content
stringlengths 1
1.04M
| input_ids
sequencelengths 1
774k
| ratio_char_token
float64 0.38
22.9
| token_count
int64 1
774k
|
---|---|---|---|
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'mainwindowtest.ui'
#
# Created by: PyQt5 UI code generator 5.15.2
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui, QtWidgets
import resources_rc
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
5178,
7822,
7560,
422,
3555,
334,
72,
2393,
705,
12417,
17497,
9288,
13,
9019,
6,
198,
2,
198,
2,
15622,
416,
25,
9485,
48,
83,
20,
12454,
2438,
17301,
642,
13,
1314,
13,
17,
198,
2,
198,
2,
39410,
25,
4377,
10107,
2458,
925,
284,
428,
2393,
481,
307,
2626,
618,
12972,
84,
291,
20,
318,
198,
2,
1057,
757,
13,
220,
2141,
407,
4370,
428,
2393,
4556,
345,
760,
644,
345,
389,
1804,
13,
628,
198,
6738,
9485,
48,
83,
20,
1330,
33734,
14055,
11,
33734,
8205,
72,
11,
33734,
54,
312,
11407,
198,
198,
11748,
4133,
62,
6015,
198
] | 3.08547 | 117 |
#!/usr/bin/python
#-*- coding: utf-8 -*-
""".. module:: blueprints """
import json
from flask import request, abort, current_app
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
12,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
492,
8265,
3712,
4171,
17190,
37227,
198,
11748,
33918,
198,
198,
6738,
42903,
1330,
2581,
11,
15614,
11,
1459,
62,
1324,
628
] | 2.911111 | 45 |
from rest_framework.permissions import BasePermission, SAFE_METHODS
'''
If the name is arabinda then allow all methods If the name is not arabinda and the name
contains even number of characters then allow only SAFE_METHODS otherwise not allowed
to perform any operation.
'''
| [
6738,
1334,
62,
30604,
13,
525,
8481,
1330,
7308,
5990,
3411,
11,
37630,
36,
62,
49273,
50,
628,
628,
628,
198,
7061,
6,
198,
1532,
262,
1438,
318,
610,
397,
22261,
788,
1249,
477,
5050,
1002,
262,
1438,
318,
407,
610,
397,
22261,
290,
262,
1438,
220,
198,
3642,
1299,
772,
1271,
286,
3435,
788,
1249,
691,
37630,
36,
62,
49273,
50,
4306,
407,
3142,
220,
198,
1462,
1620,
597,
4905,
13,
198,
7061,
6,
198
] | 3.736842 | 76 |
#################################################################################
# Copyright (c) 2018 Creative Sphere Limited.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License v2.0
# which accompanies this distribution, and is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# Contributors:
# Creative Sphere - initial API and implementation
#
#################################################################################
from nRF2401.nRF2401 import *
| [
29113,
29113,
14468,
2,
198,
2,
15069,
357,
66,
8,
2864,
17404,
31798,
15302,
13,
198,
2,
1439,
2489,
10395,
13,
770,
1430,
290,
262,
19249,
5696,
198,
2,
389,
925,
1695,
739,
262,
2846,
286,
262,
24843,
13789,
410,
17,
13,
15,
198,
2,
543,
48159,
428,
6082,
11,
290,
318,
1695,
379,
198,
2,
3740,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
43,
2149,
24290,
12,
17,
13,
15,
198,
2,
198,
2,
220,
25767,
669,
25,
198,
2,
220,
220,
220,
17404,
31798,
532,
4238,
7824,
290,
7822,
198,
2,
198,
29113,
29113,
14468,
2,
198,
198,
6738,
299,
32754,
1731,
486,
13,
77,
32754,
1731,
486,
1330,
1635,
198
] | 4.758621 | 116 |
# test12.py
a = _n('a')
b = _n('b')
c = _n('c')
root = a + a + a^b + b^a + a^(b|c) | [
2,
1332,
1065,
13,
9078,
198,
198,
64,
796,
4808,
77,
10786,
64,
11537,
198,
65,
796,
4808,
77,
10786,
65,
11537,
198,
66,
796,
4808,
77,
10786,
66,
11537,
198,
198,
15763,
796,
257,
1343,
257,
1343,
257,
61,
65,
1343,
275,
61,
64,
1343,
257,
61,
7,
65,
91,
66,
8
] | 1.584906 | 53 |
"""This module is for sending scripts through Adams/PPT
"""
import os
import subprocess
import re
import time
import platform
import jinja2
from numpy import genfromtxt
import matplotlib.pyplot as plt
from thornpy.signal import manually_clean_sig, remove_data_point, manually_clean_sigs, low_pass
from thornpy.signal import _clean_sig as clean_sig
LOG_COMPLETE_PATTERN = '! Command file is exhausted, batch run is finished.'
LUNAR_SCRIPT_NAME = 'get_lunar_results.py'
GET_RESULTS_SCRIPT_NAME = 'get_results.py'
EDIT_RESULTS_SCRIPT_NAME = 'edit_results.py'
TEMP_OUTPUT_FILENAME = 'results.tmp'
LOG_NAME = 'aview.log'
TMPLT_ENV = jinja2.Environment(
loader=jinja2.PackageLoader('adamspy.postprocess', 'aview_scripts'),
autoescape=False,
keep_trailing_newline=True,
trim_blocks=True,
lstrip_blocks=True
)
_TIMEOUT = 300
LOG_FILE_ERROR_PATTERN = '! \\S*Error: '
def get_results(res_file, reqs_to_get, t_min=None, t_max=None, _just_write_script=False, timeout=_TIMEOUT):
"""Gets results from an Adams results (.res) file.
Example
-------
>>> result_file = 'example.res'
>>> t_min = 70
>>> t_max = 80
>>> reqs_to_get = {}
>>> reqs_to_get['MSE'] = ['Instantaneous_Bottom_MSE', 'Filtered_Surface_MSE']
>>> reqs_to_get['ROP_controls'] = ['Command_ROP', 'True_WOB']
>>> requests, units = get_results(result_file, reqs_to_get, t_min, t_max)
Note
----
This funciton only works with Requests. It does not work with Result Sets.
Note
----
This function only works with xml results files.
Parameters
----------
result_file : str
Filename of an Adams results (.res) file
reqs_to_get : dict
Dictionary of requests to extract (the default is None, which gets all results)
t_min : float, optional
Minimum time for which to extract results (the default is None)
t_max : float, optional
Maximum time for which to extract results (the default is None)
Returns
-------
dict
Dictionary of request data
"""
template = TMPLT_ENV.from_string(open(os.path.join(os.path.dirname(__file__), 'aview_scripts', GET_RESULTS_SCRIPT_NAME)).read())
working_directory = os.path.dirname(res_file)
script_filename = _get_unique_filename(GET_RESULTS_SCRIPT_NAME)
output_filename = _get_unique_filename(TEMP_OUTPUT_FILENAME)
with open(os.path.join(working_directory, script_filename), 'w') as fid:
fid.write(template.render({'res_file': os.path.split(res_file)[-1], 'reqs_to_get': reqs_to_get, 't_min': t_min, 't_max': t_max, 'output_file': output_filename}))
if _just_write_script is False:
# Delete the aview.log file
try:
os.remove(os.path.join(working_directory, LOG_NAME))
except FileNotFoundError:
pass
except PermissionError:
pass
# Run the postprocessor
if platform.system() == 'Windows':
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
subprocess.Popen('"{}" aview ru-s b {}'.format(os.environ['ADAMS_LAUNCH_COMMAND'], script_filename), cwd=working_directory, startupinfo=startupinfo)
else:
subprocess.Popen([os.environ['ADAMS_LAUNCH_COMMAND'], '-c', 'aview', 'ru-standard', 'b', script_filename, 'exit'], cwd=working_directory)
# Wait for complete
_wait(os.path.join(working_directory, LOG_NAME), timeout=timeout)
# Check the log file for errors
_get_log_errors(os.path.join(working_directory, LOG_NAME))
# Read and return the results
data = genfromtxt(os.path.join(working_directory, output_filename), delimiter=',', names=True, dtype=None)
os.remove(os.path.join(working_directory, script_filename))
os.remove(os.path.join(working_directory, output_filename))
output_dict = {'time': list(data['time'])}
for res in reqs_to_get:
output_dict[res] = {}
for comp in reqs_to_get[res]:
output_dict[res][comp] = list(data[f'{res}_{comp}'])
return output_dict
def _wait(log_file, sleep_time=0.2, timeout=300):
"""Waits for the log file to write the last line of the macro
Parameters
----------
log_file : str
filename of log file
sleep_time : float, optional
Time between checks, by default 0.2
timeout : int, optional
During after which to time out, by default 300
"""
for _i in range(int(timeout/sleep_time)):
ppt_log_file_exists = os.path.exists(log_file)
if ppt_log_file_exists is True:
# If ppt.log exists, open it and see if the results have been loaded
with open(log_file, 'r') as fid:
text = fid.read()
if re.search(LOG_COMPLETE_PATTERN, text):
break
time.sleep(sleep_time)
def _get_log_errors(log_file):
"""Checks the log file for errors of the type AviewError.
Parameters
----------
log_file : str
Filename of aview log file (usulally aview.log)
"""
with open(log_file, 'r') as fid:
lines = fid.readlines()
for line in lines:
if re.search(LOG_FILE_ERROR_PATTERN, line):
raise AviewError(line[2:])
def manually_remove_spikes(res_file, reqs_to_clean, reqs_to_check=None, t_min=None, t_max=None, _just_write_script=False, timeout=_TIMEOUT, _inplace=False):
"""Allows the user to manually scan through the result sets to pick out points to eliminate.
Parameters
----------
res_file : str
Adams Results (.res) filename
reqs_to_clean : dict, optional
Nested dictionary of result sets and result components to clean
reqs_to_check : dict
Nested dictionary of result sets and result components to check for spikes, by default same as reqs_to_clean
t_min : float, optional
Minumum simulation time to clean, by default None
t_max : float, optional
Maximum simulation time to clean, by default None
timeout : float, optional
Number of seconds to wait for results to load before timing out, by default _TIMEOUT
Returns
-------
dict
Nested dictionary of cleaned results
"""
if reqs_to_check is None:
reqs_to_check = reqs_to_clean
results = get_results(res_file, reqs_to_clean, t_min=t_min, t_max=t_max, _just_write_script=_just_write_script, timeout=timeout)
time_sig = results['time']
# Remove the spikes
for (res, res_comps) in [(r, rc) for r, rc in results.items() if r in reqs_to_check]:
for (res_comp, values) in [(rc, v) for rc, v in res_comps.items() if rc in reqs_to_check[res]]:
results[res][res_comp], i_mod = manually_clean_sig(time_sig, values, indices=True)
# If a modification was made to the signal, make that modification to the rest of the signals
if i_mod != []:
# Loop over all the other results
for (other_res, other_res_comps) in [(r, rc) for r, rc in results.items() if r != 'time']:
for (other_res_comp, other_values) in [(rc, v) for rc, v in other_res_comps.items() if not (other_res == res and rc == res_comp)]: #pylint: disable=no-member
for i in i_mod:
results[other_res][other_res_comp] = remove_data_point(time_sig, other_values, i)
# Update the analysis files
edit_results(res_file, results)
# Return the cleaned results
return results
def filter_results(res_file, reqs_to_clean, freq_cutoff, N_filter=5, reqs_to_check=None, t_min=None, t_max=None, _just_write_script=False, timeout=_TIMEOUT, _inplace=False, return_raw=False):
"""Similar to `manually_remove_spikes`, but allows user to plot the signals in batches. Instead of passing a dictionary for the `reqs_to_check` argument, pass a list of dictionaries and the results in each dictionary in the list will be plotted together.
Parameters
----------
res_file : str
Adams Results (.res) filename
reqs_to_clean : dict
Nested dictionary of result sets and result components to clean
freq_cutoff : float
Cutoff freqency of filter in Hz
N_filter : int
Order of filter
reqs_to_check : list of dicts
list of nested dictionary of result sets and result components to check for spikes, by default same as reqs_to_clean
t_min : float, optional
Minumum simulation time to clean, by default None
t_max : float, optional
Maximum simulation time to clean, by default None
timeout : float, optional
Number of seconds to wait for results to load before timing out, by default _TIMEOUT
Returns
-------
dict
Nested dictionary of cleaned results
"""
if reqs_to_check is None:
reqs_to_check = [reqs_to_clean]
results = get_results(res_file, reqs_to_clean, t_min=t_min, t_max=t_max, _just_write_script=_just_write_script, timeout=timeout)
time_sig = results.pop('time')
filtered_results = {}
for res_name, res_comps in results.items():
filtered_results[res_name] = {}
for res_comp, values in res_comps.items(): # pylint: disable=no-member
cleaned_sig, _, _ = clean_sig(values, 3)
filtered_results[res_name][res_comp], _ = low_pass(cleaned_sig, time_sig, freq_cutoff, N=N_filter)
# Return the cleaned results
if return_raw is True:
return {'time': time_sig, **filtered_results}, {'time': time_sig, **results}
else:
return {'time': time_sig, **filtered_results}
def manually_remove_spikes_batch(res_file, reqs_to_clean, reqs_to_check=None, t_min=None, t_max=None, _just_write_script=False, timeout=_TIMEOUT, _inplace=False):
"""Similar to `manually_remove_spikes`, but allows user to plot the signals in batches. Instead of passing a dictionary for the `reqs_to_check` argument, pass a list of dictionaries and the results in each dictionary in the list will be plotted together.
Parameters
----------
res_file : str
Adams Results (.res) filename
reqs_to_clean : dict
Nested dictionary of result sets and result components to clean
reqs_to_check : list of dicts
list of nested dictionary of result sets and result components to check for spikes, by default same as reqs_to_clean
t_min : float, optional
Minumum simulation time to clean, by default None
t_max : float, optional
Maximum simulation time to clean, by default None
timeout : float, optional
Number of seconds to wait for results to load before timing out, by default _TIMEOUT
Returns
-------
dict
Nested dictionary of cleaned results
"""
if reqs_to_check is None:
reqs_to_check = [reqs_to_clean]
results = get_results(res_file, reqs_to_clean, t_min=t_min, t_max=t_max, _just_write_script=_just_write_script, timeout=timeout)
time_sig = results['time']
# Create a flag indicating if the results have been modified and need to be rewritten
results_modified = False
for batch_to_check in reqs_to_check:
# Make a list/batch of values to clean
values_to_check = []
for (res, res_comps) in [(r, rc) for r, rc in results.items() if r in batch_to_check]:
for (res_comp, values) in [(rc, v) for rc, v in res_comps.items() if rc in batch_to_check[res]]:
values_to_check.append(values)
_, i_mod = manually_clean_sigs(time_sig, values_to_check, indices=True)
# If a modification was made to the signal, make that modification to the rest of the signals
if i_mod != []:
# Loop over all the results
for (res, res_comps) in [(r, rc) for r, rc in results.items() if r != 'time']:
for (res_comp, values) in res_comps.items():
for i in i_mod:
results[res][res_comp] = remove_data_point(time_sig, values, i)
# Flag that the results have been modified
results_modified = True
# If the results were modified, update the analysis files
if results_modified is True:
edit_results(res_file, results)
# Return the cleaned results
return results
class AviewError(Exception):
"""Raise this error to if a known error occurs in the log file.
"""
pass | [
37811,
1212,
8265,
318,
329,
7216,
14750,
832,
12620,
14,
10246,
51,
198,
198,
37811,
198,
11748,
28686,
198,
11748,
850,
14681,
198,
11748,
302,
198,
11748,
640,
198,
11748,
3859,
198,
198,
11748,
474,
259,
6592,
17,
198,
6738,
299,
32152,
1330,
2429,
6738,
14116,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
38999,
9078,
13,
12683,
282,
1330,
14500,
62,
27773,
62,
82,
328,
11,
4781,
62,
7890,
62,
4122,
11,
14500,
62,
27773,
62,
82,
9235,
11,
1877,
62,
6603,
198,
6738,
38999,
9078,
13,
12683,
282,
1330,
4808,
27773,
62,
82,
328,
355,
3424,
62,
82,
328,
628,
198,
25294,
62,
41335,
9328,
62,
47,
1404,
31800,
796,
705,
0,
9455,
2393,
318,
19064,
11,
15458,
1057,
318,
5201,
2637,
198,
198,
43,
4944,
1503,
62,
6173,
46023,
62,
20608,
796,
705,
1136,
62,
75,
403,
283,
62,
43420,
13,
9078,
6,
198,
18851,
62,
46274,
62,
6173,
46023,
62,
20608,
796,
705,
1136,
62,
43420,
13,
9078,
6,
198,
24706,
62,
46274,
62,
6173,
46023,
62,
20608,
796,
705,
19312,
62,
43420,
13,
9078,
6,
198,
51,
39494,
62,
2606,
7250,
3843,
62,
46700,
1677,
10067,
796,
705,
43420,
13,
22065,
6,
198,
198,
25294,
62,
20608,
796,
705,
615,
769,
13,
6404,
6,
198,
198,
15972,
6489,
51,
62,
1677,
53,
796,
474,
259,
6592,
17,
13,
31441,
7,
198,
220,
220,
220,
40213,
28,
18594,
6592,
17,
13,
27813,
17401,
10786,
324,
321,
2777,
88,
13,
7353,
14681,
3256,
705,
615,
769,
62,
46521,
33809,
198,
220,
220,
220,
1960,
3028,
36435,
28,
25101,
11,
198,
220,
220,
220,
1394,
62,
9535,
4386,
62,
3605,
1370,
28,
17821,
11,
198,
220,
220,
220,
15797,
62,
27372,
28,
17821,
11,
198,
220,
220,
220,
300,
36311,
62,
27372,
28,
17821,
198,
8,
198,
198,
62,
34694,
12425,
796,
5867,
198,
25294,
62,
25664,
62,
24908,
62,
47,
1404,
31800,
796,
705,
0,
26867,
50,
9,
12331,
25,
705,
198,
198,
4299,
651,
62,
43420,
7,
411,
62,
7753,
11,
43089,
82,
62,
1462,
62,
1136,
11,
256,
62,
1084,
28,
14202,
11,
256,
62,
9806,
28,
14202,
11,
4808,
3137,
62,
13564,
62,
12048,
28,
25101,
11,
26827,
28,
62,
34694,
12425,
2599,
198,
220,
220,
220,
37227,
38,
1039,
2482,
422,
281,
12620,
2482,
20262,
411,
8,
2393,
13,
198,
197,
198,
197,
16281,
198,
197,
26866,
198,
197,
33409,
1255,
62,
7753,
796,
705,
20688,
13,
411,
6,
198,
197,
33409,
256,
62,
1084,
796,
4317,
198,
197,
33409,
256,
62,
9806,
796,
4019,
198,
197,
33409,
43089,
82,
62,
1462,
62,
1136,
796,
23884,
198,
197,
33409,
43089,
82,
62,
1462,
62,
1136,
17816,
44,
5188,
20520,
796,
37250,
49933,
11655,
62,
34104,
62,
44,
5188,
3256,
705,
11928,
4400,
62,
14214,
2550,
62,
44,
5188,
20520,
198,
197,
33409,
43089,
82,
62,
1462,
62,
1136,
17816,
49,
3185,
62,
13716,
82,
20520,
796,
37250,
21575,
62,
49,
3185,
3256,
705,
17821,
62,
54,
9864,
20520,
198,
197,
33409,
7007,
11,
4991,
796,
651,
62,
43420,
7,
20274,
62,
7753,
11,
43089,
82,
62,
1462,
62,
1136,
11,
256,
62,
1084,
11,
256,
62,
9806,
8,
628,
197,
6425,
198,
197,
650,
198,
197,
1212,
25439,
37752,
691,
2499,
351,
9394,
3558,
13,
220,
632,
857,
407,
670,
351,
25414,
21394,
13,
628,
197,
6425,
198,
197,
650,
198,
197,
1212,
2163,
691,
2499,
351,
35555,
2482,
3696,
13,
198,
197,
198,
197,
48944,
198,
197,
35937,
198,
197,
20274,
62,
7753,
1058,
965,
198,
197,
197,
35063,
286,
281,
12620,
2482,
20262,
411,
8,
2393,
198,
197,
42180,
82,
62,
1462,
62,
1136,
1058,
8633,
198,
197,
197,
35,
14188,
286,
7007,
284,
7925,
357,
1169,
4277,
318,
6045,
11,
543,
3011,
477,
2482,
8,
198,
197,
83,
62,
1084,
1058,
12178,
11,
11902,
198,
197,
197,
44046,
640,
329,
543,
284,
7925,
2482,
357,
1169,
4277,
318,
6045,
8,
198,
197,
83,
62,
9806,
1058,
12178,
11,
11902,
198,
197,
197,
40541,
640,
329,
543,
284,
7925,
2482,
357,
1169,
4277,
318,
6045,
8,
198,
197,
198,
197,
35561,
198,
197,
26866,
198,
197,
11600,
198,
197,
197,
35,
14188,
286,
2581,
1366,
198,
197,
198,
197,
37811,
198,
220,
220,
220,
11055,
796,
21232,
6489,
51,
62,
1677,
53,
13,
6738,
62,
8841,
7,
9654,
7,
418,
13,
6978,
13,
22179,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
828,
705,
615,
769,
62,
46521,
3256,
17151,
62,
46274,
62,
6173,
46023,
62,
20608,
29720,
961,
28955,
198,
220,
220,
220,
1762,
62,
34945,
796,
28686,
13,
6978,
13,
15908,
3672,
7,
411,
62,
7753,
8,
628,
198,
220,
220,
220,
4226,
62,
34345,
796,
4808,
1136,
62,
34642,
62,
34345,
7,
18851,
62,
46274,
62,
6173,
46023,
62,
20608,
8,
198,
220,
220,
220,
5072,
62,
34345,
796,
4808,
1136,
62,
34642,
62,
34345,
7,
51,
39494,
62,
2606,
7250,
3843,
62,
46700,
1677,
10067,
8,
198,
220,
220,
220,
220,
198,
220,
220,
220,
351,
1280,
7,
418,
13,
6978,
13,
22179,
7,
16090,
62,
34945,
11,
4226,
62,
34345,
828,
705,
86,
11537,
355,
49909,
25,
198,
220,
220,
220,
220,
220,
220,
220,
49909,
13,
13564,
7,
28243,
13,
13287,
15090,
6,
411,
62,
7753,
10354,
28686,
13,
6978,
13,
35312,
7,
411,
62,
7753,
38381,
12,
16,
4357,
705,
42180,
82,
62,
1462,
62,
1136,
10354,
43089,
82,
62,
1462,
62,
1136,
11,
705,
83,
62,
1084,
10354,
256,
62,
1084,
11,
705,
83,
62,
9806,
10354,
256,
62,
9806,
11,
705,
22915,
62,
7753,
10354,
5072,
62,
34345,
92,
4008,
628,
220,
220,
220,
611,
4808,
3137,
62,
13564,
62,
12048,
318,
10352,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
23520,
262,
257,
1177,
13,
6404,
2393,
198,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
28686,
13,
28956,
7,
418,
13,
6978,
13,
22179,
7,
16090,
62,
34945,
11,
41605,
62,
20608,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
2845,
9220,
3673,
21077,
12331,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1208,
198,
220,
220,
220,
220,
220,
220,
220,
2845,
2448,
3411,
12331,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1208,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
5660,
262,
1281,
41341,
198,
220,
220,
220,
220,
220,
220,
220,
611,
3859,
13,
10057,
3419,
6624,
705,
11209,
10354,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13693,
10951,
796,
850,
14681,
13,
2257,
7227,
8577,
10778,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13693,
10951,
13,
67,
86,
40053,
930,
28,
850,
14681,
13,
2257,
7227,
37,
62,
2937,
1546,
37181,
28929,
3913,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
850,
14681,
13,
47,
9654,
10786,
1,
90,
36786,
257,
1177,
7422,
12,
82,
275,
23884,
4458,
18982,
7,
418,
13,
268,
2268,
17816,
2885,
40834,
62,
13534,
47461,
62,
9858,
44,
6981,
6,
4357,
4226,
62,
34345,
828,
269,
16993,
28,
16090,
62,
34945,
11,
13693,
10951,
28,
9688,
929,
10951,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
850,
14681,
13,
47,
9654,
26933,
418,
13,
268,
2268,
17816,
2885,
40834,
62,
13534,
47461,
62,
9858,
44,
6981,
6,
4357,
705,
12,
66,
3256,
705,
615,
769,
3256,
705,
622,
12,
20307,
3256,
705,
65,
3256,
4226,
62,
34345,
11,
705,
37023,
6,
4357,
269,
16993,
28,
16090,
62,
34945,
8,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
16314,
329,
1844,
198,
220,
220,
220,
220,
220,
220,
220,
4808,
17077,
7,
418,
13,
6978,
13,
22179,
7,
16090,
62,
34945,
11,
41605,
62,
20608,
828,
26827,
28,
48678,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
6822,
262,
2604,
2393,
329,
8563,
198,
220,
220,
220,
220,
220,
220,
220,
4808,
1136,
62,
6404,
62,
48277,
7,
418,
13,
6978,
13,
22179,
7,
16090,
62,
34945,
11,
41605,
62,
20608,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
4149,
290,
1441,
262,
2482,
198,
220,
220,
220,
220,
220,
220,
220,
1366,
796,
2429,
6738,
14116,
7,
418,
13,
6978,
13,
22179,
7,
16090,
62,
34945,
11,
5072,
62,
34345,
828,
46728,
2676,
28,
3256,
3256,
3891,
28,
17821,
11,
288,
4906,
28,
14202,
8,
628,
220,
220,
220,
220,
220,
220,
220,
28686,
13,
28956,
7,
418,
13,
6978,
13,
22179,
7,
16090,
62,
34945,
11,
4226,
62,
34345,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
28686,
13,
28956,
7,
418,
13,
6978,
13,
22179,
7,
16090,
62,
34945,
11,
5072,
62,
34345,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
5072,
62,
11600,
796,
1391,
6,
2435,
10354,
1351,
7,
7890,
17816,
2435,
6,
12962,
92,
198,
220,
220,
220,
220,
220,
220,
220,
329,
581,
287,
43089,
82,
62,
1462,
62,
1136,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5072,
62,
11600,
58,
411,
60,
796,
23884,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
552,
287,
43089,
82,
62,
1462,
62,
1136,
58,
411,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5072,
62,
11600,
58,
411,
7131,
5589,
60,
796,
1351,
7,
7890,
58,
69,
6,
90,
411,
92,
23330,
5589,
92,
6,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
5072,
62,
11600,
198,
198,
4299,
4808,
17077,
7,
6404,
62,
7753,
11,
3993,
62,
2435,
28,
15,
13,
17,
11,
26827,
28,
6200,
2599,
198,
220,
220,
220,
37227,
33484,
896,
329,
262,
2604,
2393,
284,
3551,
262,
938,
1627,
286,
262,
15021,
198,
220,
220,
220,
220,
198,
220,
220,
220,
40117,
198,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
2604,
62,
7753,
1058,
965,
198,
220,
220,
220,
220,
220,
220,
220,
29472,
286,
2604,
2393,
198,
220,
220,
220,
3993,
62,
2435,
1058,
12178,
11,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
3862,
1022,
8794,
11,
416,
4277,
657,
13,
17,
198,
220,
220,
220,
26827,
1058,
493,
11,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
5856,
706,
543,
284,
640,
503,
11,
416,
4277,
5867,
628,
220,
220,
220,
37227,
220,
220,
220,
220,
628,
220,
220,
220,
329,
4808,
72,
287,
2837,
7,
600,
7,
48678,
14,
42832,
62,
2435,
8,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
279,
457,
62,
6404,
62,
7753,
62,
1069,
1023,
796,
28686,
13,
6978,
13,
1069,
1023,
7,
6404,
62,
7753,
8,
220,
220,
220,
220,
220,
220,
220,
628,
220,
220,
220,
220,
220,
220,
220,
611,
279,
457,
62,
6404,
62,
7753,
62,
1069,
1023,
318,
6407,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
1002,
279,
457,
13,
6404,
7160,
11,
1280,
340,
290,
766,
611,
262,
2482,
423,
587,
9639,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
351,
1280,
7,
6404,
62,
7753,
11,
705,
81,
11537,
355,
49909,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2420,
796,
49909,
13,
961,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
302,
13,
12947,
7,
25294,
62,
41335,
9328,
62,
47,
1404,
31800,
11,
2420,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2270,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
640,
13,
42832,
7,
42832,
62,
2435,
8,
198,
198,
4299,
4808,
1136,
62,
6404,
62,
48277,
7,
6404,
62,
7753,
2599,
198,
220,
220,
220,
37227,
7376,
4657,
262,
2604,
2393,
329,
8563,
286,
262,
2099,
317,
1177,
12331,
13,
198,
220,
220,
220,
220,
198,
220,
220,
220,
40117,
198,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
2604,
62,
7753,
1058,
965,
198,
220,
220,
220,
220,
220,
220,
220,
7066,
12453,
286,
257,
1177,
2604,
2393,
357,
385,
377,
453,
257,
1177,
13,
6404,
8,
628,
220,
220,
220,
37227,
198,
220,
220,
220,
351,
1280,
7,
6404,
62,
7753,
11,
705,
81,
11537,
355,
49909,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3951,
796,
49909,
13,
961,
6615,
3419,
198,
220,
220,
220,
220,
198,
220,
220,
220,
329,
1627,
287,
3951,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
302,
13,
12947,
7,
25294,
62,
25664,
62,
24908,
62,
47,
1404,
31800,
11,
1627,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
317,
1177,
12331,
7,
1370,
58,
17,
25,
12962,
220,
220,
220,
220,
220,
220,
220,
220,
198,
198,
4299,
14500,
62,
28956,
62,
2777,
7938,
7,
411,
62,
7753,
11,
43089,
82,
62,
1462,
62,
27773,
11,
43089,
82,
62,
1462,
62,
9122,
28,
14202,
11,
256,
62,
1084,
28,
14202,
11,
256,
62,
9806,
28,
14202,
11,
4808,
3137,
62,
13564,
62,
12048,
28,
25101,
11,
26827,
28,
62,
34694,
12425,
11,
4808,
259,
5372,
28,
25101,
2599,
198,
220,
220,
220,
37227,
34934,
262,
2836,
284,
14500,
9367,
832,
262,
1255,
5621,
284,
2298,
503,
2173,
284,
11005,
13,
628,
220,
220,
220,
40117,
198,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
581,
62,
7753,
1058,
965,
198,
220,
220,
220,
220,
220,
220,
220,
12620,
15691,
20262,
411,
8,
29472,
220,
198,
220,
220,
220,
43089,
82,
62,
1462,
62,
27773,
1058,
8633,
11,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
399,
7287,
22155,
286,
1255,
5621,
290,
1255,
6805,
284,
3424,
198,
220,
220,
220,
43089,
82,
62,
1462,
62,
9122,
1058,
8633,
198,
220,
220,
220,
220,
220,
220,
220,
399,
7287,
22155,
286,
1255,
5621,
290,
1255,
6805,
284,
2198,
329,
27198,
11,
416,
4277,
976,
355,
43089,
82,
62,
1462,
62,
27773,
198,
220,
220,
220,
256,
62,
1084,
1058,
12178,
11,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
1855,
388,
388,
18640,
640,
284,
3424,
11,
416,
4277,
6045,
198,
220,
220,
220,
256,
62,
9806,
1058,
12178,
11,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
22246,
18640,
640,
284,
3424,
11,
416,
4277,
6045,
198,
220,
220,
220,
26827,
1058,
12178,
11,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
7913,
286,
4201,
284,
4043,
329,
2482,
284,
3440,
878,
10576,
503,
11,
416,
4277,
4808,
34694,
12425,
628,
220,
220,
220,
16409,
198,
220,
220,
220,
35656,
198,
220,
220,
220,
8633,
198,
220,
220,
220,
220,
220,
220,
220,
399,
7287,
22155,
286,
20750,
2482,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
611,
43089,
82,
62,
1462,
62,
9122,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
43089,
82,
62,
1462,
62,
9122,
796,
43089,
82,
62,
1462,
62,
27773,
628,
220,
220,
220,
2482,
796,
651,
62,
43420,
7,
411,
62,
7753,
11,
43089,
82,
62,
1462,
62,
27773,
11,
256,
62,
1084,
28,
83,
62,
1084,
11,
256,
62,
9806,
28,
83,
62,
9806,
11,
4808,
3137,
62,
13564,
62,
12048,
28,
62,
3137,
62,
13564,
62,
12048,
11,
26827,
28,
48678,
8,
198,
220,
220,
220,
220,
198,
220,
220,
220,
640,
62,
82,
328,
796,
2482,
17816,
2435,
20520,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
17220,
262,
27198,
198,
220,
220,
220,
329,
357,
411,
11,
581,
62,
785,
862,
8,
287,
47527,
81,
11,
48321,
8,
329,
374,
11,
48321,
287,
2482,
13,
23814,
3419,
611,
374,
287,
43089,
82,
62,
1462,
62,
9122,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
329,
357,
411,
62,
5589,
11,
3815,
8,
287,
47527,
6015,
11,
410,
8,
329,
48321,
11,
410,
287,
581,
62,
785,
862,
13,
23814,
3419,
611,
48321,
287,
43089,
82,
62,
1462,
62,
9122,
58,
411,
60,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2482,
58,
411,
7131,
411,
62,
5589,
4357,
1312,
62,
4666,
796,
14500,
62,
27773,
62,
82,
328,
7,
2435,
62,
82,
328,
11,
3815,
11,
36525,
28,
17821,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
1002,
257,
17613,
373,
925,
284,
262,
6737,
11,
787,
326,
17613,
284,
262,
1334,
286,
262,
10425,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
1312,
62,
4666,
14512,
685,
5974,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
26304,
625,
477,
262,
584,
2482,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
357,
847,
62,
411,
11,
584,
62,
411,
62,
785,
862,
8,
287,
47527,
81,
11,
48321,
8,
329,
374,
11,
48321,
287,
2482,
13,
23814,
3419,
611,
374,
14512,
705,
2435,
6,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
357,
847,
62,
411,
62,
5589,
11,
584,
62,
27160,
8,
287,
47527,
6015,
11,
410,
8,
329,
48321,
11,
410,
287,
584,
62,
411,
62,
785,
862,
13,
23814,
3419,
611,
407,
357,
847,
62,
411,
6624,
581,
290,
48321,
6624,
581,
62,
5589,
8,
5974,
1303,
79,
2645,
600,
25,
15560,
28,
3919,
12,
19522,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
287,
1312,
62,
4666,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2482,
58,
847,
62,
411,
7131,
847,
62,
411,
62,
5589,
60,
796,
4781,
62,
7890,
62,
4122,
7,
2435,
62,
82,
328,
11,
584,
62,
27160,
11,
1312,
8,
628,
220,
220,
220,
1303,
10133,
262,
3781,
3696,
198,
220,
220,
220,
4370,
62,
43420,
7,
411,
62,
7753,
11,
2482,
8,
628,
220,
220,
220,
1303,
8229,
262,
20750,
2482,
198,
220,
220,
220,
1441,
2482,
198,
198,
4299,
8106,
62,
43420,
7,
411,
62,
7753,
11,
43089,
82,
62,
1462,
62,
27773,
11,
2030,
80,
62,
8968,
2364,
11,
399,
62,
24455,
28,
20,
11,
43089,
82,
62,
1462,
62,
9122,
28,
14202,
11,
256,
62,
1084,
28,
14202,
11,
256,
62,
9806,
28,
14202,
11,
4808,
3137,
62,
13564,
62,
12048,
28,
25101,
11,
26827,
28,
62,
34694,
12425,
11,
4808,
259,
5372,
28,
25101,
11,
1441,
62,
1831,
28,
25101,
2599,
198,
220,
220,
220,
37227,
18925,
284,
4600,
805,
935,
62,
28956,
62,
2777,
7938,
47671,
475,
3578,
2836,
284,
7110,
262,
10425,
287,
37830,
13,
220,
5455,
286,
6427,
257,
22155,
329,
262,
4600,
42180,
82,
62,
1462,
62,
9122,
63,
4578,
11,
1208,
257,
1351,
286,
48589,
3166,
290,
262,
2482,
287,
1123,
22155,
287,
262,
1351,
481,
307,
37515,
1978,
13,
628,
220,
220,
220,
40117,
198,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
581,
62,
7753,
1058,
965,
198,
220,
220,
220,
220,
220,
220,
220,
12620,
15691,
20262,
411,
8,
29472,
220,
198,
220,
220,
220,
43089,
82,
62,
1462,
62,
27773,
1058,
8633,
198,
220,
220,
220,
220,
220,
220,
220,
399,
7287,
22155,
286,
1255,
5621,
290,
1255,
6805,
284,
3424,
198,
220,
220,
220,
2030,
80,
62,
8968,
2364,
1058,
12178,
198,
220,
220,
220,
220,
220,
220,
220,
9712,
2364,
2030,
80,
1387,
286,
8106,
287,
26109,
198,
220,
220,
220,
399,
62,
24455,
1058,
493,
198,
220,
220,
220,
220,
220,
220,
220,
8284,
286,
8106,
198,
220,
220,
220,
43089,
82,
62,
1462,
62,
9122,
1058,
1351,
286,
8633,
82,
198,
220,
220,
220,
220,
220,
220,
220,
1351,
286,
28376,
22155,
286,
1255,
5621,
290,
1255,
6805,
284,
2198,
329,
27198,
11,
416,
4277,
976,
355,
43089,
82,
62,
1462,
62,
27773,
198,
220,
220,
220,
256,
62,
1084,
1058,
12178,
11,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
1855,
388,
388,
18640,
640,
284,
3424,
11,
416,
4277,
6045,
198,
220,
220,
220,
256,
62,
9806,
1058,
12178,
11,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
22246,
18640,
640,
284,
3424,
11,
416,
4277,
6045,
198,
220,
220,
220,
26827,
1058,
12178,
11,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
7913,
286,
4201,
284,
4043,
329,
2482,
284,
3440,
878,
10576,
503,
11,
416,
4277,
4808,
34694,
12425,
628,
220,
220,
220,
16409,
198,
220,
220,
220,
35656,
198,
220,
220,
220,
8633,
198,
220,
220,
220,
220,
220,
220,
220,
399,
7287,
22155,
286,
20750,
2482,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
611,
43089,
82,
62,
1462,
62,
9122,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
43089,
82,
62,
1462,
62,
9122,
796,
685,
42180,
82,
62,
1462,
62,
27773,
60,
628,
220,
220,
220,
2482,
796,
651,
62,
43420,
7,
411,
62,
7753,
11,
43089,
82,
62,
1462,
62,
27773,
11,
256,
62,
1084,
28,
83,
62,
1084,
11,
256,
62,
9806,
28,
83,
62,
9806,
11,
4808,
3137,
62,
13564,
62,
12048,
28,
62,
3137,
62,
13564,
62,
12048,
11,
26827,
28,
48678,
8,
220,
220,
220,
220,
198,
220,
220,
220,
640,
62,
82,
328,
796,
2482,
13,
12924,
10786,
2435,
11537,
628,
220,
220,
220,
29083,
62,
43420,
796,
23884,
198,
220,
220,
220,
329,
581,
62,
3672,
11,
581,
62,
785,
862,
287,
2482,
13,
23814,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
29083,
62,
43420,
58,
411,
62,
3672,
60,
796,
23884,
198,
220,
220,
220,
220,
220,
220,
220,
329,
581,
62,
5589,
11,
3815,
287,
581,
62,
785,
862,
13,
23814,
33529,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
279,
2645,
600,
25,
15560,
28,
3919,
12,
19522,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
20750,
62,
82,
328,
11,
4808,
11,
4808,
796,
3424,
62,
82,
328,
7,
27160,
11,
513,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
29083,
62,
43420,
58,
411,
62,
3672,
7131,
411,
62,
5589,
4357,
4808,
796,
1877,
62,
6603,
7,
2375,
22739,
62,
82,
328,
11,
640,
62,
82,
328,
11,
2030,
80,
62,
8968,
2364,
11,
399,
28,
45,
62,
24455,
8,
628,
220,
220,
220,
1303,
8229,
262,
20750,
2482,
198,
220,
220,
220,
611,
1441,
62,
1831,
318,
6407,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
1391,
6,
2435,
10354,
640,
62,
82,
328,
11,
12429,
10379,
4400,
62,
43420,
5512,
1391,
6,
2435,
10354,
640,
62,
82,
328,
11,
12429,
43420,
92,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
1391,
6,
2435,
10354,
640,
62,
82,
328,
11,
12429,
10379,
4400,
62,
43420,
92,
220,
198,
198,
4299,
14500,
62,
28956,
62,
2777,
7938,
62,
43501,
7,
411,
62,
7753,
11,
43089,
82,
62,
1462,
62,
27773,
11,
43089,
82,
62,
1462,
62,
9122,
28,
14202,
11,
256,
62,
1084,
28,
14202,
11,
256,
62,
9806,
28,
14202,
11,
4808,
3137,
62,
13564,
62,
12048,
28,
25101,
11,
26827,
28,
62,
34694,
12425,
11,
4808,
259,
5372,
28,
25101,
2599,
198,
220,
220,
220,
37227,
18925,
284,
4600,
805,
935,
62,
28956,
62,
2777,
7938,
47671,
475,
3578,
2836,
284,
7110,
262,
10425,
287,
37830,
13,
220,
5455,
286,
6427,
257,
22155,
329,
262,
4600,
42180,
82,
62,
1462,
62,
9122,
63,
4578,
11,
1208,
257,
1351,
286,
48589,
3166,
290,
262,
2482,
287,
1123,
22155,
287,
262,
1351,
481,
307,
37515,
1978,
13,
628,
220,
220,
220,
40117,
198,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
581,
62,
7753,
1058,
965,
198,
220,
220,
220,
220,
220,
220,
220,
12620,
15691,
20262,
411,
8,
29472,
220,
198,
220,
220,
220,
43089,
82,
62,
1462,
62,
27773,
1058,
8633,
198,
220,
220,
220,
220,
220,
220,
220,
399,
7287,
22155,
286,
1255,
5621,
290,
1255,
6805,
284,
3424,
198,
220,
220,
220,
43089,
82,
62,
1462,
62,
9122,
1058,
1351,
286,
8633,
82,
198,
220,
220,
220,
220,
220,
220,
220,
1351,
286,
28376,
22155,
286,
1255,
5621,
290,
1255,
6805,
284,
2198,
329,
27198,
11,
416,
4277,
976,
355,
43089,
82,
62,
1462,
62,
27773,
198,
220,
220,
220,
256,
62,
1084,
1058,
12178,
11,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
1855,
388,
388,
18640,
640,
284,
3424,
11,
416,
4277,
6045,
198,
220,
220,
220,
256,
62,
9806,
1058,
12178,
11,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
22246,
18640,
640,
284,
3424,
11,
416,
4277,
6045,
198,
220,
220,
220,
26827,
1058,
12178,
11,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
7913,
286,
4201,
284,
4043,
329,
2482,
284,
3440,
878,
10576,
503,
11,
416,
4277,
4808,
34694,
12425,
628,
220,
220,
220,
16409,
198,
220,
220,
220,
35656,
198,
220,
220,
220,
8633,
198,
220,
220,
220,
220,
220,
220,
220,
399,
7287,
22155,
286,
20750,
2482,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
611,
43089,
82,
62,
1462,
62,
9122,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
43089,
82,
62,
1462,
62,
9122,
796,
685,
42180,
82,
62,
1462,
62,
27773,
60,
628,
220,
220,
220,
2482,
796,
651,
62,
43420,
7,
411,
62,
7753,
11,
43089,
82,
62,
1462,
62,
27773,
11,
256,
62,
1084,
28,
83,
62,
1084,
11,
256,
62,
9806,
28,
83,
62,
9806,
11,
4808,
3137,
62,
13564,
62,
12048,
28,
62,
3137,
62,
13564,
62,
12048,
11,
26827,
28,
48678,
8,
198,
220,
220,
220,
220,
198,
220,
220,
220,
640,
62,
82,
328,
796,
2482,
17816,
2435,
20520,
628,
220,
220,
220,
1303,
13610,
257,
6056,
12739,
611,
262,
2482,
423,
587,
9518,
290,
761,
284,
307,
30101,
198,
220,
220,
220,
2482,
62,
41771,
796,
10352,
628,
220,
220,
220,
329,
15458,
62,
1462,
62,
9122,
287,
43089,
82,
62,
1462,
62,
9122,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
6889,
257,
1351,
14,
43501,
286,
3815,
284,
3424,
198,
220,
220,
220,
220,
220,
220,
220,
3815,
62,
1462,
62,
9122,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
329,
357,
411,
11,
581,
62,
785,
862,
8,
287,
47527,
81,
11,
48321,
8,
329,
374,
11,
48321,
287,
2482,
13,
23814,
3419,
611,
374,
287,
15458,
62,
1462,
62,
9122,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
357,
411,
62,
5589,
11,
3815,
8,
287,
47527,
6015,
11,
410,
8,
329,
48321,
11,
410,
287,
581,
62,
785,
862,
13,
23814,
3419,
611,
48321,
287,
15458,
62,
1462,
62,
9122,
58,
411,
60,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3815,
62,
1462,
62,
9122,
13,
33295,
7,
27160,
8,
628,
220,
220,
220,
220,
220,
220,
220,
4808,
11,
1312,
62,
4666,
796,
14500,
62,
27773,
62,
82,
9235,
7,
2435,
62,
82,
328,
11,
3815,
62,
1462,
62,
9122,
11,
36525,
28,
17821,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
1002,
257,
17613,
373,
925,
284,
262,
6737,
11,
787,
326,
17613,
284,
262,
1334,
286,
262,
10425,
198,
220,
220,
220,
220,
220,
220,
220,
611,
1312,
62,
4666,
14512,
685,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
26304,
625,
477,
262,
2482,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
357,
411,
11,
581,
62,
785,
862,
8,
287,
47527,
81,
11,
48321,
8,
329,
374,
11,
48321,
287,
2482,
13,
23814,
3419,
611,
374,
14512,
705,
2435,
6,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
357,
411,
62,
5589,
11,
3815,
8,
287,
581,
62,
785,
862,
13,
23814,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
287,
1312,
62,
4666,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2482,
58,
411,
7131,
411,
62,
5589,
60,
796,
4781,
62,
7890,
62,
4122,
7,
2435,
62,
82,
328,
11,
3815,
11,
1312,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
19762,
326,
262,
2482,
423,
587,
9518,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2482,
62,
41771,
796,
6407,
628,
220,
220,
220,
1303,
1002,
262,
2482,
547,
9518,
11,
4296,
262,
3781,
3696,
198,
220,
220,
220,
611,
2482,
62,
41771,
318,
6407,
25,
198,
220,
220,
220,
220,
220,
220,
220,
4370,
62,
43420,
7,
411,
62,
7753,
11,
2482,
8,
628,
220,
220,
220,
1303,
8229,
262,
20750,
2482,
198,
220,
220,
220,
1441,
2482,
198,
198,
4871,
317,
1177,
12331,
7,
16922,
2599,
198,
220,
220,
220,
37227,
21762,
786,
428,
4049,
284,
611,
257,
1900,
4049,
8833,
287,
262,
2604,
2393,
13,
198,
220,
220,
220,
220,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1208
] | 2.476938 | 5,095 |
"""
Move this to wherever once we establish a setup for the Application Framework
"""
import re
from collections import deque
from typing import Callable, Deque
from time import perf_counter
from cloudcix_metrics import prepare_metrics
from django.http.response import HttpResponseBase
from rest_framework.request import Request
from metrics.client_ip import post_client_ip
from metrics.response_time import post_response_time
GetResponseType = Callable[[Request], HttpResponseBase]
class OpenAPIDeepObjectParserMiddleware:
"""
This middleware will transform the GET parameters received from the user and turn any OAPI deepObject types into
nested dictionaries
OAPI deepObject example: ?search[name]=yes&exclude[name]=no
Turning these into nested dictionaries makes the search and exclude validation a lot easier
"""
def __init__(self, get_response: GetResponseType) -> None:
"""
Set up this middleware class
:param get_response: A callable that calls the next part in the chain.
This might be another middleware or the view itself.
"""
self.get_response = get_response
self.pattern = re.compile(r'(?P<dict>[a-zA-z][a-zA-Z0-9]+)\[(?P<key>.+)\]')
def __call__(self, request: Request) -> HttpResponseBase:
"""
This method is run when the middleware is called by Django
:param request: The current request object passed from the last part of the chain
:returns: The response to be returned to the user
"""
# Before we pass on the request, we should alter the GET params
# Find all deepObject style params and transform them
new_get = request.GET.copy()
transformed: Deque = deque()
for k in request.GET.keys():
match = self.pattern.match(k)
if match:
# Attempt to get the named dict
new_get.setdefault(match['dict'], {})[match['key']] = request.GET[k]
transformed.append(k)
for k in transformed:
new_get.pop(k)
request.GET = new_get
# Now pass the request to the next part of the chain and return what
# comes back
return self.get_response(request)
class MetricsMiddleware:
"""
This middleware will handle the generation and logging of response time metrics to our influx instance
"""
def __init__(self, get_response: GetResponseType) -> None:
"""
Set up this middleware class
:param get_response: A callable that calls the next part in the chain.
This might be another middleware or the view itself.
"""
self.get_response = get_response
def __call__(self, request: Request) -> HttpResponseBase:
"""
This method is run when the middleware is called by Django to deal with metrics
:param request: The current request object passed from the last part of the chain
:returns: The response to be returned to the user
"""
start = perf_counter()
response = self.get_response(request)
time = perf_counter() - start
prepare_metrics(post_response_time, time=time, response=response, request=request)
prepare_metrics(post_client_ip, response=response, request=request)
return response
| [
37811,
198,
21774,
428,
284,
14530,
1752,
356,
4474,
257,
9058,
329,
262,
15678,
25161,
198,
37811,
198,
11748,
302,
198,
6738,
17268,
1330,
390,
4188,
198,
6738,
19720,
1330,
4889,
540,
11,
1024,
4188,
198,
6738,
640,
1330,
23035,
62,
24588,
198,
198,
6738,
6279,
66,
844,
62,
4164,
10466,
1330,
8335,
62,
4164,
10466,
198,
6738,
42625,
14208,
13,
4023,
13,
26209,
1330,
367,
29281,
31077,
14881,
198,
6738,
1334,
62,
30604,
13,
25927,
1330,
19390,
198,
198,
6738,
20731,
13,
16366,
62,
541,
1330,
1281,
62,
16366,
62,
541,
198,
6738,
20731,
13,
26209,
62,
2435,
1330,
1281,
62,
26209,
62,
2435,
198,
198,
3855,
31077,
6030,
796,
4889,
540,
30109,
18453,
4357,
367,
29281,
31077,
14881,
60,
628,
198,
4871,
4946,
2969,
2389,
68,
538,
10267,
46677,
34621,
1574,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
770,
3504,
1574,
481,
6121,
262,
17151,
10007,
2722,
422,
262,
2836,
290,
1210,
597,
440,
17614,
2769,
10267,
3858,
656,
198,
220,
220,
220,
28376,
48589,
3166,
628,
220,
220,
220,
440,
17614,
2769,
10267,
1672,
25,
5633,
12947,
58,
3672,
22241,
8505,
5,
1069,
9152,
58,
3672,
22241,
3919,
628,
220,
220,
220,
36143,
777,
656,
28376,
48589,
3166,
1838,
262,
2989,
290,
19607,
21201,
257,
1256,
4577,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
651,
62,
26209,
25,
3497,
31077,
6030,
8,
4613,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
5345,
510,
428,
3504,
1574,
1398,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
651,
62,
26209,
25,
317,
869,
540,
326,
3848,
262,
1306,
636,
287,
262,
6333,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
770,
1244,
307,
1194,
3504,
1574,
393,
262,
1570,
2346,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
1136,
62,
26209,
796,
651,
62,
26209,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
33279,
796,
302,
13,
5589,
576,
7,
81,
6,
7,
30,
47,
27,
11600,
36937,
64,
12,
89,
32,
12,
89,
7131,
64,
12,
89,
32,
12,
57,
15,
12,
24,
48688,
19415,
58,
7,
30,
47,
27,
2539,
28401,
10,
19415,
60,
11537,
628,
220,
220,
220,
825,
11593,
13345,
834,
7,
944,
11,
2581,
25,
19390,
8,
4613,
367,
29281,
31077,
14881,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
770,
2446,
318,
1057,
618,
262,
3504,
1574,
318,
1444,
416,
37770,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
2581,
25,
383,
1459,
2581,
2134,
3804,
422,
262,
938,
636,
286,
262,
6333,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
82,
25,
383,
2882,
284,
307,
4504,
284,
262,
2836,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
7413,
356,
1208,
319,
262,
2581,
11,
356,
815,
8343,
262,
17151,
42287,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
9938,
477,
2769,
10267,
3918,
42287,
290,
6121,
606,
198,
220,
220,
220,
220,
220,
220,
220,
649,
62,
1136,
796,
2581,
13,
18851,
13,
30073,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
14434,
25,
1024,
4188,
796,
390,
4188,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
329,
479,
287,
2581,
13,
18851,
13,
13083,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2872,
796,
2116,
13,
33279,
13,
15699,
7,
74,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2872,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
25770,
284,
651,
262,
3706,
8633,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
649,
62,
1136,
13,
2617,
12286,
7,
15699,
17816,
11600,
6,
4357,
23884,
38381,
15699,
17816,
2539,
6,
11907,
796,
2581,
13,
18851,
58,
74,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
14434,
13,
33295,
7,
74,
8,
198,
220,
220,
220,
220,
220,
220,
220,
329,
479,
287,
14434,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
649,
62,
1136,
13,
12924,
7,
74,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2581,
13,
18851,
796,
649,
62,
1136,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
2735,
1208,
262,
2581,
284,
262,
1306,
636,
286,
262,
6333,
290,
1441,
644,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
2058,
736,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
1136,
62,
26209,
7,
25927,
8,
628,
198,
4871,
3395,
10466,
34621,
1574,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
770,
3504,
1574,
481,
5412,
262,
5270,
290,
18931,
286,
2882,
640,
20731,
284,
674,
25065,
4554,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
651,
62,
26209,
25,
3497,
31077,
6030,
8,
4613,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
5345,
510,
428,
3504,
1574,
1398,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
651,
62,
26209,
25,
317,
869,
540,
326,
3848,
262,
1306,
636,
287,
262,
6333,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
770,
1244,
307,
1194,
3504,
1574,
393,
262,
1570,
2346,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
1136,
62,
26209,
796,
651,
62,
26209,
628,
220,
220,
220,
825,
11593,
13345,
834,
7,
944,
11,
2581,
25,
19390,
8,
4613,
367,
29281,
31077,
14881,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
770,
2446,
318,
1057,
618,
262,
3504,
1574,
318,
1444,
416,
37770,
284,
1730,
351,
20731,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
2581,
25,
383,
1459,
2581,
2134,
3804,
422,
262,
938,
636,
286,
262,
6333,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
82,
25,
383,
2882,
284,
307,
4504,
284,
262,
2836,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
923,
796,
23035,
62,
24588,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2882,
796,
2116,
13,
1136,
62,
26209,
7,
25927,
8,
198,
220,
220,
220,
220,
220,
220,
220,
640,
796,
23035,
62,
24588,
3419,
532,
923,
198,
220,
220,
220,
220,
220,
220,
220,
8335,
62,
4164,
10466,
7,
7353,
62,
26209,
62,
2435,
11,
640,
28,
2435,
11,
2882,
28,
26209,
11,
2581,
28,
25927,
8,
198,
220,
220,
220,
220,
220,
220,
220,
8335,
62,
4164,
10466,
7,
7353,
62,
16366,
62,
541,
11,
2882,
28,
26209,
11,
2581,
28,
25927,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2882,
198
] | 2.752855 | 1,226 |
from socket import *
while True:
choc = str(input("[1] Host\n[2] Connect\n[0] Exit\n"))
if choc == '1':
hirc()
elif choc == '2':
circ()
elif choc == '0':
exit(0)
else:
print("wrong input, try again")
| [
6738,
17802,
1330,
1635,
198,
198,
4514,
6407,
25,
198,
197,
354,
420,
796,
965,
7,
15414,
7203,
58,
16,
60,
14504,
59,
77,
58,
17,
60,
8113,
59,
77,
58,
15,
60,
29739,
59,
77,
48774,
198,
197,
361,
442,
420,
6624,
705,
16,
10354,
198,
197,
197,
71,
1980,
3419,
198,
197,
417,
361,
442,
420,
6624,
705,
17,
10354,
198,
197,
197,
21170,
3419,
198,
197,
417,
361,
442,
420,
6624,
705,
15,
10354,
198,
197,
197,
37023,
7,
15,
8,
198,
197,
17772,
25,
198,
197,
197,
4798,
7203,
36460,
5128,
11,
1949,
757,
4943,
198
] | 2.14 | 100 |
from tramway.analyzer import *
import numpy as np
import pandas as pd
from ..data import project_dir
datafile = project_dir / 'data/Image_traj.txt'
| [
6738,
29957,
1014,
13,
38200,
9107,
1330,
1635,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
6738,
11485,
7890,
1330,
1628,
62,
15908,
198,
198,
7890,
7753,
796,
1628,
62,
15908,
1220,
705,
7890,
14,
5159,
62,
9535,
73,
13,
14116,
6,
198
] | 3 | 50 |
import os
import sys
sys.path.append(os.path.normpath(os.path.join(os.path.abspath(__file__), '..', '..', '..', "common")))
from env_indigo import *
indigo = Indigo()
indigo.setOption("molfile-saving-skip-date", "1")
testReactionInstrumentation()
| [
11748,
28686,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
7,
418,
13,
6978,
13,
27237,
6978,
7,
418,
13,
6978,
13,
22179,
7,
418,
13,
6978,
13,
397,
2777,
776,
7,
834,
7753,
834,
828,
705,
492,
3256,
705,
492,
3256,
705,
492,
3256,
366,
11321,
1,
22305,
198,
6738,
17365,
62,
521,
14031,
1330,
1635,
198,
198,
521,
14031,
796,
40673,
3419,
198,
521,
14031,
13,
2617,
19722,
7203,
76,
4024,
576,
12,
29336,
12,
48267,
12,
4475,
1600,
366,
16,
4943,
198,
220,
220,
220,
220,
220,
220,
198,
9288,
3041,
2673,
818,
43872,
341,
3419,
198
] | 2.524752 | 101 |
try:
a = int(input('digite um valor'))
b = int(input('di'))
r = a / b
except (ValueError, TypeError):
print('Houve um problema com dados digitados!')
except KeyboardInterrupt:
print('preferio não continuar')
else:
print(f'o resultado é {r:.2f:}')
finally:
print('Volte sempre! Muito obrigado!')
| [
28311,
25,
198,
220,
220,
220,
257,
796,
493,
7,
15414,
10786,
12894,
578,
23781,
1188,
273,
6,
4008,
198,
220,
220,
220,
275,
796,
493,
7,
15414,
10786,
10989,
6,
4008,
198,
220,
220,
220,
374,
796,
257,
1220,
275,
198,
16341,
357,
11395,
12331,
11,
5994,
12331,
2599,
198,
220,
220,
220,
3601,
10786,
39,
280,
303,
23781,
1917,
64,
401,
9955,
418,
16839,
22484,
0,
11537,
198,
16341,
31973,
9492,
3622,
25,
198,
220,
220,
220,
3601,
10786,
3866,
2232,
952,
299,
28749,
11143,
283,
11537,
198,
198,
17772,
25,
198,
220,
220,
220,
3601,
7,
69,
6,
78,
1255,
4533,
38251,
1391,
81,
25,
13,
17,
69,
25,
92,
11537,
198,
69,
3289,
25,
198,
220,
220,
220,
3601,
10786,
16598,
660,
5026,
3866,
0,
337,
5013,
78,
909,
4359,
4533,
0,
11537,
628
] | 2.355072 | 138 |
from myhdl import *
from hex_reader import *
@block
def BRAM(clk,addr,di,enstore,we,re,do,done,
A_WIDTH=5,
W_WIDTH=32,B_WIDTH=8):
"""
"""
assert len(addr) == A_WIDTH, "Error: Address width mismatch."
if do is not None:
assert len(di) == len(do) == W_WIDTH, "Error: Data width mismatch in portA."
arrayblock1, arrayblock2, arrayblock3, arrayblock4 = Reader(A_WIDTH)
ramregsblock1 = [Signal(modbv(arrayblock1[i])[B_WIDTH:]) for i in range(0, 2**A_WIDTH)]
ramregsblock2 = [Signal(modbv(arrayblock2[i])[B_WIDTH:]) for i in range(0, 2**A_WIDTH)]
ramregsblock3 = [Signal(modbv(arrayblock3[i])[B_WIDTH:]) for i in range(0, 2**A_WIDTH)]
ramregsblock4 = [Signal(modbv(arrayblock4[i])[B_WIDTH:]) for i in range(0, 2**A_WIDTH)]
#for addr in range(A_WIDTH):
# ramregsblock1.append(Signal(modbv(arrayblock1[addr])[B_WIDTH:]))
# ramregsblock2.append(Signal(modbv(arrayblock2[addr])[B_WIDTH:]))
# ramregsblock3.append(Signal(modbv(arrayblock3[addr])[B_WIDTH:])
# ramregsblock4[addr] = Signal(modbv(arrayblock4[addr])[B_WIDTH:])
@always(clk.posedge)
@always(clk.negedge)
@always(clk.posedge)
@always(clk.negedge)
return instances()
| [
6738,
616,
71,
25404,
1330,
1635,
197,
198,
6738,
17910,
62,
46862,
1330,
1635,
197,
198,
198,
31,
9967,
198,
4299,
11177,
2390,
7,
565,
74,
11,
29851,
11,
10989,
11,
268,
8095,
11,
732,
11,
260,
11,
4598,
11,
28060,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
62,
54,
2389,
4221,
28,
20,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
370,
62,
54,
2389,
4221,
28,
2624,
11,
33,
62,
54,
2389,
4221,
28,
23,
2599,
198,
197,
37811,
198,
197,
37811,
198,
197,
30493,
18896,
7,
29851,
8,
6624,
317,
62,
54,
2389,
4221,
11,
366,
12331,
25,
17917,
9647,
46318,
526,
198,
197,
361,
466,
318,
407,
6045,
25,
198,
197,
197,
30493,
18896,
7,
10989,
8,
6624,
18896,
7,
4598,
8,
6624,
370,
62,
54,
2389,
4221,
11,
366,
12331,
25,
6060,
9647,
46318,
287,
2493,
32,
526,
628,
197,
18747,
9967,
16,
11,
7177,
9967,
17,
11,
7177,
9967,
18,
11,
7177,
9967,
19,
796,
25342,
7,
32,
62,
54,
2389,
4221,
8,
197,
198,
197,
198,
197,
859,
2301,
82,
9967,
16,
796,
685,
11712,
282,
7,
4666,
65,
85,
7,
18747,
9967,
16,
58,
72,
12962,
58,
33,
62,
54,
2389,
4221,
25,
12962,
329,
1312,
287,
2837,
7,
15,
11,
362,
1174,
32,
62,
54,
2389,
4221,
15437,
198,
197,
859,
2301,
82,
9967,
17,
796,
685,
11712,
282,
7,
4666,
65,
85,
7,
18747,
9967,
17,
58,
72,
12962,
58,
33,
62,
54,
2389,
4221,
25,
12962,
329,
1312,
287,
2837,
7,
15,
11,
362,
1174,
32,
62,
54,
2389,
4221,
15437,
198,
197,
859,
2301,
82,
9967,
18,
796,
685,
11712,
282,
7,
4666,
65,
85,
7,
18747,
9967,
18,
58,
72,
12962,
58,
33,
62,
54,
2389,
4221,
25,
12962,
329,
1312,
287,
2837,
7,
15,
11,
362,
1174,
32,
62,
54,
2389,
4221,
15437,
198,
197,
859,
2301,
82,
9967,
19,
796,
685,
11712,
282,
7,
4666,
65,
85,
7,
18747,
9967,
19,
58,
72,
12962,
58,
33,
62,
54,
2389,
4221,
25,
12962,
329,
1312,
287,
2837,
7,
15,
11,
362,
1174,
32,
62,
54,
2389,
4221,
15437,
628,
628,
197,
2,
1640,
37817,
287,
2837,
7,
32,
62,
54,
2389,
4221,
2599,
198,
197,
2,
197,
859,
2301,
82,
9967,
16,
13,
33295,
7,
11712,
282,
7,
4666,
65,
85,
7,
18747,
9967,
16,
58,
29851,
12962,
58,
33,
62,
54,
2389,
4221,
47715,
4008,
198,
197,
2,
197,
859,
2301,
82,
9967,
17,
13,
33295,
7,
11712,
282,
7,
4666,
65,
85,
7,
18747,
9967,
17,
58,
29851,
12962,
58,
33,
62,
54,
2389,
4221,
47715,
4008,
198,
197,
2,
197,
859,
2301,
82,
9967,
18,
13,
33295,
7,
11712,
282,
7,
4666,
65,
85,
7,
18747,
9967,
18,
58,
29851,
12962,
58,
33,
62,
54,
2389,
4221,
25,
12962,
198,
197,
2,
197,
859,
2301,
82,
9967,
19,
58,
29851,
60,
796,
220,
220,
26484,
7,
4666,
65,
85,
7,
18747,
9967,
19,
58,
29851,
12962,
58,
33,
62,
54,
2389,
4221,
25,
12962,
628,
198,
197,
31,
33770,
7,
565,
74,
13,
29813,
469,
8,
198,
197,
198,
197,
628,
197,
197,
198,
197,
31,
33770,
7,
565,
74,
13,
710,
2004,
469,
8,
628,
197,
31,
33770,
7,
565,
74,
13,
29813,
469,
8,
628,
198,
197,
31,
33770,
7,
565,
74,
13,
710,
2004,
469,
8,
628,
198,
197,
7783,
10245,
3419,
198
] | 2.069808 | 573 |
from sqlalchemy import Column, Integer, String, ForeignKey
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
ModelBase = declarative_base()
| [
6738,
44161,
282,
26599,
1330,
29201,
11,
34142,
11,
10903,
11,
8708,
9218,
198,
6738,
44161,
282,
26599,
13,
2302,
13,
32446,
283,
876,
1330,
2377,
283,
876,
62,
8692,
198,
6738,
44161,
282,
26599,
13,
579,
1330,
2776,
198,
198,
17633,
14881,
796,
2377,
283,
876,
62,
8692,
3419,
628
] | 3.686275 | 51 |
""" --- Atom data ---
Written by D. J. Whiting (2017)
** Modified by F. S. Ponciano Ojeda (2021) **
Quantum Light & Matter Group, Durham University, UK
Simple database for housing atomic species data for use in calculations of
energy levels.
"""
def atomic_structure_coefficients(atom,I,L,J):
'''
Currently only contains information for Rb states with n=5, l=0,1,2
and Cs states with n=6, l=0,1,2. Further data to be added...
'''
# global A_fs,A_hfs,B_hfs,gI,gL
if atom == 'Rb':
if int(2*I+1e-10) == 3: # Rb 87
gI = -0.0009951414
gL = 0.99999369
if L == 0:
A_fs = 0
A_hfs = 3417.34130545215e6
B_hfs = 0
elif L == 1:
A_fs = 7.123e12*2/3 # (2*S+1)/(2*L+1) or 1/(S+L)
if int(2*J+1e-10) == 1:
A_hfs = 406.147e6
B_hfs = 0
elif int(2*J+1e-10) == 3:
A_hfs = 84.7185e6
B_hfs = 12.4965e6
elif L == 2:
A_fs = 88.905185e9*2/5 # (2*S+1)/(2*L+1) or 1/(S+L)
if int(2*J+1e-10) == 3:
A_hfs = 14.4303e6
B_hfs = 0.9320e6
elif int(2*J+1e-10) == 5:
A_hfs = -7.4605e6
B_hfs = 1.2713e6
elif int(2*I+1e-10) == 5: # Rb 85
gI = -0.0002936400
gL = 0.99999354
if L == 0:
A_fs = 0
A_hfs = 1011.9108130e6
B_hfs = 0
elif L == 1:
A_fs = 7.123e12*2/3
if int(2*J+1e-10) == 1:
A_hfs = 120.527e6
B_hfs = 0
elif int(2*J+1e-10) == 3:
A_hfs = 25.0020e6
B_hfs = 25.790e6
elif L == 2:
A_fs = 88.905185e9*2/5
if int(2*J+1e-10) == 3:
A_hfs = 4.2699e6
B_hfs = 1.9106e6
elif int(2*J+1e-10) == 5:
A_hfs = -2.2112e6
B_hfs = 2.6804e6
if atom == 'Cs':
gI = -0.00039885395
gL = 0.99999587
if L == 0:
A_fs = 0
A_hfs = 2298.1579425e6
B_hfs = 0
elif L == 1:
A_fs = 16.60966969094428436e12*2/3 # (2*S+1)/(2*L+1) or 1/(S+L)
if int(2*J+1e-10) == 1:
A_hfs = 291.9201e6
B_hfs = 0
elif int(2*J+1e-10) == 3:
A_hfs = 50.28827e6
B_hfs = -0.4934e6
C_hfs = 0.560e3
elif L == 2:
A_fs = 1.285060371217e12*2/5 # (2*S+1)/(2*L+1) or 1/(S+L)
if int(2*J+1e-10) == 3:
A_hfs = 16.34e6
B_hfs = -0.1e6
elif int(2*J+1e-10) == 5:
A_hfs = -4.66e6
B_hfs = 0.9e6
return A_fs,A_hfs,B_hfs,gI,gL
| [
37811,
11420,
33102,
1366,
11420,
628,
197,
25354,
416,
360,
13,
449,
13,
854,
1780,
357,
5539,
8,
198,
197,
1174,
40499,
416,
376,
13,
311,
13,
50210,
66,
10115,
440,
73,
18082,
357,
1238,
2481,
8,
12429,
198,
197,
24915,
388,
4401,
1222,
16900,
4912,
11,
30928,
2059,
11,
3482,
628,
220,
220,
220,
17427,
6831,
329,
5627,
17226,
4693,
1366,
329,
779,
287,
16765,
286,
198,
220,
220,
220,
2568,
2974,
13,
198,
37811,
198,
4299,
17226,
62,
301,
5620,
62,
1073,
41945,
7,
37696,
11,
40,
11,
43,
11,
41,
2599,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
16888,
691,
4909,
1321,
329,
371,
65,
2585,
351,
299,
28,
20,
11,
300,
28,
15,
11,
16,
11,
17,
198,
220,
220,
220,
220,
220,
220,
220,
290,
327,
82,
2585,
351,
299,
28,
21,
11,
300,
28,
15,
11,
16,
11,
17,
13,
7735,
1366,
284,
307,
2087,
986,
198,
220,
220,
220,
705,
7061,
628,
220,
220,
220,
1303,
3298,
317,
62,
9501,
11,
32,
62,
71,
9501,
11,
33,
62,
71,
9501,
11,
70,
40,
11,
70,
43,
198,
220,
220,
220,
611,
22037,
6624,
705,
49,
65,
10354,
198,
220,
220,
220,
220,
220,
220,
220,
611,
493,
7,
17,
9,
40,
10,
16,
68,
12,
940,
8,
6624,
513,
25,
1303,
371,
65,
10083,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
308,
40,
796,
532,
15,
13,
830,
33438,
1415,
1415,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
308,
43,
796,
657,
13,
2079,
17032,
30803,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
406,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
62,
9501,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
62,
71,
9501,
796,
4974,
1558,
13,
2682,
12952,
45326,
23349,
68,
21,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
347,
62,
71,
9501,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
406,
6624,
352,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
62,
9501,
796,
767,
13,
10163,
68,
1065,
9,
17,
14,
18,
1303,
357,
17,
9,
50,
10,
16,
20679,
7,
17,
9,
43,
10,
16,
8,
393,
352,
29006,
50,
10,
43,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
493,
7,
17,
9,
41,
10,
16,
68,
12,
940,
8,
6624,
352,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
62,
71,
9501,
796,
45439,
13,
20198,
68,
21,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
347,
62,
71,
9501,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
493,
7,
17,
9,
41,
10,
16,
68,
12,
940,
8,
6624,
513,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
62,
71,
9501,
796,
9508,
13,
22,
21652,
68,
21,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
347,
62,
71,
9501,
796,
1105,
13,
2920,
2996,
68,
21,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
406,
6624,
362,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
62,
9501,
796,
9193,
13,
44928,
21652,
68,
24,
9,
17,
14,
20,
1303,
357,
17,
9,
50,
10,
16,
20679,
7,
17,
9,
43,
10,
16,
8,
393,
352,
29006,
50,
10,
43,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
493,
7,
17,
9,
41,
10,
16,
68,
12,
940,
8,
6624,
513,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
62,
71,
9501,
796,
1478,
13,
19,
22572,
68,
21,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
347,
62,
71,
9501,
796,
657,
13,
6052,
1238,
68,
21,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
493,
7,
17,
9,
41,
10,
16,
68,
12,
940,
8,
6624,
642,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
62,
71,
9501,
796,
532,
22,
13,
19,
32417,
68,
21,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
347,
62,
71,
9501,
796,
352,
13,
1983,
1485,
68,
21,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
493,
7,
17,
9,
40,
10,
16,
68,
12,
940,
8,
6624,
642,
25,
1303,
371,
65,
7600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
308,
40,
796,
532,
15,
13,
830,
1959,
26780,
405,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
308,
43,
796,
657,
13,
2079,
17032,
32182,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
406,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
62,
9501,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
62,
71,
9501,
796,
8949,
16,
13,
43234,
6659,
1270,
68,
21,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
347,
62,
71,
9501,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
406,
6624,
352,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
62,
9501,
796,
767,
13,
10163,
68,
1065,
9,
17,
14,
18,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
493,
7,
17,
9,
41,
10,
16,
68,
12,
940,
8,
6624,
352,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
62,
71,
9501,
796,
7982,
13,
20,
1983,
68,
21,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
347,
62,
71,
9501,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
493,
7,
17,
9,
41,
10,
16,
68,
12,
940,
8,
6624,
513,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
62,
71,
9501,
796,
1679,
13,
405,
1238,
68,
21,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
347,
62,
71,
9501,
796,
1679,
13,
37750,
68,
21,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
406,
6624,
362,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
62,
9501,
796,
9193,
13,
44928,
21652,
68,
24,
9,
17,
14,
20,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
493,
7,
17,
9,
41,
10,
16,
68,
12,
940,
8,
6624,
513,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
62,
71,
9501,
796,
604,
13,
2075,
2079,
68,
21,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
347,
62,
71,
9501,
796,
352,
13,
24,
15801,
68,
21,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
493,
7,
17,
9,
41,
10,
16,
68,
12,
940,
8,
6624,
642,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
62,
71,
9501,
796,
532,
17,
13,
2481,
1065,
68,
21,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
347,
62,
71,
9501,
796,
362,
13,
21,
36088,
68,
21,
628,
220,
220,
220,
611,
22037,
6624,
705,
32274,
10354,
198,
220,
220,
220,
220,
220,
220,
220,
308,
40,
796,
532,
15,
13,
830,
2670,
44230,
31010,
198,
220,
220,
220,
220,
220,
220,
220,
308,
43,
796,
657,
13,
2079,
17032,
44617,
198,
220,
220,
220,
220,
220,
220,
220,
611,
406,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
62,
9501,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
62,
71,
9501,
796,
362,
27728,
13,
1314,
3720,
32114,
68,
21,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
347,
62,
71,
9501,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
406,
6624,
352,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
62,
9501,
796,
1467,
13,
31751,
36657,
3388,
2931,
2598,
30336,
2623,
68,
1065,
9,
17,
14,
18,
1303,
357,
17,
9,
50,
10,
16,
20679,
7,
17,
9,
43,
10,
16,
8,
393,
352,
29006,
50,
10,
43,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
493,
7,
17,
9,
41,
10,
16,
68,
12,
940,
8,
6624,
352,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
62,
71,
9501,
796,
43336,
13,
24,
1264,
68,
21,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
347,
62,
71,
9501,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
493,
7,
17,
9,
41,
10,
16,
68,
12,
940,
8,
6624,
513,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
62,
71,
9501,
796,
2026,
13,
25270,
1983,
68,
21,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
347,
62,
71,
9501,
796,
532,
15,
13,
2920,
2682,
68,
21,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
327,
62,
71,
9501,
796,
657,
13,
34135,
68,
18,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
406,
6624,
362,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
62,
9501,
796,
352,
13,
2078,
1120,
1899,
2718,
1065,
1558,
68,
1065,
9,
17,
14,
20,
1303,
357,
17,
9,
50,
10,
16,
20679,
7,
17,
9,
43,
10,
16,
8,
393,
352,
29006,
50,
10,
43,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
493,
7,
17,
9,
41,
10,
16,
68,
12,
940,
8,
6624,
513,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
62,
71,
9501,
796,
1467,
13,
2682,
68,
21,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
347,
62,
71,
9501,
796,
532,
15,
13,
16,
68,
21,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
493,
7,
17,
9,
41,
10,
16,
68,
12,
940,
8,
6624,
642,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
62,
71,
9501,
796,
532,
19,
13,
2791,
68,
21,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
347,
62,
71,
9501,
796,
657,
13,
24,
68,
21,
628,
220,
220,
220,
1441,
317,
62,
9501,
11,
32,
62,
71,
9501,
11,
33,
62,
71,
9501,
11,
70,
40,
11,
70,
43,
198
] | 1.423295 | 2,112 |
import sqlalchemy as sa
| [
11748,
44161,
282,
26599,
355,
473,
628,
628
] | 3.375 | 8 |
import numpy as np
import scipy.optimize as so
class mlp_cg:
""" A Multi-Layer Perceptron"""
def __init__(self,inputs,targets,nhidden,beta=1,momentum=0.9,outtype='logistic'):
""" Constructor """
# Set up network size
self.nin = np.shape(inputs)[1]
self.nout = np.shape(targets)[1]
self.ndata = np.shape(inputs)[0]
self.nhidden = nhidden
self.beta = beta
self.momentum = momentum
self.outtype = outtype
# Initialise network
self.weights1 = (np.random.rand(self.nin+1,self.nhidden)-0.5)*2/np.sqrt(self.nin)
self.weights2 = (np.random.rand(self.nhidden+1,self.nout)-0.5)*2/np.sqrt(self.nhidden)
def mlptrain(self,inputs,targets,niterations=100):
""" Train the thing """
# Add the inputs that match the bias node
inputs = np.concatenate((inputs,-np.ones((self.ndata,1))),axis=1)
# Put all the weights into a single row vector
w = np.concatenate((self.weights1.flatten(),self.weights2.flatten()))
#out = so.fmin_cg(self.mlperror, w, fprime=None, args=(inputs,targets), gtol=1e-05, maxiter=5000, full_output=True, disp=1)
out = so.fmin_cg(self.mlperror, w, fprime=self.mlpgrad, args=(inputs,targets), gtol=1e-05, maxiter=10000, full_output=True, disp=1)
wopt = out[0]
# Put the updated weights back into the matrices
split = (self.nin+1)*self.nhidden
self.weights1 = np.reshape(wopt[:split],(self.nin+1,self.nhidden))
self.weights2 = np.reshape(wopt[split:],(self.nhidden+1,self.nout))
def mlpfwd(self,inputs):
""" Run the network forward """
self.hidden = np.dot(inputs,self.weights1);
self.hidden = 1.0/(1.0+np.exp(-self.beta*self.hidden))
self.hidden = np.concatenate((self.hidden,-np.ones((np.shape(inputs)[0],1))),axis=1)
outputs = np.dot(self.hidden,self.weights2);
# Different types of output neurons
if self.outtype == 'linear':
return outputs
elif self.outtype == 'logistic':
return 1.0/(1.0+np.exp(-self.beta*outputs))
elif self.outtype == 'softmax':
normalisers = np.sum(np.exp(outputs),axis=1)*np.ones((1,np.shape(outputs)[0]))
return np.transpose(np.transpose(np.exp(outputs))/normalisers)
else:
print "error"
def confmat(self,inputs,targets):
"""Confusion matrix"""
# Add the inputs that match the bias node
inputs = np.concatenate((inputs,-np.ones((np.shape(inputs)[0],1))),axis=1)
outputs = self.mlpfwd(inputs)
nclasses = np.shape(targets)[1]
if nclasses==1:
nclasses = 2
outputs = np.where(outputs>0.5,1,0)
else:
# 1-of-N encoding
outputs = np.argmax(outputs,1)
targets = np.argmax(targets,1)
cm = np.zeros((nclasses,nclasses))
for i in range(nclasses):
for j in range(nclasses):
cm[i,j] = np.sum(np.where(outputs==i,1,0)*np.where(targets==j,1,0))
print "Confusion matrix is:"
print cm
print "Percentage Correct: ",np.trace(cm)/np.sum(cm)*100
| [
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
13,
40085,
1096,
355,
523,
198,
198,
4871,
25962,
79,
62,
66,
70,
25,
198,
220,
220,
220,
37227,
317,
15237,
12,
49925,
2448,
984,
1313,
37811,
198,
220,
220,
220,
220,
198,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
15414,
82,
11,
83,
853,
1039,
11,
77,
30342,
11,
31361,
28,
16,
11,
32542,
298,
388,
28,
15,
13,
24,
11,
448,
4906,
11639,
6404,
2569,
6,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
28407,
273,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
5345,
510,
3127,
2546,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
35073,
796,
45941,
13,
43358,
7,
15414,
82,
38381,
16,
60,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
77,
448,
796,
45941,
13,
43358,
7,
83,
853,
1039,
38381,
16,
60,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
358,
1045,
796,
45941,
13,
43358,
7,
15414,
82,
38381,
15,
60,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
77,
30342,
796,
299,
30342,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
31361,
796,
12159,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
32542,
298,
388,
796,
12858,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
448,
4906,
796,
503,
4906,
198,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
20768,
786,
3127,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
43775,
16,
796,
357,
37659,
13,
25120,
13,
25192,
7,
944,
13,
35073,
10,
16,
11,
944,
13,
77,
30342,
13219,
15,
13,
20,
27493,
17,
14,
37659,
13,
31166,
17034,
7,
944,
13,
35073,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
43775,
17,
796,
357,
37659,
13,
25120,
13,
25192,
7,
944,
13,
77,
30342,
10,
16,
11,
944,
13,
77,
448,
13219,
15,
13,
20,
27493,
17,
14,
37659,
13,
31166,
17034,
7,
944,
13,
77,
30342,
8,
628,
220,
220,
220,
825,
25962,
457,
3201,
7,
944,
11,
15414,
82,
11,
83,
853,
1039,
11,
77,
2676,
602,
28,
3064,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
16835,
262,
1517,
37227,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
3060,
262,
17311,
326,
2872,
262,
10690,
10139,
198,
220,
220,
220,
220,
220,
220,
220,
17311,
796,
45941,
13,
1102,
9246,
268,
378,
19510,
15414,
82,
12095,
37659,
13,
1952,
19510,
944,
13,
358,
1045,
11,
16,
4008,
828,
22704,
28,
16,
8,
628,
197,
2,
5930,
477,
262,
19590,
656,
257,
2060,
5752,
15879,
198,
197,
86,
796,
45941,
13,
1102,
9246,
268,
378,
19510,
944,
13,
43775,
16,
13,
2704,
41769,
22784,
944,
13,
43775,
17,
13,
2704,
41769,
3419,
4008,
628,
197,
2,
448,
796,
523,
13,
69,
1084,
62,
66,
70,
7,
944,
13,
4029,
525,
1472,
11,
266,
11,
277,
35505,
28,
14202,
11,
26498,
16193,
15414,
82,
11,
83,
853,
1039,
828,
308,
83,
349,
28,
16,
68,
12,
2713,
11,
3509,
2676,
28,
27641,
11,
1336,
62,
22915,
28,
17821,
11,
4596,
28,
16,
8,
198,
197,
448,
796,
523,
13,
69,
1084,
62,
66,
70,
7,
944,
13,
4029,
525,
1472,
11,
266,
11,
277,
35505,
28,
944,
13,
4029,
79,
9744,
11,
26498,
16193,
15414,
82,
11,
83,
853,
1039,
828,
308,
83,
349,
28,
16,
68,
12,
2713,
11,
3509,
2676,
28,
49388,
11,
1336,
62,
22915,
28,
17821,
11,
4596,
28,
16,
8,
628,
197,
86,
8738,
796,
503,
58,
15,
60,
628,
197,
2,
5930,
262,
6153,
19590,
736,
656,
262,
2603,
45977,
198,
197,
35312,
796,
357,
944,
13,
35073,
10,
16,
27493,
944,
13,
77,
30342,
198,
197,
944,
13,
43775,
16,
796,
45941,
13,
3447,
1758,
7,
86,
8738,
58,
25,
35312,
4357,
7,
944,
13,
35073,
10,
16,
11,
944,
13,
77,
30342,
4008,
198,
197,
944,
13,
43775,
17,
796,
45941,
13,
3447,
1758,
7,
86,
8738,
58,
35312,
25,
4357,
7,
944,
13,
77,
30342,
10,
16,
11,
944,
13,
77,
448,
4008,
198,
220,
220,
220,
220,
198,
220,
220,
220,
825,
25962,
79,
69,
16993,
7,
944,
11,
15414,
82,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
5660,
262,
3127,
2651,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30342,
796,
45941,
13,
26518,
7,
15414,
82,
11,
944,
13,
43775,
16,
1776,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30342,
796,
352,
13,
15,
29006,
16,
13,
15,
10,
37659,
13,
11201,
32590,
944,
13,
31361,
9,
944,
13,
30342,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30342,
796,
45941,
13,
1102,
9246,
268,
378,
19510,
944,
13,
30342,
12095,
37659,
13,
1952,
19510,
37659,
13,
43358,
7,
15414,
82,
38381,
15,
4357,
16,
4008,
828,
22704,
28,
16,
8,
628,
220,
220,
220,
220,
220,
220,
220,
23862,
796,
45941,
13,
26518,
7,
944,
13,
30342,
11,
944,
13,
43775,
17,
1776,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
20615,
3858,
286,
5072,
16890,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13,
448,
4906,
6624,
705,
29127,
10354,
198,
220,
220,
220,
220,
220,
220,
220,
220,
197,
7783,
23862,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
2116,
13,
448,
4906,
6624,
705,
6404,
2569,
10354,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
197,
7783,
352,
13,
15,
29006,
16,
13,
15,
10,
37659,
13,
11201,
32590,
944,
13,
31361,
9,
22915,
82,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
2116,
13,
448,
4906,
6624,
705,
4215,
9806,
10354,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
197,
11265,
21572,
796,
45941,
13,
16345,
7,
37659,
13,
11201,
7,
22915,
82,
828,
22704,
28,
16,
27493,
37659,
13,
1952,
19510,
16,
11,
37659,
13,
43358,
7,
22915,
82,
38381,
15,
60,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
197,
7783,
45941,
13,
7645,
3455,
7,
37659,
13,
7645,
3455,
7,
37659,
13,
11201,
7,
22915,
82,
4008,
14,
11265,
21572,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
197,
4798,
366,
18224,
1,
198,
197,
198,
220,
220,
220,
825,
1013,
6759,
7,
944,
11,
15414,
82,
11,
83,
853,
1039,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
18546,
4241,
17593,
37811,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
3060,
262,
17311,
326,
2872,
262,
10690,
10139,
198,
220,
220,
220,
220,
220,
220,
220,
17311,
796,
45941,
13,
1102,
9246,
268,
378,
19510,
15414,
82,
12095,
37659,
13,
1952,
19510,
37659,
13,
43358,
7,
15414,
82,
38381,
15,
4357,
16,
4008,
828,
22704,
28,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
23862,
796,
2116,
13,
4029,
79,
69,
16993,
7,
15414,
82,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
299,
37724,
796,
45941,
13,
43358,
7,
83,
853,
1039,
38381,
16,
60,
628,
220,
220,
220,
220,
220,
220,
220,
611,
299,
37724,
855,
16,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
299,
37724,
796,
362,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23862,
796,
45941,
13,
3003,
7,
22915,
82,
29,
15,
13,
20,
11,
16,
11,
15,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
352,
12,
1659,
12,
45,
21004,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23862,
796,
45941,
13,
853,
9806,
7,
22915,
82,
11,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6670,
796,
45941,
13,
853,
9806,
7,
83,
853,
1039,
11,
16,
8,
628,
220,
220,
220,
220,
220,
220,
220,
12067,
796,
45941,
13,
9107,
418,
19510,
77,
37724,
11,
77,
37724,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
287,
2837,
7,
77,
37724,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
474,
287,
2837,
7,
77,
37724,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12067,
58,
72,
11,
73,
60,
796,
45941,
13,
16345,
7,
37659,
13,
3003,
7,
22915,
82,
855,
72,
11,
16,
11,
15,
27493,
37659,
13,
3003,
7,
83,
853,
1039,
855,
73,
11,
16,
11,
15,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
3601,
366,
18546,
4241,
17593,
318,
11097,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
12067,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
366,
31905,
496,
22941,
25,
33172,
37659,
13,
40546,
7,
11215,
20679,
37659,
13,
16345,
7,
11215,
27493,
3064,
198
] | 2.089592 | 1,518 |
import taichi as ti
from solar_system import SolarSystem, Sun, Planet
from datetime import datetime
ti.init(arch=ti.gpu)
if __name__ == "__main__":
main() | [
11748,
20486,
16590,
355,
46668,
198,
6738,
6591,
62,
10057,
1330,
12347,
11964,
11,
3825,
11,
11397,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
20259,
13,
15003,
7,
998,
28,
20259,
13,
46999,
8,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419
] | 2.963636 | 55 |
import abc
from controller.itranslator import ITranslator
| [
11748,
450,
66,
198,
198,
6738,
10444,
13,
270,
26084,
41880,
1330,
314,
8291,
41880,
628
] | 3.75 | 16 |
from django.urls import reverse
from django.views import View
from django.http import HttpResponse
from django.contrib.sessions.middleware import SessionMiddleware
from django.test import TestCase, RequestFactory
from django.core.exceptions import PermissionDenied
from datetime import timedelta
from tables.models import Table
from orders.models import Order
from visitors.models import Group
from visitors.views import HasGroupMixin
class HasGroupMixinTestCase(TestCase):
'''
Class to test HasGroupMixin.
'''
@classmethod
@classmethod
class TestView(HasGroupMixin, View):
'''
Simple test class using HasGroupMixin.
'''
class CreateGroupViewTestCase(TestCase):
'''
Class to test the Group view for creating a new group
'''
@classmethod
@classmethod
def test_returns_400_if_no_data_is_submitted(self):
'''
Creating a group should fail if no data submitted, return 400 response, and not create a group or add one to the session.
'''
response = self.post({})
self.assertEqual(response.status_code, 400)
self.assertTrue('error' in response.json())
self.assertEqual(Group.objects.count(), 0)
self.assertFalse('group' in self.client.session)
def test_returns_400_if_invalid_data_is_submitted(self):
'''
Creating a group should fail if invalid data submitted, return 400 response, and not create a group or add one to the session.
'''
invalid_data = [
{'visitors': 'Not a list!'},
{'visitors': []},
{'visitors': [{'name': '', 'phone_number': '', 'email': ''}]},
{'visitors': [{'name': 'John Doe', 'phone_number': '', 'email': 'johndoe.com'}]},
{'visitors': [{'name': '', 'phone_number': '', 'email': '[email protected]'}]},
{'visitors': [{'name': 'John Doe', 'phone_number': '0161 496 0210', 'email': '[email protected]'},
{'name': '', 'phone_number': '', 'email': ''}]},
]
for data in invalid_data:
response = self.post(data)
self.assertEqual(response.status_code, 400)
self.assertTrue('error' in response.json())
self.assertEqual(Group.objects.count(), 0)
self.assertFalse('group' in self.client.session)
def test_response_includes_form_errors_if_invalid_data_is_submitted(self):
'''
The response should include the form errors for each visitor in the form_errors list
'''
response = self.post({'visitors': [{'name': 'John Doe', 'phone_number': '', 'email': 'johndoe.com'}]})
self.assertTrue('email' in response.json()['form_errors'][0])
response = self.post({'visitors': [{'name': '', 'phone_number': '', 'email': ''}]})
self.assertTrue('name' in response.json()['form_errors'][0])
def test_returns_400_if_none_of_the_submitted_visitors_have_contact_details(self):
'''
Creating a group should fail if none o the visitors have any contact details, return 400 response, and not create a group or add one to the session.
'''
response = self.post({'visitors': [{'name': 'John Doe', 'phone_number': '', 'email': ''},
{'name': 'Jane Doe', 'phone_number': '', 'email': ''}]})
self.assertEqual(response.status_code, 400)
self.assertTrue('error' in response.json())
self.assertEqual(Group.objects.count(), 0)
self.assertFalse('group' in self.client.session)
def test_returns_204_if_group_created_successfully(self):
'''
Creating a group should return a 204 response and add the group id to the session if successful.
'''
response = self.post({'visitors': [{'name': 'John Doe', 'phone_number': '0161 496 0210', 'email': ''},
{'name': 'Jane Doe', 'phone_number': '', 'email': ''}]})
self.assertEqual(response.status_code, 204)
self.assertEqual(Group.objects.count(), 1)
self.assertTrue('group' in self.client.session)
| [
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
198,
6738,
42625,
14208,
13,
33571,
1330,
3582,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
82,
6202,
13,
27171,
1574,
1330,
23575,
34621,
1574,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
11,
19390,
22810,
198,
6738,
42625,
14208,
13,
7295,
13,
1069,
11755,
1330,
2448,
3411,
21306,
798,
198,
6738,
4818,
8079,
1330,
28805,
12514,
198,
198,
6738,
8893,
13,
27530,
1330,
8655,
198,
6738,
6266,
13,
27530,
1330,
8284,
198,
6738,
9692,
13,
27530,
1330,
4912,
198,
6738,
9692,
13,
33571,
1330,
7875,
13247,
35608,
259,
628,
198,
4871,
7875,
13247,
35608,
259,
14402,
20448,
7,
14402,
20448,
2599,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
5016,
284,
1332,
7875,
13247,
35608,
259,
13,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
2488,
4871,
24396,
628,
220,
220,
220,
2488,
4871,
24396,
628,
220,
220,
220,
1398,
6208,
7680,
7,
19242,
13247,
35608,
259,
11,
3582,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
17427,
1332,
1398,
1262,
7875,
13247,
35608,
259,
13,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
628,
198,
4871,
13610,
13247,
7680,
14402,
20448,
7,
14402,
20448,
2599,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
5016,
284,
1332,
262,
4912,
1570,
329,
4441,
257,
649,
1448,
198,
220,
220,
220,
705,
7061,
628,
220,
220,
220,
2488,
4871,
24396,
628,
220,
220,
220,
2488,
4871,
24396,
628,
220,
220,
220,
825,
1332,
62,
7783,
82,
62,
7029,
62,
361,
62,
3919,
62,
7890,
62,
271,
62,
7266,
3291,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
30481,
257,
1448,
815,
2038,
611,
645,
1366,
8948,
11,
1441,
7337,
2882,
11,
290,
407,
2251,
257,
1448,
393,
751,
530,
284,
262,
6246,
13,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
2882,
796,
2116,
13,
7353,
15090,
30072,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
36,
13255,
7,
26209,
13,
13376,
62,
8189,
11,
7337,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
17821,
10786,
18224,
6,
287,
2882,
13,
17752,
28955,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
36,
13255,
7,
13247,
13,
48205,
13,
9127,
22784,
657,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
25101,
10786,
8094,
6,
287,
2116,
13,
16366,
13,
29891,
8,
628,
220,
220,
220,
825,
1332,
62,
7783,
82,
62,
7029,
62,
361,
62,
259,
12102,
62,
7890,
62,
271,
62,
7266,
3291,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
30481,
257,
1448,
815,
2038,
611,
12515,
1366,
8948,
11,
1441,
7337,
2882,
11,
290,
407,
2251,
257,
1448,
393,
751,
530,
284,
262,
6246,
13,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
12515,
62,
7890,
796,
685,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1391,
6,
4703,
6742,
10354,
705,
3673,
257,
1351,
13679,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1391,
6,
4703,
6742,
10354,
17635,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1391,
6,
4703,
6742,
10354,
685,
90,
6,
3672,
10354,
705,
3256,
705,
4862,
62,
17618,
10354,
705,
3256,
705,
12888,
10354,
10148,
92,
60,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1391,
6,
4703,
6742,
10354,
685,
90,
6,
3672,
10354,
705,
7554,
31780,
3256,
705,
4862,
62,
17618,
10354,
705,
3256,
705,
12888,
10354,
705,
73,
1219,
358,
2577,
13,
785,
6,
92,
60,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1391,
6,
4703,
6742,
10354,
685,
90,
6,
3672,
10354,
705,
3256,
705,
4862,
62,
17618,
10354,
705,
3256,
705,
12888,
10354,
705,
30686,
31,
67,
2577,
13,
785,
6,
92,
60,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1391,
6,
4703,
6742,
10354,
685,
90,
6,
3672,
10354,
705,
7554,
31780,
3256,
705,
4862,
62,
17618,
10354,
705,
486,
5333,
604,
4846,
7816,
940,
3256,
705,
12888,
10354,
705,
30686,
31,
67,
2577,
13,
785,
6,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1391,
6,
3672,
10354,
705,
3256,
705,
4862,
62,
17618,
10354,
705,
3256,
705,
12888,
10354,
10148,
92,
60,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
2361,
628,
220,
220,
220,
220,
220,
220,
220,
329,
1366,
287,
12515,
62,
7890,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2882,
796,
2116,
13,
7353,
7,
7890,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
36,
13255,
7,
26209,
13,
13376,
62,
8189,
11,
7337,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
17821,
10786,
18224,
6,
287,
2882,
13,
17752,
28955,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
36,
13255,
7,
13247,
13,
48205,
13,
9127,
22784,
657,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
25101,
10786,
8094,
6,
287,
2116,
13,
16366,
13,
29891,
8,
628,
220,
220,
220,
825,
1332,
62,
26209,
62,
42813,
62,
687,
62,
48277,
62,
361,
62,
259,
12102,
62,
7890,
62,
271,
62,
7266,
3291,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
383,
2882,
815,
2291,
262,
1296,
8563,
329,
1123,
21493,
287,
262,
1296,
62,
48277,
1351,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
2882,
796,
2116,
13,
7353,
15090,
6,
4703,
6742,
10354,
685,
90,
6,
3672,
10354,
705,
7554,
31780,
3256,
705,
4862,
62,
17618,
10354,
705,
3256,
705,
12888,
10354,
705,
73,
1219,
358,
2577,
13,
785,
6,
92,
60,
30072,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
17821,
10786,
12888,
6,
287,
2882,
13,
17752,
3419,
17816,
687,
62,
48277,
6,
7131,
15,
12962,
628,
220,
220,
220,
220,
220,
220,
220,
2882,
796,
2116,
13,
7353,
15090,
6,
4703,
6742,
10354,
685,
90,
6,
3672,
10354,
705,
3256,
705,
4862,
62,
17618,
10354,
705,
3256,
705,
12888,
10354,
10148,
92,
60,
30072,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
17821,
10786,
3672,
6,
287,
2882,
13,
17752,
3419,
17816,
687,
62,
48277,
6,
7131,
15,
12962,
628,
220,
220,
220,
825,
1332,
62,
7783,
82,
62,
7029,
62,
361,
62,
23108,
62,
1659,
62,
1169,
62,
7266,
3291,
62,
4703,
6742,
62,
14150,
62,
32057,
62,
36604,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
30481,
257,
1448,
815,
2038,
611,
4844,
267,
262,
9692,
423,
597,
2800,
3307,
11,
1441,
7337,
2882,
11,
290,
407,
2251,
257,
1448,
393,
751,
530,
284,
262,
6246,
13,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
2882,
796,
2116,
13,
7353,
15090,
6,
4703,
6742,
10354,
685,
90,
6,
3672,
10354,
705,
7554,
31780,
3256,
705,
4862,
62,
17618,
10354,
705,
3256,
705,
12888,
10354,
10148,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1391,
6,
3672,
10354,
705,
41083,
31780,
3256,
705,
4862,
62,
17618,
10354,
705,
3256,
705,
12888,
10354,
10148,
92,
60,
30072,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
36,
13255,
7,
26209,
13,
13376,
62,
8189,
11,
7337,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
17821,
10786,
18224,
6,
287,
2882,
13,
17752,
28955,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
36,
13255,
7,
13247,
13,
48205,
13,
9127,
22784,
657,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
25101,
10786,
8094,
6,
287,
2116,
13,
16366,
13,
29891,
8,
628,
220,
220,
220,
825,
1332,
62,
7783,
82,
62,
18638,
62,
361,
62,
8094,
62,
25598,
62,
37351,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
30481,
257,
1448,
815,
1441,
257,
26956,
2882,
290,
751,
262,
1448,
4686,
284,
262,
6246,
611,
4388,
13,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
2882,
796,
2116,
13,
7353,
15090,
6,
4703,
6742,
10354,
685,
90,
6,
3672,
10354,
705,
7554,
31780,
3256,
705,
4862,
62,
17618,
10354,
705,
486,
5333,
604,
4846,
7816,
940,
3256,
705,
12888,
10354,
10148,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1391,
6,
3672,
10354,
705,
41083,
31780,
3256,
705,
4862,
62,
17618,
10354,
705,
3256,
705,
12888,
10354,
10148,
92,
60,
30072,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
36,
13255,
7,
26209,
13,
13376,
62,
8189,
11,
26956,
8,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
36,
13255,
7,
13247,
13,
48205,
13,
9127,
22784,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
17821,
10786,
8094,
6,
287,
2116,
13,
16366,
13,
29891,
8,
198
] | 2.437242 | 1,697 |
"""
Unit tests for the algorithm.py module
"""
# pragma pylint: disable=redefined-outer-name
import numpy as np
import pytest
from traveling_salesperson import algorithm
@pytest.fixture()
def pyramid_distance_matrix_fixture():
r"""A distance matrix, corresponding to a lopsided pyramid,
for testing the nearest neighbor algorithm
a -- 10 --,b
\`9 ,2 /
\ `c /
11 | 10
\ 5 /
\|/
d
"""
return [
[0, 10, 9, 11],
[10, 0, 2, 10],
[9, 2, 0, 5],
[11, 10, 5, 0]
]
@pytest.fixture()
def sub_optimal_path_fixture():
"""A sub-optimal path, and associated distance, along the nodes of the pyramid"""
return [0, 2, 1, 3], 9 + 2 + 10
@pytest.fixture()
def optimal_path_fixture():
"""An optimal path, and associated distance, along the nodes of the pyramid"""
return [0, 1, 2, 3], 10 + 2 + 5
def test_nearest_neighbor_path_returns_expected_path(sub_optimal_path_fixture,
pyramid_distance_matrix_fixture):
"""Ensures that the nearest_neighbor_path returns the expected (and not necessarily optimal)
path."""
observed_path = algorithm.nearest_neighbor_path(4,
pyramid_distance_matrix_fixture)
assert observed_path == sub_optimal_path_fixture
def test_nearest_neighbor_path_with_swapping_returns_expected_path(optimal_path_fixture,
pyramid_distance_matrix_fixture):
"""Ensures that the nearest_neighbor_path_with_swapping() method finds a more optimal path
than nearest neighbor alone, assume such a path exists."""
observed_path = algorithm.nearest_neighbor_path_with_swapping(4,
pyramid_distance_matrix_fixture)
assert observed_path == optimal_path_fixture
def test_two_node_swap_optimization_optimizes_path(sub_optimal_path_fixture,
optimal_path_fixture,
pyramid_distance_matrix_fixture):
"""Ensures that if a shorter path can be found through 2-opt swapping, the
two_node_swap_optimization() method returns that path."""
observed_path = algorithm.two_node_swap_optimization(sub_optimal_path_fixture[0],
pyramid_distance_matrix_fixture,
sub_optimal_path_fixture[1])
assert np.array_equal(observed_path, optimal_path_fixture)
def test_two_node_swap_optimization_leaves_optimal_path_as_is(
optimal_path_fixture,
pyramid_distance_matrix_fixture):
"""Ensures that when no further optimization from swapping can be achieved, the
two_node_swap_optimization() method leaves the path as is."""
observed_path = algorithm.two_node_swap_optimization(optimal_path_fixture[0],
pyramid_distance_matrix_fixture,
optimal_path_fixture[1])
assert np.array_equal(observed_path, optimal_path_fixture)
@pytest.fixture()
def expected_segments_fixture():
"""The segments along the pyramid to consider for swapping"""
return [(0, 2), (0, 3), (1, 3)]
def test_path_segments_yields_expected_iterator(expected_segments_fixture):
"""Ensures that the path_segments() iterator yields the expected 2-tuples."""
observed_iterator = algorithm.path_segments([], 0, 3, 2)
for observed_segment, expected_segment in zip(observed_iterator,
expected_segments_fixture):
assert observed_segment == expected_segment
@pytest.mark.parametrize('segment,expected_value',
[((0, 2), -4), ((0, 3), 0), ((1, 3), 0)])
def test_better_path_from_swap_returns_expected_bool(sub_optimal_path_fixture,
pyramid_distance_matrix_fixture,
segment, expected_value):
"""Ensures that the better_path_from_swap() method returns True, if and only if
reversing the nodes between the two to "swap" would lead to a shorter path."""
observed_value = algorithm.delta_if_better_path_from_swap(sub_optimal_path_fixture[0],
pyramid_distance_matrix_fixture,
*segment)
assert observed_value == expected_value
| [
37811,
198,
26453,
5254,
329,
262,
11862,
13,
9078,
8265,
198,
37811,
198,
2,
23864,
2611,
279,
2645,
600,
25,
15560,
28,
445,
18156,
12,
39605,
12,
3672,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
12972,
9288,
198,
198,
6738,
11300,
62,
82,
2040,
6259,
1330,
11862,
628,
198,
31,
9078,
9288,
13,
69,
9602,
3419,
198,
4299,
27944,
62,
30246,
62,
6759,
8609,
62,
69,
9602,
33529,
198,
220,
220,
220,
374,
37811,
32,
5253,
17593,
11,
11188,
284,
257,
300,
2840,
1384,
27944,
11,
198,
220,
220,
220,
329,
4856,
262,
16936,
4780,
11862,
628,
220,
220,
220,
257,
1377,
838,
1377,
11,
65,
198,
220,
220,
220,
220,
3467,
63,
24,
220,
220,
837,
17,
1220,
198,
220,
220,
220,
220,
220,
3467,
4600,
66,
220,
220,
1220,
198,
220,
220,
220,
220,
220,
1367,
930,
838,
198,
220,
220,
220,
220,
220,
220,
3467,
642,
1220,
198,
220,
220,
220,
220,
220,
220,
220,
3467,
91,
14,
198,
220,
220,
220,
220,
220,
220,
220,
220,
288,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1441,
685,
198,
220,
220,
220,
220,
220,
220,
220,
685,
15,
11,
838,
11,
860,
11,
1367,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
685,
940,
11,
657,
11,
362,
11,
838,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
685,
24,
11,
362,
11,
657,
11,
642,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
685,
1157,
11,
838,
11,
642,
11,
657,
60,
198,
220,
220,
220,
2361,
628,
198,
31,
9078,
9288,
13,
69,
9602,
3419,
198,
4299,
850,
62,
8738,
4402,
62,
6978,
62,
69,
9602,
33529,
198,
220,
220,
220,
37227,
32,
850,
12,
8738,
4402,
3108,
11,
290,
3917,
5253,
11,
1863,
262,
13760,
286,
262,
27944,
37811,
198,
220,
220,
220,
1441,
685,
15,
11,
362,
11,
352,
11,
513,
4357,
860,
1343,
362,
1343,
838,
628,
198,
31,
9078,
9288,
13,
69,
9602,
3419,
198,
4299,
16586,
62,
6978,
62,
69,
9602,
33529,
198,
220,
220,
220,
37227,
2025,
16586,
3108,
11,
290,
3917,
5253,
11,
1863,
262,
13760,
286,
262,
27944,
37811,
198,
220,
220,
220,
1441,
685,
15,
11,
352,
11,
362,
11,
513,
4357,
838,
1343,
362,
1343,
642,
628,
198,
4299,
1332,
62,
710,
12423,
62,
710,
394,
2865,
62,
6978,
62,
7783,
82,
62,
40319,
62,
6978,
7,
7266,
62,
8738,
4402,
62,
6978,
62,
69,
9602,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27944,
62,
30246,
62,
6759,
8609,
62,
69,
9602,
2599,
198,
220,
220,
220,
37227,
4834,
82,
942,
326,
262,
16936,
62,
710,
394,
2865,
62,
6978,
5860,
262,
2938,
357,
392,
407,
6646,
16586,
8,
198,
220,
220,
220,
3108,
526,
15931,
198,
220,
220,
220,
6515,
62,
6978,
796,
11862,
13,
710,
12423,
62,
710,
394,
2865,
62,
6978,
7,
19,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27944,
62,
30246,
62,
6759,
8609,
62,
69,
9602,
8,
198,
220,
220,
220,
6818,
6515,
62,
6978,
6624,
850,
62,
8738,
4402,
62,
6978,
62,
69,
9602,
628,
198,
4299,
1332,
62,
710,
12423,
62,
710,
394,
2865,
62,
6978,
62,
4480,
62,
2032,
5912,
62,
7783,
82,
62,
40319,
62,
6978,
7,
8738,
4402,
62,
6978,
62,
69,
9602,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27944,
62,
30246,
62,
6759,
8609,
62,
69,
9602,
2599,
198,
220,
220,
220,
37227,
4834,
82,
942,
326,
262,
16936,
62,
710,
394,
2865,
62,
6978,
62,
4480,
62,
2032,
5912,
3419,
2446,
7228,
257,
517,
16586,
3108,
198,
220,
220,
220,
621,
16936,
4780,
3436,
11,
7048,
884,
220,
257,
3108,
7160,
526,
15931,
198,
220,
220,
220,
6515,
62,
6978,
796,
11862,
13,
710,
12423,
62,
710,
394,
2865,
62,
6978,
62,
4480,
62,
2032,
5912,
7,
19,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27944,
62,
30246,
62,
6759,
8609,
62,
69,
9602,
8,
198,
220,
220,
220,
6818,
6515,
62,
6978,
6624,
16586,
62,
6978,
62,
69,
9602,
628,
198,
4299,
1332,
62,
11545,
62,
17440,
62,
2032,
499,
62,
40085,
1634,
62,
40085,
4340,
62,
6978,
7,
7266,
62,
8738,
4402,
62,
6978,
62,
69,
9602,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16586,
62,
6978,
62,
69,
9602,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27944,
62,
30246,
62,
6759,
8609,
62,
69,
9602,
2599,
198,
220,
220,
220,
37227,
4834,
82,
942,
326,
611,
257,
12238,
3108,
460,
307,
1043,
832,
362,
12,
8738,
38869,
11,
262,
198,
220,
220,
220,
734,
62,
17440,
62,
2032,
499,
62,
40085,
1634,
3419,
2446,
5860,
326,
3108,
526,
15931,
198,
220,
220,
220,
6515,
62,
6978,
796,
11862,
13,
11545,
62,
17440,
62,
2032,
499,
62,
40085,
1634,
7,
7266,
62,
8738,
4402,
62,
6978,
62,
69,
9602,
58,
15,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27944,
62,
30246,
62,
6759,
8609,
62,
69,
9602,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
850,
62,
8738,
4402,
62,
6978,
62,
69,
9602,
58,
16,
12962,
198,
220,
220,
220,
6818,
45941,
13,
18747,
62,
40496,
7,
672,
45852,
62,
6978,
11,
16586,
62,
6978,
62,
69,
9602,
8,
628,
198,
4299,
1332,
62,
11545,
62,
17440,
62,
2032,
499,
62,
40085,
1634,
62,
293,
3080,
62,
8738,
4402,
62,
6978,
62,
292,
62,
271,
7,
198,
220,
220,
220,
220,
220,
220,
220,
16586,
62,
6978,
62,
69,
9602,
11,
198,
220,
220,
220,
220,
220,
220,
220,
27944,
62,
30246,
62,
6759,
8609,
62,
69,
9602,
2599,
198,
220,
220,
220,
37227,
4834,
82,
942,
326,
618,
645,
2252,
23989,
422,
38869,
460,
307,
8793,
11,
262,
198,
220,
220,
220,
734,
62,
17440,
62,
2032,
499,
62,
40085,
1634,
3419,
2446,
5667,
262,
3108,
355,
318,
526,
15931,
198,
220,
220,
220,
6515,
62,
6978,
796,
11862,
13,
11545,
62,
17440,
62,
2032,
499,
62,
40085,
1634,
7,
8738,
4402,
62,
6978,
62,
69,
9602,
58,
15,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27944,
62,
30246,
62,
6759,
8609,
62,
69,
9602,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16586,
62,
6978,
62,
69,
9602,
58,
16,
12962,
198,
220,
220,
220,
6818,
45941,
13,
18747,
62,
40496,
7,
672,
45852,
62,
6978,
11,
16586,
62,
6978,
62,
69,
9602,
8,
628,
198,
31,
9078,
9288,
13,
69,
9602,
3419,
198,
4299,
2938,
62,
325,
11726,
62,
69,
9602,
33529,
198,
220,
220,
220,
37227,
464,
17894,
1863,
262,
27944,
284,
2074,
329,
38869,
37811,
198,
220,
220,
220,
1441,
47527,
15,
11,
362,
828,
357,
15,
11,
513,
828,
357,
16,
11,
513,
15437,
628,
198,
4299,
1332,
62,
6978,
62,
325,
11726,
62,
88,
1164,
82,
62,
40319,
62,
48727,
7,
40319,
62,
325,
11726,
62,
69,
9602,
2599,
198,
220,
220,
220,
37227,
4834,
82,
942,
326,
262,
3108,
62,
325,
11726,
3419,
41313,
19299,
262,
2938,
362,
12,
28047,
2374,
526,
15931,
198,
220,
220,
220,
6515,
62,
48727,
796,
11862,
13,
6978,
62,
325,
11726,
26933,
4357,
657,
11,
513,
11,
362,
8,
198,
220,
220,
220,
329,
6515,
62,
325,
5154,
11,
2938,
62,
325,
5154,
287,
19974,
7,
672,
45852,
62,
48727,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2938,
62,
325,
11726,
62,
69,
9602,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
6818,
6515,
62,
325,
5154,
6624,
2938,
62,
325,
5154,
628,
198,
31,
9078,
9288,
13,
4102,
13,
17143,
316,
380,
2736,
10786,
325,
5154,
11,
40319,
62,
8367,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
685,
19510,
15,
11,
362,
828,
532,
19,
828,
14808,
15,
11,
513,
828,
657,
828,
14808,
16,
11,
513,
828,
657,
8,
12962,
198,
4299,
1332,
62,
27903,
62,
6978,
62,
6738,
62,
2032,
499,
62,
7783,
82,
62,
40319,
62,
30388,
7,
7266,
62,
8738,
4402,
62,
6978,
62,
69,
9602,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27944,
62,
30246,
62,
6759,
8609,
62,
69,
9602,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10618,
11,
2938,
62,
8367,
2599,
198,
220,
220,
220,
37227,
4834,
82,
942,
326,
262,
1365,
62,
6978,
62,
6738,
62,
2032,
499,
3419,
2446,
5860,
6407,
11,
611,
290,
691,
611,
198,
220,
220,
220,
37556,
262,
13760,
1022,
262,
734,
284,
366,
2032,
499,
1,
561,
1085,
284,
257,
12238,
3108,
526,
15931,
198,
220,
220,
220,
6515,
62,
8367,
796,
11862,
13,
67,
12514,
62,
361,
62,
27903,
62,
6978,
62,
6738,
62,
2032,
499,
7,
7266,
62,
8738,
4402,
62,
6978,
62,
69,
9602,
58,
15,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27944,
62,
30246,
62,
6759,
8609,
62,
69,
9602,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1635,
325,
5154,
8,
198,
220,
220,
220,
6818,
6515,
62,
8367,
6624,
2938,
62,
8367,
198
] | 2.085573 | 2,232 |
# -*- coding: utf-8 -*-
import gc
import uos
import utime
import hw_urequests
import machine
import portable_firmware_constants
strMAC = ''.join(['%02X'%i for i in machine.unique_id()])
#
# Watchdog
#
objWdt = None
feedWatchdog = lambda: None
'''True if power on. False if reboot by software or watchdog.'''
bPowerOnBoot = machine.PWRON_RESET == machine.reset_cause()
'''True if Watchdog-Reset. False if reboot by software or power on.'''
bWatchdogBoot = machine.WDT_RESET == machine.reset_cause()
#
# SW Version
#
strSwVersion = __getSwVersion()
#
# LED and Button
#
iFreqOn_hz = 1000
class Gpio:
'Scan: slow blink, sharp'
'Scan: blink, dark'
'Connected: blink, bright'
def isButtonPressed(self):
'''Returns True if the Button is pressed.'''
return self.pin_button.value() == 0
objGpio = Gpio()
#
# Utils
#
def deleteVERSION_TXTandReboot():
'''Delete VERSION.TXT so that the filesystem will be formatted during next boot'''
uos.remove(portable_firmware_constants.strFILENAME_VERSION)
reboot('Reboot after deleting VERSION.TXT')
def formatAndReboot():
'''Destroy the filesystem so that it will be formatted during next boot'''
gc.collect()
objGpio.pwmLedReboot()
# This will trigger a format of the filesystem and the creation of booty.py.
# See: https://github.com/micropython/micropython/blob/master/ports/esp32/modules/inisetup.py
import inisetup
inisetup.setup()
reboot('Reboot after format filesystem')
def bootCheckUpdate():
'''
This method is called from 'boot.py' always after boot.
May reboot several times to format the filesystem and do the update.
'''
objGpio.setLed(False)
if objGpio.isButtonPressed() and bPowerOnBoot:
print('Button presed. Format')
activateWatchdog()
formatAndReboot()
if isFilesystemEmpty():
print('Filesystem is empty: Update')
activateWatchdog()
# Don't import at the beginning: It would occupy memory...
import hw_update_ota
hw_update_ota.updateAndReboot()
if not isUpdateFinished():
print('Update was not finished. Format')
activateWatchdog()
formatAndReboot()
objGpio.setLed(False)
#
# Verify SW-Version on Host
#
def getSwVersionGit(wlan):
'''
returns verions: On success
returns None: on failure
'''
strUrl = getVersionCheckUrl(wlan)
print('HTTP-Get ' + strUrl)
try:
feedWatchdog()
r = hw_urequests.get(strUrl)
if r.status_code != 200:
print('FAILED %d %s' % (r.status_code, r.reason))
r.close()
return None
strSwVersionGit = r.text
r.close()
return strSwVersionGit
except OSError as e:
print('FAILED %s' % e)
return None
def checkIfNewSwVersion(wlan):
'''
returns True: The version changed
returns False: Same version or error
'''
strSwVersionGit = getSwVersionGit(wlan)
if strSwVersionGit != None:
print('Software version node: %s' % strSwVersion)
print('Software version git: %s' % strSwVersionGit)
if strSwVersionGit != strSwVersion:
print('Software version CHANGED')
return True
print('Software version EQUAL')
return False
#
# Memory usage
#
#
# Repl-Command
#
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
308,
66,
198,
11748,
334,
418,
198,
11748,
3384,
524,
198,
11748,
289,
86,
62,
495,
421,
3558,
198,
11748,
4572,
198,
11748,
17726,
62,
69,
2533,
1574,
62,
9979,
1187,
198,
198,
2536,
44721,
796,
705,
4458,
22179,
7,
17816,
4,
2999,
55,
6,
4,
72,
329,
1312,
287,
4572,
13,
34642,
62,
312,
3419,
12962,
198,
198,
2,
198,
2,
6305,
9703,
198,
2,
198,
26801,
54,
28664,
796,
6045,
198,
198,
12363,
10723,
9703,
796,
37456,
25,
6045,
198,
198,
7061,
6,
17821,
611,
1176,
319,
13,
10352,
611,
20149,
416,
3788,
393,
26856,
2637,
7061,
198,
65,
13434,
2202,
36476,
796,
4572,
13,
47,
18564,
1340,
62,
19535,
2767,
6624,
4572,
13,
42503,
62,
25587,
3419,
198,
198,
7061,
6,
17821,
611,
6305,
9703,
12,
4965,
316,
13,
10352,
611,
20149,
416,
3788,
393,
1176,
319,
2637,
7061,
198,
65,
10723,
9703,
36476,
796,
4572,
13,
22332,
51,
62,
19535,
2767,
6624,
4572,
13,
42503,
62,
25587,
3419,
198,
198,
2,
198,
2,
12672,
10628,
198,
2,
198,
198,
2536,
10462,
14815,
796,
11593,
1136,
10462,
14815,
3419,
198,
198,
2,
198,
2,
12365,
290,
20969,
198,
2,
198,
72,
20366,
80,
2202,
62,
32179,
796,
8576,
198,
198,
4871,
402,
79,
952,
25,
628,
220,
705,
33351,
25,
3105,
21019,
11,
7786,
6,
628,
220,
705,
33351,
25,
21019,
11,
3223,
6,
628,
220,
705,
13313,
276,
25,
21019,
11,
6016,
6,
628,
220,
825,
318,
21864,
47,
2790,
7,
944,
2599,
198,
220,
220,
220,
705,
7061,
35561,
6407,
611,
262,
20969,
318,
12070,
2637,
7061,
198,
220,
220,
220,
1441,
2116,
13,
11635,
62,
16539,
13,
8367,
3419,
6624,
657,
198,
198,
26801,
38,
79,
952,
796,
402,
79,
952,
3419,
628,
198,
2,
198,
2,
7273,
4487,
198,
2,
198,
198,
4299,
12233,
43717,
62,
51,
25010,
392,
28951,
1025,
33529,
198,
220,
705,
7061,
38727,
44156,
2849,
13,
51,
25010,
523,
326,
262,
29905,
481,
307,
39559,
1141,
1306,
6297,
7061,
6,
198,
220,
334,
418,
13,
28956,
7,
634,
540,
62,
69,
2533,
1574,
62,
9979,
1187,
13,
2536,
46700,
1677,
10067,
62,
43717,
8,
198,
220,
20149,
10786,
28951,
1025,
706,
34817,
44156,
2849,
13,
51,
25010,
11537,
198,
198,
4299,
5794,
1870,
28951,
1025,
33529,
198,
220,
705,
7061,
49174,
262,
29905,
523,
326,
340,
481,
307,
39559,
1141,
1306,
6297,
7061,
6,
198,
220,
308,
66,
13,
33327,
3419,
198,
220,
26181,
38,
79,
952,
13,
79,
26377,
42416,
28951,
1025,
3419,
198,
220,
1303,
770,
481,
7616,
257,
5794,
286,
262,
29905,
290,
262,
6282,
286,
6297,
88,
13,
9078,
13,
198,
220,
1303,
4091,
25,
3740,
1378,
12567,
13,
785,
14,
9383,
1773,
7535,
14,
9383,
1773,
7535,
14,
2436,
672,
14,
9866,
14,
3742,
14,
9774,
2624,
14,
18170,
14,
16661,
316,
929,
13,
9078,
198,
220,
1330,
287,
271,
316,
929,
198,
220,
287,
271,
316,
929,
13,
40406,
3419,
198,
220,
20149,
10786,
28951,
1025,
706,
5794,
29905,
11537,
198,
198,
4299,
6297,
9787,
10260,
33529,
198,
220,
705,
7061,
198,
220,
220,
220,
770,
2446,
318,
1444,
422,
705,
18769,
13,
9078,
6,
1464,
706,
6297,
13,
628,
220,
220,
220,
1737,
20149,
1811,
1661,
284,
5794,
262,
29905,
290,
466,
262,
4296,
13,
198,
220,
705,
7061,
198,
220,
26181,
38,
79,
952,
13,
2617,
42416,
7,
25101,
8,
628,
220,
611,
26181,
38,
79,
952,
13,
271,
21864,
47,
2790,
3419,
290,
275,
13434,
2202,
36476,
25,
198,
220,
220,
220,
3601,
10786,
21864,
906,
276,
13,
18980,
11537,
198,
220,
220,
220,
15155,
10723,
9703,
3419,
198,
220,
220,
220,
5794,
1870,
28951,
1025,
3419,
628,
220,
611,
318,
25876,
6781,
40613,
33529,
198,
220,
220,
220,
3601,
10786,
25876,
6781,
318,
6565,
25,
10133,
11537,
198,
220,
220,
220,
15155,
10723,
9703,
3419,
198,
220,
220,
220,
1303,
2094,
470,
1330,
379,
262,
3726,
25,
632,
561,
22265,
4088,
986,
198,
220,
220,
220,
1330,
289,
86,
62,
19119,
62,
4265,
198,
220,
220,
220,
289,
86,
62,
19119,
62,
4265,
13,
19119,
1870,
28951,
1025,
3419,
628,
220,
611,
407,
318,
10260,
18467,
1348,
33529,
198,
220,
220,
220,
3601,
10786,
10260,
373,
407,
5201,
13,
18980,
11537,
198,
220,
220,
220,
15155,
10723,
9703,
3419,
198,
220,
220,
220,
5794,
1870,
28951,
1025,
3419,
628,
220,
26181,
38,
79,
952,
13,
2617,
42416,
7,
25101,
8,
198,
198,
2,
198,
2,
49899,
12672,
12,
14815,
319,
14504,
198,
2,
198,
198,
4299,
651,
10462,
14815,
38,
270,
7,
86,
9620,
2599,
198,
220,
705,
7061,
198,
220,
220,
220,
5860,
3326,
507,
25,
1550,
1943,
198,
220,
220,
220,
5860,
6045,
25,
319,
5287,
198,
220,
705,
7061,
198,
220,
965,
28165,
796,
651,
14815,
9787,
28165,
7,
86,
9620,
8,
198,
220,
3601,
10786,
40717,
12,
3855,
705,
1343,
965,
28165,
8,
198,
220,
1949,
25,
198,
220,
220,
220,
3745,
10723,
9703,
3419,
198,
220,
220,
220,
374,
796,
289,
86,
62,
495,
421,
3558,
13,
1136,
7,
2536,
28165,
8,
198,
220,
220,
220,
611,
374,
13,
13376,
62,
8189,
14512,
939,
25,
198,
220,
220,
220,
220,
220,
3601,
10786,
7708,
4146,
1961,
4064,
67,
4064,
82,
6,
4064,
357,
81,
13,
13376,
62,
8189,
11,
374,
13,
41181,
4008,
198,
220,
220,
220,
220,
220,
374,
13,
19836,
3419,
198,
220,
220,
220,
220,
220,
1441,
6045,
198,
220,
220,
220,
965,
10462,
14815,
38,
270,
796,
374,
13,
5239,
198,
220,
220,
220,
374,
13,
19836,
3419,
198,
220,
220,
220,
1441,
965,
10462,
14815,
38,
270,
198,
220,
2845,
440,
5188,
81,
1472,
355,
304,
25,
198,
220,
220,
220,
3601,
10786,
7708,
4146,
1961,
4064,
82,
6,
4064,
304,
8,
198,
220,
1441,
6045,
198,
198,
4299,
2198,
1532,
3791,
10462,
14815,
7,
86,
9620,
2599,
198,
220,
705,
7061,
198,
220,
220,
220,
5860,
6407,
25,
383,
2196,
3421,
198,
220,
220,
220,
5860,
10352,
25,
16766,
2196,
393,
4049,
198,
220,
705,
7061,
198,
220,
965,
10462,
14815,
38,
270,
796,
651,
10462,
14815,
38,
270,
7,
86,
9620,
8,
198,
220,
611,
965,
10462,
14815,
38,
270,
14512,
6045,
25,
198,
220,
220,
220,
3601,
10786,
25423,
2196,
10139,
25,
4064,
82,
6,
4064,
965,
10462,
14815,
8,
198,
220,
220,
220,
3601,
10786,
25423,
2196,
17606,
25,
220,
4064,
82,
6,
4064,
965,
10462,
14815,
38,
270,
8,
198,
220,
220,
220,
611,
965,
10462,
14815,
38,
270,
14512,
965,
10462,
14815,
25,
198,
220,
220,
220,
220,
220,
3601,
10786,
25423,
2196,
5870,
15567,
1961,
11537,
198,
220,
220,
220,
220,
220,
1441,
6407,
198,
220,
220,
220,
3601,
10786,
25423,
2196,
46886,
1847,
11537,
198,
220,
1441,
10352,
198,
198,
2,
198,
2,
14059,
8748,
198,
2,
628,
198,
2,
198,
2,
18407,
12,
21575,
198,
2,
628
] | 2.738942 | 1,153 |
# coding: utf-8
"""
RTRAttributes.py
The Clear BSD License
Copyright (c) – 2016, NetApp, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of NetApp, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""
from pprint import pformat
from six import iteritems
class RTRAttributes(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
def __init__(self):
"""
RTRAttributes - a model defined in Swagger
:param dict swaggerTypes: The key is attribute name
and the value is attribute type.
:param dict attributeMap: The key is attribute name
and the value is json key in definition.
"""
self.swagger_types = {
'cru_type': 'str', # (required parameter)
'parent_cru': 'ParentCru',
'rtr_attribute_data': 'RTRAttributeData'
}
self.attribute_map = {
'cru_type': 'cruType', # (required parameter)
'parent_cru': 'parentCru',
'rtr_attribute_data': 'rtrAttributeData'
}
self._cru_type = None
self._parent_cru = None
self._rtr_attribute_data = None
@property
def cru_type(self):
"""
Gets the cru_type of this RTRAttributes.
This enumeration identifies the type of CRU a component has.
:return: The cru_type of this RTRAttributes.
:rtype: str
:required/optional: required
"""
return self._cru_type
@cru_type.setter
def cru_type(self, cru_type):
"""
Sets the cru_type of this RTRAttributes.
This enumeration identifies the type of CRU a component has.
:param cru_type: The cru_type of this RTRAttributes.
:type: str
"""
allowed_values = ["unknown", "dedicated", "shared", "aggregate", "__UNDEFINED"]
if cru_type not in allowed_values:
raise ValueError(
"Invalid value for `cru_type`, must be one of {0}"
.format(allowed_values)
)
self._cru_type = cru_type
@property
def parent_cru(self):
"""
Gets the parent_cru of this RTRAttributes.
This field identifies the CRU that is the parent of this component, i.e., the CRU that it is sharing with other components. It is only present when the cruType field is set to CRU_TYPE_AGGREGATE.
:return: The parent_cru of this RTRAttributes.
:rtype: ParentCru
:required/optional: optional
"""
return self._parent_cru
@parent_cru.setter
def parent_cru(self, parent_cru):
"""
Sets the parent_cru of this RTRAttributes.
This field identifies the CRU that is the parent of this component, i.e., the CRU that it is sharing with other components. It is only present when the cruType field is set to CRU_TYPE_AGGREGATE.
:param parent_cru: The parent_cru of this RTRAttributes.
:type: ParentCru
"""
self._parent_cru = parent_cru
@property
def rtr_attribute_data(self):
"""
Gets the rtr_attribute_data of this RTRAttributes.
This field contains the actual settings for the ready-to-remove data. It is only present when the cruType field is set to CRU_TYPE_DEDICATED.
:return: The rtr_attribute_data of this RTRAttributes.
:rtype: RTRAttributeData
:required/optional: optional
"""
return self._rtr_attribute_data
@rtr_attribute_data.setter
def rtr_attribute_data(self, rtr_attribute_data):
"""
Sets the rtr_attribute_data of this RTRAttributes.
This field contains the actual settings for the ready-to-remove data. It is only present when the cruType field is set to CRU_TYPE_DEDICATED.
:param rtr_attribute_data: The rtr_attribute_data of this RTRAttributes.
:type: RTRAttributeData
"""
self._rtr_attribute_data = rtr_attribute_data
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
if self is None:
return None
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if self is None or other is None:
return None
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
| [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
37811,
198,
14181,
3861,
926,
7657,
13,
9078,
628,
383,
11459,
347,
10305,
13789,
628,
15069,
357,
66,
8,
784,
1584,
11,
3433,
4677,
11,
3457,
13,
1439,
2489,
10395,
13,
628,
2297,
396,
3890,
290,
779,
287,
2723,
290,
13934,
5107,
11,
351,
393,
1231,
17613,
11,
389,
10431,
357,
32796,
284,
262,
11247,
287,
262,
37592,
2174,
8,
2810,
326,
262,
1708,
3403,
389,
1138,
25,
628,
1635,
2297,
396,
2455,
507,
286,
2723,
2438,
1276,
12377,
262,
2029,
6634,
4003,
11,
428,
1351,
286,
3403,
290,
262,
1708,
37592,
13,
628,
1635,
2297,
396,
2455,
507,
287,
13934,
1296,
1276,
22919,
262,
2029,
6634,
4003,
11,
428,
1351,
286,
3403,
290,
262,
1708,
37592,
287,
262,
10314,
290,
14,
273,
584,
5696,
2810,
351,
262,
6082,
13,
628,
1635,
16126,
262,
1438,
286,
3433,
4677,
11,
3457,
13,
4249,
262,
3891,
286,
663,
20420,
743,
307,
973,
284,
11438,
393,
7719,
3186,
10944,
422,
428,
3788,
1231,
2176,
3161,
3194,
7170,
13,
628,
8005,
7788,
32761,
6375,
8959,
49094,
38559,
16938,
1546,
5390,
15529,
16652,
56,
6,
50,
28748,
3525,
371,
34874,
15986,
10863,
8643,
1961,
11050,
12680,
38559,
24290,
13,
12680,
47466,
3180,
36592,
2389,
1961,
11050,
3336,
27975,
38162,
9947,
367,
15173,
4877,
5357,
27342,
9865,
3843,
20673,
366,
1921,
3180,
1,
5357,
15529,
7788,
32761,
6375,
8959,
49094,
34764,
11015,
11,
47783,
2751,
11,
21728,
5626,
40880,
5390,
11,
3336,
8959,
49094,
34764,
11015,
3963,
34482,
3398,
1565,
5603,
25382,
5357,
376,
46144,
7473,
317,
16652,
2149,
37232,
33079,
48933,
15986,
13954,
48778,
1961,
13,
3268,
8005,
49261,
50163,
3336,
27975,
38162,
9947,
47210,
21479,
6375,
27342,
9865,
3843,
20673,
9348,
43031,
19146,
7473,
15529,
42242,
11,
3268,
17931,
23988,
11,
19387,
25256,
1847,
11,
38846,
11,
7788,
3620,
6489,
13153,
11,
6375,
7102,
5188,
10917,
3525,
12576,
29506,
25552,
357,
1268,
39149,
2751,
11,
21728,
5626,
40880,
5390,
11,
41755,
11335,
10979,
3963,
28932,
2257,
2043,
37780,
21090,
50,
6375,
49254,
26,
406,
18420,
3963,
23210,
11,
42865,
11,
6375,
4810,
19238,
29722,
26,
6375,
43949,
44180,
23255,
49,
8577,
24131,
8,
29630,
36,
5959,
7257,
2937,
1961,
5357,
6177,
15529,
3336,
15513,
3963,
43031,
25382,
11,
7655,
2767,
16879,
3268,
27342,
10659,
11,
19269,
18379,
43031,
25382,
11,
6375,
309,
9863,
357,
1268,
39149,
2751,
399,
7156,
43,
3528,
18310,
6375,
25401,
54,
24352,
8,
5923,
1797,
2751,
3268,
15529,
34882,
16289,
3963,
3336,
23210,
3963,
12680,
47466,
11,
45886,
16876,
5984,
29817,
1961,
3963,
3336,
28069,
11584,
25382,
3963,
13558,
3398,
29506,
11879,
13,
198,
37811,
198,
198,
6738,
279,
4798,
1330,
279,
18982,
198,
6738,
2237,
1330,
11629,
23814,
628,
198,
4871,
11923,
3861,
926,
7657,
7,
15252,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
24550,
25,
770,
1398,
318,
8295,
7560,
416,
262,
1509,
7928,
2438,
17301,
1430,
13,
198,
220,
220,
220,
2141,
407,
4370,
262,
1398,
14500,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
11923,
3861,
926,
7657,
532,
257,
2746,
5447,
287,
2451,
7928,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
8633,
1509,
7928,
31431,
25,
383,
1994,
318,
11688,
1438,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
290,
262,
1988,
318,
11688,
2099,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
8633,
11688,
13912,
25,
383,
1994,
318,
11688,
1438,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
290,
262,
1988,
318,
33918,
1994,
287,
6770,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
2032,
7928,
62,
19199,
796,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
32838,
62,
4906,
10354,
705,
2536,
3256,
220,
1303,
357,
35827,
11507,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
8000,
62,
32838,
10354,
705,
24546,
27535,
3256,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
81,
2213,
62,
42348,
62,
7890,
10354,
705,
14181,
3861,
926,
4163,
6601,
6,
198,
220,
220,
220,
220,
220,
220,
220,
1782,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
42348,
62,
8899,
796,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
32838,
62,
4906,
10354,
705,
32838,
6030,
3256,
220,
1303,
357,
35827,
11507,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
8000,
62,
32838,
10354,
705,
8000,
27535,
3256,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
81,
2213,
62,
42348,
62,
7890,
10354,
705,
81,
2213,
33682,
6601,
6,
198,
220,
220,
220,
220,
220,
220,
220,
1782,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
32838,
62,
4906,
796,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
8000,
62,
32838,
796,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
81,
2213,
62,
42348,
62,
7890,
796,
6045,
628,
220,
220,
220,
2488,
26745,
198,
220,
220,
220,
825,
4630,
62,
4906,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
29620,
262,
4630,
62,
4906,
286,
428,
11923,
3861,
926,
7657,
13,
198,
220,
220,
220,
220,
220,
220,
220,
770,
27056,
341,
21079,
262,
2099,
286,
8740,
52,
257,
7515,
468,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
383,
4630,
62,
4906,
286,
428,
11923,
3861,
926,
7657,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
81,
4906,
25,
965,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
35827,
14,
25968,
25,
2672,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13557,
32838,
62,
4906,
628,
220,
220,
220,
2488,
32838,
62,
4906,
13,
2617,
353,
198,
220,
220,
220,
825,
4630,
62,
4906,
7,
944,
11,
4630,
62,
4906,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
21394,
262,
4630,
62,
4906,
286,
428,
11923,
3861,
926,
7657,
13,
198,
220,
220,
220,
220,
220,
220,
220,
770,
27056,
341,
21079,
262,
2099,
286,
8740,
52,
257,
7515,
468,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
4630,
62,
4906,
25,
383,
4630,
62,
4906,
286,
428,
11923,
3861,
926,
7657,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
4906,
25,
965,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
3142,
62,
27160,
796,
14631,
34680,
1600,
366,
9395,
3474,
1600,
366,
28710,
1600,
366,
9460,
49373,
1600,
366,
834,
4944,
7206,
20032,
1961,
8973,
198,
220,
220,
220,
220,
220,
220,
220,
611,
4630,
62,
4906,
407,
287,
3142,
62,
27160,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
11052,
12331,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
44651,
1988,
329,
4600,
32838,
62,
4906,
47671,
1276,
307,
530,
286,
1391,
15,
36786,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
764,
18982,
7,
40845,
62,
27160,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
32838,
62,
4906,
796,
4630,
62,
4906,
628,
220,
220,
220,
2488,
26745,
198,
220,
220,
220,
825,
2560,
62,
32838,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
29620,
262,
2560,
62,
32838,
286,
428,
11923,
3861,
926,
7657,
13,
198,
220,
220,
220,
220,
220,
220,
220,
770,
2214,
21079,
262,
8740,
52,
326,
318,
262,
2560,
286,
428,
7515,
11,
1312,
13,
68,
1539,
262,
8740,
52,
326,
340,
318,
7373,
351,
584,
6805,
13,
632,
318,
691,
1944,
618,
262,
4630,
6030,
2214,
318,
900,
284,
8740,
52,
62,
25216,
62,
4760,
28934,
38,
6158,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
383,
2560,
62,
32838,
286,
428,
11923,
3861,
926,
7657,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
81,
4906,
25,
16774,
27535,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
35827,
14,
25968,
25,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13557,
8000,
62,
32838,
628,
220,
220,
220,
2488,
8000,
62,
32838,
13,
2617,
353,
198,
220,
220,
220,
825,
2560,
62,
32838,
7,
944,
11,
2560,
62,
32838,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
21394,
262,
2560,
62,
32838,
286,
428,
11923,
3861,
926,
7657,
13,
198,
220,
220,
220,
220,
220,
220,
220,
770,
2214,
21079,
262,
8740,
52,
326,
318,
262,
2560,
286,
428,
7515,
11,
1312,
13,
68,
1539,
262,
8740,
52,
326,
340,
318,
7373,
351,
584,
6805,
13,
632,
318,
691,
1944,
618,
262,
4630,
6030,
2214,
318,
900,
284,
8740,
52,
62,
25216,
62,
4760,
28934,
38,
6158,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
2560,
62,
32838,
25,
383,
2560,
62,
32838,
286,
428,
11923,
3861,
926,
7657,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
4906,
25,
16774,
27535,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
8000,
62,
32838,
796,
2560,
62,
32838,
628,
220,
220,
220,
2488,
26745,
198,
220,
220,
220,
825,
374,
2213,
62,
42348,
62,
7890,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
29620,
262,
374,
2213,
62,
42348,
62,
7890,
286,
428,
11923,
3861,
926,
7657,
13,
198,
220,
220,
220,
220,
220,
220,
220,
770,
2214,
4909,
262,
4036,
6460,
329,
262,
3492,
12,
1462,
12,
28956,
1366,
13,
632,
318,
691,
1944,
618,
262,
4630,
6030,
2214,
318,
900,
284,
8740,
52,
62,
25216,
62,
35,
1961,
2149,
11617,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
383,
374,
2213,
62,
42348,
62,
7890,
286,
428,
11923,
3861,
926,
7657,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
81,
4906,
25,
11923,
3861,
926,
4163,
6601,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
35827,
14,
25968,
25,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13557,
81,
2213,
62,
42348,
62,
7890,
628,
220,
220,
220,
2488,
81,
2213,
62,
42348,
62,
7890,
13,
2617,
353,
198,
220,
220,
220,
825,
374,
2213,
62,
42348,
62,
7890,
7,
944,
11,
374,
2213,
62,
42348,
62,
7890,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
21394,
262,
374,
2213,
62,
42348,
62,
7890,
286,
428,
11923,
3861,
926,
7657,
13,
198,
220,
220,
220,
220,
220,
220,
220,
770,
2214,
4909,
262,
4036,
6460,
329,
262,
3492,
12,
1462,
12,
28956,
1366,
13,
632,
318,
691,
1944,
618,
262,
4630,
6030,
2214,
318,
900,
284,
8740,
52,
62,
25216,
62,
35,
1961,
2149,
11617,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
374,
2213,
62,
42348,
62,
7890,
25,
383,
374,
2213,
62,
42348,
62,
7890,
286,
428,
11923,
3861,
926,
7657,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
4906,
25,
11923,
3861,
926,
4163,
6601,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
81,
2213,
62,
42348,
62,
7890,
796,
374,
2213,
62,
42348,
62,
7890,
628,
220,
220,
220,
825,
284,
62,
11600,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
16409,
262,
2746,
6608,
355,
257,
8633,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
329,
708,
81,
11,
4808,
287,
11629,
23814,
7,
944,
13,
2032,
7928,
62,
19199,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1988,
796,
651,
35226,
7,
944,
11,
708,
81,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
318,
39098,
7,
8367,
11,
1351,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
58,
35226,
60,
796,
1351,
7,
8899,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37456,
2124,
25,
2124,
13,
1462,
62,
11600,
3419,
611,
468,
35226,
7,
87,
11,
366,
1462,
62,
11600,
4943,
2073,
2124,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1988,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15306,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
468,
35226,
7,
8367,
11,
366,
1462,
62,
11600,
1,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
58,
35226,
60,
796,
1988,
13,
1462,
62,
11600,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
318,
39098,
7,
8367,
11,
8633,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
58,
35226,
60,
796,
8633,
7,
8899,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37456,
2378,
25,
357,
9186,
58,
15,
4357,
2378,
58,
16,
4083,
1462,
62,
11600,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
468,
35226,
7,
9186,
58,
16,
4357,
366,
1462,
62,
11600,
4943,
2073,
2378,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1988,
13,
23814,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15306,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
58,
35226,
60,
796,
1988,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
1255,
628,
220,
220,
220,
825,
284,
62,
2536,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
16409,
262,
4731,
10552,
286,
262,
2746,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
279,
18982,
7,
944,
13,
1462,
62,
11600,
28955,
628,
220,
220,
220,
825,
11593,
260,
1050,
834,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1114,
4600,
4798,
63,
290,
4600,
381,
22272,
63,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
1462,
62,
2536,
3419,
628,
220,
220,
220,
825,
11593,
27363,
834,
7,
944,
11,
584,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
16409,
2081,
611,
1111,
5563,
389,
4961,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
318,
6045,
393,
584,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
834,
11600,
834,
6624,
584,
13,
834,
11600,
834,
628,
220,
220,
220,
825,
11593,
710,
834,
7,
944,
11,
584,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
16409,
2081,
611,
1111,
5563,
389,
407,
4961,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
407,
2116,
6624,
584,
628
] | 2.473499 | 2,849 |
import gym, ray
#Import any agents you want to train, list found here: https://docs.ray.io/en/latest/rllib/rllib-algorithms.html
from ray.rllib.agents import ppo,dqn,a3c
from environments.defender_game import PowerGrid
import pypsa
import numpy as np
from ray.tune.registry import register_env
import pickle
import time
from ray.tune.logger import pretty_print
from agents import RandomAgent
#Initializing relevant variables
ray.init()
network = pypsa.Network('lopf_grid.nc')
LINES = network.lines.shape[0]
attack_distribution = np.random.dirichlet(np.ones(LINES),size= 1)[0]
agent_config = {
'action_distribution':attack_distribution
}
env_config = {
'network':network,
'agent_config':agent_config,
'agent_class':RandomAgent
}
agent = dqn.DQNTrainer(env=PowerGrid, config={
"env_config": env_config,
"num_workers": 8,
"n_step": 5,
"noisy": True,
"num_atoms": 5,
"v_min": 0,
"v_max": 1000.0,
})
#Change the range to desired amount of training iterations
#Runs our agent in the environment for specified number of iterations
for i in range(300):
try:
pop = agent.train()
print(pretty_print(pop))
time.sleep(5)
if i % 10 == 0:
checkpoint = agent.save()
print("checkpoint saved at", checkpoint)
except Exception as e:
print(e)
print("Error has occurred")
print(i)
| [
11748,
11550,
11,
26842,
198,
2,
20939,
597,
6554,
345,
765,
284,
4512,
11,
1351,
1043,
994,
25,
3740,
1378,
31628,
13,
2433,
13,
952,
14,
268,
14,
42861,
14,
81,
297,
571,
14,
81,
297,
571,
12,
282,
7727,
907,
13,
6494,
198,
6738,
26842,
13,
81,
297,
571,
13,
49638,
1330,
279,
7501,
11,
49506,
77,
11,
64,
18,
66,
198,
6738,
12493,
13,
4299,
2194,
62,
6057,
1330,
4333,
41339,
198,
11748,
12972,
862,
64,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
26842,
13,
83,
1726,
13,
2301,
4592,
1330,
7881,
62,
24330,
198,
11748,
2298,
293,
198,
11748,
640,
198,
6738,
26842,
13,
83,
1726,
13,
6404,
1362,
1330,
2495,
62,
4798,
198,
6738,
6554,
1330,
14534,
36772,
198,
198,
2,
24243,
2890,
5981,
9633,
198,
2433,
13,
15003,
3419,
198,
27349,
796,
12972,
862,
64,
13,
26245,
10786,
75,
404,
69,
62,
25928,
13,
10782,
11537,
198,
34509,
1546,
796,
3127,
13,
6615,
13,
43358,
58,
15,
60,
198,
20358,
62,
17080,
3890,
796,
220,
45941,
13,
25120,
13,
15908,
488,
1616,
7,
37659,
13,
1952,
7,
34509,
1546,
828,
7857,
28,
352,
38381,
15,
60,
198,
198,
25781,
62,
11250,
796,
1391,
198,
220,
705,
2673,
62,
17080,
3890,
10354,
20358,
62,
17080,
3890,
198,
92,
198,
198,
24330,
62,
11250,
796,
1391,
198,
220,
705,
27349,
10354,
27349,
11,
198,
220,
705,
25781,
62,
11250,
10354,
25781,
62,
11250,
11,
198,
220,
705,
25781,
62,
4871,
10354,
29531,
36772,
198,
220,
1782,
198,
198,
25781,
796,
288,
80,
77,
13,
35,
48,
45,
2898,
10613,
7,
24330,
28,
13434,
41339,
11,
4566,
34758,
198,
220,
220,
220,
366,
24330,
62,
11250,
1298,
17365,
62,
11250,
11,
220,
198,
220,
220,
220,
366,
22510,
62,
22896,
1298,
807,
11,
198,
220,
220,
220,
366,
77,
62,
9662,
1298,
642,
11,
198,
220,
220,
220,
366,
3919,
13560,
1298,
6407,
11,
198,
220,
220,
220,
366,
22510,
62,
265,
3150,
1298,
642,
11,
198,
220,
220,
220,
366,
85,
62,
1084,
1298,
657,
11,
198,
220,
220,
220,
366,
85,
62,
9806,
1298,
8576,
13,
15,
11,
198,
30072,
198,
198,
2,
19400,
262,
2837,
284,
10348,
2033,
286,
3047,
34820,
198,
2,
10987,
82,
674,
5797,
287,
262,
2858,
329,
7368,
1271,
286,
34820,
198,
1640,
1312,
287,
2837,
7,
6200,
2599,
198,
220,
1949,
25,
198,
220,
220,
220,
1461,
796,
5797,
13,
27432,
3419,
198,
220,
220,
220,
3601,
7,
37784,
62,
4798,
7,
12924,
4008,
198,
220,
220,
220,
640,
13,
42832,
7,
20,
8,
198,
220,
220,
220,
611,
1312,
4064,
838,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
26954,
796,
5797,
13,
21928,
3419,
198,
220,
220,
220,
220,
220,
220,
3601,
7203,
9122,
4122,
7448,
379,
1600,
26954,
8,
198,
220,
2845,
35528,
355,
304,
25,
198,
220,
220,
220,
3601,
7,
68,
8,
198,
220,
220,
220,
3601,
7203,
12331,
468,
5091,
4943,
198,
220,
220,
220,
3601,
7,
72,
8,
628
] | 2.711423 | 499 |
import random
# mod-sqrt | [
11748,
4738,
198,
198,
2,
953,
12,
31166,
17034
] | 2.777778 | 9 |
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
import sys
# Supporting Python3
try:
import urllib.request as request
except ImportError:
import urllib as request
import xml.etree.ElementTree as ET
import argparse
import pymysql
import pyodbc
import psycopg2
# ################################################################################
# CV Objects
# ################################################################################
from sqlalchemy import Column, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
metadata = Base.metadata
# -----------------------------------------------------------------------------
# handles customizing the error messages from Argparse
# -----------------------------------------------------------------------------
# handle argument parsing
info = "A simple script that loads up cvterms into a blank ODM2 database"
parser = MyParser(description=info, add_help=True)
parser.add_argument(
help="Format: {engine}+{driver}://{user}:{pass}@{address}/{db}\n"
"mysql+pymysql://ODM:odm@localhost/odm2\n\n"
"mssql+pyodbc://ODM:123@localhost/odm2?driver=SQL+Server+Native+Client+11.0\n"
"postgresql+psycopg2://ODM:[email protected]/odm2\n"
"sqlite+pysqlite:///path/to/file",
default=True, type=str, dest='conn_string')
parser.add_argument('-d', '--debug',
help="Debugging program without committing anything to"
" remote database",
action="store_true")
args = parser.parse_args()
# ------------------------------------------------------------------------------
# Script Begin
# ------------------------------------------------------------------------------
## Verify connection string
conn_string = args.conn_string
engine = None
session = None
try:
# engine = create_engine(conn_string, encoding='utf-8')
engine = create_engine(conn_string, encoding='unicode_escape')
setSchema(engine)
session = sessionmaker(bind=engine)()
except Exception as e:
print (e)
sys.exit(0)
print ("Loading CVs using connection string: %s" % conn_string)
vocab= [("actiontype", CVActionType),
("qualitycode", CVQualityCode),
("samplingfeaturegeotype", CVSamplingFeatureGeoType),
("elevationdatum", CVElevationDatum),
("resulttype", CVResultType),
#("sampledmedium", CVSampledMedium),
("speciation", CVSpeciation),
("aggregationstatistic", CVAggregationStatistic),
("methodtype", CVMethodType),
("taxonomicclassifiertype", CVTaxonomicClassifierType),
("sitetype", CVSiteType),
("censorcode", CVCensorCode),
("directivetype", CVDirectiveType),
("datasettype",CVDatasetType),
("dataqualitytype",CVDataQualityType),
("organizationtype", CVOrganizationType),
("status", CVStatus),
("annotationtype", CVAnnotationType),
("samplingfeaturetype", CVSamplingFeatureType),
("equipmenttype", CVEquipmentType),
#("specimenmedium", CVSpecimenMedium),
("spatialoffsettype", CVSpatialOffsetType),
#("referencematerialmedium", CVReferenceMaterialMedium),
("specimentype", CVSpecimenType),
("variabletype", CVVariableType),
("variablename", CVVariableName),
("propertydatatype", CVPropertyDataType),
("relationshiptype", CVRelationshipType),
("unitstype", CVUnitsType),
("medium", CVMediumType)
]
url = "http://vocabulary.odm2.org/api/v1/%s/?format=skos"
#XML encodings
dc = "{http://purl.org/dc/elements/1.1/}%s"
rdf = "{http://www.w3.org/1999/02/22-rdf-syntax-ns#}%s"
skos = "{http://www.w3.org/2004/02/skos/core#}%s"
odm2 = "{http://vocabulary.odm2.org/ODM2/ODM2Terms/}%s"
# ------------------------------------------------------------------------------
# Progress bar
# ------------------------------------------------------------------------------
for count, (key, value) in enumerate(vocab):
# print (count, key, value)
# print ("\tLoading %s" % key)
update_progress(count, value)
try:
data = request.urlopen(url % key).read()
root = ET.fromstring(data)
CVObject = value
objs = []
for voc in root.findall(rdf %"Description"):
obj = CVObject()
try:
obj.Term = voc.attrib[rdf%"about"].split('/')[-1]
obj.Name = voc.find(skos%"prefLabel").text
# obj.Definition = voc.find(skos%"definition").text.encode('UTF-8') if voc.find(skos%"definition") is not None else None
obj.Definition = voc.find(skos%"definition").text.encode('unicode_escape') if voc.find(skos%"definition") is not None else None
obj.Category = category = voc.find(odm2%"category").text if voc.find(odm2 % "category") is not None else None
obj.SourceVocabularyUri = voc.attrib[rdf%"about"]
objs.append(obj)
except Exception as e:
session.rollback()
if obj.Name is not None:
print ("issue loading single object %s: %s " %(obj.Name, e))
pass
session.add_all(objs)
if not args.debug:
session.commit()
except Exception as e:
session.rollback()
if "Duplicate entry" in e.message:
e = "Controlled Vocabulary has already been loaded"
print ("\t...%s Load was unsuccesful: \n%s" % (key, e))
sys.stdout.write("\n\n... %sLoad was unsuccessful: %s\r"%(key,e))
sys.stdout.flush()
update_progress(len(vocab), "CV_Terms")
sys.stdout.write("\nCV Load has completed\r\n")
sys.stdout.flush()
| [
6738,
44161,
282,
26599,
1330,
2251,
62,
18392,
201,
198,
6738,
44161,
282,
26599,
13,
579,
1330,
6246,
10297,
201,
198,
11748,
25064,
201,
198,
201,
198,
2,
44188,
11361,
18,
201,
198,
28311,
25,
201,
198,
220,
220,
220,
1330,
2956,
297,
571,
13,
25927,
355,
2581,
201,
198,
16341,
17267,
12331,
25,
201,
198,
220,
220,
220,
1330,
2956,
297,
571,
355,
2581,
201,
198,
11748,
35555,
13,
316,
631,
13,
20180,
27660,
355,
12152,
201,
198,
11748,
1822,
29572,
201,
198,
201,
198,
11748,
279,
4948,
893,
13976,
201,
198,
11748,
12972,
375,
15630,
201,
198,
11748,
17331,
22163,
70,
17,
201,
198,
201,
198,
2,
1303,
29113,
29113,
7804,
4242,
21017,
201,
198,
2,
26196,
220,
35832,
201,
198,
2,
1303,
29113,
29113,
7804,
4242,
21017,
201,
198,
6738,
44161,
282,
26599,
1330,
29201,
11,
220,
10903,
201,
198,
6738,
44161,
282,
26599,
13,
2302,
13,
32446,
283,
876,
1330,
2377,
283,
876,
62,
8692,
201,
198,
201,
198,
14881,
796,
2377,
283,
876,
62,
8692,
3419,
201,
198,
38993,
796,
7308,
13,
38993,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
2,
16529,
32501,
201,
198,
2,
17105,
2183,
2890,
262,
4049,
6218,
422,
20559,
29572,
201,
198,
2,
16529,
32501,
201,
198,
201,
198,
2,
5412,
4578,
32096,
201,
198,
10951,
796,
366,
32,
2829,
4226,
326,
15989,
510,
269,
85,
38707,
656,
257,
9178,
440,
23127,
17,
6831,
1,
201,
198,
48610,
796,
2011,
46677,
7,
11213,
28,
10951,
11,
751,
62,
16794,
28,
17821,
8,
201,
198,
48610,
13,
2860,
62,
49140,
7,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1037,
2625,
26227,
25,
1391,
18392,
92,
10,
90,
26230,
92,
1378,
90,
7220,
92,
29164,
6603,
92,
31,
90,
21975,
92,
14,
90,
9945,
32239,
77,
1,
201,
198,
220,
220,
220,
220,
220,
220,
220,
366,
28744,
13976,
10,
79,
4948,
893,
13976,
1378,
3727,
44,
25,
375,
76,
31,
36750,
14,
375,
76,
17,
59,
77,
59,
77,
1,
201,
198,
220,
220,
220,
220,
220,
220,
220,
366,
76,
824,
13976,
10,
9078,
375,
15630,
1378,
3727,
44,
25,
10163,
31,
36750,
14,
375,
76,
17,
30,
26230,
28,
17861,
10,
10697,
10,
31272,
10,
11792,
10,
1157,
13,
15,
59,
77,
1,
201,
198,
220,
220,
220,
220,
220,
220,
220,
366,
7353,
34239,
13976,
10,
13764,
22163,
70,
17,
1378,
3727,
44,
25,
375,
76,
31,
9288,
13,
84,
18351,
75,
13,
385,
84,
13,
15532,
14,
375,
76,
17,
59,
77,
1,
201,
198,
220,
220,
220,
220,
220,
220,
220,
366,
25410,
578,
10,
79,
893,
13976,
578,
1378,
14,
6978,
14,
1462,
14,
7753,
1600,
201,
198,
220,
220,
220,
220,
220,
220,
220,
4277,
28,
17821,
11,
2099,
28,
2536,
11,
2244,
11639,
37043,
62,
8841,
11537,
201,
198,
48610,
13,
2860,
62,
49140,
10786,
12,
67,
3256,
705,
438,
24442,
3256,
220,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1037,
2625,
27509,
2667,
1430,
1231,
17222,
1997,
284,
1,
201,
198,
220,
220,
220,
220,
220,
220,
220,
366,
6569,
6831,
1600,
201,
198,
220,
220,
220,
220,
220,
220,
220,
2223,
2625,
8095,
62,
7942,
4943,
201,
198,
22046,
796,
30751,
13,
29572,
62,
22046,
3419,
201,
198,
201,
198,
2,
16529,
26171,
201,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12327,
16623,
201,
198,
2,
16529,
26171,
201,
198,
2235,
49899,
4637,
4731,
220,
201,
198,
37043,
62,
8841,
796,
26498,
13,
37043,
62,
8841,
201,
198,
201,
198,
201,
198,
201,
198,
18392,
796,
6045,
201,
198,
29891,
796,
6045,
201,
198,
28311,
25,
201,
198,
220,
220,
220,
1303,
3113,
796,
2251,
62,
18392,
7,
37043,
62,
8841,
11,
21004,
11639,
40477,
12,
23,
11537,
201,
198,
220,
220,
220,
3113,
796,
2251,
62,
18392,
7,
37043,
62,
8841,
11,
21004,
11639,
46903,
1098,
62,
41915,
11537,
201,
198,
220,
220,
220,
900,
27054,
2611,
7,
18392,
8,
201,
198,
220,
220,
220,
6246,
796,
6246,
10297,
7,
21653,
28,
18392,
8,
3419,
201,
198,
16341,
35528,
355,
304,
25,
201,
198,
220,
220,
220,
3601,
357,
68,
8,
201,
198,
220,
220,
220,
25064,
13,
37023,
7,
15,
8,
201,
198,
201,
198,
4798,
5855,
19031,
327,
23266,
1262,
4637,
4731,
25,
4064,
82,
1,
4064,
48260,
62,
8841,
8,
201,
198,
201,
198,
201,
198,
18893,
397,
28,
685,
7203,
2673,
4906,
1600,
327,
11731,
596,
6030,
828,
201,
198,
220,
220,
220,
220,
220,
220,
220,
5855,
13237,
8189,
1600,
26196,
35013,
10669,
828,
201,
198,
220,
220,
220,
220,
220,
220,
220,
5855,
37687,
11347,
30053,
469,
8690,
1600,
26196,
16305,
11347,
38816,
10082,
78,
6030,
828,
201,
198,
220,
220,
220,
220,
220,
220,
220,
5855,
68,
2768,
341,
19608,
388,
1600,
24640,
2768,
341,
35,
21307,
828,
201,
198,
220,
220,
220,
220,
220,
220,
220,
5855,
20274,
4906,
1600,
26196,
23004,
6030,
828,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
7203,
37687,
10137,
24132,
1600,
26196,
16305,
10137,
31205,
828,
201,
198,
220,
220,
220,
220,
220,
220,
220,
5855,
4125,
17269,
1600,
26196,
5248,
17269,
828,
201,
198,
220,
220,
220,
220,
220,
220,
220,
5855,
9460,
43068,
14269,
2569,
1600,
327,
11731,
1130,
43068,
17126,
2569,
828,
201,
198,
220,
220,
220,
220,
220,
220,
220,
5855,
24396,
4906,
1600,
26196,
17410,
6030,
828,
201,
198,
220,
220,
220,
220,
220,
220,
220,
5855,
19290,
40036,
4871,
7483,
4906,
1600,
26196,
27017,
40036,
9487,
7483,
6030,
828,
201,
198,
220,
220,
220,
220,
220,
220,
220,
5855,
48937,
2963,
431,
1600,
327,
20304,
578,
6030,
828,
201,
198,
220,
220,
220,
220,
220,
220,
220,
5855,
66,
22854,
8189,
1600,
327,
15922,
22854,
10669,
828,
201,
198,
220,
220,
220,
220,
220,
220,
220,
5855,
12942,
425,
4906,
1600,
327,
8898,
1060,
425,
6030,
828,
201,
198,
220,
220,
220,
220,
220,
220,
220,
5855,
19608,
292,
316,
4906,
1600,
34,
8898,
265,
292,
316,
6030,
828,
201,
198,
220,
220,
220,
220,
220,
220,
220,
5855,
7890,
13237,
4906,
1600,
33538,
6601,
35013,
6030,
828,
201,
198,
220,
220,
220,
220,
220,
220,
220,
5855,
9971,
1634,
4906,
1600,
26196,
26121,
1634,
6030,
828,
201,
198,
220,
220,
220,
220,
220,
220,
220,
5855,
13376,
1600,
26196,
19580,
828,
201,
198,
220,
220,
220,
220,
220,
220,
220,
5855,
1236,
14221,
4906,
1600,
26196,
2025,
38983,
6030,
828,
201,
198,
220,
220,
220,
220,
220,
220,
220,
5855,
37687,
11347,
30053,
4906,
1600,
26196,
16305,
11347,
38816,
6030,
828,
201,
198,
220,
220,
220,
220,
220,
220,
220,
5855,
4853,
4667,
4906,
1600,
24640,
421,
4667,
6030,
828,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
7203,
16684,
19027,
24132,
1600,
26196,
22882,
19027,
31205,
828,
201,
198,
220,
220,
220,
220,
220,
220,
220,
5855,
2777,
34961,
28968,
4906,
1600,
26196,
4561,
34961,
34519,
6030,
828,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
7203,
35790,
33665,
24132,
1600,
26196,
26687,
17518,
31205,
828,
201,
198,
220,
220,
220,
220,
220,
220,
220,
5855,
16684,
3681,
2981,
1600,
26196,
22882,
19027,
6030,
828,
201,
198,
220,
220,
220,
220,
220,
220,
220,
5855,
45286,
4906,
1600,
26196,
43015,
6030,
828,
201,
198,
220,
220,
220,
220,
220,
220,
220,
5855,
25641,
397,
11925,
480,
1600,
26196,
43015,
5376,
828,
201,
198,
220,
220,
220,
220,
220,
220,
220,
5855,
26745,
19608,
265,
2981,
1600,
26196,
21746,
6601,
6030,
828,
201,
198,
220,
220,
220,
220,
220,
220,
220,
5855,
39468,
5303,
457,
2981,
1600,
26196,
47117,
1056,
6030,
828,
201,
198,
220,
220,
220,
220,
220,
220,
220,
5855,
20850,
301,
2981,
1600,
26196,
3118,
896,
6030,
828,
201,
198,
220,
220,
220,
220,
220,
220,
220,
5855,
24132,
1600,
26196,
31205,
6030,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
2361,
201,
198,
201,
198,
6371,
796,
366,
4023,
1378,
18893,
22528,
13,
375,
76,
17,
13,
2398,
14,
15042,
14,
85,
16,
14,
4,
82,
20924,
18982,
28,
8135,
418,
1,
201,
198,
201,
198,
2,
55,
5805,
2207,
375,
654,
201,
198,
17896,
796,
45144,
4023,
1378,
79,
6371,
13,
2398,
14,
17896,
14,
68,
3639,
14,
16,
13,
16,
14,
92,
4,
82,
1,
201,
198,
4372,
69,
796,
45144,
4023,
1378,
2503,
13,
86,
18,
13,
2398,
14,
18946,
14,
2999,
14,
1828,
12,
4372,
69,
12,
1837,
41641,
12,
5907,
2,
92,
4,
82,
1,
201,
198,
8135,
418,
796,
45144,
4023,
1378,
2503,
13,
86,
18,
13,
2398,
14,
15724,
14,
2999,
14,
8135,
418,
14,
7295,
2,
92,
4,
82,
1,
201,
198,
375,
76,
17,
796,
45144,
4023,
1378,
18893,
22528,
13,
375,
76,
17,
13,
2398,
14,
3727,
44,
17,
14,
3727,
44,
17,
15156,
907,
14,
92,
4,
82,
1,
201,
198,
201,
198,
2,
16529,
26171,
201,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
18387,
2318,
220,
201,
198,
2,
16529,
26171,
201,
198,
201,
198,
1640,
954,
11,
357,
2539,
11,
1988,
8,
287,
27056,
378,
7,
18893,
397,
2599,
201,
198,
220,
220,
220,
1303,
3601,
357,
9127,
11,
1994,
11,
1988,
8,
201,
198,
220,
220,
220,
1303,
3601,
5855,
59,
83,
19031,
4064,
82,
1,
4064,
1994,
8,
201,
198,
220,
220,
220,
4296,
62,
33723,
7,
9127,
11,
1988,
8,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
201,
198,
220,
220,
220,
1949,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1366,
796,
2581,
13,
6371,
9654,
7,
6371,
4064,
1994,
737,
961,
3419,
201,
198,
220,
220,
220,
220,
220,
220,
220,
6808,
796,
12152,
13,
6738,
8841,
7,
7890,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
26196,
10267,
796,
1988,
201,
198,
220,
220,
220,
220,
220,
220,
220,
909,
8457,
796,
17635,
201,
198,
220,
220,
220,
220,
220,
220,
220,
329,
12776,
287,
6808,
13,
19796,
439,
7,
4372,
69,
4064,
1,
11828,
1,
2599,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26181,
796,
26196,
10267,
3419,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26181,
13,
40596,
796,
12776,
13,
1078,
822,
58,
4372,
69,
39658,
10755,
1,
4083,
35312,
10786,
14,
11537,
58,
12,
16,
60,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26181,
13,
5376,
796,
12776,
13,
19796,
7,
8135,
418,
39658,
3866,
69,
33986,
11074,
5239,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
26181,
13,
36621,
796,
12776,
13,
19796,
7,
8135,
418,
39658,
46758,
11074,
5239,
13,
268,
8189,
10786,
48504,
12,
23,
11537,
611,
12776,
13,
19796,
7,
8135,
418,
39658,
46758,
4943,
318,
407,
6045,
2073,
6045,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26181,
13,
36621,
796,
12776,
13,
19796,
7,
8135,
418,
39658,
46758,
11074,
5239,
13,
268,
8189,
10786,
46903,
1098,
62,
41915,
11537,
611,
12776,
13,
19796,
7,
8135,
418,
39658,
46758,
4943,
318,
407,
6045,
2073,
6045,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26181,
13,
27313,
796,
6536,
796,
12776,
13,
19796,
7,
375,
76,
17,
39658,
22872,
11074,
5239,
611,
12776,
13,
19796,
7,
375,
76,
17,
4064,
366,
22872,
4943,
318,
407,
6045,
2073,
6045,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26181,
13,
7416,
53,
420,
22528,
52,
380,
796,
12776,
13,
1078,
822,
58,
4372,
69,
39658,
10755,
8973,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
909,
8457,
13,
33295,
7,
26801,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2845,
35528,
355,
304,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6246,
13,
2487,
1891,
3419,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
26181,
13,
5376,
318,
407,
6045,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
5855,
21949,
11046,
2060,
2134,
4064,
82,
25,
4064,
82,
366,
4064,
7,
26801,
13,
5376,
11,
304,
4008,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1208,
201,
198,
220,
220,
220,
220,
220,
220,
220,
6246,
13,
2860,
62,
439,
7,
672,
8457,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
611,
407,
26498,
13,
24442,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6246,
13,
41509,
3419,
201,
198,
220,
220,
220,
2845,
35528,
355,
304,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
6246,
13,
2487,
1891,
3419,
201,
198,
220,
220,
220,
220,
220,
220,
220,
611,
366,
35660,
489,
5344,
5726,
1,
287,
304,
13,
20500,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
304,
796,
366,
4264,
8375,
47208,
22528,
468,
1541,
587,
9639,
1,
201,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
5855,
59,
83,
986,
4,
82,
8778,
373,
48092,
535,
274,
913,
25,
3467,
77,
4,
82,
1,
4064,
357,
2539,
11,
304,
4008,
201,
198,
220,
220,
220,
220,
220,
220,
220,
25064,
13,
19282,
448,
13,
13564,
7203,
59,
77,
59,
77,
986,
4064,
82,
8912,
373,
23993,
25,
4064,
82,
59,
81,
1,
4,
7,
2539,
11,
68,
4008,
201,
198,
220,
220,
220,
220,
220,
220,
220,
25064,
13,
19282,
448,
13,
25925,
3419,
201,
198,
201,
198,
19119,
62,
33723,
7,
11925,
7,
18893,
397,
828,
366,
33538,
62,
15156,
907,
4943,
201,
198,
17597,
13,
19282,
448,
13,
13564,
7203,
59,
77,
33538,
8778,
468,
5668,
59,
81,
59,
77,
4943,
201,
198,
17597,
13,
19282,
448,
13,
25925,
3419,
201,
198,
201,
198
] | 2.424426 | 2,481 |
"""
Module containing functions to differentiate functions using pytorch.
"""
import functools
import warnings
import numpy as np
try:
import torch
except ImportError:
torch = None
else:
from torch import autograd
from ._backend import Backend
from .. import make_tracing_backend_decorator
from ...tools import bisect_sequence, unpack_singleton_sequence_return_value
PyTorch = make_tracing_backend_decorator(_PyTorchBackend)
| [
37811,
198,
26796,
7268,
5499,
284,
28754,
5499,
1262,
12972,
13165,
354,
13,
198,
37811,
198,
11748,
1257,
310,
10141,
198,
11748,
14601,
198,
198,
11748,
299,
32152,
355,
45941,
198,
28311,
25,
198,
220,
220,
220,
1330,
28034,
198,
16341,
17267,
12331,
25,
198,
220,
220,
220,
28034,
796,
6045,
198,
17772,
25,
198,
220,
220,
220,
422,
28034,
1330,
1960,
519,
6335,
198,
198,
6738,
47540,
1891,
437,
1330,
5157,
437,
198,
6738,
11485,
1330,
787,
62,
2213,
4092,
62,
1891,
437,
62,
12501,
273,
1352,
198,
6738,
2644,
31391,
1330,
47457,
478,
62,
43167,
11,
555,
8002,
62,
12215,
10565,
62,
43167,
62,
7783,
62,
8367,
628,
198,
198,
20519,
15884,
354,
796,
787,
62,
2213,
4092,
62,
1891,
437,
62,
12501,
273,
1352,
28264,
20519,
15884,
354,
7282,
437,
8,
198
] | 3.274074 | 135 |
import os
from pathlib import Path
import sys
# Taking input
print_string = """
Type Path of the directory
OR
Press enter for running the script on current directory:
OR
Type quit
"""
print(print_string + "\n\n")
input_path = input("Input:")
print("\n\n")
# Script will terminate if input is 'quit'
if input_path == "quit":
sys.exit(1)
# If nothing is entered then current working directory will be taken as the input path
if input_path == "":
input_path = os.getcwd()
input_path = Path(input_path)
# Changing the working directory to input path
os.chdir(input_path)
# Creates a dictionary "dic" with key,value pairs where key is extension and value is no. of files with that extension
dic = {}
for file in os.listdir(os.getcwd()):
if os.path.isfile(file):
extension = file.split(".")[-1]
dic[extension] = dic.get(extension, 0) + 1
for key in dic:
print(f"There are {dic[key]} files file with extension {key}")
print("\n\n")
# assigning a variable named current Path of current working directory just for simplicity.
# could have used input_path too
current = Path(os.getcwd())
'''
When this script would run the structure of the current directory would change.Hence,
we are assigning list_dir variable the files and dirs in current working directory which the script would modify
'''
list_dir = os.listdir(current)
# keys of dic are extensions of the file
for key in dic:
# try except block for making directory if it doesn't exists already
try:
os.mkdir(key)
except:
print(
f"directory named {key} already exists so it won't be overwrited \n"
)
# goes through the files in list_dir
# we are not using os.listdir() as the directory structure will change during the execution
for file in list_dir:
if file.split(".")[-1] == key and os.path.isfile(file):
# prints absolute path of the file
print(os.path.abspath(file))
# Renames the path of the file or moves the file in to the newly created directory
Path.rename(Path(os.path.abspath(file)),
current / Path("./{}/".format(key) + file))
# This block just prints a note and the current structure of the directory
print(
"\n Script has organised files as per their extensions into different directories! \n"
)
for file in os.listdir(os.getcwd()):
if not (os.path.isfile(file)):
print(file)
| [
11748,
28686,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
25064,
198,
198,
2,
20879,
5128,
198,
4798,
62,
8841,
796,
37227,
198,
6030,
10644,
286,
262,
8619,
198,
1581,
198,
13800,
3802,
329,
2491,
262,
4226,
319,
1459,
8619,
25,
198,
1581,
198,
6030,
11238,
198,
37811,
198,
4798,
7,
4798,
62,
8841,
1343,
37082,
77,
59,
77,
4943,
198,
15414,
62,
6978,
796,
5128,
7203,
20560,
25,
4943,
198,
4798,
7203,
59,
77,
59,
77,
4943,
198,
198,
2,
12327,
481,
23654,
611,
5128,
318,
705,
47391,
6,
198,
361,
5128,
62,
6978,
6624,
366,
47391,
1298,
198,
220,
220,
220,
25064,
13,
37023,
7,
16,
8,
198,
198,
2,
1002,
2147,
318,
5982,
788,
1459,
1762,
8619,
481,
307,
2077,
355,
262,
5128,
3108,
198,
361,
5128,
62,
6978,
6624,
366,
1298,
198,
220,
220,
220,
5128,
62,
6978,
796,
28686,
13,
1136,
66,
16993,
3419,
198,
198,
15414,
62,
6978,
796,
10644,
7,
15414,
62,
6978,
8,
198,
198,
2,
33680,
262,
1762,
8619,
284,
5128,
3108,
198,
418,
13,
354,
15908,
7,
15414,
62,
6978,
8,
198,
198,
2,
7921,
274,
257,
22155,
366,
67,
291,
1,
351,
1994,
11,
8367,
14729,
810,
1994,
318,
7552,
290,
1988,
318,
645,
13,
286,
3696,
351,
326,
7552,
198,
67,
291,
796,
23884,
198,
1640,
2393,
287,
28686,
13,
4868,
15908,
7,
418,
13,
1136,
66,
16993,
3419,
2599,
198,
220,
220,
220,
611,
28686,
13,
6978,
13,
4468,
576,
7,
7753,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
7552,
796,
2393,
13,
35312,
7203,
19570,
58,
12,
16,
60,
198,
220,
220,
220,
220,
220,
220,
220,
288,
291,
58,
2302,
3004,
60,
796,
288,
291,
13,
1136,
7,
2302,
3004,
11,
657,
8,
1343,
352,
198,
198,
1640,
1994,
287,
288,
291,
25,
198,
220,
220,
220,
3601,
7,
69,
1,
1858,
389,
1391,
67,
291,
58,
2539,
48999,
3696,
220,
2393,
351,
7552,
1391,
2539,
92,
4943,
198,
4798,
7203,
59,
77,
59,
77,
4943,
198,
198,
2,
38875,
257,
7885,
3706,
1459,
10644,
286,
1459,
1762,
8619,
655,
329,
21654,
13,
198,
2,
714,
423,
973,
5128,
62,
6978,
1165,
198,
14421,
796,
10644,
7,
418,
13,
1136,
66,
16993,
28955,
198,
7061,
6,
198,
2215,
428,
4226,
561,
1057,
262,
4645,
286,
262,
1459,
8619,
561,
1487,
13,
39,
594,
11,
198,
732,
389,
38875,
1351,
62,
15908,
7885,
262,
3696,
290,
288,
17062,
287,
1459,
1762,
8619,
543,
262,
4226,
561,
13096,
198,
7061,
6,
198,
4868,
62,
15908,
796,
28686,
13,
4868,
15908,
7,
14421,
8,
198,
198,
2,
8251,
286,
288,
291,
389,
18366,
286,
262,
2393,
198,
1640,
1994,
287,
288,
291,
25,
198,
220,
220,
220,
1303,
1949,
2845,
2512,
329,
1642,
8619,
611,
340,
1595,
470,
7160,
1541,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
28686,
13,
28015,
15908,
7,
2539,
8,
198,
220,
220,
220,
2845,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
1,
34945,
3706,
1391,
2539,
92,
1541,
7160,
523,
340,
1839,
470,
307,
6993,
799,
276,
3467,
77,
1,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
1303,
2925,
832,
262,
3696,
287,
1351,
62,
15908,
198,
220,
220,
220,
1303,
356,
389,
407,
1262,
28686,
13,
4868,
15908,
3419,
355,
262,
8619,
4645,
481,
1487,
1141,
262,
9706,
198,
220,
220,
220,
329,
2393,
287,
1351,
62,
15908,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2393,
13,
35312,
7203,
19570,
58,
12,
16,
60,
6624,
1994,
290,
28686,
13,
6978,
13,
4468,
576,
7,
7753,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
20842,
4112,
3108,
286,
262,
2393,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
418,
13,
6978,
13,
397,
2777,
776,
7,
7753,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
7152,
1047,
262,
3108,
286,
262,
2393,
393,
6100,
262,
2393,
287,
284,
262,
8308,
2727,
8619,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10644,
13,
918,
480,
7,
15235,
7,
418,
13,
6978,
13,
397,
2777,
776,
7,
7753,
36911,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1459,
1220,
10644,
7,
1911,
14,
90,
92,
14,
1911,
18982,
7,
2539,
8,
1343,
2393,
4008,
198,
198,
2,
770,
2512,
655,
20842,
257,
3465,
290,
262,
1459,
4645,
286,
262,
8619,
198,
198,
4798,
7,
198,
220,
220,
220,
37082,
77,
12327,
468,
20325,
3696,
355,
583,
511,
18366,
656,
1180,
29196,
0,
3467,
77,
1,
198,
8,
198,
1640,
2393,
287,
28686,
13,
4868,
15908,
7,
418,
13,
1136,
66,
16993,
3419,
2599,
198,
220,
220,
220,
611,
407,
357,
418,
13,
6978,
13,
4468,
576,
7,
7753,
8,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
7753,
8,
198
] | 2.864865 | 851 |
import time
from selenium import webdriver
from selenium import common
import func_timeout
import datetime
import requests
import logging
import zipfile
import winreg
import sys
import os
MAX_RETRIES = 0
def send_massage(content: str):
"""
发送短信/邮件
:param content: 邮件内容
:return: None
"""
# TODO: 发送短信/邮件
logger.info(content)
@func_timeout.func_set_timeout(60)
def download_chrome_driver():
"""
下载Chrome引擎
:return: None
"""
chrome_version = winreg.QueryValueEx(winreg.OpenKey(winreg.HKEY_CURRENT_USER, r'Software\Google\Chrome\BLBeacon'), 'version')[0]
while True:
res = requests.get('https://npm.taobao.org/mirrors/chromedriver/{}/chromedriver_win32.zip'.format(chrome_version), stream=True)
if res.status_code == 200:
with open('chromedriver_win32.zip', 'wb') as f:
f.write(res.content)
with zipfile.ZipFile('chromedriver_win32.zip', 'r') as f:
f.extract('chromedriver.exe')
os.remove('chromedriver_win32.zip')
break
else:
chrome_version = '.'.join(chrome_version.split('.')[:-1]) + '.' + str(int(chrome_version.split('.')[-1]) - 1)
@func_timeout.func_set_timeout(120)
def check_in(driver: webdriver, username: str, password: str, bbt: str):
"""
自动上报
:param driver: Chrome爬虫引擎
:param username: 统一身份认证用户名
:param password: 统一身份认证密码
:param bbt: 上报体温值
:return: None
"""
'''登录界面'''
driver.get('http://ehall.seu.edu.cn/appShow?appId=5821102911870447')
while (len(driver.find_elements_by_id('username')) == 0 or len(driver.find_elements_by_id('password')) == 0 or len(driver.find_elements_by_class_name('auth_login_btn')) == 0) \
and len(driver.find_elements_by_xpath('/html/body/main/article/section/div[2]/div[1]')) == 0:
pass
if len(driver.find_elements_by_id('username')) != 0 or len(driver.find_elements_by_id('password')) != 0 or len(driver.find_elements_by_class_name('auth_login_btn')) != 0:
input_username = driver.find_element_by_id('username')
input_username.click()
input_username.send_keys(username)
input_password = driver.find_element_by_id('password')
input_password.click()
input_password.send_keys(password)
button_xsfw = driver.find_element_by_class_name('auth_login_btn')
button_xsfw.click()
'''每日健康申报界面'''
while len(driver.find_elements_by_xpath('/html/body/main/article/section/div[2]/div[1]')) == 0:
pass
button_add = driver.find_element_by_xpath('/html/body/main/article/section/div[2]/div[1]')
button_add.click()
'''新增上报界面'''
while (len(driver.find_elements_by_name('DZ_JSDTCJTW')) == 0 or len(driver.find_elements_by_id('save')) == 0) and len(driver.find_elements_by_class_name('bh-dialog-center')) == 0:
pass
if len(driver.find_elements_by_class_name('bh-dialog-center')) != 0:
if '每日健康申报截止时间15:00' in driver.page_source:
logger.warning('每日健康申报截止时间15:00')
if '目前每日健康打卡时间是1时~15时,请在此时间内填报。' in driver.page_source:
logger.warning('目前每日健康打卡时间是1时~15时,请在此时间内填报。')
else:
logger.warning('今日已填报!')
driver.quit()
return
'''填写体温并提交'''
input_bbt = driver.find_element_by_name('DZ_JSDTCJTW')
driver.execute_script("arguments[0].click();", input_bbt)
input_bbt.send_keys(bbt)
button_save = driver.find_element_by_id('save')
driver.execute_script("arguments[0].click();", button_save)
while len(driver.find_elements_by_class_name('bh-bg-primary')) == 0:
pass
button_add = driver.find_element_by_class_name('bh-bg-primary')
button_add.click()
def try_to_check_in(driver: webdriver, username: str, password: str, bbt: str) -> int:
"""
尝试自动上报
:param driver: Chrome爬虫引擎
:param username: 统一身份认证用户名
:param password: 统一身份认证密码
:param bbt: 上报体温值
:return: 运行结果 0 成功 -1 失败
"""
global MAX_RETRIES
try:
check_in(driver, username, password, bbt)
return 0
except Exception as e:
if MAX_RETRIES < 10:
MAX_RETRIES += 1
logger.info('{} {} 上报失败\n{}\n正在重试第{}次...'.format(username, datetime.datetime.now().today(), e, MAX_RETRIES))
try_to_check_in(driver, username, password, bbt)
else:
logger.info('{} {} 上报失败\n{}\n重试次数超过上限...'.format(username, datetime.datetime.now().today(), e))
MAX_RETRIES = 0
return -1
def main(check_in_time: str, username: str, password: str, bbt: str, headless: bool):
"""
定时运行
:param check_in_time: 每日脚本运行时间
:param username: 统一身份认证用户名列表
:param password: 统一身份认证密码列表
:param bbt: 上报体温值列表
:param headless: 是否隐藏浏览器界面
:return: None
"""
'''检测引擎存在'''
if not os.path.exists('chromedriver.exe'):
download_chrome_driver()
'''检测引擎版本'''
try:
options = webdriver.ChromeOptions()
options.add_argument('--headless')
driver = webdriver.Chrome('chromedriver.exe', options=options)
driver.quit()
except common.exceptions.SessionNotCreatedException:
download_chrome_driver()
while True:
time.sleep(0.5)
if str(datetime.datetime.now().time())[:8] == check_in_time:
driver = None
'''初始化引擎'''
try:
options = webdriver.ChromeOptions()
options.add_experimental_option('excludeSwitches', ['enable-automation'])
options.add_argument('--disable-blink-features=AutomationControlled')
if headless:
options.add_argument('--headless')
options.add_argument('--disable-gpu')
driver = webdriver.Chrome('chromedriver.exe', options=options)
driver.execute_cdp_cmd("Page.addScriptToEvaluateOnNewDocument", {'source': 'Object.defineProperty(navigator, "webdriver", {get: () => undefined})'})
except Exception as e:
logger.error(e)
'''尝试自动上报'''
try:
res = try_to_check_in(driver, username, password, bbt)
content = '{} {} 上报{}!'.format(username, datetime.datetime.now().today(), '成功' if res == 0 else '失败')
except func_timeout.exceptions.FunctionTimedOut:
content = '{} {} 上报失败!'.format(username, datetime.datetime.now().today())
'''关闭引擎'''
try:
driver.quit()
except Exception as e:
logger.error(e)
'''发送短信/邮件'''
try:
send_massage(content)
except Exception as e:
logger.error(e)
if __name__ == '__main__':
log_time = time.localtime()
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')
file = open('{}.log'.format(time.strftime("%Y-%m-%d-%H-%M", log_time)), 'w')
file.close()
handler = logging.FileHandler('{}.log'.format(time.strftime("%Y-%m-%d-%H-%M", log_time)))
handler.setFormatter(formatter)
handler.setLevel(logging.INFO)
logger.addHandler(handler)
main(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4], True)
| [
11748,
640,
201,
198,
201,
198,
6738,
384,
11925,
1505,
1330,
3992,
26230,
201,
198,
6738,
384,
11925,
1505,
1330,
2219,
201,
198,
11748,
25439,
62,
48678,
201,
198,
11748,
4818,
8079,
201,
198,
11748,
7007,
201,
198,
11748,
18931,
201,
198,
11748,
19974,
7753,
201,
198,
11748,
1592,
2301,
201,
198,
11748,
25064,
201,
198,
11748,
28686,
201,
198,
201,
198,
201,
198,
22921,
62,
2200,
5446,
11015,
796,
657,
201,
198,
201,
198,
201,
198,
4299,
3758,
62,
22208,
496,
7,
11299,
25,
965,
2599,
201,
198,
220,
220,
220,
37227,
201,
198,
220,
220,
220,
10263,
237,
239,
34460,
223,
163,
253,
255,
46479,
94,
14,
165,
224,
106,
20015,
114,
201,
198,
201,
198,
220,
220,
220,
1058,
17143,
2695,
25,
16268,
224,
106,
20015,
114,
37863,
227,
22522,
117,
201,
198,
220,
220,
220,
1058,
7783,
25,
6045,
201,
198,
220,
220,
220,
37227,
201,
198,
220,
220,
220,
1303,
16926,
46,
25,
10263,
237,
239,
34460,
223,
163,
253,
255,
46479,
94,
14,
165,
224,
106,
20015,
114,
201,
198,
220,
220,
220,
49706,
13,
10951,
7,
11299,
8,
201,
198,
201,
198,
201,
198,
31,
20786,
62,
48678,
13,
20786,
62,
2617,
62,
48678,
7,
1899,
8,
201,
198,
4299,
4321,
62,
46659,
62,
26230,
33529,
201,
198,
220,
220,
220,
37227,
201,
198,
220,
220,
220,
220,
10310,
233,
164,
121,
121,
1925,
5998,
28156,
243,
162,
241,
236,
201,
198,
201,
198,
220,
220,
220,
1058,
7783,
25,
6045,
201,
198,
220,
220,
220,
37227,
201,
198,
220,
220,
220,
32030,
62,
9641,
796,
1592,
2301,
13,
20746,
11395,
3109,
7,
5404,
2301,
13,
11505,
9218,
7,
5404,
2301,
13,
39,
20373,
62,
34,
39237,
62,
29904,
11,
374,
6,
25423,
59,
11708,
59,
1925,
5998,
59,
9148,
3856,
7807,
33809,
705,
9641,
11537,
58,
15,
60,
201,
198,
201,
198,
220,
220,
220,
981,
6407,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
581,
796,
7007,
13,
1136,
10786,
5450,
1378,
77,
4426,
13,
8326,
672,
5488,
13,
2398,
14,
10793,
5965,
14,
28663,
276,
38291,
14,
90,
92,
14,
28663,
276,
38291,
62,
5404,
2624,
13,
13344,
4458,
18982,
7,
46659,
62,
9641,
828,
4269,
28,
17821,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
611,
581,
13,
13376,
62,
8189,
6624,
939,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
351,
1280,
10786,
28663,
276,
38291,
62,
5404,
2624,
13,
13344,
3256,
705,
39346,
11537,
355,
277,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
13,
13564,
7,
411,
13,
11299,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
351,
19974,
7753,
13,
41729,
8979,
10786,
28663,
276,
38291,
62,
5404,
2624,
13,
13344,
3256,
705,
81,
11537,
355,
277,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
13,
2302,
974,
10786,
28663,
276,
38291,
13,
13499,
11537,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
28686,
13,
28956,
10786,
28663,
276,
38291,
62,
5404,
2624,
13,
13344,
11537,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2270,
201,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32030,
62,
9641,
796,
705,
2637,
13,
22179,
7,
46659,
62,
9641,
13,
35312,
10786,
2637,
38381,
21912,
16,
12962,
1343,
705,
2637,
1343,
965,
7,
600,
7,
46659,
62,
9641,
13,
35312,
10786,
2637,
38381,
12,
16,
12962,
532,
352,
8,
201,
198,
201,
198,
201,
198,
31,
20786,
62,
48678,
13,
20786,
62,
2617,
62,
48678,
7,
10232,
8,
201,
198,
4299,
2198,
62,
259,
7,
26230,
25,
3992,
26230,
11,
20579,
25,
965,
11,
9206,
25,
965,
11,
275,
18347,
25,
965,
2599,
201,
198,
220,
220,
220,
37227,
201,
198,
220,
220,
220,
5525,
229,
103,
27950,
101,
41468,
162,
232,
98,
201,
198,
201,
198,
220,
220,
220,
1058,
17143,
4639,
25,
13282,
163,
230,
105,
164,
247,
104,
28156,
243,
162,
241,
236,
201,
198,
220,
220,
220,
1058,
17143,
20579,
25,
13328,
119,
253,
31660,
164,
118,
104,
20015,
121,
164,
106,
97,
46237,
223,
18796,
101,
22755,
115,
28938,
235,
201,
198,
220,
220,
220,
1058,
17143,
9206,
25,
13328,
119,
253,
31660,
164,
118,
104,
20015,
121,
164,
106,
97,
46237,
223,
43380,
228,
163,
254,
223,
201,
198,
220,
220,
220,
1058,
17143,
275,
18347,
25,
220,
41468,
162,
232,
98,
19526,
241,
162,
116,
102,
161,
222,
120,
201,
198,
220,
220,
220,
1058,
7783,
25,
6045,
201,
198,
220,
220,
220,
37227,
201,
198,
220,
220,
220,
705,
7061,
163,
247,
119,
37605,
243,
45911,
234,
165,
251,
95,
7061,
6,
201,
198,
220,
220,
220,
4639,
13,
1136,
10786,
4023,
1378,
17231,
439,
13,
325,
84,
13,
15532,
13,
31522,
14,
1324,
15307,
30,
1324,
7390,
28,
3365,
2481,
940,
1959,
16817,
2154,
34825,
11537,
201,
198,
201,
198,
220,
220,
220,
981,
357,
11925,
7,
26230,
13,
19796,
62,
68,
3639,
62,
1525,
62,
312,
10786,
29460,
6,
4008,
6624,
657,
393,
18896,
7,
26230,
13,
19796,
62,
68,
3639,
62,
1525,
62,
312,
10786,
28712,
6,
4008,
6624,
657,
393,
18896,
7,
26230,
13,
19796,
62,
68,
3639,
62,
1525,
62,
4871,
62,
3672,
10786,
18439,
62,
38235,
62,
46118,
6,
4008,
6624,
657,
8,
3467,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
290,
18896,
7,
26230,
13,
19796,
62,
68,
3639,
62,
1525,
62,
87,
6978,
10786,
14,
6494,
14,
2618,
14,
12417,
14,
20205,
14,
5458,
14,
7146,
58,
17,
60,
14,
7146,
58,
16,
49946,
4008,
6624,
657,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1208,
201,
198,
201,
198,
220,
220,
220,
611,
18896,
7,
26230,
13,
19796,
62,
68,
3639,
62,
1525,
62,
312,
10786,
29460,
6,
4008,
14512,
657,
393,
18896,
7,
26230,
13,
19796,
62,
68,
3639,
62,
1525,
62,
312,
10786,
28712,
6,
4008,
14512,
657,
393,
18896,
7,
26230,
13,
19796,
62,
68,
3639,
62,
1525,
62,
4871,
62,
3672,
10786,
18439,
62,
38235,
62,
46118,
6,
4008,
14512,
657,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
5128,
62,
29460,
796,
4639,
13,
19796,
62,
30854,
62,
1525,
62,
312,
10786,
29460,
11537,
201,
198,
220,
220,
220,
220,
220,
220,
220,
5128,
62,
29460,
13,
12976,
3419,
201,
198,
220,
220,
220,
220,
220,
220,
220,
5128,
62,
29460,
13,
21280,
62,
13083,
7,
29460,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
5128,
62,
28712,
796,
4639,
13,
19796,
62,
30854,
62,
1525,
62,
312,
10786,
28712,
11537,
201,
198,
220,
220,
220,
220,
220,
220,
220,
5128,
62,
28712,
13,
12976,
3419,
201,
198,
220,
220,
220,
220,
220,
220,
220,
5128,
62,
28712,
13,
21280,
62,
13083,
7,
28712,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
4936,
62,
87,
28202,
86,
796,
4639,
13,
19796,
62,
30854,
62,
1525,
62,
4871,
62,
3672,
10786,
18439,
62,
38235,
62,
46118,
11537,
201,
198,
220,
220,
220,
220,
220,
220,
220,
4936,
62,
87,
28202,
86,
13,
12976,
3419,
201,
198,
201,
198,
220,
220,
220,
705,
7061,
162,
107,
237,
33768,
98,
161,
223,
98,
41753,
115,
18796,
111,
162,
232,
98,
45911,
234,
165,
251,
95,
7061,
6,
201,
198,
220,
220,
220,
981,
18896,
7,
26230,
13,
19796,
62,
68,
3639,
62,
1525,
62,
87,
6978,
10786,
14,
6494,
14,
2618,
14,
12417,
14,
20205,
14,
5458,
14,
7146,
58,
17,
60,
14,
7146,
58,
16,
49946,
4008,
6624,
657,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1208,
201,
198,
220,
220,
220,
4936,
62,
2860,
796,
4639,
13,
19796,
62,
30854,
62,
1525,
62,
87,
6978,
10786,
14,
6494,
14,
2618,
14,
12417,
14,
20205,
14,
5458,
14,
7146,
58,
17,
60,
14,
7146,
58,
16,
60,
11537,
201,
198,
220,
220,
220,
4936,
62,
2860,
13,
12976,
3419,
201,
198,
201,
198,
220,
220,
220,
705,
7061,
23877,
108,
161,
95,
252,
41468,
162,
232,
98,
45911,
234,
165,
251,
95,
7061,
6,
201,
198,
220,
220,
220,
981,
357,
11925,
7,
26230,
13,
19796,
62,
68,
3639,
62,
1525,
62,
3672,
10786,
35,
57,
62,
41,
10305,
4825,
41,
34551,
6,
4008,
6624,
657,
393,
18896,
7,
26230,
13,
19796,
62,
68,
3639,
62,
1525,
62,
312,
10786,
21928,
6,
4008,
6624,
657,
8,
290,
18896,
7,
26230,
13,
19796,
62,
68,
3639,
62,
1525,
62,
4871,
62,
3672,
10786,
34369,
12,
38969,
519,
12,
16159,
6,
4008,
6624,
657,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1208,
201,
198,
201,
198,
220,
220,
220,
611,
18896,
7,
26230,
13,
19796,
62,
68,
3639,
62,
1525,
62,
4871,
62,
3672,
10786,
34369,
12,
38969,
519,
12,
16159,
6,
4008,
14512,
657,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
611,
705,
162,
107,
237,
33768,
98,
161,
223,
98,
41753,
115,
18796,
111,
162,
232,
98,
22755,
103,
29826,
95,
33768,
114,
29785,
112,
1314,
25,
405,
6,
287,
4639,
13,
7700,
62,
10459,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
43917,
10786,
162,
107,
237,
33768,
98,
161,
223,
98,
41753,
115,
18796,
111,
162,
232,
98,
22755,
103,
29826,
95,
33768,
114,
29785,
112,
1314,
25,
405,
11537,
201,
198,
220,
220,
220,
220,
220,
220,
220,
611,
705,
33566,
106,
30298,
235,
162,
107,
237,
33768,
98,
161,
223,
98,
41753,
115,
33699,
241,
39355,
94,
33768,
114,
29785,
112,
42468,
16,
33768,
114,
171,
121,
252,
1314,
33768,
114,
171,
120,
234,
46237,
115,
28839,
101,
29826,
97,
33768,
114,
29785,
112,
37863,
227,
161,
94,
104,
162,
232,
98,
16764,
6,
287,
4639,
13,
7700,
62,
10459,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
43917,
10786,
33566,
106,
30298,
235,
162,
107,
237,
33768,
98,
161,
223,
98,
41753,
115,
33699,
241,
39355,
94,
33768,
114,
29785,
112,
42468,
16,
33768,
114,
171,
121,
252,
1314,
33768,
114,
171,
120,
234,
46237,
115,
28839,
101,
29826,
97,
33768,
114,
29785,
112,
37863,
227,
161,
94,
104,
162,
232,
98,
16764,
11537,
201,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
43917,
10786,
20015,
232,
33768,
98,
32432,
110,
161,
94,
104,
162,
232,
98,
171,
120,
223,
11537,
201,
198,
220,
220,
220,
220,
220,
220,
220,
4639,
13,
47391,
3419,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
201,
198,
201,
198,
220,
220,
220,
705,
7061,
161,
94,
104,
37863,
247,
19526,
241,
162,
116,
102,
33176,
35050,
237,
238,
12859,
97,
7061,
6,
201,
198,
220,
220,
220,
5128,
62,
11848,
83,
796,
4639,
13,
19796,
62,
30854,
62,
1525,
62,
3672,
10786,
35,
57,
62,
41,
10305,
4825,
41,
34551,
11537,
201,
198,
220,
220,
220,
4639,
13,
41049,
62,
12048,
7203,
853,
2886,
58,
15,
4083,
12976,
9783,
1600,
5128,
62,
11848,
83,
8,
201,
198,
220,
220,
220,
5128,
62,
11848,
83,
13,
21280,
62,
13083,
7,
11848,
83,
8,
201,
198,
220,
220,
220,
4936,
62,
21928,
796,
4639,
13,
19796,
62,
30854,
62,
1525,
62,
312,
10786,
21928,
11537,
201,
198,
220,
220,
220,
4639,
13,
41049,
62,
12048,
7203,
853,
2886,
58,
15,
4083,
12976,
9783,
1600,
4936,
62,
21928,
8,
201,
198,
201,
198,
220,
220,
220,
981,
18896,
7,
26230,
13,
19796,
62,
68,
3639,
62,
1525,
62,
4871,
62,
3672,
10786,
34369,
12,
35904,
12,
39754,
6,
4008,
6624,
657,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1208,
201,
198,
220,
220,
220,
4936,
62,
2860,
796,
4639,
13,
19796,
62,
30854,
62,
1525,
62,
4871,
62,
3672,
10786,
34369,
12,
35904,
12,
39754,
11537,
201,
198,
220,
220,
220,
4936,
62,
2860,
13,
12976,
3419,
201,
198,
201,
198,
201,
198,
4299,
1949,
62,
1462,
62,
9122,
62,
259,
7,
26230,
25,
3992,
26230,
11,
20579,
25,
965,
11,
9206,
25,
965,
11,
275,
18347,
25,
965,
8,
4613,
493,
25,
201,
198,
220,
220,
220,
37227,
201,
198,
220,
220,
220,
10263,
108,
251,
46237,
243,
164,
229,
103,
27950,
101,
41468,
162,
232,
98,
201,
198,
201,
198,
220,
220,
220,
1058,
17143,
4639,
25,
13282,
163,
230,
105,
164,
247,
104,
28156,
243,
162,
241,
236,
201,
198,
220,
220,
220,
1058,
17143,
20579,
25,
13328,
119,
253,
31660,
164,
118,
104,
20015,
121,
164,
106,
97,
46237,
223,
18796,
101,
22755,
115,
28938,
235,
201,
198,
220,
220,
220,
1058,
17143,
9206,
25,
13328,
119,
253,
31660,
164,
118,
104,
20015,
121,
164,
106,
97,
46237,
223,
43380,
228,
163,
254,
223,
201,
198,
220,
220,
220,
1058,
17143,
275,
18347,
25,
220,
41468,
162,
232,
98,
19526,
241,
162,
116,
102,
161,
222,
120,
201,
198,
220,
220,
220,
1058,
7783,
25,
5525,
123,
238,
26193,
234,
163,
119,
241,
162,
252,
250,
657,
10545,
230,
238,
27950,
253,
532,
16,
36469,
109,
164,
112,
98,
201,
198,
220,
220,
220,
37227,
201,
198,
220,
220,
220,
3298,
25882,
62,
2200,
5446,
11015,
201,
198,
201,
198,
220,
220,
220,
1949,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
2198,
62,
259,
7,
26230,
11,
20579,
11,
9206,
11,
275,
18347,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
657,
201,
198,
220,
220,
220,
2845,
35528,
355,
304,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
611,
25882,
62,
2200,
5446,
11015,
1279,
838,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25882,
62,
2200,
5446,
11015,
15853,
352,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
10951,
10786,
90,
92,
23884,
220,
41468,
162,
232,
98,
13783,
109,
164,
112,
98,
59,
77,
90,
32239,
77,
29826,
96,
28839,
101,
34932,
235,
46237,
243,
163,
105,
105,
90,
92,
162,
105,
94,
986,
4458,
18982,
7,
29460,
11,
4818,
8079,
13,
19608,
8079,
13,
2197,
22446,
40838,
22784,
304,
11,
25882,
62,
2200,
5446,
11015,
4008,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1949,
62,
1462,
62,
9122,
62,
259,
7,
26230,
11,
20579,
11,
9206,
11,
275,
18347,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
10951,
10786,
90,
92,
23884,
220,
41468,
162,
232,
98,
13783,
109,
164,
112,
98,
59,
77,
90,
32239,
77,
34932,
235,
46237,
243,
162,
105,
94,
46763,
108,
164,
41678,
32573,
229,
41468,
165,
247,
238,
986,
4458,
18982,
7,
29460,
11,
4818,
8079,
13,
19608,
8079,
13,
2197,
22446,
40838,
22784,
304,
4008,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25882,
62,
2200,
5446,
11015,
796,
657,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
532,
16,
201,
198,
201,
198,
201,
198,
4299,
1388,
7,
9122,
62,
259,
62,
2435,
25,
965,
11,
20579,
25,
965,
11,
9206,
25,
965,
11,
275,
18347,
25,
965,
11,
1182,
1203,
25,
20512,
2599,
201,
198,
220,
220,
220,
37227,
201,
198,
220,
220,
220,
10263,
106,
248,
33768,
114,
32573,
238,
26193,
234,
201,
198,
201,
198,
220,
220,
220,
1058,
17143,
2198,
62,
259,
62,
2435,
25,
10545,
107,
237,
33768,
98,
164,
226,
248,
17312,
105,
32573,
238,
26193,
234,
33768,
114,
29785,
112,
201,
198,
220,
220,
220,
1058,
17143,
20579,
25,
13328,
119,
253,
31660,
164,
118,
104,
20015,
121,
164,
106,
97,
46237,
223,
18796,
101,
22755,
115,
28938,
235,
26344,
245,
26193,
101,
201,
198,
220,
220,
220,
1058,
17143,
9206,
25,
13328,
119,
253,
31660,
164,
118,
104,
20015,
121,
164,
106,
97,
46237,
223,
43380,
228,
163,
254,
223,
26344,
245,
26193,
101,
201,
198,
220,
220,
220,
1058,
17143,
275,
18347,
25,
220,
41468,
162,
232,
98,
19526,
241,
162,
116,
102,
161,
222,
120,
26344,
245,
26193,
101,
201,
198,
220,
220,
220,
1058,
17143,
1182,
1203,
25,
10545,
246,
107,
28938,
99,
49694,
238,
164,
245,
237,
38184,
237,
164,
100,
230,
161,
247,
101,
45911,
234,
165,
251,
95,
201,
198,
220,
220,
220,
1058,
7783,
25,
6045,
201,
198,
220,
220,
220,
37227,
201,
198,
220,
220,
220,
705,
7061,
162,
96,
222,
38184,
233,
28156,
243,
162,
241,
236,
27764,
246,
28839,
101,
7061,
6,
201,
198,
220,
220,
220,
611,
407,
28686,
13,
6978,
13,
1069,
1023,
10786,
28663,
276,
38291,
13,
13499,
6,
2599,
201,
198,
220,
220,
220,
220,
220,
220,
220,
4321,
62,
46659,
62,
26230,
3419,
201,
198,
201,
198,
220,
220,
220,
705,
7061,
162,
96,
222,
38184,
233,
28156,
243,
162,
241,
236,
48304,
17312,
105,
7061,
6,
201,
198,
220,
220,
220,
1949,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
3689,
796,
3992,
26230,
13,
1925,
5998,
29046,
3419,
201,
198,
220,
220,
220,
220,
220,
220,
220,
3689,
13,
2860,
62,
49140,
10786,
438,
2256,
1203,
11537,
201,
198,
220,
220,
220,
220,
220,
220,
220,
4639,
796,
3992,
26230,
13,
1925,
5998,
10786,
28663,
276,
38291,
13,
13499,
3256,
3689,
28,
25811,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
4639,
13,
47391,
3419,
201,
198,
220,
220,
220,
2845,
2219,
13,
1069,
11755,
13,
36044,
3673,
41972,
16922,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
4321,
62,
46659,
62,
26230,
3419,
201,
198,
201,
198,
220,
220,
220,
981,
6407,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
640,
13,
42832,
7,
15,
13,
20,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
611,
965,
7,
19608,
8079,
13,
19608,
8079,
13,
2197,
22446,
2435,
28955,
58,
25,
23,
60,
6624,
2198,
62,
259,
62,
2435,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4639,
796,
6045,
201,
198,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
26344,
251,
34650,
233,
44293,
244,
28156,
243,
162,
241,
236,
7061,
6,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3689,
796,
3992,
26230,
13,
1925,
5998,
29046,
3419,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3689,
13,
2860,
62,
23100,
9134,
62,
18076,
10786,
1069,
9152,
10462,
9249,
3256,
37250,
21633,
12,
2306,
296,
341,
6,
12962,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3689,
13,
2860,
62,
49140,
10786,
438,
40223,
12,
2436,
676,
12,
40890,
28,
38062,
341,
4264,
8375,
11537,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
1182,
1203,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3689,
13,
2860,
62,
49140,
10786,
438,
2256,
1203,
11537,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3689,
13,
2860,
62,
49140,
10786,
438,
40223,
12,
46999,
11537,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4639,
796,
3992,
26230,
13,
1925,
5998,
10786,
28663,
276,
38291,
13,
13499,
3256,
3689,
28,
25811,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4639,
13,
41049,
62,
10210,
79,
62,
28758,
7203,
9876,
13,
2860,
7391,
2514,
36,
2100,
4985,
2202,
3791,
24941,
1600,
1391,
6,
10459,
10354,
705,
10267,
13,
13086,
21746,
7,
28341,
23823,
11,
366,
12384,
26230,
1600,
1391,
1136,
25,
7499,
5218,
28721,
30072,
6,
30072,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2845,
35528,
355,
304,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
18224,
7,
68,
8,
201,
198,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
22887,
251,
46237,
243,
164,
229,
103,
27950,
101,
41468,
162,
232,
98,
7061,
6,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
581,
796,
1949,
62,
1462,
62,
9122,
62,
259,
7,
26230,
11,
20579,
11,
9206,
11,
275,
18347,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2695,
796,
705,
90,
92,
23884,
220,
41468,
162,
232,
98,
90,
92,
171,
120,
223,
4458,
18982,
7,
29460,
11,
4818,
8079,
13,
19608,
8079,
13,
2197,
22446,
40838,
22784,
705,
22755,
238,
27950,
253,
6,
611,
581,
6624,
657,
2073,
705,
13783,
109,
164,
112,
98,
11537,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2845,
25439,
62,
48678,
13,
1069,
11755,
13,
22203,
14967,
276,
7975,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2695,
796,
705,
90,
92,
23884,
220,
41468,
162,
232,
98,
13783,
109,
164,
112,
98,
171,
120,
223,
4458,
18982,
7,
29460,
11,
4818,
8079,
13,
19608,
8079,
13,
2197,
22446,
40838,
28955,
201,
198,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
17739,
111,
29785,
255,
28156,
243,
162,
241,
236,
7061,
6,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4639,
13,
47391,
3419,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2845,
35528,
355,
304,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
18224,
7,
68,
8,
201,
198,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
20998,
239,
34460,
223,
163,
253,
255,
46479,
94,
14,
165,
224,
106,
20015,
114,
7061,
6,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3758,
62,
22208,
496,
7,
11299,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2845,
35528,
355,
304,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
18224,
7,
68,
8,
201,
198,
201,
198,
201,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
201,
198,
220,
220,
220,
2604,
62,
2435,
796,
640,
13,
12001,
2435,
3419,
201,
198,
220,
220,
220,
18931,
13,
35487,
16934,
7,
5715,
28,
6404,
2667,
13,
10778,
11,
5794,
11639,
4,
7,
292,
310,
524,
8,
82,
532,
4064,
7,
5715,
3672,
8,
82,
532,
4064,
7,
20500,
8,
82,
11537,
201,
198,
220,
220,
220,
49706,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
201,
198,
220,
220,
220,
1296,
1436,
796,
18931,
13,
8479,
1436,
10786,
4,
7,
292,
310,
524,
8,
82,
532,
4064,
7,
5715,
3672,
8,
82,
532,
4064,
7,
20500,
8,
82,
11537,
201,
198,
220,
220,
220,
2393,
796,
1280,
10786,
90,
27422,
6404,
4458,
18982,
7,
2435,
13,
2536,
31387,
7203,
4,
56,
12,
4,
76,
12,
4,
67,
12,
4,
39,
12,
4,
44,
1600,
2604,
62,
2435,
36911,
705,
86,
11537,
201,
198,
220,
220,
220,
2393,
13,
19836,
3419,
201,
198,
220,
220,
220,
21360,
796,
18931,
13,
8979,
25060,
10786,
90,
27422,
6404,
4458,
18982,
7,
2435,
13,
2536,
31387,
7203,
4,
56,
12,
4,
76,
12,
4,
67,
12,
4,
39,
12,
4,
44,
1600,
2604,
62,
2435,
22305,
201,
198,
220,
220,
220,
21360,
13,
2617,
8479,
1436,
7,
687,
1436,
8,
201,
198,
220,
220,
220,
21360,
13,
2617,
4971,
7,
6404,
2667,
13,
10778,
8,
201,
198,
220,
220,
220,
49706,
13,
2860,
25060,
7,
30281,
8,
201,
198,
201,
198,
220,
220,
220,
1388,
7,
17597,
13,
853,
85,
58,
16,
4357,
25064,
13,
853,
85,
58,
17,
4357,
25064,
13,
853,
85,
58,
18,
4357,
25064,
13,
853,
85,
58,
19,
4357,
6407,
8,
201,
198
] | 1.820931 | 4,166 |
# Generated by Django 3.0.5 on 2020-08-03 14:19
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
20,
319,
12131,
12,
2919,
12,
3070,
1478,
25,
1129,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
# python manage.py test api.tests.tests.test_models
from django.test import TestCase, TransactionTestCase
from django.contrib.auth.models import User
from django.db.utils import IntegrityError
from django.test.testcases import LiveServerTestCase, LiveServerThread
from mixer.backend.django import mixer
from datetime import datetime, timedelta, timezone
import logging
from socialDistribution.models import *
from socialDistribution.builders import *
from cmput404.constants import API_BASE
class AuthorTests(LiveServerTestCase):
""" Unit tests for Author. """
# the pillow, https://stackoverflow.com/users/2812257/the-pillow, "How can I disable logging while running unit tests in Python Django?"
# https://stackoverflow.com/a/54519433, 2019-02-04, CC BY-SA 4.0
# disable logging before tests
@classmethod
# enable logging after tests
@classmethod
# a bit more work needed to get this to correctly find the debug server
# def test_get_author_json(self):
# # makes an API call, server must be running
# local = mixer.blend(LocalAuthor)
# remote = Author.objects.get(id=local.id)
# print(self.live_server_url)
# print(socket.gethostname())
# author_json = remote.as_json()
# print(author_json)
class LocalAuthorTests(TestCase):
""" Unit tests for LocalAuthor """
# the pillow, https://stackoverflow.com/users/2812257/the-pillow, "How can I disable logging while running unit tests in Python Django?"
# https://stackoverflow.com/a/54519433, 2019-02-04, CC BY-SA 4.0
# disable logging before tests
@classmethod
# enable logging after tests
@classmethod
class LikeTests(TransactionTestCase):
""" Unit tests for Likes, PostLikes and CommentLikes. """
# the pillow, https://stackoverflow.com/users/2812257/the-pillow, "How can I disable logging while running unit tests in Python Django?"
# https://stackoverflow.com/a/54519433, 2019-02-04, CC BY-SA 4.0
# disable logging before tests
@classmethod
# enable logging after tests
@classmethod
def test_post_like(self):
""" Test successfully liking a Post """
post = mixer.blend(LocalPost)
author = mixer.blend(Author)
# like a post
post.likes.create(author=author)
self.assertEqual(1, post.likes.count())
self.assertEqual(author, post.likes.first().author)
def test_comment_like(self):
""" Test successfully liking a Comment """
comment = mixer.blend(Comment)
author = mixer.blend(Author)
# like a comment
comment.likes.create(author=author)
self.assertEqual(1, comment.likes.count())
self.assertEqual(author, comment.likes.first().author)
def test_no_author(self):
""" Test creating a Like with no Author """
post = mixer.blend(LocalPost)
with self.assertRaises(IntegrityError):
post.likes.create()
def test_no_post(self):
""" Test creating a like with no object """
with self.assertRaises(IntegrityError):
author = mixer.blend(Author)
PostLike.objects.create(author=author)
with self.assertRaises(IntegrityError):
author = mixer.blend(Author)
CommentLike.objects.create(author=author)
def test_double_like(self):
""" Test liking a post multiple times """
post = mixer.blend(LocalPost)
author = mixer.blend(Author)
# add a like
like = post.likes.create(author=author)
self.assertEqual(1, post.likes.count())
# adding another like should raise an error
with self.assertRaisesMessage(IntegrityError, "UNIQUE constraint failed"):
post.likes.create(author=author)
# should be able to remove and like again
like.delete()
self.assertEqual(0, post.likes.count())
post.likes.create(author=author)
self.assertEqual(1, post.likes.count())
| [
2,
21015,
6687,
13,
9078,
1332,
40391,
13,
41989,
13,
41989,
13,
9288,
62,
27530,
198,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
11,
45389,
14402,
20448,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
42625,
14208,
13,
9945,
13,
26791,
1330,
39348,
12331,
198,
6738,
42625,
14208,
13,
9288,
13,
9288,
33964,
1330,
7547,
10697,
14402,
20448,
11,
7547,
10697,
16818,
198,
6738,
33938,
13,
1891,
437,
13,
28241,
14208,
1330,
33938,
198,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
11,
640,
11340,
198,
11748,
18931,
198,
198,
6738,
1919,
20344,
3890,
13,
27530,
1330,
1635,
198,
6738,
1919,
20344,
3890,
13,
50034,
1330,
1635,
198,
6738,
12067,
1996,
26429,
13,
9979,
1187,
1330,
7824,
62,
33,
11159,
198,
198,
4871,
6434,
51,
3558,
7,
18947,
10697,
14402,
20448,
2599,
198,
220,
220,
220,
37227,
11801,
5254,
329,
6434,
13,
37227,
628,
220,
220,
220,
1303,
262,
28774,
11,
3740,
1378,
25558,
2502,
11125,
13,
785,
14,
18417,
14,
2078,
1065,
28676,
14,
1169,
12,
27215,
322,
11,
366,
2437,
460,
314,
15560,
18931,
981,
2491,
4326,
5254,
287,
11361,
37770,
1701,
198,
220,
220,
220,
1303,
3740,
1378,
25558,
2502,
11125,
13,
785,
14,
64,
14,
45326,
22913,
2091,
11,
13130,
12,
2999,
12,
3023,
11,
12624,
11050,
12,
4090,
604,
13,
15,
628,
220,
220,
220,
1303,
15560,
18931,
878,
5254,
198,
220,
220,
220,
2488,
4871,
24396,
628,
220,
220,
220,
1303,
7139,
18931,
706,
5254,
198,
220,
220,
220,
2488,
4871,
24396,
628,
220,
220,
220,
1303,
257,
1643,
517,
670,
2622,
284,
651,
428,
284,
9380,
1064,
262,
14257,
4382,
198,
220,
220,
220,
1303,
825,
1332,
62,
1136,
62,
9800,
62,
17752,
7,
944,
2599,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
1303,
1838,
281,
7824,
869,
11,
4382,
1276,
307,
2491,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
1957,
796,
33938,
13,
2436,
437,
7,
14565,
13838,
8,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
6569,
796,
6434,
13,
48205,
13,
1136,
7,
312,
28,
12001,
13,
312,
8,
628,
220,
220,
220,
1303,
220,
220,
220,
220,
3601,
7,
944,
13,
12583,
62,
15388,
62,
6371,
8,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
3601,
7,
44971,
13,
1136,
4774,
3672,
28955,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
1772,
62,
17752,
796,
6569,
13,
292,
62,
17752,
3419,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
3601,
7,
9800,
62,
17752,
8,
628,
198,
4871,
10714,
13838,
51,
3558,
7,
14402,
20448,
2599,
198,
220,
220,
220,
37227,
11801,
5254,
329,
10714,
13838,
37227,
628,
220,
220,
220,
1303,
262,
28774,
11,
3740,
1378,
25558,
2502,
11125,
13,
785,
14,
18417,
14,
2078,
1065,
28676,
14,
1169,
12,
27215,
322,
11,
366,
2437,
460,
314,
15560,
18931,
981,
2491,
4326,
5254,
287,
11361,
37770,
1701,
198,
220,
220,
220,
1303,
3740,
1378,
25558,
2502,
11125,
13,
785,
14,
64,
14,
45326,
22913,
2091,
11,
13130,
12,
2999,
12,
3023,
11,
12624,
11050,
12,
4090,
604,
13,
15,
628,
220,
220,
220,
1303,
15560,
18931,
878,
5254,
198,
220,
220,
220,
2488,
4871,
24396,
628,
220,
220,
220,
1303,
7139,
18931,
706,
5254,
198,
220,
220,
220,
2488,
4871,
24396,
628,
628,
198,
4871,
4525,
51,
3558,
7,
48720,
14402,
20448,
2599,
198,
220,
220,
220,
37227,
11801,
5254,
329,
46077,
11,
2947,
43,
7938,
290,
18957,
43,
7938,
13,
37227,
628,
220,
220,
220,
1303,
262,
28774,
11,
3740,
1378,
25558,
2502,
11125,
13,
785,
14,
18417,
14,
2078,
1065,
28676,
14,
1169,
12,
27215,
322,
11,
366,
2437,
460,
314,
15560,
18931,
981,
2491,
4326,
5254,
287,
11361,
37770,
1701,
198,
220,
220,
220,
1303,
3740,
1378,
25558,
2502,
11125,
13,
785,
14,
64,
14,
45326,
22913,
2091,
11,
13130,
12,
2999,
12,
3023,
11,
12624,
11050,
12,
4090,
604,
13,
15,
628,
220,
220,
220,
1303,
15560,
18931,
878,
5254,
198,
220,
220,
220,
2488,
4871,
24396,
628,
220,
220,
220,
1303,
7139,
18931,
706,
5254,
198,
220,
220,
220,
2488,
4871,
24396,
628,
220,
220,
220,
825,
1332,
62,
7353,
62,
2339,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
6208,
7675,
24976,
257,
2947,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
1281,
796,
33938,
13,
2436,
437,
7,
14565,
6307,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1772,
796,
33938,
13,
2436,
437,
7,
13838,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
588,
257,
1281,
198,
220,
220,
220,
220,
220,
220,
220,
1281,
13,
75,
7938,
13,
17953,
7,
9800,
28,
9800,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
36,
13255,
7,
16,
11,
1281,
13,
75,
7938,
13,
9127,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
36,
13255,
7,
9800,
11,
1281,
13,
75,
7938,
13,
11085,
22446,
9800,
8,
628,
220,
220,
220,
825,
1332,
62,
23893,
62,
2339,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
6208,
7675,
24976,
257,
18957,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
2912,
796,
33938,
13,
2436,
437,
7,
21357,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1772,
796,
33938,
13,
2436,
437,
7,
13838,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
588,
257,
2912,
198,
220,
220,
220,
220,
220,
220,
220,
2912,
13,
75,
7938,
13,
17953,
7,
9800,
28,
9800,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
36,
13255,
7,
16,
11,
2912,
13,
75,
7938,
13,
9127,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
36,
13255,
7,
9800,
11,
2912,
13,
75,
7938,
13,
11085,
22446,
9800,
8,
628,
220,
220,
220,
825,
1332,
62,
3919,
62,
9800,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
6208,
4441,
257,
4525,
351,
645,
6434,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
1281,
796,
33938,
13,
2436,
437,
7,
14565,
6307,
8,
198,
220,
220,
220,
220,
220,
220,
220,
351,
2116,
13,
30493,
21762,
2696,
7,
34500,
10138,
12331,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1281,
13,
75,
7938,
13,
17953,
3419,
628,
220,
220,
220,
825,
1332,
62,
3919,
62,
7353,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
6208,
4441,
257,
588,
351,
645,
2134,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
351,
2116,
13,
30493,
21762,
2696,
7,
34500,
10138,
12331,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1772,
796,
33938,
13,
2436,
437,
7,
13838,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2947,
7594,
13,
48205,
13,
17953,
7,
9800,
28,
9800,
8,
628,
220,
220,
220,
220,
220,
220,
220,
351,
2116,
13,
30493,
21762,
2696,
7,
34500,
10138,
12331,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1772,
796,
33938,
13,
2436,
437,
7,
13838,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
18957,
7594,
13,
48205,
13,
17953,
7,
9800,
28,
9800,
8,
628,
220,
220,
220,
825,
1332,
62,
23352,
62,
2339,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
6208,
24976,
257,
1281,
3294,
1661,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
1281,
796,
33938,
13,
2436,
437,
7,
14565,
6307,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1772,
796,
33938,
13,
2436,
437,
7,
13838,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
751,
257,
588,
198,
220,
220,
220,
220,
220,
220,
220,
588,
796,
1281,
13,
75,
7938,
13,
17953,
7,
9800,
28,
9800,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
36,
13255,
7,
16,
11,
1281,
13,
75,
7938,
13,
9127,
28955,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
4375,
1194,
588,
815,
5298,
281,
4049,
198,
220,
220,
220,
220,
220,
220,
220,
351,
2116,
13,
30493,
21762,
2696,
12837,
7,
34500,
10138,
12331,
11,
366,
4944,
33866,
8924,
32315,
4054,
1,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1281,
13,
75,
7938,
13,
17953,
7,
9800,
28,
9800,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
815,
307,
1498,
284,
4781,
290,
588,
757,
198,
220,
220,
220,
220,
220,
220,
220,
588,
13,
33678,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
36,
13255,
7,
15,
11,
1281,
13,
75,
7938,
13,
9127,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
1281,
13,
75,
7938,
13,
17953,
7,
9800,
28,
9800,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
36,
13255,
7,
16,
11,
1281,
13,
75,
7938,
13,
9127,
28955,
198
] | 2.682943 | 1,495 |
# File: forescoutcounteract_consts.py
# Copyright (c) 2018-2021 Splunk Inc.
#
# Licensed under Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt)
#
# --
# Define your constants here
FS_DEX_HOST_ENDPOINT = '/fsapi/niCore/Hosts'
FS_DEX_LIST_ENDPOINT = '/fsapi/niCore/Lists'
FS_DEX_TEST_CONNECTIVITY = \
"""<?xml version="1.0" encoding="UTF-8"?>
<FSAPI TYPE="request" API_VERSION="1.0">
<TRANSACTION TYPE="update">
<OPTIONS CREATE_NEW_HOST="true"/>
<HOST_KEY NAME="ip" VALUE="{host_key_value}"/>
<PROPERTIES></PROPERTIES>
</TRANSACTION>
</FSAPI>"""
FS_DEX_UPDATE_SIMPLE_PROPERTY = \
"""<?xml version='1.0' encoding='utf-8'?>
<FSAPI TYPE="request" API_VERSION="1.0">
<TRANSACTION TYPE="update">
<OPTIONS CREATE_NEW_HOST="{create_host}"/>
<HOST_KEY NAME="{host_key_name}" VALUE="{host_key_value}"/>
<PROPERTIES>
<PROPERTY NAME="{property_name}">
<VALUE>{property_value}</VALUE>
</PROPERTY>
</PROPERTIES>
</TRANSACTION>
</FSAPI>"""
FS_DEX_DELETE_SIMPLE_PROPERTY = \
"""<?xml version='1.0' encoding='utf-8'?>
<FSAPI TYPE="request" API_VERSION="1.0">
<TRANSACTION TYPE="delete">
<HOST_KEY NAME="{host_key_name}" VALUE="{host_key_value}"/>
<PROPERTIES>
<PROPERTY NAME="{property_name}" />
</PROPERTIES>
</TRANSACTION>
</FSAPI>"""
FS_DEX_UPDATE_LIST_PROPERTY = \
"""<?xml version="1.0" encoding="UTF-8"?>
<FSAPI TYPE="request" API_VERSION="2.0">
<TRANSACTION TYPE="{transaction_type}">
<LISTS>
{list_body}
</LISTS>
</TRANSACTION>
</FSAPI>"""
FS_WEB_LOGIN = '/api/login'
FS_WEB_HOSTS = '/api/hosts'
FS_WEB_HOSTFIELDS = '/api/hostfields'
FS_WEB_POLICIES = '/api/policies'
# Error message constants
FS_ERR_CODE_MSG = "Error code unavailable"
FS_ERR_MSG_UNAVAILABLE = "Error message unavailable. Please check the asset configuration and|or action parameters"
FS_PARSE_ERR_MSG = "Unable to parse the error message. Please check the asset configuration and|or action parameters"
# validate integer
ERR_VALID_INT_MSG = "Please provide a valid integer value in the {}"
ERR_NON_NEG_INT_MSG = "Please provide a valid non-negative integer value in the {}"
ERR_POSITIVE_INTEGER_MSG = "Please provide a valid non-zero positive integer value in the {}"
HOST_ID_INT_PARAM = "'host_id' action parameter"
| [
2,
9220,
25,
1674,
1416,
448,
24588,
529,
62,
1102,
6448,
13,
9078,
198,
2,
15069,
357,
66,
8,
2864,
12,
1238,
2481,
13341,
2954,
3457,
13,
198,
2,
198,
2,
49962,
739,
24843,
362,
13,
15,
357,
5450,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
43,
2149,
24290,
12,
17,
13,
15,
13,
14116,
8,
198,
2,
198,
2,
1377,
198,
198,
2,
2896,
500,
534,
38491,
994,
198,
10652,
62,
35,
6369,
62,
39,
10892,
62,
1677,
6322,
46,
12394,
796,
31051,
9501,
15042,
14,
8461,
14055,
14,
17932,
82,
6,
198,
10652,
62,
35,
6369,
62,
45849,
62,
1677,
6322,
46,
12394,
796,
31051,
9501,
15042,
14,
8461,
14055,
14,
43,
1023,
6,
198,
198,
10652,
62,
35,
6369,
62,
51,
6465,
62,
10943,
48842,
3824,
9050,
796,
3467,
198,
220,
220,
220,
37227,
47934,
19875,
2196,
2625,
16,
13,
15,
1,
21004,
2625,
48504,
12,
23,
13984,
29,
198,
220,
220,
220,
220,
220,
220,
220,
1279,
10652,
17614,
41876,
2625,
25927,
1,
7824,
62,
43717,
2625,
16,
13,
15,
5320,
198,
220,
220,
220,
220,
220,
220,
220,
1279,
5446,
15037,
44710,
41876,
2625,
19119,
5320,
198,
220,
220,
220,
220,
220,
220,
220,
1279,
3185,
51,
11053,
29244,
6158,
62,
13965,
62,
39,
10892,
2625,
7942,
26700,
198,
220,
220,
220,
220,
220,
220,
220,
1279,
39,
10892,
62,
20373,
36751,
2625,
541,
1,
26173,
8924,
2625,
90,
4774,
62,
2539,
62,
8367,
92,
26700,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
4805,
3185,
17395,
11015,
12240,
4805,
3185,
17395,
11015,
29,
198,
220,
220,
220,
220,
220,
220,
220,
7359,
5446,
15037,
44710,
29,
198,
220,
220,
220,
220,
220,
220,
220,
7359,
10652,
17614,
29,
37811,
198,
198,
10652,
62,
35,
6369,
62,
16977,
62,
48913,
16437,
62,
4805,
31054,
9936,
796,
3467,
198,
220,
220,
220,
37227,
47934,
19875,
2196,
11639,
16,
13,
15,
6,
21004,
11639,
40477,
12,
23,
30960,
29,
198,
220,
220,
220,
220,
220,
220,
220,
1279,
10652,
17614,
41876,
2625,
25927,
1,
7824,
62,
43717,
2625,
16,
13,
15,
5320,
198,
220,
220,
220,
220,
220,
220,
220,
1279,
5446,
15037,
44710,
41876,
2625,
19119,
5320,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
3185,
51,
11053,
29244,
6158,
62,
13965,
62,
39,
10892,
2625,
90,
17953,
62,
4774,
92,
26700,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
39,
10892,
62,
20373,
36751,
2625,
90,
4774,
62,
2539,
62,
3672,
36786,
26173,
8924,
2625,
90,
4774,
62,
2539,
62,
8367,
92,
26700,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
4805,
3185,
17395,
11015,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
4805,
31054,
9936,
36751,
2625,
90,
26745,
62,
3672,
92,
5320,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
39488,
29,
90,
26745,
62,
8367,
92,
3556,
39488,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7359,
4805,
31054,
9936,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7359,
4805,
3185,
17395,
11015,
29,
198,
220,
220,
220,
220,
220,
220,
220,
7359,
5446,
15037,
44710,
29,
198,
220,
220,
220,
220,
220,
220,
220,
7359,
10652,
17614,
29,
37811,
198,
198,
10652,
62,
35,
6369,
62,
7206,
2538,
9328,
62,
48913,
16437,
62,
4805,
31054,
9936,
796,
3467,
198,
220,
220,
220,
37227,
47934,
19875,
2196,
11639,
16,
13,
15,
6,
21004,
11639,
40477,
12,
23,
30960,
29,
198,
220,
220,
220,
220,
220,
220,
220,
1279,
10652,
17614,
41876,
2625,
25927,
1,
7824,
62,
43717,
2625,
16,
13,
15,
5320,
198,
220,
220,
220,
220,
220,
220,
220,
1279,
5446,
15037,
44710,
41876,
2625,
33678,
5320,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
39,
10892,
62,
20373,
36751,
2625,
90,
4774,
62,
2539,
62,
3672,
36786,
26173,
8924,
2625,
90,
4774,
62,
2539,
62,
8367,
92,
26700,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
4805,
3185,
17395,
11015,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
4805,
31054,
9936,
36751,
2625,
90,
26745,
62,
3672,
36786,
11037,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7359,
4805,
3185,
17395,
11015,
29,
198,
220,
220,
220,
220,
220,
220,
220,
7359,
5446,
15037,
44710,
29,
198,
220,
220,
220,
220,
220,
220,
220,
7359,
10652,
17614,
29,
37811,
198,
198,
10652,
62,
35,
6369,
62,
16977,
62,
45849,
62,
4805,
31054,
9936,
796,
3467,
198,
220,
220,
220,
37227,
47934,
19875,
2196,
2625,
16,
13,
15,
1,
21004,
2625,
48504,
12,
23,
13984,
29,
198,
220,
220,
220,
220,
220,
220,
220,
1279,
10652,
17614,
41876,
2625,
25927,
1,
7824,
62,
43717,
2625,
17,
13,
15,
5320,
198,
220,
220,
220,
220,
220,
220,
220,
1279,
5446,
15037,
44710,
41876,
2625,
90,
7645,
2673,
62,
4906,
92,
5320,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
43,
1797,
4694,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1391,
4868,
62,
2618,
92,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7359,
43,
1797,
4694,
29,
198,
220,
220,
220,
220,
220,
220,
220,
7359,
5446,
15037,
44710,
29,
198,
220,
220,
220,
220,
220,
220,
220,
7359,
10652,
17614,
29,
37811,
198,
198,
10652,
62,
8845,
33,
62,
25294,
1268,
796,
31051,
15042,
14,
38235,
6,
198,
10652,
62,
8845,
33,
62,
39,
10892,
50,
796,
31051,
15042,
14,
4774,
82,
6,
198,
10652,
62,
8845,
33,
62,
39,
10892,
11674,
3698,
5258,
796,
31051,
15042,
14,
4774,
25747,
6,
198,
10652,
62,
8845,
33,
62,
45472,
2149,
11015,
796,
31051,
15042,
14,
79,
4160,
444,
6,
198,
198,
2,
13047,
3275,
38491,
198,
10652,
62,
1137,
49,
62,
34,
16820,
62,
5653,
38,
796,
366,
12331,
2438,
23485,
1,
198,
10652,
62,
1137,
49,
62,
5653,
38,
62,
52,
4535,
11731,
4146,
17534,
796,
366,
12331,
3275,
23485,
13,
4222,
2198,
262,
11171,
8398,
290,
91,
273,
2223,
10007,
1,
198,
10652,
62,
27082,
5188,
62,
1137,
49,
62,
5653,
38,
796,
366,
3118,
540,
284,
21136,
262,
4049,
3275,
13,
4222,
2198,
262,
11171,
8398,
290,
91,
273,
2223,
10007,
1,
198,
198,
2,
26571,
18253,
198,
1137,
49,
62,
23428,
2389,
62,
12394,
62,
5653,
38,
796,
366,
5492,
2148,
257,
4938,
18253,
1988,
287,
262,
23884,
1,
198,
1137,
49,
62,
45,
1340,
62,
45,
7156,
62,
12394,
62,
5653,
38,
796,
366,
5492,
2148,
257,
4938,
1729,
12,
31591,
18253,
1988,
287,
262,
23884,
1,
198,
1137,
49,
62,
37997,
2043,
9306,
62,
12394,
7156,
1137,
62,
5653,
38,
796,
366,
5492,
2148,
257,
4938,
1729,
12,
22570,
3967,
18253,
1988,
287,
262,
23884,
1,
198,
39,
10892,
62,
2389,
62,
12394,
62,
27082,
2390,
796,
24018,
4774,
62,
312,
6,
2223,
11507,
1,
198
] | 2.067663 | 1,271 |
from flask_static_digest import parse_digest_host_url
import pytest as pt
@pt.mark.parametrize(
"digest_host_url, expected", [
(
"https://cdn.example.com",
("https://cdn.example.com", "")
),
(
"https://cdn.example.com/",
("https://cdn.example.com", "")
),
(
"https://cdn.example.com/myapp",
("https://cdn.example.com", "myapp")
),
(
"https://cdn.example.com/myapp/",
("https://cdn.example.com", "myapp")
),
(
"https://cdn.example.com/myapp/anotherdir",
("https://cdn.example.com", "myapp/anotherdir")
),
(
"https://cdn.example.com/myapp/anotherdir/",
("https://cdn.example.com", "myapp/anotherdir")
),
]
)
| [
6738,
42903,
62,
12708,
62,
12894,
395,
1330,
21136,
62,
12894,
395,
62,
4774,
62,
6371,
198,
198,
11748,
12972,
9288,
355,
42975,
628,
198,
31,
457,
13,
4102,
13,
17143,
316,
380,
2736,
7,
198,
220,
220,
220,
366,
12894,
395,
62,
4774,
62,
6371,
11,
2938,
1600,
685,
198,
220,
220,
220,
220,
220,
220,
220,
357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
5450,
1378,
32341,
13,
20688,
13,
785,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5855,
5450,
1378,
32341,
13,
20688,
13,
785,
1600,
366,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
10612,
198,
220,
220,
220,
220,
220,
220,
220,
357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
5450,
1378,
32341,
13,
20688,
13,
785,
14,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5855,
5450,
1378,
32341,
13,
20688,
13,
785,
1600,
366,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
10612,
198,
220,
220,
220,
220,
220,
220,
220,
357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
5450,
1378,
32341,
13,
20688,
13,
785,
14,
1820,
1324,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5855,
5450,
1378,
32341,
13,
20688,
13,
785,
1600,
366,
1820,
1324,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
10612,
198,
220,
220,
220,
220,
220,
220,
220,
357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
5450,
1378,
32341,
13,
20688,
13,
785,
14,
1820,
1324,
14,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5855,
5450,
1378,
32341,
13,
20688,
13,
785,
1600,
366,
1820,
1324,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
10612,
198,
220,
220,
220,
220,
220,
220,
220,
357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
5450,
1378,
32341,
13,
20688,
13,
785,
14,
1820,
1324,
14,
29214,
15908,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5855,
5450,
1378,
32341,
13,
20688,
13,
785,
1600,
366,
1820,
1324,
14,
29214,
15908,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
10612,
198,
220,
220,
220,
220,
220,
220,
220,
357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
5450,
1378,
32341,
13,
20688,
13,
785,
14,
1820,
1324,
14,
29214,
15908,
14,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5855,
5450,
1378,
32341,
13,
20688,
13,
785,
1600,
366,
1820,
1324,
14,
29214,
15908,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
10612,
198,
220,
220,
220,
2361,
198,
8,
628
] | 1.845161 | 465 |
from .model import get_cam_model, get_model
MODEL_FACTORY = {'vgg_base': get_model, 'vgg_cam': get_cam_model}
| [
6738,
764,
19849,
1330,
651,
62,
20991,
62,
19849,
11,
651,
62,
19849,
198,
198,
33365,
3698,
62,
37,
10659,
15513,
796,
1391,
6,
85,
1130,
62,
8692,
10354,
651,
62,
19849,
11,
705,
85,
1130,
62,
20991,
10354,
651,
62,
20991,
62,
19849,
92,
198
] | 2.413043 | 46 |
import socket
conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
conn.connect (("127.0.0.1", 14900))
hels = "Hello, server"
conn.send(bytes(hels, "utf-8"))
data = conn.recv(16384)
udata = data.decode("utf-8")
print(udata)
conn.close() | [
11748,
17802,
198,
198,
37043,
796,
17802,
13,
44971,
7,
44971,
13,
8579,
62,
1268,
2767,
11,
17802,
13,
50,
11290,
62,
2257,
32235,
8,
198,
37043,
13,
8443,
357,
7203,
16799,
13,
15,
13,
15,
13,
16,
1600,
1478,
12865,
4008,
198,
2978,
82,
796,
366,
15496,
11,
4382,
1,
198,
37043,
13,
21280,
7,
33661,
7,
2978,
82,
11,
366,
40477,
12,
23,
48774,
198,
198,
7890,
796,
48260,
13,
8344,
85,
7,
1433,
22842,
8,
198,
463,
1045,
796,
1366,
13,
12501,
1098,
7203,
40477,
12,
23,
4943,
198,
4798,
7,
463,
1045,
8,
198,
198,
37043,
13,
19836,
3419
] | 2.359223 | 103 |
from cpstats.models.model import VERDICT_AC, Task
from flask import render_template
from cpstats.models import model
from cpstats import app
@app.route('/')
@app.route('/index')
SUBNAV = [
'general',
'submissions',
'tasks',
'achievements'
]
@app.route('/user/<string:username>')
@app.route('/user/<string:username>/general')
@app.route('/user/<string:username>/tasks') | [
6738,
31396,
34242,
13,
27530,
13,
19849,
1330,
33310,
35,
18379,
62,
2246,
11,
15941,
198,
6738,
42903,
1330,
8543,
62,
28243,
198,
6738,
31396,
34242,
13,
27530,
1330,
2746,
198,
6738,
31396,
34242,
1330,
598,
198,
198,
31,
1324,
13,
38629,
10786,
14,
11537,
198,
31,
1324,
13,
38629,
10786,
14,
9630,
11537,
198,
198,
50,
10526,
4535,
53,
796,
685,
198,
220,
220,
220,
705,
24622,
3256,
198,
220,
220,
220,
705,
7266,
8481,
3256,
198,
220,
220,
220,
705,
83,
6791,
3256,
198,
220,
220,
220,
705,
620,
12311,
902,
6,
198,
60,
628,
198,
198,
31,
1324,
13,
38629,
10786,
14,
7220,
14,
27,
8841,
25,
29460,
29,
11537,
198,
31,
1324,
13,
38629,
10786,
14,
7220,
14,
27,
8841,
25,
29460,
29,
14,
24622,
11537,
198,
198,
31,
1324,
13,
38629,
10786,
14,
7220,
14,
27,
8841,
25,
29460,
29,
14,
83,
6791,
11537
] | 2.61745 | 149 |
"""Flreportviewer module."""
from PyQt5 import QtWidgets, QtCore, QtXml
from pineboolib.core import decorators
from pineboolib.application.qsatypes.sysbasetype import SysBaseType
from pineboolib.fllegacy.flutil import FLUtil
# from pineboolib.fllegacy.flpicture import FLPicture
from .flsqlquery import FLSqlQuery
from .flsqlcursor import FLSqlCursor
from .flreportengine import FLReportEngine
from pineboolib import logging
from typing import Any, List, Mapping, Sized, Union, Dict, Optional, Callable
from PyQt5.QtGui import QColor
AQ_USRHOME = "." # FIXME
class internalReportViewer(QtWidgets.QWidget):
"""internalReportViewer class."""
rptEngine_: Optional[FLReportEngine]
dpi_: int
report_: List[Any]
num_copies: int
def __init__(self, parent: QtWidgets.QWidget) -> None:
"""Inicialize."""
super().__init__(parent)
self.rptEngine_ = None
self.dpi_ = 300
self.report_ = []
self.num_copies = 1
def setReportEngine(self, rptEngine: FLReportEngine) -> None:
"""Set report engine."""
self.rptEngine_ = rptEngine
def resolution(self) -> int:
"""Return resolution."""
return self.dpi_
def reportPages(self) -> List[Any]:
"""Return report pages."""
return self.report_
def renderReport(self, init_row: int, init_col: int, flags: List[int]) -> Any:
"""Render report."""
if self.rptEngine_ is None:
raise Exception("renderReport. self.rptEngine_ is empty!")
return self.rptEngine_.renderReport(init_row, init_col, flags)
def setNumCopies(self, num_copies: int) -> None:
"""Set number of copies."""
self.num_copies = num_copies
def __getattr__(self, name: str) -> Callable:
"""Return attributes from report engine."""
return getattr(self.rptEngine_, name, None)
class FLReportViewer(QtWidgets.QWidget):
"""FLReportViewer class."""
pdfFile: str
Append: int
Display: int
PageBreak: int
spnResolution_: int
report_: List[Any]
qry_: Any
xmlData_: Any
template_: Any
autoClose_: bool
styleName_: str
PrintGrayScale = 0
PrintColor = 1
def __init__(
self,
parent: Optional[QtWidgets.QWidget] = None,
name: Optional[str] = None,
embedInParent: bool = False,
rptEngine: Optional[FLReportEngine] = None,
) -> None:
"""Inicialize."""
super(FLReportViewer, self).__init__(parent)
self.logger = logging.getLogger("FLReportViewer")
self.loop_ = False
self.eventloop = QtCore.QEventLoop()
self.reportPrinted_ = False
self.rptEngine_: Optional[Any] = None
self.report_ = []
self.slotsPrintDisabled_ = False
self.slotsExportedDisabled_ = False
self.printing_ = False
self.embedInParent_ = True if parent and embedInParent else False
self.ui_: Dict[str, QtCore.QObject] = {}
self.Display = 1
self.Append = 1
self.PageBreak = 1
self.rptViewer_ = internalReportViewer(self)
self.setReportEngine(FLReportEngine(self) if rptEngine is None else rptEngine)
if self.rptViewer_ is None:
raise Exception("self.rptViewer_ is empty!")
self.report_ = self.rptViewer_.reportPages()
def rptViewer(self) -> internalReportViewer:
"""Return report viewer."""
return self.rptViewer_
def rptEngine(self) -> FLReportEngine:
"""Return report engine."""
if self.rptEngine_ is None:
raise Exception("rptEngine_ is not defined!")
return self.rptEngine_
def setReportEngine(self, r: Optional[FLReportEngine] = None) -> None:
"""Set report engine."""
if self.rptEngine_ == r:
return
sender = self.sender()
noSigDestroy = not (sender and sender == self.rptEngine_)
self.rptEngine_ = r
if self.rptEngine_ is not None:
self.template_ = self.rptEngine_.rptNameTemplate()
self.qry_ = self.rptEngine_.rptQueryData()
if noSigDestroy:
self.rptViewer_.setReportEngine(self.rptEngine_)
def exec_(self) -> None:
"""Show report."""
# if self.loop_:
# print("FLReportViewer::exec(): Se ha detectado una llamada recursiva")
# return
if self.rptViewer_.rptEngine_ and hasattr(self.rptViewer_.rptEngine_, "parser_"):
pdf_file = self.rptViewer_.rptEngine_.parser_.get_file_name()
SysBaseType.openUrl(pdf_file)
# self.eventloop.exec_()
# if self.embedInParent_:
# return
# self.loop_ = True
# self.clearWFlags(Qt.WShowModal) # FIXME
@decorators.BetaImplementation
def csvData(self) -> str:
"""Return csv data."""
return self.rptEngine_.csvData() if self.rptEngine_ else ""
def renderReport(
self,
init_row: int = 0,
init_col: int = 0,
append_or_flags: Union[bool, Sized, Mapping[int, Any]] = None,
display_report: bool = False,
) -> bool:
"""Render report."""
if not self.rptEngine_:
return False
flags = [self.Append, self.Display]
if isinstance(append_or_flags, bool):
flags[0] = append_or_flags
if display_report is not None:
flags[0] = display_report
elif isinstance(append_or_flags, list):
if len(append_or_flags) > 0:
flags[0] = append_or_flags[0] # display
if len(append_or_flags) > 1:
flags[1] = append_or_flags[1] # append
if len(append_or_flags) > 2:
flags.append(append_or_flags[2]) # page_break
ret = self.rptViewer_.renderReport(init_row, init_col, flags)
self.report_ = self.rptViewer_.reportPages()
return ret
def setReportData(self, d: Union[FLSqlCursor, FLSqlQuery, QtXml.QDomNode]) -> bool:
"""Set data to report."""
if isinstance(d, FLSqlQuery):
self.qry_ = d
if self.rptEngine_ and self.rptEngine_.setReportData(d):
self.xmlData_ = self.rptEngine_.rptXmlData()
return True
return False
elif isinstance(d, FLSqlCursor):
if not self.rptEngine_:
return False
return self.rptEngine_.setReportData(d)
elif isinstance(d, QtXml.QDomNode):
self.xmlData_ = d
self.qry_ = None
if not self.rptEngine_:
return False
return self.rptEngine_.setReportData(d)
return False
def setReportTemplate(self, t: Union[QtXml.QDomNode, str], style: Optional[str] = None) -> bool:
"""Set template to report."""
if isinstance(t, QtXml.QDomNode):
self.xmlTemplate_ = t
self.template_ = ""
if not self.rptEngine_:
return False
if style is not None:
self.setStyleName(style)
self.rptEngine_.setFLReportTemplate(t)
return True
else:
self.template_ = t
self.styleName_ = style
if self.rptEngine_ and self.rptEngine_.setFLReportTemplate(t):
# self.setStyleName(style)
self.xmlTemplate_ = self.rptEngine_.rptXmlTemplate()
return True
return False
@decorators.BetaImplementation
def sizeHint(self) -> QtCore.QSize:
"""Return sizeHint."""
return self.rptViewer_.sizeHint()
@decorators.BetaImplementation
def setNumCopies(self, numCopies: int) -> None:
"""Set number of copies."""
self.rptViewer_.setNumCopies(numCopies)
@decorators.BetaImplementation
def setPrinterName(self, pName: str) -> None:
"""Set printer name."""
self.rptViewer_.setPrinterName(pName)
@decorators.BetaImplementation
def reportPrinted(self) -> bool:
"""Return if report was printed."""
return self.reportPrinted_
@decorators.pyqtSlot(int)
@decorators.BetaImplementation
def setResolution(self, dpi: int) -> None:
"""Set resolution."""
util = FLUtil()
util.writeSettingEntry("rptViewer/dpi", str(dpi))
self.rptViewer_.setResolution(dpi)
@decorators.pyqtSlot(int)
@decorators.BetaImplementation
def setPixel(self, relDpi: int) -> None:
"""Set pixel size."""
util = FLUtil()
util.writeSettingEntry("rptViewer/pixel", str(float(relDpi / 10.0)))
if self.rptEngine_:
self.rptEngine_.setRelDpi(relDpi / 10.0)
@decorators.BetaImplementation
def setDefaults(self) -> None:
"""Set default values."""
import platform
self.spnResolution_ = 300
system = platform.system()
if system == "Linux":
self.spnPixel_ = 780
elif system == "Windows":
# FIXME
pass
elif system == "Darwin":
# FIXME
pass
@decorators.BetaImplementation
def updateReport(self) -> None:
"""Update report."""
self.requestUpdateReport.emit()
if self.qry_ or (self.xmlData_ and self.xmlData_ != ""):
if not self.rptEngine_:
self.setReportEngine(FLReportEngine(self))
self.setResolution(self.spnResolution_)
self.setPixel(self.spnPixel_)
if self.template_ and self.template_ != "":
self.setReportTemplate(self.template_, self.styleName_)
else:
self.setReportTemplate(self.xmlTemplate_, self.styleName_)
if self.qry_:
self.setReportData(self.qry_)
else:
self.setReportData(self.xmlData_)
self.renderReport(0, 0, False, False)
self.updateDisplay()
@decorators.BetaImplementation
def getCurrentPage(self) -> Any:
"""Return curent page."""
# FIXME: self.report_ is just a List[]
# if self.report_:
# return FLPicture(self.report_.getCurrentPage(), self)
return 0
@decorators.BetaImplementation
def getFirstPage(self) -> Any:
"""Return first page."""
# FIXME: self.report_ is just a List[]
# if self.report_:
# return FLPicture(self.report_.getFirstPage(), self)
return 0
@decorators.BetaImplementation
def getPreviousPage(self) -> Any:
"""Return previous page."""
# FIXME: self.report_ is just a List[]
# if self.report_:
# return FLPicture(self.report_.getPreviousPage(), self)
return 0
@decorators.BetaImplementation
def getNextPage(self) -> Any:
"""Return next page."""
# FIXME: self.report_ is just a List[]
# if self.report_:
# return FLPicture(self.report_.getNextPage(), self)
return 0
@decorators.BetaImplementation
def getLastPage(self) -> Any:
"""Return last page."""
# FIXME: self.report_ is just a List[]
# if self.report_:
# return FLPicture(self.report_.getLastPage(), self)
return 0
@decorators.BetaImplementation
def getPageAt(self, i: int) -> Any:
"""Return actual page."""
# FIXME: self.report_ is just a List[]
# if self.report_:
# return FLPicture(self.report_.getPageAt(i), self)
return 0
@decorators.BetaImplementation
def updateDisplay(self) -> None:
"""Update display."""
self.rptViewer_.slotUpdateDisplay()
@decorators.BetaImplementation
def clearPages(self) -> None:
"""Clear report pages."""
# FIXME: self.report_ is just a List[]
# if self.report_:
# self.report_.clear()
pass
@decorators.BetaImplementation
def appendPage(self) -> None:
"""Add a new page."""
# FIXME: self.report_ is just a List[]
# if self.report_:
# self.report_.appendPage()
pass
@decorators.BetaImplementation
def getCurrentIndex(self) -> int:
"""Return current index position."""
# FIXME: self.report_ is just a List[]
# if self.report_:
# return self.report_.getCurrentIndex()
return -1
@decorators.BetaImplementation
def setCurrentPage(self, idx: int) -> None:
"""Set current page index."""
# FIXME: self.report_ is just a List[]
# if self.report_:
# self.report_.setCurrentPage(idx)
pass
@decorators.BetaImplementation
def setPageSize(self, w: Union[QtCore.QSize, int], h: Optional[int] = None) -> None:
"""Set page size."""
# FIXME: self.report_ is just a List[]
# if self.report_:
# self.report_.setPageSize(s)
pass
@decorators.BetaImplementation
def setPageOrientation(self, o: int) -> None:
"""Set page orientation."""
# FIXME: self.report_ is just a List[]
# if self.report_:
# self.report_.setPageOrientation(o)
pass
@decorators.BetaImplementation
def setPageDimensions(self, dim: QtCore.QSize) -> None:
"""Set page dimensions."""
# FIXME: self.report_ is just a List[]
# if self.report_:
# self.report_.setPageDimensions(dim)
pass
@decorators.BetaImplementation
def pageSize(self) -> QtCore.QSize:
"""Return page size."""
# FIXME: self.report_ is just a List[]
# if self.report_:
# return self.report_.pageSize()
return -1
@decorators.BetaImplementation
def pageOrientation(self) -> int:
"""Return page orientation."""
# FIXME: self.report_ is just a List[]
# if self.report_:
# return self.report_.pageOrientation()
return -1
def pageDimensions(self) -> QtCore.QSize:
"""Return page dimensions."""
if self.rptViewer_.rptEngine_ and hasattr(self.rptViewer_.rptEngine_, "parser_"):
return self.rptViewer_.rptEngine_.parser_._page_size
return -1
def pageCount(self) -> int:
"""Return number of pages."""
if self.rptViewer_.rptEngine_:
return self.rptViewer_.rptEngine_.number_pages()
return -1
@decorators.BetaImplementation
def setStyleName(self, style: str) -> None:
"""Set style name."""
self.styleName_ = style
@decorators.BetaImplementation
def setReportPages(self, pgs: Any) -> None:
"""Add pages to actual report."""
self.setReportEngine(None)
self.qry_ = None
self.xmlData_ = QtXml.QDomNode()
self.rptViewer_.setReportPages(pgs.pageCollection() if pgs else 0)
self.report_ = self.rptViewer_.reportPages()
@decorators.BetaImplementation
def setColorMode(self, c: QColor) -> None:
"""Set color mode."""
self.rptViewer_.setColorMode(c)
@decorators.BetaImplementation
def colorMode(self) -> QColor:
"""Return color mode."""
return self.rptViewer_.colorMode()
@decorators.BetaImplementation
def setName(self, n: str) -> None:
"""Set report name."""
self.name_ = n
@decorators.BetaImplementation
def name(self) -> str:
"""Return report name."""
return self.name_
def __getattr__(self, name: str) -> Any:
"""Return attribute from inernal object."""
return getattr(self.rptViewer_, name, None)
| [
37811,
7414,
13116,
1177,
263,
8265,
526,
15931,
198,
6738,
9485,
48,
83,
20,
1330,
33734,
54,
312,
11407,
11,
33734,
14055,
11,
33734,
55,
4029,
198,
198,
6738,
20161,
30388,
571,
13,
7295,
1330,
11705,
2024,
198,
6738,
20161,
30388,
571,
13,
31438,
13,
48382,
265,
9497,
13,
17597,
12093,
2963,
431,
1330,
311,
893,
14881,
6030,
198,
6738,
20161,
30388,
571,
13,
2704,
1455,
1590,
13,
2704,
22602,
1330,
9977,
18274,
346,
628,
198,
2,
422,
20161,
30388,
571,
13,
2704,
1455,
1590,
13,
2704,
34053,
1330,
9977,
28070,
198,
6738,
764,
2704,
25410,
22766,
1330,
376,
6561,
13976,
20746,
198,
6738,
764,
2704,
25410,
66,
21471,
1330,
376,
6561,
13976,
34,
21471,
198,
198,
6738,
764,
2704,
13116,
18392,
1330,
9977,
19100,
13798,
198,
6738,
20161,
30388,
571,
1330,
18931,
198,
198,
6738,
19720,
1330,
4377,
11,
7343,
11,
337,
5912,
11,
311,
1143,
11,
4479,
11,
360,
713,
11,
32233,
11,
4889,
540,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
8205,
72,
1330,
1195,
10258,
628,
198,
32,
48,
62,
2937,
49,
39069,
796,
366,
526,
220,
1303,
44855,
11682,
628,
198,
4871,
5387,
19100,
7680,
263,
7,
48,
83,
54,
312,
11407,
13,
48,
38300,
2599,
198,
220,
220,
220,
37227,
32538,
19100,
7680,
263,
1398,
526,
15931,
628,
220,
220,
220,
374,
457,
13798,
62,
25,
32233,
58,
3697,
19100,
13798,
60,
198,
220,
220,
220,
288,
14415,
62,
25,
493,
198,
220,
220,
220,
989,
62,
25,
7343,
58,
7149,
60,
198,
220,
220,
220,
997,
62,
22163,
444,
25,
493,
628,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
2560,
25,
33734,
54,
312,
11407,
13,
48,
38300,
8,
4613,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
818,
6652,
1096,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
2208,
22446,
834,
15003,
834,
7,
8000,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
81,
457,
13798,
62,
796,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
67,
14415,
62,
796,
5867,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
13116,
62,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
22510,
62,
22163,
444,
796,
352,
628,
220,
220,
220,
825,
900,
19100,
13798,
7,
944,
11,
374,
457,
13798,
25,
9977,
19100,
13798,
8,
4613,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
7248,
989,
3113,
526,
15931,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
81,
457,
13798,
62,
796,
374,
457,
13798,
628,
220,
220,
220,
825,
6323,
7,
944,
8,
4613,
493,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
13615,
6323,
526,
15931,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
67,
14415,
62,
628,
220,
220,
220,
825,
989,
47798,
7,
944,
8,
4613,
7343,
58,
7149,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
13615,
989,
5468,
526,
15931,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
13116,
62,
628,
220,
220,
220,
825,
8543,
19100,
7,
944,
11,
2315,
62,
808,
25,
493,
11,
2315,
62,
4033,
25,
493,
11,
9701,
25,
7343,
58,
600,
12962,
4613,
4377,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
45819,
989,
526,
15931,
628,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13,
81,
457,
13798,
62,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
35528,
7203,
13287,
19100,
13,
2116,
13,
81,
457,
13798,
62,
318,
6565,
2474,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
81,
457,
13798,
44807,
13287,
19100,
7,
15003,
62,
808,
11,
2315,
62,
4033,
11,
9701,
8,
628,
220,
220,
220,
825,
900,
33111,
13379,
444,
7,
944,
11,
997,
62,
22163,
444,
25,
493,
8,
4613,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
7248,
1271,
286,
9088,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
22510,
62,
22163,
444,
796,
997,
62,
22163,
444,
628,
220,
220,
220,
825,
11593,
1136,
35226,
834,
7,
944,
11,
1438,
25,
965,
8,
4613,
4889,
540,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
13615,
12608,
422,
989,
3113,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
651,
35226,
7,
944,
13,
81,
457,
13798,
62,
11,
1438,
11,
6045,
8,
628,
198,
4871,
9977,
19100,
7680,
263,
7,
48,
83,
54,
312,
11407,
13,
48,
38300,
2599,
198,
220,
220,
220,
37227,
3697,
19100,
7680,
263,
1398,
526,
15931,
628,
220,
220,
220,
37124,
8979,
25,
965,
198,
220,
220,
220,
2034,
437,
25,
493,
198,
220,
220,
220,
16531,
25,
493,
198,
220,
220,
220,
7873,
31737,
25,
493,
198,
220,
220,
220,
599,
77,
4965,
2122,
62,
25,
493,
198,
220,
220,
220,
989,
62,
25,
7343,
58,
7149,
60,
198,
220,
220,
220,
10662,
563,
62,
25,
4377,
198,
220,
220,
220,
35555,
6601,
62,
25,
4377,
198,
220,
220,
220,
11055,
62,
25,
4377,
198,
220,
220,
220,
8295,
26125,
62,
25,
20512,
198,
220,
220,
220,
3918,
5376,
62,
25,
965,
628,
220,
220,
220,
12578,
46130,
29990,
796,
657,
198,
220,
220,
220,
12578,
10258,
796,
352,
628,
220,
220,
220,
825,
11593,
15003,
834,
7,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2560,
25,
32233,
58,
48,
83,
54,
312,
11407,
13,
48,
38300,
60,
796,
6045,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
25,
32233,
58,
2536,
60,
796,
6045,
11,
198,
220,
220,
220,
220,
220,
220,
220,
11525,
818,
24546,
25,
20512,
796,
10352,
11,
198,
220,
220,
220,
220,
220,
220,
220,
374,
457,
13798,
25,
32233,
58,
3697,
19100,
13798,
60,
796,
6045,
11,
198,
220,
220,
220,
1267,
4613,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
818,
6652,
1096,
526,
15931,
628,
220,
220,
220,
220,
220,
220,
220,
2208,
7,
3697,
19100,
7680,
263,
11,
2116,
737,
834,
15003,
834,
7,
8000,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7203,
3697,
19100,
7680,
263,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
26268,
62,
796,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
15596,
26268,
796,
33734,
14055,
13,
48,
9237,
39516,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
13116,
18557,
276,
62,
796,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
81,
457,
13798,
62,
25,
32233,
58,
7149,
60,
796,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
13116,
62,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
6649,
1747,
18557,
7279,
4510,
62,
796,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
6649,
1747,
3109,
9213,
7279,
4510,
62,
796,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
4798,
278,
62,
796,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
20521,
818,
24546,
62,
796,
6407,
611,
2560,
290,
11525,
818,
24546,
2073,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
9019,
62,
25,
360,
713,
58,
2536,
11,
33734,
14055,
13,
48,
10267,
60,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
23114,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
4677,
437,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
9876,
31737,
796,
352,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
81,
457,
7680,
263,
62,
796,
5387,
19100,
7680,
263,
7,
944,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
2617,
19100,
13798,
7,
3697,
19100,
13798,
7,
944,
8,
611,
374,
457,
13798,
318,
6045,
2073,
374,
457,
13798,
8,
628,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13,
81,
457,
7680,
263,
62,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
35528,
7203,
944,
13,
81,
457,
7680,
263,
62,
318,
6565,
2474,
8,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
13116,
62,
796,
2116,
13,
81,
457,
7680,
263,
44807,
13116,
47798,
3419,
628,
220,
220,
220,
825,
374,
457,
7680,
263,
7,
944,
8,
4613,
5387,
19100,
7680,
263,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
13615,
989,
19091,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
81,
457,
7680,
263,
62,
628,
220,
220,
220,
825,
374,
457,
13798,
7,
944,
8,
4613,
9977,
19100,
13798,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
13615,
989,
3113,
526,
15931,
628,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13,
81,
457,
13798,
62,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
35528,
7203,
81,
457,
13798,
62,
318,
407,
5447,
2474,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
81,
457,
13798,
62,
628,
220,
220,
220,
825,
900,
19100,
13798,
7,
944,
11,
374,
25,
32233,
58,
3697,
19100,
13798,
60,
796,
6045,
8,
4613,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
7248,
989,
3113,
526,
15931,
628,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13,
81,
457,
13798,
62,
6624,
374,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
628,
220,
220,
220,
220,
220,
220,
220,
29788,
796,
2116,
13,
82,
2194,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
645,
50,
328,
49174,
796,
407,
357,
82,
2194,
290,
29788,
6624,
2116,
13,
81,
457,
13798,
62,
8,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
81,
457,
13798,
62,
796,
374,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13,
81,
457,
13798,
62,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
28243,
62,
796,
2116,
13,
81,
457,
13798,
44807,
81,
457,
5376,
30800,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
80,
563,
62,
796,
2116,
13,
81,
457,
13798,
44807,
81,
457,
20746,
6601,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
645,
50,
328,
49174,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
81,
457,
7680,
263,
44807,
2617,
19100,
13798,
7,
944,
13,
81,
457,
13798,
62,
8,
628,
220,
220,
220,
825,
2452,
41052,
944,
8,
4613,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
15307,
989,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
611,
2116,
13,
26268,
62,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
220,
220,
3601,
7203,
3697,
19100,
7680,
263,
3712,
18558,
33529,
1001,
387,
4886,
4533,
555,
64,
32660,
321,
4763,
664,
1834,
12151,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
220,
220,
1441,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13,
81,
457,
7680,
263,
44807,
81,
457,
13798,
62,
290,
468,
35226,
7,
944,
13,
81,
457,
7680,
263,
44807,
81,
457,
13798,
62,
11,
366,
48610,
62,
1,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37124,
62,
7753,
796,
2116,
13,
81,
457,
7680,
263,
44807,
81,
457,
13798,
44807,
48610,
44807,
1136,
62,
7753,
62,
3672,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
311,
893,
14881,
6030,
13,
9654,
28165,
7,
12315,
62,
7753,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
2116,
13,
15596,
26268,
13,
18558,
62,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
611,
2116,
13,
20521,
818,
24546,
62,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
220,
220,
1441,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
2116,
13,
26268,
62,
796,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
2116,
13,
20063,
54,
40053,
7,
48,
83,
13,
54,
15307,
5841,
282,
8,
1303,
44855,
11682,
628,
220,
220,
220,
2488,
12501,
273,
2024,
13,
43303,
3546,
32851,
198,
220,
220,
220,
825,
269,
21370,
6601,
7,
944,
8,
4613,
965,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
13615,
269,
21370,
1366,
526,
15931,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
81,
457,
13798,
44807,
40664,
6601,
3419,
611,
2116,
13,
81,
457,
13798,
62,
2073,
13538,
628,
220,
220,
220,
825,
8543,
19100,
7,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2315,
62,
808,
25,
493,
796,
657,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2315,
62,
4033,
25,
493,
796,
657,
11,
198,
220,
220,
220,
220,
220,
220,
220,
24443,
62,
273,
62,
33152,
25,
4479,
58,
30388,
11,
311,
1143,
11,
337,
5912,
58,
600,
11,
4377,
11907,
796,
6045,
11,
198,
220,
220,
220,
220,
220,
220,
220,
3359,
62,
13116,
25,
20512,
796,
10352,
11,
198,
220,
220,
220,
1267,
4613,
20512,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
45819,
989,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
611,
407,
2116,
13,
81,
457,
13798,
62,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
628,
220,
220,
220,
220,
220,
220,
220,
9701,
796,
685,
944,
13,
4677,
437,
11,
2116,
13,
23114,
60,
628,
220,
220,
220,
220,
220,
220,
220,
611,
318,
39098,
7,
33295,
62,
273,
62,
33152,
11,
20512,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9701,
58,
15,
60,
796,
24443,
62,
273,
62,
33152,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
3359,
62,
13116,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9701,
58,
15,
60,
796,
3359,
62,
13116,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
318,
39098,
7,
33295,
62,
273,
62,
33152,
11,
1351,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
18896,
7,
33295,
62,
273,
62,
33152,
8,
1875,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9701,
58,
15,
60,
796,
24443,
62,
273,
62,
33152,
58,
15,
60,
220,
1303,
3359,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
18896,
7,
33295,
62,
273,
62,
33152,
8,
1875,
352,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9701,
58,
16,
60,
796,
24443,
62,
273,
62,
33152,
58,
16,
60,
220,
1303,
24443,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
18896,
7,
33295,
62,
273,
62,
33152,
8,
1875,
362,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9701,
13,
33295,
7,
33295,
62,
273,
62,
33152,
58,
17,
12962,
220,
1303,
2443,
62,
9032,
628,
220,
220,
220,
220,
220,
220,
220,
1005,
796,
2116,
13,
81,
457,
7680,
263,
44807,
13287,
19100,
7,
15003,
62,
808,
11,
2315,
62,
4033,
11,
9701,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
13116,
62,
796,
2116,
13,
81,
457,
7680,
263,
44807,
13116,
47798,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
1005,
628,
220,
220,
220,
825,
900,
19100,
6601,
7,
944,
11,
288,
25,
4479,
58,
3697,
50,
13976,
34,
21471,
11,
376,
6561,
13976,
20746,
11,
33734,
55,
4029,
13,
48,
24510,
19667,
12962,
4613,
20512,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
7248,
1366,
284,
989,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
611,
318,
39098,
7,
67,
11,
376,
6561,
13976,
20746,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
80,
563,
62,
796,
288,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13,
81,
457,
13798,
62,
290,
2116,
13,
81,
457,
13798,
44807,
2617,
19100,
6601,
7,
67,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
19875,
6601,
62,
796,
2116,
13,
81,
457,
13798,
44807,
81,
457,
55,
4029,
6601,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
318,
39098,
7,
67,
11,
376,
6561,
13976,
34,
21471,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
407,
2116,
13,
81,
457,
13798,
62,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
81,
457,
13798,
44807,
2617,
19100,
6601,
7,
67,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
318,
39098,
7,
67,
11,
33734,
55,
4029,
13,
48,
24510,
19667,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
19875,
6601,
62,
796,
288,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
80,
563,
62,
796,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
407,
2116,
13,
81,
457,
13798,
62,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
81,
457,
13798,
44807,
2617,
19100,
6601,
7,
67,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
628,
220,
220,
220,
825,
900,
19100,
30800,
7,
944,
11,
256,
25,
4479,
58,
48,
83,
55,
4029,
13,
48,
24510,
19667,
11,
965,
4357,
3918,
25,
32233,
58,
2536,
60,
796,
6045,
8,
4613,
20512,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
7248,
11055,
284,
989,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
611,
318,
39098,
7,
83,
11,
33734,
55,
4029,
13,
48,
24510,
19667,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
19875,
30800,
62,
796,
256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
28243,
62,
796,
13538,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
407,
2116,
13,
81,
457,
13798,
62,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
3918,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
2617,
21466,
5376,
7,
7635,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
81,
457,
13798,
44807,
2617,
3697,
19100,
30800,
7,
83,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
28243,
62,
796,
256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
7635,
5376,
62,
796,
3918,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13,
81,
457,
13798,
62,
290,
2116,
13,
81,
457,
13798,
44807,
2617,
3697,
19100,
30800,
7,
83,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
2116,
13,
2617,
21466,
5376,
7,
7635,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
19875,
30800,
62,
796,
2116,
13,
81,
457,
13798,
44807,
81,
457,
55,
4029,
30800,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
6407,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
628,
220,
220,
220,
2488,
12501,
273,
2024,
13,
43303,
3546,
32851,
198,
220,
220,
220,
825,
2546,
39,
600,
7,
944,
8,
4613,
33734,
14055,
13,
48,
10699,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
13615,
2546,
39,
600,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
81,
457,
7680,
263,
44807,
7857,
39,
600,
3419,
628,
220,
220,
220,
2488,
12501,
273,
2024,
13,
43303,
3546,
32851,
198,
220,
220,
220,
825,
900,
33111,
13379,
444,
7,
944,
11,
997,
13379,
444,
25,
493,
8,
4613,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
7248,
1271,
286,
9088,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
81,
457,
7680,
263,
44807,
2617,
33111,
13379,
444,
7,
22510,
13379,
444,
8,
628,
220,
220,
220,
2488,
12501,
273,
2024,
13,
43303,
3546,
32851,
198,
220,
220,
220,
825,
900,
6836,
3849,
5376,
7,
944,
11,
279,
5376,
25,
965,
8,
4613,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
7248,
20632,
1438,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
81,
457,
7680,
263,
44807,
2617,
6836,
3849,
5376,
7,
79,
5376,
8,
628,
220,
220,
220,
2488,
12501,
273,
2024,
13,
43303,
3546,
32851,
198,
220,
220,
220,
825,
989,
18557,
276,
7,
944,
8,
4613,
20512,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
13615,
611,
989,
373,
10398,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
13116,
18557,
276,
62,
628,
220,
220,
220,
2488,
12501,
273,
2024,
13,
9078,
39568,
38963,
7,
600,
8,
198,
220,
220,
220,
2488,
12501,
273,
2024,
13,
43303,
3546,
32851,
198,
220,
220,
220,
825,
900,
4965,
2122,
7,
944,
11,
288,
14415,
25,
493,
8,
4613,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
7248,
6323,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
7736,
796,
9977,
18274,
346,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
7736,
13,
13564,
34149,
30150,
7203,
81,
457,
7680,
263,
14,
67,
14415,
1600,
965,
7,
67,
14415,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
81,
457,
7680,
263,
44807,
2617,
4965,
2122,
7,
67,
14415,
8,
628,
220,
220,
220,
2488,
12501,
273,
2024,
13,
9078,
39568,
38963,
7,
600,
8,
198,
220,
220,
220,
2488,
12501,
273,
2024,
13,
43303,
3546,
32851,
198,
220,
220,
220,
825,
900,
40809,
7,
944,
11,
823,
35,
14415,
25,
493,
8,
4613,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
7248,
17465,
2546,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
7736,
796,
9977,
18274,
346,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
7736,
13,
13564,
34149,
30150,
7203,
81,
457,
7680,
263,
14,
32515,
1600,
965,
7,
22468,
7,
2411,
35,
14415,
1220,
838,
13,
15,
22305,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13,
81,
457,
13798,
62,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
81,
457,
13798,
44807,
2617,
6892,
35,
14415,
7,
2411,
35,
14415,
1220,
838,
13,
15,
8,
628,
220,
220,
220,
2488,
12501,
273,
2024,
13,
43303,
3546,
32851,
198,
220,
220,
220,
825,
900,
7469,
13185,
7,
944,
8,
4613,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
7248,
4277,
3815,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
1330,
3859,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
2777,
77,
4965,
2122,
62,
796,
5867,
198,
220,
220,
220,
220,
220,
220,
220,
1080,
796,
3859,
13,
10057,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
611,
1080,
6624,
366,
19314,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
2777,
77,
40809,
62,
796,
41287,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
1080,
6624,
366,
11209,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
44855,
11682,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1208,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
1080,
6624,
366,
32708,
5404,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
44855,
11682,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1208,
628,
220,
220,
220,
2488,
12501,
273,
2024,
13,
43303,
3546,
32851,
198,
220,
220,
220,
825,
4296,
19100,
7,
944,
8,
4613,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
10260,
989,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
25927,
10260,
19100,
13,
368,
270,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13,
80,
563,
62,
393,
357,
944,
13,
19875,
6601,
62,
290,
2116,
13,
19875,
6601,
62,
14512,
13538,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
407,
2116,
13,
81,
457,
13798,
62,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
2617,
19100,
13798,
7,
3697,
19100,
13798,
7,
944,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
2617,
4965,
2122,
7,
944,
13,
2777,
77,
4965,
2122,
62,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
2617,
40809,
7,
944,
13,
2777,
77,
40809,
62,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13,
28243,
62,
290,
2116,
13,
28243,
62,
14512,
366,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
2617,
19100,
30800,
7,
944,
13,
28243,
62,
11,
2116,
13,
7635,
5376,
62,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
2617,
19100,
30800,
7,
944,
13,
19875,
30800,
62,
11,
2116,
13,
7635,
5376,
62,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13,
80,
563,
62,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
2617,
19100,
6601,
7,
944,
13,
80,
563,
62,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
2617,
19100,
6601,
7,
944,
13,
19875,
6601,
62,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
13287,
19100,
7,
15,
11,
657,
11,
10352,
11,
10352,
8,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
19119,
23114,
3419,
628,
220,
220,
220,
2488,
12501,
273,
2024,
13,
43303,
3546,
32851,
198,
220,
220,
220,
825,
651,
11297,
9876,
7,
944,
8,
4613,
4377,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
13615,
13996,
429,
2443,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
44855,
11682,
25,
2116,
13,
13116,
62,
318,
655,
257,
7343,
21737,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
611,
2116,
13,
13116,
62,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
220,
220,
220,
1441,
9977,
28070,
7,
944,
13,
13116,
44807,
1136,
11297,
9876,
22784,
2116,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
657,
628,
220,
220,
220,
2488,
12501,
273,
2024,
13,
43303,
3546,
32851,
198,
220,
220,
220,
825,
651,
5962,
9876,
7,
944,
8,
4613,
4377,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
13615,
717,
2443,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
44855,
11682,
25,
2116,
13,
13116,
62,
318,
655,
257,
7343,
21737,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
611,
2116,
13,
13116,
62,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
220,
220,
220,
1441,
9977,
28070,
7,
944,
13,
13116,
44807,
1136,
5962,
9876,
22784,
2116,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
657,
628,
220,
220,
220,
2488,
12501,
273,
2024,
13,
43303,
3546,
32851,
198,
220,
220,
220,
825,
651,
21448,
9876,
7,
944,
8,
4613,
4377,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
13615,
2180,
2443,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
44855,
11682,
25,
2116,
13,
13116,
62,
318,
655,
257,
7343,
21737,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
611,
2116,
13,
13116,
62,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
220,
220,
220,
1441,
9977,
28070,
7,
944,
13,
13116,
44807,
1136,
21448,
9876,
22784,
2116,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
657,
628,
220,
220,
220,
2488,
12501,
273,
2024,
13,
43303,
3546,
32851,
198,
220,
220,
220,
825,
651,
10019,
9876,
7,
944,
8,
4613,
4377,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
13615,
1306,
2443,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
44855,
11682,
25,
2116,
13,
13116,
62,
318,
655,
257,
7343,
21737,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
611,
2116,
13,
13116,
62,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
220,
220,
220,
1441,
9977,
28070,
7,
944,
13,
13116,
44807,
1136,
10019,
9876,
22784,
2116,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
657,
628,
220,
220,
220,
2488,
12501,
273,
2024,
13,
43303,
3546,
32851,
198,
220,
220,
220,
825,
651,
5956,
9876,
7,
944,
8,
4613,
4377,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
13615,
938,
2443,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
44855,
11682,
25,
2116,
13,
13116,
62,
318,
655,
257,
7343,
21737,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
611,
2116,
13,
13116,
62,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
220,
220,
220,
1441,
9977,
28070,
7,
944,
13,
13116,
44807,
1136,
5956,
9876,
22784,
2116,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
657,
628,
220,
220,
220,
2488,
12501,
273,
2024,
13,
43303,
3546,
32851,
198,
220,
220,
220,
825,
651,
9876,
2953,
7,
944,
11,
1312,
25,
493,
8,
4613,
4377,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
13615,
4036,
2443,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
44855,
11682,
25,
2116,
13,
13116,
62,
318,
655,
257,
7343,
21737,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
611,
2116,
13,
13116,
62,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
220,
220,
220,
1441,
9977,
28070,
7,
944,
13,
13116,
44807,
1136,
9876,
2953,
7,
72,
828,
2116,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
657,
628,
220,
220,
220,
2488,
12501,
273,
2024,
13,
43303,
3546,
32851,
198,
220,
220,
220,
825,
4296,
23114,
7,
944,
8,
4613,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
10260,
3359,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
81,
457,
7680,
263,
44807,
43384,
10260,
23114,
3419,
628,
220,
220,
220,
2488,
12501,
273,
2024,
13,
43303,
3546,
32851,
198,
220,
220,
220,
825,
1598,
47798,
7,
944,
8,
4613,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
19856,
989,
5468,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
44855,
11682,
25,
2116,
13,
13116,
62,
318,
655,
257,
7343,
21737,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
611,
2116,
13,
13116,
62,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
220,
220,
220,
2116,
13,
13116,
44807,
20063,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
1208,
628,
220,
220,
220,
2488,
12501,
273,
2024,
13,
43303,
3546,
32851,
198,
220,
220,
220,
825,
24443,
9876,
7,
944,
8,
4613,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
4550,
257,
649,
2443,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
44855,
11682,
25,
2116,
13,
13116,
62,
318,
655,
257,
7343,
21737,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
611,
2116,
13,
13116,
62,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
220,
220,
220,
2116,
13,
13116,
44807,
33295,
9876,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
1208,
628,
220,
220,
220,
2488,
12501,
273,
2024,
13,
43303,
3546,
32851,
198,
220,
220,
220,
825,
651,
11297,
15732,
7,
944,
8,
4613,
493,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
13615,
1459,
6376,
2292,
526,
15931,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
44855,
11682,
25,
2116,
13,
13116,
62,
318,
655,
257,
7343,
21737,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
611,
2116,
13,
13116,
62,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
220,
220,
220,
1441,
2116,
13,
13116,
44807,
1136,
11297,
15732,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
532,
16,
628,
220,
220,
220,
2488,
12501,
273,
2024,
13,
43303,
3546,
32851,
198,
220,
220,
220,
825,
900,
11297,
9876,
7,
944,
11,
4686,
87,
25,
493,
8,
4613,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
7248,
1459,
2443,
6376,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
44855,
11682,
25,
2116,
13,
13116,
62,
318,
655,
257,
7343,
21737,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
611,
2116,
13,
13116,
62,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
220,
220,
220,
2116,
13,
13116,
44807,
2617,
11297,
9876,
7,
312,
87,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1208,
628,
220,
220,
220,
2488,
12501,
273,
2024,
13,
43303,
3546,
32851,
198,
220,
220,
220,
825,
900,
9876,
10699,
7,
944,
11,
266,
25,
4479,
58,
48,
83,
14055,
13,
48,
10699,
11,
493,
4357,
289,
25,
32233,
58,
600,
60,
796,
6045,
8,
4613,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
7248,
2443,
2546,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
44855,
11682,
25,
2116,
13,
13116,
62,
318,
655,
257,
7343,
21737,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
611,
2116,
13,
13116,
62,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
220,
220,
220,
2116,
13,
13116,
44807,
2617,
9876,
10699,
7,
82,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1208,
628,
220,
220,
220,
2488,
12501,
273,
2024,
13,
43303,
3546,
32851,
198,
220,
220,
220,
825,
900,
9876,
46,
8289,
341,
7,
944,
11,
267,
25,
493,
8,
4613,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
7248,
2443,
12852,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
44855,
11682,
25,
2116,
13,
13116,
62,
318,
655,
257,
7343,
21737,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
611,
2116,
13,
13116,
62,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
220,
220,
220,
2116,
13,
13116,
44807,
2617,
9876,
46,
8289,
341,
7,
78,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1208,
628,
220,
220,
220,
2488,
12501,
273,
2024,
13,
43303,
3546,
32851,
198,
220,
220,
220,
825,
900,
9876,
29271,
5736,
7,
944,
11,
5391,
25,
33734,
14055,
13,
48,
10699,
8,
4613,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
7248,
2443,
15225,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
44855,
11682,
25,
2116,
13,
13116,
62,
318,
655,
257,
7343,
21737,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
611,
2116,
13,
13116,
62,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
220,
220,
220,
2116,
13,
13116,
44807,
2617,
9876,
29271,
5736,
7,
27740,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1208,
628,
220,
220,
220,
2488,
12501,
273,
2024,
13,
43303,
3546,
32851,
198,
220,
220,
220,
825,
2443,
10699,
7,
944,
8,
4613,
33734,
14055,
13,
48,
10699,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
13615,
2443,
2546,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
44855,
11682,
25,
2116,
13,
13116,
62,
318,
655,
257,
7343,
21737,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
611,
2116,
13,
13116,
62,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
220,
220,
220,
1441,
2116,
13,
13116,
44807,
7700,
10699,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
532,
16,
628,
220,
220,
220,
2488,
12501,
273,
2024,
13,
43303,
3546,
32851,
198,
220,
220,
220,
825,
2443,
46,
8289,
341,
7,
944,
8,
4613,
493,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
13615,
2443,
12852,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
44855,
11682,
25,
2116,
13,
13116,
62,
318,
655,
257,
7343,
21737,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
611,
2116,
13,
13116,
62,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
220,
220,
220,
1441,
2116,
13,
13116,
44807,
7700,
46,
8289,
341,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
532,
16,
628,
220,
220,
220,
825,
2443,
29271,
5736,
7,
944,
8,
4613,
33734,
14055,
13,
48,
10699,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
13615,
2443,
15225,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13,
81,
457,
7680,
263,
44807,
81,
457,
13798,
62,
290,
468,
35226,
7,
944,
13,
81,
457,
7680,
263,
44807,
81,
457,
13798,
62,
11,
366,
48610,
62,
1,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
81,
457,
7680,
263,
44807,
81,
457,
13798,
44807,
48610,
62,
13557,
7700,
62,
7857,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
532,
16,
628,
220,
220,
220,
825,
2443,
12332,
7,
944,
8,
4613,
493,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
13615,
1271,
286,
5468,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13,
81,
457,
7680,
263,
44807,
81,
457,
13798,
62,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
81,
457,
7680,
263,
44807,
81,
457,
13798,
44807,
17618,
62,
31126,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
532,
16,
628,
220,
220,
220,
2488,
12501,
273,
2024,
13,
43303,
3546,
32851,
198,
220,
220,
220,
825,
900,
21466,
5376,
7,
944,
11,
3918,
25,
965,
8,
4613,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
7248,
3918,
1438,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
7635,
5376,
62,
796,
3918,
628,
220,
220,
220,
2488,
12501,
273,
2024,
13,
43303,
3546,
32851,
198,
220,
220,
220,
825,
900,
19100,
47798,
7,
944,
11,
279,
14542,
25,
4377,
8,
4613,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
4550,
5468,
284,
4036,
989,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
2617,
19100,
13798,
7,
14202,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
80,
563,
62,
796,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
19875,
6601,
62,
796,
33734,
55,
4029,
13,
48,
24510,
19667,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
81,
457,
7680,
263,
44807,
2617,
19100,
47798,
7,
6024,
82,
13,
7700,
36307,
3419,
611,
279,
14542,
2073,
657,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
13116,
62,
796,
2116,
13,
81,
457,
7680,
263,
44807,
13116,
47798,
3419,
628,
220,
220,
220,
2488,
12501,
273,
2024,
13,
43303,
3546,
32851,
198,
220,
220,
220,
825,
900,
10258,
19076,
7,
944,
11,
269,
25,
1195,
10258,
8,
4613,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
7248,
3124,
4235,
526,
15931,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
81,
457,
7680,
263,
44807,
2617,
10258,
19076,
7,
66,
8,
628,
220,
220,
220,
2488,
12501,
273,
2024,
13,
43303,
3546,
32851,
198,
220,
220,
220,
825,
3124,
19076,
7,
944,
8,
4613,
1195,
10258,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
13615,
3124,
4235,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
81,
457,
7680,
263,
44807,
8043,
19076,
3419,
628,
220,
220,
220,
2488,
12501,
273,
2024,
13,
43303,
3546,
32851,
198,
220,
220,
220,
825,
900,
5376,
7,
944,
11,
299,
25,
965,
8,
4613,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
7248,
989,
1438,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
3672,
62,
796,
299,
628,
220,
220,
220,
2488,
12501,
273,
2024,
13,
43303,
3546,
32851,
198,
220,
220,
220,
825,
1438,
7,
944,
8,
4613,
965,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
13615,
989,
1438,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
3672,
62,
628,
220,
220,
220,
825,
11593,
1136,
35226,
834,
7,
944,
11,
1438,
25,
965,
8,
4613,
4377,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
13615,
11688,
422,
287,
35220,
2134,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
651,
35226,
7,
944,
13,
81,
457,
7680,
263,
62,
11,
1438,
11,
6045,
8,
198
] | 2.210905 | 7,079 |
# MIT License
# Copyright (c) 2018-2019 Groupe Allo-Media
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
from typing import Dict, Optional, Set, Tuple
from .base import Language
#
# CONSTANTS
# Built once on import.
#
# Those words multiplies lesser numbers (see Rules)
# Special case: "hundred" is processed apart.
MULTIPLIERS = {
"thousand": 1_000,
"thousands": 1_000,
"million": 1_000_000,
"millions": 1_000_000,
"billion": 1_000_000_000,
"billions": 1_000_000_000,
"trillion": 1_000_000_000_000,
"trillions": 1_000_000_000_000,
}
# Units are terminals (see Rules)
# Special case: "zero/O" is processed apart.
UNITS: Dict[str, int] = {
word: value
for value, word in enumerate(
"one two three four five six seven eight nine".split(), 1
)
}
# Single tens are terminals (see Rules)
STENS: Dict[str, int] = {
word: value
for value, word in enumerate(
"ten eleven twelve thirteen fourteen fifteen sixteen seventeen eighteen nineteen".split(),
10,
)
}
# Ten multiples
# Ten multiples may be followed by a unit only;
MTENS: Dict[str, int] = {
word: value * 10
for value, word in enumerate(
"twenty thirty forty fifty sixty seventy eighty ninety".split(), 2
)
}
# Ten multiples that can be combined with STENS
MTENS_WSTENS: Set[str] = set()
# "hundred" has a special status (see Rules)
HUNDRED = {"hundred": 100, "hundreds": 100}
# Composites are tens already composed with terminals in one word.
# Composites are terminals.
COMPOSITES: Dict[str, int] = {
"-".join((ten_word, unit_word)): ten_val + unit_val
for ten_word, ten_val in MTENS.items()
for unit_word, unit_val in UNITS.items()
}
# All number words
NUMBERS = MULTIPLIERS.copy()
NUMBERS.update(UNITS)
NUMBERS.update(STENS)
NUMBERS.update(MTENS)
NUMBERS.update(HUNDRED)
NUMBERS.update(COMPOSITES)
RAD_MAP = {"fif": "five", "eigh": "eight", "nin": "nine", "twelf": "twelve"}
| [
2,
17168,
13789,
198,
198,
2,
15069,
357,
66,
8,
2864,
12,
23344,
402,
472,
431,
1439,
78,
12,
13152,
198,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
2,
286,
428,
3788,
290,
3917,
10314,
3696,
357,
1169,
366,
25423,
12340,
284,
1730,
198,
2,
287,
262,
10442,
1231,
17504,
11,
1390,
1231,
17385,
262,
2489,
198,
2,
284,
779,
11,
4866,
11,
13096,
11,
20121,
11,
7715,
11,
14983,
11,
850,
43085,
11,
290,
14,
273,
3677,
198,
2,
9088,
286,
262,
10442,
11,
290,
284,
8749,
6506,
284,
4150,
262,
10442,
318,
198,
2,
30760,
284,
466,
523,
11,
2426,
284,
262,
1708,
3403,
25,
198,
198,
2,
383,
2029,
6634,
4003,
290,
428,
7170,
4003,
2236,
307,
3017,
287,
477,
198,
2,
9088,
393,
8904,
16690,
286,
262,
10442,
13,
198,
198,
2,
3336,
47466,
3180,
36592,
2389,
1961,
366,
1921,
3180,
1600,
42881,
34764,
56,
3963,
15529,
509,
12115,
11,
7788,
32761,
6375,
198,
2,
8959,
49094,
11,
47783,
2751,
21728,
5626,
40880,
5390,
3336,
34764,
11015,
3963,
34482,
3398,
1565,
5603,
25382,
11,
198,
2,
376,
46144,
7473,
317,
16652,
2149,
37232,
33079,
48933,
5357,
44521,
1268,
10913,
2751,
12529,
13,
3268,
8005,
49261,
50163,
3336,
198,
2,
37195,
20673,
6375,
27975,
38162,
9947,
367,
15173,
4877,
9348,
43031,
19146,
7473,
15529,
47666,
3955,
11,
29506,
25552,
6375,
25401,
198,
2,
43031,
25382,
11,
7655,
2767,
16879,
3268,
3537,
40282,
3963,
27342,
10659,
11,
309,
9863,
6375,
25401,
54,
24352,
11,
5923,
1797,
2751,
16034,
11,
198,
2,
16289,
3963,
6375,
3268,
7102,
45,
24565,
13315,
3336,
47466,
6375,
3336,
23210,
6375,
25401,
5550,
1847,
20754,
3268,
3336,
198,
2,
47466,
13,
198,
198,
6738,
19720,
1330,
360,
713,
11,
32233,
11,
5345,
11,
309,
29291,
198,
198,
6738,
764,
8692,
1330,
15417,
198,
198,
2,
198,
2,
7102,
2257,
1565,
4694,
198,
2,
28477,
1752,
319,
1330,
13,
198,
2,
198,
198,
2,
5845,
2456,
15082,
444,
14494,
3146,
357,
3826,
14252,
8,
198,
2,
6093,
1339,
25,
366,
71,
3229,
1,
318,
13686,
5475,
13,
198,
44,
16724,
4061,
31271,
4877,
796,
1391,
198,
220,
220,
220,
366,
400,
29910,
1298,
352,
62,
830,
11,
198,
220,
220,
220,
366,
400,
19983,
1298,
352,
62,
830,
11,
198,
220,
220,
220,
366,
14100,
1298,
352,
62,
830,
62,
830,
11,
198,
220,
220,
220,
366,
17805,
507,
1298,
352,
62,
830,
62,
830,
11,
198,
220,
220,
220,
366,
24540,
1298,
352,
62,
830,
62,
830,
62,
830,
11,
198,
220,
220,
220,
366,
35546,
507,
1298,
352,
62,
830,
62,
830,
62,
830,
11,
198,
220,
220,
220,
366,
2213,
1131,
1298,
352,
62,
830,
62,
830,
62,
830,
62,
830,
11,
198,
220,
220,
220,
366,
2213,
40083,
1298,
352,
62,
830,
62,
830,
62,
830,
62,
830,
11,
198,
92,
628,
198,
2,
27719,
389,
30237,
357,
3826,
14252,
8,
198,
2,
6093,
1339,
25,
366,
22570,
14,
46,
1,
318,
13686,
5475,
13,
198,
4944,
29722,
25,
360,
713,
58,
2536,
11,
493,
60,
796,
1391,
198,
220,
220,
220,
1573,
25,
1988,
198,
220,
220,
220,
329,
1988,
11,
1573,
287,
27056,
378,
7,
198,
220,
220,
220,
220,
220,
220,
220,
366,
505,
734,
1115,
1440,
1936,
2237,
3598,
3624,
5193,
1911,
35312,
22784,
352,
198,
220,
220,
220,
1267,
198,
92,
198,
198,
2,
14206,
11192,
389,
30237,
357,
3826,
14252,
8,
198,
2257,
16938,
25,
360,
713,
58,
2536,
11,
493,
60,
796,
1391,
198,
220,
220,
220,
1573,
25,
1988,
198,
220,
220,
220,
329,
1988,
11,
1573,
287,
27056,
378,
7,
198,
220,
220,
220,
220,
220,
220,
220,
366,
1452,
22216,
14104,
28306,
29167,
17280,
27913,
38741,
29095,
43063,
1911,
35312,
22784,
198,
220,
220,
220,
220,
220,
220,
220,
838,
11,
198,
220,
220,
220,
1267,
198,
92,
628,
198,
2,
9368,
5021,
2374,
198,
2,
9368,
5021,
2374,
743,
307,
3940,
416,
257,
4326,
691,
26,
198,
13752,
16938,
25,
360,
713,
58,
2536,
11,
493,
60,
796,
1391,
198,
220,
220,
220,
1573,
25,
1988,
1635,
838,
198,
220,
220,
220,
329,
1988,
11,
1573,
287,
27056,
378,
7,
198,
220,
220,
220,
220,
220,
220,
220,
366,
4246,
3787,
12277,
16571,
15334,
24742,
31989,
37516,
37989,
1911,
35312,
22784,
362,
198,
220,
220,
220,
1267,
198,
92,
198,
198,
2,
9368,
5021,
2374,
326,
460,
307,
5929,
351,
3563,
16938,
198,
13752,
16938,
62,
54,
2257,
16938,
25,
5345,
58,
2536,
60,
796,
900,
3419,
628,
198,
2,
366,
71,
3229,
1,
468,
257,
2041,
3722,
357,
3826,
14252,
8,
198,
39,
4944,
7707,
1961,
796,
19779,
71,
3229,
1298,
1802,
11,
366,
71,
20960,
1298,
1802,
92,
628,
198,
2,
29936,
2737,
389,
11192,
1541,
13160,
351,
30237,
287,
530,
1573,
13,
198,
2,
29936,
2737,
389,
30237,
13,
198,
198,
9858,
37997,
2043,
1546,
25,
360,
713,
58,
2536,
11,
493,
60,
796,
1391,
198,
220,
220,
220,
27444,
1911,
22179,
19510,
1452,
62,
4775,
11,
4326,
62,
4775,
8,
2599,
3478,
62,
2100,
1343,
4326,
62,
2100,
198,
220,
220,
220,
329,
3478,
62,
4775,
11,
3478,
62,
2100,
287,
19308,
16938,
13,
23814,
3419,
198,
220,
220,
220,
329,
4326,
62,
4775,
11,
4326,
62,
2100,
287,
4725,
29722,
13,
23814,
3419,
198,
92,
198,
198,
2,
1439,
1271,
2456,
198,
198,
41359,
33,
4877,
796,
337,
16724,
4061,
31271,
4877,
13,
30073,
3419,
198,
41359,
33,
4877,
13,
19119,
7,
4944,
29722,
8,
198,
41359,
33,
4877,
13,
19119,
7,
2257,
16938,
8,
198,
41359,
33,
4877,
13,
19119,
7,
13752,
16938,
8,
198,
41359,
33,
4877,
13,
19119,
7,
39,
4944,
7707,
1961,
8,
198,
41359,
33,
4877,
13,
19119,
7,
9858,
37997,
2043,
1546,
8,
198,
198,
49,
2885,
62,
33767,
796,
19779,
32041,
1298,
366,
13261,
1600,
366,
68,
394,
1298,
366,
26022,
1600,
366,
35073,
1298,
366,
30888,
1600,
366,
4246,
7046,
1298,
366,
4246,
9954,
20662,
628
] | 2.964036 | 1,001 |
"""
Matrix multiply generator. Generates an Eigen matrix multiply override kernel.
"""
| [
37811,
628,
220,
24936,
29162,
17301,
13,
2980,
689,
281,
412,
9324,
17593,
29162,
20957,
9720,
13,
198,
198,
37811,
628
] | 4.380952 | 21 |
import datetime
import importlib
import logging
import sys
from redash.query_runner import *
from redash.utils import json_dumps, json_loads
from redash import models
from RestrictedPython import compile_restricted
from RestrictedPython.Guards import safe_builtins
logger = logging.getLogger(__name__)
class CustomPrint(object):
"""CustomPrint redirect "print" calls to be sent as "log" on the result object."""
register(Python)
| [
11748,
4818,
8079,
198,
11748,
1330,
8019,
198,
11748,
18931,
198,
11748,
25064,
198,
198,
6738,
2266,
1077,
13,
22766,
62,
16737,
1330,
1635,
198,
6738,
2266,
1077,
13,
26791,
1330,
33918,
62,
67,
8142,
11,
33918,
62,
46030,
198,
6738,
2266,
1077,
1330,
4981,
198,
6738,
8324,
20941,
37906,
1330,
17632,
62,
49343,
198,
6738,
8324,
20941,
37906,
13,
8205,
1371,
1330,
3338,
62,
18780,
1040,
628,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628,
198,
4871,
8562,
18557,
7,
15252,
2599,
198,
220,
220,
220,
37227,
15022,
18557,
18941,
366,
4798,
1,
3848,
284,
307,
1908,
355,
366,
6404,
1,
319,
262,
1255,
2134,
526,
15931,
628,
198,
198,
30238,
7,
37906,
8,
198
] | 3.585366 | 123 |
#-*- coding: utf-8 -*-
'''
Created on 21 06 2019
@author: lukhnevsn
'''
#import packages
##############################################
from java.io import BufferedReader ,FileReader, IOException;
from java.sql import PreparedStatement,Connection,DriverManager,SQLException,Statement,Types, ResultSet;
from java.net import Proxy, InetSocketAddress;
from okhttp3 import Call, OkHttpClient, Request, Response;
from okhttp3.OkHttpClient import newBuilder;
from okhttp3.Request import newBuilder as Builder;
from org.apache.http.impl.client import BasicCredentialsProvider, CloseableHttpClient, HttpClients;
from org.apache.http import HttpEntity,HttpHost;
from org.apache.http.auth import AuthScope, NTCredentials;
from jarray import zeros;
from au.com.bytecode.opencsv import CSVReader;
from java.lang.String import length, replace;
#import org.apache.commons.vfs2.util.Cryptor as Cryptor;
#import org.apache.commons.vfs2.util.CryptorFactory as CryptorFactory;
import okhttp3.Credentials as Credentials;
import java.io.File as File;
import java.io.FileOutputStream as FileOutputStream;
import java.io.InputStreamReader as InputStreamReader;
import java.io.FileInputStream as FileInputStream;
import java.sql.ResultSet;
import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream as BZip2CompressorInputStream;
import java.nio.file.Files as Files;
import java.nio.file.Paths as Paths;
import java.nio.file.StandardCopyOption as StandardCopyOption;
import java.util.concurrent.TimeUnit as TimeUnit;
import java.lang;
import org.apache.http.client.config.RequestConfig as RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse as CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet as HttpGet;
import java.sql.Timestamp as Timestamp;
import java.lang.System as System;
import java.sql.Timestamp as Timestamp;
#constants
##############################################
archived_file = 'list_of_expired_passports.csv.bz2'; #filname for downloading file
unarchived_file = 'list_of_expired_passports.csv'; #filname for uncompressed file
url = "http://guvm.mvd.ru/upload/expired-passports/list_of_expired_passports.csv.bz2" ; #url = 'https://xn--b1ab2a0a.xn--b1aew.xn--p1ai/upload/expired-passports/list_of_expired_passports.csv.bz2'; #url = 'http://localhost/pass/list_of_expired_passports.csv.bin';
ODIAgent = '<%=odiRef.getSession( "AGENT_NAME" )%>';
ora_odi_pass_e = "BD15AFA077FA694DB138CD75D5BD19BA";
ora_odi_pass = CryptorFactory.getCryptor().decrypt(ora_odi_pass_e);
conn = odiRef.getJDBCConnection( "DEST" );
s_schema = '<%=odiRef.getInfo("DEST_SCHEMA")%>'
table_name = 'DIM_INVALID_PASSPORTS';
batch_size = 500000; #batch for inserting
buffer_size = 1024*8; #buffer for reading from web
downloaded = 0; #help const
lnNum =0; #help const
lastPercent = -1; #help const
totalRecords= 0; #help const
#functions
##############################################
def ins_log(state, err_text) :
'''
ANALSYS PROCCESSES LOGGING FUNC
'''
global conn;
conn.setSchema(s_schema);
cLog = conn.prepareCall("{call P_INS_LOG(DIM_INVALID_PASSPORTS,?,?)}");
cLog.setString("sSTATE",state);
if (err_text != None) :
cLog.setString("sERRTEXT", err_text);
else :
cLog.setNull("sERRTEXT",Types.VARCHAR);
cLog.execute();
cLog.close();
def print_download_process(l1, l2):
'''
FUNC FOR PRINT DOWNLOAD PERCENTS
'''
global lastPercent;
currentPercent = (l1*100)/l2;
if(lastPercent < currentPercent):
print('='*currentPercent);
print('\n current = '+str(l1))
print('\n target = ' +str(l2))
lastPercent = currentPercent;
def decompress_file(archived_file, unarchived_file):
'''
FUNC TO DECOMPRESS BZIP2 ARCHIVE
'''
ins_log("Decompressing...", str(archived_file));
try:
gzis = BZip2CompressorInputStream(FileInputStream(archived_file));
Files.copy(gzis, Paths.get(unarchived_file), StandardCopyOption.REPLACE_EXISTING);
except Exception:
ins_log('Decompressing error', str(Exception));
ins_log("File Decompressed!", str(unarchived_file));
def proxy_authenticator():
'''
FUNC FOR PROXY THIS AUTH.
'''
global proxy_user, proxy_pass;
credential = Credentials.basic(proxy_user, proxy_pass);
return Response.request().newBuilder().header("Proxy-Authorization", credential).build();
def download_file():
'''
FUNC FOR DOWNLOADING DATA FROM MVD.RF WEBSITE
'''
global buffer_size, downloaded;
ins_log('Create proxy settings', 'using '+str(ODIAgent));
if ODIAgent == 'Internal':
proxy_address = TEST_FILE_DOWNLOADS.ProdProxyHost;
proxy_port = TEST_FILE_DOWNLOADS.ProdProxyPort;
proxy_user = 'lukhnevsn';
proxy_passe = "70320DB646F3C6740262E9224E8A88C7";
proxy_domain = "BANKEXP";
proxy_pass = cryptor.decrypt(proxy_passe);
else:
proxy_address = FILE_DOWNLOADS.ProdProxyHost;
proxy_port = FILE_DOWNLOADS.ProdProxyPort;
proxy_user = "ODI_USER";
proxy_passe = "32A47DEE17B2F967BA6094BB609ABF8E";
proxy_domain = "BANKEXP";
proxy_pass = cryptor.decrypt(PROXY_PASSE);
ins_log("Downloading...", url);
builder = OkHttpClient.Builder(); #builder.followRedirects(False).followSslRedirects(False);
builder.connectTimeout(5, TimeUnit.MINUTES).writeTimeout(5, TimeUnit.MINUTES).readTimeout(5, TimeUnit.MINUTES);
httpClient = builder.proxy(Proxy( Proxy.Type.HTTP, InetSocketAddress(proxy_address, proxy_port))).proxyAuthenticator(proxy_authenticator).build();
call = httpClient.newCall(Request.Builder().url(url).get().build()); #//Call to server
response = call.execute(); #//
ins_log('Call to web server', str(response));
#print(response.code())
if (response.code() == 200): #//Check Response code
inputStream = None;
outputStream = None;
target = response.body().contentLength();
try:
inputStream = response.body().byteStream(); #//Get stream of bytes
buffer = zeros(buffer_size, 'b'); #//Creating buffer bytes(1024*4) #bytearray(4096)
outputStream = FileOutputStream(File(archived_file));
print_download_process(0, target);
while (downloaded < target) :
readed = inputStream.read(buffer);
if (readed == -1):
break;
else:
outputStream.write(buffer, 0, readed); #//write buff
downloaded += readed;
print_download_process(downloaded, target);
except Exception:
ins_log("Downloading Error", str(Exception));
finally:
if (inputStream != None):
inputStream.close();
elif(outputStream != None):
outputStream.close();
ins_log("File downloaded!", str(url) + ' filename:'+str(archived_file));
#print("File downloaded! "+ str( url));
def insert_file_data_to_db_batch():
'''
FUNC FOR DATA INSERTING INTO DATABASE
'''
ins_log("Adding data to DB...", 'Using JDBC from File');
global conn, unarchived_file, lnNum, totalRecords, batch_size;
conn.setSchema(s_schema);
truncate_table();
conn.setAutoCommit(False);
#jdbc_insert_sql = 'insert into dim_invalid_passports (pass_serial, pass_no, valid_to_dttm) values (?,?,?)';
jdbc_insert_sql = 'insert into dim_invalid_passports (pass_serial, pass_no, sys_actual_flg, sys_deleted_flg, valid_from_dttm, valid_to_dttm, sys_mod_by) values (?, ?, ?, ?, ?, ?, ? )';
#print(jdbc_insert_sql);
sql_statement = conn.prepareStatement(jdbc_insert_sql);
reader = CSVReader(FileReader(unarchived_file));#/* Read CSV file in OpenCSV */
nextLine = reader.readNext();
while reader.readNext() != None:
lnNum+=1;
sql_statement.setString(1, replace_str(reader.readNext()[0]));
sql_statement.setString(2, replace_str(reader.readNext()[1]));
sql_statement.setInt(3, 1);
sql_statement.setInt(4, 0);
sql_statement.setTimestamp(5, Timestamp(System.currentTimeMillis()));
sql_statement.setString(6, "01.01.2400");
sql_statement.setString(7, "ODI_USER");
sql_statement.addBatch();
if lnNum%batch_size==0 or reader.readNext()==None:
sql_statement.executeBatch();
#print(sql_statement.executeBatch());
conn.commit();
sql_statement.close();
ins_log('File inserted, '+str(lnNum)+" rows added;", str(jdbc_insert_sql) + ' batch_size = '+str(batch_size));
conn.close(); #//Close connection to DB
def do_it():
'''
EASY CALL TO OUR PROCESS
'''
ins_log('Begin', None);
download_file();
decompress_file(archived_file, unarchived_file);
insert_file_data_to_db_batch();
ins_log('Done', None);
conn.close();
#main
##############################################
do_it();
| [
2,
12,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
220,
198,
7061,
6,
198,
41972,
319,
2310,
9130,
13130,
220,
198,
198,
31,
9800,
25,
300,
2724,
71,
710,
14259,
77,
198,
7061,
6,
628,
198,
198,
2,
11748,
10392,
198,
29113,
7804,
4242,
2235,
198,
198,
6738,
20129,
13,
952,
1330,
8792,
1068,
33634,
837,
8979,
33634,
11,
24418,
16922,
26,
198,
6738,
20129,
13,
25410,
1330,
19141,
1144,
48682,
11,
32048,
11,
32103,
13511,
11,
50,
48,
2538,
87,
4516,
11,
48682,
11,
31431,
11,
25414,
7248,
26,
198,
6738,
20129,
13,
3262,
1330,
38027,
11,
554,
316,
39105,
20231,
26,
198,
6738,
12876,
4023,
18,
1330,
4889,
11,
6762,
43481,
11792,
11,
19390,
11,
18261,
26,
198,
6738,
12876,
4023,
18,
13,
18690,
43481,
11792,
1330,
649,
32875,
26,
198,
6738,
12876,
4023,
18,
13,
18453,
1330,
649,
32875,
355,
35869,
26,
198,
6738,
8745,
13,
43073,
13,
4023,
13,
23928,
13,
16366,
1330,
14392,
34,
445,
14817,
29495,
11,
13872,
540,
43481,
11792,
11,
367,
29281,
2601,
2334,
26,
198,
6738,
8745,
13,
43073,
13,
4023,
1330,
220,
367,
29281,
32398,
11,
43481,
17932,
26,
198,
6738,
8745,
13,
43073,
13,
4023,
13,
18439,
1330,
26828,
43642,
11,
399,
4825,
445,
14817,
26,
198,
6738,
17379,
2433,
1330,
1976,
27498,
26,
220,
198,
6738,
35851,
13,
785,
13,
26327,
8189,
13,
9654,
40664,
1330,
44189,
33634,
26,
220,
198,
6738,
20129,
13,
17204,
13,
10100,
1330,
220,
4129,
11,
6330,
26,
198,
198,
2,
11748,
8745,
13,
43073,
13,
9503,
684,
13,
85,
9501,
17,
13,
22602,
13,
23919,
273,
355,
15126,
273,
26,
198,
2,
11748,
8745,
13,
43073,
13,
9503,
684,
13,
85,
9501,
17,
13,
22602,
13,
23919,
273,
22810,
355,
15126,
273,
22810,
26,
198,
198,
11748,
12876,
4023,
18,
13,
34,
445,
14817,
355,
327,
445,
14817,
26,
198,
11748,
20129,
13,
952,
13,
8979,
355,
9220,
26,
198,
11748,
20129,
13,
952,
13,
8979,
26410,
12124,
355,
9220,
26410,
12124,
26,
198,
11748,
20129,
13,
952,
13,
20560,
12124,
33634,
355,
23412,
12124,
33634,
26,
198,
11748,
20129,
13,
952,
13,
8979,
20560,
12124,
355,
9220,
20560,
12124,
26,
198,
11748,
20129,
13,
25410,
13,
23004,
7248,
26,
198,
11748,
8745,
13,
43073,
13,
9503,
684,
13,
5589,
601,
13,
5589,
601,
669,
13,
65,
13344,
17,
13,
33,
41729,
17,
7293,
44292,
20560,
12124,
355,
347,
41729,
17,
7293,
44292,
20560,
12124,
26,
198,
11748,
20129,
13,
77,
952,
13,
7753,
13,
25876,
355,
13283,
26,
198,
11748,
20129,
13,
77,
952,
13,
7753,
13,
15235,
82,
355,
10644,
82,
26,
198,
11748,
20129,
13,
77,
952,
13,
7753,
13,
23615,
29881,
19722,
355,
8997,
29881,
19722,
26,
198,
11748,
20129,
13,
22602,
13,
1102,
14421,
13,
7575,
26453,
355,
3862,
26453,
26,
198,
11748,
20129,
13,
17204,
26,
198,
11748,
8745,
13,
43073,
13,
4023,
13,
16366,
13,
11250,
13,
18453,
16934,
355,
19390,
16934,
26,
198,
11748,
8745,
13,
43073,
13,
4023,
13,
16366,
13,
24396,
82,
13,
26125,
540,
43481,
31077,
355,
13872,
540,
43481,
31077,
26,
198,
11748,
8745,
13,
43073,
13,
4023,
13,
16366,
13,
24396,
82,
13,
43481,
3855,
355,
367,
29281,
3855,
26,
198,
11748,
20129,
13,
25410,
13,
14967,
27823,
355,
5045,
27823,
26,
220,
198,
11748,
20129,
13,
17204,
13,
11964,
355,
4482,
26,
220,
198,
11748,
20129,
13,
25410,
13,
14967,
27823,
355,
5045,
27823,
26,
628,
628,
198,
198,
2,
9979,
1187,
198,
29113,
7804,
4242,
2235,
198,
198,
998,
1572,
62,
7753,
796,
705,
4868,
62,
1659,
62,
1069,
6474,
62,
6603,
3742,
13,
40664,
13,
65,
89,
17,
17020,
1303,
10379,
3672,
329,
22023,
2393,
198,
403,
998,
1572,
62,
7753,
796,
705,
4868,
62,
1659,
62,
1069,
6474,
62,
6603,
3742,
13,
40664,
17020,
1303,
10379,
3672,
329,
34318,
2790,
2393,
198,
6371,
796,
366,
4023,
1378,
5162,
14761,
13,
76,
20306,
13,
622,
14,
25850,
14,
1069,
6474,
12,
6603,
3742,
14,
4868,
62,
1659,
62,
1069,
6474,
62,
6603,
3742,
13,
40664,
13,
65,
89,
17,
1,
2162,
1303,
6371,
796,
705,
5450,
1378,
87,
77,
438,
65,
16,
397,
17,
64,
15,
64,
13,
87,
77,
438,
65,
16,
64,
413,
13,
87,
77,
438,
79,
16,
1872,
14,
25850,
14,
1069,
6474,
12,
6603,
3742,
14,
4868,
62,
1659,
62,
1069,
6474,
62,
6603,
3742,
13,
40664,
13,
65,
89,
17,
17020,
1303,
6371,
796,
705,
4023,
1378,
36750,
14,
6603,
14,
4868,
62,
1659,
62,
1069,
6474,
62,
6603,
3742,
13,
40664,
13,
8800,
17020,
198,
3727,
3539,
6783,
796,
705,
27,
4,
28,
23130,
8134,
13,
1136,
36044,
7,
366,
4760,
3525,
62,
20608,
1,
1267,
4,
29,
17020,
198,
5799,
62,
23130,
62,
6603,
62,
68,
796,
366,
14529,
1314,
32,
7708,
2998,
22,
7708,
45214,
11012,
20107,
8610,
2425,
35,
20,
14529,
1129,
4339,
8172,
220,
198,
5799,
62,
23130,
62,
6603,
796,
15126,
273,
22810,
13,
1136,
23919,
273,
22446,
12501,
6012,
7,
5799,
62,
23130,
62,
6603,
62,
68,
1776,
198,
37043,
796,
267,
10989,
8134,
13,
1136,
37882,
2749,
32048,
7,
366,
35,
6465,
1,
5619,
198,
82,
62,
15952,
2611,
796,
705,
27,
4,
28,
23130,
8134,
13,
1136,
12360,
7203,
35,
6465,
62,
50,
3398,
27630,
4943,
4,
29,
6,
198,
11487,
62,
3672,
796,
705,
35,
3955,
62,
1268,
23428,
2389,
62,
47,
1921,
4303,
33002,
17020,
198,
43501,
62,
7857,
796,
5323,
830,
26,
1303,
43501,
329,
19319,
198,
22252,
62,
7857,
796,
28119,
9,
23,
26,
1303,
22252,
329,
3555,
422,
3992,
198,
2902,
14578,
796,
657,
26,
1303,
16794,
1500,
198,
18755,
33111,
796,
15,
26,
1303,
16794,
1500,
198,
12957,
31905,
796,
532,
16,
26,
1303,
16794,
1500,
198,
23350,
6690,
3669,
28,
657,
26,
1303,
16794,
1500,
628,
198,
2,
12543,
2733,
198,
29113,
7804,
4242,
2235,
628,
198,
198,
4299,
1035,
62,
6404,
7,
5219,
11,
11454,
62,
5239,
8,
1058,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
3537,
23333,
16309,
21965,
4093,
7597,
1546,
41605,
38,
2751,
29397,
34,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
3298,
48260,
26,
198,
220,
220,
220,
48260,
13,
2617,
27054,
2611,
7,
82,
62,
15952,
2611,
1776,
198,
220,
220,
220,
269,
11187,
796,
48260,
13,
46012,
533,
14134,
7203,
90,
13345,
350,
62,
20913,
62,
25294,
7,
35,
3955,
62,
1268,
23428,
2389,
62,
47,
1921,
4303,
33002,
11,
21747,
10091,
92,
15341,
198,
220,
220,
220,
269,
11187,
13,
2617,
10100,
7203,
82,
44724,
1600,
5219,
1776,
198,
220,
220,
220,
611,
357,
8056,
62,
5239,
14512,
6045,
8,
1058,
198,
220,
220,
220,
220,
220,
220,
220,
269,
11187,
13,
2617,
10100,
7203,
82,
1137,
14181,
13918,
1600,
11454,
62,
5239,
1776,
198,
220,
220,
220,
2073,
1058,
198,
220,
220,
220,
220,
220,
220,
220,
269,
11187,
13,
2617,
35067,
7203,
82,
1137,
14181,
13918,
1600,
31431,
13,
53,
31315,
1503,
1776,
198,
220,
220,
220,
269,
11187,
13,
41049,
9783,
198,
220,
220,
220,
269,
11187,
13,
19836,
9783,
198,
220,
220,
220,
220,
198,
4299,
3601,
62,
15002,
62,
14681,
7,
75,
16,
11,
300,
17,
2599,
220,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
29397,
34,
7473,
4810,
12394,
30320,
35613,
19878,
34,
15365,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
3298,
938,
31905,
26,
198,
220,
220,
220,
1459,
31905,
796,
357,
75,
16,
9,
3064,
20679,
75,
17,
26,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
611,
7,
12957,
31905,
1279,
1459,
31905,
2599,
220,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
11639,
9,
14421,
31905,
1776,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
59,
77,
1459,
796,
705,
10,
2536,
7,
75,
16,
4008,
220,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
59,
77,
2496,
796,
705,
1343,
2536,
7,
75,
17,
4008,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
938,
31905,
796,
1459,
31905,
26,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
4299,
38237,
601,
62,
7753,
7,
998,
1572,
62,
7753,
11,
555,
998,
1572,
62,
7753,
2599,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
29397,
34,
5390,
27196,
2662,
32761,
347,
57,
4061,
17,
5923,
3398,
9306,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
1035,
62,
6404,
7203,
10707,
3361,
11697,
9313,
11,
965,
7,
998,
1572,
62,
7753,
18125,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
308,
89,
271,
796,
347,
41729,
17,
7293,
44292,
20560,
12124,
7,
8979,
20560,
12124,
7,
998,
1572,
62,
7753,
18125,
198,
220,
220,
220,
220,
220,
220,
220,
13283,
13,
30073,
7,
34586,
271,
11,
10644,
82,
13,
1136,
7,
403,
998,
1572,
62,
7753,
828,
8997,
29881,
19722,
13,
2200,
6489,
11598,
62,
6369,
8808,
2751,
1776,
198,
220,
220,
220,
2845,
35528,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1035,
62,
6404,
10786,
10707,
3361,
11697,
4049,
3256,
965,
7,
16922,
18125,
198,
220,
220,
220,
1035,
62,
6404,
7203,
8979,
4280,
3361,
2790,
40754,
965,
7,
403,
998,
1572,
62,
7753,
18125,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
4299,
15741,
62,
41299,
26407,
33529,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
29397,
34,
7473,
21965,
34278,
12680,
37195,
13,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
3298,
15741,
62,
7220,
11,
15741,
62,
6603,
26,
198,
220,
220,
220,
49920,
796,
327,
445,
14817,
13,
35487,
7,
36436,
62,
7220,
11,
15741,
62,
6603,
1776,
198,
220,
220,
220,
1441,
18261,
13,
25927,
22446,
3605,
32875,
22446,
25677,
7203,
44148,
12,
13838,
1634,
1600,
49920,
737,
11249,
9783,
220,
220,
220,
220,
628,
220,
220,
220,
220,
220,
220,
220,
198,
4299,
4321,
62,
7753,
33529,
220,
220,
220,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
29397,
34,
7473,
30320,
35613,
2751,
42865,
16034,
337,
8898,
13,
32754,
12887,
4462,
12709,
198,
220,
220,
220,
705,
7061,
220,
220,
198,
220,
220,
220,
3298,
11876,
62,
7857,
11,
15680,
26,
198,
220,
220,
220,
1035,
62,
6404,
10786,
16447,
15741,
6460,
3256,
705,
3500,
705,
10,
2536,
7,
3727,
3539,
6783,
18125,
198,
220,
220,
220,
611,
31245,
3539,
6783,
6624,
705,
37693,
10354,
198,
220,
220,
220,
220,
220,
220,
220,
15741,
62,
21975,
796,
43001,
62,
25664,
62,
41925,
35613,
50,
13,
2964,
67,
44148,
17932,
26,
198,
220,
220,
220,
220,
220,
220,
220,
15741,
62,
634,
220,
220,
220,
796,
43001,
62,
25664,
62,
41925,
35613,
50,
13,
2964,
67,
44148,
13924,
26,
198,
220,
220,
220,
220,
220,
220,
220,
15741,
62,
7220,
796,
705,
2290,
14636,
710,
14259,
77,
17020,
198,
220,
220,
220,
220,
220,
220,
220,
15741,
62,
79,
21612,
220,
220,
796,
366,
2154,
19504,
11012,
27720,
37,
18,
34,
3134,
1821,
29119,
36,
5892,
1731,
36,
23,
32,
3459,
34,
22,
8172,
220,
198,
220,
220,
220,
220,
220,
220,
220,
15741,
62,
27830,
220,
796,
366,
33,
15154,
49864,
8172,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
15741,
62,
6603,
220,
220,
220,
796,
8194,
273,
13,
12501,
6012,
7,
36436,
62,
79,
21612,
1776,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
15741,
62,
21975,
796,
45811,
62,
41925,
35613,
50,
13,
2964,
67,
44148,
17932,
26,
198,
220,
220,
220,
220,
220,
220,
220,
15741,
62,
634,
220,
220,
220,
796,
45811,
62,
41925,
35613,
50,
13,
2964,
67,
44148,
13924,
26,
198,
220,
220,
220,
220,
220,
220,
220,
15741,
62,
7220,
220,
220,
220,
796,
366,
3727,
40,
62,
29904,
8172,
198,
220,
220,
220,
220,
220,
220,
220,
15741,
62,
79,
21612,
220,
220,
796,
366,
2624,
32,
2857,
35,
6500,
1558,
33,
17,
37,
24,
3134,
4339,
1899,
5824,
15199,
31751,
6242,
37,
23,
36,
8172,
220,
198,
220,
220,
220,
220,
220,
220,
220,
15741,
62,
27830,
220,
796,
366,
33,
15154,
49864,
8172,
198,
220,
220,
220,
220,
220,
220,
220,
15741,
62,
6603,
220,
220,
220,
796,
8194,
273,
13,
12501,
6012,
7,
31190,
34278,
62,
47,
1921,
5188,
1776,
198,
220,
220,
220,
1035,
62,
6404,
7203,
10002,
278,
9313,
11,
19016,
1776,
220,
198,
220,
220,
220,
27098,
796,
6762,
43481,
11792,
13,
32875,
9783,
220,
220,
220,
1303,
38272,
13,
27780,
7738,
1060,
82,
7,
25101,
737,
27780,
50,
6649,
7738,
1060,
82,
7,
25101,
1776,
198,
220,
220,
220,
27098,
13,
8443,
48031,
7,
20,
11,
3862,
26453,
13,
23678,
3843,
1546,
737,
13564,
48031,
7,
20,
11,
3862,
26453,
13,
23678,
3843,
1546,
737,
961,
48031,
7,
20,
11,
3862,
26453,
13,
23678,
3843,
1546,
1776,
220,
198,
220,
220,
220,
2638,
11792,
796,
27098,
13,
36436,
7,
44148,
7,
38027,
13,
6030,
13,
40717,
11,
554,
316,
39105,
20231,
7,
36436,
62,
21975,
11,
15741,
62,
634,
4008,
737,
36436,
47649,
26407,
7,
36436,
62,
41299,
26407,
737,
11249,
9783,
198,
220,
220,
220,
869,
796,
2638,
11792,
13,
3605,
14134,
7,
18453,
13,
32875,
22446,
6371,
7,
6371,
737,
1136,
22446,
11249,
35430,
1303,
1003,
14134,
284,
4382,
198,
220,
220,
220,
2882,
796,
869,
13,
41049,
9783,
1303,
1003,
198,
220,
220,
220,
1035,
62,
6404,
10786,
14134,
284,
3992,
4382,
3256,
965,
7,
26209,
18125,
198,
220,
220,
220,
1303,
4798,
7,
26209,
13,
8189,
28955,
198,
220,
220,
220,
611,
357,
26209,
13,
8189,
3419,
6624,
939,
2599,
220,
1303,
1003,
9787,
18261,
2438,
198,
220,
220,
220,
220,
220,
220,
220,
5128,
12124,
796,
6045,
26,
198,
220,
220,
220,
220,
220,
220,
220,
5072,
12124,
796,
6045,
26,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
2496,
796,
2882,
13,
2618,
22446,
11299,
24539,
9783,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5128,
12124,
796,
2882,
13,
2618,
22446,
26327,
12124,
9783,
1303,
1003,
3855,
4269,
286,
9881,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
11876,
796,
220,
1976,
27498,
7,
22252,
62,
7857,
11,
705,
65,
24036,
1303,
1003,
32071,
11876,
9881,
7,
35500,
9,
19,
8,
220,
1303,
1525,
83,
451,
2433,
7,
1821,
4846,
8,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5072,
12124,
796,
220,
9220,
26410,
12124,
7,
8979,
7,
998,
1572,
62,
7753,
18125,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
62,
15002,
62,
14681,
7,
15,
11,
2496,
1776,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
981,
357,
2902,
14578,
1279,
2496,
8,
1058,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1100,
276,
796,
5128,
12124,
13,
961,
7,
22252,
1776,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
357,
961,
276,
6624,
532,
16,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2270,
26,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5072,
12124,
13,
13564,
7,
22252,
11,
657,
11,
1100,
276,
1776,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
1003,
13564,
6940,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15680,
15853,
1100,
276,
26,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
62,
15002,
62,
14681,
7,
2902,
14578,
11,
2496,
1776,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
2845,
35528,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1035,
62,
6404,
7203,
10002,
278,
13047,
1600,
965,
7,
16922,
18125,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
3443,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
357,
15414,
12124,
14512,
6045,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5128,
12124,
13,
19836,
9783,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
7,
22915,
12124,
14512,
6045,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5072,
12124,
13,
19836,
9783,
220,
220,
198,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1035,
62,
6404,
7203,
8979,
15680,
40754,
965,
7,
6371,
8,
1343,
705,
29472,
32105,
10,
2536,
7,
998,
1572,
62,
7753,
18125,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
4798,
7203,
8979,
15680,
0,
43825,
965,
7,
19016,
18125,
628,
220,
220,
220,
220,
220,
220,
220,
220,
198,
4299,
7550,
62,
7753,
62,
7890,
62,
1462,
62,
9945,
62,
43501,
33529,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
29397,
34,
7473,
42865,
29194,
17395,
2751,
39319,
360,
1404,
6242,
11159,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
1035,
62,
6404,
7203,
32901,
1366,
284,
20137,
9313,
11,
705,
12814,
28591,
2749,
422,
9220,
24036,
220,
220,
220,
220,
198,
220,
220,
220,
3298,
48260,
11,
555,
998,
1572,
62,
7753,
11,
300,
77,
33111,
11,
2472,
6690,
3669,
11,
15458,
62,
7857,
26,
198,
220,
220,
220,
48260,
13,
2617,
27054,
2611,
7,
82,
62,
15952,
2611,
1776,
198,
220,
220,
220,
40122,
378,
62,
11487,
9783,
198,
220,
220,
220,
48260,
13,
2617,
27722,
6935,
270,
7,
25101,
1776,
220,
198,
220,
220,
220,
1303,
73,
9945,
66,
62,
28463,
62,
25410,
796,
705,
28463,
656,
5391,
62,
259,
12102,
62,
6603,
3742,
357,
6603,
62,
46911,
11,
1208,
62,
3919,
11,
4938,
62,
1462,
62,
67,
926,
76,
8,
3815,
32843,
21747,
10091,
17020,
198,
220,
220,
220,
474,
9945,
66,
62,
28463,
62,
25410,
220,
796,
705,
28463,
656,
5391,
62,
259,
12102,
62,
6603,
3742,
357,
6603,
62,
46911,
11,
1208,
62,
3919,
11,
25064,
62,
50039,
62,
2704,
70,
11,
25064,
62,
2934,
33342,
62,
2704,
70,
11,
4938,
62,
6738,
62,
67,
926,
76,
11,
220,
4938,
62,
1462,
62,
67,
926,
76,
11,
25064,
62,
4666,
62,
1525,
8,
3815,
32843,
5633,
11,
5633,
11,
5633,
11,
5633,
11,
5633,
11,
5633,
1267,
17020,
198,
220,
220,
220,
1303,
4798,
7,
73,
9945,
66,
62,
28463,
62,
25410,
1776,
198,
220,
220,
220,
44161,
62,
26090,
796,
48260,
13,
46012,
533,
48682,
7,
73,
9945,
66,
62,
28463,
62,
25410,
1776,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
9173,
796,
44189,
33634,
7,
8979,
33634,
7,
403,
998,
1572,
62,
7753,
18125,
2,
15211,
4149,
44189,
2393,
287,
4946,
7902,
53,
9466,
198,
220,
220,
220,
1306,
13949,
796,
9173,
13,
961,
10019,
9783,
220,
220,
220,
198,
220,
220,
220,
981,
9173,
13,
961,
10019,
3419,
14512,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
300,
77,
33111,
47932,
16,
26,
198,
220,
220,
220,
220,
220,
220,
220,
44161,
62,
26090,
13,
2617,
10100,
7,
16,
11,
6330,
62,
2536,
7,
46862,
13,
961,
10019,
3419,
58,
15,
12962,
1776,
198,
220,
220,
220,
220,
220,
220,
220,
44161,
62,
26090,
13,
2617,
10100,
7,
17,
11,
6330,
62,
2536,
7,
46862,
13,
961,
10019,
3419,
58,
16,
12962,
1776,
198,
220,
220,
220,
220,
220,
220,
220,
44161,
62,
26090,
13,
2617,
5317,
7,
18,
11,
352,
1776,
198,
220,
220,
220,
220,
220,
220,
220,
44161,
62,
26090,
13,
2617,
5317,
7,
19,
11,
657,
1776,
198,
220,
220,
220,
220,
220,
220,
220,
44161,
62,
26090,
13,
2617,
14967,
27823,
7,
20,
11,
5045,
27823,
7,
11964,
13,
14421,
7575,
22603,
271,
3419,
18125,
198,
220,
220,
220,
220,
220,
220,
220,
44161,
62,
26090,
13,
2617,
10100,
7,
21,
11,
366,
486,
13,
486,
13,
1731,
405,
15341,
198,
220,
220,
220,
220,
220,
220,
220,
44161,
62,
26090,
13,
2617,
10100,
7,
22,
11,
366,
3727,
40,
62,
29904,
15341,
198,
220,
220,
220,
220,
220,
220,
220,
44161,
62,
26090,
13,
2860,
33,
963,
9783,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
611,
300,
77,
33111,
4,
43501,
62,
7857,
855,
15,
393,
9173,
13,
961,
10019,
3419,
855,
14202,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
44161,
62,
26090,
13,
41049,
33,
963,
9783,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
4798,
7,
25410,
62,
26090,
13,
41049,
33,
963,
35430,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
48260,
13,
41509,
9783,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
44161,
62,
26090,
13,
19836,
9783,
198,
220,
220,
220,
1035,
62,
6404,
10786,
8979,
18846,
11,
705,
10,
2536,
7,
18755,
33111,
47762,
1,
15274,
2087,
26,
1600,
965,
7,
73,
9945,
66,
62,
28463,
62,
25410,
8,
1343,
705,
15458,
62,
7857,
796,
705,
10,
2536,
7,
43501,
62,
7857,
18125,
220,
198,
220,
220,
220,
48260,
13,
19836,
9783,
1303,
1003,
26125,
4637,
284,
20137,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
628,
198,
4299,
466,
62,
270,
33529,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
412,
26483,
42815,
5390,
30229,
41755,
7597,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
1035,
62,
6404,
10786,
44140,
3256,
6045,
1776,
198,
220,
220,
220,
4321,
62,
7753,
9783,
198,
220,
220,
220,
38237,
601,
62,
7753,
7,
998,
1572,
62,
7753,
11,
555,
998,
1572,
62,
7753,
1776,
198,
220,
220,
220,
7550,
62,
7753,
62,
7890,
62,
1462,
62,
9945,
62,
43501,
9783,
198,
220,
220,
220,
1035,
62,
6404,
10786,
45677,
3256,
6045,
1776,
198,
220,
220,
220,
48260,
13,
19836,
9783,
628,
198,
2,
12417,
198,
29113,
7804,
4242,
2235,
198,
4598,
62,
270,
9783,
628
] | 2.396858 | 3,883 |
import mock
import pytest
from paasta_tools import tron_tools
from paasta_tools.tron_tools import MASTER_NAMESPACE
from paasta_tools.utils import InvalidInstanceConfig
from paasta_tools.utils import NoConfigurationForServiceError
from paasta_tools.utils import NoDeploymentsAvailable
@mock.patch('service_configuration_lib.read_extra_service_information', autospec=True)
@mock.patch('service_configuration_lib.read_extra_service_information', autospec=True)
@mock.patch('service_configuration_lib._read_yaml_file', autospec=True)
@mock.patch('os.path.abspath', autospec=True)
@mock.patch('paasta_tools.tron_tools.load_tron_yaml', autospec=True)
| [
11748,
15290,
198,
11748,
12972,
9288,
198,
198,
6738,
14187,
40197,
62,
31391,
1330,
491,
261,
62,
31391,
198,
6738,
14187,
40197,
62,
31391,
13,
83,
1313,
62,
31391,
1330,
32337,
5781,
62,
45,
29559,
47,
11598,
198,
6738,
14187,
40197,
62,
31391,
13,
26791,
1330,
17665,
33384,
16934,
198,
6738,
14187,
40197,
62,
31391,
13,
26791,
1330,
1400,
38149,
1890,
16177,
12331,
198,
6738,
14187,
40197,
62,
31391,
13,
26791,
1330,
1400,
49322,
902,
10493,
628,
628,
628,
198,
31,
76,
735,
13,
17147,
10786,
15271,
62,
11250,
3924,
62,
8019,
13,
961,
62,
26086,
62,
15271,
62,
17018,
3256,
44619,
43106,
28,
17821,
8,
628,
198,
31,
76,
735,
13,
17147,
10786,
15271,
62,
11250,
3924,
62,
8019,
13,
961,
62,
26086,
62,
15271,
62,
17018,
3256,
44619,
43106,
28,
17821,
8,
198,
31,
76,
735,
13,
17147,
10786,
15271,
62,
11250,
3924,
62,
8019,
13557,
961,
62,
88,
43695,
62,
7753,
3256,
44619,
43106,
28,
17821,
8,
198,
31,
76,
735,
13,
17147,
10786,
418,
13,
6978,
13,
397,
2777,
776,
3256,
44619,
43106,
28,
17821,
8,
628,
198,
31,
76,
735,
13,
17147,
10786,
8957,
40197,
62,
31391,
13,
83,
1313,
62,
31391,
13,
2220,
62,
83,
1313,
62,
88,
43695,
3256,
44619,
43106,
28,
17821,
8,
198
] | 3.09434 | 212 |
fun=generator()
fun.__next__() | [
201,
198,
201,
198,
12543,
28,
8612,
1352,
3419,
201,
198,
12543,
13,
834,
19545,
834,
3419
] | 2.058824 | 17 |
import matplotlib.pyplot as plt
import numpy as np
# Displays the probability that the current trajectory matches the stored trajectores at every instant in time.
def plot_distribution(dof_names, mean, upper_bound, lower_bound):
"""Plots a given probability distribution.
"""
figures_per_plot = np.min([4, mean.shape[0]])
for index in range(mean.shape[0]):
if(index % figures_per_plot == 0):
fig = plt.figure()
new_plot = plt.subplot(figures_per_plot, 1, (index % figures_per_plot) + 1)
domain = np.linspace(0, 1, mean.shape[1])
new_plot.fill_between(domain, upper_bound[index], lower_bound[index], color = '#ccf5ff')
new_plot.plot(domain, mean[index], color = '#000000')
new_plot.set_title('Trajectory distribution for degree ' + dof_names[index])
fig.tight_layout()
plt.show(block = False)
def plot_trajectory(dof_names, trajectory, observed_trajectory, mean_trajectory = None):
"""Plots a given trajectory.
"""
fig = plt.figure()
plt.plot(trajectory[0], trajectory[1])
plt.plot(observed_trajectory[0], observed_trajectory[1])
if(mean_trajectory is not None):
plt.plot(mean_trajectory[0], mean_trajectory[1])
fig.suptitle('Probable trajectory')
fig = plt.figure()
for index, degree in enumerate(trajectory):
new_plot = plt.subplot(len(trajectory), 1, index + 1)
domain = np.linspace(0, 1, len(trajectory[index]))
new_plot.plot(domain, trajectory[index], label = "Inferred")
domain = np.linspace(0, 1, len(observed_trajectory[index]))
new_plot.plot(domain, observed_trajectory[index], label = "Observed")
if(mean_trajectory is not None):
domain = np.linspace(0, 1, len(mean_trajectory[index]))
new_plot.plot(domain, mean_trajectory[index], label = "Mean")
new_plot.set_title('Trajectory for degree ' + dof_names[index])
new_plot.legend()
plt.show()
def plot_partial_trajectory(trajectory, partial_observed_trajectory, mean_trajectory = None):
"""Plots a trajectory and a partially observed trajectory.
"""
fig = plt.figure()
plt.plot(partial_observed_trajectory[0], partial_observed_trajectory[1], color = "#6ba3ff", label = "Observed", linewidth = 3.0)
plt.plot(trajectory[0], trajectory[1], "--", color = "#ff6a6a", label = "Inferred", linewidth = 2.0)
if(mean_trajectory is not None):
plt.plot(mean_trajectory[0], mean_trajectory[1], color = "#85d87f", label = "Mean")
fig.suptitle('Probable trajectory')
plt.legend()
plt.text(0.01, 0.7, "Observed samples: " + str(partial_observed_trajectory.shape[1]), transform = fig.axes[0].transAxes)
plt.show()
def plot_approximation(dof_names, trajectory, approx_trajectory, approx_trajectory_deriv):
"""Plots a trajectory and its approximation.
"""
domain = np.linspace(0, 1, len(trajectory[0]))
approx_domain = np.linspace(0, 1, len(approx_trajectory[0]))
for dof in range(len(trajectory)):
plt.figure()
new_plot = plt.subplot(3, 1, 1)
new_plot.plot(domain, trajectory[dof])
new_plot.set_title('Original ' + dof_names[dof] + ' Data')
new_plot = plt.subplot(3, 1, 2)
# The trailing [0] is the dimension of the the state. In this case only plot position.
new_plot.plot(approx_domain, approx_trajectory[dof])
new_plot.set_title('Approximated ' + dof_names[dof] + ' Data')
new_plot = plt.subplot(3, 1, 3)
# The trailing [0] is the dimension of the the state. In this case only plot position.
new_plot.plot(approx_domain, approx_trajectory_deriv[dof])
new_plot.set_title('Approximated ' + dof_names[dof] + ' Derivative')
plt.show()
| [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
198,
2,
3167,
26024,
262,
12867,
326,
262,
1459,
22942,
7466,
262,
8574,
20134,
2850,
379,
790,
9113,
287,
640,
13,
198,
4299,
7110,
62,
17080,
3890,
7,
67,
1659,
62,
14933,
11,
1612,
11,
6727,
62,
7784,
11,
2793,
62,
7784,
2599,
198,
220,
220,
220,
37227,
3646,
1747,
257,
1813,
12867,
6082,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
5538,
62,
525,
62,
29487,
796,
45941,
13,
1084,
26933,
19,
11,
1612,
13,
43358,
58,
15,
11907,
8,
628,
220,
220,
220,
329,
6376,
287,
2837,
7,
32604,
13,
43358,
58,
15,
60,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
611,
7,
9630,
4064,
5538,
62,
525,
62,
29487,
6624,
657,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2336,
796,
458,
83,
13,
26875,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
649,
62,
29487,
796,
458,
83,
13,
7266,
29487,
7,
5647,
942,
62,
525,
62,
29487,
11,
352,
11,
357,
9630,
4064,
5538,
62,
525,
62,
29487,
8,
1343,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
7386,
796,
45941,
13,
21602,
10223,
7,
15,
11,
352,
11,
1612,
13,
43358,
58,
16,
12962,
628,
220,
220,
220,
220,
220,
220,
220,
649,
62,
29487,
13,
20797,
62,
23395,
7,
27830,
11,
6727,
62,
7784,
58,
9630,
4357,
2793,
62,
7784,
58,
9630,
4357,
3124,
796,
705,
2,
535,
69,
20,
487,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
649,
62,
29487,
13,
29487,
7,
27830,
11,
1612,
58,
9630,
4357,
3124,
796,
705,
2,
10535,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
649,
62,
29487,
13,
2617,
62,
7839,
10786,
15721,
752,
652,
6082,
329,
4922,
705,
1343,
466,
69,
62,
14933,
58,
9630,
12962,
628,
220,
220,
220,
220,
220,
220,
220,
2336,
13,
33464,
62,
39786,
3419,
628,
220,
220,
220,
458,
83,
13,
12860,
7,
9967,
796,
10352,
8,
198,
198,
4299,
7110,
62,
9535,
752,
652,
7,
67,
1659,
62,
14933,
11,
22942,
11,
6515,
62,
9535,
752,
652,
11,
1612,
62,
9535,
752,
652,
796,
6045,
2599,
198,
220,
220,
220,
37227,
3646,
1747,
257,
1813,
22942,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
2336,
796,
458,
83,
13,
26875,
3419,
628,
220,
220,
220,
458,
83,
13,
29487,
7,
9535,
752,
652,
58,
15,
4357,
22942,
58,
16,
12962,
198,
220,
220,
220,
458,
83,
13,
29487,
7,
672,
45852,
62,
9535,
752,
652,
58,
15,
4357,
6515,
62,
9535,
752,
652,
58,
16,
12962,
198,
220,
220,
220,
611,
7,
32604,
62,
9535,
752,
652,
318,
407,
6045,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
458,
83,
13,
29487,
7,
32604,
62,
9535,
752,
652,
58,
15,
4357,
1612,
62,
9535,
752,
652,
58,
16,
12962,
628,
220,
220,
220,
2336,
13,
2385,
457,
2578,
10786,
2964,
33460,
22942,
11537,
628,
220,
220,
220,
2336,
796,
458,
83,
13,
26875,
3419,
198,
220,
220,
220,
329,
6376,
11,
4922,
287,
27056,
378,
7,
9535,
752,
652,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
649,
62,
29487,
796,
458,
83,
13,
7266,
29487,
7,
11925,
7,
9535,
752,
652,
828,
352,
11,
6376,
1343,
352,
8,
628,
220,
220,
220,
220,
220,
220,
220,
7386,
796,
45941,
13,
21602,
10223,
7,
15,
11,
352,
11,
18896,
7,
9535,
752,
652,
58,
9630,
60,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
649,
62,
29487,
13,
29487,
7,
27830,
11,
22942,
58,
9630,
4357,
6167,
796,
366,
818,
18186,
4943,
628,
220,
220,
220,
220,
220,
220,
220,
7386,
796,
45941,
13,
21602,
10223,
7,
15,
11,
352,
11,
18896,
7,
672,
45852,
62,
9535,
752,
652,
58,
9630,
60,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
649,
62,
29487,
13,
29487,
7,
27830,
11,
6515,
62,
9535,
752,
652,
58,
9630,
4357,
6167,
796,
366,
31310,
8520,
4943,
628,
220,
220,
220,
220,
220,
220,
220,
611,
7,
32604,
62,
9535,
752,
652,
318,
407,
6045,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7386,
796,
45941,
13,
21602,
10223,
7,
15,
11,
352,
11,
18896,
7,
32604,
62,
9535,
752,
652,
58,
9630,
60,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
649,
62,
29487,
13,
29487,
7,
27830,
11,
1612,
62,
9535,
752,
652,
58,
9630,
4357,
6167,
796,
366,
5308,
272,
4943,
628,
220,
220,
220,
220,
220,
220,
220,
649,
62,
29487,
13,
2617,
62,
7839,
10786,
15721,
752,
652,
329,
4922,
705,
1343,
466,
69,
62,
14933,
58,
9630,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
649,
62,
29487,
13,
1455,
437,
3419,
628,
220,
220,
220,
458,
83,
13,
12860,
3419,
198,
198,
4299,
7110,
62,
47172,
62,
9535,
752,
652,
7,
9535,
752,
652,
11,
13027,
62,
672,
45852,
62,
9535,
752,
652,
11,
1612,
62,
9535,
752,
652,
796,
6045,
2599,
198,
220,
220,
220,
37227,
3646,
1747,
257,
22942,
290,
257,
12387,
6515,
22942,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
2336,
796,
458,
83,
13,
26875,
3419,
628,
220,
220,
220,
458,
83,
13,
29487,
7,
47172,
62,
672,
45852,
62,
9535,
752,
652,
58,
15,
4357,
13027,
62,
672,
45852,
62,
9535,
752,
652,
58,
16,
4357,
3124,
796,
25113,
21,
7012,
18,
487,
1600,
6167,
796,
366,
31310,
8520,
1600,
9493,
413,
5649,
796,
513,
13,
15,
8,
198,
220,
220,
220,
458,
83,
13,
29487,
7,
9535,
752,
652,
58,
15,
4357,
22942,
58,
16,
4357,
366,
438,
1600,
3124,
796,
25113,
487,
21,
64,
21,
64,
1600,
6167,
796,
366,
818,
18186,
1600,
9493,
413,
5649,
796,
362,
13,
15,
8,
198,
220,
220,
220,
611,
7,
32604,
62,
9535,
752,
652,
318,
407,
6045,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
458,
83,
13,
29487,
7,
32604,
62,
9535,
752,
652,
58,
15,
4357,
1612,
62,
9535,
752,
652,
58,
16,
4357,
3124,
796,
25113,
5332,
67,
5774,
69,
1600,
6167,
796,
366,
5308,
272,
4943,
628,
220,
220,
220,
2336,
13,
2385,
457,
2578,
10786,
2964,
33460,
22942,
11537,
198,
220,
220,
220,
458,
83,
13,
1455,
437,
3419,
628,
220,
220,
220,
458,
83,
13,
5239,
7,
15,
13,
486,
11,
657,
13,
22,
11,
366,
31310,
8520,
8405,
25,
366,
1343,
965,
7,
47172,
62,
672,
45852,
62,
9535,
752,
652,
13,
43358,
58,
16,
46570,
6121,
796,
2336,
13,
897,
274,
58,
15,
4083,
7645,
31554,
274,
8,
628,
220,
220,
220,
458,
83,
13,
12860,
3419,
198,
198,
4299,
7110,
62,
1324,
13907,
18991,
7,
67,
1659,
62,
14933,
11,
22942,
11,
5561,
62,
9535,
752,
652,
11,
5561,
62,
9535,
752,
652,
62,
1082,
452,
2599,
198,
220,
220,
220,
37227,
3646,
1747,
257,
22942,
290,
663,
40874,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
7386,
796,
45941,
13,
21602,
10223,
7,
15,
11,
352,
11,
18896,
7,
9535,
752,
652,
58,
15,
60,
4008,
198,
220,
220,
220,
5561,
62,
27830,
796,
45941,
13,
21602,
10223,
7,
15,
11,
352,
11,
18896,
7,
1324,
13907,
62,
9535,
752,
652,
58,
15,
60,
4008,
628,
220,
220,
220,
329,
466,
69,
287,
2837,
7,
11925,
7,
9535,
752,
652,
8,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
458,
83,
13,
26875,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
649,
62,
29487,
796,
458,
83,
13,
7266,
29487,
7,
18,
11,
352,
11,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
649,
62,
29487,
13,
29487,
7,
27830,
11,
22942,
58,
67,
1659,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
649,
62,
29487,
13,
2617,
62,
7839,
10786,
20556,
705,
1343,
466,
69,
62,
14933,
58,
67,
1659,
60,
1343,
705,
6060,
11537,
628,
220,
220,
220,
220,
220,
220,
220,
649,
62,
29487,
796,
458,
83,
13,
7266,
29487,
7,
18,
11,
352,
11,
362,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
383,
25462,
685,
15,
60,
318,
262,
15793,
286,
262,
262,
1181,
13,
554,
428,
1339,
691,
7110,
2292,
13,
198,
220,
220,
220,
220,
220,
220,
220,
649,
62,
29487,
13,
29487,
7,
1324,
13907,
62,
27830,
11,
5561,
62,
9535,
752,
652,
58,
67,
1659,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
649,
62,
29487,
13,
2617,
62,
7839,
10786,
4677,
13907,
15655,
705,
1343,
466,
69,
62,
14933,
58,
67,
1659,
60,
1343,
705,
6060,
11537,
628,
220,
220,
220,
220,
220,
220,
220,
649,
62,
29487,
796,
458,
83,
13,
7266,
29487,
7,
18,
11,
352,
11,
513,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
383,
25462,
685,
15,
60,
318,
262,
15793,
286,
262,
262,
1181,
13,
554,
428,
1339,
691,
7110,
2292,
13,
198,
220,
220,
220,
220,
220,
220,
220,
649,
62,
29487,
13,
29487,
7,
1324,
13907,
62,
27830,
11,
5561,
62,
9535,
752,
652,
62,
1082,
452,
58,
67,
1659,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
649,
62,
29487,
13,
2617,
62,
7839,
10786,
4677,
13907,
15655,
705,
1343,
466,
69,
62,
14933,
58,
67,
1659,
60,
1343,
705,
9626,
452,
876,
11537,
628,
220,
220,
220,
458,
83,
13,
12860,
3419,
198
] | 2.414013 | 1,570 |
"""Guarde en lista `naturales` los primeros 100 números naturales (desde el 1)
usando el bucle while
"""
naturales = []
i = 1
while i <= 100:
naturales.append(i)
i += 1
"""Guarde en `acumulado` una lista con el siguiente patrón:
['1','1 2','1 2 3','1 2 3 4','1 2 3 4 5',...,'...47 48 49 50']
Hasta el número 50.
"""
acumulado = []
i = 1
while True:
if i == 1:
acumulado.append(str(i))
else:
acumulado.append(acumulado[i-2] + ' ' + str(i))
i += 1
if i > 50:
break;
"""Guarde en `suma100` el entero de la suma de todos los números entre 1 y 100:
"""
suma100 = 0
for i in range(1, 101):
suma100 += i
"""Guarde en `tabla100` un string con los primeros 10 múltiplos del número 134,
separados por coma, así:
'134,268,...'
"""
tabla100 = ','.join([str(i * 134) for i in range(1, 11)])
"""Guardar en `multiplos3` la cantidad de números que son múltiplos de 3 y
menores o iguales a 300 en la lista `lista1` que se define a continuación (la lista
está ordenada).
"""
lista1 = [12, 15, 20, 27, 32, 39, 42, 48, 55, 66, 75, 82, 89, 91, 93, 105, 123, 132, 150, 180, 201, 203, 231, 250, 260, 267, 300, 304, 310, 312, 321, 326]
multiplos3 = len([i for i in lista1 if (i % 3 == 0) and (i < 300)])
"""Guardar en `regresivo50` una lista con la cuenta regresiva desde el número
50 hasta el 1, así:
[
'50 49 48 47...',
'49 48 47 46...',
...
'5 4 3 2 1',
'4 3 2 1',
'3 2 1',
'2 1',
'1'
]
"""
regresivo50 = []
i = 0
while True:
if i == 0:
regresivo50.insert(i, str(1))
else:
regresivo50.insert(i, str(i + 1) + ' ' + regresivo50[i-1])
i += 1
if i >= 50:
break;
regresivo50.reverse()
"""Invierta la siguiente lista usando el bucle for y guarde el resultado en
`invertido` (sin hacer uso de la función `reversed` ni del método `reverse`)
"""
lista2 = list(range(1, 70, 5))
invertido = [lista2[i] for i in range(len(lista2) - 1, -1, -1)]
"""Guardar en `primos` una lista con todos los números primos desde el 37 al 300
Nota: Un número primo es un número entero que no se puede calcular multiplicando
otros números enteros.
"""
# forma 1
#primos = [i for i in range(37, 301) if ([True for x in range(2, i) if (i % x) == 0].__contains__(True)) == False]
# forma 2
primos = []
for i in range(37, 301):
esPrimo = True
for x in range(2, i):
if (i % x) == 0:
esPrimo = False
break
if esPrimo == True: primos.append(i)
"""Guardar en `fibonacci` una lista con los primeros 60 términos de la serie de
Fibonacci.
Nota: En la serie de Fibonacci, los 2 primeros términos son 0 y 1, y a partir
del segundo cada uno se calcula sumando los dos anteriores términos de la serie.
[0, 1, 1, 2, 3, 5, 8, ...]
"""
fibonacci = []
for i in range(0, 60):
if i == 0:
fibonacci.append(i)
elif i == 1:
fibonacci.append(i)
else:
fibonacci.append(fibonacci[i-1] + fibonacci[i-2])
"""Guardar en `factorial` el factorial de 30
El factorial (símbolo:!) Significa multiplicar todos los números enteros desde
el 1 hasta el número elegido.
Por ejemplo, el factorial de 5 se calcula así:
5! = 5 × 4 × 3 × 2 × 1 = 120
"""
factorial = 1
for i in range(1, 31):
factorial *= i
"""Guarde en lista `pares` los elementos de la siguiente lista que esten
presentes en posiciones pares, pero solo hasta la posición 80.
"""
lista3 = [941, 149, 672, 208, 99, 562, 749, 947, 251, 750, 889, 596, 836, 742, 512, 19, 674, 142, 272, 773, 859, 598, 898, 930, 119, 107, 798, 447, 348, 402, 33, 678, 460, 144, 168, 290, 929, 254, 233, 563, 48, 249, 890, 871, 484, 265, 831, 694, 366, 499, 271, 123, 870, 986, 449, 894, 347, 346, 519, 969, 242, 57, 985, 250, 490, 93, 999, 373, 355, 466, 416, 937, 214, 707, 834, 126, 698, 268, 217, 406, 334, 285, 429, 130, 393, 396, 936, 572, 688, 765, 404, 970, 159, 98, 545, 412, 629, 361, 70, 602]
pares = [lista3[i] for i in range(0, len(lista3[0:81])) if i % 2 == 0]
"""Guarde en lista `cubos` el cubo (potencia elevada a la 3) de los números del
1 al 100.
"""
cubos = [i**3 for i in range(1, 101)]
"""Encuentre la suma de la serie 2 +22 + 222 + 2222 + .. hasta sumar 10 términos
y guardar resultado en variable `suma_2s`
"""
suma_2s = 0
suma = [str('2') * i for i in range(1, 11)]
for x in range(0, len(suma)):
suma_2s += int(suma[x])
"""Guardar en un string llamado `patron` el siguiente patrón llegando a una
cantidad máxima de asteriscos de 30.
*
**
***
****
*****
******
*******
********
*********
********
*******
******
*****
****
***
**
*
"""
items = [str('*') * i for i in range(1, 31)]
items2 = [str('*') * i for i in range(29, 0, -1)]
items.extend(items2)
patron = '\n'.join(items)
| [
198,
37811,
24502,
68,
551,
1351,
64,
4600,
11802,
274,
63,
22346,
2684,
27498,
1802,
299,
21356,
647,
418,
3288,
274,
357,
8906,
2934,
1288,
352,
8,
220,
198,
385,
25440,
1288,
809,
2375,
981,
198,
37811,
198,
198,
11802,
274,
796,
17635,
198,
72,
796,
352,
198,
4514,
1312,
19841,
1802,
25,
198,
220,
3288,
274,
13,
33295,
7,
72,
8,
198,
220,
1312,
15853,
352,
628,
198,
37811,
24502,
68,
551,
4600,
330,
388,
377,
4533,
63,
555,
64,
1351,
64,
369,
1288,
43237,
84,
1153,
68,
1458,
81,
18840,
25,
198,
198,
17816,
16,
41707,
16,
362,
41707,
16,
362,
513,
41707,
16,
362,
513,
604,
41707,
16,
362,
513,
604,
642,
3256,
986,
4032,
986,
2857,
4764,
5125,
2026,
20520,
198,
198,
39,
40197,
1288,
299,
21356,
647,
78,
2026,
13,
198,
37811,
198,
198,
330,
388,
377,
4533,
796,
17635,
198,
72,
796,
352,
198,
4514,
6407,
25,
198,
220,
611,
1312,
6624,
352,
25,
198,
220,
220,
220,
936,
388,
377,
4533,
13,
33295,
7,
2536,
7,
72,
4008,
198,
220,
2073,
25,
198,
220,
220,
220,
936,
388,
377,
4533,
13,
33295,
7,
330,
388,
377,
4533,
58,
72,
12,
17,
60,
1343,
705,
705,
1343,
965,
7,
72,
4008,
198,
220,
1312,
15853,
352,
628,
220,
611,
1312,
1875,
2026,
25,
198,
220,
220,
220,
2270,
26,
198,
198,
37811,
24502,
68,
551,
4600,
82,
7487,
3064,
63,
1288,
920,
3529,
390,
8591,
2160,
64,
390,
284,
37427,
22346,
299,
21356,
647,
418,
920,
260,
352,
331,
1802,
25,
198,
37811,
198,
198,
82,
7487,
3064,
796,
657,
198,
1640,
1312,
287,
2837,
7,
16,
11,
8949,
2599,
198,
220,
2160,
64,
3064,
15853,
1312,
198,
198,
37811,
24502,
68,
551,
4600,
8658,
5031,
3064,
63,
555,
4731,
369,
22346,
2684,
27498,
838,
285,
21356,
2528,
24705,
418,
1619,
299,
21356,
647,
78,
22352,
11,
220,
198,
25512,
22484,
16964,
33658,
11,
355,
8836,
25,
198,
198,
6,
19880,
11,
25022,
42303,
6,
198,
198,
37811,
198,
198,
8658,
5031,
3064,
796,
220,
705,
4032,
13,
22179,
26933,
2536,
7,
72,
1635,
22352,
8,
329,
1312,
287,
2837,
7,
16,
11,
1367,
8,
12962,
198,
198,
37811,
24502,
283,
551,
4600,
47945,
418,
18,
63,
8591,
18548,
32482,
390,
299,
21356,
647,
418,
8358,
3367,
285,
21356,
2528,
24705,
418,
390,
513,
331,
220,
198,
3653,
2850,
267,
45329,
723,
274,
257,
5867,
551,
8591,
1351,
64,
4600,
4868,
64,
16,
63,
8358,
384,
8160,
257,
11143,
32009,
18840,
357,
5031,
1351,
64,
220,
198,
395,
6557,
2760,
268,
4763,
737,
198,
37811,
198,
4868,
64,
16,
796,
685,
1065,
11,
1315,
11,
1160,
11,
2681,
11,
3933,
11,
5014,
11,
5433,
11,
4764,
11,
5996,
11,
7930,
11,
5441,
11,
9415,
11,
9919,
11,
10495,
11,
10261,
11,
13343,
11,
17031,
11,
21761,
11,
6640,
11,
11546,
11,
580,
11,
27408,
11,
34598,
11,
8646,
11,
21148,
11,
37364,
11,
5867,
11,
31672,
11,
28947,
11,
34465,
11,
39595,
11,
40660,
60,
198,
198,
47945,
418,
18,
796,
18896,
26933,
72,
329,
1312,
287,
1351,
64,
16,
611,
357,
72,
4064,
513,
6624,
657,
8,
290,
357,
72,
1279,
5867,
8,
12962,
198,
198,
37811,
24502,
283,
551,
4600,
2301,
411,
23593,
1120,
63,
555,
64,
1351,
64,
369,
8591,
18912,
29188,
842,
411,
12151,
748,
2934,
1288,
299,
21356,
647,
78,
220,
198,
1120,
19338,
64,
1288,
352,
11,
355,
8836,
25,
198,
198,
58,
198,
220,
705,
1120,
5125,
4764,
6298,
986,
3256,
198,
220,
705,
2920,
4764,
6298,
6337,
986,
3256,
198,
220,
2644,
198,
220,
705,
20,
604,
513,
362,
352,
3256,
198,
220,
705,
19,
513,
362,
352,
3256,
198,
220,
705,
18,
362,
352,
3256,
198,
220,
705,
17,
352,
3256,
198,
220,
705,
16,
6,
198,
60,
198,
37811,
198,
198,
2301,
411,
23593,
1120,
796,
17635,
198,
72,
796,
657,
198,
4514,
6407,
25,
198,
220,
611,
1312,
6624,
657,
25,
198,
220,
220,
220,
842,
411,
23593,
1120,
13,
28463,
7,
72,
11,
965,
7,
16,
4008,
198,
220,
2073,
25,
198,
220,
220,
220,
842,
411,
23593,
1120,
13,
28463,
7,
72,
11,
965,
7,
72,
1343,
352,
8,
1343,
705,
705,
1343,
842,
411,
23593,
1120,
58,
72,
12,
16,
12962,
198,
220,
1312,
15853,
352,
198,
220,
220,
198,
220,
611,
1312,
18189,
2026,
25,
198,
220,
220,
220,
2270,
26,
198,
198,
2301,
411,
23593,
1120,
13,
50188,
3419,
628,
198,
37811,
818,
8903,
861,
64,
8591,
43237,
84,
1153,
68,
1351,
64,
514,
25440,
1288,
809,
2375,
329,
331,
4860,
68,
1288,
1255,
4533,
551,
220,
198,
63,
259,
1851,
17305,
63,
357,
31369,
289,
11736,
514,
78,
390,
8591,
1257,
979,
18840,
4600,
260,
690,
276,
63,
37628,
1619,
285,
25125,
24313,
4600,
50188,
63,
8,
198,
37811,
198,
198,
4868,
64,
17,
796,
1351,
7,
9521,
7,
16,
11,
4317,
11,
642,
4008,
198,
259,
1851,
17305,
796,
685,
4868,
64,
17,
58,
72,
60,
329,
1312,
287,
2837,
7,
11925,
7,
4868,
64,
17,
8,
532,
352,
11,
532,
16,
11,
532,
16,
15437,
198,
198,
37811,
24502,
283,
551,
4600,
19795,
418,
63,
555,
64,
1351,
64,
369,
284,
37427,
22346,
299,
21356,
647,
418,
2684,
418,
748,
2934,
1288,
5214,
435,
5867,
198,
3673,
64,
25,
791,
299,
21356,
647,
78,
2684,
78,
1658,
555,
299,
21356,
647,
78,
920,
3529,
8358,
645,
384,
279,
1739,
68,
2386,
10440,
15082,
291,
25440,
220,
198,
313,
4951,
299,
21356,
647,
418,
3802,
418,
13,
198,
37811,
198,
198,
2,
1296,
64,
352,
198,
2,
19795,
418,
796,
685,
72,
329,
1312,
287,
2837,
7,
2718,
11,
25643,
8,
611,
29565,
17821,
329,
2124,
287,
2837,
7,
17,
11,
1312,
8,
611,
357,
72,
4064,
2124,
8,
6624,
657,
4083,
834,
3642,
1299,
834,
7,
17821,
4008,
6624,
10352,
60,
198,
198,
2,
1296,
64,
362,
198,
19795,
418,
796,
17635,
198,
1640,
1312,
287,
2837,
7,
2718,
11,
25643,
2599,
198,
220,
1658,
23828,
78,
796,
6407,
198,
220,
329,
2124,
287,
2837,
7,
17,
11,
1312,
2599,
198,
220,
220,
220,
611,
357,
72,
4064,
2124,
8,
6624,
657,
25,
220,
198,
220,
220,
220,
220,
220,
1658,
23828,
78,
796,
10352,
198,
220,
220,
220,
220,
220,
2270,
198,
220,
611,
1658,
23828,
78,
6624,
6407,
25,
2684,
418,
13,
33295,
7,
72,
8,
198,
198,
37811,
24502,
283,
551,
4600,
69,
571,
261,
44456,
63,
555,
64,
1351,
64,
369,
22346,
2684,
27498,
3126,
256,
42445,
1084,
418,
390,
8591,
1055,
494,
390,
220,
198,
37,
571,
261,
44456,
13,
198,
3673,
64,
25,
2039,
8591,
1055,
494,
390,
41566,
261,
44456,
11,
22346,
362,
2684,
27498,
256,
42445,
1084,
418,
3367,
657,
331,
352,
11,
331,
257,
636,
343,
220,
198,
12381,
384,
70,
41204,
269,
4763,
555,
78,
384,
5204,
64,
2160,
25440,
22346,
23430,
281,
353,
72,
2850,
256,
42445,
1084,
418,
390,
8591,
1055,
494,
13,
198,
198,
58,
15,
11,
352,
11,
352,
11,
362,
11,
513,
11,
642,
11,
807,
11,
2644,
60,
198,
198,
37811,
198,
198,
69,
571,
261,
44456,
796,
17635,
198,
1640,
1312,
287,
2837,
7,
15,
11,
3126,
2599,
198,
220,
611,
1312,
6624,
657,
25,
198,
220,
220,
220,
12900,
261,
44456,
13,
33295,
7,
72,
8,
198,
220,
1288,
361,
1312,
6624,
352,
25,
198,
220,
220,
220,
12900,
261,
44456,
13,
33295,
7,
72,
8,
198,
220,
2073,
25,
198,
220,
220,
220,
12900,
261,
44456,
13,
33295,
7,
69,
571,
261,
44456,
58,
72,
12,
16,
60,
1343,
12900,
261,
44456,
58,
72,
12,
17,
12962,
198,
198,
37811,
24502,
283,
551,
4600,
22584,
5132,
63,
1288,
1109,
5132,
390,
1542,
198,
9527,
1109,
5132,
357,
82,
8836,
2022,
14057,
25,
8133,
5865,
811,
64,
15082,
291,
283,
284,
37427,
22346,
299,
21356,
647,
418,
3802,
418,
748,
2934,
198,
417,
352,
19338,
64,
1288,
299,
21356,
647,
78,
15361,
17305,
13,
198,
198,
47,
273,
304,
73,
18856,
78,
11,
1288,
1109,
5132,
390,
642,
384,
5204,
64,
355,
8836,
25,
198,
198,
20,
0,
796,
642,
13958,
604,
13958,
513,
13958,
362,
13958,
352,
796,
7982,
198,
37811,
198,
198,
22584,
5132,
796,
352,
198,
1640,
1312,
287,
2837,
7,
16,
11,
3261,
2599,
198,
220,
1109,
5132,
1635,
28,
1312,
198,
198,
37811,
24502,
68,
551,
1351,
64,
4600,
79,
3565,
63,
22346,
5002,
418,
390,
8591,
43237,
84,
1153,
68,
1351,
64,
8358,
1556,
268,
220,
198,
25579,
274,
551,
1426,
47430,
274,
279,
3565,
11,
583,
78,
12199,
19338,
64,
8591,
1426,
44070,
18840,
4019,
13,
198,
37811,
198,
198,
4868,
64,
18,
796,
685,
24,
3901,
11,
24041,
11,
718,
4761,
11,
27121,
11,
7388,
11,
642,
5237,
11,
767,
2920,
11,
860,
2857,
11,
34489,
11,
19683,
11,
807,
4531,
11,
642,
4846,
11,
807,
2623,
11,
767,
3682,
11,
22243,
11,
678,
11,
718,
4524,
11,
25181,
11,
38107,
11,
767,
4790,
11,
807,
3270,
11,
642,
4089,
11,
807,
4089,
11,
860,
1270,
11,
15136,
11,
16226,
11,
767,
4089,
11,
604,
2857,
11,
44084,
11,
42622,
11,
4747,
11,
718,
3695,
11,
34091,
11,
20224,
11,
23378,
11,
26481,
11,
860,
1959,
11,
35360,
11,
30435,
11,
642,
5066,
11,
4764,
11,
34620,
11,
807,
3829,
11,
807,
4869,
11,
4764,
19,
11,
32090,
11,
807,
3132,
11,
718,
5824,
11,
44856,
11,
48391,
11,
33797,
11,
17031,
11,
807,
2154,
11,
860,
4521,
11,
604,
2920,
11,
807,
5824,
11,
43292,
11,
44729,
11,
642,
1129,
11,
860,
3388,
11,
34353,
11,
7632,
11,
860,
5332,
11,
8646,
11,
45601,
11,
10261,
11,
36006,
11,
47946,
11,
36561,
11,
604,
2791,
11,
38158,
11,
860,
2718,
11,
28277,
11,
767,
2998,
11,
807,
2682,
11,
19710,
11,
39861,
11,
36678,
11,
24894,
11,
45439,
11,
42819,
11,
33015,
11,
42313,
11,
11323,
11,
5014,
18,
11,
48758,
11,
860,
2623,
11,
642,
4761,
11,
718,
3459,
11,
767,
2996,
11,
32320,
11,
40463,
11,
26422,
11,
9661,
11,
642,
2231,
11,
42215,
11,
718,
1959,
11,
47744,
11,
4317,
11,
718,
2999,
60,
198,
198,
79,
3565,
796,
685,
4868,
64,
18,
58,
72,
60,
329,
1312,
287,
2837,
7,
15,
11,
18896,
7,
4868,
64,
18,
58,
15,
25,
6659,
60,
4008,
611,
1312,
4064,
362,
6624,
657,
60,
198,
198,
37811,
24502,
68,
551,
1351,
64,
4600,
66,
549,
418,
63,
1288,
13617,
78,
357,
13059,
29634,
7662,
4763,
257,
8591,
513,
8,
390,
22346,
299,
21356,
647,
418,
1619,
220,
198,
16,
435,
1802,
13,
220,
198,
37811,
198,
198,
66,
549,
418,
796,
685,
72,
1174,
18,
329,
1312,
287,
2837,
7,
16,
11,
8949,
15437,
198,
198,
37811,
27195,
84,
298,
260,
8591,
2160,
64,
390,
8591,
1055,
494,
362,
1343,
1828,
1343,
27795,
1343,
362,
23148,
1343,
11485,
19338,
64,
2160,
283,
838,
256,
42445,
1084,
418,
220,
198,
88,
4860,
283,
1255,
4533,
551,
7885,
4600,
82,
7487,
62,
17,
82,
63,
220,
198,
37811,
198,
198,
82,
7487,
62,
17,
82,
796,
657,
198,
82,
7487,
796,
685,
2536,
10786,
17,
11537,
1635,
1312,
329,
1312,
287,
2837,
7,
16,
11,
1367,
15437,
198,
198,
1640,
2124,
287,
2837,
7,
15,
11,
18896,
7,
82,
7487,
8,
2599,
198,
220,
2160,
64,
62,
17,
82,
15853,
493,
7,
82,
7487,
58,
87,
12962,
198,
198,
37811,
24502,
283,
551,
555,
4731,
32660,
321,
4533,
4600,
8071,
1313,
63,
1288,
43237,
84,
1153,
68,
1458,
81,
18840,
300,
1455,
25440,
257,
555,
64,
220,
198,
66,
415,
32482,
285,
6557,
87,
8083,
390,
18503,
2304,
418,
390,
1542,
13,
220,
198,
9,
198,
1174,
198,
8162,
198,
2466,
198,
35625,
198,
2466,
1174,
198,
2466,
8162,
198,
4557,
198,
4557,
9,
198,
4557,
198,
2466,
8162,
198,
2466,
1174,
198,
35625,
198,
2466,
198,
8162,
198,
1174,
198,
9,
198,
37811,
198,
198,
23814,
796,
685,
2536,
10786,
9,
11537,
1635,
1312,
329,
1312,
287,
2837,
7,
16,
11,
3261,
15437,
198,
23814,
17,
796,
685,
2536,
10786,
9,
11537,
1635,
1312,
329,
1312,
287,
2837,
7,
1959,
11,
657,
11,
532,
16,
15437,
198,
23814,
13,
2302,
437,
7,
23814,
17,
8,
198,
8071,
1313,
796,
705,
59,
77,
4458,
22179,
7,
23814,
8,
198
] | 2.254758 | 2,049 |
from abc import abstractmethod
from typing import Callable, List, Optional, Type
import redbot.core.commands as commands
from redbot.core.commands import Cog, Command
from .helper_classes import CogABCMeta
| [
6738,
450,
66,
1330,
12531,
24396,
198,
6738,
19720,
1330,
4889,
540,
11,
7343,
11,
32233,
11,
5994,
198,
198,
11748,
2266,
13645,
13,
7295,
13,
9503,
1746,
355,
9729,
198,
6738,
2266,
13645,
13,
7295,
13,
9503,
1746,
1330,
327,
519,
11,
9455,
198,
198,
6738,
764,
2978,
525,
62,
37724,
1330,
327,
519,
24694,
48526,
628,
628,
628,
198
] | 3.508197 | 61 |
# coding:utf-8
"""
354. Russian Doll Envelopes
Hard
You have a number of envelopes with widths and heights given as a pair of integers (w, h). One envelope can fit into another if and only if both the width and height of one envelope is greater than the width and height of the other envelope.
What is the maximum number of envelopes can you Russian doll? (put one inside other)
Note:
Rotation is not allowed.
Example:
Input: [[5,4],[6,4],[6,7],[2,3]]
Output: 3
Explanation: The maximum number of envelopes you can Russian doll is 3 ([2,3] => [5,4] => [6,7]).
"""
# 2020-7-30
envelopesNums = [
[[5,4],[6,4],[6,7],[2,3]],
]
answers = [
3,
]
test = Solution()
for (en, ans) in zip(envelopesNums, answers):
ret = test.maxEnvelopes(en)
print("{}, my answer is {}, true answer is {}".format(en, ret, ans)) | [
2,
19617,
25,
40477,
12,
23,
198,
198,
37811,
198,
32182,
13,
3394,
22209,
2039,
1091,
274,
198,
17309,
198,
198,
1639,
423,
257,
1271,
286,
16441,
274,
351,
9647,
82,
290,
23245,
1813,
355,
257,
5166,
286,
37014,
357,
86,
11,
289,
737,
1881,
22878,
460,
4197,
656,
1194,
611,
290,
691,
611,
1111,
262,
9647,
290,
6001,
286,
530,
22878,
318,
3744,
621,
262,
9647,
290,
6001,
286,
262,
584,
22878,
13,
198,
198,
2061,
318,
262,
5415,
1271,
286,
16441,
274,
460,
345,
3394,
3654,
30,
357,
1996,
530,
2641,
584,
8,
198,
198,
6425,
25,
198,
49,
14221,
318,
407,
3142,
13,
198,
198,
16281,
25,
198,
198,
20560,
25,
16410,
20,
11,
19,
38430,
21,
11,
19,
38430,
21,
11,
22,
38430,
17,
11,
18,
11907,
198,
26410,
25,
513,
220,
198,
3109,
11578,
341,
25,
383,
5415,
1271,
286,
16441,
274,
345,
460,
3394,
3654,
318,
513,
29565,
17,
11,
18,
60,
5218,
685,
20,
11,
19,
60,
5218,
685,
21,
11,
22,
35944,
198,
37811,
198,
198,
2,
12131,
12,
22,
12,
1270,
198,
198,
268,
1091,
274,
45,
5700,
796,
685,
198,
197,
30109,
20,
11,
19,
38430,
21,
11,
19,
38430,
21,
11,
22,
38430,
17,
11,
18,
60,
4357,
198,
60,
198,
198,
504,
86,
364,
796,
685,
198,
197,
18,
11,
198,
60,
198,
198,
9288,
796,
28186,
3419,
198,
1640,
357,
268,
11,
9093,
8,
287,
19974,
7,
268,
1091,
274,
45,
5700,
11,
7429,
2599,
198,
197,
1186,
796,
1332,
13,
9806,
4834,
1091,
274,
7,
268,
8,
198,
197,
4798,
7203,
90,
5512,
616,
3280,
318,
1391,
5512,
2081,
3280,
318,
23884,
1911,
18982,
7,
268,
11,
1005,
11,
9093,
4008
] | 2.859649 | 285 |
from airflow.dags.common import config
from airflow.models import Variable
# Test variables, state and xcom passing values
| [
6738,
45771,
13,
67,
3775,
13,
11321,
1330,
4566,
198,
6738,
45771,
13,
27530,
1330,
35748,
628,
198,
2,
6208,
9633,
11,
1181,
290,
2124,
785,
6427,
3815,
198
] | 4.310345 | 29 |
import json
from typing import Optional
import pulumi_aws as aws
from infra.lambda_ import Lambda, LambdaArgs
from infra.metric_forwarder import MetricForwarder
from infra.network import Network
import pulumi
class QueueDrivenLambda(pulumi.ComponentResource):
""" A lambda function that is triggered by an SQS queue. """
| [
11748,
33918,
198,
6738,
19720,
1330,
32233,
198,
198,
11748,
17472,
12994,
62,
8356,
355,
3253,
82,
198,
6738,
1167,
430,
13,
50033,
62,
1330,
21114,
6814,
11,
21114,
6814,
42035,
198,
6738,
1167,
430,
13,
4164,
1173,
62,
11813,
263,
1330,
3395,
1173,
39746,
263,
198,
6738,
1167,
430,
13,
27349,
1330,
7311,
198,
198,
11748,
17472,
12994,
628,
198,
4871,
4670,
518,
20564,
574,
43,
4131,
6814,
7,
79,
377,
12994,
13,
21950,
26198,
2599,
198,
220,
220,
220,
37227,
317,
37456,
2163,
326,
318,
13973,
416,
281,
49747,
50,
16834,
13,
37227,
198
] | 3.427083 | 96 |
import asyncio
import re
import time
import datetime
import aiohttp
from bs4 import BeautifulSoup
| [
11748,
30351,
952,
198,
11748,
302,
198,
11748,
640,
198,
11748,
4818,
8079,
198,
11748,
257,
952,
4023,
198,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198
] | 3.413793 | 29 |
# This script will scrape all the internships with given url
# and create a CSV sheet out of it.
# Necessary imports
import requests
from bs4 import BeautifulSoup
import pandas as pd
# A dictionary that will initially hold all scraped values
scraped_data = {
'heading': [],
'company': [],
'stipend': [],
'apply_by': [],
'logo': []
}
# First, find out total computer science internships available
url = "https://internshala.com/internships/computer%20science-internship"
response = requests.get(url)
data = response.text
soup = BeautifulSoup(data, 'html.parser')
count_of_internships = int(soup.find("div",
class_="heading_4_6").text.split()[0])
num_of_pages = int((count_of_internships / 40) + 1)
# A loop that will go to each page and will scrape the data
for i in range(1, num_of_pages + 1):
# ------------------- Scraping starts here -------------------------------
response = requests.get(f"{url}/page-{0}".format(i))
print(response.status_code) # Check out response whether its 200 or not
# ........ if response is not 200, exit the script ..........
if response.status_code != 200:
print("Task cannot be completed at the moment!!!")
exit()
data = response.text
soup = BeautifulSoup(data, 'html.parser')
# ------------------- Search for heading of the Internship -------------------
heading_data = soup.find_all("div", class_="heading_4_5 profile")
for heading in heading_data:
scraped_data['heading'].append(heading.text.lstrip('\n'))
# ------------------- Search for company of the Internship -------------------
company_data = soup.find_all("div", class_="company_name")
for name in company_data:
# Cleaning of data before saving it
name = name.text
name = name.lstrip('\n')
name = name.lstrip(' ')
name = name.rstrip('\n')
name = name.rstrip(' ')
scraped_data['company'].append(name)
# # ------------------- Search for location of the Internship -----------------
# location_data = soup.find_all("a", class_="location_link")
# for loc in location_data:
# # Cleaning of data before saving it
# loc = loc.text
# loc = loc.lstrip('\n')
# loc = loc.lstrip(' ')
# loc = loc.rstrip('\n')
# loc = loc.rstrip(' ')
# if loc != 'Work From Home':
# scraped_data['location'].append(loc)
# # ------------------- Search for start date of the Internship ---------------
# start_date_data = soup.find_all("span", class_="start_immediately_desktop")
# for date in start_date_data:
# date = date.text
# date = date.lstrip('\n')
# date = date.lstrip(' ')
# date = date.rstrip('\n')
# date = date.rstrip(' ')
# scraped_data['start_date'].append(date)
# ------------------- Search for stipend of the Internship -------------------
stipend_data = soup.find_all("span", class_="stipend")
for stipend in stipend_data:
stipend = stipend.text
stipend = stipend.lstrip('\n')
stipend = stipend.lstrip(' ')
stipend = stipend.rstrip('\n')
stipend = stipend.rstrip(' ')
scraped_data['stipend'].append(stipend)
# ------------------- Search for apply by date of the Internship -------------
apply_by_data = soup.find_all("div", class_="apply_by")
for apply_date in apply_by_data:
apply_date = apply_date.find("div", class_="item_body").text
apply_date = apply_date.lstrip('\n')
apply_date = apply_date.lstrip(' ')
apply_date = apply_date.rstrip('\n')
apply_date = apply_date.rstrip(' ')
scraped_data['apply_by'].append(apply_date)
# ------------------- Search for logo of the company of the Internship -------
logo_data = soup.find_all("div", class_="internship_logo")
for logo in logo_data:
logo = logo.find("img")
if logo is not None:
logo = logo.get('src')
scraped_data['logo'].append(logo)
# Now convert the obtained dictionary to a CSV file via pandas module
df = pd.DataFrame(scraped_data)
df.to_csv('internships.csv', index=False)
| [
2,
770,
4226,
481,
42778,
477,
262,
1788,
26313,
351,
1813,
19016,
201,
198,
2,
290,
2251,
257,
44189,
9629,
503,
286,
340,
13,
201,
198,
201,
198,
2,
19652,
408,
560,
17944,
201,
198,
11748,
7007,
201,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
201,
198,
11748,
19798,
292,
355,
279,
67,
201,
198,
201,
198,
2,
317,
22155,
326,
481,
7317,
1745,
477,
15881,
276,
3815,
201,
198,
1416,
31951,
62,
7890,
796,
1391,
201,
198,
220,
220,
220,
705,
33878,
10354,
685,
4357,
201,
198,
220,
220,
220,
705,
39722,
10354,
685,
4357,
201,
198,
220,
220,
220,
705,
301,
541,
437,
10354,
685,
4357,
201,
198,
220,
220,
220,
705,
39014,
62,
1525,
10354,
685,
4357,
201,
198,
220,
220,
220,
705,
6404,
78,
10354,
17635,
201,
198,
92,
201,
198,
201,
198,
2,
3274,
11,
1064,
503,
2472,
3644,
3783,
1788,
26313,
1695,
201,
198,
6371,
796,
366,
5450,
1378,
23124,
1477,
6081,
13,
785,
14,
23124,
26313,
14,
33215,
4,
1238,
16801,
12,
23124,
6720,
1,
201,
198,
26209,
796,
7007,
13,
1136,
7,
6371,
8,
201,
198,
7890,
796,
2882,
13,
5239,
201,
198,
82,
10486,
796,
23762,
50,
10486,
7,
7890,
11,
705,
6494,
13,
48610,
11537,
201,
198,
9127,
62,
1659,
62,
23124,
26313,
796,
493,
7,
82,
10486,
13,
19796,
7203,
7146,
1600,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1398,
62,
2625,
33878,
62,
19,
62,
21,
11074,
5239,
13,
35312,
3419,
58,
15,
12962,
201,
198,
201,
198,
22510,
62,
1659,
62,
31126,
796,
493,
19510,
9127,
62,
1659,
62,
23124,
26313,
1220,
2319,
8,
1343,
352,
8,
201,
198,
2,
317,
9052,
326,
481,
467,
284,
1123,
2443,
290,
481,
42778,
262,
1366,
201,
198,
1640,
1312,
287,
2837,
7,
16,
11,
997,
62,
1659,
62,
31126,
1343,
352,
2599,
201,
198,
220,
220,
220,
1303,
34400,
6329,
1446,
2416,
278,
4940,
994,
34400,
24305,
201,
198,
220,
220,
220,
2882,
796,
7007,
13,
1136,
7,
69,
1,
90,
6371,
92,
14,
7700,
12,
90,
15,
92,
1911,
18982,
7,
72,
4008,
201,
198,
220,
220,
220,
3601,
7,
26209,
13,
13376,
62,
8189,
8,
220,
1303,
6822,
503,
2882,
1771,
663,
939,
393,
407,
201,
198,
201,
198,
220,
220,
220,
1303,
20004,
611,
2882,
318,
407,
939,
11,
8420,
262,
4226,
39864,
201,
198,
220,
220,
220,
611,
2882,
13,
13376,
62,
8189,
14512,
939,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
25714,
2314,
307,
5668,
379,
262,
2589,
3228,
2474,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
8420,
3419,
201,
198,
201,
198,
220,
220,
220,
1366,
796,
2882,
13,
5239,
201,
198,
220,
220,
220,
17141,
796,
23762,
50,
10486,
7,
7890,
11,
705,
6494,
13,
48610,
11537,
201,
198,
201,
198,
2,
34400,
6329,
11140,
329,
9087,
286,
262,
2445,
6720,
34400,
6329,
201,
198,
220,
220,
220,
9087,
62,
7890,
796,
17141,
13,
19796,
62,
439,
7203,
7146,
1600,
1398,
62,
2625,
33878,
62,
19,
62,
20,
7034,
4943,
201,
198,
220,
220,
220,
329,
9087,
287,
9087,
62,
7890,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
15881,
276,
62,
7890,
17816,
33878,
6,
4083,
33295,
7,
33878,
13,
5239,
13,
75,
36311,
10786,
59,
77,
6,
4008,
201,
198,
201,
198,
2,
34400,
6329,
11140,
329,
1664,
286,
262,
2445,
6720,
34400,
6329,
201,
198,
220,
220,
220,
1664,
62,
7890,
796,
17141,
13,
19796,
62,
439,
7203,
7146,
1600,
1398,
62,
2625,
39722,
62,
3672,
4943,
201,
198,
220,
220,
220,
329,
1438,
287,
1664,
62,
7890,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
5985,
278,
286,
1366,
878,
8914,
340,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
796,
1438,
13,
5239,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
796,
1438,
13,
75,
36311,
10786,
59,
77,
11537,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
796,
1438,
13,
75,
36311,
10786,
705,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
796,
1438,
13,
81,
36311,
10786,
59,
77,
11537,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
796,
1438,
13,
81,
36311,
10786,
705,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
15881,
276,
62,
7890,
17816,
39722,
6,
4083,
33295,
7,
3672,
8,
201,
198,
201,
198,
2,
1303,
34400,
6329,
11140,
329,
4067,
286,
262,
2445,
6720,
34400,
12,
201,
198,
2,
220,
220,
220,
220,
4067,
62,
7890,
796,
17141,
13,
19796,
62,
439,
7203,
64,
1600,
1398,
62,
2625,
24886,
62,
8726,
4943,
201,
198,
2,
220,
220,
220,
220,
329,
1179,
287,
4067,
62,
7890,
25,
201,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
5985,
278,
286,
1366,
878,
8914,
340,
201,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
1179,
796,
1179,
13,
5239,
201,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
1179,
796,
1179,
13,
75,
36311,
10786,
59,
77,
11537,
201,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
1179,
796,
1179,
13,
75,
36311,
10786,
705,
8,
201,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
1179,
796,
1179,
13,
81,
36311,
10786,
59,
77,
11537,
201,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
1179,
796,
1179,
13,
81,
36311,
10786,
705,
8,
201,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
611,
1179,
14512,
705,
12468,
3574,
5995,
10354,
201,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15881,
276,
62,
7890,
17816,
24886,
6,
4083,
33295,
7,
17946,
8,
201,
198,
201,
198,
2,
1303,
34400,
6329,
11140,
329,
923,
3128,
286,
262,
2445,
6720,
220,
24305,
201,
198,
2,
220,
220,
923,
62,
4475,
62,
7890,
796,
17141,
13,
19796,
62,
439,
7203,
12626,
1600,
1398,
62,
2625,
9688,
62,
320,
23802,
62,
41375,
4943,
201,
198,
2,
220,
220,
220,
220,
329,
3128,
287,
923,
62,
4475,
62,
7890,
25,
201,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
3128,
796,
3128,
13,
5239,
201,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
3128,
796,
3128,
13,
75,
36311,
10786,
59,
77,
11537,
201,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
3128,
796,
3128,
13,
75,
36311,
10786,
705,
8,
201,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
3128,
796,
3128,
13,
81,
36311,
10786,
59,
77,
11537,
201,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
3128,
796,
3128,
13,
81,
36311,
10786,
705,
8,
201,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
15881,
276,
62,
7890,
17816,
9688,
62,
4475,
6,
4083,
33295,
7,
4475,
8,
201,
198,
201,
198,
2,
34400,
6329,
11140,
329,
22111,
437,
286,
262,
2445,
6720,
34400,
6329,
201,
198,
220,
220,
220,
22111,
437,
62,
7890,
796,
17141,
13,
19796,
62,
439,
7203,
12626,
1600,
1398,
62,
2625,
301,
541,
437,
4943,
201,
198,
220,
220,
220,
329,
22111,
437,
287,
22111,
437,
62,
7890,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
22111,
437,
796,
22111,
437,
13,
5239,
201,
198,
220,
220,
220,
220,
220,
220,
220,
22111,
437,
796,
22111,
437,
13,
75,
36311,
10786,
59,
77,
11537,
201,
198,
220,
220,
220,
220,
220,
220,
220,
22111,
437,
796,
22111,
437,
13,
75,
36311,
10786,
705,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
22111,
437,
796,
22111,
437,
13,
81,
36311,
10786,
59,
77,
11537,
201,
198,
220,
220,
220,
220,
220,
220,
220,
22111,
437,
796,
22111,
437,
13,
81,
36311,
10786,
705,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
15881,
276,
62,
7890,
17816,
301,
541,
437,
6,
4083,
33295,
7,
301,
541,
437,
8,
201,
198,
201,
198,
2,
34400,
6329,
11140,
329,
4174,
416,
3128,
286,
262,
2445,
6720,
220,
32501,
201,
198,
220,
220,
220,
4174,
62,
1525,
62,
7890,
796,
17141,
13,
19796,
62,
439,
7203,
7146,
1600,
1398,
62,
2625,
39014,
62,
1525,
4943,
201,
198,
220,
220,
220,
329,
4174,
62,
4475,
287,
4174,
62,
1525,
62,
7890,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
4174,
62,
4475,
796,
4174,
62,
4475,
13,
19796,
7203,
7146,
1600,
1398,
62,
2625,
9186,
62,
2618,
11074,
5239,
201,
198,
220,
220,
220,
220,
220,
220,
220,
4174,
62,
4475,
796,
4174,
62,
4475,
13,
75,
36311,
10786,
59,
77,
11537,
201,
198,
220,
220,
220,
220,
220,
220,
220,
4174,
62,
4475,
796,
4174,
62,
4475,
13,
75,
36311,
10786,
705,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
4174,
62,
4475,
796,
4174,
62,
4475,
13,
81,
36311,
10786,
59,
77,
11537,
201,
198,
220,
220,
220,
220,
220,
220,
220,
4174,
62,
4475,
796,
4174,
62,
4475,
13,
81,
36311,
10786,
705,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
15881,
276,
62,
7890,
17816,
39014,
62,
1525,
6,
4083,
33295,
7,
39014,
62,
4475,
8,
201,
198,
201,
198,
2,
34400,
6329,
11140,
329,
11112,
286,
262,
1664,
286,
262,
2445,
6720,
35656,
201,
198,
220,
220,
220,
11112,
62,
7890,
796,
17141,
13,
19796,
62,
439,
7203,
7146,
1600,
1398,
62,
2625,
23124,
6720,
62,
6404,
78,
4943,
201,
198,
220,
220,
220,
329,
11112,
287,
11112,
62,
7890,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
11112,
796,
11112,
13,
19796,
7203,
9600,
4943,
201,
198,
220,
220,
220,
220,
220,
220,
220,
611,
11112,
318,
407,
6045,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
11112,
796,
11112,
13,
1136,
10786,
10677,
11537,
201,
198,
220,
220,
220,
220,
220,
220,
220,
15881,
276,
62,
7890,
17816,
6404,
78,
6,
4083,
33295,
7,
6404,
78,
8,
201,
198,
201,
198,
2,
2735,
10385,
262,
6492,
22155,
284,
257,
44189,
2393,
2884,
19798,
292,
8265,
201,
198,
7568,
796,
279,
67,
13,
6601,
19778,
7,
1416,
31951,
62,
7890,
8,
201,
198,
7568,
13,
1462,
62,
40664,
10786,
23124,
26313,
13,
40664,
3256,
6376,
28,
25101,
8,
201,
198
] | 2.485566 | 1,732 |
# Date: 24/06/2019
# Author: Callum Bruce
# Earth, Moon example.
# To run, ensure 'de430.bsp' is downloaded to the working directory. See https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/planets/.
import numpy as np
from mayavi import mlab
import datetime
from jplephem.spk import SPK
import pysamss
# Step 1: Setup system
system = pysamss.System('EarthMoon')
system.current.setDatetime(datetime.datetime.utcnow()) # Set current time utc
# Step 1.1: Add Earth and Moon to system
system.current.addCelestialBody(pysamss.CelestialBody('Earth', 5.972e24, 6.371e6))
system.current.addCelestialBody(pysamss.CelestialBody('Moon', 7.348e22, 1.737e6, parent_name='Earth'))
# Step 2: Calculate positions and velocities
time = system.current.getJulianDate()
kernel = SPK.open('de430.bsp')
# Earth
earth_pos, earth_vel = kernel[3,399].compute_and_differentiate(time)
earth_pos *= 1000 # Convert from km -> m
earth_vel /= 86.4 # Convert from km/day -> m/s
# Moon
moon_pos, moon_vel = kernel[3,301].compute_and_differentiate(time)
moon_pos *= 1000 # Convert from km -> m
moon_vel /= 86.4 # Convert from km/day -> m/s
# Step 3: Set positions and velocities
system.current.celestial_bodies['Earth'].setPosition(earth_pos)
system.current.celestial_bodies['Earth'].setVelocity(earth_vel)
system.current.celestial_bodies['Earth'].setAttitudeDot(np.array([0.0, 0.0, np.deg2rad(360 / ((23 * 60 * 60) + (56 * 60) + 4))]))
system.current.celestial_bodies['Earth'].setTexture(pysamss.__file__[:-12] + '/resources/earth.jpg')
system.current.celestial_bodies['Moon'].setPosition(moon_pos)
system.current.celestial_bodies['Moon'].setVelocity(moon_vel)
system.current.celestial_bodies['Moon'].setAttitudeDot(np.array([0.0, 0.0, np.deg2rad(360 / 2358720.0)]))
system.current.celestial_bodies['Moon'].setTexture(pysamss.__file__[:-12] + '/resources/moon.jpg')
# Step 4: Simulate system
system.setDt(60.0)
system.setEndTime(2358720.0)
system.setSaveInterval(100)
system.simulateSystem()
# Step 5: Post processing
system.load('EarthMoon.psm')
fig = pysamss.MainWidget()
fig.loadSystem(system)
fig.showMaximized()
mlab.show() | [
2,
7536,
25,
1987,
14,
3312,
14,
23344,
198,
2,
6434,
25,
4889,
388,
11088,
198,
2,
3668,
11,
6869,
1672,
13,
198,
2,
1675,
1057,
11,
4155,
705,
2934,
31794,
13,
24145,
6,
318,
15680,
284,
262,
1762,
8619,
13,
4091,
3740,
1378,
2616,
361,
13,
73,
489,
13,
77,
15462,
13,
9567,
14,
12984,
14,
2616,
361,
14,
41357,
62,
74,
44930,
14,
2777,
74,
14,
11578,
1039,
11757,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
743,
15820,
1330,
285,
23912,
198,
11748,
4818,
8079,
198,
6738,
474,
1154,
79,
4411,
13,
2777,
74,
1330,
6226,
42,
198,
11748,
279,
893,
321,
824,
198,
198,
2,
5012,
352,
25,
31122,
1080,
198,
10057,
796,
279,
893,
321,
824,
13,
11964,
10786,
22840,
31640,
11537,
198,
10057,
13,
14421,
13,
2617,
27354,
8079,
7,
19608,
8079,
13,
19608,
8079,
13,
315,
66,
2197,
28955,
1303,
5345,
1459,
640,
3384,
66,
198,
2,
5012,
352,
13,
16,
25,
3060,
3668,
290,
6869,
284,
1080,
198,
10057,
13,
14421,
13,
2860,
34,
417,
21711,
25842,
7,
79,
893,
321,
824,
13,
34,
417,
21711,
25842,
10786,
22840,
3256,
642,
13,
24,
4761,
68,
1731,
11,
718,
13,
38056,
68,
21,
4008,
198,
10057,
13,
14421,
13,
2860,
34,
417,
21711,
25842,
7,
79,
893,
321,
824,
13,
34,
417,
21711,
25842,
10786,
31640,
3256,
767,
13,
28978,
68,
1828,
11,
352,
13,
22,
2718,
68,
21,
11,
2560,
62,
3672,
11639,
22840,
6,
4008,
198,
198,
2,
5012,
362,
25,
27131,
378,
6116,
290,
11555,
420,
871,
198,
2435,
796,
1080,
13,
14421,
13,
1136,
16980,
666,
10430,
3419,
198,
33885,
796,
6226,
42,
13,
9654,
10786,
2934,
31794,
13,
24145,
11537,
198,
2,
3668,
198,
16442,
62,
1930,
11,
4534,
62,
626,
796,
9720,
58,
18,
11,
28771,
4083,
5589,
1133,
62,
392,
62,
39799,
9386,
7,
2435,
8,
198,
16442,
62,
1930,
1635,
28,
8576,
1303,
38240,
422,
10571,
4613,
285,
198,
16442,
62,
626,
1220,
28,
9849,
13,
19,
1303,
38240,
422,
10571,
14,
820,
4613,
285,
14,
82,
198,
2,
6869,
198,
22977,
62,
1930,
11,
8824,
62,
626,
796,
9720,
58,
18,
11,
18938,
4083,
5589,
1133,
62,
392,
62,
39799,
9386,
7,
2435,
8,
198,
22977,
62,
1930,
1635,
28,
8576,
1303,
38240,
422,
10571,
4613,
285,
198,
22977,
62,
626,
1220,
28,
9849,
13,
19,
1303,
38240,
422,
10571,
14,
820,
4613,
285,
14,
82,
198,
198,
2,
5012,
513,
25,
5345,
6116,
290,
11555,
420,
871,
198,
10057,
13,
14421,
13,
5276,
21711,
62,
65,
5042,
17816,
22840,
6,
4083,
2617,
26545,
7,
16442,
62,
1930,
8,
198,
10057,
13,
14421,
13,
5276,
21711,
62,
65,
5042,
17816,
22840,
6,
4083,
2617,
46261,
11683,
7,
16442,
62,
626,
8,
198,
10057,
13,
14421,
13,
5276,
21711,
62,
65,
5042,
17816,
22840,
6,
4083,
2617,
8086,
3984,
35,
313,
7,
37659,
13,
18747,
26933,
15,
13,
15,
11,
657,
13,
15,
11,
45941,
13,
13500,
17,
6335,
7,
15277,
1220,
14808,
1954,
1635,
3126,
1635,
3126,
8,
1343,
357,
3980,
1635,
3126,
8,
1343,
604,
4008,
60,
4008,
198,
10057,
13,
14421,
13,
5276,
21711,
62,
65,
5042,
17816,
22840,
6,
4083,
2617,
32742,
7,
79,
893,
321,
824,
13,
834,
7753,
834,
58,
21912,
1065,
60,
1343,
31051,
37540,
14,
16442,
13,
9479,
11537,
198,
10057,
13,
14421,
13,
5276,
21711,
62,
65,
5042,
17816,
31640,
6,
4083,
2617,
26545,
7,
22977,
62,
1930,
8,
198,
10057,
13,
14421,
13,
5276,
21711,
62,
65,
5042,
17816,
31640,
6,
4083,
2617,
46261,
11683,
7,
22977,
62,
626,
8,
198,
10057,
13,
14421,
13,
5276,
21711,
62,
65,
5042,
17816,
31640,
6,
4083,
2617,
8086,
3984,
35,
313,
7,
37659,
13,
18747,
26933,
15,
13,
15,
11,
657,
13,
15,
11,
45941,
13,
13500,
17,
6335,
7,
15277,
1220,
2242,
3365,
23906,
13,
15,
15437,
4008,
198,
10057,
13,
14421,
13,
5276,
21711,
62,
65,
5042,
17816,
31640,
6,
4083,
2617,
32742,
7,
79,
893,
321,
824,
13,
834,
7753,
834,
58,
21912,
1065,
60,
1343,
31051,
37540,
14,
22977,
13,
9479,
11537,
198,
198,
2,
5012,
604,
25,
3184,
5039,
1080,
198,
10057,
13,
2617,
35,
83,
7,
1899,
13,
15,
8,
198,
10057,
13,
2617,
12915,
7575,
7,
1954,
3365,
23906,
13,
15,
8,
198,
10057,
13,
2617,
16928,
9492,
2100,
7,
3064,
8,
198,
10057,
13,
14323,
5039,
11964,
3419,
198,
198,
2,
5012,
642,
25,
2947,
7587,
198,
10057,
13,
2220,
10786,
22840,
31640,
13,
862,
76,
11537,
198,
5647,
796,
279,
893,
321,
824,
13,
13383,
38300,
3419,
198,
5647,
13,
2220,
11964,
7,
10057,
8,
198,
5647,
13,
12860,
11518,
320,
1143,
3419,
198,
4029,
397,
13,
12860,
3419
] | 2.693982 | 781 |
# http://www.codewars.com/kata/vasya-clerk/python
import unittest
import vasya_clerk
| [
2,
2638,
1378,
2503,
13,
19815,
413,
945,
13,
785,
14,
74,
1045,
14,
11017,
3972,
12,
565,
9587,
14,
29412,
198,
198,
11748,
555,
715,
395,
198,
11748,
34439,
3972,
62,
565,
9587,
628
] | 2.485714 | 35 |
from requests import Session
import requests
import os
# NLP_ENGINE_URL = "http://127.0.0.1:5001"
# INTENTS_MANAGMENT_URL = "http://127.0.0.1:5002"
# CONTEXT_MANAGMENT_URL = "http://127.0.0.1:5003"
NLP_ENGINE_URL = os.environ.get('NLP_ENGINE_URL')
INTENTS_MANAGMENT_URL = os.environ.get('INTENTS_MANAGMENT_URL')
CONTEXT_MANAGMENT_URL = os.environ.get('CONTEXT_MANAGMENT_URL')
session = Session()
session.trust_env = False
session.verify = False
session.headers["Accept"] = "application/json"
session.headers["Content-Type"] = "application/json"
def discover_intent(agent, text):
"""
This method connects to the microservice *NLP Engine* in order to retrieve the intents from a raw text.
:param agent: The agent name of the chatbot
:param text: The raw input to discover the intent
:return: The uri of a intent
"""
url = NLP_ENGINE_URL + "/intents"
try:
r = session.post(url, json={"agent": agent, "sentence": text})
if r.status_code == 200:
response = r.json()
if "intent" in response and len(response["intent"]) > 0:
return response["intent"][0]["prediction"]
else:
return None
except requests.exceptions.RequestException as e:
print(e)
return None
def discover_entities(agent, text):
"""
This method connects to the microservice *NLP Engine* in order to retrieve the entities from a raw text.
:param agent: The agent name of the chatbot
:param text: The raw input to discover the intent
:return: A list with the URIS of the entities and type of entities.
"""
url = NLP_ENGINE_URL + "/entities"
try:
r = session.post(url, json={"agent": agent, "sentence": text})
if r.status_code == 200:
response = r.json()
entities = []
if len(response["entities"]) > 0:
for entity in response["entities"]:
entities.append({
"type": entity["entity"],
"value": entity["prediction"],
})
return entities
except requests.exceptions.RequestException as e:
print(e)
return []
def get_requirements(intent):
"""
This service connects to the microservice *Intents Managment* in order to retrieve requirements of an intent
:param intent: The intent from where requirements will be retrieved
:return: A list of URIS of the different entities needed to complete an intent
"""
url = INTENTS_MANAGMENT_URL + "/intent/requires"
try:
r = session.get(url, json={"intent": intent})
if r.status_code == 200:
response = r.json()
if "requires" in response:
return response["requires"]
else:
return None
except requests.exceptions.RequestException as e:
print(e)
return None
def get_options(entity):
"""
This service connects to the microservice *Intents Management* in order to retrieve options of an entity type
:param entity: The entity from where options will be retrieved
:return: A list of options to complete an entity
.. todo:: give a list of entities
"""
url = INTENTS_MANAGMENT_URL + "/entity/options"
try:
# print({"entity": entity})
r = session.get(url, json={"entity": entity})
if r.status_code == 200:
response = r.json()
return response
except requests.exceptions.RequestException as e:
print(e)
return None
def find_in_context(user, entities):
"""
This method looks for information in the conversation thread.
:param user: The id of the user to find information
:param entities: The entities to be found in context.
"""
url = CONTEXT_MANAGMENT_URL + "/context/entities"
try:
r = session.get(url, json={"user": user, "entities": entities})
if r.status_code == 200:
response = r.json()
if "entities" in response:
entities = response["entities"]
return entities
else:
return []
except requests.exceptions.RequestException as e:
print(e)
return []
def get_answer(intent, entities):
"""
This service connects to the microservice *Intents Management* in order to retrieve the answer of an intent.
:param intent: The intent from where answer will be retrieved
:param entities: A list of entities used to retrieve answer
:return: A list of options to complete an entity
"""
url = INTENTS_MANAGMENT_URL + "/intent/answer"
try:
r = session.get(url, json={"intent": intent, "entities": entities})
if r.status_code == 200:
response = r.json()
return response
except requests.exceptions.RequestException as e:
print(e)
def get_agent_data(agent):
"""
This service connects to the microservice *Intents Management* in order to information about and agent
:param agent: A valid agent name
:return: A dict containing agent, a description and the different intents.
"""
url = INTENTS_MANAGMENT_URL + "/agent/info"
try:
r = session.get(url, json={"agent": agent})
if r.status_code == 200:
response = r.json()
return response
except requests.exceptions.RequestException as e:
print(e)
return None
def get_intent_rq(intent, entity):
"""
This service connects to the microservice *Intents Management* in order to get the resolution question of an intent
:param intent: A valid intent
:param entity: A valid entity
:return: A dict containing intent, a entity and the resolution question.
"""
url = INTENTS_MANAGMENT_URL + "/intent/rq"
try:
r = session.get(url, json={"intent": intent, "entity": entity})
if r.status_code == 200:
response = r.json()
return response
except requests.exceptions.RequestException as e:
print(e)
return None
| [
6738,
7007,
1330,
23575,
198,
11748,
7007,
198,
11748,
28686,
198,
198,
2,
399,
19930,
62,
26808,
8881,
62,
21886,
796,
366,
4023,
1378,
16799,
13,
15,
13,
15,
13,
16,
25,
4059,
16,
1,
198,
2,
17828,
15365,
62,
10725,
4760,
10979,
62,
21886,
796,
366,
4023,
1378,
16799,
13,
15,
13,
15,
13,
16,
25,
4059,
17,
1,
198,
2,
22904,
13918,
62,
10725,
4760,
10979,
62,
21886,
796,
366,
4023,
1378,
16799,
13,
15,
13,
15,
13,
16,
25,
4059,
18,
1,
198,
198,
45,
19930,
62,
26808,
8881,
62,
21886,
796,
28686,
13,
268,
2268,
13,
1136,
10786,
45,
19930,
62,
26808,
8881,
62,
21886,
11537,
198,
12394,
15365,
62,
10725,
4760,
10979,
62,
21886,
796,
28686,
13,
268,
2268,
13,
1136,
10786,
12394,
15365,
62,
10725,
4760,
10979,
62,
21886,
11537,
198,
10943,
32541,
62,
10725,
4760,
10979,
62,
21886,
796,
28686,
13,
268,
2268,
13,
1136,
10786,
10943,
32541,
62,
10725,
4760,
10979,
62,
21886,
11537,
198,
198,
29891,
796,
23575,
3419,
198,
29891,
13,
38087,
62,
24330,
796,
10352,
198,
29891,
13,
332,
1958,
796,
10352,
198,
29891,
13,
50145,
14692,
38855,
8973,
796,
366,
31438,
14,
17752,
1,
198,
29891,
13,
50145,
14692,
19746,
12,
6030,
8973,
796,
366,
31438,
14,
17752,
1,
628,
198,
4299,
7073,
62,
48536,
7,
25781,
11,
2420,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
770,
2446,
20417,
284,
262,
4580,
15271,
1635,
45,
19930,
7117,
9,
287,
1502,
284,
19818,
262,
493,
658,
422,
257,
8246,
2420,
13,
628,
220,
220,
220,
1058,
17143,
5797,
25,
383,
5797,
1438,
286,
262,
8537,
13645,
628,
220,
220,
220,
1058,
17143,
2420,
25,
383,
8246,
5128,
284,
7073,
262,
6824,
628,
220,
220,
220,
1058,
7783,
25,
383,
2956,
72,
286,
257,
6824,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
19016,
796,
399,
19930,
62,
26808,
8881,
62,
21886,
1343,
12813,
600,
658,
1,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
374,
796,
6246,
13,
7353,
7,
6371,
11,
33918,
28,
4895,
25781,
1298,
5797,
11,
366,
34086,
594,
1298,
2420,
30072,
198,
220,
220,
220,
220,
220,
220,
220,
611,
374,
13,
13376,
62,
8189,
6624,
939,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2882,
796,
374,
13,
17752,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
366,
48536,
1,
287,
2882,
290,
18896,
7,
26209,
14692,
48536,
8973,
8,
1875,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
2882,
14692,
48536,
1,
7131,
15,
7131,
1,
28764,
2867,
8973,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
6045,
198,
220,
220,
220,
2845,
7007,
13,
1069,
11755,
13,
18453,
16922,
355,
304,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
68,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
6045,
628,
198,
4299,
7073,
62,
298,
871,
7,
25781,
11,
2420,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
770,
2446,
20417,
284,
262,
4580,
15271,
1635,
45,
19930,
7117,
9,
287,
1502,
284,
19818,
262,
12066,
422,
257,
8246,
2420,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
5797,
25,
383,
5797,
1438,
286,
262,
8537,
13645,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
2420,
25,
383,
8246,
5128,
284,
7073,
262,
6824,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
317,
1351,
351,
262,
37902,
1797,
286,
262,
12066,
290,
2099,
286,
12066,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
19016,
796,
399,
19930,
62,
26808,
8881,
62,
21886,
1343,
12813,
298,
871,
1,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
374,
796,
6246,
13,
7353,
7,
6371,
11,
33918,
28,
4895,
25781,
1298,
5797,
11,
366,
34086,
594,
1298,
2420,
30072,
198,
220,
220,
220,
220,
220,
220,
220,
611,
374,
13,
13376,
62,
8189,
6624,
939,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2882,
796,
374,
13,
17752,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12066,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
18896,
7,
26209,
14692,
298,
871,
8973,
8,
1875,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
9312,
287,
2882,
14692,
298,
871,
1,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12066,
13,
33295,
15090,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
4906,
1298,
9312,
14692,
26858,
33116,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
8367,
1298,
9312,
14692,
28764,
2867,
33116,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32092,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
12066,
198,
220,
220,
220,
2845,
7007,
13,
1069,
11755,
13,
18453,
16922,
355,
304,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
68,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
17635,
628,
198,
4299,
651,
62,
8897,
18883,
7,
48536,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
770,
2139,
20417,
284,
262,
4580,
15271,
1635,
5317,
658,
1869,
363,
434,
9,
287,
1502,
284,
19818,
5359,
286,
281,
6824,
628,
220,
220,
220,
1058,
17143,
6824,
25,
383,
6824,
422,
810,
5359,
481,
307,
29517,
628,
220,
220,
220,
1058,
7783,
25,
317,
1351,
286,
37902,
1797,
286,
262,
1180,
12066,
2622,
284,
1844,
281,
6824,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
19016,
796,
17828,
15365,
62,
10725,
4760,
10979,
62,
21886,
1343,
12813,
48536,
14,
47911,
1,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
374,
796,
6246,
13,
1136,
7,
6371,
11,
33918,
28,
4895,
48536,
1298,
6824,
30072,
198,
220,
220,
220,
220,
220,
220,
220,
611,
374,
13,
13376,
62,
8189,
6624,
939,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2882,
796,
374,
13,
17752,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
366,
47911,
1,
287,
2882,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
2882,
14692,
47911,
8973,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
6045,
198,
220,
220,
220,
2845,
7007,
13,
1069,
11755,
13,
18453,
16922,
355,
304,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
68,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
6045,
628,
198,
4299,
651,
62,
25811,
7,
26858,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
770,
2139,
20417,
284,
262,
4580,
15271,
1635,
5317,
658,
8549,
9,
287,
1502,
284,
19818,
3689,
286,
281,
9312,
2099,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
9312,
25,
383,
9312,
422,
810,
3689,
481,
307,
29517,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
317,
1351,
286,
3689,
284,
1844,
281,
9312,
628,
220,
220,
220,
220,
220,
220,
220,
11485,
284,
4598,
3712,
1577,
257,
1351,
286,
12066,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
19016,
796,
17828,
15365,
62,
10725,
4760,
10979,
62,
21886,
1343,
12813,
26858,
14,
25811,
1,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
3601,
7,
4895,
26858,
1298,
9312,
30072,
198,
220,
220,
220,
220,
220,
220,
220,
374,
796,
6246,
13,
1136,
7,
6371,
11,
33918,
28,
4895,
26858,
1298,
9312,
30072,
198,
220,
220,
220,
220,
220,
220,
220,
611,
374,
13,
13376,
62,
8189,
6624,
939,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2882,
796,
374,
13,
17752,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
2882,
628,
220,
220,
220,
2845,
7007,
13,
1069,
11755,
13,
18453,
16922,
355,
304,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
68,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
6045,
628,
198,
4299,
1064,
62,
259,
62,
22866,
7,
7220,
11,
12066,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
770,
2446,
3073,
329,
1321,
287,
262,
5273,
4704,
13,
198,
220,
220,
220,
220,
1058,
17143,
2836,
25,
383,
4686,
286,
262,
2836,
284,
1064,
1321,
628,
220,
220,
220,
220,
1058,
17143,
12066,
25,
383,
12066,
284,
307,
1043,
287,
4732,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
19016,
796,
22904,
13918,
62,
10725,
4760,
10979,
62,
21886,
1343,
12813,
22866,
14,
298,
871,
1,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
374,
796,
6246,
13,
1136,
7,
6371,
11,
33918,
28,
4895,
7220,
1298,
2836,
11,
366,
298,
871,
1298,
12066,
30072,
198,
220,
220,
220,
220,
220,
220,
220,
611,
374,
13,
13376,
62,
8189,
6624,
939,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2882,
796,
374,
13,
17752,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
366,
298,
871,
1,
287,
2882,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12066,
796,
2882,
14692,
298,
871,
8973,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
12066,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
17635,
198,
220,
220,
220,
2845,
7007,
13,
1069,
11755,
13,
18453,
16922,
355,
304,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
68,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
17635,
628,
198,
4299,
651,
62,
41484,
7,
48536,
11,
12066,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
770,
2139,
20417,
284,
262,
4580,
15271,
1635,
5317,
658,
8549,
9,
287,
1502,
284,
19818,
262,
3280,
286,
281,
6824,
13,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
6824,
25,
383,
6824,
422,
810,
3280,
481,
307,
29517,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
12066,
25,
317,
1351,
286,
12066,
973,
284,
19818,
3280,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
317,
1351,
286,
3689,
284,
1844,
281,
9312,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
19016,
796,
17828,
15365,
62,
10725,
4760,
10979,
62,
21886,
1343,
12813,
48536,
14,
41484,
1,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
374,
796,
6246,
13,
1136,
7,
6371,
11,
33918,
28,
4895,
48536,
1298,
6824,
11,
366,
298,
871,
1298,
12066,
30072,
198,
220,
220,
220,
220,
220,
220,
220,
611,
374,
13,
13376,
62,
8189,
6624,
939,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2882,
796,
374,
13,
17752,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
2882,
198,
220,
220,
220,
2845,
7007,
13,
1069,
11755,
13,
18453,
16922,
355,
304,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
68,
8,
628,
198,
4299,
651,
62,
25781,
62,
7890,
7,
25781,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
770,
2139,
20417,
284,
262,
4580,
15271,
1635,
5317,
658,
8549,
9,
287,
1502,
284,
1321,
546,
290,
5797,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
5797,
25,
317,
4938,
5797,
1438,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
317,
8633,
7268,
5797,
11,
257,
6764,
290,
262,
1180,
493,
658,
13,
628,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
19016,
796,
17828,
15365,
62,
10725,
4760,
10979,
62,
21886,
1343,
12813,
25781,
14,
10951,
1,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
374,
796,
6246,
13,
1136,
7,
6371,
11,
33918,
28,
4895,
25781,
1298,
5797,
30072,
198,
220,
220,
220,
220,
220,
220,
220,
611,
374,
13,
13376,
62,
8189,
6624,
939,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2882,
796,
374,
13,
17752,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
2882,
628,
220,
220,
220,
2845,
7007,
13,
1069,
11755,
13,
18453,
16922,
355,
304,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
68,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
6045,
628,
198,
4299,
651,
62,
48536,
62,
81,
80,
7,
48536,
11,
9312,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
770,
2139,
20417,
284,
262,
4580,
15271,
1635,
5317,
658,
8549,
9,
287,
1502,
284,
651,
262,
6323,
1808,
286,
281,
6824,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
6824,
25,
317,
4938,
6824,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
9312,
25,
317,
4938,
9312,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
317,
8633,
7268,
6824,
11,
257,
9312,
290,
262,
6323,
1808,
13,
628,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
19016,
796,
17828,
15365,
62,
10725,
4760,
10979,
62,
21886,
1343,
12813,
48536,
14,
81,
80,
1,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
374,
796,
6246,
13,
1136,
7,
6371,
11,
33918,
28,
4895,
48536,
1298,
6824,
11,
366,
26858,
1298,
9312,
30072,
198,
220,
220,
220,
220,
220,
220,
220,
611,
374,
13,
13376,
62,
8189,
6624,
939,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2882,
796,
374,
13,
17752,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
2882,
628,
220,
220,
220,
2845,
7007,
13,
1069,
11755,
13,
18453,
16922,
355,
304,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
68,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
6045,
198
] | 2.484499 | 2,516 |
import re
if __name__ == '__main__':
main() | [
11748,
302,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1388,
3419
] | 1.756757 | 37 |
"""
Join two sets of intervals using their overlap as the key. The
intervals MUST be sorted by chrom(lexicographically),
start(arithmetically) and end(arithmetically). This works by simply
walking through the inputs in O(n) time.
"""
import math
from bx.intervals.io import GenomicInterval
from .quicksect import IntervalTree
| [
37811,
198,
18234,
734,
5621,
286,
20016,
1262,
511,
21721,
355,
262,
1994,
13,
220,
383,
198,
3849,
12786,
17191,
307,
23243,
416,
15358,
7,
2588,
291,
33145,
828,
198,
9688,
7,
283,
342,
4164,
1146,
8,
290,
886,
7,
283,
342,
4164,
1146,
737,
220,
770,
2499,
416,
2391,
198,
44065,
832,
262,
17311,
287,
440,
7,
77,
8,
640,
13,
198,
37811,
198,
198,
11748,
10688,
198,
198,
6738,
275,
87,
13,
3849,
12786,
13,
952,
1330,
5215,
10179,
9492,
2100,
198,
6738,
764,
24209,
8831,
1330,
4225,
2100,
27660,
628,
628,
198
] | 3.515789 | 95 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 5 09:45:45 2020
@author: hien
"""
import numpy as np
import torch
from src.deep_q_network import Critic, Actor
from src.replay_memory import ReplayBuffer
from random import random, randint, choices, uniform
from src import utils
from src.utils import flatten
from torch.optim import Adam, SGD
from torch.autograd import Variable
import torch.nn.functional as F
from sklearn.utils import shuffle
from copy import deepcopy as copy
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
26223,
5267,
220,
642,
7769,
25,
2231,
25,
2231,
12131,
198,
198,
31,
9800,
25,
289,
2013,
198,
37811,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
6738,
12351,
13,
22089,
62,
80,
62,
27349,
1330,
10056,
291,
11,
27274,
198,
6738,
12351,
13,
260,
1759,
62,
31673,
1330,
23635,
28632,
198,
6738,
4738,
1330,
4738,
11,
43720,
600,
11,
7747,
11,
8187,
198,
6738,
12351,
1330,
3384,
4487,
198,
6738,
12351,
13,
26791,
1330,
27172,
268,
198,
6738,
28034,
13,
40085,
1330,
7244,
11,
26147,
35,
198,
6738,
28034,
13,
2306,
519,
6335,
1330,
35748,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
6738,
1341,
35720,
13,
26791,
1330,
36273,
198,
6738,
4866,
1330,
2769,
30073,
355,
4866,
628
] | 3.302632 | 152 |
#!/usr/bin/env python
# coding: utf8
'''
@author: qitan
@contact: [email protected]
@file: myinclusion.py
@time: 2017/3/30 15:32
@desc:
'''
from django import template
from django.db.models import Q
from deploy.models import *
from userauth.models import *
register = template.Library()
def show_single_minions(pk, user_type):
'''
文件回滚中单项显示主机列表
'''
tgt_list = []
if user_type:
tgt_list = [i['hostname'] for i in SaltHost.objects.filter(status=True).values('hostname')]
else:
tgt_list = [i['hostname'] for d in User.objects.get(pk=pk).department.all() for i in
d.host_department_set.values('hostname')]
return {'tgt_list': sorted(list(set(tgt_list)))}
register.inclusion_tag('tag_single_minions.html')(show_single_minions)
def show_groups(pk, user_type):
'''
远程命令、模块部署及文件管理中显示所有分组
'''
group_dict = {}
if user_type:
group_dict = {i['groupname']:i['nickname'] for i in SaltGroup.objects.values('groupname', 'nickname')}
else:
d = User.objects.get(pk=pk).department
group_dict = {i['groupname']:i['nickname'] for d in User.objects.get(pk=pk).department.all()
for i in d.saltgroup_department_set.values('groupname', 'nickname')}
return {'group_dict':sorted(list(set(group_dict.items())))}
register.inclusion_tag('tag_user_departments.html')(show_groups)
def show_modules(u, user_type):
'''
模块部署中显示所有模块
'''
if user_type:
module_list = ModuleUpload.objects.all()
else:
# 获取用户创建或公开模块
module_visible_list = [{'pk': i.pk, 'name': i.name, 'module': i.module, 'remark': i.remark}
for i in ModuleUpload.objects.filter(Q(user=u) | Q(visible=2))]
# 获取用户组模块
module_user_group_list = [{'pk': i.pk, 'name': i.name, 'module': i.module, 'remark': i.remark}
for g in User.objects.get(pk=u.pk).group.all() for i in
ModuleUpload.objects.filter(user_group=g)]
# 合并list
module_list = module_visible_list + [i for i in module_user_group_list if i not in module_visible_list]
return {'module_list': module_list}
register.inclusion_tag('tag_modules.html')(show_modules)
def show_user_group_minions(pk, user_type, list_type):
'''
远程命令、模块部署及文件上传中显示主机列表
'''
if user_type:
tgt_list = [i['hostname'] for i in SaltHost.objects.filter(status=True).values('hostname')]
else:
tgt_list = [i['hostname'] for g in User.objects.get(pk=pk).group.all() for i in
SaltHost.objects.filter(user_group=g).values('hostname')]
return {'tgt_list':sorted(list(set(tgt_list))), 'list_type':list_type}
register.inclusion_tag('tag_user_group_minions.html')(show_user_group_minions)
def show_user_group_groups(pk, user_type):
'''
远程命令、模块部署及文件管理中显示用户分组
'''
group_dict = {}
if user_type:
group_dict = {i['groupname']:i['nickname'] for i in SaltGroup.objects.values('groupname', 'nickname')}
else:
group_dict = {i['groupname']:i['nickname'] for g in User.objects.get(pk=pk).group.all()
for i in SaltGroup.objects.filter(user_group=g).values('groupname', 'nickname')}
return {'group_dict':sorted(list(set(group_dict.items())))}
register.inclusion_tag('tag_user_group_groups.html')(show_user_group_groups)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
23,
198,
7061,
6,
198,
31,
9800,
25,
10662,
18642,
198,
31,
32057,
25,
10662,
80,
278,
62,
75,
1872,
31,
8940,
4529,
13,
785,
198,
31,
7753,
25,
616,
259,
4717,
13,
9078,
198,
31,
2435,
25,
2177,
14,
18,
14,
1270,
1315,
25,
2624,
198,
31,
20147,
25,
198,
7061,
6,
198,
198,
6738,
42625,
14208,
1330,
11055,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
1330,
1195,
198,
198,
6738,
6061,
13,
27530,
1330,
1635,
198,
6738,
2836,
18439,
13,
27530,
1330,
1635,
198,
198,
30238,
796,
11055,
13,
23377,
3419,
628,
198,
4299,
905,
62,
29762,
62,
1084,
507,
7,
79,
74,
11,
2836,
62,
4906,
2599,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
10545,
244,
229,
20015,
114,
32368,
252,
162,
119,
248,
40792,
39355,
243,
165,
94,
117,
23626,
122,
163,
97,
118,
10310,
119,
17312,
118,
26344,
245,
26193,
101,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
256,
13655,
62,
4868,
796,
17635,
198,
220,
220,
220,
611,
2836,
62,
4906,
25,
198,
220,
220,
220,
220,
220,
220,
220,
256,
13655,
62,
4868,
796,
685,
72,
17816,
4774,
3672,
20520,
329,
1312,
287,
13754,
17932,
13,
48205,
13,
24455,
7,
13376,
28,
17821,
737,
27160,
10786,
4774,
3672,
11537,
60,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
256,
13655,
62,
4868,
796,
685,
72,
17816,
4774,
3672,
20520,
329,
288,
287,
11787,
13,
48205,
13,
1136,
7,
79,
74,
28,
79,
74,
737,
10378,
1823,
13,
439,
3419,
329,
1312,
287,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
288,
13,
4774,
62,
10378,
1823,
62,
2617,
13,
27160,
10786,
4774,
3672,
11537,
60,
198,
220,
220,
220,
1441,
1391,
6,
83,
13655,
62,
4868,
10354,
23243,
7,
4868,
7,
2617,
7,
83,
13655,
62,
4868,
22305,
92,
198,
198,
30238,
13,
259,
4717,
62,
12985,
10786,
12985,
62,
29762,
62,
1084,
507,
13,
6494,
6,
5769,
12860,
62,
29762,
62,
1084,
507,
8,
628,
198,
4299,
905,
62,
24432,
7,
79,
74,
11,
2836,
62,
4906,
2599,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
5525,
123,
250,
163,
101,
233,
37772,
121,
20015,
97,
23513,
162,
101,
94,
161,
251,
245,
32849,
101,
163,
121,
110,
20998,
232,
23877,
229,
20015,
114,
163,
106,
94,
49426,
228,
40792,
23626,
122,
163,
97,
118,
33699,
222,
17312,
231,
26344,
228,
163,
119,
226,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
1448,
62,
11600,
796,
23884,
198,
220,
220,
220,
611,
2836,
62,
4906,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1448,
62,
11600,
796,
1391,
72,
17816,
8094,
3672,
6,
5974,
72,
17816,
17172,
3672,
20520,
329,
1312,
287,
13754,
13247,
13,
48205,
13,
27160,
10786,
8094,
3672,
3256,
705,
17172,
3672,
11537,
92,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
288,
796,
11787,
13,
48205,
13,
1136,
7,
79,
74,
28,
79,
74,
737,
10378,
1823,
198,
220,
220,
220,
220,
220,
220,
220,
1448,
62,
11600,
796,
1391,
72,
17816,
8094,
3672,
6,
5974,
72,
17816,
17172,
3672,
20520,
329,
288,
287,
11787,
13,
48205,
13,
1136,
7,
79,
74,
28,
79,
74,
737,
10378,
1823,
13,
439,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
287,
288,
13,
82,
2501,
8094,
62,
10378,
1823,
62,
2617,
13,
27160,
10786,
8094,
3672,
3256,
705,
17172,
3672,
11537,
92,
628,
220,
220,
220,
1441,
1391,
6,
8094,
62,
11600,
10354,
82,
9741,
7,
4868,
7,
2617,
7,
8094,
62,
11600,
13,
23814,
3419,
22305,
92,
198,
198,
30238,
13,
259,
4717,
62,
12985,
10786,
12985,
62,
7220,
62,
10378,
32514,
13,
6494,
6,
5769,
12860,
62,
24432,
8,
628,
198,
4299,
905,
62,
18170,
7,
84,
11,
2836,
62,
4906,
2599,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
10545,
101,
94,
161,
251,
245,
32849,
101,
163,
121,
110,
40792,
23626,
122,
163,
97,
118,
33699,
222,
17312,
231,
162,
101,
94,
161,
251,
245,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
611,
2836,
62,
4906,
25,
198,
220,
220,
220,
220,
220,
220,
220,
8265,
62,
4868,
796,
19937,
41592,
13,
48205,
13,
439,
3419,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
5525,
236,
115,
20998,
244,
18796,
101,
22755,
115,
26344,
249,
161,
119,
118,
22755,
244,
17739,
105,
28156,
222,
162,
101,
94,
161,
251,
245,
198,
220,
220,
220,
220,
220,
220,
220,
8265,
62,
23504,
62,
4868,
796,
685,
90,
6,
79,
74,
10354,
1312,
13,
79,
74,
11,
705,
3672,
10354,
1312,
13,
3672,
11,
705,
21412,
10354,
1312,
13,
21412,
11,
705,
2787,
668,
10354,
1312,
13,
2787,
668,
92,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
287,
19937,
41592,
13,
48205,
13,
24455,
7,
48,
7,
7220,
28,
84,
8,
930,
1195,
7,
23504,
28,
17,
4008,
60,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
5525,
236,
115,
20998,
244,
18796,
101,
22755,
115,
163,
119,
226,
162,
101,
94,
161,
251,
245,
198,
220,
220,
220,
220,
220,
220,
220,
8265,
62,
7220,
62,
8094,
62,
4868,
796,
685,
90,
6,
79,
74,
10354,
1312,
13,
79,
74,
11,
705,
3672,
10354,
1312,
13,
3672,
11,
705,
21412,
10354,
1312,
13,
21412,
11,
705,
2787,
668,
10354,
1312,
13,
2787,
668,
92,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
308,
287,
11787,
13,
48205,
13,
1136,
7,
79,
74,
28,
84,
13,
79,
74,
737,
8094,
13,
439,
3419,
329,
1312,
287,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
19937,
41592,
13,
48205,
13,
24455,
7,
7220,
62,
8094,
28,
70,
15437,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
10263,
238,
230,
33176,
114,
4868,
198,
220,
220,
220,
220,
220,
220,
220,
8265,
62,
4868,
796,
8265,
62,
23504,
62,
4868,
1343,
685,
72,
329,
1312,
287,
8265,
62,
7220,
62,
8094,
62,
4868,
611,
1312,
407,
287,
8265,
62,
23504,
62,
4868,
60,
198,
220,
220,
220,
1441,
1391,
6,
21412,
62,
4868,
10354,
8265,
62,
4868,
92,
198,
198,
30238,
13,
259,
4717,
62,
12985,
10786,
12985,
62,
18170,
13,
6494,
6,
5769,
12860,
62,
18170,
8,
628,
198,
4299,
905,
62,
7220,
62,
8094,
62,
1084,
507,
7,
79,
74,
11,
2836,
62,
4906,
11,
1351,
62,
4906,
2599,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
5525,
123,
250,
163,
101,
233,
37772,
121,
20015,
97,
23513,
162,
101,
94,
161,
251,
245,
32849,
101,
163,
121,
110,
20998,
232,
23877,
229,
20015,
114,
41468,
27670,
254,
40792,
23626,
122,
163,
97,
118,
10310,
119,
17312,
118,
26344,
245,
26193,
101,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
611,
2836,
62,
4906,
25,
198,
220,
220,
220,
220,
220,
220,
220,
256,
13655,
62,
4868,
796,
685,
72,
17816,
4774,
3672,
20520,
329,
1312,
287,
13754,
17932,
13,
48205,
13,
24455,
7,
13376,
28,
17821,
737,
27160,
10786,
4774,
3672,
11537,
60,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
256,
13655,
62,
4868,
796,
685,
72,
17816,
4774,
3672,
20520,
329,
308,
287,
11787,
13,
48205,
13,
1136,
7,
79,
74,
28,
79,
74,
737,
8094,
13,
439,
3419,
329,
1312,
287,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13754,
17932,
13,
48205,
13,
24455,
7,
7220,
62,
8094,
28,
70,
737,
27160,
10786,
4774,
3672,
11537,
60,
198,
220,
220,
220,
1441,
1391,
6,
83,
13655,
62,
4868,
10354,
82,
9741,
7,
4868,
7,
2617,
7,
83,
13655,
62,
4868,
4008,
828,
705,
4868,
62,
4906,
10354,
4868,
62,
4906,
92,
198,
198,
30238,
13,
259,
4717,
62,
12985,
10786,
12985,
62,
7220,
62,
8094,
62,
1084,
507,
13,
6494,
6,
5769,
12860,
62,
7220,
62,
8094,
62,
1084,
507,
8,
628,
198,
4299,
905,
62,
7220,
62,
8094,
62,
24432,
7,
79,
74,
11,
2836,
62,
4906,
2599,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
5525,
123,
250,
163,
101,
233,
37772,
121,
20015,
97,
23513,
162,
101,
94,
161,
251,
245,
32849,
101,
163,
121,
110,
20998,
232,
23877,
229,
20015,
114,
163,
106,
94,
49426,
228,
40792,
23626,
122,
163,
97,
118,
18796,
101,
22755,
115,
26344,
228,
163,
119,
226,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
1448,
62,
11600,
796,
23884,
198,
220,
220,
220,
611,
2836,
62,
4906,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1448,
62,
11600,
796,
1391,
72,
17816,
8094,
3672,
6,
5974,
72,
17816,
17172,
3672,
20520,
329,
1312,
287,
13754,
13247,
13,
48205,
13,
27160,
10786,
8094,
3672,
3256,
705,
17172,
3672,
11537,
92,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1448,
62,
11600,
796,
1391,
72,
17816,
8094,
3672,
6,
5974,
72,
17816,
17172,
3672,
20520,
329,
308,
287,
11787,
13,
48205,
13,
1136,
7,
79,
74,
28,
79,
74,
737,
8094,
13,
439,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
287,
13754,
13247,
13,
48205,
13,
24455,
7,
7220,
62,
8094,
28,
70,
737,
27160,
10786,
8094,
3672,
3256,
705,
17172,
3672,
11537,
92,
628,
220,
220,
220,
1441,
1391,
6,
8094,
62,
11600,
10354,
82,
9741,
7,
4868,
7,
2617,
7,
8094,
62,
11600,
13,
23814,
3419,
22305,
92,
198,
198,
30238,
13,
259,
4717,
62,
12985,
10786,
12985,
62,
7220,
62,
8094,
62,
24432,
13,
6494,
6,
5769,
12860,
62,
7220,
62,
8094,
62,
24432,
8,
628
] | 1.956995 | 1,744 |
# call this script with `python -m evaluation.evaluate_poselines_globalaction`
import numpy as np
from numpy.core.fromnumeric import sort
import pandas as pd
import datetime
import torch
from torch.functional import norm
from tqdm import tqdm
from . import eval_utils
import cv2
from .compare_deepfeatures import negative_cosine_dist_flatten
from compoelem.config import config
from compoelem.compare.pose_line import compare_pose_lines_2, compare_pose_lines_3, filter_pose_line_ga_result
from compoelem.compare.normalize import minmax_norm_by_imgrect, minmax_norm_by_bbox, norm_by_global_action
#https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_feature2d/py_matcher/py_matcher.html#brute-force-matching-with-sift-descriptors-and-ratio-test
| [
2,
869,
428,
4226,
351,
4600,
29412,
532,
76,
12660,
13,
49786,
62,
3455,
6615,
62,
20541,
2673,
63,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
299,
32152,
13,
7295,
13,
6738,
77,
39223,
1330,
3297,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
4818,
8079,
198,
11748,
28034,
198,
6738,
28034,
13,
45124,
1330,
2593,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
6738,
764,
1330,
5418,
62,
26791,
198,
11748,
269,
85,
17,
198,
198,
6738,
764,
5589,
533,
62,
22089,
40890,
1330,
4633,
62,
6966,
500,
62,
17080,
62,
2704,
41769,
198,
198,
6738,
552,
2577,
10671,
13,
11250,
1330,
4566,
198,
6738,
552,
2577,
10671,
13,
5589,
533,
13,
3455,
62,
1370,
1330,
8996,
62,
3455,
62,
6615,
62,
17,
11,
8996,
62,
3455,
62,
6615,
62,
18,
11,
8106,
62,
3455,
62,
1370,
62,
4908,
62,
20274,
198,
6738,
552,
2577,
10671,
13,
5589,
533,
13,
11265,
1096,
1330,
949,
9806,
62,
27237,
62,
1525,
62,
9600,
2554,
11,
949,
9806,
62,
27237,
62,
1525,
62,
65,
3524,
11,
2593,
62,
1525,
62,
20541,
62,
2673,
198,
198,
2,
5450,
1378,
9654,
33967,
12,
29412,
12,
83,
315,
305,
874,
13,
961,
83,
704,
420,
82,
13,
952,
14,
268,
14,
42861,
14,
9078,
62,
83,
44917,
82,
14,
9078,
62,
30053,
17,
67,
14,
9078,
62,
6759,
2044,
14,
9078,
62,
6759,
2044,
13,
6494,
2,
1671,
1133,
12,
3174,
12,
15699,
278,
12,
4480,
12,
82,
2135,
12,
20147,
1968,
669,
12,
392,
12,
10366,
952,
12,
9288,
198
] | 2.95 | 260 |
import torch.autograd
import torch.nn as nn
from dataset import Dataset2
if __name__ == '__main__':
num_epoch = 500
data_vector_dim = 20
item_of_single_class = 10
train_dataset = Dataset2(item_of_single_class=item_of_single_class, data_vector_dim=data_vector_dim)
test_dataset = Dataset2(item_of_single_class=item_of_single_class, data_vector_dim=data_vector_dim)
class_num = len(train_dataset.noise_scope_list)
dataset_length = item_of_single_class * class_num
train_dataloader = torch.utils.data.DataLoader(
dataset=train_dataset, batch_size=dataset_length, shuffle=True
)
test_dataloader = torch.utils.data.DataLoader(
dataset=test_dataset, batch_size=dataset_length, shuffle=True
)
net = Network2(input_dim=data_vector_dim, output_dim=class_num)
if torch.cuda.is_available():
net = net.cuda()
criterion = nn.CrossEntropyLoss()
optimizer = torch.optim.Adam(net.parameters(), lr=0.0001)
for epoch in range(num_epoch):
for i, (data_batch, label_batch) in enumerate(train_dataloader):
data_batch = data_batch.cuda()
real_out = net(data_batch)
label_batch = label_batch.cuda()
loss = criterion(real_out, label_batch)
optimizer.zero_grad()
loss.backward()
optimizer.step()
print("acc:{:.6f}".format(evaluate(net, test_dataloader)))
| [
11748,
28034,
13,
2306,
519,
6335,
201,
198,
11748,
28034,
13,
20471,
355,
299,
77,
201,
198,
6738,
27039,
1330,
16092,
292,
316,
17,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
201,
198,
220,
220,
220,
997,
62,
538,
5374,
796,
5323,
201,
198,
220,
220,
220,
1366,
62,
31364,
62,
27740,
796,
1160,
201,
198,
220,
220,
220,
2378,
62,
1659,
62,
29762,
62,
4871,
796,
838,
201,
198,
220,
220,
220,
4512,
62,
19608,
292,
316,
796,
16092,
292,
316,
17,
7,
9186,
62,
1659,
62,
29762,
62,
4871,
28,
9186,
62,
1659,
62,
29762,
62,
4871,
11,
1366,
62,
31364,
62,
27740,
28,
7890,
62,
31364,
62,
27740,
8,
201,
198,
220,
220,
220,
1332,
62,
19608,
292,
316,
796,
16092,
292,
316,
17,
7,
9186,
62,
1659,
62,
29762,
62,
4871,
28,
9186,
62,
1659,
62,
29762,
62,
4871,
11,
1366,
62,
31364,
62,
27740,
28,
7890,
62,
31364,
62,
27740,
8,
201,
198,
220,
220,
220,
1398,
62,
22510,
796,
18896,
7,
27432,
62,
19608,
292,
316,
13,
3919,
786,
62,
29982,
62,
4868,
8,
201,
198,
220,
220,
220,
27039,
62,
13664,
796,
2378,
62,
1659,
62,
29762,
62,
4871,
1635,
1398,
62,
22510,
201,
198,
201,
198,
220,
220,
220,
4512,
62,
67,
10254,
1170,
263,
796,
28034,
13,
26791,
13,
7890,
13,
6601,
17401,
7,
201,
198,
220,
220,
220,
220,
220,
220,
220,
27039,
28,
27432,
62,
19608,
292,
316,
11,
15458,
62,
7857,
28,
19608,
292,
316,
62,
13664,
11,
36273,
28,
17821,
201,
198,
220,
220,
220,
1267,
201,
198,
220,
220,
220,
1332,
62,
67,
10254,
1170,
263,
796,
28034,
13,
26791,
13,
7890,
13,
6601,
17401,
7,
201,
198,
220,
220,
220,
220,
220,
220,
220,
27039,
28,
9288,
62,
19608,
292,
316,
11,
15458,
62,
7857,
28,
19608,
292,
316,
62,
13664,
11,
36273,
28,
17821,
201,
198,
220,
220,
220,
1267,
201,
198,
201,
198,
220,
220,
220,
2010,
796,
7311,
17,
7,
15414,
62,
27740,
28,
7890,
62,
31364,
62,
27740,
11,
5072,
62,
27740,
28,
4871,
62,
22510,
8,
201,
198,
220,
220,
220,
611,
28034,
13,
66,
15339,
13,
271,
62,
15182,
33529,
201,
198,
220,
220,
220,
220,
220,
220,
220,
2010,
796,
2010,
13,
66,
15339,
3419,
201,
198,
201,
198,
220,
220,
220,
34054,
796,
299,
77,
13,
21544,
14539,
28338,
43,
793,
3419,
201,
198,
220,
220,
220,
6436,
7509,
796,
28034,
13,
40085,
13,
23159,
7,
3262,
13,
17143,
7307,
22784,
300,
81,
28,
15,
13,
18005,
8,
201,
198,
220,
220,
220,
329,
36835,
287,
2837,
7,
22510,
62,
538,
5374,
2599,
201,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
11,
357,
7890,
62,
43501,
11,
6167,
62,
43501,
8,
287,
27056,
378,
7,
27432,
62,
67,
10254,
1170,
263,
2599,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
62,
43501,
796,
1366,
62,
43501,
13,
66,
15339,
3419,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1103,
62,
448,
796,
2010,
7,
7890,
62,
43501,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6167,
62,
43501,
796,
6167,
62,
43501,
13,
66,
15339,
3419,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2994,
796,
34054,
7,
5305,
62,
448,
11,
6167,
62,
43501,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6436,
7509,
13,
22570,
62,
9744,
3419,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2994,
13,
1891,
904,
3419,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6436,
7509,
13,
9662,
3419,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
4134,
29164,
25,
13,
21,
69,
92,
1911,
18982,
7,
49786,
7,
3262,
11,
1332,
62,
67,
10254,
1170,
263,
22305,
201,
198
] | 2.187779 | 671 |
#!/usr/bin/env python
# -*- coding: utf-8
"""
Taxonomy Resolver
:copyright: (c) 2020-2021.
:license: Apache 2.0, see LICENSE for more details.
"""
import io
import zipfile
import pandas as pd
from taxonresolver.utils import parse_tax_ids
from taxonresolver.utils import print_and_exit
from taxonresolver.utils import split_line
from taxonresolver.utils import download_taxonomy_dump
from taxonresolver.utils import tree_reparenting
from taxonresolver.utils import tree_traversal
from taxonresolver.utils import get_nested_sets
from taxonresolver.utils import get_children
from taxonresolver.utils import get_parents
def build_tree(inputfile: str, root: str = "1") -> pd.DataFrame:
"""
Given the path to NCBI Taxonomy 'taxdmp.zip' file or simply a
'nodes.dmp' file, builds a slim tree data structure.
:param inputfile: Path to inputfile
:param root: TaxID of the root Node
:return: pandas DataFrame
"""
tree = {}
# read nodes
if zipfile.is_zipfile(inputfile):
with zipfile.ZipFile(inputfile) as taxdmp:
dmp = taxdmp.open("nodes.dmp")
else:
dmp = open(inputfile, "rb")
for line in io.TextIOWrapper(dmp):
fields = split_line(line)
tree[fields[0]] = {
"id": fields[0],
"parent_id": fields[1],
"rank": fields[2]
}
dmp.close()
# creating a full tree
tree = tree_reparenting(tree)
# transversing the tree to find 'left' and 'right' indexes
nodes = []
tree_traversal(tree[root], nodes)
nested_set, visited, counter = [], {}, -1
for i, node in enumerate(nodes):
taxid, depth = node[0], node[1]
parent_id, rank = tree[taxid]["parent_id"], tree[taxid]["rank"]
if taxid not in visited:
# create array with left ('lft') index
nested_set.append([taxid, parent_id, rank, depth, i + 1, 0])
counter += 1
visited[taxid] = counter
else:
# update the right ('rgt') index
nested_set[visited[taxid]][5] = i + 1
# load dict into a pandas DataFrame for fast indexing and operations
df = pd.DataFrame(nested_set, columns=["id", "parent_id", "rank", "depth", "lft", "rgt"]) \
.astype(dtype={"id": str, "parent_id": str, "rank": str})
return df
def write_tree(tree: pd.DataFrame, outputfile: str, outputformat: str = "pickle") -> None:
"""
Writes a pandas DataFrame object to file.
:param tree: pandas DataFrame
:param outputfile: Path to outputfile
:param outputformat: currently "pickle" format
:return: (side-effects) writes to file
"""
if outputformat == "pickle":
tree.to_pickle(outputfile)
else:
print_and_exit(f"Output format '{outputformat}' is not valid!")
def load_tree(inputfile: str, inputformat: str = "pickle") -> pd.DataFrame:
"""
Loads a pre-existing pandas DataFrame from file.
:param inputfile: Path to outputfile
:param inputformat: currently "pickle" format
:return: pandas DataFrame
"""
if inputformat == "pickle":
return pd.read_pickle(inputfile)
else:
print_and_exit(f"Input format '{inputformat}' is not valid!")
def filter_tree(tree: pd.DataFrame, filterids: list or str or None = None,
root: str = "1", ignoreinvalid: bool = True, sep: str = None, indx: int = 0) -> pd.DataFrame:
"""
Filters an existing pandas DataFrame based on a List of TaxIDs.
:param tree: pandas DataFrame
:param filterids: list of TaxIDs or Path to file with TaxIDs to filter
(i.e. to keep) in the final set of results (optional)
:param root: TaxID of the root Node
:param ignoreinvalid: whether to ignore invalid TaxIDs or not
:param sep: separator for splitting the input file lines
:param indx: index used for splicing the the resulting list
:return: pandas DataFrame
"""
message = ("Some of the provided TaxIDs are not valid or not found "
"in the built Tree.")
if type(filterids) is list:
taxids_filter = set(filterids)
elif type(filterids) is str:
taxids_filter = set(parse_tax_ids(filterids, sep, indx))
if ignoreinvalid or validate_taxids(tree, taxids_filter):
# if ignoring invalid, we should still only return TaxIDs that exist in the Tree
taxids_filter = taxids_filter.intersection(set(tree["id"].values))
# get a subset dataset sorted (by 'lft')
subset = tree[tree["id"].isin(taxids_filter)].sort_values("lft")
nested_sets = get_nested_sets(subset)
for l, r in nested_sets:
taxids = get_children(tree, l, r)
taxids_filter.update(taxids)
# expand taxids_filter with parents of the selected node
taxids = get_parents(tree, l, r)
taxids_filter.update(taxids)
df = tree[tree["id"].isin(taxids_filter)].reset_index()
else:
print_and_exit(message)
return df
def search_taxids(tree: pd.DataFrame,
includeids: list or str,
excludeids: list or str or None = None,
filterids: list or str or None = None,
ignoreinvalid: bool = True,
sep: str = None, indx: int = 0) -> list or set:
"""
Searches an existing tree pandas DataFrame and produces a list of TaxIDs.
Search is performed based on a list of TaxIDs (includedids). A search is also
performed on a list of TaxIDs (excludedids), if provided. Those will be
removed from the search on the includedids. From this final list of TaxIDs,
filterids can used to clean the final set. This could be useful to compress a
final list of TaxIDs, to only return those known to exist in another dataset.
:param tree: pandas DataFrame
:param includeids: list of TaxIDs or Path to file with TaxIDs to search with
:param excludeids: list of TaxIDs or Path to file with TaxIDs to exclude
from the search (optional)
:param filterids: list of TaxIDs or Path to file with TaxIDs to filter
(i.e. to keep) in the final set of results (optional)
:param ignoreinvalid: whether to ignore invalid TaxIDs or not
:param sep: separator for splitting the input file lines
:param indx: index used for splicing the the resulting list
:return: list of TaxIDs
"""
message = ("Some of the provided TaxIDs are not valid or not found "
"in the built Tree.")
# find all the children nodes of the list of TaxIDs to be included in the search
if type(includeids) is list:
taxids_include = set(includeids)
elif type(includeids) is str:
taxids_include = set(parse_tax_ids(includeids))
if ignoreinvalid or validate_taxids(tree, taxids_include):
# if ignoring invalid, we should still only return TaxIDs that exist in the Tree
taxids_found = taxids_include.intersection(set(tree["id"].values))
# get a subset dataset sorted (by 'lft')
subset = tree[tree["id"].isin(taxids_found)].sort_values("lft")
nested_sets = get_nested_sets(subset)
for l, r in nested_sets:
taxids = get_children(tree, l, r)
taxids_found.update(taxids)
else:
print_and_exit(message)
# find all the children nodes of the list of TaxIDs to be excluded from the search
if excludeids:
if type(excludeids) is list:
taxids_exclude = set(excludeids)
elif type(excludeids) is str:
taxids_exclude = set(parse_tax_ids(excludeids))
if ignoreinvalid or validate_taxids(tree, taxids_exclude):
subset = tree[tree["id"].isin(taxids_exclude)].sort_values("lft")
nested_sets = get_nested_sets(subset)
for l, r in nested_sets:
taxids = get_children(tree, l, r)
taxids_exclude.update(taxids)
taxids_found = taxids_found.difference(taxids_exclude)
else:
print_and_exit(message)
# keep only TaxIDs that are in the provided list of TaxIDs to filter with
if filterids:
if type(filterids) is list:
taxids_filter = set(filterids)
elif type(filterids) is str:
taxids_filter = set(parse_tax_ids(filterids, sep, indx))
if ignoreinvalid or validate_taxids(tree, taxids_filter):
taxids_found = taxids_found.intersection(taxids_filter)
else:
print_and_exit(message)
return taxids_found
def validate_taxids(tree: pd.DataFrame, validateids: list or set or str) -> bool:
"""
Checks if TaxIDs are in the list and in the Tree.
:param tree: pandas DataFrame
:param validateids: list of TaxIDs or Path to file with TaxIDs to validate
:return: boolean
"""
if type(validateids) is list:
taxids_validate = set(validateids)
elif type(validateids) is set:
taxids_validate = validateids
elif type(validateids) is str:
taxids_validate = set(parse_tax_ids(validateids))
taxids_valid = taxids_validate.intersection(set(tree["id"].values))
if len(taxids_valid) == len(taxids_validate):
return True
return False
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
198,
198,
37811,
198,
27017,
30565,
1874,
14375,
198,
198,
25,
22163,
4766,
25,
357,
66,
8,
12131,
12,
1238,
2481,
13,
198,
25,
43085,
25,
24843,
362,
13,
15,
11,
766,
38559,
24290,
329,
517,
3307,
13,
198,
37811,
198,
198,
11748,
33245,
198,
11748,
19974,
7753,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
6738,
1687,
261,
411,
14375,
13,
26791,
1330,
21136,
62,
19290,
62,
2340,
198,
6738,
1687,
261,
411,
14375,
13,
26791,
1330,
3601,
62,
392,
62,
37023,
198,
6738,
1687,
261,
411,
14375,
13,
26791,
1330,
6626,
62,
1370,
198,
6738,
1687,
261,
411,
14375,
13,
26791,
1330,
4321,
62,
19290,
30565,
62,
39455,
198,
6738,
1687,
261,
411,
14375,
13,
26791,
1330,
5509,
62,
7856,
1580,
278,
198,
6738,
1687,
261,
411,
14375,
13,
26791,
1330,
5509,
62,
9535,
690,
282,
198,
6738,
1687,
261,
411,
14375,
13,
26791,
1330,
651,
62,
77,
7287,
62,
28709,
198,
6738,
1687,
261,
411,
14375,
13,
26791,
1330,
651,
62,
17197,
198,
6738,
1687,
261,
411,
14375,
13,
26791,
1330,
651,
62,
23743,
628,
198,
4299,
1382,
62,
21048,
7,
15414,
7753,
25,
965,
11,
6808,
25,
965,
796,
366,
16,
4943,
4613,
279,
67,
13,
6601,
19778,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
11259,
262,
3108,
284,
8823,
3483,
9241,
30565,
705,
19290,
67,
3149,
13,
13344,
6,
2393,
393,
2391,
257,
198,
220,
220,
220,
705,
77,
4147,
13,
67,
3149,
6,
2393,
11,
12188,
257,
18862,
5509,
1366,
4645,
13,
628,
220,
220,
220,
1058,
17143,
5128,
7753,
25,
10644,
284,
5128,
7753,
198,
220,
220,
220,
1058,
17143,
6808,
25,
9241,
2389,
286,
262,
6808,
19081,
198,
220,
220,
220,
1058,
7783,
25,
19798,
292,
6060,
19778,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
5509,
796,
23884,
198,
220,
220,
220,
1303,
1100,
13760,
198,
220,
220,
220,
611,
19974,
7753,
13,
271,
62,
13344,
7753,
7,
15414,
7753,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
351,
19974,
7753,
13,
41729,
8979,
7,
15414,
7753,
8,
355,
1687,
67,
3149,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
288,
3149,
796,
1687,
67,
3149,
13,
9654,
7203,
77,
4147,
13,
67,
3149,
4943,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
288,
3149,
796,
1280,
7,
15414,
7753,
11,
366,
26145,
4943,
198,
220,
220,
220,
329,
1627,
287,
33245,
13,
8206,
40,
3913,
430,
2848,
7,
67,
3149,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
7032,
796,
6626,
62,
1370,
7,
1370,
8,
198,
220,
220,
220,
220,
220,
220,
220,
5509,
58,
25747,
58,
15,
11907,
796,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
312,
1298,
7032,
58,
15,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
8000,
62,
312,
1298,
7032,
58,
16,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
43027,
1298,
7032,
58,
17,
60,
198,
220,
220,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
288,
3149,
13,
19836,
3419,
198,
220,
220,
220,
1303,
4441,
257,
1336,
5509,
198,
220,
220,
220,
5509,
796,
5509,
62,
7856,
1580,
278,
7,
21048,
8,
628,
220,
220,
220,
1303,
1007,
690,
278,
262,
5509,
284,
1064,
705,
9464,
6,
290,
705,
3506,
6,
39199,
198,
220,
220,
220,
13760,
796,
17635,
198,
220,
220,
220,
5509,
62,
9535,
690,
282,
7,
21048,
58,
15763,
4357,
13760,
8,
198,
220,
220,
220,
28376,
62,
2617,
11,
8672,
11,
3753,
796,
685,
4357,
1391,
5512,
532,
16,
198,
220,
220,
220,
329,
1312,
11,
10139,
287,
27056,
378,
7,
77,
4147,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
1687,
312,
11,
6795,
796,
10139,
58,
15,
4357,
10139,
58,
16,
60,
198,
220,
220,
220,
220,
220,
220,
220,
2560,
62,
312,
11,
4279,
796,
5509,
58,
19290,
312,
7131,
1,
8000,
62,
312,
33116,
5509,
58,
19290,
312,
7131,
1,
43027,
8973,
198,
220,
220,
220,
220,
220,
220,
220,
611,
1687,
312,
407,
287,
8672,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
2251,
7177,
351,
1364,
19203,
75,
701,
11537,
6376,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
28376,
62,
2617,
13,
33295,
26933,
19290,
312,
11,
2560,
62,
312,
11,
4279,
11,
6795,
11,
1312,
1343,
352,
11,
657,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3753,
15853,
352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8672,
58,
19290,
312,
60,
796,
3753,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
4296,
262,
826,
19203,
81,
13655,
11537,
6376,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
28376,
62,
2617,
58,
4703,
863,
58,
19290,
312,
60,
7131,
20,
60,
796,
1312,
1343,
352,
628,
220,
220,
220,
1303,
3440,
8633,
656,
257,
19798,
292,
6060,
19778,
329,
3049,
6376,
278,
290,
4560,
198,
220,
220,
220,
47764,
796,
279,
67,
13,
6601,
19778,
7,
77,
7287,
62,
2617,
11,
15180,
28,
14692,
312,
1600,
366,
8000,
62,
312,
1600,
366,
43027,
1600,
366,
18053,
1600,
366,
75,
701,
1600,
366,
81,
13655,
8973,
8,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
764,
459,
2981,
7,
67,
4906,
28,
4895,
312,
1298,
965,
11,
366,
8000,
62,
312,
1298,
965,
11,
366,
43027,
1298,
965,
30072,
198,
220,
220,
220,
1441,
47764,
628,
198,
4299,
3551,
62,
21048,
7,
21048,
25,
279,
67,
13,
6601,
19778,
11,
5072,
7753,
25,
965,
11,
5072,
18982,
25,
965,
796,
366,
27729,
293,
4943,
4613,
6045,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
12257,
274,
257,
19798,
292,
6060,
19778,
2134,
284,
2393,
13,
628,
220,
220,
220,
1058,
17143,
5509,
25,
19798,
292,
6060,
19778,
198,
220,
220,
220,
1058,
17143,
5072,
7753,
25,
10644,
284,
5072,
7753,
198,
220,
220,
220,
1058,
17143,
5072,
18982,
25,
3058,
366,
27729,
293,
1,
5794,
198,
220,
220,
220,
1058,
7783,
25,
357,
1589,
12,
34435,
8,
6797,
284,
2393,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
611,
5072,
18982,
6624,
366,
27729,
293,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
5509,
13,
1462,
62,
27729,
293,
7,
22915,
7753,
8,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
62,
392,
62,
37023,
7,
69,
1,
26410,
5794,
705,
90,
22915,
18982,
92,
6,
318,
407,
4938,
2474,
8,
628,
198,
4299,
3440,
62,
21048,
7,
15414,
7753,
25,
965,
11,
5128,
18982,
25,
965,
796,
366,
27729,
293,
4943,
4613,
279,
67,
13,
6601,
19778,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
8778,
82,
257,
662,
12,
25687,
19798,
292,
6060,
19778,
422,
2393,
13,
628,
220,
220,
220,
1058,
17143,
5128,
7753,
25,
10644,
284,
5072,
7753,
198,
220,
220,
220,
1058,
17143,
5128,
18982,
25,
3058,
366,
27729,
293,
1,
5794,
198,
220,
220,
220,
1058,
7783,
25,
19798,
292,
6060,
19778,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
611,
5128,
18982,
6624,
366,
27729,
293,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
279,
67,
13,
961,
62,
27729,
293,
7,
15414,
7753,
8,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
62,
392,
62,
37023,
7,
69,
1,
20560,
5794,
705,
90,
15414,
18982,
92,
6,
318,
407,
4938,
2474,
8,
628,
198,
4299,
8106,
62,
21048,
7,
21048,
25,
279,
67,
13,
6601,
19778,
11,
8106,
2340,
25,
1351,
393,
965,
393,
6045,
796,
6045,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6808,
25,
965,
796,
366,
16,
1600,
8856,
259,
12102,
25,
20512,
796,
6407,
11,
41767,
25,
965,
796,
6045,
11,
773,
87,
25,
493,
796,
657,
8,
4613,
279,
67,
13,
6601,
19778,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
7066,
1010,
281,
4683,
19798,
292,
6060,
19778,
1912,
319,
257,
7343,
286,
9241,
47954,
13,
628,
220,
220,
220,
1058,
17143,
5509,
25,
19798,
292,
6060,
19778,
198,
220,
220,
220,
1058,
17143,
8106,
2340,
25,
1351,
286,
9241,
47954,
393,
10644,
284,
2393,
351,
9241,
47954,
284,
8106,
198,
220,
220,
220,
220,
220,
220,
220,
357,
72,
13,
68,
13,
284,
1394,
8,
287,
262,
2457,
900,
286,
2482,
357,
25968,
8,
198,
220,
220,
220,
1058,
17143,
6808,
25,
9241,
2389,
286,
262,
6808,
19081,
198,
220,
220,
220,
1058,
17143,
8856,
259,
12102,
25,
1771,
284,
8856,
12515,
9241,
47954,
393,
407,
198,
220,
220,
220,
1058,
17143,
41767,
25,
2880,
1352,
329,
26021,
262,
5128,
2393,
3951,
198,
220,
220,
220,
1058,
17143,
773,
87,
25,
6376,
973,
329,
4328,
6345,
262,
262,
7186,
1351,
198,
220,
220,
220,
1058,
7783,
25,
19798,
292,
6060,
19778,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
3275,
796,
5855,
4366,
286,
262,
2810,
9241,
47954,
389,
407,
4938,
393,
407,
1043,
366,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
259,
262,
3170,
12200,
19570,
628,
220,
220,
220,
611,
2099,
7,
24455,
2340,
8,
318,
1351,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1687,
2340,
62,
24455,
796,
900,
7,
24455,
2340,
8,
198,
220,
220,
220,
1288,
361,
2099,
7,
24455,
2340,
8,
318,
965,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1687,
2340,
62,
24455,
796,
900,
7,
29572,
62,
19290,
62,
2340,
7,
24455,
2340,
11,
41767,
11,
773,
87,
4008,
628,
220,
220,
220,
611,
8856,
259,
12102,
393,
26571,
62,
19290,
2340,
7,
21048,
11,
1687,
2340,
62,
24455,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
611,
15482,
12515,
11,
356,
815,
991,
691,
1441,
9241,
47954,
326,
2152,
287,
262,
12200,
198,
220,
220,
220,
220,
220,
220,
220,
1687,
2340,
62,
24455,
796,
1687,
2340,
62,
24455,
13,
3849,
5458,
7,
2617,
7,
21048,
14692,
312,
1,
4083,
27160,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
651,
257,
24637,
27039,
23243,
357,
1525,
705,
75,
701,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
24637,
796,
5509,
58,
21048,
14692,
312,
1,
4083,
45763,
7,
19290,
2340,
62,
24455,
25295,
30619,
62,
27160,
7203,
75,
701,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
28376,
62,
28709,
796,
651,
62,
77,
7287,
62,
28709,
7,
7266,
2617,
8,
198,
220,
220,
220,
220,
220,
220,
220,
329,
300,
11,
374,
287,
28376,
62,
28709,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1687,
2340,
796,
651,
62,
17197,
7,
21048,
11,
300,
11,
374,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1687,
2340,
62,
24455,
13,
19119,
7,
19290,
2340,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
4292,
1687,
2340,
62,
24455,
351,
3397,
286,
262,
6163,
10139,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1687,
2340,
796,
651,
62,
23743,
7,
21048,
11,
300,
11,
374,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1687,
2340,
62,
24455,
13,
19119,
7,
19290,
2340,
8,
198,
220,
220,
220,
220,
220,
220,
220,
47764,
796,
5509,
58,
21048,
14692,
312,
1,
4083,
45763,
7,
19290,
2340,
62,
24455,
25295,
42503,
62,
9630,
3419,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
62,
392,
62,
37023,
7,
20500,
8,
198,
220,
220,
220,
1441,
47764,
628,
198,
4299,
2989,
62,
19290,
2340,
7,
21048,
25,
279,
67,
13,
6601,
19778,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2291,
2340,
25,
1351,
393,
965,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
19607,
2340,
25,
1351,
393,
965,
393,
6045,
796,
6045,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8106,
2340,
25,
1351,
393,
965,
393,
6045,
796,
6045,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8856,
259,
12102,
25,
20512,
796,
6407,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41767,
25,
965,
796,
6045,
11,
773,
87,
25,
493,
796,
657,
8,
4613,
1351,
393,
900,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
42016,
2052,
281,
4683,
5509,
19798,
292,
6060,
19778,
290,
11073,
257,
1351,
286,
9241,
47954,
13,
198,
220,
220,
220,
11140,
318,
6157,
1912,
319,
257,
1351,
286,
9241,
47954,
357,
259,
10341,
2340,
737,
317,
2989,
318,
635,
198,
220,
220,
220,
6157,
319,
257,
1351,
286,
9241,
47954,
357,
1069,
10341,
2340,
828,
611,
2810,
13,
5845,
481,
307,
198,
220,
220,
220,
4615,
422,
262,
2989,
319,
262,
3017,
2340,
13,
3574,
428,
2457,
1351,
286,
9241,
47954,
11,
198,
220,
220,
220,
8106,
2340,
460,
973,
284,
3424,
262,
2457,
900,
13,
770,
714,
307,
4465,
284,
27413,
257,
198,
220,
220,
220,
2457,
1351,
286,
9241,
47954,
11,
284,
691,
1441,
883,
1900,
284,
2152,
287,
1194,
27039,
13,
628,
220,
220,
220,
1058,
17143,
5509,
25,
19798,
292,
6060,
19778,
198,
220,
220,
220,
1058,
17143,
2291,
2340,
25,
1351,
286,
9241,
47954,
393,
10644,
284,
2393,
351,
9241,
47954,
284,
2989,
351,
198,
220,
220,
220,
1058,
17143,
19607,
2340,
25,
1351,
286,
9241,
47954,
393,
10644,
284,
2393,
351,
9241,
47954,
284,
19607,
198,
220,
220,
220,
220,
220,
220,
220,
422,
262,
2989,
357,
25968,
8,
198,
220,
220,
220,
1058,
17143,
8106,
2340,
25,
1351,
286,
9241,
47954,
393,
10644,
284,
2393,
351,
9241,
47954,
284,
8106,
198,
220,
220,
220,
220,
220,
220,
220,
357,
72,
13,
68,
13,
284,
1394,
8,
287,
262,
2457,
900,
286,
2482,
357,
25968,
8,
198,
220,
220,
220,
1058,
17143,
8856,
259,
12102,
25,
1771,
284,
8856,
12515,
9241,
47954,
393,
407,
198,
220,
220,
220,
1058,
17143,
41767,
25,
2880,
1352,
329,
26021,
262,
5128,
2393,
3951,
198,
220,
220,
220,
1058,
17143,
773,
87,
25,
6376,
973,
329,
4328,
6345,
262,
262,
7186,
1351,
198,
220,
220,
220,
1058,
7783,
25,
1351,
286,
9241,
47954,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
3275,
796,
5855,
4366,
286,
262,
2810,
9241,
47954,
389,
407,
4938,
393,
407,
1043,
366,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
259,
262,
3170,
12200,
19570,
628,
220,
220,
220,
1303,
1064,
477,
262,
1751,
13760,
286,
262,
1351,
286,
9241,
47954,
284,
307,
3017,
287,
262,
2989,
198,
220,
220,
220,
611,
2099,
7,
17256,
2340,
8,
318,
1351,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1687,
2340,
62,
17256,
796,
900,
7,
17256,
2340,
8,
198,
220,
220,
220,
1288,
361,
2099,
7,
17256,
2340,
8,
318,
965,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1687,
2340,
62,
17256,
796,
900,
7,
29572,
62,
19290,
62,
2340,
7,
17256,
2340,
4008,
198,
220,
220,
220,
611,
8856,
259,
12102,
393,
26571,
62,
19290,
2340,
7,
21048,
11,
1687,
2340,
62,
17256,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
611,
15482,
12515,
11,
356,
815,
991,
691,
1441,
9241,
47954,
326,
2152,
287,
262,
12200,
198,
220,
220,
220,
220,
220,
220,
220,
1687,
2340,
62,
9275,
796,
1687,
2340,
62,
17256,
13,
3849,
5458,
7,
2617,
7,
21048,
14692,
312,
1,
4083,
27160,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
651,
257,
24637,
27039,
23243,
357,
1525,
705,
75,
701,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
24637,
796,
5509,
58,
21048,
14692,
312,
1,
4083,
45763,
7,
19290,
2340,
62,
9275,
25295,
30619,
62,
27160,
7203,
75,
701,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
28376,
62,
28709,
796,
651,
62,
77,
7287,
62,
28709,
7,
7266,
2617,
8,
198,
220,
220,
220,
220,
220,
220,
220,
329,
300,
11,
374,
287,
28376,
62,
28709,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1687,
2340,
796,
651,
62,
17197,
7,
21048,
11,
300,
11,
374,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1687,
2340,
62,
9275,
13,
19119,
7,
19290,
2340,
8,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
62,
392,
62,
37023,
7,
20500,
8,
628,
220,
220,
220,
1303,
1064,
477,
262,
1751,
13760,
286,
262,
1351,
286,
9241,
47954,
284,
307,
15009,
422,
262,
2989,
198,
220,
220,
220,
611,
19607,
2340,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2099,
7,
1069,
9152,
2340,
8,
318,
1351,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1687,
2340,
62,
1069,
9152,
796,
900,
7,
1069,
9152,
2340,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
2099,
7,
1069,
9152,
2340,
8,
318,
965,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1687,
2340,
62,
1069,
9152,
796,
900,
7,
29572,
62,
19290,
62,
2340,
7,
1069,
9152,
2340,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
611,
8856,
259,
12102,
393,
26571,
62,
19290,
2340,
7,
21048,
11,
1687,
2340,
62,
1069,
9152,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
24637,
796,
5509,
58,
21048,
14692,
312,
1,
4083,
45763,
7,
19290,
2340,
62,
1069,
9152,
25295,
30619,
62,
27160,
7203,
75,
701,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
28376,
62,
28709,
796,
651,
62,
77,
7287,
62,
28709,
7,
7266,
2617,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
300,
11,
374,
287,
28376,
62,
28709,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1687,
2340,
796,
651,
62,
17197,
7,
21048,
11,
300,
11,
374,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1687,
2340,
62,
1069,
9152,
13,
19119,
7,
19290,
2340,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1687,
2340,
62,
9275,
796,
1687,
2340,
62,
9275,
13,
26069,
1945,
7,
19290,
2340,
62,
1069,
9152,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
62,
392,
62,
37023,
7,
20500,
8,
628,
220,
220,
220,
1303,
1394,
691,
9241,
47954,
326,
389,
287,
262,
2810,
1351,
286,
9241,
47954,
284,
8106,
351,
198,
220,
220,
220,
611,
8106,
2340,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2099,
7,
24455,
2340,
8,
318,
1351,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1687,
2340,
62,
24455,
796,
900,
7,
24455,
2340,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
2099,
7,
24455,
2340,
8,
318,
965,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1687,
2340,
62,
24455,
796,
900,
7,
29572,
62,
19290,
62,
2340,
7,
24455,
2340,
11,
41767,
11,
773,
87,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
611,
8856,
259,
12102,
393,
26571,
62,
19290,
2340,
7,
21048,
11,
1687,
2340,
62,
24455,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1687,
2340,
62,
9275,
796,
1687,
2340,
62,
9275,
13,
3849,
5458,
7,
19290,
2340,
62,
24455,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
62,
392,
62,
37023,
7,
20500,
8,
198,
220,
220,
220,
1441,
1687,
2340,
62,
9275,
628,
198,
4299,
26571,
62,
19290,
2340,
7,
21048,
25,
279,
67,
13,
6601,
19778,
11,
26571,
2340,
25,
1351,
393,
900,
393,
965,
8,
4613,
20512,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
47719,
611,
9241,
47954,
389,
287,
262,
1351,
290,
287,
262,
12200,
13,
628,
220,
220,
220,
1058,
17143,
5509,
25,
19798,
292,
6060,
19778,
198,
220,
220,
220,
1058,
17143,
26571,
2340,
25,
1351,
286,
9241,
47954,
393,
10644,
284,
2393,
351,
9241,
47954,
284,
26571,
198,
220,
220,
220,
1058,
7783,
25,
25131,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
611,
2099,
7,
12102,
378,
2340,
8,
318,
1351,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1687,
2340,
62,
12102,
378,
796,
900,
7,
12102,
378,
2340,
8,
198,
220,
220,
220,
1288,
361,
2099,
7,
12102,
378,
2340,
8,
318,
900,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1687,
2340,
62,
12102,
378,
796,
26571,
2340,
198,
220,
220,
220,
1288,
361,
2099,
7,
12102,
378,
2340,
8,
318,
965,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1687,
2340,
62,
12102,
378,
796,
900,
7,
29572,
62,
19290,
62,
2340,
7,
12102,
378,
2340,
4008,
628,
220,
220,
220,
1687,
2340,
62,
12102,
796,
1687,
2340,
62,
12102,
378,
13,
3849,
5458,
7,
2617,
7,
21048,
14692,
312,
1,
4083,
27160,
4008,
198,
220,
220,
220,
611,
18896,
7,
19290,
2340,
62,
12102,
8,
6624,
18896,
7,
19290,
2340,
62,
12102,
378,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
6407,
198,
220,
220,
220,
1441,
10352,
628
] | 2.506801 | 3,676 |
import json
import threading
import time
import datetime
import socket
import asyncio
from collections import deque
from queue import Empty, Queue
from game.const import *
from game.world import Chunk
from kademlia.server import DHTServer
| [
11748,
33918,
198,
11748,
4704,
278,
198,
11748,
640,
198,
11748,
4818,
8079,
198,
11748,
17802,
198,
11748,
30351,
952,
198,
6738,
17268,
1330,
390,
4188,
198,
6738,
16834,
1330,
33523,
11,
4670,
518,
198,
198,
6738,
983,
13,
9979,
1330,
1635,
198,
6738,
983,
13,
6894,
1330,
609,
2954,
198,
6738,
479,
36920,
24660,
13,
15388,
1330,
23809,
4694,
18497,
628,
628,
628,
198
] | 3.784615 | 65 |
import os
os.environ['DECORRELATE'] = "False"
from DeepJetCore.training.training_base import training_base
from Losses import loss_NLL, loss_meansquared
from DeepJetCore.modeltools import fixLayersContaining,printLayerInfosAndWeights
import subprocess
import tensorflow as tf
from keras import backend as k
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
config.gpu_options.per_process_gpu_memory_fraction = 0.6
k.tensorflow_backend.set_session(tf.Session(config=config))
#train=training_base(testrun=False,renewtokens=True,useAFS=False,useweights=True)
train=training_base(testrun=False,renewtokens=True,useAFS=False,useweights=False)
if not train.modelSet():
from models import model_diTauReference as trainingModel
#from models import model_diTauDense as trainingModel
datasets = ['global','cpf','npf','sv']
#datasets = ['global']
train.setModel(trainingModel,
datasets=datasets,
dropoutRate=0.1,
momentum=0.9,
batchnorm=False,
depth=4,
width=200,
pattern=[32,32],
)
train.compileModel(learningrate=0.0001,
loss=['categorical_crossentropy'],
metrics=['accuracy'],
loss_weights=[1.],
)
#train.train_data.maxFilesOpen = 1
#train.val_data.maxFilesOpen = 1
with open(train.outputDir + 'summary.txt','w') as f:
train.keras_model.summary(print_fn=lambda x: f.write(x + '\n'))
from keras.utils import plot_model
plot_model(train.keras_model, to_file=train.outputDir+'model.eps')
# convert eps to png
command = ['convert', '-density', '300', train.outputDir+'model.eps', train.outputDir+'model.png']
result = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
print(train.keras_model.summary())
model, history = train.trainModel(nepochs=500,
batchsize=5000,
stop_patience=100,
lr_factor=0.8,
lr_patience=10,
lr_epsilon=0.0001,
lr_cooldown=8,
lr_minimum=0.00000001,
maxqsize=10,
verbose=1,
)
| [
11748,
28686,
198,
418,
13,
268,
2268,
17816,
41374,
1581,
16448,
6158,
20520,
796,
366,
25101,
1,
198,
6738,
10766,
42273,
14055,
13,
34409,
13,
34409,
62,
8692,
1330,
3047,
62,
8692,
198,
6738,
22014,
274,
1330,
2994,
62,
45,
3069,
11,
2994,
62,
1326,
504,
421,
1144,
220,
220,
220,
198,
6738,
10766,
42273,
14055,
13,
4666,
2120,
10141,
1330,
4259,
43,
6962,
4264,
1397,
11,
4798,
49925,
18943,
418,
1870,
1135,
2337,
198,
198,
11748,
850,
14681,
198,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
41927,
292,
1330,
30203,
355,
479,
198,
198,
11250,
796,
48700,
13,
16934,
2964,
1462,
3419,
198,
11250,
13,
46999,
62,
25811,
13,
12154,
62,
27922,
796,
6407,
198,
11250,
13,
46999,
62,
25811,
13,
525,
62,
14681,
62,
46999,
62,
31673,
62,
69,
7861,
796,
657,
13,
21,
198,
74,
13,
83,
22854,
11125,
62,
1891,
437,
13,
2617,
62,
29891,
7,
27110,
13,
36044,
7,
11250,
28,
11250,
4008,
628,
198,
198,
2,
27432,
28,
34409,
62,
8692,
7,
9288,
5143,
28,
25101,
11,
918,
413,
83,
482,
641,
28,
17821,
11,
1904,
8579,
50,
28,
25101,
11,
1904,
43775,
28,
17821,
8,
198,
27432,
28,
34409,
62,
8692,
7,
9288,
5143,
28,
25101,
11,
918,
413,
83,
482,
641,
28,
17821,
11,
1904,
8579,
50,
28,
25101,
11,
1904,
43775,
28,
25101,
8,
198,
198,
361,
407,
4512,
13,
19849,
7248,
33529,
198,
220,
220,
220,
422,
4981,
1330,
2746,
62,
10989,
51,
559,
26687,
355,
3047,
17633,
198,
220,
220,
220,
1303,
6738,
4981,
1330,
2746,
62,
10989,
51,
559,
35,
1072,
355,
3047,
17633,
628,
220,
220,
220,
40522,
796,
37250,
20541,
41707,
13155,
69,
41707,
37659,
69,
41707,
21370,
20520,
198,
220,
220,
220,
1303,
19608,
292,
1039,
796,
37250,
20541,
20520,
628,
220,
220,
220,
4512,
13,
2617,
17633,
7,
34409,
17633,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
40522,
28,
19608,
292,
1039,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4268,
448,
32184,
28,
15,
13,
16,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12858,
28,
15,
13,
24,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15458,
27237,
28,
25101,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6795,
28,
19,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9647,
28,
2167,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3912,
41888,
2624,
11,
2624,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
198,
220,
220,
220,
4512,
13,
5589,
576,
17633,
7,
40684,
4873,
28,
15,
13,
18005,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2994,
28,
17816,
66,
2397,
12409,
62,
19692,
298,
28338,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
20731,
28,
17816,
4134,
23843,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2994,
62,
43775,
41888,
16,
13,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
1303,
27432,
13,
27432,
62,
7890,
13,
9806,
25876,
11505,
796,
352,
198,
220,
220,
220,
1303,
27432,
13,
2100,
62,
7890,
13,
9806,
25876,
11505,
796,
352,
198,
220,
220,
220,
220,
198,
220,
220,
220,
351,
1280,
7,
27432,
13,
22915,
35277,
1343,
705,
49736,
13,
14116,
41707,
86,
11537,
355,
277,
25,
198,
220,
220,
220,
220,
220,
220,
220,
4512,
13,
6122,
292,
62,
19849,
13,
49736,
7,
4798,
62,
22184,
28,
50033,
2124,
25,
277,
13,
13564,
7,
87,
1343,
705,
59,
77,
6,
4008,
198,
220,
220,
220,
220,
198,
220,
220,
220,
422,
41927,
292,
13,
26791,
1330,
7110,
62,
19849,
198,
220,
220,
220,
7110,
62,
19849,
7,
27432,
13,
6122,
292,
62,
19849,
11,
284,
62,
7753,
28,
27432,
13,
22915,
35277,
10,
6,
19849,
13,
25386,
11537,
628,
220,
220,
220,
1303,
10385,
304,
862,
284,
279,
782,
198,
220,
220,
220,
3141,
796,
37250,
1102,
1851,
3256,
705,
12,
43337,
3256,
705,
6200,
3256,
4512,
13,
22915,
35277,
10,
6,
19849,
13,
25386,
3256,
4512,
13,
22915,
35277,
10,
6,
19849,
13,
11134,
20520,
198,
220,
220,
220,
1255,
796,
850,
14681,
13,
47,
9654,
7,
21812,
11,
14367,
448,
28,
7266,
14681,
13,
47,
4061,
36,
11,
336,
1082,
81,
28,
7266,
14681,
13,
47,
4061,
36,
737,
10709,
5344,
3419,
628,
198,
4798,
7,
27432,
13,
6122,
292,
62,
19849,
13,
49736,
28955,
198,
198,
19849,
11,
2106,
796,
4512,
13,
27432,
17633,
7,
77,
538,
5374,
82,
28,
4059,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15458,
7857,
28,
27641,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2245,
62,
8071,
1240,
28,
3064,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
81,
62,
31412,
28,
15,
13,
23,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
81,
62,
8071,
1240,
28,
940,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
81,
62,
538,
18217,
261,
28,
15,
13,
18005,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
81,
62,
1073,
15041,
28,
23,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
81,
62,
39504,
28,
15,
13,
10535,
486,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3509,
80,
7857,
28,
940,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15942,
577,
28,
16,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
628
] | 1.92296 | 1,311 |
import cv2
cv2.namedWindow("test")
cv2.namedWindow("test1")
cam = cv2.VideoCapture(0)
detector = cv2.CascadeClassifier("haarcascade_frontalface_alt.xml")
while True:
temp , frame = cam.read()
if not temp:
break;
faces = detector.detectMultiScale(frame)
cv2.imshow("test1" , frame)
for face in faces:
a,b,c,d = face
cv2.rectangle(frame , (a , b ) , (a+c , b+d) ,(0 , 255 , 0) , 3)
cv2.imshow("test" , frame)
val = cv2.waitKey(1)
if val%256 == 27:
# ESC button pressed
break
cam.release()
cv2.destroyAllWindows()
| [
11748,
269,
85,
17,
198,
33967,
17,
13,
13190,
27703,
7203,
9288,
4943,
198,
33967,
17,
13,
13190,
27703,
7203,
9288,
16,
4943,
198,
20991,
796,
269,
85,
17,
13,
10798,
49630,
7,
15,
8,
198,
15255,
9250,
796,
269,
85,
17,
13,
34,
28966,
9487,
7483,
7203,
3099,
5605,
28966,
62,
8534,
1604,
558,
62,
2501,
13,
19875,
4943,
198,
4514,
6407,
25,
198,
220,
220,
220,
20218,
837,
5739,
796,
12172,
13,
961,
3419,
198,
220,
220,
220,
611,
407,
20218,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2270,
26,
198,
220,
220,
220,
6698,
796,
31029,
13,
15255,
478,
29800,
29990,
7,
14535,
8,
198,
220,
220,
220,
269,
85,
17,
13,
320,
12860,
7203,
9288,
16,
1,
837,
5739,
8,
198,
220,
220,
220,
329,
1986,
287,
6698,
25,
198,
220,
220,
220,
220,
220,
220,
220,
257,
11,
65,
11,
66,
11,
67,
796,
1986,
198,
220,
220,
220,
220,
220,
220,
220,
269,
85,
17,
13,
2554,
9248,
7,
14535,
837,
357,
64,
837,
275,
1267,
837,
357,
64,
10,
66,
837,
275,
10,
67,
8,
837,
7,
15,
837,
14280,
837,
657,
8,
837,
513,
8,
198,
220,
220,
220,
269,
85,
17,
13,
320,
12860,
7203,
9288,
1,
837,
5739,
8,
198,
220,
220,
220,
1188,
796,
269,
85,
17,
13,
17077,
9218,
7,
16,
8,
198,
220,
220,
220,
611,
1188,
4,
11645,
6624,
2681,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
40251,
4936,
12070,
198,
220,
220,
220,
220,
220,
220,
220,
2270,
198,
20991,
13,
20979,
3419,
198,
33967,
17,
13,
41659,
3237,
11209,
3419,
198
] | 2.143382 | 272 |
import pandas as pd
def assess_NA(data):
"""
Returns a pandas dataframe denoting the total number of NA values
and the percentage of NA values in each column.
The column names are noted on the index.
Parameters
----------
data: dataframe
"""
# pandas series denoting features and the sum of their null values
null_sum = data.isnull().sum() # instantiate columns for missing data
total = null_sum.sort_values(ascending=False)
percent = (((null_sum / len(data.index)) * 100).
round(2)).sort_values(ascending=False)
# concatenate along the columns to create the complete dataframe
df_NA = pd.concat([total, percent], axis=1,
keys=['Number of NA', 'Percent NA'])
# drop rows that don't have any missing data;
# omit if you want to keep all rows
df_NA = df_NA[(df_NA.T != 0).any()]
return df_NA
| [
11748,
19798,
292,
355,
279,
67,
201,
198,
201,
198,
201,
198,
4299,
4659,
62,
4535,
7,
7890,
2599,
201,
198,
220,
220,
220,
37227,
201,
198,
220,
220,
220,
16409,
257,
19798,
292,
1366,
14535,
2853,
10720,
262,
2472,
1271,
286,
11746,
3815,
201,
198,
220,
220,
220,
290,
262,
5873,
286,
11746,
3815,
287,
1123,
5721,
13,
201,
198,
220,
220,
220,
383,
5721,
3891,
389,
4367,
319,
262,
6376,
13,
201,
198,
201,
198,
220,
220,
220,
40117,
201,
198,
220,
220,
220,
24200,
438,
201,
198,
220,
220,
220,
1366,
25,
1366,
14535,
201,
198,
220,
220,
220,
37227,
201,
198,
220,
220,
220,
1303,
19798,
292,
2168,
2853,
10720,
3033,
290,
262,
2160,
286,
511,
9242,
3815,
201,
198,
220,
220,
220,
9242,
62,
16345,
796,
1366,
13,
271,
8423,
22446,
16345,
3419,
220,
1303,
9113,
9386,
15180,
329,
4814,
1366,
201,
198,
220,
220,
220,
2472,
796,
9242,
62,
16345,
13,
30619,
62,
27160,
7,
3372,
1571,
28,
25101,
8,
201,
198,
220,
220,
220,
1411,
796,
14808,
7,
8423,
62,
16345,
1220,
18896,
7,
7890,
13,
9630,
4008,
1635,
1802,
737,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2835,
7,
17,
29720,
30619,
62,
27160,
7,
3372,
1571,
28,
25101,
8,
201,
198,
201,
198,
220,
220,
220,
1303,
1673,
36686,
378,
1863,
262,
15180,
284,
2251,
262,
1844,
1366,
14535,
201,
198,
220,
220,
220,
47764,
62,
4535,
796,
279,
67,
13,
1102,
9246,
26933,
23350,
11,
1411,
4357,
16488,
28,
16,
11,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8251,
28,
17816,
15057,
286,
11746,
3256,
705,
31905,
11746,
6,
12962,
201,
198,
201,
198,
220,
220,
220,
1303,
4268,
15274,
326,
836,
470,
423,
597,
4814,
1366,
26,
201,
198,
220,
220,
220,
1303,
42848,
611,
345,
765,
284,
1394,
477,
15274,
201,
198,
220,
220,
220,
47764,
62,
4535,
796,
47764,
62,
4535,
58,
7,
7568,
62,
4535,
13,
51,
14512,
657,
737,
1092,
3419,
60,
201,
198,
201,
198,
220,
220,
220,
1441,
47764,
62,
4535,
201,
198,
201,
198
] | 2.550409 | 367 |
import colored | [
11748,
16396
] | 7 | 2 |
l = [['felipe', 99], ['tamara', 50], ['fernando', 60]]
l1 = sorted(l)
l = sorted(l)
print(l)
print(l1) | [
75,
796,
16410,
6,
69,
417,
3757,
3256,
7388,
4357,
37250,
83,
47848,
3256,
2026,
4357,
37250,
69,
13023,
78,
3256,
3126,
11907,
198,
75,
16,
796,
23243,
7,
75,
8,
198,
75,
796,
23243,
7,
75,
8,
198,
4798,
7,
75,
8,
198,
4798,
7,
75,
16,
8
] | 2.081633 | 49 |
"""
This module implements the `se interactive-replace` command.
"""
import argparse
import curses
from pathlib import Path
import os
from math import floor
from typing import Tuple
import regex
import se
TAB_SIZE = 8
def _get_text_dimensions(text: str) -> Tuple[int, int]:
"""
Get the number of rows and columns to fit the given text.
Returns (height, width)
"""
text_height = 0
text_width = 0
text = text.rstrip()
for line in text.split("\n"):
text_height = text_height + 1
line_length = 0
for char in line:
if char == "\t":
line_length = line_length + TAB_SIZE
else:
line_length = line_length + 1
if line_length > text_width:
text_width = line_length
return (text_height + 1, text_width + 1)
def _print_ui(screen, filepath: Path) -> None:
"""
Print the header and footer bars to the screen
"""
# Wipe the current screen, in case we resized
screen.clear()
screen_height, screen_width = screen.getmaxyx()
header_bar = str(filepath)
# If the filepath is longer than the screen, use the filename instead
if len(str(filepath)) > screen_width:
header_bar = str(filepath.name)
# Fill blank space in the header bar
fill_space = max(floor((screen_width - len(header_bar)) / 2), 0)
if fill_space:
header_bar = f"{' ': <{fill_space}}{header_bar}{' ': <{fill_space}}"
if len(header_bar) < screen_width:
header_bar = header_bar + " "
# Create the footer bar
# Be very careful with generating a footer of correct width, because unlike
# the header, a footer that is too long will cause curses to crash
footer_bar = "(y)es (n)o (a)ccept remaining (r)eject remaining (c)enter on match (q)uit"
if len(footer_bar) >= screen_width:
footer_bar = "y/n; a/r; c; q"
if len(footer_bar) >= screen_width:
footer_bar = ""
fill_space = max(screen_width - len(footer_bar) - 1, 0)
if fill_space:
footer_bar = f"{footer_bar}{' ': <{fill_space}}"
# Print the header and footer
screen.attron(curses.A_REVERSE)
screen.addstr(0, 0, header_bar)
# Make accelerators bold
footer_index = 0
for char in footer_bar:
if char == "(":
screen.attron(curses.A_BOLD)
# If the previous char was ), turn off bold
if footer_index > 0 and footer_bar[footer_index - 1] == ")":
screen.attroff(curses.A_BOLD)
screen.addstr(screen_height - 1, footer_index, char)
footer_index = footer_index + 1
# The bottom right corner has to be set with insch() for some reason
screen.insch(screen_height - 1, screen_width - 1, " ")
screen.attroff(curses.A_REVERSE)
screen.refresh()
def _get_center_of_match(text: str, match_start: int, match_end: int, screen_height: int, screen_width: int) -> Tuple[int, int]:
"""
Given the text, the start and end of the match, and the screen dimensions, return
a tuple representing the pad x and y that will result in the pad's
view being centered on the match.
"""
# Now we want to try to center the highlighted section on the screen
# First, get the row/col dimensions of the highlighted region
index = 0
highlight_start_x = 0
highlight_start_y = 0
highlight_end_x = 0
highlight_end_y = 0
for char in text:
if index < match_start:
if char == "\n":
highlight_start_y = highlight_start_y + 1
highlight_end_y = highlight_end_y + 1
highlight_start_x = 0
highlight_end_x = 0
elif char == "\t":
highlight_start_x = highlight_start_x + TAB_SIZE
highlight_end_x = highlight_end_x + TAB_SIZE
else:
highlight_start_x = highlight_start_x + 1
highlight_end_x = highlight_end_x + 1
index = index + 1
elif index < match_end:
if char == "\n":
highlight_end_y = highlight_end_y + 1
highlight_end_x = 0
elif char == "\t":
highlight_end_x = highlight_end_x + TAB_SIZE
else:
highlight_end_x = highlight_end_x + 1
index = index + 1
else:
break
pad_y = max(highlight_start_y - floor((highlight_start_y - highlight_end_y) / 2) - floor(screen_height / 2), 0)
pad_x = max(highlight_start_x - floor((highlight_start_x - highlight_end_x) / 2) - floor(screen_width / 2), 0)
return (pad_y, pad_x)
def _print_screen(screen, filepath: Path, text: str, start_matching_at: int, regex_search: str, regex_flags: int):
"""
Print the complete UI to the screen.
Returns a tuple of (pad, line_numbers_pad, pad_y, pad_x, match_start, match_end)
if there are more replacements to be made. If not, returns a tuple of
(None, None, 0, 0, 0, 0)
"""
# Get the dimensions of the complete text, and the terminal screen
text_height, text_width = _get_text_dimensions(text)
screen_height, screen_width = screen.getmaxyx()
line_numbers_height = text_height
line_numbers_width = len(str(text_height))
#print(line_numbers_height)
#exit()
# Create the line numbers pad
line_numbers_pad = curses.newpad(line_numbers_height, line_numbers_width)
# Reset the cursor
line_numbers_pad.addstr(0, 0, "")
line_numbers_pad.attron(curses.A_REVERSE)
line_numbers_pad.attron(curses.A_DIM)
# Add the line numbers
for i in range(line_numbers_height - 1):
line_numbers_pad.addstr(i, 0, f"{i + 1}".rjust(line_numbers_width))
# Create a new pad
pad = curses.newpad(text_height, text_width)
pad.keypad(True)
# Reset the cursor
pad.addstr(0, 0, "")
# Do we have a regex match in the text?
# We only consider text after the last completed match
match = regex.search(fr"{regex_search}", text[start_matching_at:], flags=regex_flags)
if not match:
return (None, None, 0, 0, 0, 0)
match_start = start_matching_at + match.start()
match_end = start_matching_at + match.end()
# Print the text preceding the match
pad.addstr(text[:match_start])
# Print the match itself, in reversed color
if curses.has_colors():
pad.addstr(text[match_start:match_end], curses.color_pair(1) | curses.A_BOLD)
else:
pad.attron(curses.A_REVERSE)
pad.addstr(text[match_start:match_end])
pad.attroff(curses.A_REVERSE)
# Print the text after the match
pad.addstr(text[match_end:len(text)])
pad_y, pad_x = _get_center_of_match(text, match_start, match_end, screen_height, screen_width)
# Print the header and footer
_print_ui(screen, filepath)
# Output to the screen
pad.refresh(pad_y, pad_x, 1, line_numbers_width, screen_height - 2, screen_width - 1)
line_numbers_pad.refresh(pad_y, 0, 1, 0, screen_height - 2, line_numbers_width)
return (pad, line_numbers_pad, pad_y, pad_x, match_start, match_end)
def interactive_replace(plain_output: bool) -> int: # pylint: disable=unused-argument
"""
Entry point for `se interactive-replace`
"""
parser = argparse.ArgumentParser(description="Perform an interactive search and replace on a list of files using Python-flavored regex. The view is scrolled using the arrow keys, with alt to scroll by page in any direction. Basic Emacs (default) or Vim style navigation is available. The following actions are possible: (y) Accept replacement. (n) Reject replacement. (a) Accept all remaining replacements in this file. (r) Reject all remaining replacements in this file. (c) Center on match. (q) Save this file and quit.")
parser.add_argument("-i", "--ignore-case", action="store_true", help="ignore case when matching; equivalent to regex.IGNORECASE")
parser.add_argument("-m", "--multiline", action="store_true", help="make `^` and `$` consider each line; equivalent to regex.MULTILINE")
parser.add_argument("-d", "--dot-all", action="store_true", help="make `.` match newlines; equivalent to regex.DOTALL")
parser.add_argument("-v", "--vim", action="store_true", help="use basic Vim-like navigation shortcuts")
parser.add_argument("regex", metavar="REGEX", help="a regex of the type accepted by Python’s `regex` library.")
parser.add_argument("replace", metavar="REPLACE", help="a replacement regex of the type accepted by Python’s `regex` library.")
parser.add_argument("targets", metavar="TARGET", nargs="+", help="a file or directory on which to perform the search and replace")
args = parser.parse_args()
# By default, the esc key has a delay before its delivered to curses.
# Set the delay to 0
os.environ.setdefault("ESCDELAY", "0")
# Save errors for later, because we can only print them after curses is
# deinitialized
errors = []
return_code = 0
nav_down = b"^N"
nav_up = b"^P"
nav_right = b"^F"
nav_left = b"^B"
if args.vim:
nav_down = b"j"
nav_up = b"k"
nav_right = b"l"
nav_left = b"h"
regex_flags = 0
if args.ignore_case:
regex_flags = regex_flags | regex.IGNORECASE
if args.multiline:
regex_flags = regex_flags | regex.MULTILINE
if args.dot_all:
regex_flags = regex_flags | regex.DOTALL
try:
# Initialize curses
screen = curses.initscr()
curses.start_color()
if curses.has_colors():
curses.init_pair(1, curses.COLOR_WHITE, curses.COLOR_BLUE)
# Disable the blinking cursor
try:
curses.curs_set(False)
# Because some terminals do not support the invisible cursor, proceeed
# if curs_set fails to change the visibility
except Exception:
pass
for filepath in se.get_target_filenames(args.targets, ".xhtml"):
try:
with open(filepath, "r", encoding="utf-8") as file:
xhtml = file.read()
except:
errors.append(f"Couldn’t open file: {filepath}")
return_code = se.InvalidFileException.code
continue
original_xhtml = xhtml
is_file_dirty = False
screen_height, screen_width = screen.getmaxyx()
# In curses terminology, a "pad" is a window that is larger than the viewport.
# Pads can be scrolled around.
# Create and output our initial pad
pad, line_numbers_pad, pad_y, pad_x, match_start, match_end = _print_screen(screen, filepath, xhtml, 0, args.regex, regex_flags)
while pad:
# Wait for input
char = pad.getch()
esc_pressed = False
alt_pressed = False
if char == 27: # ALT was pressed
pad.nodelay(True)
alt_pressed = True
char = pad.getch() # Get the key pressed after ALT
pad.nodelay(False)
if alt_pressed and char == -1: # ESC
esc_pressed = True
# We have input!
pad_height, pad_width = pad.getmaxyx()
_, line_numbers_width = line_numbers_pad.getmaxyx()
# Accept all remaining replacements and continue to the next file
if curses.keyname(char) in (b"a", b"A"):
xhtml = xhtml[:match_start] + regex.sub(fr"{args.regex}", fr"{args.replace}", xhtml[match_start:], flags=regex_flags)
# Can't check is_file_dirty, we have to compare file contents
if xhtml != original_xhtml:
with open(filepath, "w", encoding="utf-8") as file:
file.write(xhtml)
break
# Reject all remaining replacements and continue to the next file
if curses.keyname(char) in (b"r", b"R") or esc_pressed:
if is_file_dirty:
with open(filepath, "w", encoding="utf-8") as file:
file.write(xhtml)
break
# Save this file and quit immediately
if curses.keyname(char) in (b"q", b"Q"):
if is_file_dirty:
with open(filepath, "w", encoding="utf-8") as file:
file.write(xhtml)
# Throw a blank exception so that we break out of the loop
# and disinitialize curses in `finally`
raise Exception
if curses.keyname(char) in (b"y", b"Y"):
# Do the replacement, but starting from the beginning of the match in case we
# skipped replacements earlier
new_xhtml = xhtml[:match_start] + regex.sub(fr"{args.regex}", fr"{args.replace}", xhtml[match_start:], 1, flags=regex_flags)
# Our replacement has changed the XHTML string, so the
# match_end doesn't point to the right place any more.
# Update match_end to account for the change in string length
# caused by the replacement before passing it to _print_screen()
match_end = match_end + (len(new_xhtml) - len(xhtml))
is_file_dirty = True
# OK, now set our xhtml to the replaced version
xhtml = new_xhtml
pad, line_numbers_pad, pad_y, pad_x, match_start, match_end = _print_screen(screen, filepath, xhtml, match_end, args.regex, regex_flags)
if curses.keyname(char) in (b"n", b"N"):
# Skip this match
pad, line_numbers_pad, pad_y, pad_x, match_start, match_end = _print_screen(screen, filepath, xhtml, match_end, args.regex, regex_flags)
# Center on the match
if curses.keyname(char) in (b"c", b"C"):
pad_y, pad_x = _get_center_of_match(xhtml, match_start, match_end, screen_height, screen_width)
pad.refresh(pad_y, pad_x, 1, line_numbers_width, screen_height - 2, screen_width - 1)
line_numbers_pad.refresh(pad_y, 0, 1, 0, screen_height - 2, line_numbers_width)
# The terminal has been resized, redraw the UI
if curses.keyname(char) == b"KEY_RESIZE":
screen_height, screen_width = screen.getmaxyx()
# Note that we pass match_start instead of match_end to print screen, so that we don't
# appear to increment the search when we resize!
pad, line_numbers_pad, pad_y, pad_x, _, _ = _print_screen(screen, filepath, xhtml, match_start, args.regex, regex_flags)
if curses.keyname(char) in (b"KEY_DOWN", nav_down):
if pad_height - pad_y - screen_height >= 0:
pad_y = pad_y + 1
pad.refresh(pad_y, pad_x, 1, line_numbers_width, screen_height - 2, screen_width - 1)
line_numbers_pad.refresh(pad_y, 0, 1, 0, screen_height - 2, line_numbers_width)
if curses.keyname(char) in (b"KEY_UP", nav_up):
if pad_y > 0:
pad_y = pad_y - 1
pad.refresh(pad_y, pad_x, 1, line_numbers_width, screen_height - 2, screen_width - 1)
line_numbers_pad.refresh(pad_y, 0, 1, 0, screen_height - 2, line_numbers_width)
# pgdown or alt + down, which has its own keycode
if curses.keyname(char) in (b"KEY_NPAGE", b"kDN3") or (not args.vim and curses.keyname(char) == b"^V") or (args.vim and curses.keyname(char) == b"^F"):
if pad_height - pad_y - screen_height > 0:
pad_y = pad_y + screen_height
if pad_y + screen_height > pad_height:
pad_y = pad_height - screen_height + 1
pad.refresh(pad_y, pad_x, 1, line_numbers_width, screen_height - 2, screen_width - 1)
line_numbers_pad.refresh(pad_y, 0, 1, 0, screen_height - 2, line_numbers_width)
# pgup or alt + up, which has its own keycode
if curses.keyname(char) in (b"KEY_PPAGE", b"kUP3") or (not args.vim and alt_pressed and curses.keyname(char) == b"v") or (args.vim and curses.keyname(char) == b"^B"):
if pad_y > 0:
pad_y = max(pad_y - screen_height, 0)
pad.refresh(pad_y, pad_x, 1, line_numbers_width, screen_height - 2, screen_width - 1)
line_numbers_pad.refresh(pad_y, 0, 1, 0, screen_height - 2, line_numbers_width)
if curses.keyname(char) in (b"KEY_RIGHT", nav_right):
if pad_width - pad_x - screen_width + line_numbers_width > 1:
pad_x = pad_x + 1
pad.refresh(pad_y, pad_x, 1, line_numbers_width, screen_height - 2, screen_width - 1)
if curses.keyname(char) in (b"KEY_LEFT", nav_left):
if pad_x > 0:
pad_x = pad_x - 1
pad.refresh(pad_y, pad_x, 1, line_numbers_width, screen_height - 2, screen_width - 1)
# alt + right, which as its own key code
if curses.keyname(char) == b"kRIT3":
if pad_width - pad_x - screen_width + line_numbers_width > 1:
pad_x = pad_x + screen_width - line_numbers_width
if pad_x + screen_width >= pad_width:
pad_x = pad_width - screen_width + line_numbers_width - 1
pad.refresh(pad_y, pad_x, 1, line_numbers_width, screen_height - 2, screen_width - 1)
# alt + left, which as its own key code
if curses.keyname(char) == b"kLFT3":
if pad_x > 0:
pad_x = max(pad_x - screen_width, 0)
pad.refresh(pad_y, pad_x, 1, line_numbers_width, screen_height - 2, screen_width - 1)
if is_file_dirty:
with open(filepath, "w", encoding="utf-8") as file:
file.write(xhtml)
except Exception as ex:
# We check for the `pattern` attr instead of catching
# regex._regex_core.error because the regex error type is
# private and pylint will complain
if hasattr(ex, "pattern"):
errors.append(f"Invalid regular expression: {ex}")
return_code = se.InvalidInputException.code
# We may get here if we pressed `q`
finally:
curses.endwin()
for error in errors:
se.print_error(error)
return return_code
| [
37811,
198,
1212,
8265,
23986,
262,
4600,
325,
14333,
12,
33491,
63,
3141,
13,
198,
37811,
198,
198,
11748,
1822,
29572,
198,
11748,
43878,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
28686,
198,
6738,
10688,
1330,
4314,
198,
6738,
19720,
1330,
309,
29291,
198,
198,
11748,
40364,
198,
198,
11748,
384,
628,
198,
5603,
33,
62,
33489,
796,
807,
628,
198,
4299,
4808,
1136,
62,
5239,
62,
27740,
5736,
7,
5239,
25,
965,
8,
4613,
309,
29291,
58,
600,
11,
493,
5974,
198,
197,
37811,
198,
197,
3855,
262,
1271,
286,
15274,
290,
15180,
284,
4197,
262,
1813,
2420,
13,
628,
197,
35561,
357,
17015,
11,
9647,
8,
198,
197,
37811,
628,
197,
5239,
62,
17015,
796,
657,
198,
197,
5239,
62,
10394,
796,
657,
628,
197,
5239,
796,
2420,
13,
81,
36311,
3419,
628,
197,
1640,
1627,
287,
2420,
13,
35312,
7203,
59,
77,
1,
2599,
198,
197,
197,
5239,
62,
17015,
796,
2420,
62,
17015,
1343,
352,
628,
197,
197,
1370,
62,
13664,
796,
657,
198,
197,
197,
1640,
1149,
287,
1627,
25,
198,
197,
197,
197,
361,
1149,
6624,
37082,
83,
1298,
198,
197,
197,
197,
197,
1370,
62,
13664,
796,
1627,
62,
13664,
1343,
309,
6242,
62,
33489,
198,
197,
197,
197,
17772,
25,
198,
197,
197,
197,
197,
1370,
62,
13664,
796,
1627,
62,
13664,
1343,
352,
628,
197,
197,
361,
1627,
62,
13664,
1875,
2420,
62,
10394,
25,
198,
197,
197,
197,
5239,
62,
10394,
796,
1627,
62,
13664,
628,
197,
7783,
357,
5239,
62,
17015,
1343,
352,
11,
2420,
62,
10394,
1343,
352,
8,
198,
198,
4299,
4808,
4798,
62,
9019,
7,
9612,
11,
2393,
6978,
25,
10644,
8,
4613,
6045,
25,
198,
197,
37811,
198,
197,
18557,
262,
13639,
290,
2366,
263,
9210,
284,
262,
3159,
198,
197,
37811,
628,
197,
2,
370,
3757,
262,
1459,
3159,
11,
287,
1339,
356,
581,
1143,
198,
197,
9612,
13,
20063,
3419,
628,
197,
9612,
62,
17015,
11,
3159,
62,
10394,
796,
3159,
13,
1136,
76,
6969,
87,
3419,
628,
197,
25677,
62,
5657,
796,
965,
7,
7753,
6978,
8,
628,
197,
2,
1002,
262,
2393,
6978,
318,
2392,
621,
262,
3159,
11,
779,
262,
29472,
2427,
198,
197,
361,
18896,
7,
2536,
7,
7753,
6978,
4008,
1875,
3159,
62,
10394,
25,
198,
197,
197,
25677,
62,
5657,
796,
965,
7,
7753,
6978,
13,
3672,
8,
628,
197,
2,
27845,
9178,
2272,
287,
262,
13639,
2318,
198,
197,
20797,
62,
13200,
796,
3509,
7,
28300,
19510,
9612,
62,
10394,
532,
18896,
7,
25677,
62,
5657,
4008,
1220,
362,
828,
657,
8,
628,
197,
361,
6070,
62,
13200,
25,
198,
197,
197,
25677,
62,
5657,
796,
277,
1,
90,
6,
705,
25,
1279,
90,
20797,
62,
13200,
11709,
90,
25677,
62,
5657,
18477,
6,
705,
25,
1279,
90,
20797,
62,
13200,
11709,
1,
628,
197,
361,
18896,
7,
25677,
62,
5657,
8,
1279,
3159,
62,
10394,
25,
198,
197,
197,
25677,
62,
5657,
796,
13639,
62,
5657,
1343,
366,
366,
628,
197,
2,
13610,
262,
2366,
263,
2318,
198,
197,
2,
1355,
845,
8161,
351,
15453,
257,
2366,
263,
286,
3376,
9647,
11,
780,
5023,
198,
197,
2,
262,
13639,
11,
257,
2366,
263,
326,
318,
1165,
890,
481,
2728,
43878,
284,
7014,
198,
197,
5898,
263,
62,
5657,
796,
30629,
88,
8,
274,
357,
77,
8,
78,
357,
64,
8,
66,
984,
5637,
357,
81,
8,
68,
752,
5637,
357,
66,
8,
9255,
319,
2872,
357,
80,
8,
5013,
1,
628,
197,
361,
18896,
7,
5898,
263,
62,
5657,
8,
18189,
3159,
62,
10394,
25,
198,
197,
197,
5898,
263,
62,
5657,
796,
366,
88,
14,
77,
26,
257,
14,
81,
26,
269,
26,
10662,
1,
628,
197,
361,
18896,
7,
5898,
263,
62,
5657,
8,
18189,
3159,
62,
10394,
25,
198,
197,
197,
5898,
263,
62,
5657,
796,
13538,
628,
197,
20797,
62,
13200,
796,
3509,
7,
9612,
62,
10394,
532,
18896,
7,
5898,
263,
62,
5657,
8,
532,
352,
11,
657,
8,
628,
197,
361,
6070,
62,
13200,
25,
198,
197,
197,
5898,
263,
62,
5657,
796,
277,
1,
90,
5898,
263,
62,
5657,
18477,
6,
705,
25,
1279,
90,
20797,
62,
13200,
11709,
1,
628,
197,
2,
12578,
262,
13639,
290,
2366,
263,
198,
197,
9612,
13,
1078,
1313,
7,
66,
46998,
13,
32,
62,
2200,
28884,
36,
8,
198,
197,
9612,
13,
2860,
2536,
7,
15,
11,
657,
11,
13639,
62,
5657,
8,
628,
197,
2,
6889,
8320,
2024,
10758,
198,
197,
5898,
263,
62,
9630,
796,
657,
198,
197,
1640,
1149,
287,
2366,
263,
62,
5657,
25,
198,
197,
197,
361,
1149,
6624,
30629,
1298,
198,
197,
197,
197,
9612,
13,
1078,
1313,
7,
66,
46998,
13,
32,
62,
33,
15173,
8,
628,
197,
197,
2,
1002,
262,
2180,
1149,
373,
10612,
1210,
572,
10758,
198,
197,
197,
361,
2366,
263,
62,
9630,
1875,
657,
290,
2366,
263,
62,
5657,
58,
5898,
263,
62,
9630,
532,
352,
60,
6624,
366,
8,
1298,
198,
197,
197,
197,
9612,
13,
1078,
305,
487,
7,
66,
46998,
13,
32,
62,
33,
15173,
8,
628,
197,
197,
9612,
13,
2860,
2536,
7,
9612,
62,
17015,
532,
352,
11,
2366,
263,
62,
9630,
11,
1149,
8,
198,
197,
197,
5898,
263,
62,
9630,
796,
2366,
263,
62,
9630,
1343,
352,
198,
197,
2,
383,
4220,
826,
5228,
468,
284,
307,
900,
351,
1035,
354,
3419,
329,
617,
1738,
198,
197,
9612,
13,
1040,
354,
7,
9612,
62,
17015,
532,
352,
11,
3159,
62,
10394,
532,
352,
11,
366,
366,
8,
198,
197,
9612,
13,
1078,
305,
487,
7,
66,
46998,
13,
32,
62,
2200,
28884,
36,
8,
628,
197,
9612,
13,
5420,
3447,
3419,
198,
198,
4299,
4808,
1136,
62,
16159,
62,
1659,
62,
15699,
7,
5239,
25,
965,
11,
2872,
62,
9688,
25,
493,
11,
2872,
62,
437,
25,
493,
11,
3159,
62,
17015,
25,
493,
11,
3159,
62,
10394,
25,
493,
8,
4613,
309,
29291,
58,
600,
11,
493,
5974,
198,
197,
37811,
198,
197,
15056,
262,
2420,
11,
262,
923,
290,
886,
286,
262,
2872,
11,
290,
262,
3159,
15225,
11,
1441,
198,
197,
64,
46545,
10200,
262,
14841,
2124,
290,
331,
326,
481,
1255,
287,
262,
14841,
338,
198,
197,
1177,
852,
19254,
319,
262,
2872,
13,
198,
197,
37811,
628,
197,
2,
2735,
356,
765,
284,
1949,
284,
3641,
262,
14537,
2665,
319,
262,
3159,
198,
197,
2,
3274,
11,
651,
262,
5752,
14,
4033,
15225,
286,
262,
14537,
3814,
198,
197,
9630,
796,
657,
198,
197,
8929,
2971,
62,
9688,
62,
87,
796,
657,
198,
197,
8929,
2971,
62,
9688,
62,
88,
796,
657,
198,
197,
8929,
2971,
62,
437,
62,
87,
796,
657,
198,
197,
8929,
2971,
62,
437,
62,
88,
796,
657,
198,
197,
1640,
1149,
287,
2420,
25,
198,
197,
197,
361,
6376,
1279,
2872,
62,
9688,
25,
198,
197,
197,
197,
361,
1149,
6624,
37082,
77,
1298,
198,
197,
197,
197,
197,
8929,
2971,
62,
9688,
62,
88,
796,
7238,
62,
9688,
62,
88,
1343,
352,
198,
197,
197,
197,
197,
8929,
2971,
62,
437,
62,
88,
796,
7238,
62,
437,
62,
88,
1343,
352,
198,
197,
197,
197,
197,
8929,
2971,
62,
9688,
62,
87,
796,
657,
198,
197,
197,
197,
197,
8929,
2971,
62,
437,
62,
87,
796,
657,
198,
197,
197,
197,
417,
361,
1149,
6624,
37082,
83,
1298,
198,
197,
197,
197,
197,
8929,
2971,
62,
9688,
62,
87,
796,
7238,
62,
9688,
62,
87,
1343,
309,
6242,
62,
33489,
198,
197,
197,
197,
197,
8929,
2971,
62,
437,
62,
87,
796,
7238,
62,
437,
62,
87,
1343,
309,
6242,
62,
33489,
198,
197,
197,
197,
17772,
25,
198,
197,
197,
197,
197,
8929,
2971,
62,
9688,
62,
87,
796,
7238,
62,
9688,
62,
87,
1343,
352,
198,
197,
197,
197,
197,
8929,
2971,
62,
437,
62,
87,
796,
7238,
62,
437,
62,
87,
1343,
352,
628,
197,
197,
197,
9630,
796,
6376,
1343,
352,
628,
197,
197,
417,
361,
6376,
1279,
2872,
62,
437,
25,
198,
197,
197,
197,
361,
1149,
6624,
37082,
77,
1298,
198,
197,
197,
197,
197,
8929,
2971,
62,
437,
62,
88,
796,
7238,
62,
437,
62,
88,
1343,
352,
198,
197,
197,
197,
197,
8929,
2971,
62,
437,
62,
87,
796,
657,
198,
197,
197,
197,
417,
361,
1149,
6624,
37082,
83,
1298,
198,
197,
197,
197,
197,
8929,
2971,
62,
437,
62,
87,
796,
7238,
62,
437,
62,
87,
1343,
309,
6242,
62,
33489,
198,
197,
197,
197,
17772,
25,
198,
197,
197,
197,
197,
8929,
2971,
62,
437,
62,
87,
796,
7238,
62,
437,
62,
87,
1343,
352,
628,
197,
197,
197,
9630,
796,
6376,
1343,
352,
628,
197,
197,
17772,
25,
198,
197,
197,
197,
9032,
628,
197,
15636,
62,
88,
796,
3509,
7,
8929,
2971,
62,
9688,
62,
88,
532,
4314,
19510,
8929,
2971,
62,
9688,
62,
88,
532,
7238,
62,
437,
62,
88,
8,
1220,
362,
8,
532,
4314,
7,
9612,
62,
17015,
1220,
362,
828,
657,
8,
198,
197,
15636,
62,
87,
796,
3509,
7,
8929,
2971,
62,
9688,
62,
87,
532,
4314,
19510,
8929,
2971,
62,
9688,
62,
87,
532,
7238,
62,
437,
62,
87,
8,
1220,
362,
8,
532,
4314,
7,
9612,
62,
10394,
1220,
362,
828,
657,
8,
628,
197,
7783,
357,
15636,
62,
88,
11,
14841,
62,
87,
8,
198,
198,
4299,
4808,
4798,
62,
9612,
7,
9612,
11,
2393,
6978,
25,
10644,
11,
2420,
25,
965,
11,
923,
62,
15699,
278,
62,
265,
25,
493,
11,
40364,
62,
12947,
25,
965,
11,
40364,
62,
33152,
25,
493,
2599,
198,
197,
37811,
198,
197,
18557,
262,
1844,
12454,
284,
262,
3159,
13,
628,
197,
35561,
257,
46545,
286,
357,
15636,
11,
1627,
62,
77,
17024,
62,
15636,
11,
14841,
62,
88,
11,
14841,
62,
87,
11,
2872,
62,
9688,
11,
2872,
62,
437,
8,
198,
197,
361,
612,
389,
517,
36205,
284,
307,
925,
13,
1002,
407,
11,
5860,
257,
46545,
286,
198,
197,
7,
14202,
11,
6045,
11,
657,
11,
657,
11,
657,
11,
657,
8,
198,
197,
37811,
628,
197,
2,
3497,
262,
15225,
286,
262,
1844,
2420,
11,
290,
262,
12094,
3159,
198,
197,
5239,
62,
17015,
11,
2420,
62,
10394,
796,
4808,
1136,
62,
5239,
62,
27740,
5736,
7,
5239,
8,
198,
197,
9612,
62,
17015,
11,
3159,
62,
10394,
796,
3159,
13,
1136,
76,
6969,
87,
3419,
198,
197,
1370,
62,
77,
17024,
62,
17015,
796,
2420,
62,
17015,
198,
197,
1370,
62,
77,
17024,
62,
10394,
796,
18896,
7,
2536,
7,
5239,
62,
17015,
4008,
628,
197,
2,
4798,
7,
1370,
62,
77,
17024,
62,
17015,
8,
198,
197,
2,
37023,
3419,
628,
197,
2,
13610,
262,
1627,
3146,
14841,
198,
197,
1370,
62,
77,
17024,
62,
15636,
796,
43878,
13,
3605,
15636,
7,
1370,
62,
77,
17024,
62,
17015,
11,
1627,
62,
77,
17024,
62,
10394,
8,
198,
197,
2,
30027,
262,
23493,
198,
197,
1370,
62,
77,
17024,
62,
15636,
13,
2860,
2536,
7,
15,
11,
657,
11,
366,
4943,
198,
197,
1370,
62,
77,
17024,
62,
15636,
13,
1078,
1313,
7,
66,
46998,
13,
32,
62,
2200,
28884,
36,
8,
198,
197,
1370,
62,
77,
17024,
62,
15636,
13,
1078,
1313,
7,
66,
46998,
13,
32,
62,
35,
3955,
8,
198,
197,
2,
3060,
262,
1627,
3146,
198,
197,
1640,
1312,
287,
2837,
7,
1370,
62,
77,
17024,
62,
17015,
532,
352,
2599,
198,
197,
197,
1370,
62,
77,
17024,
62,
15636,
13,
2860,
2536,
7,
72,
11,
657,
11,
277,
1,
90,
72,
1343,
352,
92,
1911,
81,
3137,
7,
1370,
62,
77,
17024,
62,
10394,
4008,
628,
197,
2,
13610,
257,
649,
14841,
198,
197,
15636,
796,
43878,
13,
3605,
15636,
7,
5239,
62,
17015,
11,
2420,
62,
10394,
8,
198,
197,
15636,
13,
2539,
15636,
7,
17821,
8,
628,
197,
2,
30027,
262,
23493,
198,
197,
15636,
13,
2860,
2536,
7,
15,
11,
657,
11,
366,
4943,
628,
197,
2,
2141,
356,
423,
257,
40364,
2872,
287,
262,
2420,
30,
198,
197,
2,
775,
691,
2074,
2420,
706,
262,
938,
5668,
2872,
198,
197,
15699,
796,
40364,
13,
12947,
7,
8310,
1,
90,
260,
25636,
62,
12947,
92,
1600,
2420,
58,
9688,
62,
15699,
278,
62,
265,
25,
4357,
9701,
28,
260,
25636,
62,
33152,
8,
628,
197,
361,
407,
2872,
25,
198,
197,
197,
7783,
357,
14202,
11,
6045,
11,
657,
11,
657,
11,
657,
11,
657,
8,
628,
197,
15699,
62,
9688,
796,
923,
62,
15699,
278,
62,
265,
1343,
2872,
13,
9688,
3419,
198,
197,
15699,
62,
437,
796,
923,
62,
15699,
278,
62,
265,
1343,
2872,
13,
437,
3419,
628,
197,
2,
12578,
262,
2420,
18148,
262,
2872,
198,
197,
15636,
13,
2860,
2536,
7,
5239,
58,
25,
15699,
62,
9688,
12962,
198,
197,
2,
12578,
262,
2872,
2346,
11,
287,
17687,
3124,
198,
197,
361,
43878,
13,
10134,
62,
4033,
669,
33529,
198,
197,
197,
15636,
13,
2860,
2536,
7,
5239,
58,
15699,
62,
9688,
25,
15699,
62,
437,
4357,
43878,
13,
8043,
62,
24874,
7,
16,
8,
930,
43878,
13,
32,
62,
33,
15173,
8,
198,
197,
17772,
25,
198,
197,
197,
15636,
13,
1078,
1313,
7,
66,
46998,
13,
32,
62,
2200,
28884,
36,
8,
198,
197,
197,
15636,
13,
2860,
2536,
7,
5239,
58,
15699,
62,
9688,
25,
15699,
62,
437,
12962,
198,
197,
197,
15636,
13,
1078,
305,
487,
7,
66,
46998,
13,
32,
62,
2200,
28884,
36,
8,
198,
197,
2,
12578,
262,
2420,
706,
262,
2872,
198,
197,
15636,
13,
2860,
2536,
7,
5239,
58,
15699,
62,
437,
25,
11925,
7,
5239,
8,
12962,
628,
197,
15636,
62,
88,
11,
14841,
62,
87,
796,
4808,
1136,
62,
16159,
62,
1659,
62,
15699,
7,
5239,
11,
2872,
62,
9688,
11,
2872,
62,
437,
11,
3159,
62,
17015,
11,
3159,
62,
10394,
8,
628,
197,
2,
12578,
262,
13639,
290,
2366,
263,
198,
197,
62,
4798,
62,
9019,
7,
9612,
11,
2393,
6978,
8,
628,
197,
2,
25235,
284,
262,
3159,
198,
197,
15636,
13,
5420,
3447,
7,
15636,
62,
88,
11,
14841,
62,
87,
11,
352,
11,
1627,
62,
77,
17024,
62,
10394,
11,
3159,
62,
17015,
532,
362,
11,
3159,
62,
10394,
532,
352,
8,
628,
197,
1370,
62,
77,
17024,
62,
15636,
13,
5420,
3447,
7,
15636,
62,
88,
11,
657,
11,
352,
11,
657,
11,
3159,
62,
17015,
532,
362,
11,
1627,
62,
77,
17024,
62,
10394,
8,
628,
197,
7783,
357,
15636,
11,
1627,
62,
77,
17024,
62,
15636,
11,
14841,
62,
88,
11,
14841,
62,
87,
11,
2872,
62,
9688,
11,
2872,
62,
437,
8,
198,
198,
4299,
14333,
62,
33491,
7,
25638,
62,
22915,
25,
20512,
8,
4613,
493,
25,
1303,
279,
2645,
600,
25,
15560,
28,
403,
1484,
12,
49140,
198,
197,
37811,
198,
197,
30150,
966,
329,
4600,
325,
14333,
12,
33491,
63,
198,
197,
37811,
628,
197,
48610,
796,
1822,
29572,
13,
28100,
1713,
46677,
7,
11213,
2625,
5990,
687,
281,
14333,
2989,
290,
6330,
319,
257,
1351,
286,
3696,
1262,
11361,
12,
2704,
48275,
40364,
13,
383,
1570,
318,
629,
8375,
1262,
262,
15452,
8251,
11,
351,
5988,
284,
10743,
416,
2443,
287,
597,
4571,
13,
14392,
36447,
357,
12286,
8,
393,
36645,
3918,
16408,
318,
1695,
13,
383,
1708,
4028,
389,
1744,
25,
357,
88,
8,
21699,
9014,
13,
357,
77,
8,
797,
752,
9014,
13,
357,
64,
8,
21699,
477,
5637,
36205,
287,
428,
2393,
13,
357,
81,
8,
797,
752,
477,
5637,
36205,
287,
428,
2393,
13,
357,
66,
8,
3337,
319,
2872,
13,
357,
80,
8,
12793,
428,
2393,
290,
11238,
19570,
198,
197,
48610,
13,
2860,
62,
49140,
7203,
12,
72,
1600,
366,
438,
46430,
12,
7442,
1600,
2223,
2625,
8095,
62,
7942,
1600,
1037,
2625,
46430,
1339,
618,
12336,
26,
7548,
284,
40364,
13,
16284,
1581,
2943,
11159,
4943,
198,
197,
48610,
13,
2860,
62,
49140,
7203,
12,
76,
1600,
366,
438,
16680,
346,
500,
1600,
2223,
2625,
8095,
62,
7942,
1600,
1037,
2625,
15883,
4600,
61,
63,
290,
4600,
3,
63,
2074,
1123,
1627,
26,
7548,
284,
40364,
13,
44,
16724,
4146,
8881,
4943,
198,
197,
48610,
13,
2860,
62,
49140,
7203,
12,
67,
1600,
366,
438,
26518,
12,
439,
1600,
2223,
2625,
8095,
62,
7942,
1600,
1037,
2625,
15883,
4600,
13,
63,
2872,
649,
6615,
26,
7548,
284,
40364,
13,
35,
2394,
7036,
4943,
198,
197,
48610,
13,
2860,
62,
49140,
7203,
12,
85,
1600,
366,
438,
31124,
1600,
2223,
2625,
8095,
62,
7942,
1600,
1037,
2625,
1904,
4096,
36645,
12,
2339,
16408,
32953,
4943,
198,
197,
48610,
13,
2860,
62,
49140,
7203,
260,
25636,
1600,
1138,
615,
283,
2625,
31553,
6369,
1600,
1037,
2625,
64,
40364,
286,
262,
2099,
6292,
416,
11361,
447,
247,
82,
4600,
260,
25636,
63,
5888,
19570,
198,
197,
48610,
13,
2860,
62,
49140,
7203,
33491,
1600,
1138,
615,
283,
2625,
2200,
6489,
11598,
1600,
1037,
2625,
64,
9014,
40364,
286,
262,
2099,
6292,
416,
11361,
447,
247,
82,
4600,
260,
25636,
63,
5888,
19570,
198,
197,
48610,
13,
2860,
62,
49140,
7203,
83,
853,
1039,
1600,
1138,
615,
283,
2625,
51,
46095,
1600,
299,
22046,
2625,
10,
1600,
1037,
2625,
64,
2393,
393,
8619,
319,
543,
284,
1620,
262,
2989,
290,
6330,
4943,
198,
197,
22046,
796,
30751,
13,
29572,
62,
22046,
3419,
628,
197,
2,
2750,
4277,
11,
262,
3671,
1994,
468,
257,
5711,
878,
663,
6793,
284,
43878,
13,
198,
197,
2,
5345,
262,
5711,
284,
657,
198,
197,
418,
13,
268,
2268,
13,
2617,
12286,
7203,
1546,
8610,
3698,
4792,
1600,
366,
15,
4943,
628,
197,
2,
12793,
8563,
329,
1568,
11,
780,
356,
460,
691,
3601,
606,
706,
43878,
318,
198,
197,
2,
390,
17532,
198,
197,
48277,
796,
17635,
198,
197,
7783,
62,
8189,
796,
657,
628,
197,
28341,
62,
2902,
796,
275,
1,
61,
45,
1,
198,
197,
28341,
62,
929,
796,
275,
1,
61,
47,
1,
198,
197,
28341,
62,
3506,
796,
275,
1,
61,
37,
1,
198,
197,
28341,
62,
9464,
796,
275,
1,
61,
33,
1,
628,
197,
361,
26498,
13,
31124,
25,
198,
197,
197,
28341,
62,
2902,
796,
275,
1,
73,
1,
198,
197,
197,
28341,
62,
929,
796,
275,
1,
74,
1,
198,
197,
197,
28341,
62,
3506,
796,
275,
1,
75,
1,
198,
197,
197,
28341,
62,
9464,
796,
275,
1,
71,
1,
628,
197,
260,
25636,
62,
33152,
796,
657,
198,
197,
361,
26498,
13,
46430,
62,
7442,
25,
198,
197,
197,
260,
25636,
62,
33152,
796,
40364,
62,
33152,
930,
40364,
13,
16284,
1581,
2943,
11159,
628,
197,
361,
26498,
13,
16680,
346,
500,
25,
198,
197,
197,
260,
25636,
62,
33152,
796,
40364,
62,
33152,
930,
40364,
13,
44,
16724,
4146,
8881,
628,
197,
361,
26498,
13,
26518,
62,
439,
25,
198,
197,
197,
260,
25636,
62,
33152,
796,
40364,
62,
33152,
930,
40364,
13,
35,
2394,
7036,
628,
197,
28311,
25,
198,
197,
197,
2,
20768,
1096,
43878,
198,
197,
197,
9612,
796,
43878,
13,
259,
896,
6098,
3419,
198,
197,
197,
66,
46998,
13,
9688,
62,
8043,
3419,
198,
197,
197,
361,
43878,
13,
10134,
62,
4033,
669,
33529,
198,
197,
197,
197,
66,
46998,
13,
15003,
62,
24874,
7,
16,
11,
43878,
13,
46786,
62,
12418,
12709,
11,
43878,
13,
46786,
62,
9148,
8924,
8,
628,
197,
197,
2,
31529,
262,
43196,
23493,
198,
197,
197,
28311,
25,
198,
197,
197,
197,
66,
46998,
13,
66,
1834,
62,
2617,
7,
25101,
8,
198,
197,
197,
2,
4362,
617,
30237,
466,
407,
1104,
262,
14836,
23493,
11,
386,
344,
2308,
198,
197,
197,
2,
611,
13882,
62,
2617,
10143,
284,
1487,
262,
20742,
198,
197,
197,
16341,
35528,
25,
198,
197,
197,
197,
6603,
628,
197,
197,
1640,
2393,
6978,
287,
384,
13,
1136,
62,
16793,
62,
10379,
268,
1047,
7,
22046,
13,
83,
853,
1039,
11,
27071,
87,
6494,
1,
2599,
198,
197,
197,
197,
28311,
25,
198,
197,
197,
197,
197,
4480,
1280,
7,
7753,
6978,
11,
366,
81,
1600,
21004,
2625,
40477,
12,
23,
4943,
355,
2393,
25,
198,
197,
197,
197,
197,
197,
87,
6494,
796,
2393,
13,
961,
3419,
198,
197,
197,
197,
16341,
25,
198,
197,
197,
197,
197,
48277,
13,
33295,
7,
69,
1,
23722,
77,
447,
247,
83,
1280,
2393,
25,
1391,
7753,
6978,
92,
4943,
198,
197,
197,
197,
197,
7783,
62,
8189,
796,
384,
13,
44651,
8979,
16922,
13,
8189,
198,
197,
197,
197,
197,
43043,
628,
197,
197,
197,
14986,
62,
87,
6494,
796,
2124,
6494,
198,
197,
197,
197,
271,
62,
7753,
62,
49075,
796,
10352,
628,
197,
197,
197,
9612,
62,
17015,
11,
3159,
62,
10394,
796,
3159,
13,
1136,
76,
6969,
87,
3419,
628,
197,
197,
197,
2,
554,
43878,
29191,
11,
257,
366,
15636,
1,
318,
257,
4324,
326,
318,
4025,
621,
262,
1570,
634,
13,
198,
197,
197,
197,
2,
350,
5643,
460,
307,
629,
8375,
1088,
13,
198,
197,
197,
197,
2,
13610,
290,
5072,
674,
4238,
14841,
198,
197,
197,
197,
15636,
11,
1627,
62,
77,
17024,
62,
15636,
11,
14841,
62,
88,
11,
14841,
62,
87,
11,
2872,
62,
9688,
11,
2872,
62,
437,
796,
4808,
4798,
62,
9612,
7,
9612,
11,
2393,
6978,
11,
2124,
6494,
11,
657,
11,
26498,
13,
260,
25636,
11,
40364,
62,
33152,
8,
628,
197,
197,
197,
4514,
14841,
25,
198,
197,
197,
197,
197,
2,
16314,
329,
5128,
198,
197,
197,
197,
197,
10641,
796,
14841,
13,
1136,
354,
3419,
628,
197,
197,
197,
197,
3798,
62,
45477,
796,
10352,
198,
197,
197,
197,
197,
2501,
62,
45477,
796,
10352,
628,
197,
197,
197,
197,
361,
1149,
6624,
2681,
25,
1303,
8355,
51,
373,
12070,
198,
197,
197,
197,
197,
197,
15636,
13,
77,
375,
417,
323,
7,
17821,
8,
198,
197,
197,
197,
197,
197,
2501,
62,
45477,
796,
6407,
198,
197,
197,
197,
197,
197,
10641,
796,
14841,
13,
1136,
354,
3419,
1303,
3497,
262,
1994,
12070,
706,
8355,
51,
198,
197,
197,
197,
197,
197,
15636,
13,
77,
375,
417,
323,
7,
25101,
8,
628,
197,
197,
197,
197,
361,
5988,
62,
45477,
290,
1149,
6624,
532,
16,
25,
1303,
40251,
198,
197,
197,
197,
197,
197,
3798,
62,
45477,
796,
6407,
628,
197,
197,
197,
197,
2,
775,
423,
5128,
0,
628,
197,
197,
197,
197,
15636,
62,
17015,
11,
14841,
62,
10394,
796,
14841,
13,
1136,
76,
6969,
87,
3419,
198,
197,
197,
197,
197,
62,
11,
1627,
62,
77,
17024,
62,
10394,
796,
1627,
62,
77,
17024,
62,
15636,
13,
1136,
76,
6969,
87,
3419,
628,
197,
197,
197,
197,
2,
21699,
477,
5637,
36205,
290,
2555,
284,
262,
1306,
2393,
198,
197,
197,
197,
197,
361,
43878,
13,
365,
2047,
480,
7,
10641,
8,
287,
357,
65,
1,
64,
1600,
275,
1,
32,
1,
2599,
198,
197,
197,
197,
197,
197,
87,
6494,
796,
2124,
6494,
58,
25,
15699,
62,
9688,
60,
1343,
40364,
13,
7266,
7,
8310,
1,
90,
22046,
13,
260,
25636,
92,
1600,
1216,
1,
90,
22046,
13,
33491,
92,
1600,
2124,
6494,
58,
15699,
62,
9688,
25,
4357,
9701,
28,
260,
25636,
62,
33152,
8,
628,
197,
197,
197,
197,
197,
2,
1680,
470,
2198,
318,
62,
7753,
62,
49075,
11,
356,
423,
284,
8996,
2393,
10154,
198,
197,
197,
197,
197,
197,
361,
2124,
6494,
14512,
2656,
62,
87,
6494,
25,
198,
197,
197,
197,
197,
197,
197,
4480,
1280,
7,
7753,
6978,
11,
366,
86,
1600,
21004,
2625,
40477,
12,
23,
4943,
355,
2393,
25,
198,
197,
197,
197,
197,
197,
197,
197,
7753,
13,
13564,
7,
87,
6494,
8,
628,
197,
197,
197,
197,
197,
9032,
628,
197,
197,
197,
197,
2,
797,
752,
477,
5637,
36205,
290,
2555,
284,
262,
1306,
2393,
198,
197,
197,
197,
197,
361,
43878,
13,
365,
2047,
480,
7,
10641,
8,
287,
357,
65,
1,
81,
1600,
275,
1,
49,
4943,
393,
3671,
62,
45477,
25,
198,
197,
197,
197,
197,
197,
361,
318,
62,
7753,
62,
49075,
25,
198,
197,
197,
197,
197,
197,
197,
4480,
1280,
7,
7753,
6978,
11,
366,
86,
1600,
21004,
2625,
40477,
12,
23,
4943,
355,
2393,
25,
198,
197,
197,
197,
197,
197,
197,
197,
7753,
13,
13564,
7,
87,
6494,
8,
628,
197,
197,
197,
197,
197,
9032,
628,
197,
197,
197,
197,
2,
12793,
428,
2393,
290,
11238,
3393,
198,
197,
197,
197,
197,
361,
43878,
13,
365,
2047,
480,
7,
10641,
8,
287,
357,
65,
1,
80,
1600,
275,
1,
48,
1,
2599,
198,
197,
197,
197,
197,
197,
361,
318,
62,
7753,
62,
49075,
25,
198,
197,
197,
197,
197,
197,
197,
4480,
1280,
7,
7753,
6978,
11,
366,
86,
1600,
21004,
2625,
40477,
12,
23,
4943,
355,
2393,
25,
198,
197,
197,
197,
197,
197,
197,
197,
7753,
13,
13564,
7,
87,
6494,
8,
628,
197,
197,
197,
197,
197,
2,
22481,
257,
9178,
6631,
523,
326,
356,
2270,
503,
286,
262,
9052,
198,
197,
197,
197,
197,
197,
2,
290,
595,
36733,
1096,
43878,
287,
4600,
69,
3289,
63,
198,
197,
197,
197,
197,
197,
40225,
35528,
628,
197,
197,
197,
197,
361,
43878,
13,
365,
2047,
480,
7,
10641,
8,
287,
357,
65,
1,
88,
1600,
275,
1,
56,
1,
2599,
198,
197,
197,
197,
197,
197,
2,
2141,
262,
9014,
11,
475,
3599,
422,
262,
3726,
286,
262,
2872,
287,
1339,
356,
198,
197,
197,
197,
197,
197,
2,
26684,
36205,
2961,
198,
197,
197,
197,
197,
197,
3605,
62,
87,
6494,
796,
2124,
6494,
58,
25,
15699,
62,
9688,
60,
1343,
40364,
13,
7266,
7,
8310,
1,
90,
22046,
13,
260,
25636,
92,
1600,
1216,
1,
90,
22046,
13,
33491,
92,
1600,
2124,
6494,
58,
15699,
62,
9688,
25,
4357,
352,
11,
9701,
28,
260,
25636,
62,
33152,
8,
628,
197,
197,
197,
197,
197,
2,
3954,
9014,
468,
3421,
262,
1395,
28656,
4731,
11,
523,
262,
198,
197,
197,
197,
197,
197,
2,
2872,
62,
437,
1595,
470,
966,
284,
262,
826,
1295,
597,
517,
13,
198,
197,
197,
197,
197,
197,
2,
10133,
2872,
62,
437,
284,
1848,
329,
262,
1487,
287,
4731,
4129,
198,
197,
197,
197,
197,
197,
2,
4073,
416,
262,
9014,
878,
6427,
340,
284,
4808,
4798,
62,
9612,
3419,
198,
197,
197,
197,
197,
197,
15699,
62,
437,
796,
2872,
62,
437,
1343,
357,
11925,
7,
3605,
62,
87,
6494,
8,
532,
18896,
7,
87,
6494,
4008,
628,
197,
197,
197,
197,
197,
271,
62,
7753,
62,
49075,
796,
6407,
628,
197,
197,
197,
197,
197,
2,
7477,
11,
783,
900,
674,
2124,
6494,
284,
262,
6928,
2196,
198,
197,
197,
197,
197,
197,
87,
6494,
796,
649,
62,
87,
6494,
628,
197,
197,
197,
197,
197,
15636,
11,
1627,
62,
77,
17024,
62,
15636,
11,
14841,
62,
88,
11,
14841,
62,
87,
11,
2872,
62,
9688,
11,
2872,
62,
437,
796,
4808,
4798,
62,
9612,
7,
9612,
11,
2393,
6978,
11,
2124,
6494,
11,
2872,
62,
437,
11,
26498,
13,
260,
25636,
11,
40364,
62,
33152,
8,
628,
197,
197,
197,
197,
361,
43878,
13,
365,
2047,
480,
7,
10641,
8,
287,
357,
65,
1,
77,
1600,
275,
1,
45,
1,
2599,
198,
197,
197,
197,
197,
197,
2,
32214,
428,
2872,
198,
197,
197,
197,
197,
197,
15636,
11,
1627,
62,
77,
17024,
62,
15636,
11,
14841,
62,
88,
11,
14841,
62,
87,
11,
2872,
62,
9688,
11,
2872,
62,
437,
796,
4808,
4798,
62,
9612,
7,
9612,
11,
2393,
6978,
11,
2124,
6494,
11,
2872,
62,
437,
11,
26498,
13,
260,
25636,
11,
40364,
62,
33152,
8,
628,
197,
197,
197,
197,
2,
3337,
319,
262,
2872,
198,
197,
197,
197,
197,
361,
43878,
13,
365,
2047,
480,
7,
10641,
8,
287,
357,
65,
1,
66,
1600,
275,
1,
34,
1,
2599,
198,
197,
197,
197,
197,
197,
15636,
62,
88,
11,
14841,
62,
87,
796,
4808,
1136,
62,
16159,
62,
1659,
62,
15699,
7,
87,
6494,
11,
2872,
62,
9688,
11,
2872,
62,
437,
11,
3159,
62,
17015,
11,
3159,
62,
10394,
8,
628,
197,
197,
197,
197,
197,
15636,
13,
5420,
3447,
7,
15636,
62,
88,
11,
14841,
62,
87,
11,
352,
11,
1627,
62,
77,
17024,
62,
10394,
11,
3159,
62,
17015,
532,
362,
11,
3159,
62,
10394,
532,
352,
8,
198,
197,
197,
197,
197,
197,
1370,
62,
77,
17024,
62,
15636,
13,
5420,
3447,
7,
15636,
62,
88,
11,
657,
11,
352,
11,
657,
11,
3159,
62,
17015,
532,
362,
11,
1627,
62,
77,
17024,
62,
10394,
8,
628,
197,
197,
197,
197,
2,
383,
12094,
468,
587,
581,
1143,
11,
2266,
1831,
262,
12454,
198,
197,
197,
197,
197,
361,
43878,
13,
365,
2047,
480,
7,
10641,
8,
6624,
275,
1,
20373,
62,
19535,
35400,
1298,
198,
197,
197,
197,
197,
197,
9612,
62,
17015,
11,
3159,
62,
10394,
796,
3159,
13,
1136,
76,
6969,
87,
3419,
198,
197,
197,
197,
197,
197,
2,
5740,
326,
356,
1208,
2872,
62,
9688,
2427,
286,
2872,
62,
437,
284,
3601,
3159,
11,
523,
326,
356,
836,
470,
198,
197,
197,
197,
197,
197,
2,
1656,
284,
18703,
262,
2989,
618,
356,
47558,
0,
198,
197,
197,
197,
197,
197,
15636,
11,
1627,
62,
77,
17024,
62,
15636,
11,
14841,
62,
88,
11,
14841,
62,
87,
11,
4808,
11,
4808,
796,
4808,
4798,
62,
9612,
7,
9612,
11,
2393,
6978,
11,
2124,
6494,
11,
2872,
62,
9688,
11,
26498,
13,
260,
25636,
11,
40364,
62,
33152,
8,
628,
197,
197,
197,
197,
361,
43878,
13,
365,
2047,
480,
7,
10641,
8,
287,
357,
65,
1,
20373,
62,
41925,
1600,
6812,
62,
2902,
2599,
198,
197,
197,
197,
197,
197,
361,
14841,
62,
17015,
532,
14841,
62,
88,
532,
3159,
62,
17015,
18189,
657,
25,
198,
197,
197,
197,
197,
197,
197,
15636,
62,
88,
796,
14841,
62,
88,
1343,
352,
198,
197,
197,
197,
197,
197,
197,
15636,
13,
5420,
3447,
7,
15636,
62,
88,
11,
14841,
62,
87,
11,
352,
11,
1627,
62,
77,
17024,
62,
10394,
11,
3159,
62,
17015,
532,
362,
11,
3159,
62,
10394,
532,
352,
8,
198,
197,
197,
197,
197,
197,
197,
1370,
62,
77,
17024,
62,
15636,
13,
5420,
3447,
7,
15636,
62,
88,
11,
657,
11,
352,
11,
657,
11,
3159,
62,
17015,
532,
362,
11,
1627,
62,
77,
17024,
62,
10394,
8,
628,
197,
197,
197,
197,
361,
43878,
13,
365,
2047,
480,
7,
10641,
8,
287,
357,
65,
1,
20373,
62,
8577,
1600,
6812,
62,
929,
2599,
198,
197,
197,
197,
197,
197,
361,
14841,
62,
88,
1875,
657,
25,
198,
197,
197,
197,
197,
197,
197,
15636,
62,
88,
796,
14841,
62,
88,
532,
352,
198,
197,
197,
197,
197,
197,
197,
15636,
13,
5420,
3447,
7,
15636,
62,
88,
11,
14841,
62,
87,
11,
352,
11,
1627,
62,
77,
17024,
62,
10394,
11,
3159,
62,
17015,
532,
362,
11,
3159,
62,
10394,
532,
352,
8,
198,
197,
197,
197,
197,
197,
197,
1370,
62,
77,
17024,
62,
15636,
13,
5420,
3447,
7,
15636,
62,
88,
11,
657,
11,
352,
11,
657,
11,
3159,
62,
17015,
532,
362,
11,
1627,
62,
77,
17024,
62,
10394,
8,
628,
197,
197,
197,
197,
2,
23241,
2902,
393,
5988,
1343,
866,
11,
543,
468,
663,
898,
1994,
8189,
198,
197,
197,
197,
197,
361,
43878,
13,
365,
2047,
480,
7,
10641,
8,
287,
357,
65,
1,
20373,
62,
45,
4537,
8264,
1600,
275,
1,
74,
35504,
18,
4943,
393,
357,
1662,
26498,
13,
31124,
290,
43878,
13,
365,
2047,
480,
7,
10641,
8,
6624,
275,
1,
61,
53,
4943,
393,
357,
22046,
13,
31124,
290,
43878,
13,
365,
2047,
480,
7,
10641,
8,
6624,
275,
1,
61,
37,
1,
2599,
198,
197,
197,
197,
197,
197,
361,
14841,
62,
17015,
532,
14841,
62,
88,
532,
3159,
62,
17015,
1875,
657,
25,
198,
197,
197,
197,
197,
197,
197,
15636,
62,
88,
796,
14841,
62,
88,
1343,
3159,
62,
17015,
198,
197,
197,
197,
197,
197,
197,
361,
14841,
62,
88,
1343,
3159,
62,
17015,
1875,
14841,
62,
17015,
25,
198,
197,
197,
197,
197,
197,
197,
197,
15636,
62,
88,
796,
14841,
62,
17015,
532,
3159,
62,
17015,
1343,
352,
198,
197,
197,
197,
197,
197,
197,
15636,
13,
5420,
3447,
7,
15636,
62,
88,
11,
14841,
62,
87,
11,
352,
11,
1627,
62,
77,
17024,
62,
10394,
11,
3159,
62,
17015,
532,
362,
11,
3159,
62,
10394,
532,
352,
8,
198,
197,
197,
197,
197,
197,
197,
1370,
62,
77,
17024,
62,
15636,
13,
5420,
3447,
7,
15636,
62,
88,
11,
657,
11,
352,
11,
657,
11,
3159,
62,
17015,
532,
362,
11,
1627,
62,
77,
17024,
62,
10394,
8,
628,
197,
197,
197,
197,
2,
23241,
929,
393,
5988,
1343,
510,
11,
543,
468,
663,
898,
1994,
8189,
198,
197,
197,
197,
197,
361,
43878,
13,
365,
2047,
480,
7,
10641,
8,
287,
357,
65,
1,
20373,
62,
47,
4537,
8264,
1600,
275,
1,
74,
8577,
18,
4943,
393,
357,
1662,
26498,
13,
31124,
290,
5988,
62,
45477,
290,
43878,
13,
365,
2047,
480,
7,
10641,
8,
6624,
275,
1,
85,
4943,
393,
357,
22046,
13,
31124,
290,
43878,
13,
365,
2047,
480,
7,
10641,
8,
6624,
275,
1,
61,
33,
1,
2599,
198,
197,
197,
197,
197,
197,
361,
14841,
62,
88,
1875,
657,
25,
198,
197,
197,
197,
197,
197,
197,
15636,
62,
88,
796,
3509,
7,
15636,
62,
88,
532,
3159,
62,
17015,
11,
657,
8,
198,
197,
197,
197,
197,
197,
197,
15636,
13,
5420,
3447,
7,
15636,
62,
88,
11,
14841,
62,
87,
11,
352,
11,
1627,
62,
77,
17024,
62,
10394,
11,
3159,
62,
17015,
532,
362,
11,
3159,
62,
10394,
532,
352,
8,
198,
197,
197,
197,
197,
197,
197,
1370,
62,
77,
17024,
62,
15636,
13,
5420,
3447,
7,
15636,
62,
88,
11,
657,
11,
352,
11,
657,
11,
3159,
62,
17015,
532,
362,
11,
1627,
62,
77,
17024,
62,
10394,
8,
628,
197,
197,
197,
197,
361,
43878,
13,
365,
2047,
480,
7,
10641,
8,
287,
357,
65,
1,
20373,
62,
49,
9947,
1600,
6812,
62,
3506,
2599,
198,
197,
197,
197,
197,
197,
361,
14841,
62,
10394,
532,
14841,
62,
87,
532,
3159,
62,
10394,
1343,
1627,
62,
77,
17024,
62,
10394,
1875,
352,
25,
198,
197,
197,
197,
197,
197,
197,
15636,
62,
87,
796,
14841,
62,
87,
1343,
352,
198,
197,
197,
197,
197,
197,
197,
15636,
13,
5420,
3447,
7,
15636,
62,
88,
11,
14841,
62,
87,
11,
352,
11,
1627,
62,
77,
17024,
62,
10394,
11,
3159,
62,
17015,
532,
362,
11,
3159,
62,
10394,
532,
352,
8,
628,
197,
197,
197,
197,
361,
43878,
13,
365,
2047,
480,
7,
10641,
8,
287,
357,
65,
1,
20373,
62,
2538,
9792,
1600,
6812,
62,
9464,
2599,
198,
197,
197,
197,
197,
197,
361,
14841,
62,
87,
1875,
657,
25,
198,
197,
197,
197,
197,
197,
197,
15636,
62,
87,
796,
14841,
62,
87,
532,
352,
198,
197,
197,
197,
197,
197,
197,
15636,
13,
5420,
3447,
7,
15636,
62,
88,
11,
14841,
62,
87,
11,
352,
11,
1627,
62,
77,
17024,
62,
10394,
11,
3159,
62,
17015,
532,
362,
11,
3159,
62,
10394,
532,
352,
8,
628,
197,
197,
197,
197,
2,
5988,
1343,
826,
11,
543,
355,
663,
898,
1994,
2438,
198,
197,
197,
197,
197,
361,
43878,
13,
365,
2047,
480,
7,
10641,
8,
6624,
275,
1,
74,
49,
2043,
18,
1298,
198,
197,
197,
197,
197,
197,
361,
14841,
62,
10394,
532,
14841,
62,
87,
532,
3159,
62,
10394,
1343,
1627,
62,
77,
17024,
62,
10394,
1875,
352,
25,
198,
197,
197,
197,
197,
197,
197,
15636,
62,
87,
796,
14841,
62,
87,
1343,
3159,
62,
10394,
532,
1627,
62,
77,
17024,
62,
10394,
198,
197,
197,
197,
197,
197,
197,
361,
14841,
62,
87,
1343,
3159,
62,
10394,
18189,
14841,
62,
10394,
25,
198,
197,
197,
197,
197,
197,
197,
197,
15636,
62,
87,
796,
14841,
62,
10394,
532,
3159,
62,
10394,
1343,
1627,
62,
77,
17024,
62,
10394,
532,
352,
198,
197,
197,
197,
197,
197,
197,
15636,
13,
5420,
3447,
7,
15636,
62,
88,
11,
14841,
62,
87,
11,
352,
11,
1627,
62,
77,
17024,
62,
10394,
11,
3159,
62,
17015,
532,
362,
11,
3159,
62,
10394,
532,
352,
8,
628,
197,
197,
197,
197,
2,
5988,
1343,
1364,
11,
543,
355,
663,
898,
1994,
2438,
198,
197,
197,
197,
197,
361,
43878,
13,
365,
2047,
480,
7,
10641,
8,
6624,
275,
1,
74,
43,
9792,
18,
1298,
198,
197,
197,
197,
197,
197,
361,
14841,
62,
87,
1875,
657,
25,
198,
197,
197,
197,
197,
197,
197,
15636,
62,
87,
796,
3509,
7,
15636,
62,
87,
532,
3159,
62,
10394,
11,
657,
8,
198,
197,
197,
197,
197,
197,
197,
15636,
13,
5420,
3447,
7,
15636,
62,
88,
11,
14841,
62,
87,
11,
352,
11,
1627,
62,
77,
17024,
62,
10394,
11,
3159,
62,
17015,
532,
362,
11,
3159,
62,
10394,
532,
352,
8,
628,
197,
197,
197,
361,
318,
62,
7753,
62,
49075,
25,
198,
197,
197,
197,
197,
4480,
1280,
7,
7753,
6978,
11,
366,
86,
1600,
21004,
2625,
40477,
12,
23,
4943,
355,
2393,
25,
198,
197,
197,
197,
197,
197,
7753,
13,
13564,
7,
87,
6494,
8,
628,
197,
16341,
35528,
355,
409,
25,
198,
197,
197,
2,
775,
2198,
329,
262,
4600,
33279,
63,
708,
81,
2427,
286,
16508,
198,
197,
197,
2,
40364,
13557,
260,
25636,
62,
7295,
13,
18224,
780,
262,
40364,
4049,
2099,
318,
198,
197,
197,
2,
2839,
290,
279,
2645,
600,
481,
13121,
198,
197,
197,
361,
468,
35226,
7,
1069,
11,
366,
33279,
1,
2599,
198,
197,
197,
197,
48277,
13,
33295,
7,
69,
1,
44651,
3218,
5408,
25,
1391,
1069,
92,
4943,
198,
197,
197,
197,
7783,
62,
8189,
796,
384,
13,
44651,
20560,
16922,
13,
8189,
628,
197,
197,
2,
775,
743,
651,
994,
611,
356,
12070,
4600,
80,
63,
198,
197,
69,
3289,
25,
198,
197,
197,
66,
46998,
13,
437,
5404,
3419,
628,
197,
1640,
4049,
287,
8563,
25,
198,
197,
197,
325,
13,
4798,
62,
18224,
7,
18224,
8,
628,
197,
7783,
1441,
62,
8189,
198
] | 2.555872 | 6,327 |
default_style = {
'alpha': .6,
'width': 1,
'node_size': 100,
'node_color': '#2EB1E6',
'edge_color': '#cccccc',
}
solution_style = default_style.copy()
solution_style.update(node_color='#ff0000')
| [
12286,
62,
7635,
796,
1391,
198,
220,
220,
220,
705,
26591,
10354,
764,
21,
11,
198,
220,
220,
220,
705,
10394,
10354,
352,
11,
198,
220,
220,
220,
705,
17440,
62,
7857,
10354,
1802,
11,
198,
220,
220,
220,
705,
17440,
62,
8043,
10354,
705,
2,
17,
30195,
16,
36,
21,
3256,
198,
220,
220,
220,
705,
14907,
62,
8043,
10354,
705,
2,
535,
535,
535,
3256,
198,
92,
198,
198,
82,
2122,
62,
7635,
796,
4277,
62,
7635,
13,
30073,
3419,
198,
82,
2122,
62,
7635,
13,
19119,
7,
17440,
62,
8043,
11639,
2,
487,
2388,
11537,
198
] | 2.181818 | 99 |
"""empty message
Revision ID: bff862ed6870
Revises: 2ee4f69c4623
Create Date: 2019-11-28 17:42:47.448962
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = 'bff862ed6870'
down_revision = '2ee4f69c4623'
branch_labels = None
depends_on = None
| [
37811,
28920,
3275,
198,
198,
18009,
1166,
4522,
25,
275,
487,
4521,
17,
276,
3104,
2154,
198,
18009,
2696,
25,
362,
1453,
19,
69,
3388,
66,
3510,
1954,
198,
16447,
7536,
25,
13130,
12,
1157,
12,
2078,
1596,
25,
3682,
25,
2857,
13,
2598,
4531,
5237,
198,
198,
37811,
198,
6738,
31341,
2022,
291,
1330,
1034,
198,
11748,
44161,
282,
26599,
355,
473,
198,
6738,
44161,
282,
26599,
13,
38969,
478,
82,
1330,
48761,
198,
198,
2,
18440,
42814,
11,
973,
416,
9300,
2022,
291,
13,
198,
260,
10178,
796,
705,
65,
487,
4521,
17,
276,
3104,
2154,
6,
198,
2902,
62,
260,
10178,
796,
705,
17,
1453,
19,
69,
3388,
66,
3510,
1954,
6,
198,
1671,
3702,
62,
23912,
1424,
796,
6045,
198,
10378,
2412,
62,
261,
796,
6045,
628,
198
] | 2.545455 | 132 |
import random
import warnings
import numpy as np
from nose.tools import raises, assert_not_equal
from nose.tools import assert_true, assert_raises
from numpy.testing import assert_array_almost_equal
from numpy.testing import assert_array_equal
from numpy.testing import assert_equal, assert_almost_equal
from sklearn import datasets
from sklearn import svm
from sklearn.metrics import auc
from sklearn.metrics import classification_report
from sklearn.metrics import confusion_matrix
from sklearn.metrics import explained_variance_score
from sklearn.metrics import r2_score
from sklearn.metrics import f1_score
from sklearn.metrics import matthews_corrcoef
from sklearn.metrics import mean_squared_error
from sklearn.metrics import precision_recall_curve
from sklearn.metrics import precision_recall_fscore_support
from sklearn.metrics import precision_score
from sklearn.metrics import recall_score
from sklearn.metrics import roc_curve
from sklearn.metrics import auc_score
from sklearn.metrics import average_precision_score
from sklearn.metrics import zero_one
from sklearn.metrics import hinge_loss
def make_prediction(dataset=None, binary=False):
"""Make some classification predictions on a toy dataset using a SVC
If binary is True restrict to a binary classification problem instead of a
multiclass classification problem
"""
if dataset is None:
# import some data to play with
dataset = datasets.load_iris()
X = dataset.data
y = dataset.target
if binary:
# restrict to a binary classification task
X, y = X[y < 2], y[y < 2]
n_samples, n_features = X.shape
p = range(n_samples)
random.seed(0)
random.shuffle(p)
X, y = X[p], y[p]
half = int(n_samples / 2)
# add noisy features to make the problem harder and avoid perfect results
rng = np.random.RandomState(0)
X = np.c_[X, rng.randn(n_samples, 200 * n_features)]
# run classifier, get class probabilities and label predictions
clf = svm.SVC(kernel='linear', probability=True)
probas_pred = clf.fit(X[:half], y[:half]).predict_proba(X[half:])
if binary:
# only interested in probabilities of the positive case
# XXX: do we really want a special API for the binary case?
probas_pred = probas_pred[:, 1]
y_pred = clf.predict(X[half:])
y_true = y[half:]
return y_true, y_pred, probas_pred
def test_roc_curve():
"""Test Area under Receiver Operating Characteristic (ROC) curve"""
y_true, _, probas_pred = make_prediction(binary=True)
fpr, tpr, thresholds = roc_curve(y_true, probas_pred)
roc_auc = auc(fpr, tpr)
assert_array_almost_equal(roc_auc, 0.80, decimal=2)
assert_almost_equal(roc_auc, auc_score(y_true, probas_pred))
def test_roc_returns_consistency():
"""Test whether the returned threshold matches up with tpr"""
# make small toy dataset
y_true, _, probas_pred = make_prediction(binary=True)
fpr, tpr, thresholds = roc_curve(y_true, probas_pred)
# use the given thresholds to determine the tpr
tpr_correct = []
for t in range(len(thresholds)):
tp = np.sum((probas_pred >= thresholds[t]) & y_true)
p = np.sum(y_true)
tpr_correct.append(1.0 * tp / p)
# compare tpr and tpr_correct to see if the thresholds' order was correct
assert_array_almost_equal(tpr, tpr_correct, decimal=2)
@raises(ValueError)
def test_roc_curve_multi():
"""roc_curve not applicable for multi-class problems"""
y_true, _, probas_pred = make_prediction(binary=False)
fpr, tpr, thresholds = roc_curve(y_true, probas_pred)
def test_roc_curve_confidence():
"""roc_curve for confidence scores"""
y_true, _, probas_pred = make_prediction(binary=True)
fpr, tpr, thresholds = roc_curve(y_true, probas_pred - 0.5)
roc_auc = auc(fpr, tpr)
assert_array_almost_equal(roc_auc, 0.80, decimal=2)
def test_roc_curve_hard():
"""roc_curve for hard decisions"""
y_true, pred, probas_pred = make_prediction(binary=True)
# always predict one
trivial_pred = np.ones(y_true.shape)
fpr, tpr, thresholds = roc_curve(y_true, trivial_pred)
roc_auc = auc(fpr, tpr)
assert_array_almost_equal(roc_auc, 0.50, decimal=2)
# always predict zero
trivial_pred = np.zeros(y_true.shape)
fpr, tpr, thresholds = roc_curve(y_true, trivial_pred)
roc_auc = auc(fpr, tpr)
assert_array_almost_equal(roc_auc, 0.50, decimal=2)
# hard decisions
fpr, tpr, thresholds = roc_curve(y_true, pred)
roc_auc = auc(fpr, tpr)
assert_array_almost_equal(roc_auc, 0.74, decimal=2)
def test_auc():
"""Test Area Under Curve (AUC) computation"""
x = [0, 1]
y = [0, 1]
assert_array_almost_equal(auc(x, y), 0.5)
x = [1, 0]
y = [0, 1]
assert_array_almost_equal(auc(x, y), 0.5)
x = [0, 1]
y = [1, 1]
assert_array_almost_equal(auc(x, y), 1)
x = [0, 0.5, 1]
y = [0, 0.5, 1]
assert_array_almost_equal(auc(x, y), 0.5)
def test_precision_recall_f1_score_binary():
"""Test Precision Recall and F1 Score for binary classification task"""
y_true, y_pred, _ = make_prediction(binary=True)
# detailed measures for each class
p, r, f, s = precision_recall_fscore_support(y_true, y_pred, average=None)
assert_array_almost_equal(p, [0.73, 0.75], 2)
assert_array_almost_equal(r, [0.76, 0.72], 2)
assert_array_almost_equal(f, [0.75, 0.74], 2)
assert_array_equal(s, [25, 25])
# individual scoring function that can be used for grid search: in the
# binary class case the score is the value of the measure for the positive
# class (e.g. label == 1)
ps = precision_score(y_true, y_pred)
assert_array_almost_equal(ps, 0.75, 2)
rs = recall_score(y_true, y_pred)
assert_array_almost_equal(rs, 0.72, 2)
fs = f1_score(y_true, y_pred)
assert_array_almost_equal(fs, 0.74, 2)
def test_confusion_matrix_binary():
"""Test confusion matrix - binary classification case"""
y_true, y_pred, _ = make_prediction(binary=True)
cm = confusion_matrix(y_true, y_pred)
assert_array_equal(cm, [[19, 6], [7, 18]])
tp = cm[0, 0]
tn = cm[1, 1]
fp = cm[0, 1]
fn = cm[1, 0]
num = (tp * tn - fp * fn)
den = np.sqrt((tp + fp) * (tp + fn) * (tn + fp) * (tn + fn))
if den == 0.:
true_mcc = 0
else:
true_mcc = num / den
mcc = matthews_corrcoef(y_true, y_pred)
assert_array_almost_equal(mcc, true_mcc, decimal=2)
assert_array_almost_equal(mcc, 0.48, decimal=2)
def test_precision_recall_f1_score_multiclass():
"""Test Precision Recall and F1 Score for multiclass classification task"""
y_true, y_pred, _ = make_prediction(binary=False)
# compute scores with default labels introspection
p, r, f, s = precision_recall_fscore_support(y_true, y_pred, average=None)
assert_array_almost_equal(p, [0.82, 0.55, 0.47], 2)
assert_array_almost_equal(r, [0.92, 0.17, 0.90], 2)
assert_array_almost_equal(f, [0.87, 0.26, 0.62], 2)
assert_array_equal(s, [25, 30, 20])
# averaging tests
ps = precision_score(y_true, y_pred, pos_label=1, average='micro')
assert_array_almost_equal(ps, 0.61, 2)
rs = recall_score(y_true, y_pred, average='micro')
assert_array_almost_equal(rs, 0.61, 2)
fs = f1_score(y_true, y_pred, average='micro')
assert_array_almost_equal(fs, 0.61, 2)
ps = precision_score(y_true, y_pred, average='macro')
assert_array_almost_equal(ps, 0.62, 2)
rs = recall_score(y_true, y_pred, average='macro')
assert_array_almost_equal(rs, 0.66, 2)
fs = f1_score(y_true, y_pred, average='macro')
assert_array_almost_equal(fs, 0.58, 2)
ps = precision_score(y_true, y_pred, average='weighted')
assert_array_almost_equal(ps, 0.62, 2)
rs = recall_score(y_true, y_pred, average='weighted')
assert_array_almost_equal(rs, 0.61, 2)
fs = f1_score(y_true, y_pred, average='weighted')
assert_array_almost_equal(fs, 0.55, 2)
# same prediction but with and explicit label ordering
p, r, f, s = precision_recall_fscore_support(
y_true, y_pred, labels=[0, 2, 1], average=None)
assert_array_almost_equal(p, [0.82, 0.47, 0.55], 2)
assert_array_almost_equal(r, [0.92, 0.90, 0.17], 2)
assert_array_almost_equal(f, [0.87, 0.62, 0.26], 2)
assert_array_equal(s, [25, 20, 30])
def test_precision_recall_f1_score_multiclass_pos_label_none():
"""Test Precision Recall and F1 Score for multiclass classification task
GH Issue #1296
"""
# initialize data
y_true = np.array([0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1])
y_pred = np.array([1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1])
# compute scores with default labels introspection
p, r, f, s = precision_recall_fscore_support(y_true, y_pred,
pos_label=None,
average='weighted')
def test_zero_precision_recall():
"""Check that pathological cases do not bring NaNs"""
try:
old_error_settings = np.seterr(all='raise')
y_true = np.array([0, 1, 2, 0, 1, 2])
y_pred = np.array([2, 0, 1, 1, 2, 0])
assert_almost_equal(precision_score(y_true, y_pred,
average='weighted'), 0.0, 2)
assert_almost_equal(recall_score(y_true, y_pred, average='weighted'),
0.0, 2)
assert_almost_equal(f1_score(y_true, y_pred, average='weighted'),
0.0, 2)
finally:
np.seterr(**old_error_settings)
def test_confusion_matrix_multiclass():
"""Test confusion matrix - multi-class case"""
y_true, y_pred, _ = make_prediction(binary=False)
# compute confusion matrix with default labels introspection
cm = confusion_matrix(y_true, y_pred)
assert_array_equal(cm, [[23, 2, 0],
[5, 5, 20],
[0, 2, 18]])
# compute confusion matrix with explicit label ordering
cm = confusion_matrix(y_true, y_pred, labels=[0, 2, 1])
assert_array_equal(cm, [[23, 0, 2],
[0, 18, 2],
[5, 20, 5]])
def test_confusion_matrix_multiclass_subset_labels():
"""Test confusion matrix - multi-class case with subset of labels"""
y_true, y_pred, _ = make_prediction(binary=False)
# compute confusion matrix with only first two labels considered
cm = confusion_matrix(y_true, y_pred, labels=[0, 1])
assert_array_equal(cm, [[23, 2],
[5, 5]])
# compute confusion matrix with explicit label ordering for only subset
# of labels
cm = confusion_matrix(y_true, y_pred, labels=[2, 1])
assert_array_equal(cm, [[18, 2],
[20, 5]])
def test_classification_report():
"""Test performance report"""
iris = datasets.load_iris()
y_true, y_pred, _ = make_prediction(dataset=iris, binary=False)
# print classification report with class names
expected_report = """\
precision recall f1-score support
setosa 0.82 0.92 0.87 25
versicolor 0.56 0.17 0.26 30
virginica 0.47 0.90 0.62 20
avg / total 0.62 0.61 0.56 75
"""
report = classification_report(
y_true, y_pred, labels=range(len(iris.target_names)),
target_names=iris.target_names)
assert_equal(report, expected_report)
# print classification report with label detection
expected_report = """\
precision recall f1-score support
0 0.82 0.92 0.87 25
1 0.56 0.17 0.26 30
2 0.47 0.90 0.62 20
avg / total 0.62 0.61 0.56 75
"""
report = classification_report(y_true, y_pred)
assert_equal(report, expected_report)
def _test_precision_recall_curve(y_true, probas_pred):
"""Test Precision-Recall and aread under PR curve"""
p, r, thresholds = precision_recall_curve(y_true, probas_pred)
precision_recall_auc = auc(r, p)
assert_array_almost_equal(precision_recall_auc, 0.82, 2)
assert_array_almost_equal(precision_recall_auc,
average_precision_score(y_true, probas_pred))
# Smoke test in the case of proba having only one value
p, r, thresholds = precision_recall_curve(y_true,
np.zeros_like(probas_pred))
precision_recall_auc = auc(r, p)
assert_array_almost_equal(precision_recall_auc, 0.75, 3)
def test_losses():
"""Test loss functions"""
y_true, y_pred, _ = make_prediction(binary=True)
n = y_true.shape[0]
assert_equal(zero_one(y_true, y_pred), 13)
assert_almost_equal(mean_squared_error(y_true, y_pred), 12.999 / n, 2)
assert_almost_equal(mean_squared_error(y_true, y_true), 0.00, 2)
assert_almost_equal(explained_variance_score(y_true, y_pred), -0.04, 2)
assert_almost_equal(explained_variance_score(y_true, y_true), 1.00, 2)
assert_equal(explained_variance_score([0, 0, 0], [0, 1, 1]), 0.0)
assert_almost_equal(r2_score(y_true, y_pred), -0.04, 2)
assert_almost_equal(r2_score(y_true, y_true), 1.00, 2)
assert_equal(r2_score([0, 0, 0], [0, 0, 0]), 1.0)
assert_equal(r2_score([0, 0, 0], [0, 1, 1]), 0.0)
def test_symmetry():
"""Test the symmetry of score and loss functions"""
y_true, y_pred, _ = make_prediction(binary=True)
# symmetric
assert_equal(zero_one(y_true, y_pred),
zero_one(y_pred, y_true))
assert_almost_equal(mean_squared_error(y_true, y_pred),
mean_squared_error(y_pred, y_true))
# not symmetric
assert_true(explained_variance_score(y_true, y_pred) !=
explained_variance_score(y_pred, y_true))
assert_true(r2_score(y_true, y_pred) !=
r2_score(y_pred, y_true))
# FIXME: precision and recall aren't symmetric either
| [
11748,
4738,
198,
11748,
14601,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
9686,
13,
31391,
1330,
12073,
11,
6818,
62,
1662,
62,
40496,
198,
6738,
9686,
13,
31391,
1330,
6818,
62,
7942,
11,
6818,
62,
430,
2696,
198,
6738,
299,
32152,
13,
33407,
1330,
6818,
62,
18747,
62,
28177,
62,
40496,
198,
6738,
299,
32152,
13,
33407,
1330,
6818,
62,
18747,
62,
40496,
198,
6738,
299,
32152,
13,
33407,
1330,
6818,
62,
40496,
11,
6818,
62,
28177,
62,
40496,
198,
198,
6738,
1341,
35720,
1330,
40522,
198,
6738,
1341,
35720,
1330,
264,
14761,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
257,
1229,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
17923,
62,
13116,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
10802,
62,
6759,
8609,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
4893,
62,
25641,
590,
62,
26675,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
374,
17,
62,
26675,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
277,
16,
62,
26675,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
23963,
40645,
62,
10215,
81,
1073,
891,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
1612,
62,
16485,
1144,
62,
18224,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
15440,
62,
8344,
439,
62,
22019,
303,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
15440,
62,
8344,
439,
62,
69,
26675,
62,
11284,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
15440,
62,
26675,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
10014,
62,
26675,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
686,
66,
62,
22019,
303,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
257,
1229,
62,
26675,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
2811,
62,
3866,
16005,
62,
26675,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
6632,
62,
505,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
41968,
62,
22462,
628,
198,
4299,
787,
62,
28764,
2867,
7,
19608,
292,
316,
28,
14202,
11,
13934,
28,
25101,
2599,
198,
220,
220,
220,
37227,
12050,
617,
17923,
16277,
319,
257,
13373,
27039,
1262,
257,
311,
15922,
628,
220,
220,
220,
1002,
13934,
318,
6407,
4239,
284,
257,
13934,
17923,
1917,
2427,
286,
257,
198,
220,
220,
220,
47368,
31172,
17923,
1917,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
611,
27039,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
1330,
617,
1366,
284,
711,
351,
198,
220,
220,
220,
220,
220,
220,
220,
27039,
796,
40522,
13,
2220,
62,
29616,
3419,
628,
220,
220,
220,
1395,
796,
27039,
13,
7890,
198,
220,
220,
220,
331,
796,
27039,
13,
16793,
628,
220,
220,
220,
611,
13934,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
4239,
284,
257,
13934,
17923,
4876,
198,
220,
220,
220,
220,
220,
220,
220,
1395,
11,
331,
796,
1395,
58,
88,
1279,
362,
4357,
331,
58,
88,
1279,
362,
60,
628,
220,
220,
220,
299,
62,
82,
12629,
11,
299,
62,
40890,
796,
1395,
13,
43358,
198,
220,
220,
220,
279,
796,
2837,
7,
77,
62,
82,
12629,
8,
628,
220,
220,
220,
4738,
13,
28826,
7,
15,
8,
198,
220,
220,
220,
4738,
13,
1477,
18137,
7,
79,
8,
198,
220,
220,
220,
1395,
11,
331,
796,
1395,
58,
79,
4357,
331,
58,
79,
60,
198,
220,
220,
220,
2063,
796,
493,
7,
77,
62,
82,
12629,
1220,
362,
8,
628,
220,
220,
220,
1303,
751,
31210,
3033,
284,
787,
262,
1917,
7069,
290,
3368,
2818,
2482,
198,
220,
220,
220,
374,
782,
796,
45941,
13,
25120,
13,
29531,
9012,
7,
15,
8,
198,
220,
220,
220,
1395,
796,
45941,
13,
66,
62,
58,
55,
11,
374,
782,
13,
25192,
77,
7,
77,
62,
82,
12629,
11,
939,
1635,
299,
62,
40890,
15437,
628,
220,
220,
220,
1303,
1057,
1398,
7483,
11,
651,
1398,
39522,
290,
6167,
16277,
198,
220,
220,
220,
537,
69,
796,
264,
14761,
13,
50,
15922,
7,
33885,
11639,
29127,
3256,
12867,
28,
17821,
8,
198,
220,
220,
220,
1861,
292,
62,
28764,
796,
537,
69,
13,
11147,
7,
55,
58,
25,
13959,
4357,
331,
58,
25,
13959,
35944,
79,
17407,
62,
1676,
7012,
7,
55,
58,
13959,
25,
12962,
628,
220,
220,
220,
611,
13934,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
691,
4609,
287,
39522,
286,
262,
3967,
1339,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
27713,
25,
466,
356,
1107,
765,
257,
2041,
7824,
329,
262,
13934,
1339,
30,
198,
220,
220,
220,
220,
220,
220,
220,
1861,
292,
62,
28764,
796,
1861,
292,
62,
28764,
58,
45299,
352,
60,
628,
220,
220,
220,
331,
62,
28764,
796,
537,
69,
13,
79,
17407,
7,
55,
58,
13959,
25,
12962,
198,
220,
220,
220,
331,
62,
7942,
796,
331,
58,
13959,
47715,
198,
220,
220,
220,
1441,
331,
62,
7942,
11,
331,
62,
28764,
11,
1861,
292,
62,
28764,
628,
198,
4299,
1332,
62,
12204,
62,
22019,
303,
33529,
198,
220,
220,
220,
37227,
14402,
9498,
739,
39106,
24850,
15684,
2569,
357,
49,
4503,
8,
12133,
37811,
198,
220,
220,
220,
331,
62,
7942,
11,
4808,
11,
1861,
292,
62,
28764,
796,
787,
62,
28764,
2867,
7,
39491,
28,
17821,
8,
628,
220,
220,
220,
277,
1050,
11,
256,
1050,
11,
40885,
796,
686,
66,
62,
22019,
303,
7,
88,
62,
7942,
11,
1861,
292,
62,
28764,
8,
198,
220,
220,
220,
686,
66,
62,
14272,
796,
257,
1229,
7,
69,
1050,
11,
256,
1050,
8,
198,
220,
220,
220,
6818,
62,
18747,
62,
28177,
62,
40496,
7,
12204,
62,
14272,
11,
657,
13,
1795,
11,
32465,
28,
17,
8,
198,
220,
220,
220,
6818,
62,
28177,
62,
40496,
7,
12204,
62,
14272,
11,
257,
1229,
62,
26675,
7,
88,
62,
7942,
11,
1861,
292,
62,
28764,
4008,
628,
198,
4299,
1332,
62,
12204,
62,
7783,
82,
62,
5936,
396,
1387,
33529,
198,
220,
220,
220,
37227,
14402,
1771,
262,
4504,
11387,
7466,
510,
351,
256,
1050,
37811,
198,
220,
220,
220,
1303,
787,
1402,
13373,
27039,
198,
220,
220,
220,
331,
62,
7942,
11,
4808,
11,
1861,
292,
62,
28764,
796,
787,
62,
28764,
2867,
7,
39491,
28,
17821,
8,
198,
220,
220,
220,
277,
1050,
11,
256,
1050,
11,
40885,
796,
686,
66,
62,
22019,
303,
7,
88,
62,
7942,
11,
1861,
292,
62,
28764,
8,
628,
220,
220,
220,
1303,
779,
262,
1813,
40885,
284,
5004,
262,
256,
1050,
198,
220,
220,
220,
256,
1050,
62,
30283,
796,
17635,
198,
220,
220,
220,
329,
256,
287,
2837,
7,
11925,
7,
400,
10126,
82,
8,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
256,
79,
796,
45941,
13,
16345,
19510,
1676,
12093,
62,
28764,
18189,
40885,
58,
83,
12962,
1222,
331,
62,
7942,
8,
198,
220,
220,
220,
220,
220,
220,
220,
279,
796,
45941,
13,
16345,
7,
88,
62,
7942,
8,
198,
220,
220,
220,
220,
220,
220,
220,
256,
1050,
62,
30283,
13,
33295,
7,
16,
13,
15,
1635,
256,
79,
1220,
279,
8,
628,
220,
220,
220,
1303,
8996,
256,
1050,
290,
256,
1050,
62,
30283,
284,
766,
611,
262,
40885,
6,
1502,
373,
3376,
198,
220,
220,
220,
6818,
62,
18747,
62,
28177,
62,
40496,
7,
83,
1050,
11,
256,
1050,
62,
30283,
11,
32465,
28,
17,
8,
628,
198,
31,
430,
2696,
7,
11395,
12331,
8,
198,
4299,
1332,
62,
12204,
62,
22019,
303,
62,
41684,
33529,
198,
220,
220,
220,
37227,
12204,
62,
22019,
303,
407,
9723,
329,
5021,
12,
4871,
2761,
37811,
198,
220,
220,
220,
331,
62,
7942,
11,
4808,
11,
1861,
292,
62,
28764,
796,
787,
62,
28764,
2867,
7,
39491,
28,
25101,
8,
628,
220,
220,
220,
277,
1050,
11,
256,
1050,
11,
40885,
796,
686,
66,
62,
22019,
303,
7,
88,
62,
7942,
11,
1861,
292,
62,
28764,
8,
628,
198,
4299,
1332,
62,
12204,
62,
22019,
303,
62,
39745,
33529,
198,
220,
220,
220,
37227,
12204,
62,
22019,
303,
329,
6628,
8198,
37811,
198,
220,
220,
220,
331,
62,
7942,
11,
4808,
11,
1861,
292,
62,
28764,
796,
787,
62,
28764,
2867,
7,
39491,
28,
17821,
8,
628,
220,
220,
220,
277,
1050,
11,
256,
1050,
11,
40885,
796,
686,
66,
62,
22019,
303,
7,
88,
62,
7942,
11,
1861,
292,
62,
28764,
532,
657,
13,
20,
8,
198,
220,
220,
220,
686,
66,
62,
14272,
796,
257,
1229,
7,
69,
1050,
11,
256,
1050,
8,
198,
220,
220,
220,
6818,
62,
18747,
62,
28177,
62,
40496,
7,
12204,
62,
14272,
11,
657,
13,
1795,
11,
32465,
28,
17,
8,
628,
198,
4299,
1332,
62,
12204,
62,
22019,
303,
62,
10424,
33529,
198,
220,
220,
220,
37227,
12204,
62,
22019,
303,
329,
1327,
5370,
37811,
198,
220,
220,
220,
331,
62,
7942,
11,
2747,
11,
1861,
292,
62,
28764,
796,
787,
62,
28764,
2867,
7,
39491,
28,
17821,
8,
628,
220,
220,
220,
1303,
1464,
4331,
530,
198,
220,
220,
220,
20861,
62,
28764,
796,
45941,
13,
1952,
7,
88,
62,
7942,
13,
43358,
8,
198,
220,
220,
220,
277,
1050,
11,
256,
1050,
11,
40885,
796,
686,
66,
62,
22019,
303,
7,
88,
62,
7942,
11,
20861,
62,
28764,
8,
198,
220,
220,
220,
686,
66,
62,
14272,
796,
257,
1229,
7,
69,
1050,
11,
256,
1050,
8,
198,
220,
220,
220,
6818,
62,
18747,
62,
28177,
62,
40496,
7,
12204,
62,
14272,
11,
657,
13,
1120,
11,
32465,
28,
17,
8,
628,
220,
220,
220,
1303,
1464,
4331,
6632,
198,
220,
220,
220,
20861,
62,
28764,
796,
45941,
13,
9107,
418,
7,
88,
62,
7942,
13,
43358,
8,
198,
220,
220,
220,
277,
1050,
11,
256,
1050,
11,
40885,
796,
686,
66,
62,
22019,
303,
7,
88,
62,
7942,
11,
20861,
62,
28764,
8,
198,
220,
220,
220,
686,
66,
62,
14272,
796,
257,
1229,
7,
69,
1050,
11,
256,
1050,
8,
198,
220,
220,
220,
6818,
62,
18747,
62,
28177,
62,
40496,
7,
12204,
62,
14272,
11,
657,
13,
1120,
11,
32465,
28,
17,
8,
628,
220,
220,
220,
1303,
1327,
5370,
198,
220,
220,
220,
277,
1050,
11,
256,
1050,
11,
40885,
796,
686,
66,
62,
22019,
303,
7,
88,
62,
7942,
11,
2747,
8,
198,
220,
220,
220,
686,
66,
62,
14272,
796,
257,
1229,
7,
69,
1050,
11,
256,
1050,
8,
198,
220,
220,
220,
6818,
62,
18747,
62,
28177,
62,
40496,
7,
12204,
62,
14272,
11,
657,
13,
4524,
11,
32465,
28,
17,
8,
628,
198,
4299,
1332,
62,
14272,
33529,
198,
220,
220,
220,
37227,
14402,
9498,
4698,
46300,
357,
32,
9598,
8,
29964,
37811,
198,
220,
220,
220,
2124,
796,
685,
15,
11,
352,
60,
198,
220,
220,
220,
331,
796,
685,
15,
11,
352,
60,
198,
220,
220,
220,
6818,
62,
18747,
62,
28177,
62,
40496,
7,
14272,
7,
87,
11,
331,
828,
657,
13,
20,
8,
198,
220,
220,
220,
2124,
796,
685,
16,
11,
657,
60,
198,
220,
220,
220,
331,
796,
685,
15,
11,
352,
60,
198,
220,
220,
220,
6818,
62,
18747,
62,
28177,
62,
40496,
7,
14272,
7,
87,
11,
331,
828,
657,
13,
20,
8,
198,
220,
220,
220,
2124,
796,
685,
15,
11,
352,
60,
198,
220,
220,
220,
331,
796,
685,
16,
11,
352,
60,
198,
220,
220,
220,
6818,
62,
18747,
62,
28177,
62,
40496,
7,
14272,
7,
87,
11,
331,
828,
352,
8,
198,
220,
220,
220,
2124,
796,
685,
15,
11,
657,
13,
20,
11,
352,
60,
198,
220,
220,
220,
331,
796,
685,
15,
11,
657,
13,
20,
11,
352,
60,
198,
220,
220,
220,
6818,
62,
18747,
62,
28177,
62,
40496,
7,
14272,
7,
87,
11,
331,
828,
657,
13,
20,
8,
628,
628,
198,
4299,
1332,
62,
3866,
16005,
62,
8344,
439,
62,
69,
16,
62,
26675,
62,
39491,
33529,
198,
220,
220,
220,
37227,
14402,
39281,
44536,
290,
376,
16,
15178,
329,
13934,
17923,
4876,
37811,
198,
220,
220,
220,
331,
62,
7942,
11,
331,
62,
28764,
11,
4808,
796,
787,
62,
28764,
2867,
7,
39491,
28,
17821,
8,
628,
220,
220,
220,
1303,
6496,
5260,
329,
1123,
1398,
198,
220,
220,
220,
279,
11,
374,
11,
277,
11,
264,
796,
15440,
62,
8344,
439,
62,
69,
26675,
62,
11284,
7,
88,
62,
7942,
11,
331,
62,
28764,
11,
2811,
28,
14202,
8,
198,
220,
220,
220,
6818,
62,
18747,
62,
28177,
62,
40496,
7,
79,
11,
685,
15,
13,
4790,
11,
657,
13,
2425,
4357,
362,
8,
198,
220,
220,
220,
6818,
62,
18747,
62,
28177,
62,
40496,
7,
81,
11,
685,
15,
13,
4304,
11,
657,
13,
4761,
4357,
362,
8,
198,
220,
220,
220,
6818,
62,
18747,
62,
28177,
62,
40496,
7,
69,
11,
685,
15,
13,
2425,
11,
657,
13,
4524,
4357,
362,
8,
198,
220,
220,
220,
6818,
62,
18747,
62,
40496,
7,
82,
11,
685,
1495,
11,
1679,
12962,
628,
220,
220,
220,
1303,
1981,
9689,
2163,
326,
460,
307,
973,
329,
10706,
2989,
25,
287,
262,
198,
220,
220,
220,
1303,
13934,
1398,
1339,
262,
4776,
318,
262,
1988,
286,
262,
3953,
329,
262,
3967,
198,
220,
220,
220,
1303,
1398,
357,
68,
13,
70,
13,
6167,
6624,
352,
8,
198,
220,
220,
220,
26692,
796,
15440,
62,
26675,
7,
88,
62,
7942,
11,
331,
62,
28764,
8,
198,
220,
220,
220,
6818,
62,
18747,
62,
28177,
62,
40496,
7,
862,
11,
657,
13,
2425,
11,
362,
8,
628,
220,
220,
220,
44608,
796,
10014,
62,
26675,
7,
88,
62,
7942,
11,
331,
62,
28764,
8,
198,
220,
220,
220,
6818,
62,
18747,
62,
28177,
62,
40496,
7,
3808,
11,
657,
13,
4761,
11,
362,
8,
628,
220,
220,
220,
43458,
796,
277,
16,
62,
26675,
7,
88,
62,
7942,
11,
331,
62,
28764,
8,
198,
220,
220,
220,
6818,
62,
18747,
62,
28177,
62,
40496,
7,
9501,
11,
657,
13,
4524,
11,
362,
8,
628,
628,
198,
198,
4299,
1332,
62,
10414,
4241,
62,
6759,
8609,
62,
39491,
33529,
198,
220,
220,
220,
37227,
14402,
10802,
17593,
532,
13934,
17923,
1339,
37811,
198,
220,
220,
220,
331,
62,
7942,
11,
331,
62,
28764,
11,
4808,
796,
787,
62,
28764,
2867,
7,
39491,
28,
17821,
8,
628,
220,
220,
220,
12067,
796,
10802,
62,
6759,
8609,
7,
88,
62,
7942,
11,
331,
62,
28764,
8,
198,
220,
220,
220,
6818,
62,
18747,
62,
40496,
7,
11215,
11,
16410,
1129,
11,
718,
4357,
685,
22,
11,
1248,
11907,
8,
628,
220,
220,
220,
256,
79,
796,
12067,
58,
15,
11,
657,
60,
198,
220,
220,
220,
256,
77,
796,
12067,
58,
16,
11,
352,
60,
198,
220,
220,
220,
277,
79,
796,
12067,
58,
15,
11,
352,
60,
198,
220,
220,
220,
24714,
796,
12067,
58,
16,
11,
657,
60,
198,
220,
220,
220,
997,
796,
357,
34788,
1635,
256,
77,
532,
277,
79,
1635,
24714,
8,
198,
220,
220,
220,
2853,
796,
45941,
13,
31166,
17034,
19510,
34788,
1343,
277,
79,
8,
1635,
357,
34788,
1343,
24714,
8,
1635,
357,
34106,
1343,
277,
79,
8,
1635,
357,
34106,
1343,
24714,
4008,
198,
220,
220,
220,
611,
2853,
6624,
657,
11207,
198,
220,
220,
220,
220,
220,
220,
220,
2081,
62,
76,
535,
796,
657,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2081,
62,
76,
535,
796,
997,
1220,
2853,
198,
220,
220,
220,
285,
535,
796,
23963,
40645,
62,
10215,
81,
1073,
891,
7,
88,
62,
7942,
11,
331,
62,
28764,
8,
198,
220,
220,
220,
6818,
62,
18747,
62,
28177,
62,
40496,
7,
76,
535,
11,
2081,
62,
76,
535,
11,
32465,
28,
17,
8,
198,
220,
220,
220,
6818,
62,
18747,
62,
28177,
62,
40496,
7,
76,
535,
11,
657,
13,
2780,
11,
32465,
28,
17,
8,
628,
198,
198,
4299,
1332,
62,
3866,
16005,
62,
8344,
439,
62,
69,
16,
62,
26675,
62,
16680,
291,
31172,
33529,
198,
220,
220,
220,
37227,
14402,
39281,
44536,
290,
376,
16,
15178,
329,
47368,
31172,
17923,
4876,
37811,
198,
220,
220,
220,
331,
62,
7942,
11,
331,
62,
28764,
11,
4808,
796,
787,
62,
28764,
2867,
7,
39491,
28,
25101,
8,
628,
220,
220,
220,
1303,
24061,
8198,
351,
4277,
14722,
18951,
31308,
198,
220,
220,
220,
279,
11,
374,
11,
277,
11,
264,
796,
15440,
62,
8344,
439,
62,
69,
26675,
62,
11284,
7,
88,
62,
7942,
11,
331,
62,
28764,
11,
2811,
28,
14202,
8,
198,
220,
220,
220,
6818,
62,
18747,
62,
28177,
62,
40496,
7,
79,
11,
685,
15,
13,
6469,
11,
657,
13,
2816,
11,
657,
13,
2857,
4357,
362,
8,
198,
220,
220,
220,
6818,
62,
18747,
62,
28177,
62,
40496,
7,
81,
11,
685,
15,
13,
5892,
11,
657,
13,
1558,
11,
657,
13,
3829,
4357,
362,
8,
198,
220,
220,
220,
6818,
62,
18747,
62,
28177,
62,
40496,
7,
69,
11,
685,
15,
13,
5774,
11,
657,
13,
2075,
11,
657,
13,
5237,
4357,
362,
8,
198,
220,
220,
220,
6818,
62,
18747,
62,
40496,
7,
82,
11,
685,
1495,
11,
1542,
11,
1160,
12962,
628,
220,
220,
220,
1303,
20430,
5254,
198,
220,
220,
220,
26692,
796,
15440,
62,
26675,
7,
88,
62,
7942,
11,
331,
62,
28764,
11,
1426,
62,
18242,
28,
16,
11,
2811,
11639,
24055,
11537,
198,
220,
220,
220,
6818,
62,
18747,
62,
28177,
62,
40496,
7,
862,
11,
657,
13,
5333,
11,
362,
8,
628,
220,
220,
220,
44608,
796,
10014,
62,
26675,
7,
88,
62,
7942,
11,
331,
62,
28764,
11,
2811,
11639,
24055,
11537,
198,
220,
220,
220,
6818,
62,
18747,
62,
28177,
62,
40496,
7,
3808,
11,
657,
13,
5333,
11,
362,
8,
628,
220,
220,
220,
43458,
796,
277,
16,
62,
26675,
7,
88,
62,
7942,
11,
331,
62,
28764,
11,
2811,
11639,
24055,
11537,
198,
220,
220,
220,
6818,
62,
18747,
62,
28177,
62,
40496,
7,
9501,
11,
657,
13,
5333,
11,
362,
8,
628,
220,
220,
220,
26692,
796,
15440,
62,
26675,
7,
88,
62,
7942,
11,
331,
62,
28764,
11,
2811,
11639,
20285,
305,
11537,
198,
220,
220,
220,
6818,
62,
18747,
62,
28177,
62,
40496,
7,
862,
11,
657,
13,
5237,
11,
362,
8,
628,
220,
220,
220,
44608,
796,
10014,
62,
26675,
7,
88,
62,
7942,
11,
331,
62,
28764,
11,
2811,
11639,
20285,
305,
11537,
198,
220,
220,
220,
6818,
62,
18747,
62,
28177,
62,
40496,
7,
3808,
11,
657,
13,
2791,
11,
362,
8,
628,
220,
220,
220,
43458,
796,
277,
16,
62,
26675,
7,
88,
62,
7942,
11,
331,
62,
28764,
11,
2811,
11639,
20285,
305,
11537,
198,
220,
220,
220,
6818,
62,
18747,
62,
28177,
62,
40496,
7,
9501,
11,
657,
13,
3365,
11,
362,
8,
628,
220,
220,
220,
26692,
796,
15440,
62,
26675,
7,
88,
62,
7942,
11,
331,
62,
28764,
11,
2811,
11639,
6551,
276,
11537,
198,
220,
220,
220,
6818,
62,
18747,
62,
28177,
62,
40496,
7,
862,
11,
657,
13,
5237,
11,
362,
8,
628,
220,
220,
220,
44608,
796,
10014,
62,
26675,
7,
88,
62,
7942,
11,
331,
62,
28764,
11,
2811,
11639,
6551,
276,
11537,
198,
220,
220,
220,
6818,
62,
18747,
62,
28177,
62,
40496,
7,
3808,
11,
657,
13,
5333,
11,
362,
8,
628,
220,
220,
220,
43458,
796,
277,
16,
62,
26675,
7,
88,
62,
7942,
11,
331,
62,
28764,
11,
2811,
11639,
6551,
276,
11537,
198,
220,
220,
220,
6818,
62,
18747,
62,
28177,
62,
40496,
7,
9501,
11,
657,
13,
2816,
11,
362,
8,
628,
220,
220,
220,
1303,
976,
17724,
475,
351,
290,
7952,
6167,
16216,
198,
220,
220,
220,
279,
11,
374,
11,
277,
11,
264,
796,
15440,
62,
8344,
439,
62,
69,
26675,
62,
11284,
7,
198,
220,
220,
220,
220,
220,
220,
220,
331,
62,
7942,
11,
331,
62,
28764,
11,
14722,
41888,
15,
11,
362,
11,
352,
4357,
2811,
28,
14202,
8,
198,
220,
220,
220,
6818,
62,
18747,
62,
28177,
62,
40496,
7,
79,
11,
685,
15,
13,
6469,
11,
657,
13,
2857,
11,
657,
13,
2816,
4357,
362,
8,
198,
220,
220,
220,
6818,
62,
18747,
62,
28177,
62,
40496,
7,
81,
11,
685,
15,
13,
5892,
11,
657,
13,
3829,
11,
657,
13,
1558,
4357,
362,
8,
198,
220,
220,
220,
6818,
62,
18747,
62,
28177,
62,
40496,
7,
69,
11,
685,
15,
13,
5774,
11,
657,
13,
5237,
11,
657,
13,
2075,
4357,
362,
8,
198,
220,
220,
220,
6818,
62,
18747,
62,
40496,
7,
82,
11,
685,
1495,
11,
1160,
11,
1542,
12962,
628,
198,
4299,
1332,
62,
3866,
16005,
62,
8344,
439,
62,
69,
16,
62,
26675,
62,
16680,
291,
31172,
62,
1930,
62,
18242,
62,
23108,
33529,
198,
220,
220,
220,
37227,
14402,
39281,
44536,
290,
376,
16,
15178,
329,
47368,
31172,
17923,
4876,
628,
220,
220,
220,
24739,
18232,
1303,
1065,
4846,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1303,
41216,
1366,
198,
220,
220,
220,
331,
62,
7942,
796,
45941,
13,
18747,
26933,
15,
11,
352,
11,
657,
11,
657,
11,
352,
11,
352,
11,
657,
11,
352,
11,
657,
11,
657,
11,
352,
11,
657,
11,
352,
11,
657,
11,
352,
12962,
198,
220,
220,
220,
331,
62,
28764,
796,
45941,
13,
18747,
26933,
16,
11,
352,
11,
657,
11,
352,
11,
657,
11,
352,
11,
352,
11,
352,
11,
352,
11,
657,
11,
352,
11,
657,
11,
352,
11,
657,
11,
352,
12962,
628,
220,
220,
220,
1303,
24061,
8198,
351,
4277,
14722,
18951,
31308,
198,
220,
220,
220,
279,
11,
374,
11,
277,
11,
264,
796,
15440,
62,
8344,
439,
62,
69,
26675,
62,
11284,
7,
88,
62,
7942,
11,
331,
62,
28764,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1426,
62,
18242,
28,
14202,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2811,
11639,
6551,
276,
11537,
628,
198,
4299,
1332,
62,
22570,
62,
3866,
16005,
62,
8344,
439,
33529,
198,
220,
220,
220,
37227,
9787,
326,
42306,
2663,
466,
407,
2222,
11013,
47503,
37811,
628,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1468,
62,
18224,
62,
33692,
796,
45941,
13,
82,
2357,
81,
7,
439,
11639,
40225,
11537,
628,
220,
220,
220,
220,
220,
220,
220,
331,
62,
7942,
796,
45941,
13,
18747,
26933,
15,
11,
352,
11,
362,
11,
657,
11,
352,
11,
362,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
331,
62,
28764,
796,
45941,
13,
18747,
26933,
17,
11,
657,
11,
352,
11,
352,
11,
362,
11,
657,
12962,
628,
220,
220,
220,
220,
220,
220,
220,
6818,
62,
28177,
62,
40496,
7,
3866,
16005,
62,
26675,
7,
88,
62,
7942,
11,
331,
62,
28764,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2811,
11639,
6551,
276,
33809,
657,
13,
15,
11,
362,
8,
198,
220,
220,
220,
220,
220,
220,
220,
6818,
62,
28177,
62,
40496,
7,
8344,
439,
62,
26675,
7,
88,
62,
7942,
11,
331,
62,
28764,
11,
2811,
11639,
6551,
276,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
657,
13,
15,
11,
362,
8,
198,
220,
220,
220,
220,
220,
220,
220,
6818,
62,
28177,
62,
40496,
7,
69,
16,
62,
26675,
7,
88,
62,
7942,
11,
331,
62,
28764,
11,
2811,
11639,
6551,
276,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
657,
13,
15,
11,
362,
8,
628,
220,
220,
220,
3443,
25,
198,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
82,
2357,
81,
7,
1174,
727,
62,
18224,
62,
33692,
8,
628,
198,
4299,
1332,
62,
10414,
4241,
62,
6759,
8609,
62,
16680,
291,
31172,
33529,
198,
220,
220,
220,
37227,
14402,
10802,
17593,
532,
5021,
12,
4871,
1339,
37811,
198,
220,
220,
220,
331,
62,
7942,
11,
331,
62,
28764,
11,
4808,
796,
787,
62,
28764,
2867,
7,
39491,
28,
25101,
8,
628,
220,
220,
220,
1303,
24061,
10802,
17593,
351,
4277,
14722,
18951,
31308,
198,
220,
220,
220,
12067,
796,
10802,
62,
6759,
8609,
7,
88,
62,
7942,
11,
331,
62,
28764,
8,
198,
220,
220,
220,
6818,
62,
18747,
62,
40496,
7,
11215,
11,
16410,
1954,
11,
362,
11,
657,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
685,
20,
11,
642,
11,
1160,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
685,
15,
11,
362,
11,
1248,
11907,
8,
628,
220,
220,
220,
1303,
24061,
10802,
17593,
351,
7952,
6167,
16216,
198,
220,
220,
220,
12067,
796,
10802,
62,
6759,
8609,
7,
88,
62,
7942,
11,
331,
62,
28764,
11,
14722,
41888,
15,
11,
362,
11,
352,
12962,
198,
220,
220,
220,
6818,
62,
18747,
62,
40496,
7,
11215,
11,
16410,
1954,
11,
657,
11,
362,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
685,
15,
11,
1248,
11,
362,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
685,
20,
11,
1160,
11,
642,
11907,
8,
628,
198,
4299,
1332,
62,
10414,
4241,
62,
6759,
8609,
62,
16680,
291,
31172,
62,
7266,
2617,
62,
23912,
1424,
33529,
198,
220,
220,
220,
37227,
14402,
10802,
17593,
532,
5021,
12,
4871,
1339,
351,
24637,
286,
14722,
37811,
198,
220,
220,
220,
331,
62,
7942,
11,
331,
62,
28764,
11,
4808,
796,
787,
62,
28764,
2867,
7,
39491,
28,
25101,
8,
628,
220,
220,
220,
1303,
24061,
10802,
17593,
351,
691,
717,
734,
14722,
3177,
198,
220,
220,
220,
12067,
796,
10802,
62,
6759,
8609,
7,
88,
62,
7942,
11,
331,
62,
28764,
11,
14722,
41888,
15,
11,
352,
12962,
198,
220,
220,
220,
6818,
62,
18747,
62,
40496,
7,
11215,
11,
16410,
1954,
11,
362,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
685,
20,
11,
642,
11907,
8,
628,
220,
220,
220,
1303,
24061,
10802,
17593,
351,
7952,
6167,
16216,
329,
691,
24637,
198,
220,
220,
220,
1303,
286,
14722,
198,
220,
220,
220,
12067,
796,
10802,
62,
6759,
8609,
7,
88,
62,
7942,
11,
331,
62,
28764,
11,
14722,
41888,
17,
11,
352,
12962,
198,
220,
220,
220,
6818,
62,
18747,
62,
40496,
7,
11215,
11,
16410,
1507,
11,
362,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
685,
1238,
11,
642,
11907,
8,
628,
198,
4299,
1332,
62,
4871,
2649,
62,
13116,
33529,
198,
220,
220,
220,
37227,
14402,
2854,
989,
37811,
198,
220,
220,
220,
4173,
271,
796,
40522,
13,
2220,
62,
29616,
3419,
198,
220,
220,
220,
331,
62,
7942,
11,
331,
62,
28764,
11,
4808,
796,
787,
62,
28764,
2867,
7,
19608,
292,
316,
28,
29616,
11,
13934,
28,
25101,
8,
628,
220,
220,
220,
1303,
3601,
17923,
989,
351,
1398,
3891,
198,
220,
220,
220,
2938,
62,
13116,
796,
37227,
59,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15440,
220,
220,
220,
10014,
220,
277,
16,
12,
26675,
220,
220,
1104,
628,
220,
220,
220,
220,
900,
8546,
220,
220,
220,
220,
220,
220,
657,
13,
6469,
220,
220,
220,
220,
220,
657,
13,
5892,
220,
220,
220,
220,
220,
657,
13,
5774,
220,
220,
220,
220,
220,
220,
220,
1679,
198,
1646,
27045,
273,
220,
220,
220,
220,
220,
220,
657,
13,
3980,
220,
220,
220,
220,
220,
657,
13,
1558,
220,
220,
220,
220,
220,
657,
13,
2075,
220,
220,
220,
220,
220,
220,
220,
1542,
198,
220,
21772,
3970,
220,
220,
220,
220,
220,
220,
657,
13,
2857,
220,
220,
220,
220,
220,
657,
13,
3829,
220,
220,
220,
220,
220,
657,
13,
5237,
220,
220,
220,
220,
220,
220,
220,
1160,
198,
198,
615,
70,
1220,
2472,
220,
220,
220,
220,
220,
220,
657,
13,
5237,
220,
220,
220,
220,
220,
657,
13,
5333,
220,
220,
220,
220,
220,
657,
13,
3980,
220,
220,
220,
220,
220,
220,
220,
5441,
198,
37811,
198,
220,
220,
220,
989,
796,
17923,
62,
13116,
7,
198,
220,
220,
220,
220,
220,
220,
220,
331,
62,
7942,
11,
331,
62,
28764,
11,
14722,
28,
9521,
7,
11925,
7,
29616,
13,
16793,
62,
14933,
36911,
198,
220,
220,
220,
220,
220,
220,
220,
2496,
62,
14933,
28,
29616,
13,
16793,
62,
14933,
8,
198,
220,
220,
220,
6818,
62,
40496,
7,
13116,
11,
2938,
62,
13116,
8,
628,
220,
220,
220,
1303,
3601,
17923,
989,
351,
6167,
13326,
198,
220,
220,
220,
2938,
62,
13116,
796,
37227,
59,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15440,
220,
220,
220,
10014,
220,
277,
16,
12,
26675,
220,
220,
1104,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
657,
220,
220,
220,
220,
220,
220,
657,
13,
6469,
220,
220,
220,
220,
220,
657,
13,
5892,
220,
220,
220,
220,
220,
657,
13,
5774,
220,
220,
220,
220,
220,
220,
220,
1679,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
352,
220,
220,
220,
220,
220,
220,
657,
13,
3980,
220,
220,
220,
220,
220,
657,
13,
1558,
220,
220,
220,
220,
220,
657,
13,
2075,
220,
220,
220,
220,
220,
220,
220,
1542,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
362,
220,
220,
220,
220,
220,
220,
657,
13,
2857,
220,
220,
220,
220,
220,
657,
13,
3829,
220,
220,
220,
220,
220,
657,
13,
5237,
220,
220,
220,
220,
220,
220,
220,
1160,
198,
198,
615,
70,
1220,
2472,
220,
220,
220,
220,
220,
220,
657,
13,
5237,
220,
220,
220,
220,
220,
657,
13,
5333,
220,
220,
220,
220,
220,
657,
13,
3980,
220,
220,
220,
220,
220,
220,
220,
5441,
198,
37811,
198,
220,
220,
220,
989,
796,
17923,
62,
13116,
7,
88,
62,
7942,
11,
331,
62,
28764,
8,
198,
220,
220,
220,
6818,
62,
40496,
7,
13116,
11,
2938,
62,
13116,
8,
628,
198,
198,
4299,
4808,
9288,
62,
3866,
16005,
62,
8344,
439,
62,
22019,
303,
7,
88,
62,
7942,
11,
1861,
292,
62,
28764,
2599,
198,
220,
220,
220,
37227,
14402,
39281,
12,
6690,
439,
290,
389,
324,
739,
4810,
12133,
37811,
198,
220,
220,
220,
279,
11,
374,
11,
40885,
796,
15440,
62,
8344,
439,
62,
22019,
303,
7,
88,
62,
7942,
11,
1861,
292,
62,
28764,
8,
198,
220,
220,
220,
15440,
62,
8344,
439,
62,
14272,
796,
257,
1229,
7,
81,
11,
279,
8,
198,
220,
220,
220,
6818,
62,
18747,
62,
28177,
62,
40496,
7,
3866,
16005,
62,
8344,
439,
62,
14272,
11,
657,
13,
6469,
11,
362,
8,
198,
220,
220,
220,
6818,
62,
18747,
62,
28177,
62,
40496,
7,
3866,
16005,
62,
8344,
439,
62,
14272,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2811,
62,
3866,
16005,
62,
26675,
7,
88,
62,
7942,
11,
1861,
292,
62,
28764,
4008,
198,
220,
220,
220,
1303,
25416,
1332,
287,
262,
1339,
286,
1861,
64,
1719,
691,
530,
1988,
198,
220,
220,
220,
279,
11,
374,
11,
40885,
796,
15440,
62,
8344,
439,
62,
22019,
303,
7,
88,
62,
7942,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
9107,
418,
62,
2339,
7,
1676,
12093,
62,
28764,
4008,
198,
220,
220,
220,
15440,
62,
8344,
439,
62,
14272,
796,
257,
1229,
7,
81,
11,
279,
8,
198,
220,
220,
220,
6818,
62,
18747,
62,
28177,
62,
40496,
7,
3866,
16005,
62,
8344,
439,
62,
14272,
11,
657,
13,
2425,
11,
513,
8,
628,
628,
198,
4299,
1332,
62,
22462,
274,
33529,
198,
220,
220,
220,
37227,
14402,
2994,
5499,
37811,
198,
220,
220,
220,
331,
62,
7942,
11,
331,
62,
28764,
11,
4808,
796,
787,
62,
28764,
2867,
7,
39491,
28,
17821,
8,
198,
220,
220,
220,
299,
796,
331,
62,
7942,
13,
43358,
58,
15,
60,
628,
220,
220,
220,
6818,
62,
40496,
7,
22570,
62,
505,
7,
88,
62,
7942,
11,
331,
62,
28764,
828,
1511,
8,
198,
220,
220,
220,
6818,
62,
28177,
62,
40496,
7,
32604,
62,
16485,
1144,
62,
18224,
7,
88,
62,
7942,
11,
331,
62,
28764,
828,
1105,
13,
17032,
1220,
299,
11,
362,
8,
198,
220,
220,
220,
6818,
62,
28177,
62,
40496,
7,
32604,
62,
16485,
1144,
62,
18224,
7,
88,
62,
7942,
11,
331,
62,
7942,
828,
657,
13,
405,
11,
362,
8,
628,
220,
220,
220,
6818,
62,
28177,
62,
40496,
7,
20676,
1328,
62,
25641,
590,
62,
26675,
7,
88,
62,
7942,
11,
331,
62,
28764,
828,
532,
15,
13,
3023,
11,
362,
8,
198,
220,
220,
220,
6818,
62,
28177,
62,
40496,
7,
20676,
1328,
62,
25641,
590,
62,
26675,
7,
88,
62,
7942,
11,
331,
62,
7942,
828,
352,
13,
405,
11,
362,
8,
198,
220,
220,
220,
6818,
62,
40496,
7,
20676,
1328,
62,
25641,
590,
62,
26675,
26933,
15,
11,
657,
11,
657,
4357,
685,
15,
11,
352,
11,
352,
46570,
657,
13,
15,
8,
628,
220,
220,
220,
6818,
62,
28177,
62,
40496,
7,
81,
17,
62,
26675,
7,
88,
62,
7942,
11,
331,
62,
28764,
828,
532,
15,
13,
3023,
11,
362,
8,
198,
220,
220,
220,
6818,
62,
28177,
62,
40496,
7,
81,
17,
62,
26675,
7,
88,
62,
7942,
11,
331,
62,
7942,
828,
352,
13,
405,
11,
362,
8,
198,
220,
220,
220,
6818,
62,
40496,
7,
81,
17,
62,
26675,
26933,
15,
11,
657,
11,
657,
4357,
685,
15,
11,
657,
11,
657,
46570,
352,
13,
15,
8,
198,
220,
220,
220,
6818,
62,
40496,
7,
81,
17,
62,
26675,
26933,
15,
11,
657,
11,
657,
4357,
685,
15,
11,
352,
11,
352,
46570,
657,
13,
15,
8,
628,
628,
198,
4299,
1332,
62,
1837,
3020,
11973,
33529,
198,
220,
220,
220,
37227,
14402,
262,
40686,
286,
4776,
290,
2994,
5499,
37811,
198,
220,
220,
220,
331,
62,
7942,
11,
331,
62,
28764,
11,
4808,
796,
787,
62,
28764,
2867,
7,
39491,
28,
17821,
8,
628,
220,
220,
220,
1303,
23606,
19482,
198,
220,
220,
220,
6818,
62,
40496,
7,
22570,
62,
505,
7,
88,
62,
7942,
11,
331,
62,
28764,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6632,
62,
505,
7,
88,
62,
28764,
11,
331,
62,
7942,
4008,
198,
220,
220,
220,
6818,
62,
28177,
62,
40496,
7,
32604,
62,
16485,
1144,
62,
18224,
7,
88,
62,
7942,
11,
331,
62,
28764,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1612,
62,
16485,
1144,
62,
18224,
7,
88,
62,
28764,
11,
331,
62,
7942,
4008,
198,
220,
220,
220,
1303,
407,
23606,
19482,
198,
220,
220,
220,
6818,
62,
7942,
7,
20676,
1328,
62,
25641,
590,
62,
26675,
7,
88,
62,
7942,
11,
331,
62,
28764,
8,
14512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4893,
62,
25641,
590,
62,
26675,
7,
88,
62,
28764,
11,
331,
62,
7942,
4008,
198,
220,
220,
220,
6818,
62,
7942,
7,
81,
17,
62,
26675,
7,
88,
62,
7942,
11,
331,
62,
28764,
8,
14512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
374,
17,
62,
26675,
7,
88,
62,
28764,
11,
331,
62,
7942,
4008,
198,
220,
220,
220,
1303,
44855,
11682,
25,
15440,
290,
10014,
3588,
470,
23606,
19482,
2035,
628,
198
] | 2.292837 | 6,157 |
"""Python Objects Onto HDF5
"""
__version__ = '0.1.dev0'
from ._h5io import read_hdf5, write_hdf5, _TempDir, object_diff # noqa, analysis:ignore
| [
37811,
37906,
35832,
9463,
78,
5572,
37,
20,
198,
37811,
198,
198,
834,
9641,
834,
796,
705,
15,
13,
16,
13,
7959,
15,
6,
198,
198,
6738,
47540,
71,
20,
952,
1330,
1100,
62,
71,
7568,
20,
11,
3551,
62,
71,
7568,
20,
11,
4808,
30782,
35277,
11,
2134,
62,
26069,
220,
1303,
645,
20402,
11,
3781,
25,
46430,
198
] | 2.466667 | 60 |
"""Select2 support for DAL."""
# default_app_config = 'dal_select2.apps.DefaultApp'
| [
37811,
17563,
17,
1104,
329,
360,
1847,
526,
15931,
198,
198,
2,
4277,
62,
1324,
62,
11250,
796,
705,
31748,
62,
19738,
17,
13,
18211,
13,
19463,
4677,
6,
198
] | 2.833333 | 30 |
from django.core.files.storage import FileSystemStorage
from django.core.files.move import file_move_safe
from django.contrib.auth.models import User
from django.apps import apps
from fnmatch import fnmatch
from whatisit.settings import (
MEDIA_ROOT,
MEDIA_URL
)
import errno
import itertools
import os
import tempfile
############################################################################
# Storage Models
############################################################################
| [
6738,
42625,
14208,
13,
7295,
13,
16624,
13,
35350,
1330,
9220,
11964,
31425,
198,
6738,
42625,
14208,
13,
7295,
13,
16624,
13,
21084,
1330,
2393,
62,
21084,
62,
21230,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
42625,
14208,
13,
18211,
1330,
6725,
198,
198,
6738,
24714,
15699,
1330,
24714,
15699,
198,
6738,
644,
271,
270,
13,
33692,
1330,
357,
198,
220,
220,
220,
26112,
3539,
62,
13252,
2394,
11,
220,
198,
220,
220,
220,
26112,
3539,
62,
21886,
198,
8,
198,
198,
11748,
11454,
3919,
198,
11748,
340,
861,
10141,
198,
11748,
28686,
198,
11748,
20218,
7753,
198,
198,
29113,
29113,
7804,
4242,
198,
2,
20514,
32329,
198,
29113,
29113,
7804,
4242,
628
] | 4.157025 | 121 |
import unittest2
from datetime import date, datetime
from helpers.season_helper import SeasonHelper
| [
11748,
555,
715,
395,
17,
198,
6738,
4818,
8079,
1330,
3128,
11,
4818,
8079,
198,
198,
6738,
49385,
13,
6230,
62,
2978,
525,
1330,
7369,
47429,
628
] | 3.777778 | 27 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
201,
198,
201,
198
] | 3.083333 | 12 |
import os
import numpy as np
from sklearn.utils import shuffle
| [
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
1341,
35720,
13,
26791,
1330,
36273,
198
] | 3.705882 | 17 |
import os, sys
name = sys.argv[1]
root_dir = sys.argv[2]
header_dir = os.path.join(root_dir, name)
if not os.path.exists(header_dir):
os.makedirs(header_dir)
files = []
dirs = [("", root_dir)]
for i in range(4):
subdirs = []
for (p, d) in dirs:
files = files + [os.path.join(p, item) for item in os.listdir(d) if os.path.isfile(os.path.join(d, item))]
subdirs = subdirs + [(os.path.join(p, sd), os.path.join(d, sd)) for sd in os.listdir(d) if os.path.isdir(os.path.join(d, sd))]
dirs = subdirs
header = open(os.path.join(root_dir, name + "/" + name + ".h"), "w+")
for f in [f for f in files if name not in f]:
header.write("#include \"" + f + "\"\n")
header.close()
| [
11748,
28686,
11,
25064,
198,
3672,
796,
25064,
13,
853,
85,
58,
16,
60,
198,
15763,
62,
15908,
796,
25064,
13,
853,
85,
58,
17,
60,
198,
25677,
62,
15908,
796,
28686,
13,
6978,
13,
22179,
7,
15763,
62,
15908,
11,
1438,
8,
198,
361,
407,
28686,
13,
6978,
13,
1069,
1023,
7,
25677,
62,
15908,
2599,
198,
220,
220,
220,
28686,
13,
76,
4335,
17062,
7,
25677,
62,
15908,
8,
198,
16624,
796,
17635,
198,
15908,
82,
796,
685,
7203,
1600,
6808,
62,
15908,
15437,
198,
1640,
1312,
287,
2837,
7,
19,
2599,
198,
220,
220,
220,
850,
15908,
82,
796,
17635,
198,
220,
220,
220,
329,
357,
79,
11,
288,
8,
287,
288,
17062,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3696,
796,
3696,
1343,
685,
418,
13,
6978,
13,
22179,
7,
79,
11,
2378,
8,
329,
2378,
287,
28686,
13,
4868,
15908,
7,
67,
8,
611,
28686,
13,
6978,
13,
4468,
576,
7,
418,
13,
6978,
13,
22179,
7,
67,
11,
2378,
4008,
60,
198,
220,
220,
220,
220,
220,
220,
220,
850,
15908,
82,
796,
850,
15908,
82,
1343,
47527,
418,
13,
6978,
13,
22179,
7,
79,
11,
45647,
828,
28686,
13,
6978,
13,
22179,
7,
67,
11,
45647,
4008,
329,
45647,
287,
28686,
13,
4868,
15908,
7,
67,
8,
611,
28686,
13,
6978,
13,
9409,
343,
7,
418,
13,
6978,
13,
22179,
7,
67,
11,
45647,
4008,
60,
198,
220,
220,
220,
288,
17062,
796,
850,
15908,
82,
198,
25677,
220,
796,
1280,
7,
418,
13,
6978,
13,
22179,
7,
15763,
62,
15908,
11,
1438,
1343,
12813,
1,
220,
1343,
1438,
1343,
27071,
71,
12340,
366,
86,
10,
4943,
198,
1640,
277,
287,
685,
69,
329,
277,
287,
3696,
611,
1438,
407,
287,
277,
5974,
198,
220,
220,
220,
13639,
13,
13564,
7203,
2,
17256,
3467,
15931,
1343,
277,
1343,
366,
7879,
59,
77,
4943,
198,
25677,
13,
19836,
3419,
198
] | 2.213836 | 318 |
"""Generic reaction image commands."""
import json
import secrets
from sailor import commands
from sailor.exceptions import UserInputError
def setup(processor):
"""Set up reaction commands."""
with open("reactions.json") as file_object:
reactions = json.load(file_object)
last_image_for_command = {}
async def coro(event, image_number: int = None):
"""Generic coroutine."""
command_properties = reactions.get(event.command.name)
message = command_properties.get("message")
if message:
await event.reply(message)
images = command_properties.get("images")
if not isinstance(images, list):
return
# Avoid repeats when possible
if len(images) > 1 and isinstance(image_number, int):
image_number -= 1
if image_number not in range(len(images)):
raise UserInputError(f"Number must be from 1 to {len(images)}")
image = images[image_number]
else:
image = secrets.choice(images)
while image == last_image_for_command.get(event.command.name):
image = secrets.choice(images)
if len(images) > 1:
last_image_for_command[event.command.name] = image
await event.reply(image)
async def coro_noselect(event):
"""Generic coroutine, without manual image selection."""
await coro(event)
for command_name, command_properties in reactions.items():
aliases = command_properties.get("aliases", [])
num_images = len(command_properties.get("images", []))
if num_images > 1:
new_command = commands.Command(coro, name=command_name, aliases=aliases)
new_command.help = (
f"Randomly posts any of {num_images} {command_name}-themed images.\n\n"
f"A number from 1-{num_images} can be provided to select a specific image."
)
else:
new_command = commands.Command(coro_noselect, name=command_name, aliases=aliases)
new_command.help = f"Posts a {command_name}-themed image."
processor.add_command(new_command)
| [
37811,
46189,
6317,
2939,
9729,
526,
15931,
198,
198,
11748,
33918,
198,
11748,
13141,
198,
198,
6738,
43272,
1330,
9729,
198,
6738,
43272,
13,
1069,
11755,
1330,
11787,
20560,
12331,
628,
198,
4299,
9058,
7,
41341,
2599,
198,
220,
220,
220,
37227,
7248,
510,
6317,
9729,
526,
15931,
628,
220,
220,
220,
351,
1280,
7203,
260,
4658,
13,
17752,
4943,
355,
2393,
62,
15252,
25,
198,
220,
220,
220,
220,
220,
220,
220,
12737,
796,
33918,
13,
2220,
7,
7753,
62,
15252,
8,
628,
220,
220,
220,
938,
62,
9060,
62,
1640,
62,
21812,
796,
23884,
628,
220,
220,
220,
30351,
825,
1162,
78,
7,
15596,
11,
2939,
62,
17618,
25,
493,
796,
6045,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
46189,
1162,
28399,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
3141,
62,
48310,
796,
12737,
13,
1136,
7,
15596,
13,
21812,
13,
3672,
8,
198,
220,
220,
220,
220,
220,
220,
220,
3275,
796,
3141,
62,
48310,
13,
1136,
7203,
20500,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
611,
3275,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25507,
1785,
13,
47768,
7,
20500,
8,
198,
220,
220,
220,
220,
220,
220,
220,
4263,
796,
3141,
62,
48310,
13,
1136,
7203,
17566,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
611,
407,
318,
39098,
7,
17566,
11,
1351,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
24390,
29819,
618,
1744,
198,
220,
220,
220,
220,
220,
220,
220,
611,
18896,
7,
17566,
8,
1875,
352,
290,
318,
39098,
7,
9060,
62,
17618,
11,
493,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2939,
62,
17618,
48185,
352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2939,
62,
17618,
407,
287,
2837,
7,
11925,
7,
17566,
8,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
11787,
20560,
12331,
7,
69,
1,
15057,
1276,
307,
422,
352,
284,
1391,
11925,
7,
17566,
38165,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2939,
796,
4263,
58,
9060,
62,
17618,
60,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2939,
796,
13141,
13,
25541,
7,
17566,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
981,
2939,
6624,
938,
62,
9060,
62,
1640,
62,
21812,
13,
1136,
7,
15596,
13,
21812,
13,
3672,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2939,
796,
13141,
13,
25541,
7,
17566,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
18896,
7,
17566,
8,
1875,
352,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
938,
62,
9060,
62,
1640,
62,
21812,
58,
15596,
13,
21812,
13,
3672,
60,
796,
2939,
198,
220,
220,
220,
220,
220,
220,
220,
25507,
1785,
13,
47768,
7,
9060,
8,
628,
220,
220,
220,
30351,
825,
1162,
78,
62,
77,
577,
801,
7,
15596,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
46189,
1162,
28399,
11,
1231,
10107,
2939,
6356,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
25507,
1162,
78,
7,
15596,
8,
628,
220,
220,
220,
329,
3141,
62,
3672,
11,
3141,
62,
48310,
287,
12737,
13,
23814,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
47217,
796,
3141,
62,
48310,
13,
1136,
7203,
7344,
1386,
1600,
685,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
997,
62,
17566,
796,
18896,
7,
21812,
62,
48310,
13,
1136,
7203,
17566,
1600,
17635,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
611,
997,
62,
17566,
1875,
352,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
649,
62,
21812,
796,
9729,
13,
21575,
7,
10215,
78,
11,
1438,
28,
21812,
62,
3672,
11,
47217,
28,
7344,
1386,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
649,
62,
21812,
13,
16794,
796,
357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
1,
29531,
306,
6851,
597,
286,
1391,
22510,
62,
17566,
92,
1391,
21812,
62,
3672,
92,
12,
26966,
4263,
13,
59,
77,
59,
77,
1,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
1,
32,
1271,
422,
352,
12,
90,
22510,
62,
17566,
92,
460,
307,
2810,
284,
2922,
257,
2176,
2939,
526,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
649,
62,
21812,
796,
9729,
13,
21575,
7,
10215,
78,
62,
77,
577,
801,
11,
1438,
28,
21812,
62,
3672,
11,
47217,
28,
7344,
1386,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
649,
62,
21812,
13,
16794,
796,
277,
1,
21496,
257,
1391,
21812,
62,
3672,
92,
12,
26966,
2939,
526,
198,
220,
220,
220,
220,
220,
220,
220,
12649,
13,
2860,
62,
21812,
7,
3605,
62,
21812,
8,
198
] | 2.423503 | 902 |
from __future__ import print_function, absolute_import, division
from future.builtins import *
from future import standard_library
standard_library.install_aliases()
# Copyright 2017 Autodesk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import functools
import inspect
import os
from functools import wraps
import collections
import funcsigs
from .utils import if_not_none
from .docparsers import GoogleDocArgumentInjector
def args_from(original_function,
only=None,
allexcept=None,
inject_kwargs=None,
inject_docs=None,
wraps=None,
update_docstring_args=False):
"""
Decorator to transfer call signatures - helps to hide ugly *args and **kwargs in delegated calls
Args:
original_function (callable): the function to take the call signature from
only (List[str]): only transfer these arguments (incompatible with `allexcept`)
wraps (bool): Transfer documentation and attributes from original_function to
decorated_function, using functools.wraps (default: True if call signature is
unchanged, False otherwise)
allexcept (List[str]): transfer all except these arguments (incompatible with `only`)
inject_kwargs (dict): Inject new kwargs into the call signature
(of the form ``{argname: defaultvalue}``)
inject_docs (dict): Add or modifies argument documentation (requires google-style
docstrings) with a dict of the form `{argname: "(type): description"}`
update_docstring_args (bool): Update "arguments" section of the docstring using the
original function's documentation (requires google-style docstrings and wraps=False)
Note:
To use arguments from a classes' __init__ method, pass the class itself as
``original_function`` - this will also allow us to inject the documentation
Returns:
Decorator function
"""
# NEWFEATURE - verify arguments?
if only and allexcept:
raise ValueError('Error in keyword arguments - '
'pass *either* "only" or "allexcept", not both')
origname = get_qualified_name(original_function)
if hasattr(original_function, '__signature__'):
sig = original_function.__signature__.replace()
else:
sig = funcsigs.signature(original_function)
# Modify the call signature if necessary
if only or allexcept or inject_kwargs:
wraps = if_not_none(wraps, False)
newparams = []
if only:
for param in only:
newparams.append(sig.parameters[param])
elif allexcept:
for name, param in sig.parameters.items():
if name not in allexcept:
newparams.append(param)
else:
newparams = list(sig.parameters.values())
if inject_kwargs:
for name, default in inject_kwargs.items():
newp = funcsigs.Parameter(name, funcsigs.Parameter.POSITIONAL_OR_KEYWORD,
default=default)
newparams.append(newp)
newparams.sort(key=lambda param: param._kind)
sig = sig.replace(parameters=newparams)
else:
wraps = if_not_none(wraps, True)
# Get the docstring arguments
if update_docstring_args:
original_docs = GoogleDocArgumentInjector(original_function.__doc__)
argument_docstrings = collections.OrderedDict((p.name, original_docs.args[p.name])
for p in newparams)
def decorator(f):
"""Modify f's call signature (using the `__signature__` attribute)"""
if wraps:
fname = original_function.__name__
f = functools.wraps(original_function)(f)
f.__name__ = fname # revert name change
else:
fname = f.__name__
f.__signature__ = sig
if update_docstring_args or inject_kwargs:
if not update_docstring_args:
argument_docstrings = GoogleDocArgumentInjector(f.__doc__).args
docs = GoogleDocArgumentInjector(f.__doc__)
docs.args = argument_docstrings
if not hasattr(f, '__orig_docs'):
f.__orig_docs = []
f.__orig_docs.append(f.__doc__)
f.__doc__ = docs.new_docstring()
# Only for building sphinx documentation:
if os.environ.get('SPHINX_IS_BUILDING_DOCS', ""):
sigstring = '%s%s\n' % (fname, sig)
if hasattr(f, '__doc__') and f.__doc__ is not None:
f.__doc__ = sigstring + f.__doc__
else:
f.__doc__ = sigstring
return f
return decorator
def kwargs_from(reference_function, mod_docs=True):
""" Replaces ``**kwargs`` in a call signature with keyword arguments from another function.
Args:
reference_function (function): function to get kwargs from
mod_docs (bool): whether to modify the decorated function's docstring
Note:
``mod_docs`` works ONLY for google-style docstrings
"""
refsig = funcsigs.signature(reference_function)
origname = get_qualified_name(reference_function)
kwparams = []
for name, param in refsig.parameters.items():
if param.default != param.empty or param.kind in (param.VAR_KEYWORD, param.KEYWORD_ONLY):
if param.name[0] != '_':
kwparams.append(param)
if mod_docs:
refdocs = GoogleDocArgumentInjector(reference_function.__doc__)
return decorator
class DocInherit(object):
"""
Allows methods to inherit docstrings from their superclasses
FROM http://code.activestate.com/recipes/576862/
"""
#idiomatic decorator name
doc_inherit = DocInherit | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
11,
4112,
62,
11748,
11,
7297,
198,
6738,
2003,
13,
18780,
1040,
1330,
1635,
198,
6738,
2003,
1330,
3210,
62,
32016,
198,
20307,
62,
32016,
13,
17350,
62,
7344,
1386,
3419,
198,
198,
2,
15069,
2177,
5231,
4147,
74,
3457,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
7330,
257,
4866,
286,
262,
13789,
379,
198,
2,
198,
2,
220,
220,
220,
220,
2638,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
43,
2149,
24290,
12,
17,
13,
15,
198,
2,
198,
2,
17486,
2672,
416,
9723,
1099,
393,
4987,
284,
287,
3597,
11,
3788,
198,
2,
9387,
739,
262,
13789,
318,
9387,
319,
281,
366,
1921,
3180,
1,
29809,
1797,
11,
198,
2,
42881,
34764,
11015,
6375,
7102,
49828,
11053,
3963,
15529,
509,
12115,
11,
2035,
4911,
393,
17142,
13,
198,
2,
4091,
262,
13789,
329,
262,
2176,
3303,
15030,
21627,
290,
198,
2,
11247,
739,
262,
13789,
13,
198,
11748,
1257,
310,
10141,
198,
11748,
10104,
198,
11748,
28686,
198,
6738,
1257,
310,
10141,
1330,
27521,
198,
198,
11748,
17268,
198,
11748,
1257,
6359,
9235,
198,
198,
6738,
764,
26791,
1330,
611,
62,
1662,
62,
23108,
198,
6738,
764,
15390,
79,
945,
364,
1330,
3012,
23579,
28100,
1713,
818,
752,
273,
628,
198,
4299,
26498,
62,
6738,
7,
14986,
62,
8818,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
691,
28,
14202,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
435,
2588,
984,
28,
14202,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8677,
62,
46265,
22046,
28,
14202,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8677,
62,
31628,
28,
14202,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27521,
28,
14202,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4296,
62,
15390,
8841,
62,
22046,
28,
25101,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
4280,
273,
1352,
284,
4351,
869,
17239,
532,
5419,
284,
7808,
13400,
1635,
22046,
290,
12429,
46265,
22046,
287,
49711,
3848,
628,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2656,
62,
8818,
357,
13345,
540,
2599,
262,
2163,
284,
1011,
262,
869,
9877,
422,
198,
220,
220,
220,
220,
220,
220,
220,
691,
357,
8053,
58,
2536,
60,
2599,
691,
4351,
777,
7159,
357,
259,
38532,
351,
4600,
282,
2588,
984,
63,
8,
198,
220,
220,
220,
220,
220,
220,
220,
27521,
357,
30388,
2599,
20558,
10314,
290,
12608,
422,
2656,
62,
8818,
284,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
24789,
62,
8818,
11,
1262,
1257,
310,
10141,
13,
29988,
862,
357,
12286,
25,
6407,
611,
869,
9877,
318,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21588,
11,
10352,
4306,
8,
198,
220,
220,
220,
220,
220,
220,
220,
435,
2588,
984,
357,
8053,
58,
2536,
60,
2599,
4351,
477,
2845,
777,
7159,
357,
259,
38532,
351,
4600,
8807,
63,
8,
198,
220,
220,
220,
220,
220,
220,
220,
8677,
62,
46265,
22046,
357,
11600,
2599,
554,
752,
649,
479,
86,
22046,
656,
262,
869,
9877,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
1659,
262,
1296,
7559,
90,
853,
3672,
25,
4277,
8367,
92,
15506,
8,
198,
220,
220,
220,
220,
220,
220,
220,
8677,
62,
31628,
357,
11600,
2599,
3060,
393,
953,
6945,
4578,
10314,
357,
47911,
23645,
12,
7635,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2205,
37336,
8,
351,
257,
8633,
286,
262,
1296,
4600,
90,
853,
3672,
25,
30629,
4906,
2599,
6764,
20662,
63,
198,
220,
220,
220,
220,
220,
220,
220,
4296,
62,
15390,
8841,
62,
22046,
357,
30388,
2599,
10133,
366,
853,
2886,
1,
2665,
286,
262,
2205,
8841,
1262,
262,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2656,
2163,
338,
10314,
357,
47911,
23645,
12,
7635,
2205,
37336,
290,
27521,
28,
25101,
8,
628,
220,
220,
220,
5740,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1675,
779,
7159,
422,
257,
6097,
6,
11593,
15003,
834,
2446,
11,
1208,
262,
1398,
2346,
355,
198,
220,
220,
220,
220,
220,
220,
220,
7559,
14986,
62,
8818,
15506,
532,
428,
481,
635,
1249,
514,
284,
8677,
262,
10314,
628,
220,
220,
220,
16409,
25,
198,
220,
220,
220,
220,
220,
220,
220,
4280,
273,
1352,
2163,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1303,
12682,
15112,
40086,
532,
11767,
7159,
30,
628,
220,
220,
220,
611,
691,
290,
435,
2588,
984,
25,
198,
220,
220,
220,
220,
220,
220,
220,
5298,
11052,
12331,
10786,
12331,
287,
21179,
7159,
532,
705,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
6603,
1635,
31336,
9,
366,
8807,
1,
393,
366,
282,
2588,
984,
1600,
407,
1111,
11537,
628,
220,
220,
220,
393,
570,
480,
796,
651,
62,
22557,
62,
3672,
7,
14986,
62,
8818,
8,
628,
220,
220,
220,
611,
468,
35226,
7,
14986,
62,
8818,
11,
705,
834,
12683,
1300,
834,
6,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
43237,
796,
2656,
62,
8818,
13,
834,
12683,
1300,
834,
13,
33491,
3419,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
43237,
796,
1257,
6359,
9235,
13,
12683,
1300,
7,
14986,
62,
8818,
8,
628,
220,
220,
220,
1303,
3401,
1958,
262,
869,
9877,
611,
3306,
198,
220,
220,
220,
611,
691,
393,
435,
2588,
984,
393,
8677,
62,
46265,
22046,
25,
198,
220,
220,
220,
220,
220,
220,
220,
27521,
796,
611,
62,
1662,
62,
23108,
7,
29988,
862,
11,
10352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
649,
37266,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
611,
691,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
5772,
287,
691,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
649,
37266,
13,
33295,
7,
82,
328,
13,
17143,
7307,
58,
17143,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
435,
2588,
984,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1438,
11,
5772,
287,
43237,
13,
17143,
7307,
13,
23814,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
1438,
407,
287,
435,
2588,
984,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
649,
37266,
13,
33295,
7,
17143,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
649,
37266,
796,
1351,
7,
82,
328,
13,
17143,
7307,
13,
27160,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
611,
8677,
62,
46265,
22046,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1438,
11,
4277,
287,
8677,
62,
46265,
22046,
13,
23814,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
649,
79,
796,
1257,
6359,
9235,
13,
36301,
7,
3672,
11,
1257,
6359,
9235,
13,
36301,
13,
37997,
17941,
1847,
62,
1581,
62,
20373,
54,
12532,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4277,
28,
12286,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
649,
37266,
13,
33295,
7,
3605,
79,
8,
628,
220,
220,
220,
220,
220,
220,
220,
649,
37266,
13,
30619,
7,
2539,
28,
50033,
5772,
25,
5772,
13557,
11031,
8,
198,
220,
220,
220,
220,
220,
220,
220,
43237,
796,
43237,
13,
33491,
7,
17143,
7307,
28,
3605,
37266,
8,
628,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
27521,
796,
611,
62,
1662,
62,
23108,
7,
29988,
862,
11,
6407,
8,
628,
220,
220,
220,
1303,
3497,
262,
2205,
8841,
7159,
198,
220,
220,
220,
611,
4296,
62,
15390,
8841,
62,
22046,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2656,
62,
31628,
796,
3012,
23579,
28100,
1713,
818,
752,
273,
7,
14986,
62,
8818,
13,
834,
15390,
834,
8,
198,
220,
220,
220,
220,
220,
220,
220,
4578,
62,
15390,
37336,
796,
17268,
13,
35422,
1068,
35,
713,
19510,
79,
13,
3672,
11,
2656,
62,
31628,
13,
22046,
58,
79,
13,
3672,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
279,
287,
649,
37266,
8,
628,
220,
220,
220,
825,
11705,
1352,
7,
69,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
5841,
1958,
277,
338,
869,
9877,
357,
3500,
262,
4600,
834,
12683,
1300,
834,
63,
11688,
8,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
611,
27521,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
3672,
796,
2656,
62,
8818,
13,
834,
3672,
834,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
796,
1257,
310,
10141,
13,
29988,
862,
7,
14986,
62,
8818,
5769,
69,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
13,
834,
3672,
834,
796,
277,
3672,
220,
1303,
34052,
1438,
1487,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
3672,
796,
277,
13,
834,
3672,
834,
198,
220,
220,
220,
220,
220,
220,
220,
277,
13,
834,
12683,
1300,
834,
796,
43237,
628,
220,
220,
220,
220,
220,
220,
220,
611,
4296,
62,
15390,
8841,
62,
22046,
393,
8677,
62,
46265,
22046,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
407,
4296,
62,
15390,
8841,
62,
22046,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4578,
62,
15390,
37336,
796,
3012,
23579,
28100,
1713,
818,
752,
273,
7,
69,
13,
834,
15390,
834,
737,
22046,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
34165,
796,
3012,
23579,
28100,
1713,
818,
752,
273,
7,
69,
13,
834,
15390,
834,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
34165,
13,
22046,
796,
4578,
62,
15390,
37336,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
407,
468,
35226,
7,
69,
11,
705,
834,
11612,
62,
31628,
6,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
13,
834,
11612,
62,
31628,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
13,
834,
11612,
62,
31628,
13,
33295,
7,
69,
13,
834,
15390,
834,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
13,
834,
15390,
834,
796,
34165,
13,
3605,
62,
15390,
8841,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
5514,
329,
2615,
599,
20079,
87,
10314,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
28686,
13,
268,
2268,
13,
1136,
10786,
4303,
39,
1268,
55,
62,
1797,
62,
19499,
26761,
2751,
62,
38715,
50,
3256,
13538,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43237,
8841,
796,
705,
4,
82,
4,
82,
59,
77,
6,
4064,
357,
69,
3672,
11,
43237,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
468,
35226,
7,
69,
11,
705,
834,
15390,
834,
11537,
290,
277,
13,
834,
15390,
834,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
13,
834,
15390,
834,
796,
43237,
8841,
1343,
277,
13,
834,
15390,
834,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
13,
834,
15390,
834,
796,
43237,
8841,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
277,
628,
220,
220,
220,
1441,
11705,
1352,
628,
198,
4299,
479,
86,
22046,
62,
6738,
7,
35790,
62,
8818,
11,
953,
62,
31628,
28,
17821,
2599,
198,
220,
220,
220,
37227,
18407,
2114,
7559,
1174,
46265,
22046,
15506,
287,
257,
869,
9877,
351,
21179,
7159,
422,
1194,
2163,
13,
628,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
4941,
62,
8818,
357,
8818,
2599,
2163,
284,
651,
479,
86,
22046,
422,
198,
220,
220,
220,
220,
220,
220,
220,
953,
62,
31628,
357,
30388,
2599,
1771,
284,
13096,
262,
24789,
2163,
338,
2205,
8841,
628,
220,
220,
220,
5740,
25,
198,
220,
220,
220,
220,
220,
220,
220,
7559,
4666,
62,
31628,
15506,
2499,
22224,
329,
23645,
12,
7635,
2205,
37336,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1006,
82,
328,
796,
1257,
6359,
9235,
13,
12683,
1300,
7,
35790,
62,
8818,
8,
628,
220,
220,
220,
393,
570,
480,
796,
651,
62,
22557,
62,
3672,
7,
35790,
62,
8818,
8,
628,
220,
220,
220,
479,
86,
37266,
796,
17635,
198,
220,
220,
220,
329,
1438,
11,
5772,
287,
1006,
82,
328,
13,
17143,
7307,
13,
23814,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
611,
5772,
13,
12286,
14512,
5772,
13,
28920,
393,
5772,
13,
11031,
287,
357,
17143,
13,
53,
1503,
62,
20373,
54,
12532,
11,
5772,
13,
20373,
54,
12532,
62,
1340,
11319,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
5772,
13,
3672,
58,
15,
60,
14512,
705,
62,
10354,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
479,
86,
37266,
13,
33295,
7,
17143,
8,
628,
220,
220,
220,
611,
953,
62,
31628,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1006,
31628,
796,
3012,
23579,
28100,
1713,
818,
752,
273,
7,
35790,
62,
8818,
13,
834,
15390,
834,
8,
628,
220,
220,
220,
1441,
11705,
1352,
628,
628,
198,
4871,
14432,
818,
372,
270,
7,
15252,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
40402,
5050,
284,
16955,
2205,
37336,
422,
511,
2208,
37724,
198,
220,
220,
220,
16034,
2638,
1378,
8189,
13,
15791,
44146,
13,
785,
14,
8344,
18636,
14,
3553,
3104,
5237,
14,
198,
220,
220,
220,
37227,
198,
198,
2,
19830,
13730,
11705,
1352,
1438,
198,
15390,
62,
259,
372,
270,
796,
14432,
818,
372,
270
] | 2.471345 | 2,565 |
#!./venv/bin/python
from netbox.views import generic
from .models import Number, VoiceCircuit
from . import filters
from . import forms
from . import tables
from django.conf import settings
from packaging import version
NETBOX_CURRENT_VERSION = version.parse(settings.VERSION)
| [
2,
0,
19571,
574,
85,
14,
8800,
14,
29412,
198,
198,
6738,
2010,
3524,
13,
33571,
1330,
14276,
198,
6738,
764,
27530,
1330,
7913,
11,
15282,
31560,
5013,
198,
6738,
764,
1330,
16628,
198,
6738,
764,
1330,
5107,
198,
6738,
764,
1330,
8893,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
16846,
1330,
2196,
628,
198,
12884,
39758,
62,
34,
39237,
62,
43717,
796,
2196,
13,
29572,
7,
33692,
13,
43717,
8,
628,
628,
628,
628,
628,
628,
628,
198
] | 3.554217 | 83 |
# Copyright 2020 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# https://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import utils.utils as utils
import utils.constants as constants
import collections
from jinja2 import Environment, FileSystemLoader
from typing import List
from utils.utils import PropertyToParent as PropertyToParent
class EnumDescriptor:
"""The EnumDescriptor generates protocol buffer code for schema
enumeration.
Args:
name (str): Name of the schema enumeration.
field_types (list[PropertyToParent]): The schema properties that belong
to the schema enumeration.
enum_values (list[str]): The possible values of the schema enumeration.
Attributes:
name (str): Name of the schema enumeration.
field_types (list[PropertyToParent]): The schema properties that belong
to the schema enumeration.
enum_values (list[str]): The possible values of the schema enumeration.
"""
def to_proto(self, comment: str) -> str:
"""Return proto code for the schema enumeration.
Args:
comment (str): The comment to be added to the code.
Returns:
str: The proto code for the schema enumeration as a string.
"""
assert isinstance(
comment, str), "Invalid parameter 'comment' must be 'str'."
prop_from_self = list()
prop_inherited = dict()
for x in self.field_types:
if x.parent == self.name:
prop_from_self.append(x.name)
else:
if x.parent not in prop_inherited:
prop_inherited[x.parent] = list()
prop_inherited[x.parent].append(x.name)
prop_from_self = sorted(prop_from_self)
prop_inherited = collections.OrderedDict(
sorted(prop_inherited.items()))
file_loader = FileSystemLoader('./core/templates')
env = Environment(
loader=file_loader,
trim_blocks=True,
lstrip_blocks=True)
env.globals['get_property_name'] = utils.get_property_name
env.globals['to_snake_case'] = utils.to_snake_case
env.globals['sorted'] = sorted
env.globals['get_enum_value_name'] = utils.get_enum_value_name
comment = '// ' + comment.replace('\n', '\n// ')
proto_string = env.get_template('enumeration.txt').render(
name=self.name,
prop_from_self=prop_from_self,
prop_inherited=prop_inherited,
comment=comment,
enum_values=self.enum_values,
)
return proto_string
| [
2,
15069,
12131,
3012,
11419,
198,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
7330,
257,
4866,
286,
262,
13789,
379,
198,
198,
2,
220,
220,
220,
220,
3740,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
43,
2149,
24290,
12,
17,
13,
15,
198,
198,
2,
17486,
2672,
416,
9723,
1099,
393,
4987,
284,
287,
3597,
11,
3788,
198,
2,
9387,
739,
262,
13789,
318,
9387,
319,
281,
366,
1921,
3180,
1,
29809,
1797,
11,
198,
2,
42881,
34764,
11015,
6375,
7102,
49828,
11053,
3963,
15529,
509,
12115,
11,
2035,
4911,
393,
17142,
13,
198,
2,
4091,
262,
13789,
329,
262,
2176,
3303,
15030,
21627,
290,
198,
2,
11247,
739,
262,
13789,
13,
198,
11748,
3384,
4487,
13,
26791,
355,
3384,
4487,
198,
11748,
3384,
4487,
13,
9979,
1187,
355,
38491,
198,
11748,
17268,
198,
6738,
474,
259,
6592,
17,
1330,
9344,
11,
9220,
11964,
17401,
198,
6738,
19720,
1330,
7343,
198,
6738,
3384,
4487,
13,
26791,
1330,
14161,
2514,
24546,
355,
14161,
2514,
24546,
628,
198,
4871,
2039,
388,
24564,
1968,
273,
25,
198,
220,
220,
220,
37227,
464,
2039,
388,
24564,
1968,
273,
18616,
8435,
11876,
2438,
329,
32815,
198,
220,
220,
220,
27056,
341,
13,
628,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
357,
2536,
2599,
6530,
286,
262,
32815,
27056,
341,
13,
198,
220,
220,
220,
220,
220,
220,
220,
2214,
62,
19199,
357,
4868,
58,
21746,
2514,
24546,
60,
2599,
383,
32815,
6608,
326,
5594,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
284,
262,
32815,
27056,
341,
13,
198,
220,
220,
220,
220,
220,
220,
220,
33829,
62,
27160,
357,
4868,
58,
2536,
60,
2599,
383,
1744,
3815,
286,
262,
32815,
27056,
341,
13,
628,
220,
220,
220,
49213,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
357,
2536,
2599,
6530,
286,
262,
32815,
27056,
341,
13,
198,
220,
220,
220,
220,
220,
220,
220,
2214,
62,
19199,
357,
4868,
58,
21746,
2514,
24546,
60,
2599,
383,
32815,
6608,
326,
5594,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
284,
262,
32815,
27056,
341,
13,
198,
220,
220,
220,
220,
220,
220,
220,
33829,
62,
27160,
357,
4868,
58,
2536,
60,
2599,
383,
1744,
3815,
286,
262,
32815,
27056,
341,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
284,
62,
1676,
1462,
7,
944,
11,
2912,
25,
965,
8,
4613,
965,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
13615,
44876,
2438,
329,
262,
32815,
27056,
341,
13,
628,
220,
220,
220,
220,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2912,
357,
2536,
2599,
383,
2912,
284,
307,
2087,
284,
262,
2438,
13,
628,
220,
220,
220,
220,
220,
220,
220,
16409,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
965,
25,
383,
44876,
2438,
329,
262,
32815,
27056,
341,
355,
257,
4731,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
6818,
318,
39098,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2912,
11,
965,
828,
366,
44651,
11507,
705,
23893,
6,
1276,
307,
705,
2536,
30827,
628,
220,
220,
220,
220,
220,
220,
220,
2632,
62,
6738,
62,
944,
796,
1351,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2632,
62,
259,
372,
863,
796,
8633,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
329,
2124,
287,
2116,
13,
3245,
62,
19199,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2124,
13,
8000,
6624,
2116,
13,
3672,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2632,
62,
6738,
62,
944,
13,
33295,
7,
87,
13,
3672,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2124,
13,
8000,
407,
287,
2632,
62,
259,
372,
863,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2632,
62,
259,
372,
863,
58,
87,
13,
8000,
60,
796,
1351,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2632,
62,
259,
372,
863,
58,
87,
13,
8000,
4083,
33295,
7,
87,
13,
3672,
8,
628,
220,
220,
220,
220,
220,
220,
220,
2632,
62,
6738,
62,
944,
796,
23243,
7,
22930,
62,
6738,
62,
944,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2632,
62,
259,
372,
863,
796,
17268,
13,
35422,
1068,
35,
713,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23243,
7,
22930,
62,
259,
372,
863,
13,
23814,
3419,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
2393,
62,
29356,
796,
9220,
11964,
17401,
7,
4458,
14,
7295,
14,
11498,
17041,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
17365,
796,
9344,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
40213,
28,
7753,
62,
29356,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15797,
62,
27372,
28,
17821,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
36311,
62,
27372,
28,
17821,
8,
198,
220,
220,
220,
220,
220,
220,
220,
17365,
13,
4743,
672,
874,
17816,
1136,
62,
26745,
62,
3672,
20520,
796,
3384,
4487,
13,
1136,
62,
26745,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
17365,
13,
4743,
672,
874,
17816,
1462,
62,
16184,
539,
62,
7442,
20520,
796,
3384,
4487,
13,
1462,
62,
16184,
539,
62,
7442,
198,
220,
220,
220,
220,
220,
220,
220,
17365,
13,
4743,
672,
874,
17816,
82,
9741,
20520,
796,
23243,
198,
220,
220,
220,
220,
220,
220,
220,
17365,
13,
4743,
672,
874,
17816,
1136,
62,
44709,
62,
8367,
62,
3672,
20520,
796,
3384,
4487,
13,
1136,
62,
44709,
62,
8367,
62,
3672,
628,
220,
220,
220,
220,
220,
220,
220,
2912,
796,
705,
1003,
705,
1343,
2912,
13,
33491,
10786,
59,
77,
3256,
705,
59,
77,
1003,
705,
8,
198,
220,
220,
220,
220,
220,
220,
220,
44876,
62,
8841,
796,
17365,
13,
1136,
62,
28243,
10786,
268,
6975,
341,
13,
14116,
27691,
13287,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
28,
944,
13,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2632,
62,
6738,
62,
944,
28,
22930,
62,
6738,
62,
944,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2632,
62,
259,
372,
863,
28,
22930,
62,
259,
372,
863,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2912,
28,
23893,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33829,
62,
27160,
28,
944,
13,
44709,
62,
27160,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
44876,
62,
8841,
198
] | 2.436055 | 1,298 |
from . import controllers
from . import messages
from grow.common import urls
from grow.translations import locales
from datetime import datetime
import fnmatch
import hashlib
import mimetypes
import os
import re
import time
import webob
import yaml
mimetypes.add_type('application/font-woff', '.woff')
mimetypes.add_type('application/font-woff', '.woff')
mimetypes.add_type('image/bmp', '.cur')
mimetypes.add_type('image/svg+xml', '.svg')
mimetypes.add_type('text/css', '.css')
SKIP_PATTERNS = [
'**/.**',
]
# Allow the yaml dump to write out a representation of the static file.
yaml.SafeDumper.add_representer(StaticFile, static_representer)
| [
6738,
764,
1330,
20624,
198,
6738,
764,
1330,
6218,
198,
6738,
1663,
13,
11321,
1330,
2956,
7278,
198,
6738,
1663,
13,
7645,
49905,
1330,
1957,
274,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
24714,
15699,
198,
11748,
12234,
8019,
198,
11748,
17007,
2963,
12272,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
640,
198,
11748,
3992,
672,
198,
11748,
331,
43695,
198,
198,
76,
320,
2963,
12272,
13,
2860,
62,
4906,
10786,
31438,
14,
10331,
12,
86,
2364,
3256,
45302,
86,
2364,
11537,
198,
76,
320,
2963,
12272,
13,
2860,
62,
4906,
10786,
31438,
14,
10331,
12,
86,
2364,
3256,
45302,
86,
2364,
11537,
198,
76,
320,
2963,
12272,
13,
2860,
62,
4906,
10786,
9060,
14,
65,
3149,
3256,
45302,
22019,
11537,
198,
76,
320,
2963,
12272,
13,
2860,
62,
4906,
10786,
9060,
14,
21370,
70,
10,
19875,
3256,
45302,
21370,
70,
11537,
198,
76,
320,
2963,
12272,
13,
2860,
62,
4906,
10786,
5239,
14,
25471,
3256,
45302,
25471,
11537,
628,
198,
18831,
4061,
62,
47,
1404,
5781,
8035,
796,
685,
198,
220,
220,
220,
705,
1174,
11757,
1174,
3256,
198,
60,
628,
628,
628,
198,
2,
22507,
262,
331,
43695,
10285,
284,
3551,
503,
257,
10552,
286,
262,
9037,
2393,
13,
198,
198,
88,
43695,
13,
31511,
35,
15829,
13,
2860,
62,
15603,
263,
7,
45442,
8979,
11,
9037,
62,
15603,
263,
8,
198
] | 2.903084 | 227 |
# -*- mode:python; coding:utf-8 -*-
# Copyright (c) 2020 IBM Corp. 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for trestle write actions class."""
import os
from tests import test_utils
import trestle.common.const as const
from trestle.core.models.actions import WriteAction
from trestle.core.models.elements import Element
from trestle.core.models.file_content_type import FileContentType
def test_write_action_yaml(tmp_yaml_file, sample_nist_component_def):
"""Test write yaml action."""
element = Element(sample_nist_component_def, 'component-definition')
with open(tmp_yaml_file, 'w+', encoding=const.FILE_ENCODING) as writer:
wa = WriteAction(writer, element, FileContentType.YAML)
wa.execute()
writer.flush()
writer.close()
test_utils.verify_file_content(tmp_yaml_file, element.get())
os.remove(tmp_yaml_file)
def test_write_action_json(tmp_json_file, sample_nist_component_def):
"""Test write json action."""
element = Element(sample_nist_component_def, 'component-definition')
with open(tmp_json_file, 'w+', encoding=const.FILE_ENCODING) as writer:
wa = WriteAction(writer, element, FileContentType.JSON)
wa.execute()
writer.flush()
writer.close()
test_utils.verify_file_content(tmp_json_file, element.get())
os.remove(tmp_json_file)
| [
2,
532,
9,
12,
4235,
25,
29412,
26,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
198,
2,
15069,
357,
66,
8,
12131,
19764,
11421,
13,
1439,
2489,
10395,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
7330,
257,
4866,
286,
262,
13789,
379,
198,
2,
198,
2,
220,
220,
220,
220,
3740,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
43,
2149,
24290,
12,
17,
13,
15,
198,
2,
198,
2,
17486,
2672,
416,
9723,
1099,
393,
4987,
284,
287,
3597,
11,
3788,
198,
2,
9387,
739,
262,
13789,
318,
9387,
319,
281,
366,
1921,
3180,
1,
29809,
1797,
11,
198,
2,
42881,
34764,
11015,
6375,
7102,
49828,
11053,
3963,
15529,
509,
12115,
11,
2035,
4911,
393,
17142,
13,
198,
2,
4091,
262,
13789,
329,
262,
2176,
3303,
15030,
21627,
290,
198,
2,
11247,
739,
262,
13789,
13,
198,
37811,
51,
3558,
329,
2054,
301,
293,
3551,
4028,
1398,
526,
15931,
198,
198,
11748,
28686,
198,
198,
6738,
5254,
1330,
1332,
62,
26791,
198,
198,
11748,
2054,
301,
293,
13,
11321,
13,
9979,
355,
1500,
198,
6738,
2054,
301,
293,
13,
7295,
13,
27530,
13,
4658,
1330,
19430,
12502,
198,
6738,
2054,
301,
293,
13,
7295,
13,
27530,
13,
68,
3639,
1330,
11703,
198,
6738,
2054,
301,
293,
13,
7295,
13,
27530,
13,
7753,
62,
11299,
62,
4906,
1330,
9220,
19746,
6030,
628,
198,
4299,
1332,
62,
13564,
62,
2673,
62,
88,
43695,
7,
22065,
62,
88,
43695,
62,
7753,
11,
6291,
62,
77,
396,
62,
42895,
62,
4299,
2599,
198,
220,
220,
220,
37227,
14402,
3551,
331,
43695,
2223,
526,
15931,
198,
220,
220,
220,
5002,
796,
11703,
7,
39873,
62,
77,
396,
62,
42895,
62,
4299,
11,
705,
42895,
12,
46758,
11537,
628,
220,
220,
220,
351,
1280,
7,
22065,
62,
88,
43695,
62,
7753,
11,
705,
86,
10,
3256,
21004,
28,
9979,
13,
25664,
62,
24181,
3727,
2751,
8,
355,
6260,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2082,
796,
19430,
12502,
7,
16002,
11,
5002,
11,
9220,
19746,
6030,
13,
56,
2390,
43,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2082,
13,
41049,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
6260,
13,
25925,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
6260,
13,
19836,
3419,
628,
220,
220,
220,
1332,
62,
26791,
13,
332,
1958,
62,
7753,
62,
11299,
7,
22065,
62,
88,
43695,
62,
7753,
11,
5002,
13,
1136,
28955,
628,
220,
220,
220,
28686,
13,
28956,
7,
22065,
62,
88,
43695,
62,
7753,
8,
628,
198,
4299,
1332,
62,
13564,
62,
2673,
62,
17752,
7,
22065,
62,
17752,
62,
7753,
11,
6291,
62,
77,
396,
62,
42895,
62,
4299,
2599,
198,
220,
220,
220,
37227,
14402,
3551,
33918,
2223,
526,
15931,
198,
220,
220,
220,
5002,
796,
11703,
7,
39873,
62,
77,
396,
62,
42895,
62,
4299,
11,
705,
42895,
12,
46758,
11537,
628,
220,
220,
220,
351,
1280,
7,
22065,
62,
17752,
62,
7753,
11,
705,
86,
10,
3256,
21004,
28,
9979,
13,
25664,
62,
24181,
3727,
2751,
8,
355,
6260,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2082,
796,
19430,
12502,
7,
16002,
11,
5002,
11,
9220,
19746,
6030,
13,
40386,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2082,
13,
41049,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
6260,
13,
25925,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
6260,
13,
19836,
3419,
628,
220,
220,
220,
1332,
62,
26791,
13,
332,
1958,
62,
7753,
62,
11299,
7,
22065,
62,
17752,
62,
7753,
11,
5002,
13,
1136,
28955,
628,
220,
220,
220,
28686,
13,
28956,
7,
22065,
62,
17752,
62,
7753,
8,
198
] | 2.957813 | 640 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2013 PolyBeacon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from oslo.config import cfg
# Register options for the service
API_SERVICE_OPTS = [
cfg.IntOpt('port',
default=9869,
deprecated_name='bind_port',
deprecated_group='DEFAULT',
help='The port for the ripcord API server.',
),
cfg.StrOpt('host',
default='0.0.0.0',
deprecated_name='bind_host',
deprecated_group='DEFAULT',
help='The listen IP for the ripcord API server.',
),
cfg.BoolOpt('enable_reverse_dns_lookup',
default=False,
help=('Set it to False if your environment does not need '
'or have dns server, otherwise it will delay the '
'response from api.')
),
]
CONF = cfg.CONF
opt_group = cfg.OptGroup(name='api',
title='Options for the ripcord-api service')
CONF.register_group(opt_group)
CONF.register_opts(API_SERVICE_OPTS, opt_group)
| [
2,
43907,
25,
7400,
11338,
28,
19,
6482,
10394,
28,
19,
2705,
8658,
11338,
28,
19,
198,
198,
2,
15069,
357,
34,
8,
2211,
12280,
3856,
7807,
11,
3457,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
7330,
257,
4866,
286,
262,
13789,
379,
198,
2,
198,
2,
220,
220,
220,
2638,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
43,
2149,
24290,
12,
17,
13,
15,
198,
2,
198,
2,
17486,
2672,
416,
9723,
1099,
393,
4987,
284,
287,
3597,
11,
3788,
198,
2,
9387,
739,
262,
13789,
318,
9387,
319,
281,
366,
1921,
3180,
1,
29809,
1797,
11,
198,
2,
42881,
34764,
11015,
6375,
7102,
49828,
11053,
3963,
15529,
509,
12115,
11,
2035,
4911,
393,
17142,
13,
198,
2,
4091,
262,
13789,
329,
262,
2176,
3303,
15030,
21627,
290,
198,
2,
11247,
739,
262,
13789,
13,
198,
198,
6738,
28686,
5439,
13,
11250,
1330,
30218,
70,
198,
198,
2,
17296,
3689,
329,
262,
2139,
198,
17614,
62,
35009,
27389,
62,
3185,
4694,
796,
685,
198,
220,
220,
220,
30218,
70,
13,
5317,
27871,
10786,
634,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4277,
28,
4089,
3388,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
39224,
62,
3672,
11639,
21653,
62,
634,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
39224,
62,
8094,
11639,
7206,
38865,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1037,
11639,
464,
2493,
329,
262,
18344,
66,
585,
7824,
4382,
2637,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10612,
198,
220,
220,
220,
30218,
70,
13,
13290,
27871,
10786,
4774,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4277,
11639,
15,
13,
15,
13,
15,
13,
15,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
39224,
62,
3672,
11639,
21653,
62,
4774,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
39224,
62,
8094,
11639,
7206,
38865,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1037,
11639,
464,
6004,
6101,
329,
262,
18344,
66,
585,
7824,
4382,
2637,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10612,
198,
220,
220,
220,
30218,
70,
13,
33,
970,
27871,
10786,
21633,
62,
50188,
62,
67,
5907,
62,
5460,
929,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4277,
28,
25101,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1037,
28,
10786,
7248,
340,
284,
10352,
611,
534,
2858,
857,
407,
761,
705,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
273,
423,
288,
5907,
4382,
11,
4306,
340,
481,
5711,
262,
705,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
26209,
422,
40391,
2637,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10612,
198,
60,
198,
198,
10943,
37,
796,
30218,
70,
13,
10943,
37,
198,
8738,
62,
8094,
796,
30218,
70,
13,
27871,
13247,
7,
3672,
11639,
15042,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3670,
11639,
29046,
329,
262,
18344,
66,
585,
12,
15042,
2139,
11537,
198,
10943,
37,
13,
30238,
62,
8094,
7,
8738,
62,
8094,
8,
198,
10943,
37,
13,
30238,
62,
404,
912,
7,
17614,
62,
35009,
27389,
62,
3185,
4694,
11,
2172,
62,
8094,
8,
198
] | 2.37069 | 696 |
import os
import shutil
import nox
nox.options.reuse_existing_virtualenvs = True
PYTHON_VERSIONS = ['3.6', '3.7', '3.8']
@nox.session(python=PYTHON_VERSIONS[-1])
def lint(session):
"""Performs pep8 and security checks."""
source_code = 'configuror'
session.install('flake8==3.7.9', 'bandit==1.6.2')
session.run('flake8', source_code)
session.run('bandit', '-r', source_code)
@nox.session(python=PYTHON_VERSIONS)
def tests(session):
"""Runs the test suite."""
session.install('poetry>=1.0.0,<2.0.0')
session.run('poetry', 'install')
session.cd('tests')
session.run('pytest')
# we notify codecov when the latest version of python is used
if session.python == PYTHON_VERSIONS[-1] and 'APPVEYOR_URL' not in os.environ:
session.notify('codecov')
@nox.session
def codecov(session):
"""Runs codecov command to share coverage information on codecov.io"""
session.install('codecov==2.0.15')
session.cd('tests')
session.run('coverage', 'xml', '-i')
session.run('codecov', '-f', 'coverage.xml')
@nox.session(python=PYTHON_VERSIONS[-1])
def docs(session):
"""Builds the documentation."""
session.install('mkdocs==1.1')
session.run('mkdocs', 'build', '--clean')
@nox.session(python=PYTHON_VERSIONS[-1])
def deploy(session):
"""
Deploys on pypi.
"""
if 'POETRY_PYPI_TOKEN_PYPI' not in os.environ:
session.error('you must specify your pypi token api to deploy your package')
session.install('poetry>=1.0.0,<2.0.0')
session.run('poetry', 'publish', '--build')
@nox.session(python=False)
def clean(*_):
"""Since nox take a bit of memory, this command helps to clean nox environment."""
shutil.rmtree('.nox', ignore_errors=True)
| [
11748,
28686,
198,
11748,
4423,
346,
198,
198,
11748,
645,
87,
198,
198,
35420,
13,
25811,
13,
260,
1904,
62,
25687,
62,
32844,
268,
14259,
796,
6407,
198,
198,
47,
56,
4221,
1340,
62,
28884,
11053,
796,
37250,
18,
13,
21,
3256,
705,
18,
13,
22,
3256,
705,
18,
13,
23,
20520,
628,
198,
31,
35420,
13,
29891,
7,
29412,
28,
47,
56,
4221,
1340,
62,
28884,
11053,
58,
12,
16,
12962,
198,
4299,
300,
600,
7,
29891,
2599,
198,
220,
220,
220,
37227,
5990,
23914,
279,
538,
23,
290,
2324,
8794,
526,
15931,
198,
220,
220,
220,
2723,
62,
8189,
796,
705,
11250,
333,
273,
6,
198,
220,
220,
220,
6246,
13,
17350,
10786,
47597,
23,
855,
18,
13,
22,
13,
24,
3256,
705,
3903,
270,
855,
16,
13,
21,
13,
17,
11537,
198,
220,
220,
220,
6246,
13,
5143,
10786,
47597,
23,
3256,
2723,
62,
8189,
8,
198,
220,
220,
220,
6246,
13,
5143,
10786,
3903,
270,
3256,
705,
12,
81,
3256,
2723,
62,
8189,
8,
628,
198,
31,
35420,
13,
29891,
7,
29412,
28,
47,
56,
4221,
1340,
62,
28884,
11053,
8,
198,
4299,
5254,
7,
29891,
2599,
198,
220,
220,
220,
37227,
10987,
82,
262,
1332,
18389,
526,
15931,
198,
220,
220,
220,
6246,
13,
17350,
10786,
7501,
11973,
29,
28,
16,
13,
15,
13,
15,
11,
27,
17,
13,
15,
13,
15,
11537,
198,
220,
220,
220,
6246,
13,
5143,
10786,
7501,
11973,
3256,
705,
17350,
11537,
198,
220,
220,
220,
6246,
13,
10210,
10786,
41989,
11537,
198,
220,
220,
220,
6246,
13,
5143,
10786,
9078,
9288,
11537,
628,
220,
220,
220,
1303,
356,
19361,
40481,
709,
618,
262,
3452,
2196,
286,
21015,
318,
973,
198,
220,
220,
220,
611,
6246,
13,
29412,
6624,
350,
56,
4221,
1340,
62,
28884,
11053,
58,
12,
16,
60,
290,
705,
24805,
6089,
56,
1581,
62,
21886,
6,
407,
287,
28686,
13,
268,
2268,
25,
198,
220,
220,
220,
220,
220,
220,
220,
6246,
13,
1662,
1958,
10786,
19815,
721,
709,
11537,
628,
198,
31,
35420,
13,
29891,
198,
4299,
40481,
709,
7,
29891,
2599,
198,
220,
220,
220,
37227,
10987,
82,
40481,
709,
3141,
284,
2648,
5197,
1321,
319,
40481,
709,
13,
952,
37811,
198,
220,
220,
220,
6246,
13,
17350,
10786,
19815,
721,
709,
855,
17,
13,
15,
13,
1314,
11537,
198,
220,
220,
220,
6246,
13,
10210,
10786,
41989,
11537,
198,
220,
220,
220,
6246,
13,
5143,
10786,
1073,
1857,
3256,
705,
19875,
3256,
705,
12,
72,
11537,
198,
220,
220,
220,
6246,
13,
5143,
10786,
19815,
721,
709,
3256,
705,
12,
69,
3256,
705,
1073,
1857,
13,
19875,
11537,
628,
198,
31,
35420,
13,
29891,
7,
29412,
28,
47,
56,
4221,
1340,
62,
28884,
11053,
58,
12,
16,
12962,
198,
4299,
34165,
7,
29891,
2599,
198,
220,
220,
220,
37227,
15580,
82,
262,
10314,
526,
15931,
198,
220,
220,
220,
6246,
13,
17350,
10786,
28015,
31628,
855,
16,
13,
16,
11537,
198,
220,
220,
220,
6246,
13,
5143,
10786,
28015,
31628,
3256,
705,
11249,
3256,
705,
438,
27773,
11537,
628,
198,
31,
35420,
13,
29891,
7,
29412,
28,
47,
56,
4221,
1340,
62,
28884,
11053,
58,
12,
16,
12962,
198,
4299,
6061,
7,
29891,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
34706,
82,
319,
279,
4464,
72,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
611,
705,
16402,
2767,
18276,
62,
47,
56,
11901,
62,
10468,
43959,
62,
47,
56,
11901,
6,
407,
287,
28686,
13,
268,
2268,
25,
198,
220,
220,
220,
220,
220,
220,
220,
6246,
13,
18224,
10786,
5832,
1276,
11986,
534,
279,
4464,
72,
11241,
40391,
284,
6061,
534,
5301,
11537,
628,
220,
220,
220,
6246,
13,
17350,
10786,
7501,
11973,
29,
28,
16,
13,
15,
13,
15,
11,
27,
17,
13,
15,
13,
15,
11537,
198,
220,
220,
220,
6246,
13,
5143,
10786,
7501,
11973,
3256,
705,
12984,
1836,
3256,
705,
438,
11249,
11537,
628,
198,
31,
35420,
13,
29891,
7,
29412,
28,
25101,
8,
198,
4299,
3424,
46491,
62,
2599,
198,
220,
220,
220,
37227,
6385,
645,
87,
1011,
257,
1643,
286,
4088,
11,
428,
3141,
5419,
284,
3424,
645,
87,
2858,
526,
15931,
198,
220,
220,
220,
4423,
346,
13,
81,
16762,
631,
7,
4458,
35420,
3256,
8856,
62,
48277,
28,
17821,
8,
198
] | 2.469761 | 711 |
# coding:utf-8
#
# The MIT License (MIT)
#
# Copyright (c) 2018-2020 azai/Rgveda/GolemQuant
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
import datetime
import time
import numpy as np
import pandas as pd
import pymongo
try:
import QUANTAXIS as QA
from QUANTAXIS.QAUtil import (QASETTING,
DATABASE,
QA_util_log_info,
QA_util_to_json_from_pandas,)
from QUANTAXIS.QAUtil.QAParameter import ORDER_DIRECTION
from QUANTAXIS.QAData.QADataStruct import (QA_DataStruct_Index_min,
QA_DataStruct_Index_day,
QA_DataStruct_Stock_day,
QA_DataStruct_Stock_min)
from QUANTAXIS.QAUtil.QADate_Adv import (
QA_util_timestamp_to_str,
QA_util_datetime_to_Unix_timestamp,
QA_util_print_timestamp
)
except:
print('PLEASE run "pip install QUANTAXIS" to call these modules')
pass
try:
from GolemQ.GQUtil.parameter import (
AKA,
INDICATOR_FIELD as FLD,
TREND_STATUS as ST,
)
except:
class AKA():
"""
趋势状态常量,专有名称指标,定义成常量可以避免直接打字符串造成的拼写错误。
"""
# 蜡烛线指标
CODE = 'code'
NAME = 'name'
OPEN = 'open'
HIGH = 'high'
LOW = 'low'
CLOSE = 'close'
VOLUME = 'volume'
VOL = 'vol'
DATETIME = 'datetime'
LAST_CLOSE = 'last_close'
PRICE = 'price'
SYSTEM_NAME = 'myQuant'
class ST():
"""
趋势状态常量,专有名称指标,定义成常量可以避免直接打字符串造成的拼写错误。
"""
# 状态
POSITION_R5 = 'POS_R5'
TRIGGER_R5 = 'TRG_R5'
CANDIDATE = 'CANDIDATE'
def GQSignal_util_save_indices_day(code,
indices,
market_type=QA.MARKET_TYPE.STOCK_CN,
portfolio='myportfolio',
ui_log=None,
ui_progress=None):
"""
在数据库中保存所有计算出来的股票日线指标,用于汇总评估和筛选数据——日线
save stock_indices, state
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE})
"""
client = QASETTING.client[AKA.SYSTEM_NAME]
# 同时写入横表和纵表,减少查询困扰
#coll_day = client.get_collection(
# 'indices_{}'.format(datetime.date.today()))
try:
if (market_type == QA.MARKET_TYPE.STOCK_CN):
#coll_indices = client.stock_cn_indices_day
coll_indices = client.get_collection('stock_cn_indices_{}'.format(portfolio))
elif (market_type == QA.MARKET_TYPE.INDEX_CN):
#coll_indices = client.index_cn_indices_day
coll_indices = client.get_collection('index_cn_indices_{}'.format(portfolio))
elif (market_type == QA.MARKET_TYPE.FUND_CN):
#coll_indices = client.fund_cn_indices_day
coll_indices = client.get_collection('fund_cn_indices_{}'.format(portfolio))
elif (market_type == QA.MARKET_TYPE.FUTURE_CN):
#coll_indices = client.future_cn_indices_day
coll_indices = client.get_collection('future_cn_indices_{}'.format(portfolio))
elif (market_type == QA.MARKET_TYPE.CRYPTOCURRENCY):
#coll_indices = client.cryptocurrency_indices_day
coll_indices = client.get_collection('cryptocurrency_indices_{}'.format(portfolio))
else:
QA_util_log_info('WTF IS THIS! {} \n '.format(market_type), ui_log=ui_log)
return False
except Exception as e:
QA_util_log_info(e)
QA_util_log_info('WTF IS THIS! \n ', ui_log=ui_log)
return False
_check_index(coll_indices)
data = _formatter_data(indices)
err = []
# 查询是否新 tick
query_id = {
"code": code,
'date_stamp': {
'$in': data['date_stamp'].tolist()
}
}
refcount = coll_indices.count_documents(query_id)
if refcount > 0:
if (len(data) > 1):
# 删掉重复数据
coll_indices.delete_many(query_id)
data = QA_util_to_json_from_pandas(data)
coll_indices.insert_many(data)
else:
# 持续更新模式,更新单条记录
data.drop('created_at', axis=1, inplace=True)
data = QA_util_to_json_from_pandas(data)
coll_indices.replace_one(query_id, data[0])
else:
# 新 tick,插入记录
data = QA_util_to_json_from_pandas(data)
coll_indices.insert_many(data)
return True
def GQSignal_util_save_indices_min(code,
indices,
frequence,
market_type=QA.MARKET_TYPE.STOCK_CN,
portfolio='myportfolio',
ui_log=None,
ui_progress=None):
"""
在数据库中保存所有计算出来的指标信息,用于汇总评估和筛选数据——分钟线
save stock_indices, state
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE})
"""
client = QASETTING.client[AKA.SYSTEM_NAME]
# 同时写入横表和纵表,减少查询困扰
#coll_day = client.get_collection(
# 'indices_{}'.format(datetime.date.today()))
try:
if (market_type == QA.MARKET_TYPE.STOCK_CN):
#coll_indices = client.stock_cn_indices_min
coll_indices = client.get_collection('stock_cn_indices_{}'.format(portfolio))
elif (market_type == QA.MARKET_TYPE.INDEX_CN):
#coll_indices = client.index_cn_indices_min
coll_indices = client.get_collection('index_cn_indices_{}'.format(portfolio))
elif (market_type == QA.MARKET_TYPE.FUND_CN):
#coll_indices = client.future_cn_indices_min
coll_indices = client.get_collection('fund_cn_indices_{}'.format(portfolio))
elif (market_type == QA.MARKET_TYPE.FUTURE_CN):
#coll_indices = client.future_cn_indices_min
coll_indices = client.get_collection('future_cn_indices_{}'.format(portfolio))
elif (market_type == QA.MARKET_TYPE.CRYPTOCURRENCY):
#coll_indices = client.cryptocurrency_indices_min
coll_indices = client.get_collection('cryptocurrency_indices_{}'.format(portfolio))
else:
QA_util_log_info('WTF IS THIS! \n ', ui_log=ui_log)
return False
except Exception as e:
QA_util_log_info(e)
QA_util_log_info('WTF IS THIS! \n ', ui_log=ui_log)
return False
_check_index(coll_indices)
data = _formatter_data(indices, frequence)
err = []
# 查询是否新 tick
query_id = {
"code": code,
'type': frequence,
"time_stamp": {
'$in': data['time_stamp'].tolist()
}
}
refcount = coll_indices.count_documents(query_id)
if refcount > 0:
if (len(data) > 1):
# 删掉重复数据
coll_indices.delete_many(query_id)
data = QA_util_to_json_from_pandas(data)
coll_indices.insert_many(data)
else:
# 持续更新模式,更新单条记录
data.drop('created_at', axis=1, inplace=True)
data = QA_util_to_json_from_pandas(data)
coll_indices.replace_one(query_id, data[0])
else:
# 新 tick,插入记录
data = QA_util_to_json_from_pandas(data)
coll_indices.insert_many(data)
return True
def GQSignal_fetch_position_singal_day(start,
end,
frequence='day',
market_type=QA.MARKET_TYPE.STOCK_CN,
portfolio='myportfolio',
format='numpy',
ui_log=None,
ui_progress=None):
"""
'获取股票指标日线'
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE})
"""
start = str(start)[0:10]
end = str(end)[0:10]
#code= [code] if isinstance(code,str) else code
client = QASETTING.client[AKA.SYSTEM_NAME]
# 同时写入横表和纵表,减少查询困扰
#coll_day = client.get_collection(
# 'indices_{}'.format(datetime.date.today()))
try:
if (market_type == QA.MARKET_TYPE.STOCK_CN):
#coll_indices = client.stock_cn_indices_min
coll_indices = client.get_collection('stock_cn_indices_{}'.format(portfolio))
elif (market_type == QA.MARKET_TYPE.INDEX_CN):
#coll_indices = client.index_cn_indices_min
coll_indices = client.get_collection('index_cn_indices_{}'.format(portfolio))
elif (market_type == QA.MARKET_TYPE.FUND_CN):
#coll_indices = client.future_cn_indices_min
coll_indices = client.get_collection('fund_cn_indices_{}'.format(portfolio))
elif (market_type == QA.MARKET_TYPE.FUTURE_CN):
#coll_indices = client.future_cn_indices_min
coll_indices = client.get_collection('future_cn_indices_{}'.format(portfolio))
elif (market_type == QA.MARKET_TYPE.CRYPTOCURRENCY):
#coll_indices = client.cryptocurrency_indices_min
coll_indices = client.get_collection('cryptocurrency_indices_{}'.format(portfolio))
else:
QA_util_log_info('WTF IS THIS! \n ', ui_log=ui_log)
return False
except Exception as e:
QA_util_log_info(e)
QA_util_log_info('WTF IS THIS! \n ', ui_log=ui_log)
return False
if QA_util_date_valid(end):
cursor = coll_indices.find({
ST.TRIGGER_R5: {
'$gt': 0
},
"date_stamp":
{
"$lte": QA_util_date_stamp(end),
"$gte": QA_util_date_stamp(start)
}
},
{"_id": 0},
batch_size=10000)
#res=[QA_util_dict_remove_key(data, '_id') for data in cursor]
res = pd.DataFrame([item for item in cursor])
try:
res = res.assign(date=pd.to_datetime(res.date)).drop_duplicates((['date',
'code'])).set_index(['date',
'code'],
drop=False)
codelist = QA.QA_fetch_stock_name(res[AKA.CODE].tolist())
res['name'] = res.apply(lambda x:codelist.at[x.get(AKA.CODE), 'name'], axis=1)
except:
res = None
if format in ['P', 'p', 'pandas', 'pd']:
return res
elif format in ['json', 'dict']:
return QA_util_to_json_from_pandas(res)
# 多种数据格式
elif format in ['n', 'N', 'numpy']:
return numpy.asarray(res)
elif format in ['list', 'l', 'L']:
return numpy.asarray(res).tolist()
else:
print("QA Error GQSignal_fetch_position_singal_day format parameter %s is none of \"P, p, pandas, pd , json, dict , n, N, numpy, list, l, L, !\" " % format)
return None
else:
QA_util_log_info('QA Error GQSignal_fetch_position_singal_day data parameter start=%s end=%s is not right' % (start,
end))
def GQSignal_fetch_singal_day(code,
start,
end,
frequence='day',
market_type=QA.MARKET_TYPE.STOCK_CN,
portfolio='myportfolio',
format='numpy',
ui_log=None,
ui_progress=None):
"""
获取股票日线指标/策略信号数据
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE})
"""
start = str(start)[0:10]
end = str(end)[0:10]
#code= [code] if isinstance(code,str) else code
client = QASETTING.client[AKA.SYSTEM_NAME]
# 同时写入横表和纵表,减少查询困扰
#coll_day = client.get_collection(
# 'indices_{}'.format(datetime.date.today()))
try:
if (market_type == QA.MARKET_TYPE.STOCK_CN):
#coll_indices = client.stock_cn_indices_min
coll_indices = client.get_collection('stock_cn_indices_{}'.format(portfolio))
elif (market_type == QA.MARKET_TYPE.INDEX_CN):
#coll_indices = client.index_cn_indices_min
coll_indices = client.get_collection('index_cn_indices_{}'.format(portfolio))
elif (market_type == QA.MARKET_TYPE.FUND_CN):
#coll_indices = client.future_cn_indices_min
coll_indices = client.get_collection('fund_cn_indices_{}'.format(portfolio))
elif (market_type == QA.MARKET_TYPE.FUTURE_CN):
#coll_indices = client.future_cn_indices_min
coll_indices = client.get_collection('future_cn_indices_{}'.format(portfolio))
elif (market_type == QA.MARKET_TYPE.CRYPTOCURRENCY):
#coll_indices = client.cryptocurrency_indices_min
coll_indices = client.get_collection('cryptocurrency_indices_{}'.format(portfolio))
else:
QA_util_log_info('WTF IS THIS! \n ', ui_log=ui_log)
return False
except Exception as e:
QA_util_log_info(e)
QA_util_log_info('WTF IS THIS! \n ', ui_log=ui_log)
return False
# code checking
code = QA_util_code_tolist(code)
if QA_util_date_valid(end):
cursor = coll_indices.find({
'code': {
'$in': code
},
"date_stamp":
{
"$lte": QA_util_date_stamp(end),
"$gte": QA_util_date_stamp(start)
}
},
{"_id": 0},
batch_size=10000)
#res=[QA_util_dict_remove_key(data, '_id') for data in cursor]
res = pd.DataFrame([item for item in cursor])
try:
res = res.assign(date=pd.to_datetime(res.date)).drop_duplicates((['date',
'code'])).set_index(['date',
'code'], drop=False)
res.sort_index(inplace=True)
except:
res = None
if format in ['P', 'p', 'pandas', 'pd']:
return res
elif format in ['json', 'dict']:
return QA_util_to_json_from_pandas(res)
# 多种数据格式
elif format in ['n', 'N', 'numpy']:
return numpy.asarray(res)
elif format in ['list', 'l', 'L']:
return numpy.asarray(res).tolist()
else:
print("QA Error GQSignal_fetch_singal_day format parameter %s is none of \"P, p, pandas, pd , json, dict , n, N, numpy, list, l, L, !\" " % format)
return None
else:
QA_util_log_info('QA Error GQSignal_fetch_singal_day data parameter start=%s end=%s is not right' % (start,
end))
def GQ_save_test(code,
indices,
market_type=QA.MARKET_TYPE.STOCK_CN,
portfolio='myportfolio',
ui_log=None,
ui_progress=None):
"""
在数据库中保存所有计算出来的股票日线指标,用于汇总评估和筛选数据——日线
save stock_indices, state
Keyword Arguments:
client {[type]} -- [description] (default: {DATABASE})
"""
client = QASETTING.client['quantaxis']
# 同时写入横表和纵表,减少查询困扰
#coll_day = client.get_collection(
# 'indices_{}'.format(datetime.date.today()))
try:
if (market_type == QA.MARKET_TYPE.STOCK_CN):
#coll_indices = client.stock_cn_indices_day
coll_indices = client.get_collection('stock_cn_indices_{}'.format(portfolio))
elif (market_type == QA.MARKET_TYPE.INDEX_CN):
#coll_indices = client.index_cn_indices_day
coll_indices = client.get_collection('index_cn_indices_{}'.format(portfolio))
else:
QA_util_log_info('WTF IS THIS! {} \n '.format(market_type), ui_log=ui_log)
return False
except Exception as e:
QA_util_log_info(e)
QA_util_log_info('WTF IS THIS! \n ', ui_log=ui_log)
return False
_check_index(coll_indices)
data = _formatter_data(indices)
err = []
# 查询是否新 tick
query_id = {
"code": code,
'date_stamp': {
'$in': data['date_stamp'].tolist()
}
}
refcount = coll_indices.count_documents(query_id)
if refcount > 0:
if (len(data) > 1):
# 删掉重复数据
coll_indices.delete_many(query_id)
data = QA_util_to_json_from_pandas(data)
coll_indices.insert_many(data)
else:
# 持续更新模式,更新单条记录
data.drop('created_at', axis=1, inplace=True)
data = QA_util_to_json_from_pandas(data)
coll_indices.replace_one(query_id, data[0])
else:
# 新 tick,插入记录
data = QA_util_to_json_from_pandas(data)
coll_indices.insert_many(data)
return True
data_day = QA.QA_fetch_stock_day_adv(['000001'], '2018-12-01', '2019-05-20')
data_day = data_day.to_qfq().data
GQ_save_test('000001',data_day) | [
2,
19617,
25,
40477,
12,
23,
198,
2,
198,
2,
383,
17168,
13789,
357,
36393,
8,
198,
2,
198,
2,
15069,
357,
66,
8,
2864,
12,
42334,
257,
35142,
14,
49,
70,
1079,
64,
14,
38,
2305,
76,
24915,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
2,
286,
428,
3788,
290,
3917,
10314,
3696,
357,
1169,
366,
25423,
12340,
284,
1730,
198,
2,
287,
262,
10442,
1231,
17504,
11,
1390,
1231,
17385,
262,
2489,
198,
2,
284,
779,
11,
4866,
11,
13096,
11,
20121,
11,
7715,
11,
14983,
11,
850,
43085,
11,
290,
14,
273,
3677,
198,
2,
9088,
286,
262,
10442,
11,
290,
284,
8749,
6506,
284,
4150,
262,
10442,
318,
198,
2,
30760,
284,
466,
523,
11,
2426,
284,
262,
1708,
3403,
25,
198,
2,
198,
2,
383,
2029,
6634,
4003,
290,
428,
7170,
4003,
2236,
307,
3017,
287,
198,
2,
477,
198,
2,
9088,
393,
8904,
16690,
286,
262,
10442,
13,
198,
2,
198,
2,
3336,
47466,
3180,
36592,
2389,
1961,
366,
1921,
3180,
1600,
42881,
34764,
56,
3963,
15529,
509,
12115,
11,
7788,
32761,
6375,
198,
2,
8959,
49094,
11,
47783,
2751,
21728,
5626,
40880,
5390,
3336,
34764,
11015,
3963,
34482,
3398,
1565,
5603,
25382,
11,
198,
2,
376,
46144,
7473,
317,
16652,
2149,
37232,
33079,
48933,
5357,
44521,
1268,
10913,
2751,
12529,
13,
220,
3268,
8005,
49261,
50163,
3336,
198,
2,
37195,
20673,
6375,
27975,
38162,
9947,
367,
15173,
4877,
9348,
43031,
19146,
7473,
15529,
47666,
3955,
11,
29506,
25552,
6375,
25401,
198,
2,
43031,
25382,
11,
7655,
2767,
16879,
3268,
3537,
40282,
3963,
27342,
10659,
11,
309,
9863,
6375,
25401,
54,
24352,
11,
5923,
1797,
2751,
16034,
11,
198,
2,
16289,
3963,
6375,
3268,
7102,
45,
24565,
13315,
3336,
47466,
6375,
3336,
23210,
6375,
25401,
5550,
1847,
20754,
3268,
3336,
198,
2,
47466,
13,
198,
2,
198,
11748,
4818,
8079,
198,
11748,
640,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
279,
4948,
25162,
198,
198,
28311,
25,
198,
220,
220,
220,
1330,
19604,
1565,
5603,
55,
1797,
355,
1195,
32,
198,
220,
220,
220,
422,
19604,
1565,
5603,
55,
1797,
13,
48,
32,
18274,
346,
1330,
357,
48,
1921,
2767,
48996,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
360,
1404,
6242,
11159,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1195,
32,
62,
22602,
62,
6404,
62,
10951,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1195,
32,
62,
22602,
62,
1462,
62,
17752,
62,
6738,
62,
79,
392,
292,
35751,
198,
220,
220,
220,
422,
19604,
1565,
5603,
55,
1797,
13,
48,
32,
18274,
346,
13,
48,
2969,
41158,
2357,
1330,
38678,
62,
17931,
23988,
2849,
198,
220,
220,
220,
422,
19604,
1565,
5603,
55,
1797,
13,
48,
2885,
1045,
13,
48,
2885,
1045,
44909,
1330,
357,
48,
32,
62,
6601,
44909,
62,
15732,
62,
1084,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1195,
32,
62,
6601,
44909,
62,
15732,
62,
820,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1195,
32,
62,
6601,
44909,
62,
26207,
62,
820,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1195,
32,
62,
6601,
44909,
62,
26207,
62,
1084,
8,
198,
220,
220,
220,
422,
19604,
1565,
5603,
55,
1797,
13,
48,
32,
18274,
346,
13,
48,
2885,
378,
62,
22856,
1330,
357,
198,
220,
220,
220,
220,
220,
220,
220,
1195,
32,
62,
22602,
62,
16514,
27823,
62,
1462,
62,
2536,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1195,
32,
62,
22602,
62,
19608,
8079,
62,
1462,
62,
47000,
62,
16514,
27823,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1195,
32,
62,
22602,
62,
4798,
62,
16514,
27823,
198,
220,
220,
220,
1267,
198,
16341,
25,
198,
220,
220,
220,
3601,
10786,
16437,
11159,
1057,
366,
79,
541,
2721,
19604,
1565,
5603,
55,
1797,
1,
284,
869,
777,
13103,
11537,
198,
220,
220,
220,
1208,
198,
198,
28311,
25,
198,
220,
220,
220,
422,
27167,
48,
13,
38,
10917,
47163,
13,
17143,
2357,
1330,
357,
198,
220,
220,
220,
220,
220,
220,
220,
15837,
32,
11,
198,
220,
220,
220,
220,
220,
220,
220,
24413,
2149,
25633,
62,
44603,
355,
9977,
35,
11,
198,
220,
220,
220,
220,
220,
220,
220,
7579,
10619,
62,
35744,
2937,
355,
3563,
11,
220,
198,
220,
220,
220,
1267,
198,
16341,
25,
198,
220,
220,
220,
1398,
15837,
32,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
5525,
114,
233,
27950,
123,
163,
232,
35050,
222,
223,
30585,
116,
34932,
237,
171,
120,
234,
10310,
241,
17312,
231,
28938,
235,
163,
100,
108,
162,
234,
229,
43718,
229,
171,
120,
234,
22522,
248,
20046,
231,
22755,
238,
30585,
116,
34932,
237,
20998,
107,
20015,
98,
34402,
123,
17739,
235,
33566,
112,
162,
236,
98,
33699,
241,
27764,
245,
163,
105,
99,
10310,
110,
34460,
254,
22755,
238,
21410,
162,
233,
120,
37863,
247,
165,
242,
247,
46237,
107,
16764,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
5525,
250,
94,
163,
225,
249,
163,
118,
123,
162,
234,
229,
43718,
229,
198,
220,
220,
220,
220,
220,
220,
220,
42714,
796,
705,
8189,
6,
198,
220,
220,
220,
220,
220,
220,
220,
36751,
796,
705,
3672,
6,
198,
220,
220,
220,
220,
220,
220,
220,
38303,
796,
705,
9654,
6,
198,
220,
220,
220,
220,
220,
220,
220,
34677,
796,
705,
8929,
6,
198,
220,
220,
220,
220,
220,
220,
220,
46663,
796,
705,
9319,
6,
198,
220,
220,
220,
220,
220,
220,
220,
7852,
14058,
796,
705,
19836,
6,
198,
220,
220,
220,
220,
220,
220,
220,
38570,
38340,
796,
705,
29048,
6,
198,
220,
220,
220,
220,
220,
220,
220,
38570,
796,
705,
10396,
6,
198,
220,
220,
220,
220,
220,
220,
220,
360,
1404,
2767,
12789,
796,
705,
19608,
8079,
6,
198,
220,
220,
220,
220,
220,
220,
220,
41894,
62,
32737,
796,
705,
12957,
62,
19836,
6,
198,
220,
220,
220,
220,
220,
220,
220,
4810,
8476,
796,
705,
20888,
6,
628,
220,
220,
220,
220,
220,
220,
220,
36230,
62,
20608,
796,
705,
1820,
24915,
6,
628,
198,
220,
220,
220,
1398,
3563,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
5525,
114,
233,
27950,
123,
163,
232,
35050,
222,
223,
30585,
116,
34932,
237,
171,
120,
234,
10310,
241,
17312,
231,
28938,
235,
163,
100,
108,
162,
234,
229,
43718,
229,
171,
120,
234,
22522,
248,
20046,
231,
22755,
238,
30585,
116,
34932,
237,
20998,
107,
20015,
98,
34402,
123,
17739,
235,
33566,
112,
162,
236,
98,
33699,
241,
27764,
245,
163,
105,
99,
10310,
110,
34460,
254,
22755,
238,
21410,
162,
233,
120,
37863,
247,
165,
242,
247,
46237,
107,
16764,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
13328,
232,
35050,
222,
223,
198,
220,
220,
220,
220,
220,
220,
220,
28069,
17941,
62,
49,
20,
796,
705,
37997,
62,
49,
20,
6,
198,
220,
220,
220,
220,
220,
220,
220,
7579,
3528,
30373,
62,
49,
20,
796,
705,
5446,
38,
62,
49,
20,
6,
198,
220,
220,
220,
220,
220,
220,
220,
327,
6981,
2389,
6158,
796,
705,
34,
6981,
2389,
6158,
6,
628,
198,
198,
4299,
402,
48,
11712,
282,
62,
22602,
62,
21928,
62,
521,
1063,
62,
820,
7,
8189,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
36525,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1910,
62,
4906,
28,
48,
32,
13,
44,
14175,
2767,
62,
25216,
13,
2257,
11290,
62,
44175,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15320,
11639,
1820,
634,
13652,
3256,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
334,
72,
62,
6404,
28,
14202,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
334,
72,
62,
33723,
28,
14202,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
10263,
250,
101,
46763,
108,
162,
235,
106,
41753,
241,
40792,
46479,
251,
27764,
246,
33699,
222,
17312,
231,
164,
106,
94,
163,
106,
245,
49035,
118,
30266,
98,
21410,
164,
224,
94,
163,
98,
101,
33768,
98,
163,
118,
123,
162,
234,
229,
43718,
229,
171,
120,
234,
18796,
101,
12859,
236,
162,
109,
229,
45250,
119,
46237,
226,
27670,
108,
161,
240,
234,
163,
255,
249,
34460,
231,
46763,
108,
162,
235,
106,
4500,
33768,
98,
163,
118,
123,
198,
220,
220,
220,
3613,
4283,
62,
521,
1063,
11,
1181,
628,
220,
220,
220,
7383,
4775,
20559,
2886,
25,
198,
220,
220,
220,
220,
220,
220,
220,
5456,
1391,
58,
4906,
48999,
1377,
685,
11213,
60,
357,
12286,
25,
1391,
35,
1404,
6242,
11159,
30072,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
5456,
796,
1195,
1921,
2767,
48996,
13,
16366,
58,
10206,
32,
13,
23060,
25361,
62,
20608,
60,
628,
220,
220,
220,
1303,
10263,
238,
234,
33768,
114,
37863,
247,
17739,
98,
162,
101,
103,
26193,
101,
161,
240,
234,
163,
118,
113,
26193,
101,
171,
120,
234,
49035,
237,
22887,
239,
162,
253,
98,
46237,
95,
32368,
108,
33699,
108,
198,
220,
220,
220,
1303,
26000,
62,
820,
796,
5456,
13,
1136,
62,
43681,
7,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
220,
220,
220,
705,
521,
1063,
23330,
92,
4458,
18982,
7,
19608,
8079,
13,
4475,
13,
40838,
3419,
4008,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
357,
10728,
62,
4906,
6624,
1195,
32,
13,
44,
14175,
2767,
62,
25216,
13,
2257,
11290,
62,
44175,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
26000,
62,
521,
1063,
796,
5456,
13,
13578,
62,
31522,
62,
521,
1063,
62,
820,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2927,
62,
521,
1063,
796,
5456,
13,
1136,
62,
43681,
10786,
13578,
62,
31522,
62,
521,
1063,
23330,
92,
4458,
18982,
7,
634,
13652,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
357,
10728,
62,
4906,
6624,
1195,
32,
13,
44,
14175,
2767,
62,
25216,
13,
12115,
6369,
62,
44175,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
26000,
62,
521,
1063,
796,
5456,
13,
9630,
62,
31522,
62,
521,
1063,
62,
820,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2927,
62,
521,
1063,
796,
5456,
13,
1136,
62,
43681,
10786,
9630,
62,
31522,
62,
521,
1063,
23330,
92,
4458,
18982,
7,
634,
13652,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
357,
10728,
62,
4906,
6624,
1195,
32,
13,
44,
14175,
2767,
62,
25216,
13,
42296,
35,
62,
44175,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
26000,
62,
521,
1063,
796,
5456,
13,
10990,
62,
31522,
62,
521,
1063,
62,
820,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2927,
62,
521,
1063,
796,
5456,
13,
1136,
62,
43681,
10786,
10990,
62,
31522,
62,
521,
1063,
23330,
92,
4458,
18982,
7,
634,
13652,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
357,
10728,
62,
4906,
6624,
1195,
32,
13,
44,
14175,
2767,
62,
25216,
13,
37,
3843,
11335,
62,
44175,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
26000,
62,
521,
1063,
796,
5456,
13,
37443,
62,
31522,
62,
521,
1063,
62,
820,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2927,
62,
521,
1063,
796,
5456,
13,
1136,
62,
43681,
10786,
37443,
62,
31522,
62,
521,
1063,
23330,
92,
4458,
18982,
7,
634,
13652,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
357,
10728,
62,
4906,
6624,
1195,
32,
13,
44,
14175,
2767,
62,
25216,
13,
9419,
56,
11571,
4503,
31302,
45155,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
26000,
62,
521,
1063,
796,
5456,
13,
29609,
420,
13382,
62,
521,
1063,
62,
820,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2927,
62,
521,
1063,
796,
5456,
13,
1136,
62,
43681,
10786,
29609,
420,
13382,
62,
521,
1063,
23330,
92,
4458,
18982,
7,
634,
13652,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1195,
32,
62,
22602,
62,
6404,
62,
10951,
10786,
54,
10234,
3180,
12680,
0,
23884,
3467,
77,
45302,
18982,
7,
10728,
62,
4906,
828,
334,
72,
62,
6404,
28,
9019,
62,
6404,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
198,
220,
220,
220,
2845,
35528,
355,
304,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1195,
32,
62,
22602,
62,
6404,
62,
10951,
7,
68,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1195,
32,
62,
22602,
62,
6404,
62,
10951,
10786,
54,
10234,
3180,
12680,
0,
3467,
77,
46083,
334,
72,
62,
6404,
28,
9019,
62,
6404,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
220,
220,
220,
220,
220,
220,
628,
220,
220,
220,
4808,
9122,
62,
9630,
7,
26000,
62,
521,
1063,
8,
198,
220,
220,
220,
1366,
796,
4808,
687,
1436,
62,
7890,
7,
521,
1063,
8,
198,
220,
220,
220,
11454,
796,
17635,
628,
220,
220,
220,
1303,
10545,
253,
98,
46237,
95,
42468,
28938,
99,
23877,
108,
4378,
198,
220,
220,
220,
12405,
62,
312,
796,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
366,
8189,
1298,
2438,
11,
198,
220,
220,
220,
220,
220,
220,
220,
705,
4475,
62,
301,
696,
10354,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
3,
259,
10354,
1366,
17816,
4475,
62,
301,
696,
6,
4083,
83,
349,
396,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
1782,
198,
220,
220,
220,
1006,
9127,
796,
2927,
62,
521,
1063,
13,
9127,
62,
15390,
2886,
7,
22766,
62,
312,
8,
198,
220,
220,
220,
611,
1006,
9127,
1875,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
357,
11925,
7,
7890,
8,
1875,
352,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
10263,
230,
254,
162,
236,
231,
34932,
235,
13783,
235,
46763,
108,
162,
235,
106,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2927,
62,
521,
1063,
13,
33678,
62,
21834,
7,
22766,
62,
312,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
796,
1195,
32,
62,
22602,
62,
1462,
62,
17752,
62,
6738,
62,
79,
392,
292,
7,
7890,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2927,
62,
521,
1063,
13,
28463,
62,
21834,
7,
7890,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
10545,
234,
223,
163,
119,
255,
162,
249,
112,
23877,
108,
162,
101,
94,
28156,
237,
171,
120,
234,
162,
249,
112,
23877,
108,
39355,
243,
30266,
94,
164,
106,
108,
37605,
243,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
13,
14781,
10786,
25598,
62,
265,
3256,
16488,
28,
16,
11,
287,
5372,
28,
17821,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
796,
1195,
32,
62,
22602,
62,
1462,
62,
17752,
62,
6738,
62,
79,
392,
292,
7,
7890,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2927,
62,
521,
1063,
13,
33491,
62,
505,
7,
22766,
62,
312,
11,
1366,
58,
15,
12962,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
10545,
244,
108,
4378,
171,
120,
234,
162,
237,
240,
17739,
98,
164,
106,
108,
37605,
243,
198,
220,
220,
220,
220,
220,
220,
220,
1366,
796,
1195,
32,
62,
22602,
62,
1462,
62,
17752,
62,
6738,
62,
79,
392,
292,
7,
7890,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2927,
62,
521,
1063,
13,
28463,
62,
21834,
7,
7890,
8,
198,
220,
220,
220,
1441,
6407,
628,
198,
4299,
402,
48,
11712,
282,
62,
22602,
62,
21928,
62,
521,
1063,
62,
1084,
7,
8189,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
36525,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3593,
594,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1910,
62,
4906,
28,
48,
32,
13,
44,
14175,
2767,
62,
25216,
13,
2257,
11290,
62,
44175,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15320,
11639,
1820,
634,
13652,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
334,
72,
62,
6404,
28,
14202,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
334,
72,
62,
33723,
28,
14202,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
10263,
250,
101,
46763,
108,
162,
235,
106,
41753,
241,
40792,
46479,
251,
27764,
246,
33699,
222,
17312,
231,
164,
106,
94,
163,
106,
245,
49035,
118,
30266,
98,
21410,
162,
234,
229,
43718,
229,
46479,
94,
162,
223,
107,
171,
120,
234,
18796,
101,
12859,
236,
162,
109,
229,
45250,
119,
46237,
226,
27670,
108,
161,
240,
234,
163,
255,
249,
34460,
231,
46763,
108,
162,
235,
106,
4500,
26344,
228,
165,
240,
253,
163,
118,
123,
198,
220,
220,
220,
3613,
4283,
62,
521,
1063,
11,
1181,
628,
220,
220,
220,
7383,
4775,
20559,
2886,
25,
198,
220,
220,
220,
220,
220,
220,
220,
5456,
1391,
58,
4906,
48999,
1377,
685,
11213,
60,
357,
12286,
25,
1391,
35,
1404,
6242,
11159,
30072,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
5456,
796,
1195,
1921,
2767,
48996,
13,
16366,
58,
10206,
32,
13,
23060,
25361,
62,
20608,
60,
628,
220,
220,
220,
1303,
10263,
238,
234,
33768,
114,
37863,
247,
17739,
98,
162,
101,
103,
26193,
101,
161,
240,
234,
163,
118,
113,
26193,
101,
171,
120,
234,
49035,
237,
22887,
239,
162,
253,
98,
46237,
95,
32368,
108,
33699,
108,
198,
220,
220,
220,
1303,
26000,
62,
820,
796,
5456,
13,
1136,
62,
43681,
7,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
220,
220,
220,
705,
521,
1063,
23330,
92,
4458,
18982,
7,
19608,
8079,
13,
4475,
13,
40838,
3419,
4008,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
357,
10728,
62,
4906,
6624,
1195,
32,
13,
44,
14175,
2767,
62,
25216,
13,
2257,
11290,
62,
44175,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
26000,
62,
521,
1063,
796,
5456,
13,
13578,
62,
31522,
62,
521,
1063,
62,
1084,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2927,
62,
521,
1063,
796,
5456,
13,
1136,
62,
43681,
10786,
13578,
62,
31522,
62,
521,
1063,
23330,
92,
4458,
18982,
7,
634,
13652,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
357,
10728,
62,
4906,
6624,
1195,
32,
13,
44,
14175,
2767,
62,
25216,
13,
12115,
6369,
62,
44175,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
26000,
62,
521,
1063,
796,
5456,
13,
9630,
62,
31522,
62,
521,
1063,
62,
1084,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2927,
62,
521,
1063,
796,
5456,
13,
1136,
62,
43681,
10786,
9630,
62,
31522,
62,
521,
1063,
23330,
92,
4458,
18982,
7,
634,
13652,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
357,
10728,
62,
4906,
6624,
1195,
32,
13,
44,
14175,
2767,
62,
25216,
13,
42296,
35,
62,
44175,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
26000,
62,
521,
1063,
796,
5456,
13,
37443,
62,
31522,
62,
521,
1063,
62,
1084,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2927,
62,
521,
1063,
796,
5456,
13,
1136,
62,
43681,
10786,
10990,
62,
31522,
62,
521,
1063,
23330,
92,
4458,
18982,
7,
634,
13652,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
357,
10728,
62,
4906,
6624,
1195,
32,
13,
44,
14175,
2767,
62,
25216,
13,
37,
3843,
11335,
62,
44175,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
26000,
62,
521,
1063,
796,
5456,
13,
37443,
62,
31522,
62,
521,
1063,
62,
1084,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2927,
62,
521,
1063,
796,
5456,
13,
1136,
62,
43681,
10786,
37443,
62,
31522,
62,
521,
1063,
23330,
92,
4458,
18982,
7,
634,
13652,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
357,
10728,
62,
4906,
6624,
1195,
32,
13,
44,
14175,
2767,
62,
25216,
13,
9419,
56,
11571,
4503,
31302,
45155,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
26000,
62,
521,
1063,
796,
5456,
13,
29609,
420,
13382,
62,
521,
1063,
62,
1084,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2927,
62,
521,
1063,
796,
5456,
13,
1136,
62,
43681,
10786,
29609,
420,
13382,
62,
521,
1063,
23330,
92,
4458,
18982,
7,
634,
13652,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1195,
32,
62,
22602,
62,
6404,
62,
10951,
10786,
54,
10234,
3180,
12680,
0,
3467,
77,
46083,
334,
72,
62,
6404,
28,
9019,
62,
6404,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
198,
220,
220,
220,
2845,
35528,
355,
304,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1195,
32,
62,
22602,
62,
6404,
62,
10951,
7,
68,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1195,
32,
62,
22602,
62,
6404,
62,
10951,
10786,
54,
10234,
3180,
12680,
0,
3467,
77,
46083,
334,
72,
62,
6404,
28,
9019,
62,
6404,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
220,
220,
220,
220,
220,
220,
628,
220,
220,
220,
4808,
9122,
62,
9630,
7,
26000,
62,
521,
1063,
8,
198,
220,
220,
220,
1366,
796,
4808,
687,
1436,
62,
7890,
7,
521,
1063,
11,
3593,
594,
8,
198,
220,
220,
220,
11454,
796,
17635,
628,
220,
220,
220,
1303,
10545,
253,
98,
46237,
95,
42468,
28938,
99,
23877,
108,
4378,
198,
220,
220,
220,
12405,
62,
312,
796,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
366,
8189,
1298,
2438,
11,
198,
220,
220,
220,
220,
220,
220,
220,
705,
4906,
10354,
3593,
594,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
2435,
62,
301,
696,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
3,
259,
10354,
1366,
17816,
2435,
62,
301,
696,
6,
4083,
83,
349,
396,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
1782,
198,
220,
220,
220,
1006,
9127,
796,
2927,
62,
521,
1063,
13,
9127,
62,
15390,
2886,
7,
22766,
62,
312,
8,
198,
220,
220,
220,
611,
1006,
9127,
1875,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
357,
11925,
7,
7890,
8,
1875,
352,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
10263,
230,
254,
162,
236,
231,
34932,
235,
13783,
235,
46763,
108,
162,
235,
106,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2927,
62,
521,
1063,
13,
33678,
62,
21834,
7,
22766,
62,
312,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
796,
1195,
32,
62,
22602,
62,
1462,
62,
17752,
62,
6738,
62,
79,
392,
292,
7,
7890,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2927,
62,
521,
1063,
13,
28463,
62,
21834,
7,
7890,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
10545,
234,
223,
163,
119,
255,
162,
249,
112,
23877,
108,
162,
101,
94,
28156,
237,
171,
120,
234,
162,
249,
112,
23877,
108,
39355,
243,
30266,
94,
164,
106,
108,
37605,
243,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
13,
14781,
10786,
25598,
62,
265,
3256,
16488,
28,
16,
11,
287,
5372,
28,
17821,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
796,
1195,
32,
62,
22602,
62,
1462,
62,
17752,
62,
6738,
62,
79,
392,
292,
7,
7890,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2927,
62,
521,
1063,
13,
33491,
62,
505,
7,
22766,
62,
312,
11,
1366,
58,
15,
12962,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
10545,
244,
108,
4378,
171,
120,
234,
162,
237,
240,
17739,
98,
164,
106,
108,
37605,
243,
198,
220,
220,
220,
220,
220,
220,
220,
1366,
796,
1195,
32,
62,
22602,
62,
1462,
62,
17752,
62,
6738,
62,
79,
392,
292,
7,
7890,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2927,
62,
521,
1063,
13,
28463,
62,
21834,
7,
7890,
8,
198,
220,
220,
220,
1441,
6407,
628,
198,
4299,
402,
48,
11712,
282,
62,
69,
7569,
62,
9150,
62,
12215,
282,
62,
820,
7,
9688,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3593,
594,
11639,
820,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1910,
62,
4906,
28,
48,
32,
13,
44,
14175,
2767,
62,
25216,
13,
2257,
11290,
62,
44175,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15320,
11639,
1820,
634,
13652,
3256,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5794,
11639,
77,
32152,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
334,
72,
62,
6404,
28,
14202,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
334,
72,
62,
33723,
28,
14202,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
705,
164,
236,
115,
20998,
244,
164,
224,
94,
163,
98,
101,
162,
234,
229,
43718,
229,
33768,
98,
163,
118,
123,
6,
628,
220,
220,
220,
7383,
4775,
20559,
2886,
25,
198,
220,
220,
220,
220,
220,
220,
220,
5456,
1391,
58,
4906,
48999,
1377,
685,
11213,
60,
357,
12286,
25,
1391,
35,
1404,
6242,
11159,
30072,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
923,
796,
965,
7,
9688,
38381,
15,
25,
940,
60,
198,
220,
220,
220,
886,
796,
965,
7,
437,
38381,
15,
25,
940,
60,
198,
220,
220,
220,
1303,
8189,
28,
685,
8189,
60,
611,
318,
39098,
7,
8189,
11,
2536,
8,
2073,
2438,
628,
220,
220,
220,
5456,
796,
1195,
1921,
2767,
48996,
13,
16366,
58,
10206,
32,
13,
23060,
25361,
62,
20608,
60,
198,
220,
220,
220,
1303,
10263,
238,
234,
33768,
114,
37863,
247,
17739,
98,
162,
101,
103,
26193,
101,
161,
240,
234,
163,
118,
113,
26193,
101,
171,
120,
234,
49035,
237,
22887,
239,
162,
253,
98,
46237,
95,
32368,
108,
33699,
108,
198,
220,
220,
220,
1303,
26000,
62,
820,
796,
5456,
13,
1136,
62,
43681,
7,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
220,
220,
220,
705,
521,
1063,
23330,
92,
4458,
18982,
7,
19608,
8079,
13,
4475,
13,
40838,
3419,
4008,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
357,
10728,
62,
4906,
6624,
1195,
32,
13,
44,
14175,
2767,
62,
25216,
13,
2257,
11290,
62,
44175,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
26000,
62,
521,
1063,
796,
5456,
13,
13578,
62,
31522,
62,
521,
1063,
62,
1084,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2927,
62,
521,
1063,
796,
5456,
13,
1136,
62,
43681,
10786,
13578,
62,
31522,
62,
521,
1063,
23330,
92,
4458,
18982,
7,
634,
13652,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
357,
10728,
62,
4906,
6624,
1195,
32,
13,
44,
14175,
2767,
62,
25216,
13,
12115,
6369,
62,
44175,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
26000,
62,
521,
1063,
796,
5456,
13,
9630,
62,
31522,
62,
521,
1063,
62,
1084,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2927,
62,
521,
1063,
796,
5456,
13,
1136,
62,
43681,
10786,
9630,
62,
31522,
62,
521,
1063,
23330,
92,
4458,
18982,
7,
634,
13652,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
357,
10728,
62,
4906,
6624,
1195,
32,
13,
44,
14175,
2767,
62,
25216,
13,
42296,
35,
62,
44175,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
26000,
62,
521,
1063,
796,
5456,
13,
37443,
62,
31522,
62,
521,
1063,
62,
1084,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2927,
62,
521,
1063,
796,
5456,
13,
1136,
62,
43681,
10786,
10990,
62,
31522,
62,
521,
1063,
23330,
92,
4458,
18982,
7,
634,
13652,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
357,
10728,
62,
4906,
6624,
1195,
32,
13,
44,
14175,
2767,
62,
25216,
13,
37,
3843,
11335,
62,
44175,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
26000,
62,
521,
1063,
796,
5456,
13,
37443,
62,
31522,
62,
521,
1063,
62,
1084,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2927,
62,
521,
1063,
796,
5456,
13,
1136,
62,
43681,
10786,
37443,
62,
31522,
62,
521,
1063,
23330,
92,
4458,
18982,
7,
634,
13652,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
357,
10728,
62,
4906,
6624,
1195,
32,
13,
44,
14175,
2767,
62,
25216,
13,
9419,
56,
11571,
4503,
31302,
45155,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
26000,
62,
521,
1063,
796,
5456,
13,
29609,
420,
13382,
62,
521,
1063,
62,
1084,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2927,
62,
521,
1063,
796,
5456,
13,
1136,
62,
43681,
10786,
29609,
420,
13382,
62,
521,
1063,
23330,
92,
4458,
18982,
7,
634,
13652,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1195,
32,
62,
22602,
62,
6404,
62,
10951,
10786,
54,
10234,
3180,
12680,
0,
3467,
77,
46083,
334,
72,
62,
6404,
28,
9019,
62,
6404,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
198,
220,
220,
220,
2845,
35528,
355,
304,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1195,
32,
62,
22602,
62,
6404,
62,
10951,
7,
68,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1195,
32,
62,
22602,
62,
6404,
62,
10951,
10786,
54,
10234,
3180,
12680,
0,
3467,
77,
46083,
334,
72,
62,
6404,
28,
9019,
62,
6404,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
628,
220,
220,
220,
611,
1195,
32,
62,
22602,
62,
4475,
62,
12102,
7,
437,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
23493,
796,
2927,
62,
521,
1063,
13,
19796,
15090,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3563,
13,
5446,
3528,
30373,
62,
49,
20,
25,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
3,
13655,
10354,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8964,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
4475,
62,
301,
696,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17971,
75,
660,
1298,
1195,
32,
62,
22602,
62,
4475,
62,
301,
696,
7,
437,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17971,
70,
660,
1298,
1195,
32,
62,
22602,
62,
4475,
62,
301,
696,
7,
9688,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8964,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
19779,
62,
312,
1298,
657,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15458,
62,
7857,
28,
49388,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
411,
41888,
48,
32,
62,
22602,
62,
11600,
62,
28956,
62,
2539,
7,
7890,
11,
705,
62,
312,
11537,
329,
1366,
287,
23493,
60,
628,
220,
220,
220,
220,
220,
220,
220,
581,
796,
279,
67,
13,
6601,
19778,
26933,
9186,
329,
2378,
287,
23493,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
581,
796,
581,
13,
562,
570,
7,
4475,
28,
30094,
13,
1462,
62,
19608,
8079,
7,
411,
13,
4475,
29720,
14781,
62,
646,
489,
16856,
19510,
17816,
4475,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
8189,
6,
12962,
737,
2617,
62,
9630,
7,
17816,
4475,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
8189,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4268,
28,
25101,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
14873,
46331,
796,
1195,
32,
13,
48,
32,
62,
69,
7569,
62,
13578,
62,
3672,
7,
411,
58,
10206,
32,
13,
34,
16820,
4083,
83,
349,
396,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
581,
17816,
3672,
20520,
796,
581,
13,
39014,
7,
50033,
2124,
25,
19815,
46331,
13,
265,
58,
87,
13,
1136,
7,
10206,
32,
13,
34,
16820,
828,
705,
3672,
6,
4357,
16488,
28,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2845,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
581,
796,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
611,
5794,
287,
37250,
47,
3256,
705,
79,
3256,
705,
79,
392,
292,
3256,
705,
30094,
6,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
581,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
5794,
287,
37250,
17752,
3256,
705,
11600,
6,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
1195,
32,
62,
22602,
62,
1462,
62,
17752,
62,
6738,
62,
79,
392,
292,
7,
411,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
36469,
248,
163,
100,
235,
46763,
108,
162,
235,
106,
43718,
120,
28156,
237,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
5794,
287,
37250,
77,
3256,
705,
45,
3256,
705,
77,
32152,
6,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
299,
32152,
13,
292,
18747,
7,
411,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
5794,
287,
37250,
4868,
3256,
705,
75,
3256,
705,
43,
6,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
299,
32152,
13,
292,
18747,
7,
411,
737,
83,
349,
396,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
48,
32,
13047,
402,
48,
11712,
282,
62,
69,
7569,
62,
9150,
62,
12215,
282,
62,
820,
5794,
11507,
4064,
82,
318,
4844,
286,
220,
19990,
47,
11,
279,
11,
19798,
292,
11,
279,
67,
837,
33918,
11,
8633,
837,
299,
11,
399,
11,
299,
32152,
11,
1351,
11,
300,
11,
406,
11,
5145,
7879,
366,
4064,
5794,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
6045,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1195,
32,
62,
22602,
62,
6404,
62,
10951,
10786,
48,
32,
13047,
402,
48,
11712,
282,
62,
69,
7569,
62,
9150,
62,
12215,
282,
62,
820,
1366,
11507,
923,
28,
4,
82,
886,
28,
4,
82,
318,
407,
826,
6,
4064,
357,
9688,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
4008,
628,
198,
4299,
402,
48,
11712,
282,
62,
69,
7569,
62,
12215,
282,
62,
820,
7,
8189,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
923,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3593,
594,
11639,
820,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1910,
62,
4906,
28,
48,
32,
13,
44,
14175,
2767,
62,
25216,
13,
2257,
11290,
62,
44175,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15320,
11639,
1820,
634,
13652,
3256,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5794,
11639,
77,
32152,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
334,
72,
62,
6404,
28,
14202,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
334,
72,
62,
33723,
28,
14202,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
5525,
236,
115,
20998,
244,
164,
224,
94,
163,
98,
101,
33768,
98,
163,
118,
123,
162,
234,
229,
43718,
229,
14,
163,
255,
244,
45911,
98,
46479,
94,
20998,
115,
46763,
108,
162,
235,
106,
628,
220,
220,
220,
7383,
4775,
20559,
2886,
25,
198,
220,
220,
220,
220,
220,
220,
220,
5456,
1391,
58,
4906,
48999,
1377,
685,
11213,
60,
357,
12286,
25,
1391,
35,
1404,
6242,
11159,
30072,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
923,
796,
965,
7,
9688,
38381,
15,
25,
940,
60,
198,
220,
220,
220,
886,
796,
965,
7,
437,
38381,
15,
25,
940,
60,
198,
220,
220,
220,
1303,
8189,
28,
685,
8189,
60,
611,
318,
39098,
7,
8189,
11,
2536,
8,
2073,
2438,
628,
220,
220,
220,
5456,
796,
1195,
1921,
2767,
48996,
13,
16366,
58,
10206,
32,
13,
23060,
25361,
62,
20608,
60,
198,
220,
220,
220,
1303,
10263,
238,
234,
33768,
114,
37863,
247,
17739,
98,
162,
101,
103,
26193,
101,
161,
240,
234,
163,
118,
113,
26193,
101,
171,
120,
234,
49035,
237,
22887,
239,
162,
253,
98,
46237,
95,
32368,
108,
33699,
108,
198,
220,
220,
220,
1303,
26000,
62,
820,
796,
5456,
13,
1136,
62,
43681,
7,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
220,
220,
220,
705,
521,
1063,
23330,
92,
4458,
18982,
7,
19608,
8079,
13,
4475,
13,
40838,
3419,
4008,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
357,
10728,
62,
4906,
6624,
1195,
32,
13,
44,
14175,
2767,
62,
25216,
13,
2257,
11290,
62,
44175,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
26000,
62,
521,
1063,
796,
5456,
13,
13578,
62,
31522,
62,
521,
1063,
62,
1084,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2927,
62,
521,
1063,
796,
5456,
13,
1136,
62,
43681,
10786,
13578,
62,
31522,
62,
521,
1063,
23330,
92,
4458,
18982,
7,
634,
13652,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
357,
10728,
62,
4906,
6624,
1195,
32,
13,
44,
14175,
2767,
62,
25216,
13,
12115,
6369,
62,
44175,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
26000,
62,
521,
1063,
796,
5456,
13,
9630,
62,
31522,
62,
521,
1063,
62,
1084,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2927,
62,
521,
1063,
796,
5456,
13,
1136,
62,
43681,
10786,
9630,
62,
31522,
62,
521,
1063,
23330,
92,
4458,
18982,
7,
634,
13652,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
357,
10728,
62,
4906,
6624,
1195,
32,
13,
44,
14175,
2767,
62,
25216,
13,
42296,
35,
62,
44175,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
26000,
62,
521,
1063,
796,
5456,
13,
37443,
62,
31522,
62,
521,
1063,
62,
1084,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2927,
62,
521,
1063,
796,
5456,
13,
1136,
62,
43681,
10786,
10990,
62,
31522,
62,
521,
1063,
23330,
92,
4458,
18982,
7,
634,
13652,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
357,
10728,
62,
4906,
6624,
1195,
32,
13,
44,
14175,
2767,
62,
25216,
13,
37,
3843,
11335,
62,
44175,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
26000,
62,
521,
1063,
796,
5456,
13,
37443,
62,
31522,
62,
521,
1063,
62,
1084,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2927,
62,
521,
1063,
796,
5456,
13,
1136,
62,
43681,
10786,
37443,
62,
31522,
62,
521,
1063,
23330,
92,
4458,
18982,
7,
634,
13652,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
357,
10728,
62,
4906,
6624,
1195,
32,
13,
44,
14175,
2767,
62,
25216,
13,
9419,
56,
11571,
4503,
31302,
45155,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
26000,
62,
521,
1063,
796,
5456,
13,
29609,
420,
13382,
62,
521,
1063,
62,
1084,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2927,
62,
521,
1063,
796,
5456,
13,
1136,
62,
43681,
10786,
29609,
420,
13382,
62,
521,
1063,
23330,
92,
4458,
18982,
7,
634,
13652,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1195,
32,
62,
22602,
62,
6404,
62,
10951,
10786,
54,
10234,
3180,
12680,
0,
3467,
77,
46083,
334,
72,
62,
6404,
28,
9019,
62,
6404,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
198,
220,
220,
220,
2845,
35528,
355,
304,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1195,
32,
62,
22602,
62,
6404,
62,
10951,
7,
68,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1195,
32,
62,
22602,
62,
6404,
62,
10951,
10786,
54,
10234,
3180,
12680,
0,
3467,
77,
46083,
334,
72,
62,
6404,
28,
9019,
62,
6404,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
628,
220,
220,
220,
1303,
2438,
10627,
198,
220,
220,
220,
2438,
796,
1195,
32,
62,
22602,
62,
8189,
62,
83,
349,
396,
7,
8189,
8,
628,
220,
220,
220,
611,
1195,
32,
62,
22602,
62,
4475,
62,
12102,
7,
437,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
23493,
796,
2927,
62,
521,
1063,
13,
19796,
15090,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
8189,
10354,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
3,
259,
10354,
2438,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8964,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
4475,
62,
301,
696,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17971,
75,
660,
1298,
1195,
32,
62,
22602,
62,
4475,
62,
301,
696,
7,
437,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17971,
70,
660,
1298,
1195,
32,
62,
22602,
62,
4475,
62,
301,
696,
7,
9688,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8964,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
19779,
62,
312,
1298,
657,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15458,
62,
7857,
28,
49388,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
411,
41888,
48,
32,
62,
22602,
62,
11600,
62,
28956,
62,
2539,
7,
7890,
11,
705,
62,
312,
11537,
329,
1366,
287,
23493,
60,
628,
220,
220,
220,
220,
220,
220,
220,
581,
796,
279,
67,
13,
6601,
19778,
26933,
9186,
329,
2378,
287,
23493,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
581,
796,
581,
13,
562,
570,
7,
4475,
28,
30094,
13,
1462,
62,
19608,
8079,
7,
411,
13,
4475,
29720,
14781,
62,
646,
489,
16856,
19510,
17816,
4475,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
8189,
6,
12962,
737,
2617,
62,
9630,
7,
17816,
4475,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
8189,
6,
4357,
4268,
28,
25101,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
581,
13,
30619,
62,
9630,
7,
259,
5372,
28,
17821,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2845,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
581,
796,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
611,
5794,
287,
37250,
47,
3256,
705,
79,
3256,
705,
79,
392,
292,
3256,
705,
30094,
6,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
581,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
5794,
287,
37250,
17752,
3256,
705,
11600,
6,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
1195,
32,
62,
22602,
62,
1462,
62,
17752,
62,
6738,
62,
79,
392,
292,
7,
411,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
36469,
248,
163,
100,
235,
46763,
108,
162,
235,
106,
43718,
120,
28156,
237,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
5794,
287,
37250,
77,
3256,
705,
45,
3256,
705,
77,
32152,
6,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
299,
32152,
13,
292,
18747,
7,
411,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
5794,
287,
37250,
4868,
3256,
705,
75,
3256,
705,
43,
6,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
299,
32152,
13,
292,
18747,
7,
411,
737,
83,
349,
396,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
48,
32,
13047,
402,
48,
11712,
282,
62,
69,
7569,
62,
12215,
282,
62,
820,
5794,
11507,
4064,
82,
318,
4844,
286,
220,
19990,
47,
11,
279,
11,
19798,
292,
11,
279,
67,
837,
33918,
11,
8633,
837,
299,
11,
399,
11,
299,
32152,
11,
1351,
11,
300,
11,
406,
11,
5145,
7879,
366,
4064,
5794,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
6045,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1195,
32,
62,
22602,
62,
6404,
62,
10951,
10786,
48,
32,
13047,
402,
48,
11712,
282,
62,
69,
7569,
62,
12215,
282,
62,
820,
1366,
11507,
923,
28,
4,
82,
886,
28,
4,
82,
318,
407,
826,
6,
4064,
357,
9688,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
4008,
198,
220,
198,
198,
4299,
402,
48,
62,
21928,
62,
9288,
7,
8189,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
36525,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1910,
62,
4906,
28,
48,
32,
13,
44,
14175,
2767,
62,
25216,
13,
2257,
11290,
62,
44175,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15320,
11639,
1820,
634,
13652,
3256,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
334,
72,
62,
6404,
28,
14202,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
334,
72,
62,
33723,
28,
14202,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
10263,
250,
101,
46763,
108,
162,
235,
106,
41753,
241,
40792,
46479,
251,
27764,
246,
33699,
222,
17312,
231,
164,
106,
94,
163,
106,
245,
49035,
118,
30266,
98,
21410,
164,
224,
94,
163,
98,
101,
33768,
98,
163,
118,
123,
162,
234,
229,
43718,
229,
171,
120,
234,
18796,
101,
12859,
236,
162,
109,
229,
45250,
119,
46237,
226,
27670,
108,
161,
240,
234,
163,
255,
249,
34460,
231,
46763,
108,
162,
235,
106,
4500,
33768,
98,
163,
118,
123,
198,
220,
220,
220,
3613,
4283,
62,
521,
1063,
11,
1181,
628,
220,
220,
220,
7383,
4775,
20559,
2886,
25,
198,
220,
220,
220,
220,
220,
220,
220,
5456,
1391,
58,
4906,
48999,
1377,
685,
11213,
60,
357,
12286,
25,
1391,
35,
1404,
6242,
11159,
30072,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
5456,
796,
1195,
1921,
2767,
48996,
13,
16366,
17816,
40972,
22704,
20520,
628,
220,
220,
220,
1303,
10263,
238,
234,
33768,
114,
37863,
247,
17739,
98,
162,
101,
103,
26193,
101,
161,
240,
234,
163,
118,
113,
26193,
101,
171,
120,
234,
49035,
237,
22887,
239,
162,
253,
98,
46237,
95,
32368,
108,
33699,
108,
198,
220,
220,
220,
1303,
26000,
62,
820,
796,
5456,
13,
1136,
62,
43681,
7,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
220,
220,
220,
705,
521,
1063,
23330,
92,
4458,
18982,
7,
19608,
8079,
13,
4475,
13,
40838,
3419,
4008,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
357,
10728,
62,
4906,
6624,
1195,
32,
13,
44,
14175,
2767,
62,
25216,
13,
2257,
11290,
62,
44175,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
26000,
62,
521,
1063,
796,
5456,
13,
13578,
62,
31522,
62,
521,
1063,
62,
820,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2927,
62,
521,
1063,
796,
5456,
13,
1136,
62,
43681,
10786,
13578,
62,
31522,
62,
521,
1063,
23330,
92,
4458,
18982,
7,
634,
13652,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
357,
10728,
62,
4906,
6624,
1195,
32,
13,
44,
14175,
2767,
62,
25216,
13,
12115,
6369,
62,
44175,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
26000,
62,
521,
1063,
796,
5456,
13,
9630,
62,
31522,
62,
521,
1063,
62,
820,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2927,
62,
521,
1063,
796,
5456,
13,
1136,
62,
43681,
10786,
9630,
62,
31522,
62,
521,
1063,
23330,
92,
4458,
18982,
7,
634,
13652,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1195,
32,
62,
22602,
62,
6404,
62,
10951,
10786,
54,
10234,
3180,
12680,
0,
23884,
3467,
77,
45302,
18982,
7,
10728,
62,
4906,
828,
334,
72,
62,
6404,
28,
9019,
62,
6404,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
198,
220,
220,
220,
2845,
35528,
355,
304,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1195,
32,
62,
22602,
62,
6404,
62,
10951,
7,
68,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1195,
32,
62,
22602,
62,
6404,
62,
10951,
10786,
54,
10234,
3180,
12680,
0,
3467,
77,
46083,
334,
72,
62,
6404,
28,
9019,
62,
6404,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
220,
220,
220,
220,
220,
220,
628,
220,
220,
220,
4808,
9122,
62,
9630,
7,
26000,
62,
521,
1063,
8,
198,
220,
220,
220,
1366,
796,
4808,
687,
1436,
62,
7890,
7,
521,
1063,
8,
198,
220,
220,
220,
11454,
796,
17635,
628,
220,
220,
220,
1303,
10545,
253,
98,
46237,
95,
42468,
28938,
99,
23877,
108,
4378,
198,
220,
220,
220,
12405,
62,
312,
796,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
366,
8189,
1298,
2438,
11,
198,
220,
220,
220,
220,
220,
220,
220,
705,
4475,
62,
301,
696,
10354,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
3,
259,
10354,
1366,
17816,
4475,
62,
301,
696,
6,
4083,
83,
349,
396,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
1782,
198,
220,
220,
220,
1006,
9127,
796,
2927,
62,
521,
1063,
13,
9127,
62,
15390,
2886,
7,
22766,
62,
312,
8,
198,
220,
220,
220,
611,
1006,
9127,
1875,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
357,
11925,
7,
7890,
8,
1875,
352,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
10263,
230,
254,
162,
236,
231,
34932,
235,
13783,
235,
46763,
108,
162,
235,
106,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2927,
62,
521,
1063,
13,
33678,
62,
21834,
7,
22766,
62,
312,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
796,
1195,
32,
62,
22602,
62,
1462,
62,
17752,
62,
6738,
62,
79,
392,
292,
7,
7890,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2927,
62,
521,
1063,
13,
28463,
62,
21834,
7,
7890,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
10545,
234,
223,
163,
119,
255,
162,
249,
112,
23877,
108,
162,
101,
94,
28156,
237,
171,
120,
234,
162,
249,
112,
23877,
108,
39355,
243,
30266,
94,
164,
106,
108,
37605,
243,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
13,
14781,
10786,
25598,
62,
265,
3256,
16488,
28,
16,
11,
287,
5372,
28,
17821,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
796,
1195,
32,
62,
22602,
62,
1462,
62,
17752,
62,
6738,
62,
79,
392,
292,
7,
7890,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2927,
62,
521,
1063,
13,
33491,
62,
505,
7,
22766,
62,
312,
11,
1366,
58,
15,
12962,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
10545,
244,
108,
4378,
171,
120,
234,
162,
237,
240,
17739,
98,
164,
106,
108,
37605,
243,
198,
220,
220,
220,
220,
220,
220,
220,
1366,
796,
1195,
32,
62,
22602,
62,
1462,
62,
17752,
62,
6738,
62,
79,
392,
292,
7,
7890,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2927,
62,
521,
1063,
13,
28463,
62,
21834,
7,
7890,
8,
198,
220,
220,
220,
1441,
6407,
198,
198,
7890,
62,
820,
796,
1195,
32,
13,
48,
32,
62,
69,
7569,
62,
13578,
62,
820,
62,
32225,
7,
17816,
2388,
486,
6,
4357,
705,
7908,
12,
1065,
12,
486,
3256,
705,
23344,
12,
2713,
12,
1238,
11537,
198,
7890,
62,
820,
796,
1366,
62,
820,
13,
1462,
62,
80,
69,
80,
22446,
7890,
198,
198,
38,
48,
62,
21928,
62,
9288,
10786,
2388,
486,
3256,
7890,
62,
820,
8
] | 1.763962 | 10,278 |
from .frankwolfe import FrankWolfe
from .sampling import ImportanceSampling, UniformSampling
from .giga import GIGA
from .orthopursuit import OrthoPursuit
| [
6738,
764,
8310,
962,
18829,
68,
1330,
5278,
32069,
68,
198,
6738,
764,
37687,
11347,
1330,
17267,
590,
16305,
11347,
11,
35712,
16305,
11347,
198,
6738,
764,
70,
13827,
1330,
402,
3528,
32,
198,
6738,
764,
1506,
404,
1834,
5013,
1330,
47664,
78,
47,
1834,
5013,
198
] | 3.297872 | 47 |
#!/usr/bin/env python3
# -*- coding=utf-8 -*-
import cv2 as cv
import imutils
import time
import math
import numpy as np
"""
"""
if "__main__" == __name__:
main()
cv.destroyAllWindows()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
201,
198,
2,
532,
9,
12,
19617,
28,
40477,
12,
23,
532,
9,
12,
201,
198,
201,
198,
11748,
269,
85,
17,
355,
269,
85,
201,
198,
11748,
545,
26791,
201,
198,
11748,
640,
201,
198,
11748,
10688,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
201,
198,
201,
198,
37811,
201,
198,
201,
198,
37811,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
361,
366,
834,
12417,
834,
1,
6624,
11593,
3672,
834,
25,
201,
198,
220,
220,
220,
1388,
3419,
201,
198,
220,
220,
220,
269,
85,
13,
41659,
3237,
11209,
3419,
201,
198
] | 2.055556 | 108 |
#crie um programa que leia o nome e o preço de varios produtos
#dever perguntar se o usuário quer continuar, no final mostre:
#qual é o total gasto nas compras
# quantos produtos custam mais de R$ 1000
#qual o nome do produto mais barato?
print('-=-'*10)
print(' MERCADÂO BARATO ')
print('-=-'*10)
preco = 0
menor = 0
maior = 0
soma = 0
quant = 0
menorproduto = ''
while True:
produto = str(input('Digite o nome do produto: '))
preco = int(input('Digite o valor do produto R$: '))
soma = soma + preco
quant = quant + 1
if quant == 1:
maior = preco
menor = preco
if preco > maior:
maior = preco
if preco < menor:
menor = preco
menorproduto = produto
parar = str(input('Deseja parar? [S/N] : ').upper() .strip())[0]
if parar == 'S':
break
print(f'a soma dos produtos comprado foi de R${soma} \n o produto mais caro foi {maior}\n',end='')
print(f'O produto mais barato foi {menor} e era o {menorproduto}') | [
2,
66,
5034,
23781,
1430,
64,
8358,
443,
544,
267,
299,
462,
304,
267,
662,
16175,
78,
390,
1401,
4267,
40426,
315,
418,
198,
2,
67,
964,
583,
70,
2797,
283,
384,
267,
514,
84,
6557,
27250,
42517,
11143,
283,
11,
645,
2457,
749,
260,
25,
198,
198,
2,
13255,
38251,
267,
2472,
21956,
78,
25221,
552,
8847,
198,
198,
2,
5554,
418,
40426,
315,
418,
9378,
321,
285,
15152,
390,
371,
3,
8576,
198,
198,
2,
13255,
267,
299,
462,
466,
40426,
9390,
285,
15152,
2318,
5549,
30,
198,
4798,
10786,
12,
10779,
6,
9,
940,
8,
198,
4798,
10786,
220,
220,
220,
220,
34482,
34,
2885,
5523,
46,
31597,
1404,
46,
220,
220,
220,
220,
705,
8,
198,
4798,
10786,
12,
10779,
6,
9,
940,
8,
198,
3866,
1073,
796,
657,
198,
3653,
273,
796,
657,
198,
2611,
1504,
796,
657,
198,
82,
6086,
796,
657,
198,
40972,
796,
657,
198,
3653,
273,
1676,
67,
9390,
796,
10148,
198,
4514,
6407,
25,
198,
220,
220,
220,
40426,
9390,
796,
965,
7,
15414,
10786,
19511,
578,
267,
299,
462,
466,
40426,
9390,
25,
705,
4008,
198,
220,
220,
220,
662,
1073,
796,
493,
7,
15414,
10786,
19511,
578,
267,
1188,
273,
466,
40426,
9390,
371,
3,
25,
705,
4008,
198,
220,
220,
220,
3870,
64,
796,
3870,
64,
1343,
662,
1073,
198,
220,
220,
220,
5554,
796,
5554,
1343,
352,
198,
220,
220,
220,
611,
5554,
6624,
352,
25,
198,
220,
220,
220,
220,
220,
220,
220,
17266,
1504,
796,
662,
1073,
198,
220,
220,
220,
220,
220,
220,
220,
1450,
273,
796,
662,
1073,
198,
220,
220,
220,
611,
662,
1073,
1875,
17266,
1504,
25,
198,
220,
220,
220,
220,
220,
220,
220,
17266,
1504,
796,
662,
1073,
198,
220,
220,
220,
611,
662,
1073,
1279,
1450,
273,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1450,
273,
796,
662,
1073,
198,
220,
220,
220,
220,
220,
220,
220,
1450,
273,
1676,
67,
9390,
796,
40426,
9390,
198,
220,
220,
220,
1582,
283,
796,
965,
7,
15414,
10786,
35,
2771,
6592,
1582,
283,
30,
685,
50,
14,
45,
60,
1058,
705,
737,
45828,
3419,
764,
36311,
28955,
58,
15,
60,
198,
220,
220,
220,
611,
1582,
283,
6624,
705,
50,
10354,
198,
220,
220,
220,
220,
220,
220,
220,
2270,
198,
4798,
7,
69,
6,
64,
3870,
64,
23430,
40426,
315,
418,
12084,
4533,
11511,
72,
390,
371,
38892,
82,
6086,
92,
3467,
77,
267,
40426,
9390,
285,
15152,
1097,
78,
11511,
72,
1391,
2611,
1504,
32239,
77,
3256,
437,
28,
7061,
8,
198,
4798,
7,
69,
6,
46,
40426,
9390,
285,
15152,
2318,
5549,
11511,
72,
1391,
3653,
273,
92,
304,
6980,
267,
1391,
3653,
273,
1676,
67,
9390,
92,
11537
] | 2.191209 | 455 |
"""
Author: Paul Saves
This package is distributed under New BSD license.
"""
import numpy as np
import unittest
import inspect
from collections import OrderedDict
from smt.problems import Sphere, TensorProduct, Rosenbrock, Branin
from smt.sampling_methods import LHS
from smt.utils.sm_test_case import SMTestCase
from smt.utils.silence import Silence
from smt.utils import compute_rms_error
from smt.surrogate_models import KPLS
print_output = False
# --------------------------------------------------------------------
# Function: sphere
if __name__ == "__main__":
print_output = True
print("%6s %8s %18s %18s" % ("SM", "Problem", "Train. pt. error", "Test pt. error"))
unittest.main()
| [
37811,
198,
13838,
25,
3362,
311,
3080,
220,
198,
198,
1212,
5301,
318,
9387,
739,
968,
347,
10305,
5964,
13,
198,
37811,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
555,
715,
395,
198,
11748,
10104,
198,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
198,
6738,
895,
83,
13,
1676,
22143,
1330,
31798,
11,
309,
22854,
15667,
11,
15564,
7957,
694,
11,
33628,
259,
198,
6738,
895,
83,
13,
37687,
11347,
62,
24396,
82,
1330,
406,
7998,
198,
198,
6738,
895,
83,
13,
26791,
13,
5796,
62,
9288,
62,
7442,
1330,
9447,
14402,
20448,
198,
6738,
895,
83,
13,
26791,
13,
18217,
594,
1330,
26354,
198,
6738,
895,
83,
13,
26791,
1330,
24061,
62,
81,
907,
62,
18224,
198,
6738,
895,
83,
13,
11793,
3828,
378,
62,
27530,
1330,
509,
6489,
50,
628,
198,
4798,
62,
22915,
796,
10352,
628,
198,
220,
220,
220,
1303,
16529,
650,
198,
220,
220,
220,
1303,
15553,
25,
16558,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
3601,
62,
22915,
796,
6407,
198,
220,
220,
220,
3601,
7203,
4,
21,
82,
4064,
23,
82,
4064,
1507,
82,
4064,
1507,
82,
1,
4064,
5855,
12310,
1600,
366,
40781,
1600,
366,
44077,
13,
42975,
13,
4049,
1600,
366,
14402,
42975,
13,
4049,
48774,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
3419,
198
] | 3.148472 | 229 |
class ADC:
''
class ADCAll:
''
class Accel:
''
class ExtInt:
''
EVT_FALLING = 270663680
EVT_RISING = 269615104
EVT_RISING_FALLING = 271712256
IRQ_FALLING = 270598144
IRQ_RISING = 269549568
IRQ_RISING_FALLING = 271646720
class Flash:
''
class I2C:
''
MASTER = 0
SLAVE = 1
class LCD:
''
class LED:
''
class Pin:
''
AF1_TIM1 = 1
AF1_TIM2 = 1
AF2_TIM3 = 2
AF2_TIM4 = 2
AF2_TIM5 = 2
AF3_TIM10 = 3
AF3_TIM11 = 3
AF3_TIM9 = 3
AF4_I2C1 = 4
AF4_I2C3 = 4
AF5_SPI1 = 5
AF5_SPI2 = 5
AF7_USART1 = 7
AF7_USART2 = 7
AF8_USART6 = 8
AF9_I2C3 = 9
AF_OD = 18
AF_PP = 2
ALT = 2
ALT_OPEN_DRAIN = 18
ANALOG = 3
IN = 0
IRQ_FALLING = 270598144
IRQ_RISING = 269549568
OPEN_DRAIN = 17
OUT = 1
OUT_OD = 17
OUT_PP = 1
PULL_DOWN = 2
PULL_NONE = 0
PULL_UP = 1
board = None
cpu = None
class RTC:
''
SD = None
class SDCard:
''
class SPI:
''
LSB = 128
MASTER = 260
MSB = 0
SLAVE = 0
class Servo:
''
class Switch:
''
class Timer:
''
BOTH = 10
CENTER = 32
DOWN = 16
ENC_A = 9
ENC_AB = 11
ENC_B = 10
FALLING = 2
HIGH = 0
IC = 8
LOW = 2
OC_ACTIVE = 3
OC_FORCED_ACTIVE = 6
OC_FORCED_INACTIVE = 7
OC_INACTIVE = 4
OC_TIMING = 2
OC_TOGGLE = 5
PWM = 0
PWM_INVERTED = 1
RISING = 0
UP = 0
class UART:
''
CTS = 512
RTS = 256
class USB_HID:
''
class USB_VCP:
''
hid_keyboard = None
hid_mouse = None
| [
198,
4871,
49169,
25,
198,
220,
220,
220,
10148,
628,
198,
4871,
49169,
3237,
25,
198,
220,
220,
220,
10148,
628,
198,
4871,
4013,
5276,
25,
198,
220,
220,
220,
10148,
628,
198,
4871,
5683,
5317,
25,
198,
220,
220,
220,
10148,
198,
220,
220,
220,
8696,
51,
62,
37,
7036,
2751,
796,
20479,
2791,
2623,
1795,
198,
220,
220,
220,
8696,
51,
62,
49,
1797,
2751,
796,
2608,
4846,
1314,
13464,
198,
220,
220,
220,
8696,
51,
62,
49,
1797,
2751,
62,
37,
7036,
2751,
796,
2681,
1558,
1065,
11645,
198,
220,
220,
220,
14826,
48,
62,
37,
7036,
2751,
796,
20479,
41292,
18444,
198,
220,
220,
220,
14826,
48,
62,
49,
1797,
2751,
796,
2608,
3865,
33781,
3104,
198,
220,
220,
220,
14826,
48,
62,
49,
1797,
2751,
62,
37,
7036,
2751,
796,
2681,
23237,
3134,
1238,
628,
198,
4871,
9973,
25,
198,
220,
220,
220,
10148,
628,
198,
4871,
314,
17,
34,
25,
198,
220,
220,
220,
10148,
198,
220,
220,
220,
32337,
5781,
796,
657,
198,
220,
220,
220,
12419,
32,
6089,
796,
352,
628,
198,
4871,
23598,
25,
198,
220,
220,
220,
10148,
628,
198,
4871,
12365,
25,
198,
220,
220,
220,
10148,
628,
198,
4871,
13727,
25,
198,
220,
220,
220,
10148,
198,
220,
220,
220,
12341,
16,
62,
51,
3955,
16,
796,
352,
198,
220,
220,
220,
12341,
16,
62,
51,
3955,
17,
796,
352,
198,
220,
220,
220,
12341,
17,
62,
51,
3955,
18,
796,
362,
198,
220,
220,
220,
12341,
17,
62,
51,
3955,
19,
796,
362,
198,
220,
220,
220,
12341,
17,
62,
51,
3955,
20,
796,
362,
198,
220,
220,
220,
12341,
18,
62,
51,
3955,
940,
796,
513,
198,
220,
220,
220,
12341,
18,
62,
51,
3955,
1157,
796,
513,
198,
220,
220,
220,
12341,
18,
62,
51,
3955,
24,
796,
513,
198,
220,
220,
220,
12341,
19,
62,
40,
17,
34,
16,
796,
604,
198,
220,
220,
220,
12341,
19,
62,
40,
17,
34,
18,
796,
604,
198,
220,
220,
220,
12341,
20,
62,
4303,
40,
16,
796,
642,
198,
220,
220,
220,
12341,
20,
62,
4303,
40,
17,
796,
642,
198,
220,
220,
220,
12341,
22,
62,
2937,
7227,
16,
796,
767,
198,
220,
220,
220,
12341,
22,
62,
2937,
7227,
17,
796,
767,
198,
220,
220,
220,
12341,
23,
62,
2937,
7227,
21,
796,
807,
198,
220,
220,
220,
12341,
24,
62,
40,
17,
34,
18,
796,
860,
198,
220,
220,
220,
12341,
62,
3727,
796,
1248,
198,
220,
220,
220,
12341,
62,
10246,
796,
362,
198,
220,
220,
220,
8355,
51,
796,
362,
198,
220,
220,
220,
8355,
51,
62,
3185,
1677,
62,
35,
3861,
1268,
796,
1248,
198,
220,
220,
220,
3537,
1847,
7730,
796,
513,
198,
220,
220,
220,
3268,
796,
657,
198,
220,
220,
220,
14826,
48,
62,
37,
7036,
2751,
796,
20479,
41292,
18444,
198,
220,
220,
220,
14826,
48,
62,
49,
1797,
2751,
796,
2608,
3865,
33781,
3104,
198,
220,
220,
220,
38303,
62,
35,
3861,
1268,
796,
1596,
198,
220,
220,
220,
16289,
796,
352,
198,
220,
220,
220,
16289,
62,
3727,
796,
1596,
198,
220,
220,
220,
16289,
62,
10246,
796,
352,
198,
220,
220,
220,
350,
9994,
62,
41925,
796,
362,
198,
220,
220,
220,
350,
9994,
62,
45,
11651,
796,
657,
198,
220,
220,
220,
350,
9994,
62,
8577,
796,
352,
628,
220,
220,
220,
3096,
796,
6045,
198,
220,
220,
220,
42804,
796,
6045,
628,
198,
4871,
371,
4825,
25,
198,
220,
220,
220,
10148,
198,
198,
10305,
796,
6045,
198,
198,
4871,
311,
9697,
446,
25,
198,
220,
220,
220,
10148,
628,
198,
4871,
49091,
25,
198,
220,
220,
220,
10148,
198,
220,
220,
220,
406,
16811,
796,
13108,
198,
220,
220,
220,
32337,
5781,
796,
21148,
198,
220,
220,
220,
6579,
33,
796,
657,
198,
220,
220,
220,
12419,
32,
6089,
796,
657,
628,
198,
4871,
3116,
78,
25,
198,
220,
220,
220,
10148,
628,
198,
4871,
14645,
25,
198,
220,
220,
220,
10148,
628,
198,
4871,
5045,
263,
25,
198,
220,
220,
220,
10148,
198,
220,
220,
220,
347,
26946,
796,
838,
198,
220,
220,
220,
33269,
1137,
796,
3933,
198,
220,
220,
220,
30320,
796,
1467,
198,
220,
220,
220,
412,
7792,
62,
32,
796,
860,
198,
220,
220,
220,
412,
7792,
62,
6242,
796,
1367,
198,
220,
220,
220,
412,
7792,
62,
33,
796,
838,
198,
220,
220,
220,
376,
7036,
2751,
796,
362,
198,
220,
220,
220,
34677,
796,
657,
198,
220,
220,
220,
12460,
796,
807,
198,
220,
220,
220,
46663,
796,
362,
198,
220,
220,
220,
24775,
62,
10659,
9306,
796,
513,
198,
220,
220,
220,
24775,
62,
13775,
34,
1961,
62,
10659,
9306,
796,
718,
198,
220,
220,
220,
24775,
62,
13775,
34,
1961,
62,
1268,
10659,
9306,
796,
767,
198,
220,
220,
220,
24775,
62,
1268,
10659,
9306,
796,
604,
198,
220,
220,
220,
24775,
62,
51,
3955,
2751,
796,
362,
198,
220,
220,
220,
24775,
62,
51,
7730,
38,
2538,
796,
642,
198,
220,
220,
220,
350,
22117,
796,
657,
198,
220,
220,
220,
350,
22117,
62,
1268,
15858,
1961,
796,
352,
198,
220,
220,
220,
45698,
2751,
796,
657,
198,
220,
220,
220,
15958,
796,
657,
628,
198,
4871,
471,
7227,
25,
198,
220,
220,
220,
10148,
198,
220,
220,
220,
327,
4694,
796,
22243,
198,
220,
220,
220,
371,
4694,
796,
17759,
628,
198,
4871,
8450,
62,
39,
2389,
25,
198,
220,
220,
220,
10148,
628,
198,
4871,
8450,
62,
53,
8697,
25,
198,
220,
220,
220,
10148,
198,
198,
49675,
62,
2539,
3526,
796,
6045,
198,
49675,
62,
35888,
796,
6045,
628
] | 1.75 | 932 |
import pytest
from django.conf import settings
from index_auth_service.friends.models import Friendship
from index_auth_service.users.tests.factories import UserFactory
from .factories import FriendshipFactory
pytestmark = pytest.mark.django_db
| [
11748,
12972,
9288,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
198,
6738,
6376,
62,
18439,
62,
15271,
13,
36154,
13,
27530,
1330,
39993,
198,
198,
6738,
6376,
62,
18439,
62,
15271,
13,
18417,
13,
41989,
13,
22584,
1749,
1330,
11787,
22810,
198,
6738,
764,
22584,
1749,
1330,
39993,
22810,
198,
198,
9078,
9288,
4102,
796,
12972,
9288,
13,
4102,
13,
28241,
14208,
62,
9945,
628
] | 3.716418 | 67 |
import mesh.patch as patch
import mesh.reconstruction_f as reconstruction_f
import mesh.array_indexer as ai
| [
11748,
19609,
13,
17147,
355,
8529,
198,
11748,
19609,
13,
260,
9979,
2762,
62,
69,
355,
25056,
62,
69,
198,
11748,
19609,
13,
18747,
62,
9630,
263,
355,
257,
72,
198
] | 3.483871 | 31 |
import os
from typing import Generator
from src.abstract_folder_iterator import FolderIterator
| [
11748,
28686,
198,
6738,
19720,
1330,
35986,
198,
198,
6738,
12351,
13,
397,
8709,
62,
43551,
62,
48727,
1330,
48107,
37787,
628
] | 4.409091 | 22 |
pkgname = "mpv"
pkgver = "0.34.1"
pkgrel = 0
build_style = "waf"
configure_args = [
"--confdir=/etc/mpv", "--docdir=/usr/share/examples/mpv",
"--zshdir=/usr/share/zsh/site-functions", "--enable-libmpv-shared",
"--enable-cplugins", "--enable-cdda", "--enable-dvbin",
"--enable-dvdnav", "--enable-libarchive", "--enable-pulse",
"--enable-jack", "--enable-lcms2", "--enable-lua", "--enable-vdpau",
"--enable-vulkan", "--enable-shaderc", "--enable-wayland",
"--enable-x11", "--enable-caca", "--enable-vapoursynth",
"--enable-zimg",
"--disable-alsa", "--disable-openal", "--disable-sdl2",
]
hostmakedepends = [
"pkgconf", "python", "python-docutils", "wayland-progs"
]
makedepends = [
"libarchive-devel", "lua5.1-devel", "libuuid-devel", "mesa-devel",
"vulkan-headers", "vulkan-loader", "libplacebo-devel", "shaderc-devel",
"ffmpeg-devel", "libxv-devel", "libxrandr-devel", "libxinerama-devel",
"libxscrnsaver-devel", "libxkbcommon-devel", "wayland-devel",
"wayland-protocols", "libvdpau-devel", "libva-devel", "libpulse-devel",
"pipewire-jack-devel", "lcms2-devel", "libass-devel", "libbluray-devel",
"libdvdnav-devel", "libcdio-paranoia-devel", "rubberband-devel",
"uchardet-devel", "harfbuzz-devel", "libcaca-devel", "zimg-devel",
"vapoursynth-devel",
]
depends = ["hicolor-icon-theme"]
pkgdesc = "Video player based on mplayer2"
maintainer = "q66 <[email protected]>"
license = "GPL-2.0-or-later"
url = "https://mpv.io"
source = f"https://github.com/mpv-player/{pkgname}/archive/v{pkgver}.tar.gz"
sha256 = "32ded8c13b6398310fa27767378193dc1db6d78b006b70dbcbd3123a1445e746"
# no test suite
options = ["!check"]
@subpackage("mpv-devel")
| [
35339,
3672,
796,
366,
3149,
85,
1,
198,
35339,
332,
796,
366,
15,
13,
2682,
13,
16,
1,
198,
35339,
2411,
796,
657,
198,
11249,
62,
7635,
796,
366,
86,
1878,
1,
198,
11250,
495,
62,
22046,
796,
685,
198,
220,
220,
220,
366,
438,
10414,
15908,
33223,
14784,
14,
3149,
85,
1600,
366,
438,
15390,
15908,
33223,
14629,
14,
20077,
14,
1069,
12629,
14,
3149,
85,
1600,
198,
220,
220,
220,
366,
438,
89,
1477,
15908,
33223,
14629,
14,
20077,
14,
89,
1477,
14,
15654,
12,
12543,
2733,
1600,
366,
438,
21633,
12,
8019,
3149,
85,
12,
28710,
1600,
198,
220,
220,
220,
366,
438,
21633,
12,
66,
37390,
1600,
366,
438,
21633,
12,
66,
1860,
64,
1600,
366,
438,
21633,
12,
67,
85,
8800,
1600,
198,
220,
220,
220,
366,
438,
21633,
12,
67,
20306,
28341,
1600,
366,
438,
21633,
12,
8019,
17474,
1600,
366,
438,
21633,
12,
79,
9615,
1600,
198,
220,
220,
220,
366,
438,
21633,
12,
19650,
1600,
366,
438,
21633,
12,
44601,
907,
17,
1600,
366,
438,
21633,
12,
40211,
1600,
366,
438,
21633,
12,
20306,
79,
559,
1600,
198,
220,
220,
220,
366,
438,
21633,
12,
85,
31263,
1600,
366,
438,
21633,
12,
1477,
324,
2798,
1600,
366,
438,
21633,
12,
1014,
1044,
1600,
198,
220,
220,
220,
366,
438,
21633,
12,
87,
1157,
1600,
366,
438,
21633,
12,
66,
22260,
1600,
366,
438,
21633,
12,
85,
499,
454,
28869,
400,
1600,
198,
220,
220,
220,
366,
438,
21633,
12,
89,
9600,
1600,
198,
220,
220,
220,
366,
438,
40223,
12,
32058,
1600,
366,
438,
40223,
12,
9654,
282,
1600,
366,
438,
40223,
12,
21282,
75,
17,
1600,
198,
60,
198,
4774,
76,
4335,
538,
2412,
796,
685,
198,
220,
220,
220,
366,
35339,
10414,
1600,
366,
29412,
1600,
366,
29412,
12,
15390,
26791,
1600,
366,
1014,
1044,
12,
1676,
14542,
1,
198,
60,
198,
76,
4335,
538,
2412,
796,
685,
198,
220,
220,
220,
366,
8019,
17474,
12,
2934,
626,
1600,
366,
40211,
20,
13,
16,
12,
2934,
626,
1600,
366,
8019,
12303,
312,
12,
2934,
626,
1600,
366,
6880,
64,
12,
2934,
626,
1600,
198,
220,
220,
220,
366,
85,
31263,
12,
50145,
1600,
366,
85,
31263,
12,
29356,
1600,
366,
8019,
5372,
2127,
12,
2934,
626,
1600,
366,
1477,
324,
2798,
12,
2934,
626,
1600,
198,
220,
220,
220,
366,
487,
43913,
12,
2934,
626,
1600,
366,
8019,
87,
85,
12,
2934,
626,
1600,
366,
8019,
87,
25192,
81,
12,
2934,
626,
1600,
366,
8019,
87,
7274,
1689,
12,
2934,
626,
1600,
198,
220,
220,
220,
366,
8019,
87,
1416,
81,
5907,
8770,
12,
2934,
626,
1600,
366,
8019,
87,
32812,
11321,
12,
2934,
626,
1600,
366,
1014,
1044,
12,
2934,
626,
1600,
198,
220,
220,
220,
366,
1014,
1044,
12,
11235,
4668,
82,
1600,
366,
8019,
20306,
79,
559,
12,
2934,
626,
1600,
366,
8019,
6862,
12,
2934,
626,
1600,
366,
8019,
79,
9615,
12,
2934,
626,
1600,
198,
220,
220,
220,
366,
79,
541,
413,
557,
12,
19650,
12,
2934,
626,
1600,
366,
44601,
907,
17,
12,
2934,
626,
1600,
366,
8019,
562,
12,
2934,
626,
1600,
366,
8019,
2436,
333,
323,
12,
2934,
626,
1600,
198,
220,
220,
220,
366,
8019,
67,
20306,
28341,
12,
2934,
626,
1600,
366,
8019,
10210,
952,
12,
1845,
30661,
12,
2934,
626,
1600,
366,
25089,
527,
3903,
12,
2934,
626,
1600,
198,
220,
220,
220,
366,
794,
446,
316,
12,
2934,
626,
1600,
366,
9869,
21855,
4715,
12,
2934,
626,
1600,
366,
8019,
66,
22260,
12,
2934,
626,
1600,
366,
89,
9600,
12,
2934,
626,
1600,
198,
220,
220,
220,
366,
85,
499,
454,
28869,
400,
12,
2934,
626,
1600,
198,
60,
198,
10378,
2412,
796,
14631,
71,
27045,
273,
12,
4749,
12,
43810,
8973,
198,
35339,
20147,
796,
366,
10798,
2137,
1912,
319,
285,
7829,
17,
1,
198,
76,
2913,
10613,
796,
366,
80,
2791,
1279,
80,
2791,
31,
354,
320,
8607,
12,
23289,
13,
2398,
24618,
198,
43085,
796,
366,
38,
6489,
12,
17,
13,
15,
12,
273,
12,
36760,
1,
198,
6371,
796,
366,
5450,
1378,
3149,
85,
13,
952,
1,
198,
10459,
796,
277,
1,
5450,
1378,
12567,
13,
785,
14,
3149,
85,
12,
7829,
14,
90,
35339,
3672,
92,
14,
17474,
14,
85,
90,
35339,
332,
27422,
18870,
13,
34586,
1,
198,
26270,
11645,
796,
366,
2624,
9395,
23,
66,
1485,
65,
21,
2670,
5999,
940,
13331,
27019,
3134,
30695,
24943,
17896,
16,
9945,
21,
67,
3695,
65,
28041,
65,
2154,
9945,
66,
17457,
18,
10163,
64,
1415,
2231,
68,
22,
3510,
1,
198,
2,
645,
1332,
18389,
198,
25811,
796,
14631,
0,
9122,
8973,
198,
198,
31,
7266,
26495,
7203,
3149,
85,
12,
2934,
626,
4943,
198
] | 2.193095 | 782 |
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
"""
78 / 78 test cases passed.
Runtime: 52 ms
Memory Usage: 17.6 MB
"""
| [
2,
30396,
329,
257,
13934,
5509,
10139,
13,
198,
2,
1398,
12200,
19667,
25,
198,
2,
220,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
1188,
28,
15,
11,
1364,
28,
14202,
11,
826,
28,
14202,
2599,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
2100,
796,
1188,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
9464,
796,
1364,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
3506,
796,
826,
198,
198,
37811,
198,
3695,
1220,
8699,
1332,
2663,
3804,
13,
198,
41006,
25,
6740,
13845,
198,
30871,
29566,
25,
1596,
13,
21,
10771,
198,
37811,
198
] | 2.387387 | 111 |
from __future__ import print_function, absolute_import
import argparse
import os.path as osp
import numpy as np
import sys
import torch
from torch import nn
from torch.backends import cudnn
from torch.utils.data import DataLoader
import tkinter as tk
from tkinter import ttk
import tkinter.font as tkFont
from reid import datasets
from reid import models
from reid.loss import TripletLoss
from reid.dist_metric import DistanceMetric
from reid.trainers import Trainer
from reid.evaluators import Evaluator
from reid.utils.data import transforms as T
from reid.utils.data.preprocessor import Preprocessor
from reid.utils.logging import Logger
from reid.utils.serialization import load_checkpoint, save_checkpoint
from reid.utils.data.sampler import RandomIdentitySampler
from reid.loss import OIMLoss
from examples.pl_createmodel import cr_oimmodel, cr_softmaxmodel, cr_tripletmodel
from examples.pl_parameters import *
from examples.pl_optimizer import softmax_op, triplet_op, oim_op
| [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
11,
4112,
62,
11748,
198,
11748,
1822,
29572,
198,
11748,
28686,
13,
6978,
355,
267,
2777,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
25064,
198,
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
198,
6738,
28034,
13,
1891,
2412,
1330,
269,
463,
20471,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
6060,
17401,
198,
11748,
256,
74,
3849,
355,
256,
74,
198,
6738,
256,
74,
3849,
1330,
256,
30488,
198,
11748,
256,
74,
3849,
13,
10331,
355,
256,
74,
23252,
198,
198,
6738,
302,
312,
1330,
40522,
198,
6738,
302,
312,
1330,
4981,
198,
6738,
302,
312,
13,
22462,
1330,
19817,
83,
43,
793,
198,
6738,
302,
312,
13,
17080,
62,
4164,
1173,
1330,
34600,
9171,
1173,
198,
6738,
302,
312,
13,
27432,
364,
1330,
31924,
198,
6738,
302,
312,
13,
18206,
84,
2024,
1330,
26439,
84,
1352,
198,
6738,
302,
312,
13,
26791,
13,
7890,
1330,
31408,
355,
309,
198,
6738,
302,
312,
13,
26791,
13,
7890,
13,
3866,
41341,
1330,
3771,
41341,
198,
6738,
302,
312,
13,
26791,
13,
6404,
2667,
1330,
5972,
1362,
198,
6738,
302,
312,
13,
26791,
13,
46911,
1634,
1330,
3440,
62,
9122,
4122,
11,
3613,
62,
9122,
4122,
198,
6738,
302,
312,
13,
26791,
13,
7890,
13,
37687,
20053,
1330,
14534,
7390,
26858,
16305,
20053,
198,
198,
6738,
302,
312,
13,
22462,
1330,
440,
3955,
43,
793,
628,
198,
6738,
6096,
13,
489,
62,
20123,
368,
375,
417,
1330,
1067,
62,
78,
320,
19849,
11,
1067,
62,
4215,
9806,
19849,
11,
1067,
62,
28461,
37069,
19849,
198,
6738,
6096,
13,
489,
62,
17143,
7307,
1330,
1635,
198,
6738,
6096,
13,
489,
62,
40085,
7509,
1330,
2705,
9806,
62,
404,
11,
15055,
83,
62,
404,
11,
267,
320,
62,
404,
628,
628,
628
] | 3.32107 | 299 |
import expressions
| [
11748,
14700,
628,
628
] | 5.5 | 4 |
from .dgmr import DGMR
from .generators import Sampler, Generator
from .discriminators import SpatialDiscriminator, TemporalDiscriminator, Discriminator
from .common import LatentConditioningStack, ContextConditioningStack
| [
6738,
764,
67,
39870,
81,
1330,
46133,
13599,
198,
6738,
764,
8612,
2024,
1330,
3409,
20053,
11,
35986,
198,
6738,
764,
15410,
3036,
47721,
1330,
1338,
34961,
15642,
3036,
20900,
11,
5825,
35738,
15642,
3036,
20900,
11,
8444,
3036,
20900,
198,
6738,
764,
11321,
1330,
5476,
298,
48362,
278,
25896,
11,
30532,
48362,
278,
25896,
198
] | 3.982143 | 56 |
from contextlib import suppress
from pyopenproject.api_connection.exceptions.request_exception import RequestError
from pyopenproject.api_connection.requests.patch_request import PatchRequest
from pyopenproject.business.exception.business_error import BusinessError
from pyopenproject.business.services.command.time_entry.time_entry_command import TimeEntryCommand
from pyopenproject.model import time_entry as te
| [
6738,
4732,
8019,
1330,
18175,
198,
198,
6738,
12972,
9654,
16302,
13,
15042,
62,
38659,
13,
1069,
11755,
13,
25927,
62,
1069,
4516,
1330,
19390,
12331,
198,
6738,
12972,
9654,
16302,
13,
15042,
62,
38659,
13,
8897,
3558,
13,
17147,
62,
25927,
1330,
17106,
18453,
198,
6738,
12972,
9654,
16302,
13,
22680,
13,
1069,
4516,
13,
22680,
62,
18224,
1330,
7320,
12331,
198,
6738,
12972,
9654,
16302,
13,
22680,
13,
30416,
13,
21812,
13,
2435,
62,
13000,
13,
2435,
62,
13000,
62,
21812,
1330,
3862,
30150,
21575,
198,
6738,
12972,
9654,
16302,
13,
19849,
1330,
640,
62,
13000,
355,
573,
198
] | 4.108911 | 101 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.