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
|
---|---|---|---|---|---|
gtil_influx.py | jirisrba/gtil2-wifi | 1 | 122518 | <filename>gtil_influx.py
#!/usr/bin/env python3
""" read data from GTIL2 Wifi module
and send it to influxdb server
"""
#
# crontab
#
# */5 * * * * /usr/bin/python3 /home/pi/gtil_influx.py
#
import requests
from requests.auth import HTTPBasicAuth
from influxdb import InfluxDBClient
# GTIL invertor WiFi IP
gtil_ip = '192.168.2.205'
# influx db config
db = InfluxDBClient('192.168.2.4', 8089, use_udp=True, udp_port=8089, database='malina')
measurement = 'gtil2'
gtil_data = dict()
def read_gtil_data():
""" read data from GTIL2 Wifi module """
response = requests.get(
'http://' + gtil_ip + '/status.html',
auth=HTTPBasicAuth('admin', 'admin'))
for line in response.text.splitlines():
# var webdata_sn = "1905100904";
if line.startswith('var webdata'):
key, value = line[12:-1].split("=")
gtil_data[key.strip()] = value.strip().replace('"', '')
# print(gtil_data)
return gtil_data
def send_data_to_influx():
""" send data to influxdb """
json_body = {
"tags": {
"sn": gtil_data['sn'],
},
"points": [{
"measurement": measurement,
"fields": {
"current_power": int(gtil_data['now_p']),
"today_energy": float(gtil_data['today_e']),
"total_energy": float(gtil_data['total_e'])
}
}]
}
db.send_packet(json_body)
def main():
"""Main()"""
read_gtil_data()
send_data_to_influx()
if __name__ == "__main__":
main()
| [
1,
529,
9507,
29958,
29887,
1376,
29918,
13453,
1314,
29889,
2272,
13,
29937,
14708,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
13,
15945,
29908,
1303,
848,
515,
21342,
6227,
29906,
399,
6832,
3883,
13,
1678,
322,
3638,
372,
304,
4414,
1314,
2585,
1923,
13,
15945,
29908,
13,
13,
29937,
13,
29937,
2181,
609,
370,
13,
29937,
13,
29937,
3776,
29945,
334,
334,
334,
334,
847,
4855,
29914,
2109,
29914,
4691,
29941,
847,
5184,
29914,
1631,
29914,
29887,
1376,
29918,
13453,
1314,
29889,
2272,
13,
29937,
13,
13,
5215,
7274,
13,
3166,
7274,
29889,
5150,
1053,
7331,
16616,
6444,
13,
3166,
4414,
1314,
2585,
1053,
512,
1579,
1314,
4051,
4032,
13,
13,
29937,
21342,
6227,
21292,
272,
14570,
18800,
5641,
13,
29887,
1376,
29918,
666,
353,
525,
29896,
29929,
29906,
29889,
29896,
29953,
29947,
29889,
29906,
29889,
29906,
29900,
29945,
29915,
13,
13,
29937,
4414,
1314,
4833,
2295,
13,
2585,
353,
512,
1579,
1314,
4051,
4032,
877,
29896,
29929,
29906,
29889,
29896,
29953,
29947,
29889,
29906,
29889,
29946,
742,
29871,
29947,
29900,
29947,
29929,
29892,
671,
29918,
566,
29886,
29922,
5574,
29892,
318,
6099,
29918,
637,
29922,
29947,
29900,
29947,
29929,
29892,
2566,
2433,
5156,
1099,
1495,
13,
26658,
358,
353,
525,
29887,
1376,
29906,
29915,
13,
13,
29887,
1376,
29918,
1272,
353,
9657,
580,
13,
13,
13,
1753,
1303,
29918,
29887,
1376,
29918,
1272,
7295,
13,
29871,
9995,
1303,
848,
515,
21342,
6227,
29906,
399,
6832,
3883,
9995,
13,
13,
29871,
2933,
353,
7274,
29889,
657,
29898,
13,
418,
525,
1124,
597,
29915,
718,
330,
1376,
29918,
666,
718,
8207,
4882,
29889,
1420,
742,
13,
418,
4817,
29922,
10493,
16616,
6444,
877,
6406,
742,
525,
6406,
8785,
13,
29871,
363,
1196,
297,
2933,
29889,
726,
29889,
5451,
9012,
7295,
13,
1678,
396,
722,
1856,
1272,
29918,
16586,
353,
376,
29896,
29929,
29900,
29945,
29896,
29900,
29900,
29929,
29900,
29946,
1769,
13,
1678,
565,
1196,
29889,
27382,
2541,
877,
1707,
1856,
1272,
29374,
13,
418,
1820,
29892,
995,
353,
1196,
29961,
29896,
29906,
13018,
29896,
1822,
5451,
703,
543,
29897,
13,
418,
330,
1376,
29918,
1272,
29961,
1989,
29889,
17010,
580,
29962,
353,
995,
29889,
17010,
2141,
6506,
877,
29908,
742,
27255,
13,
13,
29871,
396,
1596,
29898,
29887,
1376,
29918,
1272,
29897,
13,
29871,
736,
330,
1376,
29918,
1272,
13,
13,
1753,
3638,
29918,
1272,
29918,
517,
29918,
13453,
1314,
7295,
13,
29871,
9995,
3638,
848,
304,
4414,
1314,
2585,
9995,
13,
29871,
4390,
29918,
2587,
353,
426,
13,
418,
376,
11338,
1115,
426,
13,
3986,
376,
16586,
1115,
330,
1376,
29918,
1272,
1839,
16586,
7464,
13,
418,
2981,
13,
418,
376,
9748,
1115,
15974,
13,
3986,
376,
26658,
358,
1115,
20039,
29892,
13,
3986,
376,
9621,
1115,
426,
13,
795,
376,
3784,
29918,
13519,
1115,
938,
29898,
29887,
1376,
29918,
1272,
1839,
3707,
29918,
29886,
2033,
511,
13,
795,
376,
27765,
29918,
27548,
1115,
5785,
29898,
29887,
1376,
29918,
1272,
1839,
27765,
29918,
29872,
2033,
511,
13,
795,
376,
7827,
29918,
27548,
1115,
5785,
29898,
29887,
1376,
29918,
1272,
1839,
7827,
29918,
29872,
11287,
13,
3986,
500,
13,
418,
500,
29962,
13,
1678,
500,
13,
13,
29871,
4833,
29889,
6717,
29918,
4058,
300,
29898,
3126,
29918,
2587,
29897,
13,
13,
13,
1753,
1667,
7295,
13,
29871,
9995,
6330,
580,
15945,
29908,
13,
13,
29871,
1303,
29918,
29887,
1376,
29918,
1272,
580,
13,
29871,
3638,
29918,
1272,
29918,
517,
29918,
13453,
1314,
580,
13,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
29871,
1667,
580,
13,
2
] |
miping/training/noGloveValueError.py | mclgoerg/MiningPersonalityInGerman | 1 | 161830 | <gh_stars>1-10
class NoGloveValueError(Exception):
"""
Raised if no value can be found in GloVe for a user's text.
"""
pass
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
1990,
1939,
29954,
417,
345,
1917,
2392,
29898,
2451,
1125,
13,
1678,
9995,
13,
1678,
390,
1759,
287,
565,
694,
995,
508,
367,
1476,
297,
21806,
29963,
29872,
363,
263,
1404,
29915,
29879,
1426,
29889,
13,
1678,
9995,
13,
1678,
1209,
13,
2
] |
cir_project/cirp_user/scripts/camera_user.py | sprkrd/UPC-MAI-CIR | 1 | 32631 | #!/usr/bin/env python
import rospy
from std_msgs.msg import String
from peyetribe import EyeTribe
import time
from cir_user.srv import UserAction, UserActionResponse
TH1 = 1280*(1.0/3)
TH2 = 1280*(2.0/3)
IP = "192.168.101.72"
class CameraUserServer:
def __init__(self):
rospy.init_node("talker")
rospy.Service("poll_action", UserAction, self._action_cb)
self._next_action = None
# self._tracker = EyeTribe()
# self._tracker.connect(IP)
# self._tracker.pullmode()
def _action_cb(self, req):
rate = rospy.Rate(10)
action = self._next_action
while action is None:
rate.sleep()
action = self._next_action
self._next_action = None
return UserActionResponse(action=action)
def set_next_action(self):
inp = raw_input("Action: ")
self._next_action = inp
# inp = raw_input("Press p or d: ").strip()
# while inp not in ("p", "d"):
# inp = raw_input("Unknown action {}. Press p or d: ".format(inp)).strip()
# data_str = str(self._tracker.next()._avg)
# x_coord = float(data_str.split(";")[0])
# rospy.loginfo("x_coord=" + str(x_coord))
# if x_coord < TH1:
# direction = "L"
# elif x_coord < TH2:
# direction = "M"
# else:
# direction = "R"
# if inp == "p": # Pick action
# rospy.loginfo("Pick Action in coordinate:")
# action = "pick" + direction
# elif inp == "d":
# rospy.loginfo("Drop Action in coordinate:")
# action = "put" + direction
# if action == "putM": # Invalid action
# action = ""
# self._next_action = action
def shutdown(self):
self._tracker.close()
if __name__ == '__main__':
try:
user = CameraUserServer()
while True:
user.set_next_action()
except rospy.ROSInterruptException:
pass
finally:
print "Shutting down server..."
user.shutdown()
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
13,
13,
5215,
696,
1028,
29891,
13,
3166,
3659,
29918,
1516,
3174,
29889,
7645,
1053,
1714,
13,
13,
3166,
282,
1032,
300,
374,
915,
1053,
382,
4099,
29565,
915,
13,
5215,
931,
13,
13,
3166,
5902,
29918,
1792,
29889,
29879,
15291,
1053,
4911,
4276,
29892,
4911,
4276,
5103,
13,
13,
4690,
29896,
353,
29871,
29896,
29906,
29947,
29900,
16395,
29896,
29889,
29900,
29914,
29941,
29897,
13,
4690,
29906,
353,
29871,
29896,
29906,
29947,
29900,
16395,
29906,
29889,
29900,
29914,
29941,
29897,
13,
13,
5690,
353,
376,
29896,
29929,
29906,
29889,
29896,
29953,
29947,
29889,
29896,
29900,
29896,
29889,
29955,
29906,
29908,
13,
13,
1990,
24321,
2659,
6004,
29901,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
696,
1028,
29891,
29889,
2344,
29918,
3177,
703,
29873,
2235,
261,
1159,
13,
4706,
696,
1028,
29891,
29889,
3170,
703,
29886,
3028,
29918,
2467,
613,
4911,
4276,
29892,
1583,
3032,
2467,
29918,
10702,
29897,
13,
4706,
1583,
3032,
4622,
29918,
2467,
353,
6213,
13,
4706,
396,
1583,
3032,
3018,
4937,
353,
382,
4099,
29565,
915,
580,
13,
4706,
396,
1583,
3032,
3018,
4937,
29889,
6915,
29898,
5690,
29897,
13,
4706,
396,
1583,
3032,
3018,
4937,
29889,
26746,
8513,
580,
13,
13,
1678,
822,
903,
2467,
29918,
10702,
29898,
1311,
29892,
12428,
1125,
13,
4706,
6554,
353,
696,
1028,
29891,
29889,
19907,
29898,
29896,
29900,
29897,
13,
4706,
3158,
353,
1583,
3032,
4622,
29918,
2467,
13,
4706,
1550,
3158,
338,
6213,
29901,
13,
9651,
6554,
29889,
17059,
580,
13,
9651,
3158,
353,
1583,
3032,
4622,
29918,
2467,
13,
9651,
1583,
3032,
4622,
29918,
2467,
353,
6213,
13,
4706,
736,
4911,
4276,
5103,
29898,
2467,
29922,
2467,
29897,
13,
13,
1678,
822,
731,
29918,
4622,
29918,
2467,
29898,
1311,
1125,
13,
4706,
297,
29886,
353,
10650,
29918,
2080,
703,
4276,
29901,
16521,
13,
4706,
1583,
3032,
4622,
29918,
2467,
353,
297,
29886,
13,
4706,
396,
297,
29886,
353,
10650,
29918,
2080,
703,
10923,
282,
470,
270,
29901,
376,
467,
17010,
580,
13,
4706,
396,
1550,
297,
29886,
451,
297,
4852,
29886,
613,
376,
29881,
29908,
1125,
13,
9651,
396,
297,
29886,
353,
10650,
29918,
2080,
703,
14148,
3158,
426,
1836,
5254,
282,
470,
270,
29901,
11393,
4830,
29898,
262,
29886,
8106,
17010,
580,
13,
4706,
396,
848,
29918,
710,
353,
851,
29898,
1311,
3032,
3018,
4937,
29889,
4622,
2141,
29918,
485,
29887,
29897,
13,
4706,
396,
921,
29918,
1111,
536,
353,
5785,
29898,
1272,
29918,
710,
29889,
5451,
703,
29936,
1159,
29961,
29900,
2314,
13,
4706,
396,
696,
1028,
29891,
29889,
1188,
3888,
703,
29916,
29918,
1111,
536,
543,
718,
851,
29898,
29916,
29918,
1111,
536,
876,
13,
4706,
396,
565,
921,
29918,
1111,
536,
529,
3446,
29896,
29901,
13,
9651,
396,
5305,
353,
376,
29931,
29908,
13,
4706,
396,
25342,
921,
29918,
1111,
536,
529,
3446,
29906,
29901,
13,
9651,
396,
5305,
353,
376,
29924,
29908,
13,
4706,
396,
1683,
29901,
13,
9651,
396,
5305,
353,
376,
29934,
29908,
13,
4706,
396,
565,
297,
29886,
1275,
376,
29886,
1115,
396,
23868,
3158,
13,
9651,
396,
696,
1028,
29891,
29889,
1188,
3888,
703,
29925,
860,
9123,
297,
14821,
29901,
1159,
13,
9651,
396,
3158,
353,
376,
23945,
29908,
718,
5305,
13,
4706,
396,
25342,
297,
29886,
1275,
376,
29881,
1115,
13,
9651,
396,
696,
1028,
29891,
29889,
1188,
3888,
703,
15063,
9123,
297,
14821,
29901,
1159,
13,
9651,
396,
3158,
353,
376,
649,
29908,
718,
5305,
13,
4706,
396,
565,
3158,
1275,
376,
649,
29924,
1115,
396,
21403,
3158,
13,
9651,
396,
3158,
353,
5124,
13,
4706,
396,
1583,
3032,
4622,
29918,
2467,
353,
3158,
13,
13,
1678,
822,
12522,
3204,
29898,
1311,
1125,
13,
4706,
1583,
3032,
3018,
4937,
29889,
5358,
580,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
1018,
29901,
13,
4706,
1404,
353,
24321,
2659,
6004,
580,
13,
4706,
1550,
5852,
29901,
13,
9651,
1404,
29889,
842,
29918,
4622,
29918,
2467,
580,
13,
1678,
5174,
696,
1028,
29891,
29889,
1672,
29903,
4074,
6685,
2451,
29901,
13,
4706,
1209,
13,
1678,
7146,
29901,
13,
4706,
1596,
376,
2713,
329,
1259,
1623,
1923,
17794,
13,
4706,
1404,
29889,
845,
329,
3204,
580,
13,
13,
2
] |
Scripts/Maperipy/CreateOruxMapLite.py | cojalvo/Map | 2 | 129462 | <reponame>cojalvo/Map
import os, os.path, datetime, string, errno
from maperipy import *
import GenIsraelHikingTilesLite
# http://stackoverflow.com/questions/749711/how-to-get-the-python-exe-location-programmatically
MaperitiveDir = os.path.dirname(os.path.dirname(os.path.normpath(os.__file__)))
# App.log('MaperitiveDir: ' + MaperitiveDir)
ProgramFiles = os.path.normpath(os.path.dirname(MaperitiveDir))
# App.log('ProgramFiles: ' + ProgramFiles)
IsraelHikingDir = os.path.dirname(os.path.dirname(os.path.normpath(App.script_dir)))
# App.log('App.script_dir: ' + App.script_dir)
# App.log('IsraelHikingDir: ' + IsraelHikingDir)
App.run_command('change-dir dir="' + IsraelHikingDir +'"')
os.chdir(IsraelHikingDir)
# # Keep the name of the Tile Upload command
# upload_tiles = os.path.join(IsraelHikingDir, "Scripts", "Batch", "UploadTiles.bat")
def mkdir_p(path):
try:
os.makedirs(path)
except OSError as exc: # Python >2.5
if exc.errno == errno.EEXIST and os.path.isdir(path):
pass
else: raise
def add_to_PATH(app_dir):
full_app_dir=os.path.join(ProgramFiles, app_dir)
for path_dir in (string.split(os.environ["PATH"], os.pathsep)):
if os.path.basename(path_dir) == app_dir:
# Application already found in PATH
return
if not os.path.isdir(full_app_dir):
# Application not a sibling of Maperitive
App.log("Warning: " + app_dir + " location not found. Could not add it to PATH.")
return
os.environ["PATH"] = string.join([os.environ["PATH"],full_app_dir], os.pathsep)
# Keep batch windows open up to 24 hours
os.environ["NOPAUSE"] = "TIMEOUT /T 86400"
# os.rmdir(os.path.join(IsraelHikingDir, 'Site', 'Tiles_Lite' ))
gen_cmd = GenIsraelHikingTilesLite.IsraelHikingTileGenCommand()
App.run_command("run-script file=" + os.path.join("Scripts", "Maperitive", "IsraelHikingLite.mscript"))
# Map Created
#Original# App.run_command("generate-tiles minzoom=7 maxzoom=15 subpixel=3 tilesdir=" + IsraelHikingDir + "\Site\Tiles use-fprint=true")
gen_cmd.GenToDirectory(16, 16, os.path.join(IsraelHikingDir, 'Site', 'Tiles_Lite'))
App.collect_garbage()
| [
1,
529,
276,
1112,
420,
29958,
1111,
12429,
1365,
29914,
3388,
13,
5215,
2897,
29892,
2897,
29889,
2084,
29892,
12865,
29892,
1347,
29892,
4589,
1217,
13,
3166,
2910,
261,
666,
29891,
1053,
334,
13,
5215,
5739,
3624,
9058,
29950,
638,
292,
29911,
5475,
29931,
568,
13,
13,
29937,
1732,
597,
2417,
29889,
510,
29914,
2619,
29914,
29955,
29946,
29929,
29955,
29896,
29896,
29914,
3525,
29899,
517,
29899,
657,
29899,
1552,
29899,
4691,
29899,
8097,
29899,
5479,
29899,
8860,
20300,
13,
3388,
261,
3321,
9170,
353,
2897,
29889,
2084,
29889,
25721,
29898,
359,
29889,
2084,
29889,
25721,
29898,
359,
29889,
2084,
29889,
12324,
2084,
29898,
359,
17255,
1445,
1649,
4961,
13,
29937,
2401,
29889,
1188,
877,
3388,
261,
3321,
9170,
29901,
525,
718,
341,
7202,
3321,
9170,
29897,
13,
9283,
10547,
353,
2897,
29889,
2084,
29889,
12324,
2084,
29898,
359,
29889,
2084,
29889,
25721,
29898,
3388,
261,
3321,
9170,
876,
13,
29937,
2401,
29889,
1188,
877,
9283,
10547,
29901,
525,
718,
7835,
10547,
29897,
13,
3624,
9058,
29950,
638,
292,
9170,
353,
2897,
29889,
2084,
29889,
25721,
29898,
359,
29889,
2084,
29889,
25721,
29898,
359,
29889,
2084,
29889,
12324,
2084,
29898,
2052,
29889,
2154,
29918,
3972,
4961,
13,
29937,
2401,
29889,
1188,
877,
2052,
29889,
2154,
29918,
3972,
29901,
525,
718,
2401,
29889,
2154,
29918,
3972,
29897,
13,
29937,
2401,
29889,
1188,
877,
3624,
9058,
29950,
638,
292,
9170,
29901,
525,
718,
11996,
29950,
638,
292,
9170,
29897,
13,
2052,
29889,
3389,
29918,
6519,
877,
3167,
29899,
3972,
4516,
543,
29915,
718,
11996,
29950,
638,
292,
9170,
718,
11838,
1495,
13,
359,
29889,
305,
3972,
29898,
3624,
9058,
29950,
638,
292,
9170,
29897,
13,
13,
29937,
396,
19152,
278,
1024,
310,
278,
323,
488,
5020,
1359,
1899,
13,
29937,
6441,
29918,
1376,
267,
353,
2897,
29889,
2084,
29889,
7122,
29898,
3624,
9058,
29950,
638,
292,
9170,
29892,
376,
4081,
29879,
613,
376,
23145,
613,
376,
17553,
29911,
5475,
29889,
10222,
1159,
13,
13,
1753,
29356,
29918,
29886,
29898,
2084,
1125,
13,
1678,
1018,
29901,
13,
4706,
2897,
29889,
29885,
12535,
12935,
29898,
2084,
29897,
13,
1678,
5174,
438,
29173,
408,
5566,
29901,
396,
5132,
1405,
29906,
29889,
29945,
13,
4706,
565,
5566,
29889,
3127,
1217,
1275,
4589,
1217,
29889,
29923,
5746,
9047,
322,
2897,
29889,
2084,
29889,
275,
3972,
29898,
2084,
1125,
13,
9651,
1209,
13,
4706,
1683,
29901,
12020,
13,
13,
1753,
788,
29918,
517,
29918,
10145,
29898,
932,
29918,
3972,
1125,
13,
1678,
2989,
29918,
932,
29918,
3972,
29922,
359,
29889,
2084,
29889,
7122,
29898,
9283,
10547,
29892,
623,
29918,
3972,
29897,
13,
1678,
363,
2224,
29918,
3972,
297,
313,
1807,
29889,
5451,
29898,
359,
29889,
21813,
3366,
10145,
12436,
2897,
29889,
2084,
19570,
22164,
13,
4706,
565,
2897,
29889,
2084,
29889,
6500,
3871,
29898,
2084,
29918,
3972,
29897,
1275,
623,
29918,
3972,
29901,
13,
9651,
396,
8427,
2307,
1476,
297,
23611,
13,
9651,
736,
13,
1678,
565,
451,
2897,
29889,
2084,
29889,
275,
3972,
29898,
8159,
29918,
932,
29918,
3972,
1125,
13,
4706,
396,
8427,
451,
263,
27767,
1847,
310,
341,
7202,
3321,
13,
4706,
2401,
29889,
1188,
703,
22709,
29901,
376,
718,
623,
29918,
3972,
718,
376,
4423,
451,
1476,
29889,
6527,
451,
788,
372,
304,
23611,
23157,
13,
4706,
736,
13,
1678,
2897,
29889,
21813,
3366,
10145,
3108,
353,
1347,
29889,
7122,
4197,
359,
29889,
21813,
3366,
10145,
12436,
8159,
29918,
932,
29918,
3972,
1402,
2897,
29889,
2084,
19570,
29897,
13,
13,
13,
13,
29937,
19152,
9853,
5417,
1722,
701,
304,
29871,
29906,
29946,
6199,
13,
359,
29889,
21813,
3366,
29940,
4590,
29909,
17171,
3108,
353,
376,
15307,
12015,
847,
29911,
29871,
29947,
29953,
29946,
29900,
29900,
29908,
13,
13,
29937,
2897,
29889,
1758,
3972,
29898,
359,
29889,
2084,
29889,
7122,
29898,
3624,
9058,
29950,
638,
292,
9170,
29892,
525,
17033,
742,
525,
29911,
5475,
29918,
29931,
568,
29915,
29871,
876,
13,
13,
1885,
29918,
9006,
353,
29871,
5739,
3624,
9058,
29950,
638,
292,
29911,
5475,
29931,
568,
29889,
3624,
9058,
29950,
638,
292,
29911,
488,
15462,
6255,
580,
13,
13,
2052,
29889,
3389,
29918,
6519,
703,
3389,
29899,
2154,
934,
543,
718,
2897,
29889,
2084,
29889,
7122,
703,
4081,
29879,
613,
376,
3388,
261,
3321,
613,
376,
3624,
9058,
29950,
638,
292,
29931,
568,
29889,
1516,
924,
5783,
13,
29937,
7315,
6760,
630,
13,
29937,
26036,
29937,
2401,
29889,
3389,
29918,
6519,
703,
17158,
29899,
1376,
267,
1375,
2502,
290,
29922,
29955,
4236,
2502,
290,
29922,
29896,
29945,
1014,
29886,
15711,
29922,
29941,
260,
5475,
3972,
543,
718,
11996,
29950,
638,
292,
9170,
718,
6634,
17033,
29905,
29911,
5475,
671,
29899,
29888,
2158,
29922,
3009,
1159,
13,
1885,
29918,
9006,
29889,
15462,
1762,
9882,
29898,
29896,
29953,
29892,
29871,
29896,
29953,
29892,
2897,
29889,
2084,
29889,
7122,
29898,
3624,
9058,
29950,
638,
292,
9170,
29892,
525,
17033,
742,
525,
29911,
5475,
29918,
29931,
568,
8785,
13,
2052,
29889,
15914,
29918,
5397,
17807,
580,
13,
13,
13,
2
] |
concat_csv.py | jweckman/vim | 0 | 22607 | import pandas as pd
from pathlib import Path
import sys
''' Concatenates all csv files in the folder passed to stdin '''
path = Path(sys.argv[1])
def get_csv_paths(path):
return [p for p in path.iterdir() if p.suffix == '.csv']
def ask_details():
print('Please specify the following:')
encoding = input('Encoding\n')
delimiter = input('Delimiter\n')
return encoding, delimiter
def get_frames(files_list, encoding, delimiter):
return [pd.read_csv(p, sep=delimiter, dtype='str', encoding=encoding) for p in csv_files]
def concat_output(frames):
output = pd.DataFrame()
for df in frames:
output = pd.concat([output,df])
path_out = path / 'COMBINED.csv'
output.to_csv(path_out, sep=';', index=False)
if __name__ == '__main__':
csv_files = get_csv_paths(path)
encoding, delimiter = ask_details()
try:
frames = get_frames(csv_files, encoding, delimiter)
concat_output(frames)
except Exception as e:
print('Seems like there were files that could not be read\n')
print(str(e))
encoding, delimiter = ask_details()
frames = get_frames(csv_files, encoding, delimiter)
concat_output(frames)
| [
1,
1053,
11701,
408,
10518,
30004,
13,
3166,
2224,
1982,
1053,
10802,
30004,
13,
5215,
10876,
30004,
13,
30004,
13,
12008,
23924,
2579,
1078,
599,
11799,
2066,
297,
278,
4138,
4502,
304,
3659,
262,
14550,
30004,
13,
30004,
13,
2084,
353,
10802,
29898,
9675,
29889,
19218,
29961,
29896,
2314,
30004,
13,
30004,
13,
1753,
679,
29918,
7638,
29918,
24772,
29898,
2084,
1125,
30004,
13,
1678,
736,
518,
29886,
363,
282,
297,
2224,
29889,
1524,
3972,
580,
565,
282,
29889,
2146,
600,
861,
1275,
15300,
7638,
2033,
30004,
13,
30004,
13,
1753,
2244,
29918,
14144,
7295,
30004,
13,
1678,
1596,
877,
12148,
6084,
278,
1494,
29901,
1495,
30004,
13,
1678,
8025,
353,
1881,
877,
14934,
29905,
29876,
1495,
30004,
13,
1678,
28552,
353,
1881,
877,
13157,
19657,
29905,
29876,
1495,
30004,
13,
30004,
13,
1678,
736,
8025,
29892,
28552,
30004,
13,
30004,
13,
1753,
679,
29918,
19935,
29898,
5325,
29918,
1761,
29892,
8025,
29892,
28552,
1125,
30004,
13,
1678,
736,
518,
15926,
29889,
949,
29918,
7638,
29898,
29886,
29892,
16345,
29922,
6144,
19657,
29892,
26688,
2433,
710,
742,
8025,
29922,
22331,
29897,
363,
282,
297,
11799,
29918,
5325,
29962,
30004,
13,
30004,
13,
1753,
3022,
271,
29918,
4905,
29898,
19935,
1125,
30004,
13,
1678,
1962,
353,
10518,
29889,
17271,
26471,
13,
1678,
363,
4489,
297,
16608,
29901,
30004,
13,
4706,
1962,
353,
10518,
29889,
17685,
4197,
4905,
29892,
2176,
2314,
30004,
13,
1678,
2224,
29918,
449,
353,
2224,
847,
525,
3217,
9486,
1177,
3352,
29889,
7638,
29915,
30004,
13,
1678,
1962,
29889,
517,
29918,
7638,
29898,
2084,
29918,
449,
29892,
16345,
2433,
29936,
742,
2380,
29922,
8824,
8443,
13,
30004,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
30004,
13,
1678,
11799,
29918,
5325,
353,
679,
29918,
7638,
29918,
24772,
29898,
2084,
8443,
13,
1678,
8025,
29892,
28552,
353,
2244,
29918,
14144,
26471,
13,
1678,
1018,
29901,
30004,
13,
4706,
16608,
353,
679,
29918,
19935,
29898,
7638,
29918,
5325,
29892,
8025,
29892,
28552,
8443,
13,
4706,
3022,
271,
29918,
4905,
29898,
19935,
8443,
13,
1678,
5174,
8960,
408,
321,
29901,
30004,
13,
4706,
1596,
877,
2008,
1567,
763,
727,
892,
2066,
393,
1033,
451,
367,
1303,
29905,
29876,
1495,
30004,
13,
4706,
1596,
29898,
710,
29898,
29872,
876,
30004,
13,
4706,
8025,
29892,
28552,
353,
2244,
29918,
14144,
26471,
13,
4706,
16608,
353,
679,
29918,
19935,
29898,
7638,
29918,
5325,
29892,
8025,
29892,
28552,
8443,
13,
4706,
3022,
271,
29918,
4905,
29898,
19935,
8443,
13,
2
] |
tests/test_fasttext_embeddings.py | CLARIN-PL/embeddings | 33 | 156341 | <gh_stars>10-100
from typing import Type
import pytest
import torch
from flair.data import Sentence
from flair.embeddings import FastTextEmbeddings, StackedEmbeddings
from torch.testing import assert_close as assert_close
from embeddings.embedding.flair_embedding import FlairDocumentPoolEmbedding
from embeddings.embedding.static.embedding import (
AutoStaticDocumentEmbedding,
AutoStaticWordEmbedding,
)
from embeddings.embedding.static.fasttext import KGR10FastTextConfig, KGR10FastTextEmbedding
from embeddings.utils.utils import import_from_string
def test_fasttext_embeddings_close(dummy_fasttext_config: KGR10FastTextConfig) -> None:
config = dummy_fasttext_config
cls: Type[KGR10FastTextEmbedding] = import_from_string(config.model_type_reference)
embedding = cls(config)
assert_close_embedding_word(embedding)
def test_krg10_fasttext_default_config() -> None:
config = KGR10FastTextConfig()
assert config.model_name == "kgr10.plain.skipgram.dim300.neg10.bin"
def test_init_kgr10_fasttext_from_config(dummy_fasttext_config: KGR10FastTextConfig) -> None:
config = dummy_fasttext_config
embedding = KGR10FastTextEmbedding.from_config(config)
assert_close_embedding_word(embedding)
def test_static_automodel_word_fast_text(dummy_fasttext_config: KGR10FastTextConfig) -> None:
config = dummy_fasttext_config
embedding = AutoStaticWordEmbedding.from_config(config=config)
assert isinstance(embedding, KGR10FastTextEmbedding)
assert_close_embedding_word(embedding)
@pytest.fixture
def automodel_document_fast_text(
dummy_fasttext_config: KGR10FastTextConfig,
) -> FlairDocumentPoolEmbedding:
config = dummy_fasttext_config
return AutoStaticDocumentEmbedding.from_config(config=config)
def test_static_automodel_document_fast_text_structure(
automodel_document_fast_text: KGR10FastTextEmbedding,
) -> None:
embedding = automodel_document_fast_text
assert isinstance(embedding, FlairDocumentPoolEmbedding)
assert isinstance(embedding.word_embedding, KGR10FastTextEmbedding)
assert isinstance(embedding.model.embeddings, StackedEmbeddings)
assert len(embedding.model.embeddings.embeddings) == 1
assert isinstance(embedding.model.embeddings.embeddings[0], FastTextEmbeddings)
def test_static_automodel_document_fast_text_close(
automodel_document_fast_text: KGR10FastTextEmbedding,
) -> None:
embedding = automodel_document_fast_text
assert_close_embedding_word(embedding, assert_doc_embedding_empty=False)
assert_close_embedding_document(embedding)
def assert_close_embedding_word(
embedding: KGR10FastTextEmbedding, assert_doc_embedding_empty: bool = True
) -> None:
sentence = Sentence("Polska należy do Unii Europejskiej.")
embedding.embed([sentence])
assert all(token.embedding.shape == (100,) for token in sentence)
tokens_embeddings = torch.stack([token.embedding for token in sentence])
assert_close(
tokens_embeddings[:, :5].clone(),
torch.Tensor(
[
[-1.5600e-03, 7.7694e-03, 4.0358e-03, -3.9865e-03, 1.0068e-02],
[1.9560e-04, 5.9088e-03, 4.6389e-03, -4.8860e-04, 5.7465e-03],
[1.5331e-03, 6.9973e-03, -1.2511e-03, -6.6496e-03, 1.7792e-03],
[-5.3175e-04, 6.8117e-04, 4.8832e-05, -1.9572e-04, 6.4091e-04],
[-9.3253e-04, 2.3494e-03, 1.8994e-03, -1.3316e-03, 1.6869e-03],
[9.7278e-03, -1.8942e-03, 6.4082e-03, -4.4753e-03, 1.2305e-02],
]
),
atol=1e-6,
rtol=0,
)
torch.testing.assert_close(
tokens_embeddings.mean(dim=1),
torch.Tensor([7.9601e-04, 7.0972e-04, 4.8373e-05, 2.1889e-05, 2.7810e-04, 9.9517e-04]),
atol=1e-6,
rtol=0,
)
torch.testing.assert_close(
tokens_embeddings.std(dim=1),
torch.Tensor([0.0045, 0.0029, 0.0036, 0.0019, 0.0020, 0.0058]),
atol=1e-4,
rtol=0,
)
if assert_doc_embedding_empty:
assert sentence.embedding.shape == (0,)
def assert_close_embedding_document(embedding: KGR10FastTextEmbedding) -> None:
sentence = Sentence("Polska należy do Unii Europejskiej.")
embedding.embed([sentence])
document_embedding = sentence.embedding
assert document_embedding.shape == (100,)
assert_close(
document_embedding[:5].clone(),
torch.Tensor([0.0014, 0.0036, 0.0026, -0.0029, 0.0054]),
atol=1e-4,
rtol=0,
)
torch.testing.assert_close(
document_embedding.mean().item(),
0.0005,
atol=1e-4,
rtol=0,
)
torch.testing.assert_close(
document_embedding.std().item(),
0.0023,
atol=1e-4,
rtol=0,
)
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29900,
29899,
29896,
29900,
29900,
13,
3166,
19229,
1053,
5167,
13,
13,
5215,
11451,
1688,
13,
5215,
4842,
305,
13,
3166,
17422,
381,
29889,
1272,
1053,
28048,
663,
13,
3166,
17422,
381,
29889,
17987,
29881,
886,
1053,
23786,
1626,
6026,
2580,
29881,
886,
29892,
10292,
287,
6026,
2580,
29881,
886,
13,
3166,
4842,
305,
29889,
13424,
1053,
4974,
29918,
5358,
408,
4974,
29918,
5358,
13,
13,
3166,
8297,
29881,
886,
29889,
17987,
8497,
29889,
29888,
433,
381,
29918,
17987,
8497,
1053,
383,
433,
381,
6268,
11426,
6026,
2580,
8497,
13,
3166,
8297,
29881,
886,
29889,
17987,
8497,
29889,
7959,
29889,
17987,
8497,
1053,
313,
13,
1678,
11133,
17046,
6268,
6026,
2580,
8497,
29892,
13,
1678,
11133,
17046,
14463,
6026,
2580,
8497,
29892,
13,
29897,
13,
3166,
8297,
29881,
886,
29889,
17987,
8497,
29889,
7959,
29889,
11255,
726,
1053,
476,
14345,
29896,
29900,
29943,
579,
1626,
3991,
29892,
476,
14345,
29896,
29900,
29943,
579,
1626,
6026,
2580,
8497,
13,
3166,
8297,
29881,
886,
29889,
13239,
29889,
13239,
1053,
1053,
29918,
3166,
29918,
1807,
13,
13,
13,
1753,
1243,
29918,
11255,
726,
29918,
17987,
29881,
886,
29918,
5358,
29898,
29881,
11770,
29918,
11255,
726,
29918,
2917,
29901,
476,
14345,
29896,
29900,
29943,
579,
1626,
3991,
29897,
1599,
6213,
29901,
13,
1678,
2295,
353,
20254,
29918,
11255,
726,
29918,
2917,
13,
1678,
1067,
29879,
29901,
5167,
29961,
29968,
14345,
29896,
29900,
29943,
579,
1626,
6026,
2580,
8497,
29962,
353,
1053,
29918,
3166,
29918,
1807,
29898,
2917,
29889,
4299,
29918,
1853,
29918,
5679,
29897,
13,
1678,
23655,
353,
1067,
29879,
29898,
2917,
29897,
13,
1678,
4974,
29918,
5358,
29918,
17987,
8497,
29918,
1742,
29898,
17987,
8497,
29897,
13,
13,
13,
1753,
1243,
29918,
29895,
11007,
29896,
29900,
29918,
11255,
726,
29918,
4381,
29918,
2917,
580,
1599,
6213,
29901,
13,
1678,
2295,
353,
476,
14345,
29896,
29900,
29943,
579,
1626,
3991,
580,
13,
1678,
4974,
2295,
29889,
4299,
29918,
978,
1275,
376,
29895,
629,
29896,
29900,
29889,
24595,
29889,
11014,
1393,
29889,
6229,
29941,
29900,
29900,
29889,
10052,
29896,
29900,
29889,
2109,
29908,
13,
13,
13,
1753,
1243,
29918,
2344,
29918,
29895,
629,
29896,
29900,
29918,
11255,
726,
29918,
3166,
29918,
2917,
29898,
29881,
11770,
29918,
11255,
726,
29918,
2917,
29901,
476,
14345,
29896,
29900,
29943,
579,
1626,
3991,
29897,
1599,
6213,
29901,
13,
1678,
2295,
353,
20254,
29918,
11255,
726,
29918,
2917,
13,
1678,
23655,
353,
476,
14345,
29896,
29900,
29943,
579,
1626,
6026,
2580,
8497,
29889,
3166,
29918,
2917,
29898,
2917,
29897,
13,
1678,
4974,
29918,
5358,
29918,
17987,
8497,
29918,
1742,
29898,
17987,
8497,
29897,
13,
13,
13,
1753,
1243,
29918,
7959,
29918,
17405,
27224,
29918,
1742,
29918,
11255,
29918,
726,
29898,
29881,
11770,
29918,
11255,
726,
29918,
2917,
29901,
476,
14345,
29896,
29900,
29943,
579,
1626,
3991,
29897,
1599,
6213,
29901,
13,
1678,
2295,
353,
20254,
29918,
11255,
726,
29918,
2917,
13,
1678,
23655,
353,
11133,
17046,
14463,
6026,
2580,
8497,
29889,
3166,
29918,
2917,
29898,
2917,
29922,
2917,
29897,
13,
1678,
4974,
338,
8758,
29898,
17987,
8497,
29892,
476,
14345,
29896,
29900,
29943,
579,
1626,
6026,
2580,
8497,
29897,
13,
1678,
4974,
29918,
5358,
29918,
17987,
8497,
29918,
1742,
29898,
17987,
8497,
29897,
13,
13,
13,
29992,
2272,
1688,
29889,
7241,
15546,
13,
1753,
3345,
27224,
29918,
3225,
29918,
11255,
29918,
726,
29898,
13,
1678,
20254,
29918,
11255,
726,
29918,
2917,
29901,
476,
14345,
29896,
29900,
29943,
579,
1626,
3991,
29892,
13,
29897,
1599,
383,
433,
381,
6268,
11426,
6026,
2580,
8497,
29901,
13,
1678,
2295,
353,
20254,
29918,
11255,
726,
29918,
2917,
13,
1678,
736,
11133,
17046,
6268,
6026,
2580,
8497,
29889,
3166,
29918,
2917,
29898,
2917,
29922,
2917,
29897,
13,
13,
13,
1753,
1243,
29918,
7959,
29918,
17405,
27224,
29918,
3225,
29918,
11255,
29918,
726,
29918,
23905,
29898,
13,
1678,
3345,
27224,
29918,
3225,
29918,
11255,
29918,
726,
29901,
476,
14345,
29896,
29900,
29943,
579,
1626,
6026,
2580,
8497,
29892,
13,
29897,
1599,
6213,
29901,
13,
1678,
23655,
353,
3345,
27224,
29918,
3225,
29918,
11255,
29918,
726,
13,
1678,
4974,
338,
8758,
29898,
17987,
8497,
29892,
383,
433,
381,
6268,
11426,
6026,
2580,
8497,
29897,
13,
1678,
4974,
338,
8758,
29898,
17987,
8497,
29889,
1742,
29918,
17987,
8497,
29892,
476,
14345,
29896,
29900,
29943,
579,
1626,
6026,
2580,
8497,
29897,
13,
1678,
4974,
338,
8758,
29898,
17987,
8497,
29889,
4299,
29889,
17987,
29881,
886,
29892,
10292,
287,
6026,
2580,
29881,
886,
29897,
13,
1678,
4974,
7431,
29898,
17987,
8497,
29889,
4299,
29889,
17987,
29881,
886,
29889,
17987,
29881,
886,
29897,
1275,
29871,
29896,
13,
1678,
4974,
338,
8758,
29898,
17987,
8497,
29889,
4299,
29889,
17987,
29881,
886,
29889,
17987,
29881,
886,
29961,
29900,
1402,
23786,
1626,
6026,
2580,
29881,
886,
29897,
13,
13,
13,
1753,
1243,
29918,
7959,
29918,
17405,
27224,
29918,
3225,
29918,
11255,
29918,
726,
29918,
5358,
29898,
13,
1678,
3345,
27224,
29918,
3225,
29918,
11255,
29918,
726,
29901,
476,
14345,
29896,
29900,
29943,
579,
1626,
6026,
2580,
8497,
29892,
13,
29897,
1599,
6213,
29901,
13,
1678,
23655,
353,
3345,
27224,
29918,
3225,
29918,
11255,
29918,
726,
13,
1678,
4974,
29918,
5358,
29918,
17987,
8497,
29918,
1742,
29898,
17987,
8497,
29892,
4974,
29918,
1514,
29918,
17987,
8497,
29918,
6310,
29922,
8824,
29897,
13,
1678,
4974,
29918,
5358,
29918,
17987,
8497,
29918,
3225,
29898,
17987,
8497,
29897,
13,
13,
13,
1753,
4974,
29918,
5358,
29918,
17987,
8497,
29918,
1742,
29898,
13,
1678,
23655,
29901,
476,
14345,
29896,
29900,
29943,
579,
1626,
6026,
2580,
8497,
29892,
4974,
29918,
1514,
29918,
17987,
8497,
29918,
6310,
29901,
6120,
353,
5852,
13,
29897,
1599,
6213,
29901,
13,
1678,
10541,
353,
28048,
663,
703,
7713,
4621,
302,
744,
7558,
437,
853,
2236,
4092,
29926,
8779,
23157,
13,
1678,
23655,
29889,
17987,
4197,
18616,
663,
2314,
13,
13,
1678,
4974,
599,
29898,
6979,
29889,
17987,
8497,
29889,
12181,
1275,
313,
29896,
29900,
29900,
29892,
29897,
363,
5993,
297,
10541,
29897,
13,
1678,
18897,
29918,
17987,
29881,
886,
353,
4842,
305,
29889,
1429,
4197,
6979,
29889,
17987,
8497,
363,
5993,
297,
10541,
2314,
13,
13,
1678,
4974,
29918,
5358,
29898,
13,
4706,
18897,
29918,
17987,
29881,
886,
7503,
29892,
584,
29945,
1822,
16513,
3285,
13,
4706,
4842,
305,
29889,
29911,
6073,
29898,
13,
9651,
518,
13,
18884,
21069,
29896,
29889,
29945,
29953,
29900,
29900,
29872,
29899,
29900,
29941,
29892,
29871,
29955,
29889,
29955,
29953,
29929,
29946,
29872,
29899,
29900,
29941,
29892,
29871,
29946,
29889,
29900,
29941,
29945,
29947,
29872,
29899,
29900,
29941,
29892,
448,
29941,
29889,
29929,
29947,
29953,
29945,
29872,
29899,
29900,
29941,
29892,
29871,
29896,
29889,
29900,
29900,
29953,
29947,
29872,
29899,
29900,
29906,
1402,
13,
18884,
518,
29896,
29889,
29929,
29945,
29953,
29900,
29872,
29899,
29900,
29946,
29892,
29871,
29945,
29889,
29929,
29900,
29947,
29947,
29872,
29899,
29900,
29941,
29892,
29871,
29946,
29889,
29953,
29941,
29947,
29929,
29872,
29899,
29900,
29941,
29892,
448,
29946,
29889,
29947,
29947,
29953,
29900,
29872,
29899,
29900,
29946,
29892,
29871,
29945,
29889,
29955,
29946,
29953,
29945,
29872,
29899,
29900,
29941,
1402,
13,
18884,
518,
29896,
29889,
29945,
29941,
29941,
29896,
29872,
29899,
29900,
29941,
29892,
29871,
29953,
29889,
29929,
29929,
29955,
29941,
29872,
29899,
29900,
29941,
29892,
448,
29896,
29889,
29906,
29945,
29896,
29896,
29872,
29899,
29900,
29941,
29892,
448,
29953,
29889,
29953,
29946,
29929,
29953,
29872,
29899,
29900,
29941,
29892,
29871,
29896,
29889,
29955,
29955,
29929,
29906,
29872,
29899,
29900,
29941,
1402,
13,
18884,
21069,
29945,
29889,
29941,
29896,
29955,
29945,
29872,
29899,
29900,
29946,
29892,
29871,
29953,
29889,
29947,
29896,
29896,
29955,
29872,
29899,
29900,
29946,
29892,
29871,
29946,
29889,
29947,
29947,
29941,
29906,
29872,
29899,
29900,
29945,
29892,
448,
29896,
29889,
29929,
29945,
29955,
29906,
29872,
29899,
29900,
29946,
29892,
29871,
29953,
29889,
29946,
29900,
29929,
29896,
29872,
29899,
29900,
29946,
1402,
13,
18884,
21069,
29929,
29889,
29941,
29906,
29945,
29941,
29872,
29899,
29900,
29946,
29892,
29871,
29906,
29889,
29941,
29946,
29929,
29946,
29872,
29899,
29900,
29941,
29892,
29871,
29896,
29889,
29947,
29929,
29929,
29946,
29872,
29899,
29900,
29941,
29892,
448,
29896,
29889,
29941,
29941,
29896,
29953,
29872,
29899,
29900,
29941,
29892,
29871,
29896,
29889,
29953,
29947,
29953,
29929,
29872,
29899,
29900,
29941,
1402,
13,
18884,
518,
29929,
29889,
29955,
29906,
29955,
29947,
29872,
29899,
29900,
29941,
29892,
448,
29896,
29889,
29947,
29929,
29946,
29906,
29872,
29899,
29900,
29941,
29892,
29871,
29953,
29889,
29946,
29900,
29947,
29906,
29872,
29899,
29900,
29941,
29892,
448,
29946,
29889,
29946,
29955,
29945,
29941,
29872,
29899,
29900,
29941,
29892,
29871,
29896,
29889,
29906,
29941,
29900,
29945,
29872,
29899,
29900,
29906,
1402,
13,
9651,
4514,
13,
4706,
10353,
13,
4706,
472,
324,
29922,
29896,
29872,
29899,
29953,
29892,
13,
4706,
364,
25027,
29922,
29900,
29892,
13,
1678,
1723,
13,
13,
1678,
4842,
305,
29889,
13424,
29889,
9294,
29918,
5358,
29898,
13,
4706,
18897,
29918,
17987,
29881,
886,
29889,
12676,
29898,
6229,
29922,
29896,
511,
13,
4706,
4842,
305,
29889,
29911,
6073,
4197,
29955,
29889,
29929,
29953,
29900,
29896,
29872,
29899,
29900,
29946,
29892,
29871,
29955,
29889,
29900,
29929,
29955,
29906,
29872,
29899,
29900,
29946,
29892,
29871,
29946,
29889,
29947,
29941,
29955,
29941,
29872,
29899,
29900,
29945,
29892,
29871,
29906,
29889,
29896,
29947,
29947,
29929,
29872,
29899,
29900,
29945,
29892,
29871,
29906,
29889,
29955,
29947,
29896,
29900,
29872,
29899,
29900,
29946,
29892,
29871,
29929,
29889,
29929,
29945,
29896,
29955,
29872,
29899,
29900,
29946,
11724,
13,
4706,
472,
324,
29922,
29896,
29872,
29899,
29953,
29892,
13,
4706,
364,
25027,
29922,
29900,
29892,
13,
1678,
1723,
13,
13,
1678,
4842,
305,
29889,
13424,
29889,
9294,
29918,
5358,
29898,
13,
4706,
18897,
29918,
17987,
29881,
886,
29889,
4172,
29898,
6229,
29922,
29896,
511,
13,
4706,
4842,
305,
29889,
29911,
6073,
4197,
29900,
29889,
29900,
29900,
29946,
29945,
29892,
29871,
29900,
29889,
29900,
29900,
29906,
29929,
29892,
29871,
29900,
29889,
29900,
29900,
29941,
29953,
29892,
29871,
29900,
29889,
29900,
29900,
29896,
29929,
29892,
29871,
29900,
29889,
29900,
29900,
29906,
29900,
29892,
29871,
29900,
29889,
29900,
29900,
29945,
29947,
11724,
13,
4706,
472,
324,
29922,
29896,
29872,
29899,
29946,
29892,
13,
4706,
364,
25027,
29922,
29900,
29892,
13,
1678,
1723,
13,
13,
1678,
565,
4974,
29918,
1514,
29918,
17987,
8497,
29918,
6310,
29901,
13,
4706,
4974,
10541,
29889,
17987,
8497,
29889,
12181,
1275,
313,
29900,
29892,
29897,
13,
13,
13,
1753,
4974,
29918,
5358,
29918,
17987,
8497,
29918,
3225,
29898,
17987,
8497,
29901,
476,
14345,
29896,
29900,
29943,
579,
1626,
6026,
2580,
8497,
29897,
1599,
6213,
29901,
13,
1678,
10541,
353,
28048,
663,
703,
7713,
4621,
302,
744,
7558,
437,
853,
2236,
4092,
29926,
8779,
23157,
13,
1678,
23655,
29889,
17987,
4197,
18616,
663,
2314,
13,
13,
1678,
1842,
29918,
17987,
8497,
353,
10541,
29889,
17987,
8497,
13,
1678,
4974,
1842,
29918,
17987,
8497,
29889,
12181,
1275,
313,
29896,
29900,
29900,
29892,
29897,
13,
13,
1678,
4974,
29918,
5358,
29898,
13,
4706,
1842,
29918,
17987,
8497,
7503,
29945,
1822,
16513,
3285,
13,
4706,
4842,
305,
29889,
29911,
6073,
4197,
29900,
29889,
29900,
29900,
29896,
29946,
29892,
29871,
29900,
29889,
29900,
29900,
29941,
29953,
29892,
29871,
29900,
29889,
29900,
29900,
29906,
29953,
29892,
448,
29900,
29889,
29900,
29900,
29906,
29929,
29892,
29871,
29900,
29889,
29900,
29900,
29945,
29946,
11724,
13,
4706,
472,
324,
29922,
29896,
29872,
29899,
29946,
29892,
13,
4706,
364,
25027,
29922,
29900,
29892,
13,
1678,
1723,
13,
13,
1678,
4842,
305,
29889,
13424,
29889,
9294,
29918,
5358,
29898,
13,
4706,
1842,
29918,
17987,
8497,
29889,
12676,
2141,
667,
3285,
13,
308,
29900,
29889,
29900,
29900,
29900,
29945,
29892,
13,
4706,
472,
324,
29922,
29896,
29872,
29899,
29946,
29892,
13,
4706,
364,
25027,
29922,
29900,
29892,
13,
1678,
1723,
13,
13,
1678,
4842,
305,
29889,
13424,
29889,
9294,
29918,
5358,
29898,
13,
4706,
1842,
29918,
17987,
8497,
29889,
4172,
2141,
667,
3285,
13,
308,
29900,
29889,
29900,
29900,
29906,
29941,
29892,
13,
4706,
472,
324,
29922,
29896,
29872,
29899,
29946,
29892,
13,
4706,
364,
25027,
29922,
29900,
29892,
13,
1678,
1723,
13,
2
] |
validation.py | QCMM/dynqmprop | 0 | 97035 | <gh_stars>0
import sys
from dynqmprop import DynQMProp
top_file = sys.argv[1]
coords_file = sys.argv[2]
def main():
# creating objects for validation
# standard parameters:
# radius: 10
# sampling: 25
# n_charge_updates: 3
radius_param = DynQMProp(top_file, coords_file, qm_charge=+1, ligand_selection=':2', receptor_selection=':1')
# sampling_param = DynQMProp(top_file, coords_file, qm_charge=+1, ligand_selection=':2', receptor_selection=':1', radius=12, n_charge_updates=1)
# n_charge_updates_param = DynQMProp(top_file, coords_file, qm_charge=0, ligand_selection=f':1', radius=10, n_charge_updates=2, sampling_time=1, total_qm_calculations=5)
# basis_param = DynQMProp(top_file, coords_file, qm_charge=0, ligand_selection=f':1', radius=10, n_charge_updates=2, sampling_time=1, total_qm_calculations=5, method='HF')
# parameter validation run
radius_param.validation('radius', [12, 14], overwrite=True, compl=True)
# sampling_param.validation('sampling_time', [15, 20, 25, 30, 35, 40], overwrite=True)
# n_charge_updates_param.validation(
# 'n_charge_updates', [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], overwrite=True)
# basis_param.validation(
# 'basis', ['def2-SVP', 'def2-TZVP', 'cc-pVDZ', 'cc-pVTZ'], overwrite=True)
if __name__ == '__main__':
main()
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
5215,
10876,
13,
13,
3166,
270,
948,
29939,
29885,
7728,
1053,
360,
948,
29984,
29924,
20420,
13,
13,
3332,
29918,
1445,
353,
10876,
29889,
19218,
29961,
29896,
29962,
13,
1111,
4339,
29918,
1445,
353,
10876,
29889,
19218,
29961,
29906,
29962,
13,
13,
13,
1753,
1667,
7295,
13,
1678,
396,
4969,
3618,
363,
8845,
13,
1678,
396,
3918,
4128,
29901,
13,
1678,
396,
259,
11855,
29901,
29871,
29896,
29900,
13,
1678,
396,
259,
23460,
29901,
29871,
29906,
29945,
13,
1678,
396,
259,
302,
29918,
23367,
29918,
786,
15190,
29901,
29871,
29941,
13,
1678,
11855,
29918,
3207,
353,
360,
948,
29984,
29924,
20420,
29898,
3332,
29918,
1445,
29892,
1302,
4339,
29918,
1445,
29892,
3855,
29885,
29918,
23367,
29922,
29974,
29896,
29892,
14172,
392,
29918,
21731,
29922,
2396,
29906,
742,
337,
14268,
29918,
21731,
29922,
2396,
29896,
1495,
13,
1678,
396,
23460,
29918,
3207,
353,
360,
948,
29984,
29924,
20420,
29898,
3332,
29918,
1445,
29892,
1302,
4339,
29918,
1445,
29892,
3855,
29885,
29918,
23367,
29922,
29974,
29896,
29892,
14172,
392,
29918,
21731,
29922,
2396,
29906,
742,
337,
14268,
29918,
21731,
29922,
2396,
29896,
742,
11855,
29922,
29896,
29906,
29892,
302,
29918,
23367,
29918,
786,
15190,
29922,
29896,
29897,
13,
1678,
396,
302,
29918,
23367,
29918,
786,
15190,
29918,
3207,
353,
360,
948,
29984,
29924,
20420,
29898,
3332,
29918,
1445,
29892,
1302,
4339,
29918,
1445,
29892,
3855,
29885,
29918,
23367,
29922,
29900,
29892,
14172,
392,
29918,
21731,
29922,
29888,
2396,
29896,
742,
11855,
29922,
29896,
29900,
29892,
302,
29918,
23367,
29918,
786,
15190,
29922,
29906,
29892,
23460,
29918,
2230,
29922,
29896,
29892,
3001,
29918,
29939,
29885,
29918,
15807,
800,
29922,
29945,
29897,
13,
1678,
396,
8405,
29918,
3207,
353,
360,
948,
29984,
29924,
20420,
29898,
3332,
29918,
1445,
29892,
1302,
4339,
29918,
1445,
29892,
3855,
29885,
29918,
23367,
29922,
29900,
29892,
14172,
392,
29918,
21731,
29922,
29888,
2396,
29896,
742,
11855,
29922,
29896,
29900,
29892,
302,
29918,
23367,
29918,
786,
15190,
29922,
29906,
29892,
23460,
29918,
2230,
29922,
29896,
29892,
3001,
29918,
29939,
29885,
29918,
15807,
800,
29922,
29945,
29892,
1158,
2433,
29950,
29943,
1495,
13,
1678,
396,
3443,
8845,
1065,
13,
1678,
11855,
29918,
3207,
29889,
18157,
877,
13471,
742,
518,
29896,
29906,
29892,
29871,
29896,
29946,
1402,
26556,
29922,
5574,
29892,
13162,
29922,
5574,
29897,
13,
1678,
396,
23460,
29918,
3207,
29889,
18157,
877,
13445,
10335,
29918,
2230,
742,
518,
29896,
29945,
29892,
29871,
29906,
29900,
29892,
29871,
29906,
29945,
29892,
29871,
29941,
29900,
29892,
29871,
29941,
29945,
29892,
29871,
29946,
29900,
1402,
26556,
29922,
5574,
29897,
13,
1678,
396,
302,
29918,
23367,
29918,
786,
15190,
29918,
3207,
29889,
18157,
29898,
13,
1678,
396,
1678,
525,
29876,
29918,
23367,
29918,
786,
15190,
742,
518,
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,
1402,
26556,
29922,
5574,
29897,
13,
1678,
396,
8405,
29918,
3207,
29889,
18157,
29898,
13,
1678,
396,
1678,
525,
6500,
275,
742,
6024,
1753,
29906,
29899,
7597,
29925,
742,
525,
1753,
29906,
29899,
29911,
29999,
18510,
742,
525,
617,
29899,
29886,
10699,
29999,
742,
525,
617,
29899,
29886,
29963,
29911,
29999,
7464,
26556,
29922,
5574,
29897,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
1667,
580,
13,
2
] |
dev/tasks/run.py | MasonData/dev | 12 | 1611918 | <gh_stars>10-100
from typing import Any, Optional
from schema import Optional as SchemaOptional
from schema import Or, Schema
from dev.exceptions import NonZeroReturnCodeError
from dev.helpers import run_command
from dev.task import Task
class Run(Task):
__schema__ = Schema(
Or(
# - run: date
str,
# - run:
# - date
# - date
[str],
# - run:
# command: echo $SCOPE
# env:
# SCOPE: something
{
'command': Or(str, [str]),
SchemaOptional('env'): {str: str},
SchemaOptional('if'): str,
},
)
)
__description__ = 'Run shell args'
def up(self, args: Optional[Any], extra_args: Optional[Any]) -> None:
if not args:
return
if isinstance(args, dict):
env = args.get('env')
if_command = args.get('if')
commands_from_args = args['command']
else:
env = None
if_command = None
commands_from_args = args
if isinstance(commands_from_args, str):
commands = [commands_from_args]
else:
commands = commands_from_args
if if_command:
try:
run_command(if_command, silent=True)
except NonZeroReturnCodeError:
... # If test failed - run command
else:
return # If test succeeded - do not run command
for command in commands:
full_command: str = command
if extra_args:
full_command += " " + " ".join(extra_args)
run_command(full_command, env=env)
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29900,
29899,
29896,
29900,
29900,
13,
3166,
19229,
1053,
3139,
29892,
28379,
13,
13,
3166,
10938,
1053,
28379,
408,
1102,
2603,
27636,
13,
3166,
10938,
1053,
1394,
29892,
1102,
2603,
13,
13,
3166,
2906,
29889,
11739,
29879,
1053,
10050,
24214,
11609,
3399,
2392,
13,
3166,
2906,
29889,
3952,
6774,
1053,
1065,
29918,
6519,
13,
3166,
2906,
29889,
7662,
1053,
9330,
13,
13,
13,
1990,
7525,
29898,
5398,
1125,
13,
1678,
4770,
11010,
1649,
353,
1102,
2603,
29898,
13,
4706,
1394,
29898,
13,
9651,
396,
448,
1065,
29901,
2635,
13,
9651,
851,
29892,
13,
9651,
396,
448,
1065,
29901,
13,
9651,
396,
268,
448,
2635,
13,
9651,
396,
268,
448,
2635,
13,
9651,
518,
710,
1402,
13,
9651,
396,
448,
1065,
29901,
13,
9651,
396,
268,
1899,
29901,
2916,
395,
29903,
3217,
4162,
13,
9651,
396,
268,
8829,
29901,
13,
9651,
396,
539,
317,
3217,
4162,
29901,
1554,
13,
9651,
426,
13,
18884,
525,
6519,
2396,
1394,
29898,
710,
29892,
518,
710,
11724,
13,
18884,
1102,
2603,
27636,
877,
6272,
29374,
426,
710,
29901,
851,
1118,
13,
18884,
1102,
2603,
27636,
877,
361,
29374,
851,
29892,
13,
9651,
2981,
13,
4706,
1723,
13,
1678,
1723,
13,
1678,
4770,
8216,
1649,
353,
525,
6558,
6473,
6389,
29915,
13,
13,
1678,
822,
701,
29898,
1311,
29892,
6389,
29901,
28379,
29961,
10773,
1402,
4805,
29918,
5085,
29901,
28379,
29961,
10773,
2314,
1599,
6213,
29901,
13,
4706,
565,
451,
6389,
29901,
13,
9651,
736,
13,
13,
4706,
565,
338,
8758,
29898,
5085,
29892,
9657,
1125,
13,
9651,
8829,
353,
6389,
29889,
657,
877,
6272,
1495,
13,
9651,
565,
29918,
6519,
353,
6389,
29889,
657,
877,
361,
1495,
13,
9651,
8260,
29918,
3166,
29918,
5085,
353,
6389,
1839,
6519,
2033,
13,
4706,
1683,
29901,
13,
9651,
8829,
353,
6213,
13,
9651,
565,
29918,
6519,
353,
6213,
13,
9651,
8260,
29918,
3166,
29918,
5085,
353,
6389,
13,
13,
4706,
565,
338,
8758,
29898,
26381,
29918,
3166,
29918,
5085,
29892,
851,
1125,
13,
9651,
8260,
353,
518,
26381,
29918,
3166,
29918,
5085,
29962,
13,
4706,
1683,
29901,
13,
9651,
8260,
353,
8260,
29918,
3166,
29918,
5085,
13,
13,
4706,
565,
565,
29918,
6519,
29901,
13,
9651,
1018,
29901,
13,
18884,
1065,
29918,
6519,
29898,
361,
29918,
6519,
29892,
17436,
29922,
5574,
29897,
13,
9651,
5174,
10050,
24214,
11609,
3399,
2392,
29901,
13,
18884,
2023,
29871,
396,
960,
1243,
5229,
448,
1065,
1899,
13,
9651,
1683,
29901,
13,
18884,
736,
29871,
396,
960,
1243,
14792,
448,
437,
451,
1065,
1899,
13,
13,
4706,
363,
1899,
297,
8260,
29901,
13,
9651,
2989,
29918,
6519,
29901,
851,
353,
1899,
13,
9651,
565,
4805,
29918,
5085,
29901,
13,
18884,
2989,
29918,
6519,
4619,
376,
376,
718,
376,
11393,
7122,
29898,
17833,
29918,
5085,
29897,
13,
9651,
1065,
29918,
6519,
29898,
8159,
29918,
6519,
29892,
8829,
29922,
6272,
29897,
13,
2
] |
tinyforum/models.py | matthiask/django-tinyforum | 0 | 52883 | from ckeditor.fields import RichTextField
from django.conf import settings
from django.db import models
from django.urls import reverse
from django.utils import timezone
from django.utils.html import strip_tags
from django.utils.text import Truncator
from django.utils.translation import gettext_lazy as _
from html_sanitizer.django import get_sanitizer
class BaseQuerySet(models.QuerySet):
def visible(self):
return self.exclude(moderation_status=self.model.HIDDEN)
class BaseModel(models.Model):
GOOD = "good"
FLAGGED = "flagged"
HIDDEN = "hidden"
MODERATION_STATUS_CHOICES = (
(GOOD, _("good")),
(FLAGGED, _("flagged")),
(HIDDEN, _("hidden")),
)
MODERATION_ACTION_CHOICES = (
(GOOD, _("approve content")),
(HIDDEN, _("hide content")),
)
created_at = models.DateTimeField(_("created at"), default=timezone.now)
authored_by = models.ForeignKey(
settings.AUTH_USER_MODEL,
on_delete=models.CASCADE,
verbose_name=_("authored by"),
)
moderation_status = models.CharField(
_("moderation status"),
max_length=10,
choices=MODERATION_STATUS_CHOICES,
default=GOOD,
)
objects = BaseQuerySet.as_manager()
class Meta:
abstract = True
class ThreadQuerySet(BaseQuerySet):
def active(self):
return self.visible().filter(closed_at__isnull=True)
def closed(self):
return self.visible().filter(closed_at__isnull=False)
class Thread(BaseModel):
title = models.CharField(_("title"), max_length=200)
is_pinned = models.BooleanField(
_("is pinned"),
default=False,
help_text=_("Pinned threads are shown at the top of the thread list."),
)
closed_at = models.DateTimeField(_("closed at"), blank=True, null=True)
latest_post = models.OneToOneField(
"Post",
on_delete=models.SET_NULL,
related_name="+",
blank=True,
null=True,
verbose_name=_("latest post"),
)
post_count = models.IntegerField(_("post count"), default=0)
starred_by = models.ManyToManyField(
settings.AUTH_USER_MODEL,
blank=True,
related_name="starred_threads",
verbose_name=_("starred by"),
)
objects = ThreadQuerySet.as_manager()
class Meta:
ordering = ["-is_pinned", "-latest_post__created_at", "-created_at"]
verbose_name = _("thread")
verbose_name_plural = _("threads")
def __str__(self):
return self.title
def get_absolute_url(self):
if self.moderation_status == self.HIDDEN:
return reverse("tinyforum:thread-list")
return reverse("tinyforum:thread-detail", kwargs={"pk": self.pk})
def save(self, *args, **kwargs):
if self.pk:
self.post_count = self.posts.visible().count()
self.latest_post = self.posts.visible().last()
super().save(*args, **kwargs)
save.alters_data = True
class Post(BaseModel):
thread = models.ForeignKey(
Thread, on_delete=models.CASCADE, verbose_name=_("thread"), related_name="posts"
)
text = RichTextField(_("text"), config_name="tinyforum-post")
class Meta:
ordering = ["created_at"]
verbose_name = _("post")
verbose_name_plural = _("post")
def __str__(self):
return Truncator(strip_tags(self.text)).words(20, truncate="...")
def save(self, *args, **kwargs):
self.text = get_sanitizer("tinyforum-post").sanitize(self.text)
super().save(*args, **kwargs)
self.thread.save()
save.alters_data = True
class Report(BaseModel):
REASON_CHOICES = (
("annoying", _("It's annoying or not interesting")),
("misplaced", _("I think it shouldn't be here")),
("spam", _("It's spam")),
)
reason = models.CharField(_("reason"), max_length=10, choices=REASON_CHOICES)
notes = models.TextField(
_("notes"), blank=True, help_text=_("Anything else you want to say?")
)
handled_at = models.DateTimeField(_("handled at"), blank=True, null=True)
handled_by = models.ForeignKey(
settings.AUTH_USER_MODEL,
on_delete=models.PROTECT,
blank=True,
null=True,
verbose_name=_("handled by"),
related_name="+",
)
# Override BaseModel.moderation_status with a blank=True version
moderation_status = models.CharField(
_("moderation status"),
max_length=10,
choices=BaseModel.MODERATION_STATUS_CHOICES,
default=BaseModel.FLAGGED,
)
class Meta:
abstract = True
class PostReport(Report):
post = models.ForeignKey(
Post, on_delete=models.CASCADE, related_name="reports", verbose_name=_("post")
)
class Meta:
unique_together = (("authored_by", "post"),)
verbose_name = _("post report")
verbose_name_plural = _("post reports")
| [
1,
515,
274,
29895,
15204,
29889,
9621,
1053,
4385,
15778,
13,
3166,
9557,
29889,
5527,
1053,
6055,
13,
3166,
9557,
29889,
2585,
1053,
4733,
13,
3166,
9557,
29889,
26045,
1053,
11837,
13,
3166,
9557,
29889,
13239,
1053,
29431,
13,
3166,
9557,
29889,
13239,
29889,
1420,
1053,
17820,
29918,
11338,
13,
3166,
9557,
29889,
13239,
29889,
726,
1053,
1605,
4661,
1061,
13,
3166,
9557,
29889,
13239,
29889,
3286,
18411,
1053,
679,
726,
29918,
433,
1537,
408,
903,
13,
3166,
3472,
29918,
28455,
277,
3950,
29889,
14095,
1053,
679,
29918,
28455,
277,
3950,
13,
13,
13,
1990,
7399,
3010,
2697,
29898,
9794,
29889,
3010,
2697,
1125,
13,
1678,
822,
7962,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
735,
2325,
29898,
1545,
261,
362,
29918,
4882,
29922,
1311,
29889,
4299,
29889,
29950,
1367,
29928,
1430,
29897,
13,
13,
13,
1990,
7399,
3195,
29898,
9794,
29889,
3195,
1125,
13,
1678,
21947,
13668,
353,
376,
16773,
29908,
13,
1678,
383,
4375,
29954,
1692,
29928,
353,
376,
15581,
3192,
29908,
13,
1678,
379,
1367,
29928,
1430,
353,
376,
10892,
29908,
13,
13,
1678,
16999,
8032,
8098,
29918,
27047,
29918,
3210,
29949,
2965,
2890,
353,
313,
13,
4706,
313,
17080,
13668,
29892,
903,
703,
16773,
1159,
511,
13,
4706,
313,
26516,
1692,
29928,
29892,
903,
703,
15581,
3192,
1159,
511,
13,
4706,
313,
29950,
1367,
29928,
1430,
29892,
903,
703,
10892,
1159,
511,
13,
1678,
1723,
13,
1678,
16999,
8032,
8098,
29918,
24705,
29918,
3210,
29949,
2965,
2890,
353,
313,
13,
4706,
313,
17080,
13668,
29892,
903,
703,
9961,
345,
2793,
1159,
511,
13,
4706,
313,
29950,
1367,
29928,
1430,
29892,
903,
703,
11458,
2793,
1159,
511,
13,
1678,
1723,
13,
13,
1678,
2825,
29918,
271,
353,
4733,
29889,
11384,
3073,
7373,
703,
11600,
472,
4968,
2322,
29922,
2230,
8028,
29889,
3707,
29897,
13,
1678,
4148,
287,
29918,
1609,
353,
4733,
29889,
27755,
2558,
29898,
13,
4706,
6055,
29889,
20656,
29950,
29918,
11889,
29918,
20387,
29931,
29892,
13,
4706,
373,
29918,
8143,
29922,
9794,
29889,
29907,
3289,
5454,
2287,
29892,
13,
4706,
26952,
29918,
978,
29922,
29918,
703,
8921,
287,
491,
4968,
13,
1678,
1723,
13,
1678,
17768,
362,
29918,
4882,
353,
4733,
29889,
27890,
29898,
13,
4706,
903,
703,
1545,
261,
362,
4660,
4968,
13,
4706,
4236,
29918,
2848,
29922,
29896,
29900,
29892,
13,
4706,
19995,
29922,
6720,
8032,
8098,
29918,
27047,
29918,
3210,
29949,
2965,
2890,
29892,
13,
4706,
2322,
29922,
17080,
13668,
29892,
13,
1678,
1723,
13,
13,
1678,
3618,
353,
7399,
3010,
2697,
29889,
294,
29918,
12847,
580,
13,
13,
1678,
770,
20553,
29901,
13,
4706,
9846,
353,
5852,
13,
13,
13,
1990,
10480,
3010,
2697,
29898,
5160,
3010,
2697,
1125,
13,
1678,
822,
6136,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
12872,
2141,
4572,
29898,
15603,
29918,
271,
1649,
275,
4304,
29922,
5574,
29897,
13,
13,
1678,
822,
5764,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
12872,
2141,
4572,
29898,
15603,
29918,
271,
1649,
275,
4304,
29922,
8824,
29897,
13,
13,
13,
1990,
10480,
29898,
5160,
3195,
1125,
13,
1678,
3611,
353,
4733,
29889,
27890,
7373,
703,
3257,
4968,
4236,
29918,
2848,
29922,
29906,
29900,
29900,
29897,
13,
1678,
338,
29918,
29886,
27464,
353,
4733,
29889,
18146,
3073,
29898,
13,
4706,
903,
703,
275,
282,
27464,
4968,
13,
4706,
2322,
29922,
8824,
29892,
13,
4706,
1371,
29918,
726,
29922,
29918,
703,
29925,
27464,
9717,
526,
4318,
472,
278,
2246,
310,
278,
3244,
1051,
1213,
511,
13,
1678,
1723,
13,
1678,
5764,
29918,
271,
353,
4733,
29889,
11384,
3073,
7373,
703,
15603,
472,
4968,
9654,
29922,
5574,
29892,
1870,
29922,
5574,
29897,
13,
13,
1678,
9281,
29918,
2490,
353,
4733,
29889,
6716,
1762,
6716,
3073,
29898,
13,
4706,
376,
6747,
613,
13,
4706,
373,
29918,
8143,
29922,
9794,
29889,
10490,
29918,
10074,
29892,
13,
4706,
4475,
29918,
978,
543,
29974,
613,
13,
4706,
9654,
29922,
5574,
29892,
13,
4706,
1870,
29922,
5574,
29892,
13,
4706,
26952,
29918,
978,
29922,
29918,
703,
12333,
1400,
4968,
13,
1678,
1723,
13,
1678,
1400,
29918,
2798,
353,
4733,
29889,
7798,
3073,
7373,
703,
2490,
2302,
4968,
2322,
29922,
29900,
29897,
13,
1678,
5810,
1127,
29918,
1609,
353,
4733,
29889,
14804,
1762,
14804,
3073,
29898,
13,
4706,
6055,
29889,
20656,
29950,
29918,
11889,
29918,
20387,
29931,
29892,
13,
4706,
9654,
29922,
5574,
29892,
13,
4706,
4475,
29918,
978,
543,
8508,
1127,
29918,
28993,
613,
13,
4706,
26952,
29918,
978,
29922,
29918,
703,
8508,
1127,
491,
4968,
13,
1678,
1723,
13,
13,
1678,
3618,
353,
10480,
3010,
2697,
29889,
294,
29918,
12847,
580,
13,
13,
1678,
770,
20553,
29901,
13,
4706,
20520,
353,
6796,
29899,
275,
29918,
29886,
27464,
613,
11663,
12333,
29918,
2490,
1649,
11600,
29918,
271,
613,
11663,
11600,
29918,
271,
3108,
13,
4706,
26952,
29918,
978,
353,
903,
703,
7097,
1159,
13,
4706,
26952,
29918,
978,
29918,
572,
3631,
353,
903,
703,
28993,
1159,
13,
13,
1678,
822,
4770,
710,
12035,
1311,
1125,
13,
4706,
736,
1583,
29889,
3257,
13,
13,
1678,
822,
679,
29918,
23552,
29918,
2271,
29898,
1311,
1125,
13,
4706,
565,
1583,
29889,
1545,
261,
362,
29918,
4882,
1275,
1583,
29889,
29950,
1367,
29928,
1430,
29901,
13,
9651,
736,
11837,
703,
25649,
23343,
29901,
7097,
29899,
1761,
1159,
13,
4706,
736,
11837,
703,
25649,
23343,
29901,
7097,
29899,
16432,
613,
9049,
5085,
3790,
29908,
20571,
1115,
1583,
29889,
20571,
1800,
13,
13,
1678,
822,
4078,
29898,
1311,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
565,
1583,
29889,
20571,
29901,
13,
9651,
1583,
29889,
2490,
29918,
2798,
353,
1583,
29889,
14080,
29889,
12872,
2141,
2798,
580,
13,
9651,
1583,
29889,
12333,
29918,
2490,
353,
1583,
29889,
14080,
29889,
12872,
2141,
4230,
580,
13,
4706,
2428,
2141,
7620,
10456,
5085,
29892,
3579,
19290,
29897,
13,
13,
1678,
4078,
29889,
284,
2153,
29918,
1272,
353,
5852,
13,
13,
13,
1990,
4918,
29898,
5160,
3195,
1125,
13,
1678,
3244,
353,
4733,
29889,
27755,
2558,
29898,
13,
4706,
10480,
29892,
373,
29918,
8143,
29922,
9794,
29889,
29907,
3289,
5454,
2287,
29892,
26952,
29918,
978,
29922,
29918,
703,
7097,
4968,
4475,
29918,
978,
543,
14080,
29908,
13,
1678,
1723,
13,
1678,
1426,
353,
4385,
15778,
7373,
703,
726,
4968,
2295,
29918,
978,
543,
25649,
23343,
29899,
2490,
1159,
13,
13,
1678,
770,
20553,
29901,
13,
4706,
20520,
353,
6796,
11600,
29918,
271,
3108,
13,
4706,
26952,
29918,
978,
353,
903,
703,
2490,
1159,
13,
4706,
26952,
29918,
978,
29918,
572,
3631,
353,
903,
703,
2490,
1159,
13,
13,
1678,
822,
4770,
710,
12035,
1311,
1125,
13,
4706,
736,
1605,
4661,
1061,
29898,
17010,
29918,
11338,
29898,
1311,
29889,
726,
8106,
9303,
29898,
29906,
29900,
29892,
21022,
403,
543,
856,
1159,
13,
13,
1678,
822,
4078,
29898,
1311,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
4706,
1583,
29889,
726,
353,
679,
29918,
28455,
277,
3950,
703,
25649,
23343,
29899,
2490,
2564,
28455,
277,
675,
29898,
1311,
29889,
726,
29897,
13,
4706,
2428,
2141,
7620,
10456,
5085,
29892,
3579,
19290,
29897,
13,
4706,
1583,
29889,
7097,
29889,
7620,
580,
13,
13,
1678,
4078,
29889,
284,
2153,
29918,
1272,
353,
5852,
13,
13,
13,
1990,
13969,
29898,
5160,
3195,
1125,
13,
1678,
5195,
29909,
3094,
29918,
3210,
29949,
2965,
2890,
353,
313,
13,
4706,
4852,
7665,
5414,
613,
903,
703,
3112,
29915,
29879,
12327,
5414,
470,
451,
8031,
1159,
511,
13,
4706,
4852,
29885,
11936,
433,
1133,
613,
903,
703,
29902,
1348,
372,
9273,
29915,
29873,
367,
1244,
1159,
511,
13,
4706,
4852,
1028,
314,
613,
903,
703,
3112,
29915,
29879,
805,
314,
1159,
511,
13,
1678,
1723,
13,
13,
1678,
2769,
353,
4733,
29889,
27890,
7373,
703,
23147,
4968,
4236,
29918,
2848,
29922,
29896,
29900,
29892,
19995,
29922,
1525,
29909,
3094,
29918,
3210,
29949,
2965,
2890,
29897,
13,
1678,
11486,
353,
4733,
29889,
15778,
29898,
13,
4706,
903,
703,
16953,
4968,
9654,
29922,
5574,
29892,
1371,
29918,
726,
29922,
29918,
703,
10773,
1918,
1683,
366,
864,
304,
1827,
29973,
1159,
13,
1678,
1723,
13,
13,
1678,
16459,
29918,
271,
353,
4733,
29889,
11384,
3073,
7373,
703,
3179,
839,
472,
4968,
9654,
29922,
5574,
29892,
1870,
29922,
5574,
29897,
13,
1678,
16459,
29918,
1609,
353,
4733,
29889,
27755,
2558,
29898,
13,
4706,
6055,
29889,
20656,
29950,
29918,
11889,
29918,
20387,
29931,
29892,
13,
4706,
373,
29918,
8143,
29922,
9794,
29889,
8618,
4330,
1783,
29892,
13,
4706,
9654,
29922,
5574,
29892,
13,
4706,
1870,
29922,
5574,
29892,
13,
4706,
26952,
29918,
978,
29922,
29918,
703,
3179,
839,
491,
4968,
13,
4706,
4475,
29918,
978,
543,
29974,
613,
13,
1678,
1723,
13,
13,
1678,
396,
6811,
2426,
7399,
3195,
29889,
1545,
261,
362,
29918,
4882,
411,
263,
9654,
29922,
5574,
1873,
13,
1678,
17768,
362,
29918,
4882,
353,
4733,
29889,
27890,
29898,
13,
4706,
903,
703,
1545,
261,
362,
4660,
4968,
13,
4706,
4236,
29918,
2848,
29922,
29896,
29900,
29892,
13,
4706,
19995,
29922,
5160,
3195,
29889,
6720,
8032,
8098,
29918,
27047,
29918,
3210,
29949,
2965,
2890,
29892,
13,
4706,
2322,
29922,
5160,
3195,
29889,
26516,
1692,
29928,
29892,
13,
1678,
1723,
13,
13,
1678,
770,
20553,
29901,
13,
4706,
9846,
353,
5852,
13,
13,
13,
1990,
4918,
13020,
29898,
13020,
1125,
13,
1678,
1400,
353,
4733,
29889,
27755,
2558,
29898,
13,
4706,
4918,
29892,
373,
29918,
8143,
29922,
9794,
29889,
29907,
3289,
5454,
2287,
29892,
4475,
29918,
978,
543,
276,
4011,
613,
26952,
29918,
978,
29922,
29918,
703,
2490,
1159,
13,
1678,
1723,
13,
13,
1678,
770,
20553,
29901,
13,
4706,
5412,
29918,
29873,
12966,
353,
313,
703,
8921,
287,
29918,
1609,
613,
376,
2490,
4968,
29897,
13,
4706,
26952,
29918,
978,
353,
903,
703,
2490,
3461,
1159,
13,
4706,
26952,
29918,
978,
29918,
572,
3631,
353,
903,
703,
2490,
13676,
1159,
13,
2
] |
tests/test_basic.py | WSULib/combine | 24 | 24382 | <reponame>WSULib/combine
import django
import os
import pytest
import shutil
import sys
import time
import uuid
# logging
import logging
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
# init django settings file to retrieve settings
os.environ['DJANGO_SETTINGS_MODULE'] = 'combine.settings'
sys.path.append('/opt/combine')
django.setup()
# import core
from core.models import Organization, RecordGroup, CombineJob, HarvestStaticXMLJob, QueryDict, Transformation,\
TransformJob, ValidationScenario, MergeJob
#############################################################################
# Tests Setup
#############################################################################
@pytest.mark.run(order=1)
def test_organization_create(VO):
'''
Test creation of organization
'''
# instantiate and save
VO.org = Organization(
name='test_org_%s' % uuid.uuid4().hex,
description=''
)
VO.org.save()
assert type(VO.org.id) == int
@pytest.mark.run(order=2)
def test_record_group_create(VO):
'''
Test creation of record group
'''
# instantiate and save
VO.rg = RecordGroup(
organization=VO.org,
name='test_record_group_%s' % uuid.uuid4().hex,
description=''
)
VO.rg.save()
assert type(VO.rg.id) == int
#############################################################################
# Test Harvest
#############################################################################
@pytest.mark.run(order=3)
def test_static_harvest(VO):
'''
Test static harvest of XML records from disk
'''
# copy test data to /tmp
payload_dir = '/tmp/%s' % uuid.uuid4().hex
shutil.copytree('/opt/combine/tests/data/static_harvest_data', payload_dir)
# emulate request.POST
request_dict = {
'dbdd': '',
'job_note': '',
'xpath_record_id': '',
'static_filepath': payload_dir,
'fm_config_json': '{"add_literals":{},"capture_attribute_values":[],"concat_values_on_all_fields":false,"concat_values_on_fields":{},"copy_to":{},"copy_to_regex":{},"copy_value_to_regex":{},"error_on_delims_collision":false,"exclude_attributes":[],"exclude_elements":[],"include_all_attributes":false,"include_attributes":[],"include_sibling_id":false,"multivalue_delim":"|","node_delim":"_","ns_prefix_delim":"|","remove_copied_key":true,"remove_copied_value":false,"remove_ns_prefix":true,"repeating_element_suffix_count":false,"self_describing":false,"skip_attribute_ns_declarations":true,"skip_repeating_values":true,"skip_root":false,"split_values_on_all_fields":false,"split_values_on_fields":{}}',
'static_payload': '',
'job_name': '',
'field_mapper': 'default',
'rits': '',
'additional_namespace_decs': 'xmlns:mods="http://www.loc.gov/mods/v3"',
'document_element_root': 'mods:mods'
}
query_dict = QueryDict('', mutable=True)
query_dict.update(request_dict)
# init job, using Variable Object (VO)
cjob = CombineJob.init_combine_job(
user=VO.user,
record_group=VO.rg,
job_type_class=HarvestStaticXMLJob,
job_params=query_dict,
files={},
hash_payload_filename=False
)
# start job and update status
job_status = cjob.start_job()
# if job_status is absent, report job status as failed
if job_status == False:
cjob.job.status = 'failed'
cjob.job.save()
# poll until complete
for x in range(0, 480):
# pause
time.sleep(1)
# refresh session
cjob.job.update_status()
# check status
if cjob.job.status != 'available':
continue
else:
break
# save static harvest job to VO
VO.static_harvest_cjob = cjob
# remove payload_dir
shutil.rmtree(payload_dir)
# assert job is done and available via livy
assert VO.static_harvest_cjob.job.status == 'available'
# assert record count is 250
assert VO.static_harvest_cjob.job.record_count == 250
# assert no indexing failures
assert len(VO.static_harvest_cjob.get_indexing_failures()) == 0
# #############################################################################
# # Test Transform
# #############################################################################
def prepare_transform():
'''
Create temporary transformation scenario based on tests/data/mods_transform.xsl
'''
with open('tests/data/mods_transform.xsl', 'r') as f:
xsl_string = f.read()
trans = Transformation(
name='temp_mods_transformation',
payload=xsl_string,
transformation_type='xslt',
filepath='will_be_updated'
)
trans.save()
# return transformation
return trans
@pytest.mark.run(order=4)
def test_static_transform(VO):
'''
Test static harvest of XML records from disk
'''
# prepare and capture temporary transformation scenario
VO.transformation_scenario = prepare_transform()
# emulate request.POST
request_dict = {
'dbdd': '',
'field_mapper': 'default',
'filter_dupe_record_ids': 'true',
'fm_config_json': '{"add_literals":{},"capture_attribute_values":[],"concat_values_on_all_fields":false,"concat_values_on_fields":{},"copy_to":{},"copy_to_regex":{},"copy_value_to_regex":{},"error_on_delims_collision":false,"exclude_attributes":[],"exclude_elements":[],"include_all_attributes":false,"include_attributes":[],"include_sibling_id":false,"multivalue_delim":"|","node_delim":"_","ns_prefix_delim":"|","remove_copied_key":true,"remove_copied_value":false,"remove_ns_prefix":true,"repeating_element_suffix_count":false,"self_describing":false,"skip_attribute_ns_declarations":true,"skip_repeating_values":true,"skip_root":false,"split_values_on_all_fields":false,"split_values_on_fields":{}}',
'input_es_query_valve': '',
'input_job_id': VO.static_harvest_cjob.job.id,
'input_numerical_valve': '',
'input_validity_valve': 'all',
'job_name': '',
'job_note': '',
'rits': '',
'sel_trans_json': '[{"index":0,"trans_id":%s}]' % VO.transformation_scenario.id
}
query_dict = QueryDict('', mutable=True)
query_dict.update(request_dict)
# init job
cjob = CombineJob.init_combine_job(
user=VO.user,
record_group=VO.rg,
job_type_class=TransformJob,
job_params=query_dict)
# start job and update status
job_status = cjob.start_job()
# if job_status is absent, report job status as failed
if job_status == False:
cjob.job.status = 'failed'
cjob.job.save()
# poll until complete
for x in range(0, 480):
# pause
time.sleep(1)
# refresh session
cjob.job.update_status()
# check status
if cjob.job.status != 'available':
continue
else:
break
# save static harvest job to VO
VO.static_transform_cjob = cjob
# assert job is done and available via livy
assert VO.static_transform_cjob.job.status == 'available'
# assert record count is 250
assert VO.static_transform_cjob.job.record_count == 250
# assert no indexing failures
assert len(VO.static_transform_cjob.get_indexing_failures()) == 0
# remove transformation
assert VO.transformation_scenario.delete()[0] > 0
# #############################################################################
# # Test Validation Scenarios
# #############################################################################
@pytest.mark.run(order=5)
def test_add_schematron_validation_scenario(VO):
'''
Add schematron validation
'''
# get schematron validation from test data
with open('tests/data/schematron_validation.sch', 'r') as f:
sch_payload = f.read()
# init new validation scenario
schematron_validation_scenario = ValidationScenario(
name='temp_vs_%s' % str(uuid.uuid4()),
payload=sch_payload,
validation_type='sch',
default_run=False
)
schematron_validation_scenario.save()
# pin to VO
VO.schematron_validation_scenario = schematron_validation_scenario
# assert creation
assert type(VO.schematron_validation_scenario.id) == int
@pytest.mark.run(order=6)
def test_add_python_validation_scenario(VO):
'''
Add python code snippet validation
'''
# get python validation from test data
with open('tests/data/python_validation.py', 'r') as f:
py_payload = f.read()
# init new validation scenario
python_validation_scenario = ValidationScenario(
name='temp_vs_%s' % str(uuid.uuid4()),
payload=py_payload,
validation_type='python',
default_run=False
)
python_validation_scenario.save()
# pin to VO
VO.python_validation_scenario = python_validation_scenario
# assert creation
assert type(VO.python_validation_scenario.id) == int
@pytest.mark.run(order=7)
def test_schematron_validation(VO):
# get target records
VO.harvest_record = VO.static_harvest_cjob.job.get_records().first()
VO.transform_record = VO.static_transform_cjob.job.get_records().first()
# validate harvest record with schematron
'''
expecting failure count of 2
'''
vs_results = VO.schematron_validation_scenario.validate_record(VO.harvest_record)
assert vs_results['parsed']['fail_count'] == 2
# validate transform record with schematron
'''
expecting failure count of 1
'''
vs_results = VO.schematron_validation_scenario.validate_record(VO.transform_record)
assert vs_results['parsed']['fail_count'] == 1
@pytest.mark.run(order=8)
def test_python_validation(VO):
# validate harvest record with python
'''
expecting failure count of 1
'''
vs_results = VO.python_validation_scenario.validate_record(VO.harvest_record)
print(vs_results)
assert vs_results['parsed']['fail_count'] == 1
# validate transform record with python
'''
expecting failure count of 1
'''
vs_results = VO.python_validation_scenario.validate_record(VO.transform_record)
print(vs_results)
assert vs_results['parsed']['fail_count'] == 1
# #############################################################################
# # Test Duplicate/Merge Job
# #############################################################################
@pytest.mark.run(order=9)
def test_merge_duplicate(VO):
'''
Duplicate Transform job, applying newly created validation scenarios
'''
# emulate request.POST
request_dict = {
'dbdd': '',
'field_mapper': 'default',
'filter_dupe_record_ids': 'true',
'fm_config_json': '{"add_literals":{},"capture_attribute_values":[],"concat_values_on_all_fields":false,"concat_values_on_fields":{},"copy_to":{},"copy_to_regex":{},"copy_value_to_regex":{},"error_on_delims_collision":false,"exclude_attributes":[],"exclude_elements":[],"include_all_attributes":false,"include_attributes":[],"include_sibling_id":false,"multivalue_delim":"|","node_delim":"_","ns_prefix_delim":"|","remove_copied_key":true,"remove_copied_value":false,"remove_ns_prefix":true,"repeating_element_suffix_count":false,"self_describing":false,"skip_attribute_ns_declarations":true,"skip_repeating_values":true,"skip_root":false,"split_values_on_all_fields":false,"split_values_on_fields":{}}',
'input_es_query_valve': '',
'input_numerical_valve': '',
'input_validity_valve': 'all',
'job_name': '',
'job_note': '',
'rits': ''
}
query_dict = QueryDict('', mutable=True)
query_dict.update(request_dict)
# set input jobs with QueryDict.setlist
query_dict.setlist('input_job_id', [
VO.static_harvest_cjob.job.id,
VO.static_transform_cjob.job.id
])
# set validation scenarios with QueryDict.setlist
query_dict.setlist('validation_scenario', [
VO.schematron_validation_scenario.id,
VO.python_validation_scenario.id
])
# init job
cjob = CombineJob.init_combine_job(
user=VO.user,
record_group=VO.rg,
job_type_class=MergeJob,
job_params=query_dict)
# start job and update status
job_status = cjob.start_job()
# if job_status is absent, report job status as failed
if job_status == False:
cjob.job.status = 'failed'
cjob.job.save()
# poll until complete
for x in range(0, 480):
# pause
time.sleep(1)
# refresh session
cjob.job.update_status()
# check status
if cjob.job.status != 'available':
continue
else:
break
# save static harvest job to VO
VO.merge_cjob = cjob
# assert job is done and available via livy
assert VO.merge_cjob.job.status == 'available'
# assert record count is 250
assert VO.merge_cjob.job.record_count == 250
# assert validation scenarios applied
job_validation_scenarios = VO.merge_cjob.job.jobvalidation_set.all()
assert job_validation_scenarios.count() == 2
# loop through validation scenarios and confirm that both show 250 failures
for jv in job_validation_scenarios:
assert jv.get_record_validation_failures().count() == 232
# assert no indexing failures
assert len(VO.merge_cjob.get_indexing_failures()) == 0
#############################################################################
# Tests Teardown
#############################################################################
@pytest.mark.last
def test_teardown(keep_records, VO):
'''
Test teardown
'''
# assert delete of org and children
if not keep_records:
assert VO.org.delete()[0] > 0
else:
assert True
assert VO.schematron_validation_scenario.delete()[0] > 0
assert VO.python_validation_scenario.delete()[0] > 0
| [
1,
529,
276,
1112,
420,
29958,
7811,
13309,
747,
29914,
17743,
457,
13,
5215,
9557,
13,
5215,
2897,
13,
5215,
11451,
1688,
13,
5215,
528,
4422,
13,
5215,
10876,
13,
5215,
931,
13,
5215,
318,
5416,
13,
13,
29937,
12183,
13,
5215,
12183,
13,
13,
21707,
353,
12183,
29889,
657,
16363,
22168,
978,
1649,
29897,
13,
21707,
29889,
842,
10108,
29898,
21027,
29889,
18525,
29897,
13,
13,
29937,
2069,
9557,
6055,
934,
304,
10563,
6055,
13,
359,
29889,
21813,
1839,
29928,
29967,
2190,
17080,
29918,
10490,
29911,
4214,
29903,
29918,
6720,
14849,
1307,
2033,
353,
525,
17743,
457,
29889,
11027,
29915,
13,
9675,
29889,
2084,
29889,
4397,
11219,
3670,
29914,
17743,
457,
1495,
13,
14095,
29889,
14669,
580,
13,
13,
29937,
1053,
7136,
13,
3166,
7136,
29889,
9794,
1053,
9205,
2133,
29892,
14164,
4782,
29892,
422,
26062,
11947,
29892,
3536,
10147,
17046,
9165,
11947,
29892,
13641,
21533,
29892,
4103,
5404,
2053,
13,
1678,
4103,
689,
11947,
29892,
15758,
362,
4421,
24893,
29892,
4702,
479,
11947,
13,
13,
13,
13383,
13383,
13383,
13383,
7346,
4136,
29937,
13,
29937,
4321,
29879,
3789,
786,
13,
13383,
13383,
13383,
13383,
7346,
4136,
29937,
13,
13,
29992,
2272,
1688,
29889,
3502,
29889,
3389,
29898,
2098,
29922,
29896,
29897,
13,
1753,
1243,
29918,
6388,
2133,
29918,
3258,
29898,
24898,
1125,
13,
1678,
14550,
13,
1678,
4321,
11265,
310,
13013,
13,
1678,
14550,
13,
13,
1678,
396,
25112,
322,
4078,
13,
1678,
478,
29949,
29889,
990,
353,
9205,
2133,
29898,
13,
4706,
1024,
2433,
1688,
29918,
990,
29918,
29995,
29879,
29915,
1273,
318,
5416,
29889,
25118,
29946,
2141,
20970,
29892,
13,
4706,
6139,
2433,
29915,
13,
1678,
1723,
13,
1678,
478,
29949,
29889,
990,
29889,
7620,
580,
13,
1678,
4974,
1134,
29898,
24898,
29889,
990,
29889,
333,
29897,
1275,
938,
13,
13,
13,
29992,
2272,
1688,
29889,
3502,
29889,
3389,
29898,
2098,
29922,
29906,
29897,
13,
1753,
1243,
29918,
11651,
29918,
2972,
29918,
3258,
29898,
24898,
1125,
13,
1678,
14550,
13,
1678,
4321,
11265,
310,
2407,
2318,
13,
1678,
14550,
13,
13,
1678,
396,
25112,
322,
4078,
13,
1678,
478,
29949,
29889,
11007,
353,
14164,
4782,
29898,
13,
4706,
13013,
29922,
24898,
29889,
990,
29892,
13,
4706,
1024,
2433,
1688,
29918,
11651,
29918,
2972,
29918,
29995,
29879,
29915,
1273,
318,
5416,
29889,
25118,
29946,
2141,
20970,
29892,
13,
4706,
6139,
2433,
29915,
13,
1678,
1723,
13,
1678,
478,
29949,
29889,
11007,
29889,
7620,
580,
13,
1678,
4974,
1134,
29898,
24898,
29889,
11007,
29889,
333,
29897,
1275,
938,
13,
13,
13,
13383,
13383,
13383,
13383,
7346,
4136,
29937,
13,
29937,
4321,
3536,
10147,
13,
13383,
13383,
13383,
13383,
7346,
4136,
29937,
13,
13,
29992,
2272,
1688,
29889,
3502,
29889,
3389,
29898,
2098,
29922,
29941,
29897,
13,
1753,
1243,
29918,
7959,
29918,
8222,
10147,
29898,
24898,
1125,
13,
1678,
14550,
13,
1678,
4321,
2294,
4023,
10147,
310,
6560,
6475,
515,
8086,
13,
1678,
14550,
13,
13,
1678,
396,
3509,
1243,
848,
304,
847,
7050,
13,
1678,
20092,
29918,
3972,
353,
8207,
7050,
22584,
29879,
29915,
1273,
318,
5416,
29889,
25118,
29946,
2141,
20970,
13,
1678,
528,
4422,
29889,
8552,
8336,
11219,
3670,
29914,
17743,
457,
29914,
21150,
29914,
1272,
29914,
7959,
29918,
8222,
10147,
29918,
1272,
742,
20092,
29918,
3972,
29897,
13,
13,
1678,
396,
953,
5987,
2009,
29889,
5438,
13,
1678,
2009,
29918,
8977,
353,
426,
13,
4706,
525,
2585,
1289,
2396,
15516,
13,
4706,
525,
9057,
29918,
6812,
2396,
15516,
13,
4706,
525,
23635,
29918,
11651,
29918,
333,
2396,
15516,
13,
4706,
525,
7959,
29918,
1445,
2084,
2396,
20092,
29918,
3972,
29892,
13,
4706,
525,
24826,
29918,
2917,
29918,
3126,
2396,
525,
6377,
1202,
29918,
20889,
1338,
1115,
29912,
1118,
29908,
17885,
545,
29918,
12715,
29918,
5975,
1115,
29961,
1402,
29908,
17685,
29918,
5975,
29918,
265,
29918,
497,
29918,
9621,
1115,
4541,
1699,
17685,
29918,
5975,
29918,
265,
29918,
9621,
1115,
29912,
1118,
29908,
8552,
29918,
517,
1115,
29912,
1118,
29908,
8552,
29918,
517,
29918,
13087,
1115,
29912,
1118,
29908,
8552,
29918,
1767,
29918,
517,
29918,
13087,
1115,
29912,
1118,
29908,
2704,
29918,
265,
29918,
6144,
9893,
29918,
22017,
2459,
1115,
4541,
1699,
735,
2325,
29918,
15697,
1115,
29961,
1402,
29908,
735,
2325,
29918,
17664,
1115,
29961,
1402,
29908,
2856,
29918,
497,
29918,
15697,
1115,
4541,
1699,
2856,
29918,
15697,
1115,
29961,
1402,
29908,
2856,
29918,
29879,
747,
1847,
29918,
333,
1115,
4541,
1699,
4713,
2561,
434,
29918,
6144,
326,
4710,
29989,
3284,
3177,
29918,
6144,
326,
4710,
29918,
3284,
1983,
29918,
13506,
29918,
6144,
326,
4710,
29989,
3284,
5992,
29918,
9708,
1000,
29918,
1989,
1115,
3009,
1699,
5992,
29918,
9708,
1000,
29918,
1767,
1115,
4541,
1699,
5992,
29918,
1983,
29918,
13506,
1115,
3009,
1699,
276,
412,
1218,
29918,
5029,
29918,
2146,
600,
861,
29918,
2798,
1115,
4541,
1699,
1311,
29918,
2783,
699,
10549,
1115,
4541,
1699,
11014,
29918,
12715,
29918,
1983,
29918,
311,
16544,
800,
1115,
3009,
1699,
11014,
29918,
276,
412,
1218,
29918,
5975,
1115,
3009,
1699,
11014,
29918,
4632,
1115,
4541,
1699,
5451,
29918,
5975,
29918,
265,
29918,
497,
29918,
9621,
1115,
4541,
1699,
5451,
29918,
5975,
29918,
265,
29918,
9621,
1115,
29912,
930,
742,
13,
4706,
525,
7959,
29918,
23813,
2396,
15516,
13,
4706,
525,
9057,
29918,
978,
2396,
15516,
13,
4706,
525,
2671,
29918,
655,
2496,
2396,
525,
4381,
742,
13,
4706,
525,
768,
29879,
2396,
15516,
13,
4706,
525,
1202,
3245,
29918,
22377,
29918,
311,
2395,
2396,
525,
18295,
29901,
1545,
29879,
543,
1124,
597,
1636,
29889,
2029,
29889,
13513,
29914,
1545,
29879,
29914,
29894,
29941,
29908,
742,
13,
4706,
525,
3225,
29918,
5029,
29918,
4632,
2396,
525,
1545,
29879,
29901,
1545,
29879,
29915,
13,
1678,
500,
13,
1678,
2346,
29918,
8977,
353,
13641,
21533,
877,
742,
26691,
29922,
5574,
29897,
13,
1678,
2346,
29918,
8977,
29889,
5504,
29898,
3827,
29918,
8977,
29897,
13,
13,
1678,
396,
2069,
4982,
29892,
773,
28736,
4669,
313,
24898,
29897,
13,
1678,
274,
9057,
353,
422,
26062,
11947,
29889,
2344,
29918,
17743,
457,
29918,
9057,
29898,
13,
4706,
1404,
29922,
24898,
29889,
1792,
29892,
13,
4706,
2407,
29918,
2972,
29922,
24898,
29889,
11007,
29892,
13,
4706,
4982,
29918,
1853,
29918,
1990,
29922,
21972,
10147,
17046,
9165,
11947,
29892,
13,
4706,
4982,
29918,
7529,
29922,
1972,
29918,
8977,
29892,
13,
4706,
2066,
3790,
1118,
13,
4706,
6608,
29918,
23813,
29918,
9507,
29922,
8824,
13,
1678,
1723,
13,
13,
1678,
396,
1369,
4982,
322,
2767,
4660,
13,
1678,
4982,
29918,
4882,
353,
274,
9057,
29889,
2962,
29918,
9057,
580,
13,
13,
1678,
396,
565,
4982,
29918,
4882,
338,
29207,
29892,
3461,
4982,
4660,
408,
5229,
13,
1678,
565,
4982,
29918,
4882,
1275,
7700,
29901,
13,
4706,
274,
9057,
29889,
9057,
29889,
4882,
353,
525,
26061,
29915,
13,
4706,
274,
9057,
29889,
9057,
29889,
7620,
580,
13,
13,
1678,
396,
21180,
2745,
4866,
13,
1678,
363,
921,
297,
3464,
29898,
29900,
29892,
29871,
29946,
29947,
29900,
1125,
13,
13,
4706,
396,
19957,
13,
4706,
931,
29889,
17059,
29898,
29896,
29897,
13,
13,
4706,
396,
11086,
4867,
13,
4706,
274,
9057,
29889,
9057,
29889,
5504,
29918,
4882,
580,
13,
13,
4706,
396,
1423,
4660,
13,
4706,
565,
274,
9057,
29889,
9057,
29889,
4882,
2804,
525,
16515,
2396,
13,
9651,
6773,
13,
4706,
1683,
29901,
13,
9651,
2867,
13,
13,
1678,
396,
4078,
2294,
4023,
10147,
4982,
304,
478,
29949,
13,
1678,
478,
29949,
29889,
7959,
29918,
8222,
10147,
29918,
29883,
9057,
353,
274,
9057,
13,
13,
1678,
396,
3349,
20092,
29918,
3972,
13,
1678,
528,
4422,
29889,
1758,
8336,
29898,
23813,
29918,
3972,
29897,
13,
13,
1678,
396,
4974,
4982,
338,
2309,
322,
3625,
3025,
7294,
29891,
13,
1678,
4974,
478,
29949,
29889,
7959,
29918,
8222,
10147,
29918,
29883,
9057,
29889,
9057,
29889,
4882,
1275,
525,
16515,
29915,
13,
13,
1678,
396,
4974,
2407,
2302,
338,
29871,
29906,
29945,
29900,
13,
1678,
4974,
478,
29949,
29889,
7959,
29918,
8222,
10147,
29918,
29883,
9057,
29889,
9057,
29889,
11651,
29918,
2798,
1275,
29871,
29906,
29945,
29900,
13,
13,
1678,
396,
4974,
694,
26190,
4418,
1973,
13,
1678,
4974,
7431,
29898,
24898,
29889,
7959,
29918,
8222,
10147,
29918,
29883,
9057,
29889,
657,
29918,
2248,
292,
29918,
14057,
1973,
3101,
1275,
29871,
29900,
13,
13,
13,
29937,
835,
13383,
13383,
13383,
13383,
7346,
2277,
13,
29937,
396,
4321,
4103,
689,
13,
29937,
835,
13383,
13383,
13383,
13383,
7346,
2277,
13,
13,
1753,
19012,
29918,
9067,
7295,
13,
1678,
14550,
13,
1678,
6204,
13201,
13852,
10483,
2729,
373,
6987,
29914,
1272,
29914,
1545,
29879,
29918,
9067,
29889,
7836,
13,
1678,
14550,
13,
13,
1678,
411,
1722,
877,
21150,
29914,
1272,
29914,
1545,
29879,
29918,
9067,
29889,
7836,
742,
525,
29878,
1495,
408,
285,
29901,
13,
4706,
921,
2536,
29918,
1807,
353,
285,
29889,
949,
580,
13,
1678,
1301,
353,
4103,
5404,
29898,
13,
4706,
1024,
2433,
7382,
29918,
1545,
29879,
29918,
3286,
5404,
742,
13,
4706,
20092,
29922,
7836,
29918,
1807,
29892,
13,
4706,
13852,
29918,
1853,
2433,
10351,
1896,
742,
13,
4706,
934,
2084,
2433,
14043,
29918,
915,
29918,
21402,
29915,
13,
1678,
1723,
13,
1678,
1301,
29889,
7620,
580,
13,
13,
1678,
396,
736,
13852,
13,
1678,
736,
1301,
13,
13,
13,
29992,
2272,
1688,
29889,
3502,
29889,
3389,
29898,
2098,
29922,
29946,
29897,
13,
1753,
1243,
29918,
7959,
29918,
9067,
29898,
24898,
1125,
13,
1678,
14550,
13,
1678,
4321,
2294,
4023,
10147,
310,
6560,
6475,
515,
8086,
13,
1678,
14550,
13,
13,
1678,
396,
19012,
322,
10446,
13201,
13852,
10483,
13,
1678,
478,
29949,
29889,
3286,
5404,
29918,
1557,
24893,
353,
19012,
29918,
9067,
580,
13,
13,
1678,
396,
953,
5987,
2009,
29889,
5438,
13,
1678,
2009,
29918,
8977,
353,
426,
13,
4706,
525,
2585,
1289,
2396,
15516,
13,
4706,
525,
2671,
29918,
655,
2496,
2396,
525,
4381,
742,
13,
4706,
525,
4572,
29918,
700,
412,
29918,
11651,
29918,
4841,
2396,
525,
3009,
742,
13,
4706,
525,
24826,
29918,
2917,
29918,
3126,
2396,
525,
6377,
1202,
29918,
20889,
1338,
1115,
29912,
1118,
29908,
17885,
545,
29918,
12715,
29918,
5975,
1115,
29961,
1402,
29908,
17685,
29918,
5975,
29918,
265,
29918,
497,
29918,
9621,
1115,
4541,
1699,
17685,
29918,
5975,
29918,
265,
29918,
9621,
1115,
29912,
1118,
29908,
8552,
29918,
517,
1115,
29912,
1118,
29908,
8552,
29918,
517,
29918,
13087,
1115,
29912,
1118,
29908,
8552,
29918,
1767,
29918,
517,
29918,
13087,
1115,
29912,
1118,
29908,
2704,
29918,
265,
29918,
6144,
9893,
29918,
22017,
2459,
1115,
4541,
1699,
735,
2325,
29918,
15697,
1115,
29961,
1402,
29908,
735,
2325,
29918,
17664,
1115,
29961,
1402,
29908,
2856,
29918,
497,
29918,
15697,
1115,
4541,
1699,
2856,
29918,
15697,
1115,
29961,
1402,
29908,
2856,
29918,
29879,
747,
1847,
29918,
333,
1115,
4541,
1699,
4713,
2561,
434,
29918,
6144,
326,
4710,
29989,
3284,
3177,
29918,
6144,
326,
4710,
29918,
3284,
1983,
29918,
13506,
29918,
6144,
326,
4710,
29989,
3284,
5992,
29918,
9708,
1000,
29918,
1989,
1115,
3009,
1699,
5992,
29918,
9708,
1000,
29918,
1767,
1115,
4541,
1699,
5992,
29918,
1983,
29918,
13506,
1115,
3009,
1699,
276,
412,
1218,
29918,
5029,
29918,
2146,
600,
861,
29918,
2798,
1115,
4541,
1699,
1311,
29918,
2783,
699,
10549,
1115,
4541,
1699,
11014,
29918,
12715,
29918,
1983,
29918,
311,
16544,
800,
1115,
3009,
1699,
11014,
29918,
276,
412,
1218,
29918,
5975,
1115,
3009,
1699,
11014,
29918,
4632,
1115,
4541,
1699,
5451,
29918,
5975,
29918,
265,
29918,
497,
29918,
9621,
1115,
4541,
1699,
5451,
29918,
5975,
29918,
265,
29918,
9621,
1115,
29912,
930,
742,
13,
4706,
525,
2080,
29918,
267,
29918,
1972,
29918,
791,
345,
2396,
15516,
13,
4706,
525,
2080,
29918,
9057,
29918,
333,
2396,
478,
29949,
29889,
7959,
29918,
8222,
10147,
29918,
29883,
9057,
29889,
9057,
29889,
333,
29892,
13,
4706,
525,
2080,
29918,
8058,
936,
29918,
791,
345,
2396,
15516,
13,
4706,
525,
2080,
29918,
3084,
537,
29918,
791,
345,
2396,
525,
497,
742,
13,
4706,
525,
9057,
29918,
978,
2396,
15516,
13,
4706,
525,
9057,
29918,
6812,
2396,
15516,
13,
4706,
525,
768,
29879,
2396,
15516,
13,
4706,
525,
2838,
29918,
3286,
29918,
3126,
2396,
525,
29961,
6377,
2248,
1115,
29900,
1699,
3286,
29918,
333,
1115,
29995,
29879,
6525,
29915,
1273,
478,
29949,
29889,
3286,
5404,
29918,
1557,
24893,
29889,
333,
13,
1678,
500,
13,
1678,
2346,
29918,
8977,
353,
13641,
21533,
877,
742,
26691,
29922,
5574,
29897,
13,
1678,
2346,
29918,
8977,
29889,
5504,
29898,
3827,
29918,
8977,
29897,
13,
13,
1678,
396,
2069,
4982,
13,
1678,
274,
9057,
353,
422,
26062,
11947,
29889,
2344,
29918,
17743,
457,
29918,
9057,
29898,
13,
4706,
1404,
29922,
24898,
29889,
1792,
29892,
13,
4706,
2407,
29918,
2972,
29922,
24898,
29889,
11007,
29892,
13,
4706,
4982,
29918,
1853,
29918,
1990,
29922,
13372,
11947,
29892,
13,
4706,
4982,
29918,
7529,
29922,
1972,
29918,
8977,
29897,
13,
13,
1678,
396,
1369,
4982,
322,
2767,
4660,
13,
1678,
4982,
29918,
4882,
353,
274,
9057,
29889,
2962,
29918,
9057,
580,
13,
13,
1678,
396,
565,
4982,
29918,
4882,
338,
29207,
29892,
3461,
4982,
4660,
408,
5229,
13,
1678,
565,
4982,
29918,
4882,
1275,
7700,
29901,
13,
4706,
274,
9057,
29889,
9057,
29889,
4882,
353,
525,
26061,
29915,
13,
4706,
274,
9057,
29889,
9057,
29889,
7620,
580,
13,
13,
1678,
396,
21180,
2745,
4866,
13,
1678,
363,
921,
297,
3464,
29898,
29900,
29892,
29871,
29946,
29947,
29900,
1125,
13,
13,
4706,
396,
19957,
13,
4706,
931,
29889,
17059,
29898,
29896,
29897,
13,
13,
4706,
396,
11086,
4867,
13,
4706,
274,
9057,
29889,
9057,
29889,
5504,
29918,
4882,
580,
13,
13,
4706,
396,
1423,
4660,
13,
4706,
565,
274,
9057,
29889,
9057,
29889,
4882,
2804,
525,
16515,
2396,
13,
9651,
6773,
13,
4706,
1683,
29901,
13,
9651,
2867,
13,
13,
1678,
396,
4078,
2294,
4023,
10147,
4982,
304,
478,
29949,
13,
1678,
478,
29949,
29889,
7959,
29918,
9067,
29918,
29883,
9057,
353,
274,
9057,
13,
13,
1678,
396,
4974,
4982,
338,
2309,
322,
3625,
3025,
7294,
29891,
13,
1678,
4974,
478,
29949,
29889,
7959,
29918,
9067,
29918,
29883,
9057,
29889,
9057,
29889,
4882,
1275,
525,
16515,
29915,
13,
13,
1678,
396,
4974,
2407,
2302,
338,
29871,
29906,
29945,
29900,
13,
1678,
4974,
478,
29949,
29889,
7959,
29918,
9067,
29918,
29883,
9057,
29889,
9057,
29889,
11651,
29918,
2798,
1275,
29871,
29906,
29945,
29900,
13,
13,
1678,
396,
4974,
694,
26190,
4418,
1973,
13,
1678,
4974,
7431,
29898,
24898,
29889,
7959,
29918,
9067,
29918,
29883,
9057,
29889,
657,
29918,
2248,
292,
29918,
14057,
1973,
3101,
1275,
29871,
29900,
13,
13,
1678,
396,
3349,
13852,
13,
1678,
4974,
478,
29949,
29889,
3286,
5404,
29918,
1557,
24893,
29889,
8143,
580,
29961,
29900,
29962,
1405,
29871,
29900,
13,
13,
13,
29937,
835,
13383,
13383,
13383,
13383,
7346,
2277,
13,
29937,
396,
4321,
15758,
362,
2522,
264,
8596,
13,
29937,
835,
13383,
13383,
13383,
13383,
7346,
2277,
13,
13,
29992,
2272,
1688,
29889,
3502,
29889,
3389,
29898,
2098,
29922,
29945,
29897,
13,
1753,
1243,
29918,
1202,
29918,
816,
4579,
1617,
29918,
18157,
29918,
1557,
24893,
29898,
24898,
1125,
13,
1678,
14550,
13,
1678,
3462,
1364,
4579,
1617,
8845,
13,
1678,
14550,
13,
13,
1678,
396,
679,
1364,
4579,
1617,
8845,
515,
1243,
848,
13,
1678,
411,
1722,
877,
21150,
29914,
1272,
29914,
816,
4579,
1617,
29918,
18157,
29889,
816,
742,
525,
29878,
1495,
408,
285,
29901,
13,
4706,
1364,
29918,
23813,
353,
285,
29889,
949,
580,
13,
13,
1678,
396,
2069,
716,
8845,
10483,
13,
1678,
1364,
4579,
1617,
29918,
18157,
29918,
1557,
24893,
353,
15758,
362,
4421,
24893,
29898,
13,
4706,
1024,
2433,
7382,
29918,
4270,
29918,
29995,
29879,
29915,
1273,
851,
29898,
25118,
29889,
25118,
29946,
25739,
13,
4706,
20092,
29922,
816,
29918,
23813,
29892,
13,
4706,
8845,
29918,
1853,
2433,
816,
742,
13,
4706,
2322,
29918,
3389,
29922,
8824,
13,
1678,
1723,
13,
1678,
1364,
4579,
1617,
29918,
18157,
29918,
1557,
24893,
29889,
7620,
580,
13,
13,
1678,
396,
12534,
304,
478,
29949,
13,
1678,
478,
29949,
29889,
816,
4579,
1617,
29918,
18157,
29918,
1557,
24893,
353,
1364,
4579,
1617,
29918,
18157,
29918,
1557,
24893,
13,
13,
1678,
396,
4974,
11265,
13,
1678,
4974,
1134,
29898,
24898,
29889,
816,
4579,
1617,
29918,
18157,
29918,
1557,
24893,
29889,
333,
29897,
1275,
938,
13,
13,
13,
29992,
2272,
1688,
29889,
3502,
29889,
3389,
29898,
2098,
29922,
29953,
29897,
13,
1753,
1243,
29918,
1202,
29918,
4691,
29918,
18157,
29918,
1557,
24893,
29898,
24898,
1125,
13,
1678,
14550,
13,
1678,
3462,
3017,
775,
11534,
8845,
13,
1678,
14550,
13,
13,
1678,
396,
679,
3017,
8845,
515,
1243,
848,
13,
1678,
411,
1722,
877,
21150,
29914,
1272,
29914,
4691,
29918,
18157,
29889,
2272,
742,
525,
29878,
1495,
408,
285,
29901,
13,
4706,
11451,
29918,
23813,
353,
285,
29889,
949,
580,
13,
13,
1678,
396,
2069,
716,
8845,
10483,
13,
1678,
3017,
29918,
18157,
29918,
1557,
24893,
353,
15758,
362,
4421,
24893,
29898,
13,
4706,
1024,
2433,
7382,
29918,
4270,
29918,
29995,
29879,
29915,
1273,
851,
29898,
25118,
29889,
25118,
29946,
25739,
13,
4706,
20092,
29922,
2272,
29918,
23813,
29892,
13,
4706,
8845,
29918,
1853,
2433,
4691,
742,
13,
4706,
2322,
29918,
3389,
29922,
8824,
13,
1678,
1723,
13,
1678,
3017,
29918,
18157,
29918,
1557,
24893,
29889,
7620,
580,
13,
13,
1678,
396,
12534,
304,
478,
29949,
13,
1678,
478,
29949,
29889,
4691,
29918,
18157,
29918,
1557,
24893,
353,
3017,
29918,
18157,
29918,
1557,
24893,
13,
13,
1678,
396,
4974,
11265,
13,
1678,
4974,
1134,
29898,
24898,
29889,
4691,
29918,
18157,
29918,
1557,
24893,
29889,
333,
29897,
1275,
938,
13,
13,
13,
29992,
2272,
1688,
29889,
3502,
29889,
3389,
29898,
2098,
29922,
29955,
29897,
13,
1753,
1243,
29918,
816,
4579,
1617,
29918,
18157,
29898,
24898,
1125,
13,
1678,
396,
679,
3646,
6475,
13,
1678,
478,
29949,
29889,
8222,
10147,
29918,
11651,
353,
478,
29949,
29889,
7959,
29918,
8222,
10147,
29918,
29883,
9057,
29889,
9057,
29889,
657,
29918,
3757,
4339,
2141,
4102,
580,
13,
1678,
478,
29949,
29889,
9067,
29918,
11651,
353,
478,
29949,
29889,
7959,
29918,
9067,
29918,
29883,
9057,
29889,
9057,
29889,
657,
29918,
3757,
4339,
2141,
4102,
580,
13,
13,
1678,
396,
12725,
4023,
10147,
2407,
411,
1364,
4579,
1617,
13,
1678,
14550,
13,
1678,
16120,
10672,
2302,
310,
29871,
29906,
13,
1678,
14550,
13,
1678,
7186,
29918,
9902,
353,
478,
29949,
29889,
816,
4579,
1617,
29918,
18157,
29918,
1557,
24893,
29889,
15480,
29918,
11651,
29898,
24898,
29889,
8222,
10147,
29918,
11651,
29897,
13,
1678,
4974,
7186,
29918,
9902,
1839,
862,
8485,
16215,
14057,
29918,
2798,
2033,
1275,
29871,
29906,
13,
13,
1678,
396,
12725,
4327,
2407,
411,
1364,
4579,
1617,
13,
1678,
14550,
13,
1678,
16120,
10672,
2302,
310,
29871,
29896,
13,
1678,
14550,
13,
1678,
7186,
29918,
9902,
353,
478,
29949,
29889,
816,
4579,
1617,
29918,
18157,
29918,
1557,
24893,
29889,
15480,
29918,
11651,
29898,
24898,
29889,
9067,
29918,
11651,
29897,
13,
1678,
4974,
7186,
29918,
9902,
1839,
862,
8485,
16215,
14057,
29918,
2798,
2033,
1275,
29871,
29896,
13,
13,
13,
29992,
2272,
1688,
29889,
3502,
29889,
3389,
29898,
2098,
29922,
29947,
29897,
13,
1753,
1243,
29918,
4691,
29918,
18157,
29898,
24898,
1125,
13,
1678,
396,
12725,
4023,
10147,
2407,
411,
3017,
13,
1678,
14550,
13,
1678,
16120,
10672,
2302,
310,
29871,
29896,
13,
1678,
14550,
13,
1678,
7186,
29918,
9902,
353,
478,
29949,
29889,
4691,
29918,
18157,
29918,
1557,
24893,
29889,
15480,
29918,
11651,
29898,
24898,
29889,
8222,
10147,
29918,
11651,
29897,
13,
1678,
1596,
29898,
4270,
29918,
9902,
29897,
13,
1678,
4974,
7186,
29918,
9902,
1839,
862,
8485,
16215,
14057,
29918,
2798,
2033,
1275,
29871,
29896,
13,
13,
1678,
396,
12725,
4327,
2407,
411,
3017,
13,
1678,
14550,
13,
1678,
16120,
10672,
2302,
310,
29871,
29896,
13,
1678,
14550,
13,
1678,
7186,
29918,
9902,
353,
478,
29949,
29889,
4691,
29918,
18157,
29918,
1557,
24893,
29889,
15480,
29918,
11651,
29898,
24898,
29889,
9067,
29918,
11651,
29897,
13,
1678,
1596,
29898,
4270,
29918,
9902,
29897,
13,
1678,
4974,
7186,
29918,
9902,
1839,
862,
8485,
16215,
14057,
29918,
2798,
2033,
1275,
29871,
29896,
13,
13,
13,
29937,
835,
13383,
13383,
13383,
13383,
7346,
2277,
13,
29937,
396,
4321,
18733,
5926,
29914,
15836,
479,
17163,
13,
29937,
835,
13383,
13383,
13383,
13383,
7346,
2277,
13,
13,
29992,
2272,
1688,
29889,
3502,
29889,
3389,
29898,
2098,
29922,
29929,
29897,
13,
1753,
1243,
29918,
14634,
29918,
20908,
5926,
29898,
24898,
1125,
13,
1678,
14550,
13,
1678,
18733,
5926,
4103,
689,
4982,
29892,
15399,
15141,
2825,
8845,
21846,
13,
1678,
14550,
13,
13,
1678,
396,
953,
5987,
2009,
29889,
5438,
13,
1678,
2009,
29918,
8977,
353,
426,
13,
4706,
525,
2585,
1289,
2396,
15516,
13,
4706,
525,
2671,
29918,
655,
2496,
2396,
525,
4381,
742,
13,
4706,
525,
4572,
29918,
700,
412,
29918,
11651,
29918,
4841,
2396,
525,
3009,
742,
13,
4706,
525,
24826,
29918,
2917,
29918,
3126,
2396,
525,
6377,
1202,
29918,
20889,
1338,
1115,
29912,
1118,
29908,
17885,
545,
29918,
12715,
29918,
5975,
1115,
29961,
1402,
29908,
17685,
29918,
5975,
29918,
265,
29918,
497,
29918,
9621,
1115,
4541,
1699,
17685,
29918,
5975,
29918,
265,
29918,
9621,
1115,
29912,
1118,
29908,
8552,
29918,
517,
1115,
29912,
1118,
29908,
8552,
29918,
517,
29918,
13087,
1115,
29912,
1118,
29908,
8552,
29918,
1767,
29918,
517,
29918,
13087,
1115,
29912,
1118,
29908,
2704,
29918,
265,
29918,
6144,
9893,
29918,
22017,
2459,
1115,
4541,
1699,
735,
2325,
29918,
15697,
1115,
29961,
1402,
29908,
735,
2325,
29918,
17664,
1115,
29961,
1402,
29908,
2856,
29918,
497,
29918,
15697,
1115,
4541,
1699,
2856,
29918,
15697,
1115,
29961,
1402,
29908,
2856,
29918,
29879,
747,
1847,
29918,
333,
1115,
4541,
1699,
4713,
2561,
434,
29918,
6144,
326,
4710,
29989,
3284,
3177,
29918,
6144,
326,
4710,
29918,
3284,
1983,
29918,
13506,
29918,
6144,
326,
4710,
29989,
3284,
5992,
29918,
9708,
1000,
29918,
1989,
1115,
3009,
1699,
5992,
29918,
9708,
1000,
29918,
1767,
1115,
4541,
1699,
5992,
29918,
1983,
29918,
13506,
1115,
3009,
1699,
276,
412,
1218,
29918,
5029,
29918,
2146,
600,
861,
29918,
2798,
1115,
4541,
1699,
1311,
29918,
2783,
699,
10549,
1115,
4541,
1699,
11014,
29918,
12715,
29918,
1983,
29918,
311,
16544,
800,
1115,
3009,
1699,
11014,
29918,
276,
412,
1218,
29918,
5975,
1115,
3009,
1699,
11014,
29918,
4632,
1115,
4541,
1699,
5451,
29918,
5975,
29918,
265,
29918,
497,
29918,
9621,
1115,
4541,
1699,
5451,
29918,
5975,
29918,
265,
29918,
9621,
1115,
29912,
930,
742,
13,
4706,
525,
2080,
29918,
267,
29918,
1972,
29918,
791,
345,
2396,
15516,
13,
4706,
525,
2080,
29918,
8058,
936,
29918,
791,
345,
2396,
15516,
13,
4706,
525,
2080,
29918,
3084,
537,
29918,
791,
345,
2396,
525,
497,
742,
13,
4706,
525,
9057,
29918,
978,
2396,
15516,
13,
4706,
525,
9057,
29918,
6812,
2396,
15516,
13,
4706,
525,
768,
29879,
2396,
6629,
13,
1678,
500,
13,
1678,
2346,
29918,
8977,
353,
13641,
21533,
877,
742,
26691,
29922,
5574,
29897,
13,
1678,
2346,
29918,
8977,
29889,
5504,
29898,
3827,
29918,
8977,
29897,
13,
13,
1678,
396,
731,
1881,
17643,
411,
13641,
21533,
29889,
842,
1761,
13,
1678,
2346,
29918,
8977,
29889,
842,
1761,
877,
2080,
29918,
9057,
29918,
333,
742,
518,
13,
4706,
478,
29949,
29889,
7959,
29918,
8222,
10147,
29918,
29883,
9057,
29889,
9057,
29889,
333,
29892,
13,
4706,
478,
29949,
29889,
7959,
29918,
9067,
29918,
29883,
9057,
29889,
9057,
29889,
333,
13,
268,
2314,
13,
1678,
396,
731,
8845,
21846,
411,
13641,
21533,
29889,
842,
1761,
13,
1678,
2346,
29918,
8977,
29889,
842,
1761,
877,
18157,
29918,
1557,
24893,
742,
518,
13,
4706,
478,
29949,
29889,
816,
4579,
1617,
29918,
18157,
29918,
1557,
24893,
29889,
333,
29892,
13,
4706,
478,
29949,
29889,
4691,
29918,
18157,
29918,
1557,
24893,
29889,
333,
13,
268,
2314,
13,
13,
1678,
396,
2069,
4982,
13,
1678,
274,
9057,
353,
422,
26062,
11947,
29889,
2344,
29918,
17743,
457,
29918,
9057,
29898,
13,
4706,
1404,
29922,
24898,
29889,
1792,
29892,
13,
4706,
2407,
29918,
2972,
29922,
24898,
29889,
11007,
29892,
13,
4706,
4982,
29918,
1853,
29918,
1990,
29922,
15836,
479,
11947,
29892,
13,
4706,
4982,
29918,
7529,
29922,
1972,
29918,
8977,
29897,
13,
13,
1678,
396,
1369,
4982,
322,
2767,
4660,
13,
1678,
4982,
29918,
4882,
353,
274,
9057,
29889,
2962,
29918,
9057,
580,
13,
13,
1678,
396,
565,
4982,
29918,
4882,
338,
29207,
29892,
3461,
4982,
4660,
408,
5229,
13,
1678,
565,
4982,
29918,
4882,
1275,
7700,
29901,
13,
4706,
274,
9057,
29889,
9057,
29889,
4882,
353,
525,
26061,
29915,
13,
4706,
274,
9057,
29889,
9057,
29889,
7620,
580,
13,
13,
1678,
396,
21180,
2745,
4866,
13,
1678,
363,
921,
297,
3464,
29898,
29900,
29892,
29871,
29946,
29947,
29900,
1125,
13,
13,
4706,
396,
19957,
13,
4706,
931,
29889,
17059,
29898,
29896,
29897,
13,
13,
4706,
396,
11086,
4867,
13,
4706,
274,
9057,
29889,
9057,
29889,
5504,
29918,
4882,
580,
13,
13,
4706,
396,
1423,
4660,
13,
4706,
565,
274,
9057,
29889,
9057,
29889,
4882,
2804,
525,
16515,
2396,
13,
9651,
6773,
13,
4706,
1683,
29901,
13,
9651,
2867,
13,
13,
1678,
396,
4078,
2294,
4023,
10147,
4982,
304,
478,
29949,
13,
1678,
478,
29949,
29889,
14634,
29918,
29883,
9057,
353,
274,
9057,
13,
13,
1678,
396,
4974,
4982,
338,
2309,
322,
3625,
3025,
7294,
29891,
13,
1678,
4974,
478,
29949,
29889,
14634,
29918,
29883,
9057,
29889,
9057,
29889,
4882,
1275,
525,
16515,
29915,
13,
13,
1678,
396,
4974,
2407,
2302,
338,
29871,
29906,
29945,
29900,
13,
1678,
4974,
478,
29949,
29889,
14634,
29918,
29883,
9057,
29889,
9057,
29889,
11651,
29918,
2798,
1275,
29871,
29906,
29945,
29900,
13,
13,
1678,
396,
4974,
8845,
21846,
7436,
13,
1678,
4982,
29918,
18157,
29918,
1557,
264,
8596,
353,
478,
29949,
29889,
14634,
29918,
29883,
9057,
29889,
9057,
29889,
9057,
18157,
29918,
842,
29889,
497,
580,
13,
1678,
4974,
4982,
29918,
18157,
29918,
1557,
264,
8596,
29889,
2798,
580,
1275,
29871,
29906,
13,
13,
1678,
396,
2425,
1549,
8845,
21846,
322,
9659,
393,
1716,
1510,
29871,
29906,
29945,
29900,
4418,
1973,
13,
1678,
363,
432,
29894,
297,
4982,
29918,
18157,
29918,
1557,
264,
8596,
29901,
13,
4706,
4974,
432,
29894,
29889,
657,
29918,
11651,
29918,
18157,
29918,
14057,
1973,
2141,
2798,
580,
1275,
29871,
29906,
29941,
29906,
13,
13,
1678,
396,
4974,
694,
26190,
4418,
1973,
13,
1678,
4974,
7431,
29898,
24898,
29889,
14634,
29918,
29883,
9057,
29889,
657,
29918,
2248,
292,
29918,
14057,
1973,
3101,
1275,
29871,
29900,
13,
13,
13,
13383,
13383,
13383,
13383,
7346,
4136,
29937,
13,
29937,
4321,
29879,
1920,
538,
776,
13,
13383,
13383,
13383,
13383,
7346,
4136,
29937,
13,
13,
29992,
2272,
1688,
29889,
3502,
29889,
4230,
13,
1753,
1243,
29918,
371,
538,
776,
29898,
17462,
29918,
3757,
4339,
29892,
478,
29949,
1125,
13,
1678,
14550,
13,
1678,
4321,
734,
538,
776,
13,
1678,
14550,
13,
13,
1678,
396,
4974,
5217,
310,
1638,
322,
4344,
13,
1678,
565,
451,
3013,
29918,
3757,
4339,
29901,
13,
4706,
4974,
478,
29949,
29889,
990,
29889,
8143,
580,
29961,
29900,
29962,
1405,
29871,
29900,
13,
1678,
1683,
29901,
13,
4706,
4974,
5852,
13,
13,
1678,
4974,
478,
29949,
29889,
816,
4579,
1617,
29918,
18157,
29918,
1557,
24893,
29889,
8143,
580,
29961,
29900,
29962,
1405,
29871,
29900,
13,
1678,
4974,
478,
29949,
29889,
4691,
29918,
18157,
29918,
1557,
24893,
29889,
8143,
580,
29961,
29900,
29962,
1405,
29871,
29900,
13,
2
] |
gcp-cli/client/util/util_dpm.py | lacework/csp-integrations | 1 | 48359 | <filename>gcp-cli/client/util/util_dpm.py
from __future__ import print_function
from __future__ import absolute_import
from builtins import input
from builtins import str
import logging
from .util_base import UtilBase
from . import util_template
HTTP_GET_METHOD = "GET"
HTTP_POST_METHOD = "POST"
HTTP_DELETE_METHOD = "DELETE"
SERVICE_ACCOUNT_ID = "lacework-cfg-sa"
GET_DEPLOYMENT_URL= "https://www.googleapis.com/deploymentmanager/v2/projects/%projectId/global/deployments/%deployment"
GET_DEPLOYMENTS_URL= "https://www.googleapis.com/deploymentmanager/v2/projects/%projectId/global/deployments"
from client.config.client_helper import ClientHelper
import time
SLEEP_SECS = 20
class UtilDpm(UtilBase):
def __init__(self):
UtilBase.__init__(self)
def checkIfDeploymentExists(self, projectId, deployment):
isinstance(self.getHttpClient(), ClientHelper)
url = GET_DEPLOYMENT_URL.replace("%deployment", deployment)
deployment = self.getHttpClient().make_request(HTTP_GET_METHOD, url, projectId, None)
if deployment['isError']:
if deployment['defaultErrorObject'].get("status") == 404:
return False
else:
raise Exception("Error fetching deployment: \n" + str(deployment['defaultErrorObject']))
return True
def getDeploymentDetails(self, projectId, deployment):
isinstance(self.getHttpClient(), ClientHelper)
url = GET_DEPLOYMENT_URL.replace("%deployment", deployment)
deployment = self.getHttpClient().make_request(HTTP_GET_METHOD, url, projectId, None)
if deployment['isError']:
raise Exception("Error fetching deployment: \n" + str(deployment['defaultErrorObject']))
return deployment["data"]
def deploymentWait(self, setupProjectId, deploymentName):
while (True):
deployment = self.getDeploymentDetails(setupProjectId, deploymentName)
if (deployment["operation"]["status"] == "DONE" and "error" in deployment["operation"]):
logging.warning("Deployment has failed, please run again and check configuration")
logging.warning("Rolling back and deleting failed deployment")
self.deleteDeployment(setupProjectId, deploymentName)
logging.error(str(deployment["operation"]["error"]))
return None
elif (deployment["operation"]["status"] == "RUNNING"):
if (deployment["operation"]["operationType"] == "insert"):
logging.info("Deployment is running! Sleeping for " + str(SLEEP_SECS) + " seconds before checking again")
print("Deployment is running! Sleeping for " + str(SLEEP_SECS) + " seconds before checking again")
time.sleep(SLEEP_SECS)
else:
raise Exception("The deployment with name " + deploymentName + " is being used or being deleted, please wait until all operations are done!")
else:
logging.info("Deployment has been created and successfully deployed!")
return self.getDeploymentOutput(deployment["manifest"])
def getDeploymentOutput(self, url):
isinstance(self.getHttpClient(), ClientHelper)
manifest = self.getHttpClient().make_request(HTTP_GET_METHOD, url, None, None)
if manifest['isError']:
raise Exception("Error fetching deployment: \n" + str(manifest["defaultErrorObject"]))
return manifest["data"]["layout"]
def deleteDeployment(self, projectId, deploymentName):
isinstance(self.getHttpClient(), ClientHelper)
logging.info("Deleting deployment with name: " + deploymentName)
url = GET_DEPLOYMENT_URL.replace("%deployment", deploymentName)
deployment = self.getHttpClient().make_request(HTTP_DELETE_METHOD, url, projectId, None)
if deployment['isError']:
raise Exception("Error deleting deployment: \n" + str(deployment['defaultErrorObject']))
logging.info("Deployment with name " + deploymentName + " has been deleted")
return deployment['data']
def createDeployment(self, config, deploymentName):
logging.info("Creating the request body to be sent to the deployment manager")
body = self.buildDeploymentBody(config, deploymentName)
projectId = config.getSetupProjectId()
isinstance(self.getHttpClient(), ClientHelper)
logging.info("Creating new deployment named " + deploymentName + " in project " + projectId)
deployment = self.getHttpClient().make_request(HTTP_POST_METHOD, GET_DEPLOYMENTS_URL, projectId, body)
if deployment['isError']:
raise Exception("Error creating deployment: \n" + str(deployment['defaultErrorObject']))
return deployment['data']
def buildDeploymentBody(self, config, deploymentName):
setupPrefix = config.getSetupPrefix()
projectId = config.getSetupProjectId()
resources = util_template.SERVICE_ACCOUNT
if (config.isAuditLogSetup()):
if (not config.doesBucketExist()):
resources = resources + util_template.BUCKET_CREATION
resources = resources + util_template.TOPIC_CREATION
resources = resources + util_template.SUBSCRIPTION_CREATION
resources = resources + util_template.NOTIFICATION_CREATION
idType = config.getAuditSetupType()
id = config.getAuditSetupId()
sinkAndBucketBinding = util_template.SINK_CREATION
if not config.doesBucketExist():
sinkAndBucketBinding += util_template.BUCKET_DEPENDENCY
sinkAndBucketBinding += util_template.BUCKET_BINDING
if (idType == "ORGANIZATION"):
sinkAndBucketBinding = sinkAndBucketBinding.replace("%resourceTypeAudit", "organizations")
sinkAndBucketBinding = sinkAndBucketBinding.replace("%resourceTypeSingle", "organization")
elif (idType == "PROJECT"):
sinkAndBucketBinding = sinkAndBucketBinding.replace("%resourceTypeAudit", "projects")
sinkAndBucketBinding = sinkAndBucketBinding.replace("%resourceTypeSingle", "project")
else:
sinkAndBucketBinding = sinkAndBucketBinding.replace("%resourceTypeAudit", "folders")
sinkAndBucketBinding = sinkAndBucketBinding.replace("%resourceTypeSingle", "folder")
sinkAndBucketBinding = sinkAndBucketBinding.replace("%resourceIdAudit", id)
sinkAndBucketBinding = sinkAndBucketBinding.replace("%sinkProp", setupPrefix + "-" + id + "-lacework-sink")
sinkAndBucketBinding = sinkAndBucketBinding.replace("%bucketBindingName", setupPrefix+ "-" + id + "-bucket-binding")
resources = resources + sinkAndBucketBinding
if config.customRole():
resources = resources + util_template.CUSTOM_ROLE
resources = resources + util_template.ASSIGN_ROLE
resources = resources + util_template.VIEWER_BINDING
resources = resources + util_template.SECURITY_REVIEWER_BINDING
if (config.getComplianceSetupType() == "ORGANIZATION"):
resources = resources + util_template.ORG_VIEWER_BINDING
resources = resources + util_template.ACCOUNT_KEY
resources = resources + util_template.OUTPUT
resources = resources + util_template.OUTPUT_KEY
if (config.isAuditLogSetup()):
if config.doesBucketExist():
resources = resources + util_template.OUTPUT_SINK
else:
resources = resources + util_template.OUTPUT_SUBSCRIPTION
id = config.getAuditSetupId()
resources = resources.replace("%sinkName", setupPrefix + "-" + projectId + "-" + id + "-lacework-sink")
if config.customRole():
if (config.getComplianceSetupType() == "ORGANIZATION"):
resources = resources.replace("%customRole", setupPrefix + "-lacework-custom-role-org")
resources = resources.replace("%roleType", "organizations")
resources = resources.replace("%roleId", setupPrefix.replace("-","") + config.getComplianceSetupId() + "laceworkCustomRoleOrg")
resources = resources.replace("%roleParent", "organizations/" + config.getComplianceSetupId())
elif (config.getComplianceSetupType() == "PROJECT"):
resources = resources.replace("%customRole", setupPrefix + "-lacework-custom-role-project")
resources = resources.replace("%roleId", setupPrefix.replace("-","") + projectId.replace("-", "") + "laceworkCustomRoleProject")
resources = resources.replace("%roleType", "projects")
resources = resources.replace("%roleParent", "projects/" + projectId)
resources = resources.replace("%setRoleName", setupPrefix + "-lacework-role-assignment")
resources = resources.replace("%serviceAccountName", setupPrefix + "-" + projectId + "-" + "lacework-serviceaccnt")
resources = resources.replace("%serviceAccountId", setupPrefix + "-" + SERVICE_ACCOUNT_ID)
if config.doesBucketExist():
resources = resources.replace("$(ref.%bucketName.name)", config.getExistingBucketName())
resources = resources.replace("%projectNumber", config.getBucketParent())
else:
resources = resources.replace("%bucketName", setupPrefix + "-" + projectId + "-" + "lacework-bucket")
resources = resources.replace("%projectNumber", config.getSetupProjectNumber())
resources = resources.replace("%projectId", projectId)
resources = resources.replace("%topicName", setupPrefix + "-" + projectId + "-" + "lacework-topic")
resources = resources.replace("%topicProp", setupPrefix + "-" + projectId + "-" + "lacework-topic-prop")
resources = resources.replace("%subscriptionName", setupPrefix + "-" + projectId + "-" + "lacework-subscription")
resources = resources.replace("%subscriptionProp", setupPrefix + "-" + projectId + "-" + "lacework-subscription-prop")
resources = resources.replace("%notificationName", setupPrefix + "-" + projectId + "-" + "lacework-notification")
resources = resources.replace("%setupPrefix", setupPrefix)
if (config.getComplianceSetupType() == "ORGANIZATION"):
resources = resources.replace("%resourceType", "organizations")
resources = resources.replace("%resourceId", "organizations/" + config.getComplianceSetupId())
else:
resources = resources.replace("%resourceType", "projects")
resources = resources.replace("%resourceId", projectId)
print(resources)
print("Please review the above configuration to be deployed")
if config.getToIntegrate():
print("This deployment will be integrated with following lacework account: " + config.getLaceworkAccount())
while (True):
userInput = input("Accept? (Y/N): ")
userInput = userInput.lower()
if (userInput == "n" or userInput == "no"):
raise Exception("Created configuration rejected by user, please check the config.yml")
elif (userInput == "y" or userInput == "yes"):
body = {
"name" : deploymentName,
"target" : {
"config" : {
"content" : resources
}
}
}
return body
else:
print ("Please enter valid input")
| [
1,
529,
9507,
29958,
29887,
6814,
29899,
11303,
29914,
4645,
29914,
4422,
29914,
4422,
29918,
29881,
3358,
29889,
2272,
13,
3166,
4770,
29888,
9130,
1649,
1053,
1596,
29918,
2220,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8380,
29918,
5215,
13,
3166,
4240,
1144,
1053,
1881,
13,
3166,
4240,
1144,
1053,
851,
13,
5215,
12183,
13,
3166,
869,
4422,
29918,
3188,
1053,
22310,
5160,
13,
3166,
869,
1053,
3667,
29918,
6886,
13,
13,
10493,
29918,
7194,
29918,
2303,
4690,
13668,
353,
376,
7194,
29908,
13,
10493,
29918,
5438,
29918,
2303,
4690,
13668,
353,
376,
5438,
29908,
13,
10493,
29918,
2287,
18476,
29918,
2303,
4690,
13668,
353,
376,
2287,
18476,
29908,
13,
6304,
19059,
29918,
2477,
18736,
29918,
1367,
353,
376,
1265,
1287,
29899,
16859,
29899,
4977,
29908,
13,
13,
7194,
29918,
2287,
29925,
3927,
29979,
13780,
29918,
4219,
29922,
376,
991,
597,
1636,
29889,
15947,
29889,
510,
29914,
16519,
358,
12847,
29914,
29894,
29906,
29914,
16418,
22584,
4836,
1204,
29914,
10945,
29914,
16519,
1860,
22584,
16519,
358,
29908,
13,
7194,
29918,
2287,
29925,
3927,
29979,
13780,
29903,
29918,
4219,
29922,
376,
991,
597,
1636,
29889,
15947,
29889,
510,
29914,
16519,
358,
12847,
29914,
29894,
29906,
29914,
16418,
22584,
4836,
1204,
29914,
10945,
29914,
16519,
1860,
29908,
13,
3166,
3132,
29889,
2917,
29889,
4645,
29918,
20907,
1053,
12477,
10739,
13,
5215,
931,
13,
29903,
1307,
15488,
29918,
1660,
9295,
353,
29871,
29906,
29900,
13,
13,
1990,
22310,
29928,
3358,
29898,
7270,
5160,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
22310,
5160,
17255,
2344,
12035,
1311,
29897,
13,
13,
1678,
822,
1423,
3644,
8498,
22812,
24217,
29898,
1311,
29892,
2060,
1204,
29892,
18209,
1125,
13,
4706,
338,
8758,
29898,
1311,
29889,
657,
5506,
4032,
3285,
12477,
10739,
29897,
13,
4706,
3142,
353,
12354,
29918,
2287,
29925,
3927,
29979,
13780,
29918,
4219,
29889,
6506,
11702,
16519,
358,
613,
18209,
29897,
13,
4706,
18209,
353,
1583,
29889,
657,
5506,
4032,
2141,
5675,
29918,
3827,
29898,
10493,
29918,
7194,
29918,
2303,
4690,
13668,
29892,
3142,
29892,
2060,
1204,
29892,
6213,
29897,
13,
4706,
565,
18209,
1839,
275,
2392,
2033,
29901,
13,
9651,
565,
18209,
1839,
4381,
2392,
2061,
13359,
657,
703,
4882,
1159,
1275,
29871,
29946,
29900,
29946,
29901,
13,
18884,
736,
7700,
13,
9651,
1683,
29901,
13,
18884,
12020,
8960,
703,
2392,
6699,
292,
18209,
29901,
320,
29876,
29908,
718,
851,
29898,
16519,
358,
1839,
4381,
2392,
2061,
25901,
13,
4706,
736,
5852,
13,
13,
1678,
822,
679,
8498,
22812,
10602,
29898,
1311,
29892,
2060,
1204,
29892,
18209,
1125,
13,
4706,
338,
8758,
29898,
1311,
29889,
657,
5506,
4032,
3285,
12477,
10739,
29897,
13,
4706,
3142,
353,
12354,
29918,
2287,
29925,
3927,
29979,
13780,
29918,
4219,
29889,
6506,
11702,
16519,
358,
613,
18209,
29897,
13,
4706,
18209,
353,
1583,
29889,
657,
5506,
4032,
2141,
5675,
29918,
3827,
29898,
10493,
29918,
7194,
29918,
2303,
4690,
13668,
29892,
3142,
29892,
2060,
1204,
29892,
6213,
29897,
13,
4706,
565,
18209,
1839,
275,
2392,
2033,
29901,
13,
9651,
12020,
8960,
703,
2392,
6699,
292,
18209,
29901,
320,
29876,
29908,
718,
851,
29898,
16519,
358,
1839,
4381,
2392,
2061,
25901,
13,
4706,
736,
18209,
3366,
1272,
3108,
13,
13,
1678,
822,
18209,
15716,
29898,
1311,
29892,
6230,
7653,
1204,
29892,
18209,
1170,
1125,
13,
4706,
1550,
313,
5574,
1125,
13,
9651,
18209,
353,
1583,
29889,
657,
8498,
22812,
10602,
29898,
14669,
7653,
1204,
29892,
18209,
1170,
29897,
13,
9651,
565,
313,
16519,
358,
3366,
16453,
3108,
3366,
4882,
3108,
1275,
376,
29928,
12413,
29908,
322,
376,
2704,
29908,
297,
18209,
3366,
16453,
3108,
1125,
13,
18884,
12183,
29889,
27392,
703,
8498,
22812,
756,
5229,
29892,
3113,
1065,
1449,
322,
1423,
5285,
1159,
13,
18884,
12183,
29889,
27392,
703,
29934,
324,
1847,
1250,
322,
21228,
5229,
18209,
1159,
13,
18884,
1583,
29889,
8143,
8498,
22812,
29898,
14669,
7653,
1204,
29892,
18209,
1170,
29897,
13,
18884,
12183,
29889,
2704,
29898,
710,
29898,
16519,
358,
3366,
16453,
3108,
3366,
2704,
3108,
876,
13,
18884,
736,
6213,
13,
9651,
25342,
313,
16519,
358,
3366,
16453,
3108,
3366,
4882,
3108,
1275,
376,
29934,
3904,
29940,
4214,
29908,
1125,
13,
18884,
565,
313,
16519,
358,
3366,
16453,
3108,
3366,
16453,
1542,
3108,
1275,
376,
7851,
29908,
1125,
13,
462,
1678,
12183,
29889,
3888,
703,
8498,
22812,
338,
2734,
29991,
317,
5436,
292,
363,
376,
718,
851,
29898,
29903,
1307,
15488,
29918,
1660,
9295,
29897,
718,
376,
6923,
1434,
8454,
1449,
1159,
13,
462,
1678,
1596,
703,
8498,
22812,
338,
2734,
29991,
317,
5436,
292,
363,
376,
718,
851,
29898,
29903,
1307,
15488,
29918,
1660,
9295,
29897,
718,
376,
6923,
1434,
8454,
1449,
1159,
13,
462,
1678,
931,
29889,
17059,
29898,
29903,
1307,
15488,
29918,
1660,
9295,
29897,
13,
18884,
1683,
29901,
13,
462,
1678,
12020,
8960,
703,
1576,
18209,
411,
1024,
376,
718,
18209,
1170,
718,
376,
338,
1641,
1304,
470,
1641,
11132,
29892,
3113,
4480,
2745,
599,
6931,
526,
2309,
29991,
1159,
13,
9651,
1683,
29901,
13,
18884,
12183,
29889,
3888,
703,
8498,
22812,
756,
1063,
2825,
322,
8472,
21168,
29991,
1159,
13,
18884,
736,
1583,
29889,
657,
8498,
22812,
6466,
29898,
16519,
358,
3366,
29135,
20068,
13,
13,
1678,
822,
679,
8498,
22812,
6466,
29898,
1311,
29892,
3142,
1125,
13,
4706,
338,
8758,
29898,
1311,
29889,
657,
5506,
4032,
3285,
12477,
10739,
29897,
13,
4706,
10419,
353,
1583,
29889,
657,
5506,
4032,
2141,
5675,
29918,
3827,
29898,
10493,
29918,
7194,
29918,
2303,
4690,
13668,
29892,
3142,
29892,
6213,
29892,
6213,
29897,
13,
4706,
565,
10419,
1839,
275,
2392,
2033,
29901,
13,
9651,
12020,
8960,
703,
2392,
6699,
292,
18209,
29901,
320,
29876,
29908,
718,
851,
29898,
29135,
3366,
4381,
2392,
2061,
3108,
876,
13,
4706,
736,
10419,
3366,
1272,
3108,
3366,
2680,
3108,
13,
13,
1678,
822,
5217,
8498,
22812,
29898,
1311,
29892,
2060,
1204,
29892,
18209,
1170,
1125,
13,
4706,
338,
8758,
29898,
1311,
29889,
657,
5506,
4032,
3285,
12477,
10739,
29897,
13,
4706,
12183,
29889,
3888,
703,
2772,
1026,
292,
18209,
411,
1024,
29901,
376,
718,
18209,
1170,
29897,
13,
4706,
3142,
353,
12354,
29918,
2287,
29925,
3927,
29979,
13780,
29918,
4219,
29889,
6506,
11702,
16519,
358,
613,
18209,
1170,
29897,
13,
4706,
18209,
353,
1583,
29889,
657,
5506,
4032,
2141,
5675,
29918,
3827,
29898,
10493,
29918,
2287,
18476,
29918,
2303,
4690,
13668,
29892,
3142,
29892,
2060,
1204,
29892,
6213,
29897,
13,
4706,
565,
18209,
1839,
275,
2392,
2033,
29901,
13,
9651,
12020,
8960,
703,
2392,
21228,
18209,
29901,
320,
29876,
29908,
718,
851,
29898,
16519,
358,
1839,
4381,
2392,
2061,
25901,
13,
4706,
12183,
29889,
3888,
703,
8498,
22812,
411,
1024,
376,
718,
18209,
1170,
718,
376,
756,
1063,
11132,
1159,
13,
4706,
736,
18209,
1839,
1272,
2033,
13,
13,
1678,
822,
1653,
8498,
22812,
29898,
1311,
29892,
2295,
29892,
18209,
1170,
1125,
13,
4706,
12183,
29889,
3888,
703,
9832,
1218,
278,
2009,
3573,
304,
367,
2665,
304,
278,
18209,
8455,
1159,
13,
4706,
3573,
353,
1583,
29889,
4282,
8498,
22812,
8434,
29898,
2917,
29892,
18209,
1170,
29897,
13,
4706,
2060,
1204,
353,
2295,
29889,
657,
26947,
7653,
1204,
580,
13,
4706,
338,
8758,
29898,
1311,
29889,
657,
5506,
4032,
3285,
12477,
10739,
29897,
13,
4706,
12183,
29889,
3888,
703,
9832,
1218,
716,
18209,
4257,
376,
718,
18209,
1170,
718,
376,
297,
2060,
376,
718,
2060,
1204,
29897,
13,
4706,
18209,
353,
1583,
29889,
657,
5506,
4032,
2141,
5675,
29918,
3827,
29898,
10493,
29918,
5438,
29918,
2303,
4690,
13668,
29892,
12354,
29918,
2287,
29925,
3927,
29979,
13780,
29903,
29918,
4219,
29892,
2060,
1204,
29892,
3573,
29897,
13,
4706,
565,
18209,
1839,
275,
2392,
2033,
29901,
13,
9651,
12020,
8960,
703,
2392,
4969,
18209,
29901,
320,
29876,
29908,
718,
851,
29898,
16519,
358,
1839,
4381,
2392,
2061,
25901,
13,
4706,
736,
18209,
1839,
1272,
2033,
13,
13,
1678,
822,
2048,
8498,
22812,
8434,
29898,
1311,
29892,
2295,
29892,
18209,
1170,
1125,
13,
4706,
6230,
23095,
353,
2295,
29889,
657,
26947,
23095,
580,
13,
4706,
2060,
1204,
353,
2295,
29889,
657,
26947,
7653,
1204,
580,
13,
13,
4706,
7788,
353,
3667,
29918,
6886,
29889,
6304,
19059,
29918,
2477,
18736,
13,
4706,
565,
313,
2917,
29889,
275,
29909,
566,
277,
3403,
26947,
580,
1125,
13,
9651,
565,
313,
1333,
2295,
29889,
13221,
29933,
2707,
300,
1252,
391,
580,
1125,
13,
18884,
7788,
353,
7788,
718,
3667,
29918,
6886,
29889,
7838,
7077,
2544,
29918,
22245,
8098,
13,
18884,
7788,
353,
7788,
718,
3667,
29918,
6886,
29889,
4986,
2227,
29907,
29918,
22245,
8098,
13,
18884,
7788,
353,
7788,
718,
3667,
29918,
6886,
29889,
20633,
7187,
24290,
2725,
29918,
22245,
8098,
13,
18884,
7788,
353,
7788,
718,
3667,
29918,
6886,
29889,
12256,
6545,
28541,
29918,
22245,
8098,
13,
9651,
1178,
1542,
353,
2295,
29889,
657,
29909,
566,
277,
26947,
1542,
580,
13,
9651,
1178,
353,
2295,
29889,
657,
29909,
566,
277,
26947,
1204,
580,
13,
9651,
28169,
2855,
29933,
2707,
300,
9270,
353,
3667,
29918,
6886,
29889,
29903,
1177,
29968,
29918,
22245,
8098,
13,
9651,
565,
451,
2295,
29889,
13221,
29933,
2707,
300,
1252,
391,
7295,
13,
18884,
28169,
2855,
29933,
2707,
300,
9270,
4619,
3667,
29918,
6886,
29889,
7838,
7077,
2544,
29918,
2287,
29925,
11794,
1430,
29907,
29979,
13,
18884,
28169,
2855,
29933,
2707,
300,
9270,
4619,
3667,
29918,
6886,
29889,
7838,
7077,
2544,
29918,
29933,
22255,
4214,
13,
9651,
565,
313,
333,
1542,
1275,
376,
1955,
29954,
2190,
26664,
8098,
29908,
1125,
13,
18884,
28169,
2855,
29933,
2707,
300,
9270,
353,
28169,
2855,
29933,
2707,
300,
9270,
29889,
6506,
11702,
10314,
1542,
29909,
566,
277,
613,
376,
6388,
17063,
1159,
13,
18884,
28169,
2855,
29933,
2707,
300,
9270,
353,
28169,
2855,
29933,
2707,
300,
9270,
29889,
6506,
11702,
10314,
1542,
15771,
613,
376,
6388,
2133,
1159,
13,
9651,
25342,
313,
333,
1542,
1275,
376,
8618,
17637,
29908,
1125,
13,
18884,
28169,
2855,
29933,
2707,
300,
9270,
353,
28169,
2855,
29933,
2707,
300,
9270,
29889,
6506,
11702,
10314,
1542,
29909,
566,
277,
613,
376,
16418,
1159,
13,
18884,
28169,
2855,
29933,
2707,
300,
9270,
353,
28169,
2855,
29933,
2707,
300,
9270,
29889,
6506,
11702,
10314,
1542,
15771,
613,
376,
4836,
1159,
13,
9651,
1683,
29901,
13,
18884,
28169,
2855,
29933,
2707,
300,
9270,
353,
28169,
2855,
29933,
2707,
300,
9270,
29889,
6506,
11702,
10314,
1542,
29909,
566,
277,
613,
376,
8771,
414,
1159,
13,
18884,
28169,
2855,
29933,
2707,
300,
9270,
353,
28169,
2855,
29933,
2707,
300,
9270,
29889,
6506,
11702,
10314,
1542,
15771,
613,
376,
12083,
1159,
13,
9651,
28169,
2855,
29933,
2707,
300,
9270,
353,
28169,
2855,
29933,
2707,
300,
9270,
29889,
6506,
11702,
10314,
1204,
29909,
566,
277,
613,
1178,
29897,
13,
9651,
28169,
2855,
29933,
2707,
300,
9270,
353,
28169,
2855,
29933,
2707,
300,
9270,
29889,
6506,
11702,
29879,
682,
20420,
613,
6230,
23095,
718,
11663,
29908,
718,
1178,
718,
11663,
1265,
1287,
29899,
29879,
682,
1159,
13,
9651,
28169,
2855,
29933,
2707,
300,
9270,
353,
28169,
2855,
29933,
2707,
300,
9270,
29889,
6506,
11702,
21454,
9270,
1170,
613,
6230,
23095,
29974,
11663,
29908,
718,
1178,
718,
11663,
21454,
29899,
19672,
1159,
13,
9651,
7788,
353,
7788,
718,
28169,
2855,
29933,
2707,
300,
9270,
13,
13,
4706,
565,
2295,
29889,
6341,
16727,
7295,
13,
9651,
7788,
353,
7788,
718,
3667,
29918,
6886,
29889,
29907,
17321,
6488,
29918,
1672,
1307,
13,
9651,
7788,
353,
7788,
718,
3667,
29918,
6886,
29889,
22933,
17298,
29918,
1672,
1307,
13,
4706,
7788,
353,
7788,
718,
3667,
29918,
6886,
29889,
29963,
8673,
29956,
1001,
29918,
29933,
22255,
4214,
13,
4706,
7788,
353,
7788,
718,
3667,
29918,
6886,
29889,
1660,
22484,
11937,
29918,
1525,
29963,
8673,
29956,
1001,
29918,
29933,
22255,
4214,
13,
4706,
565,
313,
2917,
29889,
657,
6843,
13036,
26947,
1542,
580,
1275,
376,
1955,
29954,
2190,
26664,
8098,
29908,
1125,
13,
9651,
7788,
353,
7788,
718,
3667,
29918,
6886,
29889,
1955,
29954,
29918,
29963,
8673,
29956,
1001,
29918,
29933,
22255,
4214,
13,
4706,
7788,
353,
7788,
718,
3667,
29918,
6886,
29889,
2477,
18736,
29918,
10818,
13,
13,
4706,
7788,
353,
7788,
718,
3667,
29918,
6886,
29889,
12015,
12336,
13,
4706,
7788,
353,
7788,
718,
3667,
29918,
6886,
29889,
12015,
12336,
29918,
10818,
13,
4706,
565,
313,
2917,
29889,
275,
29909,
566,
277,
3403,
26947,
580,
1125,
13,
9651,
565,
2295,
29889,
13221,
29933,
2707,
300,
1252,
391,
7295,
13,
18884,
7788,
353,
7788,
718,
3667,
29918,
6886,
29889,
12015,
12336,
29918,
29903,
1177,
29968,
13,
9651,
1683,
29901,
13,
18884,
7788,
353,
7788,
718,
3667,
29918,
6886,
29889,
12015,
12336,
29918,
20633,
7187,
24290,
2725,
13,
9651,
1178,
353,
2295,
29889,
657,
29909,
566,
277,
26947,
1204,
580,
13,
9651,
7788,
353,
7788,
29889,
6506,
11702,
29879,
682,
1170,
613,
6230,
23095,
718,
11663,
29908,
718,
2060,
1204,
718,
11663,
29908,
718,
1178,
718,
11663,
1265,
1287,
29899,
29879,
682,
1159,
13,
13,
4706,
565,
2295,
29889,
6341,
16727,
7295,
13,
9651,
565,
313,
2917,
29889,
657,
6843,
13036,
26947,
1542,
580,
1275,
376,
1955,
29954,
2190,
26664,
8098,
29908,
1125,
13,
18884,
7788,
353,
7788,
29889,
6506,
11702,
6341,
16727,
613,
6230,
23095,
718,
11663,
1265,
1287,
29899,
6341,
29899,
12154,
29899,
990,
1159,
13,
18884,
7788,
353,
7788,
29889,
6506,
11702,
12154,
1542,
613,
376,
6388,
17063,
1159,
13,
18884,
7788,
353,
7788,
29889,
6506,
11702,
12154,
1204,
613,
6230,
23095,
29889,
6506,
703,
29899,
3284,
1159,
718,
2295,
29889,
657,
6843,
13036,
26947,
1204,
580,
718,
376,
1265,
1287,
7281,
16727,
2816,
29887,
1159,
13,
18884,
7788,
353,
7788,
29889,
6506,
11702,
12154,
9780,
613,
376,
6388,
17063,
12975,
718,
2295,
29889,
657,
6843,
13036,
26947,
1204,
3101,
13,
9651,
25342,
313,
2917,
29889,
657,
6843,
13036,
26947,
1542,
580,
1275,
376,
8618,
17637,
29908,
1125,
13,
18884,
7788,
353,
7788,
29889,
6506,
11702,
6341,
16727,
613,
6230,
23095,
718,
11663,
1265,
1287,
29899,
6341,
29899,
12154,
29899,
4836,
1159,
13,
18884,
7788,
353,
7788,
29889,
6506,
11702,
12154,
1204,
613,
6230,
23095,
29889,
6506,
703,
29899,
3284,
1159,
718,
2060,
1204,
29889,
6506,
703,
29899,
613,
20569,
718,
376,
1265,
1287,
7281,
16727,
7653,
1159,
13,
18884,
7788,
353,
7788,
29889,
6506,
11702,
12154,
1542,
613,
376,
16418,
1159,
13,
18884,
7788,
353,
7788,
29889,
6506,
11702,
12154,
9780,
613,
376,
16418,
12975,
718,
2060,
1204,
29897,
13,
13,
4706,
7788,
353,
7788,
29889,
6506,
11702,
842,
16727,
1170,
613,
6230,
23095,
718,
11663,
1265,
1287,
29899,
12154,
29899,
465,
10194,
1159,
13,
4706,
7788,
353,
7788,
29889,
6506,
11702,
5509,
10601,
1170,
613,
6230,
23095,
718,
11663,
29908,
718,
2060,
1204,
718,
11663,
29908,
718,
376,
1265,
1287,
29899,
5509,
5753,
593,
1159,
13,
4706,
7788,
353,
7788,
29889,
6506,
11702,
5509,
10601,
1204,
613,
6230,
23095,
718,
11663,
29908,
718,
26996,
19059,
29918,
2477,
18736,
29918,
1367,
29897,
13,
4706,
565,
2295,
29889,
13221,
29933,
2707,
300,
1252,
391,
7295,
13,
9651,
7788,
353,
7788,
29889,
6506,
703,
12330,
999,
29889,
29995,
21454,
1170,
29889,
978,
19123,
2295,
29889,
657,
1252,
15423,
29933,
2707,
300,
1170,
3101,
13,
9651,
7788,
353,
7788,
29889,
6506,
11702,
4836,
4557,
613,
2295,
29889,
657,
29933,
2707,
300,
9780,
3101,
13,
4706,
1683,
29901,
13,
9651,
7788,
353,
7788,
29889,
6506,
11702,
21454,
1170,
613,
6230,
23095,
718,
11663,
29908,
718,
2060,
1204,
718,
11663,
29908,
718,
376,
1265,
1287,
29899,
21454,
1159,
13,
9651,
7788,
353,
7788,
29889,
6506,
11702,
4836,
4557,
613,
2295,
29889,
657,
26947,
7653,
4557,
3101,
13,
4706,
7788,
353,
7788,
29889,
6506,
11702,
4836,
1204,
613,
2060,
1204,
29897,
13,
4706,
7788,
353,
7788,
29889,
6506,
11702,
13010,
1170,
613,
6230,
23095,
718,
11663,
29908,
718,
2060,
1204,
718,
11663,
29908,
718,
376,
1265,
1287,
29899,
13010,
1159,
13,
4706,
7788,
353,
7788,
29889,
6506,
11702,
13010,
20420,
613,
6230,
23095,
718,
11663,
29908,
718,
2060,
1204,
718,
11663,
29908,
718,
376,
1265,
1287,
29899,
13010,
29899,
7728,
1159,
13,
4706,
7788,
353,
7788,
29889,
6506,
11702,
1491,
22371,
1170,
613,
6230,
23095,
718,
11663,
29908,
718,
2060,
1204,
718,
11663,
29908,
718,
376,
1265,
1287,
29899,
1491,
22371,
1159,
13,
4706,
7788,
353,
7788,
29889,
6506,
11702,
1491,
22371,
20420,
613,
6230,
23095,
718,
11663,
29908,
718,
2060,
1204,
718,
11663,
29908,
718,
376,
1265,
1287,
29899,
1491,
22371,
29899,
7728,
1159,
13,
4706,
7788,
353,
7788,
29889,
6506,
11702,
24671,
1170,
613,
6230,
23095,
718,
11663,
29908,
718,
2060,
1204,
718,
11663,
29908,
718,
376,
1265,
1287,
29899,
24671,
1159,
13,
4706,
7788,
353,
7788,
29889,
6506,
11702,
14669,
23095,
613,
6230,
23095,
29897,
13,
4706,
565,
313,
2917,
29889,
657,
6843,
13036,
26947,
1542,
580,
1275,
376,
1955,
29954,
2190,
26664,
8098,
29908,
1125,
13,
9651,
7788,
353,
7788,
29889,
6506,
11702,
10314,
1542,
613,
376,
6388,
17063,
1159,
13,
9651,
7788,
353,
7788,
29889,
6506,
11702,
10314,
1204,
613,
376,
6388,
17063,
12975,
718,
2295,
29889,
657,
6843,
13036,
26947,
1204,
3101,
13,
4706,
1683,
29901,
13,
9651,
7788,
353,
7788,
29889,
6506,
11702,
10314,
1542,
613,
376,
16418,
1159,
13,
9651,
7788,
353,
7788,
29889,
6506,
11702,
10314,
1204,
613,
2060,
1204,
29897,
13,
13,
13,
4706,
1596,
29898,
13237,
29897,
13,
4706,
1596,
703,
12148,
9076,
278,
2038,
5285,
304,
367,
21168,
1159,
13,
4706,
565,
2295,
29889,
657,
1762,
23573,
403,
7295,
13,
9651,
1596,
703,
4013,
18209,
674,
367,
23387,
411,
1494,
425,
346,
1287,
3633,
29901,
376,
718,
2295,
29889,
657,
29931,
815,
1287,
10601,
3101,
13,
4706,
1550,
313,
5574,
1125,
13,
9651,
1404,
4290,
353,
1881,
703,
23965,
29973,
313,
29979,
29914,
29940,
1125,
16521,
13,
9651,
1404,
4290,
353,
1404,
4290,
29889,
13609,
580,
13,
13,
9651,
565,
313,
1792,
4290,
1275,
376,
29876,
29908,
470,
1404,
4290,
1275,
376,
1217,
29908,
1125,
13,
18884,
12020,
8960,
703,
20399,
5285,
22225,
491,
1404,
29892,
3113,
1423,
278,
2295,
29889,
21053,
1159,
13,
9651,
25342,
313,
1792,
4290,
1275,
376,
29891,
29908,
470,
1404,
4290,
1275,
376,
3582,
29908,
1125,
13,
18884,
3573,
353,
426,
13,
462,
1678,
376,
978,
29908,
584,
18209,
1170,
29892,
13,
462,
1678,
376,
5182,
29908,
584,
426,
13,
462,
4706,
376,
2917,
29908,
584,
426,
13,
462,
9651,
376,
3051,
29908,
584,
7788,
13,
462,
4706,
500,
13,
462,
1678,
500,
13,
18884,
500,
13,
18884,
736,
3573,
13,
9651,
1683,
29901,
13,
18884,
1596,
4852,
12148,
3896,
2854,
1881,
1159,
13,
2
] |
Software_Engineering/ObjectOrientedProgramming/IdeFiles/5_exercise_upload_to_pypi/setup.py | surily/Udacity-Data-Science | 0 | 43665 | <reponame>surily/Udacity-Data-Science
from setuptools import setup
setup(name='gaussian_bionary_dist_prob',
version='0.1',
description='Gaussian and Binomial distributions',
packages=['gaussian_bionary_dist_prob'],
author = '<NAME>',
author_email = '<EMAIL>',
zip_safe=False)
| [
1,
529,
276,
1112,
420,
29958,
7610,
2354,
29914,
29965,
29881,
5946,
29899,
1469,
29899,
29903,
15277,
13,
3166,
731,
21245,
8789,
1053,
6230,
13,
13,
14669,
29898,
978,
2433,
29887,
17019,
29918,
29890,
291,
653,
29918,
5721,
29918,
22795,
742,
13,
418,
1873,
2433,
29900,
29889,
29896,
742,
13,
418,
6139,
2433,
29954,
17019,
322,
27662,
7615,
18822,
742,
13,
418,
9741,
29922,
1839,
29887,
17019,
29918,
29890,
291,
653,
29918,
5721,
29918,
22795,
7464,
13,
418,
4148,
353,
12801,
5813,
29958,
742,
13,
418,
4148,
29918,
5269,
353,
12801,
26862,
6227,
29958,
742,
13,
418,
14319,
29918,
11177,
29922,
8824,
29897,
13,
2
] |
examples/exp_configs/rl/singleagent/singleagent_ring_attack.py | cwang717/flow | 0 | 69596 | <filename>examples/exp_configs/rl/singleagent/singleagent_ring_attack.py
"""Ring road example.
Trains a single autonomous vehicle to stabilize the flow of 21 human-driven
vehicles in a variable length ring road.
"""
from flow.core.params import SumoParams, EnvParams, InitialConfig, NetParams
from flow.core.params import VehicleParams, SumoCarFollowingParams
from flow.controllers import RLController, IDMController, ContinuousRouter
from flow.envs import WaveAttenuationPOEnv, DisguisedAttackPOEnv
from flow.networks import RingNetwork
# time horizon of a single rollout
HORIZON = 3000
# number of rollouts per training iteration
N_ROLLOUTS = 20
# number of parallel workers
N_CPUS = 2
# We place one autonomous vehicle and 22 human-driven vehicles in the network
vehicles = VehicleParams()
vehicles.add(
veh_id="human",
acceleration_controller=(IDMController, {
"noise": 0.2
}),
car_following_params=SumoCarFollowingParams(
min_gap=0
),
routing_controller=(ContinuousRouter, {}),
num_vehicles=21)
vehicles.add(
veh_id="rl",
acceleration_controller=(RLController, {}),
routing_controller=(ContinuousRouter, {}),
num_vehicles=1)
flow_params = dict(
# name of the experiment
#exp_tag="stabilizing_the_ring",
exp_tag="disguised_vehicle_attacker",
# name of the flow environment the experiment is running on
#env_name=WaveAttenuationPOEnv,
env_name=DisguisedAttackPOEnv,
# name of the network class the experiment is running on
network=RingNetwork,
# simulator that is used by the experiment
simulator='traci',
# sumo-related parameters (see flow.core.params.SumoParams)
sim=SumoParams(
sim_step=0.1,
render=False,
restart_instance=False
),
# environment related parameters (see flow.core.params.EnvParams)
env=EnvParams(
horizon=HORIZON,
warmup_steps=750,
clip_actions=False,
additional_params={
"max_accel": 1,
"max_decel": 1,
"ring_length": [220, 270],
},
),
# network-related parameters (see flow.core.params.NetParams and the
# network's documentation or ADDITIONAL_NET_PARAMS component)
net=NetParams(
additional_params={
"length": 260,
"lanes": 1,
"speed_limit": 30,
"resolution": 40,
}, ),
# vehicles to be placed in the network at the start of a rollout (see
# flow.core.params.VehicleParams)
veh=vehicles,
# parameters specifying the positioning of vehicles upon initialization/
# reset (see flow.core.params.InitialConfig)
initial=InitialConfig(),
)
| [
1,
529,
9507,
29958,
19057,
29914,
4548,
29918,
2917,
29879,
29914,
2096,
29914,
14369,
14748,
29914,
14369,
14748,
29918,
5393,
29918,
1131,
547,
29889,
2272,
13,
15945,
29908,
29934,
292,
6520,
1342,
29889,
13,
13,
5323,
1144,
263,
2323,
28273,
681,
19716,
304,
16160,
675,
278,
4972,
310,
29871,
29906,
29896,
5199,
29899,
24477,
854,
13,
345,
29882,
4027,
297,
263,
2286,
3309,
9228,
6520,
29889,
13,
15945,
29908,
13,
3166,
4972,
29889,
3221,
29889,
7529,
1053,
6991,
29877,
9629,
29892,
1174,
29894,
9629,
29892,
17250,
3991,
29892,
12670,
9629,
13,
3166,
4972,
29889,
3221,
29889,
7529,
1053,
8980,
29882,
2512,
9629,
29892,
6991,
29877,
8179,
29943,
2952,
292,
9629,
13,
3166,
4972,
29889,
1285,
11897,
1053,
390,
29931,
2956,
29892,
3553,
29924,
2956,
29892,
2866,
8675,
681,
23971,
13,
3166,
4972,
29889,
264,
4270,
1053,
399,
1351,
4165,
4814,
362,
13152,
21745,
29892,
3295,
2543,
3368,
4165,
547,
13152,
21745,
13,
3166,
4972,
29889,
11618,
29879,
1053,
17716,
13724,
13,
13,
29937,
931,
28205,
310,
263,
2323,
9679,
449,
13,
29950,
1955,
26664,
1164,
353,
29871,
29941,
29900,
29900,
29900,
13,
29937,
1353,
310,
9679,
17718,
639,
6694,
12541,
13,
29940,
29918,
1672,
2208,
12015,
29903,
353,
29871,
29906,
29900,
13,
29937,
1353,
310,
8943,
17162,
13,
29940,
29918,
6271,
3308,
353,
29871,
29906,
13,
13,
29937,
1334,
2058,
697,
28273,
681,
19716,
322,
29871,
29906,
29906,
5199,
29899,
24477,
854,
24413,
297,
278,
3564,
13,
345,
29882,
4027,
353,
8980,
29882,
2512,
9629,
580,
13,
345,
29882,
4027,
29889,
1202,
29898,
13,
1678,
10852,
29918,
333,
543,
26029,
613,
13,
1678,
28178,
29918,
8299,
7607,
1367,
29924,
2956,
29892,
426,
13,
4706,
376,
1217,
895,
1115,
29871,
29900,
29889,
29906,
13,
1678,
500,
511,
13,
1678,
1559,
29918,
23031,
292,
29918,
7529,
29922,
11139,
29877,
8179,
29943,
2952,
292,
9629,
29898,
13,
4706,
1375,
29918,
29887,
481,
29922,
29900,
13,
1678,
10353,
13,
1678,
21398,
29918,
8299,
7607,
1323,
8675,
681,
23971,
29892,
6571,
511,
13,
1678,
954,
29918,
345,
29882,
4027,
29922,
29906,
29896,
29897,
13,
345,
29882,
4027,
29889,
1202,
29898,
13,
1678,
10852,
29918,
333,
543,
2096,
613,
13,
1678,
28178,
29918,
8299,
7607,
2241,
2956,
29892,
6571,
511,
13,
1678,
21398,
29918,
8299,
7607,
1323,
8675,
681,
23971,
29892,
6571,
511,
13,
1678,
954,
29918,
345,
29882,
4027,
29922,
29896,
29897,
13,
13,
1731,
29918,
7529,
353,
9657,
29898,
13,
1678,
396,
1024,
310,
278,
7639,
13,
1678,
396,
4548,
29918,
4039,
543,
303,
4427,
5281,
29918,
1552,
29918,
5393,
613,
13,
1678,
1518,
29918,
4039,
543,
2218,
2543,
3368,
29918,
345,
29882,
2512,
29918,
1131,
28940,
613,
13,
13,
1678,
396,
1024,
310,
278,
4972,
5177,
278,
7639,
338,
2734,
373,
13,
1678,
396,
6272,
29918,
978,
29922,
29956,
1351,
4165,
4814,
362,
13152,
21745,
29892,
29871,
13,
1678,
8829,
29918,
978,
29922,
4205,
2543,
3368,
4165,
547,
13152,
21745,
29892,
13,
13,
1678,
396,
1024,
310,
278,
3564,
770,
278,
7639,
338,
2734,
373,
13,
1678,
3564,
29922,
29934,
292,
13724,
29892,
13,
13,
1678,
396,
1027,
9183,
393,
338,
1304,
491,
278,
7639,
13,
1678,
1027,
9183,
2433,
3018,
455,
742,
13,
13,
1678,
396,
2533,
29877,
29899,
12817,
4128,
313,
4149,
4972,
29889,
3221,
29889,
7529,
29889,
11139,
29877,
9629,
29897,
13,
1678,
1027,
29922,
11139,
29877,
9629,
29898,
13,
4706,
1027,
29918,
10568,
29922,
29900,
29889,
29896,
29892,
13,
4706,
4050,
29922,
8824,
29892,
13,
4706,
10715,
29918,
8758,
29922,
8824,
13,
1678,
10353,
13,
13,
1678,
396,
5177,
4475,
4128,
313,
4149,
4972,
29889,
3221,
29889,
7529,
29889,
21745,
9629,
29897,
13,
1678,
8829,
29922,
21745,
9629,
29898,
13,
4706,
28205,
29922,
29950,
1955,
26664,
1164,
29892,
13,
4706,
14294,
786,
29918,
24530,
29922,
29955,
29945,
29900,
29892,
13,
4706,
20102,
29918,
7387,
29922,
8824,
29892,
13,
4706,
5684,
29918,
7529,
3790,
13,
9651,
376,
3317,
29918,
562,
2242,
1115,
29871,
29896,
29892,
13,
9651,
376,
3317,
29918,
311,
2242,
1115,
29871,
29896,
29892,
13,
9651,
376,
5393,
29918,
2848,
1115,
518,
29906,
29906,
29900,
29892,
29871,
29906,
29955,
29900,
1402,
13,
4706,
2981,
13,
1678,
10353,
13,
13,
1678,
396,
3564,
29899,
12817,
4128,
313,
4149,
4972,
29889,
3221,
29889,
7529,
29889,
6779,
9629,
322,
278,
13,
1678,
396,
3564,
29915,
29879,
5106,
470,
27827,
22122,
1964,
29918,
6006,
29918,
16320,
29909,
4345,
4163,
29897,
13,
1678,
7787,
29922,
6779,
9629,
29898,
13,
4706,
5684,
29918,
7529,
3790,
13,
9651,
376,
2848,
1115,
29871,
29906,
29953,
29900,
29892,
13,
9651,
376,
6468,
267,
1115,
29871,
29896,
29892,
13,
9651,
376,
19322,
29918,
13400,
1115,
29871,
29941,
29900,
29892,
13,
9651,
376,
9778,
918,
1115,
29871,
29946,
29900,
29892,
13,
4706,
2981,
10353,
13,
13,
1678,
396,
24413,
304,
367,
7180,
297,
278,
3564,
472,
278,
1369,
310,
263,
9679,
449,
313,
4149,
13,
1678,
396,
4972,
29889,
3221,
29889,
7529,
29889,
29963,
14797,
2512,
9629,
29897,
13,
1678,
10852,
29922,
345,
29882,
4027,
29892,
13,
13,
1678,
396,
4128,
22146,
278,
2602,
292,
310,
24413,
2501,
17865,
29914,
13,
1678,
396,
10092,
313,
4149,
4972,
29889,
3221,
29889,
7529,
29889,
15514,
3991,
29897,
13,
1678,
2847,
29922,
15514,
3991,
3285,
13,
29897,
13,
2
] |
python/Unimeta/clinica/Trabalho_3/trabalho3.py | alifoliveira/rep-estudos | 0 | 156444 | <reponame>alifoliveira/rep-estudos<filename>python/Unimeta/clinica/Trabalho_3/trabalho3.py
#coding=utf-8
from tkinter import *
from tkinter import messagebox as ms
import sqlite3
cont = 0
cont2 = 2
cadt = None
listr = None
empr = None
loged = None
photo2 = None
logo2 = None
def verify():
global loged
global cont2
global cont
global photo2
global logo2
with sqlite3.connect('registro.db') as db:
c = db.cursor()
find_user = 'SELECT * FROM usuario WHERE login = ? AND senha = ?'
c.execute(find_user,[(entry_user.get()), (entry_password.get())])
result = c.fetchall()
if result:
label_user.destroy()
entry_user.destroy()
label_password.destroy()
entry_password.destroy()
bt_login.destroy()
bt_leave.destroy()
logo.destroy()
main()
photo2 = PhotoImage(file='logo-biblioteca-menu.png')
logo2 = Label(root, image=photo2, bg='#292929')
logo2.pack(padx=20, pady=20)
loged = Label(root, text='Bem Vindo!', font=('', 20, 'bold'), bg='#292929', fg='white', pady=20)
loged.pack(side=BOTTOM)
else:
ms.showerror('ERRO', f'Usuário ou Senha Inválidos. \n\nTentativas restantes: {cont2}')
cont2 -= 1
cont += 1
if cont == 3:
ms.showwarning('Aviso', 'O Sistema será finalizado por questões de segurança.')
root.destroy()
def main():
barra_menu = Menu(root)
main_menu = Menu(barra_menu, tearoff=0)
barra_menu.add_cascade(label='Menu', menu=main_menu)
main_menu.add_command(label='Cadastrar', command=cadastrar)
main_menu.add_command(label='Listar', command=listar)
main_menu.add_command(label='Empréstimo', command=emprestimo)
main_menu.add_separator()
main_menu.add_command(label='Sair', command=root.destroy)
root.config(menu=barra_menu)
def cadastrar():
global cadt
try:
loged.destroy()
logo2.destroy()
cadt.destroy()
listr.destroy()
empr.destroy()
except:
pass
cadt = Frame(root, bg='#292929', width=400, height=300)
cadt.pack(fill=BOTH, expand=1)
bt_autor = Button(cadt, width=10, text='Autor', font=('', 12, 'bold'), fg='white', bg='#5bc30b')
bt_autor.place(x=140, y=60)
bt_cliente = Button(cadt, width=10, text='Cliente', font=('', 12, 'bold'), fg='white', bg='#5bc30b', command=cliente)
bt_cliente.place(x=140, y=100)
bt_livro = Button(cadt, width=10, text='Livro', font=('', 12, 'bold'), fg='white', bg='#5bc30b')
bt_livro.place(x=140, y=140)
bt_usuario = Button(cadt, width=10, text='Usuário', font=('', 12, 'bold'), fg='white', bg='#5bc30b')
bt_usuario.place(x=140, y=180)
def listar():
global listr
try:
loged.destroy()
logo2.destroy()
listr.destroy()
empr.destroy()
cadt.destroy()
except:
pass
listr = Frame(root, bg='#292929', width=400, height=300)
listr.pack(fill=BOTH, expand=1)
bt_autor = Button(listr, width=10, text='Autor', font=('', 12, 'bold'), fg='white', bg='#5bc30b')
bt_autor.place(x=140, y=60)
bt_cliente = Button(listr, width=10, text='Cliente', font=('', 12, 'bold'), fg='white', bg='#5bc30b')
bt_cliente.place(x=140, y=100)
bt_livro = Button(listr, width=10, text='Livro', font=('', 12, 'bold'), fg='white', bg='#5bc30b')
bt_livro.place(x=140, y=140)
bt_usuario = Button(listr, width=10, text='Usuário', font=('', 12, 'bold'), fg='white', bg='#5bc30b')
bt_usuario.place(x=140, y=180)
bt_emprestimo = Button(listr, width=10, text='Empréstimos', font=('', 12, 'bold'), fg='white', bg='#5bc30b')
bt_emprestimo.place(x=140, y=220)
def emprestimo():
global empr
try:
loged.destroy()
logo2.destroy()
empr.destroy()
cadt.destroy()
listr.destroy()
except:
pass
empr = Frame(root, bg='#292929', width=400, height=300)
empr.pack(fill=BOTH, expand=1)
bt_emprestimo = Button(empr, width=18, text='Realizar Empréstimo', font=('', 12, 'bold'), fg='white', bg='#5bc30b')
bt_emprestimo.place(x=110, y=80)
bt_devolucao = Button(empr, width=18, text='Realizar Devolução', font=('', 12, 'bold'), fg='white', bg='#5bc30b')
bt_devolucao.place(x=110, y=120)
def cliente():
db = sqlite3.connect('registro.db')
c = db.cursor()
c.execute('''CREATE TABLE IF NOT EXISTS cliente(
id INTEGER PRIMARY KEY NOT NULL,
nome TEXT NOT NULL,
rua TEXT NOT NULL,
numero INTEGER NOT NULL,
bairro TEXT NOT NULL,
cidade TEXT NOT NULL,
estado TEXT NOT NULL,
data_de_nascimento DATE NOT NULL,
telefone_residencial TEXT,
telefone_celular TEXT NOT NULL,
email TEXT NOT NULL,
cpf TEXT NOT NULL
);''')
window_cliente = Toplevel(root, bg='#292929')
window_cliente.title('Cadastrar Cliente')
lnome = Label(window_cliente, text='Nome', bg='#292929', fg='white', font=('', 12, 'bold'))
lnome.place(x=20, y=20)
nome = Entry(window_cliente, width=45, font=('', 11, 'bold'))
nome.place(x=20, y=50)
lcpf = Label(window_cliente, text='CPF', bg='#292929', fg='white', font=('', 12, 'bold'))
lcpf.place(x=20, y=80)
cpf = Entry(window_cliente, width=12, font=('', 11, 'bold'))
cpf.place(x=20, y=110)
ltelefone = Label(window_cliente, text='Telefone', bg='#292929', fg='white', font=('', 12, 'bold'))
ltelefone.place(x=150, y=80)
telefone = Entry(window_cliente, width=12, font=('', 11, 'bold'))
telefone.place(x=150, y=110)
lcelular = Label(window_cliente, text='Celular', bg='#292929', fg='white', font=('', 12, 'bold'))
lcelular.place(x=283, y=80)
celular = Entry(window_cliente, width=12, font=('', 11, 'bold'))
celular.place(x=283, y=110)
lemail = Label(window_cliente, text='E-mail', bg='#292929', fg='white', font=('', 12, 'bold'))
lemail.place(x=20, y=140)
email = Entry(window_cliente, width=45, font=('', 11, 'bold'))
email.place(x=20, y=170)
lrua = Label(window_cliente, text='Rua', bg='#292929', fg='white', font=('', 12, 'bold'))
lrua.place(x=20, y=200)
rua = Entry(window_cliente, width=45, font=('', 11, 'bold'))
rua.place(x=20, y=230)
lnumero = Label(window_cliente, text='Número', bg='#292929', fg='white', font=('', 12, 'bold'))
lnumero.place(x=300, y=260)
numero = Entry(window_cliente, width=10, font=('', 11, 'bold'))
numero.place(x=300, y=290)
lbairro = Label(window_cliente, text='Bairro', bg='#292929', fg='white', font=('', 12, 'bold'))
lbairro.place(x=20, y=260)
bairro = Entry(window_cliente, width=31, font=('', 11, 'bold'))
bairro.place(x=20, y=290)
lcidade = Label(window_cliente, text='Cidade', bg='#292929', fg='white', font=('', 12, 'bold'))
lcidade.place(x=20, y=320)
cidade = Entry(window_cliente, width=23, font=('', 11, 'bold'))
cidade.place(x=20, y=350)
lestado = Label(window_cliente, text='Estado', bg='#292929', fg='white', font=('', 12, 'bold'))
lestado.place(x=235, y=320)
estado = Entry(window_cliente, width=18, font=('', 11, 'bold'))
estado.place(x=235, y=350)
window_cliente.geometry('400x550+200+200')
db.commit()
db.close()
root = Tk()
photo = PhotoImage(file='logo-biblioteca.png')
logo = Label(root, image=photo, bg='#292929')
logo.pack(pady=20)
label_user = Label(root, text='Usuário:', font=('', 12), fg='gray', bg='#292929')
label_user.place(x=30, y=120)
entry_user = Entry(root, justify=CENTER, font=('', 11, 'bold'), width=26)
entry_user.place(x=100, y=120)
label_password = Label(root, text='Senha:', font=('', 12), fg='gray', bg='#292929')
label_password.place(x=40, y=150)
entry_password = Entry(root, justify=CENTER, font=('', 11, 'bold'), show='*', width=26)
entry_password.place(x=100, y=150)
bt_login = Button(root, width=8, text='LOGIN', font=('', 12, 'bold'), bg='#5bc30b', fg='white', command=verify)
bt_login.place(x=100, y=200)
bt_leave = Button(root, width=8, text='SAIR', font=('', 12, 'bold'), bg='#5bc30b', fg='white', command=root.quit)
bt_leave.place(x=223, y=200)
root.title('Login')
root['bg'] = '#292929'
root.geometry('400x300+600+300')
root.resizable(0, 0)
root.mainloop()
| [
1,
529,
276,
1112,
420,
29958,
284,
361,
324,
573,
3055,
29914,
3445,
29899,
342,
566,
359,
29966,
9507,
29958,
4691,
29914,
2525,
326,
1187,
29914,
695,
262,
983,
29914,
29911,
4201,
284,
1251,
29918,
29941,
29914,
3018,
5521,
1251,
29941,
29889,
2272,
13,
29937,
29883,
3689,
29922,
9420,
29899,
29947,
13,
13,
3166,
18883,
1639,
1053,
334,
13,
3166,
18883,
1639,
1053,
2643,
1884,
408,
10887,
13,
5215,
21120,
29941,
13,
13,
1285,
353,
29871,
29900,
13,
1285,
29906,
353,
29871,
29906,
13,
29883,
3590,
353,
6213,
13,
1761,
29878,
353,
6213,
13,
331,
558,
353,
6213,
13,
1188,
287,
353,
6213,
13,
21596,
29906,
353,
6213,
13,
14569,
29906,
353,
6213,
13,
13,
13,
1753,
11539,
7295,
13,
1678,
5534,
1480,
287,
13,
1678,
5534,
640,
29906,
13,
1678,
5534,
640,
13,
1678,
5534,
15373,
29906,
13,
1678,
5534,
20194,
29906,
13,
1678,
411,
21120,
29941,
29889,
6915,
877,
1727,
19150,
29889,
2585,
1495,
408,
4833,
29901,
13,
4706,
274,
353,
4833,
29889,
18127,
580,
13,
4706,
1284,
29918,
1792,
353,
525,
6404,
334,
3895,
502,
22223,
5754,
6464,
353,
1577,
5300,
6940,
2350,
353,
1577,
29915,
13,
4706,
274,
29889,
7978,
29898,
2886,
29918,
1792,
29892,
15625,
8269,
29918,
1792,
29889,
657,
25739,
313,
8269,
29918,
5630,
29889,
657,
3101,
2314,
13,
4706,
1121,
353,
274,
29889,
9155,
497,
580,
13,
4706,
565,
1121,
29901,
13,
9651,
3858,
29918,
1792,
29889,
20524,
580,
13,
9651,
6251,
29918,
1792,
29889,
20524,
580,
13,
9651,
3858,
29918,
5630,
29889,
20524,
580,
13,
9651,
6251,
29918,
5630,
29889,
20524,
580,
13,
9651,
289,
29873,
29918,
7507,
29889,
20524,
580,
13,
9651,
289,
29873,
29918,
280,
1351,
29889,
20524,
580,
13,
9651,
20194,
29889,
20524,
580,
13,
9651,
1667,
580,
13,
9651,
15373,
29906,
353,
1963,
3747,
2940,
29898,
1445,
2433,
14569,
29899,
17481,
19011,
29899,
6510,
29889,
2732,
1495,
13,
9651,
20194,
29906,
353,
15796,
29898,
4632,
29892,
1967,
29922,
21596,
29906,
29892,
25989,
2433,
29937,
29906,
29929,
29906,
29929,
29906,
29929,
1495,
13,
9651,
20194,
29906,
29889,
4058,
29898,
8305,
29916,
29922,
29906,
29900,
29892,
282,
3714,
29922,
29906,
29900,
29897,
13,
9651,
1480,
287,
353,
15796,
29898,
4632,
29892,
1426,
2433,
29933,
331,
478,
15036,
29991,
742,
4079,
29922,
877,
742,
29871,
29906,
29900,
29892,
525,
8934,
5477,
25989,
2433,
29937,
29906,
29929,
29906,
29929,
29906,
29929,
742,
285,
29887,
2433,
10921,
742,
282,
3714,
29922,
29906,
29900,
29897,
13,
9651,
1480,
287,
29889,
4058,
29898,
2975,
29922,
29933,
2891,
4986,
29924,
29897,
13,
13,
4706,
1683,
29901,
13,
9651,
10887,
29889,
845,
1680,
729,
877,
1001,
1672,
742,
285,
29915,
29965,
2146,
12288,
2123,
5811,
2350,
15518,
2464,
4396,
29889,
320,
29876,
29905,
29876,
29911,
296,
26126,
1791,
3794,
29901,
426,
1285,
29906,
29913,
1495,
13,
9651,
640,
29906,
22361,
29871,
29896,
13,
9651,
640,
4619,
29871,
29896,
13,
9651,
565,
640,
1275,
29871,
29941,
29901,
13,
18884,
10887,
29889,
4294,
27392,
877,
29909,
1730,
29877,
742,
525,
29949,
317,
28474,
724,
29976,
2186,
17566,
1277,
21126,
4420,
316,
2377,
332,
25356,
29889,
1495,
13,
18884,
3876,
29889,
20524,
580,
13,
13,
13,
1753,
1667,
7295,
13,
1678,
2594,
336,
29918,
6510,
353,
20019,
29898,
4632,
29897,
13,
1678,
1667,
29918,
6510,
353,
20019,
29898,
1646,
336,
29918,
6510,
29892,
734,
279,
2696,
29922,
29900,
29897,
13,
1678,
2594,
336,
29918,
6510,
29889,
1202,
29918,
9398,
6332,
29898,
1643,
2433,
6823,
742,
6143,
29922,
3396,
29918,
6510,
29897,
13,
1678,
1667,
29918,
6510,
29889,
1202,
29918,
6519,
29898,
1643,
2433,
29907,
3922,
509,
279,
742,
1899,
29922,
29883,
3922,
509,
279,
29897,
13,
1678,
1667,
29918,
6510,
29889,
1202,
29918,
6519,
29898,
1643,
2433,
1293,
279,
742,
1899,
29922,
1761,
279,
29897,
13,
1678,
1667,
29918,
6510,
29889,
1202,
29918,
6519,
29898,
1643,
2433,
6026,
558,
21611,
4200,
742,
1899,
29922,
331,
558,
342,
4200,
29897,
13,
1678,
1667,
29918,
6510,
29889,
1202,
29918,
344,
17954,
580,
13,
1678,
1667,
29918,
6510,
29889,
1202,
29918,
6519,
29898,
1643,
2433,
29903,
1466,
742,
1899,
29922,
4632,
29889,
20524,
29897,
13,
1678,
3876,
29889,
2917,
29898,
6510,
29922,
1646,
336,
29918,
6510,
29897,
13,
13,
13,
1753,
274,
3922,
509,
279,
7295,
13,
1678,
5534,
274,
3590,
13,
1678,
1018,
29901,
13,
4706,
1480,
287,
29889,
20524,
580,
13,
4706,
20194,
29906,
29889,
20524,
580,
13,
4706,
274,
3590,
29889,
20524,
580,
13,
4706,
1051,
29878,
29889,
20524,
580,
13,
4706,
953,
558,
29889,
20524,
580,
13,
1678,
5174,
29901,
13,
4706,
1209,
13,
1678,
274,
3590,
353,
12218,
29898,
4632,
29892,
25989,
2433,
29937,
29906,
29929,
29906,
29929,
29906,
29929,
742,
2920,
29922,
29946,
29900,
29900,
29892,
3171,
29922,
29941,
29900,
29900,
29897,
13,
1678,
274,
3590,
29889,
4058,
29898,
5589,
29922,
29933,
2891,
29950,
29892,
7985,
29922,
29896,
29897,
13,
1678,
289,
29873,
29918,
8309,
353,
11025,
29898,
29883,
3590,
29892,
2920,
29922,
29896,
29900,
29892,
1426,
2433,
29909,
3406,
742,
4079,
29922,
877,
742,
29871,
29896,
29906,
29892,
525,
8934,
5477,
285,
29887,
2433,
10921,
742,
25989,
2433,
29937,
29945,
12328,
29941,
29900,
29890,
1495,
13,
1678,
289,
29873,
29918,
8309,
29889,
6689,
29898,
29916,
29922,
29896,
29946,
29900,
29892,
343,
29922,
29953,
29900,
29897,
13,
1678,
289,
29873,
29918,
4645,
29872,
353,
11025,
29898,
29883,
3590,
29892,
2920,
29922,
29896,
29900,
29892,
1426,
2433,
4032,
29872,
742,
4079,
29922,
877,
742,
29871,
29896,
29906,
29892,
525,
8934,
5477,
285,
29887,
2433,
10921,
742,
25989,
2433,
29937,
29945,
12328,
29941,
29900,
29890,
742,
1899,
29922,
4645,
29872,
29897,
13,
1678,
289,
29873,
29918,
4645,
29872,
29889,
6689,
29898,
29916,
29922,
29896,
29946,
29900,
29892,
343,
29922,
29896,
29900,
29900,
29897,
13,
1678,
289,
29873,
29918,
17843,
307,
353,
11025,
29898,
29883,
3590,
29892,
2920,
29922,
29896,
29900,
29892,
1426,
2433,
29931,
440,
307,
742,
4079,
29922,
877,
742,
29871,
29896,
29906,
29892,
525,
8934,
5477,
285,
29887,
2433,
10921,
742,
25989,
2433,
29937,
29945,
12328,
29941,
29900,
29890,
1495,
13,
1678,
289,
29873,
29918,
17843,
307,
29889,
6689,
29898,
29916,
29922,
29896,
29946,
29900,
29892,
343,
29922,
29896,
29946,
29900,
29897,
13,
1678,
289,
29873,
29918,
375,
22223,
353,
11025,
29898,
29883,
3590,
29892,
2920,
29922,
29896,
29900,
29892,
1426,
2433,
29965,
2146,
12288,
742,
4079,
29922,
877,
742,
29871,
29896,
29906,
29892,
525,
8934,
5477,
285,
29887,
2433,
10921,
742,
25989,
2433,
29937,
29945,
12328,
29941,
29900,
29890,
1495,
13,
1678,
289,
29873,
29918,
375,
22223,
29889,
6689,
29898,
29916,
29922,
29896,
29946,
29900,
29892,
343,
29922,
29896,
29947,
29900,
29897,
13,
13,
13,
1753,
1051,
279,
7295,
13,
1678,
5534,
1051,
29878,
13,
1678,
1018,
29901,
13,
4706,
1480,
287,
29889,
20524,
580,
13,
4706,
20194,
29906,
29889,
20524,
580,
13,
4706,
1051,
29878,
29889,
20524,
580,
13,
4706,
953,
558,
29889,
20524,
580,
13,
4706,
274,
3590,
29889,
20524,
580,
13,
1678,
5174,
29901,
13,
4706,
1209,
13,
1678,
1051,
29878,
353,
12218,
29898,
4632,
29892,
25989,
2433,
29937,
29906,
29929,
29906,
29929,
29906,
29929,
742,
2920,
29922,
29946,
29900,
29900,
29892,
3171,
29922,
29941,
29900,
29900,
29897,
13,
1678,
1051,
29878,
29889,
4058,
29898,
5589,
29922,
29933,
2891,
29950,
29892,
7985,
29922,
29896,
29897,
13,
1678,
289,
29873,
29918,
8309,
353,
11025,
29898,
1761,
29878,
29892,
2920,
29922,
29896,
29900,
29892,
1426,
2433,
29909,
3406,
742,
4079,
29922,
877,
742,
29871,
29896,
29906,
29892,
525,
8934,
5477,
285,
29887,
2433,
10921,
742,
25989,
2433,
29937,
29945,
12328,
29941,
29900,
29890,
1495,
13,
1678,
289,
29873,
29918,
8309,
29889,
6689,
29898,
29916,
29922,
29896,
29946,
29900,
29892,
343,
29922,
29953,
29900,
29897,
13,
1678,
289,
29873,
29918,
4645,
29872,
353,
11025,
29898,
1761,
29878,
29892,
2920,
29922,
29896,
29900,
29892,
1426,
2433,
4032,
29872,
742,
4079,
29922,
877,
742,
29871,
29896,
29906,
29892,
525,
8934,
5477,
285,
29887,
2433,
10921,
742,
25989,
2433,
29937,
29945,
12328,
29941,
29900,
29890,
1495,
13,
1678,
289,
29873,
29918,
4645,
29872,
29889,
6689,
29898,
29916,
29922,
29896,
29946,
29900,
29892,
343,
29922,
29896,
29900,
29900,
29897,
13,
1678,
289,
29873,
29918,
17843,
307,
353,
11025,
29898,
1761,
29878,
29892,
2920,
29922,
29896,
29900,
29892,
1426,
2433,
29931,
440,
307,
742,
4079,
29922,
877,
742,
29871,
29896,
29906,
29892,
525,
8934,
5477,
285,
29887,
2433,
10921,
742,
25989,
2433,
29937,
29945,
12328,
29941,
29900,
29890,
1495,
13,
1678,
289,
29873,
29918,
17843,
307,
29889,
6689,
29898,
29916,
29922,
29896,
29946,
29900,
29892,
343,
29922,
29896,
29946,
29900,
29897,
13,
1678,
289,
29873,
29918,
375,
22223,
353,
11025,
29898,
1761,
29878,
29892,
2920,
29922,
29896,
29900,
29892,
1426,
2433,
29965,
2146,
12288,
742,
4079,
29922,
877,
742,
29871,
29896,
29906,
29892,
525,
8934,
5477,
285,
29887,
2433,
10921,
742,
25989,
2433,
29937,
29945,
12328,
29941,
29900,
29890,
1495,
13,
1678,
289,
29873,
29918,
375,
22223,
29889,
6689,
29898,
29916,
29922,
29896,
29946,
29900,
29892,
343,
29922,
29896,
29947,
29900,
29897,
13,
1678,
289,
29873,
29918,
331,
558,
342,
4200,
353,
11025,
29898,
1761,
29878,
29892,
2920,
29922,
29896,
29900,
29892,
1426,
2433,
6026,
558,
21611,
18594,
742,
4079,
29922,
877,
742,
29871,
29896,
29906,
29892,
525,
8934,
5477,
285,
29887,
2433,
10921,
742,
25989,
2433,
29937,
29945,
12328,
29941,
29900,
29890,
1495,
13,
1678,
289,
29873,
29918,
331,
558,
342,
4200,
29889,
6689,
29898,
29916,
29922,
29896,
29946,
29900,
29892,
343,
29922,
29906,
29906,
29900,
29897,
13,
13,
13,
1753,
953,
558,
342,
4200,
7295,
13,
1678,
5534,
953,
558,
13,
1678,
1018,
29901,
13,
4706,
1480,
287,
29889,
20524,
580,
13,
4706,
20194,
29906,
29889,
20524,
580,
13,
4706,
953,
558,
29889,
20524,
580,
13,
4706,
274,
3590,
29889,
20524,
580,
13,
4706,
1051,
29878,
29889,
20524,
580,
13,
1678,
5174,
29901,
13,
4706,
1209,
13,
1678,
953,
558,
353,
12218,
29898,
4632,
29892,
25989,
2433,
29937,
29906,
29929,
29906,
29929,
29906,
29929,
742,
2920,
29922,
29946,
29900,
29900,
29892,
3171,
29922,
29941,
29900,
29900,
29897,
13,
1678,
953,
558,
29889,
4058,
29898,
5589,
29922,
29933,
2891,
29950,
29892,
7985,
29922,
29896,
29897,
13,
1678,
289,
29873,
29918,
331,
558,
342,
4200,
353,
11025,
29898,
331,
558,
29892,
2920,
29922,
29896,
29947,
29892,
1426,
2433,
21713,
15356,
2812,
558,
21611,
4200,
742,
4079,
29922,
877,
742,
29871,
29896,
29906,
29892,
525,
8934,
5477,
285,
29887,
2433,
10921,
742,
25989,
2433,
29937,
29945,
12328,
29941,
29900,
29890,
1495,
13,
1678,
289,
29873,
29918,
331,
558,
342,
4200,
29889,
6689,
29898,
29916,
29922,
29896,
29896,
29900,
29892,
343,
29922,
29947,
29900,
29897,
13,
1678,
289,
29873,
29918,
311,
1555,
18393,
29877,
353,
11025,
29898,
331,
558,
29892,
2920,
29922,
29896,
29947,
29892,
1426,
2433,
21713,
15356,
897,
1555,
29884,
2340,
742,
4079,
29922,
877,
742,
29871,
29896,
29906,
29892,
525,
8934,
5477,
285,
29887,
2433,
10921,
742,
25989,
2433,
29937,
29945,
12328,
29941,
29900,
29890,
1495,
13,
1678,
289,
29873,
29918,
311,
1555,
18393,
29877,
29889,
6689,
29898,
29916,
29922,
29896,
29896,
29900,
29892,
343,
29922,
29896,
29906,
29900,
29897,
13,
13,
13,
1753,
3132,
29872,
7295,
13,
1678,
4833,
353,
21120,
29941,
29889,
6915,
877,
1727,
19150,
29889,
2585,
1495,
13,
1678,
274,
353,
4833,
29889,
18127,
580,
13,
1678,
274,
29889,
7978,
877,
4907,
27045,
10911,
10762,
6058,
28731,
3132,
29872,
29898,
13,
1678,
1178,
2672,
4330,
17070,
29778,
14636,
6058,
4265,
29892,
13,
1678,
9235,
323,
12194,
6058,
4265,
29892,
13,
1678,
364,
3357,
323,
12194,
6058,
4265,
29892,
13,
1678,
17910,
2672,
4330,
17070,
6058,
4265,
29892,
13,
1678,
289,
1466,
307,
323,
12194,
6058,
4265,
29892,
13,
1678,
17931,
323,
12194,
6058,
4265,
29892,
13,
1678,
12082,
323,
12194,
6058,
4265,
29892,
13,
1678,
848,
29918,
311,
29918,
29876,
6151,
6174,
20231,
6058,
4265,
29892,
13,
1678,
4382,
29888,
650,
29918,
690,
3615,
1455,
323,
12194,
29892,
13,
1678,
4382,
29888,
650,
29918,
2242,
1070,
323,
12194,
6058,
4265,
29892,
13,
1678,
4876,
323,
12194,
6058,
4265,
29892,
13,
1678,
274,
7810,
323,
12194,
6058,
4265,
13,
1678,
3482,
4907,
1495,
13,
1678,
3474,
29918,
4645,
29872,
353,
323,
1991,
955,
29898,
4632,
29892,
25989,
2433,
29937,
29906,
29929,
29906,
29929,
29906,
29929,
1495,
13,
1678,
3474,
29918,
4645,
29872,
29889,
3257,
877,
29907,
3922,
509,
279,
12477,
29872,
1495,
13,
13,
1678,
301,
25155,
353,
15796,
29898,
7165,
29918,
4645,
29872,
29892,
1426,
2433,
29940,
608,
742,
25989,
2433,
29937,
29906,
29929,
29906,
29929,
29906,
29929,
742,
285,
29887,
2433,
10921,
742,
4079,
29922,
877,
742,
29871,
29896,
29906,
29892,
525,
8934,
8785,
13,
1678,
301,
25155,
29889,
6689,
29898,
29916,
29922,
29906,
29900,
29892,
343,
29922,
29906,
29900,
29897,
13,
1678,
9235,
353,
28236,
29898,
7165,
29918,
4645,
29872,
29892,
2920,
29922,
29946,
29945,
29892,
4079,
29922,
877,
742,
29871,
29896,
29896,
29892,
525,
8934,
8785,
13,
1678,
9235,
29889,
6689,
29898,
29916,
29922,
29906,
29900,
29892,
343,
29922,
29945,
29900,
29897,
13,
13,
1678,
301,
6814,
29888,
353,
15796,
29898,
7165,
29918,
4645,
29872,
29892,
1426,
2433,
6271,
29943,
742,
25989,
2433,
29937,
29906,
29929,
29906,
29929,
29906,
29929,
742,
285,
29887,
2433,
10921,
742,
4079,
29922,
877,
742,
29871,
29896,
29906,
29892,
525,
8934,
8785,
13,
1678,
301,
6814,
29888,
29889,
6689,
29898,
29916,
29922,
29906,
29900,
29892,
343,
29922,
29947,
29900,
29897,
13,
1678,
274,
7810,
353,
28236,
29898,
7165,
29918,
4645,
29872,
29892,
2920,
29922,
29896,
29906,
29892,
4079,
29922,
877,
742,
29871,
29896,
29896,
29892,
525,
8934,
8785,
13,
1678,
274,
7810,
29889,
6689,
29898,
29916,
29922,
29906,
29900,
29892,
343,
29922,
29896,
29896,
29900,
29897,
13,
13,
1678,
301,
15494,
29888,
650,
353,
15796,
29898,
7165,
29918,
4645,
29872,
29892,
1426,
2433,
29911,
6146,
29888,
650,
742,
25989,
2433,
29937,
29906,
29929,
29906,
29929,
29906,
29929,
742,
285,
29887,
2433,
10921,
742,
4079,
29922,
877,
742,
29871,
29896,
29906,
29892,
525,
8934,
8785,
13,
1678,
301,
15494,
29888,
650,
29889,
6689,
29898,
29916,
29922,
29896,
29945,
29900,
29892,
343,
29922,
29947,
29900,
29897,
13,
1678,
4382,
29888,
650,
353,
28236,
29898,
7165,
29918,
4645,
29872,
29892,
2920,
29922,
29896,
29906,
29892,
4079,
29922,
877,
742,
29871,
29896,
29896,
29892,
525,
8934,
8785,
13,
1678,
4382,
29888,
650,
29889,
6689,
29898,
29916,
29922,
29896,
29945,
29900,
29892,
343,
29922,
29896,
29896,
29900,
29897,
13,
13,
1678,
301,
2242,
1070,
353,
15796,
29898,
7165,
29918,
4645,
29872,
29892,
1426,
2433,
29907,
295,
1070,
742,
25989,
2433,
29937,
29906,
29929,
29906,
29929,
29906,
29929,
742,
285,
29887,
2433,
10921,
742,
4079,
29922,
877,
742,
29871,
29896,
29906,
29892,
525,
8934,
8785,
13,
1678,
301,
2242,
1070,
29889,
6689,
29898,
29916,
29922,
29906,
29947,
29941,
29892,
343,
29922,
29947,
29900,
29897,
13,
1678,
6432,
1070,
353,
28236,
29898,
7165,
29918,
4645,
29872,
29892,
2920,
29922,
29896,
29906,
29892,
4079,
29922,
877,
742,
29871,
29896,
29896,
29892,
525,
8934,
8785,
13,
1678,
6432,
1070,
29889,
6689,
29898,
29916,
29922,
29906,
29947,
29941,
29892,
343,
29922,
29896,
29896,
29900,
29897,
13,
13,
1678,
454,
2549,
353,
15796,
29898,
7165,
29918,
4645,
29872,
29892,
1426,
2433,
29923,
29899,
2549,
742,
25989,
2433,
29937,
29906,
29929,
29906,
29929,
29906,
29929,
742,
285,
29887,
2433,
10921,
742,
4079,
29922,
877,
742,
29871,
29896,
29906,
29892,
525,
8934,
8785,
13,
1678,
454,
2549,
29889,
6689,
29898,
29916,
29922,
29906,
29900,
29892,
343,
29922,
29896,
29946,
29900,
29897,
13,
1678,
4876,
353,
28236,
29898,
7165,
29918,
4645,
29872,
29892,
2920,
29922,
29946,
29945,
29892,
4079,
29922,
877,
742,
29871,
29896,
29896,
29892,
525,
8934,
8785,
13,
1678,
4876,
29889,
6689,
29898,
29916,
29922,
29906,
29900,
29892,
343,
29922,
29896,
29955,
29900,
29897,
13,
13,
1678,
301,
582,
29874,
353,
15796,
29898,
7165,
29918,
4645,
29872,
29892,
1426,
2433,
29934,
3357,
742,
25989,
2433,
29937,
29906,
29929,
29906,
29929,
29906,
29929,
742,
285,
29887,
2433,
10921,
742,
4079,
29922,
877,
742,
29871,
29896,
29906,
29892,
525,
8934,
8785,
13,
1678,
301,
582,
29874,
29889,
6689,
29898,
29916,
29922,
29906,
29900,
29892,
343,
29922,
29906,
29900,
29900,
29897,
13,
1678,
364,
3357,
353,
28236,
29898,
7165,
29918,
4645,
29872,
29892,
2920,
29922,
29946,
29945,
29892,
4079,
29922,
877,
742,
29871,
29896,
29896,
29892,
525,
8934,
8785,
13,
1678,
364,
3357,
29889,
6689,
29898,
29916,
29922,
29906,
29900,
29892,
343,
29922,
29906,
29941,
29900,
29897,
13,
13,
1678,
301,
1949,
1489,
353,
15796,
29898,
7165,
29918,
4645,
29872,
29892,
1426,
2433,
29940,
30030,
1050,
29877,
742,
25989,
2433,
29937,
29906,
29929,
29906,
29929,
29906,
29929,
742,
285,
29887,
2433,
10921,
742,
4079,
29922,
877,
742,
29871,
29896,
29906,
29892,
525,
8934,
8785,
13,
1678,
301,
1949,
1489,
29889,
6689,
29898,
29916,
29922,
29941,
29900,
29900,
29892,
343,
29922,
29906,
29953,
29900,
29897,
13,
1678,
17910,
353,
28236,
29898,
7165,
29918,
4645,
29872,
29892,
2920,
29922,
29896,
29900,
29892,
4079,
29922,
877,
742,
29871,
29896,
29896,
29892,
525,
8934,
8785,
13,
1678,
17910,
29889,
6689,
29898,
29916,
29922,
29941,
29900,
29900,
29892,
343,
29922,
29906,
29929,
29900,
29897,
13,
13,
1678,
27981,
1466,
307,
353,
15796,
29898,
7165,
29918,
4645,
29872,
29892,
1426,
2433,
29933,
1466,
307,
742,
25989,
2433,
29937,
29906,
29929,
29906,
29929,
29906,
29929,
742,
285,
29887,
2433,
10921,
742,
4079,
29922,
877,
742,
29871,
29896,
29906,
29892,
525,
8934,
8785,
13,
1678,
27981,
1466,
307,
29889,
6689,
29898,
29916,
29922,
29906,
29900,
29892,
343,
29922,
29906,
29953,
29900,
29897,
13,
1678,
289,
1466,
307,
353,
28236,
29898,
7165,
29918,
4645,
29872,
29892,
2920,
29922,
29941,
29896,
29892,
4079,
29922,
877,
742,
29871,
29896,
29896,
29892,
525,
8934,
8785,
13,
1678,
289,
1466,
307,
29889,
6689,
29898,
29916,
29922,
29906,
29900,
29892,
343,
29922,
29906,
29929,
29900,
29897,
13,
13,
1678,
301,
29883,
5558,
353,
15796,
29898,
7165,
29918,
4645,
29872,
29892,
1426,
2433,
29907,
5558,
742,
25989,
2433,
29937,
29906,
29929,
29906,
29929,
29906,
29929,
742,
285,
29887,
2433,
10921,
742,
4079,
29922,
877,
742,
29871,
29896,
29906,
29892,
525,
8934,
8785,
13,
1678,
301,
29883,
5558,
29889,
6689,
29898,
29916,
29922,
29906,
29900,
29892,
343,
29922,
29941,
29906,
29900,
29897,
13,
1678,
17931,
353,
28236,
29898,
7165,
29918,
4645,
29872,
29892,
2920,
29922,
29906,
29941,
29892,
4079,
29922,
877,
742,
29871,
29896,
29896,
29892,
525,
8934,
8785,
13,
1678,
17931,
29889,
6689,
29898,
29916,
29922,
29906,
29900,
29892,
343,
29922,
29941,
29945,
29900,
29897,
13,
13,
1678,
301,
342,
912,
353,
15796,
29898,
7165,
29918,
4645,
29872,
29892,
1426,
2433,
12787,
912,
742,
25989,
2433,
29937,
29906,
29929,
29906,
29929,
29906,
29929,
742,
285,
29887,
2433,
10921,
742,
4079,
29922,
877,
742,
29871,
29896,
29906,
29892,
525,
8934,
8785,
13,
1678,
301,
342,
912,
29889,
6689,
29898,
29916,
29922,
29906,
29941,
29945,
29892,
343,
29922,
29941,
29906,
29900,
29897,
13,
1678,
12082,
353,
28236,
29898,
7165,
29918,
4645,
29872,
29892,
2920,
29922,
29896,
29947,
29892,
4079,
29922,
877,
742,
29871,
29896,
29896,
29892,
525,
8934,
8785,
13,
1678,
12082,
29889,
6689,
29898,
29916,
29922,
29906,
29941,
29945,
29892,
343,
29922,
29941,
29945,
29900,
29897,
13,
13,
1678,
3474,
29918,
4645,
29872,
29889,
19156,
877,
29946,
29900,
29900,
29916,
29945,
29945,
29900,
29974,
29906,
29900,
29900,
29974,
29906,
29900,
29900,
1495,
13,
1678,
4833,
29889,
15060,
580,
13,
1678,
4833,
29889,
5358,
580,
13,
13,
13,
4632,
353,
323,
29895,
580,
13,
13,
21596,
353,
1963,
3747,
2940,
29898,
1445,
2433,
14569,
29899,
17481,
19011,
29889,
2732,
1495,
13,
14569,
353,
15796,
29898,
4632,
29892,
1967,
29922,
21596,
29892,
25989,
2433,
29937,
29906,
29929,
29906,
29929,
29906,
29929,
1495,
13,
14569,
29889,
4058,
29898,
29886,
3714,
29922,
29906,
29900,
29897,
13,
13,
1643,
29918,
1792,
353,
15796,
29898,
4632,
29892,
1426,
2433,
29965,
2146,
12288,
29901,
742,
4079,
29922,
877,
742,
29871,
29896,
29906,
511,
285,
29887,
2433,
21012,
742,
25989,
2433,
29937,
29906,
29929,
29906,
29929,
29906,
29929,
1495,
13,
1643,
29918,
1792,
29889,
6689,
29898,
29916,
29922,
29941,
29900,
29892,
343,
29922,
29896,
29906,
29900,
29897,
13,
8269,
29918,
1792,
353,
28236,
29898,
4632,
29892,
26922,
29922,
29907,
3919,
1001,
29892,
4079,
29922,
877,
742,
29871,
29896,
29896,
29892,
525,
8934,
5477,
2920,
29922,
29906,
29953,
29897,
13,
8269,
29918,
1792,
29889,
6689,
29898,
29916,
29922,
29896,
29900,
29900,
29892,
343,
29922,
29896,
29906,
29900,
29897,
13,
13,
1643,
29918,
5630,
353,
15796,
29898,
4632,
29892,
1426,
2433,
29903,
264,
2350,
29901,
742,
4079,
29922,
877,
742,
29871,
29896,
29906,
511,
285,
29887,
2433,
21012,
742,
25989,
2433,
29937,
29906,
29929,
29906,
29929,
29906,
29929,
1495,
13,
1643,
29918,
5630,
29889,
6689,
29898,
29916,
29922,
29946,
29900,
29892,
343,
29922,
29896,
29945,
29900,
29897,
13,
8269,
29918,
5630,
353,
28236,
29898,
4632,
29892,
26922,
29922,
29907,
3919,
1001,
29892,
4079,
29922,
877,
742,
29871,
29896,
29896,
29892,
525,
8934,
5477,
1510,
2433,
29930,
742,
2920,
29922,
29906,
29953,
29897,
13,
8269,
29918,
5630,
29889,
6689,
29898,
29916,
29922,
29896,
29900,
29900,
29892,
343,
29922,
29896,
29945,
29900,
29897,
13,
13,
3116,
29918,
7507,
353,
11025,
29898,
4632,
29892,
2920,
29922,
29947,
29892,
1426,
2433,
14480,
1177,
742,
4079,
29922,
877,
742,
29871,
29896,
29906,
29892,
525,
8934,
5477,
25989,
2433,
29937,
29945,
12328,
29941,
29900,
29890,
742,
285,
29887,
2433,
10921,
742,
1899,
29922,
27902,
29897,
13,
3116,
29918,
7507,
29889,
6689,
29898,
29916,
29922,
29896,
29900,
29900,
29892,
343,
29922,
29906,
29900,
29900,
29897,
13,
3116,
29918,
280,
1351,
353,
11025,
29898,
4632,
29892,
2920,
29922,
29947,
29892,
1426,
2433,
8132,
8193,
742,
4079,
29922,
877,
742,
29871,
29896,
29906,
29892,
525,
8934,
5477,
25989,
2433,
29937,
29945,
12328,
29941,
29900,
29890,
742,
285,
29887,
2433,
10921,
742,
1899,
29922,
4632,
29889,
28358,
29897,
13,
3116,
29918,
280,
1351,
29889,
6689,
29898,
29916,
29922,
29906,
29906,
29941,
29892,
343,
29922,
29906,
29900,
29900,
29897,
13,
13,
4632,
29889,
3257,
877,
11049,
1495,
13,
4632,
1839,
16264,
2033,
353,
16321,
29906,
29929,
29906,
29929,
29906,
29929,
29915,
13,
4632,
29889,
19156,
877,
29946,
29900,
29900,
29916,
29941,
29900,
29900,
29974,
29953,
29900,
29900,
29974,
29941,
29900,
29900,
1495,
13,
4632,
29889,
690,
13902,
29898,
29900,
29892,
29871,
29900,
29897,
13,
4632,
29889,
3396,
7888,
580,
13,
2
] |
tests/basic_stages/test_freq_drop.py | DavidKatz-il/pdpipe | 438 | 182234 | """Testing basic pipeline stages."""
import pandas as pd
from pdpipe.basic_stages import FreqDrop
DF1 = pd.DataFrame([[1, 4], [4, 5], [1, 11]], [1, 2, 3], ['a', 'b'])
def test_freqdrop_basic():
"""Testing the FreqDrop pipeline stage."""
res_df = FreqDrop(2, 'a').apply(DF1)
assert 1 in res_df.index
assert 2 not in res_df.index
assert 3 in res_df.index
def test_freqdrop_verbose():
"""Testing the FreqDrop pipeline stage."""
res_df = FreqDrop(2, 'a').apply(DF1, verbose=True)
assert 1 in res_df.index
assert 2 not in res_df.index
assert 3 in res_df.index
| [
1,
9995,
3057,
292,
6996,
16439,
22950,
1213,
15945,
13,
13,
5215,
11701,
408,
10518,
13,
13,
3166,
10518,
17760,
29889,
16121,
29918,
303,
1179,
1053,
3878,
29939,
15063,
13,
13,
13,
4037,
29896,
353,
10518,
29889,
17271,
4197,
29961,
29896,
29892,
29871,
29946,
1402,
518,
29946,
29892,
29871,
29945,
1402,
518,
29896,
29892,
29871,
29896,
29896,
20526,
518,
29896,
29892,
29871,
29906,
29892,
29871,
29941,
1402,
6024,
29874,
742,
525,
29890,
11287,
13,
13,
13,
1753,
1243,
29918,
29888,
7971,
8865,
29918,
16121,
7295,
13,
1678,
9995,
3057,
292,
278,
3878,
29939,
15063,
16439,
7408,
1213,
15945,
13,
1678,
620,
29918,
2176,
353,
3878,
29939,
15063,
29898,
29906,
29892,
525,
29874,
2824,
7302,
29898,
4037,
29896,
29897,
13,
1678,
4974,
29871,
29896,
297,
620,
29918,
2176,
29889,
2248,
13,
1678,
4974,
29871,
29906,
451,
297,
620,
29918,
2176,
29889,
2248,
13,
1678,
4974,
29871,
29941,
297,
620,
29918,
2176,
29889,
2248,
13,
13,
13,
1753,
1243,
29918,
29888,
7971,
8865,
29918,
369,
15828,
7295,
13,
1678,
9995,
3057,
292,
278,
3878,
29939,
15063,
16439,
7408,
1213,
15945,
13,
1678,
620,
29918,
2176,
353,
3878,
29939,
15063,
29898,
29906,
29892,
525,
29874,
2824,
7302,
29898,
4037,
29896,
29892,
26952,
29922,
5574,
29897,
13,
1678,
4974,
29871,
29896,
297,
620,
29918,
2176,
29889,
2248,
13,
1678,
4974,
29871,
29906,
451,
297,
620,
29918,
2176,
29889,
2248,
13,
1678,
4974,
29871,
29941,
297,
620,
29918,
2176,
29889,
2248,
13,
2
] |
src/clophfit/old/dil_correction.py | darosio/ClopHfit | 0 | 44403 | #!/usr/bin/python
#
import argparse
import os
import pandas as pd
corr = {'pH': [1, 1.02, 1.04, 1.06, 1.08, 1.1, 1.12],
'cl': [1.000000, 1.017857, 1.035714, 1.053571, 1.071429, 1.089286,
1.107143, 1.160714, 1.196429]}
corr = {'pH': [1, 1.02, 1.04, 1.06, 1.08, 1.1],
'cl': [1.000000, 1.017857, 1.035714, 1.053571, 1.071429, 1.089286,
1.107143, 1.160714, 1.196429]}
def main():
description = "make correction for dilution"
parser = argparse.ArgumentParser(description=description)
parser.add_argument('ffile',
help="a file x y1 y2 --> y1*corr y2*corr")
parser.add_argument('out',
help="destination directory")
parser.add_argument('buffer', nargs=2,
help="buffer values for y1 y2")
parser.add_argument("-t", "--titration-of", action="store", default="pH",
choices=["pH", "cl"], dest='titration_type')
args = parser.parse_args()
df = pd.read_csv(args.ffile)
df.y1 -= float(args.buffer[0])
df.y2 -= float(args.buffer[1])
df.y1 *= corr[args.titration_type]
df.y2 *= corr[args.titration_type]
if not os.path.isdir(args.out):
os.makedirs(args.out)
df.to_csv(os.path.join(args.out, args.ffile), index=False)
main()
| [
1,
18787,
4855,
29914,
2109,
29914,
4691,
13,
29937,
13,
13,
5215,
1852,
5510,
13,
5215,
2897,
13,
5215,
11701,
408,
10518,
13,
13,
13,
29725,
353,
11117,
29886,
29950,
2396,
518,
29896,
29892,
29871,
29896,
29889,
29900,
29906,
29892,
29871,
29896,
29889,
29900,
29946,
29892,
29871,
29896,
29889,
29900,
29953,
29892,
29871,
29896,
29889,
29900,
29947,
29892,
29871,
29896,
29889,
29896,
29892,
29871,
29896,
29889,
29896,
29906,
1402,
13,
4706,
525,
695,
2396,
518,
29896,
29889,
29900,
29900,
29900,
29900,
29900,
29900,
29892,
29871,
29896,
29889,
29900,
29896,
29955,
29947,
29945,
29955,
29892,
29871,
29896,
29889,
29900,
29941,
29945,
29955,
29896,
29946,
29892,
29871,
29896,
29889,
29900,
29945,
29941,
29945,
29955,
29896,
29892,
29871,
29896,
29889,
29900,
29955,
29896,
29946,
29906,
29929,
29892,
29871,
29896,
29889,
29900,
29947,
29929,
29906,
29947,
29953,
29892,
13,
18884,
29896,
29889,
29896,
29900,
29955,
29896,
29946,
29941,
29892,
29871,
29896,
29889,
29896,
29953,
29900,
29955,
29896,
29946,
29892,
29871,
29896,
29889,
29896,
29929,
29953,
29946,
29906,
29929,
12258,
13,
13,
29725,
353,
11117,
29886,
29950,
2396,
518,
29896,
29892,
29871,
29896,
29889,
29900,
29906,
29892,
29871,
29896,
29889,
29900,
29946,
29892,
29871,
29896,
29889,
29900,
29953,
29892,
29871,
29896,
29889,
29900,
29947,
29892,
29871,
29896,
29889,
29896,
1402,
13,
4706,
525,
695,
2396,
518,
29896,
29889,
29900,
29900,
29900,
29900,
29900,
29900,
29892,
29871,
29896,
29889,
29900,
29896,
29955,
29947,
29945,
29955,
29892,
29871,
29896,
29889,
29900,
29941,
29945,
29955,
29896,
29946,
29892,
29871,
29896,
29889,
29900,
29945,
29941,
29945,
29955,
29896,
29892,
29871,
29896,
29889,
29900,
29955,
29896,
29946,
29906,
29929,
29892,
29871,
29896,
29889,
29900,
29947,
29929,
29906,
29947,
29953,
29892,
13,
18884,
29896,
29889,
29896,
29900,
29955,
29896,
29946,
29941,
29892,
29871,
29896,
29889,
29896,
29953,
29900,
29955,
29896,
29946,
29892,
29871,
29896,
29889,
29896,
29929,
29953,
29946,
29906,
29929,
12258,
13,
13,
13,
1753,
1667,
7295,
13,
1678,
6139,
353,
376,
5675,
26385,
363,
21749,
918,
29908,
13,
1678,
13812,
353,
1852,
5510,
29889,
15730,
11726,
29898,
8216,
29922,
8216,
29897,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
600,
488,
742,
13,
462,
4706,
1371,
543,
29874,
934,
921,
343,
29896,
343,
29906,
6660,
343,
29896,
29930,
29725,
343,
29906,
29930,
29725,
1159,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
449,
742,
13,
462,
4706,
1371,
543,
23848,
3884,
1159,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
9040,
742,
302,
5085,
29922,
29906,
29892,
13,
462,
4706,
1371,
543,
9040,
1819,
363,
343,
29896,
343,
29906,
1159,
13,
1678,
13812,
29889,
1202,
29918,
23516,
703,
29899,
29873,
613,
376,
489,
23545,
29878,
362,
29899,
974,
613,
3158,
543,
8899,
613,
2322,
543,
29886,
29950,
613,
13,
462,
4706,
19995,
29922,
3366,
29886,
29950,
613,
376,
695,
12436,
2731,
2433,
23545,
29878,
362,
29918,
1853,
1495,
13,
1678,
6389,
353,
13812,
29889,
5510,
29918,
5085,
580,
13,
1678,
4489,
353,
10518,
29889,
949,
29918,
7638,
29898,
5085,
29889,
600,
488,
29897,
13,
1678,
4489,
29889,
29891,
29896,
22361,
5785,
29898,
5085,
29889,
9040,
29961,
29900,
2314,
13,
1678,
4489,
29889,
29891,
29906,
22361,
5785,
29898,
5085,
29889,
9040,
29961,
29896,
2314,
13,
1678,
4489,
29889,
29891,
29896,
334,
29922,
27760,
29961,
5085,
29889,
23545,
29878,
362,
29918,
1853,
29962,
13,
1678,
4489,
29889,
29891,
29906,
334,
29922,
27760,
29961,
5085,
29889,
23545,
29878,
362,
29918,
1853,
29962,
13,
1678,
565,
451,
2897,
29889,
2084,
29889,
275,
3972,
29898,
5085,
29889,
449,
1125,
13,
4706,
2897,
29889,
29885,
12535,
12935,
29898,
5085,
29889,
449,
29897,
13,
1678,
4489,
29889,
517,
29918,
7638,
29898,
359,
29889,
2084,
29889,
7122,
29898,
5085,
29889,
449,
29892,
6389,
29889,
600,
488,
511,
2380,
29922,
8824,
29897,
13,
13,
13,
3396,
580,
13,
2
] |
api/api.py | dartm05/Shape-Prediction | 0 | 80425 |
import numpy as np
import io
from PIL import Image
import tensorflow as tf
from tensorflow.keras.models import load_model
from tensorflow.keras.preprocessing.image import img_to_array
import matplotlib.pyplot as plt
from flask import Flask,render_template,redirect,url_for,request
import urllib3
from tensorflow.keras.preprocessing import image
import os
app = Flask(__name__)
model = load_model('shape2.h5')
# Image preprocessing/prediction function
def predict_(img_path, show=False):
img = image.load_img(img_path, target_size=(224, 224))
img_tensor = image.img_to_array(img) # (height, width, channels)
img_tensor = np.expand_dims(img_tensor, axis=0) # (1, height, width, channels), add a dimension because the model expects this shape: (batch_size, height, width, channels)
img_tensor /= 255. # imshow expects values in the range [0, 1]
prediction = model.predict(img_tensor)
if show:
plt.imshow(img_tensor[0])
plt.axis('off')
plt.show()
return prediction
# Home
@app.route('/', methods=['GET'])
def api():
return {
'userid':1,
'title':'Flask react app',
'completed': False
}
@app.route('/predict',methods = ['GET' , 'POST'])
def predictions():
error = ''
# Change image dir to fit needs
target_img = os.path.join(os.getcwd() , 'static/images')
if request.method == 'POST':
if (request.files):
file = request.files['file']
if file:
file.save(os.path.join(target_img , file.filename))
img_path = os.path.join(target_img , file.filename)
img = file.filename
predictions = predict_(img_path)
# Change to a switch-case later
if round(predictions[0][0]) == 0:
pred = 'Circle'
if round(predictions[0][0]) == 1:
pred = 'Rectangle'
if round(predictions[0][0]) == 2:
pred = 'Star'
if round(predictions[0][0]) == 3:
pred = 'Triangle'
else:
pred = 'No existe XD'
predictions = {
'Prediction': pred
}
else:
error = "Please draw a shape to predict."
if(len(error) == 0):
# No error
pass
else:
# Error
pass
else:
# Method no fue POST XD
pass
if __name__ == '__main__':
app.run(debug=True) | [
1,
29871,
13,
5215,
12655,
408,
7442,
13,
5215,
12013,
13,
3166,
349,
6227,
1053,
7084,
13,
5215,
26110,
408,
15886,
13,
3166,
26110,
29889,
3946,
294,
29889,
9794,
1053,
2254,
29918,
4299,
13,
3166,
26110,
29889,
3946,
294,
29889,
1457,
19170,
29889,
3027,
1053,
10153,
29918,
517,
29918,
2378,
13,
5215,
22889,
29889,
2272,
5317,
408,
14770,
13,
3166,
29784,
1053,
2379,
1278,
29892,
9482,
29918,
6886,
29892,
17886,
29892,
2271,
29918,
1454,
29892,
3827,
13,
5215,
3142,
1982,
29941,
13,
3166,
26110,
29889,
3946,
294,
29889,
1457,
19170,
1053,
1967,
13,
5215,
2897,
13,
13,
13,
932,
353,
2379,
1278,
22168,
978,
1649,
29897,
13,
13,
4299,
353,
2254,
29918,
4299,
877,
12181,
29906,
29889,
29882,
29945,
1495,
13,
13,
29937,
7084,
758,
19170,
29914,
11965,
2463,
740,
13,
1753,
8500,
23538,
2492,
29918,
2084,
29892,
1510,
29922,
8824,
1125,
13,
13,
1678,
10153,
353,
1967,
29889,
1359,
29918,
2492,
29898,
2492,
29918,
2084,
29892,
3646,
29918,
2311,
7607,
29906,
29906,
29946,
29892,
29871,
29906,
29906,
29946,
876,
13,
1678,
10153,
29918,
20158,
353,
1967,
29889,
2492,
29918,
517,
29918,
2378,
29898,
2492,
29897,
462,
1678,
396,
313,
3545,
29892,
2920,
29892,
18196,
29897,
13,
1678,
10153,
29918,
20158,
353,
7442,
29889,
18837,
29918,
6229,
29879,
29898,
2492,
29918,
20158,
29892,
9685,
29922,
29900,
29897,
308,
396,
313,
29896,
29892,
3171,
29892,
2920,
29892,
18196,
511,
788,
263,
9927,
1363,
278,
1904,
23347,
445,
8267,
29901,
313,
16175,
29918,
2311,
29892,
3171,
29892,
2920,
29892,
18196,
29897,
13,
1678,
10153,
29918,
20158,
847,
29922,
29871,
29906,
29945,
29945,
29889,
462,
462,
418,
396,
527,
4294,
23347,
1819,
297,
278,
3464,
518,
29900,
29892,
29871,
29896,
29962,
13,
13,
1678,
18988,
353,
1904,
29889,
27711,
29898,
2492,
29918,
20158,
29897,
13,
13,
1678,
565,
1510,
29901,
13,
4706,
14770,
29889,
326,
4294,
29898,
2492,
29918,
20158,
29961,
29900,
2314,
462,
9651,
13,
4706,
14770,
29889,
8990,
877,
2696,
1495,
13,
4706,
14770,
29889,
4294,
580,
13,
13,
268,
13,
1678,
736,
18988,
13,
13,
13,
13,
29937,
8778,
13,
29992,
932,
29889,
13134,
11219,
742,
3519,
29922,
1839,
7194,
11287,
13,
1753,
7882,
7295,
13,
1678,
736,
426,
13,
4706,
525,
1792,
333,
2396,
29896,
29892,
13,
4706,
525,
3257,
22099,
8754,
1278,
7657,
623,
742,
13,
4706,
525,
5729,
9446,
2396,
7700,
13,
1678,
500,
13,
13,
29992,
932,
29889,
13134,
11219,
27711,
742,
23515,
353,
6024,
7194,
29915,
1919,
525,
5438,
11287,
13,
1753,
27303,
7295,
13,
1678,
1059,
353,
6629,
13,
1678,
396,
10726,
1967,
4516,
304,
6216,
4225,
13,
1678,
3646,
29918,
2492,
353,
2897,
29889,
2084,
29889,
7122,
29898,
359,
29889,
657,
29883,
9970,
580,
1919,
525,
7959,
29914,
8346,
1495,
13,
1678,
565,
2009,
29889,
5696,
1275,
525,
5438,
2396,
13,
4706,
565,
313,
3827,
29889,
5325,
1125,
13,
9651,
934,
353,
2009,
29889,
5325,
1839,
1445,
2033,
13,
9651,
565,
934,
29901,
13,
18884,
934,
29889,
7620,
29898,
359,
29889,
2084,
29889,
7122,
29898,
5182,
29918,
2492,
1919,
934,
29889,
9507,
876,
13,
18884,
10153,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
5182,
29918,
2492,
1919,
934,
29889,
9507,
29897,
13,
18884,
10153,
353,
934,
29889,
9507,
13,
13,
18884,
27303,
353,
8500,
23538,
2492,
29918,
2084,
29897,
13,
462,
13,
18884,
396,
10726,
304,
263,
4607,
29899,
4878,
2678,
29871,
13,
18884,
565,
4513,
29898,
27711,
1080,
29961,
29900,
3816,
29900,
2314,
1275,
29871,
29900,
29901,
13,
462,
1678,
4450,
353,
525,
23495,
280,
29915,
13,
18884,
565,
4513,
29898,
27711,
1080,
29961,
29900,
3816,
29900,
2314,
1275,
29871,
29896,
29901,
13,
462,
1678,
4450,
353,
525,
7364,
2521,
29915,
13,
18884,
565,
4513,
29898,
27711,
1080,
29961,
29900,
3816,
29900,
2314,
1275,
29871,
29906,
29901,
13,
462,
1678,
4450,
353,
525,
16213,
29915,
13,
18884,
565,
4513,
29898,
27711,
1080,
29961,
29900,
3816,
29900,
2314,
1275,
29871,
29941,
29901,
13,
462,
1678,
4450,
353,
525,
29565,
2521,
29915,
13,
18884,
1683,
29901,
13,
462,
1678,
4450,
353,
525,
3782,
19947,
1060,
29928,
29915,
13,
462,
13,
18884,
27303,
353,
426,
13,
462,
539,
525,
23084,
2463,
2396,
4450,
13,
18884,
500,
13,
13,
9651,
1683,
29901,
13,
18884,
1059,
353,
376,
12148,
4216,
263,
8267,
304,
8500,
1213,
13,
13,
9651,
565,
29898,
2435,
29898,
2704,
29897,
1275,
29871,
29900,
1125,
13,
18884,
396,
1939,
1059,
13,
18884,
1209,
13,
9651,
1683,
29901,
13,
18884,
396,
4829,
13,
18884,
1209,
13,
268,
13,
1678,
1683,
29901,
13,
4706,
396,
8108,
694,
3576,
11971,
1060,
29928,
13,
4706,
1209,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
623,
29889,
3389,
29898,
8382,
29922,
5574,
29897,
2
] |
API/client.py | Ray1993TW/Kn-Pressure_Test | 0 | 100967 | <reponame>Ray1993TW/Kn-Pressure_Test
import requests, json, cv2
url1 = ''
content_type = 'image/jpeg'
headers = {'content-type': content_type}
class useAPI:
def __init__(self, frame):
h,w,c = frame.shape
if(h<=0):
h=w
elif(w<=0):
w=h
else:
self._state_, self.img_encoded = cv2.imencode('.jpg', frame)
def get_answer(self):
try:
response1 = requests.post(url1, data=self.img_encoded.tostring(), headers=headers, timeout = 3)
get_json1 = json.loads(response1.text)
return get_json1
except:
return 'e'
| [
1,
529,
276,
1112,
420,
29958,
29934,
388,
29896,
29929,
29929,
29941,
16240,
29914,
29968,
29876,
29899,
10923,
545,
29918,
3057,
13,
5215,
7274,
29892,
4390,
29892,
13850,
29906,
13,
13,
2271,
29896,
353,
6629,
13,
13,
3051,
29918,
1853,
353,
525,
3027,
29914,
26568,
29915,
13,
13662,
353,
11117,
3051,
29899,
1853,
2396,
2793,
29918,
1853,
29913,
13,
13,
1990,
671,
8787,
29901,
13,
12,
1753,
4770,
2344,
12035,
1311,
29892,
3515,
1125,
13,
12,
12,
29882,
29892,
29893,
29892,
29883,
353,
3515,
29889,
12181,
13,
12,
12,
361,
29898,
29882,
14065,
29900,
1125,
13,
12,
12,
12,
29882,
29922,
29893,
13,
12,
12,
23681,
29898,
29893,
14065,
29900,
1125,
13,
12,
12,
12,
29893,
29922,
29882,
13,
12,
12,
2870,
29901,
13,
12,
12,
12,
1311,
3032,
3859,
3383,
1583,
29889,
2492,
29918,
26716,
353,
13850,
29906,
29889,
326,
12508,
12839,
6173,
742,
3515,
29897,
13,
13,
12,
1753,
679,
29918,
12011,
29898,
1311,
1125,
13,
12,
12,
2202,
29901,
13,
12,
12,
12,
5327,
29896,
353,
7274,
29889,
2490,
29898,
2271,
29896,
29892,
848,
29922,
1311,
29889,
2492,
29918,
26716,
29889,
517,
1807,
3285,
9066,
29922,
13662,
29892,
11815,
353,
29871,
29941,
29897,
13,
13,
12,
12,
12,
657,
29918,
3126,
29896,
353,
4390,
29889,
18132,
29898,
5327,
29896,
29889,
726,
29897,
13,
12,
12,
12,
2457,
679,
29918,
3126,
29896,
13,
12,
12,
19499,
29901,
13,
12,
12,
12,
2457,
525,
29872,
29915,
13,
12,
12,
12,
2
] |
AlgorithmsAndDataStructures/mod2/Heap.py | BootyAss/bmstu | 0 | 4734 | <gh_stars>0
class Heap:
def __init__(self):
self.items = dict() # key - (value, index)
self.indexes = [] # index - key // to know indexes
# Usefull functions
def swap(self, i, j):
x = self.indexes[i] # key of 1 item
y = self.indexes[j] # key of 2 item
# swap keys in index array
self.indexes[i] = y
self.indexes[j] = x
temp = self.items[x][1] # index of 1 item
# swap indexes in dictionary
self.items.update({x: (self.items[x][0], self.items[y][1])})
self.items.update({y: (self.items[y][0], temp)})
def bigger(self, i, j):
if self.indexes[i] <= self.indexes[j]:
return False
else:
return True
# Check family UwU
def hasParent(self, i):
if (i - 1)/2 >= 0:
return True
return False
def parentIndex(self, i):
return int((i - 1)/2)
def hasLeft(self, i):
if i*2 + 1 < len(self.indexes):
return True
return False
def leftIndex(self, i):
return int(i*2 + 1)
def hasRight(self, i):
if i*2 + 2 < len(self.indexes):
return True
return False
def rightIndex(self, i):
return int(i*2 + 2)
# heapifys
def heapifyUp(self, i=None):
if i:
index = i
else:
index = len(self.indexes) - 1
while self.hasParent(index) and self.bigger(self.parentIndex(index), index):
self.swap(self.parentIndex(index), index)
index = self.parentIndex(index)
def heapifyDown(self, i=0):
index = i
while self.hasLeft(index):
smaller = self.leftIndex(index)
if self.hasRight(index) and self.bigger(self.leftIndex(index), self.rightIndex(index)):
smaller = self.rightIndex(index)
if self.bigger(smaller, index):
break
else:
self.swap(index, smaller)
index = smaller
# all needed methods
def add(self, key, data):
if self.items.get(key, None):
raise(Exception)
self.items[key] = (data, int(len(self.indexes)))
self.indexes.append(key)
self.heapifyUp()
def set(self, key, data):
temp = self.items.get(key, None)
if not temp:
raise(Exception)
self.items[key] = (data, temp[1])
def delete(self, key):
temp = self.items.get(key, None)
if not temp:
raise(Exception)
if len(self.indexes) > 1:
lastKey = self.indexes[-1]
last = self.items.get(lastKey, None)
# set last item index of deleted
self.items.update({lastKey: (last[0], temp[1])})
# set key of last item to deleted index
self.indexes[temp[1]] = lastKey
self.indexes.pop()
del self.items[key]
if temp[1] < len(self.indexes): # dont heapify if deleted last element
self.heapifyDown(i=temp[1])
self.heapifyUp(i=temp[1])
def search(self, key):
temp = self.items.get(key, None)
if temp:
print('1', temp[1], temp[0])
else:
print('0')
def min(self):
if len(self.indexes) == 0:
raise(Exception)
key = self.indexes[0]
print(key, '0', self.items[key][0])
def max(self):
if len(self.indexes) == 0:
raise(Exception)
i = int(len(self.indexes)/2)
maxKey = self.indexes[i]
index = i
while i < len(self.indexes):
if maxKey < self.indexes[i]:
maxKey = self.indexes[i]
index = i
i += 1
print(maxKey, index, self.items[maxKey][0])
def extract(self):
if len(self.indexes) == 0:
raise(Exception)
rootKey = self.indexes[0]
rootData = self.items[rootKey][0]
del self.items[rootKey]
if len(self.indexes) > 1:
self.indexes[0] = self.indexes.pop()
# set top item index to 0
self.items.update({self.indexes[0] : (self.items[self.indexes[0]][0], 0)})
self.heapifyDown()
else:
self.indexes.pop()
print(rootKey, rootData)
def print(self):
height = 0
index = 0
out = ''
i = 0
if len(self.indexes) == 0:
out += '_\n'
print('_')
return
while i < len(self.indexes):
lineLen = 1 << height
index += 1
key = self.indexes[i]
out += '[' + str(key) + ' ' + self.items[key][0]
if height != 0:
out += ' ' + str(self.indexes[self.parentIndex(i)])
out += ']'
if index == lineLen:
out += '\n'
index = 0
height += 1
else:
out += ' '
i += 1
if index != 0 and index < lineLen:
out += '_ ' * (lineLen - index)
print(out[0:-1])
else:
print(out, end='')
cycle = True
heap = Heap()
while cycle:
try:
line = input()
cmd = line.split(' ', 2)
try:
if len(cmd) == 1 and cmd[0] == '':
continue
if len(cmd) == 2 and cmd[0] == '' and cmd[1] == '':
continue
if cmd[0] == 'add':
heap.add(int(cmd[1]), cmd[2])
elif cmd[0] == 'set':
heap.set(int(cmd[1]), cmd[2])
elif cmd[0] == 'delete':
heap.delete(int(cmd[1]))
elif cmd[0] == 'search':
heap.search(int(cmd[1]))
elif cmd[0] == 'min':
heap.min()
elif cmd[0] == 'max':
heap.max()
elif cmd[0] == 'extract':
heap.extract()
elif cmd[0] == 'print':
heap.print()
else:
raise(Exception)
except Exception:
print('error')
continue
except Exception:
cycle = False
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
1990,
940,
481,
29901,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
1583,
29889,
7076,
353,
9657,
580,
268,
396,
1820,
448,
313,
1767,
29892,
2380,
29897,
13,
4706,
1583,
29889,
2248,
267,
353,
5159,
539,
396,
2380,
29871,
448,
1820,
849,
304,
1073,
18111,
29871,
13,
13,
13,
1678,
396,
4803,
8159,
3168,
13,
1678,
822,
17945,
29898,
1311,
29892,
474,
29892,
432,
1125,
13,
4706,
921,
353,
1583,
29889,
2248,
267,
29961,
29875,
29962,
268,
396,
1820,
310,
29871,
29896,
2944,
13,
4706,
343,
353,
1583,
29889,
2248,
267,
29961,
29926,
29962,
268,
396,
1820,
310,
29871,
29906,
2944,
13,
13,
4706,
396,
17945,
6611,
297,
2380,
1409,
13,
4706,
1583,
29889,
2248,
267,
29961,
29875,
29962,
353,
343,
13,
4706,
1583,
29889,
2248,
267,
29961,
29926,
29962,
353,
921,
13,
13,
4706,
5694,
353,
1583,
29889,
7076,
29961,
29916,
3816,
29896,
29962,
268,
396,
2380,
310,
29871,
29896,
2944,
13,
13,
4706,
396,
17945,
18111,
297,
8600,
13,
4706,
1583,
29889,
7076,
29889,
5504,
3319,
29916,
29901,
313,
1311,
29889,
7076,
29961,
29916,
3816,
29900,
1402,
1583,
29889,
7076,
29961,
29891,
3816,
29896,
2314,
1800,
13,
4706,
1583,
29889,
7076,
29889,
5504,
3319,
29891,
29901,
313,
1311,
29889,
7076,
29961,
29891,
3816,
29900,
1402,
5694,
26972,
13,
13,
1678,
822,
16600,
29898,
1311,
29892,
474,
29892,
432,
1125,
13,
4706,
565,
1583,
29889,
2248,
267,
29961,
29875,
29962,
5277,
1583,
29889,
2248,
267,
29961,
29926,
5387,
13,
9651,
736,
7700,
13,
4706,
1683,
29901,
13,
9651,
736,
5852,
13,
13,
13,
1678,
396,
5399,
3942,
501,
29893,
29965,
13,
1678,
822,
756,
9780,
29898,
1311,
29892,
474,
1125,
13,
4706,
565,
313,
29875,
448,
29871,
29896,
6802,
29906,
6736,
29871,
29900,
29901,
13,
9651,
736,
5852,
13,
4706,
736,
7700,
13,
1678,
822,
3847,
3220,
29898,
1311,
29892,
474,
1125,
13,
4706,
736,
938,
3552,
29875,
448,
29871,
29896,
6802,
29906,
29897,
13,
13,
1678,
822,
756,
8091,
29898,
1311,
29892,
474,
1125,
13,
4706,
565,
474,
29930,
29906,
718,
29871,
29896,
529,
7431,
29898,
1311,
29889,
2248,
267,
1125,
13,
9651,
736,
5852,
13,
4706,
736,
7700,
13,
1678,
822,
2175,
3220,
29898,
1311,
29892,
474,
1125,
13,
4706,
736,
938,
29898,
29875,
29930,
29906,
718,
29871,
29896,
29897,
13,
13,
1678,
822,
756,
7341,
29898,
1311,
29892,
474,
1125,
13,
4706,
565,
474,
29930,
29906,
718,
29871,
29906,
529,
7431,
29898,
1311,
29889,
2248,
267,
1125,
13,
9651,
736,
5852,
13,
4706,
736,
7700,
13,
1678,
822,
1492,
3220,
29898,
1311,
29892,
474,
1125,
13,
4706,
736,
938,
29898,
29875,
29930,
29906,
718,
29871,
29906,
29897,
13,
13,
13,
1678,
396,
16947,
361,
952,
13,
1678,
822,
16947,
1598,
3373,
29898,
1311,
29892,
474,
29922,
8516,
1125,
13,
4706,
565,
474,
29901,
13,
9651,
2380,
353,
474,
13,
4706,
1683,
29901,
13,
9651,
2380,
353,
7431,
29898,
1311,
29889,
2248,
267,
29897,
448,
29871,
29896,
13,
13,
4706,
1550,
1583,
29889,
5349,
9780,
29898,
2248,
29897,
322,
1583,
29889,
29890,
3567,
29898,
1311,
29889,
3560,
3220,
29898,
2248,
511,
2380,
1125,
13,
9651,
1583,
29889,
26276,
29898,
1311,
29889,
3560,
3220,
29898,
2248,
511,
2380,
29897,
13,
9651,
2380,
353,
1583,
29889,
3560,
3220,
29898,
2248,
29897,
13,
13,
1678,
822,
16947,
1598,
6767,
29898,
1311,
29892,
474,
29922,
29900,
1125,
13,
4706,
2380,
353,
474,
13,
4706,
1550,
1583,
29889,
5349,
8091,
29898,
2248,
1125,
13,
9651,
7968,
353,
1583,
29889,
1563,
3220,
29898,
2248,
29897,
13,
9651,
565,
1583,
29889,
5349,
7341,
29898,
2248,
29897,
322,
1583,
29889,
29890,
3567,
29898,
1311,
29889,
1563,
3220,
29898,
2248,
511,
1583,
29889,
1266,
3220,
29898,
2248,
22164,
13,
18884,
7968,
353,
1583,
29889,
1266,
3220,
29898,
2248,
29897,
13,
13,
9651,
565,
1583,
29889,
29890,
3567,
29898,
9278,
261,
29892,
2380,
1125,
13,
18884,
2867,
13,
9651,
1683,
29901,
13,
18884,
1583,
29889,
26276,
29898,
2248,
29892,
7968,
29897,
13,
13,
9651,
2380,
353,
7968,
13,
13,
13,
1678,
396,
599,
4312,
3519,
13,
1678,
822,
788,
29898,
1311,
29892,
1820,
29892,
848,
1125,
13,
4706,
565,
1583,
29889,
7076,
29889,
657,
29898,
1989,
29892,
6213,
1125,
13,
9651,
12020,
29898,
2451,
29897,
13,
13,
4706,
1583,
29889,
7076,
29961,
1989,
29962,
353,
313,
1272,
29892,
938,
29898,
2435,
29898,
1311,
29889,
2248,
267,
4961,
13,
4706,
1583,
29889,
2248,
267,
29889,
4397,
29898,
1989,
29897,
13,
4706,
1583,
29889,
354,
481,
1598,
3373,
580,
13,
13,
1678,
822,
731,
29898,
1311,
29892,
1820,
29892,
848,
1125,
13,
4706,
5694,
353,
1583,
29889,
7076,
29889,
657,
29898,
1989,
29892,
6213,
29897,
13,
4706,
565,
451,
5694,
29901,
13,
9651,
12020,
29898,
2451,
29897,
13,
13,
4706,
1583,
29889,
7076,
29961,
1989,
29962,
353,
313,
1272,
29892,
5694,
29961,
29896,
2314,
13,
13,
1678,
822,
5217,
29898,
1311,
29892,
1820,
1125,
13,
4706,
5694,
353,
1583,
29889,
7076,
29889,
657,
29898,
1989,
29892,
6213,
29897,
13,
4706,
565,
451,
5694,
29901,
13,
9651,
12020,
29898,
2451,
29897,
13,
13,
4706,
565,
7431,
29898,
1311,
29889,
2248,
267,
29897,
1405,
29871,
29896,
29901,
13,
9651,
1833,
2558,
353,
1583,
29889,
2248,
267,
14352,
29896,
29962,
13,
9651,
1833,
353,
1583,
29889,
7076,
29889,
657,
29898,
4230,
2558,
29892,
6213,
29897,
13,
13,
9651,
396,
731,
1833,
2944,
2380,
310,
11132,
13,
9651,
1583,
29889,
7076,
29889,
5504,
3319,
4230,
2558,
29901,
313,
4230,
29961,
29900,
1402,
5694,
29961,
29896,
2314,
1800,
13,
13,
9651,
396,
731,
1820,
310,
1833,
2944,
304,
11132,
2380,
13,
9651,
1583,
29889,
2248,
267,
29961,
7382,
29961,
29896,
5262,
353,
1833,
2558,
13,
13,
4706,
1583,
29889,
2248,
267,
29889,
7323,
580,
13,
4706,
628,
1583,
29889,
7076,
29961,
1989,
29962,
13,
13,
4706,
565,
5694,
29961,
29896,
29962,
529,
7431,
29898,
1311,
29889,
2248,
267,
1125,
259,
396,
4555,
16947,
1598,
565,
11132,
1833,
1543,
13,
9651,
1583,
29889,
354,
481,
1598,
6767,
29898,
29875,
29922,
7382,
29961,
29896,
2314,
13,
9651,
1583,
29889,
354,
481,
1598,
3373,
29898,
29875,
29922,
7382,
29961,
29896,
2314,
13,
13,
1678,
822,
2740,
29898,
1311,
29892,
1820,
1125,
13,
4706,
5694,
353,
1583,
29889,
7076,
29889,
657,
29898,
1989,
29892,
6213,
29897,
13,
4706,
565,
5694,
29901,
13,
9651,
1596,
877,
29896,
742,
5694,
29961,
29896,
1402,
5694,
29961,
29900,
2314,
13,
4706,
1683,
29901,
13,
9651,
1596,
877,
29900,
1495,
13,
13,
1678,
822,
1375,
29898,
1311,
1125,
13,
4706,
565,
7431,
29898,
1311,
29889,
2248,
267,
29897,
1275,
29871,
29900,
29901,
13,
9651,
12020,
29898,
2451,
29897,
13,
13,
4706,
1820,
353,
1583,
29889,
2248,
267,
29961,
29900,
29962,
13,
4706,
1596,
29898,
1989,
29892,
525,
29900,
742,
1583,
29889,
7076,
29961,
1989,
3816,
29900,
2314,
13,
13,
1678,
822,
4236,
29898,
1311,
1125,
13,
4706,
565,
7431,
29898,
1311,
29889,
2248,
267,
29897,
1275,
29871,
29900,
29901,
13,
9651,
12020,
29898,
2451,
29897,
13,
13,
4706,
474,
353,
938,
29898,
2435,
29898,
1311,
29889,
2248,
267,
6802,
29906,
29897,
13,
4706,
4236,
2558,
353,
1583,
29889,
2248,
267,
29961,
29875,
29962,
13,
13,
4706,
2380,
353,
474,
13,
4706,
1550,
474,
529,
7431,
29898,
1311,
29889,
2248,
267,
1125,
13,
9651,
565,
4236,
2558,
529,
1583,
29889,
2248,
267,
29961,
29875,
5387,
13,
18884,
4236,
2558,
353,
1583,
29889,
2248,
267,
29961,
29875,
29962,
13,
18884,
2380,
353,
474,
13,
9651,
474,
4619,
29871,
29896,
13,
4706,
1596,
29898,
3317,
2558,
29892,
2380,
29892,
1583,
29889,
7076,
29961,
3317,
2558,
3816,
29900,
2314,
13,
13,
1678,
822,
6597,
29898,
1311,
1125,
13,
4706,
565,
7431,
29898,
1311,
29889,
2248,
267,
29897,
1275,
29871,
29900,
29901,
13,
9651,
12020,
29898,
2451,
29897,
13,
13,
4706,
3876,
2558,
353,
1583,
29889,
2248,
267,
29961,
29900,
29962,
13,
4706,
3876,
1469,
353,
1583,
29889,
7076,
29961,
4632,
2558,
3816,
29900,
29962,
13,
4706,
628,
1583,
29889,
7076,
29961,
4632,
2558,
29962,
13,
13,
4706,
565,
7431,
29898,
1311,
29889,
2248,
267,
29897,
1405,
29871,
29896,
29901,
13,
9651,
1583,
29889,
2248,
267,
29961,
29900,
29962,
353,
1583,
29889,
2248,
267,
29889,
7323,
580,
13,
13,
9651,
396,
731,
2246,
2944,
2380,
304,
29871,
29900,
13,
9651,
1583,
29889,
7076,
29889,
5504,
3319,
1311,
29889,
2248,
267,
29961,
29900,
29962,
584,
313,
1311,
29889,
7076,
29961,
1311,
29889,
2248,
267,
29961,
29900,
29962,
3816,
29900,
1402,
29871,
29900,
26972,
13,
632,
13,
9651,
1583,
29889,
354,
481,
1598,
6767,
580,
13,
4706,
1683,
29901,
13,
9651,
1583,
29889,
2248,
267,
29889,
7323,
580,
13,
13,
4706,
1596,
29898,
4632,
2558,
29892,
3876,
1469,
29897,
13,
13,
1678,
822,
1596,
29898,
1311,
1125,
13,
4706,
3171,
353,
29871,
29900,
13,
4706,
2380,
353,
29871,
29900,
13,
4706,
714,
353,
6629,
13,
13,
4706,
474,
353,
29871,
29900,
13,
4706,
565,
7431,
29898,
1311,
29889,
2248,
267,
29897,
1275,
29871,
29900,
29901,
13,
9651,
714,
4619,
525,
3187,
29876,
29915,
13,
9651,
1596,
877,
29918,
1495,
13,
9651,
736,
13,
13,
4706,
1550,
474,
529,
7431,
29898,
1311,
29889,
2248,
267,
1125,
13,
9651,
1196,
21515,
353,
29871,
29896,
3532,
3171,
13,
9651,
2380,
4619,
29871,
29896,
13,
9651,
1820,
353,
1583,
29889,
2248,
267,
29961,
29875,
29962,
13,
9651,
714,
4619,
525,
1839,
718,
851,
29898,
1989,
29897,
718,
525,
525,
718,
1583,
29889,
7076,
29961,
1989,
3816,
29900,
29962,
13,
9651,
565,
3171,
2804,
29871,
29900,
29901,
13,
18884,
714,
4619,
525,
525,
718,
851,
29898,
1311,
29889,
2248,
267,
29961,
1311,
29889,
3560,
3220,
29898,
29875,
29897,
2314,
13,
13,
9651,
714,
4619,
525,
29962,
29915,
13,
13,
9651,
565,
2380,
1275,
1196,
21515,
29901,
13,
18884,
714,
4619,
11297,
29876,
29915,
13,
18884,
2380,
353,
29871,
29900,
13,
18884,
3171,
4619,
29871,
29896,
13,
9651,
1683,
29901,
13,
18884,
714,
4619,
525,
525,
13,
9651,
474,
4619,
29871,
29896,
13,
13,
4706,
565,
2380,
2804,
29871,
29900,
322,
2380,
529,
1196,
21515,
29901,
13,
9651,
714,
4619,
22868,
525,
334,
313,
1220,
21515,
448,
2380,
29897,
13,
9651,
1596,
29898,
449,
29961,
29900,
13018,
29896,
2314,
13,
4706,
1683,
29901,
13,
9651,
1596,
29898,
449,
29892,
1095,
2433,
1495,
13,
13,
13,
23090,
353,
5852,
13,
354,
481,
353,
940,
481,
580,
13,
13,
8000,
11412,
29901,
13,
1678,
1018,
29901,
13,
4706,
1196,
353,
1881,
580,
13,
4706,
9920,
353,
1196,
29889,
5451,
877,
13420,
29871,
29906,
29897,
13,
13,
4706,
1018,
29901,
13,
9651,
565,
7431,
29898,
9006,
29897,
1275,
29871,
29896,
322,
9920,
29961,
29900,
29962,
1275,
525,
2396,
13,
18884,
6773,
13,
13,
9651,
565,
7431,
29898,
9006,
29897,
1275,
29871,
29906,
322,
9920,
29961,
29900,
29962,
1275,
6629,
322,
9920,
29961,
29896,
29962,
1275,
525,
2396,
13,
18884,
6773,
13,
13,
9651,
565,
9920,
29961,
29900,
29962,
1275,
525,
1202,
2396,
13,
18884,
16947,
29889,
1202,
29898,
524,
29898,
9006,
29961,
29896,
11724,
9920,
29961,
29906,
2314,
13,
13,
9651,
25342,
9920,
29961,
29900,
29962,
1275,
525,
842,
2396,
13,
18884,
16947,
29889,
842,
29898,
524,
29898,
9006,
29961,
29896,
11724,
9920,
29961,
29906,
2314,
13,
13,
9651,
25342,
9920,
29961,
29900,
29962,
1275,
525,
8143,
2396,
13,
18884,
16947,
29889,
8143,
29898,
524,
29898,
9006,
29961,
29896,
12622,
13,
13,
9651,
25342,
9920,
29961,
29900,
29962,
1275,
525,
4478,
2396,
13,
18884,
16947,
29889,
4478,
29898,
524,
29898,
9006,
29961,
29896,
12622,
13,
13,
9651,
25342,
9920,
29961,
29900,
29962,
1275,
525,
1195,
2396,
13,
18884,
16947,
29889,
1195,
580,
13,
13,
9651,
25342,
9920,
29961,
29900,
29962,
1275,
525,
3317,
2396,
13,
18884,
16947,
29889,
3317,
580,
13,
13,
9651,
25342,
9920,
29961,
29900,
29962,
1275,
525,
21111,
2396,
13,
18884,
16947,
29889,
21111,
580,
13,
13,
9651,
25342,
9920,
29961,
29900,
29962,
1275,
525,
2158,
2396,
13,
18884,
16947,
29889,
2158,
580,
13,
13,
9651,
1683,
29901,
13,
18884,
12020,
29898,
2451,
29897,
13,
13,
4706,
5174,
8960,
29901,
13,
18884,
1596,
877,
2704,
1495,
13,
18884,
6773,
13,
13,
1678,
5174,
8960,
29901,
13,
4706,
11412,
353,
7700,
13,
2
] |
xbox/constants.py | tomwhross/wishlist | 0 | 180733 | <filename>xbox/constants.py<gh_stars>0
SEED_URLS = [
"https://www.microsoft.com/en-ca/p/immortals-fenyx-rising/c07kjzrh0l7s?activetab=pivot:overviewtab",
"https://www.microsoft.com/en-ca/p/grand-theft-auto-v-premium-edition/C496CLVXMJP8?wa=wsignin1.0&lc=4105&activetab=pivot:overviewtab",
"https://www.microsoft.com/en-ca/p/far-cry-5/br7x7mvbbqkm?activetab=pivot:overviewtab",
"https://www.microsoft.com/en-ca/p/pathfinder-kingmaker-definitive-edition/bphqqn22gb7l?activetab=pivot:overviewtab",
"https://www.microsoft.com/en-ca/p/call-of-duty-modern-warfare---digital-standard-edition/9NVQBQ3F6W9W?activetab=pivot:overviewtab",
"https://www.microsoft.com/en-ca/p/ori-and-the-will-of-the-wisps/9N8CD0XZKLP4?activetab=pivot:overviewtab",
"https://www.microsoft.com/EN-CA/p/red-dead-redemption-2/9N2ZDN7NWQKV?activetab=pivot:overviewtab",
"https://www.microsoft.com/en-ca/p/tom-clancys-rainbow-six-siege-deluxe-edition/9p30k2nxwh82?activetab=pivot:overviewtab",
"https://www.microsoft.com/en-ca/p/pillars-of-eternity-complete-edition/bs34vnw7h61f?activetab=pivot:overviewtab",
"https://www.microsoft.com/en-ca/p/pillars-of-eternity-ii-deadfire-ultimate-edition/9pjd2kmx7tz6?activetab=pivot:overviewtab",
"https://www.microsoft.com/en-ca/p/astroneer/9nblggh43kzb?cid=msft_web_chart&activetab=pivot:overviewtab",
"https://www.microsoft.com/en-ca/p/farm-together/9mxsdjxfzq25?cid=msft_web_chart&activetab=pivot:overviewtab",
"https://www.microsoft.com/en-ca/p/Mafia-III-Definitive-Edition/BVZLS7XZ68KF?rtc=1&activetab=pivot:overviewtab",
"https://www.microsoft.com/EN-CA/p/little-nightmares/BWD88K55MK5W?id=Pubsalegame_Week13&activetab=pivot:overviewtab",
"https://www.microsoft.com/en-ca/p/Nexomon-Extinction/9NCJR504WXT0?rtc=1&activetab=pivot:overviewtab",
"https://www.microsoft.com/en-ca/p/GreedFall/BWMH4RQ4Q06F?rtc=1&activetab=pivot:overviewtab",
"https://www.microsoft.com/en-ca/p/outriders-standard-edition/9p12rcxbf02p?activetab=pivot:overviewtab",
]
| [
1,
529,
9507,
29958,
29916,
1884,
29914,
3075,
1934,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29900,
13,
1660,
3352,
29918,
4219,
29903,
353,
518,
13,
1678,
376,
991,
597,
1636,
29889,
4994,
29889,
510,
29914,
264,
29899,
1113,
29914,
29886,
29914,
6727,
441,
1338,
29899,
11350,
29891,
29916,
29899,
3780,
292,
29914,
29883,
29900,
29955,
29895,
29926,
29920,
19046,
29900,
29880,
29955,
29879,
29973,
11236,
300,
370,
29922,
29886,
11002,
29901,
957,
1493,
3891,
613,
13,
1678,
376,
991,
597,
1636,
29889,
4994,
29889,
510,
29914,
264,
29899,
1113,
29914,
29886,
29914,
27857,
29899,
1552,
615,
29899,
6921,
29899,
29894,
29899,
1457,
29885,
1974,
29899,
287,
654,
29914,
29907,
29946,
29929,
29953,
6154,
29963,
29990,
29924,
29967,
29925,
29947,
29973,
2766,
29922,
29893,
4530,
262,
29896,
29889,
29900,
29987,
29880,
29883,
29922,
29946,
29896,
29900,
29945,
29987,
11236,
300,
370,
29922,
29886,
11002,
29901,
957,
1493,
3891,
613,
13,
1678,
376,
991,
597,
1636,
29889,
4994,
29889,
510,
29914,
264,
29899,
1113,
29914,
29886,
29914,
15641,
29899,
29883,
719,
29899,
29945,
29914,
1182,
29955,
29916,
29955,
29324,
1327,
29939,
8848,
29973,
11236,
300,
370,
29922,
29886,
11002,
29901,
957,
1493,
3891,
613,
13,
1678,
376,
991,
597,
1636,
29889,
4994,
29889,
510,
29914,
264,
29899,
1113,
29914,
29886,
29914,
2084,
2886,
261,
29899,
9292,
28107,
29899,
1753,
2344,
573,
29899,
287,
654,
29914,
29890,
561,
24349,
29876,
29906,
29906,
26300,
29955,
29880,
29973,
11236,
300,
370,
29922,
29886,
11002,
29901,
957,
1493,
3891,
613,
13,
1678,
376,
991,
597,
1636,
29889,
4994,
29889,
510,
29914,
264,
29899,
1113,
29914,
29886,
29914,
4804,
29899,
974,
29899,
29881,
329,
29891,
29899,
1545,
824,
29899,
4495,
24658,
5634,
7501,
2410,
29899,
15770,
29899,
287,
654,
29914,
29929,
29940,
29963,
29984,
29933,
29984,
29941,
29943,
29953,
29956,
29929,
29956,
29973,
11236,
300,
370,
29922,
29886,
11002,
29901,
957,
1493,
3891,
613,
13,
1678,
376,
991,
597,
1636,
29889,
4994,
29889,
510,
29914,
264,
29899,
1113,
29914,
29886,
29914,
4170,
29899,
392,
29899,
1552,
29899,
14043,
29899,
974,
29899,
1552,
29899,
29893,
275,
567,
29914,
29929,
29940,
29947,
6530,
29900,
29990,
29999,
29968,
13208,
29946,
29973,
11236,
300,
370,
29922,
29886,
11002,
29901,
957,
1493,
3891,
613,
13,
1678,
376,
991,
597,
1636,
29889,
4994,
29889,
510,
29914,
1430,
29899,
5454,
29914,
29886,
29914,
1127,
29899,
311,
328,
29899,
276,
2310,
683,
29899,
29906,
29914,
29929,
29940,
29906,
29999,
28307,
29955,
29940,
29956,
29984,
29968,
29963,
29973,
11236,
300,
370,
29922,
29886,
11002,
29901,
957,
1493,
3891,
613,
13,
1678,
376,
991,
597,
1636,
29889,
4994,
29889,
510,
29914,
264,
29899,
1113,
29914,
29886,
29914,
15135,
29899,
695,
4564,
952,
29899,
6038,
17729,
29899,
28319,
29899,
29879,
347,
479,
29899,
6144,
1314,
29872,
29899,
287,
654,
29914,
29929,
29886,
29941,
29900,
29895,
29906,
23818,
1332,
29947,
29906,
29973,
11236,
300,
370,
29922,
29886,
11002,
29901,
957,
1493,
3891,
613,
13,
1678,
376,
991,
597,
1636,
29889,
4994,
29889,
510,
29914,
264,
29899,
1113,
29914,
29886,
29914,
29886,
453,
1503,
29899,
974,
29899,
300,
824,
537,
29899,
8835,
29899,
287,
654,
29914,
5824,
29941,
29946,
18564,
29893,
29955,
29882,
29953,
29896,
29888,
29973,
11236,
300,
370,
29922,
29886,
11002,
29901,
957,
1493,
3891,
613,
13,
1678,
376,
991,
597,
1636,
29889,
4994,
29889,
510,
29914,
264,
29899,
1113,
29914,
29886,
29914,
29886,
453,
1503,
29899,
974,
29899,
300,
824,
537,
29899,
2236,
29899,
311,
328,
8696,
29899,
499,
6490,
29899,
287,
654,
29914,
29929,
29886,
26012,
29906,
8848,
29916,
29955,
17559,
29953,
29973,
11236,
300,
370,
29922,
29886,
11002,
29901,
957,
1493,
3891,
613,
13,
1678,
376,
991,
597,
1636,
29889,
4994,
29889,
510,
29914,
264,
29899,
1113,
29914,
29886,
29914,
7614,
650,
261,
29914,
29929,
29876,
2204,
1505,
29882,
29946,
29941,
29895,
29920,
29890,
29973,
25232,
29922,
1516,
615,
29918,
2676,
29918,
15425,
29987,
11236,
300,
370,
29922,
29886,
11002,
29901,
957,
1493,
3891,
613,
13,
1678,
376,
991,
597,
1636,
29889,
4994,
29889,
510,
29914,
264,
29899,
1113,
29914,
29886,
29914,
29888,
2817,
29899,
29873,
12966,
29914,
29929,
16838,
4928,
29926,
24660,
29920,
29939,
29906,
29945,
29973,
25232,
29922,
1516,
615,
29918,
2676,
29918,
15425,
29987,
11236,
300,
370,
29922,
29886,
11002,
29901,
957,
1493,
3891,
613,
13,
1678,
376,
991,
597,
1636,
29889,
4994,
29889,
510,
29914,
264,
29899,
1113,
29914,
29886,
29914,
29924,
2142,
423,
29899,
5287,
29899,
3206,
2344,
573,
29899,
3853,
654,
29914,
29933,
29963,
29999,
8547,
29955,
29990,
29999,
29953,
29947,
29968,
29943,
29973,
2273,
29883,
29922,
29896,
29987,
11236,
300,
370,
29922,
29886,
11002,
29901,
957,
1493,
3891,
613,
13,
1678,
376,
991,
597,
1636,
29889,
4994,
29889,
510,
29914,
1430,
29899,
5454,
29914,
29886,
29914,
29880,
1992,
29899,
11147,
3034,
267,
29914,
29933,
24668,
29947,
29947,
29968,
29945,
29945,
29924,
29968,
29945,
29956,
29973,
333,
29922,
21076,
29879,
744,
11802,
29918,
22606,
29896,
29941,
29987,
11236,
300,
370,
29922,
29886,
11002,
29901,
957,
1493,
3891,
613,
13,
1678,
376,
991,
597,
1636,
29889,
4994,
29889,
510,
29914,
264,
29899,
1113,
29914,
29886,
29914,
29940,
735,
18192,
29899,
5647,
16807,
29914,
29929,
15868,
29967,
29934,
29945,
29900,
29946,
29956,
12188,
29900,
29973,
2273,
29883,
29922,
29896,
29987,
11236,
300,
370,
29922,
29886,
11002,
29901,
957,
1493,
3891,
613,
13,
1678,
376,
991,
597,
1636,
29889,
4994,
29889,
510,
29914,
264,
29899,
1113,
29914,
29886,
29914,
25120,
287,
29943,
497,
29914,
29933,
26735,
29950,
29946,
29934,
29984,
29946,
29984,
29900,
29953,
29943,
29973,
2273,
29883,
29922,
29896,
29987,
11236,
300,
370,
29922,
29886,
11002,
29901,
957,
1493,
3891,
613,
13,
1678,
376,
991,
597,
1636,
29889,
4994,
29889,
510,
29914,
264,
29899,
1113,
29914,
29886,
29914,
449,
2429,
414,
29899,
15770,
29899,
287,
654,
29914,
29929,
29886,
29896,
29906,
2214,
29916,
1635,
29900,
29906,
29886,
29973,
11236,
300,
370,
29922,
29886,
11002,
29901,
957,
1493,
3891,
613,
13,
29962,
13,
2
] |
core/management/commands/init_envs.py | klebed/esdc-ce | 97 | 124107 | from ._base import DanubeCloudCommand, CommandError
class Command(DanubeCloudCommand):
help = 'Initialize the virtual environments.'
def handle(self, *args, **options):
raise CommandError('Use ctl.sh directly')
| [
1,
515,
869,
29918,
3188,
1053,
3951,
4003,
20442,
6255,
29892,
10516,
2392,
13,
13,
13,
1990,
10516,
29898,
18529,
4003,
20442,
6255,
1125,
13,
1678,
1371,
353,
525,
6644,
6646,
278,
6901,
23136,
6169,
13,
13,
1678,
822,
4386,
29898,
1311,
29892,
334,
5085,
29892,
3579,
6768,
1125,
13,
4706,
12020,
10516,
2392,
877,
11403,
274,
15206,
29889,
845,
4153,
1495,
13,
2
] |
app/profiles_api/urls.py | ijhajj/Django-basicRESTAPI | 0 | 168960 | from django.conf.urls import url
from django.conf.urls import include
from django.urls import path
from rest_framework.routers import DefaultRouter
from . import views
router = DefaultRouter()
router.register('hello-viewset', views.HelloViewSet, base_name='hello-viewset')
#In case of ModelSerializer, no need to pass the base_name
router.register('profile', views.UserProfileViewSet)
router.register('login', views.LoginViewSet, base_name='login')
urlpatterns = [
path('hello-view/',views.HelloApiView.as_view()),
path('', include(router.urls))
]
| [
1,
515,
9557,
29889,
5527,
29889,
26045,
1053,
3142,
13,
3166,
9557,
29889,
5527,
29889,
26045,
1053,
3160,
13,
3166,
9557,
29889,
26045,
1053,
2224,
13,
3166,
1791,
29918,
4468,
29889,
27537,
2153,
1053,
13109,
23971,
13,
3166,
869,
1053,
8386,
13,
13,
13,
15140,
353,
13109,
23971,
580,
13,
15140,
29889,
9573,
877,
12199,
29899,
1493,
842,
742,
8386,
29889,
10994,
1043,
2697,
29892,
2967,
29918,
978,
2433,
12199,
29899,
1493,
842,
1495,
13,
29937,
797,
1206,
310,
8125,
17679,
29892,
694,
817,
304,
1209,
278,
2967,
29918,
978,
13,
15140,
29889,
9573,
877,
10185,
742,
8386,
29889,
2659,
13909,
1043,
2697,
29897,
13,
15140,
29889,
9573,
877,
7507,
742,
8386,
29889,
11049,
1043,
2697,
29892,
2967,
29918,
978,
2433,
7507,
1495,
13,
13,
2271,
11037,
29879,
353,
518,
13,
1678,
2224,
877,
12199,
29899,
1493,
29914,
742,
7406,
29889,
10994,
11713,
1043,
29889,
294,
29918,
1493,
25739,
13,
1678,
2224,
877,
742,
3160,
29898,
15140,
29889,
26045,
876,
13,
29962,
13,
2
] |
raiden/tests/integration/test_blockchainservice.py | nicksavers/raiden | 2 | 79524 | # -*- coding: utf-8 -*-
from __future__ import division
import os
import pytest
from ethereum import _solidity
from ethereum._solidity import compile_file
from ethereum.utils import denoms
from pyethapp.rpc_client import JSONRPCClient
from pyethapp.jsonrpc import default_gasprice
from raiden.network.rpc.client import (
decode_topic, patch_send_transaction, patch_send_message
)
from raiden.utils import privatekey_to_address, get_contract_path
from raiden.blockchain.abi import CHANNEL_MANAGER_ABI
solidity = _solidity.get_solidity() # pylint: disable=invalid-name
@pytest.mark.timeout(180)
@pytest.mark.parametrize('privatekey_seed', ['blockchain:{}'])
@pytest.mark.parametrize('number_of_nodes', [3])
@pytest.mark.parametrize('channels_per_node', [0])
@pytest.mark.parametrize('number_of_assets', [0])
def test_new_netting_contract(raiden_network, asset_amount, settle_timeout):
# pylint: disable=line-too-long,too-many-statements,too-many-locals
app0, app1, app2 = raiden_network
peer0_address = app0.raiden.address
peer1_address = app1.raiden.address
peer2_address = app2.raiden.address
blockchain_service0 = app0.raiden.chain
asset_address = blockchain_service0.deploy_and_register_asset(
contract_name='HumanStandardToken',
contract_file='HumanStandardToken.sol',
constructor_parameters=(asset_amount, 'raiden', 2, 'Rd'),
)
asset0 = blockchain_service0.asset(asset_address)
for transfer_to in raiden_network[1:]:
asset0.transfer(
privatekey_to_address(transfer_to.raiden.privkey),
asset_amount // len(raiden_network),
)
manager0 = blockchain_service0.manager_by_asset(asset_address)
# sanity
assert manager0.channels_addresses() == []
assert manager0.channels_by_participant(peer0_address) == []
assert manager0.channels_by_participant(peer1_address) == []
assert manager0.channels_by_participant(peer2_address) == []
# create one channel
netting_address_01 = manager0.new_netting_channel(
peer0_address,
peer1_address,
settle_timeout,
)
# check contract state
netting_channel_01 = blockchain_service0.netting_channel(netting_address_01)
assert netting_channel_01.isopen() is False
assert netting_channel_01.partner(peer0_address) == peer1_address
assert netting_channel_01.partner(peer1_address) == peer0_address
# check channels
channel_list = manager0.channels_addresses()
assert sorted(channel_list[0]) == sorted([peer0_address, peer1_address])
assert manager0.channels_by_participant(peer0_address) == [netting_address_01]
assert manager0.channels_by_participant(peer1_address) == [netting_address_01]
assert manager0.channels_by_participant(peer2_address) == []
# create other chanel
netting_address_02 = manager0.new_netting_channel(
peer0_address,
peer2_address,
settle_timeout,
)
netting_channel_02 = blockchain_service0.netting_channel(netting_address_02)
assert netting_channel_02.isopen() is False
assert netting_channel_02.partner(peer0_address) == peer2_address
assert netting_channel_02.partner(peer2_address) == peer0_address
channel_list = manager0.channels_addresses()
expected_channels = [
sorted([peer0_address, peer1_address]),
sorted([peer0_address, peer2_address]),
]
for channel in channel_list:
assert sorted(channel) in expected_channels
result0 = sorted(manager0.channels_by_participant(peer0_address))
result1 = sorted([netting_address_01, netting_address_02])
assert result0 == result1
assert manager0.channels_by_participant(peer1_address) == [netting_address_01]
assert manager0.channels_by_participant(peer2_address) == [netting_address_02]
# deposit without approve should fail
netting_channel_01.deposit(peer0_address, 100)
assert netting_channel_01.isopen() is False
assert netting_channel_02.isopen() is False
assert netting_channel_01.detail(peer0_address)['our_balance'] == 0
assert netting_channel_01.detail(peer1_address)['our_balance'] == 0
# single-funded channel
app0.raiden.chain.asset(asset_address).approve(netting_address_01, 100)
netting_channel_01.deposit(peer0_address, 100)
assert netting_channel_01.isopen() is True
assert netting_channel_02.isopen() is False
assert netting_channel_01.detail(peer0_address)['our_balance'] == 100
assert netting_channel_01.detail(peer1_address)['our_balance'] == 0
# double-funded channel
app0.raiden.chain.asset(asset_address).approve(netting_address_02, 70)
netting_channel_02.deposit(peer0_address, 70)
assert netting_channel_01.isopen() is True
assert netting_channel_02.isopen() is True
assert netting_channel_02.detail(peer0_address)['our_balance'] == 70
assert netting_channel_02.detail(peer2_address)['our_balance'] == 0
app2.raiden.chain.asset(asset_address).approve(netting_address_02, 130)
app2.raiden.chain.netting_channel(netting_address_02).deposit(peer2_address, 130)
assert netting_channel_01.isopen() is True
assert netting_channel_02.isopen() is True
assert netting_channel_02.detail(peer0_address)['our_balance'] == 70
assert netting_channel_02.detail(peer2_address)['our_balance'] == 130
@pytest.mark.skipif(
'TRAVIS' in os.environ,
reason='Flaky test due to mark.timeout not being scheduled. Issue #319'
)
@pytest.mark.timeout(60)
@pytest.mark.parametrize('privatekey_seed', ['blockchain:{}'])
@pytest.mark.parametrize('number_of_nodes', [3])
def test_blockchain(
blockchain_type,
blockchain_backend, # required to start the geth backend
blockchain_rpc_ports,
private_keys,
poll_timeout):
# pylint: disable=too-many-locals
# this test is for interaction with a blockchain using json-rpc, so it
# doesnt make sense to execute it against mock or tester
if blockchain_type not in ('geth',):
return
addresses = [
privatekey_to_address(priv)
for priv in private_keys
]
privatekey = private_keys[0]
address = privatekey_to_address(privatekey)
total_asset = 100
jsonrpc_client = JSONRPCClient(
port=blockchain_rpc_ports[0],
privkey=privatekey,
print_communication=False,
)
patch_send_transaction(jsonrpc_client)
patch_send_message(jsonrpc_client)
humantoken_path = get_contract_path('HumanStandardToken.sol')
humantoken_contracts = compile_file(humantoken_path, libraries=dict())
token_proxy = jsonrpc_client.deploy_solidity_contract(
address,
'HumanStandardToken',
humantoken_contracts,
dict(),
(total_asset, 'raiden', 2, 'Rd'),
contract_path=humantoken_path,
gasprice=default_gasprice,
timeout=poll_timeout,
)
registry_path = get_contract_path('Registry.sol')
registry_contracts = compile_file(registry_path)
registry_proxy = jsonrpc_client.deploy_solidity_contract(
address,
'Registry',
registry_contracts,
dict(),
tuple(),
contract_path=registry_path,
gasprice=default_gasprice,
timeout=poll_timeout,
)
log_list = jsonrpc_client.call(
'eth_getLogs',
{
'fromBlock': '0x0',
'toBlock': 'latest',
'topics': [],
},
)
assert len(log_list) == 0
# pylint: disable=no-member
assert token_proxy.balanceOf(address) == total_asset
transaction_hash = registry_proxy.addAsset.transact(
token_proxy.address,
gasprice=denoms.wei,
)
jsonrpc_client.poll(transaction_hash.decode('hex'), timeout=poll_timeout)
assert len(registry_proxy.assetAddresses.call()) == 1
log_list = jsonrpc_client.call(
'eth_getLogs',
{
'fromBlock': '0x0',
'toBlock': 'latest',
'topics': [],
},
)
assert len(log_list) == 1
channel_manager_address_encoded = registry_proxy.channelManagerByAsset.call(
token_proxy.address,
)
channel_manager_address = channel_manager_address_encoded.decode('hex')
log = log_list[0]
log_topics = [
decode_topic(topic)
for topic in log['topics'] # pylint: disable=invalid-sequence-index
]
log_data = log['data']
event = registry_proxy.translator.decode_event(
log_topics,
log_data[2:].decode('hex'),
)
assert channel_manager_address == event['channel_manager_address'].decode('hex')
assert token_proxy.address == event['asset_address'].decode('hex')
channel_manager_proxy = jsonrpc_client.new_contract_proxy(
CHANNEL_MANAGER_ABI,
channel_manager_address,
)
transaction_hash = channel_manager_proxy.newChannel.transact(
addresses[1],
10,
gasprice=denoms.wei,
)
jsonrpc_client.poll(transaction_hash.decode('hex'), timeout=poll_timeout)
log_list = jsonrpc_client.call(
'eth_getLogs',
{
'fromBlock': '0x0',
'toBlock': 'latest',
'topics': [],
},
)
assert len(log_list) == 2
| [
1,
396,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8542,
13,
13,
5215,
2897,
13,
13,
5215,
11451,
1688,
13,
3166,
11314,
406,
398,
1053,
903,
2929,
333,
537,
13,
3166,
11314,
406,
398,
3032,
2929,
333,
537,
1053,
6633,
29918,
1445,
13,
3166,
11314,
406,
398,
29889,
13239,
1053,
972,
4835,
13,
3166,
11451,
621,
932,
29889,
29878,
6739,
29918,
4645,
1053,
4663,
29934,
9026,
4032,
13,
3166,
11451,
621,
932,
29889,
3126,
29878,
6739,
1053,
2322,
29918,
25496,
9175,
13,
13,
3166,
1153,
3615,
29889,
11618,
29889,
29878,
6739,
29889,
4645,
1053,
313,
13,
1678,
21822,
29918,
13010,
29892,
13261,
29918,
6717,
29918,
20736,
29892,
13261,
29918,
6717,
29918,
4906,
13,
29897,
13,
3166,
1153,
3615,
29889,
13239,
1053,
2024,
1989,
29918,
517,
29918,
7328,
29892,
679,
29918,
1285,
1461,
29918,
2084,
13,
3166,
1153,
3615,
29889,
1271,
14153,
29889,
19266,
1053,
5868,
2190,
29940,
6670,
29918,
1529,
3521,
17070,
29918,
2882,
29902,
13,
13,
2929,
333,
537,
353,
903,
2929,
333,
537,
29889,
657,
29918,
2929,
333,
537,
580,
259,
396,
282,
2904,
524,
29901,
11262,
29922,
20965,
29899,
978,
13,
13,
13,
29992,
2272,
1688,
29889,
3502,
29889,
15619,
29898,
29896,
29947,
29900,
29897,
13,
29992,
2272,
1688,
29889,
3502,
29889,
3207,
300,
374,
911,
877,
9053,
1989,
29918,
26776,
742,
6024,
1271,
14153,
29901,
8875,
11287,
13,
29992,
2272,
1688,
29889,
3502,
29889,
3207,
300,
374,
911,
877,
4537,
29918,
974,
29918,
18010,
742,
518,
29941,
2314,
13,
29992,
2272,
1688,
29889,
3502,
29889,
3207,
300,
374,
911,
877,
305,
12629,
29918,
546,
29918,
3177,
742,
518,
29900,
2314,
13,
29992,
2272,
1688,
29889,
3502,
29889,
3207,
300,
374,
911,
877,
4537,
29918,
974,
29918,
16596,
742,
518,
29900,
2314,
13,
1753,
1243,
29918,
1482,
29918,
1212,
1259,
29918,
1285,
1461,
29898,
336,
3615,
29918,
11618,
29892,
24342,
29918,
14506,
29892,
3604,
280,
29918,
15619,
1125,
13,
1678,
396,
282,
2904,
524,
29901,
11262,
29922,
1220,
29899,
517,
29877,
29899,
5426,
29892,
517,
29877,
29899,
13011,
29899,
6112,
4110,
29892,
517,
29877,
29899,
13011,
29899,
2997,
29879,
13,
13,
1678,
623,
29900,
29892,
623,
29896,
29892,
623,
29906,
353,
1153,
3615,
29918,
11618,
13,
1678,
23533,
29900,
29918,
7328,
353,
623,
29900,
29889,
336,
3615,
29889,
7328,
13,
1678,
23533,
29896,
29918,
7328,
353,
623,
29896,
29889,
336,
3615,
29889,
7328,
13,
1678,
23533,
29906,
29918,
7328,
353,
623,
29906,
29889,
336,
3615,
29889,
7328,
13,
13,
1678,
2908,
14153,
29918,
5509,
29900,
353,
623,
29900,
29889,
336,
3615,
29889,
14153,
13,
13,
1678,
24342,
29918,
7328,
353,
2908,
14153,
29918,
5509,
29900,
29889,
16519,
29918,
392,
29918,
9573,
29918,
24129,
29898,
13,
4706,
8078,
29918,
978,
2433,
29950,
7889,
15449,
6066,
742,
13,
4706,
8078,
29918,
1445,
2433,
29950,
7889,
15449,
6066,
29889,
2929,
742,
13,
4706,
5823,
29918,
16744,
7607,
24129,
29918,
14506,
29892,
525,
336,
3615,
742,
29871,
29906,
29892,
525,
29934,
29881,
5477,
13,
1678,
1723,
13,
13,
1678,
24342,
29900,
353,
2908,
14153,
29918,
5509,
29900,
29889,
24129,
29898,
24129,
29918,
7328,
29897,
13,
1678,
363,
6782,
29918,
517,
297,
1153,
3615,
29918,
11618,
29961,
29896,
29901,
5387,
13,
4706,
24342,
29900,
29889,
3286,
571,
29898,
13,
9651,
2024,
1989,
29918,
517,
29918,
7328,
29898,
3286,
571,
29918,
517,
29889,
336,
3615,
29889,
22534,
1989,
511,
13,
9651,
24342,
29918,
14506,
849,
7431,
29898,
336,
3615,
29918,
11618,
511,
13,
4706,
1723,
13,
13,
1678,
8455,
29900,
353,
2908,
14153,
29918,
5509,
29900,
29889,
12847,
29918,
1609,
29918,
24129,
29898,
24129,
29918,
7328,
29897,
13,
13,
1678,
396,
9753,
537,
13,
1678,
4974,
8455,
29900,
29889,
305,
12629,
29918,
7328,
267,
580,
1275,
5159,
13,
1678,
4974,
8455,
29900,
29889,
305,
12629,
29918,
1609,
29918,
1595,
12654,
424,
29898,
412,
261,
29900,
29918,
7328,
29897,
1275,
5159,
13,
1678,
4974,
8455,
29900,
29889,
305,
12629,
29918,
1609,
29918,
1595,
12654,
424,
29898,
412,
261,
29896,
29918,
7328,
29897,
1275,
5159,
13,
1678,
4974,
8455,
29900,
29889,
305,
12629,
29918,
1609,
29918,
1595,
12654,
424,
29898,
412,
261,
29906,
29918,
7328,
29897,
1275,
5159,
13,
13,
1678,
396,
1653,
697,
8242,
13,
1678,
7787,
1259,
29918,
7328,
29918,
29900,
29896,
353,
8455,
29900,
29889,
1482,
29918,
1212,
1259,
29918,
12719,
29898,
13,
4706,
23533,
29900,
29918,
7328,
29892,
13,
4706,
23533,
29896,
29918,
7328,
29892,
13,
4706,
3604,
280,
29918,
15619,
29892,
13,
1678,
1723,
13,
13,
1678,
396,
1423,
8078,
2106,
13,
1678,
7787,
1259,
29918,
12719,
29918,
29900,
29896,
353,
2908,
14153,
29918,
5509,
29900,
29889,
1212,
1259,
29918,
12719,
29898,
1212,
1259,
29918,
7328,
29918,
29900,
29896,
29897,
13,
1678,
4974,
7787,
1259,
29918,
12719,
29918,
29900,
29896,
29889,
275,
3150,
580,
338,
7700,
13,
1678,
4974,
7787,
1259,
29918,
12719,
29918,
29900,
29896,
29889,
1595,
1089,
29898,
412,
261,
29900,
29918,
7328,
29897,
1275,
23533,
29896,
29918,
7328,
13,
1678,
4974,
7787,
1259,
29918,
12719,
29918,
29900,
29896,
29889,
1595,
1089,
29898,
412,
261,
29896,
29918,
7328,
29897,
1275,
23533,
29900,
29918,
7328,
13,
13,
1678,
396,
1423,
18196,
13,
1678,
8242,
29918,
1761,
353,
8455,
29900,
29889,
305,
12629,
29918,
7328,
267,
580,
13,
1678,
4974,
12705,
29898,
12719,
29918,
1761,
29961,
29900,
2314,
1275,
12705,
4197,
412,
261,
29900,
29918,
7328,
29892,
23533,
29896,
29918,
7328,
2314,
13,
13,
1678,
4974,
8455,
29900,
29889,
305,
12629,
29918,
1609,
29918,
1595,
12654,
424,
29898,
412,
261,
29900,
29918,
7328,
29897,
1275,
518,
1212,
1259,
29918,
7328,
29918,
29900,
29896,
29962,
13,
1678,
4974,
8455,
29900,
29889,
305,
12629,
29918,
1609,
29918,
1595,
12654,
424,
29898,
412,
261,
29896,
29918,
7328,
29897,
1275,
518,
1212,
1259,
29918,
7328,
29918,
29900,
29896,
29962,
13,
1678,
4974,
8455,
29900,
29889,
305,
12629,
29918,
1609,
29918,
1595,
12654,
424,
29898,
412,
261,
29906,
29918,
7328,
29897,
1275,
5159,
13,
13,
1678,
396,
1653,
916,
521,
3870,
13,
1678,
7787,
1259,
29918,
7328,
29918,
29900,
29906,
353,
8455,
29900,
29889,
1482,
29918,
1212,
1259,
29918,
12719,
29898,
13,
4706,
23533,
29900,
29918,
7328,
29892,
13,
4706,
23533,
29906,
29918,
7328,
29892,
13,
4706,
3604,
280,
29918,
15619,
29892,
13,
1678,
1723,
13,
13,
1678,
7787,
1259,
29918,
12719,
29918,
29900,
29906,
353,
2908,
14153,
29918,
5509,
29900,
29889,
1212,
1259,
29918,
12719,
29898,
1212,
1259,
29918,
7328,
29918,
29900,
29906,
29897,
13,
13,
1678,
4974,
7787,
1259,
29918,
12719,
29918,
29900,
29906,
29889,
275,
3150,
580,
338,
7700,
13,
1678,
4974,
7787,
1259,
29918,
12719,
29918,
29900,
29906,
29889,
1595,
1089,
29898,
412,
261,
29900,
29918,
7328,
29897,
1275,
23533,
29906,
29918,
7328,
13,
1678,
4974,
7787,
1259,
29918,
12719,
29918,
29900,
29906,
29889,
1595,
1089,
29898,
412,
261,
29906,
29918,
7328,
29897,
1275,
23533,
29900,
29918,
7328,
13,
13,
1678,
8242,
29918,
1761,
353,
8455,
29900,
29889,
305,
12629,
29918,
7328,
267,
580,
13,
1678,
3806,
29918,
305,
12629,
353,
518,
13,
4706,
12705,
4197,
412,
261,
29900,
29918,
7328,
29892,
23533,
29896,
29918,
7328,
11724,
13,
4706,
12705,
4197,
412,
261,
29900,
29918,
7328,
29892,
23533,
29906,
29918,
7328,
11724,
13,
1678,
4514,
13,
13,
1678,
363,
8242,
297,
8242,
29918,
1761,
29901,
13,
4706,
4974,
12705,
29898,
12719,
29897,
297,
3806,
29918,
305,
12629,
13,
13,
1678,
1121,
29900,
353,
12705,
29898,
12847,
29900,
29889,
305,
12629,
29918,
1609,
29918,
1595,
12654,
424,
29898,
412,
261,
29900,
29918,
7328,
876,
13,
1678,
1121,
29896,
353,
12705,
4197,
1212,
1259,
29918,
7328,
29918,
29900,
29896,
29892,
7787,
1259,
29918,
7328,
29918,
29900,
29906,
2314,
13,
1678,
4974,
1121,
29900,
1275,
1121,
29896,
13,
1678,
4974,
8455,
29900,
29889,
305,
12629,
29918,
1609,
29918,
1595,
12654,
424,
29898,
412,
261,
29896,
29918,
7328,
29897,
1275,
518,
1212,
1259,
29918,
7328,
29918,
29900,
29896,
29962,
13,
1678,
4974,
8455,
29900,
29889,
305,
12629,
29918,
1609,
29918,
1595,
12654,
424,
29898,
412,
261,
29906,
29918,
7328,
29897,
1275,
518,
1212,
1259,
29918,
7328,
29918,
29900,
29906,
29962,
13,
13,
1678,
396,
19754,
277,
1728,
2134,
345,
881,
4418,
13,
1678,
7787,
1259,
29918,
12719,
29918,
29900,
29896,
29889,
311,
1066,
277,
29898,
412,
261,
29900,
29918,
7328,
29892,
29871,
29896,
29900,
29900,
29897,
13,
1678,
4974,
7787,
1259,
29918,
12719,
29918,
29900,
29896,
29889,
275,
3150,
580,
338,
7700,
13,
1678,
4974,
7787,
1259,
29918,
12719,
29918,
29900,
29906,
29889,
275,
3150,
580,
338,
7700,
13,
1678,
4974,
7787,
1259,
29918,
12719,
29918,
29900,
29896,
29889,
16432,
29898,
412,
261,
29900,
29918,
7328,
29897,
1839,
473,
29918,
5521,
749,
2033,
1275,
29871,
29900,
13,
1678,
4974,
7787,
1259,
29918,
12719,
29918,
29900,
29896,
29889,
16432,
29898,
412,
261,
29896,
29918,
7328,
29897,
1839,
473,
29918,
5521,
749,
2033,
1275,
29871,
29900,
13,
13,
1678,
396,
2323,
29899,
27159,
287,
8242,
13,
1678,
623,
29900,
29889,
336,
3615,
29889,
14153,
29889,
24129,
29898,
24129,
29918,
7328,
467,
9961,
345,
29898,
1212,
1259,
29918,
7328,
29918,
29900,
29896,
29892,
29871,
29896,
29900,
29900,
29897,
13,
1678,
7787,
1259,
29918,
12719,
29918,
29900,
29896,
29889,
311,
1066,
277,
29898,
412,
261,
29900,
29918,
7328,
29892,
29871,
29896,
29900,
29900,
29897,
13,
1678,
4974,
7787,
1259,
29918,
12719,
29918,
29900,
29896,
29889,
275,
3150,
580,
338,
5852,
13,
1678,
4974,
7787,
1259,
29918,
12719,
29918,
29900,
29906,
29889,
275,
3150,
580,
338,
7700,
13,
13,
1678,
4974,
7787,
1259,
29918,
12719,
29918,
29900,
29896,
29889,
16432,
29898,
412,
261,
29900,
29918,
7328,
29897,
1839,
473,
29918,
5521,
749,
2033,
1275,
29871,
29896,
29900,
29900,
13,
1678,
4974,
7787,
1259,
29918,
12719,
29918,
29900,
29896,
29889,
16432,
29898,
412,
261,
29896,
29918,
7328,
29897,
1839,
473,
29918,
5521,
749,
2033,
1275,
29871,
29900,
13,
13,
1678,
396,
3765,
29899,
27159,
287,
8242,
13,
1678,
623,
29900,
29889,
336,
3615,
29889,
14153,
29889,
24129,
29898,
24129,
29918,
7328,
467,
9961,
345,
29898,
1212,
1259,
29918,
7328,
29918,
29900,
29906,
29892,
29871,
29955,
29900,
29897,
13,
1678,
7787,
1259,
29918,
12719,
29918,
29900,
29906,
29889,
311,
1066,
277,
29898,
412,
261,
29900,
29918,
7328,
29892,
29871,
29955,
29900,
29897,
13,
1678,
4974,
7787,
1259,
29918,
12719,
29918,
29900,
29896,
29889,
275,
3150,
580,
338,
5852,
13,
1678,
4974,
7787,
1259,
29918,
12719,
29918,
29900,
29906,
29889,
275,
3150,
580,
338,
5852,
13,
13,
1678,
4974,
7787,
1259,
29918,
12719,
29918,
29900,
29906,
29889,
16432,
29898,
412,
261,
29900,
29918,
7328,
29897,
1839,
473,
29918,
5521,
749,
2033,
1275,
29871,
29955,
29900,
13,
1678,
4974,
7787,
1259,
29918,
12719,
29918,
29900,
29906,
29889,
16432,
29898,
412,
261,
29906,
29918,
7328,
29897,
1839,
473,
29918,
5521,
749,
2033,
1275,
29871,
29900,
13,
13,
1678,
623,
29906,
29889,
336,
3615,
29889,
14153,
29889,
24129,
29898,
24129,
29918,
7328,
467,
9961,
345,
29898,
1212,
1259,
29918,
7328,
29918,
29900,
29906,
29892,
29871,
29896,
29941,
29900,
29897,
13,
1678,
623,
29906,
29889,
336,
3615,
29889,
14153,
29889,
1212,
1259,
29918,
12719,
29898,
1212,
1259,
29918,
7328,
29918,
29900,
29906,
467,
311,
1066,
277,
29898,
412,
261,
29906,
29918,
7328,
29892,
29871,
29896,
29941,
29900,
29897,
13,
1678,
4974,
7787,
1259,
29918,
12719,
29918,
29900,
29896,
29889,
275,
3150,
580,
338,
5852,
13,
1678,
4974,
7787,
1259,
29918,
12719,
29918,
29900,
29906,
29889,
275,
3150,
580,
338,
5852,
13,
13,
1678,
4974,
7787,
1259,
29918,
12719,
29918,
29900,
29906,
29889,
16432,
29898,
412,
261,
29900,
29918,
7328,
29897,
1839,
473,
29918,
5521,
749,
2033,
1275,
29871,
29955,
29900,
13,
1678,
4974,
7787,
1259,
29918,
12719,
29918,
29900,
29906,
29889,
16432,
29898,
412,
261,
29906,
29918,
7328,
29897,
1839,
473,
29918,
5521,
749,
2033,
1275,
29871,
29896,
29941,
29900,
13,
13,
13,
29992,
2272,
1688,
29889,
3502,
29889,
11014,
361,
29898,
13,
1678,
525,
29911,
4717,
28607,
29915,
297,
2897,
29889,
21813,
29892,
13,
1678,
2769,
2433,
29943,
433,
3459,
1243,
2861,
304,
2791,
29889,
15619,
451,
1641,
21467,
29889,
26246,
396,
29941,
29896,
29929,
29915,
13,
29897,
13,
29992,
2272,
1688,
29889,
3502,
29889,
15619,
29898,
29953,
29900,
29897,
13,
29992,
2272,
1688,
29889,
3502,
29889,
3207,
300,
374,
911,
877,
9053,
1989,
29918,
26776,
742,
6024,
1271,
14153,
29901,
8875,
11287,
13,
29992,
2272,
1688,
29889,
3502,
29889,
3207,
300,
374,
911,
877,
4537,
29918,
974,
29918,
18010,
742,
518,
29941,
2314,
13,
1753,
1243,
29918,
1271,
14153,
29898,
13,
4706,
2908,
14153,
29918,
1853,
29892,
13,
4706,
2908,
14153,
29918,
27852,
29892,
29871,
396,
3734,
304,
1369,
278,
330,
621,
14998,
13,
4706,
2908,
14153,
29918,
29878,
6739,
29918,
4011,
29892,
13,
4706,
2024,
29918,
8149,
29892,
13,
4706,
21180,
29918,
15619,
1125,
13,
1678,
396,
282,
2904,
524,
29901,
11262,
29922,
517,
29877,
29899,
13011,
29899,
2997,
29879,
13,
13,
1678,
396,
445,
1243,
338,
363,
14881,
411,
263,
2908,
14153,
773,
4390,
29899,
29878,
6739,
29892,
577,
372,
13,
1678,
396,
19403,
1207,
4060,
304,
6222,
372,
2750,
11187,
470,
1243,
261,
13,
1678,
565,
2908,
14153,
29918,
1853,
451,
297,
6702,
29887,
621,
742,
1125,
13,
4706,
736,
13,
13,
1678,
14157,
353,
518,
13,
4706,
2024,
1989,
29918,
517,
29918,
7328,
29898,
22534,
29897,
13,
4706,
363,
5999,
297,
2024,
29918,
8149,
13,
1678,
4514,
13,
13,
1678,
2024,
1989,
353,
2024,
29918,
8149,
29961,
29900,
29962,
13,
1678,
3211,
353,
2024,
1989,
29918,
517,
29918,
7328,
29898,
9053,
1989,
29897,
13,
1678,
3001,
29918,
24129,
353,
29871,
29896,
29900,
29900,
13,
13,
1678,
4390,
29878,
6739,
29918,
4645,
353,
4663,
29934,
9026,
4032,
29898,
13,
4706,
2011,
29922,
1271,
14153,
29918,
29878,
6739,
29918,
4011,
29961,
29900,
1402,
13,
4706,
5999,
1989,
29922,
9053,
1989,
29892,
13,
4706,
1596,
29918,
27820,
362,
29922,
8824,
29892,
13,
1678,
1723,
13,
1678,
13261,
29918,
6717,
29918,
20736,
29898,
3126,
29878,
6739,
29918,
4645,
29897,
13,
1678,
13261,
29918,
6717,
29918,
4906,
29898,
3126,
29878,
6739,
29918,
4645,
29897,
13,
13,
1678,
3165,
424,
4476,
29918,
2084,
353,
679,
29918,
1285,
1461,
29918,
2084,
877,
29950,
7889,
15449,
6066,
29889,
2929,
1495,
13,
1678,
3165,
424,
4476,
29918,
1285,
1461,
29879,
353,
6633,
29918,
1445,
29898,
16063,
424,
4476,
29918,
2084,
29892,
9562,
29922,
8977,
3101,
13,
1678,
5993,
29918,
14701,
353,
4390,
29878,
6739,
29918,
4645,
29889,
16519,
29918,
2929,
333,
537,
29918,
1285,
1461,
29898,
13,
4706,
3211,
29892,
13,
4706,
525,
29950,
7889,
15449,
6066,
742,
13,
4706,
3165,
424,
4476,
29918,
1285,
1461,
29879,
29892,
13,
4706,
9657,
3285,
13,
4706,
313,
7827,
29918,
24129,
29892,
525,
336,
3615,
742,
29871,
29906,
29892,
525,
29934,
29881,
5477,
13,
4706,
8078,
29918,
2084,
29922,
16063,
424,
4476,
29918,
2084,
29892,
13,
4706,
10489,
9175,
29922,
4381,
29918,
25496,
9175,
29892,
13,
4706,
11815,
29922,
29886,
3028,
29918,
15619,
29892,
13,
1678,
1723,
13,
13,
1678,
21235,
29918,
2084,
353,
679,
29918,
1285,
1461,
29918,
2084,
877,
22579,
29889,
2929,
1495,
13,
1678,
21235,
29918,
1285,
1461,
29879,
353,
6633,
29918,
1445,
29898,
1727,
6020,
29918,
2084,
29897,
13,
1678,
21235,
29918,
14701,
353,
4390,
29878,
6739,
29918,
4645,
29889,
16519,
29918,
2929,
333,
537,
29918,
1285,
1461,
29898,
13,
4706,
3211,
29892,
13,
4706,
525,
22579,
742,
13,
4706,
21235,
29918,
1285,
1461,
29879,
29892,
13,
4706,
9657,
3285,
13,
4706,
18761,
3285,
13,
4706,
8078,
29918,
2084,
29922,
1727,
6020,
29918,
2084,
29892,
13,
4706,
10489,
9175,
29922,
4381,
29918,
25496,
9175,
29892,
13,
4706,
11815,
29922,
29886,
3028,
29918,
15619,
29892,
13,
1678,
1723,
13,
13,
1678,
1480,
29918,
1761,
353,
4390,
29878,
6739,
29918,
4645,
29889,
4804,
29898,
13,
4706,
525,
621,
29918,
657,
3403,
29879,
742,
13,
4706,
426,
13,
9651,
525,
3166,
7445,
2396,
525,
29900,
29916,
29900,
742,
13,
9651,
525,
517,
7445,
2396,
525,
12333,
742,
13,
9651,
525,
3332,
1199,
2396,
19997,
13,
4706,
2981,
13,
1678,
1723,
13,
1678,
4974,
7431,
29898,
1188,
29918,
1761,
29897,
1275,
29871,
29900,
13,
13,
1678,
396,
282,
2904,
524,
29901,
11262,
29922,
1217,
29899,
14242,
13,
13,
1678,
4974,
5993,
29918,
14701,
29889,
5521,
749,
2776,
29898,
7328,
29897,
1275,
3001,
29918,
24129,
13,
1678,
10804,
29918,
8568,
353,
21235,
29918,
14701,
29889,
1202,
26405,
29889,
3286,
627,
29898,
13,
4706,
5993,
29918,
14701,
29889,
7328,
29892,
13,
4706,
10489,
9175,
29922,
1145,
4835,
29889,
26599,
29892,
13,
1678,
1723,
13,
1678,
4390,
29878,
6739,
29918,
4645,
29889,
29886,
3028,
29898,
20736,
29918,
8568,
29889,
13808,
877,
20970,
5477,
11815,
29922,
29886,
3028,
29918,
15619,
29897,
13,
13,
1678,
4974,
7431,
29898,
1727,
6020,
29918,
14701,
29889,
24129,
7061,
267,
29889,
4804,
3101,
1275,
29871,
29896,
13,
13,
1678,
1480,
29918,
1761,
353,
4390,
29878,
6739,
29918,
4645,
29889,
4804,
29898,
13,
4706,
525,
621,
29918,
657,
3403,
29879,
742,
13,
4706,
426,
13,
9651,
525,
3166,
7445,
2396,
525,
29900,
29916,
29900,
742,
13,
9651,
525,
517,
7445,
2396,
525,
12333,
742,
13,
9651,
525,
3332,
1199,
2396,
19997,
13,
4706,
2981,
13,
1678,
1723,
13,
1678,
4974,
7431,
29898,
1188,
29918,
1761,
29897,
1275,
29871,
29896,
13,
13,
1678,
8242,
29918,
12847,
29918,
7328,
29918,
26716,
353,
21235,
29918,
14701,
29889,
12719,
3260,
2059,
26405,
29889,
4804,
29898,
13,
4706,
5993,
29918,
14701,
29889,
7328,
29892,
13,
1678,
1723,
13,
1678,
8242,
29918,
12847,
29918,
7328,
353,
8242,
29918,
12847,
29918,
7328,
29918,
26716,
29889,
13808,
877,
20970,
1495,
13,
13,
1678,
1480,
353,
1480,
29918,
1761,
29961,
29900,
29962,
13,
1678,
1480,
29918,
3332,
1199,
353,
518,
13,
4706,
21822,
29918,
13010,
29898,
13010,
29897,
13,
4706,
363,
11261,
297,
1480,
1839,
3332,
1199,
2033,
29871,
396,
282,
2904,
524,
29901,
11262,
29922,
20965,
29899,
16506,
29899,
2248,
13,
1678,
4514,
13,
1678,
1480,
29918,
1272,
353,
1480,
1839,
1272,
2033,
13,
1678,
1741,
353,
21235,
29918,
14701,
29889,
3286,
29880,
1061,
29889,
13808,
29918,
3696,
29898,
13,
4706,
1480,
29918,
3332,
1199,
29892,
13,
4706,
1480,
29918,
1272,
29961,
29906,
29901,
1822,
13808,
877,
20970,
5477,
13,
1678,
1723,
13,
13,
1678,
4974,
8242,
29918,
12847,
29918,
7328,
1275,
1741,
1839,
12719,
29918,
12847,
29918,
7328,
13359,
13808,
877,
20970,
1495,
13,
1678,
4974,
5993,
29918,
14701,
29889,
7328,
1275,
1741,
1839,
24129,
29918,
7328,
13359,
13808,
877,
20970,
1495,
13,
13,
1678,
8242,
29918,
12847,
29918,
14701,
353,
4390,
29878,
6739,
29918,
4645,
29889,
1482,
29918,
1285,
1461,
29918,
14701,
29898,
13,
4706,
5868,
2190,
29940,
6670,
29918,
1529,
3521,
17070,
29918,
2882,
29902,
29892,
13,
4706,
8242,
29918,
12847,
29918,
7328,
29892,
13,
1678,
1723,
13,
13,
1678,
10804,
29918,
8568,
353,
8242,
29918,
12847,
29918,
14701,
29889,
1482,
13599,
29889,
3286,
627,
29898,
13,
4706,
14157,
29961,
29896,
1402,
13,
308,
29896,
29900,
29892,
13,
4706,
10489,
9175,
29922,
1145,
4835,
29889,
26599,
29892,
13,
1678,
1723,
13,
1678,
4390,
29878,
6739,
29918,
4645,
29889,
29886,
3028,
29898,
20736,
29918,
8568,
29889,
13808,
877,
20970,
5477,
11815,
29922,
29886,
3028,
29918,
15619,
29897,
13,
13,
1678,
1480,
29918,
1761,
353,
4390,
29878,
6739,
29918,
4645,
29889,
4804,
29898,
13,
4706,
525,
621,
29918,
657,
3403,
29879,
742,
13,
4706,
426,
13,
9651,
525,
3166,
7445,
2396,
525,
29900,
29916,
29900,
742,
13,
9651,
525,
517,
7445,
2396,
525,
12333,
742,
13,
9651,
525,
3332,
1199,
2396,
19997,
13,
4706,
2981,
13,
1678,
1723,
13,
1678,
4974,
7431,
29898,
1188,
29918,
1761,
29897,
1275,
29871,
29906,
13,
2
] |
Translator.py | aj-naik/City-Sentiment-Detector-BERT | 2 | 197723 | import requests
class Translator:
def __init__(self, api_key: str):
self.api_key = api_key
class GoogleTranslate(Translator):
api_endpoint = 'https://translation.googleapis.com/language/translate/v2'
def __init__(self, api_key: str):
Translator.__init__(self, api_key=api_key)
def detect_language(self, input_text) -> str:
request = requests.post(f'{self.api_endpoint}/detect', data={'q': input_text, 'key': self.api_key})
data = request.json()
language = data.get('data').get('detections')[0][0].get('language')
return language
def translate(self, input_text: str, target_lang: str, source_lang: str = "") -> str:
request = requests.post(f'{self.api_endpoint}',
data={'q': input_text, 'source': source_lang,
'target': target_lang, 'format': 'text',
'key': self.api_key})
data = request.json()
translations = data.get('data').get('translations')
text = translations[0].get('translatedText')
return text
| [
1,
1053,
7274,
13,
13,
1990,
4103,
29880,
1061,
29901,
13,
268,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
7882,
29918,
1989,
29901,
851,
1125,
13,
4706,
1583,
29889,
2754,
29918,
1989,
353,
7882,
29918,
1989,
13,
13,
1990,
5087,
4300,
9632,
29898,
4300,
29880,
1061,
1125,
13,
13,
1678,
7882,
29918,
29734,
353,
525,
991,
597,
3286,
18411,
29889,
15947,
29889,
510,
29914,
11675,
29914,
21652,
29914,
29894,
29906,
29915,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
7882,
29918,
1989,
29901,
851,
1125,
13,
4706,
4103,
29880,
1061,
17255,
2344,
12035,
1311,
29892,
7882,
29918,
1989,
29922,
2754,
29918,
1989,
29897,
13,
13,
1678,
822,
6459,
29918,
11675,
29898,
1311,
29892,
1881,
29918,
726,
29897,
1599,
851,
29901,
13,
4706,
2009,
353,
7274,
29889,
2490,
29898,
29888,
29915,
29912,
1311,
29889,
2754,
29918,
29734,
6822,
4801,
522,
742,
848,
3790,
29915,
29939,
2396,
1881,
29918,
726,
29892,
525,
1989,
2396,
1583,
29889,
2754,
29918,
1989,
1800,
13,
4706,
848,
353,
2009,
29889,
3126,
580,
13,
4706,
4086,
353,
848,
29889,
657,
877,
1272,
2824,
657,
877,
29881,
2650,
1953,
29861,
29900,
3816,
29900,
1822,
657,
877,
11675,
1495,
13,
13,
4706,
736,
4086,
13,
13,
13,
1678,
822,
14240,
29898,
1311,
29892,
1881,
29918,
726,
29901,
851,
29892,
3646,
29918,
3893,
29901,
851,
29892,
2752,
29918,
3893,
29901,
851,
353,
20569,
1599,
851,
29901,
13,
4706,
2009,
353,
7274,
29889,
2490,
29898,
29888,
29915,
29912,
1311,
29889,
2754,
29918,
29734,
29913,
742,
13,
462,
18884,
848,
3790,
29915,
29939,
2396,
1881,
29918,
726,
29892,
525,
4993,
2396,
2752,
29918,
3893,
29892,
13,
462,
462,
418,
525,
5182,
2396,
3646,
29918,
3893,
29892,
525,
4830,
2396,
525,
726,
742,
13,
462,
462,
418,
525,
1989,
2396,
1583,
29889,
2754,
29918,
1989,
1800,
13,
4706,
848,
353,
2009,
29889,
3126,
580,
13,
4706,
5578,
800,
353,
848,
29889,
657,
877,
1272,
2824,
657,
877,
3286,
29880,
800,
1495,
13,
4706,
1426,
353,
5578,
800,
29961,
29900,
1822,
657,
877,
3286,
29880,
630,
1626,
1495,
13,
13,
4706,
736,
1426,
13,
2
] |
run.py | OSPgrp8/OSP | 0 | 181523 | <gh_stars>0
from app import app
import mongoengine as ming
from osp.classes.address import Address
if __name__ == "__main__":
obj = Address(residence_number="a@b", street="str", locality="loc",
state="state", city="city")
print(obj.pincode)
app.run(debug = True,port = 8000) | [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
3166,
623,
1053,
623,
13,
5215,
19476,
10599,
408,
286,
292,
13,
3166,
288,
1028,
29889,
13203,
29889,
7328,
1053,
16428,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
13,
1678,
5446,
353,
16428,
29898,
690,
5084,
29918,
4537,
543,
29874,
29992,
29890,
613,
11952,
543,
710,
613,
1887,
537,
543,
2029,
613,
13,
462,
2106,
543,
3859,
613,
4272,
543,
12690,
1159,
13,
1678,
1596,
29898,
5415,
29889,
12687,
401,
29897,
13,
13,
1678,
623,
29889,
3389,
29898,
8382,
353,
5852,
29892,
637,
353,
29871,
29947,
29900,
29900,
29900,
29897,
2
] |
district42_exp_types/sdict/_rollout.py | nikitanovosibirsk/district42-exp-types | 0 | 1611343 | <reponame>nikitanovosibirsk/district42-exp-types
from typing import Any, Dict, Union
from district42 import optional
from district42.utils import is_ellipsis
__all__ = ("rollout",)
KeysType = Dict[Union[str, optional], Any]
def rollout(keys: KeysType, separator: str = ".") -> KeysType:
updated: KeysType = {}
for comp_key, val in keys.items():
if is_ellipsis(comp_key):
assert is_ellipsis(val)
updated[comp_key] = val
continue
is_optional = False
if isinstance(comp_key, optional):
assert isinstance(comp_key.key, str)
comp_key = comp_key.key
is_optional = True
assert isinstance(comp_key, str)
parts = comp_key.split(separator)
key = parts[0]
if len(parts) == 1:
updated[optional(key) if is_optional else key] = val
else:
if key not in updated:
updated[key] = {}
tail = separator.join(parts[1:])
updated[key][optional(tail) if is_optional else tail] = val
for k, v in updated.items():
updated[k] = rollout(v) if isinstance(v, dict) else v
return updated
| [
1,
529,
276,
1112,
420,
29958,
5585,
8929,
586,
359,
747,
381,
808,
29914,
29881,
6801,
29946,
29906,
29899,
4548,
29899,
8768,
13,
3166,
19229,
1053,
3139,
29892,
360,
919,
29892,
7761,
13,
13,
3166,
6474,
29946,
29906,
1053,
13136,
13,
3166,
6474,
29946,
29906,
29889,
13239,
1053,
338,
29918,
5481,
567,
275,
13,
13,
1649,
497,
1649,
353,
4852,
1245,
449,
613,
29897,
13,
13,
13,
15506,
1542,
353,
360,
919,
29961,
19986,
29961,
710,
29892,
13136,
1402,
3139,
29962,
13,
13,
13,
1753,
9679,
449,
29898,
8149,
29901,
4813,
952,
1542,
29892,
28128,
29901,
851,
353,
11393,
1159,
1599,
4813,
952,
1542,
29901,
13,
1678,
4784,
29901,
4813,
952,
1542,
353,
6571,
13,
13,
1678,
363,
752,
29918,
1989,
29892,
659,
297,
6611,
29889,
7076,
7295,
13,
4706,
565,
338,
29918,
5481,
567,
275,
29898,
2388,
29918,
1989,
1125,
13,
9651,
4974,
338,
29918,
5481,
567,
275,
29898,
791,
29897,
13,
9651,
4784,
29961,
2388,
29918,
1989,
29962,
353,
659,
13,
9651,
6773,
13,
13,
4706,
338,
29918,
25253,
353,
7700,
13,
4706,
565,
338,
8758,
29898,
2388,
29918,
1989,
29892,
13136,
1125,
13,
9651,
4974,
338,
8758,
29898,
2388,
29918,
1989,
29889,
1989,
29892,
851,
29897,
13,
9651,
752,
29918,
1989,
353,
752,
29918,
1989,
29889,
1989,
13,
9651,
338,
29918,
25253,
353,
5852,
13,
4706,
4974,
338,
8758,
29898,
2388,
29918,
1989,
29892,
851,
29897,
13,
13,
4706,
5633,
353,
752,
29918,
1989,
29889,
5451,
29898,
344,
17954,
29897,
13,
4706,
1820,
353,
5633,
29961,
29900,
29962,
13,
4706,
565,
7431,
29898,
20895,
29897,
1275,
29871,
29896,
29901,
13,
9651,
4784,
29961,
25253,
29898,
1989,
29897,
565,
338,
29918,
25253,
1683,
1820,
29962,
353,
659,
13,
4706,
1683,
29901,
13,
9651,
565,
1820,
451,
297,
4784,
29901,
13,
18884,
4784,
29961,
1989,
29962,
353,
6571,
13,
9651,
12464,
353,
28128,
29889,
7122,
29898,
20895,
29961,
29896,
29901,
2314,
13,
9651,
4784,
29961,
1989,
3816,
25253,
29898,
18237,
29897,
565,
338,
29918,
25253,
1683,
12464,
29962,
353,
659,
13,
13,
1678,
363,
413,
29892,
325,
297,
4784,
29889,
7076,
7295,
13,
4706,
4784,
29961,
29895,
29962,
353,
9679,
449,
29898,
29894,
29897,
565,
338,
8758,
29898,
29894,
29892,
9657,
29897,
1683,
325,
13,
13,
1678,
736,
4784,
13,
2
] |
aio_geojson_nsw_transport_incidents/__init__.py | Fred-Ch/python-aio-geojson-nsw-transport-incidents-master | 0 | 166152 | """NSW Transport Service Incidents library."""
from .feed import NswTransportServiceIncidentsFeed # noqa
from .feed_manager import NswTransportServiceIncidentsFeedManager # noqa
| [
1,
9995,
3059,
29956,
15710,
6692,
9266,
16719,
3489,
1213,
15945,
30004,
13,
3166,
869,
18798,
1053,
405,
2774,
27395,
3170,
797,
29883,
16719,
29737,
29871,
396,
694,
25621,
30004,
13,
3166,
869,
18798,
29918,
12847,
1053,
405,
2774,
27395,
3170,
797,
29883,
16719,
29737,
3260,
29871,
396,
694,
25621,
30004,
13,
2
] |
tests/test_soda.py | Adam-Lechnos/SocrataPython | 0 | 110576 | <reponame>Adam-Lechnos/SocrataPython
from sodapy import Socrata
from sodapy.constants import DEFAULT_API_PREFIX, OLD_API_PREFIX
import requests
import requests_mock
import os.path
import inspect
import json
PREFIX = "https://"
DOMAIN = "fakedomain.com"
DATASET_IDENTIFIER = "songs"
APPTOKEN = "FakeAppToken"
USERNAME = "fakeuser"
PASSWORD = "<PASSWORD>"
TEST_DATA_PATH = os.path.join(os.path.dirname(os.path.abspath(inspect.getfile(
inspect.currentframe()))), "test_data")
def test_client():
client = Socrata(DOMAIN, APPTOKEN)
assert isinstance(client, Socrata)
client.close()
def test_get():
mock_adapter = {}
mock_adapter["prefix"] = PREFIX
adapter = requests_mock.Adapter()
mock_adapter["adapter"] = adapter
client = Socrata(DOMAIN, APPTOKEN, session_adapter=mock_adapter)
response_data = "get_songs.txt"
setup_mock(adapter, "GET", response_data, 200)
response = client.get(DATASET_IDENTIFIER)
assert isinstance(response, list)
assert len(response) == 10
client.close()
def test_get_unicode():
mock_adapter = {}
mock_adapter["prefix"] = PREFIX
adapter = requests_mock.Adapter()
mock_adapter["adapter"] = adapter
client = Socrata(DOMAIN, APPTOKEN, session_adapter=mock_adapter)
response_data = "get_songs_unicode.txt"
setup_mock(adapter, "GET", response_data, 200)
response = client.get(DATASET_IDENTIFIER)
assert isinstance(response, list)
assert len(response) == 10
client.close()
def test_get_metadata_and_attachments():
mock_adapter = {}
mock_adapter["prefix"] = PREFIX
adapter = requests_mock.Adapter()
mock_adapter["adapter"] = adapter
client = Socrata(DOMAIN, APPTOKEN, session_adapter=mock_adapter)
response_data = "get_song_metadata.txt"
setup_old_api_mock(adapter, "GET", response_data, 200)
response = client.get_metadata(DATASET_IDENTIFIER)
assert isinstance(response, dict)
assert "newBackend" in response
assert "attachments" in response["metadata"]
response = client.download_attachments(DATASET_IDENTIFIER)
assert isinstance(response, list)
assert len(response) == 0
client.close()
def test_update_metadata():
mock_adapter = {}
mock_adapter["prefix"] = PREFIX
adapter = requests_mock.Adapter()
mock_adapter["adapter"] = adapter
client = Socrata(DOMAIN, APPTOKEN, session_adapter=mock_adapter)
response_data = "update_song_metadata.txt"
setup_old_api_mock(adapter, "PUT", response_data, 200)
data = {"category": "Education", "attributionLink": "https://testing.updates"}
response = client.update_metadata(DATASET_IDENTIFIER, data)
assert isinstance(response, dict)
assert response.get("category") == data["category"]
assert response.get("attributionLink") == data["attributionLink"]
client.close()
def test_upsert_exception():
mock_adapter = {}
mock_adapter["prefix"] = PREFIX
adapter = requests_mock.Adapter()
mock_adapter["adapter"] = adapter
client = Socrata(DOMAIN, APPTOKEN, session_adapter=mock_adapter)
response_data = "403_response_json.txt"
setup_mock(adapter, "POST", response_data, 403, reason="Forbidden")
data = [{"theme": "Surfing", "artist": "Wavves",
"title": "King of the Beach", "year": "2010"}]
try:
client.upsert(DATASET_IDENTIFIER, data)
except Exception as e:
assert isinstance(e, requests.exceptions.HTTPError)
else:
raise AssertionError("No exception raised for bad request.")
def test_upsert():
mock_adapter = {}
mock_adapter["prefix"] = PREFIX
adapter = requests_mock.Adapter()
mock_adapter["adapter"] = adapter
client = Socrata(DOMAIN, APPTOKEN, username=USERNAME, password=PASSWORD,
session_adapter=mock_adapter)
response_data = "upsert_songs.txt"
data = [{"theme": "Surfing", "artist": "Wavves",
"title": "King of the Beach", "year": "2010"}]
setup_mock(adapter, "POST", response_data, 200)
response = client.upsert(DATASET_IDENTIFIER, data)
assert isinstance(response, dict)
assert response.get("Rows Created") == 1
client.close()
def test_replace():
mock_adapter = {}
mock_adapter["prefix"] = PREFIX
adapter = requests_mock.Adapter()
mock_adapter["adapter"] = adapter
client = Socrata(DOMAIN, APPTOKEN, username=USERNAME, password=PASSWORD,
session_adapter=mock_adapter)
response_data = "replace_songs.txt"
data = [
{"theme": "Surfing", "artist": "Wavves", "title": "King of the Beach",
"year": "2010"},
{"theme": "History", "artist": "Best Friends Forever",
"title": "<NAME>", "year": "2008"},
]
setup_mock(adapter, "PUT", response_data, 200)
response = client.replace(DATASET_IDENTIFIER, data)
assert isinstance(response, dict)
assert response.get("Rows Created") == 2
client.close()
def test_delete():
mock_adapter = {}
mock_adapter["prefix"] = PREFIX
adapter = requests_mock.Adapter()
mock_adapter["adapter"] = adapter
client = Socrata(DOMAIN, APPTOKEN, username=USERNAME, password=PASSWORD,
session_adapter=mock_adapter)
uri = "{0}{1}{2}/{3}.json".format(PREFIX, DOMAIN, OLD_API_PREFIX, DATASET_IDENTIFIER)
adapter.register_uri("DELETE", uri, status_code=200)
response = client.delete(DATASET_IDENTIFIER)
assert response.status_code == 200
try:
client.delete("foobar")
except Exception as e:
assert isinstance(e, requests_mock.exceptions.NoMockAddress)
finally:
client.close()
def test_create():
mock_adapter = {}
mock_adapter["prefix"] = PREFIX
adapter = requests_mock.Adapter()
mock_adapter["adapter"] = adapter
client = Socrata(DOMAIN, APPTOKEN, username=USERNAME, password=PASSWORD,
session_adapter=mock_adapter)
response_data = "create_foobar.txt"
setup_mock(adapter, "POST", response_data, 200, dataset_identifier=None)
columns = [
{"fieldName": "foo", "name": "Foo", "dataTypeName": "text"},
{"fieldName": "bar", "name": "Bar", "dataTypeName": "number"}
]
tags = ["foo", "bar"]
response = client.create("Foo Bar", description="test dataset",
columns=columns, tags=tags, row_identifier="bar")
request = adapter.request_history[0]
request_payload = json.loads(request.text) # can't figure out how to use .json
# Test request payload
for dataset_key in ["name", "description", "columns", "tags"]:
assert dataset_key in request_payload
for column_key in ["fieldName", "name", "dataTypeName"]:
assert column_key in request_payload["columns"][0]
# Test response
assert isinstance(response, dict)
assert len(response.get("id")) == 9
client.close()
def test_set_permission():
mock_adapter = {}
mock_adapter["prefix"] = PREFIX
adapter = requests_mock.Adapter()
mock_adapter["adapter"] = adapter
client = Socrata(DOMAIN, APPTOKEN, username=USERNAME, password=PASSWORD,
session_adapter=mock_adapter)
response_data = "empty.txt"
setup_old_api_mock(adapter, "PUT", response_data, 200)
# Test response
response = client.set_permission(DATASET_IDENTIFIER, "public")
assert response.status_code == 200
# Test request
request = adapter.request_history[0]
query_string = request.url.split("?")[-1]
params = query_string.split("&")
assert len(params) == 2
assert "method=setPermission" in params
assert "value=public.read" in params
client.close()
def test_publish():
mock_adapter = {}
mock_adapter["prefix"] = PREFIX
adapter = requests_mock.Adapter()
mock_adapter["adapter"] = adapter
client = Socrata(DOMAIN, APPTOKEN, username=USERNAME, password=PASSWORD,
session_adapter=mock_adapter)
response_data = "create_foobar.txt"
setup_publish_mock(adapter, "POST", response_data, 200)
response = client.publish(DATASET_IDENTIFIER)
assert isinstance(response, dict)
assert len(response.get("id")) == 9
client.close()
def test_import_non_data_file():
mock_adapter = {}
mock_adapter["prefix"] = PREFIX
adapter = requests_mock.Adapter()
mock_adapter["adapter"] = adapter
client = Socrata(DOMAIN, APPTOKEN, username=USERNAME, password=PASSWORD,
session_adapter=mock_adapter)
response_data = "successblobres.txt"
nondatasetfile_path = 'tests/test_data/nondatasetfile.zip'
setup_import_non_data_file(adapter, "POST", response_data, 200)
with open(nondatasetfile_path, 'rb') as f:
files = (
{'file': ("nondatasetfile.zip", f)}
)
response = client.create_non_data_file({}, files)
assert isinstance(response, dict)
assert response.get("blobFileSize") == 496
client.close()
def test_replace_non_data_file():
mock_adapter = {}
mock_adapter["prefix"] = PREFIX
adapter = requests_mock.Adapter()
mock_adapter["adapter"] = adapter
client = Socrata(DOMAIN, APPTOKEN, username=USERNAME, password=PASSWORD,
session_adapter=mock_adapter)
response_data = "successblobres.txt"
nondatasetfile_path = 'tests/test_data/nondatasetfile.zip'
setup_replace_non_data_file(adapter, "POST", response_data, 200)
with open(nondatasetfile_path, 'rb') as fin:
file = (
{'file': ("nondatasetfile.zip", fin)}
)
response = client.replace_non_data_file(DATASET_IDENTIFIER, {}, file)
assert isinstance(response, dict)
assert response.get("blobFileSize") == 496
client.close()
def setup_publish_mock(adapter, method, response, response_code, reason="OK",
dataset_identifier=DATASET_IDENTIFIER, content_type="json"):
path = os.path.join(TEST_DATA_PATH, response)
with open(path, "r") as response_body:
body = json.load(response_body)
uri = "{0}{1}{2}/{3}/publication.{4}".format(PREFIX, DOMAIN, OLD_API_PREFIX,
dataset_identifier, content_type)
headers = {
"content-type": "application/json; charset=utf-8"
}
adapter.register_uri(method, uri, status_code=response_code, json=body, reason=reason,
headers=headers)
def setup_import_non_data_file(adapter, method, response, response_code, reason="OK",
dataset_identifier=DATASET_IDENTIFIER, content_type="json"):
path = os.path.join(TEST_DATA_PATH, response)
with open(path, "r") as response_body:
body = json.load(response_body)
uri = "{0}{1}/api/imports2/?method=blob".format(PREFIX, DOMAIN)
headers = {
"content-type": "application/json; charset=utf-8"
}
adapter.register_uri(method, uri, status_code=response_code, json=body, reason=reason,
headers=headers)
def setup_replace_non_data_file(adapter, method, response, response_code, reason="OK",
dataset_identifier=DATASET_IDENTIFIER, content_type="json"):
path = os.path.join(TEST_DATA_PATH, response)
with open(path, "r") as response_body:
body = json.load(response_body)
uri = "{0}{1}{2}/{3}.{4}?method=replaceBlob&id={3}".format(PREFIX, DOMAIN, OLD_API_PREFIX,
dataset_identifier, "txt")
headers = {
"content-type": "text/plain; charset=utf-8"
}
adapter.register_uri(method, uri, status_code=response_code, json=body, reason=reason,
headers=headers)
def setup_old_api_mock(adapter, method, response, response_code, reason="OK",
dataset_identifier=DATASET_IDENTIFIER, content_type="json"):
path = os.path.join(TEST_DATA_PATH, response)
with open(path, "r") as response_body:
try:
body = json.load(response_body)
except ValueError:
body = None
uri = "{0}{1}{2}/{3}.{4}".format(PREFIX, DOMAIN, OLD_API_PREFIX, dataset_identifier,
content_type)
headers = {
"content-type": "application/json; charset=utf-8"
}
adapter.register_uri(method, uri, status_code=response_code, json=body, reason=reason,
headers=headers)
def setup_mock(adapter, method, response, response_code, reason="OK",
dataset_identifier=DATASET_IDENTIFIER, content_type="json"):
path = os.path.join(TEST_DATA_PATH, response)
with open(path, "r") as response_body:
body = json.load(response_body)
if dataset_identifier is None: # for create endpoint
uri = "{0}{1}{2}.{3}".format(PREFIX, DOMAIN, OLD_API_PREFIX, "json")
else: # most cases
uri = "{0}{1}{2}{3}.{4}".format(PREFIX, DOMAIN, DEFAULT_API_PREFIX, dataset_identifier,
content_type)
headers = {
"content-type": "application/json; charset=utf-8"
}
adapter.register_uri(method, uri, status_code=response_code, json=body, reason=reason,
headers=headers)
| [
1,
529,
276,
1112,
420,
29958,
3253,
314,
29899,
3226,
3049,
359,
29914,
29903,
8415,
532,
11980,
13,
3166,
20892,
27580,
1053,
317,
8415,
532,
13,
3166,
20892,
27580,
29889,
3075,
1934,
1053,
22236,
29918,
8787,
29918,
15094,
25634,
29892,
438,
10249,
29918,
8787,
29918,
15094,
25634,
13,
5215,
7274,
13,
5215,
7274,
29918,
17640,
13,
13,
5215,
2897,
29889,
2084,
13,
5215,
16096,
13,
5215,
4390,
13,
13,
13,
15094,
25634,
353,
376,
991,
597,
29908,
13,
3970,
29032,
353,
376,
29888,
557,
11607,
475,
29889,
510,
29908,
13,
25832,
8127,
29911,
29918,
1367,
3919,
29902,
3738,
1001,
353,
376,
21453,
29879,
29908,
13,
20576,
4986,
29968,
1430,
353,
376,
29943,
1296,
2052,
6066,
29908,
13,
11889,
5813,
353,
376,
29888,
1296,
1792,
29908,
13,
25711,
17013,
353,
9872,
25711,
17013,
11903,
13,
18267,
29918,
14573,
29918,
10145,
353,
2897,
29889,
2084,
29889,
7122,
29898,
359,
29889,
2084,
29889,
25721,
29898,
359,
29889,
2084,
29889,
370,
1028,
493,
29898,
1144,
1103,
29889,
657,
1445,
29898,
13,
1678,
16096,
29889,
3784,
2557,
22130,
511,
376,
1688,
29918,
1272,
1159,
13,
13,
13,
1753,
1243,
29918,
4645,
7295,
13,
1678,
3132,
353,
317,
8415,
532,
29898,
3970,
29032,
29892,
12279,
29925,
4986,
29968,
1430,
29897,
13,
1678,
4974,
338,
8758,
29898,
4645,
29892,
317,
8415,
532,
29897,
13,
1678,
3132,
29889,
5358,
580,
13,
13,
13,
1753,
1243,
29918,
657,
7295,
13,
1678,
11187,
29918,
21412,
353,
6571,
13,
1678,
11187,
29918,
21412,
3366,
13506,
3108,
353,
349,
1525,
25634,
13,
1678,
13304,
353,
7274,
29918,
17640,
29889,
6168,
580,
13,
1678,
11187,
29918,
21412,
3366,
21412,
3108,
353,
13304,
13,
1678,
3132,
353,
317,
8415,
532,
29898,
3970,
29032,
29892,
12279,
29925,
4986,
29968,
1430,
29892,
4867,
29918,
21412,
29922,
17640,
29918,
21412,
29897,
13,
13,
1678,
2933,
29918,
1272,
353,
376,
657,
29918,
21453,
29879,
29889,
3945,
29908,
13,
1678,
6230,
29918,
17640,
29898,
21412,
29892,
376,
7194,
613,
2933,
29918,
1272,
29892,
29871,
29906,
29900,
29900,
29897,
13,
1678,
2933,
353,
3132,
29889,
657,
29898,
25832,
8127,
29911,
29918,
1367,
3919,
29902,
3738,
1001,
29897,
13,
13,
1678,
4974,
338,
8758,
29898,
5327,
29892,
1051,
29897,
13,
1678,
4974,
7431,
29898,
5327,
29897,
1275,
29871,
29896,
29900,
13,
13,
1678,
3132,
29889,
5358,
580,
13,
13,
13,
1753,
1243,
29918,
657,
29918,
2523,
356,
7295,
13,
1678,
11187,
29918,
21412,
353,
6571,
13,
1678,
11187,
29918,
21412,
3366,
13506,
3108,
353,
349,
1525,
25634,
13,
1678,
13304,
353,
7274,
29918,
17640,
29889,
6168,
580,
13,
1678,
11187,
29918,
21412,
3366,
21412,
3108,
353,
13304,
13,
1678,
3132,
353,
317,
8415,
532,
29898,
3970,
29032,
29892,
12279,
29925,
4986,
29968,
1430,
29892,
4867,
29918,
21412,
29922,
17640,
29918,
21412,
29897,
13,
13,
1678,
2933,
29918,
1272,
353,
376,
657,
29918,
21453,
29879,
29918,
2523,
356,
29889,
3945,
29908,
13,
1678,
6230,
29918,
17640,
29898,
21412,
29892,
376,
7194,
613,
2933,
29918,
1272,
29892,
29871,
29906,
29900,
29900,
29897,
13,
13,
1678,
2933,
353,
3132,
29889,
657,
29898,
25832,
8127,
29911,
29918,
1367,
3919,
29902,
3738,
1001,
29897,
13,
13,
1678,
4974,
338,
8758,
29898,
5327,
29892,
1051,
29897,
13,
1678,
4974,
7431,
29898,
5327,
29897,
1275,
29871,
29896,
29900,
13,
13,
1678,
3132,
29889,
5358,
580,
13,
13,
13,
1753,
1243,
29918,
657,
29918,
19635,
29918,
392,
29918,
14930,
1860,
7295,
13,
1678,
11187,
29918,
21412,
353,
6571,
13,
1678,
11187,
29918,
21412,
3366,
13506,
3108,
353,
349,
1525,
25634,
13,
1678,
13304,
353,
7274,
29918,
17640,
29889,
6168,
580,
13,
1678,
11187,
29918,
21412,
3366,
21412,
3108,
353,
13304,
13,
1678,
3132,
353,
317,
8415,
532,
29898,
3970,
29032,
29892,
12279,
29925,
4986,
29968,
1430,
29892,
4867,
29918,
21412,
29922,
17640,
29918,
21412,
29897,
13,
13,
1678,
2933,
29918,
1272,
353,
376,
657,
29918,
21453,
29918,
19635,
29889,
3945,
29908,
13,
1678,
6230,
29918,
1025,
29918,
2754,
29918,
17640,
29898,
21412,
29892,
376,
7194,
613,
2933,
29918,
1272,
29892,
29871,
29906,
29900,
29900,
29897,
13,
1678,
2933,
353,
3132,
29889,
657,
29918,
19635,
29898,
25832,
8127,
29911,
29918,
1367,
3919,
29902,
3738,
1001,
29897,
13,
13,
1678,
4974,
338,
8758,
29898,
5327,
29892,
9657,
29897,
13,
1678,
4974,
376,
1482,
5841,
355,
29908,
297,
2933,
13,
1678,
4974,
376,
14930,
1860,
29908,
297,
2933,
3366,
19635,
3108,
13,
13,
1678,
2933,
353,
3132,
29889,
10382,
29918,
14930,
1860,
29898,
25832,
8127,
29911,
29918,
1367,
3919,
29902,
3738,
1001,
29897,
13,
13,
1678,
4974,
338,
8758,
29898,
5327,
29892,
1051,
29897,
13,
1678,
4974,
7431,
29898,
5327,
29897,
1275,
29871,
29900,
13,
13,
1678,
3132,
29889,
5358,
580,
13,
13,
13,
1753,
1243,
29918,
5504,
29918,
19635,
7295,
13,
1678,
11187,
29918,
21412,
353,
6571,
13,
1678,
11187,
29918,
21412,
3366,
13506,
3108,
353,
349,
1525,
25634,
13,
1678,
13304,
353,
7274,
29918,
17640,
29889,
6168,
580,
13,
1678,
11187,
29918,
21412,
3366,
21412,
3108,
353,
13304,
13,
1678,
3132,
353,
317,
8415,
532,
29898,
3970,
29032,
29892,
12279,
29925,
4986,
29968,
1430,
29892,
4867,
29918,
21412,
29922,
17640,
29918,
21412,
29897,
13,
13,
1678,
2933,
29918,
1272,
353,
376,
5504,
29918,
21453,
29918,
19635,
29889,
3945,
29908,
13,
1678,
6230,
29918,
1025,
29918,
2754,
29918,
17640,
29898,
21412,
29892,
376,
12336,
613,
2933,
29918,
1272,
29892,
29871,
29906,
29900,
29900,
29897,
13,
1678,
848,
353,
8853,
7320,
1115,
376,
29923,
29392,
613,
376,
1131,
3224,
6595,
1115,
376,
991,
597,
13424,
29889,
786,
15190,
9092,
13,
13,
1678,
2933,
353,
3132,
29889,
5504,
29918,
19635,
29898,
25832,
8127,
29911,
29918,
1367,
3919,
29902,
3738,
1001,
29892,
848,
29897,
13,
13,
1678,
4974,
338,
8758,
29898,
5327,
29892,
9657,
29897,
13,
1678,
4974,
2933,
29889,
657,
703,
7320,
1159,
1275,
848,
3366,
7320,
3108,
13,
1678,
4974,
2933,
29889,
657,
703,
1131,
3224,
6595,
1159,
1275,
848,
3366,
1131,
3224,
6595,
3108,
13,
13,
1678,
3132,
29889,
5358,
580,
13,
13,
13,
1753,
1243,
29918,
14340,
814,
29918,
11739,
7295,
13,
1678,
11187,
29918,
21412,
353,
6571,
13,
1678,
11187,
29918,
21412,
3366,
13506,
3108,
353,
349,
1525,
25634,
13,
1678,
13304,
353,
7274,
29918,
17640,
29889,
6168,
580,
13,
1678,
11187,
29918,
21412,
3366,
21412,
3108,
353,
13304,
13,
1678,
3132,
353,
317,
8415,
532,
29898,
3970,
29032,
29892,
12279,
29925,
4986,
29968,
1430,
29892,
4867,
29918,
21412,
29922,
17640,
29918,
21412,
29897,
13,
13,
1678,
2933,
29918,
1272,
353,
376,
29946,
29900,
29941,
29918,
5327,
29918,
3126,
29889,
3945,
29908,
13,
1678,
6230,
29918,
17640,
29898,
21412,
29892,
376,
5438,
613,
2933,
29918,
1272,
29892,
29871,
29946,
29900,
29941,
29892,
2769,
543,
2831,
29890,
4215,
1159,
13,
13,
1678,
848,
353,
518,
6377,
18193,
1115,
376,
18498,
29888,
292,
613,
376,
442,
391,
1115,
376,
29956,
485,
1960,
613,
13,
632,
376,
3257,
1115,
376,
29968,
292,
310,
278,
17594,
613,
376,
6360,
1115,
376,
29906,
29900,
29896,
29900,
29908,
6525,
13,
1678,
1018,
29901,
13,
4706,
3132,
29889,
14340,
814,
29898,
25832,
8127,
29911,
29918,
1367,
3919,
29902,
3738,
1001,
29892,
848,
29897,
13,
1678,
5174,
8960,
408,
321,
29901,
13,
4706,
4974,
338,
8758,
29898,
29872,
29892,
7274,
29889,
11739,
29879,
29889,
10493,
2392,
29897,
13,
1678,
1683,
29901,
13,
4706,
12020,
16499,
291,
2392,
703,
3782,
3682,
10425,
363,
4319,
2009,
23157,
13,
13,
13,
1753,
1243,
29918,
14340,
814,
7295,
13,
1678,
11187,
29918,
21412,
353,
6571,
13,
1678,
11187,
29918,
21412,
3366,
13506,
3108,
353,
349,
1525,
25634,
13,
1678,
13304,
353,
7274,
29918,
17640,
29889,
6168,
580,
13,
1678,
11187,
29918,
21412,
3366,
21412,
3108,
353,
13304,
13,
1678,
3132,
353,
317,
8415,
532,
29898,
3970,
29032,
29892,
12279,
29925,
4986,
29968,
1430,
29892,
8952,
29922,
11889,
5813,
29892,
4800,
29922,
25711,
17013,
29892,
13,
462,
268,
4867,
29918,
21412,
29922,
17640,
29918,
21412,
29897,
13,
13,
1678,
2933,
29918,
1272,
353,
376,
14340,
814,
29918,
21453,
29879,
29889,
3945,
29908,
13,
1678,
848,
353,
518,
6377,
18193,
1115,
376,
18498,
29888,
292,
613,
376,
442,
391,
1115,
376,
29956,
485,
1960,
613,
13,
632,
376,
3257,
1115,
376,
29968,
292,
310,
278,
17594,
613,
376,
6360,
1115,
376,
29906,
29900,
29896,
29900,
29908,
6525,
13,
1678,
6230,
29918,
17640,
29898,
21412,
29892,
376,
5438,
613,
2933,
29918,
1272,
29892,
29871,
29906,
29900,
29900,
29897,
13,
1678,
2933,
353,
3132,
29889,
14340,
814,
29898,
25832,
8127,
29911,
29918,
1367,
3919,
29902,
3738,
1001,
29892,
848,
29897,
13,
13,
1678,
4974,
338,
8758,
29898,
5327,
29892,
9657,
29897,
13,
1678,
4974,
2933,
29889,
657,
703,
10661,
6760,
630,
1159,
1275,
29871,
29896,
13,
1678,
3132,
29889,
5358,
580,
13,
13,
13,
1753,
1243,
29918,
6506,
7295,
13,
1678,
11187,
29918,
21412,
353,
6571,
13,
1678,
11187,
29918,
21412,
3366,
13506,
3108,
353,
349,
1525,
25634,
13,
1678,
13304,
353,
7274,
29918,
17640,
29889,
6168,
580,
13,
1678,
11187,
29918,
21412,
3366,
21412,
3108,
353,
13304,
13,
1678,
3132,
353,
317,
8415,
532,
29898,
3970,
29032,
29892,
12279,
29925,
4986,
29968,
1430,
29892,
8952,
29922,
11889,
5813,
29892,
4800,
29922,
25711,
17013,
29892,
13,
462,
268,
4867,
29918,
21412,
29922,
17640,
29918,
21412,
29897,
13,
13,
1678,
2933,
29918,
1272,
353,
376,
6506,
29918,
21453,
29879,
29889,
3945,
29908,
13,
1678,
848,
353,
518,
13,
4706,
8853,
18193,
1115,
376,
18498,
29888,
292,
613,
376,
442,
391,
1115,
376,
29956,
485,
1960,
613,
376,
3257,
1115,
376,
29968,
292,
310,
278,
17594,
613,
13,
308,
376,
6360,
1115,
376,
29906,
29900,
29896,
29900,
10758,
13,
4706,
8853,
18193,
1115,
376,
20570,
613,
376,
442,
391,
1115,
376,
25353,
11169,
1975,
28297,
369,
613,
13,
308,
376,
3257,
1115,
9872,
5813,
28341,
376,
6360,
1115,
376,
29906,
29900,
29900,
29947,
10758,
13,
1678,
4514,
13,
1678,
6230,
29918,
17640,
29898,
21412,
29892,
376,
12336,
613,
2933,
29918,
1272,
29892,
29871,
29906,
29900,
29900,
29897,
13,
1678,
2933,
353,
3132,
29889,
6506,
29898,
25832,
8127,
29911,
29918,
1367,
3919,
29902,
3738,
1001,
29892,
848,
29897,
13,
13,
1678,
4974,
338,
8758,
29898,
5327,
29892,
9657,
29897,
13,
1678,
4974,
2933,
29889,
657,
703,
10661,
6760,
630,
1159,
1275,
29871,
29906,
13,
1678,
3132,
29889,
5358,
580,
13,
13,
13,
1753,
1243,
29918,
8143,
7295,
13,
1678,
11187,
29918,
21412,
353,
6571,
13,
1678,
11187,
29918,
21412,
3366,
13506,
3108,
353,
349,
1525,
25634,
13,
1678,
13304,
353,
7274,
29918,
17640,
29889,
6168,
580,
13,
1678,
11187,
29918,
21412,
3366,
21412,
3108,
353,
13304,
13,
1678,
3132,
353,
317,
8415,
532,
29898,
3970,
29032,
29892,
12279,
29925,
4986,
29968,
1430,
29892,
8952,
29922,
11889,
5813,
29892,
4800,
29922,
25711,
17013,
29892,
13,
462,
268,
4867,
29918,
21412,
29922,
17640,
29918,
21412,
29897,
13,
13,
1678,
21333,
353,
29850,
29900,
1157,
29896,
1157,
29906,
6822,
29912,
29941,
1836,
3126,
1642,
4830,
29898,
15094,
25634,
29892,
11662,
29032,
29892,
438,
10249,
29918,
8787,
29918,
15094,
25634,
29892,
27640,
8127,
29911,
29918,
1367,
3919,
29902,
3738,
1001,
29897,
13,
1678,
13304,
29889,
9573,
29918,
5338,
703,
2287,
18476,
613,
21333,
29892,
4660,
29918,
401,
29922,
29906,
29900,
29900,
29897,
13,
1678,
2933,
353,
3132,
29889,
8143,
29898,
25832,
8127,
29911,
29918,
1367,
3919,
29902,
3738,
1001,
29897,
13,
1678,
4974,
2933,
29889,
4882,
29918,
401,
1275,
29871,
29906,
29900,
29900,
13,
13,
1678,
1018,
29901,
13,
4706,
3132,
29889,
8143,
703,
1181,
22872,
1159,
13,
1678,
5174,
8960,
408,
321,
29901,
13,
4706,
4974,
338,
8758,
29898,
29872,
29892,
7274,
29918,
17640,
29889,
11739,
29879,
29889,
3782,
18680,
7061,
29897,
13,
1678,
7146,
29901,
13,
4706,
3132,
29889,
5358,
580,
13,
13,
13,
1753,
1243,
29918,
3258,
7295,
13,
1678,
11187,
29918,
21412,
353,
6571,
13,
1678,
11187,
29918,
21412,
3366,
13506,
3108,
353,
349,
1525,
25634,
13,
1678,
13304,
353,
7274,
29918,
17640,
29889,
6168,
580,
13,
1678,
11187,
29918,
21412,
3366,
21412,
3108,
353,
13304,
13,
1678,
3132,
353,
317,
8415,
532,
29898,
3970,
29032,
29892,
12279,
29925,
4986,
29968,
1430,
29892,
8952,
29922,
11889,
5813,
29892,
4800,
29922,
25711,
17013,
29892,
13,
462,
268,
4867,
29918,
21412,
29922,
17640,
29918,
21412,
29897,
13,
13,
1678,
2933,
29918,
1272,
353,
376,
3258,
29918,
1181,
22872,
29889,
3945,
29908,
13,
1678,
6230,
29918,
17640,
29898,
21412,
29892,
376,
5438,
613,
2933,
29918,
1272,
29892,
29871,
29906,
29900,
29900,
29892,
8783,
29918,
25378,
29922,
8516,
29897,
13,
13,
1678,
4341,
353,
518,
13,
4706,
8853,
2671,
1170,
1115,
376,
5431,
613,
376,
978,
1115,
376,
14016,
613,
376,
1272,
1542,
1170,
1115,
376,
726,
10758,
13,
4706,
8853,
2671,
1170,
1115,
376,
1646,
613,
376,
978,
1115,
376,
4297,
613,
376,
1272,
1542,
1170,
1115,
376,
4537,
9092,
13,
1678,
4514,
13,
1678,
8282,
353,
6796,
5431,
613,
376,
1646,
3108,
13,
1678,
2933,
353,
3132,
29889,
3258,
703,
14016,
2261,
613,
6139,
543,
1688,
8783,
613,
13,
462,
632,
4341,
29922,
13099,
29892,
8282,
29922,
11338,
29892,
1948,
29918,
25378,
543,
1646,
1159,
13,
13,
1678,
2009,
353,
13304,
29889,
3827,
29918,
18434,
29961,
29900,
29962,
13,
1678,
2009,
29918,
23813,
353,
4390,
29889,
18132,
29898,
3827,
29889,
726,
29897,
29871,
396,
508,
29915,
29873,
4377,
714,
920,
304,
671,
869,
3126,
13,
13,
1678,
396,
4321,
2009,
20092,
13,
1678,
363,
8783,
29918,
1989,
297,
6796,
978,
613,
376,
8216,
613,
376,
13099,
613,
376,
11338,
3108,
29901,
13,
4706,
4974,
8783,
29918,
1989,
297,
2009,
29918,
23813,
13,
13,
1678,
363,
1897,
29918,
1989,
297,
6796,
2671,
1170,
613,
376,
978,
613,
376,
1272,
1542,
1170,
3108,
29901,
13,
4706,
4974,
1897,
29918,
1989,
297,
2009,
29918,
23813,
3366,
13099,
3108,
29961,
29900,
29962,
13,
13,
1678,
396,
4321,
2933,
13,
1678,
4974,
338,
8758,
29898,
5327,
29892,
9657,
29897,
13,
1678,
4974,
7431,
29898,
5327,
29889,
657,
703,
333,
5783,
1275,
29871,
29929,
13,
1678,
3132,
29889,
5358,
580,
13,
13,
13,
1753,
1243,
29918,
842,
29918,
16074,
7295,
13,
1678,
11187,
29918,
21412,
353,
6571,
13,
1678,
11187,
29918,
21412,
3366,
13506,
3108,
353,
349,
1525,
25634,
13,
1678,
13304,
353,
7274,
29918,
17640,
29889,
6168,
580,
13,
1678,
11187,
29918,
21412,
3366,
21412,
3108,
353,
13304,
13,
1678,
3132,
353,
317,
8415,
532,
29898,
3970,
29032,
29892,
12279,
29925,
4986,
29968,
1430,
29892,
8952,
29922,
11889,
5813,
29892,
4800,
29922,
25711,
17013,
29892,
13,
462,
268,
4867,
29918,
21412,
29922,
17640,
29918,
21412,
29897,
13,
13,
1678,
2933,
29918,
1272,
353,
376,
6310,
29889,
3945,
29908,
13,
1678,
6230,
29918,
1025,
29918,
2754,
29918,
17640,
29898,
21412,
29892,
376,
12336,
613,
2933,
29918,
1272,
29892,
29871,
29906,
29900,
29900,
29897,
13,
13,
1678,
396,
4321,
2933,
13,
1678,
2933,
353,
3132,
29889,
842,
29918,
16074,
29898,
25832,
8127,
29911,
29918,
1367,
3919,
29902,
3738,
1001,
29892,
376,
3597,
1159,
13,
1678,
4974,
2933,
29889,
4882,
29918,
401,
1275,
29871,
29906,
29900,
29900,
13,
13,
1678,
396,
4321,
2009,
13,
1678,
2009,
353,
13304,
29889,
3827,
29918,
18434,
29961,
29900,
29962,
13,
1678,
2346,
29918,
1807,
353,
2009,
29889,
2271,
29889,
5451,
703,
29973,
1159,
14352,
29896,
29962,
13,
1678,
8636,
353,
2346,
29918,
1807,
29889,
5451,
703,
29987,
1159,
13,
13,
1678,
4974,
7431,
29898,
7529,
29897,
1275,
29871,
29906,
13,
1678,
4974,
376,
5696,
29922,
842,
27293,
29908,
297,
8636,
13,
1678,
4974,
376,
1767,
29922,
3597,
29889,
949,
29908,
297,
8636,
13,
13,
1678,
3132,
29889,
5358,
580,
13,
13,
13,
1753,
1243,
29918,
23679,
7295,
13,
1678,
11187,
29918,
21412,
353,
6571,
13,
1678,
11187,
29918,
21412,
3366,
13506,
3108,
353,
349,
1525,
25634,
13,
1678,
13304,
353,
7274,
29918,
17640,
29889,
6168,
580,
13,
1678,
11187,
29918,
21412,
3366,
21412,
3108,
353,
13304,
13,
1678,
3132,
353,
317,
8415,
532,
29898,
3970,
29032,
29892,
12279,
29925,
4986,
29968,
1430,
29892,
8952,
29922,
11889,
5813,
29892,
4800,
29922,
25711,
17013,
29892,
13,
462,
268,
4867,
29918,
21412,
29922,
17640,
29918,
21412,
29897,
13,
13,
1678,
2933,
29918,
1272,
353,
376,
3258,
29918,
1181,
22872,
29889,
3945,
29908,
13,
1678,
6230,
29918,
23679,
29918,
17640,
29898,
21412,
29892,
376,
5438,
613,
2933,
29918,
1272,
29892,
29871,
29906,
29900,
29900,
29897,
13,
13,
1678,
2933,
353,
3132,
29889,
23679,
29898,
25832,
8127,
29911,
29918,
1367,
3919,
29902,
3738,
1001,
29897,
13,
1678,
4974,
338,
8758,
29898,
5327,
29892,
9657,
29897,
13,
1678,
4974,
7431,
29898,
5327,
29889,
657,
703,
333,
5783,
1275,
29871,
29929,
13,
1678,
3132,
29889,
5358,
580,
13,
13,
13,
1753,
1243,
29918,
5215,
29918,
5464,
29918,
1272,
29918,
1445,
7295,
13,
1678,
11187,
29918,
21412,
353,
6571,
13,
1678,
11187,
29918,
21412,
3366,
13506,
3108,
353,
349,
1525,
25634,
13,
1678,
13304,
353,
7274,
29918,
17640,
29889,
6168,
580,
13,
1678,
11187,
29918,
21412,
3366,
21412,
3108,
353,
13304,
13,
1678,
3132,
353,
317,
8415,
532,
29898,
3970,
29032,
29892,
12279,
29925,
4986,
29968,
1430,
29892,
8952,
29922,
11889,
5813,
29892,
4800,
29922,
25711,
17013,
29892,
13,
462,
268,
4867,
29918,
21412,
29922,
17640,
29918,
21412,
29897,
13,
13,
1678,
2933,
29918,
1272,
353,
376,
8698,
10054,
690,
29889,
3945,
29908,
13,
1678,
302,
898,
271,
24541,
1445,
29918,
2084,
353,
525,
21150,
29914,
1688,
29918,
1272,
29914,
29876,
898,
271,
24541,
1445,
29889,
7554,
29915,
13,
13,
1678,
6230,
29918,
5215,
29918,
5464,
29918,
1272,
29918,
1445,
29898,
21412,
29892,
376,
5438,
613,
2933,
29918,
1272,
29892,
29871,
29906,
29900,
29900,
29897,
13,
13,
1678,
411,
1722,
29898,
29876,
898,
271,
24541,
1445,
29918,
2084,
29892,
525,
6050,
1495,
408,
285,
29901,
13,
4706,
2066,
353,
313,
13,
9651,
11117,
1445,
2396,
4852,
29876,
898,
271,
24541,
1445,
29889,
7554,
613,
285,
2915,
13,
4706,
1723,
13,
4706,
2933,
353,
3132,
29889,
3258,
29918,
5464,
29918,
1272,
29918,
1445,
3319,
1118,
2066,
29897,
13,
13,
1678,
4974,
338,
8758,
29898,
5327,
29892,
9657,
29897,
13,
1678,
4974,
2933,
29889,
657,
703,
10054,
2283,
3505,
1159,
1275,
29871,
29946,
29929,
29953,
13,
1678,
3132,
29889,
5358,
580,
13,
13,
13,
1753,
1243,
29918,
6506,
29918,
5464,
29918,
1272,
29918,
1445,
7295,
13,
1678,
11187,
29918,
21412,
353,
6571,
13,
1678,
11187,
29918,
21412,
3366,
13506,
3108,
353,
349,
1525,
25634,
13,
1678,
13304,
353,
7274,
29918,
17640,
29889,
6168,
580,
13,
1678,
11187,
29918,
21412,
3366,
21412,
3108,
353,
13304,
13,
1678,
3132,
353,
317,
8415,
532,
29898,
3970,
29032,
29892,
12279,
29925,
4986,
29968,
1430,
29892,
8952,
29922,
11889,
5813,
29892,
4800,
29922,
25711,
17013,
29892,
13,
462,
268,
4867,
29918,
21412,
29922,
17640,
29918,
21412,
29897,
13,
13,
1678,
2933,
29918,
1272,
353,
376,
8698,
10054,
690,
29889,
3945,
29908,
13,
1678,
302,
898,
271,
24541,
1445,
29918,
2084,
353,
525,
21150,
29914,
1688,
29918,
1272,
29914,
29876,
898,
271,
24541,
1445,
29889,
7554,
29915,
13,
13,
1678,
6230,
29918,
6506,
29918,
5464,
29918,
1272,
29918,
1445,
29898,
21412,
29892,
376,
5438,
613,
2933,
29918,
1272,
29892,
29871,
29906,
29900,
29900,
29897,
13,
13,
1678,
411,
1722,
29898,
29876,
898,
271,
24541,
1445,
29918,
2084,
29892,
525,
6050,
1495,
408,
1436,
29901,
13,
4706,
934,
353,
313,
13,
9651,
11117,
1445,
2396,
4852,
29876,
898,
271,
24541,
1445,
29889,
7554,
613,
1436,
2915,
13,
4706,
1723,
13,
4706,
2933,
353,
3132,
29889,
6506,
29918,
5464,
29918,
1272,
29918,
1445,
29898,
25832,
8127,
29911,
29918,
1367,
3919,
29902,
3738,
1001,
29892,
24335,
934,
29897,
13,
13,
1678,
4974,
338,
8758,
29898,
5327,
29892,
9657,
29897,
13,
1678,
4974,
2933,
29889,
657,
703,
10054,
2283,
3505,
1159,
1275,
29871,
29946,
29929,
29953,
13,
1678,
3132,
29889,
5358,
580,
13,
13,
13,
1753,
6230,
29918,
23679,
29918,
17640,
29898,
21412,
29892,
1158,
29892,
2933,
29892,
2933,
29918,
401,
29892,
2769,
543,
8949,
613,
13,
462,
539,
8783,
29918,
25378,
29922,
25832,
8127,
29911,
29918,
1367,
3919,
29902,
3738,
1001,
29892,
2793,
29918,
1853,
543,
3126,
29908,
1125,
13,
13,
1678,
2224,
353,
2897,
29889,
2084,
29889,
7122,
29898,
18267,
29918,
14573,
29918,
10145,
29892,
2933,
29897,
13,
1678,
411,
1722,
29898,
2084,
29892,
376,
29878,
1159,
408,
2933,
29918,
2587,
29901,
13,
4706,
3573,
353,
4390,
29889,
1359,
29898,
5327,
29918,
2587,
29897,
13,
13,
1678,
21333,
353,
29850,
29900,
1157,
29896,
1157,
29906,
6822,
29912,
29941,
6822,
3597,
362,
29889,
29912,
29946,
29913,
1642,
4830,
29898,
15094,
25634,
29892,
11662,
29032,
29892,
438,
10249,
29918,
8787,
29918,
15094,
25634,
29892,
13,
462,
462,
462,
8783,
29918,
25378,
29892,
2793,
29918,
1853,
29897,
13,
13,
1678,
9066,
353,
426,
13,
4706,
376,
3051,
29899,
1853,
1115,
376,
6214,
29914,
3126,
29936,
17425,
29922,
9420,
29899,
29947,
29908,
13,
1678,
500,
13,
13,
1678,
13304,
29889,
9573,
29918,
5338,
29898,
5696,
29892,
21333,
29892,
4660,
29918,
401,
29922,
5327,
29918,
401,
29892,
4390,
29922,
2587,
29892,
2769,
29922,
23147,
29892,
13,
462,
308,
9066,
29922,
13662,
29897,
13,
13,
13,
1753,
6230,
29918,
5215,
29918,
5464,
29918,
1272,
29918,
1445,
29898,
21412,
29892,
1158,
29892,
2933,
29892,
2933,
29918,
401,
29892,
2769,
543,
8949,
613,
13,
462,
1669,
8783,
29918,
25378,
29922,
25832,
8127,
29911,
29918,
1367,
3919,
29902,
3738,
1001,
29892,
2793,
29918,
1853,
543,
3126,
29908,
1125,
13,
13,
1678,
2224,
353,
2897,
29889,
2084,
29889,
7122,
29898,
18267,
29918,
14573,
29918,
10145,
29892,
2933,
29897,
13,
1678,
411,
1722,
29898,
2084,
29892,
376,
29878,
1159,
408,
2933,
29918,
2587,
29901,
13,
4706,
3573,
353,
4390,
29889,
1359,
29898,
5327,
29918,
2587,
29897,
13,
13,
1678,
21333,
353,
29850,
29900,
1157,
29896,
6822,
2754,
29914,
326,
4011,
29906,
13401,
5696,
29922,
10054,
1642,
4830,
29898,
15094,
25634,
29892,
11662,
29032,
29897,
13,
13,
1678,
9066,
353,
426,
13,
4706,
376,
3051,
29899,
1853,
1115,
376,
6214,
29914,
3126,
29936,
17425,
29922,
9420,
29899,
29947,
29908,
13,
1678,
500,
13,
13,
1678,
13304,
29889,
9573,
29918,
5338,
29898,
5696,
29892,
21333,
29892,
4660,
29918,
401,
29922,
5327,
29918,
401,
29892,
4390,
29922,
2587,
29892,
2769,
29922,
23147,
29892,
13,
462,
308,
9066,
29922,
13662,
29897,
13,
13,
13,
1753,
6230,
29918,
6506,
29918,
5464,
29918,
1272,
29918,
1445,
29898,
21412,
29892,
1158,
29892,
2933,
29892,
2933,
29918,
401,
29892,
2769,
543,
8949,
613,
13,
462,
18884,
8783,
29918,
25378,
29922,
25832,
8127,
29911,
29918,
1367,
3919,
29902,
3738,
1001,
29892,
2793,
29918,
1853,
543,
3126,
29908,
1125,
13,
13,
1678,
2224,
353,
2897,
29889,
2084,
29889,
7122,
29898,
18267,
29918,
14573,
29918,
10145,
29892,
2933,
29897,
13,
1678,
411,
1722,
29898,
2084,
29892,
376,
29878,
1159,
408,
2933,
29918,
2587,
29901,
13,
4706,
3573,
353,
4390,
29889,
1359,
29898,
5327,
29918,
2587,
29897,
13,
13,
1678,
21333,
353,
29850,
29900,
1157,
29896,
1157,
29906,
6822,
29912,
29941,
1836,
29912,
29946,
29913,
29973,
5696,
29922,
6506,
29933,
2127,
29987,
333,
3790,
29941,
29913,
1642,
4830,
29898,
15094,
25634,
29892,
11662,
29032,
29892,
438,
10249,
29918,
8787,
29918,
15094,
25634,
29892,
13,
462,
462,
462,
1669,
8783,
29918,
25378,
29892,
376,
3945,
1159,
13,
13,
1678,
9066,
353,
426,
13,
4706,
376,
3051,
29899,
1853,
1115,
376,
726,
29914,
24595,
29936,
17425,
29922,
9420,
29899,
29947,
29908,
13,
1678,
500,
13,
13,
1678,
13304,
29889,
9573,
29918,
5338,
29898,
5696,
29892,
21333,
29892,
4660,
29918,
401,
29922,
5327,
29918,
401,
29892,
4390,
29922,
2587,
29892,
2769,
29922,
23147,
29892,
13,
462,
308,
9066,
29922,
13662,
29897,
13,
13,
13,
1753,
6230,
29918,
1025,
29918,
2754,
29918,
17640,
29898,
21412,
29892,
1158,
29892,
2933,
29892,
2933,
29918,
401,
29892,
2769,
543,
8949,
613,
13,
462,
539,
8783,
29918,
25378,
29922,
25832,
8127,
29911,
29918,
1367,
3919,
29902,
3738,
1001,
29892,
2793,
29918,
1853,
543,
3126,
29908,
1125,
13,
13,
1678,
2224,
353,
2897,
29889,
2084,
29889,
7122,
29898,
18267,
29918,
14573,
29918,
10145,
29892,
2933,
29897,
13,
1678,
411,
1722,
29898,
2084,
29892,
376,
29878,
1159,
408,
2933,
29918,
2587,
29901,
13,
4706,
1018,
29901,
13,
9651,
3573,
353,
4390,
29889,
1359,
29898,
5327,
29918,
2587,
29897,
13,
4706,
5174,
7865,
2392,
29901,
13,
9651,
3573,
353,
6213,
13,
13,
1678,
21333,
353,
29850,
29900,
1157,
29896,
1157,
29906,
6822,
29912,
29941,
1836,
29912,
29946,
29913,
1642,
4830,
29898,
15094,
25634,
29892,
11662,
29032,
29892,
438,
10249,
29918,
8787,
29918,
15094,
25634,
29892,
8783,
29918,
25378,
29892,
13,
462,
462,
268,
2793,
29918,
1853,
29897,
13,
13,
1678,
9066,
353,
426,
13,
4706,
376,
3051,
29899,
1853,
1115,
376,
6214,
29914,
3126,
29936,
17425,
29922,
9420,
29899,
29947,
29908,
13,
1678,
500,
13,
13,
1678,
13304,
29889,
9573,
29918,
5338,
29898,
5696,
29892,
21333,
29892,
4660,
29918,
401,
29922,
5327,
29918,
401,
29892,
4390,
29922,
2587,
29892,
2769,
29922,
23147,
29892,
13,
462,
308,
9066,
29922,
13662,
29897,
13,
13,
13,
1753,
6230,
29918,
17640,
29898,
21412,
29892,
1158,
29892,
2933,
29892,
2933,
29918,
401,
29892,
2769,
543,
8949,
613,
13,
1669,
8783,
29918,
25378,
29922,
25832,
8127,
29911,
29918,
1367,
3919,
29902,
3738,
1001,
29892,
2793,
29918,
1853,
543,
3126,
29908,
1125,
13,
13,
1678,
2224,
353,
2897,
29889,
2084,
29889,
7122,
29898,
18267,
29918,
14573,
29918,
10145,
29892,
2933,
29897,
13,
1678,
411,
1722,
29898,
2084,
29892,
376,
29878,
1159,
408,
2933,
29918,
2587,
29901,
13,
4706,
3573,
353,
4390,
29889,
1359,
29898,
5327,
29918,
2587,
29897,
13,
13,
1678,
565,
8783,
29918,
25378,
338,
6213,
29901,
29871,
396,
363,
1653,
16248,
13,
4706,
21333,
353,
29850,
29900,
1157,
29896,
1157,
29906,
1836,
29912,
29941,
29913,
1642,
4830,
29898,
15094,
25634,
29892,
11662,
29032,
29892,
438,
10249,
29918,
8787,
29918,
15094,
25634,
29892,
376,
3126,
1159,
13,
1678,
1683,
29901,
29871,
396,
1556,
4251,
13,
4706,
21333,
353,
29850,
29900,
1157,
29896,
1157,
29906,
1157,
29941,
1836,
29912,
29946,
29913,
1642,
4830,
29898,
15094,
25634,
29892,
11662,
29032,
29892,
22236,
29918,
8787,
29918,
15094,
25634,
29892,
8783,
29918,
25378,
29892,
13,
462,
462,
4706,
2793,
29918,
1853,
29897,
13,
13,
1678,
9066,
353,
426,
13,
4706,
376,
3051,
29899,
1853,
1115,
376,
6214,
29914,
3126,
29936,
17425,
29922,
9420,
29899,
29947,
29908,
13,
1678,
500,
13,
1678,
13304,
29889,
9573,
29918,
5338,
29898,
5696,
29892,
21333,
29892,
4660,
29918,
401,
29922,
5327,
29918,
401,
29892,
4390,
29922,
2587,
29892,
2769,
29922,
23147,
29892,
13,
462,
308,
9066,
29922,
13662,
29897,
13,
2
] |
src/vmshepherd/healthcheck/dummy_healthcheck.py | DreamLab/VmShepherd | 10 | 137372 | from .abstract import AbstractHealthcheck
class DummyHealthcheck(AbstractHealthcheck):
status = True
def __init__(self, config=None):
pass
async def is_healthy(self, vm):
return self.status
def set_status(self, healthy):
self.status = healthy
| [
1,
515,
869,
16595,
1053,
25513,
3868,
4298,
3198,
13,
13,
13,
1990,
360,
11770,
3868,
4298,
3198,
29898,
9118,
3868,
4298,
3198,
1125,
13,
1678,
4660,
353,
5852,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
2295,
29922,
8516,
1125,
13,
4706,
1209,
13,
13,
1678,
7465,
822,
338,
29918,
354,
4298,
29891,
29898,
1311,
29892,
22419,
1125,
13,
4706,
736,
1583,
29889,
4882,
13,
13,
1678,
822,
731,
29918,
4882,
29898,
1311,
29892,
9045,
29891,
1125,
13,
4706,
1583,
29889,
4882,
353,
9045,
29891,
13,
2
] |
darkweb/views/main.py | robopt/Capstone | 5 | 191120 | """
main.py
Handles all accessible URI's for flask
"""
from flask import Flask, render_template, request, g
from darkweb.modules.base.crawlerconfig import CrawlerConfig
from darkweb.modules.irc.irc import IRC
from darkweb.modules.web.WebCrawler import WebCrawler
from darkweb.modules.parser.search import search
from darkweb.modules.parser.parser import parser
import SocketServer
import threading
import datetime
import sys
from threading import Thread
from darkweb import app
"""
before_first
Initialize parser before first request is served.
"""
@app.before_first_request
def before_first():
print("views.py - init start")
HOST, PORT = "0.0.0.0", 4443
sserver = SocketServer.ThreadingTCPServer((HOST, PORT), parser)
Thread(target=sserver.serve_forever).start()
print("views.py - init end")
"""
addParam
Add a search term or a regular expression to the parser.
Future work: This code causes parser and website to be on same box.
Refactor to utilize connections to send terms to the parser.
"""
@app.route("/addParam", methods=["POST"])
def addParam():
# add new param
if request.form['addST']:
print("Adding searchterm")
st_terms = request.form['addST'].split(",")
# add new search term
for st in st_terms:
search().add_searchterm(st)
if request.form['addRE']:
re_terms = request.form['addRE'].split(",")
# add new regex
for re in re_terms:
search().add_searchterm(re)
print("Adding regularexpression")
result = readSearchFile()
msg = "Successfull added search parameters"
return render_template("index.html", result=result)
"""
clearParams
Remove all search terms from the parser.
Future work: This code causes parser and website to be on same box.
Refactor to utilize connections to send terms to the parser.
"""
@app.route("/clearParams", methods=["POST"])
def clearParams():
# clear all params
result = readSearchFile()
msg = "Successfull cleared search parameters"
return render_template("index.html", result=result)
"""
home (get)
Serve index page.
"""
@app.route("/", methods=["GET"])
def home():
result = readSearchFile()
return render_template("index.html", result=result)
"""
home (post)
Process a search
"""
@app.route("/", methods=["POST"])
def createCrawlerConfig():
print(str(request.form))
print("Post recieved.")
searchName = str(request.form['searchName'])
protocol = str(request.form['protocol']).lower()
print("Post parameters parsed.")
speed = str(request.form['speed'])
maxDepth = str(request.form['maxDepth'])
location = request.form['location']
options_input = str(request.form['options'])
options = makeOptionsDict(options_input)
config = CrawlerConfig(location, protocol, speed, maxDepth, searchName, options)
msg = "Search \"" + searchName + "\" started."
crawler = None
search_params = None
if searchName == "":
msg = "Search failed. Search must be given a name."
elif location == "":
msg = "Search failed. Must give a search location."
elif protocol == "irc":
crawler = IRC(config)
elif protocol == "tor" or protocol == "web":
if not speed.isdigit():
msg = "Search falied. Speed much be an integer."
elif not maxDepth.isdigit():
msg = "Search failed. Max Crawl Depth must be an integer."
crawler = WebCrawler(config)
else:
msg = "Search failed invalid protocol.\nMust be TOR, IRC, or web"
if(crawler):
run_crawl(crawler)
search_params = [("Search Name", searchName), ("Protocol", protocol), ("Speed", speed), ("Max Depth", maxDepth), ("Location", location)]
for label, val in options.iteritems():
search_params.append((label, val))
result = readSearchFile()
return render_template("index.html", msg=msg, search_params=search_params, result=result)
"""
readSearchFile
read from /tmp/searches.txt and return list of 5 lines
"""
def readSearchFile():
result = []
i = 0
with open("/tmp/searches.txt", "r") as f:
for line in f:
if(i >= 5):
break
result.append(line)
i += 1
return result
"""
writeSearchFile
Writes to file in /tmp the datetime a search was started
"""
def writeSearchFile(searchName):
with open("/tmp/searches.txt", "a") as f:
out_string = "\"" + searchName + "\": " + datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') + "\n"
f.write(out_string)
return
"""
run_crawl
Run the specified cralwer
Call do crawl in new thread
"""
def run_crawl(crawler, args=None):
#t = threading.Thread(target=crawler.doCrawl, args=(args, ))
t = threading.Thread(target=crawler.doCrawl)
t.start()
writeSearchFile(crawler.config.name)
return
"""
makeOptionsDict
format options string from form and create options dict for crawlerconfig
returns options dict
"""
def makeOptionsDict(options_input):
options = {}
split_input = options_input.split(',')
for s in split_input:
s = s.replace(" ", "")
o = s.split(':')
if len(o) == 2:
options[o[0]] = o[1]
return options
| [
1,
9995,
13,
3396,
29889,
2272,
13,
3481,
793,
599,
15579,
23539,
29915,
29879,
363,
29784,
13,
15945,
29908,
13,
3166,
29784,
1053,
2379,
1278,
29892,
4050,
29918,
6886,
29892,
2009,
29892,
330,
13,
3166,
6501,
2676,
29889,
7576,
29889,
3188,
29889,
29883,
1610,
1358,
2917,
1053,
315,
1610,
1358,
3991,
13,
3166,
6501,
2676,
29889,
7576,
29889,
2076,
29889,
2076,
1053,
306,
10363,
13,
3166,
6501,
2676,
29889,
7576,
29889,
2676,
29889,
3609,
29907,
1610,
1358,
1053,
2563,
29907,
1610,
1358,
13,
3166,
6501,
2676,
29889,
7576,
29889,
16680,
29889,
4478,
1053,
2740,
13,
3166,
6501,
2676,
29889,
7576,
29889,
16680,
29889,
16680,
1053,
13812,
13,
5215,
29141,
6004,
13,
5215,
3244,
292,
13,
5215,
12865,
13,
5215,
10876,
13,
3166,
3244,
292,
1053,
10480,
13,
3166,
6501,
2676,
1053,
623,
13,
13,
13,
15945,
29908,
13,
11083,
29918,
4102,
13,
6644,
6646,
13812,
1434,
937,
2009,
338,
6766,
29889,
13,
15945,
29908,
13,
29992,
932,
29889,
11083,
29918,
4102,
29918,
3827,
13,
1753,
1434,
29918,
4102,
7295,
13,
1678,
1596,
703,
7406,
29889,
2272,
448,
2069,
1369,
1159,
13,
1678,
379,
3718,
29892,
349,
8476,
353,
376,
29900,
29889,
29900,
29889,
29900,
29889,
29900,
613,
29871,
29946,
29946,
29946,
29941,
13,
1678,
269,
2974,
353,
29141,
6004,
29889,
4899,
292,
29911,
6271,
6004,
3552,
20832,
29892,
349,
8476,
511,
13812,
29897,
13,
1678,
10480,
29898,
5182,
29922,
29879,
2974,
29889,
16349,
29918,
1079,
369,
467,
2962,
580,
13,
1678,
1596,
703,
7406,
29889,
2272,
448,
2069,
1095,
1159,
13,
13,
15945,
29908,
13,
1202,
4736,
13,
2528,
263,
2740,
1840,
470,
263,
4943,
4603,
304,
278,
13812,
29889,
13,
20154,
664,
29901,
910,
775,
9946,
13812,
322,
4700,
304,
367,
373,
1021,
3800,
29889,
13,
632,
9897,
7168,
304,
3667,
675,
12368,
304,
3638,
4958,
304,
278,
13812,
29889,
13,
15945,
29908,
13,
29992,
932,
29889,
13134,
11974,
1202,
4736,
613,
3519,
29922,
3366,
5438,
20068,
13,
1753,
788,
4736,
7295,
13,
1678,
396,
788,
716,
1828,
13,
1678,
565,
2009,
29889,
689,
1839,
1202,
1254,
2033,
29901,
13,
4706,
1596,
703,
2528,
292,
2740,
8489,
1159,
13,
12,
303,
29918,
357,
1516,
353,
2009,
29889,
689,
1839,
1202,
1254,
13359,
5451,
28165,
1159,
13,
1678,
396,
788,
716,
2740,
1840,
13,
12,
1454,
380,
297,
380,
29918,
357,
1516,
29901,
13,
12,
12,
4478,
2141,
1202,
29918,
4478,
8489,
29898,
303,
29897,
13,
1678,
565,
2009,
29889,
689,
1839,
1202,
1525,
2033,
29901,
13,
12,
276,
29918,
357,
1516,
353,
2009,
29889,
689,
1839,
1202,
1525,
13359,
5451,
28165,
1159,
13,
1678,
396,
788,
716,
6528,
13,
12,
1454,
337,
297,
337,
29918,
357,
1516,
29901,
13,
12,
12,
4478,
2141,
1202,
29918,
4478,
8489,
29898,
276,
29897,
13,
4706,
1596,
703,
2528,
292,
24378,
598,
29916,
2590,
1159,
13,
1678,
1121,
353,
1303,
7974,
2283,
580,
13,
1678,
10191,
353,
376,
14191,
8159,
2715,
2740,
4128,
29908,
13,
1678,
736,
4050,
29918,
6886,
703,
2248,
29889,
1420,
613,
1121,
29922,
2914,
29897,
13,
13,
15945,
29908,
13,
8551,
9629,
13,
15941,
599,
2740,
4958,
515,
278,
13812,
29889,
13,
20154,
664,
29901,
910,
775,
9946,
13812,
322,
4700,
304,
367,
373,
1021,
3800,
29889,
13,
632,
9897,
7168,
304,
3667,
675,
12368,
304,
3638,
4958,
304,
278,
13812,
29889,
13,
15945,
29908,
13,
29992,
932,
29889,
13134,
11974,
8551,
9629,
613,
3519,
29922,
3366,
5438,
20068,
13,
1753,
2821,
9629,
7295,
13,
1678,
396,
2821,
599,
8636,
13,
1678,
1121,
353,
1303,
7974,
2283,
580,
13,
1678,
10191,
353,
376,
14191,
8159,
24639,
2740,
4128,
29908,
13,
1678,
736,
4050,
29918,
6886,
703,
2248,
29889,
1420,
613,
1121,
29922,
2914,
29897,
13,
13,
15945,
29908,
13,
5184,
313,
657,
29897,
13,
1748,
345,
2380,
1813,
29889,
13,
15945,
29908,
13,
29992,
932,
29889,
13134,
11974,
613,
3519,
29922,
3366,
7194,
20068,
13,
1753,
3271,
7295,
13,
1678,
1121,
353,
1303,
7974,
2283,
580,
13,
1678,
736,
4050,
29918,
6886,
703,
2248,
29889,
1420,
613,
1121,
29922,
2914,
29897,
13,
13,
15945,
29908,
13,
5184,
313,
2490,
29897,
13,
7032,
263,
2740,
13,
15945,
29908,
13,
29992,
932,
29889,
13134,
11974,
613,
3519,
29922,
3366,
5438,
20068,
13,
1753,
1653,
29907,
1610,
1358,
3991,
7295,
13,
1678,
1596,
29898,
710,
29898,
3827,
29889,
689,
876,
13,
1678,
1596,
703,
6747,
1162,
6402,
23157,
13,
1678,
2740,
1170,
353,
851,
29898,
3827,
29889,
689,
1839,
4478,
1170,
11287,
13,
1678,
9608,
353,
851,
29898,
3827,
29889,
689,
1839,
20464,
2033,
467,
13609,
580,
13,
1678,
1596,
703,
6747,
4128,
21213,
23157,
13,
1678,
6210,
353,
851,
29898,
3827,
29889,
689,
1839,
19322,
11287,
13,
1678,
4236,
8498,
386,
353,
851,
29898,
3827,
29889,
689,
1839,
3317,
8498,
386,
11287,
13,
1678,
4423,
29871,
353,
2009,
29889,
689,
1839,
5479,
2033,
13,
1678,
3987,
29918,
2080,
353,
851,
29898,
3827,
29889,
689,
1839,
6768,
11287,
13,
1678,
3987,
353,
1207,
5856,
21533,
29898,
6768,
29918,
2080,
29897,
13,
1678,
2295,
353,
315,
1610,
1358,
3991,
29898,
5479,
29892,
9608,
29892,
6210,
29892,
4236,
8498,
386,
29892,
2740,
1170,
29892,
3987,
29897,
13,
13,
1678,
10191,
353,
376,
7974,
13218,
29908,
718,
2740,
1170,
718,
376,
5931,
4687,
1213,
13,
1678,
29349,
1358,
353,
6213,
13,
1678,
2740,
29918,
7529,
353,
6213,
13,
1678,
565,
2740,
1170,
1275,
376,
1115,
13,
4706,
10191,
353,
376,
7974,
5229,
29889,
11856,
1818,
367,
2183,
263,
1024,
1213,
13,
1678,
25342,
4423,
1275,
376,
1115,
13,
4706,
10191,
353,
376,
7974,
5229,
29889,
19928,
2367,
263,
2740,
4423,
1213,
13,
1678,
25342,
9608,
1275,
376,
2076,
1115,
13,
4706,
29349,
1358,
353,
306,
10363,
29898,
2917,
29897,
13,
1678,
25342,
9608,
1275,
376,
7345,
29908,
470,
9608,
1275,
376,
2676,
1115,
13,
4706,
565,
451,
6210,
29889,
275,
26204,
7295,
13,
9651,
10191,
353,
376,
7974,
11092,
1000,
29889,
24839,
1568,
367,
385,
6043,
1213,
13,
4706,
25342,
451,
4236,
8498,
386,
29889,
275,
26204,
7295,
13,
9651,
10191,
353,
376,
7974,
5229,
29889,
5918,
315,
1610,
29880,
10034,
386,
1818,
367,
385,
6043,
1213,
13,
4706,
29349,
1358,
353,
2563,
29907,
1610,
1358,
29898,
2917,
29897,
13,
1678,
1683,
29901,
13,
4706,
10191,
353,
376,
7974,
5229,
8340,
9608,
7790,
29876,
29924,
504,
367,
323,
1955,
29892,
306,
10363,
29892,
470,
1856,
29908,
13,
1678,
565,
29898,
29883,
1610,
1358,
1125,
13,
4706,
1065,
29918,
29883,
1610,
29880,
29898,
29883,
1610,
1358,
29897,
13,
4706,
2740,
29918,
7529,
353,
518,
703,
7974,
4408,
613,
2740,
1170,
511,
4852,
17830,
613,
9608,
511,
4852,
26539,
613,
6210,
511,
4852,
7976,
10034,
386,
613,
4236,
8498,
386,
511,
4852,
6508,
613,
4423,
4638,
13,
4706,
363,
3858,
29892,
659,
297,
3987,
29889,
1524,
7076,
7295,
13,
9651,
2740,
29918,
7529,
29889,
4397,
3552,
1643,
29892,
659,
876,
13,
1678,
1121,
353,
1303,
7974,
2283,
580,
13,
1678,
736,
4050,
29918,
6886,
703,
2248,
29889,
1420,
613,
10191,
29922,
7645,
29892,
2740,
29918,
7529,
29922,
4478,
29918,
7529,
29892,
1121,
29922,
2914,
29897,
13,
13,
13,
15945,
29908,
13,
949,
7974,
2283,
13,
949,
515,
847,
7050,
29914,
4478,
267,
29889,
3945,
322,
736,
1051,
310,
29871,
29945,
3454,
13,
15945,
29908,
13,
1753,
1303,
7974,
2283,
7295,
13,
1678,
1121,
353,
5159,
13,
1678,
474,
353,
29871,
29900,
13,
1678,
411,
1722,
11974,
7050,
29914,
4478,
267,
29889,
3945,
613,
376,
29878,
1159,
408,
285,
29901,
13,
4706,
363,
1196,
297,
285,
29901,
13,
9651,
565,
29898,
29875,
6736,
29871,
29945,
1125,
13,
18884,
2867,
13,
9651,
1121,
29889,
4397,
29898,
1220,
29897,
13,
9651,
474,
4619,
29871,
29896,
13,
1678,
736,
1121,
13,
13,
15945,
29908,
13,
3539,
7974,
2283,
13,
29956,
768,
267,
304,
934,
297,
847,
7050,
278,
12865,
263,
2740,
471,
4687,
13,
15945,
29908,
13,
1753,
2436,
7974,
2283,
29898,
4478,
1170,
1125,
13,
1678,
411,
1722,
11974,
7050,
29914,
4478,
267,
29889,
3945,
613,
376,
29874,
1159,
408,
285,
29901,
13,
4706,
714,
29918,
1807,
353,
376,
5931,
29908,
718,
2740,
1170,
718,
6634,
1115,
376,
718,
12865,
29889,
12673,
29889,
3707,
2141,
710,
615,
603,
877,
29995,
29979,
19222,
29885,
19222,
29881,
1273,
29950,
16664,
29924,
16664,
29903,
1495,
718,
6634,
29876,
29908,
13,
4706,
285,
29889,
3539,
29898,
449,
29918,
1807,
29897,
13,
1678,
736,
13,
13,
13,
15945,
29908,
13,
3389,
29918,
29883,
1610,
29880,
13,
6558,
278,
6790,
274,
1705,
556,
13,
5594,
437,
29349,
29880,
297,
716,
3244,
13,
15945,
29908,
13,
1753,
1065,
29918,
29883,
1610,
29880,
29898,
29883,
1610,
1358,
29892,
6389,
29922,
8516,
1125,
13,
1678,
396,
29873,
353,
3244,
292,
29889,
4899,
29898,
5182,
29922,
29883,
1610,
1358,
29889,
1867,
29907,
1610,
29880,
29892,
6389,
7607,
5085,
29892,
29871,
876,
13,
1678,
260,
353,
3244,
292,
29889,
4899,
29898,
5182,
29922,
29883,
1610,
1358,
29889,
1867,
29907,
1610,
29880,
29897,
13,
1678,
260,
29889,
2962,
580,
13,
1678,
2436,
7974,
2283,
29898,
29883,
1610,
1358,
29889,
2917,
29889,
978,
29897,
13,
1678,
736,
13,
13,
15945,
29908,
13,
5675,
5856,
21533,
13,
4830,
3987,
1347,
515,
883,
322,
1653,
3987,
9657,
363,
29349,
1358,
2917,
13,
18280,
3987,
9657,
13,
15945,
29908,
13,
1753,
1207,
5856,
21533,
29898,
6768,
29918,
2080,
1125,
13,
1678,
3987,
353,
6571,
13,
1678,
6219,
29918,
2080,
353,
3987,
29918,
2080,
29889,
5451,
29317,
1495,
13,
1678,
363,
269,
297,
6219,
29918,
2080,
29901,
13,
4706,
269,
353,
269,
29889,
6506,
703,
9162,
20569,
13,
4706,
288,
353,
269,
29889,
5451,
877,
29901,
1495,
13,
4706,
565,
7431,
29898,
29877,
29897,
1275,
29871,
29906,
29901,
13,
9651,
3987,
29961,
29877,
29961,
29900,
5262,
353,
288,
29961,
29896,
29962,
13,
1678,
736,
3987,
13,
2
] |
scripts/list_ports.py | nnarain/ftl | 0 | 182395 | import os
import serial
def get_serial_port_iterator():
try:
if os.name == 'nt':
from serial.tools.list_ports_windows import comports
return comports
elif os.name == 'posix':
from serial.tools.list_ports_posix import comports
return comports
else:
raise ImportError('No serial implementation for this platform found')
except ImportError as e:
return None
for (port, _, _) in get_serial_port_iterator()():
print(port)
| [
1,
1053,
2897,
13,
5215,
7797,
13,
13,
1753,
679,
29918,
15550,
29918,
637,
29918,
17609,
7295,
13,
1678,
1018,
29901,
13,
4706,
565,
2897,
29889,
978,
1275,
525,
593,
2396,
13,
9651,
515,
7797,
29889,
8504,
29889,
1761,
29918,
4011,
29918,
10499,
1053,
419,
4011,
13,
9651,
736,
419,
4011,
13,
4706,
25342,
2897,
29889,
978,
1275,
525,
1066,
861,
2396,
13,
9651,
515,
7797,
29889,
8504,
29889,
1761,
29918,
4011,
29918,
1066,
861,
1053,
419,
4011,
13,
9651,
736,
419,
4011,
13,
4706,
1683,
29901,
13,
9651,
12020,
16032,
2392,
877,
3782,
7797,
5314,
363,
445,
7481,
1476,
1495,
13,
1678,
5174,
16032,
2392,
408,
321,
29901,
13,
4706,
736,
6213,
13,
13,
1454,
313,
637,
29892,
17117,
24459,
297,
679,
29918,
15550,
29918,
637,
29918,
17609,
580,
7295,
13,
1678,
1596,
29898,
637,
29897,
13,
2
] |
testproject/settings.py | Instawork/django-log-request-id | 1 | 84421 | <filename>testproject/settings.py
from django.conf import global_settings
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
},
}
DEBUG = True
SECRET_KEY = 'secret'
ROOT_URLCONF = "testproject.urls"
INSTALLED_APPS = ["log_request_id"]
MIDDLEWARE_CLASSES = [
'log_request_id.middleware.RequestIDMiddleware',
# ... other middleware goes here
] + list(global_settings.MIDDLEWARE_CLASSES)
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
'request_id': {
'()': 'log_request_id.filters.RequestIDFilter'
}
},
'formatters': {
'standard': {
'format': '%(levelname)-8s [%(asctime)s] [%(request_id)s] %(name)s: %(message)s'
},
},
'handlers': {
'mock': {
'level': 'DEBUG',
'class': 'testproject.handler.MockLoggingHandler',
'filters': ['request_id'],
'formatter': 'standard',
},
},
'loggers': {
'testproject': {
'handlers': ['mock'],
'level': 'DEBUG',
'propagate': False,
},
'log_request_id.middleware': {
'handlers': ['mock'],
'level': 'DEBUG',
'propagate': False,
},
}
}
| [
1,
529,
9507,
29958,
1688,
4836,
29914,
11027,
29889,
2272,
13,
3166,
9557,
29889,
5527,
1053,
5534,
29918,
11027,
13,
13,
25832,
27982,
29903,
353,
426,
13,
1678,
525,
4381,
2396,
426,
13,
4706,
525,
1430,
29954,
8895,
2396,
525,
14095,
29889,
2585,
29889,
1627,
1975,
29889,
22793,
29941,
742,
13,
4706,
525,
5813,
2396,
525,
29901,
14834,
29901,
742,
13,
1678,
2981,
13,
29913,
13,
13,
18525,
353,
5852,
13,
13,
1660,
22245,
29911,
29918,
10818,
353,
525,
19024,
29915,
13,
13,
21289,
29918,
4219,
6007,
29943,
353,
376,
1688,
4836,
29889,
26045,
29908,
13,
13,
25580,
1964,
20566,
29918,
3301,
7024,
353,
6796,
1188,
29918,
3827,
29918,
333,
3108,
13,
13,
29924,
1367,
29928,
1307,
12982,
1525,
29918,
6154,
3289,
1660,
29903,
353,
518,
13,
1678,
525,
1188,
29918,
3827,
29918,
333,
29889,
17662,
2519,
29889,
3089,
1367,
25411,
2519,
742,
13,
1678,
396,
2023,
916,
7256,
2519,
5771,
1244,
13,
29962,
718,
1051,
29898,
10945,
29918,
11027,
29889,
29924,
1367,
29928,
1307,
12982,
1525,
29918,
6154,
3289,
1660,
29903,
29897,
13,
13,
14480,
29954,
4214,
353,
426,
13,
1678,
525,
3259,
2396,
29871,
29896,
29892,
13,
1678,
525,
20472,
29918,
735,
15423,
29918,
1188,
5743,
2396,
7700,
29892,
13,
1678,
525,
26705,
2396,
426,
13,
4706,
525,
3827,
29918,
333,
2396,
426,
13,
9651,
525,
580,
2396,
525,
1188,
29918,
3827,
29918,
333,
29889,
26705,
29889,
3089,
1367,
5072,
29915,
13,
4706,
500,
13,
1678,
2981,
13,
1678,
525,
4830,
2153,
2396,
426,
13,
4706,
525,
15770,
2396,
426,
13,
9651,
525,
4830,
2396,
14210,
29898,
5563,
978,
6817,
29947,
29879,
518,
29995,
29898,
294,
312,
603,
29897,
29879,
29962,
518,
29995,
29898,
3827,
29918,
333,
29897,
29879,
29962,
1273,
29898,
978,
29897,
29879,
29901,
1273,
29898,
4906,
29897,
29879,
29915,
13,
4706,
2981,
13,
1678,
2981,
13,
1678,
525,
3179,
9306,
2396,
426,
13,
4706,
525,
17640,
2396,
426,
13,
9651,
525,
5563,
2396,
525,
18525,
742,
13,
9651,
525,
1990,
2396,
525,
1688,
4836,
29889,
13789,
29889,
18680,
3403,
3460,
4598,
742,
13,
9651,
525,
26705,
2396,
6024,
3827,
29918,
333,
7464,
13,
9651,
525,
689,
2620,
2396,
525,
15770,
742,
13,
4706,
2981,
13,
1678,
2981,
13,
1678,
525,
1188,
5743,
2396,
426,
13,
4706,
525,
1688,
4836,
2396,
426,
13,
9651,
525,
3179,
9306,
2396,
6024,
17640,
7464,
13,
9651,
525,
5563,
2396,
525,
18525,
742,
13,
9651,
525,
7728,
351,
403,
2396,
7700,
29892,
13,
4706,
2981,
13,
4706,
525,
1188,
29918,
3827,
29918,
333,
29889,
17662,
2519,
2396,
426,
13,
9651,
525,
3179,
9306,
2396,
6024,
17640,
7464,
13,
9651,
525,
5563,
2396,
525,
18525,
742,
13,
9651,
525,
7728,
351,
403,
2396,
7700,
29892,
13,
4706,
2981,
13,
1678,
500,
13,
29913,
13,
2
] |
Findclone/aiofindclone.py | vypivshiy/Findclone_api | 5 | 13538 | from aiohttp import ClientSession, FormData
from Findclone import __version__
from .models import Account, Profiles, Histories, get_builder
from .utils import random_string, paint_boxes
from .exceptions import a_error_handler, FindcloneError
from io import BufferedReader, BytesIO
class FindcloneAsync:
"""async findclone api class
Attributes:
headers : dict - set requests headers
"""
def __init__(self):
self._session = ClientSession()
self.headers = {"User-Agent": f"findclone-api/{__version__}"}
self.__builder = get_builder().build_aio_response
self._session_key = None
self._userid = None
self.__info = None
async def login(self,
login: [str, None] = None,
password: [str, None] = None,
session_key: [str, None] = None,
userid: [str, int, None] = None) -> bool:
"""
*coro
Findclone authorisation
:param login: account login
:param password: account password
:param session_key: account session_key
:param userid: account userid
:return: True is auth success
"""
if login and password:
async with self._session.post("https://findclone.ru/login", data={"phone": login,
"password": password}) as response:
await a_error_handler(response)
resp = await response.json()
self.__info = await self.__builder(response)
self._session_key = resp["session_key"]
self._userid = resp["userid"]
self.headers.update({'session-key': self._session_key, 'user-id': str(self._userid)})
return True
elif session_key and userid:
self.headers.update({"session-key": session_key, "user-id": str(userid)})
async with self._session.get("https://findclone.ru/profile", headers=self.headers) as response:
await a_error_handler(response)
self.__info = await self.__builder(response)
self._session_key = session_key
self._userid = userid
return True
else:
raise FindcloneError("Need login and password or session-key and _userid")
@property
async def info(self) -> Account:
"""
*coro
return account information
:return: Account object
"""
async with self._session.get("https://findclone.ru/profile", headers=self.headers) as response:
info = await self.__builder(response)
self.__info = info
return info
async def upload(self,
file: [str, BufferedReader],
face_box_id: int = None,
timeout: float = 180) -> [Profiles, BytesIO]:
"""
*coro
upload image or image url and return Profiles object or BytesIO object
:param file: image direct download link or path
:param face_box_id: OPTIONAL, send facebox id if 2 or more faces are detected
:param timeout: OPTIONAL - max timeout delay
:return: Profiles object or BytesIO if 2 or more faces are detected
"""
data = FormData()
if file.startswith("http"):
async with self._session.get(file, headers=self.headers) as response:
file = await response.read()
data.add_field("uploaded_photo", file, filename=f"{random_string()}.png", content_type="image/png")
else:
data.add_field("uploaded_photo", open(file, "rb"), filename=f"{random_string()}.png",
content_type="image/png")
async with self._session.post("https://findclone.ru/upload2", data=data, headers=self.headers,
timeout=timeout) as response:
resp = await response.json()
if resp.get("faceBoxes"):
if face_box_id is not None:
async with self._session.get("https://findclone.ru/upload3", params={"id": face_box_id},
headers=self.headers) as response2:
resp = await self.__builder(response2)
return resp
else:
img_bytes = paint_boxes(file, resp) # return bytesIO object
return img_bytes
resp = await self.__builder(response)
return resp
async def history(self, offset: int = 0, count: int = 100) -> Histories:
"""
*coro
return object histories search for account
:param offset: int
:param count: int
:return: Histories object
"""
async with self._session.get("https://findclone.ru/hist", params={"offset": offset, "count": count},
headers=self.headers) as response:
history = await self.__builder(response)
return history
async def search(self, search_id: [int, str], count: int = 128) -> Profiles:
"""
*coro
:param search_id: [int, str] search id
:param count: [int] max Profiles count get
:return: Profiles object
"""
async with self._session.get("https://findclone.ru/search", params={"id": search_id, "count": count},
headers=self.headers) as response:
search_result = await self.__builder(response)
return search_result
@property
def get_session(self) -> dict:
"""
property
return session-key and _userid account
:return: dict {"session-key": session_key, "user-id": userid}
"""
_session = {"session-key": self._session_key, "user-id": self._userid}
return _session
def __str__(self):
return self.__info.__str__()
async def __aenter__(self) -> 'FindcloneAsync':
return self
async def __aexit__(self, exc_type, exc_val, exc_tb) -> None:
await self._session.close()
async def close(self) -> None:
await self._session.close()
| [
1,
515,
263,
601,
1124,
1053,
12477,
7317,
29892,
3812,
1469,
13,
13,
3166,
10987,
16513,
1053,
4770,
3259,
1649,
13,
3166,
869,
9794,
1053,
16535,
29892,
1019,
5325,
29892,
4731,
583,
29892,
679,
29918,
16409,
13,
3166,
869,
13239,
1053,
4036,
29918,
1807,
29892,
10675,
29918,
1884,
267,
13,
3166,
869,
11739,
29879,
1053,
263,
29918,
2704,
29918,
13789,
29892,
10987,
16513,
2392,
13,
3166,
12013,
1053,
22217,
6982,
29892,
2648,
2167,
5971,
13,
13,
13,
1990,
10987,
16513,
8123,
29901,
13,
1678,
9995,
12674,
1284,
16513,
7882,
770,
13,
1678,
6212,
5026,
29901,
13,
4706,
9066,
584,
9657,
448,
731,
7274,
9066,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
1583,
3032,
7924,
353,
12477,
7317,
580,
13,
4706,
1583,
29889,
13662,
353,
8853,
2659,
29899,
19661,
1115,
285,
29908,
2886,
16513,
29899,
2754,
19248,
1649,
3259,
1649,
5038,
29913,
13,
4706,
1583,
17255,
16409,
353,
679,
29918,
16409,
2141,
4282,
29918,
29874,
601,
29918,
5327,
13,
4706,
1583,
3032,
7924,
29918,
1989,
353,
6213,
13,
4706,
1583,
3032,
1792,
333,
353,
6213,
13,
4706,
1583,
17255,
3888,
353,
6213,
13,
13,
1678,
7465,
822,
6464,
29898,
1311,
29892,
13,
462,
1678,
6464,
29901,
518,
710,
29892,
6213,
29962,
353,
6213,
29892,
13,
462,
1678,
4800,
29901,
518,
710,
29892,
6213,
29962,
353,
6213,
29892,
13,
462,
1678,
4867,
29918,
1989,
29901,
518,
710,
29892,
6213,
29962,
353,
6213,
29892,
13,
462,
1678,
1404,
333,
29901,
518,
710,
29892,
938,
29892,
6213,
29962,
353,
6213,
29897,
1599,
6120,
29901,
13,
4706,
9995,
13,
4706,
334,
2616,
29877,
13,
4706,
10987,
16513,
4148,
4371,
13,
9651,
584,
3207,
6464,
29901,
3633,
6464,
13,
9651,
584,
3207,
4800,
29901,
3633,
4800,
13,
9651,
584,
3207,
4867,
29918,
1989,
29901,
3633,
4867,
29918,
1989,
13,
9651,
584,
3207,
1404,
333,
29901,
3633,
1404,
333,
13,
4706,
584,
2457,
29901,
5852,
338,
4817,
2551,
13,
4706,
9995,
13,
4706,
565,
6464,
322,
4800,
29901,
13,
9651,
7465,
411,
1583,
3032,
7924,
29889,
2490,
703,
991,
597,
2886,
16513,
29889,
582,
29914,
7507,
613,
848,
3790,
29908,
6710,
1115,
6464,
29892,
13,
462,
462,
462,
462,
795,
376,
5630,
1115,
4800,
1800,
408,
2933,
29901,
13,
18884,
7272,
263,
29918,
2704,
29918,
13789,
29898,
5327,
29897,
13,
18884,
4613,
353,
7272,
2933,
29889,
3126,
580,
13,
18884,
1583,
17255,
3888,
353,
7272,
1583,
17255,
16409,
29898,
5327,
29897,
13,
18884,
1583,
3032,
7924,
29918,
1989,
353,
4613,
3366,
7924,
29918,
1989,
3108,
13,
18884,
1583,
3032,
1792,
333,
353,
4613,
3366,
1792,
333,
3108,
13,
18884,
1583,
29889,
13662,
29889,
5504,
3319,
29915,
7924,
29899,
1989,
2396,
1583,
3032,
7924,
29918,
1989,
29892,
525,
1792,
29899,
333,
2396,
851,
29898,
1311,
3032,
1792,
333,
26972,
13,
18884,
736,
5852,
13,
4706,
25342,
4867,
29918,
1989,
322,
1404,
333,
29901,
13,
9651,
1583,
29889,
13662,
29889,
5504,
3319,
29908,
7924,
29899,
1989,
1115,
4867,
29918,
1989,
29892,
376,
1792,
29899,
333,
1115,
851,
29898,
1792,
333,
26972,
13,
9651,
7465,
411,
1583,
3032,
7924,
29889,
657,
703,
991,
597,
2886,
16513,
29889,
582,
29914,
10185,
613,
9066,
29922,
1311,
29889,
13662,
29897,
408,
2933,
29901,
13,
18884,
7272,
263,
29918,
2704,
29918,
13789,
29898,
5327,
29897,
13,
18884,
1583,
17255,
3888,
353,
7272,
1583,
17255,
16409,
29898,
5327,
29897,
13,
18884,
1583,
3032,
7924,
29918,
1989,
353,
4867,
29918,
1989,
13,
18884,
1583,
3032,
1792,
333,
353,
1404,
333,
13,
18884,
736,
5852,
13,
4706,
1683,
29901,
13,
9651,
12020,
10987,
16513,
2392,
703,
8139,
287,
6464,
322,
4800,
470,
4867,
29899,
1989,
322,
903,
1792,
333,
1159,
13,
13,
1678,
732,
6799,
13,
1678,
7465,
822,
5235,
29898,
1311,
29897,
1599,
16535,
29901,
13,
4706,
9995,
13,
4706,
334,
2616,
29877,
13,
4706,
736,
3633,
2472,
13,
4706,
584,
2457,
29901,
16535,
1203,
13,
4706,
9995,
13,
4706,
7465,
411,
1583,
3032,
7924,
29889,
657,
703,
991,
597,
2886,
16513,
29889,
582,
29914,
10185,
613,
9066,
29922,
1311,
29889,
13662,
29897,
408,
2933,
29901,
13,
9651,
5235,
353,
7272,
1583,
17255,
16409,
29898,
5327,
29897,
13,
9651,
1583,
17255,
3888,
353,
5235,
13,
4706,
736,
5235,
13,
13,
1678,
7465,
822,
6441,
29898,
1311,
29892,
13,
462,
268,
934,
29901,
518,
710,
29892,
22217,
6982,
1402,
13,
462,
268,
3700,
29918,
1884,
29918,
333,
29901,
938,
353,
6213,
29892,
13,
462,
268,
11815,
29901,
5785,
353,
29871,
29896,
29947,
29900,
29897,
1599,
518,
1184,
5325,
29892,
2648,
2167,
5971,
5387,
13,
4706,
9995,
13,
4706,
334,
2616,
29877,
13,
4706,
6441,
1967,
470,
1967,
3142,
322,
736,
1019,
5325,
1203,
470,
2648,
2167,
5971,
1203,
13,
4706,
584,
3207,
934,
29901,
1967,
1513,
5142,
1544,
470,
2224,
13,
4706,
584,
3207,
3700,
29918,
1884,
29918,
333,
29901,
6418,
29911,
2725,
1964,
29892,
3638,
3700,
1884,
1178,
565,
29871,
29906,
470,
901,
17240,
526,
17809,
13,
4706,
584,
3207,
11815,
29901,
6418,
29911,
2725,
1964,
448,
4236,
11815,
9055,
13,
4706,
584,
2457,
29901,
1019,
5325,
1203,
470,
2648,
2167,
5971,
565,
29871,
29906,
470,
901,
17240,
526,
17809,
13,
4706,
9995,
13,
4706,
848,
353,
3812,
1469,
580,
13,
4706,
565,
934,
29889,
27382,
2541,
703,
1124,
29908,
1125,
13,
9651,
7465,
411,
1583,
3032,
7924,
29889,
657,
29898,
1445,
29892,
9066,
29922,
1311,
29889,
13662,
29897,
408,
2933,
29901,
13,
18884,
934,
353,
7272,
2933,
29889,
949,
580,
13,
18884,
848,
29889,
1202,
29918,
2671,
703,
9009,
287,
29918,
21596,
613,
934,
29892,
10422,
29922,
29888,
29908,
29912,
8172,
29918,
1807,
580,
1836,
2732,
613,
2793,
29918,
1853,
543,
3027,
29914,
2732,
1159,
13,
4706,
1683,
29901,
13,
9651,
848,
29889,
1202,
29918,
2671,
703,
9009,
287,
29918,
21596,
613,
1722,
29898,
1445,
29892,
376,
6050,
4968,
10422,
29922,
29888,
29908,
29912,
8172,
29918,
1807,
580,
1836,
2732,
613,
13,
462,
965,
2793,
29918,
1853,
543,
3027,
29914,
2732,
1159,
13,
13,
4706,
7465,
411,
1583,
3032,
7924,
29889,
2490,
703,
991,
597,
2886,
16513,
29889,
582,
29914,
9009,
29906,
613,
848,
29922,
1272,
29892,
9066,
29922,
1311,
29889,
13662,
29892,
13,
462,
462,
418,
11815,
29922,
15619,
29897,
408,
2933,
29901,
13,
9651,
4613,
353,
7272,
2933,
29889,
3126,
580,
13,
9651,
565,
4613,
29889,
657,
703,
2161,
3313,
267,
29908,
1125,
13,
18884,
565,
3700,
29918,
1884,
29918,
333,
338,
451,
6213,
29901,
13,
462,
1678,
7465,
411,
1583,
3032,
7924,
29889,
657,
703,
991,
597,
2886,
16513,
29889,
582,
29914,
9009,
29941,
613,
8636,
3790,
29908,
333,
1115,
3700,
29918,
1884,
29918,
333,
1118,
13,
462,
462,
462,
9066,
29922,
1311,
29889,
13662,
29897,
408,
2933,
29906,
29901,
13,
462,
4706,
4613,
353,
7272,
1583,
17255,
16409,
29898,
5327,
29906,
29897,
13,
462,
4706,
736,
4613,
13,
18884,
1683,
29901,
13,
462,
1678,
10153,
29918,
13193,
353,
10675,
29918,
1884,
267,
29898,
1445,
29892,
4613,
29897,
29871,
396,
736,
6262,
5971,
1203,
13,
462,
1678,
736,
10153,
29918,
13193,
13,
9651,
4613,
353,
7272,
1583,
17255,
16409,
29898,
5327,
29897,
13,
9651,
736,
4613,
13,
13,
1678,
7465,
822,
4955,
29898,
1311,
29892,
9210,
29901,
938,
353,
29871,
29900,
29892,
2302,
29901,
938,
353,
29871,
29896,
29900,
29900,
29897,
1599,
4731,
583,
29901,
13,
4706,
9995,
13,
4706,
334,
2616,
29877,
13,
4706,
736,
1203,
3603,
583,
2740,
363,
3633,
13,
4706,
584,
3207,
9210,
29901,
938,
13,
4706,
584,
3207,
2302,
29901,
938,
13,
4706,
584,
2457,
29901,
4731,
583,
1203,
13,
4706,
9995,
13,
4706,
7465,
411,
1583,
3032,
7924,
29889,
657,
703,
991,
597,
2886,
16513,
29889,
582,
29914,
29882,
391,
613,
8636,
3790,
29908,
10289,
1115,
9210,
29892,
376,
2798,
1115,
2302,
1118,
13,
462,
462,
268,
9066,
29922,
1311,
29889,
13662,
29897,
408,
2933,
29901,
13,
9651,
4955,
353,
7272,
1583,
17255,
16409,
29898,
5327,
29897,
13,
4706,
736,
4955,
13,
13,
1678,
7465,
822,
2740,
29898,
1311,
29892,
2740,
29918,
333,
29901,
518,
524,
29892,
851,
1402,
2302,
29901,
938,
353,
29871,
29896,
29906,
29947,
29897,
1599,
1019,
5325,
29901,
13,
4706,
9995,
13,
4706,
334,
2616,
29877,
13,
4706,
584,
3207,
2740,
29918,
333,
29901,
518,
524,
29892,
851,
29962,
2740,
1178,
13,
4706,
584,
3207,
2302,
29901,
518,
524,
29962,
4236,
1019,
5325,
2302,
679,
13,
4706,
584,
2457,
29901,
1019,
5325,
1203,
13,
4706,
9995,
13,
4706,
7465,
411,
1583,
3032,
7924,
29889,
657,
703,
991,
597,
2886,
16513,
29889,
582,
29914,
4478,
613,
8636,
3790,
29908,
333,
1115,
2740,
29918,
333,
29892,
376,
2798,
1115,
2302,
1118,
13,
462,
462,
268,
9066,
29922,
1311,
29889,
13662,
29897,
408,
2933,
29901,
13,
9651,
2740,
29918,
2914,
353,
7272,
1583,
17255,
16409,
29898,
5327,
29897,
13,
4706,
736,
2740,
29918,
2914,
13,
13,
1678,
732,
6799,
13,
1678,
822,
679,
29918,
7924,
29898,
1311,
29897,
1599,
9657,
29901,
13,
4706,
9995,
13,
4706,
2875,
13,
4706,
736,
4867,
29899,
1989,
322,
903,
1792,
333,
3633,
13,
4706,
584,
2457,
29901,
9657,
8853,
7924,
29899,
1989,
1115,
4867,
29918,
1989,
29892,
376,
1792,
29899,
333,
1115,
1404,
333,
29913,
13,
4706,
9995,
13,
4706,
903,
7924,
353,
8853,
7924,
29899,
1989,
1115,
1583,
3032,
7924,
29918,
1989,
29892,
376,
1792,
29899,
333,
1115,
1583,
3032,
1792,
333,
29913,
13,
4706,
736,
903,
7924,
13,
13,
1678,
822,
4770,
710,
12035,
1311,
1125,
13,
4706,
736,
1583,
17255,
3888,
17255,
710,
1649,
580,
13,
13,
1678,
7465,
822,
4770,
29874,
5893,
12035,
1311,
29897,
1599,
525,
12542,
16513,
8123,
2396,
13,
4706,
736,
1583,
13,
13,
1678,
7465,
822,
4770,
29874,
13322,
12035,
1311,
29892,
5566,
29918,
1853,
29892,
5566,
29918,
791,
29892,
5566,
29918,
22625,
29897,
1599,
6213,
29901,
13,
4706,
7272,
1583,
3032,
7924,
29889,
5358,
580,
13,
13,
1678,
7465,
822,
3802,
29898,
1311,
29897,
1599,
6213,
29901,
13,
4706,
7272,
1583,
3032,
7924,
29889,
5358,
580,
13,
2
] |
pwtools/test/test_is_seq.py | elcorto/pwtools | 41 | 60794 | import os
import numpy as np
from pwtools.common import is_seq, file_write
from .testenv import testdir
def test_is_seq():
fn = os.path.join(testdir, 'is_seq_test_file')
file_write(fn, 'lala')
fd = open(fn , 'r')
for xx in ([1,2,3], (1,2,3), np.array([1,2,3])):
print(type(xx))
assert is_seq(xx) is True
for xx in ('aaa', fd):
print(type(xx))
assert is_seq(xx) is False
fd.close()
| [
1,
1053,
2897,
13,
5215,
12655,
408,
7442,
13,
3166,
282,
29893,
8504,
29889,
9435,
1053,
338,
29918,
11762,
29892,
934,
29918,
3539,
13,
3166,
869,
1688,
6272,
1053,
1243,
3972,
13,
13,
1753,
1243,
29918,
275,
29918,
11762,
7295,
13,
1678,
7876,
353,
2897,
29889,
2084,
29889,
7122,
29898,
1688,
3972,
29892,
525,
275,
29918,
11762,
29918,
1688,
29918,
1445,
1495,
13,
1678,
934,
29918,
3539,
29898,
9144,
29892,
525,
29880,
2883,
1495,
13,
1678,
285,
29881,
353,
1722,
29898,
9144,
1919,
525,
29878,
1495,
13,
1678,
363,
15473,
297,
9310,
29896,
29892,
29906,
29892,
29941,
1402,
313,
29896,
29892,
29906,
29892,
29941,
511,
7442,
29889,
2378,
4197,
29896,
29892,
29906,
29892,
29941,
12622,
29901,
13,
4706,
1596,
29898,
1853,
29898,
4419,
876,
13,
4706,
4974,
338,
29918,
11762,
29898,
4419,
29897,
338,
5852,
13,
1678,
363,
15473,
297,
6702,
7340,
29874,
742,
285,
29881,
1125,
13,
4706,
1596,
29898,
1853,
29898,
4419,
876,
13,
4706,
4974,
338,
29918,
11762,
29898,
4419,
29897,
338,
7700,
13,
1678,
285,
29881,
29889,
5358,
580,
13,
2
] |
py-question/lv1-01.py | fos777/MarbleChocolate | 0 | 88329 | # Q:编写一个程序,它将找到所有这些数字,可被7整除,但不是5的倍数,2000年至3200年(包括在内)。得到的数字应按逗号分隔的顺序打印在一行上。
# HINT:考虑使用range(#begin, #end)方法
l = []
for i in range(2000,3201):
if (i%7==0) and (i%5!=0):
l.append(str(i))
print (l) | [
1,
396,
660,
29901,
31795,
31479,
30287,
30502,
31101,
31463,
30214,
232,
177,
134,
30998,
233,
140,
193,
30780,
30744,
30417,
30810,
31959,
30354,
30578,
30214,
30682,
31407,
29955,
233,
152,
183,
31152,
30214,
231,
192,
137,
30413,
30392,
29945,
30210,
232,
131,
144,
30354,
30214,
29906,
29900,
29900,
29900,
30470,
235,
138,
182,
29941,
29906,
29900,
29900,
30470,
29898,
31473,
233,
142,
175,
30505,
30728,
29897,
30267,
31050,
30780,
30210,
30354,
30578,
31370,
31590,
236,
131,
154,
30850,
30748,
236,
157,
151,
30210,
236,
164,
189,
31463,
31656,
232,
144,
179,
30505,
30287,
30448,
30429,
30267,
13,
29937,
379,
10192,
29901,
235,
131,
134,
235,
156,
148,
30785,
30406,
3881,
29898,
29937,
463,
30214,
396,
355,
29897,
30525,
30545,
13,
13,
29880,
353,
5159,
13,
1454,
474,
297,
3464,
29898,
29906,
29900,
29900,
29900,
29892,
29941,
29906,
29900,
29896,
1125,
13,
1678,
565,
313,
29875,
29995,
29955,
1360,
29900,
29897,
322,
313,
29875,
29995,
29945,
19216,
29900,
1125,
13,
4706,
301,
29889,
4397,
29898,
710,
29898,
29875,
876,
13,
2158,
313,
29880,
29897,
2
] |
output/models/nist_data/atomic/unsigned_byte/schema_instance/nistschema_sv_iv_atomic_unsigned_byte_pattern_1_xsd/__init__.py | tefra/xsdata-w3c-tests | 1 | 69558 | <gh_stars>1-10
from output.models.nist_data.atomic.unsigned_byte.schema_instance.nistschema_sv_iv_atomic_unsigned_byte_pattern_1_xsd.nistschema_sv_iv_atomic_unsigned_byte_pattern_1 import NistschemaSvIvAtomicUnsignedBytePattern1
__all__ = [
"NistschemaSvIvAtomicUnsignedBytePattern1",
]
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
3166,
1962,
29889,
9794,
29889,
29876,
391,
29918,
1272,
29889,
21641,
29889,
15395,
29918,
10389,
29889,
11010,
29918,
8758,
29889,
29876,
391,
11010,
29918,
4501,
29918,
440,
29918,
21641,
29918,
15395,
29918,
10389,
29918,
11037,
29918,
29896,
29918,
19168,
29889,
29876,
391,
11010,
29918,
4501,
29918,
440,
29918,
21641,
29918,
15395,
29918,
10389,
29918,
11037,
29918,
29896,
1053,
405,
391,
11010,
29903,
29894,
29902,
29894,
4178,
25426,
25807,
12961,
12901,
17144,
29896,
13,
13,
1649,
497,
1649,
353,
518,
13,
1678,
376,
29940,
391,
11010,
29903,
29894,
29902,
29894,
4178,
25426,
25807,
12961,
12901,
17144,
29896,
613,
13,
29962,
13,
2
] |
Programmers/10. Graph/02. Rank.py | Minoolian/Coding_Test | 0 | 83719 | # 순위
#
# https://programmers.co.kr/learn/courses/30/lessons/49191
def solution(n, results):
answer=0
adj=[[0 for _ in range(n+1)] for _ in range(n+1)]
for w,l in results:
adj[w][l]=2
adj[l][w]=1
# for i in range(n+1):
# for j in range(n+1):
# if adj[i][j]==1:
# for k in range(n+1):
# if adj[i][k]==2:
# adj[j][k]=2
# elif adj[i][j]==2:
# for k in range(n+1):
# if adj[i][k]==1:
# adj[j][k]=1
for i in range(n+1):
for j in range(n+1):
for k in range(n+1):
if adj[i][j]==1 and adj[i][k]==2:
adj[j][k]=2
elif adj[i][j]==2 and adj[i][k]==1:
adj[j][k]=1
for lis in adj:
if lis.count(0)==2:
answer+=1
return answer
solution(5,[[4, 3], [4, 2], [3, 2], [1, 2], [2, 5]])
| [
1,
396,
29871,
239,
139,
159,
31724,
13,
13,
29937,
29871,
13,
29937,
2045,
597,
8860,
13269,
29889,
1111,
29889,
12748,
29914,
19668,
29914,
29883,
29781,
29914,
29941,
29900,
29914,
2222,
787,
29914,
29946,
29929,
29896,
29929,
29896,
13,
13,
1753,
1650,
29898,
29876,
29892,
2582,
1125,
13,
1678,
1234,
29922,
29900,
13,
1678,
12109,
29922,
8999,
29900,
363,
903,
297,
3464,
29898,
29876,
29974,
29896,
4638,
363,
903,
297,
3464,
29898,
29876,
29974,
29896,
4638,
13,
13,
1678,
363,
281,
29892,
29880,
297,
2582,
29901,
13,
4706,
12109,
29961,
29893,
3816,
29880,
13192,
29906,
13,
4706,
12109,
29961,
29880,
3816,
29893,
13192,
29896,
13,
13,
1678,
396,
363,
474,
297,
3464,
29898,
29876,
29974,
29896,
1125,
13,
1678,
396,
268,
363,
432,
297,
3464,
29898,
29876,
29974,
29896,
1125,
13,
1678,
396,
308,
565,
12109,
29961,
29875,
3816,
29926,
29962,
1360,
29896,
29901,
13,
1678,
396,
632,
363,
413,
297,
3464,
29898,
29876,
29974,
29896,
1125,
13,
1678,
396,
462,
565,
12109,
29961,
29875,
3816,
29895,
29962,
1360,
29906,
29901,
13,
1678,
396,
462,
268,
12109,
29961,
29926,
3816,
29895,
13192,
29906,
13,
1678,
396,
308,
25342,
12109,
29961,
29875,
3816,
29926,
29962,
1360,
29906,
29901,
13,
1678,
396,
632,
363,
413,
297,
3464,
29898,
29876,
29974,
29896,
1125,
13,
1678,
396,
462,
565,
12109,
29961,
29875,
3816,
29895,
29962,
1360,
29896,
29901,
13,
1678,
396,
462,
268,
12109,
29961,
29926,
3816,
29895,
13192,
29896,
13,
13,
1678,
363,
474,
297,
3464,
29898,
29876,
29974,
29896,
1125,
13,
4706,
363,
432,
297,
3464,
29898,
29876,
29974,
29896,
1125,
13,
9651,
363,
413,
297,
3464,
29898,
29876,
29974,
29896,
1125,
13,
18884,
565,
12109,
29961,
29875,
3816,
29926,
29962,
1360,
29896,
322,
12109,
29961,
29875,
3816,
29895,
29962,
1360,
29906,
29901,
13,
462,
1678,
12109,
29961,
29926,
3816,
29895,
13192,
29906,
13,
13,
18884,
25342,
12109,
29961,
29875,
3816,
29926,
29962,
1360,
29906,
322,
12109,
29961,
29875,
3816,
29895,
29962,
1360,
29896,
29901,
13,
462,
1678,
12109,
29961,
29926,
3816,
29895,
13192,
29896,
13,
13,
1678,
363,
301,
275,
297,
12109,
29901,
13,
4706,
565,
301,
275,
29889,
2798,
29898,
29900,
29897,
1360,
29906,
29901,
13,
9651,
1234,
23661,
29896,
13,
13,
1678,
736,
1234,
13,
13,
2929,
918,
29898,
29945,
29892,
8999,
29946,
29892,
29871,
29941,
1402,
518,
29946,
29892,
29871,
29906,
1402,
518,
29941,
29892,
29871,
29906,
1402,
518,
29896,
29892,
29871,
29906,
1402,
518,
29906,
29892,
29871,
29945,
24960,
13,
13,
2
] |
mkdocs_swagger_ui_plugin/plugin.py | byrnereese/mkdocs-swagger-ui | 3 | 1611666 | <gh_stars>1-10
import os
import sys
import fnmatch
from timeit import default_timer as timer
from datetime import datetime, timedelta
from mkdocs import utils as mkdocs_utils
from mkdocs.config import config_options, Config
from mkdocs.plugins import BasePlugin
import mkdocs.structure.files
import yaml
import json
import markdown
from jinja2 import Environment, FileSystemLoader, select_autoescape, Markup
import requests
from urllib.parse import urlparse
from urllib.request import Request, urlopen
from urllib.error import URLError
class SwaggerUIPlugin(BasePlugin):
config_scheme = (
('do_nothing', mkdocs.config.config_options.Type(str, default='')),
('spec_url', config_options.Type(str, default='https://petstore.swagger.io/v2/swagger.json')),
('template', config_options.Type(str, default='swagger.md.tmpl')),
('outfile', config_options.Type(str, default='docs/swagger.md'))
)
def __init__(self):
self.enabled = True
self.total_time = 0
def generate_page_contents(self):
spec_url = self.config['spec_url']
tmpl_url = self.config['template']
print("INFO - Generating swagger-ui for spec: " + spec_url)
print("DEBUG - template: " + tmpl_url)
env = Environment(
loader=FileSystemLoader('tmpl'),
autoescape=select_autoescape(['html', 'xml'])
)
md = markdown.Markdown()
env.filters['markdown'] = lambda text: Markup(md.convert(text))
template = env.get_template( tmpl_url )
tmpl_out = template.render( spec=spec_url )
return tmpl_out
def on_config(self, config):
print("INFO - swagger-ui plugin ENABLED")
def on_page_read_source(self, page, config):
index_path = os.path.join(config['docs_dir'], self.config['outfile'])
page_path = os.path.join(config['docs_dir'], page.file.src_path)
if index_path == page_path:
contents = self.generate_page_contents()
return contents
'''
def on_pre_build(self, config):
outfile = self.config['outfile']
contents = self.generate_page_contents()
dest = os.path.join(config['docs_dir'], outfile)
with open(dest, "w") as fh:
fh.write(contents)
return config
'''
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
5215,
2897,
13,
5215,
10876,
13,
5215,
7876,
4352,
13,
3166,
931,
277,
1053,
2322,
29918,
20404,
408,
12237,
13,
3166,
12865,
1053,
12865,
29892,
5335,
287,
2554,
13,
13,
3166,
14690,
2640,
1053,
3667,
29879,
408,
14690,
2640,
29918,
13239,
13,
3166,
14690,
2640,
29889,
2917,
1053,
2295,
29918,
6768,
29892,
12782,
13,
3166,
14690,
2640,
29889,
12800,
1053,
7399,
16288,
13,
5215,
14690,
2640,
29889,
23905,
29889,
5325,
13,
13,
5215,
343,
8807,
13,
5215,
4390,
13,
5215,
2791,
3204,
13,
3166,
432,
262,
1764,
29906,
1053,
16738,
29892,
3497,
3924,
10036,
29892,
1831,
29918,
6921,
21587,
29892,
4485,
786,
13,
268,
13,
5215,
7274,
13,
3166,
3142,
1982,
29889,
5510,
1053,
3142,
5510,
13,
3166,
3142,
1982,
29889,
3827,
1053,
10729,
29892,
5065,
417,
2238,
13,
3166,
3142,
1982,
29889,
2704,
1053,
501,
29934,
1307,
24616,
13,
268,
13,
1990,
3925,
9921,
3120,
16288,
29898,
5160,
16288,
1125,
13,
13,
1678,
2295,
29918,
816,
2004,
353,
313,
13,
4706,
6702,
1867,
29918,
28450,
742,
14690,
2640,
29889,
2917,
29889,
2917,
29918,
6768,
29889,
1542,
29898,
710,
29892,
2322,
2433,
1495,
511,
13,
4706,
6702,
6550,
29918,
2271,
742,
2295,
29918,
6768,
29889,
1542,
29898,
710,
29892,
2322,
2433,
991,
597,
10963,
8899,
29889,
2774,
9921,
29889,
601,
29914,
29894,
29906,
29914,
2774,
9921,
29889,
3126,
1495,
511,
13,
4706,
6702,
6886,
742,
2295,
29918,
6768,
29889,
1542,
29898,
710,
29892,
2322,
2433,
2774,
9921,
29889,
3487,
29889,
18276,
572,
1495,
511,
13,
4706,
6702,
449,
1445,
742,
2295,
29918,
6768,
29889,
1542,
29898,
710,
29892,
2322,
2433,
2640,
29914,
2774,
9921,
29889,
3487,
8785,
13,
1678,
1723,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
1583,
29889,
17590,
353,
5852,
13,
4706,
1583,
29889,
7827,
29918,
2230,
353,
29871,
29900,
13,
13,
1678,
822,
5706,
29918,
3488,
29918,
10853,
29898,
1311,
1125,
13,
4706,
1580,
29918,
2271,
1678,
353,
1583,
29889,
2917,
1839,
6550,
29918,
2271,
2033,
13,
4706,
27702,
572,
29918,
2271,
1678,
353,
1583,
29889,
2917,
1839,
6886,
2033,
13,
4706,
1596,
703,
11690,
268,
448,
29871,
3251,
1218,
2381,
9921,
29899,
1481,
363,
1580,
29901,
376,
718,
1580,
29918,
2271,
29897,
13,
4706,
1596,
703,
18525,
1678,
448,
29871,
4472,
29901,
376,
718,
27702,
572,
29918,
2271,
29897,
13,
4706,
8829,
353,
16738,
29898,
13,
9651,
23466,
29922,
2283,
3924,
10036,
877,
18276,
572,
5477,
13,
9651,
4469,
21587,
29922,
2622,
29918,
6921,
21587,
18959,
1420,
742,
525,
3134,
11287,
13,
4706,
1723,
13,
4706,
22821,
353,
2791,
3204,
29889,
9802,
3204,
580,
13,
4706,
8829,
29889,
26705,
1839,
3502,
3204,
2033,
353,
14013,
1426,
29901,
4485,
786,
29898,
3487,
29889,
13441,
29898,
726,
876,
13,
259,
13,
4706,
4472,
353,
8829,
29889,
657,
29918,
6886,
29898,
27702,
572,
29918,
2271,
1723,
13,
4706,
27702,
572,
29918,
449,
353,
4472,
29889,
9482,
29898,
1580,
29922,
6550,
29918,
2271,
1723,
13,
4706,
736,
27702,
572,
29918,
449,
13,
268,
13,
1678,
822,
373,
29918,
2917,
29898,
1311,
29892,
2295,
1125,
13,
4706,
1596,
703,
11690,
268,
448,
29871,
2381,
9921,
29899,
1481,
7079,
12524,
6181,
29928,
1159,
13,
13,
1678,
822,
373,
29918,
3488,
29918,
949,
29918,
4993,
29898,
1311,
29892,
1813,
29892,
2295,
1125,
13,
4706,
2380,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
2917,
1839,
2640,
29918,
3972,
7464,
1583,
29889,
2917,
1839,
449,
1445,
11287,
13,
4706,
1813,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
2917,
1839,
2640,
29918,
3972,
7464,
1813,
29889,
1445,
29889,
4351,
29918,
2084,
29897,
13,
4706,
565,
2380,
29918,
2084,
1275,
1813,
29918,
2084,
29901,
13,
9651,
8118,
353,
1583,
29889,
17158,
29918,
3488,
29918,
10853,
580,
13,
9651,
736,
8118,
13,
13,
1678,
14550,
13,
1678,
822,
373,
29918,
1457,
29918,
4282,
29898,
1311,
29892,
2295,
1125,
13,
4706,
714,
1445,
29871,
353,
1583,
29889,
2917,
1839,
449,
1445,
2033,
13,
4706,
8118,
353,
1583,
29889,
17158,
29918,
3488,
29918,
10853,
580,
13,
4706,
2731,
353,
2897,
29889,
2084,
29889,
7122,
29898,
2917,
1839,
2640,
29918,
3972,
7464,
714,
1445,
29897,
13,
4706,
411,
1722,
29898,
7854,
29892,
376,
29893,
1159,
408,
285,
29882,
29901,
13,
9651,
285,
29882,
29889,
3539,
29898,
10853,
29897,
13,
4706,
736,
2295,
13,
1678,
14550,
13,
2
] |
ahc_tools/test/test_utils.py | rdo-management/ahc-tools | 0 | 183597 | # 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 json
import mock
from ironicclient.exc import AmbiguousAuthSystem
from ahc_tools.test import base
from ahc_tools import utils
class TestGetFacts(base.BaseTest):
@mock.patch.object(utils.swift, 'SwiftAPI', autospec=True)
def test_facts(self, swift_mock):
swift_conn = swift_mock.return_value
obj = json.dumps([[u'cpu', u'logical_0', u'bogomips', u'4199.99'],
[u'cpu', u'logical_0', u'cache_size', u'4096KB']])
swift_conn.get_object.return_value = obj
name = 'extra_hardware-UUID1'
node = mock.Mock(extra={'hardware_swift_object': name})
expected = [(u'cpu', u'logical_0', u'bogomips', u'4199.99'),
(u'cpu', u'logical_0', u'cache_size', u'4096KB')]
facts = utils.get_facts(node)
self.assertEqual(expected, facts)
swift_conn.get_object.assert_called_once_with(name)
def test_no_facts(self):
node = mock.Mock(extra={})
err_msg = ("You must run introspection on the nodes before "
"running this tool.\n")
self.assertRaisesRegexp(SystemExit, err_msg,
utils.get_facts, node)
@mock.patch.object(utils.client, 'get_client', autospec=True,
side_effect=AmbiguousAuthSystem)
class TestGetIronicClient(base.BaseTest):
def test_no_credentials(self, ic_mock):
utils.CONF.config_file = ['ahc-tools.conf']
err_msg = '.*credentials.*missing.*ironic.*searched.*ahc-tools.conf'
self.assertRaisesRegexp(SystemExit, err_msg,
utils.get_ironic_client)
self.assertTrue(ic_mock.called)
class TestGetIronicNodes(base.BaseTest):
def test_only_matchable_nodes_returned(self):
available_node = mock.Mock(provision_state='available')
manageable_node = mock.Mock(provision_state='manageable')
active_node = mock.Mock(provision_state='active')
ironic_client = mock.Mock()
ironic_client.node.list.return_value = [available_node,
manageable_node,
active_node]
expected = [available_node, manageable_node]
returned_nodes = utils.get_ironic_nodes(ironic_client)
self.assertEqual(expected, returned_nodes)
| [
1,
396,
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,
13,
29937,
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,
4390,
13,
5215,
11187,
13,
13,
3166,
3805,
8927,
4645,
29889,
735,
29883,
1053,
1913,
3752,
17269,
6444,
3924,
13,
13,
3166,
21023,
29883,
29918,
8504,
29889,
1688,
1053,
2967,
13,
3166,
21023,
29883,
29918,
8504,
1053,
3667,
29879,
13,
13,
13,
1990,
4321,
2577,
20738,
29879,
29898,
3188,
29889,
5160,
3057,
1125,
13,
1678,
732,
17640,
29889,
5041,
29889,
3318,
29898,
13239,
29889,
26792,
29892,
525,
10840,
2027,
8787,
742,
1120,
359,
3135,
29922,
5574,
29897,
13,
1678,
822,
1243,
29918,
17028,
29879,
29898,
1311,
29892,
12086,
29918,
17640,
1125,
13,
4706,
12086,
29918,
13082,
353,
12086,
29918,
17640,
29889,
2457,
29918,
1767,
13,
4706,
5446,
353,
4390,
29889,
29881,
17204,
4197,
29961,
29884,
29915,
21970,
742,
318,
29915,
1188,
936,
29918,
29900,
742,
318,
29915,
29890,
468,
290,
4512,
742,
318,
29915,
29946,
29896,
29929,
29929,
29889,
29929,
29929,
7464,
13,
462,
3986,
518,
29884,
29915,
21970,
742,
318,
29915,
1188,
936,
29918,
29900,
742,
318,
29915,
8173,
29918,
2311,
742,
318,
29915,
29946,
29900,
29929,
29953,
26067,
2033,
2314,
13,
4706,
12086,
29918,
13082,
29889,
657,
29918,
3318,
29889,
2457,
29918,
1767,
353,
5446,
13,
4706,
1024,
353,
525,
17833,
29918,
6800,
2519,
29899,
29965,
11150,
29896,
29915,
13,
4706,
2943,
353,
11187,
29889,
18680,
29898,
17833,
3790,
29915,
6800,
2519,
29918,
26792,
29918,
3318,
2396,
1024,
1800,
13,
4706,
3806,
353,
17288,
29884,
29915,
21970,
742,
318,
29915,
1188,
936,
29918,
29900,
742,
318,
29915,
29890,
468,
290,
4512,
742,
318,
29915,
29946,
29896,
29929,
29929,
29889,
29929,
29929,
5477,
13,
462,
1678,
313,
29884,
29915,
21970,
742,
318,
29915,
1188,
936,
29918,
29900,
742,
318,
29915,
8173,
29918,
2311,
742,
318,
29915,
29946,
29900,
29929,
29953,
26067,
1495,
29962,
13,
13,
4706,
17099,
353,
3667,
29879,
29889,
657,
29918,
17028,
29879,
29898,
3177,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
9684,
29892,
17099,
29897,
13,
4706,
12086,
29918,
13082,
29889,
657,
29918,
3318,
29889,
9294,
29918,
13998,
29918,
10646,
29918,
2541,
29898,
978,
29897,
13,
13,
1678,
822,
1243,
29918,
1217,
29918,
17028,
29879,
29898,
1311,
1125,
13,
4706,
2943,
353,
11187,
29889,
18680,
29898,
17833,
3790,
1800,
13,
4706,
4589,
29918,
7645,
353,
4852,
3492,
1818,
1065,
25956,
27988,
373,
278,
7573,
1434,
376,
13,
462,
259,
376,
21094,
445,
5780,
7790,
29876,
1159,
13,
4706,
1583,
29889,
9294,
29934,
1759,
267,
4597,
4548,
29898,
3924,
24365,
29892,
4589,
29918,
7645,
29892,
13,
462,
18884,
3667,
29879,
29889,
657,
29918,
17028,
29879,
29892,
2943,
29897,
13,
13,
13,
29992,
17640,
29889,
5041,
29889,
3318,
29898,
13239,
29889,
4645,
29892,
525,
657,
29918,
4645,
742,
1120,
359,
3135,
29922,
5574,
29892,
13,
462,
259,
2625,
29918,
15987,
29922,
6833,
3752,
17269,
6444,
3924,
29897,
13,
1990,
4321,
2577,
29902,
1617,
293,
4032,
29898,
3188,
29889,
5160,
3057,
1125,
13,
1678,
822,
1243,
29918,
1217,
29918,
11944,
9409,
29898,
1311,
29892,
16077,
29918,
17640,
1125,
13,
4706,
3667,
29879,
29889,
6007,
29943,
29889,
2917,
29918,
1445,
353,
6024,
801,
29883,
29899,
8504,
29889,
5527,
2033,
13,
4706,
4589,
29918,
7645,
353,
525,
5575,
11944,
9409,
5575,
27259,
5575,
381,
8927,
5575,
4478,
287,
5575,
801,
29883,
29899,
8504,
29889,
5527,
29915,
13,
4706,
1583,
29889,
9294,
29934,
1759,
267,
4597,
4548,
29898,
3924,
24365,
29892,
4589,
29918,
7645,
29892,
13,
462,
18884,
3667,
29879,
29889,
657,
29918,
381,
8927,
29918,
4645,
29897,
13,
4706,
1583,
29889,
9294,
5574,
29898,
293,
29918,
17640,
29889,
13998,
29897,
13,
13,
13,
1990,
4321,
2577,
29902,
1617,
293,
20284,
29898,
3188,
29889,
5160,
3057,
1125,
13,
1678,
822,
1243,
29918,
6194,
29918,
4352,
519,
29918,
18010,
29918,
2457,
287,
29898,
1311,
1125,
13,
4706,
3625,
29918,
3177,
353,
11187,
29889,
18680,
29898,
771,
4924,
29918,
3859,
2433,
16515,
1495,
13,
4706,
10933,
519,
29918,
3177,
353,
11187,
29889,
18680,
29898,
771,
4924,
29918,
3859,
2433,
1171,
482,
519,
1495,
13,
4706,
6136,
29918,
3177,
353,
11187,
29889,
18680,
29898,
771,
4924,
29918,
3859,
2433,
4925,
1495,
13,
4706,
3805,
8927,
29918,
4645,
353,
11187,
29889,
18680,
580,
13,
4706,
3805,
8927,
29918,
4645,
29889,
3177,
29889,
1761,
29889,
2457,
29918,
1767,
353,
518,
16515,
29918,
3177,
29892,
13,
462,
462,
18884,
10933,
519,
29918,
3177,
29892,
13,
462,
462,
18884,
6136,
29918,
3177,
29962,
13,
4706,
3806,
353,
518,
16515,
29918,
3177,
29892,
10933,
519,
29918,
3177,
29962,
13,
4706,
4133,
29918,
18010,
353,
3667,
29879,
29889,
657,
29918,
381,
8927,
29918,
18010,
29898,
381,
8927,
29918,
4645,
29897,
13,
4706,
1583,
29889,
9294,
9843,
29898,
9684,
29892,
4133,
29918,
18010,
29897,
13,
2
] |
plot/Spectrogram.py | varunss123/WaveCLI | 0 | 179398 | <gh_stars>0
#!/usr/bin/env python3
# =============================================================================
# Developer : <NAME>(<EMAIL>)
# License : MIT License
# Year : 2019
# =============================================================================
# =============================================================================
# Description:
# Plot Spectrogram of a .wav file
# =============================================================================
import argparse
import matplotlib.pyplot as plot
import Utilities as util
import numpy as np
from scipy import signal
parser = argparse.ArgumentParser(description = 'Plot Spectrogram of a .wav File')
parser.add_argument('-i', nargs = '?', required = True, type = str, help = 'Input File (.wav)')
parser.add_argument('-o', nargs = '?', type = str, help = 'Output Image File (Optional)')
parser.add_argument('-isolate',default = False, action = 'store_true', help = 'Plot Only Spectrogram without .wav')
args = parser.parse_args()
[fs,y_axis] = util.WavRead(args.i)
x_axis = np.arange(0,len(y_axis)/fs,1/fs)
f, t, spectrogram = signal.spectrogram(y_axis,fs, window = signal.get_window('hamming',1024), noverlap = 100)
if not args.isolate:
plot.subplot(211)
plot.plot(x_axis,y_axis)
plot.grid()
plot.title(args.i.split('/')[-1]+ ' Signal')
plot.xlabel('Time (s)')
plot.ylabel('Amplitude')
plot.subplot(212)
plot.pcolormesh(t, f, spectrogram, cmap = 'tab20')
plot.ylabel('Frequency (Hz)')
plot.yscale('symlog')
plot.xlabel('Time (s)')
plot.grid()
plot.title(args.i.split('/')[-1]+ ' Spectrogram')
plot.tight_layout()
if args.o:
plot.savefig(args.o, dpi = 360)
else:
plot.show() | [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
29937,
14708,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
25512,
13,
29937,
10682,
261,
584,
529,
5813,
5961,
29966,
26862,
6227,
12948,
13,
29937,
19245,
584,
341,
1806,
19245,
13,
29937,
8905,
584,
29871,
29906,
29900,
29896,
29929,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
25512,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
25512,
13,
29937,
12953,
29901,
13,
29937,
268,
18399,
27738,
307,
1393,
310,
263,
869,
29893,
485,
934,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
25512,
13,
5215,
1852,
5510,
13,
5215,
22889,
29889,
2272,
5317,
408,
6492,
13,
5215,
22310,
1907,
408,
3667,
13,
5215,
12655,
408,
7442,
13,
3166,
4560,
2272,
1053,
7182,
13,
13,
16680,
353,
1852,
5510,
29889,
15730,
11726,
29898,
8216,
353,
525,
20867,
27738,
307,
1393,
310,
263,
869,
29893,
485,
3497,
1495,
13,
13,
16680,
29889,
1202,
29918,
23516,
877,
29899,
29875,
742,
302,
5085,
353,
525,
29973,
742,
3734,
353,
5852,
29892,
1134,
353,
851,
29892,
1371,
353,
525,
4290,
3497,
14544,
29893,
485,
29897,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
29899,
29877,
742,
302,
5085,
353,
525,
29973,
742,
1134,
353,
851,
29892,
1371,
353,
525,
6466,
7084,
3497,
313,
27636,
29897,
1495,
13,
16680,
29889,
1202,
29918,
23516,
877,
29899,
275,
23167,
742,
4381,
353,
7700,
29892,
3158,
353,
525,
8899,
29918,
3009,
742,
1371,
353,
525,
20867,
9333,
27738,
307,
1393,
1728,
869,
29893,
485,
1495,
13,
5085,
353,
13812,
29889,
5510,
29918,
5085,
580,
13,
13,
29961,
5847,
29892,
29891,
29918,
8990,
29962,
353,
3667,
29889,
29956,
485,
6359,
29898,
5085,
29889,
29875,
29897,
13,
13,
29916,
29918,
8990,
353,
7442,
29889,
279,
927,
29898,
29900,
29892,
2435,
29898,
29891,
29918,
8990,
6802,
5847,
29892,
29896,
29914,
5847,
29897,
13,
29888,
29892,
260,
29892,
6683,
307,
1393,
353,
7182,
29889,
21494,
307,
1393,
29898,
29891,
29918,
8990,
29892,
5847,
29892,
3474,
353,
7182,
29889,
657,
29918,
7165,
877,
3391,
4056,
742,
29896,
29900,
29906,
29946,
511,
694,
369,
6984,
353,
29871,
29896,
29900,
29900,
29897,
13,
361,
451,
6389,
29889,
275,
23167,
29901,
13,
1678,
6492,
29889,
1491,
5317,
29898,
29906,
29896,
29896,
29897,
13,
1678,
6492,
29889,
5317,
29898,
29916,
29918,
8990,
29892,
29891,
29918,
8990,
29897,
13,
1678,
6492,
29889,
7720,
580,
13,
1678,
6492,
29889,
3257,
29898,
5085,
29889,
29875,
29889,
5451,
11219,
1495,
14352,
29896,
10062,
525,
9954,
284,
1495,
13,
1678,
6492,
29889,
29916,
1643,
877,
2481,
313,
29879,
29897,
1495,
13,
1678,
6492,
29889,
29891,
1643,
877,
6833,
2830,
1151,
1495,
13,
1678,
6492,
29889,
1491,
5317,
29898,
29906,
29896,
29906,
29897,
13,
5317,
29889,
29886,
1054,
555,
12094,
29898,
29873,
29892,
285,
29892,
6683,
307,
1393,
29892,
274,
1958,
353,
525,
3891,
29906,
29900,
1495,
13,
5317,
29889,
29891,
1643,
877,
23923,
23860,
313,
12661,
29897,
1495,
13,
5317,
29889,
952,
29883,
744,
877,
11967,
1188,
1495,
13,
5317,
29889,
29916,
1643,
877,
2481,
313,
29879,
29897,
1495,
13,
5317,
29889,
7720,
580,
13,
5317,
29889,
3257,
29898,
5085,
29889,
29875,
29889,
5451,
11219,
1495,
14352,
29896,
10062,
525,
27738,
307,
1393,
1495,
13,
5317,
29889,
29873,
523,
29918,
2680,
580,
13,
361,
6389,
29889,
29877,
29901,
13,
1678,
6492,
29889,
7620,
1003,
29898,
5085,
29889,
29877,
29892,
270,
1631,
353,
29871,
29941,
29953,
29900,
29897,
13,
2870,
29901,
13,
1678,
6492,
29889,
4294,
580,
2
] |
home/migrations/0013_merge_20190507_1221.py | nurpeiis/RED | 0 | 102223 | <reponame>nurpeiis/RED
# Generated by Django 2.1.3 on 2019-05-07 08:21
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('home', '0008_auto_20190421_1129'),
('home', '0012_team_title'),
]
operations = [
]
| [
1,
529,
276,
1112,
420,
29958,
29876,
332,
412,
29875,
275,
29914,
19386,
13,
29937,
3251,
630,
491,
15337,
29871,
29906,
29889,
29896,
29889,
29941,
373,
29871,
29906,
29900,
29896,
29929,
29899,
29900,
29945,
29899,
29900,
29955,
29871,
29900,
29947,
29901,
29906,
29896,
13,
13,
3166,
9557,
29889,
2585,
1053,
9725,
800,
13,
13,
13,
1990,
341,
16783,
29898,
26983,
800,
29889,
29924,
16783,
1125,
13,
13,
1678,
9962,
353,
518,
13,
4706,
6702,
5184,
742,
525,
29900,
29900,
29900,
29947,
29918,
6921,
29918,
29906,
29900,
29896,
29929,
29900,
29946,
29906,
29896,
29918,
29896,
29896,
29906,
29929,
5477,
13,
4706,
6702,
5184,
742,
525,
29900,
29900,
29896,
29906,
29918,
14318,
29918,
3257,
5477,
13,
1678,
4514,
13,
13,
1678,
6931,
353,
518,
13,
1678,
4514,
13,
2
] |
backend/app/rooms/models.py | vpaliy/react-chat | 1 | 93228 | # -*- coding: future_fstrings -*-
from app.database import Model, Column, SurrogatePK, db, relationship
import datetime as dt
import hashlib
class Room(SurrogatePK, Model):
__tablename__ = 'rooms'
name = Column(db.String(80), unique=True, nullable=False)
description = Column(db.String(300), unique=True, nullable=False)
image = Column(db.String(120), nullable=True)
created_at = Column(db.DateTime, nullable=False, default=dt.datetime.utcnow)
updated_at = Column(db.DateTime, nullable=False, default=dt.datetime.utcnow)
@property
def avatar_url(self):
hash = hashlib.md5(self.name.lower()).hexdigest()
return f'https://www.gravatar.com/avatar/{hash}?d=identicon&s={str(50)}'
def __repr__(self):
return '<Room {!r}>'.format(self.name)
| [
1,
396,
448,
29930,
29899,
14137,
29901,
5434,
29918,
29888,
19651,
448,
29930,
29899,
13,
3166,
623,
29889,
9803,
1053,
8125,
29892,
12481,
29892,
6298,
9102,
403,
21738,
29892,
4833,
29892,
9443,
13,
5215,
12865,
408,
11636,
13,
5215,
6608,
1982,
13,
13,
13,
1990,
25114,
29898,
18498,
9102,
403,
21738,
29892,
8125,
1125,
13,
29871,
4770,
3891,
2435,
420,
1649,
353,
525,
18901,
29915,
13,
13,
29871,
1024,
353,
12481,
29898,
2585,
29889,
1231,
29898,
29947,
29900,
511,
5412,
29922,
5574,
29892,
1870,
519,
29922,
8824,
29897,
13,
29871,
6139,
353,
12481,
29898,
2585,
29889,
1231,
29898,
29941,
29900,
29900,
511,
5412,
29922,
5574,
29892,
1870,
519,
29922,
8824,
29897,
13,
29871,
1967,
353,
12481,
29898,
2585,
29889,
1231,
29898,
29896,
29906,
29900,
511,
1870,
519,
29922,
5574,
29897,
13,
29871,
2825,
29918,
271,
353,
12481,
29898,
2585,
29889,
11384,
29892,
1870,
519,
29922,
8824,
29892,
2322,
29922,
6008,
29889,
12673,
29889,
329,
29883,
3707,
29897,
13,
29871,
4784,
29918,
271,
353,
12481,
29898,
2585,
29889,
11384,
29892,
1870,
519,
29922,
8824,
29892,
2322,
29922,
6008,
29889,
12673,
29889,
329,
29883,
3707,
29897,
13,
13,
29871,
732,
6799,
13,
29871,
822,
1029,
14873,
29918,
2271,
29898,
1311,
1125,
13,
1678,
6608,
353,
6608,
1982,
29889,
3487,
29945,
29898,
1311,
29889,
978,
29889,
13609,
16655,
20970,
7501,
342,
580,
13,
1678,
736,
285,
29915,
991,
597,
1636,
29889,
3874,
9046,
279,
29889,
510,
29914,
485,
14873,
19248,
8568,
29913,
29973,
29881,
29922,
1693,
4144,
29987,
29879,
3790,
710,
29898,
29945,
29900,
2915,
29915,
13,
13,
29871,
822,
4770,
276,
558,
12035,
1311,
1125,
13,
1678,
736,
12801,
9588,
290,
426,
29991,
29878,
17428,
4286,
4830,
29898,
1311,
29889,
978,
29897,
13,
2
] |
pkgpanda/actions.py | zhe-sun/dcos | 0 | 84781 | <reponame>zhe-sun/dcos<filename>pkgpanda/actions.py
import collections
import logging
import os
import sys
from functools import partial
from subprocess import CalledProcessError, check_call
from pkgpanda import PackageId, requests_fetcher
from pkgpanda.constants import (DCOS_SERVICE_CONFIGURATION_PATH,
SYSCTL_SETTING_KEY)
from pkgpanda.exceptions import FetchError, PackageConflict, ValidationError
from pkgpanda.util import (extract_tarball, if_exists, load_json, load_string,
write_string)
DCOS_TARGET_CONTENTS = """[Install]
WantedBy=multi-user.target
"""
log = logging.getLogger(__name__)
def activate_packages(install, repository, package_ids, systemd, block_systemd):
"""Replace the active package set with package_ids.
install: pkgpanda.Install
repository: pkgpanda.Repository
package_ids: sequence of package IDs to activate
systemd: start/stop systemd services
block_systemd: if systemd, block waiting for systemd services to come up
"""
assert isinstance(package_ids, collections.Sequence)
install.activate(repository.load_packages(package_ids))
if systemd:
_start_dcos_target(block_systemd)
def swap_active_package(install, repository, package_id, systemd, block_systemd):
"""Replace an active package with a package_id with the same name.
swap(install, repository, 'foo--version') will replace the active 'foo'
package with 'foo--version'.
install: pkgpanda.Install
repository: pkgpanda.Repository
package_id: package ID to activate
systemd: start/stop systemd services
block_systemd: if systemd, block waiting for systemd services to come up
"""
active = install.get_active()
# TODO(cmaloney): I guarantee there is a better way to write this and
# I've written the same logic before...
packages_by_name = dict()
for id_str in active:
pkg_id = PackageId(id_str)
packages_by_name[pkg_id.name] = pkg_id
new_id = PackageId(package_id)
if new_id.name not in packages_by_name:
raise ValidationError("No package with name {} currently active to swap with.".format(new_id.name))
packages_by_name[new_id.name] = new_id
new_active = list(map(str, packages_by_name.values()))
# Activate with the new package name
activate_packages(install, repository, new_active, systemd, block_systemd)
def fetch_package(repository, repository_url, package_id, work_dir):
"""Fetch package_id from repository_url into repository.
repository: pkgpanda.Repository
repository_url: URL for remote package repository
package_id: package ID to fetch
work_dir: location for temporary files, used only if repository_url is a file URL with a relative path
"""
def fetcher(id_, target):
return requests_fetcher(repository_url, id_, target, work_dir)
# TODO(cmaloney): Make this not use escape sequences when not at a
# `real` terminal.
sys.stdout.write("\rFetching: {0}".format(package_id))
sys.stdout.flush()
try:
repository.add(fetcher, package_id)
except FetchError as ex:
raise Exception("Unable to fetch package {0}: {1}".format(package_id, ex)) from ex
else:
sys.stdout.write("\rFetched: {0}".format(package_id))
finally:
sys.stdout.write("\n")
sys.stdout.flush()
def add_package_file(repository, package_filename):
"""Add a package to the repository from a file.
repository: pkgpanda.Repository
package_filename: location of the package file
"""
filename_suffix = '.tar.xz'
# Extract Package Id (Filename must be path/{pkg-id}.tar.xz).
name = os.path.basename(package_filename)
if not name.endswith(filename_suffix):
print("ERROR: Can only add package tarballs which have names "
"like {{pkg-id}}{}".format(filename_suffix))
pkg_id = name[:-len(filename_suffix)]
# Validate the package id
PackageId(pkg_id)
def fetch(_, target):
extract_tarball(package_filename, target)
repository.add(fetch, pkg_id)
def remove_package(install, repository, package_id):
"""Remove a package from the local repository.
Errors if any packages in package_ids are activated in install.
install: pkgpanda.Install
repository: pkgpanda.Repository
package_id: package ID to remove from repository
"""
if package_id in install.get_active():
raise PackageConflict("Refusing to remove active package {0}".format(package_id))
sys.stdout.write("\rRemoving: {0}".format(package_id))
sys.stdout.flush()
try:
# Validate package id, that package is installed.
PackageId(package_id)
repository.remove(package_id)
except ValidationError as ex:
raise ValidationError("Invalid package id {0}".format(package_id)) from ex
except OSError as ex:
raise Exception("Error removing package {0}: {1}".format(package_id, ex)) from ex
else:
sys.stdout.write("\rRemoved: {0}".format(package_id))
finally:
sys.stdout.write("\n")
sys.stdout.flush()
def setup(install, repository):
"""Set up a fresh install of DC/OS.
install: pkgpanda.Install
repository: pkgpanda.Repository
"""
# Check for /opt/mesosphere/bootstrap. If not exists, download everything
# and install /etc/systemd/system/mutli-user.target/dcos.target
bootstrap_path = os.path.join(install.root, "bootstrap")
if os.path.exists(bootstrap_path):
# Write, enable /etc/systemd/system/dcos.target for next boot.
dcos_target_dir = os.path.dirname(install.systemd_dir)
try:
os.makedirs(dcos_target_dir)
except FileExistsError:
pass
write_string(os.path.join(dcos_target_dir, "dcos.target"),
DCOS_TARGET_CONTENTS)
_do_bootstrap(install, repository)
# Enable dcos.target only after we have populated it to prevent starting
# up stuff inside of it before we activate the new set of packages.
if install.manage_systemd:
_start_dcos_target(block_systemd=True)
os.remove(bootstrap_path)
# Check for /opt/mesosphere/install_progress. If found, recover the partial
# update.
if os.path.exists("/opt/mesosphere/install_progress"):
took_action, msg = install.recover_swap_active()
if not took_action:
print("No recovery performed: {}".format(msg))
def _start_dcos_target(block_systemd):
no_block = [] if block_systemd else ["--no-block"]
check_call(["systemctl", "daemon-reload"])
check_call(["systemctl", "enable", "dcos.target", '--no-reload'])
check_call(["systemctl", "start", "dcos.target"] + no_block)
def _do_bootstrap(install, repository):
# These files should be set by the environment which initially builds
# the host (cloud-init).
repository_url = if_exists(load_string, install.get_config_filename("setup-flags/repository-url"))
# TODO(cmaloney): If there is 1+ master, grab the active config from a master.
# If the config can't be grabbed from any of them, fail.
def fetcher(id, target):
if repository_url is None:
raise ValidationError("ERROR: Non-local package {} but no repository url given.".format(repository_url))
return requests_fetcher(repository_url, id, target, os.getcwd())
# Copy host/cluster-specific packages written to the filesystem manually
# from the setup-packages folder into the repository. Do not overwrite or
# merge existing packages, hard fail instead.
setup_packages_to_activate = []
setup_pkg_dir = install.get_config_filename("setup-packages")
copy_fetcher = partial(_copy_fetcher, setup_pkg_dir)
if os.path.exists(setup_pkg_dir):
for pkg_id_str in os.listdir(setup_pkg_dir):
print("Installing setup package: {}".format(pkg_id_str))
if not PackageId.is_id(pkg_id_str):
raise ValidationError("Invalid package id in setup package: {}".format(pkg_id_str))
pkg_id = PackageId(pkg_id_str)
if pkg_id.version != "setup":
raise ValidationError(
"Setup packages (those in `{0}`) must have the version setup. "
"Bad package: {1}".format(setup_pkg_dir, pkg_id_str))
# Make sure there is no existing package
if repository.has_package(pkg_id_str):
print("WARNING: Ignoring already installed package {}".format(pkg_id_str))
repository.add(copy_fetcher, pkg_id_str)
setup_packages_to_activate.append(pkg_id_str)
# If active.json is set on the host, use that as the set of packages to
# activate. Otherwise just use the set of currently active packages (those
# active in the bootstrap tarball)
to_activate = None
active_path = install.get_config_filename("setup-flags/active.json")
if os.path.exists(active_path):
print("Loaded active packages from", active_path)
to_activate = load_json(active_path)
# Ensure all packages are local
print("Ensuring all packages in active set {} are local".format(",".join(to_activate)))
for package in to_activate:
repository.add(fetcher, package)
else:
print("Calculated active packages from bootstrap tarball")
to_activate = list(install.get_active())
# Fetch and activate all requested additional packages to accompany the bootstrap packages.
cluster_packages_filename = install.get_config_filename("setup-flags/cluster-packages.json")
cluster_packages = if_exists(load_json, cluster_packages_filename)
print("Checking for cluster packages in:", cluster_packages_filename)
if cluster_packages:
if not isinstance(cluster_packages, list):
print('ERROR: {} should contain a JSON list of packages. Got a {}'.format(cluster_packages_filename,
type(cluster_packages)))
print("Loading cluster-packages: {}".format(cluster_packages))
for package_id_str in cluster_packages:
# Validate the package ids
pkg_id = PackageId(package_id_str)
# Fetch the packages if not local
if not repository.has_package(package_id_str):
repository.add(fetcher, package_id_str)
# Add the package to the set to activate
setup_packages_to_activate.append(package_id_str)
else:
print("No cluster-packages specified")
# Calculate the full set of final packages (Explicit activations + setup packages).
# De-duplicate using a set.
to_activate = list(set(to_activate + setup_packages_to_activate))
print("Activating packages")
install.activate(repository.load_packages(to_activate))
def _copy_fetcher(setup_pkg_dir, id_, target):
src_pkg_path = os.path.join(setup_pkg_dir, id_) + "/"
check_call(["cp", "-rp", src_pkg_path, target])
def _apply_sysctl(setting, service):
try:
check_call(["sysctl", "-q", "-w", setting])
except CalledProcessError:
log.warning("sysctl {setting} not set for {service}".format(setting=setting, service=service))
def _apply_sysctl_settings(sysctl_settings, service):
for setting, value in sysctl_settings.get(service, {}).items():
_apply_sysctl("{setting}={value}".format(setting=setting, value=value), service)
def apply_service_configuration(service):
if not os.path.exists(DCOS_SERVICE_CONFIGURATION_PATH):
return
dcos_service_properties = load_json(DCOS_SERVICE_CONFIGURATION_PATH)
if SYSCTL_SETTING_KEY in dcos_service_properties:
_apply_sysctl_settings(dcos_service_properties[SYSCTL_SETTING_KEY], service)
| [
1,
529,
276,
1112,
420,
29958,
29920,
354,
29899,
11445,
29914,
29881,
3944,
29966,
9507,
29958,
15865,
29886,
5863,
29914,
7387,
29889,
2272,
13,
5215,
16250,
13,
5215,
12183,
13,
5215,
2897,
13,
5215,
10876,
13,
3166,
2090,
312,
8789,
1053,
7687,
13,
3166,
1014,
5014,
1053,
3037,
839,
7032,
2392,
29892,
1423,
29918,
4804,
13,
13,
3166,
282,
9415,
29886,
5863,
1053,
22029,
1204,
29892,
7274,
29918,
9155,
261,
13,
3166,
282,
9415,
29886,
5863,
29889,
3075,
1934,
1053,
313,
29928,
3217,
29903,
29918,
6304,
19059,
29918,
25903,
4574,
8098,
29918,
10145,
29892,
13,
462,
18884,
317,
21554,
1783,
29931,
29918,
10490,
29911,
4214,
29918,
10818,
29897,
13,
3166,
282,
9415,
29886,
5863,
29889,
11739,
29879,
1053,
383,
3486,
2392,
29892,
22029,
16376,
29176,
29892,
15758,
362,
2392,
13,
3166,
282,
9415,
29886,
5863,
29889,
4422,
1053,
313,
21111,
29918,
12637,
2135,
29892,
565,
29918,
9933,
29892,
2254,
29918,
3126,
29892,
2254,
29918,
1807,
29892,
13,
462,
965,
2436,
29918,
1807,
29897,
13,
13,
29928,
3217,
29903,
29918,
29911,
1718,
7194,
29918,
22412,
3919,
29903,
353,
9995,
29961,
23271,
29962,
13,
29956,
9714,
2059,
29922,
9910,
29899,
1792,
29889,
5182,
13,
15945,
29908,
13,
13,
1188,
353,
12183,
29889,
657,
16363,
22168,
978,
1649,
29897,
13,
13,
13,
1753,
5039,
403,
29918,
8318,
29898,
6252,
29892,
9810,
29892,
3577,
29918,
4841,
29892,
1788,
29881,
29892,
2908,
29918,
5205,
29881,
1125,
13,
1678,
9995,
20083,
278,
6136,
3577,
731,
411,
3577,
29918,
4841,
29889,
13,
13,
1678,
2601,
29901,
282,
9415,
29886,
5863,
29889,
23271,
13,
1678,
9810,
29901,
282,
9415,
29886,
5863,
29889,
11481,
13,
1678,
3577,
29918,
4841,
29901,
5665,
310,
3577,
23481,
304,
5039,
403,
13,
1678,
1788,
29881,
29901,
1369,
29914,
9847,
1788,
29881,
5786,
13,
1678,
2908,
29918,
5205,
29881,
29901,
565,
1788,
29881,
29892,
2908,
10534,
363,
1788,
29881,
5786,
304,
2041,
701,
13,
13,
1678,
9995,
13,
1678,
4974,
338,
8758,
29898,
5113,
29918,
4841,
29892,
16250,
29889,
20529,
29897,
13,
1678,
2601,
29889,
11236,
403,
29898,
19033,
29889,
1359,
29918,
8318,
29898,
5113,
29918,
4841,
876,
13,
1678,
565,
1788,
29881,
29901,
13,
4706,
903,
2962,
29918,
29881,
3944,
29918,
5182,
29898,
1271,
29918,
5205,
29881,
29897,
13,
13,
13,
1753,
17945,
29918,
4925,
29918,
5113,
29898,
6252,
29892,
9810,
29892,
3577,
29918,
333,
29892,
1788,
29881,
29892,
2908,
29918,
5205,
29881,
1125,
13,
1678,
9995,
20083,
385,
6136,
3577,
411,
263,
3577,
29918,
333,
411,
278,
1021,
1024,
29889,
13,
13,
1678,
17945,
29898,
6252,
29892,
9810,
29892,
525,
5431,
489,
3259,
1495,
674,
5191,
278,
6136,
525,
5431,
29915,
13,
1678,
3577,
411,
525,
5431,
489,
3259,
4286,
13,
13,
1678,
2601,
29901,
282,
9415,
29886,
5863,
29889,
23271,
13,
1678,
9810,
29901,
282,
9415,
29886,
5863,
29889,
11481,
13,
1678,
3577,
29918,
333,
29901,
3577,
3553,
304,
5039,
403,
13,
1678,
1788,
29881,
29901,
1369,
29914,
9847,
1788,
29881,
5786,
13,
1678,
2908,
29918,
5205,
29881,
29901,
565,
1788,
29881,
29892,
2908,
10534,
363,
1788,
29881,
5786,
304,
2041,
701,
13,
13,
1678,
9995,
13,
1678,
6136,
353,
2601,
29889,
657,
29918,
4925,
580,
13,
1678,
396,
14402,
29898,
4912,
284,
4992,
1125,
306,
18818,
727,
338,
263,
2253,
982,
304,
2436,
445,
322,
13,
1678,
396,
306,
29915,
345,
3971,
278,
1021,
5900,
1434,
856,
13,
1678,
9741,
29918,
1609,
29918,
978,
353,
9657,
580,
13,
1678,
363,
1178,
29918,
710,
297,
6136,
29901,
13,
4706,
282,
9415,
29918,
333,
353,
22029,
1204,
29898,
333,
29918,
710,
29897,
13,
4706,
9741,
29918,
1609,
29918,
978,
29961,
15865,
29918,
333,
29889,
978,
29962,
353,
282,
9415,
29918,
333,
13,
13,
1678,
716,
29918,
333,
353,
22029,
1204,
29898,
5113,
29918,
333,
29897,
13,
1678,
565,
716,
29918,
333,
29889,
978,
451,
297,
9741,
29918,
1609,
29918,
978,
29901,
13,
4706,
12020,
15758,
362,
2392,
703,
3782,
3577,
411,
1024,
6571,
5279,
6136,
304,
17945,
411,
1213,
29889,
4830,
29898,
1482,
29918,
333,
29889,
978,
876,
13,
13,
1678,
9741,
29918,
1609,
29918,
978,
29961,
1482,
29918,
333,
29889,
978,
29962,
353,
716,
29918,
333,
13,
1678,
716,
29918,
4925,
353,
1051,
29898,
1958,
29898,
710,
29892,
9741,
29918,
1609,
29918,
978,
29889,
5975,
22130,
13,
1678,
396,
21775,
403,
411,
278,
716,
3577,
1024,
13,
1678,
5039,
403,
29918,
8318,
29898,
6252,
29892,
9810,
29892,
716,
29918,
4925,
29892,
1788,
29881,
29892,
2908,
29918,
5205,
29881,
29897,
13,
13,
13,
1753,
6699,
29918,
5113,
29898,
19033,
29892,
9810,
29918,
2271,
29892,
3577,
29918,
333,
29892,
664,
29918,
3972,
1125,
13,
1678,
9995,
20927,
3577,
29918,
333,
515,
9810,
29918,
2271,
964,
9810,
29889,
13,
13,
1678,
9810,
29901,
282,
9415,
29886,
5863,
29889,
11481,
13,
1678,
9810,
29918,
2271,
29901,
3988,
363,
7592,
3577,
9810,
13,
1678,
3577,
29918,
333,
29901,
3577,
3553,
304,
6699,
13,
1678,
664,
29918,
3972,
29901,
4423,
363,
13201,
2066,
29892,
1304,
871,
565,
9810,
29918,
2271,
338,
263,
934,
3988,
411,
263,
6198,
2224,
13,
13,
1678,
9995,
13,
1678,
822,
6699,
261,
29898,
333,
3383,
3646,
1125,
13,
4706,
736,
7274,
29918,
9155,
261,
29898,
19033,
29918,
2271,
29892,
1178,
3383,
3646,
29892,
664,
29918,
3972,
29897,
13,
13,
1678,
396,
14402,
29898,
4912,
284,
4992,
1125,
8561,
445,
451,
671,
10169,
15602,
746,
451,
472,
263,
13,
1678,
396,
421,
6370,
29952,
8638,
29889,
13,
1678,
10876,
29889,
25393,
29889,
3539,
14182,
29878,
20927,
292,
29901,
426,
29900,
29913,
1642,
4830,
29898,
5113,
29918,
333,
876,
13,
1678,
10876,
29889,
25393,
29889,
23126,
580,
13,
1678,
1018,
29901,
13,
4706,
9810,
29889,
1202,
29898,
9155,
261,
29892,
3577,
29918,
333,
29897,
13,
1678,
5174,
383,
3486,
2392,
408,
429,
29901,
13,
4706,
12020,
8960,
703,
2525,
519,
304,
6699,
3577,
426,
29900,
6177,
426,
29896,
29913,
1642,
4830,
29898,
5113,
29918,
333,
29892,
429,
876,
515,
429,
13,
1678,
1683,
29901,
13,
4706,
10876,
29889,
25393,
29889,
3539,
14182,
29878,
20927,
287,
29901,
426,
29900,
29913,
1642,
4830,
29898,
5113,
29918,
333,
876,
13,
1678,
7146,
29901,
13,
4706,
10876,
29889,
25393,
29889,
3539,
14182,
29876,
1159,
13,
4706,
10876,
29889,
25393,
29889,
23126,
580,
13,
13,
13,
1753,
788,
29918,
5113,
29918,
1445,
29898,
19033,
29892,
3577,
29918,
9507,
1125,
13,
1678,
9995,
2528,
263,
3577,
304,
278,
9810,
515,
263,
934,
29889,
13,
13,
1678,
9810,
29901,
282,
9415,
29886,
5863,
29889,
11481,
13,
1678,
3577,
29918,
9507,
29901,
4423,
310,
278,
3577,
934,
13,
13,
1678,
9995,
13,
1678,
10422,
29918,
2146,
600,
861,
353,
15300,
12637,
29889,
29916,
29920,
29915,
13,
1678,
396,
7338,
1461,
22029,
5163,
313,
3434,
3871,
1818,
367,
2224,
19248,
15865,
29899,
333,
1836,
12637,
29889,
29916,
29920,
467,
13,
1678,
1024,
353,
2897,
29889,
2084,
29889,
6500,
3871,
29898,
5113,
29918,
9507,
29897,
13,
13,
1678,
565,
451,
1024,
29889,
1975,
2541,
29898,
9507,
29918,
2146,
600,
861,
1125,
13,
4706,
1596,
703,
11432,
29901,
1815,
871,
788,
3577,
9913,
2135,
29879,
607,
505,
2983,
376,
13,
795,
376,
4561,
8620,
15865,
29899,
333,
7585,
29913,
1642,
4830,
29898,
9507,
29918,
2146,
600,
861,
876,
13,
13,
1678,
282,
9415,
29918,
333,
353,
1024,
7503,
29899,
2435,
29898,
9507,
29918,
2146,
600,
861,
4638,
13,
13,
1678,
396,
15758,
403,
278,
3577,
1178,
13,
1678,
22029,
1204,
29898,
15865,
29918,
333,
29897,
13,
13,
1678,
822,
6699,
29898,
3383,
3646,
1125,
13,
4706,
6597,
29918,
12637,
2135,
29898,
5113,
29918,
9507,
29892,
3646,
29897,
13,
13,
1678,
9810,
29889,
1202,
29898,
9155,
29892,
282,
9415,
29918,
333,
29897,
13,
13,
13,
1753,
3349,
29918,
5113,
29898,
6252,
29892,
9810,
29892,
3577,
29918,
333,
1125,
13,
1678,
9995,
15941,
263,
3577,
515,
278,
1887,
9810,
29889,
13,
13,
1678,
4829,
29879,
565,
738,
9741,
297,
3577,
29918,
4841,
526,
5039,
630,
297,
2601,
29889,
13,
13,
1678,
2601,
29901,
282,
9415,
29886,
5863,
29889,
23271,
13,
1678,
9810,
29901,
282,
9415,
29886,
5863,
29889,
11481,
13,
1678,
3577,
29918,
333,
29901,
3577,
3553,
304,
3349,
515,
9810,
13,
13,
1678,
9995,
13,
1678,
565,
3577,
29918,
333,
297,
2601,
29889,
657,
29918,
4925,
7295,
13,
4706,
12020,
22029,
16376,
29176,
703,
5620,
4746,
304,
3349,
6136,
3577,
426,
29900,
29913,
1642,
4830,
29898,
5113,
29918,
333,
876,
13,
13,
1678,
10876,
29889,
25393,
29889,
3539,
14182,
29878,
7301,
21081,
29901,
426,
29900,
29913,
1642,
4830,
29898,
5113,
29918,
333,
876,
13,
1678,
10876,
29889,
25393,
29889,
23126,
580,
13,
1678,
1018,
29901,
13,
4706,
396,
15758,
403,
3577,
1178,
29892,
393,
3577,
338,
5130,
29889,
13,
4706,
22029,
1204,
29898,
5113,
29918,
333,
29897,
13,
4706,
9810,
29889,
5992,
29898,
5113,
29918,
333,
29897,
13,
1678,
5174,
15758,
362,
2392,
408,
429,
29901,
13,
4706,
12020,
15758,
362,
2392,
703,
13919,
3577,
1178,
426,
29900,
29913,
1642,
4830,
29898,
5113,
29918,
333,
876,
515,
429,
13,
1678,
5174,
438,
29173,
408,
429,
29901,
13,
4706,
12020,
8960,
703,
2392,
11077,
3577,
426,
29900,
6177,
426,
29896,
29913,
1642,
4830,
29898,
5113,
29918,
333,
29892,
429,
876,
515,
429,
13,
1678,
1683,
29901,
13,
4706,
10876,
29889,
25393,
29889,
3539,
14182,
29878,
7301,
8238,
29901,
426,
29900,
29913,
1642,
4830,
29898,
5113,
29918,
333,
876,
13,
1678,
7146,
29901,
13,
4706,
10876,
29889,
25393,
29889,
3539,
14182,
29876,
1159,
13,
4706,
10876,
29889,
25393,
29889,
23126,
580,
13,
13,
13,
1753,
6230,
29898,
6252,
29892,
9810,
1125,
13,
1678,
9995,
2697,
701,
263,
10849,
2601,
310,
13681,
29914,
3267,
29889,
13,
13,
1678,
2601,
29901,
282,
9415,
29886,
5863,
29889,
23271,
13,
1678,
9810,
29901,
282,
9415,
29886,
5863,
29889,
11481,
13,
13,
1678,
9995,
13,
1678,
396,
5399,
363,
847,
3670,
29914,
4467,
359,
9085,
29914,
8704,
29889,
960,
451,
4864,
29892,
5142,
4129,
13,
1678,
396,
322,
2601,
847,
7070,
29914,
5205,
29881,
29914,
5205,
29914,
6149,
492,
29899,
1792,
29889,
5182,
29914,
29881,
3944,
29889,
5182,
13,
1678,
16087,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
6252,
29889,
4632,
29892,
376,
8704,
1159,
13,
1678,
565,
2897,
29889,
2084,
29889,
9933,
29898,
8704,
29918,
2084,
1125,
13,
4706,
396,
14350,
29892,
9025,
847,
7070,
29914,
5205,
29881,
29914,
5205,
29914,
29881,
3944,
29889,
5182,
363,
2446,
6579,
29889,
13,
4706,
270,
3944,
29918,
5182,
29918,
3972,
353,
2897,
29889,
2084,
29889,
25721,
29898,
6252,
29889,
5205,
29881,
29918,
3972,
29897,
13,
4706,
1018,
29901,
13,
9651,
2897,
29889,
29885,
12535,
12935,
29898,
29881,
3944,
29918,
5182,
29918,
3972,
29897,
13,
4706,
5174,
3497,
24217,
2392,
29901,
13,
9651,
1209,
13,
13,
4706,
2436,
29918,
1807,
29898,
359,
29889,
2084,
29889,
7122,
29898,
29881,
3944,
29918,
5182,
29918,
3972,
29892,
376,
29881,
3944,
29889,
5182,
4968,
13,
462,
268,
360,
3217,
29903,
29918,
29911,
1718,
7194,
29918,
22412,
3919,
29903,
29897,
13,
4706,
903,
1867,
29918,
8704,
29898,
6252,
29892,
9810,
29897,
13,
4706,
396,
1174,
519,
270,
3944,
29889,
5182,
871,
1156,
591,
505,
24146,
372,
304,
5557,
6257,
13,
4706,
396,
701,
6433,
2768,
310,
372,
1434,
591,
5039,
403,
278,
716,
731,
310,
9741,
29889,
13,
4706,
565,
2601,
29889,
1171,
482,
29918,
5205,
29881,
29901,
13,
9651,
903,
2962,
29918,
29881,
3944,
29918,
5182,
29898,
1271,
29918,
5205,
29881,
29922,
5574,
29897,
13,
4706,
2897,
29889,
5992,
29898,
8704,
29918,
2084,
29897,
13,
13,
1678,
396,
5399,
363,
847,
3670,
29914,
4467,
359,
9085,
29914,
6252,
29918,
18035,
29889,
960,
1476,
29892,
9792,
278,
7687,
13,
1678,
396,
2767,
29889,
13,
1678,
565,
2897,
29889,
2084,
29889,
9933,
11974,
3670,
29914,
4467,
359,
9085,
29914,
6252,
29918,
18035,
29908,
1125,
13,
4706,
3614,
29918,
2467,
29892,
10191,
353,
2601,
29889,
3757,
957,
29918,
26276,
29918,
4925,
580,
13,
4706,
565,
451,
3614,
29918,
2467,
29901,
13,
9651,
1596,
703,
3782,
24205,
8560,
29901,
6571,
1642,
4830,
29898,
7645,
876,
13,
13,
13,
1753,
903,
2962,
29918,
29881,
3944,
29918,
5182,
29898,
1271,
29918,
5205,
29881,
1125,
13,
1678,
694,
29918,
1271,
353,
5159,
565,
2908,
29918,
5205,
29881,
1683,
6796,
489,
1217,
29899,
1271,
3108,
13,
1678,
1423,
29918,
4804,
29898,
3366,
5205,
16948,
613,
376,
1388,
9857,
29899,
28120,
20068,
13,
1678,
1423,
29918,
4804,
29898,
3366,
5205,
16948,
613,
376,
12007,
613,
376,
29881,
3944,
29889,
5182,
613,
525,
489,
1217,
29899,
28120,
11287,
13,
1678,
1423,
29918,
4804,
29898,
3366,
5205,
16948,
613,
376,
2962,
613,
376,
29881,
3944,
29889,
5182,
3108,
718,
694,
29918,
1271,
29897,
13,
13,
13,
1753,
903,
1867,
29918,
8704,
29898,
6252,
29892,
9810,
1125,
13,
1678,
396,
4525,
2066,
881,
367,
731,
491,
278,
5177,
607,
12919,
23315,
13,
1678,
396,
278,
3495,
313,
9274,
29899,
2344,
467,
13,
1678,
9810,
29918,
2271,
353,
565,
29918,
9933,
29898,
1359,
29918,
1807,
29892,
2601,
29889,
657,
29918,
2917,
29918,
9507,
703,
14669,
29899,
15764,
29914,
19033,
29899,
2271,
5783,
13,
13,
1678,
396,
14402,
29898,
4912,
284,
4992,
1125,
960,
727,
338,
29871,
29896,
29974,
5835,
29892,
17229,
278,
6136,
2295,
515,
263,
5835,
29889,
13,
1678,
396,
960,
278,
2295,
508,
29915,
29873,
367,
2646,
1327,
287,
515,
738,
310,
963,
29892,
4418,
29889,
13,
1678,
822,
6699,
261,
29898,
333,
29892,
3646,
1125,
13,
4706,
565,
9810,
29918,
2271,
338,
6213,
29901,
13,
9651,
12020,
15758,
362,
2392,
703,
11432,
29901,
10050,
29899,
2997,
3577,
6571,
541,
694,
9810,
3142,
2183,
1213,
29889,
4830,
29898,
19033,
29918,
2271,
876,
13,
4706,
736,
7274,
29918,
9155,
261,
29898,
19033,
29918,
2271,
29892,
1178,
29892,
3646,
29892,
2897,
29889,
657,
29883,
9970,
3101,
13,
13,
1678,
396,
14187,
3495,
29914,
19594,
29899,
14940,
9741,
3971,
304,
278,
22101,
7522,
13,
1678,
396,
515,
278,
6230,
29899,
8318,
4138,
964,
278,
9810,
29889,
1938,
451,
26556,
470,
13,
1678,
396,
10366,
5923,
9741,
29892,
2898,
4418,
2012,
29889,
13,
1678,
6230,
29918,
8318,
29918,
517,
29918,
11236,
403,
353,
5159,
13,
1678,
6230,
29918,
15865,
29918,
3972,
353,
2601,
29889,
657,
29918,
2917,
29918,
9507,
703,
14669,
29899,
8318,
1159,
13,
1678,
3509,
29918,
9155,
261,
353,
7687,
7373,
8552,
29918,
9155,
261,
29892,
6230,
29918,
15865,
29918,
3972,
29897,
13,
1678,
565,
2897,
29889,
2084,
29889,
9933,
29898,
14669,
29918,
15865,
29918,
3972,
1125,
13,
4706,
363,
282,
9415,
29918,
333,
29918,
710,
297,
2897,
29889,
1761,
3972,
29898,
14669,
29918,
15865,
29918,
3972,
1125,
13,
9651,
1596,
703,
23271,
292,
6230,
3577,
29901,
6571,
1642,
4830,
29898,
15865,
29918,
333,
29918,
710,
876,
13,
9651,
565,
451,
22029,
1204,
29889,
275,
29918,
333,
29898,
15865,
29918,
333,
29918,
710,
1125,
13,
18884,
12020,
15758,
362,
2392,
703,
13919,
3577,
1178,
297,
6230,
3577,
29901,
6571,
1642,
4830,
29898,
15865,
29918,
333,
29918,
710,
876,
13,
9651,
282,
9415,
29918,
333,
353,
22029,
1204,
29898,
15865,
29918,
333,
29918,
710,
29897,
13,
9651,
565,
282,
9415,
29918,
333,
29889,
3259,
2804,
376,
14669,
1115,
13,
18884,
12020,
15758,
362,
2392,
29898,
13,
462,
1678,
376,
26947,
9741,
313,
386,
852,
297,
23230,
29900,
29913,
6348,
1818,
505,
278,
1873,
6230,
29889,
376,
13,
462,
1678,
376,
22050,
3577,
29901,
426,
29896,
29913,
1642,
4830,
29898,
14669,
29918,
15865,
29918,
3972,
29892,
282,
9415,
29918,
333,
29918,
710,
876,
13,
13,
9651,
396,
8561,
1854,
727,
338,
694,
5923,
3577,
13,
9651,
565,
9810,
29889,
5349,
29918,
5113,
29898,
15865,
29918,
333,
29918,
710,
1125,
13,
18884,
1596,
703,
29956,
25614,
29901,
18076,
8253,
2307,
5130,
3577,
6571,
1642,
4830,
29898,
15865,
29918,
333,
29918,
710,
876,
13,
13,
9651,
9810,
29889,
1202,
29898,
8552,
29918,
9155,
261,
29892,
282,
9415,
29918,
333,
29918,
710,
29897,
13,
9651,
6230,
29918,
8318,
29918,
517,
29918,
11236,
403,
29889,
4397,
29898,
15865,
29918,
333,
29918,
710,
29897,
13,
13,
1678,
396,
960,
6136,
29889,
3126,
338,
731,
373,
278,
3495,
29892,
671,
393,
408,
278,
731,
310,
9741,
304,
13,
1678,
396,
5039,
403,
29889,
13466,
925,
671,
278,
731,
310,
5279,
6136,
9741,
313,
386,
852,
13,
1678,
396,
6136,
297,
278,
16087,
9913,
2135,
29897,
13,
1678,
304,
29918,
11236,
403,
353,
6213,
13,
1678,
6136,
29918,
2084,
353,
2601,
29889,
657,
29918,
2917,
29918,
9507,
703,
14669,
29899,
15764,
29914,
4925,
29889,
3126,
1159,
13,
1678,
565,
2897,
29889,
2084,
29889,
9933,
29898,
4925,
29918,
2084,
1125,
13,
4706,
1596,
703,
29147,
6136,
9741,
515,
613,
6136,
29918,
2084,
29897,
13,
4706,
304,
29918,
11236,
403,
353,
2254,
29918,
3126,
29898,
4925,
29918,
2084,
29897,
13,
13,
4706,
396,
22521,
545,
599,
9741,
526,
1887,
13,
4706,
1596,
703,
29923,
1983,
3864,
599,
9741,
297,
6136,
731,
6571,
526,
1887,
1642,
4830,
28165,
1642,
7122,
29898,
517,
29918,
11236,
403,
4961,
13,
4706,
363,
3577,
297,
304,
29918,
11236,
403,
29901,
13,
9651,
9810,
29889,
1202,
29898,
9155,
261,
29892,
3577,
29897,
13,
1678,
1683,
29901,
13,
4706,
1596,
703,
27065,
630,
6136,
9741,
515,
16087,
9913,
2135,
1159,
13,
4706,
304,
29918,
11236,
403,
353,
1051,
29898,
6252,
29889,
657,
29918,
4925,
3101,
13,
13,
4706,
396,
383,
3486,
322,
5039,
403,
599,
13877,
5684,
9741,
304,
10259,
1384,
278,
16087,
9741,
29889,
13,
4706,
9867,
29918,
8318,
29918,
9507,
353,
2601,
29889,
657,
29918,
2917,
29918,
9507,
703,
14669,
29899,
15764,
29914,
19594,
29899,
8318,
29889,
3126,
1159,
13,
4706,
9867,
29918,
8318,
353,
565,
29918,
9933,
29898,
1359,
29918,
3126,
29892,
9867,
29918,
8318,
29918,
9507,
29897,
13,
4706,
1596,
703,
5596,
292,
363,
9867,
9741,
297,
29901,
613,
9867,
29918,
8318,
29918,
9507,
29897,
13,
4706,
565,
9867,
29918,
8318,
29901,
13,
9651,
565,
451,
338,
8758,
29898,
19594,
29918,
8318,
29892,
1051,
1125,
13,
18884,
1596,
877,
11432,
29901,
6571,
881,
1712,
263,
4663,
1051,
310,
9741,
29889,
15992,
263,
6571,
4286,
4830,
29898,
19594,
29918,
8318,
29918,
9507,
29892,
13,
462,
462,
462,
462,
462,
3986,
1134,
29898,
19594,
29918,
8318,
4961,
13,
9651,
1596,
703,
23456,
9867,
29899,
8318,
29901,
6571,
1642,
4830,
29898,
19594,
29918,
8318,
876,
13,
13,
9651,
363,
3577,
29918,
333,
29918,
710,
297,
9867,
29918,
8318,
29901,
13,
18884,
396,
15758,
403,
278,
3577,
18999,
13,
18884,
282,
9415,
29918,
333,
353,
22029,
1204,
29898,
5113,
29918,
333,
29918,
710,
29897,
13,
13,
18884,
396,
383,
3486,
278,
9741,
565,
451,
1887,
13,
18884,
565,
451,
9810,
29889,
5349,
29918,
5113,
29898,
5113,
29918,
333,
29918,
710,
1125,
13,
462,
1678,
9810,
29889,
1202,
29898,
9155,
261,
29892,
3577,
29918,
333,
29918,
710,
29897,
13,
13,
18884,
396,
3462,
278,
3577,
304,
278,
731,
304,
5039,
403,
13,
18884,
6230,
29918,
8318,
29918,
517,
29918,
11236,
403,
29889,
4397,
29898,
5113,
29918,
333,
29918,
710,
29897,
13,
4706,
1683,
29901,
13,
9651,
1596,
703,
3782,
9867,
29899,
8318,
6790,
1159,
13,
13,
1678,
396,
20535,
403,
278,
2989,
731,
310,
2186,
9741,
313,
9544,
4019,
5039,
800,
718,
6230,
9741,
467,
13,
1678,
396,
897,
29899,
20908,
5926,
773,
263,
731,
29889,
13,
1678,
304,
29918,
11236,
403,
353,
1051,
29898,
842,
29898,
517,
29918,
11236,
403,
718,
6230,
29918,
8318,
29918,
517,
29918,
11236,
403,
876,
13,
13,
1678,
1596,
703,
21786,
1218,
9741,
1159,
13,
1678,
2601,
29889,
11236,
403,
29898,
19033,
29889,
1359,
29918,
8318,
29898,
517,
29918,
11236,
403,
876,
13,
13,
13,
1753,
903,
8552,
29918,
9155,
261,
29898,
14669,
29918,
15865,
29918,
3972,
29892,
1178,
3383,
3646,
1125,
13,
1678,
4765,
29918,
15865,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
14669,
29918,
15865,
29918,
3972,
29892,
1178,
19925,
718,
5591,
29908,
13,
1678,
1423,
29918,
4804,
29898,
3366,
6814,
613,
11663,
19080,
613,
4765,
29918,
15865,
29918,
2084,
29892,
3646,
2314,
13,
13,
13,
1753,
903,
7302,
29918,
9675,
16948,
29898,
26740,
29892,
2669,
1125,
13,
1678,
1018,
29901,
13,
4706,
1423,
29918,
4804,
29898,
3366,
9675,
16948,
613,
11663,
29939,
613,
11663,
29893,
613,
4444,
2314,
13,
1678,
5174,
3037,
839,
7032,
2392,
29901,
13,
4706,
1480,
29889,
27392,
703,
9675,
16948,
426,
26740,
29913,
451,
731,
363,
426,
5509,
29913,
1642,
4830,
29898,
26740,
29922,
26740,
29892,
2669,
29922,
5509,
876,
13,
13,
13,
1753,
903,
7302,
29918,
9675,
16948,
29918,
11027,
29898,
9675,
16948,
29918,
11027,
29892,
2669,
1125,
13,
1678,
363,
4444,
29892,
995,
297,
10876,
16948,
29918,
11027,
29889,
657,
29898,
5509,
29892,
6571,
467,
7076,
7295,
13,
4706,
903,
7302,
29918,
9675,
16948,
703,
29912,
26740,
29913,
3790,
1767,
29913,
1642,
4830,
29898,
26740,
29922,
26740,
29892,
995,
29922,
1767,
511,
2669,
29897,
13,
13,
13,
1753,
3394,
29918,
5509,
29918,
13305,
29898,
5509,
1125,
13,
1678,
565,
451,
2897,
29889,
2084,
29889,
9933,
29898,
29928,
3217,
29903,
29918,
6304,
19059,
29918,
25903,
4574,
8098,
29918,
10145,
1125,
13,
4706,
736,
13,
13,
1678,
270,
3944,
29918,
5509,
29918,
11330,
353,
2254,
29918,
3126,
29898,
29928,
3217,
29903,
29918,
6304,
19059,
29918,
25903,
4574,
8098,
29918,
10145,
29897,
13,
1678,
565,
317,
21554,
1783,
29931,
29918,
10490,
29911,
4214,
29918,
10818,
297,
270,
3944,
29918,
5509,
29918,
11330,
29901,
13,
4706,
903,
7302,
29918,
9675,
16948,
29918,
11027,
29898,
29881,
3944,
29918,
5509,
29918,
11330,
29961,
14816,
29903,
1783,
29931,
29918,
10490,
29911,
4214,
29918,
10818,
1402,
2669,
29897,
13,
2
] |
hivemind/client/__init__.py | Vsevolod-pl/hivemind | 11 | 123088 | from hivemind.client.expert import RemoteExpert
from hivemind.client.moe import RemoteMixtureOfExperts
from hivemind.client.switch_moe import RemoteSwitchMixtureOfExperts
from hivemind.client.averaging import DecentralizedAverager
from hivemind.client.averaging.training import TrainingAverager
| [
1,
515,
298,
440,
331,
513,
29889,
4645,
29889,
735,
10700,
1053,
5240,
866,
1252,
10700,
13,
3166,
298,
440,
331,
513,
29889,
4645,
29889,
4346,
29872,
1053,
5240,
866,
29924,
29875,
15546,
2776,
1252,
546,
1372,
13,
3166,
298,
440,
331,
513,
29889,
4645,
29889,
15123,
29918,
4346,
29872,
1053,
5240,
866,
24995,
29924,
29875,
15546,
2776,
1252,
546,
1372,
13,
3166,
298,
440,
331,
513,
29889,
4645,
29889,
12483,
6751,
1053,
3826,
296,
1705,
1891,
29909,
369,
1875,
13,
3166,
298,
440,
331,
513,
29889,
4645,
29889,
12483,
6751,
29889,
26495,
1053,
26101,
29909,
369,
1875,
13,
2
] |
algorithms/acm/sort.py | MarkWh1te/Gate-of-Babylon | 2 | 185870 | """Sorting Algorithms In Python
"""
"""
Dutch national flag problem
https://en.wikipedia.org/wiki/Dutch_national_flag_problem
"""
def sort_colors(nums: [int], pivot: int)->[int]:
small = 0
current = 1
big = len(nums)-1
while current < big:
if nums[current] == pivot:
current += 1
elif nums[current] > pivot:
nums[big], nums[current] = nums[current], nums[big]
big -= 1
else:
nums[current], nums[small] = nums[small], nums[current]
small += 1
current += 1
return nums
def quick_sort(numbers: list):
if len(numbers) <= 1:
return numbers
pivot = numbers[0]
left = [i for i in numbers[1:] if i <= pivot]
right = [i for i in numbers[1:] if i > pivot]
return quick_sort(left) + [pivot] + quick_sort(right)
| [
1,
9995,
13685,
292,
11545,
12404,
512,
5132,
13,
15945,
29908,
13,
13,
15945,
29908,
13,
29928,
10519,
4797,
7353,
1108,
13,
991,
597,
264,
29889,
6011,
29889,
990,
29914,
4594,
29914,
29928,
10519,
29918,
29876,
1288,
29918,
15581,
29918,
17199,
13,
15945,
29908,
13,
13,
13,
1753,
2656,
29918,
27703,
29898,
1949,
29879,
29901,
518,
524,
1402,
24438,
29901,
938,
19969,
29961,
524,
5387,
13,
1678,
2319,
353,
29871,
29900,
13,
1678,
1857,
353,
29871,
29896,
13,
1678,
4802,
353,
7431,
29898,
1949,
29879,
6817,
29896,
13,
1678,
1550,
1857,
529,
4802,
29901,
13,
4706,
565,
954,
29879,
29961,
3784,
29962,
1275,
24438,
29901,
13,
9651,
1857,
4619,
29871,
29896,
13,
4706,
25342,
954,
29879,
29961,
3784,
29962,
1405,
24438,
29901,
13,
9651,
954,
29879,
29961,
3752,
1402,
954,
29879,
29961,
3784,
29962,
353,
954,
29879,
29961,
3784,
1402,
954,
29879,
29961,
3752,
29962,
13,
9651,
4802,
22361,
29871,
29896,
13,
4706,
1683,
29901,
13,
9651,
954,
29879,
29961,
3784,
1402,
954,
29879,
29961,
9278,
29962,
353,
954,
29879,
29961,
9278,
1402,
954,
29879,
29961,
3784,
29962,
13,
9651,
2319,
4619,
29871,
29896,
13,
9651,
1857,
4619,
29871,
29896,
13,
1678,
736,
954,
29879,
13,
13,
13,
1753,
4996,
29918,
6605,
29898,
20326,
29901,
1051,
1125,
13,
1678,
565,
7431,
29898,
20326,
29897,
5277,
29871,
29896,
29901,
13,
4706,
736,
3694,
13,
1678,
24438,
353,
3694,
29961,
29900,
29962,
13,
1678,
2175,
353,
518,
29875,
363,
474,
297,
3694,
29961,
29896,
17531,
565,
474,
5277,
24438,
29962,
13,
1678,
1492,
353,
518,
29875,
363,
474,
297,
3694,
29961,
29896,
17531,
565,
474,
1405,
24438,
29962,
13,
1678,
736,
4996,
29918,
6605,
29898,
1563,
29897,
718,
518,
29886,
11002,
29962,
718,
4996,
29918,
6605,
29898,
1266,
29897,
13,
2
] |
pypospack/potential/threebody.py | eragasa/pypospack | 4 | 99153 | <reponame>eragasa/pypospack<filename>pypospack/potential/threebody.py
from collections import OrderedDict
from pypospack.potential import Potential
class ThreeBodyPotential(Potential):
def _init_parameter_names(self):
# TODO: This is only written for a single element potential
for i in range(len(self.symbols)):
for j in range(len(self.symbols)):
for k in range(len(self.symbols)):
el1 = self.symbols[i]
el2 = self.symbols[j]
el3 = self.symbols[k]
self._add_parameter_names(el1, el2, el3)
def _add_parameter_names(self,el1,el2,el3):
s = "{}{}{}".format(el1,el2,el3)
self.parameter_names = []
for p in self.threebody_parameter_names:
self.parameter_names.append('{}__{}'.format(s,p))
def _init_parameters(self):
self.parameters = OrderedDict()
for p in self.parameter_names:
self.parameters[p] = None
| [
1,
529,
276,
1112,
420,
29958,
261,
351,
11290,
29914,
2272,
1066,
4058,
29966,
9507,
29958,
2272,
1066,
4058,
29914,
17765,
2556,
29914,
386,
276,
774,
1486,
29889,
2272,
13,
3166,
16250,
1053,
8170,
287,
21533,
13,
3166,
11451,
1066,
4058,
29889,
17765,
2556,
1053,
10173,
2556,
13,
13,
1990,
12753,
8434,
29925,
327,
2556,
29898,
29925,
327,
2556,
1125,
13,
13,
1678,
822,
903,
2344,
29918,
15501,
29918,
7039,
29898,
1311,
1125,
13,
4706,
396,
14402,
29901,
910,
338,
871,
3971,
363,
263,
2323,
1543,
7037,
13,
4706,
363,
474,
297,
3464,
29898,
2435,
29898,
1311,
29889,
18098,
29879,
22164,
13,
9651,
363,
432,
297,
3464,
29898,
2435,
29898,
1311,
29889,
18098,
29879,
22164,
13,
18884,
363,
413,
297,
3464,
29898,
2435,
29898,
1311,
29889,
18098,
29879,
22164,
13,
462,
1678,
560,
29896,
353,
1583,
29889,
18098,
29879,
29961,
29875,
29962,
13,
462,
1678,
560,
29906,
353,
1583,
29889,
18098,
29879,
29961,
29926,
29962,
13,
462,
1678,
560,
29941,
353,
1583,
29889,
18098,
29879,
29961,
29895,
29962,
13,
462,
1678,
1583,
3032,
1202,
29918,
15501,
29918,
7039,
29898,
295,
29896,
29892,
560,
29906,
29892,
560,
29941,
29897,
13,
13,
1678,
822,
903,
1202,
29918,
15501,
29918,
7039,
29898,
1311,
29892,
295,
29896,
29892,
295,
29906,
29892,
295,
29941,
1125,
13,
4706,
269,
353,
29850,
1157,
1157,
29913,
1642,
4830,
29898,
295,
29896,
29892,
295,
29906,
29892,
295,
29941,
29897,
13,
13,
4706,
1583,
29889,
15501,
29918,
7039,
353,
5159,
13,
4706,
363,
282,
297,
1583,
29889,
386,
276,
774,
1486,
29918,
15501,
29918,
7039,
29901,
13,
9651,
1583,
29889,
15501,
29918,
7039,
29889,
4397,
877,
29912,
2403,
648,
29913,
4286,
4830,
29898,
29879,
29892,
29886,
876,
13,
13,
1678,
822,
903,
2344,
29918,
16744,
29898,
1311,
1125,
13,
4706,
1583,
29889,
16744,
353,
8170,
287,
21533,
580,
13,
4706,
363,
282,
297,
1583,
29889,
15501,
29918,
7039,
29901,
13,
9651,
1583,
29889,
16744,
29961,
29886,
29962,
353,
6213,
13,
2
] |
tests/unit/test_placeholder.py | djpugh/docserver-client | 1 | 167803 | <filename>tests/unit/test_placeholder.py<gh_stars>1-10
import unittest
class PlaceholderTestCase(unittest.TestCase):
def test_x(self):
self.assertEqual(1, 1)
| [
1,
529,
9507,
29958,
21150,
29914,
5441,
29914,
1688,
29918,
27074,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
5215,
443,
27958,
13,
13,
1990,
15484,
7694,
3057,
8259,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
13,
1678,
822,
1243,
29918,
29916,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
9843,
29898,
29896,
29892,
29871,
29896,
29897,
13,
2
] |
OPTICS2.py | k-kapp/Clustering-Algos | 0 | 27363 | # -*- coding: utf-8 -*-
"""
Created on Mon Nov 30 21:25:24 2015
@author: Konrad
"""
import copy
import numpy as np
import matplotlib.pyplot as plt
import scipy.special as sc_p
def gen_clusters(means, num_each):
tup = ();
for m in means:
tup = tup + (np.random.multivariate_normal(m, np.diag(np.ones(2)), num_each),)
data = np.concatenate(tup);
np.random.shuffle(data);
return data;
def make_pts(data):
pts = [];
for pos in data:
pts.append(Point(pos));
return pts;
def euclid(obj1, obj2):
if (isinstance(obj1, Point) and isinstance(obj2, Point)):
return np.sqrt(sum(( obj1.pos - obj2.pos )**2));
elif (isinstance(obj1, np.ndarray) and isinstance(obj2, np.ndarray)):
return np.sqrt(sum(( obj1 - obj2 )**2))
else:
return None;
class Point:
def __init__(self, pos):
self.pos = copy.deepcopy(pos);
self.processed = False;
self.core_dist = None;
self.reach_dist = None;
self.in_seed = False;
class OPTICS:
def __init__(self, min_pts, data, max_eps = None):
self.max_eps = max_eps;
self.min_pts = min_pts;
self.data = copy.deepcopy(data);
self.dim = self.data[0].pos.size;
self.main_list = [];
if (self.max_eps == None):
self.get_max_eps();
self.main_loop();
def __call__(self, main_idx):
return self.data[self.main_list[main_idx]].reach_dist;
def main_loop(self):
for idx, obj in enumerate(self.data):
if (not obj.processed):
self.expand_point(idx);
for idx, obj in enumerate(self.data):
if (not obj.processed):
self.append_main(idx);
def get_max_eps(self):
extr_x = self.get_extr_x();
extr_y = self.get_extr_y();
area = (extr_x[1] - extr_x[0])*(extr_y[1] - extr_y[0]);
self.max_eps = ((area*self.min_pts*sc_p.gamma(2))/(len(self.data)*np.sqrt(np.pi**2)))**0.5
def get_extr_x(self):
min_x = float("inf");
max_x = -float("inf");
for obj in self.data:
if obj.pos[0] < min_x:
min_x = obj.pos[0];
if obj.pos[0] > max_x:
max_x = obj.pos[0];
return (min_x, max_x);
def get_extr_y(self):
min_y = float("inf");
max_y = -float("inf");
for obj in self.data:
if obj.pos[1] < min_y:
min_y = obj.pos[1];
if obj.pos[1] > max_y:
max_y = obj.pos[1];
return (min_y, max_y);
def append_main(self, idx):
self.data[idx].processed = True;
if (self.data[idx].reach_dist == None):
self.data[idx].reach_dist = self.max_eps;
self.main_list.append(idx);
def expand_point(self, idx):
self.get_neighbours(idx);
self.get_core_dist(idx);
if (self.data[idx].core_dist == -1):
return;
else:
self.data[idx].processed = True;
self.append_main(idx);
seed_list = [];
self.append_seed(seed_list, self.data[idx].neighbours, idx)
while (len(seed_list) > 0):
curr_idx = seed_list[0];
self.get_neighbours(curr_idx);
self.get_core_dist(curr_idx);
self.data[curr_idx].processed = True;
self.append_main(curr_idx);
self.remove_seed(seed_list);
if (not (self.data[curr_idx].core_dist == -1)):
self.append_seed(seed_list, self.data[curr_idx].neighbours, curr_idx);
def get_core_dist(self, idx):
if (len(self.data[idx].neighbours) >= self.min_pts):
self.data[idx].core_dist = self.data[idx].neighbours[self.min_pts - 1][1];
else:
self.data[idx].core_dist = -1;
def get_reach_dist(self, center_idx, idx, dist):
r_dist = max(dist, self.data[center_idx].core_dist);
if (self.data[idx].reach_dist == None):
self.data[idx].reach_dist = r_dist;
return True;
elif (self.data[idx].reach_dist > r_dist):
self.data[idx].reach_dist = r_dist;
return True;
else:
return False;
def get_neighbours(self, idx):
self.data[idx].neighbours = [];
for n_idx, obj in enumerate(self.data):
dist = euclid(obj, self.data[idx])
if (dist <= self.max_eps):
self.data[idx].neighbours.append([n_idx, dist]);
self.data[idx].neighbours.sort(key = lambda x : x[1]);
def append_seed(self, seed_list, neighbours, center_idx):
for n_tup in neighbours:
changed = self.get_reach_dist(center_idx, n_tup[0], n_tup[1]);
if (self.data[n_tup[0]].in_seed and changed):
del seed_list[seed_list.index(n_tup[0])];
self.data[n_tup[0]].in_seed = False;
elif (self.data[n_tup[0]].processed or self.data[n_tup[0]].in_seed):
continue;
for idx, obj in enumerate(seed_list):
if ( self.data[n_tup[0]].reach_dist < self.data[obj].reach_dist ):
seed_list.insert(idx, n_tup[0]);
self.data[n_tup[0]].in_seed = True;
break;
if (not self.data[n_tup[0]].in_seed):
seed_list.append(n_tup[0]);
self.data[n_tup[0]].in_seed = True;
def remove_seed(self, seed_list):
self.data[seed_list[0]].in_seed = False;
del seed_list[0];
def reach_plot(self):
x = list(range(len(self.main_list)));
y = [];
for idx in self.main_list:
y.append(self.data[idx].reach_dist);
f, ax = plt.subplots();
ax.bar(x, y);
def print_reach_dist(self):
for idx in self.main_list:
print (idx)
print (self.data[idx].reach_dist)
def plot_data(self):
x = [];
y = [];
for obj in self.data:
x.append(obj.pos[0]);
y.append(obj.pos[1]);
f, ax = plt.subplots();
ax.scatter(x, y);
def get_num_clusters(self):
clusters = [];
up = True;
top, bottom = -1, -1;
for i, idx in enumerate(self.main_list[:-1]):
if (up and (self.data[idx].reach_dist > self.data[self.main_list[i + 1]])):
up = not up;
if (not bottom == -1):
clusters.append(top - bottom);
top = self.data[idx].reach_dist;
continue;
if (not up) and (self.data[idx].reach_dist < self.data[self.main_list[i + 1]].reach_dist):
up = not up;
bottom = self.data[idx].reach_dist;
class Clusters:
def __init__(optics_obj, eps):
self.optics_obj = optics_obj;
self.main_list = optics_obj.main_list;
self.eps = eps;
self.min_pts = optics_obj.min_pts;
def find(self):
idx = 0;
#down, up = False, False;
downs = [];
clusters = [];
while idx < len(self.main_list):
diff = self.main_list[idx] - self.main_list[idx + 1];
if (diff >= self.optics_obj(idx)*self.eps):
new_down, idx = self.proc_down(idx);
downs.append([new_down, -float("inf")]);
#glob_mib = self.optics_obj(downs[-1][0][0]]);
#self.filter_downs(glob_mib, downs);
elif (-diff >= self.optics_obj(idx)*self.eps):
glob_mib = self.get_glob_mib(downs[-1], idx);
self.filter_downs(glob_mib, downs);
up, idx = self.proc_up(idx);
for down in downs:
if (self.optics_obj(up[1]).reach_dist*(1 - self.eps) >= down[1]):
clusters.append((down[0][0], up[1]));
else:
idx += 1;
def get_glob_mib(self, last_down, curr_idx):
begin_idx, end_idx = last_down[0][1], curr_idx;
glob_mib = -float("inf");
for i in range(begin_idx, end_idx + 1):
if (self.optics_obj(i) > glob_mib):
glob_mib = self.optics_obj(i);
return glob_mib;
def proc_down(self, idx):
bad_inrow = 0;
begin_idx = idx;
while (idx < len(self.main_list)):
idx += 1;
diff = self.main_list[idx].reach_dist - self.main_list[idx + 1].reach_dist;
if (diff < 0):
return (begin_idx, idx - 1);
if (diff > 0):
if (diff >= self.eps*self.main_list[idx]):
bad_inrow = 0;
else:
if (bad_inrow == 0):
last_good = idx - 1;
bad_inrow += 1;
if bad_inrow > self.min_pts:
# include a check that ensures region does not have
# length zero?
return (begin_idx, last_good), idx;
def proc_up(self, idx):
bad_inrow = 0;
begin_idx = idx;
while (idx < len(self.main_list)):
idx += 1;
diff = self.main_list[idx].reach_dist[idx + 1] - self.main_list[idx].reach_dist;
if (diff < 0):
return (begin_idx, idx - 1);
if (diff > 0):
if (diff >= self.eps*self.main_list[idx + 1]):
bad_inrow = 0;
else:
if (bad_inrow == 0):
last_good = idx - 1;
bad_inrow += 1;
if (bad_inrow > self.min_pts):
return (begin_idx, last_good), idx;
def filter_downs(self, glob_mib, downs):
del_idx = [];
for idx, obj in enumerate(downs[:-1]):
if self.main_list[obj[0][0]].reach_dist*(1 - self.eps) < glob_mib:
del_idx.append(idx);
elif (obj[1] < glob_mib):
downs[idx][1] = glob_mib;
del_idx.reverse();
for i in del_idx:
del downs[i];
dat = gen_clusters([[1, 1], [6, 7], [10, 15], [15, 15]], 200);
data = make_pts(dat);
optics = OPTICS(15, data);
optics.reach_plot();
optics.plot_data();
plt.show();
#optics.print_reach_dist();
print ("Done") | [
1,
396,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
30004,
13,
15945,
19451,
13,
20399,
373,
2598,
2864,
29871,
29941,
29900,
29871,
29906,
29896,
29901,
29906,
29945,
29901,
29906,
29946,
29871,
29906,
29900,
29896,
29945,
30004,
13,
30004,
13,
29992,
8921,
29901,
5250,
3665,
30004,
13,
15945,
19451,
13,
30004,
13,
5215,
3509,
30004,
13,
5215,
12655,
408,
7442,
30004,
13,
5215,
22889,
29889,
2272,
5317,
408,
14770,
30004,
13,
5215,
4560,
2272,
29889,
18732,
408,
885,
29918,
29886,
30004,
13,
30004,
13,
1753,
2531,
29918,
695,
504,
414,
29898,
1004,
550,
29892,
954,
29918,
4204,
1125,
30004,
13,
1678,
260,
786,
353,
313,
6075,
13,
1678,
363,
286,
297,
2794,
29901,
30004,
13,
4706,
260,
786,
353,
260,
786,
718,
313,
9302,
29889,
8172,
29889,
4713,
27432,
403,
29918,
8945,
29898,
29885,
29892,
7442,
29889,
6051,
351,
29898,
9302,
29889,
2873,
29898,
29906,
8243,
954,
29918,
4204,
511,
8443,
13,
1678,
848,
353,
7442,
29889,
535,
29883,
2579,
403,
29898,
29873,
786,
6075,
13,
1678,
7442,
29889,
8172,
29889,
845,
21897,
29898,
1272,
6075,
13,
1678,
736,
848,
2104,
13,
30004,
13,
1753,
1207,
29918,
16485,
29898,
1272,
1125,
30004,
13,
1678,
282,
1372,
353,
13769,
30004,
13,
1678,
363,
926,
297,
848,
29901,
30004,
13,
4706,
282,
1372,
29889,
4397,
29898,
5228,
29898,
1066,
2483,
30004,
13,
1678,
736,
282,
1372,
2104,
13,
30004,
13,
1753,
11878,
695,
333,
29898,
5415,
29896,
29892,
5446,
29906,
1125,
30004,
13,
1678,
565,
313,
275,
8758,
29898,
5415,
29896,
29892,
8984,
29897,
322,
338,
8758,
29898,
5415,
29906,
29892,
8984,
22164,
30004,
13,
4706,
736,
7442,
29889,
3676,
29898,
2083,
3552,
5446,
29896,
29889,
1066,
448,
5446,
29906,
29889,
1066,
1723,
1068,
29906,
2483,
30004,
13,
1678,
25342,
313,
275,
8758,
29898,
5415,
29896,
29892,
7442,
29889,
299,
2378,
29897,
322,
338,
8758,
29898,
5415,
29906,
29892,
7442,
29889,
299,
2378,
22164,
30004,
13,
4706,
736,
7442,
29889,
3676,
29898,
2083,
3552,
5446,
29896,
448,
5446,
29906,
1723,
1068,
29906,
876,
30004,
13,
1678,
1683,
29901,
30004,
13,
4706,
736,
6213,
2104,
13,
30004,
13,
1990,
8984,
29901,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
926,
1125,
30004,
13,
4706,
1583,
29889,
1066,
353,
3509,
29889,
24535,
8552,
29898,
1066,
6075,
13,
4706,
1583,
29889,
5014,
287,
353,
7700,
2104,
13,
4706,
1583,
29889,
3221,
29918,
5721,
353,
6213,
2104,
13,
4706,
1583,
29889,
276,
496,
29918,
5721,
353,
6213,
2104,
13,
4706,
1583,
29889,
262,
29918,
26776,
353,
7700,
2104,
13,
4706,
6756,
13,
30004,
13,
1990,
6418,
29911,
2965,
29903,
29901,
30004,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1375,
29918,
16485,
29892,
848,
29892,
4236,
29918,
8961,
353,
6213,
1125,
30004,
13,
4706,
1583,
29889,
3317,
29918,
8961,
353,
4236,
29918,
8961,
2104,
13,
4706,
1583,
29889,
1195,
29918,
16485,
353,
1375,
29918,
16485,
2104,
13,
4706,
1583,
29889,
1272,
353,
3509,
29889,
24535,
8552,
29898,
1272,
6075,
13,
4706,
1583,
29889,
6229,
353,
1583,
29889,
1272,
29961,
29900,
1822,
1066,
29889,
2311,
2104,
13,
4706,
1583,
29889,
3396,
29918,
1761,
353,
13769,
30004,
13,
4706,
565,
313,
1311,
29889,
3317,
29918,
8961,
1275,
6213,
1125,
30004,
13,
9651,
1583,
29889,
657,
29918,
3317,
29918,
8961,
14078,
13,
4706,
1583,
29889,
3396,
29918,
7888,
14078,
13,
1678,
6756,
13,
1678,
822,
4770,
4804,
12035,
1311,
29892,
1667,
29918,
13140,
1125,
30004,
13,
4706,
736,
1583,
29889,
1272,
29961,
1311,
29889,
3396,
29918,
1761,
29961,
3396,
29918,
13140,
29962,
1822,
276,
496,
29918,
5721,
2104,
13,
1678,
6756,
13,
1678,
822,
1667,
29918,
7888,
29898,
1311,
1125,
30004,
13,
4706,
363,
22645,
29892,
5446,
297,
26985,
29898,
1311,
29889,
1272,
1125,
30004,
13,
9651,
565,
313,
1333,
5446,
29889,
5014,
287,
1125,
30004,
13,
18884,
1583,
29889,
18837,
29918,
3149,
29898,
13140,
6075,
13,
4706,
6756,
13,
4706,
363,
22645,
29892,
5446,
297,
26985,
29898,
1311,
29889,
1272,
1125,
30004,
13,
9651,
565,
313,
1333,
5446,
29889,
5014,
287,
1125,
30004,
13,
18884,
1583,
29889,
4397,
29918,
3396,
29898,
13140,
6075,
13,
1678,
6756,
13,
1678,
6756,
13,
1678,
822,
679,
29918,
3317,
29918,
8961,
29898,
1311,
1125,
30004,
13,
4706,
17541,
29918,
29916,
353,
1583,
29889,
657,
29918,
1062,
29878,
29918,
29916,
14078,
13,
4706,
17541,
29918,
29891,
353,
1583,
29889,
657,
29918,
1062,
29878,
29918,
29891,
14078,
13,
4706,
4038,
353,
313,
1062,
29878,
29918,
29916,
29961,
29896,
29962,
448,
17541,
29918,
29916,
29961,
29900,
2314,
16395,
1062,
29878,
29918,
29891,
29961,
29896,
29962,
448,
17541,
29918,
29891,
29961,
29900,
5691,
30004,
13,
4706,
1583,
29889,
3317,
29918,
8961,
353,
5135,
6203,
29930,
1311,
29889,
1195,
29918,
16485,
29930,
1557,
29918,
29886,
29889,
4283,
29898,
29906,
876,
14571,
2435,
29898,
1311,
29889,
1272,
11877,
9302,
29889,
3676,
29898,
9302,
29889,
1631,
1068,
29906,
4961,
1068,
29900,
29889,
29945,
30004,
13,
1678,
6756,
13,
1678,
822,
679,
29918,
1062,
29878,
29918,
29916,
29898,
1311,
1125,
30004,
13,
4706,
1375,
29918,
29916,
353,
5785,
703,
7192,
18584,
13,
4706,
4236,
29918,
29916,
353,
448,
7411,
703,
7192,
18584,
13,
4706,
363,
5446,
297,
1583,
29889,
1272,
29901,
30004,
13,
9651,
565,
5446,
29889,
1066,
29961,
29900,
29962,
529,
1375,
29918,
29916,
29901,
30004,
13,
18884,
1375,
29918,
29916,
353,
5446,
29889,
1066,
29961,
29900,
1385,
30004,
13,
9651,
565,
5446,
29889,
1066,
29961,
29900,
29962,
1405,
4236,
29918,
29916,
29901,
30004,
13,
18884,
4236,
29918,
29916,
353,
5446,
29889,
1066,
29961,
29900,
1385,
30004,
13,
4706,
736,
313,
1195,
29918,
29916,
29892,
4236,
29918,
29916,
6075,
13,
4706,
6756,
13,
1678,
822,
679,
29918,
1062,
29878,
29918,
29891,
29898,
1311,
1125,
30004,
13,
4706,
1375,
29918,
29891,
353,
5785,
703,
7192,
18584,
13,
4706,
4236,
29918,
29891,
353,
448,
7411,
703,
7192,
18584,
13,
4706,
363,
5446,
297,
1583,
29889,
1272,
29901,
30004,
13,
9651,
565,
5446,
29889,
1066,
29961,
29896,
29962,
529,
1375,
29918,
29891,
29901,
30004,
13,
18884,
1375,
29918,
29891,
353,
5446,
29889,
1066,
29961,
29896,
1385,
30004,
13,
9651,
565,
5446,
29889,
1066,
29961,
29896,
29962,
1405,
4236,
29918,
29891,
29901,
30004,
13,
18884,
4236,
29918,
29891,
353,
5446,
29889,
1066,
29961,
29896,
1385,
30004,
13,
4706,
736,
313,
1195,
29918,
29891,
29892,
4236,
29918,
29891,
6075,
13,
1678,
6756,
13,
1678,
822,
9773,
29918,
3396,
29898,
1311,
29892,
22645,
1125,
30004,
13,
4706,
1583,
29889,
1272,
29961,
13140,
1822,
5014,
287,
353,
5852,
2104,
13,
4706,
565,
313,
1311,
29889,
1272,
29961,
13140,
1822,
276,
496,
29918,
5721,
1275,
6213,
1125,
30004,
13,
9651,
1583,
29889,
1272,
29961,
13140,
1822,
276,
496,
29918,
5721,
353,
1583,
29889,
3317,
29918,
8961,
2104,
13,
4706,
1583,
29889,
3396,
29918,
1761,
29889,
4397,
29898,
13140,
6075,
13,
1678,
6756,
13,
1678,
822,
7985,
29918,
3149,
29898,
1311,
29892,
22645,
1125,
30004,
13,
4706,
1583,
29889,
657,
29918,
484,
1141,
29890,
2470,
29898,
13140,
6075,
13,
4706,
1583,
29889,
657,
29918,
3221,
29918,
5721,
29898,
13140,
6075,
13,
4706,
565,
313,
1311,
29889,
1272,
29961,
13140,
1822,
3221,
29918,
5721,
1275,
448,
29896,
1125,
30004,
13,
9651,
736,
2104,
13,
4706,
1683,
29901,
30004,
13,
9651,
1583,
29889,
1272,
29961,
13140,
1822,
5014,
287,
353,
5852,
2104,
13,
9651,
1583,
29889,
4397,
29918,
3396,
29898,
13140,
6075,
13,
9651,
6756,
13,
9651,
16717,
29918,
1761,
353,
13769,
30004,
13,
9651,
1583,
29889,
4397,
29918,
26776,
29898,
26776,
29918,
1761,
29892,
1583,
29889,
1272,
29961,
13140,
1822,
484,
1141,
29890,
2470,
29892,
22645,
8443,
13,
9651,
1550,
313,
2435,
29898,
26776,
29918,
1761,
29897,
1405,
29871,
29900,
1125,
30004,
13,
18884,
16256,
29918,
13140,
353,
16717,
29918,
1761,
29961,
29900,
1385,
30004,
13,
18884,
1583,
29889,
657,
29918,
484,
1141,
29890,
2470,
29898,
21962,
29918,
13140,
6075,
13,
18884,
1583,
29889,
657,
29918,
3221,
29918,
5721,
29898,
21962,
29918,
13140,
6075,
13,
18884,
1583,
29889,
1272,
29961,
21962,
29918,
13140,
1822,
5014,
287,
353,
5852,
2104,
13,
18884,
1583,
29889,
4397,
29918,
3396,
29898,
21962,
29918,
13140,
6075,
13,
18884,
1583,
29889,
5992,
29918,
26776,
29898,
26776,
29918,
1761,
6075,
13,
18884,
565,
313,
1333,
313,
1311,
29889,
1272,
29961,
21962,
29918,
13140,
1822,
3221,
29918,
5721,
1275,
448,
29896,
22164,
30004,
13,
462,
1678,
1583,
29889,
4397,
29918,
26776,
29898,
26776,
29918,
1761,
29892,
1583,
29889,
1272,
29961,
21962,
29918,
13140,
1822,
484,
1141,
29890,
2470,
29892,
16256,
29918,
13140,
6075,
13,
462,
1678,
6756,
13,
18884,
6756,
13,
1678,
822,
679,
29918,
3221,
29918,
5721,
29898,
1311,
29892,
22645,
1125,
30004,
13,
4706,
565,
313,
2435,
29898,
1311,
29889,
1272,
29961,
13140,
1822,
484,
1141,
29890,
2470,
29897,
6736,
1583,
29889,
1195,
29918,
16485,
1125,
30004,
13,
9651,
1583,
29889,
1272,
29961,
13140,
1822,
3221,
29918,
5721,
353,
1583,
29889,
1272,
29961,
13140,
1822,
484,
1141,
29890,
2470,
29961,
1311,
29889,
1195,
29918,
16485,
448,
29871,
29896,
3816,
29896,
1385,
30004,
13,
4706,
1683,
29901,
30004,
13,
9651,
1583,
29889,
1272,
29961,
13140,
1822,
3221,
29918,
5721,
353,
448,
29896,
2104,
13,
4706,
6756,
13,
1678,
822,
679,
29918,
276,
496,
29918,
5721,
29898,
1311,
29892,
4818,
29918,
13140,
29892,
22645,
29892,
1320,
1125,
30004,
13,
4706,
364,
29918,
5721,
353,
4236,
29898,
5721,
29892,
1583,
29889,
1272,
29961,
5064,
29918,
13140,
1822,
3221,
29918,
5721,
6075,
13,
4706,
565,
313,
1311,
29889,
1272,
29961,
13140,
1822,
276,
496,
29918,
5721,
1275,
6213,
1125,
30004,
13,
9651,
1583,
29889,
1272,
29961,
13140,
1822,
276,
496,
29918,
5721,
353,
364,
29918,
5721,
2104,
13,
9651,
736,
5852,
2104,
13,
4706,
25342,
313,
1311,
29889,
1272,
29961,
13140,
1822,
276,
496,
29918,
5721,
1405,
364,
29918,
5721,
1125,
30004,
13,
9651,
1583,
29889,
1272,
29961,
13140,
1822,
276,
496,
29918,
5721,
353,
364,
29918,
5721,
2104,
13,
9651,
736,
5852,
2104,
13,
4706,
1683,
29901,
30004,
13,
9651,
736,
7700,
2104,
13,
4706,
6756,
13,
1678,
822,
679,
29918,
484,
1141,
29890,
2470,
29898,
1311,
29892,
22645,
1125,
30004,
13,
4706,
1583,
29889,
1272,
29961,
13140,
1822,
484,
1141,
29890,
2470,
353,
13769,
30004,
13,
4706,
6756,
13,
4706,
363,
302,
29918,
13140,
29892,
5446,
297,
26985,
29898,
1311,
29889,
1272,
1125,
30004,
13,
9651,
1320,
353,
11878,
695,
333,
29898,
5415,
29892,
1583,
29889,
1272,
29961,
13140,
2314,
30004,
13,
9651,
565,
313,
5721,
5277,
1583,
29889,
3317,
29918,
8961,
1125,
30004,
13,
18884,
1583,
29889,
1272,
29961,
13140,
1822,
484,
1141,
29890,
2470,
29889,
4397,
4197,
29876,
29918,
13140,
29892,
1320,
5691,
30004,
13,
4706,
6756,
13,
4706,
1583,
29889,
1272,
29961,
13140,
1822,
484,
1141,
29890,
2470,
29889,
6605,
29898,
1989,
353,
14013,
921,
584,
921,
29961,
29896,
5691,
30004,
13,
1678,
6756,
13,
1678,
822,
9773,
29918,
26776,
29898,
1311,
29892,
16717,
29918,
1761,
29892,
22092,
2470,
29892,
4818,
29918,
13140,
1125,
30004,
13,
4706,
363,
302,
29918,
29873,
786,
297,
22092,
2470,
29901,
30004,
13,
9651,
3939,
353,
1583,
29889,
657,
29918,
276,
496,
29918,
5721,
29898,
5064,
29918,
13140,
29892,
302,
29918,
29873,
786,
29961,
29900,
1402,
302,
29918,
29873,
786,
29961,
29896,
5691,
30004,
13,
9651,
6756,
13,
9651,
565,
313,
1311,
29889,
1272,
29961,
29876,
29918,
29873,
786,
29961,
29900,
29962,
1822,
262,
29918,
26776,
322,
3939,
1125,
30004,
13,
18884,
628,
16717,
29918,
1761,
29961,
26776,
29918,
1761,
29889,
2248,
29898,
29876,
29918,
29873,
786,
29961,
29900,
2314,
1385,
30004,
13,
18884,
1583,
29889,
1272,
29961,
29876,
29918,
29873,
786,
29961,
29900,
29962,
1822,
262,
29918,
26776,
353,
7700,
2104,
13,
9651,
25342,
313,
1311,
29889,
1272,
29961,
29876,
29918,
29873,
786,
29961,
29900,
29962,
1822,
5014,
287,
470,
1583,
29889,
1272,
29961,
29876,
29918,
29873,
786,
29961,
29900,
29962,
1822,
262,
29918,
26776,
1125,
30004,
13,
18884,
6773,
2104,
13,
9651,
6756,
13,
9651,
363,
22645,
29892,
5446,
297,
26985,
29898,
26776,
29918,
1761,
1125,
30004,
13,
18884,
565,
313,
1583,
29889,
1272,
29961,
29876,
29918,
29873,
786,
29961,
29900,
29962,
1822,
276,
496,
29918,
5721,
529,
1583,
29889,
1272,
29961,
5415,
1822,
276,
496,
29918,
5721,
29871,
1125,
30004,
13,
462,
1678,
16717,
29918,
1761,
29889,
7851,
29898,
13140,
29892,
302,
29918,
29873,
786,
29961,
29900,
5691,
30004,
13,
462,
1678,
1583,
29889,
1272,
29961,
29876,
29918,
29873,
786,
29961,
29900,
29962,
1822,
262,
29918,
26776,
353,
5852,
2104,
13,
462,
1678,
2867,
29936,
539,
6756,
13,
9651,
565,
313,
1333,
1583,
29889,
1272,
29961,
29876,
29918,
29873,
786,
29961,
29900,
29962,
1822,
262,
29918,
26776,
1125,
30004,
13,
18884,
16717,
29918,
1761,
29889,
4397,
29898,
29876,
29918,
29873,
786,
29961,
29900,
5691,
30004,
13,
18884,
1583,
29889,
1272,
29961,
29876,
29918,
29873,
786,
29961,
29900,
29962,
1822,
262,
29918,
26776,
353,
5852,
2104,
13,
1678,
6756,
13,
1678,
822,
3349,
29918,
26776,
29898,
1311,
29892,
16717,
29918,
1761,
1125,
30004,
13,
4706,
1583,
29889,
1272,
29961,
26776,
29918,
1761,
29961,
29900,
29962,
1822,
262,
29918,
26776,
353,
7700,
2104,
13,
4706,
628,
16717,
29918,
1761,
29961,
29900,
1385,
30004,
13,
4706,
6756,
13,
1678,
822,
6159,
29918,
5317,
29898,
1311,
1125,
30004,
13,
4706,
921,
353,
1051,
29898,
3881,
29898,
2435,
29898,
1311,
29889,
3396,
29918,
1761,
876,
6075,
13,
4706,
343,
353,
13769,
30004,
13,
4706,
6756,
13,
4706,
363,
22645,
297,
1583,
29889,
3396,
29918,
1761,
29901,
30004,
13,
9651,
343,
29889,
4397,
29898,
1311,
29889,
1272,
29961,
13140,
1822,
276,
496,
29918,
5721,
6075,
13,
9651,
6756,
13,
4706,
285,
29892,
4853,
353,
14770,
29889,
1491,
26762,
14078,
13,
4706,
4853,
29889,
1646,
29898,
29916,
29892,
343,
6075,
13,
4706,
6756,
13,
1678,
822,
1596,
29918,
276,
496,
29918,
5721,
29898,
1311,
1125,
30004,
13,
4706,
363,
22645,
297,
1583,
29889,
3396,
29918,
1761,
29901,
30004,
13,
9651,
1596,
313,
13140,
8443,
13,
9651,
1596,
313,
1311,
29889,
1272,
29961,
13140,
1822,
276,
496,
29918,
5721,
8443,
13,
9651,
6756,
13,
1678,
822,
6492,
29918,
1272,
29898,
1311,
1125,
30004,
13,
4706,
921,
353,
13769,
30004,
13,
4706,
343,
353,
13769,
30004,
13,
4706,
6756,
13,
4706,
363,
5446,
297,
1583,
29889,
1272,
29901,
30004,
13,
9651,
921,
29889,
4397,
29898,
5415,
29889,
1066,
29961,
29900,
5691,
30004,
13,
9651,
343,
29889,
4397,
29898,
5415,
29889,
1066,
29961,
29896,
5691,
30004,
13,
9651,
6756,
13,
4706,
285,
29892,
4853,
353,
14770,
29889,
1491,
26762,
14078,
13,
4706,
4853,
29889,
1557,
2620,
29898,
29916,
29892,
343,
6075,
13,
4706,
6756,
13,
1678,
822,
679,
29918,
1949,
29918,
695,
504,
414,
29898,
1311,
1125,
30004,
13,
4706,
24554,
353,
13769,
30004,
13,
4706,
701,
353,
5852,
2104,
13,
4706,
2246,
29892,
5970,
353,
448,
29896,
29892,
448,
29896,
2104,
13,
4706,
363,
474,
29892,
22645,
297,
26985,
29898,
1311,
29889,
3396,
29918,
1761,
7503,
29899,
29896,
29962,
1125,
30004,
13,
9651,
565,
313,
786,
322,
313,
1311,
29889,
1272,
29961,
13140,
1822,
276,
496,
29918,
5721,
1405,
1583,
29889,
1272,
29961,
1311,
29889,
3396,
29918,
1761,
29961,
29875,
718,
29871,
29896,
5262,
22164,
30004,
13,
18884,
701,
353,
451,
701,
2104,
13,
18884,
565,
313,
1333,
5970,
1275,
448,
29896,
1125,
30004,
13,
462,
1678,
24554,
29889,
4397,
29898,
3332,
448,
5970,
6075,
13,
18884,
2246,
353,
1583,
29889,
1272,
29961,
13140,
1822,
276,
496,
29918,
5721,
2104,
13,
18884,
6773,
2104,
13,
9651,
565,
313,
1333,
701,
29897,
322,
313,
1311,
29889,
1272,
29961,
13140,
1822,
276,
496,
29918,
5721,
529,
1583,
29889,
1272,
29961,
1311,
29889,
3396,
29918,
1761,
29961,
29875,
718,
29871,
29896,
29962,
1822,
276,
496,
29918,
5721,
1125,
30004,
13,
18884,
701,
353,
451,
701,
2104,
13,
18884,
5970,
353,
1583,
29889,
1272,
29961,
13140,
1822,
276,
496,
29918,
5721,
2104,
13,
9651,
6756,
13,
30004,
13,
1990,
2233,
504,
414,
29901,
30004,
13,
1678,
822,
4770,
2344,
12035,
3670,
1199,
29918,
5415,
29892,
321,
567,
1125,
30004,
13,
4706,
1583,
29889,
3670,
1199,
29918,
5415,
353,
3523,
1199,
29918,
5415,
2104,
13,
4706,
1583,
29889,
3396,
29918,
1761,
353,
29871,
3523,
1199,
29918,
5415,
29889,
3396,
29918,
1761,
2104,
13,
4706,
1583,
29889,
8961,
353,
321,
567,
2104,
13,
4706,
1583,
29889,
1195,
29918,
16485,
353,
3523,
1199,
29918,
5415,
29889,
1195,
29918,
16485,
2104,
13,
4706,
6756,
13,
1678,
822,
1284,
29898,
1311,
1125,
30004,
13,
4706,
22645,
353,
29871,
29900,
2104,
13,
4706,
396,
3204,
29892,
701,
353,
7700,
29892,
7700,
2104,
13,
4706,
1623,
29879,
353,
13769,
30004,
13,
4706,
24554,
353,
13769,
30004,
13,
4706,
1550,
22645,
529,
7431,
29898,
1311,
29889,
3396,
29918,
1761,
1125,
30004,
13,
9651,
2923,
353,
1583,
29889,
3396,
29918,
1761,
29961,
13140,
29962,
448,
1583,
29889,
3396,
29918,
1761,
29961,
13140,
718,
29871,
29896,
1385,
30004,
13,
9651,
565,
313,
12765,
6736,
1583,
29889,
3670,
1199,
29918,
5415,
29898,
13140,
11877,
1311,
29889,
8961,
1125,
30004,
13,
18884,
716,
29918,
3204,
29892,
22645,
353,
1583,
29889,
15439,
29918,
3204,
29898,
13140,
6075,
13,
18884,
1623,
29879,
29889,
4397,
4197,
1482,
29918,
3204,
29892,
448,
7411,
703,
7192,
1159,
5691,
30004,
13,
18884,
396,
23705,
29918,
29885,
747,
353,
1583,
29889,
3670,
1199,
29918,
5415,
29898,
3204,
29879,
14352,
29896,
3816,
29900,
3816,
29900,
5262,
6075,
13,
18884,
396,
1311,
29889,
4572,
29918,
3204,
29879,
29898,
23705,
29918,
29885,
747,
29892,
1623,
29879,
6075,
13,
9651,
25342,
8521,
12765,
6736,
1583,
29889,
3670,
1199,
29918,
5415,
29898,
13140,
11877,
1311,
29889,
8961,
1125,
30004,
13,
18884,
13149,
29918,
29885,
747,
353,
1583,
29889,
657,
29918,
23705,
29918,
29885,
747,
29898,
3204,
29879,
14352,
29896,
1402,
22645,
6075,
13,
18884,
1583,
29889,
4572,
29918,
3204,
29879,
29898,
23705,
29918,
29885,
747,
29892,
1623,
29879,
6075,
13,
18884,
701,
29892,
22645,
353,
1583,
29889,
15439,
29918,
786,
29898,
13140,
6075,
13,
18884,
363,
1623,
297,
1623,
29879,
29901,
30004,
13,
462,
1678,
565,
313,
1311,
29889,
3670,
1199,
29918,
5415,
29898,
786,
29961,
29896,
14664,
276,
496,
29918,
5721,
16395,
29896,
448,
1583,
29889,
8961,
29897,
6736,
1623,
29961,
29896,
29962,
1125,
30004,
13,
462,
4706,
24554,
29889,
4397,
3552,
3204,
29961,
29900,
3816,
29900,
1402,
701,
29961,
29896,
2314,
6075,
13,
9651,
1683,
29901,
30004,
13,
18884,
22645,
4619,
29871,
29896,
2104,
13,
462,
4706,
6756,
13,
1678,
822,
679,
29918,
23705,
29918,
29885,
747,
29898,
1311,
29892,
1833,
29918,
3204,
29892,
16256,
29918,
13140,
1125,
30004,
13,
4706,
3380,
29918,
13140,
29892,
1095,
29918,
13140,
353,
1833,
29918,
3204,
29961,
29900,
3816,
29896,
1402,
16256,
29918,
13140,
2104,
13,
4706,
13149,
29918,
29885,
747,
353,
448,
7411,
703,
7192,
18584,
13,
4706,
6756,
13,
4706,
363,
474,
297,
3464,
29898,
463,
29918,
13140,
29892,
1095,
29918,
13140,
718,
29871,
29896,
1125,
30004,
13,
9651,
565,
313,
1311,
29889,
3670,
1199,
29918,
5415,
29898,
29875,
29897,
1405,
13149,
29918,
29885,
747,
1125,
30004,
13,
18884,
13149,
29918,
29885,
747,
353,
1583,
29889,
3670,
1199,
29918,
5415,
29898,
29875,
6075,
13,
4706,
6756,
13,
4706,
736,
13149,
29918,
29885,
747,
2104,
13,
18884,
6756,
13,
1678,
822,
9580,
29918,
3204,
29898,
1311,
29892,
22645,
1125,
30004,
13,
4706,
4319,
29918,
262,
798,
353,
29871,
29900,
2104,
13,
4706,
3380,
29918,
13140,
353,
22645,
2104,
13,
4706,
1550,
313,
13140,
529,
7431,
29898,
1311,
29889,
3396,
29918,
1761,
22164,
30004,
13,
9651,
22645,
4619,
29871,
29896,
2104,
13,
9651,
2923,
353,
1583,
29889,
3396,
29918,
1761,
29961,
13140,
1822,
276,
496,
29918,
5721,
448,
1583,
29889,
3396,
29918,
1761,
29961,
13140,
718,
29871,
29896,
1822,
276,
496,
29918,
5721,
2104,
13,
9651,
565,
313,
12765,
529,
29871,
29900,
1125,
30004,
13,
18884,
736,
313,
463,
29918,
13140,
29892,
22645,
448,
29871,
29896,
6075,
13,
9651,
565,
313,
12765,
1405,
29871,
29900,
1125,
30004,
13,
18884,
565,
313,
12765,
6736,
1583,
29889,
8961,
29930,
1311,
29889,
3396,
29918,
1761,
29961,
13140,
29962,
1125,
30004,
13,
462,
1678,
4319,
29918,
262,
798,
353,
29871,
29900,
2104,
13,
18884,
1683,
29901,
30004,
13,
462,
1678,
565,
313,
12313,
29918,
262,
798,
1275,
29871,
29900,
1125,
30004,
13,
462,
4706,
1833,
29918,
16773,
353,
22645,
448,
29871,
29896,
2104,
13,
462,
1678,
4319,
29918,
262,
798,
4619,
29871,
29896,
2104,
13,
462,
1678,
565,
4319,
29918,
262,
798,
1405,
1583,
29889,
1195,
29918,
16485,
29901,
30004,
13,
462,
4706,
396,
3160,
263,
1423,
393,
5662,
1973,
5120,
947,
451,
505,
30004,
13,
462,
4706,
396,
3309,
5225,
29973,
30004,
13,
462,
4706,
736,
313,
463,
29918,
13140,
29892,
1833,
29918,
16773,
511,
22645,
2104,
13,
1678,
6756,
13,
1678,
822,
9580,
29918,
786,
29898,
1311,
29892,
22645,
1125,
30004,
13,
4706,
4319,
29918,
262,
798,
353,
29871,
29900,
2104,
13,
4706,
3380,
29918,
13140,
353,
22645,
2104,
13,
4706,
1550,
313,
13140,
529,
7431,
29898,
1311,
29889,
3396,
29918,
1761,
22164,
30004,
13,
9651,
22645,
4619,
29871,
29896,
2104,
13,
9651,
2923,
353,
1583,
29889,
3396,
29918,
1761,
29961,
13140,
1822,
276,
496,
29918,
5721,
29961,
13140,
718,
29871,
29896,
29962,
448,
1583,
29889,
3396,
29918,
1761,
29961,
13140,
1822,
276,
496,
29918,
5721,
2104,
13,
9651,
565,
313,
12765,
529,
29871,
29900,
1125,
30004,
13,
18884,
736,
313,
463,
29918,
13140,
29892,
22645,
448,
29871,
29896,
6075,
13,
9651,
565,
313,
12765,
1405,
29871,
29900,
1125,
30004,
13,
18884,
565,
313,
12765,
6736,
1583,
29889,
8961,
29930,
1311,
29889,
3396,
29918,
1761,
29961,
13140,
718,
29871,
29896,
29962,
1125,
30004,
13,
462,
1678,
4319,
29918,
262,
798,
353,
29871,
29900,
2104,
13,
18884,
1683,
29901,
30004,
13,
462,
1678,
565,
313,
12313,
29918,
262,
798,
1275,
29871,
29900,
1125,
30004,
13,
462,
4706,
1833,
29918,
16773,
353,
22645,
448,
29871,
29896,
2104,
13,
462,
1678,
4319,
29918,
262,
798,
4619,
29871,
29896,
2104,
13,
462,
1678,
565,
313,
12313,
29918,
262,
798,
1405,
1583,
29889,
1195,
29918,
16485,
1125,
30004,
13,
462,
4706,
736,
313,
463,
29918,
13140,
29892,
1833,
29918,
16773,
511,
22645,
2104,
13,
462,
4706,
6756,
13,
1678,
822,
4175,
29918,
3204,
29879,
29898,
1311,
29892,
13149,
29918,
29885,
747,
29892,
1623,
29879,
1125,
30004,
13,
4706,
628,
29918,
13140,
353,
13769,
30004,
13,
4706,
363,
22645,
29892,
5446,
297,
26985,
29898,
3204,
29879,
7503,
29899,
29896,
29962,
1125,
30004,
13,
9651,
565,
1583,
29889,
3396,
29918,
1761,
29961,
5415,
29961,
29900,
3816,
29900,
29962,
1822,
276,
496,
29918,
5721,
16395,
29896,
448,
1583,
29889,
8961,
29897,
529,
13149,
29918,
29885,
747,
29901,
30004,
13,
18884,
628,
29918,
13140,
29889,
4397,
29898,
13140,
6075,
13,
9651,
25342,
313,
5415,
29961,
29896,
29962,
529,
13149,
29918,
29885,
747,
1125,
30004,
13,
18884,
1623,
29879,
29961,
13140,
3816,
29896,
29962,
353,
13149,
29918,
29885,
747,
2104,
13,
4706,
628,
29918,
13140,
29889,
24244,
14078,
13,
4706,
363,
474,
297,
628,
29918,
13140,
29901,
30004,
13,
9651,
628,
1623,
29879,
29961,
29875,
1385,
30004,
13,
30004,
13,
4130,
353,
2531,
29918,
695,
504,
414,
4197,
29961,
29896,
29892,
29871,
29896,
1402,
518,
29953,
29892,
29871,
29955,
1402,
518,
29896,
29900,
29892,
29871,
29896,
29945,
1402,
518,
29896,
29945,
29892,
29871,
29896,
29945,
20526,
29871,
29906,
29900,
29900,
6075,
13,
1272,
353,
1207,
29918,
16485,
29898,
4130,
6075,
13,
30004,
13,
3670,
1199,
353,
6418,
29911,
2965,
29903,
29898,
29896,
29945,
29892,
848,
6075,
13,
30004,
13,
3670,
1199,
29889,
276,
496,
29918,
5317,
14078,
13,
3670,
1199,
29889,
5317,
29918,
1272,
14078,
13,
30004,
13,
572,
29873,
29889,
4294,
14078,
13,
30004,
13,
29937,
3670,
1199,
29889,
2158,
29918,
276,
496,
29918,
5721,
14078,
13,
30004,
13,
2158,
4852,
25632,
1159,
2
] |
model_utils.py | PreferredAI/vista-net | 75 | 70693 | <filename>model_utils.py
import tensorflow as tf
import numpy as np
import os
def get_shape(tensor):
static_shape = tensor.shape.as_list()
dynamic_shape = tf.unstack(tf.shape(tensor))
dims = [s[1] if s[0] is None else s[0]
for s in zip(static_shape, dynamic_shape)]
return dims
def make_dirs(dir):
next_idx = 1
if tf.gfile.Exists(dir):
folder_list = sorted([int(f) for f in os.listdir(dir)])
if len(folder_list) > 0:
next_idx = folder_list[-1] + 1
new_folder = os.path.join(dir, str(next_idx))
tf.gfile.MakeDirs(new_folder)
return new_folder
def count_parameters(trained_vars):
total_parameters = 0
print('=' * 100)
for variable in trained_vars:
variable_parameters = 1
for dim in variable.get_shape():
variable_parameters *= dim.value
print('{:70} {:20} params'.format(variable.name, variable_parameters))
print('-' * 100)
total_parameters += variable_parameters
print('=' * 100)
print("Total trainable parameters: %d" % total_parameters)
print('=' * 100)
def load_glove(vocab_size, emb_size):
print('Loading Glove word embeddings ...')
embedding_weights = {}
f = open('glove/glove.6B.{}d.txt'.format(emb_size), encoding='utf-8')
for line in f:
values = line.split()
word = values[0]
coefs = np.asarray(values[1:], dtype='float32')
embedding_weights[word] = coefs
f.close()
print('Total {} word vectors in Glove 6B {}d.'.format(len(embedding_weights), emb_size))
embedding_matrix = np.random.uniform(-0.5, 0.5, (vocab_size, emb_size))
embedding_matrix[0, :] = np.zeros(emb_size) # alignment word for blank image
oov_count = 0
from data_preprocess import load_vocabulary
for word, i in load_vocabulary().items():
embedding_vector = embedding_weights.get(word)
if embedding_vector is not None:
embedding_matrix[i] = embedding_vector
else:
oov_count += 1
print('Number of OOV words: %d' % oov_count)
return embedding_matrix
| [
1,
529,
9507,
29958,
4299,
29918,
13239,
29889,
2272,
13,
5215,
26110,
408,
15886,
13,
5215,
12655,
408,
7442,
13,
5215,
2897,
13,
13,
1753,
679,
29918,
12181,
29898,
20158,
1125,
13,
29871,
2294,
29918,
12181,
353,
12489,
29889,
12181,
29889,
294,
29918,
1761,
580,
13,
29871,
7343,
29918,
12181,
353,
15886,
29889,
348,
1429,
29898,
13264,
29889,
12181,
29898,
20158,
876,
13,
29871,
3964,
29879,
353,
518,
29879,
29961,
29896,
29962,
565,
269,
29961,
29900,
29962,
338,
6213,
1683,
269,
29961,
29900,
29962,
13,
3986,
363,
269,
297,
14319,
29898,
7959,
29918,
12181,
29892,
7343,
29918,
12181,
4638,
13,
29871,
736,
3964,
29879,
13,
13,
13,
1753,
1207,
29918,
3972,
29879,
29898,
3972,
1125,
13,
29871,
2446,
29918,
13140,
353,
29871,
29896,
13,
29871,
565,
15886,
29889,
29887,
1445,
29889,
24217,
29898,
3972,
1125,
13,
1678,
4138,
29918,
1761,
353,
12705,
4197,
524,
29898,
29888,
29897,
363,
285,
297,
2897,
29889,
1761,
3972,
29898,
3972,
29897,
2314,
13,
1678,
565,
7431,
29898,
12083,
29918,
1761,
29897,
1405,
29871,
29900,
29901,
13,
418,
2446,
29918,
13140,
353,
4138,
29918,
1761,
14352,
29896,
29962,
718,
29871,
29896,
13,
29871,
716,
29918,
12083,
353,
2897,
29889,
2084,
29889,
7122,
29898,
3972,
29892,
851,
29898,
4622,
29918,
13140,
876,
13,
29871,
15886,
29889,
29887,
1445,
29889,
9984,
9170,
29879,
29898,
1482,
29918,
12083,
29897,
13,
29871,
736,
716,
29918,
12083,
13,
13,
13,
1753,
2302,
29918,
16744,
29898,
3018,
1312,
29918,
16908,
1125,
13,
29871,
3001,
29918,
16744,
353,
29871,
29900,
13,
29871,
1596,
877,
2433,
334,
29871,
29896,
29900,
29900,
29897,
13,
29871,
363,
2286,
297,
16370,
29918,
16908,
29901,
13,
1678,
2286,
29918,
16744,
353,
29871,
29896,
13,
1678,
363,
3964,
297,
2286,
29889,
657,
29918,
12181,
7295,
13,
418,
2286,
29918,
16744,
334,
29922,
3964,
29889,
1767,
13,
1678,
1596,
877,
25641,
29955,
29900,
29913,
12365,
29906,
29900,
29913,
8636,
4286,
4830,
29898,
11918,
29889,
978,
29892,
2286,
29918,
16744,
876,
13,
1678,
1596,
877,
29899,
29915,
334,
29871,
29896,
29900,
29900,
29897,
13,
1678,
3001,
29918,
16744,
4619,
2286,
29918,
16744,
13,
29871,
1596,
877,
2433,
334,
29871,
29896,
29900,
29900,
29897,
13,
29871,
1596,
703,
11536,
7945,
519,
4128,
29901,
1273,
29881,
29908,
1273,
3001,
29918,
16744,
29897,
13,
29871,
1596,
877,
2433,
334,
29871,
29896,
29900,
29900,
29897,
13,
13,
13,
1753,
2254,
29918,
29887,
417,
345,
29898,
29894,
542,
370,
29918,
2311,
29892,
7232,
29918,
2311,
1125,
13,
29871,
1596,
877,
23456,
21806,
345,
1734,
8297,
29881,
886,
2023,
1495,
13,
29871,
23655,
29918,
705,
5861,
353,
6571,
13,
29871,
285,
353,
1722,
877,
29887,
417,
345,
29914,
29887,
417,
345,
29889,
29953,
29933,
29889,
8875,
29881,
29889,
3945,
4286,
4830,
29898,
1590,
29918,
2311,
511,
8025,
2433,
9420,
29899,
29947,
1495,
13,
29871,
363,
1196,
297,
285,
29901,
13,
1678,
1819,
353,
1196,
29889,
5451,
580,
13,
1678,
1734,
353,
1819,
29961,
29900,
29962,
13,
1678,
1302,
1389,
29879,
353,
7442,
29889,
294,
2378,
29898,
5975,
29961,
29896,
29901,
1402,
26688,
2433,
7411,
29941,
29906,
1495,
13,
1678,
23655,
29918,
705,
5861,
29961,
1742,
29962,
353,
1302,
1389,
29879,
13,
29871,
285,
29889,
5358,
580,
13,
29871,
1596,
877,
11536,
6571,
1734,
12047,
297,
21806,
345,
29871,
29953,
29933,
6571,
29881,
29889,
4286,
4830,
29898,
2435,
29898,
17987,
8497,
29918,
705,
5861,
511,
7232,
29918,
2311,
876,
13,
13,
29871,
23655,
29918,
5344,
353,
7442,
29889,
8172,
29889,
29590,
6278,
29900,
29889,
29945,
29892,
29871,
29900,
29889,
29945,
29892,
313,
29894,
542,
370,
29918,
2311,
29892,
7232,
29918,
2311,
876,
13,
29871,
23655,
29918,
5344,
29961,
29900,
29892,
584,
29962,
353,
7442,
29889,
3298,
359,
29898,
1590,
29918,
2311,
29897,
29871,
396,
22239,
1734,
363,
9654,
1967,
13,
13,
29871,
288,
586,
29918,
2798,
353,
29871,
29900,
13,
29871,
515,
848,
29918,
1457,
5014,
1053,
2254,
29918,
29894,
542,
370,
352,
653,
13,
29871,
363,
1734,
29892,
474,
297,
2254,
29918,
29894,
542,
370,
352,
653,
2141,
7076,
7295,
13,
1678,
23655,
29918,
8111,
353,
23655,
29918,
705,
5861,
29889,
657,
29898,
1742,
29897,
13,
1678,
565,
23655,
29918,
8111,
338,
451,
6213,
29901,
13,
418,
23655,
29918,
5344,
29961,
29875,
29962,
353,
23655,
29918,
8111,
13,
1678,
1683,
29901,
13,
418,
288,
586,
29918,
2798,
4619,
29871,
29896,
13,
29871,
1596,
877,
4557,
310,
438,
29949,
29963,
3838,
29901,
1273,
29881,
29915,
1273,
288,
586,
29918,
2798,
29897,
13,
13,
29871,
736,
23655,
29918,
5344,
13,
2
] |
Students/Zephyr/Exercise 1.py | MikelShifrin/Python1 | 3 | 33943 | <filename>Students/Zephyr/Exercise 1.py
name = input('Please enter your name:\n')
age = int(input("Please enter your age:\n"))
color = input('Enter your favorite color:\n')
animal = input('Enter your favorite animal:\n')
print('Hello my name is' , name , '.')
print('I am' , age , 'years old.')
print('My favorite color is' , color ,'.')
print('My favorite animal is the' , animal , '.')
| [
1,
529,
9507,
29958,
855,
566,
1237,
29914,
24625,
561,
4316,
29914,
1252,
6269,
895,
29871,
29896,
29889,
2272,
13,
978,
353,
1881,
877,
12148,
3896,
596,
1024,
3583,
29876,
1495,
13,
13,
482,
353,
938,
29898,
2080,
703,
12148,
3896,
596,
5046,
3583,
29876,
5783,
13,
13,
2780,
353,
1881,
877,
10399,
596,
25448,
2927,
3583,
29876,
1495,
13,
13,
273,
3039,
353,
1881,
877,
10399,
596,
25448,
13019,
3583,
29876,
1495,
13,
13,
2158,
877,
10994,
590,
1024,
338,
29915,
1919,
1024,
1919,
15300,
1495,
13,
2158,
877,
29902,
626,
29915,
1919,
5046,
1919,
525,
6360,
29879,
2030,
29889,
1495,
13,
2158,
877,
3421,
25448,
2927,
338,
29915,
1919,
2927,
1919,
4286,
1495,
13,
2158,
877,
3421,
25448,
13019,
338,
278,
29915,
1919,
13019,
1919,
15300,
1495,
13,
2
] |
plasmapy/examples/plot_distribution.py | techieashish/PlasmaPy | 1 | 30683 | <reponame>techieashish/PlasmaPy<gh_stars>1-10
"""
1D Maxwellian distribution function
===================================
We import the usual modules, and the hero of this notebook,
the Maxwellian 1D distribution:
"""
import numpy as np
from astropy import units as u
import matplotlib.pyplot as plt
from astropy.constants import (m_e, k_B)
from plasmapy.formulary import Maxwellian_1D
############################################################
# Given we'll be plotting, import astropy's quantity support:
from astropy.visualization import quantity_support
quantity_support()
############################################################
# As a first example, let's get the probability density of
# finding an electron with a speed of 1 m/s if we have a
# plasma at a temperature of 30 000 K:
p_dens = Maxwellian_1D(v=1 * u.m / u.s,
T=30000 * u.K,
particle='e',
v_drift=0 * u.m / u.s)
print(p_dens)
############################################################
# Note the units! Integrated over speed, this will give us a
# probability. Let's test that for a bunch of particles:
T = 3e4 * u.K
dv = 10 * u.m / u.s
v = np.arange(-5e6, 5e6, 10) * u.m / u.s
############################################################
# Check that the integral over all speeds is 1
# (the particle has to be somewhere):
for particle in ['p', 'e']:
pdf = Maxwellian_1D(v, T=T, particle=particle)
integral = (pdf).sum() * dv
print(f"Integral value for {particle}: {integral}")
plt.plot(v, pdf, label=particle)
plt.legend()
############################################################
# The standard deviation of this distribution should give us back the
# temperature:
std = np.sqrt((Maxwellian_1D(v, T=T, particle='e') * v ** 2 * dv).sum())
T_theo = (std ** 2 / k_B * m_e).to(u.K)
print('T from standard deviation:', T_theo)
print('Initial T:', T)
| [
1,
529,
276,
1112,
420,
29958,
11345,
347,
1161,
728,
29914,
3247,
25392,
19737,
29966,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
15945,
29908,
13,
29896,
29928,
5918,
29893,
5481,
273,
4978,
740,
13,
9166,
9166,
25512,
13,
13,
4806,
1053,
278,
9670,
10585,
29892,
322,
278,
13444,
310,
445,
451,
19273,
29892,
13,
1552,
5918,
29893,
5481,
273,
29871,
29896,
29928,
4978,
29901,
13,
15945,
29908,
13,
13,
13,
5215,
12655,
408,
7442,
13,
3166,
8717,
14441,
1053,
10340,
408,
318,
13,
5215,
22889,
29889,
2272,
5317,
408,
14770,
13,
3166,
8717,
14441,
29889,
3075,
1934,
1053,
313,
29885,
29918,
29872,
29892,
413,
29918,
29933,
29897,
13,
13,
3166,
715,
294,
1958,
29891,
29889,
689,
352,
653,
1053,
5918,
29893,
5481,
273,
29918,
29896,
29928,
13,
13,
13,
13383,
13383,
13383,
7346,
4136,
13,
29937,
11221,
591,
29915,
645,
367,
6492,
1259,
29892,
1053,
8717,
14441,
29915,
29879,
14728,
2304,
29901,
13,
13,
13,
3166,
8717,
14441,
29889,
20119,
2133,
1053,
14728,
29918,
5924,
13,
22640,
29918,
5924,
580,
13,
13,
13383,
13383,
13383,
7346,
4136,
13,
29937,
1094,
263,
937,
1342,
29892,
1235,
29915,
29879,
679,
278,
6976,
9027,
310,
13,
29937,
9138,
385,
11966,
411,
263,
6210,
310,
29871,
29896,
286,
29914,
29879,
565,
591,
505,
263,
13,
29937,
715,
25392,
472,
263,
10430,
310,
29871,
29941,
29900,
29871,
29900,
29900,
29900,
476,
29901,
13,
13,
13,
29886,
29918,
21518,
353,
5918,
29893,
5481,
273,
29918,
29896,
29928,
29898,
29894,
29922,
29896,
334,
318,
29889,
29885,
847,
318,
29889,
29879,
29892,
13,
462,
539,
323,
29922,
29941,
29900,
29900,
29900,
29900,
334,
318,
29889,
29968,
29892,
13,
462,
539,
16445,
2433,
29872,
742,
13,
462,
539,
325,
29918,
29881,
7532,
29922,
29900,
334,
318,
29889,
29885,
847,
318,
29889,
29879,
29897,
13,
2158,
29898,
29886,
29918,
21518,
29897,
13,
13,
13383,
13383,
13383,
7346,
4136,
13,
29937,
3940,
278,
10340,
29991,
17100,
630,
975,
6210,
29892,
445,
674,
2367,
502,
263,
13,
29937,
6976,
29889,
2803,
29915,
29879,
1243,
393,
363,
263,
14928,
310,
17105,
29901,
13,
13,
29911,
353,
29871,
29941,
29872,
29946,
334,
318,
29889,
29968,
13,
29881,
29894,
353,
29871,
29896,
29900,
334,
318,
29889,
29885,
847,
318,
29889,
29879,
13,
29894,
353,
7442,
29889,
279,
927,
6278,
29945,
29872,
29953,
29892,
29871,
29945,
29872,
29953,
29892,
29871,
29896,
29900,
29897,
334,
318,
29889,
29885,
847,
318,
29889,
29879,
13,
13,
13383,
13383,
13383,
7346,
4136,
13,
29937,
5399,
393,
278,
10160,
975,
599,
961,
5779,
338,
29871,
29896,
13,
29937,
313,
1552,
16445,
756,
304,
367,
9051,
1125,
13,
13,
1454,
16445,
297,
6024,
29886,
742,
525,
29872,
2033,
29901,
13,
1678,
13552,
353,
5918,
29893,
5481,
273,
29918,
29896,
29928,
29898,
29894,
29892,
323,
29922,
29911,
29892,
16445,
29922,
1595,
2512,
29897,
13,
1678,
10160,
353,
313,
5140,
467,
2083,
580,
334,
14897,
13,
1678,
1596,
29898,
29888,
29908,
23573,
284,
995,
363,
426,
1595,
2512,
6177,
426,
14146,
284,
27195,
13,
1678,
14770,
29889,
5317,
29898,
29894,
29892,
13552,
29892,
3858,
29922,
1595,
2512,
29897,
13,
572,
29873,
29889,
26172,
580,
13,
13,
13,
13383,
13383,
13383,
7346,
4136,
13,
29937,
450,
3918,
29522,
310,
445,
4978,
881,
2367,
502,
1250,
278,
13,
29937,
10430,
29901,
13,
13,
13,
4172,
353,
7442,
29889,
3676,
3552,
7976,
29893,
5481,
273,
29918,
29896,
29928,
29898,
29894,
29892,
323,
29922,
29911,
29892,
16445,
2433,
29872,
1495,
334,
325,
3579,
29871,
29906,
334,
14897,
467,
2083,
3101,
13,
29911,
29918,
1552,
29877,
353,
313,
4172,
3579,
29871,
29906,
847,
413,
29918,
29933,
334,
286,
29918,
29872,
467,
517,
29898,
29884,
29889,
29968,
29897,
13,
13,
2158,
877,
29911,
515,
3918,
29522,
29901,
742,
323,
29918,
1552,
29877,
29897,
13,
2158,
877,
15514,
323,
29901,
742,
323,
29897,
13,
2
] |
babybuddy/migrations/0002_add_settings.py | Gitoffomalawn/babybuddy | 922 | 118771 | <reponame>Gitoffomalawn/babybuddy
# -*- coding: utf-8 -*-
from django.db import migrations
def add_settings(apps, schema_editor):
Settings = apps.get_model("babybuddy", "Settings")
User = apps.get_model("auth", "User")
for user in User.objects.all():
if Settings.objects.filter(user=user).count() == 0:
settings = Settings.objects.create(user=user)
settings.save()
class Migration(migrations.Migration):
initial = True
dependencies = [
("babybuddy", "0001_initial"),
]
operations = [
migrations.RunPython(add_settings, reverse_code=migrations.RunPython.noop),
]
| [
1,
529,
276,
1112,
420,
29958,
29954,
2049,
600,
290,
2883,
1233,
29914,
29890,
10798,
15841,
4518,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
3166,
9557,
29889,
2585,
1053,
9725,
800,
13,
13,
13,
1753,
788,
29918,
11027,
29898,
13371,
29892,
10938,
29918,
15204,
1125,
13,
1678,
19215,
353,
11446,
29889,
657,
29918,
4299,
703,
29890,
10798,
15841,
4518,
613,
376,
9585,
1159,
13,
1678,
4911,
353,
11446,
29889,
657,
29918,
4299,
703,
5150,
613,
376,
2659,
1159,
13,
1678,
363,
1404,
297,
4911,
29889,
12650,
29889,
497,
7295,
13,
4706,
565,
19215,
29889,
12650,
29889,
4572,
29898,
1792,
29922,
1792,
467,
2798,
580,
1275,
29871,
29900,
29901,
13,
9651,
6055,
353,
19215,
29889,
12650,
29889,
3258,
29898,
1792,
29922,
1792,
29897,
13,
9651,
6055,
29889,
7620,
580,
13,
13,
13,
1990,
341,
16783,
29898,
26983,
800,
29889,
29924,
16783,
1125,
13,
13,
1678,
2847,
353,
5852,
13,
13,
1678,
9962,
353,
518,
13,
4706,
4852,
29890,
10798,
15841,
4518,
613,
376,
29900,
29900,
29900,
29896,
29918,
11228,
4968,
13,
1678,
4514,
13,
13,
1678,
6931,
353,
518,
13,
4706,
9725,
800,
29889,
6558,
11980,
29898,
1202,
29918,
11027,
29892,
11837,
29918,
401,
29922,
26983,
800,
29889,
6558,
11980,
29889,
1217,
459,
511,
13,
1678,
4514,
13,
2
] |
chemdataextractor/scrape/__init__.py | edbeard/chemdataextractor-uvvis2018 | 6 | 66749 | # -*- coding: utf-8 -*-
"""
chemdataextractor.scrape
~~~~~~~~~~~~~~~~~~~~~~~~
Declarative scraping framework for extracting structured data from HTML and XML documents.
:copyright: Copyright 2016 by <NAME>.
:license: MIT, see LICENSE file for more details.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
#: Block level HTML elements
BLOCK_ELEMENTS = {
'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'ul', 'ol', 'pre', 'dd', 'dl', 'div', 'noscript', 'blockquote', 'form',
'hr', 'table', 'fieldset', 'address', 'article', 'aside', 'audio', 'canvas', 'figcaption', 'figure', 'footer',
'header', 'hgroup', 'output', 'section', 'body', 'head', 'title', 'tr', 'td', 'th', 'thead', 'tfoot', 'dt', 'li',
'tbody',
}
#: Inline level HTML elements
INLINE_ELEMENTS = {
'b', 'big', 'i', 'small', 'tt', 'abbr', 'acronym', 'cite', 'code', 'dfn', 'em', 'kbd', 'strong', 'samp', 'var',
'a', 'bdo', 'br', 'img', 'map', 'object', 'q', 'script', 'span', 'sub', 'sup', 'button', 'input', 'label',
'select', 'textarea', 'blink', 'font', 'marquee', 'nobr', 's', 'strike', 'u', 'wbr',
}
from .clean import Cleaner, clean, clean_html, clean_markup
from .entity import Entity, EntityList, DocumentEntity
from .fields import StringField, IntField, FloatField, BoolField, DateTimeField, EntityField, UrlField
from .scraper import HtmlFormat, XmlFormat, GetRequester, PostRequester, UrlScraper, RssScraper, SearchScraper
from .selector import Selector, SelectorList
from .pub.nlm import NlmXmlDocument
from .pub.rsc import RscHtmlDocument
from .pub.springer import SpringerXmlDocument
| [
1,
396,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
15945,
29908,
13,
14969,
1272,
21111,
272,
29889,
1557,
336,
412,
13,
26594,
26594,
26594,
13,
13,
6185,
4675,
1230,
885,
2390,
292,
6890,
363,
6597,
292,
2281,
2955,
848,
515,
4544,
322,
6560,
10701,
29889,
13,
13,
29901,
8552,
1266,
29901,
14187,
1266,
29871,
29906,
29900,
29896,
29953,
491,
529,
5813,
15513,
13,
29901,
506,
1947,
29901,
341,
1806,
29892,
1074,
365,
2965,
1430,
1660,
934,
363,
901,
4902,
29889,
13,
15945,
29908,
13,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8380,
29918,
5215,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8542,
13,
3166,
4770,
29888,
9130,
1649,
1053,
1596,
29918,
2220,
13,
3166,
4770,
29888,
9130,
1649,
1053,
29104,
29918,
20889,
1338,
13,
13,
29937,
29901,
15658,
3233,
4544,
3161,
13,
29933,
21339,
29918,
29923,
1307,
13780,
29903,
353,
426,
13,
1678,
525,
29886,
742,
525,
29882,
29896,
742,
525,
29882,
29906,
742,
525,
29882,
29941,
742,
525,
29882,
29946,
742,
525,
29882,
29945,
742,
525,
29882,
29953,
742,
525,
352,
742,
525,
324,
742,
525,
1457,
742,
525,
1289,
742,
525,
11671,
742,
525,
4563,
742,
525,
17639,
924,
742,
525,
1443,
742,
525,
689,
742,
13,
1678,
525,
1092,
742,
525,
2371,
742,
525,
2671,
842,
742,
525,
7328,
742,
525,
7914,
742,
525,
294,
680,
742,
525,
18494,
742,
525,
15257,
742,
525,
1003,
6671,
742,
525,
4532,
742,
525,
21720,
742,
13,
1678,
525,
6672,
742,
525,
29882,
2972,
742,
525,
4905,
742,
525,
2042,
742,
525,
2587,
742,
525,
2813,
742,
525,
3257,
742,
525,
509,
742,
525,
1594,
742,
525,
386,
742,
525,
19081,
742,
525,
29873,
6661,
742,
525,
6008,
742,
525,
492,
742,
13,
1678,
525,
15370,
742,
13,
29913,
13,
13,
29937,
29901,
512,
1220,
3233,
4544,
3161,
13,
1177,
18521,
29918,
29923,
1307,
13780,
29903,
353,
426,
13,
1678,
525,
29890,
742,
525,
3752,
742,
525,
29875,
742,
525,
9278,
742,
525,
698,
742,
525,
370,
1182,
742,
525,
562,
1617,
962,
742,
525,
2036,
742,
525,
401,
742,
525,
2176,
29876,
742,
525,
331,
742,
525,
8810,
742,
525,
1110,
742,
525,
29879,
1160,
742,
525,
1707,
742,
13,
1678,
525,
29874,
742,
525,
29890,
1867,
742,
525,
1182,
742,
525,
2492,
742,
525,
1958,
742,
525,
3318,
742,
525,
29939,
742,
525,
2154,
742,
525,
9653,
742,
525,
1491,
742,
525,
12587,
742,
525,
3092,
742,
525,
2080,
742,
525,
1643,
742,
13,
1678,
525,
2622,
742,
525,
20433,
742,
525,
2204,
682,
742,
525,
5657,
742,
525,
3034,
802,
29872,
742,
525,
29876,
711,
29878,
742,
525,
29879,
742,
525,
303,
20995,
742,
525,
29884,
742,
525,
29893,
1182,
742,
13,
29913,
13,
13,
13,
3166,
869,
14941,
1053,
315,
14044,
261,
29892,
5941,
29892,
5941,
29918,
1420,
29892,
5941,
29918,
3502,
786,
13,
3166,
869,
10041,
1053,
14945,
29892,
14945,
1293,
29892,
10854,
6691,
13,
3166,
869,
9621,
1053,
1714,
3073,
29892,
3159,
3073,
29892,
27842,
3073,
29892,
18912,
3073,
29892,
12315,
3073,
29892,
14945,
3073,
29892,
501,
2096,
3073,
13,
3166,
869,
1557,
336,
546,
1053,
24726,
5809,
29892,
24409,
5809,
29892,
3617,
3089,
261,
29892,
4918,
3089,
261,
29892,
501,
2096,
4421,
336,
546,
29892,
390,
893,
4421,
336,
546,
29892,
11856,
4421,
336,
546,
13,
3166,
869,
14357,
1053,
7605,
272,
29892,
7605,
272,
1293,
13,
3166,
869,
5467,
29889,
12938,
29885,
1053,
405,
21457,
11089,
6268,
13,
3166,
869,
5467,
29889,
29878,
1557,
1053,
390,
1557,
10922,
6268,
13,
3166,
869,
5467,
29889,
4278,
261,
1053,
26667,
11089,
6268,
13,
2
] |
application/siteApp/urls.py | Marcelotsvaz/vaz-projects | 0 | 859 | #
# VAZ Projects
#
#
# Author: <NAME> <<EMAIL>>
from django.urls import path
from . import views
app_name = 'siteApp'
urlpatterns = [
path( '', views.Home.as_view(), name = 'home' ),
path( 'about-me', views.About_me.as_view(), name = 'about_me' ),
path( 'search', views.Search.as_view(), name = 'search' ),
path( 'search/page/<int:page>', views.Search.as_view(), name = 'search' ),
path( 'sitemap.xml', views.Sitemap.as_view(), name = 'sitemap' ),
] | [
1,
396,
29871,
13,
29937,
478,
29909,
29999,
8010,
29879,
13,
29937,
29871,
13,
29937,
29871,
13,
29937,
13361,
29901,
529,
5813,
29958,
3532,
26862,
6227,
6778,
13,
13,
13,
13,
3166,
9557,
29889,
26045,
1053,
2224,
13,
13,
3166,
869,
1053,
8386,
13,
13,
13,
932,
29918,
978,
353,
525,
2746,
2052,
29915,
13,
13,
2271,
11037,
29879,
353,
518,
13,
12,
2084,
29898,
15516,
12,
12,
12,
12,
12,
12,
12,
7406,
29889,
11184,
29889,
294,
29918,
1493,
3285,
12,
12,
978,
353,
525,
5184,
29915,
10353,
13,
12,
2084,
29898,
525,
12717,
29899,
1004,
742,
12,
12,
12,
12,
12,
7406,
29889,
28173,
29918,
1004,
29889,
294,
29918,
1493,
3285,
12,
978,
353,
525,
12717,
29918,
1004,
29915,
10353,
13,
12,
2084,
29898,
525,
4478,
742,
12,
12,
12,
12,
12,
12,
7406,
29889,
7974,
29889,
294,
29918,
1493,
3285,
12,
12,
978,
353,
525,
4478,
29915,
10353,
13,
12,
2084,
29898,
525,
4478,
29914,
3488,
29914,
29966,
524,
29901,
3488,
29958,
742,
12,
12,
7406,
29889,
7974,
29889,
294,
29918,
1493,
3285,
12,
12,
978,
353,
525,
4478,
29915,
10353,
13,
12,
2084,
29898,
525,
29879,
667,
481,
29889,
3134,
742,
12,
12,
12,
12,
7406,
29889,
29903,
667,
481,
29889,
294,
29918,
1493,
3285,
12,
978,
353,
525,
29879,
667,
481,
29915,
10353,
13,
29962,
2
] |
examples/poverty-detection-keras/pred_cong_pd.py | rpitonak/eo-learn | 1 | 101937 | <filename>examples/poverty-detection-keras/pred_cong_pd.py
"""
Note: After we have the tf-serving image running, we don't actually need following script.
pred_config.py
List some configuration parameters for prediction
"""
import os
from os import path as op
preds_dir = op.join(os.getcwd(), "preds")
plot_dir = op.join(os.getcwd(), "plots")
ckpt_dir = op.join(os.getcwd(), "models")
# Params to run inference on some tiles in S3
pred_params = dict(model_time='0813_192409', #201910_L5.39
single_batch_size=16, # Number of images seen by a single GPU
n_gpus=1,
deci_prec=2) # Number of decimal places in prediction precision
pred_params.update(dict(model_arch_fname='{}_arch.yaml'.format(pred_params['model_time']),
model_params_fname='{}_params.yaml'.format(pred_params['model_time']),
model_weights_fname='{}_L1.20_E13_weights.h5'.format(pred_params['model_time'])))
| [
1,
529,
9507,
29958,
19057,
29914,
29886,
957,
1017,
29899,
29881,
2650,
428,
29899,
3946,
294,
29914,
11965,
29918,
21015,
29918,
15926,
29889,
2272,
13,
13,
15945,
29908,
13,
9842,
29901,
2860,
591,
505,
278,
15886,
29899,
643,
1747,
1967,
2734,
29892,
591,
1016,
29915,
29873,
2869,
817,
1494,
2471,
29889,
13,
11965,
29918,
2917,
29889,
2272,
13,
13,
1293,
777,
5285,
4128,
363,
18988,
13,
15945,
29908,
13,
5215,
2897,
13,
3166,
2897,
1053,
2224,
408,
1015,
13,
13,
11965,
29879,
29918,
3972,
353,
1015,
29889,
7122,
29898,
359,
29889,
657,
29883,
9970,
3285,
376,
11965,
29879,
1159,
13,
5317,
29918,
3972,
353,
1015,
29889,
7122,
29898,
359,
29889,
657,
29883,
9970,
3285,
376,
26762,
1159,
13,
384,
415,
29918,
3972,
353,
1015,
29889,
7122,
29898,
359,
29889,
657,
29883,
9970,
3285,
376,
9794,
1159,
13,
13,
13,
29937,
1459,
2232,
304,
1065,
27262,
373,
777,
260,
5475,
297,
317,
29941,
13,
11965,
29918,
7529,
353,
9657,
29898,
4299,
29918,
2230,
2433,
29900,
29947,
29896,
29941,
29918,
29896,
29929,
29906,
29946,
29900,
29929,
742,
396,
29906,
29900,
29896,
29929,
29896,
29900,
29918,
29931,
29945,
29889,
29941,
29929,
13,
462,
259,
2323,
29918,
16175,
29918,
2311,
29922,
29896,
29953,
29892,
29871,
396,
9681,
310,
4558,
3595,
491,
263,
2323,
22796,
13,
462,
259,
302,
29918,
29887,
13364,
29922,
29896,
29892,
13,
462,
259,
316,
455,
29918,
17990,
29922,
29906,
29897,
29871,
396,
9681,
310,
13677,
7600,
297,
18988,
16716,
13,
11965,
29918,
7529,
29889,
5504,
29898,
8977,
29898,
4299,
29918,
1279,
29918,
29888,
978,
2433,
29912,
2403,
1279,
29889,
25162,
4286,
4830,
29898,
11965,
29918,
7529,
1839,
4299,
29918,
2230,
2033,
511,
13,
462,
4706,
1904,
29918,
7529,
29918,
29888,
978,
2433,
29912,
2403,
7529,
29889,
25162,
4286,
4830,
29898,
11965,
29918,
7529,
1839,
4299,
29918,
2230,
2033,
511,
13,
462,
4706,
1904,
29918,
705,
5861,
29918,
29888,
978,
2433,
29912,
2403,
29931,
29896,
29889,
29906,
29900,
29918,
29923,
29896,
29941,
29918,
705,
5861,
29889,
29882,
29945,
4286,
4830,
29898,
11965,
29918,
7529,
1839,
4299,
29918,
2230,
2033,
4961,
13,
2
] |
msl/qt/exceptions.py | rebeccahawke/msl-qt | 0 | 43114 | """
Exception handling used by **MSL-Qt**.
"""
import logging
import traceback
from . import QtWidgets, Qt, application
logger = logging.getLogger(__name__)
def excepthook(exc_type, exc_obj, exc_traceback):
"""Displays unhandled exceptions in a :class:`QtWidgets.QMessageBox`.
See :func:`sys.excepthook` for more details.
To implement the :func:`excepthook` in your own application include the following:
.. code-block:: python
import sys
from msl import qt
sys.excepthook = qt.excepthook
"""
def event_handler(e):
"""Resize the QMessageBox"""
result = QtWidgets.QMessageBox.event(msg, e)
detailed_text = msg.findChild(QtWidgets.QTextEdit)
if not detailed_text or not detailed_text.isVisible():
return result
detailed_text.setMaximumSize(QtWidgets.QWIDGETSIZE_MAX, QtWidgets.QWIDGETSIZE_MAX)
detailed_text.setSizePolicy(Qt.QSizePolicy.Expanding, Qt.QSizePolicy.Expanding)
msg.setMaximumSize(QtWidgets.QWIDGETSIZE_MAX, QtWidgets.QWIDGETSIZE_MAX)
msg.setSizePolicy(Qt.QSizePolicy.Expanding, Qt.QSizePolicy.Expanding)
return result
details = ''.join(
['Traceback (most recent call last):\n'] +
traceback.format_tb(exc_traceback) +
[exc_obj.__class__.__name__ + ': ' + str(exc_obj)]
)
logger.error(details)
# ensure that a QApplication exists
app = application()
# add a prefix to the title bar
w = app.activeWindow()
prefix = 'MSL' if w is None or not w.windowTitle() else w.windowTitle()
msg = QtWidgets.QMessageBox()
# want to be able to resize the QMessageBox to allow for the
# DetailedText to be read easier
# see http://www.qtcentre.org/threads/24888-Resizing-a-QMessageBox
msg.event = event_handler
msg.setSizeGripEnabled(True)
msg.setWindowTitle(prefix + ' || Unhandled Exception')
msg.setIcon(QtWidgets.QMessageBox.Critical)
msg.setText(exc_obj.__class__.__name__ + ':')
msg.setInformativeText(str(exc_obj))
msg.setDetailedText(details)
msg.raise_()
msg.exec_()
| [
1,
9995,
13,
2451,
11415,
1304,
491,
3579,
4345,
29931,
29899,
17303,
1068,
29889,
13,
15945,
29908,
13,
5215,
12183,
13,
5215,
9637,
1627,
13,
13,
3166,
869,
1053,
14705,
8801,
29879,
29892,
14705,
29892,
2280,
13,
13,
21707,
353,
12183,
29889,
657,
16363,
22168,
978,
1649,
29897,
13,
13,
13,
1753,
429,
13300,
386,
2550,
29898,
735,
29883,
29918,
1853,
29892,
5566,
29918,
5415,
29892,
5566,
29918,
15003,
1627,
1125,
13,
1678,
9995,
4205,
12922,
443,
3179,
839,
15283,
297,
263,
584,
1990,
18078,
17303,
8801,
29879,
29889,
29984,
3728,
3313,
1412,
13,
13,
1678,
2823,
584,
9891,
18078,
9675,
29889,
735,
13300,
386,
2550,
29952,
363,
901,
4902,
29889,
13,
13,
1678,
1763,
2334,
278,
584,
9891,
18078,
735,
13300,
386,
2550,
29952,
297,
596,
1914,
2280,
3160,
278,
1494,
29901,
13,
13,
1678,
6317,
775,
29899,
1271,
1057,
3017,
13,
13,
4706,
1053,
10876,
13,
4706,
515,
286,
2536,
1053,
3855,
29873,
13,
13,
4706,
10876,
29889,
735,
13300,
386,
2550,
353,
3855,
29873,
29889,
735,
13300,
386,
2550,
13,
13,
1678,
9995,
13,
1678,
822,
1741,
29918,
13789,
29898,
29872,
1125,
13,
4706,
9995,
1666,
675,
278,
660,
3728,
3313,
15945,
29908,
13,
4706,
1121,
353,
14705,
8801,
29879,
29889,
29984,
3728,
3313,
29889,
3696,
29898,
7645,
29892,
321,
29897,
13,
13,
4706,
13173,
29918,
726,
353,
10191,
29889,
2886,
5938,
29898,
17303,
8801,
29879,
29889,
29984,
1626,
6103,
29897,
13,
4706,
565,
451,
13173,
29918,
726,
470,
451,
13173,
29918,
726,
29889,
275,
12911,
7295,
13,
9651,
736,
1121,
13,
13,
4706,
13173,
29918,
726,
29889,
842,
7976,
12539,
3505,
29898,
17303,
8801,
29879,
29889,
29984,
19292,
7194,
14226,
29918,
12648,
29892,
14705,
8801,
29879,
29889,
29984,
19292,
7194,
14226,
29918,
12648,
29897,
13,
4706,
13173,
29918,
726,
29889,
842,
3505,
15644,
29898,
17303,
29889,
29984,
3505,
15644,
29889,
29777,
292,
29892,
14705,
29889,
29984,
3505,
15644,
29889,
29777,
292,
29897,
13,
13,
4706,
10191,
29889,
842,
7976,
12539,
3505,
29898,
17303,
8801,
29879,
29889,
29984,
19292,
7194,
14226,
29918,
12648,
29892,
14705,
8801,
29879,
29889,
29984,
19292,
7194,
14226,
29918,
12648,
29897,
13,
4706,
10191,
29889,
842,
3505,
15644,
29898,
17303,
29889,
29984,
3505,
15644,
29889,
29777,
292,
29892,
14705,
29889,
29984,
3505,
15644,
29889,
29777,
292,
29897,
13,
13,
4706,
736,
1121,
13,
13,
1678,
4902,
353,
525,
4286,
7122,
29898,
13,
4706,
6024,
11591,
1627,
313,
3242,
7786,
1246,
1833,
1125,
29905,
29876,
2033,
718,
13,
4706,
9637,
1627,
29889,
4830,
29918,
22625,
29898,
735,
29883,
29918,
15003,
1627,
29897,
718,
13,
4706,
518,
735,
29883,
29918,
5415,
17255,
1990,
1649,
17255,
978,
1649,
718,
525,
29901,
525,
718,
851,
29898,
735,
29883,
29918,
5415,
4638,
13,
1678,
1723,
13,
13,
1678,
17927,
29889,
2704,
29898,
14144,
29897,
13,
13,
1678,
396,
9801,
393,
263,
660,
4873,
4864,
13,
1678,
623,
353,
2280,
580,
13,
13,
1678,
396,
788,
263,
10944,
304,
278,
3611,
2594,
13,
1678,
281,
353,
623,
29889,
4925,
5907,
580,
13,
1678,
10944,
353,
525,
4345,
29931,
29915,
565,
281,
338,
6213,
470,
451,
281,
29889,
7165,
7030,
580,
1683,
281,
29889,
7165,
7030,
580,
13,
13,
1678,
10191,
353,
14705,
8801,
29879,
29889,
29984,
3728,
3313,
580,
13,
13,
1678,
396,
864,
304,
367,
2221,
304,
19490,
278,
660,
3728,
3313,
304,
2758,
363,
278,
13,
1678,
396,
360,
11881,
1626,
304,
367,
1303,
6775,
13,
1678,
396,
1074,
1732,
597,
1636,
29889,
17915,
1760,
276,
29889,
990,
29914,
28993,
29914,
29906,
29946,
29947,
29947,
29947,
29899,
1666,
5281,
29899,
29874,
29899,
29984,
3728,
3313,
13,
1678,
10191,
29889,
3696,
353,
1741,
29918,
13789,
13,
13,
1678,
10191,
29889,
842,
3505,
29954,
6472,
10861,
29898,
5574,
29897,
13,
1678,
10191,
29889,
842,
5907,
7030,
29898,
13506,
718,
525,
3830,
853,
3179,
839,
8960,
1495,
13,
1678,
10191,
29889,
842,
12492,
29898,
17303,
8801,
29879,
29889,
29984,
3728,
3313,
29889,
29907,
768,
936,
29897,
13,
1678,
10191,
29889,
12038,
29898,
735,
29883,
29918,
5415,
17255,
1990,
1649,
17255,
978,
1649,
718,
525,
29901,
1495,
13,
1678,
10191,
29889,
842,
797,
689,
1230,
1626,
29898,
710,
29898,
735,
29883,
29918,
5415,
876,
13,
1678,
10191,
29889,
842,
29928,
11881,
1626,
29898,
14144,
29897,
13,
1678,
10191,
29889,
22692,
29918,
580,
13,
1678,
10191,
29889,
4258,
29918,
580,
13,
2
] |
Data Structures/Heap/JesseAndCookies.py | aibenStunner/HackerRank | 2 | 37149 | #!/bin/python3
import os
import sys
class minHeap:
def __init__(self):
self.items = []
self.size = len(self.items)
def getLeftChildIndex(self, parentIndex):
return 2 * parentIndex + 1
def getRightChildIndex(self, parentIndex):
return 2 * parentIndex + 2
def getParentIndex(self, childIndex):
return int((childIndex - 1) / 2)
def hasLeftChild(self, index):
return self.getLeftChildIndex(index) < self.size
def hasRightChild(self, index):
return self.getRightChildIndex(index) < self.size
def hasParent(self, index):
return self.getParentIndex(index) >= 0
def leftChild(self, index):
return self.items[self.getLeftChildIndex(index)]
def rightChild(self, index):
return self.items[self.getRightChildIndex(index)]
def parent(self, index):
return self.items[self.getParentIndex(index)]
def swap(self, indexOne, indexTwo):
temp = self.items[indexOne]
self.items[indexOne] = self.items[indexTwo]
self.items[indexTwo] = temp
def pop(self):
if self.size == 0:
raise Exception("Empty Heap!!")
else:
item = self.items[0]
self.items[0] = self.items[self.size - 1]
del(self.items[self.size - 1])
self.size = len(self.items)
self.heapifyDown()
return item
def peek(self):
if self.size == 0:
raise Exception("Empty Heap!!")
else:
return self.items[0]
def add(self, item):
self.items.append(item)
self.size = len(self.items)
self.heapifyUp()
def heapify(self, arr):
for elem in arr:
self.add(elem)
def heapifyUp(self):
index = self.size - 1
while (self.hasParent(index) and self.parent(index) > self.items[index]):
self.swap(self.getParentIndex(index), index)
index = self.getParentIndex(index)
def heapifyDown(self):
index = 0
while(self.hasLeftChild(index)):
smallerChildIndex = self.getLeftChildIndex(index)
if(self.hasRightChild(index) and self.rightChild(index) < self.leftChild(index)):
smallerChildIndex = self.getRightChildIndex(index)
if(self.items[index] < self.items[smallerChildIndex]):
break
else:
self.swap(index, smallerChildIndex)
index = smallerChildIndex
#
# Complete the cookies function below.
#
def cookies(k, A):
qHeap = minHeap()
qHeap.heapify(A)
count = 0
try:
while qHeap.peek() < k:
count += 1
a, b = qHeap.pop(), qHeap.pop()
newCookie = (1*a)+(2*b)
qHeap.add(newCookie)
return count
except:
return -1
if __name__ == '__main__':
# fptr = open(os.environ['OUTPUT_PATH'], 'w')
nk = input().split()
n = int(nk[0])
k = int(nk[1])
A = list(map(int, input().rstrip().split()))
result = cookies(k, A)
print(result)
# fptr.write(str(result) + '\n')
# fptr.close()
# def cookies(k, A):
# from heapq import heappop,heappush,heapify
# heapify(A)
# fC = 0
# try:
# while A[0] < k:
# fC+=1
# c1 = heappop(A)
# c2 = heappop(A)
# newCookie=(1*c1)+(2*c2)
# heappush(A,newCookie)
# return fC
# except:
# return -1
| [
1,
18787,
2109,
29914,
4691,
29941,
13,
13,
5215,
2897,
13,
5215,
10876,
13,
13,
1990,
1375,
3868,
481,
29901,
13,
1678,
822,
4770,
2344,
12035,
1311,
1125,
13,
4706,
1583,
29889,
7076,
353,
5159,
13,
4706,
1583,
29889,
2311,
353,
7431,
29898,
1311,
29889,
7076,
29897,
13,
13,
1678,
822,
679,
8091,
5938,
3220,
29898,
1311,
29892,
3847,
3220,
1125,
13,
4706,
736,
29871,
29906,
334,
3847,
3220,
718,
29871,
29896,
13,
268,
13,
1678,
822,
679,
7341,
5938,
3220,
29898,
1311,
29892,
3847,
3220,
1125,
13,
4706,
736,
29871,
29906,
334,
3847,
3220,
718,
29871,
29906,
13,
268,
13,
1678,
822,
679,
9780,
3220,
29898,
1311,
29892,
2278,
3220,
1125,
13,
4706,
736,
938,
3552,
5145,
3220,
448,
29871,
29896,
29897,
847,
29871,
29906,
29897,
13,
268,
13,
1678,
822,
756,
8091,
5938,
29898,
1311,
29892,
2380,
1125,
13,
4706,
736,
1583,
29889,
657,
8091,
5938,
3220,
29898,
2248,
29897,
529,
1583,
29889,
2311,
13,
13,
1678,
822,
756,
7341,
5938,
29898,
1311,
29892,
2380,
1125,
13,
4706,
736,
1583,
29889,
657,
7341,
5938,
3220,
29898,
2248,
29897,
529,
1583,
29889,
2311,
13,
268,
13,
1678,
822,
756,
9780,
29898,
1311,
29892,
2380,
1125,
13,
4706,
736,
1583,
29889,
657,
9780,
3220,
29898,
2248,
29897,
6736,
29871,
29900,
13,
268,
13,
1678,
822,
2175,
5938,
29898,
1311,
29892,
2380,
1125,
13,
4706,
736,
1583,
29889,
7076,
29961,
1311,
29889,
657,
8091,
5938,
3220,
29898,
2248,
4638,
13,
268,
13,
1678,
822,
1492,
5938,
29898,
1311,
29892,
2380,
1125,
13,
4706,
736,
1583,
29889,
7076,
29961,
1311,
29889,
657,
7341,
5938,
3220,
29898,
2248,
4638,
13,
13,
1678,
822,
3847,
29898,
1311,
29892,
2380,
1125,
13,
4706,
736,
1583,
29889,
7076,
29961,
1311,
29889,
657,
9780,
3220,
29898,
2248,
4638,
13,
13,
1678,
822,
17945,
29898,
1311,
29892,
2380,
6716,
29892,
2380,
13985,
1125,
13,
4706,
5694,
353,
1583,
29889,
7076,
29961,
2248,
6716,
29962,
13,
4706,
1583,
29889,
7076,
29961,
2248,
6716,
29962,
353,
1583,
29889,
7076,
29961,
2248,
13985,
29962,
13,
4706,
1583,
29889,
7076,
29961,
2248,
13985,
29962,
353,
5694,
13,
268,
13,
1678,
822,
1835,
29898,
1311,
1125,
13,
4706,
565,
1583,
29889,
2311,
1275,
29871,
29900,
29901,
13,
9651,
12020,
8960,
703,
8915,
940,
481,
6824,
1159,
13,
4706,
1683,
29901,
13,
9651,
2944,
29871,
353,
1583,
29889,
7076,
29961,
29900,
29962,
13,
9651,
1583,
29889,
7076,
29961,
29900,
29962,
353,
1583,
29889,
7076,
29961,
1311,
29889,
2311,
448,
29871,
29896,
29962,
13,
9651,
628,
29898,
1311,
29889,
7076,
29961,
1311,
29889,
2311,
448,
29871,
29896,
2314,
13,
9651,
1583,
29889,
2311,
353,
7431,
29898,
1311,
29889,
7076,
29897,
13,
9651,
1583,
29889,
354,
481,
1598,
6767,
580,
13,
9651,
736,
2944,
13,
268,
13,
1678,
822,
1236,
1416,
29898,
1311,
1125,
13,
4706,
565,
1583,
29889,
2311,
1275,
29871,
29900,
29901,
13,
9651,
12020,
8960,
703,
8915,
940,
481,
6824,
1159,
13,
4706,
1683,
29901,
13,
9651,
736,
1583,
29889,
7076,
29961,
29900,
29962,
13,
13,
1678,
822,
788,
29898,
1311,
29892,
2944,
1125,
13,
4706,
1583,
29889,
7076,
29889,
4397,
29898,
667,
29897,
13,
4706,
1583,
29889,
2311,
353,
7431,
29898,
1311,
29889,
7076,
29897,
13,
4706,
1583,
29889,
354,
481,
1598,
3373,
580,
13,
268,
13,
1678,
822,
16947,
1598,
29898,
1311,
29892,
3948,
1125,
13,
4706,
363,
21268,
297,
3948,
29901,
13,
9651,
1583,
29889,
1202,
29898,
20461,
29897,
13,
13,
1678,
822,
16947,
1598,
3373,
29898,
1311,
1125,
13,
4706,
2380,
353,
1583,
29889,
2311,
448,
29871,
29896,
13,
4706,
1550,
313,
1311,
29889,
5349,
9780,
29898,
2248,
29897,
322,
1583,
29889,
3560,
29898,
2248,
29897,
1405,
1583,
29889,
7076,
29961,
2248,
29962,
1125,
13,
9651,
1583,
29889,
26276,
29898,
1311,
29889,
657,
9780,
3220,
29898,
2248,
511,
2380,
29897,
13,
9651,
2380,
353,
1583,
29889,
657,
9780,
3220,
29898,
2248,
29897,
13,
13,
1678,
822,
16947,
1598,
6767,
29898,
1311,
1125,
13,
4706,
2380,
353,
29871,
29900,
13,
4706,
1550,
29898,
1311,
29889,
5349,
8091,
5938,
29898,
2248,
22164,
13,
9651,
7968,
5938,
3220,
353,
1583,
29889,
657,
8091,
5938,
3220,
29898,
2248,
29897,
13,
9651,
565,
29898,
1311,
29889,
5349,
7341,
5938,
29898,
2248,
29897,
322,
1583,
29889,
1266,
5938,
29898,
2248,
29897,
529,
1583,
29889,
1563,
5938,
29898,
2248,
22164,
13,
18884,
7968,
5938,
3220,
353,
1583,
29889,
657,
7341,
5938,
3220,
29898,
2248,
29897,
13,
9651,
565,
29898,
1311,
29889,
7076,
29961,
2248,
29962,
529,
1583,
29889,
7076,
29961,
9278,
261,
5938,
3220,
29962,
1125,
13,
18884,
2867,
13,
9651,
1683,
29901,
13,
18884,
1583,
29889,
26276,
29898,
2248,
29892,
7968,
5938,
3220,
29897,
13,
9651,
2380,
353,
7968,
5938,
3220,
13,
13,
29937,
13,
29937,
25034,
278,
21046,
740,
2400,
29889,
13,
29937,
13,
1753,
21046,
29898,
29895,
29892,
319,
1125,
13,
1678,
3855,
3868,
481,
353,
1375,
3868,
481,
580,
13,
1678,
3855,
3868,
481,
29889,
354,
481,
1598,
29898,
29909,
29897,
13,
1678,
2302,
353,
29871,
29900,
13,
1678,
1018,
29901,
13,
4706,
1550,
3855,
3868,
481,
29889,
412,
1416,
580,
529,
413,
29901,
13,
9651,
2302,
4619,
29871,
29896,
13,
9651,
263,
29892,
289,
353,
3855,
3868,
481,
29889,
7323,
3285,
3855,
3868,
481,
29889,
7323,
580,
13,
9651,
716,
24914,
353,
313,
29896,
29930,
29874,
7240,
29898,
29906,
29930,
29890,
29897,
13,
9651,
3855,
3868,
481,
29889,
1202,
29898,
1482,
24914,
29897,
13,
4706,
736,
2302,
13,
1678,
5174,
29901,
13,
4706,
736,
448,
29896,
13,
308,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
396,
285,
7414,
353,
1722,
29898,
359,
29889,
21813,
1839,
12015,
12336,
29918,
10145,
7464,
525,
29893,
1495,
13,
13,
1678,
302,
29895,
353,
1881,
2141,
5451,
580,
13,
13,
1678,
302,
353,
938,
29898,
29876,
29895,
29961,
29900,
2314,
13,
13,
1678,
413,
353,
938,
29898,
29876,
29895,
29961,
29896,
2314,
13,
13,
1678,
319,
353,
1051,
29898,
1958,
29898,
524,
29892,
1881,
2141,
29878,
17010,
2141,
5451,
22130,
13,
13,
1678,
1121,
353,
21046,
29898,
29895,
29892,
319,
29897,
13,
1678,
1596,
29898,
2914,
29897,
13,
13,
1678,
396,
285,
7414,
29889,
3539,
29898,
710,
29898,
2914,
29897,
718,
11297,
29876,
1495,
13,
13,
1678,
396,
285,
7414,
29889,
5358,
580,
13,
13,
13,
29937,
822,
21046,
29898,
29895,
29892,
319,
1125,
13,
29937,
308,
515,
16947,
29939,
1053,
540,
932,
459,
29892,
354,
932,
1878,
29892,
354,
481,
1598,
13,
13,
29937,
308,
16947,
1598,
29898,
29909,
29897,
13,
29937,
308,
285,
29907,
353,
29871,
29900,
13,
29937,
308,
1018,
29901,
13,
29937,
462,
1550,
319,
29961,
29900,
29962,
529,
413,
29901,
13,
29937,
462,
308,
285,
29907,
23661,
29896,
13,
29937,
462,
308,
274,
29896,
353,
540,
932,
459,
29898,
29909,
29897,
13,
29937,
462,
308,
274,
29906,
353,
540,
932,
459,
29898,
29909,
29897,
13,
29937,
462,
308,
716,
24914,
7607,
29896,
29930,
29883,
29896,
7240,
29898,
29906,
29930,
29883,
29906,
29897,
13,
29937,
462,
308,
540,
932,
1878,
29898,
29909,
29892,
1482,
24914,
29897,
13,
29937,
462,
736,
285,
29907,
13,
29937,
308,
5174,
29901,
13,
29937,
462,
736,
448,
29896,
13,
2
] |
sdk/eventhub/azure-eventhub/tests/eventhub_preparer.py | rsdoherty/azure-sdk-for-python | 2,728 | 1607590 | <reponame>rsdoherty/azure-sdk-for-python<filename>sdk/eventhub/azure-eventhub/tests/eventhub_preparer.py
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------
# This EventHubs resource preparer is for future use after the tests are all compatible with
# The resource preparer.
import functools
from azure.mgmt.eventhub import EventHubManagementClient
from azure.mgmt.eventhub.models import Eventhub, AccessRights
from azure_devtools.scenario_tests.exceptions import AzureTestError
from devtools_testutils import (
ResourceGroupPreparer, AzureMgmtPreparer, FakeResource
)
from devtools_testutils.resource_testcase import RESOURCE_GROUP_PARAM
EVENTHUB_DEFAULT_AUTH_RULE_NAME = 'RootManageSharedAccessKey'
EVENTHUB_NAMESPACE_PARAM = 'eventhub_namespace'
EVENTHUB_PARAM = 'eventhub'
EVENTHUB_AUTHORIZATION_RULE_PARAM = 'eventhub_authorization_rule'
# Service Bus Namespace Preparer and its shorthand decorator
class EventHubNamespacePreparer(AzureMgmtPreparer):
def __init__(self,
name_prefix='',
use_cache=False,
sku='Standard', location='westus',
parameter_name=EVENTHUB_NAMESPACE_PARAM,
resource_group_parameter_name=RESOURCE_GROUP_PARAM,
disable_recording=True, playback_fake_resource=None,
client_kwargs=None, random_name_enabled=True):
super(EventHubNamespacePreparer, self).__init__(name_prefix, 24,
random_name_enabled=random_name_enabled,
disable_recording=disable_recording,
playback_fake_resource=playback_fake_resource,
client_kwargs=client_kwargs)
self.location = location
self.sku = sku
self.resource_group_parameter_name = resource_group_parameter_name
self.parameter_name = parameter_name
self.connection_string = ''
if random_name_enabled:
self.resource_moniker = self.name_prefix + "ehname"
self.set_cache(use_cache, sku, location)
def create_resource(self, name, **kwargs):
if self.is_live:
self.client = self.create_mgmt_client(EventHubManagementClient) # type: EventHubManagementClient
group = self._get_resource_group(**kwargs)
namespace_async_operation = self.client.namespaces.begin_create_or_update(
group.name,
name,
{
'sku': {'name': self.sku},
'location': self.location,
}
)
self.resource = namespace_async_operation.result()
key = self.client.namespaces.list_keys(group.name, name, EVENTHUB_DEFAULT_AUTH_RULE_NAME)
self.connection_string = key.primary_connection_string
self.key_name = key.key_name
self.primary_key = key.primary_key
else:
self.resource = FakeResource(name=name, id=name)
self.connection_string = 'Endpoint=sb://{}.servicebus.windows.net/;SharedAccessKeyName=test;SharedAccessKey=<KEY>='.format(name)
self.key_name = EVENTHUB_DEFAULT_AUTH_RULE_NAME
self.primary_key = '<KEY>
return {
self.parameter_name: self.resource,
'{}_connection_string'.format(self.parameter_name): self.connection_string,
'{}_key_name'.format(self.parameter_name): self.key_name,
'{}_primary_key'.format(self.parameter_name): self.primary_key,
'{}_management_client'.format(self.parameter_name): self.client
}
def remove_resource(self, name, **kwargs):
if self.is_live:
group = self._get_resource_group(**kwargs)
self.client.namespaces.begin_delete(group.name, name).wait()
def _get_resource_group(self, **kwargs):
try:
return kwargs.get(self.resource_group_parameter_name)
except KeyError:
template = 'To create an event hub a resource group is required. Please add ' \
'decorator @{} in front of this event hub preparer.'
raise AzureTestError(template.format(ResourceGroupPreparer.__name__))
# Shared base class for event hub sub-resources that require a namespace and RG to exist.
class _EventHubChildResourcePreparer(AzureMgmtPreparer):
def __init__(self,
name_prefix='',
resource_group_parameter_name=RESOURCE_GROUP_PARAM,
eventhub_namespace_parameter_name=EVENTHUB_NAMESPACE_PARAM,
disable_recording=True, playback_fake_resource=None,
client_kwargs=None, random_name_enabled=True):
super(_EventHubChildResourcePreparer, self).__init__(name_prefix, 24,
random_name_enabled=random_name_enabled,
disable_recording=disable_recording,
playback_fake_resource=playback_fake_resource,
client_kwargs=client_kwargs)
self.resource_group_parameter_name = resource_group_parameter_name
self.eventhub_namespace_parameter_name = eventhub_namespace_parameter_name
def _get_resource_group(self, **kwargs):
try:
return kwargs.get(self.resource_group_parameter_name)
except KeyError:
template = 'To create this event hub child resource event hub a resource group is required. Please add ' \
'decorator @{} in front of this event hub preparer.'
raise AzureTestError(template.format(ResourceGroupPreparer.__name__))
def _get_namespace(self, **kwargs):
try:
return kwargs.get(self.eventhub_namespace_parameter_name)
except KeyError:
template = 'To create this event hub child resource a event hub namespace is required. Please add ' \
'decorator @{} in front of this event hub preparer.'
raise AzureTestError(template.format(EventHubNamespacePreparer.__name__))
class EventHubPreparer(_EventHubChildResourcePreparer):
def __init__(self,
name_prefix='',
use_cache=False,
parameter_name=EVENTHUB_PARAM,
resource_group_parameter_name=RESOURCE_GROUP_PARAM,
eventhub_namespace_parameter_name=EVENTHUB_NAMESPACE_PARAM,
disable_recording=True, playback_fake_resource=None,
client_kwargs=None, random_name_enabled=True):
super(EventHubPreparer, self).__init__(name_prefix,
random_name_enabled=random_name_enabled,
resource_group_parameter_name=resource_group_parameter_name,
eventhub_namespace_parameter_name=eventhub_namespace_parameter_name,
disable_recording=disable_recording,
playback_fake_resource=playback_fake_resource,
client_kwargs=client_kwargs)
self.parameter_name = parameter_name
if random_name_enabled:
self.resource_moniker = self.name_prefix + "eventhub"
self.set_cache(use_cache)
def create_resource(self, name, **kwargs):
if self.is_live:
self.client = self.create_mgmt_client(EventHubManagementClient)
group = self._get_resource_group(**kwargs)
namespace = self._get_namespace(**kwargs)
self.resource = self.client.event_hubs.create_or_update(
group.name,
namespace.name,
name,
{}
)
else:
self.resource = FakeResource(name=name, id=name)
return {
self.parameter_name: self.resource,
}
def remove_resource(self, name, **kwargs):
if self.is_live:
group = self._get_resource_group(**kwargs)
namespace = self._get_namespace(**kwargs)
self.client.event_hubs.delete(group.name, namespace.name, name, polling=False)
class EventHubNamespaceAuthorizationRulePreparer(_EventHubChildResourcePreparer):
def __init__(self,
name_prefix='',
use_cache=False,
access_rights=[AccessRights.manage, AccessRights.send, AccessRights.listen],
parameter_name=EVENTHUB_AUTHORIZATION_RULE_PARAM,
resource_group_parameter_name=RESOURCE_GROUP_PARAM,
eventhub_namespace_parameter_name=EVENTHUB_NAMESPACE_PARAM,
disable_recording=True, playback_fake_resource=None,
client_kwargs=None, random_name_enabled=True):
super(EventHubNamespaceAuthorizationRulePreparer, self).__init__(name_prefix,
random_name_enabled=random_name_enabled,
resource_group_parameter_name=resource_group_parameter_name,
eventhub_namespace_parameter_name=eventhub_namespace_parameter_name,
disable_recording=disable_recording,
playback_fake_resource=playback_fake_resource,
client_kwargs=client_kwargs)
self.parameter_name = parameter_name
self.access_rights = access_rights
if random_name_enabled:
self.resource_moniker = self.name_prefix + "sbnameauth"
self.set_cache(use_cache, access_rights)
def create_resource(self, name, **kwargs):
if self.is_live:
self.client = self.create_mgmt_client(EventHubManagementClient)
group = self._get_resource_group(**kwargs)
namespace = self._get_namespace(**kwargs)
self.resource = self.client.namespaces.create_or_update_authorization_rule(
group.name,
namespace.name,
name,
self.access_rights
)
key = self.client.namespaces.list_keys(group.name, namespace.name, name)
connection_string = key.primary_connection_string
else:
self.resource = FakeResource(name=name, id=name)
connection_string = 'https://microsoft.com'
return {
self.parameter_name: self.resource,
'{}_connection_string'.format(self.parameter_name): connection_string,
}
def remove_resource(self, name, **kwargs):
if self.is_live:
group = self._get_resource_group(**kwargs)
namespace = self._get_namespace(**kwargs)
self.client.namespaces.delete_authorization_rule(group.name, namespace.name, name, polling=False)
class EventHubAuthorizationRulePreparer(_EventHubChildResourcePreparer):
def __init__(self,
name_prefix='',
use_cache=False,
access_rights=[AccessRights.manage, AccessRights.send, AccessRights.listen],
parameter_name=EVENTHUB_AUTHORIZATION_RULE_PARAM,
resource_group_parameter_name=RESOURCE_GROUP_PARAM,
eventhub_namespace_parameter_name=EVENTHUB_NAMESPACE_PARAM,
eventhub_parameter_name=EVENTHUB_PARAM,
disable_recording=True, playback_fake_resource=None,
client_kwargs=None, random_name_enabled=True):
super(EventHubAuthorizationRulePreparer, self).__init__(name_prefix,
random_name_enabled=random_name_enabled,
resource_group_parameter_name=resource_group_parameter_name,
eventhub_namespace_parameter_name=eventhub_namespace_parameter_name,
disable_recording=disable_recording,
playback_fake_resource=playback_fake_resource,
client_kwargs=client_kwargs)
self.parameter_name = parameter_name
self.access_rights = access_rights
self.eventhub_parameter_name = eventhub_parameter_name
if random_name_enabled:
self.resource_moniker = self.name_prefix + "evnethubauth"
self.set_cache(use_cache, access_rights)
def create_resource(self, name, **kwargs):
if self.is_live:
self.client = self.create_mgmt_client(EventHubManagementClient)
group = self._get_resource_group(**kwargs)
namespace = self._get_namespace(**kwargs)
eventhub = self._get_eventhub(**kwargs)
self.resource = self.client.event_hubs.create_or_update_authorization_rule(
group.name,
namespace.name,
eventhub.name,
name,
self.access_rights
)
key = self.client.event_hubs.list_keys(group.name, namespace.name, eventhub.name, name)
connection_string = key.primary_connection_string
else:
self.resource = FakeResource(name=name, id=name)
connection_string = 'https://microsoft.com'
return {
self.parameter_name: self.resource,
'{}_connection_string'.format(self.parameter_name): connection_string,
}
def remove_resource(self, name, **kwargs):
if self.is_live:
group = self._get_resource_group(**kwargs)
namespace = self._get_namespace(**kwargs)
eventhub = self._get_eventhub(**kwargs)
self.client.event_hubs.delete_authorization_rule(group.name, namespace.name, eventhub.name, name, polling=False)
def _get_eventhub(self, **kwargs):
try:
return kwargs.get(self.eventhub_parameter_name)
except KeyError:
template = 'To create this event hub authorization rule a event hub is required. Please add ' \
'decorator @{} in front of this event hub preparer.'
raise AzureTestError(template.format(EventHubPreparer.__name__))
CachedEventHubNamespacePreparer = functools.partial(EventHubNamespacePreparer, use_cache=True)
CachedEventHubPreparer = functools.partial(EventHubPreparer, use_cache=True)
| [
1,
529,
276,
1112,
420,
29958,
2288,
29881,
1148,
814,
29891,
29914,
17688,
29899,
15348,
29899,
1454,
29899,
4691,
29966,
9507,
29958,
15348,
29914,
3696,
29882,
431,
29914,
17688,
29899,
3696,
29882,
431,
29914,
21150,
29914,
3696,
29882,
431,
29918,
1457,
862,
261,
29889,
2272,
13,
29937,
2683,
2683,
2683,
2683,
1378,
29899,
13,
29937,
14187,
1266,
313,
29883,
29897,
7783,
15025,
29889,
2178,
10462,
21676,
29889,
13,
29937,
10413,
21144,
1090,
278,
341,
1806,
19245,
29889,
2823,
19245,
29889,
3945,
297,
278,
2060,
3876,
363,
13,
29937,
19405,
2472,
29889,
13,
29937,
2683,
2683,
2683,
2683,
28400,
13,
13,
29937,
910,
6864,
16046,
29879,
6503,
10223,
261,
338,
363,
5434,
671,
1156,
278,
6987,
526,
599,
15878,
411,
13,
29937,
450,
6503,
10223,
261,
29889,
13,
13,
5215,
2090,
312,
8789,
13,
13,
3166,
15699,
29889,
29885,
29887,
4378,
29889,
3696,
29882,
431,
1053,
6864,
16046,
27107,
4032,
13,
3166,
15699,
29889,
29885,
29887,
4378,
29889,
3696,
29882,
431,
29889,
9794,
1053,
6864,
29882,
431,
29892,
11028,
29934,
5861,
13,
13,
3166,
15699,
29918,
3359,
8504,
29889,
1557,
24893,
29918,
21150,
29889,
11739,
29879,
1053,
12634,
3057,
2392,
13,
13,
3166,
2906,
8504,
29918,
1688,
13239,
1053,
313,
13,
1678,
18981,
4782,
6572,
862,
261,
29892,
12634,
29924,
29887,
4378,
6572,
862,
261,
29892,
383,
1296,
6848,
13,
29897,
13,
13,
3166,
2906,
8504,
29918,
1688,
13239,
29889,
10314,
29918,
1688,
4878,
1053,
390,
2890,
22970,
4741,
29918,
26284,
29918,
16320,
5194,
13,
13,
22240,
3919,
29950,
7466,
29918,
23397,
29918,
20656,
29950,
29918,
28283,
1307,
29918,
5813,
353,
525,
10303,
2517,
482,
21741,
6638,
2558,
29915,
13,
22240,
3919,
29950,
7466,
29918,
5813,
5550,
11538,
29918,
16320,
5194,
353,
525,
3696,
29882,
431,
29918,
22377,
29915,
13,
22240,
3919,
29950,
7466,
29918,
16320,
5194,
353,
525,
3696,
29882,
431,
29915,
13,
22240,
3919,
29950,
7466,
29918,
20656,
29950,
1955,
26664,
8098,
29918,
28283,
1307,
29918,
16320,
5194,
353,
525,
3696,
29882,
431,
29918,
8921,
2133,
29918,
7491,
29915,
13,
13,
29937,
6692,
8406,
14706,
3535,
4721,
862,
261,
322,
967,
528,
2072,
392,
10200,
1061,
13,
1990,
6864,
16046,
23335,
6572,
862,
261,
29898,
28413,
29924,
29887,
4378,
6572,
862,
261,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
13,
462,
1024,
29918,
13506,
2433,
742,
13,
462,
671,
29918,
8173,
29922,
8824,
29892,
13,
462,
2071,
29884,
2433,
15449,
742,
4423,
2433,
5933,
375,
742,
13,
462,
3443,
29918,
978,
29922,
22240,
3919,
29950,
7466,
29918,
5813,
5550,
11538,
29918,
16320,
5194,
29892,
13,
462,
6503,
29918,
2972,
29918,
15501,
29918,
978,
29922,
1525,
27839,
4741,
29918,
26284,
29918,
16320,
5194,
29892,
13,
462,
11262,
29918,
3757,
3278,
29922,
5574,
29892,
1708,
1627,
29918,
29888,
1296,
29918,
10314,
29922,
8516,
29892,
13,
462,
3132,
29918,
19290,
29922,
8516,
29892,
4036,
29918,
978,
29918,
17590,
29922,
5574,
1125,
13,
4706,
2428,
29898,
2624,
16046,
23335,
6572,
862,
261,
29892,
1583,
467,
1649,
2344,
12035,
978,
29918,
13506,
29892,
29871,
29906,
29946,
29892,
13,
462,
462,
462,
3986,
4036,
29918,
978,
29918,
17590,
29922,
8172,
29918,
978,
29918,
17590,
29892,
13,
462,
462,
462,
3986,
11262,
29918,
3757,
3278,
29922,
20472,
29918,
3757,
3278,
29892,
13,
462,
462,
462,
3986,
1708,
1627,
29918,
29888,
1296,
29918,
10314,
29922,
1456,
1627,
29918,
29888,
1296,
29918,
10314,
29892,
13,
462,
462,
462,
3986,
3132,
29918,
19290,
29922,
4645,
29918,
19290,
29897,
13,
4706,
1583,
29889,
5479,
353,
4423,
13,
4706,
1583,
29889,
18181,
353,
2071,
29884,
13,
4706,
1583,
29889,
10314,
29918,
2972,
29918,
15501,
29918,
978,
353,
6503,
29918,
2972,
29918,
15501,
29918,
978,
13,
4706,
1583,
29889,
15501,
29918,
978,
353,
3443,
29918,
978,
13,
4706,
1583,
29889,
9965,
29918,
1807,
353,
6629,
13,
4706,
565,
4036,
29918,
978,
29918,
17590,
29901,
13,
9651,
1583,
29889,
10314,
29918,
3712,
5603,
353,
1583,
29889,
978,
29918,
13506,
718,
376,
14797,
978,
29908,
13,
13,
4706,
1583,
29889,
842,
29918,
8173,
29898,
1509,
29918,
8173,
29892,
2071,
29884,
29892,
4423,
29897,
13,
13,
1678,
822,
1653,
29918,
10314,
29898,
1311,
29892,
1024,
29892,
3579,
19290,
1125,
13,
4706,
565,
1583,
29889,
275,
29918,
9258,
29901,
13,
9651,
1583,
29889,
4645,
353,
1583,
29889,
3258,
29918,
29885,
29887,
4378,
29918,
4645,
29898,
2624,
16046,
27107,
4032,
29897,
29871,
396,
1134,
29901,
6864,
16046,
27107,
4032,
13,
9651,
2318,
353,
1583,
3032,
657,
29918,
10314,
29918,
2972,
29898,
1068,
19290,
29897,
13,
9651,
7397,
29918,
12674,
29918,
16453,
353,
1583,
29889,
4645,
29889,
7039,
22459,
29889,
463,
29918,
3258,
29918,
272,
29918,
5504,
29898,
13,
18884,
2318,
29889,
978,
29892,
13,
18884,
1024,
29892,
13,
18884,
426,
13,
462,
1678,
525,
18181,
2396,
11117,
978,
2396,
1583,
29889,
18181,
1118,
13,
462,
1678,
525,
5479,
2396,
1583,
29889,
5479,
29892,
13,
18884,
500,
13,
9651,
1723,
13,
9651,
1583,
29889,
10314,
353,
7397,
29918,
12674,
29918,
16453,
29889,
2914,
580,
13,
13,
9651,
1820,
353,
1583,
29889,
4645,
29889,
7039,
22459,
29889,
1761,
29918,
8149,
29898,
2972,
29889,
978,
29892,
1024,
29892,
382,
29963,
3919,
29950,
7466,
29918,
23397,
29918,
20656,
29950,
29918,
28283,
1307,
29918,
5813,
29897,
13,
9651,
1583,
29889,
9965,
29918,
1807,
353,
1820,
29889,
16072,
29918,
9965,
29918,
1807,
13,
9651,
1583,
29889,
1989,
29918,
978,
353,
1820,
29889,
1989,
29918,
978,
13,
9651,
1583,
29889,
16072,
29918,
1989,
353,
1820,
29889,
16072,
29918,
1989,
13,
4706,
1683,
29901,
13,
9651,
1583,
29889,
10314,
353,
383,
1296,
6848,
29898,
978,
29922,
978,
29892,
1178,
29922,
978,
29897,
13,
9651,
1583,
29889,
9965,
29918,
1807,
353,
525,
25602,
29922,
20778,
597,
29912,
1836,
5509,
8262,
29889,
10499,
29889,
1212,
29914,
29936,
21741,
6638,
2558,
1170,
29922,
1688,
29936,
21741,
6638,
2558,
29922,
29966,
10818,
29958,
2433,
29889,
4830,
29898,
978,
29897,
13,
9651,
1583,
29889,
1989,
29918,
978,
353,
382,
29963,
3919,
29950,
7466,
29918,
23397,
29918,
20656,
29950,
29918,
28283,
1307,
29918,
5813,
13,
9651,
1583,
29889,
16072,
29918,
1989,
353,
12801,
10818,
29958,
13,
4706,
736,
426,
13,
9651,
1583,
29889,
15501,
29918,
978,
29901,
1583,
29889,
10314,
29892,
13,
9651,
22372,
2403,
9965,
29918,
1807,
4286,
4830,
29898,
1311,
29889,
15501,
29918,
978,
1125,
1583,
29889,
9965,
29918,
1807,
29892,
13,
9651,
22372,
2403,
1989,
29918,
978,
4286,
4830,
29898,
1311,
29889,
15501,
29918,
978,
1125,
1583,
29889,
1989,
29918,
978,
29892,
13,
9651,
22372,
2403,
16072,
29918,
1989,
4286,
4830,
29898,
1311,
29889,
15501,
29918,
978,
1125,
1583,
29889,
16072,
29918,
1989,
29892,
13,
9651,
22372,
2403,
21895,
29918,
4645,
4286,
4830,
29898,
1311,
29889,
15501,
29918,
978,
1125,
1583,
29889,
4645,
13,
4706,
500,
13,
13,
1678,
822,
3349,
29918,
10314,
29898,
1311,
29892,
1024,
29892,
3579,
19290,
1125,
13,
4706,
565,
1583,
29889,
275,
29918,
9258,
29901,
13,
9651,
2318,
353,
1583,
3032,
657,
29918,
10314,
29918,
2972,
29898,
1068,
19290,
29897,
13,
9651,
1583,
29889,
4645,
29889,
7039,
22459,
29889,
463,
29918,
8143,
29898,
2972,
29889,
978,
29892,
1024,
467,
10685,
580,
13,
13,
1678,
822,
903,
657,
29918,
10314,
29918,
2972,
29898,
1311,
29892,
3579,
19290,
1125,
13,
4706,
1018,
29901,
13,
9651,
736,
9049,
5085,
29889,
657,
29898,
1311,
29889,
10314,
29918,
2972,
29918,
15501,
29918,
978,
29897,
13,
4706,
5174,
7670,
2392,
29901,
13,
9651,
4472,
353,
525,
1762,
1653,
385,
1741,
19766,
263,
6503,
2318,
338,
3734,
29889,
3529,
788,
525,
320,
13,
462,
539,
525,
19557,
1061,
732,
8875,
297,
4565,
310,
445,
1741,
19766,
10223,
261,
6169,
13,
9651,
12020,
12634,
3057,
2392,
29898,
6886,
29889,
4830,
29898,
6848,
4782,
6572,
862,
261,
17255,
978,
1649,
876,
13,
13,
13,
29937,
21236,
2967,
770,
363,
1741,
19766,
1014,
29899,
13237,
393,
1996,
263,
7397,
322,
390,
29954,
304,
1863,
29889,
13,
1990,
903,
2624,
16046,
5938,
6848,
6572,
862,
261,
29898,
28413,
29924,
29887,
4378,
6572,
862,
261,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
13,
462,
1024,
29918,
13506,
2433,
742,
13,
462,
6503,
29918,
2972,
29918,
15501,
29918,
978,
29922,
1525,
27839,
4741,
29918,
26284,
29918,
16320,
5194,
29892,
13,
462,
1741,
29882,
431,
29918,
22377,
29918,
15501,
29918,
978,
29922,
22240,
3919,
29950,
7466,
29918,
5813,
5550,
11538,
29918,
16320,
5194,
29892,
13,
462,
11262,
29918,
3757,
3278,
29922,
5574,
29892,
1708,
1627,
29918,
29888,
1296,
29918,
10314,
29922,
8516,
29892,
13,
462,
3132,
29918,
19290,
29922,
8516,
29892,
4036,
29918,
978,
29918,
17590,
29922,
5574,
1125,
13,
4706,
2428,
7373,
2624,
16046,
5938,
6848,
6572,
862,
261,
29892,
1583,
467,
1649,
2344,
12035,
978,
29918,
13506,
29892,
29871,
29906,
29946,
29892,
13,
462,
462,
462,
1669,
4036,
29918,
978,
29918,
17590,
29922,
8172,
29918,
978,
29918,
17590,
29892,
13,
462,
462,
462,
1669,
11262,
29918,
3757,
3278,
29922,
20472,
29918,
3757,
3278,
29892,
13,
462,
462,
462,
1669,
1708,
1627,
29918,
29888,
1296,
29918,
10314,
29922,
1456,
1627,
29918,
29888,
1296,
29918,
10314,
29892,
13,
462,
462,
462,
1669,
3132,
29918,
19290,
29922,
4645,
29918,
19290,
29897,
13,
4706,
1583,
29889,
10314,
29918,
2972,
29918,
15501,
29918,
978,
353,
6503,
29918,
2972,
29918,
15501,
29918,
978,
13,
4706,
1583,
29889,
3696,
29882,
431,
29918,
22377,
29918,
15501,
29918,
978,
353,
1741,
29882,
431,
29918,
22377,
29918,
15501,
29918,
978,
13,
13,
1678,
822,
903,
657,
29918,
10314,
29918,
2972,
29898,
1311,
29892,
3579,
19290,
1125,
13,
4706,
1018,
29901,
13,
9651,
736,
9049,
5085,
29889,
657,
29898,
1311,
29889,
10314,
29918,
2972,
29918,
15501,
29918,
978,
29897,
13,
4706,
5174,
7670,
2392,
29901,
13,
9651,
4472,
353,
525,
1762,
1653,
445,
1741,
19766,
2278,
6503,
1741,
19766,
263,
6503,
2318,
338,
3734,
29889,
3529,
788,
525,
320,
13,
462,
539,
525,
19557,
1061,
732,
8875,
297,
4565,
310,
445,
1741,
19766,
10223,
261,
6169,
13,
9651,
12020,
12634,
3057,
2392,
29898,
6886,
29889,
4830,
29898,
6848,
4782,
6572,
862,
261,
17255,
978,
1649,
876,
13,
13,
1678,
822,
903,
657,
29918,
22377,
29898,
1311,
29892,
3579,
19290,
1125,
13,
4706,
1018,
29901,
13,
9651,
736,
9049,
5085,
29889,
657,
29898,
1311,
29889,
3696,
29882,
431,
29918,
22377,
29918,
15501,
29918,
978,
29897,
13,
4706,
5174,
7670,
2392,
29901,
13,
9651,
4472,
353,
525,
1762,
1653,
445,
1741,
19766,
2278,
6503,
263,
1741,
19766,
7397,
338,
3734,
29889,
3529,
788,
525,
320,
13,
462,
539,
525,
19557,
1061,
732,
8875,
297,
4565,
310,
445,
1741,
19766,
10223,
261,
6169,
13,
9651,
12020,
12634,
3057,
2392,
29898,
6886,
29889,
4830,
29898,
2624,
16046,
23335,
6572,
862,
261,
17255,
978,
1649,
876,
13,
13,
13,
1990,
6864,
16046,
6572,
862,
261,
7373,
2624,
16046,
5938,
6848,
6572,
862,
261,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
13,
462,
1024,
29918,
13506,
2433,
742,
13,
462,
671,
29918,
8173,
29922,
8824,
29892,
13,
462,
3443,
29918,
978,
29922,
22240,
3919,
29950,
7466,
29918,
16320,
5194,
29892,
13,
462,
6503,
29918,
2972,
29918,
15501,
29918,
978,
29922,
1525,
27839,
4741,
29918,
26284,
29918,
16320,
5194,
29892,
13,
462,
1741,
29882,
431,
29918,
22377,
29918,
15501,
29918,
978,
29922,
22240,
3919,
29950,
7466,
29918,
5813,
5550,
11538,
29918,
16320,
5194,
29892,
13,
462,
11262,
29918,
3757,
3278,
29922,
5574,
29892,
1708,
1627,
29918,
29888,
1296,
29918,
10314,
29922,
8516,
29892,
13,
462,
3132,
29918,
19290,
29922,
8516,
29892,
4036,
29918,
978,
29918,
17590,
29922,
5574,
1125,
13,
4706,
2428,
29898,
2624,
16046,
6572,
862,
261,
29892,
1583,
467,
1649,
2344,
12035,
978,
29918,
13506,
29892,
13,
462,
462,
462,
268,
4036,
29918,
978,
29918,
17590,
29922,
8172,
29918,
978,
29918,
17590,
29892,
13,
462,
462,
462,
268,
6503,
29918,
2972,
29918,
15501,
29918,
978,
29922,
10314,
29918,
2972,
29918,
15501,
29918,
978,
29892,
13,
462,
462,
462,
268,
1741,
29882,
431,
29918,
22377,
29918,
15501,
29918,
978,
29922,
3696,
29882,
431,
29918,
22377,
29918,
15501,
29918,
978,
29892,
13,
462,
462,
462,
268,
11262,
29918,
3757,
3278,
29922,
20472,
29918,
3757,
3278,
29892,
13,
462,
462,
462,
268,
1708,
1627,
29918,
29888,
1296,
29918,
10314,
29922,
1456,
1627,
29918,
29888,
1296,
29918,
10314,
29892,
13,
462,
462,
462,
268,
3132,
29918,
19290,
29922,
4645,
29918,
19290,
29897,
13,
4706,
1583,
29889,
15501,
29918,
978,
353,
3443,
29918,
978,
13,
4706,
565,
4036,
29918,
978,
29918,
17590,
29901,
13,
9651,
1583,
29889,
10314,
29918,
3712,
5603,
353,
1583,
29889,
978,
29918,
13506,
718,
376,
3696,
29882,
431,
29908,
13,
4706,
1583,
29889,
842,
29918,
8173,
29898,
1509,
29918,
8173,
29897,
13,
13,
1678,
822,
1653,
29918,
10314,
29898,
1311,
29892,
1024,
29892,
3579,
19290,
1125,
13,
4706,
565,
1583,
29889,
275,
29918,
9258,
29901,
13,
9651,
1583,
29889,
4645,
353,
1583,
29889,
3258,
29918,
29885,
29887,
4378,
29918,
4645,
29898,
2624,
16046,
27107,
4032,
29897,
13,
9651,
2318,
353,
1583,
3032,
657,
29918,
10314,
29918,
2972,
29898,
1068,
19290,
29897,
13,
9651,
7397,
353,
1583,
3032,
657,
29918,
22377,
29898,
1068,
19290,
29897,
13,
9651,
1583,
29889,
10314,
353,
1583,
29889,
4645,
29889,
3696,
29918,
29882,
23954,
29889,
3258,
29918,
272,
29918,
5504,
29898,
13,
18884,
2318,
29889,
978,
29892,
13,
18884,
7397,
29889,
978,
29892,
13,
18884,
1024,
29892,
13,
18884,
6571,
13,
9651,
1723,
13,
4706,
1683,
29901,
13,
9651,
1583,
29889,
10314,
353,
383,
1296,
6848,
29898,
978,
29922,
978,
29892,
1178,
29922,
978,
29897,
13,
4706,
736,
426,
13,
9651,
1583,
29889,
15501,
29918,
978,
29901,
1583,
29889,
10314,
29892,
13,
4706,
500,
13,
13,
1678,
822,
3349,
29918,
10314,
29898,
1311,
29892,
1024,
29892,
3579,
19290,
1125,
13,
4706,
565,
1583,
29889,
275,
29918,
9258,
29901,
13,
9651,
2318,
353,
1583,
3032,
657,
29918,
10314,
29918,
2972,
29898,
1068,
19290,
29897,
13,
9651,
7397,
353,
1583,
3032,
657,
29918,
22377,
29898,
1068,
19290,
29897,
13,
9651,
1583,
29889,
4645,
29889,
3696,
29918,
29882,
23954,
29889,
8143,
29898,
2972,
29889,
978,
29892,
7397,
29889,
978,
29892,
1024,
29892,
1248,
1847,
29922,
8824,
29897,
13,
13,
13,
1990,
6864,
16046,
23335,
25471,
10740,
6572,
862,
261,
7373,
2624,
16046,
5938,
6848,
6572,
862,
261,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
13,
462,
1024,
29918,
13506,
2433,
742,
13,
462,
671,
29918,
8173,
29922,
8824,
29892,
13,
462,
2130,
29918,
1266,
29879,
11759,
6638,
29934,
5861,
29889,
1171,
482,
29892,
11028,
29934,
5861,
29889,
6717,
29892,
11028,
29934,
5861,
29889,
20631,
1402,
13,
462,
3443,
29918,
978,
29922,
22240,
3919,
29950,
7466,
29918,
20656,
29950,
1955,
26664,
8098,
29918,
28283,
1307,
29918,
16320,
5194,
29892,
13,
462,
6503,
29918,
2972,
29918,
15501,
29918,
978,
29922,
1525,
27839,
4741,
29918,
26284,
29918,
16320,
5194,
29892,
13,
462,
1741,
29882,
431,
29918,
22377,
29918,
15501,
29918,
978,
29922,
22240,
3919,
29950,
7466,
29918,
5813,
5550,
11538,
29918,
16320,
5194,
29892,
13,
462,
11262,
29918,
3757,
3278,
29922,
5574,
29892,
1708,
1627,
29918,
29888,
1296,
29918,
10314,
29922,
8516,
29892,
13,
462,
3132,
29918,
19290,
29922,
8516,
29892,
4036,
29918,
978,
29918,
17590,
29922,
5574,
1125,
13,
4706,
2428,
29898,
2624,
16046,
23335,
25471,
10740,
6572,
862,
261,
29892,
1583,
467,
1649,
2344,
12035,
978,
29918,
13506,
29892,
13,
462,
462,
462,
268,
4036,
29918,
978,
29918,
17590,
29922,
8172,
29918,
978,
29918,
17590,
29892,
13,
462,
462,
462,
268,
6503,
29918,
2972,
29918,
15501,
29918,
978,
29922,
10314,
29918,
2972,
29918,
15501,
29918,
978,
29892,
13,
462,
462,
462,
268,
1741,
29882,
431,
29918,
22377,
29918,
15501,
29918,
978,
29922,
3696,
29882,
431,
29918,
22377,
29918,
15501,
29918,
978,
29892,
13,
462,
462,
462,
268,
11262,
29918,
3757,
3278,
29922,
20472,
29918,
3757,
3278,
29892,
13,
462,
462,
462,
268,
1708,
1627,
29918,
29888,
1296,
29918,
10314,
29922,
1456,
1627,
29918,
29888,
1296,
29918,
10314,
29892,
13,
462,
462,
462,
268,
3132,
29918,
19290,
29922,
4645,
29918,
19290,
29897,
13,
4706,
1583,
29889,
15501,
29918,
978,
353,
3443,
29918,
978,
13,
4706,
1583,
29889,
5943,
29918,
1266,
29879,
353,
2130,
29918,
1266,
29879,
13,
4706,
565,
4036,
29918,
978,
29918,
17590,
29901,
13,
9651,
1583,
29889,
10314,
29918,
3712,
5603,
353,
1583,
29889,
978,
29918,
13506,
718,
376,
20778,
978,
5150,
29908,
13,
4706,
1583,
29889,
842,
29918,
8173,
29898,
1509,
29918,
8173,
29892,
2130,
29918,
1266,
29879,
29897,
13,
13,
1678,
822,
1653,
29918,
10314,
29898,
1311,
29892,
1024,
29892,
3579,
19290,
1125,
13,
4706,
565,
1583,
29889,
275,
29918,
9258,
29901,
13,
9651,
1583,
29889,
4645,
353,
1583,
29889,
3258,
29918,
29885,
29887,
4378,
29918,
4645,
29898,
2624,
16046,
27107,
4032,
29897,
13,
9651,
2318,
353,
1583,
3032,
657,
29918,
10314,
29918,
2972,
29898,
1068,
19290,
29897,
13,
9651,
7397,
353,
1583,
3032,
657,
29918,
22377,
29898,
1068,
19290,
29897,
13,
9651,
1583,
29889,
10314,
353,
1583,
29889,
4645,
29889,
7039,
22459,
29889,
3258,
29918,
272,
29918,
5504,
29918,
8921,
2133,
29918,
7491,
29898,
13,
18884,
2318,
29889,
978,
29892,
13,
18884,
7397,
29889,
978,
29892,
13,
18884,
1024,
29892,
13,
18884,
1583,
29889,
5943,
29918,
1266,
29879,
13,
9651,
1723,
13,
13,
9651,
1820,
353,
1583,
29889,
4645,
29889,
7039,
22459,
29889,
1761,
29918,
8149,
29898,
2972,
29889,
978,
29892,
7397,
29889,
978,
29892,
1024,
29897,
13,
9651,
3957,
29918,
1807,
353,
1820,
29889,
16072,
29918,
9965,
29918,
1807,
13,
4706,
1683,
29901,
13,
9651,
1583,
29889,
10314,
353,
383,
1296,
6848,
29898,
978,
29922,
978,
29892,
1178,
29922,
978,
29897,
13,
9651,
3957,
29918,
1807,
353,
525,
991,
597,
4994,
29889,
510,
29915,
13,
4706,
736,
426,
13,
9651,
1583,
29889,
15501,
29918,
978,
29901,
1583,
29889,
10314,
29892,
13,
9651,
22372,
2403,
9965,
29918,
1807,
4286,
4830,
29898,
1311,
29889,
15501,
29918,
978,
1125,
3957,
29918,
1807,
29892,
13,
4706,
500,
13,
13,
1678,
822,
3349,
29918,
10314,
29898,
1311,
29892,
1024,
29892,
3579,
19290,
1125,
13,
4706,
565,
1583,
29889,
275,
29918,
9258,
29901,
13,
9651,
2318,
353,
1583,
3032,
657,
29918,
10314,
29918,
2972,
29898,
1068,
19290,
29897,
13,
9651,
7397,
353,
1583,
3032,
657,
29918,
22377,
29898,
1068,
19290,
29897,
13,
9651,
1583,
29889,
4645,
29889,
7039,
22459,
29889,
8143,
29918,
8921,
2133,
29918,
7491,
29898,
2972,
29889,
978,
29892,
7397,
29889,
978,
29892,
1024,
29892,
1248,
1847,
29922,
8824,
29897,
13,
13,
13,
1990,
6864,
16046,
25471,
10740,
6572,
862,
261,
7373,
2624,
16046,
5938,
6848,
6572,
862,
261,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
13,
462,
1024,
29918,
13506,
2433,
742,
13,
462,
671,
29918,
8173,
29922,
8824,
29892,
13,
462,
2130,
29918,
1266,
29879,
11759,
6638,
29934,
5861,
29889,
1171,
482,
29892,
11028,
29934,
5861,
29889,
6717,
29892,
11028,
29934,
5861,
29889,
20631,
1402,
13,
462,
3443,
29918,
978,
29922,
22240,
3919,
29950,
7466,
29918,
20656,
29950,
1955,
26664,
8098,
29918,
28283,
1307,
29918,
16320,
5194,
29892,
13,
462,
6503,
29918,
2972,
29918,
15501,
29918,
978,
29922,
1525,
27839,
4741,
29918,
26284,
29918,
16320,
5194,
29892,
13,
462,
1741,
29882,
431,
29918,
22377,
29918,
15501,
29918,
978,
29922,
22240,
3919,
29950,
7466,
29918,
5813,
5550,
11538,
29918,
16320,
5194,
29892,
13,
462,
1741,
29882,
431,
29918,
15501,
29918,
978,
29922,
22240,
3919,
29950,
7466,
29918,
16320,
5194,
29892,
13,
462,
11262,
29918,
3757,
3278,
29922,
5574,
29892,
1708,
1627,
29918,
29888,
1296,
29918,
10314,
29922,
8516,
29892,
13,
462,
3132,
29918,
19290,
29922,
8516,
29892,
4036,
29918,
978,
29918,
17590,
29922,
5574,
1125,
13,
4706,
2428,
29898,
2624,
16046,
25471,
10740,
6572,
862,
261,
29892,
1583,
467,
1649,
2344,
12035,
978,
29918,
13506,
29892,
13,
462,
462,
462,
268,
4036,
29918,
978,
29918,
17590,
29922,
8172,
29918,
978,
29918,
17590,
29892,
13,
462,
462,
462,
268,
6503,
29918,
2972,
29918,
15501,
29918,
978,
29922,
10314,
29918,
2972,
29918,
15501,
29918,
978,
29892,
13,
462,
462,
462,
268,
1741,
29882,
431,
29918,
22377,
29918,
15501,
29918,
978,
29922,
3696,
29882,
431,
29918,
22377,
29918,
15501,
29918,
978,
29892,
13,
462,
462,
462,
268,
11262,
29918,
3757,
3278,
29922,
20472,
29918,
3757,
3278,
29892,
13,
462,
462,
462,
268,
1708,
1627,
29918,
29888,
1296,
29918,
10314,
29922,
1456,
1627,
29918,
29888,
1296,
29918,
10314,
29892,
13,
462,
462,
462,
268,
3132,
29918,
19290,
29922,
4645,
29918,
19290,
29897,
13,
4706,
1583,
29889,
15501,
29918,
978,
353,
3443,
29918,
978,
13,
4706,
1583,
29889,
5943,
29918,
1266,
29879,
353,
2130,
29918,
1266,
29879,
13,
4706,
1583,
29889,
3696,
29882,
431,
29918,
15501,
29918,
978,
353,
1741,
29882,
431,
29918,
15501,
29918,
978,
13,
4706,
565,
4036,
29918,
978,
29918,
17590,
29901,
13,
9651,
1583,
29889,
10314,
29918,
3712,
5603,
353,
1583,
29889,
978,
29918,
13506,
718,
376,
5750,
29876,
621,
431,
5150,
29908,
13,
4706,
1583,
29889,
842,
29918,
8173,
29898,
1509,
29918,
8173,
29892,
2130,
29918,
1266,
29879,
29897,
13,
13,
1678,
822,
1653,
29918,
10314,
29898,
1311,
29892,
1024,
29892,
3579,
19290,
1125,
13,
4706,
565,
1583,
29889,
275,
29918,
9258,
29901,
13,
9651,
1583,
29889,
4645,
353,
1583,
29889,
3258,
29918,
29885,
29887,
4378,
29918,
4645,
29898,
2624,
16046,
27107,
4032,
29897,
13,
9651,
2318,
353,
1583,
3032,
657,
29918,
10314,
29918,
2972,
29898,
1068,
19290,
29897,
13,
9651,
7397,
353,
1583,
3032,
657,
29918,
22377,
29898,
1068,
19290,
29897,
13,
9651,
1741,
29882,
431,
353,
1583,
3032,
657,
29918,
3696,
29882,
431,
29898,
1068,
19290,
29897,
13,
9651,
1583,
29889,
10314,
353,
1583,
29889,
4645,
29889,
3696,
29918,
29882,
23954,
29889,
3258,
29918,
272,
29918,
5504,
29918,
8921,
2133,
29918,
7491,
29898,
13,
18884,
2318,
29889,
978,
29892,
13,
18884,
7397,
29889,
978,
29892,
13,
18884,
1741,
29882,
431,
29889,
978,
29892,
13,
18884,
1024,
29892,
13,
18884,
1583,
29889,
5943,
29918,
1266,
29879,
13,
9651,
1723,
13,
13,
9651,
1820,
353,
1583,
29889,
4645,
29889,
3696,
29918,
29882,
23954,
29889,
1761,
29918,
8149,
29898,
2972,
29889,
978,
29892,
7397,
29889,
978,
29892,
1741,
29882,
431,
29889,
978,
29892,
1024,
29897,
13,
9651,
3957,
29918,
1807,
353,
1820,
29889,
16072,
29918,
9965,
29918,
1807,
13,
4706,
1683,
29901,
13,
9651,
1583,
29889,
10314,
353,
383,
1296,
6848,
29898,
978,
29922,
978,
29892,
1178,
29922,
978,
29897,
13,
9651,
3957,
29918,
1807,
353,
525,
991,
597,
4994,
29889,
510,
29915,
13,
4706,
736,
426,
13,
9651,
1583,
29889,
15501,
29918,
978,
29901,
1583,
29889,
10314,
29892,
13,
9651,
22372,
2403,
9965,
29918,
1807,
4286,
4830,
29898,
1311,
29889,
15501,
29918,
978,
1125,
3957,
29918,
1807,
29892,
13,
4706,
500,
13,
13,
1678,
822,
3349,
29918,
10314,
29898,
1311,
29892,
1024,
29892,
3579,
19290,
1125,
13,
4706,
565,
1583,
29889,
275,
29918,
9258,
29901,
13,
9651,
2318,
353,
1583,
3032,
657,
29918,
10314,
29918,
2972,
29898,
1068,
19290,
29897,
13,
9651,
7397,
353,
1583,
3032,
657,
29918,
22377,
29898,
1068,
19290,
29897,
13,
9651,
1741,
29882,
431,
353,
1583,
3032,
657,
29918,
3696,
29882,
431,
29898,
1068,
19290,
29897,
13,
9651,
1583,
29889,
4645,
29889,
3696,
29918,
29882,
23954,
29889,
8143,
29918,
8921,
2133,
29918,
7491,
29898,
2972,
29889,
978,
29892,
7397,
29889,
978,
29892,
1741,
29882,
431,
29889,
978,
29892,
1024,
29892,
1248,
1847,
29922,
8824,
29897,
13,
13,
1678,
822,
903,
657,
29918,
3696,
29882,
431,
29898,
1311,
29892,
3579,
19290,
1125,
13,
4706,
1018,
29901,
13,
9651,
736,
9049,
5085,
29889,
657,
29898,
1311,
29889,
3696,
29882,
431,
29918,
15501,
29918,
978,
29897,
13,
4706,
5174,
7670,
2392,
29901,
13,
9651,
4472,
353,
525,
1762,
1653,
445,
1741,
19766,
28733,
5751,
263,
1741,
19766,
338,
3734,
29889,
3529,
788,
525,
320,
13,
462,
539,
525,
19557,
1061,
732,
8875,
297,
4565,
310,
445,
1741,
19766,
10223,
261,
6169,
13,
9651,
12020,
12634,
3057,
2392,
29898,
6886,
29889,
4830,
29898,
2624,
16046,
6572,
862,
261,
17255,
978,
1649,
876,
13,
13,
13,
29907,
3791,
2624,
16046,
23335,
6572,
862,
261,
353,
2090,
312,
8789,
29889,
3846,
29898,
2624,
16046,
23335,
6572,
862,
261,
29892,
671,
29918,
8173,
29922,
5574,
29897,
13,
29907,
3791,
2624,
16046,
6572,
862,
261,
353,
2090,
312,
8789,
29889,
3846,
29898,
2624,
16046,
6572,
862,
261,
29892,
671,
29918,
8173,
29922,
5574,
29897,
13,
2
] |
rnn/chatbot/chatbot.py | llichengtong/yx4 | 128 | 21467 | # coding=utf8
import logging
import os
import random
import re
import numpy as np
import tensorflow as tf
from seq2seq_conversation_model import seq2seq_model
from seq2seq_conversation_model import data_utils
from seq2seq_conversation_model import tokenizer
from seq2seq_conversation_model.seq2seq_conversation_model import FLAGS, _buckets
from settings import SEQ2SEQ_MODEL_DIR
_LOGGER = logging.getLogger('track')
UNK_TOKEN_REPLACEMENT = [
'?',
'我不知道你在说什么',
'什么鬼。。。',
'宝宝不知道你在说什么呐。。。',
]
ENGLISHWORD_PATTERN = re.compile(r'[a-zA-Z0-9]')
def is_unichar_englishnum(char):
return ENGLISHWORD_PATTERN.match(char)
def trim(s):
"""
1. delete every space between chinese words
2. suppress extra spaces
:param s: some python string
:return: the trimmed string
"""
if not (isinstance(s, unicode) or isinstance(s, str)):
return s
unistr = s.decode('utf8') if type(s) != unicode else s
unistr = unistr.strip()
if not unistr:
return ''
trimmed_str = []
if unistr[0] != ' ':
trimmed_str.append(unistr[0])
for ind in xrange(1, len(unistr) - 1):
prev_char = unistr[ind - 1] if len(trimmed_str) == 0 else trimmed_str[-1]
cur_char = unistr[ind]
maybe_trim = cur_char == ' '
next_char = unistr[ind + 1]
if not maybe_trim:
trimmed_str.append(cur_char)
else:
if is_unichar_englishnum(prev_char) and is_unichar_englishnum(next_char):
trimmed_str.append(cur_char)
else:
continue
if unistr[-1] != ' ':
trimmed_str.append(unistr[-1])
return ''.join(trimmed_str)
class Chatbot():
"""
answer an enquiry using trained seq2seq model
"""
def __init__(self, model_dir):
# Create model and load parameters.
self.session = tf.InteractiveSession()
self.model = self.create_model(self.session, model_dir, True)
self.model.batch_size = 1
# Load vocabularies.
vocab_path = os.path.join(FLAGS.data_dir, "vocab%d" % FLAGS.vocab_size)
self.vocab, self.rev_vocab = data_utils.initialize_vocabulary(vocab_path)
def create_model(self, session, model_dir, forward_only):
"""Create conversation model and initialize or load parameters in session."""
model = seq2seq_model.Seq2SeqModel(
FLAGS.vocab_size, FLAGS.vocab_size, _buckets,
FLAGS.size, FLAGS.num_layers, FLAGS.max_gradient_norm,
FLAGS.batch_size,
FLAGS.learning_rate, FLAGS.learning_rate_decay_factor,
use_lstm=FLAGS.use_lstm,
forward_only=forward_only)
ckpt = tf.train.get_checkpoint_state(model_dir)
if ckpt and tf.train.checkpoint_exists(ckpt.model_checkpoint_path):
_LOGGER.info("Reading model parameters from %s" % ckpt.model_checkpoint_path)
model.saver.restore(session, ckpt.model_checkpoint_path)
_LOGGER.info("Read model parameter succeed!")
else:
raise ValueError(
"Failed to find legal model checkpoint files in %s" % model_dir)
return model
def generate_answer(self, enquiry):
# Get token-ids for the input sentence.
token_ids = data_utils.sentence_to_token_ids(enquiry, self.vocab, tokenizer.fmm_tokenizer)
if len(token_ids) == 0:
_LOGGER.error('lens of token ids of sentence %s is 0' % enquiry)
# Which bucket does it belong to?
bucket_id = min([b for b in xrange(len(_buckets))
if _buckets[b][0] > len(token_ids)])
# Get a 1-element batch to feed the sentence to the model.
encoder_inputs, decoder_inputs, target_weights = self.model.get_batch(
{bucket_id: [(token_ids, [])]}, bucket_id)
# Get output logits for the sentence.
_, _, output_logits = self.model.step(self.session, encoder_inputs,
decoder_inputs,
target_weights, bucket_id, True)
# This is a greedy decoder - outputs are just argmaxes of output_logits.
outputs = [int(np.argmax(logit, axis=1)) for logit in output_logits]
# If there is an EOS symbol in outputs, cut them at that point.
if tokenizer.EOS_ID in outputs:
outputs = outputs[:outputs.index(tokenizer.EOS_ID)]
# Print out response sentence corresponding to outputs.
answer = " ".join([self.rev_vocab[output] for output in outputs])
if tokenizer._UNK in answer:
answer = random.choice(UNK_TOKEN_REPLACEMENT)
answer = trim(answer)
return answer
def close(self):
self.session.close()
if __name__ == "__main__":
m = Chatbot(SEQ2SEQ_MODEL_DIR + '/train/')
response = m.generate_answer(u'我知道你不知道我知道你不知道我说的是什么意思')
print response
| [
1,
396,
14137,
29922,
9420,
29947,
13,
5215,
12183,
13,
5215,
2897,
13,
5215,
4036,
13,
5215,
337,
13,
5215,
12655,
408,
7442,
13,
5215,
26110,
408,
15886,
13,
3166,
19359,
29906,
11762,
29918,
535,
874,
362,
29918,
4299,
1053,
19359,
29906,
11762,
29918,
4299,
13,
3166,
19359,
29906,
11762,
29918,
535,
874,
362,
29918,
4299,
1053,
848,
29918,
13239,
13,
3166,
19359,
29906,
11762,
29918,
535,
874,
362,
29918,
4299,
1053,
5993,
3950,
13,
3166,
19359,
29906,
11762,
29918,
535,
874,
362,
29918,
4299,
29889,
11762,
29906,
11762,
29918,
535,
874,
362,
29918,
4299,
1053,
383,
4375,
10749,
29892,
903,
2423,
9737,
13,
3166,
6055,
1053,
3725,
29984,
29906,
1660,
29984,
29918,
20387,
29931,
29918,
9464,
13,
13,
29918,
14480,
17070,
353,
12183,
29889,
657,
16363,
877,
11294,
1495,
13,
13,
3904,
29968,
29918,
4986,
29968,
1430,
29918,
1525,
7390,
11538,
13780,
353,
518,
13,
1678,
525,
30882,
742,
13,
1678,
525,
30672,
30413,
31043,
30397,
30919,
30505,
31639,
231,
190,
131,
31882,
742,
13,
1678,
525,
231,
190,
131,
31882,
31820,
30267,
30267,
30267,
742,
13,
1678,
525,
31647,
31647,
30413,
31043,
30397,
30919,
30505,
31639,
231,
190,
131,
31882,
232,
148,
147,
30267,
30267,
30267,
742,
13,
29962,
13,
13,
13,
1430,
7239,
3235,
29950,
17013,
29918,
29925,
1299,
4945,
29940,
353,
337,
29889,
12198,
29898,
29878,
29915,
29961,
29874,
29899,
25265,
29899,
29999,
29900,
29899,
29929,
29962,
1495,
13,
13,
13,
1753,
338,
29918,
348,
436,
279,
29918,
996,
1674,
1949,
29898,
3090,
1125,
13,
1678,
736,
12524,
7239,
3235,
29950,
17013,
29918,
29925,
1299,
4945,
29940,
29889,
4352,
29898,
3090,
29897,
13,
13,
13,
1753,
17151,
29898,
29879,
1125,
13,
1678,
9995,
13,
268,
29896,
29889,
5217,
1432,
2913,
1546,
521,
8233,
3838,
13,
268,
29906,
29889,
21301,
4805,
8162,
13,
1678,
584,
3207,
269,
29901,
777,
3017,
1347,
13,
1678,
584,
2457,
29901,
278,
17151,
2168,
1347,
13,
1678,
9995,
13,
1678,
565,
451,
313,
275,
8758,
29898,
29879,
29892,
29104,
29897,
470,
338,
8758,
29898,
29879,
29892,
851,
22164,
13,
4706,
736,
269,
13,
1678,
443,
2132,
353,
269,
29889,
13808,
877,
9420,
29947,
1495,
565,
1134,
29898,
29879,
29897,
2804,
29104,
1683,
269,
13,
1678,
443,
2132,
353,
443,
2132,
29889,
17010,
580,
13,
1678,
565,
451,
443,
2132,
29901,
13,
4706,
736,
6629,
13,
1678,
17151,
2168,
29918,
710,
353,
5159,
13,
1678,
565,
443,
2132,
29961,
29900,
29962,
2804,
525,
525,
29901,
13,
4706,
17151,
2168,
29918,
710,
29889,
4397,
29898,
348,
2132,
29961,
29900,
2314,
13,
1678,
363,
1399,
297,
921,
3881,
29898,
29896,
29892,
7431,
29898,
348,
2132,
29897,
448,
29871,
29896,
1125,
13,
4706,
12379,
29918,
3090,
353,
443,
2132,
29961,
513,
448,
29871,
29896,
29962,
565,
7431,
29898,
15450,
2168,
29918,
710,
29897,
1275,
29871,
29900,
1683,
17151,
2168,
29918,
710,
14352,
29896,
29962,
13,
4706,
3151,
29918,
3090,
353,
443,
2132,
29961,
513,
29962,
13,
4706,
5505,
29918,
15450,
353,
3151,
29918,
3090,
1275,
525,
525,
13,
4706,
2446,
29918,
3090,
353,
443,
2132,
29961,
513,
718,
29871,
29896,
29962,
13,
4706,
565,
451,
5505,
29918,
15450,
29901,
13,
9651,
17151,
2168,
29918,
710,
29889,
4397,
29898,
2764,
29918,
3090,
29897,
13,
4706,
1683,
29901,
13,
9651,
565,
338,
29918,
348,
436,
279,
29918,
996,
1674,
1949,
29898,
16304,
29918,
3090,
29897,
322,
338,
29918,
348,
436,
279,
29918,
996,
1674,
1949,
29898,
4622,
29918,
3090,
1125,
13,
18884,
17151,
2168,
29918,
710,
29889,
4397,
29898,
2764,
29918,
3090,
29897,
13,
9651,
1683,
29901,
13,
18884,
6773,
13,
1678,
565,
443,
2132,
14352,
29896,
29962,
2804,
525,
525,
29901,
13,
4706,
17151,
2168,
29918,
710,
29889,
4397,
29898,
348,
2132,
14352,
29896,
2314,
13,
1678,
736,
525,
4286,
7122,
29898,
15450,
2168,
29918,
710,
29897,
13,
13,
13,
1990,
678,
271,
7451,
7295,
13,
1678,
9995,
13,
1678,
1234,
385,
22085,
16129,
773,
16370,
19359,
29906,
11762,
1904,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1904,
29918,
3972,
1125,
13,
4706,
396,
6204,
1904,
322,
2254,
4128,
29889,
13,
4706,
1583,
29889,
7924,
353,
15886,
29889,
4074,
4925,
7317,
580,
13,
4706,
1583,
29889,
4299,
353,
1583,
29889,
3258,
29918,
4299,
29898,
1311,
29889,
7924,
29892,
1904,
29918,
3972,
29892,
5852,
29897,
13,
4706,
1583,
29889,
4299,
29889,
16175,
29918,
2311,
353,
29871,
29896,
13,
4706,
396,
16012,
7931,
370,
1070,
583,
29889,
13,
4706,
7931,
370,
29918,
2084,
353,
2897,
29889,
2084,
29889,
7122,
29898,
18823,
10749,
29889,
1272,
29918,
3972,
29892,
376,
29894,
542,
370,
29995,
29881,
29908,
1273,
383,
4375,
10749,
29889,
29894,
542,
370,
29918,
2311,
29897,
13,
4706,
1583,
29889,
29894,
542,
370,
29892,
1583,
29889,
13478,
29918,
29894,
542,
370,
353,
848,
29918,
13239,
29889,
24926,
29918,
29894,
542,
370,
352,
653,
29898,
29894,
542,
370,
29918,
2084,
29897,
13,
13,
1678,
822,
1653,
29918,
4299,
29898,
1311,
29892,
4867,
29892,
1904,
29918,
3972,
29892,
6375,
29918,
6194,
1125,
13,
4706,
9995,
4391,
14983,
1904,
322,
11905,
470,
2254,
4128,
297,
4867,
1213,
15945,
13,
4706,
1904,
353,
19359,
29906,
11762,
29918,
4299,
29889,
23718,
29906,
23718,
3195,
29898,
13,
9651,
383,
4375,
10749,
29889,
29894,
542,
370,
29918,
2311,
29892,
383,
4375,
10749,
29889,
29894,
542,
370,
29918,
2311,
29892,
903,
2423,
9737,
29892,
13,
9651,
383,
4375,
10749,
29889,
2311,
29892,
383,
4375,
10749,
29889,
1949,
29918,
29277,
29892,
383,
4375,
10749,
29889,
3317,
29918,
24970,
29918,
12324,
29892,
13,
9651,
383,
4375,
10749,
29889,
16175,
29918,
2311,
29892,
13,
9651,
383,
4375,
10749,
29889,
21891,
29918,
10492,
29892,
383,
4375,
10749,
29889,
21891,
29918,
10492,
29918,
7099,
388,
29918,
19790,
29892,
13,
9651,
671,
29918,
20155,
29885,
29922,
18823,
10749,
29889,
1509,
29918,
20155,
29885,
29892,
13,
9651,
6375,
29918,
6194,
29922,
11333,
29918,
6194,
29897,
13,
13,
4706,
274,
29895,
415,
353,
15886,
29889,
14968,
29889,
657,
29918,
3198,
3149,
29918,
3859,
29898,
4299,
29918,
3972,
29897,
13,
4706,
565,
274,
29895,
415,
322,
15886,
29889,
14968,
29889,
3198,
3149,
29918,
9933,
29898,
384,
415,
29889,
4299,
29918,
3198,
3149,
29918,
2084,
1125,
13,
9651,
903,
14480,
17070,
29889,
3888,
703,
6359,
292,
1904,
4128,
515,
1273,
29879,
29908,
1273,
274,
29895,
415,
29889,
4299,
29918,
3198,
3149,
29918,
2084,
29897,
13,
9651,
1904,
29889,
4977,
369,
29889,
5060,
487,
29898,
7924,
29892,
274,
29895,
415,
29889,
4299,
29918,
3198,
3149,
29918,
2084,
29897,
13,
9651,
903,
14480,
17070,
29889,
3888,
703,
6359,
1904,
3443,
9269,
29991,
1159,
13,
4706,
1683,
29901,
13,
9651,
12020,
7865,
2392,
29898,
13,
18884,
376,
17776,
304,
1284,
11706,
1904,
1423,
3149,
2066,
297,
1273,
29879,
29908,
1273,
1904,
29918,
3972,
29897,
13,
4706,
736,
1904,
13,
13,
1678,
822,
5706,
29918,
12011,
29898,
1311,
29892,
22085,
16129,
1125,
13,
4706,
396,
3617,
5993,
29899,
4841,
363,
278,
1881,
10541,
29889,
13,
4706,
5993,
29918,
4841,
353,
848,
29918,
13239,
29889,
18616,
663,
29918,
517,
29918,
6979,
29918,
4841,
29898,
264,
339,
16129,
29892,
1583,
29889,
29894,
542,
370,
29892,
5993,
3950,
29889,
29888,
4317,
29918,
6979,
3950,
29897,
13,
4706,
565,
7431,
29898,
6979,
29918,
4841,
29897,
1275,
29871,
29900,
29901,
13,
9651,
903,
14480,
17070,
29889,
2704,
877,
29880,
575,
310,
5993,
18999,
310,
10541,
1273,
29879,
338,
29871,
29900,
29915,
1273,
22085,
16129,
29897,
13,
4706,
396,
8449,
20968,
947,
372,
6852,
304,
29973,
13,
4706,
20968,
29918,
333,
353,
1375,
4197,
29890,
363,
289,
297,
921,
3881,
29898,
2435,
7373,
2423,
9737,
876,
13,
462,
308,
565,
903,
2423,
9737,
29961,
29890,
3816,
29900,
29962,
1405,
7431,
29898,
6979,
29918,
4841,
29897,
2314,
13,
4706,
396,
3617,
263,
29871,
29896,
29899,
5029,
9853,
304,
8343,
278,
10541,
304,
278,
1904,
29889,
13,
4706,
2094,
6119,
29918,
2080,
29879,
29892,
1602,
6119,
29918,
2080,
29879,
29892,
3646,
29918,
705,
5861,
353,
1583,
29889,
4299,
29889,
657,
29918,
16175,
29898,
13,
9651,
426,
21454,
29918,
333,
29901,
17288,
6979,
29918,
4841,
29892,
518,
2314,
29962,
1118,
20968,
29918,
333,
29897,
13,
4706,
396,
3617,
1962,
1480,
1169,
363,
278,
10541,
29889,
13,
4706,
17117,
17117,
1962,
29918,
1188,
1169,
353,
1583,
29889,
4299,
29889,
10568,
29898,
1311,
29889,
7924,
29892,
2094,
6119,
29918,
2080,
29879,
29892,
13,
462,
462,
795,
1602,
6119,
29918,
2080,
29879,
29892,
13,
462,
462,
795,
3646,
29918,
705,
5861,
29892,
20968,
29918,
333,
29892,
5852,
29897,
13,
4706,
396,
910,
338,
263,
1395,
7584,
1602,
6119,
448,
14391,
526,
925,
1852,
3317,
267,
310,
1962,
29918,
1188,
1169,
29889,
13,
4706,
14391,
353,
518,
524,
29898,
9302,
29889,
1191,
3317,
29898,
1188,
277,
29892,
9685,
29922,
29896,
876,
363,
1480,
277,
297,
1962,
29918,
1188,
1169,
29962,
13,
4706,
396,
960,
727,
338,
385,
382,
3267,
5829,
297,
14391,
29892,
5700,
963,
472,
393,
1298,
29889,
13,
4706,
565,
5993,
3950,
29889,
29923,
3267,
29918,
1367,
297,
14391,
29901,
13,
9651,
14391,
353,
14391,
7503,
4905,
29879,
29889,
2248,
29898,
6979,
3950,
29889,
29923,
3267,
29918,
1367,
4638,
13,
13,
4706,
396,
13905,
714,
2933,
10541,
6590,
304,
14391,
29889,
13,
4706,
1234,
353,
376,
11393,
7122,
4197,
1311,
29889,
13478,
29918,
29894,
542,
370,
29961,
4905,
29962,
363,
1962,
297,
14391,
2314,
13,
4706,
565,
5993,
3950,
3032,
3904,
29968,
297,
1234,
29901,
13,
9651,
1234,
353,
4036,
29889,
16957,
29898,
3904,
29968,
29918,
4986,
29968,
1430,
29918,
1525,
7390,
11538,
13780,
29897,
13,
4706,
1234,
353,
17151,
29898,
12011,
29897,
13,
4706,
736,
1234,
13,
13,
1678,
822,
3802,
29898,
1311,
1125,
13,
4706,
1583,
29889,
7924,
29889,
5358,
580,
13,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
286,
353,
678,
271,
7451,
29898,
1660,
29984,
29906,
1660,
29984,
29918,
20387,
29931,
29918,
9464,
718,
8207,
14968,
29914,
1495,
13,
1678,
2933,
353,
286,
29889,
17158,
29918,
12011,
29898,
29884,
29915,
30672,
31043,
30397,
30919,
30413,
31043,
30397,
30672,
31043,
30397,
30919,
30413,
31043,
30397,
30672,
31639,
30210,
30392,
231,
190,
131,
31882,
31474,
31579,
1495,
13,
1678,
1596,
2933,
13,
2
] |
sfymca/feed/urls.py | streeter/sf-ymca-pools | 0 | 95030 | <reponame>streeter/sf-ymca-pools
from django.urls import path
from sfymca.feed import views
urlpatterns = [
path("", views.index, name="index"),
path("<branch_name>.ics", views.branch_calendar, name="branch_calendar"),
path("<branch_name>/", views.branch, name="branch"),
]
| [
1,
529,
276,
1112,
420,
29958,
13045,
1308,
29914,
4668,
29899,
962,
1113,
29899,
1129,
3775,
13,
3166,
9557,
29889,
26045,
1053,
2224,
13,
13,
3166,
18668,
962,
1113,
29889,
18798,
1053,
8386,
13,
13,
2271,
11037,
29879,
353,
518,
13,
1678,
2224,
703,
613,
8386,
29889,
2248,
29892,
1024,
543,
2248,
4968,
13,
1678,
2224,
28945,
17519,
29918,
978,
15513,
1199,
613,
8386,
29889,
17519,
29918,
23392,
29892,
1024,
543,
17519,
29918,
23392,
4968,
13,
1678,
2224,
28945,
17519,
29918,
978,
20690,
613,
8386,
29889,
17519,
29892,
1024,
543,
17519,
4968,
13,
29962,
13,
2
] |
app/__init__.py | HK-Zhang/FlaskAADB2C | 0 | 175366 | <filename>app/__init__.py
from flask import Flask,url_for
from flask_session import Session # https://pythonhosted.org/Flask-Session
from flask_cors import CORS
from config import appinsightKey,apiversion,load_config
from opencensus.ext.azure.trace_exporter import AzureExporter
from opencensus.ext.azure.log_exporter import AzureLogHandler
from opencensus.ext.flask.flask_middleware import FlaskMiddleware
from opencensus.trace.samplers import ProbabilitySampler
import logging
from flasgger import Swagger,swag_from
from os import listdir
from os.path import isfile, join
import socket
import app_config_b2c
# This section is needed for url_for("foo", _external=True) to automatically
# generate http scheme when this sample is running on localhost,
# and to generate https scheme when it is deployed behind reversed proxy.
# See also https://flask.palletsprojects.com/en/1.0.x/deploying/wsgi-standalone/#proxy-setups
from werkzeug.middleware.proxy_fix import ProxyFix
hostname=socket.gethostname()
format_str = f'{apiversion}@{hostname} says:'+'%(asctime)s - %(levelname)-8s - %(message)s'
date_format = '%Y-%m-%d %H:%M:%S'
logging.basicConfig(level=logging.INFO)
formatter = logging.Formatter(format_str, date_format)
rootlogger = logging.getLogger()
app = Flask(__name__)
CORS(app)
app.config.from_object(app_config_b2c)
Session(app)
handler = AzureLogHandler(connection_string=f'InstrumentationKey={appinsightKey}')
handler.setFormatter(formatter)
rootlogger.addHandler(handler)
middleware = FlaskMiddleware(app,exporter=AzureExporter(connection_string=f'InstrumentationKey={appinsightKey}'),sampler=ProbabilitySampler(rate=1.0))
app.wsgi_app = ProxyFix(app.wsgi_app, x_proto=1, x_host=1)
load_config()
Swagger(app)
from app.api import api as api_blueprint
app.register_blueprint(api_blueprint, url_prefix='/v1')
from app.web import web as web_blueprint
app.register_blueprint(web_blueprint)
from app.web.views import _build_auth_url
app.jinja_env.globals.update(
_build_auth_url=_build_auth_url) # Used in template
logging.info(f'App Started {apiversion}.')
| [
1,
529,
9507,
29958,
932,
29914,
1649,
2344,
26914,
2272,
13,
3166,
29784,
1053,
2379,
1278,
29892,
2271,
29918,
1454,
13,
3166,
29784,
29918,
7924,
1053,
16441,
29871,
396,
2045,
597,
4691,
3069,
287,
29889,
990,
29914,
8754,
1278,
29899,
7317,
13,
3166,
29784,
29918,
29883,
943,
1053,
315,
24125,
13,
3166,
2295,
1053,
623,
1144,
523,
2558,
29892,
481,
1536,
291,
29892,
1359,
29918,
2917,
13,
3166,
1722,
29883,
8841,
29889,
1062,
29889,
17688,
29889,
15003,
29918,
735,
18505,
1053,
12634,
1252,
18505,
13,
3166,
1722,
29883,
8841,
29889,
1062,
29889,
17688,
29889,
1188,
29918,
735,
18505,
1053,
12634,
3403,
4598,
13,
3166,
1722,
29883,
8841,
29889,
1062,
29889,
1579,
1278,
29889,
1579,
1278,
29918,
17662,
2519,
1053,
2379,
1278,
25411,
2519,
13,
3166,
1722,
29883,
8841,
29889,
15003,
29889,
13445,
572,
414,
1053,
1019,
29890,
3097,
22966,
20069,
13,
5215,
12183,
13,
3166,
1652,
294,
29887,
914,
1053,
3925,
9921,
29892,
2774,
351,
29918,
3166,
13,
3166,
2897,
1053,
1051,
3972,
13,
3166,
2897,
29889,
2084,
1053,
338,
1445,
29892,
5988,
13,
5215,
9909,
13,
5215,
623,
29918,
2917,
29918,
29890,
29906,
29883,
13,
29937,
910,
4004,
338,
4312,
363,
3142,
29918,
1454,
703,
5431,
613,
903,
23176,
29922,
5574,
29897,
304,
6336,
13,
29937,
5706,
1732,
11380,
746,
445,
4559,
338,
2734,
373,
15683,
29892,
13,
29937,
322,
304,
5706,
2045,
11380,
746,
372,
338,
21168,
5742,
18764,
287,
10166,
29889,
13,
29937,
2823,
884,
2045,
597,
1579,
1278,
29889,
7830,
10376,
16418,
29889,
510,
29914,
264,
29914,
29896,
29889,
29900,
29889,
29916,
29914,
16519,
292,
29914,
5652,
3146,
29899,
1689,
18785,
8484,
14701,
29899,
842,
14340,
13,
3166,
23085,
13289,
29889,
17662,
2519,
29889,
14701,
29918,
5878,
1053,
1019,
3594,
29943,
861,
13,
13,
28988,
29922,
11514,
29889,
29887,
621,
520,
978,
580,
13,
4830,
29918,
710,
353,
285,
29915,
29912,
481,
1536,
291,
29913,
28312,
28988,
29913,
4083,
11283,
23097,
29995,
29898,
294,
312,
603,
29897,
29879,
448,
1273,
29898,
5563,
978,
6817,
29947,
29879,
448,
1273,
29898,
4906,
29897,
29879,
29915,
13,
1256,
29918,
4830,
353,
14210,
29979,
19222,
29885,
19222,
29881,
1273,
29950,
16664,
29924,
16664,
29903,
29915,
13,
21027,
29889,
16121,
3991,
29898,
5563,
29922,
21027,
29889,
11690,
29897,
13,
689,
2620,
353,
12183,
29889,
18522,
29898,
4830,
29918,
710,
29892,
2635,
29918,
4830,
29897,
13,
4632,
21707,
353,
12183,
29889,
657,
16363,
580,
13,
13,
932,
353,
2379,
1278,
22168,
978,
1649,
29897,
13,
29907,
24125,
29898,
932,
29897,
13,
932,
29889,
2917,
29889,
3166,
29918,
3318,
29898,
932,
29918,
2917,
29918,
29890,
29906,
29883,
29897,
13,
7317,
29898,
932,
29897,
13,
13789,
353,
12634,
3403,
4598,
29898,
9965,
29918,
1807,
29922,
29888,
29915,
3379,
15461,
362,
2558,
3790,
932,
1144,
523,
2558,
29913,
1495,
13,
13789,
29889,
842,
18522,
29898,
689,
2620,
29897,
13,
4632,
21707,
29889,
1202,
4598,
29898,
13789,
29897,
13,
17662,
2519,
353,
2379,
1278,
25411,
2519,
29898,
932,
29892,
735,
18505,
29922,
28413,
1252,
18505,
29898,
9965,
29918,
1807,
29922,
29888,
29915,
3379,
15461,
362,
2558,
3790,
932,
1144,
523,
2558,
29913,
5477,
13445,
20069,
29922,
1184,
29890,
3097,
22966,
20069,
29898,
10492,
29922,
29896,
29889,
29900,
876,
268,
13,
13,
932,
29889,
5652,
3146,
29918,
932,
353,
1019,
3594,
29943,
861,
29898,
932,
29889,
5652,
3146,
29918,
932,
29892,
921,
29918,
17529,
29922,
29896,
29892,
921,
29918,
3069,
29922,
29896,
29897,
13,
13,
1359,
29918,
2917,
580,
13,
13,
10840,
9921,
29898,
932,
29897,
268,
13,
3166,
623,
29889,
2754,
1053,
7882,
408,
7882,
29918,
9539,
2158,
13,
932,
29889,
9573,
29918,
9539,
2158,
29898,
2754,
29918,
9539,
2158,
29892,
3142,
29918,
13506,
2433,
29914,
29894,
29896,
1495,
13,
3166,
623,
29889,
2676,
1053,
1856,
408,
1856,
29918,
9539,
2158,
13,
932,
29889,
9573,
29918,
9539,
2158,
29898,
2676,
29918,
9539,
2158,
29897,
13,
3166,
623,
29889,
2676,
29889,
7406,
1053,
903,
4282,
29918,
5150,
29918,
2271,
13,
932,
29889,
28789,
1764,
29918,
6272,
29889,
23705,
1338,
29889,
5504,
29898,
13,
1678,
903,
4282,
29918,
5150,
29918,
2271,
29922,
29918,
4282,
29918,
5150,
29918,
2271,
29897,
29871,
396,
501,
8485,
297,
4472,
13,
13,
21027,
29889,
3888,
29898,
29888,
29915,
2052,
7370,
287,
426,
481,
1536,
291,
1836,
1495,
13,
13,
2
] |
ironic_inspector/cmd/dbsync.py | namnx228/ironic-inspector | 31 | 10566 | <gh_stars>10-100
# Copyright 2015 Cisco Systems
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import os
import sys
from alembic import command as alembic_command
from alembic import config as alembic_config
from alembic import util as alembic_util
from oslo_config import cfg
from oslo_log import log
from ironic_inspector import conf # noqa
CONF = cfg.CONF
def add_alembic_command(subparsers, name):
return subparsers.add_parser(
name, help=getattr(alembic_command, name).__doc__)
def add_command_parsers(subparsers):
for name in ['current', 'history', 'branches', 'heads']:
parser = add_alembic_command(subparsers, name)
parser.set_defaults(func=do_alembic_command)
for name in ['stamp', 'show', 'edit']:
parser = add_alembic_command(subparsers, name)
parser.set_defaults(func=with_revision)
parser.add_argument('--revision', nargs='?', required=True)
parser = add_alembic_command(subparsers, 'upgrade')
parser.set_defaults(func=with_revision)
parser.add_argument('--revision', nargs='?')
parser = add_alembic_command(subparsers, 'revision')
parser.set_defaults(func=do_revision)
parser.add_argument('-m', '--message')
parser.add_argument('--autogenerate', action='store_true')
command_opt = cfg.SubCommandOpt('command',
title='Command',
help='Available commands',
handler=add_command_parsers)
def _get_alembic_config():
base_path = os.path.split(os.path.dirname(__file__))[0]
return alembic_config.Config(os.path.join(base_path, 'alembic.ini'))
def do_revision(config, cmd, *args, **kwargs):
do_alembic_command(config, cmd, message=CONF.command.message,
autogenerate=CONF.command.autogenerate)
def with_revision(config, cmd, *args, **kwargs):
revision = CONF.command.revision or 'head'
do_alembic_command(config, cmd, revision)
def do_alembic_command(config, cmd, *args, **kwargs):
try:
getattr(alembic_command, cmd)(config, *args, **kwargs)
except alembic_util.CommandError as e:
alembic_util.err(str(e))
def main(args=sys.argv[1:]):
log.register_options(CONF)
CONF.register_cli_opt(command_opt)
CONF(args, project='ironic-inspector')
config = _get_alembic_config()
config.set_main_option('script_location', "ironic_inspector:migrations")
config.ironic_inspector_config = CONF
CONF.command.func(config, CONF.command.name)
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29900,
29899,
29896,
29900,
29900,
13,
29937,
14187,
1266,
29871,
29906,
29900,
29896,
29945,
315,
275,
1111,
23985,
13,
29937,
2178,
26863,
2538,
9841,
29889,
13,
29937,
13,
29937,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
366,
1122,
13,
29937,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
887,
1122,
4017,
13,
29937,
263,
3509,
310,
278,
19245,
472,
13,
29937,
13,
29937,
418,
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,
399,
1806,
8187,
2692,
13,
29937,
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,
19245,
363,
278,
2702,
4086,
14765,
1076,
11239,
322,
27028,
13,
29937,
1090,
278,
19245,
29889,
13,
13,
5215,
2897,
13,
5215,
10876,
13,
13,
3166,
20712,
29890,
293,
1053,
1899,
408,
20712,
29890,
293,
29918,
6519,
13,
3166,
20712,
29890,
293,
1053,
2295,
408,
20712,
29890,
293,
29918,
2917,
13,
3166,
20712,
29890,
293,
1053,
3667,
408,
20712,
29890,
293,
29918,
4422,
13,
3166,
2897,
417,
29918,
2917,
1053,
274,
16434,
13,
3166,
2897,
417,
29918,
1188,
1053,
1480,
13,
13,
3166,
3805,
8927,
29918,
1144,
1103,
272,
1053,
1970,
29871,
396,
694,
25621,
13,
13,
6007,
29943,
353,
274,
16434,
29889,
6007,
29943,
13,
13,
13,
1753,
788,
29918,
744,
8337,
293,
29918,
6519,
29898,
1491,
862,
4253,
29892,
1024,
1125,
13,
1678,
736,
1014,
862,
4253,
29889,
1202,
29918,
16680,
29898,
13,
4706,
1024,
29892,
1371,
29922,
657,
5552,
29898,
744,
8337,
293,
29918,
6519,
29892,
1024,
467,
1649,
1514,
1649,
29897,
13,
13,
13,
1753,
788,
29918,
6519,
29918,
862,
4253,
29898,
1491,
862,
4253,
1125,
13,
1678,
363,
1024,
297,
6024,
3784,
742,
525,
18434,
742,
525,
17519,
267,
742,
525,
2813,
29879,
2033,
29901,
13,
4706,
13812,
353,
788,
29918,
744,
8337,
293,
29918,
6519,
29898,
1491,
862,
4253,
29892,
1024,
29897,
13,
4706,
13812,
29889,
842,
29918,
4381,
29879,
29898,
9891,
29922,
1867,
29918,
744,
8337,
293,
29918,
6519,
29897,
13,
13,
1678,
363,
1024,
297,
6024,
303,
1160,
742,
525,
4294,
742,
525,
5628,
2033,
29901,
13,
4706,
13812,
353,
788,
29918,
744,
8337,
293,
29918,
6519,
29898,
1491,
862,
4253,
29892,
1024,
29897,
13,
4706,
13812,
29889,
842,
29918,
4381,
29879,
29898,
9891,
29922,
2541,
29918,
276,
4924,
29897,
13,
4706,
13812,
29889,
1202,
29918,
23516,
877,
489,
276,
4924,
742,
302,
5085,
2433,
29973,
742,
3734,
29922,
5574,
29897,
13,
13,
1678,
13812,
353,
788,
29918,
744,
8337,
293,
29918,
6519,
29898,
1491,
862,
4253,
29892,
525,
786,
8228,
1495,
13,
1678,
13812,
29889,
842,
29918,
4381,
29879,
29898,
9891,
29922,
2541,
29918,
276,
4924,
29897,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
276,
4924,
742,
302,
5085,
2433,
29973,
1495,
13,
13,
1678,
13812,
353,
788,
29918,
744,
8337,
293,
29918,
6519,
29898,
1491,
862,
4253,
29892,
525,
276,
4924,
1495,
13,
1678,
13812,
29889,
842,
29918,
4381,
29879,
29898,
9891,
29922,
1867,
29918,
276,
4924,
29897,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
29899,
29885,
742,
525,
489,
4906,
1495,
13,
1678,
13812,
29889,
1202,
29918,
23516,
877,
489,
1300,
468,
759,
403,
742,
3158,
2433,
8899,
29918,
3009,
1495,
13,
13,
13,
6519,
29918,
3670,
353,
274,
16434,
29889,
4035,
6255,
20624,
877,
6519,
742,
13,
462,
18884,
3611,
2433,
6255,
742,
13,
462,
18884,
1371,
2433,
27635,
8260,
742,
13,
462,
18884,
7834,
29922,
1202,
29918,
6519,
29918,
862,
4253,
29897,
13,
13,
13,
1753,
903,
657,
29918,
744,
8337,
293,
29918,
2917,
7295,
13,
1678,
2967,
29918,
2084,
353,
2897,
29889,
2084,
29889,
5451,
29898,
359,
29889,
2084,
29889,
25721,
22168,
1445,
1649,
876,
29961,
29900,
29962,
13,
1678,
736,
20712,
29890,
293,
29918,
2917,
29889,
3991,
29898,
359,
29889,
2084,
29889,
7122,
29898,
3188,
29918,
2084,
29892,
525,
744,
8337,
293,
29889,
2172,
8785,
13,
13,
13,
1753,
437,
29918,
276,
4924,
29898,
2917,
29892,
9920,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
1678,
437,
29918,
744,
8337,
293,
29918,
6519,
29898,
2917,
29892,
9920,
29892,
2643,
29922,
6007,
29943,
29889,
6519,
29889,
4906,
29892,
13,
462,
539,
1120,
468,
759,
403,
29922,
6007,
29943,
29889,
6519,
29889,
1300,
468,
759,
403,
29897,
13,
13,
13,
1753,
411,
29918,
276,
4924,
29898,
2917,
29892,
9920,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
1678,
26554,
353,
8707,
29943,
29889,
6519,
29889,
276,
4924,
470,
525,
2813,
29915,
13,
1678,
437,
29918,
744,
8337,
293,
29918,
6519,
29898,
2917,
29892,
9920,
29892,
26554,
29897,
13,
13,
13,
1753,
437,
29918,
744,
8337,
293,
29918,
6519,
29898,
2917,
29892,
9920,
29892,
334,
5085,
29892,
3579,
19290,
1125,
13,
1678,
1018,
29901,
13,
4706,
679,
5552,
29898,
744,
8337,
293,
29918,
6519,
29892,
9920,
5033,
2917,
29892,
334,
5085,
29892,
3579,
19290,
29897,
13,
1678,
5174,
20712,
29890,
293,
29918,
4422,
29889,
6255,
2392,
408,
321,
29901,
13,
4706,
20712,
29890,
293,
29918,
4422,
29889,
3127,
29898,
710,
29898,
29872,
876,
13,
13,
13,
1753,
1667,
29898,
5085,
29922,
9675,
29889,
19218,
29961,
29896,
17531,
1125,
13,
1678,
1480,
29889,
9573,
29918,
6768,
29898,
6007,
29943,
29897,
13,
1678,
8707,
29943,
29889,
9573,
29918,
11303,
29918,
3670,
29898,
6519,
29918,
3670,
29897,
13,
1678,
8707,
29943,
29898,
5085,
29892,
2060,
2433,
381,
8927,
29899,
1144,
1103,
272,
1495,
13,
1678,
2295,
353,
903,
657,
29918,
744,
8337,
293,
29918,
2917,
580,
13,
1678,
2295,
29889,
842,
29918,
3396,
29918,
3385,
877,
2154,
29918,
5479,
742,
376,
381,
8927,
29918,
1144,
1103,
272,
29901,
26983,
800,
1159,
13,
1678,
2295,
29889,
381,
8927,
29918,
1144,
1103,
272,
29918,
2917,
353,
8707,
29943,
13,
13,
1678,
8707,
29943,
29889,
6519,
29889,
9891,
29898,
2917,
29892,
8707,
29943,
29889,
6519,
29889,
978,
29897,
13,
2
] |
test/LHS_test.py | misantam/GAparsimony | 0 | 125895 | # -*- coding: utf-8 -*-
from GAparsimony.lhs.util import isValidLHS, isValidLHS_int
from GAparsimony.lhs import geneticLHS, improvedLHS, maximinLHS, optimumLHS, randomLHS, randomLHS_int
import pytest
@pytest.mark.parametrize("shape", [
(2, 2),
(6, 6),
(3, 8)
])
def test_randomLHS_int(shape):
assert isValidLHS_int(randomLHS_int(*shape))
@pytest.mark.parametrize("shape", [
(2, 2),
(6, 6),
(3, 8)
])
def test_randomLHS(shape):
assert isValidLHS(randomLHS(*shape))
@pytest.mark.parametrize("shape", [
(2, 2),
(6, 6),
(3, 8)
])
def test_geneticLHS(shape):
assert isValidLHS(geneticLHS(*shape))
@pytest.mark.parametrize("shape", [
(2, 2),
(6, 6),
(3, 8)
])
def test_improvedLHS(shape):
assert isValidLHS(improvedLHS(*shape))
@pytest.mark.parametrize("shape", [
(2, 2),
(6, 6),
(3, 8)
])
def test_maximinLHS(shape):
assert isValidLHS(maximinLHS(*shape))
@pytest.mark.parametrize("shape", [
(2, 2),
(6, 6),
(8, 8)
])
def test_optimumLHS(shape):
assert isValidLHS(optimumLHS(*shape)) | [
1,
396,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
13,
3166,
402,
29909,
862,
3601,
2592,
29889,
29880,
9499,
29889,
4422,
1053,
338,
7211,
29931,
14851,
29892,
338,
7211,
29931,
14851,
29918,
524,
13,
3166,
402,
29909,
862,
3601,
2592,
29889,
29880,
9499,
1053,
2531,
7492,
29931,
14851,
29892,
16710,
29931,
14851,
29892,
5256,
262,
29931,
14851,
29892,
5994,
398,
29931,
14851,
29892,
4036,
29931,
14851,
29892,
4036,
29931,
14851,
29918,
524,
13,
13,
5215,
11451,
1688,
13,
13,
29992,
2272,
1688,
29889,
3502,
29889,
3207,
300,
374,
911,
703,
12181,
613,
518,
13,
1678,
313,
29906,
29892,
29871,
29906,
511,
13,
1678,
313,
29953,
29892,
29871,
29953,
511,
13,
1678,
313,
29941,
29892,
29871,
29947,
29897,
13,
2314,
13,
1753,
1243,
29918,
8172,
29931,
14851,
29918,
524,
29898,
12181,
1125,
13,
1678,
4974,
338,
7211,
29931,
14851,
29918,
524,
29898,
8172,
29931,
14851,
29918,
524,
10456,
12181,
876,
13,
13,
29992,
2272,
1688,
29889,
3502,
29889,
3207,
300,
374,
911,
703,
12181,
613,
518,
13,
1678,
313,
29906,
29892,
29871,
29906,
511,
13,
1678,
313,
29953,
29892,
29871,
29953,
511,
13,
1678,
313,
29941,
29892,
29871,
29947,
29897,
13,
2314,
13,
1753,
1243,
29918,
8172,
29931,
14851,
29898,
12181,
1125,
13,
1678,
4974,
338,
7211,
29931,
14851,
29898,
8172,
29931,
14851,
10456,
12181,
876,
13,
13,
29992,
2272,
1688,
29889,
3502,
29889,
3207,
300,
374,
911,
703,
12181,
613,
518,
13,
1678,
313,
29906,
29892,
29871,
29906,
511,
13,
1678,
313,
29953,
29892,
29871,
29953,
511,
13,
1678,
313,
29941,
29892,
29871,
29947,
29897,
13,
2314,
13,
1753,
1243,
29918,
1885,
7492,
29931,
14851,
29898,
12181,
1125,
13,
1678,
4974,
338,
7211,
29931,
14851,
29898,
1885,
7492,
29931,
14851,
10456,
12181,
876,
13,
13,
29992,
2272,
1688,
29889,
3502,
29889,
3207,
300,
374,
911,
703,
12181,
613,
518,
13,
1678,
313,
29906,
29892,
29871,
29906,
511,
13,
1678,
313,
29953,
29892,
29871,
29953,
511,
13,
1678,
313,
29941,
29892,
29871,
29947,
29897,
13,
2314,
13,
1753,
1243,
29918,
326,
771,
1490,
29931,
14851,
29898,
12181,
1125,
13,
1678,
4974,
338,
7211,
29931,
14851,
29898,
326,
771,
1490,
29931,
14851,
10456,
12181,
876,
13,
13,
29992,
2272,
1688,
29889,
3502,
29889,
3207,
300,
374,
911,
703,
12181,
613,
518,
13,
1678,
313,
29906,
29892,
29871,
29906,
511,
13,
1678,
313,
29953,
29892,
29871,
29953,
511,
13,
1678,
313,
29941,
29892,
29871,
29947,
29897,
13,
2314,
13,
1753,
1243,
29918,
27525,
262,
29931,
14851,
29898,
12181,
1125,
13,
1678,
4974,
338,
7211,
29931,
14851,
29898,
27525,
262,
29931,
14851,
10456,
12181,
876,
13,
13,
29992,
2272,
1688,
29889,
3502,
29889,
3207,
300,
374,
911,
703,
12181,
613,
518,
13,
1678,
313,
29906,
29892,
29871,
29906,
511,
13,
1678,
313,
29953,
29892,
29871,
29953,
511,
13,
1678,
313,
29947,
29892,
29871,
29947,
29897,
13,
2314,
13,
1753,
1243,
29918,
3670,
12539,
29931,
14851,
29898,
12181,
1125,
13,
1678,
4974,
338,
7211,
29931,
14851,
29898,
3670,
12539,
29931,
14851,
10456,
12181,
876,
2
] |
model_analyzer/config/run/run_search.py | MarkMoTrin/model_analyzer | 115 | 68183 | # Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from model_analyzer.config.input.objects.config_model_profile_spec \
import ConfigModelProfileSpec
from model_analyzer.constants import LOGGER_NAME, THROUGHPUT_GAIN
import copy
import logging
logger = logging.getLogger(LOGGER_NAME)
class RunSearch:
"""
A class responsible for searching the config space.
"""
def __init__(self, config):
self._max_concurrency = config.run_config_search_max_concurrency
self._max_instance_count = config.run_config_search_max_instance_count
self._max_preferred_batch_size = config.run_config_search_max_preferred_batch_size
self._sweep_preferred_batch_size_disable = config.run_config_search_preferred_batch_size_disable
self._model_config_parameters = {'instance_count': 1}
self._measurements = []
self._last_batch_length = None
# Run search operating mode
self._sweep_mode_function = None
def _create_model_config(self, cpu_only=False):
"""
Generate the model config sweep to be used.
"""
model_config = self._model_config_parameters
new_config = {}
if 'dynamic_batching' in model_config:
if model_config['dynamic_batching'] is None:
new_config['dynamic_batching'] = {}
else:
new_config['dynamic_batching'] = {
'preferred_batch_size': [model_config['dynamic_batching']]
}
if 'instance_count' in model_config:
if not cpu_only:
new_config['instance_group'] = [{
'count': model_config['instance_count'],
'kind': 'KIND_GPU'
}]
else:
new_config['instance_group'] = [{
'count': model_config['instance_count'],
'kind': 'KIND_CPU'
}]
return new_config
def add_measurements(self, measurements):
"""
Add the measurments that are the result of running
the sweeps.
Parameters
----------
measurements : list
list of measurements
"""
self._last_batch_length = len(measurements)
# The list will contain one parameter, because we are experimenting
# with one value at a time.
self._measurements += measurements
def _step_instance_count(self):
"""
Advances instance count by one step.
"""
self._model_config_parameters['instance_count'] += 1
def _step_dynamic_batching(self):
"""
Advances the dynamic batching by one step.
"""
if 'dynamic_batching' not in self._model_config_parameters:
# Enable dynamic batching
self._model_config_parameters['dynamic_batching'] = None
else:
if self._model_config_parameters['dynamic_batching'] is None:
self._model_config_parameters['dynamic_batching'] = 1
else:
self._model_config_parameters['dynamic_batching'] *= 2
def _get_throughput(self, measurement):
return measurement.get_metric_value('perf_throughput')
def _calculate_throughput_gain(self, index):
throughput_before = self._get_throughput(
self._measurements[-(index + 1)])
throughput_after = self._get_throughput(self._measurements[-index])
gain = (throughput_after - throughput_before) / throughput_before
return gain
def _valid_throughput_gain(self):
"""
Returns true if the amount of throughput gained
is reasonable for continuing the search process
"""
# If number of measurements is smaller than 4,
# the search can continue.
if len(self._measurements) < 4:
return True
return self._calculate_throughput_gain(1) > THROUGHPUT_GAIN or \
self._calculate_throughput_gain(2) > THROUGHPUT_GAIN or \
self._calculate_throughput_gain(3) > THROUGHPUT_GAIN
def init_model_sweep(self, concurrency, search_model_config_parameters):
"""
Intiliazes the sweep mode, and model config parameters in some cases.
"""
# Reset the measurements after each init
self._measurements = []
if len(concurrency) != 0 and search_model_config_parameters:
self._model_config_parameters = {'instance_count': 0}
self._sweep_mode_function = self._sweep_model_config_only
elif len(concurrency) == 0 and search_model_config_parameters:
self._model_config_parameters = {'instance_count': 1}
logger.info(
'Will sweep both the concurrency and model config parameters...'
)
self._sweep_mode_function = self._sweep_concurrency_and_model_config
else:
logger.info('Will sweep only through the concurrency values...')
self._sweep_mode_function = self._sweep_concurrency_only
def get_model_sweep(self, config_model):
"""
Get the next iteration of the sweeps.
Parameters
----------
config_model : ConfigModelProfileSpec
The config model object of the model to sweep through
Returns
-------
config_model, list
The list may be empty, contain a model config dict or None
"""
new_model = ConfigModelProfileSpec(
copy.deepcopy(config_model.model_name()),
copy.deepcopy(config_model.cpu_only()),
copy.deepcopy(config_model.objectives()),
copy.deepcopy(config_model.constraints()),
copy.deepcopy(config_model.parameters()),
copy.deepcopy(config_model.model_config_parameters()),
copy.deepcopy(config_model.perf_analyzer_flags()))
if self._sweep_mode_function:
new_model, model_sweep = self._sweep_mode_function(new_model)
# Only log message if there is new runs.
if model_sweep:
self._log_message(new_model)
return new_model, model_sweep
return new_model, []
def _sweep_concurrency_and_model_config(self, model):
"""
Gets next iteration of both the concurrency and model config
parameters
Parameters
----------
model : ConfigModelProfileSpec
The model whose parameters are being swept over
"""
return self._sweep_parameters(model, sweep_model_configs=True)
def _sweep_concurrency_only(self, model):
"""
Gets next iteration of the concurrency sweep
"""
return self._sweep_parameters(model, sweep_model_configs=False)
def _sweep_parameters(self, model, sweep_model_configs):
"""
A helper function that sweeps over concurrency
and if required, over model configs as well
"""
concurrency = model.parameters()['concurrency']
if len(concurrency) == 0:
model.parameters()['concurrency'] = [1]
else:
# Exponentially increase concurrency
new_concurrency = concurrency[0] * 2
# If the concurrency limit has been reached, the last batch lead to
# an error, or the throughput gain is not significant, step
# the concurrency value. TODO: add exponential backoff so
# that the algorithm can step back and exactly find the points.
concurrency_limit_reached = new_concurrency > self._max_concurrency
last_batch_erroneous = self._last_batch_length == 0
throughput_peaked = not self._valid_throughput_gain()
if concurrency_limit_reached or last_batch_erroneous or throughput_peaked:
# Reset concurrency
if sweep_model_configs:
self._measurements = []
model.parameters()['concurrency'] = [1]
return self._sweep_model_config_only(model)
else:
return model, []
model.parameters()['concurrency'] = [new_concurrency]
return model, [
self._create_model_config(
cpu_only=model.cpu_only()) if sweep_model_configs else None
]
def _sweep_model_config_only(self, model):
"""
Gets next iteration model config
parameters sweep
"""
self._step_instance_count()
instance_limit_reached = self._model_config_parameters[
'instance_count'] > self._max_instance_count
if instance_limit_reached:
if self._sweep_preferred_batch_size_disable:
return model, []
# Reset instance_count
self._model_config_parameters['instance_count'] = 1
self._step_dynamic_batching()
dynamic_batching_enabled = self._model_config_parameters[
'dynamic_batching'] is not None
if dynamic_batching_enabled:
batch_size_limit_reached = self._model_config_parameters[
'dynamic_batching'] > self._max_preferred_batch_size
if batch_size_limit_reached:
return model, []
return model, [self._create_model_config(cpu_only=model.cpu_only())]
def _log_message(self, model):
"""
Writes the current state of the search to the console
"""
concurrency = model.parameters()['concurrency'][0]
message = 'dynamic batching is disabled.'
if 'dynamic_batching' in self._model_config_parameters:
if self._model_config_parameters['dynamic_batching'] is None:
message = 'dynamic batching is enabled.'
else:
message = (
"preferred batch size is set to "
f"{self._model_config_parameters['dynamic_batching']}.")
if self._sweep_mode_function == self._sweep_concurrency_only:
logger.info(f"[Search Step] Concurrency set to {concurrency}. ")
elif self._sweep_mode_function == self._sweep_concurrency_and_model_config:
logger.info(
f"[Search Step] Concurrency set to {concurrency}. "
f"Instance count set to "
f"{self._model_config_parameters['instance_count']}, and {message}"
)
elif self._sweep_mode_function == self._sweep_model_config_only:
logger.info(
f"[Search Step] Instance count set to "
f"{self._model_config_parameters['instance_count']}, and {message}"
)
| [
1,
396,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29906,
29896,
405,
13044,
10764,
315,
1955,
29925,
1955,
8098,
669,
23844,
3738,
5265,
1299,
2890,
29889,
2178,
10462,
21676,
29889,
13,
29937,
13,
29937,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
13,
29937,
366,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
13,
29937,
887,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
13,
29937,
13,
29937,
268,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
29937,
13,
29937,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
7047,
13,
29937,
13235,
1090,
278,
19245,
338,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
13,
29937,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29059,
6323,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
13,
29937,
2823,
278,
19245,
363,
278,
2702,
4086,
14765,
1076,
11239,
322,
13,
29937,
27028,
1090,
278,
19245,
29889,
13,
13,
3166,
1904,
29918,
24209,
3298,
29889,
2917,
29889,
2080,
29889,
12650,
29889,
2917,
29918,
4299,
29918,
10185,
29918,
6550,
320,
13,
1678,
1053,
12782,
3195,
13909,
10299,
13,
3166,
1904,
29918,
24209,
3298,
29889,
3075,
1934,
1053,
25401,
17070,
29918,
5813,
29892,
3446,
1672,
23338,
3954,
2692,
29918,
12739,
1177,
13,
13,
5215,
3509,
13,
5215,
12183,
13,
13,
21707,
353,
12183,
29889,
657,
16363,
29898,
14480,
17070,
29918,
5813,
29897,
13,
13,
13,
1990,
7525,
7974,
29901,
13,
1678,
9995,
13,
1678,
319,
770,
14040,
363,
11975,
278,
2295,
2913,
29889,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
2295,
1125,
13,
4706,
1583,
3032,
3317,
29918,
535,
26095,
353,
2295,
29889,
3389,
29918,
2917,
29918,
4478,
29918,
3317,
29918,
535,
26095,
13,
4706,
1583,
3032,
3317,
29918,
8758,
29918,
2798,
353,
2295,
29889,
3389,
29918,
2917,
29918,
4478,
29918,
3317,
29918,
8758,
29918,
2798,
13,
4706,
1583,
3032,
3317,
29918,
1457,
14373,
29918,
16175,
29918,
2311,
353,
2295,
29889,
3389,
29918,
2917,
29918,
4478,
29918,
3317,
29918,
1457,
14373,
29918,
16175,
29918,
2311,
13,
4706,
1583,
3032,
29879,
705,
1022,
29918,
1457,
14373,
29918,
16175,
29918,
2311,
29918,
20472,
353,
2295,
29889,
3389,
29918,
2917,
29918,
4478,
29918,
1457,
14373,
29918,
16175,
29918,
2311,
29918,
20472,
13,
4706,
1583,
3032,
4299,
29918,
2917,
29918,
16744,
353,
11117,
8758,
29918,
2798,
2396,
29871,
29896,
29913,
13,
4706,
1583,
3032,
26658,
1860,
353,
5159,
13,
4706,
1583,
3032,
4230,
29918,
16175,
29918,
2848,
353,
6213,
13,
13,
4706,
396,
7525,
2740,
13598,
4464,
13,
4706,
1583,
3032,
29879,
705,
1022,
29918,
8513,
29918,
2220,
353,
6213,
13,
13,
1678,
822,
903,
3258,
29918,
4299,
29918,
2917,
29898,
1311,
29892,
26403,
29918,
6194,
29922,
8824,
1125,
13,
4706,
9995,
13,
4706,
3251,
403,
278,
1904,
2295,
7901,
1022,
304,
367,
1304,
29889,
13,
4706,
9995,
13,
13,
4706,
1904,
29918,
2917,
353,
1583,
3032,
4299,
29918,
2917,
29918,
16744,
13,
13,
4706,
716,
29918,
2917,
353,
6571,
13,
4706,
565,
525,
16626,
29918,
16175,
292,
29915,
297,
1904,
29918,
2917,
29901,
13,
9651,
565,
1904,
29918,
2917,
1839,
16626,
29918,
16175,
292,
2033,
338,
6213,
29901,
13,
18884,
716,
29918,
2917,
1839,
16626,
29918,
16175,
292,
2033,
353,
6571,
13,
9651,
1683,
29901,
13,
18884,
716,
29918,
2917,
1839,
16626,
29918,
16175,
292,
2033,
353,
426,
13,
462,
1678,
525,
1457,
14373,
29918,
16175,
29918,
2311,
2396,
518,
4299,
29918,
2917,
1839,
16626,
29918,
16175,
292,
2033,
29962,
13,
18884,
500,
13,
13,
4706,
565,
525,
8758,
29918,
2798,
29915,
297,
1904,
29918,
2917,
29901,
13,
9651,
565,
451,
26403,
29918,
6194,
29901,
13,
18884,
716,
29918,
2917,
1839,
8758,
29918,
2972,
2033,
353,
15974,
13,
462,
1678,
525,
2798,
2396,
1904,
29918,
2917,
1839,
8758,
29918,
2798,
7464,
13,
462,
1678,
525,
14380,
2396,
525,
29968,
22255,
29918,
29954,
7056,
29915,
13,
18884,
500,
29962,
13,
9651,
1683,
29901,
13,
18884,
716,
29918,
2917,
1839,
8758,
29918,
2972,
2033,
353,
15974,
13,
462,
1678,
525,
2798,
2396,
1904,
29918,
2917,
1839,
8758,
29918,
2798,
7464,
13,
462,
1678,
525,
14380,
2396,
525,
29968,
22255,
29918,
6271,
29965,
29915,
13,
18884,
500,
29962,
13,
4706,
736,
716,
29918,
2917,
13,
13,
1678,
822,
788,
29918,
26658,
1860,
29898,
1311,
29892,
20398,
1125,
13,
4706,
9995,
13,
4706,
3462,
278,
7540,
332,
1860,
393,
526,
278,
1121,
310,
2734,
13,
4706,
278,
7901,
8961,
29889,
13,
13,
4706,
12662,
2699,
13,
4706,
448,
1378,
29899,
13,
4706,
20398,
584,
1051,
13,
9651,
1051,
310,
20398,
13,
4706,
9995,
13,
13,
4706,
1583,
3032,
4230,
29918,
16175,
29918,
2848,
353,
7431,
29898,
26658,
1860,
29897,
13,
13,
4706,
396,
450,
1051,
674,
1712,
697,
3443,
29892,
1363,
591,
526,
7639,
292,
13,
4706,
396,
411,
697,
995,
472,
263,
931,
29889,
13,
4706,
1583,
3032,
26658,
1860,
4619,
20398,
13,
13,
1678,
822,
903,
10568,
29918,
8758,
29918,
2798,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
25215,
2925,
2777,
2302,
491,
697,
4331,
29889,
13,
4706,
9995,
13,
13,
4706,
1583,
3032,
4299,
29918,
2917,
29918,
16744,
1839,
8758,
29918,
2798,
2033,
4619,
29871,
29896,
13,
13,
1678,
822,
903,
10568,
29918,
16626,
29918,
16175,
292,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
25215,
2925,
278,
7343,
9853,
292,
491,
697,
4331,
29889,
13,
4706,
9995,
13,
13,
4706,
565,
525,
16626,
29918,
16175,
292,
29915,
451,
297,
1583,
3032,
4299,
29918,
2917,
29918,
16744,
29901,
13,
9651,
396,
1174,
519,
7343,
9853,
292,
13,
9651,
1583,
3032,
4299,
29918,
2917,
29918,
16744,
1839,
16626,
29918,
16175,
292,
2033,
353,
6213,
13,
4706,
1683,
29901,
13,
9651,
565,
1583,
3032,
4299,
29918,
2917,
29918,
16744,
1839,
16626,
29918,
16175,
292,
2033,
338,
6213,
29901,
13,
18884,
1583,
3032,
4299,
29918,
2917,
29918,
16744,
1839,
16626,
29918,
16175,
292,
2033,
353,
29871,
29896,
13,
9651,
1683,
29901,
13,
18884,
1583,
3032,
4299,
29918,
2917,
29918,
16744,
1839,
16626,
29918,
16175,
292,
2033,
334,
29922,
29871,
29906,
13,
13,
1678,
822,
903,
657,
29918,
20678,
649,
29898,
1311,
29892,
20039,
1125,
13,
4706,
736,
20039,
29889,
657,
29918,
16414,
29918,
1767,
877,
546,
29888,
29918,
20678,
649,
1495,
13,
13,
1678,
822,
903,
15807,
403,
29918,
20678,
649,
29918,
29887,
475,
29898,
1311,
29892,
2380,
1125,
13,
4706,
1549,
649,
29918,
11083,
353,
1583,
3032,
657,
29918,
20678,
649,
29898,
13,
9651,
1583,
3032,
26658,
1860,
14352,
29898,
2248,
718,
29871,
29896,
29897,
2314,
13,
4706,
1549,
649,
29918,
7045,
353,
1583,
3032,
657,
29918,
20678,
649,
29898,
1311,
3032,
26658,
1860,
14352,
2248,
2314,
13,
4706,
11581,
353,
313,
20678,
649,
29918,
7045,
448,
1549,
649,
29918,
11083,
29897,
847,
1549,
649,
29918,
11083,
13,
4706,
736,
11581,
13,
13,
1678,
822,
903,
3084,
29918,
20678,
649,
29918,
29887,
475,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
16969,
1565,
565,
278,
5253,
310,
1549,
649,
17515,
13,
4706,
338,
15590,
363,
3133,
292,
278,
2740,
1889,
13,
4706,
9995,
13,
13,
4706,
396,
960,
1353,
310,
20398,
338,
7968,
1135,
29871,
29946,
29892,
13,
4706,
396,
278,
2740,
508,
6773,
29889,
13,
4706,
565,
7431,
29898,
1311,
3032,
26658,
1860,
29897,
529,
29871,
29946,
29901,
13,
9651,
736,
5852,
13,
13,
4706,
736,
1583,
3032,
15807,
403,
29918,
20678,
649,
29918,
29887,
475,
29898,
29896,
29897,
1405,
3446,
1672,
23338,
3954,
2692,
29918,
12739,
1177,
470,
320,
13,
9651,
1583,
3032,
15807,
403,
29918,
20678,
649,
29918,
29887,
475,
29898,
29906,
29897,
1405,
3446,
1672,
23338,
3954,
2692,
29918,
12739,
1177,
470,
320,
13,
9651,
1583,
3032,
15807,
403,
29918,
20678,
649,
29918,
29887,
475,
29898,
29941,
29897,
1405,
3446,
1672,
23338,
3954,
2692,
29918,
12739,
1177,
13,
13,
1678,
822,
2069,
29918,
4299,
29918,
29879,
705,
1022,
29898,
1311,
29892,
3022,
10880,
29892,
2740,
29918,
4299,
29918,
2917,
29918,
16744,
1125,
13,
4706,
9995,
13,
4706,
512,
1376,
423,
10947,
278,
7901,
1022,
4464,
29892,
322,
1904,
2295,
4128,
297,
777,
4251,
29889,
13,
4706,
9995,
13,
13,
4706,
396,
2538,
300,
278,
20398,
1156,
1269,
2069,
13,
4706,
1583,
3032,
26658,
1860,
353,
5159,
13,
4706,
565,
7431,
29898,
535,
26095,
29897,
2804,
29871,
29900,
322,
2740,
29918,
4299,
29918,
2917,
29918,
16744,
29901,
13,
9651,
1583,
3032,
4299,
29918,
2917,
29918,
16744,
353,
11117,
8758,
29918,
2798,
2396,
29871,
29900,
29913,
13,
9651,
1583,
3032,
29879,
705,
1022,
29918,
8513,
29918,
2220,
353,
1583,
3032,
29879,
705,
1022,
29918,
4299,
29918,
2917,
29918,
6194,
13,
4706,
25342,
7431,
29898,
535,
26095,
29897,
1275,
29871,
29900,
322,
2740,
29918,
4299,
29918,
2917,
29918,
16744,
29901,
13,
9651,
1583,
3032,
4299,
29918,
2917,
29918,
16744,
353,
11117,
8758,
29918,
2798,
2396,
29871,
29896,
29913,
13,
9651,
17927,
29889,
3888,
29898,
13,
18884,
525,
12984,
7901,
1022,
1716,
278,
3022,
10880,
322,
1904,
2295,
4128,
856,
29915,
13,
9651,
1723,
13,
9651,
1583,
3032,
29879,
705,
1022,
29918,
8513,
29918,
2220,
353,
1583,
3032,
29879,
705,
1022,
29918,
535,
26095,
29918,
392,
29918,
4299,
29918,
2917,
13,
4706,
1683,
29901,
13,
9651,
17927,
29889,
3888,
877,
12984,
7901,
1022,
871,
1549,
278,
3022,
10880,
1819,
856,
1495,
13,
9651,
1583,
3032,
29879,
705,
1022,
29918,
8513,
29918,
2220,
353,
1583,
3032,
29879,
705,
1022,
29918,
535,
26095,
29918,
6194,
13,
13,
1678,
822,
679,
29918,
4299,
29918,
29879,
705,
1022,
29898,
1311,
29892,
2295,
29918,
4299,
1125,
13,
4706,
9995,
13,
4706,
3617,
278,
2446,
12541,
310,
278,
7901,
8961,
29889,
13,
13,
4706,
12662,
2699,
13,
4706,
448,
1378,
29899,
13,
4706,
2295,
29918,
4299,
584,
12782,
3195,
13909,
10299,
13,
9651,
450,
2295,
1904,
1203,
310,
278,
1904,
304,
7901,
1022,
1549,
13,
13,
4706,
16969,
13,
4706,
448,
22158,
13,
4706,
2295,
29918,
4299,
29892,
1051,
13,
9651,
450,
1051,
1122,
367,
4069,
29892,
1712,
263,
1904,
2295,
9657,
470,
6213,
13,
4706,
9995,
13,
13,
4706,
716,
29918,
4299,
353,
12782,
3195,
13909,
10299,
29898,
13,
9651,
3509,
29889,
24535,
8552,
29898,
2917,
29918,
4299,
29889,
4299,
29918,
978,
25739,
13,
9651,
3509,
29889,
24535,
8552,
29898,
2917,
29918,
4299,
29889,
21970,
29918,
6194,
25739,
13,
9651,
3509,
29889,
24535,
8552,
29898,
2917,
29918,
4299,
29889,
3318,
3145,
25739,
13,
9651,
3509,
29889,
24535,
8552,
29898,
2917,
29918,
4299,
29889,
13646,
29879,
25739,
13,
9651,
3509,
29889,
24535,
8552,
29898,
2917,
29918,
4299,
29889,
16744,
25739,
13,
9651,
3509,
29889,
24535,
8552,
29898,
2917,
29918,
4299,
29889,
4299,
29918,
2917,
29918,
16744,
25739,
13,
9651,
3509,
29889,
24535,
8552,
29898,
2917,
29918,
4299,
29889,
546,
29888,
29918,
24209,
3298,
29918,
15764,
22130,
13,
13,
4706,
565,
1583,
3032,
29879,
705,
1022,
29918,
8513,
29918,
2220,
29901,
13,
9651,
716,
29918,
4299,
29892,
1904,
29918,
29879,
705,
1022,
353,
1583,
3032,
29879,
705,
1022,
29918,
8513,
29918,
2220,
29898,
1482,
29918,
4299,
29897,
13,
13,
9651,
396,
9333,
1480,
2643,
565,
727,
338,
716,
6057,
29889,
13,
9651,
565,
1904,
29918,
29879,
705,
1022,
29901,
13,
18884,
1583,
3032,
1188,
29918,
4906,
29898,
1482,
29918,
4299,
29897,
13,
9651,
736,
716,
29918,
4299,
29892,
1904,
29918,
29879,
705,
1022,
13,
4706,
736,
716,
29918,
4299,
29892,
5159,
13,
13,
1678,
822,
903,
29879,
705,
1022,
29918,
535,
26095,
29918,
392,
29918,
4299,
29918,
2917,
29898,
1311,
29892,
1904,
1125,
13,
4706,
9995,
13,
4706,
402,
1691,
2446,
12541,
310,
1716,
278,
3022,
10880,
322,
1904,
2295,
13,
4706,
4128,
13,
13,
4706,
12662,
2699,
13,
4706,
448,
1378,
29899,
13,
4706,
1904,
584,
12782,
3195,
13909,
10299,
13,
9651,
450,
1904,
5069,
4128,
526,
1641,
7901,
415,
975,
13,
4706,
9995,
13,
13,
4706,
736,
1583,
3032,
29879,
705,
1022,
29918,
16744,
29898,
4299,
29892,
7901,
1022,
29918,
4299,
29918,
2917,
29879,
29922,
5574,
29897,
13,
13,
1678,
822,
903,
29879,
705,
1022,
29918,
535,
26095,
29918,
6194,
29898,
1311,
29892,
1904,
1125,
13,
4706,
9995,
13,
4706,
402,
1691,
2446,
12541,
310,
278,
3022,
10880,
7901,
1022,
13,
4706,
9995,
13,
13,
4706,
736,
1583,
3032,
29879,
705,
1022,
29918,
16744,
29898,
4299,
29892,
7901,
1022,
29918,
4299,
29918,
2917,
29879,
29922,
8824,
29897,
13,
13,
1678,
822,
903,
29879,
705,
1022,
29918,
16744,
29898,
1311,
29892,
1904,
29892,
7901,
1022,
29918,
4299,
29918,
2917,
29879,
1125,
13,
4706,
9995,
13,
4706,
319,
16876,
740,
393,
7901,
8961,
975,
3022,
10880,
13,
4706,
322,
565,
3734,
29892,
975,
1904,
2295,
29879,
408,
1532,
13,
4706,
9995,
13,
13,
4706,
3022,
10880,
353,
1904,
29889,
16744,
580,
1839,
535,
26095,
2033,
13,
13,
4706,
565,
7431,
29898,
535,
26095,
29897,
1275,
29871,
29900,
29901,
13,
9651,
1904,
29889,
16744,
580,
1839,
535,
26095,
2033,
353,
518,
29896,
29962,
13,
4706,
1683,
29901,
13,
9651,
396,
1222,
1112,
9247,
7910,
3022,
10880,
13,
9651,
716,
29918,
535,
26095,
353,
3022,
10880,
29961,
29900,
29962,
334,
29871,
29906,
13,
13,
9651,
396,
960,
278,
3022,
10880,
4046,
756,
1063,
7450,
29892,
278,
1833,
9853,
3275,
304,
13,
9651,
396,
385,
1059,
29892,
470,
278,
1549,
649,
11581,
338,
451,
7282,
29892,
4331,
13,
9651,
396,
278,
3022,
10880,
995,
29889,
14402,
29901,
788,
25658,
1250,
2696,
577,
13,
9651,
396,
393,
278,
5687,
508,
4331,
1250,
322,
3721,
1284,
278,
3291,
29889,
13,
9651,
3022,
10880,
29918,
13400,
29918,
276,
3791,
353,
716,
29918,
535,
26095,
1405,
1583,
3032,
3317,
29918,
535,
26095,
13,
9651,
1833,
29918,
16175,
29918,
3127,
650,
681,
353,
1583,
3032,
4230,
29918,
16175,
29918,
2848,
1275,
29871,
29900,
13,
9651,
1549,
649,
29918,
412,
12535,
353,
451,
1583,
3032,
3084,
29918,
20678,
649,
29918,
29887,
475,
580,
13,
9651,
565,
3022,
10880,
29918,
13400,
29918,
276,
3791,
470,
1833,
29918,
16175,
29918,
3127,
650,
681,
470,
1549,
649,
29918,
412,
12535,
29901,
13,
13,
18884,
396,
2538,
300,
3022,
10880,
13,
18884,
565,
7901,
1022,
29918,
4299,
29918,
2917,
29879,
29901,
13,
462,
1678,
1583,
3032,
26658,
1860,
353,
5159,
13,
462,
1678,
1904,
29889,
16744,
580,
1839,
535,
26095,
2033,
353,
518,
29896,
29962,
13,
13,
462,
1678,
736,
1583,
3032,
29879,
705,
1022,
29918,
4299,
29918,
2917,
29918,
6194,
29898,
4299,
29897,
13,
18884,
1683,
29901,
13,
462,
1678,
736,
1904,
29892,
5159,
13,
13,
9651,
1904,
29889,
16744,
580,
1839,
535,
26095,
2033,
353,
518,
1482,
29918,
535,
26095,
29962,
13,
13,
4706,
736,
1904,
29892,
518,
13,
9651,
1583,
3032,
3258,
29918,
4299,
29918,
2917,
29898,
13,
18884,
26403,
29918,
6194,
29922,
4299,
29889,
21970,
29918,
6194,
3101,
565,
7901,
1022,
29918,
4299,
29918,
2917,
29879,
1683,
6213,
13,
4706,
4514,
13,
13,
1678,
822,
903,
29879,
705,
1022,
29918,
4299,
29918,
2917,
29918,
6194,
29898,
1311,
29892,
1904,
1125,
13,
4706,
9995,
13,
4706,
402,
1691,
2446,
12541,
1904,
2295,
13,
4706,
4128,
7901,
1022,
13,
4706,
9995,
13,
13,
4706,
1583,
3032,
10568,
29918,
8758,
29918,
2798,
580,
13,
4706,
2777,
29918,
13400,
29918,
276,
3791,
353,
1583,
3032,
4299,
29918,
2917,
29918,
16744,
29961,
13,
9651,
525,
8758,
29918,
2798,
2033,
1405,
1583,
3032,
3317,
29918,
8758,
29918,
2798,
13,
13,
4706,
565,
2777,
29918,
13400,
29918,
276,
3791,
29901,
13,
9651,
565,
1583,
3032,
29879,
705,
1022,
29918,
1457,
14373,
29918,
16175,
29918,
2311,
29918,
20472,
29901,
13,
18884,
736,
1904,
29892,
5159,
13,
13,
9651,
396,
2538,
300,
2777,
29918,
2798,
13,
9651,
1583,
3032,
4299,
29918,
2917,
29918,
16744,
1839,
8758,
29918,
2798,
2033,
353,
29871,
29896,
13,
13,
9651,
1583,
3032,
10568,
29918,
16626,
29918,
16175,
292,
580,
13,
9651,
7343,
29918,
16175,
292,
29918,
17590,
353,
1583,
3032,
4299,
29918,
2917,
29918,
16744,
29961,
13,
18884,
525,
16626,
29918,
16175,
292,
2033,
338,
451,
6213,
13,
13,
9651,
565,
7343,
29918,
16175,
292,
29918,
17590,
29901,
13,
18884,
9853,
29918,
2311,
29918,
13400,
29918,
276,
3791,
353,
1583,
3032,
4299,
29918,
2917,
29918,
16744,
29961,
13,
462,
1678,
525,
16626,
29918,
16175,
292,
2033,
1405,
1583,
3032,
3317,
29918,
1457,
14373,
29918,
16175,
29918,
2311,
13,
18884,
565,
9853,
29918,
2311,
29918,
13400,
29918,
276,
3791,
29901,
13,
462,
1678,
736,
1904,
29892,
5159,
13,
4706,
736,
1904,
29892,
518,
1311,
3032,
3258,
29918,
4299,
29918,
2917,
29898,
21970,
29918,
6194,
29922,
4299,
29889,
21970,
29918,
6194,
3101,
29962,
13,
13,
1678,
822,
903,
1188,
29918,
4906,
29898,
1311,
29892,
1904,
1125,
13,
4706,
9995,
13,
4706,
16849,
267,
278,
1857,
2106,
310,
278,
2740,
304,
278,
2991,
13,
4706,
9995,
13,
13,
4706,
3022,
10880,
353,
1904,
29889,
16744,
580,
1839,
535,
26095,
2033,
29961,
29900,
29962,
13,
4706,
2643,
353,
525,
16626,
9853,
292,
338,
12708,
6169,
13,
4706,
565,
525,
16626,
29918,
16175,
292,
29915,
297,
1583,
3032,
4299,
29918,
2917,
29918,
16744,
29901,
13,
9651,
565,
1583,
3032,
4299,
29918,
2917,
29918,
16744,
1839,
16626,
29918,
16175,
292,
2033,
338,
6213,
29901,
13,
18884,
2643,
353,
525,
16626,
9853,
292,
338,
9615,
6169,
13,
9651,
1683,
29901,
13,
18884,
2643,
353,
313,
13,
462,
1678,
376,
1457,
14373,
9853,
2159,
338,
731,
304,
376,
13,
462,
1678,
285,
29908,
29912,
1311,
3032,
4299,
29918,
2917,
29918,
16744,
1839,
16626,
29918,
16175,
292,
2033,
1836,
1159,
13,
13,
4706,
565,
1583,
3032,
29879,
705,
1022,
29918,
8513,
29918,
2220,
1275,
1583,
3032,
29879,
705,
1022,
29918,
535,
26095,
29918,
6194,
29901,
13,
9651,
17927,
29889,
3888,
29898,
29888,
29908,
29961,
7974,
16696,
29962,
23924,
10880,
731,
304,
426,
535,
26095,
1836,
16521,
13,
4706,
25342,
1583,
3032,
29879,
705,
1022,
29918,
8513,
29918,
2220,
1275,
1583,
3032,
29879,
705,
1022,
29918,
535,
26095,
29918,
392,
29918,
4299,
29918,
2917,
29901,
13,
9651,
17927,
29889,
3888,
29898,
13,
18884,
285,
29908,
29961,
7974,
16696,
29962,
23924,
10880,
731,
304,
426,
535,
26095,
1836,
376,
13,
18884,
285,
29908,
4998,
2302,
731,
304,
376,
13,
18884,
285,
29908,
29912,
1311,
3032,
4299,
29918,
2917,
29918,
16744,
1839,
8758,
29918,
2798,
2033,
1118,
322,
426,
4906,
5038,
13,
9651,
1723,
13,
4706,
25342,
1583,
3032,
29879,
705,
1022,
29918,
8513,
29918,
2220,
1275,
1583,
3032,
29879,
705,
1022,
29918,
4299,
29918,
2917,
29918,
6194,
29901,
13,
9651,
17927,
29889,
3888,
29898,
13,
18884,
285,
29908,
29961,
7974,
16696,
29962,
2799,
749,
2302,
731,
304,
376,
13,
18884,
285,
29908,
29912,
1311,
3032,
4299,
29918,
2917,
29918,
16744,
1839,
8758,
29918,
2798,
2033,
1118,
322,
426,
4906,
5038,
13,
9651,
1723,
13,
2
] |
nibabies/workflows/brain_extraction.py | oesteban/nibabies | 0 | 90097 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""Nipype translation of ANTs' workflows."""
import numpy as np
# general purpose
from pkg_resources import resource_filename as pkgr_fn
# nipype
from nipype.pipeline import engine as pe
from nipype.interfaces import utility as niu
from nipype.interfaces.ants import N4BiasFieldCorrection
from nipype.interfaces.ants.utils import AI
# niworkflows
from niworkflows.anat.ants import init_atropos_wf, ATROPOS_MODELS
from niworkflows.interfaces.ants import ImageMath
from niworkflows.interfaces.images import RegridToZooms, ValidateImage
from niworkflows.interfaces.nibabel import ApplyMask, Binarize
from niworkflows.interfaces.fixes import (
FixHeaderRegistration as Registration,
FixHeaderApplyTransforms as ApplyTransforms,
)
from niworkflows.interfaces.registration import (
SimpleBeforeAfterRPT as SimpleBeforeAfter
)
from templateflow.api import get as get_template
from ..utils.filtering import (
gaussian_filter as _gauss_filter,
truncation as _trunc
)
HIRES_ZOOMS = (1, 1, 1)
LOWRES_ZOOMS = (2, 2, 2)
def init_infant_brain_extraction_wf(
ants_affine_init=False,
bspline_fitting_distance=200,
debug=False,
in_template="MNIInfant",
template_specs=None,
interim_checkpoints=True,
mem_gb=3.0,
mri_scheme="T2w",
name="infant_brain_extraction_wf",
atropos_model=None,
omp_nthreads=None,
output_dir=None,
use_float=True,
):
"""
Build an atlas-based brain extraction pipeline for infant T2w MRI data.
Parameters
----------
ants_affine_init : :obj:`bool`, optional
Set-up a pre-initialization step with ``antsAI`` to account for mis-oriented images.
"""
inputnode = pe.Node(
niu.IdentityInterface(fields=["in_files", "in_mask"]), name="inputnode"
)
outputnode = pe.Node(
niu.IdentityInterface(fields=["out_corrected", "out_brain", "out_mask"]),
name="outputnode"
)
template_specs = template_specs or {}
# Find a suitable target template in TemplateFlow
tpl_target_path = get_template(
in_template,
suffix=mri_scheme,
**template_specs
)
if not tpl_target_path:
raise RuntimeError(
f"An instance of template <tpl-{in_template}> with MR scheme '{mri_scheme}'"
" could not be found.")
# tpl_brainmask_path = get_template(
# in_template, desc="brain", suffix="probseg", **template_specs
# )
# if not tpl_brainmask_path:
# ignore probseg for the time being
tpl_brainmask_path = get_template(
in_template, desc="brain", suffix="mask", **template_specs
)
tpl_regmask_path = get_template(
in_template, desc="BrainCerebellumExtraction", suffix="mask", **template_specs
)
# validate images
val_tmpl = pe.Node(ValidateImage(), name='val_tmpl')
val_tmpl.inputs.in_file = _pop(tpl_target_path)
val_target = pe.Node(ValidateImage(), name='val_target')
# Resample both target and template to a controlled, isotropic resolution
res_tmpl = pe.Node(RegridToZooms(zooms=HIRES_ZOOMS), name="res_tmpl") # testing
res_target = pe.Node(RegridToZooms(zooms=HIRES_ZOOMS), name="res_target") # testing
gauss_tmpl = pe.Node(niu.Function(function=_gauss_filter), name="gauss_tmpl")
# Spatial normalization step
lap_tmpl = pe.Node(ImageMath(operation="Laplacian", op2="0.4 1"), name="lap_tmpl")
lap_target = pe.Node(ImageMath(operation="Laplacian", op2="0.4 1"), name="lap_target")
# Merge image nodes
mrg_target = pe.Node(niu.Merge(2), name="mrg_target")
mrg_tmpl = pe.Node(niu.Merge(2), name="mrg_tmpl")
norm_lap_tmpl = pe.Node(niu.Function(function=_trunc), name="norm_lap_tmpl")
norm_lap_tmpl.inputs.dtype = "float32"
norm_lap_tmpl.inputs.out_max = 1.0
norm_lap_tmpl.inputs.percentile = (0.01, 99.99)
norm_lap_tmpl.inputs.clip_max = None
norm_lap_target = pe.Node(niu.Function(function=_trunc), name="norm_lap_target")
norm_lap_target.inputs.dtype = "float32"
norm_lap_target.inputs.out_max = 1.0
norm_lap_target.inputs.percentile = (0.01, 99.99)
norm_lap_target.inputs.clip_max = None
# Set up initial spatial normalization
ants_params = "testing" if debug else "precise"
norm = pe.Node(
Registration(from_file=pkgr_fn(
"niworkflows.data",
f"antsBrainExtraction_{ants_params}.json")
),
name="norm",
n_procs=omp_nthreads,
mem_gb=mem_gb,
)
norm.inputs.float = use_float
# main workflow
wf = pe.Workflow(name)
# Create a buffer interface as a cache for the actual inputs to registration
buffernode = pe.Node(niu.IdentityInterface(
fields=["hires_target", "smooth_target"]), name="buffernode")
# truncate target intensity for N4 correction
clip_target = pe.Node(
niu.Function(function=_trunc),
name="clip_target",
)
clip_tmpl = pe.Node(
niu.Function(function=_trunc),
name="clip_tmpl",
)
#clip_tmpl.inputs.in_file = _pop(tpl_target_path)
# INU correction of the target image
init_n4 = pe.Node(
N4BiasFieldCorrection(
dimension=3,
save_bias=False,
copy_header=True,
n_iterations=[50] * (4 - debug),
convergence_threshold=1e-7,
shrink_factor=4,
bspline_fitting_distance=bspline_fitting_distance,
),
n_procs=omp_nthreads,
name="init_n4",
)
clip_inu = pe.Node(
niu.Function(function=_trunc),
name="clip_inu",
)
gauss_target = pe.Node(niu.Function(function=_gauss_filter), name="gauss_target")
wf.connect([
# truncation, resampling, and initial N4
(inputnode, val_target, [(("in_files", _pop), "in_file")]),
# (inputnode, res_target, [(("in_files", _pop), "in_file")]),
(val_target, res_target, [("out_file", "in_file")]),
(res_target, clip_target, [("out_file", "in_file")]),
(val_tmpl, clip_tmpl, [("out_file", "in_file")]),
(clip_tmpl, res_tmpl, [("out", "in_file")]),
(clip_target, init_n4, [("out", "input_image")]),
(init_n4, clip_inu, [("output_image", "in_file")]),
(clip_inu, gauss_target, [("out", "in_file")]),
(clip_inu, buffernode, [("out", "hires_target")]),
(gauss_target, buffernode, [("out", "smooth_target")]),
(res_tmpl, gauss_tmpl, [("out_file", "in_file")]),
# (clip_tmpl, gauss_tmpl, [("out", "in_file")]),
])
# Graft a template registration-mask if present
if tpl_regmask_path:
hires_mask = pe.Node(
ApplyTransforms(
input_image=_pop(tpl_regmask_path),
transforms="identity",
interpolation="NearestNeighbor",
float=True),
name="hires_mask",
mem_gb=1
)
wf.connect([
(res_tmpl, hires_mask, [("out_file", "reference_image")]),
])
map_brainmask = pe.Node(
ApplyTransforms(interpolation="Gaussian", float=True),
name="map_brainmask",
mem_gb=1
)
map_brainmask.inputs.input_image = str(tpl_brainmask_path)
thr_brainmask = pe.Node(Binarize(thresh_low=0.80),
name="thr_brainmask")
bspline_grid = pe.Node(niu.Function(function=_bspline_distance),
name="bspline_grid")
# Refine INU correction
final_n4 = pe.Node(
N4BiasFieldCorrection(
dimension=3,
save_bias=True,
copy_header=True,
n_iterations=[50] * 5,
convergence_threshold=1e-7,
rescale_intensities=True,
shrink_factor=4,
),
n_procs=omp_nthreads,
name="final_n4",
)
final_mask = pe.Node(ApplyMask(), name="final_mask")
if atropos_model is None:
atropos_model = tuple(ATROPOS_MODELS[mri_scheme].values())
atropos_wf = init_atropos_wf(
use_random_seed=False,
omp_nthreads=omp_nthreads,
mem_gb=mem_gb,
in_segmentation_model=atropos_model,
)
# if tpl_regmask_path:
# atropos_wf.get_node('inputnode').inputs.in_mask_dilated = tpl_regmask_path
sel_wm = pe.Node(niu.Select(index=atropos_model[-1] - 1), name='sel_wm',
run_without_submitting=True)
wf.connect([
(inputnode, map_brainmask, [(("in_files", _pop), "reference_image")]),
(inputnode, final_n4, [(("in_files", _pop), "input_image")]),
(inputnode, bspline_grid, [(("in_files", _pop), "in_file")]),
# (bspline_grid, final_n4, [("out", "bspline_fitting_distance")]),
(bspline_grid, final_n4, [("out", "args")]),
# merge laplacian and original images
(buffernode, lap_target, [("smooth_target", "op1")]),
(buffernode, mrg_target, [("hires_target", "in1")]),
(lap_target, norm_lap_target, [("output_image", "in_file")]),
(norm_lap_target, mrg_target, [("out", "in2")]),
# Template massaging
(res_tmpl, lap_tmpl, [("out_file", "op1")]),
(res_tmpl, mrg_tmpl, [("out_file", "in1")]),
(lap_tmpl, norm_lap_tmpl, [("output_image", "in_file")]),
(norm_lap_tmpl, mrg_tmpl, [("out", "in2")]),
# spatial normalization
(mrg_target, norm, [("out", "moving_image")]),
(mrg_tmpl, norm, [("out", "fixed_image")]),
(norm, map_brainmask, [
("reverse_transforms", "transforms"),
("reverse_invert_flags", "invert_transform_flags")]),
(map_brainmask, thr_brainmask, [("output_image", "in_file")]),
# take a second pass of N4
(map_brainmask, final_n4, [("output_image", "weight_image")]),
(final_n4, final_mask, [("output_image", "in_file")]),
(thr_brainmask, final_mask, [("out_mask", "in_mask")]),
(final_n4, outputnode, [("output_image", "out_corrected")]),
(thr_brainmask, outputnode, [("out_mask", "out_mask")]),
(final_mask, outputnode, [("out_file", "out_brain")]),
])
# wf.disconnect([
# (get_brainmask, apply_mask, [('output_image', 'mask_file')]),
# (copy_xform, outputnode, [('out_mask', 'out_mask')]),
# ])
# wf.connect([
# (init_n4, atropos_wf, [
# ('output_image', 'inputnode.in_files')]), # intensity image
# (thr_brainmask, atropos_wf, [
# ('out_mask', 'inputnode.in_mask')]),
# (atropos_wf, sel_wm, [('outputnode.out_tpms', 'inlist')]),
# (sel_wm, final_n4, [('out', 'weight_image')]),
# ])
# wf.connect([
# (atropos_wf, outputnode, [
# ('outputnode.out_mask', 'out_mask'),
# ('outputnode.out_segm', 'out_segm'),
# ('outputnode.out_tpms', 'out_tpms')]),
# ])
if tpl_regmask_path:
wf.connect([
(hires_mask, norm, [
("output_image", "fixed_image_masks")]),
# (hires_mask, atropos_wf, [
# ("output_image", "inputnode.in_mask_dilated")]),
])
if interim_checkpoints:
final_apply = pe.Node(
ApplyTransforms(
interpolation="BSpline",
float=True),
name="final_apply",
mem_gb=1
)
final_report = pe.Node(SimpleBeforeAfter(
before_label=f"tpl-{in_template}",
after_label="target",
out_report="final_report.svg"),
name="final_report"
)
wf.connect([
(inputnode, final_apply, [(("in_files", _pop), "reference_image")]),
(res_tmpl, final_apply, [("out_file", "input_image")]),
(norm, final_apply, [
("reverse_transforms", "transforms"),
("reverse_invert_flags", "invert_transform_flags")]),
(final_apply, final_report, [("output_image", "before")]),
(outputnode, final_report, [("out_corrected", "after"),
("out_mask", "wm_seg")]),
])
if output_dir:
from nipype.interfaces.io import DataSink
ds_final_inu = pe.Node(DataSink(base_directory=str(output_dir.parent)),
name="ds_final_inu")
ds_final_msk = pe.Node(DataSink(base_directory=str(output_dir.parent)),
name="ds_final_msk")
ds_report = pe.Node(DataSink(base_directory=str(output_dir.parent)),
name="ds_report")
wf.connect([
(outputnode, ds_final_inu, [
("out_corrected", f"{output_dir.name}.@inu_corrected")]),
(outputnode, ds_final_msk, [
("out_mask", f"{output_dir.name}.@brainmask")]),
(final_report, ds_report, [
("out_report", f"{output_dir.name}.@report")]),
])
if not ants_affine_init:
return wf
# Initialize transforms with antsAI
lowres_tmpl = pe.Node(RegridToZooms(zooms=LOWRES_ZOOMS), name="lowres_tmpl")
lowres_target = pe.Node(RegridToZooms(zooms=LOWRES_ZOOMS), name="lowres_target")
init_aff = pe.Node(
AI(
metric=("Mattes", 32, "Regular", 0.25),
transform=("Affine", 0.1),
search_factor=(15, 0.1),
principal_axes=False,
convergence=(10, 1e-6, 10),
search_grid=(40, (0, 40, 40)),
verbose=True,
),
name="init_aff",
n_procs=omp_nthreads,
)
wf.connect([
(gauss_tmpl, lowres_tmpl, [("out", "in_file")]),
(lowres_tmpl, init_aff, [("out_file", "fixed_image")]),
(gauss_target, lowres_target, [("out", "in_file")]),
(lowres_target, init_aff, [("out_file", "moving_image")]),
(init_aff, norm, [("output_transform", "initial_moving_transform")]),
])
if tpl_regmask_path:
lowres_mask = pe.Node(
ApplyTransforms(
input_image=_pop(tpl_regmask_path),
transforms="identity",
interpolation="MultiLabel",
float=True),
name="lowres_mask",
mem_gb=1
)
wf.connect([
(lowres_tmpl, lowres_mask, [("out_file", "reference_image")]),
(lowres_mask, init_aff, [("output_image", "fixed_image_mask")]),
])
if interim_checkpoints:
init_apply = pe.Node(
ApplyTransforms(
interpolation="BSpline",
float=True),
name="init_apply",
mem_gb=1
)
init_report = pe.Node(SimpleBeforeAfter(
before_label=f"tpl-{in_template}",
after_label="target",
out_report="init_report.svg"),
name="init_report"
)
wf.connect([
(lowres_target, init_apply, [("out_file", "input_image")]),
(res_tmpl, init_apply, [("out_file", "reference_image")]),
(init_aff, init_apply, [("output_transform", "transforms")]),
(init_apply, init_report, [("output_image", "after")]),
(res_tmpl, init_report, [("out_file", "before")]),
])
if output_dir:
ds_init_report = pe.Node(DataSink(base_directory=str(output_dir.parent)),
name="ds_init_report")
wf.connect(
init_report, "out_report",
ds_init_report, f"{output_dir.name}.@init_report"
)
return wf
def _pop(in_files):
if isinstance(in_files, (list, tuple)):
return in_files[0]
return in_files
def _bspline_distance(in_file, spacings=(20, 20, 20)):
import numpy as np
import nibabel as nb
img = nb.load(in_file)
extent = (np.array(img.shape[:3]) - 1) * img.header.get_zooms()[:3]
retval = [f"{v}" for v in np.ceil(extent / np.array(spacings)).astype(int)]
return f"-b {'x'.join(retval)}"
| [
1,
396,
953,
16815,
29901,
448,
29930,
29899,
4464,
29901,
3017,
29936,
11451,
29899,
12860,
29899,
10289,
29901,
29871,
29946,
29936,
29536,
29899,
21175,
29899,
8513,
29901,
4263,
448,
29930,
29899,
13,
29937,
3516,
29901,
731,
11791,
29922,
4691,
380,
29879,
29922,
29946,
18696,
29922,
29946,
2381,
29922,
29946,
634,
29901,
13,
15945,
29908,
29940,
666,
668,
13962,
310,
13764,
29911,
29879,
29915,
27321,
29879,
1213,
15945,
13,
5215,
12655,
408,
7442,
13,
29937,
2498,
6437,
13,
3166,
282,
9415,
29918,
13237,
1053,
6503,
29918,
9507,
408,
282,
29895,
629,
29918,
9144,
13,
13,
29937,
302,
666,
668,
13,
3166,
302,
666,
668,
29889,
13096,
5570,
1053,
6012,
408,
1236,
13,
3166,
302,
666,
668,
29889,
1639,
8726,
1053,
19725,
408,
302,
5871,
13,
3166,
302,
666,
668,
29889,
1639,
8726,
29889,
1934,
1053,
405,
29946,
29933,
3173,
3073,
12521,
276,
428,
13,
3166,
302,
666,
668,
29889,
1639,
8726,
29889,
1934,
29889,
13239,
1053,
319,
29902,
13,
13,
29937,
6836,
1287,
1731,
29879,
13,
3166,
6836,
1287,
1731,
29879,
29889,
273,
271,
29889,
1934,
1053,
2069,
29918,
7816,
1066,
29918,
29893,
29888,
29892,
15531,
1672,
24815,
29918,
20387,
8547,
13,
3166,
6836,
1287,
1731,
29879,
29889,
1639,
8726,
29889,
1934,
1053,
7084,
11309,
13,
3166,
6836,
1287,
1731,
29879,
29889,
1639,
8726,
29889,
8346,
1053,
2169,
2429,
1762,
29999,
29877,
4835,
29892,
15758,
403,
2940,
13,
3166,
6836,
1287,
1731,
29879,
29889,
1639,
8726,
29889,
29876,
747,
1107,
1053,
2401,
368,
19832,
29892,
350,
18220,
675,
13,
3166,
6836,
1287,
1731,
29879,
29889,
1639,
8726,
29889,
5878,
267,
1053,
313,
13,
1678,
24778,
7850,
4597,
8306,
408,
2169,
8306,
29892,
13,
1678,
24778,
7850,
2052,
368,
4300,
9514,
408,
2401,
368,
4300,
9514,
29892,
13,
29897,
13,
3166,
6836,
1287,
1731,
29879,
29889,
1639,
8726,
29889,
1727,
8306,
1053,
313,
13,
1678,
12545,
18743,
13555,
29934,
7982,
408,
12545,
18743,
13555,
13,
29897,
13,
13,
3166,
4472,
1731,
29889,
2754,
1053,
679,
408,
679,
29918,
6886,
13,
3166,
6317,
13239,
29889,
4572,
292,
1053,
313,
13,
1678,
330,
17019,
29918,
4572,
408,
903,
29887,
11214,
29918,
4572,
29892,
13,
1678,
21022,
362,
408,
903,
509,
4661,
13,
29897,
13,
13,
17628,
15989,
29918,
29999,
29949,
29949,
4345,
353,
313,
29896,
29892,
29871,
29896,
29892,
29871,
29896,
29897,
13,
27998,
15989,
29918,
29999,
29949,
29949,
4345,
353,
313,
29906,
29892,
29871,
29906,
29892,
29871,
29906,
29897,
13,
13,
13,
1753,
2069,
29918,
7192,
424,
29918,
2634,
262,
29918,
1062,
13857,
29918,
29893,
29888,
29898,
13,
1678,
385,
1372,
29918,
3470,
457,
29918,
2344,
29922,
8824,
29892,
13,
1678,
289,
23579,
457,
29918,
29888,
5367,
29918,
19244,
29922,
29906,
29900,
29900,
29892,
13,
1678,
4744,
29922,
8824,
29892,
13,
1678,
297,
29918,
6886,
543,
29924,
12916,
25433,
424,
613,
13,
1678,
4472,
29918,
5965,
2395,
29922,
8516,
29892,
13,
1678,
1006,
326,
29918,
3198,
9748,
29922,
5574,
29892,
13,
1678,
2626,
29918,
26300,
29922,
29941,
29889,
29900,
29892,
13,
1678,
286,
374,
29918,
816,
2004,
543,
29911,
29906,
29893,
613,
13,
1678,
1024,
543,
7192,
424,
29918,
2634,
262,
29918,
1062,
13857,
29918,
29893,
29888,
613,
13,
1678,
472,
307,
1066,
29918,
4299,
29922,
8516,
29892,
13,
1678,
288,
1526,
29918,
29876,
28993,
29922,
8516,
29892,
13,
1678,
1962,
29918,
3972,
29922,
8516,
29892,
13,
1678,
671,
29918,
7411,
29922,
5574,
29892,
13,
1125,
13,
1678,
9995,
13,
1678,
8878,
385,
472,
3333,
29899,
6707,
17294,
4805,
428,
16439,
363,
28056,
323,
29906,
29893,
341,
3960,
848,
29889,
13,
13,
1678,
12662,
2699,
13,
1678,
448,
1378,
29899,
13,
1678,
385,
1372,
29918,
3470,
457,
29918,
2344,
584,
584,
5415,
18078,
11227,
1673,
13136,
13,
4706,
3789,
29899,
786,
263,
758,
29899,
11228,
2133,
4331,
411,
4954,
1934,
23869,
16159,
304,
3633,
363,
3984,
29899,
12236,
287,
4558,
29889,
13,
13,
1678,
9995,
13,
1678,
1881,
3177,
353,
1236,
29889,
4247,
29898,
13,
4706,
302,
5871,
29889,
18415,
10448,
29898,
9621,
29922,
3366,
262,
29918,
5325,
613,
376,
262,
29918,
13168,
3108,
511,
1024,
543,
2080,
3177,
29908,
13,
1678,
1723,
13,
1678,
1962,
3177,
353,
1236,
29889,
4247,
29898,
13,
4706,
302,
5871,
29889,
18415,
10448,
29898,
9621,
29922,
3366,
449,
29918,
15728,
287,
613,
376,
449,
29918,
2634,
262,
613,
376,
449,
29918,
13168,
3108,
511,
13,
4706,
1024,
543,
4905,
3177,
29908,
13,
1678,
1723,
13,
13,
1678,
4472,
29918,
5965,
2395,
353,
4472,
29918,
5965,
2395,
470,
6571,
13,
1678,
396,
10987,
263,
13907,
3646,
4472,
297,
25663,
17907,
13,
1678,
260,
572,
29918,
5182,
29918,
2084,
353,
679,
29918,
6886,
29898,
13,
4706,
297,
29918,
6886,
29892,
13,
4706,
25557,
29922,
29885,
374,
29918,
816,
2004,
29892,
13,
4706,
3579,
6886,
29918,
5965,
2395,
13,
1678,
1723,
13,
1678,
565,
451,
260,
572,
29918,
5182,
29918,
2084,
29901,
13,
4706,
12020,
24875,
2392,
29898,
13,
9651,
285,
29908,
2744,
2777,
310,
4472,
529,
29873,
572,
29899,
29912,
262,
29918,
6886,
17428,
411,
29751,
11380,
22372,
29885,
374,
29918,
816,
2004,
10162,
29908,
13,
9651,
376,
1033,
451,
367,
1476,
23157,
13,
13,
1678,
396,
260,
572,
29918,
2634,
262,
13168,
29918,
2084,
353,
679,
29918,
6886,
29898,
13,
1678,
396,
268,
297,
29918,
6886,
29892,
5153,
543,
2634,
262,
613,
25557,
543,
22795,
10199,
613,
3579,
6886,
29918,
5965,
2395,
13,
1678,
396,
1723,
13,
1678,
396,
565,
451,
260,
572,
29918,
2634,
262,
13168,
29918,
2084,
29901,
13,
13,
1678,
396,
11455,
2070,
10199,
363,
278,
931,
1641,
13,
1678,
260,
572,
29918,
2634,
262,
13168,
29918,
2084,
353,
679,
29918,
6886,
29898,
13,
4706,
297,
29918,
6886,
29892,
5153,
543,
2634,
262,
613,
25557,
543,
13168,
613,
3579,
6886,
29918,
5965,
2395,
13,
1678,
1723,
13,
13,
1678,
260,
572,
29918,
1727,
13168,
29918,
2084,
353,
679,
29918,
6886,
29898,
13,
4706,
297,
29918,
6886,
29892,
5153,
543,
22097,
29907,
406,
12562,
398,
5647,
13857,
613,
25557,
543,
13168,
613,
3579,
6886,
29918,
5965,
2395,
13,
1678,
1723,
13,
13,
1678,
396,
12725,
4558,
13,
1678,
659,
29918,
18276,
572,
353,
1236,
29889,
4247,
29898,
7211,
403,
2940,
3285,
1024,
2433,
791,
29918,
18276,
572,
1495,
13,
1678,
659,
29918,
18276,
572,
29889,
2080,
29879,
29889,
262,
29918,
1445,
353,
903,
7323,
29898,
29873,
572,
29918,
5182,
29918,
2084,
29897,
13,
13,
1678,
659,
29918,
5182,
353,
1236,
29889,
4247,
29898,
7211,
403,
2940,
3285,
1024,
2433,
791,
29918,
5182,
1495,
13,
13,
1678,
396,
2538,
981,
1716,
3646,
322,
4472,
304,
263,
20704,
29892,
338,
28467,
293,
10104,
13,
1678,
620,
29918,
18276,
572,
353,
1236,
29889,
4247,
29898,
4597,
2429,
1762,
29999,
29877,
4835,
29898,
2502,
4835,
29922,
17628,
15989,
29918,
29999,
29949,
29949,
4345,
511,
1024,
543,
690,
29918,
18276,
572,
1159,
29871,
396,
6724,
13,
1678,
620,
29918,
5182,
353,
1236,
29889,
4247,
29898,
4597,
2429,
1762,
29999,
29877,
4835,
29898,
2502,
4835,
29922,
17628,
15989,
29918,
29999,
29949,
29949,
4345,
511,
1024,
543,
690,
29918,
5182,
1159,
29871,
396,
6724,
13,
1678,
330,
11214,
29918,
18276,
572,
353,
1236,
29889,
4247,
29898,
21399,
29889,
6678,
29898,
2220,
29922,
29918,
29887,
11214,
29918,
4572,
511,
1024,
543,
29887,
11214,
29918,
18276,
572,
1159,
13,
13,
1678,
396,
1706,
15238,
4226,
2133,
4331,
13,
1678,
23012,
29918,
18276,
572,
353,
1236,
29889,
4247,
29898,
2940,
11309,
29898,
16453,
543,
29931,
481,
433,
28445,
613,
1015,
29906,
543,
29900,
29889,
29946,
29871,
29896,
4968,
1024,
543,
6984,
29918,
18276,
572,
1159,
13,
1678,
23012,
29918,
5182,
353,
1236,
29889,
4247,
29898,
2940,
11309,
29898,
16453,
543,
29931,
481,
433,
28445,
613,
1015,
29906,
543,
29900,
29889,
29946,
29871,
29896,
4968,
1024,
543,
6984,
29918,
5182,
1159,
13,
13,
1678,
396,
4702,
479,
1967,
7573,
13,
1678,
286,
11007,
29918,
5182,
353,
1236,
29889,
4247,
29898,
21399,
29889,
15836,
479,
29898,
29906,
511,
1024,
543,
29885,
11007,
29918,
5182,
1159,
13,
1678,
286,
11007,
29918,
18276,
572,
353,
1236,
29889,
4247,
29898,
21399,
29889,
15836,
479,
29898,
29906,
511,
1024,
543,
29885,
11007,
29918,
18276,
572,
1159,
13,
13,
1678,
6056,
29918,
6984,
29918,
18276,
572,
353,
1236,
29889,
4247,
29898,
21399,
29889,
6678,
29898,
2220,
29922,
29918,
509,
4661,
511,
1024,
543,
12324,
29918,
6984,
29918,
18276,
572,
1159,
13,
1678,
6056,
29918,
6984,
29918,
18276,
572,
29889,
2080,
29879,
29889,
29881,
1853,
353,
376,
7411,
29941,
29906,
29908,
13,
1678,
6056,
29918,
6984,
29918,
18276,
572,
29889,
2080,
29879,
29889,
449,
29918,
3317,
353,
29871,
29896,
29889,
29900,
13,
1678,
6056,
29918,
6984,
29918,
18276,
572,
29889,
2080,
29879,
29889,
25376,
488,
353,
313,
29900,
29889,
29900,
29896,
29892,
29871,
29929,
29929,
29889,
29929,
29929,
29897,
13,
1678,
6056,
29918,
6984,
29918,
18276,
572,
29889,
2080,
29879,
29889,
24049,
29918,
3317,
353,
6213,
13,
13,
1678,
6056,
29918,
6984,
29918,
5182,
353,
1236,
29889,
4247,
29898,
21399,
29889,
6678,
29898,
2220,
29922,
29918,
509,
4661,
511,
1024,
543,
12324,
29918,
6984,
29918,
5182,
1159,
13,
1678,
6056,
29918,
6984,
29918,
5182,
29889,
2080,
29879,
29889,
29881,
1853,
353,
376,
7411,
29941,
29906,
29908,
13,
1678,
6056,
29918,
6984,
29918,
5182,
29889,
2080,
29879,
29889,
449,
29918,
3317,
353,
29871,
29896,
29889,
29900,
13,
1678,
6056,
29918,
6984,
29918,
5182,
29889,
2080,
29879,
29889,
25376,
488,
353,
313,
29900,
29889,
29900,
29896,
29892,
29871,
29929,
29929,
29889,
29929,
29929,
29897,
13,
1678,
6056,
29918,
6984,
29918,
5182,
29889,
2080,
29879,
29889,
24049,
29918,
3317,
353,
6213,
13,
13,
1678,
396,
3789,
701,
2847,
18652,
4226,
2133,
13,
1678,
385,
1372,
29918,
7529,
353,
376,
13424,
29908,
565,
4744,
1683,
376,
17990,
895,
29908,
13,
1678,
6056,
353,
1236,
29889,
4247,
29898,
13,
4706,
2169,
8306,
29898,
3166,
29918,
1445,
29922,
20571,
629,
29918,
9144,
29898,
13,
9651,
376,
1240,
1287,
1731,
29879,
29889,
1272,
613,
13,
9651,
285,
29908,
1934,
22097,
5647,
13857,
648,
1934,
29918,
7529,
1836,
3126,
1159,
13,
4706,
10353,
13,
4706,
1024,
543,
12324,
613,
13,
4706,
302,
29918,
771,
2395,
29922,
21744,
29918,
29876,
28993,
29892,
13,
4706,
2626,
29918,
26300,
29922,
6954,
29918,
26300,
29892,
13,
1678,
1723,
13,
1678,
6056,
29889,
2080,
29879,
29889,
7411,
353,
671,
29918,
7411,
13,
13,
1678,
396,
1667,
27321,
13,
1678,
281,
29888,
353,
1236,
29889,
5531,
1731,
29898,
978,
29897,
13,
1678,
396,
6204,
263,
6835,
5067,
408,
263,
7090,
363,
278,
3935,
10970,
304,
22583,
13,
1678,
6835,
3177,
353,
1236,
29889,
4247,
29898,
21399,
29889,
18415,
10448,
29898,
13,
4706,
4235,
29922,
3366,
29882,
2658,
29918,
5182,
613,
376,
3844,
6983,
29918,
5182,
3108,
511,
1024,
543,
9040,
3177,
1159,
13,
13,
1678,
396,
21022,
403,
3646,
26171,
363,
405,
29946,
26385,
13,
1678,
20102,
29918,
5182,
353,
1236,
29889,
4247,
29898,
13,
4706,
302,
5871,
29889,
6678,
29898,
2220,
29922,
29918,
509,
4661,
511,
13,
4706,
1024,
543,
24049,
29918,
5182,
613,
13,
1678,
1723,
13,
1678,
20102,
29918,
18276,
572,
353,
1236,
29889,
4247,
29898,
13,
4706,
302,
5871,
29889,
6678,
29898,
2220,
29922,
29918,
509,
4661,
511,
13,
4706,
1024,
543,
24049,
29918,
18276,
572,
613,
13,
1678,
1723,
13,
1678,
396,
24049,
29918,
18276,
572,
29889,
2080,
29879,
29889,
262,
29918,
1445,
353,
903,
7323,
29898,
29873,
572,
29918,
5182,
29918,
2084,
29897,
13,
13,
1678,
396,
2672,
29965,
26385,
310,
278,
3646,
1967,
13,
1678,
2069,
29918,
29876,
29946,
353,
1236,
29889,
4247,
29898,
13,
4706,
405,
29946,
29933,
3173,
3073,
12521,
276,
428,
29898,
13,
9651,
9927,
29922,
29941,
29892,
13,
9651,
4078,
29918,
29890,
3173,
29922,
8824,
29892,
13,
9651,
3509,
29918,
6672,
29922,
5574,
29892,
13,
9651,
302,
29918,
1524,
800,
11759,
29945,
29900,
29962,
334,
313,
29946,
448,
4744,
511,
13,
9651,
17221,
29918,
386,
12268,
29922,
29896,
29872,
29899,
29955,
29892,
13,
9651,
14653,
682,
29918,
19790,
29922,
29946,
29892,
13,
9651,
289,
23579,
457,
29918,
29888,
5367,
29918,
19244,
29922,
5824,
572,
457,
29918,
29888,
5367,
29918,
19244,
29892,
13,
4706,
10353,
13,
4706,
302,
29918,
771,
2395,
29922,
21744,
29918,
29876,
28993,
29892,
13,
4706,
1024,
543,
2344,
29918,
29876,
29946,
613,
13,
1678,
1723,
13,
1678,
20102,
29918,
8675,
353,
1236,
29889,
4247,
29898,
13,
4706,
302,
5871,
29889,
6678,
29898,
2220,
29922,
29918,
509,
4661,
511,
13,
4706,
1024,
543,
24049,
29918,
8675,
613,
13,
1678,
1723,
13,
1678,
330,
11214,
29918,
5182,
353,
1236,
29889,
4247,
29898,
21399,
29889,
6678,
29898,
2220,
29922,
29918,
29887,
11214,
29918,
4572,
511,
1024,
543,
29887,
11214,
29918,
5182,
1159,
13,
1678,
281,
29888,
29889,
6915,
4197,
13,
4706,
396,
21022,
362,
29892,
620,
314,
10335,
29892,
322,
2847,
405,
29946,
13,
4706,
313,
2080,
3177,
29892,
659,
29918,
5182,
29892,
17288,
703,
262,
29918,
5325,
613,
903,
7323,
511,
376,
262,
29918,
1445,
1159,
11724,
13,
4706,
396,
313,
2080,
3177,
29892,
620,
29918,
5182,
29892,
17288,
703,
262,
29918,
5325,
613,
903,
7323,
511,
376,
262,
29918,
1445,
1159,
11724,
13,
4706,
313,
791,
29918,
5182,
29892,
620,
29918,
5182,
29892,
518,
703,
449,
29918,
1445,
613,
376,
262,
29918,
1445,
1159,
11724,
13,
4706,
313,
690,
29918,
5182,
29892,
20102,
29918,
5182,
29892,
518,
703,
449,
29918,
1445,
613,
376,
262,
29918,
1445,
1159,
11724,
13,
4706,
313,
791,
29918,
18276,
572,
29892,
20102,
29918,
18276,
572,
29892,
518,
703,
449,
29918,
1445,
613,
376,
262,
29918,
1445,
1159,
11724,
13,
4706,
313,
24049,
29918,
18276,
572,
29892,
620,
29918,
18276,
572,
29892,
518,
703,
449,
613,
376,
262,
29918,
1445,
1159,
11724,
13,
4706,
313,
24049,
29918,
5182,
29892,
2069,
29918,
29876,
29946,
29892,
518,
703,
449,
613,
376,
2080,
29918,
3027,
1159,
11724,
13,
4706,
313,
2344,
29918,
29876,
29946,
29892,
20102,
29918,
8675,
29892,
518,
703,
4905,
29918,
3027,
613,
376,
262,
29918,
1445,
1159,
11724,
13,
4706,
313,
24049,
29918,
8675,
29892,
330,
11214,
29918,
5182,
29892,
518,
703,
449,
613,
376,
262,
29918,
1445,
1159,
11724,
13,
4706,
313,
24049,
29918,
8675,
29892,
6835,
3177,
29892,
518,
703,
449,
613,
376,
29882,
2658,
29918,
5182,
1159,
11724,
13,
4706,
313,
29887,
11214,
29918,
5182,
29892,
6835,
3177,
29892,
518,
703,
449,
613,
376,
3844,
6983,
29918,
5182,
1159,
11724,
13,
4706,
313,
690,
29918,
18276,
572,
29892,
330,
11214,
29918,
18276,
572,
29892,
518,
703,
449,
29918,
1445,
613,
376,
262,
29918,
1445,
1159,
11724,
13,
4706,
396,
313,
24049,
29918,
18276,
572,
29892,
330,
11214,
29918,
18276,
572,
29892,
518,
703,
449,
613,
376,
262,
29918,
1445,
1159,
11724,
13,
268,
2314,
13,
13,
1678,
396,
402,
4154,
263,
4472,
22583,
29899,
13168,
565,
2198,
13,
1678,
565,
260,
572,
29918,
1727,
13168,
29918,
2084,
29901,
13,
4706,
298,
2658,
29918,
13168,
353,
1236,
29889,
4247,
29898,
13,
9651,
2401,
368,
4300,
9514,
29898,
13,
18884,
1881,
29918,
3027,
29922,
29918,
7323,
29898,
29873,
572,
29918,
1727,
13168,
29918,
2084,
511,
13,
18884,
4327,
29879,
543,
22350,
613,
13,
18884,
29694,
543,
29940,
799,
342,
8139,
1141,
4089,
613,
13,
18884,
5785,
29922,
5574,
511,
13,
9651,
1024,
543,
29882,
2658,
29918,
13168,
613,
13,
9651,
2626,
29918,
26300,
29922,
29896,
13,
4706,
1723,
13,
4706,
281,
29888,
29889,
6915,
4197,
13,
9651,
313,
690,
29918,
18276,
572,
29892,
298,
2658,
29918,
13168,
29892,
518,
703,
449,
29918,
1445,
613,
376,
5679,
29918,
3027,
1159,
11724,
13,
308,
2314,
13,
13,
1678,
2910,
29918,
2634,
262,
13168,
353,
1236,
29889,
4247,
29898,
13,
4706,
2401,
368,
4300,
9514,
29898,
1639,
3733,
362,
543,
29954,
17019,
613,
5785,
29922,
5574,
511,
13,
4706,
1024,
543,
1958,
29918,
2634,
262,
13168,
613,
13,
4706,
2626,
29918,
26300,
29922,
29896,
13,
1678,
1723,
13,
1678,
2910,
29918,
2634,
262,
13168,
29889,
2080,
29879,
29889,
2080,
29918,
3027,
353,
851,
29898,
29873,
572,
29918,
2634,
262,
13168,
29918,
2084,
29897,
13,
13,
1678,
1468,
29918,
2634,
262,
13168,
353,
1236,
29889,
4247,
29898,
29933,
18220,
675,
29898,
386,
3781,
29918,
677,
29922,
29900,
29889,
29947,
29900,
511,
13,
462,
9651,
1024,
543,
386,
29878,
29918,
2634,
262,
13168,
1159,
13,
1678,
289,
23579,
457,
29918,
7720,
353,
1236,
29889,
4247,
29898,
21399,
29889,
6678,
29898,
2220,
29922,
29918,
5824,
572,
457,
29918,
19244,
511,
13,
462,
965,
1024,
543,
5824,
572,
457,
29918,
7720,
1159,
13,
13,
1678,
396,
9897,
457,
2672,
29965,
26385,
13,
1678,
2186,
29918,
29876,
29946,
353,
1236,
29889,
4247,
29898,
13,
4706,
405,
29946,
29933,
3173,
3073,
12521,
276,
428,
29898,
13,
9651,
9927,
29922,
29941,
29892,
13,
9651,
4078,
29918,
29890,
3173,
29922,
5574,
29892,
13,
9651,
3509,
29918,
6672,
29922,
5574,
29892,
13,
9651,
302,
29918,
1524,
800,
11759,
29945,
29900,
29962,
334,
29871,
29945,
29892,
13,
9651,
17221,
29918,
386,
12268,
29922,
29896,
29872,
29899,
29955,
29892,
13,
9651,
620,
29883,
744,
29918,
524,
575,
1907,
29922,
5574,
29892,
13,
9651,
14653,
682,
29918,
19790,
29922,
29946,
29892,
13,
4706,
10353,
13,
4706,
302,
29918,
771,
2395,
29922,
21744,
29918,
29876,
28993,
29892,
13,
4706,
1024,
543,
8394,
29918,
29876,
29946,
613,
13,
1678,
1723,
13,
1678,
2186,
29918,
13168,
353,
1236,
29889,
4247,
29898,
2052,
368,
19832,
3285,
1024,
543,
8394,
29918,
13168,
1159,
13,
13,
1678,
565,
472,
307,
1066,
29918,
4299,
338,
6213,
29901,
13,
4706,
472,
307,
1066,
29918,
4299,
353,
18761,
29898,
1299,
1672,
24815,
29918,
20387,
8547,
29961,
29885,
374,
29918,
816,
2004,
1822,
5975,
3101,
13,
13,
1678,
472,
307,
1066,
29918,
29893,
29888,
353,
2069,
29918,
7816,
1066,
29918,
29893,
29888,
29898,
13,
4706,
671,
29918,
8172,
29918,
26776,
29922,
8824,
29892,
13,
4706,
288,
1526,
29918,
29876,
28993,
29922,
21744,
29918,
29876,
28993,
29892,
13,
4706,
2626,
29918,
26300,
29922,
6954,
29918,
26300,
29892,
13,
4706,
297,
29918,
28192,
362,
29918,
4299,
29922,
7816,
1066,
29918,
4299,
29892,
13,
1678,
1723,
13,
1678,
396,
565,
260,
572,
29918,
1727,
13168,
29918,
2084,
29901,
13,
1678,
396,
268,
472,
307,
1066,
29918,
29893,
29888,
29889,
657,
29918,
3177,
877,
2080,
3177,
2824,
2080,
29879,
29889,
262,
29918,
13168,
29918,
29881,
309,
630,
353,
260,
572,
29918,
1727,
13168,
29918,
2084,
13,
13,
1678,
5535,
29918,
29893,
29885,
353,
1236,
29889,
4247,
29898,
21399,
29889,
3549,
29898,
2248,
29922,
7816,
1066,
29918,
4299,
14352,
29896,
29962,
448,
29871,
29896,
511,
1024,
2433,
2838,
29918,
29893,
29885,
742,
13,
462,
1678,
1065,
29918,
14037,
29918,
1491,
29885,
5367,
29922,
5574,
29897,
13,
13,
13,
1678,
281,
29888,
29889,
6915,
4197,
13,
4706,
313,
2080,
3177,
29892,
2910,
29918,
2634,
262,
13168,
29892,
17288,
703,
262,
29918,
5325,
613,
903,
7323,
511,
376,
5679,
29918,
3027,
1159,
11724,
13,
4706,
313,
2080,
3177,
29892,
2186,
29918,
29876,
29946,
29892,
17288,
703,
262,
29918,
5325,
613,
903,
7323,
511,
376,
2080,
29918,
3027,
1159,
11724,
13,
4706,
313,
2080,
3177,
29892,
289,
23579,
457,
29918,
7720,
29892,
17288,
703,
262,
29918,
5325,
613,
903,
7323,
511,
376,
262,
29918,
1445,
1159,
11724,
13,
4706,
396,
313,
5824,
572,
457,
29918,
7720,
29892,
2186,
29918,
29876,
29946,
29892,
518,
703,
449,
613,
376,
5824,
572,
457,
29918,
29888,
5367,
29918,
19244,
1159,
11724,
13,
4706,
313,
5824,
572,
457,
29918,
7720,
29892,
2186,
29918,
29876,
29946,
29892,
518,
703,
449,
613,
376,
5085,
1159,
11724,
13,
4706,
396,
10366,
425,
13974,
28445,
322,
2441,
4558,
13,
4706,
313,
9040,
3177,
29892,
23012,
29918,
5182,
29892,
518,
703,
3844,
6983,
29918,
5182,
613,
376,
459,
29896,
1159,
11724,
13,
4706,
313,
9040,
3177,
29892,
286,
11007,
29918,
5182,
29892,
518,
703,
29882,
2658,
29918,
5182,
613,
376,
262,
29896,
1159,
11724,
13,
4706,
313,
6984,
29918,
5182,
29892,
6056,
29918,
6984,
29918,
5182,
29892,
518,
703,
4905,
29918,
3027,
613,
376,
262,
29918,
1445,
1159,
11724,
13,
4706,
313,
12324,
29918,
6984,
29918,
5182,
29892,
286,
11007,
29918,
5182,
29892,
518,
703,
449,
613,
376,
262,
29906,
1159,
11724,
13,
4706,
396,
25663,
4158,
6751,
13,
4706,
313,
690,
29918,
18276,
572,
29892,
23012,
29918,
18276,
572,
29892,
518,
703,
449,
29918,
1445,
613,
376,
459,
29896,
1159,
11724,
13,
4706,
313,
690,
29918,
18276,
572,
29892,
286,
11007,
29918,
18276,
572,
29892,
518,
703,
449,
29918,
1445,
613,
376,
262,
29896,
1159,
11724,
13,
4706,
313,
6984,
29918,
18276,
572,
29892,
6056,
29918,
6984,
29918,
18276,
572,
29892,
518,
703,
4905,
29918,
3027,
613,
376,
262,
29918,
1445,
1159,
11724,
13,
4706,
313,
12324,
29918,
6984,
29918,
18276,
572,
29892,
286,
11007,
29918,
18276,
572,
29892,
518,
703,
449,
613,
376,
262,
29906,
1159,
11724,
13,
4706,
396,
18652,
4226,
2133,
13,
4706,
313,
29885,
11007,
29918,
5182,
29892,
6056,
29892,
518,
703,
449,
613,
376,
13529,
292,
29918,
3027,
1159,
11724,
13,
4706,
313,
29885,
11007,
29918,
18276,
572,
29892,
6056,
29892,
518,
703,
449,
613,
376,
20227,
29918,
3027,
1159,
11724,
13,
4706,
313,
12324,
29892,
2910,
29918,
2634,
262,
13168,
29892,
518,
13,
9651,
4852,
24244,
29918,
9067,
29879,
613,
376,
9067,
29879,
4968,
13,
9651,
4852,
24244,
29918,
262,
1765,
29918,
15764,
613,
376,
262,
1765,
29918,
9067,
29918,
15764,
1159,
11724,
13,
4706,
313,
1958,
29918,
2634,
262,
13168,
29892,
1468,
29918,
2634,
262,
13168,
29892,
518,
703,
4905,
29918,
3027,
613,
376,
262,
29918,
1445,
1159,
11724,
13,
4706,
396,
2125,
263,
1473,
1209,
310,
405,
29946,
13,
4706,
313,
1958,
29918,
2634,
262,
13168,
29892,
2186,
29918,
29876,
29946,
29892,
518,
703,
4905,
29918,
3027,
613,
376,
7915,
29918,
3027,
1159,
11724,
13,
4706,
313,
8394,
29918,
29876,
29946,
29892,
2186,
29918,
13168,
29892,
518,
703,
4905,
29918,
3027,
613,
376,
262,
29918,
1445,
1159,
11724,
13,
4706,
313,
386,
29878,
29918,
2634,
262,
13168,
29892,
2186,
29918,
13168,
29892,
518,
703,
449,
29918,
13168,
613,
376,
262,
29918,
13168,
1159,
11724,
13,
4706,
313,
8394,
29918,
29876,
29946,
29892,
1962,
3177,
29892,
518,
703,
4905,
29918,
3027,
613,
376,
449,
29918,
15728,
287,
1159,
11724,
13,
4706,
313,
386,
29878,
29918,
2634,
262,
13168,
29892,
1962,
3177,
29892,
518,
703,
449,
29918,
13168,
613,
376,
449,
29918,
13168,
1159,
11724,
13,
4706,
313,
8394,
29918,
13168,
29892,
1962,
3177,
29892,
518,
703,
449,
29918,
1445,
613,
376,
449,
29918,
2634,
262,
1159,
11724,
13,
268,
2314,
13,
13,
1678,
396,
281,
29888,
29889,
2218,
6915,
4197,
13,
1678,
396,
268,
313,
657,
29918,
2634,
262,
13168,
29892,
3394,
29918,
13168,
29892,
518,
877,
4905,
29918,
3027,
742,
525,
13168,
29918,
1445,
1495,
11724,
13,
1678,
396,
268,
313,
8552,
29918,
29916,
689,
29892,
1962,
3177,
29892,
518,
877,
449,
29918,
13168,
742,
525,
449,
29918,
13168,
1495,
11724,
13,
1678,
396,
29871,
2314,
13,
13,
1678,
396,
281,
29888,
29889,
6915,
4197,
13,
1678,
396,
268,
313,
2344,
29918,
29876,
29946,
29892,
472,
307,
1066,
29918,
29893,
29888,
29892,
518,
13,
1678,
396,
308,
6702,
4905,
29918,
3027,
742,
525,
2080,
3177,
29889,
262,
29918,
5325,
1495,
11724,
29871,
396,
26171,
1967,
13,
1678,
396,
268,
313,
386,
29878,
29918,
2634,
262,
13168,
29892,
472,
307,
1066,
29918,
29893,
29888,
29892,
518,
13,
1678,
396,
308,
6702,
449,
29918,
13168,
742,
525,
2080,
3177,
29889,
262,
29918,
13168,
1495,
11724,
13,
1678,
396,
268,
313,
7816,
1066,
29918,
29893,
29888,
29892,
5535,
29918,
29893,
29885,
29892,
518,
877,
4905,
3177,
29889,
449,
29918,
9392,
1516,
742,
525,
262,
1761,
1495,
11724,
13,
1678,
396,
268,
313,
2838,
29918,
29893,
29885,
29892,
2186,
29918,
29876,
29946,
29892,
518,
877,
449,
742,
525,
7915,
29918,
3027,
1495,
11724,
13,
1678,
396,
29871,
2314,
13,
1678,
396,
281,
29888,
29889,
6915,
4197,
13,
4706,
396,
313,
7816,
1066,
29918,
29893,
29888,
29892,
1962,
3177,
29892,
518,
13,
4706,
396,
268,
6702,
4905,
3177,
29889,
449,
29918,
13168,
742,
525,
449,
29918,
13168,
5477,
13,
4706,
396,
268,
6702,
4905,
3177,
29889,
449,
29918,
10199,
29885,
742,
525,
449,
29918,
10199,
29885,
5477,
13,
4706,
396,
268,
6702,
4905,
3177,
29889,
449,
29918,
9392,
1516,
742,
525,
449,
29918,
9392,
1516,
1495,
11724,
13,
1678,
396,
29871,
2314,
13,
13,
1678,
565,
260,
572,
29918,
1727,
13168,
29918,
2084,
29901,
13,
4706,
281,
29888,
29889,
6915,
4197,
13,
9651,
313,
29882,
2658,
29918,
13168,
29892,
6056,
29892,
518,
13,
18884,
4852,
4905,
29918,
3027,
613,
376,
20227,
29918,
3027,
29918,
13168,
29879,
1159,
11724,
13,
9651,
396,
313,
29882,
2658,
29918,
13168,
29892,
472,
307,
1066,
29918,
29893,
29888,
29892,
518,
13,
9651,
396,
268,
4852,
4905,
29918,
3027,
613,
376,
2080,
3177,
29889,
262,
29918,
13168,
29918,
29881,
309,
630,
1159,
11724,
13,
308,
2314,
13,
13,
1678,
565,
1006,
326,
29918,
3198,
9748,
29901,
13,
4706,
2186,
29918,
7302,
353,
1236,
29889,
4247,
29898,
13,
9651,
2401,
368,
4300,
9514,
29898,
13,
18884,
29694,
543,
9851,
572,
457,
613,
13,
18884,
5785,
29922,
5574,
511,
13,
9651,
1024,
543,
8394,
29918,
7302,
613,
13,
9651,
2626,
29918,
26300,
29922,
29896,
13,
4706,
1723,
13,
4706,
2186,
29918,
12276,
353,
1236,
29889,
4247,
29898,
15427,
18743,
13555,
29898,
13,
9651,
1434,
29918,
1643,
29922,
29888,
29908,
29873,
572,
29899,
29912,
262,
29918,
6886,
17671,
13,
9651,
1156,
29918,
1643,
543,
5182,
613,
13,
9651,
714,
29918,
12276,
543,
8394,
29918,
12276,
29889,
15120,
4968,
13,
9651,
1024,
543,
8394,
29918,
12276,
29908,
13,
4706,
1723,
13,
4706,
281,
29888,
29889,
6915,
4197,
13,
9651,
313,
2080,
3177,
29892,
2186,
29918,
7302,
29892,
17288,
703,
262,
29918,
5325,
613,
903,
7323,
511,
376,
5679,
29918,
3027,
1159,
11724,
13,
9651,
313,
690,
29918,
18276,
572,
29892,
2186,
29918,
7302,
29892,
518,
703,
449,
29918,
1445,
613,
376,
2080,
29918,
3027,
1159,
11724,
13,
9651,
313,
12324,
29892,
2186,
29918,
7302,
29892,
518,
13,
18884,
4852,
24244,
29918,
9067,
29879,
613,
376,
9067,
29879,
4968,
13,
18884,
4852,
24244,
29918,
262,
1765,
29918,
15764,
613,
376,
262,
1765,
29918,
9067,
29918,
15764,
1159,
11724,
13,
9651,
313,
8394,
29918,
7302,
29892,
2186,
29918,
12276,
29892,
518,
703,
4905,
29918,
3027,
613,
376,
11083,
1159,
11724,
13,
9651,
313,
4905,
3177,
29892,
2186,
29918,
12276,
29892,
518,
703,
449,
29918,
15728,
287,
613,
376,
7045,
4968,
13,
462,
462,
4706,
4852,
449,
29918,
13168,
613,
376,
29893,
29885,
29918,
10199,
1159,
11724,
13,
308,
2314,
13,
13,
1678,
565,
1962,
29918,
3972,
29901,
13,
4706,
515,
302,
666,
668,
29889,
1639,
8726,
29889,
601,
1053,
3630,
29903,
682,
13,
4706,
18031,
29918,
8394,
29918,
8675,
353,
1236,
29889,
4247,
29898,
1469,
29903,
682,
29898,
3188,
29918,
12322,
29922,
710,
29898,
4905,
29918,
3972,
29889,
3560,
8243,
13,
462,
1669,
1024,
543,
6289,
29918,
8394,
29918,
8675,
1159,
13,
4706,
18031,
29918,
8394,
29918,
29885,
808,
353,
1236,
29889,
4247,
29898,
1469,
29903,
682,
29898,
3188,
29918,
12322,
29922,
710,
29898,
4905,
29918,
3972,
29889,
3560,
8243,
13,
462,
1669,
1024,
543,
6289,
29918,
8394,
29918,
29885,
808,
1159,
13,
4706,
18031,
29918,
12276,
353,
1236,
29889,
4247,
29898,
1469,
29903,
682,
29898,
3188,
29918,
12322,
29922,
710,
29898,
4905,
29918,
3972,
29889,
3560,
8243,
13,
462,
9651,
1024,
543,
6289,
29918,
12276,
1159,
13,
13,
4706,
281,
29888,
29889,
6915,
4197,
13,
9651,
313,
4905,
3177,
29892,
18031,
29918,
8394,
29918,
8675,
29892,
518,
13,
18884,
4852,
449,
29918,
15728,
287,
613,
285,
29908,
29912,
4905,
29918,
3972,
29889,
978,
1836,
29992,
8675,
29918,
15728,
287,
1159,
11724,
13,
9651,
313,
4905,
3177,
29892,
18031,
29918,
8394,
29918,
29885,
808,
29892,
518,
13,
18884,
4852,
449,
29918,
13168,
613,
285,
29908,
29912,
4905,
29918,
3972,
29889,
978,
1836,
29992,
2634,
262,
13168,
1159,
11724,
13,
9651,
313,
8394,
29918,
12276,
29892,
18031,
29918,
12276,
29892,
518,
13,
18884,
4852,
449,
29918,
12276,
613,
285,
29908,
29912,
4905,
29918,
3972,
29889,
978,
1836,
29992,
12276,
1159,
11724,
13,
308,
2314,
13,
13,
1678,
565,
451,
385,
1372,
29918,
3470,
457,
29918,
2344,
29901,
13,
4706,
736,
281,
29888,
13,
13,
1678,
396,
25455,
4327,
29879,
411,
385,
1372,
23869,
13,
1678,
4482,
690,
29918,
18276,
572,
353,
1236,
29889,
4247,
29898,
4597,
2429,
1762,
29999,
29877,
4835,
29898,
2502,
4835,
29922,
27998,
15989,
29918,
29999,
29949,
29949,
4345,
511,
1024,
543,
677,
690,
29918,
18276,
572,
1159,
13,
1678,
4482,
690,
29918,
5182,
353,
1236,
29889,
4247,
29898,
4597,
2429,
1762,
29999,
29877,
4835,
29898,
2502,
4835,
29922,
27998,
15989,
29918,
29999,
29949,
29949,
4345,
511,
1024,
543,
677,
690,
29918,
5182,
1159,
13,
13,
1678,
2069,
29918,
3470,
353,
1236,
29889,
4247,
29898,
13,
4706,
319,
29902,
29898,
13,
9651,
12714,
29922,
703,
29924,
1131,
267,
613,
29871,
29941,
29906,
29892,
376,
4597,
1070,
613,
29871,
29900,
29889,
29906,
29945,
511,
13,
9651,
4327,
29922,
703,
27867,
457,
613,
29871,
29900,
29889,
29896,
511,
13,
9651,
2740,
29918,
19790,
7607,
29896,
29945,
29892,
29871,
29900,
29889,
29896,
511,
13,
9651,
5882,
29918,
1165,
267,
29922,
8824,
29892,
13,
9651,
17221,
7607,
29896,
29900,
29892,
29871,
29896,
29872,
29899,
29953,
29892,
29871,
29896,
29900,
511,
13,
9651,
2740,
29918,
7720,
7607,
29946,
29900,
29892,
313,
29900,
29892,
29871,
29946,
29900,
29892,
29871,
29946,
29900,
8243,
13,
9651,
26952,
29922,
5574,
29892,
13,
4706,
10353,
13,
4706,
1024,
543,
2344,
29918,
3470,
613,
13,
4706,
302,
29918,
771,
2395,
29922,
21744,
29918,
29876,
28993,
29892,
13,
1678,
1723,
13,
1678,
281,
29888,
29889,
6915,
4197,
13,
4706,
313,
29887,
11214,
29918,
18276,
572,
29892,
4482,
690,
29918,
18276,
572,
29892,
518,
703,
449,
613,
376,
262,
29918,
1445,
1159,
11724,
13,
4706,
313,
677,
690,
29918,
18276,
572,
29892,
2069,
29918,
3470,
29892,
518,
703,
449,
29918,
1445,
613,
376,
20227,
29918,
3027,
1159,
11724,
13,
4706,
313,
29887,
11214,
29918,
5182,
29892,
4482,
690,
29918,
5182,
29892,
518,
703,
449,
613,
376,
262,
29918,
1445,
1159,
11724,
13,
4706,
313,
677,
690,
29918,
5182,
29892,
2069,
29918,
3470,
29892,
518,
703,
449,
29918,
1445,
613,
376,
13529,
292,
29918,
3027,
1159,
11724,
13,
4706,
313,
2344,
29918,
3470,
29892,
6056,
29892,
518,
703,
4905,
29918,
9067,
613,
376,
11228,
29918,
13529,
292,
29918,
9067,
1159,
11724,
13,
268,
2314,
13,
13,
1678,
565,
260,
572,
29918,
1727,
13168,
29918,
2084,
29901,
13,
4706,
4482,
690,
29918,
13168,
353,
1236,
29889,
4247,
29898,
13,
9651,
2401,
368,
4300,
9514,
29898,
13,
18884,
1881,
29918,
3027,
29922,
29918,
7323,
29898,
29873,
572,
29918,
1727,
13168,
29918,
2084,
511,
13,
18884,
4327,
29879,
543,
22350,
613,
13,
18884,
29694,
543,
15329,
4775,
613,
13,
18884,
5785,
29922,
5574,
511,
13,
9651,
1024,
543,
677,
690,
29918,
13168,
613,
13,
9651,
2626,
29918,
26300,
29922,
29896,
13,
4706,
1723,
13,
4706,
281,
29888,
29889,
6915,
4197,
13,
9651,
313,
677,
690,
29918,
18276,
572,
29892,
4482,
690,
29918,
13168,
29892,
518,
703,
449,
29918,
1445,
613,
376,
5679,
29918,
3027,
1159,
11724,
13,
9651,
313,
677,
690,
29918,
13168,
29892,
2069,
29918,
3470,
29892,
518,
703,
4905,
29918,
3027,
613,
376,
20227,
29918,
3027,
29918,
13168,
1159,
11724,
13,
308,
2314,
13,
13,
1678,
565,
1006,
326,
29918,
3198,
9748,
29901,
13,
4706,
2069,
29918,
7302,
353,
1236,
29889,
4247,
29898,
13,
9651,
2401,
368,
4300,
9514,
29898,
13,
18884,
29694,
543,
9851,
572,
457,
613,
13,
18884,
5785,
29922,
5574,
511,
13,
9651,
1024,
543,
2344,
29918,
7302,
613,
13,
9651,
2626,
29918,
26300,
29922,
29896,
13,
4706,
1723,
13,
4706,
2069,
29918,
12276,
353,
1236,
29889,
4247,
29898,
15427,
18743,
13555,
29898,
13,
9651,
1434,
29918,
1643,
29922,
29888,
29908,
29873,
572,
29899,
29912,
262,
29918,
6886,
17671,
13,
9651,
1156,
29918,
1643,
543,
5182,
613,
13,
9651,
714,
29918,
12276,
543,
2344,
29918,
12276,
29889,
15120,
4968,
13,
9651,
1024,
543,
2344,
29918,
12276,
29908,
13,
4706,
1723,
13,
4706,
281,
29888,
29889,
6915,
4197,
13,
9651,
313,
677,
690,
29918,
5182,
29892,
2069,
29918,
7302,
29892,
518,
703,
449,
29918,
1445,
613,
376,
2080,
29918,
3027,
1159,
11724,
13,
9651,
313,
690,
29918,
18276,
572,
29892,
2069,
29918,
7302,
29892,
518,
703,
449,
29918,
1445,
613,
376,
5679,
29918,
3027,
1159,
11724,
13,
9651,
313,
2344,
29918,
3470,
29892,
2069,
29918,
7302,
29892,
518,
703,
4905,
29918,
9067,
613,
376,
9067,
29879,
1159,
11724,
13,
9651,
313,
2344,
29918,
7302,
29892,
2069,
29918,
12276,
29892,
518,
703,
4905,
29918,
3027,
613,
376,
7045,
1159,
11724,
13,
9651,
313,
690,
29918,
18276,
572,
29892,
2069,
29918,
12276,
29892,
518,
703,
449,
29918,
1445,
613,
376,
11083,
1159,
11724,
13,
308,
2314,
13,
13,
4706,
565,
1962,
29918,
3972,
29901,
13,
9651,
18031,
29918,
2344,
29918,
12276,
353,
1236,
29889,
4247,
29898,
1469,
29903,
682,
29898,
3188,
29918,
12322,
29922,
710,
29898,
4905,
29918,
3972,
29889,
3560,
8243,
13,
462,
1678,
1024,
543,
6289,
29918,
2344,
29918,
12276,
1159,
13,
9651,
281,
29888,
29889,
6915,
29898,
13,
18884,
2069,
29918,
12276,
29892,
376,
449,
29918,
12276,
613,
13,
18884,
18031,
29918,
2344,
29918,
12276,
29892,
285,
29908,
29912,
4905,
29918,
3972,
29889,
978,
1836,
29992,
2344,
29918,
12276,
29908,
13,
9651,
1723,
13,
1678,
736,
281,
29888,
13,
13,
13,
1753,
903,
7323,
29898,
262,
29918,
5325,
1125,
13,
1678,
565,
338,
8758,
29898,
262,
29918,
5325,
29892,
313,
1761,
29892,
18761,
22164,
13,
4706,
736,
297,
29918,
5325,
29961,
29900,
29962,
13,
1678,
736,
297,
29918,
5325,
13,
13,
13,
1753,
903,
5824,
572,
457,
29918,
19244,
29898,
262,
29918,
1445,
29892,
26325,
886,
7607,
29906,
29900,
29892,
29871,
29906,
29900,
29892,
29871,
29906,
29900,
22164,
13,
1678,
1053,
12655,
408,
7442,
13,
1678,
1053,
302,
747,
1107,
408,
302,
29890,
13,
13,
1678,
10153,
353,
302,
29890,
29889,
1359,
29898,
262,
29918,
1445,
29897,
13,
1678,
15834,
353,
313,
9302,
29889,
2378,
29898,
2492,
29889,
12181,
7503,
29941,
2314,
448,
29871,
29896,
29897,
334,
10153,
29889,
6672,
29889,
657,
29918,
2502,
4835,
580,
7503,
29941,
29962,
13,
1678,
3240,
791,
353,
518,
29888,
29908,
29912,
29894,
5038,
363,
325,
297,
7442,
29889,
27696,
29898,
1062,
296,
847,
7442,
29889,
2378,
29898,
1028,
562,
886,
8106,
579,
668,
29898,
524,
4638,
13,
1678,
736,
285,
29908,
29899,
29890,
11117,
29916,
4286,
7122,
29898,
2267,
791,
2915,
29908,
13,
2
] |
packages/w3af/w3af/core/controllers/tests/core_test_suite/test_exception_handler.py | ZooAtmosphereGroup/HelloPackages | 3 | 92709 | <gh_stars>1-10
"""
test_exception_handling.py
Copyright 2011 <NAME>
This file is part of w3af, http://w3af.org/ .
w3af is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 2 of the License.
w3af is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with w3af; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
"""
from w3af.core.controllers.tests.core_test_suite.test_pause_stop import CountTestMixin
class TestExceptionHandler(CountTestMixin):
"""
Inherit from TestW3afCorePause to get the nice setUp().
"""
def test_same_id(self):
"""
Verify that the exception handler is the same before and after the scan
"""
before_id_ehandler = id(self.w3afcore.exception_handler)
self.w3afcore.start()
after_id_ehandler = id(self.w3afcore.exception_handler)
self.assertEqual(before_id_ehandler, after_id_ehandler) | [
1,
529,
12443,
29918,
303,
1503,
29958,
29896,
29899,
29896,
29900,
13,
15945,
29908,
13,
1688,
29918,
11739,
29918,
3179,
1847,
29889,
2272,
13,
13,
11882,
1266,
29871,
29906,
29900,
29896,
29896,
529,
5813,
29958,
13,
13,
4013,
934,
338,
760,
310,
281,
29941,
2142,
29892,
1732,
597,
29893,
29941,
2142,
29889,
990,
29914,
869,
13,
13,
29893,
29941,
2142,
338,
3889,
7047,
29936,
366,
508,
2654,
391,
2666,
372,
322,
29914,
272,
6623,
13,
277,
1090,
278,
4958,
310,
278,
15143,
4593,
5236,
19245,
408,
6369,
491,
13,
1552,
12362,
18540,
10606,
1873,
29871,
29906,
310,
278,
19245,
29889,
13,
13,
29893,
29941,
2142,
338,
13235,
297,
278,
4966,
393,
372,
674,
367,
5407,
29892,
13,
4187,
399,
1806,
8187,
2692,
13764,
29979,
399,
1718,
29934,
13566,
29979,
29936,
1728,
1584,
278,
2411,
2957,
1370,
21867,
29891,
310,
13,
29924,
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,
13,
29954,
11601,
4593,
5236,
19245,
363,
901,
4902,
29889,
13,
13,
3492,
881,
505,
4520,
263,
3509,
310,
278,
15143,
4593,
5236,
19245,
13,
284,
549,
411,
281,
29941,
2142,
29936,
565,
451,
29892,
2436,
304,
278,
12362,
18540,
13,
28077,
29892,
9266,
1696,
29871,
29945,
29896,
21504,
624,
29892,
29008,
386,
383,
10102,
29892,
12115,
29892,
14861,
259,
29900,
29906,
29896,
29896,
29900,
29899,
29896,
29941,
29900,
29896,
29871,
8278,
13,
15945,
29908,
13,
3166,
281,
29941,
2142,
29889,
3221,
29889,
1285,
11897,
29889,
21150,
29889,
3221,
29918,
1688,
29918,
13495,
29889,
1688,
29918,
29886,
1071,
29918,
9847,
1053,
3917,
3057,
29924,
861,
262,
13,
13,
13,
1990,
4321,
2451,
4598,
29898,
3981,
3057,
29924,
861,
262,
1125,
13,
1678,
9995,
13,
1678,
512,
27069,
515,
4321,
29956,
29941,
2142,
9203,
29925,
1071,
304,
679,
278,
7575,
731,
3373,
2141,
13,
1678,
9995,
13,
1678,
822,
1243,
29918,
17642,
29918,
333,
29898,
1311,
1125,
13,
4706,
9995,
13,
4706,
1798,
1598,
393,
278,
3682,
7834,
338,
278,
1021,
1434,
322,
1156,
278,
12812,
13,
4706,
9995,
13,
4706,
1434,
29918,
333,
29918,
29872,
13789,
353,
1178,
29898,
1311,
29889,
29893,
29941,
2142,
3221,
29889,
11739,
29918,
13789,
29897,
13,
308,
13,
4706,
1583,
29889,
29893,
29941,
2142,
3221,
29889,
2962,
580,
13,
308,
13,
4706,
1156,
29918,
333,
29918,
29872,
13789,
353,
1178,
29898,
1311,
29889,
29893,
29941,
2142,
3221,
29889,
11739,
29918,
13789,
29897,
13,
308,
13,
4706,
1583,
29889,
9294,
9843,
29898,
11083,
29918,
333,
29918,
29872,
13789,
29892,
1156,
29918,
333,
29918,
29872,
13789,
29897,
2
] |
imports.py | MarcusTL12/PyCalc | 0 | 119831 | import sys
sys.path.append('./PyScr/')
import numpy as np
import matplotlib.pyplot as plt
import cmath
import math
import copy
import pfprint
import primefac
from scipy.special import comb as choose
_ = None
def ppprint(arg):
global _
pfprint.pfprint(arg)
_ = arg
def frac():
pfprint.frac = not pfprint.frac
return _
def denom_lim(n):
pfprint.denom_lim = n
def num_dec(n):
pfprint.num_dec = n
def pltclr():
plt.cla()
plt.clf()
plt.close()
def fact(n):
return math.factorial(n)
def primesS(n):
return primefac.primes_to_string(primefac.primes(n))
def primes(n):
return primefac.primes(n)
sys.displayhook = ppprint
pi = np.pi
e = np.exp(1)
sqrt = np.sqrt
predef_globals = len(globals()) + 1
def loc():
return dict(list(globals().items())[predef_globals:])
| [
1,
1053,
10876,
13,
9675,
29889,
2084,
29889,
4397,
877,
6904,
19737,
4421,
29878,
29914,
1495,
13,
5215,
12655,
408,
7442,
13,
5215,
22889,
29889,
2272,
5317,
408,
14770,
13,
5215,
274,
755,
13,
5215,
5844,
13,
5215,
3509,
13,
5215,
282,
29888,
2158,
13,
5215,
6019,
17470,
13,
3166,
4560,
2272,
29889,
18732,
1053,
4145,
408,
6755,
13,
13,
29918,
353,
6213,
13,
13,
1753,
282,
407,
29878,
524,
29898,
1191,
1125,
13,
12,
10945,
903,
13,
12,
7810,
2158,
29889,
7810,
2158,
29898,
1191,
29897,
13,
12,
29918,
353,
1852,
13,
13,
1753,
285,
945,
7295,
13,
12,
7810,
2158,
29889,
1154,
353,
451,
282,
29888,
2158,
29889,
1154,
13,
12,
2457,
903,
13,
13,
1753,
972,
290,
29918,
2576,
29898,
29876,
1125,
13,
12,
7810,
2158,
29889,
1145,
290,
29918,
2576,
353,
302,
13,
13,
1753,
954,
29918,
7099,
29898,
29876,
1125,
13,
12,
7810,
2158,
29889,
1949,
29918,
7099,
353,
302,
13,
13,
1753,
14770,
695,
29878,
7295,
13,
12,
572,
29873,
29889,
16398,
580,
13,
12,
572,
29873,
29889,
695,
29888,
580,
13,
12,
572,
29873,
29889,
5358,
580,
13,
13,
1753,
2114,
29898,
29876,
1125,
13,
12,
2457,
5844,
29889,
19790,
616,
29898,
29876,
29897,
13,
13,
1753,
544,
1355,
29903,
29898,
29876,
1125,
13,
12,
2457,
6019,
17470,
29889,
558,
1355,
29918,
517,
29918,
1807,
29898,
10080,
17470,
29889,
558,
1355,
29898,
29876,
876,
13,
13,
1753,
544,
1355,
29898,
29876,
1125,
13,
12,
2457,
6019,
17470,
29889,
558,
1355,
29898,
29876,
29897,
13,
13,
9675,
29889,
4990,
20849,
353,
282,
407,
29878,
524,
13,
13,
1631,
353,
7442,
29889,
1631,
13,
29872,
353,
7442,
29889,
4548,
29898,
29896,
29897,
13,
3676,
353,
7442,
29889,
3676,
13,
13,
1457,
1753,
29918,
23705,
1338,
353,
7431,
29898,
23705,
1338,
3101,
718,
29871,
29896,
13,
1753,
1180,
7295,
13,
12,
2457,
9657,
29898,
1761,
29898,
23705,
1338,
2141,
7076,
3101,
29961,
1457,
1753,
29918,
23705,
1338,
29901,
2314,
13,
2
] |
trompace/mutations/__init__.py | trompamusic/ce-queries-template | 1 | 8306 | MUTATION = '''mutation {{
{mutation}
}}'''
def _verify_additional_type(additionaltype):
"""Check that the input to additionaltype is a list of strings.
If it is empty, raise ValueError
If it is a string, convert it to a list of strings."""
if additionaltype is None:
return None
if isinstance(additionaltype, str):
additionaltype = [additionaltype]
if len(additionaltype) == 0:
raise ValueError("additionaltype must be a non-empty list")
return additionaltype
| [
1,
341,
2692,
8098,
353,
14550,
6149,
362,
8620,
13,
29871,
426,
6149,
362,
29913,
13,
930,
12008,
13,
13,
13,
1753,
903,
27902,
29918,
1202,
3245,
29918,
1853,
29898,
1202,
3245,
1853,
1125,
13,
1678,
9995,
5596,
393,
278,
1881,
304,
5684,
1853,
338,
263,
1051,
310,
6031,
29889,
13,
1678,
960,
372,
338,
4069,
29892,
12020,
7865,
2392,
13,
1678,
960,
372,
338,
263,
1347,
29892,
3588,
372,
304,
263,
1051,
310,
6031,
1213,
15945,
13,
1678,
565,
5684,
1853,
338,
6213,
29901,
13,
4706,
736,
6213,
13,
13,
1678,
565,
338,
8758,
29898,
1202,
3245,
1853,
29892,
851,
1125,
13,
4706,
5684,
1853,
353,
518,
1202,
3245,
1853,
29962,
13,
1678,
565,
7431,
29898,
1202,
3245,
1853,
29897,
1275,
29871,
29900,
29901,
13,
4706,
12020,
7865,
2392,
703,
1202,
3245,
1853,
1818,
367,
263,
1661,
29899,
6310,
1051,
1159,
13,
1678,
736,
5684,
1853,
13,
2
] |
nodux_stock_one/config/nodux_stock_one.py | tatiqm25/nodux_stock_one | 0 | 89714 | from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"label": _("Reporte Stock"),
"icon": "fa fa-star",
"items": [
{
"type": "report",
"name": "Stock",
"doctype": "Stock One",
"is_query_report": True
}
]
}
]
| [
1,
515,
4770,
29888,
9130,
1649,
1053,
29104,
29918,
20889,
1338,
13,
3166,
5227,
4798,
1053,
903,
13,
13,
1753,
679,
29918,
1272,
7295,
13,
12,
2457,
518,
13,
12,
12,
29912,
13,
12,
12,
12,
29908,
1643,
1115,
903,
703,
5612,
10069,
10224,
4968,
13,
12,
12,
12,
29908,
4144,
1115,
376,
5444,
2258,
29899,
8508,
613,
13,
12,
12,
12,
29908,
7076,
1115,
518,
13,
12,
12,
12,
12,
29912,
13,
12,
12,
12,
12,
12,
29908,
1853,
1115,
376,
12276,
613,
13,
12,
12,
12,
12,
12,
29908,
978,
1115,
376,
20754,
384,
613,
13,
12,
12,
12,
12,
12,
29908,
1867,
312,
668,
1115,
376,
20754,
384,
3118,
613,
13,
12,
12,
12,
12,
12,
29908,
275,
29918,
1972,
29918,
12276,
1115,
5852,
13,
12,
12,
12,
12,
29913,
13,
12,
12,
12,
29962,
13,
12,
12,
29913,
13,
12,
29962,
13,
2
] |
ai_haste/loss/log_squared_loss.py | aidotse/Team-Haste | 0 | 107857 | <reponame>aidotse/Team-Haste
import torch
import torch.nn as nn
import torch.nn.functional as F
class LogSquaredLoss(nn.Module):
def __init__(self,):
super(LogSquaredLoss, self).__init__()
self.l1 = nn.L1Loss()
self.eps = 1e-8
def forward(self, output, target):
# output = torch.log((output) + self.eps)
# target = torch.log((target) + self.eps)
# loss = self.l1(target, output)
loss = torch.log(torch.div(((target) + self.eps), ((output) + self.eps)))
loss = (loss ** 2).mean()
return loss
| [
1,
529,
276,
1112,
420,
29958,
29874,
333,
327,
344,
29914,
19409,
29899,
29950,
4350,
13,
5215,
4842,
305,
13,
5215,
4842,
305,
29889,
15755,
408,
302,
29876,
13,
5215,
4842,
305,
29889,
15755,
29889,
2220,
284,
408,
383,
13,
13,
13,
1990,
4522,
29903,
339,
1965,
29931,
2209,
29898,
15755,
29889,
7355,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1125,
13,
4706,
2428,
29898,
3403,
29903,
339,
1965,
29931,
2209,
29892,
1583,
467,
1649,
2344,
1649,
580,
13,
4706,
1583,
29889,
29880,
29896,
353,
302,
29876,
29889,
29931,
29896,
29931,
2209,
580,
13,
4706,
1583,
29889,
8961,
353,
29871,
29896,
29872,
29899,
29947,
13,
13,
1678,
822,
6375,
29898,
1311,
29892,
1962,
29892,
3646,
1125,
13,
4706,
396,
1962,
353,
4842,
305,
29889,
1188,
3552,
4905,
29897,
718,
1583,
29889,
8961,
29897,
13,
4706,
396,
3646,
353,
4842,
305,
29889,
1188,
3552,
5182,
29897,
718,
1583,
29889,
8961,
29897,
13,
4706,
396,
6410,
353,
1583,
29889,
29880,
29896,
29898,
5182,
29892,
1962,
29897,
13,
4706,
6410,
353,
4842,
305,
29889,
1188,
29898,
7345,
305,
29889,
4563,
3552,
29898,
5182,
29897,
718,
1583,
29889,
8961,
511,
5135,
4905,
29897,
718,
1583,
29889,
8961,
4961,
13,
4706,
6410,
353,
313,
6758,
3579,
29871,
29906,
467,
12676,
580,
13,
4706,
736,
6410,
13,
2
] |
pymf6/tests/test_bool.py | hydrocomputing/pymf6 | 4 | 171382 | #!/usr/bin/env python
"""Simple callback test
"""
from pymf6.callback import Func
from pymf6 import mf6
class MyFunc(Func):
# pylint: disable=too-few-public-methods
"""
Callback
"""
def __init__(self, stop=2, verbose=False):
super().__init__(verbose=verbose)
self.stop = stop
def __call__(self):
super().__call__()
print(f'>>> Python: Called {self.counter} times')
if self.counter >= self.stop:
print(f'Stopping from Python after {self.stop} time steps.')
self.set_value('ENDOFSIMULATION', 'TDIS', True)
if __name__ == '__main__':
mf6.mf6_sub(MyFunc(verbose=True))
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
13,
13,
15945,
29908,
15427,
6939,
1243,
13,
15945,
29908,
13,
13,
13,
3166,
282,
962,
29888,
29953,
29889,
14035,
1053,
383,
4661,
13,
3166,
282,
962,
29888,
29953,
1053,
286,
29888,
29953,
13,
13,
13,
1990,
1619,
14400,
29898,
14400,
1125,
13,
1678,
396,
282,
2904,
524,
29901,
11262,
29922,
517,
29877,
29899,
29888,
809,
29899,
3597,
29899,
23515,
13,
1678,
9995,
13,
1678,
8251,
1627,
13,
1678,
9995,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
5040,
29922,
29906,
29892,
26952,
29922,
8824,
1125,
13,
4706,
2428,
2141,
1649,
2344,
12035,
369,
15828,
29922,
369,
15828,
29897,
13,
4706,
1583,
29889,
9847,
353,
5040,
13,
13,
1678,
822,
4770,
4804,
12035,
1311,
1125,
13,
4706,
2428,
2141,
1649,
4804,
1649,
580,
13,
4706,
1596,
29898,
29888,
29915,
6778,
29958,
5132,
29901,
3037,
839,
426,
1311,
29889,
11808,
29913,
3064,
1495,
13,
4706,
565,
1583,
29889,
11808,
6736,
1583,
29889,
9847,
29901,
13,
9651,
1596,
29898,
29888,
29915,
20754,
3262,
515,
5132,
1156,
426,
1311,
29889,
9847,
29913,
931,
6576,
29889,
1495,
13,
9651,
1583,
29889,
842,
29918,
1767,
877,
1430,
3970,
29943,
5425,
29924,
13309,
8098,
742,
525,
29911,
23711,
742,
5852,
29897,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
286,
29888,
29953,
29889,
29885,
29888,
29953,
29918,
1491,
29898,
3421,
14400,
29898,
369,
15828,
29922,
5574,
876,
13,
2
] |
src/main/resources/pytz/zoneinfo/America/Panama.py | TheEin/swagger-maven-plugin | 65 | 60898 | '''tzinfo timezone information for America/Panama.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Panama(DstTzInfo):
'''America/Panama timezone definition. See datetime.tzinfo for details'''
zone = 'America/Panama'
_utc_transition_times = [
d(1,1,1,0,0,0),
d(1908,4,22,5,19,36),
]
_transition_info = [
i(-19200,0,'CMT'),
i(-18000,0,'EST'),
]
Panama = Panama()
| [
1,
14550,
17559,
3888,
29431,
2472,
363,
6813,
29914,
23684,
3304,
29889,
12008,
13,
3166,
282,
3637,
29920,
29889,
17559,
3888,
1053,
360,
303,
29911,
29920,
3401,
13,
3166,
282,
3637,
29920,
29889,
17559,
3888,
1053,
26959,
1891,
29918,
12673,
408,
270,
13,
3166,
282,
3637,
29920,
29889,
17559,
3888,
1053,
26959,
1891,
29918,
698,
3888,
408,
474,
13,
13,
1990,
6518,
3304,
29898,
29928,
303,
29911,
29920,
3401,
1125,
13,
1678,
14550,
29048,
29914,
23684,
3304,
29431,
5023,
29889,
2823,
12865,
29889,
17559,
3888,
363,
4902,
12008,
13,
13,
1678,
10640,
353,
525,
29048,
29914,
23684,
3304,
29915,
13,
13,
1678,
903,
329,
29883,
29918,
20543,
29918,
3706,
353,
518,
13,
29881,
29898,
29896,
29892,
29896,
29892,
29896,
29892,
29900,
29892,
29900,
29892,
29900,
511,
13,
29881,
29898,
29896,
29929,
29900,
29947,
29892,
29946,
29892,
29906,
29906,
29892,
29945,
29892,
29896,
29929,
29892,
29941,
29953,
511,
13,
4706,
4514,
13,
13,
1678,
903,
20543,
29918,
3888,
353,
518,
13,
29875,
6278,
29896,
29929,
29906,
29900,
29900,
29892,
29900,
5501,
29907,
11490,
5477,
13,
29875,
6278,
29896,
29947,
29900,
29900,
29900,
29892,
29900,
5501,
29923,
1254,
5477,
13,
4706,
4514,
13,
13,
23684,
3304,
353,
6518,
3304,
580,
13,
13,
2
] |
python/generated/swaggeraem/apis/__init__.py | mbloch1986/swagger-aem | 0 | 104970 | from __future__ import absolute_import
# import apis into api package
from .console_api import ConsoleApi
from .cq_api import CqApi
from .crx_api import CrxApi
from .custom_api import CustomApi
from .sling_api import SlingApi
| [
1,
515,
4770,
29888,
9130,
1649,
1053,
8380,
29918,
5215,
13,
13,
29937,
1053,
3095,
275,
964,
7882,
3577,
13,
3166,
869,
11058,
29918,
2754,
1053,
9405,
11713,
13,
3166,
869,
29883,
29939,
29918,
2754,
1053,
315,
29939,
11713,
13,
3166,
869,
7283,
29916,
29918,
2754,
1053,
6781,
29916,
11713,
13,
3166,
869,
6341,
29918,
2754,
1053,
8701,
11713,
13,
3166,
869,
29879,
1847,
29918,
2754,
1053,
317,
1847,
11713,
13,
2
] |
setup.py | edyatl/passchek | 5 | 163446 | #!/usr/bin/env python3
import setuptools
from passchek.passchek import __version__
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="passchek",
version=__version__,
license="MIT",
author="<NAME>",
author_email="<EMAIL>",
description="Passchek is a simple cli tool, checks if your password has been compromised.",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/edyatl/passchek",
packages=setuptools.find_packages(),
include_package_data=True,
entry_points={
"console_scripts": [
"passchek=passchek.passchek:main",
]
},
keywords=[
"passchek", "password", "pwned",
"troyhunt", "github", "k-anonymity",
"interactive", "console", "sha1",
"pwnedpassword", "versions",
"virtualenv"
],
classifiers=[
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Environment :: Console",
"License :: OSI Approved :: MIT License",
"Operating System :: POSIX",
"Intended Audience :: End Users/Desktop",
"Topic :: Utilities",
],
python_requires='>=3.5',
)
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
29941,
13,
5215,
731,
21245,
8789,
13,
13,
3166,
1209,
1173,
29895,
29889,
3364,
1173,
29895,
1053,
4770,
3259,
1649,
13,
13,
2541,
1722,
703,
16310,
2303,
29889,
3487,
613,
376,
29878,
1159,
408,
285,
29882,
29901,
13,
1678,
1472,
29918,
8216,
353,
285,
29882,
29889,
949,
580,
13,
13,
842,
21245,
8789,
29889,
14669,
29898,
13,
1678,
1024,
543,
3364,
1173,
29895,
613,
13,
1678,
1873,
29922,
1649,
3259,
1649,
29892,
13,
1678,
19405,
543,
26349,
613,
13,
1678,
4148,
543,
29966,
5813,
28341,
13,
1678,
4148,
29918,
5269,
543,
29966,
26862,
6227,
28341,
13,
1678,
6139,
543,
7129,
1173,
29895,
338,
263,
2560,
9335,
5780,
29892,
12747,
565,
596,
4800,
756,
1063,
19632,
3368,
19602,
13,
1678,
1472,
29918,
8216,
29922,
5426,
29918,
8216,
29892,
13,
1678,
1472,
29918,
8216,
29918,
3051,
29918,
1853,
543,
726,
29914,
3502,
3204,
613,
13,
1678,
3142,
543,
991,
597,
3292,
29889,
510,
29914,
7584,
271,
29880,
29914,
3364,
1173,
29895,
613,
13,
1678,
9741,
29922,
842,
21245,
8789,
29889,
2886,
29918,
8318,
3285,
13,
1678,
3160,
29918,
5113,
29918,
1272,
29922,
5574,
29892,
13,
13,
1678,
6251,
29918,
9748,
3790,
13,
4706,
376,
11058,
29918,
16713,
1115,
518,
13,
9651,
376,
3364,
1173,
29895,
29922,
3364,
1173,
29895,
29889,
3364,
1173,
29895,
29901,
3396,
613,
13,
4706,
4514,
13,
1678,
2981,
13,
13,
1678,
29361,
11759,
13,
4706,
376,
3364,
1173,
29895,
613,
376,
5630,
613,
376,
29886,
1233,
287,
613,
13,
4706,
376,
29873,
4727,
29882,
1657,
613,
376,
3292,
613,
376,
29895,
29899,
273,
4735,
537,
613,
13,
4706,
376,
1639,
4925,
613,
376,
11058,
613,
376,
17051,
29896,
613,
13,
4706,
376,
29886,
1233,
287,
5630,
613,
376,
26100,
613,
13,
4706,
376,
18714,
6272,
29908,
13,
1678,
21251,
13,
1678,
770,
14903,
11759,
13,
4706,
376,
9283,
4056,
17088,
4761,
5132,
4761,
29871,
29941,
613,
13,
4706,
376,
9283,
4056,
17088,
4761,
5132,
4761,
29871,
29941,
29889,
29945,
613,
13,
4706,
376,
9283,
4056,
17088,
4761,
5132,
4761,
29871,
29941,
29889,
29953,
613,
13,
4706,
376,
18649,
4761,
9405,
613,
13,
4706,
376,
29931,
293,
1947,
4761,
438,
5425,
28268,
1490,
4761,
341,
1806,
19245,
613,
13,
4706,
376,
7094,
1218,
2184,
4761,
349,
3267,
6415,
613,
13,
4706,
376,
2928,
2760,
319,
4749,
663,
4761,
2796,
23861,
29914,
17600,
613,
13,
4706,
376,
7031,
293,
4761,
22310,
1907,
613,
13,
1678,
21251,
13,
1678,
3017,
29918,
276,
339,
2658,
2433,
18572,
29941,
29889,
29945,
742,
13,
29897,
13,
2
] |
conftest.py | Casecommons/sentry | 0 | 1608557 | <gh_stars>0
from django.conf import settings
import mock
import os
import os.path
def pytest_configure(config):
import warnings
warnings.filterwarnings('error', '', Warning, r'(sentry|raven)')
if not settings.configured:
os.environ['DJANGO_SETTINGS_MODULE'] = 'sentry.conf.server'
test_db = os.environ.get('DB', 'sqlite')
if test_db == 'mysql':
settings.DATABASES['default'].update({
'ENGINE': 'django.db.backends.mysql',
'NAME': 'sentry',
'USER': 'root',
})
elif test_db == 'postgres':
settings.DATABASES['default'].update({
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'USER': 'postgres',
'NAME': 'sentry',
'OPTIONS': {
'autocommit': True,
}
})
elif test_db == 'sqlite':
settings.DATABASES['default'].update({
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
})
# http://djangosnippets.org/snippets/646/
class InvalidVarException(object):
def __mod__(self, missing):
try:
missing_str = unicode(missing)
except:
missing_str = 'Failed to create string representation'
raise Exception('Unknown template variable %r %s' % (missing, missing_str))
def __contains__(self, search):
if search == '%s':
return True
return False
settings.TEMPLATE_DEBUG = True
# settings.TEMPLATE_STRING_IF_INVALID = InvalidVarException()
# Disable static compiling in tests
settings.STATIC_BUNDLES = {}
# override a few things with our test specifics
settings.INSTALLED_APPS = tuple(settings.INSTALLED_APPS) + (
'tests',
)
# Need a predictable key for tests that involve checking signatures
settings.SENTRY_KEY = 'abc123'
settings.SENTRY_PUBLIC = False
# This speeds up the tests considerably, pbkdf2 is by design, slow.
settings.PASSWORD_HASHERS = [
'django.contrib.auth.hashers.MD5PasswordHasher',
]
# enable draft features
settings.SENTRY_ENABLE_EXPLORE_CODE = True
settings.SENTRY_ENABLE_EXPLORE_USERS = True
settings.SENTRY_ENABLE_EMAIL_REPLIES = True
settings.SENTRY_ALLOW_ORIGIN = '*'
# django mail uses socket.getfqdn which doesnt play nice if our
# networking isnt stable
patcher = mock.patch('socket.getfqdn', return_value='localhost')
patcher.start()
from sentry.utils.runner import initialize_receivers
initialize_receivers()
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
3166,
9557,
29889,
5527,
1053,
6055,
13,
5215,
11187,
13,
5215,
2897,
13,
5215,
2897,
29889,
2084,
13,
13,
13,
1753,
11451,
1688,
29918,
17591,
29898,
2917,
1125,
13,
1678,
1053,
18116,
13,
1678,
18116,
29889,
4572,
25442,
886,
877,
2704,
742,
15516,
24412,
29892,
364,
12215,
29879,
8269,
29989,
336,
854,
29897,
1495,
13,
13,
1678,
565,
451,
6055,
29889,
2917,
2955,
29901,
13,
4706,
2897,
29889,
21813,
1839,
29928,
29967,
2190,
17080,
29918,
10490,
29911,
4214,
29903,
29918,
6720,
14849,
1307,
2033,
353,
525,
29879,
8269,
29889,
5527,
29889,
2974,
29915,
13,
13,
1678,
1243,
29918,
2585,
353,
2897,
29889,
21813,
29889,
657,
877,
4051,
742,
525,
22793,
1495,
13,
1678,
565,
1243,
29918,
2585,
1275,
525,
7938,
2396,
13,
4706,
6055,
29889,
25832,
27982,
29903,
1839,
4381,
13359,
5504,
3319,
13,
9651,
525,
1430,
29954,
8895,
2396,
525,
14095,
29889,
2585,
29889,
1627,
1975,
29889,
7938,
742,
13,
9651,
525,
5813,
2396,
525,
29879,
8269,
742,
13,
9651,
525,
11889,
2396,
525,
4632,
742,
13,
4706,
5615,
13,
1678,
25342,
1243,
29918,
2585,
1275,
525,
2490,
7201,
2396,
13,
4706,
6055,
29889,
25832,
27982,
29903,
1839,
4381,
13359,
5504,
3319,
13,
9651,
525,
1430,
29954,
8895,
2396,
525,
14095,
29889,
2585,
29889,
1627,
1975,
29889,
29272,
29918,
567,
29891,
9708,
29887,
29906,
742,
13,
9651,
525,
11889,
2396,
525,
2490,
7201,
742,
13,
9651,
525,
5813,
2396,
525,
29879,
8269,
742,
13,
9651,
525,
14094,
27946,
2396,
426,
13,
18884,
525,
6921,
15060,
2396,
5852,
29892,
13,
9651,
500,
13,
4706,
5615,
13,
1678,
25342,
1243,
29918,
2585,
1275,
525,
22793,
2396,
13,
4706,
6055,
29889,
25832,
27982,
29903,
1839,
4381,
13359,
5504,
3319,
13,
9651,
525,
1430,
29954,
8895,
2396,
525,
14095,
29889,
2585,
29889,
1627,
1975,
29889,
22793,
29941,
742,
13,
9651,
525,
5813,
2396,
525,
29901,
14834,
29901,
742,
13,
4706,
5615,
13,
13,
1678,
396,
1732,
597,
19776,
574,
359,
1240,
27421,
29889,
990,
29914,
29879,
1240,
27421,
29914,
29953,
29946,
29953,
29914,
13,
1678,
770,
21403,
9037,
2451,
29898,
3318,
1125,
13,
4706,
822,
4770,
1545,
12035,
1311,
29892,
4567,
1125,
13,
9651,
1018,
29901,
13,
18884,
4567,
29918,
710,
353,
29104,
29898,
27259,
29897,
13,
9651,
5174,
29901,
13,
18884,
4567,
29918,
710,
353,
525,
17776,
304,
1653,
1347,
8954,
29915,
13,
9651,
12020,
8960,
877,
14148,
4472,
2286,
1273,
29878,
1273,
29879,
29915,
1273,
313,
27259,
29892,
4567,
29918,
710,
876,
13,
13,
4706,
822,
4770,
11516,
12035,
1311,
29892,
2740,
1125,
13,
9651,
565,
2740,
1275,
14210,
29879,
2396,
13,
18884,
736,
5852,
13,
9651,
736,
7700,
13,
13,
1678,
6055,
29889,
4330,
3580,
29931,
3040,
29918,
18525,
353,
5852,
13,
1678,
396,
6055,
29889,
4330,
3580,
29931,
3040,
29918,
20785,
29918,
6545,
29918,
1177,
26707,
353,
21403,
9037,
2451,
580,
13,
13,
1678,
396,
3295,
519,
2294,
22520,
297,
6987,
13,
1678,
6055,
29889,
17816,
2965,
29918,
7838,
2797,
17101,
353,
6571,
13,
13,
1678,
396,
5712,
263,
2846,
2712,
411,
1749,
1243,
2702,
29879,
13,
1678,
6055,
29889,
25580,
1964,
20566,
29918,
3301,
7024,
353,
18761,
29898,
11027,
29889,
25580,
1964,
20566,
29918,
3301,
7024,
29897,
718,
313,
13,
4706,
525,
21150,
742,
13,
1678,
1723,
13,
1678,
396,
20768,
263,
8500,
519,
1820,
363,
6987,
393,
25135,
8454,
1804,
3698,
13,
1678,
6055,
29889,
29903,
3919,
13207,
29918,
10818,
353,
525,
10736,
29896,
29906,
29941,
29915,
13,
1678,
6055,
29889,
29903,
3919,
13207,
29918,
7056,
13367,
2965,
353,
7700,
13,
1678,
396,
910,
961,
5779,
701,
278,
6987,
2050,
2197,
29892,
282,
29890,
29895,
2176,
29906,
338,
491,
2874,
29892,
5232,
29889,
13,
1678,
6055,
29889,
25711,
17013,
29918,
29950,
3289,
4448,
29903,
353,
518,
13,
4706,
525,
14095,
29889,
21570,
29889,
5150,
29889,
8568,
414,
29889,
5773,
29945,
10048,
10438,
261,
742,
13,
1678,
4514,
13,
13,
1678,
396,
9025,
18195,
5680,
13,
1678,
6055,
29889,
29903,
3919,
13207,
29918,
1430,
6181,
29918,
5746,
29925,
3927,
1525,
29918,
16524,
353,
5852,
13,
1678,
6055,
29889,
29903,
3919,
13207,
29918,
1430,
6181,
29918,
5746,
29925,
3927,
1525,
29918,
11889,
29903,
353,
5852,
13,
1678,
6055,
29889,
29903,
3919,
13207,
29918,
1430,
6181,
29918,
26862,
6227,
29918,
1525,
29925,
5265,
2890,
353,
5852,
13,
13,
1678,
6055,
29889,
29903,
3919,
13207,
29918,
1964,
27998,
29918,
1955,
6259,
1177,
353,
525,
29930,
29915,
13,
13,
1678,
396,
9557,
10524,
3913,
9909,
29889,
657,
29888,
29939,
5200,
607,
19403,
1708,
7575,
565,
1749,
13,
1678,
396,
28127,
338,
593,
13714,
13,
1678,
13261,
261,
353,
11187,
29889,
5041,
877,
11514,
29889,
657,
29888,
29939,
5200,
742,
736,
29918,
1767,
2433,
7640,
1495,
13,
1678,
13261,
261,
29889,
2962,
580,
13,
13,
1678,
515,
2665,
719,
29889,
13239,
29889,
27492,
1053,
11905,
29918,
13556,
1536,
13,
1678,
11905,
29918,
13556,
1536,
580,
13,
2
] |
tensorflow_hub/saved_model_module.py | hrishikeshmane/hub | 2 | 1615221 | # Copyright 2018 The TensorFlow Hub Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Implementation of deprecated hub.Module that loads raw TF1 SavedModels."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow_hub import native_module
from tensorflow_hub import saved_model_lib
from tensorflow_hub import tf_v1
_ALWAYS_DROPPED_COLLECTIONS = [
# SavedModels exported from estimator framework typically contain a
# collection with the variable that holds the global training step.
#
# This collection is ignored when loading it as a module. However the
# variable that contains the step would still be brought in if declared
# in the VARIABLES collection.
tf_v1.GraphKeys.GLOBAL_STEP,
# SavedModels exported for serving use cases contain collections which refer
# to ops in the graph that when run are responsible to initialize the
# session for subsequent signature executions.
#
# This generic initialization definition is impossible to support for many
# hub use cases and therefore the assumption here is that the SavedModel
# init op can be ignored in favor of initializing using the
# tf.train.MonitoredSession mechanisms + construction of a new tf.Saver()
# from the global variables collection.
tf_v1.saved_model.constants.LEGACY_INIT_OP_KEY,
tf_v1.saved_model.constants.MAIN_OP_KEY,
]
def _drop_collections(saved_model_handler, collections):
for meta_graph in saved_model_handler.meta_graphs:
for collection in collections:
if collection in meta_graph.collection_def:
del meta_graph.collection_def[collection]
def create_module_spec_from_saved_model(saved_model_path,
drop_collections=None):
"""Experimental: Create a ModuleSpec out of a SavedModel from TF1.
DEPRECATION NOTE: This belongs to the hub.Module API and file format for TF1.
For TF2, TensorFlow Hub ships plain SavedModels, removing the need for
conversions like this.
Define a ModuleSpec from a SavedModel. Note that this is not guaranteed to
work in all cases and it assumes the SavedModel has followed some conventions:
- The serialized SaverDef can be ignored and instead can be reconstructed.
- The init op and main op can be ignored and instead the module can be
initialized by using the conventions followed by
`tf.train.MonitoredSession`.
Note that the set of features supported can increase over time and have side
effects that were not previously visible. The pattern followed to avoid
surprises is forcing users to declare which features to ignore (even
if they are not supported).
Note that this function creates a ModuleSpec that when exported exports a
Module (based on a modified copy of the original SavedModel) and not a
SavedModel.
Args:
saved_model_path: Directory with the SavedModel to use.
drop_collections: Additionally list of collection to drop.
Returns:
A ModuleSpec.
"""
saved_model_handler = saved_model_lib.load(saved_model_path)
checkpoint_filename = saved_model_lib.get_variables_path(saved_model_path)
drop_collections = (set(_ALWAYS_DROPPED_COLLECTIONS) |
(set(drop_collections) if drop_collections else set()))
_drop_collections(saved_model_handler, drop_collections)
return native_module._ModuleSpec(saved_model_handler, checkpoint_filename) # pylint: disable=protected-access
| [
1,
396,
14187,
1266,
29871,
29906,
29900,
29896,
29947,
450,
323,
6073,
17907,
14533,
13189,
943,
29889,
2178,
26863,
2538,
9841,
29889,
13,
29937,
13,
29937,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
13,
29937,
366,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
13,
29937,
887,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
13,
29937,
13,
29937,
268,
1732,
597,
1636,
29889,
4288,
29889,
990,
29914,
506,
11259,
29914,
27888,
1430,
1660,
29899,
29906,
29889,
29900,
13,
29937,
13,
29937,
25870,
3734,
491,
22903,
4307,
470,
15502,
304,
297,
5007,
29892,
7047,
13,
29937,
13235,
1090,
278,
19245,
338,
13235,
373,
385,
376,
3289,
8519,
29908,
350,
3289,
3235,
29892,
13,
29937,
399,
1806,
8187,
2692,
399,
1718,
29934,
13566,
29059,
6323,
8707,
29928,
22122,
29903,
8079,
13764,
29979,
476,
22255,
29892,
2845,
4653,
470,
2411,
2957,
29889,
13,
29937,
2823,
278,
19245,
363,
278,
2702,
4086,
14765,
1076,
11239,
322,
13,
29937,
27028,
1090,
278,
19245,
29889,
13,
29937,
1275,
9166,
9166,
9166,
9166,
4936,
2751,
13,
15945,
29908,
1888,
14607,
310,
18164,
19766,
29889,
7355,
393,
15376,
10650,
323,
29943,
29896,
9583,
287,
23785,
1213,
15945,
13,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8380,
29918,
5215,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8542,
13,
3166,
4770,
29888,
9130,
1649,
1053,
1596,
29918,
2220,
13,
13,
3166,
26110,
29918,
29882,
431,
1053,
7531,
29918,
5453,
13,
3166,
26110,
29918,
29882,
431,
1053,
7160,
29918,
4299,
29918,
1982,
13,
3166,
26110,
29918,
29882,
431,
1053,
15886,
29918,
29894,
29896,
13,
13,
13,
29918,
1964,
12982,
21554,
29918,
29928,
1672,
18009,
3352,
29918,
15032,
3281,
27946,
353,
518,
13,
1678,
396,
9583,
287,
23785,
5609,
287,
515,
4844,
1061,
6890,
12234,
1712,
263,
13,
1678,
396,
4333,
411,
278,
2286,
393,
8640,
278,
5534,
6694,
4331,
29889,
13,
1678,
396,
13,
1678,
396,
910,
4333,
338,
17262,
746,
8363,
372,
408,
263,
3883,
29889,
2398,
278,
13,
1678,
396,
2286,
393,
3743,
278,
4331,
723,
1603,
367,
6296,
297,
565,
8052,
13,
1678,
396,
297,
278,
478,
1718,
29902,
6181,
29903,
4333,
29889,
13,
1678,
15886,
29918,
29894,
29896,
29889,
9527,
15506,
29889,
29954,
28902,
1964,
29918,
1254,
15488,
29892,
13,
13,
1678,
396,
9583,
287,
23785,
5609,
287,
363,
16330,
671,
4251,
1712,
16250,
607,
2737,
13,
1678,
396,
304,
288,
567,
297,
278,
3983,
393,
746,
1065,
526,
14040,
304,
11905,
278,
13,
1678,
396,
4867,
363,
15352,
12608,
8225,
29879,
29889,
13,
1678,
396,
13,
1678,
396,
910,
10035,
17865,
5023,
338,
9301,
304,
2304,
363,
1784,
13,
1678,
396,
19766,
671,
4251,
322,
5480,
278,
11833,
1244,
338,
393,
278,
9583,
287,
3195,
13,
1678,
396,
2069,
1015,
508,
367,
17262,
297,
7853,
310,
2847,
5281,
773,
278,
13,
1678,
396,
15886,
29889,
14968,
29889,
7185,
2105,
287,
7317,
7208,
12903,
718,
7632,
310,
263,
716,
15886,
29889,
29903,
12483,
580,
13,
1678,
396,
515,
278,
5534,
3651,
4333,
29889,
13,
1678,
15886,
29918,
29894,
29896,
29889,
17314,
29918,
4299,
29889,
3075,
1934,
29889,
1307,
29954,
2477,
29979,
29918,
26019,
29918,
4590,
29918,
10818,
29892,
13,
1678,
15886,
29918,
29894,
29896,
29889,
17314,
29918,
4299,
29889,
3075,
1934,
29889,
29032,
29918,
4590,
29918,
10818,
29892,
13,
29962,
13,
13,
13,
1753,
903,
8865,
29918,
29027,
29898,
17314,
29918,
4299,
29918,
13789,
29892,
16250,
1125,
13,
29871,
363,
12700,
29918,
4262,
297,
7160,
29918,
4299,
29918,
13789,
29889,
7299,
29918,
4262,
29879,
29901,
13,
1678,
363,
4333,
297,
16250,
29901,
13,
418,
565,
4333,
297,
12700,
29918,
4262,
29889,
10855,
29918,
1753,
29901,
13,
4706,
628,
12700,
29918,
4262,
29889,
10855,
29918,
1753,
29961,
10855,
29962,
13,
13,
13,
1753,
1653,
29918,
5453,
29918,
6550,
29918,
3166,
29918,
17314,
29918,
4299,
29898,
17314,
29918,
4299,
29918,
2084,
29892,
13,
462,
462,
4706,
5768,
29918,
29027,
29922,
8516,
1125,
13,
29871,
9995,
1252,
27910,
29901,
6204,
263,
15591,
10299,
714,
310,
263,
9583,
287,
3195,
515,
323,
29943,
29896,
29889,
13,
13,
29871,
5012,
15094,
29907,
8098,
6058,
29923,
29901,
910,
14393,
304,
278,
19766,
29889,
7355,
3450,
322,
934,
3402,
363,
323,
29943,
29896,
29889,
13,
29871,
1152,
323,
29943,
29906,
29892,
323,
6073,
17907,
14533,
13968,
8656,
9583,
287,
23785,
29892,
11077,
278,
817,
363,
13,
29871,
9678,
1080,
763,
445,
29889,
13,
13,
29871,
22402,
263,
15591,
10299,
515,
263,
9583,
287,
3195,
29889,
3940,
393,
445,
338,
451,
22688,
304,
13,
29871,
664,
297,
599,
4251,
322,
372,
15894,
278,
9583,
287,
3195,
756,
5643,
777,
13064,
1080,
29901,
13,
13,
29871,
448,
450,
7797,
1891,
5701,
369,
3206,
508,
367,
17262,
322,
2012,
508,
367,
337,
11433,
287,
29889,
13,
29871,
448,
450,
2069,
1015,
322,
1667,
1015,
508,
367,
17262,
322,
2012,
278,
3883,
508,
367,
13,
1678,
16601,
491,
773,
278,
13064,
1080,
5643,
491,
13,
1678,
421,
13264,
29889,
14968,
29889,
7185,
2105,
287,
7317,
1412,
13,
13,
29871,
3940,
393,
278,
731,
310,
5680,
6969,
508,
7910,
975,
931,
322,
505,
2625,
13,
29871,
9545,
393,
892,
451,
9251,
7962,
29889,
450,
4766,
5643,
304,
4772,
13,
29871,
11468,
4637,
338,
28172,
4160,
304,
9607,
607,
5680,
304,
11455,
313,
11884,
13,
29871,
565,
896,
526,
451,
6969,
467,
13,
13,
29871,
3940,
393,
445,
740,
10017,
263,
15591,
10299,
393,
746,
5609,
287,
29586,
263,
13,
29871,
15591,
313,
6707,
373,
263,
9120,
3509,
310,
278,
2441,
9583,
287,
3195,
29897,
322,
451,
263,
13,
29871,
9583,
287,
3195,
29889,
13,
13,
29871,
826,
3174,
29901,
13,
1678,
7160,
29918,
4299,
29918,
2084,
29901,
18862,
411,
278,
9583,
287,
3195,
304,
671,
29889,
13,
1678,
5768,
29918,
29027,
29901,
19814,
1051,
310,
4333,
304,
5768,
29889,
13,
13,
29871,
16969,
29901,
13,
1678,
319,
15591,
10299,
29889,
13,
29871,
9995,
13,
29871,
7160,
29918,
4299,
29918,
13789,
353,
7160,
29918,
4299,
29918,
1982,
29889,
1359,
29898,
17314,
29918,
4299,
29918,
2084,
29897,
13,
29871,
1423,
3149,
29918,
9507,
353,
7160,
29918,
4299,
29918,
1982,
29889,
657,
29918,
20897,
29918,
2084,
29898,
17314,
29918,
4299,
29918,
2084,
29897,
13,
13,
29871,
5768,
29918,
29027,
353,
313,
842,
7373,
1964,
12982,
21554,
29918,
29928,
1672,
18009,
3352,
29918,
15032,
3281,
27946,
29897,
891,
13,
462,
418,
313,
842,
29898,
8865,
29918,
29027,
29897,
565,
5768,
29918,
29027,
1683,
731,
22130,
13,
29871,
903,
8865,
29918,
29027,
29898,
17314,
29918,
4299,
29918,
13789,
29892,
5768,
29918,
29027,
29897,
13,
13,
29871,
736,
7531,
29918,
5453,
3032,
7355,
10299,
29898,
17314,
29918,
4299,
29918,
13789,
29892,
1423,
3149,
29918,
9507,
29897,
29871,
396,
282,
2904,
524,
29901,
11262,
29922,
24681,
29899,
5943,
13,
2
] |
modules/sensor_heatmap/controllers.py | srcc-msu/job_statistics | 0 | 122799 | from flask import Blueprint, render_template, current_app, Response
from application.database import global_db
from application.helpers import requires_auth
from core.monitoring.models import SENSOR_CLASS_MAP
sensor_heatmap_pages = Blueprint('sensor_heatmap', __name__
, template_folder='templates', static_folder='static')
import time
def __heatmap():
cpu = SENSOR_CLASS_MAP["cpu_user"]
gpu = SENSOR_CLASS_MAP["gpu_load"]
interval = current_app.app_config.monitoring["aggregation_interval"]
time_thr = int(time.time() - interval * 3)
cpu_data = list(global_db.session.query(cpu.node_id, cpu.avg)
.filter(cpu.time > time_thr)
.order_by("time desc").all())
gpu_data = list(global_db.session.query(gpu.node_id, gpu.avg)
.filter(gpu.time > time_thr)
.order_by("time desc").all())
return render_template("cpu.html", cpu_data = cpu_data, gpu_data = gpu_data)
@sensor_heatmap_pages.route("/general")
@requires_auth
def heatmap() -> Response:
return __heatmap()
| [
1,
515,
29784,
1053,
10924,
2158,
29892,
4050,
29918,
6886,
29892,
1857,
29918,
932,
29892,
13291,
13,
3166,
2280,
29889,
9803,
1053,
5534,
29918,
2585,
13,
13,
3166,
2280,
29889,
3952,
6774,
1053,
6858,
29918,
5150,
13,
3166,
7136,
29889,
3712,
2105,
292,
29889,
9794,
1053,
317,
1430,
29903,
1955,
29918,
13875,
1799,
29918,
23827,
13,
13,
29879,
6073,
29918,
354,
271,
1958,
29918,
12292,
353,
10924,
2158,
877,
29879,
6073,
29918,
354,
271,
1958,
742,
4770,
978,
1649,
13,
12,
29892,
4472,
29918,
12083,
2433,
20943,
742,
2294,
29918,
12083,
2433,
7959,
1495,
13,
13,
5215,
931,
13,
13,
1753,
4770,
354,
271,
1958,
7295,
13,
12,
21970,
353,
317,
1430,
29903,
1955,
29918,
13875,
1799,
29918,
23827,
3366,
21970,
29918,
1792,
3108,
13,
12,
29887,
3746,
353,
317,
1430,
29903,
1955,
29918,
13875,
1799,
29918,
23827,
3366,
29887,
3746,
29918,
1359,
3108,
13,
13,
12,
19207,
353,
1857,
29918,
932,
29889,
932,
29918,
2917,
29889,
3712,
2105,
292,
3366,
26193,
362,
29918,
19207,
3108,
13,
13,
12,
2230,
29918,
386,
29878,
353,
938,
29898,
2230,
29889,
2230,
580,
448,
7292,
334,
29871,
29941,
29897,
13,
13,
12,
21970,
29918,
1272,
353,
1051,
29898,
10945,
29918,
2585,
29889,
7924,
29889,
1972,
29898,
21970,
29889,
3177,
29918,
333,
29892,
26403,
29889,
485,
29887,
29897,
13,
12,
12,
29889,
4572,
29898,
21970,
29889,
2230,
1405,
931,
29918,
386,
29878,
29897,
13,
12,
12,
29889,
2098,
29918,
1609,
703,
2230,
5153,
2564,
497,
3101,
13,
13,
12,
29887,
3746,
29918,
1272,
353,
1051,
29898,
10945,
29918,
2585,
29889,
7924,
29889,
1972,
29898,
29887,
3746,
29889,
3177,
29918,
333,
29892,
330,
3746,
29889,
485,
29887,
29897,
13,
12,
12,
29889,
4572,
29898,
29887,
3746,
29889,
2230,
1405,
931,
29918,
386,
29878,
29897,
13,
12,
12,
29889,
2098,
29918,
1609,
703,
2230,
5153,
2564,
497,
3101,
13,
13,
12,
2457,
4050,
29918,
6886,
703,
21970,
29889,
1420,
613,
26403,
29918,
1272,
353,
26403,
29918,
1272,
29892,
330,
3746,
29918,
1272,
353,
330,
3746,
29918,
1272,
29897,
13,
13,
29992,
29879,
6073,
29918,
354,
271,
1958,
29918,
12292,
29889,
13134,
11974,
17492,
1159,
13,
29992,
276,
339,
2658,
29918,
5150,
13,
1753,
12871,
1958,
580,
1599,
13291,
29901,
13,
12,
2457,
4770,
354,
271,
1958,
580,
13,
2
] |
python_test.py | jackKiZhu/mypython | 0 | 8114 | <gh_stars>0
from flask import Flask, render_template, request
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config["SQLALCHEMY_DATABASE_URI"] = "mysql://root:[email protected]:3306/python_github"
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = True
db = SQLAlchemy(app)
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
user_name = db.Column(db.String(64), unique=True)
user_password = db.Column(db.String(32))
def __repr__(self):
return "用户id:%s 用户名:%s" % (self.id, self.user_name)
@app.route("/", methods=["post", "get"])
def index():
index_meg = ""
if request.method == "POST":
user_name = request.form.get("user_name", "")
user_pwd = request.form.get("user_pwd", "")
if not all([user_name, user_pwd]):
index_meg = "请正确输入信息"
else:
print(request.get_data())
user_name_is_exits = User.query.filter(User.user_name == user_name).first()
if user_name_is_exits:
index_meg = "用户名已存在"
else:
user_obj = User(user_name=user_name, user_password=<PASSWORD>)
db.session.add(user_obj)
db.session.commit()
index_meg = "注册成功"
print("注册成功")
# user_name = request.args.get("user_name", "")
# user_pwd = request.args.get("user_pwd", "")
# user_is_login = User.query.filter_by(user_name=user_name, user_password=<PASSWORD>).first()
# if user_is_login:
# index_meg = "登陆成功"
# print("登陆成功")
# return render_template("login_ok.html", index_meg=index_meg)
# else:
# # index_meg = "登陆失败"
# print("登陆失败")
return render_template("index.html", index_meg=index_meg)
if __name__ == "__main__":
db.drop_all()
db.create_all()
app.run(debug=True)
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
3166,
29784,
1053,
2379,
1278,
29892,
4050,
29918,
6886,
29892,
2009,
13,
3166,
29784,
29918,
2850,
284,
305,
6764,
1053,
3758,
2499,
305,
6764,
13,
932,
353,
2379,
1278,
22168,
978,
1649,
29897,
13,
932,
29889,
2917,
3366,
4176,
1964,
3210,
12665,
29979,
29918,
25832,
27982,
29918,
15551,
3108,
353,
376,
7938,
597,
4632,
29901,
7938,
29992,
29896,
29906,
29955,
29889,
29900,
29889,
29900,
29889,
29896,
29901,
29941,
29941,
29900,
29953,
29914,
4691,
29918,
3292,
29908,
13,
932,
29889,
2917,
3366,
4176,
1964,
3210,
12665,
29979,
29918,
5659,
11375,
29918,
6720,
4571,
29943,
28541,
29903,
3108,
353,
5852,
13,
2585,
353,
3758,
2499,
305,
6764,
29898,
932,
29897,
13,
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,
1404,
29918,
978,
353,
4833,
29889,
4409,
29898,
2585,
29889,
1231,
29898,
29953,
29946,
511,
5412,
29922,
5574,
29897,
13,
1678,
1404,
29918,
5630,
353,
4833,
29889,
4409,
29898,
2585,
29889,
1231,
29898,
29941,
29906,
876,
13,
13,
1678,
822,
4770,
276,
558,
12035,
1311,
1125,
13,
4706,
736,
376,
30406,
31229,
333,
16664,
29879,
29871,
30406,
31229,
30548,
16664,
29879,
29908,
1273,
313,
1311,
29889,
333,
29892,
1583,
29889,
1792,
29918,
978,
29897,
13,
13,
13,
29992,
932,
29889,
13134,
11974,
613,
3519,
29922,
3366,
2490,
613,
376,
657,
20068,
13,
1753,
2380,
7295,
13,
1678,
2380,
29918,
29885,
387,
353,
5124,
13,
1678,
565,
2009,
29889,
5696,
1275,
376,
5438,
1115,
13,
4706,
1404,
29918,
978,
353,
2009,
29889,
689,
29889,
657,
703,
1792,
29918,
978,
613,
20569,
13,
4706,
1404,
29918,
29886,
9970,
353,
2009,
29889,
689,
29889,
657,
703,
1792,
29918,
29886,
9970,
613,
20569,
13,
4706,
565,
451,
599,
4197,
1792,
29918,
978,
29892,
1404,
29918,
29886,
9970,
29962,
1125,
13,
9651,
2380,
29918,
29885,
387,
353,
376,
31088,
30724,
31835,
31573,
30752,
30689,
31021,
29908,
13,
4706,
1683,
29901,
13,
9651,
1596,
29898,
3827,
29889,
657,
29918,
1272,
3101,
13,
9651,
1404,
29918,
978,
29918,
275,
29918,
735,
1169,
353,
4911,
29889,
1972,
29889,
4572,
29898,
2659,
29889,
1792,
29918,
978,
1275,
1404,
29918,
978,
467,
4102,
580,
13,
9651,
565,
1404,
29918,
978,
29918,
275,
29918,
735,
1169,
29901,
13,
18884,
2380,
29918,
29885,
387,
353,
376,
30406,
31229,
30548,
31290,
30946,
30505,
29908,
13,
9651,
1683,
29901,
13,
18884,
1404,
29918,
5415,
353,
4911,
29898,
1792,
29918,
978,
29922,
1792,
29918,
978,
29892,
1404,
29918,
5630,
29922,
29966,
25711,
17013,
12948,
13,
18884,
4833,
29889,
7924,
29889,
1202,
29898,
1792,
29918,
5415,
29897,
13,
18884,
4833,
29889,
7924,
29889,
15060,
580,
13,
18884,
2380,
29918,
29885,
387,
353,
376,
31368,
232,
137,
143,
30494,
31134,
29908,
13,
18884,
1596,
703,
31368,
232,
137,
143,
30494,
31134,
1159,
13,
13,
1678,
396,
1404,
29918,
978,
353,
2009,
29889,
5085,
29889,
657,
703,
1792,
29918,
978,
613,
20569,
13,
1678,
396,
1404,
29918,
29886,
9970,
353,
2009,
29889,
5085,
29889,
657,
703,
1792,
29918,
29886,
9970,
613,
20569,
13,
1678,
396,
1404,
29918,
275,
29918,
7507,
353,
4911,
29889,
1972,
29889,
4572,
29918,
1609,
29898,
1792,
29918,
978,
29922,
1792,
29918,
978,
29892,
1404,
29918,
5630,
29922,
29966,
25711,
17013,
29958,
467,
4102,
580,
13,
1678,
396,
565,
1404,
29918,
275,
29918,
7507,
29901,
13,
1678,
396,
268,
2380,
29918,
29885,
387,
353,
376,
31451,
236,
156,
137,
30494,
31134,
29908,
13,
1678,
396,
268,
1596,
703,
31451,
236,
156,
137,
30494,
31134,
1159,
13,
1678,
396,
268,
736,
4050,
29918,
6886,
703,
7507,
29918,
554,
29889,
1420,
613,
2380,
29918,
29885,
387,
29922,
2248,
29918,
29885,
387,
29897,
13,
1678,
396,
1683,
29901,
13,
1678,
396,
268,
396,
2380,
29918,
29885,
387,
353,
376,
31451,
236,
156,
137,
31369,
31955,
29908,
13,
1678,
396,
268,
1596,
703,
31451,
236,
156,
137,
31369,
31955,
1159,
13,
1678,
736,
4050,
29918,
6886,
703,
2248,
29889,
1420,
613,
2380,
29918,
29885,
387,
29922,
2248,
29918,
29885,
387,
29897,
13,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
4833,
29889,
8865,
29918,
497,
580,
13,
1678,
4833,
29889,
3258,
29918,
497,
580,
13,
1678,
623,
29889,
3389,
29898,
8382,
29922,
5574,
29897,
13,
268,
13,
13,
2
] |
tests.py | HeyIamJames/CarCompare | 0 | 137833 | <gh_stars>0
import unittest
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
class PythonOrgSearch(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Chrome()
def test_search_in_python_org(self):
driver = self.driver("/chromedriver.exe"
self.assertIn("none", driver.title)
elem.send_keys("Ads")
elem.send_keys(Keys.RETURN)
def tearDown(self):
self.driver.close()
if __name__ == "__main__":
unittest.main()
| [
1,
529,
12443,
29918,
303,
1503,
29958,
29900,
13,
5215,
443,
27958,
13,
3166,
18866,
1053,
1856,
9465,
13,
3166,
18866,
29889,
29813,
29889,
9435,
29889,
8149,
1053,
4813,
952,
13,
13,
1990,
5132,
2816,
29887,
7974,
29898,
348,
27958,
29889,
3057,
8259,
1125,
13,
13,
1678,
822,
731,
3373,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9465,
353,
1856,
9465,
29889,
1451,
4871,
580,
13,
13,
1678,
822,
1243,
29918,
4478,
29918,
262,
29918,
4691,
29918,
990,
29898,
1311,
1125,
13,
4706,
7156,
353,
1583,
29889,
9465,
11974,
27433,
287,
3511,
29889,
8097,
29908,
13,
4706,
1583,
29889,
9294,
797,
703,
9290,
613,
7156,
29889,
3257,
29897,
13,
4706,
21268,
29889,
6717,
29918,
8149,
703,
3253,
29879,
1159,
13,
4706,
21268,
29889,
6717,
29918,
8149,
29898,
15506,
29889,
1525,
29911,
24015,
29897,
13,
13,
13,
1678,
822,
734,
279,
6767,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9465,
29889,
5358,
580,
13,
13,
361,
4770,
978,
1649,
1275,
376,
1649,
3396,
1649,
1115,
13,
1678,
443,
27958,
29889,
3396,
580,
13,
2
] |
Audio_CrisNet_spec_mel_log.py | BioSIP/countcrowd_TFG | 0 | 71797 | <filename>Audio_CrisNet_spec_mel_log.py<gh_stars>0
from losses import LogCoshLoss
import os
from scipy.io import loadmat
from torch.utils.data import DataLoader
from torch.utils.data import Dataset
import torch
import torchaudio
import torch.nn as nn
from torch import optim
import torch.nn.functional as F
import numpy as np
from torch.optim.lr_scheduler import StepLR
import pickle
# https://pytorch.org/tutorials/beginner/audio_preprocessing_tutorial.html
# Para comprobar si tenemos GPUs disponibles para usar o no:
use_cuda = torch.cuda.is_available()
device = torch.device("cuda" if use_cuda else "cpu")
SAVE_FILENAME = 'crisnet_melspectrogram_mselog.pickle'
class AudioDataset(Dataset):
def __init__(self, audio_path, density_path, transform=None):
# 3 opciones para el density_path:
#density_path = '/Volumes/Cristina /TFG/Data/density/train'
#density_path = '/Volumes/Cristina /TFG/Data/density/test'
#density_path = '/Volumes/Cristina /TFG/Data/density/val'
self.density_path = density_path
self.audio_path = audio_path
self.transform = transform
self.mapfiles = os.listdir(self.density_path)
# Para no incluir los archivos con '._':
self.mapfiles = [
el for el in self.mapfiles if el.startswith('._') == False]
self.mapfiles_wo_ext = [el[:-4] for el in self.mapfiles]
# list comprehension
#audio_path = '/Volumes/Cristina /TFG/Data/auds/'
self.audiofiles = os.listdir(audio_path)
self.audiofiles_wo_ext = [el[:-4] for el in self.audiofiles]
self.audiofiles = [
el + '.wav' for el in self.audiofiles_wo_ext if el in self.mapfiles_wo_ext]
self.audiofiles = sorted(self.audiofiles)
self.mapfiles = sorted(self.mapfiles)
# Añadir extensiones a archivos de audio:
# for i in range(len(self.audiofiles)):
# Añado la extensión al nombre del archivo que quiero importar:
#self.audiofiles[i] = [self.audiofiles[i] + '.wav']
def __len__(self):
return len(self.audiofiles)
def __getitem__(self, idx):
# DENSITY MAP
map_path = self.density_path + self.mapfiles[idx]
mapa = loadmat(map_path)
y = torch.as_tensor(mapa['map'].sum(), dtype=torch.float32)
# AUDIO
# Encuentro el path del archivo:
filename = str(self.audiofiles[idx])
filename = filename.lstrip("['")
filename = filename.rstrip("']")
aud_path = self.audio_path + filename
# Cargamos el audio:
waveform, sample_rate = torchaudio.load(
aud_path) # waveform es un tensor
x = waveform.view((2, 1, -1)) # dimensiones
if self.transform:
x = self.transform(x)
return x, y
class MelSpectrogramDataset(Dataset):
def __init__(self, audio_path, density_path, transform=None):
#3 opciones para el density_path:
#density_path = '/Volumes/Cristina /TFG/Data/density/train'
#density_path = '/Volumes/Cristina /TFG/Data/density/test'
#density_path = '/Volumes/Cristina /TFG/Data/density/val'
self.density_path=density_path
self.audio_path=audio_path
self.transform=transform
self.mapfiles = os.listdir(self.density_path)
#Para no incluir los archivos con '._':
self.mapfiles = [el for el in self.mapfiles if el.startswith('._')==False]
self.mapfiles_wo_ext=[el[:-4] for el in self.mapfiles]
# list comprehension
#audio_path = '/Volumes/Cristina /TFG/Data/auds/'
self.audiofiles = os.listdir(audio_path)
self.audiofiles_wo_ext=[el[:-4] for el in self.audiofiles]
self.audiofiles = [el + '.wav' for el in self.audiofiles_wo_ext if el in self.mapfiles_wo_ext]
self.audiofiles = sorted(self.audiofiles)
self.mapfiles = sorted(self.mapfiles)
#Anadir extensiones a archivos de audio:
#for i in range(len(self.audiofiles)):
#Anado la extension al nombre del archivo que quiero importar:
#self.audiofiles[i] = [self.audiofiles[i] + '.wav']
def __len__(self):
return len(self.audiofiles)
def __getitem__(self, idx):
#DENSITY MAP
map_path = self.density_path + self.mapfiles[idx]
mapa = loadmat(map_path)
y = torch.as_tensor(mapa['map'].sum(), dtype=torch.float32)
#AUDIO
#Encuentro el path del archivo:
filename=str(self.audiofiles[idx])
filename=filename.lstrip("['")
filename=filename.rstrip("']")
aud_path = self.audio_path + filename
#Cargamos el audio:
waveform, sample_rate = torchaudio.load(aud_path) #waveform es un tensor
spec = torchaudio.transforms.Spectrogram()(waveform)
x = torchaudio.transforms.MelScale(n_mels = 201, sample_rate = sample_rate)(spec)
#print("Shape of spectrogram: {}".format(x.size()))
#plt.figure()
#plt.imshow(x.log2()[0,:,:].numpy(), cmap='gray')
return x, y
'''
audio_path = '/home/pakitochus/Descargas/propuestas_tfg_cristina/crowd/definitivo/DISCO_dataset/auds/'
train_density_path = '/home/pakitochus/Descargas/propuestas_tfg_cristina/crowd/definitivo/DISCO_dataset/density/train/'
val_density_path = '/home/pakitochus/Descargas/propuestas_tfg_cristina/crowd/definitivo/DISCO_dataset/density/val/'
test_density_path = '/home/pakitochus/Descargas/propuestas_tfg_cristina/crowd/definitivo/DISCO_dataset/density/test/'
'''
audio_path = '/media/NAS/home/cristfg/datasets/auds/'
train_density_path = '/media/NAS/home/cristfg/datasets/density/train/'
val_density_path = '/media/NAS/home/cristfg/datasets/density/val/'
test_density_path = '/media/NAS/home/cristfg/datasets/density/test/'
trainset = MelSpectrogramDataset(audio_path, train_density_path,'MEL')
valset = MelSpectrogramDataset(audio_path, val_density_path,'MEL')
testset = MelSpectrogramDataset(audio_path, test_density_path,'MEL')
# PRUEBA para ver tensores de audio y de mapas de los conjuntos de train y val:
# print(trainset.__getitem__(20))
# print(valset.__getitem__(20))
#BATCH_SIZE: pequeño (1-3)
batch_size = 48
# BATCH_SIZE: pequeño (1-3)
train_loader = DataLoader(trainset, batch_size, shuffle=True)
val_loader = DataLoader(valset, 32, shuffle=False)
test_loader = DataLoader(testset, 32, shuffle=False)
# RED:
'''
#Por si quiero probar luego con LeNet (CAMBIAR INPUTS!):
class LeNet(nn.Module):
def __init__(self):
super(LeNet, self).__init__() # esta linea es siempre necesaria
self.conv1 = nn.Conv2d(1, 6, 5, padding=2)
self.mp1 = nn.MaxPool2d(1,2)
self.conv2 = nn.Conv2d(6, 16, 5, padding=2)
self.mp2 = nn.MaxPool2d(2)
self.conv3 = nn.Conv2d(16, 120, 3, padding=1)
self.fc1 = nn.Linear(7*7*120, 256)#capa oculta
self.fc2 = nn.Linear(256, 10)#capa de salida
def forward(self, x):
x = F.relu(self.conv1(x))
x = self.mp1(x)
x = F.relu(self.conv2(x))
x = self.mp2(x)
x = F.relu(self.conv3(x))
x = x.view(-1, 7*7*120)
x = F.relu(self.fc1(x))#Función de activación relu en la salida de la capa oculta
x = F.softmax(self.fc2(x), dim=1)#Función de activación softmax en la salida de la capa oculta
return x
'''
# MaxPool2d((1,2))
# torch.nn.Conv2d(in_channels, out_channels, kernel_size) -> kernel_size = (1, 61)
# in_channels ->2, out_channels -> [32,64].
# optim - > adam
class GlobalAvgPool2d(nn.Module):
def __init__(self):
super(GlobalAvgPool2d, self).__init__()
def forward(self, x):
assert len(x.size()) == 4, x.size()
B, C, W, H = x.size()
return F.avg_pool2d(x, (W, H)).view(B, C)
class GlobalMaxPool2d(nn.Module):
def __init__(self):
super(GlobalMaxPool2d, self).__init__()
def forward(self, x):
assert len(x.size()) == 4, x.size()
B, C, W, H = x.size()
return F.max_pool2d(x, (W, H)).view(B, C)
class VGGish(nn.Module):
"""
PyTorch implementation of the VGGish model.
Adapted from: https://github.com/harritaylor/torch-vggish
The following modifications were made: (i) correction for the missing ReLU layers, (ii) correction for the
improperly formatted data when transitioning from NHWC --> NCHW in the fully-connected layers, and (iii)
correction for flattening in the fully-connected layers.
"""
def __init__(self):
super(VGGish, self).__init__()
self.pools = [4, 4, 2, 2]
self.features = nn.Sequential(
nn.Conv2d(2, 64, 3, stride=(1, self.pools[0]), padding=3),
nn.ReLU(),
nn.Conv2d(64, 128, 5, stride=(1, self.pools[1]), padding=2),
nn.ReLU(),
nn.Conv2d(128, 256, 3, stride=1, padding=1),
nn.ReLU(),
nn.Conv2d(256, 256, 3, stride=(1, self.pools[2]), padding=1),
nn.ReLU(),
nn.Conv2d(256, 512, 3, stride=1, padding=1),
nn.ReLU(),
nn.Conv2d(512, 1024, 3, stride=1, padding=1),
nn.ReLU(),
# nn.MaxPool2d((1,self.pools[3]), stride=self.pools[3])
)
self.avgpool = GlobalAvgPool2d()
self.fc = nn.Sequential(
nn.Linear(1024, 4096),
nn.Linear(4096, 1)
)
# así y todo se nos queda en 1572864000
def forward(self, x):
x = self.features(x) # .permute(0, 2, 3, 1).contiguous()
x = self.avgpool(x)
# x = x.view(x.size(0), -1)
x = self.fc(x)
# b, c, w, h = x.shape
# x = x.view(b, c, -1).mean(-1)
return x
class CrisNet(nn.Module):
def __init__(self):
super(CrisNet, self).__init__() # esta linea es siempre necesaria
self.max_pool1 = nn.MaxPool2d((1,2))
self.max_pool2 = nn.MaxPool2d((1,2))
self.max_pool3 = nn.MaxPool2d((1,2))
self.max_pool4 = nn.MaxPool2d((1,2))
self.max_pool5 = nn.MaxPool2d((1,2))
self.max_pool6 = nn.MaxPool2d((1,2))
self.conv1 = nn.Conv2d(2, 32, 3, stride=1, padding=1)
self.conv2 = nn.Conv2d(32, 64, 3, stride=1, padding=1)
self.conv3 = nn.Conv2d(64, 128, 3, stride=1, padding=1)
self.conv4 = nn.Conv2d(128, 256, 3, stride=1, padding=1)
self.conv5 = nn.Conv2d(256, 512, 3, stride=1, padding=1)
self.conv6 = nn.Conv2d(512, 1024, 3, stride=1, padding=1)
self.fc1 = nn.Linear(617472,1)
def forward(self, x):
#Con función de activación ReLu
#PRIMERA CAPA
x = F.relu(self.conv1(x))
x = self.max_pool1(x)
#SEGUNDA CAPA
x = F.relu(self.conv2(x))
x = self.max_pool2(x)
#TERCERA CAPA
x = F.relu(self.conv3(x))
x = self.max_pool3(x)
#CUARTA CAPA
x = F.relu(self.conv4(x))
x = self.max_pool4(x)
#QUINTA CAPA
x = F.relu(self.conv5(x))
x = self.max_pool5(x)
#SEXTA CAPA
x = F.relu(self.conv6(x))
x = self.max_pool6(x)
x = x.view((x.size(0),-1))
#print(x.size())
x = self.fc1(x)
return x
modelo=CrisNet()
modelo = modelo.to(device)
criterion = nn.MSELoss() # definimos la pérdida
# criterion = LogCoshLoss(reduction='sum')
optimizador = optim.Adam(modelo.parameters(), lr=1e-3)#, weight_decay=1e-4)
# optimizador = optim.SGD(modelo.parameters(), lr=1e-4)
# print(modelo)
# print(train_loader)
# print(type(train_loader))
# print(x)
# print(x.size())
# print(y)
# print(y.size())
def get_mae_mse(ypred, y, transform):
mse_loss = 0.0
mae_loss = 0.0
total = 0
ypred, y = transform(ypred.data), transform(y.data)
for ix in range(y.shape[0]):
total += 1
mae_loss += abs(ypred[ix] - y[ix])
mse_loss += (ypred[ix] - y[ix])*(ypred[ix] - y[ix])
return mae_loss/total, torch.sqrt(mse_loss/total)
# Para predecir y, la normalizaremos. Siempre por el mismo valor:
Y_NORM = 10
losses = {'train': list(), 'validacion': list()}
min_val_loss = {'mae': float('Inf'), 'mse': float('Inf'), 'loss': float('Inf') }
expcode = 'cris_melspectrogram_mselog'
def transform(x):
return torch.log(x/Y_NORM)
def inverse_transform(x):
return Y_NORM*torch.exp(torch.as_tensor(x))
for epoch in range(100):
print("Entrenando... \n") # Esta será la parte de entrenamiento
training_loss = 0.0 # el loss en cada epoch de entrenamiento
total = 0
modelo.train() # Para preparar el modelo para el training
for x, y in train_loader:
total += 1
# ponemos a cero todos los gradientes en todas las neuronas:
optimizador.zero_grad()
y = transform(y) # normalizamos
x = x.to(device)
y = y.to(device)
output = modelo(x) # forward
loss = criterion(output.squeeze(), y.squeeze()) # evaluación del loss
# print(f'loss: {loss:.4f}')
loss.backward() # backward pass
optimizador.step() # optimización
training_loss += loss.item() # acumulamos el loss de este batch
training_loss = training_loss/total
losses['train'].append(training_loss) # .item())
val_loss = 0.0
mae, mse = 0,0
total = 0
modelo.eval() # Preparar el modelo para validación y/o test
print("Validando... \n")
for x, y in val_loader:
total += 1
y = transform(y) # normalizamos
x = x.to(device)
y = y.to(device)
output = modelo(x)
loss = criterion(output.squeeze(), y.squeeze())
val_loss += loss.item()
mae_accum, mse_accum = get_mae_mse(output.squeeze(), y.squeeze(), inverse_transform)
mae += mae_accum
mse += mse_accum
val_loss = val_loss/total
mae = mae/total
mse = mse/total
losses['validacion'].append(val_loss) # .item())
print(f'[ep {epoch}] [Train: {training_loss:.4f}][Val: {val_loss:.4f}]')
print(f'\t[Val MAE: {mae:.4f}][Val MSE: {mse:.4f}]')
# Early stopping
if (val_loss <= min_val_loss['loss']) or (mse <= min_val_loss['mse']) or (mae<=min_val_loss['mae']):
filename = expcode+'.pt'
print(f'Saving as {filename}')
torch.save(modelo, filename)
if val_loss <= min_val_loss['loss']:
min_val_loss['loss'] = val_loss
if mse <= min_val_loss['mse']:
min_val_loss['mse'] = mse
if mae<=min_val_loss['mae']:
min_val_loss['mae'] = mae
last_epoch = epoch
# last_lr = scheduler.get_last_lr()
# ENTRENAMIENTO
n_epochs = 500
LR_DECAY = 0.99
NUM_EPOCH_LR_DECAY = 1
modelo = torch.load(filename)
optimizador = optim.SGD(modelo.parameters(), lr=1e-4, momentum=0.9)
scheduler = StepLR(optimizador, step_size=NUM_EPOCH_LR_DECAY, gamma=LR_DECAY)
epoch_ni = 0 # epochs not improving.
MAX_ITER = 100
for epoch in range(last_epoch, n_epochs):
print("Entrenando... \n") # Esta será la parte de entrenamiento
training_loss = 0.0 # el loss en cada epoch de entrenamiento
total = 0
modelo.train() # Para preparar el modelo para el training
for x, y in train_loader:
total += 1
# ponemos a cero todos los gradientes en todas las neuronas:
optimizador.zero_grad()
y = transform(y) # normalizamos
x = x.to(device)
y = y.to(device)
output = modelo(x) # forward
loss = criterion(output.squeeze(), y.squeeze()) # evaluación del loss
# print(f'loss: {loss}')
loss.backward() # backward pass
optimizador.step() # optimización
training_loss += loss.item() # acumulamos el loss de este batch
training_loss = training_loss/total
losses['train'].append(training_loss) # .item())
val_loss = 0.0
total = 0
mae, mse = 0,0
scheduler.step() # rebaja un poco la LR del SGD
modelo.eval() # Preparar el modelo para validación y/o test
print("Validando... \n")
for x, y in val_loader:
total += 1
y = transform(y) # normalizamos
x = x.to(device)
y = y.to(device)
output = modelo(x) # forward
loss = criterion(output.squeeze(), y.squeeze())
mae_accum, mse_accum = get_mae_mse(output.squeeze(), y.squeeze(), inverse_transform)
mae += mae_accum
mse += mse_accum
val_loss = val_loss/total
mae = mae/total
mse = mse/total
losses['validacion'].append(val_loss) # .item())
print(f'[ep {epoch}] [Train: {training_loss:.4f}][Val: {val_loss:.4f}]')
print(f'\t[Val MAE: {mae:.4f}][Val MSE: {mse:.4f}]')
# Early stopping
if (val_loss <= min_val_loss['loss']) or (mse <= min_val_loss['mse']) or (mae<=min_val_loss['mae']):
filename = expcode+'.pt'
print(f'Saving as {filename}')
torch.save(modelo, filename)
if val_loss <= min_val_loss['loss']:
min_val_loss['loss'] = val_loss
if mse <= min_val_loss['mse']:
min_val_loss['mse'] = mse
if mae<=min_val_loss['mae']:
min_val_loss['mae'] = mae
# TEST
modelo = torch.load(filename)
modelo.eval() # Preparar el modelo para validación y/o test
print("Testing... \n")
total = 0
test_loss_mse = 0.0
test_loss_mae = 0.0
yreal = list()
ypredicha = list()
for x, y in test_loader:
y = transform(y) # normalizamos
x = x.to(device)
y = y.to(device)
with torch.no_grad():
output = modelo(x)
yreal.append(inverse_transform(y.data.cpu().numpy()))
ypredicha.append(inverse_transform(output.data.cpu().numpy()))
mae_accum, mse_accum = get_mae_mse(output.squeeze(), y.squeeze(), inverse_transform)
mae += mae_accum
mse += mse_accum
total += 1
val_loss = val_loss/total
mae = mae/total
mse = mse/total
print(f'[ep {epoch}][Test MAE: {mae:.4f}][Test MSE: {mse:.4f}]')
# yreal = np.array(yreal).flatten()
# ypredicha = np.array(ypredicha).flatten() # comprobar si funciona.
losses['yreal'] = np.array([el.item() for a in yreal for el in a])
losses['ypredicha'] = np.array([el.item() for a in ypredicha for el in a])
print(f'Test Loss (MSE): {mse}')
losses['test_mse'] = mse # .item())
print(f'Test Loss (MAE): {mae}')
losses['test_mae'] = mae # .item())
with open(SAVE_FILENAME, 'wb') as handle:
pickle.dump(losses, handle, protocol=pickle.HIGHEST_PROTOCOL)
| [
1,
529,
9507,
29958,
17111,
29918,
29907,
3780,
6779,
29918,
6550,
29918,
12873,
29918,
1188,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29900,
13,
3166,
28495,
1053,
4522,
29907,
10578,
29931,
2209,
13,
5215,
2897,
13,
3166,
4560,
2272,
29889,
601,
1053,
2254,
2922,
13,
3166,
4842,
305,
29889,
13239,
29889,
1272,
1053,
3630,
10036,
13,
3166,
4842,
305,
29889,
13239,
29889,
1272,
1053,
13373,
24541,
13,
5215,
4842,
305,
13,
5215,
4842,
5815,
2881,
13,
5215,
4842,
305,
29889,
15755,
408,
302,
29876,
13,
3166,
4842,
305,
1053,
5994,
13,
5215,
4842,
305,
29889,
15755,
29889,
2220,
284,
408,
383,
13,
5215,
12655,
408,
7442,
13,
3166,
4842,
305,
29889,
20640,
29889,
29212,
29918,
816,
14952,
1053,
16696,
29519,
13,
5215,
5839,
280,
13,
29937,
2045,
597,
2272,
7345,
305,
29889,
990,
29914,
12631,
29879,
29914,
463,
1089,
29914,
18494,
29918,
1457,
19170,
29918,
12631,
29889,
1420,
13,
13,
29937,
12994,
752,
307,
1646,
1354,
3006,
29629,
22796,
29879,
14458,
13876,
1702,
28336,
288,
694,
29901,
13,
1509,
29918,
29883,
6191,
353,
4842,
305,
29889,
29883,
6191,
29889,
275,
29918,
16515,
580,
13,
10141,
353,
4842,
305,
29889,
10141,
703,
29883,
6191,
29908,
565,
671,
29918,
29883,
6191,
1683,
376,
21970,
1159,
13,
13,
13,
29903,
7520,
29923,
29918,
7724,
5813,
353,
525,
29883,
3780,
1212,
29918,
29885,
1379,
1103,
307,
1393,
29918,
1516,
295,
468,
29889,
23945,
280,
29915,
13,
13,
13,
1990,
21764,
16390,
24541,
29898,
16390,
24541,
1125,
13,
12,
1753,
4770,
2344,
12035,
1311,
29892,
10348,
29918,
2084,
29892,
9027,
29918,
2084,
29892,
4327,
29922,
8516,
1125,
13,
13,
12,
12,
29937,
29871,
29941,
1015,
17593,
1702,
560,
9027,
29918,
2084,
29901,
13,
12,
12,
29937,
21518,
537,
29918,
2084,
353,
8207,
13072,
9351,
29914,
29907,
2021,
1099,
847,
8969,
29954,
29914,
1469,
29914,
21518,
537,
29914,
14968,
29915,
13,
12,
12,
29937,
21518,
537,
29918,
2084,
353,
8207,
13072,
9351,
29914,
29907,
2021,
1099,
847,
8969,
29954,
29914,
1469,
29914,
21518,
537,
29914,
1688,
29915,
13,
12,
12,
29937,
21518,
537,
29918,
2084,
353,
8207,
13072,
9351,
29914,
29907,
2021,
1099,
847,
8969,
29954,
29914,
1469,
29914,
21518,
537,
29914,
791,
29915,
13,
13,
12,
12,
1311,
29889,
21518,
537,
29918,
2084,
353,
9027,
29918,
2084,
13,
12,
12,
1311,
29889,
18494,
29918,
2084,
353,
10348,
29918,
2084,
13,
12,
12,
1311,
29889,
9067,
353,
4327,
13,
13,
12,
12,
1311,
29889,
1958,
5325,
353,
2897,
29889,
1761,
3972,
29898,
1311,
29889,
21518,
537,
29918,
2084,
29897,
13,
12,
12,
29937,
12994,
694,
13654,
381,
1232,
3190,
12927,
378,
525,
3032,
2396,
13,
12,
12,
1311,
29889,
1958,
5325,
353,
518,
13,
12,
12,
12,
295,
363,
560,
297,
1583,
29889,
1958,
5325,
565,
560,
29889,
27382,
2541,
877,
3032,
1495,
1275,
7700,
29962,
13,
12,
12,
1311,
29889,
1958,
5325,
29918,
827,
29918,
1062,
353,
518,
295,
7503,
29899,
29946,
29962,
363,
560,
297,
1583,
29889,
1958,
5325,
29962,
13,
13,
12,
12,
29937,
1051,
15171,
2673,
13,
13,
12,
12,
29937,
18494,
29918,
2084,
353,
8207,
13072,
9351,
29914,
29907,
2021,
1099,
847,
8969,
29954,
29914,
1469,
29914,
15052,
29879,
22208,
13,
12,
12,
1311,
29889,
18494,
5325,
353,
2897,
29889,
1761,
3972,
29898,
18494,
29918,
2084,
29897,
13,
12,
12,
1311,
29889,
18494,
5325,
29918,
827,
29918,
1062,
353,
518,
295,
7503,
29899,
29946,
29962,
363,
560,
297,
1583,
29889,
18494,
5325,
29962,
13,
12,
12,
1311,
29889,
18494,
5325,
353,
518,
13,
12,
12,
12,
295,
718,
15300,
29893,
485,
29915,
363,
560,
297,
1583,
29889,
18494,
5325,
29918,
827,
29918,
1062,
565,
560,
297,
1583,
29889,
1958,
5325,
29918,
827,
29918,
1062,
29962,
13,
13,
12,
12,
1311,
29889,
18494,
5325,
353,
12705,
29898,
1311,
29889,
18494,
5325,
29897,
13,
12,
12,
1311,
29889,
1958,
5325,
353,
12705,
29898,
1311,
29889,
1958,
5325,
29897,
13,
12,
12,
29937,
319,
30046,
328,
381,
6081,
267,
263,
3190,
12927,
316,
10348,
29901,
13,
12,
12,
29937,
363,
474,
297,
3464,
29898,
2435,
29898,
1311,
29889,
18494,
5325,
22164,
13,
12,
12,
29937,
319,
30046,
912,
425,
21103,
3175,
394,
5419,
628,
3190,
4243,
712,
439,
15067,
1053,
279,
29901,
13,
12,
12,
29937,
1311,
29889,
18494,
5325,
29961,
29875,
29962,
353,
518,
1311,
29889,
18494,
5325,
29961,
29875,
29962,
718,
15300,
29893,
485,
2033,
13,
13,
12,
1753,
4770,
2435,
12035,
1311,
1125,
13,
12,
12,
2457,
7431,
29898,
1311,
29889,
18494,
5325,
29897,
13,
13,
12,
1753,
4770,
657,
667,
12035,
1311,
29892,
22645,
1125,
13,
13,
12,
12,
29937,
360,
1430,
29903,
11937,
341,
3301,
13,
12,
12,
1958,
29918,
2084,
353,
1583,
29889,
21518,
537,
29918,
2084,
718,
1583,
29889,
1958,
5325,
29961,
13140,
29962,
13,
12,
12,
1958,
29874,
353,
2254,
2922,
29898,
1958,
29918,
2084,
29897,
13,
12,
12,
29891,
353,
4842,
305,
29889,
294,
29918,
20158,
29898,
1958,
29874,
1839,
1958,
13359,
2083,
3285,
26688,
29922,
7345,
305,
29889,
7411,
29941,
29906,
29897,
13,
12,
12,
29937,
319,
29965,
4571,
29949,
13,
12,
12,
29937,
1174,
4979,
296,
307,
560,
2224,
628,
3190,
4243,
29901,
13,
12,
12,
9507,
353,
851,
29898,
1311,
29889,
18494,
5325,
29961,
13140,
2314,
13,
12,
12,
9507,
353,
10422,
29889,
29880,
17010,
703,
1839,
1159,
13,
12,
12,
9507,
353,
10422,
29889,
29878,
17010,
703,
2033,
1159,
13,
12,
12,
15052,
29918,
2084,
353,
1583,
29889,
18494,
29918,
2084,
718,
10422,
13,
12,
12,
29937,
315,
1191,
14054,
560,
10348,
29901,
13,
12,
12,
27766,
689,
29892,
4559,
29918,
10492,
353,
4842,
5815,
2881,
29889,
1359,
29898,
13,
12,
12,
12,
15052,
29918,
2084,
29897,
29871,
396,
10742,
689,
831,
443,
12489,
13,
13,
12,
12,
29916,
353,
10742,
689,
29889,
1493,
3552,
29906,
29892,
29871,
29896,
29892,
448,
29896,
876,
29871,
396,
9927,
267,
13,
12,
12,
361,
1583,
29889,
9067,
29901,
13,
12,
12,
12,
29916,
353,
1583,
29889,
9067,
29898,
29916,
29897,
13,
12,
12,
2457,
921,
29892,
343,
13,
13,
13,
1990,
6286,
29903,
1103,
307,
1393,
16390,
24541,
29898,
16390,
24541,
1125,
13,
12,
1753,
4770,
2344,
12035,
1311,
29892,
10348,
29918,
2084,
29892,
9027,
29918,
2084,
29892,
4327,
29922,
8516,
1125,
13,
13,
12,
12,
29937,
29941,
1015,
17593,
1702,
560,
9027,
29918,
2084,
29901,
13,
12,
12,
29937,
21518,
537,
29918,
2084,
353,
8207,
13072,
9351,
29914,
29907,
2021,
1099,
847,
8969,
29954,
29914,
1469,
29914,
21518,
537,
29914,
14968,
29915,
13,
12,
12,
29937,
21518,
537,
29918,
2084,
353,
8207,
13072,
9351,
29914,
29907,
2021,
1099,
847,
8969,
29954,
29914,
1469,
29914,
21518,
537,
29914,
1688,
29915,
13,
12,
12,
29937,
21518,
537,
29918,
2084,
353,
8207,
13072,
9351,
29914,
29907,
2021,
1099,
847,
8969,
29954,
29914,
1469,
29914,
21518,
537,
29914,
791,
29915,
13,
13,
12,
12,
1311,
29889,
21518,
537,
29918,
2084,
29922,
21518,
537,
29918,
2084,
13,
12,
12,
1311,
29889,
18494,
29918,
2084,
29922,
18494,
29918,
2084,
13,
12,
12,
1311,
29889,
9067,
29922,
9067,
13,
13,
12,
12,
1311,
29889,
1958,
5325,
353,
2897,
29889,
1761,
3972,
29898,
1311,
29889,
21518,
537,
29918,
2084,
29897,
13,
12,
12,
29937,
2177,
29874,
694,
13654,
381,
1232,
3190,
12927,
378,
525,
3032,
2396,
13,
12,
12,
1311,
29889,
1958,
5325,
353,
518,
295,
363,
560,
297,
1583,
29889,
1958,
5325,
565,
560,
29889,
27382,
2541,
877,
3032,
1495,
1360,
8824,
29962,
13,
12,
12,
1311,
29889,
1958,
5325,
29918,
827,
29918,
1062,
11759,
295,
7503,
29899,
29946,
29962,
363,
560,
297,
1583,
29889,
1958,
5325,
29962,
13,
13,
12,
12,
29937,
1051,
15171,
2673,
13,
13,
12,
12,
29937,
18494,
29918,
2084,
353,
8207,
13072,
9351,
29914,
29907,
2021,
1099,
847,
8969,
29954,
29914,
1469,
29914,
15052,
29879,
22208,
13,
12,
12,
1311,
29889,
18494,
5325,
353,
2897,
29889,
1761,
3972,
29898,
18494,
29918,
2084,
29897,
13,
12,
12,
1311,
29889,
18494,
5325,
29918,
827,
29918,
1062,
11759,
295,
7503,
29899,
29946,
29962,
363,
560,
297,
1583,
29889,
18494,
5325,
29962,
13,
12,
12,
1311,
29889,
18494,
5325,
353,
518,
295,
718,
15300,
29893,
485,
29915,
363,
560,
297,
1583,
29889,
18494,
5325,
29918,
827,
29918,
1062,
565,
560,
297,
1583,
29889,
1958,
5325,
29918,
827,
29918,
1062,
29962,
13,
13,
12,
12,
1311,
29889,
18494,
5325,
353,
12705,
29898,
1311,
29889,
18494,
5325,
29897,
13,
12,
12,
1311,
29889,
1958,
5325,
353,
12705,
29898,
1311,
29889,
1958,
5325,
29897,
13,
13,
12,
12,
29937,
2744,
328,
381,
6081,
267,
263,
3190,
12927,
316,
10348,
29901,
13,
12,
12,
29937,
1454,
474,
297,
3464,
29898,
2435,
29898,
1311,
29889,
18494,
5325,
22164,
13,
12,
12,
12,
29937,
2744,
912,
425,
6081,
394,
5419,
628,
3190,
4243,
712,
439,
15067,
1053,
279,
29901,
13,
12,
12,
12,
29937,
1311,
29889,
18494,
5325,
29961,
29875,
29962,
353,
518,
1311,
29889,
18494,
5325,
29961,
29875,
29962,
718,
15300,
29893,
485,
2033,
13,
12,
12,
13,
12,
1753,
4770,
2435,
12035,
1311,
1125,
13,
12,
12,
2457,
7431,
29898,
1311,
29889,
18494,
5325,
29897,
13,
12,
12,
13,
12,
1753,
4770,
657,
667,
12035,
1311,
29892,
22645,
1125,
13,
13,
12,
12,
29937,
29928,
1430,
29903,
11937,
341,
3301,
13,
12,
12,
1958,
29918,
2084,
353,
1583,
29889,
21518,
537,
29918,
2084,
718,
1583,
29889,
1958,
5325,
29961,
13140,
29962,
13,
12,
12,
1958,
29874,
353,
2254,
2922,
29898,
1958,
29918,
2084,
29897,
13,
12,
12,
29891,
353,
4842,
305,
29889,
294,
29918,
20158,
29898,
1958,
29874,
1839,
1958,
13359,
2083,
3285,
26688,
29922,
7345,
305,
29889,
7411,
29941,
29906,
29897,
29871,
13,
12,
12,
29937,
25951,
4571,
29949,
13,
12,
12,
29937,
2369,
4979,
296,
307,
560,
2224,
628,
3190,
4243,
29901,
13,
12,
12,
9507,
29922,
710,
29898,
1311,
29889,
18494,
5325,
29961,
13140,
2314,
13,
12,
12,
9507,
29922,
9507,
29889,
29880,
17010,
703,
1839,
1159,
13,
12,
12,
9507,
29922,
9507,
29889,
29878,
17010,
703,
2033,
1159,
13,
12,
12,
15052,
29918,
2084,
353,
1583,
29889,
18494,
29918,
2084,
718,
10422,
13,
12,
12,
29937,
29907,
1191,
14054,
560,
10348,
29901,
13,
12,
12,
27766,
689,
29892,
4559,
29918,
10492,
353,
4842,
5815,
2881,
29889,
1359,
29898,
15052,
29918,
2084,
29897,
12,
29937,
27766,
689,
831,
443,
12489,
13,
13,
12,
13,
12,
12,
6550,
353,
4842,
5815,
2881,
29889,
9067,
29879,
29889,
29903,
1103,
307,
1393,
580,
29898,
27766,
689,
29897,
13,
12,
12,
29916,
353,
4842,
5815,
2881,
29889,
9067,
29879,
29889,
29924,
295,
17185,
29898,
29876,
29918,
29885,
1379,
353,
29871,
29906,
29900,
29896,
29892,
4559,
29918,
10492,
353,
4559,
29918,
10492,
5033,
6550,
29897,
13,
12,
13,
13,
12,
12,
29937,
2158,
703,
24111,
310,
6683,
307,
1393,
29901,
6571,
1642,
4830,
29898,
29916,
29889,
2311,
22130,
13,
13,
12,
12,
29937,
572,
29873,
29889,
4532,
580,
13,
12,
12,
29937,
572,
29873,
29889,
326,
4294,
29898,
29916,
29889,
1188,
29906,
580,
29961,
29900,
29892,
29901,
29892,
29901,
1822,
23749,
3285,
274,
1958,
2433,
21012,
1495,
13,
13,
12,
12,
2457,
921,
29892,
343,
13,
13,
12008,
13,
18494,
29918,
2084,
353,
8207,
5184,
29914,
29886,
557,
2049,
26806,
29914,
19617,
1191,
294,
29914,
771,
3746,
342,
294,
29918,
13264,
29887,
29918,
29883,
2021,
1099,
29914,
29883,
798,
29881,
29914,
1753,
2344,
4243,
29914,
23711,
3217,
29918,
24713,
29914,
15052,
29879,
22208,
13,
14968,
29918,
21518,
537,
29918,
2084,
353,
8207,
5184,
29914,
29886,
557,
2049,
26806,
29914,
19617,
1191,
294,
29914,
771,
3746,
342,
294,
29918,
13264,
29887,
29918,
29883,
2021,
1099,
29914,
29883,
798,
29881,
29914,
1753,
2344,
4243,
29914,
23711,
3217,
29918,
24713,
29914,
21518,
537,
29914,
14968,
22208,
13,
791,
29918,
21518,
537,
29918,
2084,
353,
8207,
5184,
29914,
29886,
557,
2049,
26806,
29914,
19617,
1191,
294,
29914,
771,
3746,
342,
294,
29918,
13264,
29887,
29918,
29883,
2021,
1099,
29914,
29883,
798,
29881,
29914,
1753,
2344,
4243,
29914,
23711,
3217,
29918,
24713,
29914,
21518,
537,
29914,
791,
22208,
13,
1688,
29918,
21518,
537,
29918,
2084,
353,
8207,
5184,
29914,
29886,
557,
2049,
26806,
29914,
19617,
1191,
294,
29914,
771,
3746,
342,
294,
29918,
13264,
29887,
29918,
29883,
2021,
1099,
29914,
29883,
798,
29881,
29914,
1753,
2344,
4243,
29914,
23711,
3217,
29918,
24713,
29914,
21518,
537,
29914,
1688,
22208,
13,
12008,
13,
18494,
29918,
2084,
353,
8207,
9799,
29914,
29940,
3289,
29914,
5184,
29914,
29883,
2021,
16434,
29914,
14538,
1691,
29914,
15052,
29879,
22208,
13,
14968,
29918,
21518,
537,
29918,
2084,
353,
8207,
9799,
29914,
29940,
3289,
29914,
5184,
29914,
29883,
2021,
16434,
29914,
14538,
1691,
29914,
21518,
537,
29914,
14968,
22208,
13,
791,
29918,
21518,
537,
29918,
2084,
353,
8207,
9799,
29914,
29940,
3289,
29914,
5184,
29914,
29883,
2021,
16434,
29914,
14538,
1691,
29914,
21518,
537,
29914,
791,
22208,
13,
1688,
29918,
21518,
537,
29918,
2084,
353,
8207,
9799,
29914,
29940,
3289,
29914,
5184,
29914,
29883,
2021,
16434,
29914,
14538,
1691,
29914,
21518,
537,
29914,
1688,
22208,
13,
13,
14968,
842,
353,
6286,
29903,
1103,
307,
1393,
16390,
24541,
29898,
18494,
29918,
2084,
29892,
7945,
29918,
21518,
537,
29918,
2084,
5501,
2303,
29931,
1495,
13,
791,
842,
353,
6286,
29903,
1103,
307,
1393,
16390,
24541,
29898,
18494,
29918,
2084,
29892,
659,
29918,
21518,
537,
29918,
2084,
5501,
2303,
29931,
1495,
13,
1688,
842,
353,
6286,
29903,
1103,
307,
1393,
16390,
24541,
29898,
18494,
29918,
2084,
29892,
1243,
29918,
21518,
537,
29918,
2084,
5501,
2303,
29931,
1495,
13,
13,
29937,
12089,
4462,
5688,
1702,
1147,
25187,
2361,
316,
10348,
343,
316,
2910,
294,
316,
1232,
9589,
1657,
359,
316,
7945,
343,
659,
29901,
13,
29937,
1596,
29898,
14968,
842,
17255,
657,
667,
12035,
29906,
29900,
876,
13,
29937,
1596,
29898,
791,
842,
17255,
657,
667,
12035,
29906,
29900,
876,
13,
13,
29937,
29933,
14789,
29918,
14226,
29901,
18946,
8266,
313,
29896,
29899,
29941,
29897,
13,
16175,
29918,
2311,
353,
29871,
29946,
29947,
13,
29937,
350,
14789,
29918,
14226,
29901,
18946,
8266,
313,
29896,
29899,
29941,
29897,
13,
14968,
29918,
12657,
353,
3630,
10036,
29898,
14968,
842,
29892,
9853,
29918,
2311,
29892,
528,
21897,
29922,
5574,
29897,
13,
791,
29918,
12657,
353,
3630,
10036,
29898,
791,
842,
29892,
29871,
29941,
29906,
29892,
528,
21897,
29922,
8824,
29897,
13,
1688,
29918,
12657,
353,
3630,
10036,
29898,
1688,
842,
29892,
29871,
29941,
29906,
29892,
528,
21897,
29922,
8824,
29897,
13,
13,
29937,
390,
3352,
29901,
13,
12008,
13,
29937,
29925,
272,
1354,
439,
15067,
410,
1646,
19102,
378,
951,
6779,
313,
29907,
5194,
12809,
1718,
2672,
12336,
29903,
29991,
1125,
13,
1990,
951,
6779,
29898,
15755,
29889,
7355,
1125,
13,
12,
1753,
4770,
2344,
12035,
1311,
1125,
13,
12,
12,
9136,
29898,
3226,
6779,
29892,
1583,
467,
1649,
2344,
1649,
580,
396,
7444,
26241,
831,
26692,
16632,
4568,
13,
12,
12,
1311,
29889,
20580,
29896,
353,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
29896,
29892,
29871,
29953,
29892,
29871,
29945,
29892,
7164,
29922,
29906,
29897,
13,
12,
12,
1311,
29889,
1526,
29896,
353,
302,
29876,
29889,
7976,
11426,
29906,
29881,
29898,
29896,
29892,
29906,
29897,
13,
12,
12,
1311,
29889,
20580,
29906,
353,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
29953,
29892,
29871,
29896,
29953,
29892,
29871,
29945,
29892,
7164,
29922,
29906,
29897,
13,
12,
12,
1311,
29889,
1526,
29906,
353,
302,
29876,
29889,
7976,
11426,
29906,
29881,
29898,
29906,
29897,
13,
12,
12,
1311,
29889,
20580,
29941,
353,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
29896,
29953,
29892,
29871,
29896,
29906,
29900,
29892,
29871,
29941,
29892,
7164,
29922,
29896,
29897,
13,
12,
12,
1311,
29889,
13801,
29896,
353,
302,
29876,
29889,
12697,
29898,
29955,
29930,
29955,
29930,
29896,
29906,
29900,
29892,
29871,
29906,
29945,
29953,
29897,
29937,
5030,
29874,
12954,
499,
29874,
13,
12,
12,
1311,
29889,
13801,
29906,
353,
302,
29876,
29889,
12697,
29898,
29906,
29945,
29953,
29892,
29871,
29896,
29900,
29897,
29937,
5030,
29874,
316,
4497,
1458,
13,
12,
12,
13,
12,
1753,
6375,
29898,
1311,
29892,
921,
1125,
13,
12,
12,
29916,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
20580,
29896,
29898,
29916,
876,
13,
12,
12,
29916,
353,
1583,
29889,
1526,
29896,
29898,
29916,
29897,
13,
12,
12,
29916,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
20580,
29906,
29898,
29916,
876,
13,
12,
12,
29916,
353,
1583,
29889,
1526,
29906,
29898,
29916,
29897,
13,
12,
12,
29916,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
20580,
29941,
29898,
29916,
876,
13,
12,
12,
29916,
353,
921,
29889,
1493,
6278,
29896,
29892,
29871,
29955,
29930,
29955,
29930,
29896,
29906,
29900,
29897,
13,
12,
12,
29916,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
13801,
29896,
29898,
29916,
876,
29937,
25394,
1290,
316,
5039,
2709,
1104,
29884,
427,
425,
4497,
1458,
316,
425,
2117,
29874,
12954,
499,
29874,
13,
12,
12,
29916,
353,
383,
29889,
2695,
3317,
29898,
1311,
29889,
13801,
29906,
29898,
29916,
511,
3964,
29922,
29896,
29897,
29937,
25394,
1290,
316,
5039,
2709,
4964,
3317,
427,
425,
4497,
1458,
316,
425,
2117,
29874,
12954,
499,
29874,
13,
12,
12,
2457,
921,
13,
12008,
13,
13,
29937,
5918,
11426,
29906,
29881,
3552,
29896,
29892,
29906,
876,
13,
29937,
4842,
305,
29889,
15755,
29889,
1168,
29894,
29906,
29881,
29898,
262,
29918,
305,
12629,
29892,
714,
29918,
305,
12629,
29892,
8466,
29918,
2311,
29897,
1599,
8466,
29918,
2311,
353,
313,
29896,
29892,
29871,
29953,
29896,
29897,
13,
29937,
297,
29918,
305,
12629,
1599,
29906,
29892,
714,
29918,
305,
12629,
1599,
518,
29941,
29906,
29892,
29953,
29946,
1822,
13,
29937,
5994,
448,
1405,
594,
314,
13,
13,
13,
1990,
12002,
12810,
29887,
11426,
29906,
29881,
29898,
15755,
29889,
7355,
1125,
13,
12,
1753,
4770,
2344,
12035,
1311,
1125,
13,
12,
12,
9136,
29898,
12756,
12810,
29887,
11426,
29906,
29881,
29892,
1583,
467,
1649,
2344,
1649,
580,
13,
13,
12,
1753,
6375,
29898,
1311,
29892,
921,
1125,
13,
12,
12,
9294,
7431,
29898,
29916,
29889,
2311,
3101,
1275,
29871,
29946,
29892,
921,
29889,
2311,
580,
13,
12,
12,
29933,
29892,
315,
29892,
399,
29892,
379,
353,
921,
29889,
2311,
580,
13,
12,
12,
2457,
383,
29889,
485,
29887,
29918,
10109,
29906,
29881,
29898,
29916,
29892,
313,
29956,
29892,
379,
8106,
1493,
29898,
29933,
29892,
315,
29897,
13,
13,
13,
1990,
12002,
7976,
11426,
29906,
29881,
29898,
15755,
29889,
7355,
1125,
13,
12,
1753,
4770,
2344,
12035,
1311,
1125,
13,
12,
12,
9136,
29898,
12756,
7976,
11426,
29906,
29881,
29892,
1583,
467,
1649,
2344,
1649,
580,
13,
13,
12,
1753,
6375,
29898,
1311,
29892,
921,
1125,
13,
12,
12,
9294,
7431,
29898,
29916,
29889,
2311,
3101,
1275,
29871,
29946,
29892,
921,
29889,
2311,
580,
13,
12,
12,
29933,
29892,
315,
29892,
399,
29892,
379,
353,
921,
29889,
2311,
580,
13,
12,
12,
2457,
383,
29889,
3317,
29918,
10109,
29906,
29881,
29898,
29916,
29892,
313,
29956,
29892,
379,
8106,
1493,
29898,
29933,
29892,
315,
29897,
13,
13,
13,
1990,
478,
26788,
728,
29898,
15755,
29889,
7355,
1125,
13,
12,
15945,
29908,
13,
12,
19737,
29911,
25350,
5314,
310,
278,
478,
26788,
728,
1904,
29889,
13,
13,
12,
29909,
1388,
415,
287,
515,
29901,
2045,
597,
3292,
29889,
510,
29914,
8222,
768,
11017,
29914,
7345,
305,
29899,
29894,
1505,
728,
13,
12,
1576,
1494,
26278,
892,
1754,
29901,
313,
29875,
29897,
26385,
363,
278,
4567,
830,
29931,
29965,
15359,
29892,
313,
2236,
29897,
26385,
363,
278,
13,
12,
326,
771,
546,
368,
20917,
848,
746,
9558,
292,
515,
405,
29950,
29956,
29907,
6660,
405,
3210,
29956,
297,
278,
8072,
29899,
18045,
15359,
29892,
322,
313,
25609,
29897,
13,
12,
2616,
276,
428,
363,
1652,
8606,
292,
297,
278,
8072,
29899,
18045,
15359,
29889,
13,
12,
15945,
29908,
13,
13,
12,
1753,
4770,
2344,
12035,
1311,
1125,
13,
12,
12,
9136,
29898,
29963,
26788,
728,
29892,
1583,
467,
1649,
2344,
1649,
580,
13,
12,
12,
1311,
29889,
1129,
3775,
353,
518,
29946,
29892,
29871,
29946,
29892,
29871,
29906,
29892,
29871,
29906,
29962,
13,
12,
12,
1311,
29889,
22100,
353,
302,
29876,
29889,
16941,
2556,
29898,
13,
12,
12,
12,
15755,
29889,
1168,
29894,
29906,
29881,
29898,
29906,
29892,
29871,
29953,
29946,
29892,
29871,
29941,
29892,
29871,
380,
2426,
7607,
29896,
29892,
1583,
29889,
1129,
3775,
29961,
29900,
11724,
7164,
29922,
29941,
511,
13,
12,
12,
12,
15755,
29889,
1123,
29931,
29965,
3285,
13,
13,
12,
12,
12,
15755,
29889,
1168,
29894,
29906,
29881,
29898,
29953,
29946,
29892,
29871,
29896,
29906,
29947,
29892,
29871,
29945,
29892,
380,
2426,
7607,
29896,
29892,
1583,
29889,
1129,
3775,
29961,
29896,
11724,
7164,
29922,
29906,
511,
13,
12,
12,
12,
15755,
29889,
1123,
29931,
29965,
3285,
13,
13,
12,
12,
12,
15755,
29889,
1168,
29894,
29906,
29881,
29898,
29896,
29906,
29947,
29892,
29871,
29906,
29945,
29953,
29892,
29871,
29941,
29892,
380,
2426,
29922,
29896,
29892,
7164,
29922,
29896,
511,
13,
12,
12,
12,
15755,
29889,
1123,
29931,
29965,
3285,
13,
12,
12,
12,
15755,
29889,
1168,
29894,
29906,
29881,
29898,
29906,
29945,
29953,
29892,
29871,
29906,
29945,
29953,
29892,
29871,
29941,
29892,
380,
2426,
7607,
29896,
29892,
1583,
29889,
1129,
3775,
29961,
29906,
11724,
7164,
29922,
29896,
511,
13,
12,
12,
12,
15755,
29889,
1123,
29931,
29965,
3285,
13,
13,
12,
12,
12,
15755,
29889,
1168,
29894,
29906,
29881,
29898,
29906,
29945,
29953,
29892,
29871,
29945,
29896,
29906,
29892,
29871,
29941,
29892,
380,
2426,
29922,
29896,
29892,
7164,
29922,
29896,
511,
13,
12,
12,
12,
15755,
29889,
1123,
29931,
29965,
3285,
13,
12,
12,
12,
15755,
29889,
1168,
29894,
29906,
29881,
29898,
29945,
29896,
29906,
29892,
29871,
29896,
29900,
29906,
29946,
29892,
29871,
29941,
29892,
380,
2426,
29922,
29896,
29892,
7164,
29922,
29896,
511,
13,
12,
12,
12,
15755,
29889,
1123,
29931,
29965,
3285,
13,
12,
12,
12,
29937,
302,
29876,
29889,
7976,
11426,
29906,
29881,
3552,
29896,
29892,
1311,
29889,
1129,
3775,
29961,
29941,
11724,
380,
2426,
29922,
1311,
29889,
1129,
3775,
29961,
29941,
2314,
13,
12,
12,
29897,
13,
12,
12,
1311,
29889,
485,
29887,
10109,
353,
12002,
12810,
29887,
11426,
29906,
29881,
580,
13,
12,
12,
1311,
29889,
13801,
353,
302,
29876,
29889,
16941,
2556,
29898,
13,
12,
12,
12,
15755,
29889,
12697,
29898,
29896,
29900,
29906,
29946,
29892,
29871,
29946,
29900,
29929,
29953,
511,
13,
12,
12,
12,
15755,
29889,
12697,
29898,
29946,
29900,
29929,
29953,
29892,
29871,
29896,
29897,
13,
12,
12,
29897,
13,
12,
12,
29937,
12606,
343,
10481,
409,
7814,
439,
8710,
427,
29871,
29896,
29945,
29955,
29906,
29947,
29953,
29946,
29900,
29900,
29900,
13,
13,
12,
1753,
6375,
29898,
1311,
29892,
921,
1125,
13,
12,
12,
29916,
353,
1583,
29889,
22100,
29898,
29916,
29897,
29871,
396,
869,
17858,
1082,
29898,
29900,
29892,
29871,
29906,
29892,
29871,
29941,
29892,
29871,
29896,
467,
1285,
5526,
681,
580,
13,
12,
12,
29916,
353,
1583,
29889,
485,
29887,
10109,
29898,
29916,
29897,
13,
12,
12,
29937,
921,
353,
921,
29889,
1493,
29898,
29916,
29889,
2311,
29898,
29900,
511,
448,
29896,
29897,
13,
12,
12,
29916,
353,
1583,
29889,
13801,
29898,
29916,
29897,
13,
12,
12,
29937,
289,
29892,
274,
29892,
281,
29892,
298,
353,
921,
29889,
12181,
13,
12,
12,
29937,
921,
353,
921,
29889,
1493,
29898,
29890,
29892,
274,
29892,
448,
29896,
467,
12676,
6278,
29896,
29897,
13,
12,
12,
2457,
921,
13,
13,
13,
13,
1990,
29524,
6779,
29898,
15755,
29889,
7355,
1125,
13,
12,
1753,
4770,
2344,
12035,
1311,
1125,
13,
12,
12,
9136,
29898,
29907,
3780,
6779,
29892,
1583,
467,
1649,
2344,
1649,
580,
396,
7444,
26241,
831,
26692,
16632,
4568,
13,
12,
12,
1311,
29889,
3317,
29918,
10109,
29896,
353,
302,
29876,
29889,
7976,
11426,
29906,
29881,
3552,
29896,
29892,
29906,
876,
13,
12,
12,
1311,
29889,
3317,
29918,
10109,
29906,
353,
302,
29876,
29889,
7976,
11426,
29906,
29881,
3552,
29896,
29892,
29906,
876,
13,
12,
12,
1311,
29889,
3317,
29918,
10109,
29941,
353,
302,
29876,
29889,
7976,
11426,
29906,
29881,
3552,
29896,
29892,
29906,
876,
13,
12,
12,
1311,
29889,
3317,
29918,
10109,
29946,
353,
302,
29876,
29889,
7976,
11426,
29906,
29881,
3552,
29896,
29892,
29906,
876,
13,
12,
12,
1311,
29889,
3317,
29918,
10109,
29945,
353,
302,
29876,
29889,
7976,
11426,
29906,
29881,
3552,
29896,
29892,
29906,
876,
13,
12,
12,
1311,
29889,
3317,
29918,
10109,
29953,
353,
302,
29876,
29889,
7976,
11426,
29906,
29881,
3552,
29896,
29892,
29906,
876,
13,
13,
12,
12,
1311,
29889,
20580,
29896,
353,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
29906,
29892,
29871,
29941,
29906,
29892,
29871,
29941,
29892,
380,
2426,
29922,
29896,
29892,
7164,
29922,
29896,
29897,
13,
12,
12,
1311,
29889,
20580,
29906,
353,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
29941,
29906,
29892,
29871,
29953,
29946,
29892,
29871,
29941,
29892,
380,
2426,
29922,
29896,
29892,
7164,
29922,
29896,
29897,
13,
12,
12,
1311,
29889,
20580,
29941,
353,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
29953,
29946,
29892,
29871,
29896,
29906,
29947,
29892,
29871,
29941,
29892,
380,
2426,
29922,
29896,
29892,
7164,
29922,
29896,
29897,
13,
12,
12,
1311,
29889,
20580,
29946,
353,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
29896,
29906,
29947,
29892,
29871,
29906,
29945,
29953,
29892,
29871,
29941,
29892,
380,
2426,
29922,
29896,
29892,
7164,
29922,
29896,
29897,
13,
12,
12,
1311,
29889,
20580,
29945,
353,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
29906,
29945,
29953,
29892,
29871,
29945,
29896,
29906,
29892,
29871,
29941,
29892,
380,
2426,
29922,
29896,
29892,
7164,
29922,
29896,
29897,
13,
12,
12,
1311,
29889,
20580,
29953,
353,
302,
29876,
29889,
1168,
29894,
29906,
29881,
29898,
29945,
29896,
29906,
29892,
29871,
29896,
29900,
29906,
29946,
29892,
29871,
29941,
29892,
380,
2426,
29922,
29896,
29892,
7164,
29922,
29896,
29897,
13,
13,
12,
12,
1311,
29889,
13801,
29896,
353,
302,
29876,
29889,
12697,
29898,
29953,
29896,
29955,
29946,
29955,
29906,
29892,
29896,
29897,
13,
12,
12,
13,
13,
12,
1753,
6375,
29898,
1311,
29892,
921,
1125,
13,
12,
12,
29937,
1168,
2090,
1290,
316,
5039,
2709,
830,
24126,
13,
13,
12,
12,
29937,
29829,
29924,
1001,
29909,
315,
3301,
29909,
13,
12,
12,
29916,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
20580,
29896,
29898,
29916,
876,
13,
12,
12,
29916,
353,
1583,
29889,
3317,
29918,
10109,
29896,
29898,
29916,
29897,
13,
13,
13,
12,
12,
29937,
1660,
29954,
18783,
29909,
315,
3301,
29909,
13,
12,
12,
29916,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
20580,
29906,
29898,
29916,
876,
13,
12,
12,
29916,
353,
1583,
29889,
3317,
29918,
10109,
29906,
29898,
29916,
29897,
13,
13,
12,
12,
29937,
4945,
29907,
1001,
29909,
315,
3301,
29909,
13,
12,
12,
29916,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
20580,
29941,
29898,
29916,
876,
13,
12,
12,
29916,
353,
1583,
29889,
3317,
29918,
10109,
29941,
29898,
29916,
29897,
13,
13,
12,
12,
29937,
29907,
29965,
1718,
6040,
315,
3301,
29909,
13,
12,
12,
29916,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
20580,
29946,
29898,
29916,
876,
13,
12,
12,
29916,
353,
1583,
29889,
3317,
29918,
10109,
29946,
29898,
29916,
29897,
13,
13,
12,
12,
29937,
13356,
1177,
6040,
315,
3301,
29909,
13,
12,
12,
29916,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
20580,
29945,
29898,
29916,
876,
13,
12,
12,
29916,
353,
1583,
29889,
3317,
29918,
10109,
29945,
29898,
29916,
29897,
13,
13,
13,
12,
12,
29937,
1660,
29990,
6040,
315,
3301,
29909,
13,
12,
12,
29916,
353,
383,
29889,
2674,
29884,
29898,
1311,
29889,
20580,
29953,
29898,
29916,
876,
13,
12,
12,
29916,
353,
1583,
29889,
3317,
29918,
10109,
29953,
29898,
29916,
29897,
13,
13,
13,
12,
12,
29916,
353,
921,
29889,
1493,
3552,
29916,
29889,
2311,
29898,
29900,
511,
29899,
29896,
876,
13,
12,
12,
29937,
2158,
29898,
29916,
29889,
2311,
3101,
13,
12,
12,
29916,
353,
1583,
29889,
13801,
29896,
29898,
29916,
29897,
13,
13,
13,
12,
12,
2457,
921,
13,
13,
4299,
29877,
29922,
29907,
3780,
6779,
580,
13,
4299,
29877,
353,
29472,
29889,
517,
29898,
10141,
29897,
13,
29883,
5385,
291,
353,
302,
29876,
29889,
29924,
1660,
29931,
2209,
580,
29871,
396,
7403,
18594,
425,
282,
1064,
29881,
1458,
13,
29937,
28770,
291,
353,
4522,
29907,
10578,
29931,
2209,
29898,
9313,
428,
2433,
2083,
1495,
13,
20640,
466,
3136,
353,
5994,
29889,
3253,
314,
29898,
4299,
29877,
29889,
16744,
3285,
301,
29878,
29922,
29896,
29872,
29899,
29941,
29897,
6552,
7688,
29918,
7099,
388,
29922,
29896,
29872,
29899,
29946,
29897,
13,
29937,
5994,
466,
3136,
353,
5994,
29889,
26016,
29928,
29898,
4299,
29877,
29889,
16744,
3285,
301,
29878,
29922,
29896,
29872,
29899,
29946,
29897,
13,
29937,
1596,
29898,
4299,
29877,
29897,
13,
13,
29937,
1596,
29898,
14968,
29918,
12657,
29897,
13,
29937,
1596,
29898,
1853,
29898,
14968,
29918,
12657,
876,
13,
13,
13,
29937,
1596,
29898,
29916,
29897,
13,
29937,
1596,
29898,
29916,
29889,
2311,
3101,
13,
29937,
1596,
29898,
29891,
29897,
13,
29937,
1596,
29898,
29891,
29889,
2311,
3101,
13,
13,
1753,
679,
29918,
655,
29872,
29918,
29885,
344,
29898,
1478,
1127,
29892,
343,
29892,
4327,
1125,
13,
12,
29885,
344,
29918,
6758,
353,
29871,
29900,
29889,
29900,
13,
12,
655,
29872,
29918,
6758,
353,
29871,
29900,
29889,
29900,
13,
12,
7827,
353,
29871,
29900,
29871,
13,
12,
1478,
1127,
29892,
343,
353,
4327,
29898,
1478,
1127,
29889,
1272,
511,
4327,
29898,
29891,
29889,
1272,
29897,
13,
12,
1454,
474,
29916,
297,
3464,
29898,
29891,
29889,
12181,
29961,
29900,
29962,
1125,
13,
12,
12,
7827,
4619,
29871,
29896,
13,
12,
12,
655,
29872,
29918,
6758,
4619,
6425,
29898,
1478,
1127,
29961,
861,
29962,
448,
343,
29961,
861,
2314,
13,
12,
12,
29885,
344,
29918,
6758,
4619,
313,
1478,
1127,
29961,
861,
29962,
448,
343,
29961,
861,
2314,
16395,
1478,
1127,
29961,
861,
29962,
448,
343,
29961,
861,
2314,
13,
12,
2457,
611,
29872,
29918,
6758,
29914,
7827,
29892,
4842,
305,
29889,
3676,
29898,
29885,
344,
29918,
6758,
29914,
7827,
29897,
13,
13,
29937,
12994,
758,
7099,
381,
343,
29892,
425,
4226,
466,
598,
7681,
29889,
317,
3768,
1457,
1277,
560,
11329,
16497,
29901,
13,
29979,
29918,
29940,
12054,
353,
29871,
29896,
29900,
13,
13,
6758,
267,
353,
11117,
14968,
2396,
1051,
3285,
525,
3084,
16337,
2396,
1051,
28296,
13,
1195,
29918,
791,
29918,
6758,
353,
11117,
655,
29872,
2396,
5785,
877,
25433,
5477,
525,
29885,
344,
2396,
5785,
877,
25433,
5477,
525,
6758,
2396,
5785,
877,
25433,
1495,
500,
13,
4548,
401,
353,
525,
29883,
3780,
29918,
29885,
1379,
1103,
307,
1393,
29918,
1516,
295,
468,
29915,
13,
13,
1753,
4327,
29898,
29916,
1125,
13,
12,
2457,
4842,
305,
29889,
1188,
29898,
29916,
29914,
29979,
29918,
29940,
12054,
29897,
13,
13,
1753,
16402,
29918,
9067,
29898,
29916,
1125,
13,
12,
2457,
612,
29918,
29940,
12054,
29930,
7345,
305,
29889,
4548,
29898,
7345,
305,
29889,
294,
29918,
20158,
29898,
29916,
876,
13,
13,
1454,
21502,
305,
297,
3464,
29898,
29896,
29900,
29900,
1125,
13,
12,
2158,
703,
2369,
509,
264,
1743,
856,
320,
29876,
1159,
29871,
396,
14192,
724,
29976,
425,
3810,
316,
875,
1267,
9993,
13,
12,
26495,
29918,
6758,
353,
29871,
29900,
29889,
29900,
29871,
396,
560,
6410,
427,
9747,
21502,
305,
316,
875,
1267,
9993,
13,
12,
7827,
353,
29871,
29900,
13,
13,
12,
4299,
29877,
29889,
14968,
580,
29871,
396,
12994,
10223,
279,
560,
29472,
1702,
560,
6694,
13,
12,
1454,
921,
29892,
343,
297,
7945,
29918,
12657,
29901,
13,
13,
12,
12,
7827,
4619,
29871,
29896,
13,
12,
12,
29937,
12509,
29629,
263,
274,
1489,
10843,
1232,
4656,
13833,
427,
17824,
1869,
26808,
27835,
29901,
13,
12,
12,
20640,
466,
3136,
29889,
9171,
29918,
5105,
580,
13,
13,
12,
12,
29891,
353,
4327,
29898,
29891,
29897,
29871,
396,
4226,
466,
14054,
13,
13,
12,
12,
29916,
353,
921,
29889,
517,
29898,
10141,
29897,
13,
12,
12,
29891,
353,
343,
29889,
517,
29898,
10141,
29897,
13,
13,
12,
12,
4905,
353,
29472,
29898,
29916,
29897,
29871,
396,
6375,
13,
12,
12,
6758,
353,
28770,
291,
29898,
4905,
29889,
29879,
802,
29872,
911,
3285,
343,
29889,
29879,
802,
29872,
911,
3101,
29871,
396,
6161,
2709,
628,
6410,
13,
12,
12,
29937,
1596,
29898,
29888,
29915,
6758,
29901,
426,
6758,
29901,
29889,
29946,
29888,
29913,
1495,
13,
12,
12,
6758,
29889,
1627,
1328,
580,
29871,
396,
1250,
1328,
1209,
13,
12,
12,
20640,
466,
3136,
29889,
10568,
580,
29871,
396,
5994,
15677,
13,
13,
12,
12,
26495,
29918,
6758,
4619,
6410,
29889,
667,
580,
29871,
396,
1274,
398,
352,
14054,
560,
6410,
316,
4404,
9853,
13,
13,
12,
26495,
29918,
6758,
353,
6694,
29918,
6758,
29914,
7827,
13,
12,
6758,
267,
1839,
14968,
13359,
4397,
29898,
26495,
29918,
6758,
29897,
29871,
396,
869,
667,
3101,
13,
13,
12,
791,
29918,
6758,
353,
29871,
29900,
29889,
29900,
13,
12,
655,
29872,
29892,
286,
344,
353,
29871,
29900,
29892,
29900,
29871,
13,
12,
7827,
353,
29871,
29900,
13,
12,
4299,
29877,
29889,
14513,
580,
29871,
396,
4721,
862,
279,
560,
29472,
1702,
659,
1458,
1290,
343,
29914,
29877,
1243,
13,
12,
2158,
703,
7211,
1743,
856,
320,
29876,
1159,
13,
12,
1454,
921,
29892,
343,
297,
659,
29918,
12657,
29901,
13,
12,
12,
7827,
4619,
29871,
29896,
13,
13,
12,
12,
29891,
353,
4327,
29898,
29891,
29897,
29871,
396,
4226,
466,
14054,
13,
13,
12,
12,
29916,
353,
921,
29889,
517,
29898,
10141,
29897,
13,
12,
12,
29891,
353,
343,
29889,
517,
29898,
10141,
29897,
13,
13,
12,
12,
4905,
353,
29472,
29898,
29916,
29897,
13,
12,
12,
6758,
353,
28770,
291,
29898,
4905,
29889,
29879,
802,
29872,
911,
3285,
343,
29889,
29879,
802,
29872,
911,
3101,
13,
12,
12,
791,
29918,
6758,
4619,
6410,
29889,
667,
580,
13,
12,
12,
655,
29872,
29918,
5753,
398,
29892,
286,
344,
29918,
5753,
398,
353,
679,
29918,
655,
29872,
29918,
29885,
344,
29898,
4905,
29889,
29879,
802,
29872,
911,
3285,
343,
29889,
29879,
802,
29872,
911,
3285,
16402,
29918,
9067,
29897,
13,
12,
12,
655,
29872,
4619,
611,
29872,
29918,
5753,
398,
13,
12,
12,
29885,
344,
4619,
286,
344,
29918,
5753,
398,
13,
13,
12,
791,
29918,
6758,
29871,
353,
659,
29918,
6758,
29914,
7827,
13,
12,
655,
29872,
353,
611,
29872,
29914,
7827,
13,
12,
29885,
344,
353,
286,
344,
29914,
7827,
13,
12,
6758,
267,
1839,
3084,
16337,
13359,
4397,
29898,
791,
29918,
6758,
29897,
29871,
396,
869,
667,
3101,
13,
12,
2158,
29898,
29888,
29915,
29961,
1022,
426,
1022,
2878,
6525,
518,
5323,
262,
29901,
426,
26495,
29918,
6758,
29901,
29889,
29946,
29888,
29913,
3816,
1440,
29901,
426,
791,
29918,
6758,
29901,
29889,
29946,
29888,
6525,
1495,
13,
12,
2158,
29898,
29888,
12764,
29873,
29961,
1440,
14861,
29923,
29901,
426,
655,
29872,
29901,
29889,
29946,
29888,
29913,
3816,
1440,
341,
1660,
29901,
426,
29885,
344,
29901,
29889,
29946,
29888,
6525,
1495,
13,
13,
12,
29937,
11095,
25480,
13,
12,
361,
313,
791,
29918,
6758,
5277,
1375,
29918,
791,
29918,
6758,
1839,
6758,
11287,
470,
313,
29885,
344,
5277,
1375,
29918,
791,
29918,
6758,
1839,
29885,
344,
11287,
470,
313,
655,
29872,
14065,
1195,
29918,
791,
29918,
6758,
1839,
655,
29872,
2033,
1125,
13,
12,
12,
9507,
353,
1518,
401,
29974,
4286,
415,
29915,
13,
12,
12,
2158,
29898,
29888,
29915,
29903,
5555,
408,
426,
9507,
29913,
1495,
13,
12,
12,
7345,
305,
29889,
7620,
29898,
4299,
29877,
29892,
10422,
29897,
13,
13,
12,
12,
361,
659,
29918,
6758,
5277,
1375,
29918,
791,
29918,
6758,
1839,
6758,
2033,
29901,
13,
12,
12,
12,
1195,
29918,
791,
29918,
6758,
1839,
6758,
2033,
353,
659,
29918,
6758,
13,
12,
12,
361,
286,
344,
5277,
1375,
29918,
791,
29918,
6758,
1839,
29885,
344,
2033,
29901,
13,
12,
12,
12,
1195,
29918,
791,
29918,
6758,
1839,
29885,
344,
2033,
353,
286,
344,
29871,
13,
12,
12,
361,
611,
29872,
14065,
1195,
29918,
791,
29918,
6758,
1839,
655,
29872,
2033,
29901,
29871,
13,
12,
12,
12,
1195,
29918,
791,
29918,
6758,
1839,
655,
29872,
2033,
353,
611,
29872,
13,
13,
13,
4230,
29918,
1022,
2878,
353,
21502,
305,
13,
29937,
1833,
29918,
29212,
353,
1364,
14952,
29889,
657,
29918,
4230,
29918,
29212,
580,
13,
13,
29937,
12524,
5659,
1430,
5194,
29902,
3919,
29949,
13,
29876,
29918,
1022,
2878,
29879,
353,
29871,
29945,
29900,
29900,
13,
13,
29519,
29918,
2287,
5454,
29979,
353,
29871,
29900,
29889,
29929,
29929,
13,
13967,
29918,
29923,
13152,
3210,
29918,
29519,
29918,
2287,
5454,
29979,
353,
29871,
29896,
13,
4299,
29877,
353,
4842,
305,
29889,
1359,
29898,
9507,
29897,
13,
20640,
466,
3136,
353,
5994,
29889,
26016,
29928,
29898,
4299,
29877,
29889,
16744,
3285,
301,
29878,
29922,
29896,
29872,
29899,
29946,
29892,
19399,
29922,
29900,
29889,
29929,
29897,
13,
816,
14952,
353,
16696,
29519,
29898,
20640,
466,
3136,
29892,
4331,
29918,
2311,
29922,
13967,
29918,
29923,
13152,
3210,
29918,
29519,
29918,
2287,
5454,
29979,
29892,
330,
2735,
29922,
29519,
29918,
2287,
5454,
29979,
29897,
268,
13,
13,
1022,
2878,
29918,
1240,
353,
29871,
29900,
396,
21502,
12168,
451,
4857,
1747,
29889,
29871,
13,
12648,
29918,
1806,
1001,
353,
29871,
29896,
29900,
29900,
13,
13,
1454,
21502,
305,
297,
3464,
29898,
4230,
29918,
1022,
2878,
29892,
302,
29918,
1022,
2878,
29879,
1125,
13,
12,
2158,
703,
2369,
509,
264,
1743,
856,
320,
29876,
1159,
29871,
396,
14192,
724,
29976,
425,
3810,
316,
875,
1267,
9993,
13,
12,
26495,
29918,
6758,
353,
29871,
29900,
29889,
29900,
29871,
396,
560,
6410,
427,
9747,
21502,
305,
316,
875,
1267,
9993,
13,
12,
7827,
353,
29871,
29900,
13,
13,
12,
4299,
29877,
29889,
14968,
580,
29871,
396,
12994,
10223,
279,
560,
29472,
1702,
560,
6694,
13,
12,
1454,
921,
29892,
343,
297,
7945,
29918,
12657,
29901,
13,
13,
12,
12,
7827,
4619,
29871,
29896,
13,
12,
12,
29937,
12509,
29629,
263,
274,
1489,
10843,
1232,
4656,
13833,
427,
17824,
1869,
26808,
27835,
29901,
13,
12,
12,
20640,
466,
3136,
29889,
9171,
29918,
5105,
580,
13,
13,
12,
12,
29891,
353,
4327,
29898,
29891,
29897,
29871,
396,
4226,
466,
14054,
13,
13,
12,
12,
29916,
353,
921,
29889,
517,
29898,
10141,
29897,
13,
12,
12,
29891,
353,
343,
29889,
517,
29898,
10141,
29897,
13,
13,
12,
12,
4905,
353,
29472,
29898,
29916,
29897,
29871,
396,
6375,
13,
12,
12,
6758,
353,
28770,
291,
29898,
4905,
29889,
29879,
802,
29872,
911,
3285,
343,
29889,
29879,
802,
29872,
911,
3101,
29871,
396,
6161,
2709,
628,
6410,
13,
12,
12,
29937,
1596,
29898,
29888,
29915,
6758,
29901,
426,
6758,
29913,
1495,
13,
12,
12,
6758,
29889,
1627,
1328,
580,
29871,
396,
1250,
1328,
1209,
13,
12,
12,
20640,
466,
3136,
29889,
10568,
580,
29871,
396,
5994,
15677,
13,
13,
12,
12,
26495,
29918,
6758,
4619,
6410,
29889,
667,
580,
29871,
396,
1274,
398,
352,
14054,
560,
6410,
316,
4404,
9853,
13,
13,
12,
26495,
29918,
6758,
353,
6694,
29918,
6758,
29914,
7827,
13,
12,
6758,
267,
1839,
14968,
13359,
4397,
29898,
26495,
29918,
6758,
29897,
29871,
396,
869,
667,
3101,
13,
12,
791,
29918,
6758,
353,
29871,
29900,
29889,
29900,
13,
12,
7827,
353,
29871,
29900,
13,
12,
655,
29872,
29892,
286,
344,
353,
29871,
29900,
29892,
29900,
29871,
13,
13,
12,
816,
14952,
29889,
10568,
580,
396,
15121,
9919,
443,
14534,
425,
365,
29934,
628,
317,
29954,
29928,
13,
13,
12,
4299,
29877,
29889,
14513,
580,
29871,
396,
4721,
862,
279,
560,
29472,
1702,
659,
1458,
1290,
343,
29914,
29877,
1243,
13,
12,
2158,
703,
7211,
1743,
856,
320,
29876,
1159,
13,
12,
1454,
921,
29892,
343,
297,
659,
29918,
12657,
29901,
13,
12,
12,
7827,
4619,
29871,
29896,
13,
13,
12,
12,
29891,
353,
4327,
29898,
29891,
29897,
29871,
396,
4226,
466,
14054,
13,
13,
12,
12,
29916,
353,
921,
29889,
517,
29898,
10141,
29897,
13,
12,
12,
29891,
353,
343,
29889,
517,
29898,
10141,
29897,
13,
13,
12,
12,
4905,
353,
29472,
29898,
29916,
29897,
29871,
396,
6375,
13,
12,
12,
6758,
353,
28770,
291,
29898,
4905,
29889,
29879,
802,
29872,
911,
3285,
343,
29889,
29879,
802,
29872,
911,
3101,
29871,
13,
12,
12,
655,
29872,
29918,
5753,
398,
29892,
286,
344,
29918,
5753,
398,
353,
679,
29918,
655,
29872,
29918,
29885,
344,
29898,
4905,
29889,
29879,
802,
29872,
911,
3285,
343,
29889,
29879,
802,
29872,
911,
3285,
16402,
29918,
9067,
29897,
13,
12,
12,
655,
29872,
4619,
611,
29872,
29918,
5753,
398,
13,
12,
12,
29885,
344,
4619,
286,
344,
29918,
5753,
398,
13,
13,
12,
791,
29918,
6758,
29871,
353,
659,
29918,
6758,
29914,
7827,
13,
12,
655,
29872,
353,
611,
29872,
29914,
7827,
13,
12,
29885,
344,
353,
286,
344,
29914,
7827,
13,
12,
6758,
267,
1839,
3084,
16337,
13359,
4397,
29898,
791,
29918,
6758,
29897,
29871,
396,
869,
667,
3101,
13,
12,
2158,
29898,
29888,
29915,
29961,
1022,
426,
1022,
2878,
6525,
518,
5323,
262,
29901,
426,
26495,
29918,
6758,
29901,
29889,
29946,
29888,
29913,
3816,
1440,
29901,
426,
791,
29918,
6758,
29901,
29889,
29946,
29888,
6525,
1495,
13,
12,
2158,
29898,
29888,
12764,
29873,
29961,
1440,
14861,
29923,
29901,
426,
655,
29872,
29901,
29889,
29946,
29888,
29913,
3816,
1440,
341,
1660,
29901,
426,
29885,
344,
29901,
29889,
29946,
29888,
6525,
1495,
13,
13,
12,
29937,
11095,
25480,
13,
12,
361,
313,
791,
29918,
6758,
5277,
1375,
29918,
791,
29918,
6758,
1839,
6758,
11287,
470,
313,
29885,
344,
5277,
1375,
29918,
791,
29918,
6758,
1839,
29885,
344,
11287,
470,
313,
655,
29872,
14065,
1195,
29918,
791,
29918,
6758,
1839,
655,
29872,
2033,
1125,
13,
12,
12,
9507,
353,
1518,
401,
29974,
4286,
415,
29915,
13,
12,
12,
2158,
29898,
29888,
29915,
29903,
5555,
408,
426,
9507,
29913,
1495,
13,
12,
12,
7345,
305,
29889,
7620,
29898,
4299,
29877,
29892,
10422,
29897,
13,
12,
12,
13,
12,
12,
361,
659,
29918,
6758,
5277,
1375,
29918,
791,
29918,
6758,
1839,
6758,
2033,
29901,
13,
12,
12,
12,
1195,
29918,
791,
29918,
6758,
1839,
6758,
2033,
353,
659,
29918,
6758,
13,
12,
12,
361,
286,
344,
5277,
1375,
29918,
791,
29918,
6758,
1839,
29885,
344,
2033,
29901,
13,
12,
12,
12,
1195,
29918,
791,
29918,
6758,
1839,
29885,
344,
2033,
353,
286,
344,
29871,
13,
12,
12,
361,
611,
29872,
14065,
1195,
29918,
791,
29918,
6758,
1839,
655,
29872,
2033,
29901,
29871,
13,
12,
12,
12,
1195,
29918,
791,
29918,
6758,
1839,
655,
29872,
2033,
353,
611,
29872,
13,
13,
13,
29937,
17067,
1254,
13,
13,
4299,
29877,
353,
4842,
305,
29889,
1359,
29898,
9507,
29897,
13,
4299,
29877,
29889,
14513,
580,
29871,
396,
4721,
862,
279,
560,
29472,
1702,
659,
1458,
1290,
343,
29914,
29877,
1243,
13,
2158,
703,
3057,
292,
856,
320,
29876,
1159,
13,
7827,
353,
29871,
29900,
13,
13,
1688,
29918,
6758,
29918,
29885,
344,
353,
29871,
29900,
29889,
29900,
13,
1688,
29918,
6758,
29918,
655,
29872,
353,
29871,
29900,
29889,
29900,
13,
13,
29891,
6370,
353,
1051,
580,
13,
1478,
1127,
24227,
353,
1051,
580,
13,
13,
1454,
921,
29892,
343,
297,
1243,
29918,
12657,
29901,
13,
13,
12,
29891,
353,
4327,
29898,
29891,
29897,
29871,
396,
4226,
466,
14054,
13,
13,
12,
29916,
353,
921,
29889,
517,
29898,
10141,
29897,
13,
12,
29891,
353,
343,
29889,
517,
29898,
10141,
29897,
13,
12,
2541,
4842,
305,
29889,
1217,
29918,
5105,
7295,
13,
12,
12,
4905,
353,
29472,
29898,
29916,
29897,
13,
13,
12,
29891,
6370,
29889,
4397,
29898,
262,
3901,
29918,
9067,
29898,
29891,
29889,
1272,
29889,
21970,
2141,
23749,
22130,
13,
12,
1478,
1127,
24227,
29889,
4397,
29898,
262,
3901,
29918,
9067,
29898,
4905,
29889,
1272,
29889,
21970,
2141,
23749,
22130,
13,
13,
12,
655,
29872,
29918,
5753,
398,
29892,
286,
344,
29918,
5753,
398,
353,
679,
29918,
655,
29872,
29918,
29885,
344,
29898,
4905,
29889,
29879,
802,
29872,
911,
3285,
343,
29889,
29879,
802,
29872,
911,
3285,
16402,
29918,
9067,
29897,
13,
12,
655,
29872,
4619,
611,
29872,
29918,
5753,
398,
13,
12,
29885,
344,
4619,
286,
344,
29918,
5753,
398,
13,
12,
7827,
4619,
29871,
29896,
13,
13,
791,
29918,
6758,
29871,
353,
659,
29918,
6758,
29914,
7827,
13,
655,
29872,
353,
611,
29872,
29914,
7827,
13,
29885,
344,
353,
286,
344,
29914,
7827,
13,
2158,
29898,
29888,
29915,
29961,
1022,
426,
1022,
2878,
29913,
3816,
3057,
14861,
29923,
29901,
426,
655,
29872,
29901,
29889,
29946,
29888,
29913,
3816,
3057,
341,
1660,
29901,
426,
29885,
344,
29901,
29889,
29946,
29888,
6525,
1495,
13,
13,
29937,
343,
6370,
353,
7442,
29889,
2378,
29898,
29891,
6370,
467,
1579,
8606,
580,
13,
29937,
343,
11965,
24227,
353,
7442,
29889,
2378,
29898,
1478,
1127,
24227,
467,
1579,
8606,
580,
396,
752,
307,
1646,
1354,
3653,
16017,
29889,
13,
13,
6758,
267,
1839,
29891,
6370,
2033,
353,
7442,
29889,
2378,
4197,
295,
29889,
667,
580,
363,
263,
297,
343,
6370,
363,
560,
297,
263,
2314,
13,
6758,
267,
1839,
1478,
1127,
24227,
2033,
353,
7442,
29889,
2378,
4197,
295,
29889,
667,
580,
363,
263,
297,
343,
11965,
24227,
363,
560,
297,
263,
2314,
13,
13,
2158,
29898,
29888,
29915,
3057,
365,
2209,
313,
29924,
1660,
1125,
426,
29885,
344,
29913,
1495,
13,
6758,
267,
1839,
1688,
29918,
29885,
344,
2033,
353,
286,
344,
29871,
396,
869,
667,
3101,
13,
2158,
29898,
29888,
29915,
3057,
365,
2209,
313,
1529,
29923,
1125,
426,
655,
29872,
29913,
1495,
13,
6758,
267,
1839,
1688,
29918,
655,
29872,
2033,
353,
611,
29872,
29871,
396,
869,
667,
3101,
13,
13,
13,
2541,
1722,
29898,
29903,
7520,
29923,
29918,
7724,
5813,
29892,
525,
29893,
29890,
1495,
408,
4386,
29901,
13,
12,
23945,
280,
29889,
15070,
29898,
6758,
267,
29892,
4386,
29892,
9608,
29922,
23945,
280,
29889,
29950,
6259,
9606,
1254,
29918,
8618,
4986,
15032,
29897,
13,
2
] |
signin/tests.py | pptnz/swa_team2 | 0 | 1343 | <reponame>pptnz/swa_team2
import json
from django.test import TestCase
from django.contrib.auth.models import User
from .models import CustomUser
from django.apps import apps
from .apps import SigninConfig
class SignInTest(TestCase):
def setUp(self):
self.django_user = User.objects.create_user(username='testusername', password='<PASSWORD>')
self.custom_user = CustomUser.objects.create(django_user=self.django_user)
def test_apps(self):
self.assertEqual(SigninConfig.name, 'signin')
self.assertEqual(apps.get_app_config('signin').name, 'signin')
def test_sign_in_redirect_page(self):
response = self.client.get('/')
self.assertRedirects(response, '/sign_in/')
def test_get(self):
response = self.client.get('/sign_in/')
self.assertEqual(response.status_code, 200)
def test_wrong_username(self):
response = self.client.post('/sign_in/', {'username': 'wrongusername', 'password': '<PASSWORD>'})
self.assertEqual(response.status_code, 200)
def test_wrong_password(self):
response = self.client.post('/sign_in/', {'username': 'testusername', 'password': '<PASSWORD>'})
self.assertEqual(response.status_code, 200)
def test_login(self):
response = self.client.post('/sign_in/', {'username': 'testusername', 'password': '<PASSWORD>'})
self.assertRedirects(response, '/habitmaker/')
# todo: change this link
def test_login_other_page(self):
response = self.client.post('/sign_in/?next=/habitmaker/', {'username': 'testusername', 'password': '<PASSWORD>'})
self.assertRedirects(response, '/habitmaker/')
def test_form_not_valid(self):
response = self.client.post('/sign_in/', {'username': 'testusername'})
self.assertEqual(response.status_code, 200)
def test_email_verification(self):
self.custom_user.authenticate_email()
self.assertTrue(self.custom_user.is_email_authenticated)
def test_already_signed_in(self):
self.client.login(username='testusername', password='<PASSWORD>')
response = self.client.get('/sign_in/')
self.assertRedirects(response, '/habitmaker/')
| [
1,
529,
276,
1112,
420,
29958,
407,
6277,
29920,
29914,
29879,
2766,
29918,
14318,
29906,
13,
5215,
4390,
13,
13,
3166,
9557,
29889,
1688,
1053,
4321,
8259,
13,
3166,
9557,
29889,
21570,
29889,
5150,
29889,
9794,
1053,
4911,
13,
3166,
869,
9794,
1053,
8701,
2659,
13,
3166,
9557,
29889,
13371,
1053,
11446,
13,
3166,
869,
13371,
1053,
9954,
262,
3991,
13,
13,
13,
1990,
9954,
797,
3057,
29898,
3057,
8259,
1125,
13,
1678,
822,
731,
3373,
29898,
1311,
1125,
13,
4706,
1583,
29889,
14095,
29918,
1792,
353,
4911,
29889,
12650,
29889,
3258,
29918,
1792,
29898,
6786,
2433,
1688,
6786,
742,
4800,
2433,
29966,
25711,
17013,
29958,
1495,
13,
4706,
1583,
29889,
6341,
29918,
1792,
353,
8701,
2659,
29889,
12650,
29889,
3258,
29898,
14095,
29918,
1792,
29922,
1311,
29889,
14095,
29918,
1792,
29897,
13,
13,
1678,
822,
1243,
29918,
13371,
29898,
1311,
1125,
13,
4706,
1583,
29889,
9294,
9843,
29898,
10140,
262,
3991,
29889,
978,
29892,
525,
4530,
262,
1495,
13,
4706,
1583,
29889,
9294,
9843,
29898,
13371,
29889,
657,
29918,
932,
29918,
2917,
877,
4530,
262,
2824,
978,
29892,
525,
4530,
262,
1495,
13,
13,
1678,
822,
1243,
29918,
4530,
29918,
262,
29918,
17886,
29918,
3488,
29898,
1311,
1125,
13,
4706,
2933,
353,
1583,
29889,
4645,
29889,
657,
11219,
1495,
13,
4706,
1583,
29889,
9294,
24735,
29879,
29898,
5327,
29892,
8207,
4530,
29918,
262,
29914,
1495,
13,
13,
1678,
822,
1243,
29918,
657,
29898,
1311,
1125,
13,
4706,
2933,
353,
1583,
29889,
4645,
29889,
657,
11219,
4530,
29918,
262,
29914,
1495,
13,
4706,
1583,
29889,
9294,
9843,
29898,
5327,
29889,
4882,
29918,
401,
29892,
29871,
29906,
29900,
29900,
29897,
13,
13,
1678,
822,
1243,
29918,
15866,
549,
29918,
6786,
29898,
1311,
1125,
13,
4706,
2933,
353,
1583,
29889,
4645,
29889,
2490,
11219,
4530,
29918,
262,
29914,
742,
11117,
6786,
2396,
525,
15866,
549,
6786,
742,
525,
5630,
2396,
12801,
25711,
17013,
16299,
1800,
13,
4706,
1583,
29889,
9294,
9843,
29898,
5327,
29889,
4882,
29918,
401,
29892,
29871,
29906,
29900,
29900,
29897,
13,
13,
1678,
822,
1243,
29918,
15866,
549,
29918,
5630,
29898,
1311,
1125,
13,
4706,
2933,
353,
1583,
29889,
4645,
29889,
2490,
11219,
4530,
29918,
262,
29914,
742,
11117,
6786,
2396,
525,
1688,
6786,
742,
525,
5630,
2396,
12801,
25711,
17013,
16299,
1800,
13,
4706,
1583,
29889,
9294,
9843,
29898,
5327,
29889,
4882,
29918,
401,
29892,
29871,
29906,
29900,
29900,
29897,
13,
13,
1678,
822,
1243,
29918,
7507,
29898,
1311,
1125,
13,
4706,
2933,
353,
1583,
29889,
4645,
29889,
2490,
11219,
4530,
29918,
262,
29914,
742,
11117,
6786,
2396,
525,
1688,
6786,
742,
525,
5630,
2396,
12801,
25711,
17013,
16299,
1800,
13,
4706,
1583,
29889,
9294,
24735,
29879,
29898,
5327,
29892,
8207,
7308,
277,
28107,
29914,
1495,
13,
13,
1678,
396,
10481,
29901,
1735,
445,
1544,
13,
1678,
822,
1243,
29918,
7507,
29918,
1228,
29918,
3488,
29898,
1311,
1125,
13,
4706,
2933,
353,
1583,
29889,
4645,
29889,
2490,
11219,
4530,
29918,
262,
13401,
4622,
14327,
7308,
277,
28107,
29914,
742,
11117,
6786,
2396,
525,
1688,
6786,
742,
525,
5630,
2396,
12801,
25711,
17013,
16299,
1800,
13,
4706,
1583,
29889,
9294,
24735,
29879,
29898,
5327,
29892,
8207,
7308,
277,
28107,
29914,
1495,
13,
13,
1678,
822,
1243,
29918,
689,
29918,
1333,
29918,
3084,
29898,
1311,
1125,
13,
4706,
2933,
353,
1583,
29889,
4645,
29889,
2490,
11219,
4530,
29918,
262,
29914,
742,
11117,
6786,
2396,
525,
1688,
6786,
29915,
1800,
13,
4706,
1583,
29889,
9294,
9843,
29898,
5327,
29889,
4882,
29918,
401,
29892,
29871,
29906,
29900,
29900,
29897,
13,
13,
1678,
822,
1243,
29918,
5269,
29918,
369,
2450,
29898,
1311,
1125,
13,
4706,
1583,
29889,
6341,
29918,
1792,
29889,
27218,
403,
29918,
5269,
580,
13,
4706,
1583,
29889,
9294,
5574,
29898,
1311,
29889,
6341,
29918,
1792,
29889,
275,
29918,
5269,
29918,
27218,
630,
29897,
13,
13,
1678,
822,
1243,
29918,
284,
2040,
29918,
7433,
29918,
262,
29898,
1311,
1125,
13,
4706,
1583,
29889,
4645,
29889,
7507,
29898,
6786,
2433,
1688,
6786,
742,
4800,
2433,
29966,
25711,
17013,
29958,
1495,
13,
4706,
2933,
353,
1583,
29889,
4645,
29889,
657,
11219,
4530,
29918,
262,
29914,
1495,
13,
4706,
1583,
29889,
9294,
24735,
29879,
29898,
5327,
29892,
8207,
7308,
277,
28107,
29914,
1495,
13,
2
] |
mutagene/cli/motif_menu.py | neksa/pymutagene | 3 | 116108 | <filename>mutagene/cli/motif_menu.py
import argparse
import sys
import logging
from mutagene.io.context_window import read_MAF_with_context_window, read_VCF_with_context_window
from mutagene.motifs import identify_motifs
from mutagene.io.motifs import write_motif_matches, get_known_motifs
logger = logging.getLogger(__name__)
genome_error_message = """requires genome name argument -g hg19, hg38, mm10, see http://hgdownload.cse.ucsc.edu/downloads.html for more
Use mutagene fetch to download genome assemblies"""
class MotifMenu(object):
def __init__(self, parser):
parser.description = ""
parser.epilog = """
Examples:
# search in sample2.vcf for all preidentified motifs in mutagene using hg19
mutagene motif --infile sample2.vcf --input-format VCF --genome hg19
# search for the presence of the C[A>T] motif in sample1.maf using hg19 not checking for strand-specificity
mutagene motif --infile sample1.maf --input-format MAF --genome hg19 --motif 'C[A>T]' --strand A
"""
###################################################################
required_group = parser.add_argument_group('Required arguments')
required_group.add_argument(
"--infile", "-i", help="Input file in MAF or VCF format with one or multiple samples",
type=argparse.FileType('r'))
required_group.add_argument(
'--genome', "-g", help="Location of genome assembly file in 2bit format", type=str)
###################################################################
optional_group = parser.add_argument_group('Optional arguments')
optional_group.add_argument('--input-format', "-f", help="Input format: MAF, VCF", type=str, choices=['MAF', 'VCF'], default='MAF')
optional_group.add_argument(
"--motif", "-m",
help="Motif to search for, use the 'R[C>T]GY' syntax for the motif. Use quotes", type=str)
optional_group.add_argument(
'--outfile', "-o", nargs='?', type=argparse.FileType('w'), default=sys.stdout,
help="Name of output file, will be generated in TSV format")
# for backwards compatibility with 0.8.X add a hidden action that would just take anything as a valid input
optional_group.add_argument('action', nargs="?", metavar="")
###################################################################
advanced_group = parser.add_argument_group('Advanced arguments')
advanced_group.add_argument(
'--window-size', "-w", help="Context window size for motif search, default setting is 50",
type=int, default=50)
advanced_group.add_argument(
'--strand', "-s",
help="Transcribed strand (T), non-transcribed (N), any (A), or all (TNA default) ",
type=str, default='TNA', choices=['T', 'N', 'A', 'TNA'])
advanced_group.add_argument(
'--threshold', "-t",
help="Significance threshold for qvalues, default value=0.05",
type=float, default=0.05)
advanced_group.add_argument(
'--save-motif-matches',
help="Save mutations in matching motifs to a BED file",
type=argparse.FileType('w'), default=None)
advanced_group.add_argument(
'--test',
help="Statistical test to use",
type=str, default='Fisher', choices=['Fisher', 'Chi2'])
self.parser = parser
@classmethod
def search(cls, args):
if not args.infile:
logger.warning("Provide input file in VCF or MAF format (-i) and a corresponding genome assembly (-g)")
return
if not args.genome:
logger.warning(genome_error_message)
return
if args.threshold > 1.0 or args.threshold < 0.0:
logger.warning("The threshold value should be between 0.0 and 1.0, inclusive")
return
if not args.motif:
logger.info("Searching for predefined motifs")
logger.info("Will reduce statistical power because of multiple comparisons")
custom_motif = None
else:
custom_motif = args.motif
custom_motif = custom_motif.replace('-', '>')
custom_motif = custom_motif.replace('/', '>')
custom_motif = custom_motif.replace('.', '>')
custom_motif = custom_motif.replace('->', '>')
if ">" not in custom_motif or "]" not in custom_motif:
logger.warning(
"Mutagene motif search failed because motif cannot be processed."
"Check to make sure motif input is in quotes")
return
logger.info("Searching for motif {}".format(custom_motif))
if args.window_size > 5000 or args.window_size < 1:
logger.warning('window-size should be between 1 and 5000 nucleotides')
return
try:
if args.input_format == 'VCF':
mutations, mutations_with_context, processing_stats = read_VCF_with_context_window(
args.infile, args.genome, args.window_size)
elif args.input_format == 'MAF':
mutations, mutations_with_context, processing_stats = read_MAF_with_context_window(
args.infile, args.genome, args.window_size)
except ValueError as e:
logger.warning('Not able to parse input file in {} format: {}. You can specify a different format with --input-format (-f)'.format(args.input_format, e))
sys.exit(1)
if len(mutations_with_context) == 0:
logger.warning("No mutations loaded")
#######################
# Performance PROFILING
# import cProfile
# import pstats
# pr = cProfile.Profile()
# pr.enable()
matching_motifs = identify_motifs(
samples_mutations=mutations_with_context,
custom_motif=custom_motif,
strand=args.strand,
threshold=args.threshold,
dump_matches=args.save_motif_matches,
stat_type=args.test) if mutations_with_context is not None else []
#######################
# Performance PROFILING
# pr.disable()
# p = pstats.Stats(pr)
# p.sort_stats('ncalls').print_stats(20) # strip_dirs()
if len(matching_motifs) == 0:
logger.warning("No significant motif matches found")
else:
write_motif_matches(args.outfile, matching_motifs)
def list(self, args):
""" Prints the list of known motifs bundled with the package"""
print("\nThe list of mutational motifs that will be tested by default:")
for m in get_known_motifs():
print("{:20}\t{}".format(m['name'], m['logo']))
print("any custom motif can be specified with --motif (-m)")
def callback(self, args):
# getattr(cls, args.action)(args)
if args.infile:
MotifMenu.search(args)
else:
self.parser.print_usage()
self.list(args)
sys.exit(1)
| [
1,
529,
9507,
29958,
6149,
351,
1600,
29914,
11303,
29914,
14817,
361,
29918,
6510,
29889,
2272,
13,
5215,
1852,
5510,
13,
5215,
10876,
13,
5215,
12183,
13,
13,
3166,
5478,
351,
1600,
29889,
601,
29889,
4703,
29918,
7165,
1053,
1303,
29918,
1529,
29943,
29918,
2541,
29918,
4703,
29918,
7165,
29892,
1303,
29918,
8257,
29943,
29918,
2541,
29918,
4703,
29918,
7165,
13,
3166,
5478,
351,
1600,
29889,
14817,
10270,
1053,
12439,
29918,
14817,
10270,
13,
3166,
5478,
351,
1600,
29889,
601,
29889,
14817,
10270,
1053,
2436,
29918,
14817,
361,
29918,
20317,
29892,
679,
29918,
5203,
29918,
14817,
10270,
13,
13,
13,
21707,
353,
12183,
29889,
657,
16363,
22168,
978,
1649,
29897,
13,
1885,
608,
29918,
2704,
29918,
4906,
353,
9995,
276,
339,
2658,
2531,
608,
1024,
2980,
448,
29887,
298,
29887,
29896,
29929,
29892,
298,
29887,
29941,
29947,
29892,
5654,
29896,
29900,
29892,
1074,
1732,
597,
29882,
29887,
10382,
29889,
29883,
344,
29889,
1682,
1557,
29889,
6085,
29914,
10382,
29879,
29889,
1420,
363,
901,
13,
462,
4706,
4803,
5478,
351,
1600,
6699,
304,
5142,
2531,
608,
24367,
3687,
15945,
29908,
13,
13,
13,
1990,
7142,
361,
6823,
29898,
3318,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
13812,
1125,
13,
4706,
13812,
29889,
8216,
353,
5124,
13,
4706,
13812,
29889,
1022,
26140,
353,
9995,
13,
1252,
9422,
29901,
13,
29937,
2740,
297,
4559,
29906,
29889,
29894,
6854,
363,
599,
758,
1693,
2164,
3184,
10270,
297,
5478,
351,
1600,
773,
298,
29887,
29896,
29929,
13,
6149,
351,
1600,
3184,
361,
1192,
262,
1445,
4559,
29906,
29889,
29894,
6854,
1192,
2080,
29899,
4830,
478,
9207,
1192,
1885,
608,
298,
29887,
29896,
29929,
13,
13,
29937,
2740,
363,
278,
10122,
310,
278,
315,
29961,
29909,
29958,
29911,
29962,
3184,
361,
297,
4559,
29896,
29889,
655,
29888,
773,
298,
29887,
29896,
29929,
451,
8454,
363,
851,
392,
29899,
14940,
537,
13,
6149,
351,
1600,
3184,
361,
1192,
262,
1445,
4559,
29896,
29889,
655,
29888,
1192,
2080,
29899,
4830,
341,
5098,
1192,
1885,
608,
298,
29887,
29896,
29929,
1192,
14817,
361,
525,
29907,
29961,
29909,
29958,
29911,
29962,
29915,
1192,
710,
392,
319,
13,
4706,
9995,
13,
13,
4706,
835,
13383,
13383,
13383,
13383,
13,
4706,
3734,
29918,
2972,
353,
13812,
29889,
1202,
29918,
23516,
29918,
2972,
877,
19347,
6273,
1495,
13,
4706,
3734,
29918,
2972,
29889,
1202,
29918,
23516,
29898,
13,
9651,
376,
489,
262,
1445,
613,
11663,
29875,
613,
1371,
543,
4290,
934,
297,
341,
5098,
470,
478,
9207,
3402,
411,
697,
470,
2999,
11916,
613,
13,
9651,
1134,
29922,
1191,
5510,
29889,
2283,
1542,
877,
29878,
8785,
13,
4706,
3734,
29918,
2972,
29889,
1202,
29918,
23516,
29898,
13,
9651,
525,
489,
1885,
608,
742,
11663,
29887,
613,
1371,
543,
6508,
310,
2531,
608,
11470,
934,
297,
29871,
29906,
2966,
3402,
613,
1134,
29922,
710,
29897,
13,
13,
4706,
835,
13383,
13383,
13383,
13383,
13,
4706,
13136,
29918,
2972,
353,
13812,
29889,
1202,
29918,
23516,
29918,
2972,
877,
27636,
6273,
1495,
13,
4706,
13136,
29918,
2972,
29889,
1202,
29918,
23516,
877,
489,
2080,
29899,
4830,
742,
11663,
29888,
613,
1371,
543,
4290,
3402,
29901,
341,
5098,
29892,
478,
9207,
613,
1134,
29922,
710,
29892,
19995,
29922,
1839,
1529,
29943,
742,
525,
8257,
29943,
7464,
2322,
2433,
1529,
29943,
1495,
13,
4706,
13136,
29918,
2972,
29889,
1202,
29918,
23516,
29898,
13,
9651,
376,
489,
14817,
361,
613,
11663,
29885,
613,
13,
9651,
1371,
543,
29924,
327,
361,
304,
2740,
363,
29892,
671,
278,
525,
29934,
29961,
29907,
29958,
29911,
29962,
29954,
29979,
29915,
5877,
363,
278,
3184,
361,
29889,
4803,
11839,
613,
1134,
29922,
710,
29897,
13,
4706,
13136,
29918,
2972,
29889,
1202,
29918,
23516,
29898,
13,
9651,
525,
489,
449,
1445,
742,
11663,
29877,
613,
302,
5085,
2433,
29973,
742,
1134,
29922,
1191,
5510,
29889,
2283,
1542,
877,
29893,
5477,
2322,
29922,
9675,
29889,
25393,
29892,
13,
9651,
1371,
543,
1170,
310,
1962,
934,
29892,
674,
367,
5759,
297,
323,
7597,
3402,
1159,
13,
13,
4706,
396,
363,
28953,
24521,
411,
29871,
29900,
29889,
29947,
29889,
29990,
788,
263,
7934,
3158,
393,
723,
925,
2125,
3099,
408,
263,
2854,
1881,
13,
4706,
13136,
29918,
2972,
29889,
1202,
29918,
23516,
877,
2467,
742,
302,
5085,
543,
29973,
613,
1539,
485,
279,
543,
1159,
13,
13,
4706,
835,
13383,
13383,
13383,
13383,
13,
4706,
12862,
29918,
2972,
353,
13812,
29889,
1202,
29918,
23516,
29918,
2972,
877,
3253,
16858,
6273,
1495,
13,
4706,
12862,
29918,
2972,
29889,
1202,
29918,
23516,
29898,
13,
9651,
525,
489,
7165,
29899,
2311,
742,
11663,
29893,
613,
1371,
543,
2677,
3474,
2159,
363,
3184,
361,
2740,
29892,
2322,
4444,
338,
29871,
29945,
29900,
613,
13,
9651,
1134,
29922,
524,
29892,
2322,
29922,
29945,
29900,
29897,
13,
4706,
12862,
29918,
2972,
29889,
1202,
29918,
23516,
29898,
13,
9651,
525,
489,
710,
392,
742,
11663,
29879,
613,
13,
9651,
1371,
543,
4300,
23059,
851,
392,
313,
29911,
511,
1661,
29899,
3286,
23059,
313,
29940,
511,
738,
313,
29909,
511,
470,
599,
313,
29911,
3521,
2322,
29897,
9162,
13,
9651,
1134,
29922,
710,
29892,
2322,
2433,
29911,
3521,
742,
19995,
29922,
1839,
29911,
742,
525,
29940,
742,
525,
29909,
742,
525,
29911,
3521,
11287,
13,
4706,
12862,
29918,
2972,
29889,
1202,
29918,
23516,
29898,
13,
9651,
525,
489,
386,
12268,
742,
11663,
29873,
613,
13,
9651,
1371,
543,
10140,
928,
749,
16897,
363,
3855,
5975,
29892,
2322,
995,
29922,
29900,
29889,
29900,
29945,
613,
13,
9651,
1134,
29922,
7411,
29892,
2322,
29922,
29900,
29889,
29900,
29945,
29897,
13,
4706,
12862,
29918,
2972,
29889,
1202,
29918,
23516,
29898,
13,
9651,
525,
489,
7620,
29899,
14817,
361,
29899,
20317,
742,
13,
9651,
1371,
543,
11371,
5478,
800,
297,
9686,
3184,
10270,
304,
263,
350,
3352,
934,
613,
13,
9651,
1134,
29922,
1191,
5510,
29889,
2283,
1542,
877,
29893,
5477,
2322,
29922,
8516,
29897,
13,
4706,
12862,
29918,
2972,
29889,
1202,
29918,
23516,
29898,
13,
9651,
525,
489,
1688,
742,
13,
9651,
1371,
543,
9513,
391,
936,
1243,
304,
671,
613,
13,
9651,
1134,
29922,
710,
29892,
2322,
2433,
29943,
22154,
742,
19995,
29922,
1839,
29943,
22154,
742,
525,
1451,
29875,
29906,
11287,
13,
13,
4706,
1583,
29889,
16680,
353,
13812,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
2740,
29898,
25932,
29892,
6389,
1125,
13,
4706,
565,
451,
6389,
29889,
262,
1445,
29901,
13,
9651,
17927,
29889,
27392,
703,
1184,
29894,
680,
1881,
934,
297,
478,
9207,
470,
341,
5098,
3402,
8521,
29875,
29897,
322,
263,
6590,
2531,
608,
11470,
8521,
29887,
25760,
13,
9651,
736,
13,
4706,
565,
451,
6389,
29889,
1885,
608,
29901,
13,
9651,
17927,
29889,
27392,
29898,
1885,
608,
29918,
2704,
29918,
4906,
29897,
13,
9651,
736,
13,
4706,
565,
6389,
29889,
386,
12268,
1405,
29871,
29896,
29889,
29900,
470,
6389,
29889,
386,
12268,
529,
29871,
29900,
29889,
29900,
29901,
13,
9651,
17927,
29889,
27392,
703,
1576,
16897,
995,
881,
367,
1546,
29871,
29900,
29889,
29900,
322,
29871,
29896,
29889,
29900,
29892,
20978,
573,
1159,
13,
9651,
736,
13,
4706,
565,
451,
6389,
29889,
14817,
361,
29901,
13,
9651,
17927,
29889,
3888,
703,
7974,
292,
363,
758,
12119,
3184,
10270,
1159,
13,
9651,
17927,
29889,
3888,
703,
12984,
10032,
24148,
3081,
1363,
310,
2999,
5734,
14125,
1159,
13,
9651,
2888,
29918,
14817,
361,
353,
6213,
13,
4706,
1683,
29901,
13,
9651,
2888,
29918,
14817,
361,
353,
6389,
29889,
14817,
361,
13,
9651,
2888,
29918,
14817,
361,
353,
2888,
29918,
14817,
361,
29889,
6506,
877,
29899,
742,
525,
29958,
1495,
13,
9651,
2888,
29918,
14817,
361,
353,
2888,
29918,
14817,
361,
29889,
6506,
11219,
742,
525,
29958,
1495,
13,
9651,
2888,
29918,
14817,
361,
353,
2888,
29918,
14817,
361,
29889,
6506,
12839,
742,
525,
29958,
1495,
13,
9651,
2888,
29918,
14817,
361,
353,
2888,
29918,
14817,
361,
29889,
6506,
877,
976,
742,
525,
29958,
1495,
13,
13,
9651,
565,
376,
11903,
451,
297,
2888,
29918,
14817,
361,
470,
376,
18017,
451,
297,
2888,
29918,
14817,
361,
29901,
13,
18884,
17927,
29889,
27392,
29898,
13,
462,
1678,
376,
29924,
329,
351,
1600,
3184,
361,
2740,
5229,
1363,
3184,
361,
2609,
367,
19356,
1213,
13,
462,
1678,
376,
5596,
304,
1207,
1854,
3184,
361,
1881,
338,
297,
11839,
1159,
13,
18884,
736,
13,
13,
9651,
17927,
29889,
3888,
703,
7974,
292,
363,
3184,
361,
6571,
1642,
4830,
29898,
6341,
29918,
14817,
361,
876,
13,
13,
4706,
565,
6389,
29889,
7165,
29918,
2311,
1405,
29871,
29945,
29900,
29900,
29900,
470,
6389,
29889,
7165,
29918,
2311,
529,
29871,
29896,
29901,
13,
9651,
17927,
29889,
27392,
877,
7165,
29899,
2311,
881,
367,
1546,
29871,
29896,
322,
29871,
29945,
29900,
29900,
29900,
22699,
327,
2247,
1495,
13,
9651,
736,
13,
13,
4706,
1018,
29901,
13,
9651,
565,
6389,
29889,
2080,
29918,
4830,
1275,
525,
8257,
29943,
2396,
13,
18884,
5478,
800,
29892,
5478,
800,
29918,
2541,
29918,
4703,
29892,
9068,
29918,
16202,
353,
1303,
29918,
8257,
29943,
29918,
2541,
29918,
4703,
29918,
7165,
29898,
13,
462,
1678,
6389,
29889,
262,
1445,
29892,
6389,
29889,
1885,
608,
29892,
6389,
29889,
7165,
29918,
2311,
29897,
13,
9651,
25342,
6389,
29889,
2080,
29918,
4830,
1275,
525,
1529,
29943,
2396,
13,
18884,
5478,
800,
29892,
5478,
800,
29918,
2541,
29918,
4703,
29892,
9068,
29918,
16202,
353,
1303,
29918,
1529,
29943,
29918,
2541,
29918,
4703,
29918,
7165,
29898,
13,
462,
1678,
6389,
29889,
262,
1445,
29892,
6389,
29889,
1885,
608,
29892,
6389,
29889,
7165,
29918,
2311,
29897,
13,
4706,
5174,
7865,
2392,
408,
321,
29901,
13,
9651,
17927,
29889,
27392,
877,
3664,
2221,
304,
6088,
1881,
934,
297,
6571,
3402,
29901,
426,
1836,
887,
508,
6084,
263,
1422,
3402,
411,
1192,
2080,
29899,
4830,
8521,
29888,
29897,
4286,
4830,
29898,
5085,
29889,
2080,
29918,
4830,
29892,
321,
876,
13,
9651,
10876,
29889,
13322,
29898,
29896,
29897,
13,
13,
4706,
565,
7431,
29898,
6149,
800,
29918,
2541,
29918,
4703,
29897,
1275,
29871,
29900,
29901,
13,
9651,
17927,
29889,
27392,
703,
3782,
5478,
800,
7500,
1159,
13,
13,
4706,
835,
13383,
4136,
13,
4706,
396,
23768,
13756,
3738,
29931,
4214,
13,
4706,
396,
1053,
274,
13909,
13,
4706,
396,
1053,
282,
16202,
13,
4706,
396,
544,
353,
274,
13909,
29889,
13909,
580,
13,
4706,
396,
544,
29889,
12007,
580,
13,
13,
4706,
9686,
29918,
14817,
10270,
353,
12439,
29918,
14817,
10270,
29898,
13,
9651,
11916,
29918,
6149,
800,
29922,
6149,
800,
29918,
2541,
29918,
4703,
29892,
13,
9651,
2888,
29918,
14817,
361,
29922,
6341,
29918,
14817,
361,
29892,
13,
9651,
851,
392,
29922,
5085,
29889,
710,
392,
29892,
13,
9651,
16897,
29922,
5085,
29889,
386,
12268,
29892,
13,
9651,
16766,
29918,
20317,
29922,
5085,
29889,
7620,
29918,
14817,
361,
29918,
20317,
29892,
13,
9651,
1002,
29918,
1853,
29922,
5085,
29889,
1688,
29897,
565,
5478,
800,
29918,
2541,
29918,
4703,
338,
451,
6213,
1683,
5159,
13,
13,
4706,
835,
13383,
4136,
13,
4706,
396,
23768,
13756,
3738,
29931,
4214,
13,
4706,
396,
544,
29889,
20472,
580,
13,
4706,
396,
282,
353,
282,
16202,
29889,
25060,
29898,
558,
29897,
13,
4706,
396,
282,
29889,
6605,
29918,
16202,
877,
17608,
4293,
2824,
2158,
29918,
16202,
29898,
29906,
29900,
29897,
29871,
396,
17820,
29918,
3972,
29879,
580,
13,
13,
4706,
565,
7431,
29898,
4352,
292,
29918,
14817,
10270,
29897,
1275,
29871,
29900,
29901,
13,
9651,
17927,
29889,
27392,
703,
3782,
7282,
3184,
361,
7087,
1476,
1159,
13,
4706,
1683,
29901,
13,
9651,
2436,
29918,
14817,
361,
29918,
20317,
29898,
5085,
29889,
449,
1445,
29892,
9686,
29918,
14817,
10270,
29897,
13,
13,
1678,
822,
1051,
29898,
1311,
29892,
6389,
1125,
13,
4706,
9995,
1588,
9466,
278,
1051,
310,
2998,
3184,
10270,
22813,
839,
411,
278,
3577,
15945,
29908,
13,
4706,
1596,
14182,
29876,
1576,
1051,
310,
5478,
1288,
3184,
10270,
393,
674,
367,
9528,
491,
2322,
29901,
1159,
13,
4706,
363,
286,
297,
679,
29918,
5203,
29918,
14817,
10270,
7295,
13,
9651,
1596,
703,
25641,
29906,
29900,
1012,
29873,
8875,
1642,
4830,
29898,
29885,
1839,
978,
7464,
286,
1839,
14569,
25901,
13,
4706,
1596,
703,
1384,
2888,
3184,
361,
508,
367,
6790,
411,
1192,
14817,
361,
8521,
29885,
25760,
13,
13,
1678,
822,
6939,
29898,
1311,
29892,
6389,
1125,
13,
4706,
396,
679,
5552,
29898,
25932,
29892,
6389,
29889,
2467,
5033,
5085,
29897,
13,
4706,
565,
6389,
29889,
262,
1445,
29901,
13,
9651,
7142,
361,
6823,
29889,
4478,
29898,
5085,
29897,
13,
4706,
1683,
29901,
13,
9651,
1583,
29889,
16680,
29889,
2158,
29918,
21125,
580,
13,
9651,
1583,
29889,
1761,
29898,
5085,
29897,
13,
9651,
10876,
29889,
13322,
29898,
29896,
29897,
13,
2
] |
leetcode/319-Bulb-Switcher/BulbSwitcher_001_TLE.py | cc13ny/all-in | 1 | 175640 | class Solution(object):
def bulbSwitch(self, n):
"""
:type n: int
:rtype: int
"""
num_of_facs = [1 for i in range(n)]
for j in range(2, n + 1):
for k in range(1, n / j + 1):
num_of_facs[j * k - 1] += 1
res = 0
for num in num_of_facs:
res += num % 2
return res
| [
1,
770,
24380,
29898,
3318,
1125,
13,
1678,
822,
8227,
29890,
24995,
29898,
1311,
29892,
302,
1125,
13,
4706,
9995,
13,
4706,
584,
1853,
302,
29901,
938,
13,
4706,
584,
29878,
1853,
29901,
938,
13,
4706,
9995,
13,
4706,
954,
29918,
974,
29918,
29888,
16815,
353,
518,
29896,
363,
474,
297,
3464,
29898,
29876,
4638,
13,
4706,
363,
432,
297,
3464,
29898,
29906,
29892,
302,
718,
29871,
29896,
1125,
13,
9651,
363,
413,
297,
3464,
29898,
29896,
29892,
302,
847,
432,
718,
29871,
29896,
1125,
13,
18884,
954,
29918,
974,
29918,
29888,
16815,
29961,
29926,
334,
413,
448,
29871,
29896,
29962,
4619,
29871,
29896,
13,
13,
4706,
620,
353,
29871,
29900,
13,
4706,
363,
954,
297,
954,
29918,
974,
29918,
29888,
16815,
29901,
13,
9651,
620,
4619,
954,
1273,
29871,
29906,
13,
13,
4706,
736,
620,
13,
2
] |
main.py | fogcitymarathoner/gae_p27_dj17 | 0 | 1615694 | import os,sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'p27_d17_prj.settings'
# Force Django to reload its settings.
from django.conf import settings
settings._target = None
import django.core.handlers.wsgi
import django.core.signals
import django.db
import django.dispatch
# Log errors.
#import logging
#def log_exception(*args, **kwds):
# logging.exception('Exception in request:')
#
#django.dispatch.Signal.connect(
# django.core.signals.got_request_exception, log_exception)
# Unregister the rollback event handler.
django.dispatch.Signal.disconnect(
django.core.signals.got_request_exception,
django.db._rollback_on_exception)
app = django.core.handlers.wsgi.WSGIHandler()
| [
1,
1053,
2897,
29892,
9675,
13,
359,
29889,
21813,
1839,
29928,
29967,
2190,
17080,
29918,
10490,
29911,
4214,
29903,
29918,
6720,
14849,
1307,
2033,
353,
525,
29886,
29906,
29955,
29918,
29881,
29896,
29955,
29918,
558,
29926,
29889,
11027,
29915,
13,
13,
29937,
11004,
15337,
304,
19763,
967,
6055,
29889,
13,
3166,
9557,
29889,
5527,
1053,
6055,
13,
11027,
3032,
5182,
353,
6213,
13,
13,
5215,
9557,
29889,
3221,
29889,
3179,
9306,
29889,
5652,
3146,
13,
5215,
9557,
29889,
3221,
29889,
4530,
1338,
13,
5215,
9557,
29889,
2585,
13,
5215,
9557,
29889,
13369,
13,
13,
29937,
4522,
4436,
29889,
13,
29937,
5215,
12183,
13,
29937,
1753,
1480,
29918,
11739,
10456,
5085,
29892,
3579,
11022,
6289,
1125,
13,
29937,
1678,
12183,
29889,
11739,
877,
2451,
297,
2009,
29901,
1495,
13,
29937,
13,
29937,
14095,
29889,
13369,
29889,
10140,
284,
29889,
6915,
29898,
13,
29937,
1678,
9557,
29889,
3221,
29889,
4530,
1338,
29889,
7085,
29918,
3827,
29918,
11739,
29892,
1480,
29918,
11739,
29897,
13,
13,
29937,
853,
9573,
278,
9679,
1627,
1741,
7834,
29889,
13,
14095,
29889,
13369,
29889,
10140,
284,
29889,
2218,
6915,
29898,
13,
1678,
9557,
29889,
3221,
29889,
4530,
1338,
29889,
7085,
29918,
3827,
29918,
11739,
29892,
13,
1678,
9557,
29889,
2585,
3032,
1245,
1627,
29918,
265,
29918,
11739,
29897,
13,
13,
932,
353,
9557,
29889,
3221,
29889,
3179,
9306,
29889,
5652,
3146,
29889,
7811,
29954,
29902,
4598,
580,
13,
2
] |
conllu/conllu.py | spyysalo/conllu.py | 13 | 53528 | #!/usr/bin/env python
# CoNLL-U format support
import re
import codecs
import brat
from itertools import groupby
# feature name-value separator
FSEP = '='
# dependency head-rel separator
DSEP = ':'
# Free-form text annotation type in brat export
COMMENT_TYPE = 'AnnotatorNotes'
class FormatError(Exception):
def __init__(self, msg, line=None, linenum=None):
self.msg = msg
self.line = line
self.linenum = linenum
def __str__(self):
msg = self.msg
if self.line is not None:
msg += ': "'+self.line.encode('ascii', 'replace')+'"'
if self.linenum is not None:
msg += ' (line %d)' % self.linenum
return msg
CPOSTAG_RE = re.compile(r'^[a-zA-Z]+$')
POSTAG_RE = re.compile(r'^[\x20-\xff]+$')
class Element(object):
"""Represents CoNLL-U word or multi-word token."""
def __init__(self, id_, form, lemma, cpostag, postag,
feats, head, deprel, deps, misc, offset=0):
self.id = id_
self.form = form
self.lemma = lemma
self.cpostag = cpostag
self.postag = postag
self._feats = feats
self.head = head
self.deprel = deprel
self._deps = deps
self.misc = misc
self.offset = offset
self.sentence = None
self.validate()
self._fmap = None
self._dlist = None
def validate(self):
# minimal format validation (incomplete)
if not self.is_word():
# TODO: check multi-word tokens
return
# some character set constraints
if not CPOSTAG_RE.match(self.cpostag):
raise FormatError('invalid CPOSTAG: %s' % self.cpostag)
if not POSTAG_RE.match(self.postag):
raise FormatError('invalid POSTAG: %s' % self.postag)
# no feature is empty
if any(True for s in self._feats if len(s) == 0):
raise FormatError('empty feature: %s' % str(self._feats))
# feature names and values separated by feature separator
if any(s for s in self._feats if len(s.split(FSEP)) < 2):
raise FormatError('invalid features: %s' % str(self._feats))
# no feature name repeats
if any(n for n, g in groupby(sorted(s.split(FSEP)[0] for s in self._feats))
if len(list(g)) > 1):
raise FormatError('duplicate features: %s' % str(self._feats))
# head is integer
try:
int(self.head)
except ValueError:
raise FormatError('non-int head: %s' % self.head)
def is_word(self):
try:
val = int(self.id)
return True
except ValueError:
return False
def has_feat(self, name):
return name in self.feat_map()
def add_feats(self, feats):
# name-value pairs
assert not any(nv for nv in feats if len(nv) != 2)
self._feats.extend(FSEP.join(nv) for nv in feats)
self._fmap = None
def set_feats(self, feats):
self._feats = []
self.add_feats(feats)
self._fmap = None
def remove_feat(self, name, value):
nv = FSEP.join((name, value))
self._feats.remove(nv)
self._fmap = None
def append_misc(self, value):
if self.misc == '_':
self.misc = value
else:
self.misc = self.misc + '|' + value
def feat_names(self):
return [f.split(FSEP)[0] for f in self._feats]
def feat_map(self):
if self._fmap is None:
try:
self._fmap = dict([f.split(FSEP, 1) for f in self._feats])
except ValueError:
raise ValueError('failed to convert ' + str(self._feats))
return self._fmap
def feats(self):
return self.feat_map().items()
def deps(self, include_primary=False):
if self._dlist is None:
try:
self._dlist = [d.split(DSEP, 1) for d in self._deps]
except:
raise FormatError('failed to parse ' + str(self._deps))
if not include_primary:
return self._dlist
else:
return [(self.head, self.deprel)] + self._dlist
def set_deps(self, dlist):
self._deps = [DSEP.join(hd) for hd in dlist]
self._dlist = None
def has_deprel(self, deprel, check_deps=True):
if self.deprel == deprel:
return True
elif not check_deps:
return False
elif any(d for d in self.deps() if d[1] == deprel):
return True
else:
return False
def wipe_annotation(self):
self.lemma = '_'
self.cpostag = '_'
self.postag = '_'
self._feats = '_'
self.head = '_'
self.deprel = '_'
self._deps = '_'
self.misc = '_'
def to_brat_standoff(self, element_by_id):
"""Return list of brat standoff annotations for the element."""
# base ID, unique within the document
bid = '%s.%s' % (self.sentence.id, self.id)
if self.is_word():
# Word, maps to: Textbound with the coarse POS tag as
# type, freeform text comment with LEMMA, POSTAG and
# MISC (when nonempty) as values, attribute for each
# feature.
# textbounds
spans = [[self.offset, self.offset+len(self.form)]]
textbounds = [
brat.Textbound('T'+bid, self.cpostag, spans, self.form),
]
# comments
freeform = [
('LEMMA', self.lemma),
('POSTAG', self.postag),
]
if self.misc != '_':
freeform.append(('MISC', self.misc))
comments = [
brat.Comment('#'+bid, COMMENT_TYPE, 'T'+bid,
' '.join(u'%s=%s' % f for f in freeform))
]
# attributes
attribs = []
for name, value in self.feats():
aid = 'A'+bid+'-%d'%(len(attribs)+1)
attribs.append(brat.Attribute(aid, name, 'T'+bid, value))
# relations
relations = []
for head, deprel in self.deps(include_primary=True):
if head == '0':
continue # skip root
rid = 'R'+bid+'-%d'%(len(relations)+1)
tid = '%s.%s' % (self.sentence.id, element_by_id[head].id)
args = [('Arg1', 'T'+tid), ('Arg2', 'T'+bid)]
relations.append(brat.Relation(rid, deprel, args))
return textbounds + attribs + relations + comments
else:
# Multi-word token, maps to: Textbound with a special type,
# and free-text comment containing the form.
# Span corresponds to maximum span over covered tokens.
start, end = self.id.split('-')
first, last = element_by_id[start], element_by_id[end]
spans = [[first.offset, last.offset+len(last.form)]]
text = ' '.join(str(element_by_id[str(t)].form)
for t in range(int(start), int(end)+1))
return [
brat.Textbound('T'+bid, 'Multiword-token', spans, text),
brat.Comment('#'+bid, COMMENT_TYPE, 'T'+bid, 'FORM='+self.form)
]
def __unicode__(self):
fields = [self.id, self.form, self.lemma, self.cpostag, self.postag,
self._feats, self.head, self.deprel, self._deps, self.misc]
fields[5] = '_' if fields[5] == [] else '|'.join(sorted(fields[5], key=lambda s: s.lower())) # feats
fields[8] = '_' if fields[8] == [] else '|'.join(fields[8]) # deps
return '\t'.join(fields)
@classmethod
def from_string(cls, s):
fields = s.split('\t')
if len(fields) != 10:
raise FormatError('got %d/10 field(s)' % len(fields), s)
fields[5] = [] if fields[5] == '_' else fields[5].split('|') # feats
fields[8] = [] if fields[8] == '_' else fields[8].split('|') # deps
return cls(*fields)
class Sentence(object):
def __init__(self, id_=0, filename=None, base_offset=0):
"""Initialize a new, empty Sentence."""
self.comments = []
self._elements = []
self.id = id_
self.filename = filename
self.base_offset = base_offset
self.next_offset = base_offset
# mapping from IDs to elements
self._element_by_id = None
def append(self, element):
"""Append word or multi-word token to sentence."""
self._elements.append(element)
assert element.sentence is None, 'element in multiple sentences?'
element.sentence = self
element.offset = self.next_offset
if element.is_word():
self.next_offset += len(element.form) + 1
else:
# multi-word token; don't shift position of next token
pass
# reset cache (TODO: extend instead)
self._element_by_id = None
def empty(self):
return self._elements == []
def words(self):
"""Return a list of the words in the sentence."""
return [e for e in self._elements if e.is_word()]
def text(self, use_tokens=False, separator=' '):
"""Return the text of the sentence."""
if use_tokens:
raise NotImplementedError('multi-word token text not supported.')
else:
return separator.join(w.form for w in self.words())
def length(self, use_tokens=False):
"""Return the length of the sentence text."""
return len(self.text(use_tokens))
def element_by_id(self):
"""Return mapping from id to element."""
if self._element_by_id is None:
self._element_by_id = { e.id: e for e in self._elements }
return self._element_by_id
def get_element(self, id_):
"""Return element by id."""
return self.element_by_id()[id_]
def wipe_annotation(self):
for e in self._elements:
if e.is_word():
e.wipe_annotation()
def remove_element(self, id_):
# TODO: implement for cases where multi-word tokens span the
# element to remove.
assert len(self.words()) == len(self._elements), 'not implemented'
# there must not be references to the element to remove
for w in self.words():
assert not any(h for h, d in w.deps(True) if h == id_), \
'cannot remove %s, references remain' % id_
# drop element
element = self.get_element(id_)
self._elements.remove(element)
self._element_by_id = None
# update IDs
id_map = { u'0' : u'0' }
for i, w in enumerate(self.words()):
new_id = unicode(i+1)
id_map[w.id] = new_id
w.id = new_id
for w in self.words():
w.head = id_map[w.head]
w.set_deps([(id_map[h], d) for h, d in w.deps()])
def dependents(self, head, include_secondary=True):
if isinstance(head, Element):
head_id = head.id
deps = []
for w in self.words():
if not include_secondary:
wdeps = [(w.head, w.deprel)]
else:
wdeps = w.deps(include_primary=True)
for head, deprel in wdeps:
if head == head_id:
deps.append((w.id, deprel))
return deps
def assign_offsets(self, base_offset=None, use_tokens=False):
"""Assign offsets to sentence elements."""
if base_offset is not None:
self.base_offset = base_offset
offset = self.base_offset
if use_tokens:
raise NotImplementedError('multi-word token text not supported.')
else:
# Words are separated by a single character and multi-word
# tokens appear at the start of the position of their
# initial words with zero-width spans.
for e in self._elements:
e.offset = offset
if e.is_word():
offset += len(e.form) + 1
def to_brat_standoff(self):
"""Return list of brat standoff annotations for the sentence."""
# Create mapping from ID to element.
annotations = []
for element in self._elements:
annotations.extend(element.to_brat_standoff(self.element_by_id()))
return annotations
def __unicode__(self):
element_unicode = [unicode(e) for e in self._elements]
return '\n'.join(self.comments + element_unicode)+'\n'
class Document(object):
def __init__(self, filename=None):
self._sentences = []
self.filename = filename
def append(self, sentence):
"""Append sentence to document."""
self._sentences.append(sentence)
def empty(self):
return self._sentences == []
def words(self):
"""Return a list of the words in the document."""
return [w for s in self.sentences() for w in s.words()]
def sentences(self):
"""Return a list of the sentences in the document."""
return self._sentences
def text(self, use_tokens=False, element_separator=' ',
sentence_separator='\n'):
return sentence_separator.join(s.text(use_tokens, element_separator)
for s in self.sentences())
def to_brat_standoff(self):
"""Return list of brat standoff annotations for the document."""
annotations = []
for sentence in self._sentences:
annotations.extend(sentence.to_brat_standoff())
return annotations
def _file_name(file_like, default='document'):
"""Return name of named file or file-like object, or default if not
available."""
# If given a string, assume that it's the name
if isinstance(file_like, basestring):
return file_like
try:
return file_like.name
except AttributeError:
return default
def read_documents(source, filename=None):
"""Read CoNLL-U format, yielding Document objects."""
if filename is None:
filename = _file_name(source)
current = Document(filename)
for sentence in read_conllu(source, filename):
# TODO: recognize and respect document boundaries in source data.
current.append(sentence)
yield current
def read_conllu(source, filename=None):
"""Read CoNLL-U format, yielding Sentence objects.
Note: incomplete implementation, lacks validation."""
# If given a string, assume it's a file name, open and recurse.
if isinstance(source, basestring):
with codecs.open(source, encoding='utf-8') as i:
for s in read_conllu(i, filename=source):
yield s
return
if filename is None:
filename = _file_name(source)
sent_num, offset = 1, 0
current = Sentence(sent_num, filename, offset)
for ln, line in enumerate(source):
line = line.rstrip('\n')
if not line:
if not current.empty():
# Assume single character sentence separator.
offset += current.length() + 1
yield current
else:
raise FormatError('empty sentence', line, ln+1)
sent_num += 1
current = Sentence(sent_num, filename, offset)
elif line[0] == '#':
current.comments.append(line)
else:
try:
current.append(Element.from_string(line))
except FormatError, e:
e.linenum = ln+1
raise e
assert current.empty(), 'missing terminating whitespace'
| [
1,
18787,
4855,
29914,
2109,
29914,
6272,
3017,
13,
13,
29937,
3189,
29940,
2208,
29899,
29965,
3402,
2304,
13,
13,
5215,
337,
13,
5215,
775,
2395,
13,
13,
5215,
1506,
271,
13,
13,
3166,
4256,
8504,
1053,
2318,
1609,
13,
13,
29937,
4682,
1024,
29899,
1767,
28128,
13,
29943,
1660,
29925,
353,
525,
2433,
13,
29937,
10609,
2343,
29899,
2674,
28128,
13,
29928,
1660,
29925,
353,
525,
11283,
13,
13,
29937,
12362,
29899,
689,
1426,
17195,
1134,
297,
1506,
271,
5609,
13,
3217,
7428,
3919,
29918,
11116,
353,
525,
2744,
1333,
1061,
3664,
267,
29915,
13,
13,
1990,
19191,
2392,
29898,
2451,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
10191,
29892,
1196,
29922,
8516,
29892,
6276,
18605,
29922,
8516,
1125,
13,
4706,
1583,
29889,
7645,
353,
10191,
13,
4706,
1583,
29889,
1220,
353,
1196,
13,
4706,
1583,
29889,
1915,
18605,
353,
6276,
18605,
13,
13,
1678,
822,
4770,
710,
12035,
1311,
1125,
308,
13,
4706,
10191,
353,
1583,
29889,
7645,
13,
4706,
565,
1583,
29889,
1220,
338,
451,
6213,
29901,
13,
9651,
10191,
4619,
525,
29901,
13577,
29974,
1311,
29889,
1220,
29889,
12508,
877,
294,
18869,
742,
525,
6506,
1495,
29974,
11838,
29915,
13,
4706,
565,
1583,
29889,
1915,
18605,
338,
451,
6213,
29901,
13,
9651,
10191,
4619,
525,
313,
1220,
1273,
29881,
16029,
1273,
1583,
29889,
1915,
18605,
13,
4706,
736,
10191,
13,
13,
29907,
5438,
10051,
29918,
1525,
353,
337,
29889,
12198,
29898,
29878,
29915,
29985,
29961,
29874,
29899,
25265,
29899,
29999,
10062,
29938,
1495,
13,
5438,
10051,
29918,
1525,
353,
337,
29889,
12198,
29898,
29878,
29915,
29985,
7110,
29916,
29906,
29900,
2612,
29916,
600,
10062,
29938,
1495,
13,
13,
1990,
10619,
29898,
3318,
1125,
13,
1678,
9995,
1123,
4569,
1237,
3189,
29940,
2208,
29899,
29965,
1734,
470,
2473,
29899,
1742,
5993,
1213,
15945,
13,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1178,
3383,
883,
29892,
10383,
29892,
274,
2490,
351,
29892,
1400,
351,
29892,
13,
462,
1238,
1446,
29892,
2343,
29892,
1401,
2674,
29892,
316,
567,
29892,
3984,
29883,
29892,
9210,
29922,
29900,
1125,
13,
4706,
1583,
29889,
333,
353,
1178,
29918,
13,
4706,
1583,
29889,
689,
353,
883,
13,
4706,
1583,
29889,
13846,
353,
10383,
13,
4706,
1583,
29889,
29883,
2490,
351,
353,
274,
2490,
351,
13,
4706,
1583,
29889,
2490,
351,
353,
1400,
351,
13,
4706,
1583,
3032,
1725,
1446,
353,
1238,
1446,
13,
4706,
1583,
29889,
2813,
353,
2343,
13,
4706,
1583,
29889,
311,
1457,
29880,
353,
1401,
2674,
13,
4706,
1583,
3032,
311,
567,
353,
316,
567,
13,
4706,
1583,
29889,
29885,
10669,
353,
3984,
29883,
13,
13,
4706,
1583,
29889,
10289,
353,
9210,
13,
4706,
1583,
29889,
18616,
663,
353,
6213,
13,
13,
4706,
1583,
29889,
15480,
580,
13,
13,
4706,
1583,
3032,
29888,
1958,
353,
6213,
13,
4706,
1583,
3032,
29881,
1761,
353,
6213,
13,
13,
1678,
822,
12725,
29898,
1311,
1125,
13,
4706,
396,
13114,
3402,
8845,
313,
262,
8835,
29897,
13,
13,
4706,
565,
451,
1583,
29889,
275,
29918,
1742,
7295,
13,
9651,
396,
14402,
29901,
1423,
2473,
29899,
1742,
18897,
13,
9651,
736,
13,
13,
4706,
396,
777,
2931,
731,
11938,
13,
4706,
565,
451,
315,
5438,
10051,
29918,
1525,
29889,
4352,
29898,
1311,
29889,
29883,
2490,
351,
1125,
13,
9651,
12020,
19191,
2392,
877,
20965,
315,
5438,
10051,
29901,
1273,
29879,
29915,
1273,
1583,
29889,
29883,
2490,
351,
29897,
13,
4706,
565,
451,
11971,
10051,
29918,
1525,
29889,
4352,
29898,
1311,
29889,
2490,
351,
1125,
13,
9651,
12020,
19191,
2392,
877,
20965,
11971,
10051,
29901,
1273,
29879,
29915,
1273,
1583,
29889,
2490,
351,
29897,
13,
13,
4706,
396,
694,
4682,
338,
4069,
13,
4706,
565,
738,
29898,
5574,
363,
269,
297,
1583,
3032,
1725,
1446,
565,
7431,
29898,
29879,
29897,
1275,
29871,
29900,
1125,
13,
9651,
12020,
19191,
2392,
877,
6310,
4682,
29901,
1273,
29879,
29915,
1273,
851,
29898,
1311,
3032,
1725,
1446,
876,
13,
13,
4706,
396,
4682,
2983,
322,
1819,
13055,
491,
4682,
28128,
13,
4706,
565,
738,
29898,
29879,
363,
269,
297,
1583,
3032,
1725,
1446,
565,
7431,
29898,
29879,
29889,
5451,
29898,
29943,
1660,
29925,
876,
529,
29871,
29906,
1125,
13,
9651,
12020,
19191,
2392,
877,
20965,
5680,
29901,
1273,
29879,
29915,
1273,
851,
29898,
1311,
3032,
1725,
1446,
876,
13,
13,
4706,
396,
694,
4682,
1024,
5565,
1446,
13,
4706,
565,
738,
29898,
29876,
363,
302,
29892,
330,
297,
2318,
1609,
29898,
24582,
29898,
29879,
29889,
5451,
29898,
29943,
1660,
29925,
9601,
29900,
29962,
363,
269,
297,
1583,
3032,
1725,
1446,
876,
13,
1669,
565,
7431,
29898,
1761,
29898,
29887,
876,
1405,
29871,
29896,
1125,
13,
9651,
12020,
19191,
2392,
877,
20908,
5926,
5680,
29901,
1273,
29879,
29915,
1273,
851,
29898,
1311,
3032,
1725,
1446,
876,
13,
13,
4706,
396,
2343,
338,
6043,
13,
4706,
1018,
29901,
13,
9651,
938,
29898,
1311,
29889,
2813,
29897,
13,
4706,
5174,
7865,
2392,
29901,
13,
9651,
12020,
19191,
2392,
877,
5464,
29899,
524,
2343,
29901,
1273,
29879,
29915,
1273,
1583,
29889,
2813,
29897,
13,
13,
1678,
822,
338,
29918,
1742,
29898,
1311,
1125,
13,
4706,
1018,
29901,
13,
9651,
659,
353,
938,
29898,
1311,
29889,
333,
29897,
13,
9651,
736,
5852,
13,
4706,
5174,
7865,
2392,
29901,
13,
9651,
736,
7700,
13,
13,
1678,
822,
756,
29918,
1725,
271,
29898,
1311,
29892,
1024,
1125,
13,
4706,
736,
1024,
297,
1583,
29889,
1725,
271,
29918,
1958,
580,
13,
13,
1678,
822,
788,
29918,
1725,
1446,
29898,
1311,
29892,
1238,
1446,
1125,
13,
4706,
396,
1024,
29899,
1767,
11000,
13,
4706,
4974,
451,
738,
29898,
29876,
29894,
363,
302,
29894,
297,
1238,
1446,
565,
7431,
29898,
29876,
29894,
29897,
2804,
29871,
29906,
29897,
13,
4706,
1583,
3032,
1725,
1446,
29889,
21843,
29898,
29943,
1660,
29925,
29889,
7122,
29898,
29876,
29894,
29897,
363,
302,
29894,
297,
1238,
1446,
29897,
13,
4706,
1583,
3032,
29888,
1958,
353,
6213,
13,
13,
1678,
822,
731,
29918,
1725,
1446,
29898,
1311,
29892,
1238,
1446,
1125,
13,
4706,
1583,
3032,
1725,
1446,
353,
5159,
13,
4706,
1583,
29889,
1202,
29918,
1725,
1446,
29898,
1725,
1446,
29897,
13,
4706,
1583,
3032,
29888,
1958,
353,
6213,
13,
13,
1678,
822,
3349,
29918,
1725,
271,
29898,
1311,
29892,
1024,
29892,
995,
1125,
13,
4706,
302,
29894,
353,
383,
1660,
29925,
29889,
7122,
3552,
978,
29892,
995,
876,
13,
4706,
1583,
3032,
1725,
1446,
29889,
5992,
29898,
29876,
29894,
29897,
13,
4706,
1583,
3032,
29888,
1958,
353,
6213,
13,
13,
1678,
822,
9773,
29918,
29885,
10669,
29898,
1311,
29892,
995,
1125,
13,
4706,
565,
1583,
29889,
29885,
10669,
1275,
22868,
2396,
13,
9651,
1583,
29889,
29885,
10669,
353,
995,
13,
4706,
1683,
29901,
13,
9651,
1583,
29889,
29885,
10669,
353,
1583,
29889,
29885,
10669,
718,
525,
29989,
29915,
718,
995,
13,
13,
1678,
822,
1238,
271,
29918,
7039,
29898,
1311,
1125,
13,
4706,
736,
518,
29888,
29889,
5451,
29898,
29943,
1660,
29925,
9601,
29900,
29962,
363,
285,
297,
1583,
3032,
1725,
1446,
29962,
13,
13,
1678,
822,
1238,
271,
29918,
1958,
29898,
1311,
1125,
13,
4706,
565,
1583,
3032,
29888,
1958,
338,
6213,
29901,
13,
9651,
1018,
29901,
13,
18884,
1583,
3032,
29888,
1958,
353,
9657,
4197,
29888,
29889,
5451,
29898,
29943,
1660,
29925,
29892,
29871,
29896,
29897,
363,
285,
297,
1583,
3032,
1725,
1446,
2314,
13,
9651,
5174,
7865,
2392,
29901,
13,
18884,
12020,
7865,
2392,
877,
26061,
304,
3588,
525,
718,
851,
29898,
1311,
3032,
1725,
1446,
876,
13,
4706,
736,
1583,
3032,
29888,
1958,
13,
13,
1678,
822,
1238,
1446,
29898,
1311,
1125,
13,
4706,
736,
1583,
29889,
1725,
271,
29918,
1958,
2141,
7076,
580,
13,
13,
1678,
822,
316,
567,
29898,
1311,
29892,
3160,
29918,
16072,
29922,
8824,
1125,
13,
4706,
565,
1583,
3032,
29881,
1761,
338,
6213,
29901,
13,
9651,
1018,
29901,
13,
18884,
1583,
3032,
29881,
1761,
353,
518,
29881,
29889,
5451,
29898,
29928,
1660,
29925,
29892,
29871,
29896,
29897,
363,
270,
297,
1583,
3032,
311,
567,
29962,
13,
9651,
5174,
29901,
13,
18884,
12020,
19191,
2392,
877,
26061,
304,
6088,
525,
718,
851,
29898,
1311,
3032,
311,
567,
876,
13,
4706,
565,
451,
3160,
29918,
16072,
29901,
13,
9651,
736,
1583,
3032,
29881,
1761,
13,
4706,
1683,
29901,
13,
9651,
736,
17288,
1311,
29889,
2813,
29892,
1583,
29889,
311,
1457,
29880,
4638,
718,
1583,
3032,
29881,
1761,
13,
13,
1678,
822,
731,
29918,
311,
567,
29898,
1311,
29892,
270,
1761,
1125,
13,
4706,
1583,
3032,
311,
567,
353,
518,
29928,
1660,
29925,
29889,
7122,
29898,
16440,
29897,
363,
298,
29881,
297,
270,
1761,
29962,
13,
4706,
1583,
3032,
29881,
1761,
353,
6213,
13,
13,
1678,
822,
756,
29918,
311,
1457,
29880,
29898,
1311,
29892,
1401,
2674,
29892,
1423,
29918,
311,
567,
29922,
5574,
1125,
13,
4706,
565,
1583,
29889,
311,
1457,
29880,
1275,
1401,
2674,
29901,
13,
9651,
736,
5852,
13,
4706,
25342,
451,
1423,
29918,
311,
567,
29901,
13,
9651,
736,
7700,
13,
4706,
25342,
738,
29898,
29881,
363,
270,
297,
1583,
29889,
311,
567,
580,
565,
270,
29961,
29896,
29962,
1275,
1401,
2674,
1125,
13,
9651,
736,
5852,
13,
4706,
1683,
29901,
13,
9651,
736,
7700,
13,
13,
1678,
822,
281,
15705,
29918,
18317,
29898,
1311,
1125,
13,
4706,
1583,
29889,
13846,
353,
22868,
29915,
13,
4706,
1583,
29889,
29883,
2490,
351,
353,
22868,
29915,
13,
4706,
1583,
29889,
2490,
351,
353,
22868,
29915,
13,
4706,
1583,
3032,
1725,
1446,
353,
22868,
29915,
13,
4706,
1583,
29889,
2813,
353,
22868,
29915,
13,
4706,
1583,
29889,
311,
1457,
29880,
353,
22868,
29915,
13,
4706,
1583,
3032,
311,
567,
353,
22868,
29915,
13,
4706,
1583,
29889,
29885,
10669,
353,
22868,
29915,
13,
13,
1678,
822,
304,
29918,
1182,
271,
29918,
1689,
2696,
29898,
1311,
29892,
1543,
29918,
1609,
29918,
333,
1125,
13,
4706,
9995,
11609,
1051,
310,
1506,
271,
380,
1743,
600,
25495,
363,
278,
1543,
1213,
15945,
13,
4706,
396,
2967,
3553,
29892,
5412,
2629,
278,
1842,
13,
4706,
21000,
353,
14210,
29879,
29889,
29995,
29879,
29915,
1273,
313,
1311,
29889,
18616,
663,
29889,
333,
29892,
1583,
29889,
333,
29897,
13,
4706,
565,
1583,
29889,
275,
29918,
1742,
7295,
13,
9651,
396,
10803,
29892,
11053,
304,
29901,
3992,
9917,
411,
278,
1302,
7989,
349,
3267,
4055,
408,
13,
9651,
396,
1134,
29892,
3889,
689,
1426,
3440,
411,
11060,
29924,
1529,
29892,
11971,
10051,
322,
13,
9651,
396,
341,
3235,
29907,
313,
8256,
1661,
6310,
29897,
408,
1819,
29892,
5352,
363,
1269,
13,
9651,
396,
4682,
29889,
13,
9651,
396,
1426,
23687,
13,
9651,
805,
550,
353,
5519,
1311,
29889,
10289,
29892,
1583,
29889,
10289,
29974,
2435,
29898,
1311,
29889,
689,
4638,
29962,
13,
9651,
1426,
23687,
353,
518,
13,
18884,
1506,
271,
29889,
1626,
9917,
877,
29911,
18717,
23883,
29892,
1583,
29889,
29883,
2490,
351,
29892,
805,
550,
29892,
1583,
29889,
689,
511,
13,
9651,
4514,
13,
9651,
396,
6589,
13,
9651,
3889,
689,
353,
518,
13,
18884,
6702,
1307,
29924,
1529,
742,
1583,
29889,
13846,
511,
13,
18884,
6702,
5438,
10051,
742,
1583,
29889,
2490,
351,
511,
13,
9651,
4514,
13,
9651,
565,
1583,
29889,
29885,
10669,
2804,
22868,
2396,
13,
18884,
3889,
689,
29889,
4397,
29898,
877,
29924,
3235,
29907,
742,
1583,
29889,
29885,
10669,
876,
13,
9651,
6589,
353,
518,
13,
18884,
1506,
271,
29889,
20001,
14237,
18717,
23883,
29892,
4810,
7428,
3919,
29918,
11116,
29892,
525,
29911,
18717,
23883,
29892,
13,
462,
632,
525,
15300,
7122,
29898,
29884,
29915,
29995,
29879,
16328,
29879,
29915,
1273,
285,
363,
285,
297,
3889,
689,
876,
13,
9651,
4514,
13,
9651,
396,
8393,
13,
9651,
1098,
1091,
29879,
353,
5159,
13,
9651,
363,
1024,
29892,
995,
297,
1583,
29889,
1725,
1446,
7295,
13,
18884,
16226,
353,
525,
29909,
18717,
23883,
23097,
19222,
29881,
29915,
29995,
29898,
2435,
29898,
1131,
1091,
29879,
7240,
29896,
29897,
13,
18884,
1098,
1091,
29879,
29889,
4397,
29898,
1182,
271,
29889,
6708,
29898,
29874,
333,
29892,
1024,
29892,
525,
29911,
18717,
23883,
29892,
995,
876,
13,
9651,
396,
5302,
13,
9651,
5302,
353,
5159,
13,
9651,
363,
2343,
29892,
1401,
2674,
297,
1583,
29889,
311,
567,
29898,
2856,
29918,
16072,
29922,
5574,
1125,
13,
18884,
565,
2343,
1275,
525,
29900,
2396,
13,
462,
1678,
6773,
396,
14383,
3876,
13,
18884,
8177,
353,
525,
29934,
18717,
23883,
23097,
19222,
29881,
29915,
29995,
29898,
2435,
29898,
2674,
800,
7240,
29896,
29897,
13,
18884,
10668,
353,
14210,
29879,
29889,
29995,
29879,
29915,
1273,
313,
1311,
29889,
18616,
663,
29889,
333,
29892,
1543,
29918,
1609,
29918,
333,
29961,
2813,
1822,
333,
29897,
13,
18884,
6389,
353,
518,
877,
8559,
29896,
742,
525,
29911,
18717,
17681,
511,
6702,
8559,
29906,
742,
525,
29911,
18717,
23883,
4638,
13,
18884,
5302,
29889,
4397,
29898,
1182,
271,
29889,
9662,
362,
29898,
2429,
29892,
1401,
2674,
29892,
6389,
876,
13,
9651,
736,
1426,
23687,
718,
1098,
1091,
29879,
718,
5302,
718,
6589,
13,
4706,
1683,
29901,
13,
9651,
396,
14974,
29899,
1742,
5993,
29892,
11053,
304,
29901,
3992,
9917,
411,
263,
4266,
1134,
29892,
13,
9651,
396,
322,
3889,
29899,
726,
3440,
6943,
278,
883,
29889,
13,
9651,
396,
7948,
16161,
304,
7472,
10638,
975,
10664,
18897,
29889,
13,
9651,
1369,
29892,
1095,
353,
1583,
29889,
333,
29889,
5451,
877,
29899,
1495,
13,
9651,
937,
29892,
1833,
353,
1543,
29918,
1609,
29918,
333,
29961,
2962,
1402,
1543,
29918,
1609,
29918,
333,
29961,
355,
29962,
13,
9651,
805,
550,
353,
5519,
4102,
29889,
10289,
29892,
1833,
29889,
10289,
29974,
2435,
29898,
4230,
29889,
689,
4638,
29962,
13,
9651,
1426,
29871,
353,
525,
15300,
7122,
29898,
710,
29898,
5029,
29918,
1609,
29918,
333,
29961,
710,
29898,
29873,
29897,
1822,
689,
29897,
13,
462,
795,
363,
260,
297,
3464,
29898,
524,
29898,
2962,
511,
938,
29898,
355,
7240,
29896,
876,
13,
9651,
736,
518,
13,
18884,
1506,
271,
29889,
1626,
9917,
877,
29911,
18717,
23883,
29892,
525,
15329,
1742,
29899,
6979,
742,
805,
550,
29892,
1426,
511,
13,
18884,
1506,
271,
29889,
20001,
14237,
18717,
23883,
29892,
4810,
7428,
3919,
29918,
11116,
29892,
525,
29911,
18717,
23883,
29892,
525,
19094,
2433,
29974,
1311,
29889,
689,
29897,
13,
9651,
4514,
13,
13,
1678,
822,
4770,
2523,
356,
12035,
1311,
1125,
13,
4706,
4235,
353,
518,
1311,
29889,
333,
29892,
1583,
29889,
689,
29892,
1583,
29889,
13846,
29892,
1583,
29889,
29883,
2490,
351,
29892,
1583,
29889,
2490,
351,
29892,
29871,
13,
462,
29871,
1583,
3032,
1725,
1446,
29892,
1583,
29889,
2813,
29892,
1583,
29889,
311,
1457,
29880,
29892,
1583,
3032,
311,
567,
29892,
1583,
29889,
29885,
10669,
29962,
13,
4706,
4235,
29961,
29945,
29962,
353,
22868,
29915,
565,
4235,
29961,
29945,
29962,
1275,
5159,
1683,
525,
29989,
4286,
7122,
29898,
24582,
29898,
9621,
29961,
29945,
1402,
1820,
29922,
2892,
269,
29901,
269,
29889,
13609,
22130,
396,
1238,
1446,
13,
4706,
4235,
29961,
29947,
29962,
353,
22868,
29915,
565,
4235,
29961,
29947,
29962,
1275,
5159,
1683,
525,
29989,
4286,
7122,
29898,
9621,
29961,
29947,
2314,
396,
316,
567,
13,
4706,
736,
11297,
29873,
4286,
7122,
29898,
9621,
29897,
13,
13,
1678,
732,
1990,
5696,
13,
1678,
822,
515,
29918,
1807,
29898,
25932,
29892,
269,
1125,
13,
4706,
4235,
353,
269,
29889,
5451,
28909,
29873,
1495,
13,
4706,
565,
7431,
29898,
9621,
29897,
2804,
29871,
29896,
29900,
29901,
13,
9651,
12020,
19191,
2392,
877,
7085,
1273,
29881,
29914,
29896,
29900,
1746,
29898,
29879,
16029,
1273,
7431,
29898,
9621,
511,
269,
29897,
13,
4706,
4235,
29961,
29945,
29962,
353,
5159,
565,
4235,
29961,
29945,
29962,
1275,
22868,
29915,
1683,
4235,
29961,
29945,
1822,
5451,
877,
29989,
1495,
396,
1238,
1446,
13,
4706,
4235,
29961,
29947,
29962,
353,
5159,
565,
4235,
29961,
29947,
29962,
1275,
22868,
29915,
1683,
4235,
29961,
29947,
1822,
5451,
877,
29989,
1495,
396,
316,
567,
13,
4706,
736,
1067,
29879,
10456,
9621,
29897,
13,
13,
1990,
28048,
663,
29898,
3318,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1178,
29918,
29922,
29900,
29892,
10422,
29922,
8516,
29892,
2967,
29918,
10289,
29922,
29900,
1125,
13,
4706,
9995,
6644,
6646,
263,
716,
29892,
4069,
28048,
663,
1213,
15945,
13,
4706,
1583,
29889,
21032,
353,
5159,
13,
4706,
1583,
3032,
17664,
353,
5159,
13,
4706,
1583,
29889,
333,
353,
1178,
29918,
13,
4706,
1583,
29889,
9507,
353,
10422,
13,
4706,
1583,
29889,
3188,
29918,
10289,
353,
2967,
29918,
10289,
13,
4706,
1583,
29889,
4622,
29918,
10289,
353,
2967,
29918,
10289,
13,
4706,
396,
10417,
515,
23481,
304,
3161,
13,
4706,
1583,
3032,
5029,
29918,
1609,
29918,
333,
353,
6213,
13,
13,
1678,
822,
9773,
29898,
1311,
29892,
1543,
1125,
13,
4706,
9995,
18277,
1734,
470,
2473,
29899,
1742,
5993,
304,
10541,
1213,
15945,
13,
4706,
1583,
3032,
17664,
29889,
4397,
29898,
5029,
29897,
13,
4706,
4974,
1543,
29889,
18616,
663,
338,
6213,
29892,
525,
5029,
297,
2999,
25260,
17901,
13,
4706,
1543,
29889,
18616,
663,
353,
1583,
13,
4706,
1543,
29889,
10289,
353,
1583,
29889,
4622,
29918,
10289,
13,
4706,
565,
1543,
29889,
275,
29918,
1742,
7295,
13,
9651,
1583,
29889,
4622,
29918,
10289,
4619,
7431,
29898,
5029,
29889,
689,
29897,
718,
29871,
29896,
13,
4706,
1683,
29901,
13,
9651,
396,
2473,
29899,
1742,
5993,
29936,
1016,
29915,
29873,
9500,
2602,
310,
2446,
5993,
13,
9651,
1209,
13,
4706,
396,
10092,
7090,
313,
4986,
3970,
29901,
10985,
2012,
29897,
13,
4706,
1583,
3032,
5029,
29918,
1609,
29918,
333,
353,
6213,
13,
13,
1678,
822,
4069,
29898,
1311,
1125,
13,
4706,
736,
1583,
3032,
17664,
1275,
5159,
13,
13,
1678,
822,
3838,
29898,
1311,
1125,
13,
4706,
9995,
11609,
263,
1051,
310,
278,
3838,
297,
278,
10541,
1213,
15945,
13,
4706,
736,
518,
29872,
363,
321,
297,
1583,
3032,
17664,
565,
321,
29889,
275,
29918,
1742,
580,
29962,
13,
13,
1678,
822,
1426,
29898,
1311,
29892,
671,
29918,
517,
12360,
29922,
8824,
29892,
28128,
2433,
525,
1125,
13,
4706,
9995,
11609,
278,
1426,
310,
278,
10541,
1213,
15945,
13,
4706,
565,
671,
29918,
517,
12360,
29901,
13,
9651,
12020,
2216,
1888,
2037,
287,
2392,
877,
9910,
29899,
1742,
5993,
1426,
451,
6969,
29889,
1495,
13,
4706,
1683,
29901,
13,
9651,
736,
28128,
29889,
7122,
29898,
29893,
29889,
689,
363,
281,
297,
1583,
29889,
9303,
3101,
13,
13,
1678,
822,
3309,
29898,
1311,
29892,
671,
29918,
517,
12360,
29922,
8824,
1125,
13,
4706,
9995,
11609,
278,
3309,
310,
278,
10541,
1426,
1213,
15945,
13,
4706,
736,
7431,
29898,
1311,
29889,
726,
29898,
1509,
29918,
517,
12360,
876,
13,
13,
1678,
822,
1543,
29918,
1609,
29918,
333,
29898,
1311,
1125,
13,
4706,
9995,
11609,
10417,
515,
1178,
304,
1543,
1213,
15945,
13,
4706,
565,
1583,
3032,
5029,
29918,
1609,
29918,
333,
338,
6213,
29901,
13,
9651,
1583,
3032,
5029,
29918,
1609,
29918,
333,
353,
426,
321,
29889,
333,
29901,
321,
363,
321,
297,
1583,
3032,
17664,
500,
13,
4706,
736,
1583,
3032,
5029,
29918,
1609,
29918,
333,
13,
13,
1678,
822,
679,
29918,
5029,
29898,
1311,
29892,
1178,
29918,
1125,
13,
4706,
9995,
11609,
1543,
491,
1178,
1213,
15945,
13,
4706,
736,
1583,
29889,
5029,
29918,
1609,
29918,
333,
580,
29961,
333,
29918,
29962,
13,
13,
1678,
822,
281,
15705,
29918,
18317,
29898,
1311,
1125,
13,
4706,
363,
321,
297,
1583,
3032,
17664,
29901,
13,
9651,
565,
321,
29889,
275,
29918,
1742,
7295,
13,
18884,
321,
29889,
4353,
412,
29918,
18317,
580,
13,
13,
1678,
822,
3349,
29918,
5029,
29898,
1311,
29892,
1178,
29918,
1125,
13,
4706,
396,
14402,
29901,
2334,
363,
4251,
988,
2473,
29899,
1742,
18897,
10638,
278,
13,
4706,
396,
1543,
304,
3349,
29889,
13,
4706,
4974,
7431,
29898,
1311,
29889,
9303,
3101,
1275,
7431,
29898,
1311,
3032,
17664,
511,
525,
1333,
8762,
29915,
13,
13,
4706,
396,
727,
1818,
451,
367,
9282,
304,
278,
1543,
304,
3349,
13,
4706,
363,
281,
297,
1583,
29889,
9303,
7295,
13,
9651,
4974,
451,
738,
29898,
29882,
363,
298,
29892,
270,
297,
281,
29889,
311,
567,
29898,
5574,
29897,
565,
298,
1275,
1178,
29918,
511,
320,
13,
18884,
525,
29883,
6735,
3349,
1273,
29879,
29892,
9282,
3933,
29915,
1273,
1178,
29918,
13,
13,
4706,
396,
5768,
1543,
13,
4706,
1543,
353,
1583,
29889,
657,
29918,
5029,
29898,
333,
19925,
13,
4706,
1583,
3032,
17664,
29889,
5992,
29898,
5029,
29897,
13,
4706,
1583,
3032,
5029,
29918,
1609,
29918,
333,
353,
6213,
13,
13,
4706,
396,
2767,
23481,
13,
4706,
1178,
29918,
1958,
353,
426,
318,
29915,
29900,
29915,
584,
318,
29915,
29900,
29915,
500,
13,
4706,
363,
474,
29892,
281,
297,
26985,
29898,
1311,
29889,
9303,
580,
1125,
13,
9651,
716,
29918,
333,
353,
29104,
29898,
29875,
29974,
29896,
29897,
13,
9651,
1178,
29918,
1958,
29961,
29893,
29889,
333,
29962,
353,
716,
29918,
333,
13,
9651,
281,
29889,
333,
353,
716,
29918,
333,
13,
4706,
363,
281,
297,
1583,
29889,
9303,
7295,
13,
9651,
281,
29889,
2813,
353,
1178,
29918,
1958,
29961,
29893,
29889,
2813,
29962,
13,
9651,
281,
29889,
842,
29918,
311,
567,
4197,
29898,
333,
29918,
1958,
29961,
29882,
1402,
270,
29897,
363,
298,
29892,
270,
297,
281,
29889,
311,
567,
580,
2314,
13,
13,
1678,
822,
8839,
1237,
29898,
1311,
29892,
2343,
29892,
3160,
29918,
7496,
653,
29922,
5574,
1125,
13,
4706,
565,
338,
8758,
29898,
2813,
29892,
10619,
1125,
13,
9651,
2343,
29918,
333,
353,
2343,
29889,
333,
13,
13,
4706,
316,
567,
353,
5159,
13,
4706,
363,
281,
297,
1583,
29889,
9303,
7295,
13,
9651,
565,
451,
3160,
29918,
7496,
653,
29901,
13,
18884,
281,
311,
567,
353,
17288,
29893,
29889,
2813,
29892,
281,
29889,
311,
1457,
29880,
4638,
13,
9651,
1683,
29901,
13,
18884,
281,
311,
567,
353,
281,
29889,
311,
567,
29898,
2856,
29918,
16072,
29922,
5574,
29897,
13,
9651,
363,
2343,
29892,
1401,
2674,
297,
281,
311,
567,
29901,
13,
18884,
565,
2343,
1275,
2343,
29918,
333,
29901,
13,
462,
1678,
316,
567,
29889,
4397,
3552,
29893,
29889,
333,
29892,
1401,
2674,
876,
13,
4706,
736,
316,
567,
13,
13,
1678,
822,
3566,
29918,
2696,
7224,
29898,
1311,
29892,
2967,
29918,
10289,
29922,
8516,
29892,
671,
29918,
517,
12360,
29922,
8824,
1125,
13,
4706,
9995,
7900,
647,
1283,
7224,
304,
10541,
3161,
1213,
15945,
13,
4706,
565,
2967,
29918,
10289,
338,
451,
6213,
29901,
13,
9651,
1583,
29889,
3188,
29918,
10289,
353,
2967,
29918,
10289,
13,
4706,
9210,
353,
1583,
29889,
3188,
29918,
10289,
13,
4706,
565,
671,
29918,
517,
12360,
29901,
13,
9651,
12020,
2216,
1888,
2037,
287,
2392,
877,
9910,
29899,
1742,
5993,
1426,
451,
6969,
29889,
1495,
13,
4706,
1683,
29901,
13,
9651,
396,
399,
4339,
526,
13055,
491,
263,
2323,
2931,
322,
2473,
29899,
1742,
13,
9651,
396,
18897,
2615,
472,
278,
1369,
310,
278,
2602,
310,
1009,
13,
9651,
396,
2847,
3838,
411,
5225,
29899,
2103,
805,
550,
29889,
13,
9651,
363,
321,
297,
1583,
3032,
17664,
29901,
13,
18884,
321,
29889,
10289,
353,
9210,
13,
18884,
565,
321,
29889,
275,
29918,
1742,
7295,
13,
462,
1678,
9210,
4619,
7431,
29898,
29872,
29889,
689,
29897,
718,
29871,
29896,
13,
13,
1678,
822,
304,
29918,
1182,
271,
29918,
1689,
2696,
29898,
1311,
1125,
13,
4706,
9995,
11609,
1051,
310,
1506,
271,
380,
1743,
600,
25495,
363,
278,
10541,
1213,
15945,
13,
4706,
396,
6204,
10417,
515,
3553,
304,
1543,
29889,
13,
4706,
25495,
353,
5159,
13,
4706,
363,
1543,
297,
1583,
3032,
17664,
29901,
13,
9651,
25495,
29889,
21843,
29898,
5029,
29889,
517,
29918,
1182,
271,
29918,
1689,
2696,
29898,
1311,
29889,
5029,
29918,
1609,
29918,
333,
22130,
13,
4706,
736,
25495,
13,
13,
1678,
822,
4770,
2523,
356,
12035,
1311,
1125,
13,
4706,
1543,
29918,
2523,
356,
353,
518,
2523,
356,
29898,
29872,
29897,
363,
321,
297,
1583,
3032,
17664,
29962,
13,
4706,
736,
11297,
29876,
4286,
7122,
29898,
1311,
29889,
21032,
718,
1543,
29918,
2523,
356,
7240,
12764,
29876,
29915,
13,
13,
1990,
10854,
29898,
3318,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
10422,
29922,
8516,
1125,
13,
4706,
1583,
3032,
18616,
2063,
353,
5159,
13,
4706,
1583,
29889,
9507,
353,
10422,
13,
13,
1678,
822,
9773,
29898,
1311,
29892,
10541,
1125,
13,
4706,
9995,
18277,
10541,
304,
1842,
1213,
15945,
13,
4706,
1583,
3032,
18616,
2063,
29889,
4397,
29898,
18616,
663,
29897,
13,
13,
1678,
822,
4069,
29898,
1311,
1125,
13,
4706,
736,
1583,
3032,
18616,
2063,
1275,
5159,
13,
13,
1678,
822,
3838,
29898,
1311,
1125,
13,
4706,
9995,
11609,
263,
1051,
310,
278,
3838,
297,
278,
1842,
1213,
15945,
13,
4706,
736,
518,
29893,
363,
269,
297,
1583,
29889,
18616,
2063,
580,
363,
281,
297,
269,
29889,
9303,
580,
29962,
13,
13,
1678,
822,
25260,
29898,
1311,
1125,
13,
4706,
9995,
11609,
263,
1051,
310,
278,
25260,
297,
278,
1842,
1213,
15945,
13,
4706,
736,
1583,
3032,
18616,
2063,
13,
13,
1678,
822,
1426,
29898,
1311,
29892,
671,
29918,
517,
12360,
29922,
8824,
29892,
1543,
29918,
344,
17954,
2433,
13420,
13,
632,
10541,
29918,
344,
17954,
2433,
29905,
29876,
29374,
13,
4706,
736,
10541,
29918,
344,
17954,
29889,
7122,
29898,
29879,
29889,
726,
29898,
1509,
29918,
517,
12360,
29892,
1543,
29918,
344,
17954,
29897,
13,
462,
462,
539,
363,
269,
297,
1583,
29889,
18616,
2063,
3101,
13,
13,
1678,
822,
304,
29918,
1182,
271,
29918,
1689,
2696,
29898,
1311,
1125,
13,
4706,
9995,
11609,
1051,
310,
1506,
271,
380,
1743,
600,
25495,
363,
278,
1842,
1213,
15945,
13,
4706,
25495,
353,
5159,
13,
4706,
363,
10541,
297,
1583,
3032,
18616,
2063,
29901,
13,
9651,
25495,
29889,
21843,
29898,
18616,
663,
29889,
517,
29918,
1182,
271,
29918,
1689,
2696,
3101,
13,
4706,
736,
25495,
13,
13,
1753,
903,
1445,
29918,
978,
29898,
1445,
29918,
4561,
29892,
2322,
2433,
3225,
29374,
13,
1678,
9995,
11609,
1024,
310,
4257,
934,
470,
934,
29899,
4561,
1203,
29892,
470,
2322,
565,
451,
13,
1678,
3625,
1213,
15945,
13,
1678,
396,
960,
2183,
263,
1347,
29892,
5251,
393,
372,
29915,
29879,
278,
1024,
13,
1678,
565,
338,
8758,
29898,
1445,
29918,
4561,
29892,
2362,
342,
5393,
1125,
13,
4706,
736,
934,
29918,
4561,
13,
1678,
1018,
29901,
13,
4706,
736,
934,
29918,
4561,
29889,
978,
13,
1678,
5174,
23833,
2392,
29901,
13,
4706,
736,
2322,
13,
13,
1753,
1303,
29918,
3225,
29879,
29898,
4993,
29892,
10422,
29922,
8516,
1125,
13,
1678,
9995,
6359,
3189,
29940,
2208,
29899,
29965,
3402,
29892,
7709,
292,
10854,
3618,
1213,
15945,
13,
13,
1678,
565,
10422,
338,
6213,
29901,
13,
4706,
10422,
353,
903,
1445,
29918,
978,
29898,
4993,
29897,
13,
1678,
1857,
353,
10854,
29898,
9507,
29897,
13,
1678,
363,
10541,
297,
1303,
29918,
535,
645,
29884,
29898,
4993,
29892,
10422,
1125,
13,
4706,
396,
14402,
29901,
18720,
322,
3390,
1842,
24371,
297,
2752,
848,
29889,
13,
4706,
1857,
29889,
4397,
29898,
18616,
663,
29897,
13,
1678,
7709,
1857,
13,
13,
1753,
1303,
29918,
535,
645,
29884,
29898,
4993,
29892,
10422,
29922,
8516,
1125,
13,
1678,
9995,
6359,
3189,
29940,
2208,
29899,
29965,
3402,
29892,
7709,
292,
28048,
663,
3618,
29889,
13,
13,
1678,
3940,
29901,
28907,
5314,
29892,
425,
4684,
8845,
1213,
15945,
13,
13,
1678,
396,
960,
2183,
263,
1347,
29892,
5251,
372,
29915,
29879,
263,
934,
1024,
29892,
1722,
322,
1162,
332,
344,
29889,
13,
1678,
565,
338,
8758,
29898,
4993,
29892,
2362,
342,
5393,
1125,
13,
4706,
411,
775,
2395,
29889,
3150,
29898,
4993,
29892,
8025,
2433,
9420,
29899,
29947,
1495,
408,
474,
29901,
13,
9651,
363,
269,
297,
1303,
29918,
535,
645,
29884,
29898,
29875,
29892,
10422,
29922,
4993,
1125,
13,
18884,
7709,
269,
13,
4706,
736,
13,
13,
1678,
565,
10422,
338,
6213,
29901,
13,
4706,
10422,
353,
903,
1445,
29918,
978,
29898,
4993,
29897,
13,
13,
1678,
2665,
29918,
1949,
29892,
9210,
353,
29871,
29896,
29892,
29871,
29900,
13,
1678,
1857,
353,
28048,
663,
29898,
18616,
29918,
1949,
29892,
10422,
29892,
9210,
29897,
13,
1678,
363,
301,
29876,
29892,
1196,
297,
26985,
29898,
4993,
1125,
13,
4706,
1196,
353,
1196,
29889,
29878,
17010,
28909,
29876,
1495,
13,
4706,
565,
451,
1196,
29901,
13,
9651,
565,
451,
1857,
29889,
6310,
7295,
13,
18884,
396,
22680,
2323,
2931,
10541,
28128,
29889,
13,
18884,
9210,
4619,
1857,
29889,
2848,
580,
718,
29871,
29896,
13,
18884,
7709,
1857,
13,
9651,
1683,
29901,
13,
18884,
12020,
19191,
2392,
877,
6310,
10541,
742,
1196,
29892,
301,
29876,
29974,
29896,
29897,
13,
9651,
2665,
29918,
1949,
4619,
29871,
29896,
13,
9651,
1857,
353,
28048,
663,
29898,
18616,
29918,
1949,
29892,
10422,
29892,
9210,
29897,
13,
4706,
25342,
1196,
29961,
29900,
29962,
1275,
16321,
2396,
13,
9651,
1857,
29889,
21032,
29889,
4397,
29898,
1220,
29897,
13,
4706,
1683,
29901,
13,
9651,
1018,
29901,
13,
18884,
1857,
29889,
4397,
29898,
2642,
29889,
3166,
29918,
1807,
29898,
1220,
876,
13,
9651,
5174,
19191,
2392,
29892,
321,
29901,
13,
18884,
321,
29889,
1915,
18605,
353,
301,
29876,
29974,
29896,
13,
18884,
12020,
321,
13,
1678,
4974,
1857,
29889,
6310,
3285,
525,
27259,
6624,
1218,
24358,
29915,
13,
2
] |
src/riotwatcher/__version__.py | mikeread-dev/Riot-Watcher | 0 | 54996 | __version__ = "3.1.2"
__author__ = "pseudonym117"
__title__ = "RiotWatcher"
| [
1,
4770,
3259,
1649,
353,
376,
29941,
29889,
29896,
29889,
29906,
29908,
13,
1649,
8921,
1649,
353,
376,
27358,
566,
4735,
29896,
29896,
29955,
29908,
13,
1649,
3257,
1649,
353,
376,
29934,
24414,
24709,
261,
29908,
13,
2
] |
practices/practice_2.2/src/database/manage/__init__.py | JoelHernandez343/networking-administration | 0 | 1616295 | from database import models
from database.database import engine
from database.manage import interface
from database.manage import vlan
def drop_db():
models.Base.metadata.drop_all(bind=engine)
def create_db():
models.Base.metadata.create_all(bind=engine)
def recreate_db():
drop_db()
create_db()
| [
1,
515,
2566,
1053,
4733,
13,
3166,
2566,
29889,
9803,
1053,
6012,
13,
13,
3166,
2566,
29889,
1171,
482,
1053,
5067,
13,
3166,
2566,
29889,
1171,
482,
1053,
325,
6468,
13,
13,
13,
1753,
5768,
29918,
2585,
7295,
13,
1678,
4733,
29889,
5160,
29889,
19635,
29889,
8865,
29918,
497,
29898,
5355,
29922,
10599,
29897,
13,
13,
13,
1753,
1653,
29918,
2585,
7295,
13,
1678,
4733,
29889,
5160,
29889,
19635,
29889,
3258,
29918,
497,
29898,
5355,
29922,
10599,
29897,
13,
13,
13,
1753,
337,
3258,
29918,
2585,
7295,
13,
1678,
5768,
29918,
2585,
580,
13,
1678,
1653,
29918,
2585,
580,
13,
2
] |
plugins/modules/channel_policy.py | m-g-k/ansible-collection | 1 | 64331 | #!/usr/bin/python
#
# SPDX-License-Identifier: Apache-2.0
#
from __future__ import absolute_import, division, print_function
__metaclass__ = type
from ..module_utils.dict_utils import equal_dicts, merge_dicts, copy_dict
from ..module_utils.module import BlockchainModule
from ..module_utils.proto_utils import proto_to_json, json_to_proto
from ansible.module_utils._text import to_native
import json
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: channel_policy
short_description: Manage a policy for a Hyperledger Fabric channel
description:
- Add, update, and remove policies for a Hyperledger Fabric channel by using the IBM Blockchain Platform.
- This module works with the IBM Blockchain Platform managed service running in IBM Cloud, or the IBM Blockchain
Platform software running in a Red Hat OpenShift or Kubernetes cluster.
author: <NAME> (@sstone1)
options:
state:
description:
- C(absent) - An policy matching the specified name will be removed from the channel.
- C(present) - Asserts that an policy matching the specified name and configuration exists
in the channel. If no policy matches the specified name, the policy will be added
to the channel. If an policy matches the specified name but the configuration does not
match, then the policy in the channel will be updated.
type: str
default: present
choices:
- absent
- present
path:
description:
- Path to current the channel configuration file.
- This file can be fetched by using the M(channel_config) module.
- This file will be updated in place. You will need to keep a copy of the original file for computing the configuration
update.
type: str
required: true
name:
description:
- The name of the policy to add, update, or remove from the channel.
type: str
required: true
policy:
description:
- The policy to add, update, or remove from the channel.
- You can pass a string, which is a path to a JSON file containing a policy
in the Hyperledger Fabric format (common.Policy).
- You can also pass a dict, which must correspond to a parsed policy in the
Hyperledger Fabric format (common.Policy).
- Only required when I(state) is C(present).
type: raw
required: true
notes: []
requirements: []
'''
EXAMPLES = '''
- name: Add the policy to the channel
ibm.blockchain_platform.channel_policy:
state: present
api_endpoint: https://ibp-console.example.org:32000
api_authtype: basic
api_key: xxxxxxxx
api_secret: <KEY>
name: Admins
policy: admins-policy.json
path: channel_config.bin
- name: Remove the policy to the channel
ibm.blockchain_platform.channel_policy:
state: absent
api_endpoint: https://ibp-console.example.org:32000
api_authtype: basic
api_key: xxxxxxxx
api_secret: <KEY>
name: Admins
path: channel_config.bin
'''
RETURN = '''
---
{}
'''
def main():
# Create the module.
argument_spec = dict(
state=dict(type='str', default='present', choices=['present', 'absent']),
path=dict(type='str', required=True),
name=dict(type='str', required=True),
policy=dict(type='raw', required=True)
)
required_if = [
]
module = BlockchainModule(argument_spec=argument_spec, supports_check_mode=True, required_if=required_if)
# Ensure all exceptions are caught.
try:
# Get the target path, policy name and policy.
path = module.params['path']
name = module.params['name']
policy = module.params['policy']
if isinstance(policy, str):
with open(policy, 'r') as file:
policy = json.load(file)
elif isinstance(policy, dict):
pass
else:
raise Exception(f'The policy {name} is invalid')
# Read the config.
with open(path, 'rb') as file:
config_json = proto_to_json('common.Config', file.read())
# Check to see if the channel member exists.
application_policies = config_json['channel_group']['groups']['Application']['policies']
policy_wrapper = application_policies.get(name, None)
# Handle the desired state appropriately.
state = module.params['state']
if state == 'present' and policy_wrapper is None:
# Add the channel policy.
application_policies[name] = dict(
mod_policy='Admins',
policy=policy
)
elif state == 'present' and policy_wrapper is not None:
# Update the channel policy.
updated_policy_wrapper = copy_dict(policy_wrapper)
merge_dicts(updated_policy_wrapper['policy'], policy)
if equal_dicts(policy_wrapper, updated_policy_wrapper):
return module.exit_json(changed=False)
application_policies[name] = updated_policy_wrapper
elif state == 'absent' and policy_wrapper is None:
# Nothing to do.
return module.exit_json(changed=False)
elif state == 'absent' and policy_wrapper is not None:
# Delete the channel member.
del application_policies[name]
# Save the config.
config_proto = json_to_proto('common.Config', config_json)
with open(path, 'wb') as file:
file.write(config_proto)
module.exit_json(changed=True)
# Notify Ansible of the exception.
except Exception as e:
module.fail_json(msg=to_native(e))
if __name__ == '__main__':
main()
| [
1,
18787,
4855,
29914,
2109,
29914,
4691,
13,
29937,
13,
29937,
10937,
29928,
29990,
29899,
29931,
293,
1947,
29899,
12889,
29901,
13380,
29899,
29906,
29889,
29900,
13,
29937,
13,
13,
3166,
4770,
29888,
9130,
1649,
1053,
8380,
29918,
5215,
29892,
8542,
29892,
1596,
29918,
2220,
13,
1649,
2527,
562,
605,
1649,
353,
1134,
13,
13,
3166,
6317,
5453,
29918,
13239,
29889,
8977,
29918,
13239,
1053,
5186,
29918,
8977,
29879,
29892,
10366,
29918,
8977,
29879,
29892,
3509,
29918,
8977,
13,
3166,
6317,
5453,
29918,
13239,
29889,
5453,
1053,
15658,
14153,
7355,
13,
3166,
6317,
5453,
29918,
13239,
29889,
17529,
29918,
13239,
1053,
17814,
29918,
517,
29918,
3126,
29892,
4390,
29918,
517,
29918,
17529,
13,
13,
3166,
385,
1687,
29889,
5453,
29918,
13239,
3032,
726,
1053,
304,
29918,
11487,
13,
13,
5215,
4390,
13,
13,
2190,
5425,
29933,
1307,
29918,
2303,
29911,
3035,
8254,
353,
11117,
19635,
29918,
3259,
2396,
525,
29896,
29889,
29896,
742,
13,
462,
1678,
525,
4882,
2396,
6024,
25347,
7464,
13,
462,
1678,
525,
23765,
29918,
1609,
2396,
525,
23834,
10827,
13,
13,
28665,
5005,
3919,
8098,
353,
14550,
13,
5634,
13,
5453,
29901,
8242,
29918,
22197,
13,
12759,
29918,
8216,
29901,
2315,
482,
263,
8898,
363,
263,
26078,
839,
914,
10629,
2200,
8242,
13,
8216,
29901,
13,
1678,
448,
3462,
29892,
2767,
29892,
322,
3349,
24833,
363,
263,
26078,
839,
914,
10629,
2200,
8242,
491,
773,
278,
27955,
15658,
14153,
28096,
29889,
13,
1678,
448,
910,
3883,
1736,
411,
278,
27955,
15658,
14153,
28096,
8745,
2669,
2734,
297,
27955,
14293,
29892,
470,
278,
27955,
15658,
14153,
13,
418,
28096,
7047,
2734,
297,
263,
4367,
25966,
4673,
29657,
470,
476,
17547,
9867,
29889,
13,
8921,
29901,
529,
5813,
29958,
20164,
29879,
12734,
29896,
29897,
13,
6768,
29901,
13,
1678,
2106,
29901,
13,
4706,
6139,
29901,
13,
9651,
448,
315,
29898,
6897,
296,
29897,
448,
530,
8898,
9686,
278,
6790,
1024,
674,
367,
6206,
515,
278,
8242,
29889,
13,
9651,
448,
315,
29898,
6338,
29897,
448,
1094,
643,
1372,
393,
385,
8898,
9686,
278,
6790,
1024,
322,
5285,
4864,
13,
795,
297,
278,
8242,
29889,
960,
694,
8898,
7087,
278,
6790,
1024,
29892,
278,
8898,
674,
367,
2715,
13,
795,
304,
278,
8242,
29889,
960,
385,
8898,
7087,
278,
6790,
1024,
541,
278,
5285,
947,
451,
13,
795,
1993,
29892,
769,
278,
8898,
297,
278,
8242,
674,
367,
4784,
29889,
13,
4706,
1134,
29901,
851,
13,
4706,
2322,
29901,
2198,
13,
4706,
19995,
29901,
13,
9651,
448,
29207,
13,
9651,
448,
2198,
13,
1678,
2224,
29901,
13,
4706,
6139,
29901,
13,
9651,
448,
10802,
304,
1857,
278,
8242,
5285,
934,
29889,
13,
9651,
448,
910,
934,
508,
367,
6699,
287,
491,
773,
278,
341,
29898,
12719,
29918,
2917,
29897,
3883,
29889,
13,
9651,
448,
910,
934,
674,
367,
4784,
297,
2058,
29889,
887,
674,
817,
304,
3013,
263,
3509,
310,
278,
2441,
934,
363,
20602,
278,
5285,
13,
795,
2767,
29889,
13,
4706,
1134,
29901,
851,
13,
4706,
3734,
29901,
1565,
13,
1678,
1024,
29901,
13,
4706,
6139,
29901,
13,
9651,
448,
450,
1024,
310,
278,
8898,
304,
788,
29892,
2767,
29892,
470,
3349,
515,
278,
8242,
29889,
13,
4706,
1134,
29901,
851,
13,
4706,
3734,
29901,
1565,
13,
1678,
8898,
29901,
13,
4706,
6139,
29901,
13,
9651,
448,
450,
8898,
304,
788,
29892,
2767,
29892,
470,
3349,
515,
278,
8242,
29889,
13,
9651,
448,
887,
508,
1209,
263,
1347,
29892,
607,
338,
263,
2224,
304,
263,
4663,
934,
6943,
263,
8898,
13,
795,
297,
278,
26078,
839,
914,
10629,
2200,
3402,
313,
9435,
29889,
15644,
467,
13,
9651,
448,
887,
508,
884,
1209,
263,
9657,
29892,
607,
1818,
3928,
304,
263,
21213,
8898,
297,
278,
13,
795,
26078,
839,
914,
10629,
2200,
3402,
313,
9435,
29889,
15644,
467,
13,
9651,
448,
9333,
3734,
746,
306,
29898,
3859,
29897,
338,
315,
29898,
6338,
467,
13,
4706,
1134,
29901,
10650,
13,
4706,
3734,
29901,
1565,
13,
16953,
29901,
5159,
13,
12277,
1860,
29901,
5159,
13,
12008,
13,
13,
5746,
19297,
17101,
353,
14550,
13,
29899,
1024,
29901,
3462,
278,
8898,
304,
278,
8242,
13,
29871,
474,
5838,
29889,
1271,
14153,
29918,
12120,
29889,
12719,
29918,
22197,
29901,
13,
1678,
2106,
29901,
2198,
13,
1678,
7882,
29918,
29734,
29901,
2045,
597,
747,
29886,
29899,
11058,
29889,
4773,
29889,
990,
29901,
29941,
29906,
29900,
29900,
29900,
13,
1678,
7882,
29918,
1300,
400,
668,
29901,
6996,
13,
1678,
7882,
29918,
1989,
29901,
921,
14633,
12353,
13,
1678,
7882,
29918,
19024,
29901,
529,
10818,
29958,
13,
1678,
1024,
29901,
2087,
29885,
1144,
13,
1678,
8898,
29901,
7336,
1144,
29899,
22197,
29889,
3126,
13,
1678,
2224,
29901,
8242,
29918,
2917,
29889,
2109,
13,
13,
29899,
1024,
29901,
15154,
278,
8898,
304,
278,
8242,
13,
29871,
474,
5838,
29889,
1271,
14153,
29918,
12120,
29889,
12719,
29918,
22197,
29901,
13,
1678,
2106,
29901,
29207,
13,
1678,
7882,
29918,
29734,
29901,
2045,
597,
747,
29886,
29899,
11058,
29889,
4773,
29889,
990,
29901,
29941,
29906,
29900,
29900,
29900,
13,
1678,
7882,
29918,
1300,
400,
668,
29901,
6996,
13,
1678,
7882,
29918,
1989,
29901,
921,
14633,
12353,
13,
1678,
7882,
29918,
19024,
29901,
529,
10818,
29958,
13,
1678,
1024,
29901,
2087,
29885,
1144,
13,
1678,
2224,
29901,
8242,
29918,
2917,
29889,
2109,
13,
12008,
13,
13,
1525,
29911,
24015,
353,
14550,
13,
5634,
13,
8875,
13,
12008,
13,
13,
13,
1753,
1667,
7295,
13,
13,
1678,
396,
6204,
278,
3883,
29889,
13,
1678,
2980,
29918,
6550,
353,
9657,
29898,
13,
4706,
2106,
29922,
8977,
29898,
1853,
2433,
710,
742,
2322,
2433,
6338,
742,
19995,
29922,
1839,
6338,
742,
525,
6897,
296,
2033,
511,
13,
4706,
2224,
29922,
8977,
29898,
1853,
2433,
710,
742,
3734,
29922,
5574,
511,
13,
4706,
1024,
29922,
8977,
29898,
1853,
2433,
710,
742,
3734,
29922,
5574,
511,
13,
4706,
8898,
29922,
8977,
29898,
1853,
2433,
1610,
742,
3734,
29922,
5574,
29897,
13,
1678,
1723,
13,
1678,
3734,
29918,
361,
353,
518,
13,
1678,
4514,
13,
1678,
3883,
353,
15658,
14153,
7355,
29898,
23516,
29918,
6550,
29922,
23516,
29918,
6550,
29892,
11286,
29918,
3198,
29918,
8513,
29922,
5574,
29892,
3734,
29918,
361,
29922,
12403,
29918,
361,
29897,
13,
13,
1678,
396,
22521,
545,
599,
15283,
526,
12624,
29889,
13,
1678,
1018,
29901,
13,
13,
4706,
396,
3617,
278,
3646,
2224,
29892,
8898,
1024,
322,
8898,
29889,
13,
4706,
2224,
353,
3883,
29889,
7529,
1839,
2084,
2033,
13,
4706,
1024,
353,
3883,
29889,
7529,
1839,
978,
2033,
13,
4706,
8898,
353,
3883,
29889,
7529,
1839,
22197,
2033,
13,
4706,
565,
338,
8758,
29898,
22197,
29892,
851,
1125,
13,
9651,
411,
1722,
29898,
22197,
29892,
525,
29878,
1495,
408,
934,
29901,
13,
18884,
8898,
353,
4390,
29889,
1359,
29898,
1445,
29897,
13,
4706,
25342,
338,
8758,
29898,
22197,
29892,
9657,
1125,
13,
9651,
1209,
13,
4706,
1683,
29901,
13,
9651,
12020,
8960,
29898,
29888,
29915,
1576,
8898,
426,
978,
29913,
338,
8340,
1495,
13,
13,
4706,
396,
7523,
278,
2295,
29889,
13,
4706,
411,
1722,
29898,
2084,
29892,
525,
6050,
1495,
408,
934,
29901,
13,
9651,
2295,
29918,
3126,
353,
17814,
29918,
517,
29918,
3126,
877,
9435,
29889,
3991,
742,
934,
29889,
949,
3101,
13,
13,
4706,
396,
5399,
304,
1074,
565,
278,
8242,
4509,
4864,
29889,
13,
4706,
2280,
29918,
3733,
293,
583,
353,
2295,
29918,
3126,
1839,
12719,
29918,
2972,
16215,
13155,
16215,
4873,
16215,
3733,
293,
583,
2033,
13,
4706,
8898,
29918,
17699,
353,
2280,
29918,
3733,
293,
583,
29889,
657,
29898,
978,
29892,
6213,
29897,
13,
13,
4706,
396,
29273,
278,
7429,
2106,
7128,
2486,
29889,
13,
4706,
2106,
353,
3883,
29889,
7529,
1839,
3859,
2033,
13,
4706,
565,
2106,
1275,
525,
6338,
29915,
322,
8898,
29918,
17699,
338,
6213,
29901,
13,
13,
9651,
396,
3462,
278,
8242,
8898,
29889,
13,
9651,
2280,
29918,
3733,
293,
583,
29961,
978,
29962,
353,
9657,
29898,
13,
18884,
878,
29918,
22197,
2433,
3253,
29885,
1144,
742,
13,
18884,
8898,
29922,
22197,
13,
9651,
1723,
13,
13,
4706,
25342,
2106,
1275,
525,
6338,
29915,
322,
8898,
29918,
17699,
338,
451,
6213,
29901,
13,
13,
9651,
396,
10318,
278,
8242,
8898,
29889,
13,
9651,
4784,
29918,
22197,
29918,
17699,
353,
3509,
29918,
8977,
29898,
22197,
29918,
17699,
29897,
13,
9651,
10366,
29918,
8977,
29879,
29898,
21402,
29918,
22197,
29918,
17699,
1839,
22197,
7464,
8898,
29897,
13,
9651,
565,
5186,
29918,
8977,
29879,
29898,
22197,
29918,
17699,
29892,
4784,
29918,
22197,
29918,
17699,
1125,
13,
18884,
736,
3883,
29889,
13322,
29918,
3126,
29898,
15033,
29922,
8824,
29897,
13,
9651,
2280,
29918,
3733,
293,
583,
29961,
978,
29962,
353,
4784,
29918,
22197,
29918,
17699,
13,
13,
4706,
25342,
2106,
1275,
525,
6897,
296,
29915,
322,
8898,
29918,
17699,
338,
6213,
29901,
13,
13,
9651,
396,
9531,
304,
437,
29889,
13,
9651,
736,
3883,
29889,
13322,
29918,
3126,
29898,
15033,
29922,
8824,
29897,
13,
13,
4706,
25342,
2106,
1275,
525,
6897,
296,
29915,
322,
8898,
29918,
17699,
338,
451,
6213,
29901,
13,
13,
9651,
396,
21267,
278,
8242,
4509,
29889,
13,
9651,
628,
2280,
29918,
3733,
293,
583,
29961,
978,
29962,
13,
13,
4706,
396,
16913,
278,
2295,
29889,
13,
4706,
2295,
29918,
17529,
353,
4390,
29918,
517,
29918,
17529,
877,
9435,
29889,
3991,
742,
2295,
29918,
3126,
29897,
13,
4706,
411,
1722,
29898,
2084,
29892,
525,
29893,
29890,
1495,
408,
934,
29901,
13,
9651,
934,
29889,
3539,
29898,
2917,
29918,
17529,
29897,
13,
4706,
3883,
29889,
13322,
29918,
3126,
29898,
15033,
29922,
5574,
29897,
13,
13,
1678,
396,
2216,
1598,
530,
1687,
310,
278,
3682,
29889,
13,
1678,
5174,
8960,
408,
321,
29901,
13,
4706,
3883,
29889,
14057,
29918,
3126,
29898,
7645,
29922,
517,
29918,
11487,
29898,
29872,
876,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
1667,
580,
13,
2
] |
Diena_1_4_thonny/d2_u2_d11.py | edzya/Python_RTU_08_20 | 8 | 34881 | <filename>Diena_1_4_thonny/d2_u2_d11.py
try:
width=float(input("Ieraksti savas istabas platumu (metros): "))
height=float(input("Ieraksti savas istabas augstumu (metros): "))
length=float(input("Ieraksti savas istabas garumu (metros): "))
capacity=round(width*height*length, 2)
print(f"Tavas istabas tilpums ir {capacity} m\u00b3.")
except ValueError:
print("Ievadiet vērtību ciparos! Komata vietā jālieto punkts.")
print("*"*30) | [
1,
529,
9507,
29958,
29928,
819,
29874,
29918,
29896,
29918,
29946,
29918,
386,
265,
1460,
29914,
29881,
29906,
29918,
29884,
29906,
29918,
29881,
29896,
29896,
29889,
2272,
13,
2202,
29901,
13,
1678,
2920,
29922,
7411,
29898,
2080,
703,
29902,
261,
557,
303,
29875,
269,
2449,
1752,
370,
294,
18870,
398,
29884,
313,
28204,
1125,
376,
876,
13,
1678,
3171,
29922,
7411,
29898,
2080,
703,
29902,
261,
557,
303,
29875,
269,
2449,
1752,
370,
294,
11307,
303,
398,
29884,
313,
28204,
1125,
376,
876,
13,
1678,
3309,
29922,
7411,
29898,
2080,
703,
29902,
261,
557,
303,
29875,
269,
2449,
1752,
370,
294,
7171,
398,
29884,
313,
28204,
1125,
376,
876,
13,
1678,
13284,
29922,
14486,
29898,
2103,
29930,
3545,
29930,
2848,
29892,
29871,
29906,
29897,
13,
1678,
1596,
29898,
29888,
29908,
29911,
2449,
1752,
370,
294,
6928,
29886,
6762,
3805,
426,
5030,
5946,
29913,
286,
29905,
29884,
29900,
29900,
29890,
29941,
23157,
13,
19499,
7865,
2392,
29901,
13,
1678,
1596,
703,
29902,
5750,
328,
2035,
325,
30230,
2273,
30150,
2423,
274,
666,
279,
359,
29991,
7107,
532,
325,
2035,
30107,
432,
30107,
492,
10896,
6035,
1193,
29879,
23157,
13,
2158,
703,
20605,
29930,
29941,
29900,
29897,
2
] |
my_app/templates/model.py | varshaholsambre/Whats-For-Dinner | 0 | 113164 | from my_app import db
class Fact(db.Model):
id = db.Column(db.Integer, primary_keys = True)
name = db.Column(db.String(100))
value = db.Column(db.String(100)) | [
1,
515,
590,
29918,
932,
1053,
4833,
30004,
13,
30004,
13,
1990,
26748,
29898,
2585,
29889,
3195,
1125,
30004,
13,
12,
333,
353,
4833,
29889,
4409,
29898,
2585,
29889,
7798,
29892,
7601,
29918,
8149,
353,
5852,
8443,
13,
12,
978,
353,
4833,
29889,
4409,
29898,
2585,
29889,
1231,
29898,
29896,
29900,
29900,
876,
30004,
13,
12,
1767,
353,
4833,
29889,
4409,
29898,
2585,
29889,
1231,
29898,
29896,
29900,
29900,
876,
2
] |
test/propagation_warn_only_test.py | lechat/jenkinsflow | 0 | 21075 | # Copyright (c) 2012 - 2015 <NAME>, Hupfeldt IT
# All rights reserved. This work is under a BSD license, see LICENSE.TXT.
from pytest import raises
from jenkinsflow.flow import serial, parallel, FailedChildJobException, FailedChildJobsException, Propagation, BuildResult
from .framework import api_select
from .framework.utils import pre_existing_fake_cli
def test_propagation_warn_only_serial(api_type, fake_java):
with api_select.api(__file__, api_type, login=True) as api:
pre_existing_fake_cli(api_type)
api.flow_job()
api.job('j11', exec_time=0.01, max_fails=0, expect_invocations=1, expect_order=1)
api.job('j12_fail', exec_time=0.01, max_fails=1, expect_invocations=1, expect_order=2, serial=True)
api.job('j13', exec_time=0.01, max_fails=0, expect_invocations=0, expect_order=None)
with serial(api, timeout=70, job_name_prefix=api.job_name_prefix, report_interval=3, propagation=Propagation.FAILURE_TO_UNSTABLE) as ctrl1:
ctrl1.invoke('j11')
ctrl1.invoke('j12_fail')
ctrl1.invoke('j13')
assert ctrl1.result == BuildResult.UNSTABLE
# Note: the fact that no error was raised also implies that the failure didn't propagate as failure
def test_propagation_warn_only_parallel(api_type, fake_java):
with api_select.api(__file__, api_type, login=True) as api:
pre_existing_fake_cli(api_type)
api.flow_job()
api.job('j1_fail', exec_time=0.01, max_fails=1, expect_invocations=1, expect_order=1)
api.job('j2', exec_time=0.01, max_fails=0, expect_invocations=1, expect_order=1)
with parallel(api, timeout=70, job_name_prefix=api.job_name_prefix, report_interval=3, propagation=Propagation.FAILURE_TO_UNSTABLE) as ctrl1:
ctrl1.invoke('j1_fail')
ctrl1.invoke('j2')
def test_propagation_warn_only_nested_serial_parallel(api_type, fake_java):
with api_select.api(__file__, api_type, login=True) as api:
pre_existing_fake_cli(api_type)
api.flow_job()
api.job('j11', exec_time=0.01, max_fails=0, expect_invocations=1, expect_order=1)
api.job('j21', exec_time=0.01, max_fails=0, expect_invocations=1, expect_order=2, serial=True)
api.job('j22_fail', exec_time=0.01, max_fails=1, expect_invocations=1, expect_order=2)
api.job('j23', exec_time=0.01, max_fails=0, expect_invocations=1, expect_order=2)
with serial(api, timeout=70, job_name_prefix=api.job_name_prefix, report_interval=3) as ctrl1:
ctrl1.invoke('j11')
with ctrl1.parallel(propagation=Propagation.FAILURE_TO_UNSTABLE) as ctrl2:
ctrl2.invoke('j21')
ctrl2.invoke('j22_fail')
ctrl2.invoke('j23')
def test_propagation_warn_only_nested_parallel_serial(api_type, fake_java):
with api_select.api(__file__, api_type, login=True) as api:
pre_existing_fake_cli(api_type)
api.flow_job()
api.job('j11', exec_time=0.01, max_fails=0, expect_invocations=1, expect_order=1)
api.job('j21', exec_time=0.01, max_fails=0, expect_invocations=1, expect_order=1)
api.job('j22_fail', exec_time=0.01, max_fails=1, expect_invocations=1, expect_order=1, serial=True)
api.job('j23', exec_time=0.01, max_fails=0, expect_invocations=0, expect_order=None)
with parallel(api, timeout=70, job_name_prefix=api.job_name_prefix, report_interval=3) as ctrl1:
ctrl1.invoke('j11')
with ctrl1.serial(propagation=Propagation.FAILURE_TO_UNSTABLE) as ctrl2:
ctrl2.invoke('j21')
ctrl2.invoke('j22_fail')
ctrl2.invoke('j23')
def test_propagation_warn_only_nested_serial_serial(api_type, fake_java):
with api_select.api(__file__, api_type, login=True) as api:
pre_existing_fake_cli(api_type)
api.flow_job()
api.job('j11', exec_time=0.01, max_fails=0, expect_invocations=1, expect_order=1)
api.job('j21', exec_time=0.01, max_fails=0, expect_invocations=1, expect_order=2)
api.job('j22_fail', exec_time=0.01, max_fails=1, expect_invocations=1, expect_order=2)
api.job('j23', exec_time=0.01, max_fails=0, expect_invocations=0, expect_order=None)
with serial(api, timeout=70, job_name_prefix=api.job_name_prefix, report_interval=3) as ctrl1:
ctrl1.invoke('j11')
with ctrl1.serial(propagation=Propagation.FAILURE_TO_UNSTABLE) as ctrl2:
ctrl2.invoke('j21')
ctrl2.invoke('j22_fail')
ctrl2.invoke('j23')
def test_propagation_warn_only_nested_parallel_parallel(api_type, fake_java):
with api_select.api(__file__, api_type, login=True) as api:
pre_existing_fake_cli(api_type)
api.flow_job()
api.job('j11', exec_time=0.01, max_fails=0, expect_invocations=1, expect_order=1)
api.job('j21', exec_time=0.01, max_fails=0, expect_invocations=1, expect_order=1)
api.job('j22_fail', exec_time=0.01, max_fails=1, expect_invocations=1, expect_order=1)
api.job('j23', exec_time=0.01, max_fails=0, expect_invocations=1, expect_order=1)
with parallel(api, timeout=70, job_name_prefix=api.job_name_prefix, report_interval=3) as ctrl1:
ctrl1.invoke('j11')
with ctrl1.parallel(propagation=Propagation.FAILURE_TO_UNSTABLE) as ctrl2:
ctrl2.invoke('j21')
ctrl2.invoke('j22_fail')
ctrl2.invoke('j23')
def test_propagation_warn_only_nested_serial_serial_continue(api_type, fake_java):
with api_select.api(__file__, api_type, login=True) as api:
pre_existing_fake_cli(api_type)
api.flow_job()
api.job('j11', exec_time=0.01, max_fails=0, expect_invocations=1, expect_order=1)
api.job('j21', exec_time=0.01, max_fails=0, expect_invocations=1, expect_order=2)
api.job('j22_fail', exec_time=0.01, max_fails=1, expect_invocations=1, expect_order=3)
api.job('j23', exec_time=0.01, max_fails=0, expect_invocations=1, expect_order=4)
with serial(api, timeout=70, job_name_prefix=api.job_name_prefix, report_interval=3) as ctrl1:
ctrl1.invoke('j11')
with ctrl1.serial() as ctrl2:
ctrl2.invoke('j21')
with ctrl2.serial(propagation=Propagation.FAILURE_TO_UNSTABLE) as ctrl3:
ctrl3.invoke('j22_fail')
ctrl2.invoke('j23')
def test_propagation_warn_only_nested_parallel_serial_continue(api_type, fake_java):
with api_select.api(__file__, api_type, login=True) as api:
pre_existing_fake_cli(api_type)
api.flow_job()
api.job('j11', exec_time=0.01, max_fails=0, expect_invocations=1, expect_order=1)
api.job('j21', exec_time=0.01, max_fails=0, expect_invocations=1, expect_order=1)
api.job('j22_fail', exec_time=0.01, max_fails=1, expect_invocations=1, expect_order=1)
api.job('j23', exec_time=0.01, max_fails=0, expect_invocations=1, expect_order=1)
with parallel(api, timeout=70, job_name_prefix=api.job_name_prefix, report_interval=3) as ctrl1:
ctrl1.invoke('j11')
with ctrl1.serial() as ctrl2:
ctrl2.invoke('j21')
with ctrl2.serial(propagation=Propagation.FAILURE_TO_UNSTABLE) as ctrl3:
ctrl3.invoke('j22_fail')
ctrl2.invoke('j23')
def test_propagation_warn_only_nested_serial_serial_continue_fail(api_type):
with api_select.api(__file__, api_type, login=True) as api:
pre_existing_fake_cli(api_type)
api.flow_job()
api.job('j11', exec_time=0.01, max_fails=0, expect_invocations=1, expect_order=1)
api.job('j21', exec_time=0.01, max_fails=0, expect_invocations=1, expect_order=2)
api.job('j22_fail', exec_time=0.01, max_fails=1, expect_invocations=1, expect_order=3)
api.job('j23_fail', exec_time=0.01, max_fails=1, expect_invocations=1, expect_order=4)
with raises(FailedChildJobException):
with serial(api, timeout=70, job_name_prefix=api.job_name_prefix, report_interval=3) as ctrl1:
ctrl1.invoke('j11')
with ctrl1.serial() as ctrl2:
ctrl2.invoke('j21')
with ctrl2.serial(propagation=Propagation.FAILURE_TO_UNSTABLE) as ctrl3:
ctrl3.invoke('j22_fail')
ctrl2.invoke('j23_fail')
def test_propagation_warn_only_nested_parallel_serial_continue_fail(api_type):
with api_select.api(__file__, api_type, login=True) as api:
pre_existing_fake_cli(api_type)
api.flow_job()
api.job('j11', exec_time=0.01, max_fails=0, expect_invocations=1, expect_order=1)
api.job('j21', exec_time=0.01, max_fails=0, expect_invocations=1, expect_order=1)
api.job('j22_fail', exec_time=0.01, max_fails=1, expect_invocations=1, expect_order=1)
api.job('j23_fail', exec_time=0.01, max_fails=1, expect_invocations=1, expect_order=1)
with raises(FailedChildJobsException):
with parallel(api, timeout=70, job_name_prefix=api.job_name_prefix, report_interval=3) as ctrl1:
ctrl1.invoke('j11')
with ctrl1.serial() as ctrl2:
ctrl2.invoke('j21')
with ctrl2.serial(propagation=Propagation.FAILURE_TO_UNSTABLE) as ctrl3:
ctrl3.invoke('j22_fail')
ctrl2.invoke('j23_fail')
| [
1,
396,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29896,
29906,
448,
29871,
29906,
29900,
29896,
29945,
529,
5813,
10202,
379,
786,
10612,
29873,
13315,
13,
29937,
2178,
10462,
21676,
29889,
910,
664,
338,
1090,
263,
350,
7230,
19405,
29892,
1074,
365,
2965,
1430,
1660,
29889,
29911,
12188,
29889,
13,
13,
3166,
11451,
1688,
1053,
1153,
4637,
13,
13,
3166,
432,
16468,
1731,
29889,
1731,
1053,
7797,
29892,
8943,
29892,
18390,
5938,
11947,
2451,
29892,
18390,
5938,
11947,
29879,
2451,
29892,
1019,
13573,
362,
29892,
8878,
3591,
13,
3166,
869,
4468,
1053,
7882,
29918,
2622,
13,
3166,
869,
4468,
29889,
13239,
1053,
758,
29918,
735,
15423,
29918,
29888,
1296,
29918,
11303,
13,
13,
13,
1753,
1243,
29918,
7728,
351,
362,
29918,
25442,
29918,
6194,
29918,
15550,
29898,
2754,
29918,
1853,
29892,
25713,
29918,
1645,
1125,
13,
1678,
411,
7882,
29918,
2622,
29889,
2754,
22168,
1445,
1649,
29892,
7882,
29918,
1853,
29892,
6464,
29922,
5574,
29897,
408,
7882,
29901,
13,
4706,
758,
29918,
735,
15423,
29918,
29888,
1296,
29918,
11303,
29898,
2754,
29918,
1853,
29897,
13,
4706,
7882,
29889,
1731,
29918,
9057,
580,
13,
4706,
7882,
29889,
9057,
877,
29926,
29896,
29896,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29900,
29892,
2149,
29918,
11569,
542,
800,
29922,
29896,
29892,
2149,
29918,
2098,
29922,
29896,
29897,
13,
4706,
7882,
29889,
9057,
877,
29926,
29896,
29906,
29918,
14057,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29896,
29892,
2149,
29918,
11569,
542,
800,
29922,
29896,
29892,
2149,
29918,
2098,
29922,
29906,
29892,
7797,
29922,
5574,
29897,
13,
4706,
7882,
29889,
9057,
877,
29926,
29896,
29941,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29900,
29892,
2149,
29918,
11569,
542,
800,
29922,
29900,
29892,
2149,
29918,
2098,
29922,
8516,
29897,
13,
13,
4706,
411,
7797,
29898,
2754,
29892,
11815,
29922,
29955,
29900,
29892,
4982,
29918,
978,
29918,
13506,
29922,
2754,
29889,
9057,
29918,
978,
29918,
13506,
29892,
3461,
29918,
19207,
29922,
29941,
29892,
13089,
362,
29922,
1184,
13573,
362,
29889,
4519,
6227,
11499,
29918,
4986,
29918,
3904,
1254,
6181,
29897,
408,
274,
11742,
29896,
29901,
13,
9651,
274,
11742,
29896,
29889,
9772,
877,
29926,
29896,
29896,
1495,
13,
9651,
274,
11742,
29896,
29889,
9772,
877,
29926,
29896,
29906,
29918,
14057,
1495,
13,
9651,
274,
11742,
29896,
29889,
9772,
877,
29926,
29896,
29941,
1495,
13,
13,
4706,
4974,
274,
11742,
29896,
29889,
2914,
1275,
8878,
3591,
29889,
3904,
1254,
6181,
13,
4706,
396,
3940,
29901,
278,
2114,
393,
694,
1059,
471,
10425,
884,
10469,
393,
278,
10672,
3282,
29915,
29873,
13089,
403,
408,
10672,
13,
13,
13,
1753,
1243,
29918,
7728,
351,
362,
29918,
25442,
29918,
6194,
29918,
23482,
29898,
2754,
29918,
1853,
29892,
25713,
29918,
1645,
1125,
13,
1678,
411,
7882,
29918,
2622,
29889,
2754,
22168,
1445,
1649,
29892,
7882,
29918,
1853,
29892,
6464,
29922,
5574,
29897,
408,
7882,
29901,
13,
4706,
758,
29918,
735,
15423,
29918,
29888,
1296,
29918,
11303,
29898,
2754,
29918,
1853,
29897,
13,
4706,
7882,
29889,
1731,
29918,
9057,
580,
13,
4706,
7882,
29889,
9057,
877,
29926,
29896,
29918,
14057,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29896,
29892,
2149,
29918,
11569,
542,
800,
29922,
29896,
29892,
2149,
29918,
2098,
29922,
29896,
29897,
13,
4706,
7882,
29889,
9057,
877,
29926,
29906,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29900,
29892,
2149,
29918,
11569,
542,
800,
29922,
29896,
29892,
2149,
29918,
2098,
29922,
29896,
29897,
13,
13,
4706,
411,
8943,
29898,
2754,
29892,
11815,
29922,
29955,
29900,
29892,
4982,
29918,
978,
29918,
13506,
29922,
2754,
29889,
9057,
29918,
978,
29918,
13506,
29892,
3461,
29918,
19207,
29922,
29941,
29892,
13089,
362,
29922,
1184,
13573,
362,
29889,
4519,
6227,
11499,
29918,
4986,
29918,
3904,
1254,
6181,
29897,
408,
274,
11742,
29896,
29901,
13,
9651,
274,
11742,
29896,
29889,
9772,
877,
29926,
29896,
29918,
14057,
1495,
13,
9651,
274,
11742,
29896,
29889,
9772,
877,
29926,
29906,
1495,
13,
13,
13,
1753,
1243,
29918,
7728,
351,
362,
29918,
25442,
29918,
6194,
29918,
27420,
29918,
15550,
29918,
23482,
29898,
2754,
29918,
1853,
29892,
25713,
29918,
1645,
1125,
13,
1678,
411,
7882,
29918,
2622,
29889,
2754,
22168,
1445,
1649,
29892,
7882,
29918,
1853,
29892,
6464,
29922,
5574,
29897,
408,
7882,
29901,
13,
4706,
758,
29918,
735,
15423,
29918,
29888,
1296,
29918,
11303,
29898,
2754,
29918,
1853,
29897,
13,
4706,
7882,
29889,
1731,
29918,
9057,
580,
13,
4706,
7882,
29889,
9057,
877,
29926,
29896,
29896,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29900,
29892,
2149,
29918,
11569,
542,
800,
29922,
29896,
29892,
2149,
29918,
2098,
29922,
29896,
29897,
13,
4706,
7882,
29889,
9057,
877,
29926,
29906,
29896,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29900,
29892,
2149,
29918,
11569,
542,
800,
29922,
29896,
29892,
2149,
29918,
2098,
29922,
29906,
29892,
7797,
29922,
5574,
29897,
13,
4706,
7882,
29889,
9057,
877,
29926,
29906,
29906,
29918,
14057,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29896,
29892,
2149,
29918,
11569,
542,
800,
29922,
29896,
29892,
2149,
29918,
2098,
29922,
29906,
29897,
13,
4706,
7882,
29889,
9057,
877,
29926,
29906,
29941,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29900,
29892,
2149,
29918,
11569,
542,
800,
29922,
29896,
29892,
2149,
29918,
2098,
29922,
29906,
29897,
13,
13,
4706,
411,
7797,
29898,
2754,
29892,
11815,
29922,
29955,
29900,
29892,
4982,
29918,
978,
29918,
13506,
29922,
2754,
29889,
9057,
29918,
978,
29918,
13506,
29892,
3461,
29918,
19207,
29922,
29941,
29897,
408,
274,
11742,
29896,
29901,
13,
9651,
274,
11742,
29896,
29889,
9772,
877,
29926,
29896,
29896,
1495,
13,
13,
9651,
411,
274,
11742,
29896,
29889,
23482,
29898,
7728,
351,
362,
29922,
1184,
13573,
362,
29889,
4519,
6227,
11499,
29918,
4986,
29918,
3904,
1254,
6181,
29897,
408,
274,
11742,
29906,
29901,
13,
18884,
274,
11742,
29906,
29889,
9772,
877,
29926,
29906,
29896,
1495,
13,
18884,
274,
11742,
29906,
29889,
9772,
877,
29926,
29906,
29906,
29918,
14057,
1495,
13,
18884,
274,
11742,
29906,
29889,
9772,
877,
29926,
29906,
29941,
1495,
13,
13,
13,
1753,
1243,
29918,
7728,
351,
362,
29918,
25442,
29918,
6194,
29918,
27420,
29918,
23482,
29918,
15550,
29898,
2754,
29918,
1853,
29892,
25713,
29918,
1645,
1125,
13,
1678,
411,
7882,
29918,
2622,
29889,
2754,
22168,
1445,
1649,
29892,
7882,
29918,
1853,
29892,
6464,
29922,
5574,
29897,
408,
7882,
29901,
13,
4706,
758,
29918,
735,
15423,
29918,
29888,
1296,
29918,
11303,
29898,
2754,
29918,
1853,
29897,
13,
4706,
7882,
29889,
1731,
29918,
9057,
580,
13,
4706,
7882,
29889,
9057,
877,
29926,
29896,
29896,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29900,
29892,
2149,
29918,
11569,
542,
800,
29922,
29896,
29892,
2149,
29918,
2098,
29922,
29896,
29897,
13,
4706,
7882,
29889,
9057,
877,
29926,
29906,
29896,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29900,
29892,
2149,
29918,
11569,
542,
800,
29922,
29896,
29892,
2149,
29918,
2098,
29922,
29896,
29897,
13,
4706,
7882,
29889,
9057,
877,
29926,
29906,
29906,
29918,
14057,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29896,
29892,
2149,
29918,
11569,
542,
800,
29922,
29896,
29892,
2149,
29918,
2098,
29922,
29896,
29892,
7797,
29922,
5574,
29897,
13,
4706,
7882,
29889,
9057,
877,
29926,
29906,
29941,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29900,
29892,
2149,
29918,
11569,
542,
800,
29922,
29900,
29892,
2149,
29918,
2098,
29922,
8516,
29897,
13,
13,
4706,
411,
8943,
29898,
2754,
29892,
11815,
29922,
29955,
29900,
29892,
4982,
29918,
978,
29918,
13506,
29922,
2754,
29889,
9057,
29918,
978,
29918,
13506,
29892,
3461,
29918,
19207,
29922,
29941,
29897,
408,
274,
11742,
29896,
29901,
13,
9651,
274,
11742,
29896,
29889,
9772,
877,
29926,
29896,
29896,
1495,
13,
13,
9651,
411,
274,
11742,
29896,
29889,
15550,
29898,
7728,
351,
362,
29922,
1184,
13573,
362,
29889,
4519,
6227,
11499,
29918,
4986,
29918,
3904,
1254,
6181,
29897,
408,
274,
11742,
29906,
29901,
13,
18884,
274,
11742,
29906,
29889,
9772,
877,
29926,
29906,
29896,
1495,
13,
18884,
274,
11742,
29906,
29889,
9772,
877,
29926,
29906,
29906,
29918,
14057,
1495,
13,
18884,
274,
11742,
29906,
29889,
9772,
877,
29926,
29906,
29941,
1495,
13,
13,
13,
1753,
1243,
29918,
7728,
351,
362,
29918,
25442,
29918,
6194,
29918,
27420,
29918,
15550,
29918,
15550,
29898,
2754,
29918,
1853,
29892,
25713,
29918,
1645,
1125,
13,
1678,
411,
7882,
29918,
2622,
29889,
2754,
22168,
1445,
1649,
29892,
7882,
29918,
1853,
29892,
6464,
29922,
5574,
29897,
408,
7882,
29901,
13,
4706,
758,
29918,
735,
15423,
29918,
29888,
1296,
29918,
11303,
29898,
2754,
29918,
1853,
29897,
13,
4706,
7882,
29889,
1731,
29918,
9057,
580,
13,
4706,
7882,
29889,
9057,
877,
29926,
29896,
29896,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29900,
29892,
2149,
29918,
11569,
542,
800,
29922,
29896,
29892,
2149,
29918,
2098,
29922,
29896,
29897,
13,
4706,
7882,
29889,
9057,
877,
29926,
29906,
29896,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29900,
29892,
2149,
29918,
11569,
542,
800,
29922,
29896,
29892,
2149,
29918,
2098,
29922,
29906,
29897,
13,
4706,
7882,
29889,
9057,
877,
29926,
29906,
29906,
29918,
14057,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29896,
29892,
2149,
29918,
11569,
542,
800,
29922,
29896,
29892,
2149,
29918,
2098,
29922,
29906,
29897,
13,
4706,
7882,
29889,
9057,
877,
29926,
29906,
29941,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29900,
29892,
2149,
29918,
11569,
542,
800,
29922,
29900,
29892,
2149,
29918,
2098,
29922,
8516,
29897,
13,
13,
4706,
411,
7797,
29898,
2754,
29892,
11815,
29922,
29955,
29900,
29892,
4982,
29918,
978,
29918,
13506,
29922,
2754,
29889,
9057,
29918,
978,
29918,
13506,
29892,
3461,
29918,
19207,
29922,
29941,
29897,
408,
274,
11742,
29896,
29901,
13,
9651,
274,
11742,
29896,
29889,
9772,
877,
29926,
29896,
29896,
1495,
13,
13,
9651,
411,
274,
11742,
29896,
29889,
15550,
29898,
7728,
351,
362,
29922,
1184,
13573,
362,
29889,
4519,
6227,
11499,
29918,
4986,
29918,
3904,
1254,
6181,
29897,
408,
274,
11742,
29906,
29901,
13,
18884,
274,
11742,
29906,
29889,
9772,
877,
29926,
29906,
29896,
1495,
13,
18884,
274,
11742,
29906,
29889,
9772,
877,
29926,
29906,
29906,
29918,
14057,
1495,
13,
18884,
274,
11742,
29906,
29889,
9772,
877,
29926,
29906,
29941,
1495,
13,
13,
13,
1753,
1243,
29918,
7728,
351,
362,
29918,
25442,
29918,
6194,
29918,
27420,
29918,
23482,
29918,
23482,
29898,
2754,
29918,
1853,
29892,
25713,
29918,
1645,
1125,
13,
1678,
411,
7882,
29918,
2622,
29889,
2754,
22168,
1445,
1649,
29892,
7882,
29918,
1853,
29892,
6464,
29922,
5574,
29897,
408,
7882,
29901,
13,
4706,
758,
29918,
735,
15423,
29918,
29888,
1296,
29918,
11303,
29898,
2754,
29918,
1853,
29897,
13,
4706,
7882,
29889,
1731,
29918,
9057,
580,
13,
4706,
7882,
29889,
9057,
877,
29926,
29896,
29896,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29900,
29892,
2149,
29918,
11569,
542,
800,
29922,
29896,
29892,
2149,
29918,
2098,
29922,
29896,
29897,
13,
4706,
7882,
29889,
9057,
877,
29926,
29906,
29896,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29900,
29892,
2149,
29918,
11569,
542,
800,
29922,
29896,
29892,
2149,
29918,
2098,
29922,
29896,
29897,
13,
4706,
7882,
29889,
9057,
877,
29926,
29906,
29906,
29918,
14057,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29896,
29892,
2149,
29918,
11569,
542,
800,
29922,
29896,
29892,
2149,
29918,
2098,
29922,
29896,
29897,
13,
4706,
7882,
29889,
9057,
877,
29926,
29906,
29941,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29900,
29892,
2149,
29918,
11569,
542,
800,
29922,
29896,
29892,
2149,
29918,
2098,
29922,
29896,
29897,
13,
13,
4706,
411,
8943,
29898,
2754,
29892,
11815,
29922,
29955,
29900,
29892,
4982,
29918,
978,
29918,
13506,
29922,
2754,
29889,
9057,
29918,
978,
29918,
13506,
29892,
3461,
29918,
19207,
29922,
29941,
29897,
408,
274,
11742,
29896,
29901,
13,
9651,
274,
11742,
29896,
29889,
9772,
877,
29926,
29896,
29896,
1495,
13,
13,
9651,
411,
274,
11742,
29896,
29889,
23482,
29898,
7728,
351,
362,
29922,
1184,
13573,
362,
29889,
4519,
6227,
11499,
29918,
4986,
29918,
3904,
1254,
6181,
29897,
408,
274,
11742,
29906,
29901,
13,
18884,
274,
11742,
29906,
29889,
9772,
877,
29926,
29906,
29896,
1495,
13,
18884,
274,
11742,
29906,
29889,
9772,
877,
29926,
29906,
29906,
29918,
14057,
1495,
13,
18884,
274,
11742,
29906,
29889,
9772,
877,
29926,
29906,
29941,
1495,
13,
13,
13,
1753,
1243,
29918,
7728,
351,
362,
29918,
25442,
29918,
6194,
29918,
27420,
29918,
15550,
29918,
15550,
29918,
19878,
29898,
2754,
29918,
1853,
29892,
25713,
29918,
1645,
1125,
13,
1678,
411,
7882,
29918,
2622,
29889,
2754,
22168,
1445,
1649,
29892,
7882,
29918,
1853,
29892,
6464,
29922,
5574,
29897,
408,
7882,
29901,
13,
4706,
758,
29918,
735,
15423,
29918,
29888,
1296,
29918,
11303,
29898,
2754,
29918,
1853,
29897,
13,
4706,
7882,
29889,
1731,
29918,
9057,
580,
13,
4706,
7882,
29889,
9057,
877,
29926,
29896,
29896,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29900,
29892,
2149,
29918,
11569,
542,
800,
29922,
29896,
29892,
2149,
29918,
2098,
29922,
29896,
29897,
13,
4706,
7882,
29889,
9057,
877,
29926,
29906,
29896,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29900,
29892,
2149,
29918,
11569,
542,
800,
29922,
29896,
29892,
2149,
29918,
2098,
29922,
29906,
29897,
13,
4706,
7882,
29889,
9057,
877,
29926,
29906,
29906,
29918,
14057,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29896,
29892,
2149,
29918,
11569,
542,
800,
29922,
29896,
29892,
2149,
29918,
2098,
29922,
29941,
29897,
13,
4706,
7882,
29889,
9057,
877,
29926,
29906,
29941,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29900,
29892,
2149,
29918,
11569,
542,
800,
29922,
29896,
29892,
2149,
29918,
2098,
29922,
29946,
29897,
13,
13,
4706,
411,
7797,
29898,
2754,
29892,
11815,
29922,
29955,
29900,
29892,
4982,
29918,
978,
29918,
13506,
29922,
2754,
29889,
9057,
29918,
978,
29918,
13506,
29892,
3461,
29918,
19207,
29922,
29941,
29897,
408,
274,
11742,
29896,
29901,
13,
9651,
274,
11742,
29896,
29889,
9772,
877,
29926,
29896,
29896,
1495,
13,
13,
9651,
411,
274,
11742,
29896,
29889,
15550,
580,
408,
274,
11742,
29906,
29901,
13,
18884,
274,
11742,
29906,
29889,
9772,
877,
29926,
29906,
29896,
1495,
13,
18884,
411,
274,
11742,
29906,
29889,
15550,
29898,
7728,
351,
362,
29922,
1184,
13573,
362,
29889,
4519,
6227,
11499,
29918,
4986,
29918,
3904,
1254,
6181,
29897,
408,
274,
11742,
29941,
29901,
13,
462,
1678,
274,
11742,
29941,
29889,
9772,
877,
29926,
29906,
29906,
29918,
14057,
1495,
13,
18884,
274,
11742,
29906,
29889,
9772,
877,
29926,
29906,
29941,
1495,
13,
13,
13,
1753,
1243,
29918,
7728,
351,
362,
29918,
25442,
29918,
6194,
29918,
27420,
29918,
23482,
29918,
15550,
29918,
19878,
29898,
2754,
29918,
1853,
29892,
25713,
29918,
1645,
1125,
13,
1678,
411,
7882,
29918,
2622,
29889,
2754,
22168,
1445,
1649,
29892,
7882,
29918,
1853,
29892,
6464,
29922,
5574,
29897,
408,
7882,
29901,
13,
4706,
758,
29918,
735,
15423,
29918,
29888,
1296,
29918,
11303,
29898,
2754,
29918,
1853,
29897,
13,
4706,
7882,
29889,
1731,
29918,
9057,
580,
13,
4706,
7882,
29889,
9057,
877,
29926,
29896,
29896,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29900,
29892,
2149,
29918,
11569,
542,
800,
29922,
29896,
29892,
2149,
29918,
2098,
29922,
29896,
29897,
13,
4706,
7882,
29889,
9057,
877,
29926,
29906,
29896,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29900,
29892,
2149,
29918,
11569,
542,
800,
29922,
29896,
29892,
2149,
29918,
2098,
29922,
29896,
29897,
13,
4706,
7882,
29889,
9057,
877,
29926,
29906,
29906,
29918,
14057,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29896,
29892,
2149,
29918,
11569,
542,
800,
29922,
29896,
29892,
2149,
29918,
2098,
29922,
29896,
29897,
13,
4706,
7882,
29889,
9057,
877,
29926,
29906,
29941,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29900,
29892,
2149,
29918,
11569,
542,
800,
29922,
29896,
29892,
2149,
29918,
2098,
29922,
29896,
29897,
13,
13,
4706,
411,
8943,
29898,
2754,
29892,
11815,
29922,
29955,
29900,
29892,
4982,
29918,
978,
29918,
13506,
29922,
2754,
29889,
9057,
29918,
978,
29918,
13506,
29892,
3461,
29918,
19207,
29922,
29941,
29897,
408,
274,
11742,
29896,
29901,
13,
9651,
274,
11742,
29896,
29889,
9772,
877,
29926,
29896,
29896,
1495,
13,
13,
9651,
411,
274,
11742,
29896,
29889,
15550,
580,
408,
274,
11742,
29906,
29901,
13,
18884,
274,
11742,
29906,
29889,
9772,
877,
29926,
29906,
29896,
1495,
13,
18884,
411,
274,
11742,
29906,
29889,
15550,
29898,
7728,
351,
362,
29922,
1184,
13573,
362,
29889,
4519,
6227,
11499,
29918,
4986,
29918,
3904,
1254,
6181,
29897,
408,
274,
11742,
29941,
29901,
13,
462,
1678,
274,
11742,
29941,
29889,
9772,
877,
29926,
29906,
29906,
29918,
14057,
1495,
13,
18884,
274,
11742,
29906,
29889,
9772,
877,
29926,
29906,
29941,
1495,
13,
13,
13,
1753,
1243,
29918,
7728,
351,
362,
29918,
25442,
29918,
6194,
29918,
27420,
29918,
15550,
29918,
15550,
29918,
19878,
29918,
14057,
29898,
2754,
29918,
1853,
1125,
13,
1678,
411,
7882,
29918,
2622,
29889,
2754,
22168,
1445,
1649,
29892,
7882,
29918,
1853,
29892,
6464,
29922,
5574,
29897,
408,
7882,
29901,
13,
4706,
758,
29918,
735,
15423,
29918,
29888,
1296,
29918,
11303,
29898,
2754,
29918,
1853,
29897,
13,
4706,
7882,
29889,
1731,
29918,
9057,
580,
13,
4706,
7882,
29889,
9057,
877,
29926,
29896,
29896,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29900,
29892,
2149,
29918,
11569,
542,
800,
29922,
29896,
29892,
2149,
29918,
2098,
29922,
29896,
29897,
13,
4706,
7882,
29889,
9057,
877,
29926,
29906,
29896,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29900,
29892,
2149,
29918,
11569,
542,
800,
29922,
29896,
29892,
2149,
29918,
2098,
29922,
29906,
29897,
13,
4706,
7882,
29889,
9057,
877,
29926,
29906,
29906,
29918,
14057,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29896,
29892,
2149,
29918,
11569,
542,
800,
29922,
29896,
29892,
2149,
29918,
2098,
29922,
29941,
29897,
13,
4706,
7882,
29889,
9057,
877,
29926,
29906,
29941,
29918,
14057,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29896,
29892,
2149,
29918,
11569,
542,
800,
29922,
29896,
29892,
2149,
29918,
2098,
29922,
29946,
29897,
13,
13,
4706,
411,
1153,
4637,
29898,
17776,
5938,
11947,
2451,
1125,
13,
9651,
411,
7797,
29898,
2754,
29892,
11815,
29922,
29955,
29900,
29892,
4982,
29918,
978,
29918,
13506,
29922,
2754,
29889,
9057,
29918,
978,
29918,
13506,
29892,
3461,
29918,
19207,
29922,
29941,
29897,
408,
274,
11742,
29896,
29901,
13,
18884,
274,
11742,
29896,
29889,
9772,
877,
29926,
29896,
29896,
1495,
13,
13,
18884,
411,
274,
11742,
29896,
29889,
15550,
580,
408,
274,
11742,
29906,
29901,
13,
462,
1678,
274,
11742,
29906,
29889,
9772,
877,
29926,
29906,
29896,
1495,
13,
462,
1678,
411,
274,
11742,
29906,
29889,
15550,
29898,
7728,
351,
362,
29922,
1184,
13573,
362,
29889,
4519,
6227,
11499,
29918,
4986,
29918,
3904,
1254,
6181,
29897,
408,
274,
11742,
29941,
29901,
13,
462,
4706,
274,
11742,
29941,
29889,
9772,
877,
29926,
29906,
29906,
29918,
14057,
1495,
13,
462,
1678,
274,
11742,
29906,
29889,
9772,
877,
29926,
29906,
29941,
29918,
14057,
1495,
13,
13,
13,
1753,
1243,
29918,
7728,
351,
362,
29918,
25442,
29918,
6194,
29918,
27420,
29918,
23482,
29918,
15550,
29918,
19878,
29918,
14057,
29898,
2754,
29918,
1853,
1125,
13,
1678,
411,
7882,
29918,
2622,
29889,
2754,
22168,
1445,
1649,
29892,
7882,
29918,
1853,
29892,
6464,
29922,
5574,
29897,
408,
7882,
29901,
13,
4706,
758,
29918,
735,
15423,
29918,
29888,
1296,
29918,
11303,
29898,
2754,
29918,
1853,
29897,
13,
4706,
7882,
29889,
1731,
29918,
9057,
580,
13,
4706,
7882,
29889,
9057,
877,
29926,
29896,
29896,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29900,
29892,
2149,
29918,
11569,
542,
800,
29922,
29896,
29892,
2149,
29918,
2098,
29922,
29896,
29897,
13,
4706,
7882,
29889,
9057,
877,
29926,
29906,
29896,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29900,
29892,
2149,
29918,
11569,
542,
800,
29922,
29896,
29892,
2149,
29918,
2098,
29922,
29896,
29897,
13,
4706,
7882,
29889,
9057,
877,
29926,
29906,
29906,
29918,
14057,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29896,
29892,
2149,
29918,
11569,
542,
800,
29922,
29896,
29892,
2149,
29918,
2098,
29922,
29896,
29897,
13,
4706,
7882,
29889,
9057,
877,
29926,
29906,
29941,
29918,
14057,
742,
2279,
29918,
2230,
29922,
29900,
29889,
29900,
29896,
29892,
4236,
29918,
29888,
2234,
29922,
29896,
29892,
2149,
29918,
11569,
542,
800,
29922,
29896,
29892,
2149,
29918,
2098,
29922,
29896,
29897,
13,
13,
4706,
411,
1153,
4637,
29898,
17776,
5938,
11947,
29879,
2451,
1125,
13,
9651,
411,
8943,
29898,
2754,
29892,
11815,
29922,
29955,
29900,
29892,
4982,
29918,
978,
29918,
13506,
29922,
2754,
29889,
9057,
29918,
978,
29918,
13506,
29892,
3461,
29918,
19207,
29922,
29941,
29897,
408,
274,
11742,
29896,
29901,
13,
18884,
274,
11742,
29896,
29889,
9772,
877,
29926,
29896,
29896,
1495,
13,
13,
18884,
411,
274,
11742,
29896,
29889,
15550,
580,
408,
274,
11742,
29906,
29901,
13,
462,
1678,
274,
11742,
29906,
29889,
9772,
877,
29926,
29906,
29896,
1495,
13,
462,
1678,
411,
274,
11742,
29906,
29889,
15550,
29898,
7728,
351,
362,
29922,
1184,
13573,
362,
29889,
4519,
6227,
11499,
29918,
4986,
29918,
3904,
1254,
6181,
29897,
408,
274,
11742,
29941,
29901,
13,
462,
4706,
274,
11742,
29941,
29889,
9772,
877,
29926,
29906,
29906,
29918,
14057,
1495,
13,
462,
1678,
274,
11742,
29906,
29889,
9772,
877,
29926,
29906,
29941,
29918,
14057,
1495,
13,
2
] |
plugins/modules/system_certificate_info.py | steinzi/ansible-ise | 0 | 1612480 | <reponame>steinzi/ansible-ise<filename>plugins/modules/system_certificate_info.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Cisco Systems
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
DOCUMENTATION = r"""
---
module: system_certificate_info
short_description: Information module for System Certificate
description:
- Get System Certificate by id.
- Get System Certificate by name.
version_added: '1.0.0'
author: <NAME> (@racampos)
options:
hostName:
description:
- HostName path parameter. Name of the host of which system certificates should be returned.
type: str
page:
description:
- Page query parameter. Page number.
type: int
size:
description:
- Size query parameter. Number of objects returned per page.
type: int
sort:
description:
- Sort query parameter. Sort type - asc or desc.
type: str
sortBy:
description:
- SortBy query parameter. Sort column by which objects needs to be sorted.
type: str
filter:
description:
- >
Filter query parameter. <div> <style type="text/css" scoped> .apiServiceTable td, .apiServiceTable th {
padding 5px 10px !important; text-align left; } </style> <span> <b>Simple filtering</b> should be available
through the filter query string parameter. The structure of a filter is a triplet of field operator and
value separated with dots. More than one filter can be sent. The logical operator common to ALL filter
criteria will be by default AND, and can be changed by using the <i>"filterType=or"</i> query string
parameter. Each resource Data model description should specify if an attribute is a filtered field. </span>
<br /> <table class="apiServiceTable"> <thead> <tr> <th>OPERATOR</th> <th>DESCRIPTION</th> </tr> </thead>
<tbody> <tr> <td>EQ</td> <td>Equals</td> </tr> <tr> <td>NEQ</td> <td>Not Equals</td> </tr> <tr> <td>GT</td>
<td>Greater Than</td> </tr> <tr> <td>LT</td> <td>Less Then</td> </tr> <tr> <td>STARTSW</td> <td>Starts
With</td> </tr> <tr> <td>NSTARTSW</td> <td>Not Starts With</td> </tr> <tr> <td>ENDSW</td> <td>Ends With</td>
</tr> <tr> <td>NENDSW</td> <td>Not Ends With</td> </tr> <tr> <td>CONTAINS</td> <td>Contains</td> </tr> <tr>
<td>NCONTAINS</td> <td>Not Contains</td> </tr> </tbody> </table> </div>.
type: list
filterType:
description:
- >
FilterType query parameter. The logical operator common to ALL filter criteria will be by default AND, and
can be changed by using the parameter.
type: str
id:
description:
- Id path parameter. The id of the system certificate.
type: str
requirements:
- ciscoisesdk
seealso:
# Reference by Internet resource
- name: System Certificate reference
description: Complete reference of the System Certificate object model.
link: https://ciscoisesdk.readthedocs.io/en/latest/api/api.html#v3-0-0-summary
"""
EXAMPLES = r"""
- name: Get System Certificate by id
cisco.ise.system_certificate_info:
ise_hostname: "{{ise_hostname}}"
ise_username: "{{ise_username}}"
ise_password: "{{<PASSWORD>}}"
ise_verify: "{{ise_verify}}"
hostName: string
id: string
register: result
- name: Get System Certificate by name
cisco.ise.system_certificate_info:
ise_hostname: "{{ise_hostname}}"
ise_username: "{{ise_username}}"
ise_password: "{{<PASSWORD>}}"
ise_verify: "{{ise_verify}}"
page: 1
size: 20
sort: asc
sortBy: string
filter: []
filterType: AND
hostName: string
register: result
"""
RETURN = r"""
ise_response:
description: A dictionary or list with the response returned by the Cisco ISE Python SDK
returned: always
type: dict
sample: >
{
"response": {
"expirationDate": "string",
"friendlyName": "string",
"groupTag": "string",
"id": "string",
"issuedBy": "string",
"issuedTo": "string",
"keySize": 0,
"link": {
"href": "string",
"rel": "string",
"type": "string"
},
"portalsUsingTheTag": "string",
"selfSigned": true,
"serialNumberDecimalFormat": "string",
"sha256Fingerprint": "string",
"signatureAlgorithm": "string",
"usedBy": "string",
"validFrom": "string"
},
"version": "string"
}
"""
| [
1,
529,
276,
1112,
420,
29958,
5465,
2526,
29914,
550,
1821,
29899,
895,
29966,
9507,
29958,
12800,
29914,
7576,
29914,
5205,
29918,
6327,
8021,
29918,
3888,
29889,
2272,
13,
29937,
14708,
4855,
29914,
2109,
29914,
4691,
13,
29937,
448,
29930,
29899,
14137,
29901,
23616,
29899,
29947,
448,
29930,
29899,
13,
13,
29937,
14187,
1266,
313,
29883,
29897,
29871,
29906,
29900,
29906,
29896,
29892,
315,
275,
1111,
23985,
13,
29937,
15143,
4593,
5236,
19245,
325,
29941,
29889,
29900,
29974,
313,
4149,
365,
2965,
1430,
1660,
470,
2045,
597,
1636,
29889,
18713,
29889,
990,
29914,
506,
11259,
29914,
29887,
572,
29899,
29941,
29889,
29900,
29889,
3945,
29897,
13,
13,
28665,
5005,
3919,
8098,
353,
364,
15945,
29908,
13,
5634,
13,
5453,
29901,
1788,
29918,
6327,
8021,
29918,
3888,
13,
12759,
29918,
8216,
29901,
10343,
3883,
363,
2184,
18410,
8021,
13,
8216,
29901,
13,
29899,
3617,
2184,
18410,
8021,
491,
1178,
29889,
13,
29899,
3617,
2184,
18410,
8021,
491,
1024,
29889,
13,
3259,
29918,
23959,
29901,
525,
29896,
29889,
29900,
29889,
29900,
29915,
13,
8921,
29901,
529,
5813,
29958,
20164,
945,
314,
1066,
29897,
13,
6768,
29901,
13,
29871,
3495,
1170,
29901,
13,
1678,
6139,
29901,
13,
1678,
448,
16956,
1170,
2224,
3443,
29889,
4408,
310,
278,
3495,
310,
607,
1788,
23199,
1078,
881,
367,
4133,
29889,
13,
1678,
1134,
29901,
851,
13,
29871,
1813,
29901,
13,
1678,
6139,
29901,
13,
1678,
448,
9305,
2346,
3443,
29889,
9305,
1353,
29889,
13,
1678,
1134,
29901,
938,
13,
29871,
2159,
29901,
13,
1678,
6139,
29901,
13,
1678,
448,
21179,
2346,
3443,
29889,
9681,
310,
3618,
4133,
639,
1813,
29889,
13,
1678,
1134,
29901,
938,
13,
29871,
2656,
29901,
13,
1678,
6139,
29901,
13,
1678,
448,
20025,
2346,
3443,
29889,
20025,
1134,
448,
12066,
470,
5153,
29889,
13,
1678,
1134,
29901,
851,
13,
29871,
2656,
2059,
29901,
13,
1678,
6139,
29901,
13,
1678,
448,
20025,
2059,
2346,
3443,
29889,
20025,
1897,
491,
607,
3618,
4225,
304,
367,
12705,
29889,
13,
1678,
1134,
29901,
851,
13,
29871,
4175,
29901,
13,
1678,
6139,
29901,
13,
1678,
448,
1405,
13,
418,
19916,
2346,
3443,
29889,
529,
4563,
29958,
529,
3293,
1134,
543,
726,
29914,
4268,
29908,
16505,
287,
29958,
869,
2754,
3170,
3562,
22599,
29892,
869,
2754,
3170,
3562,
266,
426,
13,
418,
7164,
29871,
29945,
1756,
29871,
29896,
29900,
1756,
1738,
17001,
29936,
1426,
29899,
2520,
2175,
29936,
500,
1533,
3293,
29958,
529,
9653,
29958,
529,
29890,
29958,
15427,
21166,
829,
29890,
29958,
881,
367,
3625,
13,
418,
1549,
278,
4175,
2346,
1347,
3443,
29889,
450,
3829,
310,
263,
4175,
338,
263,
21954,
29873,
310,
1746,
5455,
322,
13,
418,
995,
13055,
411,
270,
1862,
29889,
5853,
1135,
697,
4175,
508,
367,
2665,
29889,
450,
16667,
5455,
3619,
304,
15149,
4175,
13,
418,
16614,
674,
367,
491,
2322,
5300,
29892,
322,
508,
367,
3939,
491,
773,
278,
529,
29875,
11903,
4572,
1542,
29922,
272,
29908,
829,
29875,
29958,
2346,
1347,
13,
418,
3443,
29889,
7806,
6503,
3630,
1904,
6139,
881,
6084,
565,
385,
5352,
338,
263,
22289,
1746,
29889,
1533,
9653,
29958,
13,
418,
529,
1182,
2900,
529,
2371,
770,
543,
2754,
3170,
3562,
1013,
529,
19081,
29958,
529,
509,
29958,
529,
386,
29958,
4590,
1001,
1299,
1955,
829,
386,
29958,
529,
386,
29958,
2287,
7187,
24290,
2725,
829,
386,
29958,
1533,
509,
29958,
1533,
19081,
29958,
13,
418,
529,
15370,
29958,
529,
509,
29958,
529,
1594,
29958,
28879,
829,
1594,
29958,
529,
1594,
29958,
14776,
829,
1594,
29958,
1533,
509,
29958,
529,
509,
29958,
529,
1594,
29958,
8186,
29984,
829,
1594,
29958,
529,
1594,
29958,
3664,
11243,
1338,
829,
1594,
29958,
1533,
509,
29958,
529,
509,
29958,
529,
1594,
29958,
23799,
829,
1594,
29958,
13,
418,
529,
1594,
29958,
25120,
1008,
498,
273,
829,
1594,
29958,
1533,
509,
29958,
529,
509,
29958,
529,
1594,
29958,
5850,
829,
1594,
29958,
529,
1594,
29958,
29931,
404,
1987,
829,
1594,
29958,
1533,
509,
29958,
529,
509,
29958,
529,
1594,
29958,
25826,
23066,
829,
1594,
29958,
529,
1594,
29958,
4763,
29879,
13,
418,
2973,
829,
1594,
29958,
1533,
509,
29958,
529,
509,
29958,
529,
1594,
29958,
29940,
25826,
23066,
829,
1594,
29958,
529,
1594,
29958,
3664,
624,
5708,
2973,
829,
1594,
29958,
1533,
509,
29958,
529,
509,
29958,
529,
1594,
29958,
1430,
8452,
29956,
829,
1594,
29958,
529,
1594,
29958,
5044,
29879,
2973,
829,
1594,
29958,
13,
418,
1533,
509,
29958,
529,
509,
29958,
529,
1594,
29958,
29940,
1430,
8452,
29956,
829,
1594,
29958,
529,
1594,
29958,
3664,
2796,
29879,
2973,
829,
1594,
29958,
1533,
509,
29958,
529,
509,
29958,
529,
1594,
29958,
6007,
6040,
1177,
29903,
829,
1594,
29958,
529,
1594,
29958,
21409,
829,
1594,
29958,
1533,
509,
29958,
529,
509,
29958,
13,
418,
529,
1594,
29958,
29940,
6007,
6040,
1177,
29903,
829,
1594,
29958,
529,
1594,
29958,
3664,
2866,
2708,
829,
1594,
29958,
1533,
509,
29958,
1533,
15370,
29958,
1533,
2371,
29958,
1533,
4563,
15513,
13,
1678,
1134,
29901,
1051,
13,
29871,
4175,
1542,
29901,
13,
1678,
6139,
29901,
13,
1678,
448,
1405,
13,
418,
19916,
1542,
2346,
3443,
29889,
450,
16667,
5455,
3619,
304,
15149,
4175,
16614,
674,
367,
491,
2322,
5300,
29892,
322,
13,
418,
508,
367,
3939,
491,
773,
278,
3443,
29889,
13,
1678,
1134,
29901,
851,
13,
29871,
1178,
29901,
13,
1678,
6139,
29901,
13,
1678,
448,
5163,
2224,
3443,
29889,
450,
1178,
310,
278,
1788,
12289,
29889,
13,
1678,
1134,
29901,
851,
13,
12277,
1860,
29901,
13,
29899,
274,
275,
1111,
4637,
8181,
13,
4149,
15189,
29901,
13,
29937,
12105,
491,
4685,
6503,
13,
29899,
1024,
29901,
2184,
18410,
8021,
3407,
13,
29871,
6139,
29901,
25034,
3407,
310,
278,
2184,
18410,
8021,
1203,
1904,
29889,
13,
29871,
1544,
29901,
2045,
597,
3476,
1111,
4637,
8181,
29889,
949,
386,
287,
12332,
29889,
601,
29914,
264,
29914,
12333,
29914,
2754,
29914,
2754,
29889,
1420,
29937,
29894,
29941,
29899,
29900,
29899,
29900,
29899,
7727,
13,
15945,
29908,
13,
13,
5746,
19297,
17101,
353,
364,
15945,
29908,
13,
29899,
1024,
29901,
3617,
2184,
18410,
8021,
491,
1178,
13,
29871,
274,
275,
1111,
29889,
895,
29889,
5205,
29918,
6327,
8021,
29918,
3888,
29901,
13,
1678,
338,
29872,
29918,
28988,
29901,
376,
6224,
895,
29918,
28988,
930,
29908,
13,
1678,
338,
29872,
29918,
6786,
29901,
376,
6224,
895,
29918,
6786,
930,
29908,
13,
1678,
338,
29872,
29918,
5630,
29901,
376,
6224,
29966,
25711,
17013,
29958,
930,
29908,
13,
1678,
338,
29872,
29918,
27902,
29901,
376,
6224,
895,
29918,
27902,
930,
29908,
13,
1678,
3495,
1170,
29901,
1347,
13,
1678,
1178,
29901,
1347,
13,
29871,
6036,
29901,
1121,
13,
13,
29899,
1024,
29901,
3617,
2184,
18410,
8021,
491,
1024,
13,
29871,
274,
275,
1111,
29889,
895,
29889,
5205,
29918,
6327,
8021,
29918,
3888,
29901,
13,
1678,
338,
29872,
29918,
28988,
29901,
376,
6224,
895,
29918,
28988,
930,
29908,
13,
1678,
338,
29872,
29918,
6786,
29901,
376,
6224,
895,
29918,
6786,
930,
29908,
13,
1678,
338,
29872,
29918,
5630,
29901,
376,
6224,
29966,
25711,
17013,
29958,
930,
29908,
13,
1678,
338,
29872,
29918,
27902,
29901,
376,
6224,
895,
29918,
27902,
930,
29908,
13,
1678,
1813,
29901,
29871,
29896,
13,
1678,
2159,
29901,
29871,
29906,
29900,
13,
1678,
2656,
29901,
12066,
13,
1678,
2656,
2059,
29901,
1347,
13,
1678,
4175,
29901,
5159,
13,
1678,
4175,
1542,
29901,
5300,
13,
1678,
3495,
1170,
29901,
1347,
13,
29871,
6036,
29901,
1121,
13,
13,
15945,
29908,
13,
13,
1525,
29911,
24015,
353,
364,
15945,
29908,
13,
895,
29918,
5327,
29901,
13,
29871,
6139,
29901,
319,
8600,
470,
1051,
411,
278,
2933,
4133,
491,
278,
315,
275,
1111,
306,
1660,
5132,
12967,
13,
29871,
4133,
29901,
2337,
13,
29871,
1134,
29901,
9657,
13,
29871,
4559,
29901,
1405,
13,
1678,
426,
13,
418,
376,
5327,
1115,
426,
13,
4706,
376,
4548,
12232,
2539,
1115,
376,
1807,
613,
13,
4706,
376,
18326,
368,
1170,
1115,
376,
1807,
613,
13,
4706,
376,
2972,
8176,
1115,
376,
1807,
613,
13,
4706,
376,
333,
1115,
376,
1807,
613,
13,
4706,
376,
790,
6742,
2059,
1115,
376,
1807,
613,
13,
4706,
376,
790,
6742,
1762,
1115,
376,
1807,
613,
13,
4706,
376,
1989,
3505,
1115,
29871,
29900,
29892,
13,
4706,
376,
2324,
1115,
426,
13,
3986,
376,
12653,
1115,
376,
1807,
613,
13,
3986,
376,
2674,
1115,
376,
1807,
613,
13,
3986,
376,
1853,
1115,
376,
1807,
29908,
13,
4706,
2981,
13,
4706,
376,
637,
1338,
15156,
1576,
8176,
1115,
376,
1807,
613,
13,
4706,
376,
1311,
10140,
287,
1115,
1565,
29892,
13,
4706,
376,
15550,
4557,
23307,
5809,
1115,
376,
1807,
613,
13,
4706,
376,
17051,
29906,
29945,
29953,
29943,
5621,
2158,
1115,
376,
1807,
613,
13,
4706,
376,
4530,
1535,
22461,
4540,
1115,
376,
1807,
613,
13,
4706,
376,
3880,
2059,
1115,
376,
1807,
613,
13,
4706,
376,
3084,
4591,
1115,
376,
1807,
29908,
13,
418,
2981,
13,
418,
376,
3259,
1115,
376,
1807,
29908,
13,
1678,
500,
13,
15945,
29908,
13,
2
] |
get-mensa-data/get_mensa_data.py | ProjectPepperHSB/Backend-Services | 0 | 90616 | <reponame>ProjectPepperHSB/Backend-Services<filename>get-mensa-data/get_mensa_data.py
#pip install pdf2image
#-- poppler --
#https://github.com/oschwartz10612/poppler-windows/releases/
#env: "C:\path\to\poppler-xx\bin"
import requests
import urllib.request
import json
import re
import traceback
from bs4 import BeautifulSoup
from pdf2image import convert_from_path
from PIL import Image
url = "https://www.stw-bremen.de/de/cafeteria/bremerhaven"
folder_location = "/home/docker-hbv-kms/repositories/NodeJS_Server4Pepper/public/"
def getMensaData():
try:
#download newest cafeteria plan
response = requests.get(url)
soup= BeautifulSoup(response.text, "html.parser")
#create url string
menucard = ((str(soup.select("a[href$='/print']")[0]).rsplit(' target', 1)[0]).split("href=",1)[1]).replace('"','')
urllib.request.urlretrieve(menucard, folder_location+"Mensaplan.pdf")
print("pdf downloaded")
#pdf to img
img = convert_from_path(folder_location+"Mensaplan.pdf", 500)[0]
#crop image
area = (0, 200, 4134, 2800) # R T L B
cropped_img = img.crop(area)
area = (0, 5200, 4134, 5800)
cropped_img2 = img.crop(area)
mergeImgs([cropped_img, cropped_img2]).save(folder_location+'images/mensaplan.png', 'JPEG')
print("images created from pdf")
#get all tbody tags from the site
menulist = soup.select("tbody")
menu = {}
day = ["Montag","Dienstag", "Mittwoch", "Donnerstag", "Freitag"]
offer1 = []
offer2 = []
for i in range(10):
tmp = (str(menulist[i]).split('description">',1)[1]).rsplit("</td><td",2)[0]
tmp = tmp.replace("\n","").replace("\r","").replace("a1","").replace("amp;","")
tmp = re.sub('<sup>.*?</sup>', '', tmp)
if(i%2==0):
offer1.append(tmp)
else:
offer2.append(tmp)
menu["day"] = day
menu["offer1"] = offer1
menu["offer2"] = offer2
with open(folder_location+"mensadata.json", "w+") as f:
json.dump(menu, f, ensure_ascii=False)
print("menu dataframe created")
except Exception:
traceback.print_exc()
def mergeImgs(imgs):
min_img_width = min(i.width for i in imgs)
total_height = 0
for i, img in enumerate(imgs):
# If the image is larger than the minimum width, resize it
if(img.width > min_img_width):
imgs[i] = img.resize((min_img_width, int(img.height / img.width * min_img_width)), Image.ANTIALIAS)
total_height += imgs[i].height
img_merge = Image.new(imgs[0].mode, (min_img_width, total_height))
y = 0
for img in imgs:
img_merge.paste(img, (0, y))
y += img.height
return img_merge
getMensaData() | [
1,
529,
276,
1112,
420,
29958,
7653,
15666,
2496,
29950,
1744,
29914,
5841,
355,
29899,
13779,
29966,
9507,
29958,
657,
29899,
29885,
14535,
29899,
1272,
29914,
657,
29918,
29885,
14535,
29918,
1272,
29889,
2272,
13,
29937,
13096,
2601,
13552,
29906,
3027,
30004,
13,
29937,
489,
772,
407,
1358,
1192,
30004,
13,
29937,
991,
597,
3292,
29889,
510,
29914,
359,
305,
10305,
29920,
29896,
29900,
29953,
29896,
29906,
29914,
1129,
407,
1358,
29899,
10499,
29914,
276,
17836,
29914,
30004,
13,
29937,
6272,
29901,
376,
29907,
3583,
2084,
29905,
517,
29905,
1129,
407,
1358,
29899,
4419,
29905,
2109,
19451,
13,
30004,
13,
5215,
7274,
30004,
13,
5215,
3142,
1982,
29889,
3827,
30004,
13,
5215,
4390,
30004,
13,
5215,
337,
30004,
13,
5215,
9637,
1627,
30004,
13,
3166,
24512,
29946,
1053,
25685,
29903,
1132,
30004,
13,
3166,
13552,
29906,
3027,
1053,
3588,
29918,
3166,
29918,
2084,
30004,
13,
3166,
349,
6227,
1053,
7084,
30004,
13,
30004,
13,
2271,
353,
376,
991,
597,
1636,
29889,
303,
29893,
29899,
1030,
1527,
29889,
311,
29914,
311,
29914,
1113,
29888,
1308,
423,
29914,
1030,
1050,
29882,
3496,
19451,
13,
12083,
29918,
5479,
353,
5591,
5184,
29914,
14695,
29899,
29882,
29890,
29894,
29899,
29895,
1516,
29914,
276,
1066,
20106,
29914,
4247,
8700,
29918,
6004,
29946,
15666,
2496,
29914,
3597,
12975,
30004,
13,
30004,
13,
1753,
679,
29924,
14535,
1469,
7295,
30004,
13,
1678,
1018,
29901,
30004,
13,
4706,
396,
10382,
716,
342,
274,
2142,
1308,
423,
3814,
30004,
13,
4706,
2933,
353,
7274,
29889,
657,
29898,
2271,
8443,
13,
4706,
22300,
29922,
25685,
29903,
1132,
29898,
5327,
29889,
726,
29892,
376,
1420,
29889,
16680,
1159,
30004,
13,
4706,
396,
3258,
3142,
1347,
30004,
13,
4706,
1757,
1682,
538,
353,
5135,
710,
29898,
29879,
1132,
29889,
2622,
703,
29874,
29961,
12653,
29938,
2433,
29914,
2158,
2033,
1159,
29961,
29900,
14664,
2288,
2830,
877,
3646,
742,
29871,
29896,
9601,
29900,
14664,
5451,
703,
12653,
543,
29892,
29896,
9601,
29896,
14664,
6506,
877,
29908,
3788,
1495,
30004,
13,
4706,
3142,
1982,
29889,
3827,
29889,
2271,
276,
509,
2418,
29898,
1527,
1682,
538,
29892,
4138,
29918,
5479,
13578,
29924,
575,
481,
6468,
29889,
5140,
1159,
30004,
13,
4706,
1596,
703,
5140,
16532,
1159,
30004,
13,
30004,
13,
4706,
396,
5140,
304,
10153,
30004,
13,
4706,
10153,
353,
3588,
29918,
3166,
29918,
2084,
29898,
12083,
29918,
5479,
13578,
29924,
575,
481,
6468,
29889,
5140,
613,
29871,
29945,
29900,
29900,
9601,
29900,
29962,
30004,
13,
4706,
396,
29883,
1336,
1967,
30004,
13,
4706,
4038,
353,
313,
29900,
29892,
29871,
29906,
29900,
29900,
29892,
29871,
29946,
29896,
29941,
29946,
29892,
29871,
29906,
29947,
29900,
29900,
29897,
396,
390,
323,
365,
350,
30004,
13,
4706,
8182,
2986,
29918,
2492,
353,
10153,
29889,
29883,
1336,
29898,
6203,
8443,
13,
30004,
13,
4706,
4038,
353,
313,
29900,
29892,
29871,
29945,
29906,
29900,
29900,
29892,
29871,
29946,
29896,
29941,
29946,
29892,
29871,
29945,
29947,
29900,
29900,
8443,
13,
4706,
8182,
2986,
29918,
2492,
29906,
353,
10153,
29889,
29883,
1336,
29898,
6203,
8443,
13,
30004,
13,
4706,
10366,
1888,
3174,
4197,
24077,
2986,
29918,
2492,
29892,
8182,
2986,
29918,
2492,
29906,
14664,
7620,
29898,
12083,
29918,
5479,
23097,
8346,
29914,
29885,
575,
481,
6468,
29889,
2732,
742,
525,
29967,
4162,
29954,
1495,
30004,
13,
30004,
13,
4706,
1596,
703,
8346,
2825,
515,
13552,
1159,
30004,
13,
30004,
13,
4706,
396,
657,
599,
260,
2587,
8282,
515,
278,
3268,
30004,
13,
4706,
1757,
352,
391,
353,
22300,
29889,
2622,
703,
15370,
1159,
30004,
13,
30004,
13,
4706,
6143,
353,
6571,
30004,
13,
4706,
2462,
353,
6796,
24665,
351,
3284,
29928,
11271,
351,
613,
376,
29924,
986,
827,
305,
613,
376,
10310,
1089,
24403,
613,
376,
23923,
277,
351,
3108,
30004,
13,
4706,
5957,
29896,
353,
5159,
30004,
13,
4706,
5957,
29906,
353,
5159,
30004,
13,
30004,
13,
4706,
363,
474,
297,
3464,
29898,
29896,
29900,
1125,
30004,
13,
9651,
13128,
353,
313,
710,
29898,
1527,
352,
391,
29961,
29875,
14664,
5451,
877,
8216,
1013,
742,
29896,
9601,
29896,
14664,
2288,
2830,
703,
829,
1594,
5299,
1594,
613,
29906,
9601,
29900,
29962,
30004,
13,
9651,
13128,
353,
13128,
29889,
6506,
14182,
29876,
3284,
2564,
6506,
14182,
29878,
3284,
2564,
6506,
703,
29874,
29896,
3284,
2564,
6506,
703,
1160,
29936,
3284,
1159,
30004,
13,
9651,
13128,
353,
337,
29889,
1491,
877,
29966,
12587,
29958,
5575,
29973,
829,
12587,
29958,
742,
15516,
13128,
8443,
13,
9651,
565,
29898,
29875,
29995,
29906,
1360,
29900,
1125,
30004,
13,
18884,
5957,
29896,
29889,
4397,
29898,
7050,
8443,
13,
9651,
1683,
29901,
30004,
13,
18884,
5957,
29906,
29889,
4397,
29898,
7050,
8443,
13,
4706,
6143,
3366,
3250,
3108,
353,
2462,
30004,
13,
4706,
6143,
3366,
974,
571,
29896,
3108,
353,
5957,
29896,
30004,
13,
4706,
6143,
3366,
974,
571,
29906,
3108,
353,
5957,
29906,
30004,
13,
30004,
13,
30004,
13,
4706,
411,
1722,
29898,
12083,
29918,
5479,
13578,
29885,
575,
7221,
29889,
3126,
613,
376,
29893,
29974,
1159,
408,
285,
29901,
30004,
13,
9651,
4390,
29889,
15070,
29898,
6510,
29892,
285,
29892,
9801,
29918,
294,
18869,
29922,
8824,
8443,
13,
4706,
1596,
703,
6510,
12205,
2825,
1159,
30004,
13,
30004,
13,
1678,
5174,
8960,
29901,
30004,
13,
4706,
9637,
1627,
29889,
2158,
29918,
735,
29883,
26471,
13,
30004,
13,
30004,
13,
1753,
10366,
1888,
3174,
29898,
2492,
29879,
1125,
30004,
13,
1678,
1375,
29918,
2492,
29918,
2103,
353,
1375,
29898,
29875,
29889,
2103,
363,
474,
297,
527,
3174,
8443,
13,
30004,
13,
1678,
3001,
29918,
3545,
353,
29871,
29900,
30004,
13,
1678,
363,
474,
29892,
10153,
297,
26985,
29898,
2492,
29879,
1125,
30004,
13,
4706,
396,
960,
278,
1967,
338,
7200,
1135,
278,
9212,
2920,
29892,
19490,
372,
30004,
13,
4706,
565,
29898,
2492,
29889,
2103,
1405,
1375,
29918,
2492,
29918,
2103,
1125,
30004,
13,
9651,
527,
3174,
29961,
29875,
29962,
353,
10153,
29889,
21476,
3552,
1195,
29918,
2492,
29918,
2103,
29892,
938,
29898,
2492,
29889,
3545,
847,
10153,
29889,
2103,
334,
1375,
29918,
2492,
29918,
2103,
8243,
7084,
29889,
13566,
25758,
29902,
3289,
8443,
13,
4706,
3001,
29918,
3545,
4619,
527,
3174,
29961,
29875,
1822,
3545,
30004,
13,
30004,
13,
1678,
10153,
29918,
14634,
353,
7084,
29889,
1482,
29898,
2492,
29879,
29961,
29900,
1822,
8513,
29892,
313,
1195,
29918,
2492,
29918,
2103,
29892,
3001,
29918,
3545,
876,
30004,
13,
1678,
343,
353,
29871,
29900,
30004,
13,
1678,
363,
10153,
297,
527,
3174,
29901,
30004,
13,
4706,
10153,
29918,
14634,
29889,
16179,
29898,
2492,
29892,
313,
29900,
29892,
343,
876,
30004,
13,
30004,
13,
4706,
343,
4619,
10153,
29889,
3545,
30004,
13,
1678,
736,
10153,
29918,
14634,
30004,
13,
30004,
13,
657,
29924,
14535,
1469,
580,
2
] |
points/migrations/0004_spend_receipt.py | JXIong15/fetch-points | 0 | 58797 | # Generated by Django 4.0.1 on 2022-01-12 23:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('points', '0003_spend_alter_transaction_timestamp'),
]
operations = [
migrations.AddField(
model_name='spend',
name='receipt',
field=models.TextField(blank=True, null=True),
),
]
| [
1,
396,
3251,
630,
491,
15337,
29871,
29946,
29889,
29900,
29889,
29896,
373,
29871,
29906,
29900,
29906,
29906,
29899,
29900,
29896,
29899,
29896,
29906,
29871,
29906,
29941,
29901,
29946,
29946,
13,
13,
3166,
9557,
29889,
2585,
1053,
9725,
800,
29892,
4733,
13,
13,
13,
1990,
341,
16783,
29898,
26983,
800,
29889,
29924,
16783,
1125,
13,
13,
1678,
9962,
353,
518,
13,
4706,
6702,
9748,
742,
525,
29900,
29900,
29900,
29941,
29918,
1028,
355,
29918,
13794,
29918,
20736,
29918,
16394,
5477,
13,
1678,
4514,
13,
13,
1678,
6931,
353,
518,
13,
4706,
9725,
800,
29889,
2528,
3073,
29898,
13,
9651,
1904,
29918,
978,
2433,
1028,
355,
742,
13,
9651,
1024,
2433,
13556,
21278,
742,
13,
9651,
1746,
29922,
9794,
29889,
15778,
29898,
19465,
29922,
5574,
29892,
1870,
29922,
5574,
511,
13,
4706,
10353,
13,
1678,
4514,
13,
2
] |
django_walletpass/__init__.py | Develatio/django-passbook | 7 | 63589 | <reponame>Develatio/django-passbook
# pylint: disable=invalid-name
VERSION = '1.0'
default_app_config = 'django_walletpass.apps.DjangoWalletpassConfig'
| [
1,
529,
276,
1112,
420,
29958,
2772,
955,
20819,
29914,
14095,
29899,
3364,
2909,
13,
29937,
282,
2904,
524,
29901,
11262,
29922,
20965,
29899,
978,
13,
16358,
353,
525,
29896,
29889,
29900,
29915,
13,
13,
4381,
29918,
932,
29918,
2917,
353,
525,
14095,
29918,
14625,
1026,
3364,
29889,
13371,
29889,
29928,
5364,
29956,
284,
1026,
3364,
3991,
29915,
13,
2
] |
etc/metadataParsers/ngrams/writeNgrams.py | organisciak/HTRC-BookwormDB | 0 | 93549 | <filename>etc/metadataParsers/ngrams/writeNgrams.py<gh_stars>0
#!/usr/bin/python
import os
import re
filenames = [filename for filename in os.listdir("../../../texts/raw") if not (re.search('zip',filename) or re.search('3gram',filename))]
for filename in filenames:
towrite = dict()
print filename
reading = open("../../../texts/raw/" + filename)
corpus = re.sub("-2009.*","",filename)
corpus = re.sub("-\dgram.*","",corpus)
corpus = re.sub("googlebooks-","",corpus)
print corpus
i = 0
for line in reading:
i = i+1
if (i==1000000*round(i/1000000)):
print "reading line no. \t" + str(round(i)/1000000) + " million out of c. 50 million"
try:
output = line.split("\t")
try:
year = int(output[1])
except:
continue
word = output[0]
count= output[2]
string = " ".join([word,count])
try:
towrite[year].append(string)
except:
towrite[year] = [string]
except:
pass
for year in towrite.keys():
print year
if re.search("2gram",filename):
print corpus
print str(year)
writing = open("../../../texts/bigrams/" + corpus+str(year)+".txt",'a')
elif re.search("1gram",filename):
writing = open("../../../texts/unigrams/" + corpus+str(year)+".txt",'a')
else:
writing = open("tmp/scratch",'a')
writing.write('\n'.join(towrite[year]))
writing.close()
| [
1,
529,
9507,
29958,
7070,
29914,
19635,
29925,
1503,
414,
29914,
29876,
1393,
29879,
29914,
3539,
29940,
1393,
29879,
29889,
2272,
29966,
12443,
29918,
303,
1503,
29958,
29900,
13,
29937,
14708,
4855,
29914,
2109,
29914,
4691,
13,
13,
5215,
2897,
13,
5215,
337,
13,
1777,
264,
1280,
353,
518,
9507,
363,
10422,
297,
2897,
29889,
1761,
3972,
703,
21546,
6995,
726,
29879,
29914,
1610,
1159,
565,
451,
313,
276,
29889,
4478,
877,
7554,
742,
9507,
29897,
470,
337,
29889,
4478,
877,
29941,
1393,
742,
9507,
28166,
13,
1454,
10422,
297,
977,
264,
1280,
29901,
13,
1678,
304,
3539,
353,
9657,
580,
13,
1678,
1596,
10422,
13,
1678,
5183,
353,
1722,
703,
21546,
6995,
726,
29879,
29914,
1610,
12975,
718,
10422,
29897,
13,
1678,
1034,
13364,
353,
337,
29889,
1491,
703,
29899,
29906,
29900,
29900,
29929,
5575,
3284,
613,
9507,
29897,
13,
1678,
1034,
13364,
353,
337,
29889,
1491,
703,
2612,
29881,
1393,
5575,
3284,
613,
2616,
13364,
29897,
13,
1678,
1034,
13364,
353,
337,
29889,
1491,
703,
3608,
12733,
29899,
3284,
613,
2616,
13364,
29897,
13,
1678,
1596,
1034,
13364,
13,
1678,
474,
353,
29871,
29900,
13,
1678,
363,
1196,
297,
5183,
29901,
13,
4706,
474,
353,
474,
29974,
29896,
13,
4706,
565,
313,
29875,
1360,
29896,
29900,
29900,
29900,
29900,
29900,
29900,
29930,
14486,
29898,
29875,
29914,
29896,
29900,
29900,
29900,
29900,
29900,
29900,
22164,
13,
9651,
1596,
376,
19715,
1196,
694,
29889,
320,
29873,
29908,
718,
851,
29898,
14486,
29898,
29875,
6802,
29896,
29900,
29900,
29900,
29900,
29900,
29900,
29897,
718,
376,
7284,
714,
310,
274,
29889,
29871,
29945,
29900,
7284,
29908,
13,
4706,
1018,
29901,
13,
9651,
1962,
353,
1196,
29889,
5451,
14182,
29873,
1159,
13,
9651,
1018,
29901,
13,
18884,
1629,
353,
938,
29898,
4905,
29961,
29896,
2314,
13,
9651,
5174,
29901,
13,
18884,
6773,
13,
9651,
1734,
353,
1962,
29961,
29900,
29962,
13,
9651,
2302,
29922,
1962,
29961,
29906,
29962,
13,
9651,
1347,
353,
376,
11393,
7122,
4197,
1742,
29892,
2798,
2314,
13,
9651,
1018,
29901,
13,
18884,
304,
3539,
29961,
6360,
1822,
4397,
29898,
1807,
29897,
13,
9651,
5174,
29901,
13,
18884,
304,
3539,
29961,
6360,
29962,
353,
518,
1807,
29962,
13,
4706,
5174,
29901,
13,
9651,
1209,
13,
1678,
363,
1629,
297,
304,
3539,
29889,
8149,
7295,
13,
4706,
1596,
1629,
13,
4706,
565,
337,
29889,
4478,
703,
29906,
1393,
613,
9507,
1125,
13,
9651,
1596,
1034,
13364,
13,
9651,
1596,
851,
29898,
6360,
29897,
13,
9651,
5007,
353,
1722,
703,
21546,
6995,
726,
29879,
29914,
3752,
25402,
12975,
718,
1034,
13364,
29974,
710,
29898,
6360,
7240,
1642,
3945,
613,
29915,
29874,
1495,
13,
4706,
25342,
337,
29889,
4478,
703,
29896,
1393,
613,
9507,
1125,
13,
9651,
5007,
353,
1722,
703,
21546,
6995,
726,
29879,
29914,
348,
4481,
2232,
12975,
718,
1034,
13364,
29974,
710,
29898,
6360,
7240,
1642,
3945,
613,
29915,
29874,
1495,
13,
4706,
1683,
29901,
13,
9651,
5007,
353,
1722,
703,
7050,
29914,
10526,
905,
613,
29915,
29874,
1495,
13,
4706,
5007,
29889,
3539,
28909,
29876,
4286,
7122,
29898,
29873,
340,
1377,
29961,
6360,
12622,
13,
4706,
5007,
29889,
5358,
580,
13,
2
] |
json.py | AbhijithGanesh/Flask-HTTP-Server | 0 | 18858 | import json
'''
READ THE DATABASE README before operating
'''
File = r'''YOUR FILE'''
with open(File,'a') as fileObj:
data = json.load()
'''
YOUR DATA LOGIC GOES IN HERE
Once the data is changed, to write it to your JSON file use the following command.
'''
json.dump(object,File) | [
1,
1053,
4390,
13,
12008,
13,
16310,
6093,
27640,
27982,
5195,
3035,
2303,
1434,
13598,
13,
12008,
13,
2283,
353,
364,
12008,
29979,
22970,
24080,
12008,
13,
2541,
1722,
29898,
2283,
5501,
29874,
1495,
408,
934,
9930,
29901,
13,
1678,
848,
353,
4390,
29889,
1359,
580,
13,
1678,
14550,
13,
1678,
612,
22970,
360,
8254,
25401,
2965,
21947,
2890,
2672,
379,
27267,
13,
1678,
9038,
278,
848,
338,
3939,
29892,
304,
2436,
372,
304,
596,
4663,
934,
671,
278,
1494,
1899,
29889,
13,
1678,
14550,
13,
1678,
4390,
29889,
15070,
29898,
3318,
29892,
2283,
29897,
2
] |
tests/test_code.py | MattDMo/PythonImproved | 83 | 120746 | from . import foo
from .. import bar
from ... import baz
import ...snurp
def blah(...):
pass
class Foo(tuple):
@staticmethod
def __new__(cls, initialValue=(0,0)):
return tuple.__new__(cls, initialValue)
class Bar(tuple):
def __init__(self, initialValue=(0,0)):
super(tuple, self).__init__(initialValue)
super(tuple, self).count(items, stuff="thneed")
@staticmethod
def somefunc(arg, arrg=pirate):
pass
@property
list(map(str, range(100)))
[str(i) for i in range(100)]
sâomething(arg=22)
def sâomething():
pass
class sâomething(object):
pass
__init__(something)
list(map(str, range(100)))
# ^^^ support.type.python
[str(i) for i in range(100)]
#^^^ support.function.builtin.call.python
super(arg1=1)(arg2=2)
list abs, map
some.None NotImplemented
print (file=None)
print __class__
print keyword
print __init__
print(foobar)
__init__ . something()
callback(print)
callback(range)
.__init__
__init__ [2]
@ deco . __init__ (call=some) # rator
def function():
pass
@classmethod
def from_foo(cls, foo):
return cls(foo, bar='baz')
# highlighting for arguments broken
mod.func()
mod.submod.func()
func().func2().attr
mod.func().attr.attr2.func2()
range(foo, bar)
(...)
__exit__
print foobar
Привет_мир() or 我喜欢奶酪() or Kolbász_finom()
bool
class MyWarning(Warning):
def __init__(self, text='first part'
'second part'):
self.args = (text,)
foo(text="line 1"
"line 2")
foobar(param=r"()")
def f():
print(r"()")
f()
def hi(name):
r""" Say hi!
with a \) special characters.
"""
return 'hi ' + name
print(hi('avi'))
| [
1,
515,
869,
1053,
7953,
13,
3166,
6317,
1053,
2594,
13,
3166,
2023,
1053,
12741,
13,
13,
5215,
2023,
16586,
332,
29886,
13,
13,
1753,
29268,
19327,
1125,
13,
1678,
1209,
13,
13,
13,
13,
1990,
13679,
29898,
23583,
1125,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
4770,
1482,
12035,
25932,
29892,
2847,
1917,
7607,
29900,
29892,
29900,
22164,
13,
4706,
736,
18761,
17255,
1482,
12035,
25932,
29892,
2847,
1917,
29897,
13,
13,
13,
1990,
2261,
29898,
23583,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
2847,
1917,
7607,
29900,
29892,
29900,
22164,
13,
4706,
2428,
29898,
23583,
29892,
1583,
467,
1649,
2344,
12035,
11228,
1917,
29897,
13,
4706,
2428,
29898,
23583,
29892,
1583,
467,
2798,
29898,
7076,
29892,
6433,
543,
386,
26180,
1159,
13,
13,
1678,
732,
7959,
5696,
13,
1678,
822,
777,
9891,
29898,
1191,
29892,
3948,
29887,
29922,
29886,
381,
403,
1125,
13,
4706,
1209,
13,
13,
1678,
732,
6799,
13,
13,
1761,
29898,
1958,
29898,
710,
29892,
3464,
29898,
29896,
29900,
29900,
4961,
13,
29961,
710,
29898,
29875,
29897,
363,
474,
297,
3464,
29898,
29896,
29900,
29900,
4638,
13,
13,
29879,
30057,
9153,
29898,
1191,
29922,
29906,
29906,
29897,
13,
13,
1753,
269,
30057,
9153,
7295,
13,
1678,
1209,
13,
13,
1990,
269,
30057,
9153,
29898,
3318,
1125,
13,
1678,
1209,
13,
13,
1649,
2344,
12035,
14481,
29897,
13,
13,
1761,
29898,
1958,
29898,
710,
29892,
3464,
29898,
29896,
29900,
29900,
4961,
13,
29937,
4706,
6228,
16672,
2304,
29889,
1853,
29889,
4691,
13,
29961,
710,
29898,
29875,
29897,
363,
474,
297,
3464,
29898,
29896,
29900,
29900,
4638,
13,
29937,
16672,
29985,
2304,
29889,
2220,
29889,
16145,
262,
29889,
4804,
29889,
4691,
13,
13,
9136,
29898,
1191,
29896,
29922,
29896,
5033,
1191,
29906,
29922,
29906,
29897,
13,
1761,
6425,
29892,
2910,
13,
5372,
29889,
8516,
2216,
1888,
2037,
287,
13,
13,
2158,
313,
1445,
29922,
8516,
29897,
13,
2158,
4770,
1990,
1649,
13,
2158,
13553,
13,
2158,
4770,
2344,
1649,
13,
2158,
29898,
1181,
22872,
29897,
13,
13,
1649,
2344,
1649,
869,
1554,
580,
13,
13,
14035,
29898,
2158,
29897,
13,
14035,
29898,
3881,
29897,
13,
13,
17255,
2344,
1649,
13,
1649,
2344,
1649,
518,
29906,
29962,
13,
13,
13,
29992,
316,
1111,
869,
4770,
2344,
1649,
313,
4804,
29922,
5372,
29897,
29871,
396,
364,
1061,
13,
1753,
740,
7295,
13,
1678,
1209,
13,
13,
29992,
1990,
5696,
13,
1753,
515,
29918,
5431,
29898,
25932,
29892,
7953,
1125,
13,
1678,
736,
1067,
29879,
29898,
5431,
29892,
2594,
2433,
27975,
1495,
13,
29937,
12141,
292,
363,
6273,
9391,
13,
13,
13,
1545,
29889,
9891,
580,
13,
1545,
29889,
1491,
1545,
29889,
9891,
580,
13,
9891,
2141,
9891,
29906,
2141,
5552,
13,
1545,
29889,
9891,
2141,
5552,
29889,
5552,
29906,
29889,
9891,
29906,
580,
13,
13,
3881,
29898,
5431,
29892,
2594,
29897,
13,
29077,
13,
13,
1649,
13322,
1649,
13,
2158,
1701,
22872,
13,
30013,
641,
7616,
29918,
10971,
580,
470,
29871,
30672,
31823,
233,
175,
165,
232,
168,
185,
236,
136,
173,
580,
470,
10451,
29890,
15995,
29918,
4951,
290,
580,
13,
13,
11227,
13,
13,
1990,
1619,
22709,
29898,
22709,
1125,
13,
1678,
822,
4770,
2344,
12035,
1311,
29892,
1426,
2433,
4102,
760,
29915,
13,
462,
9651,
525,
7496,
760,
29374,
13,
4706,
1583,
29889,
5085,
353,
313,
726,
29892,
29897,
13,
13,
1678,
7953,
29898,
726,
543,
1220,
29871,
29896,
29908,
13,
632,
376,
1220,
29871,
29906,
1159,
13,
13,
1181,
22872,
29898,
3207,
29922,
29878,
29908,
580,
1159,
13,
13,
13,
1753,
285,
7295,
13,
1678,
1596,
29898,
29878,
29908,
580,
1159,
13,
13,
29888,
580,
13,
13,
1753,
7251,
29898,
978,
1125,
13,
1678,
364,
15945,
29908,
14891,
7251,
29991,
13,
1678,
411,
263,
21811,
4266,
4890,
29889,
13,
1678,
9995,
13,
1678,
736,
525,
2918,
525,
718,
1024,
13,
13,
2158,
29898,
2918,
877,
17345,
8785,
13,
2
] |
test/test_stdio.py | razor-1/apns-clerk | 0 | 57747 | # Author <NAME>
# Based on apns-client implementation by <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
if __name__ == '__main__':
import os.path
import sys
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
import unittest
import datetime
from apns_clerk import Session
CERTIFICATE = b"""-----BEGIN CERTIFICATE-----
<KEY>
BgNV<KEY>
-----END CERTIFICATE-----"""
PRIVATE_KEY = b"""-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,3195B956C3AD71F6
g7mfzdit5/<KEY>"""
PRIVATE_PASS = "<PASSWORD>"
class Python26Mixin(object):
""" Adds missing methods to test cases in Python 2.6 environment. """
def assertIsNotNone(self, value, msg=None):
""" Fail if value is None. """
parent = super(Python26Mixin, self)
if hasattr(parent, 'assertIsNotNone'):
parent.assertIsNotNone(value, msg)
else:
if value is None:
raise self.failureException(msg or '%r is None' % value)
class StdIOBackendTest(Python26Mixin, unittest.TestCase):
""" Test stdio features. """
def setUp(self):
self.session = Session(pool="apns_clerk.backends.stdio")
def test_locking(self):
""" Test thread locking mechanism """
lock = self.session.pool.create_lock()
self.assertIsNotNone(lock)
self.assertTrue(hasattr(lock, "acquire"))
self.assertTrue(hasattr(lock, "release"))
lock.acquire()
lock.release()
def test_certificates(self):
""" Test pyOpenSSL certificates. """
cert = self.session.pool.get_certificate({
"cert_string": CERTIFICATE,
"key_string": PRIVATE_KEY,
"passphrase": <PASSWORD>
})
cert2 = self.session.pool.get_certificate({
"cert_string": (CERTIFICATE + b"\n" + PRIVATE_KEY),
"passphrase": PRIVATE_PASS
})
self.assertIsNotNone(cert.get_context())
self.assertEqual(cert, cert2)
def test_outdate(self):
# we are not allowed to do any IO in tests, so no real connections.
# however, it is good idea to test utility functions even with empty pool.
self.session.outdate(datetime.timedelta(seconds=60))
self.session.shutdown()
if __name__ == '__main__':
unittest.main()
| [
1,
396,
13361,
529,
5813,
29958,
13,
29937,
16564,
373,
3095,
1983,
29899,
4645,
5314,
491,
529,
5813,
29958,
13,
29937,
13,
29937,
10413,
21144,
1090,
278,
13380,
19245,
29892,
10079,
29871,
29906,
29889,
29900,
313,
1552,
376,
29931,
293,
1947,
1496,
13,
29937,
366,
1122,
451,
671,
445,
934,
5174,
297,
752,
13036,
411,
278,
19245,
29889,
13,
29937,
887,
1122,
4017,
263,
3509,
310,
278,
19245,
472,
13,
29937,
13,
29937,
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,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
1053,
2897,
29889,
2084,
13,
1678,
1053,
10876,
13,
13,
1678,
10876,
29889,
2084,
29889,
4397,
29898,
359,
29889,
2084,
29889,
25721,
29898,
359,
29889,
2084,
29889,
25721,
22168,
1445,
1649,
4961,
13,
13,
5215,
443,
27958,
13,
5215,
12865,
13,
13,
3166,
3095,
1983,
29918,
695,
5968,
1053,
16441,
13,
13,
13,
29907,
20161,
6545,
2965,
3040,
353,
289,
15945,
29908,
23648,
29933,
17958,
315,
20161,
6545,
2965,
3040,
23648,
13,
29966,
10818,
29958,
13,
29933,
29887,
29940,
29963,
29966,
10818,
29958,
13,
23648,
11794,
315,
20161,
6545,
2965,
3040,
23648,
15945,
29908,
13,
13,
29829,
29963,
3040,
29918,
10818,
353,
289,
15945,
29908,
23648,
29933,
17958,
390,
8132,
349,
3960,
29963,
3040,
14636,
23648,
13,
27893,
29899,
1542,
29901,
29871,
29946,
29892,
1430,
11341,
29979,
7982,
3352,
13,
2287,
29968,
29899,
3401,
29901,
18539,
29899,
29923,
2287,
29941,
29899,
29907,
5371,
29892,
29941,
29896,
29929,
29945,
29933,
29929,
29945,
29953,
29907,
29941,
3035,
29955,
29896,
29943,
29953,
13,
13,
29887,
29955,
29885,
29888,
8849,
277,
29945,
29914,
29966,
10818,
11903,
15945,
13,
13,
29829,
29963,
3040,
29918,
25711,
353,
9872,
25711,
17013,
11903,
13,
13,
13,
1990,
5132,
29906,
29953,
29924,
861,
262,
29898,
3318,
1125,
13,
1678,
9995,
3462,
29879,
4567,
3519,
304,
1243,
4251,
297,
5132,
29871,
29906,
29889,
29953,
5177,
29889,
9995,
13,
13,
1678,
822,
4974,
3624,
3664,
8516,
29898,
1311,
29892,
995,
29892,
10191,
29922,
8516,
1125,
13,
4706,
9995,
29098,
565,
995,
338,
6213,
29889,
9995,
13,
4706,
3847,
353,
2428,
29898,
11980,
29906,
29953,
29924,
861,
262,
29892,
1583,
29897,
13,
4706,
565,
756,
5552,
29898,
3560,
29892,
525,
9294,
3624,
3664,
8516,
29374,
13,
9651,
3847,
29889,
9294,
3624,
3664,
8516,
29898,
1767,
29892,
10191,
29897,
13,
4706,
1683,
29901,
13,
9651,
565,
995,
338,
6213,
29901,
13,
18884,
12020,
1583,
29889,
14057,
545,
2451,
29898,
7645,
470,
14210,
29878,
338,
6213,
29915,
1273,
995,
29897,
13,
13,
13,
1990,
624,
29881,
5971,
5841,
355,
3057,
29898,
11980,
29906,
29953,
29924,
861,
262,
29892,
443,
27958,
29889,
3057,
8259,
1125,
13,
1678,
9995,
4321,
3659,
601,
5680,
29889,
9995,
13,
13,
1678,
822,
731,
3373,
29898,
1311,
1125,
13,
4706,
1583,
29889,
7924,
353,
16441,
29898,
10109,
543,
481,
1983,
29918,
695,
5968,
29889,
1627,
1975,
29889,
23656,
1159,
13,
13,
1678,
822,
1243,
29918,
908,
292,
29898,
1311,
1125,
13,
4706,
9995,
4321,
3244,
7714,
292,
13336,
9995,
13,
4706,
7714,
353,
1583,
29889,
7924,
29889,
10109,
29889,
3258,
29918,
908,
580,
13,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
908,
29897,
13,
4706,
1583,
29889,
9294,
5574,
29898,
5349,
5552,
29898,
908,
29892,
376,
562,
1548,
5783,
13,
4706,
1583,
29889,
9294,
5574,
29898,
5349,
5552,
29898,
908,
29892,
376,
14096,
5783,
13,
13,
4706,
7714,
29889,
562,
1548,
580,
13,
4706,
7714,
29889,
14096,
580,
13,
13,
1678,
822,
1243,
29918,
6327,
928,
1078,
29898,
1311,
1125,
13,
4706,
9995,
4321,
11451,
6585,
18641,
23199,
1078,
29889,
9995,
13,
4706,
2284,
353,
1583,
29889,
7924,
29889,
10109,
29889,
657,
29918,
6327,
8021,
3319,
13,
9651,
376,
6327,
29918,
1807,
1115,
315,
20161,
6545,
2965,
3040,
29892,
13,
9651,
376,
1989,
29918,
1807,
1115,
349,
3960,
29963,
3040,
29918,
10818,
29892,
13,
9651,
376,
3364,
24588,
559,
1115,
529,
25711,
17013,
29958,
13,
4706,
5615,
13,
13,
4706,
2284,
29906,
353,
1583,
29889,
7924,
29889,
10109,
29889,
657,
29918,
6327,
8021,
3319,
13,
9651,
376,
6327,
29918,
1807,
1115,
313,
29907,
20161,
6545,
2965,
3040,
718,
289,
26732,
29876,
29908,
718,
349,
3960,
29963,
3040,
29918,
10818,
511,
13,
9651,
376,
3364,
24588,
559,
1115,
349,
3960,
29963,
3040,
29918,
25711,
13,
4706,
5615,
13,
13,
4706,
1583,
29889,
9294,
3624,
3664,
8516,
29898,
6327,
29889,
657,
29918,
4703,
3101,
13,
4706,
1583,
29889,
9294,
9843,
29898,
6327,
29892,
2284,
29906,
29897,
13,
13,
1678,
822,
1243,
29918,
449,
1256,
29898,
1311,
1125,
13,
4706,
396,
591,
526,
451,
6068,
304,
437,
738,
10663,
297,
6987,
29892,
577,
694,
1855,
12368,
29889,
13,
4706,
396,
3138,
29892,
372,
338,
1781,
2969,
304,
1243,
19725,
3168,
1584,
411,
4069,
11565,
29889,
13,
4706,
1583,
29889,
7924,
29889,
449,
1256,
29898,
12673,
29889,
9346,
287,
2554,
29898,
23128,
29922,
29953,
29900,
876,
13,
4706,
1583,
29889,
7924,
29889,
845,
329,
3204,
580,
13,
13,
13,
361,
4770,
978,
1649,
1275,
525,
1649,
3396,
1649,
2396,
13,
1678,
443,
27958,
29889,
3396,
580,
13,
2
] |
tensorflow_in_action/nlp/2_ptb_gen_idword.py | wdxtub/deep-learning-note | 37 | 31273 | import codecs
import sys
RAW_DATA = "../data/ptb/ptb.train.txt"
VOCAB = "data/ptb.vocab"
OUTPUT_DATA = "data/ptb.train"
# 读取词汇表并建立映射
with codecs.open(VOCAB, "r", "utf-8") as f_vocab:
vocab = [w.strip() for w in f_vocab.readlines()]
word_to_id = {k: v for (k, v) in zip(vocab, range(len(vocab)))}
# 如果出现了被删除的低频词,替换成 <unk>
def get_id(word):
return word_to_id[word] if word in word_to_id else word_to_id["<unk>"]
fin = codecs.open(RAW_DATA, "r", "utf-8")
fout = codecs.open(OUTPUT_DATA, 'w', 'utf-8')
for line in fin:
words = line.strip().split() + ["<eos>"] # 读取单词并添加 <eos> 结束符
# 将每个单词替换为词汇表中的编号
out_line = ' '.join([str(get_id(w)) for w in words]) + '\n'
fout.write(out_line)
fin.close()
fout.close() | [
1,
1053,
775,
2395,
13,
5215,
10876,
13,
13,
4717,
29956,
29918,
14573,
353,
376,
6995,
1272,
29914,
415,
29890,
29914,
415,
29890,
29889,
14968,
29889,
3945,
29908,
13,
29963,
20166,
2882,
353,
376,
1272,
29914,
415,
29890,
29889,
29894,
542,
370,
29908,
13,
12015,
12336,
29918,
14573,
353,
376,
1272,
29914,
415,
29890,
29889,
14968,
29908,
13,
13,
29937,
29871,
235,
178,
190,
30683,
235,
178,
144,
233,
180,
138,
30746,
31666,
30886,
30939,
233,
155,
163,
232,
179,
135,
13,
2541,
775,
2395,
29889,
3150,
29898,
29963,
20166,
2882,
29892,
376,
29878,
613,
376,
9420,
29899,
29947,
1159,
408,
285,
29918,
29894,
542,
370,
29901,
13,
1678,
7931,
370,
353,
518,
29893,
29889,
17010,
580,
363,
281,
297,
285,
29918,
29894,
542,
370,
29889,
949,
9012,
580,
29962,
13,
1742,
29918,
517,
29918,
333,
353,
426,
29895,
29901,
325,
363,
313,
29895,
29892,
325,
29897,
297,
14319,
29898,
29894,
542,
370,
29892,
3464,
29898,
2435,
29898,
29894,
542,
370,
876,
2915,
13,
13,
29937,
29871,
30847,
30801,
30544,
31424,
30743,
31407,
31916,
31152,
30210,
231,
192,
145,
236,
165,
148,
235,
178,
144,
30214,
233,
158,
194,
31640,
30494,
29871,
0,
29871,
13,
1753,
679,
29918,
333,
29898,
1742,
1125,
13,
1678,
736,
1734,
29918,
517,
29918,
333,
29961,
1742,
29962,
565,
1734,
297,
1734,
29918,
517,
29918,
333,
1683,
1734,
29918,
517,
29918,
333,
3366,
0,
376,
29962,
13,
13,
4951,
353,
775,
2395,
29889,
3150,
29898,
4717,
29956,
29918,
14573,
29892,
376,
29878,
613,
376,
9420,
29899,
29947,
1159,
13,
29888,
449,
353,
775,
2395,
29889,
3150,
29898,
12015,
12336,
29918,
14573,
29892,
525,
29893,
742,
525,
9420,
29899,
29947,
1495,
13,
1454,
1196,
297,
1436,
29901,
13,
1678,
3838,
353,
1196,
29889,
17010,
2141,
5451,
580,
718,
6796,
29966,
29872,
359,
29958,
3108,
396,
29871,
235,
178,
190,
30683,
31166,
235,
178,
144,
31666,
31538,
30666,
529,
29872,
359,
29958,
29871,
31320,
233,
160,
162,
31277,
13,
1678,
396,
29871,
30998,
31951,
30502,
31166,
235,
178,
144,
233,
158,
194,
31640,
30573,
235,
178,
144,
233,
180,
138,
30746,
30275,
30210,
31795,
30850,
13,
1678,
714,
29918,
1220,
353,
525,
15300,
7122,
4197,
710,
29898,
657,
29918,
333,
29898,
29893,
876,
363,
281,
297,
3838,
2314,
718,
11297,
29876,
29915,
13,
1678,
285,
449,
29889,
3539,
29898,
449,
29918,
1220,
29897,
13,
4951,
29889,
5358,
580,
13,
29888,
449,
29889,
5358,
580,
2
] |
Subsets and Splits