content
stringlengths 1
1.04M
| input_ids
sequencelengths 1
774k
| ratio_char_token
float64 0.38
22.9
| token_count
int64 1
774k
|
---|---|---|---|
import os
import tempfile
import sys
import errno
import getpass
import configparser
import pytest
from unittest import mock
from keyring.testing.backend import BackendBasicTests
from keyring.testing.util import random_string
from keyrings.cryptfile import file
from keyrings.cryptfile.file_base import encodebytes
from keyrings.cryptfile.escape import escape as escape_for_ini
from keyring.errors import PasswordDeleteError
| [
11748,
28686,
198,
11748,
20218,
7753,
198,
11748,
25064,
198,
11748,
11454,
3919,
198,
11748,
651,
6603,
198,
11748,
4566,
48610,
198,
198,
11748,
12972,
9288,
198,
6738,
555,
715,
395,
1330,
15290,
198,
198,
6738,
1994,
1806,
13,
33407,
13,
1891,
437,
1330,
5157,
437,
26416,
51,
3558,
198,
6738,
1994,
1806,
13,
33407,
13,
22602,
1330,
4738,
62,
8841,
198,
198,
6738,
1994,
33173,
13,
29609,
7753,
1330,
2393,
198,
6738,
1994,
33173,
13,
29609,
7753,
13,
7753,
62,
8692,
1330,
37773,
33661,
198,
6738,
1994,
33173,
13,
29609,
7753,
13,
41915,
1330,
6654,
355,
6654,
62,
1640,
62,
5362,
198,
198,
6738,
1994,
1806,
13,
48277,
1330,
30275,
38727,
12331,
628,
628
] | 3.756522 | 115 |
import math
import pygame
from pygame.locals import *
class Flags(object):
"""docstring for Flags"""
# def __get_sound(self):
# self.sounds = {
# 'move' : pygame.mixer.Sound(self.proj_path + 'asset/sound/Coin_1.wav'),
# 'merge' : pygame.mixer.Sound(self.proj_path + 'asset/sound/Coin_2.wav'),
# 'castle' : pygame.mixer.Sound(self.proj_path + 'asset/sound/Coin_3.wav')
# }
F = Flags()
| [
11748,
10688,
198,
11748,
12972,
6057,
198,
6738,
12972,
6057,
13,
17946,
874,
1330,
1635,
198,
198,
4871,
34771,
7,
15252,
2599,
198,
220,
220,
220,
37227,
15390,
8841,
329,
34771,
37811,
628,
198,
220,
220,
220,
1303,
825,
11593,
1136,
62,
23661,
7,
944,
2599,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
2116,
13,
82,
3733,
796,
1391,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
220,
220,
220,
220,
705,
21084,
6,
220,
220,
1058,
12972,
6057,
13,
19816,
263,
13,
21369,
7,
944,
13,
1676,
73,
62,
6978,
1343,
705,
562,
316,
14,
23661,
14,
24387,
62,
16,
13,
45137,
33809,
220,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
220,
220,
220,
220,
705,
647,
469,
6,
220,
1058,
12972,
6057,
13,
19816,
263,
13,
21369,
7,
944,
13,
1676,
73,
62,
6978,
1343,
705,
562,
316,
14,
23661,
14,
24387,
62,
17,
13,
45137,
33809,
220,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
220,
220,
220,
220,
705,
18676,
6,
1058,
12972,
6057,
13,
19816,
263,
13,
21369,
7,
944,
13,
1676,
73,
62,
6978,
1343,
705,
562,
316,
14,
23661,
14,
24387,
62,
18,
13,
45137,
11537,
198,
220,
220,
220,
1303,
220,
220,
220,
220,
1782,
198,
198,
37,
796,
34771,
3419,
628
] | 2.101852 | 216 |
# This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
# * Rearrange models' order
# * Make sure each model has one field with primary_key=True
# * Make sure each ForeignKey has `on_delete` set to the desired behavior.
# * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table
# Feel free to rename the models, but don't rename db_table values or field names.
from django.db import models
| [
2,
770,
318,
281,
8295,
12,
27568,
37770,
2746,
8265,
13,
198,
2,
921,
1183,
423,
284,
466,
262,
1708,
14500,
284,
3424,
428,
510,
25,
198,
2,
220,
220,
1635,
30144,
9521,
4981,
6,
1502,
198,
2,
220,
220,
1635,
6889,
1654,
1123,
2746,
468,
530,
2214,
351,
4165,
62,
2539,
28,
17821,
198,
2,
220,
220,
1635,
6889,
1654,
1123,
8708,
9218,
468,
4600,
261,
62,
33678,
63,
900,
284,
262,
10348,
4069,
13,
198,
2,
220,
220,
1635,
17220,
4600,
39935,
796,
10352,
63,
3951,
611,
345,
4601,
284,
1249,
37770,
284,
2251,
11,
13096,
11,
290,
12233,
262,
3084,
198,
2,
18571,
1479,
284,
36265,
262,
4981,
11,
475,
836,
470,
36265,
20613,
62,
11487,
3815,
393,
2214,
3891,
13,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
628,
628,
628,
628,
198
] | 3.686131 | 137 |
import json
| [
11748,
33918,
628
] | 4.333333 | 3 |
import arcade
import arcade.gui
import menu_view
from data_handler import DataHandler
from arcade.gui import UIManager
from constants import *
import os
dirname = os.path.dirname(__file__)
button_normal = arcade.load_texture(os.path.join(dirname, 'images/red_button_normal.png'))
hovered_texture = arcade.load_texture(os.path.join(dirname, 'images/red_button_hover.png'))
pressed_texture = arcade.load_texture(os.path.join(dirname, 'images/red_button_press.png'))
class BackButton(arcade.gui.UIImageButton):
"""
When clicked, go back to the menu view.
"""
go_back = False
class LeaderboardView(arcade.View):
"""
This view displays player name and data obtained from the .xml file (via DataHandler).
"""
def __init__(self):
"""
LeaderboardView construct.
"""
super().__init__()
arcade.set_background_color(arcade.color.LIGHT_TAUPE)
self.ui_manager = UIManager()
# GUI elements which will get constructed in setup()
self.back_button = None
def setup(self):
"""
Sets up leaderboard screen with GUI elements.
:return:
"""
self.ui_manager.purge_ui_elements()
# back button - press to play the game (creates a new view)
self.back_button = BackButton(center_x=WIDTH / 2, center_y=HEIGHT * 1.5 / 10, normal_texture=button_normal,
hover_texture=hovered_texture, press_texture=pressed_texture, text='Back')
self.ui_manager.add_ui_element(self.back_button)
def on_draw(self):
"""
Render the screen.
"""
arcade.start_render()
arcade.draw_text("LEADERBOARD", WIDTH / 2, HEIGHT * 3/4,
arcade.color.BLACK, font_size=75, anchor_x="center")
arcade.draw_text("Name", WIDTH / 6, HEIGHT * 3 / 4 - 50,
arcade.color.BLACK, font_size=20, anchor_x="center")
arcade.draw_text("Date", WIDTH * 2/6, HEIGHT * 3 / 4 - 50,
arcade.color.BLACK, font_size=20, anchor_x="center")
arcade.draw_text("Dimensions", WIDTH * 3.1/6, HEIGHT * 3 / 4 - 50,
arcade.color.BLACK, font_size=20, anchor_x="center")
arcade.draw_text("Time", WIDTH * 4.1/6, HEIGHT * 3 / 4 - 50,
arcade.color.BLACK, font_size=20, anchor_x="center")
arcade.draw_text("Score", WIDTH * 5/6, HEIGHT * 3 / 4 - 50,
arcade.color.BLACK, font_size=20, anchor_x="center")
# Display player data
leaderboard_data = DataHandler.get_leaderboard_data()
for i in range(len(leaderboard_data)):
rank = str(i+1)
# If name is too big, shorten it using '...' (e.g. Franklin -> Frankl...)
name = leaderboard_data[rank]['name']
name = name[:6] + '...' if len(name) > 6 else name
# Display the data
arcade.draw_text(name, WIDTH / 6, HEIGHT * 3 / 4 - 50*(i+2),
arcade.color.BLACK, font_size=20, anchor_x="center")
arcade.draw_text(leaderboard_data[rank]['date'], WIDTH * 2 / 6, HEIGHT * 3 / 4 - 50*(i+2),
arcade.color.BLACK, font_size=20, anchor_x="center")
arcade.draw_text(leaderboard_data[rank]['dimensions'], WIDTH * 3.1 / 6, HEIGHT * 3 / 4 - 50*(i+2),
arcade.color.BLACK, font_size=20, anchor_x="center")
arcade.draw_text(leaderboard_data[rank]['time'], WIDTH * 4.1 / 6, HEIGHT * 3 / 4 - 50*(i+2),
arcade.color.BLACK, font_size=20, anchor_x="center")
arcade.draw_text(leaderboard_data[rank]['score'], WIDTH * 5 / 6, HEIGHT * 3 / 4 - 50*(i+2),
arcade.color.BLACK, font_size=20, anchor_x="center")
def on_show_view(self):
"""
Show this view.
"""
self.setup()
def on_hide_view(self):
"""
What to do when hiding this view.
:return:
"""
self.ui_manager.unregister_handlers()
def update(self, delta_time: float):
"""
Called every frame.
:param delta_time: delta time for each frame.
:return:
"""
if self.back_button.go_back:
next_view = menu_view.MainMenu()
self.window.show_view(next_view)
if __name__ == "__main__":
main()
| [
11748,
27210,
198,
11748,
27210,
13,
48317,
198,
11748,
6859,
62,
1177,
198,
6738,
1366,
62,
30281,
1330,
6060,
25060,
198,
6738,
27210,
13,
48317,
1330,
471,
3955,
272,
3536,
198,
6738,
38491,
1330,
1635,
628,
198,
11748,
28686,
198,
15908,
3672,
796,
28686,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
8,
198,
16539,
62,
11265,
796,
27210,
13,
2220,
62,
41293,
7,
418,
13,
6978,
13,
22179,
7,
15908,
3672,
11,
705,
17566,
14,
445,
62,
16539,
62,
11265,
13,
11134,
6,
4008,
198,
71,
2557,
62,
41293,
796,
27210,
13,
2220,
62,
41293,
7,
418,
13,
6978,
13,
22179,
7,
15908,
3672,
11,
705,
17566,
14,
445,
62,
16539,
62,
43753,
13,
11134,
6,
4008,
198,
45477,
62,
41293,
796,
27210,
13,
2220,
62,
41293,
7,
418,
13,
6978,
13,
22179,
7,
15908,
3672,
11,
705,
17566,
14,
445,
62,
16539,
62,
8439,
13,
11134,
6,
4008,
628,
198,
4871,
5157,
21864,
7,
5605,
671,
13,
48317,
13,
10080,
5159,
21864,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1649,
28384,
11,
467,
736,
284,
262,
6859,
1570,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
467,
62,
1891,
796,
10352,
628,
198,
4871,
10540,
3526,
7680,
7,
5605,
671,
13,
7680,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
770,
1570,
11298,
2137,
1438,
290,
1366,
6492,
422,
262,
764,
19875,
2393,
357,
8869,
6060,
25060,
737,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
10540,
3526,
7680,
5678,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
2208,
22446,
834,
15003,
834,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
27210,
13,
2617,
62,
25249,
62,
8043,
7,
5605,
671,
13,
8043,
13,
43,
9947,
62,
5603,
8577,
36,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
9019,
62,
37153,
796,
471,
3955,
272,
3536,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
25757,
4847,
543,
481,
651,
12006,
287,
9058,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
1891,
62,
16539,
796,
6045,
628,
220,
220,
220,
825,
9058,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
21394,
510,
3554,
3526,
3159,
351,
25757,
4847,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
9019,
62,
37153,
13,
14225,
469,
62,
9019,
62,
68,
3639,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
736,
4936,
532,
1803,
284,
711,
262,
983,
357,
20123,
274,
257,
649,
1570,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
1891,
62,
16539,
796,
5157,
21864,
7,
16159,
62,
87,
28,
54,
2389,
4221,
1220,
362,
11,
3641,
62,
88,
28,
13909,
9947,
1635,
352,
13,
20,
1220,
838,
11,
3487,
62,
41293,
28,
16539,
62,
11265,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
20599,
62,
41293,
28,
71,
2557,
62,
41293,
11,
1803,
62,
41293,
28,
45477,
62,
41293,
11,
2420,
11639,
7282,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
9019,
62,
37153,
13,
2860,
62,
9019,
62,
30854,
7,
944,
13,
1891,
62,
16539,
8,
628,
220,
220,
220,
825,
319,
62,
19334,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
46722,
262,
3159,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
27210,
13,
9688,
62,
13287,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
27210,
13,
19334,
62,
5239,
7203,
2538,
2885,
1137,
8202,
9795,
1600,
370,
2389,
4221,
1220,
362,
11,
11179,
9947,
1635,
513,
14,
19,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27210,
13,
8043,
13,
9148,
8120,
11,
10369,
62,
7857,
28,
2425,
11,
18021,
62,
87,
2625,
16159,
4943,
628,
220,
220,
220,
220,
220,
220,
220,
27210,
13,
19334,
62,
5239,
7203,
5376,
1600,
370,
2389,
4221,
1220,
718,
11,
11179,
9947,
1635,
513,
1220,
604,
532,
2026,
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,
27210,
13,
8043,
13,
9148,
8120,
11,
10369,
62,
7857,
28,
1238,
11,
18021,
62,
87,
2625,
16159,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
27210,
13,
19334,
62,
5239,
7203,
10430,
1600,
370,
2389,
4221,
1635,
362,
14,
21,
11,
11179,
9947,
1635,
513,
1220,
604,
532,
2026,
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,
27210,
13,
8043,
13,
9148,
8120,
11,
10369,
62,
7857,
28,
1238,
11,
18021,
62,
87,
2625,
16159,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
27210,
13,
19334,
62,
5239,
7203,
29271,
5736,
1600,
370,
2389,
4221,
1635,
513,
13,
16,
14,
21,
11,
11179,
9947,
1635,
513,
1220,
604,
532,
2026,
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,
27210,
13,
8043,
13,
9148,
8120,
11,
10369,
62,
7857,
28,
1238,
11,
18021,
62,
87,
2625,
16159,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
27210,
13,
19334,
62,
5239,
7203,
7575,
1600,
370,
2389,
4221,
1635,
604,
13,
16,
14,
21,
11,
11179,
9947,
1635,
513,
1220,
604,
532,
2026,
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,
27210,
13,
8043,
13,
9148,
8120,
11,
10369,
62,
7857,
28,
1238,
11,
18021,
62,
87,
2625,
16159,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
27210,
13,
19334,
62,
5239,
7203,
26595,
1600,
370,
2389,
4221,
1635,
642,
14,
21,
11,
11179,
9947,
1635,
513,
1220,
604,
532,
2026,
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,
27210,
13,
8043,
13,
9148,
8120,
11,
10369,
62,
7857,
28,
1238,
11,
18021,
62,
87,
2625,
16159,
4943,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
16531,
2137,
1366,
198,
220,
220,
220,
220,
220,
220,
220,
3554,
3526,
62,
7890,
796,
6060,
25060,
13,
1136,
62,
27940,
3526,
62,
7890,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
287,
2837,
7,
11925,
7,
27940,
3526,
62,
7890,
8,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4279,
796,
965,
7,
72,
10,
16,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
1002,
1438,
318,
1165,
1263,
11,
45381,
340,
1262,
705,
986,
6,
357,
68,
13,
70,
13,
14021,
4613,
5278,
75,
23029,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
796,
3554,
3526,
62,
7890,
58,
43027,
7131,
6,
3672,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
796,
1438,
58,
25,
21,
60,
1343,
705,
986,
6,
611,
18896,
7,
3672,
8,
1875,
718,
2073,
1438,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
16531,
262,
1366,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27210,
13,
19334,
62,
5239,
7,
3672,
11,
370,
2389,
4221,
1220,
718,
11,
11179,
9947,
1635,
513,
1220,
604,
532,
2026,
9,
7,
72,
10,
17,
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,
220,
27210,
13,
8043,
13,
9148,
8120,
11,
10369,
62,
7857,
28,
1238,
11,
18021,
62,
87,
2625,
16159,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27210,
13,
19334,
62,
5239,
7,
27940,
3526,
62,
7890,
58,
43027,
7131,
6,
4475,
6,
4357,
370,
2389,
4221,
1635,
362,
1220,
718,
11,
11179,
9947,
1635,
513,
1220,
604,
532,
2026,
9,
7,
72,
10,
17,
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,
220,
27210,
13,
8043,
13,
9148,
8120,
11,
10369,
62,
7857,
28,
1238,
11,
18021,
62,
87,
2625,
16159,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27210,
13,
19334,
62,
5239,
7,
27940,
3526,
62,
7890,
58,
43027,
7131,
6,
27740,
5736,
6,
4357,
370,
2389,
4221,
1635,
513,
13,
16,
1220,
718,
11,
11179,
9947,
1635,
513,
1220,
604,
532,
2026,
9,
7,
72,
10,
17,
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,
220,
27210,
13,
8043,
13,
9148,
8120,
11,
10369,
62,
7857,
28,
1238,
11,
18021,
62,
87,
2625,
16159,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27210,
13,
19334,
62,
5239,
7,
27940,
3526,
62,
7890,
58,
43027,
7131,
6,
2435,
6,
4357,
370,
2389,
4221,
1635,
604,
13,
16,
1220,
718,
11,
11179,
9947,
1635,
513,
1220,
604,
532,
2026,
9,
7,
72,
10,
17,
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,
220,
27210,
13,
8043,
13,
9148,
8120,
11,
10369,
62,
7857,
28,
1238,
11,
18021,
62,
87,
2625,
16159,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27210,
13,
19334,
62,
5239,
7,
27940,
3526,
62,
7890,
58,
43027,
7131,
6,
26675,
6,
4357,
370,
2389,
4221,
1635,
642,
1220,
718,
11,
11179,
9947,
1635,
513,
1220,
604,
532,
2026,
9,
7,
72,
10,
17,
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,
220,
27210,
13,
8043,
13,
9148,
8120,
11,
10369,
62,
7857,
28,
1238,
11,
18021,
62,
87,
2625,
16159,
4943,
628,
220,
220,
220,
825,
319,
62,
12860,
62,
1177,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
5438,
428,
1570,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
40406,
3419,
628,
220,
220,
220,
825,
319,
62,
24717,
62,
1177,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1867,
284,
466,
618,
11816,
428,
1570,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
9019,
62,
37153,
13,
403,
30238,
62,
4993,
8116,
3419,
628,
220,
220,
220,
825,
4296,
7,
944,
11,
25979,
62,
2435,
25,
12178,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
34099,
790,
5739,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
25979,
62,
2435,
25,
25979,
640,
329,
1123,
5739,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13,
1891,
62,
16539,
13,
2188,
62,
1891,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1306,
62,
1177,
796,
6859,
62,
1177,
13,
13383,
23381,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
17497,
13,
12860,
62,
1177,
7,
19545,
62,
1177,
8,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419,
198
] | 2.115714 | 2,100 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Tests for `{{ cookiecutter.package_name }}` package.
"""
from {{ cookiecutter.package_name }} import {{ cookiecutter.package_name }}
class Test{{ cookiecutter.project_name|replace(' ', '')}}(object):
@classmethod
@classmethod
# vim: filetype=python
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
51,
3558,
329,
4600,
27007,
19751,
8968,
353,
13,
26495,
62,
3672,
34949,
63,
5301,
13,
198,
37811,
198,
198,
6738,
22935,
19751,
8968,
353,
13,
26495,
62,
3672,
34949,
1330,
22935,
19751,
8968,
353,
13,
26495,
62,
3672,
34949,
628,
198,
4871,
6208,
27007,
19751,
8968,
353,
13,
16302,
62,
3672,
91,
33491,
10786,
46083,
10148,
8,
11709,
7,
15252,
2599,
628,
220,
220,
220,
2488,
4871,
24396,
628,
220,
220,
220,
2488,
4871,
24396,
198,
198,
2,
43907,
25,
2393,
4906,
28,
29412,
198
] | 2.803571 | 112 |
version = "2018-08-01" | [
9641,
796,
366,
7908,
12,
2919,
12,
486,
1
] | 2.444444 | 9 |
import fs
from .setup import * | [
11748,
43458,
198,
198,
6738,
764,
40406,
1330,
1635
] | 3.444444 | 9 |
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
path('competitions', views.competitions, name='competitions'),
path('athletes', views.athletes, name='athletes'),
path('news', views.news, name='news')
] | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
198,
6738,
764,
1330,
5009,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
10786,
3256,
5009,
13,
9630,
11,
1438,
11639,
9630,
33809,
198,
220,
220,
220,
3108,
10786,
5589,
316,
1756,
3256,
5009,
13,
5589,
316,
1756,
11,
1438,
11639,
5589,
316,
1756,
33809,
198,
220,
220,
220,
3108,
10786,
776,
40676,
3256,
5009,
13,
776,
40676,
11,
1438,
11639,
776,
40676,
33809,
198,
220,
220,
220,
3108,
10786,
10827,
3256,
5009,
13,
10827,
11,
1438,
11639,
10827,
11537,
198,
60
] | 2.873684 | 95 |
##updated api path, engine, top p
##Runs as expected
import os
import sys
API_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..')
sys.path.append(API_PATH)
from api import GPT, Example, UIConfig
# Construct GPT object and show some examples
gpt = GPT(engine="curie-instruct-beta",
temperature=0.5,
top_p=1,
max_tokens=100)
##Generate feature to benefit for product
gpt.add_example(Example("""AirPods Max, Introducing AirPods Max — a perfect balance of exhilarating high-fidelity audio
and the effortless magic of AirPods. The ultimate personal listening experience is here.""",
"""A deeper richer bass, an expansive soundstage, and less distortion make listening to your favorite music with AirPods Max a treat for the ears."""))
gpt.add_example(Example("""AirPods Max, Introducing AirPods Max — a perfect balance of exhilarating high-fidelity audio
and the effortless magic of AirPods. The ultimate personal listening experience is here.""",
"""Experience wireless audio the way it’s meant to be heard with AirPods Max"""))
gpt.add_example(Example("""AirPods Max, Introducing AirPods Max — a perfect balance of exhilarating high-fidelity audio
and the effortless magic of AirPods. The ultimate personal listening experience is here.""",
"""AirPods Max sound better than the original AirPods, feature world-class noise cancellation and come with TrueWireless™ technology."""))
gpt.add_example(Example("""AirPods Max, Introducing AirPods Max — a perfect balance of exhilarating high-fidelity audio
and the effortless magic of AirPods. The ultimate personal listening experience is here.""",
"""Listen to more of your music than ever, in unparalleled quality, with no wires."""))
gpt.add_example(Example("""Bento Lunch Box Container, slim design but it is also more than enough space,
sometimes too much. The biggest plus is that it is BPA free and FDA approved. A huge win when trying to eat clean!""",
"""Perfect size for my two year old. More space than I thought but with a slim design, it doesn’t take up too much room in my diaper bag."""))
gpt.add_example(Example("""Bento Lunch Box Container, slim design but it is also more than enough space,
sometimes too much. The biggest plus is that it is BPA free and FDA approved. A huge win when trying to eat clean!""",
"""If you are a parent you understand how you want the best for your child. The Bento Box is perfect for little hands.
It promotes portion control and healthy eating habits."""))
gpt.add_example(Example("""Bento Lunch Box Container, slim design but it is also more than enough space,
sometimes too much. The biggest plus is that it is BPA free and FDA approved. A huge win when trying to eat clean!""",
"""Because the 3 compartment, 6 separate container is so much bigger, it takes less time to pack the lunchbox up."""))
# Define UI configuration
config = UIConfig(description="Create feature to benefits for your product",
button_text="Create",
placeholder="Enter product description and name")
id = "feature-benefits" | [
2235,
43162,
40391,
3108,
11,
3113,
11,
1353,
279,
220,
198,
2235,
10987,
82,
355,
2938,
220,
198,
11748,
28686,
198,
11748,
25064,
198,
17614,
62,
34219,
796,
28686,
13,
6978,
13,
22179,
7,
418,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
5305,
6978,
7,
834,
7753,
834,
36911,
705,
492,
3256,
705,
492,
11537,
198,
17597,
13,
6978,
13,
33295,
7,
17614,
62,
34219,
8,
198,
198,
6738,
40391,
1330,
402,
11571,
11,
17934,
11,
471,
2149,
261,
5647,
628,
198,
2,
28407,
402,
11571,
2134,
290,
905,
617,
6096,
198,
70,
457,
796,
402,
11571,
7,
18392,
2625,
22019,
494,
12,
259,
7249,
12,
31361,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5951,
28,
15,
13,
20,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1353,
62,
79,
28,
16,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3509,
62,
83,
482,
641,
28,
3064,
8,
628,
198,
198,
2235,
8645,
378,
3895,
284,
4414,
329,
1720,
628,
198,
70,
457,
13,
2860,
62,
20688,
7,
16281,
7203,
15931,
16170,
47,
12978,
5436,
11,
11036,
2259,
3701,
47,
12978,
5436,
851,
257,
2818,
5236,
286,
47029,
803,
1029,
12,
69,
23091,
6597,
220,
198,
392,
262,
3626,
1203,
5536,
286,
3701,
47,
12978,
13,
383,
8713,
2614,
8680,
1998,
318,
994,
32203,
1600,
198,
37811,
32,
9211,
26192,
12702,
11,
281,
31316,
2128,
14247,
11,
290,
1342,
25100,
787,
8680,
284,
534,
4004,
2647,
351,
3701,
47,
12978,
5436,
257,
2190,
329,
262,
11368,
526,
15931,
4008,
198,
198,
70,
457,
13,
2860,
62,
20688,
7,
16281,
7203,
15931,
16170,
47,
12978,
5436,
11,
11036,
2259,
3701,
47,
12978,
5436,
851,
257,
2818,
5236,
286,
47029,
803,
1029,
12,
69,
23091,
6597,
220,
198,
392,
262,
3626,
1203,
5536,
286,
3701,
47,
12978,
13,
383,
8713,
2614,
8680,
1998,
318,
994,
32203,
1600,
198,
37811,
44901,
12521,
6597,
262,
835,
340,
447,
247,
82,
4001,
284,
307,
2982,
351,
3701,
47,
12978,
5436,
37811,
4008,
198,
198,
70,
457,
13,
2860,
62,
20688,
7,
16281,
7203,
15931,
16170,
47,
12978,
5436,
11,
11036,
2259,
3701,
47,
12978,
5436,
851,
257,
2818,
5236,
286,
47029,
803,
1029,
12,
69,
23091,
6597,
220,
198,
392,
262,
3626,
1203,
5536,
286,
3701,
47,
12978,
13,
383,
8713,
2614,
8680,
1998,
318,
994,
32203,
1600,
198,
37811,
16170,
47,
12978,
5436,
2128,
1365,
621,
262,
2656,
3701,
47,
12978,
11,
3895,
995,
12,
4871,
7838,
25395,
290,
1282,
351,
6407,
29451,
1203,
8151,
3037,
526,
15931,
4008,
198,
198,
70,
457,
13,
2860,
62,
20688,
7,
16281,
7203,
15931,
16170,
47,
12978,
5436,
11,
11036,
2259,
3701,
47,
12978,
5436,
851,
257,
2818,
5236,
286,
47029,
803,
1029,
12,
69,
23091,
6597,
220,
198,
392,
262,
3626,
1203,
5536,
286,
3701,
47,
12978,
13,
383,
8713,
2614,
8680,
1998,
318,
994,
32203,
1600,
198,
37811,
23061,
284,
517,
286,
534,
2647,
621,
1683,
11,
287,
39235,
3081,
11,
351,
645,
19474,
526,
15931,
4008,
198,
198,
70,
457,
13,
2860,
62,
20688,
7,
16281,
7203,
15931,
33,
50217,
40514,
8315,
43101,
11,
18862,
1486,
475,
340,
318,
635,
517,
621,
1576,
2272,
11,
220,
198,
29810,
1165,
881,
13,
383,
4094,
5556,
318,
326,
340,
318,
347,
4537,
1479,
290,
14672,
6325,
13,
317,
3236,
1592,
618,
2111,
284,
4483,
3424,
2474,
1,
1600,
198,
37811,
36635,
2546,
329,
616,
734,
614,
1468,
13,
3125,
2272,
621,
314,
1807,
475,
351,
257,
18862,
1486,
11,
340,
1595,
447,
247,
83,
1011,
510,
1165,
881,
2119,
287,
616,
48196,
6131,
526,
15931,
4008,
198,
198,
70,
457,
13,
2860,
62,
20688,
7,
16281,
7203,
15931,
33,
50217,
40514,
8315,
43101,
11,
18862,
1486,
475,
340,
318,
635,
517,
621,
1576,
2272,
11,
220,
198,
29810,
1165,
881,
13,
383,
4094,
5556,
318,
326,
340,
318,
347,
4537,
1479,
290,
14672,
6325,
13,
317,
3236,
1592,
618,
2111,
284,
4483,
3424,
2474,
1,
1600,
198,
37811,
1532,
345,
389,
257,
2560,
345,
1833,
703,
345,
765,
262,
1266,
329,
534,
1200,
13,
383,
20421,
78,
8315,
318,
2818,
329,
1310,
2832,
13,
220,
198,
1026,
21068,
6903,
1630,
290,
5448,
6600,
13870,
526,
15931,
4008,
198,
198,
70,
457,
13,
2860,
62,
20688,
7,
16281,
7203,
15931,
33,
50217,
40514,
8315,
43101,
11,
18862,
1486,
475,
340,
318,
635,
517,
621,
1576,
2272,
11,
220,
198,
29810,
1165,
881,
13,
383,
4094,
5556,
318,
326,
340,
318,
347,
4537,
1479,
290,
14672,
6325,
13,
317,
3236,
1592,
618,
2111,
284,
4483,
3424,
2474,
1,
1600,
198,
37811,
8128,
262,
513,
26247,
11,
718,
4553,
9290,
318,
523,
881,
5749,
11,
340,
2753,
1342,
640,
284,
2353,
262,
9965,
3524,
510,
526,
15931,
4008,
628,
628,
198,
198,
2,
2896,
500,
12454,
8398,
198,
11250,
796,
471,
2149,
261,
5647,
7,
11213,
2625,
16447,
3895,
284,
4034,
329,
534,
1720,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4936,
62,
5239,
2625,
16447,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
46076,
2625,
17469,
1720,
6764,
290,
1438,
4943,
198,
198,
312,
796,
366,
30053,
12,
36934,
896,
1
] | 3.538111 | 879 |
import numpy as np
from random import randint
class Transposon(object):
""" Transposon is our general class used for evolutionary
algorithms applied to vectors"""
def initialize(self):
""" sets up our population and asserts
our fitness func is of correct type
"""
assert self.mutation_rate >= 0.0
assert self.mutation_rate <= 1.0
assert self.fitness_func != None
assert self.winner_pool >= 0.0
assert self.winner_pool <= 1.0
assert self.vector_len >= 0.0
#setup a random vector and assert that our fitness_func is of correct type
random_vector = self.create_vector()
#use our fitness function, assert that the value is correct
fitness = self.fitness_func(random_vector)
assert fitness >= 0.0
#now create our population
population = [random_vector]
for i in range(1,self.population_size):
population.append(self.create_vector())
self.population = population
def create_vector(self, replace=False):
"""
Create a random vector
replace = whether or not we can replace values (default false, ie: each value is unique)
"""
return np.random.choice(self.values, self.vector_len, replace=replace).tolist()
def mutate(self):
""" create mutations randomly based on the mutation rate
preserves winner pool so that the best individuals aren't mutated
"""
if self.mutation_rate == 0:
return
mutated_population = []
for i,individual in enumerate(self.population):
mutation_vec = np.random.choice(2, len(individual), p=[1.0-self.mutation_rate, self.mutation_rate])
combined_vec = []
for i,m in enumerate(mutation_vec):
if m == 1:
#random mutation
rand = randint(self.min_value, self.max_value)
combined_vec.append(rand)
else:
#no mutation
combined_vec.append(individual[i])
mutated_population.append(combined_vec)
#now we preserve our best individuals and drop the last x mutated individuals
num_best = int(self.winner_pool*self.population_size)
self.population = self.population[:num_best] + mutated_population[:len(mutated_population)-num_best]
def transpose(self):
""" Transpose is another mutation function where we mimic actual transposons
moving a random sequence from one location and inserting it into another location"""
pass
def breed(self, replace=True):
""" given the top x percent breed new solutions """
num_breeders = int(self.winner_pool*self.population_size)
breeders = self.population[:num_breeders]
num_children = self.population_size - num_breeders
pairings = np.random.choice(num_breeders, num_children, replace=replace)
children = []
for i,pair in enumerate(pairings):
i1 = int(i%len(breeders))
i2 = int(pair%len(breeders))
parent1 = breeders[i1]
parent2 = breeders[i2]
child_vector = []
#create our vector [0,1,0,0..] which chooses which item to take from each individual
breed_vector = np.random.choice(2, len(breeders[0]))
for i,v in enumerate(breed_vector):
if v == 0:
child_vector.append(parent1[i])
else:
child_vector.append(parent2[i])
children.append(child_vector)
#now create our new population
self.population = self.population[:num_breeders] + children
def evaluate(self):
"""
evaluate the fitness of each individual
sort the individuals by fitness (descending order with most fit first)
if any individual is of max_fitness then return true, else false
"""
scored = []
for individual in self.population:
fitness = self.fitness_func(individual)
scored.append((individual,fitness))
#sort our individuals by fitness (Descending)
sorted_pop = sorted(scored, reverse=True, key=lambda x: x[1])
#sort our population in descending fitness
self.population = [x[0] for x in sorted_pop]
#return just our fitness scores
return [x[1] for x in sorted_pop]
def evolve(self):
""" main for-loop for genetic algorithm"""
for i in range(0,self.max_generations):
pop_fitness = self.evaluate()
if self.verbose == True:
print("Generation: ", i, " Top fitness: ", pop_fitness[0])
if pop_fitness[0] >= self.max_fitness:
return self.population
self.breed()
self.mutate()
#reached max generations without getting a max_fitness
return self.population
| [
11748,
299,
32152,
355,
45941,
198,
6738,
4738,
1330,
43720,
600,
198,
198,
4871,
3602,
1930,
261,
7,
15252,
2599,
198,
197,
37811,
3602,
1930,
261,
318,
674,
2276,
1398,
973,
329,
16673,
220,
198,
197,
282,
7727,
907,
5625,
284,
30104,
37811,
628,
197,
4299,
41216,
7,
944,
2599,
198,
197,
197,
37811,
5621,
510,
674,
3265,
290,
29348,
220,
198,
197,
197,
454,
13547,
25439,
318,
286,
3376,
2099,
198,
197,
197,
37811,
198,
197,
197,
30493,
2116,
13,
76,
7094,
62,
4873,
18189,
657,
13,
15,
198,
197,
197,
30493,
2116,
13,
76,
7094,
62,
4873,
19841,
352,
13,
15,
198,
197,
197,
30493,
2116,
13,
69,
3659,
62,
20786,
14512,
6045,
198,
197,
197,
30493,
2116,
13,
39791,
62,
7742,
18189,
657,
13,
15,
198,
197,
197,
30493,
2116,
13,
39791,
62,
7742,
19841,
352,
13,
15,
198,
197,
197,
30493,
2116,
13,
31364,
62,
11925,
18189,
657,
13,
15,
628,
197,
197,
2,
40406,
257,
4738,
15879,
290,
6818,
326,
674,
13547,
62,
20786,
318,
286,
3376,
2099,
198,
197,
197,
25120,
62,
31364,
796,
2116,
13,
17953,
62,
31364,
3419,
198,
197,
197,
2,
1904,
674,
13547,
2163,
11,
6818,
326,
262,
1988,
318,
3376,
198,
197,
197,
69,
3659,
796,
2116,
13,
69,
3659,
62,
20786,
7,
25120,
62,
31364,
8,
198,
197,
197,
30493,
13547,
18189,
657,
13,
15,
198,
197,
197,
2,
2197,
2251,
674,
3265,
198,
197,
197,
39748,
796,
685,
25120,
62,
31364,
60,
198,
197,
197,
1640,
1312,
287,
2837,
7,
16,
11,
944,
13,
39748,
62,
7857,
2599,
198,
197,
197,
197,
39748,
13,
33295,
7,
944,
13,
17953,
62,
31364,
28955,
198,
197,
197,
944,
13,
39748,
796,
3265,
628,
198,
197,
4299,
2251,
62,
31364,
7,
944,
11,
6330,
28,
25101,
2599,
198,
197,
197,
37811,
198,
197,
197,
16447,
257,
4738,
15879,
198,
197,
197,
33491,
796,
1771,
393,
407,
356,
460,
6330,
3815,
357,
12286,
3991,
11,
37941,
25,
1123,
1988,
318,
3748,
8,
198,
197,
197,
37811,
198,
197,
197,
7783,
45941,
13,
25120,
13,
25541,
7,
944,
13,
27160,
11,
2116,
13,
31364,
62,
11925,
11,
6330,
28,
33491,
737,
83,
349,
396,
3419,
628,
197,
4299,
4517,
378,
7,
944,
2599,
198,
197,
197,
37811,
2251,
23005,
15456,
1912,
319,
262,
15148,
2494,
198,
197,
197,
18302,
11184,
8464,
5933,
523,
326,
262,
1266,
3925,
3588,
470,
48865,
198,
197,
197,
37811,
198,
197,
197,
198,
197,
197,
361,
2116,
13,
76,
7094,
62,
4873,
6624,
657,
25,
198,
197,
197,
197,
7783,
628,
197,
197,
21973,
515,
62,
39748,
796,
17635,
198,
197,
197,
198,
197,
197,
1640,
1312,
11,
43129,
287,
27056,
378,
7,
944,
13,
39748,
2599,
198,
197,
197,
197,
76,
7094,
62,
35138,
796,
45941,
13,
25120,
13,
25541,
7,
17,
11,
18896,
7,
43129,
828,
279,
41888,
16,
13,
15,
12,
944,
13,
76,
7094,
62,
4873,
11,
2116,
13,
76,
7094,
62,
4873,
12962,
198,
197,
197,
197,
24011,
1389,
62,
35138,
796,
17635,
628,
197,
197,
197,
1640,
1312,
11,
76,
287,
27056,
378,
7,
76,
7094,
62,
35138,
2599,
198,
197,
197,
197,
197,
361,
285,
6624,
352,
25,
198,
197,
197,
197,
197,
197,
2,
25120,
15148,
198,
197,
197,
197,
197,
197,
25192,
796,
43720,
600,
7,
944,
13,
1084,
62,
8367,
11,
2116,
13,
9806,
62,
8367,
8,
198,
197,
197,
197,
197,
197,
24011,
1389,
62,
35138,
13,
33295,
7,
25192,
8,
198,
197,
197,
197,
197,
17772,
25,
198,
197,
197,
197,
197,
197,
2,
3919,
15148,
198,
197,
197,
197,
197,
197,
24011,
1389,
62,
35138,
13,
33295,
7,
43129,
58,
72,
12962,
198,
197,
197,
197,
21973,
515,
62,
39748,
13,
33295,
7,
24011,
1389,
62,
35138,
8,
628,
197,
197,
2,
2197,
356,
12201,
674,
1266,
3925,
290,
4268,
262,
938,
2124,
48865,
3925,
198,
197,
197,
22510,
62,
13466,
796,
493,
7,
944,
13,
39791,
62,
7742,
9,
944,
13,
39748,
62,
7857,
8,
198,
197,
197,
944,
13,
39748,
796,
2116,
13,
39748,
58,
25,
22510,
62,
13466,
60,
1343,
48865,
62,
39748,
58,
25,
11925,
7,
21973,
515,
62,
39748,
13219,
22510,
62,
13466,
60,
628,
198,
197,
4299,
1007,
3455,
7,
944,
2599,
198,
197,
197,
37811,
3602,
3455,
318,
1194,
15148,
2163,
810,
356,
26332,
4036,
1007,
1930,
684,
198,
197,
197,
31462,
257,
4738,
8379,
422,
530,
4067,
290,
19319,
340,
656,
1194,
4067,
37811,
198,
197,
197,
6603,
628,
197,
4299,
15939,
7,
944,
11,
6330,
28,
17821,
2599,
198,
197,
197,
37811,
1813,
262,
1353,
2124,
1411,
15939,
649,
8136,
37227,
198,
197,
197,
198,
197,
197,
22510,
62,
4679,
276,
364,
796,
493,
7,
944,
13,
39791,
62,
7742,
9,
944,
13,
39748,
62,
7857,
8,
198,
197,
197,
4679,
276,
364,
796,
2116,
13,
39748,
58,
25,
22510,
62,
4679,
276,
364,
60,
628,
197,
197,
22510,
62,
17197,
796,
2116,
13,
39748,
62,
7857,
532,
997,
62,
4679,
276,
364,
198,
197,
197,
24874,
654,
796,
45941,
13,
25120,
13,
25541,
7,
22510,
62,
4679,
276,
364,
11,
997,
62,
17197,
11,
6330,
28,
33491,
8,
198,
197,
197,
17197,
796,
17635,
628,
197,
197,
1640,
1312,
11,
24874,
287,
27056,
378,
7,
24874,
654,
2599,
198,
197,
197,
197,
72,
16,
796,
493,
7,
72,
4,
11925,
7,
4679,
276,
364,
4008,
198,
197,
197,
197,
72,
17,
796,
493,
7,
24874,
4,
11925,
7,
4679,
276,
364,
4008,
198,
197,
197,
197,
8000,
16,
796,
15939,
364,
58,
72,
16,
60,
198,
197,
197,
197,
8000,
17,
796,
15939,
364,
58,
72,
17,
60,
198,
197,
197,
197,
9410,
62,
31364,
796,
17635,
198,
197,
197,
197,
2,
17953,
674,
15879,
685,
15,
11,
16,
11,
15,
11,
15,
492,
60,
543,
19769,
543,
2378,
284,
1011,
422,
1123,
1981,
198,
197,
197,
197,
4679,
276,
62,
31364,
796,
45941,
13,
25120,
13,
25541,
7,
17,
11,
18896,
7,
4679,
276,
364,
58,
15,
60,
4008,
220,
198,
197,
197,
197,
1640,
1312,
11,
85,
287,
27056,
378,
7,
4679,
276,
62,
31364,
2599,
198,
197,
197,
197,
197,
361,
410,
6624,
657,
25,
198,
197,
197,
197,
197,
197,
9410,
62,
31364,
13,
33295,
7,
8000,
16,
58,
72,
12962,
198,
197,
197,
197,
197,
17772,
25,
198,
197,
197,
197,
197,
197,
9410,
62,
31364,
13,
33295,
7,
8000,
17,
58,
72,
12962,
198,
197,
197,
197,
17197,
13,
33295,
7,
9410,
62,
31364,
8,
198,
197,
197,
2,
2197,
2251,
674,
649,
3265,
198,
197,
197,
944,
13,
39748,
796,
2116,
13,
39748,
58,
25,
22510,
62,
4679,
276,
364,
60,
1343,
1751,
628,
197,
4299,
13446,
7,
944,
2599,
198,
197,
197,
37811,
220,
198,
197,
197,
49786,
262,
13547,
286,
1123,
1981,
198,
197,
197,
30619,
262,
3925,
416,
13547,
357,
20147,
1571,
1502,
351,
749,
4197,
717,
8,
198,
197,
197,
361,
597,
1981,
318,
286,
3509,
62,
69,
3659,
788,
1441,
2081,
11,
2073,
3991,
198,
197,
197,
37811,
198,
197,
197,
1416,
1850,
796,
17635,
198,
197,
197,
1640,
1981,
287,
2116,
13,
39748,
25,
198,
197,
197,
197,
69,
3659,
796,
2116,
13,
69,
3659,
62,
20786,
7,
43129,
8,
198,
197,
197,
197,
1416,
1850,
13,
33295,
19510,
43129,
11,
69,
3659,
4008,
198,
197,
197,
2,
30619,
674,
3925,
416,
13547,
357,
24564,
1571,
8,
198,
197,
197,
82,
9741,
62,
12924,
796,
23243,
7,
1416,
1850,
11,
9575,
28,
17821,
11,
1994,
28,
50033,
2124,
25,
2124,
58,
16,
12962,
628,
197,
197,
2,
30619,
674,
3265,
287,
31491,
13547,
198,
197,
197,
944,
13,
39748,
796,
685,
87,
58,
15,
60,
329,
2124,
287,
23243,
62,
12924,
60,
198,
197,
197,
2,
7783,
655,
674,
13547,
8198,
198,
197,
197,
7783,
685,
87,
58,
16,
60,
329,
2124,
287,
23243,
62,
12924,
60,
628,
197,
4299,
18101,
7,
944,
2599,
198,
197,
197,
37811,
1388,
329,
12,
26268,
329,
8513,
11862,
37811,
198,
197,
197,
1640,
1312,
287,
2837,
7,
15,
11,
944,
13,
9806,
62,
8612,
602,
2599,
198,
197,
197,
197,
12924,
62,
69,
3659,
796,
2116,
13,
49786,
3419,
198,
197,
197,
197,
361,
2116,
13,
19011,
577,
6624,
6407,
25,
198,
197,
197,
197,
197,
4798,
7203,
8645,
341,
25,
33172,
1312,
11,
366,
5849,
13547,
25,
33172,
1461,
62,
69,
3659,
58,
15,
12962,
198,
197,
197,
197,
361,
1461,
62,
69,
3659,
58,
15,
60,
18189,
2116,
13,
9806,
62,
69,
3659,
25,
198,
197,
197,
197,
197,
7783,
2116,
13,
39748,
198,
197,
197,
197,
944,
13,
4679,
276,
3419,
198,
197,
197,
197,
944,
13,
21973,
378,
3419,
198,
197,
197,
2,
260,
2317,
3509,
10439,
1231,
1972,
257,
3509,
62,
69,
3659,
198,
197,
197,
7783,
2116,
13,
39748,
628
] | 2.891929 | 1,462 |
for i in range(int(input())):
solution()
#Author: Dharmik Bhadra | [
220,
220,
220,
220,
201,
198,
1640,
1312,
287,
2837,
7,
600,
7,
15414,
28955,
2599,
201,
198,
220,
220,
220,
4610,
3419,
201,
198,
201,
198,
2,
13838,
25,
20529,
1670,
1134,
16581,
49456
] | 2.228571 | 35 |
# -*- coding: utf-8 -*-
from math import sqrt
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
10688,
1330,
19862,
17034,
628
] | 2.35 | 20 |
# coding: utf-8
from builtins import object
import time
import threading
from xTool.compat import PY3
if PY3:
from threading import BoundedSemaphore
else:
from threading import _BoundedSemaphore as BoundedSemaphore
class BoundedEmptySemaphore(BoundedSemaphore):
"""
A bounded semaphore that is initially empty.
"""
class GlobalThrottle(object):
"""一个线程安全的全局限速器,用于访问全局资源;可以应用到所有的线程上。
也可以认为是一个令牌桶算法,BoundedEmptySemaphore就是一个令牌桶。
A thread-safe rate limiter that throttles all threads globally. This should be used to
regulate access to a global resource. It can be used as a function/method decorator or as a
simple object, using the throttle() method. The token generation starts with the first call
to throttle() or the decorated function. Each subsequent call to throttle() will then acquire
a token, possibly having to wait until one becomes available. The number of unused tokens
will not exceed a limit given at construction time. This is a very basic mechanism to
prevent the resource from becoming swamped after longer pauses.
"""
def __init__(self, min_interval, max_unused):
"""
:param min_interval: 资源探测的间隔时间,也即令牌的生成间隔
:param max_unused: 信号量的大小,即资源的数量,也即令牌的数量
"""
# 线程的间隔时间
self.min_interval = min_interval
# 创建信号量,并调用acquire使其内部计数器等于0,阻塞进程
self.semaphore = BoundedEmptySemaphore(max_unused)
# 创建线程锁
self.thread_start_lock = threading.Lock()
# 默认不启动线程
self.thread_started = False
# 创建线程
self.thread = threading.Thread(target=self.generator)
# 主线程结束时,子线程也随之结束
self.thread.daemon = True
def throttle(self, wait=True):
"""
If the wait parameter is True, this method returns True after suspending the current
thread as necessary to ensure that no less than the configured minimum interval passed
since the most recent time an invocation of this method returned True in any thread.
If the wait parameter is False, this method immediatly returns True if at least the
configured minimum interval has passed since the most recent time this method returned
True in any thread, or False otherwise.
"""
# I think there is a race in Thread.start(), hence the lock
with self.thread_start_lock:
# 启动子线程,不停地释放信号量
if not self.thread_started:
self.thread.start()
self.thread_started = True
# 新请求来临时,会各自拿走一个Token, 如果没有Token可拿了就阻塞或者拒绝服务.
return self.semaphore.acquire(blocking=wait)
class LocalThrottle(object):
"""一个线程安全的单个线程限速器,在指定时间间隔后才会运行
A thread-safe rate limiter that throttles each thread independently. Can be used as a
function or method decorator or as a simple object, via its .throttle() method.
The use as a decorator is deprecated in favor of throttle().
"""
def __init__(self, min_interval):
"""
Initialize this local throttle.
:param min_interval: The minimum interval in seconds between invocations of the throttle
method or, if this throttle is used as a decorator, invocations of the decorated method.
"""
self.min_interval = min_interval
# 线程局部变量
self.per_thread = threading.local()
self.per_thread.last_invocation = None
def throttle(self, wait=True):
"""
If the wait parameter is True, this method returns True after suspending the current
thread as necessary to ensure that no less than the configured minimum interval has
passed since the last invocation of this method in the current thread returned True.
If the wait parameter is False, this method immediatly returns True (if at least the
configured minimum interval has passed since the last time this method returned True in
the current thread) or False otherwise.
"""
now = time.time()
last_invocation = self.per_thread.last_invocation
if last_invocation is not None:
# 计算时间过了多久
interval = now - last_invocation
# 时间未过期,继续等待;到期后执行函数
if interval < self.min_interval:
if wait:
remainder = self.min_interval - interval
time.sleep(remainder)
else:
return False
self.per_thread.last_invocation = time.time()
return True
class throttle(object): # pylint: disable=invalid-name
"""在函数执行之后等待,直到超时;如果有异常不等待
A context manager for ensuring that the execution of its body takes at least a given amount
of time, sleeping if necessary. It is a simpler version of LocalThrottle if used as a
decorator.
Ensures that body takes at least the given amount of time.
"""
| [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
6738,
3170,
1040,
1330,
2134,
198,
11748,
640,
198,
11748,
4704,
278,
198,
6738,
2124,
25391,
13,
5589,
265,
1330,
350,
56,
18,
198,
198,
361,
350,
56,
18,
25,
198,
220,
220,
220,
422,
4704,
278,
1330,
347,
6302,
13900,
6570,
382,
198,
17772,
25,
198,
220,
220,
220,
422,
4704,
278,
1330,
4808,
33,
6302,
13900,
6570,
382,
355,
347,
6302,
13900,
6570,
382,
628,
198,
4871,
347,
6302,
40613,
13900,
6570,
382,
7,
33,
6302,
13900,
6570,
382,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
317,
49948,
5026,
6570,
382,
326,
318,
7317,
6565,
13,
198,
220,
220,
220,
37227,
628,
198,
4871,
8060,
817,
305,
23296,
7,
15252,
2599,
198,
220,
220,
220,
37227,
31660,
10310,
103,
163,
118,
123,
163,
101,
233,
22522,
231,
17739,
101,
21410,
17739,
101,
161,
109,
222,
165,
247,
238,
34460,
253,
161,
247,
101,
171,
120,
234,
18796,
101,
12859,
236,
164,
106,
123,
29785,
106,
17739,
101,
161,
109,
222,
164,
113,
226,
162,
118,
238,
171,
120,
249,
20998,
107,
20015,
98,
41753,
242,
18796,
101,
26344,
108,
33699,
222,
17312,
231,
21410,
163,
118,
123,
163,
101,
233,
41468,
16764,
628,
220,
220,
220,
220,
20046,
253,
20998,
107,
20015,
98,
164,
106,
97,
10310,
118,
42468,
31660,
10310,
103,
20015,
97,
31965,
234,
162,
94,
114,
163,
106,
245,
37345,
243,
171,
120,
234,
33,
6302,
40613,
13900,
6570,
382,
22887,
109,
42468,
31660,
10310,
103,
20015,
97,
31965,
234,
162,
94,
114,
16764,
628,
220,
220,
220,
317,
4704,
12,
21230,
2494,
1761,
2676,
326,
46692,
829,
477,
14390,
18309,
13,
770,
815,
307,
973,
284,
198,
220,
220,
220,
16697,
1895,
284,
257,
3298,
8271,
13,
632,
460,
307,
973,
355,
257,
2163,
14,
24396,
11705,
1352,
393,
355,
257,
198,
220,
220,
220,
2829,
2134,
11,
1262,
262,
29976,
3419,
2446,
13,
383,
11241,
5270,
4940,
351,
262,
717,
869,
198,
220,
220,
220,
284,
29976,
3419,
393,
262,
24789,
2163,
13,
5501,
8840,
869,
284,
29976,
3419,
481,
788,
12831,
198,
220,
220,
220,
257,
11241,
11,
5457,
1719,
284,
4043,
1566,
530,
4329,
1695,
13,
383,
1271,
286,
21958,
16326,
198,
220,
220,
220,
481,
407,
7074,
257,
4179,
1813,
379,
5103,
640,
13,
770,
318,
257,
845,
4096,
9030,
284,
198,
220,
220,
220,
2948,
262,
8271,
422,
5033,
1509,
13322,
706,
2392,
37622,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
949,
62,
3849,
2100,
11,
3509,
62,
403,
1484,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
949,
62,
3849,
2100,
25,
5525,
113,
226,
162,
118,
238,
162,
236,
95,
38184,
233,
21410,
29785,
112,
49694,
242,
33768,
114,
29785,
112,
171,
120,
234,
20046,
253,
39355,
111,
20015,
97,
31965,
234,
21410,
37955,
22755,
238,
29785,
112,
49694,
242,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
3509,
62,
403,
1484,
25,
220,
46479,
94,
20998,
115,
34932,
237,
21410,
32014,
22887,
237,
171,
120,
234,
39355,
111,
164,
113,
226,
162,
118,
238,
21410,
46763,
108,
34932,
237,
171,
120,
234,
20046,
253,
39355,
111,
20015,
97,
31965,
234,
21410,
46763,
108,
34932,
237,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
13328,
118,
123,
163,
101,
233,
21410,
29785,
112,
49694,
242,
33768,
114,
29785,
112,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
1084,
62,
3849,
2100,
796,
949,
62,
3849,
2100,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
10263,
230,
249,
161,
119,
118,
46479,
94,
20998,
115,
34932,
237,
171,
120,
234,
33176,
114,
164,
108,
225,
18796,
101,
330,
29782,
45635,
17739,
114,
37863,
227,
32849,
101,
164,
106,
94,
46763,
108,
161,
247,
101,
163,
255,
231,
12859,
236,
15,
171,
120,
234,
165,
246,
119,
161,
94,
252,
32573,
249,
163,
101,
233,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
43616,
6570,
382,
796,
347,
6302,
40613,
13900,
6570,
382,
7,
9806,
62,
403,
1484,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
10263,
230,
249,
161,
119,
118,
163,
118,
123,
163,
101,
233,
165,
242,
223,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
16663,
62,
9688,
62,
5354,
796,
4704,
278,
13,
25392,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
16268,
119,
246,
164,
106,
97,
38834,
28938,
107,
27950,
101,
163,
118,
123,
163,
101,
233,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
16663,
62,
46981,
796,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
10263,
230,
249,
161,
119,
118,
163,
118,
123,
163,
101,
233,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
16663,
796,
4704,
278,
13,
16818,
7,
16793,
28,
944,
13,
8612,
1352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
220,
10310,
119,
163,
118,
123,
163,
101,
233,
163,
119,
241,
30266,
253,
33768,
114,
171,
120,
234,
36310,
163,
118,
123,
163,
101,
233,
20046,
253,
49694,
237,
45298,
163,
119,
241,
30266,
253,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
16663,
13,
6814,
7966,
796,
6407,
628,
220,
220,
220,
825,
29976,
7,
944,
11,
4043,
28,
17821,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1002,
262,
4043,
11507,
318,
6407,
11,
428,
2446,
5860,
6407,
706,
47499,
262,
1459,
198,
220,
220,
220,
220,
220,
220,
220,
4704,
355,
3306,
284,
4155,
326,
645,
1342,
621,
262,
17839,
5288,
16654,
3804,
198,
220,
220,
220,
220,
220,
220,
220,
1201,
262,
749,
2274,
640,
281,
43219,
286,
428,
2446,
4504,
6407,
287,
597,
4704,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1002,
262,
4043,
11507,
318,
10352,
11,
428,
2446,
2729,
265,
306,
5860,
6407,
611,
379,
1551,
262,
198,
220,
220,
220,
220,
220,
220,
220,
17839,
5288,
16654,
468,
3804,
1201,
262,
749,
2274,
640,
428,
2446,
4504,
198,
220,
220,
220,
220,
220,
220,
220,
6407,
287,
597,
4704,
11,
393,
10352,
4306,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
314,
892,
612,
318,
257,
3234,
287,
14122,
13,
9688,
22784,
12891,
262,
5793,
198,
220,
220,
220,
220,
220,
220,
220,
351,
2116,
13,
16663,
62,
9688,
62,
5354,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
10263,
238,
107,
27950,
101,
36310,
163,
118,
123,
163,
101,
233,
171,
120,
234,
38834,
161,
223,
250,
28839,
108,
34932,
232,
162,
242,
122,
46479,
94,
20998,
115,
34932,
237,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
407,
2116,
13,
16663,
62,
46981,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
16663,
13,
9688,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
16663,
62,
46981,
796,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
10545,
244,
108,
46237,
115,
162,
109,
224,
30266,
98,
10310,
112,
33768,
114,
11,
27670,
248,
28938,
226,
164,
229,
103,
162,
233,
123,
164,
113,
108,
31660,
10310,
103,
30642,
11,
10263,
99,
224,
162,
252,
250,
162,
110,
94,
17312,
231,
30642,
20998,
107,
162,
233,
123,
12859,
228,
22887,
109,
165,
246,
119,
161,
94,
252,
22755,
244,
38519,
162,
233,
240,
163,
119,
251,
17312,
235,
27950,
94,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
43616,
6570,
382,
13,
330,
29782,
7,
41938,
28,
17077,
8,
628,
198,
4871,
10714,
817,
305,
23296,
7,
15252,
2599,
198,
220,
220,
220,
37227,
31660,
10310,
103,
163,
118,
123,
163,
101,
233,
22522,
231,
17739,
101,
21410,
39355,
243,
10310,
103,
163,
118,
123,
163,
101,
233,
165,
247,
238,
34460,
253,
161,
247,
101,
171,
120,
234,
28839,
101,
162,
234,
229,
22522,
248,
33768,
114,
29785,
112,
29785,
112,
49694,
242,
28938,
236,
33699,
235,
27670,
248,
32573,
238,
26193,
234,
198,
220,
220,
220,
317,
4704,
12,
21230,
2494,
1761,
2676,
326,
46692,
829,
1123,
4704,
14799,
13,
1680,
307,
973,
355,
257,
198,
220,
220,
220,
2163,
393,
2446,
11705,
1352,
393,
355,
257,
2829,
2134,
11,
2884,
663,
764,
26110,
23296,
3419,
2446,
13,
628,
220,
220,
220,
383,
779,
355,
257,
11705,
1352,
318,
39224,
287,
2661,
286,
29976,
22446,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
949,
62,
3849,
2100,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
20768,
1096,
428,
1957,
29976,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
949,
62,
3849,
2100,
25,
383,
5288,
16654,
287,
4201,
1022,
800,
20968,
286,
262,
29976,
198,
220,
220,
220,
220,
220,
220,
220,
2446,
393,
11,
611,
428,
29976,
318,
973,
355,
257,
11705,
1352,
11,
800,
20968,
286,
262,
24789,
2446,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
1084,
62,
3849,
2100,
796,
949,
62,
3849,
2100,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
13328,
118,
123,
163,
101,
233,
161,
109,
222,
32849,
101,
20998,
246,
34932,
237,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
525,
62,
16663,
796,
4704,
278,
13,
12001,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
525,
62,
16663,
13,
12957,
62,
16340,
5040,
796,
6045,
628,
220,
220,
220,
825,
29976,
7,
944,
11,
4043,
28,
17821,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1002,
262,
4043,
11507,
318,
6407,
11,
428,
2446,
5860,
6407,
706,
47499,
262,
1459,
198,
220,
220,
220,
220,
220,
220,
220,
4704,
355,
3306,
284,
4155,
326,
645,
1342,
621,
262,
17839,
5288,
16654,
468,
198,
220,
220,
220,
220,
220,
220,
220,
3804,
1201,
262,
938,
43219,
286,
428,
2446,
287,
262,
1459,
4704,
4504,
6407,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1002,
262,
4043,
11507,
318,
10352,
11,
428,
2446,
2729,
265,
306,
5860,
6407,
357,
361,
379,
1551,
262,
198,
220,
220,
220,
220,
220,
220,
220,
17839,
5288,
16654,
468,
3804,
1201,
262,
938,
640,
428,
2446,
4504,
6407,
287,
198,
220,
220,
220,
220,
220,
220,
220,
262,
1459,
4704,
8,
393,
10352,
4306,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
783,
796,
640,
13,
2435,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
938,
62,
16340,
5040,
796,
2116,
13,
525,
62,
16663,
13,
12957,
62,
16340,
5040,
198,
220,
220,
220,
220,
220,
220,
220,
611,
938,
62,
16340,
5040,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
5525,
106,
94,
163,
106,
245,
33768,
114,
29785,
112,
32573,
229,
12859,
228,
13783,
248,
20046,
227,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16654,
796,
783,
532,
938,
62,
16340,
5040,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
10545,
245,
114,
29785,
112,
17312,
103,
32573,
229,
17312,
253,
171,
120,
234,
163,
119,
100,
163,
119,
255,
163,
255,
231,
36181,
227,
171,
120,
249,
26344,
108,
17312,
253,
28938,
236,
33699,
100,
26193,
234,
49035,
121,
46763,
108,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
16654,
1279,
2116,
13,
1084,
62,
3849,
2100,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
4043,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17675,
796,
2116,
13,
1084,
62,
3849,
2100,
532,
16654,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
640,
13,
42832,
7,
2787,
391,
1082,
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,
1441,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
525,
62,
16663,
13,
12957,
62,
16340,
5040,
796,
640,
13,
2435,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
6407,
628,
198,
4871,
29976,
7,
15252,
2599,
220,
1303,
279,
2645,
600,
25,
15560,
28,
259,
12102,
12,
3672,
198,
220,
220,
220,
37227,
28839,
101,
49035,
121,
46763,
108,
33699,
100,
26193,
234,
45298,
28938,
236,
163,
255,
231,
36181,
227,
171,
120,
234,
33566,
112,
26344,
108,
164,
41678,
33768,
114,
171,
120,
249,
36685,
224,
162,
252,
250,
17312,
231,
28156,
224,
30585,
116,
38834,
163,
255,
231,
36181,
227,
198,
220,
220,
220,
317,
4732,
4706,
329,
13359,
326,
262,
9706,
286,
663,
1767,
2753,
379,
1551,
257,
1813,
2033,
198,
220,
220,
220,
286,
640,
11,
11029,
611,
3306,
13,
632,
318,
257,
18599,
2196,
286,
10714,
817,
305,
23296,
611,
973,
355,
257,
198,
220,
220,
220,
11705,
1352,
13,
628,
220,
220,
220,
48221,
942,
326,
1767,
2753,
379,
1551,
262,
1813,
2033,
286,
640,
13,
198,
220,
220,
220,
37227,
198
] | 2.126532 | 2,284 |
import asyncio
import glob as _glob
import itertools as _iter
import pathlib as _path
import random as _rand
import functools
from pyperator import IP
from pyperator.nodes import Component
from pyperator.utils import InputPort, OutputPort, FilePort
from pyperator.decorators import log_schedule, component, inport, outport
class GeneratorSource(Component):
"""
This is a component that returns a single element from a generator
passed at initalization time to 'gen'
to a single output 'OUT'
"""
@log_schedule
class FormatString(Component):
"""
This component formats
a string "{}" given on
the port "pattern"
the values of the input packets
and sends it to "OUT"
"""
class GlobSource(Component):
"""
This is a component that emits Packets
according to a glob pattern specified
when the component is initialized
"""
@log_schedule
class Product(Component):
"""
This component generates the
cartesian product of the packets incoming from each ports and
then sends them to the output port `OUT` as bracket IPs.
Alternatively, by providing a function `fun` to the constructor, another
combinatorial function can be used to generate the packets.
"""
@log_schedule
class FileListSource(Component):
"""
This is a component that emits InformationPackets
from a list of files
"""
@log_schedule
class ReplacePath(Component):
"""
This is a component that emits InformationPackets
with a path obtained by replacing the input path
"""
@log_schedule
class Split(Component):
"""
This component splits the input tuple into
separate ouputs; the number of elements is given
with `n_outs`
"""
@log_schedule
# class IterSource(Component):
# """
# This component returns a Bracket IP
# from a itertool function such as product
# """
#
# def __init__(self, name, *generators, function=_iter.combinations):
# super(IterSource, self).__init__(name)
# self.generators = generators
# self.outputs.add(OutputPort('OUT'))
# self.function = function
#
# @log_schedule
# async def __call__(self):
# for items in self.function(*self.generators):
# open = IP.OpenBracket()
# await self.outputs.OUT.send_packet(open)
# for item in items:
# packet = IP.InformationPacket(item)
# await self.outputs.OUT.send_packet(packet)
# await self.outputs.OUT.send_packet(IP.CloseBracket())
# await asyncio.sleep(0)
# await self.close_downstream()
class ConstantSource(Component):
"""
This is a component that continously outputs a constant to
the output 'OUT', up to to :repeat: times, infinitely if :repeat: is none
The constant is given to the 'constant' port
"""
@log_schedule
class Repeat(Component):
"""
This component receives
from his input once only
and keeps on repeating
it on the output
"""
class Filter(Component):
"""
This component filters the input in 'IN' according to the given predicate in the port 'predicate'
and sends it to the output 'OUT' if the predicate is true
"""
@log_schedule
class BroadcastApplyFunction(Component):
"""
This component computes a function of the inputs
and sends it to all outputs
"""
@log_schedule
class OneOffProcess(BroadcastApplyFunction):
"""
This class awaits the upstream process once and then keeps on
broadcasting the result to the outputs
"""
@log_schedule
@outport('OUT')
@inport('IN')
@component
async def Once(self):
"""
This component
receives from `IN` once and sends
the result to `OUT`. Afterwards, it closes
:param self:
:return:
"""
in_packet = await self.inputs.IN.receive_packet()
await self.outputs.OUT.send_packet(in_packet.copy())
self.inputs.IN.close()
@inport("IN")#: inputs :
@outport("OUT")
@component
async def Repeat(self):
"""
This component receives from `IN` once
and repeats it to `OUT` forever
:param self:
:return:
"""
in_packet= await self.inputs.IN.receive_packet()
async with self.outputs.OUT as out:
while True:
await out.send_packet(in_packet.copy())
await asyncio.sleep(0)
@inport('IN')
@outport('count')
@inport('reset', optional=True)
@component
async def Count(self):
"""
This component receives packets from `IN`
and keeps a count that will be continously
sent to `count`
:param self:
:return:
"""
count = 0
reset = False
async with self.outputs.count as out:
while True:
pack = await self.inputs.IN.receive_packet()
count += 1
reset = await self.inputs.reset.receive()
if reset:
count = 0
await self.outputs.count.send(count)
await asyncio.sleep(0)
@outport('OUT')
@component
async def WaitRandom(self):
"""
This component randomly sends
an empty packets after having waited for
a random amount of time
:param self:
:return:
"""
async with self.outputs.OUT as out:
while True:
waiting_time = _rand.uniform(0,3)
self.log.debug('Will wait for {} '.format(waiting_time))
await asyncio.sleep(waiting_time)
await self.outputs.OUT.send(True)
await asyncio.sleep(0) | [
11748,
30351,
952,
198,
11748,
15095,
355,
4808,
4743,
672,
198,
11748,
340,
861,
10141,
355,
4808,
2676,
198,
11748,
3108,
8019,
355,
4808,
6978,
198,
11748,
4738,
355,
4808,
25192,
198,
198,
11748,
1257,
310,
10141,
198,
198,
6738,
12972,
525,
1352,
1330,
6101,
198,
6738,
12972,
525,
1352,
13,
77,
4147,
1330,
35100,
198,
6738,
12972,
525,
1352,
13,
26791,
1330,
23412,
13924,
11,
25235,
13924,
11,
9220,
13924,
198,
6738,
12972,
525,
1352,
13,
12501,
273,
2024,
1330,
2604,
62,
15952,
5950,
11,
7515,
11,
287,
634,
11,
503,
634,
628,
198,
4871,
35986,
7416,
7,
21950,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
770,
318,
257,
7515,
326,
5860,
257,
2060,
5002,
422,
257,
17301,
198,
220,
220,
220,
3804,
379,
287,
1287,
1634,
640,
284,
705,
5235,
6,
198,
220,
220,
220,
284,
257,
2060,
5072,
705,
12425,
6,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
2488,
6404,
62,
15952,
5950,
198,
198,
4871,
18980,
10100,
7,
21950,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
770,
7515,
17519,
198,
220,
220,
220,
257,
4731,
45144,
36786,
1813,
319,
198,
220,
220,
220,
262,
2493,
366,
33279,
1,
198,
220,
220,
220,
262,
3815,
286,
262,
5128,
24624,
198,
220,
220,
220,
290,
12800,
340,
284,
366,
12425,
1,
198,
220,
220,
220,
37227,
628,
198,
4871,
40713,
7416,
7,
21950,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
770,
318,
257,
7515,
326,
48300,
6400,
1039,
198,
220,
220,
220,
1864,
284,
257,
15095,
3912,
7368,
198,
220,
220,
220,
618,
262,
7515,
318,
23224,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
2488,
6404,
62,
15952,
5950,
628,
198,
4871,
8721,
7,
21950,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
770,
7515,
18616,
262,
198,
220,
220,
220,
6383,
35610,
1720,
286,
262,
24624,
15619,
422,
1123,
14090,
290,
198,
220,
220,
220,
788,
12800,
606,
284,
262,
5072,
2493,
4600,
12425,
63,
355,
19096,
6101,
82,
13,
198,
220,
220,
220,
25929,
11,
416,
4955,
257,
2163,
4600,
12543,
63,
284,
262,
23772,
11,
1194,
198,
220,
220,
220,
1974,
20900,
498,
2163,
460,
307,
973,
284,
7716,
262,
24624,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
2488,
6404,
62,
15952,
5950,
628,
198,
4871,
9220,
8053,
7416,
7,
21950,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
770,
318,
257,
7515,
326,
48300,
6188,
11869,
1039,
198,
220,
220,
220,
422,
257,
1351,
286,
3696,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
2488,
6404,
62,
15952,
5950,
628,
198,
4871,
40177,
15235,
7,
21950,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
770,
318,
257,
7515,
326,
48300,
6188,
11869,
1039,
198,
220,
220,
220,
351,
257,
3108,
6492,
416,
13586,
262,
5128,
3108,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
2488,
6404,
62,
15952,
5950,
628,
198,
4871,
27758,
7,
21950,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
770,
7515,
30778,
262,
5128,
46545,
656,
198,
220,
220,
220,
4553,
267,
929,
5500,
26,
262,
1271,
286,
4847,
318,
1813,
198,
220,
220,
220,
351,
4600,
77,
62,
5269,
63,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
2488,
6404,
62,
15952,
5950,
628,
198,
2,
1398,
40806,
7416,
7,
21950,
2599,
198,
2,
220,
220,
220,
220,
37227,
198,
2,
220,
220,
220,
220,
770,
7515,
5860,
257,
1709,
8317,
6101,
198,
2,
220,
220,
220,
220,
422,
257,
340,
861,
970,
2163,
884,
355,
1720,
198,
2,
220,
220,
220,
220,
37227,
198,
2,
198,
2,
220,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
1438,
11,
1635,
8612,
2024,
11,
2163,
28,
62,
2676,
13,
24011,
7352,
2599,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
2208,
7,
29993,
7416,
11,
2116,
737,
834,
15003,
834,
7,
3672,
8,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
8612,
2024,
796,
27298,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
22915,
82,
13,
2860,
7,
26410,
13924,
10786,
12425,
6,
4008,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
8818,
796,
2163,
198,
2,
198,
2,
220,
220,
220,
220,
2488,
6404,
62,
15952,
5950,
198,
2,
220,
220,
220,
220,
30351,
825,
11593,
13345,
834,
7,
944,
2599,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
329,
3709,
287,
2116,
13,
8818,
46491,
944,
13,
8612,
2024,
2599,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1280,
796,
6101,
13,
11505,
9414,
8317,
3419,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25507,
2116,
13,
22915,
82,
13,
12425,
13,
21280,
62,
8002,
316,
7,
9654,
8,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
2378,
287,
3709,
25,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
19638,
796,
6101,
13,
21918,
47,
8317,
7,
9186,
8,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25507,
2116,
13,
22915,
82,
13,
12425,
13,
21280,
62,
8002,
316,
7,
8002,
316,
8,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25507,
2116,
13,
22915,
82,
13,
12425,
13,
21280,
62,
8002,
316,
7,
4061,
13,
26125,
9414,
8317,
28955,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
25507,
30351,
952,
13,
42832,
7,
15,
8,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
25507,
2116,
13,
19836,
62,
2902,
5532,
3419,
628,
198,
4871,
20217,
7416,
7,
21950,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
770,
318,
257,
7515,
326,
1261,
3481,
23862,
257,
6937,
284,
198,
220,
220,
220,
262,
5072,
705,
12425,
3256,
510,
284,
284,
1058,
44754,
25,
1661,
11,
32264,
611,
1058,
44754,
25,
318,
4844,
198,
220,
220,
220,
383,
6937,
318,
1813,
284,
262,
705,
9979,
415,
6,
2493,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
2488,
6404,
62,
15952,
5950,
628,
198,
4871,
30021,
7,
21950,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
770,
7515,
11583,
198,
220,
220,
220,
422,
465,
5128,
1752,
691,
198,
220,
220,
220,
290,
7622,
319,
20394,
198,
220,
220,
220,
340,
319,
262,
5072,
198,
220,
220,
220,
37227,
628,
198,
4871,
25853,
7,
21950,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
770,
7515,
16628,
262,
5128,
287,
705,
1268,
6,
1864,
284,
262,
1813,
44010,
287,
262,
2493,
705,
28764,
5344,
6,
198,
220,
220,
220,
290,
12800,
340,
284,
262,
5072,
705,
12425,
6,
611,
262,
44010,
318,
2081,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
2488,
6404,
62,
15952,
5950,
628,
198,
198,
4871,
44244,
44836,
22203,
7,
21950,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
770,
7515,
552,
1769,
257,
2163,
286,
262,
17311,
198,
220,
220,
220,
290,
12800,
340,
284,
477,
23862,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
2488,
6404,
62,
15952,
5950,
628,
198,
4871,
1881,
9362,
18709,
7,
30507,
2701,
44836,
22203,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
770,
1398,
37180,
262,
28717,
1429,
1752,
290,
788,
7622,
319,
198,
220,
220,
220,
22978,
262,
1255,
284,
262,
23862,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
2488,
6404,
62,
15952,
5950,
628,
198,
31,
448,
634,
10786,
12425,
11537,
198,
31,
259,
634,
10786,
1268,
11537,
198,
31,
42895,
198,
292,
13361,
825,
4874,
7,
944,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
770,
7515,
220,
198,
220,
220,
220,
11583,
422,
4600,
1268,
63,
1752,
290,
12800,
198,
220,
220,
220,
262,
1255,
284,
4600,
12425,
44646,
39063,
11,
340,
20612,
198,
220,
220,
220,
1058,
17143,
2116,
25,
220,
198,
220,
220,
220,
1058,
7783,
25,
220,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
287,
62,
8002,
316,
796,
25507,
2116,
13,
15414,
82,
13,
1268,
13,
260,
15164,
62,
8002,
316,
3419,
198,
220,
220,
220,
25507,
2116,
13,
22915,
82,
13,
12425,
13,
21280,
62,
8002,
316,
7,
259,
62,
8002,
316,
13,
30073,
28955,
198,
220,
220,
220,
2116,
13,
15414,
82,
13,
1268,
13,
19836,
3419,
628,
198,
31,
259,
634,
7203,
1268,
4943,
2,
25,
17311,
1058,
198,
31,
448,
634,
7203,
12425,
4943,
198,
31,
42895,
198,
292,
13361,
825,
30021,
7,
944,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
770,
7515,
11583,
422,
4600,
1268,
63,
1752,
198,
220,
220,
220,
290,
29819,
340,
284,
4600,
12425,
63,
8097,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1058,
17143,
2116,
25,
220,
198,
220,
220,
220,
1058,
7783,
25,
220,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
287,
62,
8002,
316,
28,
25507,
2116,
13,
15414,
82,
13,
1268,
13,
260,
15164,
62,
8002,
316,
3419,
198,
220,
220,
220,
30351,
351,
2116,
13,
22915,
82,
13,
12425,
355,
503,
25,
198,
220,
220,
220,
220,
220,
220,
220,
981,
6407,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25507,
503,
13,
21280,
62,
8002,
316,
7,
259,
62,
8002,
316,
13,
30073,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25507,
30351,
952,
13,
42832,
7,
15,
8,
628,
198,
31,
259,
634,
10786,
1268,
11537,
198,
31,
448,
634,
10786,
9127,
11537,
198,
31,
259,
634,
10786,
42503,
3256,
11902,
28,
17821,
8,
198,
31,
42895,
198,
292,
13361,
825,
2764,
7,
944,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
770,
7515,
11583,
24624,
422,
4600,
1268,
63,
220,
198,
220,
220,
220,
290,
7622,
257,
954,
326,
481,
307,
1261,
3481,
198,
220,
220,
220,
1908,
284,
4600,
9127,
63,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1058,
17143,
2116,
25,
220,
198,
220,
220,
220,
1058,
7783,
25,
220,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
954,
796,
657,
198,
220,
220,
220,
13259,
796,
10352,
198,
220,
220,
220,
30351,
351,
2116,
13,
22915,
82,
13,
9127,
355,
503,
25,
198,
220,
220,
220,
220,
220,
220,
220,
981,
6407,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2353,
796,
25507,
2116,
13,
15414,
82,
13,
1268,
13,
260,
15164,
62,
8002,
316,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
954,
15853,
352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13259,
796,
25507,
2116,
13,
15414,
82,
13,
42503,
13,
260,
15164,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
13259,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
954,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25507,
2116,
13,
22915,
82,
13,
9127,
13,
21280,
7,
9127,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25507,
30351,
952,
13,
42832,
7,
15,
8,
198,
198,
31,
448,
634,
10786,
12425,
11537,
198,
31,
42895,
198,
292,
13361,
825,
16314,
29531,
7,
944,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
770,
7515,
15456,
12800,
220,
198,
220,
220,
220,
281,
6565,
24624,
706,
1719,
13488,
329,
198,
220,
220,
220,
257,
4738,
2033,
286,
640,
198,
220,
220,
220,
1058,
17143,
2116,
25,
220,
198,
220,
220,
220,
1058,
7783,
25,
220,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
30351,
351,
2116,
13,
22915,
82,
13,
12425,
355,
503,
25,
198,
220,
220,
220,
220,
220,
220,
220,
981,
6407,
25,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4953,
62,
2435,
796,
4808,
25192,
13,
403,
6933,
7,
15,
11,
18,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
6404,
13,
24442,
10786,
8743,
4043,
329,
23884,
45302,
18982,
7,
10247,
1780,
62,
2435,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25507,
30351,
952,
13,
42832,
7,
10247,
1780,
62,
2435,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25507,
2116,
13,
22915,
82,
13,
12425,
13,
21280,
7,
17821,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25507,
30351,
952,
13,
42832,
7,
15,
8
] | 2.635199 | 2,108 |
from abc import ABC, abstractmethod
from skimage.io import imread, imshow
import matplotlib.pyplot as plt
import random
import numpy as np
import matplotlib.patches as patches
import os
from torch.utils.data import Dataset, DataLoader
import torch
import glob
if __name__ == "__main__":
from configs import InputParser
dataset = DataGeneratorTorch()
data_loader = DataLoader(dataset, batch_size=4, shuffle=True)
args = InputParser()
data = DataGenerator(args)
training_data_single = data.input_data('cracks','train',plot=False)
training_data_all = data.label_maker()
dataTorch = data.toTorchDataset(is_train=True)
data_loader_lmd = DataLoader(dataTorch, batch_size=4, shuffle=True)
print("Done")
| [
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
198,
6738,
1341,
9060,
13,
952,
1330,
545,
961,
11,
545,
12860,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
4738,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
8071,
2052,
355,
16082,
198,
11748,
28686,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
16092,
292,
316,
11,
6060,
17401,
198,
11748,
28034,
198,
11748,
15095,
628,
220,
220,
220,
220,
220,
220,
220,
220,
628,
628,
628,
628,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
422,
4566,
82,
1330,
23412,
46677,
198,
220,
220,
220,
27039,
796,
6060,
8645,
1352,
15884,
354,
3419,
198,
220,
220,
220,
1366,
62,
29356,
796,
6060,
17401,
7,
19608,
292,
316,
11,
15458,
62,
7857,
28,
19,
11,
36273,
28,
17821,
8,
198,
220,
220,
220,
26498,
796,
23412,
46677,
3419,
198,
220,
220,
220,
1366,
796,
6060,
8645,
1352,
7,
22046,
8,
628,
220,
220,
220,
3047,
62,
7890,
62,
29762,
796,
1366,
13,
15414,
62,
7890,
10786,
6098,
4595,
41707,
27432,
3256,
29487,
28,
25101,
8,
198,
220,
220,
220,
3047,
62,
7890,
62,
439,
796,
1366,
13,
18242,
62,
10297,
3419,
628,
220,
220,
220,
1366,
15884,
354,
796,
1366,
13,
1462,
15884,
354,
27354,
292,
316,
7,
271,
62,
27432,
28,
17821,
8,
198,
220,
220,
220,
1366,
62,
29356,
62,
75,
9132,
796,
6060,
17401,
7,
7890,
15884,
354,
11,
15458,
62,
7857,
28,
19,
11,
36273,
28,
17821,
8,
628,
220,
220,
220,
3601,
7203,
45677,
4943,
198,
220,
220,
220,
220
] | 2.8125 | 272 |
from uuid import UUID
from botx import Bot, SendingMessage
bot = Bot()
CHAT_ID = UUID("1f972f5e-6d17-4f39-be5b-f7e20f1b4d13")
BOT_ID = UUID("cc257e1c-c028-4181-a055-01e14ba881b0")
CTS_HOST = "my-cts.example.com"
| [
6738,
334,
27112,
1330,
471,
27586,
198,
198,
6738,
10214,
87,
1330,
18579,
11,
32038,
12837,
198,
198,
13645,
796,
18579,
3419,
198,
31542,
62,
2389,
796,
471,
27586,
7203,
16,
69,
24,
4761,
69,
20,
68,
12,
21,
67,
1558,
12,
19,
69,
2670,
12,
1350,
20,
65,
12,
69,
22,
68,
1238,
69,
16,
65,
19,
67,
1485,
4943,
198,
33,
2394,
62,
2389,
796,
471,
27586,
7203,
535,
28676,
68,
16,
66,
12,
66,
46957,
12,
19,
27057,
12,
64,
47838,
12,
486,
68,
1415,
7012,
3459,
16,
65,
15,
4943,
198,
4177,
50,
62,
39,
10892,
796,
366,
1820,
12,
310,
82,
13,
20688,
13,
785,
1,
628
] | 1.919643 | 112 |
# -*- coding: utf-8 -*-
"""
Repair strategy
- repair_ss:
attempts at repairing a stacking sequence for the following constraints:
- damage tolerance
- contiguity
- disorientation
- 10% rule
- balance
"""
__version__ = '2.0'
__author__ = 'Noemie Fedon'
import sys
import numpy as np
import numpy.matlib
sys.path.append(r'C:\RELAY')
from src.parameters import Parameters
from src.constraints import Constraints
from src.objectives import objectives
from src.pretty_print import print_ss, print_list_ss
from src.repair_10_bal import repair_10_bal
from src.repair_10_bal import calc_mini_10
from src.repair_membrane import repair_membrane
from src.repair_flexural import repair_flexural
from src.repair_diso_contig import repair_diso_contig_list
from src.one_stack import check_ss_manufacturability
from src.lampam_functions import calc_lampam
def repair_ss(
ss, constraints, parameters, lampam_target, obj_no_constraints=None,
count_obj=False):
"""
repairs stacking sequences to meet design and manufacturing guidelines
and evaluates the performance of the repaired stacking sequence
The repair process is deterministic and attempts at conducting minimal
modification of the original stacking sequence with a preference for
modifying outer plies that have the least influence on out-of-plane
properties.
step 1: repair for the 10% rule and balance
step 2: refinement for in-plane lamination parameter convergence
step 3: repair for disorientation and contiguity
step 4: refinement for out-of-plane lamination parameter convergence
(step 5: attribute a poor objective function value to unrepaired layups)
OUTPUTS
-
INPUTS
- ss: stacking sequence of the laminate
- lampam_target: lamination parameter targets
- constraints: instance of the class Constraints
- parameters: instance of the class Parameters
- count_obj: flag to count the number of objective function calls
(- obj_no_constraints: objective function value of the initial stacking
sequence with no consideration of design and manufacturing constraints)
"""
ss_ini = np.copy(ss)
mini_10 = calc_mini_10(constraints, ss.size)
# print('before repair')
# print_ss(ss_ini)
#--------------------------------------------------------------------------
# step 1 / repair for the 10% rule and balance
#--------------------------------------------------------------------------
ss, ply_queue = repair_10_bal(ss, mini_10, constraints)
# print('after repair 10 and balance')
# print_ss(ss)
# print(ply_queue)
#--------------------------------------------------------------------------
# step 2 / improvement of the in-plane lamination parameter convergence
#--------------------------------------------------------------------------
ss_list, ply_queue_list, _ = repair_membrane(
ss=ss,
ply_queue=ply_queue,
mini_10=mini_10,
in_plane_coeffs=parameters.weighting_finalA,
parameters=parameters,
constraints=constraints,
lampam_target=lampam_target)
# print('after repair for membrane properties')
# for ind in range(len(ss_list)):
# print('ind', ind)
# print('ss_list[ind]', ss_list[ind])
# print('ply_queue_list[ind]', ply_queue_list[ind])
# if not is_ten_percent_rule(constraints, stack=ss_list[ind],
# ply_queue=ply_queue_list[ind]):
# print('lampam_target', lampam_target[0:4])
# raise Exception('10% rule not satisfied membrane')
# print('ss_list[0]')
# print_ss(ss_list[0])
# print('ply_queue_list[0]', ply_queue_list[0])
#--------------------------------------------------------------------------
# step 3 / repair for disorientation and contiguity
#--------------------------------------------------------------------------
ss, completed_inward, completed_outward, ind = repair_diso_contig_list(
ss_list, ply_queue_list, constraints,
parameters.n_D1)
# print('completed_inward, completed_outward, ind',
# completed_inward, completed_outward, ind)
if not completed_outward:
# print('unsuccessful repair for disorientation and/or contiguity')
if obj_no_constraints is None:
if count_obj:
return ss_ini, False, 0
else:
return ss_ini, False
if count_obj:
return ss_ini, False, 1e10, 0
else:
return ss_ini, False, 1e10
# print('successful repair for disorientation and/or contiguity')
# print_ss(ss)
#--------------------------------------------------------------------------
# step 4 / improvement of the out-of-plane lamination parameter convergence
#--------------------------------------------------------------------------
ss = repair_flexural(
ss=ss,
out_of_plane_coeffs=parameters.weighting_finalD,
lampam_target=lampam_target,
constraints=constraints,
parameters=parameters,
count_obj=count_obj)
if count_obj:
ss, n_obj_func_D_calls = ss
# print(' after repair')
# print_ss(ss)
# print('lampam_target', lampam_target)
if obj_no_constraints is None:
if count_obj:
return ss, True, n_obj_func_D_calls
else:
return ss, True
#--------------------------------------------------------------------------
# step 5 /
#--------------------------------------------------------------------------
obj_no_constraints = objectives(
lampam=calc_lampam(ss, constraints),
lampam_target=lampam_target,
lampam_weightings=parameters.lampam_weightings_final,
constraints=constraints,
parameters=parameters)
if count_obj:
return ss, True, 1e10, n_obj_func_D_calls
else:
return ss, True, 1e10
if __name__ == "__main__":
print('\n*** Test for the function repair_ss ***')
constraints = Constraints(
sym=True,
bal=True,
ipo=True,
dam_tol=False,
rule_10_percent=True,
diso=True,
contig=True,
delta_angle=45,
n_contig=5,
percent_0=10,
percent_45=0,
percent_90=10,
percent_135=0,
percent_45_135=10,
set_of_angles=[0, 45, -45, 90])
ss = np.array([45, 90, 45, 90, -45, -45, -45, -45, 90, 45, 45, 45,
90, -45, 0, 0, 0, -45, 90, 45, 45, 45, 90, -45,
-45, -45, -45, 90, 45, 90, 45], int)
ss_target = 60*np.ones((1,), dtype=int)
lampam_target = calc_lampam(ss_target)
#==========================================================================
# Optimiser Parameters
#==========================================================================
### Techniques to enforce the constraints
# repair to improve the convergence towards the in-plane lamination parameter
# targets
repair_membrane_switch = True
# repair to improve the convergence towards the out-of-plane lamination
# parameter targets
repair_flexural_switch = True
# balanced laminate scheme
balanced_scheme = False
# coefficient for the proportion of the laminate thickness that can be modified
# during the refinement for membrane properties in the repair process
p_A = 80
# number of plies in the last permutation during repair for disorientation
# and/or contiguity
n_D1 = 6
# number of ply shifts tested at each step of the re-designing process during
# refinement for flexural properties
n_D2 = 10
# number of times are redesigned during the refinement of flexural properties
n_D3 = 2
# Lamination parameters to be considered in the multi-objective functions
optimisation_type = 'D'
set_of_angles = np.array([-45, 0, 45, 90], int)
if optimisation_type == 'A':
if set_of_angles is np.array([-45, 0, 45, 90], int):
lampam_to_be_optimised = np.array([1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0])
else:
lampam_to_be_optimised = np.array([1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0])
if optimisation_type == 'D':
if set_of_angles is np.array([-45, 0, 45, 90], int):
lampam_to_be_optimised = np.array([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0])
else:
lampam_to_be_optimised = np.array([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1])
if optimisation_type == 'AD':
if set_of_angles is np.array([-45, 0, 45, 90], int):
lampam_to_be_optimised = np.array([1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0])
else:
lampam_to_be_optimised = np.array([1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1])
# Lamination parameters sensitivities from the first-lebel optimiser
first_level_sensitivities = np.ones((12,), float)
parameters = Parameters(
constraints=constraints,
p_A=p_A,
n_D1=n_D1,
n_D2=n_D2,
n_D3=n_D3,
first_level_sensitivities=first_level_sensitivities,
lampam_to_be_optimised=lampam_to_be_optimised,
repair_membrane_switch=repair_membrane_switch,
repair_flexural_switch=repair_flexural_switch)
ss, completed, n_obj_func_D_calls = repair_ss(
ss, constraints, parameters, lampam_target, count_obj=True)
print('Repair successful?', completed)
print_ss(ss, 20)
print('n_obj_func_D_calls', n_obj_func_D_calls)
check_ss_manufacturability(ss, constraints)
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
6207,
958,
4811,
198,
198,
12,
9185,
62,
824,
25,
198,
220,
220,
220,
6370,
379,
39005,
257,
41228,
8379,
329,
262,
1708,
17778,
25,
198,
220,
220,
220,
220,
220,
220,
220,
532,
2465,
15621,
198,
220,
220,
220,
220,
220,
220,
220,
532,
542,
328,
14834,
198,
220,
220,
220,
220,
220,
220,
220,
532,
595,
13989,
341,
198,
220,
220,
220,
220,
220,
220,
220,
532,
838,
4,
3896,
198,
220,
220,
220,
220,
220,
220,
220,
532,
5236,
198,
37811,
198,
834,
9641,
834,
796,
705,
17,
13,
15,
6,
198,
834,
9800,
834,
796,
705,
2949,
368,
494,
10169,
261,
6,
198,
198,
11748,
25064,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
299,
32152,
13,
6759,
8019,
198,
198,
17597,
13,
6978,
13,
33295,
7,
81,
6,
34,
7479,
16448,
4792,
11537,
198,
6738,
12351,
13,
17143,
7307,
1330,
40117,
198,
6738,
12351,
13,
1102,
2536,
6003,
1330,
1482,
2536,
6003,
198,
6738,
12351,
13,
15252,
1083,
1330,
15221,
198,
6738,
12351,
13,
37784,
62,
4798,
1330,
3601,
62,
824,
11,
3601,
62,
4868,
62,
824,
198,
6738,
12351,
13,
49932,
62,
940,
62,
6893,
1330,
9185,
62,
940,
62,
6893,
198,
6738,
12351,
13,
49932,
62,
940,
62,
6893,
1330,
42302,
62,
45313,
62,
940,
198,
6738,
12351,
13,
49932,
62,
11883,
1671,
1531,
1330,
9185,
62,
11883,
1671,
1531,
198,
6738,
12351,
13,
49932,
62,
32880,
1523,
1330,
9185,
62,
32880,
1523,
198,
6738,
12351,
13,
49932,
62,
6381,
78,
62,
3642,
328,
1330,
9185,
62,
6381,
78,
62,
3642,
328,
62,
4868,
198,
6738,
12351,
13,
505,
62,
25558,
1330,
2198,
62,
824,
62,
48119,
333,
1799,
198,
6738,
12351,
13,
75,
696,
321,
62,
12543,
2733,
1330,
42302,
62,
75,
696,
321,
198,
198,
4299,
9185,
62,
824,
7,
198,
220,
220,
220,
220,
220,
220,
220,
37786,
11,
17778,
11,
10007,
11,
20450,
321,
62,
16793,
11,
26181,
62,
3919,
62,
1102,
2536,
6003,
28,
14202,
11,
198,
220,
220,
220,
220,
220,
220,
220,
954,
62,
26801,
28,
25101,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
20097,
41228,
16311,
284,
1826,
1486,
290,
9138,
9949,
198,
220,
220,
220,
290,
47850,
262,
2854,
286,
262,
27457,
41228,
8379,
628,
220,
220,
220,
383,
9185,
1429,
318,
2206,
49228,
290,
6370,
379,
14523,
10926,
198,
220,
220,
220,
17613,
286,
262,
2656,
41228,
8379,
351,
257,
12741,
329,
198,
220,
220,
220,
30620,
12076,
458,
444,
326,
423,
262,
1551,
4588,
319,
503,
12,
1659,
12,
14382,
198,
220,
220,
220,
6608,
13,
628,
220,
220,
220,
2239,
352,
25,
9185,
329,
262,
838,
4,
3896,
290,
5236,
198,
220,
220,
220,
2239,
362,
25,
47517,
329,
287,
12,
14382,
300,
24979,
11507,
40826,
198,
220,
220,
220,
2239,
513,
25,
9185,
329,
595,
13989,
341,
290,
542,
328,
14834,
198,
220,
220,
220,
2239,
604,
25,
47517,
329,
503,
12,
1659,
12,
14382,
300,
24979,
11507,
40826,
198,
220,
220,
220,
357,
9662,
642,
25,
11688,
257,
3595,
9432,
2163,
1988,
284,
555,
7856,
9820,
3830,
4739,
8,
628,
220,
220,
220,
16289,
30076,
50,
198,
220,
220,
220,
532,
628,
220,
220,
220,
3268,
30076,
50,
198,
220,
220,
220,
532,
37786,
25,
41228,
8379,
286,
262,
30592,
4559,
198,
220,
220,
220,
532,
20450,
321,
62,
16793,
25,
300,
24979,
11507,
6670,
198,
220,
220,
220,
532,
17778,
25,
4554,
286,
262,
1398,
1482,
2536,
6003,
198,
220,
220,
220,
532,
10007,
25,
4554,
286,
262,
1398,
40117,
198,
220,
220,
220,
532,
954,
62,
26801,
25,
6056,
284,
954,
262,
1271,
286,
9432,
2163,
3848,
198,
220,
220,
220,
13841,
26181,
62,
3919,
62,
1102,
2536,
6003,
25,
9432,
2163,
1988,
286,
262,
4238,
41228,
198,
220,
220,
220,
220,
8379,
351,
645,
9110,
286,
1486,
290,
9138,
17778,
8,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
37786,
62,
5362,
796,
45941,
13,
30073,
7,
824,
8,
198,
220,
220,
220,
9927,
62,
940,
796,
42302,
62,
45313,
62,
940,
7,
1102,
2536,
6003,
11,
37786,
13,
7857,
8,
198,
2,
220,
220,
220,
3601,
10786,
19052,
9185,
11537,
198,
2,
220,
220,
220,
3601,
62,
824,
7,
824,
62,
5362,
8,
198,
220,
220,
220,
1303,
10097,
35937,
198,
220,
220,
220,
1303,
2239,
352,
1220,
9185,
329,
262,
838,
4,
3896,
290,
5236,
198,
220,
220,
220,
1303,
10097,
35937,
198,
220,
220,
220,
37786,
11,
35960,
62,
36560,
796,
9185,
62,
940,
62,
6893,
7,
824,
11,
9927,
62,
940,
11,
17778,
8,
198,
2,
220,
220,
220,
3601,
10786,
8499,
9185,
838,
290,
5236,
11537,
198,
2,
220,
220,
220,
3601,
62,
824,
7,
824,
8,
198,
2,
220,
220,
220,
3601,
7,
2145,
62,
36560,
8,
198,
220,
220,
220,
1303,
10097,
35937,
198,
220,
220,
220,
1303,
2239,
362,
1220,
9025,
286,
262,
287,
12,
14382,
300,
24979,
11507,
40826,
198,
220,
220,
220,
1303,
10097,
35937,
198,
220,
220,
220,
37786,
62,
4868,
11,
35960,
62,
36560,
62,
4868,
11,
4808,
796,
9185,
62,
11883,
1671,
1531,
7,
198,
220,
220,
220,
220,
220,
220,
220,
37786,
28,
824,
11,
198,
220,
220,
220,
220,
220,
220,
220,
35960,
62,
36560,
28,
2145,
62,
36560,
11,
198,
220,
220,
220,
220,
220,
220,
220,
9927,
62,
940,
28,
45313,
62,
940,
11,
198,
220,
220,
220,
220,
220,
220,
220,
287,
62,
14382,
62,
1073,
14822,
82,
28,
17143,
7307,
13,
6551,
278,
62,
20311,
32,
11,
198,
220,
220,
220,
220,
220,
220,
220,
10007,
28,
17143,
7307,
11,
198,
220,
220,
220,
220,
220,
220,
220,
17778,
28,
1102,
2536,
6003,
11,
198,
220,
220,
220,
220,
220,
220,
220,
20450,
321,
62,
16793,
28,
75,
696,
321,
62,
16793,
8,
198,
2,
220,
220,
220,
3601,
10786,
8499,
9185,
329,
25019,
6608,
11537,
198,
2,
220,
220,
220,
329,
773,
287,
2837,
7,
11925,
7,
824,
62,
4868,
8,
2599,
198,
2,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
521,
3256,
773,
8,
198,
2,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
824,
62,
4868,
58,
521,
60,
3256,
37786,
62,
4868,
58,
521,
12962,
198,
2,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
2145,
62,
36560,
62,
4868,
58,
521,
60,
3256,
35960,
62,
36560,
62,
4868,
58,
521,
12962,
198,
2,
220,
220,
220,
220,
220,
220,
220,
611,
407,
318,
62,
1452,
62,
25067,
62,
25135,
7,
1102,
2536,
6003,
11,
8931,
28,
824,
62,
4868,
58,
521,
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,
35960,
62,
36560,
28,
2145,
62,
36560,
62,
4868,
58,
521,
60,
2599,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
75,
696,
321,
62,
16793,
3256,
20450,
321,
62,
16793,
58,
15,
25,
19,
12962,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
35528,
10786,
940,
4,
3896,
407,
11378,
25019,
11537,
198,
2,
220,
220,
220,
3601,
10786,
824,
62,
4868,
58,
15,
60,
11537,
198,
2,
220,
220,
220,
3601,
62,
824,
7,
824,
62,
4868,
58,
15,
12962,
198,
2,
220,
220,
220,
3601,
10786,
2145,
62,
36560,
62,
4868,
58,
15,
60,
3256,
35960,
62,
36560,
62,
4868,
58,
15,
12962,
198,
220,
220,
220,
1303,
10097,
35937,
198,
220,
220,
220,
1303,
2239,
513,
1220,
9185,
329,
595,
13989,
341,
290,
542,
328,
14834,
198,
220,
220,
220,
1303,
10097,
35937,
198,
220,
220,
220,
37786,
11,
5668,
62,
259,
904,
11,
5668,
62,
448,
904,
11,
773,
796,
9185,
62,
6381,
78,
62,
3642,
328,
62,
4868,
7,
198,
220,
220,
220,
220,
220,
220,
220,
37786,
62,
4868,
11,
35960,
62,
36560,
62,
4868,
11,
17778,
11,
198,
220,
220,
220,
220,
220,
220,
220,
10007,
13,
77,
62,
35,
16,
8,
198,
2,
220,
220,
220,
3601,
10786,
785,
16838,
62,
259,
904,
11,
5668,
62,
448,
904,
11,
773,
3256,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5668,
62,
259,
904,
11,
5668,
62,
448,
904,
11,
773,
8,
198,
220,
220,
220,
611,
407,
5668,
62,
448,
904,
25,
198,
2,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
403,
17212,
9185,
329,
595,
13989,
341,
290,
14,
273,
542,
328,
14834,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
611,
26181,
62,
3919,
62,
1102,
2536,
6003,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
954,
62,
26801,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
37786,
62,
5362,
11,
10352,
11,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
37786,
62,
5362,
11,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
611,
954,
62,
26801,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
37786,
62,
5362,
11,
10352,
11,
352,
68,
940,
11,
657,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
37786,
62,
5362,
11,
10352,
11,
352,
68,
940,
198,
2,
220,
220,
220,
3601,
10786,
17212,
9185,
329,
595,
13989,
341,
290,
14,
273,
542,
328,
14834,
11537,
198,
2,
220,
220,
220,
3601,
62,
824,
7,
824,
8,
198,
220,
220,
220,
1303,
10097,
35937,
198,
220,
220,
220,
1303,
2239,
604,
1220,
9025,
286,
262,
503,
12,
1659,
12,
14382,
300,
24979,
11507,
40826,
198,
220,
220,
220,
1303,
10097,
35937,
198,
220,
220,
220,
37786,
796,
9185,
62,
32880,
1523,
7,
198,
220,
220,
220,
220,
220,
220,
220,
37786,
28,
824,
11,
198,
220,
220,
220,
220,
220,
220,
220,
503,
62,
1659,
62,
14382,
62,
1073,
14822,
82,
28,
17143,
7307,
13,
6551,
278,
62,
20311,
35,
11,
198,
220,
220,
220,
220,
220,
220,
220,
20450,
321,
62,
16793,
28,
75,
696,
321,
62,
16793,
11,
198,
220,
220,
220,
220,
220,
220,
220,
17778,
28,
1102,
2536,
6003,
11,
198,
220,
220,
220,
220,
220,
220,
220,
10007,
28,
17143,
7307,
11,
198,
220,
220,
220,
220,
220,
220,
220,
954,
62,
26801,
28,
9127,
62,
26801,
8,
198,
220,
220,
220,
611,
954,
62,
26801,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37786,
11,
299,
62,
26801,
62,
20786,
62,
35,
62,
66,
5691,
796,
37786,
198,
2,
220,
220,
220,
3601,
10786,
220,
220,
220,
706,
9185,
11537,
198,
2,
220,
220,
220,
3601,
62,
824,
7,
824,
8,
198,
2,
220,
220,
220,
3601,
10786,
75,
696,
321,
62,
16793,
3256,
20450,
321,
62,
16793,
8,
628,
220,
220,
220,
611,
26181,
62,
3919,
62,
1102,
2536,
6003,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
954,
62,
26801,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
37786,
11,
6407,
11,
299,
62,
26801,
62,
20786,
62,
35,
62,
66,
5691,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
37786,
11,
6407,
198,
220,
220,
220,
1303,
10097,
35937,
198,
220,
220,
220,
1303,
2239,
642,
1220,
198,
220,
220,
220,
1303,
10097,
35937,
198,
220,
220,
220,
26181,
62,
3919,
62,
1102,
2536,
6003,
796,
15221,
7,
198,
220,
220,
220,
220,
220,
220,
220,
20450,
321,
28,
9948,
66,
62,
75,
696,
321,
7,
824,
11,
17778,
828,
198,
220,
220,
220,
220,
220,
220,
220,
20450,
321,
62,
16793,
28,
75,
696,
321,
62,
16793,
11,
198,
220,
220,
220,
220,
220,
220,
220,
20450,
321,
62,
6551,
654,
28,
17143,
7307,
13,
75,
696,
321,
62,
6551,
654,
62,
20311,
11,
198,
220,
220,
220,
220,
220,
220,
220,
17778,
28,
1102,
2536,
6003,
11,
198,
220,
220,
220,
220,
220,
220,
220,
10007,
28,
17143,
7307,
8,
198,
220,
220,
220,
611,
954,
62,
26801,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
37786,
11,
6407,
11,
352,
68,
940,
11,
299,
62,
26801,
62,
20786,
62,
35,
62,
66,
5691,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
37786,
11,
6407,
11,
352,
68,
940,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
3601,
10786,
59,
77,
8162,
6208,
329,
262,
2163,
9185,
62,
824,
17202,
11537,
198,
220,
220,
220,
17778,
796,
1482,
2536,
6003,
7,
198,
220,
220,
220,
220,
220,
220,
220,
5659,
28,
17821,
11,
198,
220,
220,
220,
220,
220,
220,
220,
3652,
28,
17821,
11,
198,
220,
220,
220,
220,
220,
220,
220,
20966,
78,
28,
17821,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1801,
62,
83,
349,
28,
25101,
11,
198,
220,
220,
220,
220,
220,
220,
220,
3896,
62,
940,
62,
25067,
28,
17821,
11,
198,
220,
220,
220,
220,
220,
220,
220,
595,
78,
28,
17821,
11,
198,
220,
220,
220,
220,
220,
220,
220,
542,
328,
28,
17821,
11,
198,
220,
220,
220,
220,
220,
220,
220,
25979,
62,
9248,
28,
2231,
11,
198,
220,
220,
220,
220,
220,
220,
220,
299,
62,
3642,
328,
28,
20,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1411,
62,
15,
28,
940,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1411,
62,
2231,
28,
15,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1411,
62,
3829,
28,
940,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1411,
62,
17059,
28,
15,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1411,
62,
2231,
62,
17059,
28,
940,
11,
198,
220,
220,
220,
220,
220,
220,
220,
900,
62,
1659,
62,
27787,
41888,
15,
11,
4153,
11,
532,
2231,
11,
4101,
12962,
198,
220,
220,
220,
37786,
796,
45941,
13,
18747,
26933,
2231,
11,
220,
4101,
11,
220,
4153,
11,
220,
4101,
11,
532,
2231,
11,
532,
2231,
11,
532,
2231,
11,
532,
2231,
11,
220,
4101,
11,
220,
4153,
11,
220,
4153,
11,
220,
4153,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4101,
11,
532,
2231,
11,
220,
220,
657,
11,
220,
220,
657,
11,
220,
220,
657,
11,
532,
2231,
11,
220,
4101,
11,
220,
4153,
11,
220,
4153,
11,
220,
4153,
11,
220,
4101,
11,
532,
2231,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
532,
2231,
11,
532,
2231,
11,
532,
2231,
11,
220,
4101,
11,
220,
4153,
11,
220,
4101,
11,
220,
4153,
4357,
493,
8,
198,
220,
220,
220,
37786,
62,
16793,
796,
3126,
9,
37659,
13,
1952,
19510,
16,
11,
828,
288,
4906,
28,
600,
8,
198,
220,
220,
220,
20450,
321,
62,
16793,
796,
42302,
62,
75,
696,
321,
7,
824,
62,
16793,
8,
198,
220,
220,
220,
1303,
23926,
2559,
855,
198,
220,
220,
220,
1303,
30011,
5847,
40117,
198,
220,
220,
220,
1303,
23926,
2559,
855,
198,
220,
220,
220,
44386,
49686,
284,
4605,
262,
17778,
198,
220,
220,
220,
1303,
9185,
284,
2987,
262,
40826,
3371,
262,
287,
12,
14382,
300,
24979,
11507,
198,
220,
220,
220,
1303,
6670,
198,
220,
220,
220,
9185,
62,
11883,
1671,
1531,
62,
31943,
796,
6407,
198,
220,
220,
220,
1303,
9185,
284,
2987,
262,
40826,
3371,
262,
503,
12,
1659,
12,
14382,
300,
24979,
198,
220,
220,
220,
1303,
11507,
6670,
198,
220,
220,
220,
9185,
62,
32880,
1523,
62,
31943,
796,
6407,
198,
220,
220,
220,
1303,
12974,
30592,
4559,
7791,
198,
220,
220,
220,
12974,
62,
15952,
1326,
796,
10352,
628,
220,
220,
220,
1303,
35381,
329,
262,
9823,
286,
262,
30592,
4559,
20735,
326,
460,
307,
9518,
198,
220,
220,
220,
1303,
1141,
262,
47517,
329,
25019,
6608,
287,
262,
9185,
1429,
198,
220,
220,
220,
279,
62,
32,
796,
4019,
198,
220,
220,
220,
1303,
1271,
286,
458,
444,
287,
262,
938,
9943,
7094,
1141,
9185,
329,
595,
13989,
341,
198,
220,
220,
220,
1303,
290,
14,
273,
542,
328,
14834,
198,
220,
220,
220,
299,
62,
35,
16,
796,
718,
198,
220,
220,
220,
1303,
1271,
286,
35960,
15381,
6789,
379,
1123,
2239,
286,
262,
302,
12,
26124,
278,
1429,
1141,
198,
220,
220,
220,
1303,
47517,
329,
7059,
1523,
6608,
198,
220,
220,
220,
299,
62,
35,
17,
796,
838,
198,
220,
220,
220,
1303,
1271,
286,
1661,
389,
36240,
1141,
262,
47517,
286,
7059,
1523,
6608,
198,
220,
220,
220,
299,
62,
35,
18,
796,
362,
628,
220,
220,
220,
1303,
10923,
1883,
10007,
284,
307,
3177,
287,
262,
5021,
12,
15252,
425,
5499,
198,
220,
220,
220,
6436,
5612,
62,
4906,
796,
705,
35,
6,
198,
220,
220,
220,
900,
62,
1659,
62,
27787,
796,
45941,
13,
18747,
26933,
12,
2231,
11,
657,
11,
4153,
11,
4101,
4357,
493,
8,
198,
220,
220,
220,
611,
6436,
5612,
62,
4906,
6624,
705,
32,
10354,
198,
220,
220,
220,
220,
220,
220,
220,
611,
900,
62,
1659,
62,
27787,
318,
45941,
13,
18747,
26933,
12,
2231,
11,
657,
11,
4153,
11,
4101,
4357,
493,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
20450,
321,
62,
1462,
62,
1350,
62,
40085,
1417,
796,
45941,
13,
18747,
26933,
16,
11,
352,
11,
352,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
20450,
321,
62,
1462,
62,
1350,
62,
40085,
1417,
796,
45941,
13,
18747,
26933,
16,
11,
352,
11,
352,
11,
352,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
12962,
198,
220,
220,
220,
611,
6436,
5612,
62,
4906,
6624,
705,
35,
10354,
198,
220,
220,
220,
220,
220,
220,
220,
611,
900,
62,
1659,
62,
27787,
318,
45941,
13,
18747,
26933,
12,
2231,
11,
657,
11,
4153,
11,
4101,
4357,
493,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
20450,
321,
62,
1462,
62,
1350,
62,
40085,
1417,
796,
45941,
13,
18747,
26933,
15,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
352,
11,
352,
11,
352,
11,
657,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
20450,
321,
62,
1462,
62,
1350,
62,
40085,
1417,
796,
45941,
13,
18747,
26933,
15,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
352,
11,
352,
11,
352,
11,
352,
12962,
198,
220,
220,
220,
611,
6436,
5612,
62,
4906,
6624,
705,
2885,
10354,
198,
220,
220,
220,
220,
220,
220,
220,
611,
900,
62,
1659,
62,
27787,
318,
45941,
13,
18747,
26933,
12,
2231,
11,
657,
11,
4153,
11,
4101,
4357,
493,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
20450,
321,
62,
1462,
62,
1350,
62,
40085,
1417,
796,
45941,
13,
18747,
26933,
16,
11,
352,
11,
352,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
352,
11,
352,
11,
352,
11,
657,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
20450,
321,
62,
1462,
62,
1350,
62,
40085,
1417,
796,
45941,
13,
18747,
26933,
16,
11,
352,
11,
352,
11,
352,
11,
657,
11,
657,
11,
657,
11,
657,
11,
352,
11,
352,
11,
352,
11,
352,
12962,
628,
220,
220,
220,
1303,
10923,
1883,
10007,
44752,
28720,
422,
262,
717,
12,
293,
6667,
6436,
5847,
198,
220,
220,
220,
717,
62,
5715,
62,
82,
641,
270,
28720,
796,
45941,
13,
1952,
19510,
1065,
11,
828,
12178,
8,
628,
220,
220,
220,
10007,
796,
40117,
7,
198,
220,
220,
220,
220,
220,
220,
220,
17778,
28,
1102,
2536,
6003,
11,
198,
220,
220,
220,
220,
220,
220,
220,
279,
62,
32,
28,
79,
62,
32,
11,
198,
220,
220,
220,
220,
220,
220,
220,
299,
62,
35,
16,
28,
77,
62,
35,
16,
11,
198,
220,
220,
220,
220,
220,
220,
220,
299,
62,
35,
17,
28,
77,
62,
35,
17,
11,
198,
220,
220,
220,
220,
220,
220,
220,
299,
62,
35,
18,
28,
77,
62,
35,
18,
11,
198,
220,
220,
220,
220,
220,
220,
220,
717,
62,
5715,
62,
82,
641,
270,
28720,
28,
11085,
62,
5715,
62,
82,
641,
270,
28720,
11,
198,
220,
220,
220,
220,
220,
220,
220,
20450,
321,
62,
1462,
62,
1350,
62,
40085,
1417,
28,
75,
696,
321,
62,
1462,
62,
1350,
62,
40085,
1417,
11,
198,
220,
220,
220,
220,
220,
220,
220,
9185,
62,
11883,
1671,
1531,
62,
31943,
28,
49932,
62,
11883,
1671,
1531,
62,
31943,
11,
198,
220,
220,
220,
220,
220,
220,
220,
9185,
62,
32880,
1523,
62,
31943,
28,
49932,
62,
32880,
1523,
62,
31943,
8,
628,
220,
220,
220,
37786,
11,
5668,
11,
299,
62,
26801,
62,
20786,
62,
35,
62,
66,
5691,
796,
9185,
62,
824,
7,
198,
220,
220,
220,
220,
220,
220,
220,
37786,
11,
17778,
11,
10007,
11,
20450,
321,
62,
16793,
11,
954,
62,
26801,
28,
17821,
8,
198,
220,
220,
220,
3601,
10786,
6207,
958,
4388,
30,
3256,
5668,
8,
198,
220,
220,
220,
3601,
62,
824,
7,
824,
11,
1160,
8,
198,
220,
220,
220,
3601,
10786,
77,
62,
26801,
62,
20786,
62,
35,
62,
66,
5691,
3256,
299,
62,
26801,
62,
20786,
62,
35,
62,
66,
5691,
8,
198,
220,
220,
220,
2198,
62,
824,
62,
48119,
333,
1799,
7,
824,
11,
17778,
8,
198
] | 2.585201 | 3,703 |
from __future__ import print_function
import numpy as np
import os
from sensor_msgs.msg import LaserScan
from navrep.tools.data_extraction import archive_to_lidar_dataset
from navrep.models.vae1d import Conv1DVAE, reset_graph
DEBUG_PLOTTING = True
# Parameters for training
batch_size = 100
N_SCANS_PER_BATCH = 1
NUM_EPOCH = 100
DATA_DIR = "record"
HOME = os.path.expanduser("~")
MAX_LIDAR_DIST = 25.0
vae_model_path = os.path.expanduser("~/navrep/models/V/vae1d.json")
# create network
reset_graph()
vae = Conv1DVAE(batch_size=batch_size, is_training=False)
# load
vae.load_json(vae_model_path)
# create training dataset
dataset = archive_to_lidar_dataset("~/navrep/datasets/V/ian", limit=180)
if len(dataset) == 0:
raise ValueError("no scans found, exiting")
print(len(dataset), "scans in dataset.")
# split into batches:
total_length = len(dataset)
num_batches = len(dataset)
dummy_msg = LaserScan()
dummy_msg.range_max = 100.0
dummy_msg.ranges = range(1080)
for idx in range(num_batches):
batch = dataset[idx:idx+N_SCANS_PER_BATCH]
scans = batch
obs = np.clip(scans.astype(np.float) / MAX_LIDAR_DIST, 0.0, MAX_LIDAR_DIST)
obs = obs.reshape(N_SCANS_PER_BATCH, 1080, 1)
obs_pred = vae.encode_decode(obs)
if True:
import matplotlib.pyplot as plt
plt.ion()
plt.figure("rings")
plt.cla()
plt.plot(obs[0,:,0])
plt.plot(obs_pred[0,:,0])
plt.title(idx)
# update
plt.pause(0.01)
| [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
6738,
12694,
62,
907,
14542,
13,
19662,
1330,
23222,
33351,
198,
198,
6738,
6812,
7856,
13,
31391,
13,
7890,
62,
2302,
7861,
1330,
15424,
62,
1462,
62,
75,
312,
283,
62,
19608,
292,
316,
198,
6738,
6812,
7856,
13,
27530,
13,
33353,
16,
67,
1330,
34872,
16,
35,
11731,
36,
11,
13259,
62,
34960,
198,
198,
30531,
62,
6489,
29089,
2751,
796,
6407,
198,
198,
2,
40117,
329,
3047,
198,
43501,
62,
7857,
796,
1802,
198,
45,
62,
6173,
15037,
62,
18973,
62,
33,
11417,
796,
352,
198,
41359,
62,
8905,
46,
3398,
796,
1802,
198,
26947,
62,
34720,
796,
366,
22105,
1,
198,
39069,
796,
28686,
13,
6978,
13,
11201,
392,
7220,
7203,
93,
4943,
198,
22921,
62,
43,
2389,
1503,
62,
35,
8808,
796,
1679,
13,
15,
198,
198,
33353,
62,
19849,
62,
6978,
796,
28686,
13,
6978,
13,
11201,
392,
7220,
7203,
93,
14,
28341,
7856,
14,
27530,
14,
53,
14,
33353,
16,
67,
13,
17752,
4943,
198,
198,
2,
2251,
3127,
198,
42503,
62,
34960,
3419,
198,
33353,
796,
34872,
16,
35,
11731,
36,
7,
43501,
62,
7857,
28,
43501,
62,
7857,
11,
318,
62,
34409,
28,
25101,
8,
198,
198,
2,
3440,
198,
33353,
13,
2220,
62,
17752,
7,
33353,
62,
19849,
62,
6978,
8,
198,
198,
2,
2251,
3047,
27039,
198,
19608,
292,
316,
796,
15424,
62,
1462,
62,
75,
312,
283,
62,
19608,
292,
316,
7203,
93,
14,
28341,
7856,
14,
19608,
292,
1039,
14,
53,
14,
666,
1600,
4179,
28,
15259,
8,
198,
361,
18896,
7,
19608,
292,
316,
8,
6624,
657,
25,
198,
220,
220,
220,
5298,
11052,
12331,
7203,
3919,
23824,
1043,
11,
33895,
4943,
198,
4798,
7,
11925,
7,
19608,
292,
316,
828,
366,
1416,
504,
287,
27039,
19570,
198,
198,
2,
6626,
656,
37830,
25,
198,
23350,
62,
13664,
796,
18896,
7,
19608,
292,
316,
8,
198,
22510,
62,
8664,
2052,
796,
18896,
7,
19608,
292,
316,
8,
628,
198,
67,
13513,
62,
19662,
796,
23222,
33351,
3419,
198,
67,
13513,
62,
19662,
13,
9521,
62,
9806,
796,
1802,
13,
15,
198,
67,
13513,
62,
19662,
13,
81,
6231,
796,
2837,
7,
24045,
8,
198,
198,
1640,
4686,
87,
287,
2837,
7,
22510,
62,
8664,
2052,
2599,
198,
220,
220,
220,
15458,
796,
27039,
58,
312,
87,
25,
312,
87,
10,
45,
62,
6173,
15037,
62,
18973,
62,
33,
11417,
60,
198,
220,
220,
220,
23824,
796,
15458,
628,
220,
220,
220,
10201,
796,
45941,
13,
15036,
7,
1416,
504,
13,
459,
2981,
7,
37659,
13,
22468,
8,
1220,
25882,
62,
43,
2389,
1503,
62,
35,
8808,
11,
657,
13,
15,
11,
25882,
62,
43,
2389,
1503,
62,
35,
8808,
8,
198,
220,
220,
220,
10201,
796,
10201,
13,
3447,
1758,
7,
45,
62,
6173,
15037,
62,
18973,
62,
33,
11417,
11,
17729,
11,
352,
8,
628,
220,
220,
220,
10201,
62,
28764,
796,
410,
3609,
13,
268,
8189,
62,
12501,
1098,
7,
8158,
8,
198,
220,
220,
220,
611,
6407,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1330,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
628,
220,
220,
220,
220,
220,
220,
220,
458,
83,
13,
295,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
458,
83,
13,
26875,
7203,
33173,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
458,
83,
13,
565,
64,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
458,
83,
13,
29487,
7,
8158,
58,
15,
11,
45299,
15,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
458,
83,
13,
29487,
7,
8158,
62,
28764,
58,
15,
11,
45299,
15,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
458,
83,
13,
7839,
7,
312,
87,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
4296,
198,
220,
220,
220,
220,
220,
220,
220,
458,
83,
13,
32125,
7,
15,
13,
486,
8,
198
] | 2.261398 | 658 |
# modules in standard library
import re
from urllib.parse import urlparse
import requests
from selenium import webdriver
from selenium.webdriver.common.keys import Keys #需要引入 keys 包
import time
def main(domain):
"""
主函数,只需执行它就能get子域名
:param domain:
:return:
"""
dns_record = DnsRecord(domain)
set1 = dns_record.get_by_hackertarget()
return set1
if __name__ == '__main__':
# 自己在这个文件里尝试好,能获取子域名就提交上来
print(main("hubu.edu.cn")) # 输出hubu.edu.com的子域名 | [
2,
13103,
287,
3210,
5888,
201,
198,
11748,
302,
201,
198,
6738,
2956,
297,
571,
13,
29572,
1330,
19016,
29572,
201,
198,
201,
198,
11748,
7007,
201,
198,
6738,
384,
11925,
1505,
1330,
3992,
26230,
201,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11321,
13,
13083,
1330,
26363,
1303,
165,
250,
222,
17358,
223,
28156,
243,
17739,
98,
8251,
10263,
234,
227,
201,
198,
11748,
640,
201,
198,
201,
198,
4299,
1388,
7,
27830,
2599,
201,
198,
220,
220,
220,
37227,
201,
198,
220,
220,
220,
220,
10310,
119,
49035,
121,
46763,
108,
171,
120,
234,
20998,
103,
165,
250,
222,
33699,
100,
26193,
234,
22522,
225,
22887,
109,
47797,
121,
1136,
36310,
161,
253,
253,
28938,
235,
201,
198,
220,
220,
220,
1058,
17143,
7386,
25,
201,
198,
220,
220,
220,
1058,
7783,
25,
201,
198,
220,
220,
220,
37227,
201,
198,
220,
220,
220,
288,
5907,
62,
22105,
796,
360,
5907,
23739,
7,
27830,
8,
201,
198,
220,
220,
220,
900,
16,
796,
288,
5907,
62,
22105,
13,
1136,
62,
1525,
62,
31153,
861,
7641,
3419,
201,
198,
220,
220,
220,
1441,
900,
16,
201,
198,
201,
198,
201,
198,
201,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
201,
198,
220,
220,
220,
1303,
5525,
229,
103,
32432,
109,
28839,
101,
32573,
247,
10310,
103,
23877,
229,
20015,
114,
34932,
234,
22887,
251,
46237,
243,
25001,
121,
171,
120,
234,
47797,
121,
164,
236,
115,
20998,
244,
36310,
161,
253,
253,
28938,
235,
22887,
109,
162,
237,
238,
12859,
97,
41468,
30266,
98,
201,
198,
220,
220,
220,
3601,
7,
12417,
7203,
40140,
84,
13,
15532,
13,
31522,
48774,
220,
220,
220,
1303,
5525,
122,
241,
49035,
118,
40140,
84,
13,
15532,
13,
785,
21410,
36310,
161,
253,
253,
28938,
235
] | 1.725753 | 299 |
/usr/lib/python3.6/encodings/utf_16_be.py | [
14,
14629,
14,
8019,
14,
29412,
18,
13,
21,
14,
12685,
375,
654,
14,
40477,
62,
1433,
62,
1350,
13,
9078
] | 1.952381 | 21 |
from datetime import datetime
from django.db import models
from django.conf import settings
from django.core.cache import get_cache
| [
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
7295,
13,
23870,
1330,
651,
62,
23870,
628,
198
] | 3.648649 | 37 |
# Ensure that accidentally-raised StopIterations are transformed to RuntimeErrors
# Livin' in the future!
from __future__ import generator_stop
from wordsearch.board import Board
import string, random
def start_board_run(start, direction, board):
"""
A generator that yields successive values of "board" starting from "start" and
moving in "direction", raising a StopIteration when the edge of the board is
crossed.
"direction" is added as a vector to the current position on every iteration.
For example, for start = (0,0) and direction = (1,1), this will yield the letters
at (0,0), (1,1), (2,2), etc.
Args:
start: a 2-tuple of ints (x,y) for which coordinates to start at in "board"
direction: a 2-tuple of ints (x,y) of which direction to iterate in.
Both x and y should be one of (-1, 0, 1) and (0, 0) is invalid.
board: a Board to search in
Yields: next letter in run (type depends on board value type)
"""
if not all(d in (-1, 0, 1) for d in direction):
raise ValueError('All values in direction should be one of (-1, 0, 1), got {}'.format(direction))
if direction == (0, 0):
raise ValueError("Direction cannot be (0, 0)")
cur_pt = start
try:
while True:
yield board[cur_pt[0], cur_pt[1]]
cur_pt = (cur_pt[0] + direction[0], cur_pt[1] + direction[1])
except IndexError:
return
def start_trie_search(root):
"""
A generator that progressively searches down a trie. When given a letter with
"trie_search.send(letter)", it does the following:
- If the letter is not a child of the current node, raise a StopIteration
- If the letter is a child of the current node, select it, and yield whether it
ends a word
You must "prime" the generator by calling next() or .send(None) on it
once before .send()-ing the first letter.
Args:
root: root TrieNode to begin the search with
Yields: whether the letter ends a word (bool)
"""
cur_node = root
letter = None
while True:
letter = yield cur_node.word_end
try:
cur_node = cur_node.children[letter]
except KeyError:
return
# List of x,y vectors (tuples) for all directions a word can be found in, i.e. forwards
# or backwards in rows or columns, and on diagonals.
# E.g. (0, 1) = down, (1, 1) = diagonal down-right, (1, 0) = right, ...
_directions = [(x, y) for x in range(-1, 2) for y in range (-1, 2) if not (x == 0 and y == 0)]
def search_board(board, rootnode):
"""
A generator that searches for words in "board" using the trie rooted by "rootnode"
and yields the words found.
Args:
board: a Board to search
rootnode: a TrieNode that roots a trie used to identify words
Yields: a word found in board (string)
"""
for x, y, letter in board:
for direction in _directions:
board_run = start_board_run((x, y), direction, board)
trie_search = start_trie_search(rootnode)
next(trie_search) #Prime trie_search
letters = []
last_word_end = None
# Try advancing both generators until one runs out. That means we've either hit
# the edge of the board or the bottom of the trie.
#
# Keep track of the letters as we go and the location of the last-found
# word_end flag in the trie. When we hit then end, grab all the letters until
# the last-found flag.
try:
while True:
letter = next(board_run)
letters.append(letter)
word_end = trie_search.send(letter)
if word_end:
last_word_end = len(letters)
except StopIteration:
pass
if last_word_end is not None:
yield ''.join(letters[:last_word_end])
def random_board(width, height):
"""
Returns a Board of random lowercase letters
Args:
width: width of the board
height: height of the board
"""
return Board([[random.choice(string.ascii_lowercase) for _ in range(width)] for _ in range(height)]) | [
2,
48987,
326,
14716,
12,
49309,
13707,
29993,
602,
389,
14434,
284,
43160,
9139,
5965,
198,
2,
32020,
259,
6,
287,
262,
2003,
0,
198,
6738,
11593,
37443,
834,
1330,
17301,
62,
11338,
198,
198,
6738,
1573,
12947,
13,
3526,
1330,
5926,
198,
11748,
4731,
11,
4738,
628,
198,
4299,
923,
62,
3526,
62,
5143,
7,
9688,
11,
4571,
11,
3096,
2599,
198,
220,
37227,
198,
220,
317,
17301,
326,
19299,
25175,
3815,
286,
366,
3526,
1,
3599,
422,
366,
9688,
1,
290,
198,
220,
3867,
287,
366,
37295,
1600,
8620,
257,
13707,
29993,
341,
618,
262,
5743,
286,
262,
3096,
318,
198,
220,
12606,
13,
628,
220,
366,
37295,
1,
318,
2087,
355,
257,
15879,
284,
262,
1459,
2292,
319,
790,
24415,
13,
198,
220,
1114,
1672,
11,
329,
923,
796,
357,
15,
11,
15,
8,
290,
4571,
796,
357,
16,
11,
16,
828,
428,
481,
7800,
262,
7475,
198,
220,
379,
357,
15,
11,
15,
828,
357,
16,
11,
16,
828,
357,
17,
11,
17,
828,
3503,
13,
628,
220,
943,
14542,
25,
198,
220,
220,
220,
923,
25,
257,
362,
12,
83,
29291,
286,
493,
82,
357,
87,
11,
88,
8,
329,
543,
22715,
284,
923,
379,
287,
366,
3526,
1,
198,
220,
220,
220,
4571,
25,
257,
362,
12,
83,
29291,
286,
493,
82,
357,
87,
11,
88,
8,
286,
543,
4571,
284,
11629,
378,
287,
13,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5747,
2124,
290,
331,
815,
307,
530,
286,
13841,
16,
11,
657,
11,
352,
8,
290,
357,
15,
11,
657,
8,
318,
12515,
13,
198,
220,
220,
220,
3096,
25,
257,
5926,
284,
2989,
287,
628,
220,
575,
1164,
82,
25,
1306,
3850,
287,
1057,
357,
4906,
8338,
319,
3096,
1988,
2099,
8,
198,
220,
37227,
198,
220,
611,
407,
477,
7,
67,
287,
13841,
16,
11,
657,
11,
352,
8,
329,
288,
287,
4571,
2599,
198,
220,
220,
220,
5298,
11052,
12331,
10786,
3237,
3815,
287,
4571,
815,
307,
530,
286,
13841,
16,
11,
657,
11,
352,
828,
1392,
23884,
4458,
18982,
7,
37295,
4008,
198,
220,
611,
4571,
6624,
357,
15,
11,
657,
2599,
198,
220,
220,
220,
5298,
11052,
12331,
7203,
35,
4154,
2314,
307,
357,
15,
11,
657,
8,
4943,
628,
220,
1090,
62,
457,
796,
923,
198,
220,
1949,
25,
198,
220,
220,
220,
981,
6407,
25,
198,
220,
220,
220,
220,
220,
7800,
3096,
58,
22019,
62,
457,
58,
15,
4357,
1090,
62,
457,
58,
16,
11907,
198,
220,
220,
220,
220,
220,
1090,
62,
457,
796,
357,
22019,
62,
457,
58,
15,
60,
1343,
4571,
58,
15,
4357,
1090,
62,
457,
58,
16,
60,
1343,
4571,
58,
16,
12962,
198,
220,
2845,
12901,
12331,
25,
198,
220,
220,
220,
1441,
628,
198,
4299,
923,
62,
83,
5034,
62,
12947,
7,
15763,
2599,
198,
220,
37227,
198,
220,
317,
17301,
326,
34322,
15455,
866,
257,
1333,
68,
13,
1649,
1813,
257,
3850,
351,
198,
220,
366,
83,
5034,
62,
12947,
13,
21280,
7,
9291,
42501,
340,
857,
262,
1708,
25,
198,
220,
532,
1002,
262,
3850,
318,
407,
257,
1200,
286,
262,
1459,
10139,
11,
5298,
257,
13707,
29993,
341,
198,
220,
532,
1002,
262,
3850,
318,
257,
1200,
286,
262,
1459,
10139,
11,
2922,
340,
11,
290,
7800,
1771,
340,
198,
220,
220,
220,
5645,
257,
1573,
628,
220,
921,
1276,
366,
35505,
1,
262,
17301,
416,
4585,
1306,
3419,
393,
764,
21280,
7,
14202,
8,
319,
340,
198,
220,
1752,
878,
764,
21280,
3419,
12,
278,
262,
717,
3850,
13,
628,
220,
943,
14542,
25,
198,
220,
220,
220,
6808,
25,
6808,
309,
5034,
19667,
284,
2221,
262,
2989,
351,
628,
220,
575,
1164,
82,
25,
1771,
262,
3850,
5645,
257,
1573,
357,
30388,
8,
198,
220,
37227,
198,
220,
1090,
62,
17440,
796,
6808,
198,
220,
3850,
796,
6045,
198,
220,
220,
198,
220,
981,
6407,
25,
198,
220,
220,
220,
3850,
796,
7800,
1090,
62,
17440,
13,
4775,
62,
437,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
1090,
62,
17440,
796,
1090,
62,
17440,
13,
17197,
58,
9291,
60,
198,
220,
220,
220,
2845,
7383,
12331,
25,
198,
220,
220,
220,
220,
220,
1441,
628,
198,
2,
7343,
286,
2124,
11,
88,
30104,
357,
28047,
2374,
8,
329,
477,
11678,
257,
1573,
460,
307,
1043,
287,
11,
1312,
13,
68,
13,
22052,
198,
2,
393,
16196,
287,
15274,
393,
15180,
11,
290,
319,
2566,
1840,
874,
13,
198,
2,
412,
13,
70,
13,
357,
15,
11,
352,
8,
796,
866,
11,
357,
16,
11,
352,
8,
796,
40039,
866,
12,
3506,
11,
357,
16,
11,
657,
8,
796,
826,
11,
2644,
198,
62,
12942,
507,
796,
47527,
87,
11,
331,
8,
329,
2124,
287,
2837,
32590,
16,
11,
362,
8,
329,
331,
287,
2837,
13841,
16,
11,
362,
8,
611,
407,
357,
87,
6624,
657,
290,
331,
6624,
657,
15437,
628,
198,
4299,
2989,
62,
3526,
7,
3526,
11,
6808,
17440,
2599,
198,
220,
37227,
198,
220,
317,
17301,
326,
15455,
329,
2456,
287,
366,
3526,
1,
1262,
262,
1333,
68,
19459,
416,
366,
15763,
17440,
1,
198,
220,
290,
19299,
262,
2456,
1043,
13,
628,
220,
943,
14542,
25,
198,
220,
220,
220,
3096,
25,
257,
5926,
284,
2989,
198,
220,
220,
220,
6808,
17440,
25,
257,
309,
5034,
19667,
326,
11135,
257,
1333,
68,
973,
284,
5911,
2456,
628,
220,
575,
1164,
82,
25,
257,
1573,
1043,
287,
3096,
357,
8841,
8,
198,
220,
37227,
198,
220,
329,
2124,
11,
331,
11,
3850,
287,
3096,
25,
198,
220,
220,
220,
329,
4571,
287,
4808,
12942,
507,
25,
198,
220,
220,
220,
220,
220,
3096,
62,
5143,
796,
923,
62,
3526,
62,
5143,
19510,
87,
11,
331,
828,
4571,
11,
3096,
8,
198,
220,
220,
220,
220,
220,
1333,
68,
62,
12947,
796,
923,
62,
83,
5034,
62,
12947,
7,
15763,
17440,
8,
198,
220,
220,
220,
220,
220,
1306,
7,
83,
5034,
62,
12947,
8,
220,
220,
1303,
26405,
1333,
68,
62,
12947,
198,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
7475,
796,
17635,
198,
220,
220,
220,
220,
220,
938,
62,
4775,
62,
437,
796,
6045,
628,
220,
220,
220,
220,
220,
1303,
9993,
19988,
1111,
27298,
1566,
530,
4539,
503,
13,
1320,
1724,
356,
1053,
2035,
2277,
198,
220,
220,
220,
220,
220,
1303,
262,
5743,
286,
262,
3096,
393,
262,
4220,
286,
262,
1333,
68,
13,
198,
220,
220,
220,
220,
220,
1303,
198,
220,
220,
220,
220,
220,
1303,
9175,
2610,
286,
262,
7475,
355,
356,
467,
290,
262,
4067,
286,
262,
938,
12,
9275,
198,
220,
220,
220,
220,
220,
1303,
1573,
62,
437,
6056,
287,
262,
1333,
68,
13,
1649,
356,
2277,
788,
886,
11,
5552,
477,
262,
7475,
1566,
198,
220,
220,
220,
220,
220,
1303,
262,
938,
12,
9275,
6056,
13,
198,
220,
220,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
981,
6407,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3850,
796,
1306,
7,
3526,
62,
5143,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7475,
13,
33295,
7,
9291,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1573,
62,
437,
796,
1333,
68,
62,
12947,
13,
21280,
7,
9291,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
1573,
62,
437,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
938,
62,
4775,
62,
437,
796,
18896,
7,
15653,
8,
198,
220,
220,
220,
220,
220,
2845,
13707,
29993,
341,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1208,
628,
220,
220,
220,
220,
220,
611,
938,
62,
4775,
62,
437,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
7800,
705,
4458,
22179,
7,
15653,
58,
25,
12957,
62,
4775,
62,
437,
12962,
628,
198,
4299,
4738,
62,
3526,
7,
10394,
11,
6001,
2599,
198,
220,
37227,
198,
220,
16409,
257,
5926,
286,
4738,
2793,
7442,
7475,
198,
220,
220,
198,
220,
943,
14542,
25,
198,
220,
220,
220,
9647,
25,
9647,
286,
262,
3096,
198,
220,
220,
220,
6001,
25,
6001,
286,
262,
3096,
198,
220,
37227,
198,
220,
1441,
5926,
26933,
58,
25120,
13,
25541,
7,
8841,
13,
292,
979,
72,
62,
21037,
7442,
8,
329,
4808,
287,
2837,
7,
10394,
15437,
329,
4808,
287,
2837,
7,
17015,
8,
12962
] | 2.81179 | 1,408 |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class GetSnapshotIdsResult:
"""
A collection of values returned by getSnapshotIds.
"""
# pylint: disable=using-constant-test
def get_snapshot_ids(filters=None,owners=None,restorable_by_user_ids=None,opts=None):
"""
Use this data source to get a list of EBS Snapshot IDs matching the specified
criteria.
## Example Usage
```python
import pulumi
import pulumi_aws as aws
ebs_volumes = aws.ebs.get_snapshot_ids(filters=[
{
"name": "volume-size",
"values": ["40"],
},
{
"name": "tag:Name",
"values": ["Example"],
},
],
owners=["self"])
```
:param list filters: One or more name/value pairs to filter off of. There are
several valid keys, for a full reference, check out
[describe-volumes in the AWS CLI reference][1].
:param list owners: Returns the snapshots owned by the specified owner id. Multiple owners can be specified.
:param list restorable_by_user_ids: One or more AWS accounts IDs that can create volumes from the snapshot.
The **filters** object supports the following:
* `name` (`str`)
* `values` (`list`)
"""
__args__ = dict()
__args__['filters'] = filters
__args__['owners'] = owners
__args__['restorableByUserIds'] = restorable_by_user_ids
if opts is None:
opts = pulumi.InvokeOptions()
if opts.version is None:
opts.version = utilities.get_version()
__ret__ = pulumi.runtime.invoke('aws:ebs/getSnapshotIds:getSnapshotIds', __args__, opts=opts).value
return AwaitableGetSnapshotIdsResult(
filters=__ret__.get('filters'),
id=__ret__.get('id'),
ids=__ret__.get('ids'),
owners=__ret__.get('owners'),
restorable_by_user_ids=__ret__.get('restorableByUserIds'))
| [
2,
19617,
28,
40477,
12,
23,
198,
2,
17202,
39410,
25,
428,
2393,
373,
7560,
416,
262,
21624,
12994,
24118,
687,
10290,
357,
27110,
5235,
8,
16984,
13,
17202,
198,
2,
17202,
2141,
407,
4370,
416,
1021,
4556,
345,
821,
1728,
345,
760,
644,
345,
389,
1804,
0,
17202,
198,
198,
11748,
33918,
198,
11748,
14601,
198,
11748,
17472,
12994,
198,
11748,
17472,
12994,
13,
43282,
198,
6738,
19720,
1330,
4479,
198,
6738,
11485,
1330,
20081,
11,
8893,
198,
198,
4871,
3497,
43826,
9442,
7390,
82,
23004,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
317,
4947,
286,
3815,
4504,
416,
651,
43826,
9442,
7390,
82,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1303,
279,
2645,
600,
25,
15560,
28,
3500,
12,
9979,
415,
12,
9288,
198,
198,
4299,
651,
62,
45380,
9442,
62,
2340,
7,
10379,
1010,
28,
14202,
11,
15605,
28,
14202,
11,
2118,
10475,
62,
1525,
62,
7220,
62,
2340,
28,
14202,
11,
404,
912,
28,
14202,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
5765,
428,
1366,
2723,
284,
651,
257,
1351,
286,
412,
4462,
16026,
9442,
32373,
12336,
262,
7368,
198,
220,
220,
220,
9987,
13,
628,
220,
220,
220,
22492,
17934,
29566,
628,
628,
220,
220,
220,
7559,
63,
29412,
198,
220,
220,
220,
1330,
17472,
12994,
198,
220,
220,
220,
1330,
17472,
12994,
62,
8356,
355,
3253,
82,
628,
220,
220,
220,
304,
1443,
62,
10396,
8139,
796,
3253,
82,
13,
68,
1443,
13,
1136,
62,
45380,
9442,
62,
2340,
7,
10379,
1010,
41888,
198,
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,
366,
3672,
1298,
366,
29048,
12,
7857,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
27160,
1298,
14631,
1821,
33116,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8964,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
3672,
1298,
366,
12985,
25,
5376,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
27160,
1298,
14631,
16281,
33116,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8964,
198,
220,
220,
220,
220,
220,
220,
220,
16589,
198,
220,
220,
220,
220,
220,
220,
220,
4393,
28,
14692,
944,
8973,
8,
198,
220,
220,
220,
7559,
63,
628,
198,
220,
220,
220,
1058,
17143,
1351,
16628,
25,
1881,
393,
517,
1438,
14,
8367,
14729,
284,
8106,
572,
286,
13,
1318,
389,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1811,
4938,
8251,
11,
329,
257,
1336,
4941,
11,
2198,
503,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
685,
20147,
4892,
12,
10396,
8139,
287,
262,
30865,
43749,
4941,
7131,
16,
4083,
198,
220,
220,
220,
1058,
17143,
1351,
4393,
25,
16409,
262,
47787,
6898,
416,
262,
7368,
4870,
4686,
13,
20401,
4393,
460,
307,
7368,
13,
198,
220,
220,
220,
1058,
17143,
1351,
1334,
10475,
62,
1525,
62,
7220,
62,
2340,
25,
1881,
393,
517,
30865,
5504,
32373,
326,
460,
2251,
15343,
422,
262,
27479,
13,
628,
220,
220,
220,
383,
12429,
10379,
1010,
1174,
2134,
6971,
262,
1708,
25,
628,
220,
220,
220,
220,
220,
1635,
4600,
3672,
63,
357,
63,
2536,
63,
8,
198,
220,
220,
220,
220,
220,
1635,
4600,
27160,
63,
357,
63,
4868,
63,
8,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
11593,
22046,
834,
796,
8633,
3419,
628,
198,
220,
220,
220,
11593,
22046,
834,
17816,
10379,
1010,
20520,
796,
16628,
198,
220,
220,
220,
11593,
22046,
834,
17816,
15605,
20520,
796,
4393,
198,
220,
220,
220,
11593,
22046,
834,
17816,
2118,
10475,
3886,
12982,
7390,
82,
20520,
796,
1334,
10475,
62,
1525,
62,
7220,
62,
2340,
198,
220,
220,
220,
611,
2172,
82,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2172,
82,
796,
17472,
12994,
13,
19904,
2088,
29046,
3419,
198,
220,
220,
220,
611,
2172,
82,
13,
9641,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2172,
82,
13,
9641,
796,
20081,
13,
1136,
62,
9641,
3419,
198,
220,
220,
220,
11593,
1186,
834,
796,
17472,
12994,
13,
43282,
13,
37669,
10786,
8356,
25,
68,
1443,
14,
1136,
43826,
9442,
7390,
82,
25,
1136,
43826,
9442,
7390,
82,
3256,
11593,
22046,
834,
11,
2172,
82,
28,
404,
912,
737,
8367,
628,
220,
220,
220,
1441,
5851,
4548,
540,
3855,
43826,
9442,
7390,
82,
23004,
7,
198,
220,
220,
220,
220,
220,
220,
220,
16628,
28,
834,
1186,
834,
13,
1136,
10786,
10379,
1010,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
4686,
28,
834,
1186,
834,
13,
1136,
10786,
312,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
2340,
28,
834,
1186,
834,
13,
1136,
10786,
2340,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
4393,
28,
834,
1186,
834,
13,
1136,
10786,
15605,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
1334,
10475,
62,
1525,
62,
7220,
62,
2340,
28,
834,
1186,
834,
13,
1136,
10786,
2118,
10475,
3886,
12982,
7390,
82,
6,
4008,
198
] | 2.487064 | 889 |
#!/usr/bin/python3
import re
import requests
from time import sleep
from argparse import ArgumentParser
if __name__ == '__main__':
args = get_args()
data = ''
pattern = 'QCTF{.*?}'
while not re.search(pattern, data):
update = requests.get('%s/%s/' % (args.url, args.token)).text
hexcode = re.search('\>([\w\s]*?)\<\/div', update).group(1)
if not hexcode:
continue
text = ''.join([chr(int(code, 16)) for code in hexcode.split(' ')])
if text not in data:
data += text
print('Downloaded text length: %d' % len(data))
sleep(args.timeout)
print(data)
print()
print('Found flag!')
print(re.search(pattern, data).group(0))
| [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
11748,
302,
198,
11748,
7007,
198,
198,
6738,
640,
1330,
3993,
198,
6738,
1822,
29572,
1330,
45751,
46677,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
26498,
796,
651,
62,
22046,
3419,
198,
220,
220,
220,
1366,
796,
10148,
198,
220,
220,
220,
3912,
796,
705,
48,
4177,
37,
90,
15885,
30,
92,
6,
198,
220,
220,
220,
981,
407,
302,
13,
12947,
7,
33279,
11,
1366,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
4296,
796,
7007,
13,
1136,
10786,
4,
82,
14,
4,
82,
14,
6,
4064,
357,
22046,
13,
6371,
11,
26498,
13,
30001,
29720,
5239,
198,
220,
220,
220,
220,
220,
220,
220,
17910,
8189,
796,
302,
13,
12947,
10786,
59,
29,
26933,
59,
86,
59,
82,
60,
9,
10091,
49778,
11139,
7146,
3256,
4296,
737,
8094,
7,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
611,
407,
17910,
8189,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2555,
198,
220,
220,
220,
220,
220,
220,
220,
2420,
796,
705,
4458,
22179,
26933,
354,
81,
7,
600,
7,
8189,
11,
1467,
4008,
329,
2438,
287,
17910,
8189,
13,
35312,
10786,
705,
8,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2420,
407,
287,
1366,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
15853,
2420,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
10002,
276,
2420,
4129,
25,
4064,
67,
6,
4064,
18896,
7,
7890,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
3993,
7,
22046,
13,
48678,
8,
198,
220,
220,
220,
3601,
7,
7890,
8,
198,
220,
220,
220,
3601,
3419,
198,
220,
220,
220,
3601,
10786,
21077,
6056,
0,
11537,
198,
220,
220,
220,
3601,
7,
260,
13,
12947,
7,
33279,
11,
1366,
737,
8094,
7,
15,
4008,
198
] | 2.26935 | 323 |
import pycountry
from django.db import migrations
| [
11748,
12972,
19315,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628,
198
] | 3.533333 | 15 |
# This file is code generated
import ctypes
simple_string = ctypes.c_char * 1024
UInt64 = ctypes.c_ulonglong
ResourceHandle = ctypes.c_void_p
EnumResourceHandle = ctypes.c_void_p
EnumSoftwareFeedHandle = ctypes.c_void_p
SessionHandle = ctypes.c_void_p
TimestampUTC = ctypes.c_uint * 4
EnumSoftwareComponentHandle = ctypes.c_void_p
EnumDependencyHandle = ctypes.c_void_p
SoftwareSetHandle = ctypes.c_void_p
FilterHandle = ctypes.c_void_p
EnumExpertHandle = ctypes.c_void_p
EnumSystemHandle = ctypes.c_void_p
EnumSoftwareSetHandle = ctypes.c_void_p
| [
2,
770,
2393,
318,
2438,
7560,
198,
198,
11748,
269,
19199,
198,
198,
36439,
62,
8841,
796,
269,
19199,
13,
66,
62,
10641,
1635,
28119,
198,
198,
52,
5317,
2414,
796,
269,
19199,
13,
66,
62,
377,
506,
6511,
198,
26198,
37508,
796,
269,
19199,
13,
66,
62,
19382,
62,
79,
198,
4834,
388,
26198,
37508,
796,
269,
19199,
13,
66,
62,
19382,
62,
79,
198,
4834,
388,
25423,
18332,
37508,
796,
269,
19199,
13,
66,
62,
19382,
62,
79,
198,
36044,
37508,
796,
269,
19199,
13,
66,
62,
19382,
62,
79,
198,
14967,
27823,
17429,
796,
269,
19199,
13,
66,
62,
28611,
1635,
604,
198,
4834,
388,
25423,
21950,
37508,
796,
269,
19199,
13,
66,
62,
19382,
62,
79,
198,
4834,
388,
35,
2690,
1387,
37508,
796,
269,
19199,
13,
66,
62,
19382,
62,
79,
198,
25423,
7248,
37508,
796,
269,
19199,
13,
66,
62,
19382,
62,
79,
198,
22417,
37508,
796,
269,
19199,
13,
66,
62,
19382,
62,
79,
198,
4834,
388,
3109,
11766,
37508,
796,
269,
19199,
13,
66,
62,
19382,
62,
79,
198,
4834,
388,
11964,
37508,
796,
269,
19199,
13,
66,
62,
19382,
62,
79,
198,
4834,
388,
25423,
7248,
37508,
796,
269,
19199,
13,
66,
62,
19382,
62,
79,
198
] | 2.669903 | 206 |
import os
import random
import string
from flask import Flask, render_template, request, redirect, url_for
app = Flask(__name__)
COMPLAINTS_DIR = 'complaints'
os.makedirs(COMPLAINTS_DIR, exist_ok=True)
@app.route('/')
@app.route('/complaint', methods=['GET'])
@app.route('/complaint', methods=['POST'])
if __name__ == '__main__':
app.run(host='0.0.0.0', port=4000)
| [
11748,
28686,
198,
11748,
4738,
198,
11748,
4731,
198,
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
2581,
11,
18941,
11,
19016,
62,
1640,
198,
1324,
796,
46947,
7,
834,
3672,
834,
8,
198,
198,
9858,
6489,
29833,
4694,
62,
34720,
796,
705,
23855,
6003,
6,
198,
418,
13,
76,
4335,
17062,
7,
9858,
6489,
29833,
4694,
62,
34720,
11,
2152,
62,
482,
28,
17821,
8,
198,
198,
31,
1324,
13,
38629,
10786,
14,
11537,
198,
198,
31,
1324,
13,
38629,
10786,
14,
23855,
2913,
3256,
5050,
28,
17816,
18851,
6,
12962,
198,
198,
31,
1324,
13,
38629,
10786,
14,
23855,
2913,
3256,
5050,
28,
17816,
32782,
6,
12962,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
598,
13,
5143,
7,
4774,
11639,
15,
13,
15,
13,
15,
13,
15,
3256,
2493,
28,
27559,
8,
198
] | 2.57931 | 145 |
# -*- coding: utf-8 -*-
from django.template import Template, Context, loader, TemplateDoesNotExist
from django.contrib.sites.models import Site
from django.core.mail import EmailMultiAlternatives
from django.template.defaultfilters import striptags
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
42625,
14208,
13,
28243,
1330,
37350,
11,
30532,
11,
40213,
11,
37350,
13921,
3673,
3109,
396,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
49315,
13,
27530,
1330,
14413,
198,
6738,
42625,
14208,
13,
7295,
13,
4529,
1330,
9570,
29800,
23081,
2929,
198,
6738,
42625,
14208,
13,
28243,
13,
12286,
10379,
1010,
1330,
336,
1968,
3775,
628,
628,
628,
628
] | 3.426667 | 75 |
import string
import random as rnd
for u in range(1000):
p1 = random_password()
print(p1)
| [
11748,
4731,
198,
11748,
4738,
355,
374,
358,
198,
198,
1640,
334,
287,
2837,
7,
12825,
2599,
198,
220,
220,
220,
279,
16,
796,
4738,
62,
28712,
3419,
198,
220,
220,
220,
3601,
7,
79,
16,
8,
198
] | 2.605263 | 38 |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This module is largely a wrapper around `jaxlib` that performs version
# checking on import.
import jaxlib
_minimum_jaxlib_version = (0, 1, 31)
try:
from jaxlib import version as jaxlib_version
except:
# jaxlib is too old to have version number.
msg = 'This version of jax requires jaxlib version >= {}.'
raise ImportError(msg.format('.'.join(map(str, _minimum_jaxlib_version))))
version = tuple(int(x) for x in jaxlib_version.__version__.split('.'))
# Check the jaxlib version before importing anything else from jaxlib.
_check_jaxlib_version()
from jaxlib import xla_client
from jaxlib import xrt
from jaxlib import lapack
from jaxlib import pytree
from jaxlib import cusolver
| [
2,
15069,
2864,
3012,
11419,
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,
198,
2,
770,
8265,
318,
5688,
257,
29908,
1088,
4600,
73,
897,
8019,
63,
326,
17706,
2196,
198,
2,
10627,
319,
1330,
13,
198,
198,
11748,
474,
897,
8019,
198,
198,
62,
39504,
62,
73,
897,
8019,
62,
9641,
796,
357,
15,
11,
352,
11,
3261,
8,
198,
28311,
25,
198,
220,
422,
474,
897,
8019,
1330,
2196,
355,
474,
897,
8019,
62,
9641,
198,
16341,
25,
198,
220,
1303,
474,
897,
8019,
318,
1165,
1468,
284,
423,
2196,
1271,
13,
198,
220,
31456,
796,
705,
1212,
2196,
286,
474,
897,
4433,
474,
897,
8019,
2196,
18189,
23884,
2637,
198,
220,
5298,
17267,
12331,
7,
19662,
13,
18982,
10786,
2637,
13,
22179,
7,
8899,
7,
2536,
11,
4808,
39504,
62,
73,
897,
8019,
62,
9641,
35514,
198,
198,
9641,
796,
46545,
7,
600,
7,
87,
8,
329,
2124,
287,
474,
897,
8019,
62,
9641,
13,
834,
9641,
834,
13,
35312,
10786,
2637,
4008,
198,
198,
2,
6822,
262,
474,
897,
8019,
2196,
878,
33332,
1997,
2073,
422,
474,
897,
8019,
13,
198,
198,
62,
9122,
62,
73,
897,
8019,
62,
9641,
3419,
628,
198,
6738,
474,
897,
8019,
1330,
2124,
5031,
62,
16366,
198,
6738,
474,
897,
8019,
1330,
2124,
17034,
198,
6738,
474,
897,
8019,
1330,
14779,
441,
198,
198,
6738,
474,
897,
8019,
1330,
12972,
21048,
198,
6738,
474,
897,
8019,
1330,
269,
385,
14375,
198
] | 3.385638 | 376 |
# Copyright (c) 2022 Dai HBG
"""
获得日频指数成分股数据
日志
2022-01-05
- init,迁移原本功能
2022-01-08
- 更新:传入dates
- 增量更新
2022-01-11
- 更新:新增多种指数
"""
from jqdatasdk import *
import os
import pickle
import numpy as np
| [
2,
15069,
357,
66,
8,
33160,
39604,
25997,
38,
628,
198,
37811,
198,
164,
236,
115,
36181,
245,
33768,
98,
165,
95,
239,
162,
234,
229,
46763,
108,
22755,
238,
26344,
228,
164,
224,
94,
46763,
108,
162,
235,
106,
198,
198,
33768,
98,
33232,
245,
198,
1238,
1828,
12,
486,
12,
2713,
198,
12,
2315,
171,
120,
234,
32573,
223,
163,
100,
119,
43889,
253,
17312,
105,
27950,
253,
47797,
121,
198,
1238,
1828,
12,
486,
12,
2919,
198,
12,
10545,
249,
112,
23877,
108,
171,
120,
248,
27670,
254,
17739,
98,
19581,
198,
12,
10263,
95,
252,
34932,
237,
162,
249,
112,
23877,
108,
198,
1238,
1828,
12,
486,
12,
1157,
198,
12,
10545,
249,
112,
23877,
108,
171,
120,
248,
23877,
108,
161,
95,
252,
13783,
248,
163,
100,
235,
162,
234,
229,
46763,
108,
198,
37811,
628,
198,
6738,
474,
80,
19608,
292,
34388,
1330,
1635,
198,
11748,
28686,
198,
11748,
2298,
293,
198,
11748,
299,
32152,
355,
45941,
628
] | 1.243902 | 164 |
from get_set_login_data import get_login_data
from instaling import start_instaling
if __name__ == "__main__":
main() | [
6738,
651,
62,
2617,
62,
38235,
62,
7890,
1330,
651,
62,
38235,
62,
7890,
198,
6738,
916,
4272,
1330,
923,
62,
8625,
4272,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419
] | 2.97561 | 41 |
var = "Casper"
print ("Value 1:", var)
var = 23
print ("Value 2:", var)
var = "You get the point"
print ("Value 3:", var) | [
7785,
796,
366,
34,
32981,
1,
201,
198,
4798,
5855,
11395,
352,
25,
1600,
1401,
8,
201,
198,
7785,
796,
2242,
201,
198,
4798,
5855,
11395,
362,
25,
1600,
1401,
8,
201,
198,
7785,
796,
366,
1639,
651,
262,
966,
1,
201,
198,
4798,
5855,
11395,
513,
25,
1600,
1401,
8
] | 2.470588 | 51 |
FRAGMENT_PRODUCT = """
fragment fragmentProduct on Product {
productId
typeId
type_ {
typeId
name
}
attributesUnicodeText {
edges {
node {
name
field {
name
type_
}
value
}
}
}
attributesBoolean {
edges {
node {
name
field {
name
type_
}
value
}
}
}
attributesInteger {
edges {
node {
name
field {
name
type_
}
value
}
}
}
attributesFloat {
edges {
node {
name
field {
name
type_
}
value
}
}
}
attributesDate {
edges {
node {
name
field {
name
type_
}
value
}
}
}
attributesDateTime {
edges {
node {
name
field {
name
type_
}
value
}
}
}
attributesTime {
edges {
node {
name
field {
name
type_
}
value
}
}
}
name
contact
dateProduced
producedBy
timePosted
postedBy
postingGitHubUser {
login
}
timeUpdated
updatedBy
updatingGitHubUser {
login
}
paths {
edges {
node {
pathId
path
note
}
}
}
relations {
edges {
node {
relationId
typeId
type_ {
typeId
name
}
otherProductId
other {
productId
typeId
type_ {
typeId
name
}
name
}
reverseRelationId
reverse {
relationId
typeId
type_ {
typeId
name
}
}
}
}
}
note
}
"""
| [
37,
33202,
10979,
62,
4805,
28644,
796,
37227,
198,
8310,
363,
434,
24225,
15667,
319,
8721,
1391,
198,
220,
1720,
7390,
198,
220,
2099,
7390,
198,
220,
2099,
62,
1391,
198,
220,
220,
220,
2099,
7390,
198,
220,
220,
220,
1438,
198,
220,
1782,
198,
220,
12608,
3118,
291,
1098,
8206,
1391,
198,
220,
220,
220,
13015,
1391,
198,
220,
220,
220,
220,
220,
10139,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
198,
220,
220,
220,
220,
220,
220,
220,
2214,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
62,
198,
220,
220,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
220,
220,
220,
220,
1988,
198,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
1782,
198,
220,
1782,
198,
220,
12608,
46120,
13087,
1391,
198,
220,
220,
220,
13015,
1391,
198,
220,
220,
220,
220,
220,
10139,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
198,
220,
220,
220,
220,
220,
220,
220,
2214,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
62,
198,
220,
220,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
220,
220,
220,
220,
1988,
198,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
1782,
198,
220,
1782,
198,
220,
12608,
46541,
1391,
198,
220,
220,
220,
13015,
1391,
198,
220,
220,
220,
220,
220,
10139,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
198,
220,
220,
220,
220,
220,
220,
220,
2214,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
62,
198,
220,
220,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
220,
220,
220,
220,
1988,
198,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
1782,
198,
220,
1782,
198,
220,
12608,
43879,
1391,
198,
220,
220,
220,
13015,
1391,
198,
220,
220,
220,
220,
220,
10139,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
198,
220,
220,
220,
220,
220,
220,
220,
2214,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
62,
198,
220,
220,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
220,
220,
220,
220,
1988,
198,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
1782,
198,
220,
1782,
198,
220,
12608,
10430,
1391,
198,
220,
220,
220,
13015,
1391,
198,
220,
220,
220,
220,
220,
10139,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
198,
220,
220,
220,
220,
220,
220,
220,
2214,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
62,
198,
220,
220,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
220,
220,
220,
220,
1988,
198,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
1782,
198,
220,
1782,
198,
220,
12608,
10430,
7575,
1391,
198,
220,
220,
220,
13015,
1391,
198,
220,
220,
220,
220,
220,
10139,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
198,
220,
220,
220,
220,
220,
220,
220,
2214,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
62,
198,
220,
220,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
220,
220,
220,
220,
1988,
198,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
1782,
198,
220,
1782,
198,
220,
12608,
7575,
1391,
198,
220,
220,
220,
13015,
1391,
198,
220,
220,
220,
220,
220,
10139,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
198,
220,
220,
220,
220,
220,
220,
220,
2214,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
62,
198,
220,
220,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
220,
220,
220,
220,
1988,
198,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
1782,
198,
220,
1782,
198,
220,
1438,
198,
220,
2800,
198,
220,
3128,
11547,
771,
198,
220,
4635,
3886,
198,
220,
640,
14231,
198,
220,
4481,
3886,
198,
220,
10754,
38,
270,
16066,
12982,
1391,
198,
220,
220,
220,
17594,
198,
220,
1782,
198,
220,
640,
17354,
198,
220,
6153,
3886,
198,
220,
19698,
38,
270,
16066,
12982,
1391,
198,
220,
220,
220,
17594,
198,
220,
1782,
198,
220,
13532,
1391,
198,
220,
220,
220,
13015,
1391,
198,
220,
220,
220,
220,
220,
10139,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
3108,
7390,
198,
220,
220,
220,
220,
220,
220,
220,
3108,
198,
220,
220,
220,
220,
220,
220,
220,
3465,
198,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
1782,
198,
220,
1782,
198,
220,
2316,
1391,
198,
220,
220,
220,
13015,
1391,
198,
220,
220,
220,
220,
220,
10139,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
8695,
7390,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
7390,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
62,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
7390,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
198,
220,
220,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
220,
220,
220,
220,
584,
15667,
7390,
198,
220,
220,
220,
220,
220,
220,
220,
584,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1720,
7390,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
7390,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
62,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
7390,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
198,
220,
220,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
220,
220,
220,
220,
9575,
6892,
341,
7390,
198,
220,
220,
220,
220,
220,
220,
220,
9575,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8695,
7390,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
7390,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
62,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
7390,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
220,
220,
1782,
198,
220,
220,
220,
1782,
198,
220,
1782,
198,
220,
3465,
198,
92,
198,
37811,
198
] | 1.6465 | 1,157 |
# coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from swagger_server.models.base_model_ import Model
from swagger_server import util
class ConcentrationSeries(Model):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
def __init__(self, concentrationlist: List[float]=None): # noqa: E501
"""ConcentrationSeries - a model defined in Swagger
:param concentrationlist: The concentrationlist of this ConcentrationSeries. # noqa: E501
:type concentrationlist: List[float]
"""
self.swagger_types = {
'concentrationlist': List[float]
}
self.attribute_map = {
'concentrationlist': 'concentrationlist'
}
self._concentrationlist = concentrationlist
@classmethod
def from_dict(cls, dikt) -> 'ConcentrationSeries':
"""Returns the dict as a model
:param dikt: A dict.
:type: dict
:return: The ConcentrationSeries of this ConcentrationSeries. # noqa: E501
:rtype: ConcentrationSeries
"""
return util.deserialize_model(dikt, cls)
@property
def concentrationlist(self) -> List[float]:
"""Gets the concentrationlist of this ConcentrationSeries.
:return: The concentrationlist of this ConcentrationSeries.
:rtype: List[float]
"""
return self._concentrationlist
@concentrationlist.setter
def concentrationlist(self, concentrationlist: List[float]):
"""Sets the concentrationlist of this ConcentrationSeries.
:param concentrationlist: The concentrationlist of this ConcentrationSeries.
:type concentrationlist: List[float]
"""
if concentrationlist is None:
raise ValueError("Invalid value for `concentrationlist`, must not be `None`") # noqa: E501
self._concentrationlist = concentrationlist
| [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
4818,
8079,
1330,
3128,
11,
4818,
8079,
220,
1303,
645,
20402,
25,
376,
21844,
198,
198,
6738,
19720,
1330,
7343,
11,
360,
713,
220,
1303,
645,
20402,
25,
376,
21844,
198,
198,
6738,
1509,
7928,
62,
15388,
13,
27530,
13,
8692,
62,
19849,
62,
1330,
9104,
198,
6738,
1509,
7928,
62,
15388,
1330,
7736,
628,
198,
4871,
37613,
1358,
27996,
7,
17633,
2599,
198,
220,
220,
220,
37227,
16580,
25,
770,
1398,
318,
8295,
7560,
416,
262,
1509,
7928,
2438,
17301,
1430,
13,
628,
220,
220,
220,
2141,
407,
4370,
262,
1398,
14500,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
10368,
4868,
25,
7343,
58,
22468,
22241,
14202,
2599,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
3103,
1087,
1358,
27996,
532,
257,
2746,
5447,
287,
2451,
7928,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
10368,
4868,
25,
383,
10368,
4868,
286,
428,
37613,
1358,
27996,
13,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
4906,
10368,
4868,
25,
7343,
58,
22468,
60,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
2032,
7928,
62,
19199,
796,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
1102,
1087,
1358,
4868,
10354,
7343,
58,
22468,
60,
198,
220,
220,
220,
220,
220,
220,
220,
1782,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
42348,
62,
8899,
796,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
1102,
1087,
1358,
4868,
10354,
705,
1102,
1087,
1358,
4868,
6,
198,
220,
220,
220,
220,
220,
220,
220,
1782,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
1102,
1087,
1358,
4868,
796,
10368,
4868,
628,
220,
220,
220,
2488,
4871,
24396,
198,
220,
220,
220,
825,
422,
62,
11600,
7,
565,
82,
11,
288,
1134,
83,
8,
4613,
705,
3103,
1087,
1358,
27996,
10354,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
35561,
262,
8633,
355,
257,
2746,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
288,
1134,
83,
25,
317,
8633,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
4906,
25,
8633,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
383,
37613,
1358,
27996,
286,
428,
37613,
1358,
27996,
13,
220,
1303,
645,
20402,
25,
412,
33548,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
81,
4906,
25,
37613,
1358,
27996,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
7736,
13,
8906,
48499,
1096,
62,
19849,
7,
67,
1134,
83,
11,
537,
82,
8,
628,
220,
220,
220,
2488,
26745,
198,
220,
220,
220,
825,
10368,
4868,
7,
944,
8,
4613,
7343,
58,
22468,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
38,
1039,
262,
10368,
4868,
286,
428,
37613,
1358,
27996,
13,
628,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
383,
10368,
4868,
286,
428,
37613,
1358,
27996,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
81,
4906,
25,
7343,
58,
22468,
60,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13557,
1102,
1087,
1358,
4868,
628,
220,
220,
220,
2488,
1102,
1087,
1358,
4868,
13,
2617,
353,
198,
220,
220,
220,
825,
10368,
4868,
7,
944,
11,
10368,
4868,
25,
7343,
58,
22468,
60,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
50,
1039,
262,
10368,
4868,
286,
428,
37613,
1358,
27996,
13,
628,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
10368,
4868,
25,
383,
10368,
4868,
286,
428,
37613,
1358,
27996,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
4906,
10368,
4868,
25,
7343,
58,
22468,
60,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
611,
10368,
4868,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
11052,
12331,
7203,
44651,
1988,
329,
4600,
1102,
1087,
1358,
4868,
47671,
1276,
407,
307,
4600,
14202,
63,
4943,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
1102,
1087,
1358,
4868,
796,
10368,
4868,
198
] | 2.717507 | 754 |
from Algorithm import SearchTree, GraphContainer
from multiprocessing import Process, Queue
import time
| [
6738,
978,
42289,
1330,
11140,
27660,
11,
29681,
29869,
198,
6738,
18540,
305,
919,
278,
1330,
10854,
11,
4670,
518,
198,
11748,
640,
628,
628
] | 4.28 | 25 |
from urllib3_mock import Responses
from anipy import (
AuthenticationProvider,
)
import os
# from anipy.exception import AniException
# from anipy.exception import InternalServerError
# from anipy.exception import InvalidGrantException
# from anipy.exception import InvalidRequestException
# from anipy.exception import UnauthorizedException
| [
6738,
2956,
297,
571,
18,
62,
76,
735,
1330,
20549,
274,
198,
198,
6738,
281,
541,
88,
1330,
357,
198,
220,
220,
220,
48191,
29495,
11,
198,
8,
198,
198,
11748,
28686,
198,
198,
2,
422,
281,
541,
88,
13,
1069,
4516,
1330,
1052,
72,
16922,
198,
2,
422,
281,
541,
88,
13,
1069,
4516,
1330,
18628,
10697,
12331,
198,
2,
422,
281,
541,
88,
13,
1069,
4516,
1330,
17665,
45431,
16922,
198,
2,
422,
281,
541,
88,
13,
1069,
4516,
1330,
17665,
18453,
16922,
198,
2,
422,
281,
541,
88,
13,
1069,
4516,
1330,
791,
19721,
16922,
628
] | 3.535354 | 99 |
from controller.invoker.invoker_cmd_base import BaseMirControllerInvoker
from controller.utils import checker, utils
from id_definition.error_codes import CTLResponseCode
from proto import backend_pb2
| [
6738,
10444,
13,
16340,
11020,
13,
16340,
11020,
62,
28758,
62,
8692,
1330,
7308,
27453,
22130,
19904,
11020,
198,
6738,
10444,
13,
26791,
1330,
2198,
263,
11,
3384,
4487,
198,
6738,
4686,
62,
46758,
13,
18224,
62,
40148,
1330,
327,
14990,
31077,
10669,
198,
6738,
44876,
1330,
30203,
62,
40842,
17,
628
] | 3.884615 | 52 |
from .base import BaseBreadcrumbMixin # noqa
from .create import CreateBreadcrumbMixin # noqa
from .delete import DeleteBreadcrumbMixin # noqa
from .detail import DetailBreadcrumbMixin # noqa
from .list import ListBreadcrumbMixin # noqa
from .update import UpdateBreadcrumbMixin # noqa
| [
6738,
764,
8692,
1330,
7308,
33,
961,
6098,
2178,
35608,
259,
220,
1303,
645,
20402,
198,
6738,
764,
17953,
1330,
13610,
33,
961,
6098,
2178,
35608,
259,
220,
1303,
645,
20402,
198,
6738,
764,
33678,
1330,
23520,
33,
961,
6098,
2178,
35608,
259,
220,
1303,
645,
20402,
198,
6738,
764,
49170,
1330,
42585,
33,
961,
6098,
2178,
35608,
259,
220,
1303,
645,
20402,
198,
6738,
764,
4868,
1330,
7343,
33,
961,
6098,
2178,
35608,
259,
220,
1303,
645,
20402,
198,
6738,
764,
19119,
1330,
10133,
33,
961,
6098,
2178,
35608,
259,
220,
1303,
645,
20402,
198
] | 3.041667 | 96 |
from .data import Data
from .error import Error
from .paged_data import PagedData
from .pagination import Pagination
from .short_url import ShortUrl
__all__ = ["Data", "PagedData", "Error", "Pagination", "ShortUrl"]
| [
6738,
764,
7890,
1330,
6060,
198,
6738,
764,
18224,
1330,
13047,
198,
6738,
764,
79,
1886,
62,
7890,
1330,
350,
1886,
6601,
198,
6738,
764,
79,
363,
1883,
1330,
31525,
1883,
198,
6738,
764,
19509,
62,
6371,
1330,
10073,
28165,
198,
198,
834,
439,
834,
796,
14631,
6601,
1600,
366,
47,
1886,
6601,
1600,
366,
12331,
1600,
366,
47,
363,
1883,
1600,
366,
16438,
28165,
8973,
198
] | 3.238806 | 67 |
# Original by EMC-prog
# UNDER THE MIT LICENSE
import paramiko
import time
import os
import json
import sys
from getpass import getpass
print("ServerChecker")
print("Check and command your linux server without knowing Linux")
time.sleep(2)
os.system('cls' if os.name == 'nt' else 'clear')
#Know if the program has been opened already:
f = open("data/1ststart", "r")
iststart = f.read()
f.close
if iststart == "0":
print("Looks like you haven't started this program before. You have to fill the file located in 'data/info.txt'.")
ok = input("If you have already done the setup, press enter and execute the program again. If you haven't, edit the file with the help of the manual.")
f = open("data/1ststart", "w")
iststart = f.write("1")
f.close
sys.exit()
#open json file with the server data
js = open("data/info.txt", "r")
jsondata = f.read()
file_path = "data/info.txt"
with open(file_path, 'r') as j:
jdfp = json.loads(j.read())
#jdfp = json.loads(jsondata)
f.close
os.system('cls' if os.name == 'nt' else 'clear')
#Initial menu
print("Options avalible for the server: ")
print("1) Check server temperature (NOT WORKING)")
print("2) Reboot the server")
print("3) Shut down the server (in 1 minute)")
print("4) Shut down the server (instantaniously)")
print("5) Custom command (check README)")
option = input("Type a number an then press enter: ")
#Enter the server
host = (jdfp["ip"])
port = (jdfp["port"])
username = (jdfp["user"])
password = getpass("Password for user " + username + ": ")
# Check the number selected:
if option == "1":
command = "echo wip"
elif option == "2":
command = "sudo reboot"
elif option == "3":
command = "sudo shutdown +1"
elif option == "4":
command = "sudo shutdown now"
elif option == "5":
command = (jdfp["custom_command"])
else:
print("ERROR: No command selected. Program will close.")
sys.exit()
#make contact with server and do operation
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(host, port, username, password)
stdin, stdout, stderr = ssh.exec_command(command)
lines = stdout.readlines()
print(lines)
| [
2,
13745,
416,
412,
9655,
12,
1676,
70,
198,
2,
35219,
3336,
17168,
38559,
24290,
628,
198,
11748,
5772,
12125,
198,
11748,
640,
198,
11748,
28686,
198,
11748,
33918,
198,
11748,
25064,
198,
6738,
651,
6603,
1330,
651,
6603,
198,
198,
4798,
7203,
10697,
9787,
263,
4943,
198,
4798,
7203,
9787,
290,
3141,
534,
32639,
4382,
1231,
6970,
7020,
4943,
198,
2435,
13,
42832,
7,
17,
8,
198,
418,
13,
10057,
10786,
565,
82,
6,
611,
28686,
13,
3672,
6624,
705,
429,
6,
2073,
705,
20063,
11537,
198,
198,
2,
23812,
611,
262,
1430,
468,
587,
4721,
1541,
25,
198,
198,
69,
796,
1280,
7203,
7890,
14,
16,
301,
9688,
1600,
366,
81,
4943,
198,
396,
9688,
796,
277,
13,
961,
3419,
198,
69,
13,
19836,
198,
198,
361,
318,
83,
9688,
6624,
366,
15,
1298,
198,
220,
220,
220,
3601,
7203,
41102,
588,
345,
4398,
470,
2067,
428,
1430,
878,
13,
921,
423,
284,
6070,
262,
2393,
5140,
287,
705,
7890,
14,
10951,
13,
14116,
6,
19570,
198,
220,
220,
220,
12876,
796,
5128,
7203,
1532,
345,
423,
1541,
1760,
262,
9058,
11,
1803,
3802,
290,
12260,
262,
1430,
757,
13,
1002,
345,
4398,
470,
11,
4370,
262,
2393,
351,
262,
1037,
286,
262,
10107,
19570,
198,
220,
220,
220,
277,
796,
1280,
7203,
7890,
14,
16,
301,
9688,
1600,
366,
86,
4943,
198,
220,
220,
220,
318,
83,
9688,
796,
277,
13,
13564,
7203,
16,
4943,
198,
220,
220,
220,
277,
13,
19836,
198,
220,
220,
220,
25064,
13,
37023,
3419,
198,
220,
220,
220,
220,
198,
2,
9654,
33918,
2393,
351,
262,
4382,
1366,
198,
8457,
796,
1280,
7203,
7890,
14,
10951,
13,
14116,
1600,
366,
81,
4943,
198,
8457,
623,
1045,
796,
277,
13,
961,
3419,
198,
7753,
62,
6978,
796,
366,
7890,
14,
10951,
13,
14116,
1,
198,
4480,
1280,
7,
7753,
62,
6978,
11,
705,
81,
11537,
355,
474,
25,
198,
220,
220,
220,
220,
474,
7568,
79,
796,
33918,
13,
46030,
7,
73,
13,
961,
28955,
198,
2,
73,
7568,
79,
796,
33918,
13,
46030,
7,
8457,
623,
1045,
8,
198,
69,
13,
19836,
198,
198,
418,
13,
10057,
10786,
565,
82,
6,
611,
28686,
13,
3672,
6624,
705,
429,
6,
2073,
705,
20063,
11537,
198,
198,
2,
24243,
6859,
198,
4798,
7203,
29046,
37441,
856,
329,
262,
4382,
25,
366,
8,
198,
4798,
7203,
16,
8,
6822,
4382,
5951,
357,
11929,
30936,
2751,
8,
4943,
198,
4798,
7203,
17,
8,
50204,
262,
4382,
4943,
198,
4798,
7203,
18,
8,
18736,
866,
262,
4382,
357,
259,
352,
5664,
8,
4943,
198,
4798,
7203,
19,
8,
18736,
866,
262,
4382,
357,
8625,
415,
272,
6819,
8,
4943,
198,
4798,
7203,
20,
8,
8562,
3141,
357,
9122,
20832,
11682,
8,
4943,
198,
198,
18076,
796,
5128,
7203,
6030,
257,
1271,
281,
788,
1803,
3802,
25,
366,
8,
198,
198,
2,
17469,
262,
4382,
198,
4774,
796,
357,
73,
7568,
79,
14692,
541,
8973,
8,
198,
634,
796,
357,
73,
7568,
79,
14692,
634,
8973,
8,
198,
29460,
796,
357,
73,
7568,
79,
14692,
7220,
8973,
8,
198,
28712,
796,
651,
6603,
7203,
35215,
329,
2836,
366,
1343,
20579,
1343,
366,
25,
366,
8,
198,
198,
2,
6822,
262,
1271,
6163,
25,
198,
198,
361,
3038,
6624,
366,
16,
1298,
198,
220,
220,
220,
3141,
796,
366,
30328,
14763,
1,
198,
417,
361,
3038,
6624,
366,
17,
1298,
198,
220,
220,
220,
3141,
796,
366,
24032,
20149,
1,
198,
417,
361,
3038,
6624,
366,
18,
1298,
198,
220,
220,
220,
3141,
796,
366,
24032,
18325,
1343,
16,
1,
198,
417,
361,
3038,
6624,
366,
19,
1298,
198,
220,
220,
220,
3141,
796,
366,
24032,
18325,
783,
1,
198,
417,
361,
3038,
6624,
366,
20,
1298,
198,
220,
220,
220,
3141,
796,
357,
73,
7568,
79,
14692,
23144,
62,
21812,
8973,
8,
198,
17772,
25,
198,
220,
220,
220,
3601,
7203,
24908,
25,
1400,
3141,
6163,
13,
6118,
481,
1969,
19570,
198,
220,
220,
220,
25064,
13,
37023,
3419,
198,
198,
2,
15883,
2800,
351,
4382,
290,
466,
4905,
198,
45824,
796,
5772,
12125,
13,
5432,
39,
11792,
3419,
198,
45824,
13,
2617,
62,
45688,
62,
4774,
62,
2539,
62,
30586,
7,
17143,
12125,
13,
27722,
4550,
36727,
28955,
198,
45824,
13,
8443,
7,
4774,
11,
2493,
11,
20579,
11,
9206,
8,
198,
198,
19282,
259,
11,
14367,
448,
11,
336,
1082,
81,
796,
26678,
13,
18558,
62,
21812,
7,
21812,
8,
198,
6615,
796,
14367,
448,
13,
961,
6615,
3419,
198,
4798,
7,
6615,
8,
198
] | 2.897333 | 750 |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="sdi_pandas",
version="0.0.38",
author="Thorsten Hapke",
author_email="[email protected]",
description="List of operators using the pandas module for processing the input",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/thhapke/sdi_pandas/",
keywords = ['SAP Data Intelligence','pandas','operator'],
packages=setuptools.find_packages(),
install_requires=[
'pandas',
'numpy',
'fuzzywuzzy'
],
include_package_data=True,
classifiers=[
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
) | [
11748,
900,
37623,
10141,
198,
198,
4480,
1280,
7203,
15675,
11682,
13,
9132,
1600,
366,
81,
4943,
355,
277,
71,
25,
198,
220,
220,
220,
890,
62,
11213,
796,
277,
71,
13,
961,
3419,
198,
198,
2617,
37623,
10141,
13,
40406,
7,
198,
220,
220,
220,
1438,
2625,
82,
10989,
62,
79,
392,
292,
1600,
198,
220,
220,
220,
2196,
2625,
15,
13,
15,
13,
2548,
1600,
198,
220,
220,
220,
1772,
2625,
46765,
26400,
367,
499,
365,
1600,
198,
220,
220,
220,
1772,
62,
12888,
2625,
400,
273,
26400,
13,
45897,
365,
31,
82,
499,
13,
785,
1600,
198,
220,
220,
220,
6764,
2625,
8053,
286,
12879,
1262,
262,
19798,
292,
8265,
329,
7587,
262,
5128,
1600,
198,
220,
220,
220,
890,
62,
11213,
28,
6511,
62,
11213,
11,
198,
220,
220,
220,
890,
62,
11213,
62,
11299,
62,
4906,
2625,
5239,
14,
4102,
2902,
1600,
198,
220,
220,
220,
19016,
2625,
5450,
1378,
12567,
13,
785,
14,
400,
45897,
365,
14,
82,
10989,
62,
79,
392,
292,
14,
1600,
198,
220,
220,
220,
26286,
796,
37250,
50,
2969,
6060,
9345,
41707,
79,
392,
292,
41707,
46616,
6,
4357,
198,
220,
220,
220,
10392,
28,
2617,
37623,
10141,
13,
19796,
62,
43789,
22784,
198,
220,
220,
220,
2721,
62,
47911,
41888,
198,
220,
220,
220,
220,
220,
220,
220,
705,
79,
392,
292,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
705,
77,
32152,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
705,
69,
4715,
88,
86,
4715,
88,
6,
198,
220,
220,
220,
16589,
198,
220,
220,
220,
2291,
62,
26495,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
1398,
13350,
41888,
198,
220,
220,
220,
220,
197,
6,
15167,
2229,
15417,
7904,
11361,
7904,
513,
13,
20,
3256,
198,
220,
220,
220,
220,
197,
6,
15167,
2229,
15417,
7904,
11361,
7904,
513,
13,
21,
3256,
198,
220,
220,
220,
220,
197,
6,
15167,
2229,
15417,
7904,
11361,
7904,
513,
13,
22,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
366,
34156,
7904,
7294,
40,
20010,
1079,
7904,
17168,
13789,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
366,
18843,
803,
4482,
7904,
7294,
13362,
1600,
198,
220,
220,
220,
16589,
198,
8
] | 2.510811 | 370 |
''' An example of learning a NFSP Agent on Limit Texas Holdem
'''
import torch
import rlcard
from rlcard.agents.nfsp_agent_pytorch import NFSPAgent
from rlcard.agents.random_agent import RandomAgent
from rlcard.utils.utils import set_global_seed
from rlcard.utils.logger import Logger
# Make environment
env = rlcard.make('limit-holdem')
eval_env = rlcard.make('limit-holdem')
# Set the iterations numbers and how frequently we evaluate/save plot
evaluate_every = 100
save_plot_every = 1000
evaluate_num = 10000
episode_num = 10000000
# Set the the number of steps for collecting normalization statistics
# and intial memory size
memory_init_size = 1000
norm_step = 1000
# The paths for saving the logs and learning curves
root_path = './experiments/limit_holdem_nfsp_pytorch_result/'
log_path = root_path + 'log.txt'
csv_path = root_path + 'performance.csv'
figure_path = root_path + 'figures/'
# Set a global seed
set_global_seed(0)
# Set agents
agents = []
for i in range(env.player_num):
agent = NFSPAgent(scope='nfsp' + str(i),
action_num=env.action_num,
state_shape=env.state_shape,
hidden_layers_sizes=[512,512],
anticipatory_param=0.1,
min_buffer_size_to_learn=memory_init_size,
q_replay_memory_init_size=memory_init_size,
q_norm_step=norm_step,
q_mlp_layers=[512,512])
agents.append(agent)
random_agent = RandomAgent(action_num=eval_env.action_num)
env.set_agents(agents)
eval_env.set_agents([agents[0], random_agent])
# Count the number of steps
step_counters = [0 for _ in range(env.player_num)]
# Init a Logger to plot the learning curve
logger = Logger(xlabel='timestep', ylabel='reward', legend='NFSP on Limit Texas Holdem', log_path=log_path, csv_path=csv_path)
for episode in range(episode_num):
# First sample a policy for the episode
for agent in agents:
agent.sample_episode_policy()
# Generate data from the environment
trajectories, _ = env.run(is_training=True)
# Feed transitions into agent memory, and train the agent
for i in range(env.player_num):
for ts in trajectories[i]:
agents[i].feed(ts)
step_counters[i] += 1
# Train the agent
train_count = step_counters[i] - (memory_init_size + norm_step)
if train_count > 0 and train_count % 64 == 0:
rl_loss = agents[i].train_rl()
sl_loss = agents[i].train_sl()
print('\rINFO - Agent {}, step {}, rl-loss: {}, sl-loss: {}'.format(i, step_counters[i], rl_loss, sl_loss), end='')
# Evaluate the performance. Play with random agents.
if episode % evaluate_every == 0:
reward = 0
for eval_episode in range(evaluate_num):
_, payoffs = eval_env.run(is_training=False)
reward += payoffs[0]
logger.log('\n########## Evaluation ##########')
logger.log('Timestep: {} Average reward is {}'.format(env.timestep, float(reward)/evaluate_num))
# Add point to logger
logger.add_point(x=env.timestep, y=float(reward)/evaluate_num)
# Make plot
if episode % save_plot_every == 0 and episode > 0:
logger.make_plot(save_path=figure_path+str(episode)+'.png')
# Make the final plot
logger.make_plot(save_path=figure_path+'final_'+str(episode)+'.png')
| [
7061,
6,
1052,
1672,
286,
4673,
257,
41288,
4303,
15906,
319,
27272,
3936,
9340,
368,
198,
7061,
6,
198,
11748,
28034,
198,
198,
11748,
374,
75,
9517,
198,
6738,
374,
75,
9517,
13,
49638,
13,
77,
69,
2777,
62,
25781,
62,
9078,
13165,
354,
1330,
41288,
4303,
36772,
198,
6738,
374,
75,
9517,
13,
49638,
13,
25120,
62,
25781,
1330,
14534,
36772,
198,
6738,
374,
75,
9517,
13,
26791,
13,
26791,
1330,
900,
62,
20541,
62,
28826,
198,
6738,
374,
75,
9517,
13,
26791,
13,
6404,
1362,
1330,
5972,
1362,
198,
198,
2,
6889,
2858,
198,
24330,
796,
374,
75,
9517,
13,
15883,
10786,
32374,
12,
2946,
368,
11537,
198,
18206,
62,
24330,
796,
374,
75,
9517,
13,
15883,
10786,
32374,
12,
2946,
368,
11537,
198,
198,
2,
5345,
262,
34820,
3146,
290,
703,
6777,
356,
13446,
14,
21928,
7110,
198,
49786,
62,
16833,
796,
1802,
198,
21928,
62,
29487,
62,
16833,
796,
8576,
198,
49786,
62,
22510,
796,
33028,
198,
38668,
62,
22510,
796,
1802,
20483,
198,
198,
2,
5345,
262,
262,
1271,
286,
4831,
329,
13157,
3487,
1634,
7869,
198,
2,
290,
493,
498,
4088,
2546,
198,
31673,
62,
15003,
62,
7857,
796,
8576,
198,
27237,
62,
9662,
796,
8576,
198,
198,
2,
383,
13532,
329,
8914,
262,
17259,
290,
4673,
23759,
198,
15763,
62,
6978,
796,
705,
19571,
23100,
6800,
14,
32374,
62,
2946,
368,
62,
77,
69,
2777,
62,
9078,
13165,
354,
62,
20274,
14,
6,
198,
6404,
62,
6978,
796,
6808,
62,
6978,
1343,
705,
6404,
13,
14116,
6,
198,
40664,
62,
6978,
796,
6808,
62,
6978,
1343,
705,
26585,
13,
40664,
6,
198,
26875,
62,
6978,
796,
6808,
62,
6978,
1343,
705,
5647,
942,
14,
6,
198,
198,
2,
5345,
257,
3298,
9403,
198,
2617,
62,
20541,
62,
28826,
7,
15,
8,
198,
198,
2,
5345,
6554,
198,
49638,
796,
17635,
198,
1640,
1312,
287,
2837,
7,
24330,
13,
7829,
62,
22510,
2599,
198,
220,
220,
220,
5797,
796,
41288,
4303,
36772,
7,
29982,
11639,
77,
69,
2777,
6,
1343,
965,
7,
72,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2223,
62,
22510,
28,
24330,
13,
2673,
62,
22510,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1181,
62,
43358,
28,
24330,
13,
5219,
62,
43358,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7104,
62,
75,
6962,
62,
82,
4340,
41888,
25836,
11,
25836,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8462,
2870,
62,
17143,
28,
15,
13,
16,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
949,
62,
22252,
62,
7857,
62,
1462,
62,
35720,
28,
31673,
62,
15003,
62,
7857,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10662,
62,
260,
1759,
62,
31673,
62,
15003,
62,
7857,
28,
31673,
62,
15003,
62,
7857,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10662,
62,
27237,
62,
9662,
28,
27237,
62,
9662,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10662,
62,
4029,
79,
62,
75,
6962,
41888,
25836,
11,
25836,
12962,
198,
220,
220,
220,
6554,
13,
33295,
7,
25781,
8,
198,
198,
25120,
62,
25781,
796,
14534,
36772,
7,
2673,
62,
22510,
28,
18206,
62,
24330,
13,
2673,
62,
22510,
8,
198,
198,
24330,
13,
2617,
62,
49638,
7,
49638,
8,
198,
18206,
62,
24330,
13,
2617,
62,
49638,
26933,
49638,
58,
15,
4357,
4738,
62,
25781,
12962,
198,
198,
2,
2764,
262,
1271,
286,
4831,
198,
9662,
62,
66,
15044,
796,
685,
15,
329,
4808,
287,
2837,
7,
24330,
13,
7829,
62,
22510,
15437,
198,
198,
2,
44707,
257,
5972,
1362,
284,
7110,
262,
4673,
12133,
198,
6404,
1362,
796,
5972,
1362,
7,
87,
18242,
11639,
16514,
395,
538,
3256,
331,
18242,
11639,
260,
904,
3256,
8177,
11639,
21870,
4303,
319,
27272,
3936,
9340,
368,
3256,
2604,
62,
6978,
28,
6404,
62,
6978,
11,
269,
21370,
62,
6978,
28,
40664,
62,
6978,
8,
198,
198,
1640,
4471,
287,
2837,
7,
38668,
62,
22510,
2599,
628,
220,
220,
220,
1303,
3274,
6291,
257,
2450,
329,
262,
4471,
198,
220,
220,
220,
329,
5797,
287,
6554,
25,
198,
220,
220,
220,
220,
220,
220,
220,
5797,
13,
39873,
62,
38668,
62,
30586,
3419,
628,
220,
220,
220,
1303,
2980,
378,
1366,
422,
262,
2858,
198,
220,
220,
220,
20134,
1749,
11,
4808,
796,
17365,
13,
5143,
7,
271,
62,
34409,
28,
17821,
8,
628,
220,
220,
220,
1303,
18272,
27188,
656,
5797,
4088,
11,
290,
4512,
262,
5797,
198,
220,
220,
220,
329,
1312,
287,
2837,
7,
24330,
13,
7829,
62,
22510,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
329,
40379,
287,
20134,
1749,
58,
72,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6554,
58,
72,
4083,
12363,
7,
912,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2239,
62,
66,
15044,
58,
72,
60,
15853,
352,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
16835,
262,
5797,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4512,
62,
9127,
796,
2239,
62,
66,
15044,
58,
72,
60,
532,
357,
31673,
62,
15003,
62,
7857,
1343,
2593,
62,
9662,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
4512,
62,
9127,
1875,
657,
290,
4512,
62,
9127,
4064,
5598,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
374,
75,
62,
22462,
796,
6554,
58,
72,
4083,
27432,
62,
45895,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1017,
62,
22462,
796,
6554,
58,
72,
4083,
27432,
62,
6649,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
59,
81,
10778,
532,
15906,
1391,
5512,
2239,
1391,
5512,
374,
75,
12,
22462,
25,
1391,
5512,
1017,
12,
22462,
25,
23884,
4458,
18982,
7,
72,
11,
2239,
62,
66,
15044,
58,
72,
4357,
374,
75,
62,
22462,
11,
1017,
62,
22462,
828,
886,
28,
7061,
8,
628,
220,
220,
220,
1303,
26439,
4985,
262,
2854,
13,
3811,
351,
4738,
6554,
13,
198,
220,
220,
220,
611,
4471,
4064,
13446,
62,
16833,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
6721,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
329,
5418,
62,
38668,
287,
2837,
7,
49786,
62,
22510,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
11,
1414,
8210,
796,
5418,
62,
24330,
13,
5143,
7,
271,
62,
34409,
28,
25101,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6721,
15853,
1414,
8210,
58,
15,
60,
628,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
6404,
10786,
59,
77,
7804,
2235,
34959,
1303,
7804,
2,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
6404,
10786,
14967,
395,
538,
25,
23884,
13475,
6721,
318,
23884,
4458,
18982,
7,
24330,
13,
16514,
395,
538,
11,
12178,
7,
260,
904,
20679,
49786,
62,
22510,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
3060,
966,
284,
49706,
198,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
2860,
62,
4122,
7,
87,
28,
24330,
13,
16514,
395,
538,
11,
331,
28,
22468,
7,
260,
904,
20679,
49786,
62,
22510,
8,
628,
220,
220,
220,
1303,
6889,
7110,
198,
220,
220,
220,
611,
4471,
4064,
3613,
62,
29487,
62,
16833,
6624,
657,
290,
4471,
1875,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
49706,
13,
15883,
62,
29487,
7,
21928,
62,
6978,
28,
26875,
62,
6978,
10,
2536,
7,
38668,
47762,
4458,
11134,
11537,
198,
198,
2,
6889,
262,
2457,
7110,
198,
6404,
1362,
13,
15883,
62,
29487,
7,
21928,
62,
6978,
28,
26875,
62,
6978,
10,
6,
20311,
62,
6,
10,
2536,
7,
38668,
47762,
4458,
11134,
11537,
198
] | 2.420646 | 1,424 |
import os
import random
import cv2
import matplotlib.image as mpimg
import numpy as np
import pandas as pd
import torch
from torch.utils.data import Dataset
class FacialKeypointsDataset(Dataset):
"""
Face Landmarks dataset.
"""
def __init__(self, csv_file, root_dir, transform=None):
"""
Args:
csv_file (string): Path to the csv file with annotations.
root_dir (string): Directory with all the images.
transform (callable, optional): Optional transform to be applied
on a sample.
"""
self.key_pts_frame = pd.read_csv(csv_file)
self.root_dir = root_dir
self.transform = transform
# Tranforms
class Normalize(object):
"""
Convert a color image to grayscale and normalize the color range to [0,1].
"""
class Rescale(object):
"""
Rescale the image in a sample to a given size.
Args:
output_size (tuple or int): Desired output size. If tuple, output is
matched to output_size. If int, smaller of image edges is matched
to output_size keeping aspect ratio the same.
"""
class RandomCrop(object):
"""
Crop randomly the image in a sample.
Args:
output_size (tuple or int): Desired output size. If int, square crop
is made.
"""
class ToTensor(object):
"""
Convert ndarrays in sample to Tensors.
"""
| [
11748,
28686,
198,
11748,
4738,
198,
198,
11748,
269,
85,
17,
198,
11748,
2603,
29487,
8019,
13,
9060,
355,
29034,
9600,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
28034,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
16092,
292,
316,
628,
198,
4871,
13585,
498,
9218,
13033,
27354,
292,
316,
7,
27354,
292,
316,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
15399,
6379,
14306,
27039,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
269,
21370,
62,
7753,
11,
6808,
62,
15908,
11,
6121,
28,
14202,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
21370,
62,
7753,
357,
8841,
2599,
10644,
284,
262,
269,
21370,
2393,
351,
37647,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6808,
62,
15908,
357,
8841,
2599,
27387,
351,
477,
262,
4263,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6121,
357,
13345,
540,
11,
11902,
2599,
32233,
6121,
284,
307,
5625,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
319,
257,
6291,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
2539,
62,
457,
82,
62,
14535,
796,
279,
67,
13,
961,
62,
40664,
7,
40664,
62,
7753,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
15763,
62,
15908,
796,
6808,
62,
15908,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
35636,
796,
6121,
628,
198,
2,
833,
272,
23914,
198,
198,
4871,
14435,
1096,
7,
15252,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
38240,
257,
3124,
2939,
284,
1036,
592,
38765,
290,
3487,
1096,
262,
3124,
2837,
284,
685,
15,
11,
16,
4083,
198,
220,
220,
220,
37227,
628,
198,
4871,
1874,
38765,
7,
15252,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1874,
38765,
262,
2939,
287,
257,
6291,
284,
257,
1813,
2546,
13,
628,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
5072,
62,
7857,
357,
83,
29291,
393,
493,
2599,
2935,
1202,
5072,
2546,
13,
1002,
46545,
11,
5072,
318,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
14451,
284,
5072,
62,
7857,
13,
1002,
493,
11,
4833,
286,
2939,
13015,
318,
14451,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
284,
5072,
62,
7857,
5291,
4843,
8064,
262,
976,
13,
198,
220,
220,
220,
37227,
628,
198,
198,
4871,
14534,
34,
1773,
7,
15252,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
327,
1773,
15456,
262,
2939,
287,
257,
6291,
13,
628,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
5072,
62,
7857,
357,
83,
29291,
393,
493,
2599,
2935,
1202,
5072,
2546,
13,
1002,
493,
11,
6616,
13833,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
925,
13,
198,
220,
220,
220,
37227,
628,
198,
4871,
1675,
51,
22854,
7,
15252,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
38240,
299,
67,
3258,
592,
287,
6291,
284,
40280,
669,
13,
198,
220,
220,
220,
37227,
198
] | 2.504378 | 571 |
import requests
| [
11748,
7007,
628
] | 5.666667 | 3 |
TWOHERTZ = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
FIVEHERTZ = [
36,
40,
44,
48,
52,
56,
60,
64,
100,
104,
108,
112,
116,
132,
136,
140,
149,
153,
157,
161,
165,
]
ALL = [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
36,
40,
44,
48,
52,
56,
60,
64,
100,
104,
108,
112,
116,
132,
136,
140,
149,
153,
157,
161,
165,
]
| [
34551,
12096,
17395,
57,
796,
685,
16,
11,
362,
11,
513,
11,
604,
11,
642,
11,
718,
11,
767,
11,
807,
11,
860,
11,
838,
11,
1367,
60,
198,
198,
37,
9306,
16879,
51,
57,
796,
685,
198,
220,
220,
220,
4570,
11,
198,
220,
220,
220,
2319,
11,
198,
220,
220,
220,
5846,
11,
198,
220,
220,
220,
4764,
11,
198,
220,
220,
220,
6740,
11,
198,
220,
220,
220,
7265,
11,
198,
220,
220,
220,
3126,
11,
198,
220,
220,
220,
5598,
11,
198,
220,
220,
220,
1802,
11,
198,
220,
220,
220,
14436,
11,
198,
220,
220,
220,
15495,
11,
198,
220,
220,
220,
13539,
11,
198,
220,
220,
220,
18693,
11,
198,
220,
220,
220,
21761,
11,
198,
220,
220,
220,
21056,
11,
198,
220,
220,
220,
12713,
11,
198,
220,
220,
220,
24041,
11,
198,
220,
220,
220,
24652,
11,
198,
220,
220,
220,
23313,
11,
198,
220,
220,
220,
27829,
11,
198,
220,
220,
220,
21409,
11,
198,
60,
198,
198,
7036,
796,
685,
198,
220,
220,
220,
352,
11,
198,
220,
220,
220,
362,
11,
198,
220,
220,
220,
513,
11,
198,
220,
220,
220,
604,
11,
198,
220,
220,
220,
642,
11,
198,
220,
220,
220,
718,
11,
198,
220,
220,
220,
767,
11,
198,
220,
220,
220,
807,
11,
198,
220,
220,
220,
860,
11,
198,
220,
220,
220,
838,
11,
198,
220,
220,
220,
1367,
11,
198,
220,
220,
220,
4570,
11,
198,
220,
220,
220,
2319,
11,
198,
220,
220,
220,
5846,
11,
198,
220,
220,
220,
4764,
11,
198,
220,
220,
220,
6740,
11,
198,
220,
220,
220,
7265,
11,
198,
220,
220,
220,
3126,
11,
198,
220,
220,
220,
5598,
11,
198,
220,
220,
220,
1802,
11,
198,
220,
220,
220,
14436,
11,
198,
220,
220,
220,
15495,
11,
198,
220,
220,
220,
13539,
11,
198,
220,
220,
220,
18693,
11,
198,
220,
220,
220,
21761,
11,
198,
220,
220,
220,
21056,
11,
198,
220,
220,
220,
12713,
11,
198,
220,
220,
220,
24041,
11,
198,
220,
220,
220,
24652,
11,
198,
220,
220,
220,
23313,
11,
198,
220,
220,
220,
27829,
11,
198,
220,
220,
220,
21409,
11,
198,
60,
198
] | 1.413699 | 365 |
#!/usr/bin/env python3.8
print(uni_char1('abcdaefg')) | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
13,
23,
198,
198,
4798,
7,
35657,
62,
10641,
16,
10786,
39305,
6814,
891,
70,
6,
4008
] | 2.076923 | 26 |
from django.urls import path
from .views import RecipientDetails, MeetSchedule, DashboardView, MyMapView, SubmitMap, submitForReview,AdminGraphView, FinalSubmit, Approval, SentForApprovalMap, SaveApprovedVersion, GetLatestRevision, CommentSubmit, Discard, ReviewerReview, embedded_signing_ceremony, get_access_code, auth_login, sign_complete
from django.conf.urls import url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
urlpatterns = [
path('', DashboardView, name='dashboard-home'),
path('MyMapView/', MyMapView, name='my-map-view'),
path('submitMap/', SubmitMap),
path('submitForReview/', submitForReview, name='submit-review'),
path('AdminMapView/', AdminGraphView, name='admin-graph-view'),
path('FinalSubmit/', FinalSubmit),
path('approve/', Approval, name='user-approve'),
path('ApprovedMap/', SentForApprovalMap, name='approved-map'),
path('SaveRevision/', SaveApprovedVersion, name='approved-revision'),
path('GetLatestRevision/', GetLatestRevision, name='latest-revision'),
path('CommentSubmit/', CommentSubmit, name='comment-submit'),
path('Discard/', Discard, name='discard'),
path('reviewerReview/', ReviewerReview, name='reviewer-review'),
path('meetSchedule/', MeetSchedule, name='meet-schedule'),
path('recipients/', RecipientDetails, name='recipients'),
url(r'^get_signing_url/$', embedded_signing_ceremony, name='get_signing_url'),
url(r'^get_access_code/$', get_access_code, name='get_access_code'),
url(r'^auth_login/$', auth_login, name='auth_login'),
url(r'^sign_completed/$', sign_complete, name='sign_completed'),
]
| [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
764,
33571,
1330,
3311,
48137,
24259,
11,
21167,
27054,
5950,
11,
16189,
3526,
7680,
11,
2011,
13912,
7680,
11,
39900,
13912,
11,
9199,
1890,
14832,
11,
46787,
37065,
7680,
11,
8125,
45135,
11,
20010,
2100,
11,
11352,
1890,
4677,
305,
2100,
13912,
11,
12793,
4677,
305,
1079,
14815,
11,
3497,
39478,
18009,
1166,
11,
18957,
45135,
11,
8444,
446,
11,
6602,
263,
14832,
11,
14553,
62,
12683,
278,
62,
344,
2787,
1647,
11,
651,
62,
15526,
62,
8189,
11,
6284,
62,
38235,
11,
1051,
62,
20751,
198,
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
12708,
16624,
13,
6371,
82,
1330,
9037,
16624,
62,
6371,
33279,
82,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
10786,
3256,
16189,
3526,
7680,
11,
1438,
11639,
42460,
3526,
12,
11195,
33809,
198,
220,
220,
220,
3108,
10786,
3666,
13912,
7680,
14,
3256,
2011,
13912,
7680,
11,
1438,
11639,
1820,
12,
8899,
12,
1177,
33809,
198,
220,
220,
220,
3108,
10786,
46002,
13912,
14,
3256,
39900,
13912,
828,
198,
220,
220,
220,
3108,
10786,
46002,
1890,
14832,
14,
3256,
9199,
1890,
14832,
11,
1438,
11639,
46002,
12,
19023,
33809,
198,
220,
220,
220,
3108,
10786,
46787,
13912,
7680,
14,
3256,
32053,
37065,
7680,
11,
1438,
11639,
28482,
12,
34960,
12,
1177,
33809,
198,
220,
220,
220,
3108,
10786,
19006,
45135,
14,
3256,
8125,
45135,
828,
198,
220,
220,
220,
3108,
10786,
21064,
303,
14,
3256,
20010,
2100,
11,
1438,
11639,
7220,
12,
21064,
303,
33809,
198,
220,
220,
220,
3108,
10786,
4677,
305,
1079,
13912,
14,
3256,
11352,
1890,
4677,
305,
2100,
13912,
11,
1438,
11639,
29137,
12,
8899,
33809,
198,
220,
220,
220,
3108,
10786,
16928,
18009,
1166,
14,
3256,
12793,
4677,
305,
1079,
14815,
11,
1438,
11639,
29137,
12,
260,
10178,
33809,
198,
220,
220,
220,
3108,
10786,
3855,
39478,
18009,
1166,
14,
3256,
3497,
39478,
18009,
1166,
11,
1438,
11639,
42861,
12,
260,
10178,
33809,
198,
220,
220,
220,
3108,
10786,
21357,
45135,
14,
3256,
18957,
45135,
11,
1438,
11639,
23893,
12,
46002,
33809,
198,
220,
220,
220,
3108,
10786,
15642,
446,
14,
3256,
8444,
446,
11,
1438,
11639,
15410,
446,
33809,
198,
220,
220,
220,
3108,
10786,
19023,
263,
14832,
14,
3256,
6602,
263,
14832,
11,
1438,
11639,
19023,
263,
12,
19023,
33809,
198,
220,
220,
220,
3108,
10786,
47745,
27054,
5950,
14,
3256,
21167,
27054,
5950,
11,
1438,
11639,
47745,
12,
15952,
5950,
33809,
198,
220,
220,
220,
3108,
10786,
8344,
541,
2334,
14,
3256,
3311,
48137,
24259,
11,
1438,
11639,
8344,
541,
2334,
33809,
198,
220,
220,
220,
19016,
7,
81,
6,
61,
1136,
62,
12683,
278,
62,
6371,
32624,
3256,
14553,
62,
12683,
278,
62,
344,
2787,
1647,
11,
1438,
11639,
1136,
62,
12683,
278,
62,
6371,
33809,
198,
220,
220,
220,
19016,
7,
81,
6,
61,
1136,
62,
15526,
62,
8189,
32624,
3256,
651,
62,
15526,
62,
8189,
11,
1438,
11639,
1136,
62,
15526,
62,
8189,
33809,
198,
220,
220,
220,
19016,
7,
81,
6,
61,
18439,
62,
38235,
32624,
3256,
6284,
62,
38235,
11,
1438,
11639,
18439,
62,
38235,
33809,
198,
220,
220,
220,
19016,
7,
81,
6,
61,
12683,
62,
785,
16838,
32624,
3256,
1051,
62,
20751,
11,
1438,
11639,
12683,
62,
785,
16838,
33809,
198,
60,
198
] | 2.937276 | 558 |
# -*- coding:utf-8 -*-
import os
import tempfile
from flexmock import flexmock
from orator.commands.command import Command
from . import OratorCommandTestCase
class FooCommand(Command):
"""
Test Command
"""
name = "foo"
| [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
11748,
28686,
198,
11748,
20218,
7753,
198,
198,
6738,
7059,
76,
735,
1330,
7059,
76,
735,
198,
198,
6738,
393,
1352,
13,
9503,
1746,
13,
21812,
1330,
9455,
198,
198,
6738,
764,
1330,
1471,
1352,
21575,
14402,
20448,
628,
198,
4871,
36080,
21575,
7,
21575,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
6208,
9455,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
1438,
796,
366,
21943,
1,
628
] | 2.858824 | 85 |
# Copyright 2021 Google LLC All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import concurrent.futures
import datetime
import mock
import typing
import google
from google.cloud.firestore_v1.base_client import BaseClient
from google.cloud.firestore_v1.document import DocumentReference, DocumentSnapshot
from google.cloud._helpers import _datetime_to_pb_timestamp, UTC # type: ignore
from google.cloud.firestore_v1._helpers import build_timestamp
from google.cloud.firestore_v1.async_client import AsyncClient
from google.cloud.firestore_v1.client import Client
from google.protobuf.timestamp_pb2 import Timestamp # type: ignore
| [
2,
15069,
33448,
3012,
11419,
1439,
2489,
10395,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
7330,
257,
4866,
286,
262,
13789,
379,
198,
2,
198,
2,
220,
220,
220,
220,
2638,
1378,
2503,
13,
43073,
13,
2398,
14,
677,
4541,
14,
43,
2149,
24290,
12,
17,
13,
15,
198,
2,
198,
2,
17486,
2672,
416,
9723,
1099,
393,
4987,
284,
287,
3597,
11,
3788,
198,
2,
9387,
739,
262,
13789,
318,
9387,
319,
281,
366,
1921,
3180,
1,
29809,
1797,
11,
198,
2,
42881,
34764,
11015,
6375,
7102,
49828,
11053,
3963,
15529,
509,
12115,
11,
2035,
4911,
393,
17142,
13,
198,
2,
4091,
262,
13789,
329,
262,
2176,
3303,
15030,
21627,
290,
198,
2,
11247,
739,
262,
13789,
13,
198,
198,
11748,
24580,
13,
69,
315,
942,
198,
11748,
4818,
8079,
198,
11748,
15290,
198,
11748,
19720,
198,
198,
11748,
23645,
198,
6738,
23645,
13,
17721,
13,
6495,
8095,
62,
85,
16,
13,
8692,
62,
16366,
1330,
7308,
11792,
198,
6738,
23645,
13,
17721,
13,
6495,
8095,
62,
85,
16,
13,
22897,
1330,
16854,
26687,
11,
16854,
43826,
9442,
198,
6738,
23645,
13,
17721,
13557,
16794,
364,
1330,
4808,
19608,
8079,
62,
1462,
62,
40842,
62,
16514,
27823,
11,
18119,
220,
1303,
2099,
25,
8856,
198,
6738,
23645,
13,
17721,
13,
6495,
8095,
62,
85,
16,
13557,
16794,
364,
1330,
1382,
62,
16514,
27823,
198,
6738,
23645,
13,
17721,
13,
6495,
8095,
62,
85,
16,
13,
292,
13361,
62,
16366,
1330,
1081,
13361,
11792,
198,
6738,
23645,
13,
17721,
13,
6495,
8095,
62,
85,
16,
13,
16366,
1330,
20985,
198,
6738,
23645,
13,
11235,
672,
3046,
13,
16514,
27823,
62,
40842,
17,
1330,
5045,
27823,
220,
1303,
2099,
25,
8856,
628,
628,
628,
198
] | 3.658228 | 316 |
# Copyright 2021 AI Singapore
#
# 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.
"""
Estimates the 3D coordinates of an object given a 2D bounding box
"""
from typing import Dict, Any
import numpy as np
from peekingduck.pipeline.nodes.node import AbstractNode
class Node(AbstractNode):
"""Node that uses 2D bounding boxes information to estimate 3D location.
Inputs:
|bboxes|
Outputs:
|obj_3D_locs|
Configs:
focal_length (:obj:`float`): **default = 1.14**
Approximate focal length of webcam used, in metres. Example on measuring focal length:
https://learnopencv.com/approximate-focal-length-for-webcams-and-cell-phone-cameras/
height_factor (:obj:`float`): **default = 2.5**
A factor used to estimate real-world distance from pixels, based on average human height
in metres. The value varies across different camera set-ups, and calibration may be
required.
"""
def run(self, inputs: Dict[str, Any]) -> Dict[str, Any]:
"""Converts 2D bounding boxes into 3D locations.
"""
locations = []
for bbox in inputs["bboxes"]:
# Subtraction is to make the camera the origin of the coordinate system
center_2d = ((bbox[0:2] + bbox[2:4]) * 0.5) - np.array([0.5, 0.5])
bbox_height = bbox[3] - bbox[1]
z_coord = (self.focal_length * self.height_factor) / bbox_height
x_coord = (center_2d[0] * self.height_factor) / bbox_height
y_coord = (center_2d[1] * self.height_factor) / bbox_height
point = np.array([x_coord, y_coord, z_coord])
locations.append(point)
outputs = {"obj_3D_locs": locations}
return outputs
| [
2,
15069,
33448,
9552,
12551,
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,
198,
37811,
198,
22362,
26748,
262,
513,
35,
22715,
286,
281,
2134,
1813,
257,
362,
35,
5421,
278,
3091,
198,
37811,
198,
198,
6738,
19720,
1330,
360,
713,
11,
4377,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
613,
18754,
646,
694,
13,
79,
541,
4470,
13,
77,
4147,
13,
17440,
1330,
27741,
19667,
628,
198,
4871,
19081,
7,
23839,
19667,
2599,
198,
220,
220,
220,
37227,
19667,
326,
3544,
362,
35,
5421,
278,
10559,
1321,
284,
8636,
513,
35,
4067,
13,
628,
220,
220,
220,
23412,
82,
25,
198,
220,
220,
220,
220,
220,
220,
220,
930,
65,
29305,
91,
628,
220,
220,
220,
25235,
82,
25,
198,
220,
220,
220,
220,
220,
220,
220,
930,
26801,
62,
18,
35,
62,
17946,
82,
91,
628,
220,
220,
220,
17056,
82,
25,
198,
220,
220,
220,
220,
220,
220,
220,
25397,
62,
13664,
357,
25,
26801,
25,
63,
22468,
63,
2599,
12429,
12286,
796,
352,
13,
1415,
1174,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2034,
13907,
1920,
25397,
4129,
286,
49823,
973,
11,
287,
18985,
13,
17934,
319,
15964,
25397,
4129,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3740,
1378,
35720,
9654,
33967,
13,
785,
14,
1324,
13907,
1920,
12,
69,
4374,
12,
13664,
12,
1640,
12,
12384,
66,
4105,
12,
392,
12,
3846,
12,
4862,
12,
66,
2382,
292,
14,
628,
198,
220,
220,
220,
220,
220,
220,
220,
6001,
62,
31412,
357,
25,
26801,
25,
63,
22468,
63,
2599,
12429,
12286,
796,
362,
13,
20,
1174,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
317,
5766,
973,
284,
8636,
1103,
12,
6894,
5253,
422,
17848,
11,
1912,
319,
2811,
1692,
6001,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
287,
18985,
13,
383,
1988,
17806,
1973,
1180,
4676,
900,
12,
4739,
11,
290,
36537,
743,
307,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2672,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
1057,
7,
944,
11,
17311,
25,
360,
713,
58,
2536,
11,
4377,
12962,
4613,
360,
713,
58,
2536,
11,
4377,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
3103,
24040,
362,
35,
5421,
278,
10559,
656,
513,
35,
7064,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
7064,
796,
17635,
628,
220,
220,
220,
220,
220,
220,
220,
329,
275,
3524,
287,
17311,
14692,
65,
29305,
1,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
3834,
83,
7861,
318,
284,
787,
262,
4676,
262,
8159,
286,
262,
20435,
1080,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3641,
62,
17,
67,
796,
14808,
65,
3524,
58,
15,
25,
17,
60,
1343,
275,
3524,
58,
17,
25,
19,
12962,
1635,
657,
13,
20,
8,
532,
45941,
13,
18747,
26933,
15,
13,
20,
11,
657,
13,
20,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
275,
3524,
62,
17015,
796,
275,
3524,
58,
18,
60,
532,
275,
3524,
58,
16,
60,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1976,
62,
37652,
796,
357,
944,
13,
69,
4374,
62,
13664,
1635,
2116,
13,
17015,
62,
31412,
8,
1220,
275,
3524,
62,
17015,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
62,
37652,
796,
357,
16159,
62,
17,
67,
58,
15,
60,
1635,
2116,
13,
17015,
62,
31412,
8,
1220,
275,
3524,
62,
17015,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
331,
62,
37652,
796,
357,
16159,
62,
17,
67,
58,
16,
60,
1635,
2116,
13,
17015,
62,
31412,
8,
1220,
275,
3524,
62,
17015,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
966,
796,
45941,
13,
18747,
26933,
87,
62,
37652,
11,
331,
62,
37652,
11,
1976,
62,
37652,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7064,
13,
33295,
7,
4122,
8,
628,
220,
220,
220,
220,
220,
220,
220,
23862,
796,
19779,
26801,
62,
18,
35,
62,
17946,
82,
1298,
7064,
92,
628,
220,
220,
220,
220,
220,
220,
220,
1441,
23862,
198
] | 2.630359 | 863 |
import pytest
from punch import file_configuration as fc
@pytest.fixture
@pytest.fixture
@pytest.fixture
| [
11748,
12972,
9288,
198,
198,
6738,
10862,
1330,
2393,
62,
11250,
3924,
355,
277,
66,
628,
198,
31,
9078,
9288,
13,
69,
9602,
628,
198,
31,
9078,
9288,
13,
69,
9602,
628,
198,
31,
9078,
9288,
13,
69,
9602,
628,
628,
628,
198
] | 2.744186 | 43 |
import datetime
emp1 = Employee.from_string("[email protected]")
emp2 = Employee.from_string("[email protected]")
emp3 = Employee.from_string("[email protected]")
Employee.set_raise()
emp1.apply_raise()
emp2.apply_raise()
emp3.apply_raise()
print("Employee 1 fullname is:", emp1.get_full_name(), "created at", emp1.timestamp, "salary is $", float(emp1.pay))
print("Employee 2 fullname is:", emp2.get_full_name(), "created at", emp2.timestamp, "salary is $", float(emp2.pay))
print("Employee 3 fullname is:", emp3.get_full_name(), "created at", emp3.timestamp, "salary is $", float(emp3.pay))
| [
11748,
4818,
8079,
628,
198,
198,
45787,
16,
796,
36824,
13,
6738,
62,
8841,
7203,
26497,
12,
38,
571,
1443,
12,
73,
888,
13,
70,
571,
1443,
31,
8940,
4529,
13,
785,
12,
2623,
830,
4943,
198,
45787,
17,
796,
36824,
13,
6738,
62,
8841,
7203,
44,
888,
12,
32173,
12,
76,
888,
13,
12135,
31,
14816,
13,
785,
12,
2231,
830,
4943,
198,
45787,
18,
796,
36824,
13,
6738,
62,
8841,
7203,
42,
417,
7114,
12,
39,
672,
1443,
12,
365,
6780,
259,
13,
71,
672,
1443,
31,
46848,
4207,
603,
13,
785,
12,
4531,
830,
4943,
198,
198,
29733,
1453,
13,
2617,
62,
40225,
3419,
198,
198,
45787,
16,
13,
39014,
62,
40225,
3419,
198,
45787,
17,
13,
39014,
62,
40225,
3419,
198,
45787,
18,
13,
39014,
62,
40225,
3419,
198,
198,
4798,
7203,
29733,
1453,
352,
1336,
3672,
318,
25,
1600,
795,
79,
16,
13,
1136,
62,
12853,
62,
3672,
22784,
366,
25598,
379,
1600,
795,
79,
16,
13,
16514,
27823,
11,
366,
21680,
560,
318,
720,
1600,
12178,
7,
45787,
16,
13,
15577,
4008,
198,
4798,
7203,
29733,
1453,
362,
1336,
3672,
318,
25,
1600,
795,
79,
17,
13,
1136,
62,
12853,
62,
3672,
22784,
366,
25598,
379,
1600,
795,
79,
17,
13,
16514,
27823,
11,
366,
21680,
560,
318,
720,
1600,
12178,
7,
45787,
17,
13,
15577,
4008,
198,
4798,
7203,
29733,
1453,
513,
1336,
3672,
318,
25,
1600,
795,
79,
18,
13,
1136,
62,
12853,
62,
3672,
22784,
366,
25598,
379,
1600,
795,
79,
18,
13,
16514,
27823,
11,
366,
21680,
560,
318,
720,
1600,
12178,
7,
45787,
18,
13,
15577,
4008,
198
] | 2.498141 | 269 |
"""
This tests whether
from future.builtins import *
works as expected:
- This should NOT introduce namespace pollution on Py3.
- On Python 2, this should not introduce any symbols that aren't in
__builtin__.
"""
from __future__ import absolute_import, print_function, unicode_literals
import copy
from future import utils
from future.tests.base import unittest
original_locals = set(copy.copy(locals()))
original_globals = set(copy.copy(globals()))
new_names = set(['original_locals', 'original_globals', 'new_names'])
from future.builtins import *
new_locals = set(copy.copy(locals())) - new_names - original_locals
new_globals = set(copy.copy(globals())) - new_names - original_globals - \
set(['new_locals'])
if __name__ == '__main__':
unittest.main()
| [
37811,
198,
1212,
5254,
1771,
628,
220,
220,
220,
422,
2003,
13,
18780,
1040,
1330,
1635,
198,
198,
5225,
355,
2938,
25,
198,
12,
770,
815,
5626,
10400,
25745,
12231,
319,
9485,
18,
13,
198,
12,
1550,
11361,
362,
11,
428,
815,
407,
10400,
597,
14354,
326,
3588,
470,
287,
198,
220,
11593,
18780,
259,
834,
13,
198,
198,
37811,
198,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
3601,
62,
8818,
11,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
4866,
198,
198,
6738,
2003,
1330,
3384,
4487,
198,
6738,
2003,
13,
41989,
13,
8692,
1330,
555,
715,
395,
628,
198,
14986,
62,
17946,
874,
796,
900,
7,
30073,
13,
30073,
7,
17946,
874,
3419,
4008,
198,
14986,
62,
4743,
672,
874,
796,
900,
7,
30073,
13,
30073,
7,
4743,
672,
874,
3419,
4008,
198,
3605,
62,
14933,
796,
900,
7,
17816,
14986,
62,
17946,
874,
3256,
705,
14986,
62,
4743,
672,
874,
3256,
705,
3605,
62,
14933,
6,
12962,
198,
6738,
2003,
13,
18780,
1040,
1330,
1635,
198,
3605,
62,
17946,
874,
796,
900,
7,
30073,
13,
30073,
7,
17946,
874,
3419,
4008,
532,
649,
62,
14933,
532,
2656,
62,
17946,
874,
198,
3605,
62,
4743,
672,
874,
796,
900,
7,
30073,
13,
30073,
7,
4743,
672,
874,
3419,
4008,
532,
649,
62,
14933,
532,
2656,
62,
4743,
672,
874,
532,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
900,
7,
17816,
3605,
62,
17946,
874,
6,
12962,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
3419,
198
] | 2.897436 | 273 |
import collections
'''
This problem was recently asked by Google:
Given a list of numbers and a target number n, find 3 numbers combinatins in the list that sums closest to the target number n. There may be multiple ways of creating the sum closest to the target number, you can return any combination in any order.
Time: O(nlogn) + O(n2) = O(n2)
Space: O(n)
'''
print(Solution().closest_3_sum([2, 1, -5, 4], -1))
# (1, [[-5, 1, 4], [-5, 1, 2]]) | [
11748,
17268,
198,
198,
7061,
6,
198,
1212,
1917,
373,
2904,
1965,
416,
3012,
25,
198,
198,
15056,
257,
1351,
286,
3146,
290,
257,
2496,
1271,
299,
11,
1064,
513,
3146,
1974,
259,
265,
1040,
287,
262,
1351,
326,
21784,
11706,
284,
262,
2496,
1271,
299,
13,
1318,
743,
307,
3294,
2842,
286,
4441,
262,
2160,
11706,
284,
262,
2496,
1271,
11,
345,
460,
1441,
597,
6087,
287,
597,
1502,
13,
198,
198,
7575,
25,
440,
7,
21283,
2360,
8,
1343,
440,
7,
77,
17,
8,
796,
440,
7,
77,
17,
8,
198,
14106,
25,
440,
7,
77,
8,
198,
198,
7061,
6,
628,
198,
198,
4798,
7,
46344,
22446,
565,
418,
395,
62,
18,
62,
16345,
26933,
17,
11,
352,
11,
532,
20,
11,
604,
4357,
532,
16,
4008,
198,
2,
357,
16,
11,
16410,
12,
20,
11,
352,
11,
604,
4357,
25915,
20,
11,
352,
11,
362,
11907,
8
] | 2.993377 | 151 |
from .trial import generate_trial_id
import random
import hashlib
import pandas as pd
| [
6738,
764,
45994,
1330,
7716,
62,
45994,
62,
312,
198,
11748,
4738,
198,
11748,
12234,
8019,
198,
11748,
19798,
292,
355,
279,
67,
628
] | 3.625 | 24 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# from flask_security import login_required
from functools import wraps
from .blueprints import register_blueprints
from .slugify import slugify
from app.settings import project_name
try: from instance.settings import project_name
except ImportError: pass
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
422,
42903,
62,
12961,
1330,
17594,
62,
35827,
198,
6738,
1257,
310,
10141,
1330,
27521,
198,
198,
6738,
764,
17585,
17190,
1330,
7881,
62,
17585,
17190,
198,
6738,
764,
6649,
1018,
1958,
1330,
31065,
1958,
198,
198,
6738,
598,
13,
33692,
1330,
1628,
62,
3672,
198,
28311,
25,
422,
4554,
13,
33692,
1330,
1628,
62,
3672,
198,
16341,
17267,
12331,
25,
1208,
628
] | 3.477273 | 88 |
import requests
if __name__ == '__main__':
main() | [
11748,
7007,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1388,
3419
] | 2.7 | 20 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import model_utils.fields
import django.utils.timezone
| [
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,
198,
11748,
2746,
62,
26791,
13,
25747,
198,
11748,
42625,
14208,
13,
26791,
13,
2435,
11340,
628
] | 3.056604 | 53 |
"""Application tests.
"""
import i_xero2
def test_version():
"""Test the version of the app.
"""
assert i_xero2.__version__
| [
37811,
23416,
5254,
13,
198,
37811,
198,
11748,
1312,
62,
87,
3529,
17,
198,
198,
4299,
1332,
62,
9641,
33529,
198,
220,
220,
220,
37227,
14402,
262,
2196,
286,
262,
598,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
6818,
1312,
62,
87,
3529,
17,
13,
834,
9641,
834,
198
] | 2.634615 | 52 |
from django.test import TestCase
from esmond.poll import IfDescrCorrelator, JnxFirewallCorrelator, \
JnxCOSCorrelator, SentryCorrelator, \
ALUSAPCorrelator
#def test_jnx_cos_correlator():
# s = MockSession()
# c = JnxCOSCorrelator(s)
# c.setup()
# for (var,val,check) in s.walk('jnxCosIfqQedBytes'):
# assert check == c.lookup('jnxCosIfqQedBytes', var)
| [
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
6738,
1658,
6327,
13,
30393,
1330,
1002,
24564,
81,
10606,
2411,
1352,
11,
449,
77,
87,
13543,
11930,
10606,
2411,
1352,
11,
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,
220,
220,
220,
449,
77,
87,
34,
2640,
10606,
2411,
1352,
11,
11352,
563,
10606,
2411,
1352,
11,
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,
220,
220,
220,
8355,
2937,
2969,
10606,
2411,
1352,
628,
198,
2,
4299,
1332,
62,
73,
77,
87,
62,
6966,
62,
10215,
2411,
1352,
33529,
198,
2,
220,
220,
220,
264,
796,
44123,
36044,
3419,
198,
2,
220,
220,
220,
269,
796,
449,
77,
87,
34,
2640,
10606,
2411,
1352,
7,
82,
8,
198,
2,
220,
220,
220,
269,
13,
40406,
3419,
198,
2,
220,
220,
220,
329,
357,
7785,
11,
2100,
11,
9122,
8,
287,
264,
13,
11152,
10786,
73,
77,
87,
36734,
1532,
80,
48,
276,
45992,
6,
2599,
198,
2,
220,
220,
220,
220,
220,
220,
220,
6818,
2198,
6624,
269,
13,
5460,
929,
10786,
73,
77,
87,
36734,
1532,
80,
48,
276,
45992,
3256,
1401,
8,
628
] | 1.941441 | 222 |
from . import common_pb2 as common_messages
from contextlib import redirect_stdout
from .Utility import Utility
import json, io
| [
6738,
764,
1330,
2219,
62,
40842,
17,
355,
2219,
62,
37348,
1095,
198,
6738,
4732,
8019,
1330,
18941,
62,
19282,
448,
198,
6738,
764,
18274,
879,
1330,
34030,
198,
11748,
33918,
11,
33245,
198
] | 3.764706 | 34 |
# Copyright © 2018 Stanislav Hnatiuk. All rights reserved.
"""Module of functions."""
from operator import itemgetter
from itertools import groupby
def stime_to_decimal(s):
"""Lololo."""
return s.hour + s.minute / 60
def group_time(records):
"""Lololo."""
records.sort(key=itemgetter(6, 1))
result = [
[stime_to_decimal(time), *[item[0] for item in group]]
for time, group in groupby(records, key=itemgetter(6))
]
return result
def group_sensor(records):
"""Lololo."""
records.sort(key=itemgetter(1))
result = ['X', *[key[1] for key, _ in groupby(
records, key=itemgetter(1, 2))]]
return result
def group_category(records):
"""Lololo."""
records.sort(key=itemgetter(3))
result = [{
'id': key[0],
'name': key[1],
'measure': key[2],
'data': [*[item for item in group]],
} for key, group in groupby(records, key=itemgetter(3, 4, 5))]
for item in result:
item['rows'] = group_time(item['data'])
item['cols'] = group_sensor(item['data'])
item.pop('data')
return result
# [
# {
# "cols": [
# "X",
# "Sens 1",
# "Sens 2"
# ],
# "id": 1,
# "measure": "AAA",
# "name": "Cat 1",
# "rows": [
# [
# 10.916666666666666,
# 17.0,
# 14.0
# ]
# ]
# },
# {
# "cols": [
# "X",
# "Sens 3"
# ],
# "id": 2,
# "measure": "AAA",
# "name": "Cat 2",
# "rows": [
# [
# 10.916666666666666,
# 13.0
# ]
# ]
# }
# ] | [
2,
15069,
10673,
2864,
7299,
3044,
615,
367,
77,
7246,
2724,
13,
1439,
2489,
10395,
13,
198,
198,
37811,
26796,
286,
5499,
526,
15931,
198,
198,
6738,
10088,
1330,
2378,
1136,
353,
198,
6738,
340,
861,
10141,
1330,
1448,
1525,
628,
198,
4299,
336,
524,
62,
1462,
62,
12501,
4402,
7,
82,
2599,
198,
220,
220,
220,
37227,
43,
349,
14057,
526,
15931,
198,
220,
220,
220,
1441,
264,
13,
9769,
1343,
264,
13,
11374,
1220,
3126,
628,
198,
4299,
1448,
62,
2435,
7,
8344,
3669,
2599,
198,
220,
220,
220,
37227,
43,
349,
14057,
526,
15931,
198,
220,
220,
220,
4406,
13,
30619,
7,
2539,
28,
9186,
1136,
353,
7,
21,
11,
352,
4008,
198,
220,
220,
220,
1255,
796,
685,
198,
220,
220,
220,
220,
220,
220,
220,
685,
301,
524,
62,
1462,
62,
12501,
4402,
7,
2435,
828,
1635,
58,
9186,
58,
15,
60,
329,
2378,
287,
1448,
11907,
198,
220,
220,
220,
220,
220,
220,
220,
329,
640,
11,
1448,
287,
1448,
1525,
7,
8344,
3669,
11,
1994,
28,
9186,
1136,
353,
7,
21,
4008,
198,
220,
220,
220,
2361,
198,
220,
220,
220,
1441,
1255,
628,
198,
4299,
1448,
62,
82,
22854,
7,
8344,
3669,
2599,
198,
220,
220,
220,
37227,
43,
349,
14057,
526,
15931,
198,
220,
220,
220,
4406,
13,
30619,
7,
2539,
28,
9186,
1136,
353,
7,
16,
4008,
198,
220,
220,
220,
1255,
796,
37250,
55,
3256,
1635,
58,
2539,
58,
16,
60,
329,
1994,
11,
4808,
287,
1448,
1525,
7,
198,
220,
220,
220,
220,
220,
220,
220,
4406,
11,
1994,
28,
9186,
1136,
353,
7,
16,
11,
362,
4008,
11907,
198,
220,
220,
220,
1441,
1255,
628,
198,
4299,
1448,
62,
22872,
7,
8344,
3669,
2599,
198,
220,
220,
220,
37227,
43,
349,
14057,
526,
15931,
198,
220,
220,
220,
4406,
13,
30619,
7,
2539,
28,
9186,
1136,
353,
7,
18,
4008,
198,
220,
220,
220,
1255,
796,
685,
90,
198,
220,
220,
220,
220,
220,
220,
220,
705,
312,
10354,
1994,
58,
15,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
705,
3672,
10354,
1994,
58,
16,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
705,
1326,
5015,
10354,
1994,
58,
17,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7890,
10354,
30138,
58,
9186,
329,
2378,
287,
1448,
60,
4357,
198,
220,
220,
220,
1782,
329,
1994,
11,
1448,
287,
1448,
1525,
7,
8344,
3669,
11,
1994,
28,
9186,
1136,
353,
7,
18,
11,
604,
11,
642,
4008,
60,
628,
220,
220,
220,
329,
2378,
287,
1255,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2378,
17816,
8516,
20520,
796,
1448,
62,
2435,
7,
9186,
17816,
7890,
6,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
2378,
17816,
4033,
82,
20520,
796,
1448,
62,
82,
22854,
7,
9186,
17816,
7890,
6,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
2378,
13,
12924,
10786,
7890,
11537,
628,
220,
220,
220,
1441,
1255,
198,
198,
2,
685,
198,
2,
220,
220,
1391,
198,
2,
220,
220,
220,
220,
366,
4033,
82,
1298,
685,
198,
2,
220,
220,
220,
220,
220,
220,
366,
55,
1600,
220,
198,
2,
220,
220,
220,
220,
220,
220,
366,
50,
641,
352,
1600,
220,
198,
2,
220,
220,
220,
220,
220,
220,
366,
50,
641,
362,
1,
198,
2,
220,
220,
220,
220,
16589,
220,
198,
2,
220,
220,
220,
220,
366,
312,
1298,
352,
11,
220,
198,
2,
220,
220,
220,
220,
366,
1326,
5015,
1298,
366,
29697,
1600,
220,
198,
2,
220,
220,
220,
220,
366,
3672,
1298,
366,
21979,
352,
1600,
220,
198,
2,
220,
220,
220,
220,
366,
8516,
1298,
685,
198,
2,
220,
220,
220,
220,
220,
220,
685,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
838,
13,
48894,
41977,
19060,
11,
220,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
1596,
13,
15,
11,
220,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
1478,
13,
15,
198,
2,
220,
220,
220,
220,
220,
220,
2361,
198,
2,
220,
220,
220,
220,
2361,
198,
2,
220,
220,
8964,
220,
198,
2,
220,
220,
1391,
198,
2,
220,
220,
220,
220,
366,
4033,
82,
1298,
685,
198,
2,
220,
220,
220,
220,
220,
220,
366,
55,
1600,
220,
198,
2,
220,
220,
220,
220,
220,
220,
366,
50,
641,
513,
1,
198,
2,
220,
220,
220,
220,
16589,
220,
198,
2,
220,
220,
220,
220,
366,
312,
1298,
362,
11,
220,
198,
2,
220,
220,
220,
220,
366,
1326,
5015,
1298,
366,
29697,
1600,
220,
198,
2,
220,
220,
220,
220,
366,
3672,
1298,
366,
21979,
362,
1600,
220,
198,
2,
220,
220,
220,
220,
366,
8516,
1298,
685,
198,
2,
220,
220,
220,
220,
220,
220,
685,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
838,
13,
48894,
41977,
19060,
11,
220,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
1511,
13,
15,
198,
2,
220,
220,
220,
220,
220,
220,
2361,
198,
2,
220,
220,
220,
220,
2361,
198,
2,
220,
220,
1782,
198,
2,
2361
] | 1.91253 | 846 |
# MINLP written by GAMS Convert at 04/21/18 13:54:56
#
# Equation counts
# Total E G L N X C B
# 140 56 33 51 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc si
# Total cont binary integer sos1 sos2 scont sint
# 70 61 9 0 0 0 0 0
# FX 0 0 0 0 0 0 0 0
#
# Nonzero counts
# Total const NL DLL
# 401 182 219 0
#
# Reformulation has removed 1 variable and 1 equation
from pyomo.environ import *
model = m = ConcreteModel()
m.x1 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x2 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x3 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x4 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x5 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x6 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x7 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x8 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x9 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x10 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x11 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x12 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x13 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x14 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x15 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x16 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x17 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x18 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x19 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x20 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x21 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x22 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x23 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x24 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x25 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x26 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x27 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x28 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x29 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x30 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x31 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x32 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x33 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x34 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x35 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x36 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x37 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x38 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x39 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x40 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x41 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x42 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x43 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x44 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x45 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x46 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x47 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x48 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x49 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x50 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x51 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x52 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x53 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x54 = Var(within=Reals,bounds=(None,None),initialize=0)
m.b55 = Var(within=Binary,bounds=(0,1),initialize=0)
m.b56 = Var(within=Binary,bounds=(0,1),initialize=0)
m.b57 = Var(within=Binary,bounds=(0,1),initialize=0)
m.b58 = Var(within=Binary,bounds=(0,1),initialize=0)
m.b59 = Var(within=Binary,bounds=(0,1),initialize=0)
m.b60 = Var(within=Binary,bounds=(0,1),initialize=0)
m.b61 = Var(within=Binary,bounds=(0,1),initialize=0)
m.b62 = Var(within=Binary,bounds=(0,1),initialize=0)
m.b63 = Var(within=Binary,bounds=(0,1),initialize=0)
m.x64 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x65 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x66 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x67 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x68 = Var(within=Reals,bounds=(None,None),initialize=0)
m.x69 = Var(within=Reals,bounds=(None,None),initialize=0)
m.obj = Objective(expr=1100*m.x64**2 + 500*m.x64 + 850*m.x65**2 + 120*m.x65 + 1225*m.x66**2 + 100*m.x66
+ 1085, sense=minimize)
m.c2 = Constraint(expr=-17.0648464163823*m.x3*m.x6*sin(m.x48 - m.x51)*m.b55 + m.x10 == 0)
m.c3 = Constraint(expr=-17.0648464163823*m.x6*m.x3*sin(m.x51 - m.x48)*m.b55 + m.x11 == 0)
m.c4 = Constraint(expr=-(1.61712247324614*m.x7**2 - 1.61712247324614*m.x7*m.x8*cos(m.x52 - m.x53) + 13.6979785969084*
m.x7*m.x8*sin(m.x52 - m.x53))*m.b56 + m.x12 == 0)
m.c5 = Constraint(expr=-(1.61712247324614*m.x8**2 - 1.61712247324614*m.x8*m.x7*cos(m.x53 - m.x52) + 13.6979785969084*
m.x8*m.x7*sin(m.x53 - m.x52))*m.b56 + m.x13 == 0)
m.c6 = Constraint(expr=-(1.28200913842411*m.x5**2 - 1.28200913842411*m.x5*m.x6*cos(m.x50 - m.x51) + 5.58824496236153*
m.x5*m.x6*sin(m.x50 - m.x51))*m.b57 + m.x14 == 0)
m.c7 = Constraint(expr=-(1.28200913842411*m.x6**2 - 1.28200913842411*m.x6*m.x5*cos(m.x51 - m.x50) + 5.58824496236153*
m.x6*m.x5*sin(m.x51 - m.x50))*m.b57 + m.x15 == 0)
m.c8 = Constraint(expr=-(1.1550874808901*m.x6**2 - 1.1550874808901*m.x6*m.x7*cos(m.x51 - m.x52) + 9.78427042636317*m.x6*
m.x7*sin(m.x51 - m.x52))*m.b58 + m.x16 == 0)
m.c9 = Constraint(expr=-(1.1550874808901*m.x7**2 - 1.1550874808901*m.x7*m.x6*cos(m.x52 - m.x51) + 9.78427042636317*m.x7*
m.x6*sin(m.x52 - m.x51))*m.b58 + m.x17 == 0)
m.c10 = Constraint(expr=-16*m.x8*m.x2*sin(m.x53 - m.x47)*m.b59 + m.x18 == 0)
m.c11 = Constraint(expr=-16*m.x2*m.x8*sin(m.x47 - m.x53)*m.b59 + m.x19 == 0)
m.c12 = Constraint(expr=-(1.94219124871473*m.x4**2 - 1.94219124871473*m.x4*m.x5*cos(m.x49 - m.x50) + 10.5106820518679*
m.x4*m.x5*sin(m.x49 - m.x50))*m.b60 + m.x20 == 0)
m.c13 = Constraint(expr=-(1.94219124871473*m.x5**2 - 1.94219124871473*m.x5*m.x4*cos(m.x50 - m.x49) + 10.5106820518679*
m.x5*m.x4*sin(m.x50 - m.x49))*m.b60 + m.x21 == 0)
m.c14 = Constraint(expr=-17.3611111111111*m.x1*m.x4*sin(m.x46 - m.x49)*m.b61 + m.x22 == 0)
m.c15 = Constraint(expr=-17.3611111111111*m.x4*m.x1*sin(m.x49 - m.x46)*m.b61 + m.x23 == 0)
m.c16 = Constraint(expr=-(1.36518771331058*m.x9**2 - 1.36518771331058*m.x9*m.x4*cos(m.x54 - m.x49) + 11.6040955631399*
m.x9*m.x4*sin(m.x54 - m.x49))*m.b62 + m.x24 == 0)
m.c17 = Constraint(expr=-(1.36518771331058*m.x4**2 - 1.36518771331058*m.x4*m.x9*cos(m.x49 - m.x54) + 11.6040955631399*
m.x4*m.x9*sin(m.x49 - m.x54))*m.b62 + m.x25 == 0)
m.c18 = Constraint(expr=-(1.18760437929115*m.x8**2 - 1.18760437929115*m.x8*m.x9*cos(m.x53 - m.x54) + 5.97513453330859*
m.x8*m.x9*sin(m.x53 - m.x54))*m.b63 + m.x26 == 0)
m.c19 = Constraint(expr=-(1.18760437929115*m.x9**2 - 1.18760437929115*m.x9*m.x8*cos(m.x54 - m.x53) + 5.97513453330859*
m.x9*m.x8*sin(m.x54 - m.x53))*m.b63 + m.x27 == 0)
m.c20 = Constraint(expr=-(17.0648464163823*m.x3**2 - 17.0648464163823*m.x3*m.x6*cos(m.x48 - m.x51))*m.b55 + m.x28 == 0)
m.c21 = Constraint(expr=-(17.0648464163823*m.x6**2 - 17.0648464163823*m.x6*m.x3*cos(m.x51 - m.x48))*m.b55 + m.x29 == 0)
m.c22 = Constraint(expr=-(13.6234785969084*m.x7**2 - 13.6979785969084*m.x7*m.x8*cos(m.x52 - m.x53) - 1.61712247324614*
m.x7*m.x8*sin(m.x52 - m.x53))*m.b56 + m.x30 == 0)
m.c23 = Constraint(expr=-(13.6234785969084*m.x8**2 - 13.6979785969084*m.x8*m.x7*cos(m.x53 - m.x52) - 1.61712247324614*
m.x8*m.x7*sin(m.x53 - m.x52))*m.b56 + m.x31 == 0)
m.c24 = Constraint(expr=-(5.40924496236153*m.x5**2 - 5.58824496236153*m.x5*m.x6*cos(m.x50 - m.x51) - 1.28200913842411*
m.x5*m.x6*sin(m.x50 - m.x51))*m.b57 + m.x32 == 0)
m.c25 = Constraint(expr=-(5.40924496236153*m.x6**2 - 5.58824496236153*m.x6*m.x5*cos(m.x51 - m.x50) - 1.28200913842411*
m.x6*m.x5*sin(m.x51 - m.x50))*m.b57 + m.x33 == 0)
m.c26 = Constraint(expr=-(9.67977042636317*m.x6**2 - 9.78427042636317*m.x6*m.x7*cos(m.x51 - m.x52) - 1.1550874808901*
m.x6*m.x7*sin(m.x51 - m.x52))*m.b58 + m.x34 == 0)
m.c27 = Constraint(expr=-(9.67977042636317*m.x7**2 - 9.78427042636317*m.x7*m.x6*cos(m.x52 - m.x51) - 1.1550874808901*
m.x7*m.x6*sin(m.x52 - m.x51))*m.b58 + m.x35 == 0)
m.c28 = Constraint(expr=-(16*m.x8**2 - 16*m.x8*m.x2*cos(m.x53 - m.x47))*m.b59 + m.x36 == 0)
m.c29 = Constraint(expr=-(16*m.x2**2 - 16*m.x2*m.x8*cos(m.x47 - m.x53))*m.b59 + m.x37 == 0)
m.c30 = Constraint(expr=-(10.4316820518679*m.x4**2 - 10.5106820518679*m.x4*m.x5*cos(m.x49 - m.x50) - 1.94219124871473*
m.x4*m.x5*sin(m.x49 - m.x50))*m.b60 + m.x38 == 0)
m.c31 = Constraint(expr=-(10.4316820518679*m.x5**2 - 10.5106820518679*m.x5*m.x4*cos(m.x50 - m.x49) - 1.94219124871473*
m.x5*m.x4*sin(m.x50 - m.x49))*m.b60 + m.x39 == 0)
m.c32 = Constraint(expr=-(17.3611111111111*m.x1**2 - 17.3611111111111*m.x1*m.x4*cos(m.x46 - m.x49))*m.b61 + m.x40 == 0)
m.c33 = Constraint(expr=-(17.3611111111111*m.x4**2 - 17.3611111111111*m.x4*m.x1*cos(m.x49 - m.x46))*m.b61 + m.x41 == 0)
m.c34 = Constraint(expr=-(11.5160955631399*m.x9**2 - 11.6040955631399*m.x9*m.x4*cos(m.x54 - m.x49) - 1.36518771331058*
m.x9*m.x4*sin(m.x54 - m.x49))*m.b62 + m.x42 == 0)
m.c35 = Constraint(expr=-(11.5160955631399*m.x4**2 - 11.6040955631399*m.x4*m.x9*cos(m.x49 - m.x54) - 1.36518771331058*
m.x4*m.x9*sin(m.x49 - m.x54))*m.b62 + m.x43 == 0)
m.c36 = Constraint(expr=-(5.82213453330859*m.x8**2 - 5.97513453330859*m.x8*m.x9*cos(m.x53 - m.x54) - 1.18760437929115*
m.x8*m.x9*sin(m.x53 - m.x54))*m.b63 + m.x44 == 0)
m.c37 = Constraint(expr=-(5.82213453330859*m.x9**2 - 5.97513453330859*m.x9*m.x8*cos(m.x54 - m.x53) - 1.18760437929115*
m.x9*m.x8*sin(m.x54 - m.x53))*m.b63 + m.x45 == 0)
m.c38 = Constraint(expr=m.x10**2 + m.x28**2 <= 9)
m.c39 = Constraint(expr=m.x11**2 + m.x29**2 <= 9)
m.c40 = Constraint(expr=m.x12**2 + m.x30**2 <= 6.25)
m.c41 = Constraint(expr=m.x13**2 + m.x31**2 <= 6.25)
m.c42 = Constraint(expr=m.x14**2 + m.x32**2 <= 2.25)
m.c43 = Constraint(expr=m.x15**2 + m.x33**2 <= 2.25)
m.c44 = Constraint(expr=m.x16**2 + m.x34**2 <= 2.25)
m.c45 = Constraint(expr=m.x17**2 + m.x35**2 <= 2.25)
m.c46 = Constraint(expr=m.x18**2 + m.x36**2 <= 6.25)
m.c47 = Constraint(expr=m.x19**2 + m.x37**2 <= 6.25)
m.c48 = Constraint(expr=m.x20**2 + m.x38**2 <= 6.25)
m.c49 = Constraint(expr=m.x21**2 + m.x39**2 <= 6.25)
m.c50 = Constraint(expr=m.x22**2 + m.x40**2 <= 6.25)
m.c51 = Constraint(expr=m.x23**2 + m.x41**2 <= 6.25)
m.c52 = Constraint(expr=m.x24**2 + m.x42**2 <= 6.25)
m.c53 = Constraint(expr=m.x25**2 + m.x43**2 <= 6.25)
m.c54 = Constraint(expr=m.x26**2 + m.x44**2 <= 6.25)
m.c55 = Constraint(expr=m.x27**2 + m.x45**2 <= 6.25)
m.c56 = Constraint(expr= m.x64 <= 2.5)
m.c57 = Constraint(expr= m.x65 <= 3)
m.c58 = Constraint(expr= m.x66 <= 2.7)
m.c59 = Constraint(expr= m.x64 >= 0.1)
m.c60 = Constraint(expr= m.x65 >= 0.1)
m.c61 = Constraint(expr= m.x66 >= 0.1)
m.c62 = Constraint(expr= m.x67 <= 3)
m.c63 = Constraint(expr= m.x68 <= 3)
m.c64 = Constraint(expr= m.x69 <= 3)
m.c65 = Constraint(expr= m.x67 >= -3)
m.c66 = Constraint(expr= m.x68 >= -3)
m.c67 = Constraint(expr= m.x69 >= -3)
m.c68 = Constraint(expr= m.x1 <= 1.1)
m.c69 = Constraint(expr= m.x2 <= 1.1)
m.c70 = Constraint(expr= m.x3 <= 1.1)
m.c71 = Constraint(expr= m.x4 <= 1.1)
m.c72 = Constraint(expr= m.x5 <= 1.1)
m.c73 = Constraint(expr= m.x6 <= 1.1)
m.c74 = Constraint(expr= m.x7 <= 1.1)
m.c75 = Constraint(expr= m.x8 <= 1.1)
m.c76 = Constraint(expr= m.x9 <= 1.1)
m.c77 = Constraint(expr= m.x1 >= 0.9)
m.c78 = Constraint(expr= m.x2 >= 0.9)
m.c79 = Constraint(expr= m.x3 >= 0.9)
m.c80 = Constraint(expr= m.x4 >= 0.9)
m.c81 = Constraint(expr= m.x5 >= 0.9)
m.c82 = Constraint(expr= m.x6 >= 0.9)
m.c83 = Constraint(expr= m.x7 >= 0.9)
m.c84 = Constraint(expr= m.x8 >= 0.9)
m.c85 = Constraint(expr= m.x9 >= 0.9)
m.c86 = Constraint(expr= m.x48 - m.x51 >= -0.26)
m.c87 = Constraint(expr= - m.x48 + m.x51 >= -0.26)
m.c88 = Constraint(expr= m.x52 - m.x53 >= -0.26)
m.c89 = Constraint(expr= - m.x52 + m.x53 >= -0.26)
m.c90 = Constraint(expr= m.x50 - m.x51 >= -0.26)
m.c91 = Constraint(expr= - m.x50 + m.x51 >= -0.26)
m.c92 = Constraint(expr= m.x51 - m.x52 >= -0.26)
m.c93 = Constraint(expr= - m.x51 + m.x52 >= -0.26)
m.c94 = Constraint(expr= - m.x47 + m.x53 >= -0.26)
m.c95 = Constraint(expr= m.x47 - m.x53 >= -0.26)
m.c96 = Constraint(expr= m.x49 - m.x50 >= -0.26)
m.c97 = Constraint(expr= - m.x49 + m.x50 >= -0.26)
m.c98 = Constraint(expr= m.x46 - m.x49 >= -0.26)
m.c99 = Constraint(expr= - m.x46 + m.x49 >= -0.26)
m.c100 = Constraint(expr= - m.x49 + m.x54 >= -0.26)
m.c101 = Constraint(expr= m.x49 - m.x54 >= -0.26)
m.c102 = Constraint(expr= m.x53 - m.x54 >= -0.26)
m.c103 = Constraint(expr= - m.x53 + m.x54 >= -0.26)
m.c104 = Constraint(expr= m.x48 - m.x51 <= 0.26)
m.c105 = Constraint(expr= - m.x48 + m.x51 <= 0.26)
m.c106 = Constraint(expr= m.x52 - m.x53 <= 0.26)
m.c107 = Constraint(expr= - m.x52 + m.x53 <= 0.26)
m.c108 = Constraint(expr= m.x50 - m.x51 <= 0.26)
m.c109 = Constraint(expr= - m.x50 + m.x51 <= 0.26)
m.c110 = Constraint(expr= m.x51 - m.x52 <= 0.26)
m.c111 = Constraint(expr= - m.x51 + m.x52 <= 0.26)
m.c112 = Constraint(expr= - m.x47 + m.x53 <= 0.26)
m.c113 = Constraint(expr= m.x47 - m.x53 <= 0.26)
m.c114 = Constraint(expr= m.x49 - m.x50 <= 0.26)
m.c115 = Constraint(expr= - m.x49 + m.x50 <= 0.26)
m.c116 = Constraint(expr= m.x46 - m.x49 <= 0.26)
m.c117 = Constraint(expr= - m.x46 + m.x49 <= 0.26)
m.c118 = Constraint(expr= - m.x49 + m.x54 <= 0.26)
m.c119 = Constraint(expr= m.x49 - m.x54 <= 0.26)
m.c120 = Constraint(expr= m.x53 - m.x54 <= 0.26)
m.c121 = Constraint(expr= - m.x53 + m.x54 <= 0.26)
m.c122 = Constraint(expr= m.x46 == 0)
m.c123 = Constraint(expr= m.x22 - m.x64 == 0)
m.c124 = Constraint(expr= m.x19 - m.x65 == 0)
m.c125 = Constraint(expr= m.x10 - m.x66 == 0)
m.c126 = Constraint(expr= m.x40 - m.x67 == 0)
m.c127 = Constraint(expr= m.x37 - m.x68 == 0)
m.c128 = Constraint(expr= m.x28 - m.x69 == 0)
m.c129 = Constraint(expr= m.x20 + m.x23 + m.x25 == 0)
m.c130 = Constraint(expr= m.x14 + m.x21 == -0.9)
m.c131 = Constraint(expr= m.x11 + m.x15 + m.x16 == 0)
m.c132 = Constraint(expr= m.x12 + m.x17 == -1)
m.c133 = Constraint(expr= m.x13 + m.x18 + m.x26 == 0)
m.c134 = Constraint(expr= m.x24 + m.x27 == -1.25)
m.c135 = Constraint(expr= m.x38 + m.x41 + m.x43 == 0)
m.c136 = Constraint(expr= m.x32 + m.x39 == -0.3)
m.c137 = Constraint(expr= m.x29 + m.x33 + m.x34 == 0)
m.c138 = Constraint(expr= m.x30 + m.x35 == -0.35)
m.c139 = Constraint(expr= m.x31 + m.x36 + m.x44 == 0)
m.c140 = Constraint(expr= m.x42 + m.x45 == -0.5)
| [
2,
220,
20625,
19930,
3194,
416,
402,
40834,
38240,
379,
8702,
14,
2481,
14,
1507,
1511,
25,
4051,
25,
3980,
198,
2,
220,
220,
198,
2,
220,
7889,
341,
9853,
198,
2,
220,
220,
220,
220,
220,
7472,
220,
220,
220,
220,
220,
220,
220,
412,
220,
220,
220,
220,
220,
220,
220,
402,
220,
220,
220,
220,
220,
220,
220,
406,
220,
220,
220,
220,
220,
220,
220,
399,
220,
220,
220,
220,
220,
220,
220,
1395,
220,
220,
220,
220,
220,
220,
220,
327,
220,
220,
220,
220,
220,
220,
220,
347,
198,
2,
220,
220,
220,
220,
220,
220,
220,
12713,
220,
220,
220,
220,
220,
220,
7265,
220,
220,
220,
220,
220,
220,
4747,
220,
220,
220,
220,
220,
220,
6885,
220,
220,
220,
220,
220,
220,
220,
657,
220,
220,
220,
220,
220,
220,
220,
657,
220,
220,
220,
220,
220,
220,
220,
657,
220,
220,
220,
220,
220,
220,
220,
657,
198,
2,
220,
220,
198,
2,
220,
35748,
9853,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
220,
220,
220,
220,
220,
220,
220,
275,
220,
220,
220,
220,
220,
220,
220,
1312,
220,
220,
220,
220,
220,
264,
16,
82,
220,
220,
220,
220,
220,
264,
17,
82,
220,
220,
220,
220,
220,
220,
629,
220,
220,
220,
220,
220,
220,
33721,
198,
2,
220,
220,
220,
220,
220,
7472,
220,
220,
220,
220,
542,
220,
220,
13934,
220,
18253,
220,
220,
220,
220,
264,
418,
16,
220,
220,
220,
220,
264,
418,
17,
220,
220,
220,
629,
756,
220,
220,
220,
220,
264,
600,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
4317,
220,
220,
220,
220,
220,
220,
8454,
220,
220,
220,
220,
220,
220,
220,
860,
220,
220,
220,
220,
220,
220,
220,
657,
220,
220,
220,
220,
220,
220,
220,
657,
220,
220,
220,
220,
220,
220,
220,
657,
220,
220,
220,
220,
220,
220,
220,
657,
220,
220,
220,
220,
220,
220,
220,
657,
198,
2,
220,
19534,
220,
220,
220,
220,
220,
657,
220,
220,
220,
220,
220,
220,
220,
657,
220,
220,
220,
220,
220,
220,
220,
657,
220,
220,
220,
220,
220,
220,
220,
657,
220,
220,
220,
220,
220,
220,
220,
657,
220,
220,
220,
220,
220,
220,
220,
657,
220,
220,
220,
220,
220,
220,
220,
657,
220,
220,
220,
220,
220,
220,
220,
657,
198,
2,
220,
220,
198,
2,
220,
8504,
22570,
9853,
198,
2,
220,
220,
220,
220,
220,
7472,
220,
220,
220,
1500,
220,
220,
220,
220,
220,
220,
22879,
220,
220,
220,
220,
220,
360,
3069,
198,
2,
220,
220,
220,
220,
220,
220,
220,
22219,
220,
220,
220,
220,
220,
28581,
220,
220,
220,
220,
220,
30453,
220,
220,
220,
220,
220,
220,
220,
657,
198,
2,
220,
198,
2,
220,
17893,
1741,
468,
4615,
352,
7885,
290,
352,
16022,
628,
198,
6738,
12972,
17902,
13,
268,
2268,
1330,
1635,
198,
198,
19849,
796,
285,
796,
1482,
38669,
17633,
3419,
628,
198,
76,
13,
87,
16,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
17,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
18,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
19,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
20,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
21,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
22,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
23,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
24,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
940,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
1157,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
1065,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
1485,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
1415,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
1314,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
1433,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
1558,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
1507,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
1129,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
1238,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
2481,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
1828,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
1954,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
1731,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
1495,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
2075,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
1983,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
2078,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
1959,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
1270,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
3132,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
2624,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
2091,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
2682,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
2327,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
2623,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
2718,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
2548,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
2670,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
1821,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
3901,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
3682,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
3559,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
2598,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
2231,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
3510,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
2857,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
2780,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
2920,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
1120,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
4349,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
4309,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
4310,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
4051,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
65,
2816,
796,
12372,
7,
33479,
28,
33,
3219,
11,
65,
3733,
16193,
15,
11,
16,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
65,
3980,
796,
12372,
7,
33479,
28,
33,
3219,
11,
65,
3733,
16193,
15,
11,
16,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
65,
3553,
796,
12372,
7,
33479,
28,
33,
3219,
11,
65,
3733,
16193,
15,
11,
16,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
65,
3365,
796,
12372,
7,
33479,
28,
33,
3219,
11,
65,
3733,
16193,
15,
11,
16,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
65,
3270,
796,
12372,
7,
33479,
28,
33,
3219,
11,
65,
3733,
16193,
15,
11,
16,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
65,
1899,
796,
12372,
7,
33479,
28,
33,
3219,
11,
65,
3733,
16193,
15,
11,
16,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
65,
5333,
796,
12372,
7,
33479,
28,
33,
3219,
11,
65,
3733,
16193,
15,
11,
16,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
65,
5237,
796,
12372,
7,
33479,
28,
33,
3219,
11,
65,
3733,
16193,
15,
11,
16,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
65,
5066,
796,
12372,
7,
33479,
28,
33,
3219,
11,
65,
3733,
16193,
15,
11,
16,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
2414,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
2996,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
2791,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
3134,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
3104,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
76,
13,
87,
3388,
796,
12372,
7,
33479,
28,
3041,
874,
11,
65,
3733,
16193,
14202,
11,
14202,
828,
36733,
1096,
28,
15,
8,
198,
198,
76,
13,
26801,
796,
37092,
7,
31937,
28,
42060,
9,
76,
13,
87,
2414,
1174,
17,
1343,
5323,
9,
76,
13,
87,
2414,
1343,
30607,
9,
76,
13,
87,
2996,
1174,
17,
1343,
7982,
9,
76,
13,
87,
2996,
1343,
1105,
1495,
9,
76,
13,
87,
2791,
1174,
17,
1343,
1802,
9,
76,
13,
87,
2791,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1343,
838,
5332,
11,
2565,
28,
1084,
48439,
8,
198,
198,
76,
13,
66,
17,
796,
1482,
2536,
2913,
7,
31937,
10779,
1558,
13,
15,
2414,
5705,
2414,
1433,
2548,
1954,
9,
76,
13,
87,
18,
9,
76,
13,
87,
21,
9,
31369,
7,
76,
13,
87,
2780,
532,
285,
13,
87,
4349,
27493,
76,
13,
65,
2816,
1343,
285,
13,
87,
940,
6624,
657,
8,
198,
198,
76,
13,
66,
18,
796,
1482,
2536,
2913,
7,
31937,
10779,
1558,
13,
15,
2414,
5705,
2414,
1433,
2548,
1954,
9,
76,
13,
87,
21,
9,
76,
13,
87,
18,
9,
31369,
7,
76,
13,
87,
4349,
532,
285,
13,
87,
2780,
27493,
76,
13,
65,
2816,
1343,
285,
13,
87,
1157,
6624,
657,
8,
198,
198,
76,
13,
66,
19,
796,
1482,
2536,
2913,
7,
31937,
10779,
7,
16,
13,
47941,
1065,
1731,
4790,
26912,
1415,
9,
76,
13,
87,
22,
1174,
17,
532,
352,
13,
47941,
1065,
1731,
4790,
26912,
1415,
9,
76,
13,
87,
22,
9,
76,
13,
87,
23,
9,
6966,
7,
76,
13,
87,
4309,
532,
285,
13,
87,
4310,
8,
1343,
1511,
13,
3388,
3720,
3695,
3270,
3388,
2919,
19,
9,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
13,
87,
22,
9,
76,
13,
87,
23,
9,
31369,
7,
76,
13,
87,
4309,
532,
285,
13,
87,
4310,
4008,
9,
76,
13,
65,
3980,
1343,
285,
13,
87,
1065,
6624,
657,
8,
198,
198,
76,
13,
66,
20,
796,
1482,
2536,
2913,
7,
31937,
10779,
7,
16,
13,
47941,
1065,
1731,
4790,
26912,
1415,
9,
76,
13,
87,
23,
1174,
17,
532,
352,
13,
47941,
1065,
1731,
4790,
26912,
1415,
9,
76,
13,
87,
23,
9,
76,
13,
87,
22,
9,
6966,
7,
76,
13,
87,
4310,
532,
285,
13,
87,
4309,
8,
1343,
1511,
13,
3388,
3720,
3695,
3270,
3388,
2919,
19,
9,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
13,
87,
23,
9,
76,
13,
87,
22,
9,
31369,
7,
76,
13,
87,
4310,
532,
285,
13,
87,
4309,
4008,
9,
76,
13,
65,
3980,
1343,
285,
13,
87,
1485,
6624,
657,
8,
198,
198,
76,
13,
66,
21,
796,
1482,
2536,
2913,
7,
31937,
10779,
7,
16,
13,
2078,
10531,
1485,
5705,
1731,
1157,
9,
76,
13,
87,
20,
1174,
17,
532,
352,
13,
2078,
10531,
1485,
5705,
1731,
1157,
9,
76,
13,
87,
20,
9,
76,
13,
87,
21,
9,
6966,
7,
76,
13,
87,
1120,
532,
285,
13,
87,
4349,
8,
1343,
642,
13,
39118,
1731,
37747,
24940,
21395,
9,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
13,
87,
20,
9,
76,
13,
87,
21,
9,
31369,
7,
76,
13,
87,
1120,
532,
285,
13,
87,
4349,
4008,
9,
76,
13,
65,
3553,
1343,
285,
13,
87,
1415,
6624,
657,
8,
198,
198,
76,
13,
66,
22,
796,
1482,
2536,
2913,
7,
31937,
10779,
7,
16,
13,
2078,
10531,
1485,
5705,
1731,
1157,
9,
76,
13,
87,
21,
1174,
17,
532,
352,
13,
2078,
10531,
1485,
5705,
1731,
1157,
9,
76,
13,
87,
21,
9,
76,
13,
87,
20,
9,
6966,
7,
76,
13,
87,
4349,
532,
285,
13,
87,
1120,
8,
1343,
642,
13,
39118,
1731,
37747,
24940,
21395,
9,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
13,
87,
21,
9,
76,
13,
87,
20,
9,
31369,
7,
76,
13,
87,
4349,
532,
285,
13,
87,
1120,
4008,
9,
76,
13,
65,
3553,
1343,
285,
13,
87,
1314,
6624,
657,
8,
198,
198,
76,
13,
66,
23,
796,
1482,
2536,
2913,
7,
31937,
10779,
7,
16,
13,
1314,
33042,
4524,
1795,
4531,
486,
9,
76,
13,
87,
21,
1174,
17,
532,
352,
13,
1314,
33042,
4524,
1795,
4531,
486,
9,
76,
13,
87,
21,
9,
76,
13,
87,
22,
9,
6966,
7,
76,
13,
87,
4349,
532,
285,
13,
87,
4309,
8,
1343,
860,
13,
37688,
1983,
3023,
2075,
2623,
34125,
9,
76,
13,
87,
21,
9,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
13,
87,
22,
9,
31369,
7,
76,
13,
87,
4349,
532,
285,
13,
87,
4309,
4008,
9,
76,
13,
65,
3365,
1343,
285,
13,
87,
1433,
6624,
657,
8,
198,
198,
76,
13,
66,
24,
796,
1482,
2536,
2913,
7,
31937,
10779,
7,
16,
13,
1314,
33042,
4524,
1795,
4531,
486,
9,
76,
13,
87,
22,
1174,
17,
532,
352,
13,
1314,
33042,
4524,
1795,
4531,
486,
9,
76,
13,
87,
22,
9,
76,
13,
87,
21,
9,
6966,
7,
76,
13,
87,
4309,
532,
285,
13,
87,
4349,
8,
1343,
860,
13,
37688,
1983,
3023,
2075,
2623,
34125,
9,
76,
13,
87,
22,
9,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
13,
87,
21,
9,
31369,
7,
76,
13,
87,
4309,
532,
285,
13,
87,
4349,
4008,
9,
76,
13,
65,
3365,
1343,
285,
13,
87,
1558,
6624,
657,
8,
198,
198,
76,
13,
66,
940,
796,
1482,
2536,
2913,
7,
31937,
10779,
1433,
9,
76,
13,
87,
23,
9,
76,
13,
87,
17,
9,
31369,
7,
76,
13,
87,
4310,
532,
285,
13,
87,
2857,
27493,
76,
13,
65,
3270,
1343,
285,
13,
87,
1507,
6624,
657,
8,
198,
198,
76,
13,
66,
1157,
796,
1482,
2536,
2913,
7,
31937,
10779,
1433,
9,
76,
13,
87,
17,
9,
76,
13,
87,
23,
9,
31369,
7,
76,
13,
87,
2857,
532,
285,
13,
87,
4310,
27493,
76,
13,
65,
3270,
1343,
285,
13,
87,
1129,
6624,
657,
8,
198,
198,
76,
13,
66,
1065,
796,
1482,
2536,
2913,
7,
31937,
10779,
7,
16,
13,
24,
3682,
1129,
1065,
35133,
1415,
4790,
9,
76,
13,
87,
19,
1174,
17,
532,
352,
13,
24,
3682,
1129,
1065,
35133,
1415,
4790,
9,
76,
13,
87,
19,
9,
76,
13,
87,
20,
9,
6966,
7,
76,
13,
87,
2920,
532,
285,
13,
87,
1120,
8,
1343,
838,
13,
33690,
3104,
21261,
1507,
37601,
9,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
13,
87,
19,
9,
76,
13,
87,
20,
9,
31369,
7,
76,
13,
87,
2920,
532,
285,
13,
87,
1120,
4008,
9,
76,
13,
65,
1899,
1343,
285,
13,
87,
1238,
6624,
657,
8,
198,
198,
76,
13,
66,
1485,
796,
1482,
2536,
2913,
7,
31937,
10779,
7,
16,
13,
24,
3682,
1129,
1065,
35133,
1415,
4790,
9,
76,
13,
87,
20,
1174,
17,
532,
352,
13,
24,
3682,
1129,
1065,
35133,
1415,
4790,
9,
76,
13,
87,
20,
9,
76,
13,
87,
19,
9,
6966,
7,
76,
13,
87,
1120,
532,
285,
13,
87,
2920,
8,
1343,
838,
13,
33690,
3104,
21261,
1507,
37601,
9,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
13,
87,
20,
9,
76,
13,
87,
19,
9,
31369,
7,
76,
13,
87,
1120,
532,
285,
13,
87,
2920,
4008,
9,
76,
13,
65,
1899,
1343,
285,
13,
87,
2481,
6624,
657,
8,
198,
198,
76,
13,
66,
1415,
796,
1482,
2536,
2913,
7,
31937,
10779,
1558,
13,
2623,
26259,
26259,
16243,
9,
76,
13,
87,
16,
9,
76,
13,
87,
19,
9,
31369,
7,
76,
13,
87,
3510,
532,
285,
13,
87,
2920,
27493,
76,
13,
65,
5333,
1343,
285,
13,
87,
1828,
6624,
657,
8,
198,
198,
76,
13,
66,
1314,
796,
1482,
2536,
2913,
7,
31937,
10779,
1558,
13,
2623,
26259,
26259,
16243,
9,
76,
13,
87,
19,
9,
76,
13,
87,
16,
9,
31369,
7,
76,
13,
87,
2920,
532,
285,
13,
87,
3510,
27493,
76,
13,
65,
5333,
1343,
285,
13,
87,
1954,
6624,
657,
8,
198,
198,
76,
13,
66,
1433,
796,
1482,
2536,
2913,
7,
31937,
10779,
7,
16,
13,
24760,
1507,
3324,
16945,
940,
3365,
9,
76,
13,
87,
24,
1174,
17,
532,
352,
13,
24760,
1507,
3324,
16945,
940,
3365,
9,
76,
13,
87,
24,
9,
76,
13,
87,
19,
9,
6966,
7,
76,
13,
87,
4051,
532,
285,
13,
87,
2920,
8,
1343,
1367,
13,
1899,
29416,
2816,
5066,
1485,
2079,
9,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
13,
87,
24,
9,
76,
13,
87,
19,
9,
31369,
7,
76,
13,
87,
4051,
532,
285,
13,
87,
2920,
4008,
9,
76,
13,
65,
5237,
1343,
285,
13,
87,
1731,
6624,
657,
8,
198,
198,
76,
13,
66,
1558,
796,
1482,
2536,
2913,
7,
31937,
10779,
7,
16,
13,
24760,
1507,
3324,
16945,
940,
3365,
9,
76,
13,
87,
19,
1174,
17,
532,
352,
13,
24760,
1507,
3324,
16945,
940,
3365,
9,
76,
13,
87,
19,
9,
76,
13,
87,
24,
9,
6966,
7,
76,
13,
87,
2920,
532,
285,
13,
87,
4051,
8,
1343,
1367,
13,
1899,
29416,
2816,
5066,
1485,
2079,
9,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
13,
87,
19,
9,
76,
13,
87,
24,
9,
31369,
7,
76,
13,
87,
2920,
532,
285,
13,
87,
4051,
4008,
9,
76,
13,
65,
5237,
1343,
285,
13,
87,
1495,
6624,
657,
8,
198,
198,
76,
13,
66,
1507,
796,
1482,
2536,
2913,
7,
31937,
10779,
7,
16,
13,
23451,
31916,
29088,
1959,
15363,
9,
76,
13,
87,
23,
1174,
17,
532,
352,
13,
23451,
31916,
29088,
1959,
15363,
9,
76,
13,
87,
23,
9,
76,
13,
87,
24,
9,
6966,
7,
76,
13,
87,
4310,
532,
285,
13,
87,
4051,
8,
1343,
642,
13,
42716,
1485,
2231,
2091,
21495,
3270,
9,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
13,
87,
23,
9,
76,
13,
87,
24,
9,
31369,
7,
76,
13,
87,
4310,
532,
285,
13,
87,
4051,
4008,
9,
76,
13,
65,
5066,
1343,
285,
13,
87,
2075,
6624,
657,
8,
198,
198,
76,
13,
66,
1129,
796,
1482,
2536,
2913,
7,
31937,
10779,
7,
16,
13,
23451,
31916,
29088,
1959,
15363,
9,
76,
13,
87,
24,
1174,
17,
532,
352,
13,
23451,
31916,
29088,
1959,
15363,
9,
76,
13,
87,
24,
9,
76,
13,
87,
23,
9,
6966,
7,
76,
13,
87,
4051,
532,
285,
13,
87,
4310,
8,
1343,
642,
13,
42716,
1485,
2231,
2091,
21495,
3270,
9,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
13,
87,
24,
9,
76,
13,
87,
23,
9,
31369,
7,
76,
13,
87,
4051,
532,
285,
13,
87,
4310,
4008,
9,
76,
13,
65,
5066,
1343,
285,
13,
87,
1983,
6624,
657,
8,
198,
198,
76,
13,
66,
1238,
796,
1482,
2536,
2913,
7,
31937,
10779,
7,
1558,
13,
15,
2414,
5705,
2414,
1433,
2548,
1954,
9,
76,
13,
87,
18,
1174,
17,
532,
1596,
13,
15,
2414,
5705,
2414,
1433,
2548,
1954,
9,
76,
13,
87,
18,
9,
76,
13,
87,
21,
9,
6966,
7,
76,
13,
87,
2780,
532,
285,
13,
87,
4349,
4008,
9,
76,
13,
65,
2816,
1343,
285,
13,
87,
2078,
6624,
657,
8,
198,
198,
76,
13,
66,
2481,
796,
1482,
2536,
2913,
7,
31937,
10779,
7,
1558,
13,
15,
2414,
5705,
2414,
1433,
2548,
1954,
9,
76,
13,
87,
21,
1174,
17,
532,
1596,
13,
15,
2414,
5705,
2414,
1433,
2548,
1954,
9,
76,
13,
87,
21,
9,
76,
13,
87,
18,
9,
6966,
7,
76,
13,
87,
4349,
532,
285,
13,
87,
2780,
4008,
9,
76,
13,
65,
2816,
1343,
285,
13,
87,
1959,
6624,
657,
8,
198,
198,
76,
13,
66,
1828,
796,
1482,
2536,
2913,
7,
31937,
10779,
7,
1485,
13,
46872,
29059,
3270,
3388,
2919,
19,
9,
76,
13,
87,
22,
1174,
17,
532,
1511,
13,
3388,
3720,
3695,
3270,
3388,
2919,
19,
9,
76,
13,
87,
22,
9,
76,
13,
87,
23,
9,
6966,
7,
76,
13,
87,
4309,
532,
285,
13,
87,
4310,
8,
532,
352,
13,
47941,
1065,
1731,
4790,
26912,
1415,
9,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
13,
87,
22,
9,
76,
13,
87,
23,
9,
31369,
7,
76,
13,
87,
4309,
532,
285,
13,
87,
4310,
4008,
9,
76,
13,
65,
3980,
1343,
285,
13,
87,
1270,
6624,
657,
8,
198,
198,
76,
13,
66,
1954,
796,
1482,
2536,
2913,
7,
31937,
10779,
7,
1485,
13,
46872,
29059,
3270,
3388,
2919,
19,
9,
76,
13,
87,
23,
1174,
17,
532,
1511,
13,
3388,
3720,
3695,
3270,
3388,
2919,
19,
9,
76,
13,
87,
23,
9,
76,
13,
87,
22,
9,
6966,
7,
76,
13,
87,
4310,
532,
285,
13,
87,
4309,
8,
532,
352,
13,
47941,
1065,
1731,
4790,
26912,
1415,
9,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
13,
87,
23,
9,
76,
13,
87,
22,
9,
31369,
7,
76,
13,
87,
4310,
532,
285,
13,
87,
4309,
4008,
9,
76,
13,
65,
3980,
1343,
285,
13,
87,
3132,
6624,
657,
8,
198,
198,
76,
13,
66,
1731,
796,
1482,
2536,
2913,
7,
31937,
10779,
7,
20,
13,
29416,
1731,
37747,
24940,
21395,
9,
76,
13,
87,
20,
1174,
17,
532,
642,
13,
39118,
1731,
37747,
24940,
21395,
9,
76,
13,
87,
20,
9,
76,
13,
87,
21,
9,
6966,
7,
76,
13,
87,
1120,
532,
285,
13,
87,
4349,
8,
532,
352,
13,
2078,
10531,
1485,
5705,
1731,
1157,
9,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
13,
87,
20,
9,
76,
13,
87,
21,
9,
31369,
7,
76,
13,
87,
1120,
532,
285,
13,
87,
4349,
4008,
9,
76,
13,
65,
3553,
1343,
285,
13,
87,
2624,
6624,
657,
8,
198,
198,
76,
13,
66,
1495,
796,
1482,
2536,
2913,
7,
31937,
10779,
7,
20,
13,
29416,
1731,
37747,
24940,
21395,
9,
76,
13,
87,
21,
1174,
17,
532,
642,
13,
39118,
1731,
37747,
24940,
21395,
9,
76,
13,
87,
21,
9,
76,
13,
87,
20,
9,
6966,
7,
76,
13,
87,
4349,
532,
285,
13,
87,
1120,
8,
532,
352,
13,
2078,
10531,
1485,
5705,
1731,
1157,
9,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
13,
87,
21,
9,
76,
13,
87,
20,
9,
31369,
7,
76,
13,
87,
4349,
532,
285,
13,
87,
1120,
4008,
9,
76,
13,
65,
3553,
1343,
285,
13,
87,
2091,
6624,
657,
8,
198,
198,
76,
13,
66,
2075,
796,
1482,
2536,
2913,
7,
31937,
10779,
7,
24,
13,
3134,
5607,
32869,
2075,
2623,
34125,
9,
76,
13,
87,
21,
1174,
17,
532,
860,
13,
37688,
1983,
3023,
2075,
2623,
34125,
9,
76,
13,
87,
21,
9,
76,
13,
87,
22,
9,
6966,
7,
76,
13,
87,
4349,
532,
285,
13,
87,
4309,
8,
532,
352,
13,
1314,
33042,
4524,
1795,
4531,
486,
9,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
13,
87,
21,
9,
76,
13,
87,
22,
9,
31369,
7,
76,
13,
87,
4349,
532,
285,
13,
87,
4309,
4008,
9,
76,
13,
65,
3365,
1343,
285,
13,
87,
2682,
6624,
657,
8,
198,
198,
76,
13,
66,
1983,
796,
1482,
2536,
2913,
7,
31937,
10779,
7,
24,
13,
3134,
5607,
32869,
2075,
2623,
34125,
9,
76,
13,
87,
22,
1174,
17,
532,
860,
13,
37688,
1983,
3023,
2075,
2623,
34125,
9,
76,
13,
87,
22,
9,
76,
13,
87,
21,
9,
6966,
7,
76,
13,
87,
4309,
532,
285,
13,
87,
4349,
8,
532,
352,
13,
1314,
33042,
4524,
1795,
4531,
486,
9,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
13,
87,
22,
9,
76,
13,
87,
21,
9,
31369,
7,
76,
13,
87,
4309,
532,
285,
13,
87,
4349,
4008,
9,
76,
13,
65,
3365,
1343,
285,
13,
87,
2327,
6624,
657,
8,
198,
198,
76,
13,
66,
2078,
796,
1482,
2536,
2913,
7,
31937,
10779,
7,
1433,
9,
76,
13,
87,
23,
1174,
17,
532,
1467,
9,
76,
13,
87,
23,
9,
76,
13,
87,
17,
9,
6966,
7,
76,
13,
87,
4310,
532,
285,
13,
87,
2857,
4008,
9,
76,
13,
65,
3270,
1343,
285,
13,
87,
2623,
6624,
657,
8,
198,
198,
76,
13,
66,
1959,
796,
1482,
2536,
2913,
7,
31937,
10779,
7,
1433,
9,
76,
13,
87,
17,
1174,
17,
532,
1467,
9,
76,
13,
87,
17,
9,
76,
13,
87,
23,
9,
6966,
7,
76,
13,
87,
2857,
532,
285,
13,
87,
4310,
4008,
9,
76,
13,
65,
3270,
1343,
285,
13,
87,
2718,
6624,
657,
8,
198,
198,
76,
13,
66,
1270,
796,
1482,
2536,
2913,
7,
31937,
10779,
7,
940,
13,
3559,
14656,
21261,
1507,
37601,
9,
76,
13,
87,
19,
1174,
17,
532,
838,
13,
33690,
3104,
21261,
1507,
37601,
9,
76,
13,
87,
19,
9,
76,
13,
87,
20,
9,
6966,
7,
76,
13,
87,
2920,
532,
285,
13,
87,
1120,
8,
532,
352,
13,
24,
3682,
1129,
1065,
35133,
1415,
4790,
9,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
13,
87,
19,
9,
76,
13,
87,
20,
9,
31369,
7,
76,
13,
87,
2920,
532,
285,
13,
87,
1120,
4008,
9,
76,
13,
65,
1899,
1343,
285,
13,
87,
2548,
6624,
657,
8,
198,
198,
76,
13,
66,
3132,
796,
1482,
2536,
2913,
7,
31937,
10779,
7,
940,
13,
3559,
14656,
21261,
1507,
37601,
9,
76,
13,
87,
20,
1174,
17,
532,
838,
13,
33690,
3104,
21261,
1507,
37601,
9,
76,
13,
87,
20,
9,
76,
13,
87,
19,
9,
6966,
7,
76,
13,
87,
1120,
532,
285,
13,
87,
2920,
8,
532,
352,
13,
24,
3682,
1129,
1065,
35133,
1415,
4790,
9,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
13,
87,
20,
9,
76,
13,
87,
19,
9,
31369,
7,
76,
13,
87,
1120,
532,
285,
13,
87,
2920,
4008,
9,
76,
13,
65,
1899,
1343,
285,
13,
87,
2670,
6624,
657,
8,
198,
198,
76,
13,
66,
2624,
796,
1482,
2536,
2913,
7,
31937,
10779,
7,
1558,
13,
2623,
26259,
26259,
16243,
9,
76,
13,
87,
16,
1174,
17,
532,
1596,
13,
2623,
26259,
26259,
16243,
9,
76,
13,
87,
16,
9,
76,
13,
87,
19,
9,
6966,
7,
76,
13,
87,
3510,
532,
285,
13,
87,
2920,
4008,
9,
76,
13,
65,
5333,
1343,
285,
13,
87,
1821,
6624,
657,
8,
198,
198,
76,
13,
66,
2091,
796,
1482,
2536,
2913,
7,
31937,
10779,
7,
1558,
13,
2623,
26259,
26259,
16243,
9,
76,
13,
87,
19,
1174,
17,
532,
1596,
13,
2623,
26259,
26259,
16243,
9,
76,
13,
87,
19,
9,
76,
13,
87,
16,
9,
6966,
7,
76,
13,
87,
2920,
532,
285,
13,
87,
3510,
4008,
9,
76,
13,
65,
5333,
1343,
285,
13,
87,
3901,
6624,
657,
8,
198,
198,
76,
13,
66,
2682,
796,
1482,
2536,
2913,
7,
31937,
10779,
7,
1157,
13,
47493,
2931,
2816,
5066,
1485,
2079,
9,
76,
13,
87,
24,
1174,
17,
532,
1367,
13,
1899,
29416,
2816,
5066,
1485,
2079,
9,
76,
13,
87,
24,
9,
76,
13,
87,
19,
9,
6966,
7,
76,
13,
87,
4051,
532,
285,
13,
87,
2920,
8,
532,
352,
13,
24760,
1507,
3324,
16945,
940,
3365,
9,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
13,
87,
24,
9,
76,
13,
87,
19,
9,
31369,
7,
76,
13,
87,
4051,
532,
285,
13,
87,
2920,
4008,
9,
76,
13,
65,
5237,
1343,
285,
13,
87,
3682,
6624,
657,
8,
198,
198,
76,
13,
66,
2327,
796,
1482,
2536,
2913,
7,
31937,
10779,
7,
1157,
13,
47493,
2931,
2816,
5066,
1485,
2079,
9,
76,
13,
87,
19,
1174,
17,
532,
1367,
13,
1899,
29416,
2816,
5066,
1485,
2079,
9,
76,
13,
87,
19,
9,
76,
13,
87,
24,
9,
6966,
7,
76,
13,
87,
2920,
532,
285,
13,
87,
4051,
8,
532,
352,
13,
24760,
1507,
3324,
16945,
940,
3365,
9,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
13,
87,
19,
9,
76,
13,
87,
24,
9,
31369,
7,
76,
13,
87,
2920,
532,
285,
13,
87,
4051,
4008,
9,
76,
13,
65,
5237,
1343,
285,
13,
87,
3559,
6624,
657,
8,
198,
198,
76,
13,
66,
2623,
796,
1482,
2536,
2913,
7,
31937,
10779,
7,
20,
13,
23,
1828,
1485,
2231,
2091,
21495,
3270,
9,
76,
13,
87,
23,
1174,
17,
532,
642,
13,
42716,
1485,
2231,
2091,
21495,
3270,
9,
76,
13,
87,
23,
9,
76,
13,
87,
24,
9,
6966,
7,
76,
13,
87,
4310,
532,
285,
13,
87,
4051,
8,
532,
352,
13,
23451,
31916,
29088,
1959,
15363,
9,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
13,
87,
23,
9,
76,
13,
87,
24,
9,
31369,
7,
76,
13,
87,
4310,
532,
285,
13,
87,
4051,
4008,
9,
76,
13,
65,
5066,
1343,
285,
13,
87,
2598,
6624,
657,
8,
198,
198,
76,
13,
66,
2718,
796,
1482,
2536,
2913,
7,
31937,
10779,
7,
20,
13,
23,
1828,
1485,
2231,
2091,
21495,
3270,
9,
76,
13,
87,
24,
1174,
17,
532,
642,
13,
42716,
1485,
2231,
2091,
21495,
3270,
9,
76,
13,
87,
24,
9,
76,
13,
87,
23,
9,
6966,
7,
76,
13,
87,
4051,
532,
285,
13,
87,
4310,
8,
532,
352,
13,
23451,
31916,
29088,
1959,
15363,
9,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
13,
87,
24,
9,
76,
13,
87,
23,
9,
31369,
7,
76,
13,
87,
4051,
532,
285,
13,
87,
4310,
4008,
9,
76,
13,
65,
5066,
1343,
285,
13,
87,
2231,
6624,
657,
8,
198,
198,
76,
13,
66,
2548,
796,
1482,
2536,
2913,
7,
31937,
28,
76,
13,
87,
940,
1174,
17,
1343,
285,
13,
87,
2078,
1174,
17,
19841,
860,
8,
198,
198,
76,
13,
66,
2670,
796,
1482,
2536,
2913,
7,
31937,
28,
76,
13,
87,
1157,
1174,
17,
1343,
285,
13,
87,
1959,
1174,
17,
19841,
860,
8,
198,
198,
76,
13,
66,
1821,
796,
1482,
2536,
2913,
7,
31937,
28,
76,
13,
87,
1065,
1174,
17,
1343,
285,
13,
87,
1270,
1174,
17,
19841,
718,
13,
1495,
8,
198,
198,
76,
13,
66,
3901,
796,
1482,
2536,
2913,
7,
31937,
28,
76,
13,
87,
1485,
1174,
17,
1343,
285,
13,
87,
3132,
1174,
17,
19841,
718,
13,
1495,
8,
198,
198,
76,
13,
66,
3682,
796,
1482,
2536,
2913,
7,
31937,
28,
76,
13,
87,
1415,
1174,
17,
1343,
285,
13,
87,
2624,
1174,
17,
19841,
362,
13,
1495,
8,
198,
198,
76,
13,
66,
3559,
796,
1482,
2536,
2913,
7,
31937,
28,
76,
13,
87,
1314,
1174,
17,
1343,
285,
13,
87,
2091,
1174,
17,
19841,
362,
13,
1495,
8,
198,
198,
76,
13,
66,
2598,
796,
1482,
2536,
2913,
7,
31937,
28,
76,
13,
87,
1433,
1174,
17,
1343,
285,
13,
87,
2682,
1174,
17,
19841,
362,
13,
1495,
8,
198,
198,
76,
13,
66,
2231,
796,
1482,
2536,
2913,
7,
31937,
28,
76,
13,
87,
1558,
1174,
17,
1343,
285,
13,
87,
2327,
1174,
17,
19841,
362,
13,
1495,
8,
198,
198,
76,
13,
66,
3510,
796,
1482,
2536,
2913,
7,
31937,
28,
76,
13,
87,
1507,
1174,
17,
1343,
285,
13,
87,
2623,
1174,
17,
19841,
718,
13,
1495,
8,
198,
198,
76,
13,
66,
2857,
796,
1482,
2536,
2913,
7,
31937,
28,
76,
13,
87,
1129,
1174,
17,
1343,
285,
13,
87,
2718,
1174,
17,
19841,
718,
13,
1495,
8,
198,
198,
76,
13,
66,
2780,
796,
1482,
2536,
2913,
7,
31937,
28,
76,
13,
87,
1238,
1174,
17,
1343,
285,
13,
87,
2548,
1174,
17,
19841,
718,
13,
1495,
8,
198,
198,
76,
13,
66,
2920,
796,
1482,
2536,
2913,
7,
31937,
28,
76,
13,
87,
2481,
1174,
17,
1343,
285,
13,
87,
2670,
1174,
17,
19841,
718,
13,
1495,
8,
198,
198,
76,
13,
66,
1120,
796,
1482,
2536,
2913,
7,
31937,
28,
76,
13,
87,
1828,
1174,
17,
1343,
285,
13,
87,
1821,
1174,
17,
19841,
718,
13,
1495,
8,
198,
198,
76,
13,
66,
4349,
796,
1482,
2536,
2913,
7,
31937,
28,
76,
13,
87,
1954,
1174,
17,
1343,
285,
13,
87,
3901,
1174,
17,
19841,
718,
13,
1495,
8,
198,
198,
76,
13,
66,
4309,
796,
1482,
2536,
2913,
7,
31937,
28,
76,
13,
87,
1731,
1174,
17,
1343,
285,
13,
87,
3682,
1174,
17,
19841,
718,
13,
1495,
8,
198,
198,
76,
13,
66,
4310,
796,
1482,
2536,
2913,
7,
31937,
28,
76,
13,
87,
1495,
1174,
17,
1343,
285,
13,
87,
3559,
1174,
17,
19841,
718,
13,
1495,
8,
198,
198,
76,
13,
66,
4051,
796,
1482,
2536,
2913,
7,
31937,
28,
76,
13,
87,
2075,
1174,
17,
1343,
285,
13,
87,
2598,
1174,
17,
19841,
718,
13,
1495,
8,
198,
198,
76,
13,
66,
2816,
796,
1482,
2536,
2913,
7,
31937,
28,
76,
13,
87,
1983,
1174,
17,
1343,
285,
13,
87,
2231,
1174,
17,
19841,
718,
13,
1495,
8,
198,
198,
76,
13,
66,
3980,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
2414,
19841,
362,
13,
20,
8,
198,
198,
76,
13,
66,
3553,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
2996,
19841,
513,
8,
198,
198,
76,
13,
66,
3365,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
2791,
19841,
362,
13,
22,
8,
198,
198,
76,
13,
66,
3270,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
2414,
18189,
657,
13,
16,
8,
198,
198,
76,
13,
66,
1899,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
2996,
18189,
657,
13,
16,
8,
198,
198,
76,
13,
66,
5333,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
2791,
18189,
657,
13,
16,
8,
198,
198,
76,
13,
66,
5237,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
3134,
19841,
513,
8,
198,
198,
76,
13,
66,
5066,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
3104,
19841,
513,
8,
198,
198,
76,
13,
66,
2414,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
3388,
19841,
513,
8,
198,
198,
76,
13,
66,
2996,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
3134,
18189,
532,
18,
8,
198,
198,
76,
13,
66,
2791,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
3104,
18189,
532,
18,
8,
198,
198,
76,
13,
66,
3134,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
3388,
18189,
532,
18,
8,
198,
198,
76,
13,
66,
3104,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
16,
19841,
352,
13,
16,
8,
198,
198,
76,
13,
66,
3388,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
17,
19841,
352,
13,
16,
8,
198,
198,
76,
13,
66,
2154,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
18,
19841,
352,
13,
16,
8,
198,
198,
76,
13,
66,
4869,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
19,
19841,
352,
13,
16,
8,
198,
198,
76,
13,
66,
4761,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
20,
19841,
352,
13,
16,
8,
198,
198,
76,
13,
66,
4790,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
21,
19841,
352,
13,
16,
8,
198,
198,
76,
13,
66,
4524,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
22,
19841,
352,
13,
16,
8,
198,
198,
76,
13,
66,
2425,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
23,
19841,
352,
13,
16,
8,
198,
198,
76,
13,
66,
4304,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
24,
19841,
352,
13,
16,
8,
198,
198,
76,
13,
66,
3324,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
16,
18189,
657,
13,
24,
8,
198,
198,
76,
13,
66,
3695,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
17,
18189,
657,
13,
24,
8,
198,
198,
76,
13,
66,
3720,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
18,
18189,
657,
13,
24,
8,
198,
198,
76,
13,
66,
1795,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
19,
18189,
657,
13,
24,
8,
198,
198,
76,
13,
66,
6659,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
20,
18189,
657,
13,
24,
8,
198,
198,
76,
13,
66,
6469,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
21,
18189,
657,
13,
24,
8,
198,
198,
76,
13,
66,
5999,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
22,
18189,
657,
13,
24,
8,
198,
198,
76,
13,
66,
5705,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
23,
18189,
657,
13,
24,
8,
198,
198,
76,
13,
66,
5332,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
24,
18189,
657,
13,
24,
8,
198,
198,
76,
13,
66,
4521,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
2780,
532,
285,
13,
87,
4349,
18189,
532,
15,
13,
2075,
8,
198,
198,
76,
13,
66,
5774,
796,
1482,
2536,
2913,
7,
31937,
28,
532,
285,
13,
87,
2780,
1343,
285,
13,
87,
4349,
18189,
532,
15,
13,
2075,
8,
198,
198,
76,
13,
66,
3459,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
4309,
532,
285,
13,
87,
4310,
18189,
532,
15,
13,
2075,
8,
198,
198,
76,
13,
66,
4531,
796,
1482,
2536,
2913,
7,
31937,
28,
532,
285,
13,
87,
4309,
1343,
285,
13,
87,
4310,
18189,
532,
15,
13,
2075,
8,
198,
198,
76,
13,
66,
3829,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
1120,
532,
285,
13,
87,
4349,
18189,
532,
15,
13,
2075,
8,
198,
198,
76,
13,
66,
6420,
796,
1482,
2536,
2913,
7,
31937,
28,
532,
285,
13,
87,
1120,
1343,
285,
13,
87,
4349,
18189,
532,
15,
13,
2075,
8,
198,
198,
76,
13,
66,
5892,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
4349,
532,
285,
13,
87,
4309,
18189,
532,
15,
13,
2075,
8,
198,
198,
76,
13,
66,
6052,
796,
1482,
2536,
2913,
7,
31937,
28,
532,
285,
13,
87,
4349,
1343,
285,
13,
87,
4309,
18189,
532,
15,
13,
2075,
8,
198,
198,
76,
13,
66,
5824,
796,
1482,
2536,
2913,
7,
31937,
28,
532,
285,
13,
87,
2857,
1343,
285,
13,
87,
4310,
18189,
532,
15,
13,
2075,
8,
198,
198,
76,
13,
66,
3865,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
2857,
532,
285,
13,
87,
4310,
18189,
532,
15,
13,
2075,
8,
198,
198,
76,
13,
66,
4846,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
2920,
532,
285,
13,
87,
1120,
18189,
532,
15,
13,
2075,
8,
198,
198,
76,
13,
66,
5607,
796,
1482,
2536,
2913,
7,
31937,
28,
532,
285,
13,
87,
2920,
1343,
285,
13,
87,
1120,
18189,
532,
15,
13,
2075,
8,
198,
198,
76,
13,
66,
4089,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
3510,
532,
285,
13,
87,
2920,
18189,
532,
15,
13,
2075,
8,
198,
198,
76,
13,
66,
2079,
796,
1482,
2536,
2913,
7,
31937,
28,
532,
285,
13,
87,
3510,
1343,
285,
13,
87,
2920,
18189,
532,
15,
13,
2075,
8,
198,
198,
76,
13,
66,
3064,
796,
1482,
2536,
2913,
7,
31937,
28,
532,
285,
13,
87,
2920,
1343,
285,
13,
87,
4051,
18189,
532,
15,
13,
2075,
8,
198,
198,
76,
13,
66,
8784,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
2920,
532,
285,
13,
87,
4051,
18189,
532,
15,
13,
2075,
8,
198,
198,
76,
13,
66,
15377,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
4310,
532,
285,
13,
87,
4051,
18189,
532,
15,
13,
2075,
8,
198,
198,
76,
13,
66,
15197,
796,
1482,
2536,
2913,
7,
31937,
28,
532,
285,
13,
87,
4310,
1343,
285,
13,
87,
4051,
18189,
532,
15,
13,
2075,
8,
198,
198,
76,
13,
66,
13464,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
2780,
532,
285,
13,
87,
4349,
19841,
657,
13,
2075,
8,
198,
198,
76,
13,
66,
13348,
796,
1482,
2536,
2913,
7,
31937,
28,
532,
285,
13,
87,
2780,
1343,
285,
13,
87,
4349,
19841,
657,
13,
2075,
8,
198,
198,
76,
13,
66,
15801,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
4309,
532,
285,
13,
87,
4310,
19841,
657,
13,
2075,
8,
198,
198,
76,
13,
66,
15982,
796,
1482,
2536,
2913,
7,
31937,
28,
532,
285,
13,
87,
4309,
1343,
285,
13,
87,
4310,
19841,
657,
13,
2075,
8,
198,
198,
76,
13,
66,
15711,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
1120,
532,
285,
13,
87,
4349,
19841,
657,
13,
2075,
8,
198,
198,
76,
13,
66,
14454,
796,
1482,
2536,
2913,
7,
31937,
28,
532,
285,
13,
87,
1120,
1343,
285,
13,
87,
4349,
19841,
657,
13,
2075,
8,
198,
198,
76,
13,
66,
11442,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
4349,
532,
285,
13,
87,
4309,
19841,
657,
13,
2075,
8,
198,
198,
76,
13,
66,
16243,
796,
1482,
2536,
2913,
7,
31937,
28,
532,
285,
13,
87,
4349,
1343,
285,
13,
87,
4309,
19841,
657,
13,
2075,
8,
198,
198,
76,
13,
66,
14686,
796,
1482,
2536,
2913,
7,
31937,
28,
532,
285,
13,
87,
2857,
1343,
285,
13,
87,
4310,
19841,
657,
13,
2075,
8,
198,
198,
76,
13,
66,
16616,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
2857,
532,
285,
13,
87,
4310,
19841,
657,
13,
2075,
8,
198,
198,
76,
13,
66,
16562,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
2920,
532,
285,
13,
87,
1120,
19841,
657,
13,
2075,
8,
198,
198,
76,
13,
66,
15363,
796,
1482,
2536,
2913,
7,
31937,
28,
532,
285,
13,
87,
2920,
1343,
285,
13,
87,
1120,
19841,
657,
13,
2075,
8,
198,
198,
76,
13,
66,
18298,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
3510,
532,
285,
13,
87,
2920,
19841,
657,
13,
2075,
8,
198,
198,
76,
13,
66,
17657,
796,
1482,
2536,
2913,
7,
31937,
28,
532,
285,
13,
87,
3510,
1343,
285,
13,
87,
2920,
19841,
657,
13,
2075,
8,
198,
198,
76,
13,
66,
16817,
796,
1482,
2536,
2913,
7,
31937,
28,
532,
285,
13,
87,
2920,
1343,
285,
13,
87,
4051,
19841,
657,
13,
2075,
8,
198,
198,
76,
13,
66,
16315,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
2920,
532,
285,
13,
87,
4051,
19841,
657,
13,
2075,
8,
198,
198,
76,
13,
66,
10232,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
4310,
532,
285,
13,
87,
4051,
19841,
657,
13,
2075,
8,
198,
198,
76,
13,
66,
19244,
796,
1482,
2536,
2913,
7,
31937,
28,
532,
285,
13,
87,
4310,
1343,
285,
13,
87,
4051,
19841,
657,
13,
2075,
8,
198,
198,
76,
13,
66,
18376,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
3510,
6624,
657,
8,
198,
198,
76,
13,
66,
10163,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
1828,
532,
285,
13,
87,
2414,
6624,
657,
8,
198,
198,
76,
13,
66,
17464,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
1129,
532,
285,
13,
87,
2996,
6624,
657,
8,
198,
198,
76,
13,
66,
11623,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
940,
532,
285,
13,
87,
2791,
6624,
657,
8,
198,
198,
76,
13,
66,
19420,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
1821,
532,
285,
13,
87,
3134,
6624,
657,
8,
198,
198,
76,
13,
66,
16799,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
2718,
532,
285,
13,
87,
3104,
6624,
657,
8,
198,
198,
76,
13,
66,
12762,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
2078,
532,
285,
13,
87,
3388,
6624,
657,
8,
198,
198,
76,
13,
66,
18741,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
1238,
1343,
285,
13,
87,
1954,
1343,
285,
13,
87,
1495,
6624,
657,
8,
198,
198,
76,
13,
66,
12952,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
1415,
1343,
285,
13,
87,
2481,
6624,
532,
15,
13,
24,
8,
198,
198,
76,
13,
66,
22042,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
1157,
1343,
285,
13,
87,
1314,
1343,
285,
13,
87,
1433,
6624,
657,
8,
198,
198,
76,
13,
66,
19924,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
1065,
1343,
285,
13,
87,
1558,
6624,
532,
16,
8,
198,
198,
76,
13,
66,
16945,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
1485,
1343,
285,
13,
87,
1507,
1343,
285,
13,
87,
2075,
6624,
657,
8,
198,
198,
76,
13,
66,
19880,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
1731,
1343,
285,
13,
87,
1983,
6624,
532,
16,
13,
1495,
8,
198,
198,
76,
13,
66,
17059,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
2548,
1343,
285,
13,
87,
3901,
1343,
285,
13,
87,
3559,
6624,
657,
8,
198,
198,
76,
13,
66,
20809,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
2624,
1343,
285,
13,
87,
2670,
6624,
532,
15,
13,
18,
8,
198,
198,
76,
13,
66,
19708,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
1959,
1343,
285,
13,
87,
2091,
1343,
285,
13,
87,
2682,
6624,
657,
8,
198,
198,
76,
13,
66,
20107,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
1270,
1343,
285,
13,
87,
2327,
6624,
532,
15,
13,
2327,
8,
198,
198,
76,
13,
66,
20219,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
3132,
1343,
285,
13,
87,
2623,
1343,
285,
13,
87,
2598,
6624,
657,
8,
198,
198,
76,
13,
66,
15187,
796,
1482,
2536,
2913,
7,
31937,
28,
220,
220,
285,
13,
87,
3682,
1343,
285,
13,
87,
2231,
6624,
532,
15,
13,
20,
8,
198
] | 1.746788 | 9,028 |
# Django & Python
from django.core.urlresolvers import resolve
from django.http import HttpRequest
from django.http import QueryDict
from django.test import TestCase
from django.test import Client
from django.contrib.auth.models import User
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
import json
from account.models import Teacher
from registrar.models import Course
from registrar.models import CourseDiscussionPost
from registrar.models import CourseDiscussionThread
from teacher.views import discussion
# Contants
TEST_USER_EMAIL = "[email protected]"
TEST_USER_USERNAME = "Ledo"
TEST_USER_PASSWORD = "ContinentalUnion"
TEST_USER_EMAIL2 = "[email protected]"
TEST_USER_USERNAME2 = "whalesquid"
TEST_USER_PASSWORD2 = "Evolvers"
# Notes:
# https://docs.djangoproject.com/en/1.7/topics/testing/tools/#assertions
# Create your tests here. | [
2,
37770,
1222,
11361,
198,
6738,
42625,
14208,
13,
7295,
13,
6371,
411,
349,
690,
1330,
10568,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
18453,
198,
6738,
42625,
14208,
13,
4023,
1330,
43301,
35,
713,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
6738,
42625,
14208,
13,
9288,
1330,
20985,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
8323,
5344,
11,
17594,
11,
2604,
448,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
12501,
273,
2024,
1330,
17594,
62,
35827,
198,
11748,
33918,
198,
6738,
1848,
13,
27530,
1330,
32019,
198,
6738,
4214,
20040,
13,
27530,
1330,
20537,
198,
6738,
4214,
20040,
13,
27530,
1330,
20537,
34255,
6307,
198,
6738,
4214,
20040,
13,
27530,
1330,
20537,
34255,
16818,
198,
6738,
4701,
13,
33571,
1330,
5114,
198,
198,
2,
2345,
1187,
198,
51,
6465,
62,
29904,
62,
27630,
4146,
796,
366,
992,
78,
31,
70,
993,
13,
785,
1,
198,
51,
6465,
62,
29904,
62,
29904,
20608,
796,
366,
43,
24757,
1,
198,
51,
6465,
62,
29904,
62,
47924,
54,
12532,
796,
366,
17875,
2470,
38176,
1,
198,
51,
6465,
62,
29904,
62,
27630,
4146,
17,
796,
366,
1929,
2040,
421,
312,
31,
24717,
559,
2736,
13,
785,
1,
198,
51,
6465,
62,
29904,
62,
29904,
20608,
17,
796,
366,
1929,
2040,
421,
312,
1,
198,
51,
6465,
62,
29904,
62,
47924,
54,
12532,
17,
796,
366,
36,
10396,
690,
1,
198,
198,
2,
11822,
25,
198,
2,
3740,
1378,
31628,
13,
28241,
648,
404,
305,
752,
13,
785,
14,
268,
14,
16,
13,
22,
14,
4852,
873,
14,
33407,
14,
31391,
31113,
30493,
507,
198,
198,
2,
13610,
534,
5254,
994,
13
] | 3.12628 | 293 |
"""This file is part of the trivago/rebase library.
# Copyright (c) 2018 trivago N.V.
# License: Apache 2.0
# Source: https://github.com/trivago/rebase
# Version: 1.2.2
# Python Version: 3.6
# Author: Yuv Joodhisty <[email protected]>
"""
from rebase.core import Model, Validator
| [
37811,
1212,
2393,
318,
636,
286,
262,
19876,
3839,
14,
260,
8692,
5888,
13,
198,
198,
2,
15069,
357,
66,
8,
2864,
19876,
3839,
399,
13,
53,
13,
198,
2,
13789,
25,
24843,
362,
13,
15,
198,
2,
8090,
25,
3740,
1378,
12567,
13,
785,
14,
83,
15104,
3839,
14,
260,
8692,
198,
2,
10628,
25,
352,
13,
17,
13,
17,
198,
2,
11361,
10628,
25,
513,
13,
21,
198,
2,
6434,
25,
10605,
85,
449,
702,
10034,
88,
1279,
88,
14795,
430,
8457,
278,
71,
13,
73,
702,
10034,
88,
31,
83,
15104,
3839,
13,
785,
29,
198,
37811,
198,
198,
6738,
3405,
589,
13,
7295,
1330,
9104,
11,
48951,
1352,
628
] | 2.646018 | 113 |
import numpy as np
import cv2
import camera
import images
objCamera = camera.Camera(camera_port = 1, resolution = 1)
img = objCamera.take_photo()
gray = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY)
cv2.imshow('Gray', gray)
cv2.waitKey(0)
gray_blur = images.gaussian(gray, 11)
cv2.imshow('Gaussian', gray_blur)
cv2.waitKey(0)
gray_canny = images.canny(gray_blur, 100, 130)
cv2.imshow('Canny', gray_canny)
cv2.waitKey(0)
imshape = img.shape
vertix0 = (0, imshape[0])
vertix1 = (0, int(333 * imshape[0] / 480))
vertix2 = (int(200 * imshape[1] / 640), int(65 * imshape[0] / 480))
vertix3 = (int(430 * imshape[1] / 640), int(65 * imshape[0] / 480))
vertix4 = (imshape[1], int(333 * imshape[0] / 480))
vertix5 = (imshape[1], imshape[0])
vertices = np.array([[vertix0, vertix1, vertix2, vertix3, vertix4, vertix5]], dtype=np.int32)
region = images.region_of_interest(gray_canny, vertices)
cv2.imshow('Region', region)
cv2.waitKey(0)
hough = images.hough(img, region, 0, 0, 120)
cv2.imshow('Hough', hough)
cv2.waitKey(0)
camera.save_photo('hough', hough)
cv2.destroyAllWindows() | [
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
17,
198,
11748,
4676,
198,
11748,
4263,
628,
198,
26801,
35632,
796,
4676,
13,
35632,
7,
25695,
62,
634,
796,
352,
11,
6323,
796,
352,
8,
198,
9600,
796,
26181,
35632,
13,
20657,
62,
23074,
3419,
198,
44605,
796,
269,
85,
17,
13,
33967,
83,
10258,
7,
9600,
11,
269,
85,
17,
13,
46786,
62,
36982,
17,
38,
30631,
8,
198,
33967,
17,
13,
320,
12860,
10786,
46130,
3256,
12768,
8,
198,
33967,
17,
13,
17077,
9218,
7,
15,
8,
198,
198,
44605,
62,
2436,
333,
796,
4263,
13,
4908,
31562,
7,
44605,
11,
1367,
8,
198,
33967,
17,
13,
320,
12860,
10786,
35389,
31562,
3256,
12768,
62,
2436,
333,
8,
198,
33967,
17,
13,
17077,
9218,
7,
15,
8,
198,
198,
44605,
62,
66,
7737,
796,
4263,
13,
66,
7737,
7,
44605,
62,
2436,
333,
11,
1802,
11,
11323,
8,
198,
33967,
17,
13,
320,
12860,
10786,
34,
7737,
3256,
12768,
62,
66,
7737,
8,
198,
33967,
17,
13,
17077,
9218,
7,
15,
8,
198,
198,
320,
43358,
796,
33705,
13,
43358,
198,
1851,
844,
15,
796,
357,
15,
11,
545,
43358,
58,
15,
12962,
198,
1851,
844,
16,
796,
357,
15,
11,
493,
7,
20370,
1635,
545,
43358,
58,
15,
60,
1220,
23487,
4008,
198,
1851,
844,
17,
796,
357,
600,
7,
2167,
1635,
545,
43358,
58,
16,
60,
1220,
33759,
828,
493,
7,
2996,
1635,
545,
43358,
58,
15,
60,
1220,
23487,
4008,
198,
1851,
844,
18,
796,
357,
600,
7,
31794,
1635,
545,
43358,
58,
16,
60,
1220,
33759,
828,
493,
7,
2996,
1635,
545,
43358,
58,
15,
60,
1220,
23487,
4008,
198,
1851,
844,
19,
796,
357,
320,
43358,
58,
16,
4357,
493,
7,
20370,
1635,
545,
43358,
58,
15,
60,
1220,
23487,
4008,
198,
1851,
844,
20,
796,
357,
320,
43358,
58,
16,
4357,
545,
43358,
58,
15,
12962,
198,
1851,
1063,
796,
45941,
13,
18747,
26933,
58,
1851,
844,
15,
11,
9421,
844,
16,
11,
9421,
844,
17,
11,
9421,
844,
18,
11,
9421,
844,
19,
11,
9421,
844,
20,
60,
4357,
288,
4906,
28,
37659,
13,
600,
2624,
8,
198,
36996,
796,
4263,
13,
36996,
62,
1659,
62,
9446,
7,
44605,
62,
66,
7737,
11,
9421,
1063,
8,
198,
33967,
17,
13,
320,
12860,
10786,
47371,
3256,
3814,
8,
198,
33967,
17,
13,
17077,
9218,
7,
15,
8,
198,
198,
71,
619,
796,
4263,
13,
71,
619,
7,
9600,
11,
3814,
11,
657,
11,
657,
11,
7982,
8,
198,
33967,
17,
13,
320,
12860,
10786,
39,
619,
3256,
289,
619,
8,
198,
33967,
17,
13,
17077,
9218,
7,
15,
8,
198,
198,
25695,
13,
21928,
62,
23074,
10786,
71,
619,
3256,
289,
619,
8,
198,
198,
33967,
17,
13,
41659,
3237,
11209,
3419
] | 2.328261 | 460 |
size = int(input())
matrix = []
alice_row, alice_col = 0, 0
for r in range(size):
matrix.append(input().split())
for c in range(size):
if matrix[r][c] == "A":
alice_row, alice_col = r, c
matrix[alice_row][alice_col] = '*'
alice_collected_enough_tea = False
tea = 0
current_row, current_col = alice_row, alice_col
while True:
command = input()
current_row, current_col = get_position(command, current_row, current_col)
if not check_valid_index(current_row, current_col, size):
break
if matrix[current_row][current_col] == "R":
matrix[current_row][current_col] = "*"
break
elif matrix[current_row][current_col] == ".":
matrix[current_row][current_col] = "*"
continue
elif matrix[current_row][current_col] == "*":
continue
else:
tea += int(matrix[current_row][current_col])
matrix[current_row][current_col] = "*"
if tea >= 10:
alice_collected_enough_tea = True
break
if alice_collected_enough_tea:
print("She did it! She went to the party.")
else:
print("Alice didn't make it to the tea party.")
[print(' '.join(row)) for row in matrix] | [
628,
198,
7857,
796,
493,
7,
15414,
28955,
198,
6759,
8609,
796,
17635,
198,
198,
282,
501,
62,
808,
11,
435,
501,
62,
4033,
796,
657,
11,
657,
198,
1640,
374,
287,
2837,
7,
7857,
2599,
198,
220,
220,
220,
17593,
13,
33295,
7,
15414,
22446,
35312,
28955,
198,
220,
220,
220,
329,
269,
287,
2837,
7,
7857,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
611,
17593,
58,
81,
7131,
66,
60,
6624,
366,
32,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
435,
501,
62,
808,
11,
220,
435,
501,
62,
4033,
796,
374,
11,
269,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17593,
58,
282,
501,
62,
808,
7131,
282,
501,
62,
4033,
60,
796,
705,
9,
6,
198,
198,
282,
501,
62,
4033,
12609,
62,
48229,
62,
660,
64,
796,
10352,
198,
660,
64,
796,
657,
198,
14421,
62,
808,
11,
1459,
62,
4033,
796,
435,
501,
62,
808,
11,
435,
501,
62,
4033,
198,
4514,
6407,
25,
198,
220,
220,
220,
3141,
796,
5128,
3419,
628,
220,
220,
220,
1459,
62,
808,
11,
1459,
62,
4033,
796,
651,
62,
9150,
7,
21812,
11,
1459,
62,
808,
11,
1459,
62,
4033,
8,
628,
220,
220,
220,
611,
407,
2198,
62,
12102,
62,
9630,
7,
14421,
62,
808,
11,
1459,
62,
4033,
11,
2546,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
2270,
628,
220,
220,
220,
611,
17593,
58,
14421,
62,
808,
7131,
14421,
62,
4033,
60,
6624,
366,
49,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
17593,
58,
14421,
62,
808,
7131,
14421,
62,
4033,
60,
796,
366,
9,
1,
198,
220,
220,
220,
220,
220,
220,
220,
2270,
198,
220,
220,
220,
1288,
361,
17593,
58,
14421,
62,
808,
7131,
14421,
62,
4033,
60,
6624,
366,
526,
25,
198,
220,
220,
220,
220,
220,
220,
220,
17593,
58,
14421,
62,
808,
7131,
14421,
62,
4033,
60,
796,
366,
9,
1,
198,
220,
220,
220,
220,
220,
220,
220,
2555,
198,
220,
220,
220,
1288,
361,
17593,
58,
14421,
62,
808,
7131,
14421,
62,
4033,
60,
6624,
366,
9,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
2555,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
8887,
15853,
493,
7,
6759,
8609,
58,
14421,
62,
808,
7131,
14421,
62,
4033,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
17593,
58,
14421,
62,
808,
7131,
14421,
62,
4033,
60,
796,
366,
9,
1,
628,
220,
220,
220,
611,
8887,
18189,
838,
25,
198,
220,
220,
220,
220,
220,
220,
220,
435,
501,
62,
4033,
12609,
62,
48229,
62,
660,
64,
796,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
2270,
198,
198,
361,
435,
501,
62,
4033,
12609,
62,
48229,
62,
660,
64,
25,
198,
220,
220,
220,
3601,
7203,
3347,
750,
340,
0,
1375,
1816,
284,
262,
2151,
19570,
198,
17772,
25,
198,
220,
220,
220,
3601,
7203,
44484,
1422,
470,
787,
340,
284,
262,
8887,
2151,
19570,
198,
198,
58,
4798,
10786,
45302,
22179,
7,
808,
4008,
329,
5752,
287,
17593,
60
] | 2.31286 | 521 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -*- coding: utf8 -*-
import hashlib
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
23,
532,
9,
12,
198,
198,
11748,
12234,
8019,
628
] | 2.097561 | 41 |
import os
from pathlib import Path
from ska.sdc1.utils.image_utils import crop_to_training_area
# Challenge frequency bands
#
FREQS = [560, 1400, 9200]
full_image_dir = os.path.join("data", "images")
sample_image_dir = os.path.join("data", "sample_images")
if __name__ == "__main__":
"""
Helper script to generate small sample images from the full images, for testing.
These are 1.5 times the size (2.25 times the area) of the training area.
"""
for freq in FREQS:
try:
Path(sample_image_dir).mkdir(parents=True, exist_ok=True)
crop_to_training_area(
full_image_path(freq), sample_image_path(freq), freq, 1.5
)
except FileNotFoundError:
print(
"Could not find image {}; run download_data.sh first".format(
full_image_path(freq)
)
)
| [
11748,
28686,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
1341,
64,
13,
82,
17896,
16,
13,
26791,
13,
9060,
62,
26791,
1330,
13833,
62,
1462,
62,
34409,
62,
20337,
198,
198,
2,
13879,
8373,
11760,
198,
2,
198,
37,
2200,
48,
50,
796,
685,
34135,
11,
36641,
11,
860,
2167,
60,
198,
198,
12853,
62,
9060,
62,
15908,
796,
28686,
13,
6978,
13,
22179,
7203,
7890,
1600,
366,
17566,
4943,
198,
39873,
62,
9060,
62,
15908,
796,
28686,
13,
6978,
13,
22179,
7203,
7890,
1600,
366,
39873,
62,
17566,
4943,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
5053,
525,
4226,
284,
7716,
1402,
6291,
4263,
422,
262,
1336,
4263,
11,
329,
4856,
13,
628,
220,
220,
220,
2312,
389,
352,
13,
20,
1661,
262,
2546,
357,
17,
13,
1495,
1661,
262,
1989,
8,
286,
262,
3047,
1989,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
329,
2030,
80,
287,
44253,
48,
50,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10644,
7,
39873,
62,
9060,
62,
15908,
737,
28015,
15908,
7,
23743,
28,
17821,
11,
2152,
62,
482,
28,
17821,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13833,
62,
1462,
62,
34409,
62,
20337,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1336,
62,
9060,
62,
6978,
7,
19503,
80,
828,
6291,
62,
9060,
62,
6978,
7,
19503,
80,
828,
2030,
80,
11,
352,
13,
20,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
2845,
9220,
3673,
21077,
12331,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
23722,
407,
1064,
2939,
1391,
19629,
1057,
4321,
62,
7890,
13,
1477,
717,
1911,
18982,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1336,
62,
9060,
62,
6978,
7,
19503,
80,
8,
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
] | 2.212714 | 409 |
from unittest import TestCase
from graph import Graph
from edge import Edge
from vertex import Vertex
import collections as col
| [
6738,
555,
715,
395,
1330,
6208,
20448,
201,
198,
6738,
4823,
1330,
29681,
201,
198,
6738,
5743,
1330,
13113,
201,
198,
6738,
37423,
1330,
4643,
16886,
201,
198,
11748,
17268,
355,
951,
201,
198,
201,
198
] | 3.75 | 36 |
import unittest
from chemcharts.core.plots.base_plot import BasePlot
| [
11748,
555,
715,
395,
198,
198,
6738,
4607,
354,
5889,
13,
7295,
13,
489,
1747,
13,
8692,
62,
29487,
1330,
7308,
43328,
628
] | 3.086957 | 23 |
import re
import xml.etree.ElementTree as ET
from datetime import datetime, timedelta
import requests
from ...models import (POI, Address, Coordinates, Line, LineType, LineTypes, LiveTime, Location, MetaRide, Platform,
Ride, RidePoint, RideSegment, Searchable, Stop, TicketData, TicketList, Trip, Way, WayEvent,
WayType)
from .base import API
| [
11748,
302,
198,
11748,
35555,
13,
316,
631,
13,
20180,
27660,
355,
12152,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
198,
11748,
7007,
198,
198,
6738,
2644,
27530,
1330,
357,
16402,
40,
11,
17917,
11,
22819,
17540,
11,
6910,
11,
6910,
6030,
11,
6910,
31431,
11,
7547,
7575,
11,
13397,
11,
30277,
49,
485,
11,
19193,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21640,
11,
21640,
12727,
11,
21640,
41030,
434,
11,
11140,
540,
11,
13707,
11,
24014,
6601,
11,
24014,
8053,
11,
18383,
11,
6378,
11,
6378,
9237,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6378,
6030,
8,
198,
6738,
764,
8692,
1330,
7824,
628
] | 2.722222 | 144 |
# -*- coding: utf-8 -*-
"""Location schema."""
from marshmallow import Schema, fields, validates
from werkzeug.exceptions import BadRequest
from ceraon.constants import Errors
class LocationSchema(Schema):
"""A schema for a Location model."""
created_at = fields.DateTime(dump_only=True)
name = fields.String(required=True, load_only=True)
id = fields.UUID()
address = fields.Str()
latitude = fields.Float()
longitude = fields.Float()
private_fields = ['address', 'latitude', 'longitude']
class Meta:
"""The mata class for the location schema."""
type_ = 'location'
strict = True
@validates('name')
def validate_name(self, value):
"""Validate the name of the location."""
if not value:
raise BadRequest(Errors.LOCATION_NAME_MISSING)
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
14749,
32815,
526,
15931,
198,
6738,
22397,
42725,
1330,
10011,
2611,
11,
7032,
11,
4938,
689,
198,
6738,
266,
9587,
2736,
1018,
13,
1069,
11755,
1330,
7772,
18453,
198,
198,
6738,
269,
8607,
261,
13,
9979,
1187,
1330,
44225,
628,
198,
4871,
13397,
27054,
2611,
7,
27054,
2611,
2599,
198,
220,
220,
220,
37227,
32,
32815,
329,
257,
13397,
2746,
526,
15931,
628,
220,
220,
220,
2727,
62,
265,
796,
7032,
13,
10430,
7575,
7,
39455,
62,
8807,
28,
17821,
8,
198,
220,
220,
220,
1438,
796,
7032,
13,
10100,
7,
35827,
28,
17821,
11,
3440,
62,
8807,
28,
17821,
8,
198,
220,
220,
220,
4686,
796,
7032,
13,
52,
27586,
3419,
198,
220,
220,
220,
2209,
796,
7032,
13,
13290,
3419,
198,
220,
220,
220,
32477,
796,
7032,
13,
43879,
3419,
198,
220,
220,
220,
890,
3984,
796,
7032,
13,
43879,
3419,
628,
220,
220,
220,
2839,
62,
25747,
796,
37250,
21975,
3256,
705,
15460,
3984,
3256,
705,
6511,
3984,
20520,
628,
220,
220,
220,
1398,
30277,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
464,
285,
1045,
1398,
329,
262,
4067,
32815,
526,
15931,
628,
220,
220,
220,
220,
220,
220,
220,
2099,
62,
796,
705,
24886,
6,
198,
220,
220,
220,
220,
220,
220,
220,
7646,
796,
6407,
628,
220,
220,
220,
2488,
12102,
689,
10786,
3672,
11537,
198,
220,
220,
220,
825,
26571,
62,
3672,
7,
944,
11,
1988,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
7762,
20540,
262,
1438,
286,
262,
4067,
526,
15931,
198,
220,
220,
220,
220,
220,
220,
220,
611,
407,
1988,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
7772,
18453,
7,
9139,
5965,
13,
29701,
6234,
62,
20608,
62,
44,
16744,
2751,
8,
198
] | 2.7 | 310 |
__version__ = '0.4.4'
| [
198,
198,
834,
9641,
834,
796,
705,
15,
13,
19,
13,
19,
6,
198
] | 1.714286 | 14 |
import logging
from util import config
from abc import ABC, abstractmethod
from temporal.workflow import workflow_method
logging.basicConfig(level=logging.DEBUG)
import functools
| [
11748,
18931,
198,
6738,
7736,
1330,
4566,
198,
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
198,
6738,
21964,
13,
1818,
11125,
1330,
30798,
62,
24396,
628,
198,
6404,
2667,
13,
35487,
16934,
7,
5715,
28,
6404,
2667,
13,
30531,
8,
628,
198,
11748,
1257,
310,
10141,
628,
197,
197,
628,
628,
628,
197,
198,
197,
198,
197,
198
] | 3.355932 | 59 |
#!/usr/bin/env python
# encoding: utf-8
from itertools import groupby
from operator import itemgetter
def get_real_bases(bases):
"""
Get real bases for types argument.
>>> get_real_bases(None) #=> (object,)
>>> get_real_bases(TypeA) #=> (TypeA,)
>>> get_real_bases([TypeA, TypeB]) #=> (TypeA, TypeB)
:param bases: type or type sequence
"""
if bases is None:
return (object,)
if isinstance(bases, type):
bases = (bases,)
return tuple(bases)
def subtype(name, bases=None, attrs=None):
"""
A easier way to create a type inherited from bases(default:object)
with specified attrs.
:param name: name of new type
:param bases: bases class of new type
:param attrs: class attributes of new type
"""
return type(name, get_real_bases(bases), dict(attrs or {}))
class TypeFactory(object):
"""
Create your type from this factory.
>>> types_factory.NewType()
equals:
>>> subtype("NewType")
"""
types_factory = TypeFactory()
def subexception(name, bases=None, attrs=None):
"""
A easier way to create an Exception
:param name: name of new exception
:param bases: bases class of new exception
:param attrs: class attributes of new exception
"""
return subtype(name, bases or [Exception], attrs)
class ExceptionFactory(object):
"""
Create your type by this factory.
>>> exceptions_factory.NewError()
equals:
>>> subexception("NewError")
"""
exceptions_factory = ExceptionFactory()
class SimpleExceptions(object):
"""
Create and cached a simple exception.
"""
def freezed_attrs(attrs):
"""
Decorator the declare attributes of cls is freezed.
Attributes in attrs can only assigned once as
initialization(usually is in __init__).
:param attrs: attribute list
"""
return setattr_hook
class Constants(object):
"""
The base class of constants
"""
def constants(**kwg):
"""
Declare some constants.
"""
return Constants(kwg, {"name": "ConstantSet"})
def enums(*values):
"""
Declare some enumerations.
"""
return Constants(
{k: i for i, k in enumerate(values)},
{"name": "EnumerationSet", "getitem_hook": _enums_getitem_hook}
)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
21004,
25,
3384,
69,
12,
23,
198,
198,
6738,
340,
861,
10141,
1330,
1448,
1525,
198,
6738,
10088,
1330,
2378,
1136,
353,
628,
198,
4299,
651,
62,
5305,
62,
65,
1386,
7,
65,
1386,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
3497,
1103,
12536,
329,
3858,
4578,
13,
198,
220,
220,
220,
13163,
651,
62,
5305,
62,
65,
1386,
7,
14202,
8,
1303,
14804,
357,
15252,
35751,
198,
220,
220,
220,
13163,
651,
62,
5305,
62,
65,
1386,
7,
6030,
32,
8,
1303,
14804,
357,
6030,
32,
35751,
198,
220,
220,
220,
13163,
651,
62,
5305,
62,
65,
1386,
26933,
6030,
32,
11,
5994,
33,
12962,
1303,
14804,
357,
6030,
32,
11,
5994,
33,
8,
628,
220,
220,
220,
1058,
17143,
12536,
25,
2099,
393,
2099,
8379,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
611,
12536,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
357,
15252,
35751,
198,
220,
220,
220,
611,
318,
39098,
7,
65,
1386,
11,
2099,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
12536,
796,
357,
65,
1386,
35751,
198,
220,
220,
220,
1441,
46545,
7,
65,
1386,
8,
628,
198,
4299,
850,
4906,
7,
3672,
11,
12536,
28,
14202,
11,
708,
3808,
28,
14202,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
317,
4577,
835,
284,
2251,
257,
2099,
19552,
422,
12536,
7,
12286,
25,
15252,
8,
198,
220,
220,
220,
351,
7368,
708,
3808,
13,
628,
220,
220,
220,
1058,
17143,
1438,
25,
1438,
286,
649,
2099,
198,
220,
220,
220,
1058,
17143,
12536,
25,
12536,
1398,
286,
649,
2099,
198,
220,
220,
220,
1058,
17143,
708,
3808,
25,
1398,
12608,
286,
649,
2099,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1441,
2099,
7,
3672,
11,
651,
62,
5305,
62,
65,
1386,
7,
65,
1386,
828,
8633,
7,
1078,
3808,
393,
23884,
4008,
628,
198,
4871,
5994,
22810,
7,
15252,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
13610,
534,
2099,
422,
428,
8860,
13,
198,
220,
220,
220,
13163,
3858,
62,
69,
9548,
13,
3791,
6030,
3419,
198,
220,
220,
220,
21767,
25,
198,
220,
220,
220,
13163,
850,
4906,
7203,
3791,
6030,
4943,
198,
220,
220,
220,
37227,
198,
198,
19199,
62,
69,
9548,
796,
5994,
22810,
3419,
628,
198,
4299,
850,
1069,
4516,
7,
3672,
11,
12536,
28,
14202,
11,
708,
3808,
28,
14202,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
317,
4577,
835,
284,
2251,
281,
35528,
628,
220,
220,
220,
1058,
17143,
1438,
25,
1438,
286,
649,
6631,
198,
220,
220,
220,
1058,
17143,
12536,
25,
12536,
1398,
286,
649,
6631,
198,
220,
220,
220,
1058,
17143,
708,
3808,
25,
1398,
12608,
286,
649,
6631,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1441,
850,
4906,
7,
3672,
11,
12536,
393,
685,
16922,
4357,
708,
3808,
8,
628,
198,
4871,
35528,
22810,
7,
15252,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
13610,
534,
2099,
416,
428,
8860,
13,
198,
220,
220,
220,
13163,
13269,
62,
69,
9548,
13,
3791,
12331,
3419,
198,
220,
220,
220,
21767,
25,
198,
220,
220,
220,
13163,
850,
1069,
4516,
7203,
3791,
12331,
4943,
198,
220,
220,
220,
37227,
198,
198,
1069,
11755,
62,
69,
9548,
796,
35528,
22810,
3419,
628,
198,
4871,
17427,
3109,
11755,
7,
15252,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
13610,
290,
39986,
257,
2829,
6631,
13,
198,
220,
220,
220,
37227,
628,
198,
4299,
1479,
8863,
62,
1078,
3808,
7,
1078,
3808,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
4280,
273,
1352,
262,
13627,
12608,
286,
537,
82,
318,
1479,
8863,
13,
198,
220,
220,
220,
49213,
287,
708,
3808,
460,
691,
8686,
1752,
355,
198,
220,
220,
220,
37588,
7,
23073,
318,
287,
11593,
15003,
834,
737,
628,
220,
220,
220,
1058,
17143,
708,
3808,
25,
11688,
1351,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1441,
900,
35226,
62,
25480,
628,
198,
4871,
4757,
1187,
7,
15252,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
383,
2779,
1398,
286,
38491,
198,
220,
220,
220,
37227,
628,
198,
4299,
38491,
7,
1174,
46265,
70,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
16691,
533,
617,
38491,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1441,
4757,
1187,
7,
46265,
70,
11,
19779,
3672,
1298,
366,
3103,
18797,
7248,
20662,
8,
628,
198,
198,
4299,
551,
5700,
46491,
27160,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
16691,
533,
617,
27056,
602,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1441,
4757,
1187,
7,
198,
220,
220,
220,
220,
220,
220,
220,
1391,
74,
25,
1312,
329,
1312,
11,
479,
287,
27056,
378,
7,
27160,
8,
5512,
198,
220,
220,
220,
220,
220,
220,
220,
19779,
3672,
1298,
366,
4834,
6975,
341,
7248,
1600,
366,
1136,
9186,
62,
25480,
1298,
4808,
268,
5700,
62,
1136,
9186,
62,
25480,
92,
198,
220,
220,
220,
1267,
198
] | 2.713105 | 847 |
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 25 21:00:31 2022
@author: LiCheng_Xu
"""
import numpy as np
from .TargetTransformation import ddG2ee
import matplotlib.pyplot as plt
from scipy.interpolate import make_interp_spline
from sklearn.model_selection import KFold
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
37811,
201,
198,
41972,
319,
19480,
1526,
1679,
2310,
25,
405,
25,
3132,
33160,
201,
198,
201,
198,
31,
9800,
25,
7455,
7376,
782,
62,
55,
84,
201,
198,
37811,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
6738,
764,
21745,
8291,
1161,
1330,
49427,
38,
17,
1453,
201,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
201,
198,
6738,
629,
541,
88,
13,
3849,
16104,
378,
1330,
787,
62,
3849,
79,
62,
22018,
500,
201,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
509,
37,
727,
201,
198,
220,
220,
220,
220,
201,
198
] | 2.513043 | 115 |
import pandas as pd
# Accepts input for 'Salary Offer' and 'Tax Rate %' to provide
# Annual, Monthly, and Weekly take home pay after taxes and
# Lambda ISA deductions
if __name__ == '__main__':
salary = int(input("Salary Offer $:"))
taxrate = int(input('Tax Rate as Whole Number ___%:'))
take_home = TakeHomePay(salary, taxrate).postISA(salary, taxrate)
print("After ISA and Taxes, Take Home Pay is:", round(take_home, 2),
"Annually/// ", round(take_home/12, 2), "Monthly///",
round(take_home/52, 2), "Weekly")
| [
11748,
19798,
292,
355,
279,
67,
628,
220,
220,
220,
1303,
21699,
82,
5128,
329,
705,
19221,
560,
33085,
6,
290,
705,
27017,
14806,
4064,
6,
284,
2148,
198,
220,
220,
220,
1303,
16328,
11,
27573,
11,
290,
18168,
1011,
1363,
1414,
706,
5704,
290,
198,
220,
220,
220,
1303,
21114,
6814,
3180,
32,
31086,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
9588,
796,
493,
7,
15414,
7203,
19221,
560,
33085,
720,
11097,
4008,
198,
220,
220,
220,
1687,
4873,
796,
493,
7,
15414,
10786,
27017,
14806,
355,
23431,
7913,
46444,
4,
32105,
4008,
198,
220,
220,
220,
1011,
62,
11195,
796,
7214,
16060,
19197,
7,
21680,
560,
11,
1687,
4873,
737,
7353,
22312,
7,
21680,
560,
11,
1687,
4873,
8,
198,
220,
220,
220,
3601,
7203,
3260,
3180,
32,
290,
42260,
11,
7214,
5995,
7119,
318,
25,
1600,
2835,
7,
20657,
62,
11195,
11,
362,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
18858,
935,
20379,
33172,
2835,
7,
20657,
62,
11195,
14,
1065,
11,
362,
828,
366,
31948,
306,
20379,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2835,
7,
20657,
62,
11195,
14,
4309,
11,
362,
828,
366,
20916,
306,
4943,
198
] | 2.658768 | 211 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
USAGE: %(program)s -train CORPUS -output VECTORS -size SIZE -window WINDOW
-cbow CBOW -sample SAMPLE -hs HS -negative NEGATIVE -threads THREADS -iter ITER
-min_count MIN-COUNT -alpha ALPHA -binary BINARY -accuracy FILE
Trains a neural embedding model on text file CORPUS.
Parameters essentially reproduce those used by the original C tool
(see https://code.google.com/archive/p/word2vec/).
Parameters for training:
-train <file>
Use text data from <file> to train the model
-output <file>
Use <file> to save the resulting word vectors / word clusters
-size <int>
Set size of word vectors; default is 100
-window <int>
Set max skip length between words; default is 5
-sample <float>
Set threshold for occurrence of words. Those that appear with higher frequency in the training data
will be randomly down-sampled; default is 1e-3, useful range is (0, 1e-5)
-hs <int>
Use Hierarchical Softmax; default is 0 (not used)
-negative <int>
Number of negative examples; default is 5, common values are 3 - 10 (0 = not used)
-threads <int>
Use <int> threads (default 3)
-iter <int>
Run more training iterations (default 5)
-min_count <int>
This will discard words that appear less than <int> times; default is 5
-alpha <float>
Set the starting learning rate; default is 0.025 for skip-gram and 0.05 for CBOW
-binary <int>
Save the resulting vectors in binary moded; default is 0 (off)
-cbow <int>
Use the continuous bag of words model; default is 1 (use 0 for skip-gram model)
-accuracy <file>
Compute accuracy of the resulting model analogical inference power on questions file <file>
See an example of questions file
at https://code.google.com/p/word2vec/source/browse/trunk/questions-words.txt
Example: python -m gensim.scripts.word2vec_standalone -train data.txt \
-output vec.txt -size 200 -sample 1e-4 -binary 0 -iter 3
"""
import logging
import os.path
import sys
import argparse
from numpy import seterr
from gensim.models.word2vec import Word2Vec, LineSentence # avoid referencing __main__ in pickle
logger = logging.getLogger(__name__)
if __name__ == "__main__":
logging.basicConfig(format='%(asctime)s : %(threadName)s : %(levelname)s : %(message)s', level=logging.INFO)
logger.info("running %s", " ".join(sys.argv))
seterr(all='raise') # don't ignore numpy errors
parser = argparse.ArgumentParser()
parser.add_argument("-train", help="Use text data from file TRAIN to train the model", required=True)
parser.add_argument("-output", help="Use file OUTPUT to save the resulting word vectors")
parser.add_argument("-window", help="Set max skip length WINDOW between words; default is 5", type=int, default=5)
parser.add_argument("-size", help="Set size of word vectors; default is 100", type=int, default=100)
parser.add_argument(
"-sample",
help="Set threshold for occurrence of words. "
"Those that appear with higher frequency in the training data will be randomly down-sampled; "
"default is 1e-3, useful range is (0, 1e-5)",
type=float, default=1e-3)
parser.add_argument(
"-hs", help="Use Hierarchical Softmax; default is 0 (not used)",
type=int, default=0, choices=[0, 1]
)
parser.add_argument(
"-negative", help="Number of negative examples; default is 5, common values are 3 - 10 (0 = not used)",
type=int, default=5
)
parser.add_argument("-threads", help="Use THREADS threads (default 3)", type=int, default=3)
parser.add_argument("-iter", help="Run more training iterations (default 5)", type=int, default=5)
parser.add_argument(
"-min_count", help="This will discard words that appear less than MIN_COUNT times; default is 5",
type=int, default=5
)
parser.add_argument(
"-alpha", help="Set the starting learning rate; default is 0.025 for skip-gram and 0.05 for CBOW",
type=float
)
parser.add_argument(
"-cbow", help="Use the continuous bag of words model; default is 1 (use 0 for skip-gram model)",
type=int, default=1, choices=[0, 1]
)
parser.add_argument(
"-binary", help="Save the resulting vectors in binary mode; default is 0 (off)",
type=int, default=0, choices=[0, 1]
)
parser.add_argument("-accuracy", help="Use questions from file ACCURACY to evaluate the model")
args = parser.parse_args()
if args.cbow == 0:
skipgram = 1
if not args.alpha:
args.alpha = 0.025
else:
skipgram = 0
if not args.alpha:
args.alpha = 0.05
corpus = LineSentence(args.train)
model = Word2Vec(
corpus, vector_size=args.size, min_count=args.min_count, workers=args.threads,
window=args.window, sample=args.sample, alpha=args.alpha, sg=skipgram,
hs=args.hs, negative=args.negative, cbow_mean=1, epochs=args.iter,
)
if args.output:
outfile = args.output
model.wv.save_word2vec_format(outfile, binary=args.binary)
else:
outfile = args.train.split('.')[0]
model.save(outfile + '.model')
if args.binary == 1:
model.wv.save_word2vec_format(outfile + '.model.bin', binary=True)
else:
model.wv.save_word2vec_format(outfile + '.model.txt', binary=False)
if args.accuracy:
questions_file = args.accuracy
model.accuracy(questions_file)
logger.info("finished running %s", os.path.basename(sys.argv[0]))
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
49962,
739,
262,
22961,
17370,
6489,
410,
17,
13,
16,
532,
2638,
1378,
2503,
13,
41791,
13,
2398,
14,
677,
4541,
14,
75,
70,
489,
13,
6494,
628,
198,
37811,
198,
2937,
11879,
25,
4064,
7,
23065,
8,
82,
532,
27432,
23929,
47,
2937,
532,
22915,
569,
9782,
20673,
532,
7857,
311,
35400,
532,
17497,
370,
12115,
3913,
198,
12,
66,
8176,
10078,
3913,
532,
39873,
28844,
16437,
532,
11994,
18070,
532,
31591,
399,
7156,
37045,
532,
16663,
82,
2320,
15675,
50,
532,
2676,
314,
5781,
198,
12,
1084,
62,
9127,
20625,
12,
34,
28270,
532,
26591,
42674,
7801,
532,
39491,
347,
1268,
13153,
532,
4134,
23843,
45811,
198,
198,
2898,
1299,
257,
17019,
11525,
12083,
2746,
319,
2420,
2393,
23929,
47,
2937,
13,
198,
48944,
6986,
22919,
883,
973,
416,
262,
2656,
327,
2891,
198,
7,
3826,
3740,
1378,
8189,
13,
13297,
13,
785,
14,
17474,
14,
79,
14,
4775,
17,
35138,
14,
737,
198,
198,
48944,
329,
3047,
25,
198,
220,
220,
220,
220,
220,
220,
220,
532,
27432,
1279,
7753,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5765,
2420,
1366,
422,
1279,
7753,
29,
284,
4512,
262,
2746,
198,
220,
220,
220,
220,
220,
220,
220,
532,
22915,
1279,
7753,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5765,
1279,
7753,
29,
284,
3613,
262,
7186,
1573,
30104,
1220,
1573,
23163,
198,
220,
220,
220,
220,
220,
220,
220,
532,
7857,
1279,
600,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5345,
2546,
286,
1573,
30104,
26,
4277,
318,
1802,
198,
220,
220,
220,
220,
220,
220,
220,
532,
17497,
1279,
600,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5345,
3509,
14267,
4129,
1022,
2456,
26,
4277,
318,
642,
198,
220,
220,
220,
220,
220,
220,
220,
532,
39873,
1279,
22468,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5345,
11387,
329,
19810,
286,
2456,
13,
5845,
326,
1656,
351,
2440,
8373,
287,
262,
3047,
1366,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
481,
307,
15456,
866,
12,
37687,
10137,
26,
4277,
318,
352,
68,
12,
18,
11,
4465,
2837,
318,
357,
15,
11,
352,
68,
12,
20,
8,
198,
220,
220,
220,
220,
220,
220,
220,
532,
11994,
1279,
600,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5765,
36496,
998,
605,
8297,
9806,
26,
4277,
318,
657,
357,
1662,
973,
8,
198,
220,
220,
220,
220,
220,
220,
220,
532,
31591,
1279,
600,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7913,
286,
4633,
6096,
26,
4277,
318,
642,
11,
2219,
3815,
389,
513,
532,
838,
357,
15,
796,
407,
973,
8,
198,
220,
220,
220,
220,
220,
220,
220,
532,
16663,
82,
1279,
600,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5765,
1279,
600,
29,
14390,
357,
12286,
513,
8,
198,
220,
220,
220,
220,
220,
220,
220,
532,
2676,
1279,
600,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5660,
517,
3047,
34820,
357,
12286,
642,
8,
198,
220,
220,
220,
220,
220,
220,
220,
532,
1084,
62,
9127,
1279,
600,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
770,
481,
27537,
2456,
326,
1656,
1342,
621,
1279,
600,
29,
1661,
26,
4277,
318,
642,
198,
220,
220,
220,
220,
220,
220,
220,
532,
26591,
1279,
22468,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5345,
262,
3599,
4673,
2494,
26,
4277,
318,
657,
13,
36629,
329,
14267,
12,
4546,
290,
657,
13,
2713,
329,
10078,
3913,
198,
220,
220,
220,
220,
220,
220,
220,
532,
39491,
1279,
600,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12793,
262,
7186,
30104,
287,
13934,
953,
276,
26,
4277,
318,
657,
357,
2364,
8,
198,
220,
220,
220,
220,
220,
220,
220,
532,
66,
8176,
1279,
600,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5765,
262,
12948,
6131,
286,
2456,
2746,
26,
4277,
318,
352,
357,
1904,
657,
329,
14267,
12,
4546,
2746,
8,
198,
220,
220,
220,
220,
220,
220,
220,
532,
4134,
23843,
1279,
7753,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3082,
1133,
9922,
286,
262,
7186,
2746,
15075,
605,
32278,
1176,
319,
2683,
2393,
1279,
7753,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4091,
281,
1672,
286,
2683,
2393,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
379,
3740,
1378,
8189,
13,
13297,
13,
785,
14,
79,
14,
4775,
17,
35138,
14,
10459,
14,
25367,
325,
14,
2213,
2954,
14,
6138,
507,
12,
10879,
13,
14116,
198,
198,
16281,
25,
21015,
532,
76,
308,
641,
320,
13,
46521,
13,
4775,
17,
35138,
62,
1481,
17749,
532,
27432,
1366,
13,
14116,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
220,
532,
22915,
43030,
13,
14116,
532,
7857,
939,
532,
39873,
352,
68,
12,
19,
532,
39491,
657,
532,
2676,
513,
198,
37811,
628,
198,
11748,
18931,
198,
11748,
28686,
13,
6978,
198,
11748,
25064,
198,
11748,
1822,
29572,
198,
6738,
299,
32152,
1330,
900,
8056,
198,
198,
6738,
308,
641,
320,
13,
27530,
13,
4775,
17,
35138,
1330,
9678,
17,
53,
721,
11,
6910,
31837,
594,
220,
1303,
3368,
32578,
11593,
12417,
834,
287,
2298,
293,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
18931,
13,
35487,
16934,
7,
18982,
11639,
4,
7,
292,
310,
524,
8,
82,
1058,
4064,
7,
16663,
5376,
8,
82,
1058,
4064,
7,
5715,
3672,
8,
82,
1058,
4064,
7,
20500,
8,
82,
3256,
1241,
28,
6404,
2667,
13,
10778,
8,
198,
220,
220,
220,
49706,
13,
10951,
7203,
20270,
4064,
82,
1600,
366,
27071,
22179,
7,
17597,
13,
853,
85,
4008,
198,
220,
220,
220,
900,
8056,
7,
439,
11639,
40225,
11537,
220,
1303,
836,
470,
8856,
299,
32152,
8563,
628,
220,
220,
220,
30751,
796,
1822,
29572,
13,
28100,
1713,
46677,
3419,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7203,
12,
27432,
1600,
1037,
2625,
11041,
2420,
1366,
422,
2393,
29125,
1268,
284,
4512,
262,
2746,
1600,
2672,
28,
17821,
8,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7203,
12,
22915,
1600,
1037,
2625,
11041,
2393,
16289,
30076,
284,
3613,
262,
7186,
1573,
30104,
4943,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7203,
12,
17497,
1600,
1037,
2625,
7248,
3509,
14267,
4129,
370,
12115,
3913,
1022,
2456,
26,
4277,
318,
642,
1600,
2099,
28,
600,
11,
4277,
28,
20,
8,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7203,
12,
7857,
1600,
1037,
2625,
7248,
2546,
286,
1573,
30104,
26,
4277,
318,
1802,
1600,
2099,
28,
600,
11,
4277,
28,
3064,
8,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7,
198,
220,
220,
220,
220,
220,
220,
220,
27444,
39873,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
1037,
2625,
7248,
11387,
329,
19810,
286,
2456,
13,
366,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
9627,
326,
1656,
351,
2440,
8373,
287,
262,
3047,
1366,
481,
307,
15456,
866,
12,
37687,
10137,
26,
366,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
12286,
318,
352,
68,
12,
18,
11,
4465,
2837,
318,
357,
15,
11,
352,
68,
12,
20,
42501,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
28,
22468,
11,
4277,
28,
16,
68,
12,
18,
8,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7,
198,
220,
220,
220,
220,
220,
220,
220,
27444,
11994,
1600,
1037,
2625,
11041,
36496,
998,
605,
8297,
9806,
26,
4277,
318,
657,
357,
1662,
973,
42501,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
28,
600,
11,
4277,
28,
15,
11,
7747,
41888,
15,
11,
352,
60,
198,
220,
220,
220,
1267,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7,
198,
220,
220,
220,
220,
220,
220,
220,
27444,
31591,
1600,
1037,
2625,
15057,
286,
4633,
6096,
26,
4277,
318,
642,
11,
2219,
3815,
389,
513,
532,
838,
357,
15,
796,
407,
973,
42501,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
28,
600,
11,
4277,
28,
20,
198,
220,
220,
220,
1267,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7203,
12,
16663,
82,
1600,
1037,
2625,
11041,
2320,
15675,
50,
14390,
357,
12286,
513,
42501,
2099,
28,
600,
11,
4277,
28,
18,
8,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7203,
12,
2676,
1600,
1037,
2625,
10987,
517,
3047,
34820,
357,
12286,
642,
42501,
2099,
28,
600,
11,
4277,
28,
20,
8,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7,
198,
220,
220,
220,
220,
220,
220,
220,
27444,
1084,
62,
9127,
1600,
1037,
2625,
1212,
481,
27537,
2456,
326,
1656,
1342,
621,
20625,
62,
34,
28270,
1661,
26,
4277,
318,
642,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
28,
600,
11,
4277,
28,
20,
198,
220,
220,
220,
1267,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7,
198,
220,
220,
220,
220,
220,
220,
220,
27444,
26591,
1600,
1037,
2625,
7248,
262,
3599,
4673,
2494,
26,
4277,
318,
657,
13,
36629,
329,
14267,
12,
4546,
290,
657,
13,
2713,
329,
10078,
3913,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
28,
22468,
198,
220,
220,
220,
1267,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7,
198,
220,
220,
220,
220,
220,
220,
220,
27444,
66,
8176,
1600,
1037,
2625,
11041,
262,
12948,
6131,
286,
2456,
2746,
26,
4277,
318,
352,
357,
1904,
657,
329,
14267,
12,
4546,
2746,
42501,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
28,
600,
11,
4277,
28,
16,
11,
7747,
41888,
15,
11,
352,
60,
198,
220,
220,
220,
1267,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7,
198,
220,
220,
220,
220,
220,
220,
220,
27444,
39491,
1600,
1037,
2625,
16928,
262,
7186,
30104,
287,
13934,
4235,
26,
4277,
318,
657,
357,
2364,
42501,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
28,
600,
11,
4277,
28,
15,
11,
7747,
41888,
15,
11,
352,
60,
198,
220,
220,
220,
1267,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7203,
12,
4134,
23843,
1600,
1037,
2625,
11041,
2683,
422,
2393,
15859,
4261,
43300,
284,
13446,
262,
2746,
4943,
628,
220,
220,
220,
26498,
796,
30751,
13,
29572,
62,
22046,
3419,
628,
220,
220,
220,
611,
26498,
13,
66,
8176,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
14267,
4546,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
611,
407,
26498,
13,
26591,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26498,
13,
26591,
796,
657,
13,
36629,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
14267,
4546,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
611,
407,
26498,
13,
26591,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26498,
13,
26591,
796,
657,
13,
2713,
628,
220,
220,
220,
35789,
796,
6910,
31837,
594,
7,
22046,
13,
27432,
8,
628,
220,
220,
220,
2746,
796,
9678,
17,
53,
721,
7,
198,
220,
220,
220,
220,
220,
220,
220,
35789,
11,
15879,
62,
7857,
28,
22046,
13,
7857,
11,
949,
62,
9127,
28,
22046,
13,
1084,
62,
9127,
11,
3259,
28,
22046,
13,
16663,
82,
11,
198,
220,
220,
220,
220,
220,
220,
220,
4324,
28,
22046,
13,
17497,
11,
6291,
28,
22046,
13,
39873,
11,
17130,
28,
22046,
13,
26591,
11,
264,
70,
28,
48267,
4546,
11,
198,
220,
220,
220,
220,
220,
220,
220,
289,
82,
28,
22046,
13,
11994,
11,
4633,
28,
22046,
13,
31591,
11,
269,
8176,
62,
32604,
28,
16,
11,
36835,
82,
28,
22046,
13,
2676,
11,
198,
220,
220,
220,
1267,
628,
220,
220,
220,
611,
26498,
13,
22915,
25,
198,
220,
220,
220,
220,
220,
220,
220,
503,
7753,
796,
26498,
13,
22915,
198,
220,
220,
220,
220,
220,
220,
220,
2746,
13,
86,
85,
13,
21928,
62,
4775,
17,
35138,
62,
18982,
7,
448,
7753,
11,
13934,
28,
22046,
13,
39491,
8,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
503,
7753,
796,
26498,
13,
27432,
13,
35312,
10786,
2637,
38381,
15,
60,
198,
220,
220,
220,
220,
220,
220,
220,
2746,
13,
21928,
7,
448,
7753,
1343,
45302,
19849,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
611,
26498,
13,
39491,
6624,
352,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2746,
13,
86,
85,
13,
21928,
62,
4775,
17,
35138,
62,
18982,
7,
448,
7753,
1343,
45302,
19849,
13,
8800,
3256,
13934,
28,
17821,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2746,
13,
86,
85,
13,
21928,
62,
4775,
17,
35138,
62,
18982,
7,
448,
7753,
1343,
45302,
19849,
13,
14116,
3256,
13934,
28,
25101,
8,
628,
220,
220,
220,
611,
26498,
13,
4134,
23843,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2683,
62,
7753,
796,
26498,
13,
4134,
23843,
198,
220,
220,
220,
220,
220,
220,
220,
2746,
13,
4134,
23843,
7,
6138,
507,
62,
7753,
8,
628,
220,
220,
220,
49706,
13,
10951,
7203,
43952,
2491,
4064,
82,
1600,
28686,
13,
6978,
13,
12093,
12453,
7,
17597,
13,
853,
85,
58,
15,
60,
4008,
198
] | 2.493116 | 2,397 |
import messages
"""
This validator is basic validator that returns (True, None)
when a user is authenticated and the number of command tokens is 1.
Returns (False, <message>) otherwise.
"""
| [
11748,
6218,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
37811,
201,
198,
220,
220,
220,
770,
4938,
1352,
318,
4096,
4938,
1352,
326,
5860,
357,
17821,
11,
6045,
8,
220,
201,
198,
220,
220,
220,
618,
257,
2836,
318,
44529,
290,
262,
1271,
286,
3141,
16326,
318,
352,
13,
201,
198,
220,
220,
220,
16409,
357,
25101,
11,
1279,
20500,
43734,
4306,
13,
201,
198,
37811,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198
] | 2.640449 | 89 |
import re
regex_pattern = r'M{0,3}(C[MD]|D?C{0,3})(X[CL]|L?X{0,3})(I[VX]|V?I{0,3})$'
print(str(bool(re.match(regex_pattern, input())))) | [
11748,
302,
198,
198,
260,
25636,
62,
33279,
796,
374,
6,
44,
90,
15,
11,
18,
92,
7,
34,
58,
12740,
60,
91,
35,
30,
34,
90,
15,
11,
18,
92,
5769,
55,
58,
5097,
60,
91,
43,
30,
55,
90,
15,
11,
18,
92,
5769,
40,
58,
53,
55,
60,
91,
53,
30,
40,
90,
15,
11,
18,
30072,
3,
6,
198,
198,
4798,
7,
2536,
7,
30388,
7,
260,
13,
15699,
7,
260,
25636,
62,
33279,
11,
5128,
3419,
35514
] | 1.670732 | 82 |
# --- Day 12: Passage Pathing ---
import copy
print("TEST")
resolve_puzzle("test_data.txt")
print("PUZZLE")
resolve_puzzle("data.txt") ## takes a while (<1min) --> not very efficient | [
2,
11420,
3596,
1105,
25,
46169,
3208,
722,
11420,
198,
11748,
4866,
628,
628,
628,
198,
198,
4798,
7203,
51,
6465,
4943,
198,
411,
6442,
62,
79,
9625,
7203,
9288,
62,
7890,
13,
14116,
4943,
198,
4798,
7203,
5105,
30148,
2538,
4943,
198,
411,
6442,
62,
79,
9625,
7203,
7890,
13,
14116,
4943,
220,
22492,
2753,
257,
981,
38155,
16,
1084,
8,
14610,
407,
845,
6942
] | 2.878788 | 66 |
epsilon_d_ = {
"epsilon": ["float", "0.03", "0.01 ... 0.3"],
}
distribution_d_ = {
"distribution": ["string", "normal", "normal, laplace, logistic, gumbel"],
}
n_neighbours_d_ = {
"n_neighbours": ["int", "3", "1 ... 10"],
}
p_accept_d_ = {
"p_accept": ["float", "0.1", "0.01 ... 0.3"],
}
repulsion_factor_d = {
"repulsion_factor": ["float", "5", "2 ... 10"],
}
annealing_rate_d = {
"annealing_rate": ["float", "0.97", "0.9 ... 0.99"],
}
start_temp_d = {
"start_temp": ["float", "1", "0.5 ... 1.5"],
}
alpha_d = {
"alpha": ["float", "1", "0.5 ... 2"],
}
gamma_d = {
"gamma": ["float", "2", "0.5 ... 5"],
}
beta_d = {
"beta": ["float", "0.5", "0.25 ... 3"],
}
sigma_d = {
"sigma": ["float", "0.5", "0.25 ... 3"],
}
step_size_d = {
"step_size": ["int", "1", "1 ... 1000"],
}
n_iter_restart_d = {
"n_iter_restart": ["int", "10", "5 ... 20"],
}
iters_p_dim_d = {
"iters_p_dim": ["int", "10", "5 ... 15"],
}
n_positions_d = {
"n_positions": ["int", "4", "2 ... 8"],
}
pattern_size_d = {
"pattern_size": ["float", "0.25", "0.1 ... 0.5"],
}
reduction_d = {
"reduction": ["float", "0.9", "0.75 ... 0.99"],
}
population_parallel_temp_d = {
"population": ["int", "5", "3 ... 15"],
}
n_iter_swap_parallel_temp_d = {
"n_iter_swap": ["int", "10", "5 ... 15"],
}
population_pso_d = {
"population": ["int", "10", "4 ... 15"],
}
inertia_d = {
"inertia": ["float", "0.5", "0.25 ... 0.75"],
}
cognitive_weight_d = {
"cognitive_weight": ["float", "0.5", "0.25 ... 0.75"],
}
social_weight_d = {
"social_weight": ["float", "0.5", "0.25 ... 0.75"],
}
temp_weight_d = {
"temp_weight": ["float", "0.2", "0.05 ... 0.3"],
}
population_evo_strat_d = {
"population": ["int", "10", "4 ... 15"],
}
mutation_rate_d = {
"mutation_rate": ["float", "0.7", "0.1 ... 0.9"],
}
crossover_rate_d = {
"crossover_rate": ["float", "0.3", "0.1 ... 0.9"],
}
gpr_bayes_opt_d = {
"gpr": ["class", "0.3", "-"],
}
xi_bayes_opt_d = {
"xi": ["float", "0.3", "0.1 ... 0.9"],
}
warm_start_smbo_d = {
"warm_start_smbo": ["pandas dataframe", "None", "-"],
}
max_sample_size_d = {
"max_sample_size": ["int", "10000000", "-"],
}
sampling_d = {
"sampling": ["dict", "{'random': 1000000}", "-"],
}
gamma_tpe_d = {
"gamma_tpe": ["float", "0.2", "0.05 ... 0.75"],
}
tree_regressor_d = {
"tree_regressor": [
"string",
"extra_tree",
"extra_tree, random_forest, gradient_boost",
],
}
tree_para_d = {
"tree_para": ["dict", "{'n_estimators': 100}", "-"],
}
xi_forest_opt_d = {
"xi": ["float", "0.03", "0.001 ... 0.1"],
}
| [
538,
18217,
261,
62,
67,
62,
796,
1391,
198,
220,
220,
220,
366,
538,
18217,
261,
1298,
14631,
22468,
1600,
366,
15,
13,
3070,
1600,
366,
15,
13,
486,
2644,
657,
13,
18,
33116,
198,
92,
198,
17080,
3890,
62,
67,
62,
796,
1391,
198,
220,
220,
220,
366,
17080,
3890,
1298,
14631,
8841,
1600,
366,
11265,
1600,
366,
11265,
11,
8591,
5372,
11,
2604,
2569,
11,
308,
2178,
417,
33116,
198,
92,
198,
77,
62,
710,
394,
65,
4662,
62,
67,
62,
796,
1391,
198,
220,
220,
220,
366,
77,
62,
710,
394,
65,
4662,
1298,
14631,
600,
1600,
366,
18,
1600,
366,
16,
2644,
838,
33116,
198,
92,
198,
79,
62,
13635,
62,
67,
62,
796,
1391,
198,
220,
220,
220,
366,
79,
62,
13635,
1298,
14631,
22468,
1600,
366,
15,
13,
16,
1600,
366,
15,
13,
486,
2644,
657,
13,
18,
33116,
198,
92,
198,
7856,
15204,
62,
31412,
62,
67,
796,
1391,
198,
220,
220,
220,
366,
7856,
15204,
62,
31412,
1298,
14631,
22468,
1600,
366,
20,
1600,
366,
17,
2644,
838,
33116,
198,
92,
198,
21952,
4272,
62,
4873,
62,
67,
796,
1391,
198,
220,
220,
220,
366,
21952,
4272,
62,
4873,
1298,
14631,
22468,
1600,
366,
15,
13,
5607,
1600,
366,
15,
13,
24,
2644,
657,
13,
2079,
33116,
198,
92,
198,
9688,
62,
29510,
62,
67,
796,
1391,
198,
220,
220,
220,
366,
9688,
62,
29510,
1298,
14631,
22468,
1600,
366,
16,
1600,
366,
15,
13,
20,
2644,
352,
13,
20,
33116,
198,
92,
198,
26591,
62,
67,
796,
1391,
198,
220,
220,
220,
366,
26591,
1298,
14631,
22468,
1600,
366,
16,
1600,
366,
15,
13,
20,
2644,
362,
33116,
198,
92,
198,
28483,
2611,
62,
67,
796,
1391,
198,
220,
220,
220,
366,
28483,
2611,
1298,
14631,
22468,
1600,
366,
17,
1600,
366,
15,
13,
20,
2644,
642,
33116,
198,
92,
198,
31361,
62,
67,
796,
1391,
198,
220,
220,
220,
366,
31361,
1298,
14631,
22468,
1600,
366,
15,
13,
20,
1600,
366,
15,
13,
1495,
2644,
513,
33116,
198,
92,
198,
82,
13495,
62,
67,
796,
1391,
198,
220,
220,
220,
366,
82,
13495,
1298,
14631,
22468,
1600,
366,
15,
13,
20,
1600,
366,
15,
13,
1495,
2644,
513,
33116,
198,
92,
198,
9662,
62,
7857,
62,
67,
796,
1391,
198,
220,
220,
220,
366,
9662,
62,
7857,
1298,
14631,
600,
1600,
366,
16,
1600,
366,
16,
2644,
8576,
33116,
198,
92,
198,
77,
62,
2676,
62,
2118,
433,
62,
67,
796,
1391,
198,
220,
220,
220,
366,
77,
62,
2676,
62,
2118,
433,
1298,
14631,
600,
1600,
366,
940,
1600,
366,
20,
2644,
1160,
33116,
198,
92,
198,
270,
364,
62,
79,
62,
27740,
62,
67,
796,
1391,
198,
220,
220,
220,
366,
270,
364,
62,
79,
62,
27740,
1298,
14631,
600,
1600,
366,
940,
1600,
366,
20,
2644,
1315,
33116,
198,
92,
198,
77,
62,
1930,
1756,
62,
67,
796,
1391,
198,
220,
220,
220,
366,
77,
62,
1930,
1756,
1298,
14631,
600,
1600,
366,
19,
1600,
366,
17,
2644,
807,
33116,
198,
92,
198,
33279,
62,
7857,
62,
67,
796,
1391,
198,
220,
220,
220,
366,
33279,
62,
7857,
1298,
14631,
22468,
1600,
366,
15,
13,
1495,
1600,
366,
15,
13,
16,
2644,
657,
13,
20,
33116,
198,
92,
198,
445,
8110,
62,
67,
796,
1391,
198,
220,
220,
220,
366,
445,
8110,
1298,
14631,
22468,
1600,
366,
15,
13,
24,
1600,
366,
15,
13,
2425,
2644,
657,
13,
2079,
33116,
198,
92,
198,
39748,
62,
1845,
29363,
62,
29510,
62,
67,
796,
1391,
198,
220,
220,
220,
366,
39748,
1298,
14631,
600,
1600,
366,
20,
1600,
366,
18,
2644,
1315,
33116,
198,
92,
198,
77,
62,
2676,
62,
2032,
499,
62,
1845,
29363,
62,
29510,
62,
67,
796,
1391,
198,
220,
220,
220,
366,
77,
62,
2676,
62,
2032,
499,
1298,
14631,
600,
1600,
366,
940,
1600,
366,
20,
2644,
1315,
33116,
198,
92,
198,
39748,
62,
79,
568,
62,
67,
796,
1391,
198,
220,
220,
220,
366,
39748,
1298,
14631,
600,
1600,
366,
940,
1600,
366,
19,
2644,
1315,
33116,
198,
92,
198,
259,
861,
544,
62,
67,
796,
1391,
198,
220,
220,
220,
366,
259,
861,
544,
1298,
14631,
22468,
1600,
366,
15,
13,
20,
1600,
366,
15,
13,
1495,
2644,
657,
13,
2425,
33116,
198,
92,
198,
66,
46610,
62,
6551,
62,
67,
796,
1391,
198,
220,
220,
220,
366,
66,
46610,
62,
6551,
1298,
14631,
22468,
1600,
366,
15,
13,
20,
1600,
366,
15,
13,
1495,
2644,
657,
13,
2425,
33116,
198,
92,
198,
14557,
62,
6551,
62,
67,
796,
1391,
198,
220,
220,
220,
366,
14557,
62,
6551,
1298,
14631,
22468,
1600,
366,
15,
13,
20,
1600,
366,
15,
13,
1495,
2644,
657,
13,
2425,
33116,
198,
92,
198,
29510,
62,
6551,
62,
67,
796,
1391,
198,
220,
220,
220,
366,
29510,
62,
6551,
1298,
14631,
22468,
1600,
366,
15,
13,
17,
1600,
366,
15,
13,
2713,
2644,
657,
13,
18,
33116,
198,
92,
198,
39748,
62,
1990,
78,
62,
2536,
265,
62,
67,
796,
1391,
198,
220,
220,
220,
366,
39748,
1298,
14631,
600,
1600,
366,
940,
1600,
366,
19,
2644,
1315,
33116,
198,
92,
198,
76,
7094,
62,
4873,
62,
67,
796,
1391,
198,
220,
220,
220,
366,
76,
7094,
62,
4873,
1298,
14631,
22468,
1600,
366,
15,
13,
22,
1600,
366,
15,
13,
16,
2644,
657,
13,
24,
33116,
198,
92,
198,
66,
23954,
62,
4873,
62,
67,
796,
1391,
198,
220,
220,
220,
366,
66,
23954,
62,
4873,
1298,
14631,
22468,
1600,
366,
15,
13,
18,
1600,
366,
15,
13,
16,
2644,
657,
13,
24,
33116,
198,
92,
198,
70,
1050,
62,
24406,
274,
62,
8738,
62,
67,
796,
1391,
198,
220,
220,
220,
366,
70,
1050,
1298,
14631,
4871,
1600,
366,
15,
13,
18,
1600,
366,
21215,
4357,
198,
92,
198,
29992,
62,
24406,
274,
62,
8738,
62,
67,
796,
1391,
198,
220,
220,
220,
366,
29992,
1298,
14631,
22468,
1600,
366,
15,
13,
18,
1600,
366,
15,
13,
16,
2644,
657,
13,
24,
33116,
198,
92,
198,
31975,
62,
9688,
62,
82,
2022,
78,
62,
67,
796,
1391,
198,
220,
220,
220,
366,
31975,
62,
9688,
62,
82,
2022,
78,
1298,
14631,
79,
392,
292,
1366,
14535,
1600,
366,
14202,
1600,
366,
21215,
4357,
198,
92,
198,
9806,
62,
39873,
62,
7857,
62,
67,
796,
1391,
198,
220,
220,
220,
366,
9806,
62,
39873,
62,
7857,
1298,
14631,
600,
1600,
366,
16,
24598,
1600,
366,
21215,
4357,
198,
92,
198,
37687,
11347,
62,
67,
796,
1391,
198,
220,
220,
220,
366,
37687,
11347,
1298,
14631,
11600,
1600,
45144,
6,
25120,
10354,
1802,
2388,
92,
1600,
366,
21215,
4357,
198,
92,
198,
28483,
2611,
62,
83,
431,
62,
67,
796,
1391,
198,
220,
220,
220,
366,
28483,
2611,
62,
83,
431,
1298,
14631,
22468,
1600,
366,
15,
13,
17,
1600,
366,
15,
13,
2713,
2644,
657,
13,
2425,
33116,
198,
92,
198,
21048,
62,
2301,
44292,
62,
67,
796,
1391,
198,
220,
220,
220,
366,
21048,
62,
2301,
44292,
1298,
685,
198,
220,
220,
220,
220,
220,
220,
220,
366,
8841,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
366,
26086,
62,
21048,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
366,
26086,
62,
21048,
11,
4738,
62,
29623,
11,
31312,
62,
39521,
1600,
198,
220,
220,
220,
16589,
198,
92,
198,
21048,
62,
1845,
64,
62,
67,
796,
1391,
198,
220,
220,
220,
366,
21048,
62,
1845,
64,
1298,
14631,
11600,
1600,
45144,
6,
77,
62,
395,
320,
2024,
10354,
1802,
92,
1600,
366,
21215,
4357,
198,
92,
198,
29992,
62,
29623,
62,
8738,
62,
67,
796,
1391,
198,
220,
220,
220,
366,
29992,
1298,
14631,
22468,
1600,
366,
15,
13,
3070,
1600,
366,
15,
13,
8298,
2644,
657,
13,
16,
33116,
198,
92,
198
] | 2.034857 | 1,291 |
'''Asynchronous procedure.
An asynchronous procedure, a.k.a. an aproc, is a procedure that is asynchronous and has been
wrapped into an :class:`asyncio.Future`. A procedure is a function that returns None.
'''
import asyncio
__all__ = ['AprocManager']
class AprocManager:
'''Manages the completion of aprocs.
With this manager, the user can just send an aproc to it and forget. To ensure all aprocs
are completed, please invoke the cleanup function. Otherwise, some aprocs may never get
awaited when the manager dies.
Parameters
----------
max_concurrency : int
maximum number of concurrent aprocs that can be held pending
handle_exception : {'raise', 'silent', 'warn'}
policy for handling an exception raised by an aproc. If 'raise', re-raise the caught
exception. If 'silent', ignore the exception. If 'warn', use the provided logger to
warn the user.
logger : logging.Logger or equivalent
logger for warning purposes
'''
async def send(self, aproc: asyncio.Future):
'''Sends an aproc to the manager so the user can forget about it.
The function usually returns immediately. However, if the maximum number of concurrent
aprocs has been exceeded. It will await.
Parameters
----------
aproc : asyncio.Future
a future (returned via :func:`asyncio.create_task` or :func:`asyncio.ensure_future`)
that is a procedure
'''
await self._sleep_well()
self.aproc_set.add(aproc)
async def cleanup(self):
'''Awaits until all aprocs are done.'''
await self._sleep_well(1)
| [
7061,
6,
1722,
31301,
8771,
13,
198,
198,
2025,
39354,
8771,
11,
257,
13,
74,
13,
64,
13,
281,
257,
36942,
11,
318,
257,
8771,
326,
318,
39354,
290,
468,
587,
198,
29988,
1496,
656,
281,
1058,
4871,
25,
63,
292,
13361,
952,
13,
29783,
44646,
317,
8771,
318,
257,
2163,
326,
5860,
6045,
13,
198,
7061,
6,
628,
198,
11748,
30351,
952,
628,
198,
834,
439,
834,
796,
37250,
32,
36942,
13511,
20520,
628,
198,
4871,
317,
36942,
13511,
25,
198,
220,
220,
220,
705,
7061,
5124,
1095,
262,
11939,
286,
257,
1676,
6359,
13,
628,
220,
220,
220,
2080,
428,
4706,
11,
262,
2836,
460,
655,
3758,
281,
257,
36942,
284,
340,
290,
6044,
13,
1675,
4155,
477,
257,
1676,
6359,
198,
220,
220,
220,
389,
5668,
11,
3387,
26342,
262,
27425,
2163,
13,
15323,
11,
617,
257,
1676,
6359,
743,
1239,
651,
198,
220,
220,
220,
39576,
618,
262,
4706,
10564,
13,
628,
220,
220,
220,
40117,
198,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
3509,
62,
1102,
34415,
1058,
493,
198,
220,
220,
220,
220,
220,
220,
220,
5415,
1271,
286,
24580,
257,
1676,
6359,
326,
460,
307,
2714,
13310,
198,
220,
220,
220,
5412,
62,
1069,
4516,
1058,
1391,
6,
40225,
3256,
705,
18217,
298,
3256,
705,
40539,
6,
92,
198,
220,
220,
220,
220,
220,
220,
220,
2450,
329,
9041,
281,
6631,
4376,
416,
281,
257,
36942,
13,
1002,
705,
40225,
3256,
302,
12,
40225,
262,
4978,
198,
220,
220,
220,
220,
220,
220,
220,
6631,
13,
1002,
705,
18217,
298,
3256,
8856,
262,
6631,
13,
1002,
705,
40539,
3256,
779,
262,
2810,
49706,
284,
198,
220,
220,
220,
220,
220,
220,
220,
9828,
262,
2836,
13,
198,
220,
220,
220,
49706,
1058,
18931,
13,
11187,
1362,
393,
7548,
198,
220,
220,
220,
220,
220,
220,
220,
49706,
329,
6509,
4959,
198,
220,
220,
220,
705,
7061,
628,
628,
220,
220,
220,
30351,
825,
3758,
7,
944,
11,
257,
36942,
25,
30351,
952,
13,
29783,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
50,
2412,
281,
257,
36942,
284,
262,
4706,
523,
262,
2836,
460,
6044,
546,
340,
13,
628,
220,
220,
220,
220,
220,
220,
220,
383,
2163,
3221,
5860,
3393,
13,
2102,
11,
611,
262,
5415,
1271,
286,
24580,
198,
220,
220,
220,
220,
220,
220,
220,
257,
1676,
6359,
468,
587,
20672,
13,
632,
481,
25507,
13,
628,
220,
220,
220,
220,
220,
220,
220,
40117,
198,
220,
220,
220,
220,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
220,
220,
220,
220,
257,
36942,
1058,
30351,
952,
13,
29783,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
257,
2003,
357,
7783,
276,
2884,
1058,
20786,
25,
63,
292,
13361,
952,
13,
17953,
62,
35943,
63,
393,
1058,
20786,
25,
63,
292,
13361,
952,
13,
641,
495,
62,
37443,
63,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
326,
318,
257,
8771,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
25507,
2116,
13557,
42832,
62,
4053,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
499,
12204,
62,
2617,
13,
2860,
7,
499,
12204,
8,
628,
198,
220,
220,
220,
30351,
825,
27425,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
32,
10247,
896,
1566,
477,
257,
1676,
6359,
389,
1760,
2637,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
25507,
2116,
13557,
42832,
62,
4053,
7,
16,
8,
198
] | 2.829392 | 592 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import math
import gtk, gobject
import gnomecanvas
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
11748,
10688,
198,
11748,
308,
30488,
11,
48484,
752,
198,
11748,
19967,
462,
5171,
11017,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1388,
3419,
198
] | 2.428571 | 56 |
from api import api_call
from config import SETTINGS
from helpers import create_embed, LetterboxdError
| [
6738,
40391,
1330,
40391,
62,
13345,
198,
6738,
4566,
1330,
25823,
51,
20754,
198,
6738,
49385,
1330,
2251,
62,
20521,
11,
18121,
3524,
67,
12331,
628,
628,
628,
198
] | 3.758621 | 29 |
# Generated by Django 2.0.13 on 2019-07-30 20:10
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
from postgres_schema.operations import RunInPublic
| [
2,
2980,
515,
416,
37770,
362,
13,
15,
13,
1485,
319,
13130,
12,
2998,
12,
1270,
1160,
25,
940,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
198,
6738,
1281,
34239,
62,
15952,
2611,
13,
3575,
602,
1330,
5660,
818,
15202,
628
] | 3.166667 | 66 |
# 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.
#
# See http://www.cellbots.com for more information
__license__ = 'Apache License, Version 2.0'
import ConfigParser
import os
import sys
import time
from threading import Thread
import android
import math
from threadedAndroid import droid
import utils
import xmpp
# Send command out of uplink
# Send command out of the device over BlueTooth or XMPP
class CellbotRemote(Thread):
"""Cellbot remote control"""
# Give the user an option to try other actions while still using the remote as
# an accelerometer
| [
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
407,
198,
2,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
921,
743,
7330,
257,
4866,
286,
198,
2,
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,
42881,
198,
2,
34764,
11015,
6375,
7102,
49828,
11053,
3963,
15529,
509,
12115,
11,
2035,
4911,
393,
17142,
13,
4091,
262,
198,
2,
13789,
329,
262,
2176,
3303,
15030,
21627,
290,
11247,
739,
198,
2,
262,
13789,
13,
198,
2,
198,
2,
4091,
2638,
1378,
2503,
13,
3846,
42478,
13,
785,
329,
517,
1321,
198,
198,
834,
43085,
834,
796,
705,
25189,
4891,
13789,
11,
10628,
362,
13,
15,
6,
198,
198,
11748,
17056,
46677,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
640,
198,
6738,
4704,
278,
1330,
14122,
198,
198,
11748,
19286,
198,
11748,
10688,
198,
6738,
40945,
25934,
1330,
46748,
198,
11748,
3384,
4487,
198,
11748,
2124,
76,
381,
628,
220,
1303,
16290,
3141,
503,
286,
28996,
676,
628,
220,
1303,
16290,
3141,
503,
286,
262,
3335,
625,
4518,
2514,
849,
393,
1395,
7378,
47,
198,
198,
4871,
12440,
13645,
36510,
7,
16818,
2599,
198,
220,
37227,
28780,
13645,
6569,
1630,
37811,
198,
198,
2,
13786,
262,
2836,
281,
3038,
284,
1949,
584,
4028,
981,
991,
1262,
262,
6569,
355,
198,
2,
281,
8320,
15635,
198
] | 3.836957 | 276 |
from fabric.api import *
from fabric.contrib.files import *
from path import path as ppath
app = env.app = {
'live_catalogue-repo': 'https://svn.eionet.europa.eu/repositories/Python/flis.live_catalogue',
'localrepo': ppath(__file__).abspath().parent.parent,
}
try: from localcfg import *
except: pass
app.update({
'instance_var': app['repo']/'instance',
'manage_var': app['repo']/'live_catalogue',
'live_catalogue_var': app['repo']/'live_catalogue'/'live_catalogue',
'sandbox': app['repo']/'sandbox',
'user': 'edw',
})
@task
@task
@task
@task
@task
@task
| [
6738,
9664,
13,
15042,
1330,
1635,
198,
6738,
9664,
13,
3642,
822,
13,
16624,
1330,
1635,
198,
6738,
3108,
1330,
3108,
355,
279,
6978,
198,
198,
1324,
796,
17365,
13,
1324,
796,
1391,
198,
220,
220,
220,
705,
12583,
62,
9246,
30326,
12,
260,
7501,
10354,
705,
5450,
1378,
21370,
77,
13,
68,
295,
316,
13,
44252,
8957,
13,
12496,
14,
260,
1930,
270,
1749,
14,
37906,
14,
2704,
271,
13,
12583,
62,
9246,
30326,
3256,
198,
220,
220,
220,
705,
12001,
260,
7501,
10354,
279,
6978,
7,
834,
7753,
834,
737,
397,
2777,
776,
22446,
8000,
13,
8000,
11,
198,
92,
198,
198,
28311,
25,
422,
1957,
37581,
1330,
1635,
198,
16341,
25,
1208,
198,
198,
1324,
13,
19119,
15090,
198,
220,
220,
220,
705,
39098,
62,
7785,
10354,
598,
17816,
260,
7501,
20520,
14,
6,
39098,
3256,
198,
220,
220,
220,
705,
805,
496,
62,
7785,
10354,
598,
17816,
260,
7501,
20520,
14,
6,
12583,
62,
9246,
30326,
3256,
198,
220,
220,
220,
705,
12583,
62,
9246,
30326,
62,
7785,
10354,
598,
17816,
260,
7501,
20520,
14,
6,
12583,
62,
9246,
30326,
26488,
6,
12583,
62,
9246,
30326,
3256,
198,
220,
220,
220,
705,
38142,
3524,
10354,
598,
17816,
260,
7501,
20520,
14,
6,
38142,
3524,
3256,
198,
220,
220,
220,
705,
7220,
10354,
705,
276,
86,
3256,
198,
30072,
628,
198,
31,
35943,
628,
198,
198,
31,
35943,
198,
198,
31,
35943,
198,
198,
31,
35943,
628,
198,
31,
35943,
198,
198,
31,
35943,
628
] | 2.407258 | 248 |
import pytest
from eppy.doc import EppResponse
from lxml import etree
from registrobrepp.ipnetwork.brtransferipnetworkcommand import BrEppTransferIpNetworkCommand
| [
11748,
12972,
9288,
198,
6738,
304,
14097,
13,
15390,
1330,
412,
381,
31077,
198,
6738,
300,
19875,
1330,
2123,
631,
198,
198,
6738,
4214,
305,
4679,
381,
13,
541,
27349,
13,
1671,
39437,
541,
27349,
21812,
1330,
1709,
36,
381,
43260,
40,
79,
26245,
21575,
628
] | 3.586957 | 46 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Mariusz Sielicki <[email protected]>
import logging
import requests
log = logging.getLogger("nozbe")
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
6434,
25,
1526,
3754,
89,
311,
8207,
624,
72,
1279,
76,
19897,
89,
13,
82,
8207,
624,
72,
31,
14816,
13,
785,
29,
198,
11748,
18931,
198,
11748,
7007,
198,
198,
6404,
796,
18931,
13,
1136,
11187,
1362,
7203,
3919,
89,
1350,
4943,
628
] | 2.470588 | 68 |
"""
Utility to measure performance of obstacle detector.
Parameter Defaults
------------------
Resolution = (1280, 720)
Noise SD = 0
N Objects = 0
Type = circle
Radius = 100
"""
import os, sys
parent_dir = os.path.dirname(os.path.abspath(__file__))
gparent_dir = os.path.dirname(parent_dir)
ggparent_dir = os.path.dirname(gparent_dir)
gggparent_dir = os.path.dirname(ggparent_dir)
sys.path += [parent_dir, gparent_dir, ggparent_dir, gggparent_dir]
import json
import numpy as np
import cv2
import common
from vision.obstacle.obstacle_finder import ObstacleFinder
from vision.common.import_params import import_params
class TimeObstacle:
"""
Timing ObstacleFinder methods.
"""
DEFAULT_DIMS = (1280, 720)
DEFAULT_RADIUS = 100
def setup(self):
"""
Configure blob detector and initialize images.
"""
## Generate images
self.PARAMETERS = {}
self.PARAMETERS.update(common.blank_dimensions())
base_color, base_depth = common.blank_dimensions(self.DEFAULT_DIMS)
#
for radius in [25, 50, 100, 250]:
color_image, depth_image = np.copy(base_color), np.copy(base_depth)
cv2.circle(color_image, (640, 360), radius, (255, 255, 255), thickness=-1)
cv2.circle(depth_image, (640, 360), radius, (255), thickness=-1)
self.PARAMETERS.update({f'radius={radius}': (color_image, depth_image)})
# One to each corner
for n_obj in range(4):
color_image, depth_image = np.copy(base_color), np.copy(base_depth)
for location in [(320, 180), (320, 540), (960, 180), (960, 540)][:n_obj]:
cv2.circle(color_image, location, self.DEFAULT_RADIUS, (255, 255, 255), thickness=-1)
cv2.circle(depth_image, location, self.DEFAULT_RADIUS, (255), thickness=-1)
self.PARAMETERS.update({f'n_obj={n_obj}': (color_image, depth_image)})
# On default noise specturm
for title, (color_image, depth_image) in common.noise().items():
cv2.circle(color_image, (640, 360), self.DEFAULT_RADIUS, (255, 255, 255), thickness=-1)
cv2.circle(depth_image, (640, 360), self.DEFAULT_RADIUS, (255), thickness=-1)
self.PARAMETERS.update({f'{title} single': (color_image, depth_image)})
## Read current params & setup obstacle detector
prefix = '' if os.path.isdir("times") else '..'
config_filename = os.path.join(prefix, '..', 'obstacle', 'config.json')
with open(config_filename, 'r') as config_file:
config = json.load(config_file)
self.blob_finder = ObstacleFinder(params=import_params(config))
def time_find(self, color_image, depth_image):
"""
Time the ObstacleFinder.find function.
"""
self.blob_finder.find(color_image, depth_image)
| [
37811,
198,
18274,
879,
284,
3953,
2854,
286,
22007,
31029,
13,
198,
198,
36301,
2896,
13185,
198,
1783,
438,
198,
4965,
2122,
796,
357,
1065,
1795,
11,
26250,
8,
198,
2949,
786,
9834,
796,
657,
198,
45,
35832,
796,
657,
198,
6030,
796,
9197,
198,
15546,
3754,
796,
1802,
198,
37811,
198,
11748,
28686,
11,
25064,
198,
8000,
62,
15908,
796,
28686,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
397,
2777,
776,
7,
834,
7753,
834,
4008,
198,
70,
8000,
62,
15908,
796,
28686,
13,
6978,
13,
15908,
3672,
7,
8000,
62,
15908,
8,
198,
1130,
8000,
62,
15908,
796,
28686,
13,
6978,
13,
15908,
3672,
7,
70,
8000,
62,
15908,
8,
198,
1130,
70,
8000,
62,
15908,
796,
28686,
13,
6978,
13,
15908,
3672,
7,
1130,
8000,
62,
15908,
8,
198,
17597,
13,
6978,
15853,
685,
8000,
62,
15908,
11,
308,
8000,
62,
15908,
11,
308,
70,
8000,
62,
15908,
11,
308,
1130,
8000,
62,
15908,
60,
198,
198,
11748,
33918,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
17,
198,
198,
11748,
2219,
198,
198,
6738,
5761,
13,
672,
301,
6008,
13,
672,
301,
6008,
62,
22805,
1330,
46378,
6008,
37,
5540,
198,
6738,
5761,
13,
11321,
13,
11748,
62,
37266,
1330,
1330,
62,
37266,
628,
198,
4871,
3862,
5944,
301,
6008,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
5045,
278,
46378,
6008,
37,
5540,
5050,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
5550,
38865,
62,
35,
3955,
50,
796,
357,
1065,
1795,
11,
26250,
8,
198,
220,
220,
220,
5550,
38865,
62,
49,
2885,
40,
2937,
796,
1802,
628,
220,
220,
220,
825,
9058,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
17056,
495,
44812,
31029,
290,
41216,
4263,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
22492,
2980,
378,
4263,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
27082,
2390,
2767,
4877,
796,
23884,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
27082,
2390,
2767,
4877,
13,
19119,
7,
11321,
13,
27190,
62,
27740,
5736,
28955,
628,
220,
220,
220,
220,
220,
220,
220,
2779,
62,
8043,
11,
2779,
62,
18053,
796,
2219,
13,
27190,
62,
27740,
5736,
7,
944,
13,
7206,
38865,
62,
35,
3955,
50,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
198,
220,
220,
220,
220,
220,
220,
220,
329,
16874,
287,
685,
1495,
11,
2026,
11,
1802,
11,
8646,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3124,
62,
9060,
11,
6795,
62,
9060,
796,
45941,
13,
30073,
7,
8692,
62,
8043,
828,
45941,
13,
30073,
7,
8692,
62,
18053,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
85,
17,
13,
45597,
7,
8043,
62,
9060,
11,
357,
31102,
11,
11470,
828,
16874,
11,
357,
13381,
11,
14280,
11,
14280,
828,
20735,
10779,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
85,
17,
13,
45597,
7,
18053,
62,
9060,
11,
357,
31102,
11,
11470,
828,
16874,
11,
357,
13381,
828,
20735,
10779,
16,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
27082,
2390,
2767,
4877,
13,
19119,
15090,
69,
6,
42172,
34758,
42172,
92,
10354,
357,
8043,
62,
9060,
11,
6795,
62,
9060,
8,
30072,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
1881,
284,
1123,
5228,
198,
220,
220,
220,
220,
220,
220,
220,
329,
299,
62,
26801,
287,
2837,
7,
19,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3124,
62,
9060,
11,
6795,
62,
9060,
796,
45941,
13,
30073,
7,
8692,
62,
8043,
828,
45941,
13,
30073,
7,
8692,
62,
18053,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
4067,
287,
47527,
19504,
11,
11546,
828,
357,
19504,
11,
38190,
828,
357,
39277,
11,
11546,
828,
357,
39277,
11,
38190,
8,
7131,
25,
77,
62,
26801,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
85,
17,
13,
45597,
7,
8043,
62,
9060,
11,
4067,
11,
2116,
13,
7206,
38865,
62,
49,
2885,
40,
2937,
11,
357,
13381,
11,
14280,
11,
14280,
828,
20735,
10779,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
85,
17,
13,
45597,
7,
18053,
62,
9060,
11,
4067,
11,
2116,
13,
7206,
38865,
62,
49,
2885,
40,
2937,
11,
357,
13381,
828,
20735,
10779,
16,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
27082,
2390,
2767,
4877,
13,
19119,
15090,
69,
6,
77,
62,
26801,
34758,
77,
62,
26801,
92,
10354,
357,
8043,
62,
9060,
11,
6795,
62,
9060,
8,
30072,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
1550,
4277,
7838,
5444,
333,
76,
198,
220,
220,
220,
220,
220,
220,
220,
329,
3670,
11,
357,
8043,
62,
9060,
11,
6795,
62,
9060,
8,
287,
2219,
13,
3919,
786,
22446,
23814,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
85,
17,
13,
45597,
7,
8043,
62,
9060,
11,
357,
31102,
11,
11470,
828,
2116,
13,
7206,
38865,
62,
49,
2885,
40,
2937,
11,
357,
13381,
11,
14280,
11,
14280,
828,
20735,
10779,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
85,
17,
13,
45597,
7,
18053,
62,
9060,
11,
357,
31102,
11,
11470,
828,
2116,
13,
7206,
38865,
62,
49,
2885,
40,
2937,
11,
357,
13381,
828,
20735,
10779,
16,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
27082,
2390,
2767,
4877,
13,
19119,
15090,
69,
6,
90,
7839,
92,
2060,
10354,
357,
8043,
62,
9060,
11,
6795,
62,
9060,
8,
30072,
628,
220,
220,
220,
220,
220,
220,
220,
22492,
4149,
1459,
42287,
1222,
9058,
22007,
31029,
198,
220,
220,
220,
220,
220,
220,
220,
21231,
796,
10148,
611,
28686,
13,
6978,
13,
9409,
343,
7203,
22355,
4943,
2073,
705,
492,
6,
628,
220,
220,
220,
220,
220,
220,
220,
4566,
62,
34345,
796,
28686,
13,
6978,
13,
22179,
7,
40290,
11,
705,
492,
3256,
705,
672,
301,
6008,
3256,
705,
11250,
13,
17752,
11537,
628,
220,
220,
220,
220,
220,
220,
220,
351,
1280,
7,
11250,
62,
34345,
11,
705,
81,
11537,
355,
4566,
62,
7753,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4566,
796,
33918,
13,
2220,
7,
11250,
62,
7753,
8,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
2436,
672,
62,
22805,
796,
46378,
6008,
37,
5540,
7,
37266,
28,
11748,
62,
37266,
7,
11250,
4008,
628,
220,
220,
220,
825,
640,
62,
19796,
7,
944,
11,
3124,
62,
9060,
11,
6795,
62,
9060,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
3862,
262,
46378,
6008,
37,
5540,
13,
19796,
2163,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
2436,
672,
62,
22805,
13,
19796,
7,
8043,
62,
9060,
11,
6795,
62,
9060,
8,
198
] | 2.345336 | 1,222 |
from datetime import timedelta
from django.core.paginator import Paginator
from django.http import Http404
from django.utils.translation import ugettext as _
from molly.utils import haversine
from molly.utils.views import BaseView, ZoomableView
from molly.utils.breadcrumbs import *
from molly.maps import Map
from molly.apps.library.forms import SearchForm
from molly.apps.library.models import LibrarySearchQuery, LibrarySearchError
class IndexView(BaseView):
"""
Index page of the library app
"""
@BreadcrumbFactory
class SearchDetailView(BaseView):
"""
Search results page
"""
@BreadcrumbFactory
AVAIL_COLORS = ['red', 'amber', 'purple', 'blue', 'green']
class ItemDetailView(ZoomableView):
"""
More detail about the item page
"""
@BreadcrumbFactory
class ItemHoldingsView(ZoomableView):
"""
Specific details of holdings of a particular item
"""
@BreadcrumbFactory
| [
6738,
4818,
8079,
1330,
28805,
12514,
198,
198,
6738,
42625,
14208,
13,
7295,
13,
79,
363,
20900,
1330,
31525,
20900,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
26429,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
334,
1136,
5239,
355,
4808,
198,
198,
6738,
285,
5098,
13,
26791,
1330,
387,
690,
500,
198,
6738,
285,
5098,
13,
26791,
13,
33571,
1330,
7308,
7680,
11,
40305,
540,
7680,
198,
6738,
285,
5098,
13,
26791,
13,
29573,
6098,
18146,
1330,
1635,
198,
6738,
285,
5098,
13,
31803,
1330,
9347,
198,
198,
6738,
285,
5098,
13,
18211,
13,
32016,
13,
23914,
1330,
11140,
8479,
198,
6738,
285,
5098,
13,
18211,
13,
32016,
13,
27530,
1330,
10074,
18243,
20746,
11,
10074,
18243,
12331,
198,
198,
4871,
12901,
7680,
7,
14881,
7680,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
12901,
2443,
286,
262,
5888,
598,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
198,
220,
220,
220,
2488,
33,
961,
6098,
2178,
22810,
198,
198,
4871,
11140,
11242,
603,
7680,
7,
14881,
7680,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
11140,
2482,
2443,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
198,
220,
220,
220,
2488,
33,
961,
6098,
2178,
22810,
198,
198,
10116,
32,
4146,
62,
25154,
20673,
796,
37250,
445,
3256,
705,
7789,
3256,
705,
14225,
1154,
3256,
705,
17585,
3256,
705,
14809,
20520,
198,
198,
4871,
9097,
11242,
603,
7680,
7,
57,
4207,
540,
7680,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
3125,
3703,
546,
262,
2378,
2443,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
2488,
33,
961,
6098,
2178,
22810,
198,
198,
4871,
9097,
26807,
654,
7680,
7,
57,
4207,
540,
7680,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
17377,
3307,
286,
27572,
286,
257,
1948,
2378,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
2488,
33,
961,
6098,
2178,
22810,
198
] | 2.950464 | 323 |
# -*- coding:utf-8 -*-
import os
import sys
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from sqldb import *
from add_customer import *
from customer_order import *
main()
| [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
11748,
28686,
198,
11748,
25064,
198,
6738,
9485,
48,
83,
19,
13,
48,
83,
8205,
72,
1330,
1635,
198,
6738,
9485,
48,
83,
19,
13,
48,
83,
14055,
1330,
1635,
198,
198,
6738,
19862,
335,
65,
1330,
1635,
198,
6738,
751,
62,
23144,
263,
1330,
1635,
198,
6738,
6491,
62,
2875,
1330,
1635,
198,
198,
12417,
3419,
198
] | 2.56338 | 71 |
#
# Copyright (c) 2015-2021 Thierry Florac <tflorac AT ulthar.net>
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
"""PyAMS_portal.portlet module
This module defines all portlet-related components.
"""
__docformat__ = 'restructuredtext'
import logging
import venusian
from persistent import Persistent
from persistent.mapping import PersistentMapping
from pyramid.exceptions import ConfigurationError
from zope.container.contained import Contained
from zope.copy import clone
from zope.interface import alsoProvides, implementer, noLongerProvides
from zope.lifecycleevent import ObjectCreatedEvent
from zope.location import locate
from zope.schema.fieldproperty import FieldProperty
from zope.schema.vocabulary import SimpleTerm, SimpleVocabulary
from zope.traversing.interfaces import ITraversable
from pyams_portal.interfaces import IPortalContext, IPortalPage, IPortalPortletsConfiguration, \
IPortalTemplate, IPortlet, IPortletConfiguration, IPortletRenderer, \
IPortletSettings, MANAGE_TEMPLATE_PERMISSION, PORTLETS_VOCABULARY_NAME
from pyams_security.interfaces import IViewContextPermissionChecker
from pyams_utils.adapter import ContextAdapter, adapter_config
from pyams_utils.factory import factory_config, get_object_factory, is_interface
from pyams_utils.registry import get_pyramid_registry
from pyams_utils.request import check_request
from pyams_utils.vocabulary import vocabulary_config
LOGGER = logging.getLogger('PyAMS (portal)')
@implementer(IPortlet)
class Portlet:
"""Base portlet utility"""
permission = FieldProperty(IPortlet['permission'])
toolbar_image = None
toolbar_css_class = 'fa-edit'
settings_factory = None
class portlet_config: # pylint: disable=invalid-name
"""Class decorator used to declare a portlet"""
venusian = venusian # for testing injection
@vocabulary_config(name=PORTLETS_VOCABULARY_NAME)
class PortletVocabulary(SimpleVocabulary):
"""Portlet vocabulary"""
#
# Portlet configuration
#
@implementer(IPortletSettings)
class PortletSettings(Persistent, Contained):
"""Portlet settings persistent class
This class is supposed to be sub-classed by all custom portlet subclasses to
store their configuration settings.
Each portlet sub-class must define it's settings factory in it's "settings_factory" attribute.
Given factory can be a function, a class or an interface; in this last case, implementation
is looking for default object factory registered for this interface.
"""
_renderer = FieldProperty(IPortletSettings['renderer'])
__name__ = '++settings++'
@property
def visible(self):
"""Visibility getter"""
return self._renderer != 'hidden'
@property
def renderer(self):
"""Renderer name getter"""
return self._renderer
@renderer.setter
def renderer(self, value):
"""Renderer setter"""
value = value or ''
if value == self._renderer:
return
request = check_request()
registry = request.registry
renderer = registry.queryMultiAdapter((request.root, request, request, self),
IPortletRenderer, name=self._renderer)
if (renderer is not None) and (renderer.target_interface is not None):
noLongerProvides(self, renderer.target_interface)
self._renderer = value
renderer = registry.queryMultiAdapter((request.root, request, request, self),
IPortletRenderer, name=self._renderer)
if (renderer is not None) and (renderer.target_interface is not None):
alsoProvides(self, renderer.target_interface)
def get_renderer(self, request=None):
"""Renderer adapter getter"""
if request is None:
request = check_request()
return request.registry.queryMultiAdapter((request.root, request, request, self),
IPortletRenderer, name=self._renderer)
@property
def configuration(self):
"""Configuration getter"""
return self.__parent__
@configuration.setter
def configuration(self, value):
"""Configuration setter"""
if self.__parent__ is None:
self.__parent__ = value
@adapter_config(required=IPortletSettings, provides=IViewContextPermissionChecker)
class PortletSettingsPermissionChecker(ContextAdapter):
"""Portlet settings permission checker"""
edit_permission = MANAGE_TEMPLATE_PERMISSION
@factory_config(IPortletConfiguration)
class PortletConfiguration(Persistent, Contained):
"""Portlet configuration persistent class
This class is a generic persistent class which is used to store all portlet
configuration and is *not* supposed to be sub-classed.
PortletConfiguration.__parent__ points to context where configuration is applied
(each context or local template).
PortletConfiguration.parent points to context from where configuration is inherited.
"""
portlet_id = FieldProperty(IPortletConfiguration['portlet_id'])
portlet_name = None
_inherit_parent = FieldProperty(IPortletConfiguration['inherit_parent'])
_settings = FieldProperty(IPortletConfiguration['settings'])
def get_portlet(self):
"""Portlet utility getter"""
return get_pyramid_registry().queryUtility(IPortlet, name=self.portlet_name)
@property
def can_inherit(self):
"""Check if configuration can be inherited"""
return not IPortalTemplate.providedBy(self.__parent__)
@property
def inherit_parent(self):
"""Check if inheritance is enabled"""
return self._inherit_parent if self.can_inherit else False
@inherit_parent.setter
def inherit_parent(self, value):
"""Inheritance setter"""
if (not value) or self.can_inherit:
self._inherit_parent = value
@property
def override_parent(self):
"""Parent overriding getter"""
return not self.inherit_parent
@override_parent.setter
def override_parent(self, value):
"""Parent overriding setter"""
self.inherit_parent = not value
@property
def parent(self):
"""Parent getter"""
parent = self.__parent__
if IPortalTemplate.providedBy(parent):
return parent
while True:
if IPortalContext.providedBy(parent):
configuration = IPortalPortletsConfiguration(parent).get_portlet_configuration(
self.portlet_id)
if not configuration.inherit_parent:
return parent
page = IPortalPage(parent)
if not page.inherit_parent:
break
parent = parent.__parent__
if parent is None:
break
page = IPortalPage(parent, None)
if page is not None:
return page.template
return None
@property
def settings(self):
"""Current settings getter (using inheritance settings)"""
if self.inherit_parent:
return IPortalPortletsConfiguration(self.parent).get_portlet_configuration(
self.portlet_id).settings
return self._settings
@property
def editor_settings(self):
"""Editor settings getter (always return local settings)"""
return self._settings
def get_settings(self, allow_inherit=True):
"""Settings getter (using inheritance or not according to allow_inherit argument)"""
if allow_inherit:
return self.settings
return self._settings
@adapter_config(required=IPortlet, provides=IPortletConfiguration)
def portlet_configuration_adapter(portlet):
"""Portlet configuration factory"""
return PortletConfiguration(portlet)
@adapter_config(required=IPortletConfiguration, provides=IPortletSettings)
def portlet_configuration_settings_adapter(configuration):
"""Portlet configuration settings adapter"""
return configuration.settings
@adapter_config(required=IPortletSettings, provides=IPortletConfiguration)
def portlet_settings_configuration_adapter(settings):
"""Portlet settings configuration adapter"""
return settings.configuration
@adapter_config(name='settings',
required=IPortletConfiguration, provides=ITraversable)
class PortletConfigurationSettingsTraverser(ContextAdapter):
"""++settings++ portlet configuration traverser"""
def traverse(self, name, furtherpath=None): # pylint: disable=unused-argument
"""Portlet configuration traverser to settings"""
return self.context.settings
@adapter_config(required=IPortletConfiguration, provides=IViewContextPermissionChecker)
class PortletConfigurationPermissionChecker(ContextAdapter):
"""Portlet configuration permission checker"""
edit_permission = MANAGE_TEMPLATE_PERMISSION
#
# Template portlets configuration
#
@factory_config(IPortalPortletsConfiguration)
class PortalPortletsConfiguration(PersistentMapping, Contained):
"""Portal portlets configuration"""
@classmethod
def clone(cls, source_config, new_parent):
"""Clone source configuration"""
configuration = source_config.__class__()
get_pyramid_registry().notify(ObjectCreatedEvent(configuration))
locate(configuration, new_parent)
for config_id, config_portlet in source_config.items():
config = clone(config_portlet)
configuration[config_id] = config
return configuration
def get_portlet_configuration(self, portlet_id):
"""Portlet configuration getter"""
configuration = self.get(portlet_id)
if configuration is None:
if IPortalTemplate.providedBy(self.__parent__):
portlets = IPortalPortletsConfiguration(self.__parent__)
else:
template = IPortalPage(self.__parent__).template
portlets = IPortalPortletsConfiguration(template)
configuration = clone(portlets.get_portlet_configuration(portlet_id))
get_pyramid_registry().notify(ObjectCreatedEvent(configuration))
self.set_portlet_configuration(portlet_id, configuration)
return configuration
def set_portlet_configuration(self, portlet_id, config):
"""Portlet configuration setter"""
config.portlet_id = portlet_id
self[portlet_id] = config
def delete_portlet_configuration(self, portlet_id):
"""Delete portlet configuration"""
if isinstance(portlet_id, int):
portlet_id = (portlet_id,)
for p_id in portlet_id:
del self[p_id]
| [
2,
198,
2,
15069,
357,
66,
8,
1853,
12,
1238,
2481,
536,
959,
563,
4432,
330,
1279,
83,
2704,
273,
330,
5161,
14856,
400,
283,
13,
3262,
29,
198,
2,
1439,
6923,
33876,
13,
198,
2,
198,
2,
770,
3788,
318,
2426,
284,
262,
8617,
286,
262,
1168,
3008,
5094,
13789,
11,
198,
2,
10628,
362,
13,
16,
357,
57,
6489,
737,
220,
317,
4866,
286,
262,
1168,
6489,
815,
13873,
428,
6082,
13,
198,
2,
12680,
47466,
3180,
36592,
2389,
1961,
366,
1921,
3180,
1,
5357,
15529,
5357,
11096,
7788,
32761,
6375,
8959,
49094,
198,
2,
34764,
11015,
15986,
13954,
48778,
1961,
11,
47783,
2751,
11,
21728,
5626,
40880,
5390,
11,
3336,
8959,
49094,
198,
2,
34764,
11015,
3963,
37977,
2538,
11,
34482,
3398,
1565,
5603,
25382,
11,
36218,
38604,
3268,
10913,
2751,
12529,
11,
5357,
376,
46144,
198,
2,
7473,
317,
16652,
2149,
37232,
33079,
48933,
13,
198,
2,
198,
198,
37811,
20519,
40834,
62,
634,
282,
13,
634,
1616,
8265,
198,
198,
1212,
8265,
15738,
477,
2493,
1616,
12,
5363,
6805,
13,
198,
37811,
198,
198,
834,
15390,
18982,
834,
796,
705,
2118,
1356,
1522,
5239,
6,
198,
198,
11748,
18931,
198,
198,
11748,
8710,
385,
666,
198,
6738,
16218,
1330,
9467,
7609,
198,
6738,
16218,
13,
76,
5912,
1330,
9467,
7609,
44,
5912,
198,
6738,
27944,
13,
1069,
11755,
1330,
28373,
12331,
198,
6738,
1976,
3008,
13,
34924,
13,
45964,
1330,
2345,
1328,
198,
6738,
1976,
3008,
13,
30073,
1330,
17271,
198,
6738,
1976,
3008,
13,
39994,
1330,
635,
15946,
1460,
11,
3494,
263,
11,
645,
14617,
263,
15946,
1460,
198,
6738,
1976,
3008,
13,
36195,
47510,
15596,
1330,
9515,
41972,
9237,
198,
6738,
1976,
3008,
13,
24886,
1330,
17276,
198,
6738,
1976,
3008,
13,
15952,
2611,
13,
3245,
26745,
1330,
7663,
21746,
198,
6738,
1976,
3008,
13,
15952,
2611,
13,
18893,
22528,
1330,
17427,
40596,
11,
17427,
53,
420,
22528,
198,
6738,
1976,
3008,
13,
9535,
690,
278,
13,
3849,
32186,
1330,
7283,
430,
690,
540,
198,
198,
6738,
12972,
4105,
62,
634,
282,
13,
3849,
32186,
1330,
6101,
16906,
21947,
11,
6101,
16906,
9876,
11,
6101,
16906,
13924,
5289,
38149,
11,
3467,
198,
220,
220,
220,
6101,
16906,
30800,
11,
6101,
419,
1616,
11,
6101,
419,
1616,
38149,
11,
6101,
419,
1616,
49,
437,
11882,
11,
3467,
198,
220,
220,
220,
6101,
419,
1616,
26232,
11,
17254,
11879,
62,
51,
3620,
6489,
6158,
62,
18973,
44,
40373,
11,
350,
9863,
2538,
4694,
62,
53,
4503,
6242,
6239,
13153,
62,
20608,
198,
6738,
12972,
4105,
62,
12961,
13,
3849,
32186,
1330,
314,
7680,
21947,
5990,
3411,
9787,
263,
198,
6738,
12972,
4105,
62,
26791,
13,
324,
3429,
1330,
30532,
47307,
11,
21302,
62,
11250,
198,
6738,
12972,
4105,
62,
26791,
13,
69,
9548,
1330,
8860,
62,
11250,
11,
651,
62,
15252,
62,
69,
9548,
11,
318,
62,
39994,
198,
6738,
12972,
4105,
62,
26791,
13,
2301,
4592,
1330,
651,
62,
9078,
20255,
62,
2301,
4592,
198,
6738,
12972,
4105,
62,
26791,
13,
25927,
1330,
2198,
62,
25927,
198,
6738,
12972,
4105,
62,
26791,
13,
18893,
22528,
1330,
25818,
62,
11250,
628,
198,
25294,
30373,
796,
18931,
13,
1136,
11187,
1362,
10786,
20519,
40834,
357,
634,
282,
8,
11537,
628,
198,
31,
320,
26908,
263,
7,
4061,
419,
1616,
8,
198,
4871,
4347,
1616,
25,
198,
220,
220,
220,
37227,
14881,
2493,
1616,
10361,
37811,
628,
220,
220,
220,
7170,
796,
7663,
21746,
7,
4061,
419,
1616,
17816,
525,
3411,
6,
12962,
628,
220,
220,
220,
50149,
62,
9060,
796,
6045,
198,
220,
220,
220,
50149,
62,
25471,
62,
4871,
796,
705,
13331,
12,
19312,
6,
628,
220,
220,
220,
6460,
62,
69,
9548,
796,
6045,
628,
198,
4871,
2493,
1616,
62,
11250,
25,
220,
1303,
279,
2645,
600,
25,
15560,
28,
259,
12102,
12,
3672,
198,
220,
220,
220,
37227,
9487,
11705,
1352,
973,
284,
13627,
257,
2493,
1616,
37811,
628,
220,
220,
220,
8710,
385,
666,
796,
8710,
385,
666,
220,
1303,
329,
4856,
16954,
628,
198,
31,
18893,
22528,
62,
11250,
7,
3672,
28,
15490,
2538,
4694,
62,
53,
4503,
6242,
6239,
13153,
62,
20608,
8,
198,
4871,
4347,
1616,
53,
420,
22528,
7,
26437,
53,
420,
22528,
2599,
198,
220,
220,
220,
37227,
13924,
1616,
25818,
37811,
628,
198,
2,
198,
2,
4347,
1616,
8398,
198,
2,
198,
198,
31,
320,
26908,
263,
7,
4061,
419,
1616,
26232,
8,
198,
4871,
4347,
1616,
26232,
7,
30946,
7609,
11,
2345,
1328,
2599,
198,
220,
220,
220,
37227,
13924,
1616,
6460,
16218,
1398,
628,
220,
220,
220,
770,
1398,
318,
4385,
284,
307,
850,
12,
4871,
276,
416,
477,
2183,
2493,
1616,
850,
37724,
284,
198,
220,
220,
220,
3650,
511,
8398,
6460,
13,
628,
220,
220,
220,
5501,
2493,
1616,
850,
12,
4871,
1276,
8160,
340,
338,
6460,
8860,
287,
340,
338,
366,
33692,
62,
69,
9548,
1,
11688,
13,
198,
220,
220,
220,
11259,
8860,
460,
307,
257,
2163,
11,
257,
1398,
393,
281,
7071,
26,
287,
428,
938,
1339,
11,
7822,
198,
220,
220,
220,
318,
2045,
329,
4277,
2134,
8860,
6823,
329,
428,
7071,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
4808,
10920,
11882,
796,
7663,
21746,
7,
4061,
419,
1616,
26232,
17816,
10920,
11882,
6,
12962,
628,
220,
220,
220,
11593,
3672,
834,
796,
705,
4880,
33692,
4880,
6,
628,
220,
220,
220,
2488,
26745,
198,
220,
220,
220,
825,
7424,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
15854,
2247,
651,
353,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13557,
10920,
11882,
14512,
705,
30342,
6,
628,
220,
220,
220,
2488,
26745,
198,
220,
220,
220,
825,
9851,
11882,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
49,
437,
11882,
1438,
651,
353,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13557,
10920,
11882,
628,
220,
220,
220,
2488,
10920,
11882,
13,
2617,
353,
198,
220,
220,
220,
825,
9851,
11882,
7,
944,
11,
1988,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
49,
437,
11882,
900,
353,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
1988,
796,
1988,
393,
10148,
198,
220,
220,
220,
220,
220,
220,
220,
611,
1988,
6624,
2116,
13557,
10920,
11882,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
198,
220,
220,
220,
220,
220,
220,
220,
2581,
796,
2198,
62,
25927,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
20478,
796,
2581,
13,
2301,
4592,
198,
220,
220,
220,
220,
220,
220,
220,
9851,
11882,
796,
20478,
13,
22766,
29800,
47307,
19510,
25927,
13,
15763,
11,
2581,
11,
2581,
11,
2116,
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,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6101,
419,
1616,
49,
437,
11882,
11,
1438,
28,
944,
13557,
10920,
11882,
8,
198,
220,
220,
220,
220,
220,
220,
220,
611,
357,
10920,
11882,
318,
407,
6045,
8,
290,
357,
10920,
11882,
13,
16793,
62,
39994,
318,
407,
6045,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
645,
14617,
263,
15946,
1460,
7,
944,
11,
9851,
11882,
13,
16793,
62,
39994,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
10920,
11882,
796,
1988,
198,
220,
220,
220,
220,
220,
220,
220,
9851,
11882,
796,
20478,
13,
22766,
29800,
47307,
19510,
25927,
13,
15763,
11,
2581,
11,
2581,
11,
2116,
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,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6101,
419,
1616,
49,
437,
11882,
11,
1438,
28,
944,
13557,
10920,
11882,
8,
198,
220,
220,
220,
220,
220,
220,
220,
611,
357,
10920,
11882,
318,
407,
6045,
8,
290,
357,
10920,
11882,
13,
16793,
62,
39994,
318,
407,
6045,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
635,
15946,
1460,
7,
944,
11,
9851,
11882,
13,
16793,
62,
39994,
8,
628,
220,
220,
220,
825,
651,
62,
10920,
11882,
7,
944,
11,
2581,
28,
14202,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
49,
437,
11882,
21302,
651,
353,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2581,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2581,
796,
2198,
62,
25927,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2581,
13,
2301,
4592,
13,
22766,
29800,
47307,
19510,
25927,
13,
15763,
11,
2581,
11,
2581,
11,
2116,
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,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6101,
419,
1616,
49,
437,
11882,
11,
1438,
28,
944,
13557,
10920,
11882,
8,
628,
220,
220,
220,
2488,
26745,
198,
220,
220,
220,
825,
8398,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
38149,
651,
353,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
834,
8000,
834,
628,
220,
220,
220,
2488,
11250,
3924,
13,
2617,
353,
198,
220,
220,
220,
825,
8398,
7,
944,
11,
1988,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
38149,
900,
353,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13,
834,
8000,
834,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
834,
8000,
834,
796,
1988,
628,
198,
31,
324,
3429,
62,
11250,
7,
35827,
28,
4061,
419,
1616,
26232,
11,
3769,
28,
3824,
769,
21947,
5990,
3411,
9787,
263,
8,
198,
4871,
4347,
1616,
26232,
5990,
3411,
9787,
263,
7,
21947,
47307,
2599,
198,
220,
220,
220,
37227,
13924,
1616,
6460,
7170,
2198,
263,
37811,
628,
220,
220,
220,
4370,
62,
525,
3411,
796,
17254,
11879,
62,
51,
3620,
6489,
6158,
62,
18973,
44,
40373,
628,
198,
31,
69,
9548,
62,
11250,
7,
4061,
419,
1616,
38149,
8,
198,
4871,
4347,
1616,
38149,
7,
30946,
7609,
11,
2345,
1328,
2599,
198,
220,
220,
220,
37227,
13924,
1616,
8398,
16218,
1398,
628,
220,
220,
220,
770,
1398,
318,
257,
14276,
16218,
1398,
543,
318,
973,
284,
3650,
477,
2493,
1616,
198,
220,
220,
220,
8398,
290,
318,
1635,
1662,
9,
4385,
284,
307,
850,
12,
4871,
276,
13,
628,
220,
220,
220,
4347,
1616,
38149,
13,
834,
8000,
834,
2173,
284,
4732,
810,
8398,
318,
5625,
198,
220,
220,
220,
357,
27379,
4732,
393,
1957,
11055,
737,
198,
220,
220,
220,
4347,
1616,
38149,
13,
8000,
2173,
284,
4732,
422,
810,
8398,
318,
19552,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
2493,
1616,
62,
312,
796,
7663,
21746,
7,
4061,
419,
1616,
38149,
17816,
634,
1616,
62,
312,
6,
12962,
198,
220,
220,
220,
2493,
1616,
62,
3672,
796,
6045,
198,
220,
220,
220,
4808,
259,
372,
270,
62,
8000,
796,
7663,
21746,
7,
4061,
419,
1616,
38149,
17816,
259,
372,
270,
62,
8000,
6,
12962,
198,
220,
220,
220,
4808,
33692,
796,
7663,
21746,
7,
4061,
419,
1616,
38149,
17816,
33692,
6,
12962,
628,
220,
220,
220,
825,
651,
62,
634,
1616,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
13924,
1616,
10361,
651,
353,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
651,
62,
9078,
20255,
62,
2301,
4592,
22446,
22766,
18274,
879,
7,
4061,
419,
1616,
11,
1438,
28,
944,
13,
634,
1616,
62,
3672,
8,
628,
220,
220,
220,
2488,
26745,
198,
220,
220,
220,
825,
460,
62,
259,
372,
270,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
9787,
611,
8398,
460,
307,
19552,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
407,
6101,
16906,
30800,
13,
41279,
3886,
7,
944,
13,
834,
8000,
834,
8,
628,
220,
220,
220,
2488,
26745,
198,
220,
220,
220,
825,
16955,
62,
8000,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
9787,
611,
24155,
318,
9343,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13557,
259,
372,
270,
62,
8000,
611,
2116,
13,
5171,
62,
259,
372,
270,
2073,
10352,
628,
220,
220,
220,
2488,
259,
372,
270,
62,
8000,
13,
2617,
353,
198,
220,
220,
220,
825,
16955,
62,
8000,
7,
944,
11,
1988,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
818,
372,
42942,
900,
353,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
611,
357,
1662,
1988,
8,
393,
2116,
13,
5171,
62,
259,
372,
270,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
259,
372,
270,
62,
8000,
796,
1988,
628,
220,
220,
220,
2488,
26745,
198,
220,
220,
220,
825,
20957,
62,
8000,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
24546,
44987,
651,
353,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
407,
2116,
13,
259,
372,
270,
62,
8000,
628,
220,
220,
220,
2488,
2502,
13154,
62,
8000,
13,
2617,
353,
198,
220,
220,
220,
825,
20957,
62,
8000,
7,
944,
11,
1988,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
24546,
44987,
900,
353,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
259,
372,
270,
62,
8000,
796,
407,
1988,
628,
220,
220,
220,
2488,
26745,
198,
220,
220,
220,
825,
2560,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
24546,
651,
353,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
2560,
796,
2116,
13,
834,
8000,
834,
198,
220,
220,
220,
220,
220,
220,
220,
611,
6101,
16906,
30800,
13,
41279,
3886,
7,
8000,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
2560,
198,
220,
220,
220,
220,
220,
220,
220,
981,
6407,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
6101,
16906,
21947,
13,
41279,
3886,
7,
8000,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8398,
796,
6101,
16906,
13924,
5289,
38149,
7,
8000,
737,
1136,
62,
634,
1616,
62,
11250,
3924,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
634,
1616,
62,
312,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
407,
8398,
13,
259,
372,
270,
62,
8000,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
2560,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2443,
796,
6101,
16906,
9876,
7,
8000,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
407,
2443,
13,
259,
372,
270,
62,
8000,
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,
2560,
796,
2560,
13,
834,
8000,
834,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2560,
318,
6045,
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,
2443,
796,
6101,
16906,
9876,
7,
8000,
11,
6045,
8,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2443,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
2443,
13,
28243,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
6045,
628,
220,
220,
220,
2488,
26745,
198,
220,
220,
220,
825,
6460,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
11297,
6460,
651,
353,
357,
3500,
24155,
6460,
8,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13,
259,
372,
270,
62,
8000,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
6101,
16906,
13924,
5289,
38149,
7,
944,
13,
8000,
737,
1136,
62,
634,
1616,
62,
11250,
3924,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
634,
1616,
62,
312,
737,
33692,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13557,
33692,
628,
220,
220,
220,
2488,
26745,
198,
220,
220,
220,
825,
5464,
62,
33692,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
17171,
6460,
651,
353,
357,
33770,
1441,
1957,
6460,
8,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13557,
33692,
628,
220,
220,
220,
825,
651,
62,
33692,
7,
944,
11,
1249,
62,
259,
372,
270,
28,
17821,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
26232,
651,
353,
357,
3500,
24155,
393,
407,
1864,
284,
1249,
62,
259,
372,
270,
4578,
8,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
611,
1249,
62,
259,
372,
270,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
33692,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13557,
33692,
628,
198,
31,
324,
3429,
62,
11250,
7,
35827,
28,
4061,
419,
1616,
11,
3769,
28,
4061,
419,
1616,
38149,
8,
198,
4299,
2493,
1616,
62,
11250,
3924,
62,
324,
3429,
7,
634,
1616,
2599,
198,
220,
220,
220,
37227,
13924,
1616,
8398,
8860,
37811,
198,
220,
220,
220,
1441,
4347,
1616,
38149,
7,
634,
1616,
8,
628,
198,
31,
324,
3429,
62,
11250,
7,
35827,
28,
4061,
419,
1616,
38149,
11,
3769,
28,
4061,
419,
1616,
26232,
8,
198,
4299,
2493,
1616,
62,
11250,
3924,
62,
33692,
62,
324,
3429,
7,
11250,
3924,
2599,
198,
220,
220,
220,
37227,
13924,
1616,
8398,
6460,
21302,
37811,
198,
220,
220,
220,
1441,
8398,
13,
33692,
628,
198,
31,
324,
3429,
62,
11250,
7,
35827,
28,
4061,
419,
1616,
26232,
11,
3769,
28,
4061,
419,
1616,
38149,
8,
198,
4299,
2493,
1616,
62,
33692,
62,
11250,
3924,
62,
324,
3429,
7,
33692,
2599,
198,
220,
220,
220,
37227,
13924,
1616,
6460,
8398,
21302,
37811,
198,
220,
220,
220,
1441,
6460,
13,
11250,
3924,
628,
198,
31,
324,
3429,
62,
11250,
7,
3672,
11639,
33692,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2672,
28,
4061,
419,
1616,
38149,
11,
3769,
28,
2043,
430,
690,
540,
8,
198,
4871,
4347,
1616,
38149,
26232,
15721,
690,
263,
7,
21947,
47307,
2599,
198,
220,
220,
220,
37227,
4880,
33692,
4880,
2493,
1616,
8398,
33038,
263,
37811,
628,
220,
220,
220,
825,
38138,
7,
944,
11,
1438,
11,
2252,
6978,
28,
14202,
2599,
220,
1303,
279,
2645,
600,
25,
15560,
28,
403,
1484,
12,
49140,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
13924,
1616,
8398,
33038,
263,
284,
6460,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
22866,
13,
33692,
628,
198,
31,
324,
3429,
62,
11250,
7,
35827,
28,
4061,
419,
1616,
38149,
11,
3769,
28,
3824,
769,
21947,
5990,
3411,
9787,
263,
8,
198,
4871,
4347,
1616,
38149,
5990,
3411,
9787,
263,
7,
21947,
47307,
2599,
198,
220,
220,
220,
37227,
13924,
1616,
8398,
7170,
2198,
263,
37811,
628,
220,
220,
220,
4370,
62,
525,
3411,
796,
17254,
11879,
62,
51,
3620,
6489,
6158,
62,
18973,
44,
40373,
628,
198,
2,
198,
2,
37350,
2493,
5289,
8398,
198,
2,
198,
198,
31,
69,
9548,
62,
11250,
7,
4061,
16906,
13924,
5289,
38149,
8,
198,
4871,
25663,
13924,
5289,
38149,
7,
30946,
7609,
44,
5912,
11,
2345,
1328,
2599,
198,
220,
220,
220,
37227,
13924,
282,
2493,
5289,
8398,
37811,
628,
220,
220,
220,
2488,
4871,
24396,
198,
220,
220,
220,
825,
17271,
7,
565,
82,
11,
2723,
62,
11250,
11,
649,
62,
8000,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
2601,
505,
2723,
8398,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
8398,
796,
2723,
62,
11250,
13,
834,
4871,
834,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
651,
62,
9078,
20255,
62,
2301,
4592,
22446,
1662,
1958,
7,
10267,
41972,
9237,
7,
11250,
3924,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
17276,
7,
11250,
3924,
11,
649,
62,
8000,
8,
198,
220,
220,
220,
220,
220,
220,
220,
329,
4566,
62,
312,
11,
4566,
62,
634,
1616,
287,
2723,
62,
11250,
13,
23814,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4566,
796,
17271,
7,
11250,
62,
634,
1616,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8398,
58,
11250,
62,
312,
60,
796,
4566,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
8398,
628,
220,
220,
220,
825,
651,
62,
634,
1616,
62,
11250,
3924,
7,
944,
11,
2493,
1616,
62,
312,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
13924,
1616,
8398,
651,
353,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
8398,
796,
2116,
13,
1136,
7,
634,
1616,
62,
312,
8,
198,
220,
220,
220,
220,
220,
220,
220,
611,
8398,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
6101,
16906,
30800,
13,
41279,
3886,
7,
944,
13,
834,
8000,
834,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2493,
5289,
796,
6101,
16906,
13924,
5289,
38149,
7,
944,
13,
834,
8000,
834,
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,
11055,
796,
6101,
16906,
9876,
7,
944,
13,
834,
8000,
834,
737,
28243,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2493,
5289,
796,
6101,
16906,
13924,
5289,
38149,
7,
28243,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8398,
796,
17271,
7,
634,
5289,
13,
1136,
62,
634,
1616,
62,
11250,
3924,
7,
634,
1616,
62,
312,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
651,
62,
9078,
20255,
62,
2301,
4592,
22446,
1662,
1958,
7,
10267,
41972,
9237,
7,
11250,
3924,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
2617,
62,
634,
1616,
62,
11250,
3924,
7,
634,
1616,
62,
312,
11,
8398,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
8398,
628,
220,
220,
220,
825,
900,
62,
634,
1616,
62,
11250,
3924,
7,
944,
11,
2493,
1616,
62,
312,
11,
4566,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
13924,
1616,
8398,
900,
353,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
4566,
13,
634,
1616,
62,
312,
796,
2493,
1616,
62,
312,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
58,
634,
1616,
62,
312,
60,
796,
4566,
628,
220,
220,
220,
825,
12233,
62,
634,
1616,
62,
11250,
3924,
7,
944,
11,
2493,
1616,
62,
312,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
38727,
2493,
1616,
8398,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
611,
318,
39098,
7,
634,
1616,
62,
312,
11,
493,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2493,
1616,
62,
312,
796,
357,
634,
1616,
62,
312,
35751,
198,
220,
220,
220,
220,
220,
220,
220,
329,
279,
62,
312,
287,
2493,
1616,
62,
312,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1619,
2116,
58,
79,
62,
312,
60,
198
] | 2.764266 | 4,013 |
#!/usr/bin/env python
import random
import time
tests = 1000000
boxes = [[ 'G', 'G' ],
[ 'G', 'S' ],
[ 'S', 'S' ]]
draws = [[[ 0, 0 ], [ 0, 0 ], [ 0, 0 ]],
[[ 0, 0 ], [ 0, 0 ], [ 0, 0 ]]]
total_gold_1 = 0
total_gold_2 = 0
print('Running %d tests.'%(tests))
random.seed(int(time.time()))
for i in range(tests):
box = random.randint(0,2)
ball = random.randint(0,1)
draws[0][box][ball] = draws[0][box][ball] + 1
if boxes[box][ball] is 'G':
total_gold_1 = total_gold_1 + 1
ball = (ball + 1) % 2
draws[1][box][ball] = draws[1][box][ball] + 1
if boxes[box][ball] is 'G':
total_gold_2 = total_gold_2 + 1
print('Draws:')
print('- Box 1 [G, G]:')
print(' Gold1 -> Gold2: %d'%(draws[0][0][0]))
print(' Gold2 -> Gold1: %d'%(draws[0][0][1]))
print('- Box 2 [G, S]:')
print(' Gold -> Silver: %d'%(draws[0][1][0]))
print(' Silver: %d'%(draws[0][1][1]))
print('- Box 3 [S, S]:')
print(' Silver1: %d'%(draws[0][2][0]))
print(' Silver2: %d'%(draws[0][2][1]))
print('')
print('Gold on 1st draw: %d'%(total_gold_1))
print('Gold on 2nd draw: %d'%(total_gold_2))
print('Percent two golds: %.2f%%'%(float(total_gold_2) / float(total_gold_1)))
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
4738,
198,
11748,
640,
198,
198,
41989,
796,
1802,
2388,
198,
29305,
796,
16410,
705,
38,
3256,
705,
38,
6,
16589,
198,
220,
220,
220,
220,
220,
220,
220,
220,
685,
705,
38,
3256,
705,
50,
6,
16589,
198,
220,
220,
220,
220,
220,
220,
220,
220,
685,
705,
50,
3256,
705,
50,
6,
2361,
60,
198,
19334,
82,
796,
16410,
58,
657,
11,
657,
16589,
685,
657,
11,
657,
16589,
685,
657,
11,
657,
2361,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
16410,
657,
11,
657,
16589,
685,
657,
11,
657,
16589,
685,
657,
11,
657,
2361,
11907,
198,
23350,
62,
24267,
62,
16,
796,
657,
198,
23350,
62,
24267,
62,
17,
796,
657,
198,
198,
4798,
10786,
28768,
4064,
67,
5254,
2637,
4,
7,
41989,
4008,
198,
25120,
13,
28826,
7,
600,
7,
2435,
13,
2435,
3419,
4008,
198,
1640,
1312,
287,
2837,
7,
41989,
2599,
198,
220,
220,
220,
3091,
796,
4738,
13,
25192,
600,
7,
15,
11,
17,
8,
198,
220,
220,
220,
2613,
796,
4738,
13,
25192,
600,
7,
15,
11,
16,
8,
198,
220,
220,
220,
14293,
58,
15,
7131,
3524,
7131,
1894,
60,
796,
14293,
58,
15,
7131,
3524,
7131,
1894,
60,
1343,
352,
198,
220,
220,
220,
611,
10559,
58,
3524,
7131,
1894,
60,
318,
705,
38,
10354,
198,
220,
220,
220,
220,
220,
220,
220,
2472,
62,
24267,
62,
16,
796,
2472,
62,
24267,
62,
16,
1343,
352,
198,
220,
220,
220,
220,
220,
220,
220,
2613,
796,
357,
1894,
1343,
352,
8,
4064,
362,
198,
220,
220,
220,
220,
220,
220,
220,
14293,
58,
16,
7131,
3524,
7131,
1894,
60,
796,
14293,
58,
16,
7131,
3524,
7131,
1894,
60,
1343,
352,
198,
220,
220,
220,
220,
220,
220,
220,
611,
10559,
58,
3524,
7131,
1894,
60,
318,
705,
38,
10354,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2472,
62,
24267,
62,
17,
796,
2472,
62,
24267,
62,
17,
1343,
352,
198,
198,
4798,
10786,
25302,
82,
25,
11537,
198,
4798,
10786,
12,
8315,
352,
685,
38,
11,
402,
5974,
11537,
198,
4798,
10786,
220,
220,
220,
3561,
16,
4613,
3561,
17,
25,
4064,
67,
6,
4,
7,
19334,
82,
58,
15,
7131,
15,
7131,
15,
60,
4008,
198,
4798,
10786,
220,
220,
220,
3561,
17,
4613,
3561,
16,
25,
4064,
67,
6,
4,
7,
19334,
82,
58,
15,
7131,
15,
7131,
16,
60,
4008,
198,
4798,
10786,
12,
8315,
362,
685,
38,
11,
311,
5974,
11537,
198,
4798,
10786,
220,
220,
220,
3561,
4613,
7698,
25,
4064,
67,
6,
4,
7,
19334,
82,
58,
15,
7131,
16,
7131,
15,
60,
4008,
198,
4798,
10786,
220,
220,
220,
7698,
25,
220,
220,
220,
220,
220,
220,
220,
220,
4064,
67,
6,
4,
7,
19334,
82,
58,
15,
7131,
16,
7131,
16,
60,
4008,
198,
4798,
10786,
12,
8315,
513,
685,
50,
11,
311,
5974,
11537,
198,
4798,
10786,
220,
220,
220,
7698,
16,
25,
220,
220,
220,
220,
220,
220,
220,
4064,
67,
6,
4,
7,
19334,
82,
58,
15,
7131,
17,
7131,
15,
60,
4008,
198,
4798,
10786,
220,
220,
220,
7698,
17,
25,
220,
220,
220,
220,
220,
220,
220,
4064,
67,
6,
4,
7,
19334,
82,
58,
15,
7131,
17,
7131,
16,
60,
4008,
198,
4798,
7,
7061,
8,
198,
4798,
10786,
13306,
319,
352,
301,
3197,
25,
220,
4064,
67,
6,
4,
7,
23350,
62,
24267,
62,
16,
4008,
198,
4798,
10786,
13306,
319,
362,
358,
3197,
25,
220,
4064,
67,
6,
4,
7,
23350,
62,
24267,
62,
17,
4008,
198,
4798,
10786,
31905,
734,
3869,
82,
25,
4064,
13,
17,
69,
16626,
6,
4,
7,
22468,
7,
23350,
62,
24267,
62,
17,
8,
1220,
12178,
7,
23350,
62,
24267,
62,
16,
22305,
198
] | 1.974763 | 634 |
#!/usr/bin/env python3
"""
A script to get the intersections of Differential expression results, Fst, and differential SNPs analysis.
Draws Venn diagrams and adds columns to RNA-seq-diff.xlsx, whether the gene has high Fst/PBS/diffsnps.
"""
import sys
sys.stderr = open(snakemake.log[0], "w")
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
from matplotlib_venn import *
import pandas as pd
import numpy as np
from pathlib import Path
#### Main ####
# Read contrasts in and other snakemake params
comparisons = pd.DataFrame(snakemake.params['DEcontrasts'], columns=['contrast'])
comparisons = comparisons.contrast.str.split("_", expand=True)
comparisons = [list(row) for i,row in comparisons.iterrows()]
percentile = snakemake.params['percentile']
diffsnps = snakemake.params['diffsnps']
# Create a Pandas Excel writer using XlsxWriter as the engine.
writer = pd.ExcelWriter('results/RNA-Seq-full.xlsx', engine='xlsxwriter')
#### Differential expression v Fst venn diagram
for comp1,comp2 in comparisons:
name = comp1 + "_" + comp2
print(f"\n-------------- Venn Diagram for {name} --------------")
de = pd.read_csv(f"results/genediff/{name}.csv")
fst = pd.read_csv("results/variantAnalysis/selection/FstPerGene.tsv", sep="\t")
#compare sig DE genes and top 5% fst genes?
#get sig up and down diffexp genes
sigde = de[de['padj'] < pval_threshold]
sigde_up = sigde[sigde['FC'] > upper_fc]
sigde_down = sigde[sigde['FC'] < lower_fc]
#take top percentile of fst genes
highfst = fst.nlargest(int(fst.shape[0]*percentile),f"{name}_zFst")
#how many fst? how many sig de up and down?
nfst = highfst.shape[0]
nde_up = sigde_up.shape[0]
nde_down = sigde_down.shape[0]
print(f"There are {nde_up} significantly upregulated genes in {name}")
print(f"There are {nde_down} significantly downregulated genes in {name}")
nboth, _ = intersect2(sigde_up,
highfst,
de,
write=True,
path=f"results/venn/{name}.DE.Fst.intersection.tsv")
###### XLSX file ######
if diffsnps:
diffsnpsDE = pd.read_csv("results/diffsnps/{name}.sig.kissDE.tsv", sep="\t")
sheet = add_columns_xlsx(name, de, fst, highfst, diffsnps, diffsnpsDE)
else:
sheet = add_columns_xlsx(name, de, fst, highfst, diffsnps, diffsnpsDE=None)
# Write each dataframe to a different worksheet.
sheet.to_excel(writer, sheet_name=name)
# Close the Pandas Excel writer and output the Excel file.
writer.save() | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
37811,
198,
32,
4226,
284,
651,
262,
42085,
286,
20615,
498,
5408,
2482,
11,
376,
301,
11,
290,
22577,
11346,
12016,
3781,
13,
198,
25302,
82,
569,
1697,
37067,
290,
6673,
15180,
284,
25897,
12,
41068,
12,
26069,
13,
87,
7278,
87,
11,
1771,
262,
9779,
468,
1029,
376,
301,
14,
47,
4462,
14,
67,
10203,
77,
862,
13,
220,
198,
37811,
198,
11748,
25064,
198,
17597,
13,
301,
1082,
81,
796,
1280,
7,
16184,
539,
15883,
13,
6404,
58,
15,
4357,
366,
86,
4943,
198,
198,
11748,
2603,
29487,
8019,
198,
6759,
29487,
8019,
13,
1904,
10786,
9460,
11537,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
2603,
29487,
8019,
62,
574,
77,
1330,
1635,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
3108,
8019,
1330,
10644,
628,
198,
198,
4242,
8774,
1303,
21017,
198,
2,
4149,
39469,
287,
290,
584,
17522,
15883,
42287,
198,
785,
1845,
9886,
796,
279,
67,
13,
6601,
19778,
7,
16184,
539,
15883,
13,
37266,
17816,
7206,
3642,
5685,
82,
6,
4357,
15180,
28,
17816,
3642,
5685,
6,
12962,
198,
785,
1845,
9886,
796,
17909,
13,
3642,
5685,
13,
2536,
13,
35312,
7203,
62,
1600,
4292,
28,
17821,
8,
198,
785,
1845,
9886,
796,
685,
4868,
7,
808,
8,
329,
1312,
11,
808,
287,
17909,
13,
2676,
8516,
3419,
60,
198,
198,
25067,
576,
796,
17522,
15883,
13,
37266,
17816,
25067,
576,
20520,
198,
67,
10203,
77,
862,
796,
17522,
15883,
13,
37266,
17816,
67,
10203,
77,
862,
20520,
198,
198,
2,
13610,
257,
16492,
292,
24134,
6260,
1262,
1395,
7278,
87,
34379,
355,
262,
3113,
13,
198,
16002,
796,
279,
67,
13,
3109,
5276,
34379,
10786,
43420,
14,
27204,
12,
4653,
80,
12,
12853,
13,
87,
7278,
87,
3256,
3113,
11639,
87,
7278,
87,
16002,
11537,
198,
198,
4242,
20615,
498,
5408,
410,
376,
301,
410,
1697,
16362,
198,
1640,
552,
16,
11,
5589,
17,
287,
17909,
25,
198,
220,
220,
220,
1438,
796,
552,
16,
1343,
45434,
1,
1343,
552,
17,
198,
220,
220,
220,
3601,
7,
69,
1,
59,
77,
26171,
569,
1697,
6031,
6713,
329,
1391,
3672,
92,
220,
26171,
4943,
198,
220,
220,
220,
390,
796,
279,
67,
13,
961,
62,
40664,
7,
69,
1,
43420,
14,
70,
2945,
733,
14,
90,
3672,
27422,
40664,
4943,
198,
220,
220,
220,
277,
301,
796,
279,
67,
13,
961,
62,
40664,
7203,
43420,
14,
25641,
415,
32750,
14,
49283,
14,
37,
301,
5990,
39358,
13,
912,
85,
1600,
41767,
2625,
59,
83,
4943,
198,
220,
220,
220,
1303,
5589,
533,
43237,
5550,
10812,
290,
1353,
642,
4,
277,
301,
10812,
30,
198,
220,
220,
220,
1303,
1136,
43237,
510,
290,
866,
814,
11201,
10812,
198,
220,
220,
220,
43237,
2934,
796,
390,
58,
2934,
17816,
15636,
73,
20520,
1279,
279,
2100,
62,
400,
10126,
60,
198,
220,
220,
220,
43237,
2934,
62,
929,
796,
43237,
2934,
58,
82,
328,
2934,
17816,
4851,
20520,
1875,
6727,
62,
16072,
60,
198,
220,
220,
220,
43237,
2934,
62,
2902,
796,
43237,
2934,
58,
82,
328,
2934,
17816,
4851,
20520,
1279,
2793,
62,
16072,
60,
628,
220,
220,
220,
1303,
20657,
1353,
37894,
286,
277,
301,
10812,
198,
220,
220,
220,
1029,
69,
301,
796,
277,
301,
13,
77,
28209,
7,
600,
7,
69,
301,
13,
43358,
58,
15,
60,
9,
25067,
576,
828,
69,
1,
90,
3672,
92,
62,
89,
37,
301,
4943,
628,
220,
220,
220,
1303,
4919,
867,
277,
301,
30,
703,
867,
43237,
390,
510,
290,
866,
30,
198,
220,
220,
220,
299,
69,
301,
796,
1029,
69,
301,
13,
43358,
58,
15,
60,
198,
220,
220,
220,
299,
2934,
62,
929,
796,
43237,
2934,
62,
929,
13,
43358,
58,
15,
60,
198,
220,
220,
220,
299,
2934,
62,
2902,
796,
43237,
2934,
62,
2902,
13,
43358,
58,
15,
60,
628,
220,
220,
220,
3601,
7,
69,
1,
1858,
389,
1391,
358,
68,
62,
929,
92,
5566,
510,
27739,
10812,
287,
1391,
3672,
92,
4943,
220,
198,
220,
220,
220,
3601,
7,
69,
1,
1858,
389,
1391,
358,
68,
62,
2902,
92,
5566,
866,
27739,
10812,
287,
1391,
3672,
92,
4943,
628,
220,
220,
220,
299,
16885,
11,
4808,
796,
36177,
17,
7,
82,
328,
2934,
62,
929,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1029,
69,
301,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
390,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3551,
28,
17821,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3108,
28,
69,
1,
43420,
14,
574,
77,
14,
90,
3672,
27422,
7206,
13,
37,
301,
13,
3849,
5458,
13,
912,
85,
4943,
198,
220,
220,
220,
220,
628,
220,
220,
220,
46424,
2,
1395,
6561,
55,
2393,
46424,
2,
198,
220,
220,
220,
611,
814,
16184,
862,
25,
198,
220,
220,
220,
220,
220,
220,
220,
814,
16184,
862,
7206,
796,
279,
67,
13,
961,
62,
40664,
7203,
43420,
14,
67,
10203,
77,
862,
14,
90,
3672,
27422,
82,
328,
13,
41304,
7206,
13,
912,
85,
1600,
41767,
2625,
59,
83,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
9629,
796,
751,
62,
28665,
82,
62,
87,
7278,
87,
7,
3672,
11,
390,
11,
277,
301,
11,
1029,
69,
301,
11,
814,
16184,
862,
11,
814,
16184,
862,
7206,
8,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
9629,
796,
751,
62,
28665,
82,
62,
87,
7278,
87,
7,
3672,
11,
390,
11,
277,
301,
11,
1029,
69,
301,
11,
814,
16184,
862,
11,
814,
16184,
862,
7206,
28,
14202,
8,
628,
220,
220,
220,
1303,
19430,
1123,
1366,
14535,
284,
257,
1180,
2499,
25473,
13,
198,
220,
220,
220,
9629,
13,
1462,
62,
1069,
5276,
7,
16002,
11,
9629,
62,
3672,
28,
3672,
8,
198,
198,
2,
13872,
262,
16492,
292,
24134,
6260,
290,
5072,
262,
24134,
2393,
13,
198,
16002,
13,
21928,
3419
] | 2.498054 | 1,028 |
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None | [
2,
30396,
329,
257,
13934,
5509,
10139,
13,
198,
2,
1398,
12200,
19667,
25,
198,
2,
220,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
2124,
2599,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
2100,
796,
2124,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
9464,
796,
6045,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
3506,
796,
6045
] | 2.175676 | 74 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.