content
stringlengths 1
1.04M
| input_ids
sequencelengths 1
774k
| ratio_char_token
float64 0.38
22.9
| token_count
int64 1
774k
|
---|---|---|---|
from django.contrib.auth import get_user_model
from django.db import models
from cajas.users.models.partner import Partner
User = get_user_model()
class Unit(models.Model):
"""
"""
name = models.CharField(
'Nombre',
max_length=255,
)
partner = models.ForeignKey(
Partner,
verbose_name='Socio',
on_delete=models.SET_NULL,
blank=True, null=True,
related_name='related_units'
)
collector = models.ForeignKey(
User,
verbose_name='Cobrador',
on_delete=models.SET_NULL,
blank=True, null=True,
related_name='related_collector_units'
)
supervisor = models.ForeignKey(
User,
verbose_name='Supervisor',
on_delete=models.SET_NULL,
blank=True, null=True,
related_name='related_supervisor_units'
)
is_active = models.BooleanField(
'Unidad Activa',
default=True
)
observations = models.TextField(
'Observaciones',
help_text='Por que se elimino el item?',
blank=True, null=True
)
| [
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
651,
62,
7220,
62,
19849,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
6738,
269,
1228,
292,
13,
18417,
13,
27530,
13,
3911,
1008,
1330,
35532,
198,
12982,
796,
651,
62,
7220,
62,
19849,
3419,
628,
198,
4871,
11801,
7,
27530,
13,
17633,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
1438,
796,
4981,
13,
12441,
15878,
7,
198,
220,
220,
220,
220,
220,
220,
220,
705,
45,
2381,
260,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
3509,
62,
13664,
28,
13381,
11,
198,
220,
220,
220,
1267,
198,
220,
220,
220,
5212,
796,
4981,
13,
33616,
9218,
7,
198,
220,
220,
220,
220,
220,
220,
220,
35532,
11,
198,
220,
220,
220,
220,
220,
220,
220,
15942,
577,
62,
3672,
11639,
37949,
952,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
319,
62,
33678,
28,
27530,
13,
28480,
62,
33991,
11,
198,
220,
220,
220,
220,
220,
220,
220,
9178,
28,
17821,
11,
9242,
28,
17821,
11,
198,
220,
220,
220,
220,
220,
220,
220,
3519,
62,
3672,
11639,
5363,
62,
41667,
6,
198,
220,
220,
220,
1267,
198,
220,
220,
220,
22967,
796,
4981,
13,
33616,
9218,
7,
198,
220,
220,
220,
220,
220,
220,
220,
11787,
11,
198,
220,
220,
220,
220,
220,
220,
220,
15942,
577,
62,
3672,
11639,
34,
672,
40368,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
319,
62,
33678,
28,
27530,
13,
28480,
62,
33991,
11,
198,
220,
220,
220,
220,
220,
220,
220,
9178,
28,
17821,
11,
9242,
28,
17821,
11,
198,
220,
220,
220,
220,
220,
220,
220,
3519,
62,
3672,
11639,
5363,
62,
33327,
273,
62,
41667,
6,
198,
220,
220,
220,
1267,
198,
220,
220,
220,
21277,
796,
4981,
13,
33616,
9218,
7,
198,
220,
220,
220,
220,
220,
220,
220,
11787,
11,
198,
220,
220,
220,
220,
220,
220,
220,
15942,
577,
62,
3672,
11639,
12442,
13131,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
319,
62,
33678,
28,
27530,
13,
28480,
62,
33991,
11,
198,
220,
220,
220,
220,
220,
220,
220,
9178,
28,
17821,
11,
9242,
28,
17821,
11,
198,
220,
220,
220,
220,
220,
220,
220,
3519,
62,
3672,
11639,
5363,
62,
16668,
13131,
62,
41667,
6,
198,
220,
220,
220,
1267,
198,
220,
220,
220,
318,
62,
5275,
796,
4981,
13,
46120,
13087,
15878,
7,
198,
220,
220,
220,
220,
220,
220,
220,
705,
3118,
32482,
2191,
12151,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
4277,
28,
17821,
198,
220,
220,
220,
1267,
198,
220,
220,
220,
13050,
796,
4981,
13,
8206,
15878,
7,
198,
220,
220,
220,
220,
220,
220,
220,
705,
31310,
712,
49443,
274,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
1037,
62,
5239,
11639,
47,
273,
8358,
384,
5687,
2879,
1288,
2378,
30,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
9178,
28,
17821,
11,
9242,
28,
17821,
198,
220,
220,
220,
1267,
198
] | 2.186508 | 504 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.891892 | 37 |
#!/usr/bin/env python
#
# Copyright 2007 Google 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.
#
"""Schedule callables to run at a particular time."""
import heapq
import threading
import time
class ScheduledExecutor(object):
"""An executor that supports scheduling."""
def add_event(self, runnable, eta, key=None):
"""Schedule an event to be run.
Args:
runnable: A callable to run.
eta: An int containing when to run runnable in seconds since the epoch.
key: An optional key that implements __hash__ that can be passed to
update_event.
"""
event = _Event(eta, runnable, key)
with self._work_ready_condition:
if key is not None:
self._key_to_events[key] = event
self._enqueue_event(event)
def update_event(self, eta, key):
"""Modify when an event should be run.
Args:
eta: An int containing when to schedule the event in seconds since the
epoch.
key: The key of the event to modify.
"""
with self._work_ready_condition:
old_event = self._key_to_events.get(key)
if old_event:
event = old_event.copy(eta)
old_event.cancel()
self._key_to_events[key] = event
self._enqueue_event(event)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
15069,
4343,
3012,
3457,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
7330,
257,
4866,
286,
262,
13789,
379,
198,
2,
198,
2,
220,
220,
220,
220,
2638,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
43,
2149,
24290,
12,
17,
13,
15,
198,
2,
198,
2,
17486,
2672,
416,
9723,
1099,
393,
4987,
284,
287,
3597,
11,
3788,
198,
2,
9387,
739,
262,
13789,
318,
9387,
319,
281,
366,
1921,
3180,
1,
29809,
1797,
11,
198,
2,
42881,
34764,
11015,
6375,
7102,
49828,
11053,
3963,
15529,
509,
12115,
11,
2035,
4911,
393,
17142,
13,
198,
2,
4091,
262,
13789,
329,
262,
2176,
3303,
15030,
21627,
290,
198,
2,
11247,
739,
262,
13789,
13,
198,
2,
198,
37811,
27054,
5950,
869,
2977,
284,
1057,
379,
257,
1948,
640,
526,
15931,
198,
198,
11748,
24575,
80,
198,
11748,
4704,
278,
198,
11748,
640,
628,
198,
198,
4871,
27774,
6309,
23002,
38409,
7,
15252,
2599,
198,
220,
37227,
2025,
3121,
273,
326,
6971,
26925,
526,
15931,
628,
220,
825,
751,
62,
15596,
7,
944,
11,
1057,
77,
540,
11,
2123,
64,
11,
1994,
28,
14202,
2599,
198,
220,
220,
220,
37227,
27054,
5950,
281,
1785,
284,
307,
1057,
13,
628,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
1057,
77,
540,
25,
317,
869,
540,
284,
1057,
13,
198,
220,
220,
220,
220,
220,
2123,
64,
25,
1052,
493,
7268,
618,
284,
1057,
1057,
77,
540,
287,
4201,
1201,
262,
36835,
13,
198,
220,
220,
220,
220,
220,
1994,
25,
1052,
11902,
1994,
326,
23986,
11593,
17831,
834,
326,
460,
307,
3804,
284,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4296,
62,
15596,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1785,
796,
4808,
9237,
7,
17167,
11,
1057,
77,
540,
11,
1994,
8,
198,
220,
220,
220,
351,
2116,
13557,
1818,
62,
1493,
62,
31448,
25,
198,
220,
220,
220,
220,
220,
611,
1994,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
2539,
62,
1462,
62,
31534,
58,
2539,
60,
796,
1785,
198,
220,
220,
220,
220,
220,
2116,
13557,
268,
36560,
62,
15596,
7,
15596,
8,
628,
220,
825,
4296,
62,
15596,
7,
944,
11,
2123,
64,
11,
1994,
2599,
198,
220,
220,
220,
37227,
5841,
1958,
618,
281,
1785,
815,
307,
1057,
13,
628,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
2123,
64,
25,
1052,
493,
7268,
618,
284,
7269,
262,
1785,
287,
4201,
1201,
262,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
36835,
13,
198,
220,
220,
220,
220,
220,
1994,
25,
383,
1994,
286,
262,
1785,
284,
13096,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
351,
2116,
13557,
1818,
62,
1493,
62,
31448,
25,
198,
220,
220,
220,
220,
220,
1468,
62,
15596,
796,
2116,
13557,
2539,
62,
1462,
62,
31534,
13,
1136,
7,
2539,
8,
198,
220,
220,
220,
220,
220,
611,
1468,
62,
15596,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1785,
796,
1468,
62,
15596,
13,
30073,
7,
17167,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1468,
62,
15596,
13,
66,
21130,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
2539,
62,
1462,
62,
31534,
58,
2539,
60,
796,
1785,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
268,
36560,
62,
15596,
7,
15596,
8,
198
] | 2.859477 | 612 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
{
"server": server['server'],
"server_ipv6": "::",
"server_port": int(server['server_port']),
"local_address": "127.0.0.1",
"local_port": 1080,
"password": server['password'],
"timeout": 300,
"udp_timeout": 60,
"method": method,
"protocol": ssr_protocol,
"protocol_param": "",
"obfs": obfs,
"obfs_param": "",
"fast_open": False,
"workers": 1,
"group": "ss.pythonic.life"
}
"""
from ast import literal_eval
import json
import logging
import regex as re
import requests
import cfscrape
import js2py
from bs4 import BeautifulSoup
from ssshare.ss.parse import parse, scanNetQR, gen_uri, decode
from ssshare.ss.ssr_check import validate
import time
fake_ua = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36'}
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
90,
198,
220,
220,
220,
366,
15388,
1298,
4382,
17816,
15388,
6,
4357,
198,
220,
220,
220,
366,
15388,
62,
541,
85,
21,
1298,
366,
3712,
1600,
198,
220,
220,
220,
366,
15388,
62,
634,
1298,
493,
7,
15388,
17816,
15388,
62,
634,
20520,
828,
198,
220,
220,
220,
366,
12001,
62,
21975,
1298,
366,
16799,
13,
15,
13,
15,
13,
16,
1600,
198,
220,
220,
220,
366,
12001,
62,
634,
1298,
17729,
11,
198,
220,
220,
220,
366,
28712,
1298,
4382,
17816,
28712,
6,
4357,
198,
220,
220,
220,
366,
48678,
1298,
5867,
11,
198,
220,
220,
220,
366,
463,
79,
62,
48678,
1298,
3126,
11,
198,
220,
220,
220,
366,
24396,
1298,
2446,
11,
198,
220,
220,
220,
366,
11235,
4668,
1298,
264,
27891,
62,
11235,
4668,
11,
198,
220,
220,
220,
366,
11235,
4668,
62,
17143,
1298,
366,
1600,
198,
220,
220,
220,
366,
672,
9501,
1298,
909,
9501,
11,
198,
220,
220,
220,
366,
672,
9501,
62,
17143,
1298,
366,
1600,
198,
220,
220,
220,
366,
7217,
62,
9654,
1298,
10352,
11,
198,
220,
220,
220,
366,
22896,
1298,
352,
11,
198,
220,
220,
220,
366,
8094,
1298,
366,
824,
13,
29412,
291,
13,
6042,
1,
198,
92,
198,
37811,
198,
6738,
6468,
1330,
18875,
62,
18206,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
40364,
355,
302,
198,
11748,
7007,
198,
11748,
30218,
1416,
13484,
198,
11748,
44804,
17,
9078,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
6738,
264,
824,
43466,
13,
824,
13,
29572,
1330,
21136,
11,
9367,
7934,
48,
49,
11,
2429,
62,
9900,
11,
36899,
198,
6738,
264,
824,
43466,
13,
824,
13,
824,
81,
62,
9122,
1330,
26571,
198,
11748,
640,
198,
198,
30706,
62,
6413,
796,
1391,
6,
12982,
12,
36772,
10354,
705,
44,
8590,
5049,
14,
20,
13,
15,
357,
11209,
24563,
838,
13,
15,
26,
7178,
2414,
26,
2124,
2414,
8,
4196,
13908,
20827,
14,
46096,
13,
2623,
357,
42,
28656,
11,
588,
2269,
37549,
8,
13282,
14,
3134,
13,
15,
13,
2091,
4846,
13,
5774,
23298,
14,
46096,
13,
2623,
6,
92,
628,
628,
628
] | 2.412234 | 376 |
"""Song Models File."""
from mongoengine import (Document, EmbeddedDocument, EmbeddedDocumentListField,
FloatField, IntField, ObjectIdField, StringField)
class SongRatings(EmbeddedDocument):
"""Song Ratings Model."""
song_id = ObjectIdField(required=True)
rating = IntField(min_value=1, max_value=5, required=True)
class Songs(Document):
"""Song Model."""
artist = StringField(max_length=200, required=True)
title = StringField(max_length=200, required=True)
difficulty = FloatField(required=True)
level = FloatField(required=True)
released = StringField(max_length=200, required=True)
ratings = EmbeddedDocumentListField(SongRatings, required=False)
| [
37811,
44241,
32329,
9220,
526,
15931,
198,
198,
6738,
285,
25162,
18392,
1330,
357,
24941,
11,
13302,
47238,
24941,
11,
13302,
47238,
24941,
8053,
15878,
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,
48436,
15878,
11,
2558,
15878,
11,
9515,
7390,
15878,
11,
10903,
15878,
8,
628,
198,
4871,
10940,
29665,
654,
7,
31567,
47238,
24941,
2599,
198,
220,
220,
220,
37227,
44241,
36826,
9104,
526,
15931,
628,
220,
220,
220,
3496,
62,
312,
796,
9515,
7390,
15878,
7,
35827,
28,
17821,
8,
198,
220,
220,
220,
7955,
796,
2558,
15878,
7,
1084,
62,
8367,
28,
16,
11,
3509,
62,
8367,
28,
20,
11,
2672,
28,
17821,
8,
628,
198,
4871,
31772,
7,
24941,
2599,
198,
220,
220,
220,
37227,
44241,
9104,
526,
15931,
628,
220,
220,
220,
6802,
796,
10903,
15878,
7,
9806,
62,
13664,
28,
2167,
11,
2672,
28,
17821,
8,
198,
220,
220,
220,
3670,
796,
10903,
15878,
7,
9806,
62,
13664,
28,
2167,
11,
2672,
28,
17821,
8,
198,
220,
220,
220,
8722,
796,
48436,
15878,
7,
35827,
28,
17821,
8,
198,
220,
220,
220,
1241,
796,
48436,
15878,
7,
35827,
28,
17821,
8,
198,
220,
220,
220,
2716,
796,
10903,
15878,
7,
9806,
62,
13664,
28,
2167,
11,
2672,
28,
17821,
8,
198,
220,
220,
220,
10109,
796,
13302,
47238,
24941,
8053,
15878,
7,
44241,
29665,
654,
11,
2672,
28,
25101,
8,
198
] | 2.939024 | 246 |
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
| [
6738,
384,
11925,
1505,
1330,
3992,
26230,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
6495,
12792,
13,
25811,
1330,
18634,
198,
6738,
384,
11925,
1505,
13,
11321,
13,
1069,
11755,
1330,
1400,
16678,
20180,
16922,
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,
628,
198,
220,
220,
220,
220,
220,
220,
220,
220,
628
] | 3.421053 | 95 |
from index import *
from v1 import *
| [
6738,
6376,
1330,
1635,
198,
6738,
410,
16,
1330,
1635,
198
] | 3.363636 | 11 |
import numpy as np
import matplotlib.pyplot as plt
rows,cols = 5, 9
Z1 = np.linspace(0,1,rows*cols).reshape(rows,cols)
show_array(Z1, 'ops-where-before.png')
Z2 = np.where(Z1 > 0.5, 0, 1)
show_array(Z2, 'ops-where-after.png')
Z1 = np.linspace(0,1,rows*cols).reshape(rows,cols)
show_array(Z1, 'ops-maximum-before.png')
Z2 = np.maximum(Z1, 0.5)
show_array(Z2, 'ops-maximum-after.png')
Z1 = np.linspace(0,1,rows*cols).reshape(rows,cols)
show_array(Z1, 'ops-minimum-before.png')
Z2 = np.minimum(Z1, 0.5)
show_array(Z2, 'ops-minimum-after.png')
Z1 = np.linspace(0,1,rows*cols).reshape(rows,cols)
show_array(Z1, 'ops-sum-before.png')
Z2 = Z1.sum(axis=0)
show_array(Z2, 'ops-sum-after.png')
| [
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
628,
198,
198,
8516,
11,
4033,
82,
796,
642,
11,
860,
198,
198,
57,
16,
796,
45941,
13,
21602,
10223,
7,
15,
11,
16,
11,
8516,
9,
4033,
82,
737,
3447,
1758,
7,
8516,
11,
4033,
82,
8,
198,
12860,
62,
18747,
7,
57,
16,
11,
705,
2840,
12,
3003,
12,
19052,
13,
11134,
11537,
198,
57,
17,
796,
45941,
13,
3003,
7,
57,
16,
1875,
657,
13,
20,
11,
657,
11,
352,
8,
198,
12860,
62,
18747,
7,
57,
17,
11,
705,
2840,
12,
3003,
12,
8499,
13,
11134,
11537,
198,
198,
57,
16,
796,
45941,
13,
21602,
10223,
7,
15,
11,
16,
11,
8516,
9,
4033,
82,
737,
3447,
1758,
7,
8516,
11,
4033,
82,
8,
198,
12860,
62,
18747,
7,
57,
16,
11,
705,
2840,
12,
47033,
12,
19052,
13,
11134,
11537,
198,
57,
17,
796,
45941,
13,
47033,
7,
57,
16,
11,
657,
13,
20,
8,
198,
12860,
62,
18747,
7,
57,
17,
11,
705,
2840,
12,
47033,
12,
8499,
13,
11134,
11537,
198,
198,
57,
16,
796,
45941,
13,
21602,
10223,
7,
15,
11,
16,
11,
8516,
9,
4033,
82,
737,
3447,
1758,
7,
8516,
11,
4033,
82,
8,
198,
12860,
62,
18747,
7,
57,
16,
11,
705,
2840,
12,
39504,
12,
19052,
13,
11134,
11537,
198,
57,
17,
796,
45941,
13,
39504,
7,
57,
16,
11,
657,
13,
20,
8,
198,
12860,
62,
18747,
7,
57,
17,
11,
705,
2840,
12,
39504,
12,
8499,
13,
11134,
11537,
198,
198,
57,
16,
796,
45941,
13,
21602,
10223,
7,
15,
11,
16,
11,
8516,
9,
4033,
82,
737,
3447,
1758,
7,
8516,
11,
4033,
82,
8,
198,
12860,
62,
18747,
7,
57,
16,
11,
705,
2840,
12,
16345,
12,
19052,
13,
11134,
11537,
198,
57,
17,
796,
1168,
16,
13,
16345,
7,
22704,
28,
15,
8,
198,
12860,
62,
18747,
7,
57,
17,
11,
705,
2840,
12,
16345,
12,
8499,
13,
11134,
11537,
628
] | 2.071856 | 334 |
#!/usr/bin/python3
import pyglet
from pyglet.gl import *
import sys
import math
import time
import numpy as np
import random
random.seed(7337)
import sys
sys.path.append("./libs")
#sys.path.insert(0, "./db")
#from db import *
from objloader import *
#from objloader_dbload import *
from printfuncs import *
#https://stackoverflow.com/a/23356273/4084546
#https://www.erikrotteveel.com/python/three-dimensional-ray-tracing-in-python/
width = 800
height = 600
window = pyglet.window.Window(width=width, height=height)
@window.event
@window.event
@window.event
@window.event
@window.event
@window.event
@window.event
@window.event
# make OpenGL context current
window.switch_to()
# signify that one frame has passed
pyglet.clock.tick()
# poll the operating system event queue
window.dispatch_events()
selected_obj = 0
glLightfv(GL_LIGHT0, GL_POSITION, (-40, 200, 100, 0.0))
glLightfv(GL_LIGHT0, GL_AMBIENT, (0.2, 0.2, 0.2, 1.0))
glLightfv(GL_LIGHT0, GL_DIFFUSE, (0.5, 0.5, 0.5, 1.0))
glEnable(GL_LIGHT0)
glEnable(GL_LIGHTING)
glEnable(GL_COLOR_MATERIAL)
glEnable(GL_DEPTH_TEST)
glShadeModel(GL_SMOOTH) # most obj files expect to be smooth-shaded
# Function checker
#glDisable(GL_TEXTURE_2D)
glEnable(GL_DEPTH_TEST)
glEnable(GL_BLEND)
glEnable(GL_CULL_FACE)
#
glViewport(0, 0, width, height)
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
gluPerspective(30.0, width/height, 1.0, 1000.0)
glMatrixMode(GL_MODELVIEW)
map = WorldMap()
map.render_scene()
frame_times = []
start_t = time.time()
zpos = 5
rotate = move = False
oo = map.objs[selected_obj]
storeit = None
if __name__ == '__main__':
pyglet.clock.schedule_interval(timing, 1/60.0)
pyglet.app.run() | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
201,
198,
201,
198,
11748,
12972,
70,
1616,
201,
198,
6738,
12972,
70,
1616,
13,
4743,
1330,
1635,
201,
198,
201,
198,
11748,
25064,
201,
198,
11748,
10688,
201,
198,
11748,
640,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
11748,
4738,
201,
198,
25120,
13,
28826,
7,
22,
31496,
8,
201,
198,
201,
198,
11748,
25064,
201,
198,
17597,
13,
6978,
13,
33295,
7,
1911,
14,
8019,
82,
4943,
201,
198,
2,
17597,
13,
6978,
13,
28463,
7,
15,
11,
366,
19571,
9945,
4943,
201,
198,
2,
6738,
20613,
1330,
1635,
201,
198,
201,
198,
6738,
26181,
29356,
1330,
1635,
201,
198,
2,
6738,
26181,
29356,
62,
9945,
2220,
1330,
1635,
201,
198,
6738,
3601,
12543,
6359,
1330,
1635,
201,
198,
201,
198,
201,
198,
2,
5450,
1378,
25558,
2502,
11125,
13,
785,
14,
64,
14,
1954,
32066,
27367,
14,
26200,
2231,
3510,
201,
198,
2,
5450,
1378,
2503,
13,
263,
1134,
10599,
660,
303,
417,
13,
785,
14,
29412,
14,
15542,
12,
19577,
12,
2433,
12,
2213,
4092,
12,
259,
12,
29412,
14,
201,
198,
220,
220,
220,
220,
201,
198,
220,
220,
220,
220,
201,
198,
220,
220,
220,
220,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
10394,
796,
10460,
201,
198,
17015,
796,
10053,
201,
198,
17497,
796,
12972,
70,
1616,
13,
17497,
13,
27703,
7,
10394,
28,
10394,
11,
6001,
28,
17015,
8,
201,
198,
201,
198,
201,
198,
31,
17497,
13,
15596,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
201,
198,
31,
17497,
13,
15596,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
201,
198,
31,
17497,
13,
15596,
201,
198,
201,
198,
201,
198,
31,
17497,
13,
15596,
201,
198,
201,
198,
31,
17497,
13,
15596,
201,
198,
201,
198,
31,
17497,
13,
15596,
201,
198,
201,
198,
31,
17497,
13,
15596,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
201,
198,
220,
220,
220,
220,
201,
198,
31,
17497,
13,
15596,
201,
198,
220,
220,
220,
220,
201,
198,
201,
198,
201,
198,
201,
198,
2,
787,
30672,
4732,
1459,
201,
198,
17497,
13,
31943,
62,
1462,
3419,
201,
198,
2,
44078,
326,
530,
5739,
468,
3804,
201,
198,
9078,
70,
1616,
13,
15750,
13,
42298,
3419,
201,
198,
2,
3278,
262,
5361,
1080,
1785,
16834,
201,
198,
17497,
13,
6381,
17147,
62,
31534,
3419,
201,
198,
201,
198,
34213,
62,
26801,
796,
657,
201,
198,
201,
198,
4743,
15047,
69,
85,
7,
8763,
62,
43,
9947,
15,
11,
10188,
62,
37997,
17941,
11,
220,
13841,
1821,
11,
939,
11,
1802,
11,
657,
13,
15,
4008,
201,
198,
4743,
15047,
69,
85,
7,
8763,
62,
43,
9947,
15,
11,
10188,
62,
2390,
3483,
3525,
11,
357,
15,
13,
17,
11,
657,
13,
17,
11,
657,
13,
17,
11,
352,
13,
15,
4008,
201,
198,
4743,
15047,
69,
85,
7,
8763,
62,
43,
9947,
15,
11,
10188,
62,
35,
29267,
19108,
11,
357,
15,
13,
20,
11,
657,
13,
20,
11,
657,
13,
20,
11,
352,
13,
15,
4008,
201,
198,
4743,
36695,
7,
8763,
62,
43,
9947,
15,
8,
201,
198,
4743,
36695,
7,
8763,
62,
43,
9947,
2751,
8,
201,
198,
4743,
36695,
7,
8763,
62,
46786,
62,
44,
23261,
12576,
8,
201,
198,
4743,
36695,
7,
8763,
62,
46162,
4221,
62,
51,
6465,
8,
201,
198,
4743,
2484,
671,
17633,
7,
8763,
62,
50,
11770,
26946,
8,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
749,
26181,
3696,
1607,
284,
307,
7209,
12,
1477,
5286,
201,
198,
201,
198,
2,
15553,
2198,
263,
201,
198,
2,
4743,
48893,
7,
8763,
62,
47648,
62,
17,
35,
8,
201,
198,
4743,
36695,
7,
8763,
62,
46162,
4221,
62,
51,
6465,
8,
201,
198,
4743,
36695,
7,
8763,
62,
9148,
10619,
8,
201,
198,
4743,
36695,
7,
8763,
62,
34,
9994,
62,
49836,
8,
201,
198,
2,
201,
198,
201,
198,
4743,
7680,
634,
7,
15,
11,
657,
11,
9647,
11,
6001,
8,
201,
198,
4743,
46912,
19076,
7,
8763,
62,
31190,
23680,
2849,
8,
201,
198,
4743,
8912,
7390,
26858,
3419,
201,
198,
70,
2290,
30946,
806,
425,
7,
1270,
13,
15,
11,
9647,
14,
17015,
11,
352,
13,
15,
11,
8576,
13,
15,
8,
201,
198,
4743,
46912,
19076,
7,
8763,
62,
33365,
3698,
28206,
8,
201,
198,
220,
220,
220,
220,
201,
198,
220,
220,
220,
220,
201,
198,
8899,
796,
2159,
13912,
3419,
201,
198,
8899,
13,
13287,
62,
29734,
3419,
201,
198,
201,
198,
14535,
62,
22355,
796,
17635,
201,
198,
9688,
62,
83,
796,
640,
13,
2435,
3419,
201,
198,
201,
198,
89,
1930,
796,
642,
201,
198,
10599,
378,
796,
1445,
796,
10352,
201,
198,
2238,
796,
3975,
13,
672,
8457,
58,
34213,
62,
26801,
60,
201,
198,
201,
198,
8095,
270,
796,
6045,
201,
198,
201,
198,
201,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
201,
198,
220,
220,
220,
12972,
70,
1616,
13,
15750,
13,
15952,
5950,
62,
3849,
2100,
7,
16514,
278,
11,
352,
14,
1899,
13,
15,
8,
201,
198,
220,
220,
220,
12972,
70,
1616,
13,
1324,
13,
5143,
3419
] | 2.114222 | 893 |
# -*- coding: utf-8 -*-
"""
lantz.errors
~~~~~~~~~~~~
Implements base classes for instrumentation related exceptions. They are
useful to mix with specific exceptions from libraries or modules and
therefore allowing code to catch them via lantz excepts without
breaking specific ones.
:copyright: 2012 by The Lantz Authors
:license: BSD, see LICENSE for more details.
"""
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
220,
220,
220,
300,
46269,
13,
48277,
198,
220,
220,
220,
220,
15116,
8728,
628,
220,
220,
220,
1846,
1154,
902,
2779,
6097,
329,
8875,
341,
3519,
13269,
13,
1119,
389,
198,
220,
220,
220,
4465,
284,
5022,
351,
2176,
13269,
422,
12782,
393,
13103,
290,
198,
220,
220,
220,
4361,
5086,
2438,
284,
4929,
606,
2884,
300,
46269,
2845,
82,
1231,
198,
220,
220,
220,
7163,
2176,
3392,
13,
628,
220,
220,
220,
1058,
22163,
4766,
25,
2321,
416,
383,
406,
46269,
46665,
198,
220,
220,
220,
1058,
43085,
25,
347,
10305,
11,
766,
38559,
24290,
329,
517,
3307,
13,
198,
37811,
628
] | 3.383333 | 120 |
import boto3
import botocore
import urllib2
import json
# This method is suitable for IAM role.
# This method is suitable for successful configuration.
# This method is suitable for any other situation.
# Get Client.
# Input: String client type 'profile'|'temporary'
# Output: Null.
| [
11748,
275,
2069,
18,
198,
11748,
10214,
420,
382,
198,
11748,
2956,
297,
571,
17,
198,
11748,
33918,
628,
198,
2,
770,
2446,
318,
11080,
329,
314,
2390,
2597,
13,
198,
198,
2,
770,
2446,
318,
11080,
329,
4388,
8398,
13,
198,
198,
2,
770,
2446,
318,
11080,
329,
597,
584,
3074,
13,
198,
198,
2,
3497,
20985,
13,
198,
2,
23412,
25,
220,
220,
220,
10903,
5456,
2099,
705,
13317,
6,
91,
6,
11498,
5551,
6,
198,
2,
25235,
25,
220,
220,
35886,
13,
198
] | 3.406977 | 86 |
from turbogears.feed import feed
FeedController = feed.FeedController
| [
6738,
14830,
519,
4127,
13,
12363,
1330,
3745,
198,
18332,
22130,
796,
3745,
13,
18332,
22130,
198
] | 4.117647 | 17 |
"""General-purpose test script for image-to-image translation.
Once you have trained your model with train.py, you can use this script to test the model.
It will load a saved model from '--checkpoints_dir' and save the results to '--results_dir'.
It first creates model and dataset given the option. It will hard-code some parameters.
It then runs inference for '--num_test' images and save results to an HTML file.
Example (You need to train models first or download pre-trained models from our website):
Test a CycleGAN model (both sides):
python test.py --dataroot ./datasets/maps --name maps_cyclegan --model cycle_gan
Test a CycleGAN model (one side only):
python test.py --dataroot datasets/horse2zebra/testA --name horse2zebra_pretrained --model test --no_dropout
The option '--model test' is used for generating CycleGAN results only for one side.
This option will automatically set '--dataset_mode single', which only loads the images from one set.
On the contrary, using '--model cycle_gan' requires loading and generating results in both directions,
which is sometimes unnecessary. The results will be saved at ./results/.
Use '--results_dir <directory_path_to_save_result>' to specify the results directory.
Test a pix2pix model:
python test.py --dataroot ./datasets/facades --name facades_pix2pix --model pix2pix --direction BtoA
See options/base_options.py and options/test_options.py for more test options.
See training and test tips at: https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix/blob/master/docs/tips.md
See frequently asked questions at: https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix/blob/master/docs/qa.md
"""
import os
from options.test_options import TestOptions
from data import create_dataset
from models import create_model
from util.visualizer import save_images
from util import html
from PIL import Image
import torch
from torch.utils.data import DataLoader
import torchvision.transforms as transforms
from torch.utils.data import DataLoader, Dataset
import numpy as np
from util.util import tensor2im
from random_perturb import RandomNoise
from train_facade import AdvGAN_Attack #*Using this for changes
if __name__ == '__main__':
gen = RandomNoise(None)
dataset = Facade(transform = transforms.ToTensor()) # our custom dataset
dataloader = DataLoader(dataset, batch_size=1, num_workers=4, shuffle=False, drop_last=True)
gen.save_results(dataloader) | [
37811,
12218,
12,
29983,
1332,
4226,
329,
2939,
12,
1462,
12,
9060,
11059,
13,
198,
198,
7454,
345,
423,
8776,
534,
2746,
351,
4512,
13,
9078,
11,
345,
460,
779,
428,
4226,
284,
1332,
262,
2746,
13,
198,
1026,
481,
3440,
257,
7448,
2746,
422,
705,
438,
9122,
13033,
62,
15908,
6,
290,
3613,
262,
2482,
284,
705,
438,
43420,
62,
15908,
4458,
198,
198,
1026,
717,
8075,
2746,
290,
27039,
1813,
262,
3038,
13,
632,
481,
1327,
12,
8189,
617,
10007,
13,
198,
1026,
788,
4539,
32278,
329,
705,
438,
22510,
62,
9288,
6,
4263,
290,
3613,
2482,
284,
281,
11532,
2393,
13,
198,
198,
16281,
357,
1639,
761,
284,
4512,
4981,
717,
393,
4321,
662,
12,
35311,
4981,
422,
674,
3052,
2599,
198,
220,
220,
220,
6208,
257,
26993,
45028,
2746,
357,
16885,
5389,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
21015,
1332,
13,
9078,
1377,
67,
9459,
1025,
24457,
19608,
292,
1039,
14,
31803,
1377,
3672,
8739,
62,
13696,
1030,
1377,
19849,
6772,
62,
1030,
628,
220,
220,
220,
6208,
257,
26993,
45028,
2746,
357,
505,
1735,
691,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
21015,
1332,
13,
9078,
1377,
67,
9459,
1025,
40522,
14,
30527,
17,
89,
37052,
14,
9288,
32,
1377,
3672,
8223,
17,
89,
37052,
62,
5310,
13363,
1377,
19849,
1332,
1377,
3919,
62,
14781,
448,
628,
220,
220,
220,
383,
3038,
705,
438,
19849,
1332,
6,
318,
973,
329,
15453,
26993,
45028,
2482,
691,
329,
530,
1735,
13,
198,
220,
220,
220,
770,
3038,
481,
6338,
900,
705,
438,
19608,
292,
316,
62,
14171,
2060,
3256,
543,
691,
15989,
262,
4263,
422,
530,
900,
13,
198,
220,
220,
220,
1550,
262,
10388,
11,
1262,
705,
438,
19849,
6772,
62,
1030,
6,
4433,
11046,
290,
15453,
2482,
287,
1111,
11678,
11,
198,
220,
220,
220,
543,
318,
3360,
13114,
13,
383,
2482,
481,
307,
7448,
379,
24457,
43420,
11757,
198,
220,
220,
220,
5765,
705,
438,
43420,
62,
15908,
1279,
34945,
62,
6978,
62,
1462,
62,
21928,
62,
20274,
29,
6,
284,
11986,
262,
2482,
8619,
13,
628,
220,
220,
220,
6208,
257,
279,
844,
17,
79,
844,
2746,
25,
198,
220,
220,
220,
220,
220,
220,
220,
21015,
1332,
13,
9078,
1377,
67,
9459,
1025,
24457,
19608,
292,
1039,
14,
38942,
2367,
1377,
3672,
1777,
2367,
62,
79,
844,
17,
79,
844,
1377,
19849,
279,
844,
17,
79,
844,
1377,
37295,
347,
1462,
32,
198,
198,
6214,
3689,
14,
8692,
62,
25811,
13,
9078,
290,
3689,
14,
9288,
62,
25811,
13,
9078,
329,
517,
1332,
3689,
13,
198,
6214,
3047,
290,
1332,
9040,
379,
25,
3740,
1378,
12567,
13,
785,
14,
29741,
4121,
89,
14,
9078,
13165,
354,
12,
20418,
2375,
45028,
12,
392,
12,
79,
844,
17,
79,
844,
14,
2436,
672,
14,
9866,
14,
31628,
14,
41315,
13,
9132,
198,
6214,
6777,
1965,
2683,
379,
25,
3740,
1378,
12567,
13,
785,
14,
29741,
4121,
89,
14,
9078,
13165,
354,
12,
20418,
2375,
45028,
12,
392,
12,
79,
844,
17,
79,
844,
14,
2436,
672,
14,
9866,
14,
31628,
14,
20402,
13,
9132,
198,
37811,
198,
11748,
28686,
198,
6738,
3689,
13,
9288,
62,
25811,
1330,
6208,
29046,
198,
6738,
1366,
1330,
2251,
62,
19608,
292,
316,
198,
6738,
4981,
1330,
2251,
62,
19849,
198,
6738,
7736,
13,
41464,
7509,
1330,
3613,
62,
17566,
198,
6738,
7736,
1330,
27711,
198,
198,
6738,
350,
4146,
1330,
7412,
198,
11748,
28034,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
6060,
17401,
198,
11748,
28034,
10178,
13,
7645,
23914,
355,
31408,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
6060,
17401,
11,
16092,
292,
316,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
7736,
13,
22602,
1330,
11192,
273,
17,
320,
198,
198,
6738,
4738,
62,
11766,
5945,
1330,
14534,
2949,
786,
198,
6738,
4512,
62,
38942,
671,
1330,
8007,
45028,
62,
27732,
1303,
9,
12814,
428,
329,
2458,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
2429,
796,
14534,
2949,
786,
7,
14202,
8,
628,
220,
220,
220,
27039,
796,
13585,
671,
7,
35636,
796,
31408,
13,
2514,
51,
22854,
28955,
220,
1303,
674,
2183,
27039,
198,
220,
220,
220,
4818,
282,
1170,
263,
796,
6060,
17401,
7,
19608,
292,
316,
11,
15458,
62,
7857,
28,
16,
11,
997,
62,
22896,
28,
19,
11,
36273,
28,
25101,
11,
4268,
62,
12957,
28,
17821,
8,
628,
220,
220,
220,
2429,
13,
21928,
62,
43420,
7,
67,
10254,
1170,
263,
8
] | 3.323529 | 748 |
# program to split email to username and domain name
# made by itsmeevil
print("***Email Splitter***")
email = input("\nEnter an email: ")
sliced = email.split("@") # split string at "@" which will put it in an array- ["username", "domain name"]
print(f"\nUsername: {sliced[0]}\nDomain name: {sliced[1]}")
| [
2,
1430,
284,
6626,
3053,
284,
20579,
290,
7386,
1438,
198,
2,
925,
416,
663,
1326,
23542,
198,
198,
4798,
7203,
8162,
15333,
13341,
1967,
8162,
4943,
198,
198,
12888,
796,
5128,
7203,
59,
77,
17469,
281,
3053,
25,
366,
8,
198,
198,
82,
677,
276,
796,
3053,
13,
35312,
7203,
31,
4943,
1303,
6626,
4731,
379,
44212,
1,
543,
481,
1234,
340,
287,
281,
7177,
12,
14631,
29460,
1600,
366,
27830,
1438,
8973,
198,
198,
4798,
7,
69,
1,
59,
77,
5842,
13292,
25,
1391,
82,
677,
276,
58,
15,
60,
32239,
77,
43961,
1438,
25,
1391,
82,
677,
276,
58,
16,
48999,
4943,
198
] | 2.924528 | 106 |
from async_service import background_trio_service
import pytest
import trio
from ddht.tools.factories.alexandria import AdvertisementFactory
from ddht.v5_1.alexandria.messages import AdvertiseMessage, PingMessage
from ddht.v5_1.alexandria.radius_tracker import RadiusTracker
@pytest.mark.trio
@pytest.mark.trio
@pytest.mark.trio
@pytest.mark.trio
| [
6738,
30351,
62,
15271,
1330,
4469,
62,
83,
27250,
62,
15271,
198,
11748,
12972,
9288,
198,
11748,
19886,
198,
198,
6738,
49427,
4352,
13,
31391,
13,
22584,
1749,
13,
1000,
87,
392,
7496,
1330,
39711,
22810,
198,
6738,
49427,
4352,
13,
85,
20,
62,
16,
13,
1000,
87,
392,
7496,
13,
37348,
1095,
1330,
1215,
1851,
786,
12837,
11,
34263,
12837,
198,
6738,
49427,
4352,
13,
85,
20,
62,
16,
13,
1000,
87,
392,
7496,
13,
42172,
62,
2213,
10735,
1330,
48838,
35694,
628,
198,
31,
9078,
9288,
13,
4102,
13,
83,
27250,
628,
198,
31,
9078,
9288,
13,
4102,
13,
83,
27250,
628,
198,
31,
9078,
9288,
13,
4102,
13,
83,
27250,
628,
198,
31,
9078,
9288,
13,
4102,
13,
83,
27250,
198
] | 2.870968 | 124 |
import logging
from airflow.contrib.hooks.bigquery_hook import BigQueryHook
from airflow.models import BaseOperator
from airflow.utils import apply_defaults
class BigQueryOperator(BaseOperator):
"""
Executes BigQuery SQL queries in a specific BigQuery database
"""
template_fields = ('bql',)
template_ext = ('.sql',)
ui_color = '#e4f0e8'
@apply_defaults
def __init__(self, bql, destination_dataset_table = False, write_disposition = 'WRITE_EMPTY', bigquery_conn_id='bigquery_default', *args, **kwargs):
"""
Create a new BigQueryOperator.
:param bql: the sql code to be executed
:type bql: Can receive a str representing a sql statement,
a list of str (sql statements), or reference to a template file.
Template reference are recognized by str ending in '.sql'
:param destination_dataset_table: A dotted dataset.table that, if set,
will store the results of the query.
:type destination_dataset_table: string
:param bigquery_conn_id: reference to a specific BigQuery hook.
:type bigquery_conn_id: string
"""
super(BigQueryOperator, self).__init__(*args, **kwargs)
self.bql = bql
self.destination_dataset_table = destination_dataset_table
self.write_disposition = write_disposition
self.bigquery_conn_id = bigquery_conn_id
| [
11748,
18931,
198,
198,
6738,
45771,
13,
3642,
822,
13,
25480,
82,
13,
14261,
22766,
62,
25480,
1330,
4403,
20746,
39,
566,
198,
6738,
45771,
13,
27530,
1330,
7308,
18843,
1352,
198,
6738,
45771,
13,
26791,
1330,
4174,
62,
12286,
82,
198,
198,
4871,
4403,
20746,
18843,
1352,
7,
14881,
18843,
1352,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
8393,
1769,
4403,
20746,
16363,
20743,
287,
257,
2176,
4403,
20746,
6831,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
11055,
62,
25747,
796,
19203,
65,
13976,
3256,
8,
198,
220,
220,
220,
11055,
62,
2302,
796,
357,
4458,
25410,
3256,
8,
198,
220,
220,
220,
334,
72,
62,
8043,
796,
705,
2,
68,
19,
69,
15,
68,
23,
6,
628,
220,
220,
220,
2488,
39014,
62,
12286,
82,
198,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
275,
13976,
11,
10965,
62,
19608,
292,
316,
62,
11487,
796,
10352,
11,
3551,
62,
6381,
9150,
796,
705,
18564,
12709,
62,
39494,
9936,
3256,
1263,
22766,
62,
37043,
62,
312,
11639,
14261,
22766,
62,
12286,
3256,
1635,
22046,
11,
12429,
46265,
22046,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
13610,
257,
649,
4403,
20746,
18843,
1352,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
275,
13976,
25,
262,
44161,
2438,
284,
307,
10945,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
4906,
275,
13976,
25,
1680,
3328,
257,
965,
10200,
257,
44161,
2643,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
257,
1351,
286,
965,
357,
25410,
6299,
828,
393,
4941,
284,
257,
11055,
2393,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37350,
4941,
389,
8018,
416,
965,
7464,
287,
45302,
25410,
6,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
10965,
62,
19608,
292,
316,
62,
11487,
25,
317,
38745,
27039,
13,
11487,
326,
11,
611,
900,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
481,
3650,
262,
2482,
286,
262,
12405,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
4906,
10965,
62,
19608,
292,
316,
62,
11487,
25,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
1263,
22766,
62,
37043,
62,
312,
25,
4941,
284,
257,
2176,
4403,
20746,
8011,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
4906,
1263,
22766,
62,
37043,
62,
312,
25,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2208,
7,
12804,
20746,
18843,
1352,
11,
2116,
737,
834,
15003,
834,
46491,
22046,
11,
12429,
46265,
22046,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
65,
13976,
796,
275,
13976,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
16520,
1883,
62,
19608,
292,
316,
62,
11487,
796,
10965,
62,
19608,
292,
316,
62,
11487,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
13564,
62,
6381,
9150,
796,
3551,
62,
6381,
9150,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
14261,
22766,
62,
37043,
62,
312,
796,
1263,
22766,
62,
37043,
62,
312,
198
] | 2.636023 | 533 |
import warnings
warnings.filterwarnings("ignore")
import os
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3"
import gym
from BPG.ppo2 import PPO2
from BPG.ppo_policy import MlpPolicy
env_id = "CartPole-v1"
env = gym.make(env_id)
model = PPO2(MlpPolicy, env, learning_rate=1e-4, verbose=1, tensorboard_log="MLP/", full_tensorboard_log=True)
model.learn(int(10e3))
#model.save('../result/model/ppo_cartpole_2e5.pkl')
#model = model.load('../result/model/ppo_cartpole_2e5.pkl')
env = gym.make(env_id)
obs = env.reset()
for _ in range(10000):
env.render()
action, _states = model.predict(obs)
obs, rewards, dones, info = env.step(action)
env.close()
| [
198,
11748,
14601,
198,
40539,
654,
13,
24455,
40539,
654,
7203,
46430,
4943,
198,
11748,
28686,
198,
418,
13,
268,
2268,
14692,
10234,
62,
8697,
47,
62,
23678,
62,
25294,
62,
2538,
18697,
8973,
796,
366,
18,
1,
198,
198,
11748,
11550,
198,
6738,
347,
6968,
13,
16634,
17,
1330,
350,
16402,
17,
198,
6738,
347,
6968,
13,
16634,
62,
30586,
1330,
337,
34431,
36727,
198,
198,
24330,
62,
312,
796,
366,
43476,
47,
2305,
12,
85,
16,
1,
198,
24330,
796,
11550,
13,
15883,
7,
24330,
62,
312,
8,
198,
19849,
796,
350,
16402,
17,
7,
44,
34431,
36727,
11,
17365,
11,
4673,
62,
4873,
28,
16,
68,
12,
19,
11,
15942,
577,
28,
16,
11,
11192,
273,
3526,
62,
6404,
2625,
5805,
47,
14,
1600,
1336,
62,
83,
22854,
3526,
62,
6404,
28,
17821,
8,
198,
19849,
13,
35720,
7,
600,
7,
940,
68,
18,
4008,
198,
2,
19849,
13,
21928,
10786,
40720,
20274,
14,
19849,
14,
16634,
62,
26674,
36869,
62,
17,
68,
20,
13,
79,
41582,
11537,
198,
2,
19849,
796,
2746,
13,
2220,
10786,
40720,
20274,
14,
19849,
14,
16634,
62,
26674,
36869,
62,
17,
68,
20,
13,
79,
41582,
11537,
198,
198,
24330,
796,
11550,
13,
15883,
7,
24330,
62,
312,
8,
198,
8158,
796,
17365,
13,
42503,
3419,
198,
198,
1640,
4808,
287,
2837,
7,
49388,
2599,
198,
220,
220,
220,
17365,
13,
13287,
3419,
198,
220,
220,
220,
2223,
11,
4808,
27219,
796,
2746,
13,
79,
17407,
7,
8158,
8,
198,
220,
220,
220,
10201,
11,
11530,
11,
836,
274,
11,
7508,
796,
17365,
13,
9662,
7,
2673,
8,
198,
24330,
13,
19836,
3419,
628
] | 2.40293 | 273 |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
from ax.core.arm import Arm
from ax.core.generator_run import GeneratorRun
from ax.utils.common.testutils import TestCase
from ax.utils.testing.fake import (
get_arms,
get_model_predictions,
get_model_predictions_per_arm,
get_optimization_config,
get_search_space,
)
GENERATOR_RUN_STR = "GeneratorRun(3 arms, total weight 3.0)"
GENERATOR_RUN_STR_PLUS_1 = "GeneratorRun(3 arms, total weight 4.0)"
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
15069,
357,
66,
8,
3203,
11,
3457,
13,
290,
663,
29116,
13,
1439,
6923,
33876,
13,
198,
198,
6738,
7877,
13,
7295,
13,
1670,
1330,
7057,
198,
6738,
7877,
13,
7295,
13,
8612,
1352,
62,
5143,
1330,
35986,
10987,
198,
6738,
7877,
13,
26791,
13,
11321,
13,
9288,
26791,
1330,
6208,
20448,
198,
6738,
7877,
13,
26791,
13,
33407,
13,
30706,
1330,
357,
198,
220,
220,
220,
651,
62,
8357,
11,
198,
220,
220,
220,
651,
62,
19849,
62,
28764,
9278,
11,
198,
220,
220,
220,
651,
62,
19849,
62,
28764,
9278,
62,
525,
62,
1670,
11,
198,
220,
220,
220,
651,
62,
40085,
1634,
62,
11250,
11,
198,
220,
220,
220,
651,
62,
12947,
62,
13200,
11,
198,
8,
628,
198,
35353,
1137,
25633,
62,
49,
4944,
62,
18601,
796,
366,
8645,
1352,
10987,
7,
18,
5101,
11,
2472,
3463,
513,
13,
15,
16725,
198,
35353,
1137,
25633,
62,
49,
4944,
62,
18601,
62,
6489,
2937,
62,
16,
796,
366,
8645,
1352,
10987,
7,
18,
5101,
11,
2472,
3463,
604,
13,
15,
16725,
628
] | 2.768817 | 186 |
from __future__ import absolute_import
import sys
import logging
from frontera.logger import formatters
CONSOLE = logging.StreamHandler(stream=sys.stdout)
CONSOLE.setFormatter(formatters.CONSOLE)
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
11748,
25064,
198,
11748,
18931,
198,
198,
6738,
1216,
261,
49600,
13,
6404,
1362,
1330,
5794,
1010,
198,
198,
10943,
15821,
2538,
796,
18931,
13,
12124,
25060,
7,
5532,
28,
17597,
13,
19282,
448,
8,
198,
10943,
15821,
2538,
13,
2617,
8479,
1436,
7,
18982,
1010,
13,
10943,
15821,
2538,
8,
198
] | 3.245902 | 61 |
# Expresiones Regulares I
# las expresiones reguales son una secuencia de caracteres que forman un patron de busqueda
# Sirven para el trabajo de procesamiento de texto
import re
cadena = "Vamos a aprender expresiones regulares en python. python es un lenguaje de sintaxis sencilla"
#buscarmos las palabre aprender
#print(re.search("aprender", cadena))
textoBuscar="aprender"
textoBuscar1="python"
if re.search(textoBuscar, cadena) is not None:
print("He encontrado el texto")
else:
print("No Encontre el texto")
###########################################################
textoEncontrado=re.search(textoBuscar,cadena)
print(textoEncontrado.start())# buscar el nuevo de caracteres hasta llegar a la palabra deficinida (aprender)
print(textoEncontrado.end())# carancte donde finaliza
print(textoEncontrado.span())# hace los 2 primeros metodos
###########################################################
print(re.findall(textoBuscar1, cadena))
print(len(re.findall(textoBuscar1, cadena))) #longitud
| [
2,
5518,
411,
295,
274,
3310,
377,
3565,
314,
198,
2,
39990,
1033,
411,
295,
274,
842,
723,
274,
3367,
555,
64,
792,
84,
29634,
390,
1097,
529,
68,
411,
8358,
329,
805,
555,
19686,
390,
1323,
421,
18082,
198,
198,
2,
7361,
574,
31215,
1288,
491,
397,
34944,
390,
386,
728,
321,
1153,
78,
390,
2420,
78,
198,
198,
11748,
302,
198,
198,
66,
38047,
796,
366,
53,
321,
418,
257,
2471,
13287,
1033,
411,
295,
274,
3475,
3565,
551,
21015,
13,
21015,
1658,
555,
300,
13561,
1228,
68,
390,
264,
600,
22704,
3308,
66,
5049,
1,
198,
198,
2,
10885,
66,
1670,
418,
39990,
6340,
46241,
2471,
13287,
198,
2,
4798,
7,
260,
13,
12947,
7203,
499,
13287,
1600,
20603,
8107,
4008,
198,
198,
5239,
78,
16286,
7718,
2625,
499,
13287,
1,
198,
5239,
78,
16286,
7718,
16,
2625,
29412,
1,
628,
198,
361,
302,
13,
12947,
7,
5239,
78,
16286,
7718,
11,
20603,
8107,
8,
318,
407,
6045,
25,
198,
220,
220,
220,
3601,
7203,
1544,
2207,
756,
81,
4533,
1288,
2420,
78,
4943,
198,
198,
17772,
25,
198,
220,
220,
220,
3601,
7203,
2949,
2039,
3642,
260,
1288,
2420,
78,
4943,
198,
198,
29113,
14468,
7804,
21017,
198,
5239,
78,
4834,
3642,
81,
4533,
28,
260,
13,
12947,
7,
5239,
78,
16286,
7718,
11,
66,
38047,
8,
198,
4798,
7,
5239,
78,
4834,
3642,
81,
4533,
13,
9688,
28955,
2,
1323,
7718,
1288,
299,
518,
13038,
390,
1097,
529,
68,
411,
19338,
64,
300,
1455,
283,
257,
8591,
6340,
397,
430,
12630,
259,
3755,
357,
499,
13287,
8,
198,
4798,
7,
5239,
78,
4834,
3642,
81,
4533,
13,
437,
28955,
2,
1097,
272,
310,
68,
288,
14378,
2457,
23638,
198,
4798,
7,
5239,
78,
4834,
3642,
81,
4533,
13,
12626,
28955,
2,
289,
558,
22346,
362,
2684,
27498,
1138,
375,
418,
628,
198,
29113,
14468,
7804,
21017,
198,
4798,
7,
260,
13,
19796,
439,
7,
5239,
78,
16286,
7718,
16,
11,
20603,
8107,
4008,
198,
4798,
7,
11925,
7,
260,
13,
19796,
439,
7,
5239,
78,
16286,
7718,
16,
11,
20603,
8107,
22305,
1303,
6511,
26331,
198
] | 2.894587 | 351 |
from . import patch
from .parameter import Parameter
from .module import Module
from .container import *
from . import utils
from .utils import make_method
from .layers import *
from .loss import *
from .flat_param import FlatParam
| [
6738,
764,
1330,
8529,
198,
6738,
764,
17143,
2357,
1330,
25139,
2357,
198,
6738,
764,
21412,
1330,
19937,
198,
6738,
764,
34924,
1330,
1635,
198,
6738,
764,
1330,
3384,
4487,
198,
6738,
764,
26791,
1330,
787,
62,
24396,
198,
6738,
764,
75,
6962,
1330,
1635,
198,
6738,
764,
22462,
1330,
1635,
198,
6738,
764,
38568,
62,
17143,
1330,
21939,
22973,
198
] | 3.803279 | 61 |
from fileinput import FileInput
from typing import Iterable
import day07a
if __name__ == "__main__":
day07a.calculate_fuel_needed = calculate_fuel_needed
input: "FileInput[str]" = FileInput()
initial_positions = list(map(int, next(input).rstrip().split(",")))
print(day07a.find_cheapest_position(initial_positions))
| [
6738,
2393,
15414,
1330,
9220,
20560,
198,
6738,
19720,
1330,
40806,
540,
198,
198,
11748,
1110,
2998,
64,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1110,
2998,
64,
13,
9948,
3129,
378,
62,
25802,
62,
27938,
796,
15284,
62,
25802,
62,
27938,
628,
220,
220,
220,
5128,
25,
366,
8979,
20560,
58,
2536,
30866,
796,
9220,
20560,
3419,
198,
220,
220,
220,
4238,
62,
1930,
1756,
796,
1351,
7,
8899,
7,
600,
11,
1306,
7,
15414,
737,
81,
36311,
22446,
35312,
7,
2430,
22305,
198,
220,
220,
220,
3601,
7,
820,
2998,
64,
13,
19796,
62,
2395,
35746,
62,
9150,
7,
36733,
62,
1930,
1756,
4008,
198
] | 2.888889 | 117 |
import math
import phe.paillier as paillier
pubkey, prikey = paillier.generate_paillier_keypair(n_length=1024)
# TODO: fails when iterations more than 17 (key length 1024) irrational test intermittently fails. Result either incorrect (random) or overflow
iterations = 17
# factorial test
factorial = pubkey.encrypt(1)
for x in range(1,iterations+1):
factorial = factorial * x
print("Factorial test ok "+ str(math.factorial(iterations) == prikey.decrypt(factorial)))
# irrational test: pi * 1/pi * pi * 1/pi...
piEnc = pubkey.encrypt(math.pi)
for x in range(0,iterations):
if x % 2 == 0:
piEnc = piEnc * 1/math.pi
else:
piEnc = piEnc * math.pi
if iterations % 2 == 0:
print("Irrational test ok "+ str(math.fabs(math.pi - prikey.decrypt(piEnc)) < 0.0001))
else:
print("Irrational test ok "+ str(math.fabs(1 - prikey.decrypt(piEnc)) < 0.0001))
| [
11748,
10688,
198,
11748,
279,
258,
13,
8957,
359,
959,
355,
14187,
359,
959,
198,
12984,
2539,
11,
1293,
2539,
796,
14187,
359,
959,
13,
8612,
378,
62,
8957,
359,
959,
62,
2539,
24874,
7,
77,
62,
13664,
28,
35500,
8,
198,
198,
2,
16926,
46,
25,
10143,
618,
34820,
517,
621,
1596,
357,
2539,
4129,
28119,
8,
25086,
1332,
30598,
1473,
10143,
13,
25414,
2035,
11491,
357,
25120,
8,
393,
30343,
198,
2676,
602,
796,
1596,
198,
198,
2,
1109,
5132,
1332,
198,
22584,
5132,
796,
2240,
2539,
13,
12685,
6012,
7,
16,
8,
198,
1640,
2124,
287,
2837,
7,
16,
11,
2676,
602,
10,
16,
2599,
198,
220,
220,
220,
1109,
5132,
796,
1109,
5132,
1635,
2124,
198,
4798,
7203,
29054,
5132,
1332,
12876,
43825,
965,
7,
11018,
13,
22584,
5132,
7,
2676,
602,
8,
6624,
1293,
2539,
13,
12501,
6012,
7,
22584,
5132,
22305,
198,
198,
2,
25086,
1332,
25,
220,
31028,
1635,
352,
14,
14415,
1635,
31028,
1635,
352,
14,
14415,
986,
198,
14415,
27195,
796,
2240,
2539,
13,
12685,
6012,
7,
11018,
13,
14415,
8,
198,
1640,
2124,
287,
2837,
7,
15,
11,
2676,
602,
2599,
198,
220,
220,
220,
611,
2124,
4064,
362,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
31028,
27195,
796,
31028,
27195,
1635,
352,
14,
11018,
13,
14415,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
31028,
27195,
796,
31028,
27195,
1635,
10688,
13,
14415,
198,
198,
361,
34820,
4064,
362,
6624,
657,
25,
198,
220,
220,
220,
3601,
7203,
23820,
20310,
1332,
12876,
43825,
965,
7,
11018,
13,
69,
8937,
7,
11018,
13,
14415,
532,
1293,
2539,
13,
12501,
6012,
7,
14415,
27195,
4008,
1279,
657,
13,
18005,
4008,
198,
17772,
25,
198,
220,
220,
220,
3601,
7203,
23820,
20310,
1332,
12876,
43825,
965,
7,
11018,
13,
69,
8937,
7,
16,
532,
1293,
2539,
13,
12501,
6012,
7,
14415,
27195,
4008,
1279,
657,
13,
18005,
4008,
628,
198
] | 2.695122 | 328 |
# author: Arlin Cherian, Kristin Bunyan, Michelle Wang, Berkay Bulut
# date: 2021-11-18
"""Downloads data csv data from the web to a local filepath as either a csv format
Usage: src/download_data.py --url=<url> --out_file=<out_file>
Options:
--url=<url> URL from where to download the data (must be in standard csv format)
--out_file=<out_file> Path (including filename) of where to locally write the file
"""
from docopt import docopt
import os
import pandas as pd
opt = docopt(__doc__)
if __name__ == "__main__":
main(opt["--url"], opt["--out_file"])
| [
2,
1772,
25,
943,
2815,
19305,
666,
11,
14912,
259,
28515,
4121,
11,
16738,
15233,
11,
4312,
5568,
8510,
315,
198,
2,
3128,
25,
33448,
12,
1157,
12,
1507,
198,
198,
37811,
10002,
82,
1366,
269,
21370,
1366,
422,
262,
3992,
284,
257,
1957,
2393,
6978,
355,
2035,
257,
269,
21370,
5794,
198,
28350,
25,
12351,
14,
15002,
62,
7890,
13,
9078,
1377,
6371,
28,
27,
6371,
29,
1377,
448,
62,
7753,
28,
27,
448,
62,
7753,
29,
198,
198,
29046,
25,
198,
438,
6371,
28,
27,
6371,
29,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10289,
422,
810,
284,
4321,
262,
1366,
357,
27238,
307,
287,
3210,
269,
21370,
5794,
8,
198,
438,
448,
62,
7753,
28,
27,
448,
62,
7753,
29,
220,
220,
220,
10644,
357,
8201,
29472,
8,
286,
810,
284,
15726,
3551,
262,
2393,
198,
37811,
198,
198,
6738,
2205,
8738,
1330,
2205,
8738,
198,
11748,
28686,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
8738,
796,
2205,
8738,
7,
834,
15390,
834,
8,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
7,
8738,
14692,
438,
6371,
33116,
2172,
14692,
438,
448,
62,
7753,
8973,
8,
198
] | 2.792271 | 207 |
from time import sleep
num = int(input('Digite um número inteiro de 4 digitos: '))
numero = str(num)
print('Os digitos do número informado são: ')
for c in range(0, 4):
sleep(1)
print(numero[c])
| [
6738,
640,
1330,
3993,
198,
22510,
796,
493,
7,
15414,
10786,
19511,
578,
23781,
299,
21356,
647,
78,
493,
68,
7058,
390,
604,
16839,
418,
25,
705,
4008,
198,
22510,
3529,
796,
965,
7,
22510,
8,
198,
4798,
10786,
16748,
16839,
418,
466,
299,
21356,
647,
78,
4175,
4533,
264,
28749,
25,
705,
8,
198,
1640,
269,
287,
2837,
7,
15,
11,
604,
2599,
220,
220,
220,
220,
198,
220,
220,
220,
3993,
7,
16,
8,
198,
220,
220,
220,
3601,
7,
22510,
3529,
58,
66,
12962,
198
] | 2.352273 | 88 |
from ctm_python_client.core.base import BaseJob
| [
6738,
269,
17209,
62,
29412,
62,
16366,
13,
7295,
13,
8692,
1330,
7308,
33308,
628
] | 3.266667 | 15 |
from serial import Serial
from time import sleep
from datetime import datetime
import requests
URL = 'http://127.0.0.1:8080/postLog'
serial_connection = Serial('/dev/ttyACM0', 9600)
while True:
id = str(serial_connection.readline())
id = id.strip('\n')
state = str(serial_connection.readline())
state = state.strip('\n')
if id and state:
print id
print state
post(id, state)
sleep(0.01)
| [
6738,
11389,
1330,
23283,
198,
6738,
640,
1330,
3993,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
7007,
628,
198,
21886,
796,
705,
4023,
1378,
16799,
13,
15,
13,
15,
13,
16,
25,
1795,
1795,
14,
7353,
11187,
6,
198,
198,
46911,
62,
38659,
796,
23283,
10786,
14,
7959,
14,
42852,
2246,
44,
15,
3256,
860,
8054,
8,
198,
198,
4514,
6407,
25,
198,
220,
220,
220,
4686,
796,
965,
7,
46911,
62,
38659,
13,
961,
1370,
28955,
198,
220,
220,
220,
4686,
796,
4686,
13,
36311,
10786,
59,
77,
11537,
198,
220,
220,
220,
1181,
796,
965,
7,
46911,
62,
38659,
13,
961,
1370,
28955,
198,
220,
220,
220,
1181,
796,
1181,
13,
36311,
10786,
59,
77,
11537,
198,
220,
220,
220,
611,
4686,
290,
1181,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
4686,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
1181,
198,
220,
220,
220,
220,
220,
220,
220,
1281,
7,
312,
11,
1181,
8,
198,
220,
220,
220,
3993,
7,
15,
13,
486,
8,
628
] | 2.528736 | 174 |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
# Contributors: bart:neeneenee*de, http://www.neeneenee.de/vrml, Campbell Barton
"""
This script exports to X3D format.
Usage:
Run this script from "File->Export" menu. A pop-up will ask whether you
want to export only selected or all relevant objects.
Known issues:
Doesn't handle multiple materials (don't use material indices);<br>
Doesn't handle multiple UV textures on a single mesh (create a mesh for each texture);<br>
Can't get the texture array associated with material * not the UV ones;
"""
import math
import os
import bpy
import mathutils
from bpy_extras.io_utils import create_derived_objects, free_derived_objects
x3d_names_reserved = {'Anchor', 'Appearance', 'Arc2D', 'ArcClose2D', 'AudioClip', 'Background', 'Billboard',
'BooleanFilter', 'BooleanSequencer', 'BooleanToggle', 'BooleanTrigger', 'Box', 'Circle2D',
'Collision', 'Color', 'ColorInterpolator', 'ColorRGBA', 'component', 'Cone', 'connect',
'Contour2D', 'ContourPolyline2D', 'Coordinate', 'CoordinateDouble', 'CoordinateInterpolator',
'CoordinateInterpolator2D', 'Cylinder', 'CylinderSensor', 'DirectionalLight', 'Disk2D',
'ElevationGrid', 'EspduTransform', 'EXPORT', 'ExternProtoDeclare', 'Extrusion', 'field',
'fieldValue', 'FillProperties', 'Fog', 'FontStyle', 'GeoCoordinate', 'GeoElevationGrid',
'GeoLocationLocation', 'GeoLOD', 'GeoMetadata', 'GeoOrigin', 'GeoPositionInterpolator',
'GeoTouchSensor', 'GeoViewpoint', 'Group', 'HAnimDisplacer', 'HAnimHumanoid', 'HAnimJoint',
'HAnimSegment', 'HAnimSite', 'head', 'ImageTexture', 'IMPORT', 'IndexedFaceSet',
'IndexedLineSet', 'IndexedTriangleFanSet', 'IndexedTriangleSet', 'IndexedTriangleStripSet',
'Inline', 'IntegerSequencer', 'IntegerTrigger', 'IS', 'KeySensor', 'LineProperties', 'LineSet',
'LoadSensor', 'LOD', 'Material', 'meta', 'MetadataDouble', 'MetadataFloat', 'MetadataInteger',
'MetadataSet', 'MetadataString', 'MovieTexture', 'MultiTexture', 'MultiTextureCoordinate',
'MultiTextureTransform', 'NavigationInfo', 'Normal', 'NormalInterpolator', 'NurbsCurve',
'NurbsCurve2D', 'NurbsOrientationInterpolator', 'NurbsPatchSurface',
'NurbsPositionInterpolator', 'NurbsSet', 'NurbsSurfaceInterpolator', 'NurbsSweptSurface',
'NurbsSwungSurface', 'NurbsTextureCoordinate', 'NurbsTrimmedSurface', 'OrientationInterpolator',
'PixelTexture', 'PlaneSensor', 'PointLight', 'PointSet', 'Polyline2D', 'Polypoint2D',
'PositionInterpolator', 'PositionInterpolator2D', 'ProtoBody', 'ProtoDeclare', 'ProtoInstance',
'ProtoInterface', 'ProximitySensor', 'ReceiverPdu', 'Rectangle2D', 'ROUTE', 'ScalarInterpolator',
'Scene', 'Script', 'Shape', 'SignalPdu', 'Sound', 'Sphere', 'SphereSensor', 'SpotLight', 'StaticGroup',
'StringSensor', 'Switch', 'Text', 'TextureBackground', 'TextureCoordinate', 'TextureCoordinateGenerator',
'TextureTransform', 'TimeSensor', 'TimeTrigger', 'TouchSensor', 'Transform', 'TransmitterPdu',
'TriangleFanSet', 'TriangleSet', 'TriangleSet2D', 'TriangleStripSet', 'Viewpoint', 'VisibilitySensor',
'WorldInfo', 'X3D', 'XvlShell', 'VertexShader', 'FragmentShader', 'MultiShaderAppearance', 'ShaderAppearance'}
# h3d defines
H3D_TOP_LEVEL = 'TOP_LEVEL_TI'
H3D_CAMERA_FOLLOW = 'CAMERA_FOLLOW_TRANSFORM'
H3D_VIEW_MATRIX = 'view_matrix'
def build_hierarchy(objects):
""" returns parent child relationships, skipping
"""
objects_set = set(objects)
par_lookup = {}
for obj in objects:
par_lookup.setdefault(test_parent(obj.parent), []).append((obj, []))
for parent, children in par_lookup.items():
for obj, subchildren in children:
subchildren[:] = par_lookup.get(obj, [])
return par_lookup.get(None, [])
# -----------------------------------------------------------------------------
# H3D Functions
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# Functions for writing output file
# -----------------------------------------------------------------------------
##########################################################
# Callbacks, needed before Main
##########################################################
| [
2,
46424,
347,
43312,
38644,
38559,
24290,
9878,
11290,
46424,
198,
2,
198,
2,
220,
770,
1430,
318,
1479,
3788,
26,
345,
460,
17678,
4163,
340,
290,
14,
273,
198,
2,
220,
13096,
340,
739,
262,
2846,
286,
262,
22961,
3611,
5094,
13789,
198,
2,
220,
355,
3199,
416,
262,
3232,
10442,
5693,
26,
2035,
2196,
362,
198,
2,
220,
286,
262,
13789,
11,
393,
357,
265,
534,
3038,
8,
597,
1568,
2196,
13,
198,
2,
198,
2,
220,
770,
1430,
318,
9387,
287,
262,
2911,
326,
340,
481,
307,
4465,
11,
198,
2,
220,
475,
42881,
15529,
34764,
56,
26,
1231,
772,
262,
17142,
18215,
286,
198,
2,
220,
34482,
3398,
1565,
5603,
25382,
393,
376,
46144,
7473,
317,
16652,
2149,
37232,
33079,
48933,
13,
220,
4091,
262,
198,
2,
220,
22961,
3611,
5094,
13789,
329,
517,
3307,
13,
198,
2,
198,
2,
220,
921,
815,
423,
2722,
257,
4866,
286,
262,
22961,
3611,
5094,
13789,
198,
2,
220,
1863,
351,
428,
1430,
26,
611,
407,
11,
3551,
284,
262,
3232,
10442,
5693,
11,
198,
2,
220,
3457,
1539,
6885,
14021,
3530,
11,
19383,
22343,
11,
6182,
11,
8779,
657,
2481,
940,
12,
1485,
486,
11,
4916,
13,
198,
2,
198,
2,
46424,
23578,
38644,
38559,
24290,
9878,
11290,
46424,
198,
198,
2,
1279,
431,
79,
23,
31332,
29,
198,
198,
2,
25767,
669,
25,
30539,
25,
710,
1734,
268,
1453,
9,
2934,
11,
2638,
1378,
2503,
13,
710,
1734,
268,
1453,
13,
2934,
14,
37020,
4029,
11,
14327,
32342,
198,
198,
37811,
198,
1212,
4226,
15319,
284,
1395,
18,
35,
5794,
13,
198,
198,
28350,
25,
198,
10987,
428,
4226,
422,
366,
8979,
3784,
43834,
1,
6859,
13,
220,
317,
1461,
12,
929,
481,
1265,
1771,
345,
198,
42949,
284,
10784,
691,
6163,
393,
477,
5981,
5563,
13,
198,
198,
29870,
2428,
25,
198,
220,
220,
220,
28048,
470,
5412,
3294,
5696,
357,
9099,
470,
779,
2587,
36525,
1776,
27,
1671,
29,
198,
220,
220,
220,
28048,
470,
5412,
3294,
22033,
20028,
319,
257,
2060,
19609,
357,
17953,
257,
19609,
329,
1123,
11743,
1776,
27,
1671,
29,
198,
220,
220,
220,
1680,
470,
651,
262,
11743,
7177,
3917,
351,
2587,
1635,
407,
262,
22033,
3392,
26,
198,
37811,
198,
198,
11748,
10688,
198,
11748,
28686,
198,
198,
11748,
275,
9078,
198,
11748,
10688,
26791,
198,
198,
6738,
275,
9078,
62,
2302,
8847,
13,
952,
62,
26791,
1330,
2251,
62,
34631,
62,
48205,
11,
1479,
62,
34631,
62,
48205,
198,
198,
87,
18,
67,
62,
14933,
62,
411,
8520,
796,
1391,
6,
2025,
354,
273,
3256,
705,
48231,
3256,
705,
24021,
17,
35,
3256,
705,
24021,
26125,
17,
35,
3256,
705,
21206,
2601,
541,
3256,
705,
21756,
3256,
705,
17798,
3526,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
46120,
13087,
22417,
3256,
705,
46120,
13087,
44015,
12137,
3256,
705,
46120,
13087,
51,
20258,
3256,
705,
46120,
13087,
48344,
3256,
705,
14253,
3256,
705,
31560,
293,
17,
35,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
22667,
1166,
3256,
705,
10258,
3256,
705,
10258,
9492,
16104,
1352,
3256,
705,
10258,
48192,
4339,
3256,
705,
42895,
3256,
705,
34,
505,
3256,
705,
8443,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
4264,
454,
17,
35,
3256,
705,
4264,
454,
34220,
1370,
17,
35,
3256,
705,
7222,
45480,
3256,
705,
7222,
45480,
25628,
3256,
705,
7222,
45480,
9492,
16104,
1352,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
7222,
45480,
9492,
16104,
1352,
17,
35,
3256,
705,
34,
2645,
5540,
3256,
705,
34,
2645,
5540,
47864,
3256,
705,
35,
4154,
282,
15047,
3256,
705,
40961,
17,
35,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
36,
2768,
341,
41339,
3256,
705,
36,
2777,
646,
41762,
3256,
705,
6369,
15490,
3256,
705,
3109,
759,
2964,
1462,
37835,
533,
3256,
705,
11627,
81,
4241,
3256,
705,
3245,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
3245,
11395,
3256,
705,
33762,
2964,
18200,
3256,
705,
37,
519,
3256,
705,
23252,
21466,
3256,
705,
10082,
78,
7222,
45480,
3256,
705,
10082,
78,
36,
2768,
341,
41339,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
10082,
78,
14749,
14749,
3256,
705,
10082,
78,
38543,
3256,
705,
10082,
78,
9171,
14706,
3256,
705,
10082,
78,
39688,
3256,
705,
10082,
78,
26545,
9492,
16104,
1352,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
10082,
78,
35211,
47864,
3256,
705,
10082,
78,
7680,
4122,
3256,
705,
13247,
3256,
705,
39,
35320,
7279,
489,
11736,
3256,
705,
39,
35320,
20490,
1868,
3256,
705,
39,
35320,
41,
1563,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
39,
35320,
41030,
434,
3256,
705,
39,
35320,
29123,
3256,
705,
2256,
3256,
705,
5159,
32742,
3256,
705,
3955,
15490,
3256,
705,
15732,
276,
32388,
7248,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
15732,
276,
13949,
7248,
3256,
705,
15732,
276,
14824,
9248,
22480,
7248,
3256,
705,
15732,
276,
14824,
9248,
7248,
3256,
705,
15732,
276,
14824,
9248,
1273,
5528,
7248,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
818,
1370,
3256,
705,
46541,
44015,
12137,
3256,
705,
46541,
48344,
3256,
705,
1797,
3256,
705,
9218,
47864,
3256,
705,
13949,
2964,
18200,
3256,
705,
13949,
7248,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
8912,
47864,
3256,
705,
38543,
3256,
705,
17518,
3256,
705,
28961,
3256,
705,
9171,
14706,
25628,
3256,
705,
9171,
14706,
43879,
3256,
705,
9171,
14706,
46541,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
9171,
14706,
7248,
3256,
705,
9171,
14706,
10100,
3256,
705,
25097,
32742,
3256,
705,
29800,
32742,
3256,
705,
29800,
32742,
7222,
45480,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
29800,
32742,
41762,
3256,
705,
30575,
7065,
12360,
3256,
705,
26447,
3256,
705,
26447,
9492,
16104,
1352,
3256,
705,
45,
333,
1443,
26628,
303,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
45,
333,
1443,
26628,
303,
17,
35,
3256,
705,
45,
333,
1443,
46,
8289,
341,
9492,
16104,
1352,
3256,
705,
45,
333,
1443,
33952,
14214,
2550,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
45,
333,
1443,
26545,
9492,
16104,
1352,
3256,
705,
45,
333,
1443,
7248,
3256,
705,
45,
333,
1443,
14214,
2550,
9492,
16104,
1352,
3256,
705,
45,
333,
1443,
40783,
457,
14214,
2550,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
45,
333,
1443,
10462,
2150,
14214,
2550,
3256,
705,
45,
333,
1443,
32742,
7222,
45480,
3256,
705,
45,
333,
1443,
2898,
320,
1150,
14214,
2550,
3256,
705,
46,
8289,
341,
9492,
16104,
1352,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
40809,
32742,
3256,
705,
3646,
1531,
47864,
3256,
705,
12727,
15047,
3256,
705,
12727,
7248,
3256,
705,
34220,
1370,
17,
35,
3256,
705,
34220,
4122,
17,
35,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
26545,
9492,
16104,
1352,
3256,
705,
26545,
9492,
16104,
1352,
17,
35,
3256,
705,
2964,
1462,
25842,
3256,
705,
2964,
1462,
37835,
533,
3256,
705,
2964,
1462,
33384,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
2964,
1462,
39317,
3256,
705,
2964,
87,
18853,
47864,
3256,
705,
3041,
39729,
47,
646,
3256,
705,
45474,
9248,
17,
35,
3256,
705,
49,
2606,
9328,
3256,
705,
3351,
282,
283,
9492,
16104,
1352,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
36542,
3256,
705,
7391,
3256,
705,
33383,
3256,
705,
11712,
282,
47,
646,
3256,
705,
21369,
3256,
705,
38882,
3256,
705,
38882,
47864,
3256,
705,
32565,
15047,
3256,
705,
45442,
13247,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
10100,
47864,
3256,
705,
38978,
3256,
705,
8206,
3256,
705,
32742,
21756,
3256,
705,
32742,
7222,
45480,
3256,
705,
32742,
7222,
45480,
8645,
1352,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
32742,
41762,
3256,
705,
7575,
47864,
3256,
705,
7575,
48344,
3256,
705,
35211,
47864,
3256,
705,
41762,
3256,
705,
8291,
37974,
47,
646,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
14824,
9248,
22480,
7248,
3256,
705,
14824,
9248,
7248,
3256,
705,
14824,
9248,
7248,
17,
35,
3256,
705,
14824,
9248,
1273,
5528,
7248,
3256,
705,
7680,
4122,
3256,
705,
15854,
2247,
47864,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
10603,
12360,
3256,
705,
55,
18,
35,
3256,
705,
55,
19279,
23248,
3256,
705,
13414,
16886,
2484,
5067,
3256,
705,
42974,
434,
2484,
5067,
3256,
705,
29800,
2484,
5067,
48231,
3256,
705,
2484,
5067,
48231,
6,
92,
198,
198,
2,
289,
18,
67,
15738,
198,
39,
18,
35,
62,
35222,
62,
2538,
18697,
796,
705,
35222,
62,
2538,
18697,
62,
25621,
6,
198,
39,
18,
35,
62,
34,
2390,
46461,
62,
6080,
44765,
796,
705,
34,
2390,
46461,
62,
6080,
44765,
62,
5446,
15037,
21389,
6,
198,
39,
18,
35,
62,
28206,
62,
41636,
7112,
55,
796,
705,
1177,
62,
6759,
8609,
6,
628,
628,
628,
198,
198,
4299,
1382,
62,
71,
959,
9282,
7,
48205,
2599,
198,
220,
220,
220,
37227,
5860,
2560,
1200,
6958,
11,
31017,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
5563,
62,
2617,
796,
900,
7,
48205,
8,
198,
220,
220,
220,
1582,
62,
5460,
929,
796,
23884,
628,
220,
220,
220,
329,
26181,
287,
5563,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1582,
62,
5460,
929,
13,
2617,
12286,
7,
9288,
62,
8000,
7,
26801,
13,
8000,
828,
17635,
737,
33295,
19510,
26801,
11,
17635,
4008,
628,
220,
220,
220,
329,
2560,
11,
1751,
287,
1582,
62,
5460,
929,
13,
23814,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
329,
26181,
11,
850,
17197,
287,
1751,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
850,
17197,
58,
47715,
796,
1582,
62,
5460,
929,
13,
1136,
7,
26801,
11,
685,
12962,
628,
220,
220,
220,
1441,
1582,
62,
5460,
929,
13,
1136,
7,
14202,
11,
685,
12962,
628,
198,
2,
16529,
32501,
198,
2,
367,
18,
35,
40480,
198,
2,
16529,
32501,
628,
198,
198,
2,
16529,
32501,
198,
2,
40480,
329,
3597,
5072,
2393,
198,
2,
16529,
32501,
628,
198,
29113,
14468,
7804,
2235,
198,
2,
4889,
10146,
11,
2622,
878,
8774,
198,
29113,
14468,
7804,
2235,
628
] | 2.696098 | 2,050 |
var("x", NUMBER, default=50, min=10, max=301, handler=params)
var("y", NUMBER, default=50, min=10, max=301, handler=params)
var("r1", NUMBER, default=50, min=10, max=300, handler=params)
var("r2", NUMBER, default=50, min=10, max=300, handler=params)
paintcircle(x,y,r1,r2)
| [
628,
198,
7785,
7203,
87,
1600,
36871,
13246,
11,
4277,
28,
1120,
11,
949,
28,
940,
11,
3509,
28,
18938,
11,
21360,
28,
37266,
8,
198,
7785,
7203,
88,
1600,
36871,
13246,
11,
4277,
28,
1120,
11,
949,
28,
940,
11,
3509,
28,
18938,
11,
21360,
28,
37266,
8,
198,
7785,
7203,
81,
16,
1600,
36871,
13246,
11,
4277,
28,
1120,
11,
949,
28,
940,
11,
3509,
28,
6200,
11,
21360,
28,
37266,
8,
198,
7785,
7203,
81,
17,
1600,
36871,
13246,
11,
4277,
28,
1120,
11,
949,
28,
940,
11,
3509,
28,
6200,
11,
21360,
28,
37266,
8,
198,
198,
79,
2913,
45597,
7,
87,
11,
88,
11,
81,
16,
11,
81,
17,
8,
198
] | 2.387931 | 116 |
"""querying.py
Functions for data discovery.
"""
import logging
import os.path
import pandas as pd
from sqlalchemy import func, distinct
import warnings
import xarray as xr
from . import database
from .database import NCExperiment, NCFile, CFVariable, NCVar
def get_experiments(session):
"""
Returns a DataFrame of all experiments and the number of netCDF4 files contained
within each experiment.
"""
q = (session
.query(NCExperiment.experiment,
func.count(NCFile.experiment_id).label('ncfiles'))
.join(NCFile.experiment)
.group_by(NCFile.experiment_id))
return pd.DataFrame(q)
def get_ncfiles(session, experiment):
"""
Returns a DataFrame of all netcdf files for a given experiment.
"""
q = (session
.query(NCFile.ncfile, NCFile.index_time)
.join(NCFile.experiment)
.filter(NCExperiment.experiment == experiment)
.order_by(NCFile.ncfile))
return pd.DataFrame(q)
def get_variables(session, experiment, frequency=None):
"""
Returns a DataFrame of variables for a given experiment and optionally
a given diagnostic frequency.
"""
q = (session
.query(CFVariable.name,
NCFile.frequency,
NCFile.ncfile,
func.count(NCFile.ncfile).label('# ncfiles'),
func.min(NCFile.time_start).label('time_start'),
func.max(NCFile.time_end).label('time_end'))
.join(NCFile.experiment)
.join(NCFile.ncvars)
.join(NCVar.variable)
.filter(NCExperiment.experiment == experiment)
.order_by(NCFile.frequency,
CFVariable.name,
NCFile.time_start,
NCFile.ncfile)
.group_by(CFVariable.name, NCFile.frequency))
if frequency is not None:
q = q.filter(NCFile.frequency == frequency)
return pd.DataFrame(q)
def get_frequencies(session, experiment=None):
"""
Returns a DataFrame with all diagnostics frequencies and optionally
for a given experiment.
"""
if experiment is None:
q = (session
.query(NCFile.frequency)
.group_by(NCFile.frequency))
else:
q = (session
.query(NCFile.frequency)
.join(NCFile.experiment)
.filter(NCExperiment.experiment == experiment)
.group_by(NCFile.frequency))
return pd.DataFrame(q)
def getvar(expt, variable, session, ncfile=None,
start_time=None, end_time=None, n=None, **kwargs):
"""For a given experiment, return an xarray DataArray containing the
specified variable.
expt - text string indicating the name of the experiment
variable - text string indicating the name of the variable to load
session - a database session created by cc.database.create_session()
ncfile - an optional text string indicating the pattern for filenames
to load. All filenames containing this string will match, so
be specific. '/' can be used to match the start of the
filename, and '%' is a wildcard character.
start_time - only load data after this date. specify as a text string,
e.g. '1900-01-01'
end_time - only load data before this date. specify as a text string,
e.g. '1900-01-01'
n - after all other queries, restrict the total number of files to the
first n. pass a negative value to restrict to the last n
Note that if start_time and/or end_time are used, the time range
of the resulting dataset may not be bounded exactly on those
values, depending on where the underlying files start/end. Use
dataset.sel() to exactly select times from the dataset.
Other kwargs are passed through to xarray.open_mfdataset, including:
chunks - Override any chunking by passing a chunks dictionary.
decode_times - Time decoding can be disabled by passing decode_times=False
"""
ncfiles = _ncfiles_for_variable(expt, variable, session, ncfile, start_time, end_time, n)
# chunking -- use first row/file and assume it's the same across the whole dataset
xr_kwargs = {"chunks": _parse_chunks(ncfiles[0].NCVar)}
xr_kwargs.update(kwargs)
ds = xr.open_mfdataset(
(str(f.NCFile.ncfile_path) for f in ncfiles),
parallel=True,
combine="by_coords",
preprocess=lambda d: d[variable].to_dataset()
if variable not in d.coords
else d,
**xr_kwargs
)
return ds[variable]
def _ncfiles_for_variable(expt, variable, session,
ncfile=None, start_time=None, end_time=None, n=None):
"""Return a list of (NCFile, NCVar) pairs corresponding to the
database objects for a given variable.
Optionally, pass ncfile, start_time, end_time or n for additional
disambiguation (see getvar documentation for their semantics).
"""
f, v = database.NCFile, database.NCVar
q = (
session.query(f, v)
.join(f.ncvars)
.join(f.experiment)
.filter(v.varname == variable)
.filter(database.NCExperiment.experiment == expt)
.filter(f.present)
.order_by(f.time_start)
)
# additional disambiguation
if ncfile is not None:
q = q.filter(f.ncfile.like("%" + ncfile))
if start_time is not None:
q = q.filter(f.time_end >= start_time)
if end_time is not None:
q = q.filter(f.time_start <= end_time)
ncfiles = q.all()
if n is not None:
if n > 0:
ncfiles = ncfiles[:n]
else:
ncfiles = ncfiles[n:]
# ensure we actually got a result
if not ncfiles:
raise VariableNotFoundError(
"No files were found containing '{}' in the '{}' experiment".format(
variable, expt
)
)
# check whether the results are unique
unique_files = set(os.path.basename(f.NCFile.ncfile) for f in ncfiles)
if len(unique_files) > 1:
warnings.warn(
f"Your query gets a variable from differently-named files: {unique_files}. "
"This could lead to unexpected behaviour! Disambiguate by passing "
"ncfile= to getvar, specifying the desired file."
)
return ncfiles
def _parse_chunks(ncvar):
"""Parse an NCVar, returning a dictionary mapping dimensions to chunking along that dimension."""
try:
# this should give either a list, or 'None' (other values will raise an exception)
var_chunks = eval(ncvar.chunking)
if var_chunks is not None:
return dict(zip(eval(ncvar.dimensions), var_chunks))
return None
except NameError:
# chunking could be 'contiguous', which doesn't evaluate
return None
| [
37811,
10819,
1112,
13,
9078,
198,
198,
24629,
2733,
329,
1366,
9412,
13,
198,
198,
37811,
198,
198,
11748,
18931,
198,
11748,
28686,
13,
6978,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
44161,
282,
26599,
1330,
25439,
11,
7310,
198,
11748,
14601,
198,
11748,
2124,
18747,
355,
2124,
81,
198,
198,
6738,
764,
1330,
6831,
198,
6738,
764,
48806,
1330,
8823,
20468,
3681,
11,
8823,
8979,
11,
18551,
43015,
11,
8823,
19852,
628,
198,
4299,
651,
62,
23100,
6800,
7,
29891,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
16409,
257,
6060,
19778,
286,
477,
10256,
290,
262,
1271,
286,
2010,
34,
8068,
19,
3696,
7763,
220,
198,
220,
220,
220,
1626,
1123,
6306,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
10662,
796,
357,
29891,
198,
220,
220,
220,
220,
220,
220,
220,
220,
764,
22766,
7,
7792,
20468,
3681,
13,
23100,
3681,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25439,
13,
9127,
7,
7792,
8979,
13,
23100,
3681,
62,
312,
737,
18242,
10786,
10782,
16624,
6,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
764,
22179,
7,
7792,
8979,
13,
23100,
3681,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
764,
8094,
62,
1525,
7,
7792,
8979,
13,
23100,
3681,
62,
312,
4008,
628,
220,
220,
220,
1441,
279,
67,
13,
6601,
19778,
7,
80,
8,
198,
198,
4299,
651,
62,
10782,
16624,
7,
29891,
11,
6306,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
16409,
257,
6060,
19778,
286,
477,
2010,
66,
7568,
3696,
329,
257,
1813,
6306,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
10662,
796,
357,
29891,
198,
220,
220,
220,
220,
220,
220,
220,
220,
764,
22766,
7,
7792,
8979,
13,
10782,
7753,
11,
8823,
8979,
13,
9630,
62,
2435,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
764,
22179,
7,
7792,
8979,
13,
23100,
3681,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
764,
24455,
7,
7792,
20468,
3681,
13,
23100,
3681,
6624,
6306,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
764,
2875,
62,
1525,
7,
7792,
8979,
13,
10782,
7753,
4008,
628,
220,
220,
220,
1441,
279,
67,
13,
6601,
19778,
7,
80,
8,
198,
198,
4299,
651,
62,
25641,
2977,
7,
29891,
11,
6306,
11,
8373,
28,
14202,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
16409,
257,
6060,
19778,
286,
9633,
329,
257,
1813,
6306,
290,
42976,
198,
220,
220,
220,
257,
1813,
23584,
8373,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
10662,
796,
357,
29891,
198,
220,
220,
220,
220,
220,
220,
220,
220,
764,
22766,
7,
22495,
43015,
13,
3672,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8823,
8979,
13,
35324,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8823,
8979,
13,
10782,
7753,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25439,
13,
9127,
7,
7792,
8979,
13,
10782,
7753,
737,
18242,
10786,
2,
299,
12993,
2915,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25439,
13,
1084,
7,
7792,
8979,
13,
2435,
62,
9688,
737,
18242,
10786,
2435,
62,
9688,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25439,
13,
9806,
7,
7792,
8979,
13,
2435,
62,
437,
737,
18242,
10786,
2435,
62,
437,
6,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
764,
22179,
7,
7792,
8979,
13,
23100,
3681,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
764,
22179,
7,
7792,
8979,
13,
10782,
85,
945,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
764,
22179,
7,
7792,
19852,
13,
45286,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
764,
24455,
7,
7792,
20468,
3681,
13,
23100,
3681,
6624,
6306,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
764,
2875,
62,
1525,
7,
7792,
8979,
13,
35324,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
18551,
43015,
13,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8823,
8979,
13,
2435,
62,
9688,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8823,
8979,
13,
10782,
7753,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
764,
8094,
62,
1525,
7,
22495,
43015,
13,
3672,
11,
8823,
8979,
13,
35324,
4008,
628,
220,
220,
220,
611,
8373,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
10662,
796,
10662,
13,
24455,
7,
7792,
8979,
13,
35324,
6624,
8373,
8,
628,
220,
220,
220,
1441,
279,
67,
13,
6601,
19778,
7,
80,
8,
198,
198,
4299,
651,
62,
69,
8897,
3976,
7,
29891,
11,
6306,
28,
14202,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
16409,
257,
6060,
19778,
351,
477,
6689,
34558,
19998,
290,
42976,
198,
220,
220,
220,
329,
257,
1813,
6306,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
611,
6306,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
10662,
796,
357,
29891,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
764,
22766,
7,
7792,
8979,
13,
35324,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
764,
8094,
62,
1525,
7,
7792,
8979,
13,
35324,
4008,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
10662,
796,
357,
29891,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
764,
22766,
7,
7792,
8979,
13,
35324,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
764,
22179,
7,
7792,
8979,
13,
23100,
3681,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
764,
24455,
7,
7792,
20468,
3681,
13,
23100,
3681,
6624,
6306,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
764,
8094,
62,
1525,
7,
7792,
8979,
13,
35324,
4008,
628,
220,
220,
220,
1441,
279,
67,
13,
6601,
19778,
7,
80,
8,
628,
198,
4299,
651,
7785,
7,
1069,
457,
11,
7885,
11,
6246,
11,
299,
66,
7753,
28,
14202,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
923,
62,
2435,
28,
14202,
11,
886,
62,
2435,
28,
14202,
11,
299,
28,
14202,
11,
12429,
46265,
22046,
2599,
198,
220,
220,
220,
37227,
1890,
257,
1813,
6306,
11,
1441,
281,
2124,
18747,
6060,
19182,
7268,
262,
198,
220,
220,
220,
7368,
7885,
13,
628,
220,
220,
220,
409,
457,
532,
2420,
4731,
12739,
262,
1438,
286,
262,
6306,
198,
220,
220,
220,
7885,
532,
2420,
4731,
12739,
262,
1438,
286,
262,
7885,
284,
3440,
198,
220,
220,
220,
6246,
532,
257,
6831,
6246,
2727,
416,
36624,
13,
48806,
13,
17953,
62,
29891,
3419,
198,
220,
220,
220,
299,
66,
7753,
532,
220,
281,
11902,
2420,
4731,
12739,
262,
3912,
329,
1226,
268,
1047,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
284,
3440,
13,
1439,
1226,
268,
1047,
7268,
428,
4731,
481,
2872,
11,
523,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
307,
2176,
13,
31051,
6,
460,
307,
973,
284,
2872,
262,
923,
286,
262,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
29472,
11,
290,
705,
4,
6,
318,
257,
4295,
9517,
2095,
13,
198,
220,
220,
220,
923,
62,
2435,
532,
691,
3440,
1366,
706,
428,
3128,
13,
11986,
355,
257,
2420,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
304,
13,
70,
13,
705,
48104,
12,
486,
12,
486,
6,
198,
220,
220,
220,
886,
62,
2435,
532,
691,
3440,
1366,
878,
428,
3128,
13,
11986,
355,
257,
2420,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
304,
13,
70,
13,
705,
48104,
12,
486,
12,
486,
6,
198,
220,
220,
220,
299,
532,
706,
477,
584,
20743,
11,
4239,
262,
2472,
1271,
286,
3696,
284,
262,
198,
220,
220,
220,
220,
220,
220,
220,
717,
299,
13,
1208,
257,
4633,
1988,
284,
4239,
284,
262,
938,
299,
628,
220,
220,
220,
5740,
326,
611,
923,
62,
2435,
290,
14,
273,
886,
62,
2435,
389,
973,
11,
262,
640,
2837,
198,
220,
220,
220,
286,
262,
7186,
27039,
743,
407,
307,
49948,
3446,
319,
883,
198,
220,
220,
220,
3815,
11,
6906,
319,
810,
262,
10238,
3696,
923,
14,
437,
13,
5765,
198,
220,
220,
220,
27039,
13,
741,
3419,
284,
3446,
2922,
1661,
422,
262,
27039,
13,
628,
220,
220,
220,
3819,
479,
86,
22046,
389,
3804,
832,
284,
2124,
18747,
13,
9654,
62,
76,
16344,
265,
292,
316,
11,
1390,
25,
628,
220,
220,
220,
22716,
532,
3827,
13154,
597,
16058,
278,
416,
6427,
257,
22716,
22155,
13,
198,
220,
220,
220,
36899,
62,
22355,
532,
3862,
39938,
460,
307,
10058,
416,
6427,
36899,
62,
22355,
28,
25101,
628,
220,
220,
220,
37227,
628,
220,
220,
220,
299,
12993,
2915,
796,
4808,
10782,
16624,
62,
1640,
62,
45286,
7,
1069,
457,
11,
7885,
11,
6246,
11,
299,
66,
7753,
11,
923,
62,
2435,
11,
886,
62,
2435,
11,
299,
8,
628,
220,
220,
220,
1303,
16058,
278,
1377,
779,
717,
5752,
14,
7753,
290,
7048,
340,
338,
262,
976,
1973,
262,
2187,
27039,
198,
220,
220,
220,
2124,
81,
62,
46265,
22046,
796,
19779,
354,
14125,
1298,
4808,
29572,
62,
354,
14125,
7,
10782,
16624,
58,
15,
4083,
7792,
19852,
38165,
198,
220,
220,
220,
2124,
81,
62,
46265,
22046,
13,
19119,
7,
46265,
22046,
8,
628,
220,
220,
220,
288,
82,
796,
2124,
81,
13,
9654,
62,
76,
16344,
265,
292,
316,
7,
198,
220,
220,
220,
220,
220,
220,
220,
357,
2536,
7,
69,
13,
7792,
8979,
13,
10782,
7753,
62,
6978,
8,
329,
277,
287,
299,
12993,
2915,
828,
198,
220,
220,
220,
220,
220,
220,
220,
10730,
28,
17821,
11,
198,
220,
220,
220,
220,
220,
220,
220,
12082,
2625,
1525,
62,
1073,
3669,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
662,
14681,
28,
50033,
288,
25,
288,
58,
45286,
4083,
1462,
62,
19608,
292,
316,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
611,
7885,
407,
287,
288,
13,
1073,
3669,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
288,
11,
198,
220,
220,
220,
220,
220,
220,
220,
12429,
87,
81,
62,
46265,
22046,
198,
220,
220,
220,
1267,
628,
220,
220,
220,
1441,
288,
82,
58,
45286,
60,
628,
198,
4299,
4808,
10782,
16624,
62,
1640,
62,
45286,
7,
1069,
457,
11,
7885,
11,
6246,
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,
299,
66,
7753,
28,
14202,
11,
923,
62,
2435,
28,
14202,
11,
886,
62,
2435,
28,
14202,
11,
299,
28,
14202,
2599,
198,
220,
220,
220,
37227,
13615,
257,
1351,
286,
357,
7792,
8979,
11,
8823,
19852,
8,
14729,
11188,
284,
262,
198,
220,
220,
220,
6831,
5563,
329,
257,
1813,
7885,
13,
628,
220,
220,
220,
16018,
453,
11,
1208,
299,
66,
7753,
11,
923,
62,
2435,
11,
886,
62,
2435,
393,
299,
329,
3224,
198,
220,
220,
220,
595,
4131,
328,
2288,
357,
3826,
651,
7785,
10314,
329,
511,
33815,
737,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
277,
11,
410,
796,
6831,
13,
7792,
8979,
11,
6831,
13,
7792,
19852,
198,
220,
220,
220,
10662,
796,
357,
198,
220,
220,
220,
220,
220,
220,
220,
6246,
13,
22766,
7,
69,
11,
410,
8,
198,
220,
220,
220,
220,
220,
220,
220,
764,
22179,
7,
69,
13,
10782,
85,
945,
8,
198,
220,
220,
220,
220,
220,
220,
220,
764,
22179,
7,
69,
13,
23100,
3681,
8,
198,
220,
220,
220,
220,
220,
220,
220,
764,
24455,
7,
85,
13,
85,
1501,
480,
6624,
7885,
8,
198,
220,
220,
220,
220,
220,
220,
220,
764,
24455,
7,
48806,
13,
7792,
20468,
3681,
13,
23100,
3681,
6624,
409,
457,
8,
198,
220,
220,
220,
220,
220,
220,
220,
764,
24455,
7,
69,
13,
25579,
8,
198,
220,
220,
220,
220,
220,
220,
220,
764,
2875,
62,
1525,
7,
69,
13,
2435,
62,
9688,
8,
198,
220,
220,
220,
1267,
628,
220,
220,
220,
1303,
3224,
595,
4131,
328,
2288,
198,
220,
220,
220,
611,
299,
66,
7753,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
10662,
796,
10662,
13,
24455,
7,
69,
13,
10782,
7753,
13,
2339,
7203,
39658,
1343,
299,
66,
7753,
4008,
198,
220,
220,
220,
611,
923,
62,
2435,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
10662,
796,
10662,
13,
24455,
7,
69,
13,
2435,
62,
437,
18189,
923,
62,
2435,
8,
198,
220,
220,
220,
611,
886,
62,
2435,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
10662,
796,
10662,
13,
24455,
7,
69,
13,
2435,
62,
9688,
19841,
886,
62,
2435,
8,
198,
220,
220,
220,
299,
12993,
2915,
796,
10662,
13,
439,
3419,
628,
220,
220,
220,
611,
299,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
299,
1875,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
299,
12993,
2915,
796,
299,
12993,
2915,
58,
25,
77,
60,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
299,
12993,
2915,
796,
299,
12993,
2915,
58,
77,
47715,
628,
220,
220,
220,
1303,
4155,
356,
1682,
1392,
257,
1255,
198,
220,
220,
220,
611,
407,
299,
12993,
2915,
25,
198,
220,
220,
220,
220,
220,
220,
220,
5298,
35748,
3673,
21077,
12331,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
2949,
3696,
547,
1043,
7268,
705,
90,
92,
6,
287,
262,
705,
90,
92,
6,
6306,
1911,
18982,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7885,
11,
409,
457,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
1303,
2198,
1771,
262,
2482,
389,
3748,
198,
220,
220,
220,
3748,
62,
16624,
796,
900,
7,
418,
13,
6978,
13,
12093,
12453,
7,
69,
13,
7792,
8979,
13,
10782,
7753,
8,
329,
277,
287,
299,
12993,
2915,
8,
198,
220,
220,
220,
611,
18896,
7,
34642,
62,
16624,
8,
1875,
352,
25,
198,
220,
220,
220,
220,
220,
220,
220,
14601,
13,
40539,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
1,
7120,
12405,
3011,
257,
7885,
422,
10338,
12,
13190,
3696,
25,
1391,
34642,
62,
16624,
27422,
366,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
1212,
714,
1085,
284,
10059,
9172,
0,
3167,
4131,
328,
4985,
416,
6427,
366,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
10782,
7753,
28,
284,
651,
7785,
11,
31577,
262,
10348,
2393,
526,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
1441,
299,
12993,
2915,
198,
198,
4299,
4808,
29572,
62,
354,
14125,
7,
10782,
7785,
2599,
198,
220,
220,
220,
37227,
10044,
325,
281,
8823,
19852,
11,
8024,
257,
22155,
16855,
15225,
284,
16058,
278,
1863,
326,
15793,
526,
15931,
628,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
428,
815,
1577,
2035,
257,
1351,
11,
393,
705,
14202,
6,
357,
847,
3815,
481,
5298,
281,
6631,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1401,
62,
354,
14125,
796,
5418,
7,
10782,
7785,
13,
354,
2954,
278,
8,
198,
220,
220,
220,
220,
220,
220,
220,
611,
1401,
62,
354,
14125,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
8633,
7,
13344,
7,
18206,
7,
10782,
7785,
13,
27740,
5736,
828,
1401,
62,
354,
14125,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
6045,
628,
220,
220,
220,
2845,
6530,
12331,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
16058,
278,
714,
307,
705,
3642,
29709,
3256,
543,
1595,
470,
13446,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
6045,
198
] | 2.437478 | 2,807 |
from threading import Thread
import time
""" The Cat class is a Thread by itself. There must be an __init__ calling Super
__init__ with self as an argument. Also, there must be an "run" def. """
| [
6738,
4704,
278,
1330,
14122,
198,
11748,
640,
198,
198,
37811,
383,
5181,
1398,
318,
257,
14122,
416,
2346,
13,
1318,
1276,
307,
281,
11593,
15003,
834,
4585,
3115,
198,
834,
15003,
834,
351,
2116,
355,
281,
4578,
13,
4418,
11,
612,
1276,
307,
281,
366,
5143,
1,
825,
13,
37227,
198
] | 3.769231 | 52 |
# IDEA: harvest.py?
import sys
import socket
import simplejson as json
from config import config
dispatch_table = {
"add-project" : add_project,
"stop-project" : stop_project,
"list-projects" : list_projects,
"shutdown" : shutdown,
}
if len(sys.argv) == 1 or sys.argv[1] not in dispatch_table:
print """Usage:
add-project "Name" "tag1,tag2,tag3" -- add a project
stop-project "id" -- stop recording data for a project
list-projects -- list all active projects
shutdown -- stop the daemon
"""
sys.exit()
command = " ".join(sys.argv[1:])
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# Connect the socket to the port where the server is listening
server_address = ('localhost', config["server_socket_port"])
sock.connect(server_address)
try:
sock.sendall(command)
data = ""
while True:
packet = sock.recv(1024)
if not packet:
break
data += packet
# print data
print dispatch_table[sys.argv[1]](json.loads(data))
finally:
sock.close()
| [
2,
4522,
16412,
25,
13222,
13,
9078,
30,
198,
198,
11748,
25064,
198,
11748,
17802,
198,
11748,
2829,
17752,
355,
33918,
198,
198,
6738,
4566,
1330,
4566,
628,
198,
6381,
17147,
62,
11487,
796,
1391,
198,
220,
220,
220,
366,
2860,
12,
16302,
1,
1058,
751,
62,
16302,
11,
198,
220,
220,
220,
366,
11338,
12,
16302,
1,
1058,
2245,
62,
16302,
11,
198,
220,
220,
220,
366,
4868,
12,
42068,
1,
1058,
1351,
62,
42068,
11,
198,
220,
220,
220,
366,
49625,
2902,
1,
1058,
18325,
11,
198,
92,
198,
198,
361,
18896,
7,
17597,
13,
853,
85,
8,
6624,
352,
393,
25064,
13,
853,
85,
58,
16,
60,
407,
287,
27965,
62,
11487,
25,
198,
220,
220,
220,
3601,
37227,
28350,
25,
220,
198,
198,
2860,
12,
16302,
366,
5376,
1,
366,
12985,
16,
11,
12985,
17,
11,
12985,
18,
1,
1377,
751,
257,
1628,
198,
11338,
12,
16302,
366,
312,
1,
1377,
2245,
8296,
1366,
329,
257,
1628,
220,
198,
4868,
12,
42068,
1377,
1351,
477,
4075,
4493,
198,
49625,
2902,
1377,
2245,
262,
33386,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
25064,
13,
37023,
3419,
198,
198,
21812,
796,
366,
27071,
22179,
7,
17597,
13,
853,
85,
58,
16,
25,
12962,
198,
198,
82,
735,
796,
17802,
13,
44971,
7,
44971,
13,
8579,
62,
1268,
2767,
11,
17802,
13,
50,
11290,
62,
2257,
32235,
8,
198,
198,
2,
8113,
262,
17802,
284,
262,
2493,
810,
262,
4382,
318,
8680,
198,
15388,
62,
21975,
796,
19203,
36750,
3256,
4566,
14692,
15388,
62,
44971,
62,
634,
8973,
8,
198,
82,
735,
13,
8443,
7,
15388,
62,
21975,
8,
198,
198,
28311,
25,
198,
220,
220,
220,
32263,
13,
21280,
439,
7,
21812,
8,
198,
220,
220,
220,
1366,
796,
13538,
198,
220,
220,
220,
981,
6407,
25,
198,
220,
220,
220,
220,
220,
220,
220,
19638,
796,
32263,
13,
8344,
85,
7,
35500,
8,
198,
220,
220,
220,
220,
220,
220,
220,
611,
407,
19638,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2270,
198,
220,
220,
220,
220,
220,
220,
220,
1366,
15853,
19638,
198,
220,
220,
220,
1303,
3601,
1366,
198,
220,
220,
220,
3601,
27965,
62,
11487,
58,
17597,
13,
853,
85,
58,
16,
11907,
7,
17752,
13,
46030,
7,
7890,
4008,
198,
69,
3289,
25,
198,
220,
220,
220,
32263,
13,
19836,
3419,
198
] | 2.627204 | 397 |
from datetime import datetime
| [
198,
6738,
4818,
8079,
1330,
4818,
8079,
628,
628,
628,
198
] | 3.363636 | 11 |
# Python Program to print Strong Numbers from 1 to N
import math
maximum = int(input(" Please Enter the Maximum Value: "))
for Number in range(1, maximum):
Temp = Number
Sum = 0
while(Temp > 0):
Reminder = Temp % 10
Factorial = math.factorial(Reminder)
Sum = Sum + Factorial
Temp = Temp // 10
if (Sum == Number):
print(" %d is a Strong Number" %Number) | [
2,
11361,
6118,
284,
3601,
13535,
27797,
422,
352,
284,
399,
198,
11748,
10688,
198,
198,
47033,
796,
493,
7,
15414,
7203,
4222,
6062,
262,
22246,
11052,
25,
366,
4008,
198,
198,
1640,
7913,
287,
2837,
7,
16,
11,
5415,
2599,
198,
220,
220,
220,
24189,
796,
7913,
198,
220,
220,
220,
5060,
796,
657,
198,
220,
220,
220,
981,
7,
30782,
1875,
657,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
3982,
5540,
796,
24189,
4064,
838,
198,
220,
220,
220,
220,
220,
220,
220,
19020,
5132,
796,
10688,
13,
22584,
5132,
7,
8413,
5540,
8,
198,
220,
220,
220,
220,
220,
220,
220,
5060,
796,
5060,
1343,
19020,
5132,
198,
220,
220,
220,
220,
220,
220,
220,
24189,
796,
24189,
3373,
838,
198,
220,
220,
220,
220,
198,
220,
220,
220,
611,
357,
13065,
6624,
7913,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
4064,
67,
318,
257,
13535,
7913,
1,
4064,
15057,
8
] | 2.59375 | 160 |
#
# pip install pyside6
#
from PySide6 import QtWidgets, QtGui, QtCore
import logging
from glglue.ctypesmath.camera import FrameState
import glglue.gl3.samplecontroller
from glglue.gl3 import gizmo
logger = logging.getLogger(__name__)
logging.basicConfig(format='%(levelname)s:%(name)s:%(message)s',
level=logging.DEBUG)
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
window = Window()
window.show()
sys.exit(app.exec())
| [
2,
198,
2,
7347,
2721,
279,
893,
485,
21,
198,
2,
198,
6738,
9485,
24819,
21,
1330,
33734,
54,
312,
11407,
11,
33734,
8205,
72,
11,
33734,
14055,
198,
11748,
18931,
198,
6738,
1278,
4743,
518,
13,
310,
9497,
11018,
13,
25695,
1330,
25184,
9012,
198,
11748,
1278,
4743,
518,
13,
4743,
18,
13,
39873,
36500,
198,
6738,
1278,
4743,
518,
13,
4743,
18,
1330,
308,
528,
5908,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
198,
6404,
2667,
13,
35487,
16934,
7,
18982,
11639,
4,
7,
5715,
3672,
8,
82,
25,
4,
7,
3672,
8,
82,
25,
4,
7,
20500,
8,
82,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1241,
28,
6404,
2667,
13,
30531,
8,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1330,
25064,
198,
220,
220,
220,
598,
796,
33734,
54,
312,
11407,
13,
48,
23416,
7,
17597,
13,
853,
85,
8,
198,
220,
220,
220,
4324,
796,
26580,
3419,
198,
220,
220,
220,
4324,
13,
12860,
3419,
198,
220,
220,
220,
25064,
13,
37023,
7,
1324,
13,
18558,
28955,
198
] | 2.426471 | 204 |
import psyneulink as pnl
import numpy as np
import matplotlib.pyplot as plt
#sample Hebb
FeatureNames=['small','medium','large','red','yellow','blue','circle','rectangle','triangle']
# create a variable that corresponds to the size of our feature space
sizeF = len(FeatureNames)
small_red_circle = [1,0,0,1,0,0,1,0,0]
src = small_red_circle
Hebb_comp = pnl.Composition()
Hebb_mech=pnl.RecurrentTransferMechanism(
size=sizeF,
function=pnl.Linear,
#integrator_mode = True,
#integration_rate = 0.5,
enable_learning = True,
learning_rate = .1,
name='Hebb_mech',
#matrix=pnl.AutoAssociativeProjection,
auto=0,
hetero=0
)
Hebb_comp.add_node(Hebb_mech)
Hebb_comp.execution_id = 1
# Use print_info to show numerical values and vis_info to show graphs of the changing values
inputs_dict = {Hebb_mech:np.array(src)}
out=Hebb_comp.learn(num_trials=5,
# call_after_trial=vis_info,
inputs=inputs_dict)
print_info()
| [
11748,
17331,
710,
377,
676,
355,
279,
21283,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
2,
39873,
679,
11848,
198,
198,
38816,
36690,
28,
17816,
17470,
41707,
24132,
41707,
11664,
41707,
445,
41707,
36022,
41707,
17585,
41707,
45597,
41707,
2554,
9248,
41707,
28461,
9248,
20520,
198,
198,
2,
2251,
257,
7885,
326,
24866,
284,
262,
2546,
286,
674,
3895,
2272,
198,
7857,
37,
796,
18896,
7,
38816,
36690,
8,
198,
17470,
62,
445,
62,
45597,
796,
685,
16,
11,
15,
11,
15,
11,
16,
11,
15,
11,
15,
11,
16,
11,
15,
11,
15,
60,
198,
10677,
796,
1402,
62,
445,
62,
45597,
628,
198,
1544,
11848,
62,
5589,
796,
279,
21283,
13,
5377,
9150,
3419,
198,
198,
1544,
11848,
62,
1326,
354,
28,
79,
21283,
13,
6690,
6657,
43260,
28452,
48162,
7,
198,
220,
220,
220,
2546,
28,
7857,
37,
11,
198,
220,
220,
220,
2163,
28,
79,
21283,
13,
14993,
451,
11,
198,
220,
220,
220,
1303,
18908,
12392,
62,
14171,
796,
6407,
11,
198,
220,
220,
220,
1303,
18908,
1358,
62,
4873,
796,
657,
13,
20,
11,
198,
220,
220,
220,
7139,
62,
40684,
796,
6407,
11,
198,
220,
220,
220,
4673,
62,
4873,
796,
764,
16,
11,
198,
220,
220,
220,
1438,
11639,
1544,
11848,
62,
1326,
354,
3256,
198,
220,
220,
220,
1303,
6759,
8609,
28,
79,
21283,
13,
27722,
8021,
1733,
876,
16775,
295,
11,
198,
220,
220,
220,
8295,
28,
15,
11,
198,
220,
220,
220,
14445,
78,
28,
15,
198,
220,
220,
220,
1267,
198,
198,
1544,
11848,
62,
5589,
13,
2860,
62,
17440,
7,
1544,
11848,
62,
1326,
354,
8,
198,
198,
1544,
11848,
62,
5589,
13,
18558,
1009,
62,
312,
796,
352,
198,
198,
2,
5765,
3601,
62,
10951,
284,
905,
29052,
3815,
290,
1490,
62,
10951,
284,
905,
28770,
286,
262,
5609,
3815,
628,
198,
15414,
82,
62,
11600,
796,
1391,
1544,
11848,
62,
1326,
354,
25,
37659,
13,
18747,
7,
10677,
38165,
198,
448,
28,
1544,
11848,
62,
5589,
13,
35720,
7,
22510,
62,
28461,
874,
28,
20,
11,
198,
220,
220,
220,
220,
220,
1303,
869,
62,
8499,
62,
45994,
28,
4703,
62,
10951,
11,
198,
220,
220,
220,
220,
220,
17311,
28,
15414,
82,
62,
11600,
8,
198,
198,
4798,
62,
10951,
3419,
198
] | 2.491003 | 389 |
import os, hashlib
from cryptography.fernet import Fernet
import base64
#import ast
import json
import module_postcode
import datetime
'''
Encrypt Mode : Fernet
Decrypt Mode : Fernet
Key size : 32bytes
'''
# 키를 사용하기위해 만드는 로직
# 클라이언트에게 보낼 키를 암호화
# 클라이언트에게 받은 키를 복호화
| [
11748,
28686,
11,
12234,
8019,
198,
6738,
45898,
13,
69,
1142,
316,
1330,
38982,
316,
198,
11748,
2779,
2414,
198,
2,
11748,
6468,
198,
11748,
33918,
198,
11748,
8265,
62,
7353,
8189,
198,
11748,
4818,
8079,
628,
198,
198,
7061,
6,
198,
198,
27195,
6012,
10363,
1058,
38982,
316,
198,
10707,
6012,
10363,
1058,
38982,
316,
198,
198,
9218,
2546,
1058,
3933,
33661,
198,
198,
7061,
6,
628,
220,
220,
220,
1303,
220,
169,
224,
97,
167,
98,
120,
23821,
8955,
168,
248,
102,
47991,
246,
166,
116,
108,
168,
250,
226,
47991,
112,
31619,
100,
234,
167,
241,
250,
167,
232,
242,
31619,
94,
250,
168,
100,
223,
628,
220,
220,
220,
1303,
220,
169,
223,
112,
167,
251,
120,
35975,
112,
168,
244,
116,
169,
232,
116,
168,
245,
238,
166,
110,
234,
31619,
111,
112,
167,
224,
120,
220,
169,
224,
97,
167,
98,
120,
23821,
243,
242,
169,
246,
116,
169,
247,
242,
628,
220,
220,
220,
1303,
220,
169,
223,
112,
167,
251,
120,
35975,
112,
168,
244,
116,
169,
232,
116,
168,
245,
238,
166,
110,
234,
31619,
108,
249,
35975,
222,
220,
169,
224,
97,
167,
98,
120,
31619,
111,
113,
169,
246,
116,
169,
247,
242,
628
] | 1.4 | 205 |
import os
from skimage.transform import rescale
import numpy as np
import matplotlib.pyplot as plt
from cv_class.proj1.code.student import vis_hybrid_image, load_image, save_image, my_imfilter, gen_hybrid_image
resultsDir = '..' + os.sep + 'results'
if not os.path.exists(resultsDir):
os.mkdir(resultsDir)
test_image = load_image('../data/cat.bmp')
print(test_image.shape)
# cv2.imshow('test1', test_image)
# cv2.waitKey(1000)
test_image = rescale(test_image, [0.7, 0.7, 1], mode='reflect')
print(test_image.shape)
# cv2.imshow('test2', test_image)
# cv2.waitKey(1000)
identity_filter = np.asarray([[0, 0, 0], [0, 1, 0], [0, 0, 0]], dtype=np.float32)
identity_image = my_imfilter(test_image, identity_filter)
plt.imshow(identity_image)
done = save_image(resultsDir + os.sep + 'identity_image.jpg', identity_image)
blur_filter = np.ones((3, 3), dtype=np.float32)
blur_filter /= np.sum(blur_filter, dtype=np.float32) # making the filter sum to 1
blur_image = my_imfilter(test_image, blur_filter)
plt.imshow(blur_image)
done = save_image(resultsDir + os.sep + 'blur_image.jpg', blur_image)
sobel_filter = np.asarray([[-1, 0, 1], [-2, 0, 2], [-1, 0, 1]],
dtype=np.float32) # should respond to horizontal gradients
sobel_image = my_imfilter(test_image, sobel_filter)
# 0.5 added because the output image is centered around zero otherwise and mostly black
sobel_image = np.clip(sobel_image + 0.5, 0.0, 1.0)
plt.imshow(sobel_image)
done = save_image(resultsDir + os.sep + 'sobel_image.jpg', sobel_image)
laplacian_filter = np.asarray([[0, 1, 0], [1, -4, 1], [0, 1, 0]], dtype=np.float32)
laplacian_image = my_imfilter(test_image, laplacian_filter)
# added because the output image is centered around zero otherwise and mostly black
laplacian_image = np.clip(laplacian_image + 0.5, 0.0, 1.0)
plt.figure()
plt.imshow(laplacian_image)
done = save_image(resultsDir + os.sep + 'laplacian_image.jpg', laplacian_image)
# High pass "filter" alternative
high_pass_image = test_image - blur_image
high_pass_image = np.clip(high_pass_image + 0.5, 0.0, 1.0)
plt.figure()
plt.imshow(high_pass_image)
done = save_image(resultsDir + os.sep + 'high_pass_image.jpg', high_pass_image)
image1 = load_image('../data/dog.bmp')
image2 = load_image('../data/cat.bmp')
# display the dog and cat images
plt.figure(figsize=(3, 3))
plt.imshow((image1 * 255).astype(np.uint8))
plt.figure(figsize=(3, 3))
plt.imshow((image2 * 255).astype(np.uint8))
cutoff_frequency = 7
low_frequencies, high_frequencies, hybrid_image = gen_hybrid_image(image1, image2, cutoff_frequency)
## Visualize and save outputs ##
plt.figure()
plt.imshow((low_frequencies * 255).astype(np.uint8))
plt.figure()
plt.imshow(((high_frequencies + 0.5) * 255).astype(np.uint8))
vis = vis_hybrid_image(hybrid_image)
plt.figure(figsize=(20, 20))
plt.imshow(vis)
low_frequencies = np.clip(low_frequencies, 0.0, 1.0)
high_frequencies = np.clip(high_frequencies, 0.0, 1.0)
hybrid_image = np.clip(hybrid_image, 0.0, 1.0)
vis = np.clip(vis, 0.0, 1.0)
save_image('../results/low_frequencies.jpg', low_frequencies)
save_image('../results/high_frequencies.jpg', high_frequencies)
save_image('../results/hybrid_image.jpg', hybrid_image)
save_image('../results/hybrid_image_scales.jpg', vis)
| [
11748,
28686,
198,
6738,
1341,
9060,
13,
35636,
1330,
6811,
1000,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
269,
85,
62,
4871,
13,
1676,
73,
16,
13,
8189,
13,
50139,
1330,
1490,
62,
12114,
10236,
62,
9060,
11,
3440,
62,
9060,
11,
3613,
62,
9060,
11,
616,
62,
320,
24455,
11,
2429,
62,
12114,
10236,
62,
9060,
198,
198,
43420,
35277,
796,
705,
492,
6,
1343,
28686,
13,
325,
79,
1343,
705,
43420,
6,
198,
361,
407,
28686,
13,
6978,
13,
1069,
1023,
7,
43420,
35277,
2599,
198,
220,
220,
220,
28686,
13,
28015,
15908,
7,
43420,
35277,
8,
198,
198,
9288,
62,
9060,
796,
3440,
62,
9060,
10786,
40720,
7890,
14,
9246,
13,
65,
3149,
11537,
198,
4798,
7,
9288,
62,
9060,
13,
43358,
8,
198,
2,
269,
85,
17,
13,
320,
12860,
10786,
9288,
16,
3256,
1332,
62,
9060,
8,
198,
2,
269,
85,
17,
13,
17077,
9218,
7,
12825,
8,
198,
198,
9288,
62,
9060,
796,
6811,
1000,
7,
9288,
62,
9060,
11,
685,
15,
13,
22,
11,
657,
13,
22,
11,
352,
4357,
4235,
11639,
35051,
11537,
198,
4798,
7,
9288,
62,
9060,
13,
43358,
8,
198,
2,
269,
85,
17,
13,
320,
12860,
10786,
9288,
17,
3256,
1332,
62,
9060,
8,
198,
2,
269,
85,
17,
13,
17077,
9218,
7,
12825,
8,
198,
198,
738,
414,
62,
24455,
796,
45941,
13,
292,
18747,
26933,
58,
15,
11,
657,
11,
657,
4357,
685,
15,
11,
352,
11,
657,
4357,
685,
15,
11,
657,
11,
657,
60,
4357,
288,
4906,
28,
37659,
13,
22468,
2624,
8,
198,
738,
414,
62,
9060,
796,
616,
62,
320,
24455,
7,
9288,
62,
9060,
11,
5369,
62,
24455,
8,
198,
489,
83,
13,
320,
12860,
7,
738,
414,
62,
9060,
8,
198,
28060,
796,
3613,
62,
9060,
7,
43420,
35277,
1343,
28686,
13,
325,
79,
1343,
705,
738,
414,
62,
9060,
13,
9479,
3256,
5369,
62,
9060,
8,
198,
198,
2436,
333,
62,
24455,
796,
45941,
13,
1952,
19510,
18,
11,
513,
828,
288,
4906,
28,
37659,
13,
22468,
2624,
8,
198,
2436,
333,
62,
24455,
1220,
28,
45941,
13,
16345,
7,
2436,
333,
62,
24455,
11,
288,
4906,
28,
37659,
13,
22468,
2624,
8,
220,
1303,
1642,
262,
8106,
2160,
284,
352,
198,
2436,
333,
62,
9060,
796,
616,
62,
320,
24455,
7,
9288,
62,
9060,
11,
23671,
62,
24455,
8,
198,
489,
83,
13,
320,
12860,
7,
2436,
333,
62,
9060,
8,
198,
28060,
796,
3613,
62,
9060,
7,
43420,
35277,
1343,
28686,
13,
325,
79,
1343,
705,
2436,
333,
62,
9060,
13,
9479,
3256,
23671,
62,
9060,
8,
198,
198,
568,
6667,
62,
24455,
796,
45941,
13,
292,
18747,
26933,
58,
12,
16,
11,
657,
11,
352,
4357,
25915,
17,
11,
657,
11,
362,
4357,
25915,
16,
11,
657,
11,
352,
60,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
288,
4906,
28,
37659,
13,
22468,
2624,
8,
220,
1303,
815,
3031,
284,
16021,
3915,
2334,
198,
568,
6667,
62,
9060,
796,
616,
62,
320,
24455,
7,
9288,
62,
9060,
11,
523,
6667,
62,
24455,
8,
198,
198,
2,
657,
13,
20,
2087,
780,
262,
5072,
2939,
318,
19254,
1088,
6632,
4306,
290,
4632,
2042,
198,
568,
6667,
62,
9060,
796,
45941,
13,
15036,
7,
568,
6667,
62,
9060,
1343,
657,
13,
20,
11,
657,
13,
15,
11,
352,
13,
15,
8,
198,
489,
83,
13,
320,
12860,
7,
568,
6667,
62,
9060,
8,
198,
28060,
796,
3613,
62,
9060,
7,
43420,
35277,
1343,
28686,
13,
325,
79,
1343,
705,
568,
6667,
62,
9060,
13,
9479,
3256,
523,
6667,
62,
9060,
8,
198,
198,
5031,
489,
330,
666,
62,
24455,
796,
45941,
13,
292,
18747,
26933,
58,
15,
11,
352,
11,
657,
4357,
685,
16,
11,
532,
19,
11,
352,
4357,
685,
15,
11,
352,
11,
657,
60,
4357,
288,
4906,
28,
37659,
13,
22468,
2624,
8,
198,
5031,
489,
330,
666,
62,
9060,
796,
616,
62,
320,
24455,
7,
9288,
62,
9060,
11,
8591,
489,
330,
666,
62,
24455,
8,
198,
198,
2,
2087,
780,
262,
5072,
2939,
318,
19254,
1088,
6632,
4306,
290,
4632,
2042,
198,
5031,
489,
330,
666,
62,
9060,
796,
45941,
13,
15036,
7,
5031,
489,
330,
666,
62,
9060,
1343,
657,
13,
20,
11,
657,
13,
15,
11,
352,
13,
15,
8,
198,
489,
83,
13,
26875,
3419,
198,
489,
83,
13,
320,
12860,
7,
5031,
489,
330,
666,
62,
9060,
8,
198,
28060,
796,
3613,
62,
9060,
7,
43420,
35277,
1343,
28686,
13,
325,
79,
1343,
705,
5031,
489,
330,
666,
62,
9060,
13,
9479,
3256,
8591,
489,
330,
666,
62,
9060,
8,
198,
198,
2,
3334,
1208,
366,
24455,
1,
5559,
198,
8929,
62,
6603,
62,
9060,
796,
1332,
62,
9060,
532,
23671,
62,
9060,
198,
8929,
62,
6603,
62,
9060,
796,
45941,
13,
15036,
7,
8929,
62,
6603,
62,
9060,
1343,
657,
13,
20,
11,
657,
13,
15,
11,
352,
13,
15,
8,
198,
489,
83,
13,
26875,
3419,
198,
489,
83,
13,
320,
12860,
7,
8929,
62,
6603,
62,
9060,
8,
198,
28060,
796,
3613,
62,
9060,
7,
43420,
35277,
1343,
28686,
13,
325,
79,
1343,
705,
8929,
62,
6603,
62,
9060,
13,
9479,
3256,
1029,
62,
6603,
62,
9060,
8,
198,
198,
9060,
16,
796,
3440,
62,
9060,
10786,
40720,
7890,
14,
9703,
13,
65,
3149,
11537,
198,
9060,
17,
796,
3440,
62,
9060,
10786,
40720,
7890,
14,
9246,
13,
65,
3149,
11537,
198,
198,
2,
3359,
262,
3290,
290,
3797,
4263,
198,
489,
83,
13,
26875,
7,
5647,
7857,
16193,
18,
11,
513,
4008,
198,
489,
83,
13,
320,
12860,
19510,
9060,
16,
1635,
14280,
737,
459,
2981,
7,
37659,
13,
28611,
23,
4008,
198,
489,
83,
13,
26875,
7,
5647,
7857,
16193,
18,
11,
513,
4008,
198,
489,
83,
13,
320,
12860,
19510,
9060,
17,
1635,
14280,
737,
459,
2981,
7,
37659,
13,
28611,
23,
4008,
198,
8968,
2364,
62,
35324,
796,
767,
198,
9319,
62,
69,
8897,
3976,
11,
1029,
62,
69,
8897,
3976,
11,
14554,
62,
9060,
796,
2429,
62,
12114,
10236,
62,
9060,
7,
9060,
16,
11,
2939,
17,
11,
45616,
62,
35324,
8,
198,
2235,
15612,
1096,
290,
3613,
23862,
22492,
198,
489,
83,
13,
26875,
3419,
198,
489,
83,
13,
320,
12860,
19510,
9319,
62,
69,
8897,
3976,
1635,
14280,
737,
459,
2981,
7,
37659,
13,
28611,
23,
4008,
198,
489,
83,
13,
26875,
3419,
198,
489,
83,
13,
320,
12860,
19510,
7,
8929,
62,
69,
8897,
3976,
1343,
657,
13,
20,
8,
1635,
14280,
737,
459,
2981,
7,
37659,
13,
28611,
23,
4008,
198,
4703,
796,
1490,
62,
12114,
10236,
62,
9060,
7,
12114,
10236,
62,
9060,
8,
198,
489,
83,
13,
26875,
7,
5647,
7857,
16193,
1238,
11,
1160,
4008,
198,
489,
83,
13,
320,
12860,
7,
4703,
8,
198,
9319,
62,
69,
8897,
3976,
796,
45941,
13,
15036,
7,
9319,
62,
69,
8897,
3976,
11,
657,
13,
15,
11,
352,
13,
15,
8,
198,
8929,
62,
69,
8897,
3976,
796,
45941,
13,
15036,
7,
8929,
62,
69,
8897,
3976,
11,
657,
13,
15,
11,
352,
13,
15,
8,
198,
12114,
10236,
62,
9060,
796,
45941,
13,
15036,
7,
12114,
10236,
62,
9060,
11,
657,
13,
15,
11,
352,
13,
15,
8,
198,
4703,
796,
45941,
13,
15036,
7,
4703,
11,
657,
13,
15,
11,
352,
13,
15,
8,
198,
21928,
62,
9060,
10786,
40720,
43420,
14,
9319,
62,
69,
8897,
3976,
13,
9479,
3256,
1877,
62,
69,
8897,
3976,
8,
198,
21928,
62,
9060,
10786,
40720,
43420,
14,
8929,
62,
69,
8897,
3976,
13,
9479,
3256,
1029,
62,
69,
8897,
3976,
8,
198,
21928,
62,
9060,
10786,
40720,
43420,
14,
12114,
10236,
62,
9060,
13,
9479,
3256,
14554,
62,
9060,
8,
198,
21928,
62,
9060,
10786,
40720,
43420,
14,
12114,
10236,
62,
9060,
62,
1416,
2040,
13,
9479,
3256,
1490,
8,
198
] | 2.454751 | 1,326 |
# Copyright 2019 The Feast Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import time
from abc import ABC, abstractmethod
from dataclasses import asdict, dataclass
from datetime import datetime, timedelta
from typing import Callable, Dict, List, Optional, Type, Union
import pandas as pd
import pyarrow
from google.cloud import bigquery
from jinja2 import BaseLoader, Environment
from feast.data_source import BigQuerySource, DataSource, FileSource
from feast.feature_view import FeatureView
from feast.repo_config import RepoConfig
ENTITY_DF_EVENT_TIMESTAMP_COL = "event_timestamp"
class RetrievalJob(ABC):
"""RetrievalJob is used to manage the execution of a historical feature retrieval"""
@abstractmethod
def to_df(self):
"""Return dataset as Pandas DataFrame synchronously"""
pass
@dataclass(frozen=True)
class FeatureViewQueryContext:
"""Context object used to template a BigQuery point-in-time SQL query"""
name: str
ttl: int
entities: List[str]
features: List[str] # feature reference format
table_ref: str
event_timestamp_column: str
created_timestamp_column: str
field_mapping: Dict[str, str]
query: str
table_subquery: str
class OfflineStore(ABC):
"""
OfflineStore is an object used for all interaction between Feast and the service used for offline storage of
features. Currently BigQuery is supported.
"""
@staticmethod
@abstractmethod
def pull_latest_from_table_or_query(
data_source: DataSource,
entity_names: List[str],
feature_names: List[str],
event_timestamp_column: str,
created_timestamp_column: Optional[str],
start_date: datetime,
end_date: datetime,
) -> pyarrow.Table:
"""
Note that entity_names, feature_names, event_timestamp_column, and created_timestamp_column
have all already been mapped back to column names of the source table
and those column names are the values passed into this function.
"""
pass
@staticmethod
@abstractmethod
def _upload_entity_df_into_bigquery(project, entity_df) -> str:
"""Uploads a Pandas entity dataframe into a BigQuery table and returns a reference to the resulting table"""
client = bigquery.Client()
# First create the BigQuery dataset if it doesn't exist
dataset = bigquery.Dataset(f"{client.project}.feast_{project}")
dataset.location = "US"
client.create_dataset(
dataset, exists_ok=True
) # TODO: Consider moving this to apply or BigQueryOfflineStore
# Drop the index so that we dont have unnecessary columns
entity_df.reset_index(drop=True, inplace=True)
# Upload the dataframe into BigQuery, creating a temporary table
job_config = bigquery.LoadJobConfig()
table_id = f"{client.project}.feast_{project}.entity_df_{int(time.time())}"
job = client.load_table_from_dataframe(entity_df, table_id, job_config=job_config,)
job.result()
# Ensure that the table expires after some time
table = client.get_table(table=table_id)
table.expires = datetime.utcnow() + timedelta(minutes=30)
client.update_table(table, ["expires"])
return table_id
def get_feature_view_query_context(
feature_refs: List[str], feature_views: List[FeatureView]
) -> List[FeatureViewQueryContext]:
"""Build a query context containing all information required to template a BigQuery point-in-time SQL query"""
feature_views_to_feature_map = _get_requested_feature_views_to_features_dict(
feature_refs, feature_views
)
query_context = []
for feature_view, features in feature_views_to_feature_map.items():
entity_names = [entity for entity in feature_view.entities]
if isinstance(feature_view.ttl, timedelta):
ttl_seconds = int(feature_view.ttl.total_seconds())
else:
ttl_seconds = 0
assert isinstance(feature_view.input, BigQuerySource)
context = FeatureViewQueryContext(
name=feature_view.name,
ttl=ttl_seconds,
entities=entity_names,
features=features,
table_ref=feature_view.input.table_ref,
event_timestamp_column=feature_view.input.event_timestamp_column,
created_timestamp_column=feature_view.input.created_timestamp_column,
# TODO: Make created column optional and not hardcoded
field_mapping=feature_view.input.field_mapping,
query=feature_view.input.query,
table_subquery=feature_view.input.get_table_query_string(),
)
query_context.append(context)
return query_context
def build_point_in_time_query(
feature_view_query_contexts: List[FeatureViewQueryContext],
min_timestamp: datetime,
max_timestamp: datetime,
left_table_query_string: str,
):
"""Build point-in-time query between each feature view table and the entity dataframe"""
template = Environment(loader=BaseLoader()).from_string(
source=SINGLE_FEATURE_VIEW_POINT_IN_TIME_JOIN
)
# Add additional fields to dict
template_context = {
"min_timestamp": min_timestamp,
"max_timestamp": max_timestamp,
"left_table_query_string": left_table_query_string,
"featureviews": [asdict(context) for context in feature_view_query_contexts],
}
query = template.render(template_context)
return query
def get_offline_store_for_retrieval(feature_views: List[FeatureView],) -> OfflineStore:
"""Detect which offline store should be used for retrieving historical features"""
source_types = [type(feature_view.input) for feature_view in feature_views]
# Retrieve features from ParquetOfflineStore
if all(source == FileSource for source in source_types):
return FileOfflineStore()
# Retrieve features from BigQueryOfflineStore
if all(source == BigQuerySource for source in source_types):
return BigQueryOfflineStore()
# Could not map inputs to an OfflineStore implementation
raise NotImplementedError(
"Unsupported combination of feature view input source types. Please ensure that all source types are "
"consistent and available in the same offline store."
)
def _get_requested_feature_views_to_features_dict(
feature_refs: List[str], feature_views: List[FeatureView]
) -> Dict[FeatureView, List[str]]:
"""Create a dict of FeatureView -> List[Feature] for all requested features"""
feature_views_to_feature_map = {} # type: Dict[FeatureView, List[str]]
for ref in feature_refs:
ref_parts = ref.split(":")
feature_view_from_ref = ref_parts[0]
feature_from_ref = ref_parts[1]
found = False
for feature_view_from_registry in feature_views:
if feature_view_from_registry.name == feature_view_from_ref:
found = True
if feature_view_from_registry in feature_views_to_feature_map:
feature_views_to_feature_map[feature_view_from_registry].append(
feature_from_ref
)
else:
feature_views_to_feature_map[feature_view_from_registry] = [
feature_from_ref
]
if not found:
raise ValueError(f"Could not find feature view from reference {ref}")
return feature_views_to_feature_map
# TODO: Optimizations
# * Use GENERATE_UUID() instead of ROW_NUMBER(), or join on entity columns directly
# * Precompute ROW_NUMBER() so that it doesn't have to be recomputed for every query on entity_dataframe
# * Create temporary tables instead of keeping all tables in memory
SINGLE_FEATURE_VIEW_POINT_IN_TIME_JOIN = """
WITH entity_dataframe AS (
SELECT ROW_NUMBER() OVER() AS row_number, edf.* FROM {{ left_table_query_string }} as edf
),
{% for featureview in featureviews %}
/*
This query template performs the point-in-time correctness join for a single feature set table
to the provided entity table.
1. Concatenate the timestamp and entities from the feature set table with the entity dataset.
Feature values are joined to this table later for improved efficiency.
featureview_timestamp is equal to null in rows from the entity dataset.
*/
{{ featureview.name }}__union_features AS (
SELECT
-- unique identifier for each row in the entity dataset.
row_number,
-- event_timestamp contains the timestamps to join onto
event_timestamp,
-- the feature_timestamp, i.e. the latest occurrence of the requested feature relative to the entity_dataset timestamp
NULL as {{ featureview.name }}_feature_timestamp,
-- created timestamp of the feature at the corresponding feature_timestamp
NULL as created_timestamp,
-- select only entities belonging to this feature set
{{ featureview.entities | join(', ')}},
-- boolean for filtering the dataset later
true AS is_entity_table
FROM entity_dataframe
UNION ALL
SELECT
NULL as row_number,
{{ featureview.event_timestamp_column }} as event_timestamp,
{{ featureview.event_timestamp_column }} as {{ featureview.name }}_feature_timestamp,
{{ featureview.created_timestamp_column }} as created_timestamp,
{{ featureview.entities | join(', ')}},
false AS is_entity_table
FROM {{ featureview.table_subquery }} WHERE {{ featureview.event_timestamp_column }} <= '{{ max_timestamp }}'
{% if featureview.ttl == 0 %}{% else %}AND {{ featureview.event_timestamp_column }} >= Timestamp_sub(TIMESTAMP '{{ min_timestamp }}', interval {{ featureview.ttl }} second){% endif %}
),
/*
2. Window the data in the unioned dataset, partitioning by entity and ordering by event_timestamp, as
well as is_entity_table.
Within each window, back-fill the feature_timestamp - as a result of this, the null feature_timestamps
in the rows from the entity table should now contain the latest timestamps relative to the row's
event_timestamp.
For rows where event_timestamp(provided datetime) - feature_timestamp > max age, set the
feature_timestamp to null.
*/
{{ featureview.name }}__joined AS (
SELECT
row_number,
event_timestamp,
{{ featureview.entities | join(', ')}},
{% for feature in featureview.features %}
IF(event_timestamp >= {{ featureview.name }}_feature_timestamp {% if featureview.ttl == 0 %}{% else %}AND Timestamp_sub(event_timestamp, interval {{ featureview.ttl }} second) < {{ featureview.name }}_feature_timestamp{% endif %}, {{ featureview.name }}__{{ feature }}, NULL) as {{ featureview.name }}__{{ feature }}{% if loop.last %}{% else %}, {% endif %}
{% endfor %}
FROM (
SELECT
row_number,
event_timestamp,
{{ featureview.entities | join(', ')}},
FIRST_VALUE(created_timestamp IGNORE NULLS) over w AS created_timestamp,
FIRST_VALUE({{ featureview.name }}_feature_timestamp IGNORE NULLS) over w AS {{ featureview.name }}_feature_timestamp,
is_entity_table
FROM {{ featureview.name }}__union_features
WINDOW w AS (PARTITION BY {{ featureview.entities | join(', ') }} ORDER BY event_timestamp DESC, is_entity_table DESC, created_timestamp DESC ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
)
/*
3. Select only the rows from the entity table, and join the features from the original feature set table
to the dataset using the entity values, feature_timestamp, and created_timestamps.
*/
LEFT JOIN (
SELECT
{{ featureview.event_timestamp_column }} as {{ featureview.name }}_feature_timestamp,
{{ featureview.created_timestamp_column }} as created_timestamp,
{{ featureview.entities | join(', ')}},
{% for feature in featureview.features %}
{{ feature }} as {{ featureview.name }}__{{ feature }}{% if loop.last %}{% else %}, {% endif %}
{% endfor %}
FROM {{ featureview.table_subquery }} WHERE {{ featureview.event_timestamp_column }} <= '{{ max_timestamp }}'
{% if featureview.ttl == 0 %}{% else %}AND {{ featureview.event_timestamp_column }} >= Timestamp_sub(TIMESTAMP '{{ min_timestamp }}', interval {{ featureview.ttl }} second){% endif %}
) USING ({{ featureview.name }}_feature_timestamp, created_timestamp, {{ featureview.entities | join(', ')}})
WHERE is_entity_table
),
/*
4. Finally, deduplicate the rows by selecting the first occurrence of each entity table row_number.
*/
{{ featureview.name }}__deduped AS (SELECT
k.*
FROM (
SELECT ARRAY_AGG(row LIMIT 1)[OFFSET(0)] k
FROM {{ featureview.name }}__joined row
GROUP BY row_number
)){% if loop.last %}{% else %}, {% endif %}
{% endfor %}
/*
Joins the outputs of multiple time travel joins to a single table.
*/
SELECT edf.event_timestamp as event_timestamp, * EXCEPT (row_number, event_timestamp) FROM entity_dataframe edf
{% for featureview in featureviews %}
LEFT JOIN (
SELECT
row_number,
{% for feature in featureview.features %}
{{ featureview.name }}__{{ feature }}{% if loop.last %}{% else %}, {% endif %}
{% endfor %}
FROM {{ featureview.name }}__deduped
) USING (row_number)
{% endfor %}
ORDER BY event_timestamp
"""
| [
2,
15069,
13130,
383,
42936,
46665,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
7330,
257,
4866,
286,
262,
13789,
379,
198,
2,
198,
2,
220,
220,
220,
220,
3740,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
43,
2149,
24290,
12,
17,
13,
15,
198,
2,
198,
2,
17486,
2672,
416,
9723,
1099,
393,
4987,
284,
287,
3597,
11,
3788,
198,
2,
9387,
739,
262,
13789,
318,
9387,
319,
281,
366,
1921,
3180,
1,
29809,
1797,
11,
198,
2,
42881,
34764,
11015,
6375,
7102,
49828,
11053,
3963,
15529,
509,
12115,
11,
2035,
4911,
393,
17142,
13,
198,
2,
4091,
262,
13789,
329,
262,
2176,
3303,
15030,
21627,
290,
198,
2,
11247,
739,
262,
13789,
13,
198,
11748,
640,
198,
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
198,
6738,
4818,
330,
28958,
1330,
355,
11600,
11,
4818,
330,
31172,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
6738,
19720,
1330,
4889,
540,
11,
360,
713,
11,
7343,
11,
32233,
11,
5994,
11,
4479,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
12972,
6018,
198,
6738,
23645,
13,
17721,
1330,
1263,
22766,
198,
6738,
474,
259,
6592,
17,
1330,
7308,
17401,
11,
9344,
198,
198,
6738,
26951,
13,
7890,
62,
10459,
1330,
4403,
20746,
7416,
11,
6060,
7416,
11,
9220,
7416,
198,
6738,
26951,
13,
30053,
62,
1177,
1330,
27018,
7680,
198,
6738,
26951,
13,
260,
7501,
62,
11250,
1330,
1432,
78,
16934,
198,
198,
3525,
9050,
62,
8068,
62,
20114,
3525,
62,
51,
3955,
6465,
23518,
62,
25154,
796,
366,
15596,
62,
16514,
27823,
1,
628,
198,
4871,
4990,
380,
18206,
33308,
7,
24694,
2599,
198,
220,
220,
220,
37227,
9781,
380,
18206,
33308,
318,
973,
284,
6687,
262,
9706,
286,
257,
6754,
3895,
45069,
37811,
628,
220,
220,
220,
2488,
397,
8709,
24396,
198,
220,
220,
220,
825,
284,
62,
7568,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
13615,
27039,
355,
16492,
292,
6060,
19778,
18305,
3481,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
1208,
628,
628,
198,
31,
19608,
330,
31172,
7,
69,
42005,
28,
17821,
8,
198,
4871,
27018,
7680,
20746,
21947,
25,
198,
220,
220,
220,
37227,
21947,
2134,
973,
284,
11055,
257,
4403,
20746,
966,
12,
259,
12,
2435,
16363,
12405,
37811,
628,
220,
220,
220,
1438,
25,
965,
198,
220,
220,
220,
256,
28781,
25,
493,
198,
220,
220,
220,
12066,
25,
7343,
58,
2536,
60,
198,
220,
220,
220,
3033,
25,
7343,
58,
2536,
60,
220,
1303,
3895,
4941,
5794,
198,
220,
220,
220,
3084,
62,
5420,
25,
965,
198,
220,
220,
220,
1785,
62,
16514,
27823,
62,
28665,
25,
965,
198,
220,
220,
220,
2727,
62,
16514,
27823,
62,
28665,
25,
965,
198,
220,
220,
220,
2214,
62,
76,
5912,
25,
360,
713,
58,
2536,
11,
965,
60,
198,
220,
220,
220,
12405,
25,
965,
198,
220,
220,
220,
3084,
62,
7266,
22766,
25,
965,
628,
198,
4871,
49749,
22658,
7,
24694,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
49749,
22658,
318,
281,
2134,
973,
329,
477,
10375,
1022,
42936,
290,
262,
2139,
973,
329,
18043,
6143,
286,
198,
220,
220,
220,
3033,
13,
16888,
4403,
20746,
318,
4855,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
2488,
12708,
24396,
198,
220,
220,
220,
2488,
397,
8709,
24396,
198,
220,
220,
220,
825,
2834,
62,
42861,
62,
6738,
62,
11487,
62,
273,
62,
22766,
7,
198,
220,
220,
220,
220,
220,
220,
220,
1366,
62,
10459,
25,
6060,
7416,
11,
198,
220,
220,
220,
220,
220,
220,
220,
9312,
62,
14933,
25,
7343,
58,
2536,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
3895,
62,
14933,
25,
7343,
58,
2536,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
1785,
62,
16514,
27823,
62,
28665,
25,
965,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2727,
62,
16514,
27823,
62,
28665,
25,
32233,
58,
2536,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
923,
62,
4475,
25,
4818,
8079,
11,
198,
220,
220,
220,
220,
220,
220,
220,
886,
62,
4475,
25,
4818,
8079,
11,
198,
220,
220,
220,
1267,
4613,
12972,
6018,
13,
10962,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
5740,
326,
9312,
62,
14933,
11,
3895,
62,
14933,
11,
1785,
62,
16514,
27823,
62,
28665,
11,
290,
2727,
62,
16514,
27823,
62,
28665,
198,
220,
220,
220,
220,
220,
220,
220,
423,
477,
1541,
587,
27661,
736,
284,
5721,
3891,
286,
262,
2723,
3084,
198,
220,
220,
220,
220,
220,
220,
220,
290,
883,
5721,
3891,
389,
262,
3815,
3804,
656,
428,
2163,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1208,
628,
220,
220,
220,
2488,
12708,
24396,
198,
220,
220,
220,
2488,
397,
8709,
24396,
628,
198,
198,
4299,
4808,
25850,
62,
26858,
62,
7568,
62,
20424,
62,
14261,
22766,
7,
16302,
11,
9312,
62,
7568,
8,
4613,
965,
25,
198,
220,
220,
220,
37227,
41592,
82,
257,
16492,
292,
9312,
1366,
14535,
656,
257,
4403,
20746,
3084,
290,
5860,
257,
4941,
284,
262,
7186,
3084,
37811,
198,
220,
220,
220,
5456,
796,
1263,
22766,
13,
11792,
3419,
628,
220,
220,
220,
1303,
3274,
2251,
262,
4403,
20746,
27039,
611,
340,
1595,
470,
2152,
198,
220,
220,
220,
27039,
796,
1263,
22766,
13,
27354,
292,
316,
7,
69,
1,
90,
16366,
13,
16302,
27422,
5036,
459,
23330,
16302,
92,
4943,
198,
220,
220,
220,
27039,
13,
24886,
796,
366,
2937,
1,
198,
220,
220,
220,
5456,
13,
17953,
62,
19608,
292,
316,
7,
198,
220,
220,
220,
220,
220,
220,
220,
27039,
11,
7160,
62,
482,
28,
17821,
198,
220,
220,
220,
1267,
220,
1303,
16926,
46,
25,
12642,
3867,
428,
284,
4174,
393,
4403,
20746,
28657,
22658,
628,
220,
220,
220,
1303,
14258,
262,
6376,
523,
326,
356,
17666,
423,
13114,
15180,
198,
220,
220,
220,
9312,
62,
7568,
13,
42503,
62,
9630,
7,
14781,
28,
17821,
11,
287,
5372,
28,
17821,
8,
628,
220,
220,
220,
1303,
36803,
262,
1366,
14535,
656,
4403,
20746,
11,
4441,
257,
8584,
3084,
198,
220,
220,
220,
1693,
62,
11250,
796,
1263,
22766,
13,
8912,
33308,
16934,
3419,
198,
220,
220,
220,
3084,
62,
312,
796,
277,
1,
90,
16366,
13,
16302,
27422,
5036,
459,
23330,
16302,
27422,
26858,
62,
7568,
23330,
600,
7,
2435,
13,
2435,
28955,
36786,
198,
220,
220,
220,
1693,
796,
5456,
13,
2220,
62,
11487,
62,
6738,
62,
7890,
14535,
7,
26858,
62,
7568,
11,
3084,
62,
312,
11,
1693,
62,
11250,
28,
21858,
62,
11250,
35751,
198,
220,
220,
220,
1693,
13,
20274,
3419,
628,
220,
220,
220,
1303,
48987,
326,
262,
3084,
27396,
706,
617,
640,
198,
220,
220,
220,
3084,
796,
5456,
13,
1136,
62,
11487,
7,
11487,
28,
11487,
62,
312,
8,
198,
220,
220,
220,
3084,
13,
11201,
2387,
796,
4818,
8079,
13,
315,
66,
2197,
3419,
1343,
28805,
12514,
7,
1084,
1769,
28,
1270,
8,
198,
220,
220,
220,
5456,
13,
19119,
62,
11487,
7,
11487,
11,
14631,
11201,
2387,
8973,
8,
628,
220,
220,
220,
1441,
3084,
62,
312,
628,
198,
4299,
651,
62,
30053,
62,
1177,
62,
22766,
62,
22866,
7,
198,
220,
220,
220,
3895,
62,
5420,
82,
25,
7343,
58,
2536,
4357,
3895,
62,
33571,
25,
7343,
58,
38816,
7680,
60,
198,
8,
4613,
7343,
58,
38816,
7680,
20746,
21947,
5974,
198,
220,
220,
220,
37227,
15580,
257,
12405,
4732,
7268,
477,
1321,
2672,
284,
11055,
257,
4403,
20746,
966,
12,
259,
12,
2435,
16363,
12405,
37811,
628,
220,
220,
220,
3895,
62,
33571,
62,
1462,
62,
30053,
62,
8899,
796,
4808,
1136,
62,
25927,
276,
62,
30053,
62,
33571,
62,
1462,
62,
40890,
62,
11600,
7,
198,
220,
220,
220,
220,
220,
220,
220,
3895,
62,
5420,
82,
11,
3895,
62,
33571,
198,
220,
220,
220,
1267,
628,
220,
220,
220,
12405,
62,
22866,
796,
17635,
198,
220,
220,
220,
329,
3895,
62,
1177,
11,
3033,
287,
3895,
62,
33571,
62,
1462,
62,
30053,
62,
8899,
13,
23814,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
9312,
62,
14933,
796,
685,
26858,
329,
9312,
287,
3895,
62,
1177,
13,
298,
871,
60,
628,
220,
220,
220,
220,
220,
220,
220,
611,
318,
39098,
7,
30053,
62,
1177,
13,
926,
75,
11,
28805,
12514,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
28781,
62,
43012,
796,
493,
7,
30053,
62,
1177,
13,
926,
75,
13,
23350,
62,
43012,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
28781,
62,
43012,
796,
657,
628,
220,
220,
220,
220,
220,
220,
220,
6818,
318,
39098,
7,
30053,
62,
1177,
13,
15414,
11,
4403,
20746,
7416,
8,
628,
220,
220,
220,
220,
220,
220,
220,
4732,
796,
27018,
7680,
20746,
21947,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
28,
30053,
62,
1177,
13,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
28781,
28,
926,
75,
62,
43012,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12066,
28,
26858,
62,
14933,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3033,
28,
40890,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3084,
62,
5420,
28,
30053,
62,
1177,
13,
15414,
13,
11487,
62,
5420,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1785,
62,
16514,
27823,
62,
28665,
28,
30053,
62,
1177,
13,
15414,
13,
15596,
62,
16514,
27823,
62,
28665,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2727,
62,
16514,
27823,
62,
28665,
28,
30053,
62,
1177,
13,
15414,
13,
25598,
62,
16514,
27823,
62,
28665,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
16926,
46,
25,
6889,
2727,
5721,
11902,
290,
407,
1327,
40976,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2214,
62,
76,
5912,
28,
30053,
62,
1177,
13,
15414,
13,
3245,
62,
76,
5912,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12405,
28,
30053,
62,
1177,
13,
15414,
13,
22766,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3084,
62,
7266,
22766,
28,
30053,
62,
1177,
13,
15414,
13,
1136,
62,
11487,
62,
22766,
62,
8841,
22784,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
12405,
62,
22866,
13,
33295,
7,
22866,
8,
198,
220,
220,
220,
1441,
12405,
62,
22866,
628,
198,
4299,
1382,
62,
4122,
62,
259,
62,
2435,
62,
22766,
7,
198,
220,
220,
220,
3895,
62,
1177,
62,
22766,
62,
22866,
82,
25,
7343,
58,
38816,
7680,
20746,
21947,
4357,
198,
220,
220,
220,
949,
62,
16514,
27823,
25,
4818,
8079,
11,
198,
220,
220,
220,
3509,
62,
16514,
27823,
25,
4818,
8079,
11,
198,
220,
220,
220,
1364,
62,
11487,
62,
22766,
62,
8841,
25,
965,
11,
198,
2599,
198,
220,
220,
220,
37227,
15580,
966,
12,
259,
12,
2435,
12405,
1022,
1123,
3895,
1570,
3084,
290,
262,
9312,
1366,
14535,
37811,
198,
220,
220,
220,
11055,
796,
9344,
7,
29356,
28,
14881,
17401,
3419,
737,
6738,
62,
8841,
7,
198,
220,
220,
220,
220,
220,
220,
220,
2723,
28,
50,
2751,
2538,
62,
15112,
40086,
62,
28206,
62,
16402,
12394,
62,
1268,
62,
34694,
62,
45006,
1268,
198,
220,
220,
220,
1267,
628,
220,
220,
220,
1303,
3060,
3224,
7032,
284,
8633,
198,
220,
220,
220,
11055,
62,
22866,
796,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
366,
1084,
62,
16514,
27823,
1298,
949,
62,
16514,
27823,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
9806,
62,
16514,
27823,
1298,
3509,
62,
16514,
27823,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
9464,
62,
11487,
62,
22766,
62,
8841,
1298,
1364,
62,
11487,
62,
22766,
62,
8841,
11,
198,
220,
220,
220,
220,
220,
220,
220,
366,
30053,
33571,
1298,
685,
292,
11600,
7,
22866,
8,
329,
4732,
287,
3895,
62,
1177,
62,
22766,
62,
22866,
82,
4357,
198,
220,
220,
220,
1782,
628,
220,
220,
220,
12405,
796,
11055,
13,
13287,
7,
28243,
62,
22866,
8,
198,
220,
220,
220,
1441,
12405,
628,
198,
198,
4299,
651,
62,
2364,
1370,
62,
8095,
62,
1640,
62,
1186,
380,
18206,
7,
30053,
62,
33571,
25,
7343,
58,
38816,
7680,
4357,
8,
4613,
49749,
22658,
25,
198,
220,
220,
220,
37227,
47504,
543,
18043,
3650,
815,
307,
973,
329,
50122,
6754,
3033,
37811,
628,
220,
220,
220,
2723,
62,
19199,
796,
685,
4906,
7,
30053,
62,
1177,
13,
15414,
8,
329,
3895,
62,
1177,
287,
3895,
62,
33571,
60,
628,
220,
220,
220,
1303,
4990,
30227,
3033,
422,
2547,
21108,
28657,
22658,
198,
220,
220,
220,
611,
477,
7,
10459,
6624,
9220,
7416,
329,
2723,
287,
2723,
62,
19199,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
9220,
28657,
22658,
3419,
628,
220,
220,
220,
1303,
4990,
30227,
3033,
422,
4403,
20746,
28657,
22658,
198,
220,
220,
220,
611,
477,
7,
10459,
6624,
4403,
20746,
7416,
329,
2723,
287,
2723,
62,
19199,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
4403,
20746,
28657,
22658,
3419,
628,
220,
220,
220,
1303,
10347,
407,
3975,
17311,
284,
281,
49749,
22658,
7822,
198,
220,
220,
220,
5298,
1892,
3546,
1154,
12061,
12331,
7,
198,
220,
220,
220,
220,
220,
220,
220,
366,
3118,
15999,
6087,
286,
3895,
1570,
5128,
2723,
3858,
13,
4222,
4155,
326,
477,
2723,
3858,
389,
366,
198,
220,
220,
220,
220,
220,
220,
220,
366,
5936,
7609,
290,
1695,
287,
262,
976,
18043,
3650,
526,
198,
220,
220,
220,
1267,
628,
198,
4299,
4808,
1136,
62,
25927,
276,
62,
30053,
62,
33571,
62,
1462,
62,
40890,
62,
11600,
7,
198,
220,
220,
220,
3895,
62,
5420,
82,
25,
7343,
58,
2536,
4357,
3895,
62,
33571,
25,
7343,
58,
38816,
7680,
60,
198,
8,
4613,
360,
713,
58,
38816,
7680,
11,
7343,
58,
2536,
60,
5974,
198,
220,
220,
220,
37227,
16447,
257,
8633,
286,
27018,
7680,
4613,
7343,
58,
38816,
60,
329,
477,
9167,
3033,
37811,
628,
220,
220,
220,
3895,
62,
33571,
62,
1462,
62,
30053,
62,
8899,
796,
23884,
220,
1303,
2099,
25,
360,
713,
58,
38816,
7680,
11,
7343,
58,
2536,
11907,
198,
220,
220,
220,
329,
1006,
287,
3895,
62,
5420,
82,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1006,
62,
42632,
796,
1006,
13,
35312,
7,
2404,
8,
198,
220,
220,
220,
220,
220,
220,
220,
3895,
62,
1177,
62,
6738,
62,
5420,
796,
1006,
62,
42632,
58,
15,
60,
198,
220,
220,
220,
220,
220,
220,
220,
3895,
62,
6738,
62,
5420,
796,
1006,
62,
42632,
58,
16,
60,
198,
220,
220,
220,
220,
220,
220,
220,
1043,
796,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
329,
3895,
62,
1177,
62,
6738,
62,
2301,
4592,
287,
3895,
62,
33571,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
3895,
62,
1177,
62,
6738,
62,
2301,
4592,
13,
3672,
6624,
3895,
62,
1177,
62,
6738,
62,
5420,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1043,
796,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
3895,
62,
1177,
62,
6738,
62,
2301,
4592,
287,
3895,
62,
33571,
62,
1462,
62,
30053,
62,
8899,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3895,
62,
33571,
62,
1462,
62,
30053,
62,
8899,
58,
30053,
62,
1177,
62,
6738,
62,
2301,
4592,
4083,
33295,
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,
3895,
62,
6738,
62,
5420,
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,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3895,
62,
33571,
62,
1462,
62,
30053,
62,
8899,
58,
30053,
62,
1177,
62,
6738,
62,
2301,
4592,
60,
796,
685,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3895,
62,
6738,
62,
5420,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2361,
628,
220,
220,
220,
220,
220,
220,
220,
611,
407,
1043,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
11052,
12331,
7,
69,
1,
23722,
407,
1064,
3895,
1570,
422,
4941,
1391,
5420,
92,
4943,
198,
220,
220,
220,
1441,
3895,
62,
33571,
62,
1462,
62,
30053,
62,
8899,
628,
198,
2,
16926,
46,
25,
30011,
4582,
198,
2,
220,
220,
1635,
5765,
24700,
1137,
6158,
62,
52,
27586,
3419,
2427,
286,
371,
3913,
62,
41359,
13246,
22784,
393,
4654,
319,
9312,
15180,
3264,
198,
2,
220,
220,
1635,
3771,
5589,
1133,
371,
3913,
62,
41359,
13246,
3419,
523,
326,
340,
1595,
470,
423,
284,
307,
664,
296,
17128,
329,
790,
12405,
319,
9312,
62,
7890,
14535,
198,
2,
220,
220,
1635,
13610,
8584,
8893,
2427,
286,
5291,
477,
8893,
287,
4088,
198,
198,
50,
2751,
2538,
62,
15112,
40086,
62,
28206,
62,
16402,
12394,
62,
1268,
62,
34694,
62,
45006,
1268,
796,
37227,
198,
54,
10554,
9312,
62,
7890,
14535,
7054,
357,
198,
220,
220,
220,
33493,
371,
3913,
62,
41359,
13246,
3419,
28729,
3419,
7054,
5752,
62,
17618,
11,
1225,
69,
15885,
16034,
22935,
1364,
62,
11487,
62,
22766,
62,
8841,
34949,
355,
1225,
69,
198,
828,
198,
90,
4,
329,
3895,
1177,
287,
3895,
33571,
4064,
92,
198,
15211,
198,
770,
12405,
11055,
17706,
262,
966,
12,
259,
12,
2435,
29409,
4654,
329,
257,
2060,
3895,
900,
3084,
198,
284,
262,
2810,
9312,
3084,
13,
198,
352,
13,
1482,
9246,
268,
378,
262,
41033,
290,
12066,
422,
262,
3895,
900,
3084,
351,
262,
9312,
27039,
13,
198,
27018,
3815,
389,
5399,
284,
428,
3084,
1568,
329,
6596,
9332,
13,
198,
3895,
1177,
62,
16514,
27823,
318,
4961,
284,
9242,
287,
15274,
422,
262,
9312,
27039,
13,
198,
9466,
198,
27007,
3895,
1177,
13,
3672,
34949,
834,
24592,
62,
40890,
7054,
357,
198,
46506,
198,
220,
1377,
3748,
27421,
329,
1123,
5752,
287,
262,
9312,
27039,
13,
198,
220,
5752,
62,
17618,
11,
198,
220,
1377,
1785,
62,
16514,
27823,
4909,
262,
4628,
395,
9430,
284,
4654,
4291,
198,
220,
1785,
62,
16514,
27823,
11,
198,
220,
1377,
262,
3895,
62,
16514,
27823,
11,
1312,
13,
68,
13,
262,
3452,
19810,
286,
262,
9167,
3895,
3585,
284,
262,
9312,
62,
19608,
292,
316,
41033,
198,
220,
15697,
355,
22935,
3895,
1177,
13,
3672,
34949,
62,
30053,
62,
16514,
27823,
11,
198,
220,
1377,
2727,
41033,
286,
262,
3895,
379,
262,
11188,
3895,
62,
16514,
27823,
198,
220,
15697,
355,
2727,
62,
16514,
27823,
11,
198,
220,
1377,
2922,
691,
12066,
16686,
284,
428,
3895,
900,
198,
220,
22935,
3895,
1177,
13,
298,
871,
930,
4654,
7,
3256,
705,
38165,
5512,
198,
220,
1377,
25131,
329,
25431,
262,
27039,
1568,
198,
220,
2081,
7054,
318,
62,
26858,
62,
11487,
198,
10913,
2662,
9312,
62,
7890,
14535,
198,
4944,
2849,
11096,
198,
46506,
198,
220,
15697,
355,
5752,
62,
17618,
11,
198,
220,
22935,
3895,
1177,
13,
15596,
62,
16514,
27823,
62,
28665,
34949,
355,
1785,
62,
16514,
27823,
11,
198,
220,
22935,
3895,
1177,
13,
15596,
62,
16514,
27823,
62,
28665,
34949,
355,
22935,
3895,
1177,
13,
3672,
34949,
62,
30053,
62,
16514,
27823,
11,
198,
220,
22935,
3895,
1177,
13,
25598,
62,
16514,
27823,
62,
28665,
34949,
355,
2727,
62,
16514,
27823,
11,
198,
220,
22935,
3895,
1177,
13,
298,
871,
930,
4654,
7,
3256,
705,
38165,
5512,
198,
220,
3991,
7054,
318,
62,
26858,
62,
11487,
198,
10913,
2662,
22935,
3895,
1177,
13,
11487,
62,
7266,
22766,
34949,
33411,
22935,
3895,
1177,
13,
15596,
62,
16514,
27823,
62,
28665,
34949,
19841,
705,
27007,
3509,
62,
16514,
27823,
34949,
6,
198,
90,
4,
611,
3895,
1177,
13,
926,
75,
6624,
657,
4064,
18477,
4,
2073,
4064,
92,
6981,
22935,
3895,
1177,
13,
15596,
62,
16514,
27823,
62,
28665,
34949,
18189,
5045,
27823,
62,
7266,
7,
51,
3955,
6465,
23518,
705,
27007,
949,
62,
16514,
27823,
34949,
3256,
16654,
22935,
3895,
1177,
13,
926,
75,
34949,
1218,
19953,
4,
45762,
4064,
92,
198,
828,
198,
15211,
198,
362,
13,
26580,
262,
1366,
287,
262,
6441,
276,
27039,
11,
18398,
278,
416,
9312,
290,
16216,
416,
1785,
62,
16514,
27823,
11,
355,
198,
880,
355,
318,
62,
26858,
62,
11487,
13,
198,
12511,
1123,
4324,
11,
736,
12,
20797,
262,
3895,
62,
16514,
27823,
532,
355,
257,
1255,
286,
428,
11,
262,
9242,
3895,
62,
16514,
395,
9430,
198,
287,
262,
15274,
422,
262,
9312,
3084,
815,
783,
3994,
262,
3452,
4628,
395,
9430,
3585,
284,
262,
5752,
338,
198,
1785,
62,
16514,
27823,
13,
198,
1114,
15274,
810,
1785,
62,
16514,
27823,
7,
41279,
4818,
8079,
8,
532,
3895,
62,
16514,
27823,
1875,
3509,
2479,
11,
900,
262,
198,
3895,
62,
16514,
27823,
284,
9242,
13,
198,
9466,
198,
27007,
3895,
1177,
13,
3672,
34949,
834,
46416,
7054,
357,
198,
46506,
198,
220,
5752,
62,
17618,
11,
198,
220,
1785,
62,
16514,
27823,
11,
198,
220,
22935,
3895,
1177,
13,
298,
871,
930,
4654,
7,
3256,
705,
38165,
5512,
198,
220,
1391,
4,
329,
3895,
287,
3895,
1177,
13,
40890,
4064,
92,
198,
220,
16876,
7,
15596,
62,
16514,
27823,
18189,
22935,
3895,
1177,
13,
3672,
34949,
62,
30053,
62,
16514,
27823,
1391,
4,
611,
3895,
1177,
13,
926,
75,
6624,
657,
4064,
18477,
4,
2073,
4064,
92,
6981,
5045,
27823,
62,
7266,
7,
15596,
62,
16514,
27823,
11,
16654,
22935,
3895,
1177,
13,
926,
75,
34949,
1218,
8,
1279,
22935,
3895,
1177,
13,
3672,
34949,
62,
30053,
62,
16514,
27823,
90,
4,
45762,
4064,
5512,
22935,
3895,
1177,
13,
3672,
34949,
834,
27007,
3895,
1782,
5512,
15697,
8,
355,
22935,
3895,
1177,
13,
3672,
34949,
834,
27007,
3895,
1782,
18477,
4,
611,
9052,
13,
12957,
4064,
18477,
4,
2073,
4064,
5512,
1391,
4,
45762,
4064,
92,
198,
220,
1391,
4,
886,
1640,
4064,
92,
198,
10913,
2662,
357,
198,
46506,
198,
220,
5752,
62,
17618,
11,
198,
220,
1785,
62,
16514,
27823,
11,
198,
220,
22935,
3895,
1177,
13,
298,
871,
930,
4654,
7,
3256,
705,
38165,
5512,
198,
220,
31328,
62,
39488,
7,
25598,
62,
16514,
27823,
28730,
6965,
15697,
50,
8,
625,
266,
7054,
2727,
62,
16514,
27823,
11,
198,
220,
31328,
62,
39488,
15090,
90,
3895,
1177,
13,
3672,
34949,
62,
30053,
62,
16514,
27823,
28730,
6965,
15697,
50,
8,
625,
266,
7054,
22935,
3895,
1177,
13,
3672,
34949,
62,
30053,
62,
16514,
27823,
11,
198,
220,
318,
62,
26858,
62,
11487,
198,
10913,
2662,
22935,
3895,
1177,
13,
3672,
34949,
834,
24592,
62,
40890,
198,
28929,
3913,
266,
7054,
357,
30709,
17941,
11050,
22935,
3895,
1177,
13,
298,
871,
930,
4654,
7,
3256,
705,
8,
34949,
38678,
11050,
1785,
62,
16514,
27823,
22196,
34,
11,
318,
62,
26858,
62,
11487,
22196,
34,
11,
2727,
62,
16514,
27823,
22196,
34,
371,
22845,
38651,
8845,
1677,
327,
39237,
371,
3913,
5357,
4725,
33,
15919,
1961,
11895,
44765,
2751,
8,
198,
8,
198,
15211,
198,
513,
13,
9683,
691,
262,
15274,
422,
262,
9312,
3084,
11,
290,
4654,
262,
3033,
422,
262,
2656,
3895,
900,
3084,
198,
284,
262,
27039,
1262,
262,
9312,
3815,
11,
3895,
62,
16514,
27823,
11,
290,
2727,
62,
16514,
395,
9430,
13,
198,
9466,
198,
2538,
9792,
32357,
1268,
357,
198,
46506,
198,
220,
22935,
3895,
1177,
13,
15596,
62,
16514,
27823,
62,
28665,
34949,
355,
22935,
3895,
1177,
13,
3672,
34949,
62,
30053,
62,
16514,
27823,
11,
198,
220,
22935,
3895,
1177,
13,
25598,
62,
16514,
27823,
62,
28665,
34949,
355,
2727,
62,
16514,
27823,
11,
198,
220,
22935,
3895,
1177,
13,
298,
871,
930,
4654,
7,
3256,
705,
38165,
5512,
198,
220,
1391,
4,
329,
3895,
287,
3895,
1177,
13,
40890,
4064,
92,
198,
220,
22935,
3895,
34949,
355,
22935,
3895,
1177,
13,
3672,
34949,
834,
27007,
3895,
1782,
18477,
4,
611,
9052,
13,
12957,
4064,
18477,
4,
2073,
4064,
5512,
1391,
4,
45762,
4064,
92,
198,
220,
1391,
4,
886,
1640,
4064,
92,
198,
10913,
2662,
22935,
3895,
1177,
13,
11487,
62,
7266,
22766,
34949,
33411,
22935,
3895,
1177,
13,
15596,
62,
16514,
27823,
62,
28665,
34949,
19841,
705,
27007,
3509,
62,
16514,
27823,
34949,
6,
198,
90,
4,
611,
3895,
1177,
13,
926,
75,
6624,
657,
4064,
18477,
4,
2073,
4064,
92,
6981,
22935,
3895,
1177,
13,
15596,
62,
16514,
27823,
62,
28665,
34949,
18189,
5045,
27823,
62,
7266,
7,
51,
3955,
6465,
23518,
705,
27007,
949,
62,
16514,
27823,
34949,
3256,
16654,
22935,
3895,
1177,
13,
926,
75,
34949,
1218,
19953,
4,
45762,
4064,
92,
198,
8,
1294,
2751,
357,
27007,
3895,
1177,
13,
3672,
34949,
62,
30053,
62,
16514,
27823,
11,
2727,
62,
16514,
27823,
11,
22935,
3895,
1177,
13,
298,
871,
930,
4654,
7,
3256,
705,
8,
11709,
8,
198,
47357,
318,
62,
26858,
62,
11487,
198,
828,
198,
15211,
198,
604,
13,
9461,
11,
4648,
84,
489,
5344,
262,
15274,
416,
17246,
262,
717,
19810,
286,
1123,
9312,
3084,
5752,
62,
17618,
13,
198,
9466,
198,
27007,
3895,
1177,
13,
3672,
34949,
834,
9395,
929,
276,
7054,
357,
46506,
198,
220,
479,
15885,
198,
10913,
2662,
357,
198,
220,
33493,
5923,
30631,
62,
4760,
38,
7,
808,
27564,
2043,
352,
38381,
27977,
28480,
7,
15,
15437,
479,
198,
220,
16034,
22935,
3895,
1177,
13,
3672,
34949,
834,
46416,
5752,
198,
220,
44441,
11050,
5752,
62,
17618,
198,
4008,
90,
4,
611,
9052,
13,
12957,
4064,
18477,
4,
2073,
4064,
5512,
1391,
4,
45762,
4064,
92,
198,
198,
90,
4,
886,
1640,
4064,
92,
198,
15211,
198,
5302,
1040,
262,
23862,
286,
3294,
640,
3067,
15449,
284,
257,
2060,
3084,
13,
198,
9466,
198,
46506,
1225,
69,
13,
15596,
62,
16514,
27823,
355,
1785,
62,
16514,
27823,
11,
1635,
7788,
42006,
357,
808,
62,
17618,
11,
1785,
62,
16514,
27823,
8,
16034,
9312,
62,
7890,
14535,
1225,
69,
198,
90,
4,
329,
3895,
1177,
287,
3895,
33571,
4064,
92,
198,
2538,
9792,
32357,
1268,
357,
198,
220,
220,
220,
33493,
198,
220,
220,
220,
5752,
62,
17618,
11,
198,
220,
220,
220,
1391,
4,
329,
3895,
287,
3895,
1177,
13,
40890,
4064,
92,
198,
220,
220,
220,
22935,
3895,
1177,
13,
3672,
34949,
834,
27007,
3895,
1782,
18477,
4,
611,
9052,
13,
12957,
4064,
18477,
4,
2073,
4064,
5512,
1391,
4,
45762,
4064,
92,
198,
220,
220,
220,
1391,
4,
886,
1640,
4064,
92,
198,
220,
220,
220,
16034,
22935,
3895,
1177,
13,
3672,
34949,
834,
9395,
929,
276,
198,
8,
1294,
2751,
357,
808,
62,
17618,
8,
198,
90,
4,
886,
1640,
4064,
92,
198,
12532,
1137,
11050,
1785,
62,
16514,
27823,
198,
37811,
628
] | 2.941317 | 4,601 |
"""Reversi, by Al Sweigart [email protected]
A tile flipping game, also called reversi.
More info https://en.wikipedia.org/wiki/Reversi"""
__version__ = 1
# A version of this game is featured in the book, "Invent Your Own
# Computer Games with Python. https://nostarch.com/inventwithpython
import random, sys
COLS = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H']
ROWS = ['1', '2', '3', '4', '5', '6', '7', '8']
def getScoreOfBoard(board):
"""Returns a dictionary with keys 'X' and 'O', whose values."""
scores = {'X': 0, 'O': 0} # The scores start at 0.
# Loop over each space on the board:
for x in range(8):
for y in range(8):
# Increment the score if there is an X or O on this space:
if board[(x, y)] == 'X':
scores['X'] += 1
if board[(x, y)] == 'O':
scores['O'] += 1
return scores
def displayBoard(board):
"""Displays the board data structure passed to this function."""
print(' ABCDEFGH')
print(' +--------+')
for y in range(8):
print('{}|'.format((y + 1)), end='') # Display the row number.
for x in range(8):
print(board[(x, y)], end='') # Display the row.
print('|{}'.format((y + 1))) # Display the row number.
print(' +--------+')
print(' ABCDEFGH')
# Prints out the current score.
scores = getScoreOfBoard(board)
print('X has {} points. O has {} points.'.format(scores['X'], scores['O']))
def getNewBoard():
"""Return a board data structure with the starting tiles."""
board = {}
for x in range(8):
for y in range(8):
board[(x, y)] = ' '
# Place the two starting tiles for each player:
board[(3, 3)] = 'X'
board[(3, 4)] = 'O'
board[(4, 3)] = 'O'
board[(4, 4)] = 'X'
return board
def isValidMove(board, tile, xstart, ystart):
"""Returns False if the player's move on xstart, ystart is invalid.
If it is a valid move, returns a list of spaces that would become
the player's if they made a move here."""
if board[(xstart, ystart)] != ' ' or not isOnBoard(xstart, ystart):
return False
board[(xstart, ystart)] = tile # Set the tile on the board.
if tile == 'X':
otherTile = 'O'
else:
otherTile = 'X'
tilesToFlip = []
for xdirection, ydirection in [[0, 1], [1, 1], [1, 0], [1, -1], [0, -1], [-1, -1], [-1, 0], [-1, 1]]:
x, y = xstart, ystart
x += xdirection # First step in the x direction.
y += ydirection # First step in the y direction.
if isOnBoard(x, y) and board[(x, y)] == otherTile:
# Find if the other player's tile next to our tile.
x += xdirection
y += ydirection
if not isOnBoard(x, y):
continue
while board[(x, y)] == otherTile:
x += xdirection
y += ydirection
# Break out of while loop, then continue in for loop:
if not isOnBoard(x, y):
break
if not isOnBoard(x, y):
continue
if board[(x, y)] == tile:
# Found tiles to flip over. Go in reverse direction
# until we reach the original space, noting all the
# tiles along the way.
while True:
x -= xdirection
y -= ydirection
if x == xstart and y == ystart:
break
tilesToFlip.append([x, y])
board[(xstart, ystart)] = ' ' # Restore the original empty space.
# If no tiles were flipped, this is not a valid move:
if len(tilesToFlip) == 0:
return False
return tilesToFlip
def getBoardWithValidMoves(board, tile):
"""Returns a new board with . marking the possible moves."""
dupeBoard = getBoardCopy(board)
for x, y in getValidMoves(dupeBoard, tile):
dupeBoard[(x, y)] = '.'
return dupeBoard
def getValidMoves(board, tile):
"""Returns a list of [x, y] lists of valid moves for the given
player on the given board."""
validMoves = []
for x in range(8):
for y in range(8):
if isValidMove(board, tile, x, y) != False:
validMoves.append([x, y])
return validMoves
def enterPlayerTile():
"""Lets the player enter whether they want to be X or O. Returns a
list with the player's tile first, the computer's tile second."""
tile = ''
while not (tile == 'X' or tile == 'O'):
print('Do you want to be X or O?')
tile = input().upper()
# The first string is the player's tile:
if tile == 'X':
return ['X', 'O']
else:
return ['O', 'X']
def makeMove(board, tile, xstart, ystart):
"""Place a tile on the board, flipping any of the opponent's pieces.
Returns False for invalid moves, True for valid."""
tilesToFlip = isValidMove(board, tile, xstart, ystart)
if tilesToFlip == False:
return False
board[(xstart, ystart)] = tile
for x, y in tilesToFlip:
board[(x, y)] = tile
return True
def getBoardCopy(board):
"""Make a duplicate of the board list and return the duplicate."""
dupeBoard = {}
for x in range(8):
for y in range(8):
dupeBoard[(x, y)] = board[(x, y)]
return dupeBoard
def isOnCorner(x, y):
"""Returns True if the position is in one of the four corners."""
return (x == 0 and y == 0) or (x == 7 and y == 0) or (x == 0 and y == 7) or (x == 7 and y == 7)
def getPlayerMove(board, playerTile):
"""Let the player type in their move. Returns the move as [x, y]
(or returns the string 'QUIT')"""
while True:
print('Enter your move, or type quit to end the game.')
move = input().upper()
if move == 'QUIT':
return 'QUIT'
if len(move) == 2 and move[0] in COLS and move[1] in ROWS:
x = 'ABCDEFGH'.find(move[0])
y = int(move[1]) - 1
if isValidMove(board, playerTile, x, y) == False:
print('That is not a valid space to place a tile.')
continue
else:
break
else:
print('Type the column (A-H) and row (1-8).')
print('For example, H1 will be the top-right corner.')
return [x, y]
def getComputerMove(board, computerTile):
"""Given a board and the computer's tile, determine where to move
and return that move as a [x, y] list."""
possibleMoves = getValidMoves(board, computerTile)
# Randomize the order of the possible moves so that if there are
# multiple best scoring moves, a random one is selected.
random.shuffle(possibleMoves)
# Always go for a corner if available:
for x, y in possibleMoves:
if isOnCorner(x, y):
return [x, y]
# Go through all possible moves and remember the best scoring move:
bestScore = -1
for x, y in possibleMoves:
dupeBoard = getBoardCopy(board)
makeMove(dupeBoard, computerTile, x, y)
score = getScoreOfBoard(dupeBoard)[computerTile]
if score > bestScore:
bestMove = [x, y]
bestScore = score
return bestMove
if __name__ == '__main__':
main()
| [
37811,
3041,
690,
72,
11,
416,
978,
19372,
328,
433,
435,
31,
259,
1151,
4480,
29412,
13,
785,
198,
198,
32,
17763,
33097,
983,
11,
635,
1444,
10372,
72,
13,
198,
5167,
7508,
3740,
1378,
268,
13,
31266,
13,
2398,
14,
15466,
14,
3041,
690,
72,
37811,
198,
834,
9641,
834,
796,
352,
198,
198,
2,
317,
2196,
286,
428,
983,
318,
8096,
287,
262,
1492,
11,
366,
818,
1151,
3406,
11744,
198,
2,
13851,
5776,
351,
11361,
13,
3740,
1378,
77,
455,
998,
13,
785,
14,
259,
1151,
4480,
29412,
198,
198,
11748,
4738,
11,
25064,
198,
198,
25154,
50,
796,
37250,
32,
3256,
705,
33,
3256,
705,
34,
3256,
705,
35,
3256,
705,
36,
3256,
705,
37,
3256,
705,
38,
3256,
705,
39,
20520,
198,
49,
22845,
796,
37250,
16,
3256,
705,
17,
3256,
705,
18,
3256,
705,
19,
3256,
705,
20,
3256,
705,
21,
3256,
705,
22,
3256,
705,
23,
20520,
628,
198,
4299,
651,
26595,
5189,
29828,
7,
3526,
2599,
198,
220,
220,
220,
37227,
35561,
257,
22155,
351,
8251,
705,
55,
6,
290,
705,
46,
3256,
3025,
3815,
526,
15931,
198,
220,
220,
220,
8198,
796,
1391,
6,
55,
10354,
657,
11,
705,
46,
10354,
657,
92,
220,
1303,
383,
8198,
923,
379,
657,
13,
198,
220,
220,
220,
1303,
26304,
625,
1123,
2272,
319,
262,
3096,
25,
198,
220,
220,
220,
329,
2124,
287,
2837,
7,
23,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
329,
331,
287,
2837,
7,
23,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
10791,
434,
262,
4776,
611,
612,
318,
281,
1395,
393,
440,
319,
428,
2272,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
3096,
58,
7,
87,
11,
331,
15437,
6624,
705,
55,
10354,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8198,
17816,
55,
20520,
15853,
352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
3096,
58,
7,
87,
11,
331,
15437,
6624,
705,
46,
10354,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8198,
17816,
46,
20520,
15853,
352,
198,
220,
220,
220,
1441,
8198,
628,
198,
4299,
3359,
29828,
7,
3526,
2599,
198,
220,
220,
220,
37227,
7279,
26024,
262,
3096,
1366,
4645,
3804,
284,
428,
2163,
526,
15931,
628,
220,
220,
220,
3601,
10786,
220,
9738,
32988,
17511,
11537,
198,
220,
220,
220,
3601,
10786,
1343,
982,
10,
11537,
628,
220,
220,
220,
329,
331,
287,
2837,
7,
23,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
90,
92,
91,
4458,
18982,
19510,
88,
1343,
352,
36911,
886,
28,
7061,
8,
220,
1303,
16531,
262,
5752,
1271,
13,
198,
220,
220,
220,
220,
220,
220,
220,
329,
2124,
287,
2837,
7,
23,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
3526,
58,
7,
87,
11,
331,
8,
4357,
886,
28,
7061,
8,
220,
1303,
16531,
262,
5752,
13,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
91,
90,
92,
4458,
18982,
19510,
88,
1343,
352,
22305,
220,
1303,
16531,
262,
5752,
1271,
13,
628,
220,
220,
220,
3601,
10786,
1343,
982,
10,
11537,
198,
220,
220,
220,
3601,
10786,
220,
9738,
32988,
17511,
11537,
628,
220,
220,
220,
1303,
12578,
82,
503,
262,
1459,
4776,
13,
198,
220,
220,
220,
8198,
796,
651,
26595,
5189,
29828,
7,
3526,
8,
198,
220,
220,
220,
3601,
10786,
55,
468,
23884,
2173,
13,
440,
468,
23884,
2173,
2637,
13,
18982,
7,
1416,
2850,
17816,
55,
6,
4357,
8198,
17816,
46,
20520,
4008,
628,
198,
4299,
651,
3791,
29828,
33529,
198,
220,
220,
220,
37227,
13615,
257,
3096,
1366,
4645,
351,
262,
3599,
19867,
526,
15931,
198,
220,
220,
220,
3096,
796,
23884,
198,
220,
220,
220,
329,
2124,
287,
2837,
7,
23,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
329,
331,
287,
2837,
7,
23,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3096,
58,
7,
87,
11,
331,
15437,
796,
705,
705,
628,
220,
220,
220,
1303,
8474,
262,
734,
3599,
19867,
329,
1123,
2137,
25,
198,
220,
220,
220,
3096,
58,
7,
18,
11,
513,
15437,
796,
705,
55,
6,
198,
220,
220,
220,
3096,
58,
7,
18,
11,
604,
15437,
796,
705,
46,
6,
198,
220,
220,
220,
3096,
58,
7,
19,
11,
513,
15437,
796,
705,
46,
6,
198,
220,
220,
220,
3096,
58,
7,
19,
11,
604,
15437,
796,
705,
55,
6,
198,
220,
220,
220,
1441,
3096,
628,
198,
4299,
318,
47139,
21774,
7,
3526,
11,
17763,
11,
2124,
9688,
11,
331,
9688,
2599,
198,
220,
220,
220,
37227,
35561,
10352,
611,
262,
2137,
338,
1445,
319,
2124,
9688,
11,
331,
9688,
318,
12515,
13,
198,
220,
220,
220,
1002,
340,
318,
257,
4938,
1445,
11,
5860,
257,
1351,
286,
9029,
326,
561,
1716,
198,
220,
220,
220,
262,
2137,
338,
611,
484,
925,
257,
1445,
994,
526,
15931,
198,
220,
220,
220,
611,
3096,
58,
7,
87,
9688,
11,
331,
9688,
15437,
14512,
705,
705,
393,
407,
318,
2202,
29828,
7,
87,
9688,
11,
331,
9688,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
628,
220,
220,
220,
3096,
58,
7,
87,
9688,
11,
331,
9688,
15437,
796,
17763,
220,
1303,
5345,
262,
17763,
319,
262,
3096,
13,
628,
220,
220,
220,
611,
17763,
6624,
705,
55,
10354,
198,
220,
220,
220,
220,
220,
220,
220,
584,
35103,
796,
705,
46,
6,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
584,
35103,
796,
705,
55,
6,
628,
220,
220,
220,
19867,
2514,
7414,
541,
796,
17635,
198,
220,
220,
220,
329,
2124,
37295,
11,
331,
37295,
287,
16410,
15,
11,
352,
4357,
685,
16,
11,
352,
4357,
685,
16,
11,
657,
4357,
685,
16,
11,
532,
16,
4357,
685,
15,
11,
532,
16,
4357,
25915,
16,
11,
532,
16,
4357,
25915,
16,
11,
657,
4357,
25915,
16,
11,
352,
60,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
2124,
11,
331,
796,
2124,
9688,
11,
331,
9688,
198,
220,
220,
220,
220,
220,
220,
220,
2124,
15853,
2124,
37295,
220,
1303,
3274,
2239,
287,
262,
2124,
4571,
13,
198,
220,
220,
220,
220,
220,
220,
220,
331,
15853,
331,
37295,
220,
1303,
3274,
2239,
287,
262,
331,
4571,
13,
198,
220,
220,
220,
220,
220,
220,
220,
611,
318,
2202,
29828,
7,
87,
11,
331,
8,
290,
3096,
58,
7,
87,
11,
331,
15437,
6624,
584,
35103,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
9938,
611,
262,
584,
2137,
338,
17763,
1306,
284,
674,
17763,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
15853,
2124,
37295,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
331,
15853,
331,
37295,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
407,
318,
2202,
29828,
7,
87,
11,
331,
2599,
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,
981,
3096,
58,
7,
87,
11,
331,
15437,
6624,
584,
35103,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
15853,
2124,
37295,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
331,
15853,
331,
37295,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
12243,
503,
286,
981,
9052,
11,
788,
2555,
287,
329,
9052,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
407,
318,
2202,
29828,
7,
87,
11,
331,
2599,
198,
220,
220,
220,
220,
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,
611,
407,
318,
2202,
29828,
7,
87,
11,
331,
2599,
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,
3096,
58,
7,
87,
11,
331,
15437,
6624,
17763,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
4062,
19867,
284,
14283,
625,
13,
1514,
287,
9575,
4571,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
1566,
356,
3151,
262,
2656,
2272,
11,
10820,
477,
262,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
19867,
1863,
262,
835,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
981,
6407,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
48185,
2124,
37295,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
331,
48185,
331,
37295,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2124,
6624,
2124,
9688,
290,
331,
6624,
331,
9688,
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,
2270,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
19867,
2514,
7414,
541,
13,
33295,
26933,
87,
11,
331,
12962,
628,
220,
220,
220,
3096,
58,
7,
87,
9688,
11,
331,
9688,
15437,
796,
705,
705,
220,
1303,
42019,
262,
2656,
6565,
2272,
13,
198,
220,
220,
220,
1303,
1002,
645,
19867,
547,
26157,
11,
428,
318,
407,
257,
4938,
1445,
25,
198,
220,
220,
220,
611,
18896,
7,
83,
2915,
2514,
7414,
541,
8,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
198,
220,
220,
220,
1441,
19867,
2514,
7414,
541,
628,
198,
198,
4299,
651,
29828,
3152,
47139,
44,
5241,
7,
3526,
11,
17763,
2599,
198,
220,
220,
220,
37227,
35561,
257,
649,
3096,
351,
764,
18730,
262,
1744,
6100,
526,
15931,
198,
220,
220,
220,
7043,
431,
29828,
796,
651,
29828,
29881,
7,
3526,
8,
628,
220,
220,
220,
329,
2124,
11,
331,
287,
651,
47139,
44,
5241,
7,
646,
431,
29828,
11,
17763,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
7043,
431,
29828,
58,
7,
87,
11,
331,
15437,
796,
705,
2637,
198,
220,
220,
220,
1441,
7043,
431,
29828,
628,
198,
4299,
651,
47139,
44,
5241,
7,
3526,
11,
17763,
2599,
198,
220,
220,
220,
37227,
35561,
257,
1351,
286,
685,
87,
11,
331,
60,
8341,
286,
4938,
6100,
329,
262,
1813,
198,
220,
220,
220,
2137,
319,
262,
1813,
3096,
526,
15931,
198,
220,
220,
220,
4938,
44,
5241,
796,
17635,
628,
220,
220,
220,
329,
2124,
287,
2837,
7,
23,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
329,
331,
287,
2837,
7,
23,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
318,
47139,
21774,
7,
3526,
11,
17763,
11,
2124,
11,
331,
8,
14512,
10352,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4938,
44,
5241,
13,
33295,
26933,
87,
11,
331,
12962,
198,
220,
220,
220,
1441,
4938,
44,
5241,
628,
198,
4299,
3802,
14140,
35103,
33529,
198,
220,
220,
220,
37227,
43,
1039,
262,
2137,
3802,
1771,
484,
765,
284,
307,
1395,
393,
440,
13,
16409,
257,
198,
220,
220,
220,
1351,
351,
262,
2137,
338,
17763,
717,
11,
262,
3644,
338,
17763,
1218,
526,
15931,
198,
220,
220,
220,
17763,
796,
10148,
198,
220,
220,
220,
981,
407,
357,
40927,
6624,
705,
55,
6,
393,
17763,
6624,
705,
46,
6,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
5211,
345,
765,
284,
307,
1395,
393,
440,
8348,
8,
198,
220,
220,
220,
220,
220,
220,
220,
17763,
796,
5128,
22446,
45828,
3419,
628,
220,
220,
220,
1303,
383,
717,
4731,
318,
262,
2137,
338,
17763,
25,
198,
220,
220,
220,
611,
17763,
6624,
705,
55,
10354,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
37250,
55,
3256,
705,
46,
20520,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
37250,
46,
3256,
705,
55,
20520,
628,
198,
4299,
787,
21774,
7,
3526,
11,
17763,
11,
2124,
9688,
11,
331,
9688,
2599,
198,
220,
220,
220,
37227,
27271,
257,
17763,
319,
262,
3096,
11,
33097,
597,
286,
262,
6125,
338,
5207,
13,
198,
220,
220,
220,
16409,
10352,
329,
12515,
6100,
11,
6407,
329,
4938,
526,
15931,
198,
220,
220,
220,
19867,
2514,
7414,
541,
796,
318,
47139,
21774,
7,
3526,
11,
17763,
11,
2124,
9688,
11,
331,
9688,
8,
628,
220,
220,
220,
611,
19867,
2514,
7414,
541,
6624,
10352,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
628,
220,
220,
220,
3096,
58,
7,
87,
9688,
11,
331,
9688,
15437,
796,
17763,
198,
220,
220,
220,
329,
2124,
11,
331,
287,
19867,
2514,
7414,
541,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3096,
58,
7,
87,
11,
331,
15437,
796,
17763,
198,
220,
220,
220,
1441,
6407,
628,
198,
4299,
651,
29828,
29881,
7,
3526,
2599,
198,
220,
220,
220,
37227,
12050,
257,
23418,
286,
262,
3096,
1351,
290,
1441,
262,
23418,
526,
15931,
198,
220,
220,
220,
7043,
431,
29828,
796,
23884,
628,
220,
220,
220,
329,
2124,
287,
2837,
7,
23,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
329,
331,
287,
2837,
7,
23,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7043,
431,
29828,
58,
7,
87,
11,
331,
15437,
796,
3096,
58,
7,
87,
11,
331,
15437,
628,
220,
220,
220,
1441,
7043,
431,
29828,
628,
198,
4299,
318,
2202,
10606,
1008,
7,
87,
11,
331,
2599,
198,
220,
220,
220,
37227,
35561,
6407,
611,
262,
2292,
318,
287,
530,
286,
262,
1440,
14371,
526,
15931,
198,
220,
220,
220,
1441,
357,
87,
6624,
657,
290,
331,
6624,
657,
8,
393,
357,
87,
6624,
767,
290,
331,
6624,
657,
8,
393,
357,
87,
6624,
657,
290,
331,
6624,
767,
8,
393,
357,
87,
6624,
767,
290,
331,
6624,
767,
8,
628,
198,
4299,
651,
14140,
21774,
7,
3526,
11,
2137,
35103,
2599,
198,
220,
220,
220,
37227,
5756,
262,
2137,
2099,
287,
511,
1445,
13,
16409,
262,
1445,
355,
685,
87,
11,
331,
60,
198,
220,
220,
220,
357,
273,
5860,
262,
4731,
705,
10917,
2043,
11537,
37811,
198,
220,
220,
220,
981,
6407,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
17469,
534,
1445,
11,
393,
2099,
11238,
284,
886,
262,
983,
2637,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1445,
796,
5128,
22446,
45828,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
611,
1445,
6624,
705,
10917,
2043,
10354,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
705,
10917,
2043,
6,
628,
220,
220,
220,
220,
220,
220,
220,
611,
18896,
7,
21084,
8,
6624,
362,
290,
1445,
58,
15,
60,
287,
20444,
50,
290,
1445,
58,
16,
60,
287,
371,
22845,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
796,
705,
24694,
32988,
17511,
4458,
19796,
7,
21084,
58,
15,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
331,
796,
493,
7,
21084,
58,
16,
12962,
532,
352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
318,
47139,
21774,
7,
3526,
11,
2137,
35103,
11,
2124,
11,
331,
8,
6624,
10352,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
2504,
318,
407,
257,
4938,
2272,
284,
1295,
257,
17763,
2637,
8,
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,
2073,
25,
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,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
6030,
262,
5721,
357,
32,
12,
39,
8,
290,
5752,
357,
16,
12,
23,
737,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
1890,
1672,
11,
367,
16,
481,
307,
262,
1353,
12,
3506,
5228,
2637,
8,
628,
220,
220,
220,
1441,
685,
87,
11,
331,
60,
628,
198,
4299,
651,
34556,
21774,
7,
3526,
11,
3644,
35103,
2599,
198,
220,
220,
220,
37227,
15056,
257,
3096,
290,
262,
3644,
338,
17763,
11,
5004,
810,
284,
1445,
198,
220,
220,
220,
290,
1441,
326,
1445,
355,
257,
685,
87,
11,
331,
60,
1351,
526,
15931,
198,
220,
220,
220,
1744,
44,
5241,
796,
651,
47139,
44,
5241,
7,
3526,
11,
3644,
35103,
8,
628,
220,
220,
220,
1303,
14534,
1096,
262,
1502,
286,
262,
1744,
6100,
523,
326,
611,
612,
389,
198,
220,
220,
220,
1303,
3294,
1266,
9689,
6100,
11,
257,
4738,
530,
318,
6163,
13,
198,
220,
220,
220,
4738,
13,
1477,
18137,
7,
79,
4733,
44,
5241,
8,
628,
220,
220,
220,
1303,
16622,
467,
329,
257,
5228,
611,
1695,
25,
198,
220,
220,
220,
329,
2124,
11,
331,
287,
1744,
44,
5241,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
318,
2202,
10606,
1008,
7,
87,
11,
331,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
685,
87,
11,
331,
60,
628,
220,
220,
220,
1303,
1514,
832,
477,
1744,
6100,
290,
3505,
262,
1266,
9689,
1445,
25,
198,
220,
220,
220,
1266,
26595,
796,
532,
16,
198,
220,
220,
220,
329,
2124,
11,
331,
287,
1744,
44,
5241,
25,
198,
220,
220,
220,
220,
220,
220,
220,
7043,
431,
29828,
796,
651,
29828,
29881,
7,
3526,
8,
198,
220,
220,
220,
220,
220,
220,
220,
787,
21774,
7,
646,
431,
29828,
11,
3644,
35103,
11,
2124,
11,
331,
8,
198,
220,
220,
220,
220,
220,
220,
220,
4776,
796,
651,
26595,
5189,
29828,
7,
646,
431,
29828,
38381,
33215,
35103,
60,
198,
220,
220,
220,
220,
220,
220,
220,
611,
4776,
1875,
1266,
26595,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1266,
21774,
796,
685,
87,
11,
331,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1266,
26595,
796,
4776,
198,
220,
220,
220,
1441,
1266,
21774,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1388,
3419,
198
] | 2.310649 | 3,174 |
import pandas as pd
import numpy as np
import os
from configs import general_config
from data_helpers.utils import readNewFile,loadDict
import logging
import tensorflow as tf
"""
将单词列表形式的句子转为句子列表形式的文档,
以"."、"?"、"!"为句子分隔符。
"""
| [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
6738,
4566,
82,
1330,
2276,
62,
11250,
198,
6738,
1366,
62,
16794,
364,
13,
26791,
1330,
1100,
3791,
8979,
11,
2220,
35,
713,
198,
11748,
18931,
198,
11748,
11192,
273,
11125,
355,
48700,
628,
628,
628,
198,
37811,
198,
49546,
39355,
243,
46237,
235,
26344,
245,
26193,
101,
37605,
95,
28156,
237,
21410,
20998,
98,
36310,
164,
121,
105,
10310,
118,
20998,
98,
36310,
26344,
245,
26193,
101,
37605,
95,
28156,
237,
21410,
23877,
229,
162,
94,
96,
171,
120,
234,
198,
20015,
98,
1,
526,
23513,
1,
1701,
23513,
1,
2474,
10310,
118,
20998,
98,
36310,
26344,
228,
49694,
242,
163,
105,
99,
16764,
198,
37811,
628
] | 1.879032 | 124 |
import numpy as np
import pandas as pd
from apyori import apriori
# Loading the Data
data = pd.read_excel('Online_Retail.xlsx')
data.head()
# Exploring the columns of the data
data.columns
# Exploring the different regions of transactions
data.Country.unique()
# Stripping extra spaces in the description
data['Description'] = data['Description'].str.strip()
# Dropping the rows without any invoice number
data.dropna(axis = 0, subset =['InvoiceNo'], inplace = True)
data['InvoiceNo'] = data['InvoiceNo'].astype('str')
# Dropping all transactions which were done on credit
data = data[~data['InvoiceNo'].str.contains('C')]
# Transactions done in France
basket_France = (data[data['Country'] =="France"]
.groupby(['InvoiceNo', 'Description'])['Quantity']
.sum().unstack().reset_index().fillna(0)
.set_index('InvoiceNo'))
# Transactions done in the United Kingdom
basket_UK = (data[data['Country'] =="United Kingdom"]
.groupby(['InvoiceNo', 'Description'])['Quantity']
.sum().unstack().reset_index().fillna(0)
.set_index('InvoiceNo'))
# Transactions done in Portugal
basket_Por = (data[data['Country'] =="Portugal"]
.groupby(['InvoiceNo', 'Description'])['Quantity']
.sum().unstack().reset_index().fillna(0)
.set_index('InvoiceNo'))
basket_Sweden = (data[data['Country'] =="Sweden"]
.groupby(['InvoiceNo', 'Description'])['Quantity']
.sum().unstack().reset_index().fillna(0)
.set_index('InvoiceNo'))
# Defining the hot encoding function to make the data suitable
# for the concerned libraries
# Encoding the datasets
basket_encoded = basket_France.applymap(hot_encode)
basket_France = basket_encoded
basket_encoded = basket_UK.applymap(hot_encode)
basket_UK = basket_encoded
basket_encoded = basket_Por.applymap(hot_encode)
basket_Por = basket_encoded
basket_encoded = basket_Sweden.applymap(hot_encode)
basket_Sweden = basket_encoded
# Building the model
frq_items = apriori(basket_France, min_support = 0.05, use_colnames = True)
#results = list(frq_items)
#results
frq_items2 = apriori(basket_UK, min_support = 0.05, use_colnames = True)
#results2 = list(frq_items2)
#results2
frq_items3 = apriori(basket_Por, min_support = 0.05, use_colnames = True)
#results3 = list(frq_items3)
#results3
frq_items4 = apriori(basket_Sweden, min_support = 0.05, use_colnames = True)
#results4 = list(frq_items4)
#results4
| [
11748,
299,
32152,
355,
45941,
220,
198,
11748,
19798,
292,
355,
279,
67,
220,
198,
6738,
2471,
88,
10145,
1330,
2471,
7701,
72,
628,
628,
198,
2,
12320,
262,
6060,
220,
198,
7890,
796,
279,
67,
13,
961,
62,
1069,
5276,
10786,
14439,
62,
9781,
603,
13,
87,
7278,
87,
11537,
220,
198,
7890,
13,
2256,
3419,
220,
628,
198,
2,
5905,
3255,
262,
15180,
286,
262,
1366,
220,
198,
7890,
13,
28665,
82,
220,
198,
198,
2,
5905,
3255,
262,
1180,
7652,
286,
8945,
220,
198,
7890,
13,
33921,
13,
34642,
3419,
220,
198,
198,
2,
26137,
2105,
3131,
9029,
287,
262,
6764,
220,
198,
7890,
17816,
11828,
20520,
796,
1366,
17816,
11828,
6,
4083,
2536,
13,
36311,
3419,
220,
198,
198,
2,
21045,
2105,
262,
15274,
1231,
597,
45458,
1271,
220,
198,
7890,
13,
14781,
2616,
7,
22704,
796,
657,
11,
24637,
796,
17816,
19904,
2942,
2949,
6,
4357,
287,
5372,
796,
6407,
8,
220,
198,
7890,
17816,
19904,
2942,
2949,
20520,
796,
1366,
17816,
19904,
2942,
2949,
6,
4083,
459,
2981,
10786,
2536,
11537,
220,
198,
198,
2,
21045,
2105,
477,
8945,
543,
547,
1760,
319,
3884,
220,
198,
7890,
796,
1366,
58,
93,
7890,
17816,
19904,
2942,
2949,
6,
4083,
2536,
13,
3642,
1299,
10786,
34,
11537,
60,
220,
198,
198,
2,
46192,
1760,
287,
4881,
220,
198,
65,
11715,
62,
28572,
796,
357,
7890,
58,
7890,
17816,
33921,
20520,
796,
2625,
28572,
8973,
220,
198,
197,
197,
13,
8094,
1525,
7,
17816,
19904,
2942,
2949,
3256,
705,
11828,
6,
12962,
17816,
31208,
20520,
220,
198,
197,
197,
13,
16345,
22446,
403,
25558,
22446,
42503,
62,
9630,
22446,
20797,
2616,
7,
15,
8,
220,
198,
197,
197,
13,
2617,
62,
9630,
10786,
19904,
2942,
2949,
6,
4008,
220,
198,
198,
2,
46192,
1760,
287,
262,
1578,
7526,
220,
198,
65,
11715,
62,
15039,
796,
357,
7890,
58,
7890,
17816,
33921,
20520,
796,
2625,
17013,
7526,
8973,
220,
198,
197,
197,
13,
8094,
1525,
7,
17816,
19904,
2942,
2949,
3256,
705,
11828,
6,
12962,
17816,
31208,
20520,
220,
198,
197,
197,
13,
16345,
22446,
403,
25558,
22446,
42503,
62,
9630,
22446,
20797,
2616,
7,
15,
8,
220,
198,
197,
197,
13,
2617,
62,
9630,
10786,
19904,
2942,
2949,
6,
4008,
220,
198,
198,
2,
46192,
1760,
287,
19101,
220,
198,
65,
11715,
62,
47,
273,
796,
357,
7890,
58,
7890,
17816,
33921,
20520,
796,
2625,
13924,
43778,
8973,
220,
198,
197,
197,
13,
8094,
1525,
7,
17816,
19904,
2942,
2949,
3256,
705,
11828,
6,
12962,
17816,
31208,
20520,
220,
198,
197,
197,
13,
16345,
22446,
403,
25558,
22446,
42503,
62,
9630,
22446,
20797,
2616,
7,
15,
8,
220,
198,
197,
197,
13,
2617,
62,
9630,
10786,
19904,
2942,
2949,
6,
4008,
220,
198,
198,
65,
11715,
62,
10462,
31829,
796,
357,
7890,
58,
7890,
17816,
33921,
20520,
796,
2625,
10462,
31829,
8973,
220,
198,
197,
197,
13,
8094,
1525,
7,
17816,
19904,
2942,
2949,
3256,
705,
11828,
6,
12962,
17816,
31208,
20520,
220,
198,
197,
197,
13,
16345,
22446,
403,
25558,
22446,
42503,
62,
9630,
22446,
20797,
2616,
7,
15,
8,
220,
198,
197,
197,
13,
2617,
62,
9630,
10786,
19904,
2942,
2949,
6,
4008,
220,
198,
198,
2,
2896,
3191,
262,
3024,
21004,
2163,
284,
787,
262,
1366,
11080,
220,
198,
2,
329,
262,
5213,
12782,
220,
198,
198,
2,
14711,
7656,
262,
40522,
220,
198,
65,
11715,
62,
12685,
9043,
796,
7988,
62,
28572,
13,
39014,
8899,
7,
8940,
62,
268,
8189,
8,
220,
198,
65,
11715,
62,
28572,
796,
7988,
62,
12685,
9043,
220,
198,
198,
65,
11715,
62,
12685,
9043,
796,
7988,
62,
15039,
13,
39014,
8899,
7,
8940,
62,
268,
8189,
8,
220,
198,
65,
11715,
62,
15039,
796,
7988,
62,
12685,
9043,
220,
198,
198,
65,
11715,
62,
12685,
9043,
796,
7988,
62,
47,
273,
13,
39014,
8899,
7,
8940,
62,
268,
8189,
8,
220,
198,
65,
11715,
62,
47,
273,
796,
7988,
62,
12685,
9043,
220,
198,
198,
65,
11715,
62,
12685,
9043,
796,
7988,
62,
10462,
31829,
13,
39014,
8899,
7,
8940,
62,
268,
8189,
8,
220,
198,
65,
11715,
62,
10462,
31829,
796,
7988,
62,
12685,
9043,
220,
198,
198,
2,
11819,
262,
2746,
220,
198,
8310,
80,
62,
23814,
796,
2471,
7701,
72,
7,
65,
11715,
62,
28572,
11,
949,
62,
11284,
796,
657,
13,
2713,
11,
779,
62,
4033,
14933,
796,
6407,
8,
220,
198,
198,
2,
43420,
796,
1351,
7,
8310,
80,
62,
23814,
8,
198,
2,
43420,
628,
198,
8310,
80,
62,
23814,
17,
796,
2471,
7701,
72,
7,
65,
11715,
62,
15039,
11,
949,
62,
11284,
796,
657,
13,
2713,
11,
779,
62,
4033,
14933,
796,
6407,
8,
220,
198,
198,
2,
43420,
17,
796,
1351,
7,
8310,
80,
62,
23814,
17,
8,
198,
2,
43420,
17,
198,
198,
8310,
80,
62,
23814,
18,
796,
2471,
7701,
72,
7,
65,
11715,
62,
47,
273,
11,
949,
62,
11284,
796,
657,
13,
2713,
11,
779,
62,
4033,
14933,
796,
6407,
8,
220,
198,
2,
43420,
18,
796,
1351,
7,
8310,
80,
62,
23814,
18,
8,
198,
2,
43420,
18,
628,
198,
8310,
80,
62,
23814,
19,
796,
2471,
7701,
72,
7,
65,
11715,
62,
10462,
31829,
11,
949,
62,
11284,
796,
657,
13,
2713,
11,
779,
62,
4033,
14933,
796,
6407,
8,
220,
198,
2,
43420,
19,
796,
1351,
7,
8310,
80,
62,
23814,
19,
8,
198,
2,
43420,
19,
628,
628
] | 2.685969 | 898 |
from prediction.endpoints import worker_microsoft as endpoints
from prediction import request_utils | [
6738,
17724,
13,
437,
13033,
1330,
8383,
62,
40485,
355,
886,
13033,
198,
6738,
17724,
1330,
2581,
62,
26791
] | 5.210526 | 19 |
# Copyright 2020-present NAVER Corp. Under BSD 3-clause license
"""
Evaluation with kapture objects
"""
import math
from typing import Union, List, Tuple, Set
from statistics import mean, median
import kapture
from kapture.algo.pose_operations import world_pose_transform_distance
def evaluate_error_absolute(poses_to_test: List[Tuple[str, kapture.PoseTransform]],
poses_ground_truth: List[Tuple[str, kapture.PoseTransform]]
) -> List[Tuple[str, float, float]]:
"""
Evaluate the absolute error for poses to a ground truth.
:param poses_to_test: poses to test
:param poses_ground_truth: reference poses
:return: list of error evaluation
"""
poses_ground_truth_as_dict = {name: pose for name, pose in poses_ground_truth}
result = [(name,) + world_pose_transform_distance(pose, poses_ground_truth_as_dict[name])
for (name, pose) in poses_to_test]
return result
def get_poses(k_data: kapture.Kapture,
image_set: Union[Set[str], List[str]]) -> List[Tuple[str, kapture.PoseTransform]]:
"""
Computes the poses for a set of images within a kapture.
:param k_data: the kapture
:param image_set: set of image names
:return: list of (image name,pose)
"""
assert k_data.trajectories is not None
if isinstance(image_set, list):
image_set = set(image_set)
assert isinstance(image_set, set)
assert isinstance(k_data, kapture.Kapture)
# apply rigs to trajectories
if k_data.rigs is not None:
trajectories = kapture.rigs_remove(k_data.trajectories, k_data.rigs)
else:
trajectories = k_data.trajectories
poses = []
for timestamp, device_id, filename in kapture.flatten(k_data.records_camera, is_sorted=True):
if filename in image_set and (timestamp, device_id) in trajectories:
pose = trajectories[(timestamp, device_id)]
poses.append((filename, pose))
return poses
def evaluate(k_data: kapture.Kapture,
k_data_gt: kapture.Kapture,
image_set: Union[Set[str], List[str]]) -> List[Tuple[str, float, float]]:
"""
Evaluate the pose found for images in a kapture with a reference kapture.
:param k_data: the kapture to test
:param k_data_gt: the reference kapture
:param image_set: list of image names
:return: list of image pose evaluation
"""
if isinstance(image_set, list):
image_set = set(image_set)
assert isinstance(image_set, set)
assert(len(image_set) > 0)
assert isinstance(k_data, kapture.Kapture)
assert isinstance(k_data_gt, kapture.Kapture)
poses_to_test = get_poses(k_data, image_set)
poses_gt = get_poses(k_data_gt, image_set)
evaluated = evaluate_error_absolute(poses_to_test, poses_gt)
localized_images = {name for name, position_error, rotation_error in evaluated}
missing_images = [name for name in image_set if name not in localized_images]
for name in missing_images:
evaluated.append((name, math.nan, math.nan))
return sorted(evaluated)
def fill_bins(results: List[Tuple[str, float, float]],
bins: List[Tuple[float, float]]
) -> List[Tuple[float, float, int]]:
"""
Fill a bin with the number of images within position thresholds.
:param results: list of error evaluation (image name, translation error, rotation error)
:param bins: list of translation and rotation thresholds
:return: number of images in every pair of (translation,rotation) error
"""
assert isinstance(results, list)
assert isinstance(bins, list)
all_positions = [(translation_error, rotation_error) for name, translation_error, rotation_error in results]
filled_bins = []
for a_bin in bins:
trans_threshold = a_bin[0]
rot_threshold = a_bin[1]
number_of_images_in_bin = 0
for translation_error, rotation_error in all_positions:
if (math.isnan(rot_threshold) or rot_threshold < 0) and translation_error <= trans_threshold:
number_of_images_in_bin += 1
elif translation_error <= trans_threshold and rotation_error <= rot_threshold:
number_of_images_in_bin += 1
filled_bins.append((trans_threshold, rot_threshold, number_of_images_in_bin))
return filled_bins
| [
2,
15069,
12131,
12,
25579,
11746,
5959,
11421,
13,
4698,
347,
10305,
513,
12,
565,
682,
5964,
198,
198,
37811,
198,
36,
2100,
2288,
351,
479,
2373,
495,
5563,
198,
37811,
198,
198,
11748,
10688,
198,
6738,
19720,
1330,
4479,
11,
7343,
11,
309,
29291,
11,
5345,
198,
6738,
7869,
1330,
1612,
11,
14288,
198,
198,
11748,
479,
2373,
495,
198,
6738,
479,
2373,
495,
13,
282,
2188,
13,
3455,
62,
3575,
602,
1330,
995,
62,
3455,
62,
35636,
62,
30246,
628,
198,
4299,
13446,
62,
18224,
62,
48546,
7,
4832,
62,
1462,
62,
9288,
25,
7343,
58,
51,
29291,
58,
2536,
11,
479,
2373,
495,
13,
47,
577,
41762,
60,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17313,
62,
2833,
62,
35310,
25,
7343,
58,
51,
29291,
58,
2536,
11,
479,
2373,
495,
13,
47,
577,
41762,
11907,
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,
1267,
4613,
7343,
58,
51,
29291,
58,
2536,
11,
12178,
11,
12178,
60,
5974,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
26439,
4985,
262,
4112,
4049,
329,
17313,
284,
257,
2323,
3872,
13,
628,
220,
220,
220,
1058,
17143,
17313,
62,
1462,
62,
9288,
25,
17313,
284,
1332,
198,
220,
220,
220,
1058,
17143,
17313,
62,
2833,
62,
35310,
25,
4941,
17313,
198,
220,
220,
220,
1058,
7783,
25,
1351,
286,
4049,
12660,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
17313,
62,
2833,
62,
35310,
62,
292,
62,
11600,
796,
1391,
3672,
25,
12705,
329,
1438,
11,
12705,
287,
17313,
62,
2833,
62,
35310,
92,
198,
220,
220,
220,
1255,
796,
47527,
3672,
35751,
1343,
995,
62,
3455,
62,
35636,
62,
30246,
7,
3455,
11,
17313,
62,
2833,
62,
35310,
62,
292,
62,
11600,
58,
3672,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
357,
3672,
11,
12705,
8,
287,
17313,
62,
1462,
62,
9288,
60,
198,
220,
220,
220,
1441,
1255,
628,
198,
4299,
651,
62,
4832,
7,
74,
62,
7890,
25,
479,
2373,
495,
13,
42,
2373,
495,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2939,
62,
2617,
25,
4479,
58,
7248,
58,
2536,
4357,
7343,
58,
2536,
11907,
8,
4613,
7343,
58,
51,
29291,
58,
2536,
11,
479,
2373,
495,
13,
47,
577,
41762,
60,
5974,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
3082,
1769,
262,
17313,
329,
257,
900,
286,
4263,
1626,
257,
479,
2373,
495,
13,
628,
220,
220,
220,
1058,
17143,
479,
62,
7890,
25,
262,
479,
2373,
495,
198,
220,
220,
220,
1058,
17143,
2939,
62,
2617,
25,
900,
286,
2939,
3891,
198,
220,
220,
220,
1058,
7783,
25,
1351,
286,
357,
9060,
1438,
11,
3455,
8,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
6818,
479,
62,
7890,
13,
9535,
752,
1749,
318,
407,
6045,
198,
220,
220,
220,
611,
318,
39098,
7,
9060,
62,
2617,
11,
1351,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
2939,
62,
2617,
796,
900,
7,
9060,
62,
2617,
8,
198,
220,
220,
220,
6818,
318,
39098,
7,
9060,
62,
2617,
11,
900,
8,
198,
220,
220,
220,
6818,
318,
39098,
7,
74,
62,
7890,
11,
479,
2373,
495,
13,
42,
2373,
495,
8,
628,
220,
220,
220,
1303,
4174,
45932,
284,
20134,
1749,
198,
220,
220,
220,
611,
479,
62,
7890,
13,
4359,
82,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
20134,
1749,
796,
479,
2373,
495,
13,
4359,
82,
62,
28956,
7,
74,
62,
7890,
13,
9535,
752,
1749,
11,
479,
62,
7890,
13,
4359,
82,
8,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
20134,
1749,
796,
479,
62,
7890,
13,
9535,
752,
1749,
628,
220,
220,
220,
17313,
796,
17635,
198,
220,
220,
220,
329,
41033,
11,
3335,
62,
312,
11,
29472,
287,
479,
2373,
495,
13,
2704,
41769,
7,
74,
62,
7890,
13,
8344,
3669,
62,
25695,
11,
318,
62,
82,
9741,
28,
17821,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
611,
29472,
287,
2939,
62,
2617,
290,
357,
16514,
27823,
11,
3335,
62,
312,
8,
287,
20134,
1749,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12705,
796,
20134,
1749,
58,
7,
16514,
27823,
11,
3335,
62,
312,
15437,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17313,
13,
33295,
19510,
34345,
11,
12705,
4008,
198,
220,
220,
220,
1441,
17313,
628,
198,
4299,
13446,
7,
74,
62,
7890,
25,
479,
2373,
495,
13,
42,
2373,
495,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
479,
62,
7890,
62,
13655,
25,
479,
2373,
495,
13,
42,
2373,
495,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2939,
62,
2617,
25,
4479,
58,
7248,
58,
2536,
4357,
7343,
58,
2536,
11907,
8,
4613,
7343,
58,
51,
29291,
58,
2536,
11,
12178,
11,
12178,
60,
5974,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
26439,
4985,
262,
12705,
1043,
329,
4263,
287,
257,
479,
2373,
495,
351,
257,
4941,
479,
2373,
495,
13,
628,
220,
220,
220,
1058,
17143,
479,
62,
7890,
25,
262,
479,
2373,
495,
284,
1332,
198,
220,
220,
220,
1058,
17143,
479,
62,
7890,
62,
13655,
25,
262,
4941,
479,
2373,
495,
198,
220,
220,
220,
1058,
17143,
2939,
62,
2617,
25,
1351,
286,
2939,
3891,
198,
220,
220,
220,
1058,
7783,
25,
1351,
286,
2939,
12705,
12660,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
611,
318,
39098,
7,
9060,
62,
2617,
11,
1351,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
2939,
62,
2617,
796,
900,
7,
9060,
62,
2617,
8,
198,
220,
220,
220,
6818,
318,
39098,
7,
9060,
62,
2617,
11,
900,
8,
198,
220,
220,
220,
6818,
7,
11925,
7,
9060,
62,
2617,
8,
1875,
657,
8,
198,
220,
220,
220,
6818,
318,
39098,
7,
74,
62,
7890,
11,
479,
2373,
495,
13,
42,
2373,
495,
8,
198,
220,
220,
220,
6818,
318,
39098,
7,
74,
62,
7890,
62,
13655,
11,
479,
2373,
495,
13,
42,
2373,
495,
8,
628,
220,
220,
220,
17313,
62,
1462,
62,
9288,
796,
651,
62,
4832,
7,
74,
62,
7890,
11,
2939,
62,
2617,
8,
198,
220,
220,
220,
17313,
62,
13655,
796,
651,
62,
4832,
7,
74,
62,
7890,
62,
13655,
11,
2939,
62,
2617,
8,
628,
220,
220,
220,
16726,
796,
13446,
62,
18224,
62,
48546,
7,
4832,
62,
1462,
62,
9288,
11,
17313,
62,
13655,
8,
198,
220,
220,
220,
36618,
62,
17566,
796,
1391,
3672,
329,
1438,
11,
2292,
62,
18224,
11,
13179,
62,
18224,
287,
16726,
92,
198,
220,
220,
220,
4814,
62,
17566,
796,
685,
3672,
329,
1438,
287,
2939,
62,
2617,
611,
1438,
407,
287,
36618,
62,
17566,
60,
198,
220,
220,
220,
329,
1438,
287,
4814,
62,
17566,
25,
198,
220,
220,
220,
220,
220,
220,
220,
16726,
13,
33295,
19510,
3672,
11,
10688,
13,
12647,
11,
10688,
13,
12647,
4008,
198,
220,
220,
220,
1441,
23243,
7,
18206,
6605,
8,
628,
198,
4299,
6070,
62,
65,
1040,
7,
43420,
25,
7343,
58,
51,
29291,
58,
2536,
11,
12178,
11,
12178,
60,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41701,
25,
7343,
58,
51,
29291,
58,
22468,
11,
12178,
11907,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
4613,
7343,
58,
51,
29291,
58,
22468,
11,
12178,
11,
493,
60,
5974,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
27845,
257,
9874,
351,
262,
1271,
286,
4263,
1626,
2292,
40885,
13,
628,
220,
220,
220,
1058,
17143,
2482,
25,
1351,
286,
4049,
12660,
357,
9060,
1438,
11,
11059,
4049,
11,
13179,
4049,
8,
198,
220,
220,
220,
1058,
17143,
41701,
25,
1351,
286,
11059,
290,
13179,
40885,
198,
220,
220,
220,
1058,
7783,
25,
1271,
286,
4263,
287,
790,
5166,
286,
357,
41519,
11,
10599,
341,
8,
4049,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
6818,
318,
39098,
7,
43420,
11,
1351,
8,
198,
220,
220,
220,
6818,
318,
39098,
7,
65,
1040,
11,
1351,
8,
628,
220,
220,
220,
477,
62,
1930,
1756,
796,
47527,
41519,
62,
18224,
11,
13179,
62,
18224,
8,
329,
1438,
11,
11059,
62,
18224,
11,
13179,
62,
18224,
287,
2482,
60,
198,
220,
220,
220,
5901,
62,
65,
1040,
796,
17635,
198,
220,
220,
220,
329,
257,
62,
8800,
287,
41701,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1007,
62,
400,
10126,
796,
257,
62,
8800,
58,
15,
60,
198,
220,
220,
220,
220,
220,
220,
220,
5724,
62,
400,
10126,
796,
257,
62,
8800,
58,
16,
60,
198,
220,
220,
220,
220,
220,
220,
220,
1271,
62,
1659,
62,
17566,
62,
259,
62,
8800,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
329,
11059,
62,
18224,
11,
13179,
62,
18224,
287,
477,
62,
1930,
1756,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
357,
11018,
13,
271,
12647,
7,
10599,
62,
400,
10126,
8,
393,
5724,
62,
400,
10126,
1279,
657,
8,
290,
11059,
62,
18224,
19841,
1007,
62,
400,
10126,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1271,
62,
1659,
62,
17566,
62,
259,
62,
8800,
15853,
352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
11059,
62,
18224,
19841,
1007,
62,
400,
10126,
290,
13179,
62,
18224,
19841,
5724,
62,
400,
10126,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1271,
62,
1659,
62,
17566,
62,
259,
62,
8800,
15853,
352,
198,
220,
220,
220,
220,
220,
220,
220,
5901,
62,
65,
1040,
13,
33295,
19510,
7645,
62,
400,
10126,
11,
5724,
62,
400,
10126,
11,
1271,
62,
1659,
62,
17566,
62,
259,
62,
8800,
4008,
198,
220,
220,
220,
1441,
5901,
62,
65,
1040,
628
] | 2.559391 | 1,709 |
#!/usr/bin/python
# encoding: utf-8
DEBUG = True
SQLALCHEMY_ECHO = True
SQLALCHEMY_DATABASE_URI = 'mysql://root:[email protected]/mysql'
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_ENCODING = 'utf-8'
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
21004,
25,
3384,
69,
12,
23,
198,
30531,
796,
6407,
198,
17861,
1847,
3398,
3620,
56,
62,
25994,
46,
796,
6407,
198,
17861,
1847,
3398,
3620,
56,
62,
35,
1404,
6242,
11159,
62,
47269,
796,
705,
28744,
13976,
1378,
15763,
25,
27532,
1485,
41734,
31,
16799,
13,
15,
13,
15,
13,
16,
14,
28744,
13976,
6,
198,
17861,
1847,
3398,
3620,
56,
62,
5446,
8120,
62,
33365,
30643,
18421,
796,
10352,
198,
17861,
1847,
3398,
3620,
56,
62,
24181,
3727,
2751,
796,
705,
40477,
12,
23,
6,
198
] | 2.134021 | 97 |
initial_health = 100
initial_bitcoins = 0
is_dead = False
rooms = input().split('|')
health = initial_health
bitcoins = initial_bitcoins
max_bitcoins = 0
for i in range(len(rooms)):
command = rooms[i]
tokens = command.split()
if tokens[0] == 'potion':
health_points = int(tokens[1])
if health + health_points > initial_health:
health_points = initial_health - health
health = initial_health
else:
health += health_points
print(f'You healed for {health_points} hp.')
print(f'Current health: {health} hp.')
elif tokens[0] == 'chest':
amount = int(tokens[1])
print(f'You found {amount} bitcoins.')
bitcoins += amount
if bitcoins >= max_bitcoins:
max_bitcoins = bitcoins
else:
monster = tokens[0]
attack = int(tokens[1])
health -= attack
if health > 0:
print(f'You slayed {monster}.')
else:
print(f'You died! Killed by {monster}.')
print(f'Best room: {i+1}')
is_dead = True
break
if not is_dead:
print(f"You've made it!")
print(f"Bitcoins: {bitcoins}")
print(f"Health: {health}")
| [
36733,
62,
13948,
796,
1802,
201,
198,
36733,
62,
2545,
14624,
796,
657,
201,
198,
271,
62,
25124,
796,
10352,
201,
198,
201,
198,
9649,
796,
5128,
22446,
35312,
10786,
91,
11537,
201,
198,
201,
198,
13948,
796,
4238,
62,
13948,
201,
198,
2545,
14624,
796,
4238,
62,
2545,
14624,
201,
198,
9806,
62,
2545,
14624,
796,
657,
201,
198,
201,
198,
1640,
1312,
287,
2837,
7,
11925,
7,
9649,
8,
2599,
201,
198,
220,
220,
220,
3141,
796,
9519,
58,
72,
60,
201,
198,
220,
220,
220,
16326,
796,
3141,
13,
35312,
3419,
201,
198,
201,
198,
220,
220,
220,
611,
16326,
58,
15,
60,
6624,
705,
49324,
10354,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1535,
62,
13033,
796,
493,
7,
83,
482,
641,
58,
16,
12962,
201,
198,
220,
220,
220,
220,
220,
220,
220,
611,
1535,
1343,
1535,
62,
13033,
1875,
4238,
62,
13948,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1535,
62,
13033,
796,
4238,
62,
13948,
532,
1535,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1535,
796,
4238,
62,
13948,
201,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1535,
15853,
1535,
62,
13033,
201,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
69,
6,
1639,
28557,
329,
1391,
13948,
62,
13033,
92,
27673,
2637,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
69,
6,
11297,
1535,
25,
1391,
13948,
92,
27673,
2637,
8,
201,
198,
201,
198,
220,
220,
220,
1288,
361,
16326,
58,
15,
60,
6624,
705,
46713,
10354,
201,
198,
220,
220,
220,
220,
220,
220,
220,
2033,
796,
493,
7,
83,
482,
641,
58,
16,
12962,
201,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
69,
6,
1639,
1043,
1391,
17287,
92,
22690,
2637,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
22690,
15853,
2033,
201,
198,
220,
220,
220,
220,
220,
220,
220,
611,
22690,
18189,
3509,
62,
2545,
14624,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3509,
62,
2545,
14624,
796,
22690,
201,
198,
201,
198,
220,
220,
220,
2073,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
9234,
796,
16326,
58,
15,
60,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1368,
796,
493,
7,
83,
482,
641,
58,
16,
12962,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1535,
48185,
1368,
201,
198,
220,
220,
220,
220,
220,
220,
220,
611,
1535,
1875,
657,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
69,
6,
1639,
1017,
16548,
1391,
39050,
92,
2637,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
69,
6,
1639,
3724,
0,
13095,
416,
1391,
39050,
92,
2637,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
69,
6,
13014,
2119,
25,
1391,
72,
10,
16,
92,
11537,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
62,
25124,
796,
6407,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2270,
201,
198,
201,
198,
361,
407,
318,
62,
25124,
25,
201,
198,
220,
220,
220,
3601,
7,
69,
1,
1639,
1053,
925,
340,
2474,
8,
201,
198,
220,
220,
220,
3601,
7,
69,
1,
13128,
14624,
25,
1391,
2545,
14624,
92,
4943,
201,
198,
220,
220,
220,
3601,
7,
69,
1,
18081,
25,
1391,
13948,
92,
4943,
201,
198
] | 2.067742 | 620 |
import sys
import pytest
import toml
from single_source.version import (
VERSION_REGEX,
VersionNotFoundError,
_get_version_from_metadata,
_get_version_from_path,
get_version,
)
| [
11748,
25064,
198,
198,
11748,
12972,
9288,
198,
11748,
284,
4029,
198,
198,
6738,
2060,
62,
10459,
13,
9641,
1330,
357,
198,
220,
220,
220,
44156,
2849,
62,
31553,
6369,
11,
198,
220,
220,
220,
10628,
3673,
21077,
12331,
11,
198,
220,
220,
220,
4808,
1136,
62,
9641,
62,
6738,
62,
38993,
11,
198,
220,
220,
220,
4808,
1136,
62,
9641,
62,
6738,
62,
6978,
11,
198,
220,
220,
220,
651,
62,
9641,
11,
198,
8,
628,
628,
628
] | 2.582278 | 79 |
"""
team_fouls_utils.py
This function contains helpful functions for
pulling in basketball data for use by
team_fouls.py
"""
from typing import Union, List, Dict
import pandas as pd
from py_ball import playbyplay, boxscore, scoreboard, player
from team_fouls_constants import TWO_MINUTES
# Header information needed for py_ball
HEADERS = {'Connection': 'keep-alive',
'Host': 'stats.nba.com',
'Origin': 'http://stats.nba.com',
'Upgrade-Insecure-Requests': '1',
'Referer': 'stats.nba.com',
'x-nba-stats-origin': 'stats',
'x-nba-stats-token': 'true',
'Accept-Language': 'en-US,en;q=0.9',
"X-NewRelic-ID": "VQECWF5UChAHUlNTBwgBVw==",
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6)' +\
' AppleWebKit/537.36 (KHTML, like Gecko)' + \
' Chrome/81.0.4044.129 Safari/537.36'}
def get_shot_data(season: str, game_id: str, league_id: str) -> List:
""" get_game_ids returns the NBA game IDs
that take place on the provided date
@param season (str): Season in YYYY-ZZ format for NBA
and G-League, YYYY format for WNBA
@param game_id (str): Unique identifier for the game
@param league_id (str): One of '00' (NBA), '10' (WNBA),
'20' (G League)
Returns:
- shot_df (DataFrame): DataFrame containing all
shot data
"""
shots = player.Player(headers=HEADERS,
endpoint='shotchartdetail',
league_id=league_id,
player_id='0',
game_id=game_id,
season=season)
shot_df = pd.DataFrame(shots.data['Shot_Chart_Detail'])
return shot_df
def get_game_ids(date: str, league_id: str) -> List:
""" get_game_ids returns the NBA game IDs
that take place on the provided date
@param date (str): Date in MM/DD/YYYY format
@param league_id (str): One of '00' (NBA), '10' (WNBA),
'20' (G League)
Returns:
- game_id_list (list): List of game IDs
"""
scores = scoreboard.ScoreBoard(headers=HEADERS,
endpoint='scoreboardv2',
league_id=league_id,
game_date=date,
day_offset='0')
games = scores.data['GameHeader']
game_id_list = [x['GAME_ID'] for x in games]
return game_id_list
def pull_team_ids(game_id: str) -> Union[int, int, bool, List]:
""" This function pulls the JSON file for a
game's play-by-play data and converts it into
a Pandas DataFrame
@param game_id (str): 10-digit string \
that represents a unique game. The format is two leading zeroes, \
followed by a season indicator number ('1' for preseason, \
'2' for regular season, '4' for the post-season), \
then the trailing digits of the season in which the game \
took place (e.g. '17' for the 2017-18 season). The following \
5 digits increment from '00001' in order as the season progresses. \
For example, '0021600001' is the **game_id** of the first game \
of the 2016-17 NBA regular season.
Returns:
- home_id (int): 10-digit integer that uniquely identifies the
home team
- away_id (int): 10-digit integer that uniquely identifies the
away team
- home_winner (bool): Boolean indicating whether the home team
won or not
- line (list): List containing line score information by team
"""
box = boxscore.BoxScore(headers=HEADERS, endpoint='boxscoresummaryv2', game_id=game_id)
metadata = box.data["GameSummary"]
line = box.data["LineScore"]
home_id, away_id = metadata[0]["HOME_TEAM_ID"], metadata[0]["VISITOR_TEAM_ID"]
# Find winner by comparing point totals
if line[0]["TEAM_ID"] == home_id:
home_points = line[0]["PTS"]
away_points = line[1]["PTS"]
else:
home_points = line[1]["PTS"]
away_points = line[0]["PTS"]
if pd.notnull(home_points) and pd.notnull(away_points):
home_winner = home_points > away_points
else:
home_winner = None
return home_id, away_id, home_winner, line
def pull_pbp_file(game_id: str) -> pd.DataFrame:
""" This function pulls the JSON file for a
game's play-by-play data and converts it into
a Pandas DataFrame
@param game_id (str): 10-digit string \
that represents a unique game. The format is two leading zeroes, \
followed by a season indicator number ('1' for preseason, \
'2' for regular season, '4' for the post-season), \
then the trailing digits of the season in which the game \
took place (e.g. '17' for the 2017-18 season). The following \
5 digits increment from '00001' in order as the season progresses. \
For example, '0021600001' is the **game_id** of the first game \
of the 2016-17 NBA regular season.
Returns:
- pbp_df (DataFrame): DataFrame containing play-by-play
data for the game corresponding to game_id
"""
plays = playbyplay.PlayByPlay(headers=HEADERS, endpoint='playbyplayv2', game_id=game_id)
pbp_df = pd.DataFrame(plays.data['PlayByPlay'])
return pbp_df
def str_to_time(time_str: str, period: int) -> int:
""" This function converts a period and time to seconds remaining
in the quarter
@param time_str (str): Game time in MM:SS format
@param period (int): Game quarter (5 is OT1, 6 is OT2, etc.)
Returns
- seconds_left_period (int): Seconds left in the given period
"""
split_time = time_str.split(':')
seconds_left_period = int(split_time[0]) * 60 + int(split_time[1])
return seconds_left_period
def add_fouls(foul_dict: Dict, period: int, quarter_time: int, team_id: int, penalty_dict: Dict) -> Dict:
""" This function adds fouls to a team's total and their
L2M total if applicable
@param foul_dict (dict): Dictionary containing the number of fouls
and L2M fouls a team has accumulated
@param period (int): Game quarter (5 is OT1, 6 is OT2, etc.)
@param quarter_time (int): Time remaining in the quarter
@param team_id (int): Unique identifier of team committing a foul
@param penalty_dict (dict): Dictionary containing team foul
related data
Returns:
- foul_dict (int): Incremented number of team fouls
and L2M fouls in the quarter
- penalty_dict (dict): Dictionary containing updated
team foul related data
"""
foul_dict["fouls"] += 1
penalty_dict[team_id]["time_to_foul"][period][foul_dict["fouls"]] = foul_dict["last_foul_time"] - quarter_time
foul_dict["last_foul_time"] = quarter_time
if quarter_time <= TWO_MINUTES:
foul_dict["l2m"] += 1
return foul_dict, penalty_dict
def is_in_penalty(foul_dict: Dict, period: int, penalty: bool) -> Union[bool, int]:
""" This function determines if a team is in the penalty
@param foul_dict (dict): Dictionary containing the number of fouls
and L2M fouls a team has accumulated
@param period (int): Game quarter (5 is OT1, 6 is OT2, etc.)
@param penalty (bool): Boolean indicating whether the
team is in the penalty
Returns:
- penalty (bool): Boolean indicating whether the
team is in the penalty
- period_fouls (int): Number of fouls to reach the penalty
"""
period_fouls = 4 if period <= 4 else 3
if foul_dict["fouls"] >= period_fouls or foul_dict["l2m"] >= 1:
penalty = True
else:
penalty = False
return penalty, period_fouls
| [
37811,
198,
15097,
62,
69,
42033,
62,
26791,
13,
9078,
198,
198,
1212,
2163,
4909,
7613,
5499,
329,
198,
31216,
278,
287,
9669,
1366,
329,
779,
416,
198,
15097,
62,
69,
42033,
13,
9078,
198,
37811,
198,
198,
6738,
19720,
1330,
4479,
11,
7343,
11,
360,
713,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
6738,
12972,
62,
1894,
1330,
711,
1525,
1759,
11,
3091,
26675,
11,
50198,
11,
2137,
198,
198,
6738,
1074,
62,
69,
42033,
62,
9979,
1187,
1330,
35288,
62,
23678,
3843,
1546,
628,
198,
2,
48900,
1321,
2622,
329,
12972,
62,
1894,
198,
37682,
4877,
796,
1391,
6,
32048,
10354,
705,
14894,
12,
282,
425,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
17932,
10354,
705,
34242,
13,
77,
7012,
13,
785,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
39688,
10354,
705,
4023,
1378,
34242,
13,
77,
7012,
13,
785,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
44948,
12,
818,
22390,
12,
16844,
3558,
10354,
705,
16,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
8134,
11882,
10354,
705,
34242,
13,
77,
7012,
13,
785,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
87,
12,
77,
7012,
12,
34242,
12,
47103,
10354,
705,
34242,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
87,
12,
77,
7012,
12,
34242,
12,
30001,
10354,
705,
7942,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
38855,
12,
32065,
10354,
705,
268,
12,
2937,
11,
268,
26,
80,
28,
15,
13,
24,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
55,
12,
3791,
6892,
291,
12,
2389,
1298,
366,
53,
48,
2943,
48397,
20,
52,
1925,
18429,
47920,
11251,
33,
86,
70,
33,
53,
86,
855,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
12982,
12,
36772,
10354,
705,
44,
8590,
5049,
14,
20,
13,
15,
357,
14155,
37638,
26,
8180,
4100,
7294,
1395,
838,
62,
1415,
62,
21,
33047,
1343,
59,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
4196,
13908,
20827,
14,
46096,
13,
2623,
357,
42,
28656,
11,
588,
2269,
37549,
33047,
1343,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
13282,
14,
6659,
13,
15,
13,
1821,
2598,
13,
18741,
23298,
14,
46096,
13,
2623,
6,
92,
198,
198,
4299,
651,
62,
9442,
62,
7890,
7,
6230,
25,
965,
11,
983,
62,
312,
25,
965,
11,
4652,
62,
312,
25,
965,
8,
4613,
7343,
25,
198,
197,
37811,
651,
62,
6057,
62,
2340,
5860,
262,
7403,
983,
32373,
198,
197,
5562,
1011,
1295,
319,
262,
2810,
3128,
628,
197,
31,
17143,
1622,
357,
2536,
2599,
7369,
287,
575,
26314,
56,
12,
30148,
5794,
329,
7403,
198,
197,
197,
392,
402,
12,
24623,
11,
575,
26314,
56,
5794,
329,
370,
32470,
198,
197,
31,
17143,
983,
62,
312,
357,
2536,
2599,
30015,
27421,
329,
262,
983,
198,
197,
31,
17143,
4652,
62,
312,
357,
2536,
2599,
1881,
286,
705,
405,
6,
357,
32470,
828,
705,
940,
6,
357,
29767,
4339,
828,
198,
197,
197,
6,
1238,
6,
357,
38,
4041,
8,
628,
197,
35561,
25,
628,
197,
197,
12,
2823,
62,
7568,
357,
6601,
19778,
2599,
6060,
19778,
7268,
477,
198,
197,
197,
197,
9442,
1366,
198,
197,
37811,
628,
197,
20910,
796,
2137,
13,
14140,
7,
50145,
28,
37682,
4877,
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,
36123,
11639,
9442,
40926,
49170,
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,
4652,
62,
312,
28,
19316,
62,
312,
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,
2137,
62,
312,
11639,
15,
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,
983,
62,
312,
28,
6057,
62,
312,
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,
1622,
28,
6230,
8,
628,
197,
9442,
62,
7568,
796,
279,
67,
13,
6601,
19778,
7,
20910,
13,
7890,
17816,
28512,
62,
45488,
62,
11242,
603,
6,
12962,
628,
197,
7783,
2823,
62,
7568,
628,
198,
4299,
651,
62,
6057,
62,
2340,
7,
4475,
25,
965,
11,
4652,
62,
312,
25,
965,
8,
4613,
7343,
25,
198,
197,
37811,
651,
62,
6057,
62,
2340,
5860,
262,
7403,
983,
32373,
198,
197,
5562,
1011,
1295,
319,
262,
2810,
3128,
628,
197,
31,
17143,
3128,
357,
2536,
2599,
7536,
287,
20806,
14,
16458,
14,
26314,
26314,
5794,
198,
197,
31,
17143,
4652,
62,
312,
357,
2536,
2599,
1881,
286,
705,
405,
6,
357,
32470,
828,
705,
940,
6,
357,
29767,
4339,
828,
198,
197,
197,
6,
1238,
6,
357,
38,
4041,
8,
628,
197,
35561,
25,
628,
197,
197,
12,
983,
62,
312,
62,
4868,
357,
4868,
2599,
7343,
286,
983,
32373,
198,
197,
37811,
628,
197,
1416,
2850,
796,
50198,
13,
26595,
29828,
7,
50145,
28,
37682,
4877,
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,
197,
220,
220,
36123,
11639,
26675,
3526,
85,
17,
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,
4652,
62,
312,
28,
19316,
62,
312,
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,
197,
220,
220,
983,
62,
4475,
28,
4475,
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,
197,
220,
220,
1110,
62,
28968,
11639,
15,
11537,
628,
197,
19966,
796,
8198,
13,
7890,
17816,
8777,
39681,
20520,
198,
197,
6057,
62,
312,
62,
4868,
796,
685,
87,
17816,
47109,
62,
2389,
20520,
329,
2124,
287,
1830,
60,
628,
197,
7783,
983,
62,
312,
62,
4868,
628,
198,
4299,
2834,
62,
15097,
62,
2340,
7,
6057,
62,
312,
25,
965,
8,
4613,
4479,
58,
600,
11,
493,
11,
20512,
11,
7343,
5974,
198,
197,
37811,
770,
2163,
16194,
262,
19449,
2393,
329,
257,
198,
197,
6057,
338,
711,
12,
1525,
12,
1759,
1366,
290,
26161,
340,
656,
198,
197,
64,
16492,
292,
6060,
19778,
628,
197,
31,
17143,
983,
62,
312,
357,
2536,
2599,
838,
12,
27003,
4731,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
326,
6870,
257,
3748,
983,
13,
383,
5794,
318,
734,
3756,
1976,
263,
3028,
11,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
3940,
416,
257,
1622,
16916,
1271,
19203,
16,
6,
329,
18913,
11,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
705,
17,
6,
329,
3218,
1622,
11,
705,
19,
6,
329,
262,
1281,
12,
6230,
828,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
788,
262,
25462,
19561,
286,
262,
1622,
287,
543,
262,
983,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
1718,
1295,
357,
68,
13,
70,
13,
705,
1558,
6,
329,
262,
2177,
12,
1507,
1622,
737,
383,
1708,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
642,
19561,
18703,
422,
705,
2388,
16,
6,
287,
1502,
355,
262,
1622,
33226,
13,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
1114,
1672,
11,
705,
405,
20666,
2388,
16,
6,
318,
262,
12429,
6057,
62,
312,
1174,
286,
262,
717,
983,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
286,
262,
1584,
12,
1558,
7403,
3218,
1622,
13,
628,
197,
35561,
25,
628,
197,
197,
12,
1363,
62,
312,
357,
600,
2599,
838,
12,
27003,
18253,
326,
24139,
21079,
262,
198,
197,
197,
197,
11195,
1074,
198,
197,
197,
12,
1497,
62,
312,
357,
600,
2599,
838,
12,
27003,
18253,
326,
24139,
21079,
262,
198,
197,
197,
197,
8272,
1074,
198,
197,
197,
12,
1363,
62,
39791,
357,
30388,
2599,
41146,
12739,
1771,
262,
1363,
1074,
198,
197,
197,
197,
26502,
393,
407,
198,
197,
197,
12,
1627,
357,
4868,
2599,
7343,
7268,
1627,
4776,
1321,
416,
1074,
198,
197,
37811,
628,
197,
3524,
796,
3091,
26675,
13,
14253,
26595,
7,
50145,
28,
37682,
4877,
11,
36123,
11639,
3524,
1416,
2850,
388,
6874,
85,
17,
3256,
983,
62,
312,
28,
6057,
62,
312,
8,
198,
197,
38993,
796,
3091,
13,
7890,
14692,
8777,
22093,
8973,
198,
197,
1370,
796,
3091,
13,
7890,
14692,
13949,
26595,
8973,
198,
197,
11195,
62,
312,
11,
1497,
62,
312,
796,
20150,
58,
15,
7131,
1,
39069,
62,
9328,
2390,
62,
2389,
33116,
20150,
58,
15,
7131,
1,
29817,
2043,
1581,
62,
9328,
2390,
62,
2389,
8973,
628,
197,
2,
9938,
8464,
416,
14176,
966,
26310,
198,
197,
361,
1627,
58,
15,
7131,
1,
9328,
2390,
62,
2389,
8973,
6624,
1363,
62,
312,
25,
198,
197,
197,
11195,
62,
13033,
796,
1627,
58,
15,
7131,
1,
47,
4694,
8973,
198,
197,
197,
8272,
62,
13033,
796,
1627,
58,
16,
7131,
1,
47,
4694,
8973,
198,
197,
17772,
25,
198,
197,
197,
11195,
62,
13033,
796,
1627,
58,
16,
7131,
1,
47,
4694,
8973,
198,
197,
197,
8272,
62,
13033,
796,
1627,
58,
15,
7131,
1,
47,
4694,
8973,
628,
197,
361,
279,
67,
13,
1662,
8423,
7,
11195,
62,
13033,
8,
290,
279,
67,
13,
1662,
8423,
7,
8272,
62,
13033,
2599,
198,
197,
197,
11195,
62,
39791,
796,
1363,
62,
13033,
1875,
1497,
62,
13033,
198,
197,
17772,
25,
198,
197,
197,
11195,
62,
39791,
796,
6045,
628,
197,
7783,
1363,
62,
312,
11,
1497,
62,
312,
11,
1363,
62,
39791,
11,
1627,
628,
198,
4299,
2834,
62,
40842,
79,
62,
7753,
7,
6057,
62,
312,
25,
965,
8,
4613,
279,
67,
13,
6601,
19778,
25,
198,
197,
37811,
770,
2163,
16194,
262,
19449,
2393,
329,
257,
198,
197,
6057,
338,
711,
12,
1525,
12,
1759,
1366,
290,
26161,
340,
656,
198,
197,
64,
16492,
292,
6060,
19778,
628,
197,
31,
17143,
983,
62,
312,
357,
2536,
2599,
838,
12,
27003,
4731,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
326,
6870,
257,
3748,
983,
13,
383,
5794,
318,
734,
3756,
1976,
263,
3028,
11,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
3940,
416,
257,
1622,
16916,
1271,
19203,
16,
6,
329,
18913,
11,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
705,
17,
6,
329,
3218,
1622,
11,
705,
19,
6,
329,
262,
1281,
12,
6230,
828,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
788,
262,
25462,
19561,
286,
262,
1622,
287,
543,
262,
983,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
1718,
1295,
357,
68,
13,
70,
13,
705,
1558,
6,
329,
262,
2177,
12,
1507,
1622,
737,
383,
1708,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
642,
19561,
18703,
422,
705,
2388,
16,
6,
287,
1502,
355,
262,
1622,
33226,
13,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
1114,
1672,
11,
705,
405,
20666,
2388,
16,
6,
318,
262,
12429,
6057,
62,
312,
1174,
286,
262,
717,
983,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
286,
262,
1584,
12,
1558,
7403,
3218,
1622,
13,
628,
197,
35561,
25,
628,
197,
197,
12,
279,
46583,
62,
7568,
357,
6601,
19778,
2599,
6060,
19778,
7268,
711,
12,
1525,
12,
1759,
198,
197,
197,
197,
7890,
329,
262,
983,
11188,
284,
983,
62,
312,
198,
197,
37811,
628,
197,
26024,
796,
711,
1525,
1759,
13,
11002,
3886,
11002,
7,
50145,
28,
37682,
4877,
11,
36123,
11639,
1759,
1525,
1759,
85,
17,
3256,
983,
62,
312,
28,
6057,
62,
312,
8,
198,
197,
40842,
79,
62,
7568,
796,
279,
67,
13,
6601,
19778,
7,
26024,
13,
7890,
17816,
11002,
3886,
11002,
6,
12962,
628,
197,
7783,
279,
46583,
62,
7568,
628,
198,
4299,
965,
62,
1462,
62,
2435,
7,
2435,
62,
2536,
25,
965,
11,
2278,
25,
493,
8,
4613,
493,
25,
198,
220,
220,
220,
37227,
770,
2163,
26161,
257,
2278,
290,
640,
284,
4201,
5637,
198,
220,
220,
220,
287,
262,
3860,
628,
198,
197,
31,
17143,
640,
62,
2536,
357,
2536,
2599,
3776,
640,
287,
20806,
25,
5432,
5794,
198,
197,
31,
17143,
2278,
357,
600,
2599,
3776,
3860,
357,
20,
318,
21676,
16,
11,
718,
318,
21676,
17,
11,
3503,
2014,
628,
197,
35561,
628,
197,
197,
12,
4201,
62,
9464,
62,
41007,
357,
600,
2599,
40876,
1364,
287,
262,
1813,
2278,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
6626,
62,
2435,
796,
640,
62,
2536,
13,
35312,
7,
10354,
11537,
198,
220,
220,
220,
4201,
62,
9464,
62,
41007,
796,
493,
7,
35312,
62,
2435,
58,
15,
12962,
1635,
3126,
1343,
493,
7,
35312,
62,
2435,
58,
16,
12962,
628,
220,
220,
220,
1441,
4201,
62,
9464,
62,
41007,
628,
198,
4299,
751,
62,
69,
42033,
7,
69,
2852,
62,
11600,
25,
360,
713,
11,
2278,
25,
493,
11,
3860,
62,
2435,
25,
493,
11,
1074,
62,
312,
25,
493,
11,
7389,
62,
11600,
25,
360,
713,
8,
4613,
360,
713,
25,
198,
197,
37811,
770,
2163,
6673,
15626,
82,
284,
257,
1074,
338,
2472,
290,
511,
198,
197,
43,
17,
44,
2472,
611,
9723,
628,
197,
31,
17143,
15626,
62,
11600,
357,
11600,
2599,
28261,
7268,
262,
1271,
286,
15626,
82,
198,
197,
197,
392,
406,
17,
44,
15626,
82,
257,
1074,
468,
22425,
198,
197,
31,
17143,
2278,
357,
600,
2599,
3776,
3860,
357,
20,
318,
21676,
16,
11,
718,
318,
21676,
17,
11,
3503,
2014,
198,
197,
31,
17143,
3860,
62,
2435,
357,
600,
2599,
3862,
5637,
287,
262,
3860,
198,
197,
31,
17143,
1074,
62,
312,
357,
600,
2599,
30015,
27421,
286,
1074,
17222,
257,
15626,
198,
197,
31,
17143,
7389,
62,
11600,
357,
11600,
2599,
28261,
7268,
1074,
15626,
198,
197,
197,
5363,
1366,
628,
197,
35561,
25,
628,
197,
197,
12,
15626,
62,
11600,
357,
600,
2599,
10791,
12061,
1271,
286,
1074,
15626,
82,
198,
197,
197,
197,
392,
406,
17,
44,
15626,
82,
287,
262,
3860,
198,
197,
197,
12,
7389,
62,
11600,
357,
11600,
2599,
28261,
7268,
6153,
198,
197,
197,
197,
15097,
15626,
3519,
1366,
198,
197,
37811,
628,
197,
69,
2852,
62,
11600,
14692,
69,
42033,
8973,
15853,
352,
198,
197,
3617,
6017,
62,
11600,
58,
15097,
62,
312,
7131,
1,
2435,
62,
1462,
62,
69,
2852,
1,
7131,
41007,
7131,
69,
2852,
62,
11600,
14692,
69,
42033,
8973,
60,
796,
15626,
62,
11600,
14692,
12957,
62,
69,
2852,
62,
2435,
8973,
532,
3860,
62,
2435,
198,
197,
69,
2852,
62,
11600,
14692,
12957,
62,
69,
2852,
62,
2435,
8973,
796,
3860,
62,
2435,
198,
197,
361,
3860,
62,
2435,
19841,
35288,
62,
23678,
3843,
1546,
25,
198,
197,
197,
69,
2852,
62,
11600,
14692,
75,
17,
76,
8973,
15853,
352,
628,
197,
7783,
15626,
62,
11600,
11,
7389,
62,
11600,
628,
198,
4299,
318,
62,
259,
62,
3617,
6017,
7,
69,
2852,
62,
11600,
25,
360,
713,
11,
2278,
25,
493,
11,
7389,
25,
20512,
8,
4613,
4479,
58,
30388,
11,
493,
5974,
198,
197,
37811,
770,
2163,
15947,
611,
257,
1074,
318,
287,
262,
7389,
628,
197,
31,
17143,
15626,
62,
11600,
357,
11600,
2599,
28261,
7268,
262,
1271,
286,
15626,
82,
198,
197,
197,
392,
406,
17,
44,
15626,
82,
257,
1074,
468,
22425,
198,
197,
31,
17143,
2278,
357,
600,
2599,
3776,
3860,
357,
20,
318,
21676,
16,
11,
718,
318,
21676,
17,
11,
3503,
2014,
198,
197,
31,
17143,
7389,
357,
30388,
2599,
41146,
12739,
1771,
262,
198,
197,
197,
15097,
318,
287,
262,
7389,
628,
197,
35561,
25,
628,
197,
197,
12,
7389,
357,
30388,
2599,
41146,
12739,
1771,
262,
198,
197,
197,
197,
15097,
318,
287,
262,
7389,
198,
197,
197,
12,
2278,
62,
69,
42033,
357,
600,
2599,
7913,
286,
15626,
82,
284,
3151,
262,
7389,
198,
197,
37811,
628,
197,
41007,
62,
69,
42033,
796,
604,
611,
2278,
19841,
604,
2073,
513,
628,
197,
361,
15626,
62,
11600,
14692,
69,
42033,
8973,
18189,
2278,
62,
69,
42033,
393,
15626,
62,
11600,
14692,
75,
17,
76,
8973,
18189,
352,
25,
198,
197,
197,
3617,
6017,
796,
6407,
198,
197,
17772,
25,
198,
197,
197,
3617,
6017,
796,
10352,
628,
197,
7783,
7389,
11,
2278,
62,
69,
42033,
198
] | 2.57458 | 2,856 |
import wave
import AudioParse
import AudioSteganography
main() | [
11748,
6769,
198,
11748,
13491,
10044,
325,
198,
11748,
13491,
7447,
1030,
4867,
198,
198,
12417,
3419
] | 3.705882 | 17 |
"""Utility functions for two- and three-dimensional vectors."""
__all__ = [
"quaternion_mult",
"quaternion_from_angle_axis",
"angle_axis_from_quaternion",
"quaternion_conjugate",
"rotate_vector",
"thick_diagonal",
"rotation_matrix",
"rotation_about_z",
"z_to_vector",
"angle_of_vector",
"angle_between_vectors",
"project_along_vector",
"normalize",
"get_unit_normal",
"compass_directions",
"regular_vertices",
"complex_to_R3",
"R3_to_complex",
"complex_func_to_R3_func",
"center_of_mass",
"midpoint",
"find_intersection",
"line_intersection",
"get_winding_number",
"cross2d",
"earclip_triangulation",
"perpendicular_bisector",
]
import itertools as it
import math
from functools import reduce
from typing import List, Optional, Sequence, Tuple, Union
import numpy as np
from mapbox_earcut import triangulate_float32 as earcut
from .. import config
from ..constants import DOWN, OUT, PI, RIGHT, TAU
from ..utils.iterables import adjacent_pairs
# Quaternions
# TODO, implement quaternion type
def quaternion_mult(
*quats: Sequence[float],
) -> Union[np.ndarray, List[Union[float, np.ndarray]]]:
"""Gets the Hamilton product of the quaternions provided.
For more information, check `this Wikipedia page
<https://en.wikipedia.org/wiki/Quaternion>`_.
Returns
-------
Union[np.ndarray, List[Union[float, np.ndarray]]]
Returns a list of product of two quaternions.
"""
if config.renderer == "opengl":
if len(quats) == 0:
return [1, 0, 0, 0]
result = quats[0]
for next_quat in quats[1:]:
w1, x1, y1, z1 = result
w2, x2, y2, z2 = next_quat
result = [
w1 * w2 - x1 * x2 - y1 * y2 - z1 * z2,
w1 * x2 + x1 * w2 + y1 * z2 - z1 * y2,
w1 * y2 + y1 * w2 + z1 * x2 - x1 * z2,
w1 * z2 + z1 * w2 + x1 * y2 - y1 * x2,
]
return result
else:
q1 = quats[0]
q2 = quats[1]
w1, x1, y1, z1 = q1
w2, x2, y2, z2 = q2
return np.array(
[
w1 * w2 - x1 * x2 - y1 * y2 - z1 * z2,
w1 * x2 + x1 * w2 + y1 * z2 - z1 * y2,
w1 * y2 + y1 * w2 + z1 * x2 - x1 * z2,
w1 * z2 + z1 * w2 + x1 * y2 - y1 * x2,
]
)
def quaternion_from_angle_axis(
angle: float, axis: np.ndarray, axis_normalized: bool = False
) -> List[float]:
"""Gets a quaternion from an angle and an axis.
For more information, check `this Wikipedia page
<https://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles>`_.
Parameters
----------
angle
The angle for the quaternion.
axis
The axis for the quaternion
axis_normalized : bool, optional
Checks whether the axis is normalized, by default False
Returns
-------
List[float]
Gives back a quaternion from the angle and axis
"""
if config.renderer == "opengl":
if not axis_normalized:
axis = normalize(axis)
return [math.cos(angle / 2), *(math.sin(angle / 2) * axis)]
else:
return np.append(np.cos(angle / 2), np.sin(angle / 2) * normalize(axis))
def angle_axis_from_quaternion(quaternion: Sequence[float]) -> Sequence[float]:
"""Gets angle and axis from a quaternion.
Parameters
----------
quaternion
The quaternion from which we get the angle and axis.
Returns
-------
Sequence[float]
Gives the angle and axis
"""
axis = normalize(quaternion[1:], fall_back=np.array([1, 0, 0]))
angle = 2 * np.arccos(quaternion[0])
if angle > TAU / 2:
angle = TAU - angle
return angle, axis
def quaternion_conjugate(quaternion: Sequence[float]) -> np.ndarray:
"""Used for finding the conjugate of the quaternion
Parameters
----------
quaternion
The quaternion for which you want to find the conjugate for.
Returns
-------
np.ndarray
The conjugate of the quaternion.
"""
result = np.array(quaternion)
result[1:] *= -1
return result
def rotate_vector(vector: np.ndarray, angle: int, axis: np.ndarray = OUT) -> np.ndarray:
"""Function for rotating a vector.
Parameters
----------
vector
The vector to be rotated.
angle
The angle to be rotated by.
axis
The axis to be rotated, by default OUT
Returns
-------
np.ndarray
The rotated vector with provided angle and axis.
Raises
------
ValueError
If vector is not of dimension 2 or 3.
"""
if len(vector) == 2:
# Use complex numbers...because why not
z = complex(*vector) * np.exp(complex(0, angle))
return np.array([z.real, z.imag])
elif len(vector) == 3:
# Use quaternions...because why not
quat = quaternion_from_angle_axis(angle, axis)
quat_inv = quaternion_conjugate(quat)
product = reduce(quaternion_mult, [quat, np.append(0, vector), quat_inv])
return product[1:]
else:
raise ValueError("vector must be of dimension 2 or 3")
def rotation_matrix_transpose_from_quaternion(quat: np.ndarray) -> List[np.ndarray]:
"""Converts the quaternion, quat, to an equivalent rotation matrix representation.
For more information, check `this page
<https://in.mathworks.com/help/driving/ref/quaternion.rotmat.html>`_.
Parameters
----------
quat
The quaternion which is to be converted.
Returns
-------
List[np.ndarray]
Gives back the Rotation matrix representation, returned as a 3-by-3
matrix or 3-by-3-by-N multidimensional array.
"""
quat_inv = quaternion_conjugate(quat)
return [
quaternion_mult(quat, [0, *basis], quat_inv)[1:]
for basis in [
[1, 0, 0],
[0, 1, 0],
[0, 0, 1],
]
]
def rotation_matrix(
angle: float, axis: np.ndarray, homogeneous: bool = False
) -> np.ndarray:
"""
Rotation in R^3 about a specified axis of rotation.
"""
about_z = rotation_about_z(angle)
z_to_axis = z_to_vector(axis)
axis_to_z = np.linalg.inv(z_to_axis)
inhomogeneous_rotation_matrix = reduce(np.dot, [z_to_axis, about_z, axis_to_z])
if not homogeneous:
return inhomogeneous_rotation_matrix
else:
rotation_matrix = np.eye(4)
rotation_matrix[:3, :3] = inhomogeneous_rotation_matrix
return rotation_matrix
def rotation_about_z(angle: float) -> List[List[float]]:
"""Returns a rotation matrix for a given angle.
Parameters
----------
angle : float
Angle for the rotation matrix.
Returns
-------
List[float]
Gives back the rotated matrix.
"""
return [
[np.cos(angle), -np.sin(angle), 0],
[np.sin(angle), np.cos(angle), 0],
[0, 0, 1],
]
def z_to_vector(vector: np.ndarray) -> np.ndarray:
"""
Returns some matrix in SO(3) which takes the z-axis to the
(normalized) vector provided as an argument
"""
norm = np.linalg.norm(vector)
if norm == 0:
return np.identity(3)
v = np.array(vector) / norm
phi = np.arccos(v[2])
if any(v[:2]):
# projection of vector to unit circle
axis_proj = v[:2] / np.linalg.norm(v[:2])
theta = np.arccos(axis_proj[0])
if axis_proj[1] < 0:
theta = -theta
else:
theta = 0
phi_down = np.array(
[[np.cos(phi), 0, np.sin(phi)], [0, 1, 0], [-np.sin(phi), 0, np.cos(phi)]]
)
return np.dot(rotation_about_z(theta), phi_down)
def angle_of_vector(vector: Sequence[float]) -> float:
"""Returns polar coordinate theta when vector is projected on xy plane.
Parameters
----------
vector
The vector to find the angle for.
Returns
-------
float
The angle of the vector projected.
"""
if config.renderer == "opengl":
return np.angle(complex(*vector[:2]))
else:
z = complex(*vector[:2])
if z == 0:
return 0
return np.angle(complex(*vector[:2]))
def angle_between_vectors(v1: np.ndarray, v2: np.ndarray) -> np.ndarray:
"""Returns the angle between two vectors.
This angle will always be between 0 and pi
Parameters
----------
v1
The first vector.
v2
The second vector.
Returns
-------
np.ndarray
The angle between the vectors.
"""
return 2 * np.arctan2(
np.linalg.norm(normalize(v1) - normalize(v2)),
np.linalg.norm(normalize(v1) + normalize(v2)),
)
def project_along_vector(point: float, vector: np.ndarray) -> np.ndarray:
"""Projects a vector along a point.
Parameters
----------
point
The point to be project from.
vector
The vector which has to projected.
Returns
-------
np.ndarray
A dot product of the point and vector.
"""
matrix = np.identity(3) - np.outer(vector, vector)
return np.dot(point, matrix.T)
def normalize_along_axis(array: np.ndarray, axis: np.ndarray) -> np.ndarray:
"""Normalizes an array with the provided axis.
Parameters
----------
array
The array which has to be normalized.
axis
The axis to be normalized to.
Returns
-------
np.ndarray
Array which has been normalized according to the axis.
"""
norms = np.sqrt((array * array).sum(axis))
norms[norms == 0] = 1
buffed_norms = np.repeat(norms, array.shape[axis]).reshape(array.shape)
array /= buffed_norms
return array
def get_unit_normal(v1: np.ndarray, v2: np.ndarray, tol: float = 1e-6) -> np.ndarray:
"""Gets the unit normal of the vectors.
Parameters
----------
v1
The first vector.
v2
The second vector
tol
[description], by default 1e-6
Returns
-------
np.ndarray
The normal of the two vectors.
"""
if config.renderer == "opengl":
v1 = normalize(v1)
v2 = normalize(v2)
cp = np.cross(v1, v2)
cp_norm = np.linalg.norm(cp)
if cp_norm < tol:
# Vectors align, so find a normal to them in the plane shared with the z-axis
new_cp = np.cross(np.cross(v1, OUT), v1)
new_cp_norm = np.linalg.norm(new_cp)
if new_cp_norm < tol:
return DOWN
return new_cp / new_cp_norm
return cp / cp_norm
else:
return normalize(np.cross(v1, v2))
###
def compass_directions(n: int = 4, start_vect: np.ndarray = RIGHT) -> np.ndarray:
"""Finds the cardinal directions using tau.
Parameters
----------
n
The amount to be rotated, by default 4
start_vect
The direction for the angle to start with, by default RIGHT
Returns
-------
np.ndarray
The angle which has been rotated.
"""
angle = TAU / n
return np.array([rotate_vector(start_vect, k * angle) for k in range(n)])
def regular_vertices(
n: int, *, radius: float = 1, start_angle: Optional[float] = None
) -> Tuple[np.ndarray, float]:
"""Generates regularly spaced vertices around a circle centered at the origin.
Parameters
----------
n
The number of vertices
radius
The radius of the circle that the vertices are placed on.
start_angle
The angle the vertices start at.
If unspecified, for even ``n`` values, ``0`` will be used.
For odd ``n`` values, 90 degrees is used.
Returns
-------
vertices : :class:`numpy.ndarray`
The regularly spaced vertices.
start_angle : :class:`float`
The angle the vertices start at.
"""
if start_angle is None:
if n % 2 == 0:
start_angle = 0
else:
start_angle = TAU / 4
start_vector = rotate_vector(RIGHT * radius, start_angle)
vertices = compass_directions(n, start_vector)
return vertices, start_angle
def center_of_mass(points: Sequence[float]) -> np.ndarray:
"""Gets the center of mass of the points in space.
Parameters
----------
points
The points to find the center of mass from.
Returns
-------
np.ndarray
The center of mass of the points.
"""
points = [np.array(point).astype("float") for point in points]
return sum(points) / len(points)
def midpoint(
point1: Sequence[float], point2: Sequence[float]
) -> Union[float, np.ndarray]:
"""Gets the midpoint of two points.
Parameters
----------
point1
The first point.
point2
The second point.
Returns
-------
Union[float, np.ndarray]
The midpoint of the points
"""
return center_of_mass([point1, point2])
def line_intersection(line1: Sequence[float], line2: Sequence[float]) -> np.ndarray:
"""Returns intersection point of two lines, each defined with
a pair of vectors determining the end points.
Parameters
----------
line1
The first line.
line2
The second line.
Returns
-------
np.ndarray
The intersection points of the two lines which are intersecting.
Raises
------
ValueError
Error is produced if the two lines don't intersect with each other
"""
x_diff = (line1[0][0] - line1[1][0], line2[0][0] - line2[1][0])
y_diff = (line1[0][1] - line1[1][1], line2[0][1] - line2[1][1])
div = det(x_diff, y_diff)
if div == 0:
raise ValueError("Lines do not intersect")
d = (det(*line1), det(*line2))
x = det(d, x_diff) / div
y = det(d, y_diff) / div
return np.array([x, y, 0])
def find_intersection(p0, v0, p1, v1, threshold=1e-5) -> np.ndarray:
"""
Return the intersection of a line passing through p0 in direction v0
with one passing through p1 in direction v1. (Or array of intersections
from arrays of such points/directions).
For 3d values, it returns the point on the ray p0 + v0 * t closest to the
ray p1 + v1 * t
"""
p0 = np.array(p0, ndmin=2)
v0 = np.array(v0, ndmin=2)
p1 = np.array(p1, ndmin=2)
v1 = np.array(v1, ndmin=2)
m, n = np.shape(p0)
assert n in [2, 3]
numerator = np.cross(v1, p1 - p0)
denominator = np.cross(v1, v0)
if n == 3:
d = len(np.shape(numerator))
new_numerator = np.multiply(numerator, numerator).sum(d - 1)
new_denominator = np.multiply(denominator, numerator).sum(d - 1)
numerator, denominator = new_numerator, new_denominator
denominator[abs(denominator) < threshold] = np.inf # So that ratio goes to 0 there
ratio = numerator / denominator
ratio = np.repeat(ratio, n).reshape((m, n))
return p0 + ratio * v0
def shoelace(x_y: np.ndarray) -> float:
"""2D implementation of the shoelace formula.
Returns
-------
:class:`float`
Returns signed area.
"""
x = x_y[:, 0]
y = x_y[:, 1]
area = 0.5 * np.array(np.dot(x, np.roll(y, 1)) - np.dot(y, np.roll(x, 1)))
return area
def shoelace_direction(x_y: np.ndarray) -> str:
"""
Uses the area determined by the shoelace method to determine whether
the input set of points is directed clockwise or counterclockwise.
Returns
-------
:class:`str`
Either ``"CW"`` or ``"CCW"``.
"""
area = shoelace(x_y)
return "CW" if area > 0 else "CCW"
def earclip_triangulation(verts: np.ndarray, ring_ends: list) -> list:
"""Returns a list of indices giving a triangulation
of a polygon, potentially with holes.
Parameters
----------
verts
verts is a numpy array of points.
ring_ends
ring_ends is a list of indices indicating where
the ends of new paths are.
Returns
-------
list
A list of indices giving a triangulation of a polygon.
"""
# First, connect all the rings so that the polygon
# with holes is instead treated as a (very convex)
# polygon with one edge. Do this by drawing connections
# between rings close to each other
rings = [list(range(e0, e1)) for e0, e1 in zip([0, *ring_ends], ring_ends)]
attached_rings = rings[:1]
detached_rings = rings[1:]
loop_connections = {}
while detached_rings:
i_range, j_range = [
list(
filter(
# Ignore indices that are already being
# used to draw some connection
lambda i: i not in loop_connections,
it.chain(*ring_group),
)
)
for ring_group in (attached_rings, detached_rings)
]
# Closest point on the attached rings to an estimated midpoint
# of the detached rings
tmp_j_vert = midpoint(verts[j_range[0]], verts[j_range[len(j_range) // 2]])
i = min(i_range, key=lambda i: norm_squared(verts[i] - tmp_j_vert))
# Closest point of the detached rings to the aforementioned
# point of the attached rings
j = min(j_range, key=lambda j: norm_squared(verts[i] - verts[j]))
# Recalculate i based on new j
i = min(i_range, key=lambda i: norm_squared(verts[i] - verts[j]))
# Remember to connect the polygon at these points
loop_connections[i] = j
loop_connections[j] = i
# Move the ring which j belongs to from the
# attached list to the detached list
new_ring = next(filter(lambda ring: ring[0] <= j < ring[-1], detached_rings))
detached_rings.remove(new_ring)
attached_rings.append(new_ring)
# Setup linked list
after = []
end0 = 0
for end1 in ring_ends:
after.extend(range(end0 + 1, end1))
after.append(end0)
end0 = end1
# Find an ordering of indices walking around the polygon
indices = []
i = 0
for _ in range(len(verts) + len(ring_ends) - 1):
# starting = False
if i in loop_connections:
j = loop_connections[i]
indices.extend([i, j])
i = after[j]
else:
indices.append(i)
i = after[i]
if i == 0:
break
meta_indices = earcut(verts[indices, :2], [len(indices)])
return [indices[mi] for mi in meta_indices]
def perpendicular_bisector(
line: Sequence[np.ndarray], norm_vector=OUT
) -> Sequence[np.ndarray]:
"""Returns a list of two points that correspond
to the ends of the perpendicular bisector of the
two points given.
Parameters
----------
line
a list of two numpy array points (corresponding
to the ends of a line).
norm_vector
the vector perpendicular to both the line given
and the perpendicular bisector.
Returns
-------
list
A list of two numpy array points that correspond
to the ends of the perpendicular bisector
"""
p1 = line[0]
p2 = line[1]
direction = np.cross(p1 - p2, norm_vector)
m = midpoint(p1, p2)
return [m + direction, m - direction]
| [
37811,
18274,
879,
5499,
329,
734,
12,
290,
1115,
12,
19577,
30104,
526,
15931,
198,
198,
834,
439,
834,
796,
685,
198,
220,
220,
220,
366,
421,
9205,
295,
62,
16680,
1600,
198,
220,
220,
220,
366,
421,
9205,
295,
62,
6738,
62,
9248,
62,
22704,
1600,
198,
220,
220,
220,
366,
9248,
62,
22704,
62,
6738,
62,
421,
9205,
295,
1600,
198,
220,
220,
220,
366,
421,
9205,
295,
62,
1102,
31761,
378,
1600,
198,
220,
220,
220,
366,
10599,
378,
62,
31364,
1600,
198,
220,
220,
220,
366,
400,
624,
62,
10989,
27923,
1600,
198,
220,
220,
220,
366,
10599,
341,
62,
6759,
8609,
1600,
198,
220,
220,
220,
366,
10599,
341,
62,
10755,
62,
89,
1600,
198,
220,
220,
220,
366,
89,
62,
1462,
62,
31364,
1600,
198,
220,
220,
220,
366,
9248,
62,
1659,
62,
31364,
1600,
198,
220,
220,
220,
366,
9248,
62,
23395,
62,
303,
5217,
1600,
198,
220,
220,
220,
366,
16302,
62,
24176,
62,
31364,
1600,
198,
220,
220,
220,
366,
11265,
1096,
1600,
198,
220,
220,
220,
366,
1136,
62,
20850,
62,
11265,
1600,
198,
220,
220,
220,
366,
5589,
562,
62,
12942,
507,
1600,
198,
220,
220,
220,
366,
16338,
62,
1851,
1063,
1600,
198,
220,
220,
220,
366,
41887,
62,
1462,
62,
49,
18,
1600,
198,
220,
220,
220,
366,
49,
18,
62,
1462,
62,
41887,
1600,
198,
220,
220,
220,
366,
41887,
62,
20786,
62,
1462,
62,
49,
18,
62,
20786,
1600,
198,
220,
220,
220,
366,
16159,
62,
1659,
62,
22208,
1600,
198,
220,
220,
220,
366,
13602,
4122,
1600,
198,
220,
220,
220,
366,
19796,
62,
3849,
5458,
1600,
198,
220,
220,
220,
366,
1370,
62,
3849,
5458,
1600,
198,
220,
220,
220,
366,
1136,
62,
86,
6020,
62,
17618,
1600,
198,
220,
220,
220,
366,
19692,
17,
67,
1600,
198,
220,
220,
220,
366,
451,
15036,
62,
28461,
648,
1741,
1600,
198,
220,
220,
220,
366,
525,
37038,
13174,
62,
41907,
9250,
1600,
198,
60,
628,
198,
11748,
340,
861,
10141,
355,
340,
198,
11748,
10688,
198,
6738,
1257,
310,
10141,
1330,
4646,
198,
6738,
19720,
1330,
7343,
11,
32233,
11,
45835,
11,
309,
29291,
11,
4479,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
3975,
3524,
62,
451,
8968,
1330,
1333,
648,
5039,
62,
22468,
2624,
355,
1027,
8968,
198,
198,
6738,
11485,
1330,
4566,
198,
6738,
11485,
9979,
1187,
1330,
30320,
11,
16289,
11,
30434,
11,
33621,
11,
21664,
52,
198,
6738,
11485,
26791,
13,
2676,
2977,
1330,
15909,
62,
79,
3468,
628,
198,
198,
2,
2264,
9205,
507,
198,
2,
16926,
46,
11,
3494,
627,
9205,
295,
2099,
628,
198,
4299,
627,
9205,
295,
62,
16680,
7,
198,
220,
220,
220,
1635,
421,
1381,
25,
45835,
58,
22468,
4357,
198,
8,
4613,
4479,
58,
37659,
13,
358,
18747,
11,
7343,
58,
38176,
58,
22468,
11,
45941,
13,
358,
18747,
11907,
5974,
198,
220,
220,
220,
37227,
38,
1039,
262,
11582,
1720,
286,
262,
627,
9205,
507,
2810,
13,
198,
220,
220,
220,
1114,
517,
1321,
11,
2198,
4600,
5661,
15312,
2443,
198,
220,
220,
220,
1279,
5450,
1378,
268,
13,
31266,
13,
2398,
14,
15466,
14,
4507,
9205,
295,
29,
63,
44807,
628,
220,
220,
220,
16409,
198,
220,
220,
220,
35656,
198,
220,
220,
220,
4479,
58,
37659,
13,
358,
18747,
11,
7343,
58,
38176,
58,
22468,
11,
45941,
13,
358,
18747,
11907,
60,
198,
220,
220,
220,
220,
220,
220,
220,
16409,
257,
1351,
286,
1720,
286,
734,
627,
9205,
507,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
611,
4566,
13,
10920,
11882,
6624,
366,
404,
1516,
75,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
611,
18896,
7,
421,
1381,
8,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
685,
16,
11,
657,
11,
657,
11,
657,
60,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
627,
1381,
58,
15,
60,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1306,
62,
421,
265,
287,
627,
1381,
58,
16,
25,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
266,
16,
11,
2124,
16,
11,
331,
16,
11,
1976,
16,
796,
1255,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
266,
17,
11,
2124,
17,
11,
331,
17,
11,
1976,
17,
796,
1306,
62,
421,
265,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
685,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
266,
16,
1635,
266,
17,
532,
2124,
16,
1635,
2124,
17,
532,
331,
16,
1635,
331,
17,
532,
1976,
16,
1635,
1976,
17,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
266,
16,
1635,
2124,
17,
1343,
2124,
16,
1635,
266,
17,
1343,
331,
16,
1635,
1976,
17,
532,
1976,
16,
1635,
331,
17,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
266,
16,
1635,
331,
17,
1343,
331,
16,
1635,
266,
17,
1343,
1976,
16,
1635,
2124,
17,
532,
2124,
16,
1635,
1976,
17,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
266,
16,
1635,
1976,
17,
1343,
1976,
16,
1635,
266,
17,
1343,
2124,
16,
1635,
331,
17,
532,
331,
16,
1635,
2124,
17,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2361,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
1255,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
10662,
16,
796,
627,
1381,
58,
15,
60,
198,
220,
220,
220,
220,
220,
220,
220,
10662,
17,
796,
627,
1381,
58,
16,
60,
628,
220,
220,
220,
220,
220,
220,
220,
266,
16,
11,
2124,
16,
11,
331,
16,
11,
1976,
16,
796,
10662,
16,
198,
220,
220,
220,
220,
220,
220,
220,
266,
17,
11,
2124,
17,
11,
331,
17,
11,
1976,
17,
796,
10662,
17,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
45941,
13,
18747,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
685,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
266,
16,
1635,
266,
17,
532,
2124,
16,
1635,
2124,
17,
532,
331,
16,
1635,
331,
17,
532,
1976,
16,
1635,
1976,
17,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
266,
16,
1635,
2124,
17,
1343,
2124,
16,
1635,
266,
17,
1343,
331,
16,
1635,
1976,
17,
532,
1976,
16,
1635,
331,
17,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
266,
16,
1635,
331,
17,
1343,
331,
16,
1635,
266,
17,
1343,
1976,
16,
1635,
2124,
17,
532,
2124,
16,
1635,
1976,
17,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
266,
16,
1635,
1976,
17,
1343,
1976,
16,
1635,
266,
17,
1343,
2124,
16,
1635,
331,
17,
532,
331,
16,
1635,
2124,
17,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2361,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
198,
4299,
627,
9205,
295,
62,
6738,
62,
9248,
62,
22704,
7,
198,
220,
220,
220,
9848,
25,
12178,
11,
16488,
25,
45941,
13,
358,
18747,
11,
16488,
62,
11265,
1143,
25,
20512,
796,
10352,
198,
8,
4613,
7343,
58,
22468,
5974,
198,
220,
220,
220,
37227,
38,
1039,
257,
627,
9205,
295,
422,
281,
9848,
290,
281,
16488,
13,
198,
220,
220,
220,
1114,
517,
1321,
11,
2198,
4600,
5661,
15312,
2443,
198,
220,
220,
220,
1279,
5450,
1378,
268,
13,
31266,
13,
2398,
14,
15466,
14,
3103,
9641,
62,
23395,
62,
421,
9205,
507,
62,
392,
62,
36,
18173,
62,
27787,
29,
63,
44807,
628,
220,
220,
220,
40117,
198,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
9848,
198,
220,
220,
220,
220,
220,
220,
220,
383,
9848,
329,
262,
627,
9205,
295,
13,
198,
220,
220,
220,
16488,
198,
220,
220,
220,
220,
220,
220,
220,
383,
16488,
329,
262,
627,
9205,
295,
198,
220,
220,
220,
16488,
62,
11265,
1143,
1058,
20512,
11,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
47719,
1771,
262,
16488,
318,
39279,
11,
416,
4277,
10352,
628,
220,
220,
220,
16409,
198,
220,
220,
220,
35656,
198,
220,
220,
220,
7343,
58,
22468,
60,
198,
220,
220,
220,
220,
220,
220,
220,
402,
1083,
736,
257,
627,
9205,
295,
422,
262,
9848,
290,
16488,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
611,
4566,
13,
10920,
11882,
6624,
366,
404,
1516,
75,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
611,
407,
16488,
62,
11265,
1143,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16488,
796,
3487,
1096,
7,
22704,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
685,
11018,
13,
6966,
7,
9248,
1220,
362,
828,
1635,
7,
11018,
13,
31369,
7,
9248,
1220,
362,
8,
1635,
16488,
15437,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
45941,
13,
33295,
7,
37659,
13,
6966,
7,
9248,
1220,
362,
828,
45941,
13,
31369,
7,
9248,
1220,
362,
8,
1635,
3487,
1096,
7,
22704,
4008,
628,
198,
4299,
9848,
62,
22704,
62,
6738,
62,
421,
9205,
295,
7,
421,
9205,
295,
25,
45835,
58,
22468,
12962,
4613,
45835,
58,
22468,
5974,
198,
220,
220,
220,
37227,
38,
1039,
9848,
290,
16488,
422,
257,
627,
9205,
295,
13,
628,
220,
220,
220,
40117,
198,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
627,
9205,
295,
198,
220,
220,
220,
220,
220,
220,
220,
383,
627,
9205,
295,
422,
543,
356,
651,
262,
9848,
290,
16488,
13,
628,
220,
220,
220,
16409,
198,
220,
220,
220,
35656,
198,
220,
220,
220,
45835,
58,
22468,
60,
198,
220,
220,
220,
220,
220,
220,
220,
402,
1083,
262,
9848,
290,
16488,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
16488,
796,
3487,
1096,
7,
421,
9205,
295,
58,
16,
25,
4357,
2121,
62,
1891,
28,
37659,
13,
18747,
26933,
16,
11,
657,
11,
657,
60,
4008,
198,
220,
220,
220,
9848,
796,
362,
1635,
45941,
13,
283,
535,
418,
7,
421,
9205,
295,
58,
15,
12962,
198,
220,
220,
220,
611,
9848,
1875,
21664,
52,
1220,
362,
25,
198,
220,
220,
220,
220,
220,
220,
220,
9848,
796,
21664,
52,
532,
9848,
198,
220,
220,
220,
1441,
9848,
11,
16488,
628,
198,
4299,
627,
9205,
295,
62,
1102,
31761,
378,
7,
421,
9205,
295,
25,
45835,
58,
22468,
12962,
4613,
45941,
13,
358,
18747,
25,
198,
220,
220,
220,
37227,
38052,
329,
4917,
262,
11644,
1018,
378,
286,
262,
627,
9205,
295,
628,
220,
220,
220,
40117,
198,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
627,
9205,
295,
198,
220,
220,
220,
220,
220,
220,
220,
383,
627,
9205,
295,
329,
543,
345,
765,
284,
1064,
262,
11644,
1018,
378,
329,
13,
628,
220,
220,
220,
16409,
198,
220,
220,
220,
35656,
198,
220,
220,
220,
45941,
13,
358,
18747,
198,
220,
220,
220,
220,
220,
220,
220,
383,
11644,
1018,
378,
286,
262,
627,
9205,
295,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1255,
796,
45941,
13,
18747,
7,
421,
9205,
295,
8,
198,
220,
220,
220,
1255,
58,
16,
47715,
1635,
28,
532,
16,
198,
220,
220,
220,
1441,
1255,
628,
198,
4299,
23064,
62,
31364,
7,
31364,
25,
45941,
13,
358,
18747,
11,
9848,
25,
493,
11,
16488,
25,
45941,
13,
358,
18747,
796,
16289,
8,
4613,
45941,
13,
358,
18747,
25,
198,
220,
220,
220,
37227,
22203,
329,
24012,
257,
15879,
13,
628,
220,
220,
220,
40117,
198,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
15879,
198,
220,
220,
220,
220,
220,
220,
220,
383,
15879,
284,
307,
38375,
13,
198,
220,
220,
220,
9848,
198,
220,
220,
220,
220,
220,
220,
220,
383,
9848,
284,
307,
38375,
416,
13,
198,
220,
220,
220,
16488,
198,
220,
220,
220,
220,
220,
220,
220,
383,
16488,
284,
307,
38375,
11,
416,
4277,
16289,
628,
220,
220,
220,
16409,
198,
220,
220,
220,
35656,
198,
220,
220,
220,
45941,
13,
358,
18747,
198,
220,
220,
220,
220,
220,
220,
220,
383,
38375,
15879,
351,
2810,
9848,
290,
16488,
13,
628,
220,
220,
220,
7567,
2696,
198,
220,
220,
220,
40103,
198,
220,
220,
220,
11052,
12331,
198,
220,
220,
220,
220,
220,
220,
220,
1002,
15879,
318,
407,
286,
15793,
362,
393,
513,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
611,
18896,
7,
31364,
8,
6624,
362,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
5765,
3716,
3146,
986,
13893,
1521,
407,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
796,
3716,
46491,
31364,
8,
1635,
45941,
13,
11201,
7,
41887,
7,
15,
11,
9848,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
45941,
13,
18747,
26933,
89,
13,
5305,
11,
1976,
13,
48466,
12962,
198,
220,
220,
220,
1288,
361,
18896,
7,
31364,
8,
6624,
513,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
5765,
627,
9205,
507,
986,
13893,
1521,
407,
198,
220,
220,
220,
220,
220,
220,
220,
627,
265,
796,
627,
9205,
295,
62,
6738,
62,
9248,
62,
22704,
7,
9248,
11,
16488,
8,
198,
220,
220,
220,
220,
220,
220,
220,
627,
265,
62,
16340,
796,
627,
9205,
295,
62,
1102,
31761,
378,
7,
421,
265,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1720,
796,
4646,
7,
421,
9205,
295,
62,
16680,
11,
685,
421,
265,
11,
45941,
13,
33295,
7,
15,
11,
15879,
828,
627,
265,
62,
16340,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
1720,
58,
16,
47715,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
5298,
11052,
12331,
7203,
31364,
1276,
307,
286,
15793,
362,
393,
513,
4943,
628,
198,
198,
4299,
13179,
62,
6759,
8609,
62,
7645,
3455,
62,
6738,
62,
421,
9205,
295,
7,
421,
265,
25,
45941,
13,
358,
18747,
8,
4613,
7343,
58,
37659,
13,
358,
18747,
5974,
198,
220,
220,
220,
37227,
3103,
24040,
262,
627,
9205,
295,
11,
627,
265,
11,
284,
281,
7548,
13179,
17593,
10552,
13,
198,
220,
220,
220,
1114,
517,
1321,
11,
2198,
4600,
5661,
2443,
198,
220,
220,
220,
1279,
5450,
1378,
259,
13,
11018,
5225,
13,
785,
14,
16794,
14,
24255,
14,
5420,
14,
421,
9205,
295,
13,
10599,
6759,
13,
6494,
29,
63,
44807,
628,
220,
220,
220,
40117,
198,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
627,
265,
198,
220,
220,
220,
220,
220,
220,
220,
383,
627,
9205,
295,
543,
318,
284,
307,
11513,
13,
628,
220,
220,
220,
16409,
198,
220,
220,
220,
35656,
198,
220,
220,
220,
7343,
58,
37659,
13,
358,
18747,
60,
198,
220,
220,
220,
220,
220,
220,
220,
402,
1083,
736,
262,
371,
14221,
17593,
10552,
11,
4504,
355,
257,
513,
12,
1525,
12,
18,
198,
220,
220,
220,
220,
220,
220,
220,
17593,
393,
513,
12,
1525,
12,
18,
12,
1525,
12,
45,
1963,
312,
16198,
7177,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
627,
265,
62,
16340,
796,
627,
9205,
295,
62,
1102,
31761,
378,
7,
421,
265,
8,
198,
220,
220,
220,
1441,
685,
198,
220,
220,
220,
220,
220,
220,
220,
627,
9205,
295,
62,
16680,
7,
421,
265,
11,
685,
15,
11,
1635,
12093,
271,
4357,
627,
265,
62,
16340,
38381,
16,
47715,
198,
220,
220,
220,
220,
220,
220,
220,
329,
4308,
287,
685,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
685,
16,
11,
657,
11,
657,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
685,
15,
11,
352,
11,
657,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
685,
15,
11,
657,
11,
352,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
2361,
198,
220,
220,
220,
2361,
628,
628,
198,
4299,
13179,
62,
6759,
8609,
7,
198,
220,
220,
220,
9848,
25,
12178,
11,
16488,
25,
45941,
13,
358,
18747,
11,
3488,
32269,
25,
20512,
796,
10352,
198,
8,
4613,
45941,
13,
358,
18747,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
371,
14221,
287,
371,
61,
18,
546,
257,
7368,
16488,
286,
13179,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
546,
62,
89,
796,
13179,
62,
10755,
62,
89,
7,
9248,
8,
198,
220,
220,
220,
1976,
62,
1462,
62,
22704,
796,
1976,
62,
1462,
62,
31364,
7,
22704,
8,
198,
220,
220,
220,
16488,
62,
1462,
62,
89,
796,
45941,
13,
75,
1292,
70,
13,
16340,
7,
89,
62,
1462,
62,
22704,
8,
198,
220,
220,
220,
25783,
296,
32269,
62,
10599,
341,
62,
6759,
8609,
796,
4646,
7,
37659,
13,
26518,
11,
685,
89,
62,
1462,
62,
22704,
11,
546,
62,
89,
11,
16488,
62,
1462,
62,
89,
12962,
198,
220,
220,
220,
611,
407,
3488,
32269,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
25783,
296,
32269,
62,
10599,
341,
62,
6759,
8609,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
13179,
62,
6759,
8609,
796,
45941,
13,
25379,
7,
19,
8,
198,
220,
220,
220,
220,
220,
220,
220,
13179,
62,
6759,
8609,
58,
25,
18,
11,
1058,
18,
60,
796,
25783,
296,
32269,
62,
10599,
341,
62,
6759,
8609,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
13179,
62,
6759,
8609,
628,
198,
4299,
13179,
62,
10755,
62,
89,
7,
9248,
25,
12178,
8,
4613,
7343,
58,
8053,
58,
22468,
60,
5974,
198,
220,
220,
220,
37227,
35561,
257,
13179,
17593,
329,
257,
1813,
9848,
13,
628,
220,
220,
220,
40117,
198,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
9848,
1058,
12178,
198,
220,
220,
220,
220,
220,
220,
220,
42375,
329,
262,
13179,
17593,
13,
628,
220,
220,
220,
16409,
198,
220,
220,
220,
35656,
198,
220,
220,
220,
7343,
58,
22468,
60,
198,
220,
220,
220,
220,
220,
220,
220,
402,
1083,
736,
262,
38375,
17593,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1441,
685,
198,
220,
220,
220,
220,
220,
220,
220,
685,
37659,
13,
6966,
7,
9248,
828,
532,
37659,
13,
31369,
7,
9248,
828,
657,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
685,
37659,
13,
31369,
7,
9248,
828,
45941,
13,
6966,
7,
9248,
828,
657,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
685,
15,
11,
657,
11,
352,
4357,
198,
220,
220,
220,
2361,
628,
198,
4299,
1976,
62,
1462,
62,
31364,
7,
31364,
25,
45941,
13,
358,
18747,
8,
4613,
45941,
13,
358,
18747,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
16409,
617,
17593,
287,
12809,
7,
18,
8,
543,
2753,
262,
1976,
12,
22704,
284,
262,
198,
220,
220,
220,
357,
11265,
1143,
8,
15879,
2810,
355,
281,
4578,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
2593,
796,
45941,
13,
75,
1292,
70,
13,
27237,
7,
31364,
8,
198,
220,
220,
220,
611,
2593,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
45941,
13,
738,
414,
7,
18,
8,
198,
220,
220,
220,
410,
796,
45941,
13,
18747,
7,
31364,
8,
1220,
2593,
198,
220,
220,
220,
872,
72,
796,
45941,
13,
283,
535,
418,
7,
85,
58,
17,
12962,
198,
220,
220,
220,
611,
597,
7,
85,
58,
25,
17,
60,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
20128,
286,
15879,
284,
4326,
9197,
198,
220,
220,
220,
220,
220,
220,
220,
16488,
62,
1676,
73,
796,
410,
58,
25,
17,
60,
1220,
45941,
13,
75,
1292,
70,
13,
27237,
7,
85,
58,
25,
17,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
262,
8326,
796,
45941,
13,
283,
535,
418,
7,
22704,
62,
1676,
73,
58,
15,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
611,
16488,
62,
1676,
73,
58,
16,
60,
1279,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
262,
8326,
796,
532,
1169,
8326,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
262,
8326,
796,
657,
198,
220,
220,
220,
872,
72,
62,
2902,
796,
45941,
13,
18747,
7,
198,
220,
220,
220,
220,
220,
220,
220,
16410,
37659,
13,
6966,
7,
34846,
828,
657,
11,
45941,
13,
31369,
7,
34846,
8,
4357,
685,
15,
11,
352,
11,
657,
4357,
25915,
37659,
13,
31369,
7,
34846,
828,
657,
11,
45941,
13,
6966,
7,
34846,
8,
11907,
198,
220,
220,
220,
1267,
198,
220,
220,
220,
1441,
45941,
13,
26518,
7,
10599,
341,
62,
10755,
62,
89,
7,
1169,
8326,
828,
872,
72,
62,
2902,
8,
628,
198,
4299,
9848,
62,
1659,
62,
31364,
7,
31364,
25,
45835,
58,
22468,
12962,
4613,
12178,
25,
198,
220,
220,
220,
37227,
35561,
13559,
20435,
262,
8326,
618,
15879,
318,
13301,
319,
2124,
88,
6614,
13,
628,
220,
220,
220,
40117,
198,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
15879,
198,
220,
220,
220,
220,
220,
220,
220,
383,
15879,
284,
1064,
262,
9848,
329,
13,
628,
220,
220,
220,
16409,
198,
220,
220,
220,
35656,
198,
220,
220,
220,
12178,
198,
220,
220,
220,
220,
220,
220,
220,
383,
9848,
286,
262,
15879,
13301,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
611,
4566,
13,
10920,
11882,
6624,
366,
404,
1516,
75,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
45941,
13,
9248,
7,
41887,
46491,
31364,
58,
25,
17,
60,
4008,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
796,
3716,
46491,
31364,
58,
25,
17,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
611,
1976,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
657,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
45941,
13,
9248,
7,
41887,
46491,
31364,
58,
25,
17,
60,
4008,
628,
198,
4299,
9848,
62,
23395,
62,
303,
5217,
7,
85,
16,
25,
45941,
13,
358,
18747,
11,
410,
17,
25,
45941,
13,
358,
18747,
8,
4613,
45941,
13,
358,
18747,
25,
198,
220,
220,
220,
37227,
35561,
262,
9848,
1022,
734,
30104,
13,
198,
220,
220,
220,
770,
9848,
481,
1464,
307,
1022,
657,
290,
31028,
628,
220,
220,
220,
40117,
198,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
410,
16,
198,
220,
220,
220,
220,
220,
220,
220,
383,
717,
15879,
13,
198,
220,
220,
220,
410,
17,
198,
220,
220,
220,
220,
220,
220,
220,
383,
1218,
15879,
13,
628,
220,
220,
220,
16409,
198,
220,
220,
220,
35656,
198,
220,
220,
220,
45941,
13,
358,
18747,
198,
220,
220,
220,
220,
220,
220,
220,
383,
9848,
1022,
262,
30104,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
1441,
362,
1635,
45941,
13,
283,
310,
272,
17,
7,
198,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
75,
1292,
70,
13,
27237,
7,
11265,
1096,
7,
85,
16,
8,
532,
3487,
1096,
7,
85,
17,
36911,
198,
220,
220,
220,
220,
220,
220,
220,
45941,
13,
75,
1292,
70,
13,
27237,
7,
11265,
1096,
7,
85,
16,
8,
1343,
3487,
1096,
7,
85,
17,
36911,
198,
220,
220,
220,
1267,
628,
198,
4299,
1628,
62,
24176,
62,
31364,
7,
4122,
25,
12178,
11,
15879,
25,
45941,
13,
358,
18747,
8,
4613,
45941,
13,
358,
18747,
25,
198,
220,
220,
220,
37227,
16775,
82,
257,
15879,
1863,
257,
966,
13,
628,
220,
220,
220,
40117,
198,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
966,
198,
220,
220,
220,
220,
220,
220,
220,
383,
966,
284,
307,
1628,
422,
13,
198,
220,
220,
220,
15879,
198,
220,
220,
220,
220,
220,
220,
220,
383,
15879,
543,
468,
284,
13301,
13,
628,
220,
220,
220,
16409,
198,
220,
220,
220,
35656,
198,
220,
220,
220,
45941,
13,
358,
18747,
198,
220,
220,
220,
220,
220,
220,
220,
317,
16605,
1720,
286,
262,
966,
290,
15879,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
17593,
796,
45941,
13,
738,
414,
7,
18,
8,
532,
45941,
13,
39605,
7,
31364,
11,
15879,
8,
198,
220,
220,
220,
1441,
45941,
13,
26518,
7,
4122,
11,
17593,
13,
51,
8,
628,
198,
198,
4299,
3487,
1096,
62,
24176,
62,
22704,
7,
18747,
25,
45941,
13,
358,
18747,
11,
16488,
25,
45941,
13,
358,
18747,
8,
4613,
45941,
13,
358,
18747,
25,
198,
220,
220,
220,
37227,
26447,
4340,
281,
7177,
351,
262,
2810,
16488,
13,
628,
220,
220,
220,
40117,
198,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
7177,
198,
220,
220,
220,
220,
220,
220,
220,
383,
7177,
543,
468,
284,
307,
39279,
13,
198,
220,
220,
220,
16488,
198,
220,
220,
220,
220,
220,
220,
220,
383,
16488,
284,
307,
39279,
284,
13,
628,
220,
220,
220,
16409,
198,
220,
220,
220,
35656,
198,
220,
220,
220,
45941,
13,
358,
18747,
198,
220,
220,
220,
220,
220,
220,
220,
15690,
543,
468,
587,
39279,
1864,
284,
262,
16488,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
19444,
796,
45941,
13,
31166,
17034,
19510,
18747,
1635,
7177,
737,
16345,
7,
22704,
4008,
198,
220,
220,
220,
19444,
58,
27237,
82,
6624,
657,
60,
796,
352,
198,
220,
220,
220,
6940,
276,
62,
27237,
82,
796,
45941,
13,
44754,
7,
27237,
82,
11,
7177,
13,
43358,
58,
22704,
35944,
3447,
1758,
7,
18747,
13,
43358,
8,
198,
220,
220,
220,
7177,
1220,
28,
6940,
276,
62,
27237,
82,
198,
220,
220,
220,
1441,
7177,
628,
198,
4299,
651,
62,
20850,
62,
11265,
7,
85,
16,
25,
45941,
13,
358,
18747,
11,
410,
17,
25,
45941,
13,
358,
18747,
11,
284,
75,
25,
12178,
796,
352,
68,
12,
21,
8,
4613,
45941,
13,
358,
18747,
25,
198,
220,
220,
220,
37227,
38,
1039,
262,
4326,
3487,
286,
262,
30104,
13,
628,
220,
220,
220,
40117,
198,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
410,
16,
198,
220,
220,
220,
220,
220,
220,
220,
383,
717,
15879,
13,
198,
220,
220,
220,
410,
17,
198,
220,
220,
220,
220,
220,
220,
220,
383,
1218,
15879,
198,
220,
220,
220,
284,
75,
198,
220,
220,
220,
220,
220,
220,
220,
685,
11213,
4357,
416,
4277,
352,
68,
12,
21,
628,
220,
220,
220,
16409,
198,
220,
220,
220,
35656,
198,
220,
220,
220,
45941,
13,
358,
18747,
198,
220,
220,
220,
220,
220,
220,
220,
383,
3487,
286,
262,
734,
30104,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
611,
4566,
13,
10920,
11882,
6624,
366,
404,
1516,
75,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
410,
16,
796,
3487,
1096,
7,
85,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
410,
17,
796,
3487,
1096,
7,
85,
17,
8,
198,
220,
220,
220,
220,
220,
220,
220,
31396,
796,
45941,
13,
19692,
7,
85,
16,
11,
410,
17,
8,
198,
220,
220,
220,
220,
220,
220,
220,
31396,
62,
27237,
796,
45941,
13,
75,
1292,
70,
13,
27237,
7,
13155,
8,
198,
220,
220,
220,
220,
220,
220,
220,
611,
31396,
62,
27237,
1279,
284,
75,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
569,
478,
669,
10548,
11,
523,
1064,
257,
3487,
284,
606,
287,
262,
6614,
4888,
351,
262,
1976,
12,
22704,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
649,
62,
13155,
796,
45941,
13,
19692,
7,
37659,
13,
19692,
7,
85,
16,
11,
16289,
828,
410,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
649,
62,
13155,
62,
27237,
796,
45941,
13,
75,
1292,
70,
13,
27237,
7,
3605,
62,
13155,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
649,
62,
13155,
62,
27237,
1279,
284,
75,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
30320,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
649,
62,
13155,
1220,
649,
62,
13155,
62,
27237,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
31396,
1220,
31396,
62,
27237,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
3487,
1096,
7,
37659,
13,
19692,
7,
85,
16,
11,
410,
17,
4008,
628,
198,
21017,
628,
198,
4299,
31855,
62,
12942,
507,
7,
77,
25,
493,
796,
604,
11,
923,
62,
303,
310,
25,
45941,
13,
358,
18747,
796,
33621,
8,
4613,
45941,
13,
358,
18747,
25,
198,
220,
220,
220,
37227,
16742,
82,
262,
38691,
11678,
1262,
256,
559,
13,
628,
220,
220,
220,
40117,
198,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
299,
198,
220,
220,
220,
220,
220,
220,
220,
383,
2033,
284,
307,
38375,
11,
416,
4277,
604,
198,
220,
220,
220,
923,
62,
303,
310,
198,
220,
220,
220,
220,
220,
220,
220,
383,
4571,
329,
262,
9848,
284,
923,
351,
11,
416,
4277,
33621,
628,
220,
220,
220,
16409,
198,
220,
220,
220,
35656,
198,
220,
220,
220,
45941,
13,
358,
18747,
198,
220,
220,
220,
220,
220,
220,
220,
383,
9848,
543,
468,
587,
38375,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
9848,
796,
21664,
52,
1220,
299,
198,
220,
220,
220,
1441,
45941,
13,
18747,
26933,
10599,
378,
62,
31364,
7,
9688,
62,
303,
310,
11,
479,
1635,
9848,
8,
329,
479,
287,
2837,
7,
77,
8,
12962,
628,
198,
4299,
3218,
62,
1851,
1063,
7,
198,
220,
220,
220,
299,
25,
493,
11,
1635,
11,
16874,
25,
12178,
796,
352,
11,
923,
62,
9248,
25,
32233,
58,
22468,
60,
796,
6045,
198,
8,
4613,
309,
29291,
58,
37659,
13,
358,
18747,
11,
12178,
5974,
198,
220,
220,
220,
37227,
8645,
689,
7987,
38980,
9421,
1063,
1088,
257,
9197,
19254,
379,
262,
8159,
13,
628,
220,
220,
220,
40117,
198,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
299,
198,
220,
220,
220,
220,
220,
220,
220,
383,
1271,
286,
9421,
1063,
198,
220,
220,
220,
16874,
198,
220,
220,
220,
220,
220,
220,
220,
383,
16874,
286,
262,
9197,
326,
262,
9421,
1063,
389,
4624,
319,
13,
198,
220,
220,
220,
923,
62,
9248,
198,
220,
220,
220,
220,
220,
220,
220,
383,
9848,
262,
9421,
1063,
923,
379,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1002,
29547,
11,
329,
772,
7559,
77,
15506,
3815,
11,
7559,
15,
15506,
481,
307,
973,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1114,
5629,
7559,
77,
15506,
3815,
11,
4101,
7370,
318,
973,
13,
628,
220,
220,
220,
16409,
198,
220,
220,
220,
35656,
198,
220,
220,
220,
9421,
1063,
1058,
1058,
4871,
25,
63,
77,
32152,
13,
358,
18747,
63,
198,
220,
220,
220,
220,
220,
220,
220,
383,
7987,
38980,
9421,
1063,
13,
198,
220,
220,
220,
923,
62,
9248,
1058,
1058,
4871,
25,
63,
22468,
63,
198,
220,
220,
220,
220,
220,
220,
220,
383,
9848,
262,
9421,
1063,
923,
379,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
611,
923,
62,
9248,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
299,
4064,
362,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
923,
62,
9248,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
923,
62,
9248,
796,
21664,
52,
1220,
604,
628,
220,
220,
220,
923,
62,
31364,
796,
23064,
62,
31364,
7,
49,
9947,
1635,
16874,
11,
923,
62,
9248,
8,
198,
220,
220,
220,
9421,
1063,
796,
31855,
62,
12942,
507,
7,
77,
11,
923,
62,
31364,
8,
628,
220,
220,
220,
1441,
9421,
1063,
11,
923,
62,
9248,
628,
628,
198,
198,
4299,
3641,
62,
1659,
62,
22208,
7,
13033,
25,
45835,
58,
22468,
12962,
4613,
45941,
13,
358,
18747,
25,
198,
220,
220,
220,
37227,
38,
1039,
262,
3641,
286,
2347,
286,
262,
2173,
287,
2272,
13,
628,
220,
220,
220,
40117,
198,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
2173,
198,
220,
220,
220,
220,
220,
220,
220,
383,
2173,
284,
1064,
262,
3641,
286,
2347,
422,
13,
628,
220,
220,
220,
16409,
198,
220,
220,
220,
35656,
198,
220,
220,
220,
45941,
13,
358,
18747,
198,
220,
220,
220,
220,
220,
220,
220,
383,
3641,
286,
2347,
286,
262,
2173,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
2173,
796,
685,
37659,
13,
18747,
7,
4122,
737,
459,
2981,
7203,
22468,
4943,
329,
966,
287,
2173,
60,
198,
220,
220,
220,
1441,
2160,
7,
13033,
8,
1220,
18896,
7,
13033,
8,
628,
198,
4299,
3095,
4122,
7,
198,
220,
220,
220,
966,
16,
25,
45835,
58,
22468,
4357,
966,
17,
25,
45835,
58,
22468,
60,
198,
8,
4613,
4479,
58,
22468,
11,
45941,
13,
358,
18747,
5974,
198,
220,
220,
220,
37227,
38,
1039,
262,
3095,
4122,
286,
734,
2173,
13,
628,
220,
220,
220,
40117,
198,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
966,
16,
198,
220,
220,
220,
220,
220,
220,
220,
383,
717,
966,
13,
198,
220,
220,
220,
966,
17,
198,
220,
220,
220,
220,
220,
220,
220,
383,
1218,
966,
13,
628,
220,
220,
220,
16409,
198,
220,
220,
220,
35656,
198,
220,
220,
220,
4479,
58,
22468,
11,
45941,
13,
358,
18747,
60,
198,
220,
220,
220,
220,
220,
220,
220,
383,
3095,
4122,
286,
262,
2173,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1441,
3641,
62,
1659,
62,
22208,
26933,
4122,
16,
11,
966,
17,
12962,
628,
198,
4299,
1627,
62,
3849,
5458,
7,
1370,
16,
25,
45835,
58,
22468,
4357,
1627,
17,
25,
45835,
58,
22468,
12962,
4613,
45941,
13,
358,
18747,
25,
198,
220,
220,
220,
37227,
35561,
16246,
966,
286,
734,
3951,
11,
1123,
5447,
351,
198,
220,
220,
220,
257,
5166,
286,
30104,
13213,
262,
886,
2173,
13,
628,
220,
220,
220,
40117,
198,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
1627,
16,
198,
220,
220,
220,
220,
220,
220,
220,
383,
717,
1627,
13,
198,
220,
220,
220,
1627,
17,
198,
220,
220,
220,
220,
220,
220,
220,
383,
1218,
1627,
13,
628,
220,
220,
220,
16409,
198,
220,
220,
220,
35656,
198,
220,
220,
220,
45941,
13,
358,
18747,
198,
220,
220,
220,
220,
220,
220,
220,
383,
16246,
2173,
286,
262,
734,
3951,
543,
389,
36177,
278,
13,
628,
220,
220,
220,
7567,
2696,
198,
220,
220,
220,
40103,
198,
220,
220,
220,
11052,
12331,
198,
220,
220,
220,
220,
220,
220,
220,
13047,
318,
4635,
611,
262,
734,
3951,
836,
470,
36177,
351,
1123,
584,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
2124,
62,
26069,
796,
357,
1370,
16,
58,
15,
7131,
15,
60,
532,
1627,
16,
58,
16,
7131,
15,
4357,
1627,
17,
58,
15,
7131,
15,
60,
532,
1627,
17,
58,
16,
7131,
15,
12962,
198,
220,
220,
220,
331,
62,
26069,
796,
357,
1370,
16,
58,
15,
7131,
16,
60,
532,
1627,
16,
58,
16,
7131,
16,
4357,
1627,
17,
58,
15,
7131,
16,
60,
532,
1627,
17,
58,
16,
7131,
16,
12962,
628,
220,
220,
220,
2659,
796,
1062,
7,
87,
62,
26069,
11,
331,
62,
26069,
8,
198,
220,
220,
220,
611,
2659,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
5298,
11052,
12331,
7203,
43,
1127,
466,
407,
36177,
4943,
198,
220,
220,
220,
288,
796,
357,
15255,
46491,
1370,
16,
828,
1062,
46491,
1370,
17,
4008,
198,
220,
220,
220,
2124,
796,
1062,
7,
67,
11,
2124,
62,
26069,
8,
1220,
2659,
198,
220,
220,
220,
331,
796,
1062,
7,
67,
11,
331,
62,
26069,
8,
1220,
2659,
198,
220,
220,
220,
1441,
45941,
13,
18747,
26933,
87,
11,
331,
11,
657,
12962,
628,
198,
4299,
1064,
62,
3849,
5458,
7,
79,
15,
11,
410,
15,
11,
279,
16,
11,
410,
16,
11,
11387,
28,
16,
68,
12,
20,
8,
4613,
45941,
13,
358,
18747,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
8229,
262,
16246,
286,
257,
1627,
6427,
832,
279,
15,
287,
4571,
410,
15,
198,
220,
220,
220,
351,
530,
6427,
832,
279,
16,
287,
4571,
410,
16,
13,
220,
357,
5574,
7177,
286,
42085,
198,
220,
220,
220,
422,
26515,
286,
884,
2173,
14,
12942,
507,
737,
198,
220,
220,
220,
1114,
513,
67,
3815,
11,
340,
5860,
262,
966,
319,
262,
26842,
279,
15,
1343,
410,
15,
1635,
256,
11706,
284,
262,
198,
220,
220,
220,
26842,
279,
16,
1343,
410,
16,
1635,
256,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
279,
15,
796,
45941,
13,
18747,
7,
79,
15,
11,
299,
67,
1084,
28,
17,
8,
198,
220,
220,
220,
410,
15,
796,
45941,
13,
18747,
7,
85,
15,
11,
299,
67,
1084,
28,
17,
8,
198,
220,
220,
220,
279,
16,
796,
45941,
13,
18747,
7,
79,
16,
11,
299,
67,
1084,
28,
17,
8,
198,
220,
220,
220,
410,
16,
796,
45941,
13,
18747,
7,
85,
16,
11,
299,
67,
1084,
28,
17,
8,
198,
220,
220,
220,
285,
11,
299,
796,
45941,
13,
43358,
7,
79,
15,
8,
198,
220,
220,
220,
6818,
299,
287,
685,
17,
11,
513,
60,
628,
220,
220,
220,
5470,
1352,
796,
45941,
13,
19692,
7,
85,
16,
11,
279,
16,
532,
279,
15,
8,
198,
220,
220,
220,
31457,
1352,
796,
45941,
13,
19692,
7,
85,
16,
11,
410,
15,
8,
198,
220,
220,
220,
611,
299,
6624,
513,
25,
198,
220,
220,
220,
220,
220,
220,
220,
288,
796,
18896,
7,
37659,
13,
43358,
7,
77,
6975,
1352,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
649,
62,
77,
6975,
1352,
796,
45941,
13,
16680,
541,
306,
7,
77,
6975,
1352,
11,
5470,
1352,
737,
16345,
7,
67,
532,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
649,
62,
6559,
6351,
1352,
796,
45941,
13,
16680,
541,
306,
7,
6559,
6351,
1352,
11,
5470,
1352,
737,
16345,
7,
67,
532,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
5470,
1352,
11,
31457,
1352,
796,
649,
62,
77,
6975,
1352,
11,
649,
62,
6559,
6351,
1352,
628,
220,
220,
220,
31457,
1352,
58,
8937,
7,
6559,
6351,
1352,
8,
1279,
11387,
60,
796,
45941,
13,
10745,
220,
1303,
1406,
326,
8064,
2925,
284,
657,
612,
198,
220,
220,
220,
8064,
796,
5470,
1352,
1220,
31457,
1352,
198,
220,
220,
220,
8064,
796,
45941,
13,
44754,
7,
10366,
952,
11,
299,
737,
3447,
1758,
19510,
76,
11,
299,
4008,
198,
220,
220,
220,
1441,
279,
15,
1343,
8064,
1635,
410,
15,
628,
198,
198,
4299,
7354,
417,
558,
7,
87,
62,
88,
25,
45941,
13,
358,
18747,
8,
4613,
12178,
25,
198,
220,
220,
220,
37227,
17,
35,
7822,
286,
262,
7354,
417,
558,
10451,
13,
628,
220,
220,
220,
16409,
198,
220,
220,
220,
35656,
198,
220,
220,
220,
1058,
4871,
25,
63,
22468,
63,
198,
220,
220,
220,
220,
220,
220,
220,
16409,
4488,
1989,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
2124,
796,
2124,
62,
88,
58,
45299,
657,
60,
198,
220,
220,
220,
331,
796,
2124,
62,
88,
58,
45299,
352,
60,
198,
220,
220,
220,
1989,
796,
657,
13,
20,
1635,
45941,
13,
18747,
7,
37659,
13,
26518,
7,
87,
11,
45941,
13,
2487,
7,
88,
11,
352,
4008,
532,
45941,
13,
26518,
7,
88,
11,
45941,
13,
2487,
7,
87,
11,
352,
22305,
198,
220,
220,
220,
1441,
1989,
628,
198,
4299,
7354,
417,
558,
62,
37295,
7,
87,
62,
88,
25,
45941,
13,
358,
18747,
8,
4613,
965,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
36965,
262,
1989,
5295,
416,
262,
7354,
417,
558,
2446,
284,
5004,
1771,
198,
220,
220,
220,
262,
5128,
900,
286,
2173,
318,
7924,
8801,
3083,
393,
3753,
15750,
3083,
13,
628,
220,
220,
220,
16409,
198,
220,
220,
220,
35656,
198,
220,
220,
220,
1058,
4871,
25,
63,
2536,
63,
198,
220,
220,
220,
220,
220,
220,
220,
15467,
7559,
1,
43538,
1,
15506,
393,
7559,
1,
4093,
54,
1,
15506,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1989,
796,
7354,
417,
558,
7,
87,
62,
88,
8,
198,
220,
220,
220,
1441,
366,
43538,
1,
611,
1989,
1875,
657,
2073,
366,
4093,
54,
1,
628,
198,
198,
4299,
1027,
15036,
62,
28461,
648,
1741,
7,
24040,
25,
45941,
13,
358,
18747,
11,
5858,
62,
2412,
25,
1351,
8,
4613,
1351,
25,
198,
220,
220,
220,
37227,
35561,
257,
1351,
286,
36525,
3501,
257,
1333,
648,
1741,
198,
220,
220,
220,
286,
257,
7514,
14520,
11,
6196,
351,
10421,
13,
628,
220,
220,
220,
40117,
198,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
3326,
912,
198,
220,
220,
220,
220,
220,
220,
220,
3326,
912,
318,
257,
299,
32152,
7177,
286,
2173,
13,
198,
220,
220,
220,
5858,
62,
2412,
198,
220,
220,
220,
220,
220,
220,
220,
5858,
62,
2412,
318,
257,
1351,
286,
36525,
12739,
810,
198,
220,
220,
220,
262,
5645,
286,
649,
13532,
389,
13,
628,
220,
220,
220,
16409,
198,
220,
220,
220,
35656,
198,
220,
220,
220,
1351,
198,
220,
220,
220,
220,
220,
220,
220,
317,
1351,
286,
36525,
3501,
257,
1333,
648,
1741,
286,
257,
7514,
14520,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1303,
3274,
11,
2018,
477,
262,
13917,
523,
326,
262,
7514,
14520,
198,
220,
220,
220,
1303,
351,
10421,
318,
2427,
5716,
355,
257,
357,
548,
24748,
87,
8,
198,
220,
220,
220,
1303,
7514,
14520,
351,
530,
5743,
13,
220,
2141,
428,
416,
8263,
8787,
198,
220,
220,
220,
1303,
1022,
13917,
1969,
284,
1123,
584,
198,
220,
220,
220,
13917,
796,
685,
4868,
7,
9521,
7,
68,
15,
11,
304,
16,
4008,
329,
304,
15,
11,
304,
16,
287,
19974,
26933,
15,
11,
1635,
1806,
62,
2412,
4357,
5858,
62,
2412,
15437,
198,
220,
220,
220,
7223,
62,
33173,
796,
13917,
58,
25,
16,
60,
198,
220,
220,
220,
30795,
62,
33173,
796,
13917,
58,
16,
47715,
198,
220,
220,
220,
9052,
62,
8443,
507,
796,
23884,
628,
220,
220,
220,
981,
30795,
62,
33173,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
9521,
11,
474,
62,
9521,
796,
685,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1351,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8106,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
41032,
36525,
326,
389,
1541,
852,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
973,
284,
3197,
617,
4637,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37456,
1312,
25,
1312,
407,
287,
9052,
62,
8443,
507,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
340,
13,
7983,
46491,
1806,
62,
8094,
828,
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,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
5858,
62,
8094,
287,
357,
1078,
2317,
62,
33173,
11,
30795,
62,
33173,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2361,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
1012,
418,
395,
966,
319,
262,
7223,
13917,
284,
281,
6108,
3095,
4122,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
286,
262,
30795,
13917,
198,
220,
220,
220,
220,
220,
220,
220,
45218,
62,
73,
62,
1851,
796,
3095,
4122,
7,
24040,
58,
73,
62,
9521,
58,
15,
60,
4357,
3326,
912,
58,
73,
62,
9521,
58,
11925,
7,
73,
62,
9521,
8,
3373,
362,
11907,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
796,
949,
7,
72,
62,
9521,
11,
1994,
28,
50033,
1312,
25,
2593,
62,
16485,
1144,
7,
24040,
58,
72,
60,
532,
45218,
62,
73,
62,
1851,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
1012,
418,
395,
966,
286,
262,
30795,
13917,
284,
262,
20794,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
966,
286,
262,
7223,
13917,
198,
220,
220,
220,
220,
220,
220,
220,
474,
796,
949,
7,
73,
62,
9521,
11,
1994,
28,
50033,
474,
25,
2593,
62,
16485,
1144,
7,
24040,
58,
72,
60,
532,
3326,
912,
58,
73,
60,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
3311,
282,
3129,
378,
1312,
1912,
319,
649,
474,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
796,
949,
7,
72,
62,
9521,
11,
1994,
28,
50033,
1312,
25,
2593,
62,
16485,
1144,
7,
24040,
58,
72,
60,
532,
3326,
912,
58,
73,
60,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
11436,
284,
2018,
262,
7514,
14520,
379,
777,
2173,
198,
220,
220,
220,
220,
220,
220,
220,
9052,
62,
8443,
507,
58,
72,
60,
796,
474,
198,
220,
220,
220,
220,
220,
220,
220,
9052,
62,
8443,
507,
58,
73,
60,
796,
1312,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
10028,
262,
5858,
543,
474,
14448,
284,
422,
262,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
7223,
1351,
284,
262,
30795,
1351,
198,
220,
220,
220,
220,
220,
220,
220,
649,
62,
1806,
796,
1306,
7,
24455,
7,
50033,
5858,
25,
5858,
58,
15,
60,
19841,
474,
1279,
5858,
58,
12,
16,
4357,
30795,
62,
33173,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
30795,
62,
33173,
13,
28956,
7,
3605,
62,
1806,
8,
198,
220,
220,
220,
220,
220,
220,
220,
7223,
62,
33173,
13,
33295,
7,
3605,
62,
1806,
8,
628,
220,
220,
220,
1303,
31122,
6692,
1351,
198,
220,
220,
220,
706,
796,
17635,
198,
220,
220,
220,
886,
15,
796,
657,
198,
220,
220,
220,
329,
886,
16,
287,
5858,
62,
2412,
25,
198,
220,
220,
220,
220,
220,
220,
220,
706,
13,
2302,
437,
7,
9521,
7,
437,
15,
1343,
352,
11,
886,
16,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
706,
13,
33295,
7,
437,
15,
8,
198,
220,
220,
220,
220,
220,
220,
220,
886,
15,
796,
886,
16,
628,
220,
220,
220,
1303,
9938,
281,
16216,
286,
36525,
6155,
1088,
262,
7514,
14520,
198,
220,
220,
220,
36525,
796,
17635,
198,
220,
220,
220,
1312,
796,
657,
198,
220,
220,
220,
329,
4808,
287,
2837,
7,
11925,
7,
24040,
8,
1343,
18896,
7,
1806,
62,
2412,
8,
532,
352,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
3599,
796,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
611,
1312,
287,
9052,
62,
8443,
507,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
474,
796,
9052,
62,
8443,
507,
58,
72,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
36525,
13,
2302,
437,
26933,
72,
11,
474,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1312,
796,
706,
58,
73,
60,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
36525,
13,
33295,
7,
72,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1312,
796,
706,
58,
72,
60,
198,
220,
220,
220,
220,
220,
220,
220,
611,
1312,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2270,
628,
220,
220,
220,
13634,
62,
521,
1063,
796,
1027,
8968,
7,
24040,
58,
521,
1063,
11,
1058,
17,
4357,
685,
11925,
7,
521,
1063,
8,
12962,
198,
220,
220,
220,
1441,
685,
521,
1063,
58,
11632,
60,
329,
21504,
287,
13634,
62,
521,
1063,
60,
628,
628,
198,
4299,
47190,
62,
41907,
9250,
7,
198,
220,
220,
220,
1627,
25,
45835,
58,
37659,
13,
358,
18747,
4357,
2593,
62,
31364,
28,
12425,
198,
8,
4613,
45835,
58,
37659,
13,
358,
18747,
5974,
198,
220,
220,
220,
37227,
35561,
257,
1351,
286,
734,
2173,
326,
6053,
198,
220,
220,
220,
284,
262,
5645,
286,
262,
47190,
47457,
9250,
286,
262,
198,
220,
220,
220,
734,
2173,
1813,
13,
628,
220,
220,
220,
40117,
198,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
1627,
198,
220,
220,
220,
220,
220,
220,
220,
257,
1351,
286,
734,
299,
32152,
7177,
2173,
357,
10215,
5546,
278,
198,
220,
220,
220,
220,
220,
220,
220,
284,
262,
5645,
286,
257,
1627,
737,
198,
220,
220,
220,
2593,
62,
31364,
198,
220,
220,
220,
220,
220,
220,
220,
262,
15879,
47190,
284,
1111,
262,
1627,
1813,
198,
220,
220,
220,
220,
220,
220,
220,
290,
262,
47190,
47457,
9250,
13,
628,
220,
220,
220,
16409,
198,
220,
220,
220,
35656,
198,
220,
220,
220,
1351,
198,
220,
220,
220,
220,
220,
220,
220,
317,
1351,
286,
734,
299,
32152,
7177,
2173,
326,
6053,
198,
220,
220,
220,
220,
220,
220,
220,
284,
262,
5645,
286,
262,
47190,
47457,
9250,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
279,
16,
796,
1627,
58,
15,
60,
198,
220,
220,
220,
279,
17,
796,
1627,
58,
16,
60,
198,
220,
220,
220,
4571,
796,
45941,
13,
19692,
7,
79,
16,
532,
279,
17,
11,
2593,
62,
31364,
8,
198,
220,
220,
220,
285,
796,
3095,
4122,
7,
79,
16,
11,
279,
17,
8,
198,
220,
220,
220,
1441,
685,
76,
1343,
4571,
11,
285,
532,
4571,
60,
198
] | 2.307269 | 8,351 |
import inspect
"""
An immutable class representing a command, which is anything that has a side
effect or is asynchronous.
"""
| [
11748,
10104,
198,
198,
37811,
198,
2025,
40139,
1398,
10200,
257,
3141,
11,
543,
318,
1997,
326,
468,
257,
1735,
198,
10760,
393,
318,
39354,
13,
198,
37811,
198
] | 4.413793 | 29 |
my_func(2, 3, 4, 5, 6, a=7, b=8)
| [
198,
1820,
62,
20786,
7,
17,
11,
513,
11,
604,
11,
642,
11,
718,
11,
257,
28,
22,
11,
275,
28,
23,
8,
198
] | 1.416667 | 24 |
# Learning rate parameters
BASE_LR = 0.001
EPOCH_DECAY = 30 # number of epochs after which the Learning rate is decayed exponentially.
DECAY_WEIGHT = 0.1 # factor by which the learning rate is reduced.
# DATASET INFO
NUM_CLASSES = 6 # set the number of classes in your dataset
DATA_DIR = 'output_dataset/' # to run with the sample dataset, just set to 'hymenoptera_data'
# DATALOADER PROPERTIES
BATCH_SIZE = 10 # Set as high as possible. If you keep it too high, you'll get an out of memory error.
### GPU SETTINGS
CUDA_DEVICE = 0 # Enter device ID of your gpu if you want to run on gpu. Otherwise neglect.
GPU_MODE = 0 # set to 1 if want to run on gpu.
# SETTINGS FOR DISPLAYING ON TENSORBOARD
USE_TENSORBOARD = 0 #if you want to use tensorboard set this to 1.
TENSORBOARD_SERVER = "YOUR TENSORBOARD SERVER ADDRESS HERE" # If you set.
EXP_NAME = "fine_tuning_experiment" # if using tensorboard, enter name of experiment you want it to be displayed as. | [
201,
198,
2,
18252,
2494,
10007,
201,
198,
33,
11159,
62,
35972,
796,
657,
13,
8298,
201,
198,
8905,
46,
3398,
62,
41374,
4792,
796,
1542,
1303,
1271,
286,
36835,
82,
706,
543,
262,
18252,
2494,
318,
875,
16548,
35529,
13,
201,
198,
41374,
4792,
62,
8845,
9947,
796,
657,
13,
16,
1303,
5766,
416,
543,
262,
4673,
2494,
318,
5322,
13,
201,
198,
201,
198,
201,
198,
2,
360,
1404,
1921,
2767,
24890,
201,
198,
41359,
62,
31631,
1546,
796,
718,
1303,
900,
262,
1271,
286,
6097,
287,
534,
27039,
201,
198,
26947,
62,
34720,
796,
705,
22915,
62,
19608,
292,
316,
14,
6,
1303,
284,
1057,
351,
262,
6291,
27039,
11,
655,
900,
284,
705,
12114,
3653,
32563,
64,
62,
7890,
6,
201,
198,
201,
198,
2,
360,
1404,
1847,
41048,
1137,
4810,
3185,
17395,
11015,
201,
198,
33,
11417,
62,
33489,
796,
838,
1303,
5345,
355,
1029,
355,
1744,
13,
1002,
345,
1394,
340,
1165,
1029,
11,
345,
1183,
651,
281,
503,
286,
4088,
4049,
13,
201,
198,
201,
198,
201,
198,
21017,
11362,
25823,
51,
20754,
201,
198,
43633,
5631,
62,
7206,
27389,
796,
657,
1303,
6062,
3335,
4522,
286,
534,
308,
19944,
611,
345,
765,
284,
1057,
319,
308,
19944,
13,
15323,
17985,
13,
201,
198,
33346,
62,
49058,
796,
657,
1303,
900,
284,
352,
611,
765,
284,
1057,
319,
308,
19944,
13,
201,
198,
201,
198,
201,
198,
2,
25823,
51,
20754,
7473,
13954,
31519,
2751,
6177,
309,
16938,
1581,
8202,
9795,
201,
198,
19108,
62,
51,
16938,
1581,
8202,
9795,
796,
657,
1303,
361,
345,
765,
284,
779,
11192,
273,
3526,
900,
428,
284,
352,
13,
201,
198,
51,
16938,
1581,
8202,
9795,
62,
35009,
5959,
796,
366,
56,
11698,
309,
16938,
1581,
8202,
9795,
18871,
5959,
5984,
7707,
7597,
15698,
1,
1303,
1002,
345,
900,
13,
201,
198,
49864,
62,
20608,
796,
366,
38125,
62,
28286,
278,
62,
23100,
3681,
1,
1303,
611,
1262,
11192,
273,
3526,
11,
3802,
1438,
286,
6306,
345,
765,
340,
284,
307,
9066,
355,
13
] | 2.908284 | 338 |
import logging
import sys
import time
from abc import ABCMeta, abstractmethod
import serial
import six
logger = logging.getLogger(__name__)
@six.add_metaclass(ABCMeta)
| [
11748,
18931,
198,
11748,
25064,
198,
11748,
640,
198,
6738,
450,
66,
1330,
9738,
48526,
11,
12531,
24396,
198,
198,
11748,
11389,
198,
11748,
2237,
628,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628,
198,
31,
19412,
13,
2860,
62,
4164,
330,
31172,
7,
24694,
48526,
8,
628,
198
] | 3.125 | 56 |
import unittest, tempfile, os
from pychemy.peptide_sets import *
import random
import numpy as np
AA_dict = {1:'A', 2:'C', 3:'D', 4:'E', 5:'F', 6:'G', 7:'H', 8:'I', 9:'L', 10:'K',
11:'M', 12:'N', 13:'P', 14:'Q', 15:'R', 16:'S', 17:'T', 18:'V', 19:'W', 20:'Y'}
###############################
###############################
###############################
###############################
###############################
###############################
###############################
###############################
###############################
###############################
###############################
###############################
###############################
###############################
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
11,
20218,
7753,
11,
28686,
198,
6738,
12972,
26599,
13,
431,
457,
485,
62,
28709,
1330,
1635,
198,
11748,
4738,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
3838,
62,
11600,
796,
1391,
16,
32105,
32,
3256,
362,
32105,
34,
3256,
513,
32105,
35,
3256,
604,
32105,
36,
3256,
642,
32105,
37,
3256,
718,
32105,
38,
3256,
767,
32105,
39,
3256,
807,
32105,
40,
3256,
860,
32105,
43,
3256,
838,
32105,
42,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1367,
32105,
44,
3256,
1105,
32105,
45,
3256,
1511,
32105,
47,
3256,
1478,
32105,
48,
3256,
1315,
32105,
49,
3256,
1467,
32105,
50,
3256,
1596,
32105,
51,
3256,
1248,
32105,
53,
3256,
678,
32105,
54,
3256,
1160,
32105,
56,
6,
92,
198,
220,
220,
220,
628,
628,
198,
14468,
7804,
4242,
21017,
198,
198,
14468,
7804,
4242,
21017,
198,
198,
14468,
7804,
4242,
21017,
198,
198,
14468,
7804,
4242,
21017,
198,
198,
14468,
7804,
4242,
21017,
198,
198,
14468,
7804,
4242,
21017,
198,
198,
14468,
7804,
4242,
21017,
198,
198,
14468,
7804,
4242,
21017,
198,
220,
220,
220,
220,
198,
14468,
7804,
4242,
21017,
198,
198,
14468,
7804,
4242,
21017,
198,
198,
14468,
7804,
4242,
21017,
198,
198,
14468,
7804,
4242,
21017,
198,
198,
14468,
7804,
4242,
21017,
198,
198,
14468,
7804,
4242,
21017,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
3419,
198
] | 3.231707 | 246 |
"""
Objects related to data downloads from the public PTF data server. Based on information and examples
in
Should work in python 2 and 3.
"""
import requests
import pandas as pd
from future.standard_library import install_aliases
install_aliases()
from urllib.request import urlopen
import os
__all__ = ['PTFImages']
class PTFImages(object):
"""
A class useful for downloading images that enclose point sources at different times as a function of
coordinates (ra, dec). Choices in time ranges can also be made.
"""
def _get_url(self, ra=None, dec=None, fixedurl=None):
"""get url from ra, dec
Parameters
----------
ra : ra in degrees
dec : dec in degrees
fixedurl : fixed url string
"""
if ra is None:
ra = self.ra
if dec is None:
dec = self.dec
if fixedurl is None:
fixedurl = self.fixedurl
pos = "{:3.6f},{:3.6f}".format(ra, dec)
url = fixedurl + pos
return url
@property
def response(self):
"""
text of the response from the url
"""
if self._response is None:
url = self._get_url()
r = requests.get(url)
if r.status_code != 200:
raise ValueError('response from url resulted in incorrect status', r.status)
else:
self._response = r.text
return self._response
@property
def response_cat(self):
""" A `pd.DataFrame` showing the catalog of images enclosing coordinates provided to
create class instances
"""
linesu = list(l for l in self.response.split('\n'))
headers = []
data = []
for l in linesu:
if '|' in l:
headers.append(l)
elif len(l.strip()) > 0 and '\\' not in l:
data.append(self._process_dataline(l))
else:
# blank line
pass
#return pd.DataFrame(data), headers
header_names, header_types, header_units = self.get_header(headers[:3])
return pd.DataFrame(data, columns=header_names).convert_objects(convert_numeric=True)
@staticmethod
def _process_dataline(line):
"""tokenise each line of the data by splitting on whitespace, but then joining the 5th and 6th element,
and the two final elements
Parameters
----------
line : string (unicode/bytes)
line of the return split on '\n'
.. notes : It is important that this does not include the newline character
"""
l = list(x.strip() for x in line.split())
# join the fields to create strings
l[4] = ' '.join([l[4], l[5]])
l[-2] = ' '.join([l[-2], l[-1]])
# pop the extra fields
l.pop(-1)
l.pop(5)
return l
def get_header(self, headers):
"""tuples of header strings
"""
header_names, types, units = tuple(self._process_headerline(line) for line in headers)
return header_names, types, units
@staticmethod
def _process_headerline(line):
"""tokenise each line of the data by splitting on whitespace, but then joining the 5th and 6th element,
and the two final elements
Parameters
----------
line : string (unicode/bytes)
line of the return split on '\n'
.. notes : It is important that this does not include the newline character
"""
l = list(x.strip() for x in line.split('|'))
return l[1:-1]
def get_urls(self, query=None):
"""return a list of image urls based on a dataframe query of
self.response_cat
Parameters
----------
query : string
`pd.dataFrame.queries` of any kind are allowed
"""
if query is not None:
x = self.response_cat.query(query)
else:
x = self.response_cat
pfilenames = list(self.imageurl + fname for fname in x['pfilename'].values)
afilename1 = list(self.imageurl + fname for fname in x['afilename1'].values)
return afilename1, pfilenames
@staticmethod
def downloadfilefromurl(url, outdir='./'):
"""
Download a single file into the directory `outdir`
Parameters
----------
url : string
url from which to download file
outdir : string, defaults to `./`
absolute path to existing output directory into which files will be downloaded
.. note : `outdir` needs to exist
"""
# Filename to write to is the same as the original file
outdir = os.path.abspath(outdir)
wfilename = os.path.join(outdir, url.split('/')[-1])
resp = urlopen(url)
with open(wfilename, 'wb') as f:
while True:
chunk = resp.read()
if not chunk:
break
f.write(chunk)
return 0
def downloadimages(self, query=None):
"""
"""
afilename1, pfilenames = self.get_urls(query)
print (afilename1, pfilenames)
x = list(self.downloadfilefromurl(fname) for fname in afilename1)
x = list(self.downloadfilefromurl(fname) for fname in pfilenames)
return x
| [
37811,
198,
10267,
82,
3519,
284,
1366,
21333,
422,
262,
1171,
350,
10234,
1366,
4382,
13,
13403,
319,
1321,
290,
6096,
198,
259,
220,
220,
198,
198,
19926,
670,
287,
21015,
362,
290,
513,
13,
198,
37811,
198,
11748,
7007,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
2003,
13,
20307,
62,
32016,
1330,
2721,
62,
7344,
1386,
198,
17350,
62,
7344,
1386,
3419,
198,
6738,
2956,
297,
571,
13,
25927,
1330,
19016,
9654,
198,
11748,
28686,
198,
198,
834,
439,
834,
796,
37250,
47,
10234,
29398,
20520,
198,
198,
4871,
350,
10234,
29398,
7,
15252,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
317,
1398,
4465,
329,
22023,
4263,
326,
13507,
577,
966,
4237,
379,
1180,
1661,
355,
257,
2163,
286,
198,
220,
220,
220,
22715,
357,
430,
11,
875,
737,
10031,
1063,
287,
640,
16069,
460,
635,
307,
925,
13,
198,
220,
220,
220,
220,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
198,
220,
220,
220,
825,
4808,
1136,
62,
6371,
7,
944,
11,
2179,
28,
14202,
11,
875,
28,
14202,
11,
5969,
6371,
28,
14202,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
1136,
19016,
422,
2179,
11,
875,
220,
198,
220,
220,
220,
220,
198,
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,
2179,
1058,
2179,
287,
7370,
198,
220,
220,
220,
220,
220,
220,
220,
875,
1058,
875,
287,
7370,
198,
220,
220,
220,
220,
220,
220,
220,
5969,
6371,
1058,
5969,
19016,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2179,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2179,
796,
2116,
13,
430,
198,
220,
220,
220,
220,
220,
220,
220,
611,
875,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
875,
796,
2116,
13,
12501,
198,
220,
220,
220,
220,
220,
220,
220,
611,
5969,
6371,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5969,
6371,
796,
220,
2116,
13,
34021,
6371,
198,
220,
220,
220,
220,
220,
220,
220,
1426,
796,
45144,
25,
18,
13,
21,
69,
5512,
90,
25,
18,
13,
21,
69,
92,
1911,
18982,
7,
430,
11,
875,
8,
198,
220,
220,
220,
220,
220,
220,
220,
19016,
796,
5969,
6371,
1343,
1426,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
19016,
198,
220,
220,
220,
2488,
26745,
198,
220,
220,
220,
825,
2882,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2420,
286,
262,
2882,
422,
262,
19016,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13557,
26209,
318,
6045,
25,
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,
19016,
796,
2116,
13557,
1136,
62,
6371,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
374,
796,
7007,
13,
1136,
7,
6371,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
374,
13,
13376,
62,
8189,
14512,
939,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
11052,
12331,
10786,
26209,
422,
19016,
8724,
287,
11491,
3722,
3256,
374,
13,
13376,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
26209,
796,
374,
13,
5239,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13557,
26209,
198,
220,
220,
220,
220,
198,
220,
220,
220,
2488,
26745,
198,
220,
220,
220,
825,
2882,
62,
9246,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
317,
4600,
30094,
13,
6601,
19778,
63,
4478,
262,
18388,
286,
4263,
13507,
2752,
22715,
2810,
284,
198,
220,
220,
220,
220,
220,
220,
220,
2251,
1398,
10245,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
3951,
84,
796,
1351,
7,
75,
329,
300,
287,
2116,
13,
26209,
13,
35312,
10786,
59,
77,
6,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
24697,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
1366,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
329,
300,
287,
3951,
84,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
705,
91,
6,
287,
300,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
24697,
13,
33295,
7,
75,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
18896,
7,
75,
13,
36311,
28955,
1875,
657,
290,
705,
6852,
6,
407,
287,
300,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
13,
33295,
7,
944,
13557,
14681,
62,
67,
10254,
500,
7,
75,
4008,
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,
1303,
9178,
1627,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1208,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
7783,
279,
67,
13,
6601,
19778,
7,
7890,
828,
24697,
198,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
14933,
11,
13639,
62,
19199,
11,
13639,
62,
41667,
796,
2116,
13,
1136,
62,
25677,
7,
50145,
58,
25,
18,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
279,
67,
13,
6601,
19778,
7,
7890,
11,
15180,
28,
25677,
62,
14933,
737,
1102,
1851,
62,
48205,
7,
1102,
1851,
62,
77,
39223,
28,
17821,
8,
628,
220,
220,
220,
2488,
12708,
24396,
198,
220,
220,
220,
825,
4808,
14681,
62,
67,
10254,
500,
7,
1370,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
30001,
786,
1123,
1627,
286,
262,
1366,
416,
26021,
319,
13216,
10223,
11,
475,
788,
9679,
262,
642,
400,
290,
718,
400,
5002,
11,
198,
220,
220,
220,
220,
220,
220,
220,
290,
262,
734,
2457,
4847,
198,
220,
220,
220,
220,
198,
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,
1627,
1058,
4731,
357,
46903,
1098,
14,
33661,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1627,
286,
262,
1441,
6626,
319,
705,
59,
77,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
11485,
4710,
1058,
632,
318,
1593,
326,
428,
857,
407,
2291,
262,
649,
1370,
2095,
220,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
300,
796,
1351,
7,
87,
13,
36311,
3419,
329,
2124,
287,
1627,
13,
35312,
28955,
198,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
4654,
262,
7032,
284,
2251,
13042,
198,
220,
220,
220,
220,
220,
220,
220,
300,
58,
19,
60,
796,
705,
45302,
22179,
26933,
75,
58,
19,
4357,
300,
58,
20,
11907,
8,
198,
220,
220,
220,
220,
220,
220,
220,
300,
58,
12,
17,
60,
796,
705,
45302,
22179,
26933,
75,
58,
12,
17,
4357,
300,
58,
12,
16,
11907,
8,
198,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
1461,
262,
3131,
7032,
198,
220,
220,
220,
220,
220,
220,
220,
300,
13,
12924,
32590,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
300,
13,
12924,
7,
20,
8,
198,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
300,
628,
220,
220,
220,
825,
651,
62,
25677,
7,
944,
11,
24697,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
28047,
2374,
286,
13639,
13042,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
13639,
62,
14933,
11,
3858,
11,
4991,
796,
46545,
7,
944,
13557,
14681,
62,
25677,
1370,
7,
1370,
8,
329,
1627,
287,
24697,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
13639,
62,
14933,
11,
3858,
11,
4991,
198,
220,
220,
220,
220,
198,
220,
220,
220,
2488,
12708,
24396,
198,
220,
220,
220,
825,
4808,
14681,
62,
25677,
1370,
7,
1370,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
30001,
786,
1123,
1627,
286,
262,
1366,
416,
26021,
319,
13216,
10223,
11,
475,
788,
9679,
262,
642,
400,
290,
718,
400,
5002,
11,
198,
220,
220,
220,
220,
220,
220,
220,
290,
262,
734,
2457,
4847,
198,
220,
220,
220,
220,
198,
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,
1627,
1058,
4731,
357,
46903,
1098,
14,
33661,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1627,
286,
262,
1441,
6626,
319,
705,
59,
77,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
11485,
4710,
1058,
632,
318,
1593,
326,
428,
857,
407,
2291,
262,
649,
1370,
2095,
220,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
300,
796,
1351,
7,
87,
13,
36311,
3419,
329,
2124,
287,
1627,
13,
35312,
10786,
91,
6,
4008,
198,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
300,
58,
16,
21912,
16,
60,
628,
220,
220,
220,
825,
651,
62,
6371,
82,
7,
944,
11,
12405,
28,
14202,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
7783,
257,
1351,
286,
2939,
2956,
7278,
1912,
319,
257,
1366,
14535,
12405,
286,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
26209,
62,
9246,
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,
12405,
1058,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4600,
30094,
13,
7890,
19778,
13,
421,
10640,
63,
286,
597,
1611,
389,
3142,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
611,
12405,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
796,
2116,
13,
26209,
62,
9246,
13,
22766,
7,
22766,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
796,
2116,
13,
26209,
62,
9246,
198,
220,
220,
220,
220,
220,
220,
220,
279,
10379,
268,
1047,
796,
1351,
7,
944,
13,
9060,
6371,
1343,
277,
3672,
329,
277,
3672,
287,
220,
2124,
17816,
79,
34345,
6,
4083,
27160,
8,
198,
220,
220,
220,
220,
220,
220,
220,
6580,
346,
12453,
16,
796,
1351,
7,
944,
13,
9060,
6371,
1343,
277,
3672,
329,
277,
3672,
287,
220,
2124,
17816,
1878,
346,
12453,
16,
6,
4083,
27160,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
6580,
346,
12453,
16,
11,
279,
10379,
268,
1047,
628,
220,
220,
220,
2488,
12708,
24396,
198,
220,
220,
220,
825,
4321,
7753,
6738,
6371,
7,
6371,
11,
503,
15908,
28,
4458,
14,
6,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
10472,
257,
2060,
2393,
656,
262,
8619,
4600,
448,
15908,
63,
198,
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,
19016,
1058,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
19016,
422,
543,
284,
4321,
2393,
198,
220,
220,
220,
220,
220,
220,
220,
503,
15908,
1058,
4731,
11,
26235,
284,
4600,
19571,
63,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4112,
3108,
284,
4683,
5072,
8619,
656,
543,
3696,
481,
307,
15680,
198,
197,
492,
3465,
1058,
4600,
448,
15908,
63,
2476,
284,
2152,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
7066,
12453,
284,
3551,
284,
318,
262,
976,
355,
262,
2656,
2393,
198,
220,
220,
220,
220,
220,
220,
220,
503,
15908,
796,
28686,
13,
6978,
13,
397,
2777,
776,
7,
448,
15908,
8,
198,
220,
220,
220,
220,
220,
220,
220,
266,
34345,
796,
28686,
13,
6978,
13,
22179,
7,
448,
15908,
11,
19016,
13,
35312,
10786,
14,
11537,
58,
12,
16,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
1217,
796,
19016,
9654,
7,
6371,
8,
628,
220,
220,
220,
220,
220,
220,
220,
351,
1280,
7,
86,
34345,
11,
705,
39346,
11537,
355,
277,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
981,
6407,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16058,
796,
1217,
13,
961,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
407,
16058,
25,
198,
220,
220,
220,
220,
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,
277,
13,
13564,
7,
354,
2954,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
657,
628,
220,
220,
220,
825,
4321,
17566,
7,
944,
11,
12405,
28,
14202,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
6580,
346,
12453,
16,
11,
279,
10379,
268,
1047,
796,
2116,
13,
1136,
62,
6371,
82,
7,
22766,
8,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
357,
1878,
346,
12453,
16,
11,
279,
10379,
268,
1047,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2124,
796,
1351,
7,
944,
13,
15002,
7753,
6738,
6371,
7,
69,
3672,
8,
329,
277,
3672,
287,
6580,
346,
12453,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2124,
796,
1351,
7,
944,
13,
15002,
7753,
6738,
6371,
7,
69,
3672,
8,
329,
277,
3672,
287,
279,
10379,
268,
1047,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2124,
628
] | 2.204775 | 2,471 |
import unittest
from analog_noise_estimator import laplacians | [
11748,
555,
715,
395,
198,
198,
6738,
15075,
62,
3919,
786,
62,
395,
320,
1352,
1330,
8591,
489,
330,
1547
] | 3.1 | 20 |
#!/usr/bin/env python3
import re
import sys
import codecs
inputfile = codecs.open(sys.argv[1], mode='r', encoding='utf-8', errors='replace')
lineprefix = re.compile(r'^(?P<time>\d+)\s+(?P<rss>\d+)\s+(?P<cpu>\d+\.\d+)\s+(?P<th>\d+) (?P<msg>.*)$')
pkgre = re.compile(r'^(?P<result>(?:FAIL|ok |\? ))\tgithub.com/cockroachdb/cockroach/pkg/(?P<pkgname>[^ \t]*)\t(?P<tail>.*)$')
testrunre = re.compile(r'^=== RUN (?P<testname>(?:Test|Example)[^/]*)$')
testresre = re.compile(r'^--- (?P<result>FAIL|PASS|SKIP): (?P<testname>(?:Test|Example)[^/]*) (?:\((?P<tail>.*)\))?$')
subtestrunre = re.compile(r'^=== RUN (?P<testname>(?:Test|Example)[^/]*)/(?P<stestname>[^ ]*)$')
subtestresre = re.compile(r'^--- (?P<result>FAIL|PASS|SKIP): (?P<testname>(?:Test|Example)[^/]*)/(?P<stestname>[^ ]*) (?:\((?P<tail>.*)\))?$')
allpackages = []
currentpkg = PkgRes()
currenttest = None
lasttest = None
for line in inputfile:
# line = line.strip()
m = lineprefix.match(line)
if m is None:
print("UNEXPECTED:", line, file=sys.stderr)
continue
time, rss, cpu, th, msg = int(m.group('time')), int(m.group('rss')), float(m.group('cpu')), int(m.group('th')), m.group('msg')
currentpkg.update(time, rss, cpu, th, len(line))
if currenttest is not None:
currenttest.update(time, rss, cpu, th, len(line))
# print("msg=%r" % msg, file=sys.stderr)
m = pkgre.match(msg)
if m is not None:
result, pkgname, tail = m.group('result'), m.group('pkgname'), m.group('tail')
currentpkg.finish(result, pkgname, tail)
# print("XXX", currentpkg.pkgresult(), file=sys.stderr)
allpackages.append(currentpkg.pkgresult())
currentpkg = PkgRes()
currenttest = None
continue
m = testrunre.match(msg)
if m is not None:
if currenttest is not None:
# print("ABSORBED %r: %r" % (currenttest.testname, line), file=sys.stderr)
lasttest = currenttest
currenttest = None
# This is possible if a test is emulating go test output
# as a test result.
# In that case, just count it as output
# in the current test.
# continue
tn = m.group('testname')
currenttest = TestRes(tn, currentpkg)
currentpkg.add(currenttest)
continue
m = testresre.match(msg)
if m is not None:
nm = m.group('testname')
if currenttest is None:
print("NO TEST STARTED:", line, file=sys.stderr)
continue
if nm != currenttest.testname:
# This is possible if a test is emulating go test output
# as a test result.
# In that case, just count it as output
# in the current test.
continue
# print("MISMATCH: EXPECTED %r, got %r", currenttest.testname, nm, file=sys.stderr)
currenttest.finish(m.group('result'), m.group('tail'))
lasttest = currenttest
currenttest = None
# print("YYY", currenttest.testresult(), file=sys.stderr)
# print("UNKNOWN:", line, file=sys.stderr)
# print("ZZZ", line)
m = subtestrunre.match(msg)
if m is not None:
tn = m.group('testname')
if currenttest is None:
currenttest = TestRes(tn, currentpkg)
currentpkg.add(currenttest)
if tn != currenttest.testname:
# This is possible if a test is emulating go test output
# as a test result.
# In that case, just count it as output
# in the current test.
continue
# print("MISMATCH: EXPECTED %r, got %r", currenttest.testname, nm, file=sys.stderr)
currenttest.addsubtest(m.group('stestname'))
continue
m = subtestresre.match(msg)
if m is not None:
nm = m.group('testname')
if lasttest is None:
print("NO TEST STARTED:", line, file=sys.stderr)
continue
# print("ZZZ2", nm, lasttest.testname)
if nm != lasttest.testname:
# This is possible if a test is emulating go test output
# as a test result.
# In that case, just count it as output
# in the current test.
continue
# print("MISMATCH: EXPECTED %r, got %r", currenttest.testname, nm, file=sys.stderr)
lasttest.finishsubtest(m.group('result'), m.group('stestname'), m.group('tail'))
# print("ZZZ3", len(lasttest.subtests))
#allpackages.append(currentpkg.pkgresult())
print("AT END", file=sys.stderr)
print(allpackages)
# Overall structure of a test output:
#
# === RUN TestXXXX
# (optionally, more:)
# === RUN TestXXXX/YYYY
# (at end)
# --- (PASS|FAIL|SKIP): TestXXXX (dur)
# (optionally, more)
# --- (PASSS|FAIL|SKIP): TestXXXX/YYYY (dur)
# (at end of pkg)
# PASS|FAIL
# ok
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
302,
198,
11748,
25064,
198,
11748,
40481,
82,
628,
628,
198,
198,
15414,
7753,
796,
40481,
82,
13,
9654,
7,
17597,
13,
853,
85,
58,
16,
4357,
4235,
11639,
81,
3256,
21004,
11639,
40477,
12,
23,
3256,
8563,
11639,
33491,
11537,
198,
198,
1370,
40290,
796,
302,
13,
5589,
576,
7,
81,
6,
61,
7,
30,
47,
27,
2435,
29,
59,
67,
10,
19415,
82,
33747,
30,
47,
27,
42216,
29,
59,
67,
10,
19415,
82,
33747,
30,
47,
27,
36166,
29,
59,
67,
10,
17405,
59,
67,
10,
19415,
82,
33747,
30,
47,
27,
400,
29,
59,
67,
28988,
357,
30,
47,
27,
19662,
29,
15885,
8,
3,
11537,
198,
198,
35339,
260,
796,
302,
13,
5589,
576,
7,
81,
6,
61,
7,
30,
47,
27,
20274,
33994,
27514,
7708,
4146,
91,
482,
220,
930,
59,
30,
220,
220,
15306,
59,
83,
12567,
13,
785,
14,
21517,
28562,
9945,
14,
21517,
28562,
14,
35339,
29006,
30,
47,
27,
35339,
3672,
36937,
61,
3467,
83,
60,
9,
19415,
83,
7,
30,
47,
27,
13199,
29,
15885,
8,
3,
11537,
198,
198,
9288,
5143,
260,
796,
302,
13,
5589,
576,
7,
81,
6,
61,
18604,
32494,
220,
220,
357,
30,
47,
27,
9288,
3672,
33994,
27514,
14402,
91,
16281,
38381,
61,
14,
60,
28104,
3,
11537,
198,
9288,
411,
260,
796,
302,
13,
5589,
576,
7,
81,
6,
61,
6329,
357,
30,
47,
27,
20274,
29,
7708,
4146,
91,
47924,
91,
18831,
4061,
2599,
357,
30,
47,
27,
9288,
3672,
33994,
27514,
14402,
91,
16281,
38381,
61,
14,
60,
28104,
357,
30,
7479,
19510,
30,
47,
27,
13199,
29,
15885,
19415,
4008,
30,
3,
11537,
198,
7266,
9288,
5143,
260,
796,
302,
13,
5589,
576,
7,
81,
6,
61,
18604,
32494,
220,
220,
357,
30,
47,
27,
9288,
3672,
33994,
27514,
14402,
91,
16281,
38381,
61,
14,
60,
9,
20679,
7,
30,
47,
27,
301,
395,
3672,
36937,
61,
2361,
28104,
3,
11537,
198,
7266,
9288,
411,
260,
796,
302,
13,
5589,
576,
7,
81,
6,
61,
6329,
357,
30,
47,
27,
20274,
29,
7708,
4146,
91,
47924,
91,
18831,
4061,
2599,
357,
30,
47,
27,
9288,
3672,
33994,
27514,
14402,
91,
16281,
38381,
61,
14,
60,
9,
20679,
7,
30,
47,
27,
301,
395,
3672,
36937,
61,
2361,
28104,
357,
30,
7479,
19510,
30,
47,
27,
13199,
29,
15885,
19415,
4008,
30,
3,
11537,
198,
198,
439,
43789,
796,
17635,
198,
14421,
35339,
796,
350,
10025,
4965,
3419,
198,
14421,
9288,
796,
6045,
198,
12957,
9288,
796,
6045,
198,
1640,
1627,
287,
5128,
7753,
25,
198,
220,
220,
220,
1303,
1627,
796,
1627,
13,
36311,
3419,
198,
220,
220,
220,
285,
796,
1627,
40290,
13,
15699,
7,
1370,
8,
198,
220,
220,
220,
611,
285,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
4944,
49864,
9782,
1961,
25,
1600,
1627,
11,
2393,
28,
17597,
13,
301,
1082,
81,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2555,
198,
220,
220,
220,
640,
11,
374,
824,
11,
42804,
11,
294,
11,
31456,
796,
493,
7,
76,
13,
8094,
10786,
2435,
11537,
828,
493,
7,
76,
13,
8094,
10786,
42216,
11537,
828,
12178,
7,
76,
13,
8094,
10786,
36166,
11537,
828,
493,
7,
76,
13,
8094,
10786,
400,
11537,
828,
285,
13,
8094,
10786,
19662,
11537,
198,
220,
220,
220,
1459,
35339,
13,
19119,
7,
2435,
11,
374,
824,
11,
42804,
11,
294,
11,
18896,
7,
1370,
4008,
198,
220,
220,
220,
611,
1459,
9288,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1459,
9288,
13,
19119,
7,
2435,
11,
374,
824,
11,
42804,
11,
294,
11,
18896,
7,
1370,
4008,
198,
220,
220,
220,
1303,
3601,
7203,
19662,
28,
4,
81,
1,
4064,
31456,
11,
2393,
28,
17597,
13,
301,
1082,
81,
8,
198,
220,
220,
220,
285,
796,
279,
10025,
260,
13,
15699,
7,
19662,
8,
198,
220,
220,
220,
611,
285,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
11,
279,
10025,
3672,
11,
7894,
796,
285,
13,
8094,
10786,
20274,
33809,
285,
13,
8094,
10786,
35339,
3672,
33809,
285,
13,
8094,
10786,
13199,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
1459,
35339,
13,
15643,
680,
7,
20274,
11,
279,
10025,
3672,
11,
7894,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
3601,
7203,
43145,
1600,
1459,
35339,
13,
35339,
20274,
22784,
2393,
28,
17597,
13,
301,
1082,
81,
8,
198,
220,
220,
220,
220,
220,
220,
220,
477,
43789,
13,
33295,
7,
14421,
35339,
13,
35339,
20274,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
1459,
35339,
796,
350,
10025,
4965,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
1459,
9288,
796,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
2555,
198,
220,
220,
220,
285,
796,
1332,
5143,
260,
13,
15699,
7,
19662,
8,
198,
220,
220,
220,
611,
285,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
1459,
9288,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
3601,
7203,
32,
4462,
1581,
33,
1961,
4064,
81,
25,
4064,
81,
1,
4064,
357,
14421,
9288,
13,
9288,
3672,
11,
1627,
828,
2393,
28,
17597,
13,
301,
1082,
81,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
938,
9288,
796,
1459,
9288,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1459,
9288,
796,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
770,
318,
1744,
611,
257,
1332,
318,
795,
8306,
467,
1332,
5072,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
355,
257,
1332,
1255,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
554,
326,
1339,
11,
655,
954,
340,
355,
5072,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
287,
262,
1459,
1332,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
2555,
198,
220,
220,
220,
220,
220,
220,
220,
256,
77,
796,
285,
13,
8094,
10786,
9288,
3672,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
1459,
9288,
796,
6208,
4965,
7,
34106,
11,
1459,
35339,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1459,
35339,
13,
2860,
7,
14421,
9288,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2555,
198,
220,
220,
220,
285,
796,
1332,
411,
260,
13,
15699,
7,
19662,
8,
198,
220,
220,
220,
611,
285,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
28642,
796,
285,
13,
8094,
10786,
9288,
3672,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
611,
1459,
9288,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
15285,
43001,
33303,
1961,
25,
1600,
1627,
11,
2393,
28,
17597,
13,
301,
1082,
81,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2555,
198,
220,
220,
220,
220,
220,
220,
220,
611,
28642,
14512,
1459,
9288,
13,
9288,
3672,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
770,
318,
1744,
611,
257,
1332,
318,
795,
8306,
467,
1332,
5072,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
355,
257,
1332,
1255,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
554,
326,
1339,
11,
655,
954,
340,
355,
5072,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
287,
262,
1459,
1332,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2555,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
3601,
7203,
44,
31125,
11417,
25,
25703,
9782,
1961,
4064,
81,
11,
1392,
4064,
81,
1600,
1459,
9288,
13,
9288,
3672,
11,
28642,
11,
2393,
28,
17597,
13,
301,
1082,
81,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1459,
9288,
13,
15643,
680,
7,
76,
13,
8094,
10786,
20274,
33809,
285,
13,
8094,
10786,
13199,
6,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
938,
9288,
796,
1459,
9288,
198,
220,
220,
220,
220,
220,
220,
220,
1459,
9288,
796,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
3601,
7203,
26314,
56,
1600,
1459,
9288,
13,
9288,
20274,
22784,
2393,
28,
17597,
13,
301,
1082,
81,
8,
198,
220,
220,
220,
1303,
3601,
7203,
4944,
44706,
25,
1600,
1627,
11,
2393,
28,
17597,
13,
301,
1082,
81,
8,
198,
220,
220,
220,
1303,
3601,
7203,
30148,
57,
1600,
1627,
8,
198,
220,
220,
220,
285,
796,
850,
9288,
5143,
260,
13,
15699,
7,
19662,
8,
198,
220,
220,
220,
611,
285,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
256,
77,
796,
285,
13,
8094,
10786,
9288,
3672,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
611,
1459,
9288,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1459,
9288,
796,
6208,
4965,
7,
34106,
11,
1459,
35339,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1459,
35339,
13,
2860,
7,
14421,
9288,
8,
198,
220,
220,
220,
220,
220,
220,
220,
611,
256,
77,
14512,
1459,
9288,
13,
9288,
3672,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
770,
318,
1744,
611,
257,
1332,
318,
795,
8306,
467,
1332,
5072,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
355,
257,
1332,
1255,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
554,
326,
1339,
11,
655,
954,
340,
355,
5072,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
287,
262,
1459,
1332,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2555,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
3601,
7203,
44,
31125,
11417,
25,
25703,
9782,
1961,
4064,
81,
11,
1392,
4064,
81,
1600,
1459,
9288,
13,
9288,
3672,
11,
28642,
11,
2393,
28,
17597,
13,
301,
1082,
81,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1459,
9288,
13,
2860,
7266,
9288,
7,
76,
13,
8094,
10786,
301,
395,
3672,
6,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
2555,
198,
220,
220,
220,
285,
796,
850,
9288,
411,
260,
13,
15699,
7,
19662,
8,
198,
220,
220,
220,
611,
285,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
28642,
796,
285,
13,
8094,
10786,
9288,
3672,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
611,
938,
9288,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
15285,
43001,
33303,
1961,
25,
1600,
1627,
11,
2393,
28,
17597,
13,
301,
1082,
81,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2555,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
3601,
7203,
30148,
57,
17,
1600,
28642,
11,
938,
9288,
13,
9288,
3672,
8,
198,
220,
220,
220,
220,
220,
220,
220,
611,
28642,
14512,
938,
9288,
13,
9288,
3672,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
770,
318,
1744,
611,
257,
1332,
318,
795,
8306,
467,
1332,
5072,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
355,
257,
1332,
1255,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
554,
326,
1339,
11,
655,
954,
340,
355,
5072,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
287,
262,
1459,
1332,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2555,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
3601,
7203,
44,
31125,
11417,
25,
25703,
9782,
1961,
4064,
81,
11,
1392,
4064,
81,
1600,
1459,
9288,
13,
9288,
3672,
11,
28642,
11,
2393,
28,
17597,
13,
301,
1082,
81,
8,
198,
220,
220,
220,
220,
220,
220,
220,
938,
9288,
13,
15643,
680,
7266,
9288,
7,
76,
13,
8094,
10786,
20274,
33809,
285,
13,
8094,
10786,
301,
395,
3672,
33809,
285,
13,
8094,
10786,
13199,
6,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
3601,
7203,
30148,
57,
18,
1600,
18896,
7,
12957,
9288,
13,
7266,
41989,
4008,
198,
198,
2,
439,
43789,
13,
33295,
7,
14421,
35339,
13,
35339,
20274,
28955,
198,
198,
4798,
7203,
1404,
23578,
1600,
2393,
28,
17597,
13,
301,
1082,
81,
8,
198,
198,
4798,
7,
439,
43789,
8,
628,
198,
2,
14674,
4645,
286,
257,
1332,
5072,
25,
198,
2,
198,
2,
24844,
32494,
220,
220,
6208,
24376,
198,
2,
357,
18076,
453,
11,
517,
25,
8,
198,
2,
24844,
32494,
220,
220,
6208,
24376,
14,
26314,
26314,
198,
2,
357,
265,
886,
8,
198,
2,
11420,
357,
47924,
91,
7708,
4146,
91,
18831,
4061,
2599,
220,
6208,
24376,
357,
67,
333,
8,
198,
2,
357,
18076,
453,
11,
517,
8,
198,
2,
11420,
357,
47,
1921,
5432,
91,
7708,
4146,
91,
18831,
4061,
2599,
6208,
24376,
14,
26314,
26314,
357,
67,
333,
8,
198,
2,
357,
265,
886,
286,
279,
10025,
8,
198,
2,
41752,
91,
7708,
4146,
198,
2,
12876,
220,
198
] | 2.16868 | 2,235 |
from .timefrequency_convert import *
from .timefrequency_crud import *
from .timefrequency_identify import *
from .timefrequency_resolution import *
| [
6738,
764,
2435,
35324,
62,
1102,
1851,
1330,
1635,
198,
6738,
764,
2435,
35324,
62,
6098,
463,
1330,
1635,
198,
6738,
764,
2435,
35324,
62,
738,
1958,
1330,
1635,
198,
6738,
764,
2435,
35324,
62,
29268,
1330,
1635,
628
] | 3.846154 | 39 |
from todolist_backend.models.classes import BaseODM
| [
6738,
284,
67,
349,
396,
62,
1891,
437,
13,
27530,
13,
37724,
1330,
7308,
3727,
44,
628,
628
] | 3.055556 | 18 |
__URL_EU = 'https://api-eu.restb.ai'
__URL_US = 'https://api-us.restb.ai'
__ENDPOINT = '/vision/v2/predict'
__ENDPOINT_MULTIPREDICT = '/vision/v2/multipredict'
__MODELS = [
're_roomtype_global_v2',
're_exterior_styles',
're_features_v3',
're_logo',
're_appliances_v2',
're_compliance',
're_condition'
]
__PARAMS = {
'client_key': None,
'model_id': None,
'image_url': None,
'image_base64': None
}
__all__ = [
'__URL_EU',
'__URL_US',
'__ENDPOINT',
'__ENDPOINT_MULTIPREDICT',
'__MODELS',
'__PARAMS'
]
| [
834,
21886,
62,
19684,
796,
705,
5450,
1378,
15042,
12,
12496,
13,
2118,
65,
13,
1872,
6,
198,
834,
21886,
62,
2937,
796,
705,
5450,
1378,
15042,
12,
385,
13,
2118,
65,
13,
1872,
6,
198,
834,
1677,
6322,
46,
12394,
796,
31051,
10178,
14,
85,
17,
14,
79,
17407,
6,
198,
834,
1677,
6322,
46,
12394,
62,
44,
16724,
4061,
22083,
18379,
796,
31051,
10178,
14,
85,
17,
14,
16680,
541,
17407,
6,
198,
834,
33365,
37142,
796,
685,
198,
220,
220,
220,
705,
260,
62,
3823,
4906,
62,
20541,
62,
85,
17,
3256,
198,
220,
220,
220,
705,
260,
62,
1069,
14172,
62,
47720,
3256,
198,
220,
220,
220,
705,
260,
62,
40890,
62,
85,
18,
3256,
198,
220,
220,
220,
705,
260,
62,
6404,
78,
3256,
198,
220,
220,
220,
705,
260,
62,
1324,
75,
16097,
62,
85,
17,
3256,
198,
220,
220,
220,
705,
260,
62,
47587,
3256,
198,
220,
220,
220,
705,
260,
62,
31448,
6,
198,
60,
198,
834,
27082,
40834,
796,
1391,
198,
220,
220,
220,
705,
16366,
62,
2539,
10354,
6045,
11,
198,
220,
220,
220,
705,
19849,
62,
312,
10354,
6045,
11,
198,
220,
220,
220,
705,
9060,
62,
6371,
10354,
6045,
11,
198,
220,
220,
220,
705,
9060,
62,
8692,
2414,
10354,
6045,
198,
92,
628,
198,
834,
439,
834,
796,
685,
198,
220,
220,
220,
705,
834,
21886,
62,
19684,
3256,
198,
220,
220,
220,
705,
834,
21886,
62,
2937,
3256,
198,
220,
220,
220,
705,
834,
1677,
6322,
46,
12394,
3256,
198,
220,
220,
220,
705,
834,
1677,
6322,
46,
12394,
62,
44,
16724,
4061,
22083,
18379,
3256,
198,
220,
220,
220,
705,
834,
33365,
37142,
3256,
198,
220,
220,
220,
705,
834,
27082,
40834,
6,
198,
60,
198
] | 1.95189 | 291 |
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 9 14:01:42 2021
@author: Ghozy El Fatih
"""
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy.interpolate as inter
from PIL import Image
#load gambar semblance
path_gambar = "IMAGE_PATH\\"
path_pick = "PICK_PATH\\normpick"
gambar = "*"
img = []
pick1 = []
for i in gambar:
gg = Image.open(path_gambar+i+".png")
img.append(gg)
pp = np.loadtxt("interp_normpick"+i+".txt")
pp = pp[:,0]
pick1.append(pp)
pick1 = np.array(pick1)
pick1 = np.reshape(pick1,(10,80)).T
pick2 = np.zeros([80,200])
for i in range(10):
aa = list(pick1[:,i])*20
aa = np.array(aa)
aa = np.reshape(aa,(20,80)).T
pick2[:,i*20:(i+1)*20] = aa
# sort the coordinate
# normalize coordinate from pixel to x = velocity, y = time
x_pick,y_pick = selection_sort(pick[:,0]),selection_sort(pick[:,1])
norm_x_pick = ((x_pick-0))/(500-0)*(4000-1000)+1000
norm_y_pick = ((y_pick-0))/(500-0)*(3-0)+0
norm = np.array([norm_x_pick,norm_y_pick]).T
savenorm = np.savetxt('normpick'+gambar+'.txt',norm)
vel = pick2[:,0]
t = pick2[:,1]
t[len(t)-1] = 3
t[0] = 0
y = t
x = vel
# Interpolate the data using a cubic spline to "new_length" samples
new_length = 80
new_y = np.linspace(np.min(y), np.max(y), new_length)
new_x = inter.interp1d(y, x, kind='linear')(new_y)
new = np.array([new_x,new_y]).T
neww = np.savetxt("interp_normpick"+no+".txt",new)
# load rms buat pembanding
path_rms = "C:\\Users\\Acer\\OneDrive - UNIVERSITAS INDONESIA\\Documents\\Kuliah\\Crispy\\velocity rms\\RMS Model 3\\"
rms1 = pd.read_csv(path_rms+"RMS_3_80x200_1.csv",header=None)
rms1 = np.array(rms1)
rms = rms1[:,20]
Y = np.linspace(0,3,80)
error = (abs(rms1-pick2)/rms1)*100
mean_error = np.mean(error)/2
plt.figure()
plt.suptitle('Perbandingan RMS Velocity Map, Error : '+str(round(mean_error,3))+'%',fontsize=20)
plt.subplot(211)
plt.title('RMS Velocity Hasil Pick CNN')
plt.imshow(rms1,extent=[0,10000,3,0],aspect='auto',cmap='jet',interpolation='bicubic')
plt.ylabel('Kedalaman (s)')
plt.subplot(212)
plt.title('RMS Velocity Hasil Perhitungan')
plt.imshow(rms1,extent=[0,10000,3,0],aspect='auto',cmap='jet',interpolation='bicubic')
plt.xlabel('Offset (m)')
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
37811,
201,
198,
41972,
319,
3300,
7653,
220,
860,
1478,
25,
486,
25,
3682,
33448,
201,
198,
201,
198,
31,
9800,
25,
402,
8873,
7357,
2574,
12301,
4449,
201,
198,
37811,
201,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
11748,
19798,
292,
355,
279,
67,
201,
198,
11748,
629,
541,
88,
13,
3849,
16104,
378,
355,
987,
201,
198,
6738,
350,
4146,
1330,
7412,
201,
198,
201,
198,
2,
2220,
45756,
283,
45960,
201,
198,
6978,
62,
70,
4131,
283,
796,
366,
3955,
11879,
62,
34219,
6852,
1,
201,
198,
6978,
62,
27729,
796,
366,
47,
11860,
62,
34219,
6852,
27237,
27729,
1,
201,
198,
70,
4131,
283,
796,
366,
9,
1,
201,
198,
201,
198,
9600,
796,
17635,
201,
198,
27729,
16,
796,
17635,
201,
198,
1640,
1312,
287,
45756,
283,
25,
201,
198,
220,
220,
220,
308,
70,
796,
7412,
13,
9654,
7,
6978,
62,
70,
4131,
283,
10,
72,
10,
1911,
11134,
4943,
201,
198,
220,
220,
220,
33705,
13,
33295,
7,
1130,
8,
201,
198,
220,
220,
220,
9788,
796,
45941,
13,
2220,
14116,
7203,
3849,
79,
62,
27237,
27729,
1,
10,
72,
10,
1911,
14116,
4943,
201,
198,
220,
220,
220,
9788,
796,
9788,
58,
45299,
15,
60,
201,
198,
220,
220,
220,
2298,
16,
13,
33295,
7,
381,
8,
201,
198,
201,
198,
27729,
16,
796,
45941,
13,
18747,
7,
27729,
16,
8,
201,
198,
27729,
16,
796,
45941,
13,
3447,
1758,
7,
27729,
16,
11,
7,
940,
11,
1795,
29720,
51,
201,
198,
201,
198,
27729,
17,
796,
45941,
13,
9107,
418,
26933,
1795,
11,
2167,
12962,
201,
198,
1640,
1312,
287,
2837,
7,
940,
2599,
201,
198,
220,
220,
220,
257,
64,
796,
1351,
7,
27729,
16,
58,
45299,
72,
12962,
9,
1238,
201,
198,
220,
220,
220,
257,
64,
796,
45941,
13,
18747,
7,
7252,
8,
201,
198,
220,
220,
220,
257,
64,
796,
45941,
13,
3447,
1758,
7,
7252,
11,
7,
1238,
11,
1795,
29720,
51,
201,
198,
220,
220,
220,
2298,
17,
58,
45299,
72,
9,
1238,
37498,
72,
10,
16,
27493,
1238,
60,
796,
257,
64,
201,
198,
201,
198,
2,
3297,
262,
20435,
201,
198,
201,
198,
2,
3487,
1096,
20435,
422,
17465,
284,
2124,
796,
15432,
11,
331,
796,
640,
201,
198,
220,
220,
201,
198,
87,
62,
27729,
11,
88,
62,
27729,
796,
6356,
62,
30619,
7,
27729,
58,
45299,
15,
46570,
49283,
62,
30619,
7,
27729,
58,
45299,
16,
12962,
201,
198,
27237,
62,
87,
62,
27729,
796,
14808,
87,
62,
27729,
12,
15,
4008,
29006,
4059,
12,
15,
27493,
7,
27559,
12,
12825,
47762,
12825,
201,
198,
27237,
62,
88,
62,
27729,
796,
14808,
88,
62,
27729,
12,
15,
4008,
29006,
4059,
12,
15,
27493,
7,
18,
12,
15,
47762,
15,
201,
198,
201,
198,
27237,
796,
45941,
13,
18747,
26933,
27237,
62,
87,
62,
27729,
11,
27237,
62,
88,
62,
27729,
35944,
51,
201,
198,
201,
198,
82,
4005,
579,
796,
45941,
13,
21928,
14116,
10786,
27237,
27729,
6,
10,
70,
4131,
283,
10,
4458,
14116,
3256,
27237,
8,
201,
198,
201,
198,
626,
796,
2298,
17,
58,
45299,
15,
60,
201,
198,
83,
796,
2298,
17,
58,
45299,
16,
60,
201,
198,
83,
58,
11925,
7,
83,
13219,
16,
60,
796,
513,
201,
198,
83,
58,
15,
60,
796,
657,
201,
198,
201,
198,
88,
796,
256,
201,
198,
87,
796,
11555,
201,
198,
201,
198,
2,
4225,
16104,
378,
262,
1366,
1262,
257,
27216,
4328,
500,
284,
366,
3605,
62,
13664,
1,
8405,
201,
198,
3605,
62,
13664,
796,
4019,
201,
198,
3605,
62,
88,
796,
45941,
13,
21602,
10223,
7,
37659,
13,
1084,
7,
88,
828,
45941,
13,
9806,
7,
88,
828,
649,
62,
13664,
8,
201,
198,
3605,
62,
87,
796,
987,
13,
3849,
79,
16,
67,
7,
88,
11,
2124,
11,
1611,
11639,
29127,
6,
5769,
3605,
62,
88,
8,
201,
198,
201,
198,
3605,
796,
45941,
13,
18747,
26933,
3605,
62,
87,
11,
3605,
62,
88,
35944,
51,
201,
198,
3605,
86,
796,
45941,
13,
21928,
14116,
7203,
3849,
79,
62,
27237,
27729,
1,
10,
3919,
10,
1911,
14116,
1600,
3605,
8,
201,
198,
201,
198,
2,
3440,
374,
907,
809,
265,
279,
368,
3903,
278,
201,
198,
6978,
62,
81,
907,
796,
366,
34,
25,
6852,
14490,
6852,
32,
2189,
6852,
3198,
24825,
532,
49677,
2043,
1921,
24413,
39677,
3539,
6852,
38354,
6852,
42,
377,
9520,
6852,
34,
2442,
9078,
6852,
626,
11683,
374,
907,
6852,
49,
5653,
9104,
513,
6852,
1,
201,
198,
81,
907,
16,
796,
279,
67,
13,
961,
62,
40664,
7,
6978,
62,
81,
907,
10,
1,
49,
5653,
62,
18,
62,
1795,
87,
2167,
62,
16,
13,
40664,
1600,
25677,
28,
14202,
8,
201,
198,
81,
907,
16,
796,
45941,
13,
18747,
7,
81,
907,
16,
8,
201,
198,
81,
907,
796,
374,
907,
16,
58,
45299,
1238,
60,
201,
198,
56,
796,
45941,
13,
21602,
10223,
7,
15,
11,
18,
11,
1795,
8,
201,
198,
201,
198,
18224,
796,
357,
8937,
7,
81,
907,
16,
12,
27729,
17,
20679,
81,
907,
16,
27493,
3064,
201,
198,
32604,
62,
18224,
796,
45941,
13,
32604,
7,
18224,
20679,
17,
201,
198,
201,
198,
489,
83,
13,
26875,
3419,
201,
198,
489,
83,
13,
2385,
457,
2578,
10786,
5990,
3903,
278,
272,
371,
5653,
43137,
9347,
11,
13047,
1058,
705,
10,
2536,
7,
744,
7,
32604,
62,
18224,
11,
18,
4008,
10,
6,
4,
3256,
10331,
7857,
28,
1238,
8,
201,
198,
489,
83,
13,
7266,
29487,
7,
21895,
8,
201,
198,
489,
83,
13,
7839,
10786,
49,
5653,
43137,
7875,
346,
12346,
8100,
11537,
201,
198,
489,
83,
13,
320,
12860,
7,
81,
907,
16,
11,
2302,
298,
41888,
15,
11,
49388,
11,
18,
11,
15,
4357,
292,
806,
11639,
23736,
3256,
66,
8899,
11639,
31173,
3256,
3849,
16104,
341,
11639,
65,
291,
549,
291,
11537,
201,
198,
489,
83,
13,
2645,
9608,
10786,
42,
276,
282,
10546,
357,
82,
8,
11537,
201,
198,
489,
83,
13,
7266,
29487,
7,
21777,
8,
201,
198,
489,
83,
13,
7839,
10786,
49,
5653,
43137,
7875,
346,
2448,
17945,
403,
1030,
11537,
201,
198,
489,
83,
13,
320,
12860,
7,
81,
907,
16,
11,
2302,
298,
41888,
15,
11,
49388,
11,
18,
11,
15,
4357,
292,
806,
11639,
23736,
3256,
66,
8899,
11639,
31173,
3256,
3849,
16104,
341,
11639,
65,
291,
549,
291,
11537,
201,
198,
489,
83,
13,
87,
18242,
10786,
34519,
357,
76,
8,
11537,
201,
198
] | 2.091568 | 1,103 |
# -*- coding: utf-8 -*-
__name__ = 'google_streetview'
__author__ = 'Richard Wen'
__email__ = '[email protected]'
__version__ = '1.2.9'
__license__ = 'MIT'
__description__ = 'A command line tool and module for Google Street View Image API.'
__long_description_content_type__='text/markdown'
__keywords__ = [
'google',
'api',
'street',
'view',
'streetview',
'image',
'map',
'address',
'location',
'road',
'route',
'city',
'panorama',
'photo',
'cli',
'command',
'line',
'interface',
'tool',
'module']
__url__ = 'https://github.com/rrwen/google_streetview'
__download_url__ = 'https://github.com/rrwen/google_streetview/archive/master.zip'
__install_requires__ = [
'kwconfig',
'requests'
]
__packages__ = ['google_streetview']
__package_data__ = {'google_streetview': ['config.json']}
__entry_points__ = {'console_scripts': ['google_streetview=google_streetview.cli:run']}
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
201,
198,
834,
3672,
834,
796,
705,
13297,
62,
25662,
1177,
6,
201,
198,
834,
9800,
834,
796,
705,
22245,
31164,
6,
201,
198,
834,
12888,
834,
796,
705,
21062,
21006,
13,
7959,
31,
14816,
13,
785,
6,
201,
198,
834,
9641,
834,
796,
705,
16,
13,
17,
13,
24,
6,
201,
198,
834,
43085,
834,
796,
705,
36393,
6,
201,
198,
834,
11213,
834,
796,
705,
32,
3141,
1627,
2891,
290,
8265,
329,
3012,
3530,
3582,
7412,
7824,
2637,
201,
198,
834,
6511,
62,
11213,
62,
11299,
62,
4906,
834,
11639,
5239,
14,
4102,
2902,
6,
201,
198,
834,
2539,
10879,
834,
796,
685,
201,
198,
220,
705,
13297,
3256,
201,
198,
220,
705,
15042,
3256,
201,
198,
220,
705,
25662,
3256,
201,
198,
220,
705,
1177,
3256,
201,
198,
220,
705,
25662,
1177,
3256,
201,
198,
220,
705,
9060,
3256,
201,
198,
220,
705,
8899,
3256,
201,
198,
220,
705,
21975,
3256,
201,
198,
220,
705,
24886,
3256,
201,
198,
220,
705,
6344,
3256,
201,
198,
220,
705,
38629,
3256,
201,
198,
220,
705,
19205,
3256,
201,
198,
220,
705,
6839,
36161,
3256,
201,
198,
220,
705,
23074,
3256,
201,
198,
220,
705,
44506,
3256,
201,
198,
220,
705,
21812,
3256,
220,
201,
198,
220,
705,
1370,
3256,
201,
198,
220,
705,
39994,
3256,
201,
198,
220,
705,
25981,
3256,
201,
198,
220,
705,
21412,
20520,
201,
198,
834,
6371,
834,
796,
705,
5450,
1378,
12567,
13,
785,
14,
21062,
21006,
14,
13297,
62,
25662,
1177,
6,
201,
198,
834,
15002,
62,
6371,
834,
796,
705,
5450,
1378,
12567,
13,
785,
14,
21062,
21006,
14,
13297,
62,
25662,
1177,
14,
17474,
14,
9866,
13,
13344,
6,
201,
198,
834,
17350,
62,
47911,
834,
796,
685,
201,
198,
220,
705,
46265,
11250,
3256,
201,
198,
220,
705,
8897,
3558,
6,
201,
198,
60,
201,
198,
834,
43789,
834,
796,
37250,
13297,
62,
25662,
1177,
20520,
201,
198,
834,
26495,
62,
7890,
834,
796,
1391,
6,
13297,
62,
25662,
1177,
10354,
37250,
11250,
13,
17752,
20520,
92,
201,
198,
834,
13000,
62,
13033,
834,
796,
1391,
6,
41947,
62,
46521,
10354,
37250,
13297,
62,
25662,
1177,
28,
13297,
62,
25662,
1177,
13,
44506,
25,
5143,
20520,
92,
201,
198
] | 2.492188 | 384 |
task_estimated_time = 25 # minutes
tasks_arriving_distribution_params = 20, 6 # normal distribution with mean 20 and sd 6
| [
198,
35943,
62,
395,
15655,
62,
2435,
796,
1679,
1303,
2431,
198,
83,
6791,
62,
283,
380,
1075,
62,
17080,
3890,
62,
37266,
796,
1160,
11,
718,
1303,
3487,
6082,
351,
1612,
1160,
290,
45647,
718,
198
] | 3.324324 | 37 |
a = ('zero', 'um', 'dois', 'três', 'quatro', 'cinco', 'seis', 'sete', 'oito', 'nove', 'dez', 'onze', 'doze', 'treze', 'cartoze', 'quinze')
n = int(input('DIGITE UM NÚMERO DE 0 A 15: '))
if n > 15 or n < 0:
while True:
n = int(input('DIGITE UM NÚMERO DE 0 A 15: '))
if 0 <= n <= 15:
break
print(f'Você digitou o numéro {a[n]}') | [
64,
796,
19203,
22570,
3256,
705,
388,
3256,
705,
4598,
271,
3256,
705,
2213,
25792,
82,
3256,
705,
421,
47756,
3256,
705,
17879,
1073,
3256,
705,
325,
271,
3256,
705,
2617,
68,
3256,
705,
78,
10094,
3256,
705,
77,
659,
3256,
705,
2934,
89,
3256,
705,
261,
2736,
3256,
705,
4598,
2736,
3256,
705,
33945,
2736,
3256,
705,
26674,
78,
2736,
3256,
705,
21915,
2736,
11537,
198,
77,
796,
493,
7,
15414,
10786,
35,
3528,
12709,
44352,
399,
127,
248,
29296,
46,
5550,
657,
317,
1315,
25,
705,
4008,
198,
361,
299,
1875,
1315,
393,
299,
1279,
657,
25,
198,
220,
220,
220,
981,
6407,
25,
198,
220,
220,
220,
220,
220,
220,
220,
299,
796,
493,
7,
15414,
10786,
35,
3528,
12709,
44352,
399,
127,
248,
29296,
46,
5550,
657,
317,
1315,
25,
705,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
611,
657,
19841,
299,
19841,
1315,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2270,
198,
4798,
7,
69,
6,
53,
420,
25792,
16839,
280,
267,
997,
2634,
305,
1391,
64,
58,
77,
48999,
11537
] | 1.945652 | 184 |
import importlib
import os
testdir = os.path.dirname(os.path.realpath("__file__"))
srcdir = 'src/main/python/daggit'
abs_path = os.path.join(testdir, srcdir)
| [
11748,
1330,
8019,
198,
11748,
28686,
198,
198,
9288,
15908,
796,
28686,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
5305,
6978,
7203,
834,
7753,
834,
48774,
198,
10677,
15908,
796,
705,
10677,
14,
12417,
14,
29412,
14,
67,
9460,
270,
6,
198,
8937,
62,
6978,
796,
28686,
13,
6978,
13,
22179,
7,
9288,
15908,
11,
12351,
15908,
8,
628
] | 2.580645 | 62 |
import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="rfm",
version="1.0.7",
author="Suresh Sonwane",
author_email="[email protected]",
description="Python Package for RFM Analysis and Customer Segmentation",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/sonwanesuresh95/rfm",
project_urls={
"Bug Tracker": "https://github.com/sonwanesuresh95/rfm/issues",
},
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
package_dir={"": "."},
packages=setuptools.find_packages(where="."),
python_requires=">=3.6",
install_requires=['pandas>=1.2.4', 'numpy>=1.20.1', 'matplotlib>=3.3.4']
)
| [
11748,
900,
37623,
10141,
201,
198,
201,
198,
4480,
1280,
7203,
15675,
11682,
13,
9132,
1600,
366,
81,
1600,
21004,
2625,
40477,
12,
23,
4943,
355,
277,
71,
25,
201,
198,
220,
220,
220,
890,
62,
11213,
796,
277,
71,
13,
961,
3419,
201,
198,
201,
198,
2617,
37623,
10141,
13,
40406,
7,
201,
198,
220,
220,
220,
1438,
2625,
81,
38353,
1600,
201,
198,
220,
220,
220,
2196,
2625,
16,
13,
15,
13,
22,
1600,
201,
198,
220,
220,
220,
1772,
2625,
50,
942,
71,
6295,
86,
1531,
1600,
201,
198,
220,
220,
220,
1772,
62,
12888,
2625,
1559,
86,
7305,
942,
71,
22,
2670,
31,
14816,
13,
785,
1600,
201,
198,
220,
220,
220,
6764,
2625,
37906,
15717,
329,
20445,
44,
14691,
290,
22092,
1001,
5154,
341,
1600,
201,
198,
220,
220,
220,
890,
62,
11213,
28,
6511,
62,
11213,
11,
201,
198,
220,
220,
220,
890,
62,
11213,
62,
11299,
62,
4906,
2625,
5239,
14,
4102,
2902,
1600,
201,
198,
220,
220,
220,
19016,
2625,
5450,
1378,
12567,
13,
785,
14,
1559,
86,
7305,
942,
71,
3865,
14,
81,
38353,
1600,
201,
198,
220,
220,
220,
1628,
62,
6371,
82,
34758,
201,
198,
220,
220,
220,
220,
220,
220,
220,
366,
25624,
26885,
1298,
366,
5450,
1378,
12567,
13,
785,
14,
1559,
86,
7305,
942,
71,
3865,
14,
81,
38353,
14,
37165,
1600,
201,
198,
220,
220,
220,
8964,
201,
198,
220,
220,
220,
1398,
13350,
41888,
201,
198,
220,
220,
220,
220,
220,
220,
220,
366,
15167,
2229,
15417,
7904,
11361,
7904,
513,
1600,
201,
198,
220,
220,
220,
220,
220,
220,
220,
366,
34156,
7904,
7294,
40,
20010,
1079,
7904,
17168,
13789,
1600,
201,
198,
220,
220,
220,
220,
220,
220,
220,
366,
18843,
803,
4482,
7904,
7294,
13362,
1600,
201,
198,
220,
220,
220,
16589,
201,
198,
220,
220,
220,
5301,
62,
15908,
28,
4895,
1298,
366,
526,
5512,
201,
198,
220,
220,
220,
10392,
28,
2617,
37623,
10141,
13,
19796,
62,
43789,
7,
3003,
2625,
526,
828,
201,
198,
220,
220,
220,
21015,
62,
47911,
2625,
29,
28,
18,
13,
21,
1600,
201,
198,
220,
220,
220,
2721,
62,
47911,
28,
17816,
79,
392,
292,
29,
28,
16,
13,
17,
13,
19,
3256,
705,
77,
32152,
29,
28,
16,
13,
1238,
13,
16,
3256,
705,
6759,
29487,
8019,
29,
28,
18,
13,
18,
13,
19,
20520,
201,
198,
8,
201,
198
] | 2.341709 | 398 |
#!/usr/bin/env python
import cv2 as cv
import numpy as np
import matplotlib.pyplot as plt
cap = cv.VideoCapture(0)
plt.ion()
fig = plt.figure(figsize=(10,3))
fig.suptitle('histogram')
ax = fig.add_axes([-0.25,0,1,1])
im = ax.imshow(np.zeros((480,640)),'gray',vmin=0,vmax=255)
ax.set_axis_off();
ax2 = fig.add_axes([0.55,0.1,0.4,0.8])
l1, = ax2.plot([], [], '-r',lw=2)
ax2.set_xlim(0,255)
ax2.set_ylim(0,10000)
plt.show()
for _ in range(100):
ret, frame = cap.read()
x = cv.cvtColor(frame,cv.COLOR_BGR2GRAY)
im.set_data(x)
h,b = np.histogram(x, np.arange(257))
l1.set_data(b[1:],h);
plt.pause(0.001)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
269,
85,
17,
355,
269,
85,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
11128,
796,
269,
85,
13,
10798,
49630,
7,
15,
8,
198,
198,
489,
83,
13,
295,
3419,
198,
5647,
796,
458,
83,
13,
26875,
7,
5647,
7857,
16193,
940,
11,
18,
4008,
198,
5647,
13,
2385,
457,
2578,
10786,
10034,
21857,
11537,
198,
198,
897,
796,
2336,
13,
2860,
62,
897,
274,
26933,
12,
15,
13,
1495,
11,
15,
11,
16,
11,
16,
12962,
198,
320,
796,
7877,
13,
320,
12860,
7,
37659,
13,
9107,
418,
19510,
22148,
11,
31102,
36911,
6,
44605,
3256,
85,
1084,
28,
15,
11,
85,
9806,
28,
13381,
8,
198,
897,
13,
2617,
62,
22704,
62,
2364,
9783,
198,
198,
897,
17,
796,
2336,
13,
2860,
62,
897,
274,
26933,
15,
13,
2816,
11,
15,
13,
16,
11,
15,
13,
19,
11,
15,
13,
23,
12962,
198,
75,
16,
11,
796,
7877,
17,
13,
29487,
26933,
4357,
685,
4357,
705,
12,
81,
3256,
75,
86,
28,
17,
8,
198,
897,
17,
13,
2617,
62,
87,
2475,
7,
15,
11,
13381,
8,
198,
897,
17,
13,
2617,
62,
88,
2475,
7,
15,
11,
49388,
8,
198,
198,
489,
83,
13,
12860,
3419,
198,
198,
1640,
4808,
287,
2837,
7,
3064,
2599,
198,
220,
220,
220,
1005,
11,
5739,
796,
1451,
13,
961,
3419,
198,
220,
220,
220,
220,
198,
220,
220,
220,
2124,
796,
269,
85,
13,
33967,
83,
10258,
7,
14535,
11,
33967,
13,
46786,
62,
33,
10761,
17,
38,
30631,
8,
198,
220,
220,
220,
545,
13,
2617,
62,
7890,
7,
87,
8,
628,
220,
220,
220,
289,
11,
65,
796,
45941,
13,
10034,
21857,
7,
87,
11,
45941,
13,
283,
858,
7,
28676,
4008,
628,
220,
220,
220,
300,
16,
13,
2617,
62,
7890,
7,
65,
58,
16,
25,
4357,
71,
1776,
628,
220,
220,
220,
458,
83,
13,
32125,
7,
15,
13,
8298,
8,
628
] | 1.884956 | 339 |
import logging
from sklearn.ensemble import RandomForestRegressor
from skopt.space import Integer
from lib.models import SKModel
| [
11748,
18931,
198,
198,
6738,
1341,
35720,
13,
1072,
11306,
1330,
14534,
34605,
8081,
44292,
198,
6738,
1341,
8738,
13,
13200,
1330,
34142,
198,
198,
6738,
9195,
13,
27530,
1330,
14277,
17633,
628
] | 4 | 33 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from web import template
from configuration import WEBSITE_NAME, ADMIN_VERSION
from auth import get_logged_user, get_logoff_url
from model import get_exposed_managed_tables
import os
rootpath = os.path.abspath(os.path.dirname(__file__))
admin_template_path = template.render(rootpath + '/templates/admin', cache=False)
| [
2,
48443,
14629,
14,
8800,
14,
29412,
201,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
6738,
3992,
1330,
11055,
201,
198,
6738,
8398,
1330,
12887,
4462,
12709,
62,
20608,
11,
5984,
23678,
62,
43717,
201,
198,
6738,
6284,
1330,
651,
62,
6404,
2004,
62,
7220,
11,
651,
62,
6404,
2364,
62,
6371,
201,
198,
6738,
2746,
1330,
651,
62,
11201,
1335,
62,
39935,
62,
83,
2977,
201,
198,
201,
198,
11748,
28686,
201,
198,
15763,
6978,
796,
28686,
13,
6978,
13,
397,
2777,
776,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
4008,
201,
198,
201,
198,
28482,
62,
28243,
62,
6978,
796,
11055,
13,
13287,
7,
15763,
6978,
1343,
31051,
11498,
17041,
14,
28482,
3256,
12940,
28,
25101,
8,
201,
198
] | 2.791045 | 134 |
__version__='0.41-beta'
| [
834,
9641,
834,
11639,
15,
13,
3901,
12,
31361,
6,
198
] | 2.181818 | 11 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import serial
import click
import platform
import glob
import json
import signal
import sys
from itertools import cycle
from influxdb import InfluxDBClient
serial_port = serial.Serial()
client = None
progress_pool = cycle(["_ ", "__ ", "___"])
@click.command()
@click.option('--baud_rate', default = 19200, help='Override the default baud_rate value.')
@click.option('--verbose', default = False, help='Prints the retrieved json on console.')
def routine(verbose, baud_rate):
"""
This script intends to log the data output from an Arduino connected to the PC
and running the MPU-9250 firmware provided.
The data is logged to an InfluxDB instance as soon as it arrives.
All tuning/synchronization is untested and there may be race around conditions
here.
"""
open_serial_port(baud_rate)
click.secho("[INF] ", fg = 'cyan', nl = False)
click.secho("Serial Port '{0}' opened.".format(serial_port.name))
while True:
try:
line = serial_port.readline().decode('utf-8')
act_upon(line)
except Exception:
click.secho("\n[ERR] ", fg = 'cyan', nl = False, err = True)
click.secho("Connection Lost.", err = True, fg = 'red')
click.secho("[INF] ", fg = 'cyan', nl = False)
click.secho("Terminating Process.")
sys.exit(1)
def open_serial_port(baud_rate):
"""
Prompts to select the correct Serial Port and then uses that to gather the
data from.
"""
global serial_port
ports = list_serial_ports()
for index, port in enumerate(ports, start = 1):
click.secho("[{0}]".format(index), fg = 'cyan', nl = False)
click.secho(" {0}".format(port), fg = 'yellow')
port_number = click.prompt('Please enter the Serial Port Number', type = int)
try:
ser = serial.Serial(ports[port_number - 1], baud_rate)
serial_port = ser
except IndexError:
click.secho("[ERR] ", fg = 'cyan', nl = False, err = True)
click.secho("Incorrect port number. Terminating.", err = True, fg = 'red')
sys.exit(1)
except Exception:
click.secho("[ERR] ", fg = 'cyan', nl = False, err = True)
click.secho("Cannot open the Serial Port at '{0}'.".format(ports[port_number - 1]), err = True, fg = 'red')
click.secho("[INF] ", fg = 'cyan', nl = False)
click.secho("Terminating Process.".format(index))
sys.exit(1)
def act_upon(line):
"""
Acts upon the lines received from the Device.
"""
try:
dat = json.loads(line)
if all([
'A' in dat,
'G' in dat,
'C' in dat
]):
inf = click.style("[LOGGING DATA] {0}".format(next(progress_pool)), fg = 'cyan')
click.secho('\r{0}'.format(inf), nl = False)
# Add data in influx now
json_body = [
{
"measurement": "accelerometer",
"tags": {
"host": "server01",
},
"fields": {
"x": dat['A'][0],
"y": dat['A'][1],
"z": dat['A'][2]
}
},
{
"measurement": "gyroscope",
"tags": {
"host": "server01",
},
"fields": {
"x": dat['G'][0],
"y": dat['G'][1],
"z": dat['G'][2]
}
},
{
"measurement": "magnetometer",
"tags": {
"host": "server01",
},
"fields": {
"x": dat['C'][0],
"y": dat['C'][1],
"z": dat['C'][2]
}
}
]
client.write_points(json_body)
except ValueError:
if "ok" in line:
click.secho("[INF] ", fg = 'cyan', nl = False)
click.secho("Sensors are Online. Beginning Data Logging.")
click.secho("[INF] ", fg = 'yellow', nl = False)
click.secho("Press CTRL + C to stop.", )
if "L" in line:
click.echo(line)
if "M" in line:
click.echo(line)
def signal_handler(signal, frame):
"""
Handles SIGINT.
"""
click.secho("\n[INF] ", fg = 'cyan', nl = False)
click.secho("Closing Ports and Exiting.")
serial_port.close()
sys.exit(0)
def list_serial_ports():
"""
Scans and lists the available Serial Ports.
"""
system_name = platform.system()
if system_name == "Windows":
# Scan for available ports.
available = []
for i in range(256):
try:
s = serial.Serial(i)
available.append(i)
s.close()
except serial.SerialException:
pass
return available
elif system_name == "Darwin":
# Mac
return glob.glob('/dev/tty.*') #+ glob.glob('/dev/cu.*')
else:
# Assume Linux or something else
return glob.glob('/dev/ttyS*') + glob.glob('/dev/ttyUSB*')
if __name__ == '__main__':
signal.signal(signal.SIGINT, signal_handler)
client = InfluxDBClient('localhost', 8086, 'root', 'root', 'example')
#client.create_database('example')
routine()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
11389,
198,
11748,
3904,
198,
11748,
3859,
198,
11748,
15095,
198,
11748,
33918,
198,
11748,
6737,
198,
11748,
25064,
198,
6738,
340,
861,
10141,
1330,
6772,
198,
6738,
25065,
9945,
1330,
4806,
22564,
11012,
11792,
198,
198,
46911,
62,
634,
796,
11389,
13,
32634,
3419,
198,
16366,
796,
6045,
198,
33723,
62,
7742,
796,
6772,
7,
14692,
62,
220,
33172,
366,
834,
33172,
366,
17569,
8973,
8,
198,
198,
31,
12976,
13,
21812,
3419,
198,
31,
12976,
13,
18076,
10786,
438,
65,
3885,
62,
4873,
3256,
4277,
796,
678,
2167,
11,
1037,
11639,
37961,
262,
4277,
275,
3885,
62,
4873,
1988,
2637,
8,
198,
31,
12976,
13,
18076,
10786,
438,
19011,
577,
3256,
4277,
796,
10352,
11,
1037,
11639,
18557,
82,
262,
29517,
33918,
319,
8624,
2637,
8,
198,
4299,
8027,
7,
19011,
577,
11,
275,
3885,
62,
4873,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
770,
4226,
19582,
284,
2604,
262,
1366,
5072,
422,
281,
27634,
5884,
284,
262,
4217,
198,
220,
220,
220,
290,
2491,
262,
4904,
52,
12,
5892,
1120,
18779,
2810,
13,
198,
220,
220,
220,
383,
1366,
318,
18832,
284,
281,
4806,
22564,
11012,
4554,
355,
2582,
355,
340,
14443,
13,
628,
220,
220,
220,
1439,
24549,
14,
28869,
11413,
1634,
318,
1418,
7287,
290,
612,
743,
307,
3234,
1088,
3403,
198,
220,
220,
220,
994,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
1280,
62,
46911,
62,
634,
7,
65,
3885,
62,
4873,
8,
198,
220,
220,
220,
3904,
13,
325,
6679,
7203,
58,
1268,
37,
60,
33172,
277,
70,
796,
705,
948,
272,
3256,
299,
75,
796,
10352,
8,
198,
220,
220,
220,
3904,
13,
325,
6679,
7203,
32634,
4347,
705,
90,
15,
92,
6,
4721,
526,
13,
18982,
7,
46911,
62,
634,
13,
3672,
4008,
198,
220,
220,
220,
981,
6407,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1627,
796,
11389,
62,
634,
13,
961,
1370,
22446,
12501,
1098,
10786,
40477,
12,
23,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
719,
62,
27287,
7,
1370,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2845,
35528,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3904,
13,
325,
6679,
7203,
59,
77,
58,
1137,
49,
60,
33172,
277,
70,
796,
705,
948,
272,
3256,
299,
75,
796,
10352,
11,
11454,
796,
6407,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3904,
13,
325,
6679,
7203,
32048,
9164,
33283,
11454,
796,
6407,
11,
277,
70,
796,
705,
445,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3904,
13,
325,
6679,
7203,
58,
1268,
37,
60,
33172,
277,
70,
796,
705,
948,
272,
3256,
299,
75,
796,
10352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3904,
13,
325,
6679,
7203,
44798,
803,
10854,
19570,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25064,
13,
37023,
7,
16,
8,
198,
198,
4299,
1280,
62,
46911,
62,
634,
7,
65,
3885,
62,
4873,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
45965,
82,
284,
2922,
262,
3376,
23283,
4347,
290,
788,
3544,
326,
284,
6431,
262,
198,
220,
220,
220,
1366,
422,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
3298,
11389,
62,
634,
628,
220,
220,
220,
14090,
796,
1351,
62,
46911,
62,
3742,
3419,
628,
220,
220,
220,
329,
6376,
11,
2493,
287,
27056,
378,
7,
3742,
11,
923,
796,
352,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
3904,
13,
325,
6679,
7203,
58,
90,
15,
92,
60,
1911,
18982,
7,
9630,
828,
277,
70,
796,
705,
948,
272,
3256,
299,
75,
796,
10352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
3904,
13,
325,
6679,
7203,
1391,
15,
92,
1911,
18982,
7,
634,
828,
220,
220,
277,
70,
796,
705,
36022,
11537,
628,
220,
220,
220,
2493,
62,
17618,
796,
3904,
13,
16963,
457,
10786,
5492,
3802,
262,
23283,
4347,
7913,
3256,
2099,
796,
493,
8,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1055,
796,
11389,
13,
32634,
7,
3742,
58,
634,
62,
17618,
532,
352,
4357,
275,
3885,
62,
4873,
8,
198,
220,
220,
220,
220,
220,
220,
220,
11389,
62,
634,
796,
1055,
198,
220,
220,
220,
2845,
12901,
12331,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3904,
13,
325,
6679,
7203,
58,
1137,
49,
60,
33172,
277,
70,
796,
705,
948,
272,
3256,
299,
75,
796,
10352,
11,
11454,
796,
6407,
8,
198,
220,
220,
220,
220,
220,
220,
220,
3904,
13,
325,
6679,
7203,
818,
30283,
2493,
1271,
13,
15527,
803,
33283,
11454,
796,
6407,
11,
277,
70,
796,
705,
445,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
25064,
13,
37023,
7,
16,
8,
198,
220,
220,
220,
2845,
35528,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3904,
13,
325,
6679,
7203,
58,
1137,
49,
60,
33172,
277,
70,
796,
705,
948,
272,
3256,
299,
75,
796,
10352,
11,
11454,
796,
6407,
8,
198,
220,
220,
220,
220,
220,
220,
220,
3904,
13,
325,
6679,
7203,
34,
34574,
1280,
262,
23283,
4347,
379,
705,
90,
15,
92,
30827,
13,
18982,
7,
3742,
58,
634,
62,
17618,
532,
352,
46570,
11454,
796,
6407,
11,
277,
70,
796,
705,
445,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
3904,
13,
325,
6679,
7203,
58,
1268,
37,
60,
33172,
277,
70,
796,
705,
948,
272,
3256,
299,
75,
796,
10352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
3904,
13,
325,
6679,
7203,
44798,
803,
10854,
526,
13,
18982,
7,
9630,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
25064,
13,
37023,
7,
16,
8,
198,
198,
4299,
719,
62,
27287,
7,
1370,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
25528,
2402,
262,
3951,
2722,
422,
262,
16232,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
4818,
796,
33918,
13,
46030,
7,
1370,
8,
198,
220,
220,
220,
220,
220,
220,
220,
611,
477,
26933,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
32,
6,
287,
4818,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
38,
6,
287,
4818,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
34,
6,
287,
4818,
198,
220,
220,
220,
220,
220,
220,
220,
2361,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1167,
796,
3904,
13,
7635,
7203,
58,
25294,
38,
2751,
42865,
60,
1391,
15,
92,
1911,
18982,
7,
19545,
7,
33723,
62,
7742,
36911,
277,
70,
796,
705,
948,
272,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3904,
13,
325,
6679,
10786,
59,
81,
90,
15,
92,
4458,
18982,
7,
10745,
828,
299,
75,
796,
10352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
3060,
1366,
287,
25065,
783,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33918,
62,
2618,
796,
685,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
1326,
5015,
434,
1298,
366,
330,
7015,
15635,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
31499,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
4774,
1298,
366,
15388,
486,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8964,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
25747,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
87,
1298,
4818,
17816,
32,
6,
7131,
15,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
88,
1298,
4818,
17816,
32,
6,
7131,
16,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
89,
1298,
4818,
17816,
32,
6,
7131,
17,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8964,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
1326,
5015,
434,
1298,
366,
1360,
305,
29982,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
31499,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
4774,
1298,
366,
15388,
486,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8964,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
25747,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
87,
1298,
4818,
17816,
38,
6,
7131,
15,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
88,
1298,
4818,
17816,
38,
6,
7131,
16,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
89,
1298,
4818,
17816,
38,
6,
7131,
17,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8964,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
1326,
5015,
434,
1298,
366,
19726,
3262,
15635,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
31499,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
4774,
1298,
366,
15388,
486,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8964,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
25747,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
87,
1298,
4818,
17816,
34,
6,
7131,
15,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
88,
1298,
4818,
17816,
34,
6,
7131,
16,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
89,
1298,
4818,
17816,
34,
6,
7131,
17,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2361,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5456,
13,
13564,
62,
13033,
7,
17752,
62,
2618,
8,
628,
220,
220,
220,
2845,
11052,
12331,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
366,
482,
1,
287,
1627,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3904,
13,
325,
6679,
7203,
58,
1268,
37,
60,
33172,
277,
70,
796,
705,
948,
272,
3256,
299,
75,
796,
10352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3904,
13,
325,
6679,
7203,
50,
641,
669,
389,
7467,
13,
25976,
6060,
5972,
2667,
19570,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3904,
13,
325,
6679,
7203,
58,
1268,
37,
60,
33172,
277,
70,
796,
705,
36022,
3256,
299,
75,
796,
10352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3904,
13,
325,
6679,
7203,
13800,
45249,
1343,
327,
284,
2245,
33283,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
611,
366,
43,
1,
287,
1627,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3904,
13,
30328,
7,
1370,
8,
198,
220,
220,
220,
220,
220,
220,
220,
611,
366,
44,
1,
287,
1627,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3904,
13,
30328,
7,
1370,
8,
198,
198,
4299,
6737,
62,
30281,
7,
12683,
282,
11,
5739,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
7157,
829,
33993,
12394,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
3904,
13,
325,
6679,
7203,
59,
77,
58,
1268,
37,
60,
33172,
277,
70,
796,
705,
948,
272,
3256,
299,
75,
796,
10352,
8,
198,
220,
220,
220,
3904,
13,
325,
6679,
7203,
2601,
2752,
30824,
290,
1475,
1780,
19570,
198,
220,
220,
220,
11389,
62,
634,
13,
19836,
3419,
198,
220,
220,
220,
25064,
13,
37023,
7,
15,
8,
198,
198,
4299,
1351,
62,
46911,
62,
3742,
33529,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1446,
504,
290,
8341,
262,
1695,
23283,
30824,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
1080,
62,
3672,
796,
3859,
13,
10057,
3419,
198,
220,
220,
220,
611,
1080,
62,
3672,
6624,
366,
11209,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
20937,
329,
1695,
14090,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1695,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
287,
2837,
7,
11645,
2599,
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,
264,
796,
11389,
13,
32634,
7,
72,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1695,
13,
33295,
7,
72,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
264,
13,
19836,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2845,
11389,
13,
32634,
16922,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1208,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
1695,
198,
220,
220,
220,
1288,
361,
1080,
62,
3672,
6624,
366,
32708,
5404,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
4100,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
15095,
13,
4743,
672,
10786,
14,
7959,
14,
42852,
15885,
11537,
1303,
10,
15095,
13,
4743,
672,
10786,
14,
7959,
14,
27399,
15885,
11537,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
2195,
2454,
7020,
393,
1223,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
15095,
13,
4743,
672,
10786,
14,
7959,
14,
42852,
50,
9,
11537,
1343,
15095,
13,
4743,
672,
10786,
14,
7959,
14,
42852,
27155,
9,
11537,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
6737,
13,
12683,
282,
7,
12683,
282,
13,
50,
3528,
12394,
11,
6737,
62,
30281,
8,
198,
220,
220,
220,
5456,
796,
4806,
22564,
11012,
11792,
10786,
36750,
3256,
41241,
21,
11,
705,
15763,
3256,
705,
15763,
3256,
705,
20688,
11537,
198,
220,
220,
220,
1303,
16366,
13,
17953,
62,
48806,
10786,
20688,
11537,
198,
220,
220,
220,
8027,
3419,
198
] | 1.957559 | 2,851 |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
import unittest
from libcloud.storage.drivers.rgw import S3RGWStorageDriver
from libcloud.storage.drivers.rgw import S3RGWOutscaleStorageDriver
from libcloud.storage.drivers.rgw import S3RGWConnectionAWS4
from libcloud.storage.drivers.rgw import S3RGWConnectionAWS2
from libcloud.test.secrets import STORAGE_S3_PARAMS
if __name__ == "__main__":
sys.exit(unittest.main())
| [
2,
49962,
284,
262,
24843,
10442,
5693,
357,
1921,
37,
8,
739,
530,
393,
517,
198,
2,
18920,
5964,
11704,
13,
220,
4091,
262,
28536,
2393,
9387,
351,
198,
2,
428,
670,
329,
3224,
1321,
5115,
6634,
9238,
13,
198,
2,
383,
7054,
37,
16625,
428,
2393,
284,
921,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
198,
2,
357,
1169,
366,
34156,
15341,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
198,
2,
262,
13789,
13,
220,
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,
11748,
25064,
198,
11748,
555,
715,
395,
198,
198,
6738,
9195,
17721,
13,
35350,
13,
36702,
13,
41345,
86,
1330,
311,
18,
49,
33191,
31425,
32103,
198,
6738,
9195,
17721,
13,
35350,
13,
36702,
13,
41345,
86,
1330,
311,
18,
49,
33191,
7975,
9888,
31425,
32103,
198,
6738,
9195,
17721,
13,
35350,
13,
36702,
13,
41345,
86,
1330,
311,
18,
49,
33191,
32048,
12298,
50,
19,
198,
6738,
9195,
17721,
13,
35350,
13,
36702,
13,
41345,
86,
1330,
311,
18,
49,
33191,
32048,
12298,
50,
17,
198,
198,
6738,
9195,
17721,
13,
9288,
13,
2363,
8004,
1330,
46366,
11879,
62,
50,
18,
62,
27082,
40834,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
25064,
13,
37023,
7,
403,
715,
395,
13,
12417,
28955,
198
] | 3.637771 | 323 |
"""Converts images to TFRecords file format with Example protos."""
import os
import sys
import glob
import json
import tensorflow as tf
from PIL import Image
import tifffile
import numpy as np
import Utils
from Label import class2label
def convertTo(
input_path_list,
output_path,
class_label_file_path,
organize_type,
is_3d=False,
resize=False,
new_size=None,
number=None):
''' create tfrecords file
input_path_list (string)
output_path (string) : tfrecords output file path
organize_type (int) : 1->organize by folder, 2->organize in one folder, 3->don't care label for gan
is_3d (bool) : is input image 3d
'''
global result
result = dict()
writer = tf.python_io.TFRecordWriter(output_path)
for input_path in input_path_list:
for image, label in _readFolders(
input_path,
class_label_file_path,
organize_type,
resize,
new_size,
is_3d,
number):
image_raw = image.tostring()
image_shape = image.shape
if is_3d:
example = tf.train.Example(
features=tf.train.Features(
feature={
'depth': _int64_feature(int(image_shape[0])),
'width': _int64_feature(int(image_shape[1])),
'height': _int64_feature(int(image_shape[2])),
'channel': _int64_feature(int(image_shape[3])),
'label': _int64_feature(int(label)),
'image_raw': _bytes_feature(image_raw)
}
)
)
else:
example = tf.train.Example(
features=tf.train.Features(
feature={
'height': _int64_feature(image_shape[0]),
'width': _int64_feature(image_shape[1]),
'depth': _int64_feature(image_shape[2]),
'label': _int64_feature(label),
'image_raw': _bytes_feature(image_raw)
}
)
)
writer.write(example.SerializeToString())
return result
if __name__ == '__main__':
tf.app.run()
| [
37811,
3103,
24040,
4263,
284,
24958,
6690,
3669,
2393,
5794,
351,
17934,
1237,
418,
526,
15931,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
15095,
198,
11748,
33918,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
350,
4146,
1330,
7412,
198,
11748,
256,
361,
487,
576,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
7273,
4487,
198,
6738,
36052,
1330,
1398,
17,
18242,
628,
628,
198,
4299,
10385,
2514,
7,
198,
220,
220,
220,
5128,
62,
6978,
62,
4868,
11,
198,
220,
220,
220,
5072,
62,
6978,
11,
198,
220,
220,
220,
1398,
62,
18242,
62,
7753,
62,
6978,
11,
198,
220,
220,
220,
16481,
62,
4906,
11,
198,
197,
271,
62,
18,
67,
28,
25101,
11,
198,
197,
411,
1096,
28,
25101,
11,
198,
220,
220,
220,
649,
62,
7857,
28,
14202,
11,
198,
220,
220,
220,
1271,
28,
14202,
2599,
198,
220,
220,
220,
705,
7061,
2251,
48700,
8344,
3669,
2393,
198,
220,
220,
220,
220,
220,
220,
220,
5128,
62,
6978,
62,
4868,
357,
8841,
8,
198,
220,
220,
220,
220,
220,
220,
220,
5072,
62,
6978,
357,
8841,
8,
1058,
48700,
8344,
3669,
5072,
2393,
3108,
198,
220,
220,
220,
220,
220,
220,
220,
16481,
62,
4906,
357,
600,
8,
1058,
352,
3784,
9971,
1096,
416,
9483,
11,
362,
3784,
9971,
1096,
287,
530,
9483,
11,
513,
3784,
9099,
470,
1337,
6167,
329,
308,
272,
198,
220,
220,
220,
220,
220,
220,
220,
318,
62,
18,
67,
357,
30388,
8,
1058,
318,
5128,
2939,
513,
67,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
3298,
1255,
198,
220,
220,
220,
1255,
796,
8633,
3419,
198,
220,
220,
220,
6260,
796,
48700,
13,
29412,
62,
952,
13,
10234,
23739,
34379,
7,
22915,
62,
6978,
8,
198,
220,
220,
220,
329,
5128,
62,
6978,
287,
5128,
62,
6978,
62,
4868,
25,
198,
220,
220,
220,
220,
220,
220,
220,
329,
2939,
11,
6167,
287,
4808,
961,
37,
727,
364,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5128,
62,
6978,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1398,
62,
18242,
62,
7753,
62,
6978,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16481,
62,
4906,
11,
198,
197,
197,
197,
411,
1096,
11,
198,
197,
197,
197,
3605,
62,
7857,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
62,
18,
67,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1271,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2939,
62,
1831,
796,
2939,
13,
83,
455,
1806,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2939,
62,
43358,
796,
2939,
13,
43358,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
318,
62,
18,
67,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1672,
796,
48700,
13,
27432,
13,
16281,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3033,
28,
27110,
13,
27432,
13,
23595,
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,
3895,
34758,
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,
705,
18053,
10354,
4808,
600,
2414,
62,
30053,
7,
600,
7,
9060,
62,
43358,
58,
15,
12962,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
10394,
10354,
4808,
600,
2414,
62,
30053,
7,
600,
7,
9060,
62,
43358,
58,
16,
12962,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
17015,
10354,
4808,
600,
2414,
62,
30053,
7,
600,
7,
9060,
62,
43358,
58,
17,
12962,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
17620,
10354,
4808,
600,
2414,
62,
30053,
7,
600,
7,
9060,
62,
43358,
58,
18,
12962,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
18242,
10354,
4808,
600,
2414,
62,
30053,
7,
600,
7,
18242,
36911,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
9060,
62,
1831,
10354,
4808,
33661,
62,
30053,
7,
9060,
62,
1831,
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,
1782,
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,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1672,
796,
48700,
13,
27432,
13,
16281,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3033,
28,
27110,
13,
27432,
13,
23595,
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,
3895,
34758,
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,
705,
17015,
10354,
4808,
600,
2414,
62,
30053,
7,
9060,
62,
43358,
58,
15,
46570,
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,
705,
10394,
10354,
4808,
600,
2414,
62,
30053,
7,
9060,
62,
43358,
58,
16,
46570,
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,
705,
18053,
10354,
4808,
600,
2414,
62,
30053,
7,
9060,
62,
43358,
58,
17,
46570,
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,
705,
18242,
10354,
4808,
600,
2414,
62,
30053,
7,
18242,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
9060,
62,
1831,
10354,
4808,
33661,
62,
30053,
7,
9060,
62,
1831,
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,
1782,
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,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6260,
13,
13564,
7,
20688,
13,
32634,
1096,
2514,
10100,
28955,
628,
220,
220,
220,
1441,
1255,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
48700,
13,
1324,
13,
5143,
3419,
198
] | 1.816817 | 1,332 |
import os
import numpy as np
import pandas as pd
import glob as glob
import matplotlib.pyplot as plt
# import scipy.stats
# import seaborn as sns
# from sklearn import metrics as skm
import math
from collections import Counter
import networkx as nx
import matplotlib.lines as mlines
from itertools import combinations
import matplotlib
# import os
# import numpy as np
# import pandas as pd
# import glob as glob
# import matplotlib.pyplot as plt
# # import scipy.stats
# # import seaborn as sns
# # from sklearn import metrics as skm
# import math
# from collections import Counter
# import networkx as nx
# import matplotlib.lines as mlines
# from itertools import combinations
# import matplotlib
# def create_bboxes(pos, text_scale = 14):
# node_bboxes = {}
# for node in list(pos.keys()):
# xy = pos[node]
# x = xy[0]
# y = xy[1]
# bbox_length = len(node) * text_scale / 1000
# bbox_height = 2 * text_scale / 1000
# bbox = np.array([(x-bbox_length/2,y-bbox_height/2),bbox_length, bbox_height])
# node_bboxes[node] = bbox
# return node_bboxes
# def visualize(subG, pos, node_bboxes):
# fig, ax = plt.subplots()
# fig.set_figheight(10)
# fig.set_figwidth(10)
# nodelabels = dict([(x,x) for x in subG.nodes(data=False)])
# nx.draw_networkx_labels(subG, pos, labels=nodelabels, ax=ax)
# for node in list(node_bboxes.keys()):
# bbox = node_bboxes[node]
# rect = matplotlib.patches.Rectangle(bbox[0],
# bbox[1],
# bbox[2],
# edgecolor = 'black',
# fill=False)
# ax.add_patch(rect)
# plt.show()
# # def visualize_bboxes(node_bboxes):
# # fig, ax = plt.subplots()
# # fig.set_figheight(5)
# # fig.set_figwidth(5)
# # for node in list(node_bboxes.keys()):
# # bbox = node_bboxes[node]
# # rect = matplotlib.patches.Rectangle(bbox[0],
# # bbox[1],
# # bbox[2],
# # edgecolor = 'black',
# # fill=False)
# # ax.add_patch(rect)
# # plt.show()
# def calculate_overlap(node1, node2, node_bboxes):
# bbox1 = node_bboxes[node1]
# bbox2 = node_bboxes[node2]
# xmin1 = bbox1[0][0]
# ymin1 = bbox1[0][1]
# xmax1 = xmin1 + bbox1[1]
# ymax1 = ymin1 + bbox1[2]
# xmin2 = bbox2[0][0]
# ymin2 = bbox2[0][1]
# xmax2 = xmin2 + bbox2[1]
# ymax2 = ymin2 + bbox2[2]
# dx = min(xmax1,xmax2) - max(xmin1,xmin2)
# dy = min(ymax1,ymax2) - max(ymin1,ymin2)
# if (dx < 0) | (dy < 0):
# return 0
# else:
# return dx*dy
# def calculate_total_overlap(node_bboxes):
# all_pairs = [x for x in combinations(list(node_bboxes.keys()),2)]
# total_overlap = 0
# node_bboxes = node_bboxes ##
# for pair in all_pairs:
# overlap = calculate_overlap(pair[0], pair[1], node_bboxes)
# total_overlap += overlap
# return total_overlap
# def calculate_node_overlap(node_bboxes):
# # node_bboxes = node_bboxes ##
# node_list = list(node_bboxes.keys())
# node_overlap_dict = {}
# for node in node_list:
# node_overlap = 0
# for othernode in node_list:
# if node != othernode:
# node_overlap += calculate_overlap(node, othernode, node_bboxes)
# node_overlap_dict[node] = node_overlap
# return node_overlap_dict
# def jiggle(node_bboxes, node_overlap_dict, scale):
# node_list = list(node_bboxes.keys())
# new_node_bboxes = {}
# for node in node_list:
# bbox = node_bboxes[node]
# overlap = node_overlap_dict[node]
# dx = (np.random.randn()*overlap + np.random.randn()*0.00001) * scale
# dy = (np.random.randn()*overlap + np.random.randn()*0.00001) * scale
# # print(dx,dy)
# new_bbox = np.array([(bbox[0][0]+dx, bbox[0][1]+dy), bbox[1], bbox[2]])
# new_node_bboxes[node] = new_bbox
# return new_node_bboxes
# def bbox2pos(bbox):
# return (bbox[0][0]+bbox[1]/2, bbox[0][1]+bbox[2]/2)
# def bboxes2pos(node_bboxes):
# new_pos = {}
# for node in list(node_bboxes.keys()):
# xy = bbox2pos(node_bboxes[node])
# new_pos[node] = xy
# return new_pos
# # def fit_jiggle(node_bboxes, num_iter = 500, scale = 100):
# # best_node_bboxes = node_bboxes
# # for i in range(num_iter):
# # current_node_overlap = calculate_total_overlap(best_node_bboxes) # current total overlap
# # node_overlap_dict = calculate_node_overlap(best_node_bboxes) # current overlap per node
# # new_node_bboxes = jiggle(best_node_bboxes, node_overlap_dict, scale=scale) # make new bboxes
# # # if new_node_bboxes['ADORA1'][0] == best_node_bboxes['ADORA1'][0]:
# # # print('No change')
# # # break
# # new_node_overlap = calculate_total_overlap(new_node_bboxes) # new total overlap
# # print(f'Iteration {i}, current overlap {current_node_overlap}, new overlap {new_node_overlap}')
# # if new_node_overlap < current_node_overlap:
# # best_node_bboxes = new_node_bboxes
# # print(f'Saving better version')
# # if new_node_overlap <= 0:
# # break
# # return best_node_bboxes
# def fit_jiggle(node_bboxes, num_iter = 500, scale=100):
# best_node_bboxes = node_bboxes
# for i in range(num_iter):
# current_node_overlap = calculate_total_overlap(best_node_bboxes) # current total overlap
# node_overlap_dict = calculate_node_overlap(best_node_bboxes) # current overlap per node
# new_node_bboxes = jiggle(best_node_bboxes, node_overlap_dict, scale=scale) # make new bboxes
# # if new_node_bboxes['ADORA1'][0] == best_node_bboxes['ADORA1'][0]:
# # print('No change')
# # break
# new_node_overlap = calculate_total_overlap(new_node_bboxes) # new total overlap
# print(f'Iteration {i}, current overlap {current_node_overlap}, new overlap {new_node_overlap}')
# if new_node_overlap < current_node_overlap:
# best_node_bboxes = new_node_bboxes
# print(f'Saving better version')
# if new_node_overlap <= 0:
# break
# return best_node_bboxes
# def main_jiggle(G, pos, text_scale = 14, num_iter = 500):
# # Make bboxes
# node_bboxes = create_bboxes(pos, text_scale = text_scale)
# # Check that they look correct
# visualize(G, pos, node_bboxes)
# # Fit a jiggle
# new_node_bboxes = fit_jiggle(node_bboxes, num_iter = num_iter)
# print('Finished fitting.')
# # Convert back to node positions
# new_pos = bboxes2pos(new_node_bboxes)
# # Inspect new bboxes
# visualize(G, new_pos, new_node_bboxes)
# return new_pos | [
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
15095,
355,
15095,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
2,
1330,
629,
541,
88,
13,
34242,
198,
2,
1330,
384,
397,
1211,
355,
3013,
82,
198,
2,
422,
1341,
35720,
1330,
20731,
355,
1341,
76,
198,
11748,
10688,
198,
6738,
17268,
1330,
15034,
198,
11748,
3127,
87,
355,
299,
87,
198,
11748,
2603,
29487,
8019,
13,
6615,
355,
285,
6615,
198,
6738,
340,
861,
10141,
1330,
17790,
198,
11748,
2603,
29487,
8019,
628,
628,
628,
198,
2,
1330,
28686,
198,
2,
1330,
299,
32152,
355,
45941,
198,
2,
1330,
19798,
292,
355,
279,
67,
198,
2,
1330,
15095,
355,
15095,
198,
2,
1330,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
2,
1303,
1330,
629,
541,
88,
13,
34242,
198,
2,
1303,
1330,
384,
397,
1211,
355,
3013,
82,
198,
2,
1303,
422,
1341,
35720,
1330,
20731,
355,
1341,
76,
198,
2,
1330,
10688,
198,
2,
422,
17268,
1330,
15034,
198,
2,
1330,
3127,
87,
355,
299,
87,
198,
2,
1330,
2603,
29487,
8019,
13,
6615,
355,
285,
6615,
198,
2,
422,
340,
861,
10141,
1330,
17790,
198,
2,
1330,
2603,
29487,
8019,
198,
198,
2,
825,
2251,
62,
65,
29305,
7,
1930,
11,
2420,
62,
9888,
796,
1478,
2599,
198,
2,
220,
220,
220,
220,
10139,
62,
65,
29305,
796,
23884,
198,
2,
220,
220,
220,
220,
329,
10139,
287,
1351,
7,
1930,
13,
13083,
3419,
2599,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
88,
796,
1426,
58,
17440,
60,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
796,
2124,
88,
58,
15,
60,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
331,
796,
2124,
88,
58,
16,
60,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
275,
3524,
62,
13664,
796,
18896,
7,
17440,
8,
1635,
2420,
62,
9888,
1220,
8576,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
275,
3524,
62,
17015,
796,
362,
1635,
2420,
62,
9888,
1220,
8576,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
275,
3524,
796,
45941,
13,
18747,
26933,
7,
87,
12,
65,
3524,
62,
13664,
14,
17,
11,
88,
12,
65,
3524,
62,
17015,
14,
17,
828,
65,
3524,
62,
13664,
11,
275,
3524,
62,
17015,
12962,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
10139,
62,
65,
29305,
58,
17440,
60,
796,
275,
3524,
198,
2,
220,
220,
220,
220,
1441,
10139,
62,
65,
29305,
198,
198,
2,
825,
38350,
7,
7266,
38,
11,
1426,
11,
10139,
62,
65,
29305,
2599,
198,
2,
220,
220,
220,
220,
2336,
11,
7877,
796,
458,
83,
13,
7266,
489,
1747,
3419,
198,
2,
220,
220,
220,
220,
2336,
13,
2617,
62,
5647,
17015,
7,
940,
8,
198,
2,
220,
220,
220,
220,
2336,
13,
2617,
62,
5647,
10394,
7,
940,
8,
198,
198,
2,
220,
220,
220,
220,
18666,
417,
397,
1424,
796,
8633,
26933,
7,
87,
11,
87,
8,
329,
2124,
287,
850,
38,
13,
77,
4147,
7,
7890,
28,
25101,
8,
12962,
198,
198,
2,
220,
220,
220,
220,
299,
87,
13,
19334,
62,
27349,
87,
62,
23912,
1424,
7,
7266,
38,
11,
1426,
11,
14722,
28,
77,
375,
417,
397,
1424,
11,
7877,
28,
897,
8,
198,
198,
2,
220,
220,
220,
220,
329,
10139,
287,
1351,
7,
17440,
62,
65,
29305,
13,
13083,
3419,
2599,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
275,
3524,
796,
10139,
62,
65,
29305,
58,
17440,
60,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
13621,
796,
2603,
29487,
8019,
13,
8071,
2052,
13,
45474,
9248,
7,
65,
3524,
58,
15,
4357,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
275,
3524,
58,
16,
4357,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
275,
3524,
58,
17,
4357,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5743,
8043,
796,
705,
13424,
3256,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6070,
28,
25101,
8,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
7877,
13,
2860,
62,
17147,
7,
2554,
8,
198,
198,
2,
220,
220,
220,
220,
458,
83,
13,
12860,
3419,
198,
198,
2,
1303,
825,
38350,
62,
65,
29305,
7,
17440,
62,
65,
29305,
2599,
198,
2,
1303,
220,
220,
220,
220,
2336,
11,
7877,
796,
458,
83,
13,
7266,
489,
1747,
3419,
198,
2,
1303,
220,
220,
220,
220,
2336,
13,
2617,
62,
5647,
17015,
7,
20,
8,
198,
2,
1303,
220,
220,
220,
220,
2336,
13,
2617,
62,
5647,
10394,
7,
20,
8,
198,
198,
2,
1303,
220,
220,
220,
220,
329,
10139,
287,
1351,
7,
17440,
62,
65,
29305,
13,
13083,
3419,
2599,
198,
2,
1303,
220,
220,
220,
220,
220,
220,
220,
220,
275,
3524,
796,
10139,
62,
65,
29305,
58,
17440,
60,
198,
2,
1303,
220,
220,
220,
220,
220,
220,
220,
220,
13621,
796,
2603,
29487,
8019,
13,
8071,
2052,
13,
45474,
9248,
7,
65,
3524,
58,
15,
4357,
198,
2,
1303,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
275,
3524,
58,
16,
4357,
198,
2,
1303,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
275,
3524,
58,
17,
4357,
198,
2,
1303,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5743,
8043,
796,
705,
13424,
3256,
198,
2,
1303,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6070,
28,
25101,
8,
198,
2,
1303,
220,
220,
220,
220,
220,
220,
220,
220,
7877,
13,
2860,
62,
17147,
7,
2554,
8,
198,
198,
2,
1303,
220,
220,
220,
220,
458,
83,
13,
12860,
3419,
628,
198,
2,
825,
15284,
62,
2502,
37796,
7,
17440,
16,
11,
10139,
17,
11,
10139,
62,
65,
29305,
2599,
198,
198,
2,
220,
220,
220,
220,
275,
3524,
16,
796,
10139,
62,
65,
29305,
58,
17440,
16,
60,
198,
2,
220,
220,
220,
220,
275,
3524,
17,
796,
10139,
62,
65,
29305,
58,
17440,
17,
60,
198,
198,
2,
220,
220,
220,
220,
2124,
1084,
16,
796,
275,
3524,
16,
58,
15,
7131,
15,
60,
198,
2,
220,
220,
220,
220,
331,
1084,
16,
796,
275,
3524,
16,
58,
15,
7131,
16,
60,
198,
2,
220,
220,
220,
220,
2124,
9806,
16,
796,
2124,
1084,
16,
1343,
275,
3524,
16,
58,
16,
60,
198,
2,
220,
220,
220,
220,
331,
9806,
16,
796,
331,
1084,
16,
1343,
275,
3524,
16,
58,
17,
60,
198,
198,
2,
220,
220,
220,
220,
2124,
1084,
17,
796,
275,
3524,
17,
58,
15,
7131,
15,
60,
198,
2,
220,
220,
220,
220,
331,
1084,
17,
796,
275,
3524,
17,
58,
15,
7131,
16,
60,
198,
2,
220,
220,
220,
220,
2124,
9806,
17,
796,
2124,
1084,
17,
1343,
275,
3524,
17,
58,
16,
60,
198,
2,
220,
220,
220,
220,
331,
9806,
17,
796,
331,
1084,
17,
1343,
275,
3524,
17,
58,
17,
60,
198,
198,
2,
220,
220,
220,
220,
44332,
796,
949,
7,
87,
9806,
16,
11,
87,
9806,
17,
8,
532,
3509,
7,
87,
1084,
16,
11,
87,
1084,
17,
8,
198,
2,
220,
220,
220,
220,
20268,
796,
949,
7,
4948,
897,
16,
11,
4948,
897,
17,
8,
532,
3509,
7,
88,
1084,
16,
11,
88,
1084,
17,
8,
198,
198,
2,
220,
220,
220,
220,
611,
357,
34350,
1279,
657,
8,
930,
357,
9892,
1279,
657,
2599,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
657,
198,
2,
220,
220,
220,
220,
2073,
25,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
44332,
9,
9892,
198,
198,
2,
825,
15284,
62,
23350,
62,
2502,
37796,
7,
17440,
62,
65,
29305,
2599,
198,
2,
220,
220,
220,
220,
477,
62,
79,
3468,
796,
685,
87,
329,
2124,
287,
17790,
7,
4868,
7,
17440,
62,
65,
29305,
13,
13083,
3419,
828,
17,
15437,
198,
2,
220,
220,
220,
220,
2472,
62,
2502,
37796,
796,
657,
198,
2,
220,
220,
220,
220,
10139,
62,
65,
29305,
796,
10139,
62,
65,
29305,
22492,
198,
2,
220,
220,
220,
220,
329,
5166,
287,
477,
62,
79,
3468,
25,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
21721,
796,
15284,
62,
2502,
37796,
7,
24874,
58,
15,
4357,
5166,
58,
16,
4357,
10139,
62,
65,
29305,
8,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
2472,
62,
2502,
37796,
15853,
21721,
198,
2,
220,
220,
220,
220,
1441,
2472,
62,
2502,
37796,
198,
198,
2,
825,
15284,
62,
17440,
62,
2502,
37796,
7,
17440,
62,
65,
29305,
2599,
198,
2,
220,
220,
220,
220,
1303,
10139,
62,
65,
29305,
796,
10139,
62,
65,
29305,
22492,
198,
2,
220,
220,
220,
220,
10139,
62,
4868,
796,
1351,
7,
17440,
62,
65,
29305,
13,
13083,
28955,
198,
2,
220,
220,
220,
220,
10139,
62,
2502,
37796,
62,
11600,
796,
23884,
198,
2,
220,
220,
220,
220,
329,
10139,
287,
10139,
62,
4868,
25,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
10139,
62,
2502,
37796,
796,
657,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
329,
584,
17440,
287,
10139,
62,
4868,
25,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
10139,
14512,
584,
17440,
25,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10139,
62,
2502,
37796,
15853,
15284,
62,
2502,
37796,
7,
17440,
11,
584,
17440,
11,
10139,
62,
65,
29305,
8,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
10139,
62,
2502,
37796,
62,
11600,
58,
17440,
60,
796,
10139,
62,
2502,
37796,
198,
2,
220,
220,
220,
220,
1441,
10139,
62,
2502,
37796,
62,
11600,
198,
198,
2,
825,
474,
24082,
7,
17440,
62,
65,
29305,
11,
10139,
62,
2502,
37796,
62,
11600,
11,
5046,
2599,
198,
2,
220,
220,
220,
220,
10139,
62,
4868,
796,
1351,
7,
17440,
62,
65,
29305,
13,
13083,
28955,
198,
2,
220,
220,
220,
220,
649,
62,
17440,
62,
65,
29305,
796,
23884,
198,
2,
220,
220,
220,
220,
329,
10139,
287,
10139,
62,
4868,
25,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
275,
3524,
796,
10139,
62,
65,
29305,
58,
17440,
60,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
21721,
796,
10139,
62,
2502,
37796,
62,
11600,
58,
17440,
60,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
44332,
796,
357,
37659,
13,
25120,
13,
25192,
77,
3419,
9,
2502,
37796,
1343,
45941,
13,
25120,
13,
25192,
77,
3419,
9,
15,
13,
2388,
16,
8,
1635,
5046,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
20268,
796,
357,
37659,
13,
25120,
13,
25192,
77,
3419,
9,
2502,
37796,
1343,
45941,
13,
25120,
13,
25192,
77,
3419,
9,
15,
13,
2388,
16,
8,
1635,
5046,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
3601,
7,
34350,
11,
9892,
8,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
649,
62,
65,
3524,
796,
45941,
13,
18747,
26933,
7,
65,
3524,
58,
15,
7131,
15,
48688,
34350,
11,
275,
3524,
58,
15,
7131,
16,
48688,
9892,
828,
275,
3524,
58,
16,
4357,
275,
3524,
58,
17,
11907,
8,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
649,
62,
17440,
62,
65,
29305,
58,
17440,
60,
796,
649,
62,
65,
3524,
198,
2,
220,
220,
220,
220,
1441,
649,
62,
17440,
62,
65,
29305,
198,
198,
2,
825,
275,
3524,
17,
1930,
7,
65,
3524,
2599,
198,
2,
220,
220,
220,
220,
1441,
357,
65,
3524,
58,
15,
7131,
15,
48688,
65,
3524,
58,
16,
60,
14,
17,
11,
275,
3524,
58,
15,
7131,
16,
48688,
65,
3524,
58,
17,
60,
14,
17,
8,
198,
198,
2,
825,
275,
29305,
17,
1930,
7,
17440,
62,
65,
29305,
2599,
198,
2,
220,
220,
220,
220,
649,
62,
1930,
796,
23884,
198,
2,
220,
220,
220,
220,
329,
10139,
287,
1351,
7,
17440,
62,
65,
29305,
13,
13083,
3419,
2599,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
88,
796,
275,
3524,
17,
1930,
7,
17440,
62,
65,
29305,
58,
17440,
12962,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
649,
62,
1930,
58,
17440,
60,
796,
2124,
88,
198,
2,
220,
220,
220,
220,
1441,
649,
62,
1930,
198,
198,
2,
1303,
825,
4197,
62,
73,
24082,
7,
17440,
62,
65,
29305,
11,
997,
62,
2676,
796,
5323,
11,
5046,
796,
1802,
2599,
198,
2,
1303,
220,
220,
220,
220,
1266,
62,
17440,
62,
65,
29305,
796,
10139,
62,
65,
29305,
198,
2,
1303,
220,
220,
220,
220,
329,
1312,
287,
2837,
7,
22510,
62,
2676,
2599,
198,
198,
2,
1303,
220,
220,
220,
220,
220,
220,
220,
220,
1459,
62,
17440,
62,
2502,
37796,
796,
15284,
62,
23350,
62,
2502,
37796,
7,
13466,
62,
17440,
62,
65,
29305,
8,
1303,
1459,
2472,
21721,
198,
198,
2,
1303,
220,
220,
220,
220,
220,
220,
220,
220,
10139,
62,
2502,
37796,
62,
11600,
796,
15284,
62,
17440,
62,
2502,
37796,
7,
13466,
62,
17440,
62,
65,
29305,
8,
1303,
1459,
21721,
583,
10139,
198,
2,
1303,
220,
220,
220,
220,
220,
220,
220,
220,
649,
62,
17440,
62,
65,
29305,
796,
474,
24082,
7,
13466,
62,
17440,
62,
65,
29305,
11,
10139,
62,
2502,
37796,
62,
11600,
11,
5046,
28,
9888,
8,
1303,
787,
649,
275,
29305,
198,
2,
1303,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
611,
649,
62,
17440,
62,
65,
29305,
17816,
2885,
1581,
32,
16,
6,
7131,
15,
60,
6624,
1266,
62,
17440,
62,
65,
29305,
17816,
2885,
1581,
32,
16,
6,
7131,
15,
5974,
198,
2,
1303,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
220,
220,
220,
3601,
10786,
2949,
1487,
11537,
198,
2,
1303,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
220,
220,
220,
2270,
198,
198,
2,
1303,
220,
220,
220,
220,
220,
220,
220,
220,
649,
62,
17440,
62,
2502,
37796,
796,
15284,
62,
23350,
62,
2502,
37796,
7,
3605,
62,
17440,
62,
65,
29305,
8,
1303,
649,
2472,
21721,
198,
198,
2,
1303,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
69,
6,
29993,
341,
1391,
72,
5512,
1459,
21721,
1391,
14421,
62,
17440,
62,
2502,
37796,
5512,
649,
21721,
1391,
3605,
62,
17440,
62,
2502,
37796,
92,
11537,
198,
198,
2,
1303,
220,
220,
220,
220,
220,
220,
220,
220,
611,
649,
62,
17440,
62,
2502,
37796,
1279,
1459,
62,
17440,
62,
2502,
37796,
25,
198,
2,
1303,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1266,
62,
17440,
62,
65,
29305,
796,
649,
62,
17440,
62,
65,
29305,
198,
2,
1303,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
69,
6,
50,
2703,
1365,
2196,
11537,
198,
198,
2,
1303,
220,
220,
220,
220,
220,
220,
220,
220,
611,
649,
62,
17440,
62,
2502,
37796,
19841,
657,
25,
198,
2,
1303,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2270,
198,
198,
2,
1303,
220,
220,
220,
220,
1441,
1266,
62,
17440,
62,
65,
29305,
628,
198,
2,
825,
4197,
62,
73,
24082,
7,
17440,
62,
65,
29305,
11,
997,
62,
2676,
796,
5323,
11,
5046,
28,
3064,
2599,
198,
198,
2,
220,
220,
220,
220,
1266,
62,
17440,
62,
65,
29305,
796,
10139,
62,
65,
29305,
198,
198,
2,
220,
220,
220,
220,
329,
1312,
287,
2837,
7,
22510,
62,
2676,
2599,
198,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
1459,
62,
17440,
62,
2502,
37796,
796,
15284,
62,
23350,
62,
2502,
37796,
7,
13466,
62,
17440,
62,
65,
29305,
8,
1303,
1459,
2472,
21721,
198,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
10139,
62,
2502,
37796,
62,
11600,
796,
15284,
62,
17440,
62,
2502,
37796,
7,
13466,
62,
17440,
62,
65,
29305,
8,
1303,
1459,
21721,
583,
10139,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
649,
62,
17440,
62,
65,
29305,
796,
474,
24082,
7,
13466,
62,
17440,
62,
65,
29305,
11,
10139,
62,
2502,
37796,
62,
11600,
11,
5046,
28,
9888,
8,
1303,
787,
649,
275,
29305,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
611,
649,
62,
17440,
62,
65,
29305,
17816,
2885,
1581,
32,
16,
6,
7131,
15,
60,
6624,
1266,
62,
17440,
62,
65,
29305,
17816,
2885,
1581,
32,
16,
6,
7131,
15,
5974,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
220,
220,
220,
3601,
10786,
2949,
1487,
11537,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
220,
220,
220,
2270,
198,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
649,
62,
17440,
62,
2502,
37796,
796,
15284,
62,
23350,
62,
2502,
37796,
7,
3605,
62,
17440,
62,
65,
29305,
8,
1303,
649,
2472,
21721,
198,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
69,
6,
29993,
341,
1391,
72,
5512,
1459,
21721,
1391,
14421,
62,
17440,
62,
2502,
37796,
5512,
649,
21721,
1391,
3605,
62,
17440,
62,
2502,
37796,
92,
11537,
198,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
611,
649,
62,
17440,
62,
2502,
37796,
1279,
1459,
62,
17440,
62,
2502,
37796,
25,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1266,
62,
17440,
62,
65,
29305,
796,
649,
62,
17440,
62,
65,
29305,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
69,
6,
50,
2703,
1365,
2196,
11537,
198,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
611,
649,
62,
17440,
62,
2502,
37796,
19841,
657,
25,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2270,
198,
198,
2,
220,
220,
220,
220,
1441,
1266,
62,
17440,
62,
65,
29305,
628,
198,
2,
825,
1388,
62,
73,
24082,
7,
38,
11,
1426,
11,
2420,
62,
9888,
796,
1478,
11,
997,
62,
2676,
796,
5323,
2599,
198,
198,
2,
220,
220,
220,
220,
1303,
6889,
275,
29305,
198,
2,
220,
220,
220,
220,
10139,
62,
65,
29305,
796,
2251,
62,
65,
29305,
7,
1930,
11,
2420,
62,
9888,
796,
2420,
62,
9888,
8,
198,
198,
2,
220,
220,
220,
220,
1303,
6822,
326,
484,
804,
3376,
198,
2,
220,
220,
220,
220,
38350,
7,
38,
11,
1426,
11,
10139,
62,
65,
29305,
8,
198,
198,
2,
220,
220,
220,
220,
1303,
25048,
257,
474,
24082,
198,
2,
220,
220,
220,
220,
649,
62,
17440,
62,
65,
29305,
796,
4197,
62,
73,
24082,
7,
17440,
62,
65,
29305,
11,
997,
62,
2676,
796,
997,
62,
2676,
8,
198,
198,
2,
220,
220,
220,
220,
3601,
10786,
18467,
1348,
15830,
2637,
8,
198,
198,
2,
220,
220,
220,
220,
1303,
38240,
736,
284,
10139,
6116,
198,
2,
220,
220,
220,
220,
649,
62,
1930,
796,
275,
29305,
17,
1930,
7,
3605,
62,
17440,
62,
65,
29305,
8,
198,
198,
2,
220,
220,
220,
220,
1303,
20904,
649,
275,
29305,
198,
2,
220,
220,
220,
220,
38350,
7,
38,
11,
649,
62,
1930,
11,
649,
62,
17440,
62,
65,
29305,
8,
198,
198,
2,
220,
220,
220,
220,
1441,
649,
62,
1930
] | 2.021696 | 3,503 |
# -*- coding: utf-8 -*-
import click
import platform
import tcfcli.common.base_infor as infor
from tcfcli.help.message import ConfigureHelp as help
from tcfcli.common.user_config import UserConfig
from tcfcli.common.operation_msg import Operation
version = platform.python_version()
if version >= '3':
from functools import reduce
REGIONS = infor.REGIONS
@click.command(short_help=help.ADD_SHORT_HELP)
@click.option('--secret-id', '-si', help=help.SET_SECRET_ID)
@click.option('--secret-key', '-sk', help=help.SET_SECRET_KEY)
@click.option('--region', '-r', help=help.SET_REGION)
@click.option('--appid', '-a', help=help.SET_APPID)
@click.option('--using-cos', '-uc', help=help.SET_USING_COS)
def add(**kwargs):
'''
\b
Add a user.
\b
Common usage:
\b
* Add a user.
$ scf configure add
'''
uc = UserConfig()
using_cos_true = "False (By default, it isn't deployed by COS.)"
using_cos_false = "True (By default, it is deployed by COS.)"
if "region" in kwargs and kwargs["region"]:
if kwargs["region"] not in REGIONS:
Operation("The region must in %s." % (", ".join(REGIONS))).warning()
kwargs["region"] = uc.section_map[UserConfig.USER_QCLOUD_CONFIG]['region']
return
if "using_cos" in kwargs and kwargs["using_cos"]:
kwargs["using_cos"] = using_cos_true if kwargs["using_cos"] not in ["y", "Y"] else using_cos_false
values = [v for k, v in kwargs.items()]
if not reduce(lambda x, y: (bool(x) or bool(y)), values):
list(map(set_true, kwargs))
attrs = uc.get_attrs(kwargs)
config = {}
skip_attr = {'using_cos'}
for attr in sorted(attrs):
if attr not in skip_attr:
while True:
v = click.prompt(
text="TencentCloud {}".format(attr),
default=None,
show_default=False)
config[attr] = v
if attr != "region":
break
else:
if v in REGIONS:
break
else:
Operation("The region must in %s." % (", ".join(REGIONS))).warning()
v = click.prompt(text="Deploy SCF function by COS, it will be faster. (y/n)",
default="y" if str(attrs["using_cos"]).startswith("True") else "n",
show_default=False)
if v:
config["using_cos"] = using_cos_true if v not in ["y", "Y"] else using_cos_false
else:
config["using_cos"] = attrs["using_cos"]
kwargs = config
user = uc.add_user(data=kwargs)
uc.flush()
Operation('Add User %s success!' % user).success()
Operation(user).process()
Operation('%-10s %-15s %-15s %-15s %-15s %-10s' % ('UserId', 'AppId', 'region', 'secret_id', 'secret_key', 'using_cos')).process()
userinfo = uc.get_user_info(user)
secret_id = ("*" * 3 + userinfo['secret_id'][32:]) if userinfo['secret_id'].upper() != 'NONE' else 'None'
secret_key = ("*" * 3 + userinfo['secret_key'][28:]) if userinfo['secret_key'].upper() != 'NONE' else 'None'
Operation('%-10s %-15s %-15s %-15s %-15s %-10s' % (user.strip('USER_'), userinfo['appid'], userinfo['region'],
secret_id, secret_key, userinfo['using_cos'][:5])).process()
Operation('You can use `scf configure change -u %s` to switch user.' % (user.strip('USER_'))).process()
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
3904,
198,
11748,
3859,
198,
11748,
256,
12993,
44506,
13,
11321,
13,
8692,
62,
259,
1640,
355,
1167,
273,
198,
6738,
256,
12993,
44506,
13,
16794,
13,
20500,
1330,
17056,
495,
22087,
355,
1037,
198,
6738,
256,
12993,
44506,
13,
11321,
13,
7220,
62,
11250,
1330,
11787,
16934,
198,
6738,
256,
12993,
44506,
13,
11321,
13,
27184,
62,
19662,
1330,
14680,
198,
198,
9641,
796,
3859,
13,
29412,
62,
9641,
3419,
198,
361,
2196,
18189,
705,
18,
10354,
198,
220,
220,
220,
422,
1257,
310,
10141,
1330,
4646,
628,
198,
198,
31553,
11053,
796,
1167,
273,
13,
31553,
11053,
628,
198,
31,
12976,
13,
21812,
7,
19509,
62,
16794,
28,
16794,
13,
29266,
62,
9693,
9863,
62,
39,
3698,
47,
8,
198,
31,
12976,
13,
18076,
10786,
438,
21078,
12,
312,
3256,
705,
12,
13396,
3256,
1037,
28,
16794,
13,
28480,
62,
23683,
26087,
62,
2389,
8,
198,
31,
12976,
13,
18076,
10786,
438,
21078,
12,
2539,
3256,
705,
12,
8135,
3256,
1037,
28,
16794,
13,
28480,
62,
23683,
26087,
62,
20373,
8,
198,
31,
12976,
13,
18076,
10786,
438,
36996,
3256,
705,
12,
81,
3256,
1037,
28,
16794,
13,
28480,
62,
31553,
2849,
8,
198,
31,
12976,
13,
18076,
10786,
438,
1324,
312,
3256,
705,
12,
64,
3256,
1037,
28,
16794,
13,
28480,
62,
24805,
2389,
8,
198,
31,
12976,
13,
18076,
10786,
438,
3500,
12,
6966,
3256,
705,
12,
1229,
3256,
1037,
28,
16794,
13,
28480,
62,
2937,
2751,
62,
34,
2640,
8,
198,
4299,
751,
7,
1174,
46265,
22046,
2599,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
3467,
65,
198,
220,
220,
220,
220,
220,
220,
220,
3060,
257,
2836,
13,
198,
220,
220,
220,
220,
220,
220,
220,
3467,
65,
198,
220,
220,
220,
220,
220,
220,
220,
8070,
8748,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3467,
65,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1635,
3060,
257,
2836,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
720,
629,
69,
17425,
751,
198,
220,
220,
220,
705,
7061,
628,
220,
220,
220,
334,
66,
796,
11787,
16934,
3419,
628,
220,
220,
220,
1262,
62,
6966,
62,
7942,
796,
366,
25101,
357,
3886,
4277,
11,
340,
2125,
470,
12380,
416,
327,
2640,
2014,
1,
198,
220,
220,
220,
1262,
62,
6966,
62,
9562,
796,
366,
17821,
357,
3886,
4277,
11,
340,
318,
12380,
416,
327,
2640,
2014,
1,
628,
220,
220,
220,
611,
366,
36996,
1,
287,
479,
86,
22046,
290,
479,
86,
22046,
14692,
36996,
1,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
611,
479,
86,
22046,
14692,
36996,
8973,
407,
287,
23337,
11053,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
14680,
7203,
464,
3814,
1276,
287,
4064,
82,
526,
4064,
357,
1600,
27071,
22179,
7,
31553,
11053,
4008,
737,
43917,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
479,
86,
22046,
14692,
36996,
8973,
796,
334,
66,
13,
5458,
62,
8899,
58,
12982,
16934,
13,
29904,
62,
48,
5097,
2606,
35,
62,
10943,
16254,
7131,
6,
36996,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
198,
220,
220,
220,
611,
366,
3500,
62,
6966,
1,
287,
479,
86,
22046,
290,
479,
86,
22046,
14692,
3500,
62,
6966,
1,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
479,
86,
22046,
14692,
3500,
62,
6966,
8973,
796,
1262,
62,
6966,
62,
7942,
611,
479,
86,
22046,
14692,
3500,
62,
6966,
8973,
407,
287,
14631,
88,
1600,
366,
56,
8973,
2073,
1262,
62,
6966,
62,
9562,
628,
220,
220,
220,
3815,
796,
685,
85,
329,
479,
11,
410,
287,
479,
86,
22046,
13,
23814,
3419,
60,
198,
220,
220,
220,
611,
407,
4646,
7,
50033,
2124,
11,
331,
25,
357,
30388,
7,
87,
8,
393,
20512,
7,
88,
36911,
3815,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
1351,
7,
8899,
7,
2617,
62,
7942,
11,
479,
86,
22046,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
708,
3808,
796,
334,
66,
13,
1136,
62,
1078,
3808,
7,
46265,
22046,
8,
198,
220,
220,
220,
220,
220,
220,
220,
4566,
796,
23884,
198,
220,
220,
220,
220,
220,
220,
220,
14267,
62,
35226,
796,
1391,
6,
3500,
62,
6966,
6,
92,
198,
220,
220,
220,
220,
220,
220,
220,
329,
708,
81,
287,
23243,
7,
1078,
3808,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
708,
81,
407,
287,
14267,
62,
35226,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
981,
6407,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
410,
796,
3904,
13,
16963,
457,
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,
2420,
2625,
24893,
1087,
18839,
23884,
1911,
18982,
7,
35226,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4277,
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,
905,
62,
12286,
28,
25101,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4566,
58,
35226,
60,
796,
410,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
708,
81,
14512,
366,
36996,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2270,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
410,
287,
23337,
11053,
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,
2270,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
14680,
7203,
464,
3814,
1276,
287,
4064,
82,
526,
4064,
357,
1600,
27071,
22179,
7,
31553,
11053,
4008,
737,
43917,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
410,
796,
3904,
13,
16963,
457,
7,
5239,
2625,
49322,
6374,
37,
2163,
416,
327,
2640,
11,
340,
481,
307,
5443,
13,
357,
88,
14,
77,
42501,
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,
4277,
2625,
88,
1,
611,
965,
7,
1078,
3808,
14692,
3500,
62,
6966,
8973,
737,
9688,
2032,
342,
7203,
17821,
4943,
2073,
366,
77,
1600,
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,
905,
62,
12286,
28,
25101,
8,
628,
220,
220,
220,
220,
220,
220,
220,
611,
410,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4566,
14692,
3500,
62,
6966,
8973,
796,
1262,
62,
6966,
62,
7942,
611,
410,
407,
287,
14631,
88,
1600,
366,
56,
8973,
2073,
1262,
62,
6966,
62,
9562,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4566,
14692,
3500,
62,
6966,
8973,
796,
708,
3808,
14692,
3500,
62,
6966,
8973,
628,
220,
220,
220,
220,
220,
220,
220,
479,
86,
22046,
796,
4566,
628,
220,
220,
220,
2836,
796,
334,
66,
13,
2860,
62,
7220,
7,
7890,
28,
46265,
22046,
8,
198,
220,
220,
220,
334,
66,
13,
25925,
3419,
198,
220,
220,
220,
14680,
10786,
4550,
11787,
4064,
82,
1943,
13679,
4064,
2836,
737,
13138,
3419,
198,
220,
220,
220,
14680,
7,
7220,
737,
14681,
3419,
198,
220,
220,
220,
14680,
10786,
33963,
940,
82,
4064,
12,
1314,
82,
4064,
12,
1314,
82,
4064,
12,
1314,
82,
4064,
12,
1314,
82,
4064,
12,
940,
82,
6,
4064,
19203,
12982,
7390,
3256,
705,
4677,
7390,
3256,
705,
36996,
3256,
705,
21078,
62,
312,
3256,
705,
21078,
62,
2539,
3256,
705,
3500,
62,
6966,
11537,
737,
14681,
3419,
198,
220,
220,
220,
2836,
10951,
796,
334,
66,
13,
1136,
62,
7220,
62,
10951,
7,
7220,
8,
198,
220,
220,
220,
3200,
62,
312,
796,
5855,
9,
1,
1635,
513,
1343,
2836,
10951,
17816,
21078,
62,
312,
6,
7131,
2624,
25,
12962,
611,
2836,
10951,
17816,
21078,
62,
312,
6,
4083,
45828,
3419,
14512,
705,
45,
11651,
6,
2073,
705,
14202,
6,
198,
220,
220,
220,
3200,
62,
2539,
796,
5855,
9,
1,
1635,
513,
1343,
2836,
10951,
17816,
21078,
62,
2539,
6,
7131,
2078,
25,
12962,
611,
2836,
10951,
17816,
21078,
62,
2539,
6,
4083,
45828,
3419,
14512,
705,
45,
11651,
6,
2073,
705,
14202,
6,
198,
220,
220,
220,
14680,
10786,
33963,
940,
82,
4064,
12,
1314,
82,
4064,
12,
1314,
82,
4064,
12,
1314,
82,
4064,
12,
1314,
82,
4064,
12,
940,
82,
6,
4064,
357,
7220,
13,
36311,
10786,
29904,
62,
33809,
2836,
10951,
17816,
1324,
312,
6,
4357,
2836,
10951,
17816,
36996,
6,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3200,
62,
312,
11,
3200,
62,
2539,
11,
2836,
10951,
17816,
3500,
62,
6966,
6,
7131,
25,
20,
12962,
737,
14681,
3419,
198,
220,
220,
220,
14680,
10786,
1639,
460,
779,
4600,
1416,
69,
17425,
1487,
532,
84,
4064,
82,
63,
284,
5078,
2836,
2637,
4064,
357,
7220,
13,
36311,
10786,
29904,
62,
6,
4008,
737,
14681,
3419,
198
] | 2.059024 | 1,762 |
#!/usr/bin/env python
"""
4. Use TextFSM to parse the 'show arp' output from a Juniper SRX (see link below).
Extract the following fields into tabular data: MAC Address, Address, Name, Interface.
https://github.com/ktbyers/pyplus_course/blob/master/class4/exercises/ex4_junos_show_arp.txt
"""
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
198,
19,
13,
5765,
8255,
10652,
44,
284,
21136,
262,
705,
12860,
610,
79,
6,
5072,
422,
257,
7653,
9346,
16808,
55,
357,
3826,
2792,
2174,
737,
220,
198,
11627,
974,
262,
1708,
7032,
656,
7400,
934,
1366,
25,
20582,
17917,
11,
17917,
11,
6530,
11,
26491,
13,
198,
198,
5450,
1378,
12567,
13,
785,
14,
21841,
1525,
364,
14,
9078,
9541,
62,
17319,
14,
2436,
672,
14,
9866,
14,
4871,
19,
14,
1069,
2798,
2696,
14,
1069,
19,
62,
29741,
418,
62,
12860,
62,
5117,
13,
14116,
198,
37811,
198
] | 2.901961 | 102 |
"""Import a file from Illumina BaseSpace."""
import atexit
import gzip
import os
import time
import traceback
from pathlib import Path
from requests import RequestException, Session
from resolwe.process import (
BooleanField,
FileField,
GroupField,
IntegerField,
Persistence,
Process,
SecretField,
StringField,
)
class BaseSpaceDownloadError(Exception):
"""BaseSpace download error."""
pass
def download_file_repeatedly(
tries, session, file_id, file_name, expected_file_size, request_headers, error
):
"""Attempt to download BaseSpace file numerous times in case of errors."""
for i in range(tries):
try:
download_file(
session=session,
file_id=file_id,
file_name=file_name,
request_headers=request_headers,
error=error,
)
raise_for_file_corruption(
file_name=file_name, expected_file_size=expected_file_size, error=error
)
break
except BaseSpaceDownloadError:
if i + 1 == tries:
error("Could not download file from BaseSpace.")
else:
time.sleep(3)
def download_file(session, file_id, file_name, request_headers, error):
"""Download BaseSpace file."""
response = make_get_request(
session=session,
url=get_api_file_content_url(file_id=file_id),
headers=request_headers,
error=error,
stream=True,
)
try:
with open(file_name, "wb") as f:
chunk_size = 1024 * 1024 * 10
for chunk in response.iter_content(chunk_size=chunk_size):
f.write(chunk)
except FileNotFoundError:
error(f"Could not save file to {file_name}, due to directory not being found")
except PermissionError:
error(f"Could not save file to {file_name}, due to insufficient permissions")
except RequestException:
error(f"Could not save file to {file_name}, due to a network error")
def get_file_properties(session, file_id, request_headers, error):
"""Get file name and size (in bytes)."""
response = make_get_request(
session=session,
url=get_api_file_url(file_id=file_id),
headers=request_headers,
error=error,
)
info = response.json()["Response"]
return info["Name"], info["Size"]
def make_get_request(session, url, headers, error, stream=False):
"""Make a get request."""
response = session.get(url=url, headers=headers, stream=stream, timeout=60)
if response.status_code == 401:
error(f"Authentication failed on URL {url}")
elif response.status_code == 404:
error(f"BaseSpace file {url} not found")
elif response.status_code != 200:
error(f"Failed to retrieve content from {url}")
return response
def get_api_file_url(file_id):
"""Get BaseSpace API file URL."""
api_url = "https://api.basespace.illumina.com/v1pre3"
return f"{api_url}/files/{file_id}"
def get_api_file_content_url(file_id):
"""Get BaseSpace API file contents URL."""
return f"{get_api_file_url(file_id=file_id)}/content"
def output(output_option, value):
"""Print to standard output."""
if output_option == "full":
print(value)
elif output_option == "filename":
if value.startswith("filename="):
print(value[len("filename=") :])
def get_token_from_secret_file(secret_file_path, error):
"""Read secret file to obtain access token."""
try:
with open(secret_file_path, "r") as f:
return f.readline()
except FileNotFoundError:
error("Secret file not found")
except PermissionError:
error("No permissions to read secret file")
def on_exit(session):
"""Clean up function called on exit."""
session.close()
def raise_for_file_corruption(file_name, expected_file_size, error):
"""Raise an error if file does not pass integrity check."""
# Check file size.
actual_file_size = os.path.getsize(file_name)
if expected_file_size != actual_file_size:
error(
f"File's ({file_name}) expected size ({expected_file_size}) "
f"does not match its actual size ({actual_file_size})"
)
# Check gzip integrity.
if file_name.split(".")[-1] == "gz":
try:
with gzip.open(file_name, "rb") as f:
chunk_size = 1024 * 1024 * 10
while bool(f.read(chunk_size)):
pass
except OSError:
error(f"File {file_name} did not pass gzip integrity check")
class BaseSpaceImport(Process):
"""Import a file from Illumina BaseSpace."""
slug = "basespace-file-import"
name = "BaseSpace file"
process_type = "data:file"
version = "1.4.0"
category = "Import"
data_name = 'BaseSpace ({{ file_id|default("?") }})'
persistence = Persistence.TEMP
requirements = {
"expression-engine": "jinja",
"executor": {
"docker": {"image": "public.ecr.aws/s4q6j6e8/resolwebio/common:3.0.0"}
},
"resources": {
"cores": 1,
"memory": 1024,
"network": True,
"secrets": True,
},
}
class Input:
"""Input fields to process BaseSpaceImport."""
file_id = StringField(label="BaseSpace file ID")
access_token_secret = SecretField(
label="BaseSpace access token",
description="BaseSpace access token secret handle needed to download the file.",
)
show_advanced = BooleanField(
label="Show advanced options",
default=False,
)
class Advanced:
"""Advanced options."""
output = StringField(
label="Output",
allow_custom_choice=False,
choices=[("full", "Full"), ("filename", "Filename")],
default="filename",
description="Sets what is printed to standard output. "
"Argument 'Full' outputs everything, "
"argument 'Filename' outputs only file names of downloaded files.",
)
tries = IntegerField(
label="Tries",
description="Number of tries to download a file before giving up.",
range=[1, 10],
default=3,
)
verbose = BooleanField(
label="Verbose",
default=False,
description="Print detailed exception information to standard output "
"when error occurs. Output argument had no effect on this argument.",
)
advanced = GroupField(
Advanced, label="Advanced options", hidden="!show_advanced"
)
class Output:
"""Output fields to process BaseSpaceImport."""
file = FileField(label="File with reads")
def run(self, inputs, outputs):
"""Run import."""
secret_path = Path("/secrets") / inputs.access_token_secret["handle"]
session = Session()
atexit.register(on_exit, session)
try:
file_id = inputs.file_id
access_token = get_token_from_secret_file(
secret_file_path=secret_path, error=self.error
)
headers = {"x-access-token": access_token}
file_name, file_size = get_file_properties(
session=session,
file_id=file_id,
request_headers=headers,
error=self.error,
)
download_file_repeatedly(
tries=inputs.advanced.tries,
session=session,
file_id=file_id,
file_name=file_name,
expected_file_size=file_size,
request_headers=headers,
error=self.error,
)
output(inputs.advanced.output, f"filename={file_name}")
except Exception as error:
if inputs.advanced.verbose:
traceback.print_exc()
self.error(
"Unexpected error occurred while trying to download files from BaseSpace. "
"Check standard output for more details."
)
else:
print(str(error))
self.error(
"Unexpected error occurred while trying to download files from BaseSpace. "
"Set Verbose to True to see the traceback."
)
outputs.file = file_name
| [
37811,
20939,
257,
2393,
422,
39256,
1437,
7308,
14106,
526,
15931,
198,
198,
11748,
379,
37023,
198,
11748,
308,
13344,
198,
11748,
28686,
198,
11748,
640,
198,
11748,
12854,
1891,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
7007,
1330,
19390,
16922,
11,
23575,
198,
198,
6738,
581,
349,
732,
13,
14681,
1330,
357,
198,
220,
220,
220,
41146,
15878,
11,
198,
220,
220,
220,
9220,
15878,
11,
198,
220,
220,
220,
4912,
15878,
11,
198,
220,
220,
220,
34142,
15878,
11,
198,
220,
220,
220,
9467,
13274,
11,
198,
220,
220,
220,
10854,
11,
198,
220,
220,
220,
3943,
15878,
11,
198,
220,
220,
220,
10903,
15878,
11,
198,
8,
628,
198,
4871,
7308,
14106,
10002,
12331,
7,
16922,
2599,
198,
220,
220,
220,
37227,
14881,
14106,
4321,
4049,
526,
15931,
628,
220,
220,
220,
1208,
628,
198,
4299,
4321,
62,
7753,
62,
45956,
515,
306,
7,
198,
220,
220,
220,
8404,
11,
6246,
11,
2393,
62,
312,
11,
2393,
62,
3672,
11,
2938,
62,
7753,
62,
7857,
11,
2581,
62,
50145,
11,
4049,
198,
2599,
198,
220,
220,
220,
37227,
37177,
284,
4321,
7308,
14106,
2393,
6409,
1661,
287,
1339,
286,
8563,
526,
15931,
198,
220,
220,
220,
329,
1312,
287,
2837,
7,
83,
1678,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4321,
62,
7753,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6246,
28,
29891,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2393,
62,
312,
28,
7753,
62,
312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2393,
62,
3672,
28,
7753,
62,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2581,
62,
50145,
28,
25927,
62,
50145,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4049,
28,
18224,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
62,
1640,
62,
7753,
62,
46260,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2393,
62,
3672,
28,
7753,
62,
3672,
11,
2938,
62,
7753,
62,
7857,
28,
40319,
62,
7753,
62,
7857,
11,
4049,
28,
18224,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2270,
198,
220,
220,
220,
220,
220,
220,
220,
2845,
7308,
14106,
10002,
12331,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
1312,
1343,
352,
6624,
8404,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4049,
7203,
23722,
407,
4321,
2393,
422,
7308,
14106,
19570,
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,
640,
13,
42832,
7,
18,
8,
628,
198,
4299,
4321,
62,
7753,
7,
29891,
11,
2393,
62,
312,
11,
2393,
62,
3672,
11,
2581,
62,
50145,
11,
4049,
2599,
198,
220,
220,
220,
37227,
10002,
7308,
14106,
2393,
526,
15931,
198,
220,
220,
220,
2882,
796,
787,
62,
1136,
62,
25927,
7,
198,
220,
220,
220,
220,
220,
220,
220,
6246,
28,
29891,
11,
198,
220,
220,
220,
220,
220,
220,
220,
19016,
28,
1136,
62,
15042,
62,
7753,
62,
11299,
62,
6371,
7,
7753,
62,
312,
28,
7753,
62,
312,
828,
198,
220,
220,
220,
220,
220,
220,
220,
24697,
28,
25927,
62,
50145,
11,
198,
220,
220,
220,
220,
220,
220,
220,
4049,
28,
18224,
11,
198,
220,
220,
220,
220,
220,
220,
220,
4269,
28,
17821,
11,
198,
220,
220,
220,
1267,
628,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
351,
1280,
7,
7753,
62,
3672,
11,
366,
39346,
4943,
355,
277,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16058,
62,
7857,
796,
28119,
1635,
28119,
1635,
838,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
16058,
287,
2882,
13,
2676,
62,
11299,
7,
354,
2954,
62,
7857,
28,
354,
2954,
62,
7857,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
13,
13564,
7,
354,
2954,
8,
198,
220,
220,
220,
2845,
9220,
3673,
21077,
12331,
25,
198,
220,
220,
220,
220,
220,
220,
220,
4049,
7,
69,
1,
23722,
407,
3613,
2393,
284,
1391,
7753,
62,
3672,
5512,
2233,
284,
8619,
407,
852,
1043,
4943,
198,
220,
220,
220,
2845,
2448,
3411,
12331,
25,
198,
220,
220,
220,
220,
220,
220,
220,
4049,
7,
69,
1,
23722,
407,
3613,
2393,
284,
1391,
7753,
62,
3672,
5512,
2233,
284,
19022,
21627,
4943,
198,
220,
220,
220,
2845,
19390,
16922,
25,
198,
220,
220,
220,
220,
220,
220,
220,
4049,
7,
69,
1,
23722,
407,
3613,
2393,
284,
1391,
7753,
62,
3672,
5512,
2233,
284,
257,
3127,
4049,
4943,
628,
198,
4299,
651,
62,
7753,
62,
48310,
7,
29891,
11,
2393,
62,
312,
11,
2581,
62,
50145,
11,
4049,
2599,
198,
220,
220,
220,
37227,
3855,
2393,
1438,
290,
2546,
357,
259,
9881,
21387,
15931,
198,
220,
220,
220,
2882,
796,
787,
62,
1136,
62,
25927,
7,
198,
220,
220,
220,
220,
220,
220,
220,
6246,
28,
29891,
11,
198,
220,
220,
220,
220,
220,
220,
220,
19016,
28,
1136,
62,
15042,
62,
7753,
62,
6371,
7,
7753,
62,
312,
28,
7753,
62,
312,
828,
198,
220,
220,
220,
220,
220,
220,
220,
24697,
28,
25927,
62,
50145,
11,
198,
220,
220,
220,
220,
220,
220,
220,
4049,
28,
18224,
11,
198,
220,
220,
220,
1267,
198,
220,
220,
220,
7508,
796,
2882,
13,
17752,
3419,
14692,
31077,
8973,
198,
220,
220,
220,
1441,
7508,
14692,
5376,
33116,
7508,
14692,
10699,
8973,
628,
198,
4299,
787,
62,
1136,
62,
25927,
7,
29891,
11,
19016,
11,
24697,
11,
4049,
11,
4269,
28,
25101,
2599,
198,
220,
220,
220,
37227,
12050,
257,
651,
2581,
526,
15931,
198,
220,
220,
220,
2882,
796,
6246,
13,
1136,
7,
6371,
28,
6371,
11,
24697,
28,
50145,
11,
4269,
28,
5532,
11,
26827,
28,
1899,
8,
628,
220,
220,
220,
611,
2882,
13,
13376,
62,
8189,
6624,
22219,
25,
198,
220,
220,
220,
220,
220,
220,
220,
4049,
7,
69,
1,
47649,
3299,
4054,
319,
10289,
1391,
6371,
92,
4943,
198,
220,
220,
220,
1288,
361,
2882,
13,
13376,
62,
8189,
6624,
32320,
25,
198,
220,
220,
220,
220,
220,
220,
220,
4049,
7,
69,
1,
14881,
14106,
2393,
1391,
6371,
92,
407,
1043,
4943,
198,
220,
220,
220,
1288,
361,
2882,
13,
13376,
62,
8189,
14512,
939,
25,
198,
220,
220,
220,
220,
220,
220,
220,
4049,
7,
69,
1,
37,
6255,
284,
19818,
2695,
422,
1391,
6371,
92,
4943,
628,
220,
220,
220,
1441,
2882,
628,
198,
4299,
651,
62,
15042,
62,
7753,
62,
6371,
7,
7753,
62,
312,
2599,
198,
220,
220,
220,
37227,
3855,
7308,
14106,
7824,
2393,
10289,
526,
15931,
198,
220,
220,
220,
40391,
62,
6371,
796,
366,
5450,
1378,
15042,
13,
65,
1386,
10223,
13,
359,
388,
1437,
13,
785,
14,
85,
16,
3866,
18,
1,
198,
220,
220,
220,
1441,
277,
1,
90,
15042,
62,
6371,
92,
14,
16624,
14,
90,
7753,
62,
312,
36786,
628,
198,
4299,
651,
62,
15042,
62,
7753,
62,
11299,
62,
6371,
7,
7753,
62,
312,
2599,
198,
220,
220,
220,
37227,
3855,
7308,
14106,
7824,
2393,
10154,
10289,
526,
15931,
198,
220,
220,
220,
1441,
277,
1,
90,
1136,
62,
15042,
62,
7753,
62,
6371,
7,
7753,
62,
312,
28,
7753,
62,
312,
38165,
14,
11299,
1,
628,
198,
4299,
5072,
7,
22915,
62,
18076,
11,
1988,
2599,
198,
220,
220,
220,
37227,
18557,
284,
3210,
5072,
526,
15931,
198,
220,
220,
220,
611,
5072,
62,
18076,
6624,
366,
12853,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
8367,
8,
198,
220,
220,
220,
1288,
361,
5072,
62,
18076,
6624,
366,
34345,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
611,
1988,
13,
9688,
2032,
342,
7203,
34345,
2625,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
8367,
58,
11925,
7203,
34345,
2625,
8,
1058,
12962,
628,
198,
4299,
651,
62,
30001,
62,
6738,
62,
21078,
62,
7753,
7,
21078,
62,
7753,
62,
6978,
11,
4049,
2599,
198,
220,
220,
220,
37227,
5569,
3200,
2393,
284,
7330,
1895,
11241,
526,
15931,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
351,
1280,
7,
21078,
62,
7753,
62,
6978,
11,
366,
81,
4943,
355,
277,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
277,
13,
961,
1370,
3419,
198,
220,
220,
220,
2845,
9220,
3673,
21077,
12331,
25,
198,
220,
220,
220,
220,
220,
220,
220,
4049,
7203,
23725,
2393,
407,
1043,
4943,
198,
220,
220,
220,
2845,
2448,
3411,
12331,
25,
198,
220,
220,
220,
220,
220,
220,
220,
4049,
7203,
2949,
21627,
284,
1100,
3200,
2393,
4943,
628,
198,
4299,
319,
62,
37023,
7,
29891,
2599,
198,
220,
220,
220,
37227,
32657,
510,
2163,
1444,
319,
8420,
526,
15931,
198,
220,
220,
220,
6246,
13,
19836,
3419,
628,
198,
4299,
5298,
62,
1640,
62,
7753,
62,
46260,
7,
7753,
62,
3672,
11,
2938,
62,
7753,
62,
7857,
11,
4049,
2599,
198,
220,
220,
220,
37227,
21762,
786,
281,
4049,
611,
2393,
857,
407,
1208,
11540,
2198,
526,
15931,
198,
220,
220,
220,
1303,
6822,
2393,
2546,
13,
198,
220,
220,
220,
4036,
62,
7753,
62,
7857,
796,
28686,
13,
6978,
13,
11407,
1096,
7,
7753,
62,
3672,
8,
198,
220,
220,
220,
611,
2938,
62,
7753,
62,
7857,
14512,
4036,
62,
7753,
62,
7857,
25,
198,
220,
220,
220,
220,
220,
220,
220,
4049,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
1,
8979,
338,
37913,
7753,
62,
3672,
30072,
2938,
2546,
37913,
40319,
62,
7753,
62,
7857,
30072,
366,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
1,
22437,
407,
2872,
663,
4036,
2546,
37913,
50039,
62,
7753,
62,
7857,
92,
16725,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
1303,
6822,
308,
13344,
11540,
13,
198,
220,
220,
220,
611,
2393,
62,
3672,
13,
35312,
7203,
19570,
58,
12,
16,
60,
6624,
366,
34586,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
351,
308,
13344,
13,
9654,
7,
7753,
62,
3672,
11,
366,
26145,
4943,
355,
277,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16058,
62,
7857,
796,
28119,
1635,
28119,
1635,
838,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
981,
20512,
7,
69,
13,
961,
7,
354,
2954,
62,
7857,
8,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1208,
198,
220,
220,
220,
220,
220,
220,
220,
2845,
440,
5188,
81,
1472,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4049,
7,
69,
1,
8979,
1391,
7753,
62,
3672,
92,
750,
407,
1208,
308,
13344,
11540,
2198,
4943,
628,
198,
4871,
7308,
14106,
20939,
7,
18709,
2599,
198,
220,
220,
220,
37227,
20939,
257,
2393,
422,
39256,
1437,
7308,
14106,
526,
15931,
628,
220,
220,
220,
31065,
796,
366,
65,
1386,
10223,
12,
7753,
12,
11748,
1,
198,
220,
220,
220,
1438,
796,
366,
14881,
14106,
2393,
1,
198,
220,
220,
220,
1429,
62,
4906,
796,
366,
7890,
25,
7753,
1,
198,
220,
220,
220,
2196,
796,
366,
16,
13,
19,
13,
15,
1,
198,
220,
220,
220,
6536,
796,
366,
20939,
1,
198,
220,
220,
220,
1366,
62,
3672,
796,
705,
14881,
14106,
357,
27007,
2393,
62,
312,
91,
12286,
7203,
1701,
8,
1782,
30072,
6,
198,
220,
220,
220,
30802,
796,
9467,
13274,
13,
51,
39494,
198,
220,
220,
220,
5359,
796,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
366,
38011,
12,
18392,
1298,
366,
18594,
6592,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
366,
18558,
38409,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
45986,
1298,
19779,
9060,
1298,
366,
11377,
13,
721,
81,
13,
8356,
14,
82,
19,
80,
21,
73,
21,
68,
23,
14,
411,
349,
12384,
952,
14,
11321,
25,
18,
13,
15,
13,
15,
20662,
198,
220,
220,
220,
220,
220,
220,
220,
8964,
198,
220,
220,
220,
220,
220,
220,
220,
366,
37540,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
66,
2850,
1298,
352,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
31673,
1298,
28119,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
27349,
1298,
6407,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
2363,
8004,
1298,
6407,
11,
198,
220,
220,
220,
220,
220,
220,
220,
8964,
198,
220,
220,
220,
1782,
628,
220,
220,
220,
1398,
23412,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
20560,
7032,
284,
1429,
7308,
14106,
20939,
526,
15931,
628,
220,
220,
220,
220,
220,
220,
220,
2393,
62,
312,
796,
10903,
15878,
7,
18242,
2625,
14881,
14106,
2393,
4522,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
1895,
62,
30001,
62,
21078,
796,
3943,
15878,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6167,
2625,
14881,
14106,
1895,
11241,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6764,
2625,
14881,
14106,
1895,
11241,
3200,
5412,
2622,
284,
4321,
262,
2393,
33283,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
905,
62,
32225,
2903,
796,
41146,
15878,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6167,
2625,
15307,
6190,
3689,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4277,
28,
25101,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
220,
220,
220,
220,
1398,
13435,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37227,
28809,
3689,
526,
15931,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5072,
796,
10903,
15878,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6167,
2625,
26410,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1249,
62,
23144,
62,
25541,
28,
25101,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7747,
41888,
7203,
12853,
1600,
366,
13295,
12340,
5855,
34345,
1600,
366,
35063,
4943,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4277,
2625,
34345,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6764,
2625,
50,
1039,
644,
318,
10398,
284,
3210,
5072,
13,
366,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
28100,
1713,
705,
13295,
6,
23862,
2279,
11,
366,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
49140,
705,
35063,
6,
23862,
691,
2393,
3891,
286,
15680,
3696,
33283,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8404,
796,
34142,
15878,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6167,
2625,
51,
1678,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6764,
2625,
15057,
286,
8404,
284,
4321,
257,
2393,
878,
3501,
510,
33283,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2837,
41888,
16,
11,
838,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4277,
28,
18,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15942,
577,
796,
41146,
15878,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6167,
2625,
13414,
65,
577,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4277,
28,
25101,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6764,
2625,
18557,
6496,
6631,
1321,
284,
3210,
5072,
366,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
12518,
4049,
8833,
13,
25235,
4578,
550,
645,
1245,
319,
428,
4578,
33283,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
220,
220,
220,
220,
6190,
796,
4912,
15878,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13435,
11,
6167,
2625,
28809,
3689,
1600,
7104,
2625,
0,
12860,
62,
32225,
2903,
1,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
1398,
25235,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
26410,
7032,
284,
1429,
7308,
14106,
20939,
526,
15931,
628,
220,
220,
220,
220,
220,
220,
220,
2393,
796,
9220,
15878,
7,
18242,
2625,
8979,
351,
9743,
4943,
628,
220,
220,
220,
825,
1057,
7,
944,
11,
17311,
11,
23862,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
10987,
1330,
526,
15931,
628,
220,
220,
220,
220,
220,
220,
220,
3200,
62,
6978,
796,
10644,
7203,
14,
2363,
8004,
4943,
1220,
17311,
13,
15526,
62,
30001,
62,
21078,
14692,
28144,
8973,
628,
220,
220,
220,
220,
220,
220,
220,
6246,
796,
23575,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
379,
37023,
13,
30238,
7,
261,
62,
37023,
11,
6246,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2393,
62,
312,
796,
17311,
13,
7753,
62,
312,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1895,
62,
30001,
796,
651,
62,
30001,
62,
6738,
62,
21078,
62,
7753,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3200,
62,
7753,
62,
6978,
28,
21078,
62,
6978,
11,
4049,
28,
944,
13,
18224,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
24697,
796,
19779,
87,
12,
15526,
12,
30001,
1298,
1895,
62,
30001,
92,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2393,
62,
3672,
11,
2393,
62,
7857,
796,
651,
62,
7753,
62,
48310,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6246,
28,
29891,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2393,
62,
312,
28,
7753,
62,
312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2581,
62,
50145,
28,
50145,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4049,
28,
944,
13,
18224,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4321,
62,
7753,
62,
45956,
515,
306,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8404,
28,
15414,
82,
13,
32225,
2903,
13,
83,
1678,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6246,
28,
29891,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2393,
62,
312,
28,
7753,
62,
312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2393,
62,
3672,
28,
7753,
62,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2938,
62,
7753,
62,
7857,
28,
7753,
62,
7857,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2581,
62,
50145,
28,
50145,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4049,
28,
944,
13,
18224,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5072,
7,
15414,
82,
13,
32225,
2903,
13,
22915,
11,
277,
1,
34345,
34758,
7753,
62,
3672,
92,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
2845,
35528,
355,
4049,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
17311,
13,
32225,
2903,
13,
19011,
577,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12854,
1891,
13,
4798,
62,
41194,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
18224,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
52,
42072,
4049,
5091,
981,
2111,
284,
4321,
3696,
422,
7308,
14106,
13,
366,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
9787,
3210,
5072,
329,
517,
3307,
526,
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,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
2536,
7,
18224,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
18224,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
52,
42072,
4049,
5091,
981,
2111,
284,
4321,
3696,
422,
7308,
14106,
13,
366,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
7248,
49973,
577,
284,
6407,
284,
766,
262,
12854,
1891,
526,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
220,
220,
220,
220,
23862,
13,
7753,
796,
2393,
62,
3672,
198
] | 2.225077 | 3,892 |
import re
if __name__ == '__main__':
filename = 'data/wiki_humble_monthly.txt'
verbose = True
bundles = build_dictionary(filename, verbose)
print(bundles)
| [
11748,
302,
628,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
29472,
796,
705,
7890,
14,
15466,
62,
71,
10344,
62,
8424,
306,
13,
14116,
6,
198,
220,
220,
220,
15942,
577,
796,
6407,
198,
220,
220,
220,
36344,
796,
1382,
62,
67,
14188,
7,
34345,
11,
15942,
577,
8,
198,
220,
220,
220,
3601,
7,
65,
917,
829,
8,
198
] | 2.528571 | 70 |
'''
Manage Azure Database for MySQL servers.
'''
from .. pyaz_utils import _call_az
from . import db, flexible_server, server, server_logs
| [
7061,
6,
198,
5124,
496,
22134,
24047,
329,
33476,
9597,
13,
198,
7061,
6,
198,
6738,
11485,
12972,
1031,
62,
26791,
1330,
4808,
13345,
62,
1031,
198,
6738,
764,
1330,
20613,
11,
12846,
62,
15388,
11,
4382,
11,
4382,
62,
6404,
82,
628
] | 3.255814 | 43 |
import pandas as pd
import numpy as np
from pathlib import Path
from sklearn.preprocessing import QuantileTransformer, StandardScaler, LabelEncoder
from utils import read_data
from config import UTILITY
if __name__=="__main__":
print("Reading data")
train = read_data("train")
test = read_data("test")
print("preprocess data")
train, test = preprocess_data(train, test)
print("Generating extra features")
train = get_extra_feats(train)
test = get_extra_feats(test)
feats = ["etype", "cns_desc", "loan_ratio", "avg_acc_age", "cr_hist_len", "age", "disbursed_pri_amt",
"sanctioned_pri_amt", "disbur_to_sanction", "disbur_to_sanction2",
"total_disbursed", "total_sanctioned", "total_disbur_to_sanction_ratio"]
print("Quantile transformer")
train_qnt, test_qnt = scale_data(train, test, feats)
print("Saving stuff")
train[feats].to_csv(str(Path(UTILITY) / "train_feats1.csv"), index=False)
test[feats].to_csv(str(Path(UTILITY) / "test_feats1.csv"), index=False)
train_qnt.to_csv(str(Path(UTILITY) / "train_feats1_qnt.csv"), index=False)
test_qnt.to_csv(str(Path(UTILITY) / "test_feats1_qnt.csv"), index=False)
| [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
1341,
35720,
13,
3866,
36948,
1330,
16972,
576,
8291,
16354,
11,
8997,
3351,
36213,
11,
36052,
27195,
12342,
198,
198,
6738,
3384,
4487,
1330,
1100,
62,
7890,
220,
198,
6738,
4566,
1330,
19255,
4146,
9050,
628,
628,
198,
220,
220,
220,
220,
198,
198,
361,
11593,
3672,
834,
855,
1,
834,
12417,
834,
1298,
198,
220,
220,
220,
3601,
7203,
36120,
1366,
4943,
198,
220,
220,
220,
4512,
796,
1100,
62,
7890,
7203,
27432,
4943,
198,
220,
220,
220,
1332,
796,
1100,
62,
7890,
7203,
9288,
4943,
628,
220,
220,
220,
3601,
7203,
3866,
14681,
1366,
4943,
198,
220,
220,
220,
4512,
11,
1332,
796,
662,
14681,
62,
7890,
7,
27432,
11,
1332,
8,
198,
220,
220,
220,
220,
198,
220,
220,
220,
3601,
7203,
8645,
803,
3131,
3033,
4943,
198,
220,
220,
220,
4512,
796,
651,
62,
26086,
62,
5036,
1381,
7,
27432,
8,
198,
220,
220,
220,
1332,
796,
651,
62,
26086,
62,
5036,
1381,
7,
9288,
8,
198,
220,
220,
220,
220,
198,
220,
220,
220,
35664,
796,
14631,
2963,
431,
1600,
366,
66,
5907,
62,
20147,
1600,
366,
5439,
272,
62,
10366,
952,
1600,
366,
615,
70,
62,
4134,
62,
496,
1600,
366,
6098,
62,
10034,
62,
11925,
1600,
366,
496,
1600,
366,
6381,
65,
17539,
62,
3448,
62,
321,
83,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
12807,
596,
276,
62,
3448,
62,
321,
83,
1600,
366,
6381,
6236,
62,
1462,
62,
12807,
596,
1600,
366,
6381,
6236,
62,
1462,
62,
12807,
596,
17,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
23350,
62,
6381,
65,
17539,
1600,
366,
23350,
62,
12807,
596,
276,
1600,
220,
366,
23350,
62,
6381,
6236,
62,
1462,
62,
12807,
596,
62,
10366,
952,
8973,
198,
220,
220,
220,
220,
198,
220,
220,
220,
3601,
7203,
24915,
576,
47385,
4943,
198,
220,
220,
220,
4512,
62,
80,
429,
11,
1332,
62,
80,
429,
796,
5046,
62,
7890,
7,
27432,
11,
1332,
11,
35664,
8,
198,
220,
220,
220,
220,
198,
220,
220,
220,
3601,
7203,
50,
2703,
3404,
4943,
198,
220,
220,
220,
4512,
58,
5036,
1381,
4083,
1462,
62,
40664,
7,
2536,
7,
15235,
7,
3843,
4146,
9050,
8,
1220,
366,
27432,
62,
5036,
1381,
16,
13,
40664,
12340,
6376,
28,
25101,
8,
198,
220,
220,
220,
1332,
58,
5036,
1381,
4083,
1462,
62,
40664,
7,
2536,
7,
15235,
7,
3843,
4146,
9050,
8,
1220,
366,
9288,
62,
5036,
1381,
16,
13,
40664,
12340,
6376,
28,
25101,
8,
628,
220,
220,
220,
4512,
62,
80,
429,
13,
1462,
62,
40664,
7,
2536,
7,
15235,
7,
3843,
4146,
9050,
8,
1220,
366,
27432,
62,
5036,
1381,
16,
62,
80,
429,
13,
40664,
12340,
6376,
28,
25101,
8,
198,
220,
220,
220,
1332,
62,
80,
429,
13,
1462,
62,
40664,
7,
2536,
7,
15235,
7,
3843,
4146,
9050,
8,
1220,
366,
9288,
62,
5036,
1381,
16,
62,
80,
429,
13,
40664,
12340,
6376,
28,
25101,
8,
628
] | 2.364683 | 521 |
import os
import logging
from logging.handlers import RotatingFileHandler
# Set the logs
VERBOSITY = os.getenv(
"VERBOSITY", "debug"
) # info as default, #debug for local dev
LOG_PATH = os.getenv("LOG_PATH", "./logs")
# Define the logs
# Set verbosity
ROWS = 40
COLUMNS = 40
MAX_PROB = 2
MAX_TICK = 60
| [
11748,
28686,
198,
11748,
18931,
198,
6738,
18931,
13,
4993,
8116,
1330,
18481,
803,
8979,
25060,
198,
198,
2,
5345,
262,
17259,
198,
5959,
33,
2640,
9050,
796,
28686,
13,
1136,
24330,
7,
198,
220,
220,
220,
366,
5959,
33,
2640,
9050,
1600,
366,
24442,
1,
198,
8,
220,
1303,
7508,
355,
4277,
11,
1303,
24442,
329,
1957,
1614,
198,
198,
25294,
62,
34219,
796,
28686,
13,
1136,
24330,
7203,
25294,
62,
34219,
1600,
366,
19571,
6404,
82,
4943,
628,
198,
2,
2896,
500,
262,
17259,
198,
2,
5345,
15942,
16579,
628,
198,
49,
22845,
796,
2319,
198,
25154,
5883,
8035,
796,
2319,
198,
22921,
62,
4805,
9864,
796,
362,
198,
22921,
62,
51,
11860,
796,
3126,
198
] | 2.652542 | 118 |
str = 'ABC'
print Solution().convert(str, 1) | [
198,
2536,
796,
705,
24694,
6,
198,
4798,
28186,
22446,
1102,
1851,
7,
2536,
11,
352,
8
] | 2.647059 | 17 |
#!/usr/bin/env python
"""
Lists key(s) detail(s) visible to the supplied Cosm user API key
To use this script you must create a text file containing your API key
and pass it to this script using the --keyfile argument as follows:
List all keys visible to supplied key:
$ key_view.py --keyfile=/path/to/apikey/file
List details for a particular key
$ key_view.py --keyfile=path/to/apikey/file --key=XXX
txcosm must be installed or visible on the PYTHONPATH.
"""
import logging
from optparse import OptionParser
import os
import sys
from twisted.internet import reactor, defer
from txcosm.HTTPClient import HTTPClient
parser = OptionParser("")
parser.add_option("-k", "--keyfile", dest="keyfile", default=None, help="Path to file containing your Cosm API key")
parser.add_option("-i", "--key", dest="key_id", default=None, help="A specific Cosm key id to view")
@defer.inlineCallbacks
if __name__ == '__main__':
logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)s : %(message)s")
(options, args) = parser.parse_args()
# confirm keyfile is suppplied and valid
if options.keyfile is None:
print parser.get_usage()
sys.exit(1)
keyfile = os.path.expanduser(options.keyfile)
if not os.path.exists(keyfile):
logging.error("Invalid API key file path: %s" % keyfile)
sys.exit(1)
fd = open(keyfile, 'r')
key = fd.read().strip()
fd.close()
reactor.callWhenRunning(demo, key, options.key_id)
reactor.run()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
198,
43,
1023,
1994,
7,
82,
8,
3703,
7,
82,
8,
7424,
284,
262,
14275,
10437,
76,
2836,
7824,
1994,
198,
198,
2514,
779,
428,
4226,
345,
1276,
2251,
257,
2420,
2393,
7268,
534,
7824,
1994,
198,
392,
1208,
340,
284,
428,
4226,
1262,
262,
1377,
2539,
7753,
4578,
355,
5679,
25,
198,
198,
8053,
477,
8251,
7424,
284,
14275,
1994,
25,
198,
3,
1994,
62,
1177,
13,
9078,
1377,
2539,
7753,
33223,
6978,
14,
1462,
14,
499,
522,
88,
14,
7753,
198,
198,
8053,
3307,
329,
257,
1948,
1994,
198,
3,
1994,
62,
1177,
13,
9078,
1377,
2539,
7753,
28,
6978,
14,
1462,
14,
499,
522,
88,
14,
7753,
1377,
2539,
28,
43145,
198,
198,
17602,
6966,
76,
1276,
307,
6589,
393,
7424,
319,
262,
350,
56,
4221,
1340,
34219,
13,
198,
37811,
198,
198,
11748,
18931,
198,
6738,
2172,
29572,
1330,
16018,
46677,
198,
11748,
28686,
198,
11748,
25064,
198,
6738,
19074,
13,
37675,
1330,
21905,
11,
29135,
198,
6738,
27765,
6966,
76,
13,
40717,
11792,
1330,
14626,
11792,
628,
198,
48610,
796,
16018,
46677,
7203,
4943,
198,
48610,
13,
2860,
62,
18076,
7203,
12,
74,
1600,
366,
438,
2539,
7753,
1600,
2244,
2625,
2539,
7753,
1600,
4277,
28,
14202,
11,
1037,
2625,
15235,
284,
2393,
7268,
534,
10437,
76,
7824,
1994,
4943,
198,
48610,
13,
2860,
62,
18076,
7203,
12,
72,
1600,
366,
438,
2539,
1600,
2244,
2625,
2539,
62,
312,
1600,
4277,
28,
14202,
11,
1037,
2625,
32,
2176,
10437,
76,
1994,
4686,
284,
1570,
4943,
628,
198,
31,
4299,
263,
13,
45145,
14134,
10146,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
628,
220,
220,
220,
18931,
13,
35487,
16934,
7,
5715,
28,
6404,
2667,
13,
10778,
11,
5794,
2625,
4,
7,
292,
310,
524,
8,
82,
4064,
7,
5715,
3672,
8,
82,
1058,
4064,
7,
20500,
8,
82,
4943,
628,
220,
220,
220,
357,
25811,
11,
26498,
8,
796,
30751,
13,
29572,
62,
22046,
3419,
628,
220,
220,
220,
1303,
6216,
1994,
7753,
318,
802,
489,
798,
290,
4938,
198,
220,
220,
220,
611,
3689,
13,
2539,
7753,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
30751,
13,
1136,
62,
26060,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
25064,
13,
37023,
7,
16,
8,
628,
220,
220,
220,
1994,
7753,
796,
28686,
13,
6978,
13,
11201,
392,
7220,
7,
25811,
13,
2539,
7753,
8,
198,
220,
220,
220,
611,
407,
28686,
13,
6978,
13,
1069,
1023,
7,
2539,
7753,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
18931,
13,
18224,
7203,
44651,
7824,
1994,
2393,
3108,
25,
4064,
82,
1,
4064,
1994,
7753,
8,
198,
220,
220,
220,
220,
220,
220,
220,
25064,
13,
37023,
7,
16,
8,
628,
220,
220,
220,
277,
67,
796,
1280,
7,
2539,
7753,
11,
705,
81,
11537,
198,
220,
220,
220,
1994,
796,
277,
67,
13,
961,
22446,
36311,
3419,
198,
220,
220,
220,
277,
67,
13,
19836,
3419,
628,
220,
220,
220,
21905,
13,
13345,
2215,
28768,
7,
9536,
78,
11,
1994,
11,
3689,
13,
2539,
62,
312,
8,
198,
220,
220,
220,
21905,
13,
5143,
3419,
198
] | 2.831144 | 533 |
import logging
import torch
from torch.nn import functional as F
import torch.nn as nn
import torch.utils.checkpoint as cp
from mmcv.runner.checkpoint import open_mmlab_model_urls, load_state_dict
from torch.nn.modules.batchnorm import _BatchNorm
import os
import os.path as osp
import pkgutil
import time
import warnings
from collections import OrderedDict
from importlib import import_module
import mmcv
import torch
import torchvision
from torch.utils import model_zoo
from mmcv.runner import get_dist_info
from mmcv.cnn import constant_init, kaiming_init
from mmcv.runner import load_checkpoint
from torch.utils import model_zoo
from mmdet.ops import DeformConv, ModulatedDeformConv, ContextBlock
from mmdet.models.plugins import GeneralizedAttention
from ..registry import BACKBONES
from ..utils import build_conv_layer, build_norm_layer
def load_url_dist(url):
""" In distributed setting, this function only download checkpoint at
local rank 0 """
rank, world_size = get_dist_info()
rank = int(os.environ.get('LOCAL_RANK', rank))
if rank == 0:
checkpoint = model_zoo.load_url(url)
if world_size > 1:
torch.distributed.barrier()
if rank > 0:
checkpoint = model_zoo.load_url(url)
return checkpoint
@BACKBONES.register_module
class DeShNet(nn.Module):
"""deep shallow backbone.
Args:
depth (int): Depth of resnet, from {18, 34, 50, 101, 152}.
num_stages (int): Resnet stages, normally 4.
strides (Sequence[int]): Strides of the first block of each stage.
dilations (Sequence[int]): Dilation of each stage.
out_indices (Sequence[int]): Output from which stages.
style (str): `pytorch` or `caffe`. If set to "pytorch", the stride-two
layer is the 3x3 conv layer, otherwise the stride-two layer is
the first 1x1 conv layer.
frozen_stages (int): Stages to be frozen (stop grad and set eval mode).
-1 means not freezing any parameters.
norm_cfg (dict): dictionary to construct and config norm layer.
norm_eval (bool): Whether to set norm layers to eval mode, namely,
freeze running stats (mean and var). Note: Effect on Batch Norm
and its variants only.
with_cp (bool): Use checkpoint or not. Using checkpoint will save some
memory while slowing down the training speed.
zero_init_residual (bool): whether to use zero init for last norm layer
in resblocks to let them behave as identity.
"""
arch_settings = {
18: (BasicBlock, (2, 2, 2, 2)),
34: (BasicBlock, (3, 4, 6, 3)),
50: (Bottleneck, (3, 4, 6, 3)),
101: (Bottleneck, (3, 4, 23, 3)),
152: (Bottleneck, (3, 8, 36, 3))
}
@property
@property
| [
11748,
18931,
201,
198,
11748,
28034,
201,
198,
6738,
28034,
13,
20471,
1330,
10345,
355,
376,
201,
198,
11748,
28034,
13,
20471,
355,
299,
77,
201,
198,
11748,
28034,
13,
26791,
13,
9122,
4122,
355,
31396,
201,
198,
6738,
8085,
33967,
13,
16737,
13,
9122,
4122,
1330,
1280,
62,
3020,
23912,
62,
19849,
62,
6371,
82,
11,
3440,
62,
5219,
62,
11600,
201,
198,
6738,
28034,
13,
20471,
13,
18170,
13,
43501,
27237,
1330,
4808,
33,
963,
35393,
201,
198,
201,
198,
11748,
28686,
201,
198,
11748,
28686,
13,
6978,
355,
267,
2777,
201,
198,
11748,
279,
10025,
22602,
201,
198,
11748,
640,
201,
198,
11748,
14601,
201,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
201,
198,
6738,
1330,
8019,
1330,
1330,
62,
21412,
201,
198,
201,
198,
11748,
8085,
33967,
201,
198,
11748,
28034,
201,
198,
11748,
28034,
10178,
201,
198,
6738,
28034,
13,
26791,
1330,
2746,
62,
89,
2238,
201,
198,
6738,
8085,
33967,
13,
16737,
1330,
651,
62,
17080,
62,
10951,
201,
198,
201,
198,
6738,
8085,
33967,
13,
66,
20471,
1330,
6937,
62,
15003,
11,
479,
1385,
278,
62,
15003,
201,
198,
6738,
8085,
33967,
13,
16737,
1330,
3440,
62,
9122,
4122,
201,
198,
6738,
28034,
13,
26791,
1330,
2746,
62,
89,
2238,
201,
198,
201,
198,
6738,
8085,
15255,
13,
2840,
1330,
1024,
687,
3103,
85,
11,
3401,
4817,
5005,
687,
3103,
85,
11,
30532,
12235,
201,
198,
6738,
8085,
15255,
13,
27530,
13,
37390,
1330,
3611,
1143,
8086,
1463,
201,
198,
201,
198,
6738,
11485,
2301,
4592,
1330,
28767,
33,
39677,
201,
198,
6738,
11485,
26791,
1330,
1382,
62,
42946,
62,
29289,
11,
1382,
62,
27237,
62,
29289,
201,
198,
201,
198,
201,
198,
4299,
3440,
62,
6371,
62,
17080,
7,
6371,
2599,
201,
198,
220,
220,
220,
37227,
554,
9387,
4634,
11,
428,
2163,
691,
4321,
26954,
379,
201,
198,
220,
220,
220,
1957,
4279,
657,
37227,
201,
198,
220,
220,
220,
4279,
11,
995,
62,
7857,
796,
651,
62,
17080,
62,
10951,
3419,
201,
198,
220,
220,
220,
4279,
796,
493,
7,
418,
13,
268,
2268,
13,
1136,
10786,
29701,
1847,
62,
49,
15154,
3256,
4279,
4008,
201,
198,
220,
220,
220,
611,
4279,
6624,
657,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
26954,
796,
2746,
62,
89,
2238,
13,
2220,
62,
6371,
7,
6371,
8,
201,
198,
220,
220,
220,
611,
995,
62,
7857,
1875,
352,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
28034,
13,
17080,
6169,
13,
5657,
5277,
3419,
201,
198,
220,
220,
220,
220,
220,
220,
220,
611,
4279,
1875,
657,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26954,
796,
2746,
62,
89,
2238,
13,
2220,
62,
6371,
7,
6371,
8,
201,
198,
220,
220,
220,
1441,
26954,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
31,
31098,
33,
39677,
13,
30238,
62,
21412,
201,
198,
4871,
1024,
2484,
7934,
7,
20471,
13,
26796,
2599,
201,
198,
220,
220,
220,
37227,
22089,
19337,
32774,
13,
201,
198,
201,
198,
220,
220,
220,
943,
14542,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
6795,
357,
600,
2599,
36350,
286,
581,
3262,
11,
422,
1391,
1507,
11,
4974,
11,
2026,
11,
8949,
11,
24848,
27422,
201,
198,
220,
220,
220,
220,
220,
220,
220,
997,
62,
301,
1095,
357,
600,
2599,
1874,
3262,
9539,
11,
7685,
604,
13,
201,
198,
220,
220,
220,
220,
220,
220,
220,
35002,
357,
44015,
594,
58,
600,
60,
2599,
4285,
1460,
286,
262,
717,
2512,
286,
1123,
3800,
13,
201,
198,
220,
220,
220,
220,
220,
220,
220,
11844,
602,
357,
44015,
594,
58,
600,
60,
2599,
360,
10520,
286,
1123,
3800,
13,
201,
198,
220,
220,
220,
220,
220,
220,
220,
503,
62,
521,
1063,
357,
44015,
594,
58,
600,
60,
2599,
25235,
422,
543,
9539,
13,
201,
198,
220,
220,
220,
220,
220,
220,
220,
3918,
357,
2536,
2599,
4600,
9078,
13165,
354,
63,
393,
4600,
66,
21223,
44646,
1002,
900,
284,
366,
9078,
13165,
354,
1600,
262,
33769,
12,
11545,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7679,
318,
262,
513,
87,
18,
3063,
7679,
11,
4306,
262,
33769,
12,
11545,
7679,
318,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
262,
717,
352,
87,
16,
3063,
7679,
13,
201,
198,
220,
220,
220,
220,
220,
220,
220,
12912,
62,
301,
1095,
357,
600,
2599,
520,
1095,
284,
307,
12912,
357,
11338,
3915,
290,
900,
5418,
4235,
737,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
532,
16,
1724,
407,
20884,
597,
10007,
13,
201,
198,
220,
220,
220,
220,
220,
220,
220,
2593,
62,
37581,
357,
11600,
2599,
22155,
284,
5678,
290,
4566,
2593,
7679,
13,
201,
198,
220,
220,
220,
220,
220,
220,
220,
2593,
62,
18206,
357,
30388,
2599,
10127,
284,
900,
2593,
11685,
284,
5418,
4235,
11,
14811,
11,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16611,
2491,
9756,
357,
32604,
290,
1401,
737,
5740,
25,
7896,
319,
347,
963,
11220,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
290,
663,
17670,
691,
13,
201,
198,
220,
220,
220,
220,
220,
220,
220,
351,
62,
13155,
357,
30388,
2599,
5765,
26954,
393,
407,
13,
8554,
26954,
481,
3613,
617,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4088,
981,
21605,
866,
262,
3047,
2866,
13,
201,
198,
220,
220,
220,
220,
220,
220,
220,
6632,
62,
15003,
62,
411,
312,
723,
357,
30388,
2599,
1771,
284,
779,
6632,
2315,
329,
938,
2593,
7679,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
287,
581,
27372,
284,
1309,
606,
17438,
355,
5369,
13,
201,
198,
220,
220,
220,
37227,
201,
198,
201,
198,
220,
220,
220,
3934,
62,
33692,
796,
1391,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1248,
25,
357,
26416,
12235,
11,
357,
17,
11,
362,
11,
362,
11,
362,
36911,
201,
198,
220,
220,
220,
220,
220,
220,
220,
4974,
25,
357,
26416,
12235,
11,
357,
18,
11,
604,
11,
718,
11,
513,
36911,
201,
198,
220,
220,
220,
220,
220,
220,
220,
2026,
25,
357,
28653,
43163,
11,
357,
18,
11,
604,
11,
718,
11,
513,
36911,
201,
198,
220,
220,
220,
220,
220,
220,
220,
8949,
25,
357,
28653,
43163,
11,
357,
18,
11,
604,
11,
2242,
11,
513,
36911,
201,
198,
220,
220,
220,
220,
220,
220,
220,
24848,
25,
357,
28653,
43163,
11,
357,
18,
11,
807,
11,
4570,
11,
513,
4008,
201,
198,
220,
220,
220,
1782,
201,
198,
201,
198,
201,
198,
220,
220,
220,
2488,
26745,
201,
198,
201,
198,
220,
220,
220,
2488,
26745,
201,
198
] | 2.551451 | 1,137 |
#!/usr/bin/env python3
import pprint
import collections
if __name__ == '__main__':
with open('day6_input.txt') as f:
data = [line for line in f.read().split("\n") if line != '']
pprint.pprint(solve1(data))
pprint.pprint(solve2(data))
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
279,
4798,
198,
11748,
17268,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
351,
1280,
10786,
820,
21,
62,
15414,
13,
14116,
11537,
355,
277,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1366,
796,
685,
1370,
329,
1627,
287,
277,
13,
961,
22446,
35312,
7203,
59,
77,
4943,
611,
1627,
14512,
10148,
60,
628,
220,
220,
220,
279,
4798,
13,
381,
22272,
7,
82,
6442,
16,
7,
7890,
4008,
198,
220,
220,
220,
279,
4798,
13,
381,
22272,
7,
82,
6442,
17,
7,
7890,
4008,
198
] | 2.376147 | 109 |
from typing import NamedTuple, Optional
# =======================
| [
6738,
19720,
1330,
34441,
51,
29291,
11,
32233,
628,
198,
198,
2,
36658,
50155,
628
] | 4.666667 | 15 |
"""Custom type definitions"""
import pathlib # noqa: F401
import typing
PathOrString = typing.Union[str, pathlib.Path]
OptionalString = typing.Optional[str]
StringList = typing.List[str]
AnyList = typing.List[typing.Any]
OptionalStringList = typing.Union[OptionalString, StringList]
DictOfAny = typing.Dict[str, typing.Any]
DictOfFloat = typing.Dict[str, float]
| [
37811,
15022,
2099,
17336,
37811,
198,
11748,
3108,
8019,
220,
1303,
645,
20402,
25,
376,
21844,
198,
11748,
19720,
198,
198,
15235,
5574,
10100,
796,
19720,
13,
38176,
58,
2536,
11,
3108,
8019,
13,
15235,
60,
198,
30719,
10100,
796,
19720,
13,
30719,
58,
2536,
60,
198,
10100,
8053,
796,
19720,
13,
8053,
58,
2536,
60,
198,
7149,
8053,
796,
19720,
13,
8053,
58,
774,
13886,
13,
7149,
60,
198,
30719,
10100,
8053,
796,
19720,
13,
38176,
58,
30719,
10100,
11,
10903,
8053,
60,
198,
35,
713,
5189,
7149,
796,
19720,
13,
35,
713,
58,
2536,
11,
19720,
13,
7149,
60,
198,
35,
713,
5189,
43879,
796,
19720,
13,
35,
713,
58,
2536,
11,
12178,
60,
198
] | 3.111111 | 117 |
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 6 16:53:38 2021
@author: keikei
"""
"""
There are n children standing in a line.
Each child is assigned a rating value given in the integer array ratings.
You are giving candies to these children subjected to the following requirements:
Each child must have at least one candy.
Children with a higher rating get more candies than their neighbors.
Return the minimum number of candies you need to have to distribute the candies to the children.
""" | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
30030,
5979,
220,
718,
1467,
25,
4310,
25,
2548,
33448,
198,
198,
31,
9800,
25,
885,
522,
72,
198,
37811,
198,
198,
37811,
220,
198,
1858,
389,
299,
1751,
5055,
287,
257,
1627,
13,
220,
198,
10871,
1200,
318,
8686,
257,
7955,
1988,
1813,
287,
262,
18253,
7177,
10109,
13,
198,
198,
1639,
389,
3501,
2658,
444,
284,
777,
1751,
16164,
284,
262,
1708,
5359,
25,
198,
198,
10871,
1200,
1276,
423,
379,
1551,
530,
18550,
13,
198,
26829,
351,
257,
2440,
7955,
651,
517,
2658,
444,
621,
511,
12020,
13,
198,
13615,
262,
5288,
1271,
286,
2658,
444,
345,
761,
284,
423,
284,
14983,
262,
2658,
444,
284,
262,
1751,
13,
220,
198,
37811
] | 3.774436 | 133 |
from __future__ import annotations
from .vector import T as vector
from .point import T as point
from .piece import T as piece
from .plf import T as plf
| [
6738,
11593,
37443,
834,
1330,
37647,
198,
6738,
764,
31364,
1330,
309,
355,
15879,
198,
6738,
764,
4122,
1330,
309,
355,
966,
198,
6738,
764,
12239,
1330,
309,
355,
3704,
198,
6738,
764,
489,
69,
1330,
309,
355,
458,
69,
198
] | 3.731707 | 41 |
#################################################################################
# Copyright (c) 2018-2021, Texas Instruments Incorporated - http://www.ti.com
# All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# * Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#################################################################################
###########################################################
# Approximate quantized floating point simulation with gradients.
# Can be used for quantized training of models.
###########################################################
import torch
import numpy as np
import copy
import warnings
from .. import layers
from .. import utils
from .quant_base_module import *
warnings.filterwarnings('ignore', category=torch.jit.TracerWarning)
###########################################################
#
###########################################################
###########################################################
#
###########################################################
#
###########################################################
#
###########################################################
#
###########################################################
# fake quantized PAct2 for training
| [
29113,
29113,
14468,
2,
198,
2,
15069,
357,
66,
8,
2864,
12,
1238,
2481,
11,
3936,
43953,
3457,
40132,
532,
2638,
1378,
2503,
13,
20259,
13,
785,
198,
2,
1439,
6923,
33876,
13,
198,
2,
198,
2,
2297,
396,
3890,
290,
779,
287,
2723,
290,
13934,
5107,
11,
351,
393,
1231,
198,
2,
17613,
11,
389,
10431,
2810,
326,
262,
1708,
3403,
389,
1138,
25,
198,
2,
198,
2,
1635,
2297,
396,
2455,
507,
286,
2723,
2438,
1276,
12377,
262,
2029,
6634,
4003,
11,
428,
198,
2,
220,
220,
1351,
286,
3403,
290,
262,
1708,
37592,
13,
198,
2,
198,
2,
1635,
2297,
396,
2455,
507,
287,
13934,
1296,
1276,
22919,
262,
2029,
6634,
4003,
11,
198,
2,
220,
220,
428,
1351,
286,
3403,
290,
262,
1708,
37592,
287,
262,
10314,
198,
2,
220,
220,
290,
14,
273,
584,
5696,
2810,
351,
262,
6082,
13,
198,
2,
198,
2,
1635,
16126,
262,
1438,
286,
262,
6634,
15762,
4249,
262,
3891,
286,
663,
198,
2,
220,
220,
20420,
743,
307,
973,
284,
11438,
393,
7719,
3186,
10944,
422,
198,
2,
220,
220,
428,
3788,
1231,
2176,
3161,
3194,
7170,
13,
198,
2,
198,
2,
12680,
47466,
3180,
36592,
2389,
1961,
11050,
3336,
27975,
38162,
9947,
367,
15173,
4877,
5357,
27342,
9865,
3843,
20673,
366,
1921,
3180,
1,
198,
2,
5357,
15529,
7788,
32761,
6375,
8959,
49094,
34764,
11015,
11,
47783,
2751,
11,
21728,
5626,
40880,
5390,
11,
3336,
198,
2,
8959,
49094,
34764,
11015,
3963,
34482,
3398,
1565,
5603,
25382,
5357,
376,
46144,
7473,
317,
16652,
2149,
37232,
33079,
48933,
15986,
198,
2,
13954,
48778,
1961,
13,
3268,
8005,
49261,
50163,
3336,
27975,
38162,
9947,
49707,
14418,
6375,
27342,
9865,
3843,
20673,
9348,
43031,
19146,
198,
2,
7473,
15529,
42242,
11,
3268,
17931,
23988,
11,
19387,
25256,
1847,
11,
38846,
11,
7788,
3620,
6489,
13153,
11,
6375,
7102,
5188,
10917,
3525,
12576,
198,
2,
29506,
25552,
357,
1268,
39149,
2751,
11,
21728,
5626,
40880,
5390,
11,
41755,
11335,
10979,
3963,
28932,
2257,
2043,
37780,
21090,
50,
6375,
198,
2,
49254,
26,
406,
18420,
3963,
23210,
11,
42865,
11,
6375,
4810,
19238,
29722,
26,
6375,
43949,
44180,
23255,
49,
8577,
24131,
8,
29630,
36,
5959,
198,
2,
7257,
2937,
1961,
5357,
6177,
15529,
3336,
15513,
3963,
43031,
25382,
11,
7655,
2767,
16879,
3268,
27342,
10659,
11,
19269,
18379,
43031,
25382,
11,
198,
2,
6375,
309,
9863,
357,
1268,
39149,
2751,
399,
7156,
43,
3528,
18310,
6375,
25401,
54,
24352,
8,
5923,
1797,
2751,
3268,
15529,
34882,
16289,
3963,
3336,
23210,
198,
2,
3963,
12680,
47466,
11,
45886,
16876,
5984,
29817,
1961,
3963,
3336,
28069,
11584,
25382,
3963,
13558,
3398,
29506,
11879,
13,
198,
2,
198,
29113,
29113,
14468,
2,
198,
198,
29113,
14468,
7804,
21017,
198,
2,
2034,
13907,
1920,
5554,
1143,
12462,
966,
18640,
351,
3915,
2334,
13,
198,
2,
1680,
307,
973,
329,
5554,
1143,
3047,
286,
4981,
13,
198,
29113,
14468,
7804,
21017,
198,
198,
11748,
28034,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
4866,
198,
11748,
14601,
198,
198,
6738,
11485,
1330,
11685,
198,
6738,
11485,
1330,
3384,
4487,
198,
6738,
764,
40972,
62,
8692,
62,
21412,
1330,
1635,
198,
198,
40539,
654,
13,
24455,
40539,
654,
10786,
46430,
3256,
6536,
28,
13165,
354,
13,
45051,
13,
2898,
11736,
20361,
8,
628,
198,
29113,
14468,
7804,
21017,
198,
220,
220,
220,
1303,
628,
198,
29113,
14468,
7804,
21017,
628,
628,
198,
29113,
14468,
7804,
21017,
198,
220,
220,
220,
1303,
628,
198,
29113,
14468,
7804,
21017,
198,
220,
220,
220,
1303,
628,
198,
29113,
14468,
7804,
21017,
198,
220,
220,
220,
1303,
628,
198,
29113,
14468,
7804,
21017,
628,
220,
220,
220,
1303,
628,
198,
29113,
14468,
7804,
21017,
198,
2,
8390,
5554,
1143,
350,
6398,
17,
329,
3047,
628,
198
] | 4.31891 | 624 |
from typing import Tuple
from ground.base import Relation
from ground.hints import (Multisegment,
Polygon)
from hypothesis import given
from orient.planar import (multisegment_in_polygon,
segment_in_polygon)
from tests.utils import (LINEAR_COMPOUND_RELATIONS,
equivalence,
implication,
multisegment_pop_left,
multisegment_rotations,
polygon_to_multisegment,
reverse_multisegment,
reverse_multisegment_coordinates,
reverse_polygon_border,
reverse_polygon_coordinates,
reverse_polygon_holes,
reverse_polygon_holes_contours)
from . import strategies
@given(strategies.polygons_with_multisegments)
@given(strategies.polygons)
@given(strategies.polygons_with_with_size_three_or_more_multisegments)
@given(strategies.polygons_with_multisegments)
@given(strategies.polygons_with_multisegments)
| [
6738,
19720,
1330,
309,
29291,
198,
198,
6738,
2323,
13,
8692,
1330,
4718,
341,
198,
6738,
2323,
13,
71,
29503,
1330,
357,
15205,
786,
5154,
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,
12280,
14520,
8,
198,
6738,
14078,
1330,
1813,
198,
198,
6738,
11367,
13,
11578,
283,
1330,
357,
16680,
786,
5154,
62,
259,
62,
35428,
14520,
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,
10618,
62,
259,
62,
35428,
14520,
8,
198,
6738,
5254,
13,
26791,
1330,
357,
24027,
1503,
62,
9858,
47,
15919,
62,
16448,
18421,
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,
6854,
594,
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,
26863,
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,
1963,
786,
5154,
62,
12924,
62,
9464,
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,
1963,
786,
5154,
62,
10599,
602,
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,
7514,
14520,
62,
1462,
62,
16680,
786,
5154,
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,
9575,
62,
16680,
786,
5154,
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,
9575,
62,
16680,
786,
5154,
62,
37652,
17540,
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,
9575,
62,
35428,
14520,
62,
20192,
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,
9575,
62,
35428,
14520,
62,
37652,
17540,
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,
9575,
62,
35428,
14520,
62,
28439,
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,
9575,
62,
35428,
14520,
62,
28439,
62,
3642,
4662,
8,
198,
6738,
764,
1330,
10064,
628,
198,
31,
35569,
7,
2536,
2397,
444,
13,
35428,
70,
684,
62,
4480,
62,
16680,
786,
11726,
8,
628,
198,
31,
35569,
7,
2536,
2397,
444,
13,
35428,
70,
684,
8,
628,
198,
31,
35569,
7,
2536,
2397,
444,
13,
35428,
70,
684,
62,
4480,
62,
4480,
62,
7857,
62,
15542,
62,
273,
62,
3549,
62,
16680,
786,
11726,
8,
628,
198,
31,
35569,
7,
2536,
2397,
444,
13,
35428,
70,
684,
62,
4480,
62,
16680,
786,
11726,
8,
628,
198,
31,
35569,
7,
2536,
2397,
444,
13,
35428,
70,
684,
62,
4480,
62,
16680,
786,
11726,
8,
198
] | 1.926496 | 585 |
import numpy as np
from mountainlab_pytools import mdaio
processor_name='ephys.synthesize_random_firings'
processor_version='0.14'
def synthesize_random_firings(*,firings_out,K=20,samplerate=30000,duration=60):
"""
Synthesize random waveforms for use in creating a synthetic timeseries dataset
Parameters
----------
firings_out : OUTPUT
Path to output firings mda file. 3xL, L is the number of events, second row are timestamps, third row are integer unit labels
K : int
(Optional) number of simulated units
samplerate : double
(Optional) sampling frequency in Hz
duration : double
(Optional) duration of the simulated acquisition in seconds
"""
firing_rates=3*np.ones((K))
refr=4
N=np.int64(duration*samplerate)
# events/sec * sec/timepoint * N
populations=np.ceil(firing_rates/samplerate*N).astype('int')
times=np.zeros(0)
labels=np.zeros(0)
for k in range(1,K+1):
refr_timepoints=refr/1000*samplerate
times0=np.random.rand(populations[k-1])*(N-1)+1
## make an interesting autocorrelogram shape
times0=np.hstack((times0,times0+rand_distr2(refr_timepoints,refr_timepoints*20,times0.size)))
times0=times0[np.random.choice(times0.size,int(times0.size/2))]
times0=times0[np.where((0<=times0)&(times0<N))]
times0=enforce_refractory_period(times0,refr_timepoints)
times=np.hstack((times,times0))
labels=np.hstack((labels,k*np.ones(times0.shape)))
sort_inds=np.argsort(times)
times=times[sort_inds]
labels=labels[sort_inds]
firings=np.zeros((3,times.size),dtype=np.float64)
firings[1,:]=times
firings[2,:]=labels
return mdaio.writemda64(firings,firings_out)
synthesize_random_firings.test=test_synthesize_random_firings
synthesize_random_firings.name = processor_name
synthesize_random_firings.version = processor_version
if __name__ == '__main__':
print ('Running test')
test_synthesize_random_firings()
| [
11748,
299,
32152,
355,
45941,
198,
198,
6738,
8598,
23912,
62,
9078,
31391,
1330,
285,
6814,
952,
198,
198,
41341,
62,
3672,
11639,
27446,
893,
13,
1837,
429,
956,
1096,
62,
25120,
62,
69,
343,
654,
6,
198,
41341,
62,
9641,
11639,
15,
13,
1415,
6,
198,
4299,
24983,
1096,
62,
25120,
62,
69,
343,
654,
7,
25666,
69,
343,
654,
62,
448,
11,
42,
28,
1238,
11,
37687,
20053,
378,
28,
18,
2388,
11,
32257,
28,
1899,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
26375,
956,
1096,
4738,
6769,
23914,
329,
779,
287,
4441,
257,
18512,
1661,
10640,
27039,
628,
220,
220,
220,
40117,
198,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
37979,
654,
62,
448,
1058,
16289,
30076,
198,
220,
220,
220,
220,
220,
220,
220,
10644,
284,
5072,
37979,
654,
285,
6814,
2393,
13,
513,
87,
43,
11,
406,
318,
262,
1271,
286,
2995,
11,
1218,
5752,
389,
4628,
395,
9430,
11,
2368,
5752,
389,
18253,
4326,
14722,
198,
220,
220,
220,
220,
198,
220,
220,
220,
509,
1058,
493,
198,
220,
220,
220,
220,
220,
220,
220,
357,
30719,
8,
1271,
286,
28590,
4991,
198,
220,
220,
220,
6072,
20053,
378,
1058,
4274,
198,
220,
220,
220,
220,
220,
220,
220,
357,
30719,
8,
19232,
8373,
287,
26109,
198,
220,
220,
220,
9478,
1058,
4274,
198,
220,
220,
220,
220,
220,
220,
220,
357,
30719,
8,
9478,
286,
262,
28590,
12673,
287,
4201,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
9645,
62,
9700,
28,
18,
9,
37659,
13,
1952,
19510,
42,
4008,
198,
220,
220,
220,
1006,
81,
28,
19,
198,
220,
220,
220,
220,
198,
220,
220,
220,
399,
28,
37659,
13,
600,
2414,
7,
32257,
9,
37687,
20053,
378,
8,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
2995,
14,
2363,
1635,
792,
14,
2435,
4122,
1635,
399,
198,
220,
220,
220,
9684,
28,
37659,
13,
344,
346,
7,
69,
3428,
62,
9700,
14,
37687,
20053,
378,
9,
45,
737,
459,
2981,
10786,
600,
11537,
198,
220,
220,
220,
1661,
28,
37659,
13,
9107,
418,
7,
15,
8,
198,
220,
220,
220,
14722,
28,
37659,
13,
9107,
418,
7,
15,
8,
198,
220,
220,
220,
329,
479,
287,
2837,
7,
16,
11,
42,
10,
16,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
1006,
81,
62,
2435,
13033,
28,
5420,
81,
14,
12825,
9,
37687,
20053,
378,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1661,
15,
28,
37659,
13,
25120,
13,
25192,
7,
12924,
5768,
58,
74,
12,
16,
12962,
9,
7,
45,
12,
16,
47762,
16,
628,
220,
220,
220,
220,
220,
220,
220,
22492,
787,
281,
3499,
1960,
420,
273,
2411,
21857,
5485,
198,
220,
220,
220,
220,
220,
220,
220,
1661,
15,
28,
37659,
13,
71,
25558,
19510,
22355,
15,
11,
22355,
15,
10,
25192,
62,
17080,
81,
17,
7,
5420,
81,
62,
2435,
13033,
11,
5420,
81,
62,
2435,
13033,
9,
1238,
11,
22355,
15,
13,
7857,
22305,
198,
220,
220,
220,
220,
220,
220,
220,
1661,
15,
28,
22355,
15,
58,
37659,
13,
25120,
13,
25541,
7,
22355,
15,
13,
7857,
11,
600,
7,
22355,
15,
13,
7857,
14,
17,
4008,
60,
198,
220,
220,
220,
220,
220,
220,
220,
1661,
15,
28,
22355,
15,
58,
37659,
13,
3003,
19510,
15,
27,
28,
22355,
15,
8,
5,
7,
22355,
15,
27,
45,
4008,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1661,
15,
28,
268,
3174,
62,
5420,
974,
652,
62,
41007,
7,
22355,
15,
11,
5420,
81,
62,
2435,
13033,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1661,
28,
37659,
13,
71,
25558,
19510,
22355,
11,
22355,
15,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
14722,
28,
37659,
13,
71,
25558,
19510,
23912,
1424,
11,
74,
9,
37659,
13,
1952,
7,
22355,
15,
13,
43358,
22305,
628,
220,
220,
220,
3297,
62,
521,
82,
28,
37659,
13,
22046,
419,
7,
22355,
8,
198,
220,
220,
220,
1661,
28,
22355,
58,
30619,
62,
521,
82,
60,
198,
220,
220,
220,
14722,
28,
23912,
1424,
58,
30619,
62,
521,
82,
60,
628,
220,
220,
220,
37979,
654,
28,
37659,
13,
9107,
418,
19510,
18,
11,
22355,
13,
7857,
828,
67,
4906,
28,
37659,
13,
22468,
2414,
8,
198,
220,
220,
220,
37979,
654,
58,
16,
11,
25,
22241,
22355,
198,
220,
220,
220,
37979,
654,
58,
17,
11,
25,
22241,
23912,
1424,
198,
220,
220,
220,
1441,
285,
6814,
952,
13,
8933,
368,
6814,
2414,
7,
69,
343,
654,
11,
69,
343,
654,
62,
448,
8,
198,
198,
1837,
429,
956,
1096,
62,
25120,
62,
69,
343,
654,
13,
9288,
28,
9288,
62,
1837,
429,
956,
1096,
62,
25120,
62,
69,
343,
654,
198,
1837,
429,
956,
1096,
62,
25120,
62,
69,
343,
654,
13,
3672,
796,
12649,
62,
3672,
198,
1837,
429,
956,
1096,
62,
25120,
62,
69,
343,
654,
13,
9641,
796,
12649,
62,
9641,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
3601,
19203,
28768,
1332,
11537,
198,
220,
220,
220,
1332,
62,
1837,
429,
956,
1096,
62,
25120,
62,
69,
343,
654,
3419,
198,
220,
220,
220,
220,
198
] | 2.320904 | 885 |
import threading
import logging
import inspect
from talon import cron, noise, Context
from user.utils import context_active
class _HandlerMapper(object):
"""Maps contexts to custom handlers.
Workaround for contexts being unable to be added directly.
"""
def add(self, context, handler, priority=0):
"""Add a new handler.
:param Context context: the context under which this mapping is active.
:param handler: the handler this context should map to.
:param int priority: the priority of this mapping. Only one handler can
be returned. If more than one context in our mapping is active, the
one with the _largest priority_ will win. If two contexts have the
same priority, the one added _last_ will win.
"""
# Check now to prevent deferred errors.
assert isinstance(context, Context)
with self._lock:
self._handlers.append((context, handler, priority))
def pick(self):
"""Select the best handler to use in the current context."""
best_handler = None
best_priority = -1
for (context, handler, priority) in self._handlers:
# FIXME: `context.enabled` has been removed
if context_active(context) and priority >= best_priority:
best_handler = handler
best_priority = priority
return best_handler
class LongNoiseMapper(object):
"""Workaround to map long noises within contexts."""
def register(self, context, handler, priority=0, gap_tolerance=0):
"""Register a noise ``handler`` to be active in ``context``.
Can optionally tolerate gaps in the noise.
:param Context context: the context this handler should be active in.
:param handler: will be called when the noise starts & stops. This
should be an instantiated context manager - `__enter__` will be
called when the noise starts, `__exit__` when it finishes.
:param priority: Optional. Handlers are exclusive - only one will be
active at a time. If multiple contexts match, the one with the
largest ``priority`` wins (if there's a draw, the one registered last
will win). Default is 0.
:param float gap_tolerance: Optional. Maximum gap in the noise we will
tolerate, in milliseconds. Gaps smaller than this value will be
ignored. Note this will delay the `handler finishing` callback.
Default is 0.
"""
self._handlers.add(context, _LongNoiseHandler(handler, gap_tolerance), priority)
def _finish_old_handlers(self):
"""Call `_on_finish` for any remaining handlers."""
with self._active_handlers_lock:
for handler in self._active_handlers:
handler.on_finish()
self._active_handlers.clear()
class ShortNoiseMapper(object):
"""Workaround to map short noises within contexts."""
hiss_mapper = LongNoiseMapper("hiss")
pop_mapper = ShortNoiseMapper("pop")
| [
11748,
4704,
278,
198,
11748,
18931,
198,
11748,
10104,
198,
198,
6738,
3305,
261,
1330,
1067,
261,
11,
7838,
11,
30532,
198,
6738,
2836,
13,
26791,
1330,
4732,
62,
5275,
628,
198,
198,
4871,
4808,
25060,
44,
11463,
7,
15252,
2599,
198,
220,
220,
220,
37227,
47010,
26307,
284,
2183,
32847,
13,
628,
220,
220,
220,
5521,
14145,
329,
26307,
852,
5906,
284,
307,
2087,
3264,
13,
628,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
751,
7,
944,
11,
4732,
11,
21360,
11,
8475,
28,
15,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
4550,
257,
649,
21360,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
30532,
4732,
25,
262,
4732,
739,
543,
428,
16855,
318,
4075,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
21360,
25,
262,
21360,
428,
4732,
815,
3975,
284,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
493,
8475,
25,
262,
8475,
286,
428,
16855,
13,
5514,
530,
21360,
460,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
307,
4504,
13,
1002,
517,
621,
530,
4732,
287,
674,
16855,
318,
4075,
11,
262,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
530,
351,
262,
4808,
28209,
8475,
62,
481,
1592,
13,
1002,
734,
26307,
423,
262,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
976,
8475,
11,
262,
530,
2087,
4808,
12957,
62,
481,
1592,
13,
628,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
6822,
783,
284,
2948,
28651,
8563,
13,
198,
220,
220,
220,
220,
220,
220,
220,
6818,
318,
39098,
7,
22866,
11,
30532,
8,
198,
220,
220,
220,
220,
220,
220,
220,
351,
2116,
13557,
5354,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
4993,
8116,
13,
33295,
19510,
22866,
11,
21360,
11,
8475,
4008,
628,
220,
220,
220,
825,
2298,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
17563,
262,
1266,
21360,
284,
779,
287,
262,
1459,
4732,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
1266,
62,
30281,
796,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
1266,
62,
49336,
796,
532,
16,
198,
220,
220,
220,
220,
220,
220,
220,
329,
357,
22866,
11,
21360,
11,
8475,
8,
287,
2116,
13557,
4993,
8116,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
44855,
11682,
25,
4600,
22866,
13,
25616,
63,
468,
587,
4615,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
4732,
62,
5275,
7,
22866,
8,
290,
8475,
18189,
1266,
62,
49336,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1266,
62,
30281,
796,
21360,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1266,
62,
49336,
796,
8475,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
1266,
62,
30281,
628,
198,
4871,
5882,
2949,
786,
44,
11463,
7,
15252,
2599,
198,
220,
220,
220,
37227,
12468,
14145,
284,
3975,
890,
26782,
1626,
26307,
526,
15931,
628,
220,
220,
220,
825,
7881,
7,
944,
11,
4732,
11,
21360,
11,
8475,
28,
15,
11,
7625,
62,
83,
37668,
28,
15,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
38804,
257,
7838,
7559,
30281,
15506,
284,
307,
4075,
287,
7559,
22866,
15506,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1680,
42976,
21923,
17332,
287,
262,
7838,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
30532,
4732,
25,
262,
4732,
428,
21360,
815,
307,
4075,
287,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
21360,
25,
481,
307,
1444,
618,
262,
7838,
4940,
1222,
9911,
13,
770,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
815,
307,
281,
9113,
12931,
4732,
4706,
532,
4600,
834,
9255,
834,
63,
481,
307,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1444,
618,
262,
7838,
4940,
11,
4600,
834,
37023,
834,
63,
618,
340,
20271,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
8475,
25,
32233,
13,
7157,
8116,
389,
8568,
532,
691,
530,
481,
307,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4075,
379,
257,
640,
13,
1002,
3294,
26307,
2872,
11,
262,
530,
351,
262,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4387,
7559,
49336,
15506,
7864,
357,
361,
612,
338,
257,
3197,
11,
262,
530,
6823,
938,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
481,
1592,
737,
15161,
318,
657,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
12178,
7625,
62,
83,
37668,
25,
32233,
13,
22246,
7625,
287,
262,
7838,
356,
481,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21923,
11,
287,
38694,
13,
402,
1686,
4833,
621,
428,
1988,
481,
307,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9514,
13,
5740,
428,
481,
5711,
262,
4600,
30281,
12848,
63,
23838,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15161,
318,
657,
13,
628,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
4993,
8116,
13,
2860,
7,
22866,
11,
4808,
14617,
2949,
786,
25060,
7,
30281,
11,
7625,
62,
83,
37668,
828,
8475,
8,
628,
220,
220,
220,
825,
4808,
15643,
680,
62,
727,
62,
4993,
8116,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
14134,
4600,
62,
261,
62,
15643,
680,
63,
329,
597,
5637,
32847,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
351,
2116,
13557,
5275,
62,
4993,
8116,
62,
5354,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
21360,
287,
2116,
13557,
5275,
62,
4993,
8116,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21360,
13,
261,
62,
15643,
680,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
5275,
62,
4993,
8116,
13,
20063,
3419,
628,
198,
4871,
10073,
2949,
786,
44,
11463,
7,
15252,
2599,
198,
220,
220,
220,
37227,
12468,
14145,
284,
3975,
1790,
26782,
1626,
26307,
526,
15931,
628,
198,
71,
747,
62,
76,
11463,
796,
5882,
2949,
786,
44,
11463,
7203,
71,
747,
4943,
198,
12924,
62,
76,
11463,
796,
10073,
2949,
786,
44,
11463,
7203,
12924,
4943,
198
] | 2.824561 | 1,083 |
# Return the first 10 surface indices of an UnstructuredGrid.
#
from pyvista import examples
grid = examples.load_hexbeam()
ind = grid.surface_indices()
ind[:10] # doctest:+SKIP
# Expected:
## pyvista_ndarray([ 0, 2, 36, 27, 7, 8, 81, 1, 18, 4])
| [
2,
8229,
262,
717,
838,
4417,
36525,
286,
281,
791,
7249,
1522,
41339,
13,
198,
2,
198,
6738,
12972,
85,
12523,
1330,
6096,
198,
25928,
796,
6096,
13,
2220,
62,
33095,
40045,
3419,
198,
521,
796,
10706,
13,
42029,
62,
521,
1063,
3419,
198,
521,
58,
25,
940,
60,
220,
1303,
10412,
395,
25,
10,
18831,
4061,
198,
2,
1475,
7254,
25,
198,
2235,
12972,
85,
12523,
62,
358,
18747,
26933,
657,
11,
220,
362,
11,
4570,
11,
2681,
11,
220,
767,
11,
220,
807,
11,
9773,
11,
220,
352,
11,
1248,
11,
220,
604,
12962,
198
] | 2.597938 | 97 |
from django import forms
from .models import Temperature
class TemperatureCreateForm(forms.ModelForm):
"""
Temperature create form
"""
| [
6738,
42625,
14208,
1330,
5107,
628,
198,
6738,
764,
27530,
1330,
34467,
628,
198,
4871,
34467,
16447,
8479,
7,
23914,
13,
17633,
8479,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
34467,
2251,
1296,
198,
220,
220,
220,
37227,
198
] | 3.595238 | 42 |
import cv2
import urllib2
import numpy as np
import sys
host = "192.168.1.85:8080"
if len(sys.argv)>1:
host = sys.argv[1]
hoststr = 'http://' + host + '/?action=stream'
print 'Streaming ' + hoststr
print 'Print Esc to quit'
stream=urllib2.urlopen(hoststr)
bytes=''
while True:
bytes+=stream.read(1024)
a = bytes.find('\xff\xd8')
b = bytes.find('\xff\xd9')
if a!=-1 and b!=-1:
jpg = bytes[a:b+2]
bytes= bytes[b+2:]
#flags = 1 for color image
i = cv2.imdecode(np.fromstring(jpg, dtype=np.uint8),flags=1)
print i
cv2.imshow("xiaorun",i)
#if cv2.waitKey(1) & 0xFF == ord('q'):
# exit(0) | [
11748,
269,
85,
17,
198,
11748,
2956,
297,
571,
17,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
25064,
198,
4774,
796,
366,
17477,
13,
14656,
13,
16,
13,
5332,
25,
1795,
1795,
1,
198,
361,
18896,
7,
17597,
13,
853,
85,
8,
29,
16,
25,
198,
220,
220,
220,
2583,
796,
25064,
13,
853,
85,
58,
16,
60,
198,
4774,
2536,
796,
705,
4023,
1378,
6,
1343,
2583,
1343,
705,
20924,
2673,
28,
5532,
6,
198,
4798,
705,
12124,
278,
705,
1343,
2583,
2536,
198,
198,
4798,
705,
18557,
16319,
284,
11238,
6,
198,
5532,
28,
333,
297,
571,
17,
13,
6371,
9654,
7,
4774,
2536,
8,
198,
33661,
28,
7061,
198,
4514,
6407,
25,
198,
220,
220,
220,
9881,
47932,
5532,
13,
961,
7,
35500,
8,
198,
220,
220,
220,
257,
796,
9881,
13,
19796,
10786,
59,
47596,
59,
24954,
23,
11537,
198,
220,
220,
220,
275,
796,
9881,
13,
19796,
10786,
59,
47596,
59,
24954,
24,
11537,
198,
220,
220,
220,
611,
257,
0,
10779,
16,
290,
275,
0,
10779,
16,
25,
198,
220,
220,
220,
220,
220,
220,
220,
474,
6024,
796,
9881,
58,
64,
25,
65,
10,
17,
60,
198,
220,
220,
220,
220,
220,
220,
220,
9881,
28,
9881,
58,
65,
10,
17,
47715,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
33152,
796,
352,
329,
3124,
2939,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
796,
269,
85,
17,
13,
320,
12501,
1098,
7,
37659,
13,
6738,
8841,
7,
9479,
11,
288,
4906,
28,
37659,
13,
28611,
23,
828,
33152,
28,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
1312,
198,
220,
220,
220,
220,
220,
220,
220,
269,
85,
17,
13,
320,
12860,
7203,
36072,
273,
403,
1600,
72,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
361,
269,
85,
17,
13,
17077,
9218,
7,
16,
8,
1222,
657,
87,
5777,
6624,
2760,
10786,
80,
6,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
220,
220,
8420,
7,
15,
8
] | 1.982249 | 338 |
import sys
input = sys.stdin.readline
xmax, ymax = list(map(int, input().split()))
x, y = list(map(int, input().split()))
posx, posy = 0, 0
while(x != 0 or y != 0):
posx += x
posy += y
if posx < 0:
posx = 0
if posx > xmax:
posx = xmax
if posy < 0:
posy = 0
if posy > ymax:
posy = ymax
print(posx, posy)
x, y = list(map(int, input().split())) | [
11748,
25064,
198,
15414,
796,
25064,
13,
19282,
259,
13,
961,
1370,
198,
198,
87,
9806,
11,
331,
9806,
796,
1351,
7,
8899,
7,
600,
11,
5128,
22446,
35312,
3419,
4008,
628,
198,
87,
11,
331,
796,
1351,
7,
8899,
7,
600,
11,
5128,
22446,
35312,
3419,
4008,
198,
198,
1930,
87,
11,
1426,
88,
796,
657,
11,
657,
198,
198,
4514,
7,
87,
14512,
657,
393,
331,
14512,
657,
2599,
198,
220,
220,
220,
1426,
87,
15853,
2124,
198,
220,
220,
220,
1426,
88,
15853,
331,
198,
220,
220,
220,
611,
1426,
87,
1279,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1426,
87,
796,
657,
198,
220,
220,
220,
611,
1426,
87,
1875,
2124,
9806,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1426,
87,
796,
2124,
9806,
198,
220,
220,
220,
611,
1426,
88,
1279,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1426,
88,
796,
657,
198,
220,
220,
220,
611,
1426,
88,
1875,
331,
9806,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1426,
88,
796,
331,
9806,
198,
220,
220,
220,
220,
198,
220,
220,
220,
3601,
7,
1930,
87,
11,
1426,
88,
8,
198,
220,
220,
220,
2124,
11,
331,
796,
1351,
7,
8899,
7,
600,
11,
5128,
22446,
35312,
3419,
4008
] | 1.930233 | 215 |
##
# Copyright (c) 2010-2017 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
##
"""
Tests for L{twext.enterprise.adbapi2}.
"""
import gc
from zope.interface.verify import verifyObject
from twisted.python.failure import Failure
from twisted.trial.unittest import TestCase
from twisted.internet.defer import Deferred, fail, succeed, inlineCallbacks
from twisted.test.proto_helpers import StringTransport
from twext.enterprise.ienterprise import ConnectionError
from twext.enterprise.ienterprise import AlreadyFinishedError
from twext.enterprise.adbapi2 import ConnectionPoolClient
from twext.enterprise.adbapi2 import ConnectionPoolConnection
from twext.enterprise.ienterprise import IAsyncTransaction
from twext.enterprise.ienterprise import ICommandBlock
from twext.enterprise.adbapi2 import FailsafeException
from twext.enterprise.adbapi2 import ConnectionPool
from twext.enterprise.fixtures import ConnectionPoolHelper
from twext.enterprise.fixtures import resultOf
from twext.enterprise.fixtures import ClockWithThreads
from twext.enterprise.fixtures import FakeConnectionError
from twext.enterprise.fixtures import RollbackFail
from twext.enterprise.fixtures import CommitFail
from twext.enterprise.adbapi2 import Commit
from twext.enterprise.adbapi2 import _HookableOperation
class TrashCollector(object):
"""
Test helper for monitoring gc.garbage.
"""
def checkTrash(self):
"""
Ensure that the test has added no additional garbage.
"""
gc.collect()
newGarbage = gc.garbage[self.garbageStart:]
if newGarbage:
# Don't clean up twice.
self.start()
self.testCase.fail("New garbage: " + repr(newGarbage))
class AssertResultHelper(object):
"""
Mixin for asserting about synchronous Deferred results.
"""
def assertResultList(self, resultList, expected):
"""
Assert that a list created with L{resultOf} contais the expected
result.
@param resultList: The return value of L{resultOf}.
@type resultList: L{list}
@param expected: The expected value that should be present in the list;
a L{Failure} if an exception is expected to be raised.
"""
if not resultList:
self.fail("No result; Deferred didn't fire yet.")
else:
if isinstance(resultList[0], Failure):
if isinstance(expected, Failure):
resultList[0].trap(expected.type)
else:
resultList[0].raiseException()
else:
self.assertEqual(resultList, [expected])
class ConnectionPoolBootTests(TestCase):
"""
Tests for the start-up phase of L{ConnectionPool}.
"""
def test_threadCount(self):
"""
The reactor associated with a L{ConnectionPool} will have its maximum
thread count adjusted when L{ConnectionPool.startService} is called, to
accomodate for L{ConnectionPool.maxConnections} additional threads.
Stopping the service should restore it to its original value, so that a
repeatedly re-started L{ConnectionPool} will not cause the thread
ceiling to grow without bound.
"""
defaultMax = 27
connsMax = 45
combinedMax = defaultMax + connsMax
pool = ConnectionPool(None, maxConnections=connsMax)
pool.reactor = ClockWithThreads()
threadpool = pool.reactor.getThreadPool()
pool.reactor.suggestThreadPoolSize(defaultMax)
self.assertEquals(threadpool.max, defaultMax)
pool.startService()
self.assertEquals(threadpool.max, combinedMax)
justChecking = []
pool.stopService().addCallback(justChecking.append)
# No SQL run, so no threads started, so this deferred should fire
# immediately. If not, we're in big trouble, so sanity check.
self.assertEquals(justChecking, [None])
self.assertEquals(threadpool.max, defaultMax)
def test_isRunning(self):
"""
L{ConnectionPool.startService} should set its C{running} attribute to
true.
"""
pool = ConnectionPool(None)
pool.reactor = ClockWithThreads()
self.assertEquals(pool.running, False)
pool.startService()
self.assertEquals(pool.running, True)
class ConnectionPoolNameTests(TestCase):
"""
Tests for L{ConnectionPool}'s C{name} attribute.
"""
def test_default(self):
"""
If no value is given for the C{name} parameter to L{ConnectionPool}'s
initializer then L{ConnectionPool.name} is C{None}.
"""
pool = ConnectionPool(None)
self.assertIs(None, pool.name)
def test_specified(self):
"""
If a value is given for the C{name} parameter to L{ConnectionPool}'s
initializer then it is used as the value for L{ConnectionPool.name}.
"""
name = "some test pool"
pool = ConnectionPool(None, name=name)
self.assertEqual(name, pool.name)
class ConnectionPoolTests(ConnectionPoolHelper, TestCase, AssertResultHelper):
"""
Tests for L{ConnectionPool}.
"""
def test_tooManyConnections(self):
"""
When the number of outstanding busy transactions exceeds the number of
slots specified by L{ConnectionPool.maxConnections},
L{ConnectionPool.connection} will return a pooled transaction that is
not backed by any real database connection; this object will queue its
SQL statements until an existing connection becomes available.
"""
a = self.createTransaction()
alphaResult = self.resultOf(a.execSQL("alpha"))
[[_ignore_counter, _ignore_echo]] = alphaResult[0]
b = self.createTransaction()
# "b" should have opened a connection.
self.assertEquals(len(self.factory.connections), 2)
betaResult = self.resultOf(b.execSQL("beta"))
[[bcounter, _ignore_becho]] = betaResult[0]
# both "a" and "b" are holding open a connection now; let's try to open
# a third one. (The ordering will be deterministic even if this fails,
# because those threads are already busy.)
c = self.createTransaction()
gammaResult = self.resultOf(c.execSQL("gamma"))
# Did "c" open a connection? Let's hope not...
self.assertEquals(len(self.factory.connections), 2)
# SQL shouldn't be executed too soon...
self.assertEquals(gammaResult, [])
commitResult = self.resultOf(b.commit())
# Now that "b" has committed, "c" should be able to complete.
[[ccounter, _ignore_cecho]] = gammaResult[0]
# The connection for "a" ought to still be busy, so let's make sure
# we're using the one for "c".
self.assertEquals(ccounter, bcounter)
# Sanity check: the commit should have succeeded!
self.assertEquals(commitResult, [None])
def test_stopService(self):
"""
L{ConnectionPool.stopService} stops all the associated L{ThreadHolder}s
and thereby frees up the resources it is holding.
"""
a = self.createTransaction()
alphaResult = self.resultOf(a.execSQL("alpha"))
[[[_ignore_counter, _ignore_echo]]] = alphaResult
self.assertEquals(len(self.factory.connections), 1)
self.assertEquals(len(self.holders), 1)
[holder] = self.holders
self.assertEquals(holder.started, True)
self.assertEquals(holder.stopped, False)
self.pool.stopService()
self.assertEquals(self.pool.running, False)
self.assertEquals(len(self.holders), 1)
self.assertEquals(holder.started, True)
self.assertEquals(holder.stopped, True)
# Closing fake connections removes them from the list.
self.assertEquals(len(self.factory.connections), 1)
self.assertEquals(self.factory.connections[0].closed, True)
def test_retryAfterConnectError(self):
"""
When the C{connectionFactory} passed to L{ConnectionPool} raises an
exception, the L{ConnectionPool} will log the exception and delay
execution of a new connection's SQL methods until an attempt succeeds.
"""
self.factory.willFail()
self.factory.willFail()
self.factory.willConnect()
c = self.createTransaction()
checkOneFailure()
d = c.execSQL("alpha")
happened = []
d.addBoth(happened.append)
self.assertEquals(happened, [])
self.clock.advance(self.pool.RETRY_TIMEOUT + 0.01)
checkOneFailure()
self.assertEquals(happened, [])
self.clock.advance(self.pool.RETRY_TIMEOUT + 0.01)
self.flushHolders()
self.assertEquals(happened, [[[1, "alpha"]]])
def test_shutdownDuringRetry(self):
"""
If a L{ConnectionPool} is attempting to shut down while it's in the
process of re-trying a connection attempt that received an error, the
connection attempt should be cancelled and the shutdown should complete
as normal.
"""
self.factory.defaultFail()
self.createTransaction()
errors = self.flushLoggedErrors(FakeConnectionError)
self.assertEquals(len(errors), 1)
stopd = []
self.pool.stopService().addBoth(stopd.append)
self.assertResultList(stopd, None)
self.assertEquals(self.clock.calls, [])
[holder] = self.holders
self.assertEquals(holder.started, True)
self.assertEquals(holder.stopped, True)
def test_shutdownDuringAttemptSuccess(self):
"""
If L{ConnectionPool.stopService} is called while a connection attempt
is outstanding, the resulting L{Deferred} won't be fired until the
connection attempt has finished; in this case, succeeded.
"""
self.pauseHolders()
self.createTransaction()
stopd = []
self.pool.stopService().addBoth(stopd.append)
self.assertEquals(stopd, [])
self.flushHolders()
self.assertResultList(stopd, None)
[holder] = self.holders
self.assertEquals(holder.started, True)
self.assertEquals(holder.stopped, True)
def test_shutdownDuringAttemptFailed(self):
"""
If L{ConnectionPool.stopService} is called while a connection attempt
is outstanding, the resulting L{Deferred} won't be fired until the
connection attempt has finished; in this case, failed.
"""
self.factory.defaultFail()
self.pauseHolders()
self.createTransaction()
stopd = []
self.pool.stopService().addBoth(stopd.append)
self.assertEquals(stopd, [])
self.flushHolders()
errors = self.flushLoggedErrors(FakeConnectionError)
self.assertEquals(len(errors), 1)
self.assertResultList(stopd, None)
[holder] = self.holders
self.assertEquals(holder.started, True)
self.assertEquals(holder.stopped, True)
def test_stopServicePseudoTxn(self):
"""
When L{ConnectionPool.stopService} is called with a pending
L{_ConnectingPseudoTxn} active, the DB connection being created
is closed.
"""
self.pauseHolders()
self.createTransaction()
stopResult = self.resultOf(self.pool.stopService())
self.assertEquals(stopResult, [])
self.flushHolders()
[holder] = self.holders
self.assertEquals(holder.started, True)
self.assertEquals(holder.stopped, True)
self.assertEquals(len(self.factory.connections), 1)
self.assertEquals(self.factory.connections[0].closed, True)
def test_stopServiceMidAbort(self):
"""
When L{ConnectionPool.stopService} is called with deferreds from
C{abort} still outstanding, it will wait for the currently-aborting
transaction to fully abort before firing the L{Deferred} returned from
C{stopService}.
"""
# TODO: commit() too?
self.pauseHolders()
c = self.createTransaction()
abortResult = self.resultOf(c.abort())
# Should abort instantly, as it hasn't managed to unspool anything yet.
# FIXME: kill all Deferreds associated with this thing, make sure that
# any outstanding query callback chains get nuked.
self.assertEquals(abortResult, [None])
stopResult = self.resultOf(self.pool.stopService())
self.assertEquals(stopResult, [])
self.flushHolders()
# self.assertEquals(abortResult, [None])
self.assertResultList(stopResult, None)
def test_stopServiceWithSpooled(self):
"""
When L{ConnectionPool.stopService} is called when spooled transactions
are outstanding, any pending L{Deferreds} returned by those
transactions will be failed with L{ConnectionError}.
"""
# Use up the free slots so we have to spool.
hold = []
hold.append(self.createTransaction())
hold.append(self.createTransaction())
c = self.createTransaction()
se = self.resultOf(c.execSQL("alpha"))
ce = self.resultOf(c.commit())
self.assertEquals(se, [])
self.assertEquals(ce, [])
self.resultOf(self.pool.stopService())
self.assertEquals(se[0].type, self.translateError(ConnectionError))
self.assertEquals(ce[0].type, self.translateError(ConnectionError))
def test_repoolSpooled(self):
"""
Regression test for a somewhat tricky-to-explain bug: when a spooled
transaction which has already had commit() called on it before it's
received a real connection to start executing on, it will not leave
behind any detritus that prevents stopService from working.
"""
self.pauseHolders()
c = self.createTransaction()
c2 = self.createTransaction()
c3 = self.createTransaction()
c.commit()
c2.commit()
c3.commit()
self.flushHolders()
self.assertEquals(len(self.factory.connections), 2)
stopResult = self.resultOf(self.pool.stopService())
self.assertEquals(stopResult, [None])
self.assertEquals(len(self.factory.connections), 2)
self.assertEquals(self.factory.connections[0].closed, True)
self.assertEquals(self.factory.connections[1].closed, True)
def test_connectAfterStop(self):
"""
Calls to connection() after stopService() result in transactions which
immediately fail all operations.
"""
stopResults = self.resultOf(self.pool.stopService())
self.assertEquals(stopResults, [None])
self.pauseHolders()
postClose = self.createTransaction()
queryResult = self.resultOf(postClose.execSQL("hello"))
self.assertEquals(len(queryResult), 1)
self.assertEquals(queryResult[0].type,
self.translateError(ConnectionError))
def test_connectAfterStartedStopping(self):
"""
Calls to connection() after stopService() has been called but before it
has completed will result in transactions which immediately fail all
operations.
"""
self.pauseHolders()
preClose = self.createTransaction()
preCloseResult = self.resultOf(preClose.execSQL("statement"))
stopResult = self.resultOf(self.pool.stopService())
postClose = self.createTransaction()
queryResult = self.resultOf(postClose.execSQL("hello"))
self.assertEquals(stopResult, [])
self.assertEquals(len(queryResult), 1)
self.assertEquals(
queryResult[0].type,
self.translateError(ConnectionError)
)
self.assertEquals(len(preCloseResult), 1)
self.assertEquals(
preCloseResult[0].type,
self.translateError(ConnectionError)
)
def test_abortFailsDuringStopService(self):
"""
L{IAsyncTransaction.abort} might fail, most likely because the
underlying database connection has already been disconnected. If this
happens, shutdown should continue.
"""
txns = []
txns.append(self.createTransaction())
txns.append(self.createTransaction())
for txn in txns:
# Make sure rollback will actually be executed.
results = self.resultOf(txn.execSQL("maybe change something!"))
[[[_ignore_counter, echo]]] = results
self.assertEquals("maybe change something!", echo)
# Fail one (and only one) call to rollback().
self.factory.rollbackFail = True
stopResult = self.resultOf(self.pool.stopService())
self.assertEquals(stopResult, [None])
self.assertEquals(len(self.flushLoggedErrors(RollbackFail)), 1)
self.assertEquals(self.factory.connections[0].closed, True)
self.assertEquals(self.factory.connections[1].closed, True)
def test_partialTxnFailsDuringStopService(self):
"""
Using the logic in L{ConnectionPool.stopService}, make sure that an
L{_ConnectedTxn} cannot continue to process SQL after L{_ConnectedTxn.abort}
is called and before L{_ConnectedTxn.reset} is called.
"""
txn = self.createTransaction()
if hasattr(txn, "_baseTxn"):
# Send initial statement
txn.execSQL("maybe change something!")
# Make it look like the service is stopping
txn._baseTxn._connection.close()
txn._baseTxn.terminate()
# Try to send more SQL - must fail
self.failUnlessRaises(RuntimeError, txn.execSQL, "maybe change something else!")
def test_abortRecycledTransaction(self):
"""
L{ConnectionPool.stopService} will shut down if a recycled transaction
is still pending.
"""
recycled = self.createTransaction()
self.resultOf(recycled.commit())
remember = []
remember.append(self.createTransaction())
self.assertEquals(self.resultOf(self.pool.stopService()), [None])
def test_abortSpooled(self):
"""
Aborting a still-spooled transaction (one which has no statements being
executed) will result in all of its Deferreds immediately failing and
none of the queued statements being executed.
"""
active = []
# Use up the available connections ...
for _ignore in xrange(self.pool.maxConnections):
active.append(self.createTransaction())
# ... so that this one has to be spooled.
spooled = self.createTransaction()
result = self.resultOf(spooled.execSQL("alpha"))
# sanity check, it would be bad if this actually executed.
self.assertEqual(result, [])
self.resultOf(spooled.abort())
self.assertEqual(result[0].type, self.translateError(ConnectionError))
def test_waitForAlreadyAbortedTransaction(self):
"""
L{ConnectionPool.stopService} will wait for all transactions to shut
down before exiting, including those which have already been stopped.
"""
it = self.createTransaction()
self.pauseHolders()
abortResult = self.resultOf(it.abort())
# steal it from the queue so we can do it out of order
d, _ignore_work = self.holders[0]._q.get()
# that should be the only work unit so don't continue if something else
# got in there
self.assertEquals(list(self.holders[0]._q.queue), [])
self.assertEquals(len(self.holders), 1)
self.flushHolders()
stopResult = self.resultOf(self.pool.stopService())
# Sanity check that we haven't actually stopped it yet
self.assertEquals(abortResult, [])
# We haven't fired it yet, so the service had better not have
# stopped...
self.assertEquals(stopResult, [])
d.callback(None)
self.flushHolders()
self.assertEquals(abortResult, [None])
self.assertEquals(stopResult, [None])
def test_garbageCollectedTransactionAborts(self):
"""
When an L{IAsyncTransaction} is garbage collected, it ought to abort
itself.
"""
t = self.createTransaction()
self.resultOf(t.execSQL("echo", []))
conns = self.factory.connections
self.assertEquals(len(conns), 1)
self.assertEquals(conns[0]._rollbackCount, 0)
del t
gc.collect()
self.flushHolders()
self.assertEquals(len(conns), 1)
self.assertEquals(conns[0]._rollbackCount, 1)
self.assertEquals(conns[0]._commitCount, 0)
def circularReferenceTest(self, finish, hook):
"""
Collecting a completed (committed or aborted) L{IAsyncTransaction}
should not leak any circular references.
"""
tc = TrashCollector(self)
commitExecuted = []
self.failIf(commitExecuted, "Commit hook executed.")
carefullyManagedScope()
tc.checkTrash()
def test_noGarbageOnCommit(self):
"""
Committing a transaction does not cause gc garbage.
"""
self.circularReferenceTest(
lambda txn: txn.commit(),
lambda txn, hook: txn.preCommit(hook)
)
def test_noGarbageOnCommitWithAbortHook(self):
"""
Committing a transaction does not cause gc garbage.
"""
self.circularReferenceTest(
lambda txn: txn.commit(),
lambda txn, hook: txn.postAbort(hook)
)
def test_noGarbageOnAbort(self):
"""
Aborting a transaction does not cause gc garbage.
"""
self.circularReferenceTest(
lambda txn: txn.abort(),
lambda txn, hook: txn.preCommit(hook)
)
def test_noGarbageOnAbortWithPostCommitHook(self):
"""
Aborting a transaction does not cause gc garbage.
"""
self.circularReferenceTest(
lambda txn: txn.abort(),
lambda txn, hook: txn.postCommit(hook)
)
def test_tooManyConnectionsWhileOthersFinish(self):
"""
L{ConnectionPool.connection} will not spawn more than the maximum
connections if there are finishing transactions outstanding.
"""
a = self.createTransaction()
b = self.createTransaction()
self.pauseHolders()
a.abort()
b.abort()
# Remove the holders for the existing connections, so that the "extra"
# connection() call wins the race and gets executed first.
oldholders = list(self.holders)
self.holders[:] = []
self.createTransaction()
self.flushHolders()
self.assertEquals(len(self.factory.connections), 2)
self.holders = oldholders
self.flushHolders()
def setParamstyle(self, paramstyle):
"""
Change the paramstyle of the transaction under test.
"""
self.pool.dbtype = self.pool.dbtype.copyreplace(paramstyle=paramstyle)
def test_propagateParamstyle(self):
"""
Each different type of L{ISQLExecutor} relays the C{paramstyle}
attribute from the L{ConnectionPool}.
"""
TEST_PARAMSTYLE = "justtesting"
self.setParamstyle(TEST_PARAMSTYLE)
normaltxn = self.createTransaction()
self.assertEquals(normaltxn.dbtype.paramstyle, TEST_PARAMSTYLE)
self.assertEquals(normaltxn.commandBlock().dbtype.paramstyle, TEST_PARAMSTYLE)
self.pauseHolders()
extra = []
extra.append(self.createTransaction())
waitingtxn = self.createTransaction()
self.assertEquals(waitingtxn.dbtype.paramstyle, TEST_PARAMSTYLE)
self.flushHolders()
self.pool.stopService()
notxn = self.createTransaction()
self.assertEquals(notxn.dbtype.paramstyle, TEST_PARAMSTYLE)
def setDialect(self, dialect):
"""
Change the dialect of the transaction under test.
"""
self.pool.dbtype = self.pool.dbtype.copyreplace(dialect=dialect)
def test_propagateDialect(self):
"""
Each different type of L{ISQLExecutor} relays the C{dialect}
attribute from the L{ConnectionPool}.
"""
TEST_DIALECT = "otherdialect"
self.setDialect(TEST_DIALECT)
normaltxn = self.createTransaction()
self.assertEquals(normaltxn.dbtype.dialect, TEST_DIALECT)
self.assertEquals(normaltxn.commandBlock().dbtype.dialect, TEST_DIALECT)
self.pauseHolders()
extra = []
extra.append(self.createTransaction())
waitingtxn = self.createTransaction()
self.assertEquals(waitingtxn.dbtype.dialect, TEST_DIALECT)
self.flushHolders()
self.pool.stopService()
notxn = self.createTransaction()
self.assertEquals(notxn.dbtype.dialect, TEST_DIALECT)
def test_reConnectWhenFirstExecFails(self):
"""
Generally speaking, DB-API 2.0 adapters do not provide information
about the cause of a failed C{execute} method; they definitely don't
provide it in a way which can be identified as related to the syntax of
the query, the state of the database itself, the state of the
connection, etc.
Therefore the best general heuristic for whether the connection to the
database has been lost and needs to be re-established is to catch
exceptions which are raised by the I{first} statement executed in a
transaction.
"""
# Allow C{connect} to succeed. This should behave basically the same
# whether connect() happened to succeed in some previous transaction
# and it's recycling the underlying transaction, or connect() just
# succeeded. Either way you just have a _SingleTxn wrapping a
# _ConnectedTxn.
txn = self.createTransaction()
self.assertEquals(len(self.factory.connections), 1,
"Sanity check failed.")
class CustomExecuteFailed(Exception):
"""
Custom "execute-failed" exception.
"""
self.factory.connections[0].executeWillFail(CustomExecuteFailed)
results = self.resultOf(txn.execSQL("hello, world!"))
[[[_ignore_counter, echo]]] = results
self.assertEquals("hello, world!", echo)
# Two execution attempts should have been made, one on each connection.
# The first failed with a RuntimeError, but that is deliberately
# obscured, because then we tried again and it succeeded.
self.assertEquals(
len(self.factory.connections), 2,
"No new connection opened."
)
self.assertEquals(self.factory.connections[0].executions, 1)
self.assertEquals(self.factory.connections[1].executions, 1)
self.assertEquals(self.factory.connections[0].closed, True)
self.assertEquals(self.factory.connections[1].closed, False)
# Nevertheless, since there is currently no classification of "safe"
# errors, we should probably log these messages when they occur.
self.assertEquals(len(self.flushLoggedErrors(CustomExecuteFailed)), 1)
def test_reConnectWhenFirstExecOnExistingConnectionFails(
self, moreFailureSetup=lambda factory: None
):
"""
Another situation that might arise is that a connection will be
successfully connected, executed and recycled into the connection pool;
then, the database server will shut down and the connections will die,
but we will be none the wiser until we try to use them.
"""
txn = self.createTransaction()
moreFailureSetup(self.factory)
self.assertEquals(
len(self.factory.connections), 1, "Sanity check failed."
)
results = self.resultOf(txn.execSQL("hello, world!"))
txn.commit()
[[[_ignore_counter, echo]]] = results
self.assertEquals("hello, world!", echo)
txn2 = self.createTransaction()
self.assertEquals(
len(self.factory.connections), 1, "Sanity check failed."
)
class CustomExecFail(Exception):
"""
Custom C{execute()} failure.
"""
self.factory.connections[0].executeWillFail(CustomExecFail)
results = self.resultOf(txn2.execSQL("second try!"))
txn2.commit()
[[[_ignore_counter, echo]]] = results
self.assertEquals("second try!", echo)
self.assertEquals(len(self.flushLoggedErrors(CustomExecFail)), 1)
def test_closeExceptionDoesntHinderReconnection(self):
"""
In some database bindings, if the server closes the connection,
C{close()} will fail. If C{close} fails, there's not much that could
mean except that the connection is already closed, so similar to the
condition described in
L{test_reConnectWhenFirstExecOnExistingConnectionFails}, the
failure should be logged, but transparent to application code.
"""
class BindingSpecificException(Exception):
"""
Exception that's a placeholder for something that a database
binding might raise.
"""
t = self.test_reConnectWhenFirstExecOnExistingConnectionFails(
alsoFailClose
)
errors = self.flushLoggedErrors(BindingSpecificException)
self.assertEquals(len(errors), 1)
return t
def test_preCommitSuccess(self):
"""
Callables passed to L{IAsyncTransaction.preCommit} will be invoked upon
commit.
"""
txn = self.createTransaction()
simple.done = False
txn.preCommit(simple)
self.assertEquals(simple.done, False)
result = self.resultOf(txn.commit())
self.assertEquals(len(result), 1)
self.assertEquals(simple.done, True)
def test_deferPreCommit(self):
"""
If callables passed to L{IAsyncTransaction.preCommit} return
L{Deferred}s, they will defer the actual commit operation until it has
fired.
"""
txn = self.createTransaction()
d = Deferred()
wait.started = False
wait.sqlResult = None
txn.preCommit(wait)
result = self.resultOf(txn.commit())
self.flushHolders()
self.assertEquals(wait.started, True)
self.assertEquals(wait.sqlResult, None)
self.assertEquals(result, [])
d.callback(None)
# allow network I/O for pooled / networked implementation; there should
# be the commit message now.
self.flushHolders()
self.assertEquals(len(result), 1)
self.assertEquals(wait.sqlResult, [[1, "some test sql"]])
def test_failPreCommit(self):
"""
If callables passed to L{IAsyncTransaction.preCommit} raise an
exception or return a Failure, subsequent callables will not be run,
and the transaction will be aborted.
"""
test(failer, ZeroDivisionError)
test(raiser, EOFError)
def test_noOpCommitDoesntHinderReconnection(self):
"""
Until you've executed a query or performed a statement on an ADBAPI
connection, the connection is semantically idle (between transactions).
A .commit() or .rollback() followed immediately by a .commit() is
therefore pointless, and can be ignored. Furthermore, actually
executing the commit and propagating a possible connection-oriented
error causes clients to see errors, when, if those clients had actually
executed any statements, the connection would have been recycled and
the statement transparently re-executed by the logic tested by
L{test_reConnectWhenFirstExecFails}.
"""
txn = self.createTransaction()
self.factory.commitFail = True
self.factory.rollbackFail = True
[x] = self.resultOf(txn.commit())
# No statements have been executed, so C{commit} will *not* be
# executed.
self.assertEquals(self.factory.commitFail, True)
self.assertIdentical(x, None)
self.assertEquals(len(self.pool._free), 1)
self.assertEquals(self.pool._finishing, [])
self.assertEquals(len(self.factory.connections), 1)
self.assertEquals(self.factory.connections[0].closed, False)
def test_reConnectWhenSecondExecFailsThenFirstExecFails(self):
"""
Other connection-oriented errors might raise exceptions if they occur
in the middle of a transaction, but that should cause the error to be
caught, the transaction to be aborted, and the (closed) connection to
be recycled, where the next transaction that attempts to do anything
with it will encounter the error immediately and discover it needs to
be recycled.
It would be better if this behavior were invisible, but that could only
be accomplished with more precise database exceptions. We may come up
with support in the future for more precisely identifying exceptions,
but I{unknown} exceptions should continue to be treated in this manner,
relaying the exception back to application code but attempting a
re-connection on the next try.
"""
txn = self.createTransaction()
[[[_ignore_counter, _ignore_echo]]] = self.resultOf(txn.execSQL("hello, world!", []))
self.factory.connections[0].executeWillFail(ZeroDivisionError)
[f] = self.resultOf(txn.execSQL("divide by zero", []))
f.trap(self.translateError(ZeroDivisionError))
self.assertEquals(self.factory.connections[0].executions, 2)
# Reconnection should work exactly as before.
self.assertEquals(self.factory.connections[0].closed, False)
# Application code has to roll back its transaction at this point,
# since it failed (and we don't necessarily know why it failed: not
# enough information).
self.resultOf(txn.abort())
self.factory.connections[0].executions = 0 # re-set for next test
self.assertEquals(len(self.factory.connections), 1)
self.test_reConnectWhenFirstExecFails()
def test_disconnectOnFailedRollback(self):
"""
When C{rollback} fails for any reason on a connection object, then we
don't know what state it's in. Most likely, it's already been
disconnected, so the connection should be closed and the transaction
de-pooled instead of recycled.
Also, a new connection will immediately be established to keep the pool
size the same.
"""
txn = self.createTransaction()
results = self.resultOf(txn.execSQL("maybe change something!"))
[[[_ignore_counter, echo]]] = results
self.assertEquals("maybe change something!", echo)
self.factory.rollbackFail = True
[x] = self.resultOf(txn.abort())
# Abort does not propagate the error on, the transaction merely gets
# disposed of.
self.assertIdentical(x, None)
self.assertEquals(len(self.pool._free), 1)
self.assertEquals(self.pool._finishing, [])
self.assertEquals(len(self.factory.connections), 2)
self.assertEquals(self.factory.connections[0].closed, True)
self.assertEquals(self.factory.connections[1].closed, False)
self.assertEquals(len(self.flushLoggedErrors(RollbackFail)), 1)
def test_exceptionPropagatesFailedCommit(self):
"""
A failed C{rollback} is fine (the premature death of the connection
without C{commit} means that the changes are surely gone), but a failed
C{commit} has to be relayed to client code, since that actually means
some changes didn't hit the database.
"""
txn = self.createTransaction()
self.factory.commitFail = True
results = self.resultOf(txn.execSQL("maybe change something!"))
[[[_ignore_counter, echo]]] = results
self.assertEquals("maybe change something!", echo)
[x] = self.resultOf(txn.commit())
x.trap(self.translateError(CommitFail))
self.assertEquals(len(self.pool._free), 1)
self.assertEquals(self.pool._finishing, [])
self.assertEquals(len(self.factory.connections), 2)
self.assertEquals(self.factory.connections[0].closed, True)
self.assertEquals(self.factory.connections[1].closed, False)
def test_commandBlock(self):
"""
L{IAsyncTransaction.commandBlock} returns an L{IAsyncTransaction}
provider which ensures that a block of commands are executed together.
"""
txn = self.createTransaction()
a = self.resultOf(txn.execSQL("a"))
cb = txn.commandBlock()
verifyObject(ICommandBlock, cb)
b = self.resultOf(cb.execSQL("b"))
d = self.resultOf(txn.execSQL("d"))
c = self.resultOf(cb.execSQL("c"))
cb.end()
e = self.resultOf(txn.execSQL("e"))
self.assertEquals(
self.factory.connections[0].cursors[0].allExecutions,
[("a", []), ("b", []), ("c", []), ("d", []), ("e", [])]
)
self.assertEquals(len(a), 1)
self.assertEquals(len(b), 1)
self.assertEquals(len(c), 1)
self.assertEquals(len(d), 1)
self.assertEquals(len(e), 1)
def test_commandBlockWithLatency(self):
"""
A block returned by L{IAsyncTransaction.commandBlock} won't start
executing until all SQL statements scheduled before it have completed.
"""
self.pauseHolders()
txn = self.createTransaction()
a = self.resultOf(txn.execSQL("a"))
b = self.resultOf(txn.execSQL("b"))
cb = txn.commandBlock()
c = self.resultOf(cb.execSQL("c"))
d = self.resultOf(cb.execSQL("d"))
e = self.resultOf(txn.execSQL("e"))
cb.end()
self.flushHolders()
self.assertEquals(
self.factory.connections[0].cursors[0].allExecutions,
[("a", []), ("b", []), ("c", []), ("d", []), ("e", [])]
)
self.assertEquals(len(a), 1)
self.assertEquals(len(b), 1)
self.assertEquals(len(c), 1)
self.assertEquals(len(d), 1)
self.assertEquals(len(e), 1)
def test_twoCommandBlocks(self, flush=lambda: None):
"""
When execution of one command block is complete, it will proceed to the
next queued block, then to regular SQL executed on the transaction.
"""
txn = self.createTransaction()
cb1 = txn.commandBlock()
cb2 = txn.commandBlock()
txn.execSQL("e")
cb1.execSQL("a")
cb2.execSQL("c")
cb1.execSQL("b")
cb2.execSQL("d")
cb2.end()
cb1.end()
flush()
self.flushHolders()
self.assertEquals(
self.factory.connections[0].cursors[0].allExecutions,
[("a", []), ("b", []), ("c", []), ("d", []), ("e", [])]
)
def test_twoCommandBlocksLatently(self):
"""
Same as L{test_twoCommandBlocks}, but with slower callbacks.
"""
self.pauseHolders()
self.test_twoCommandBlocks(self.flushHolders)
def test_commandBlockEndTwice(self):
"""
L{CommandBlock.end} will raise L{AlreadyFinishedError} when called more
than once.
"""
txn = self.createTransaction()
block = txn.commandBlock()
block.end()
self.assertRaises(AlreadyFinishedError, block.end)
def test_commandBlockDelaysCommit(self):
"""
Some command blocks need to run asynchronously, without the overall
transaction-managing code knowing how far they've progressed.
Therefore when you call {IAsyncTransaction.commit}(), it should not
actually take effect if there are any pending command blocks.
"""
txn = self.createTransaction()
block = txn.commandBlock()
commitResult = self.resultOf(txn.commit())
self.resultOf(block.execSQL("in block"))
self.assertEquals(commitResult, [])
self.assertEquals(
self.factory.connections[0].cursors[0].allExecutions,
[("in block", [])]
)
block.end()
self.flushHolders()
self.assertEquals(commitResult, [None])
def test_commandBlockDoesntDelayAbort(self):
"""
A L{CommandBlock} can't possibly have anything interesting to say about
a transaction that gets rolled back, so C{abort} applies immediately;
all outstanding C{execSQL}s will fail immediately, on both command
blocks and on the transaction itself.
"""
txn = self.createTransaction()
block = txn.commandBlock()
block2 = txn.commandBlock()
abortResult = self.resultOf(txn.abort())
self.assertEquals(abortResult, [None])
self.assertRaises(AlreadyFinishedError, block2.execSQL, "bar")
self.assertRaises(AlreadyFinishedError, block.execSQL, "foo")
self.assertRaises(AlreadyFinishedError, txn.execSQL, "baz")
self.assertEquals(
self.factory.connections[0].cursors[0].allExecutions, []
)
# end() should _not_ raise an exception, because this is the sort of
# thing that might be around a try/finally or try/except; it's just
# putting the commandBlock itself into a state consistent with the
# transaction.
block.end()
block2.end()
def test_endedBlockDoesntExecuteMoreSQL(self):
"""
Attempting to execute SQL on a L{CommandBlock} which has had C{end}
called on it will result in an L{AlreadyFinishedError}.
"""
txn = self.createTransaction()
block = txn.commandBlock()
block.end()
self.assertRaises(AlreadyFinishedError, block.execSQL, "hello")
self.assertEquals(
self.factory.connections[0].cursors[0].allExecutions, []
)
def test_commandBlockAfterCommitRaises(self):
"""
Once an L{IAsyncTransaction} has been committed, L{commandBlock} raises
an exception.
"""
txn = self.createTransaction()
txn.commit()
self.assertRaises(AlreadyFinishedError, txn.commandBlock)
def test_commandBlockAfterAbortRaises(self):
"""
Once an L{IAsyncTransaction} has been committed, L{commandBlock} raises
an exception.
"""
txn = self.createTransaction()
self.resultOf(txn.abort())
self.assertRaises(AlreadyFinishedError, txn.commandBlock)
def test_raiseOnZeroRowCount(self):
"""
L{IAsyncTransaction.execSQL} will return a L{Deferred} failing with the
exception passed as its raiseOnZeroRowCount argument if the underlying
query returns no rows.
"""
self.factory.hasResults = False
txn = self.createTransaction()
f = self.resultOf(
txn.execSQL("hello", raiseOnZeroRowCount=ZeroDivisionError)
)[0]
self.assertRaises(ZeroDivisionError, f.raiseException)
txn.commit()
def test_raiseOnZeroRowCountWithUnreliableRowCount(self):
"""
As it turns out, some databases can't reliably tell you how many rows
they're going to fetch via the C{rowcount} attribute before the rows
have actually been fetched, so the C{raiseOnZeroRowCount} will I{not}
raise an exception if C{rowcount} is zero but C{description} and
C{fetchall} indicates the presence of some rows.
"""
self.factory.hasResults = True
self.factory.shouldUpdateRowcount = False
txn = self.createTransaction()
r = self.resultOf(
txn.execSQL("some-rows", raiseOnZeroRowCount=RuntimeError)
)
[[[_ignore_counter, echo]]] = r
self.assertEquals(echo, "some-rows")
class IOPump(object):
"""
Connect a client and a server.
@ivar client: a client protocol
@ivar server: a server protocol
"""
def moveData(self, (outTransport, inProtocol)):
"""
Move data from a L{StringTransport} to an L{IProtocol}.
@return: C{True} if any data was moved, C{False} if no data was moved.
"""
data = outTransport.io.getvalue()
outTransport.io.seek(0)
outTransport.io.truncate()
if data:
inProtocol.dataReceived(data)
return True
else:
return False
def pump(self):
"""
Deliver all input from the client to the server, then from the server
to the client.
"""
a = self.moveData(self.c2s)
b = self.moveData(self.s2c)
return a or b
def flush(self, maxTurns=100):
"""
Continue pumping until no more data is flowing.
"""
turns = 0
while self.pump():
turns += 1
if turns > maxTurns:
raise RuntimeError("Ran too long!")
class NetworkedPoolHelper(ConnectionPoolHelper):
"""
An extension of L{ConnectionPoolHelper} that can set up a
L{ConnectionPoolClient} and L{ConnectionPoolConnection} attached to each
other.
"""
def setUp(self):
"""
Do the same setup from L{ConnectionPoolBase}, but also establish a
loopback connection between a L{ConnectionPoolConnection} and a
L{ConnectionPoolClient}.
"""
super(NetworkedPoolHelper, self).setUp()
self.pump = IOPump(
ConnectionPoolClient(
dbtype=self.dbtype,
),
ConnectionPoolConnection(self.pool)
)
def flushHolders(self):
"""
In addition to flushing the L{ThreadHolder} stubs, also flush any
pending network I/O.
"""
self.pump.flush()
super(NetworkedPoolHelper, self).flushHolders()
self.pump.flush()
def translateError(self, err):
"""
All errors raised locally will unfortunately be translated into
UnknownRemoteError, since AMP requires specific enumeration of all of
them. Flush the locally logged error of the given type and return
L{UnknownRemoteError}.
"""
if err in Commit.errors:
return err
self.flushLoggedErrors(err)
return FailsafeException
class NetworkedConnectionPoolTests(NetworkedPoolHelper, ConnectionPoolTests):
"""
Tests for L{ConnectionPoolConnection} and L{ConnectionPoolClient}
interacting with each other.
"""
def setParamstyle(self, paramstyle):
"""
Change the paramstyle on both the pool and the client.
"""
super(NetworkedConnectionPoolTests, self).setParamstyle(paramstyle)
self.pump.client.dbtype = self.pump.client.dbtype.copyreplace(paramstyle=paramstyle)
def setDialect(self, dialect):
"""
Change the dialect on both the pool and the client.
"""
super(NetworkedConnectionPoolTests, self).setDialect(dialect)
self.pump.client.dbtype = self.pump.client.dbtype.copyreplace(dialect=dialect)
def test_newTransaction(self):
"""
L{ConnectionPoolClient.newTransaction} returns a provider of
L{IAsyncTransaction}, and creates a new transaction on the server side.
"""
txn = self.pump.client.newTransaction()
verifyObject(IAsyncTransaction, txn)
self.pump.flush()
self.assertEquals(len(self.factory.connections), 1)
class HookableOperationTests(TestCase):
"""
Tests for L{_HookableOperation}.
"""
@inlineCallbacks
def test_clearPreventsSubsequentAddHook(self):
"""
After clear() or runHooks() are called, subsequent calls to addHook()
are NO-OPs.
"""
hookOp = _HookableOperation()
hookOp.addHook(hook)
self.assertEquals(len(hookOp._hooks), 1)
hookOp.clear()
self.assertEquals(hookOp._hooks, None)
hookOp = _HookableOperation()
hookOp.addHook(hook)
yield hookOp.runHooks()
self.assertEquals(hookOp._hooks, None)
hookOp.addHook(hook)
self.assertEquals(hookOp._hooks, None)
| [
2235,
198,
2,
15069,
357,
66,
8,
3050,
12,
5539,
4196,
3457,
13,
1439,
2489,
10395,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
7330,
257,
4866,
286,
262,
13789,
379,
198,
2,
198,
2,
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,
2235,
198,
198,
37811,
198,
51,
3558,
329,
406,
90,
83,
732,
742,
13,
9255,
7919,
13,
324,
65,
15042,
17,
27422,
198,
37811,
198,
198,
11748,
308,
66,
198,
198,
6738,
1976,
3008,
13,
39994,
13,
332,
1958,
1330,
11767,
10267,
198,
198,
6738,
19074,
13,
29412,
13,
32165,
495,
1330,
25743,
198,
198,
6738,
19074,
13,
45994,
13,
403,
715,
395,
1330,
6208,
20448,
198,
198,
6738,
19074,
13,
37675,
13,
4299,
263,
1330,
2896,
17436,
11,
2038,
11,
6758,
11,
26098,
14134,
10146,
198,
198,
6738,
19074,
13,
9288,
13,
1676,
1462,
62,
16794,
364,
1330,
10903,
8291,
634,
198,
198,
6738,
665,
2302,
13,
9255,
7919,
13,
1153,
263,
7919,
1330,
26923,
12331,
198,
6738,
665,
2302,
13,
9255,
7919,
13,
1153,
263,
7919,
1330,
27511,
18467,
1348,
12331,
198,
6738,
665,
2302,
13,
9255,
7919,
13,
324,
65,
15042,
17,
1330,
26923,
27201,
11792,
198,
6738,
665,
2302,
13,
9255,
7919,
13,
324,
65,
15042,
17,
1330,
26923,
27201,
32048,
198,
6738,
665,
2302,
13,
9255,
7919,
13,
1153,
263,
7919,
1330,
314,
42367,
48720,
198,
6738,
665,
2302,
13,
9255,
7919,
13,
1153,
263,
7919,
1330,
314,
21575,
12235,
198,
6738,
665,
2302,
13,
9255,
7919,
13,
324,
65,
15042,
17,
1330,
376,
1768,
8635,
16922,
198,
6738,
665,
2302,
13,
9255,
7919,
13,
324,
65,
15042,
17,
1330,
26923,
27201,
198,
6738,
665,
2302,
13,
9255,
7919,
13,
69,
25506,
1330,
26923,
27201,
47429,
198,
6738,
665,
2302,
13,
9255,
7919,
13,
69,
25506,
1330,
1255,
5189,
198,
6738,
665,
2302,
13,
9255,
7919,
13,
69,
25506,
1330,
21328,
3152,
16818,
82,
198,
6738,
665,
2302,
13,
9255,
7919,
13,
69,
25506,
1330,
33482,
32048,
12331,
198,
6738,
665,
2302,
13,
9255,
7919,
13,
69,
25506,
1330,
8299,
1891,
39044,
198,
6738,
665,
2302,
13,
9255,
7919,
13,
69,
25506,
1330,
35910,
39044,
198,
6738,
665,
2302,
13,
9255,
7919,
13,
324,
65,
15042,
17,
1330,
35910,
198,
6738,
665,
2302,
13,
9255,
7919,
13,
324,
65,
15042,
17,
1330,
4808,
39,
566,
540,
32180,
628,
198,
4871,
48161,
31337,
273,
7,
15252,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
6208,
31904,
329,
9904,
308,
66,
13,
4563,
13866,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
2198,
2898,
1077,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
48987,
326,
262,
1332,
468,
2087,
645,
3224,
15413,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
308,
66,
13,
33327,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
649,
27676,
13866,
796,
308,
66,
13,
4563,
13866,
58,
944,
13,
4563,
13866,
10434,
47715,
198,
220,
220,
220,
220,
220,
220,
220,
611,
649,
27676,
13866,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
2094,
470,
3424,
510,
5403,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
9688,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
9288,
20448,
13,
32165,
7203,
3791,
15413,
25,
366,
1343,
41575,
7,
3605,
27676,
13866,
4008,
628,
198,
4871,
2195,
861,
23004,
47429,
7,
15252,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
15561,
259,
329,
33183,
546,
18305,
516,
2896,
17436,
2482,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
6818,
23004,
8053,
7,
944,
11,
1255,
8053,
11,
2938,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2195,
861,
326,
257,
1351,
2727,
351,
406,
90,
20274,
5189,
92,
542,
15152,
262,
2938,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
13,
628,
220,
220,
220,
220,
220,
220,
220,
2488,
17143,
1255,
8053,
25,
383,
1441,
1988,
286,
406,
90,
20274,
5189,
27422,
198,
220,
220,
220,
220,
220,
220,
220,
2488,
4906,
1255,
8053,
25,
406,
90,
4868,
92,
628,
220,
220,
220,
220,
220,
220,
220,
2488,
17143,
2938,
25,
383,
2938,
1988,
326,
815,
307,
1944,
287,
262,
1351,
26,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
257,
406,
90,
50015,
92,
611,
281,
6631,
318,
2938,
284,
307,
4376,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
611,
407,
1255,
8053,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
32165,
7203,
2949,
1255,
26,
2896,
17436,
1422,
470,
2046,
1865,
19570,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
318,
39098,
7,
20274,
8053,
58,
15,
4357,
25743,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
318,
39098,
7,
40319,
11,
25743,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
8053,
58,
15,
4083,
46670,
7,
40319,
13,
4906,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
8053,
58,
15,
4083,
40225,
16922,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
36,
13255,
7,
20274,
8053,
11,
685,
40319,
12962,
628,
198,
4871,
26923,
27201,
36476,
51,
3558,
7,
14402,
20448,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
30307,
329,
262,
923,
12,
929,
7108,
286,
406,
90,
32048,
27201,
27422,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
1332,
62,
16663,
12332,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
383,
21905,
3917,
351,
257,
406,
90,
32048,
27201,
92,
481,
423,
663,
5415,
198,
220,
220,
220,
220,
220,
220,
220,
4704,
954,
12328,
618,
406,
90,
32048,
27201,
13,
9688,
16177,
92,
318,
1444,
11,
284,
198,
220,
220,
220,
220,
220,
220,
220,
697,
296,
375,
378,
329,
406,
90,
32048,
27201,
13,
9806,
13313,
507,
92,
3224,
14390,
13,
628,
220,
220,
220,
220,
220,
220,
220,
22025,
2105,
262,
2139,
815,
11169,
340,
284,
663,
2656,
1988,
11,
523,
326,
257,
198,
220,
220,
220,
220,
220,
220,
220,
7830,
302,
12,
46981,
406,
90,
32048,
27201,
92,
481,
407,
2728,
262,
4704,
198,
220,
220,
220,
220,
220,
220,
220,
13387,
284,
1663,
1231,
5421,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
4277,
11518,
796,
2681,
198,
220,
220,
220,
220,
220,
220,
220,
369,
5907,
11518,
796,
4153,
198,
220,
220,
220,
220,
220,
220,
220,
5929,
11518,
796,
4277,
11518,
1343,
369,
5907,
11518,
198,
220,
220,
220,
220,
220,
220,
220,
5933,
796,
26923,
27201,
7,
14202,
11,
3509,
13313,
507,
28,
1102,
5907,
11518,
8,
198,
220,
220,
220,
220,
220,
220,
220,
5933,
13,
260,
11218,
796,
21328,
3152,
16818,
82,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
4704,
7742,
796,
5933,
13,
260,
11218,
13,
1136,
16818,
27201,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
5933,
13,
260,
11218,
13,
47811,
16818,
27201,
10699,
7,
12286,
11518,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
16663,
7742,
13,
9806,
11,
4277,
11518,
8,
198,
220,
220,
220,
220,
220,
220,
220,
5933,
13,
9688,
16177,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
16663,
7742,
13,
9806,
11,
5929,
11518,
8,
198,
220,
220,
220,
220,
220,
220,
220,
655,
9787,
278,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
5933,
13,
11338,
16177,
22446,
2860,
47258,
7,
3137,
9787,
278,
13,
33295,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
1400,
16363,
1057,
11,
523,
645,
14390,
2067,
11,
523,
428,
28651,
815,
2046,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
3393,
13,
220,
1002,
407,
11,
356,
821,
287,
1263,
5876,
11,
523,
34182,
2198,
13,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
3137,
9787,
278,
11,
685,
14202,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
16663,
7742,
13,
9806,
11,
4277,
11518,
8,
628,
220,
220,
220,
825,
1332,
62,
271,
28768,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
406,
90,
32048,
27201,
13,
9688,
16177,
92,
815,
900,
663,
327,
90,
20270,
92,
11688,
284,
198,
220,
220,
220,
220,
220,
220,
220,
2081,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
5933,
796,
26923,
27201,
7,
14202,
8,
198,
220,
220,
220,
220,
220,
220,
220,
5933,
13,
260,
11218,
796,
21328,
3152,
16818,
82,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
7742,
13,
20270,
11,
10352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
5933,
13,
9688,
16177,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
7742,
13,
20270,
11,
6407,
8,
628,
198,
4871,
26923,
27201,
5376,
51,
3558,
7,
14402,
20448,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
30307,
329,
406,
90,
32048,
27201,
92,
6,
82,
327,
90,
3672,
92,
11688,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
1332,
62,
12286,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1002,
645,
1988,
318,
1813,
329,
262,
327,
90,
3672,
92,
11507,
284,
406,
90,
32048,
27201,
92,
6,
82,
198,
220,
220,
220,
220,
220,
220,
220,
4238,
7509,
788,
406,
90,
32048,
27201,
13,
3672,
92,
318,
327,
90,
14202,
27422,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
5933,
796,
26923,
27201,
7,
14202,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
3792,
7,
14202,
11,
5933,
13,
3672,
8,
628,
220,
220,
220,
825,
1332,
62,
23599,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1002,
257,
1988,
318,
1813,
329,
262,
327,
90,
3672,
92,
11507,
284,
406,
90,
32048,
27201,
92,
6,
82,
198,
220,
220,
220,
220,
220,
220,
220,
4238,
7509,
788,
340,
318,
973,
355,
262,
1988,
329,
406,
90,
32048,
27201,
13,
3672,
27422,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
796,
366,
11246,
1332,
5933,
1,
198,
220,
220,
220,
220,
220,
220,
220,
5933,
796,
26923,
27201,
7,
14202,
11,
1438,
28,
3672,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
36,
13255,
7,
3672,
11,
5933,
13,
3672,
8,
628,
198,
4871,
26923,
27201,
51,
3558,
7,
32048,
27201,
47429,
11,
6208,
20448,
11,
2195,
861,
23004,
47429,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
30307,
329,
406,
90,
32048,
27201,
27422,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
1332,
62,
18820,
7085,
13313,
507,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1649,
262,
1271,
286,
11660,
8179,
8945,
21695,
262,
1271,
286,
198,
220,
220,
220,
220,
220,
220,
220,
17314,
7368,
416,
406,
90,
32048,
27201,
13,
9806,
13313,
507,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
406,
90,
32048,
27201,
13,
38659,
92,
481,
1441,
257,
44762,
8611,
326,
318,
198,
220,
220,
220,
220,
220,
220,
220,
407,
9763,
416,
597,
1103,
6831,
4637,
26,
428,
2134,
481,
16834,
663,
198,
220,
220,
220,
220,
220,
220,
220,
16363,
6299,
1566,
281,
4683,
4637,
4329,
1695,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
257,
796,
2116,
13,
17953,
48720,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
17130,
23004,
796,
2116,
13,
20274,
5189,
7,
64,
13,
18558,
17861,
7203,
26591,
48774,
198,
220,
220,
220,
220,
220,
220,
220,
16410,
62,
46430,
62,
24588,
11,
4808,
46430,
62,
30328,
11907,
796,
17130,
23004,
58,
15,
60,
628,
220,
220,
220,
220,
220,
220,
220,
275,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
366,
65,
1,
815,
423,
4721,
257,
4637,
13,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
944,
13,
69,
9548,
13,
8443,
507,
828,
362,
8,
198,
220,
220,
220,
220,
220,
220,
220,
12159,
23004,
796,
2116,
13,
20274,
5189,
7,
65,
13,
18558,
17861,
7203,
31361,
48774,
198,
220,
220,
220,
220,
220,
220,
220,
16410,
15630,
6828,
11,
4808,
46430,
62,
1350,
6679,
11907,
796,
12159,
23004,
58,
15,
60,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
1111,
366,
64,
1,
290,
366,
65,
1,
389,
4769,
1280,
257,
4637,
783,
26,
1309,
338,
1949,
284,
1280,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
257,
2368,
530,
13,
220,
357,
464,
16216,
481,
307,
2206,
49228,
772,
611,
428,
10143,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
780,
883,
14390,
389,
1541,
8179,
2014,
198,
220,
220,
220,
220,
220,
220,
220,
269,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
34236,
23004,
796,
2116,
13,
20274,
5189,
7,
66,
13,
18558,
17861,
7203,
28483,
2611,
48774,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
7731,
366,
66,
1,
1280,
257,
4637,
30,
220,
3914,
338,
2911,
407,
986,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
944,
13,
69,
9548,
13,
8443,
507,
828,
362,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
16363,
6584,
470,
307,
10945,
1165,
2582,
986,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
28483,
2611,
23004,
11,
685,
12962,
628,
220,
220,
220,
220,
220,
220,
220,
4589,
23004,
796,
2116,
13,
20274,
5189,
7,
65,
13,
41509,
28955,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
2735,
326,
366,
65,
1,
468,
5364,
11,
366,
66,
1,
815,
307,
1498,
284,
1844,
13,
198,
220,
220,
220,
220,
220,
220,
220,
16410,
535,
6828,
11,
4808,
46430,
62,
344,
6679,
11907,
796,
34236,
23004,
58,
15,
60,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
383,
4637,
329,
366,
64,
1,
10783,
284,
991,
307,
8179,
11,
523,
1309,
338,
787,
1654,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
356,
821,
1262,
262,
530,
329,
366,
66,
1911,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
535,
6828,
11,
275,
24588,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
2986,
414,
2198,
25,
262,
4589,
815,
423,
14131,
0,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
41509,
23004,
11,
685,
14202,
12962,
628,
220,
220,
220,
825,
1332,
62,
11338,
16177,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
406,
90,
32048,
27201,
13,
11338,
16177,
92,
9911,
477,
262,
3917,
406,
90,
16818,
39,
19892,
92,
82,
198,
220,
220,
220,
220,
220,
220,
220,
290,
12839,
2030,
274,
510,
262,
4133,
340,
318,
4769,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
257,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
17130,
23004,
796,
2116,
13,
20274,
5189,
7,
64,
13,
18558,
17861,
7203,
26591,
48774,
198,
220,
220,
220,
220,
220,
220,
220,
16410,
29795,
46430,
62,
24588,
11,
4808,
46430,
62,
30328,
11907,
60,
796,
17130,
23004,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
944,
13,
69,
9548,
13,
8443,
507,
828,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
944,
13,
10476,
828,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
685,
13829,
60,
796,
2116,
13,
10476,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
13829,
13,
46981,
11,
6407,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
13829,
13,
301,
38333,
11,
10352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
7742,
13,
11338,
16177,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
944,
13,
7742,
13,
20270,
11,
10352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
944,
13,
10476,
828,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
13829,
13,
46981,
11,
6407,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
13829,
13,
301,
38333,
11,
6407,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
47055,
8390,
8787,
20694,
606,
422,
262,
1351,
13,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
944,
13,
69,
9548,
13,
8443,
507,
828,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
944,
13,
69,
9548,
13,
8443,
507,
58,
15,
4083,
20225,
11,
6407,
8,
628,
220,
220,
220,
825,
1332,
62,
1186,
563,
3260,
13313,
12331,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1649,
262,
327,
90,
38659,
22810,
92,
3804,
284,
406,
90,
32048,
27201,
92,
12073,
281,
198,
220,
220,
220,
220,
220,
220,
220,
6631,
11,
262,
406,
90,
32048,
27201,
92,
481,
2604,
262,
6631,
290,
5711,
198,
220,
220,
220,
220,
220,
220,
220,
9706,
286,
257,
649,
4637,
338,
16363,
5050,
1566,
281,
2230,
31137,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
69,
9548,
13,
10594,
39044,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
69,
9548,
13,
10594,
39044,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
69,
9548,
13,
10594,
13313,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
269,
796,
2116,
13,
17953,
48720,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
2198,
3198,
50015,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
288,
796,
269,
13,
18558,
17861,
7203,
26591,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
3022,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
288,
13,
2860,
10265,
7,
71,
1324,
2945,
13,
33295,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
71,
1324,
2945,
11,
685,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
15750,
13,
324,
19259,
7,
944,
13,
7742,
13,
2200,
40405,
62,
34694,
12425,
1343,
657,
13,
486,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2198,
3198,
50015,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
71,
1324,
2945,
11,
685,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
15750,
13,
324,
19259,
7,
944,
13,
7742,
13,
2200,
40405,
62,
34694,
12425,
1343,
657,
13,
486,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
25925,
26807,
364,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
71,
1324,
2945,
11,
16410,
58,
16,
11,
366,
26591,
8973,
11907,
8,
628,
220,
220,
220,
825,
1332,
62,
49625,
2902,
7191,
9781,
563,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1002,
257,
406,
90,
32048,
27201,
92,
318,
9361,
284,
4423,
866,
981,
340,
338,
287,
262,
198,
220,
220,
220,
220,
220,
220,
220,
1429,
286,
302,
12,
83,
14992,
257,
4637,
2230,
326,
2722,
281,
4049,
11,
262,
198,
220,
220,
220,
220,
220,
220,
220,
4637,
2230,
815,
307,
16769,
290,
262,
18325,
815,
1844,
198,
220,
220,
220,
220,
220,
220,
220,
355,
3487,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
69,
9548,
13,
12286,
39044,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
8563,
796,
2116,
13,
25925,
11187,
2004,
9139,
5965,
7,
49233,
32048,
12331,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
48277,
828,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2245,
67,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
7742,
13,
11338,
16177,
22446,
2860,
10265,
7,
11338,
67,
13,
33295,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23004,
8053,
7,
11338,
67,
11,
6045,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
944,
13,
15750,
13,
66,
5691,
11,
685,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
685,
13829,
60,
796,
2116,
13,
10476,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
13829,
13,
46981,
11,
6407,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
13829,
13,
301,
38333,
11,
6407,
8,
628,
220,
220,
220,
825,
1332,
62,
49625,
2902,
7191,
37177,
33244,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1002,
406,
90,
32048,
27201,
13,
11338,
16177,
92,
318,
1444,
981,
257,
4637,
2230,
198,
220,
220,
220,
220,
220,
220,
220,
318,
11660,
11,
262,
7186,
406,
90,
7469,
17436,
92,
1839,
470,
307,
6294,
1566,
262,
198,
220,
220,
220,
220,
220,
220,
220,
4637,
2230,
468,
5201,
26,
287,
428,
1339,
11,
14131,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
32125,
26807,
364,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2245,
67,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
7742,
13,
11338,
16177,
22446,
2860,
10265,
7,
11338,
67,
13,
33295,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11338,
67,
11,
685,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
25925,
26807,
364,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23004,
8053,
7,
11338,
67,
11,
6045,
8,
198,
220,
220,
220,
220,
220,
220,
220,
685,
13829,
60,
796,
2116,
13,
10476,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
13829,
13,
46981,
11,
6407,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
13829,
13,
301,
38333,
11,
6407,
8,
628,
220,
220,
220,
825,
1332,
62,
49625,
2902,
7191,
37177,
37,
6255,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1002,
406,
90,
32048,
27201,
13,
11338,
16177,
92,
318,
1444,
981,
257,
4637,
2230,
198,
220,
220,
220,
220,
220,
220,
220,
318,
11660,
11,
262,
7186,
406,
90,
7469,
17436,
92,
1839,
470,
307,
6294,
1566,
262,
198,
220,
220,
220,
220,
220,
220,
220,
4637,
2230,
468,
5201,
26,
287,
428,
1339,
11,
4054,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
69,
9548,
13,
12286,
39044,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
32125,
26807,
364,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2245,
67,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
7742,
13,
11338,
16177,
22446,
2860,
10265,
7,
11338,
67,
13,
33295,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11338,
67,
11,
685,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
25925,
26807,
364,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
8563,
796,
2116,
13,
25925,
11187,
2004,
9139,
5965,
7,
49233,
32048,
12331,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
48277,
828,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23004,
8053,
7,
11338,
67,
11,
6045,
8,
198,
220,
220,
220,
220,
220,
220,
220,
685,
13829,
60,
796,
2116,
13,
10476,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
13829,
13,
46981,
11,
6407,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
13829,
13,
301,
38333,
11,
6407,
8,
628,
220,
220,
220,
825,
1332,
62,
11338,
16177,
47,
325,
12003,
46047,
77,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1649,
406,
90,
32048,
27201,
13,
11338,
16177,
92,
318,
1444,
351,
257,
13310,
198,
220,
220,
220,
220,
220,
220,
220,
406,
90,
62,
13313,
278,
47,
325,
12003,
46047,
77,
92,
4075,
11,
262,
20137,
4637,
852,
2727,
198,
220,
220,
220,
220,
220,
220,
220,
318,
4838,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
32125,
26807,
364,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2245,
23004,
796,
2116,
13,
20274,
5189,
7,
944,
13,
7742,
13,
11338,
16177,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11338,
23004,
11,
685,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
25925,
26807,
364,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
685,
13829,
60,
796,
2116,
13,
10476,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
13829,
13,
46981,
11,
6407,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
13829,
13,
301,
38333,
11,
6407,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
944,
13,
69,
9548,
13,
8443,
507,
828,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
944,
13,
69,
9548,
13,
8443,
507,
58,
15,
4083,
20225,
11,
6407,
8,
628,
220,
220,
220,
825,
1332,
62,
11338,
16177,
22622,
4826,
419,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1649,
406,
90,
32048,
27201,
13,
11338,
16177,
92,
318,
1444,
351,
28651,
82,
422,
198,
220,
220,
220,
220,
220,
220,
220,
327,
90,
397,
419,
92,
991,
11660,
11,
340,
481,
4043,
329,
262,
3058,
12,
397,
24707,
198,
220,
220,
220,
220,
220,
220,
220,
8611,
284,
3938,
15614,
878,
9645,
262,
406,
90,
7469,
17436,
92,
4504,
422,
198,
220,
220,
220,
220,
220,
220,
220,
327,
90,
11338,
16177,
27422,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
16926,
46,
25,
4589,
3419,
1165,
30,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
32125,
26807,
364,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
269,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
15614,
23004,
796,
2116,
13,
20274,
5189,
7,
66,
13,
397,
419,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
10358,
15614,
11101,
11,
355,
340,
5818,
470,
5257,
284,
555,
2777,
970,
1997,
1865,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
44855,
11682,
25,
1494,
477,
2896,
17436,
82,
3917,
351,
428,
1517,
11,
787,
1654,
326,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
597,
11660,
12405,
23838,
14659,
651,
299,
48809,
13,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
397,
419,
23004,
11,
685,
14202,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
2245,
23004,
796,
2116,
13,
20274,
5189,
7,
944,
13,
7742,
13,
11338,
16177,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11338,
23004,
11,
685,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
25925,
26807,
364,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
2116,
13,
30493,
23588,
874,
7,
397,
419,
23004,
11,
685,
14202,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23004,
8053,
7,
11338,
23004,
11,
6045,
8,
628,
220,
220,
220,
825,
1332,
62,
11338,
16177,
3152,
4561,
970,
276,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1649,
406,
90,
32048,
27201,
13,
11338,
16177,
92,
318,
1444,
618,
599,
970,
276,
8945,
198,
220,
220,
220,
220,
220,
220,
220,
389,
11660,
11,
597,
13310,
406,
90,
7469,
17436,
82,
92,
4504,
416,
883,
198,
220,
220,
220,
220,
220,
220,
220,
8945,
481,
307,
4054,
351,
406,
90,
32048,
12331,
27422,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
5765,
510,
262,
1479,
17314,
523,
356,
423,
284,
599,
970,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1745,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
1745,
13,
33295,
7,
944,
13,
17953,
48720,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
1745,
13,
33295,
7,
944,
13,
17953,
48720,
28955,
628,
220,
220,
220,
220,
220,
220,
220,
269,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
384,
796,
2116,
13,
20274,
5189,
7,
66,
13,
18558,
17861,
7203,
26591,
48774,
198,
220,
220,
220,
220,
220,
220,
220,
2906,
796,
2116,
13,
20274,
5189,
7,
66,
13,
41509,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
325,
11,
685,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
344,
11,
685,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
20274,
5189,
7,
944,
13,
7742,
13,
11338,
16177,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
325,
58,
15,
4083,
4906,
11,
2116,
13,
7645,
17660,
12331,
7,
32048,
12331,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
344,
58,
15,
4083,
4906,
11,
2116,
13,
7645,
17660,
12331,
7,
32048,
12331,
4008,
628,
220,
220,
220,
825,
1332,
62,
260,
7742,
4561,
970,
276,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
3310,
2234,
1332,
329,
257,
6454,
17198,
12,
1462,
12,
20676,
391,
5434,
25,
618,
257,
599,
970,
276,
198,
220,
220,
220,
220,
220,
220,
220,
8611,
543,
468,
1541,
550,
4589,
3419,
1444,
319,
340,
878,
340,
338,
198,
220,
220,
220,
220,
220,
220,
220,
2722,
257,
1103,
4637,
284,
923,
23710,
319,
11,
340,
481,
407,
2666,
198,
220,
220,
220,
220,
220,
220,
220,
2157,
597,
1062,
799,
385,
326,
15174,
2245,
16177,
422,
1762,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
32125,
26807,
364,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
269,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
269,
17,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
269,
18,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
269,
13,
41509,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
269,
17,
13,
41509,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
269,
18,
13,
41509,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
25925,
26807,
364,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
944,
13,
69,
9548,
13,
8443,
507,
828,
362,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2245,
23004,
796,
2116,
13,
20274,
5189,
7,
944,
13,
7742,
13,
11338,
16177,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11338,
23004,
11,
685,
14202,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
944,
13,
69,
9548,
13,
8443,
507,
828,
362,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
944,
13,
69,
9548,
13,
8443,
507,
58,
15,
4083,
20225,
11,
6407,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
944,
13,
69,
9548,
13,
8443,
507,
58,
16,
4083,
20225,
11,
6407,
8,
628,
220,
220,
220,
825,
1332,
62,
8443,
3260,
19485,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
27592,
284,
4637,
3419,
706,
2245,
16177,
3419,
1255,
287,
8945,
543,
198,
220,
220,
220,
220,
220,
220,
220,
3393,
2038,
477,
4560,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2245,
25468,
796,
2116,
13,
20274,
5189,
7,
944,
13,
7742,
13,
11338,
16177,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11338,
25468,
11,
685,
14202,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
32125,
26807,
364,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
1281,
26125,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
12405,
23004,
796,
2116,
13,
20274,
5189,
7,
7353,
26125,
13,
18558,
17861,
7203,
31373,
48774,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
22766,
23004,
828,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
22766,
23004,
58,
15,
4083,
4906,
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,
2116,
13,
7645,
17660,
12331,
7,
32048,
12331,
4008,
628,
220,
220,
220,
825,
1332,
62,
8443,
3260,
10434,
276,
1273,
33307,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
27592,
284,
4637,
3419,
706,
2245,
16177,
3419,
468,
587,
1444,
475,
878,
340,
198,
220,
220,
220,
220,
220,
220,
220,
468,
5668,
481,
1255,
287,
8945,
543,
3393,
2038,
477,
198,
220,
220,
220,
220,
220,
220,
220,
4560,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
32125,
26807,
364,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
662,
26125,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
662,
26125,
23004,
796,
2116,
13,
20274,
5189,
7,
3866,
26125,
13,
18558,
17861,
7203,
26090,
48774,
198,
220,
220,
220,
220,
220,
220,
220,
2245,
23004,
796,
2116,
13,
20274,
5189,
7,
944,
13,
7742,
13,
11338,
16177,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
1281,
26125,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
12405,
23004,
796,
2116,
13,
20274,
5189,
7,
7353,
26125,
13,
18558,
17861,
7203,
31373,
48774,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11338,
23004,
11,
685,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
22766,
23004,
828,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12405,
23004,
58,
15,
4083,
4906,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
7645,
17660,
12331,
7,
32048,
12331,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
3866,
26125,
23004,
828,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
662,
26125,
23004,
58,
15,
4083,
4906,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
7645,
17660,
12331,
7,
32048,
12331,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
825,
1332,
62,
397,
419,
37,
1768,
7191,
19485,
16177,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
406,
90,
40,
42367,
48720,
13,
397,
419,
92,
1244,
2038,
11,
749,
1884,
780,
262,
198,
220,
220,
220,
220,
220,
220,
220,
10238,
6831,
4637,
468,
1541,
587,
28597,
13,
220,
1002,
428,
198,
220,
220,
220,
220,
220,
220,
220,
4325,
11,
18325,
815,
2555,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
27765,
5907,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
27765,
5907,
13,
33295,
7,
944,
13,
17953,
48720,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
27765,
5907,
13,
33295,
7,
944,
13,
17953,
48720,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
329,
27765,
77,
287,
27765,
5907,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
6889,
1654,
4836,
1891,
481,
1682,
307,
10945,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2482,
796,
2116,
13,
20274,
5189,
7,
17602,
77,
13,
18558,
17861,
7203,
25991,
1487,
1223,
2474,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16410,
29795,
46430,
62,
24588,
11,
9809,
11907,
60,
796,
2482,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7203,
25991,
1487,
1223,
40754,
9809,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
18448,
530,
357,
392,
691,
530,
8,
869,
284,
4836,
1891,
22446,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
69,
9548,
13,
2487,
1891,
39044,
796,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
2245,
23004,
796,
2116,
13,
20274,
5189,
7,
944,
13,
7742,
13,
11338,
16177,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11338,
23004,
11,
685,
14202,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
944,
13,
25925,
11187,
2004,
9139,
5965,
7,
26869,
1891,
39044,
36911,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
944,
13,
69,
9548,
13,
8443,
507,
58,
15,
4083,
20225,
11,
6407,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
944,
13,
69,
9548,
13,
8443,
507,
58,
16,
4083,
20225,
11,
6407,
8,
628,
220,
220,
220,
825,
1332,
62,
47172,
46047,
77,
37,
1768,
7191,
19485,
16177,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
8554,
262,
9156,
287,
406,
90,
32048,
27201,
13,
11338,
16177,
5512,
787,
1654,
326,
281,
198,
220,
220,
220,
220,
220,
220,
220,
406,
90,
62,
13313,
276,
46047,
77,
92,
2314,
2555,
284,
1429,
16363,
706,
406,
90,
62,
13313,
276,
46047,
77,
13,
397,
419,
92,
198,
220,
220,
220,
220,
220,
220,
220,
318,
1444,
290,
878,
406,
90,
62,
13313,
276,
46047,
77,
13,
42503,
92,
318,
1444,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
27765,
77,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
611,
468,
35226,
7,
17602,
77,
11,
45434,
8692,
46047,
77,
1,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
16290,
4238,
2643,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27765,
77,
13,
18558,
17861,
7203,
25991,
1487,
1223,
2474,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
6889,
340,
804,
588,
262,
2139,
318,
12225,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27765,
77,
13557,
8692,
46047,
77,
13557,
38659,
13,
19836,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27765,
77,
13557,
8692,
46047,
77,
13,
23705,
378,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
9993,
284,
3758,
517,
16363,
532,
1276,
2038,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
32165,
28042,
21762,
2696,
7,
41006,
12331,
11,
27765,
77,
13,
18558,
17861,
11,
366,
25991,
1487,
1223,
2073,
2474,
8,
628,
220,
220,
220,
825,
1332,
62,
397,
419,
6690,
88,
20095,
48720,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
406,
90,
32048,
27201,
13,
11338,
16177,
92,
481,
4423,
866,
611,
257,
32099,
8611,
198,
220,
220,
220,
220,
220,
220,
220,
318,
991,
13310,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
32099,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
20274,
5189,
7,
260,
15539,
276,
13,
41509,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
3505,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
3505,
13,
33295,
7,
944,
13,
17953,
48720,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
944,
13,
20274,
5189,
7,
944,
13,
7742,
13,
11338,
16177,
3419,
828,
685,
14202,
12962,
628,
220,
220,
220,
825,
1332,
62,
397,
419,
4561,
970,
276,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2275,
24707,
257,
991,
12,
2777,
970,
276,
8611,
357,
505,
543,
468,
645,
6299,
852,
198,
220,
220,
220,
220,
220,
220,
220,
10945,
8,
481,
1255,
287,
477,
286,
663,
2896,
17436,
82,
3393,
9894,
290,
198,
220,
220,
220,
220,
220,
220,
220,
4844,
286,
262,
8358,
1739,
6299,
852,
10945,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
4075,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
5765,
510,
262,
1695,
8787,
2644,
198,
220,
220,
220,
220,
220,
220,
220,
329,
4808,
46430,
287,
2124,
9521,
7,
944,
13,
7742,
13,
9806,
13313,
507,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4075,
13,
33295,
7,
944,
13,
17953,
48720,
28955,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
2644,
523,
326,
428,
530,
468,
284,
307,
599,
970,
276,
13,
198,
220,
220,
220,
220,
220,
220,
220,
599,
970,
276,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
2116,
13,
20274,
5189,
7,
2777,
970,
276,
13,
18558,
17861,
7203,
26591,
48774,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
34182,
2198,
11,
340,
561,
307,
2089,
611,
428,
1682,
10945,
13,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
36,
13255,
7,
20274,
11,
685,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
20274,
5189,
7,
2777,
970,
276,
13,
397,
419,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
36,
13255,
7,
20274,
58,
15,
4083,
4906,
11,
2116,
13,
7645,
17660,
12331,
7,
32048,
12331,
4008,
628,
220,
220,
220,
825,
1332,
62,
17077,
1890,
37447,
4826,
9741,
48720,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
406,
90,
32048,
27201,
13,
11338,
16177,
92,
481,
4043,
329,
477,
8945,
284,
4423,
198,
220,
220,
220,
220,
220,
220,
220,
866,
878,
33895,
11,
1390,
883,
543,
423,
1541,
587,
5025,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
340,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
32125,
26807,
364,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
15614,
23004,
796,
2116,
13,
20274,
5189,
7,
270,
13,
397,
419,
28955,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
8711,
340,
422,
262,
16834,
523,
356,
460,
466,
340,
503,
286,
1502,
198,
220,
220,
220,
220,
220,
220,
220,
288,
11,
4808,
46430,
62,
1818,
796,
2116,
13,
10476,
58,
15,
4083,
62,
80,
13,
1136,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
326,
815,
307,
262,
691,
670,
4326,
523,
836,
470,
2555,
611,
1223,
2073,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
1392,
287,
612,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
4868,
7,
944,
13,
10476,
58,
15,
4083,
62,
80,
13,
36560,
828,
685,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
944,
13,
10476,
828,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
25925,
26807,
364,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2245,
23004,
796,
2116,
13,
20274,
5189,
7,
944,
13,
7742,
13,
11338,
16177,
28955,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
2986,
414,
2198,
326,
356,
4398,
470,
1682,
5025,
340,
1865,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
397,
419,
23004,
11,
685,
12962,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
775,
4398,
470,
6294,
340,
1865,
11,
523,
262,
2139,
550,
1365,
407,
423,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
5025,
986,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11338,
23004,
11,
685,
12962,
628,
220,
220,
220,
220,
220,
220,
220,
288,
13,
47423,
7,
14202,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
25925,
26807,
364,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
397,
419,
23004,
11,
685,
14202,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11338,
23004,
11,
685,
14202,
12962,
628,
220,
220,
220,
825,
1332,
62,
4563,
13866,
5216,
12609,
48720,
4826,
2096,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1649,
281,
406,
90,
40,
42367,
48720,
92,
318,
15413,
7723,
11,
340,
10783,
284,
15614,
198,
220,
220,
220,
220,
220,
220,
220,
2346,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
256,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
20274,
5189,
7,
83,
13,
18558,
17861,
7203,
30328,
1600,
17635,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
369,
5907,
796,
2116,
13,
69,
9548,
13,
8443,
507,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
1102,
5907,
828,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
1102,
5907,
58,
15,
4083,
62,
2487,
1891,
12332,
11,
657,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1619,
256,
198,
220,
220,
220,
220,
220,
220,
220,
308,
66,
13,
33327,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
25925,
26807,
364,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
1102,
5907,
828,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
1102,
5907,
58,
15,
4083,
62,
2487,
1891,
12332,
11,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
1102,
5907,
58,
15,
4083,
62,
41509,
12332,
11,
657,
8,
628,
220,
220,
220,
825,
18620,
26687,
14402,
7,
944,
11,
5461,
11,
8011,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
9745,
278,
257,
5668,
357,
785,
3291,
393,
46847,
8,
406,
90,
40,
42367,
48720,
92,
198,
220,
220,
220,
220,
220,
220,
220,
815,
407,
13044,
597,
18620,
10288,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
37096,
796,
48161,
31337,
273,
7,
944,
8,
198,
220,
220,
220,
220,
220,
220,
220,
4589,
23002,
7241,
796,
17635,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
32165,
1532,
7,
41509,
23002,
7241,
11,
366,
6935,
270,
8011,
10945,
19570,
198,
220,
220,
220,
220,
220,
220,
220,
7773,
5124,
1886,
43642,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
37096,
13,
9122,
2898,
1077,
3419,
628,
220,
220,
220,
825,
1332,
62,
3919,
27676,
13866,
2202,
6935,
270,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1520,
2535,
257,
8611,
857,
407,
2728,
308,
66,
15413,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
21170,
934,
26687,
14402,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37456,
27765,
77,
25,
27765,
77,
13,
41509,
22784,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37456,
27765,
77,
11,
8011,
25,
27765,
77,
13,
3866,
6935,
270,
7,
25480,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
825,
1332,
62,
3919,
27676,
13866,
2202,
6935,
270,
3152,
4826,
419,
39,
566,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1520,
2535,
257,
8611,
857,
407,
2728,
308,
66,
15413,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
21170,
934,
26687,
14402,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37456,
27765,
77,
25,
27765,
77,
13,
41509,
22784,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37456,
27765,
77,
11,
8011,
25,
27765,
77,
13,
7353,
4826,
419,
7,
25480,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
825,
1332,
62,
3919,
27676,
13866,
2202,
4826,
419,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2275,
24707,
257,
8611,
857,
407,
2728,
308,
66,
15413,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
21170,
934,
26687,
14402,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37456,
27765,
77,
25,
27765,
77,
13,
397,
419,
22784,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37456,
27765,
77,
11,
8011,
25,
27765,
77,
13,
3866,
6935,
270,
7,
25480,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
825,
1332,
62,
3919,
27676,
13866,
2202,
4826,
419,
3152,
6307,
6935,
270,
39,
566,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2275,
24707,
257,
8611,
857,
407,
2728,
308,
66,
15413,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
21170,
934,
26687,
14402,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37456,
27765,
77,
25,
27765,
77,
13,
397,
419,
22784,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37456,
27765,
77,
11,
8011,
25,
27765,
77,
13,
7353,
6935,
270,
7,
25480,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
825,
1332,
62,
18820,
7085,
13313,
507,
3633,
25599,
48658,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
406,
90,
32048,
27201,
13,
38659,
92,
481,
407,
10922,
517,
621,
262,
5415,
198,
220,
220,
220,
220,
220,
220,
220,
8787,
611,
612,
389,
12848,
8945,
11660,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
257,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
275,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
32125,
26807,
364,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
257,
13,
397,
419,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
275,
13,
397,
419,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
17220,
262,
16392,
329,
262,
4683,
8787,
11,
523,
326,
262,
366,
26086,
1,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
4637,
3419,
869,
7864,
262,
3234,
290,
3011,
10945,
717,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1468,
10476,
796,
1351,
7,
944,
13,
10476,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
10476,
58,
47715,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
25925,
26807,
364,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
944,
13,
69,
9548,
13,
8443,
507,
828,
362,
8,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
10476,
796,
1468,
10476,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
25925,
26807,
364,
3419,
628,
220,
220,
220,
825,
900,
22973,
7635,
7,
944,
11,
5772,
7635,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
9794,
262,
5772,
7635,
286,
262,
8611,
739,
1332,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
7742,
13,
9945,
4906,
796,
2116,
13,
7742,
13,
9945,
4906,
13,
30073,
33491,
7,
17143,
7635,
28,
17143,
7635,
8,
628,
220,
220,
220,
825,
1332,
62,
22930,
37861,
22973,
7635,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
5501,
1180,
2099,
286,
406,
90,
1797,
48,
2538,
87,
721,
38409,
92,
823,
592,
262,
327,
90,
17143,
7635,
92,
198,
220,
220,
220,
220,
220,
220,
220,
11688,
422,
262,
406,
90,
32048,
27201,
27422,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
43001,
62,
27082,
2390,
2257,
56,
2538,
796,
366,
3137,
33407,
1,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
2617,
22973,
7635,
7,
51,
6465,
62,
27082,
2390,
2257,
56,
2538,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2593,
2501,
87,
77,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
27237,
2501,
87,
77,
13,
9945,
4906,
13,
17143,
7635,
11,
43001,
62,
27082,
2390,
2257,
56,
2538,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
27237,
2501,
87,
77,
13,
21812,
12235,
22446,
9945,
4906,
13,
17143,
7635,
11,
43001,
62,
27082,
2390,
2257,
56,
2538,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
32125,
26807,
364,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
3131,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
3131,
13,
33295,
7,
944,
13,
17953,
48720,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
4953,
17602,
77,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
10247,
1780,
17602,
77,
13,
9945,
4906,
13,
17143,
7635,
11,
43001,
62,
27082,
2390,
2257,
56,
2538,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
25925,
26807,
364,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
7742,
13,
11338,
16177,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
407,
87,
77,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
1662,
87,
77,
13,
9945,
4906,
13,
17143,
7635,
11,
43001,
62,
27082,
2390,
2257,
56,
2538,
8,
628,
220,
220,
220,
825,
900,
24400,
478,
7,
944,
11,
23637,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
9794,
262,
23637,
286,
262,
8611,
739,
1332,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
7742,
13,
9945,
4906,
796,
2116,
13,
7742,
13,
9945,
4906,
13,
30073,
33491,
7,
38969,
478,
28,
38969,
478,
8,
628,
220,
220,
220,
825,
1332,
62,
22930,
37861,
24400,
478,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
5501,
1180,
2099,
286,
406,
90,
1797,
48,
2538,
87,
721,
38409,
92,
823,
592,
262,
327,
90,
38969,
478,
92,
198,
220,
220,
220,
220,
220,
220,
220,
11688,
422,
262,
406,
90,
32048,
27201,
27422,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
43001,
62,
35,
12576,
9782,
796,
366,
847,
38969,
478,
1,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
2617,
24400,
478,
7,
51,
6465,
62,
35,
12576,
9782,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2593,
2501,
87,
77,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
27237,
2501,
87,
77,
13,
9945,
4906,
13,
38969,
478,
11,
43001,
62,
35,
12576,
9782,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
27237,
2501,
87,
77,
13,
21812,
12235,
22446,
9945,
4906,
13,
38969,
478,
11,
43001,
62,
35,
12576,
9782,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
32125,
26807,
364,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
3131,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
3131,
13,
33295,
7,
944,
13,
17953,
48720,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
4953,
17602,
77,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
10247,
1780,
17602,
77,
13,
9945,
4906,
13,
38969,
478,
11,
43001,
62,
35,
12576,
9782,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
25925,
26807,
364,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
7742,
13,
11338,
16177,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
407,
87,
77,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
1662,
87,
77,
13,
9945,
4906,
13,
38969,
478,
11,
43001,
62,
35,
12576,
9782,
8,
628,
220,
220,
220,
825,
1332,
62,
260,
13313,
2215,
5962,
23002,
37,
1768,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
23904,
5486,
11,
20137,
12,
17614,
362,
13,
15,
46363,
466,
407,
2148,
1321,
198,
220,
220,
220,
220,
220,
220,
220,
546,
262,
2728,
286,
257,
4054,
327,
90,
41049,
92,
2446,
26,
484,
4753,
836,
470,
198,
220,
220,
220,
220,
220,
220,
220,
2148,
340,
287,
257,
835,
543,
460,
307,
5174,
355,
3519,
284,
262,
15582,
286,
198,
220,
220,
220,
220,
220,
220,
220,
262,
12405,
11,
262,
1181,
286,
262,
6831,
2346,
11,
262,
1181,
286,
262,
198,
220,
220,
220,
220,
220,
220,
220,
4637,
11,
3503,
13,
628,
220,
220,
220,
220,
220,
220,
220,
8447,
262,
1266,
2276,
339,
27915,
329,
1771,
262,
4637,
284,
262,
198,
220,
220,
220,
220,
220,
220,
220,
6831,
468,
587,
2626,
290,
2476,
284,
307,
302,
12,
27718,
318,
284,
4929,
198,
220,
220,
220,
220,
220,
220,
220,
13269,
543,
389,
4376,
416,
262,
314,
90,
11085,
92,
2643,
10945,
287,
257,
198,
220,
220,
220,
220,
220,
220,
220,
8611,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
22507,
327,
90,
8443,
92,
284,
6758,
13,
220,
770,
815,
17438,
6209,
262,
976,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
1771,
2018,
3419,
3022,
284,
6758,
287,
617,
2180,
8611,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
290,
340,
338,
25914,
262,
10238,
8611,
11,
393,
2018,
3419,
655,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
14131,
13,
220,
15467,
835,
345,
655,
423,
257,
4808,
28008,
46047,
77,
27074,
257,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
4808,
13313,
276,
46047,
77,
13,
198,
220,
220,
220,
220,
220,
220,
220,
27765,
77,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
944,
13,
69,
9548,
13,
8443,
507,
828,
352,
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,
366,
15017,
414,
2198,
4054,
19570,
628,
220,
220,
220,
220,
220,
220,
220,
1398,
8562,
23002,
1133,
37,
6255,
7,
16922,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8562,
366,
41049,
12,
47904,
1,
6631,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
69,
9548,
13,
8443,
507,
58,
15,
4083,
41049,
8743,
39044,
7,
15022,
23002,
1133,
37,
6255,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2482,
796,
2116,
13,
20274,
5189,
7,
17602,
77,
13,
18558,
17861,
7203,
31373,
11,
995,
2474,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
16410,
29795,
46430,
62,
24588,
11,
9809,
11907,
60,
796,
2482,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7203,
31373,
11,
995,
40754,
9809,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
4930,
9706,
6370,
815,
423,
587,
925,
11,
530,
319,
1123,
4637,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
383,
717,
4054,
351,
257,
43160,
12331,
11,
475,
326,
318,
14593,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
40157,
11,
780,
788,
356,
3088,
757,
290,
340,
14131,
13,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
18896,
7,
944,
13,
69,
9548,
13,
8443,
507,
828,
362,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
2949,
649,
4637,
4721,
526,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
944,
13,
69,
9548,
13,
8443,
507,
58,
15,
4083,
18558,
3508,
11,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
944,
13,
69,
9548,
13,
8443,
507,
58,
16,
4083,
18558,
3508,
11,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
944,
13,
69,
9548,
13,
8443,
507,
58,
15,
4083,
20225,
11,
6407,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
944,
13,
69,
9548,
13,
8443,
507,
58,
16,
4083,
20225,
11,
10352,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
15933,
11,
1201,
612,
318,
3058,
645,
17923,
286,
366,
21230,
1,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
8563,
11,
356,
815,
2192,
2604,
777,
6218,
618,
484,
3051,
13,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
944,
13,
25925,
11187,
2004,
9139,
5965,
7,
15022,
23002,
1133,
37,
6255,
36911,
352,
8,
628,
220,
220,
220,
825,
1332,
62,
260,
13313,
2215,
5962,
23002,
2202,
3109,
9665,
32048,
37,
1768,
7,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
11,
517,
50015,
40786,
28,
50033,
8860,
25,
6045,
198,
220,
220,
220,
15179,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
6023,
3074,
326,
1244,
15058,
318,
326,
257,
4637,
481,
307,
198,
220,
220,
220,
220,
220,
220,
220,
7675,
5884,
11,
10945,
290,
32099,
656,
262,
4637,
5933,
26,
198,
220,
220,
220,
220,
220,
220,
220,
788,
11,
262,
6831,
4382,
481,
4423,
866,
290,
262,
8787,
481,
4656,
11,
198,
220,
220,
220,
220,
220,
220,
220,
475,
356,
481,
307,
4844,
262,
47897,
1566,
356,
1949,
284,
779,
606,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
27765,
77,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
517,
50015,
40786,
7,
944,
13,
69,
9548,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
18896,
7,
944,
13,
69,
9548,
13,
8443,
507,
828,
352,
11,
366,
15017,
414,
2198,
4054,
526,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
2482,
796,
2116,
13,
20274,
5189,
7,
17602,
77,
13,
18558,
17861,
7203,
31373,
11,
995,
2474,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
27765,
77,
13,
41509,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
16410,
29795,
46430,
62,
24588,
11,
9809,
11907,
60,
796,
2482,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7203,
31373,
11,
995,
40754,
9809,
8,
198,
220,
220,
220,
220,
220,
220,
220,
27765,
77,
17,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
18896,
7,
944,
13,
69,
9548,
13,
8443,
507,
828,
352,
11,
366,
15017,
414,
2198,
4054,
526,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
220,
220,
220,
220,
1398,
8562,
23002,
39044,
7,
16922,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8562,
327,
90,
41049,
3419,
92,
5287,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
69,
9548,
13,
8443,
507,
58,
15,
4083,
41049,
8743,
39044,
7,
15022,
23002,
39044,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2482,
796,
2116,
13,
20274,
5189,
7,
17602,
77,
17,
13,
18558,
17861,
7203,
12227,
1949,
2474,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
27765,
77,
17,
13,
41509,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
16410,
29795,
46430,
62,
24588,
11,
9809,
11907,
60,
796,
2482,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7203,
12227,
1949,
40754,
9809,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
944,
13,
25925,
11187,
2004,
9139,
5965,
7,
15022,
23002,
39044,
36911,
352,
8,
628,
220,
220,
220,
825,
1332,
62,
19836,
16922,
13921,
429,
39,
5540,
6690,
261,
1606,
295,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
554,
617,
6831,
34111,
11,
611,
262,
4382,
20612,
262,
4637,
11,
198,
220,
220,
220,
220,
220,
220,
220,
327,
90,
19836,
3419,
92,
481,
2038,
13,
220,
1002,
327,
90,
19836,
92,
10143,
11,
612,
338,
407,
881,
326,
714,
198,
220,
220,
220,
220,
220,
220,
220,
1612,
2845,
326,
262,
4637,
318,
1541,
4838,
11,
523,
2092,
284,
262,
198,
220,
220,
220,
220,
220,
220,
220,
4006,
3417,
287,
198,
220,
220,
220,
220,
220,
220,
220,
406,
90,
9288,
62,
260,
13313,
2215,
5962,
23002,
2202,
3109,
9665,
32048,
37,
1768,
5512,
262,
198,
220,
220,
220,
220,
220,
220,
220,
5287,
815,
307,
18832,
11,
475,
13245,
284,
3586,
2438,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
1398,
38904,
32419,
16922,
7,
16922,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
35528,
326,
338,
257,
46076,
329,
1223,
326,
257,
6831,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12765,
1244,
5298,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
256,
796,
2116,
13,
9288,
62,
260,
13313,
2215,
5962,
23002,
2202,
3109,
9665,
32048,
37,
1768,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
635,
39044,
26125,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
8563,
796,
2116,
13,
25925,
11187,
2004,
9139,
5965,
7,
33,
6020,
32419,
16922,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
48277,
828,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
256,
628,
220,
220,
220,
825,
1332,
62,
3866,
6935,
270,
33244,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
4889,
2977,
3804,
284,
406,
90,
40,
42367,
48720,
13,
3866,
6935,
270,
92,
481,
307,
24399,
2402,
198,
220,
220,
220,
220,
220,
220,
220,
4589,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
27765,
77,
796,
2116,
13,
17953,
48720,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
2829,
13,
28060,
796,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
27765,
77,
13,
3866,
6935,
270,
7,
36439,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
36439,
13,
28060,
11,
10352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
2116,
13,
20274,
5189,
7,
17602,
77,
13,
41509,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
20274,
828,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
36439,
13,
28060,
11,
6407,
8,
628,
220,
220,
220,
825,
1332,
62,
4299,
263,
6719,
6935,
270,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1002,
869,
2977,
3804,
284,
406,
90,
40,
42367,
48720,
13,
3866,
6935,
270,
92,
1441,
198,
220,
220,
220,
220,
220,
220,
220,
406,
90,
7469,
17436,
92,
82,
11,
484,
481,
29135,
262,
4036,
4589,
4905,
1566,
340,
468,
198,
220,
220,
220,
220,
220,
220,
220,
6294,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
27765,
77,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
288,
796,
2896,
17436,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
4043,
13,
46981,
796,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
4043,
13,
25410,
23004,
796,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
27765,
77,
13,
3866,
6935,
270,
7,
17077,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
2116,
13,
20274,
5189,
7,
17602,
77,
13,
41509,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
25925,
26807,
364,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
17077,
13,
46981,
11,
6407,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
17077,
13,
25410,
23004,
11,
6045,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
20274,
11,
685,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
288,
13,
47423,
7,
14202,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
1249,
3127,
314,
14,
46,
329,
44762,
1220,
3127,
276,
7822,
26,
612,
815,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
307,
262,
4589,
3275,
783,
13,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
25925,
26807,
364,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
20274,
828,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
17077,
13,
25410,
23004,
11,
16410,
16,
11,
366,
11246,
1332,
44161,
8973,
12962,
628,
220,
220,
220,
825,
1332,
62,
32165,
6719,
6935,
270,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1002,
869,
2977,
3804,
284,
406,
90,
40,
42367,
48720,
13,
3866,
6935,
270,
92,
5298,
281,
198,
220,
220,
220,
220,
220,
220,
220,
6631,
393,
1441,
257,
25743,
11,
8840,
869,
2977,
481,
407,
307,
1057,
11,
198,
220,
220,
220,
220,
220,
220,
220,
290,
262,
8611,
481,
307,
46847,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
1332,
7,
32165,
263,
11,
12169,
24095,
1166,
12331,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1332,
7,
430,
5847,
11,
412,
19238,
12331,
8,
628,
220,
220,
220,
825,
1332,
62,
3919,
18257,
6935,
270,
13921,
429,
39,
5540,
6690,
261,
1606,
295,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
14303,
345,
1053,
10945,
257,
12405,
393,
6157,
257,
2643,
319,
281,
5984,
33,
17614,
198,
220,
220,
220,
220,
220,
220,
220,
4637,
11,
262,
4637,
318,
5026,
31589,
21696,
357,
23395,
8945,
737,
198,
220,
220,
220,
220,
220,
220,
220,
317,
764,
41509,
3419,
393,
764,
2487,
1891,
3419,
3940,
3393,
416,
257,
764,
41509,
3419,
318,
198,
220,
220,
220,
220,
220,
220,
220,
4361,
27158,
11,
290,
460,
307,
9514,
13,
220,
11399,
11,
1682,
198,
220,
220,
220,
220,
220,
220,
220,
23710,
262,
4589,
290,
8928,
803,
257,
1744,
4637,
12,
17107,
198,
220,
220,
220,
220,
220,
220,
220,
4049,
5640,
7534,
284,
766,
8563,
11,
618,
11,
611,
883,
7534,
550,
1682,
198,
220,
220,
220,
220,
220,
220,
220,
10945,
597,
6299,
11,
262,
4637,
561,
423,
587,
32099,
290,
198,
220,
220,
220,
220,
220,
220,
220,
262,
2643,
13245,
306,
302,
12,
18558,
7241,
416,
262,
9156,
6789,
416,
198,
220,
220,
220,
220,
220,
220,
220,
406,
90,
9288,
62,
260,
13313,
2215,
5962,
23002,
37,
1768,
27422,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
27765,
77,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
69,
9548,
13,
41509,
39044,
796,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
69,
9548,
13,
2487,
1891,
39044,
796,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
685,
87,
60,
796,
2116,
13,
20274,
5189,
7,
17602,
77,
13,
41509,
28955,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
1400,
6299,
423,
587,
10945,
11,
523,
327,
90,
41509,
92,
481,
1635,
1662,
9,
307,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
10945,
13,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
944,
13,
69,
9548,
13,
41509,
39044,
11,
6407,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
33234,
605,
7,
87,
11,
6045,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
944,
13,
7742,
13557,
5787,
828,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
944,
13,
7742,
13557,
15643,
3929,
11,
685,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
944,
13,
69,
9548,
13,
8443,
507,
828,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
944,
13,
69,
9548,
13,
8443,
507,
58,
15,
4083,
20225,
11,
10352,
8,
628,
220,
220,
220,
825,
1332,
62,
260,
13313,
2215,
12211,
23002,
37,
1768,
6423,
5962,
23002,
37,
1768,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
3819,
4637,
12,
17107,
8563,
1244,
5298,
13269,
611,
484,
3051,
198,
220,
220,
220,
220,
220,
220,
220,
287,
262,
3504,
286,
257,
8611,
11,
475,
326,
815,
2728,
262,
4049,
284,
307,
198,
220,
220,
220,
220,
220,
220,
220,
4978,
11,
262,
8611,
284,
307,
46847,
11,
290,
262,
357,
20225,
8,
4637,
284,
198,
220,
220,
220,
220,
220,
220,
220,
307,
32099,
11,
810,
262,
1306,
8611,
326,
6370,
284,
466,
1997,
198,
220,
220,
220,
220,
220,
220,
220,
351,
340,
481,
8791,
262,
4049,
3393,
290,
7073,
340,
2476,
284,
198,
220,
220,
220,
220,
220,
220,
220,
307,
32099,
13,
628,
220,
220,
220,
220,
220,
220,
220,
632,
561,
307,
1365,
611,
428,
4069,
547,
14836,
11,
475,
326,
714,
691,
198,
220,
220,
220,
220,
220,
220,
220,
307,
13013,
351,
517,
7141,
6831,
13269,
13,
220,
775,
743,
1282,
510,
198,
220,
220,
220,
220,
220,
220,
220,
351,
1104,
287,
262,
2003,
329,
517,
10582,
13720,
13269,
11,
198,
220,
220,
220,
220,
220,
220,
220,
475,
314,
90,
34680,
92,
13269,
815,
2555,
284,
307,
5716,
287,
428,
5642,
11,
198,
220,
220,
220,
220,
220,
220,
220,
823,
8369,
262,
6631,
736,
284,
3586,
2438,
475,
9361,
257,
198,
220,
220,
220,
220,
220,
220,
220,
302,
12,
38659,
319,
262,
1306,
1949,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
27765,
77,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
16410,
29795,
46430,
62,
24588,
11,
4808,
46430,
62,
30328,
11907,
60,
796,
2116,
13,
20274,
5189,
7,
17602,
77,
13,
18558,
17861,
7203,
31373,
11,
995,
40754,
17635,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
69,
9548,
13,
8443,
507,
58,
15,
4083,
41049,
8743,
39044,
7,
28667,
24095,
1166,
12331,
8,
198,
220,
220,
220,
220,
220,
220,
220,
685,
69,
60,
796,
2116,
13,
20274,
5189,
7,
17602,
77,
13,
18558,
17861,
7203,
7146,
485,
416,
6632,
1600,
17635,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
277,
13,
46670,
7,
944,
13,
7645,
17660,
12331,
7,
28667,
24095,
1166,
12331,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
944,
13,
69,
9548,
13,
8443,
507,
58,
15,
4083,
18558,
3508,
11,
362,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
23419,
1606,
295,
815,
670,
3446,
355,
878,
13,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
944,
13,
69,
9548,
13,
8443,
507,
58,
15,
4083,
20225,
11,
10352,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
15678,
2438,
468,
284,
4836,
736,
663,
8611,
379,
428,
966,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
1201,
340,
4054,
357,
392,
356,
836,
470,
6646,
760,
1521,
340,
4054,
25,
407,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
1576,
1321,
737,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
20274,
5189,
7,
17602,
77,
13,
397,
419,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
69,
9548,
13,
8443,
507,
58,
15,
4083,
18558,
3508,
796,
657,
220,
1303,
302,
12,
2617,
329,
1306,
1332,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
944,
13,
69,
9548,
13,
8443,
507,
828,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
9288,
62,
260,
13313,
2215,
5962,
23002,
37,
1768,
3419,
628,
220,
220,
220,
825,
1332,
62,
6381,
8443,
2202,
37,
6255,
26869,
1891,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1649,
327,
90,
2487,
1891,
92,
10143,
329,
597,
1738,
319,
257,
4637,
2134,
11,
788,
356,
198,
220,
220,
220,
220,
220,
220,
220,
836,
470,
760,
644,
1181,
340,
338,
287,
13,
220,
4042,
1884,
11,
340,
338,
1541,
587,
198,
220,
220,
220,
220,
220,
220,
220,
28597,
11,
523,
262,
4637,
815,
307,
4838,
290,
262,
8611,
198,
220,
220,
220,
220,
220,
220,
220,
390,
12,
7742,
276,
2427,
286,
32099,
13,
628,
220,
220,
220,
220,
220,
220,
220,
4418,
11,
257,
649,
4637,
481,
3393,
307,
4920,
284,
1394,
262,
5933,
198,
220,
220,
220,
220,
220,
220,
220,
2546,
262,
976,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
27765,
77,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2482,
796,
2116,
13,
20274,
5189,
7,
17602,
77,
13,
18558,
17861,
7203,
25991,
1487,
1223,
2474,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
16410,
29795,
46430,
62,
24588,
11,
9809,
11907,
60,
796,
2482,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7203,
25991,
1487,
1223,
40754,
9809,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
69,
9548,
13,
2487,
1891,
39044,
796,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
685,
87,
60,
796,
2116,
13,
20274,
5189,
7,
17602,
77,
13,
397,
419,
28955,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
2275,
419,
857,
407,
47933,
262,
4049,
319,
11,
262,
8611,
6974,
3011,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
29947,
286,
13,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
33234,
605,
7,
87,
11,
6045,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
944,
13,
7742,
13557,
5787,
828,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
944,
13,
7742,
13557,
15643,
3929,
11,
685,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
944,
13,
69,
9548,
13,
8443,
507,
828,
362,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
944,
13,
69,
9548,
13,
8443,
507,
58,
15,
4083,
20225,
11,
6407,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
944,
13,
69,
9548,
13,
8443,
507,
58,
16,
4083,
20225,
11,
10352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
944,
13,
25925,
11187,
2004,
9139,
5965,
7,
26869,
1891,
39044,
36911,
352,
8,
628,
220,
220,
220,
825,
1332,
62,
1069,
4516,
24331,
363,
689,
37,
6255,
6935,
270,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
317,
4054,
327,
90,
2487,
1891,
92,
318,
3734,
357,
1169,
19905,
1918,
286,
262,
4637,
198,
220,
220,
220,
220,
220,
220,
220,
1231,
327,
90,
41509,
92,
1724,
326,
262,
2458,
389,
10403,
3750,
828,
475,
257,
4054,
198,
220,
220,
220,
220,
220,
220,
220,
327,
90,
41509,
92,
468,
284,
307,
47968,
284,
5456,
2438,
11,
1201,
326,
1682,
1724,
198,
220,
220,
220,
220,
220,
220,
220,
617,
2458,
1422,
470,
2277,
262,
6831,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
27765,
77,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
69,
9548,
13,
41509,
39044,
796,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
2482,
796,
2116,
13,
20274,
5189,
7,
17602,
77,
13,
18558,
17861,
7203,
25991,
1487,
1223,
2474,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
16410,
29795,
46430,
62,
24588,
11,
9809,
11907,
60,
796,
2482,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7203,
25991,
1487,
1223,
40754,
9809,
8,
198,
220,
220,
220,
220,
220,
220,
220,
685,
87,
60,
796,
2116,
13,
20274,
5189,
7,
17602,
77,
13,
41509,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
2124,
13,
46670,
7,
944,
13,
7645,
17660,
12331,
7,
6935,
270,
39044,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
944,
13,
7742,
13557,
5787,
828,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
944,
13,
7742,
13557,
15643,
3929,
11,
685,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
944,
13,
69,
9548,
13,
8443,
507,
828,
362,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
944,
13,
69,
9548,
13,
8443,
507,
58,
15,
4083,
20225,
11,
6407,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
944,
13,
69,
9548,
13,
8443,
507,
58,
16,
4083,
20225,
11,
10352,
8,
628,
220,
220,
220,
825,
1332,
62,
21812,
12235,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
406,
90,
40,
42367,
48720,
13,
21812,
12235,
92,
5860,
281,
406,
90,
40,
42367,
48720,
92,
198,
220,
220,
220,
220,
220,
220,
220,
10131,
543,
19047,
326,
257,
2512,
286,
9729,
389,
10945,
1978,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
27765,
77,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
257,
796,
2116,
13,
20274,
5189,
7,
17602,
77,
13,
18558,
17861,
7203,
64,
48774,
198,
220,
220,
220,
220,
220,
220,
220,
269,
65,
796,
27765,
77,
13,
21812,
12235,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
11767,
10267,
7,
2149,
2002,
392,
12235,
11,
269,
65,
8,
198,
220,
220,
220,
220,
220,
220,
220,
275,
796,
2116,
13,
20274,
5189,
7,
21101,
13,
18558,
17861,
7203,
65,
48774,
198,
220,
220,
220,
220,
220,
220,
220,
288,
796,
2116,
13,
20274,
5189,
7,
17602,
77,
13,
18558,
17861,
7203,
67,
48774,
198,
220,
220,
220,
220,
220,
220,
220,
269,
796,
2116,
13,
20274,
5189,
7,
21101,
13,
18558,
17861,
7203,
66,
48774,
198,
220,
220,
220,
220,
220,
220,
220,
269,
65,
13,
437,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
304,
796,
2116,
13,
20274,
5189,
7,
17602,
77,
13,
18558,
17861,
7203,
68,
48774,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
69,
9548,
13,
8443,
507,
58,
15,
4083,
66,
1834,
669,
58,
15,
4083,
439,
23002,
3508,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
685,
7203,
64,
1600,
17635,
828,
5855,
65,
1600,
17635,
828,
5855,
66,
1600,
17635,
828,
5855,
67,
1600,
17635,
828,
5855,
68,
1600,
685,
12962,
60,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
64,
828,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
65,
828,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
66,
828,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
67,
828,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
68,
828,
352,
8,
628,
220,
220,
220,
825,
1332,
62,
21812,
12235,
3152,
24220,
1387,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
317,
2512,
4504,
416,
406,
90,
40,
42367,
48720,
13,
21812,
12235,
92,
1839,
470,
923,
198,
220,
220,
220,
220,
220,
220,
220,
23710,
1566,
477,
16363,
6299,
7530,
878,
340,
423,
5668,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
32125,
26807,
364,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
27765,
77,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
257,
796,
2116,
13,
20274,
5189,
7,
17602,
77,
13,
18558,
17861,
7203,
64,
48774,
198,
220,
220,
220,
220,
220,
220,
220,
275,
796,
2116,
13,
20274,
5189,
7,
17602,
77,
13,
18558,
17861,
7203,
65,
48774,
198,
220,
220,
220,
220,
220,
220,
220,
269,
65,
796,
27765,
77,
13,
21812,
12235,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
269,
796,
2116,
13,
20274,
5189,
7,
21101,
13,
18558,
17861,
7203,
66,
48774,
198,
220,
220,
220,
220,
220,
220,
220,
288,
796,
2116,
13,
20274,
5189,
7,
21101,
13,
18558,
17861,
7203,
67,
48774,
198,
220,
220,
220,
220,
220,
220,
220,
304,
796,
2116,
13,
20274,
5189,
7,
17602,
77,
13,
18558,
17861,
7203,
68,
48774,
198,
220,
220,
220,
220,
220,
220,
220,
269,
65,
13,
437,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
25925,
26807,
364,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
69,
9548,
13,
8443,
507,
58,
15,
4083,
66,
1834,
669,
58,
15,
4083,
439,
23002,
3508,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
685,
7203,
64,
1600,
17635,
828,
5855,
65,
1600,
17635,
828,
5855,
66,
1600,
17635,
828,
5855,
67,
1600,
17635,
828,
5855,
68,
1600,
685,
12962,
60,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
64,
828,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
65,
828,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
66,
828,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
67,
828,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
68,
828,
352,
8,
628,
220,
220,
220,
825,
1332,
62,
11545,
21575,
45356,
7,
944,
11,
24773,
28,
50033,
25,
6045,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1649,
9706,
286,
530,
3141,
2512,
318,
1844,
11,
340,
481,
5120,
284,
262,
198,
220,
220,
220,
220,
220,
220,
220,
1306,
8358,
1739,
2512,
11,
788,
284,
3218,
16363,
10945,
319,
262,
8611,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
27765,
77,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
269,
65,
16,
796,
27765,
77,
13,
21812,
12235,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
269,
65,
17,
796,
27765,
77,
13,
21812,
12235,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
27765,
77,
13,
18558,
17861,
7203,
68,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
269,
65,
16,
13,
18558,
17861,
7203,
64,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
269,
65,
17,
13,
18558,
17861,
7203,
66,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
269,
65,
16,
13,
18558,
17861,
7203,
65,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
269,
65,
17,
13,
18558,
17861,
7203,
67,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
269,
65,
17,
13,
437,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
269,
65,
16,
13,
437,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
24773,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
25925,
26807,
364,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
69,
9548,
13,
8443,
507,
58,
15,
4083,
66,
1834,
669,
58,
15,
4083,
439,
23002,
3508,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
685,
7203,
64,
1600,
17635,
828,
5855,
65,
1600,
17635,
828,
5855,
66,
1600,
17635,
828,
5855,
67,
1600,
17635,
828,
5855,
68,
1600,
685,
12962,
60,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
825,
1332,
62,
11545,
21575,
45356,
24220,
1473,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
16766,
355,
406,
90,
9288,
62,
11545,
21575,
45356,
5512,
475,
351,
13611,
869,
10146,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
32125,
26807,
364,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
9288,
62,
11545,
21575,
45356,
7,
944,
13,
25925,
26807,
364,
8,
628,
220,
220,
220,
825,
1332,
62,
21812,
12235,
12915,
5080,
501,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
406,
90,
21575,
12235,
13,
437,
92,
481,
5298,
406,
90,
37447,
18467,
1348,
12331,
92,
618,
1444,
517,
198,
220,
220,
220,
220,
220,
220,
220,
621,
1752,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
27765,
77,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2512,
796,
27765,
77,
13,
21812,
12235,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2512,
13,
437,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
21762,
2696,
7,
37447,
18467,
1348,
12331,
11,
2512,
13,
437,
8,
628,
220,
220,
220,
825,
1332,
62,
21812,
12235,
13856,
592,
6935,
270,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2773,
3141,
7021,
761,
284,
1057,
355,
24871,
3481,
11,
1231,
262,
4045,
198,
220,
220,
220,
220,
220,
220,
220,
8611,
12,
805,
3039,
2438,
6970,
703,
1290,
484,
1053,
28775,
13,
198,
220,
220,
220,
220,
220,
220,
220,
8447,
618,
345,
869,
1391,
40,
42367,
48720,
13,
41509,
92,
22784,
340,
815,
407,
198,
220,
220,
220,
220,
220,
220,
220,
1682,
1011,
1245,
611,
612,
389,
597,
13310,
3141,
7021,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
27765,
77,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2512,
796,
27765,
77,
13,
21812,
12235,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
4589,
23004,
796,
2116,
13,
20274,
5189,
7,
17602,
77,
13,
41509,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
20274,
5189,
7,
9967,
13,
18558,
17861,
7203,
259,
2512,
48774,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
41509,
23004,
11,
685,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
69,
9548,
13,
8443,
507,
58,
15,
4083,
66,
1834,
669,
58,
15,
4083,
439,
23002,
3508,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
685,
7203,
259,
2512,
1600,
685,
12962,
60,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
2512,
13,
437,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
25925,
26807,
364,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
41509,
23004,
11,
685,
14202,
12962,
628,
220,
220,
220,
825,
1332,
62,
21812,
12235,
13921,
429,
13856,
323,
4826,
419,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
317,
406,
90,
21575,
12235,
92,
460,
470,
5457,
423,
1997,
3499,
284,
910,
546,
198,
220,
220,
220,
220,
220,
220,
220,
257,
8611,
326,
3011,
11686,
736,
11,
523,
327,
90,
397,
419,
92,
8991,
3393,
26,
198,
220,
220,
220,
220,
220,
220,
220,
477,
11660,
327,
90,
18558,
17861,
92,
82,
481,
2038,
3393,
11,
319,
1111,
3141,
198,
220,
220,
220,
220,
220,
220,
220,
7021,
290,
319,
262,
8611,
2346,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
27765,
77,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2512,
796,
27765,
77,
13,
21812,
12235,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2512,
17,
796,
27765,
77,
13,
21812,
12235,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
15614,
23004,
796,
2116,
13,
20274,
5189,
7,
17602,
77,
13,
397,
419,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
397,
419,
23004,
11,
685,
14202,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
21762,
2696,
7,
37447,
18467,
1348,
12331,
11,
2512,
17,
13,
18558,
17861,
11,
366,
5657,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
21762,
2696,
7,
37447,
18467,
1348,
12331,
11,
2512,
13,
18558,
17861,
11,
366,
21943,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
21762,
2696,
7,
37447,
18467,
1348,
12331,
11,
27765,
77,
13,
18558,
17861,
11,
366,
65,
1031,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
69,
9548,
13,
8443,
507,
58,
15,
4083,
66,
1834,
669,
58,
15,
4083,
439,
23002,
3508,
11,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
886,
3419,
815,
4808,
1662,
62,
5298,
281,
6631,
11,
780,
428,
318,
262,
3297,
286,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
1517,
326,
1244,
307,
1088,
257,
1949,
14,
69,
3289,
393,
1949,
14,
16341,
26,
340,
338,
655,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
5137,
262,
3141,
12235,
2346,
656,
257,
1181,
6414,
351,
262,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
8611,
13,
198,
220,
220,
220,
220,
220,
220,
220,
2512,
13,
437,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2512,
17,
13,
437,
3419,
628,
220,
220,
220,
825,
1332,
62,
1631,
12235,
13921,
429,
23002,
1133,
5167,
17861,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
25770,
278,
284,
12260,
16363,
319,
257,
406,
90,
21575,
12235,
92,
543,
468,
550,
327,
90,
437,
92,
198,
220,
220,
220,
220,
220,
220,
220,
1444,
319,
340,
481,
1255,
287,
281,
406,
90,
37447,
18467,
1348,
12331,
27422,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
27765,
77,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2512,
796,
27765,
77,
13,
21812,
12235,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2512,
13,
437,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
21762,
2696,
7,
37447,
18467,
1348,
12331,
11,
2512,
13,
18558,
17861,
11,
366,
31373,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
69,
9548,
13,
8443,
507,
58,
15,
4083,
66,
1834,
669,
58,
15,
4083,
439,
23002,
3508,
11,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
825,
1332,
62,
21812,
12235,
3260,
6935,
270,
21762,
2696,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
4874,
281,
406,
90,
40,
42367,
48720,
92,
468,
587,
5364,
11,
406,
90,
21812,
12235,
92,
12073,
198,
220,
220,
220,
220,
220,
220,
220,
281,
6631,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
27765,
77,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
27765,
77,
13,
41509,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
21762,
2696,
7,
37447,
18467,
1348,
12331,
11,
27765,
77,
13,
21812,
12235,
8,
628,
220,
220,
220,
825,
1332,
62,
21812,
12235,
3260,
4826,
419,
21762,
2696,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
4874,
281,
406,
90,
40,
42367,
48720,
92,
468,
587,
5364,
11,
406,
90,
21812,
12235,
92,
12073,
198,
220,
220,
220,
220,
220,
220,
220,
281,
6631,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
27765,
77,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
20274,
5189,
7,
17602,
77,
13,
397,
419,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
21762,
2696,
7,
37447,
18467,
1348,
12331,
11,
27765,
77,
13,
21812,
12235,
8,
628,
220,
220,
220,
825,
1332,
62,
40225,
2202,
28667,
25166,
12332,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
406,
90,
40,
42367,
48720,
13,
18558,
17861,
92,
481,
1441,
257,
406,
90,
7469,
17436,
92,
9894,
351,
262,
198,
220,
220,
220,
220,
220,
220,
220,
6631,
3804,
355,
663,
5298,
2202,
28667,
25166,
12332,
4578,
611,
262,
10238,
198,
220,
220,
220,
220,
220,
220,
220,
12405,
5860,
645,
15274,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
69,
9548,
13,
10134,
25468,
796,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
27765,
77,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
277,
796,
2116,
13,
20274,
5189,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27765,
77,
13,
18558,
17861,
7203,
31373,
1600,
5298,
2202,
28667,
25166,
12332,
28,
28667,
24095,
1166,
12331,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
58,
15,
60,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
21762,
2696,
7,
28667,
24095,
1166,
12331,
11,
277,
13,
40225,
16922,
8,
198,
220,
220,
220,
220,
220,
220,
220,
27765,
77,
13,
41509,
3419,
628,
220,
220,
220,
825,
1332,
62,
40225,
2202,
28667,
25166,
12332,
3152,
3118,
2411,
3379,
25166,
12332,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1081,
340,
4962,
503,
11,
617,
20083,
460,
470,
26995,
1560,
345,
703,
867,
15274,
198,
220,
220,
220,
220,
220,
220,
220,
484,
821,
1016,
284,
21207,
2884,
262,
327,
90,
808,
9127,
92,
11688,
878,
262,
15274,
198,
220,
220,
220,
220,
220,
220,
220,
423,
1682,
587,
11351,
1740,
11,
523,
262,
327,
90,
40225,
2202,
28667,
25166,
12332,
92,
481,
314,
90,
1662,
92,
198,
220,
220,
220,
220,
220,
220,
220,
5298,
281,
6631,
611,
327,
90,
808,
9127,
92,
318,
6632,
475,
327,
90,
11213,
92,
290,
198,
220,
220,
220,
220,
220,
220,
220,
327,
90,
69,
7569,
439,
92,
9217,
262,
4931,
286,
617,
15274,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
69,
9548,
13,
10134,
25468,
796,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
69,
9548,
13,
21754,
10260,
25166,
9127,
796,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
27765,
77,
796,
2116,
13,
17953,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
374,
796,
2116,
13,
20274,
5189,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27765,
77,
13,
18558,
17861,
7203,
11246,
12,
8516,
1600,
5298,
2202,
28667,
25166,
12332,
28,
41006,
12331,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
16410,
29795,
46430,
62,
24588,
11,
9809,
11907,
60,
796,
374,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
30328,
11,
366,
11246,
12,
8516,
4943,
628,
198,
4871,
314,
3185,
931,
7,
15252,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
8113,
257,
5456,
290,
257,
4382,
13,
628,
220,
220,
220,
2488,
452,
283,
5456,
25,
257,
5456,
8435,
628,
220,
220,
220,
2488,
452,
283,
4382,
25,
257,
4382,
8435,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
1445,
6601,
7,
944,
11,
357,
448,
8291,
634,
11,
287,
19703,
4668,
8,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
10028,
1366,
422,
257,
406,
90,
10100,
8291,
634,
92,
284,
281,
406,
90,
40,
19703,
4668,
27422,
628,
220,
220,
220,
220,
220,
220,
220,
2488,
7783,
25,
327,
90,
17821,
92,
611,
597,
1366,
373,
3888,
11,
327,
90,
25101,
92,
611,
645,
1366,
373,
3888,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1366,
796,
503,
8291,
634,
13,
952,
13,
1136,
8367,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
503,
8291,
634,
13,
952,
13,
36163,
7,
15,
8,
198,
220,
220,
220,
220,
220,
220,
220,
503,
8291,
634,
13,
952,
13,
2213,
19524,
378,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
611,
1366,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
287,
19703,
4668,
13,
7890,
3041,
6471,
7,
7890,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
628,
220,
220,
220,
825,
8901,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
43371,
477,
5128,
422,
262,
5456,
284,
262,
4382,
11,
788,
422,
262,
4382,
198,
220,
220,
220,
220,
220,
220,
220,
284,
262,
5456,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
257,
796,
2116,
13,
21084,
6601,
7,
944,
13,
66,
17,
82,
8,
198,
220,
220,
220,
220,
220,
220,
220,
275,
796,
2116,
13,
21084,
6601,
7,
944,
13,
82,
17,
66,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
257,
393,
275,
628,
220,
220,
220,
825,
24773,
7,
944,
11,
3509,
17278,
82,
28,
3064,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
10054,
26916,
1566,
645,
517,
1366,
318,
17609,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
4962,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
981,
2116,
13,
79,
931,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4962,
15853,
352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
4962,
1875,
3509,
17278,
82,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
43160,
12331,
7203,
49,
272,
1165,
890,
2474,
8,
628,
198,
4871,
7311,
276,
27201,
47429,
7,
32048,
27201,
47429,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1052,
7552,
286,
406,
90,
32048,
27201,
47429,
92,
326,
460,
900,
510,
257,
198,
220,
220,
220,
406,
90,
32048,
27201,
11792,
92,
290,
406,
90,
32048,
27201,
32048,
92,
7223,
284,
1123,
198,
220,
220,
220,
584,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
900,
4933,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2141,
262,
976,
9058,
422,
406,
90,
32048,
27201,
14881,
5512,
475,
635,
4474,
257,
198,
220,
220,
220,
220,
220,
220,
220,
9052,
1891,
4637,
1022,
257,
406,
90,
32048,
27201,
32048,
92,
290,
257,
198,
220,
220,
220,
220,
220,
220,
220,
406,
90,
32048,
27201,
11792,
27422,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2208,
7,
26245,
276,
27201,
47429,
11,
2116,
737,
2617,
4933,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
79,
931,
796,
314,
3185,
931,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26923,
27201,
11792,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
20613,
4906,
28,
944,
13,
9945,
4906,
11,
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,
26923,
27201,
32048,
7,
944,
13,
7742,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
628,
220,
220,
220,
825,
24773,
26807,
364,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
554,
3090,
284,
781,
8023,
262,
406,
90,
16818,
39,
19892,
92,
17071,
82,
11,
635,
24773,
597,
198,
220,
220,
220,
220,
220,
220,
220,
13310,
3127,
314,
14,
46,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
79,
931,
13,
25925,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2208,
7,
26245,
276,
27201,
47429,
11,
2116,
737,
25925,
26807,
364,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
79,
931,
13,
25925,
3419,
628,
220,
220,
220,
825,
15772,
12331,
7,
944,
11,
11454,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1439,
8563,
4376,
15726,
481,
12716,
307,
14251,
656,
198,
220,
220,
220,
220,
220,
220,
220,
16185,
36510,
12331,
11,
1201,
3001,
47,
4433,
2176,
27056,
341,
286,
477,
286,
198,
220,
220,
220,
220,
220,
220,
220,
606,
13,
220,
1610,
1530,
262,
15726,
18832,
4049,
286,
262,
1813,
2099,
290,
1441,
198,
220,
220,
220,
220,
220,
220,
220,
406,
90,
20035,
36510,
12331,
27422,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
611,
11454,
287,
35910,
13,
48277,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
11454,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
25925,
11187,
2004,
9139,
5965,
7,
8056,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
376,
1768,
8635,
16922,
628,
198,
4871,
7311,
276,
32048,
27201,
51,
3558,
7,
26245,
276,
27201,
47429,
11,
26923,
27201,
51,
3558,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
30307,
329,
406,
90,
32048,
27201,
32048,
92,
290,
406,
90,
32048,
27201,
11792,
92,
198,
220,
220,
220,
24986,
351,
1123,
584,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
900,
22973,
7635,
7,
944,
11,
5772,
7635,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
9794,
262,
5772,
7635,
319,
1111,
262,
5933,
290,
262,
5456,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2208,
7,
26245,
276,
32048,
27201,
51,
3558,
11,
2116,
737,
2617,
22973,
7635,
7,
17143,
7635,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
79,
931,
13,
16366,
13,
9945,
4906,
796,
2116,
13,
79,
931,
13,
16366,
13,
9945,
4906,
13,
30073,
33491,
7,
17143,
7635,
28,
17143,
7635,
8,
628,
220,
220,
220,
825,
900,
24400,
478,
7,
944,
11,
23637,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
9794,
262,
23637,
319,
1111,
262,
5933,
290,
262,
5456,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2208,
7,
26245,
276,
32048,
27201,
51,
3558,
11,
2116,
737,
2617,
24400,
478,
7,
38969,
478,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
79,
931,
13,
16366,
13,
9945,
4906,
796,
2116,
13,
79,
931,
13,
16366,
13,
9945,
4906,
13,
30073,
33491,
7,
38969,
478,
28,
38969,
478,
8,
628,
220,
220,
220,
825,
1332,
62,
3605,
48720,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
406,
90,
32048,
27201,
11792,
13,
3605,
48720,
92,
5860,
257,
10131,
286,
198,
220,
220,
220,
220,
220,
220,
220,
406,
90,
40,
42367,
48720,
5512,
290,
8075,
257,
649,
8611,
319,
262,
4382,
1735,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
27765,
77,
796,
2116,
13,
79,
931,
13,
16366,
13,
3605,
48720,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
11767,
10267,
7,
40,
42367,
48720,
11,
27765,
77,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
79,
931,
13,
25925,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
944,
13,
69,
9548,
13,
8443,
507,
828,
352,
8,
628,
198,
4871,
18531,
540,
32180,
51,
3558,
7,
14402,
20448,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
30307,
329,
406,
90,
62,
39,
566,
540,
32180,
27422,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
2488,
45145,
14134,
10146,
198,
220,
220,
220,
825,
1332,
62,
20063,
36854,
658,
7004,
44399,
4550,
39,
566,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2293,
1598,
3419,
393,
1057,
39,
31085,
3419,
389,
1444,
11,
8840,
3848,
284,
751,
39,
566,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
389,
8005,
12,
3185,
82,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
8011,
18257,
796,
4808,
39,
566,
540,
32180,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
8011,
18257,
13,
2860,
39,
566,
7,
25480,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
11925,
7,
25480,
18257,
13557,
25480,
82,
828,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
8011,
18257,
13,
20063,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
25480,
18257,
13557,
25480,
82,
11,
6045,
8,
628,
220,
220,
220,
220,
220,
220,
220,
8011,
18257,
796,
4808,
39,
566,
540,
32180,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
8011,
18257,
13,
2860,
39,
566,
7,
25480,
8,
198,
220,
220,
220,
220,
220,
220,
220,
7800,
8011,
18257,
13,
5143,
39,
31085,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
25480,
18257,
13557,
25480,
82,
11,
6045,
8,
198,
220,
220,
220,
220,
220,
220,
220,
8011,
18257,
13,
2860,
39,
566,
7,
25480,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30493,
23588,
874,
7,
25480,
18257,
13557,
25480,
82,
11,
6045,
8,
198
] | 2.466543 | 19,891 |
from .sensitivity import solve_sensitivity
from .monte_carlo import solve_monte_carlo
from ..model_parser import ModelParser | [
6738,
764,
82,
40545,
1330,
8494,
62,
82,
40545,
198,
6738,
764,
2144,
660,
62,
7718,
5439,
1330,
8494,
62,
2144,
660,
62,
7718,
5439,
198,
198,
6738,
11485,
19849,
62,
48610,
1330,
9104,
46677
] | 3.571429 | 35 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.