content
stringlengths 1
1.04M
| input_ids
sequencelengths 1
774k
| ratio_char_token
float64 0.38
22.9
| token_count
int64 1
774k
|
---|---|---|---|
#!/usr/bin/python
#
# Copyright 2018-2022 Polyaxon, 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 polyaxon.polyaxonfile.check import (
DEFAULT_POLYAXON_FILE_EXTENSION,
DEFAULT_POLYAXON_FILE_NAME,
check_default_path,
check_polyaxonfile,
)
from polyaxon.polyaxonfile.manager import get_op_specification
from polyaxon.polyaxonfile.params import parse_params
from polyaxon.polyaxonfile.specs import (
BaseSpecification,
CompiledOperationSpecification,
ComponentSpecification,
OperationSpecification,
get_specification,
spec_kinds,
)
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
198,
2,
15069,
2864,
12,
1238,
1828,
12280,
897,
261,
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,
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,
7514,
897,
261,
13,
35428,
897,
261,
7753,
13,
9122,
1330,
357,
198,
220,
220,
220,
5550,
38865,
62,
45472,
56,
25922,
1340,
62,
25664,
62,
13918,
16938,
2849,
11,
198,
220,
220,
220,
5550,
38865,
62,
45472,
56,
25922,
1340,
62,
25664,
62,
20608,
11,
198,
220,
220,
220,
2198,
62,
12286,
62,
6978,
11,
198,
220,
220,
220,
2198,
62,
35428,
897,
261,
7753,
11,
198,
8,
198,
6738,
7514,
897,
261,
13,
35428,
897,
261,
7753,
13,
37153,
1330,
651,
62,
404,
62,
16684,
2649,
198,
6738,
7514,
897,
261,
13,
35428,
897,
261,
7753,
13,
37266,
1330,
21136,
62,
37266,
198,
6738,
7514,
897,
261,
13,
35428,
897,
261,
7753,
13,
4125,
6359,
1330,
357,
198,
220,
220,
220,
7308,
22882,
2649,
11,
198,
220,
220,
220,
3082,
3902,
32180,
22882,
2649,
11,
198,
220,
220,
220,
35100,
22882,
2649,
11,
198,
220,
220,
220,
14680,
22882,
2649,
11,
198,
220,
220,
220,
651,
62,
16684,
2649,
11,
198,
220,
220,
220,
1020,
62,
11031,
82,
11,
198,
8,
198
] | 3.160819 | 342 |
# Generated by Django 3.1.7 on 2021-07-18 10:36
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django_countries.fields
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
22,
319,
33448,
12,
2998,
12,
1507,
838,
25,
2623,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
198,
11748,
42625,
14208,
62,
9127,
1678,
13,
25747,
628
] | 3.081967 | 61 |
from rfeed import * # Create RSS feeds
import GetOldTweets3 as got # Scrape for tweets
from functools import lru_cache # Cache feeds
from flask import make_response # Tell Flask that it's being sent XML
@lru_cache(maxsize=None)
| [
6738,
374,
12363,
1330,
1635,
1303,
13610,
25012,
21318,
198,
11748,
3497,
19620,
32665,
1039,
18,
355,
1392,
1303,
1446,
13484,
329,
12665,
198,
6738,
1257,
310,
10141,
1330,
300,
622,
62,
23870,
1303,
34088,
21318,
198,
6738,
42903,
1330,
787,
62,
26209,
1303,
14026,
46947,
326,
340,
338,
852,
1908,
23735,
198,
198,
31,
75,
622,
62,
23870,
7,
9806,
7857,
28,
14202,
8,
628
] | 3.484848 | 66 |
# Generated by Django 2.2.6 on 2019-10-21 02:18
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
21,
319,
13130,
12,
940,
12,
2481,
7816,
25,
1507,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
import asyncio
import logging
import time
from typing import Iterable, NoReturn, Optional, Set
from procrastinate import app, exceptions, jobs, signals, tasks, types
logger = logging.getLogger(__name__)
| [
11748,
30351,
952,
198,
11748,
18931,
198,
11748,
640,
198,
6738,
19720,
1330,
40806,
540,
11,
1400,
13615,
11,
32233,
11,
5345,
198,
198,
6738,
13834,
5685,
4559,
1330,
598,
11,
13269,
11,
3946,
11,
10425,
11,
8861,
11,
3858,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628
] | 3.678571 | 56 |
import wx
| [
11748,
266,
87,
198
] | 2.5 | 4 |
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import print_function
import tensorflow as tf
import numpy as np
import sys
import pickle
if len(sys.argv) != 2:
print("[ERROR] dump_pruned_model.py needs a ckpt file as input. \n e.g. python dump_pruned_model.py model.ckpt")
sys.exit(0)
# Get the values of all variables in the checkpoint file, and then save the values of all variables in a pickle file by dict
# The key of the dict is the name of variables
# The value of the dict is the values of variables
# For example, all_variables[0]=<tf.Variable 'transformer/decoder/layer_0/masked_multi_head/LayerNorm/beta:0' shape=(512,) dtype=float32_ref>,
# then the key is 'transformer/decoder/layer_0/masked_multi_head/LayerNorm/beta:0'; the value is sess.run(all_variables[0])
# If you need to dump the model which has same structure but different variable name, you can convert the name of your model into opennmt's name one by one.
# For example, the name of beta variable of first layer normalization in first layer of decoder is 'transformer/decoder/layer_0/masked_multi_head/LayerNorm/beta:0',
# and in your model, you use other name like 'body/decoder/layer_0/self_attention/LayerNorm/beta:0'
# then the key is: 'transformer/decoder/layer_0/masked_multi_head/LayerNorm/beta:0' (the model name of opennmt)
# and the value is sess.run(<tf.Variable 'transformer/decoder/layer_0/masked_multi_head/LayerNorm/beta:0', shape=(512,) dtype=float32_ref>) (your variable value)
ckpt_name = sys.argv[1]
with tf.Session() as sess:
saver = tf.train.import_meta_graph(ckpt_name + ".meta")
saver.restore(sess, (ckpt_name))
all_variables = tf.trainable_variables()
ckpt = {}
all_val = sess.run(all_variables)
for var, val in zip(all_variables, all_val):
if var.name.find("Adam") == -1:
ckpt[var.name] = val
with open('model.pkl', 'wb') as f:
pickle.dump(ckpt, f, pickle.HIGHEST_PROTOCOL)
| [
2,
15069,
357,
66,
8,
12131,
11,
15127,
23929,
44680,
6234,
13,
220,
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,
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,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
25064,
198,
11748,
2298,
293,
220,
198,
198,
361,
18896,
7,
17597,
13,
853,
85,
8,
14512,
362,
25,
198,
220,
220,
220,
3601,
7203,
58,
24908,
60,
10285,
62,
1050,
40881,
62,
19849,
13,
9078,
2476,
257,
269,
74,
457,
2393,
355,
5128,
13,
3467,
77,
304,
13,
70,
13,
21015,
10285,
62,
1050,
40881,
62,
19849,
13,
9078,
2746,
13,
694,
457,
4943,
198,
220,
220,
220,
25064,
13,
37023,
7,
15,
8,
198,
198,
2,
3497,
262,
3815,
286,
477,
9633,
287,
262,
26954,
2393,
11,
290,
788,
3613,
262,
3815,
286,
477,
9633,
287,
257,
2298,
293,
2393,
416,
8633,
198,
2,
383,
1994,
286,
262,
8633,
318,
262,
1438,
286,
9633,
198,
2,
383,
1988,
286,
262,
8633,
318,
262,
3815,
286,
9633,
198,
2,
1114,
1672,
11,
477,
62,
25641,
2977,
58,
15,
22241,
27,
27110,
13,
43015,
705,
7645,
16354,
14,
12501,
12342,
14,
29289,
62,
15,
14,
27932,
276,
62,
41684,
62,
2256,
14,
49925,
35393,
14,
31361,
25,
15,
6,
5485,
16193,
25836,
35751,
288,
4906,
28,
22468,
2624,
62,
5420,
22330,
198,
2,
788,
262,
1994,
318,
705,
7645,
16354,
14,
12501,
12342,
14,
29289,
62,
15,
14,
27932,
276,
62,
41684,
62,
2256,
14,
49925,
35393,
14,
31361,
25,
15,
17020,
262,
1988,
318,
264,
408,
13,
5143,
7,
439,
62,
25641,
2977,
58,
15,
12962,
198,
198,
2,
1002,
345,
761,
284,
10285,
262,
2746,
543,
468,
976,
4645,
475,
1180,
7885,
1438,
11,
345,
460,
10385,
262,
1438,
286,
534,
2746,
656,
1280,
77,
16762,
338,
1438,
530,
416,
530,
13,
198,
2,
1114,
1672,
11,
262,
1438,
286,
12159,
7885,
286,
717,
7679,
3487,
1634,
287,
717,
7679,
286,
875,
12342,
318,
705,
7645,
16354,
14,
12501,
12342,
14,
29289,
62,
15,
14,
27932,
276,
62,
41684,
62,
2256,
14,
49925,
35393,
14,
31361,
25,
15,
3256,
198,
2,
290,
287,
534,
2746,
11,
345,
779,
584,
1438,
588,
705,
2618,
14,
12501,
12342,
14,
29289,
62,
15,
14,
944,
62,
1078,
1463,
14,
49925,
35393,
14,
31361,
25,
15,
6,
198,
2,
788,
262,
1994,
318,
25,
705,
7645,
16354,
14,
12501,
12342,
14,
29289,
62,
15,
14,
27932,
276,
62,
41684,
62,
2256,
14,
49925,
35393,
14,
31361,
25,
15,
6,
357,
1169,
2746,
1438,
286,
1280,
77,
16762,
8,
198,
2,
290,
262,
1988,
318,
264,
408,
13,
5143,
7,
27,
27110,
13,
43015,
705,
7645,
16354,
14,
12501,
12342,
14,
29289,
62,
15,
14,
27932,
276,
62,
41684,
62,
2256,
14,
49925,
35393,
14,
31361,
25,
15,
3256,
5485,
16193,
25836,
35751,
288,
4906,
28,
22468,
2624,
62,
5420,
43734,
357,
14108,
7885,
1988,
8,
198,
198,
694,
457,
62,
3672,
796,
25064,
13,
853,
85,
58,
16,
60,
198,
220,
220,
220,
220,
198,
4480,
48700,
13,
36044,
3419,
355,
264,
408,
25,
198,
220,
220,
220,
473,
332,
796,
48700,
13,
27432,
13,
11748,
62,
28961,
62,
34960,
7,
694,
457,
62,
3672,
1343,
27071,
28961,
4943,
198,
220,
220,
220,
473,
332,
13,
2118,
382,
7,
82,
408,
11,
357,
694,
457,
62,
3672,
4008,
198,
220,
220,
220,
477,
62,
25641,
2977,
796,
48700,
13,
27432,
540,
62,
25641,
2977,
3419,
198,
220,
220,
220,
269,
74,
457,
796,
23884,
198,
220,
220,
220,
220,
198,
220,
220,
220,
477,
62,
2100,
796,
264,
408,
13,
5143,
7,
439,
62,
25641,
2977,
8,
198,
220,
220,
220,
329,
1401,
11,
1188,
287,
19974,
7,
439,
62,
25641,
2977,
11,
477,
62,
2100,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
611,
1401,
13,
3672,
13,
19796,
7203,
23159,
4943,
6624,
532,
16,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
74,
457,
58,
7785,
13,
3672,
60,
796,
1188,
198,
220,
220,
220,
220,
198,
220,
220,
220,
351,
1280,
10786,
19849,
13,
79,
41582,
3256,
705,
39346,
11537,
355,
277,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2298,
293,
13,
39455,
7,
694,
457,
11,
277,
11,
2298,
293,
13,
39,
18060,
6465,
62,
4805,
2394,
4503,
3535,
8,
198
] | 2.931871 | 866 |
# coding=utf8
import MySQLdb
conn = MySQLdb.connect(
host='localhost',
user='root',
passwd='123456',
db='TeacherSchema'
)
cur = conn.cursor()
cur.execute("SELECT COUNT(Teacher_Name) FROM Teacher;")
count = cur.fetchall()
count = count[0][0]
print count
for i in range(count):
try:
sql = "SELECT Teacher_Photo FROM Teacher WHERE Teacher_ID=" + str(i) + ";"
cur.execute(sql)
teacher = cur.fetchone()
new_photo = teacher[0][:-4] + ".jpg"
print new_photo
sql_update = "UPDATE Teacher SET Teacher_Photo='" + str(new_photo) + "' WHERE Teacher_ID=" + str(i) + ";"
cur.execute(sql_update)
conn.commit()
except:
continue
| [
2,
19617,
28,
40477,
23,
198,
11748,
33476,
9945,
198,
198,
37043,
796,
33476,
9945,
13,
8443,
7,
198,
197,
4774,
11639,
36750,
3256,
198,
197,
7220,
11639,
15763,
3256,
198,
197,
6603,
16993,
11639,
10163,
29228,
3256,
198,
197,
9945,
11639,
6767,
3493,
27054,
2611,
6,
198,
8,
198,
22019,
796,
48260,
13,
66,
21471,
3419,
198,
198,
22019,
13,
41049,
7203,
46506,
327,
28270,
7,
6767,
3493,
62,
5376,
8,
16034,
32019,
26,
4943,
198,
9127,
796,
1090,
13,
69,
7569,
439,
3419,
198,
9127,
796,
954,
58,
15,
7131,
15,
60,
198,
4798,
954,
198,
198,
1640,
1312,
287,
2837,
7,
9127,
2599,
198,
197,
28311,
25,
198,
197,
197,
25410,
796,
366,
46506,
32019,
62,
6191,
16034,
32019,
33411,
32019,
62,
2389,
2625,
1343,
965,
7,
72,
8,
1343,
366,
26033,
198,
197,
197,
22019,
13,
41049,
7,
25410,
8,
198,
197,
197,
660,
3493,
796,
1090,
13,
69,
7569,
505,
3419,
198,
197,
197,
3605,
62,
23074,
796,
4701,
58,
15,
7131,
21912,
19,
60,
1343,
27071,
9479,
1,
198,
197,
197,
4798,
649,
62,
23074,
198,
197,
197,
25410,
62,
19119,
796,
366,
16977,
32019,
25823,
32019,
62,
6191,
11639,
1,
1343,
965,
7,
3605,
62,
23074,
8,
1343,
24018,
33411,
32019,
62,
2389,
2625,
1343,
965,
7,
72,
8,
1343,
366,
26033,
198,
197,
197,
22019,
13,
41049,
7,
25410,
62,
19119,
8,
198,
197,
197,
37043,
13,
41509,
3419,
198,
197,
16341,
25,
198,
197,
197,
43043,
628
] | 2.601626 | 246 |
"""
Setup FFMPEG before!!!
https://www.ffmpeg.org/download.html#build-windows
"""
from pydub import AudioSegment
names = [
'shot',
'explosion',
'explosion_1'
]
for name in names:
sound = AudioSegment.from_mp3(f"../sound/{name}.mp3")
sound.export(f"../sound/{name}.wav", format="wav")
| [
37811,
198,
40786,
18402,
7378,
7156,
878,
10185,
198,
5450,
1378,
2503,
13,
487,
43913,
13,
2398,
14,
15002,
13,
6494,
2,
11249,
12,
28457,
198,
37811,
198,
198,
6738,
279,
5173,
549,
1330,
13491,
41030,
434,
198,
198,
14933,
796,
685,
198,
220,
220,
220,
705,
9442,
3256,
198,
220,
220,
220,
705,
20676,
18442,
3256,
198,
220,
220,
220,
705,
20676,
18442,
62,
16,
6,
198,
60,
198,
198,
1640,
1438,
287,
3891,
25,
198,
220,
220,
220,
2128,
796,
13491,
41030,
434,
13,
6738,
62,
3149,
18,
7,
69,
1,
40720,
23661,
14,
90,
3672,
27422,
3149,
18,
4943,
198,
220,
220,
220,
2128,
13,
39344,
7,
69,
1,
40720,
23661,
14,
90,
3672,
27422,
45137,
1600,
5794,
2625,
45137,
4943,
198
] | 2.456 | 125 |
from django.urls import path
from home.views import IndexView, BlogView, DetailView, ToolView, ToolDetailView
urlpatterns = [
path('', IndexView.as_view(), name='index'),
path('blog/', BlogView.as_view(), name='blog'),
path('detail/', DetailView.as_view(), name='detail'),
path('tool/', ToolView.as_view(), name='tool'),
path('tool_detail/', ToolDetailView.as_view(), name='tool_detail'),
]
| [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
201,
6738,
1363,
13,
33571,
1330,
12901,
7680,
11,
14001,
7680,
11,
42585,
7680,
11,
16984,
7680,
11,
16984,
11242,
603,
7680,
201,
201,
6371,
33279,
82,
796,
685,
201,
220,
220,
220,
3108,
10786,
3256,
12901,
7680,
13,
292,
62,
1177,
22784,
1438,
11639,
9630,
33809,
201,
220,
220,
220,
3108,
10786,
14036,
14,
3256,
14001,
7680,
13,
292,
62,
1177,
22784,
1438,
11639,
14036,
33809,
201,
220,
220,
220,
3108,
10786,
49170,
14,
3256,
42585,
7680,
13,
292,
62,
1177,
22784,
1438,
11639,
49170,
33809,
201,
220,
220,
220,
3108,
10786,
25981,
14,
3256,
16984,
7680,
13,
292,
62,
1177,
22784,
1438,
11639,
25981,
33809,
201,
220,
220,
220,
3108,
10786,
25981,
62,
49170,
14,
3256,
16984,
11242,
603,
7680,
13,
292,
62,
1177,
22784,
1438,
11639,
25981,
62,
49170,
33809,
201,
60,
201
] | 2.861111 | 144 |
# Copyright 2016 Hewlett Packard Enterprise Development LP
#
# 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 .logger import logger
from . import config
from . import constants
import cgi
import csv
import json
import subprocess
"""
Several classes are defined in this module:
Result:
This is used for setting a descriptive value of the outcome of a test.
This class is basically an ENUM which allows readable values for test
results.
ResultDisplayType:
This is used for setting how a test's results should be output. For
example in most cases it's probably fine to only show only tests which
fail. In some cases though, you'll want to see which tests were skipped
and why.
This class is basically an ENUM which allows more nicely readable values
for this option.
TestResults:
An instance of this class is returned as the result of a run of a test set.
TestResults is a list of test run dictionaries, each contains:
- name: a descriptive name of the test
- result: either a TestResult or GroupTestResult instance
Once this class has been instantiated it can be used to display the results
on the command line or output reports.
TestResult:
This class represents an individual test result. It contains two values:
result - This is an item of type Result which indicates the pass status of
the test that ran
confidence - Indicates how certain recon is about this result. Some tests
can only make a good guess.
notes - This is an optional text string field which describes any remarks
that the test added. This is typically used to indicate reasons why a
test failed or was skipped.
GroupTestResult:
Some types of tests test the same thing repeatedly. Rather than list each
as a separate test they can be defined as a GroupTest which returns results
as a GroupTestResult. A GroupTestResult is a list of individual tests which
were run as part of the group. For each sub-test the following is stored:
- name: a descriptive name of the test
- result: a TestResult instance
"""
def _build_result_string(name, result, confidence, notes, use_color,
term_colors, indent, widths):
"""Internal utility function to build a result string
:param name: Name of test
:param result: Enum indicating the status of the test
:param confidence: Enum indicating the confidence of the test
:param notes: Associated with the test
:param use_color: Boolean indicating whether color should be displayed
:param indent: Boolean indicating if test name should be indented
:param widths: Dict with field widths
:returns:
"""
name_newline_str = '\n' + ' ' * widths['TEST_NAME']
# Set the output color and text result based on test result
result_color = ""
pass_string = ""
if result == Result.PASS:
result_color = term_colors['pass']
pass_string = 'PASS'
elif result == Result.SKIP:
result_color = term_colors['skip']
pass_string = 'SKIP'
elif result == Result.FAIL:
result_color = term_colors['fail']
pass_string = 'FAIL'
conf_string = {
Result.CONF_SURE: '',
Result.CONF_GUESS: 'guess',
None: '',
}[confidence]
tab = ' ' if indent else ''
result_string = ""
# Add the test name and tab if applicable
result_string += '{0: <{1}}'.format(tab + name, widths['TEST_NAME'])
if len(tab + name) > widths['TEST_NAME']:
result_string += name_newline_str
# Add the color formatter if we are outputting color
if use_color:
result_string += result_color
# Add the result string
result_string += '{0: <{1}}'.format(pass_string, widths['TEST_RESULT'])
# If we're outputting color, terminate the color string
if use_color:
result_string += term_colors['end']
# Add the confidence string
result_string += '{0: <{1}}'.format(conf_string,
widths['TEST_CONFIDENCE'])
# Add any notes
if notes:
result_string += notes
return result_string
def _check_display_result(result, display_mode):
"""Based on the display mode and the result, determine if a result should
be shown.
:param result: The test result
:param display_mode: The display mode
:returns: True/False indicating whether the result should be shown
"""
# if we're displaying everything, display
if display_mode == ResultDisplayType.DISPLAY_ALL:
return True
# if we're displaying anything which failed and this failed
elif(result == Result.FAIL and display_mode >=
ResultDisplayType.DISPLAY_FAIL_ONLY):
return True
# if we're displaying anything which isn't pass, and this is skip or fail
elif(result == Result.SKIP and display_mode >=
ResultDisplayType.DISPLAY_NOT_PASS):
return True
else:
return False
def _create_html_result_row(result, do_indent):
"""Create the HTML string for a row in the results table
:param result: The test result
:return: HTML string for the row
"""
INDENT_CLASS = "result_indent"
# if we're indenting, set the class style to the indent style
indent_class = " class=" + INDENT_CLASS if do_indent else ""
result_class = " class=" + _result_to_class(result['result'].result)
row_string = ""
row_string += " <tr{}>\n".format(result_class)
row_string += " <td{}>{}</td>\n".format(
indent_class, cgi.escape(result['name']))
row_string += " <td{}>{}</td>\n".format(
result_class, _result_text(result['result'].result))
row_string += " <td>{}</td>\n".format(
cgi.escape(result['result'].notes or ""))
row_string += " </tr>\n"
return row_string
def _create_html_group_row(result):
"""Create the HTML string for a group row in the results table
:param result: The test result
:return: HTML string for the row
"""
result_class = " class=" + _result_to_class(result['result'].result)
row_string = ""
row_string += " <tr{}>\n".format(result_class)
row_string += " <td>{}</td>\n".format(cgi.escape(result['name']))
row_string += " <td{}>{}</td>\n".format(
result_class, _result_text(result['result'].result))
row_string += " <td></td>\n"
row_string += " </tr>\n"
return row_string
| [
2,
15069,
1584,
30446,
15503,
6400,
446,
14973,
7712,
18470,
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,
198,
6738,
764,
6404,
1362,
1330,
49706,
198,
6738,
764,
1330,
4566,
198,
6738,
764,
1330,
38491,
198,
198,
11748,
269,
12397,
198,
11748,
269,
21370,
198,
11748,
33918,
198,
11748,
850,
14681,
198,
198,
37811,
198,
14945,
6097,
389,
5447,
287,
428,
8265,
25,
198,
198,
23004,
25,
198,
220,
220,
220,
770,
318,
973,
329,
4634,
257,
35644,
1988,
286,
262,
8055,
286,
257,
1332,
13,
628,
220,
220,
220,
770,
1398,
318,
6209,
281,
12964,
5883,
543,
3578,
31744,
3815,
329,
1332,
198,
220,
220,
220,
2482,
13,
628,
198,
23004,
23114,
6030,
25,
198,
220,
220,
220,
770,
318,
973,
329,
4634,
703,
257,
1332,
338,
2482,
815,
307,
5072,
13,
220,
1114,
198,
220,
220,
220,
1672,
287,
749,
2663,
340,
338,
2192,
3734,
284,
691,
905,
691,
5254,
543,
198,
220,
220,
220,
2038,
13,
220,
554,
617,
2663,
996,
11,
345,
1183,
765,
284,
766,
543,
5254,
547,
26684,
198,
220,
220,
220,
290,
1521,
13,
628,
220,
220,
220,
770,
1398,
318,
6209,
281,
12964,
5883,
543,
3578,
517,
16576,
31744,
3815,
198,
220,
220,
220,
329,
428,
3038,
13,
628,
198,
14402,
25468,
25,
198,
220,
220,
220,
1052,
4554,
286,
428,
1398,
318,
4504,
355,
262,
1255,
286,
257,
1057,
286,
257,
1332,
900,
13,
628,
220,
220,
220,
6208,
25468,
318,
257,
1351,
286,
1332,
1057,
48589,
3166,
11,
1123,
4909,
25,
198,
220,
220,
220,
532,
1438,
25,
257,
35644,
1438,
286,
262,
1332,
198,
220,
220,
220,
532,
1255,
25,
2035,
257,
6208,
23004,
393,
4912,
14402,
23004,
4554,
628,
220,
220,
220,
4874,
428,
1398,
468,
587,
9113,
12931,
340,
460,
307,
973,
284,
3359,
262,
2482,
198,
220,
220,
220,
319,
262,
3141,
1627,
393,
5072,
3136,
13,
628,
198,
14402,
23004,
25,
198,
220,
220,
220,
770,
1398,
6870,
281,
1981,
1332,
1255,
13,
632,
4909,
734,
3815,
25,
628,
220,
220,
220,
1255,
532,
770,
318,
281,
2378,
286,
2099,
25414,
543,
9217,
262,
1208,
3722,
286,
198,
220,
220,
220,
220,
220,
220,
220,
262,
1332,
326,
4966,
198,
220,
220,
220,
6628,
532,
1423,
16856,
703,
1728,
8195,
318,
546,
428,
1255,
13,
2773,
5254,
198,
220,
220,
220,
220,
220,
220,
220,
460,
691,
787,
257,
922,
4724,
13,
198,
220,
220,
220,
4710,
532,
770,
318,
281,
11902,
2420,
4731,
2214,
543,
8477,
597,
10252,
198,
220,
220,
220,
220,
220,
220,
220,
326,
262,
1332,
2087,
13,
770,
318,
6032,
973,
284,
7603,
3840,
1521,
257,
198,
220,
220,
220,
220,
220,
220,
220,
1332,
4054,
393,
373,
26684,
13,
628,
198,
13247,
14402,
23004,
25,
198,
220,
220,
220,
2773,
3858,
286,
5254,
1332,
262,
976,
1517,
7830,
13,
11317,
621,
1351,
1123,
198,
220,
220,
220,
355,
257,
4553,
1332,
484,
460,
307,
5447,
355,
257,
4912,
14402,
543,
5860,
2482,
198,
220,
220,
220,
355,
257,
4912,
14402,
23004,
13,
317,
4912,
14402,
23004,
318,
257,
1351,
286,
1981,
5254,
543,
198,
220,
220,
220,
547,
1057,
355,
636,
286,
262,
1448,
13,
1114,
1123,
850,
12,
9288,
262,
1708,
318,
8574,
25,
628,
220,
220,
220,
532,
1438,
25,
257,
35644,
1438,
286,
262,
1332,
198,
220,
220,
220,
532,
1255,
25,
257,
6208,
23004,
4554,
198,
198,
37811,
628,
628,
628,
198,
198,
4299,
4808,
11249,
62,
20274,
62,
8841,
7,
3672,
11,
1255,
11,
6628,
11,
4710,
11,
779,
62,
8043,
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,
3381,
62,
4033,
669,
11,
33793,
11,
9647,
82,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
37693,
10361,
2163,
284,
1382,
257,
1255,
4731,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
1438,
25,
6530,
286,
1332,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
1255,
25,
2039,
388,
12739,
262,
3722,
286,
262,
1332,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
6628,
25,
2039,
388,
12739,
262,
6628,
286,
262,
1332,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
4710,
25,
10575,
351,
262,
1332,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
779,
62,
8043,
25,
41146,
12739,
1771,
3124,
815,
307,
9066,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
33793,
25,
41146,
12739,
611,
1332,
1438,
815,
307,
773,
4714,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
9647,
82,
25,
360,
713,
351,
2214,
9647,
82,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
82,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
1438,
62,
3605,
1370,
62,
2536,
796,
705,
59,
77,
6,
1343,
705,
705,
1635,
9647,
82,
17816,
51,
6465,
62,
20608,
20520,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
5345,
262,
5072,
3124,
290,
2420,
1255,
1912,
319,
1332,
1255,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
62,
8043,
796,
13538,
198,
220,
220,
220,
220,
220,
220,
220,
1208,
62,
8841,
796,
13538,
628,
220,
220,
220,
220,
220,
220,
220,
611,
1255,
6624,
25414,
13,
47924,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
62,
8043,
796,
3381,
62,
4033,
669,
17816,
6603,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1208,
62,
8841,
796,
705,
47924,
6,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
1255,
6624,
25414,
13,
18831,
4061,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
62,
8043,
796,
3381,
62,
4033,
669,
17816,
48267,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1208,
62,
8841,
796,
705,
18831,
4061,
6,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
1255,
6624,
25414,
13,
7708,
4146,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
62,
8043,
796,
3381,
62,
4033,
669,
17816,
32165,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1208,
62,
8841,
796,
705,
7708,
4146,
6,
628,
220,
220,
220,
220,
220,
220,
220,
1013,
62,
8841,
796,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25414,
13,
10943,
37,
62,
50,
11335,
25,
705,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25414,
13,
10943,
37,
62,
38022,
7597,
25,
705,
5162,
408,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6045,
25,
705,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1782,
58,
39745,
60,
628,
220,
220,
220,
220,
220,
220,
220,
7400,
796,
705,
220,
220,
220,
220,
705,
611,
33793,
2073,
10148,
628,
220,
220,
220,
220,
220,
220,
220,
1255,
62,
8841,
796,
13538,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
3060,
262,
1332,
1438,
290,
7400,
611,
9723,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
62,
8841,
15853,
705,
90,
15,
25,
1279,
90,
16,
11709,
4458,
18982,
7,
8658,
1343,
1438,
11,
9647,
82,
17816,
51,
6465,
62,
20608,
6,
12962,
628,
220,
220,
220,
220,
220,
220,
220,
611,
18896,
7,
8658,
1343,
1438,
8,
1875,
9647,
82,
17816,
51,
6465,
62,
20608,
6,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
62,
8841,
15853,
1438,
62,
3605,
1370,
62,
2536,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
3060,
262,
3124,
1296,
1436,
611,
356,
389,
5072,
889,
3124,
198,
220,
220,
220,
220,
220,
220,
220,
611,
779,
62,
8043,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
62,
8841,
15853,
1255,
62,
8043,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
3060,
262,
1255,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
62,
8841,
15853,
705,
90,
15,
25,
1279,
90,
16,
11709,
4458,
18982,
7,
6603,
62,
8841,
11,
9647,
82,
17816,
51,
6465,
62,
19535,
16724,
6,
12962,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
1002,
356,
821,
5072,
889,
3124,
11,
23654,
262,
3124,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
611,
779,
62,
8043,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
62,
8841,
15853,
3381,
62,
4033,
669,
17816,
437,
20520,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
3060,
262,
6628,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
62,
8841,
15853,
705,
90,
15,
25,
1279,
90,
16,
11709,
4458,
18982,
7,
10414,
62,
8841,
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,
9647,
82,
17816,
51,
6465,
62,
10943,
37,
2389,
18310,
6,
12962,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
3060,
597,
4710,
198,
220,
220,
220,
220,
220,
220,
220,
611,
4710,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
62,
8841,
15853,
4710,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
1255,
62,
8841,
628,
198,
4299,
4808,
9122,
62,
13812,
62,
20274,
7,
20274,
11,
3359,
62,
14171,
2599,
198,
220,
220,
220,
37227,
15001,
319,
262,
3359,
4235,
290,
262,
1255,
11,
5004,
611,
257,
1255,
815,
198,
220,
220,
220,
307,
3402,
13,
628,
220,
220,
220,
1058,
17143,
1255,
25,
383,
1332,
1255,
198,
220,
220,
220,
1058,
17143,
3359,
62,
14171,
25,
383,
3359,
4235,
198,
220,
220,
220,
1058,
7783,
82,
25,
6407,
14,
25101,
12739,
1771,
262,
1255,
815,
307,
3402,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
1303,
611,
356,
821,
19407,
2279,
11,
3359,
198,
220,
220,
220,
611,
3359,
62,
14171,
6624,
25414,
23114,
6030,
13,
26288,
31519,
62,
7036,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
6407,
628,
220,
220,
220,
1303,
611,
356,
821,
19407,
1997,
543,
4054,
290,
428,
4054,
198,
220,
220,
220,
1288,
361,
7,
20274,
6624,
25414,
13,
7708,
4146,
290,
3359,
62,
14171,
18189,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25414,
23114,
6030,
13,
26288,
31519,
62,
7708,
4146,
62,
1340,
11319,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
6407,
628,
220,
220,
220,
1303,
611,
356,
821,
19407,
1997,
543,
2125,
470,
1208,
11,
290,
428,
318,
14267,
393,
2038,
198,
220,
220,
220,
1288,
361,
7,
20274,
6624,
25414,
13,
18831,
4061,
290,
3359,
62,
14171,
18189,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25414,
23114,
6030,
13,
26288,
31519,
62,
11929,
62,
47924,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
6407,
628,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
628,
198,
4299,
4808,
17953,
62,
6494,
62,
20274,
62,
808,
7,
20274,
11,
466,
62,
521,
298,
2599,
198,
220,
220,
220,
37227,
16447,
262,
11532,
4731,
329,
257,
5752,
287,
262,
2482,
3084,
628,
220,
220,
220,
1058,
17143,
1255,
25,
383,
1332,
1255,
198,
220,
220,
220,
1058,
7783,
25,
11532,
4731,
329,
262,
5752,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
24413,
3525,
62,
31631,
796,
366,
20274,
62,
521,
298,
1,
628,
220,
220,
220,
1303,
611,
356,
821,
33793,
278,
11,
900,
262,
1398,
3918,
284,
262,
33793,
3918,
198,
220,
220,
220,
33793,
62,
4871,
796,
366,
1398,
2625,
1343,
24413,
3525,
62,
31631,
611,
466,
62,
521,
298,
2073,
13538,
628,
220,
220,
220,
1255,
62,
4871,
796,
366,
1398,
2625,
1343,
4808,
20274,
62,
1462,
62,
4871,
7,
20274,
17816,
20274,
6,
4083,
20274,
8,
628,
220,
220,
220,
5752,
62,
8841,
796,
13538,
198,
220,
220,
220,
5752,
62,
8841,
15853,
366,
220,
1279,
2213,
90,
92,
29,
59,
77,
1911,
18982,
7,
20274,
62,
4871,
8,
198,
220,
220,
220,
5752,
62,
8841,
15853,
366,
220,
220,
220,
1279,
8671,
90,
92,
29,
90,
92,
3556,
8671,
29,
59,
77,
1911,
18982,
7,
198,
220,
220,
220,
220,
220,
220,
220,
33793,
62,
4871,
11,
269,
12397,
13,
41915,
7,
20274,
17816,
3672,
20520,
4008,
198,
220,
220,
220,
5752,
62,
8841,
15853,
366,
220,
220,
220,
1279,
8671,
90,
92,
29,
90,
92,
3556,
8671,
29,
59,
77,
1911,
18982,
7,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
62,
4871,
11,
4808,
20274,
62,
5239,
7,
20274,
17816,
20274,
6,
4083,
20274,
4008,
198,
220,
220,
220,
5752,
62,
8841,
15853,
366,
220,
220,
220,
1279,
8671,
29,
90,
92,
3556,
8671,
29,
59,
77,
1911,
18982,
7,
198,
220,
220,
220,
220,
220,
220,
220,
269,
12397,
13,
41915,
7,
20274,
17816,
20274,
6,
4083,
17815,
393,
13538,
4008,
198,
220,
220,
220,
5752,
62,
8841,
15853,
366,
220,
7359,
2213,
29,
59,
77,
1,
628,
220,
220,
220,
1441,
5752,
62,
8841,
628,
198,
4299,
4808,
17953,
62,
6494,
62,
8094,
62,
808,
7,
20274,
2599,
198,
220,
220,
220,
37227,
16447,
262,
11532,
4731,
329,
257,
1448,
5752,
287,
262,
2482,
3084,
628,
220,
220,
220,
1058,
17143,
1255,
25,
383,
1332,
1255,
198,
220,
220,
220,
1058,
7783,
25,
11532,
4731,
329,
262,
5752,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
1255,
62,
4871,
796,
366,
1398,
2625,
1343,
4808,
20274,
62,
1462,
62,
4871,
7,
20274,
17816,
20274,
6,
4083,
20274,
8,
628,
220,
220,
220,
5752,
62,
8841,
796,
13538,
198,
220,
220,
220,
5752,
62,
8841,
15853,
366,
220,
1279,
2213,
90,
92,
29,
59,
77,
1911,
18982,
7,
20274,
62,
4871,
8,
198,
220,
220,
220,
5752,
62,
8841,
15853,
366,
220,
220,
220,
1279,
8671,
29,
90,
92,
3556,
8671,
29,
59,
77,
1911,
18982,
7,
37157,
13,
41915,
7,
20274,
17816,
3672,
20520,
4008,
198,
220,
220,
220,
5752,
62,
8841,
15853,
366,
220,
220,
220,
1279,
8671,
90,
92,
29,
90,
92,
3556,
8671,
29,
59,
77,
1911,
18982,
7,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
62,
4871,
11,
4808,
20274,
62,
5239,
7,
20274,
17816,
20274,
6,
4083,
20274,
4008,
198,
220,
220,
220,
5752,
62,
8841,
15853,
366,
220,
220,
220,
1279,
8671,
12240,
8671,
29,
59,
77,
1,
198,
220,
220,
220,
5752,
62,
8841,
15853,
366,
220,
7359,
2213,
29,
59,
77,
1,
628,
220,
220,
220,
1441,
5752,
62,
8841,
628,
628,
628
] | 2.767424 | 2,597 |
import os
import pytest
from barbell2.dicomexplorer.dicomexplorer import DicomExplorer
COHORT_DIR = '/Volumes/USB_SECURE1/data/radiomics/projects/deepseg/data/mega/processed/NEWEPOC'
COHORT_DCM_FILE = '/Volumes/USB_SECURE1/data/radiomics/projects/deepseg/data/mega/processed/NEWEPOC/003001_pre_PV_L3.dcm'
COHORT_TAG_FILE = '/Volumes/USB_SECURE1/data/radiomics/projects/deepseg/data/mega/processed/NEWEPOC/003001_pre_PV_L3.tag'
COHORT_DCM_HEADER_NR_ENTRIES = 86
COHORT_NR_FILES = 156
DICOM_DICT_NR_ENTRIES = 4253
PATIENT_ID_NR_ENTRIES = 6
@pytest.fixture
| [
11748,
28686,
198,
11748,
12972,
9288,
198,
198,
6738,
2318,
7923,
17,
13,
67,
291,
462,
87,
489,
11934,
13,
67,
291,
462,
87,
489,
11934,
1330,
360,
291,
296,
18438,
11934,
628,
198,
8220,
39,
9863,
62,
34720,
796,
31051,
16598,
8139,
14,
27155,
62,
23683,
11335,
16,
14,
7890,
14,
6335,
29005,
873,
14,
42068,
14,
22089,
325,
70,
14,
7890,
14,
13731,
14,
14681,
276,
14,
13965,
8905,
4503,
6,
198,
8220,
39,
9863,
62,
9697,
44,
62,
25664,
796,
31051,
16598,
8139,
14,
27155,
62,
23683,
11335,
16,
14,
7890,
14,
6335,
29005,
873,
14,
42068,
14,
22089,
325,
70,
14,
7890,
14,
13731,
14,
14681,
276,
14,
13965,
8905,
4503,
14,
405,
6200,
16,
62,
3866,
62,
47,
53,
62,
43,
18,
13,
67,
11215,
6,
198,
8220,
39,
9863,
62,
42197,
62,
25664,
796,
31051,
16598,
8139,
14,
27155,
62,
23683,
11335,
16,
14,
7890,
14,
6335,
29005,
873,
14,
42068,
14,
22089,
325,
70,
14,
7890,
14,
13731,
14,
14681,
276,
14,
13965,
8905,
4503,
14,
405,
6200,
16,
62,
3866,
62,
47,
53,
62,
43,
18,
13,
12985,
6,
198,
8220,
39,
9863,
62,
9697,
44,
62,
37682,
1137,
62,
24723,
62,
3525,
7112,
1546,
796,
9849,
198,
8220,
39,
9863,
62,
24723,
62,
46700,
1546,
796,
23871,
198,
35,
2149,
2662,
62,
35,
18379,
62,
24723,
62,
3525,
7112,
1546,
796,
604,
28592,
198,
47,
1404,
28495,
62,
2389,
62,
24723,
62,
3525,
7112,
1546,
796,
718,
628,
198,
31,
9078,
9288,
13,
69,
9602,
628,
628,
628,
628
] | 2.193798 | 258 |
# Copyright 2020, Kay Hayen, mailto:[email protected]
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# 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.
#
""" Low level constant code generation.
This deals with constants, there creation, there access, and some checks about
them. Even mutable constants should not change during the course of the
program.
There are shared constants, which are created for multiple modules to use, you
can think of them as globals. And there are module local constants, which are
for a single module only.
"""
import ctypes
import marshal
import os
import sys
from nuitka import Options
from nuitka.__past__ import ( # pylint: disable=I0021,redefined-builtin
iterItems,
xrange,
)
from nuitka.Constants import compareConstants, getConstantWeight, isMutable
from nuitka.constants.Serialization import ConstantAccessor
from nuitka.PythonVersions import python_version
from nuitka.Tracing import codegen_missing
from nuitka.Version import getNuitkaVersion
from .ErrorCodes import getReleaseCode
from .GlobalConstants import getConstantDefaultPopulation
from .Namify import namifyConstant
from .templates.CodeTemplatesConstants import template_constants_reading
from .templates.CodeTemplatesModules import template_header_guard
def generateConstantReferenceCode(to_name, expression, emit, context):
""" Assign the constant behind the expression to to_name."""
getConstantAccess(
to_name=to_name,
constant=expression.getCompileTimeConstant(),
emit=emit,
context=context,
)
def generateConstantNoneReferenceCode(to_name, expression, emit, context):
""" Assign 'None' to to_name."""
# No context or other knowledge needed, pylint: disable=unused-argument
if to_name.c_type == "nuitka_bool":
emit("%s = NUITKA_BOOL_FALSE;" % to_name)
else:
emit("%s = Py_None;" % to_name)
def generateConstantTrueReferenceCode(to_name, expression, emit, context):
""" Assign 'True' to to_name."""
# No context or other knowledge needed, pylint: disable=unused-argument
if to_name.c_type == "nuitka_bool":
emit("%s = NUITKA_BOOL_TRUE;" % to_name)
else:
emit("%s = Py_True;" % to_name)
def generateConstantFalseReferenceCode(to_name, expression, emit, context):
""" Assign 'False' to to_name."""
# No context or other knowledge needed, pylint: disable=unused-argument
if to_name.c_type == "nuitka_bool":
emit("%s = NUITKA_BOOL_FALSE;" % to_name)
else:
emit("%s = Py_False;" % to_name)
def generateConstantEllipsisReferenceCode(to_name, expression, emit, context):
""" Assign 'Ellipsis' to to_name."""
# No context or other knowledge needed, pylint: disable=unused-argument
if to_name.c_type == "nuitka_bool":
emit("%s = NUITKA_BOOL_FALSE;" % to_name)
else:
emit("%s = Py_Ellipsis;" % to_name)
sizeof_long = ctypes.sizeof(ctypes.c_long)
max_unsigned_long = 2 ** (sizeof_long * 8) - 1
# The gcc gives a warning for -2**sizeof_long*8-1, which is still an "int", but
# seems to not work (without warning) as literal, so avoid it.
min_signed_long = -(2 ** (sizeof_long * 8 - 1) - 1)
done = set()
def decideMarshal(constant_value):
"""Decide of a constant can be created using "marshal" module methods.
This is not the case for everything. A prominent exception is types,
they are constants, but the "marshal" module refuses to work with
them.
"""
# Many cases to deal with, pylint: disable=too-many-return-statements
constant_type = type(constant_value)
if constant_type is type:
# Types cannot be marshaled, there is no choice about it.
return False
elif constant_type is dict:
# Look at all the keys an values, if one of it cannot be marshaled,
# or should not, that is it.
for key, value in iterItems(constant_value):
if not decideMarshal(key):
return False
if not decideMarshal(value):
return False
elif constant_type in (tuple, list, set, frozenset):
for element_value in constant_value:
if not decideMarshal(element_value):
return False
elif constant_type is xrange:
return False
elif constant_type is slice:
return False
return True
def isMarshalConstant(constant_value):
"""Decide if we want to use marshal to create a constant.
The reason we do this, is because creating dictionaries with 700
elements creates a lot of C code, while gaining usually no performance
at all. The MSVC compiler is especially notorious about hanging like
forever with this active, due to its optimizer not scaling.
Therefore we use a constant "weight" (how expensive it is), and apply
that to decide.
If marshal is not possible, or constant "weight" is too large, we
don't do it. Also, for some constants, marshal can fail, and return
other values. Check that too. In that case, we have to create it.
"""
if not decideMarshal(constant_value):
return False
if getConstantWeight(constant_value) < 20:
return False
try:
marshal_value = marshal.dumps(constant_value)
except ValueError:
if Options.is_debug:
codegen_missing.warning("Failed to marshal constant %r." % constant_value)
return False
restored = marshal.loads(marshal_value)
r = compareConstants(constant_value, restored)
if not r:
pass
# TODO: Potentially warn about these, where that is not the case.
return r
def getConstantsDefinitionCode():
"""Create the code code "__constants.c" and "__constants.h" files.
This needs to create code to make all global constants (used in more
than one module) and create them.
"""
constant_accessor = ConstantAccessor(
data_filename="__constants.const", top_level_name="global_constants"
)
lines = []
for constant_value in getConstantDefaultPopulation():
identifier = constant_accessor.getConstantCode(constant_value)
assert "[" in identifier, (identifier, constant_value)
lines.append("// %s" % repr(constant_value))
lines.append(
"#define const_%s %s" % (namifyConstant(constant_value), identifier)
)
sys_executable = None
if not Options.shallMakeModule():
if Options.isStandaloneMode():
# The directory is added back at run time.
sys_executable = constant_accessor.getConstantCode(
os.path.basename(sys.executable)
)
else:
sys_executable = constant_accessor.getConstantCode(sys.executable)
sys_prefix = None
sys_base_prefix = None
sys_exec_prefix = None
sys_base_exec_prefix = None
# TODO: This part is needed for main program only, so do it there?
if not Options.shallMakeModule() and not Options.isStandaloneMode():
sys_prefix = constant_accessor.getConstantCode(sys.prefix)
sys_exec_prefix = constant_accessor.getConstantCode(sys.exec_prefix)
if python_version >= 0x300:
sys_base_prefix = constant_accessor.getConstantCode(sys.base_prefix)
sys_base_exec_prefix = constant_accessor.getConstantCode(
sys.base_exec_prefix
)
lines.insert(
0,
"extern PyObject *global_constants[%d];"
% constant_accessor.getConstantsCount(),
)
header = template_header_guard % {
"header_guard_name": "__NUITKA_GLOBAL_CONSTANTS_H__",
"header_body": "\n".join(lines),
}
major, minor, micro = getNuitkaVersion().split(".")[:3]
if "rc" in micro:
micro = micro[: micro.find("rc")]
level = "candidate"
else:
level = "release"
body = template_constants_reading % {
"global_constants_count": constant_accessor.getConstantsCount(),
"sys_executable": sys_executable,
"sys_prefix": sys_prefix,
"sys_base_prefix": sys_base_prefix,
"sys_exec_prefix": sys_exec_prefix,
"sys_base_exec_prefix": sys_base_exec_prefix,
"nuitka_version_major": major,
"nuitka_version_minor": minor,
"nuitka_version_micro": micro,
"nuitka_version_level": level,
}
return header, body
| [
2,
220,
220,
220,
220,
15069,
12131,
11,
17356,
9075,
268,
11,
6920,
1462,
25,
5568,
13,
71,
323,
268,
31,
14816,
13,
785,
198,
2,
198,
2,
220,
220,
220,
220,
2142,
286,
366,
45,
5013,
4914,
1600,
281,
45780,
11361,
17050,
326,
318,
11670,
290,
198,
2,
220,
220,
220,
220,
48105,
351,
16932,
7535,
11,
475,
635,
2499,
319,
663,
898,
13,
198,
2,
198,
2,
220,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
220,
220,
220,
220,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
220,
220,
220,
220,
921,
743,
7330,
257,
4866,
286,
262,
13789,
379,
198,
2,
198,
2,
220,
220,
220,
220,
220,
220,
220,
2638,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
43,
2149,
24290,
12,
17,
13,
15,
198,
2,
198,
2,
220,
220,
220,
220,
17486,
2672,
416,
9723,
1099,
393,
4987,
284,
287,
3597,
11,
3788,
198,
2,
220,
220,
220,
220,
9387,
739,
262,
13789,
318,
9387,
319,
281,
366,
1921,
3180,
1,
29809,
1797,
11,
198,
2,
220,
220,
220,
220,
42881,
34764,
11015,
6375,
7102,
49828,
11053,
3963,
15529,
509,
12115,
11,
2035,
4911,
393,
17142,
13,
198,
2,
220,
220,
220,
220,
4091,
262,
13789,
329,
262,
2176,
3303,
15030,
21627,
290,
198,
2,
220,
220,
220,
220,
11247,
739,
262,
13789,
13,
198,
2,
198,
37811,
7754,
1241,
6937,
2438,
5270,
13,
198,
198,
1212,
7529,
351,
38491,
11,
612,
6282,
11,
612,
1895,
11,
290,
617,
8794,
546,
198,
18855,
13,
3412,
4517,
540,
38491,
815,
407,
1487,
1141,
262,
1781,
286,
262,
198,
23065,
13,
198,
198,
1858,
389,
4888,
38491,
11,
543,
389,
2727,
329,
3294,
13103,
284,
779,
11,
345,
198,
5171,
892,
286,
606,
355,
15095,
874,
13,
843,
612,
389,
8265,
1957,
38491,
11,
543,
389,
198,
1640,
257,
2060,
8265,
691,
13,
198,
198,
37811,
198,
198,
11748,
269,
19199,
198,
11748,
22397,
282,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
6738,
299,
5013,
4914,
1330,
18634,
198,
6738,
299,
5013,
4914,
13,
834,
30119,
834,
1330,
357,
220,
1303,
279,
2645,
600,
25,
15560,
28,
40,
405,
2481,
11,
445,
18156,
12,
18780,
259,
198,
220,
220,
220,
11629,
23022,
11,
198,
220,
220,
220,
2124,
9521,
11,
198,
8,
198,
6738,
299,
5013,
4914,
13,
34184,
1187,
1330,
8996,
34184,
1187,
11,
651,
3103,
18797,
25844,
11,
318,
44,
18187,
198,
6738,
299,
5013,
4914,
13,
9979,
1187,
13,
32634,
1634,
1330,
20217,
15457,
273,
198,
6738,
299,
5013,
4914,
13,
37906,
45150,
1330,
21015,
62,
9641,
198,
6738,
299,
5013,
4914,
13,
2898,
4092,
1330,
2438,
5235,
62,
45688,
198,
6738,
299,
5013,
4914,
13,
14815,
1330,
651,
45,
5013,
4914,
14815,
198,
198,
6738,
764,
12331,
34,
4147,
1330,
651,
26362,
10669,
198,
6738,
764,
22289,
34184,
1187,
1330,
651,
3103,
18797,
19463,
45251,
198,
6738,
764,
45,
321,
1958,
1330,
299,
321,
1958,
3103,
18797,
198,
6738,
764,
11498,
17041,
13,
10669,
12966,
17041,
34184,
1187,
1330,
11055,
62,
9979,
1187,
62,
25782,
198,
6738,
764,
11498,
17041,
13,
10669,
12966,
17041,
5841,
5028,
1330,
11055,
62,
25677,
62,
14864,
628,
198,
4299,
7716,
3103,
18797,
26687,
10669,
7,
1462,
62,
3672,
11,
5408,
11,
27588,
11,
4732,
2599,
198,
220,
220,
220,
37227,
2195,
570,
262,
6937,
2157,
262,
5408,
284,
284,
62,
3672,
526,
15931,
628,
220,
220,
220,
651,
3103,
18797,
15457,
7,
198,
220,
220,
220,
220,
220,
220,
220,
284,
62,
3672,
28,
1462,
62,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
6937,
28,
38011,
13,
1136,
7293,
576,
7575,
3103,
18797,
22784,
198,
220,
220,
220,
220,
220,
220,
220,
27588,
28,
368,
270,
11,
198,
220,
220,
220,
220,
220,
220,
220,
4732,
28,
22866,
11,
198,
220,
220,
220,
1267,
628,
198,
4299,
7716,
3103,
18797,
14202,
26687,
10669,
7,
1462,
62,
3672,
11,
5408,
11,
27588,
11,
4732,
2599,
198,
220,
220,
220,
37227,
2195,
570,
705,
14202,
6,
284,
284,
62,
3672,
526,
15931,
628,
220,
220,
220,
1303,
1400,
4732,
393,
584,
3725,
2622,
11,
279,
2645,
600,
25,
15560,
28,
403,
1484,
12,
49140,
628,
220,
220,
220,
611,
284,
62,
3672,
13,
66,
62,
4906,
6624,
366,
77,
5013,
4914,
62,
30388,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
27588,
7203,
4,
82,
796,
399,
52,
2043,
25123,
62,
8202,
3535,
62,
37,
23719,
26033,
4064,
284,
62,
3672,
8,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
27588,
7203,
4,
82,
796,
9485,
62,
14202,
26033,
4064,
284,
62,
3672,
8,
628,
198,
4299,
7716,
3103,
18797,
17821,
26687,
10669,
7,
1462,
62,
3672,
11,
5408,
11,
27588,
11,
4732,
2599,
198,
220,
220,
220,
37227,
2195,
570,
705,
17821,
6,
284,
284,
62,
3672,
526,
15931,
628,
220,
220,
220,
1303,
1400,
4732,
393,
584,
3725,
2622,
11,
279,
2645,
600,
25,
15560,
28,
403,
1484,
12,
49140,
628,
220,
220,
220,
611,
284,
62,
3672,
13,
66,
62,
4906,
6624,
366,
77,
5013,
4914,
62,
30388,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
27588,
7203,
4,
82,
796,
399,
52,
2043,
25123,
62,
8202,
3535,
62,
5446,
8924,
26033,
4064,
284,
62,
3672,
8,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
27588,
7203,
4,
82,
796,
9485,
62,
17821,
26033,
4064,
284,
62,
3672,
8,
628,
198,
4299,
7716,
3103,
18797,
25101,
26687,
10669,
7,
1462,
62,
3672,
11,
5408,
11,
27588,
11,
4732,
2599,
198,
220,
220,
220,
37227,
2195,
570,
705,
25101,
6,
284,
284,
62,
3672,
526,
15931,
628,
220,
220,
220,
1303,
1400,
4732,
393,
584,
3725,
2622,
11,
279,
2645,
600,
25,
15560,
28,
403,
1484,
12,
49140,
628,
220,
220,
220,
611,
284,
62,
3672,
13,
66,
62,
4906,
6624,
366,
77,
5013,
4914,
62,
30388,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
27588,
7203,
4,
82,
796,
399,
52,
2043,
25123,
62,
8202,
3535,
62,
37,
23719,
26033,
4064,
284,
62,
3672,
8,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
27588,
7203,
4,
82,
796,
9485,
62,
25101,
26033,
4064,
284,
62,
3672,
8,
628,
198,
4299,
7716,
3103,
18797,
30639,
2419,
271,
26687,
10669,
7,
1462,
62,
3672,
11,
5408,
11,
27588,
11,
4732,
2599,
198,
220,
220,
220,
37227,
2195,
570,
705,
30639,
2419,
271,
6,
284,
284,
62,
3672,
526,
15931,
628,
220,
220,
220,
1303,
1400,
4732,
393,
584,
3725,
2622,
11,
279,
2645,
600,
25,
15560,
28,
403,
1484,
12,
49140,
628,
220,
220,
220,
611,
284,
62,
3672,
13,
66,
62,
4906,
6624,
366,
77,
5013,
4914,
62,
30388,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
27588,
7203,
4,
82,
796,
399,
52,
2043,
25123,
62,
8202,
3535,
62,
37,
23719,
26033,
4064,
284,
62,
3672,
8,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
27588,
7203,
4,
82,
796,
9485,
62,
30639,
2419,
271,
26033,
4064,
284,
62,
3672,
8,
628,
198,
7857,
1659,
62,
6511,
796,
269,
19199,
13,
7857,
1659,
7,
310,
9497,
13,
66,
62,
6511,
8,
198,
198,
9806,
62,
43375,
62,
6511,
796,
362,
12429,
357,
7857,
1659,
62,
6511,
1635,
807,
8,
532,
352,
198,
198,
2,
383,
49582,
3607,
257,
6509,
329,
532,
17,
1174,
7857,
1659,
62,
6511,
9,
23,
12,
16,
11,
543,
318,
991,
281,
366,
600,
1600,
475,
198,
2,
2331,
284,
407,
670,
357,
19419,
6509,
8,
355,
18875,
11,
523,
3368,
340,
13,
198,
1084,
62,
32696,
62,
6511,
796,
532,
7,
17,
12429,
357,
7857,
1659,
62,
6511,
1635,
807,
532,
352,
8,
532,
352,
8,
198,
198,
28060,
796,
900,
3419,
628,
198,
4299,
5409,
41984,
282,
7,
9979,
415,
62,
8367,
2599,
198,
220,
220,
220,
37227,
10707,
485,
286,
257,
6937,
460,
307,
2727,
1262,
366,
76,
5406,
282,
1,
8265,
5050,
13,
628,
220,
220,
220,
770,
318,
407,
262,
1339,
329,
2279,
13,
317,
9208,
6631,
318,
3858,
11,
198,
220,
220,
220,
484,
389,
38491,
11,
475,
262,
366,
76,
5406,
282,
1,
8265,
17567,
284,
670,
351,
198,
220,
220,
220,
606,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
1303,
4650,
2663,
284,
1730,
351,
11,
279,
2645,
600,
25,
15560,
28,
18820,
12,
21834,
12,
7783,
12,
14269,
3196,
628,
220,
220,
220,
6937,
62,
4906,
796,
2099,
7,
9979,
415,
62,
8367,
8,
628,
220,
220,
220,
611,
6937,
62,
4906,
318,
2099,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
24897,
2314,
307,
22397,
3021,
11,
612,
318,
645,
3572,
546,
340,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
198,
220,
220,
220,
1288,
361,
6937,
62,
4906,
318,
8633,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
6803,
379,
477,
262,
8251,
281,
3815,
11,
611,
530,
286,
340,
2314,
307,
22397,
3021,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
393,
815,
407,
11,
326,
318,
340,
13,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1994,
11,
1988,
287,
11629,
23022,
7,
9979,
415,
62,
8367,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
407,
5409,
41984,
282,
7,
2539,
2599,
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,
611,
407,
5409,
41984,
282,
7,
8367,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
198,
220,
220,
220,
1288,
361,
6937,
62,
4906,
287,
357,
83,
29291,
11,
1351,
11,
900,
11,
8400,
8247,
316,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
329,
5002,
62,
8367,
287,
6937,
62,
8367,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
407,
5409,
41984,
282,
7,
30854,
62,
8367,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
198,
220,
220,
220,
1288,
361,
6937,
62,
4906,
318,
2124,
9521,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
198,
220,
220,
220,
1288,
361,
6937,
62,
4906,
318,
16416,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
628,
220,
220,
220,
1441,
6407,
628,
198,
4299,
318,
41984,
282,
3103,
18797,
7,
9979,
415,
62,
8367,
2599,
198,
220,
220,
220,
37227,
10707,
485,
611,
356,
765,
284,
779,
22397,
282,
284,
2251,
257,
6937,
13,
628,
220,
220,
220,
383,
1738,
356,
466,
428,
11,
318,
780,
4441,
48589,
3166,
351,
13037,
198,
220,
220,
220,
4847,
8075,
257,
1256,
286,
327,
2438,
11,
981,
13977,
3221,
645,
2854,
198,
220,
220,
220,
379,
477,
13,
383,
6579,
15922,
17050,
318,
2592,
18192,
546,
10938,
588,
198,
220,
220,
220,
8097,
351,
428,
4075,
11,
2233,
284,
663,
6436,
7509,
407,
20796,
13,
628,
220,
220,
220,
8447,
356,
779,
257,
6937,
366,
6551,
1,
357,
4919,
5789,
340,
318,
828,
290,
4174,
198,
220,
220,
220,
326,
284,
5409,
13,
628,
220,
220,
220,
1002,
22397,
282,
318,
407,
1744,
11,
393,
6937,
366,
6551,
1,
318,
1165,
1588,
11,
356,
198,
220,
220,
220,
836,
470,
466,
340,
13,
4418,
11,
329,
617,
38491,
11,
22397,
282,
460,
2038,
11,
290,
1441,
198,
220,
220,
220,
584,
3815,
13,
6822,
326,
1165,
13,
554,
326,
1339,
11,
356,
423,
284,
2251,
340,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
611,
407,
5409,
41984,
282,
7,
9979,
415,
62,
8367,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
628,
220,
220,
220,
611,
651,
3103,
18797,
25844,
7,
9979,
415,
62,
8367,
8,
1279,
1160,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
628,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
22397,
282,
62,
8367,
796,
22397,
282,
13,
67,
8142,
7,
9979,
415,
62,
8367,
8,
198,
220,
220,
220,
2845,
11052,
12331,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
18634,
13,
271,
62,
24442,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2438,
5235,
62,
45688,
13,
43917,
7203,
37,
6255,
284,
22397,
282,
6937,
4064,
81,
526,
4064,
6937,
62,
8367,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
628,
220,
220,
220,
15032,
796,
22397,
282,
13,
46030,
7,
76,
5406,
282,
62,
8367,
8,
628,
220,
220,
220,
374,
796,
8996,
34184,
1187,
7,
9979,
415,
62,
8367,
11,
15032,
8,
198,
220,
220,
220,
611,
407,
374,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1208,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
16926,
46,
25,
6902,
3746,
9828,
546,
777,
11,
810,
326,
318,
407,
262,
1339,
13,
628,
220,
220,
220,
1441,
374,
628,
198,
198,
4299,
651,
34184,
1187,
36621,
10669,
33529,
198,
220,
220,
220,
37227,
16447,
262,
2438,
2438,
366,
834,
9979,
1187,
13,
66,
1,
290,
366,
834,
9979,
1187,
13,
71,
1,
3696,
13,
628,
220,
220,
220,
770,
2476,
284,
2251,
2438,
284,
787,
477,
3298,
38491,
357,
1484,
287,
517,
198,
220,
220,
220,
621,
530,
8265,
8,
290,
2251,
606,
13,
628,
220,
220,
220,
37227,
198,
220,
220,
220,
6937,
62,
15526,
273,
796,
20217,
15457,
273,
7,
198,
220,
220,
220,
220,
220,
220,
220,
1366,
62,
34345,
2625,
834,
9979,
1187,
13,
9979,
1600,
1353,
62,
5715,
62,
3672,
2625,
20541,
62,
9979,
1187,
1,
198,
220,
220,
220,
1267,
628,
220,
220,
220,
3951,
796,
17635,
628,
220,
220,
220,
329,
6937,
62,
8367,
287,
651,
3103,
18797,
19463,
45251,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
27421,
796,
6937,
62,
15526,
273,
13,
1136,
3103,
18797,
10669,
7,
9979,
415,
62,
8367,
8,
628,
220,
220,
220,
220,
220,
220,
220,
6818,
12878,
1,
287,
27421,
11,
357,
738,
7483,
11,
6937,
62,
8367,
8,
628,
220,
220,
220,
220,
220,
220,
220,
3951,
13,
33295,
7203,
1003,
4064,
82,
1,
4064,
41575,
7,
9979,
415,
62,
8367,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
3951,
13,
33295,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25113,
13086,
1500,
62,
4,
82,
4064,
82,
1,
4064,
357,
7402,
1958,
3103,
18797,
7,
9979,
415,
62,
8367,
828,
27421,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
25064,
62,
18558,
18187,
796,
6045,
628,
220,
220,
220,
611,
407,
18634,
13,
49271,
12050,
26796,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
611,
18634,
13,
271,
1273,
7642,
505,
19076,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
383,
8619,
318,
2087,
736,
379,
1057,
640,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25064,
62,
18558,
18187,
796,
6937,
62,
15526,
273,
13,
1136,
3103,
18797,
10669,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
28686,
13,
6978,
13,
12093,
12453,
7,
17597,
13,
18558,
18187,
8,
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,
25064,
62,
18558,
18187,
796,
6937,
62,
15526,
273,
13,
1136,
3103,
18797,
10669,
7,
17597,
13,
18558,
18187,
8,
628,
220,
220,
220,
25064,
62,
40290,
796,
6045,
198,
220,
220,
220,
25064,
62,
8692,
62,
40290,
796,
6045,
198,
220,
220,
220,
25064,
62,
18558,
62,
40290,
796,
6045,
198,
220,
220,
220,
25064,
62,
8692,
62,
18558,
62,
40290,
796,
6045,
628,
220,
220,
220,
1303,
16926,
46,
25,
770,
636,
318,
2622,
329,
1388,
1430,
691,
11,
523,
466,
340,
612,
30,
198,
220,
220,
220,
611,
407,
18634,
13,
49271,
12050,
26796,
3419,
290,
407,
18634,
13,
271,
1273,
7642,
505,
19076,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
25064,
62,
40290,
796,
6937,
62,
15526,
273,
13,
1136,
3103,
18797,
10669,
7,
17597,
13,
40290,
8,
198,
220,
220,
220,
220,
220,
220,
220,
25064,
62,
18558,
62,
40290,
796,
6937,
62,
15526,
273,
13,
1136,
3103,
18797,
10669,
7,
17597,
13,
18558,
62,
40290,
8,
628,
220,
220,
220,
220,
220,
220,
220,
611,
21015,
62,
9641,
18189,
657,
87,
6200,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25064,
62,
8692,
62,
40290,
796,
6937,
62,
15526,
273,
13,
1136,
3103,
18797,
10669,
7,
17597,
13,
8692,
62,
40290,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25064,
62,
8692,
62,
18558,
62,
40290,
796,
6937,
62,
15526,
273,
13,
1136,
3103,
18797,
10669,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25064,
13,
8692,
62,
18558,
62,
40290,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
3951,
13,
28463,
7,
198,
220,
220,
220,
220,
220,
220,
220,
657,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
1069,
759,
9485,
10267,
1635,
20541,
62,
9979,
1187,
58,
4,
67,
11208,
1,
198,
220,
220,
220,
220,
220,
220,
220,
4064,
6937,
62,
15526,
273,
13,
1136,
34184,
1187,
12332,
22784,
198,
220,
220,
220,
1267,
628,
220,
220,
220,
13639,
796,
11055,
62,
25677,
62,
14864,
4064,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
366,
25677,
62,
14864,
62,
3672,
1298,
366,
834,
45,
52,
2043,
25123,
62,
8763,
9864,
1847,
62,
10943,
2257,
1565,
4694,
62,
39,
834,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
366,
25677,
62,
2618,
1298,
37082,
77,
1911,
22179,
7,
6615,
828,
198,
220,
220,
220,
1782,
628,
220,
220,
220,
1688,
11,
4159,
11,
4580,
796,
651,
45,
5013,
4914,
14815,
22446,
35312,
7203,
19570,
58,
25,
18,
60,
628,
220,
220,
220,
611,
366,
6015,
1,
287,
4580,
25,
198,
220,
220,
220,
220,
220,
220,
220,
4580,
796,
4580,
58,
25,
4580,
13,
19796,
7203,
6015,
4943,
60,
198,
220,
220,
220,
220,
220,
220,
220,
1241,
796,
366,
46188,
20540,
1,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1241,
796,
366,
20979,
1,
628,
220,
220,
220,
1767,
796,
11055,
62,
9979,
1187,
62,
25782,
4064,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
366,
20541,
62,
9979,
1187,
62,
9127,
1298,
6937,
62,
15526,
273,
13,
1136,
34184,
1187,
12332,
22784,
198,
220,
220,
220,
220,
220,
220,
220,
366,
17597,
62,
18558,
18187,
1298,
25064,
62,
18558,
18187,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
17597,
62,
40290,
1298,
25064,
62,
40290,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
17597,
62,
8692,
62,
40290,
1298,
25064,
62,
8692,
62,
40290,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
17597,
62,
18558,
62,
40290,
1298,
25064,
62,
18558,
62,
40290,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
17597,
62,
8692,
62,
18558,
62,
40290,
1298,
25064,
62,
8692,
62,
18558,
62,
40290,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
77,
5013,
4914,
62,
9641,
62,
22478,
1298,
1688,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
77,
5013,
4914,
62,
9641,
62,
1084,
273,
1298,
4159,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
77,
5013,
4914,
62,
9641,
62,
24055,
1298,
4580,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
77,
5013,
4914,
62,
9641,
62,
5715,
1298,
1241,
11,
198,
220,
220,
220,
1782,
628,
220,
220,
220,
1441,
13639,
11,
1767,
198
] | 2.685075 | 3,350 |
from constants.constants import FOLDER_CONFIG_FILE_REPLACE, FILE_NOTION_CONFIG, CONFIG_FOLDER
from config_builder.config_builder import get_file_data
import os
| [
6738,
38491,
13,
9979,
1187,
1330,
376,
3535,
14418,
62,
10943,
16254,
62,
25664,
62,
2200,
6489,
11598,
11,
45811,
62,
11929,
2849,
62,
10943,
16254,
11,
25626,
62,
37,
3535,
14418,
198,
6738,
4566,
62,
38272,
13,
11250,
62,
38272,
1330,
651,
62,
7753,
62,
7890,
198,
11748,
28686,
628
] | 3.156863 | 51 |
import socket
import threading
import socketserver
from Player import Player
from Account import Account
from World import World
import re
from copy import deepcopy
global commands
commands = dict({
"room" : "Exibe a sala atual",
"move <n(north), s(south), e(east), w(weast)>" : "Move o personagem para a direção desejada",
"get_item <nome do item>" : "Pega um item do mapa e coloca no inventário",
"inventory" : "Exibe os itens do inventário",
"npc <nome do npc>" : "Interage com um npc",
"equip <nome do item>" : "Equipa um item do inventário",
"attack <nome do monstro>" : "Inicia uma batalha com um monstro",
"me": "Informações do seu personagem",
"player_info <nome do jogador>": "Informações sobre um jogador online",
"exit" : "Sai do jogo"
})
if __name__ == "__main__":
global server
server = Server("localhost", 9999)
server.start() | [
11748,
17802,
198,
11748,
4704,
278,
198,
11748,
37037,
18497,
198,
6738,
7853,
1330,
7853,
198,
6738,
10781,
1330,
10781,
198,
6738,
2159,
1330,
2159,
198,
11748,
302,
198,
6738,
4866,
1330,
2769,
30073,
198,
20541,
9729,
198,
9503,
1746,
796,
8633,
15090,
198,
220,
220,
220,
366,
3823,
1,
1058,
366,
3109,
32438,
257,
3664,
64,
379,
723,
1600,
198,
220,
220,
220,
366,
21084,
1279,
77,
7,
43588,
828,
264,
7,
35782,
828,
304,
7,
23316,
828,
266,
7,
732,
459,
8,
24618,
1058,
366,
21774,
267,
1048,
363,
368,
31215,
257,
19958,
16175,
28749,
748,
68,
73,
4763,
1600,
198,
220,
220,
220,
366,
1136,
62,
9186,
1279,
77,
462,
466,
2378,
24618,
1058,
366,
47,
26470,
23781,
2378,
466,
3975,
64,
304,
951,
11216,
645,
8067,
6557,
27250,
1600,
198,
220,
220,
220,
366,
24807,
1,
1058,
366,
3109,
32438,
28686,
340,
641,
466,
8067,
6557,
27250,
1600,
198,
220,
220,
220,
366,
77,
14751,
1279,
77,
462,
466,
299,
14751,
24618,
1058,
366,
9492,
496,
401,
23781,
299,
14751,
1600,
198,
220,
220,
220,
366,
4853,
541,
1279,
77,
462,
466,
2378,
24618,
1058,
366,
23588,
541,
64,
23781,
2378,
466,
8067,
6557,
27250,
1600,
198,
220,
220,
220,
366,
20358,
1279,
77,
462,
466,
937,
20661,
24618,
1058,
366,
818,
33577,
334,
2611,
7365,
282,
3099,
401,
23781,
937,
20661,
1600,
198,
220,
220,
220,
366,
1326,
1298,
366,
818,
687,
64,
16175,
127,
113,
274,
466,
384,
84,
1048,
363,
368,
1600,
198,
220,
220,
220,
366,
7829,
62,
10951,
1279,
77,
462,
466,
48342,
7079,
29,
1298,
366,
818,
687,
64,
16175,
127,
113,
274,
523,
4679,
23781,
48342,
7079,
2691,
1600,
198,
220,
220,
220,
366,
37023,
1,
1058,
366,
50,
1872,
466,
474,
24076,
1,
198,
30072,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
3298,
4382,
220,
220,
220,
198,
220,
4382,
796,
9652,
7203,
36750,
1600,
860,
17032,
8,
198,
220,
4382,
13,
9688,
3419
] | 2.675676 | 333 |
import mongoengine
import datetime
import re
import socket
import time
from bson.errors import InvalidStringData
from flask import request
from utilities.flask_tracking import documents
from utilities.flask_tracking.utils import WSGICopyBody
from mongoengine import Document
try:
from flask_login import current_user
except ImportError:
current_user = None
| [
11748,
285,
25162,
18392,
198,
11748,
4818,
8079,
198,
11748,
302,
198,
11748,
17802,
198,
11748,
640,
198,
198,
6738,
275,
1559,
13,
48277,
1330,
17665,
10100,
6601,
198,
6738,
42903,
1330,
2581,
198,
6738,
20081,
13,
2704,
2093,
62,
36280,
1330,
4963,
198,
6738,
20081,
13,
2704,
2093,
62,
36280,
13,
26791,
1330,
25290,
38,
2149,
11081,
25842,
198,
198,
6738,
285,
25162,
18392,
1330,
16854,
198,
198,
28311,
25,
198,
220,
220,
220,
422,
42903,
62,
38235,
1330,
1459,
62,
7220,
198,
16341,
17267,
12331,
25,
198,
220,
220,
220,
1459,
62,
7220,
796,
6045,
198
] | 3.755102 | 98 |
#!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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.
#
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
"""
When an inclusion's optional argument (enclosed in square brackets:
[]) spans multiple lines (via comment wrapping), ensure that the LaTeX
Scanner doesn't throw an IndexError.
An example of this in the wild is in Thomas Heim's epsdice LaTeX package:
\includegraphics[height=1.75ex,viewport= 3 4 38 39,%
clip=true]{\dicefile}%
In epsdice 2007/02/15, v. 2.1.
"""
import TestSCons
_exe = TestSCons._exe
test = TestSCons.TestSCons()
latex = test.where_is('latex')
if not latex:
test.skip_test("Could not find latex; skipping test(s).\n")
test.write('SConstruct', """\
import os
env = Environment(ENV = { 'PATH' : os.environ['PATH'] })
env.DVI('root.tex')
""")
test.write('root.tex',
r"""\documentclass{article}
\usepackage{graphicx}
\begin{document}
\includegraphics[height=1.75ex,%
clip=true]{square}
\end{document}
""")
# Dummy EPS file drawing a square
test.write('square.eps',
r"""%!PS-Adobe-2.0 EPSF-1.2
%%BoundingBox: 0 0 20 20
newpath
5 5 moveto
15 5 lineto
15 15 lineto
5 15 lineto
5 5 lineto
stroke
%%EOF
""")
test.run(arguments = '.')
test.must_exist(test.workpath('root.dvi'))
test.must_exist(test.workpath('root.log'))
test.pass_test()
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=4 shiftwidth=4:
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
11593,
34,
3185,
38162,
9947,
834,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
198,
2,
257,
4866,
286,
428,
3788,
290,
3917,
10314,
3696,
357,
1169,
198,
2,
366,
25423,
12340,
284,
1730,
287,
262,
10442,
1231,
17504,
11,
1390,
198,
2,
1231,
17385,
262,
2489,
284,
779,
11,
4866,
11,
13096,
11,
20121,
11,
7715,
11,
198,
2,
14983,
11,
850,
43085,
11,
290,
14,
273,
3677,
9088,
286,
262,
10442,
11,
290,
284,
198,
2,
8749,
6506,
284,
4150,
262,
10442,
318,
30760,
284,
466,
523,
11,
2426,
284,
198,
2,
262,
1708,
3403,
25,
198,
2,
198,
2,
383,
2029,
6634,
4003,
290,
428,
7170,
4003,
2236,
307,
3017,
198,
2,
287,
477,
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,
198,
2,
509,
12115,
11,
7788,
32761,
6375,
8959,
49094,
11,
47783,
2751,
21728,
5626,
40880,
5390,
3336,
198,
2,
34764,
11015,
3963,
34482,
3398,
1565,
5603,
25382,
11,
376,
46144,
7473,
317,
16652,
2149,
37232,
33079,
48933,
5357,
198,
2,
44521,
1268,
10913,
2751,
12529,
13,
3268,
8005,
49261,
50163,
3336,
37195,
20673,
6375,
27975,
38162,
9947,
367,
15173,
4877,
9348,
198,
2,
43031,
19146,
7473,
15529,
47666,
3955,
11,
29506,
25552,
6375,
25401,
43031,
25382,
11,
7655,
2767,
16879,
3268,
3537,
40282,
198,
2,
3963,
27342,
10659,
11,
309,
9863,
6375,
25401,
54,
24352,
11,
5923,
1797,
2751,
16034,
11,
16289,
3963,
6375,
3268,
7102,
45,
24565,
198,
2,
13315,
3336,
47466,
6375,
3336,
23210,
6375,
25401,
5550,
1847,
20754,
3268,
3336,
47466,
13,
198,
2,
198,
198,
834,
260,
10178,
834,
796,
366,
834,
25664,
834,
11593,
2200,
29817,
2849,
834,
11593,
35,
6158,
834,
11593,
7206,
18697,
31054,
834,
1,
198,
198,
37811,
198,
2215,
281,
14900,
338,
11902,
4578,
357,
268,
20225,
287,
6616,
28103,
25,
198,
58,
12962,
32727,
3294,
3951,
357,
8869,
2912,
27074,
828,
4155,
326,
262,
4689,
49568,
198,
33351,
1008,
1595,
470,
3714,
281,
12901,
12331,
13,
198,
198,
2025,
1672,
286,
428,
287,
262,
4295,
318,
287,
5658,
679,
320,
338,
304,
862,
67,
501,
4689,
49568,
5301,
25,
198,
220,
3467,
259,
758,
1533,
11549,
58,
17015,
28,
16,
13,
2425,
1069,
11,
1177,
634,
28,
513,
604,
4353,
5014,
11,
4,
198,
220,
10651,
28,
7942,
60,
31478,
67,
501,
7753,
92,
4,
198,
818,
304,
862,
67,
501,
4343,
14,
2999,
14,
1314,
11,
410,
13,
362,
13,
16,
13,
198,
37811,
198,
198,
11748,
6208,
6173,
684,
198,
198,
62,
13499,
796,
6208,
6173,
684,
13557,
13499,
198,
198,
9288,
796,
6208,
6173,
684,
13,
14402,
6173,
684,
3419,
198,
198,
17660,
87,
796,
1332,
13,
3003,
62,
271,
10786,
17660,
87,
11537,
198,
198,
361,
407,
47038,
25,
198,
220,
220,
220,
1332,
13,
48267,
62,
9288,
7203,
23722,
407,
1064,
47038,
26,
31017,
1332,
7,
82,
737,
59,
77,
4943,
198,
198,
9288,
13,
13564,
10786,
50,
42316,
3256,
37227,
59,
198,
11748,
28686,
198,
24330,
796,
9344,
7,
1677,
53,
796,
1391,
705,
34219,
6,
1058,
28686,
13,
268,
2268,
17816,
34219,
20520,
32092,
198,
24330,
13,
35,
12861,
10786,
15763,
13,
16886,
11537,
198,
15931,
4943,
198,
198,
9288,
13,
13564,
10786,
15763,
13,
16886,
3256,
198,
81,
37811,
59,
22897,
4871,
90,
20205,
92,
198,
59,
1904,
26495,
90,
70,
22262,
87,
92,
198,
59,
27471,
90,
22897,
92,
198,
220,
3467,
259,
758,
1533,
11549,
58,
17015,
28,
16,
13,
2425,
1069,
11,
4,
198,
220,
10651,
28,
7942,
60,
90,
23415,
92,
198,
59,
437,
90,
22897,
92,
198,
15931,
4943,
198,
198,
2,
360,
13513,
47013,
2393,
8263,
257,
6616,
198,
9288,
13,
13564,
10786,
23415,
13,
25386,
3256,
198,
81,
37811,
4,
0,
3705,
12,
2782,
5910,
12,
17,
13,
15,
47013,
37,
12,
16,
13,
17,
198,
16626,
33,
9969,
14253,
25,
657,
657,
1160,
1160,
198,
649,
6978,
198,
220,
642,
642,
1445,
1462,
198,
1315,
642,
9493,
27206,
198,
1315,
1315,
9493,
27206,
198,
642,
1315,
9493,
27206,
198,
642,
220,
642,
9493,
27206,
198,
14000,
198,
16626,
4720,
37,
198,
15931,
4943,
198,
198,
9288,
13,
5143,
7,
853,
2886,
796,
705,
2637,
8,
198,
198,
9288,
13,
27238,
62,
38476,
7,
9288,
13,
1818,
6978,
10786,
15763,
13,
67,
8903,
6,
4008,
198,
9288,
13,
27238,
62,
38476,
7,
9288,
13,
1818,
6978,
10786,
15763,
13,
6404,
6,
4008,
198,
198,
9288,
13,
6603,
62,
9288,
3419,
198,
198,
2,
10714,
15965,
2977,
25,
198,
2,
7400,
12,
10394,
25,
19,
198,
2,
33793,
12,
8658,
82,
12,
14171,
25,
45991,
198,
2,
5268,
25,
198,
2,
43907,
25,
900,
4292,
8658,
7400,
11338,
28,
19,
6482,
10394,
28,
19,
25,
628
] | 3.00612 | 817 |
import numpy as np
from matplotlib import pyplot
from matplotlib.colors import Normalize
from scipy import stats
from scipy.special import logsumexp
from IPython.display import Markdown
import seaborn as sns
lamda = 0.005
kappa = 0.25
rho = 0.01
mu = 0.01
data = []
for n_dim in [10, 80, 640]:
for dt in [1, 8, 64]:
t = time_matrix(n_dim, dt)
c_z = corr_z(t, rho, mu, lamda, kappa)
data.append({'n_dim': n_dim, 'dt': dt, 'correlation': c_z})
data = pd.DataFrame(data)
g = sns.FacetGrid(data, col='dt', row='n_dim', sharex=False, sharey=False, aspect=1, height=5/2.54, gridspec_kws={"wspace": 0.1, "hspace": 0.2})
g = g.map(draw_heatmap, 'correlation', cbar=False, xticklabels=False, yticklabels=False).set_titles("$N$ = {row_name} | $\Delta t$ = {col_name}").set(xlabel=None)
pyplot.savefig('matrix_plots.png', dpi=300) | [
11748,
299,
32152,
355,
45941,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
198,
6738,
2603,
29487,
8019,
13,
4033,
669,
1330,
14435,
1096,
198,
6738,
629,
541,
88,
1330,
9756,
198,
6738,
629,
541,
88,
13,
20887,
1330,
2604,
16345,
11201,
198,
6738,
6101,
7535,
13,
13812,
1330,
2940,
2902,
198,
11748,
384,
397,
1211,
355,
3013,
82,
198,
198,
2543,
6814,
796,
657,
13,
22544,
198,
74,
20975,
796,
657,
13,
1495,
198,
81,
8873,
796,
657,
13,
486,
198,
30300,
796,
657,
13,
486,
198,
198,
7890,
796,
17635,
198,
1640,
299,
62,
27740,
287,
685,
940,
11,
4019,
11,
33759,
5974,
198,
220,
220,
220,
329,
288,
83,
287,
685,
16,
11,
807,
11,
5598,
5974,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
256,
796,
640,
62,
6759,
8609,
7,
77,
62,
27740,
11,
288,
83,
8,
198,
220,
220,
220,
220,
220,
220,
220,
269,
62,
89,
796,
1162,
81,
62,
89,
7,
83,
11,
374,
8873,
11,
38779,
11,
30592,
6814,
11,
479,
20975,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1366,
13,
33295,
15090,
6,
77,
62,
27740,
10354,
299,
62,
27740,
11,
705,
28664,
10354,
288,
83,
11,
705,
10215,
49501,
10354,
269,
62,
89,
30072,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
7890,
796,
279,
67,
13,
6601,
19778,
7,
7890,
8,
198,
70,
796,
3013,
82,
13,
37,
23253,
41339,
7,
7890,
11,
951,
11639,
28664,
3256,
5752,
11639,
77,
62,
27740,
3256,
2648,
87,
28,
25101,
11,
2648,
88,
28,
25101,
11,
4843,
28,
16,
11,
6001,
28,
20,
14,
17,
13,
4051,
11,
50000,
43106,
62,
74,
18504,
28,
4895,
86,
13200,
1298,
657,
13,
16,
11,
366,
71,
13200,
1298,
657,
13,
17,
30072,
198,
70,
796,
308,
13,
8899,
7,
19334,
62,
25080,
8899,
11,
705,
10215,
49501,
3256,
269,
5657,
28,
25101,
11,
220,
742,
624,
23912,
1424,
28,
25101,
11,
331,
42298,
23912,
1424,
28,
25101,
737,
2617,
62,
83,
30540,
7203,
3,
45,
3,
796,
1391,
808,
62,
3672,
92,
930,
39280,
42430,
256,
3,
796,
1391,
4033,
62,
3672,
92,
11074,
2617,
7,
87,
18242,
28,
14202,
8,
198,
9078,
29487,
13,
21928,
5647,
10786,
6759,
8609,
62,
489,
1747,
13,
11134,
3256,
288,
14415,
28,
6200,
8
] | 2.220513 | 390 |
from .card import CardFilterSet
| [
6738,
764,
9517,
1330,
5172,
22417,
7248,
198
] | 4 | 8 |
"""
This carries out dynamic and static code analysis and POSTs the results to GitHub as statuses.
Without passing statuses, a pull request cannot be merged. Dynamic tests require 100% passing to be
considered a success. The static tests are informational only and will always generate success if
they run correctly.
"""
# pylint: disable=logging-fstring-interpolation
import decimal
import json
import os
import re
import time
import dpath
import requests
from requests.exceptions import MissingSchema
from py_dev_hammer.utils.aws import (
connect_to_aws_resource, get_items_by_partition_key, put_with_partition_and_sort_key,
get_boto_client,
)
from py_dev_hammer.utils.errors import GeneralError
from py_dev_hammer.utils.general import logger, load_config_file, get_certs
APP_CONFIG = load_config_file(f"{os.environ.get('CONFIG_DIR')}/app_config.yml")
USER_CONFIG = load_config_file(f"{os.environ.get('CONFIG_DIR')}/user_config.yml")
def entry_point():
"""
Allows the module to be called from the command line.
"""
logger.info("Starting at entry point")
dynamic_test_types = list(APP_CONFIG['tests_to_run']['dynamic'].keys())
static_test_types = list(APP_CONFIG['tests_to_run']['static'].keys())
test_types = dynamic_test_types + static_test_types
static_results_dir = os.path.join(
APP_CONFIG['static_analysis']['root_dir'], APP_CONFIG['static_analysis']['results_dir'])
test_parameters = [
_create_test_parameters_dict(test_type, static_results_dir) for test_type in test_types]
target_url = _parse_url_from_arn(USER_CONFIG)
os.environ['REQUESTS_CA_BUNDLE'] = get_certs()
try:
_execute(USER_CONFIG, test_parameters, target_url, dynamic_test_types, static_test_types)
except GeneralError as gen_err:
logger.error(f"GeneralError in GitHub Status Posting: {gen_err}", exc_info=True)
else:
logger.info("Successfully executed GitHub Status Posting")
| [
37811,
198,
1212,
10732,
503,
8925,
290,
9037,
2438,
3781,
290,
24582,
82,
262,
2482,
284,
21722,
355,
1185,
2664,
13,
198,
16249,
6427,
1185,
2664,
11,
257,
2834,
2581,
2314,
307,
23791,
13,
26977,
5254,
2421,
1802,
4,
6427,
284,
307,
198,
5936,
3089,
257,
1943,
13,
383,
9037,
5254,
389,
21524,
691,
290,
481,
1464,
7716,
1943,
611,
198,
9930,
1057,
9380,
13,
198,
37811,
198,
198,
2,
279,
2645,
600,
25,
15560,
28,
6404,
2667,
12,
69,
8841,
12,
3849,
16104,
341,
198,
198,
11748,
32465,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
640,
198,
198,
11748,
288,
6978,
198,
11748,
7007,
198,
6738,
7007,
13,
1069,
11755,
1330,
25639,
27054,
2611,
198,
198,
6738,
12972,
62,
7959,
62,
17980,
13,
26791,
13,
8356,
1330,
357,
198,
220,
220,
220,
2018,
62,
1462,
62,
8356,
62,
31092,
11,
651,
62,
23814,
62,
1525,
62,
3911,
653,
62,
2539,
11,
1234,
62,
4480,
62,
3911,
653,
62,
392,
62,
30619,
62,
2539,
11,
198,
220,
220,
220,
651,
62,
65,
2069,
62,
16366,
11,
198,
8,
198,
6738,
12972,
62,
7959,
62,
17980,
13,
26791,
13,
48277,
1330,
3611,
12331,
198,
6738,
12972,
62,
7959,
62,
17980,
13,
26791,
13,
24622,
1330,
49706,
11,
3440,
62,
11250,
62,
7753,
11,
651,
62,
22583,
82,
198,
198,
24805,
62,
10943,
16254,
796,
3440,
62,
11250,
62,
7753,
7,
69,
1,
90,
418,
13,
268,
2268,
13,
1136,
10786,
10943,
16254,
62,
34720,
11537,
92,
14,
1324,
62,
11250,
13,
88,
4029,
4943,
198,
29904,
62,
10943,
16254,
796,
3440,
62,
11250,
62,
7753,
7,
69,
1,
90,
418,
13,
268,
2268,
13,
1136,
10786,
10943,
16254,
62,
34720,
11537,
92,
14,
7220,
62,
11250,
13,
88,
4029,
4943,
628,
198,
4299,
5726,
62,
4122,
33529,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
40402,
262,
8265,
284,
307,
1444,
422,
262,
3141,
1627,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
49706,
13,
10951,
7203,
22851,
379,
5726,
966,
4943,
628,
220,
220,
220,
8925,
62,
9288,
62,
19199,
796,
1351,
7,
24805,
62,
10943,
16254,
17816,
41989,
62,
1462,
62,
5143,
6,
7131,
6,
67,
28995,
6,
4083,
13083,
28955,
198,
220,
220,
220,
9037,
62,
9288,
62,
19199,
796,
1351,
7,
24805,
62,
10943,
16254,
17816,
41989,
62,
1462,
62,
5143,
6,
7131,
6,
12708,
6,
4083,
13083,
28955,
198,
220,
220,
220,
1332,
62,
19199,
796,
8925,
62,
9288,
62,
19199,
1343,
9037,
62,
9288,
62,
19199,
628,
220,
220,
220,
9037,
62,
43420,
62,
15908,
796,
28686,
13,
6978,
13,
22179,
7,
198,
220,
220,
220,
220,
220,
220,
220,
43504,
62,
10943,
16254,
17816,
12708,
62,
20930,
6,
7131,
6,
15763,
62,
15908,
6,
4357,
43504,
62,
10943,
16254,
17816,
12708,
62,
20930,
6,
7131,
6,
43420,
62,
15908,
6,
12962,
198,
220,
220,
220,
1332,
62,
17143,
7307,
796,
685,
198,
220,
220,
220,
220,
220,
220,
220,
4808,
17953,
62,
9288,
62,
17143,
7307,
62,
11600,
7,
9288,
62,
4906,
11,
9037,
62,
43420,
62,
15908,
8,
329,
1332,
62,
4906,
287,
1332,
62,
19199,
60,
198,
220,
220,
220,
2496,
62,
6371,
796,
4808,
29572,
62,
6371,
62,
6738,
62,
1501,
7,
29904,
62,
10943,
16254,
8,
198,
220,
220,
220,
28686,
13,
268,
2268,
17816,
2200,
10917,
1546,
4694,
62,
8141,
62,
33,
4944,
35,
2538,
20520,
796,
651,
62,
22583,
82,
3419,
628,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
4808,
41049,
7,
29904,
62,
10943,
16254,
11,
1332,
62,
17143,
7307,
11,
2496,
62,
6371,
11,
8925,
62,
9288,
62,
19199,
11,
9037,
62,
9288,
62,
19199,
8,
198,
220,
220,
220,
2845,
3611,
12331,
355,
2429,
62,
8056,
25,
198,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
18224,
7,
69,
1,
12218,
12331,
287,
21722,
12678,
2947,
278,
25,
1391,
5235,
62,
8056,
92,
1600,
2859,
62,
10951,
28,
17821,
8,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
10951,
7203,
33244,
2759,
10945,
21722,
12678,
2947,
278,
4943,
628,
628,
628,
628,
628,
198
] | 2.855282 | 691 |
# Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).
# You may assume that the intervals were initially sorted according to their start times.
# Example 1:
# Given intervals [1,3],[6,9], insert and merge [2,5] in as [1,5],[6,9].
# Example 2:
# Given [1,2],[3,5],[6,7],[8,10],[12,16], insert and merge [4,9] in as [1,2],[3,10],[12,16].
# This is because the new interval [4,9] overlaps with [3,5],[6,7],[8,10].
# Definition for an interval.
# class Interval:
# def __init__(self, s=0, e=0):
# self.start = s
# self.end = e
# @param {Interval[]} intervals
# @param {Interval} newInterval
# @return {Interval[]}
| [
2,
11259,
257,
900,
286,
1729,
12,
2502,
75,
5912,
20016,
11,
7550,
257,
649,
16654,
656,
262,
20016,
357,
647,
469,
611,
3306,
737,
198,
198,
2,
921,
743,
7048,
326,
262,
20016,
547,
7317,
23243,
1864,
284,
511,
923,
1661,
13,
198,
198,
2,
17934,
352,
25,
198,
2,
11259,
20016,
685,
16,
11,
18,
38430,
21,
11,
24,
4357,
7550,
290,
20121,
685,
17,
11,
20,
60,
287,
355,
685,
16,
11,
20,
38430,
21,
11,
24,
4083,
198,
198,
2,
17934,
362,
25,
198,
2,
11259,
685,
16,
11,
17,
38430,
18,
11,
20,
38430,
21,
11,
22,
38430,
23,
11,
940,
38430,
1065,
11,
1433,
4357,
7550,
290,
20121,
685,
19,
11,
24,
60,
287,
355,
685,
16,
11,
17,
38430,
18,
11,
940,
38430,
1065,
11,
1433,
4083,
198,
198,
2,
770,
318,
780,
262,
649,
16654,
685,
19,
11,
24,
60,
12893,
1686,
351,
685,
18,
11,
20,
38430,
21,
11,
22,
38430,
23,
11,
940,
4083,
220,
198,
198,
2,
30396,
329,
281,
16654,
13,
198,
2,
1398,
4225,
2100,
25,
198,
2,
220,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
264,
28,
15,
11,
304,
28,
15,
2599,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
9688,
796,
264,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
437,
796,
304,
198,
220,
220,
220,
1303,
2488,
17143,
1391,
9492,
2100,
21737,
92,
20016,
198,
220,
220,
220,
1303,
2488,
17143,
1391,
9492,
2100,
92,
649,
9492,
2100,
198,
220,
220,
220,
1303,
2488,
7783,
1391,
9492,
2100,
21737,
92,
628
] | 2.6 | 270 |
from copy import deepcopy
from dataclasses import dataclass, field
from math import degrees, radians, sin, tan
from typing import List
from taperable_helix import Helix, HelixLocation
@dataclass
class HelicalThread(Helix):
"""
A set of fields used to represent a helical thread and passed as
the parameter to `helical_thread`.
Control of the size and spacing of the thread using the various
fields in Helix and those below.
"""
angle_degs: float = 45
"""angle in degrees"""
major_cutoff: float = 0
"""Size of of flat at the major diameter"""
minor_cutoff: float = 0
"""Size of flat at the minor diameter"""
ext_clearance: float = 0.1
"""External clearance between external and internal threads"""
thread_overlap: float = 0.001
"""
Amount to overlap threads with the core so the union of core and
threads is a manifold
"""
@dataclass
class ThreadHelixes:
"""
The helixes returned by helical_thread` that represents the internal
thread, prefixed with `int_` and the external thread, prefixed with `ext_`.
"""
ht: HelicalThread
"""The basic Dimensions of the helixes"""
int_helix_radius: float = 0
"""The internal thread radius"""
int_helixes: List[HelixLocation] = field(default_factory=list)
"""List of the internal helix locations"""
ext_helix_radius: float = 0
"""The external thread radius"""
ext_helixes: List[HelixLocation] = field(default_factory=list)
"""List of the external helix locations"""
def helical_thread(ht: HelicalThread) -> ThreadHelixes:
"""
Given HelicalThread compute the internal and external
helixes thread and returning them in ThreadHelixes.
int_hexlix_radius, int_helixes, ext_helix_radius and ext_helixes.
The helixes are an array of HelixLocations that define the helixes of
the thread. If minor_cutoff is 0 then the thread will be triangular
and the length of the {int|ext}_helixes 3. if minor_cutoff > 0 then
the thread will be a trapezoid with the length of the {int|ext}_helixes
will be 4.
:param ht: The basic dimensions of the helicla thread
:returns: internal and external helixes necessary to use taperable-helix
"""
# print(
# f"helical_thread:+ height={height:.3f} pitch={pitch:.3f} angle_degs={angle_degs:.3f}"
# )
# print(
# f"helical_thread: inset={inset:.3f} ext_clearance={ext_clearance} taper_rpos={taper_rpos:.3f}"
# )
# print(
# f"helical_thread: major_cutoff={major_cutoff} minor_cutoff={minor_cutoff} thread_overlap={thread_overlap:.3f} "
# )
# print(
# f"helical_thread: first_t={first_t} last_t={last_t} "
# )
result: ThreadHelixes = ThreadHelixes(ht)
angle_radians: float = radians(ht.angle_degs)
tan_hangle: float = tan(angle_radians / 2)
sin_hangle: float = sin(angle_radians / 2)
tip_to_major_cutoff: float = ((ht.pitch - ht.major_cutoff) / 2) / tan_hangle
tip_to_minor_cutoff: float = (ht.minor_cutoff / 2) / tan_hangle
# print(
# f"helical_thread: tip_to_major_cutoff={tip_to_major_cutoff:.3f} tip_to_minor_cutoff={tip_to_minor_cutoff:.3f}"
# )
int_thread_depth: float = tip_to_major_cutoff - tip_to_minor_cutoff
# print(f"helical_thread: int_thread_depth={int_thread_depth}")
thread_overlap_vert_adj: float = ht.thread_overlap * tan_hangle
thread_half_height_at_helix_radius: float = (
(ht.pitch - ht.major_cutoff) / 2
) + thread_overlap_vert_adj
thread_half_height_at_opposite_helix_radius: float = ht.minor_cutoff / 2
# print(
# f"thh_at_r={thread_half_height_at_helix_radius} thh_at_or={thread_half_height_at_opposite_helix_radius} td={int_thread_depth}"
# )
# Internal thread have helix thread radisu
result.int_helix_radius = ht.radius
result.int_helixes = []
# print(f"result.int_helix_radius={result.int_helix_radius}")
hl = HelixLocation(
radius=result.int_helix_radius + ht.thread_overlap,
horz_offset=0,
vert_offset=-thread_half_height_at_helix_radius,
)
result.int_helixes.append(hl)
hl = HelixLocation(
radius=result.int_helix_radius + ht.thread_overlap,
horz_offset=0,
vert_offset=+thread_half_height_at_helix_radius,
)
result.int_helixes.append(hl)
hl = HelixLocation(
radius=result.int_helix_radius,
horz_offset=-int_thread_depth,
vert_offset=+thread_half_height_at_opposite_helix_radius,
)
result.int_helixes.append(hl)
if ht.minor_cutoff > 0:
hl = HelixLocation(
radius=result.int_helix_radius,
horz_offset=-int_thread_depth,
vert_offset=-thread_half_height_at_opposite_helix_radius,
)
result.int_helixes.append(hl)
# Use ext_clearance to calcuate external thread values
# hyp is the hypothense of the trinagle formed by a radial
# line, the tip of the internal thread and the tip of the
# external thread.
hyp: float = ht.ext_clearance / sin_hangle
# ext_vert_adj is the amount to ajdust verticaly the helix
ext_vert_adj: float = (hyp - ht.ext_clearance) * tan_hangle
# print(f"hyp={hyp} ext_vert_adj={ext_vert_adj}")
# External thread have the helix on the minor side and
# so we subtract the int_thread_depth and ext_clearance from ht.radius
result.ext_helix_radius = ht.radius - int_thread_depth - ht.ext_clearance
# print(
# f"result.ext_helix_radius={ht.ext_helix_radius} td={int_thread_depth} ec={ht.ext_clearance}"
# )
ext_thread_half_height_at_ext_helix_radius: float = (
(ht.pitch - ht.minor_cutoff) / 2
) - ext_vert_adj
ext_thread_half_height_at_ext_helix_radius_plus_tova: float = (
ext_thread_half_height_at_ext_helix_radius + thread_overlap_vert_adj
)
# When major cutoff becomes smaller than the exter_vert_adj then the
# external thread will only be three points and we set
# ext_thrad_half_height_at_opposite_ext_helix_radius # to 0 and
# compute the thread depth. Under these circumstances the clearance
# from the external tip to internal core will be close to ext_clearance
# or greater. See test_thread.py or test_thread_new.py.
ext_thread_half_height_at_opposite_ext_helix_radius: float = (
ht.major_cutoff / 2
) - ext_vert_adj
ext_thread_depth: float = int_thread_depth
if ext_thread_half_height_at_opposite_ext_helix_radius < 0:
ext_thread_half_height_at_opposite_ext_helix_radius = 0
ext_thread_depth = ext_thread_half_height_at_ext_helix_radius / tan_hangle
# print(
# f"ext_thread_depth={ext_thread_depth} ext_thh_at_ehr={ext_thread_half_height_at_ext_helix_radius} ext_thh_at_ehr_plus_tovo={ext_thread_half_height_at_ext_helix_radius_plus_tova} ext_thh_at_oehr={ext_thread_half_height_at_opposite_ext_helix_radius}"
# )
result.ext_helixes = []
hl = HelixLocation(
radius=result.ext_helix_radius - ht.thread_overlap,
horz_offset=0,
vert_offset=-ext_thread_half_height_at_ext_helix_radius_plus_tova,
)
result.ext_helixes.append(hl)
hl = HelixLocation(
radius=result.ext_helix_radius - ht.thread_overlap,
horz_offset=0,
vert_offset=+ext_thread_half_height_at_ext_helix_radius_plus_tova,
)
result.ext_helixes.append(hl)
hl = HelixLocation(
radius=result.ext_helix_radius,
horz_offset=ext_thread_depth,
vert_offset=+ext_thread_half_height_at_opposite_ext_helix_radius,
)
result.ext_helixes.append(hl)
if ext_thread_half_height_at_opposite_ext_helix_radius > 0:
hl = HelixLocation(
radius=result.ext_helix_radius,
horz_offset=ext_thread_depth,
vert_offset=-ext_thread_half_height_at_opposite_ext_helix_radius,
)
result.ext_helixes.append(hl)
return result
| [
6738,
4866,
1330,
2769,
30073,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
11,
2214,
198,
6738,
10688,
1330,
7370,
11,
2511,
1547,
11,
7813,
11,
25706,
198,
6738,
19720,
1330,
7343,
198,
198,
6738,
256,
2136,
540,
62,
2978,
844,
1330,
5053,
844,
11,
5053,
844,
14749,
628,
198,
31,
19608,
330,
31172,
198,
4871,
5053,
605,
16818,
7,
12621,
844,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
317,
900,
286,
7032,
973,
284,
2380,
257,
932,
605,
4704,
290,
3804,
355,
198,
220,
220,
220,
262,
11507,
284,
4600,
2978,
605,
62,
16663,
44646,
628,
220,
220,
220,
6779,
286,
262,
2546,
290,
31050,
286,
262,
4704,
1262,
262,
2972,
198,
220,
220,
220,
7032,
287,
5053,
844,
290,
883,
2174,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
9848,
62,
13500,
82,
25,
12178,
796,
4153,
198,
220,
220,
220,
37227,
9248,
287,
7370,
37811,
628,
220,
220,
220,
1688,
62,
8968,
2364,
25,
12178,
796,
657,
198,
220,
220,
220,
37227,
10699,
286,
286,
6228,
379,
262,
1688,
14753,
37811,
628,
220,
220,
220,
4159,
62,
8968,
2364,
25,
12178,
796,
657,
198,
220,
220,
220,
37227,
10699,
286,
6228,
379,
262,
4159,
14753,
37811,
628,
220,
220,
220,
1070,
62,
20063,
590,
25,
12178,
796,
657,
13,
16,
198,
220,
220,
220,
37227,
41506,
19745,
1022,
7097,
290,
5387,
14390,
37811,
628,
220,
220,
220,
4704,
62,
2502,
37796,
25,
12178,
796,
657,
13,
8298,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
26308,
284,
21721,
14390,
351,
262,
4755,
523,
262,
6441,
286,
4755,
290,
198,
220,
220,
220,
14390,
318,
257,
48048,
198,
220,
220,
220,
37227,
628,
198,
31,
19608,
330,
31172,
198,
4871,
14122,
12621,
844,
274,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
383,
932,
844,
274,
4504,
416,
932,
605,
62,
16663,
63,
326,
6870,
262,
5387,
198,
220,
220,
220,
4704,
11,
7694,
2966,
351,
4600,
600,
62,
63,
290,
262,
7097,
4704,
11,
7694,
2966,
351,
4600,
2302,
62,
44646,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
289,
83,
25,
5053,
605,
16818,
198,
220,
220,
220,
37227,
464,
4096,
41265,
286,
262,
932,
844,
274,
37811,
628,
220,
220,
220,
493,
62,
2978,
844,
62,
42172,
25,
12178,
796,
657,
198,
220,
220,
220,
37227,
464,
5387,
4704,
16874,
37811,
628,
220,
220,
220,
493,
62,
2978,
844,
274,
25,
7343,
58,
12621,
844,
14749,
60,
796,
2214,
7,
12286,
62,
69,
9548,
28,
4868,
8,
198,
220,
220,
220,
37227,
8053,
286,
262,
5387,
932,
844,
7064,
37811,
628,
220,
220,
220,
1070,
62,
2978,
844,
62,
42172,
25,
12178,
796,
657,
198,
220,
220,
220,
37227,
464,
7097,
4704,
16874,
37811,
628,
220,
220,
220,
1070,
62,
2978,
844,
274,
25,
7343,
58,
12621,
844,
14749,
60,
796,
2214,
7,
12286,
62,
69,
9548,
28,
4868,
8,
198,
220,
220,
220,
37227,
8053,
286,
262,
7097,
932,
844,
7064,
37811,
628,
198,
4299,
932,
605,
62,
16663,
7,
4352,
25,
5053,
605,
16818,
8,
4613,
14122,
12621,
844,
274,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
11259,
5053,
605,
16818,
24061,
262,
5387,
290,
7097,
198,
220,
220,
220,
932,
844,
274,
4704,
290,
8024,
606,
287,
14122,
12621,
844,
274,
13,
198,
220,
220,
220,
493,
62,
33095,
75,
844,
62,
42172,
11,
493,
62,
2978,
844,
274,
11,
1070,
62,
2978,
844,
62,
42172,
290,
1070,
62,
2978,
844,
274,
13,
198,
220,
220,
220,
383,
932,
844,
274,
389,
281,
7177,
286,
5053,
844,
43,
20968,
326,
8160,
262,
932,
844,
274,
286,
198,
220,
220,
220,
262,
4704,
13,
1002,
4159,
62,
8968,
2364,
318,
657,
788,
262,
4704,
481,
307,
46963,
198,
220,
220,
220,
290,
262,
4129,
286,
262,
1391,
600,
91,
2302,
92,
62,
2978,
844,
274,
513,
13,
611,
4159,
62,
8968,
2364,
1875,
657,
788,
198,
220,
220,
220,
262,
4704,
481,
307,
257,
1291,
46057,
1868,
351,
262,
4129,
286,
262,
1391,
600,
91,
2302,
92,
62,
2978,
844,
274,
198,
220,
220,
220,
481,
307,
604,
13,
628,
220,
220,
220,
1058,
17143,
289,
83,
25,
383,
4096,
15225,
286,
262,
11573,
5031,
4704,
198,
220,
220,
220,
1058,
7783,
82,
25,
5387,
290,
7097,
932,
844,
274,
3306,
284,
779,
256,
2136,
540,
12,
2978,
844,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1303,
3601,
7,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
277,
1,
2978,
605,
62,
16663,
25,
10,
6001,
34758,
17015,
25,
13,
18,
69,
92,
7078,
34758,
79,
2007,
25,
13,
18,
69,
92,
9848,
62,
13500,
82,
34758,
9248,
62,
13500,
82,
25,
13,
18,
69,
36786,
198,
220,
220,
220,
1303,
1267,
198,
220,
220,
220,
1303,
3601,
7,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
277,
1,
2978,
605,
62,
16663,
25,
1035,
316,
34758,
1040,
316,
25,
13,
18,
69,
92,
1070,
62,
20063,
590,
34758,
2302,
62,
20063,
590,
92,
256,
2136,
62,
81,
1930,
34758,
83,
2136,
62,
81,
1930,
25,
13,
18,
69,
36786,
198,
220,
220,
220,
1303,
1267,
198,
220,
220,
220,
1303,
3601,
7,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
277,
1,
2978,
605,
62,
16663,
25,
1688,
62,
8968,
2364,
34758,
22478,
62,
8968,
2364,
92,
4159,
62,
8968,
2364,
34758,
1084,
273,
62,
8968,
2364,
92,
4704,
62,
2502,
37796,
34758,
16663,
62,
2502,
37796,
25,
13,
18,
69,
92,
366,
198,
220,
220,
220,
1303,
1267,
198,
220,
220,
220,
1303,
3601,
7,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
277,
1,
2978,
605,
62,
16663,
25,
717,
62,
83,
34758,
11085,
62,
83,
92,
938,
62,
83,
34758,
12957,
62,
83,
92,
366,
198,
220,
220,
220,
1303,
1267,
628,
220,
220,
220,
1255,
25,
14122,
12621,
844,
274,
796,
14122,
12621,
844,
274,
7,
4352,
8,
628,
220,
220,
220,
9848,
62,
6335,
1547,
25,
12178,
796,
2511,
1547,
7,
4352,
13,
9248,
62,
13500,
82,
8,
198,
220,
220,
220,
25706,
62,
71,
9248,
25,
12178,
796,
25706,
7,
9248,
62,
6335,
1547,
1220,
362,
8,
198,
220,
220,
220,
7813,
62,
71,
9248,
25,
12178,
796,
7813,
7,
9248,
62,
6335,
1547,
1220,
362,
8,
198,
220,
220,
220,
8171,
62,
1462,
62,
22478,
62,
8968,
2364,
25,
12178,
796,
14808,
4352,
13,
79,
2007,
532,
289,
83,
13,
22478,
62,
8968,
2364,
8,
1220,
362,
8,
1220,
25706,
62,
71,
9248,
198,
220,
220,
220,
8171,
62,
1462,
62,
1084,
273,
62,
8968,
2364,
25,
12178,
796,
357,
4352,
13,
1084,
273,
62,
8968,
2364,
1220,
362,
8,
1220,
25706,
62,
71,
9248,
198,
220,
220,
220,
1303,
3601,
7,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
277,
1,
2978,
605,
62,
16663,
25,
8171,
62,
1462,
62,
22478,
62,
8968,
2364,
34758,
22504,
62,
1462,
62,
22478,
62,
8968,
2364,
25,
13,
18,
69,
92,
8171,
62,
1462,
62,
1084,
273,
62,
8968,
2364,
34758,
22504,
62,
1462,
62,
1084,
273,
62,
8968,
2364,
25,
13,
18,
69,
36786,
198,
220,
220,
220,
1303,
1267,
198,
220,
220,
220,
493,
62,
16663,
62,
18053,
25,
12178,
796,
8171,
62,
1462,
62,
22478,
62,
8968,
2364,
532,
8171,
62,
1462,
62,
1084,
273,
62,
8968,
2364,
198,
220,
220,
220,
1303,
3601,
7,
69,
1,
2978,
605,
62,
16663,
25,
493,
62,
16663,
62,
18053,
34758,
600,
62,
16663,
62,
18053,
92,
4943,
628,
220,
220,
220,
4704,
62,
2502,
37796,
62,
1851,
62,
41255,
25,
12178,
796,
289,
83,
13,
16663,
62,
2502,
37796,
1635,
25706,
62,
71,
9248,
198,
220,
220,
220,
4704,
62,
13959,
62,
17015,
62,
265,
62,
2978,
844,
62,
42172,
25,
12178,
796,
357,
198,
220,
220,
220,
220,
220,
220,
220,
357,
4352,
13,
79,
2007,
532,
289,
83,
13,
22478,
62,
8968,
2364,
8,
1220,
362,
198,
220,
220,
220,
1267,
1343,
4704,
62,
2502,
37796,
62,
1851,
62,
41255,
198,
220,
220,
220,
4704,
62,
13959,
62,
17015,
62,
265,
62,
10365,
5971,
62,
2978,
844,
62,
42172,
25,
12178,
796,
289,
83,
13,
1084,
273,
62,
8968,
2364,
1220,
362,
198,
220,
220,
220,
1303,
3601,
7,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
277,
1,
400,
71,
62,
265,
62,
81,
34758,
16663,
62,
13959,
62,
17015,
62,
265,
62,
2978,
844,
62,
42172,
92,
294,
71,
62,
265,
62,
273,
34758,
16663,
62,
13959,
62,
17015,
62,
265,
62,
10365,
5971,
62,
2978,
844,
62,
42172,
92,
41560,
34758,
600,
62,
16663,
62,
18053,
36786,
198,
220,
220,
220,
1303,
1267,
628,
220,
220,
220,
1303,
18628,
4704,
423,
932,
844,
4704,
2511,
46313,
198,
220,
220,
220,
1255,
13,
600,
62,
2978,
844,
62,
42172,
796,
289,
83,
13,
42172,
198,
220,
220,
220,
1255,
13,
600,
62,
2978,
844,
274,
796,
17635,
628,
220,
220,
220,
1303,
3601,
7,
69,
1,
20274,
13,
600,
62,
2978,
844,
62,
42172,
34758,
20274,
13,
600,
62,
2978,
844,
62,
42172,
92,
4943,
198,
220,
220,
220,
289,
75,
796,
5053,
844,
14749,
7,
198,
220,
220,
220,
220,
220,
220,
220,
16874,
28,
20274,
13,
600,
62,
2978,
844,
62,
42172,
1343,
289,
83,
13,
16663,
62,
2502,
37796,
11,
198,
220,
220,
220,
220,
220,
220,
220,
3076,
89,
62,
28968,
28,
15,
11,
198,
220,
220,
220,
220,
220,
220,
220,
9421,
62,
28968,
10779,
16663,
62,
13959,
62,
17015,
62,
265,
62,
2978,
844,
62,
42172,
11,
198,
220,
220,
220,
1267,
198,
220,
220,
220,
1255,
13,
600,
62,
2978,
844,
274,
13,
33295,
7,
18519,
8,
628,
220,
220,
220,
289,
75,
796,
5053,
844,
14749,
7,
198,
220,
220,
220,
220,
220,
220,
220,
16874,
28,
20274,
13,
600,
62,
2978,
844,
62,
42172,
1343,
289,
83,
13,
16663,
62,
2502,
37796,
11,
198,
220,
220,
220,
220,
220,
220,
220,
3076,
89,
62,
28968,
28,
15,
11,
198,
220,
220,
220,
220,
220,
220,
220,
9421,
62,
28968,
28,
10,
16663,
62,
13959,
62,
17015,
62,
265,
62,
2978,
844,
62,
42172,
11,
198,
220,
220,
220,
1267,
198,
220,
220,
220,
1255,
13,
600,
62,
2978,
844,
274,
13,
33295,
7,
18519,
8,
628,
220,
220,
220,
289,
75,
796,
5053,
844,
14749,
7,
198,
220,
220,
220,
220,
220,
220,
220,
16874,
28,
20274,
13,
600,
62,
2978,
844,
62,
42172,
11,
198,
220,
220,
220,
220,
220,
220,
220,
3076,
89,
62,
28968,
10779,
600,
62,
16663,
62,
18053,
11,
198,
220,
220,
220,
220,
220,
220,
220,
9421,
62,
28968,
28,
10,
16663,
62,
13959,
62,
17015,
62,
265,
62,
10365,
5971,
62,
2978,
844,
62,
42172,
11,
198,
220,
220,
220,
1267,
198,
220,
220,
220,
1255,
13,
600,
62,
2978,
844,
274,
13,
33295,
7,
18519,
8,
628,
220,
220,
220,
611,
289,
83,
13,
1084,
273,
62,
8968,
2364,
1875,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
289,
75,
796,
5053,
844,
14749,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16874,
28,
20274,
13,
600,
62,
2978,
844,
62,
42172,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3076,
89,
62,
28968,
10779,
600,
62,
16663,
62,
18053,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9421,
62,
28968,
10779,
16663,
62,
13959,
62,
17015,
62,
265,
62,
10365,
5971,
62,
2978,
844,
62,
42172,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
13,
600,
62,
2978,
844,
274,
13,
33295,
7,
18519,
8,
628,
220,
220,
220,
1303,
5765,
1070,
62,
20063,
590,
284,
42302,
4985,
7097,
4704,
3815,
628,
220,
220,
220,
1303,
5328,
318,
262,
8813,
831,
325,
286,
262,
491,
259,
19345,
7042,
416,
257,
44503,
198,
220,
220,
220,
1303,
1627,
11,
262,
8171,
286,
262,
5387,
4704,
290,
262,
8171,
286,
262,
198,
220,
220,
220,
1303,
7097,
4704,
13,
198,
220,
220,
220,
5328,
25,
12178,
796,
289,
83,
13,
2302,
62,
20063,
590,
1220,
7813,
62,
71,
9248,
628,
220,
220,
220,
1303,
1070,
62,
1851,
62,
41255,
318,
262,
2033,
284,
257,
73,
48859,
11723,
88,
262,
932,
844,
198,
220,
220,
220,
1070,
62,
1851,
62,
41255,
25,
12178,
796,
357,
36362,
532,
289,
83,
13,
2302,
62,
20063,
590,
8,
1635,
25706,
62,
71,
9248,
198,
220,
220,
220,
1303,
3601,
7,
69,
1,
36362,
34758,
36362,
92,
1070,
62,
1851,
62,
41255,
34758,
2302,
62,
1851,
62,
41255,
92,
4943,
628,
220,
220,
220,
1303,
34579,
4704,
423,
262,
932,
844,
319,
262,
4159,
1735,
290,
198,
220,
220,
220,
1303,
523,
356,
34128,
262,
493,
62,
16663,
62,
18053,
290,
1070,
62,
20063,
590,
422,
289,
83,
13,
42172,
198,
220,
220,
220,
1255,
13,
2302,
62,
2978,
844,
62,
42172,
796,
289,
83,
13,
42172,
532,
493,
62,
16663,
62,
18053,
532,
289,
83,
13,
2302,
62,
20063,
590,
198,
220,
220,
220,
1303,
3601,
7,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
277,
1,
20274,
13,
2302,
62,
2978,
844,
62,
42172,
34758,
4352,
13,
2302,
62,
2978,
844,
62,
42172,
92,
41560,
34758,
600,
62,
16663,
62,
18053,
92,
9940,
34758,
4352,
13,
2302,
62,
20063,
590,
36786,
198,
220,
220,
220,
1303,
1267,
628,
220,
220,
220,
1070,
62,
16663,
62,
13959,
62,
17015,
62,
265,
62,
2302,
62,
2978,
844,
62,
42172,
25,
12178,
796,
357,
198,
220,
220,
220,
220,
220,
220,
220,
357,
4352,
13,
79,
2007,
532,
289,
83,
13,
1084,
273,
62,
8968,
2364,
8,
1220,
362,
198,
220,
220,
220,
1267,
532,
1070,
62,
1851,
62,
41255,
198,
220,
220,
220,
1070,
62,
16663,
62,
13959,
62,
17015,
62,
265,
62,
2302,
62,
2978,
844,
62,
42172,
62,
9541,
62,
83,
10071,
25,
12178,
796,
357,
198,
220,
220,
220,
220,
220,
220,
220,
1070,
62,
16663,
62,
13959,
62,
17015,
62,
265,
62,
2302,
62,
2978,
844,
62,
42172,
1343,
4704,
62,
2502,
37796,
62,
1851,
62,
41255,
198,
220,
220,
220,
1267,
628,
220,
220,
220,
1303,
1649,
1688,
45616,
4329,
4833,
621,
262,
409,
353,
62,
1851,
62,
41255,
788,
262,
198,
220,
220,
220,
1303,
7097,
4704,
481,
691,
307,
1115,
2173,
290,
356,
900,
198,
220,
220,
220,
1303,
1070,
62,
400,
6335,
62,
13959,
62,
17015,
62,
265,
62,
10365,
5971,
62,
2302,
62,
2978,
844,
62,
42172,
1303,
284,
657,
290,
198,
220,
220,
220,
1303,
24061,
262,
4704,
6795,
13,
4698,
777,
5917,
262,
19745,
198,
220,
220,
220,
1303,
422,
262,
7097,
8171,
284,
5387,
4755,
481,
307,
1969,
284,
1070,
62,
20063,
590,
198,
220,
220,
220,
1303,
393,
3744,
13,
4091,
1332,
62,
16663,
13,
9078,
393,
1332,
62,
16663,
62,
3605,
13,
9078,
13,
198,
220,
220,
220,
1070,
62,
16663,
62,
13959,
62,
17015,
62,
265,
62,
10365,
5971,
62,
2302,
62,
2978,
844,
62,
42172,
25,
12178,
796,
357,
198,
220,
220,
220,
220,
220,
220,
220,
289,
83,
13,
22478,
62,
8968,
2364,
1220,
362,
198,
220,
220,
220,
1267,
532,
1070,
62,
1851,
62,
41255,
198,
220,
220,
220,
1070,
62,
16663,
62,
18053,
25,
12178,
796,
493,
62,
16663,
62,
18053,
198,
220,
220,
220,
611,
1070,
62,
16663,
62,
13959,
62,
17015,
62,
265,
62,
10365,
5971,
62,
2302,
62,
2978,
844,
62,
42172,
1279,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1070,
62,
16663,
62,
13959,
62,
17015,
62,
265,
62,
10365,
5971,
62,
2302,
62,
2978,
844,
62,
42172,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
1070,
62,
16663,
62,
18053,
796,
1070,
62,
16663,
62,
13959,
62,
17015,
62,
265,
62,
2302,
62,
2978,
844,
62,
42172,
1220,
25706,
62,
71,
9248,
628,
220,
220,
220,
1303,
3601,
7,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
277,
1,
2302,
62,
16663,
62,
18053,
34758,
2302,
62,
16663,
62,
18053,
92,
1070,
62,
400,
71,
62,
265,
62,
68,
11840,
34758,
2302,
62,
16663,
62,
13959,
62,
17015,
62,
265,
62,
2302,
62,
2978,
844,
62,
42172,
92,
1070,
62,
400,
71,
62,
265,
62,
68,
11840,
62,
9541,
62,
83,
18768,
34758,
2302,
62,
16663,
62,
13959,
62,
17015,
62,
265,
62,
2302,
62,
2978,
844,
62,
42172,
62,
9541,
62,
83,
10071,
92,
1070,
62,
400,
71,
62,
265,
62,
2577,
11840,
34758,
2302,
62,
16663,
62,
13959,
62,
17015,
62,
265,
62,
10365,
5971,
62,
2302,
62,
2978,
844,
62,
42172,
36786,
198,
220,
220,
220,
1303,
1267,
628,
220,
220,
220,
1255,
13,
2302,
62,
2978,
844,
274,
796,
17635,
198,
220,
220,
220,
289,
75,
796,
5053,
844,
14749,
7,
198,
220,
220,
220,
220,
220,
220,
220,
16874,
28,
20274,
13,
2302,
62,
2978,
844,
62,
42172,
532,
289,
83,
13,
16663,
62,
2502,
37796,
11,
198,
220,
220,
220,
220,
220,
220,
220,
3076,
89,
62,
28968,
28,
15,
11,
198,
220,
220,
220,
220,
220,
220,
220,
9421,
62,
28968,
10779,
2302,
62,
16663,
62,
13959,
62,
17015,
62,
265,
62,
2302,
62,
2978,
844,
62,
42172,
62,
9541,
62,
83,
10071,
11,
198,
220,
220,
220,
1267,
198,
220,
220,
220,
1255,
13,
2302,
62,
2978,
844,
274,
13,
33295,
7,
18519,
8,
628,
220,
220,
220,
289,
75,
796,
5053,
844,
14749,
7,
198,
220,
220,
220,
220,
220,
220,
220,
16874,
28,
20274,
13,
2302,
62,
2978,
844,
62,
42172,
532,
289,
83,
13,
16663,
62,
2502,
37796,
11,
198,
220,
220,
220,
220,
220,
220,
220,
3076,
89,
62,
28968,
28,
15,
11,
198,
220,
220,
220,
220,
220,
220,
220,
9421,
62,
28968,
28,
10,
2302,
62,
16663,
62,
13959,
62,
17015,
62,
265,
62,
2302,
62,
2978,
844,
62,
42172,
62,
9541,
62,
83,
10071,
11,
198,
220,
220,
220,
1267,
198,
220,
220,
220,
1255,
13,
2302,
62,
2978,
844,
274,
13,
33295,
7,
18519,
8,
628,
220,
220,
220,
289,
75,
796,
5053,
844,
14749,
7,
198,
220,
220,
220,
220,
220,
220,
220,
16874,
28,
20274,
13,
2302,
62,
2978,
844,
62,
42172,
11,
198,
220,
220,
220,
220,
220,
220,
220,
3076,
89,
62,
28968,
28,
2302,
62,
16663,
62,
18053,
11,
198,
220,
220,
220,
220,
220,
220,
220,
9421,
62,
28968,
28,
10,
2302,
62,
16663,
62,
13959,
62,
17015,
62,
265,
62,
10365,
5971,
62,
2302,
62,
2978,
844,
62,
42172,
11,
198,
220,
220,
220,
1267,
198,
220,
220,
220,
1255,
13,
2302,
62,
2978,
844,
274,
13,
33295,
7,
18519,
8,
628,
220,
220,
220,
611,
1070,
62,
16663,
62,
13959,
62,
17015,
62,
265,
62,
10365,
5971,
62,
2302,
62,
2978,
844,
62,
42172,
1875,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
289,
75,
796,
5053,
844,
14749,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16874,
28,
20274,
13,
2302,
62,
2978,
844,
62,
42172,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3076,
89,
62,
28968,
28,
2302,
62,
16663,
62,
18053,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9421,
62,
28968,
10779,
2302,
62,
16663,
62,
13959,
62,
17015,
62,
265,
62,
10365,
5971,
62,
2302,
62,
2978,
844,
62,
42172,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
13,
2302,
62,
2978,
844,
274,
13,
33295,
7,
18519,
8,
628,
220,
220,
220,
1441,
1255,
198
] | 2.432936 | 3,273 |
from .transparentTimer import TransparentTimer | [
6738,
764,
7645,
8000,
48801,
1330,
3602,
8000,
48801
] | 5.111111 | 9 |
import pytest
# Create your tests here.
from restapi.models import Organism, Repeat
@pytest.fixture
@pytest.mark.django_db
def test_model_can_create_an_organism(organism):
"""Test the organism model can create an Organism."""
old_count = Organism.objects.count()
organism.save()
new_count = Organism.objects.count()
assert old_count != new_count
@pytest.fixture
@pytest.mark.django_db
def test_model_can_create_a_repeat(repeat):
"""Test the repeat model can create an Repeat."""
old_count = Repeat.objects.count()
repeat.save()
new_count = Repeat.objects.count()
assert old_count != new_count
| [
11748,
12972,
9288,
198,
198,
2,
13610,
534,
5254,
994,
13,
198,
6738,
1334,
15042,
13,
27530,
1330,
7221,
1042,
11,
30021,
628,
198,
31,
9078,
9288,
13,
69,
9602,
628,
198,
31,
9078,
9288,
13,
4102,
13,
28241,
14208,
62,
9945,
198,
4299,
1332,
62,
19849,
62,
5171,
62,
17953,
62,
272,
62,
9971,
1042,
7,
9971,
1042,
2599,
198,
220,
220,
220,
37227,
14402,
262,
26433,
2746,
460,
2251,
281,
7221,
1042,
526,
15931,
198,
220,
220,
220,
1468,
62,
9127,
796,
7221,
1042,
13,
48205,
13,
9127,
3419,
198,
220,
220,
220,
26433,
13,
21928,
3419,
198,
220,
220,
220,
649,
62,
9127,
796,
7221,
1042,
13,
48205,
13,
9127,
3419,
198,
220,
220,
220,
6818,
1468,
62,
9127,
14512,
649,
62,
9127,
628,
198,
31,
9078,
9288,
13,
69,
9602,
628,
198,
31,
9078,
9288,
13,
4102,
13,
28241,
14208,
62,
9945,
198,
4299,
1332,
62,
19849,
62,
5171,
62,
17953,
62,
64,
62,
44754,
7,
44754,
2599,
198,
220,
220,
220,
37227,
14402,
262,
9585,
2746,
460,
2251,
281,
30021,
526,
15931,
198,
220,
220,
220,
1468,
62,
9127,
796,
30021,
13,
48205,
13,
9127,
3419,
198,
220,
220,
220,
9585,
13,
21928,
3419,
198,
220,
220,
220,
649,
62,
9127,
796,
30021,
13,
48205,
13,
9127,
3419,
198,
220,
220,
220,
6818,
1468,
62,
9127,
14512,
649,
62,
9127,
198
] | 2.840708 | 226 |
import logging
import os
from clustertools import set_stdout_logging, ParameterSet, Experiment
from clustertools.storage import PickleStorage
from generic_threshold import TuneThresholdComputation
from train_monuseg_selftrain_clustertools import env_parser
if __name__ == "__main__":
import sys
main(sys.argv[1:])
| [
11748,
18931,
198,
11748,
28686,
198,
198,
6738,
32966,
861,
10141,
1330,
900,
62,
19282,
448,
62,
6404,
2667,
11,
25139,
2357,
7248,
11,
29544,
198,
6738,
32966,
861,
10141,
13,
35350,
1330,
12346,
293,
31425,
198,
198,
6738,
14276,
62,
400,
10126,
1330,
42587,
817,
10126,
5377,
1996,
341,
198,
6738,
4512,
62,
2144,
1904,
70,
62,
741,
701,
3201,
62,
565,
436,
861,
10141,
1330,
17365,
62,
48610,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1330,
25064,
628,
220,
220,
220,
1388,
7,
17597,
13,
853,
85,
58,
16,
25,
12962,
198
] | 3.142857 | 105 |
import sys
from PyQt5.QtCore import QUrl
from PyQt5.QtWebEngineWidgets import QWebEngineView
from PyQt5.QtWidgets import QApplication
from ytdl_gui import host, port
| [
11748,
25064,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
14055,
1330,
1195,
28165,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
13908,
13798,
54,
312,
11407,
1330,
1195,
13908,
13798,
7680,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
54,
312,
11407,
1330,
1195,
23416,
198,
6738,
331,
8671,
75,
62,
48317,
1330,
2583,
11,
2493,
628
] | 2.737705 | 61 |
import lmdb
import numpy as np
import cv2 as cv
from itertools import islice
import time
import os
from os.path import sep as path_sep
from os.path import join as path_join
import torch
import torch.nn as nn
import torchvision
path = '/home/xfz/Projects/PycharmProjects/TextRecognitionDataGenerator-master/trdg/out'
f_nameList = os.listdir(path)
for n in f_nameList:
n_ = n.replace(' ', '')
n = os.path.join(path, n)
n_ = os.path.join(path, n_)
os.rename(n, n_)
print(n, '===>', n_)
###################################################
import models.crnn as crnn
with open('data/en.alphabet', encoding='utf-8') as f:
alphabet = f.read().strip()
net_crnn = crnn.CRNN_ocr34(32, 3, len(alphabet) + 1, 256, d_bug='maxpool', rudc=False).to('cuda').eval()
# net_crnn = crnn.CRNN(32, 3, len(alphabet) + 1, 256).to('cuda').eval()
net_crnn = net_crnn.cnn
x = torch.rand([100, 3, 32, 128]).cuda()
with torch.no_grad():
y = net_crnn(x)
torch.cuda.synchronize()
t1 = time.time()
for _ in range(10):
y = net_crnn(x)
torch.cuda.synchronize()
print('time: ', time.time() - t1)
raise ValueError
##################################################################
filepath = './data/lmdb_5w'
# filepath = '../../datas/aug240w'
outroot = path_join(*filepath.rsplit(path_sep, 1)) + '_img'
outroot = outroot.replace('lmdb_5w', 'lmdb_2w')
# assert not os.path.exists(outroot)
# os.makedirs(outroot)
# os.makedirs(path_join(outroot, 'images'))
# ### 读取LMDB数据集中图片并显示出来,验证一下数据集是否制作成功
val_num = 10
with lmdb.open(filepath) as env, open(path_join(outroot, 'train.txt'), 'w', encoding='utf-8') as f:
txn = env.begin()
# for key, value in islice(txn.cursor(), val_num):
for i, (key, value) in enumerate(txn.cursor(), start=30000):
imageBuf = np.fromstring(value, dtype=np.uint8)
img = cv.imdecode(imageBuf, cv.IMREAD_GRAYSCALE)
if img is not None:
# 得到图片对应 label
key_ = key.decode().replace('image', 'label', 1).encode()
label = txn.get(key_).decode()
################################
# 保存图片
cv.imwrite(path_join(outroot, 'images', str(i)) + '.png', img)
# 保存label
l = str(i) + '.png' + ' ' + label
f.writelines(l + '\n')
#################################
# print(label)
# 显示图片
# cv.imshow('image', img)
# cv.waitKey()
else: # 标签数据,不处理
pass
# print('key: %s label: %s' % (key, value))
| [
11748,
300,
9132,
65,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
17,
355,
269,
85,
198,
6738,
340,
861,
10141,
1330,
318,
75,
501,
198,
11748,
640,
198,
198,
11748,
28686,
198,
6738,
28686,
13,
6978,
1330,
41767,
355,
3108,
62,
325,
79,
198,
6738,
28686,
13,
6978,
1330,
4654,
355,
3108,
62,
22179,
198,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
10178,
628,
198,
6978,
796,
31051,
11195,
14,
26152,
89,
14,
16775,
82,
14,
20519,
354,
1670,
16775,
82,
14,
8206,
6690,
2360,
653,
6601,
8645,
1352,
12,
9866,
14,
2213,
67,
70,
14,
448,
6,
198,
69,
62,
3672,
8053,
796,
28686,
13,
4868,
15908,
7,
6978,
8,
198,
1640,
299,
287,
277,
62,
3672,
8053,
25,
198,
220,
220,
220,
299,
62,
796,
299,
13,
33491,
10786,
46083,
10148,
8,
198,
220,
220,
220,
299,
796,
28686,
13,
6978,
13,
22179,
7,
6978,
11,
299,
8,
198,
220,
220,
220,
299,
62,
796,
28686,
13,
6978,
13,
22179,
7,
6978,
11,
299,
62,
8,
198,
220,
220,
220,
28686,
13,
918,
480,
7,
77,
11,
299,
62,
8,
198,
220,
220,
220,
3601,
7,
77,
11,
705,
855,
14804,
3256,
299,
62,
8,
628,
198,
29113,
14468,
21017,
198,
11748,
4981,
13,
6098,
20471,
355,
1067,
20471,
198,
4480,
1280,
10786,
7890,
14,
268,
13,
17307,
8380,
3256,
21004,
11639,
40477,
12,
23,
11537,
355,
277,
25,
198,
220,
220,
220,
24830,
796,
277,
13,
961,
22446,
36311,
3419,
198,
198,
3262,
62,
6098,
20471,
796,
1067,
20471,
13,
9419,
6144,
62,
1696,
2682,
7,
2624,
11,
513,
11,
18896,
7,
17307,
8380,
8,
1343,
352,
11,
17759,
11,
288,
62,
25456,
11639,
9806,
7742,
3256,
28906,
66,
28,
25101,
737,
1462,
10786,
66,
15339,
27691,
18206,
3419,
198,
2,
2010,
62,
6098,
20471,
796,
1067,
20471,
13,
9419,
6144,
7,
2624,
11,
513,
11,
18896,
7,
17307,
8380,
8,
1343,
352,
11,
17759,
737,
1462,
10786,
66,
15339,
27691,
18206,
3419,
198,
198,
3262,
62,
6098,
20471,
796,
2010,
62,
6098,
20471,
13,
66,
20471,
198,
87,
796,
28034,
13,
25192,
26933,
3064,
11,
513,
11,
3933,
11,
13108,
35944,
66,
15339,
3419,
198,
198,
4480,
28034,
13,
3919,
62,
9744,
33529,
198,
220,
220,
220,
331,
796,
2010,
62,
6098,
20471,
7,
87,
8,
628,
220,
220,
220,
28034,
13,
66,
15339,
13,
28869,
11413,
1096,
3419,
198,
220,
220,
220,
256,
16,
796,
640,
13,
2435,
3419,
198,
220,
220,
220,
329,
4808,
287,
2837,
7,
940,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
331,
796,
2010,
62,
6098,
20471,
7,
87,
8,
198,
220,
220,
220,
28034,
13,
66,
15339,
13,
28869,
11413,
1096,
3419,
198,
220,
220,
220,
3601,
10786,
2435,
25,
46083,
640,
13,
2435,
3419,
532,
256,
16,
8,
198,
198,
40225,
11052,
12331,
198,
198,
29113,
29113,
2235,
628,
198,
198,
7753,
6978,
796,
705,
19571,
7890,
14,
75,
9132,
65,
62,
20,
86,
6,
198,
2,
2393,
6978,
796,
705,
40720,
40720,
19608,
292,
14,
7493,
16102,
86,
6,
198,
198,
448,
15763,
796,
3108,
62,
22179,
46491,
7753,
6978,
13,
3808,
489,
270,
7,
6978,
62,
325,
79,
11,
352,
4008,
1343,
705,
62,
9600,
6,
198,
448,
15763,
796,
503,
15763,
13,
33491,
10786,
75,
9132,
65,
62,
20,
86,
3256,
705,
75,
9132,
65,
62,
17,
86,
11537,
198,
2,
6818,
407,
28686,
13,
6978,
13,
1069,
1023,
7,
448,
15763,
8,
198,
2,
28686,
13,
76,
4335,
17062,
7,
448,
15763,
8,
198,
2,
28686,
13,
76,
4335,
17062,
7,
6978,
62,
22179,
7,
448,
15763,
11,
705,
17566,
6,
4008,
198,
2,
44386,
5525,
107,
119,
20998,
244,
31288,
11012,
46763,
108,
162,
235,
106,
37239,
228,
40792,
32368,
122,
31965,
229,
33176,
114,
23626,
122,
163,
97,
118,
49035,
118,
30266,
98,
171,
120,
234,
165,
103,
234,
46237,
223,
31660,
10310,
233,
46763,
108,
162,
235,
106,
37239,
228,
42468,
28938,
99,
26344,
114,
43291,
22755,
238,
27950,
253,
198,
2100,
62,
22510,
796,
838,
198,
4480,
300,
9132,
65,
13,
9654,
7,
7753,
6978,
8,
355,
17365,
11,
1280,
7,
6978,
62,
22179,
7,
448,
15763,
11,
705,
27432,
13,
14116,
33809,
705,
86,
3256,
21004,
11639,
40477,
12,
23,
11537,
355,
277,
25,
198,
220,
220,
220,
27765,
77,
796,
17365,
13,
27471,
3419,
198,
220,
220,
220,
1303,
329,
1994,
11,
1988,
287,
318,
75,
501,
7,
17602,
77,
13,
66,
21471,
22784,
1188,
62,
22510,
2599,
198,
220,
220,
220,
329,
1312,
11,
357,
2539,
11,
1988,
8,
287,
27056,
378,
7,
17602,
77,
13,
66,
21471,
22784,
923,
28,
18,
2388,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
2939,
33,
3046,
796,
45941,
13,
6738,
8841,
7,
8367,
11,
288,
4906,
28,
37659,
13,
28611,
23,
8,
198,
220,
220,
220,
220,
220,
220,
220,
33705,
796,
269,
85,
13,
320,
12501,
1098,
7,
9060,
33,
3046,
11,
269,
85,
13,
3955,
15675,
62,
38,
30631,
6173,
21358,
8,
198,
220,
220,
220,
220,
220,
220,
220,
611,
33705,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
10263,
122,
245,
26344,
108,
32368,
122,
31965,
229,
43380,
117,
41753,
242,
6167,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1994,
62,
796,
1994,
13,
12501,
1098,
22446,
33491,
10786,
9060,
3256,
705,
18242,
3256,
352,
737,
268,
8189,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6167,
796,
27765,
77,
13,
1136,
7,
2539,
62,
737,
12501,
1098,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
14468,
7804,
4242,
21017,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
46479,
251,
27764,
246,
32368,
122,
31965,
229,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
85,
13,
320,
13564,
7,
6978,
62,
22179,
7,
448,
15763,
11,
705,
17566,
3256,
965,
7,
72,
4008,
1343,
45302,
11134,
3256,
33705,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
46479,
251,
27764,
246,
18242,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
796,
965,
7,
72,
8,
1343,
45302,
11134,
6,
1343,
705,
705,
1343,
6167,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
13,
8933,
20655,
7,
75,
1343,
705,
59,
77,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
29113,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
3601,
7,
18242,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
10545,
246,
122,
163,
97,
118,
32368,
122,
31965,
229,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
269,
85,
13,
320,
12860,
10786,
9060,
3256,
33705,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
269,
85,
13,
17077,
9218,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
220,
1303,
10545,
254,
229,
163,
255,
122,
46763,
108,
162,
235,
106,
171,
120,
234,
38834,
13783,
226,
49426,
228,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1208,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
3601,
10786,
2539,
25,
4064,
82,
220,
220,
220,
6167,
25,
4064,
82,
6,
4064,
357,
2539,
11,
1988,
4008,
628,
628,
628,
628,
628,
628,
198
] | 2.043582 | 1,262 |
import youtube_dl
import datetime
import threading
import requests
import re
import time
import os
threads = [] # all threads list
tasks_list = [] # all tasks list
def start_received_request_action(data):
"""
Main function which extract task type and start proper action. Then return response.
:param data:
:return: response string
"""
if data["action"] == "check_status":
dictionary = get_status_of_all_tasks()
if dictionary:
return get_status_of_all_tasks()
else:
return {"response": "No task in process"}
elif data["action"] == "download_request":
tasks_list.append(Task(data))
response = tasks_list[-1].response
if not tasks_list[-1].download_started:
os.remove(tasks_list[-1].download_dir + tasks_list[-1].filename + '.' + tasks_list[-1].extension)
del tasks_list[-1]
return response
else:
return {"response": "Invalid request action data"}
def get_status_of_all_tasks():
"""
Function which get information about all actual processed tasks.
:return: dictionary containing information about all actual processed tasks
"""
response = dict()
for task in tasks_list:
if not task.finish:
response.update(task.get_task_data())
else:
del task
return response
| [
11748,
35116,
62,
25404,
198,
11748,
4818,
8079,
198,
11748,
4704,
278,
198,
11748,
7007,
198,
11748,
302,
198,
11748,
640,
198,
11748,
28686,
198,
198,
16663,
82,
796,
17635,
220,
1303,
477,
14390,
1351,
198,
83,
6791,
62,
4868,
796,
17635,
220,
1303,
477,
8861,
1351,
628,
198,
4299,
923,
62,
47844,
62,
25927,
62,
2673,
7,
7890,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
8774,
2163,
543,
7925,
4876,
2099,
290,
923,
1774,
2223,
13,
3244,
1441,
2882,
13,
628,
220,
220,
220,
1058,
17143,
1366,
25,
198,
220,
220,
220,
1058,
7783,
25,
2882,
4731,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
611,
1366,
14692,
2673,
8973,
6624,
366,
9122,
62,
13376,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
22155,
796,
651,
62,
13376,
62,
1659,
62,
439,
62,
83,
6791,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
611,
22155,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
651,
62,
13376,
62,
1659,
62,
439,
62,
83,
6791,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
19779,
26209,
1298,
366,
2949,
4876,
287,
1429,
20662,
198,
220,
220,
220,
1288,
361,
1366,
14692,
2673,
8973,
6624,
366,
15002,
62,
25927,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
8861,
62,
4868,
13,
33295,
7,
25714,
7,
7890,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
2882,
796,
8861,
62,
4868,
58,
12,
16,
4083,
26209,
198,
220,
220,
220,
220,
220,
220,
220,
611,
407,
8861,
62,
4868,
58,
12,
16,
4083,
15002,
62,
46981,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
28686,
13,
28956,
7,
83,
6791,
62,
4868,
58,
12,
16,
4083,
15002,
62,
15908,
1343,
8861,
62,
4868,
58,
12,
16,
4083,
34345,
1343,
705,
2637,
1343,
8861,
62,
4868,
58,
12,
16,
4083,
2302,
3004,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1619,
8861,
62,
4868,
58,
12,
16,
60,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2882,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
19779,
26209,
1298,
366,
44651,
2581,
2223,
1366,
20662,
628,
198,
4299,
651,
62,
13376,
62,
1659,
62,
439,
62,
83,
6791,
33529,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
15553,
543,
651,
1321,
546,
477,
4036,
13686,
8861,
13,
628,
220,
220,
220,
1058,
7783,
25,
22155,
7268,
1321,
546,
477,
4036,
13686,
8861,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
2882,
796,
8633,
3419,
198,
220,
220,
220,
329,
4876,
287,
8861,
62,
4868,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
407,
4876,
13,
15643,
680,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2882,
13,
19119,
7,
35943,
13,
1136,
62,
35943,
62,
7890,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1619,
4876,
198,
220,
220,
220,
1441,
2882,
628
] | 2.611742 | 528 |
from tensorflow import keras
import matplotlib.pyplot as plt
from sklearn.linear_model import SGDClassifier
from sklearn.model_selection import cross_validate
import numpy as np
from sklearn.model_selection import train_test_split
(train_input, train_target), (test_input, test_target) =\
keras.datasets.fashion_mnist.load_data()
print(train_input.shape, train_target.shape)
print(test_input.shape, test_target.shape)
fig, axs = plt.subplots(1, 10, figsize=(10, 10))
for i in range(10):
axs[i].imshow(train_input[i], cmap='gray_r')
axs[i].axis('off')
plt.show()
print([train_target[i] for i in range(10)])
print(np.unique(train_target, return_counts=True))
train_scaled = train_input / 255.0
train_scaled = train_scaled.reshape(-1, 28*28)
print(train_scaled.shape)
sc = SGDClassifier(loss='log', max_iter=5, random_state=42)
scores = cross_validate(sc, train_scaled, train_target, n_jobs=-1)
print(np.mean(scores['test_score']))
# 인공 신경망
train_scaled, val_scaled, train_target, val_target =\
train_test_split(train_scaled, train_target, test_size=0.2, random_state=42)
print(train_scaled.shape, train_target.shape)
print(val_scaled.shape, val_target.shape)
dense = keras.layers.Dense(10, activation='softmax', input_shape=(784,))
model = keras.Sequential(dense)
print(train_target[:10])
model.compile(loss='sparse_categorical_crossentropy', metrics='accuracy')
model.fit(train_scaled, train_target, epochs=5)
model.evaluate(val_scaled, val_target)
| [
6738,
11192,
273,
11125,
1330,
41927,
292,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
1341,
35720,
13,
29127,
62,
19849,
1330,
26147,
35,
9487,
7483,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
3272,
62,
12102,
378,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
4512,
62,
9288,
62,
35312,
628,
198,
7,
27432,
62,
15414,
11,
4512,
62,
16793,
828,
357,
9288,
62,
15414,
11,
1332,
62,
16793,
8,
796,
59,
198,
220,
220,
220,
41927,
292,
13,
19608,
292,
1039,
13,
25265,
62,
10295,
396,
13,
2220,
62,
7890,
3419,
198,
4798,
7,
27432,
62,
15414,
13,
43358,
11,
4512,
62,
16793,
13,
43358,
8,
198,
4798,
7,
9288,
62,
15414,
13,
43358,
11,
1332,
62,
16793,
13,
43358,
8,
198,
198,
5647,
11,
7877,
82,
796,
458,
83,
13,
7266,
489,
1747,
7,
16,
11,
838,
11,
2336,
7857,
16193,
940,
11,
838,
4008,
198,
1640,
1312,
287,
2837,
7,
940,
2599,
198,
220,
220,
220,
7877,
82,
58,
72,
4083,
320,
12860,
7,
27432,
62,
15414,
58,
72,
4357,
269,
8899,
11639,
44605,
62,
81,
11537,
198,
220,
220,
220,
7877,
82,
58,
72,
4083,
22704,
10786,
2364,
11537,
198,
489,
83,
13,
12860,
3419,
198,
198,
4798,
26933,
27432,
62,
16793,
58,
72,
60,
329,
1312,
287,
2837,
7,
940,
8,
12962,
198,
198,
4798,
7,
37659,
13,
34642,
7,
27432,
62,
16793,
11,
1441,
62,
9127,
82,
28,
17821,
4008,
198,
198,
27432,
62,
1416,
3021,
796,
4512,
62,
15414,
1220,
14280,
13,
15,
198,
27432,
62,
1416,
3021,
796,
4512,
62,
1416,
3021,
13,
3447,
1758,
32590,
16,
11,
2579,
9,
2078,
8,
198,
4798,
7,
27432,
62,
1416,
3021,
13,
43358,
8,
198,
198,
1416,
796,
26147,
35,
9487,
7483,
7,
22462,
11639,
6404,
3256,
3509,
62,
2676,
28,
20,
11,
4738,
62,
5219,
28,
3682,
8,
198,
1416,
2850,
796,
3272,
62,
12102,
378,
7,
1416,
11,
4512,
62,
1416,
3021,
11,
4512,
62,
16793,
11,
299,
62,
43863,
10779,
16,
8,
198,
4798,
7,
37659,
13,
32604,
7,
1416,
2850,
17816,
9288,
62,
26675,
20520,
4008,
198,
198,
2,
23821,
251,
116,
166,
111,
113,
23821,
233,
254,
166,
110,
121,
167,
100,
251,
198,
27432,
62,
1416,
3021,
11,
1188,
62,
1416,
3021,
11,
4512,
62,
16793,
11,
1188,
62,
16793,
796,
59,
198,
220,
220,
220,
4512,
62,
9288,
62,
35312,
7,
27432,
62,
1416,
3021,
11,
4512,
62,
16793,
11,
1332,
62,
7857,
28,
15,
13,
17,
11,
4738,
62,
5219,
28,
3682,
8,
198,
4798,
7,
27432,
62,
1416,
3021,
13,
43358,
11,
4512,
62,
16793,
13,
43358,
8,
198,
4798,
7,
2100,
62,
1416,
3021,
13,
43358,
11,
1188,
62,
16793,
13,
43358,
8,
198,
198,
67,
1072,
796,
41927,
292,
13,
75,
6962,
13,
35,
1072,
7,
940,
11,
14916,
11639,
4215,
9806,
3256,
5128,
62,
43358,
16193,
37688,
11,
4008,
198,
198,
19849,
796,
41927,
292,
13,
44015,
1843,
7,
67,
1072,
8,
198,
198,
4798,
7,
27432,
62,
16793,
58,
25,
940,
12962,
198,
198,
19849,
13,
5589,
576,
7,
22462,
11639,
82,
29572,
62,
66,
2397,
12409,
62,
19692,
298,
28338,
3256,
20731,
11639,
4134,
23843,
11537,
198,
19849,
13,
11147,
7,
27432,
62,
1416,
3021,
11,
4512,
62,
16793,
11,
36835,
82,
28,
20,
8,
198,
19849,
13,
49786,
7,
2100,
62,
1416,
3021,
11,
1188,
62,
16793,
8,
628,
198
] | 2.570435 | 575 |
from unittest import mock
import decimal
from webob.multidict import MultiDict
from pyramid.compat import text_type, NativeIO
import ptah.form
from ptah.form import iso8601
from ptah.testing import strip, BaseTestCase
| [
6738,
555,
715,
395,
1330,
15290,
198,
11748,
32465,
198,
6738,
3992,
672,
13,
16680,
312,
713,
1330,
15237,
35,
713,
198,
6738,
27944,
13,
5589,
265,
1330,
2420,
62,
4906,
11,
12547,
9399,
198,
198,
11748,
42975,
993,
13,
687,
198,
6738,
42975,
993,
13,
687,
1330,
47279,
4521,
486,
198,
198,
6738,
42975,
993,
13,
33407,
1330,
10283,
11,
7308,
14402,
20448,
628,
628,
628,
628,
628,
628,
628,
628,
198
] | 3.232877 | 73 |
# Copyright (c) 2021, Moritz E. Beber.
#
# 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.
"""Provide a service that trims samples based on smoothed Phred quality."""
from typing import Tuple
import numpy as np
from plasmid_verification.domain.model import Sample
from plasmid_verification.domain.service import SampleTrimmingService
class ErrorProbabilitySampleTrimmingService(SampleTrimmingService):
"""Define a service that trims samples based on the smoothed Phred quality."""
@classmethod
def trim(
cls,
sample: Sample,
*,
prefix: str = "",
suffix: str = "_trimmed",
cutoff: float = 0.05,
**kwargs,
) -> Tuple[Sample, int, int, np.ndarray]:
"""
Trim a sequencing sample based on the smoothed quality values and a threshold.
Implement Richard Mott's alternative trimming method for finding the
maximum scoring subsequence. Please see `-trim_alt` at the following link for
more information:
http://www.phrap.org/phredphrap/phred.html
Args:
sample: A sequencing sample.
prefix:
suffix:
cutoff:
**kwargs:
Returns:
tuple:
Sample: The trimmed sequencing sample.
int: The start position of the trimmed sequence with respect to the
original sample.
int: The end position of the trimmed sequence with respect to the
original sample.
numpy.ndarray: The scores used by the trimming method.
"""
# Transform the quality values back to error probabilities.
transform = cutoff - np.power(10.0, sample.phred_quality / -10.0)
scores = cls.clamped_cumulative_sum(transform)
start, end = cls.find_max_scoring_subsequence(scores)
return (
Sample(
identifier=f"{prefix}{sample.identifier}{suffix}",
sequence=sample.sequence[start:end],
phred_quality=sample.phred_quality[start:end],
),
start,
end,
scores,
)
@classmethod
def clamped_cumulative_sum(cls, values: np.ndarray) -> np.ndarray:
"""
Compute the cumulative sum of the given values but clamp the minimum at zero.
Args:
values: The vector of values to sum up.
Returns:
Cumulative sum of the given values but sums below zero are clamped to zero.
"""
result = np.zeros_like(values)
for idx in range(1, len(result)):
result[idx] = result[idx - 1] + values[idx]
if result[idx] < 0.0:
result[idx] = 0.0
return result
@classmethod
| [
2,
15069,
357,
66,
8,
33448,
11,
3461,
4224,
412,
13,
1355,
527,
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,
628,
198,
37811,
15946,
485,
257,
2139,
326,
491,
12078,
8405,
1912,
319,
32746,
704,
1380,
445,
3081,
526,
15931,
198,
198,
6738,
19720,
1330,
309,
29291,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
458,
8597,
312,
62,
332,
2649,
13,
27830,
13,
19849,
1330,
27565,
198,
6738,
458,
8597,
312,
62,
332,
2649,
13,
27830,
13,
15271,
1330,
27565,
2898,
27428,
16177,
628,
198,
4871,
13047,
2964,
65,
1799,
36674,
2898,
27428,
16177,
7,
36674,
2898,
27428,
16177,
2599,
198,
220,
220,
220,
37227,
7469,
500,
257,
2139,
326,
491,
12078,
8405,
1912,
319,
262,
32746,
704,
1380,
445,
3081,
526,
15931,
628,
220,
220,
220,
2488,
4871,
24396,
198,
220,
220,
220,
825,
15797,
7,
198,
220,
220,
220,
220,
220,
220,
220,
537,
82,
11,
198,
220,
220,
220,
220,
220,
220,
220,
6291,
25,
27565,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1635,
11,
198,
220,
220,
220,
220,
220,
220,
220,
21231,
25,
965,
796,
366,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
35488,
25,
965,
796,
45434,
2213,
320,
1150,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
45616,
25,
12178,
796,
657,
13,
2713,
11,
198,
220,
220,
220,
220,
220,
220,
220,
12429,
46265,
22046,
11,
198,
220,
220,
220,
1267,
4613,
309,
29291,
58,
36674,
11,
493,
11,
493,
11,
45941,
13,
358,
18747,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
833,
320,
257,
32841,
6291,
1912,
319,
262,
32746,
704,
3081,
3815,
290,
257,
11387,
13,
628,
220,
220,
220,
220,
220,
220,
220,
48282,
6219,
337,
1252,
338,
5559,
15797,
2229,
2446,
329,
4917,
262,
198,
220,
220,
220,
220,
220,
220,
220,
5415,
9689,
6399,
594,
13,
4222,
766,
4600,
12,
2213,
320,
62,
2501,
63,
379,
262,
1708,
2792,
329,
198,
220,
220,
220,
220,
220,
220,
220,
517,
1321,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2638,
1378,
2503,
13,
746,
2416,
13,
2398,
14,
746,
445,
746,
2416,
14,
746,
445,
13,
6494,
628,
220,
220,
220,
220,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6291,
25,
317,
32841,
6291,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21231,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
35488,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45616,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12429,
46265,
22046,
25,
628,
220,
220,
220,
220,
220,
220,
220,
16409,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
46545,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27565,
25,
383,
40325,
32841,
6291,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
493,
25,
383,
923,
2292,
286,
262,
40325,
8379,
351,
2461,
284,
262,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2656,
6291,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
493,
25,
383,
886,
2292,
286,
262,
40325,
8379,
351,
2461,
284,
262,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2656,
6291,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
299,
32152,
13,
358,
18747,
25,
383,
8198,
973,
416,
262,
15797,
2229,
2446,
13,
628,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
26981,
262,
3081,
3815,
736,
284,
4049,
39522,
13,
198,
220,
220,
220,
220,
220,
220,
220,
6121,
796,
45616,
532,
45941,
13,
6477,
7,
940,
13,
15,
11,
6291,
13,
746,
445,
62,
13237,
1220,
532,
940,
13,
15,
8,
198,
220,
220,
220,
220,
220,
220,
220,
8198,
796,
537,
82,
13,
565,
13322,
62,
36340,
13628,
62,
16345,
7,
35636,
8,
198,
220,
220,
220,
220,
220,
220,
220,
923,
11,
886,
796,
537,
82,
13,
19796,
62,
9806,
62,
46536,
62,
7266,
43167,
7,
1416,
2850,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27565,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27421,
28,
69,
1,
90,
40290,
18477,
39873,
13,
738,
7483,
18477,
37333,
844,
92,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8379,
28,
39873,
13,
43167,
58,
9688,
25,
437,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
872,
445,
62,
13237,
28,
39873,
13,
746,
445,
62,
13237,
58,
9688,
25,
437,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10612,
198,
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,
886,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8198,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
2488,
4871,
24396,
198,
220,
220,
220,
825,
537,
13322,
62,
36340,
13628,
62,
16345,
7,
565,
82,
11,
3815,
25,
45941,
13,
358,
18747,
8,
4613,
45941,
13,
358,
18747,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
3082,
1133,
262,
23818,
2160,
286,
262,
1813,
3815,
475,
29405,
262,
5288,
379,
6632,
13,
628,
220,
220,
220,
220,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3815,
25,
383,
15879,
286,
3815,
284,
2160,
510,
13,
628,
220,
220,
220,
220,
220,
220,
220,
16409,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27843,
13628,
2160,
286,
262,
1813,
3815,
475,
21784,
2174,
6632,
389,
537,
13322,
284,
6632,
13,
628,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
45941,
13,
9107,
418,
62,
2339,
7,
27160,
8,
198,
220,
220,
220,
220,
220,
220,
220,
329,
4686,
87,
287,
2837,
7,
16,
11,
18896,
7,
20274,
8,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
58,
312,
87,
60,
796,
1255,
58,
312,
87,
532,
352,
60,
1343,
3815,
58,
312,
87,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
1255,
58,
312,
87,
60,
1279,
657,
13,
15,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
58,
312,
87,
60,
796,
657,
13,
15,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
1255,
628,
220,
220,
220,
2488,
4871,
24396,
198
] | 2.441809 | 1,349 |
import requests
req_url = "https://www.chinaamc.com/indexfundvalue.js"
response = requests.get(req_url)
print(response.apparent_encoding)
response.encoding = "UTF-8"
print(response.text) | [
11748,
7007,
628,
198,
42180,
62,
6371,
796,
366,
5450,
1378,
2503,
13,
354,
1437,
321,
66,
13,
785,
14,
9630,
10990,
8367,
13,
8457,
1,
198,
198,
26209,
796,
7007,
13,
1136,
7,
42180,
62,
6371,
8,
198,
4798,
7,
26209,
13,
1324,
1580,
62,
12685,
7656,
8,
198,
26209,
13,
12685,
7656,
796,
366,
48504,
12,
23,
1,
198,
198,
4798,
7,
26209,
13,
5239,
8
] | 2.794118 | 68 |
#!/usr/bin/env python
'''
Copyright (c) 2020 Modul 9/HiFiBerry
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.
'''
# !/usr/bin/env python
import sys
import logging
from math import sqrt, log
from struct import unpack_from
import os
import alsaaudio
output_stopped = True
# Which audio device to use
DEVICE_NAME = 'default'
# The maximum value which can be read from the input device (in other words, the value for maximum volume)
SAMPLE_MAXVAL = 32768
CHANNELS = 2
# Sample rate in samples per second
SAMPLE_RATE = 48000
PERIOD_SIZE = 1024
# The duration of a measurement interval (after which the thresholds will be checked) in seconds.
SAMPLE_SECONDS_BEFORE_CHECK = 0.5
# The number of samples before each check
SAMPLE_COUNT_BEFORE_CHECK = int((SAMPLE_RATE / CHANNELS) * SAMPLE_SECONDS_BEFORE_CHECK)
# The time during which the input threshold hasn't been reached, before output is stopped.
# This is useful for preventing the output device from turning off and on when there is a short silence in the input.
SAMPLE_SECONDS_BEFORE_TURN_OFF = 15
# The number of checks which have to fail before audio is turned off.
CHECK_NUMBER_BEFORE_TURN_OFF = int(SAMPLE_SECONDS_BEFORE_TURN_OFF / SAMPLE_SECONDS_BEFORE_CHECK)
if __name__ == '__main__':
start_db_threshold = 0
stop_db_threshold = 0
try:
start_db_threshold = float(sys.argv[1])
if start_db_threshold > 0:
start_db_threshold = -start_db_threshold
# Define the stop threshold. This prevents hysteresis when the volume fluctuates just around the threshold.
stop_db_threshold = start_db_threshold - 3
print("using alsaloop with input level detection {:.1f} to start, {:.1f} to stop"
.format(start_db_threshold, stop_db_threshold))
except:
print("using alsaloop without input level detection")
input_device = open_sound(output=False)
output_device = None
finished = False
samples = 0
sample_sum = 0
max_sample = 0
status = "-"
rms_volume = 0
input_detected = False
# Counter for subsequent intervals in which the threshold has not been met while playback is active
count_playback_threshold_not_met = 0
while not finished:
# Read data from device
data_length, data = input_device.read()
if data_length < 0:
# Something's wrong when this happens. Just try to read again.
logging.error("?")
continue
if (len(data) % 4) != 0:
# Additional sanity test: If the length isn't a multiple of 4, something's wrong
print("oops %s".format(len(data)))
continue
offset = 0
# Read through the currently captured audio data
while offset < data_length:
try:
# Read the left and right channel from the data packet
(sample_l, sample_r) = unpack_from('<hh', data, offset=offset)
except:
# logging.error("%s %s %s",l,len(data), offset)
# Set a default value of zero so the program can keep running
(sample_l, sample_r) = (0, 0)
offset += 4
samples += 2
# Calculate the sum of all samples squared, used to determine rms later.
sample_sum += sample_l * sample_l + sample_r * sample_r
# Determine the max value of all samples
max_sample = max(max_sample, abs(sample_l), abs(sample_r))
if samples >= SAMPLE_COUNT_BEFORE_CHECK:
# Calculate RMS
rms_volume = sqrt(sample_sum / samples)
# Determine which threshold value to use
if output_stopped:
threshold = start_db_threshold
else:
threshold = stop_db_threshold
# Check if the threshold has been exceeded
if start_db_threshold == 0 or decibel(max_sample) > threshold:
input_detected = True
status = "P"
else:
input_detected = False
status = "-"
print("{} {:.1f} {:.1f}".format(status, decibel(rms_volume), decibel(max_sample)), flush=True)
sample_sum = 0
samples = 0
max_sample = 0
if output_stopped and input_detected:
del input_device
logging.info("Input signal detected, pausing other players")
os.system("/opt/hifiberry/bin/pause-all alsaloop")
(input_device, output_device) = open_sound(output=True)
output_stopped = False
continue
elif not output_stopped and not input_detected:
count_playback_threshold_not_met += 1
logging.info(f"No input signal for {count_playback_threshold_not_met} intervals")
if count_playback_threshold_not_met > CHECK_NUMBER_BEFORE_TURN_OFF:
del input_device
output_device = None
logging.info("Input signal lost, stopping playback")
input_device = open_sound(output=False)
output_stopped = True
continue
if input_detected:
# Reset counter when input detected
count_playback_threshold_not_met = 0
if not output_stopped:
output_device.write(data)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
7061,
6,
198,
15269,
357,
66,
8,
12131,
3401,
377,
860,
14,
17250,
10547,
25215,
198,
198,
5990,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
1659,
428,
3788,
290,
3917,
10314,
3696,
357,
1169,
366,
25423,
12340,
284,
1730,
198,
259,
262,
10442,
1231,
17504,
11,
1390,
1231,
17385,
262,
2489,
198,
1462,
779,
11,
4866,
11,
13096,
11,
20121,
11,
7715,
11,
14983,
11,
850,
43085,
11,
290,
14,
273,
3677,
198,
22163,
444,
286,
262,
10442,
11,
290,
284,
8749,
6506,
284,
4150,
262,
10442,
318,
198,
69,
700,
1348,
284,
466,
523,
11,
2426,
284,
262,
1708,
3403,
25,
198,
198,
464,
2029,
6634,
4003,
290,
428,
7170,
4003,
2236,
307,
3017,
287,
477,
198,
22163,
444,
393,
8904,
16690,
286,
262,
10442,
13,
198,
198,
10970,
47466,
3180,
36592,
2389,
1961,
366,
1921,
3180,
1600,
42881,
34764,
56,
3963,
15529,
509,
12115,
11,
7788,
32761,
6375,
198,
3955,
49094,
11,
47783,
2751,
21728,
5626,
40880,
5390,
3336,
34764,
11015,
3963,
34482,
3398,
1565,
5603,
25382,
11,
198,
37,
46144,
7473,
317,
16652,
2149,
37232,
33079,
48933,
5357,
44521,
1268,
10913,
2751,
12529,
13,
3268,
8005,
49261,
50163,
3336,
198,
32,
24318,
20673,
6375,
27975,
38162,
9947,
367,
15173,
4877,
9348,
43031,
19146,
7473,
15529,
47666,
3955,
11,
29506,
25552,
6375,
25401,
198,
43,
3539,
25382,
11,
7655,
2767,
16879,
3268,
3537,
40282,
3963,
27342,
10659,
11,
309,
9863,
6375,
25401,
54,
24352,
11,
5923,
1797,
2751,
16034,
11,
198,
12425,
3963,
6375,
3268,
7102,
45,
24565,
13315,
3336,
47466,
6375,
3336,
23210,
6375,
25401,
5550,
1847,
20754,
3268,
3336,
198,
15821,
37485,
13,
198,
7061,
6,
198,
198,
2,
5145,
14,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
25064,
198,
11748,
18931,
198,
6738,
10688,
1330,
19862,
17034,
11,
2604,
198,
6738,
2878,
1330,
555,
8002,
62,
6738,
198,
11748,
28686,
198,
198,
11748,
435,
11400,
24051,
198,
198,
22915,
62,
301,
38333,
796,
6407,
198,
198,
2,
9022,
6597,
3335,
284,
779,
198,
7206,
27389,
62,
20608,
796,
705,
12286,
6,
198,
198,
2,
383,
5415,
1988,
543,
460,
307,
1100,
422,
262,
5128,
3335,
357,
259,
584,
2456,
11,
262,
1988,
329,
5415,
6115,
8,
198,
49302,
16437,
62,
22921,
23428,
796,
36203,
3104,
198,
198,
3398,
22846,
37142,
796,
362,
198,
2,
27565,
2494,
287,
8405,
583,
1218,
198,
49302,
16437,
62,
49,
6158,
796,
4764,
830,
198,
18973,
40,
3727,
62,
33489,
796,
28119,
198,
2,
383,
9478,
286,
257,
15558,
16654,
357,
8499,
543,
262,
40885,
481,
307,
10667,
8,
287,
4201,
13,
198,
49302,
16437,
62,
23683,
1340,
5258,
62,
12473,
30818,
62,
50084,
796,
657,
13,
20,
198,
2,
383,
1271,
286,
8405,
878,
1123,
2198,
198,
49302,
16437,
62,
34,
28270,
62,
12473,
30818,
62,
50084,
796,
493,
19510,
49302,
16437,
62,
49,
6158,
1220,
5870,
22846,
37142,
8,
1635,
28844,
16437,
62,
23683,
1340,
5258,
62,
12473,
30818,
62,
50084,
8,
198,
2,
383,
640,
1141,
543,
262,
5128,
11387,
5818,
470,
587,
4251,
11,
878,
5072,
318,
5025,
13,
198,
2,
770,
318,
4465,
329,
12174,
262,
5072,
3335,
422,
6225,
572,
290,
319,
618,
612,
318,
257,
1790,
9550,
287,
262,
5128,
13,
198,
49302,
16437,
62,
23683,
1340,
5258,
62,
12473,
30818,
62,
51,
27064,
62,
27977,
796,
1315,
198,
2,
383,
1271,
286,
8794,
543,
423,
284,
2038,
878,
6597,
318,
2900,
572,
13,
198,
50084,
62,
41359,
13246,
62,
12473,
30818,
62,
51,
27064,
62,
27977,
796,
493,
7,
49302,
16437,
62,
23683,
1340,
5258,
62,
12473,
30818,
62,
51,
27064,
62,
27977,
1220,
28844,
16437,
62,
23683,
1340,
5258,
62,
12473,
30818,
62,
50084,
8,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
628,
220,
220,
220,
923,
62,
9945,
62,
400,
10126,
796,
657,
198,
220,
220,
220,
2245,
62,
9945,
62,
400,
10126,
796,
657,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
923,
62,
9945,
62,
400,
10126,
796,
12178,
7,
17597,
13,
853,
85,
58,
16,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
611,
923,
62,
9945,
62,
400,
10126,
1875,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
923,
62,
9945,
62,
400,
10126,
796,
532,
9688,
62,
9945,
62,
400,
10126,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
2896,
500,
262,
2245,
11387,
13,
770,
15174,
2537,
4169,
411,
271,
618,
262,
6115,
19180,
12632,
655,
1088,
262,
11387,
13,
198,
220,
220,
220,
220,
220,
220,
220,
2245,
62,
9945,
62,
400,
10126,
796,
923,
62,
9945,
62,
400,
10126,
532,
513,
628,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
3500,
435,
82,
7335,
404,
351,
5128,
1241,
13326,
46110,
13,
16,
69,
92,
284,
923,
11,
46110,
13,
16,
69,
92,
284,
2245,
1,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
764,
18982,
7,
9688,
62,
9945,
62,
400,
10126,
11,
2245,
62,
9945,
62,
400,
10126,
4008,
198,
220,
220,
220,
2845,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
3500,
435,
82,
7335,
404,
1231,
5128,
1241,
13326,
4943,
628,
220,
220,
220,
5128,
62,
25202,
796,
1280,
62,
23661,
7,
22915,
28,
25101,
8,
198,
220,
220,
220,
5072,
62,
25202,
796,
6045,
198,
220,
220,
220,
5201,
796,
10352,
628,
220,
220,
220,
8405,
796,
657,
198,
220,
220,
220,
6291,
62,
16345,
796,
657,
198,
220,
220,
220,
3509,
62,
39873,
796,
657,
198,
220,
220,
220,
3722,
796,
366,
21215,
198,
220,
220,
220,
374,
907,
62,
29048,
796,
657,
198,
220,
220,
220,
5128,
62,
15255,
11197,
796,
10352,
628,
220,
220,
220,
1303,
15034,
329,
8840,
20016,
287,
543,
262,
11387,
468,
407,
587,
1138,
981,
16388,
318,
4075,
198,
220,
220,
220,
954,
62,
1759,
1891,
62,
400,
10126,
62,
1662,
62,
4164,
796,
657,
628,
220,
220,
220,
981,
407,
5201,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
4149,
1366,
422,
3335,
198,
220,
220,
220,
220,
220,
220,
220,
1366,
62,
13664,
11,
1366,
796,
5128,
62,
25202,
13,
961,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
611,
1366,
62,
13664,
1279,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
13742,
338,
2642,
618,
428,
4325,
13,
2329,
1949,
284,
1100,
757,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
18931,
13,
18224,
7203,
1701,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2555,
628,
220,
220,
220,
220,
220,
220,
220,
611,
357,
11925,
7,
7890,
8,
4064,
604,
8,
14512,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
15891,
34182,
1332,
25,
1002,
262,
4129,
2125,
470,
257,
3294,
286,
604,
11,
1223,
338,
2642,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
44860,
4064,
82,
1911,
18982,
7,
11925,
7,
7890,
22305,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2555,
628,
220,
220,
220,
220,
220,
220,
220,
11677,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
4149,
832,
262,
3058,
7907,
6597,
1366,
198,
220,
220,
220,
220,
220,
220,
220,
981,
11677,
1279,
1366,
62,
13664,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
4149,
262,
1364,
290,
826,
6518,
422,
262,
1366,
19638,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
39873,
62,
75,
11,
6291,
62,
81,
8,
796,
555,
8002,
62,
6738,
10786,
27,
12337,
3256,
1366,
11,
11677,
28,
28968,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2845,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
18931,
13,
18224,
7203,
4,
82,
4064,
82,
4064,
82,
1600,
75,
11,
11925,
7,
7890,
828,
11677,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
5345,
257,
4277,
1988,
286,
6632,
523,
262,
1430,
460,
1394,
2491,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
39873,
62,
75,
11,
6291,
62,
81,
8,
796,
357,
15,
11,
657,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
11677,
15853,
604,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8405,
15853,
362,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
27131,
378,
262,
2160,
286,
477,
8405,
44345,
11,
973,
284,
5004,
374,
907,
1568,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6291,
62,
16345,
15853,
6291,
62,
75,
1635,
6291,
62,
75,
1343,
6291,
62,
81,
1635,
6291,
62,
81,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
45559,
3810,
262,
3509,
1988,
286,
477,
8405,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3509,
62,
39873,
796,
3509,
7,
9806,
62,
39873,
11,
2352,
7,
39873,
62,
75,
828,
2352,
7,
39873,
62,
81,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
611,
8405,
18189,
28844,
16437,
62,
34,
28270,
62,
12473,
30818,
62,
50084,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
27131,
378,
371,
5653,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
374,
907,
62,
29048,
796,
19862,
17034,
7,
39873,
62,
16345,
1220,
8405,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
45559,
3810,
543,
11387,
1988,
284,
779,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
5072,
62,
301,
38333,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
11387,
796,
923,
62,
9945,
62,
400,
10126,
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,
11387,
796,
2245,
62,
9945,
62,
400,
10126,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
6822,
611,
262,
11387,
468,
587,
20672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
923,
62,
9945,
62,
400,
10126,
6624,
657,
393,
875,
43837,
7,
9806,
62,
39873,
8,
1875,
11387,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5128,
62,
15255,
11197,
796,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3722,
796,
366,
47,
1,
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,
5128,
62,
15255,
11197,
796,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3722,
796,
366,
21215,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
90,
92,
46110,
13,
16,
69,
92,
46110,
13,
16,
69,
92,
1911,
18982,
7,
13376,
11,
875,
43837,
7,
81,
907,
62,
29048,
828,
875,
43837,
7,
9806,
62,
39873,
36911,
24773,
28,
17821,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6291,
62,
16345,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8405,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3509,
62,
39873,
796,
657,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
5072,
62,
301,
38333,
290,
5128,
62,
15255,
11197,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1619,
5128,
62,
25202,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
18931,
13,
10951,
7203,
20560,
6737,
12326,
11,
14187,
3500,
584,
1938,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
28686,
13,
10057,
7203,
14,
8738,
14,
71,
361,
1856,
563,
14,
8800,
14,
32125,
12,
439,
435,
82,
7335,
404,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
15414,
62,
25202,
11,
5072,
62,
25202,
8,
796,
1280,
62,
23661,
7,
22915,
28,
17821,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5072,
62,
301,
38333,
796,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2555,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
407,
5072,
62,
301,
38333,
290,
407,
5128,
62,
15255,
11197,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
954,
62,
1759,
1891,
62,
400,
10126,
62,
1662,
62,
4164,
15853,
352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
18931,
13,
10951,
7,
69,
1,
2949,
5128,
6737,
329,
1391,
9127,
62,
1759,
1891,
62,
400,
10126,
62,
1662,
62,
4164,
92,
20016,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
954,
62,
1759,
1891,
62,
400,
10126,
62,
1662,
62,
4164,
1875,
5870,
25171,
62,
41359,
13246,
62,
12473,
30818,
62,
51,
27064,
62,
27977,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1619,
5128,
62,
25202,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5072,
62,
25202,
796,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
18931,
13,
10951,
7203,
20560,
6737,
2626,
11,
12225,
16388,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5128,
62,
25202,
796,
1280,
62,
23661,
7,
22915,
28,
25101,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5072,
62,
301,
38333,
796,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2555,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
5128,
62,
15255,
11197,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
30027,
3753,
618,
5128,
12326,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
954,
62,
1759,
1891,
62,
400,
10126,
62,
1662,
62,
4164,
796,
657,
628,
220,
220,
220,
220,
220,
220,
220,
611,
407,
5072,
62,
301,
38333,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5072,
62,
25202,
13,
13564,
7,
7890,
8,
198
] | 2.475232 | 2,584 |
import logging
import hashlib
import assets_pb2 as assets
from sawtooth_sdk.processor.exceptions import InvalidTransaction
import handler.addressing as Addressing
import handler.utils as utils
LOGGER = logging.getLogger(__name__) | [
11748,
18931,
198,
11748,
12234,
8019,
198,
198,
11748,
6798,
62,
40842,
17,
355,
6798,
198,
6738,
2497,
1462,
849,
62,
21282,
74,
13,
41341,
13,
1069,
11755,
1330,
17665,
48720,
198,
11748,
21360,
13,
2860,
11697,
355,
3060,
11697,
198,
11748,
21360,
13,
26791,
355,
3384,
4487,
198,
198,
25294,
30373,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8
] | 3.666667 | 63 |
#!/usr/bin/env python
from netCDF4 import Dataset
import matplotlib.pyplot as plt
from matplotlib.cm import get_cmap
import cartopy.crs as crs
from cartopy.feature import NaturalEarthFeature
from wrf import ALL_TIMES, to_np, getvar, smooth2d, get_cartopy, cartopy_xlim, cartopy_ylim, latlon_coords
# Open the NetCDF file
ncfile = Dataset("/Users/zhenkunli/Dropbox/share/results/wrfout_d01_2014-07-01_00:00:00")
# Get the sea level pressure
LH = getvar(ncfile, "LH", timeidx=ALL_TIMES)
print LH
# Smooth the sea level pressure since it tends to be noisy near the mountains
LH = smooth2d(LH, 3)
# Get the latitude and longitude points
lats, lons = latlon_coords(LH)
# Get the cartopy mapping object
cart_proj = get_cartopy(LH)
print cart_proj
# Create a figure
fig = plt.figure(figsize=(8,6))
# Set the GeoAxes to the projection used by WRF
ax = plt.axes(projection=cart_proj)
# Download and add the states and coastlines
states = NaturalEarthFeature(category='cultural', scale='50m', facecolor='none',
name='admin_1_states_provinces_shp')
ax.add_feature(states, linewidth=.5)
ax.coastlines('50m', linewidth=0.8)
# Make the contour outlines and filled contours for the smoothed sea level pressure.
plt.contour(to_np(lons), to_np(lats), to_np(LH[160,:,:]), 10, colors="black",
transform=crs.PlateCarree())
plt.contourf(to_np(lons), to_np(lats), to_np(LH[160,:,:]), 10, transform=crs.PlateCarree(),
cmap=get_cmap("jet"))
# Add a color bar
plt.colorbar(ax=ax, shrink=.92)
# Set the map limits. Not really necessary, but used for demonstration.
ax.set_xlim(cartopy_xlim(LH))
ax.set_ylim(cartopy_ylim(LH))
# Add the gridlines
ax.gridlines(color="black", linestyle="dotted")
plt.title("LATENT HEAT FLUX AT THE SURFACE (W m-2)")
plt.savefig('LH.png')
# plt.show()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
6738,
2010,
34,
8068,
19,
1330,
16092,
292,
316,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
2603,
29487,
8019,
13,
11215,
1330,
651,
62,
66,
8899,
198,
11748,
6383,
11081,
13,
66,
3808,
355,
1067,
82,
198,
6738,
6383,
11081,
13,
30053,
1330,
12068,
22840,
38816,
198,
198,
6738,
1319,
69,
1330,
11096,
62,
51,
3955,
1546,
11,
284,
62,
37659,
11,
651,
7785,
11,
7209,
17,
67,
11,
651,
62,
26674,
11081,
11,
6383,
11081,
62,
87,
2475,
11,
6383,
11081,
62,
88,
2475,
11,
3042,
14995,
62,
1073,
3669,
198,
198,
2,
4946,
262,
3433,
34,
8068,
2393,
198,
10782,
7753,
796,
16092,
292,
316,
7203,
14,
14490,
14,
46732,
28374,
4528,
14,
26932,
3524,
14,
20077,
14,
43420,
14,
18351,
69,
448,
62,
67,
486,
62,
4967,
12,
2998,
12,
486,
62,
405,
25,
405,
25,
405,
4943,
198,
198,
2,
3497,
262,
5417,
1241,
3833,
198,
43,
39,
796,
651,
7785,
7,
10782,
7753,
11,
366,
43,
39,
1600,
640,
312,
87,
28,
7036,
62,
51,
3955,
1546,
8,
198,
4798,
49730,
198,
198,
2,
37002,
262,
5417,
1241,
3833,
1201,
340,
12444,
284,
307,
31210,
1474,
262,
12269,
198,
43,
39,
796,
7209,
17,
67,
7,
43,
39,
11,
513,
8,
198,
198,
2,
3497,
262,
32477,
290,
890,
3984,
2173,
198,
75,
1381,
11,
300,
684,
796,
3042,
14995,
62,
1073,
3669,
7,
43,
39,
8,
198,
198,
2,
3497,
262,
6383,
11081,
16855,
2134,
198,
26674,
62,
1676,
73,
796,
651,
62,
26674,
11081,
7,
43,
39,
8,
198,
4798,
6383,
62,
1676,
73,
198,
198,
2,
13610,
257,
3785,
198,
5647,
796,
458,
83,
13,
26875,
7,
5647,
7857,
16193,
23,
11,
21,
4008,
198,
2,
5345,
262,
32960,
31554,
274,
284,
262,
20128,
973,
416,
11342,
37,
198,
897,
796,
458,
83,
13,
897,
274,
7,
16302,
295,
28,
26674,
62,
1676,
73,
8,
198,
198,
2,
10472,
290,
751,
262,
2585,
290,
7051,
6615,
198,
27219,
796,
12068,
22840,
38816,
7,
22872,
11639,
30844,
3256,
5046,
11639,
1120,
76,
3256,
1986,
8043,
11639,
23108,
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,
1438,
11639,
28482,
62,
16,
62,
27219,
62,
1676,
7114,
728,
62,
1477,
79,
11537,
198,
897,
13,
2860,
62,
30053,
7,
27219,
11,
9493,
413,
5649,
28,
13,
20,
8,
198,
897,
13,
1073,
459,
6615,
10786,
1120,
76,
3256,
9493,
413,
5649,
28,
15,
13,
23,
8,
198,
198,
2,
6889,
262,
542,
454,
27430,
290,
5901,
542,
4662,
329,
262,
32746,
704,
5417,
1241,
3833,
13,
198,
489,
83,
13,
3642,
454,
7,
1462,
62,
37659,
7,
75,
684,
828,
284,
62,
37659,
7,
75,
1381,
828,
284,
62,
37659,
7,
43,
39,
58,
14198,
11,
45299,
25,
46570,
838,
11,
7577,
2625,
13424,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6121,
28,
66,
3808,
13,
3646,
378,
9914,
631,
28955,
198,
489,
83,
13,
3642,
454,
69,
7,
1462,
62,
37659,
7,
75,
684,
828,
284,
62,
37659,
7,
75,
1381,
828,
284,
62,
37659,
7,
43,
39,
58,
14198,
11,
45299,
25,
46570,
838,
11,
6121,
28,
66,
3808,
13,
3646,
378,
9914,
631,
22784,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
8899,
28,
1136,
62,
66,
8899,
7203,
31173,
48774,
198,
198,
2,
3060,
257,
3124,
2318,
198,
489,
83,
13,
8043,
5657,
7,
897,
28,
897,
11,
22085,
28,
13,
5892,
8,
198,
198,
2,
5345,
262,
3975,
7095,
13,
220,
1892,
1107,
3306,
11,
475,
973,
329,
13646,
13,
198,
897,
13,
2617,
62,
87,
2475,
7,
26674,
11081,
62,
87,
2475,
7,
43,
39,
4008,
198,
897,
13,
2617,
62,
88,
2475,
7,
26674,
11081,
62,
88,
2475,
7,
43,
39,
4008,
198,
198,
2,
3060,
262,
10706,
6615,
198,
897,
13,
25928,
6615,
7,
8043,
2625,
13424,
1600,
9493,
10992,
2625,
67,
8426,
4943,
198,
198,
489,
83,
13,
7839,
7203,
43,
1404,
3525,
11179,
1404,
9977,
31235,
5161,
3336,
41016,
49836,
357,
54,
285,
12,
17,
8,
4943,
198,
198,
489,
83,
13,
21928,
5647,
10786,
43,
39,
13,
11134,
11537,
198,
198,
2,
458,
83,
13,
12860,
3419,
198
] | 2.489768 | 733 |
import os
import sys
import launch
import launch_ros.actions
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import ComposableNodeContainer
from launch_ros.descriptions import ComposableNode
| [
11748,
28686,
198,
11748,
25064,
198,
11748,
4219,
198,
11748,
4219,
62,
4951,
13,
4658,
198,
6738,
4219,
13,
4658,
1330,
16691,
533,
38296,
28100,
1713,
198,
6738,
4219,
13,
7266,
301,
270,
3508,
1330,
21225,
38149,
198,
6738,
4219,
62,
4951,
13,
4658,
1330,
29936,
540,
19667,
29869,
198,
6738,
4219,
62,
4951,
13,
20147,
1968,
507,
1330,
29936,
540,
19667,
198
] | 4.269841 | 63 |
from kivy.storage.jsonstore import JsonStore
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.screenmanager import Screen
from kivymd.app import MDApp
from kivy.lang import Builder
from kivymd.uix.button import MDFlatButton, MDFloatingActionButton
from kivymd.uix.dialog import MDDialog
from kivymd.uix.list import TwoLineAvatarIconListItem
from kivymd.uix.menu import MDDropdownMenu
from kivymd.uix.tab import MDTabsBase
MyApp().run()
| [
6738,
479,
452,
88,
13,
35350,
13,
17752,
8095,
1330,
449,
1559,
22658,
198,
6738,
479,
452,
88,
13,
84,
844,
13,
3524,
39786,
1330,
8315,
32517,
198,
6738,
479,
452,
88,
13,
84,
844,
13,
22468,
39786,
1330,
48436,
32517,
198,
6738,
479,
452,
88,
13,
84,
844,
13,
9612,
37153,
1330,
15216,
198,
6738,
479,
452,
4948,
67,
13,
1324,
1330,
10670,
4677,
198,
6738,
479,
452,
88,
13,
17204,
1330,
35869,
198,
6738,
479,
452,
4948,
67,
13,
84,
844,
13,
16539,
1330,
10670,
7414,
265,
21864,
11,
337,
8068,
5439,
803,
12502,
21864,
198,
6738,
479,
452,
4948,
67,
13,
84,
844,
13,
38969,
519,
1330,
10670,
44204,
198,
6738,
479,
452,
4948,
67,
13,
84,
844,
13,
4868,
1330,
4930,
13949,
7355,
9459,
19578,
8053,
7449,
198,
6738,
479,
452,
4948,
67,
13,
84,
844,
13,
26272,
1330,
10670,
26932,
2902,
23381,
198,
6738,
479,
452,
4948,
67,
13,
84,
844,
13,
8658,
1330,
10670,
51,
8937,
14881,
628,
628,
628,
628,
198,
3666,
4677,
22446,
5143,
3419,
198
] | 2.844828 | 174 |
from multiprocessing.sharedctypes import Value
import socket
import spotipy
from spotipy.oauth2 import SpotifyClientCredentials
HEADER = 64
PORT = 5050
FORMAT = 'utf-8'
DISCONNECT_MESSAGE = "!DISCONNECT"
# SERVER = socket.gethostbyname(socket.gethostname())
SERVER = "192.168.0.155"
ADDR = (SERVER, PORT)
"""
Calls track search endpoint and populates a dictionary with results.
"""
try:
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect(ADDR)
main_display()
except ConnectionRefusedError:
print("[ERROR] Bad connection. You may have the wrong IP Address or the server may be down.")
| [
6738,
18540,
305,
919,
278,
13,
28710,
310,
9497,
1330,
11052,
198,
11748,
17802,
198,
11748,
4136,
541,
88,
198,
6738,
4136,
541,
88,
13,
12162,
1071,
17,
1330,
26778,
11792,
34,
445,
14817,
628,
198,
37682,
1137,
796,
5598,
198,
15490,
796,
2026,
1120,
198,
21389,
1404,
796,
705,
40477,
12,
23,
6,
198,
26288,
10943,
48842,
62,
44,
1546,
4090,
8264,
796,
366,
0,
26288,
10943,
48842,
1,
198,
2,
18871,
5959,
796,
17802,
13,
1136,
4774,
1525,
3672,
7,
44971,
13,
1136,
4774,
3672,
28955,
198,
35009,
5959,
796,
366,
17477,
13,
14656,
13,
15,
13,
18742,
1,
198,
2885,
7707,
796,
357,
35009,
5959,
11,
350,
9863,
8,
628,
628,
198,
37811,
198,
34,
5691,
2610,
2989,
36123,
290,
1461,
15968,
257,
22155,
351,
2482,
13,
198,
37811,
628,
198,
198,
28311,
25,
198,
220,
220,
220,
5456,
796,
17802,
13,
44971,
7,
44971,
13,
8579,
62,
1268,
2767,
11,
17802,
13,
50,
11290,
62,
2257,
32235,
8,
198,
220,
220,
220,
5456,
13,
8443,
7,
2885,
7707,
8,
628,
220,
220,
220,
1388,
62,
13812,
3419,
198,
16341,
26923,
8134,
1484,
12331,
25,
198,
220,
220,
220,
3601,
7203,
58,
24908,
60,
7772,
4637,
13,
921,
743,
423,
262,
2642,
6101,
17917,
393,
262,
4382,
743,
307,
866,
19570,
198
] | 2.944186 | 215 |
'''4. Write a Python program to generate groups of five consecutive numbers in a list. '''
l = [[5*i + j for j in range(1,6)] for i in range(5)]
print(l)
#Reference: w3resource | [
7061,
6,
19,
13,
19430,
257,
11361,
1430,
284,
7716,
2628,
286,
1936,
12785,
3146,
287,
257,
1351,
13,
705,
7061,
198,
198,
75,
796,
16410,
20,
9,
72,
1343,
474,
329,
474,
287,
2837,
7,
16,
11,
21,
15437,
329,
1312,
287,
2837,
7,
20,
15437,
198,
4798,
7,
75,
8,
198,
198,
2,
26687,
25,
266,
18,
31092
] | 2.966667 | 60 |
#!/usr/bin/python
# coding: UTF-8
#
# Author: Dawid Laszuk
# Contact: [email protected]
#
# Feel free to contact for any information.
from __future__ import division, print_function
import emcee
import logging
import numpy as np
import time, datetime
from .kursl_model import KurSL
from .model import ModelWrapper
# End of Class
######################################
# Exaple usage of program.
# 1. Prepare oscillators.
# 2. Adjust Kuramoto system via Bayes inference
# 3. Plot results
if __name__ == "__main__":
import sys
logfile = __file__.split('.')[0] + ".log"
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
logger = logging.getLogger(__file__)
PLOT_RESULTS = True
N = 1024*2
t = np.linspace(0, 3, N)
t0, t1, dt = t[0], t[-1], t[1]-t[0]
oscN = 2 # Number of oscillators
nH = 1 # Number of harmonics
# For generating parameters
MIN_R, MAX_R = 1, 5
MIN_W, MAX_W = 10, 30
# Initial values for system
W = np.random.random(oscN)*(MAX_W-MIN_W) + MIN_W
R = np.random.random(oscN)*(MAX_R-MIN_R) + MIN_R
Phi0 = np.random.random(oscN)*2*np.pi
kMat = np.random.random((oscN, nH*(oscN-1)))
# P - W(Nx1) R(Nx1) Ph(Nx1) K(Nx(M(N-1))
# P - Nx(3+M(N-1))
P = np.zeros((oscN, 3+nH*(oscN-1)))
P[:,0] = W
P[:,1] = Phi0
P[:,2] = R
if oscN != 1: P[:,3:3+nH*(oscN-1)] = kMat
noise = P*np.random.normal(0, 0.2)
# Generating signal
phase, amp, sInput = KurSL(P).generate(t)
for i in range(oscN):
sInput[i] += np.random.normal(0, 0.2*R[i], N-1)
# Applying MCMC
theta_init = P + noise
S = np.sum(sInput, axis=0)+np.random.random(t.size-1)
logger.info("Sit back and relax. This will take a while...")
mcmc = KurslMCMC(theta_init, nH=nH, nwalkers=40, niter=100)
mcmc.set_sampler(t, S)
theta = mcmc.run()
# Plot comparison between plots
logger.info("Best estimate: " + str(theta))
# Plot results
if PLOT_RESULTS:
import pylab as plt
kursl = KurSL(theta)
phase, amp, rec = kursl.generate(t)
plt.figure()
for i in range(oscN):
plt.subplot(oscN, 1, i+1)
plt.plot(t[:-1], sInput[i], 'g')
plt.plot(t[:-1], rec[i], 'r')
plt.savefig("fit", dpi=200)
plt.show()
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
19617,
25,
41002,
12,
23,
198,
2,
198,
2,
6434,
25,
17552,
312,
10123,
89,
2724,
198,
2,
14039,
25,
39990,
89,
2724,
67,
707,
312,
31,
14816,
13,
785,
198,
2,
198,
2,
18571,
1479,
284,
2800,
329,
597,
1321,
13,
198,
6738,
11593,
37443,
834,
1330,
7297,
11,
3601,
62,
8818,
198,
198,
11748,
795,
344,
68,
198,
11748,
18931,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
640,
11,
4818,
8079,
198,
198,
6738,
764,
74,
1834,
75,
62,
19849,
1330,
18132,
8634,
198,
6738,
764,
19849,
1330,
9104,
36918,
2848,
198,
198,
2,
5268,
286,
5016,
198,
198,
29113,
4242,
2235,
198,
198,
2,
1475,
24052,
8748,
286,
1430,
13,
198,
2,
352,
13,
43426,
24969,
2024,
13,
198,
2,
362,
13,
20292,
18132,
25384,
1080,
2884,
4696,
274,
32278,
198,
2,
513,
13,
28114,
2482,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
628,
220,
220,
220,
1330,
25064,
198,
220,
220,
220,
2604,
7753,
796,
11593,
7753,
834,
13,
35312,
10786,
2637,
38381,
15,
60,
1343,
27071,
6404,
1,
198,
220,
220,
220,
18931,
13,
35487,
16934,
7,
5532,
28,
17597,
13,
19282,
448,
11,
1241,
28,
6404,
2667,
13,
30531,
8,
198,
220,
220,
220,
49706,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
7753,
834,
8,
628,
220,
220,
220,
9297,
2394,
62,
46274,
796,
6407,
628,
220,
220,
220,
399,
796,
28119,
9,
17,
198,
220,
220,
220,
256,
796,
45941,
13,
21602,
10223,
7,
15,
11,
513,
11,
399,
8,
198,
220,
220,
220,
256,
15,
11,
256,
16,
11,
288,
83,
796,
256,
58,
15,
4357,
256,
58,
12,
16,
4357,
256,
58,
16,
45297,
83,
58,
15,
60,
628,
220,
220,
220,
267,
1416,
45,
796,
362,
1303,
7913,
286,
24969,
2024,
198,
220,
220,
220,
299,
39,
796,
352,
220,
220,
1303,
7913,
286,
25625,
873,
628,
220,
220,
220,
1303,
1114,
15453,
10007,
198,
220,
220,
220,
20625,
62,
49,
11,
25882,
62,
49,
796,
352,
11,
642,
198,
220,
220,
220,
20625,
62,
54,
11,
25882,
62,
54,
796,
838,
11,
1542,
628,
220,
220,
220,
1303,
20768,
3815,
329,
1080,
198,
220,
220,
220,
370,
796,
45941,
13,
25120,
13,
25120,
7,
17500,
45,
27493,
7,
22921,
62,
54,
12,
23678,
62,
54,
8,
1343,
20625,
62,
54,
198,
220,
220,
220,
371,
796,
45941,
13,
25120,
13,
25120,
7,
17500,
45,
27493,
7,
22921,
62,
49,
12,
23678,
62,
49,
8,
1343,
20625,
62,
49,
198,
220,
220,
220,
47256,
15,
796,
45941,
13,
25120,
13,
25120,
7,
17500,
45,
27493,
17,
9,
37659,
13,
14415,
198,
220,
220,
220,
479,
19044,
796,
45941,
13,
25120,
13,
25120,
19510,
17500,
45,
11,
299,
39,
9,
7,
17500,
45,
12,
16,
22305,
628,
220,
220,
220,
1303,
350,
532,
370,
7,
45,
87,
16,
8,
371,
7,
45,
87,
16,
8,
1380,
7,
45,
87,
16,
8,
509,
7,
45,
87,
7,
44,
7,
45,
12,
16,
4008,
198,
220,
220,
220,
1303,
350,
532,
399,
87,
7,
18,
10,
44,
7,
45,
12,
16,
4008,
198,
220,
220,
220,
350,
796,
45941,
13,
9107,
418,
19510,
17500,
45,
11,
513,
10,
77,
39,
9,
7,
17500,
45,
12,
16,
22305,
198,
220,
220,
220,
350,
58,
45299,
15,
60,
796,
370,
198,
220,
220,
220,
350,
58,
45299,
16,
60,
796,
47256,
15,
198,
220,
220,
220,
350,
58,
45299,
17,
60,
796,
371,
198,
220,
220,
220,
611,
267,
1416,
45,
14512,
352,
25,
350,
58,
45299,
18,
25,
18,
10,
77,
39,
9,
7,
17500,
45,
12,
16,
15437,
796,
479,
19044,
198,
220,
220,
220,
7838,
796,
350,
9,
37659,
13,
25120,
13,
11265,
7,
15,
11,
657,
13,
17,
8,
628,
220,
220,
220,
1303,
2980,
803,
6737,
198,
220,
220,
220,
7108,
11,
20766,
11,
264,
20560,
796,
18132,
8634,
7,
47,
737,
8612,
378,
7,
83,
8,
198,
220,
220,
220,
329,
1312,
287,
2837,
7,
17500,
45,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
264,
20560,
58,
72,
60,
15853,
45941,
13,
25120,
13,
11265,
7,
15,
11,
657,
13,
17,
9,
49,
58,
72,
4357,
399,
12,
16,
8,
628,
220,
220,
220,
1303,
2034,
3157,
13122,
9655,
198,
220,
220,
220,
262,
8326,
62,
15003,
796,
350,
1343,
7838,
628,
220,
220,
220,
311,
796,
45941,
13,
16345,
7,
82,
20560,
11,
16488,
28,
15,
47762,
37659,
13,
25120,
13,
25120,
7,
83,
13,
7857,
12,
16,
8,
628,
220,
220,
220,
49706,
13,
10951,
7203,
46655,
736,
290,
8960,
13,
770,
481,
1011,
257,
981,
9313,
8,
198,
220,
220,
220,
285,
11215,
66,
796,
509,
1834,
75,
9655,
9655,
7,
1169,
8326,
62,
15003,
11,
299,
39,
28,
77,
39,
11,
299,
11152,
364,
28,
1821,
11,
299,
2676,
28,
3064,
8,
198,
220,
220,
220,
285,
11215,
66,
13,
2617,
62,
37687,
20053,
7,
83,
11,
311,
8,
198,
220,
220,
220,
262,
8326,
796,
285,
11215,
66,
13,
5143,
3419,
628,
220,
220,
220,
1303,
28114,
7208,
1022,
21528,
198,
220,
220,
220,
49706,
13,
10951,
7203,
13014,
8636,
25,
366,
1343,
965,
7,
1169,
8326,
4008,
628,
220,
220,
220,
1303,
28114,
2482,
198,
220,
220,
220,
611,
9297,
2394,
62,
46274,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1330,
279,
2645,
397,
355,
458,
83,
628,
220,
220,
220,
220,
220,
220,
220,
479,
1834,
75,
796,
18132,
8634,
7,
1169,
8326,
8,
198,
220,
220,
220,
220,
220,
220,
220,
7108,
11,
20766,
11,
664,
796,
479,
1834,
75,
13,
8612,
378,
7,
83,
8,
628,
220,
220,
220,
220,
220,
220,
220,
458,
83,
13,
26875,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
287,
2837,
7,
17500,
45,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
458,
83,
13,
7266,
29487,
7,
17500,
45,
11,
352,
11,
1312,
10,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
458,
83,
13,
29487,
7,
83,
58,
21912,
16,
4357,
264,
20560,
58,
72,
4357,
705,
70,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
458,
83,
13,
29487,
7,
83,
58,
21912,
16,
4357,
664,
58,
72,
4357,
705,
81,
11537,
628,
220,
220,
220,
220,
220,
220,
220,
458,
83,
13,
21928,
5647,
7203,
11147,
1600,
288,
14415,
28,
2167,
8,
198,
220,
220,
220,
220,
220,
220,
220,
458,
83,
13,
12860,
3419,
198
] | 2.127854 | 1,095 |
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import info
# make sure this path is correct
PATH = "C:\Program Files (x86)\ChromeDriver\chromedriver.exe"
driver = webdriver.Chrome(PATH)
RTX3070LINK1 = "https://www.bestbuy.com/site/nvidia-geforce-rtx-3070-8gb-gddr6-pci-express-4-0-graphics-card-dark-platinum-and-black/6429442.p?skuId=6429442"
RTX3070LINK2 = "https://www.bestbuy.com/site/gigabyte-geforce-rtx-3070-8g-gddr6-pci-express-4-0-graphics-card-black/6437912.p?skuId=6437912"
XBOXONETEST = "https://www.bestbuy.com/site/microsoft-xbox-one-s-1tb-console-bundle-white/6415222.p?skuId=6415222"
driver.get(RTX3070LINK1)
isComplete = False
while not isComplete:
# find add to cart button
try:
atcBtn = WebDriverWait(driver, 10).until(
EC.element_to_be_clickable((By.CSS_SELECTOR, ".add-to-cart-button"))
)
except:
driver.refresh()
continue
print("Add to cart button found")
try:
# add to cart
atcBtn.click()
# go to cart and begin checkout as guest
driver.get("https://www.bestbuy.com/cart")
checkoutBtn = WebDriverWait(driver, 10).until(
EC.presence_of_element_located((By.XPATH, "/html/body/div[1]/main/div/div[2]/div[1]/div/div/span/div/div[2]/div[1]/section[2]/div/div/div[3]/div/div[1]/button"))
)
checkoutBtn.click()
print("Successfully added to cart - beginning check out")
# fill in email and password
emailField = WebDriverWait(driver, 10).until(
EC.presence_of_element_located((By.ID, "fld-e"))
)
emailField.send_keys(info.email)
pwField = WebDriverWait(driver, 10).until(
EC.presence_of_element_located((By.ID, "fld-p1"))
)
pwField.send_keys(info.password)
# click sign in button
signInBtn = WebDriverWait(driver, 10).until(
EC.presence_of_element_located((By.XPATH, "/html/body/div[1]/div/section/main/div[1]/div/div/div/div/form/div[3]/button"))
)
signInBtn.click()
print("Signing in")
# fill in card cvv
cvvField = WebDriverWait(driver, 10).until(
EC.presence_of_element_located((By.ID, "credit-card-cvv"))
)
cvvField.send_keys(info.cvv)
print("Attempting to place order")
# place order
placeOrderBtn = WebDriverWait(driver, 10).until(
EC.presence_of_element_located((By.CSS_SELECTOR, ".button__fast-track"))
)
placeOrderBtn.click()
isComplete = True
except:
# make sure this link is the same as the link passed to driver.get() before looping
driver.get(RTX3070LINK1)
print("Error - restarting bot")
continue
print("Order successfully placed")
| [
6738,
384,
11925,
1505,
1330,
3992,
26230,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11321,
13,
1525,
1330,
2750,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11284,
13,
9019,
1330,
5313,
32103,
21321,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11284,
1330,
2938,
62,
17561,
1756,
355,
13182,
198,
198,
11748,
7508,
198,
198,
2,
787,
1654,
428,
3108,
318,
3376,
198,
34219,
796,
366,
34,
7479,
15167,
13283,
357,
87,
4521,
19415,
1925,
5998,
32103,
59,
28663,
276,
38291,
13,
13499,
1,
198,
198,
26230,
796,
3992,
26230,
13,
1925,
5998,
7,
34219,
8,
198,
198,
14181,
55,
1270,
2154,
43,
17248,
16,
796,
366,
5450,
1378,
2503,
13,
13466,
17846,
13,
785,
14,
15654,
14,
77,
21744,
12,
469,
3174,
12,
17034,
87,
12,
1270,
2154,
12,
23,
22296,
12,
70,
1860,
81,
21,
12,
79,
979,
12,
42712,
12,
19,
12,
15,
12,
70,
11549,
12,
9517,
12,
21953,
12,
489,
16881,
12,
392,
12,
13424,
14,
2414,
1959,
39506,
13,
79,
30,
8135,
84,
7390,
28,
2414,
1959,
39506,
1,
198,
14181,
55,
1270,
2154,
43,
17248,
17,
796,
366,
5450,
1378,
2503,
13,
13466,
17846,
13,
785,
14,
15654,
14,
70,
328,
37828,
12,
469,
3174,
12,
17034,
87,
12,
1270,
2154,
12,
23,
70,
12,
70,
1860,
81,
21,
12,
79,
979,
12,
42712,
12,
19,
12,
15,
12,
70,
11549,
12,
9517,
12,
13424,
14,
2414,
29088,
1065,
13,
79,
30,
8135,
84,
7390,
28,
2414,
29088,
1065,
1,
198,
55,
39758,
1340,
2767,
6465,
796,
366,
5450,
1378,
2503,
13,
13466,
17846,
13,
785,
14,
15654,
14,
40485,
12,
87,
3524,
12,
505,
12,
82,
12,
16,
83,
65,
12,
41947,
12,
65,
31249,
12,
11186,
14,
2414,
1314,
23148,
13,
79,
30,
8135,
84,
7390,
28,
2414,
1314,
23148,
1,
198,
198,
26230,
13,
1136,
7,
14181,
55,
1270,
2154,
43,
17248,
16,
8,
198,
198,
271,
20988,
796,
10352,
198,
198,
4514,
407,
318,
20988,
25,
198,
220,
220,
220,
1303,
1064,
751,
284,
6383,
4936,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
379,
66,
33,
34106,
796,
5313,
32103,
21321,
7,
26230,
11,
838,
737,
28446,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13182,
13,
30854,
62,
1462,
62,
1350,
62,
12976,
540,
19510,
3886,
13,
49155,
62,
46506,
1581,
11,
27071,
2860,
12,
1462,
12,
26674,
12,
16539,
48774,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
2845,
25,
198,
220,
220,
220,
220,
220,
220,
220,
4639,
13,
5420,
3447,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2555,
628,
220,
220,
220,
3601,
7203,
4550,
284,
6383,
4936,
1043,
4943,
628,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
751,
284,
6383,
198,
220,
220,
220,
220,
220,
220,
220,
379,
66,
33,
34106,
13,
12976,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
467,
284,
6383,
290,
2221,
28006,
355,
8319,
198,
220,
220,
220,
220,
220,
220,
220,
4639,
13,
1136,
7203,
5450,
1378,
2503,
13,
13466,
17846,
13,
785,
14,
26674,
4943,
628,
220,
220,
220,
220,
220,
220,
220,
28006,
33,
34106,
796,
5313,
32103,
21321,
7,
26230,
11,
838,
737,
28446,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13182,
13,
18302,
594,
62,
1659,
62,
30854,
62,
75,
10533,
19510,
3886,
13,
27481,
12599,
11,
12813,
6494,
14,
2618,
14,
7146,
58,
16,
60,
14,
12417,
14,
7146,
14,
7146,
58,
17,
60,
14,
7146,
58,
16,
60,
14,
7146,
14,
7146,
14,
12626,
14,
7146,
14,
7146,
58,
17,
60,
14,
7146,
58,
16,
60,
14,
5458,
58,
17,
60,
14,
7146,
14,
7146,
14,
7146,
58,
18,
60,
14,
7146,
14,
7146,
58,
16,
60,
14,
16539,
48774,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
28006,
33,
34106,
13,
12976,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
33244,
2759,
2087,
284,
6383,
532,
3726,
2198,
503,
4943,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
6070,
287,
3053,
290,
9206,
198,
220,
220,
220,
220,
220,
220,
220,
3053,
15878,
796,
5313,
32103,
21321,
7,
26230,
11,
838,
737,
28446,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13182,
13,
18302,
594,
62,
1659,
62,
30854,
62,
75,
10533,
19510,
3886,
13,
2389,
11,
366,
69,
335,
12,
68,
48774,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
3053,
15878,
13,
21280,
62,
13083,
7,
10951,
13,
12888,
8,
628,
220,
220,
220,
220,
220,
220,
220,
279,
86,
15878,
796,
5313,
32103,
21321,
7,
26230,
11,
838,
737,
28446,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13182,
13,
18302,
594,
62,
1659,
62,
30854,
62,
75,
10533,
19510,
3886,
13,
2389,
11,
366,
69,
335,
12,
79,
16,
48774,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
279,
86,
15878,
13,
21280,
62,
13083,
7,
10951,
13,
28712,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
3904,
1051,
287,
4936,
198,
220,
220,
220,
220,
220,
220,
220,
1051,
818,
33,
34106,
796,
5313,
32103,
21321,
7,
26230,
11,
838,
737,
28446,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13182,
13,
18302,
594,
62,
1659,
62,
30854,
62,
75,
10533,
19510,
3886,
13,
27481,
12599,
11,
12813,
6494,
14,
2618,
14,
7146,
58,
16,
60,
14,
7146,
14,
5458,
14,
12417,
14,
7146,
58,
16,
60,
14,
7146,
14,
7146,
14,
7146,
14,
7146,
14,
687,
14,
7146,
58,
18,
60,
14,
16539,
48774,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
1051,
818,
33,
34106,
13,
12976,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
11712,
278,
287,
4943,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
6070,
287,
2657,
269,
25093,
198,
220,
220,
220,
220,
220,
220,
220,
269,
25093,
15878,
796,
5313,
32103,
21321,
7,
26230,
11,
838,
737,
28446,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13182,
13,
18302,
594,
62,
1659,
62,
30854,
62,
75,
10533,
19510,
3886,
13,
2389,
11,
366,
43082,
12,
9517,
12,
66,
25093,
48774,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
269,
25093,
15878,
13,
21280,
62,
13083,
7,
10951,
13,
66,
25093,
8,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
37177,
278,
284,
1295,
1502,
4943,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
1295,
1502,
198,
220,
220,
220,
220,
220,
220,
220,
1295,
18743,
33,
34106,
796,
5313,
32103,
21321,
7,
26230,
11,
838,
737,
28446,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13182,
13,
18302,
594,
62,
1659,
62,
30854,
62,
75,
10533,
19510,
3886,
13,
49155,
62,
46506,
1581,
11,
27071,
16539,
834,
7217,
12,
11659,
48774,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
1295,
18743,
33,
34106,
13,
12976,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
318,
20988,
796,
6407,
198,
220,
220,
220,
2845,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
787,
1654,
428,
2792,
318,
262,
976,
355,
262,
2792,
3804,
284,
4639,
13,
1136,
3419,
878,
9052,
278,
198,
220,
220,
220,
220,
220,
220,
220,
4639,
13,
1136,
7,
14181,
55,
1270,
2154,
43,
17248,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
12331,
532,
15765,
278,
10214,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
2555,
198,
198,
4798,
7203,
18743,
7675,
4624,
4943,
198
] | 2.212942 | 1,329 |
""" Copyright start
Copyright (C) 2008 - 2021 Fortinet Inc.
All rights reserved.
FORTINET CONFIDENTIAL & FORTINET PROPRIETARY SOURCE CODE
Copyright end """
import boto3, requests, json
from connectors.core.connector import get_logger, ConnectorError
logger = get_logger('aws-network-firewall')
TEMP_CRED_ENDPOINT = 'http://169.254.169.254/latest/meta-data/iam/security-credentials/{}'
operations = {
'get_associate_firewall_policy': get_associate_firewall_policy,
'get_associate_subnets': get_associate_subnets,
'create_firewall': create_firewall,
'create_firewall_policy': create_firewall_policy,
'create_rule_group': create_rule_group,
'delete_firewall': delete_firewall,
'delete_firewall_policy': delete_firewall_policy,
'delete_resource_policy': delete_resource_policy,
'delete_rule_group': delete_rule_group,
'describe_firewall': describe_firewall,
'describe_firewall_policy': describe_firewall_policy,
'describe_logging_configuration': describe_logging_configuration,
'describe_resource_policy': describe_resource_policy,
'describe_rule_group': describe_rule_group,
'disassociate_subnets': disassociate_subnets,
'get_list_firewalls': get_list_firewalls,
'get_list_firewall_policies': get_list_firewall_policies,
'get_list_rule_groups': get_list_rule_groups,
'get_list_tag_for_resource': get_list_tag_for_resource,
'tag_resource': tag_resource
}
| [
37811,
15069,
923,
198,
220,
15069,
357,
34,
8,
3648,
532,
33448,
6401,
42504,
3457,
13,
198,
220,
1439,
2489,
10395,
13,
198,
220,
7473,
51,
1268,
2767,
7102,
37,
25256,
12576,
1222,
7473,
51,
1268,
2767,
4810,
3185,
7112,
2767,
13153,
311,
31033,
42714,
198,
220,
15069,
886,
37227,
198,
198,
11748,
275,
2069,
18,
11,
7007,
11,
33918,
198,
6738,
34472,
13,
7295,
13,
8443,
273,
1330,
651,
62,
6404,
1362,
11,
8113,
273,
12331,
198,
198,
6404,
1362,
796,
651,
62,
6404,
1362,
10786,
8356,
12,
27349,
12,
6495,
11930,
11537,
198,
198,
51,
39494,
62,
9419,
1961,
62,
1677,
6322,
46,
12394,
796,
705,
4023,
1378,
22172,
13,
24970,
13,
22172,
13,
24970,
14,
42861,
14,
28961,
12,
7890,
14,
1789,
14,
12961,
12,
66,
445,
14817,
14,
90,
92,
6,
628,
628,
628,
628,
628,
628,
628,
628,
628,
628,
628,
628,
628,
198,
198,
3575,
602,
796,
1391,
198,
220,
220,
220,
705,
1136,
62,
562,
47615,
62,
6495,
11930,
62,
30586,
10354,
651,
62,
562,
47615,
62,
6495,
11930,
62,
30586,
11,
198,
220,
220,
220,
705,
1136,
62,
562,
47615,
62,
7266,
45938,
10354,
651,
62,
562,
47615,
62,
7266,
45938,
11,
198,
220,
220,
220,
705,
17953,
62,
6495,
11930,
10354,
2251,
62,
6495,
11930,
11,
198,
220,
220,
220,
705,
17953,
62,
6495,
11930,
62,
30586,
10354,
2251,
62,
6495,
11930,
62,
30586,
11,
198,
220,
220,
220,
705,
17953,
62,
25135,
62,
8094,
10354,
2251,
62,
25135,
62,
8094,
11,
198,
220,
220,
220,
705,
33678,
62,
6495,
11930,
10354,
12233,
62,
6495,
11930,
11,
198,
220,
220,
220,
705,
33678,
62,
6495,
11930,
62,
30586,
10354,
12233,
62,
6495,
11930,
62,
30586,
11,
198,
220,
220,
220,
705,
33678,
62,
31092,
62,
30586,
10354,
12233,
62,
31092,
62,
30586,
11,
198,
220,
220,
220,
705,
33678,
62,
25135,
62,
8094,
10354,
12233,
62,
25135,
62,
8094,
11,
198,
220,
220,
220,
705,
20147,
4892,
62,
6495,
11930,
10354,
6901,
62,
6495,
11930,
11,
198,
220,
220,
220,
705,
20147,
4892,
62,
6495,
11930,
62,
30586,
10354,
6901,
62,
6495,
11930,
62,
30586,
11,
198,
220,
220,
220,
705,
20147,
4892,
62,
6404,
2667,
62,
11250,
3924,
10354,
6901,
62,
6404,
2667,
62,
11250,
3924,
11,
198,
220,
220,
220,
705,
20147,
4892,
62,
31092,
62,
30586,
10354,
6901,
62,
31092,
62,
30586,
11,
198,
220,
220,
220,
705,
20147,
4892,
62,
25135,
62,
8094,
10354,
6901,
62,
25135,
62,
8094,
11,
198,
220,
220,
220,
705,
6381,
562,
47615,
62,
7266,
45938,
10354,
595,
562,
47615,
62,
7266,
45938,
11,
198,
220,
220,
220,
705,
1136,
62,
4868,
62,
6495,
86,
5691,
10354,
651,
62,
4868,
62,
6495,
86,
5691,
11,
198,
220,
220,
220,
705,
1136,
62,
4868,
62,
6495,
11930,
62,
79,
4160,
444,
10354,
651,
62,
4868,
62,
6495,
11930,
62,
79,
4160,
444,
11,
198,
220,
220,
220,
705,
1136,
62,
4868,
62,
25135,
62,
24432,
10354,
651,
62,
4868,
62,
25135,
62,
24432,
11,
198,
220,
220,
220,
705,
1136,
62,
4868,
62,
12985,
62,
1640,
62,
31092,
10354,
651,
62,
4868,
62,
12985,
62,
1640,
62,
31092,
11,
198,
220,
220,
220,
705,
12985,
62,
31092,
10354,
7621,
62,
31092,
198,
92,
628
] | 2.71719 | 541 |
# Enter your code here. Read input from STDIN. Print output to STDOUTseen = ''
from string import ascii_uppercase, digits
import re
for _ in range(1, int(input())+1):
uid = str(input())
seen = ''
valid = True
if len(uid) == 10:
for char in uid:
if char not in seen and char.isalnum():
seen = seen + char
else:
valid = False
break
if len(re.findall(r'[A-Z]', seen)) > 1 and len(re.findall(r'[0-9]', seen)) >2 :
pass
else:
valid = False
else:
valid = False
print('Valid' if valid else 'Invalid')
| [
2,
6062,
534,
2438,
994,
13,
4149,
5128,
422,
48571,
1268,
13,
12578,
5072,
284,
48571,
12425,
15898,
796,
10148,
198,
6738,
4731,
1330,
355,
979,
72,
62,
7211,
2798,
589,
11,
19561,
198,
11748,
302,
198,
1640,
4808,
287,
2837,
7,
16,
11,
493,
7,
15414,
28955,
10,
16,
2599,
198,
220,
220,
220,
334,
312,
796,
965,
7,
15414,
28955,
198,
220,
220,
220,
1775,
796,
10148,
198,
220,
220,
220,
4938,
796,
6407,
198,
220,
220,
220,
220,
198,
220,
220,
220,
611,
18896,
7,
27112,
8,
6624,
838,
25,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1149,
287,
334,
312,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
1149,
407,
287,
1775,
290,
1149,
13,
28456,
22510,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1775,
796,
1775,
1343,
1149,
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,
4938,
796,
10352,
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,
611,
18896,
7,
260,
13,
19796,
439,
7,
81,
6,
58,
32,
12,
57,
60,
3256,
1775,
4008,
1875,
352,
290,
18896,
7,
260,
13,
19796,
439,
7,
81,
6,
58,
15,
12,
24,
60,
3256,
1775,
4008,
1875,
17,
1058,
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,
1208,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4938,
796,
10352,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
4938,
796,
10352,
628,
220,
220,
220,
3601,
10786,
47139,
6,
611,
4938,
2073,
705,
44651,
11537,
198
] | 1.996997 | 333 |
from __future__ import with_statement
import datetime
import random
import hashlib
import base64
from decimal import Decimal
from django.db import models
from django_bitcoin.utils import bitcoind
from django_bitcoin import settings , models
from django.utils.translation import ugettext as _
from django_bitcoin.models import DepositTransaction, BitcoinAddress
from django.db import transaction as db_transaction
from django.core.cache import cache
from django.core.mail import mail_admins
import django.dispatch
import jsonrpc
from bitcoin import bci
from BCAddressField import is_valid_btc_address
from celery import shared_task
from distributedlock import distributedlock, MemcachedLock, LockNotAcquiredError
@shared_task
@shared_task
import sys
from cStringIO import StringIO
@shared_task
| [
6738,
11593,
37443,
834,
1330,
351,
62,
26090,
198,
198,
11748,
4818,
8079,
198,
11748,
4738,
198,
11748,
12234,
8019,
198,
11748,
2779,
2414,
198,
6738,
32465,
1330,
4280,
4402,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
62,
35395,
13,
26791,
1330,
1643,
1073,
521,
198,
6738,
42625,
14208,
62,
35395,
1330,
6460,
837,
4981,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
334,
1136,
5239,
355,
4808,
198,
6738,
42625,
14208,
62,
35395,
13,
27530,
1330,
44158,
48720,
11,
6185,
20231,
198,
6738,
42625,
14208,
13,
9945,
1330,
8611,
355,
20613,
62,
7645,
2673,
198,
6738,
42625,
14208,
13,
7295,
13,
23870,
1330,
12940,
198,
6738,
42625,
14208,
13,
7295,
13,
4529,
1330,
6920,
62,
324,
42951,
198,
198,
11748,
42625,
14208,
13,
6381,
17147,
198,
198,
11748,
33918,
81,
14751,
198,
6738,
220,
8550,
1330,
275,
979,
198,
6738,
11843,
20231,
15878,
1330,
318,
62,
12102,
62,
18347,
66,
62,
21975,
198,
198,
6738,
18725,
1924,
1330,
4888,
62,
35943,
198,
198,
6738,
9387,
5354,
1330,
9387,
5354,
11,
4942,
66,
2317,
25392,
11,
13656,
3673,
12832,
421,
1202,
12331,
628,
198,
198,
31,
28710,
62,
35943,
198,
220,
220,
220,
220,
220,
220,
220,
220,
628,
220,
220,
220,
220,
220,
220,
220,
220,
198,
198,
31,
28710,
62,
35943,
198,
198,
11748,
25064,
198,
6738,
269,
10100,
9399,
1330,
10903,
9399,
198,
198,
31,
28710,
62,
35943,
198
] | 3.451883 | 239 |
from model.contact import Contact
from model.group import Group
#Главная
#Выбираем контакт
#Выбираем группу
#Нажимаем добавить
#Нажимаем перейти в группу
#Получаем ид группы
#-
#Записываем из базы не пустую группу с нашим айдишником
#Сравниваем | [
6738,
2746,
13,
32057,
1330,
14039,
198,
6738,
2746,
13,
8094,
1330,
4912,
628,
628,
628,
628,
628,
628,
628,
628,
198,
2,
140,
241,
30143,
16142,
38857,
22177,
16142,
40623,
198,
2,
140,
240,
45035,
140,
109,
18849,
21169,
16142,
16843,
43108,
12466,
118,
15166,
22177,
20375,
16142,
31583,
20375,
198,
2,
140,
240,
45035,
140,
109,
18849,
21169,
16142,
16843,
43108,
12466,
111,
21169,
35072,
140,
123,
140,
123,
35072,
198,
2,
140,
251,
16142,
140,
114,
18849,
43108,
16142,
16843,
43108,
12466,
112,
25443,
109,
16142,
38857,
18849,
20375,
45367,
198,
2,
140,
251,
16142,
140,
114,
18849,
43108,
16142,
16843,
43108,
12466,
123,
16843,
21169,
16843,
140,
117,
20375,
18849,
12466,
110,
12466,
111,
21169,
35072,
140,
123,
140,
123,
35072,
198,
2,
140,
253,
25443,
119,
35072,
141,
229,
16142,
16843,
43108,
12466,
116,
43666,
12466,
111,
21169,
35072,
140,
123,
140,
123,
45035,
198,
2,
12,
198,
2,
140,
245,
16142,
140,
123,
18849,
21727,
45035,
38857,
16142,
16843,
43108,
12466,
116,
140,
115,
12466,
109,
16142,
140,
115,
45035,
12466,
121,
16843,
12466,
123,
35072,
21727,
20375,
35072,
141,
236,
12466,
111,
21169,
35072,
140,
123,
140,
123,
35072,
220,
21727,
12466,
121,
16142,
141,
230,
18849,
43108,
12466,
108,
140,
117,
43666,
18849,
141,
230,
22177,
18849,
31583,
25443,
120,
198,
2,
140,
94,
21169,
16142,
38857,
22177,
18849,
38857,
16142,
16843,
43108
] | 1.125541 | 231 |
import html
import json
import requests
from django.apps import apps
from django.contrib.gis.geos import GEOSGeometry, MultiPolygon, Polygon
from django.conf import settings
from django.core.management.base import BaseCommand
from councils.models import Council
class Command(BaseCommand):
"""
Turn off auto system check for all apps
We will maunally run system checks only for the
'councils' and 'pollingstations' apps
"""
requires_system_checks = False
def handle(self, **options):
"""
Manually run system checks for the
'councils' and 'pollingstations' apps
Management commands can ignore checks that only apply to
the apps supporting the website part of the project
"""
self.check([
apps.get_app_config('councils'),
apps.get_app_config('pollingstations')
])
if options['teardown']:
self.stdout.write('Clearing councils table..')
Council.objects.all().delete()
councils = []
self.stdout.write("Downloading GB boundaries from ONS...")
councils = councils + self.get_councils(
settings.GB_BOUNDARIES_URL, id_field='lad16cd', name_field='lad16nm')
self.stdout.write("Downloading NI boundaries from ONS...")
councils = councils + self.get_councils(
settings.NI_BOUNDARIES_URL, id_field='LGDCode', name_field='LGDNAME')
for council in councils:
self.stdout.write("Getting contact info for %s from YourVoteMatters" %\
(council.council_id))
info = self.get_contact_info_from_yvm(council.council_id)
council.name = info['name']
council.website = info['website']
council.email = info['email']
council.phone = info['phone']
council.address = info['address']
council.postcode = info['postcode']
self._save_council(council)
self.stdout.write('..done')
| [
11748,
27711,
198,
11748,
33918,
198,
11748,
7007,
198,
6738,
42625,
14208,
13,
18211,
1330,
6725,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
70,
271,
13,
469,
418,
1330,
22319,
2640,
10082,
15748,
11,
15237,
34220,
14520,
11,
12280,
14520,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
7295,
13,
27604,
13,
8692,
1330,
7308,
21575,
198,
6738,
27174,
13,
27530,
1330,
4281,
628,
198,
4871,
9455,
7,
14881,
21575,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
6756,
572,
8295,
1080,
2198,
329,
477,
6725,
198,
220,
220,
220,
775,
481,
285,
1942,
453,
1057,
1080,
8794,
691,
329,
262,
198,
220,
220,
220,
705,
66,
977,
2856,
82,
6,
290,
705,
30393,
278,
301,
602,
6,
6725,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
4433,
62,
10057,
62,
42116,
796,
10352,
628,
198,
220,
220,
220,
825,
5412,
7,
944,
11,
12429,
25811,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1869,
935,
1057,
1080,
8794,
329,
262,
198,
220,
220,
220,
220,
220,
220,
220,
705,
66,
977,
2856,
82,
6,
290,
705,
30393,
278,
301,
602,
6,
6725,
198,
220,
220,
220,
220,
220,
220,
220,
8549,
9729,
460,
8856,
8794,
326,
691,
4174,
284,
198,
220,
220,
220,
220,
220,
220,
220,
262,
6725,
6493,
262,
3052,
636,
286,
262,
1628,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
9122,
26933,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6725,
13,
1136,
62,
1324,
62,
11250,
10786,
66,
977,
2856,
82,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6725,
13,
1136,
62,
1324,
62,
11250,
10786,
30393,
278,
301,
602,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
33761,
628,
220,
220,
220,
220,
220,
220,
220,
611,
3689,
17816,
660,
446,
593,
6,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
19282,
448,
13,
13564,
10786,
34349,
1723,
27174,
3084,
492,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4281,
13,
48205,
13,
439,
22446,
33678,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
27174,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
19282,
448,
13,
13564,
7203,
10002,
278,
13124,
13215,
422,
6177,
50,
9313,
8,
198,
220,
220,
220,
220,
220,
220,
220,
27174,
796,
27174,
1343,
2116,
13,
1136,
62,
66,
977,
2856,
82,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6460,
13,
4579,
62,
33,
15919,
1503,
11015,
62,
21886,
11,
4686,
62,
3245,
11639,
9435,
1433,
10210,
3256,
1438,
62,
3245,
11639,
9435,
1433,
21533,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
19282,
448,
13,
13564,
7203,
10002,
278,
24947,
13215,
422,
6177,
50,
9313,
8,
198,
220,
220,
220,
220,
220,
220,
220,
27174,
796,
27174,
1343,
2116,
13,
1136,
62,
66,
977,
2856,
82,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6460,
13,
22125,
62,
33,
15919,
1503,
11015,
62,
21886,
11,
4686,
62,
3245,
11639,
41257,
9697,
1098,
3256,
1438,
62,
3245,
11639,
41257,
35,
20608,
11537,
628,
220,
220,
220,
220,
220,
220,
220,
329,
6745,
287,
27174,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
19282,
448,
13,
13564,
7203,
20570,
2800,
7508,
329,
4064,
82,
422,
3406,
37394,
19044,
1010,
1,
4064,
59,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
66,
977,
2856,
13,
66,
977,
2856,
62,
312,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7508,
796,
2116,
13,
1136,
62,
32057,
62,
10951,
62,
6738,
62,
88,
14761,
7,
66,
977,
2856,
13,
66,
977,
2856,
62,
312,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6745,
13,
3672,
796,
7508,
17816,
3672,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6745,
13,
732,
12485,
796,
7508,
17816,
732,
12485,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6745,
13,
12888,
796,
7508,
17816,
12888,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6745,
13,
4862,
796,
7508,
17816,
4862,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6745,
13,
21975,
796,
7508,
17816,
21975,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6745,
13,
7353,
8189,
796,
7508,
17816,
7353,
8189,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
21928,
62,
66,
977,
2856,
7,
66,
977,
2856,
8,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
19282,
448,
13,
13564,
10786,
492,
28060,
11537,
198
] | 2.404562 | 833 |
from pathlib import Path
from tools.config import Config, ResumeConfig
from tools.runner import CustomRunner
if __name__ == '__main__':
resume_config = ResumeConfig.cli("Pix2Pix Tensorflow 2 Keras implementation")
config = Config.load(Path(resume_config.path).joinpath("config.json"))
CustomRunner.resume(config=config, resume_config=resume_config)
| [
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
4899,
13,
11250,
1330,
17056,
11,
1874,
2454,
16934,
198,
6738,
4899,
13,
16737,
1330,
8562,
49493,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
15294,
62,
11250,
796,
1874,
2454,
16934,
13,
44506,
7203,
47,
844,
17,
47,
844,
309,
22854,
11125,
362,
17337,
292,
7822,
4943,
198,
220,
220,
220,
4566,
796,
17056,
13,
2220,
7,
15235,
7,
411,
2454,
62,
11250,
13,
6978,
737,
22179,
6978,
7203,
11250,
13,
17752,
48774,
198,
220,
220,
220,
8562,
49493,
13,
411,
2454,
7,
11250,
28,
11250,
11,
15294,
62,
11250,
28,
411,
2454,
62,
11250,
8,
198
] | 3.184211 | 114 |
import re
import argparse
from string import punctuation
from scipy.io import wavfile
import torch
import yaml
import numpy as np
from torch.utils.data import DataLoader
from g2p_en import G2p
from pypinyin import pinyin, Style
from utils.model import get_model, get_vocoder
from utils.tools import to_device, synth_samples, synth_wav
from dataset import TextDataset
from text import text_to_sequence, vi_number_1, vi_abbreviation
import time
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
# device = torch.device("cpu")
g2p = G2p()
# @torch.jit.script
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--restore_step", type=int, required=True)
parser.add_argument(
"--mode",
type=str,
choices=["batch", "single", "single_wav"],
required=True,
help="Synthesize a whole dataset or a single sentence",
)
parser.add_argument(
"--source",
type=str,
default=None,
help="path to a source file with format like train.txt and val.txt, for batch mode only",
)
parser.add_argument(
"--text",
type=str,
default=None,
help="raw text to synthesize, for single-sentence mode only",
)
parser.add_argument(
"--speaker_id",
type=int,
default=0,
help="speaker ID for multi-speaker synthesis, for single-sentence mode only",
)
parser.add_argument(
"-p",
"--preprocess_config",
type=str,
required=True,
help="path to preprocess.yaml",
)
parser.add_argument(
"-m", "--model_config", type=str, required=True, help="path to model.yaml"
)
parser.add_argument(
"-t", "--train_config", type=str, required=True, help="path to train.yaml"
)
parser.add_argument(
"--pitch_control",
type=float,
default=1.0,
help="control the pitch of the whole utterance, larger value for higher pitch",
)
parser.add_argument(
"--energy_control",
type=float,
default=1.0,
help="control the energy of the whole utterance, larger value for larger volume",
)
parser.add_argument(
"--duration_control",
type=float,
default=1.0,
help="control the speed of the whole utterance, larger value for slower speaking rate",
)
args = parser.parse_args()
# Check source texts
if args.mode == "batch":
assert args.source is not None and args.text is None
if args.mode == "single":
assert args.source is None and args.text is not None
# Read Config
preprocess_config = yaml.load(
open(args.preprocess_config, "r"), Loader=yaml.FullLoader
)
model_config = yaml.load(open(args.model_config, "r"), Loader=yaml.FullLoader)
train_config = yaml.load(open(args.train_config, "r"), Loader=yaml.FullLoader)
configs = (preprocess_config, model_config, train_config)
# Get model
model = get_model(args, configs, device, train=False)
# wrapped_model = torch.jit.script(model)
# wrapped_model.save('script_model.pt')
# model = torch.jit.load("script_model.pt")
# Load vocoder
vocoder = get_vocoder(model_config, device)
# vocoder = torch.jit.script(vocoder)
# vocoder.save('script_vocoder.pt')
# vocoder = torch.jit.load('script_vocoder.pt')
# exit()
control_values = args.pitch_control, args.energy_control, args.duration_control
# Preprocess texts
if args.mode == "batch":
# Get dataset
_start = time.time()
dataset = TextDataset(args.source, preprocess_config)
batchs = DataLoader(
dataset,
batch_size=8,
collate_fn=dataset.collate_fn,
)
print(f"Loaded {len(dataset)} file after {time.time()-_start}")
synthesize(model, args.restore_step, configs, vocoder, batchs, control_values)
if args.mode == "single":
ids = raw_texts = [args.text[:100]]
speakers = np.array([args.speaker_id])
if preprocess_config["preprocessing"]["text"]["language"] == "en":
texts = np.array([preprocess_english(
args.text, preprocess_config)])
elif preprocess_config["preprocessing"]["text"]["language"] == "zh":
texts = np.array(preprocess_mandarin(
args.text, preprocess_config))
text_lens = np.array([len(texts)])
batchs = [(ids, raw_texts, speakers, texts, text_lens, max(text_lens))]
synthesize(model, args.restore_step, configs,
vocoder, batchs, control_values)
if args.mode == "single_wav":
ids = raw_texts = [args.text[:100]]
speakers = torch.tensor([args.speaker_id])
if preprocess_config["preprocessing"]["text"]["language"] == "en":
# texts = torch.tensor(preprocess_english(args.text, preprocess_config))
texts = torch.tensor(preprocess_vie(
args.text, './lexicon/viet-tts-lexicon.txt', 'vietnamese_cleaners'))
elif preprocess_config["preprocessing"]["text"]["language"] == "zh":
texts = torch.tensor(preprocess_mandarin(
args.text, preprocess_config))
# preprocess_vie.save('./script_preprocess_vie.pt')
text_lens = torch.tensor([len(texts[0])])
batchs = [(ids, raw_texts, speakers, texts, text_lens, max(text_lens))]
# synthesize_wav(model, args.restore_step, configs, vocoder, batchs, control_values)
from e2e import E2E
e2e_model = E2E('./script_model.pt', './script_vocoder.pt',
model_config, preprocess_config)
# e2e_model = torch.jit.script(e2e_model)
# e2e_model.save('./script_e2e.pt')
# e2e_model = torch.jit.load('./script_e2e.pt')
wav_files = e2e_model(to_device(batchs[0], device))
print(wav_files)
| [
11748,
302,
201,
198,
11748,
1822,
29572,
201,
198,
6738,
4731,
1330,
21025,
2288,
201,
198,
6738,
629,
541,
88,
13,
952,
1330,
266,
615,
7753,
201,
198,
201,
198,
11748,
28034,
201,
198,
11748,
331,
43695,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
6060,
17401,
201,
198,
6738,
308,
17,
79,
62,
268,
1330,
402,
17,
79,
201,
198,
6738,
279,
4464,
3541,
259,
1330,
279,
3541,
259,
11,
17738,
201,
198,
201,
198,
6738,
3384,
4487,
13,
19849,
1330,
651,
62,
19849,
11,
651,
62,
18893,
12342,
201,
198,
6738,
3384,
4487,
13,
31391,
1330,
284,
62,
25202,
11,
33549,
62,
82,
12629,
11,
33549,
62,
45137,
201,
198,
6738,
27039,
1330,
8255,
27354,
292,
316,
201,
198,
6738,
2420,
1330,
2420,
62,
1462,
62,
43167,
11,
25357,
62,
17618,
62,
16,
11,
25357,
62,
397,
4679,
47625,
201,
198,
11748,
640,
201,
198,
25202,
796,
28034,
13,
25202,
7203,
66,
15339,
1,
611,
28034,
13,
66,
15339,
13,
271,
62,
15182,
3419,
2073,
366,
36166,
4943,
201,
198,
2,
3335,
796,
28034,
13,
25202,
7203,
36166,
4943,
201,
198,
201,
198,
201,
198,
201,
198,
70,
17,
79,
796,
402,
17,
79,
3419,
201,
198,
201,
198,
2,
2488,
13165,
354,
13,
45051,
13,
12048,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
201,
198,
201,
198,
220,
220,
220,
30751,
796,
1822,
29572,
13,
28100,
1713,
46677,
3419,
201,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7203,
438,
2118,
382,
62,
9662,
1600,
2099,
28,
600,
11,
2672,
28,
17821,
8,
201,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7,
201,
198,
220,
220,
220,
220,
220,
220,
220,
366,
438,
14171,
1600,
201,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
28,
2536,
11,
201,
198,
220,
220,
220,
220,
220,
220,
220,
7747,
28,
14692,
43501,
1600,
366,
29762,
1600,
366,
29762,
62,
45137,
33116,
201,
198,
220,
220,
220,
220,
220,
220,
220,
2672,
28,
17821,
11,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1037,
2625,
13940,
429,
956,
1096,
257,
2187,
27039,
393,
257,
2060,
6827,
1600,
201,
198,
220,
220,
220,
1267,
201,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7,
201,
198,
220,
220,
220,
220,
220,
220,
220,
366,
438,
10459,
1600,
201,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
28,
2536,
11,
201,
198,
220,
220,
220,
220,
220,
220,
220,
4277,
28,
14202,
11,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1037,
2625,
6978,
284,
257,
2723,
2393,
351,
5794,
588,
4512,
13,
14116,
290,
1188,
13,
14116,
11,
329,
15458,
4235,
691,
1600,
201,
198,
220,
220,
220,
1267,
201,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7,
201,
198,
220,
220,
220,
220,
220,
220,
220,
366,
438,
5239,
1600,
201,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
28,
2536,
11,
201,
198,
220,
220,
220,
220,
220,
220,
220,
4277,
28,
14202,
11,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1037,
2625,
1831,
2420,
284,
24983,
1096,
11,
329,
2060,
12,
34086,
594,
4235,
691,
1600,
201,
198,
220,
220,
220,
1267,
201,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7,
201,
198,
220,
220,
220,
220,
220,
220,
220,
366,
438,
4125,
3110,
62,
312,
1600,
201,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
28,
600,
11,
201,
198,
220,
220,
220,
220,
220,
220,
220,
4277,
28,
15,
11,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1037,
2625,
4125,
3110,
4522,
329,
5021,
12,
4125,
3110,
21263,
11,
329,
2060,
12,
34086,
594,
4235,
691,
1600,
201,
198,
220,
220,
220,
1267,
201,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7,
201,
198,
220,
220,
220,
220,
220,
220,
220,
27444,
79,
1600,
201,
198,
220,
220,
220,
220,
220,
220,
220,
366,
438,
3866,
14681,
62,
11250,
1600,
201,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
28,
2536,
11,
201,
198,
220,
220,
220,
220,
220,
220,
220,
2672,
28,
17821,
11,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1037,
2625,
6978,
284,
662,
14681,
13,
88,
43695,
1600,
201,
198,
220,
220,
220,
1267,
201,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7,
201,
198,
220,
220,
220,
220,
220,
220,
220,
27444,
76,
1600,
366,
438,
19849,
62,
11250,
1600,
2099,
28,
2536,
11,
2672,
28,
17821,
11,
1037,
2625,
6978,
284,
2746,
13,
88,
43695,
1,
201,
198,
220,
220,
220,
1267,
201,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7,
201,
198,
220,
220,
220,
220,
220,
220,
220,
27444,
83,
1600,
366,
438,
27432,
62,
11250,
1600,
2099,
28,
2536,
11,
2672,
28,
17821,
11,
1037,
2625,
6978,
284,
4512,
13,
88,
43695,
1,
201,
198,
220,
220,
220,
1267,
201,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7,
201,
198,
220,
220,
220,
220,
220,
220,
220,
366,
438,
79,
2007,
62,
13716,
1600,
201,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
28,
22468,
11,
201,
198,
220,
220,
220,
220,
220,
220,
220,
4277,
28,
16,
13,
15,
11,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1037,
2625,
13716,
262,
7078,
286,
262,
2187,
10517,
590,
11,
4025,
1988,
329,
2440,
7078,
1600,
201,
198,
220,
220,
220,
1267,
201,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7,
201,
198,
220,
220,
220,
220,
220,
220,
220,
366,
438,
22554,
62,
13716,
1600,
201,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
28,
22468,
11,
201,
198,
220,
220,
220,
220,
220,
220,
220,
4277,
28,
16,
13,
15,
11,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1037,
2625,
13716,
262,
2568,
286,
262,
2187,
10517,
590,
11,
4025,
1988,
329,
4025,
6115,
1600,
201,
198,
220,
220,
220,
1267,
201,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7,
201,
198,
220,
220,
220,
220,
220,
220,
220,
366,
438,
32257,
62,
13716,
1600,
201,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
28,
22468,
11,
201,
198,
220,
220,
220,
220,
220,
220,
220,
4277,
28,
16,
13,
15,
11,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1037,
2625,
13716,
262,
2866,
286,
262,
2187,
10517,
590,
11,
4025,
1988,
329,
13611,
5486,
2494,
1600,
201,
198,
220,
220,
220,
1267,
201,
198,
220,
220,
220,
26498,
796,
30751,
13,
29572,
62,
22046,
3419,
201,
198,
201,
198,
220,
220,
220,
1303,
6822,
2723,
13399,
201,
198,
220,
220,
220,
611,
26498,
13,
14171,
6624,
366,
43501,
1298,
201,
198,
220,
220,
220,
220,
220,
220,
220,
6818,
26498,
13,
10459,
318,
407,
6045,
290,
26498,
13,
5239,
318,
6045,
201,
198,
220,
220,
220,
611,
26498,
13,
14171,
6624,
366,
29762,
1298,
201,
198,
220,
220,
220,
220,
220,
220,
220,
6818,
26498,
13,
10459,
318,
6045,
290,
26498,
13,
5239,
318,
407,
6045,
201,
198,
201,
198,
220,
220,
220,
1303,
4149,
17056,
201,
198,
220,
220,
220,
662,
14681,
62,
11250,
796,
331,
43695,
13,
2220,
7,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1280,
7,
22046,
13,
3866,
14681,
62,
11250,
11,
366,
81,
12340,
8778,
263,
28,
88,
43695,
13,
13295,
17401,
201,
198,
220,
220,
220,
1267,
201,
198,
220,
220,
220,
2746,
62,
11250,
796,
331,
43695,
13,
2220,
7,
9654,
7,
22046,
13,
19849,
62,
11250,
11,
366,
81,
12340,
8778,
263,
28,
88,
43695,
13,
13295,
17401,
8,
201,
198,
220,
220,
220,
4512,
62,
11250,
796,
331,
43695,
13,
2220,
7,
9654,
7,
22046,
13,
27432,
62,
11250,
11,
366,
81,
12340,
8778,
263,
28,
88,
43695,
13,
13295,
17401,
8,
201,
198,
220,
220,
220,
4566,
82,
796,
357,
3866,
14681,
62,
11250,
11,
2746,
62,
11250,
11,
4512,
62,
11250,
8,
201,
198,
201,
198,
220,
220,
220,
1303,
3497,
2746,
201,
198,
220,
220,
220,
2746,
796,
651,
62,
19849,
7,
22046,
11,
4566,
82,
11,
3335,
11,
4512,
28,
25101,
8,
201,
198,
220,
220,
220,
1303,
12908,
62,
19849,
796,
28034,
13,
45051,
13,
12048,
7,
19849,
8,
201,
198,
220,
220,
220,
1303,
12908,
62,
19849,
13,
21928,
10786,
12048,
62,
19849,
13,
457,
11537,
201,
198,
201,
198,
220,
220,
220,
1303,
2746,
796,
28034,
13,
45051,
13,
2220,
7203,
12048,
62,
19849,
13,
457,
4943,
201,
198,
201,
198,
220,
220,
220,
1303,
8778,
12776,
12342,
201,
198,
220,
220,
220,
12776,
12342,
796,
651,
62,
18893,
12342,
7,
19849,
62,
11250,
11,
3335,
8,
201,
198,
220,
220,
220,
1303,
12776,
12342,
796,
28034,
13,
45051,
13,
12048,
7,
18893,
12342,
8,
201,
198,
220,
220,
220,
1303,
12776,
12342,
13,
21928,
10786,
12048,
62,
18893,
12342,
13,
457,
11537,
201,
198,
220,
220,
220,
1303,
12776,
12342,
796,
28034,
13,
45051,
13,
2220,
10786,
12048,
62,
18893,
12342,
13,
457,
11537,
201,
198,
220,
220,
220,
1303,
8420,
3419,
201,
198,
201,
198,
220,
220,
220,
1630,
62,
27160,
796,
26498,
13,
79,
2007,
62,
13716,
11,
26498,
13,
22554,
62,
13716,
11,
26498,
13,
32257,
62,
13716,
201,
198,
220,
220,
220,
1303,
3771,
14681,
13399,
201,
198,
220,
220,
220,
611,
26498,
13,
14171,
6624,
366,
43501,
1298,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
3497,
27039,
201,
198,
220,
220,
220,
220,
220,
220,
220,
4808,
9688,
796,
640,
13,
2435,
3419,
201,
198,
220,
220,
220,
220,
220,
220,
220,
27039,
796,
8255,
27354,
292,
316,
7,
22046,
13,
10459,
11,
662,
14681,
62,
11250,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
15458,
82,
796,
6060,
17401,
7,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27039,
11,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15458,
62,
7857,
28,
23,
11,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2927,
378,
62,
22184,
28,
19608,
292,
316,
13,
26000,
378,
62,
22184,
11,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
201,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
69,
1,
8912,
276,
1391,
11925,
7,
19608,
292,
316,
38165,
2393,
706,
1391,
2435,
13,
2435,
3419,
12,
62,
9688,
92,
4943,
201,
198,
220,
220,
220,
220,
220,
220,
220,
24983,
1096,
7,
19849,
11,
26498,
13,
2118,
382,
62,
9662,
11,
4566,
82,
11,
12776,
12342,
11,
15458,
82,
11,
1630,
62,
27160,
8,
201,
198,
220,
220,
220,
611,
26498,
13,
14171,
6624,
366,
29762,
1298,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
2340,
796,
8246,
62,
5239,
82,
796,
685,
22046,
13,
5239,
58,
25,
3064,
11907,
201,
198,
220,
220,
220,
220,
220,
220,
220,
11636,
796,
45941,
13,
18747,
26933,
22046,
13,
4125,
3110,
62,
312,
12962,
201,
198,
220,
220,
220,
220,
220,
220,
220,
611,
662,
14681,
62,
11250,
14692,
3866,
36948,
1,
7131,
1,
5239,
1,
7131,
1,
16129,
8973,
6624,
366,
268,
1298,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13399,
796,
45941,
13,
18747,
26933,
3866,
14681,
62,
39126,
7,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26498,
13,
5239,
11,
662,
14681,
62,
11250,
8,
12962,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
662,
14681,
62,
11250,
14692,
3866,
36948,
1,
7131,
1,
5239,
1,
7131,
1,
16129,
8973,
6624,
366,
23548,
1298,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13399,
796,
45941,
13,
18747,
7,
3866,
14681,
62,
22249,
17714,
7,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26498,
13,
5239,
11,
662,
14681,
62,
11250,
4008,
201,
198,
220,
220,
220,
220,
220,
220,
220,
2420,
62,
75,
641,
796,
45941,
13,
18747,
26933,
11925,
7,
5239,
82,
8,
12962,
201,
198,
220,
220,
220,
220,
220,
220,
220,
15458,
82,
796,
47527,
2340,
11,
8246,
62,
5239,
82,
11,
11636,
11,
13399,
11,
2420,
62,
75,
641,
11,
3509,
7,
5239,
62,
75,
641,
4008,
60,
201,
198,
220,
220,
220,
220,
220,
220,
220,
24983,
1096,
7,
19849,
11,
26498,
13,
2118,
382,
62,
9662,
11,
4566,
82,
11,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12776,
12342,
11,
15458,
82,
11,
1630,
62,
27160,
8,
201,
198,
220,
220,
220,
611,
26498,
13,
14171,
6624,
366,
29762,
62,
45137,
1298,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
2340,
796,
8246,
62,
5239,
82,
796,
685,
22046,
13,
5239,
58,
25,
3064,
11907,
201,
198,
220,
220,
220,
220,
220,
220,
220,
11636,
796,
28034,
13,
83,
22854,
26933,
22046,
13,
4125,
3110,
62,
312,
12962,
201,
198,
220,
220,
220,
220,
220,
220,
220,
611,
662,
14681,
62,
11250,
14692,
3866,
36948,
1,
7131,
1,
5239,
1,
7131,
1,
16129,
8973,
6624,
366,
268,
1298,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
13399,
796,
28034,
13,
83,
22854,
7,
3866,
14681,
62,
39126,
7,
22046,
13,
5239,
11,
662,
14681,
62,
11250,
4008,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13399,
796,
28034,
13,
83,
22854,
7,
3866,
14681,
62,
85,
494,
7,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26498,
13,
5239,
11,
705,
19571,
2588,
4749,
14,
85,
1155,
12,
83,
912,
12,
2588,
4749,
13,
14116,
3256,
705,
85,
1155,
22678,
62,
27773,
364,
6,
4008,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
662,
14681,
62,
11250,
14692,
3866,
36948,
1,
7131,
1,
5239,
1,
7131,
1,
16129,
8973,
6624,
366,
23548,
1298,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13399,
796,
28034,
13,
83,
22854,
7,
3866,
14681,
62,
22249,
17714,
7,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26498,
13,
5239,
11,
662,
14681,
62,
11250,
4008,
201,
198,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
662,
14681,
62,
85,
494,
13,
21928,
7,
4458,
14,
12048,
62,
3866,
14681,
62,
85,
494,
13,
457,
11537,
201,
198,
220,
220,
220,
220,
220,
220,
220,
2420,
62,
75,
641,
796,
28034,
13,
83,
22854,
26933,
11925,
7,
5239,
82,
58,
15,
12962,
12962,
201,
198,
220,
220,
220,
220,
220,
220,
220,
15458,
82,
796,
47527,
2340,
11,
8246,
62,
5239,
82,
11,
11636,
11,
13399,
11,
2420,
62,
75,
641,
11,
3509,
7,
5239,
62,
75,
641,
4008,
60,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
24983,
1096,
62,
45137,
7,
19849,
11,
26498,
13,
2118,
382,
62,
9662,
11,
4566,
82,
11,
12776,
12342,
11,
15458,
82,
11,
1630,
62,
27160,
8,
201,
198,
220,
220,
220,
220,
201,
198,
220,
220,
220,
220,
220,
220,
220,
422,
304,
17,
68,
1330,
412,
17,
36,
201,
198,
220,
220,
220,
220,
220,
220,
220,
304,
17,
68,
62,
19849,
796,
412,
17,
36,
7,
4458,
14,
12048,
62,
19849,
13,
457,
3256,
705,
19571,
12048,
62,
18893,
12342,
13,
457,
3256,
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,
2746,
62,
11250,
11,
662,
14681,
62,
11250,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
304,
17,
68,
62,
19849,
796,
28034,
13,
45051,
13,
12048,
7,
68,
17,
68,
62,
19849,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
304,
17,
68,
62,
19849,
13,
21928,
7,
4458,
14,
12048,
62,
68,
17,
68,
13,
457,
11537,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
304,
17,
68,
62,
19849,
796,
28034,
13,
45051,
13,
2220,
7,
4458,
14,
12048,
62,
68,
17,
68,
13,
457,
11537,
201,
198,
220,
220,
220,
220,
220,
220,
220,
266,
615,
62,
16624,
796,
304,
17,
68,
62,
19849,
7,
1462,
62,
25202,
7,
43501,
82,
58,
15,
4357,
3335,
4008,
201,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
45137,
62,
16624,
8,
201,
198
] | 2.212658 | 2,765 |
"""
swat-s1 topology
"""
from mininet.topo import Topo as TopoBase
from pinger import Pinger
from plc2 import Plc2
from plc1 import Plc1
| [
37811,
198,
2032,
265,
12,
82,
16,
1353,
1435,
198,
37811,
198,
198,
6738,
949,
42504,
13,
4852,
78,
1330,
5849,
78,
355,
5849,
78,
14881,
198,
198,
6738,
279,
3889,
1330,
350,
3889,
198,
6738,
458,
66,
17,
1330,
1345,
66,
17,
198,
6738,
458,
66,
16,
1330,
1345,
66,
16,
628
] | 2.641509 | 53 |
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import rc
rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
rc('text', usetex=True)
c =0.9996
f = lambda p: 1/((1-c)+(c/p))
p_list = np.arange(1,1024)
N=100
tsm = 18.4e-9
tnode = 65e-9
tproc = 0.08e-9
toff = 27e-3
T = N*N/6
dt = 0.24
plt.figure()
plt.plot(p_list, p_list, label = 'Linear Speedup', color = 'k', linewidth=2)
plt.plot(p_list, list(map(f,p_list)), label = 'Amdahl', color = '#cc0000',linewidth=2)
N=5000
plt.plot(p_list, list(map(Sth,p_list)), alpha=0.5,label = 'Spx : 5000x5000 px', color = '#14a323') #color = '#1fc200') #color = '#004c99')
N=3000
plt.plot(p_list, list(map(Sth,p_list)), alpha=0.5,label = 'Spx : 3000x3000 px', color = '#00bf13') #color = '#1fc200') #color = '#004c99')
N=1500
plt.plot(p_list, list(map(Sth,p_list)), alpha=0.5,label = 'Spx : 1500x1500 px', color = '#00c654') #color = '#1fc200') #color = '#004c99')
N=1000
plt.plot(p_list, list(map(Sth,p_list)), alpha=0.5,label = 'Spx : 1000x1000 px', color = '#00ce9a') #color = '#00d280') #color = '#0080ff')
N=500
plt.plot(p_list, list(map(Sth,p_list)), alpha=0.5,label = 'Spx : 500x500 px', color = '#00c5d5') #color = '#00d9d9') #color = '#66b2ff')
N=300
plt.plot(p_list, list(map(Sth,p_list)), alpha=0.5,label = 'Spx : 300x300 px', color = '#00a5d9') #color='#005fe5') #, color='#99ccff')
N=200
plt.plot(p_list, list(map(Sth,p_list)), alpha=0.5,label = 'Spx : 200x200 px', color = '#0084dd') #color='#005fe5') #, color='#99ccff')
N=100
plt.plot(p_list, list(map(Sth,p_list)), alpha=0.5,label = 'Spx : 100x100 px', color='#003ee5') # color='#005fe5') #, color='#99ccff')
#plt.plot(p_list, list(map(S,p_list)), label = 'Hardware')
plt.legend(loc = 'upper left')
plt.grid(which = 'both')
plt.xlim([0,1024])
plt.xlabel('Number of computing cores', fontweight = 'bold', fontsize = 12)
plt.ylabel('Speedup', fontweight = 'bold', fontsize = 12)
plt.title('Speedup as a function of number of cores.', fontweight = 'bold', fontsize = 14)
plt.ylim([0, 1050])
plt.savefig('ThSpeedupLow.png')
plt.show()
| [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
2603,
29487,
8019,
1330,
48321,
198,
6015,
10786,
10331,
3256,
1174,
90,
6,
17989,
10354,
6,
82,
504,
12,
2655,
361,
41707,
82,
504,
12,
2655,
361,
10354,
17816,
39,
32667,
3970,
20520,
30072,
198,
6015,
10786,
5239,
3256,
514,
316,
1069,
28,
17821,
8,
198,
198,
66,
796,
15,
13,
2079,
4846,
198,
69,
796,
37456,
279,
25,
352,
14,
19510,
16,
12,
66,
8,
33747,
66,
14,
79,
4008,
198,
198,
79,
62,
4868,
796,
45941,
13,
283,
858,
7,
16,
11,
35500,
8,
628,
198,
45,
28,
3064,
198,
912,
76,
796,
1248,
13,
19,
68,
12,
24,
198,
83,
17440,
796,
6135,
68,
12,
24,
198,
83,
36942,
796,
657,
13,
2919,
68,
12,
24,
198,
1462,
487,
796,
2681,
68,
12,
18,
198,
51,
796,
399,
9,
45,
14,
21,
198,
28664,
796,
657,
13,
1731,
628,
628,
198,
489,
83,
13,
26875,
3419,
198,
489,
83,
13,
29487,
7,
79,
62,
4868,
11,
279,
62,
4868,
11,
6167,
796,
705,
14993,
451,
8729,
929,
3256,
3124,
796,
705,
74,
3256,
9493,
413,
5649,
28,
17,
8,
198,
489,
83,
13,
29487,
7,
79,
62,
4868,
11,
1351,
7,
8899,
7,
69,
11,
79,
62,
4868,
36911,
6167,
796,
705,
5840,
67,
15668,
3256,
3124,
796,
705,
2,
535,
2388,
3256,
2815,
413,
5649,
28,
17,
8,
198,
45,
28,
27641,
198,
489,
83,
13,
29487,
7,
79,
62,
4868,
11,
1351,
7,
8899,
7,
50,
400,
11,
79,
62,
4868,
36911,
17130,
28,
15,
13,
20,
11,
18242,
796,
705,
4561,
87,
1058,
23336,
87,
27641,
279,
87,
3256,
3124,
796,
705,
2,
1415,
64,
32637,
11537,
1303,
8043,
796,
705,
2,
16,
16072,
2167,
11537,
1303,
8043,
796,
705,
2,
22914,
66,
2079,
11537,
198,
45,
28,
23924,
198,
489,
83,
13,
29487,
7,
79,
62,
4868,
11,
1351,
7,
8899,
7,
50,
400,
11,
79,
62,
4868,
36911,
17130,
28,
15,
13,
20,
11,
18242,
796,
705,
4561,
87,
1058,
20343,
87,
23924,
279,
87,
3256,
3124,
796,
705,
2,
405,
19881,
1485,
11537,
1303,
8043,
796,
705,
2,
16,
16072,
2167,
11537,
1303,
8043,
796,
705,
2,
22914,
66,
2079,
11537,
198,
45,
28,
33698,
198,
489,
83,
13,
29487,
7,
79,
62,
4868,
11,
1351,
7,
8899,
7,
50,
400,
11,
79,
62,
4868,
36911,
17130,
28,
15,
13,
20,
11,
18242,
796,
705,
4561,
87,
1058,
20007,
87,
33698,
279,
87,
3256,
3124,
796,
705,
2,
405,
66,
39111,
11537,
1303,
8043,
796,
705,
2,
16,
16072,
2167,
11537,
1303,
8043,
796,
705,
2,
22914,
66,
2079,
11537,
198,
45,
28,
12825,
198,
489,
83,
13,
29487,
7,
79,
62,
4868,
11,
1351,
7,
8899,
7,
50,
400,
11,
79,
62,
4868,
36911,
17130,
28,
15,
13,
20,
11,
18242,
796,
705,
4561,
87,
1058,
8576,
87,
12825,
279,
87,
3256,
3124,
796,
705,
2,
405,
344,
24,
64,
11537,
1303,
8043,
796,
705,
2,
405,
67,
21033,
11537,
1303,
8043,
796,
705,
2,
405,
1795,
487,
11537,
198,
45,
28,
4059,
198,
489,
83,
13,
29487,
7,
79,
62,
4868,
11,
1351,
7,
8899,
7,
50,
400,
11,
79,
62,
4868,
36911,
17130,
28,
15,
13,
20,
11,
18242,
796,
705,
4561,
87,
1058,
5323,
87,
4059,
279,
87,
3256,
3124,
796,
705,
2,
405,
66,
20,
67,
20,
11537,
1303,
8043,
796,
705,
2,
405,
67,
24,
67,
24,
11537,
1303,
8043,
796,
705,
2,
2791,
65,
17,
487,
11537,
198,
45,
28,
6200,
198,
489,
83,
13,
29487,
7,
79,
62,
4868,
11,
1351,
7,
8899,
7,
50,
400,
11,
79,
62,
4868,
36911,
17130,
28,
15,
13,
20,
11,
18242,
796,
705,
4561,
87,
1058,
5867,
87,
6200,
279,
87,
3256,
3124,
796,
705,
2,
405,
64,
20,
67,
24,
11537,
1303,
8043,
11639,
2,
22544,
5036,
20,
11537,
1303,
11,
3124,
11639,
2,
2079,
535,
487,
11537,
198,
45,
28,
2167,
198,
489,
83,
13,
29487,
7,
79,
62,
4868,
11,
1351,
7,
8899,
7,
50,
400,
11,
79,
62,
4868,
36911,
17130,
28,
15,
13,
20,
11,
18242,
796,
705,
4561,
87,
1058,
939,
87,
2167,
279,
87,
3256,
3124,
796,
705,
2,
405,
5705,
1860,
11537,
1303,
8043,
11639,
2,
22544,
5036,
20,
11537,
1303,
11,
3124,
11639,
2,
2079,
535,
487,
11537,
198,
45,
28,
3064,
198,
489,
83,
13,
29487,
7,
79,
62,
4868,
11,
1351,
7,
8899,
7,
50,
400,
11,
79,
62,
4868,
36911,
17130,
28,
15,
13,
20,
11,
18242,
796,
705,
4561,
87,
1058,
1802,
87,
3064,
279,
87,
3256,
3124,
11639,
2,
11245,
1453,
20,
11537,
1303,
3124,
11639,
2,
22544,
5036,
20,
11537,
1303,
11,
3124,
11639,
2,
2079,
535,
487,
11537,
198,
198,
2,
489,
83,
13,
29487,
7,
79,
62,
4868,
11,
1351,
7,
8899,
7,
50,
11,
79,
62,
4868,
36911,
6167,
796,
705,
49865,
11537,
198,
489,
83,
13,
1455,
437,
7,
17946,
796,
705,
45828,
1364,
11537,
198,
489,
83,
13,
25928,
7,
4758,
796,
705,
16885,
11537,
198,
489,
83,
13,
87,
2475,
26933,
15,
11,
35500,
12962,
198,
489,
83,
13,
87,
18242,
10786,
15057,
286,
14492,
21758,
3256,
10369,
6551,
796,
705,
36575,
3256,
10369,
7857,
796,
1105,
8,
198,
489,
83,
13,
2645,
9608,
10786,
22785,
929,
3256,
10369,
6551,
796,
705,
36575,
3256,
10369,
7857,
796,
1105,
8,
198,
489,
83,
13,
7839,
10786,
22785,
929,
355,
257,
2163,
286,
1271,
286,
21758,
2637,
11,
10369,
6551,
796,
705,
36575,
3256,
10369,
7857,
796,
1478,
8,
198,
489,
83,
13,
88,
2475,
26933,
15,
11,
47235,
12962,
198,
489,
83,
13,
21928,
5647,
10786,
817,
22785,
929,
20535,
13,
11134,
11537,
198,
489,
83,
13,
12860,
3419,
198
] | 2.153846 | 962 |
from urllib.request import urlopen
# ------------------ MITAB FUNCTIONS ------------------
# -----------------------------------------------------
# Note that we are only going to get 10 interactions at most
queryUrl = "http://www.ebi.ac.uk/Tools/webservices/psicquic/intact/webservices/current/search/query/BBC1?firstResult=0&maxResults=10";
try:
fileHandle = urlopen(queryUrl)
content = fileHandle.read()
fileHandle.close()
except IOError:
print('Cannot open URL ' + urlStr)
content = ''
lines = content.splitlines()
for line in lines:
line = str(line, encoding='utf8')
cols = line.split('\t')
print(getXrefByDatabase(cols[0], 'uniprotkb') + ' interacts with ' + getXrefByDatabase(cols[1], 'uniprotkb'))
| [
6738,
2956,
297,
571,
13,
25927,
1330,
19016,
9654,
198,
198,
2,
34400,
438,
17168,
6242,
29397,
4177,
11053,
34400,
438,
198,
198,
2,
20368,
19351,
12,
198,
2,
5740,
326,
356,
389,
691,
1016,
284,
651,
838,
12213,
379,
749,
198,
22766,
28165,
796,
366,
4023,
1378,
2503,
13,
1765,
72,
13,
330,
13,
2724,
14,
33637,
14,
732,
1443,
712,
1063,
14,
862,
291,
421,
291,
14,
600,
529,
14,
732,
1443,
712,
1063,
14,
14421,
14,
12947,
14,
22766,
14,
33833,
16,
30,
11085,
23004,
28,
15,
5,
9806,
25468,
28,
940,
8172,
198,
198,
28311,
25,
198,
220,
220,
220,
2393,
37508,
796,
19016,
9654,
7,
22766,
28165,
8,
198,
220,
220,
220,
2695,
796,
2393,
37508,
13,
961,
3419,
198,
220,
220,
220,
2393,
37508,
13,
19836,
3419,
198,
16341,
24418,
12331,
25,
198,
220,
220,
220,
3601,
10786,
34,
34574,
1280,
10289,
705,
1343,
19016,
13290,
8,
198,
220,
220,
220,
2695,
796,
10148,
198,
198,
6615,
796,
2695,
13,
35312,
6615,
3419,
198,
198,
1640,
1627,
287,
3951,
25,
198,
220,
220,
220,
1627,
796,
965,
7,
1370,
11,
21004,
11639,
40477,
23,
11537,
198,
220,
220,
220,
951,
82,
796,
1627,
13,
35312,
10786,
59,
83,
11537,
628,
220,
220,
220,
3601,
7,
1136,
55,
5420,
3886,
38105,
7,
4033,
82,
58,
15,
4357,
705,
403,
541,
10599,
32812,
11537,
1343,
705,
44020,
351,
705,
1343,
651,
55,
5420,
3886,
38105,
7,
4033,
82,
58,
16,
4357,
705,
403,
541,
10599,
32812,
6,
4008,
628
] | 2.944664 | 253 |
# -*- coding: utf-8 -*-
"""
Created on Sep 6, 2020
@author: eljeffe
Copyright 2020 Root the Box
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 os import urandom
from hashlib import sha256
from sqlalchemy import Column, ForeignKey
from sqlalchemy.types import String, Boolean, Integer
from models import dbsession
from models.BaseModels import DatabaseObject
from libs.StringCoding import encode
from datetime import datetime, timedelta
class PasswordToken(DatabaseObject):
""" Password token definition """
user_id = Column(Integer, ForeignKey("user.id", ondelete="CASCADE"), nullable=False)
value = Column(String(32), unique=True, nullable=False)
used = Column(Boolean, nullable=False, default=False)
@classmethod
def all(cls):
""" Returns a list of all objects in the database """
return dbsession.query(cls).all()
@classmethod
def by_id(cls, _id):
""" Returns a the object with id of _id """
return dbsession.query(cls).filter_by(id=_id).first()
@classmethod
def by_user_id(cls, user_id):
""" Returns a the object with id of user_id """
return dbsession.query(cls).filter_by(user_id=user_id).first()
@classmethod
def count(cls):
""" Returns a list of all objects in the database """
return dbsession.query(cls).count()
@classmethod
def by_value(cls, value):
""" Returns a the object with value of value """
return dbsession.query(cls).filter_by(value=value).first()
def is_expired(self, hours=3):
""" Check if the token is expired """
now = datetime.now()
expired = self.created + timedelta(hours=hours)
return now > expired
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
8621,
718,
11,
12131,
198,
198,
31,
9800,
25,
1288,
73,
14822,
68,
628,
220,
220,
220,
15069,
12131,
20410,
262,
8315,
628,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
220,
220,
220,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
220,
220,
220,
921,
743,
7330,
257,
4866,
286,
262,
13789,
379,
628,
220,
220,
220,
220,
220,
220,
220,
2638,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
43,
2149,
24290,
12,
17,
13,
15,
628,
220,
220,
220,
17486,
2672,
416,
9723,
1099,
393,
4987,
284,
287,
3597,
11,
3788,
198,
220,
220,
220,
9387,
739,
262,
13789,
318,
9387,
319,
281,
366,
1921,
3180,
1,
29809,
1797,
11,
198,
220,
220,
220,
42881,
34764,
11015,
6375,
7102,
49828,
11053,
3963,
15529,
509,
12115,
11,
2035,
4911,
393,
17142,
13,
198,
220,
220,
220,
4091,
262,
13789,
329,
262,
2176,
3303,
15030,
21627,
290,
198,
220,
220,
220,
11247,
739,
262,
13789,
13,
198,
37811,
628,
198,
6738,
28686,
1330,
2956,
3749,
198,
6738,
12234,
8019,
1330,
427,
64,
11645,
198,
6738,
44161,
282,
26599,
1330,
29201,
11,
8708,
9218,
198,
6738,
44161,
282,
26599,
13,
19199,
1330,
10903,
11,
41146,
11,
34142,
198,
6738,
4981,
1330,
288,
1443,
2521,
198,
6738,
4981,
13,
14881,
5841,
1424,
1330,
24047,
10267,
198,
6738,
9195,
82,
13,
10100,
34,
7656,
1330,
37773,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
628,
198,
4871,
30275,
30642,
7,
38105,
10267,
2599,
198,
220,
220,
220,
37227,
30275,
11241,
6770,
37227,
628,
220,
220,
220,
2836,
62,
312,
796,
29201,
7,
46541,
11,
8708,
9218,
7203,
7220,
13,
312,
1600,
319,
33678,
2625,
34,
42643,
19266,
12340,
9242,
540,
28,
25101,
8,
198,
220,
220,
220,
1988,
796,
29201,
7,
10100,
7,
2624,
828,
3748,
28,
17821,
11,
9242,
540,
28,
25101,
8,
198,
220,
220,
220,
973,
796,
29201,
7,
46120,
13087,
11,
9242,
540,
28,
25101,
11,
4277,
28,
25101,
8,
628,
220,
220,
220,
2488,
4871,
24396,
198,
220,
220,
220,
825,
477,
7,
565,
82,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
16409,
257,
1351,
286,
477,
5563,
287,
262,
6831,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
288,
1443,
2521,
13,
22766,
7,
565,
82,
737,
439,
3419,
628,
220,
220,
220,
2488,
4871,
24396,
198,
220,
220,
220,
825,
416,
62,
312,
7,
565,
82,
11,
4808,
312,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
16409,
257,
262,
2134,
351,
4686,
286,
4808,
312,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
288,
1443,
2521,
13,
22766,
7,
565,
82,
737,
24455,
62,
1525,
7,
312,
28,
62,
312,
737,
11085,
3419,
628,
220,
220,
220,
2488,
4871,
24396,
198,
220,
220,
220,
825,
416,
62,
7220,
62,
312,
7,
565,
82,
11,
2836,
62,
312,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
16409,
257,
262,
2134,
351,
4686,
286,
2836,
62,
312,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
288,
1443,
2521,
13,
22766,
7,
565,
82,
737,
24455,
62,
1525,
7,
7220,
62,
312,
28,
7220,
62,
312,
737,
11085,
3419,
628,
220,
220,
220,
2488,
4871,
24396,
198,
220,
220,
220,
825,
954,
7,
565,
82,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
16409,
257,
1351,
286,
477,
5563,
287,
262,
6831,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
288,
1443,
2521,
13,
22766,
7,
565,
82,
737,
9127,
3419,
628,
220,
220,
220,
2488,
4871,
24396,
198,
220,
220,
220,
825,
416,
62,
8367,
7,
565,
82,
11,
1988,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
16409,
257,
262,
2134,
351,
1988,
286,
1988,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
288,
1443,
2521,
13,
22766,
7,
565,
82,
737,
24455,
62,
1525,
7,
8367,
28,
8367,
737,
11085,
3419,
628,
220,
220,
220,
825,
318,
62,
1069,
6474,
7,
944,
11,
2250,
28,
18,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
6822,
611,
262,
11241,
318,
21350,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
783,
796,
4818,
8079,
13,
2197,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
21350,
796,
2116,
13,
25598,
1343,
28805,
12514,
7,
24425,
28,
24425,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
783,
1875,
21350,
198
] | 2.916667 | 768 |
# 0480-matrix-no-numpy-mul2.py
# Multiply a matrix with a matrix
# 20220216 Create this example.
import matrix as mat
# multiply a matrix with a matrix
# define a list as two-dimension matrix
m1 = [
[1, 1, 1],
[1, 2, 1],
]
m2 = [
[1, 1],
[1, 2],
[1, 1],
]
m3 = mulmat2(m1, m2)
# display results
print("m1:")
mat.printmat(m1)
print("m2:")
mat.printmat(m2)
print("m3:")
mat.printmat(m3)
| [
2,
8702,
1795,
12,
6759,
8609,
12,
3919,
12,
77,
32152,
12,
76,
377,
17,
13,
9078,
198,
2,
7854,
541,
306,
257,
17593,
351,
257,
17593,
198,
2,
1160,
17572,
20666,
13610,
428,
1672,
13,
198,
198,
11748,
17593,
355,
2603,
198,
198,
2,
29162,
257,
17593,
351,
257,
17593,
198,
198,
2,
8160,
257,
1351,
355,
734,
12,
46156,
17593,
198,
76,
16,
796,
685,
198,
220,
220,
220,
685,
16,
11,
352,
11,
352,
4357,
198,
220,
220,
220,
685,
16,
11,
362,
11,
352,
4357,
198,
220,
220,
220,
2361,
198,
76,
17,
796,
685,
198,
220,
220,
220,
685,
16,
11,
352,
4357,
198,
220,
220,
220,
685,
16,
11,
362,
4357,
198,
220,
220,
220,
685,
16,
11,
352,
4357,
198,
220,
220,
220,
2361,
198,
198,
76,
18,
796,
35971,
6759,
17,
7,
76,
16,
11,
285,
17,
8,
198,
198,
2,
3359,
2482,
198,
4798,
7203,
76,
16,
25,
4943,
198,
6759,
13,
4798,
6759,
7,
76,
16,
8,
198,
4798,
7203,
76,
17,
25,
4943,
198,
6759,
13,
4798,
6759,
7,
76,
17,
8,
198,
4798,
7203,
76,
18,
25,
4943,
198,
6759,
13,
4798,
6759,
7,
76,
18,
8,
198
] | 2.09 | 200 |
#!/usr/bin/env python3
'''
MIT License
Copyright (c) 2020 Futurewei Cloud
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 parse
import argparse
from fabric import Connection
parser = argparse.ArgumentParser(description="Utility script to start/stop/kill cluster components")
parser.add_argument("--config_file", help="Top-level config file that specifices a Chogori cluster")
parser.add_argument("--locals_file", help="Top-level config file that specifices local environment")
parser.add_argument("--username", default="user", help="Username to use when SSHing to other nodes")
parser.add_argument("--start", nargs="*", default="", help="List of component names (from config_file) to be started")
parser.add_argument("--remove", nargs="*", default="", help="List of component names (from config_file) to be removed")
parser.add_argument("--stop", nargs="*", default="", help="List of component names (from config_file) to be stopped")
parser.add_argument("--logs", nargs="*", default="", help="List of component names (from config_file) to display logs")
args = parser.parse_args()
args.config_file
runnables = parse.parseConfig(args.locals_file, args.config_file)
for r in runnables:
if r.name in args.start or "all" in args.start:
print("Starting:")
print(r.getDockerRun())
conn = Connection(r.host, user=args.username)
pull = conn.run(r.getDockerPull())
print(pull)
start = conn.run(r.getDockerRun())
print(start)
if r.name in args.stop or "all" in args.stop:
print("Stopping:")
print(r)
conn = Connection(r.host, user=args.username)
start = conn.run(r.getDockerStop())
print(start)
if r.name in args.logs or "all" in args.logs:
print("Getting logs for:")
print(r)
conn = Connection(r.host, user=args.username)
start = conn.run(r.getDockerLogs())
print(start)
if r.name in args.remove or "all" in args.remove:
print("Removing:")
print(r)
conn = Connection(r.host, user=args.username)
start = conn.run(r.getDockerRemove())
print(start)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
7061,
6,
198,
36393,
13789,
198,
198,
15269,
357,
66,
8,
12131,
10898,
42990,
10130,
198,
198,
5990,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
1659,
428,
3788,
290,
3917,
10314,
3696,
357,
1169,
366,
25423,
12340,
284,
1730,
198,
259,
262,
10442,
1231,
17504,
11,
1390,
1231,
17385,
262,
2489,
198,
1462,
779,
11,
4866,
11,
13096,
11,
20121,
11,
7715,
11,
14983,
11,
850,
43085,
11,
290,
14,
273,
3677,
198,
22163,
444,
286,
262,
10442,
11,
290,
284,
8749,
6506,
284,
4150,
262,
10442,
318,
198,
69,
700,
1348,
284,
466,
523,
11,
2426,
284,
262,
1708,
3403,
25,
198,
198,
464,
2029,
6634,
4003,
290,
428,
7170,
4003,
2236,
307,
3017,
287,
477,
198,
22163,
444,
393,
8904,
16690,
286,
262,
10442,
13,
198,
198,
10970,
47466,
3180,
36592,
2389,
1961,
366,
1921,
3180,
1600,
42881,
34764,
56,
3963,
15529,
509,
12115,
11,
7788,
32761,
6375,
198,
3955,
49094,
11,
47783,
2751,
21728,
5626,
40880,
5390,
3336,
34764,
11015,
3963,
34482,
3398,
1565,
5603,
25382,
11,
198,
37,
46144,
7473,
317,
16652,
2149,
37232,
33079,
48933,
5357,
44521,
1268,
10913,
2751,
12529,
13,
3268,
8005,
49261,
50163,
3336,
198,
32,
24318,
20673,
6375,
27975,
38162,
9947,
367,
15173,
4877,
9348,
43031,
19146,
7473,
15529,
47666,
3955,
11,
29506,
25552,
6375,
25401,
198,
43,
3539,
25382,
11,
7655,
2767,
16879,
3268,
3537,
40282,
3963,
27342,
10659,
11,
309,
9863,
6375,
25401,
54,
24352,
11,
5923,
1797,
2751,
16034,
11,
198,
12425,
3963,
6375,
3268,
7102,
45,
24565,
13315,
3336,
47466,
6375,
3336,
23210,
6375,
25401,
5550,
1847,
20754,
3268,
3336,
198,
15821,
37485,
13,
198,
7061,
6,
198,
198,
11748,
21136,
198,
11748,
1822,
29572,
198,
6738,
9664,
1330,
26923,
198,
198,
48610,
796,
1822,
29572,
13,
28100,
1713,
46677,
7,
11213,
2625,
18274,
879,
4226,
284,
923,
14,
11338,
14,
12728,
13946,
6805,
4943,
198,
48610,
13,
2860,
62,
49140,
7203,
438,
11250,
62,
7753,
1600,
1037,
2625,
9126,
12,
5715,
4566,
2393,
326,
2176,
274,
257,
609,
519,
10145,
13946,
4943,
198,
48610,
13,
2860,
62,
49140,
7203,
438,
17946,
874,
62,
7753,
1600,
1037,
2625,
9126,
12,
5715,
4566,
2393,
326,
2176,
274,
1957,
2858,
4943,
198,
48610,
13,
2860,
62,
49140,
7203,
438,
29460,
1600,
4277,
2625,
7220,
1600,
1037,
2625,
5842,
13292,
284,
779,
618,
33825,
278,
284,
584,
13760,
4943,
198,
48610,
13,
2860,
62,
49140,
7203,
438,
9688,
1600,
299,
22046,
2625,
9,
1600,
4277,
2625,
1600,
1037,
2625,
8053,
286,
7515,
3891,
357,
6738,
4566,
62,
7753,
8,
284,
307,
2067,
4943,
198,
48610,
13,
2860,
62,
49140,
7203,
438,
28956,
1600,
299,
22046,
2625,
9,
1600,
4277,
2625,
1600,
1037,
2625,
8053,
286,
7515,
3891,
357,
6738,
4566,
62,
7753,
8,
284,
307,
4615,
4943,
198,
48610,
13,
2860,
62,
49140,
7203,
438,
11338,
1600,
299,
22046,
2625,
9,
1600,
4277,
2625,
1600,
1037,
2625,
8053,
286,
7515,
3891,
357,
6738,
4566,
62,
7753,
8,
284,
307,
5025,
4943,
198,
48610,
13,
2860,
62,
49140,
7203,
438,
6404,
82,
1600,
299,
22046,
2625,
9,
1600,
4277,
2625,
1600,
1037,
2625,
8053,
286,
7515,
3891,
357,
6738,
4566,
62,
7753,
8,
284,
3359,
17259,
4943,
198,
22046,
796,
30751,
13,
29572,
62,
22046,
3419,
198,
198,
22046,
13,
11250,
62,
7753,
198,
5143,
77,
2977,
796,
21136,
13,
29572,
16934,
7,
22046,
13,
17946,
874,
62,
7753,
11,
26498,
13,
11250,
62,
7753,
8,
198,
1640,
374,
287,
1057,
77,
2977,
25,
198,
220,
220,
220,
611,
374,
13,
3672,
287,
26498,
13,
9688,
393,
366,
439,
1,
287,
26498,
13,
9688,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
22851,
25,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
81,
13,
1136,
35,
12721,
10987,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
48260,
796,
26923,
7,
81,
13,
4774,
11,
2836,
28,
22046,
13,
29460,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2834,
796,
48260,
13,
5143,
7,
81,
13,
1136,
35,
12721,
42940,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
31216,
8,
198,
220,
220,
220,
220,
220,
220,
220,
923,
796,
48260,
13,
5143,
7,
81,
13,
1136,
35,
12721,
10987,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
9688,
8,
198,
220,
220,
220,
611,
374,
13,
3672,
287,
26498,
13,
11338,
393,
366,
439,
1,
287,
26498,
13,
11338,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
1273,
33307,
25,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
81,
8,
198,
220,
220,
220,
220,
220,
220,
220,
48260,
796,
26923,
7,
81,
13,
4774,
11,
2836,
28,
22046,
13,
29460,
8,
198,
220,
220,
220,
220,
220,
220,
220,
923,
796,
48260,
13,
5143,
7,
81,
13,
1136,
35,
12721,
19485,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
9688,
8,
198,
220,
220,
220,
611,
374,
13,
3672,
287,
26498,
13,
6404,
82,
393,
366,
439,
1,
287,
26498,
13,
6404,
82,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
20570,
17259,
329,
25,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
81,
8,
198,
220,
220,
220,
220,
220,
220,
220,
48260,
796,
26923,
7,
81,
13,
4774,
11,
2836,
28,
22046,
13,
29460,
8,
198,
220,
220,
220,
220,
220,
220,
220,
923,
796,
48260,
13,
5143,
7,
81,
13,
1136,
35,
12721,
11187,
82,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
9688,
8,
198,
220,
220,
220,
611,
374,
13,
3672,
287,
26498,
13,
28956,
393,
366,
439,
1,
287,
26498,
13,
28956,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
8413,
5165,
25,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
81,
8,
198,
220,
220,
220,
220,
220,
220,
220,
48260,
796,
26923,
7,
81,
13,
4774,
11,
2836,
28,
22046,
13,
29460,
8,
198,
220,
220,
220,
220,
220,
220,
220,
923,
796,
48260,
13,
5143,
7,
81,
13,
1136,
35,
12721,
27914,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
9688,
8,
198
] | 2.993289 | 1,043 |
# Advection test evolution
from models import advection
from bcs import periodic
from simulation import simulation
from methods import minmod_lf
from rk import rk2
from grid import grid
Npoints = 20
Ngz = 2
interval = grid([-0.5, 0.5], Npoints, Ngz)
model = advection.advection(v=1,
initial_data = advection.initial_sine(period=1))
model = advection.advection(v=1,
initial_data = advection.initial_square())
sim = simulation(model, interval, minmod_lf, rk2, periodic)
sim.evolve(0.5)
| [
2,
1215,
303,
596,
1332,
6954,
198,
198,
6738,
4981,
1330,
512,
303,
596,
198,
6738,
275,
6359,
1330,
27458,
198,
6738,
18640,
1330,
18640,
198,
6738,
5050,
1330,
949,
4666,
62,
1652,
198,
6738,
374,
74,
1330,
374,
74,
17,
198,
6738,
10706,
1330,
10706,
198,
198,
45,
13033,
796,
1160,
198,
45,
34586,
796,
362,
198,
3849,
2100,
796,
10706,
26933,
12,
15,
13,
20,
11,
657,
13,
20,
4357,
399,
13033,
11,
399,
34586,
8,
198,
19849,
796,
512,
303,
596,
13,
324,
303,
596,
7,
85,
28,
16,
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,
4238,
62,
7890,
796,
512,
303,
596,
13,
36733,
62,
82,
500,
7,
41007,
28,
16,
4008,
198,
19849,
796,
512,
303,
596,
13,
324,
303,
596,
7,
85,
28,
16,
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,
4238,
62,
7890,
796,
512,
303,
596,
13,
36733,
62,
23415,
28955,
198,
14323,
796,
18640,
7,
19849,
11,
16654,
11,
949,
4666,
62,
1652,
11,
374,
74,
17,
11,
27458,
8,
198,
14323,
13,
1990,
6442,
7,
15,
13,
20,
8,
198
] | 2.40708 | 226 |
import tensorflow as tf
"""tf.tensordot(a, b, axes, name=None)
功能:同numpy.tensordot,根据axis计算点乘。
输入:axes=1或axes=[[1],[0]],即为矩阵乘。"""
a = tf.constant([1, 2, 3, 4], shape=[2, 2], dtype=tf.float64)
b = tf.constant([1, 2, 3, 4], shape=[2, 2], dtype=tf.float64)
z = tf.tensordot(a, b, axes=[[1], [1]]) # 第一个矩阵的行乘上第二个矩阵的行
z1 = tf.tensordot(a, b, axes=[[1], [0]]) # 矩阵乘法第一个矩阵行乘第二个矩阵的列
z2 = tf.tensordot(a, b, axes=[[0], [1]]) # 第一个矩阵的列乘上第二个矩阵的行
sess = tf.Session()
print(sess.run(z))
print(sess.run(z1))
print(sess.run(z2))
sess.close()
# z==>[[5. 11.]
# [11. 25.]]
# z1==> [[ 7. 10.]
# [ 15. 22.]]
# z2==>[[ 7. 15.]
# [ 10. 22.]]
| [
11748,
11192,
273,
11125,
355,
48700,
198,
198,
37811,
27110,
13,
83,
641,
585,
313,
7,
64,
11,
275,
11,
34197,
11,
1438,
28,
14202,
8,
198,
27950,
253,
47797,
121,
171,
120,
248,
28938,
234,
77,
32152,
13,
83,
641,
585,
313,
171,
120,
234,
43718,
117,
162,
235,
106,
22704,
164,
106,
94,
163,
106,
245,
163,
224,
117,
20046,
246,
16764,
198,
164,
122,
241,
17739,
98,
171,
120,
248,
897,
274,
28,
16,
22755,
244,
897,
274,
28,
30109,
16,
38430,
15,
11907,
171,
120,
234,
39355,
111,
10310,
118,
163,
253,
102,
165,
246,
113,
20046,
246,
16764,
37811,
198,
198,
64,
796,
48700,
13,
9979,
415,
26933,
16,
11,
362,
11,
513,
11,
604,
4357,
5485,
41888,
17,
11,
362,
4357,
288,
4906,
28,
27110,
13,
22468,
2414,
8,
198,
65,
796,
48700,
13,
9979,
415,
26933,
16,
11,
362,
11,
513,
11,
604,
4357,
5485,
41888,
17,
11,
362,
4357,
288,
4906,
28,
27110,
13,
22468,
2414,
8,
198,
89,
796,
48700,
13,
83,
641,
585,
313,
7,
64,
11,
275,
11,
34197,
28,
30109,
16,
4357,
685,
16,
11907,
8,
220,
220,
1303,
13328,
105,
105,
31660,
10310,
103,
163,
253,
102,
165,
246,
113,
21410,
26193,
234,
20046,
246,
41468,
163,
105,
105,
12859,
234,
10310,
103,
163,
253,
102,
165,
246,
113,
21410,
26193,
234,
198,
89,
16,
796,
48700,
13,
83,
641,
585,
313,
7,
64,
11,
275,
11,
34197,
28,
30109,
16,
4357,
685,
15,
11907,
8,
220,
1303,
13328,
253,
102,
165,
246,
113,
20046,
246,
37345,
243,
163,
105,
105,
31660,
10310,
103,
163,
253,
102,
165,
246,
113,
26193,
234,
20046,
246,
163,
105,
105,
12859,
234,
10310,
103,
163,
253,
102,
165,
246,
113,
21410,
26344,
245,
198,
89,
17,
796,
48700,
13,
83,
641,
585,
313,
7,
64,
11,
275,
11,
34197,
28,
30109,
15,
4357,
685,
16,
11907,
8,
220,
1303,
13328,
105,
105,
31660,
10310,
103,
163,
253,
102,
165,
246,
113,
21410,
26344,
245,
20046,
246,
41468,
163,
105,
105,
12859,
234,
10310,
103,
163,
253,
102,
165,
246,
113,
21410,
26193,
234,
198,
82,
408,
796,
48700,
13,
36044,
3419,
198,
4798,
7,
82,
408,
13,
5143,
7,
89,
4008,
198,
4798,
7,
82,
408,
13,
5143,
7,
89,
16,
4008,
198,
4798,
7,
82,
408,
13,
5143,
7,
89,
17,
4008,
198,
82,
408,
13,
19836,
3419,
198,
2,
1976,
855,
29,
30109,
20,
13,
220,
1367,
8183,
198,
2,
220,
220,
220,
220,
220,
685,
1157,
13,
1679,
8183,
60,
198,
2,
1976,
16,
855,
29,
16410,
220,
767,
13,
220,
838,
8183,
198,
2,
220,
220,
220,
220,
220,
220,
685,
1315,
13,
220,
2534,
8183,
60,
198,
2,
1976,
17,
855,
29,
30109,
220,
767,
13,
220,
1315,
8183,
198,
2,
220,
220,
220,
220,
220,
220,
685,
838,
13,
220,
2534,
8183,
60,
198
] | 1.35625 | 480 |
class DELpy(Exception):
"""
Raise this so people could easily catch the exception
"""
pass
| [
4871,
28163,
9078,
7,
16922,
2599,
201,
198,
220,
220,
220,
37227,
201,
198,
220,
220,
220,
35123,
428,
523,
661,
714,
3538,
4929,
262,
6631,
201,
198,
220,
220,
220,
37227,
201,
198,
220,
220,
220,
1208,
201,
198
] | 2.8 | 40 |
import tensorflow as tf
import sys
import numpy as np
import json
import torch
import pandas as pd
from tensorflow.saved_model import tag_constants
from os.path import dirname, realpath
# Add root directory to path
file_path = realpath(__file__)
file_dir = dirname(file_path)
parent_dir = dirname(file_dir)
sys.path.append(parent_dir)
from dataset import load_data
# Load datasets
train_batch_size = 32
test_batch_size = 32
_, standard_test_loader = load_data(root_dir='../', deck='standard',
train_batch_size=train_batch_size,
test_batch_size=test_batch_size)
_, batman_joker_test_loader = load_data(root_dir='../', deck='batman_joker',
train_batch_size=train_batch_size,
test_batch_size=test_batch_size)
_, captain_america_test_loader = load_data(root_dir='../', deck='captain_america',
train_batch_size=train_batch_size,
test_batch_size=test_batch_size)
_, adversarial_standard_test_loader = load_data(root_dir='../', deck='adversarial_standard',
train_batch_size=train_batch_size,
test_batch_size=test_batch_size)
_, adversarial_batman_joker_test_loader = load_data(root_dir='../', deck='adversarial_batman_joker',
train_batch_size=train_batch_size,
test_batch_size=test_batch_size)
_, adversarial_captain_america_test_loader = load_data(root_dir='../', deck='adversarial_captain_america',
train_batch_size=train_batch_size,
test_batch_size=test_batch_size)
test_loaders = {
"standard": standard_test_loader,
"batman_joker": batman_joker_test_loader,
"captain_america": captain_america_test_loader,
"adversarial_standard": adversarial_standard_test_loader,
"adversarial_batman_joker": adversarial_batman_joker_test_loader,
"adversarial_captain_america": adversarial_captain_america_test_loader
}
cache_dir = '../../cache/card_predictions/edl_gen'
g2 = tf.Graph()
with g2.as_default():
with tf.Session(graph=g2) as sess:
tf.saved_model.loader.load(
sess,
[tag_constants.SERVING],
'saved_model'
)
for ts in test_loaders:
preds = {}
preds_for_problog = {}
test_data_csv_file = pd.read_csv('../data/'+ts+'/test.csv')
card_mapping = test_loaders[ts].dataset.mapping
image_ids = test_loaders[ts].dataset.playing_cards
for batch_idx, (data, target) in enumerate(test_loaders[ts]):
X = g2.get_tensor_by_name('X:0')
u = g2.get_tensor_by_name('uncertainty_out:0')
prob = g2.get_tensor_by_name('prob_out:0')
evidence = g2.get_tensor_by_name('evidence_out:0')
flattened_data = torch.flatten(data, start_dim=1)
feed_dict = {X: flattened_data}
output = sess.run([u, prob, evidence], feed_dict=feed_dict)
u = output[0]
prob = output[1]
evidence = output[2]
start_num_samples = test_loaders[ts].batch_size * batch_idx
batch_image_ids = image_ids.loc[start_num_samples:start_num_samples + len(data) - 1]['img'].values
for idx, img_id in enumerate(batch_image_ids):
preds[img_id] = (card_mapping[np.argmax(prob[idx])], np.max(prob[idx]))
_all_preds_this_image = []
for pred_idx in range(52):
if prob[idx][pred_idx] > 0.00001:
_all_preds_this_image.append((card_mapping[pred_idx], prob[idx][pred_idx]))
preds_for_problog[img_id] = _all_preds_this_image
print('Finished Deck: ', ts)
# Save predictions to cache
with open(cache_dir + '/' + ts + '_test_set.json', 'w') as cache_out:
cache_out.write(json.dumps(preds, cls=NpEncoder))
with open(cache_dir + '/' + ts + '_test_set_for_problog.json', 'w') as cache_out:
cache_out.write(json.dumps(preds_for_problog, cls=NpEncoder))
| [
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
25064,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
33918,
198,
11748,
28034,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
11192,
273,
11125,
13,
82,
9586,
62,
19849,
1330,
7621,
62,
9979,
1187,
198,
6738,
28686,
13,
6978,
1330,
26672,
3672,
11,
1103,
6978,
198,
198,
2,
3060,
6808,
8619,
284,
3108,
198,
7753,
62,
6978,
796,
1103,
6978,
7,
834,
7753,
834,
8,
198,
7753,
62,
15908,
796,
26672,
3672,
7,
7753,
62,
6978,
8,
198,
8000,
62,
15908,
796,
26672,
3672,
7,
7753,
62,
15908,
8,
198,
17597,
13,
6978,
13,
33295,
7,
8000,
62,
15908,
8,
198,
6738,
27039,
1330,
3440,
62,
7890,
198,
198,
2,
8778,
40522,
198,
27432,
62,
43501,
62,
7857,
796,
3933,
198,
9288,
62,
43501,
62,
7857,
796,
3933,
198,
62,
11,
3210,
62,
9288,
62,
29356,
796,
3440,
62,
7890,
7,
15763,
62,
15908,
11639,
40720,
3256,
6203,
11639,
20307,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4512,
62,
43501,
62,
7857,
28,
27432,
62,
43501,
62,
7857,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1332,
62,
43501,
62,
7857,
28,
9288,
62,
43501,
62,
7857,
8,
198,
198,
62,
11,
7365,
805,
62,
73,
11020,
62,
9288,
62,
29356,
796,
3440,
62,
7890,
7,
15763,
62,
15908,
11639,
40720,
3256,
6203,
11639,
8664,
805,
62,
73,
11020,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4512,
62,
43501,
62,
7857,
28,
27432,
62,
43501,
62,
7857,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1332,
62,
43501,
62,
7857,
28,
9288,
62,
43501,
62,
7857,
8,
198,
198,
62,
11,
10654,
62,
2382,
3970,
62,
9288,
62,
29356,
796,
3440,
62,
7890,
7,
15763,
62,
15908,
11639,
40720,
3256,
6203,
11639,
27144,
391,
62,
2382,
3970,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4512,
62,
43501,
62,
7857,
28,
27432,
62,
43501,
62,
7857,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1332,
62,
43501,
62,
7857,
28,
9288,
62,
43501,
62,
7857,
8,
198,
198,
62,
11,
16907,
36098,
62,
20307,
62,
9288,
62,
29356,
796,
3440,
62,
7890,
7,
15763,
62,
15908,
11639,
40720,
3256,
6203,
11639,
324,
690,
36098,
62,
20307,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4512,
62,
43501,
62,
7857,
28,
27432,
62,
43501,
62,
7857,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1332,
62,
43501,
62,
7857,
28,
9288,
62,
43501,
62,
7857,
8,
198,
198,
62,
11,
16907,
36098,
62,
8664,
805,
62,
73,
11020,
62,
9288,
62,
29356,
796,
3440,
62,
7890,
7,
15763,
62,
15908,
11639,
40720,
3256,
6203,
11639,
324,
690,
36098,
62,
8664,
805,
62,
73,
11020,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4512,
62,
43501,
62,
7857,
28,
27432,
62,
43501,
62,
7857,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1332,
62,
43501,
62,
7857,
28,
9288,
62,
43501,
62,
7857,
8,
198,
198,
62,
11,
16907,
36098,
62,
27144,
391,
62,
2382,
3970,
62,
9288,
62,
29356,
796,
3440,
62,
7890,
7,
15763,
62,
15908,
11639,
40720,
3256,
6203,
11639,
324,
690,
36098,
62,
27144,
391,
62,
2382,
3970,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4512,
62,
43501,
62,
7857,
28,
27432,
62,
43501,
62,
7857,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1332,
62,
43501,
62,
7857,
28,
9288,
62,
43501,
62,
7857,
8,
198,
198,
9288,
62,
2220,
364,
796,
1391,
198,
220,
220,
220,
366,
20307,
1298,
3210,
62,
9288,
62,
29356,
11,
198,
220,
220,
220,
366,
8664,
805,
62,
73,
11020,
1298,
7365,
805,
62,
73,
11020,
62,
9288,
62,
29356,
11,
198,
220,
220,
220,
366,
27144,
391,
62,
2382,
3970,
1298,
10654,
62,
2382,
3970,
62,
9288,
62,
29356,
11,
198,
220,
220,
220,
366,
324,
690,
36098,
62,
20307,
1298,
16907,
36098,
62,
20307,
62,
9288,
62,
29356,
11,
198,
220,
220,
220,
366,
324,
690,
36098,
62,
8664,
805,
62,
73,
11020,
1298,
16907,
36098,
62,
8664,
805,
62,
73,
11020,
62,
9288,
62,
29356,
11,
198,
220,
220,
220,
366,
324,
690,
36098,
62,
27144,
391,
62,
2382,
3970,
1298,
16907,
36098,
62,
27144,
391,
62,
2382,
3970,
62,
9288,
62,
29356,
198,
92,
198,
198,
23870,
62,
15908,
796,
705,
40720,
40720,
23870,
14,
9517,
62,
28764,
9278,
14,
276,
75,
62,
5235,
6,
198,
198,
70,
17,
796,
48700,
13,
37065,
3419,
628,
198,
198,
4480,
308,
17,
13,
292,
62,
12286,
33529,
198,
220,
220,
220,
351,
48700,
13,
36044,
7,
34960,
28,
70,
17,
8,
355,
264,
408,
25,
198,
220,
220,
220,
220,
220,
220,
220,
48700,
13,
82,
9586,
62,
19849,
13,
29356,
13,
2220,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
264,
408,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
685,
12985,
62,
9979,
1187,
13,
35009,
53,
2751,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
82,
9586,
62,
19849,
6,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
329,
40379,
287,
1332,
62,
2220,
364,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2747,
82,
796,
23884,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2747,
82,
62,
1640,
62,
1676,
14036,
796,
23884,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1332,
62,
7890,
62,
40664,
62,
7753,
796,
279,
67,
13,
961,
62,
40664,
10786,
40720,
7890,
14,
6,
10,
912,
10,
26488,
9288,
13,
40664,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2657,
62,
76,
5912,
796,
1332,
62,
2220,
364,
58,
912,
4083,
19608,
292,
316,
13,
76,
5912,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2939,
62,
2340,
796,
1332,
62,
2220,
364,
58,
912,
4083,
19608,
292,
316,
13,
17916,
62,
27761,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
15458,
62,
312,
87,
11,
357,
7890,
11,
2496,
8,
287,
27056,
378,
7,
9288,
62,
2220,
364,
58,
912,
60,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1395,
796,
308,
17,
13,
1136,
62,
83,
22854,
62,
1525,
62,
3672,
10786,
55,
25,
15,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
334,
796,
308,
17,
13,
1136,
62,
83,
22854,
62,
1525,
62,
3672,
10786,
19524,
1425,
774,
62,
448,
25,
15,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1861,
796,
308,
17,
13,
1136,
62,
83,
22854,
62,
1525,
62,
3672,
10786,
1676,
65,
62,
448,
25,
15,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2370,
796,
308,
17,
13,
1136,
62,
83,
22854,
62,
1525,
62,
3672,
10786,
46817,
62,
448,
25,
15,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45096,
62,
7890,
796,
28034,
13,
2704,
41769,
7,
7890,
11,
923,
62,
27740,
28,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3745,
62,
11600,
796,
1391,
55,
25,
45096,
62,
7890,
92,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5072,
796,
264,
408,
13,
5143,
26933,
84,
11,
1861,
11,
2370,
4357,
3745,
62,
11600,
28,
12363,
62,
11600,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
334,
796,
5072,
58,
15,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1861,
796,
5072,
58,
16,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2370,
796,
5072,
58,
17,
60,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
923,
62,
22510,
62,
82,
12629,
796,
1332,
62,
2220,
364,
58,
912,
4083,
43501,
62,
7857,
1635,
15458,
62,
312,
87,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15458,
62,
9060,
62,
2340,
796,
2939,
62,
2340,
13,
17946,
58,
9688,
62,
22510,
62,
82,
12629,
25,
9688,
62,
22510,
62,
82,
12629,
1343,
18896,
7,
7890,
8,
532,
352,
7131,
6,
9600,
6,
4083,
27160,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
4686,
87,
11,
33705,
62,
312,
287,
27056,
378,
7,
43501,
62,
9060,
62,
2340,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2747,
82,
58,
9600,
62,
312,
60,
796,
357,
9517,
62,
76,
5912,
58,
37659,
13,
853,
9806,
7,
1676,
65,
58,
312,
87,
12962,
4357,
45941,
13,
9806,
7,
1676,
65,
58,
312,
87,
60,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
439,
62,
28764,
82,
62,
5661,
62,
9060,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
2747,
62,
312,
87,
287,
2837,
7,
4309,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
1861,
58,
312,
87,
7131,
28764,
62,
312,
87,
60,
1875,
657,
13,
2388,
16,
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,
4808,
439,
62,
28764,
82,
62,
5661,
62,
9060,
13,
33295,
19510,
9517,
62,
76,
5912,
58,
28764,
62,
312,
87,
4357,
1861,
58,
312,
87,
7131,
28764,
62,
312,
87,
60,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2747,
82,
62,
1640,
62,
1676,
14036,
58,
9600,
62,
312,
60,
796,
4808,
439,
62,
28764,
82,
62,
5661,
62,
9060,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
18467,
1348,
20961,
25,
46083,
40379,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
12793,
16277,
284,
12940,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
351,
1280,
7,
23870,
62,
15908,
1343,
31051,
6,
1343,
40379,
1343,
705,
62,
9288,
62,
2617,
13,
17752,
3256,
705,
86,
11537,
355,
12940,
62,
448,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12940,
62,
448,
13,
13564,
7,
17752,
13,
67,
8142,
7,
28764,
82,
11,
537,
82,
28,
45,
79,
27195,
12342,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
351,
1280,
7,
23870,
62,
15908,
1343,
31051,
6,
1343,
40379,
1343,
705,
62,
9288,
62,
2617,
62,
1640,
62,
1676,
14036,
13,
17752,
3256,
705,
86,
11537,
355,
12940,
62,
448,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12940,
62,
448,
13,
13564,
7,
17752,
13,
67,
8142,
7,
28764,
82,
62,
1640,
62,
1676,
14036,
11,
537,
82,
28,
45,
79,
27195,
12342,
4008,
628
] | 1.883361 | 2,392 |
from itertools import izip
try:
from carbon.storage import loadStorageSchemas, loadAggregationSchemas
SCHEMAS = loadStorageSchemas()
AGGREGATION_SCHEMAS = loadAggregationSchemas()
except ImportError:
SCHEMAS = []
AGGREGATION_SCHEMAS = []
# Update metadata to match carbon schemas.
| [
6738,
340,
861,
10141,
1330,
220,
528,
541,
198,
198,
28311,
25,
198,
220,
422,
6588,
13,
35350,
1330,
3440,
31425,
27054,
5356,
11,
3440,
46384,
43068,
27054,
5356,
198,
220,
22374,
3620,
1921,
796,
3440,
31425,
27054,
5356,
3419,
198,
220,
317,
11190,
31553,
6234,
62,
50,
3398,
3620,
1921,
796,
3440,
46384,
43068,
27054,
5356,
3419,
198,
16341,
17267,
12331,
25,
198,
220,
22374,
3620,
1921,
796,
17635,
198,
220,
317,
11190,
31553,
6234,
62,
50,
3398,
3620,
1921,
796,
17635,
628,
198,
198,
2,
10133,
20150,
284,
2872,
6588,
3897,
5356,
13,
198
] | 3.072917 | 96 |
import numpy as np
import pytest
import pytest_check as check
from pointcloudset import PointCloud
from pointcloudset.config import OPS
@pytest.mark.parametrize("op", ["<", ">=", "<="])
| [
11748,
299,
32152,
355,
45941,
198,
11748,
12972,
9288,
198,
11748,
12972,
9288,
62,
9122,
355,
2198,
198,
198,
6738,
966,
17721,
2617,
1330,
6252,
18839,
198,
6738,
966,
17721,
2617,
13,
11250,
1330,
40490,
628,
628,
198,
198,
31,
9078,
9288,
13,
4102,
13,
17143,
316,
380,
2736,
7203,
404,
1600,
14631,
27,
1600,
366,
29,
28,
1600,
33490,
2625,
12962,
198
] | 3.047619 | 63 |
from django.db import models
# Create your models here.
#class Al_batch_output(models.Models):
#class Coverage_by_base(models.Model):
# patient = models.ForeignKey(Patient, on_delete=models.CASCADE)
# chromosome = models.CharField(max_length=2)
# genomic_coordinate = models.CharField(max_length=30)
# depth_of_coverage = models.CharField(max_length=30)
# def __str__(self):
# cov = self.chromosome + ' ' + self.genomic_coordinate + ' ' + self.depth_of_coverage
# return cov
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
2,
13610,
534,
4981,
994,
13,
198,
198,
2,
4871,
978,
62,
43501,
62,
22915,
7,
27530,
13,
5841,
1424,
2599,
198,
198,
2,
4871,
33998,
62,
1525,
62,
8692,
7,
27530,
13,
17633,
2599,
198,
2,
220,
220,
220,
5827,
796,
4981,
13,
33616,
9218,
7,
12130,
1153,
11,
319,
62,
33678,
28,
27530,
13,
34,
42643,
19266,
8,
198,
2,
220,
220,
220,
34348,
796,
4981,
13,
12441,
15878,
7,
9806,
62,
13664,
28,
17,
8,
198,
2,
220,
220,
220,
45752,
62,
37652,
4559,
796,
4981,
13,
12441,
15878,
7,
9806,
62,
13664,
28,
1270,
8,
198,
2,
220,
220,
220,
6795,
62,
1659,
62,
1073,
1857,
796,
4981,
13,
12441,
15878,
7,
9806,
62,
13664,
28,
1270,
8,
198,
198,
2,
220,
220,
220,
825,
11593,
2536,
834,
7,
944,
2599,
198,
2,
220,
220,
220,
220,
220,
220,
220,
39849,
796,
2116,
13,
28663,
418,
462,
1343,
705,
705,
1343,
2116,
13,
5235,
10179,
62,
37652,
4559,
1343,
705,
705,
1343,
2116,
13,
18053,
62,
1659,
62,
1073,
1857,
198,
2,
220,
220,
220,
220,
220,
220,
220,
1441,
39849,
198
] | 2.605128 | 195 |
from django.conf.urls import url
from django.views.generic import TemplateView
from .api import ListApi, CardApi
urlpatterns = [
url(r'^lists$', ListApi.as_view()),
url(r'^cards$', CardApi.as_view()),
url(r'^home', TemplateView.as_view(template_name="scrumboard/home.html")),
]
| [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
198,
6738,
42625,
14208,
13,
33571,
13,
41357,
1330,
37350,
7680,
628,
198,
6738,
764,
15042,
1330,
7343,
32,
14415,
11,
5172,
32,
14415,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
19016,
7,
81,
6,
61,
20713,
3,
3256,
7343,
32,
14415,
13,
292,
62,
1177,
3419,
828,
198,
220,
220,
220,
19016,
7,
81,
6,
61,
27761,
3,
3256,
5172,
32,
14415,
13,
292,
62,
1177,
3419,
828,
198,
220,
220,
220,
19016,
7,
81,
6,
61,
11195,
3256,
37350,
7680,
13,
292,
62,
1177,
7,
28243,
62,
3672,
2625,
1416,
6582,
3526,
14,
11195,
13,
6494,
4943,
828,
198,
60,
198
] | 2.504274 | 117 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
import os
from pathlib import Path
DEFAULT_ROOT_PATH = Path(os.path.expanduser(os.getenv("EQUALITY_ROOT", "~/.equality/mainnet"))).resolve()
| [
11748,
28686,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
7206,
38865,
62,
13252,
2394,
62,
34219,
796,
10644,
7,
418,
13,
6978,
13,
11201,
392,
7220,
7,
418,
13,
1136,
24330,
7203,
36,
10917,
1847,
9050,
62,
13252,
2394,
1600,
366,
93,
11757,
48203,
14,
12417,
3262,
48774,
737,
411,
6442,
3419,
198
] | 2.62963 | 54 |
import datetime
def days_in_month(year, month):
"""
Inputs:
year - an integer between datetime.MINYEAR and datetime.MAXYEAR
representing the year
month - an integer between 1 and 12 representing the month
Returns:
The number of days in the input month.
"""
if month > 11:
date1 = datetime.date(year,month,1)
date2 = datetime.date(year+1,1,1)
else:
date1 = datetime.date(year,month,1)
date2 = datetime.date(year,month+1,1)
difference = date2-date1
return difference.days
year,month=2019,12
print("Number of days:",days_in_month(year, month))
def is_valid_date(year, month, day):
"""
Inputs:
year - an integer representing the year
month - an integer representing the month
day - an integer representing the day
Returns:
True if year-month-day is a valid date and
False otherwise
"""
if ((datetime.MINYEAR<=year<=datetime.MAXYEAR) and (1<=month<=12) and
(1<=day<=days_in_month(year, month))):
return True
else:
return False
year,month,day=2000,1,1
print(is_valid_date(year, month, day))
def days_between(year1, month1, day1, year2, month2, day2):
"""
Inputs:
year1 - an integer representing the year of the first date
month1 - an integer representing the month of the first date
day1 - an integer representing the day of the first date
year2 - an integer representing the year of the second date
month2 - an integer representing the month of the second date
day2 - an integer representing the day of the second date
Returns:
The number of days from the first date to the second date.
Returns 0 if either date is invalid or the second date is
before the first date.
"""
if (not is_valid_date(year1, month1, day1) or
not is_valid_date(year2, month2, day2)):
return 0
else:
date1 = datetime.date(year1,month1,day1)
date2 = datetime.date(year2,month2,day2)
if date2<date1:
return 0
else:
diff=date2-date1
return diff.days
year1,year2 = 2000,2001
month1,month2 = 1,2
day1,day2=1,2
print(days_between(year1, month1, day1, year2, month2, day2))
def age_in_days(year, month, day):
"""
Inputs:
year - an integer representing the birthday year
month - an integer representing the birthday month
day - an integer representing the birthday day
Returns:
The age of a person with the input birthday as of today.
Returns 0 if the input date is invalid or if the input
date is in the future.
"""
if (not is_valid_date(year, month, day)):
return 0
else:
date1 = datetime.date(year,month,day)
todays_date = datetime.date.today()
if date1>todays_date:
return 0
else:
age = todays_date - date1
return age.days
year,month,day=2019,7,12
print("Person's age is:",age_in_days(year, month, day),"days")
| [
11748,
4818,
8079,
198,
198,
4299,
1528,
62,
259,
62,
8424,
7,
1941,
11,
1227,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
23412,
82,
25,
198,
220,
220,
220,
220,
220,
614,
220,
532,
281,
18253,
1022,
4818,
8079,
13,
23678,
56,
17133,
290,
4818,
8079,
13,
22921,
56,
17133,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10200,
262,
614,
198,
220,
220,
220,
220,
220,
1227,
532,
281,
18253,
1022,
352,
290,
1105,
10200,
262,
1227,
628,
220,
220,
220,
16409,
25,
198,
220,
220,
220,
220,
220,
383,
1271,
286,
1528,
287,
262,
5128,
1227,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
611,
1227,
1875,
1367,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3128,
16,
796,
4818,
8079,
13,
4475,
7,
1941,
11,
8424,
11,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
3128,
17,
796,
4818,
8079,
13,
4475,
7,
1941,
10,
16,
11,
16,
11,
16,
8,
198,
220,
220,
220,
2073,
25,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
3128,
16,
796,
4818,
8079,
13,
4475,
7,
1941,
11,
8424,
11,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
3128,
17,
796,
4818,
8079,
13,
4475,
7,
1941,
11,
8424,
10,
16,
11,
16,
8,
198,
220,
220,
220,
220,
198,
220,
220,
220,
3580,
796,
3128,
17,
12,
4475,
16,
198,
220,
220,
220,
1441,
3580,
13,
12545,
198,
198,
1941,
11,
8424,
28,
23344,
11,
1065,
198,
4798,
7203,
15057,
286,
1528,
25,
1600,
12545,
62,
259,
62,
8424,
7,
1941,
11,
1227,
4008,
628,
198,
4299,
318,
62,
12102,
62,
4475,
7,
1941,
11,
1227,
11,
1110,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
23412,
82,
25,
198,
220,
220,
220,
220,
220,
614,
220,
532,
281,
18253,
10200,
262,
614,
198,
220,
220,
220,
220,
220,
1227,
532,
281,
18253,
10200,
262,
1227,
198,
220,
220,
220,
220,
220,
1110,
220,
220,
532,
281,
18253,
10200,
262,
1110,
628,
220,
220,
220,
16409,
25,
198,
220,
220,
220,
220,
220,
6407,
611,
614,
12,
8424,
12,
820,
318,
257,
4938,
3128,
290,
198,
220,
220,
220,
220,
220,
10352,
4306,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
611,
14808,
19608,
8079,
13,
23678,
56,
17133,
27,
28,
1941,
27,
28,
19608,
8079,
13,
22921,
56,
17133,
8,
290,
357,
16,
27,
28,
8424,
27,
28,
1065,
8,
290,
220,
198,
220,
220,
220,
220,
220,
220,
220,
357,
16,
27,
28,
820,
27,
28,
12545,
62,
259,
62,
8424,
7,
1941,
11,
1227,
4008,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
6407,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
198,
220,
220,
220,
220,
198,
1941,
11,
8424,
11,
820,
28,
11024,
11,
16,
11,
16,
198,
4798,
7,
271,
62,
12102,
62,
4475,
7,
1941,
11,
1227,
11,
1110,
4008,
628,
198,
4299,
1528,
62,
23395,
7,
1941,
16,
11,
1227,
16,
11,
1110,
16,
11,
614,
17,
11,
1227,
17,
11,
1110,
17,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
23412,
82,
25,
198,
220,
220,
220,
220,
220,
614,
16,
220,
532,
281,
18253,
10200,
262,
614,
286,
262,
717,
3128,
198,
220,
220,
220,
220,
220,
1227,
16,
532,
281,
18253,
10200,
262,
1227,
286,
262,
717,
3128,
198,
220,
220,
220,
220,
220,
1110,
16,
220,
220,
532,
281,
18253,
10200,
262,
1110,
286,
262,
717,
3128,
198,
220,
220,
220,
220,
220,
614,
17,
220,
532,
281,
18253,
10200,
262,
614,
286,
262,
1218,
3128,
198,
220,
220,
220,
220,
220,
1227,
17,
532,
281,
18253,
10200,
262,
1227,
286,
262,
1218,
3128,
198,
220,
220,
220,
220,
220,
1110,
17,
220,
220,
532,
281,
18253,
10200,
262,
1110,
286,
262,
1218,
3128,
628,
220,
220,
220,
16409,
25,
198,
220,
220,
220,
220,
220,
383,
1271,
286,
1528,
422,
262,
717,
3128,
284,
262,
1218,
3128,
13,
198,
220,
220,
220,
220,
220,
16409,
657,
611,
2035,
3128,
318,
12515,
393,
262,
1218,
3128,
318,
198,
220,
220,
220,
220,
220,
878,
262,
717,
3128,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
611,
357,
1662,
318,
62,
12102,
62,
4475,
7,
1941,
16,
11,
1227,
16,
11,
1110,
16,
8,
393,
198,
220,
220,
220,
220,
220,
220,
220,
407,
318,
62,
12102,
62,
4475,
7,
1941,
17,
11,
1227,
17,
11,
1110,
17,
8,
2599,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
657,
220,
220,
220,
220,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3128,
16,
796,
4818,
8079,
13,
4475,
7,
1941,
16,
11,
8424,
16,
11,
820,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
3128,
17,
796,
4818,
8079,
13,
4475,
7,
1941,
17,
11,
8424,
17,
11,
820,
17,
8,
198,
220,
220,
220,
220,
220,
220,
220,
611,
3128,
17,
27,
4475,
16,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
657,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
814,
28,
4475,
17,
12,
4475,
16,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
814,
13,
12545,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
1941,
16,
11,
1941,
17,
796,
4751,
11,
14585,
198,
8424,
16,
11,
8424,
17,
796,
352,
11,
17,
198,
820,
16,
11,
820,
17,
28,
16,
11,
17,
198,
4798,
7,
12545,
62,
23395,
7,
1941,
16,
11,
1227,
16,
11,
1110,
16,
11,
614,
17,
11,
1227,
17,
11,
1110,
17,
4008,
628,
198,
4299,
2479,
62,
259,
62,
12545,
7,
1941,
11,
1227,
11,
1110,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
23412,
82,
25,
198,
220,
220,
220,
220,
220,
614,
220,
532,
281,
18253,
10200,
262,
10955,
614,
198,
220,
220,
220,
220,
220,
1227,
532,
281,
18253,
10200,
262,
10955,
1227,
198,
220,
220,
220,
220,
220,
1110,
220,
220,
532,
281,
18253,
10200,
262,
10955,
1110,
628,
220,
220,
220,
16409,
25,
198,
220,
220,
220,
220,
220,
383,
2479,
286,
257,
1048,
351,
262,
5128,
10955,
355,
286,
1909,
13,
198,
220,
220,
220,
220,
220,
16409,
657,
611,
262,
5128,
3128,
318,
12515,
393,
611,
262,
5128,
198,
220,
220,
220,
220,
220,
3128,
318,
287,
262,
2003,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
611,
357,
1662,
318,
62,
12102,
62,
4475,
7,
1941,
11,
1227,
11,
1110,
8,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
657,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3128,
16,
796,
4818,
8079,
13,
4475,
7,
1941,
11,
8424,
11,
820,
8,
198,
220,
220,
220,
220,
220,
220,
220,
284,
12545,
62,
4475,
796,
4818,
8079,
13,
4475,
13,
40838,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
611,
3128,
16,
29,
83,
375,
592,
62,
4475,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
657,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2479,
796,
284,
12545,
62,
4475,
532,
3128,
16,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
2479,
13,
12545,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
1941,
11,
8424,
11,
820,
28,
23344,
11,
22,
11,
1065,
220,
220,
220,
220,
198,
4798,
7203,
15439,
338,
2479,
318,
25,
1600,
496,
62,
259,
62,
12545,
7,
1941,
11,
1227,
11,
1110,
27267,
12545,
4943,
198
] | 2.385911 | 1,306 |
import argparse
import json
import logging
import numpy as np
from datetime import datetime
from os import path
from webias.constants import BIAS_METRIC_LIMITS, BIAS_METRIC_ZERO, LOGGING_CONFIG
def calculate_mean_values(results_per_run: list) -> float:
"""Calculate the mean values of each dimension for the given lists of runs.
Return a list of means.
Arguments:
results_per_run: A list of lists, where each inner list contains evaluation results per run.
"""
results_by_list_length = list(zip(*results_per_run))
return np.mean(results_by_list_length, axis=1).tolist()
def calculate_max_values(results_per_run: list) -> float:
"""Calculate the maximum values of each dimension for the given lists of runs.
Return a list of maximum values.
Arguments:
results_per_run: A list of lists, where each inner list contains evaluation results per run.
"""
results_by_list_length = list(zip(*results_per_run))
return np.max(results_by_list_length, axis=1).tolist()
def calculate_min_values(results_per_run: list) -> float:
"""Calculate the minimum values of each dimension for the given lists of runs.
Return a list of minimum values.
Arguments:
results_per_run: A list of lists, where each inner list contains evaluation results per run.
"""
results_by_list_length = list(zip(*results_per_run))
return np.min(results_by_list_length, axis=1).tolist()
def calculate_silhouette_area(lower_bounds: list, upper_bounds: list, x_values: list) -> float:
"""Calculate the silhouette area between two curves that are defined by the given bounds.
Return the size of the area.
Uses the numpy implementation of the trapezoidal rule to approximate the area between the two
curves.
Arguments:
lower_bounds -- The points defining the graph of the lower bounds of the silhouette.
upper_bounds -- The points defining the graph of the upper bounds of the silhouette.
x_values -- The points on the x-axis at which the lower and upper bounds were measured.
"""
upper_graph_area = np.trapz(y=upper_bounds, x=x_values)
lower_graph_area = np.trapz(y=lower_bounds, x=x_values)
return upper_graph_area - lower_graph_area
def calculate_graph_coverage(
metric: str,
x_axis_size: int,
silhouette_size: float,
min_y_value: int = None,
max_y_value: int = None) -> float:
"""Calculate the percentage of the available area covered by the given silhouette.
Return the percentage covered.
Arguments:
metric -- The metric that was used. Important to figure out upper and lower y-value bounds.
x_axis_size -- The largest x-value of the measurement.
silhouette_size -- The size of the area covered by the silhouette.
min_y_value -- The minimum value on the y-axis. Necessary in case the metric is unknown or not
applicable.
max_y_value -- The maximum value on the y-axis. Necessary in case the metric is unknown or not
applicable.
"""
if min_y_value and max_y_value:
y_axis_length = max_y_value - min_y_value
else:
y_axis_length = BIAS_METRIC_LIMITS[metric][1] - BIAS_METRIC_LIMITS[metric][0]
return silhouette_size / (x_axis_size * y_axis_length)
def calculate_model_statistics(evaluation_results: dict) -> dict:
"""Calculate different statistics for the given evaluation data, such as graph coverage.
Return a dictionary containing the different statistical results for each evaluation in the
given results file.
Arguments:
evaluation_results -- Dictionary containing the results of a specific model for different
metrics. Each top-level key is expected to be a metric name. An exception
is the top-level key "model_name", which is expected to hold an identifier
for the evaluated model.
"""
model_analysis_results = {}
# For each metric evaluation of the evaluated model...
for metric_name, results_by_type in evaluation_results.items():
# If the current item is not actually a metric evaluation
if metric_name == "model_name":
continue
model_analysis_results[metric_name] = {}
# For each test type of the current metric
for test_type, results in results_by_type.items():
model_analysis_results[metric_name][test_type] = {}
# For each shuffle type...
for shuffle_type, values in results.items():
# If the current item is not actually a list of values
if shuffle_type == "attribute_set_lengths" or shuffle_type == "target_set_lengths":
continue
shuffled_list = shuffle_type.split("_")[1]
set_lengths = results[f"{shuffled_list}_set_lengths"]
mean_values = calculate_mean_values(values)
max_values = calculate_max_values(values)
min_values = calculate_min_values(values)
silhouette_size = calculate_silhouette_area(
min_values, max_values, set_lengths)
graph_coverage = calculate_graph_coverage(
metric_name,
max(set_lengths),
silhouette_size)
robustness_score = get_robustness_score(graph_coverage)
statistics = {
"mean_values": mean_values,
"max_values": max_values,
"min_values": min_values,
"silhouette_size": silhouette_size,
"graph_coverage": graph_coverage,
"robustness_score": robustness_score,
"x_values": set_lengths}
model_analysis_results[metric_name][test_type][shuffle_type] = statistics
return model_analysis_results
def calculate_accuracy_scores(model_statistics: dict) -> dict:
"""Calcuate the area between each two mean curves in the given data.
Return a dict with graph coverage (calculated area normalized by the total graph size) for each
of the metrics in the given data.
Arguments:
model_statistics -- Dictionary holding the model statistics data. Each top-level key is
expected to be a model identifier, with the value being the respective
model statistics.
"""
accuracy_scores = {}
# Extract actual statistic lists from given dict
model_statistics_unpkg = [
model_statistics[model]["statistics"] for model in model_statistics.keys()]
# For each metric evaluation of the evaluated model...
# (here we can always just use the keys of the first models as they are supposed to be equal
# for both models; otherwise this analysis wont work anyway)
for metric_name in model_statistics_unpkg[0].keys():
accuracy_scores[metric_name] = {}
# For each test type of the current metric...
for test_type in model_statistics_unpkg[0][metric_name].keys():
accuracy_scores[metric_name][test_type] = {}
# For each shuffle type...
for shuffle_type in model_statistics_unpkg[0][metric_name][test_type].keys():
mean_values_model_1 = np.array(
model_statistics_unpkg[0][metric_name][test_type][shuffle_type]["mean_values"])
mean_values_model_2 = np.array(
model_statistics_unpkg[1][metric_name][test_type][shuffle_type]["mean_values"])
x_values = np.array(
model_statistics_unpkg[0][metric_name][test_type][shuffle_type]["x_values"])
# Get the absolute values of the curves to bring them both into the same range
# Necessary for measures where bias can also be negative, like WEAT
abs_means_1 = np.abs(mean_values_model_1)
abs_means_2 = np.abs(mean_values_model_2)
area_between_means = calculate_silhouette_area(abs_means_2, abs_means_1, x_values)
# Calculate graph coverage
coverage = calculate_graph_coverage(
metric_name,
max(x_values),
area_between_means,
min_y_value=BIAS_METRIC_ZERO[metric_name],
max_y_value=BIAS_METRIC_LIMITS[metric_name][1])
accuracy_scores[metric_name][test_type][shuffle_type] = get_accuracy_score(coverage)
return accuracy_scores
def get_accuracy_score(mean_silhouette_coverage: float) -> float:
"""Calculate the accuracy score given the coverage of the graph by the silhouette between means.
Return the accuracy score.
Arguments:
mean_silhouette_coverage -- Coverage of the total graph by the respective silhouette between
means.
"""
return 0.5 + (0.5 * mean_silhouette_coverage)
def get_robustness_score(silhouette_coverage: float) -> float:
"""Calculate the robustness score given the coverage of the graph by the silhouette.
Return the robustness score.
Arguments:
silhouette_coverage -- Coverage of the total graph by the respective silhouette.
"""
return 1 - silhouette_coverage
if __name__ == "__main__":
# Add cli parameters
parser = argparse.ArgumentParser(
"A script to analyze previously calculated evaluation results and prepare them for "
"plotting.")
parser.add_argument(
"-r",
"--evaluation_results",
required=True,
nargs="+",
type=str,
help="List of paths to the evaluation results files.",
metavar="EVALUATION_RESULTS")
parser.add_argument(
"-o",
"--output",
required=True,
type=str,
help="Path to the directory where the result file should be written to.",
metavar="OUTPUT_DIR")
parser.add_argument(
"-f",
"--output_filename",
type=str,
default=None,
help="If set, the given string will be used as filename for the output file. Otherwise, "
"the default filename will be used.",
metavar="OUTPUT_FILENAME")
args = parser.parse_args()
logging.basicConfig(**LOGGING_CONFIG)
main()
logging.info("Done.")
| [
11748,
1822,
29572,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
28686,
1330,
3108,
198,
198,
6738,
3992,
4448,
13,
9979,
1187,
1330,
20068,
1921,
62,
47123,
41132,
62,
43,
3955,
29722,
11,
20068,
1921,
62,
47123,
41132,
62,
57,
34812,
11,
41605,
38,
2751,
62,
10943,
16254,
628,
198,
4299,
15284,
62,
32604,
62,
27160,
7,
43420,
62,
525,
62,
5143,
25,
1351,
8,
4613,
12178,
25,
198,
220,
220,
220,
37227,
9771,
3129,
378,
262,
1612,
3815,
286,
1123,
15793,
329,
262,
1813,
8341,
286,
4539,
13,
628,
220,
220,
220,
8229,
257,
1351,
286,
1724,
13,
628,
220,
220,
220,
20559,
2886,
25,
198,
220,
220,
220,
2482,
62,
525,
62,
5143,
25,
317,
1351,
286,
8341,
11,
810,
1123,
8434,
1351,
4909,
12660,
2482,
583,
1057,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
2482,
62,
1525,
62,
4868,
62,
13664,
796,
1351,
7,
13344,
46491,
43420,
62,
525,
62,
5143,
4008,
628,
220,
220,
220,
1441,
45941,
13,
32604,
7,
43420,
62,
1525,
62,
4868,
62,
13664,
11,
16488,
28,
16,
737,
83,
349,
396,
3419,
628,
198,
4299,
15284,
62,
9806,
62,
27160,
7,
43420,
62,
525,
62,
5143,
25,
1351,
8,
4613,
12178,
25,
198,
220,
220,
220,
37227,
9771,
3129,
378,
262,
5415,
3815,
286,
1123,
15793,
329,
262,
1813,
8341,
286,
4539,
13,
628,
220,
220,
220,
8229,
257,
1351,
286,
5415,
3815,
13,
628,
220,
220,
220,
20559,
2886,
25,
198,
220,
220,
220,
2482,
62,
525,
62,
5143,
25,
317,
1351,
286,
8341,
11,
810,
1123,
8434,
1351,
4909,
12660,
2482,
583,
1057,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
2482,
62,
1525,
62,
4868,
62,
13664,
796,
1351,
7,
13344,
46491,
43420,
62,
525,
62,
5143,
4008,
628,
220,
220,
220,
1441,
45941,
13,
9806,
7,
43420,
62,
1525,
62,
4868,
62,
13664,
11,
16488,
28,
16,
737,
83,
349,
396,
3419,
628,
198,
4299,
15284,
62,
1084,
62,
27160,
7,
43420,
62,
525,
62,
5143,
25,
1351,
8,
4613,
12178,
25,
198,
220,
220,
220,
37227,
9771,
3129,
378,
262,
5288,
3815,
286,
1123,
15793,
329,
262,
1813,
8341,
286,
4539,
13,
628,
220,
220,
220,
8229,
257,
1351,
286,
5288,
3815,
13,
628,
220,
220,
220,
20559,
2886,
25,
198,
220,
220,
220,
2482,
62,
525,
62,
5143,
25,
317,
1351,
286,
8341,
11,
810,
1123,
8434,
1351,
4909,
12660,
2482,
583,
1057,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
2482,
62,
1525,
62,
4868,
62,
13664,
796,
1351,
7,
13344,
46491,
43420,
62,
525,
62,
5143,
4008,
628,
220,
220,
220,
1441,
45941,
13,
1084,
7,
43420,
62,
1525,
62,
4868,
62,
13664,
11,
16488,
28,
16,
737,
83,
349,
396,
3419,
628,
198,
4299,
15284,
62,
18217,
15710,
5857,
62,
20337,
7,
21037,
62,
65,
3733,
25,
1351,
11,
6727,
62,
65,
3733,
25,
1351,
11,
2124,
62,
27160,
25,
1351,
8,
4613,
12178,
25,
198,
220,
220,
220,
37227,
9771,
3129,
378,
262,
41834,
1989,
1022,
734,
23759,
326,
389,
5447,
416,
262,
1813,
22303,
13,
628,
220,
220,
220,
8229,
262,
2546,
286,
262,
1989,
13,
628,
220,
220,
220,
36965,
262,
299,
32152,
7822,
286,
262,
1291,
46057,
47502,
3896,
284,
27665,
262,
1989,
1022,
262,
734,
198,
220,
220,
220,
23759,
13,
628,
220,
220,
220,
20559,
2886,
25,
198,
220,
220,
220,
2793,
62,
65,
3733,
1377,
383,
2173,
16215,
262,
4823,
286,
262,
2793,
22303,
286,
262,
41834,
13,
198,
220,
220,
220,
6727,
62,
65,
3733,
1377,
383,
2173,
16215,
262,
4823,
286,
262,
6727,
22303,
286,
262,
41834,
13,
198,
220,
220,
220,
2124,
62,
27160,
1377,
383,
2173,
319,
262,
2124,
12,
22704,
379,
543,
262,
2793,
290,
6727,
22303,
547,
8630,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
6727,
62,
34960,
62,
20337,
796,
45941,
13,
46670,
89,
7,
88,
28,
45828,
62,
65,
3733,
11,
2124,
28,
87,
62,
27160,
8,
198,
220,
220,
220,
2793,
62,
34960,
62,
20337,
796,
45941,
13,
46670,
89,
7,
88,
28,
21037,
62,
65,
3733,
11,
2124,
28,
87,
62,
27160,
8,
628,
220,
220,
220,
1441,
6727,
62,
34960,
62,
20337,
532,
2793,
62,
34960,
62,
20337,
628,
198,
4299,
15284,
62,
34960,
62,
1073,
1857,
7,
198,
220,
220,
220,
220,
220,
220,
220,
18663,
25,
965,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2124,
62,
22704,
62,
7857,
25,
493,
11,
198,
220,
220,
220,
220,
220,
220,
220,
41834,
62,
7857,
25,
12178,
11,
198,
220,
220,
220,
220,
220,
220,
220,
949,
62,
88,
62,
8367,
25,
493,
796,
6045,
11,
198,
220,
220,
220,
220,
220,
220,
220,
3509,
62,
88,
62,
8367,
25,
493,
796,
6045,
8,
4613,
12178,
25,
198,
220,
220,
220,
37227,
9771,
3129,
378,
262,
5873,
286,
262,
1695,
1989,
5017,
416,
262,
1813,
41834,
13,
628,
220,
220,
220,
8229,
262,
5873,
5017,
13,
628,
220,
220,
220,
20559,
2886,
25,
198,
220,
220,
220,
18663,
1377,
383,
18663,
326,
373,
973,
13,
28511,
284,
3785,
503,
6727,
290,
2793,
331,
12,
8367,
22303,
13,
198,
220,
220,
220,
2124,
62,
22704,
62,
7857,
1377,
383,
4387,
2124,
12,
8367,
286,
262,
15558,
13,
198,
220,
220,
220,
41834,
62,
7857,
1377,
383,
2546,
286,
262,
1989,
5017,
416,
262,
41834,
13,
198,
220,
220,
220,
949,
62,
88,
62,
8367,
1377,
383,
5288,
1988,
319,
262,
331,
12,
22704,
13,
19652,
408,
560,
287,
1339,
262,
18663,
318,
6439,
393,
407,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9723,
13,
198,
220,
220,
220,
3509,
62,
88,
62,
8367,
1377,
383,
5415,
1988,
319,
262,
331,
12,
22704,
13,
19652,
408,
560,
287,
1339,
262,
18663,
318,
6439,
393,
407,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9723,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
611,
949,
62,
88,
62,
8367,
290,
3509,
62,
88,
62,
8367,
25,
198,
220,
220,
220,
220,
220,
220,
220,
331,
62,
22704,
62,
13664,
796,
3509,
62,
88,
62,
8367,
532,
949,
62,
88,
62,
8367,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
331,
62,
22704,
62,
13664,
796,
20068,
1921,
62,
47123,
41132,
62,
43,
3955,
29722,
58,
4164,
1173,
7131,
16,
60,
532,
20068,
1921,
62,
47123,
41132,
62,
43,
3955,
29722,
58,
4164,
1173,
7131,
15,
60,
628,
220,
220,
220,
1441,
41834,
62,
7857,
1220,
357,
87,
62,
22704,
62,
7857,
1635,
331,
62,
22704,
62,
13664,
8,
628,
198,
4299,
15284,
62,
19849,
62,
14269,
3969,
7,
18206,
2288,
62,
43420,
25,
8633,
8,
4613,
8633,
25,
198,
220,
220,
220,
37227,
9771,
3129,
378,
1180,
7869,
329,
262,
1813,
12660,
1366,
11,
884,
355,
4823,
5197,
13,
628,
220,
220,
220,
8229,
257,
22155,
7268,
262,
1180,
13905,
2482,
329,
1123,
12660,
287,
262,
198,
220,
220,
220,
1813,
2482,
2393,
13,
628,
220,
220,
220,
20559,
2886,
25,
198,
220,
220,
220,
12660,
62,
43420,
1377,
28261,
7268,
262,
2482,
286,
257,
2176,
2746,
329,
1180,
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,
20731,
13,
5501,
1353,
12,
5715,
1994,
318,
2938,
284,
307,
257,
18663,
1438,
13,
1052,
6631,
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,
318,
262,
1353,
12,
5715,
1994,
366,
19849,
62,
3672,
1600,
543,
318,
2938,
284,
1745,
281,
27421,
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,
329,
262,
16726,
2746,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
2746,
62,
20930,
62,
43420,
796,
23884,
628,
220,
220,
220,
1303,
1114,
1123,
18663,
12660,
286,
262,
16726,
2746,
986,
198,
220,
220,
220,
329,
18663,
62,
3672,
11,
2482,
62,
1525,
62,
4906,
287,
12660,
62,
43420,
13,
23814,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
1002,
262,
1459,
2378,
318,
407,
1682,
257,
18663,
12660,
198,
220,
220,
220,
220,
220,
220,
220,
611,
18663,
62,
3672,
6624,
366,
19849,
62,
3672,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2555,
628,
220,
220,
220,
220,
220,
220,
220,
2746,
62,
20930,
62,
43420,
58,
4164,
1173,
62,
3672,
60,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
1114,
1123,
1332,
2099,
286,
262,
1459,
18663,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1332,
62,
4906,
11,
2482,
287,
2482,
62,
1525,
62,
4906,
13,
23814,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2746,
62,
20930,
62,
43420,
58,
4164,
1173,
62,
3672,
7131,
9288,
62,
4906,
60,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
1114,
1123,
36273,
2099,
986,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
36273,
62,
4906,
11,
3815,
287,
2482,
13,
23814,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
1002,
262,
1459,
2378,
318,
407,
1682,
257,
1351,
286,
3815,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
36273,
62,
4906,
6624,
366,
42348,
62,
2617,
62,
13664,
82,
1,
393,
36273,
62,
4906,
6624,
366,
16793,
62,
2617,
62,
13664,
82,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2555,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32299,
992,
62,
4868,
796,
36273,
62,
4906,
13,
35312,
7203,
62,
4943,
58,
16,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
900,
62,
13664,
82,
796,
2482,
58,
69,
1,
90,
1477,
1648,
992,
62,
4868,
92,
62,
2617,
62,
13664,
82,
8973,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1612,
62,
27160,
796,
15284,
62,
32604,
62,
27160,
7,
27160,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3509,
62,
27160,
796,
15284,
62,
9806,
62,
27160,
7,
27160,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
949,
62,
27160,
796,
15284,
62,
1084,
62,
27160,
7,
27160,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41834,
62,
7857,
796,
15284,
62,
18217,
15710,
5857,
62,
20337,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
949,
62,
27160,
11,
3509,
62,
27160,
11,
900,
62,
13664,
82,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4823,
62,
1073,
1857,
796,
15284,
62,
34960,
62,
1073,
1857,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
18663,
62,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3509,
7,
2617,
62,
13664,
82,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41834,
62,
7857,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12373,
1108,
62,
26675,
796,
651,
62,
22609,
436,
1108,
62,
26675,
7,
34960,
62,
1073,
1857,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7869,
796,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
32604,
62,
27160,
1298,
1612,
62,
27160,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
9806,
62,
27160,
1298,
3509,
62,
27160,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
1084,
62,
27160,
1298,
949,
62,
27160,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
18217,
15710,
5857,
62,
7857,
1298,
41834,
62,
7857,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
34960,
62,
1073,
1857,
1298,
4823,
62,
1073,
1857,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
22609,
436,
1108,
62,
26675,
1298,
12373,
1108,
62,
26675,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
87,
62,
27160,
1298,
900,
62,
13664,
82,
92,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2746,
62,
20930,
62,
43420,
58,
4164,
1173,
62,
3672,
7131,
9288,
62,
4906,
7131,
1477,
18137,
62,
4906,
60,
796,
7869,
628,
220,
220,
220,
1441,
2746,
62,
20930,
62,
43420,
628,
198,
4299,
15284,
62,
4134,
23843,
62,
1416,
2850,
7,
19849,
62,
14269,
3969,
25,
8633,
8,
4613,
8633,
25,
198,
220,
220,
220,
37227,
9771,
66,
4985,
262,
1989,
1022,
1123,
734,
1612,
23759,
287,
262,
1813,
1366,
13,
628,
220,
220,
220,
8229,
257,
8633,
351,
4823,
5197,
357,
9948,
49262,
1989,
39279,
416,
262,
2472,
4823,
2546,
8,
329,
1123,
198,
220,
220,
220,
286,
262,
20731,
287,
262,
1813,
1366,
13,
628,
220,
220,
220,
20559,
2886,
25,
198,
220,
220,
220,
2746,
62,
14269,
3969,
1377,
28261,
4769,
262,
2746,
7869,
1366,
13,
5501,
1353,
12,
5715,
1994,
318,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2938,
284,
307,
257,
2746,
27421,
11,
351,
262,
1988,
852,
262,
11756,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2746,
7869,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
9922,
62,
1416,
2850,
796,
23884,
628,
220,
220,
220,
1303,
29677,
4036,
24696,
8341,
422,
1813,
8633,
198,
220,
220,
220,
2746,
62,
14269,
3969,
62,
403,
35339,
796,
685,
198,
220,
220,
220,
220,
220,
220,
220,
2746,
62,
14269,
3969,
58,
19849,
7131,
1,
14269,
3969,
8973,
329,
2746,
287,
2746,
62,
14269,
3969,
13,
13083,
3419,
60,
628,
220,
220,
220,
1303,
1114,
1123,
18663,
12660,
286,
262,
16726,
2746,
986,
198,
220,
220,
220,
1303,
357,
1456,
356,
460,
1464,
655,
779,
262,
8251,
286,
262,
717,
4981,
355,
484,
389,
4385,
284,
307,
4961,
198,
220,
220,
220,
1303,
329,
1111,
4981,
26,
4306,
428,
3781,
28329,
670,
6949,
8,
198,
220,
220,
220,
329,
18663,
62,
3672,
287,
2746,
62,
14269,
3969,
62,
403,
35339,
58,
15,
4083,
13083,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
9922,
62,
1416,
2850,
58,
4164,
1173,
62,
3672,
60,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
1114,
1123,
1332,
2099,
286,
262,
1459,
18663,
986,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1332,
62,
4906,
287,
2746,
62,
14269,
3969,
62,
403,
35339,
58,
15,
7131,
4164,
1173,
62,
3672,
4083,
13083,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9922,
62,
1416,
2850,
58,
4164,
1173,
62,
3672,
7131,
9288,
62,
4906,
60,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
1114,
1123,
36273,
2099,
986,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
36273,
62,
4906,
287,
2746,
62,
14269,
3969,
62,
403,
35339,
58,
15,
7131,
4164,
1173,
62,
3672,
7131,
9288,
62,
4906,
4083,
13083,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1612,
62,
27160,
62,
19849,
62,
16,
796,
45941,
13,
18747,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2746,
62,
14269,
3969,
62,
403,
35339,
58,
15,
7131,
4164,
1173,
62,
3672,
7131,
9288,
62,
4906,
7131,
1477,
18137,
62,
4906,
7131,
1,
32604,
62,
27160,
8973,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1612,
62,
27160,
62,
19849,
62,
17,
796,
45941,
13,
18747,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2746,
62,
14269,
3969,
62,
403,
35339,
58,
16,
7131,
4164,
1173,
62,
3672,
7131,
9288,
62,
4906,
7131,
1477,
18137,
62,
4906,
7131,
1,
32604,
62,
27160,
8973,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
62,
27160,
796,
45941,
13,
18747,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2746,
62,
14269,
3969,
62,
403,
35339,
58,
15,
7131,
4164,
1173,
62,
3672,
7131,
9288,
62,
4906,
7131,
1477,
18137,
62,
4906,
7131,
1,
87,
62,
27160,
8973,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
3497,
262,
4112,
3815,
286,
262,
23759,
284,
2222,
606,
1111,
656,
262,
976,
2837,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
19652,
408,
560,
329,
5260,
810,
10690,
460,
635,
307,
4633,
11,
588,
12887,
1404,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2352,
62,
1326,
504,
62,
16,
796,
45941,
13,
8937,
7,
32604,
62,
27160,
62,
19849,
62,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2352,
62,
1326,
504,
62,
17,
796,
45941,
13,
8937,
7,
32604,
62,
27160,
62,
19849,
62,
17,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1989,
62,
23395,
62,
1326,
504,
796,
15284,
62,
18217,
15710,
5857,
62,
20337,
7,
8937,
62,
1326,
504,
62,
17,
11,
2352,
62,
1326,
504,
62,
16,
11,
2124,
62,
27160,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
27131,
378,
4823,
5197,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5197,
796,
15284,
62,
34960,
62,
1073,
1857,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
18663,
62,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3509,
7,
87,
62,
27160,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1989,
62,
23395,
62,
1326,
504,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
949,
62,
88,
62,
8367,
28,
3483,
1921,
62,
47123,
41132,
62,
57,
34812,
58,
4164,
1173,
62,
3672,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3509,
62,
88,
62,
8367,
28,
3483,
1921,
62,
47123,
41132,
62,
43,
3955,
29722,
58,
4164,
1173,
62,
3672,
7131,
16,
12962,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9922,
62,
1416,
2850,
58,
4164,
1173,
62,
3672,
7131,
9288,
62,
4906,
7131,
1477,
18137,
62,
4906,
60,
796,
651,
62,
4134,
23843,
62,
26675,
7,
1073,
1857,
8,
628,
220,
220,
220,
1441,
9922,
62,
1416,
2850,
628,
198,
4299,
651,
62,
4134,
23843,
62,
26675,
7,
32604,
62,
18217,
15710,
5857,
62,
1073,
1857,
25,
12178,
8,
4613,
12178,
25,
198,
220,
220,
220,
37227,
9771,
3129,
378,
262,
9922,
4776,
1813,
262,
5197,
286,
262,
4823,
416,
262,
41834,
1022,
1724,
13,
628,
220,
220,
220,
8229,
262,
9922,
4776,
13,
628,
220,
220,
220,
20559,
2886,
25,
198,
220,
220,
220,
1612,
62,
18217,
15710,
5857,
62,
1073,
1857,
1377,
33998,
286,
262,
2472,
4823,
416,
262,
11756,
41834,
1022,
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,
1724,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1441,
657,
13,
20,
1343,
357,
15,
13,
20,
1635,
1612,
62,
18217,
15710,
5857,
62,
1073,
1857,
8,
628,
198,
4299,
651,
62,
22609,
436,
1108,
62,
26675,
7,
18217,
15710,
5857,
62,
1073,
1857,
25,
12178,
8,
4613,
12178,
25,
198,
220,
220,
220,
37227,
9771,
3129,
378,
262,
12373,
1108,
4776,
1813,
262,
5197,
286,
262,
4823,
416,
262,
41834,
13,
628,
220,
220,
220,
8229,
262,
12373,
1108,
4776,
13,
628,
220,
220,
220,
20559,
2886,
25,
198,
220,
220,
220,
41834,
62,
1073,
1857,
1377,
33998,
286,
262,
2472,
4823,
416,
262,
11756,
41834,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1441,
352,
532,
41834,
62,
1073,
1857,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1303,
3060,
537,
72,
10007,
198,
220,
220,
220,
30751,
796,
1822,
29572,
13,
28100,
1713,
46677,
7,
198,
220,
220,
220,
220,
220,
220,
220,
366,
32,
4226,
284,
16602,
4271,
10488,
12660,
2482,
290,
8335,
606,
329,
366,
198,
220,
220,
220,
220,
220,
220,
220,
366,
29487,
889,
19570,
628,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7,
198,
220,
220,
220,
220,
220,
220,
220,
27444,
81,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
366,
438,
18206,
2288,
62,
43420,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
2672,
28,
17821,
11,
198,
220,
220,
220,
220,
220,
220,
220,
299,
22046,
2625,
10,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
28,
2536,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1037,
2625,
8053,
286,
13532,
284,
262,
12660,
2482,
3696,
33283,
198,
220,
220,
220,
220,
220,
220,
220,
1138,
615,
283,
2625,
20114,
1847,
52,
6234,
62,
46274,
4943,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7,
198,
220,
220,
220,
220,
220,
220,
220,
27444,
78,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
366,
438,
22915,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
2672,
28,
17821,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
28,
2536,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1037,
2625,
15235,
284,
262,
8619,
810,
262,
1255,
2393,
815,
307,
3194,
284,
33283,
198,
220,
220,
220,
220,
220,
220,
220,
1138,
615,
283,
2625,
2606,
7250,
3843,
62,
34720,
4943,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7,
198,
220,
220,
220,
220,
220,
220,
220,
27444,
69,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
366,
438,
22915,
62,
34345,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
28,
2536,
11,
198,
220,
220,
220,
220,
220,
220,
220,
4277,
28,
14202,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1037,
2625,
1532,
900,
11,
262,
1813,
4731,
481,
307,
973,
355,
29472,
329,
262,
5072,
2393,
13,
15323,
11,
366,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
1169,
4277,
29472,
481,
307,
973,
33283,
198,
220,
220,
220,
220,
220,
220,
220,
1138,
615,
283,
2625,
2606,
7250,
3843,
62,
46700,
1677,
10067,
4943,
628,
220,
220,
220,
26498,
796,
30751,
13,
29572,
62,
22046,
3419,
198,
220,
220,
220,
18931,
13,
35487,
16934,
7,
1174,
25294,
38,
2751,
62,
10943,
16254,
8,
628,
220,
220,
220,
1388,
3419,
198,
220,
220,
220,
18931,
13,
10951,
7203,
45677,
19570,
198
] | 2.516715 | 4,128 |
from searcher import NCBI_searcher
# this api_key is only for testing. So pls use your api_key from ur NCBI accounts, otherwise it will effect your speed
api_key = '1cb4976dd163905feedacce5da0f10552309'
keywords = "metabolomics"
keywords_file = "propanoyl-CoA"
searcher = NCBI_searcher(api_key=api_key, len_limit=0)
# just search them
searcher.search_from_all(keywords, keywords_file, thread_num=10, keep_cache=False, case_sensitive=False)
print("finished!")
| [
6738,
9622,
2044,
1330,
8823,
3483,
62,
325,
283,
2044,
628,
198,
2,
428,
40391,
62,
2539,
318,
691,
329,
4856,
13,
1406,
458,
82,
779,
534,
40391,
62,
2539,
422,
2956,
8823,
3483,
5504,
11,
4306,
340,
481,
1245,
534,
2866,
198,
15042,
62,
2539,
796,
705,
16,
21101,
2920,
4304,
1860,
1433,
2670,
2713,
12363,
330,
344,
20,
6814,
15,
69,
940,
2816,
19214,
24,
6,
198,
198,
2539,
10879,
796,
366,
4164,
28426,
31994,
1,
198,
2539,
10879,
62,
7753,
796,
366,
1676,
6839,
726,
75,
12,
7222,
32,
1,
198,
198,
325,
283,
2044,
796,
8823,
3483,
62,
325,
283,
2044,
7,
15042,
62,
2539,
28,
15042,
62,
2539,
11,
18896,
62,
32374,
28,
15,
8,
198,
198,
2,
655,
2989,
606,
198,
325,
283,
2044,
13,
12947,
62,
6738,
62,
439,
7,
2539,
10879,
11,
26286,
62,
7753,
11,
4704,
62,
22510,
28,
940,
11,
1394,
62,
23870,
28,
25101,
11,
1339,
62,
30176,
28,
25101,
8,
198,
198,
4798,
7203,
43952,
2474,
8,
198
] | 2.735294 | 170 |
# coding: utf-8
"""
CCCS
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 0.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility library
import six
from swagger_client.api_client import ApiClient
class UsersApi(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen
"""
def create_user(self, **kwargs): # noqa: E501
"""Registration end point for a user account # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.create_user(async=True)
>>> result = thread.get()
:param async bool
:param user:
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.create_user_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.create_user_with_http_info(**kwargs) # noqa: E501
return data
def create_user_with_http_info(self, **kwargs): # noqa: E501
"""Registration end point for a user account # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.create_user_with_http_info(async=True)
>>> result = thread.get()
:param async bool
:param user:
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['user'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method create_user" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'user' in params:
body_params = params['user']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/users/register', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def delete_user(self, id, **kwargs): # noqa: E501
"""Delete user (only allowed by the user themselves) # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.delete_user(id, async=True)
>>> result = thread.get()
:param async bool
:param str id: The unique identifer for an Object (i.e. User, Task, Project, Submission etc) (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.delete_user_with_http_info(id, **kwargs) # noqa: E501
else:
(data) = self.delete_user_with_http_info(id, **kwargs) # noqa: E501
return data
def delete_user_with_http_info(self, id, **kwargs): # noqa: E501
"""Delete user (only allowed by the user themselves) # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.delete_user_with_http_info(id, async=True)
>>> result = thread.get()
:param async bool
:param str id: The unique identifer for an Object (i.e. User, Task, Project, Submission etc) (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['id'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method delete_user" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'id' is set
if ('id' not in params or
params['id'] is None):
raise ValueError("Missing the required parameter `id` when calling `delete_user`") # noqa: E501
if 'id' in params and not re.search('^[a-zA-Z0-9-]+$', params['id']): # noqa: E501
raise ValueError("Invalid value for parameter `id` when calling `delete_user`, must conform to the pattern `/^[a-zA-Z0-9-]+$/`") # noqa: E501
collection_formats = {}
path_params = {}
if 'id' in params:
path_params['id'] = params['id'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['anonUser', 'apiKeyHeader'] # noqa: E501
return self.api_client.call_api(
'/users/{id}', 'DELETE',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def generate(self, **kwargs): # noqa: E501
"""Post auth for token response # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.generate(async=True)
>>> result = thread.get()
:param async bool
:param token:
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.generate_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.generate_with_http_info(**kwargs) # noqa: E501
return data
def generate_with_http_info(self, **kwargs): # noqa: E501
"""Post auth for token response # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.generate_with_http_info(async=True)
>>> result = thread.get()
:param async bool
:param token:
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['token'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method generate" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'token' in params:
body_params = params['token']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/users/authorize', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_subs(self, id, **kwargs): # noqa: E501
"""Get all submissions for a user (or those matching an ID) # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_subs(id, async=True)
>>> result = thread.get()
:param async bool
:param str id: The unique identifer for an Object (i.e. User, Task, Project, Submission etc) (required)
:return: list[InlineResponse2004]
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_subs_with_http_info(id, **kwargs) # noqa: E501
else:
(data) = self.get_subs_with_http_info(id, **kwargs) # noqa: E501
return data
def get_subs_with_http_info(self, id, **kwargs): # noqa: E501
"""Get all submissions for a user (or those matching an ID) # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_subs_with_http_info(id, async=True)
>>> result = thread.get()
:param async bool
:param str id: The unique identifer for an Object (i.e. User, Task, Project, Submission etc) (required)
:return: list[InlineResponse2004]
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['id'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_subs" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'id' is set
if ('id' not in params or
params['id'] is None):
raise ValueError("Missing the required parameter `id` when calling `get_subs`") # noqa: E501
if 'id' in params and not re.search('^[a-zA-Z0-9-]+$', params['id']): # noqa: E501
raise ValueError("Invalid value for parameter `id` when calling `get_subs`, must conform to the pattern `/^[a-zA-Z0-9-]+$/`") # noqa: E501
collection_formats = {}
path_params = {}
if 'id' in params:
path_params['id'] = params['id'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['anonUser', 'apiKeyHeader'] # noqa: E501
return self.api_client.call_api(
'/users/{id}/submissions', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='list[InlineResponse2004]', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_user(self, id, **kwargs): # noqa: E501
"""Get all users (or those matching an ID) # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_user(id, async=True)
>>> result = thread.get()
:param async bool
:param str id: The unique identifer for an Object (i.e. User, Task, Project, Submission etc) (required)
:return: object
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_user_with_http_info(id, **kwargs) # noqa: E501
else:
(data) = self.get_user_with_http_info(id, **kwargs) # noqa: E501
return data
def get_user_with_http_info(self, id, **kwargs): # noqa: E501
"""Get all users (or those matching an ID) # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_user_with_http_info(id, async=True)
>>> result = thread.get()
:param async bool
:param str id: The unique identifer for an Object (i.e. User, Task, Project, Submission etc) (required)
:return: object
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['id'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_user" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'id' is set
if ('id' not in params or
params['id'] is None):
raise ValueError("Missing the required parameter `id` when calling `get_user`") # noqa: E501
if 'id' in params and not re.search('^[a-zA-Z0-9-]+$', params['id']): # noqa: E501
raise ValueError("Invalid value for parameter `id` when calling `get_user`, must conform to the pattern `/^[a-zA-Z0-9-]+$/`") # noqa: E501
collection_formats = {}
path_params = {}
if 'id' in params:
path_params['id'] = params['id'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['anonUser', 'apiKeyHeader'] # noqa: E501
return self.api_client.call_api(
'/users/{id}', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='object', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def get_users(self, **kwargs): # noqa: E501
"""get_users # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_users(async=True)
>>> result = thread.get()
:param async bool
:param str search_term:
:param int limit:
:return: list[object]
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.get_users_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.get_users_with_http_info(**kwargs) # noqa: E501
return data
def get_users_with_http_info(self, **kwargs): # noqa: E501
"""get_users # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_users_with_http_info(async=True)
>>> result = thread.get()
:param async bool
:param str search_term:
:param int limit:
:return: list[object]
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['search_term', 'limit'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_users" % key
)
params[key] = val
del params['kwargs']
if 'limit' in params and params['limit'] < 0: # noqa: E501
raise ValueError("Invalid value for parameter `limit` when calling `get_users`, must be a value greater than or equal to `0`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
if 'search_term' in params:
query_params.append(('search_term', params['search_term'])) # noqa: E501
if 'limit' in params:
query_params.append(('limit', params['limit'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['oauth2'] # noqa: E501
return self.api_client.call_api(
'/users', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='list[object]', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def login(self, user, **kwargs): # noqa: E501
"""Allow a user to login # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.login(user, async=True)
>>> result = thread.get()
:param async bool
:param user: (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.login_with_http_info(user, **kwargs) # noqa: E501
else:
(data) = self.login_with_http_info(user, **kwargs) # noqa: E501
return data
def login_with_http_info(self, user, **kwargs): # noqa: E501
"""Allow a user to login # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.login_with_http_info(user, async=True)
>>> result = thread.get()
:param async bool
:param user: (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['user'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method login" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'user' is set
if ('user' not in params or
params['user'] is None):
raise ValueError("Missing the required parameter `user` when calling `login`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'user' in params:
body_params = params['user']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/users/login', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def reset(self, email, **kwargs): # noqa: E501
"""Reset user password # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.reset(email, async=True)
>>> result = thread.get()
:param async bool
:param str email: (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.reset_with_http_info(email, **kwargs) # noqa: E501
else:
(data) = self.reset_with_http_info(email, **kwargs) # noqa: E501
return data
def reset_with_http_info(self, email, **kwargs): # noqa: E501
"""Reset user password # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.reset_with_http_info(email, async=True)
>>> result = thread.get()
:param async bool
:param str email: (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['email'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method reset" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'email' is set
if ('email' not in params or
params['email'] is None):
raise ValueError("Missing the required parameter `email` when calling `reset`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
if 'email' in params:
query_params.append(('email', params['email'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/users/reset', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def update_user(self, id, **kwargs): # noqa: E501
"""Update user details (change password, add details etc) # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.update_user(id, async=True)
>>> result = thread.get()
:param async bool
:param str id: The unique identifer for an Object (i.e. User, Task, Project, Submission etc) (required)
:param user:
:return: object
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.update_user_with_http_info(id, **kwargs) # noqa: E501
else:
(data) = self.update_user_with_http_info(id, **kwargs) # noqa: E501
return data
def update_user_with_http_info(self, id, **kwargs): # noqa: E501
"""Update user details (change password, add details etc) # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.update_user_with_http_info(id, async=True)
>>> result = thread.get()
:param async bool
:param str id: The unique identifer for an Object (i.e. User, Task, Project, Submission etc) (required)
:param user:
:return: object
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['id', 'user'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method update_user" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'id' is set
if ('id' not in params or
params['id'] is None):
raise ValueError("Missing the required parameter `id` when calling `update_user`") # noqa: E501
if 'id' in params and not re.search('^[a-zA-Z0-9-]+$', params['id']): # noqa: E501
raise ValueError("Invalid value for parameter `id` when calling `update_user`, must conform to the pattern `/^[a-zA-Z0-9-]+$/`") # noqa: E501
collection_formats = {}
path_params = {}
if 'id' in params:
path_params['id'] = params['id'] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'user' in params:
body_params = params['user']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['anonUser', 'apiKeyHeader'] # noqa: E501
return self.api_client.call_api(
'/users/{id}', 'PUT',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='object', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def validate(self, **kwargs): # noqa: E501
"""OAuth2 token info # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.validate(async=True)
>>> result = thread.get()
:param async bool
:param str key:
:return: object
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.validate_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.validate_with_http_info(**kwargs) # noqa: E501
return data
def validate_with_http_info(self, **kwargs): # noqa: E501
"""OAuth2 token info # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.validate_with_http_info(async=True)
>>> result = thread.get()
:param async bool
:param str key:
:return: object
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['key'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method validate" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
if 'key' in params:
query_params.append(('key', params['key'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/users/validate', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='object', # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def verify_reset(self, **kwargs): # noqa: E501
"""Verify password reset token # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.verify_reset(async=True)
>>> result = thread.get()
:param async bool
:param Reset reset:
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.verify_reset_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.verify_reset_with_http_info(**kwargs) # noqa: E501
return data
def verify_reset_with_http_info(self, **kwargs): # noqa: E501
"""Verify password reset token # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.verify_reset_with_http_info(async=True)
>>> result = thread.get()
:param async bool
:param Reset reset:
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['reset'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method verify_reset" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'reset' in params:
body_params = params['reset']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/users/reset', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
| [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
37811,
198,
220,
220,
220,
327,
4093,
50,
628,
220,
220,
220,
1400,
6764,
2810,
357,
27568,
416,
2451,
7928,
6127,
5235,
3740,
1378,
12567,
13,
785,
14,
2032,
7928,
12,
15042,
14,
2032,
7928,
12,
8189,
5235,
8,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
4946,
17614,
1020,
2196,
25,
657,
13,
16,
198,
220,
220,
220,
220,
198,
220,
220,
220,
2980,
515,
416,
25,
3740,
1378,
12567,
13,
785,
14,
2032,
7928,
12,
15042,
14,
2032,
7928,
12,
8189,
5235,
13,
18300,
198,
37811,
628,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
11748,
302,
220,
1303,
645,
20402,
25,
376,
21844,
198,
198,
2,
21015,
362,
290,
21015,
513,
17764,
5888,
198,
11748,
2237,
198,
198,
6738,
1509,
7928,
62,
16366,
13,
15042,
62,
16366,
1330,
5949,
72,
11792,
628,
198,
4871,
18987,
32,
14415,
7,
15252,
2599,
198,
220,
220,
220,
37227,
16580,
25,
770,
1398,
318,
8295,
7560,
416,
262,
1509,
7928,
2438,
17301,
1430,
13,
628,
220,
220,
220,
2141,
407,
4370,
262,
1398,
14500,
13,
198,
220,
220,
220,
6524,
25,
3740,
1378,
12567,
13,
785,
14,
2032,
7928,
12,
15042,
14,
2032,
7928,
12,
8189,
5235,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
2251,
62,
7220,
7,
944,
11,
12429,
46265,
22046,
2599,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
47133,
886,
966,
329,
257,
2836,
1848,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
770,
2446,
1838,
257,
18305,
516,
14626,
2581,
416,
4277,
13,
1675,
787,
281,
198,
220,
220,
220,
220,
220,
220,
220,
39354,
14626,
2581,
11,
3387,
1208,
30351,
28,
17821,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
4704,
796,
40391,
13,
17953,
62,
7220,
7,
292,
13361,
28,
17821,
8,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
1255,
796,
4704,
13,
1136,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
30351,
20512,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
220,
2836,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1002,
262,
2446,
318,
1444,
355,
24871,
3481,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5860,
262,
2581,
4704,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
479,
86,
22046,
17816,
62,
7783,
62,
4023,
62,
7890,
62,
8807,
20520,
796,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
611,
479,
86,
22046,
13,
1136,
10786,
292,
13361,
6,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
17953,
62,
7220,
62,
4480,
62,
4023,
62,
10951,
7,
1174,
46265,
22046,
8,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
7890,
8,
796,
2116,
13,
17953,
62,
7220,
62,
4480,
62,
4023,
62,
10951,
7,
1174,
46265,
22046,
8,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
1366,
628,
220,
220,
220,
825,
2251,
62,
7220,
62,
4480,
62,
4023,
62,
10951,
7,
944,
11,
12429,
46265,
22046,
2599,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
47133,
886,
966,
329,
257,
2836,
1848,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
770,
2446,
1838,
257,
18305,
516,
14626,
2581,
416,
4277,
13,
1675,
787,
281,
198,
220,
220,
220,
220,
220,
220,
220,
39354,
14626,
2581,
11,
3387,
1208,
30351,
28,
17821,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
4704,
796,
40391,
13,
17953,
62,
7220,
62,
4480,
62,
4023,
62,
10951,
7,
292,
13361,
28,
17821,
8,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
1255,
796,
4704,
13,
1136,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
30351,
20512,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
220,
2836,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1002,
262,
2446,
318,
1444,
355,
24871,
3481,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5860,
262,
2581,
4704,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
796,
37250,
7220,
20520,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
292,
13361,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
62,
7783,
62,
4023,
62,
7890,
62,
8807,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
62,
3866,
2220,
62,
11299,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
62,
25927,
62,
48678,
11537,
628,
220,
220,
220,
220,
220,
220,
220,
42287,
796,
17205,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1994,
11,
1188,
287,
2237,
13,
2676,
23814,
7,
37266,
17816,
46265,
22046,
20520,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
1994,
407,
287,
477,
62,
37266,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
5994,
12331,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
30074,
281,
10059,
21179,
4578,
705,
4,
82,
29653,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
284,
2446,
2251,
62,
7220,
1,
4064,
1994,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
42287,
58,
2539,
60,
796,
1188,
198,
220,
220,
220,
220,
220,
220,
220,
1619,
42287,
17816,
46265,
22046,
20520,
628,
220,
220,
220,
220,
220,
220,
220,
4947,
62,
687,
1381,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
3108,
62,
37266,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
12405,
62,
37266,
796,
17635,
628,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
1296,
62,
37266,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
1957,
62,
7785,
62,
16624,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
1767,
62,
37266,
796,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
611,
705,
7220,
6,
287,
42287,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1767,
62,
37266,
796,
42287,
17816,
7220,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
14626,
13639,
4600,
38855,
63,
198,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
17816,
38855,
20520,
796,
2116,
13,
15042,
62,
16366,
13,
19738,
62,
25677,
62,
13635,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37250,
31438,
14,
17752,
6,
12962,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
14626,
13639,
4600,
19746,
12,
6030,
63,
198,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
17816,
19746,
12,
6030,
20520,
796,
2116,
13,
15042,
62,
16366,
13,
19738,
62,
25677,
62,
11299,
62,
4906,
7,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37250,
31438,
14,
17752,
6,
12962,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
48191,
4634,
198,
220,
220,
220,
220,
220,
220,
220,
6284,
62,
33692,
796,
17635,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
15042,
62,
16366,
13,
13345,
62,
15042,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31051,
18417,
14,
30238,
3256,
705,
32782,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3108,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12405,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1767,
28,
2618,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1281,
62,
37266,
28,
687,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3696,
28,
12001,
62,
7785,
62,
16624,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2882,
62,
4906,
28,
14202,
11,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6284,
62,
33692,
28,
18439,
62,
33692,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30351,
28,
37266,
13,
1136,
10786,
292,
13361,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
7783,
62,
4023,
62,
7890,
62,
8807,
28,
37266,
13,
1136,
10786,
62,
7783,
62,
4023,
62,
7890,
62,
8807,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
3866,
2220,
62,
11299,
28,
37266,
13,
1136,
10786,
62,
3866,
2220,
62,
11299,
3256,
6407,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
25927,
62,
48678,
28,
37266,
13,
1136,
10786,
62,
25927,
62,
48678,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4947,
62,
687,
1381,
28,
43681,
62,
687,
1381,
8,
628,
220,
220,
220,
825,
12233,
62,
7220,
7,
944,
11,
4686,
11,
12429,
46265,
22046,
2599,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
38727,
2836,
357,
8807,
3142,
416,
262,
2836,
2405,
8,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
770,
2446,
1838,
257,
18305,
516,
14626,
2581,
416,
4277,
13,
1675,
787,
281,
198,
220,
220,
220,
220,
220,
220,
220,
39354,
14626,
2581,
11,
3387,
1208,
30351,
28,
17821,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
4704,
796,
40391,
13,
33678,
62,
7220,
7,
312,
11,
30351,
28,
17821,
8,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
1255,
796,
4704,
13,
1136,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
30351,
20512,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
965,
4686,
25,
383,
3748,
1852,
7087,
329,
281,
9515,
357,
72,
13,
68,
13,
11787,
11,
15941,
11,
4935,
11,
42641,
3503,
8,
357,
35827,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1002,
262,
2446,
318,
1444,
355,
24871,
3481,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5860,
262,
2581,
4704,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
479,
86,
22046,
17816,
62,
7783,
62,
4023,
62,
7890,
62,
8807,
20520,
796,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
611,
479,
86,
22046,
13,
1136,
10786,
292,
13361,
6,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
33678,
62,
7220,
62,
4480,
62,
4023,
62,
10951,
7,
312,
11,
12429,
46265,
22046,
8,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
7890,
8,
796,
2116,
13,
33678,
62,
7220,
62,
4480,
62,
4023,
62,
10951,
7,
312,
11,
12429,
46265,
22046,
8,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
1366,
628,
220,
220,
220,
825,
12233,
62,
7220,
62,
4480,
62,
4023,
62,
10951,
7,
944,
11,
4686,
11,
12429,
46265,
22046,
2599,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
38727,
2836,
357,
8807,
3142,
416,
262,
2836,
2405,
8,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
770,
2446,
1838,
257,
18305,
516,
14626,
2581,
416,
4277,
13,
1675,
787,
281,
198,
220,
220,
220,
220,
220,
220,
220,
39354,
14626,
2581,
11,
3387,
1208,
30351,
28,
17821,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
4704,
796,
40391,
13,
33678,
62,
7220,
62,
4480,
62,
4023,
62,
10951,
7,
312,
11,
30351,
28,
17821,
8,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
1255,
796,
4704,
13,
1136,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
30351,
20512,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
965,
4686,
25,
383,
3748,
1852,
7087,
329,
281,
9515,
357,
72,
13,
68,
13,
11787,
11,
15941,
11,
4935,
11,
42641,
3503,
8,
357,
35827,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1002,
262,
2446,
318,
1444,
355,
24871,
3481,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5860,
262,
2581,
4704,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
796,
37250,
312,
20520,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
292,
13361,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
62,
7783,
62,
4023,
62,
7890,
62,
8807,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
62,
3866,
2220,
62,
11299,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
62,
25927,
62,
48678,
11537,
628,
220,
220,
220,
220,
220,
220,
220,
42287,
796,
17205,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1994,
11,
1188,
287,
2237,
13,
2676,
23814,
7,
37266,
17816,
46265,
22046,
20520,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
1994,
407,
287,
477,
62,
37266,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
5994,
12331,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
30074,
281,
10059,
21179,
4578,
705,
4,
82,
29653,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
284,
2446,
12233,
62,
7220,
1,
4064,
1994,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
42287,
58,
2539,
60,
796,
1188,
198,
220,
220,
220,
220,
220,
220,
220,
1619,
42287,
17816,
46265,
22046,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
11767,
262,
2672,
11507,
705,
312,
6,
318,
900,
198,
220,
220,
220,
220,
220,
220,
220,
611,
19203,
312,
6,
407,
287,
42287,
393,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
42287,
17816,
312,
20520,
318,
6045,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
11052,
12331,
7203,
43730,
262,
2672,
11507,
4600,
312,
63,
618,
4585,
4600,
33678,
62,
7220,
63,
4943,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
611,
705,
312,
6,
287,
42287,
290,
407,
302,
13,
12947,
10786,
61,
58,
64,
12,
89,
32,
12,
57,
15,
12,
24,
12,
48688,
3,
3256,
42287,
17816,
312,
20520,
2599,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
11052,
12331,
7203,
44651,
1988,
329,
11507,
4600,
312,
63,
618,
4585,
4600,
33678,
62,
7220,
47671,
1276,
17216,
284,
262,
3912,
4600,
14,
61,
58,
64,
12,
89,
32,
12,
57,
15,
12,
24,
12,
48688,
3,
14,
63,
4943,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
4947,
62,
687,
1381,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
3108,
62,
37266,
796,
23884,
198,
220,
220,
220,
220,
220,
220,
220,
611,
705,
312,
6,
287,
42287,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3108,
62,
37266,
17816,
312,
20520,
796,
42287,
17816,
312,
20520,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
12405,
62,
37266,
796,
17635,
628,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
1296,
62,
37266,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
1957,
62,
7785,
62,
16624,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
1767,
62,
37266,
796,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
14626,
13639,
4600,
38855,
63,
198,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
17816,
38855,
20520,
796,
2116,
13,
15042,
62,
16366,
13,
19738,
62,
25677,
62,
13635,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37250,
31438,
14,
17752,
6,
12962,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
14626,
13639,
4600,
19746,
12,
6030,
63,
198,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
17816,
19746,
12,
6030,
20520,
796,
2116,
13,
15042,
62,
16366,
13,
19738,
62,
25677,
62,
11299,
62,
4906,
7,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37250,
31438,
14,
17752,
6,
12962,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
48191,
4634,
198,
220,
220,
220,
220,
220,
220,
220,
6284,
62,
33692,
796,
37250,
36902,
12982,
3256,
705,
15042,
9218,
39681,
20520,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
15042,
62,
16366,
13,
13345,
62,
15042,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31051,
18417,
14,
90,
312,
92,
3256,
705,
7206,
2538,
9328,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3108,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12405,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1767,
28,
2618,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1281,
62,
37266,
28,
687,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3696,
28,
12001,
62,
7785,
62,
16624,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2882,
62,
4906,
28,
14202,
11,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6284,
62,
33692,
28,
18439,
62,
33692,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30351,
28,
37266,
13,
1136,
10786,
292,
13361,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
7783,
62,
4023,
62,
7890,
62,
8807,
28,
37266,
13,
1136,
10786,
62,
7783,
62,
4023,
62,
7890,
62,
8807,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
3866,
2220,
62,
11299,
28,
37266,
13,
1136,
10786,
62,
3866,
2220,
62,
11299,
3256,
6407,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
25927,
62,
48678,
28,
37266,
13,
1136,
10786,
62,
25927,
62,
48678,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4947,
62,
687,
1381,
28,
43681,
62,
687,
1381,
8,
628,
220,
220,
220,
825,
7716,
7,
944,
11,
12429,
46265,
22046,
2599,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
6307,
6284,
329,
11241,
2882,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
770,
2446,
1838,
257,
18305,
516,
14626,
2581,
416,
4277,
13,
1675,
787,
281,
198,
220,
220,
220,
220,
220,
220,
220,
39354,
14626,
2581,
11,
3387,
1208,
30351,
28,
17821,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
4704,
796,
40391,
13,
8612,
378,
7,
292,
13361,
28,
17821,
8,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
1255,
796,
4704,
13,
1136,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
30351,
20512,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
220,
11241,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1002,
262,
2446,
318,
1444,
355,
24871,
3481,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5860,
262,
2581,
4704,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
479,
86,
22046,
17816,
62,
7783,
62,
4023,
62,
7890,
62,
8807,
20520,
796,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
611,
479,
86,
22046,
13,
1136,
10786,
292,
13361,
6,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
8612,
378,
62,
4480,
62,
4023,
62,
10951,
7,
1174,
46265,
22046,
8,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
7890,
8,
796,
2116,
13,
8612,
378,
62,
4480,
62,
4023,
62,
10951,
7,
1174,
46265,
22046,
8,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
1366,
628,
220,
220,
220,
825,
7716,
62,
4480,
62,
4023,
62,
10951,
7,
944,
11,
12429,
46265,
22046,
2599,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
6307,
6284,
329,
11241,
2882,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
770,
2446,
1838,
257,
18305,
516,
14626,
2581,
416,
4277,
13,
1675,
787,
281,
198,
220,
220,
220,
220,
220,
220,
220,
39354,
14626,
2581,
11,
3387,
1208,
30351,
28,
17821,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
4704,
796,
40391,
13,
8612,
378,
62,
4480,
62,
4023,
62,
10951,
7,
292,
13361,
28,
17821,
8,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
1255,
796,
4704,
13,
1136,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
30351,
20512,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
220,
11241,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1002,
262,
2446,
318,
1444,
355,
24871,
3481,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5860,
262,
2581,
4704,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
796,
37250,
30001,
20520,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
292,
13361,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
62,
7783,
62,
4023,
62,
7890,
62,
8807,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
62,
3866,
2220,
62,
11299,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
62,
25927,
62,
48678,
11537,
628,
220,
220,
220,
220,
220,
220,
220,
42287,
796,
17205,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1994,
11,
1188,
287,
2237,
13,
2676,
23814,
7,
37266,
17816,
46265,
22046,
20520,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
1994,
407,
287,
477,
62,
37266,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
5994,
12331,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
30074,
281,
10059,
21179,
4578,
705,
4,
82,
29653,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
284,
2446,
7716,
1,
4064,
1994,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
42287,
58,
2539,
60,
796,
1188,
198,
220,
220,
220,
220,
220,
220,
220,
1619,
42287,
17816,
46265,
22046,
20520,
628,
220,
220,
220,
220,
220,
220,
220,
4947,
62,
687,
1381,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
3108,
62,
37266,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
12405,
62,
37266,
796,
17635,
628,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
1296,
62,
37266,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
1957,
62,
7785,
62,
16624,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
1767,
62,
37266,
796,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
611,
705,
30001,
6,
287,
42287,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1767,
62,
37266,
796,
42287,
17816,
30001,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
14626,
13639,
4600,
38855,
63,
198,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
17816,
38855,
20520,
796,
2116,
13,
15042,
62,
16366,
13,
19738,
62,
25677,
62,
13635,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37250,
31438,
14,
17752,
6,
12962,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
14626,
13639,
4600,
19746,
12,
6030,
63,
198,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
17816,
19746,
12,
6030,
20520,
796,
2116,
13,
15042,
62,
16366,
13,
19738,
62,
25677,
62,
11299,
62,
4906,
7,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37250,
31438,
14,
17752,
6,
12962,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
48191,
4634,
198,
220,
220,
220,
220,
220,
220,
220,
6284,
62,
33692,
796,
17635,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
15042,
62,
16366,
13,
13345,
62,
15042,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31051,
18417,
14,
9800,
1096,
3256,
705,
32782,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3108,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12405,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1767,
28,
2618,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1281,
62,
37266,
28,
687,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3696,
28,
12001,
62,
7785,
62,
16624,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2882,
62,
4906,
28,
14202,
11,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6284,
62,
33692,
28,
18439,
62,
33692,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30351,
28,
37266,
13,
1136,
10786,
292,
13361,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
7783,
62,
4023,
62,
7890,
62,
8807,
28,
37266,
13,
1136,
10786,
62,
7783,
62,
4023,
62,
7890,
62,
8807,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
3866,
2220,
62,
11299,
28,
37266,
13,
1136,
10786,
62,
3866,
2220,
62,
11299,
3256,
6407,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
25927,
62,
48678,
28,
37266,
13,
1136,
10786,
62,
25927,
62,
48678,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4947,
62,
687,
1381,
28,
43681,
62,
687,
1381,
8,
628,
220,
220,
220,
825,
651,
62,
7266,
82,
7,
944,
11,
4686,
11,
12429,
46265,
22046,
2599,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
3855,
477,
22129,
329,
257,
2836,
357,
273,
883,
12336,
281,
4522,
8,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
770,
2446,
1838,
257,
18305,
516,
14626,
2581,
416,
4277,
13,
1675,
787,
281,
198,
220,
220,
220,
220,
220,
220,
220,
39354,
14626,
2581,
11,
3387,
1208,
30351,
28,
17821,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
4704,
796,
40391,
13,
1136,
62,
7266,
82,
7,
312,
11,
30351,
28,
17821,
8,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
1255,
796,
4704,
13,
1136,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
30351,
20512,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
965,
4686,
25,
383,
3748,
1852,
7087,
329,
281,
9515,
357,
72,
13,
68,
13,
11787,
11,
15941,
11,
4935,
11,
42641,
3503,
8,
357,
35827,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
1351,
58,
818,
1370,
31077,
15724,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1002,
262,
2446,
318,
1444,
355,
24871,
3481,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5860,
262,
2581,
4704,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
479,
86,
22046,
17816,
62,
7783,
62,
4023,
62,
7890,
62,
8807,
20520,
796,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
611,
479,
86,
22046,
13,
1136,
10786,
292,
13361,
6,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
1136,
62,
7266,
82,
62,
4480,
62,
4023,
62,
10951,
7,
312,
11,
12429,
46265,
22046,
8,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
7890,
8,
796,
2116,
13,
1136,
62,
7266,
82,
62,
4480,
62,
4023,
62,
10951,
7,
312,
11,
12429,
46265,
22046,
8,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
1366,
628,
220,
220,
220,
825,
651,
62,
7266,
82,
62,
4480,
62,
4023,
62,
10951,
7,
944,
11,
4686,
11,
12429,
46265,
22046,
2599,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
3855,
477,
22129,
329,
257,
2836,
357,
273,
883,
12336,
281,
4522,
8,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
770,
2446,
1838,
257,
18305,
516,
14626,
2581,
416,
4277,
13,
1675,
787,
281,
198,
220,
220,
220,
220,
220,
220,
220,
39354,
14626,
2581,
11,
3387,
1208,
30351,
28,
17821,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
4704,
796,
40391,
13,
1136,
62,
7266,
82,
62,
4480,
62,
4023,
62,
10951,
7,
312,
11,
30351,
28,
17821,
8,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
1255,
796,
4704,
13,
1136,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
30351,
20512,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
965,
4686,
25,
383,
3748,
1852,
7087,
329,
281,
9515,
357,
72,
13,
68,
13,
11787,
11,
15941,
11,
4935,
11,
42641,
3503,
8,
357,
35827,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
1351,
58,
818,
1370,
31077,
15724,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1002,
262,
2446,
318,
1444,
355,
24871,
3481,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5860,
262,
2581,
4704,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
796,
37250,
312,
20520,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
292,
13361,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
62,
7783,
62,
4023,
62,
7890,
62,
8807,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
62,
3866,
2220,
62,
11299,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
62,
25927,
62,
48678,
11537,
628,
220,
220,
220,
220,
220,
220,
220,
42287,
796,
17205,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1994,
11,
1188,
287,
2237,
13,
2676,
23814,
7,
37266,
17816,
46265,
22046,
20520,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
1994,
407,
287,
477,
62,
37266,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
5994,
12331,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
30074,
281,
10059,
21179,
4578,
705,
4,
82,
29653,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
284,
2446,
651,
62,
7266,
82,
1,
4064,
1994,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
42287,
58,
2539,
60,
796,
1188,
198,
220,
220,
220,
220,
220,
220,
220,
1619,
42287,
17816,
46265,
22046,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
11767,
262,
2672,
11507,
705,
312,
6,
318,
900,
198,
220,
220,
220,
220,
220,
220,
220,
611,
19203,
312,
6,
407,
287,
42287,
393,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
42287,
17816,
312,
20520,
318,
6045,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
11052,
12331,
7203,
43730,
262,
2672,
11507,
4600,
312,
63,
618,
4585,
4600,
1136,
62,
7266,
82,
63,
4943,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
611,
705,
312,
6,
287,
42287,
290,
407,
302,
13,
12947,
10786,
61,
58,
64,
12,
89,
32,
12,
57,
15,
12,
24,
12,
48688,
3,
3256,
42287,
17816,
312,
20520,
2599,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
11052,
12331,
7203,
44651,
1988,
329,
11507,
4600,
312,
63,
618,
4585,
4600,
1136,
62,
7266,
82,
47671,
1276,
17216,
284,
262,
3912,
4600,
14,
61,
58,
64,
12,
89,
32,
12,
57,
15,
12,
24,
12,
48688,
3,
14,
63,
4943,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
4947,
62,
687,
1381,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
3108,
62,
37266,
796,
23884,
198,
220,
220,
220,
220,
220,
220,
220,
611,
705,
312,
6,
287,
42287,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3108,
62,
37266,
17816,
312,
20520,
796,
42287,
17816,
312,
20520,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
12405,
62,
37266,
796,
17635,
628,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
1296,
62,
37266,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
1957,
62,
7785,
62,
16624,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
1767,
62,
37266,
796,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
14626,
13639,
4600,
38855,
63,
198,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
17816,
38855,
20520,
796,
2116,
13,
15042,
62,
16366,
13,
19738,
62,
25677,
62,
13635,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37250,
31438,
14,
17752,
6,
12962,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
14626,
13639,
4600,
19746,
12,
6030,
63,
198,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
17816,
19746,
12,
6030,
20520,
796,
2116,
13,
15042,
62,
16366,
13,
19738,
62,
25677,
62,
11299,
62,
4906,
7,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37250,
31438,
14,
17752,
6,
12962,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
48191,
4634,
198,
220,
220,
220,
220,
220,
220,
220,
6284,
62,
33692,
796,
37250,
36902,
12982,
3256,
705,
15042,
9218,
39681,
20520,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
15042,
62,
16366,
13,
13345,
62,
15042,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31051,
18417,
14,
90,
312,
92,
14,
7266,
8481,
3256,
705,
18851,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3108,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12405,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1767,
28,
2618,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1281,
62,
37266,
28,
687,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3696,
28,
12001,
62,
7785,
62,
16624,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2882,
62,
4906,
11639,
4868,
58,
818,
1370,
31077,
15724,
60,
3256,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6284,
62,
33692,
28,
18439,
62,
33692,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30351,
28,
37266,
13,
1136,
10786,
292,
13361,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
7783,
62,
4023,
62,
7890,
62,
8807,
28,
37266,
13,
1136,
10786,
62,
7783,
62,
4023,
62,
7890,
62,
8807,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
3866,
2220,
62,
11299,
28,
37266,
13,
1136,
10786,
62,
3866,
2220,
62,
11299,
3256,
6407,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
25927,
62,
48678,
28,
37266,
13,
1136,
10786,
62,
25927,
62,
48678,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4947,
62,
687,
1381,
28,
43681,
62,
687,
1381,
8,
628,
220,
220,
220,
825,
651,
62,
7220,
7,
944,
11,
4686,
11,
12429,
46265,
22046,
2599,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
3855,
477,
2985,
357,
273,
883,
12336,
281,
4522,
8,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
770,
2446,
1838,
257,
18305,
516,
14626,
2581,
416,
4277,
13,
1675,
787,
281,
198,
220,
220,
220,
220,
220,
220,
220,
39354,
14626,
2581,
11,
3387,
1208,
30351,
28,
17821,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
4704,
796,
40391,
13,
1136,
62,
7220,
7,
312,
11,
30351,
28,
17821,
8,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
1255,
796,
4704,
13,
1136,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
30351,
20512,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
965,
4686,
25,
383,
3748,
1852,
7087,
329,
281,
9515,
357,
72,
13,
68,
13,
11787,
11,
15941,
11,
4935,
11,
42641,
3503,
8,
357,
35827,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
2134,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1002,
262,
2446,
318,
1444,
355,
24871,
3481,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5860,
262,
2581,
4704,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
479,
86,
22046,
17816,
62,
7783,
62,
4023,
62,
7890,
62,
8807,
20520,
796,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
611,
479,
86,
22046,
13,
1136,
10786,
292,
13361,
6,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
1136,
62,
7220,
62,
4480,
62,
4023,
62,
10951,
7,
312,
11,
12429,
46265,
22046,
8,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
7890,
8,
796,
2116,
13,
1136,
62,
7220,
62,
4480,
62,
4023,
62,
10951,
7,
312,
11,
12429,
46265,
22046,
8,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
1366,
628,
220,
220,
220,
825,
651,
62,
7220,
62,
4480,
62,
4023,
62,
10951,
7,
944,
11,
4686,
11,
12429,
46265,
22046,
2599,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
3855,
477,
2985,
357,
273,
883,
12336,
281,
4522,
8,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
770,
2446,
1838,
257,
18305,
516,
14626,
2581,
416,
4277,
13,
1675,
787,
281,
198,
220,
220,
220,
220,
220,
220,
220,
39354,
14626,
2581,
11,
3387,
1208,
30351,
28,
17821,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
4704,
796,
40391,
13,
1136,
62,
7220,
62,
4480,
62,
4023,
62,
10951,
7,
312,
11,
30351,
28,
17821,
8,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
1255,
796,
4704,
13,
1136,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
30351,
20512,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
965,
4686,
25,
383,
3748,
1852,
7087,
329,
281,
9515,
357,
72,
13,
68,
13,
11787,
11,
15941,
11,
4935,
11,
42641,
3503,
8,
357,
35827,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
2134,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1002,
262,
2446,
318,
1444,
355,
24871,
3481,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5860,
262,
2581,
4704,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
796,
37250,
312,
20520,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
292,
13361,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
62,
7783,
62,
4023,
62,
7890,
62,
8807,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
62,
3866,
2220,
62,
11299,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
62,
25927,
62,
48678,
11537,
628,
220,
220,
220,
220,
220,
220,
220,
42287,
796,
17205,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1994,
11,
1188,
287,
2237,
13,
2676,
23814,
7,
37266,
17816,
46265,
22046,
20520,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
1994,
407,
287,
477,
62,
37266,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
5994,
12331,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
30074,
281,
10059,
21179,
4578,
705,
4,
82,
29653,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
284,
2446,
651,
62,
7220,
1,
4064,
1994,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
42287,
58,
2539,
60,
796,
1188,
198,
220,
220,
220,
220,
220,
220,
220,
1619,
42287,
17816,
46265,
22046,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
11767,
262,
2672,
11507,
705,
312,
6,
318,
900,
198,
220,
220,
220,
220,
220,
220,
220,
611,
19203,
312,
6,
407,
287,
42287,
393,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
42287,
17816,
312,
20520,
318,
6045,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
11052,
12331,
7203,
43730,
262,
2672,
11507,
4600,
312,
63,
618,
4585,
4600,
1136,
62,
7220,
63,
4943,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
611,
705,
312,
6,
287,
42287,
290,
407,
302,
13,
12947,
10786,
61,
58,
64,
12,
89,
32,
12,
57,
15,
12,
24,
12,
48688,
3,
3256,
42287,
17816,
312,
20520,
2599,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
11052,
12331,
7203,
44651,
1988,
329,
11507,
4600,
312,
63,
618,
4585,
4600,
1136,
62,
7220,
47671,
1276,
17216,
284,
262,
3912,
4600,
14,
61,
58,
64,
12,
89,
32,
12,
57,
15,
12,
24,
12,
48688,
3,
14,
63,
4943,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
4947,
62,
687,
1381,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
3108,
62,
37266,
796,
23884,
198,
220,
220,
220,
220,
220,
220,
220,
611,
705,
312,
6,
287,
42287,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3108,
62,
37266,
17816,
312,
20520,
796,
42287,
17816,
312,
20520,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
12405,
62,
37266,
796,
17635,
628,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
1296,
62,
37266,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
1957,
62,
7785,
62,
16624,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
1767,
62,
37266,
796,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
14626,
13639,
4600,
38855,
63,
198,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
17816,
38855,
20520,
796,
2116,
13,
15042,
62,
16366,
13,
19738,
62,
25677,
62,
13635,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37250,
31438,
14,
17752,
6,
12962,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
14626,
13639,
4600,
19746,
12,
6030,
63,
198,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
17816,
19746,
12,
6030,
20520,
796,
2116,
13,
15042,
62,
16366,
13,
19738,
62,
25677,
62,
11299,
62,
4906,
7,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37250,
31438,
14,
17752,
6,
12962,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
48191,
4634,
198,
220,
220,
220,
220,
220,
220,
220,
6284,
62,
33692,
796,
37250,
36902,
12982,
3256,
705,
15042,
9218,
39681,
20520,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
15042,
62,
16366,
13,
13345,
62,
15042,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31051,
18417,
14,
90,
312,
92,
3256,
705,
18851,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3108,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12405,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1767,
28,
2618,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1281,
62,
37266,
28,
687,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3696,
28,
12001,
62,
7785,
62,
16624,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2882,
62,
4906,
11639,
15252,
3256,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6284,
62,
33692,
28,
18439,
62,
33692,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30351,
28,
37266,
13,
1136,
10786,
292,
13361,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
7783,
62,
4023,
62,
7890,
62,
8807,
28,
37266,
13,
1136,
10786,
62,
7783,
62,
4023,
62,
7890,
62,
8807,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
3866,
2220,
62,
11299,
28,
37266,
13,
1136,
10786,
62,
3866,
2220,
62,
11299,
3256,
6407,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
25927,
62,
48678,
28,
37266,
13,
1136,
10786,
62,
25927,
62,
48678,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4947,
62,
687,
1381,
28,
43681,
62,
687,
1381,
8,
628,
220,
220,
220,
825,
651,
62,
18417,
7,
944,
11,
12429,
46265,
22046,
2599,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
1136,
62,
18417,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
770,
2446,
1838,
257,
18305,
516,
14626,
2581,
416,
4277,
13,
1675,
787,
281,
198,
220,
220,
220,
220,
220,
220,
220,
39354,
14626,
2581,
11,
3387,
1208,
30351,
28,
17821,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
4704,
796,
40391,
13,
1136,
62,
18417,
7,
292,
13361,
28,
17821,
8,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
1255,
796,
4704,
13,
1136,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
30351,
20512,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
965,
2989,
62,
4354,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
493,
4179,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
1351,
58,
15252,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1002,
262,
2446,
318,
1444,
355,
24871,
3481,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5860,
262,
2581,
4704,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
479,
86,
22046,
17816,
62,
7783,
62,
4023,
62,
7890,
62,
8807,
20520,
796,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
611,
479,
86,
22046,
13,
1136,
10786,
292,
13361,
6,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
1136,
62,
18417,
62,
4480,
62,
4023,
62,
10951,
7,
1174,
46265,
22046,
8,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
7890,
8,
796,
2116,
13,
1136,
62,
18417,
62,
4480,
62,
4023,
62,
10951,
7,
1174,
46265,
22046,
8,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
1366,
628,
220,
220,
220,
825,
651,
62,
18417,
62,
4480,
62,
4023,
62,
10951,
7,
944,
11,
12429,
46265,
22046,
2599,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
1136,
62,
18417,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
770,
2446,
1838,
257,
18305,
516,
14626,
2581,
416,
4277,
13,
1675,
787,
281,
198,
220,
220,
220,
220,
220,
220,
220,
39354,
14626,
2581,
11,
3387,
1208,
30351,
28,
17821,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
4704,
796,
40391,
13,
1136,
62,
18417,
62,
4480,
62,
4023,
62,
10951,
7,
292,
13361,
28,
17821,
8,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
1255,
796,
4704,
13,
1136,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
30351,
20512,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
965,
2989,
62,
4354,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
493,
4179,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
1351,
58,
15252,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1002,
262,
2446,
318,
1444,
355,
24871,
3481,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5860,
262,
2581,
4704,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
796,
37250,
12947,
62,
4354,
3256,
705,
32374,
20520,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
292,
13361,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
62,
7783,
62,
4023,
62,
7890,
62,
8807,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
62,
3866,
2220,
62,
11299,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
62,
25927,
62,
48678,
11537,
628,
220,
220,
220,
220,
220,
220,
220,
42287,
796,
17205,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1994,
11,
1188,
287,
2237,
13,
2676,
23814,
7,
37266,
17816,
46265,
22046,
20520,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
1994,
407,
287,
477,
62,
37266,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
5994,
12331,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
30074,
281,
10059,
21179,
4578,
705,
4,
82,
29653,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
284,
2446,
651,
62,
18417,
1,
4064,
1994,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
42287,
58,
2539,
60,
796,
1188,
198,
220,
220,
220,
220,
220,
220,
220,
1619,
42287,
17816,
46265,
22046,
20520,
628,
220,
220,
220,
220,
220,
220,
220,
611,
705,
32374,
6,
287,
42287,
290,
42287,
17816,
32374,
20520,
1279,
657,
25,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
11052,
12331,
7203,
44651,
1988,
329,
11507,
4600,
32374,
63,
618,
4585,
4600,
1136,
62,
18417,
47671,
1276,
307,
257,
1988,
3744,
621,
393,
4961,
284,
4600,
15,
63,
4943,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
4947,
62,
687,
1381,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
3108,
62,
37266,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
12405,
62,
37266,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
611,
705,
12947,
62,
4354,
6,
287,
42287,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12405,
62,
37266,
13,
33295,
7,
10786,
12947,
62,
4354,
3256,
42287,
17816,
12947,
62,
4354,
20520,
4008,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
611,
705,
32374,
6,
287,
42287,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12405,
62,
37266,
13,
33295,
7,
10786,
32374,
3256,
42287,
17816,
32374,
20520,
4008,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
1296,
62,
37266,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
1957,
62,
7785,
62,
16624,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
1767,
62,
37266,
796,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
14626,
13639,
4600,
38855,
63,
198,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
17816,
38855,
20520,
796,
2116,
13,
15042,
62,
16366,
13,
19738,
62,
25677,
62,
13635,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37250,
31438,
14,
17752,
6,
12962,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
14626,
13639,
4600,
19746,
12,
6030,
63,
198,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
17816,
19746,
12,
6030,
20520,
796,
2116,
13,
15042,
62,
16366,
13,
19738,
62,
25677,
62,
11299,
62,
4906,
7,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37250,
31438,
14,
17752,
6,
12962,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
48191,
4634,
198,
220,
220,
220,
220,
220,
220,
220,
6284,
62,
33692,
796,
37250,
12162,
1071,
17,
20520,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
15042,
62,
16366,
13,
13345,
62,
15042,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31051,
18417,
3256,
705,
18851,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3108,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12405,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1767,
28,
2618,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1281,
62,
37266,
28,
687,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3696,
28,
12001,
62,
7785,
62,
16624,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2882,
62,
4906,
11639,
4868,
58,
15252,
60,
3256,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6284,
62,
33692,
28,
18439,
62,
33692,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30351,
28,
37266,
13,
1136,
10786,
292,
13361,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
7783,
62,
4023,
62,
7890,
62,
8807,
28,
37266,
13,
1136,
10786,
62,
7783,
62,
4023,
62,
7890,
62,
8807,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
3866,
2220,
62,
11299,
28,
37266,
13,
1136,
10786,
62,
3866,
2220,
62,
11299,
3256,
6407,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
25927,
62,
48678,
28,
37266,
13,
1136,
10786,
62,
25927,
62,
48678,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4947,
62,
687,
1381,
28,
43681,
62,
687,
1381,
8,
628,
220,
220,
220,
825,
17594,
7,
944,
11,
2836,
11,
12429,
46265,
22046,
2599,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
35265,
257,
2836,
284,
17594,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
770,
2446,
1838,
257,
18305,
516,
14626,
2581,
416,
4277,
13,
1675,
787,
281,
198,
220,
220,
220,
220,
220,
220,
220,
39354,
14626,
2581,
11,
3387,
1208,
30351,
28,
17821,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
4704,
796,
40391,
13,
38235,
7,
7220,
11,
30351,
28,
17821,
8,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
1255,
796,
4704,
13,
1136,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
30351,
20512,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
220,
2836,
25,
357,
35827,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1002,
262,
2446,
318,
1444,
355,
24871,
3481,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5860,
262,
2581,
4704,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
479,
86,
22046,
17816,
62,
7783,
62,
4023,
62,
7890,
62,
8807,
20520,
796,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
611,
479,
86,
22046,
13,
1136,
10786,
292,
13361,
6,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
38235,
62,
4480,
62,
4023,
62,
10951,
7,
7220,
11,
12429,
46265,
22046,
8,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
7890,
8,
796,
2116,
13,
38235,
62,
4480,
62,
4023,
62,
10951,
7,
7220,
11,
12429,
46265,
22046,
8,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
1366,
628,
220,
220,
220,
825,
17594,
62,
4480,
62,
4023,
62,
10951,
7,
944,
11,
2836,
11,
12429,
46265,
22046,
2599,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
35265,
257,
2836,
284,
17594,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
770,
2446,
1838,
257,
18305,
516,
14626,
2581,
416,
4277,
13,
1675,
787,
281,
198,
220,
220,
220,
220,
220,
220,
220,
39354,
14626,
2581,
11,
3387,
1208,
30351,
28,
17821,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
4704,
796,
40391,
13,
38235,
62,
4480,
62,
4023,
62,
10951,
7,
7220,
11,
30351,
28,
17821,
8,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
1255,
796,
4704,
13,
1136,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
30351,
20512,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
220,
2836,
25,
357,
35827,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1002,
262,
2446,
318,
1444,
355,
24871,
3481,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5860,
262,
2581,
4704,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
796,
37250,
7220,
20520,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
292,
13361,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
62,
7783,
62,
4023,
62,
7890,
62,
8807,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
62,
3866,
2220,
62,
11299,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
62,
25927,
62,
48678,
11537,
628,
220,
220,
220,
220,
220,
220,
220,
42287,
796,
17205,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1994,
11,
1188,
287,
2237,
13,
2676,
23814,
7,
37266,
17816,
46265,
22046,
20520,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
1994,
407,
287,
477,
62,
37266,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
5994,
12331,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
30074,
281,
10059,
21179,
4578,
705,
4,
82,
29653,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
284,
2446,
17594,
1,
4064,
1994,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
42287,
58,
2539,
60,
796,
1188,
198,
220,
220,
220,
220,
220,
220,
220,
1619,
42287,
17816,
46265,
22046,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
11767,
262,
2672,
11507,
705,
7220,
6,
318,
900,
198,
220,
220,
220,
220,
220,
220,
220,
611,
19203,
7220,
6,
407,
287,
42287,
393,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
42287,
17816,
7220,
20520,
318,
6045,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
11052,
12331,
7203,
43730,
262,
2672,
11507,
4600,
7220,
63,
618,
4585,
4600,
38235,
63,
4943,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
4947,
62,
687,
1381,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
3108,
62,
37266,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
12405,
62,
37266,
796,
17635,
628,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
1296,
62,
37266,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
1957,
62,
7785,
62,
16624,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
1767,
62,
37266,
796,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
611,
705,
7220,
6,
287,
42287,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1767,
62,
37266,
796,
42287,
17816,
7220,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
14626,
13639,
4600,
38855,
63,
198,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
17816,
38855,
20520,
796,
2116,
13,
15042,
62,
16366,
13,
19738,
62,
25677,
62,
13635,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37250,
31438,
14,
17752,
6,
12962,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
14626,
13639,
4600,
19746,
12,
6030,
63,
198,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
17816,
19746,
12,
6030,
20520,
796,
2116,
13,
15042,
62,
16366,
13,
19738,
62,
25677,
62,
11299,
62,
4906,
7,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37250,
31438,
14,
17752,
6,
12962,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
48191,
4634,
198,
220,
220,
220,
220,
220,
220,
220,
6284,
62,
33692,
796,
17635,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
15042,
62,
16366,
13,
13345,
62,
15042,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31051,
18417,
14,
38235,
3256,
705,
32782,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3108,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12405,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1767,
28,
2618,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1281,
62,
37266,
28,
687,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3696,
28,
12001,
62,
7785,
62,
16624,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2882,
62,
4906,
28,
14202,
11,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6284,
62,
33692,
28,
18439,
62,
33692,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30351,
28,
37266,
13,
1136,
10786,
292,
13361,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
7783,
62,
4023,
62,
7890,
62,
8807,
28,
37266,
13,
1136,
10786,
62,
7783,
62,
4023,
62,
7890,
62,
8807,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
3866,
2220,
62,
11299,
28,
37266,
13,
1136,
10786,
62,
3866,
2220,
62,
11299,
3256,
6407,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
25927,
62,
48678,
28,
37266,
13,
1136,
10786,
62,
25927,
62,
48678,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4947,
62,
687,
1381,
28,
43681,
62,
687,
1381,
8,
628,
220,
220,
220,
825,
13259,
7,
944,
11,
3053,
11,
12429,
46265,
22046,
2599,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
4965,
316,
2836,
9206,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
770,
2446,
1838,
257,
18305,
516,
14626,
2581,
416,
4277,
13,
1675,
787,
281,
198,
220,
220,
220,
220,
220,
220,
220,
39354,
14626,
2581,
11,
3387,
1208,
30351,
28,
17821,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
4704,
796,
40391,
13,
42503,
7,
12888,
11,
30351,
28,
17821,
8,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
1255,
796,
4704,
13,
1136,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
30351,
20512,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
965,
3053,
25,
357,
35827,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1002,
262,
2446,
318,
1444,
355,
24871,
3481,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5860,
262,
2581,
4704,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
479,
86,
22046,
17816,
62,
7783,
62,
4023,
62,
7890,
62,
8807,
20520,
796,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
611,
479,
86,
22046,
13,
1136,
10786,
292,
13361,
6,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
42503,
62,
4480,
62,
4023,
62,
10951,
7,
12888,
11,
12429,
46265,
22046,
8,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
7890,
8,
796,
2116,
13,
42503,
62,
4480,
62,
4023,
62,
10951,
7,
12888,
11,
12429,
46265,
22046,
8,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
1366,
628,
220,
220,
220,
825,
13259,
62,
4480,
62,
4023,
62,
10951,
7,
944,
11,
3053,
11,
12429,
46265,
22046,
2599,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
4965,
316,
2836,
9206,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
770,
2446,
1838,
257,
18305,
516,
14626,
2581,
416,
4277,
13,
1675,
787,
281,
198,
220,
220,
220,
220,
220,
220,
220,
39354,
14626,
2581,
11,
3387,
1208,
30351,
28,
17821,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
4704,
796,
40391,
13,
42503,
62,
4480,
62,
4023,
62,
10951,
7,
12888,
11,
30351,
28,
17821,
8,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
1255,
796,
4704,
13,
1136,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
30351,
20512,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
965,
3053,
25,
357,
35827,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1002,
262,
2446,
318,
1444,
355,
24871,
3481,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5860,
262,
2581,
4704,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
796,
37250,
12888,
20520,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
292,
13361,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
62,
7783,
62,
4023,
62,
7890,
62,
8807,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
62,
3866,
2220,
62,
11299,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
62,
25927,
62,
48678,
11537,
628,
220,
220,
220,
220,
220,
220,
220,
42287,
796,
17205,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1994,
11,
1188,
287,
2237,
13,
2676,
23814,
7,
37266,
17816,
46265,
22046,
20520,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
1994,
407,
287,
477,
62,
37266,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
5994,
12331,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
30074,
281,
10059,
21179,
4578,
705,
4,
82,
29653,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
284,
2446,
13259,
1,
4064,
1994,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
42287,
58,
2539,
60,
796,
1188,
198,
220,
220,
220,
220,
220,
220,
220,
1619,
42287,
17816,
46265,
22046,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
11767,
262,
2672,
11507,
705,
12888,
6,
318,
900,
198,
220,
220,
220,
220,
220,
220,
220,
611,
19203,
12888,
6,
407,
287,
42287,
393,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
42287,
17816,
12888,
20520,
318,
6045,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
11052,
12331,
7203,
43730,
262,
2672,
11507,
4600,
12888,
63,
618,
4585,
4600,
42503,
63,
4943,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
4947,
62,
687,
1381,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
3108,
62,
37266,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
12405,
62,
37266,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
611,
705,
12888,
6,
287,
42287,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12405,
62,
37266,
13,
33295,
7,
10786,
12888,
3256,
42287,
17816,
12888,
20520,
4008,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
1296,
62,
37266,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
1957,
62,
7785,
62,
16624,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
1767,
62,
37266,
796,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
14626,
13639,
4600,
38855,
63,
198,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
17816,
38855,
20520,
796,
2116,
13,
15042,
62,
16366,
13,
19738,
62,
25677,
62,
13635,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37250,
31438,
14,
17752,
6,
12962,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
14626,
13639,
4600,
19746,
12,
6030,
63,
198,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
17816,
19746,
12,
6030,
20520,
796,
2116,
13,
15042,
62,
16366,
13,
19738,
62,
25677,
62,
11299,
62,
4906,
7,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37250,
31438,
14,
17752,
6,
12962,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
48191,
4634,
198,
220,
220,
220,
220,
220,
220,
220,
6284,
62,
33692,
796,
17635,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
15042,
62,
16366,
13,
13345,
62,
15042,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31051,
18417,
14,
42503,
3256,
705,
18851,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3108,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12405,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1767,
28,
2618,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1281,
62,
37266,
28,
687,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3696,
28,
12001,
62,
7785,
62,
16624,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2882,
62,
4906,
28,
14202,
11,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6284,
62,
33692,
28,
18439,
62,
33692,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30351,
28,
37266,
13,
1136,
10786,
292,
13361,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
7783,
62,
4023,
62,
7890,
62,
8807,
28,
37266,
13,
1136,
10786,
62,
7783,
62,
4023,
62,
7890,
62,
8807,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
3866,
2220,
62,
11299,
28,
37266,
13,
1136,
10786,
62,
3866,
2220,
62,
11299,
3256,
6407,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
25927,
62,
48678,
28,
37266,
13,
1136,
10786,
62,
25927,
62,
48678,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4947,
62,
687,
1381,
28,
43681,
62,
687,
1381,
8,
628,
220,
220,
220,
825,
4296,
62,
7220,
7,
944,
11,
4686,
11,
12429,
46265,
22046,
2599,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
10260,
2836,
3307,
357,
3803,
9206,
11,
751,
3307,
3503,
8,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
770,
2446,
1838,
257,
18305,
516,
14626,
2581,
416,
4277,
13,
1675,
787,
281,
198,
220,
220,
220,
220,
220,
220,
220,
39354,
14626,
2581,
11,
3387,
1208,
30351,
28,
17821,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
4704,
796,
40391,
13,
19119,
62,
7220,
7,
312,
11,
30351,
28,
17821,
8,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
1255,
796,
4704,
13,
1136,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
30351,
20512,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
965,
4686,
25,
383,
3748,
1852,
7087,
329,
281,
9515,
357,
72,
13,
68,
13,
11787,
11,
15941,
11,
4935,
11,
42641,
3503,
8,
357,
35827,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
220,
2836,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
2134,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1002,
262,
2446,
318,
1444,
355,
24871,
3481,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5860,
262,
2581,
4704,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
479,
86,
22046,
17816,
62,
7783,
62,
4023,
62,
7890,
62,
8807,
20520,
796,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
611,
479,
86,
22046,
13,
1136,
10786,
292,
13361,
6,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
19119,
62,
7220,
62,
4480,
62,
4023,
62,
10951,
7,
312,
11,
12429,
46265,
22046,
8,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
7890,
8,
796,
2116,
13,
19119,
62,
7220,
62,
4480,
62,
4023,
62,
10951,
7,
312,
11,
12429,
46265,
22046,
8,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
1366,
628,
220,
220,
220,
825,
4296,
62,
7220,
62,
4480,
62,
4023,
62,
10951,
7,
944,
11,
4686,
11,
12429,
46265,
22046,
2599,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
10260,
2836,
3307,
357,
3803,
9206,
11,
751,
3307,
3503,
8,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
770,
2446,
1838,
257,
18305,
516,
14626,
2581,
416,
4277,
13,
1675,
787,
281,
198,
220,
220,
220,
220,
220,
220,
220,
39354,
14626,
2581,
11,
3387,
1208,
30351,
28,
17821,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
4704,
796,
40391,
13,
19119,
62,
7220,
62,
4480,
62,
4023,
62,
10951,
7,
312,
11,
30351,
28,
17821,
8,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
1255,
796,
4704,
13,
1136,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
30351,
20512,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
965,
4686,
25,
383,
3748,
1852,
7087,
329,
281,
9515,
357,
72,
13,
68,
13,
11787,
11,
15941,
11,
4935,
11,
42641,
3503,
8,
357,
35827,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
220,
2836,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
2134,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1002,
262,
2446,
318,
1444,
355,
24871,
3481,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5860,
262,
2581,
4704,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
796,
37250,
312,
3256,
705,
7220,
20520,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
292,
13361,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
62,
7783,
62,
4023,
62,
7890,
62,
8807,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
62,
3866,
2220,
62,
11299,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
62,
25927,
62,
48678,
11537,
628,
220,
220,
220,
220,
220,
220,
220,
42287,
796,
17205,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1994,
11,
1188,
287,
2237,
13,
2676,
23814,
7,
37266,
17816,
46265,
22046,
20520,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
1994,
407,
287,
477,
62,
37266,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
5994,
12331,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
30074,
281,
10059,
21179,
4578,
705,
4,
82,
29653,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
284,
2446,
4296,
62,
7220,
1,
4064,
1994,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
42287,
58,
2539,
60,
796,
1188,
198,
220,
220,
220,
220,
220,
220,
220,
1619,
42287,
17816,
46265,
22046,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
11767,
262,
2672,
11507,
705,
312,
6,
318,
900,
198,
220,
220,
220,
220,
220,
220,
220,
611,
19203,
312,
6,
407,
287,
42287,
393,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
42287,
17816,
312,
20520,
318,
6045,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
11052,
12331,
7203,
43730,
262,
2672,
11507,
4600,
312,
63,
618,
4585,
4600,
19119,
62,
7220,
63,
4943,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
611,
705,
312,
6,
287,
42287,
290,
407,
302,
13,
12947,
10786,
61,
58,
64,
12,
89,
32,
12,
57,
15,
12,
24,
12,
48688,
3,
3256,
42287,
17816,
312,
20520,
2599,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
11052,
12331,
7203,
44651,
1988,
329,
11507,
4600,
312,
63,
618,
4585,
4600,
19119,
62,
7220,
47671,
1276,
17216,
284,
262,
3912,
4600,
14,
61,
58,
64,
12,
89,
32,
12,
57,
15,
12,
24,
12,
48688,
3,
14,
63,
4943,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
4947,
62,
687,
1381,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
3108,
62,
37266,
796,
23884,
198,
220,
220,
220,
220,
220,
220,
220,
611,
705,
312,
6,
287,
42287,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3108,
62,
37266,
17816,
312,
20520,
796,
42287,
17816,
312,
20520,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
12405,
62,
37266,
796,
17635,
628,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
1296,
62,
37266,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
1957,
62,
7785,
62,
16624,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
1767,
62,
37266,
796,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
611,
705,
7220,
6,
287,
42287,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1767,
62,
37266,
796,
42287,
17816,
7220,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
14626,
13639,
4600,
38855,
63,
198,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
17816,
38855,
20520,
796,
2116,
13,
15042,
62,
16366,
13,
19738,
62,
25677,
62,
13635,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37250,
31438,
14,
17752,
6,
12962,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
14626,
13639,
4600,
19746,
12,
6030,
63,
198,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
17816,
19746,
12,
6030,
20520,
796,
2116,
13,
15042,
62,
16366,
13,
19738,
62,
25677,
62,
11299,
62,
4906,
7,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37250,
31438,
14,
17752,
6,
12962,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
48191,
4634,
198,
220,
220,
220,
220,
220,
220,
220,
6284,
62,
33692,
796,
37250,
36902,
12982,
3256,
705,
15042,
9218,
39681,
20520,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
15042,
62,
16366,
13,
13345,
62,
15042,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31051,
18417,
14,
90,
312,
92,
3256,
705,
30076,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3108,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12405,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1767,
28,
2618,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1281,
62,
37266,
28,
687,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3696,
28,
12001,
62,
7785,
62,
16624,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2882,
62,
4906,
11639,
15252,
3256,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6284,
62,
33692,
28,
18439,
62,
33692,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30351,
28,
37266,
13,
1136,
10786,
292,
13361,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
7783,
62,
4023,
62,
7890,
62,
8807,
28,
37266,
13,
1136,
10786,
62,
7783,
62,
4023,
62,
7890,
62,
8807,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
3866,
2220,
62,
11299,
28,
37266,
13,
1136,
10786,
62,
3866,
2220,
62,
11299,
3256,
6407,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
25927,
62,
48678,
28,
37266,
13,
1136,
10786,
62,
25927,
62,
48678,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4947,
62,
687,
1381,
28,
43681,
62,
687,
1381,
8,
628,
220,
220,
220,
825,
26571,
7,
944,
11,
12429,
46265,
22046,
2599,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
23621,
1071,
17,
11241,
7508,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
770,
2446,
1838,
257,
18305,
516,
14626,
2581,
416,
4277,
13,
1675,
787,
281,
198,
220,
220,
220,
220,
220,
220,
220,
39354,
14626,
2581,
11,
3387,
1208,
30351,
28,
17821,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
4704,
796,
40391,
13,
12102,
378,
7,
292,
13361,
28,
17821,
8,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
1255,
796,
4704,
13,
1136,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
30351,
20512,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
965,
1994,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
2134,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1002,
262,
2446,
318,
1444,
355,
24871,
3481,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5860,
262,
2581,
4704,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
479,
86,
22046,
17816,
62,
7783,
62,
4023,
62,
7890,
62,
8807,
20520,
796,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
611,
479,
86,
22046,
13,
1136,
10786,
292,
13361,
6,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
12102,
378,
62,
4480,
62,
4023,
62,
10951,
7,
1174,
46265,
22046,
8,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
7890,
8,
796,
2116,
13,
12102,
378,
62,
4480,
62,
4023,
62,
10951,
7,
1174,
46265,
22046,
8,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
1366,
628,
220,
220,
220,
825,
26571,
62,
4480,
62,
4023,
62,
10951,
7,
944,
11,
12429,
46265,
22046,
2599,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
23621,
1071,
17,
11241,
7508,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
770,
2446,
1838,
257,
18305,
516,
14626,
2581,
416,
4277,
13,
1675,
787,
281,
198,
220,
220,
220,
220,
220,
220,
220,
39354,
14626,
2581,
11,
3387,
1208,
30351,
28,
17821,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
4704,
796,
40391,
13,
12102,
378,
62,
4480,
62,
4023,
62,
10951,
7,
292,
13361,
28,
17821,
8,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
1255,
796,
4704,
13,
1136,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
30351,
20512,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
965,
1994,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
2134,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1002,
262,
2446,
318,
1444,
355,
24871,
3481,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5860,
262,
2581,
4704,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
796,
37250,
2539,
20520,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
292,
13361,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
62,
7783,
62,
4023,
62,
7890,
62,
8807,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
62,
3866,
2220,
62,
11299,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
62,
25927,
62,
48678,
11537,
628,
220,
220,
220,
220,
220,
220,
220,
42287,
796,
17205,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1994,
11,
1188,
287,
2237,
13,
2676,
23814,
7,
37266,
17816,
46265,
22046,
20520,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
1994,
407,
287,
477,
62,
37266,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
5994,
12331,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
30074,
281,
10059,
21179,
4578,
705,
4,
82,
29653,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
284,
2446,
26571,
1,
4064,
1994,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
42287,
58,
2539,
60,
796,
1188,
198,
220,
220,
220,
220,
220,
220,
220,
1619,
42287,
17816,
46265,
22046,
20520,
628,
220,
220,
220,
220,
220,
220,
220,
4947,
62,
687,
1381,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
3108,
62,
37266,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
12405,
62,
37266,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
611,
705,
2539,
6,
287,
42287,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12405,
62,
37266,
13,
33295,
7,
10786,
2539,
3256,
42287,
17816,
2539,
20520,
4008,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
1296,
62,
37266,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
1957,
62,
7785,
62,
16624,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
1767,
62,
37266,
796,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
14626,
13639,
4600,
38855,
63,
198,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
17816,
38855,
20520,
796,
2116,
13,
15042,
62,
16366,
13,
19738,
62,
25677,
62,
13635,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37250,
31438,
14,
17752,
6,
12962,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
14626,
13639,
4600,
19746,
12,
6030,
63,
198,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
17816,
19746,
12,
6030,
20520,
796,
2116,
13,
15042,
62,
16366,
13,
19738,
62,
25677,
62,
11299,
62,
4906,
7,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37250,
31438,
14,
17752,
6,
12962,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
48191,
4634,
198,
220,
220,
220,
220,
220,
220,
220,
6284,
62,
33692,
796,
17635,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
15042,
62,
16366,
13,
13345,
62,
15042,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31051,
18417,
14,
12102,
378,
3256,
705,
18851,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3108,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12405,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1767,
28,
2618,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1281,
62,
37266,
28,
687,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3696,
28,
12001,
62,
7785,
62,
16624,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2882,
62,
4906,
11639,
15252,
3256,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6284,
62,
33692,
28,
18439,
62,
33692,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30351,
28,
37266,
13,
1136,
10786,
292,
13361,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
7783,
62,
4023,
62,
7890,
62,
8807,
28,
37266,
13,
1136,
10786,
62,
7783,
62,
4023,
62,
7890,
62,
8807,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
3866,
2220,
62,
11299,
28,
37266,
13,
1136,
10786,
62,
3866,
2220,
62,
11299,
3256,
6407,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
25927,
62,
48678,
28,
37266,
13,
1136,
10786,
62,
25927,
62,
48678,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4947,
62,
687,
1381,
28,
43681,
62,
687,
1381,
8,
628,
220,
220,
220,
825,
11767,
62,
42503,
7,
944,
11,
12429,
46265,
22046,
2599,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
13414,
1958,
9206,
13259,
11241,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
770,
2446,
1838,
257,
18305,
516,
14626,
2581,
416,
4277,
13,
1675,
787,
281,
198,
220,
220,
220,
220,
220,
220,
220,
39354,
14626,
2581,
11,
3387,
1208,
30351,
28,
17821,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
4704,
796,
40391,
13,
332,
1958,
62,
42503,
7,
292,
13361,
28,
17821,
8,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
1255,
796,
4704,
13,
1136,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
30351,
20512,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
30027,
13259,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1002,
262,
2446,
318,
1444,
355,
24871,
3481,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5860,
262,
2581,
4704,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
479,
86,
22046,
17816,
62,
7783,
62,
4023,
62,
7890,
62,
8807,
20520,
796,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
611,
479,
86,
22046,
13,
1136,
10786,
292,
13361,
6,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
332,
1958,
62,
42503,
62,
4480,
62,
4023,
62,
10951,
7,
1174,
46265,
22046,
8,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
7890,
8,
796,
2116,
13,
332,
1958,
62,
42503,
62,
4480,
62,
4023,
62,
10951,
7,
1174,
46265,
22046,
8,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
1366,
628,
220,
220,
220,
825,
11767,
62,
42503,
62,
4480,
62,
4023,
62,
10951,
7,
944,
11,
12429,
46265,
22046,
2599,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
13414,
1958,
9206,
13259,
11241,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
770,
2446,
1838,
257,
18305,
516,
14626,
2581,
416,
4277,
13,
1675,
787,
281,
198,
220,
220,
220,
220,
220,
220,
220,
39354,
14626,
2581,
11,
3387,
1208,
30351,
28,
17821,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
4704,
796,
40391,
13,
332,
1958,
62,
42503,
62,
4480,
62,
4023,
62,
10951,
7,
292,
13361,
28,
17821,
8,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
1255,
796,
4704,
13,
1136,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
30351,
20512,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
30027,
13259,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1002,
262,
2446,
318,
1444,
355,
24871,
3481,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5860,
262,
2581,
4704,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
796,
37250,
42503,
20520,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
292,
13361,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
62,
7783,
62,
4023,
62,
7890,
62,
8807,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
62,
3866,
2220,
62,
11299,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
37266,
13,
33295,
10786,
62,
25927,
62,
48678,
11537,
628,
220,
220,
220,
220,
220,
220,
220,
42287,
796,
17205,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1994,
11,
1188,
287,
2237,
13,
2676,
23814,
7,
37266,
17816,
46265,
22046,
20520,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
1994,
407,
287,
477,
62,
37266,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
5994,
12331,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
30074,
281,
10059,
21179,
4578,
705,
4,
82,
29653,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
284,
2446,
11767,
62,
42503,
1,
4064,
1994,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
42287,
58,
2539,
60,
796,
1188,
198,
220,
220,
220,
220,
220,
220,
220,
1619,
42287,
17816,
46265,
22046,
20520,
628,
220,
220,
220,
220,
220,
220,
220,
4947,
62,
687,
1381,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
3108,
62,
37266,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
12405,
62,
37266,
796,
17635,
628,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
1296,
62,
37266,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
1957,
62,
7785,
62,
16624,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
1767,
62,
37266,
796,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
611,
705,
42503,
6,
287,
42287,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1767,
62,
37266,
796,
42287,
17816,
42503,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
14626,
13639,
4600,
38855,
63,
198,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
17816,
38855,
20520,
796,
2116,
13,
15042,
62,
16366,
13,
19738,
62,
25677,
62,
13635,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37250,
31438,
14,
17752,
6,
12962,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
14626,
13639,
4600,
19746,
12,
6030,
63,
198,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
17816,
19746,
12,
6030,
20520,
796,
2116,
13,
15042,
62,
16366,
13,
19738,
62,
25677,
62,
11299,
62,
4906,
7,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37250,
31438,
14,
17752,
6,
12962,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
48191,
4634,
198,
220,
220,
220,
220,
220,
220,
220,
6284,
62,
33692,
796,
17635,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
15042,
62,
16366,
13,
13345,
62,
15042,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31051,
18417,
14,
42503,
3256,
705,
32782,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3108,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12405,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1767,
28,
2618,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1281,
62,
37266,
28,
687,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3696,
28,
12001,
62,
7785,
62,
16624,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2882,
62,
4906,
28,
14202,
11,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6284,
62,
33692,
28,
18439,
62,
33692,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30351,
28,
37266,
13,
1136,
10786,
292,
13361,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
7783,
62,
4023,
62,
7890,
62,
8807,
28,
37266,
13,
1136,
10786,
62,
7783,
62,
4023,
62,
7890,
62,
8807,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
3866,
2220,
62,
11299,
28,
37266,
13,
1136,
10786,
62,
3866,
2220,
62,
11299,
3256,
6407,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
25927,
62,
48678,
28,
37266,
13,
1136,
10786,
62,
25927,
62,
48678,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4947,
62,
687,
1381,
28,
43681,
62,
687,
1381,
8,
198
] | 2.190661 | 18,289 |
from ij import IJ
from ij.gui import ShapeRoi
from java.awt import Color, Polygon
from java.awt.geom import PathIterator
w = int(36)
h = int(42)
lineWidth = 2
arrowWidth = 16
image = IJ.createImage('Download arrow', 'rgb', w, h, 1)
ip = image.getProcessor()
ip.setLineWidth(lineWidth)
ip.setColor(Color(0x65a4e3))
roi = ShapeRoi([PathIterator.SEG_MOVETO, 0, 0,
PathIterator.SEG_LINETO, w, 0,
PathIterator.SEG_LINETO, w, w,
PathIterator.SEG_LINETO, 0, w,
PathIterator.SEG_CLOSE])
lw = lineWidth
roi = roi.not(ShapeRoi([PathIterator.SEG_MOVETO, lw, lw,
PathIterator.SEG_LINETO, w - lw, lw,
PathIterator.SEG_LINETO, w - lw, w - lw,
PathIterator.SEG_LINETO, lw, w - lw,
PathIterator.SEG_CLOSE]))
x1 = (w - arrowWidth) / 2
x2 = (w + arrowWidth) / 2
y1 = w * 2 / 3
roi = roi.or(ShapeRoi([PathIterator.SEG_MOVETO, x1, 0,
PathIterator.SEG_LINETO, x1, y1,
PathIterator.SEG_LINETO, 0, y1,
PathIterator.SEG_LINETO, w / 2 - 1, h,
PathIterator.SEG_LINETO, w / 2, h,
PathIterator.SEG_LINETO, w - 1, y1,
PathIterator.SEG_LINETO, x2, y1,
PathIterator.SEG_LINETO, x2, 0,
PathIterator.SEG_CLOSE]))
ip.fill(roi)
IJ.saveAs(image, "PNG", "resources/download-arrow.png")
| [
6738,
1312,
73,
1330,
314,
41,
198,
6738,
1312,
73,
13,
48317,
1330,
25959,
15450,
72,
198,
6738,
20129,
13,
707,
83,
1330,
5315,
11,
12280,
14520,
198,
6738,
20129,
13,
707,
83,
13,
469,
296,
1330,
10644,
37787,
198,
198,
86,
796,
493,
7,
2623,
8,
198,
71,
796,
493,
7,
3682,
8,
198,
1370,
30916,
796,
362,
198,
6018,
30916,
796,
1467,
198,
198,
9060,
796,
314,
41,
13,
17953,
5159,
10786,
10002,
15452,
3256,
705,
81,
22296,
3256,
266,
11,
289,
11,
352,
8,
198,
541,
796,
2939,
13,
1136,
18709,
273,
3419,
198,
541,
13,
2617,
13949,
30916,
7,
1370,
30916,
8,
198,
541,
13,
2617,
10258,
7,
10258,
7,
15,
87,
2996,
64,
19,
68,
18,
4008,
198,
305,
72,
796,
25959,
15450,
72,
26933,
15235,
37787,
13,
5188,
38,
62,
44,
8874,
2767,
46,
11,
657,
11,
657,
11,
198,
197,
15235,
37787,
13,
5188,
38,
62,
34509,
2767,
46,
11,
266,
11,
657,
11,
198,
197,
15235,
37787,
13,
5188,
38,
62,
34509,
2767,
46,
11,
266,
11,
266,
11,
198,
197,
15235,
37787,
13,
5188,
38,
62,
34509,
2767,
46,
11,
657,
11,
266,
11,
198,
197,
15235,
37787,
13,
5188,
38,
62,
32737,
12962,
198,
75,
86,
796,
1627,
30916,
198,
305,
72,
796,
686,
72,
13,
1662,
7,
33383,
15450,
72,
26933,
15235,
37787,
13,
5188,
38,
62,
44,
8874,
2767,
46,
11,
300,
86,
11,
300,
86,
11,
198,
197,
15235,
37787,
13,
5188,
38,
62,
34509,
2767,
46,
11,
266,
532,
300,
86,
11,
300,
86,
11,
198,
197,
15235,
37787,
13,
5188,
38,
62,
34509,
2767,
46,
11,
266,
532,
300,
86,
11,
266,
532,
300,
86,
11,
198,
197,
15235,
37787,
13,
5188,
38,
62,
34509,
2767,
46,
11,
300,
86,
11,
266,
532,
300,
86,
11,
198,
197,
15235,
37787,
13,
5188,
38,
62,
32737,
60,
4008,
198,
87,
16,
796,
357,
86,
532,
15452,
30916,
8,
1220,
362,
198,
87,
17,
796,
357,
86,
1343,
15452,
30916,
8,
1220,
362,
198,
88,
16,
796,
266,
1635,
362,
1220,
513,
198,
305,
72,
796,
686,
72,
13,
273,
7,
33383,
15450,
72,
26933,
15235,
37787,
13,
5188,
38,
62,
44,
8874,
2767,
46,
11,
2124,
16,
11,
657,
11,
198,
197,
15235,
37787,
13,
5188,
38,
62,
34509,
2767,
46,
11,
2124,
16,
11,
331,
16,
11,
198,
197,
15235,
37787,
13,
5188,
38,
62,
34509,
2767,
46,
11,
657,
11,
331,
16,
11,
198,
197,
15235,
37787,
13,
5188,
38,
62,
34509,
2767,
46,
11,
266,
1220,
362,
532,
352,
11,
289,
11,
198,
197,
15235,
37787,
13,
5188,
38,
62,
34509,
2767,
46,
11,
266,
1220,
362,
11,
289,
11,
198,
197,
15235,
37787,
13,
5188,
38,
62,
34509,
2767,
46,
11,
266,
532,
352,
11,
331,
16,
11,
198,
197,
15235,
37787,
13,
5188,
38,
62,
34509,
2767,
46,
11,
2124,
17,
11,
331,
16,
11,
198,
197,
15235,
37787,
13,
5188,
38,
62,
34509,
2767,
46,
11,
2124,
17,
11,
657,
11,
198,
197,
15235,
37787,
13,
5188,
38,
62,
32737,
60,
4008,
198,
541,
13,
20797,
7,
305,
72,
8,
198,
23852,
13,
21928,
1722,
7,
9060,
11,
366,
47,
10503,
1600,
366,
37540,
14,
15002,
12,
6018,
13,
11134,
4943,
198
] | 2.153137 | 542 |
"""Test LND functions"""
import logging
import random
import json
import unittest
from unittest import mock
from noma import lnd
import noma.config as cfg
class TestComplete(Exception):
"""Raise me to stop the test, we're done"""
class Unhappy(Exception):
"""Something has gone wrong"""
class LndCreateWalletTests(unittest.TestCase):
"""Test the create_wallet() function"""
@classmethod
@classmethod
@mock.patch("noma.lnd.randompass")
@mock.patch("os.path.exists")
def test_uses_tempfile_if_no_controlfile(self, m_exists, m_rpass):
"""
Test that, if PASSWORD_FILE_PATH does not exist, and SAVE_PASS_CONTROL_FILE
does not exist either, we:
- generate the password with `randompass`,
- open the temporary password file
- write the generated password to the temp file, and
- close the file
"""
m_exists.side_effect = exists
m_open = mock.mock_open()
m_rpass.return_value = random.random()
handle = m_open()
handle.close.side_effect = TestComplete
with mock.patch("builtins.open", m_open):
with self.assertRaises(TestComplete):
lnd.create_wallet()
m_exists.assert_any_call(str(cfg.PASSWORD_FILE_PATH))
m_exists.assert_any_call(str(cfg.SAVE_PASSWORD_CONTROL_FILE))
m_rpass.assert_called_with(string_length=15)
m_open.assert_called_with(str(cfg.PASSWORD_FILE_PATH), "w")
handle.write.assert_called_with(m_rpass.return_value)
handle.close.assert_called_with()
@mock.patch("noma.lnd.randompass")
@mock.patch("os.path.exists")
def test_uses_sesame_if_controlfile(self, m_exists, m_rpass):
"""
Test that, if PASSWORD_FILE_PATH does not exist, and SAVE_PASS_CONTROL_FILE
does exist, we:
- generate the password with `randompass`,
- open the sesame file
- write the generated password to the sesame file, and
- close the file
"""
m_exists.side_effect = exists
m_open = mock.mock_open()
m_rpass.return_value = random.random()
handle = m_open()
handle.close.side_effect = TestComplete
with mock.patch("builtins.open", m_open):
with self.assertRaises(TestComplete):
lnd.create_wallet()
m_exists.assert_any_call(str(cfg.PASSWORD_FILE_PATH))
m_exists.assert_any_call(str(cfg.SAVE_PASSWORD_CONTROL_FILE))
m_rpass.assert_called_with(string_length=15)
m_open.assert_called_with(str(cfg.PASSWORD_FILE_PATH), "w")
handle.write.assert_called_with(m_rpass.return_value)
handle.close.assert_called_with()
@mock.patch("os.path.exists")
def test_reads_sesame_if_exists(self, m_exists):
"""
Test that, if PASSWORD_FILE_PATH does exist, we:
- read the password_str from PASSWORD_FILE_PATH
COVERAGE IMPROVEMENT OPPORTUNITY: also test that we:
- .rstrip() the password_str
"""
m_exists.side_effect = exists
m_open = mock.mock_open()
with mock.patch("builtins.open", m_open):
with self.assertRaises(TestComplete):
lnd.create_wallet()
password_call = mock.call(str(cfg.PASSWORD_FILE_PATH), "r").read()
self.assertIn(password_call, m_open.mock_calls)
m_exists.assert_any_call(str(cfg.PASSWORD_FILE_PATH))
m_open.assert_called_with(str(cfg.PASSWORD_FILE_PATH), "r")
@mock.patch("noma.lnd.get")
@mock.patch("os.path.exists")
def test_generates_seed(self, m_exists, m_get):
"""
Test that, if PASSWORD_FILE_PATH does exist and we were able to get the
password_str earlier, and the SEED_FILENAME path does not exist, we
call get() to get a new seed
"""
m_exists.side_effect = exists
m_open = mock.mock_open()
m_get.side_effect = TestComplete
with mock.patch("builtins.open", m_open):
with self.assertRaises(TestComplete):
lnd.create_wallet()
m_get.assert_called_with(cfg.URL_GENSEED, verify=str(cfg.TLS_CERT_PATH))
@mock.patch("noma.lnd.post")
@mock.patch("noma.lnd.get")
@mock.patch("os.path.exists")
def test_saves_seed(self, m_exists, m_get, m_post):
"""
Test that, if we used get() to generate a new seed as above, and if
get().status_code == 200, we:
- call the .json() method on the get() return value
- get the "cipher_seed_mnemnonic" key in the resulting dict
- open the file at lnd.SEED_FILENAME for writing
- write the seed to file, one item in the cipher_seed_mnemonic
iterable per line
- close the file handle
COVERAGE IMPROVEMENT OPPORUNITIES:
- test that we actually check the status_code and do not proceed if
the code is not 200
- test that we correctly build the `data` dict
"""
mnemonic = ["foo", "bar", "baz"]
class DummyResponse:
"""Mocked-up Response for our get() function"""
status_code = 200
def json(self):
"""mock JSON method"""
return {"cipher_seed_mnemonic": mnemonic}
m_exists.side_effect = exists
m_open = mock.mock_open()
m_get.side_effect = DummyResponse
m_post.side_effect = TestComplete
with mock.patch("builtins.open", m_open):
with self.assertRaises(TestComplete):
try:
lnd.create_wallet()
except Unhappy as exc:
raise Unhappy(
"{}: {}\nget: {}\npost: {}".format(
exc,
m_exists.mock_calls,
m_get.mock_calls,
m_post.mock_calls,
)
)
m_get.assert_called_with(cfg.URL_GENSEED, verify=str(cfg.TLS_CERT_PATH))
handle = m_open()
for mne in mnemonic:
handle.write.assert_any_call(mne + "\n")
handle.close.assert_called_with()
@mock.patch("noma.lnd.post")
@mock.patch("noma.lnd.get")
@mock.patch("os.path.exists")
def test_loads_seed(self, m_exists, m_get, m_post):
"""
Test that, if SEED_FILENAME does exist, we:
- do not call requests.get()
- open lnd.SEED_FILENAME for reading
- load every line in the resulting file into a list, stripping
newline characters
- build a `data` dict with the keys:
- cipher_seed_mnemonic
- wallet_password
- requests.post() the `data` dict to lnd.URL_INITWALLET after
dumping it to JSON
COVERAGE IMPROVEMENT OPPORUNITIES:
- test wallet_password is correctly read (earlier in the function)
"""
mnemonic = ["foo", "bar", "baz"]
file_contents = "\n".join(mnemonic)
m_exists.side_effect = exists
m_open = mock.mock_open(read_data=file_contents)
m_post.side_effect = TestComplete
with mock.patch("builtins.open", m_open):
with self.assertRaises(TestComplete):
lnd.create_wallet()
m_get.assert_not_called()
m_open.assert_called_with(str(cfg.SEED_FILENAME), "r")
post_call = m_post.mock_calls[-1]
_, args, kwargs = post_call
self.assertIn(cfg.URL_INITWALLET, args)
self.assertEqual(kwargs["verify"], str(cfg.TLS_CERT_PATH))
data_json = kwargs["data"]
data = json.loads(data_json)
self.assertEqual(data["cipher_seed_mnemonic"], mnemonic)
if __name__ == "__main__":
unittest.main()
| [
37811,
14402,
406,
8575,
5499,
37811,
198,
11748,
18931,
198,
11748,
4738,
198,
11748,
33918,
198,
11748,
555,
715,
395,
198,
6738,
555,
715,
395,
1330,
15290,
198,
6738,
4515,
64,
1330,
300,
358,
198,
11748,
4515,
64,
13,
11250,
355,
30218,
70,
628,
198,
4871,
6208,
20988,
7,
16922,
2599,
198,
220,
220,
220,
37227,
21762,
786,
502,
284,
2245,
262,
1332,
11,
356,
821,
1760,
37811,
628,
198,
4871,
791,
34191,
7,
16922,
2599,
198,
220,
220,
220,
37227,
22210,
468,
3750,
2642,
37811,
628,
198,
4871,
406,
358,
16447,
47152,
51,
3558,
7,
403,
715,
395,
13,
14402,
20448,
2599,
198,
220,
220,
220,
37227,
14402,
262,
2251,
62,
44623,
3419,
2163,
37811,
628,
220,
220,
220,
2488,
4871,
24396,
628,
220,
220,
220,
2488,
4871,
24396,
628,
220,
220,
220,
2488,
76,
735,
13,
17147,
7203,
77,
6086,
13,
75,
358,
13,
25192,
3361,
562,
4943,
198,
220,
220,
220,
2488,
76,
735,
13,
17147,
7203,
418,
13,
6978,
13,
1069,
1023,
4943,
198,
220,
220,
220,
825,
1332,
62,
2664,
62,
29510,
7753,
62,
361,
62,
3919,
62,
3642,
305,
1652,
576,
7,
944,
11,
285,
62,
1069,
1023,
11,
285,
62,
81,
6603,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
6208,
326,
11,
611,
41752,
54,
12532,
62,
25664,
62,
34219,
857,
407,
2152,
11,
290,
14719,
6089,
62,
47924,
62,
10943,
5446,
3535,
62,
25664,
198,
220,
220,
220,
220,
220,
220,
220,
857,
407,
2152,
2035,
11,
356,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
532,
7716,
262,
9206,
351,
4600,
25192,
3361,
562,
47671,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
532,
1280,
262,
8584,
9206,
2393,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
532,
3551,
262,
7560,
9206,
284,
262,
20218,
2393,
11,
290,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
532,
1969,
262,
2393,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
285,
62,
1069,
1023,
13,
1589,
62,
10760,
796,
7160,
198,
220,
220,
220,
220,
220,
220,
220,
285,
62,
9654,
796,
15290,
13,
76,
735,
62,
9654,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
285,
62,
81,
6603,
13,
7783,
62,
8367,
796,
4738,
13,
25120,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
5412,
796,
285,
62,
9654,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
5412,
13,
19836,
13,
1589,
62,
10760,
796,
6208,
20988,
198,
220,
220,
220,
220,
220,
220,
220,
351,
15290,
13,
17147,
7203,
18780,
1040,
13,
9654,
1600,
285,
62,
9654,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
351,
2116,
13,
30493,
21762,
2696,
7,
14402,
20988,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
358,
13,
17953,
62,
44623,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
285,
62,
1069,
1023,
13,
30493,
62,
1092,
62,
13345,
7,
2536,
7,
37581,
13,
47924,
54,
12532,
62,
25664,
62,
34219,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
285,
62,
1069,
1023,
13,
30493,
62,
1092,
62,
13345,
7,
2536,
7,
37581,
13,
4090,
6089,
62,
47924,
54,
12532,
62,
10943,
5446,
3535,
62,
25664,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
285,
62,
81,
6603,
13,
30493,
62,
7174,
62,
4480,
7,
8841,
62,
13664,
28,
1314,
8,
198,
220,
220,
220,
220,
220,
220,
220,
285,
62,
9654,
13,
30493,
62,
7174,
62,
4480,
7,
2536,
7,
37581,
13,
47924,
54,
12532,
62,
25664,
62,
34219,
828,
366,
86,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
5412,
13,
13564,
13,
30493,
62,
7174,
62,
4480,
7,
76,
62,
81,
6603,
13,
7783,
62,
8367,
8,
198,
220,
220,
220,
220,
220,
220,
220,
5412,
13,
19836,
13,
30493,
62,
7174,
62,
4480,
3419,
628,
220,
220,
220,
2488,
76,
735,
13,
17147,
7203,
77,
6086,
13,
75,
358,
13,
25192,
3361,
562,
4943,
198,
220,
220,
220,
2488,
76,
735,
13,
17147,
7203,
418,
13,
6978,
13,
1069,
1023,
4943,
198,
220,
220,
220,
825,
1332,
62,
2664,
62,
8448,
480,
62,
361,
62,
3642,
305,
1652,
576,
7,
944,
11,
285,
62,
1069,
1023,
11,
285,
62,
81,
6603,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
6208,
326,
11,
611,
41752,
54,
12532,
62,
25664,
62,
34219,
857,
407,
2152,
11,
290,
14719,
6089,
62,
47924,
62,
10943,
5446,
3535,
62,
25664,
198,
220,
220,
220,
220,
220,
220,
220,
857,
2152,
11,
356,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
532,
7716,
262,
9206,
351,
4600,
25192,
3361,
562,
47671,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
532,
1280,
262,
264,
34038,
2393,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
532,
3551,
262,
7560,
9206,
284,
262,
264,
34038,
2393,
11,
290,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
532,
1969,
262,
2393,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
285,
62,
1069,
1023,
13,
1589,
62,
10760,
796,
7160,
198,
220,
220,
220,
220,
220,
220,
220,
285,
62,
9654,
796,
15290,
13,
76,
735,
62,
9654,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
285,
62,
81,
6603,
13,
7783,
62,
8367,
796,
4738,
13,
25120,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
5412,
796,
285,
62,
9654,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
5412,
13,
19836,
13,
1589,
62,
10760,
796,
6208,
20988,
198,
220,
220,
220,
220,
220,
220,
220,
351,
15290,
13,
17147,
7203,
18780,
1040,
13,
9654,
1600,
285,
62,
9654,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
351,
2116,
13,
30493,
21762,
2696,
7,
14402,
20988,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
358,
13,
17953,
62,
44623,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
285,
62,
1069,
1023,
13,
30493,
62,
1092,
62,
13345,
7,
2536,
7,
37581,
13,
47924,
54,
12532,
62,
25664,
62,
34219,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
285,
62,
1069,
1023,
13,
30493,
62,
1092,
62,
13345,
7,
2536,
7,
37581,
13,
4090,
6089,
62,
47924,
54,
12532,
62,
10943,
5446,
3535,
62,
25664,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
285,
62,
81,
6603,
13,
30493,
62,
7174,
62,
4480,
7,
8841,
62,
13664,
28,
1314,
8,
198,
220,
220,
220,
220,
220,
220,
220,
285,
62,
9654,
13,
30493,
62,
7174,
62,
4480,
7,
2536,
7,
37581,
13,
47924,
54,
12532,
62,
25664,
62,
34219,
828,
366,
86,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
5412,
13,
13564,
13,
30493,
62,
7174,
62,
4480,
7,
76,
62,
81,
6603,
13,
7783,
62,
8367,
8,
198,
220,
220,
220,
220,
220,
220,
220,
5412,
13,
19836,
13,
30493,
62,
7174,
62,
4480,
3419,
628,
220,
220,
220,
2488,
76,
735,
13,
17147,
7203,
418,
13,
6978,
13,
1069,
1023,
4943,
198,
220,
220,
220,
825,
1332,
62,
40779,
62,
8448,
480,
62,
361,
62,
1069,
1023,
7,
944,
11,
285,
62,
1069,
1023,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
6208,
326,
11,
611,
41752,
54,
12532,
62,
25664,
62,
34219,
857,
2152,
11,
356,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
532,
1100,
262,
9206,
62,
2536,
422,
41752,
54,
12532,
62,
25664,
62,
34219,
198,
220,
220,
220,
220,
220,
220,
220,
47902,
11879,
8959,
41283,
12529,
440,
10246,
9863,
4944,
9050,
25,
635,
1332,
326,
356,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
532,
764,
81,
36311,
3419,
262,
9206,
62,
2536,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
285,
62,
1069,
1023,
13,
1589,
62,
10760,
796,
7160,
198,
220,
220,
220,
220,
220,
220,
220,
285,
62,
9654,
796,
15290,
13,
76,
735,
62,
9654,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
351,
15290,
13,
17147,
7203,
18780,
1040,
13,
9654,
1600,
285,
62,
9654,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
351,
2116,
13,
30493,
21762,
2696,
7,
14402,
20988,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
358,
13,
17953,
62,
44623,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
9206,
62,
13345,
796,
15290,
13,
13345,
7,
2536,
7,
37581,
13,
47924,
54,
12532,
62,
25664,
62,
34219,
828,
366,
81,
11074,
961,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
818,
7,
28712,
62,
13345,
11,
285,
62,
9654,
13,
76,
735,
62,
66,
5691,
8,
198,
220,
220,
220,
220,
220,
220,
220,
285,
62,
1069,
1023,
13,
30493,
62,
1092,
62,
13345,
7,
2536,
7,
37581,
13,
47924,
54,
12532,
62,
25664,
62,
34219,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
285,
62,
9654,
13,
30493,
62,
7174,
62,
4480,
7,
2536,
7,
37581,
13,
47924,
54,
12532,
62,
25664,
62,
34219,
828,
366,
81,
4943,
628,
220,
220,
220,
2488,
76,
735,
13,
17147,
7203,
77,
6086,
13,
75,
358,
13,
1136,
4943,
198,
220,
220,
220,
2488,
76,
735,
13,
17147,
7203,
418,
13,
6978,
13,
1069,
1023,
4943,
198,
220,
220,
220,
825,
1332,
62,
8612,
689,
62,
28826,
7,
944,
11,
285,
62,
1069,
1023,
11,
285,
62,
1136,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
6208,
326,
11,
611,
41752,
54,
12532,
62,
25664,
62,
34219,
857,
2152,
290,
356,
547,
1498,
284,
651,
262,
198,
220,
220,
220,
220,
220,
220,
220,
9206,
62,
2536,
2961,
11,
290,
262,
7946,
1961,
62,
46700,
1677,
10067,
3108,
857,
407,
2152,
11,
356,
198,
220,
220,
220,
220,
220,
220,
220,
869,
651,
3419,
284,
651,
257,
649,
9403,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
285,
62,
1069,
1023,
13,
1589,
62,
10760,
796,
7160,
198,
220,
220,
220,
220,
220,
220,
220,
285,
62,
9654,
796,
15290,
13,
76,
735,
62,
9654,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
285,
62,
1136,
13,
1589,
62,
10760,
796,
6208,
20988,
198,
220,
220,
220,
220,
220,
220,
220,
351,
15290,
13,
17147,
7203,
18780,
1040,
13,
9654,
1600,
285,
62,
9654,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
351,
2116,
13,
30493,
21762,
2696,
7,
14402,
20988,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
358,
13,
17953,
62,
44623,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
285,
62,
1136,
13,
30493,
62,
7174,
62,
4480,
7,
37581,
13,
21886,
62,
38,
24290,
1961,
11,
11767,
28,
2536,
7,
37581,
13,
51,
6561,
62,
34,
17395,
62,
34219,
4008,
628,
220,
220,
220,
2488,
76,
735,
13,
17147,
7203,
77,
6086,
13,
75,
358,
13,
7353,
4943,
198,
220,
220,
220,
2488,
76,
735,
13,
17147,
7203,
77,
6086,
13,
75,
358,
13,
1136,
4943,
198,
220,
220,
220,
2488,
76,
735,
13,
17147,
7203,
418,
13,
6978,
13,
1069,
1023,
4943,
198,
220,
220,
220,
825,
1332,
62,
82,
3080,
62,
28826,
7,
944,
11,
285,
62,
1069,
1023,
11,
285,
62,
1136,
11,
285,
62,
7353,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
6208,
326,
11,
611,
356,
973,
651,
3419,
284,
7716,
257,
649,
9403,
355,
2029,
11,
290,
611,
198,
220,
220,
220,
220,
220,
220,
220,
651,
22446,
13376,
62,
8189,
6624,
939,
11,
356,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
532,
869,
262,
764,
17752,
3419,
2446,
319,
262,
651,
3419,
1441,
1988,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
532,
651,
262,
366,
66,
10803,
62,
28826,
62,
10295,
37705,
9229,
1,
1994,
287,
262,
7186,
8633,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
532,
1280,
262,
2393,
379,
300,
358,
13,
5188,
1961,
62,
46700,
1677,
10067,
329,
3597,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
532,
3551,
262,
9403,
284,
2393,
11,
530,
2378,
287,
262,
38012,
62,
28826,
62,
10295,
50016,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
11629,
540,
583,
1627,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
532,
1969,
262,
2393,
5412,
628,
220,
220,
220,
220,
220,
220,
220,
47902,
11879,
8959,
41283,
12529,
440,
10246,
1581,
4944,
30383,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
532,
1332,
326,
356,
1682,
2198,
262,
3722,
62,
8189,
290,
466,
407,
5120,
611,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
262,
2438,
318,
407,
939,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
532,
1332,
326,
356,
9380,
1382,
262,
4600,
7890,
63,
8633,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
285,
77,
50016,
796,
14631,
21943,
1600,
366,
5657,
1600,
366,
65,
1031,
8973,
628,
220,
220,
220,
220,
220,
220,
220,
1398,
360,
13513,
31077,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37227,
44,
3543,
12,
929,
18261,
329,
674,
651,
3419,
2163,
37811,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3722,
62,
8189,
796,
939,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
825,
33918,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37227,
76,
735,
19449,
2446,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
19779,
66,
10803,
62,
28826,
62,
10295,
50016,
1298,
285,
77,
50016,
92,
628,
220,
220,
220,
220,
220,
220,
220,
285,
62,
1069,
1023,
13,
1589,
62,
10760,
796,
7160,
198,
220,
220,
220,
220,
220,
220,
220,
285,
62,
9654,
796,
15290,
13,
76,
735,
62,
9654,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
285,
62,
1136,
13,
1589,
62,
10760,
796,
360,
13513,
31077,
198,
220,
220,
220,
220,
220,
220,
220,
285,
62,
7353,
13,
1589,
62,
10760,
796,
6208,
20988,
198,
220,
220,
220,
220,
220,
220,
220,
351,
15290,
13,
17147,
7203,
18780,
1040,
13,
9654,
1600,
285,
62,
9654,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
351,
2116,
13,
30493,
21762,
2696,
7,
14402,
20988,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
358,
13,
17953,
62,
44623,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2845,
791,
34191,
355,
2859,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
791,
34191,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45144,
38362,
23884,
59,
782,
316,
25,
23884,
59,
77,
7353,
25,
23884,
1911,
18982,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2859,
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,
285,
62,
1069,
1023,
13,
76,
735,
62,
66,
5691,
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,
285,
62,
1136,
13,
76,
735,
62,
66,
5691,
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,
285,
62,
7353,
13,
76,
735,
62,
66,
5691,
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,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
285,
62,
1136,
13,
30493,
62,
7174,
62,
4480,
7,
37581,
13,
21886,
62,
38,
24290,
1961,
11,
11767,
28,
2536,
7,
37581,
13,
51,
6561,
62,
34,
17395,
62,
34219,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
5412,
796,
285,
62,
9654,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
329,
285,
710,
287,
285,
77,
50016,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5412,
13,
13564,
13,
30493,
62,
1092,
62,
13345,
7,
76,
710,
1343,
37082,
77,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
5412,
13,
19836,
13,
30493,
62,
7174,
62,
4480,
3419,
628,
220,
220,
220,
2488,
76,
735,
13,
17147,
7203,
77,
6086,
13,
75,
358,
13,
7353,
4943,
198,
220,
220,
220,
2488,
76,
735,
13,
17147,
7203,
77,
6086,
13,
75,
358,
13,
1136,
4943,
198,
220,
220,
220,
2488,
76,
735,
13,
17147,
7203,
418,
13,
6978,
13,
1069,
1023,
4943,
198,
220,
220,
220,
825,
1332,
62,
46030,
62,
28826,
7,
944,
11,
285,
62,
1069,
1023,
11,
285,
62,
1136,
11,
285,
62,
7353,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
6208,
326,
11,
611,
7946,
1961,
62,
46700,
1677,
10067,
857,
2152,
11,
356,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
532,
466,
407,
869,
7007,
13,
1136,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
532,
1280,
300,
358,
13,
5188,
1961,
62,
46700,
1677,
10067,
329,
3555,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
532,
3440,
790,
1627,
287,
262,
7186,
2393,
656,
257,
1351,
11,
37727,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
649,
1370,
3435,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
532,
1382,
257,
4600,
7890,
63,
8633,
351,
262,
8251,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
532,
38012,
62,
28826,
62,
10295,
50016,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
532,
13008,
62,
28712,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
532,
7007,
13,
7353,
3419,
262,
4600,
7890,
63,
8633,
284,
300,
358,
13,
21886,
62,
1268,
2043,
54,
1847,
28882,
706,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30231,
340,
284,
19449,
198,
220,
220,
220,
220,
220,
220,
220,
47902,
11879,
8959,
41283,
12529,
440,
10246,
1581,
4944,
30383,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
532,
1332,
13008,
62,
28712,
318,
9380,
1100,
357,
451,
2505,
287,
262,
2163,
8,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
285,
77,
50016,
796,
14631,
21943,
1600,
366,
5657,
1600,
366,
65,
1031,
8973,
198,
220,
220,
220,
220,
220,
220,
220,
2393,
62,
3642,
658,
796,
37082,
77,
1911,
22179,
7,
10295,
50016,
8,
198,
220,
220,
220,
220,
220,
220,
220,
285,
62,
1069,
1023,
13,
1589,
62,
10760,
796,
7160,
198,
220,
220,
220,
220,
220,
220,
220,
285,
62,
9654,
796,
15290,
13,
76,
735,
62,
9654,
7,
961,
62,
7890,
28,
7753,
62,
3642,
658,
8,
198,
220,
220,
220,
220,
220,
220,
220,
285,
62,
7353,
13,
1589,
62,
10760,
796,
6208,
20988,
198,
220,
220,
220,
220,
220,
220,
220,
351,
15290,
13,
17147,
7203,
18780,
1040,
13,
9654,
1600,
285,
62,
9654,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
351,
2116,
13,
30493,
21762,
2696,
7,
14402,
20988,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
358,
13,
17953,
62,
44623,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
285,
62,
1136,
13,
30493,
62,
1662,
62,
7174,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
285,
62,
9654,
13,
30493,
62,
7174,
62,
4480,
7,
2536,
7,
37581,
13,
5188,
1961,
62,
46700,
1677,
10067,
828,
366,
81,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
1281,
62,
13345,
796,
285,
62,
7353,
13,
76,
735,
62,
66,
5691,
58,
12,
16,
60,
198,
220,
220,
220,
220,
220,
220,
220,
4808,
11,
26498,
11,
479,
86,
22046,
796,
1281,
62,
13345,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
818,
7,
37581,
13,
21886,
62,
1268,
2043,
54,
1847,
28882,
11,
26498,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
36,
13255,
7,
46265,
22046,
14692,
332,
1958,
33116,
965,
7,
37581,
13,
51,
6561,
62,
34,
17395,
62,
34219,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
1366,
62,
17752,
796,
479,
86,
22046,
14692,
7890,
8973,
198,
220,
220,
220,
220,
220,
220,
220,
1366,
796,
33918,
13,
46030,
7,
7890,
62,
17752,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
36,
13255,
7,
7890,
14692,
66,
10803,
62,
28826,
62,
10295,
50016,
33116,
285,
77,
50016,
8,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
3419,
198
] | 2.093692 | 3,757 |
#!/usr/bin/python3
from jmespath import search as queryJson
import boto3
import json
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
6738,
474,
6880,
6978,
1330,
2989,
355,
12405,
41,
1559,
198,
11748,
275,
2069,
18,
198,
11748,
33918,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
197,
12417,
3419,
198
] | 2.711111 | 45 |
# Copyright 2014 Rackspace
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
import jsonschema
from testtools import TestCase
from trove.configuration.service import ConfigurationsController
from trove.common import configurations
| [
2,
15069,
1946,
37927,
13200,
198,
2,
1439,
6923,
33876,
13,
198,
2,
198,
2,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
220,
220,
220,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
921,
743,
7330,
198,
2,
220,
220,
220,
257,
4866,
286,
262,
13789,
379,
198,
2,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
2638,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
43,
2149,
24290,
12,
17,
13,
15,
198,
2,
198,
2,
220,
220,
220,
17486,
2672,
416,
9723,
1099,
393,
4987,
284,
287,
3597,
11,
3788,
198,
2,
220,
220,
220,
9387,
739,
262,
13789,
318,
9387,
319,
281,
366,
1921,
3180,
1,
29809,
1797,
11,
42881,
198,
2,
220,
220,
220,
34764,
11015,
6375,
7102,
49828,
11053,
3963,
15529,
509,
12115,
11,
2035,
4911,
393,
17142,
13,
4091,
262,
198,
2,
220,
220,
220,
13789,
329,
262,
2176,
3303,
15030,
21627,
290,
11247,
198,
2,
220,
220,
220,
739,
262,
13789,
13,
198,
2,
198,
198,
11748,
44804,
684,
2395,
2611,
198,
6738,
1332,
31391,
1330,
6208,
20448,
198,
6738,
42377,
13,
11250,
3924,
13,
15271,
1330,
17056,
20074,
22130,
198,
6738,
42377,
13,
11321,
1330,
25412,
628,
198
] | 3.591743 | 218 |
from collections.abc import Mapping
from typing import Any, Optional
from .object_schema import InvalidObjectError, InvalidTypeError
from .schema import Schema, SchemaError
| [
6738,
17268,
13,
39305,
1330,
337,
5912,
198,
6738,
19720,
1330,
4377,
11,
32233,
198,
198,
6738,
764,
15252,
62,
15952,
2611,
1330,
17665,
10267,
12331,
11,
17665,
6030,
12331,
198,
6738,
764,
15952,
2611,
1330,
10011,
2611,
11,
10011,
2611,
12331,
628,
198
] | 4 | 44 |
'''
read_vcf
Read a vcf file into pandas data frame
'''
import pandas as pd
from typing import TextIO, List
import numpy as np
def import_vcf(vcf_reader: TextIO,
dataframe: pd.DataFrame = None,
check_phasing: bool = False,
individuals: List[str] = None) -> pd.DataFrame:
'''
Read in all lines of the provided, open vcf file and concatenate with
provided pandas dataframe
check_phasing: if true, raises value error for any unphased haplotype
that is not ./. If false, unphased haplotypes are converted to nan values,
or collapsed.
collapse_haplotype: if true, convert haplotypes to the sum of the
genotypes.
individuals: if specified, limit the imported data to only the provided
individuals. Individuals not found in the file raise value errors
'''
header_lines = 1 # 1-based indexing on error reporting
for line in vcf_reader:
header_lines += 1
if line[1] == '#': # comment string
continue
if line[0] == '#': # header string
header = line[1:].rstrip().split('\t')
break
indivs = header[9:]
if individuals is not None:
for indiv in individuals:
if indiv not in indivs:
raise ValueError(f'{indiv} not in file!')
indivs = [indiv for indiv in set(individuals)]
header = [h.lower() for h in header[:9]] + header[9:]
usecols = [header[i] for i in [0, 1, 3, 4]] + indivs
# precompute this as a dictionary for hopefully faster operations
phase_decoder = {}
for i in range(2):
for j in range(2):
phase_decoder[f'{i}|{j}'] = f'{i}|{j}'
phase_decoder[f'{i}/{j}'] = np.nan
phase_decoder['./.'] = 0
new_frame = pd.read_csv(vcf_reader,
delimiter='\t',
header=None,
names=header,
usecols=usecols)
new_frame = new_frame.loc[(new_frame.ref.str.len() == 1)
& (new_frame.alt.str.len() == 1)]
new_frame[indivs] = new_frame[indivs].applymap(phase_decoder.get)
if check_phasing:
if new_frame.isna().any(axis=None):
nanrow = new_frame[new_frame.isna().any(axis=1)].iloc[0]
nanind = nanrow.loc[nanrow.isna()].index[0]
raise ValueError('Unexpected unphased haplotype for '
f'{nanind} on position {nanrow.pos}')
if dataframe is not None:
return pd.concat([dataframe, new_frame], sort=False)
if len(new_frame) == 0:
return None
return new_frame
def import_archaic_vcf(vcf_reader: TextIO,
dataframe: pd.DataFrame = None,
include_canc: bool = False) -> pd.DataFrame:
'''
Read in all lines of the provided, open vcf file and return a
pandas dataframe.
Expects a single individual, does not check phasing, and returns the
number of alt sites only. E.g. 0/1 -> 1, ./. -> 0, 1|1 -> 2
'''
usecols = ['chrom', 'pos', 'ref', 'alt', 'variant']
if include_canc:
usecols += ['infor']
header = ['chrom', 'pos', 'id', 'ref', 'alt', 'qual',
'filter', 'infor', 'format', 'variant']
result = pd.read_csv(vcf_reader,
delimiter='\t',
header=None,
names=header,
usecols=usecols,
comment='#')
result = result.loc[(result.ref.str.len() == 1)
& (result.alt.str.len() == 1)]
if include_canc:
result = result.loc[result.infor.str.contains('CAnc')]
# extract CAnc into separate column, drop info
result.insert(len(result.columns),
"CAnc",
result.infor.map(extract_canc))
result = result.drop(columns='infor')
phase_decoder = {}
for i in range(2):
for j in range(2):
phase_decoder[f'{i}|{j}'] = i + j
phase_decoder[f'{i}/{j}'] = i + j
phase_decoder['./.'] = 0
if include_canc:
phase_decoder['./.'] = -1 # to filter later
result.variant = result.variant.map(process_phase)
if include_canc:
result = result.loc[result.variant != -1]
if dataframe is not None:
return pd.concat([dataframe, result], sort=False)
return result
| [
7061,
6,
198,
961,
62,
85,
12993,
198,
198,
5569,
257,
410,
12993,
2393,
656,
19798,
292,
1366,
5739,
198,
7061,
6,
628,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
19720,
1330,
8255,
9399,
11,
7343,
198,
11748,
299,
32152,
355,
45941,
628,
198,
4299,
1330,
62,
85,
12993,
7,
85,
12993,
62,
46862,
25,
8255,
9399,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
14535,
25,
279,
67,
13,
6601,
19778,
796,
6045,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2198,
62,
746,
2313,
25,
20512,
796,
10352,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3925,
25,
7343,
58,
2536,
60,
796,
6045,
8,
4613,
279,
67,
13,
6601,
19778,
25,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
4149,
287,
477,
3951,
286,
262,
2810,
11,
1280,
410,
12993,
2393,
290,
1673,
36686,
378,
351,
198,
220,
220,
220,
2810,
19798,
292,
1366,
14535,
198,
220,
220,
220,
2198,
62,
746,
2313,
25,
611,
2081,
11,
12073,
1988,
4049,
329,
597,
555,
746,
839,
42519,
8690,
198,
220,
220,
220,
326,
318,
407,
764,
11757,
220,
1002,
3991,
11,
555,
746,
839,
42519,
13567,
389,
11513,
284,
15709,
3815,
11,
198,
220,
220,
220,
393,
14707,
13,
198,
220,
220,
220,
9807,
62,
3099,
489,
8690,
25,
611,
2081,
11,
10385,
42519,
13567,
284,
262,
2160,
286,
262,
198,
220,
220,
220,
2429,
13567,
13,
198,
220,
220,
220,
3925,
25,
611,
7368,
11,
4179,
262,
17392,
1366,
284,
691,
262,
2810,
198,
220,
220,
220,
3925,
13,
220,
34884,
407,
1043,
287,
262,
2393,
5298,
1988,
8563,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
13639,
62,
6615,
796,
352,
220,
1303,
352,
12,
3106,
6376,
278,
319,
4049,
6447,
198,
220,
220,
220,
329,
1627,
287,
410,
12993,
62,
46862,
25,
198,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
6615,
15853,
352,
198,
220,
220,
220,
220,
220,
220,
220,
611,
1627,
58,
16,
60,
6624,
705,
2,
10354,
220,
1303,
2912,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2555,
628,
220,
220,
220,
220,
220,
220,
220,
611,
1627,
58,
15,
60,
6624,
705,
2,
10354,
220,
1303,
13639,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13639,
796,
1627,
58,
16,
25,
4083,
81,
36311,
22446,
35312,
10786,
59,
83,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2270,
628,
220,
220,
220,
773,
452,
82,
796,
13639,
58,
24,
47715,
198,
220,
220,
220,
611,
3925,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
329,
773,
452,
287,
3925,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
773,
452,
407,
287,
773,
452,
82,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
11052,
12331,
7,
69,
6,
90,
521,
452,
92,
407,
287,
2393,
0,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
773,
452,
82,
796,
685,
521,
452,
329,
773,
452,
287,
900,
7,
43129,
82,
15437,
628,
220,
220,
220,
13639,
796,
685,
71,
13,
21037,
3419,
329,
289,
287,
13639,
58,
25,
24,
11907,
1343,
13639,
58,
24,
47715,
198,
220,
220,
220,
779,
4033,
82,
796,
685,
25677,
58,
72,
60,
329,
1312,
287,
685,
15,
11,
352,
11,
513,
11,
604,
11907,
1343,
773,
452,
82,
628,
220,
220,
220,
1303,
662,
5589,
1133,
428,
355,
257,
22155,
329,
11481,
5443,
4560,
198,
220,
220,
220,
7108,
62,
12501,
12342,
796,
23884,
198,
220,
220,
220,
329,
1312,
287,
2837,
7,
17,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
329,
474,
287,
2837,
7,
17,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7108,
62,
12501,
12342,
58,
69,
6,
90,
72,
92,
91,
90,
73,
92,
20520,
796,
277,
6,
90,
72,
92,
91,
90,
73,
92,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7108,
62,
12501,
12342,
58,
69,
6,
90,
72,
92,
14,
90,
73,
92,
20520,
796,
45941,
13,
12647,
198,
220,
220,
220,
7108,
62,
12501,
12342,
58,
4458,
14,
2637,
60,
796,
657,
628,
220,
220,
220,
649,
62,
14535,
796,
279,
67,
13,
961,
62,
40664,
7,
85,
12993,
62,
46862,
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,
46728,
2676,
11639,
59,
83,
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,
13639,
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,
3891,
28,
25677,
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,
779,
4033,
82,
28,
1904,
4033,
82,
8,
628,
220,
220,
220,
649,
62,
14535,
796,
649,
62,
14535,
13,
17946,
58,
7,
3605,
62,
14535,
13,
5420,
13,
2536,
13,
11925,
3419,
6624,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1222,
357,
3605,
62,
14535,
13,
2501,
13,
2536,
13,
11925,
3419,
6624,
352,
15437,
628,
220,
220,
220,
649,
62,
14535,
58,
521,
452,
82,
60,
796,
649,
62,
14535,
58,
521,
452,
82,
4083,
39014,
8899,
7,
40715,
62,
12501,
12342,
13,
1136,
8,
628,
220,
220,
220,
611,
2198,
62,
746,
2313,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
649,
62,
14535,
13,
271,
2616,
22446,
1092,
7,
22704,
28,
14202,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15709,
808,
796,
649,
62,
14535,
58,
3605,
62,
14535,
13,
271,
2616,
22446,
1092,
7,
22704,
28,
16,
25295,
346,
420,
58,
15,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15709,
521,
796,
15709,
808,
13,
17946,
58,
12647,
808,
13,
271,
2616,
3419,
4083,
9630,
58,
15,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
11052,
12331,
10786,
52,
42072,
555,
746,
839,
42519,
8690,
329,
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,
220,
220,
220,
220,
277,
6,
90,
12647,
521,
92,
319,
2292,
1391,
12647,
808,
13,
1930,
92,
11537,
628,
220,
220,
220,
611,
1366,
14535,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
279,
67,
13,
1102,
9246,
26933,
7890,
14535,
11,
649,
62,
14535,
4357,
3297,
28,
25101,
8,
628,
220,
220,
220,
611,
18896,
7,
3605,
62,
14535,
8,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
6045,
628,
220,
220,
220,
1441,
649,
62,
14535,
628,
198,
4299,
1330,
62,
998,
18452,
62,
85,
12993,
7,
85,
12993,
62,
46862,
25,
8255,
9399,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
14535,
25,
279,
67,
13,
6601,
19778,
796,
6045,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2291,
62,
66,
1192,
25,
20512,
796,
10352,
8,
4613,
279,
67,
13,
6601,
19778,
25,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
4149,
287,
477,
3951,
286,
262,
2810,
11,
1280,
410,
12993,
2393,
290,
1441,
257,
198,
220,
220,
220,
19798,
292,
1366,
14535,
13,
198,
220,
220,
220,
23600,
82,
257,
2060,
1981,
11,
857,
407,
2198,
872,
2313,
11,
290,
5860,
262,
198,
220,
220,
220,
1271,
286,
5988,
5043,
691,
13,
220,
412,
13,
70,
13,
657,
14,
16,
4613,
352,
11,
764,
11757,
4613,
657,
11,
352,
91,
16,
4613,
362,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
779,
4033,
82,
796,
37250,
28663,
3256,
705,
1930,
3256,
705,
5420,
3256,
705,
2501,
3256,
705,
25641,
415,
20520,
198,
220,
220,
220,
611,
2291,
62,
66,
1192,
25,
198,
220,
220,
220,
220,
220,
220,
220,
779,
4033,
82,
15853,
37250,
259,
1640,
20520,
198,
220,
220,
220,
13639,
796,
37250,
28663,
3256,
705,
1930,
3256,
705,
312,
3256,
705,
5420,
3256,
705,
2501,
3256,
705,
13255,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
24455,
3256,
705,
259,
1640,
3256,
705,
18982,
3256,
705,
25641,
415,
20520,
198,
220,
220,
220,
1255,
796,
279,
67,
13,
961,
62,
40664,
7,
85,
12993,
62,
46862,
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,
46728,
2676,
11639,
59,
83,
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,
13639,
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,
3891,
28,
25677,
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,
779,
4033,
82,
28,
1904,
4033,
82,
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,
2912,
11639,
2,
11537,
628,
220,
220,
220,
1255,
796,
1255,
13,
17946,
58,
7,
20274,
13,
5420,
13,
2536,
13,
11925,
3419,
6624,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1222,
357,
20274,
13,
2501,
13,
2536,
13,
11925,
3419,
6624,
352,
15437,
198,
220,
220,
220,
611,
2291,
62,
66,
1192,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
1255,
13,
17946,
58,
20274,
13,
259,
1640,
13,
2536,
13,
3642,
1299,
10786,
34,
2025,
66,
11537,
60,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
7925,
327,
2025,
66,
656,
4553,
5721,
11,
4268,
7508,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
13,
28463,
7,
11925,
7,
20274,
13,
28665,
82,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
34,
2025,
66,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
13,
259,
1640,
13,
8899,
7,
2302,
974,
62,
66,
1192,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
1255,
13,
14781,
7,
28665,
82,
11639,
259,
1640,
11537,
628,
220,
220,
220,
7108,
62,
12501,
12342,
796,
23884,
198,
220,
220,
220,
329,
1312,
287,
2837,
7,
17,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
329,
474,
287,
2837,
7,
17,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7108,
62,
12501,
12342,
58,
69,
6,
90,
72,
92,
91,
90,
73,
92,
20520,
796,
1312,
1343,
474,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7108,
62,
12501,
12342,
58,
69,
6,
90,
72,
92,
14,
90,
73,
92,
20520,
796,
1312,
1343,
474,
198,
220,
220,
220,
7108,
62,
12501,
12342,
58,
4458,
14,
2637,
60,
796,
657,
628,
220,
220,
220,
611,
2291,
62,
66,
1192,
25,
198,
220,
220,
220,
220,
220,
220,
220,
7108,
62,
12501,
12342,
58,
4458,
14,
2637,
60,
796,
532,
16,
220,
1303,
284,
8106,
1568,
628,
220,
220,
220,
1255,
13,
25641,
415,
796,
1255,
13,
25641,
415,
13,
8899,
7,
14681,
62,
40715,
8,
628,
220,
220,
220,
611,
2291,
62,
66,
1192,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
1255,
13,
17946,
58,
20274,
13,
25641,
415,
14512,
532,
16,
60,
628,
220,
220,
220,
611,
1366,
14535,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
279,
67,
13,
1102,
9246,
26933,
7890,
14535,
11,
1255,
4357,
3297,
28,
25101,
8,
628,
220,
220,
220,
1441,
1255,
198
] | 2.075489 | 2,146 |
import datetime
import logging
import string
from unittest import TestCase
from unittest import mock
from elasticsearch_raven import exceptions
from elasticsearch_raven import transport
| [
11748,
4818,
8079,
198,
11748,
18931,
198,
11748,
4731,
198,
6738,
555,
715,
395,
1330,
6208,
20448,
198,
6738,
555,
715,
395,
1330,
15290,
198,
198,
6738,
27468,
12947,
62,
430,
574,
1330,
13269,
198,
6738,
27468,
12947,
62,
430,
574,
1330,
4839,
628,
628,
628,
628
] | 4.12766 | 47 |
import binascii
import functools
import json
import os
from rest_framework import permissions
from rest_framework import exceptions
from api.exceptions import *
from api.cryptor import ApiCrypto
| [
11748,
9874,
292,
979,
72,
198,
11748,
1257,
310,
10141,
198,
11748,
33918,
198,
11748,
28686,
198,
198,
6738,
1334,
62,
30604,
1330,
21627,
198,
6738,
1334,
62,
30604,
1330,
13269,
198,
198,
6738,
40391,
13,
1069,
11755,
1330,
1635,
198,
6738,
40391,
13,
29609,
273,
1330,
5949,
72,
23919,
78,
628
] | 3.807692 | 52 |
from core.models.view_tables import Edocument
from core.models.core_tables import TypeDef
from core.utilities.wf1_utils import generate_robot_file, generate_robot_file_wf1
#
| [
6738,
4755,
13,
27530,
13,
1177,
62,
83,
2977,
1330,
1717,
7990,
198,
6738,
4755,
13,
27530,
13,
7295,
62,
83,
2977,
1330,
5994,
7469,
198,
6738,
4755,
13,
315,
2410,
13,
86,
69,
16,
62,
26791,
1330,
7716,
62,
305,
13645,
62,
7753,
11,
7716,
62,
305,
13645,
62,
7753,
62,
86,
69,
16,
198,
198,
2,
198
] | 2.966102 | 59 |
from typing import Optional, Union
import tensorflow as tf
from tensorflow.python.layers.core import fully_connected
from hotpot.elmo.elmo import ElmoWrapper
from hotpot.elmo.lm_model import LanguageModel
from hotpot.encoder import QuestionsAndParagraphsEncoder
from hotpot.models.multiple_context_models import MultipleContextModel, INTERMEDIATE_LAYER_COLLECTION
from hotpot.nn.embedder import WordEmbedder, CharWordEmbedder
from hotpot.nn.layers import SequenceMapper, SequenceEncoder, MergeLayer, Mapper, SequenceMultiEncoder, \
MultipleMergeEncode, WeightLayer, FixedMergeLayer, get_keras_initialization, MaxPool, MeanPool
from hotpot.nn.ops import VERY_NEGATIVE_NUMBER
from hotpot.nn.relevance_prediction import BinaryFixedPredictor, BinaryWeightedMultipleFixedPredictor, \
BinaryNullPredictor
from hotpot.nn.sentence_layers import SentencesEncoder
class SingleContextMultipleEncodingModel(MultipleContextModel):
"""
Model for a question with a single paragraph, basically expands the basic model by creating multiple fixed size
representations of the context and the question, and weights each representation depending on the question.
components are as follows:
1. embeds each sequence separately
2. encodes the context and question to multiple fixed size representations
3. weights each representation, and performs a applies layer on each representation pair
4. predict by combining all representations
"""
class SingleContextMultipleEncodingWeightedSoftmaxModel(MultipleContextModel):
"""
A model very much like SingleContextMultipleEncodingModel above, but for a little but important difference:
The weighting of the encoding is done after "predicting" with each one of the encodings and performing a
softmax between each encodings logits. Then a weighted sum is calculated, with gives new probabilities
for the classes, on which a cross-entropy is applied.
"""
class SingleContextMaxSentenceModel(MultipleContextModel):
"""
Model for a question and a single paragraph which takes into account the sentences.
This model first creates an encoding for each sentence, and then performs a fully connected layer on the
encodings to get each sentence's prediction. It then gets the maximum value and predicts with it.
"""
| [
6738,
19720,
1330,
32233,
11,
4479,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
11192,
273,
11125,
13,
29412,
13,
75,
6962,
13,
7295,
1330,
3938,
62,
15236,
198,
198,
6738,
3024,
13059,
13,
417,
5908,
13,
417,
5908,
1330,
2574,
5908,
36918,
2848,
198,
6738,
3024,
13059,
13,
417,
5908,
13,
75,
76,
62,
19849,
1330,
15417,
17633,
198,
6738,
3024,
13059,
13,
12685,
12342,
1330,
20396,
1870,
10044,
6111,
82,
27195,
12342,
198,
6738,
3024,
13059,
13,
27530,
13,
48101,
62,
22866,
62,
27530,
1330,
20401,
21947,
17633,
11,
23255,
30733,
40,
6158,
62,
43,
4792,
1137,
62,
25154,
16779,
2849,
198,
6738,
3024,
13059,
13,
20471,
13,
20521,
1082,
1330,
9678,
31567,
276,
1082,
11,
3178,
26449,
31567,
276,
1082,
198,
6738,
3024,
13059,
13,
20471,
13,
75,
6962,
1330,
45835,
44,
11463,
11,
45835,
27195,
12342,
11,
39407,
49925,
11,
337,
11463,
11,
45835,
29800,
27195,
12342,
11,
3467,
198,
220,
220,
220,
20401,
13102,
469,
4834,
8189,
11,
14331,
49925,
11,
10832,
13102,
469,
49925,
11,
651,
62,
6122,
292,
62,
36733,
1634,
11,
5436,
27201,
11,
22728,
27201,
198,
6738,
3024,
13059,
13,
20471,
13,
2840,
1330,
29550,
62,
45,
7156,
37045,
62,
41359,
13246,
198,
6738,
3024,
13059,
13,
20471,
13,
260,
2768,
590,
62,
28764,
2867,
1330,
45755,
13715,
47,
17407,
273,
11,
45755,
25844,
276,
31217,
13715,
47,
17407,
273,
11,
3467,
198,
220,
220,
220,
45755,
35067,
47,
17407,
273,
198,
6738,
3024,
13059,
13,
20471,
13,
34086,
594,
62,
75,
6962,
1330,
11352,
3007,
27195,
12342,
628,
198,
4871,
14206,
21947,
31217,
27195,
7656,
17633,
7,
31217,
21947,
17633,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
9104,
329,
257,
1808,
351,
257,
2060,
7322,
11,
6209,
27513,
262,
4096,
2746,
416,
4441,
3294,
5969,
2546,
198,
220,
220,
220,
220,
24612,
286,
262,
4732,
290,
262,
1808,
11,
290,
19590,
1123,
10552,
6906,
319,
262,
1808,
13,
198,
220,
220,
220,
6805,
389,
355,
5679,
25,
198,
220,
220,
220,
352,
13,
11525,
82,
1123,
8379,
13869,
198,
220,
220,
220,
362,
13,
2207,
4147,
262,
4732,
290,
1808,
284,
3294,
5969,
2546,
24612,
198,
220,
220,
220,
513,
13,
19590,
1123,
10552,
11,
290,
17706,
257,
8991,
7679,
319,
1123,
10552,
5166,
198,
220,
220,
220,
604,
13,
4331,
416,
19771,
477,
24612,
198,
220,
220,
220,
37227,
628,
198,
4871,
14206,
21947,
31217,
27195,
7656,
25844,
276,
18380,
9806,
17633,
7,
31217,
21947,
17633,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
317,
2746,
845,
881,
588,
14206,
21947,
31217,
27195,
7656,
17633,
2029,
11,
475,
329,
257,
1310,
475,
1593,
3580,
25,
198,
220,
220,
220,
220,
220,
220,
220,
383,
3463,
278,
286,
262,
21004,
318,
1760,
706,
366,
79,
17407,
278,
1,
351,
1123,
530,
286,
262,
2207,
375,
654,
290,
9489,
257,
198,
220,
220,
220,
220,
220,
220,
220,
2705,
9806,
1022,
1123,
2207,
375,
654,
2604,
896,
13,
3244,
257,
26356,
2160,
318,
10488,
11,
351,
3607,
649,
39522,
198,
220,
220,
220,
220,
220,
220,
220,
329,
262,
6097,
11,
319,
543,
257,
3272,
12,
298,
28338,
318,
5625,
13,
198,
220,
220,
220,
37227,
628,
198,
4871,
14206,
21947,
11518,
31837,
594,
17633,
7,
31217,
21947,
17633,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
9104,
329,
257,
1808,
290,
257,
2060,
7322,
543,
2753,
656,
1848,
262,
13439,
13,
198,
220,
220,
220,
770,
2746,
717,
8075,
281,
21004,
329,
1123,
6827,
11,
290,
788,
17706,
257,
3938,
5884,
7679,
319,
262,
198,
220,
220,
220,
220,
220,
220,
220,
2207,
375,
654,
284,
651,
1123,
6827,
338,
17724,
13,
632,
788,
3011,
262,
5415,
1988,
290,
26334,
351,
340,
13,
198,
220,
220,
220,
37227,
198
] | 3.730463 | 627 |
import urllib.request as urlreq
import io,json
import pandas as pd
# ******************************************************************************************************************************************
def download_smiles(myList,intv=1) :
"""Retrieve canonical SMILES strings for a list of input INCHIKEYS.
Will return only one SMILES string per INCHIKEY. If there are multiple values returned, the first is retained and the others are returned in a the discard_lst. INCHIKEYS that fail to return a SMILES string are put in the fail_lst
Args:
myList (list): List of INCHIKEYS
intv (1) : number of INCHIKEYS to submit queries for in one request, default is 1
Returns:
list of SMILES strings corresponding to INCHIKEYS
list of INCHIKEYS, which failed to return a SMILES string
list of CIDs and SMILES, which were returned beyond the first CID and SMILE found for input INCHIKEY
"""
ncmpds=len(myList)
smiles_lst,cid_lst,inchikey_lst=[],[],[]
sublst=""
fail_lst=[]
discard_lst=[]
for it in range(0,ncmpds,intv) :
if (it+intv) > ncmpds :
upbnd=ncmpds
else :
upbnd=it+intv
sublst=myList[it:upbnd]
inchikey = ','.join(map(str,sublst))
url="https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/inchikey/"+inchikey+"/property/CanonicalSMILES/CSV"
try :
response = urlreq.urlopen(url)
html = response.read()
except :
fail_lst.append(inchikey)
continue
f=io.BytesIO(html)
cnt=0
for l in f :
l=l.decode("utf-8")
l=l.rstrip()
vals=l.split(',')
if vals[0] == '"CID"' :
continue
if cnt > 0:
#print("more than one SMILES returned, discarding. Appear to be multiple CID values",vals)
#print("using",cid_lst[-1],smiles_lst[-1],inchikey_lst[-1])
discard_lst.append(vals)
break
cid_lst.append(vals[0])
sstr=vals[1].replace('"','')
smiles_lst.append(vals[1])
inchikey_lst.append(myList[it+cnt])
cnt+=1
if cnt != len(sublst) :
print("warning, multiple SMILES for this inchikey key",cnt,len(sublst),sublst)
save_smiles_df=pd.DataFrame( {'CID' : cid_lst, 'standard_inchi_key' :inchikey_lst, 'smiles' : smiles_lst})
return save_smiles_df,fail_lst,discard_lst
#******************************************************************************************************************************************
def download_bioactivity_assay(myList,intv=1) :
"""Retrieve summary info on bioactivity assays.
Args:
myList (list): List of PubChem AIDs (bioactivity assay ids)
intv (1) : number of INCHIKEYS to submit queries for in one request, default is 1
Returns:
Nothing returned yet, will return basic stats to help decide whether to use assay or not
"""
ncmpds=len(myList)
smiles_lst,cid_lst,inchikey_lst=[],[],[]
sublst=""
fail_lst=[]
jsn_lst=[]
for it in range(0,ncmpds,intv) :
if (it+intv) > ncmpds :
upbnd=ncmpds
else :
upbnd=it+intv
sublst=myList[it:upbnd]
inchikey = ','.join(map(str,sublst))
url="https://pubchem.ncbi.nlm.nih.gov/rest/pug/assay/aid/"+inchikey+"/summary/JSON"
try :
response = urlreq.urlopen(url)
html = response.read()
except :
fail_lst.append(inchikey)
continue
f=io.BytesIO(html)
cnt=0
json_str=""
for l in f :
l=l.decode("utf-8")
l=l.rstrip()
json_str += l
jsn_lst.append(json_str)
return jsn_lst
# save_smiles_df=pd.DataFrame( {'CID' : cid_lst, 'standard_inchi_key' :inchikey_lst, 'smiles' : smiles_lst})
# return save_smiles_df,fail_lst,discard_lst
#******************************************************************************************************************************************
def download_SID_from_bioactivity_assay(bioassayid) :
"""Retrieve summary info on bioactivity assays.
Args:
a single bioactivity id: PubChem AIDs (bioactivity assay ids)
Returns:
Returns the sids tested on this assay
"""
myList=[bioassayid]
ncmpds=len(myList)
smiles_lst,cid_lst,inchikey_lst=[],[],[]
sublst=""
fail_lst=[]
jsn_lst=[]
intv=1
for it in range(0,ncmpds,intv) :
if (it+intv) > ncmpds :
upbnd=ncmpds
else :
upbnd=it+intv
sublst=myList[it:upbnd]
inchikey = ','.join(map(str,sublst))
url="https://pubchem.ncbi.nlm.nih.gov/rest/pug/assay/aid/"+inchikey+"/sids/JSON"
try :
response = urlreq.urlopen(url)
html = response.read()
except :
fail_lst.append(inchikey)
continue
f=io.BytesIO(html)
cnt=0
json_str=""
for l in f :
l=l.decode("utf-8")
l=l.rstrip()
json_str += l
jsn_lst.append(json_str)
res=json.loads(jsn_lst[0])
res_lst=res["InformationList"]['Information'][0]['SID']
return res_lst
#https://pubchem.ncbi.nlm.nih.gov/rest/pug/assay/aid/504526/doseresponse/CSV?sid=104169547,109967232
#******************************************************************************************************************************************
def download_dose_response_from_bioactivity(aid,sidlst) :
"""Retrieve data for assays for a select list of sids.
Args:
myList (list): a bioactivity id (aid)
sidlst (list): list of sids specified as integers
Returns:
Nothing returned yet, will return basic stats to help decide whether to use assay or not
"""
sidstr= "," . join(str(val) for val in sidlst)
myList=[sidstr]
ncmpds=len(myList)
smiles_lst,cid_lst,inchikey_lst=[],[],[]
sublst=""
fail_lst=[]
jsn_lst=[]
intv=1
for it in range(0,ncmpds,intv) :
if (it+intv) > ncmpds :
upbnd=ncmpds
else :
upbnd=it+intv
sublst=myList[it:upbnd]
inchikey = ','.join(map(str,sublst))
url="https://pubchem.ncbi.nlm.nih.gov/rest/pug/assay/aid/"+aid+"/doseresponse/CSV?sid="+inchikey
try :
response = urlreq.urlopen(url)
html = response.read()
except :
fail_lst.append(inchikey)
continue
f=io.BytesIO(html)
cnt=0
json_str=""
df=pd.read_csv(f)
jsn_lst.append(df)
return jsn_lst
#******************************************************************************************************************************************
def download_activitytype(aid,sid) :
"""Retrieve data for assays for a select list of sids.
Args:
myList (list): a bioactivity id (aid)
sidlst (list): list of sids specified as integers
Returns:
Nothing returned yet, will return basic stats to help decide whether to use assay or not
"""
myList=[sid]
ncmpds=len(myList)
smiles_lst,cid_lst,inchikey_lst=[],[],[]
sublst=""
fail_lst=[]
jsn_lst=[]
intv=1
for it in range(0,ncmpds,intv) :
if (it+intv) > ncmpds :
upbnd=ncmpds
else :
upbnd=it+intv
sublst=myList[it:upbnd]
inchikey = ','.join(map(str,sublst))
url="https://pubchem.ncbi.nlm.nih.gov/rest/pug/assay/aid/"+aid+"/CSV?sid="+inchikey
#url="https://pubchem.ncbi.nlm.nih.gov/rest/pug/assay/aid/"+aid+"/doseresponse/CSV?sid="+inchikey
try :
response = urlreq.urlopen(url)
html = response.read()
except :
fail_lst.append(inchikey)
continue
f=io.BytesIO(html)
cnt=0
json_str=""
df=pd.read_csv(f)
jsn_lst.append(df)
return jsn_lst
| [
11748,
2956,
297,
571,
13,
25927,
355,
19016,
42180,
198,
11748,
33245,
11,
17752,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
2,
41906,
17174,
17174,
17174,
4557,
1174,
198,
4299,
4321,
62,
5796,
2915,
7,
1820,
8053,
11,
600,
85,
28,
16,
8,
1058,
198,
220,
220,
220,
37227,
9781,
30227,
40091,
9447,
4146,
1546,
13042,
329,
257,
1351,
286,
5128,
3268,
3398,
40,
7336,
16309,
13,
198,
220,
220,
220,
2561,
1441,
691,
530,
9447,
4146,
1546,
4731,
583,
3268,
3398,
40,
20373,
13,
220,
1002,
612,
389,
3294,
3815,
4504,
11,
262,
717,
318,
17383,
290,
262,
1854,
389,
4504,
287,
257,
262,
27537,
62,
75,
301,
13,
220,
3268,
3398,
40,
7336,
16309,
326,
2038,
284,
1441,
257,
9447,
4146,
1546,
4731,
389,
1234,
287,
262,
2038,
62,
75,
301,
628,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
616,
8053,
357,
4868,
2599,
7343,
286,
3268,
3398,
40,
7336,
16309,
198,
220,
220,
220,
220,
220,
220,
220,
493,
85,
357,
16,
8,
1058,
1271,
286,
3268,
3398,
40,
7336,
16309,
284,
9199,
20743,
329,
287,
530,
2581,
11,
4277,
318,
352,
628,
220,
220,
220,
16409,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1351,
286,
9447,
4146,
1546,
13042,
11188,
284,
3268,
3398,
40,
7336,
16309,
198,
220,
220,
220,
220,
220,
220,
220,
1351,
286,
3268,
3398,
40,
7336,
16309,
11,
543,
4054,
284,
1441,
257,
9447,
4146,
1546,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
1351,
286,
327,
47954,
290,
9447,
4146,
1546,
11,
543,
547,
4504,
3675,
262,
717,
327,
2389,
290,
311,
8895,
2538,
1043,
329,
5128,
3268,
3398,
40,
20373,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
299,
48991,
9310,
28,
11925,
7,
1820,
8053,
8,
198,
220,
220,
220,
21845,
62,
75,
301,
11,
66,
312,
62,
75,
301,
11,
8589,
522,
88,
62,
75,
301,
41888,
38430,
4357,
21737,
198,
220,
220,
220,
850,
75,
301,
33151,
198,
220,
220,
220,
2038,
62,
75,
301,
28,
21737,
198,
220,
220,
220,
27537,
62,
75,
301,
28,
21737,
198,
220,
220,
220,
329,
340,
287,
2837,
7,
15,
11,
10782,
3149,
9310,
11,
600,
85,
8,
1058,
198,
220,
220,
220,
220,
220,
220,
220,
611,
357,
270,
10,
600,
85,
8,
1875,
299,
48991,
9310,
1058,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
510,
65,
358,
28,
10782,
3149,
9310,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
1058,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
510,
65,
358,
28,
270,
10,
600,
85,
198,
220,
220,
220,
220,
220,
220,
220,
850,
75,
301,
28,
1820,
8053,
58,
270,
25,
929,
65,
358,
60,
198,
220,
220,
220,
220,
220,
220,
220,
11111,
522,
88,
796,
705,
4032,
13,
22179,
7,
8899,
7,
2536,
11,
7266,
75,
301,
4008,
220,
198,
220,
220,
220,
220,
220,
220,
220,
19016,
2625,
5450,
1378,
12984,
15245,
13,
10782,
8482,
13,
21283,
76,
13,
37373,
13,
9567,
14,
2118,
14,
79,
1018,
14,
5589,
633,
14,
8589,
522,
88,
30487,
10,
8589,
522,
88,
10,
1,
14,
26745,
14,
6090,
261,
605,
12310,
4146,
1546,
14,
7902,
53,
1,
198,
220,
220,
220,
220,
220,
220,
220,
1949,
1058,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2882,
796,
19016,
42180,
13,
6371,
9654,
7,
6371,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27711,
796,
2882,
13,
961,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2845,
1058,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2038,
62,
75,
301,
13,
33295,
7,
8589,
522,
88,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2555,
198,
220,
220,
220,
220,
220,
220,
220,
277,
28,
952,
13,
45992,
9399,
7,
6494,
8,
198,
220,
220,
220,
220,
220,
220,
220,
269,
429,
28,
15,
198,
220,
220,
220,
220,
220,
220,
220,
329,
300,
287,
277,
1058,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
28,
75,
13,
12501,
1098,
7203,
40477,
12,
23,
4943,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
28,
75,
13,
81,
36311,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
410,
874,
28,
75,
13,
35312,
7,
3256,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
410,
874,
58,
15,
60,
6624,
705,
1,
34,
2389,
30543,
1058,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2555,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
269,
429,
1875,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
4798,
7203,
3549,
621,
530,
9447,
4146,
1546,
4504,
11,
1221,
13493,
13,
2034,
451,
284,
307,
3294,
327,
2389,
3815,
1600,
12786,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
4798,
7203,
3500,
1600,
66,
312,
62,
75,
301,
58,
12,
16,
4357,
5796,
2915,
62,
75,
301,
58,
12,
16,
4357,
8589,
522,
88,
62,
75,
301,
58,
12,
16,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27537,
62,
75,
301,
13,
33295,
7,
12786,
8,
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,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
312,
62,
75,
301,
13,
33295,
7,
12786,
58,
15,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
264,
2536,
28,
12786,
58,
16,
4083,
33491,
10786,
1,
3256,
7061,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21845,
62,
75,
301,
13,
33295,
7,
12786,
58,
16,
12962,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
11111,
522,
88,
62,
75,
301,
13,
33295,
7,
1820,
8053,
58,
270,
10,
66,
429,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
429,
47932,
16,
198,
220,
220,
220,
220,
220,
220,
220,
611,
269,
429,
14512,
18896,
7,
7266,
75,
301,
8,
1058,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
43917,
11,
3294,
9447,
4146,
1546,
329,
428,
11111,
522,
88,
1994,
1600,
66,
429,
11,
11925,
7,
7266,
75,
301,
828,
7266,
75,
301,
8,
198,
220,
220,
220,
3613,
62,
5796,
2915,
62,
7568,
28,
30094,
13,
6601,
19778,
7,
1391,
6,
34,
2389,
6,
1058,
269,
312,
62,
75,
301,
11,
705,
20307,
62,
8589,
72,
62,
2539,
6,
1058,
8589,
522,
88,
62,
75,
301,
11,
705,
5796,
2915,
6,
1058,
21845,
62,
75,
301,
30072,
198,
220,
220,
220,
1441,
3613,
62,
5796,
2915,
62,
7568,
11,
32165,
62,
75,
301,
11,
15410,
446,
62,
75,
301,
628,
198,
2,
17174,
17174,
17174,
17174,
4557,
1174,
198,
4299,
4321,
62,
65,
952,
21797,
62,
562,
323,
7,
1820,
8053,
11,
600,
85,
28,
16,
8,
1058,
198,
220,
220,
220,
37227,
9781,
30227,
10638,
7508,
319,
13401,
21797,
840,
592,
13,
628,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
616,
8053,
357,
4868,
2599,
7343,
286,
8525,
41829,
317,
47954,
357,
65,
952,
21797,
40575,
220,
2340,
8,
198,
220,
220,
220,
220,
220,
220,
220,
493,
85,
357,
16,
8,
1058,
1271,
286,
3268,
3398,
40,
7336,
16309,
284,
9199,
20743,
329,
287,
530,
2581,
11,
4277,
318,
352,
628,
220,
220,
220,
16409,
25,
198,
220,
220,
220,
220,
220,
220,
220,
10528,
4504,
1865,
11,
481,
1441,
4096,
9756,
284,
1037,
5409,
1771,
284,
779,
40575,
393,
407,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
299,
48991,
9310,
28,
11925,
7,
1820,
8053,
8,
198,
220,
220,
220,
21845,
62,
75,
301,
11,
66,
312,
62,
75,
301,
11,
8589,
522,
88,
62,
75,
301,
41888,
38430,
4357,
21737,
198,
220,
220,
220,
850,
75,
301,
33151,
198,
220,
220,
220,
2038,
62,
75,
301,
28,
21737,
198,
220,
220,
220,
474,
16184,
62,
75,
301,
28,
21737,
198,
220,
220,
220,
329,
340,
287,
2837,
7,
15,
11,
10782,
3149,
9310,
11,
600,
85,
8,
1058,
198,
220,
220,
220,
220,
220,
220,
220,
611,
357,
270,
10,
600,
85,
8,
1875,
299,
48991,
9310,
1058,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
510,
65,
358,
28,
10782,
3149,
9310,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
1058,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
510,
65,
358,
28,
270,
10,
600,
85,
198,
220,
220,
220,
220,
220,
220,
220,
850,
75,
301,
28,
1820,
8053,
58,
270,
25,
929,
65,
358,
60,
198,
220,
220,
220,
220,
220,
220,
220,
11111,
522,
88,
796,
705,
4032,
13,
22179,
7,
8899,
7,
2536,
11,
7266,
75,
301,
4008,
220,
198,
220,
220,
220,
220,
220,
220,
220,
19016,
2625,
5450,
1378,
12984,
15245,
13,
10782,
8482,
13,
21283,
76,
13,
37373,
13,
9567,
14,
2118,
14,
79,
1018,
14,
562,
323,
14,
1698,
30487,
10,
8589,
522,
88,
10,
1,
14,
49736,
14,
40386,
1,
198,
220,
220,
220,
220,
220,
220,
220,
1949,
1058,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2882,
796,
19016,
42180,
13,
6371,
9654,
7,
6371,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27711,
796,
2882,
13,
961,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2845,
1058,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2038,
62,
75,
301,
13,
33295,
7,
8589,
522,
88,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2555,
198,
220,
220,
220,
220,
220,
220,
220,
277,
28,
952,
13,
45992,
9399,
7,
6494,
8,
198,
220,
220,
220,
220,
220,
220,
220,
269,
429,
28,
15,
198,
220,
220,
220,
220,
220,
220,
220,
33918,
62,
2536,
33151,
198,
220,
220,
220,
220,
220,
220,
220,
329,
300,
287,
277,
1058,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
28,
75,
13,
12501,
1098,
7203,
40477,
12,
23,
4943,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
28,
75,
13,
81,
36311,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33918,
62,
2536,
15853,
300,
198,
220,
220,
220,
220,
220,
220,
220,
474,
16184,
62,
75,
301,
13,
33295,
7,
17752,
62,
2536,
8,
198,
220,
220,
220,
1441,
474,
16184,
62,
75,
301,
198,
2,
220,
220,
220,
3613,
62,
5796,
2915,
62,
7568,
28,
30094,
13,
6601,
19778,
7,
1391,
6,
34,
2389,
6,
1058,
269,
312,
62,
75,
301,
11,
705,
20307,
62,
8589,
72,
62,
2539,
6,
1058,
8589,
522,
88,
62,
75,
301,
11,
705,
5796,
2915,
6,
1058,
21845,
62,
75,
301,
30072,
198,
2,
220,
220,
220,
1441,
3613,
62,
5796,
2915,
62,
7568,
11,
32165,
62,
75,
301,
11,
15410,
446,
62,
75,
301,
198,
220,
220,
220,
220,
220,
198,
2,
17174,
17174,
17174,
17174,
4557,
1174,
198,
4299,
4321,
62,
50,
2389,
62,
6738,
62,
65,
952,
21797,
62,
562,
323,
7,
65,
952,
562,
323,
312,
8,
1058,
198,
220,
220,
220,
37227,
9781,
30227,
10638,
7508,
319,
13401,
21797,
840,
592,
13,
628,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
257,
2060,
13401,
21797,
4686,
25,
8525,
41829,
317,
47954,
357,
65,
952,
21797,
40575,
220,
2340,
8,
628,
220,
220,
220,
16409,
25,
198,
220,
220,
220,
220,
220,
220,
220,
16409,
262,
264,
2340,
6789,
319,
428,
40575,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
616,
8053,
41888,
65,
952,
562,
323,
312,
60,
198,
220,
220,
220,
299,
48991,
9310,
28,
11925,
7,
1820,
8053,
8,
198,
220,
220,
220,
21845,
62,
75,
301,
11,
66,
312,
62,
75,
301,
11,
8589,
522,
88,
62,
75,
301,
41888,
38430,
4357,
21737,
198,
220,
220,
220,
850,
75,
301,
33151,
198,
220,
220,
220,
2038,
62,
75,
301,
28,
21737,
198,
220,
220,
220,
474,
16184,
62,
75,
301,
28,
21737,
198,
220,
220,
220,
493,
85,
28,
16,
198,
220,
220,
220,
329,
340,
287,
2837,
7,
15,
11,
10782,
3149,
9310,
11,
600,
85,
8,
1058,
198,
220,
220,
220,
220,
220,
220,
220,
611,
357,
270,
10,
600,
85,
8,
1875,
299,
48991,
9310,
1058,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
510,
65,
358,
28,
10782,
3149,
9310,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
1058,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
510,
65,
358,
28,
270,
10,
600,
85,
198,
220,
220,
220,
220,
220,
220,
220,
850,
75,
301,
28,
1820,
8053,
58,
270,
25,
929,
65,
358,
60,
198,
220,
220,
220,
220,
220,
220,
220,
11111,
522,
88,
796,
705,
4032,
13,
22179,
7,
8899,
7,
2536,
11,
7266,
75,
301,
4008,
220,
198,
220,
220,
220,
220,
220,
220,
220,
19016,
2625,
5450,
1378,
12984,
15245,
13,
10782,
8482,
13,
21283,
76,
13,
37373,
13,
9567,
14,
2118,
14,
79,
1018,
14,
562,
323,
14,
1698,
30487,
10,
8589,
522,
88,
10,
1,
14,
82,
2340,
14,
40386,
1,
198,
220,
220,
220,
220,
220,
220,
220,
1949,
1058,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2882,
796,
19016,
42180,
13,
6371,
9654,
7,
6371,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27711,
796,
2882,
13,
961,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2845,
1058,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2038,
62,
75,
301,
13,
33295,
7,
8589,
522,
88,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2555,
198,
220,
220,
220,
220,
220,
220,
220,
277,
28,
952,
13,
45992,
9399,
7,
6494,
8,
198,
220,
220,
220,
220,
220,
220,
220,
269,
429,
28,
15,
198,
220,
220,
220,
220,
220,
220,
220,
33918,
62,
2536,
33151,
198,
220,
220,
220,
220,
220,
220,
220,
329,
300,
287,
277,
1058,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
28,
75,
13,
12501,
1098,
7203,
40477,
12,
23,
4943,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
28,
75,
13,
81,
36311,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33918,
62,
2536,
15853,
300,
198,
220,
220,
220,
220,
220,
220,
220,
474,
16184,
62,
75,
301,
13,
33295,
7,
17752,
62,
2536,
8,
198,
220,
220,
220,
581,
28,
17752,
13,
46030,
7,
8457,
77,
62,
75,
301,
58,
15,
12962,
198,
220,
220,
220,
581,
62,
75,
301,
28,
411,
14692,
21918,
8053,
1,
7131,
6,
21918,
6,
7131,
15,
7131,
6,
50,
2389,
20520,
198,
220,
220,
220,
1441,
581,
62,
75,
301,
198,
220,
220,
220,
220,
220,
198,
2,
5450,
1378,
12984,
15245,
13,
10782,
8482,
13,
21283,
76,
13,
37373,
13,
9567,
14,
2118,
14,
79,
1018,
14,
562,
323,
14,
1698,
14,
1120,
2231,
2075,
14,
34436,
26209,
14,
7902,
53,
30,
30255,
28,
13464,
1433,
3865,
2857,
11,
940,
2079,
3134,
24339,
198,
198,
2,
17174,
17174,
17174,
17174,
4557,
1174,
198,
4299,
4321,
62,
34436,
62,
26209,
62,
6738,
62,
65,
952,
21797,
7,
1698,
11,
30255,
75,
301,
8,
1058,
198,
220,
220,
220,
37227,
9781,
30227,
1366,
329,
840,
592,
329,
257,
2922,
1351,
286,
264,
2340,
13,
628,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
616,
8053,
357,
4868,
2599,
257,
13401,
21797,
4686,
357,
1698,
8,
198,
220,
220,
220,
220,
220,
220,
220,
9785,
75,
301,
357,
4868,
2599,
1351,
286,
264,
2340,
7368,
355,
37014,
628,
220,
220,
220,
16409,
25,
198,
220,
220,
220,
220,
220,
220,
220,
10528,
4504,
1865,
11,
481,
1441,
4096,
9756,
284,
1037,
5409,
1771,
284,
779,
40575,
393,
407,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
9785,
2536,
28,
366,
553,
764,
4654,
7,
2536,
7,
2100,
8,
329,
1188,
287,
9785,
75,
301,
8,
198,
220,
220,
220,
616,
8053,
41888,
30255,
2536,
60,
198,
220,
220,
220,
299,
48991,
9310,
28,
11925,
7,
1820,
8053,
8,
198,
220,
220,
220,
21845,
62,
75,
301,
11,
66,
312,
62,
75,
301,
11,
8589,
522,
88,
62,
75,
301,
41888,
38430,
4357,
21737,
198,
220,
220,
220,
850,
75,
301,
33151,
198,
220,
220,
220,
2038,
62,
75,
301,
28,
21737,
198,
220,
220,
220,
474,
16184,
62,
75,
301,
28,
21737,
198,
220,
220,
220,
493,
85,
28,
16,
198,
220,
220,
220,
329,
340,
287,
2837,
7,
15,
11,
10782,
3149,
9310,
11,
600,
85,
8,
1058,
198,
220,
220,
220,
220,
220,
220,
220,
611,
357,
270,
10,
600,
85,
8,
1875,
299,
48991,
9310,
1058,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
510,
65,
358,
28,
10782,
3149,
9310,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
1058,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
510,
65,
358,
28,
270,
10,
600,
85,
198,
220,
220,
220,
220,
220,
220,
220,
850,
75,
301,
28,
1820,
8053,
58,
270,
25,
929,
65,
358,
60,
198,
220,
220,
220,
220,
220,
220,
220,
11111,
522,
88,
796,
705,
4032,
13,
22179,
7,
8899,
7,
2536,
11,
7266,
75,
301,
4008,
220,
198,
220,
220,
220,
220,
220,
220,
220,
19016,
2625,
5450,
1378,
12984,
15245,
13,
10782,
8482,
13,
21283,
76,
13,
37373,
13,
9567,
14,
2118,
14,
79,
1018,
14,
562,
323,
14,
1698,
30487,
10,
1698,
10,
1,
14,
34436,
26209,
14,
7902,
53,
30,
30255,
2625,
10,
8589,
522,
88,
198,
220,
220,
220,
220,
220,
220,
220,
1949,
1058,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2882,
796,
19016,
42180,
13,
6371,
9654,
7,
6371,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27711,
796,
2882,
13,
961,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2845,
1058,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2038,
62,
75,
301,
13,
33295,
7,
8589,
522,
88,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2555,
198,
220,
220,
220,
220,
220,
220,
220,
277,
28,
952,
13,
45992,
9399,
7,
6494,
8,
198,
220,
220,
220,
220,
220,
220,
220,
269,
429,
28,
15,
198,
220,
220,
220,
220,
220,
220,
220,
33918,
62,
2536,
33151,
198,
220,
220,
220,
220,
220,
220,
220,
47764,
28,
30094,
13,
961,
62,
40664,
7,
69,
8,
198,
220,
220,
220,
220,
220,
220,
220,
474,
16184,
62,
75,
301,
13,
33295,
7,
7568,
8,
198,
220,
220,
220,
1441,
474,
16184,
62,
75,
301,
628,
198,
2,
17174,
17174,
17174,
17174,
4557,
1174,
198,
4299,
4321,
62,
21797,
4906,
7,
1698,
11,
30255,
8,
1058,
198,
220,
220,
220,
37227,
9781,
30227,
1366,
329,
840,
592,
329,
257,
2922,
1351,
286,
264,
2340,
13,
628,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
616,
8053,
357,
4868,
2599,
257,
13401,
21797,
4686,
357,
1698,
8,
198,
220,
220,
220,
220,
220,
220,
220,
9785,
75,
301,
357,
4868,
2599,
1351,
286,
264,
2340,
7368,
355,
37014,
628,
220,
220,
220,
16409,
25,
198,
220,
220,
220,
220,
220,
220,
220,
10528,
4504,
1865,
11,
481,
1441,
4096,
9756,
284,
1037,
5409,
1771,
284,
779,
40575,
393,
407,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
616,
8053,
41888,
30255,
60,
198,
220,
220,
220,
299,
48991,
9310,
28,
11925,
7,
1820,
8053,
8,
198,
220,
220,
220,
21845,
62,
75,
301,
11,
66,
312,
62,
75,
301,
11,
8589,
522,
88,
62,
75,
301,
41888,
38430,
4357,
21737,
198,
220,
220,
220,
850,
75,
301,
33151,
198,
220,
220,
220,
2038,
62,
75,
301,
28,
21737,
198,
220,
220,
220,
474,
16184,
62,
75,
301,
28,
21737,
198,
220,
220,
220,
493,
85,
28,
16,
198,
220,
220,
220,
329,
340,
287,
2837,
7,
15,
11,
10782,
3149,
9310,
11,
600,
85,
8,
1058,
198,
220,
220,
220,
220,
220,
220,
220,
611,
357,
270,
10,
600,
85,
8,
1875,
299,
48991,
9310,
1058,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
510,
65,
358,
28,
10782,
3149,
9310,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
1058,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
510,
65,
358,
28,
270,
10,
600,
85,
198,
220,
220,
220,
220,
220,
220,
220,
850,
75,
301,
28,
1820,
8053,
58,
270,
25,
929,
65,
358,
60,
198,
220,
220,
220,
220,
220,
220,
220,
11111,
522,
88,
796,
705,
4032,
13,
22179,
7,
8899,
7,
2536,
11,
7266,
75,
301,
4008,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
19016,
2625,
5450,
1378,
12984,
15245,
13,
10782,
8482,
13,
21283,
76,
13,
37373,
13,
9567,
14,
2118,
14,
79,
1018,
14,
562,
323,
14,
1698,
30487,
10,
1698,
10,
1,
14,
7902,
53,
30,
30255,
2625,
10,
8589,
522,
88,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
6371,
2625,
5450,
1378,
12984,
15245,
13,
10782,
8482,
13,
21283,
76,
13,
37373,
13,
9567,
14,
2118,
14,
79,
1018,
14,
562,
323,
14,
1698,
30487,
10,
1698,
10,
1,
14,
34436,
26209,
14,
7902,
53,
30,
30255,
2625,
10,
8589,
522,
88,
198,
220,
220,
220,
220,
220,
220,
220,
1949,
1058,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2882,
796,
19016,
42180,
13,
6371,
9654,
7,
6371,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27711,
796,
2882,
13,
961,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2845,
1058,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2038,
62,
75,
301,
13,
33295,
7,
8589,
522,
88,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2555,
198,
220,
220,
220,
220,
220,
220,
220,
277,
28,
952,
13,
45992,
9399,
7,
6494,
8,
198,
220,
220,
220,
220,
220,
220,
220,
269,
429,
28,
15,
198,
220,
220,
220,
220,
220,
220,
220,
33918,
62,
2536,
33151,
198,
220,
220,
220,
220,
220,
220,
220,
47764,
28,
30094,
13,
961,
62,
40664,
7,
69,
8,
198,
220,
220,
220,
220,
220,
220,
220,
474,
16184,
62,
75,
301,
13,
33295,
7,
7568,
8,
198,
220,
220,
220,
1441,
474,
16184,
62,
75,
301,
198
] | 2.080595 | 3,896 |
# main imports
import numpy as np
import pandas as pd
import sys, os, argparse
import subprocess
import time
import json
# models imports
from sklearn.utils import shuffle
from sklearn.externals import joblib
from sklearn.metrics import accuracy_score, f1_score, recall_score, roc_auc_score
from sklearn.model_selection import cross_val_score
from sklearn.model_selection import StratifiedKFold
from sklearn.model_selection import train_test_split
# image processing imports
from ipfml import processing
from PIL import Image
# modules imports
sys.path.insert(0, '') # trick to enable import of main folder module
import custom_config as cfg
# variables and parameters
threshold_map_folder = cfg.threshold_map_folder
threshold_map_file_prefix = cfg.threshold_map_folder + "_"
markdowns_folder = cfg.models_information_folder
final_csv_model_comparisons = cfg.csv_model_comparisons_filename
models_name = cfg.models_names_list
zones = cfg.zones_indices
current_dirpath = os.getcwd()
if __name__== "__main__":
main()
| [
2,
1388,
17944,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
11748,
25064,
11,
28686,
11,
1822,
29572,
198,
11748,
850,
14681,
198,
11748,
640,
198,
11748,
33918,
198,
198,
2,
4981,
17944,
198,
6738,
1341,
35720,
13,
26791,
1330,
36273,
198,
6738,
1341,
35720,
13,
1069,
759,
874,
1330,
1693,
8019,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
9922,
62,
26675,
11,
277,
16,
62,
26675,
11,
10014,
62,
26675,
11,
686,
66,
62,
14272,
62,
26675,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
3272,
62,
2100,
62,
26675,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
29186,
1431,
42,
37,
727,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
4512,
62,
9288,
62,
35312,
198,
198,
2,
2939,
7587,
17944,
198,
6738,
20966,
38122,
1330,
7587,
198,
6738,
350,
4146,
1330,
7412,
198,
198,
2,
13103,
17944,
198,
17597,
13,
6978,
13,
28463,
7,
15,
11,
10148,
8,
1303,
6908,
284,
7139,
1330,
286,
1388,
9483,
8265,
198,
198,
11748,
2183,
62,
11250,
355,
30218,
70,
198,
198,
2,
9633,
290,
10007,
198,
400,
10126,
62,
8899,
62,
43551,
220,
220,
220,
220,
220,
220,
220,
796,
30218,
70,
13,
400,
10126,
62,
8899,
62,
43551,
198,
400,
10126,
62,
8899,
62,
7753,
62,
40290,
220,
220,
796,
30218,
70,
13,
400,
10126,
62,
8899,
62,
43551,
1343,
45434,
1,
198,
198,
4102,
30371,
62,
43551,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
30218,
70,
13,
27530,
62,
17018,
62,
43551,
198,
20311,
62,
40664,
62,
19849,
62,
785,
1845,
9886,
796,
30218,
70,
13,
40664,
62,
19849,
62,
785,
1845,
9886,
62,
34345,
198,
27530,
62,
3672,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
30218,
70,
13,
27530,
62,
14933,
62,
4868,
198,
198,
89,
1952,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
30218,
70,
13,
89,
1952,
62,
521,
1063,
198,
198,
14421,
62,
15908,
6978,
796,
28686,
13,
1136,
66,
16993,
3419,
628,
198,
198,
361,
11593,
3672,
834,
855,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419,
198
] | 2.865789 | 380 |
/home/runner/.cache/pip/pool/b7/df/1e/7980259571f5a43b5ac0c36215dfc4b1485986d14af13b40a821ae930f | [
14,
11195,
14,
16737,
11757,
23870,
14,
79,
541,
14,
7742,
14,
65,
22,
14,
7568,
14,
16,
68,
14,
3720,
1795,
25191,
42875,
69,
20,
64,
3559,
65,
20,
330,
15,
66,
2623,
23349,
7568,
66,
19,
65,
18294,
3270,
4521,
67,
1415,
1878,
1485,
65,
1821,
64,
23,
2481,
3609,
45418,
69
] | 1.777778 | 54 |
# Ashwin Chidambaram ##
# Task: Find the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum ##
##################################################################################################################################
# Self assesment on program runtime ##
import time ##
start_time = time.time() ##
######################################
# Create a list to contain natural numbers from 1 - 100
nnums = []
sumS = 0
squareS = 0
# Populate the list
i = 0
# Create a while loop to iterate and fill list
while i != 100:
# Increment i
i += 1
# Add i to list
nnums.append(i)
# Find the sum of the squares and sum of all nums (not squared yet)
for value in nnums:
sumS = sumS + (value ** 2)
squareS = squareS + value
# Square sum of all numbers
squareS = squareS ** 2
# End runtime measure
runtime = time.time() - start_time
# Print output
print('The difference is: {}'.format(squareS - sumS))
# Print runtime
print('RunTime: {} seconds'.format(round(runtime,4)))
| [
2,
7844,
5404,
609,
312,
4131,
41158,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
22492,
198,
2,
15941,
25,
9938,
262,
3580,
1022,
262,
2160,
286,
262,
24438,
286,
262,
717,
530,
3470,
3288,
3146,
290,
262,
6616,
286,
262,
2160,
220,
220,
22492,
198,
29113,
29113,
29113,
29113,
2235,
198,
2,
12189,
50201,
434,
319,
1430,
19124,
22492,
198,
11748,
640,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
22492,
198,
9688,
62,
2435,
796,
640,
13,
2435,
3419,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
22492,
198,
29113,
4242,
2235,
198,
198,
2,
13610,
257,
1351,
284,
3994,
3288,
3146,
422,
352,
532,
1802,
198,
20471,
5700,
796,
17635,
198,
16345,
50,
796,
657,
198,
23415,
50,
796,
657,
198,
198,
2,
8099,
5039,
262,
1351,
198,
72,
796,
657,
198,
198,
2,
13610,
257,
981,
9052,
284,
11629,
378,
290,
6070,
1351,
198,
4514,
1312,
14512,
1802,
25,
628,
220,
220,
220,
1303,
10791,
434,
1312,
198,
220,
220,
220,
1312,
15853,
352,
628,
220,
220,
220,
1303,
3060,
1312,
284,
1351,
198,
220,
220,
220,
299,
77,
5700,
13,
33295,
7,
72,
8,
198,
198,
2,
9938,
262,
2160,
286,
262,
24438,
290,
2160,
286,
477,
997,
82,
357,
1662,
44345,
1865,
8,
198,
1640,
1988,
287,
299,
77,
5700,
25,
198,
220,
220,
220,
2160,
50,
796,
2160,
50,
1343,
357,
8367,
12429,
362,
8,
198,
220,
220,
220,
6616,
50,
796,
6616,
50,
1343,
1988,
198,
198,
2,
9276,
2160,
286,
477,
3146,
198,
23415,
50,
796,
6616,
50,
12429,
362,
198,
198,
2,
5268,
19124,
3953,
198,
43282,
796,
640,
13,
2435,
3419,
532,
923,
62,
2435,
198,
198,
2,
12578,
5072,
198,
4798,
10786,
464,
3580,
318,
25,
23884,
4458,
18982,
7,
23415,
50,
532,
2160,
50,
4008,
198,
198,
2,
12578,
19124,
198,
4798,
10786,
10987,
7575,
25,
23884,
4201,
4458,
18982,
7,
744,
7,
43282,
11,
19,
22305,
198
] | 2.735763 | 439 |
import tequila as tq
import numpy as np
import typing
| [
11748,
573,
43652,
355,
256,
80,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19720,
628,
198
] | 3.294118 | 17 |
# These need to be at the top to allow for running on cluster
import os
import random
import sys
cwd = os.getcwd()
sys.path.append(cwd)
# Other imports
import json
import getopt
from h_captionmodel import CaptionModel
import pickle
import time
import tensorflow.keras.backend as K
arguments = getopt.getopt(sys.argv[1:], shortopts='j:')
print(arguments)
# Get different config files
config_files = arguments[0][0][1].split("-")
config_files = [l.strip() for l in config_files]
print(" CONFIGURATIONS: ", config_files)
# Allows to loop over several configurations so I don't need to monitor this.
for file in config_files:
path_to_config_file = os.path.join(cwd, "CONFIGS", f"{file[:2].lower()}_configs", file)
#
with open(path_to_config_file, 'r') as f:
config = json.load(f)
print(config)
print("Initializing model...")
config["force_cropped"] = True
captmodel = CaptionModel(config)
# For chapter 6.4
captmodel.force_cropped = True
print("Building architecture...")
# Build Model
captmodel.build_model(save_plot=False)
weights_path = os.path.join(cwd, "models", "Weights", captmodel.webshop_name,
config["output_name"] + "_best_weights.h5")
batch_size = config["batch_size"]
print(weights_path)
print("Loading weights...")
# Load weights
captmodel.load_weights(weights_path)
if captmodel.architecture_type == "attention":
batch_size = 32
wpath = os.path.join(cwd, "models", "Weights", captmodel.webshop_name)
captmodel.inference_model.load_weights(os.path.join(wpath, config["output_name"] + "inference_best_Weights.h5"))
captmodel.initstate_model.load_weights(os.path.join(wpath, config["output_name"] + "initstate_best_Weights.h5"))
print(f"Evaluating model on {len(captmodel.test_imgs)} validation images")
# Evaluate using the validation set
start = time.time()
# results_dict = captmodel.evaluate_model(BLEU=True, ROUGE=True, img_list=captmodel.val_imgs, nr_steps=64, beam=3)
# with open(os.path.join(cwd, "models", "Output", captmodel.webshop_name, "results",
# f"test_results_dict_{file[:-4]}json"), 'w') as f:
# json.dump(results_dict, f)
# end_beam = time.time()
# print(f"Predicting val set with beam took {end_beam - start} time.")
results_dict = captmodel.evaluate_model(BLEU=True, ROUGE=True, img_list=captmodel.test_imgs,
beam=False, batch_size=batch_size)
end_greedy = time.time()
print(f"Predicting val set with greedy took {end_greedy - start} time.")
# Save results_dict
with open(os.path.join(cwd, "models", "Output", captmodel.webshop_name, "results",
f"results_dict{file[:-4]}_cropped.json"), 'w') as f:
json.dump(results_dict, f)
K.clear_session()
| [
2,
2312,
761,
284,
307,
379,
262,
1353,
284,
1249,
329,
2491,
319,
13946,
201,
198,
11748,
28686,
201,
198,
11748,
4738,
201,
198,
11748,
25064,
201,
198,
201,
198,
66,
16993,
796,
28686,
13,
1136,
66,
16993,
3419,
201,
198,
17597,
13,
6978,
13,
33295,
7,
66,
16993,
8,
201,
198,
201,
198,
2,
3819,
17944,
201,
198,
11748,
33918,
201,
198,
11748,
651,
8738,
201,
198,
6738,
289,
62,
6888,
1159,
19849,
1330,
11260,
17633,
201,
198,
11748,
2298,
293,
201,
198,
11748,
640,
201,
198,
11748,
11192,
273,
11125,
13,
6122,
292,
13,
1891,
437,
355,
509,
201,
198,
201,
198,
853,
2886,
796,
651,
8738,
13,
1136,
8738,
7,
17597,
13,
853,
85,
58,
16,
25,
4357,
1790,
404,
912,
11639,
73,
25,
11537,
201,
198,
4798,
7,
853,
2886,
8,
201,
198,
201,
198,
2,
3497,
1180,
4566,
3696,
201,
198,
201,
198,
11250,
62,
16624,
796,
7159,
58,
15,
7131,
15,
7131,
16,
4083,
35312,
7203,
12,
4943,
201,
198,
11250,
62,
16624,
796,
685,
75,
13,
36311,
3419,
329,
300,
287,
4566,
62,
16624,
60,
201,
198,
201,
198,
4798,
7203,
25626,
4261,
18421,
25,
220,
220,
33172,
4566,
62,
16624,
8,
201,
198,
2,
40402,
284,
9052,
625,
1811,
25412,
523,
314,
836,
470,
761,
284,
5671,
428,
13,
201,
198,
1640,
2393,
287,
4566,
62,
16624,
25,
201,
198,
220,
220,
220,
3108,
62,
1462,
62,
11250,
62,
7753,
796,
28686,
13,
6978,
13,
22179,
7,
66,
16993,
11,
366,
10943,
16254,
50,
1600,
277,
1,
90,
7753,
58,
25,
17,
4083,
21037,
3419,
92,
62,
11250,
82,
1600,
2393,
8,
201,
198,
220,
220,
220,
1303,
201,
198,
220,
220,
220,
351,
1280,
7,
6978,
62,
1462,
62,
11250,
62,
7753,
11,
705,
81,
11537,
355,
277,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
4566,
796,
33918,
13,
2220,
7,
69,
8,
201,
198,
220,
220,
220,
3601,
7,
11250,
8,
201,
198,
220,
220,
220,
3601,
7203,
24243,
2890,
2746,
9313,
8,
201,
198,
220,
220,
220,
4566,
14692,
3174,
62,
19915,
1496,
8973,
796,
6407,
201,
198,
220,
220,
220,
3144,
19849,
796,
11260,
17633,
7,
11250,
8,
201,
198,
201,
198,
220,
220,
220,
1303,
1114,
6843,
718,
13,
19,
201,
198,
220,
220,
220,
3144,
19849,
13,
3174,
62,
19915,
1496,
796,
6407,
201,
198,
201,
198,
220,
220,
220,
3601,
7203,
25954,
10959,
9313,
8,
201,
198,
220,
220,
220,
1303,
10934,
9104,
201,
198,
220,
220,
220,
3144,
19849,
13,
11249,
62,
19849,
7,
21928,
62,
29487,
28,
25101,
8,
201,
198,
201,
198,
220,
220,
220,
19590,
62,
6978,
796,
28686,
13,
6978,
13,
22179,
7,
66,
16993,
11,
366,
27530,
1600,
366,
1135,
2337,
1600,
3144,
19849,
13,
732,
1443,
8548,
62,
3672,
11,
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,
4566,
14692,
22915,
62,
3672,
8973,
1343,
45434,
13466,
62,
43775,
13,
71,
20,
4943,
201,
198,
220,
220,
220,
15458,
62,
7857,
796,
4566,
14692,
43501,
62,
7857,
8973,
201,
198,
220,
220,
220,
3601,
7,
43775,
62,
6978,
8,
201,
198,
220,
220,
220,
3601,
7203,
19031,
19590,
9313,
8,
201,
198,
220,
220,
220,
1303,
8778,
19590,
201,
198,
220,
220,
220,
3144,
19849,
13,
2220,
62,
43775,
7,
43775,
62,
6978,
8,
201,
198,
220,
220,
220,
611,
3144,
19849,
13,
998,
5712,
495,
62,
4906,
6624,
366,
1078,
1463,
1298,
201,
198,
220,
220,
220,
220,
220,
220,
220,
15458,
62,
7857,
796,
3933,
201,
198,
220,
220,
220,
220,
220,
220,
220,
266,
6978,
796,
28686,
13,
6978,
13,
22179,
7,
66,
16993,
11,
366,
27530,
1600,
366,
1135,
2337,
1600,
3144,
19849,
13,
732,
1443,
8548,
62,
3672,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
3144,
19849,
13,
259,
4288,
62,
19849,
13,
2220,
62,
43775,
7,
418,
13,
6978,
13,
22179,
7,
86,
6978,
11,
4566,
14692,
22915,
62,
3672,
8973,
1343,
366,
259,
4288,
62,
13466,
62,
1135,
2337,
13,
71,
20,
48774,
201,
198,
220,
220,
220,
220,
220,
220,
220,
3144,
19849,
13,
15003,
5219,
62,
19849,
13,
2220,
62,
43775,
7,
418,
13,
6978,
13,
22179,
7,
86,
6978,
11,
4566,
14692,
22915,
62,
3672,
8973,
1343,
366,
15003,
5219,
62,
13466,
62,
1135,
2337,
13,
71,
20,
48774,
201,
198,
220,
220,
220,
3601,
7,
69,
1,
36,
2100,
11927,
2746,
319,
1391,
11925,
7,
27144,
19849,
13,
9288,
62,
9600,
82,
38165,
21201,
4263,
4943,
201,
198,
220,
220,
220,
1303,
26439,
4985,
1262,
262,
21201,
900,
201,
198,
220,
220,
220,
923,
796,
640,
13,
2435,
3419,
201,
198,
220,
220,
220,
1303,
2482,
62,
11600,
796,
3144,
19849,
13,
49786,
62,
19849,
7,
19146,
52,
28,
17821,
11,
371,
2606,
8264,
28,
17821,
11,
33705,
62,
4868,
28,
27144,
19849,
13,
2100,
62,
9600,
82,
11,
299,
81,
62,
20214,
28,
2414,
11,
15584,
28,
18,
8,
201,
198,
220,
220,
220,
1303,
351,
1280,
7,
418,
13,
6978,
13,
22179,
7,
66,
16993,
11,
366,
27530,
1600,
366,
26410,
1600,
3144,
19849,
13,
732,
1443,
8548,
62,
3672,
11,
366,
43420,
1600,
201,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
1,
9288,
62,
43420,
62,
11600,
23330,
7753,
58,
21912,
19,
48999,
17752,
12340,
705,
86,
11537,
355,
277,
25,
201,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
33918,
13,
39455,
7,
43420,
62,
11600,
11,
277,
8,
201,
198,
220,
220,
220,
1303,
886,
62,
40045,
796,
640,
13,
2435,
3419,
201,
198,
220,
220,
220,
1303,
3601,
7,
69,
1,
47,
17407,
278,
1188,
900,
351,
15584,
1718,
1391,
437,
62,
40045,
532,
923,
92,
640,
19570,
201,
198,
201,
198,
201,
198,
220,
220,
220,
2482,
62,
11600,
796,
3144,
19849,
13,
49786,
62,
19849,
7,
19146,
52,
28,
17821,
11,
371,
2606,
8264,
28,
17821,
11,
33705,
62,
4868,
28,
27144,
19849,
13,
9288,
62,
9600,
82,
11,
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,
220,
220,
220,
220,
220,
220,
220,
15584,
28,
25101,
11,
15458,
62,
7857,
28,
43501,
62,
7857,
8,
201,
198,
201,
198,
220,
220,
220,
886,
62,
16694,
4716,
796,
640,
13,
2435,
3419,
201,
198,
220,
220,
220,
3601,
7,
69,
1,
47,
17407,
278,
1188,
900,
351,
31828,
1718,
1391,
437,
62,
16694,
4716,
532,
923,
92,
640,
19570,
201,
198,
220,
220,
220,
1303,
12793,
2482,
62,
11600,
201,
198,
220,
220,
220,
351,
1280,
7,
418,
13,
6978,
13,
22179,
7,
66,
16993,
11,
366,
27530,
1600,
366,
26410,
1600,
3144,
19849,
13,
732,
1443,
8548,
62,
3672,
11,
366,
43420,
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,
277,
1,
43420,
62,
11600,
90,
7753,
58,
21912,
19,
48999,
62,
19915,
1496,
13,
17752,
12340,
705,
86,
11537,
355,
277,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
33918,
13,
39455,
7,
43420,
62,
11600,
11,
277,
8,
201,
198,
220,
220,
220,
509,
13,
20063,
62,
29891,
3419,
201,
198,
201,
198
] | 2.356013 | 1,264 |
#! /usr/bin/python3
import os
import telegram_send
import requests
from datetime import date,datetime
from time import time,ctime,sleep
#Refresh Interval in seconds
ref_interval = 5
d_today = date.today()
age_limit = 18
__district_code = "363"
dt = d_today.strftime("%d/%m/%Y")
__date_today = str(dt).replace("/","-")
time_now = datetime.now()
if __name__ == '__main__':
check_slot()
while True:
diff = datetime.now()-time_now
if diff.seconds >= ref_interval:
check_slot()
time_now = datetime.now()
| [
2,
0,
1220,
14629,
14,
8800,
14,
29412,
18,
198,
11748,
28686,
198,
11748,
573,
30536,
62,
21280,
198,
11748,
7007,
198,
6738,
4818,
8079,
1330,
3128,
11,
19608,
8079,
198,
6738,
640,
1330,
640,
11,
310,
524,
11,
42832,
198,
198,
2,
8134,
3447,
4225,
2100,
287,
4201,
198,
5420,
62,
3849,
2100,
796,
642,
198,
198,
67,
62,
40838,
796,
3128,
13,
40838,
3419,
198,
198,
496,
62,
32374,
796,
1248,
198,
198,
834,
17080,
2012,
62,
8189,
796,
366,
35447,
1,
198,
198,
28664,
796,
288,
62,
40838,
13,
2536,
31387,
7203,
4,
67,
14,
4,
76,
14,
4,
56,
4943,
198,
198,
834,
4475,
62,
40838,
796,
965,
7,
28664,
737,
33491,
7203,
14,
2430,
12,
4943,
198,
197,
197,
197,
197,
198,
198,
2435,
62,
2197,
796,
4818,
8079,
13,
2197,
3419,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
197,
9122,
62,
43384,
3419,
198,
197,
4514,
6407,
25,
198,
197,
197,
26069,
796,
4818,
8079,
13,
2197,
3419,
12,
2435,
62,
2197,
198,
197,
197,
361,
814,
13,
43012,
18189,
1006,
62,
3849,
2100,
25,
198,
197,
197,
197,
9122,
62,
43384,
3419,
198,
197,
197,
197,
2435,
62,
2197,
796,
4818,
8079,
13,
2197,
3419,
198
] | 2.514423 | 208 |
import sys
print ("#icebucketchallenge vs #alsicebucketchallenge, percentage change")
print_change(200,500,100,300)
print_change(500,2000,300,1500)
print_change(2000,12000,1500,13000)
print_change(12000,24000,13000,25000)
print_change(24000,65000,25000,105000)
print_change(65000,70000,105000,85000)
# read the last test case from an input file (if provided)
if (len(sys.argv) > 1):
inputfile=sys.argv[1]
f=open(inputfile,"r")
contents=f.read().split(",")
o1=int(contents[0],10)
n1=int(contents[1],10)
o2=int(contents[2],10)
n2=int(contents[3],10)
print_change(o1,n1,o2,n2)
| [
11748,
25064,
198,
198,
4798,
5855,
2,
501,
27041,
7569,
439,
3540,
3691,
1303,
874,
501,
27041,
7569,
439,
3540,
11,
5873,
1487,
4943,
198,
4798,
62,
3803,
7,
2167,
11,
4059,
11,
3064,
11,
6200,
8,
198,
4798,
62,
3803,
7,
4059,
11,
11024,
11,
6200,
11,
33698,
8,
198,
4798,
62,
3803,
7,
11024,
11,
1065,
830,
11,
33698,
11,
1485,
830,
8,
198,
4798,
62,
3803,
7,
1065,
830,
11,
1731,
830,
11,
1485,
830,
11,
1495,
830,
8,
198,
4798,
62,
3803,
7,
1731,
830,
11,
2996,
830,
11,
1495,
830,
11,
13348,
830,
8,
198,
4798,
62,
3803,
7,
2996,
830,
11,
22,
2388,
11,
13348,
830,
11,
5332,
830,
8,
198,
198,
2,
1100,
262,
938,
1332,
1339,
422,
281,
5128,
2393,
357,
361,
2810,
8,
198,
361,
357,
11925,
7,
17597,
13,
853,
85,
8,
1875,
352,
2599,
198,
220,
220,
220,
5128,
7753,
28,
17597,
13,
853,
85,
58,
16,
60,
198,
220,
220,
220,
277,
28,
9654,
7,
15414,
7753,
553,
81,
4943,
198,
220,
220,
220,
10154,
28,
69,
13,
961,
22446,
35312,
7,
2430,
8,
628,
220,
220,
220,
267,
16,
28,
600,
7,
3642,
658,
58,
15,
4357,
940,
8,
198,
220,
220,
220,
299,
16,
28,
600,
7,
3642,
658,
58,
16,
4357,
940,
8,
198,
220,
220,
220,
267,
17,
28,
600,
7,
3642,
658,
58,
17,
4357,
940,
8,
198,
220,
220,
220,
299,
17,
28,
600,
7,
3642,
658,
58,
18,
4357,
940,
8,
628,
220,
220,
220,
3601,
62,
3803,
7,
78,
16,
11,
77,
16,
11,
78,
17,
11,
77,
17,
8,
198
] | 2.250923 | 271 |
#!/usr/bin/env python
from setuptools import setup
import gscholar
setup(name='gscholar',
version=gscholar.__VERSION__,
description='Python library to query Google Scholar.',
long_description='This package provides a python package and CLI to query google scholar and get references in various formats (e.g. bibtex, endnote, etc.)',
classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.6',
],
keywords='google scholar cli',
author='Bastian Venthur',
author_email='[email protected]',
url='https://github.com/venthur/gscholar',
packages=['gscholar'],
entry_points={
'console_scripts': [
'gscholar = gscholar.__main__:main'
]
},
license='MIT',
)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
628,
198,
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
11748,
308,
20601,
6192,
198,
198,
40406,
7,
3672,
11639,
14542,
354,
6192,
3256,
198,
220,
220,
220,
220,
220,
2196,
28,
14542,
354,
6192,
13,
834,
43717,
834,
11,
198,
220,
220,
220,
220,
220,
6764,
11639,
37906,
5888,
284,
12405,
3012,
11713,
2637,
11,
198,
220,
220,
220,
220,
220,
890,
62,
11213,
11639,
1212,
5301,
3769,
257,
21015,
5301,
290,
43749,
284,
12405,
23645,
15606,
290,
651,
10288,
287,
2972,
17519,
357,
68,
13,
70,
13,
275,
571,
16886,
11,
886,
11295,
11,
3503,
2014,
3256,
198,
220,
220,
220,
220,
220,
1398,
13350,
41888,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
41206,
12678,
7904,
642,
532,
19174,
14,
1273,
540,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
34156,
7904,
7294,
40,
20010,
1079,
7904,
17168,
13789,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
15167,
2229,
15417,
7904,
11361,
7904,
362,
13,
22,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
15167,
2229,
15417,
7904,
11361,
7904,
513,
13,
21,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16589,
198,
220,
220,
220,
220,
220,
26286,
11639,
13297,
15606,
537,
72,
3256,
198,
220,
220,
220,
220,
220,
1772,
11639,
33,
459,
666,
569,
7944,
333,
3256,
198,
220,
220,
220,
220,
220,
1772,
62,
12888,
11639,
4529,
31,
20987,
333,
13,
2934,
3256,
198,
220,
220,
220,
220,
220,
19016,
11639,
5450,
1378,
12567,
13,
785,
14,
20987,
333,
14,
14542,
354,
6192,
3256,
198,
220,
220,
220,
220,
220,
10392,
28,
17816,
14542,
354,
6192,
6,
4357,
198,
220,
220,
220,
220,
220,
5726,
62,
13033,
34758,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
41947,
62,
46521,
10354,
685,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
14542,
354,
6192,
796,
308,
20601,
6192,
13,
834,
12417,
834,
25,
12417,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2361,
198,
220,
220,
220,
220,
220,
8964,
198,
220,
220,
220,
220,
220,
5964,
11639,
36393,
3256,
198,
8,
198
] | 2.466844 | 377 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012 Homer Strong, Radim Rehurek
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""This module implements the "hashing trick" [1]_ -- a mapping between words and their integer ids
using a fixed and static mapping.
Notes
-----
The static mapping has a constant memory footprint, regardless of the number of word-types (features) in your corpus,
so it's suitable for processing extremely large corpora. The ids are computed as `hash(word) % id_range`,
where `hash` is a user-configurable function (`zlib.adler32` by default).
Advantages:
* New words can be represented immediately, without an extra pass through the corpus
to collect all the ids first.
* Can be used with non-repeatable (once-only) streams of documents.
* All tokens will be used (not only that you see in documents), typical problem
for :class:`~gensim.corpora.dictionary.Dictionary`.
Disadvantages:
* Words may map to the same id, causing hash collisions. The word <-> id mapping is no longer a bijection.
References
----------
.. [1] http://en.wikipedia.org/wiki/Hashing-Trick
"""
from __future__ import with_statement
import logging
import itertools
import zlib
from gensim import utils
from six import iteritems, iterkeys
logger = logging.getLogger(__name__)
class HashDictionary(utils.SaveLoad, dict):
"""Encapsulates the mapping between normalized words and their integer ids.
Notes
-----
Unlike :class:`~gensim.corpora.dictionary.Dictionary`,
building a :class:`~gensim.corpora.hashdictionary.HashDictionary` before using it **isn't a necessary step**.
The documents can be computed immediately, from an uninitialized
:class:`~gensim.corpora.hashdictionary.HashDictionary` without seeing the rest of the corpus first.
Examples
--------
>>> from gensim.corpora import HashDictionary
>>>
>>> texts = [['human', 'interface', 'computer']]
>>> dct = HashDictionary(texts)
>>> dct.doc2bow(texts[0])
[(10608, 1), (12466, 1), (31002, 1)]
"""
def __init__(self, documents=None, id_range=32000, myhash=zlib.adler32, debug=True):
"""
Parameters
----------
documents : iterable of iterable of str
Iterable of documents, if given - use them to initialization.
id_range : int, optional
Number of hash-values in table, used as `id = myhash(key) % id_range`.
myhash : function
Hash function, should support interface myhash(str) -> int, used `zlib.adler32` by default.
debug : bool
If True - store raw tokens mapping (as str <-> id).
If you find yourself running out of memory (or not sure that you really need raw tokens), set `debug=False`.
"""
self.myhash = myhash # hash fnc: string->integer
self.id_range = id_range # hash range: id = myhash(key) % id_range
self.debug = debug
# the following (potentially massive!) dictionaries are only formed if `debug` is True
self.token2id = {}
self.id2token = {} # reverse mapping int->set(words)
self.dfs = {} # token_id -> how many documents this token_id appeared in
self.dfs_debug = {} # token_string->how many documents this word appeared in
self.num_docs = 0 # number of documents processed
self.num_pos = 0 # total number of corpus positions
self.num_nnz = 0 # total number of non-zeroes in the BOW matrix
self.allow_update = True
if documents is not None:
self.add_documents(documents)
def __getitem__(self, tokenid):
"""Get all words that have mapped to the given id so far, as a set.
Warnings
--------
Works only if `debug=True`.
Parameters
----------
tokenid : int
Token identifier (result of hashing).
Return
------
set of str
Set of all corresponding words.
"""
return self.id2token.get(tokenid, set())
def restricted_hash(self, token):
"""Calculate id of the given token.
Also keep track of what words were mapped to what ids, for debugging reasons.
Parameters
----------
token : str
Input token.
Return
------
int
Hash value of `token`.
"""
h = self.myhash(utils.to_utf8(token)) % self.id_range
if self.debug:
self.token2id[token] = h
self.id2token.setdefault(h, set()).add(token)
return h
def __len__(self):
"""Get the number of distinct ids = the entire dictionary size."""
return self.id_range
def keys(self):
"""Get a list of all token ids."""
return range(len(self))
@staticmethod
def add_documents(self, documents):
"""Build dictionary from a collection of documents.
Notes
-----
This is only a convenience wrapper for calling `doc2bow` on each document with `allow_update=True`.
Parameters
----------
documents : iterable of list of str
Collection of documents.
Examples
--------
>>> from gensim.corpora import HashDictionary
>>>
>>> corpus = [["máma", "mele", "maso"], ["ema", "má", "máma"]]
>>> dct = HashDictionary(corpus)
>>> "sparta" in dct.token2id
False
>>> dct.add_documents([["this","is","sparta"],["just","joking"]]) # add more documents in dictionary
>>> "sparta" in dct.token2id
True
"""
for docno, document in enumerate(documents):
if docno % 10000 == 0:
logger.info("adding document #%i to %s", docno, self)
self.doc2bow(document, allow_update=True) # ignore the result, here we only care about updating token ids
logger.info(
"built %s from %i documents (total %i corpus positions)",
self, self.num_docs, self.num_pos
)
def doc2bow(self, document, allow_update=False, return_missing=False):
"""Convert `document` into the bag-of-words format, like [(1, 4), (150, 1), (2005, 2)].
Notes
-----
Each word is assumed to be a **tokenized and normalized** utf-8 encoded string. No further preprocessing
is done on the words in `document` (apply tokenization, stemming etc) before calling this method.
If `allow_update` or `self.allow_update` is set, then also update dictionary in the process: update overall
corpus statistics and document frequencies. For each id appearing in this document, increase its document
frequency (`self.dfs`) by one.
Parameters
----------
document : list of str
Is a list of tokens = **tokenized and normalized** strings (either utf8 or unicode).
allow_update : bool, optional
If True - update dictionary in the process.
return_missing : bool, optional
Show token_count for missing words. HAVE NO SENSE FOR THIS CLASS, BECAUSE WE USING HASHING-TRICK.
Return
------
list of (int, int)
Document in Bag-of-words (BoW) format.
list of (int, int), dict
If `return_missing=True`, return document in Bag-of-words (BoW) format + empty dictionary.
Examples
--------
>>> from gensim.corpora import HashDictionary
>>>
>>> corpus = [["máma", "mele", "maso"], ["ema", "má", "máma"]]
>>> dct = HashDictionary(corpus)
>>> dct.doc2bow(["this","is","máma"])
[(1721, 1), (5280, 1), (22493, 1)]
>>> dct.doc2bow(["this","is","máma"], return_missing=True)
([(1721, 1), (5280, 1), (22493, 1)], {})
"""
result = {}
missing = {}
document = sorted(document) # convert the input to plain list (needed below)
for word_norm, group in itertools.groupby(document):
frequency = len(list(group)) # how many times does this word appear in the input document
tokenid = self.restricted_hash(word_norm)
result[tokenid] = result.get(tokenid, 0) + frequency
if self.debug:
# increment document count for each unique token that appeared in the document
self.dfs_debug[word_norm] = self.dfs_debug.get(word_norm, 0) + 1
if allow_update or self.allow_update:
self.num_docs += 1
self.num_pos += len(document)
self.num_nnz += len(result)
if self.debug:
# increment document count for each unique tokenid that appeared in the document
# done here, because several words may map to the same tokenid
for tokenid in iterkeys(result):
self.dfs[tokenid] = self.dfs.get(tokenid, 0) + 1
# return tokenids, in ascending id order
result = sorted(iteritems(result))
if return_missing:
return result, missing
else:
return result
def filter_extremes(self, no_below=5, no_above=0.5, keep_n=100000):
"""Filter tokens in dictionary by frequency.
Parameters
----------
no_below : int, optional
Keep tokens which are contained in at least `no_below` documents.
no_above : float, optional
Keep tokens which are contained in no more than `no_above` documents
(fraction of total corpus size, not an absolute number).
keep_n : int, optional
Keep only the first `keep_n` most frequent tokens.
Notes
-----
For tokens that appear in:
#. Less than `no_below` documents (absolute number) or \n
#. More than `no_above` documents (fraction of total corpus size, **not absolute number**).
#. After (1) and (2), keep only the first `keep_n` most frequent tokens (or keep all if `None`).
Since :class:`~gensim.corpora.hashdictionary.HashDictionary` id range is fixed and doesn't depend on the number
of tokens seen, this doesn't really "remove" anything.
It only clears some supplementary statistics, for easier debugging and a smaller RAM footprint.
Examples
--------
>>> from gensim.corpora import HashDictionary
>>>
>>> corpus = [["máma", "mele", "maso"], ["ema", "má", "máma"]]
>>> dct = HashDictionary(corpus)
>>> dct.filter_extremes(no_below=1, no_above=0.5, keep_n=1)
>>> print dct.token2id
{'maso': 15025}
"""
no_above_abs = int(no_above * self.num_docs) # convert fractional threshold to absolute threshold
ok = [item for item in iteritems(self.dfs_debug) if no_below <= item[1] <= no_above_abs]
ok = frozenset(word for word, freq in sorted(ok, key=lambda x: -x[1])[:keep_n])
self.dfs_debug = {word: freq for word, freq in iteritems(self.dfs_debug) if word in ok}
self.token2id = {token: tokenid for token, tokenid in iteritems(self.token2id) if token in self.dfs_debug}
self.id2token = {
tokenid: {token for token in tokens if token in self.dfs_debug}
for tokenid, tokens in iteritems(self.id2token)
}
self.dfs = {tokenid: freq for tokenid, freq in iteritems(self.dfs) if self.id2token.get(tokenid, set())}
# for word->document frequency
logger.info(
"kept statistics for which were in no less than %i and no more than %i (=%.1f%%) documents",
no_below, no_above_abs, 100.0 * no_above
)
def save_as_text(self, fname):
"""Save this HashDictionary to a text file.
Parameters
----------
fname : str
Path to output file.
Notes
-----
The format is:
`id[TAB]document frequency of this id[TAB]tab-separated set of words in UTF8 that map to this id[NEWLINE]`.
Examples
--------
>>> from gensim.corpora import HashDictionary
>>> from gensim.test.utils import get_tmpfile
>>>
>>> corpus = [["máma", "mele", "maso"], ["ema", "má", "máma"]]
>>> data = HashDictionary(corpus)
>>> data.save_as_text(get_tmpfile("dictionary_in_text_format"))
"""
logger.info("saving HashDictionary mapping to %s" % fname)
with utils.smart_open(fname, 'wb') as fout:
for tokenid in self.keys():
words = sorted(self[tokenid])
if words:
words_df = [(word, self.dfs_debug.get(word, 0)) for word in words]
words_df = ["%s(%i)" % item for item in sorted(words_df, key=lambda x: -x[1])]
words_df = '\t'.join(words_df)
fout.write(utils.to_utf8("%i\t%i\t%s\n" % (tokenid, self.dfs.get(tokenid, 0), words_df)))
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
357,
34,
8,
2321,
28440,
13535,
11,
5325,
320,
797,
71,
495,
74,
198,
2,
49962,
739,
262,
22961,
17370,
6489,
410,
17,
13,
16,
532,
2638,
1378,
2503,
13,
41791,
13,
2398,
14,
677,
4541,
14,
75,
70,
489,
13,
6494,
628,
198,
37811,
1212,
8265,
23986,
262,
366,
71,
2140,
6908,
1,
685,
16,
60,
62,
1377,
257,
16855,
1022,
2456,
290,
511,
18253,
220,
2340,
198,
3500,
257,
5969,
290,
9037,
16855,
13,
198,
198,
16130,
198,
30934,
198,
464,
9037,
16855,
468,
257,
6937,
4088,
24713,
11,
7692,
286,
262,
1271,
286,
1573,
12,
19199,
357,
40890,
8,
287,
534,
35789,
11,
198,
568,
340,
338,
11080,
329,
7587,
4457,
1588,
3990,
64,
13,
383,
220,
2340,
389,
29231,
355,
4600,
17831,
7,
4775,
8,
4064,
4686,
62,
9521,
47671,
198,
3003,
4600,
17831,
63,
318,
257,
2836,
12,
11250,
11970,
2163,
357,
63,
89,
8019,
13,
324,
1754,
2624,
63,
416,
4277,
737,
198,
198,
2782,
4520,
1095,
25,
198,
198,
9,
968,
2456,
460,
307,
7997,
3393,
11,
1231,
281,
3131,
1208,
832,
262,
35789,
198,
220,
284,
2824,
477,
262,
220,
2340,
717,
13,
198,
9,
1680,
307,
973,
351,
1729,
12,
44754,
540,
357,
27078,
12,
8807,
8,
15190,
286,
4963,
13,
198,
9,
1439,
16326,
481,
307,
973,
357,
1662,
691,
326,
345,
766,
287,
4963,
828,
7226,
1917,
198,
220,
329,
1058,
4871,
25,
63,
93,
70,
641,
320,
13,
10215,
38851,
13,
67,
14188,
13,
35,
14188,
44646,
628,
198,
7279,
13461,
1095,
25,
198,
198,
9,
23087,
743,
3975,
284,
262,
976,
4686,
11,
6666,
12234,
31998,
13,
383,
1573,
1279,
3784,
4686,
16855,
318,
645,
2392,
257,
3182,
29192,
13,
628,
198,
19927,
198,
35937,
198,
492,
685,
16,
60,
2638,
1378,
268,
13,
31266,
13,
2398,
14,
15466,
14,
39,
2140,
12,
2898,
624,
198,
198,
37811,
198,
198,
6738,
11593,
37443,
834,
1330,
351,
62,
26090,
198,
198,
11748,
18931,
198,
11748,
340,
861,
10141,
198,
11748,
1976,
8019,
198,
198,
6738,
308,
641,
320,
1330,
3384,
4487,
198,
6738,
2237,
1330,
11629,
23814,
11,
11629,
13083,
628,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628,
198,
4871,
21059,
35,
14188,
7,
26791,
13,
16928,
8912,
11,
8633,
2599,
198,
220,
220,
220,
37227,
27195,
1686,
15968,
262,
16855,
1022,
39279,
2456,
290,
511,
18253,
220,
2340,
13,
628,
220,
220,
220,
11822,
198,
220,
220,
220,
37404,
198,
220,
220,
220,
12101,
1058,
4871,
25,
63,
93,
70,
641,
320,
13,
10215,
38851,
13,
67,
14188,
13,
35,
14188,
47671,
198,
220,
220,
220,
2615,
257,
1058,
4871,
25,
63,
93,
70,
641,
320,
13,
10215,
38851,
13,
17831,
67,
14188,
13,
26257,
35,
14188,
63,
878,
1262,
340,
12429,
271,
77,
470,
257,
3306,
2239,
1174,
13,
198,
220,
220,
220,
383,
4963,
460,
307,
29231,
3393,
11,
422,
281,
555,
17532,
198,
220,
220,
220,
1058,
4871,
25,
63,
93,
70,
641,
320,
13,
10215,
38851,
13,
17831,
67,
14188,
13,
26257,
35,
14188,
63,
1231,
4379,
262,
1334,
286,
262,
35789,
717,
13,
628,
220,
220,
220,
21066,
198,
220,
220,
220,
24200,
198,
220,
220,
220,
13163,
422,
308,
641,
320,
13,
10215,
38851,
1330,
21059,
35,
14188,
198,
220,
220,
220,
13163,
198,
220,
220,
220,
13163,
13399,
796,
16410,
6,
10734,
3256,
705,
39994,
3256,
705,
33215,
6,
11907,
198,
220,
220,
220,
13163,
288,
310,
796,
21059,
35,
14188,
7,
5239,
82,
8,
198,
220,
220,
220,
13163,
288,
310,
13,
15390,
17,
8176,
7,
5239,
82,
58,
15,
12962,
198,
220,
220,
220,
47527,
940,
28688,
11,
352,
828,
357,
17464,
2791,
11,
352,
828,
357,
18,
3064,
17,
11,
352,
15437,
628,
220,
220,
220,
37227,
198,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
4963,
28,
14202,
11,
4686,
62,
9521,
28,
2624,
830,
11,
616,
17831,
28,
89,
8019,
13,
324,
1754,
2624,
11,
14257,
28,
17821,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
40117,
198,
220,
220,
220,
220,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
220,
220,
220,
220,
4963,
1058,
11629,
540,
286,
11629,
540,
286,
965,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
40806,
540,
286,
4963,
11,
611,
1813,
532,
779,
606,
284,
37588,
13,
198,
220,
220,
220,
220,
220,
220,
220,
4686,
62,
9521,
1058,
493,
11,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7913,
286,
12234,
12,
27160,
287,
3084,
11,
973,
355,
4600,
312,
796,
616,
17831,
7,
2539,
8,
4064,
4686,
62,
9521,
44646,
198,
220,
220,
220,
220,
220,
220,
220,
616,
17831,
1058,
2163,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21059,
2163,
11,
815,
1104,
7071,
616,
17831,
7,
2536,
8,
4613,
493,
11,
973,
4600,
89,
8019,
13,
324,
1754,
2624,
63,
416,
4277,
13,
198,
220,
220,
220,
220,
220,
220,
220,
14257,
1058,
20512,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1002,
6407,
532,
3650,
8246,
16326,
16855,
357,
292,
965,
1279,
3784,
4686,
737,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1002,
345,
1064,
3511,
2491,
503,
286,
4088,
357,
273,
407,
1654,
326,
345,
1107,
761,
8246,
16326,
828,
900,
4600,
24442,
28,
25101,
44646,
628,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
1820,
17831,
796,
616,
17831,
220,
1303,
12234,
277,
10782,
25,
4731,
3784,
41433,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
312,
62,
9521,
796,
4686,
62,
9521,
220,
1303,
12234,
2837,
25,
4686,
796,
616,
17831,
7,
2539,
8,
4064,
4686,
62,
9521,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
24442,
796,
14257,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
262,
1708,
357,
13059,
3746,
4858,
8133,
48589,
3166,
389,
691,
7042,
611,
4600,
24442,
63,
318,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30001,
17,
312,
796,
23884,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
312,
17,
30001,
796,
23884,
220,
1303,
9575,
16855,
493,
3784,
2617,
7,
10879,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
7568,
82,
796,
23884,
220,
1303,
11241,
62,
312,
4613,
703,
867,
4963,
428,
11241,
62,
312,
4120,
287,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
7568,
82,
62,
24442,
796,
23884,
220,
1303,
11241,
62,
8841,
3784,
4919,
867,
4963,
428,
1573,
4120,
287,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
22510,
62,
31628,
796,
657,
220,
1303,
1271,
286,
4963,
13686,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
22510,
62,
1930,
796,
657,
220,
1303,
2472,
1271,
286,
35789,
6116,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
22510,
62,
20471,
89,
796,
657,
220,
1303,
2472,
1271,
286,
1729,
12,
9107,
3028,
287,
262,
347,
3913,
17593,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
12154,
62,
19119,
796,
6407,
628,
220,
220,
220,
220,
220,
220,
220,
611,
4963,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
2860,
62,
15390,
2886,
7,
15390,
2886,
8,
628,
220,
220,
220,
825,
11593,
1136,
9186,
834,
7,
944,
11,
11241,
312,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
3855,
477,
2456,
326,
423,
27661,
284,
262,
1813,
4686,
523,
1290,
11,
355,
257,
900,
13,
628,
220,
220,
220,
220,
220,
220,
220,
39567,
654,
198,
220,
220,
220,
220,
220,
220,
220,
24200,
198,
220,
220,
220,
220,
220,
220,
220,
10933,
691,
611,
4600,
24442,
28,
17821,
44646,
628,
220,
220,
220,
220,
220,
220,
220,
40117,
198,
220,
220,
220,
220,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
220,
220,
220,
220,
11241,
312,
1058,
493,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
29130,
27421,
357,
20274,
286,
49544,
737,
628,
220,
220,
220,
220,
220,
220,
220,
8229,
198,
220,
220,
220,
220,
220,
220,
220,
40103,
198,
220,
220,
220,
220,
220,
220,
220,
900,
286,
965,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5345,
286,
477,
11188,
2456,
13,
628,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
312,
17,
30001,
13,
1136,
7,
30001,
312,
11,
900,
28955,
628,
220,
220,
220,
825,
10770,
62,
17831,
7,
944,
11,
11241,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
9771,
3129,
378,
4686,
286,
262,
1813,
11241,
13,
198,
220,
220,
220,
220,
220,
220,
220,
4418,
1394,
2610,
286,
644,
2456,
547,
27661,
284,
644,
220,
2340,
11,
329,
28769,
3840,
13,
628,
220,
220,
220,
220,
220,
220,
220,
40117,
198,
220,
220,
220,
220,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
220,
220,
220,
220,
11241,
1058,
965,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23412,
11241,
13,
628,
220,
220,
220,
220,
220,
220,
220,
8229,
198,
220,
220,
220,
220,
220,
220,
220,
40103,
198,
220,
220,
220,
220,
220,
220,
220,
493,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21059,
1988,
286,
4600,
30001,
44646,
628,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
289,
796,
2116,
13,
1820,
17831,
7,
26791,
13,
1462,
62,
40477,
23,
7,
30001,
4008,
4064,
2116,
13,
312,
62,
9521,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13,
24442,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30001,
17,
312,
58,
30001,
60,
796,
289,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
312,
17,
30001,
13,
2617,
12286,
7,
71,
11,
900,
3419,
737,
2860,
7,
30001,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
289,
628,
220,
220,
220,
825,
11593,
11925,
834,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
3855,
262,
1271,
286,
7310,
220,
2340,
796,
262,
2104,
22155,
2546,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
312,
62,
9521,
628,
220,
220,
220,
825,
8251,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
3855,
257,
1351,
286,
477,
11241,
220,
2340,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2837,
7,
11925,
7,
944,
4008,
628,
220,
220,
220,
2488,
12708,
24396,
628,
220,
220,
220,
825,
751,
62,
15390,
2886,
7,
944,
11,
4963,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
15580,
22155,
422,
257,
4947,
286,
4963,
13,
628,
220,
220,
220,
220,
220,
220,
220,
11822,
198,
220,
220,
220,
220,
220,
220,
220,
37404,
198,
220,
220,
220,
220,
220,
220,
220,
770,
318,
691,
257,
15607,
29908,
329,
4585,
4600,
15390,
17,
8176,
63,
319,
1123,
3188,
351,
4600,
12154,
62,
19119,
28,
17821,
44646,
628,
220,
220,
220,
220,
220,
220,
220,
40117,
198,
220,
220,
220,
220,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
220,
220,
220,
220,
4963,
1058,
11629,
540,
286,
1351,
286,
965,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12251,
286,
4963,
13,
628,
220,
220,
220,
220,
220,
220,
220,
21066,
198,
220,
220,
220,
220,
220,
220,
220,
24200,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
422,
308,
641,
320,
13,
10215,
38851,
1330,
21059,
35,
14188,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
35789,
796,
685,
14692,
76,
6557,
2611,
1600,
366,
1326,
293,
1600,
366,
5356,
78,
33116,
14631,
19687,
1600,
366,
76,
6557,
1600,
366,
76,
6557,
2611,
8973,
60,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
288,
310,
796,
21059,
35,
14188,
7,
10215,
79,
385,
8,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
366,
2777,
34202,
1,
287,
288,
310,
13,
30001,
17,
312,
198,
220,
220,
220,
220,
220,
220,
220,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
288,
310,
13,
2860,
62,
15390,
2886,
26933,
14692,
5661,
2430,
271,
2430,
2777,
34202,
33116,
14692,
3137,
2430,
73,
5730,
8973,
12962,
220,
1303,
751,
517,
4963,
287,
22155,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
366,
2777,
34202,
1,
287,
288,
310,
13,
30001,
17,
312,
198,
220,
220,
220,
220,
220,
220,
220,
6407,
628,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
329,
2205,
3919,
11,
3188,
287,
27056,
378,
7,
15390,
2886,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2205,
3919,
4064,
33028,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
10951,
7203,
26872,
3188,
1303,
4,
72,
284,
4064,
82,
1600,
2205,
3919,
11,
2116,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
15390,
17,
8176,
7,
22897,
11,
1249,
62,
19119,
28,
17821,
8,
220,
1303,
8856,
262,
1255,
11,
994,
356,
691,
1337,
546,
19698,
11241,
220,
2340,
198,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
10951,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
18780,
4064,
82,
422,
4064,
72,
4963,
357,
23350,
4064,
72,
35789,
6116,
42501,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
11,
2116,
13,
22510,
62,
31628,
11,
2116,
13,
22510,
62,
1930,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
825,
2205,
17,
8176,
7,
944,
11,
3188,
11,
1249,
62,
19119,
28,
25101,
11,
1441,
62,
45688,
28,
25101,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
3103,
1851,
4600,
22897,
63,
656,
262,
6131,
12,
1659,
12,
10879,
5794,
11,
588,
47527,
16,
11,
604,
828,
357,
8628,
11,
352,
828,
357,
14315,
11,
362,
25295,
628,
220,
220,
220,
220,
220,
220,
220,
11822,
198,
220,
220,
220,
220,
220,
220,
220,
37404,
198,
220,
220,
220,
220,
220,
220,
220,
5501,
1573,
318,
9672,
284,
307,
257,
12429,
30001,
1143,
290,
39279,
1174,
3384,
69,
12,
23,
30240,
4731,
13,
1400,
2252,
662,
36948,
198,
220,
220,
220,
220,
220,
220,
220,
318,
1760,
319,
262,
2456,
287,
4600,
22897,
63,
357,
39014,
11241,
1634,
11,
34807,
3503,
8,
878,
4585,
428,
2446,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1002,
4600,
12154,
62,
19119,
63,
393,
4600,
944,
13,
12154,
62,
19119,
63,
318,
900,
11,
788,
635,
4296,
22155,
287,
262,
1429,
25,
4296,
4045,
198,
220,
220,
220,
220,
220,
220,
220,
35789,
7869,
290,
3188,
19998,
13,
1114,
1123,
4686,
12655,
287,
428,
3188,
11,
2620,
663,
3188,
198,
220,
220,
220,
220,
220,
220,
220,
8373,
357,
63,
944,
13,
7568,
82,
63,
8,
416,
530,
13,
628,
220,
220,
220,
220,
220,
220,
220,
40117,
198,
220,
220,
220,
220,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
220,
220,
220,
220,
3188,
1058,
1351,
286,
965,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1148,
257,
1351,
286,
16326,
796,
12429,
30001,
1143,
290,
39279,
1174,
13042,
357,
31336,
3384,
69,
23,
393,
28000,
1098,
737,
198,
220,
220,
220,
220,
220,
220,
220,
1249,
62,
19119,
1058,
20512,
11,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1002,
6407,
532,
4296,
22155,
287,
262,
1429,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
62,
45688,
1058,
20512,
11,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5438,
11241,
62,
9127,
329,
4814,
2456,
13,
21515,
8005,
311,
24290,
7473,
12680,
42715,
11,
347,
36600,
19108,
12887,
1294,
2751,
367,
11211,
2751,
12,
5446,
11860,
13,
628,
220,
220,
220,
220,
220,
220,
220,
8229,
198,
220,
220,
220,
220,
220,
220,
220,
40103,
198,
220,
220,
220,
220,
220,
220,
220,
1351,
286,
357,
600,
11,
493,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16854,
287,
20127,
12,
1659,
12,
10879,
357,
16635,
54,
8,
5794,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1351,
286,
357,
600,
11,
493,
828,
8633,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1002,
4600,
7783,
62,
45688,
28,
17821,
47671,
1441,
3188,
287,
20127,
12,
1659,
12,
10879,
357,
16635,
54,
8,
5794,
1343,
6565,
22155,
13,
628,
220,
220,
220,
220,
220,
220,
220,
21066,
198,
220,
220,
220,
220,
220,
220,
220,
24200,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
422,
308,
641,
320,
13,
10215,
38851,
1330,
21059,
35,
14188,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
35789,
796,
685,
14692,
76,
6557,
2611,
1600,
366,
1326,
293,
1600,
366,
5356,
78,
33116,
14631,
19687,
1600,
366,
76,
6557,
1600,
366,
76,
6557,
2611,
8973,
60,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
288,
310,
796,
21059,
35,
14188,
7,
10215,
79,
385,
8,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
288,
310,
13,
15390,
17,
8176,
7,
14692,
5661,
2430,
271,
2430,
76,
6557,
2611,
8973,
8,
198,
220,
220,
220,
220,
220,
220,
220,
47527,
1558,
2481,
11,
352,
828,
357,
4309,
1795,
11,
352,
828,
357,
24137,
6052,
11,
352,
15437,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
288,
310,
13,
15390,
17,
8176,
7,
14692,
5661,
2430,
271,
2430,
76,
6557,
2611,
33116,
1441,
62,
45688,
28,
17821,
8,
198,
220,
220,
220,
220,
220,
220,
220,
29565,
7,
1558,
2481,
11,
352,
828,
357,
4309,
1795,
11,
352,
828,
357,
24137,
6052,
11,
352,
8,
4357,
23884,
8,
628,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
23884,
198,
220,
220,
220,
220,
220,
220,
220,
4814,
796,
23884,
198,
220,
220,
220,
220,
220,
220,
220,
3188,
796,
23243,
7,
22897,
8,
220,
1303,
10385,
262,
5128,
284,
8631,
1351,
357,
27938,
2174,
8,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1573,
62,
27237,
11,
1448,
287,
340,
861,
10141,
13,
8094,
1525,
7,
22897,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8373,
796,
18896,
7,
4868,
7,
8094,
4008,
220,
1303,
703,
867,
1661,
857,
428,
1573,
1656,
287,
262,
5128,
3188,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
11241,
312,
796,
2116,
13,
49343,
62,
17831,
7,
4775,
62,
27237,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
58,
30001,
312,
60,
796,
1255,
13,
1136,
7,
30001,
312,
11,
657,
8,
1343,
8373,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13,
24442,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
18703,
3188,
954,
329,
1123,
3748,
11241,
326,
4120,
287,
262,
3188,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
7568,
82,
62,
24442,
58,
4775,
62,
27237,
60,
796,
2116,
13,
7568,
82,
62,
24442,
13,
1136,
7,
4775,
62,
27237,
11,
657,
8,
1343,
352,
628,
220,
220,
220,
220,
220,
220,
220,
611,
1249,
62,
19119,
393,
2116,
13,
12154,
62,
19119,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
22510,
62,
31628,
15853,
352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
22510,
62,
1930,
15853,
18896,
7,
22897,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
22510,
62,
20471,
89,
15853,
18896,
7,
20274,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13,
24442,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
18703,
3188,
954,
329,
1123,
3748,
11241,
312,
326,
4120,
287,
262,
3188,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
1760,
994,
11,
780,
1811,
2456,
743,
3975,
284,
262,
976,
11241,
312,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
11241,
312,
287,
11629,
13083,
7,
20274,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
7568,
82,
58,
30001,
312,
60,
796,
2116,
13,
7568,
82,
13,
1136,
7,
30001,
312,
11,
657,
8,
1343,
352,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
1441,
11241,
2340,
11,
287,
41988,
4686,
1502,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
23243,
7,
2676,
23814,
7,
20274,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
611,
1441,
62,
45688,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
1255,
11,
4814,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
1255,
628,
220,
220,
220,
825,
8106,
62,
2302,
2787,
274,
7,
944,
11,
645,
62,
35993,
28,
20,
11,
645,
62,
29370,
28,
15,
13,
20,
11,
1394,
62,
77,
28,
3064,
830,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
22417,
16326,
287,
22155,
416,
8373,
13,
628,
220,
220,
220,
220,
220,
220,
220,
40117,
198,
220,
220,
220,
220,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
220,
220,
220,
220,
645,
62,
35993,
1058,
493,
11,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9175,
16326,
543,
389,
7763,
287,
379,
1551,
4600,
3919,
62,
35993,
63,
4963,
13,
198,
220,
220,
220,
220,
220,
220,
220,
645,
62,
29370,
1058,
12178,
11,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9175,
16326,
543,
389,
7763,
287,
645,
517,
621,
4600,
3919,
62,
29370,
63,
4963,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
69,
7861,
286,
2472,
35789,
2546,
11,
407,
281,
4112,
1271,
737,
198,
220,
220,
220,
220,
220,
220,
220,
1394,
62,
77,
1058,
493,
11,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9175,
691,
262,
717,
4600,
14894,
62,
77,
63,
749,
10792,
16326,
13,
628,
220,
220,
220,
220,
220,
220,
220,
11822,
198,
220,
220,
220,
220,
220,
220,
220,
37404,
198,
220,
220,
220,
220,
220,
220,
220,
1114,
16326,
326,
1656,
287,
25,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
13,
12892,
621,
4600,
3919,
62,
35993,
63,
4963,
357,
48546,
1271,
8,
393,
3467,
77,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
13,
3125,
621,
4600,
3919,
62,
29370,
63,
4963,
357,
69,
7861,
286,
2472,
35789,
2546,
11,
12429,
1662,
4112,
1271,
1174,
737,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
13,
2293,
357,
16,
8,
290,
357,
17,
828,
1394,
691,
262,
717,
4600,
14894,
62,
77,
63,
749,
10792,
16326,
357,
273,
1394,
477,
611,
4600,
14202,
63,
737,
628,
220,
220,
220,
220,
220,
220,
220,
4619,
1058,
4871,
25,
63,
93,
70,
641,
320,
13,
10215,
38851,
13,
17831,
67,
14188,
13,
26257,
35,
14188,
63,
4686,
2837,
318,
5969,
290,
1595,
470,
4745,
319,
262,
1271,
198,
220,
220,
220,
220,
220,
220,
220,
286,
16326,
1775,
11,
428,
1595,
470,
1107,
366,
28956,
1,
1997,
13,
198,
220,
220,
220,
220,
220,
220,
220,
632,
691,
37526,
617,
43871,
7869,
11,
329,
4577,
28769,
290,
257,
4833,
13931,
24713,
13,
628,
220,
220,
220,
220,
220,
220,
220,
21066,
198,
220,
220,
220,
220,
220,
220,
220,
24200,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
422,
308,
641,
320,
13,
10215,
38851,
1330,
21059,
35,
14188,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
35789,
796,
685,
14692,
76,
6557,
2611,
1600,
366,
1326,
293,
1600,
366,
5356,
78,
33116,
14631,
19687,
1600,
366,
76,
6557,
1600,
366,
76,
6557,
2611,
8973,
60,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
288,
310,
796,
21059,
35,
14188,
7,
10215,
79,
385,
8,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
288,
310,
13,
24455,
62,
2302,
2787,
274,
7,
3919,
62,
35993,
28,
16,
11,
645,
62,
29370,
28,
15,
13,
20,
11,
1394,
62,
77,
28,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
3601,
288,
310,
13,
30001,
17,
312,
198,
220,
220,
220,
220,
220,
220,
220,
1391,
6,
5356,
78,
10354,
6640,
1495,
92,
628,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
645,
62,
29370,
62,
8937,
796,
493,
7,
3919,
62,
29370,
1635,
2116,
13,
22510,
62,
31628,
8,
220,
1303,
10385,
13390,
282,
11387,
284,
4112,
11387,
198,
220,
220,
220,
220,
220,
220,
220,
12876,
796,
685,
9186,
329,
2378,
287,
11629,
23814,
7,
944,
13,
7568,
82,
62,
24442,
8,
611,
645,
62,
35993,
19841,
2378,
58,
16,
60,
19841,
645,
62,
29370,
62,
8937,
60,
198,
220,
220,
220,
220,
220,
220,
220,
12876,
796,
8400,
8247,
316,
7,
4775,
329,
1573,
11,
2030,
80,
287,
23243,
7,
482,
11,
1994,
28,
50033,
2124,
25,
532,
87,
58,
16,
12962,
58,
25,
14894,
62,
77,
12962,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
7568,
82,
62,
24442,
796,
1391,
4775,
25,
2030,
80,
329,
1573,
11,
2030,
80,
287,
11629,
23814,
7,
944,
13,
7568,
82,
62,
24442,
8,
611,
1573,
287,
12876,
92,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30001,
17,
312,
796,
1391,
30001,
25,
11241,
312,
329,
11241,
11,
11241,
312,
287,
11629,
23814,
7,
944,
13,
30001,
17,
312,
8,
611,
11241,
287,
2116,
13,
7568,
82,
62,
24442,
92,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
312,
17,
30001,
796,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
11241,
312,
25,
1391,
30001,
329,
11241,
287,
16326,
611,
11241,
287,
2116,
13,
7568,
82,
62,
24442,
92,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
11241,
312,
11,
16326,
287,
11629,
23814,
7,
944,
13,
312,
17,
30001,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
7568,
82,
796,
1391,
30001,
312,
25,
2030,
80,
329,
11241,
312,
11,
2030,
80,
287,
11629,
23814,
7,
944,
13,
7568,
82,
8,
611,
2116,
13,
312,
17,
30001,
13,
1136,
7,
30001,
312,
11,
900,
28955,
92,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
329,
1573,
3784,
22897,
8373,
198,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
10951,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
45089,
7869,
329,
543,
547,
287,
645,
1342,
621,
4064,
72,
290,
645,
517,
621,
4064,
72,
46121,
7225,
16,
69,
4,
4407,
4963,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
645,
62,
35993,
11,
645,
62,
29370,
62,
8937,
11,
1802,
13,
15,
1635,
645,
62,
29370,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
825,
3613,
62,
292,
62,
5239,
7,
944,
11,
277,
3672,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
16928,
428,
21059,
35,
14188,
284,
257,
2420,
2393,
13,
628,
220,
220,
220,
220,
220,
220,
220,
40117,
198,
220,
220,
220,
220,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
220,
220,
220,
220,
277,
3672,
1058,
965,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10644,
284,
5072,
2393,
13,
628,
220,
220,
220,
220,
220,
220,
220,
11822,
198,
220,
220,
220,
220,
220,
220,
220,
37404,
198,
220,
220,
220,
220,
220,
220,
220,
383,
5794,
318,
25,
198,
220,
220,
220,
220,
220,
220,
220,
4600,
312,
58,
5603,
33,
60,
22897,
8373,
286,
428,
4686,
58,
5603,
33,
60,
8658,
12,
25512,
515,
900,
286,
2456,
287,
41002,
23,
326,
3975,
284,
428,
4686,
58,
13965,
24027,
60,
44646,
628,
198,
220,
220,
220,
220,
220,
220,
220,
21066,
198,
220,
220,
220,
220,
220,
220,
220,
24200,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
422,
308,
641,
320,
13,
10215,
38851,
1330,
21059,
35,
14188,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
422,
308,
641,
320,
13,
9288,
13,
26791,
1330,
651,
62,
22065,
7753,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
35789,
796,
685,
14692,
76,
6557,
2611,
1600,
366,
1326,
293,
1600,
366,
5356,
78,
33116,
14631,
19687,
1600,
366,
76,
6557,
1600,
366,
76,
6557,
2611,
8973,
60,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
1366,
796,
21059,
35,
14188,
7,
10215,
79,
385,
8,
198,
220,
220,
220,
220,
220,
220,
220,
13163,
1366,
13,
21928,
62,
292,
62,
5239,
7,
1136,
62,
22065,
7753,
7203,
67,
14188,
62,
259,
62,
5239,
62,
18982,
48774,
628,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
10951,
7203,
29336,
21059,
35,
14188,
16855,
284,
4064,
82,
1,
4064,
277,
3672,
8,
198,
220,
220,
220,
220,
220,
220,
220,
351,
3384,
4487,
13,
27004,
62,
9654,
7,
69,
3672,
11,
705,
39346,
11537,
355,
277,
448,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
11241,
312,
287,
2116,
13,
13083,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2456,
796,
23243,
7,
944,
58,
30001,
312,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2456,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2456,
62,
7568,
796,
47527,
4775,
11,
2116,
13,
7568,
82,
62,
24442,
13,
1136,
7,
4775,
11,
657,
4008,
329,
1573,
287,
2456,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2456,
62,
7568,
796,
14631,
4,
82,
7,
4,
72,
16725,
4064,
2378,
329,
2378,
287,
23243,
7,
10879,
62,
7568,
11,
1994,
28,
50033,
2124,
25,
532,
87,
58,
16,
12962,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2456,
62,
7568,
796,
705,
59,
83,
4458,
22179,
7,
10879,
62,
7568,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
448,
13,
13564,
7,
26791,
13,
1462,
62,
40477,
23,
7203,
4,
72,
59,
83,
4,
72,
59,
83,
4,
82,
59,
77,
1,
4064,
357,
30001,
312,
11,
2116,
13,
7568,
82,
13,
1136,
7,
30001,
312,
11,
657,
828,
2456,
62,
7568,
22305,
198
] | 2.435998 | 5,328 |
#!/usr/bin/python
#'''''''10''''''''20''''''''30''''''''40''''''''50''''''''60''''''''70''''''''80
'''_____________________________________________________________________________
'
' Created By: Kevin M. Albright
' Creation Date: 03.24.2014
'
' Modified By: Kevin M. Albright
' Last Modified: 03.30.2014
'
' Assignment: Lab6c
' File Name: albright_lab6c.py
' From: Exploring Python p. 43 q. #24
' Purpose: This program is the game of Craps, which is a dice game.
' The game will allow you to start a new game or exit.
' If you start a game the first roll will occur. Then
' you will either win, lose or mark point and continue to
' roll till you win or lose. You can use the enter key,
' y, or Y for affirmative responses and n or N for negative
' responses. The instructions in the game are written into
' the program so I will not repeat them here.
_____________________________________________________________________________'''
'''
' Function die_roll
'
' Uses random.randint() function to generate a random integer [1-6]
' simulating a die being rolled.
' Pass in nothing.
' Returns an integer.
'''
'''
' Function rolling_dice
'
' Simulates the rolling of a pair of dice. Also, tallies the two dice
' together, and adds one to rolls.
' Pass in rolls:int
' Returns [die1, die2, tally]:list and rolls:int
'''
'''
' Function first_roll_check
'
' Checks the first roll of a round whether the user wins with a [7,11]
' loses with [2,3,12], or point is on with [4,5,6,8,9,10]. Will return a
' 1 for wins, -1 for loses, and 0 for point on. Checks start of -2 is
' arbitrary, just to be a valid integer but invalid to the checkers later on.
' Pass in tally:int
' Returns check:int and mark_point:int
'''
'''
' Function mark_point_check
'
' Used to check all rolls in a round except the first. Checks if user rolled
' a 7 and thus loses the round, if they rolled the mark_point and win the
' round, or if the rolled some other number thus continuing the round.
' Pass in mark_point:int and tally:int
'''
'''
' Function get_input
'
' Gets input from the user. Displays the output string and returns an
' uppercase string.
' Pass in output:string
' Returns an upper case string
'''
'''
' Function print_out
'
' Print passed in output string.
' Pass in output:string
' Returns nothing
'''
'''
' Function is_valid
'
' Checks the input for validity. Input needs to be a 'Y', 'N', or ''.
' Returns the input if it is valid, otherwise it will return a '1' which
' will make loop using this function need to loop around again.
' Pass in input:string/char
' Returns input:string/char or '1':string/char
'''
'''
' Function is_win
'
' Check if the user won, lost, or continues. If user wins prints out win and
' the score, updates points and rounds, and resets rolls to 0. If user lost
' prints out lost and the score, resets rolls, and updates rounds.
' Pass in check:int, points:int, rolls:int, and rounds:int
' Returns check:int, points:int, rolls:int, and rounds:int
'''
'''
' Function print_dice_roll
'
' Prints out the dice roll. Prints the individual die roll and their sum.
' Pass in dice_group:list, rolls:int
'''
'''
' Function gameplay
'
' The main code of a single game. Holding variables for the function of
' the game and loops to go through rolls for making point and if the user
' wants to play continue playing the game.
' Pass in nothing
' Returns a '1' to support the loop in the calling function/code
'''
'''
' Start of Program
'
' Give introduction to user and then instructions on how to play
' the game. Is the outer most loop to exit out of the program
' cleanly.
'''
print_out("""
---- Welcome to the dice game Craps!
The name of the game is Craps. The rules of the game are:
A). On your first roll of a round: If you roll a
1). seven(7) or an eleven(11) you score and win the round.
2). two(2), three(3), or a twelve(12) you lose the round.
3). four(4), five(5), six(6), eight(8), nine(9), or ten(10)
point is on and you must continue to roll.
B). On continued rounds: If point is on and roll a
1). the point on number again, you win the round.
2). seven(7) you lose the round.
3). any other number, roll again.
You may play multiple rounds per a game, or you may start a
new game from the main menu, thus resetting your scores
without exiting the program.
Yes and No questions can be answered:
1). y or Y or press the enter key for affirmative responses.
2). n or N for negative responses.
""")
input = '1'
while not(input == 'Y' or input == 'N' or input == ''):
input = get_input(' Start a new game? (y or enter/n): ')
print_out('')
input = is_valid(input)
if input == 'Y' or input == '':
input = gameplay()
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
39115,
7061,
6,
940,
39115,
39115,
1238,
39115,
39115,
1270,
39115,
39115,
1821,
39115,
39115,
1120,
39115,
39115,
1899,
39115,
39115,
2154,
39115,
39115,
1795,
198,
7061,
6,
27193,
2602,
29343,
198,
6,
198,
6,
220,
220,
220,
220,
15622,
2750,
25,
220,
7939,
337,
13,
978,
29199,
198,
6,
220,
21582,
7536,
25,
220,
7643,
13,
1731,
13,
4967,
198,
6,
198,
6,
220,
220,
220,
40499,
2750,
25,
220,
7939,
337,
13,
978,
29199,
198,
6,
220,
4586,
40499,
25,
220,
7643,
13,
1270,
13,
4967,
198,
6,
198,
6,
220,
220,
220,
220,
50144,
25,
220,
3498,
21,
66,
198,
6,
220,
220,
220,
220,
220,
9220,
6530,
25,
220,
435,
29199,
62,
23912,
21,
66,
13,
9078,
198,
6,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3574,
25,
220,
5905,
3255,
11361,
279,
13,
5946,
10662,
13,
1303,
1731,
198,
6,
220,
220,
220,
220,
220,
220,
220,
32039,
25,
220,
770,
1430,
318,
262,
983,
286,
11176,
862,
11,
543,
318,
257,
17963,
983,
13,
198,
6,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
383,
983,
481,
1249,
345,
284,
923,
257,
649,
983,
393,
8420,
13,
198,
6,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1002,
345,
923,
257,
983,
262,
717,
4836,
481,
3051,
13,
220,
3244,
198,
6,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
345,
481,
2035,
1592,
11,
4425,
393,
1317,
966,
290,
2555,
284,
198,
6,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4836,
10597,
345,
1592,
393,
4425,
13,
220,
921,
460,
779,
262,
3802,
1994,
11,
198,
6,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
331,
11,
393,
575,
329,
27990,
9109,
290,
299,
393,
399,
329,
4633,
198,
6,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9109,
13,
220,
383,
7729,
287,
262,
983,
389,
3194,
656,
198,
6,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
262,
1430,
523,
314,
481,
407,
9585,
606,
994,
13,
198,
27193,
2602,
29343,
7061,
6,
198,
198,
7061,
6,
198,
6,
220,
15553,
4656,
62,
2487,
198,
6,
220,
220,
198,
6,
220,
36965,
4738,
13,
25192,
600,
3419,
2163,
284,
7716,
257,
4738,
18253,
685,
16,
12,
21,
60,
198,
6,
220,
220,
220,
985,
8306,
257,
4656,
852,
11686,
13,
198,
6,
220,
6251,
287,
2147,
13,
198,
6,
220,
16409,
281,
18253,
13,
198,
7061,
6,
198,
198,
7061,
6,
198,
6,
220,
15553,
10708,
62,
67,
501,
198,
6,
198,
6,
220,
3184,
15968,
262,
10708,
286,
257,
5166,
286,
17963,
13,
220,
4418,
11,
7331,
444,
262,
734,
17963,
198,
6,
220,
220,
220,
1978,
11,
290,
6673,
530,
284,
14088,
13,
198,
6,
220,
6251,
287,
14088,
25,
600,
198,
6,
220,
16409,
685,
11979,
16,
11,
4656,
17,
11,
26767,
5974,
4868,
290,
14088,
25,
600,
198,
7061,
6,
198,
198,
7061,
6,
198,
6,
220,
15553,
717,
62,
2487,
62,
9122,
198,
6,
198,
6,
220,
47719,
262,
717,
4836,
286,
257,
2835,
1771,
262,
2836,
7864,
351,
257,
685,
22,
11,
1157,
60,
198,
6,
220,
220,
220,
14754,
351,
685,
17,
11,
18,
11,
1065,
4357,
393,
966,
318,
319,
351,
685,
19,
11,
20,
11,
21,
11,
23,
11,
24,
11,
940,
4083,
220,
2561,
1441,
257,
198,
6,
220,
220,
220,
352,
329,
7864,
11,
532,
16,
329,
14754,
11,
290,
657,
329,
966,
319,
13,
220,
47719,
923,
286,
532,
17,
318,
220,
198,
6,
220,
220,
220,
14977,
11,
655,
284,
307,
257,
4938,
18253,
475,
12515,
284,
262,
2198,
364,
1568,
319,
13,
198,
6,
220,
6251,
287,
26767,
25,
600,
198,
6,
220,
16409,
2198,
25,
600,
290,
1317,
62,
4122,
25,
600,
198,
7061,
6,
198,
198,
7061,
6,
198,
6,
220,
15553,
1317,
62,
4122,
62,
9122,
198,
6,
198,
6,
220,
16718,
284,
2198,
477,
14088,
287,
257,
2835,
2845,
262,
717,
13,
220,
47719,
611,
2836,
11686,
198,
6,
220,
220,
220,
257,
767,
290,
4145,
14754,
262,
2835,
11,
611,
484,
11686,
262,
1317,
62,
4122,
290,
1592,
262,
198,
6,
220,
220,
220,
2835,
11,
393,
611,
262,
11686,
617,
584,
1271,
4145,
8282,
262,
2835,
13,
198,
6,
220,
6251,
287,
1317,
62,
4122,
25,
600,
290,
26767,
25,
600,
198,
7061,
6,
198,
198,
7061,
6,
198,
6,
220,
15553,
651,
62,
15414,
198,
6,
198,
6,
220,
29620,
5128,
422,
262,
2836,
13,
220,
3167,
26024,
262,
5072,
4731,
290,
5860,
281,
198,
6,
220,
220,
220,
334,
39921,
589,
4731,
13,
198,
6,
220,
6251,
287,
5072,
25,
8841,
198,
6,
220,
16409,
281,
6727,
1339,
4731,
198,
7061,
6,
198,
198,
7061,
6,
198,
6,
220,
15553,
3601,
62,
448,
198,
6,
198,
6,
220,
12578,
3804,
287,
5072,
4731,
13,
198,
6,
220,
6251,
287,
5072,
25,
8841,
198,
6,
220,
16409,
2147,
198,
7061,
6,
198,
198,
7061,
6,
198,
6,
220,
15553,
318,
62,
12102,
198,
6,
198,
6,
220,
47719,
262,
5128,
329,
19648,
13,
220,
23412,
2476,
284,
307,
257,
705,
56,
3256,
705,
45,
3256,
393,
705,
4458,
198,
6,
220,
220,
220,
16409,
262,
5128,
611,
340,
318,
4938,
11,
4306,
340,
481,
1441,
257,
705,
16,
6,
543,
198,
6,
220,
220,
220,
481,
787,
9052,
1262,
428,
2163,
761,
284,
9052,
1088,
757,
13,
198,
6,
220,
6251,
287,
5128,
25,
8841,
14,
10641,
198,
6,
220,
16409,
5128,
25,
8841,
14,
10641,
393,
705,
16,
10354,
8841,
14,
10641,
198,
7061,
6,
198,
198,
7061,
6,
198,
6,
220,
15553,
318,
62,
5404,
198,
6,
198,
6,
220,
6822,
611,
262,
2836,
1839,
11,
2626,
11,
393,
4477,
13,
220,
1002,
2836,
7864,
20842,
503,
1592,
290,
198,
6,
220,
220,
220,
262,
4776,
11,
5992,
2173,
290,
9196,
11,
290,
581,
1039,
14088,
284,
657,
13,
220,
1002,
2836,
2626,
198,
6,
220,
220,
220,
20842,
503,
2626,
290,
262,
4776,
11,
581,
1039,
14088,
11,
290,
5992,
9196,
13,
198,
6,
220,
6251,
287,
2198,
25,
600,
11,
2173,
25,
600,
11,
14088,
25,
600,
11,
290,
9196,
25,
600,
198,
6,
220,
16409,
2198,
25,
600,
11,
2173,
25,
600,
11,
14088,
25,
600,
11,
290,
9196,
25,
600,
198,
7061,
6,
198,
198,
7061,
6,
198,
6,
220,
15553,
3601,
62,
67,
501,
62,
2487,
198,
6,
198,
6,
220,
12578,
82,
503,
262,
17963,
4836,
13,
220,
12578,
82,
262,
1981,
4656,
4836,
290,
511,
2160,
13,
198,
6,
220,
6251,
287,
17963,
62,
8094,
25,
4868,
11,
14088,
25,
600,
198,
7061,
6,
198,
198,
7061,
6,
198,
6,
220,
15553,
11327,
198,
6,
198,
6,
220,
383,
1388,
2438,
286,
257,
2060,
983,
13,
220,
31703,
9633,
329,
262,
2163,
286,
220,
198,
6,
220,
220,
220,
262,
983,
290,
23607,
284,
467,
832,
14088,
329,
1642,
966,
290,
611,
262,
2836,
220,
198,
6,
220,
220,
220,
3382,
284,
711,
2555,
2712,
262,
983,
13,
198,
6,
220,
6251,
287,
2147,
198,
6,
220,
16409,
257,
705,
16,
6,
284,
1104,
262,
9052,
287,
262,
4585,
2163,
14,
8189,
198,
7061,
6,
198,
198,
7061,
6,
198,
6,
220,
7253,
286,
6118,
198,
6,
198,
6,
220,
13786,
9793,
284,
2836,
290,
788,
7729,
319,
703,
284,
711,
198,
6,
220,
220,
220,
262,
983,
13,
220,
1148,
262,
12076,
749,
9052,
284,
8420,
503,
286,
262,
1430,
198,
6,
220,
220,
220,
3424,
306,
13,
220,
220,
198,
7061,
6,
198,
4798,
62,
448,
7203,
15931,
198,
650,
220,
220,
220,
220,
220,
220,
220,
19134,
284,
262,
17963,
983,
11176,
862,
0,
628,
220,
220,
220,
383,
1438,
286,
262,
983,
318,
11176,
862,
13,
220,
383,
3173,
286,
262,
983,
389,
25,
198,
220,
220,
220,
317,
737,
220,
1550,
534,
717,
4836,
286,
257,
2835,
25,
220,
1002,
345,
4836,
257,
198,
220,
220,
220,
220,
220,
352,
737,
220,
3598,
7,
22,
8,
393,
281,
22216,
7,
1157,
8,
345,
4776,
290,
1592,
262,
2835,
13,
198,
220,
220,
220,
220,
220,
362,
737,
220,
734,
7,
17,
828,
1115,
7,
18,
828,
393,
257,
14104,
7,
1065,
8,
345,
4425,
262,
2835,
13,
198,
220,
220,
220,
220,
220,
513,
737,
220,
1440,
7,
19,
828,
1936,
7,
20,
828,
2237,
7,
21,
828,
3624,
7,
23,
828,
5193,
7,
24,
828,
393,
3478,
7,
940,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
966,
318,
319,
290,
345,
1276,
2555,
284,
4836,
13,
198,
220,
220,
220,
347,
737,
220,
1550,
3767,
9196,
25,
220,
1002,
966,
318,
319,
290,
4836,
257,
198,
220,
220,
220,
220,
220,
352,
737,
220,
262,
966,
319,
1271,
220,
757,
11,
345,
1592,
262,
2835,
13,
198,
220,
220,
220,
220,
220,
362,
737,
220,
3598,
7,
22,
8,
345,
4425,
262,
2835,
13,
198,
220,
220,
220,
220,
220,
513,
737,
220,
597,
584,
1271,
11,
4836,
757,
13,
628,
220,
220,
220,
921,
743,
711,
3294,
9196,
583,
257,
983,
11,
393,
345,
743,
923,
257,
220,
198,
220,
220,
220,
220,
220,
649,
983,
422,
262,
1388,
6859,
11,
4145,
13259,
889,
534,
8198,
198,
220,
220,
220,
220,
220,
1231,
33895,
262,
1430,
13,
628,
220,
220,
220,
3363,
290,
1400,
2683,
460,
307,
9373,
25,
198,
220,
220,
220,
352,
737,
220,
331,
393,
575,
393,
1803,
262,
3802,
1994,
329,
27990,
9109,
13,
198,
220,
220,
220,
362,
737,
220,
299,
393,
399,
329,
4633,
9109,
13,
198,
15931,
4943,
198,
198,
15414,
796,
705,
16,
6,
198,
4514,
407,
7,
15414,
6624,
705,
56,
6,
393,
5128,
6624,
705,
45,
6,
393,
5128,
6624,
10148,
2599,
198,
220,
5128,
796,
651,
62,
15414,
10786,
220,
220,
220,
7253,
257,
649,
983,
30,
357,
88,
393,
3802,
14,
77,
2599,
705,
8,
198,
220,
3601,
62,
448,
7,
7061,
8,
198,
220,
5128,
796,
318,
62,
12102,
7,
15414,
8,
198,
220,
611,
5128,
6624,
705,
56,
6,
393,
5128,
6624,
10148,
25,
198,
220,
220,
220,
5128,
796,
11327,
3419,
198
] | 2.851977 | 1,770 |
from nltk.tokenize import sent_tokenize
from nltk.corpus import stopwords
from sklearn.metrics.pairwise import cosine_similarity
import en_coref_lg
import networkx as nx
import pandas as pd
import numpy as np
nlp = en_coref_lg.load()
# paths #
embedding_path = "../../data/embeddings/"
# article summarizer #
def get_embeddings():
""""""
# Extract word vectors
word_embeddings = {}
f = open(embedding_path + "glove.6B.100d.txt", encoding="utf-8")
for line in f:
values = line.split()
word = values[0]
coefs = np.asarray(values[1:], dtype="float32")
word_embeddings[word] = coefs
f.close()
return word_embeddings
def summarise_fast(article, n=3):
""""""
# resolve co-reference issues
clusters = nlp(article)._.coref_clusters
if isinstance(clusters, type(None)):
trans_dict = {}
else:
clusters = filter(None, clusters)
trans_dict = {str(i[1]): str(i[0]) for i in clusters}
for k, v in trans_dict.items():
article = article.replace(k, v)
sentences = sent_tokenize(article)
return sentences[:n]
def summarise(article, word_embeddings):
""""""
sentences = []
# resolve co-reference issues
clusters = nlp(article)._.coref_clusters
if type(clusters) is None:
trans_dict = {}
else:
trans_dict = {str(i[1]): str(i[0]) for i in clusters}
for k, v in trans_dict.items():
article = article.replace(k, v)
sentences.append(sent_tokenize(article))
sentences = [y for x in sentences for y in x] # flatten list
# remove punctuations, numbers and special characters
if len(sentences) != 0:
clean_sentences = pd.Series(sentences).str.replace("[^a-zA-Z]", " ")
else:
return []
# make alphabets lowercase
clean_sentences = [s.lower() for s in clean_sentences]
stop_words = stopwords.words("english")
# function to remove stopwords
# remove stopwords from the sentences
clean_sentences = [remove_stopwords(r.split()) for r in clean_sentences]
sentence_vectors = []
for i in clean_sentences:
if len(i) != 0:
v = sum([word_embeddings.get(w, np.zeros((100,))) for w in i.split()]) / (
len(i.split()) + 0.001
)
else:
v = np.zeros((100,))
sentence_vectors.append(v)
def compute_PageRank(G, beta=0.85, epsilon=10 ** -4):
"""
Efficient computation of the PageRank values using a sparse adjacency
matrix and the iterative power method.
Parameters
----------
G : boolean adjacency matrix. np.bool8
If the element j,i is True, means that there is a link from i to j.
beta: 1-teleportation probability.
epsilon: stop condition. Minimum allowed amount of change in the PageRanks
between iterations.
Returns
-------
output : tuple
PageRank array normalized top one.
Number of iterations.
"""
# Test adjacency matrix is OK
n, _ = G.shape
assert G.shape == (n, n)
# Constants Speed-UP
# deg_out_beta = G.sum(axis=0).T
deg_out_beta = (
G.sum(axis=0).T
+ np.array([[0.0001] for x in np.arange(len(G.sum(axis=0).T))])
) / beta # vector
deg_out_beta = np.array(deg_out_beta, dtype=np.float64)
# Initialize
ranks = np.ones((n, 1)) / n # vector
time = 0
flag = True
while flag and time < 5:
time += 1
with np.errstate(
divide="ignore", invalid="ignore"
): # Ignore division by 0 on ranks/deg_out_beta
ranks = np.array(ranks, dtype=np.float64)
new_ranks = G.dot((ranks / deg_out_beta)) # vector
# Leaked PageRank
new_ranks += (1 - new_ranks.sum()) / n
# Stop condition
if np.linalg.norm(ranks - new_ranks, ord=1) <= epsilon:
flag = False
ranks = new_ranks
return {k: v.item(0) for k, v in enumerate(ranks)}
A = np.matrix(sentence_vectors)
dist = cosine_similarity(A)
try:
nx_graph = nx.from_numpy_array(dist)
except:
pass
mat = nx.adjacency_matrix(nx_graph)
try:
scores = compute_PageRank(mat)
except:
return []
ranked_sentences = sorted(
((scores[i], s) for i, s in enumerate(sentences)), reverse=True
)
return [ranked_sentences[i][1] for i in range(1)]
| [
6738,
299,
2528,
74,
13,
30001,
1096,
1330,
1908,
62,
30001,
1096,
198,
6738,
299,
2528,
74,
13,
10215,
79,
385,
1330,
2245,
10879,
198,
6738,
1341,
35720,
13,
4164,
10466,
13,
24874,
3083,
1330,
8615,
500,
62,
38610,
414,
198,
11748,
551,
62,
7295,
69,
62,
75,
70,
198,
11748,
3127,
87,
355,
299,
87,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
198,
21283,
79,
796,
551,
62,
7295,
69,
62,
75,
70,
13,
2220,
3419,
198,
198,
2,
13532,
1303,
198,
198,
20521,
12083,
62,
6978,
796,
366,
40720,
40720,
7890,
14,
20521,
67,
654,
30487,
198,
198,
2,
2708,
15676,
7509,
1303,
628,
198,
4299,
651,
62,
20521,
67,
654,
33529,
198,
220,
220,
220,
13538,
15931,
15931,
628,
220,
220,
220,
1303,
29677,
1573,
30104,
198,
220,
220,
220,
1573,
62,
20521,
67,
654,
796,
23884,
198,
220,
220,
220,
277,
796,
1280,
7,
20521,
12083,
62,
6978,
1343,
366,
4743,
659,
13,
21,
33,
13,
3064,
67,
13,
14116,
1600,
21004,
2625,
40477,
12,
23,
4943,
198,
220,
220,
220,
329,
1627,
287,
277,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3815,
796,
1627,
13,
35312,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
1573,
796,
3815,
58,
15,
60,
198,
220,
220,
220,
220,
220,
220,
220,
763,
891,
82,
796,
45941,
13,
292,
18747,
7,
27160,
58,
16,
25,
4357,
288,
4906,
2625,
22468,
2624,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
1573,
62,
20521,
67,
654,
58,
4775,
60,
796,
763,
891,
82,
198,
220,
220,
220,
277,
13,
19836,
3419,
628,
220,
220,
220,
1441,
1573,
62,
20521,
67,
654,
628,
198,
4299,
15676,
786,
62,
7217,
7,
20205,
11,
299,
28,
18,
2599,
198,
220,
220,
220,
13538,
15931,
15931,
198,
220,
220,
220,
1303,
10568,
763,
12,
35790,
2428,
198,
220,
220,
220,
23163,
796,
299,
34431,
7,
20205,
737,
44807,
7295,
69,
62,
565,
13654,
628,
220,
220,
220,
611,
318,
39098,
7,
565,
13654,
11,
2099,
7,
14202,
8,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
1007,
62,
11600,
796,
23884,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
23163,
796,
8106,
7,
14202,
11,
23163,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1007,
62,
11600,
796,
1391,
2536,
7,
72,
58,
16,
60,
2599,
965,
7,
72,
58,
15,
12962,
329,
1312,
287,
23163,
92,
628,
220,
220,
220,
329,
479,
11,
410,
287,
1007,
62,
11600,
13,
23814,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
2708,
796,
2708,
13,
33491,
7,
74,
11,
410,
8,
628,
220,
220,
220,
13439,
796,
1908,
62,
30001,
1096,
7,
20205,
8,
628,
220,
220,
220,
1441,
13439,
58,
25,
77,
60,
628,
198,
4299,
15676,
786,
7,
20205,
11,
1573,
62,
20521,
67,
654,
2599,
198,
220,
220,
220,
13538,
15931,
15931,
628,
220,
220,
220,
13439,
796,
17635,
628,
220,
220,
220,
1303,
10568,
763,
12,
35790,
2428,
198,
220,
220,
220,
23163,
796,
299,
34431,
7,
20205,
737,
44807,
7295,
69,
62,
565,
13654,
628,
220,
220,
220,
611,
2099,
7,
565,
13654,
8,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1007,
62,
11600,
796,
23884,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1007,
62,
11600,
796,
1391,
2536,
7,
72,
58,
16,
60,
2599,
965,
7,
72,
58,
15,
12962,
329,
1312,
287,
23163,
92,
628,
220,
220,
220,
329,
479,
11,
410,
287,
1007,
62,
11600,
13,
23814,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
2708,
796,
2708,
13,
33491,
7,
74,
11,
410,
8,
628,
220,
220,
220,
13439,
13,
33295,
7,
34086,
62,
30001,
1096,
7,
20205,
4008,
628,
220,
220,
220,
13439,
796,
685,
88,
329,
2124,
287,
13439,
329,
331,
287,
2124,
60,
220,
1303,
27172,
268,
1351,
628,
220,
220,
220,
1303,
4781,
21025,
6055,
11,
3146,
290,
2041,
3435,
628,
220,
220,
220,
611,
18896,
7,
34086,
3007,
8,
14512,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3424,
62,
34086,
3007,
796,
279,
67,
13,
27996,
7,
34086,
3007,
737,
2536,
13,
33491,
7203,
58,
61,
64,
12,
89,
32,
12,
57,
60,
1600,
366,
366,
8,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
17635,
628,
220,
220,
220,
1303,
787,
435,
746,
397,
1039,
2793,
7442,
198,
220,
220,
220,
3424,
62,
34086,
3007,
796,
685,
82,
13,
21037,
3419,
329,
264,
287,
3424,
62,
34086,
3007,
60,
628,
220,
220,
220,
2245,
62,
10879,
796,
2245,
10879,
13,
10879,
7203,
39126,
4943,
628,
220,
220,
220,
1303,
2163,
284,
4781,
2245,
10879,
628,
220,
220,
220,
1303,
4781,
2245,
10879,
422,
262,
13439,
198,
220,
220,
220,
3424,
62,
34086,
3007,
796,
685,
28956,
62,
11338,
10879,
7,
81,
13,
35312,
28955,
329,
374,
287,
3424,
62,
34086,
3007,
60,
628,
220,
220,
220,
6827,
62,
303,
5217,
796,
17635,
198,
220,
220,
220,
329,
1312,
287,
3424,
62,
34086,
3007,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
18896,
7,
72,
8,
14512,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
410,
796,
2160,
26933,
4775,
62,
20521,
67,
654,
13,
1136,
7,
86,
11,
45941,
13,
9107,
418,
19510,
3064,
11,
22305,
329,
266,
287,
1312,
13,
35312,
3419,
12962,
1220,
357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
18896,
7,
72,
13,
35312,
28955,
1343,
657,
13,
8298,
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,
410,
796,
45941,
13,
9107,
418,
19510,
3064,
11,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
6827,
62,
303,
5217,
13,
33295,
7,
85,
8,
628,
220,
220,
220,
825,
24061,
62,
9876,
27520,
7,
38,
11,
12159,
28,
15,
13,
5332,
11,
304,
862,
33576,
28,
940,
12429,
532,
19,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
412,
5632,
29964,
286,
262,
7873,
27520,
3815,
1262,
257,
29877,
9224,
330,
1387,
220,
198,
220,
220,
220,
220,
220,
220,
220,
17593,
290,
262,
11629,
876,
1176,
2446,
13,
628,
220,
220,
220,
220,
220,
220,
220,
40117,
198,
220,
220,
220,
220,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
220,
220,
220,
220,
402,
1058,
25131,
9224,
330,
1387,
17593,
13,
45941,
13,
30388,
23,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1002,
262,
5002,
474,
11,
72,
318,
6407,
11,
1724,
326,
612,
318,
257,
2792,
422,
1312,
284,
474,
13,
198,
220,
220,
220,
220,
220,
220,
220,
12159,
25,
352,
12,
46813,
10189,
12867,
13,
198,
220,
220,
220,
220,
220,
220,
220,
304,
862,
33576,
25,
2245,
4006,
13,
26265,
3142,
2033,
286,
1487,
287,
262,
7873,
49,
2283,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1022,
34820,
13,
628,
220,
220,
220,
220,
220,
220,
220,
16409,
198,
220,
220,
220,
220,
220,
220,
220,
35656,
198,
220,
220,
220,
220,
220,
220,
220,
5072,
1058,
46545,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7873,
27520,
7177,
39279,
1353,
530,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7913,
286,
34820,
13,
628,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
6208,
9224,
330,
1387,
17593,
318,
7477,
198,
220,
220,
220,
220,
220,
220,
220,
299,
11,
4808,
796,
402,
13,
43358,
198,
220,
220,
220,
220,
220,
220,
220,
6818,
402,
13,
43358,
6624,
357,
77,
11,
299,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
4757,
1187,
8729,
12,
8577,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
3396,
62,
448,
62,
31361,
796,
402,
13,
16345,
7,
22704,
28,
15,
737,
51,
198,
220,
220,
220,
220,
220,
220,
220,
3396,
62,
448,
62,
31361,
796,
357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
402,
13,
16345,
7,
22704,
28,
15,
737,
51,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1343,
45941,
13,
18747,
26933,
58,
15,
13,
18005,
60,
329,
2124,
287,
45941,
13,
283,
858,
7,
11925,
7,
38,
13,
16345,
7,
22704,
28,
15,
737,
51,
4008,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
1220,
12159,
220,
1303,
15879,
198,
220,
220,
220,
220,
220,
220,
220,
3396,
62,
448,
62,
31361,
796,
45941,
13,
18747,
7,
13500,
62,
448,
62,
31361,
11,
288,
4906,
28,
37659,
13,
22468,
2414,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
20768,
1096,
198,
220,
220,
220,
220,
220,
220,
220,
9803,
796,
45941,
13,
1952,
19510,
77,
11,
352,
4008,
1220,
299,
220,
1303,
15879,
198,
220,
220,
220,
220,
220,
220,
220,
640,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
6056,
796,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
981,
6056,
290,
640,
1279,
642,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
640,
15853,
352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
351,
45941,
13,
8056,
5219,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
14083,
2625,
46430,
1600,
12515,
2625,
46430,
1,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15179,
220,
1303,
41032,
7297,
416,
657,
319,
9803,
14,
13500,
62,
448,
62,
31361,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9803,
796,
45941,
13,
18747,
7,
81,
2283,
11,
288,
4906,
28,
37659,
13,
22468,
2414,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
649,
62,
81,
2283,
796,
402,
13,
26518,
19510,
81,
2283,
1220,
3396,
62,
448,
62,
31361,
4008,
220,
1303,
15879,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
1004,
4335,
7873,
27520,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
649,
62,
81,
2283,
15853,
357,
16,
532,
649,
62,
81,
2283,
13,
16345,
28955,
1220,
299,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
13707,
4006,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
45941,
13,
75,
1292,
70,
13,
27237,
7,
81,
2283,
532,
649,
62,
81,
2283,
11,
2760,
28,
16,
8,
19841,
304,
862,
33576,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6056,
796,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9803,
796,
649,
62,
81,
2283,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
1391,
74,
25,
410,
13,
9186,
7,
15,
8,
329,
479,
11,
410,
287,
27056,
378,
7,
81,
2283,
38165,
628,
220,
220,
220,
317,
796,
45941,
13,
6759,
8609,
7,
34086,
594,
62,
303,
5217,
8,
198,
220,
220,
220,
1233,
796,
8615,
500,
62,
38610,
414,
7,
32,
8,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
299,
87,
62,
34960,
796,
299,
87,
13,
6738,
62,
77,
32152,
62,
18747,
7,
17080,
8,
198,
220,
220,
220,
2845,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1208,
198,
220,
220,
220,
2603,
796,
299,
87,
13,
324,
30482,
1387,
62,
6759,
8609,
7,
77,
87,
62,
34960,
8,
628,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
8198,
796,
24061,
62,
9876,
27520,
7,
6759,
8,
198,
220,
220,
220,
2845,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
17635,
198,
220,
220,
220,
10307,
62,
34086,
3007,
796,
23243,
7,
198,
220,
220,
220,
220,
220,
220,
220,
14808,
1416,
2850,
58,
72,
4357,
264,
8,
329,
1312,
11,
264,
287,
27056,
378,
7,
34086,
3007,
36911,
9575,
28,
17821,
198,
220,
220,
220,
1267,
628,
220,
220,
220,
1441,
685,
28282,
62,
34086,
3007,
58,
72,
7131,
16,
60,
329,
1312,
287,
2837,
7,
16,
15437,
198
] | 2.205276 | 2,085 |
import cv2
import keras
import numpy as np
from keras.models import *
from keras.layers import *
from keras.optimizers import *
from .base import EdgeDetector
# Size of the edge mask matrix
TARGET_IMAGE_SIZE = 256
class UNetEdgeDetector(EdgeDetector):
"""
EdgeDetector implementation which uses the UNet deep learning architecture
to detect document edges.
Reference model: https://github.com/zhixuhao/unet
"""
def load_model(self, model_path):
"""
Load the given keras model, saved in the .h5 format.
"""
self.model.load_weights(model_path)
self.is_model_loaded = True
def evaluate(self, image):
"""
Evaluate the given image, extracting the edges and returning a 256x256 mask of them.
"""
assert self.is_model_loaded
# Resize the image to the standard 256x256 input size
resized_image = cv2.resize(image, (TARGET_IMAGE_SIZE, TARGET_IMAGE_SIZE))
# Convert the input image to float and move it to the 0-1 range
float_image = resized_image.astype("float32") / 255
# Add a new dimension, needed to feed the neural network
input_image = float_image.reshape(1, TARGET_IMAGE_SIZE, TARGET_IMAGE_SIZE, 3)
# Feed the model and reshape the given result
predicted_mask = self.model.predict(input_image).reshape(TARGET_IMAGE_SIZE, TARGET_IMAGE_SIZE)
# Convert the map to uint8 type and change range to 0-255
uint_mask = (predicted_mask * (255/np.max(predicted_mask))).astype("uint8")
return uint_mask
| [
11748,
269,
85,
17,
198,
11748,
41927,
292,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
41927,
292,
13,
27530,
1330,
1635,
198,
6738,
41927,
292,
13,
75,
6962,
1330,
1635,
198,
6738,
41927,
292,
13,
40085,
11341,
1330,
1635,
198,
198,
6738,
764,
8692,
1330,
13113,
11242,
9250,
198,
198,
2,
12849,
286,
262,
5743,
9335,
17593,
198,
51,
46095,
62,
3955,
11879,
62,
33489,
796,
17759,
198,
198,
4871,
4725,
316,
37021,
11242,
9250,
7,
37021,
11242,
9250,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
13113,
11242,
9250,
7822,
543,
3544,
262,
4725,
316,
2769,
4673,
10959,
198,
220,
220,
220,
284,
4886,
3188,
13015,
13,
628,
220,
220,
220,
20984,
2746,
25,
3740,
1378,
12567,
13,
785,
14,
23548,
844,
84,
23778,
14,
403,
316,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
3440,
62,
19849,
7,
944,
11,
2746,
62,
6978,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
8778,
262,
1813,
41927,
292,
2746,
11,
7448,
287,
262,
764,
71,
20,
5794,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
19849,
13,
2220,
62,
43775,
7,
19849,
62,
6978,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
271,
62,
19849,
62,
14578,
796,
6407,
198,
220,
220,
220,
220,
198,
220,
220,
220,
825,
13446,
7,
944,
11,
2939,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
26439,
4985,
262,
1813,
2939,
11,
37895,
262,
13015,
290,
8024,
257,
17759,
87,
11645,
9335,
286,
606,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
6818,
2116,
13,
271,
62,
19849,
62,
14578,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
1874,
1096,
262,
2939,
284,
262,
3210,
17759,
87,
11645,
5128,
2546,
198,
220,
220,
220,
220,
220,
220,
220,
581,
1143,
62,
9060,
796,
269,
85,
17,
13,
411,
1096,
7,
9060,
11,
357,
51,
46095,
62,
3955,
11879,
62,
33489,
11,
309,
46095,
62,
3955,
11879,
62,
33489,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
38240,
262,
5128,
2939,
284,
12178,
290,
1445,
340,
284,
262,
657,
12,
16,
2837,
198,
220,
220,
220,
220,
220,
220,
220,
12178,
62,
9060,
796,
581,
1143,
62,
9060,
13,
459,
2981,
7203,
22468,
2624,
4943,
1220,
14280,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
3060,
257,
649,
15793,
11,
2622,
284,
3745,
262,
17019,
3127,
198,
220,
220,
220,
220,
220,
220,
220,
5128,
62,
9060,
796,
12178,
62,
9060,
13,
3447,
1758,
7,
16,
11,
309,
46095,
62,
3955,
11879,
62,
33489,
11,
309,
46095,
62,
3955,
11879,
62,
33489,
11,
513,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
18272,
262,
2746,
290,
27179,
1758,
262,
1813,
1255,
198,
220,
220,
220,
220,
220,
220,
220,
11001,
62,
27932,
796,
2116,
13,
19849,
13,
79,
17407,
7,
15414,
62,
9060,
737,
3447,
1758,
7,
51,
46095,
62,
3955,
11879,
62,
33489,
11,
309,
46095,
62,
3955,
11879,
62,
33489,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
38240,
262,
3975,
284,
20398,
23,
2099,
290,
1487,
2837,
284,
657,
12,
13381,
198,
220,
220,
220,
220,
220,
220,
220,
20398,
62,
27932,
796,
357,
28764,
5722,
62,
27932,
1635,
357,
13381,
14,
37659,
13,
9806,
7,
28764,
5722,
62,
27932,
4008,
737,
459,
2981,
7203,
28611,
23,
4943,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
20398,
62,
27932,
628,
220,
220,
220,
220,
220,
220,
220,
220,
198
] | 2.553628 | 634 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CERN.
#
# CDS-ILS is free software; you can redistribute it and/or modify it under
# the terms of the MIT License; see LICENSE file for more details.
"""CDS-ILS migrator module."""
from cds_dojson.overdo import OverdoBase
serial_marc21 = OverdoBase(entry_point_models="cds_ils.migrator.serial_model")
journal_marc21 = OverdoBase(
entry_point_models="cds_ils.migrator.journal_model"
)
multipart_marc21 = OverdoBase(
entry_point_models="cds_ils.migrator.multipart_model"
)
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
357,
34,
8,
12131,
327,
28778,
13,
198,
2,
198,
2,
327,
5258,
12,
45484,
318,
1479,
3788,
26,
345,
460,
17678,
4163,
340,
290,
14,
273,
13096,
340,
739,
198,
2,
262,
2846,
286,
262,
17168,
13789,
26,
766,
38559,
24290,
2393,
329,
517,
3307,
13,
198,
198,
37811,
34,
5258,
12,
45484,
15720,
1352,
8265,
526,
15931,
198,
6738,
269,
9310,
62,
4598,
17752,
13,
2502,
4598,
1330,
3827,
4598,
14881,
198,
198,
46911,
62,
3876,
66,
2481,
796,
3827,
4598,
14881,
7,
13000,
62,
4122,
62,
27530,
2625,
66,
9310,
62,
4487,
13,
76,
3692,
1352,
13,
46911,
62,
19849,
4943,
198,
24891,
62,
3876,
66,
2481,
796,
3827,
4598,
14881,
7,
198,
220,
220,
220,
5726,
62,
4122,
62,
27530,
2625,
66,
9310,
62,
4487,
13,
76,
3692,
1352,
13,
24891,
62,
19849,
1,
198,
8,
198,
16680,
541,
433,
62,
3876,
66,
2481,
796,
3827,
4598,
14881,
7,
198,
220,
220,
220,
5726,
62,
4122,
62,
27530,
2625,
66,
9310,
62,
4487,
13,
76,
3692,
1352,
13,
16680,
541,
433,
62,
19849,
1,
198,
8,
198
] | 2.653266 | 199 |
import connexion
import six
from papahana.models.instrument_enum import InstrumentEnum
from papahana.models.instrument_package import InstrumentPackage
from papahana import util
from papahana.controllers import controller_helper as utils
def instrument_packages(instrument):
"""instrument_packages
Retrieves the the available instrument packages for an instrument.
:param instrument: instrument used to make observation
:type instrument: str
:rtype: [InstrumentPackage]
"""
if connexion.request.is_json:
instrument = InstrumentEnum.from_dict(connexion.request.get_json())
query = {'instrument': instrument}
return utils.get_by_query(query, 'templateCollect')
def instrument_packages_ip_parameter(instrument, ip_version):
"""
List all template parameters that can be attached to OBs using this
instrument package
:param instrument: instrument used to make observation
:type instrument: str
:param ip_version: ip version description here
:type ip_version: float
:rtype: InstrumentPackage
"""
if connexion.request.is_json:
instrument = InstrumentEnum.from_dict(connexion.request.get_json())
query = {"instrument": instrument, "version": ip_version}
fields ={"_id": 0, "optical_parameters": 1, "guider": 1,
"common_inst_params": 1, "pointing_origins": 1}
return utils.get_fields_by_query(query, fields, 'ipCollect')
def instrument_packages_ip_template(instrument, ip_version, template_name=None):
"""
Retrieves the specified instrument package template metadata
:param instrument: instrument used to make observation
:type instrument: str
:param ip_version: ip version description here
:type ip_version: float
:param template_name: template name description goes here
:type template_name: str
:rtype: InstrumentPackage
"""
# if connexion.request.is_json:
# instrument = InstrumentEnum.from_dict(connexion.request.get_json())
if template_name:
return {template_name: get_template_metadata(template_name, ip_version)}
query = {"instrument": instrument.upper(), "version": ip_version}
fields = {"template_names": 1, "_id": 0}
templates = utils.get_fields_by_query(query, fields, 'ipCollect')
metadata = {}
for template_name in templates["template_names"]:
metadata[template_name] = get_template_metadata(template_name, ip_version)
return metadata
| [
11748,
369,
12413,
295,
198,
11748,
2237,
198,
198,
6738,
20461,
993,
2271,
13,
27530,
13,
259,
43872,
62,
44709,
1330,
42410,
4834,
388,
198,
6738,
20461,
993,
2271,
13,
27530,
13,
259,
43872,
62,
26495,
1330,
42410,
27813,
198,
6738,
20461,
993,
2271,
1330,
7736,
198,
198,
6738,
20461,
993,
2271,
13,
3642,
36667,
1330,
10444,
62,
2978,
525,
355,
3384,
4487,
628,
198,
4299,
8875,
62,
43789,
7,
259,
43872,
2599,
198,
220,
220,
220,
37227,
259,
43872,
62,
43789,
628,
220,
220,
220,
4990,
5034,
1158,
262,
262,
1695,
8875,
10392,
329,
281,
8875,
13,
628,
220,
220,
220,
1058,
17143,
8875,
25,
8875,
973,
284,
787,
13432,
198,
220,
220,
220,
1058,
4906,
8875,
25,
965,
628,
220,
220,
220,
1058,
81,
4906,
25,
685,
818,
43872,
27813,
60,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
611,
369,
12413,
295,
13,
25927,
13,
271,
62,
17752,
25,
198,
220,
220,
220,
220,
220,
220,
220,
8875,
796,
42410,
4834,
388,
13,
6738,
62,
11600,
7,
1102,
12413,
295,
13,
25927,
13,
1136,
62,
17752,
28955,
628,
220,
220,
220,
12405,
796,
1391,
6,
259,
43872,
10354,
8875,
92,
628,
220,
220,
220,
1441,
3384,
4487,
13,
1136,
62,
1525,
62,
22766,
7,
22766,
11,
705,
28243,
31337,
11537,
628,
198,
4299,
8875,
62,
43789,
62,
541,
62,
17143,
2357,
7,
259,
43872,
11,
20966,
62,
9641,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
7343,
477,
11055,
10007,
326,
460,
307,
7223,
284,
25334,
82,
1262,
428,
198,
220,
220,
220,
8875,
5301,
628,
220,
220,
220,
1058,
17143,
8875,
25,
8875,
973,
284,
787,
13432,
198,
220,
220,
220,
1058,
4906,
8875,
25,
965,
198,
220,
220,
220,
1058,
17143,
20966,
62,
9641,
25,
20966,
2196,
6764,
994,
198,
220,
220,
220,
1058,
4906,
20966,
62,
9641,
25,
12178,
628,
220,
220,
220,
1058,
81,
4906,
25,
42410,
27813,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
611,
369,
12413,
295,
13,
25927,
13,
271,
62,
17752,
25,
198,
220,
220,
220,
220,
220,
220,
220,
8875,
796,
42410,
4834,
388,
13,
6738,
62,
11600,
7,
1102,
12413,
295,
13,
25927,
13,
1136,
62,
17752,
28955,
628,
220,
220,
220,
12405,
796,
19779,
259,
43872,
1298,
8875,
11,
366,
9641,
1298,
20966,
62,
9641,
92,
198,
220,
220,
220,
7032,
796,
4895,
62,
312,
1298,
657,
11,
366,
8738,
605,
62,
17143,
7307,
1298,
352,
11,
366,
5162,
1304,
1298,
352,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
11321,
62,
8625,
62,
37266,
1298,
352,
11,
366,
4122,
278,
62,
11612,
1040,
1298,
352,
92,
628,
220,
220,
220,
1441,
3384,
4487,
13,
1136,
62,
25747,
62,
1525,
62,
22766,
7,
22766,
11,
7032,
11,
705,
541,
31337,
11537,
628,
198,
4299,
8875,
62,
43789,
62,
541,
62,
28243,
7,
259,
43872,
11,
20966,
62,
9641,
11,
11055,
62,
3672,
28,
14202,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
4990,
5034,
1158,
262,
7368,
8875,
5301,
11055,
20150,
628,
220,
220,
220,
1058,
17143,
8875,
25,
8875,
973,
284,
787,
13432,
198,
220,
220,
220,
1058,
4906,
8875,
25,
965,
198,
220,
220,
220,
1058,
17143,
20966,
62,
9641,
25,
20966,
2196,
6764,
994,
198,
220,
220,
220,
1058,
4906,
20966,
62,
9641,
25,
12178,
198,
220,
220,
220,
1058,
17143,
11055,
62,
3672,
25,
11055,
1438,
6764,
2925,
994,
198,
220,
220,
220,
1058,
4906,
11055,
62,
3672,
25,
965,
628,
220,
220,
220,
1058,
81,
4906,
25,
42410,
27813,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1303,
611,
369,
12413,
295,
13,
25927,
13,
271,
62,
17752,
25,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
8875,
796,
42410,
4834,
388,
13,
6738,
62,
11600,
7,
1102,
12413,
295,
13,
25927,
13,
1136,
62,
17752,
28955,
628,
220,
220,
220,
611,
11055,
62,
3672,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
1391,
28243,
62,
3672,
25,
651,
62,
28243,
62,
38993,
7,
28243,
62,
3672,
11,
20966,
62,
9641,
38165,
628,
220,
220,
220,
12405,
796,
19779,
259,
43872,
1298,
8875,
13,
45828,
22784,
366,
9641,
1298,
20966,
62,
9641,
92,
198,
220,
220,
220,
7032,
796,
19779,
28243,
62,
14933,
1298,
352,
11,
45434,
312,
1298,
657,
92,
198,
220,
220,
220,
24019,
796,
3384,
4487,
13,
1136,
62,
25747,
62,
1525,
62,
22766,
7,
22766,
11,
7032,
11,
705,
541,
31337,
11537,
628,
220,
220,
220,
20150,
796,
23884,
198,
220,
220,
220,
329,
11055,
62,
3672,
287,
24019,
14692,
28243,
62,
14933,
1,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
20150,
58,
28243,
62,
3672,
60,
796,
651,
62,
28243,
62,
38993,
7,
28243,
62,
3672,
11,
20966,
62,
9641,
8,
628,
220,
220,
220,
1441,
20150,
198
] | 3.087282 | 802 |
from collections import OrderedDict
import torch
from torchvision import models
from torchvision.ops import FeaturePyramidNetwork
from dvmvs.config import Config
from dvmvs.convlstm import MVSLayernormConvLSTMCell
from dvmvs.layers import conv_layer, depth_layer_3x3
fpn_output_channels = 32
hyper_channels = 32
| [
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
198,
11748,
28034,
198,
6738,
28034,
10178,
1330,
4981,
198,
6738,
28034,
10178,
13,
2840,
1330,
27018,
20519,
20255,
26245,
198,
198,
6738,
288,
14761,
14259,
13,
11250,
1330,
17056,
198,
6738,
288,
14761,
14259,
13,
1102,
19279,
301,
76,
1330,
32947,
8634,
323,
1142,
579,
3103,
85,
43,
2257,
9655,
695,
198,
6738,
288,
14761,
14259,
13,
75,
6962,
1330,
3063,
62,
29289,
11,
6795,
62,
29289,
62,
18,
87,
18,
198,
198,
69,
21999,
62,
22915,
62,
354,
8961,
796,
3933,
198,
49229,
62,
354,
8961,
796,
3933,
628,
628,
628,
628,
628,
198
] | 3.125 | 104 |
#!/usr/bin/python
from fabric.operations import local as lrun, run
from fabric.api import env,cd,run,settings,task
from fabric.colors import cyan,red
import sys
# Usage for VXML -> fab domain_vxml -H <hostname>
# Usage for VCS -> fab domain_vcs -H <hostname>
env.user = 'root'
# Take the host name argument and split it to get the data center.
host=sys.argv[3]
dc=host.split('.')
# VXML use fab domain_vxml -H <hostname>
# Function to compare the dc value and execute the function to move to appropiate meter server.
# One of the following functions will be executed based off the condition above.
# Take the host name argument and split it to get the data center.
#host=sys.argv[3]
#dc=host.split('.')
# VCS : Use fab domain_vcs -H <hostname>
# Function to compare the dc value and execute the function to move to appropiate meter server.
# One of the following functions will be executed based off the condition above.
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
6738,
9664,
13,
3575,
602,
1330,
1957,
355,
300,
5143,
11,
1057,
198,
6738,
9664,
13,
15042,
1330,
17365,
11,
10210,
11,
5143,
11,
33692,
11,
35943,
198,
6738,
9664,
13,
4033,
669,
1330,
36818,
11,
445,
198,
11748,
25064,
198,
2,
29566,
329,
569,
55,
5805,
4613,
7843,
7386,
62,
85,
19875,
532,
39,
1279,
4774,
3672,
29,
198,
2,
29566,
329,
569,
7902,
4613,
7843,
7386,
62,
85,
6359,
532,
39,
1279,
4774,
3672,
29,
198,
24330,
13,
7220,
796,
705,
15763,
6,
198,
2,
7214,
262,
2583,
1438,
4578,
290,
6626,
340,
284,
651,
262,
1366,
3641,
13,
198,
4774,
28,
17597,
13,
853,
85,
58,
18,
60,
198,
17896,
28,
4774,
13,
35312,
10786,
2637,
8,
198,
2,
569,
55,
5805,
779,
7843,
7386,
62,
85,
19875,
532,
39,
1279,
4774,
3672,
29,
198,
2,
15553,
284,
8996,
262,
30736,
1988,
290,
12260,
262,
2163,
284,
1445,
284,
1331,
79,
9386,
16430,
4382,
13,
198,
2,
1881,
286,
262,
1708,
5499,
481,
307,
10945,
1912,
572,
262,
4006,
2029,
13,
628,
198,
198,
2,
7214,
262,
2583,
1438,
4578,
290,
6626,
340,
284,
651,
262,
1366,
3641,
13,
198,
2,
4774,
28,
17597,
13,
853,
85,
58,
18,
60,
198,
2,
17896,
28,
4774,
13,
35312,
10786,
2637,
8,
198,
2,
569,
7902,
1058,
5765,
7843,
7386,
62,
85,
6359,
532,
39,
1279,
4774,
3672,
29,
198,
2,
15553,
284,
8996,
262,
30736,
1988,
290,
12260,
262,
2163,
284,
1445,
284,
1331,
79,
9386,
16430,
4382,
13,
198,
2,
1881,
286,
262,
1708,
5499,
481,
307,
10945,
1912,
572,
262,
4006,
2029,
13,
628,
628,
198
] | 3.338129 | 278 |
import sympy as sy
from scipy import signal
| [
11748,
10558,
88,
355,
827,
198,
6738,
629,
541,
88,
1330,
6737,
198
] | 3.384615 | 13 |
from .question import Question
from .matcher import Matcher
see_that = Condition
| [
6738,
764,
25652,
1330,
18233,
198,
6738,
764,
6759,
2044,
1330,
6550,
2044,
628,
198,
198,
3826,
62,
5562,
796,
24295,
198
] | 3.818182 | 22 |
#
from clld.web.util.helpers import rendered_sentence | [
2,
198,
6738,
269,
297,
67,
13,
12384,
13,
22602,
13,
16794,
364,
1330,
15111,
62,
34086,
594
] | 2.944444 | 18 |
from __future__ import absolute_import
from django import template
from django.template.loader import render_to_string
from alacarte import get_menus
register = template.Library()
@register.tag
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
6738,
42625,
14208,
1330,
11055,
198,
6738,
42625,
14208,
13,
28243,
13,
29356,
1330,
8543,
62,
1462,
62,
8841,
198,
198,
6738,
435,
330,
32074,
1330,
651,
62,
3653,
385,
198,
198,
30238,
796,
11055,
13,
23377,
3419,
628,
198,
198,
31,
30238,
13,
12985,
198
] | 3.571429 | 56 |
from .base import CallbackEngine, Callback
from . import essentials
from . import scheduling | [
6738,
764,
8692,
1330,
4889,
1891,
13798,
11,
4889,
1891,
198,
6738,
764,
1330,
41954,
198,
6738,
764,
1330,
26925
] | 4.6 | 20 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.