hexsha
string
size
int64
ext
string
lang
string
max_stars_repo_path
string
max_stars_repo_name
string
max_stars_repo_head_hexsha
string
max_stars_repo_licenses
list
max_stars_count
int64
max_stars_repo_stars_event_min_datetime
string
max_stars_repo_stars_event_max_datetime
string
max_issues_repo_path
string
max_issues_repo_name
string
max_issues_repo_head_hexsha
string
max_issues_repo_licenses
list
max_issues_count
int64
max_issues_repo_issues_event_min_datetime
string
max_issues_repo_issues_event_max_datetime
string
max_forks_repo_path
string
max_forks_repo_name
string
max_forks_repo_head_hexsha
string
max_forks_repo_licenses
list
max_forks_count
int64
max_forks_repo_forks_event_min_datetime
string
max_forks_repo_forks_event_max_datetime
string
content
string
avg_line_length
float64
max_line_length
int64
alphanum_fraction
float64
qsc_code_num_words_quality_signal
int64
qsc_code_num_chars_quality_signal
float64
qsc_code_mean_word_length_quality_signal
float64
qsc_code_frac_words_unique_quality_signal
float64
qsc_code_frac_chars_top_2grams_quality_signal
float64
qsc_code_frac_chars_top_3grams_quality_signal
float64
qsc_code_frac_chars_top_4grams_quality_signal
float64
qsc_code_frac_chars_dupe_5grams_quality_signal
float64
qsc_code_frac_chars_dupe_6grams_quality_signal
float64
qsc_code_frac_chars_dupe_7grams_quality_signal
float64
qsc_code_frac_chars_dupe_8grams_quality_signal
float64
qsc_code_frac_chars_dupe_9grams_quality_signal
float64
qsc_code_frac_chars_dupe_10grams_quality_signal
float64
qsc_code_frac_chars_replacement_symbols_quality_signal
float64
qsc_code_frac_chars_digital_quality_signal
float64
qsc_code_frac_chars_whitespace_quality_signal
float64
qsc_code_size_file_byte_quality_signal
float64
qsc_code_num_lines_quality_signal
float64
qsc_code_num_chars_line_max_quality_signal
float64
qsc_code_num_chars_line_mean_quality_signal
float64
qsc_code_frac_chars_alphabet_quality_signal
float64
qsc_code_frac_chars_comments_quality_signal
float64
qsc_code_cate_xml_start_quality_signal
float64
qsc_code_frac_lines_dupe_lines_quality_signal
float64
qsc_code_cate_autogen_quality_signal
float64
qsc_code_frac_lines_long_string_quality_signal
float64
qsc_code_frac_chars_string_length_quality_signal
float64
qsc_code_frac_chars_long_word_length_quality_signal
float64
qsc_code_frac_lines_string_concat_quality_signal
float64
qsc_code_cate_encoded_data_quality_signal
float64
qsc_code_frac_chars_hex_words_quality_signal
float64
qsc_code_frac_lines_prompt_comments_quality_signal
float64
qsc_code_frac_lines_assert_quality_signal
float64
qsc_codepython_cate_ast_quality_signal
float64
qsc_codepython_frac_lines_func_ratio_quality_signal
float64
qsc_codepython_cate_var_zero_quality_signal
bool
qsc_codepython_frac_lines_pass_quality_signal
float64
qsc_codepython_frac_lines_import_quality_signal
float64
qsc_codepython_frac_lines_simplefunc_quality_signal
float64
qsc_codepython_score_lines_no_logic_quality_signal
float64
qsc_codepython_frac_lines_print_quality_signal
float64
qsc_code_num_words
int64
qsc_code_num_chars
int64
qsc_code_mean_word_length
int64
qsc_code_frac_words_unique
null
qsc_code_frac_chars_top_2grams
int64
qsc_code_frac_chars_top_3grams
int64
qsc_code_frac_chars_top_4grams
int64
qsc_code_frac_chars_dupe_5grams
int64
qsc_code_frac_chars_dupe_6grams
int64
qsc_code_frac_chars_dupe_7grams
int64
qsc_code_frac_chars_dupe_8grams
int64
qsc_code_frac_chars_dupe_9grams
int64
qsc_code_frac_chars_dupe_10grams
int64
qsc_code_frac_chars_replacement_symbols
int64
qsc_code_frac_chars_digital
int64
qsc_code_frac_chars_whitespace
int64
qsc_code_size_file_byte
int64
qsc_code_num_lines
int64
qsc_code_num_chars_line_max
int64
qsc_code_num_chars_line_mean
int64
qsc_code_frac_chars_alphabet
int64
qsc_code_frac_chars_comments
int64
qsc_code_cate_xml_start
int64
qsc_code_frac_lines_dupe_lines
int64
qsc_code_cate_autogen
int64
qsc_code_frac_lines_long_string
int64
qsc_code_frac_chars_string_length
int64
qsc_code_frac_chars_long_word_length
int64
qsc_code_frac_lines_string_concat
null
qsc_code_cate_encoded_data
int64
qsc_code_frac_chars_hex_words
int64
qsc_code_frac_lines_prompt_comments
int64
qsc_code_frac_lines_assert
int64
qsc_codepython_cate_ast
int64
qsc_codepython_frac_lines_func_ratio
int64
qsc_codepython_cate_var_zero
int64
qsc_codepython_frac_lines_pass
int64
qsc_codepython_frac_lines_import
int64
qsc_codepython_frac_lines_simplefunc
int64
qsc_codepython_score_lines_no_logic
int64
qsc_codepython_frac_lines_print
int64
effective
string
hits
int64
38f2bdce75734494748ce5c3e448e46f5282c8cd
183
py
Python
examples/src/dbnd_examples/ml/tool_sagemaker/__init__.py
ipattarapong/dbnd
7bd65621c46c73e078eb628f994127ad4c7dbd1a
[ "Apache-2.0" ]
224
2020-01-02T10:46:37.000Z
2022-03-02T13:54:08.000Z
examples/src/dbnd_examples/ml/tool_sagemaker/__init__.py
ipattarapong/dbnd
7bd65621c46c73e078eb628f994127ad4c7dbd1a
[ "Apache-2.0" ]
16
2020-03-11T09:37:58.000Z
2022-01-26T10:22:08.000Z
examples/src/dbnd_examples/ml/tool_sagemaker/__init__.py
ipattarapong/dbnd
7bd65621c46c73e078eb628f994127ad4c7dbd1a
[ "Apache-2.0" ]
24
2020-03-24T13:53:50.000Z
2022-03-22T11:55:18.000Z
class SagemakerData(object): amazon_reviews_raw_data = "s3://amazon-reviews-pds/tsv/amazon_reviews_us_Digital_Video_Download_v1_00.tsv.gz" sagemaker_data_repo = SagemakerData()
30.5
113
0.825137
26
183
5.346154
0.730769
0.280576
0
0
0
0
0
0
0
0
0
0.023669
0.076503
183
5
114
36.6
0.798817
0
0
0
0
0
0.442623
0.442623
0
0
0
0
0
1
0
false
0
0
0
0.666667
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
1
0
0
5
38fde25a31434e1c92cb336a380d7cbd785ed049
86
py
Python
tvdb_rss/__init__.py
csm10495/tvdb_rss
df40c6a86504e3ada00e7ffdea3613a65baac819
[ "MIT" ]
1
2021-02-16T04:57:23.000Z
2021-02-16T04:57:23.000Z
tvdb_rss/__init__.py
csm10495/tvdb_rss
df40c6a86504e3ada00e7ffdea3613a65baac819
[ "MIT" ]
null
null
null
tvdb_rss/__init__.py
csm10495/tvdb_rss
df40c6a86504e3ada00e7ffdea3613a65baac819
[ "MIT" ]
null
null
null
from .config import Config from .rss import RSSGenerator from .tvdb import TVDBClient
21.5
29
0.825581
12
86
5.916667
0.583333
0
0
0
0
0
0
0
0
0
0
0
0.139535
86
3
30
28.666667
0.959459
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
ac1f66e68ac71f591bcfffadd8573ec64febbd46
2,595
py
Python
tests/unit_tests/test_properties/test_visitors/test_DetailsInference/test_Or.py
samysweb/dnnv
58fb95b7300914d9da28eed86c39eca473b1aaef
[ "MIT" ]
5
2022-01-28T20:30:34.000Z
2022-03-17T09:26:52.000Z
tests/unit_tests/test_properties/test_visitors/test_DetailsInference/test_Or.py
samysweb/dnnv
58fb95b7300914d9da28eed86c39eca473b1aaef
[ "MIT" ]
9
2022-01-27T03:50:28.000Z
2022-02-08T18:42:17.000Z
tests/unit_tests/test_properties/test_visitors/test_DetailsInference/test_Or.py
samysweb/dnnv
58fb95b7300914d9da28eed86c39eca473b1aaef
[ "MIT" ]
2
2022-02-03T17:32:43.000Z
2022-03-24T16:38:49.000Z
import numpy as np import pytest from dnnv.properties.expressions import * from dnnv.properties.visitors import DetailsInference, DNNVShapeError, DNNVTypeError def test_Or_symbols(): inference = DetailsInference() a, b = Symbol("a"), Symbol("b") expr = Or(a, b) inference.visit(expr) assert not inference.shapes[a].is_concrete assert not inference.shapes[b].is_concrete assert not inference.shapes[expr].is_concrete assert inference.types[a].is_concrete assert inference.types[b].is_concrete assert inference.types[expr].is_concrete assert inference.types[a].value == bool assert inference.types[b].value == bool assert inference.types[expr].value == bool def test_Or_constants(): inference = DetailsInference() a, b = Constant(True), Constant(False) expr = Or(a, b) inference.visit(expr) assert inference.shapes[a].is_concrete assert inference.shapes[b].is_concrete assert inference.shapes[expr].is_concrete assert inference.shapes[a].value == () assert inference.shapes[b].value == () assert inference.shapes[expr].value == () assert inference.types[a].is_concrete assert inference.types[b].is_concrete assert inference.types[expr].is_concrete assert inference.types[a].value == bool assert inference.types[b].value == bool assert inference.types[expr].value == bool def test_Or_arrays(): inference = DetailsInference() a, b = Constant(np.random.rand(3) > 0.5), Constant(np.random.rand(1, 1, 1, 3) > 0.5) expr = Or(a, b) inference.visit(expr) assert inference.shapes[a].is_concrete assert inference.shapes[b].is_concrete assert inference.shapes[expr].is_concrete assert inference.shapes[a].value == (3,) assert inference.shapes[b].value == (1, 1, 1, 3) assert inference.shapes[expr].value == (1, 1, 1, 3) assert inference.types[a].is_concrete assert inference.types[b].is_concrete assert inference.types[expr].is_concrete assert inference.types[a].value == bool assert inference.types[b].value == bool assert inference.types[expr].value == bool def test_Or_incompatible_shapes(): inference = DetailsInference() a, b = Constant(np.random.rand(3, 4) > 0.5), Constant(np.random.rand(2) > 0.5) expr = Or(a, b) with pytest.raises(DNNVShapeError): inference.visit(expr) def test_Or_incompatible_types(): inference = DetailsInference() a, b = Constant(True), Constant(11) expr = Or(a, b) with pytest.raises(DNNVTypeError): inference.visit(expr)
28.206522
88
0.693642
352
2,595
5.028409
0.136364
0.254237
0.162712
0.225989
0.811864
0.761582
0.694915
0.579661
0.561582
0.507345
0
0.012688
0.179961
2,595
91
89
28.516484
0.819079
0
0
0.609375
0
0
0.000771
0
0
0
0
0
0.515625
1
0.078125
false
0
0.0625
0
0.140625
0
0
0
0
null
1
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
5
ac4e77cffd90401cc94b85a231410a0c23048e44
205,675
py
Python
main.py
kenny1203520/Final-battle-Game
ded5b267c22185d4344396702fcd4a2fb6f1f4e6
[ "MIT" ]
3
2021-12-20T01:52:53.000Z
2022-01-06T13:46:55.000Z
main.py
kenny1203520/Final-battle-Game
ded5b267c22185d4344396702fcd4a2fb6f1f4e6
[ "MIT" ]
null
null
null
main.py
kenny1203520/Final-battle-Game
ded5b267c22185d4344396702fcd4a2fb6f1f4e6
[ "MIT" ]
null
null
null
import pygame, random, os, pickle, math # Version SPECIAL_VERSION = False VERSION = "Beta 1.2.0" # 遊戲存檔地址 GAMESAVE_FILE_ADDRESS = 'saves/game_save.gs' # 設定檔地址 CONFIG_FILE_ADDRESS = 'config.txt' # Screen_Setting WIDTH = 1280 HEIGHT = 720 FPS = 60 if not os.path.isfile(CONFIG_FILE_ADDRESS): # 建立遊戲設定檔 with open(CONFIG_FILE_ADDRESS, 'wb') as gameConfigFile: gameConfig = {} gameConfig['ScreenWidth'] = WIDTH gameConfig['ScreenHeight'] = HEIGHT gameConfig['FPS'] = FPS gameConfig['FullScreen'] = True gameConfig['MainVolume'] = 5 gameConfig['MusicVolume'] = 5 pickle.dump(gameConfig, gameConfigFile) else: with open(CONFIG_FILE_ADDRESS, 'rb') as gameConfigFile: gameConfig = pickle.load(gameConfigFile) Enable_FullScreen = gameConfig['FullScreen'] # 聲音設定 MainVolume = gameConfig['MainVolume'] MusicVolume = gameConfig['MusicVolume'] # Screen_Display_Tittle Screen_display_tittle = {} Screen_display_tittle['main'] = ("最後的戰役") Screen_display_tittle['tittle'] = [("前進魔王城"), ("銓勇士上阿!"), ("銓進魔王城"), ("最後的戰役"), ("飛彈真的時好時壞"), ("飛彈不一定最強"), ("其實電腦都很弱"), ("如果你覺得自己很強最好去挑戰困難"), ("小孩子才玩簡單模式"), ("Final battle")] # 遊戲初始化 & 創建視窗 pygame.init() pygame.mixer.init() clock = pygame.time.Clock() if Enable_FullScreen: screen = pygame.display.set_mode((WIDTH, HEIGHT), pygame.FULLSCREEN) else: screen = pygame.display.set_mode((WIDTH, HEIGHT)) pygame.display.set_caption(Screen_display_tittle['main']) program_running = True GameSave_content = {} # 導入字型 text_font = os.path.join("Content", "Font", "font.ttf") # Screen_Display_Icon # icon gameIcon = pygame.transform.scale(pygame.image.load(os.path.join("Content\Images\icon.png")), (32, 32)) pygame.display.set_icon(gameIcon) # 導入圖片 # 主畫面背景 main_screen_background = {} main_screen_background['main'] = pygame.image.load(os.path.join("Content/Images/main_screen/main_screen_background0.png")).convert() main_screen_background['animation'] = [] # 製作主畫面開始動畫 for i in range(12): main_screen_background_img = pygame.image.load(os.path.join("Content/Images/main_screen", f"main_screen_background{i}.png")).convert() main_screen_background['animation'].append(main_screen_background_img) for i in range(10, 0, -1): main_screen_background_img = pygame.image.load(os.path.join("Content/Images/main_screen", f"main_screen_background{i}.png")).convert() main_screen_background['animation'].append(main_screen_background_img) # 按鈕背景照片 button_background_image_normal = pygame.image.load(os.path.join("Content/Images/button/main_screen_button_image_normal.png")) button_background_image_move = pygame.image.load(os.path.join("Content/Images/button/main_screen_button_image_onbutton.png")) button_background_image_down = pygame.image.load(os.path.join("Content/Images/button/main_screen_button_image_click.png")) button_background_image_arrowButton_normal = pygame.image.load(os.path.join("Content/Images/button/arrowButton_image_normal.png")) button_background_image_arrowButton_move = pygame.image.load(os.path.join("Content/Images/button/arrowButton_image_onbutton.png")) button_background_image_arrowButton_down = pygame.image.load(os.path.join("Content/Images/button/arrowButton_image_click.png")) # 遊戲圖片 image_player_soldier = {} image_player_soldier['Left'] = [] image_player_soldier['Right'] = [] image_player_soldier['Left'].append(pygame.transform.scale(pygame.image.load(os.path.join("Content\Images\game\player\player_soldier_left_1.png")), (96, 108))) image_player_soldier['Left'].append(pygame.transform.scale(pygame.image.load(os.path.join("Content\Images\game\player\player_soldier_left_2.png")), (96, 108))) image_player_soldier['Left'].append(pygame.transform.scale(pygame.image.load(os.path.join("Content\Images\game\player\player_soldier_left_3.png")), (96, 108))) image_player_soldier['Right'].append(pygame.transform.scale(pygame.image.load(os.path.join("Content\Images\game\player\player_soldier_right_1.png")), (96, 108))) image_player_soldier['Right'].append(pygame.transform.scale(pygame.image.load(os.path.join("Content\Images\game\player\player_soldier_right_2.png")), (96, 108))) image_player_soldier['Right'].append(pygame.transform.scale(pygame.image.load(os.path.join("Content\Images\game\player\player_soldier_right_3.png")), (96, 108))) image_enemy_soldier = {} image_enemy_soldier['Left'] = [] image_enemy_soldier['Right'] = [] image_enemy_soldier['Up'] = [] image_enemy_soldier['Down'] = [] image_enemy_soldier['Left'].append(pygame.transform.scale(pygame.image.load(os.path.join("Content\Images\game\enemy\enemy_soldier_left_1.png")), (96, 108))) image_enemy_soldier['Left'].append(pygame.transform.scale(pygame.image.load(os.path.join("Content\Images\game\enemy\enemy_soldier_left_2.png")), (96, 108))) image_enemy_soldier['Left'].append(pygame.transform.scale(pygame.image.load(os.path.join("Content\Images\game\enemy\enemy_soldier_left_3.png")), (96, 108))) image_enemy_soldier['Right'].append(pygame.transform.scale(pygame.image.load(os.path.join("Content\Images\game\enemy\enemy_soldier_right_1.png")), (96, 108))) image_enemy_soldier['Right'].append(pygame.transform.scale(pygame.image.load(os.path.join("Content\Images\game\enemy\enemy_soldier_right_2.png")), (96, 108))) image_enemy_soldier['Right'].append(pygame.transform.scale(pygame.image.load(os.path.join("Content\Images\game\enemy\enemy_soldier_right_3.png")), (96, 108))) image_enemy_soldier['Up'].append(pygame.transform.scale(pygame.image.load(os.path.join("Content\Images\game\enemy\enemy_soldier_right_up_1.png")), (96, 108))) image_enemy_soldier['Up'].append(pygame.transform.scale(pygame.image.load(os.path.join("Content\Images\game\enemy\enemy_soldier_right_up_2.png")), (96, 108))) image_enemy_soldier['Up'].append(pygame.transform.scale(pygame.image.load(os.path.join("Content\Images\game\enemy\enemy_soldier_right_up_3.png")), (96, 108))) image_enemy_soldier['Up'].append(pygame.transform.scale(pygame.image.load(os.path.join("Content\Images\game\enemy\enemy_soldier_left_up_1.png")), (96, 108))) image_enemy_soldier['Up'].append(pygame.transform.scale(pygame.image.load(os.path.join("Content\Images\game\enemy\enemy_soldier_left_up_2.png")), (96, 108))) image_enemy_soldier['Up'].append(pygame.transform.scale(pygame.image.load(os.path.join("Content\Images\game\enemy\enemy_soldier_left_up_3.png")), (96, 108))) image_enemy_soldier['Down'].append(pygame.transform.scale(pygame.image.load(os.path.join("Content\Images\game\enemy\enemy_soldier_right_down_1.png")), (96, 108))) image_enemy_soldier['Down'].append(pygame.transform.scale(pygame.image.load(os.path.join("Content\Images\game\enemy\enemy_soldier_right_down_2.png")), (96, 108))) image_enemy_soldier['Down'].append(pygame.transform.scale(pygame.image.load(os.path.join("Content\Images\game\enemy\enemy_soldier_right_down_3.png")), (96, 108))) image_enemy_soldier['Down'].append(pygame.transform.scale(pygame.image.load(os.path.join("Content\Images\game\enemy\enemy_soldier_left_down_1.png")), (96, 108))) image_enemy_soldier['Down'].append(pygame.transform.scale(pygame.image.load(os.path.join("Content\Images\game\enemy\enemy_soldier_left_down_2.png")), (96, 108))) image_enemy_soldier['Down'].append(pygame.transform.scale(pygame.image.load(os.path.join("Content\Images\game\enemy\enemy_soldier_left_down_3.png")), (96, 108))) image_sandBag_front = pygame.image.load(os.path.join("Content/Images/game/sandBag/sandBag-front.png")) image_sandBag_right = pygame.image.load(os.path.join("Content/Images/game/sandBag/sandBag-right.png")) image_player_plane = pygame.image.load(os.path.join("Content/Images/game/player/player_plane.png")) image_enemy_plane = pygame.image.load(os.path.join("Content/Images/game/enemy/enemy_plane.png")) image_enemy_plane = pygame.transform.rotate(image_enemy_plane, 180) image_enemy_plane_BOSS = pygame.image.load(os.path.join("Content/Images/game/enemy/enemy_plane_BOSS.png")) image_enemy_plane_BOSS = pygame.transform.rotate(image_enemy_plane_BOSS, 180) image_player_livesIcon = pygame.image.load(os.path.join("Content\Images\game\player\heart.png")) image_bullet_rifle = pygame.image.load(os.path.join("Content/Images/game/bullet/bullet_rifle.png")) image_bullet_laser = pygame.image.load(os.path.join("Content/Images/game/bullet/bullet_laser.png")) image_bullet_missile = pygame.image.load(os.path.join("Content/Images/game/bullet/bullet_missile.png")) image_bullet_missile_small = pygame.transform.scale(image_bullet_missile, (9, 31)) image_rock = pygame.image.load(os.path.join("Content/Images/game/rock/rock.png")) # image_magazine_rifle = pygame.image.load(os.path.join("Content/Images/game/magazine/magazine_rifle.png")) image_medkit = pygame.image.load(os.path.join("Content/Images/game/medkit/medkit.png")) image_repairKit = pygame.image.load(os.path.join("Content/Images/game/repairKit/repairKit.png")) image_armorpack = pygame.image.load(os.path.join("Content/Images/game/armorpack/armorpack.png")) image_large_magazine_rifle = pygame.image.load(os.path.join("Content/Images/game/magazine/large_magazine_rifle.png")) image_highspeed_reload_magazine_rifle = pygame.image.load(os.path.join("Content/Images/game/magazine/highspeed_reload_magazine_rifle.png")) image_aimPoint = pygame.image.load(os.path.join("Content/Images/game/aimPoint/aim_point.png")) image_weapon_M4A1 = pygame.image.load(os.path.join("Content/Images/game/weapons/rifle_M4A1.png")) image_weapon_M4A1 = pygame.transform.scale(image_weapon_M4A1, (94, 34)) image_weapon_M4A1_FlipHorizontally = pygame.image.load(os.path.join("Content/Images/game/weapons/rifle_M4A1 - FlipHorizontally.png")) image_weapon_M4A1_FlipHorizontally = pygame.transform.scale(image_weapon_M4A1_FlipHorizontally, (94, 34)) image_large_magazine_rifle_status = pygame.image.load(os.path.join("Content/Images/game/magazine/large_magazine_rifle - status.png")) image_large_magazine_rifle_status = pygame.transform.scale(image_large_magazine_rifle_status, (30, 30)) image_playerInformactionUI_background_singleMode = pygame.image.load(os.path.join("Content/Images/game/bullet/bullet_rifle_singleMode.png")) image_playerInformactionUI_background_autoMode = pygame.image.load(os.path.join("Content/Images/game/bullet/bullet_rifle_autoMode.png")) image_turretUpgrade = pygame.image.load(os.path.join("Content/Images/game/battery/battery.png")) image_turretUpgrade = pygame.transform.scale(image_turretUpgrade, (41, 22)) image_turretUpgrade_status = pygame.image.load(os.path.join("Content/Images/game/battery/turretUpgrade_status.png")) image_turretUpgrade_status = pygame.transform.scale(image_turretUpgrade_status, (30, 30)) # 背景 image_setting_panel_background = pygame.image.load(os.path.join("Content/Images/game/background/background_SettingPanel.png")) image_background_passLevelScreen = pygame.image.load(os.path.join("Content/Images/game/background/background_passLevelScreen.png")) image_playerInformactionUI_background = pygame.image.load(os.path.join("Content/Images/game/background/Player_UI_Panel.png")) image_background_desert = pygame.image.load(os.path.join("Content/Images/game/background/background_desert.png")).convert() image_background_space = pygame.image.load(os.path.join("Content/Images/game/background/background_space.png")).convert() image_background_gameStatistics = pygame.image.load(os.path.join("Content/Images/game/background/background_gameStatistics.png")).convert() image_background_gameStatistics_special = pygame.image.load(os.path.join("Content/Images/game/background/background_gameStatistics - special.png")).convert() image_background_gameMarkerScreen = pygame.image.load(os.path.join("Content/Images/game/background/background_gameMarkerScreen.png")) image_background_level1Trip = pygame.image.load(os.path.join("Content/Images/game/background/background_level1Trip_v2.png")) image_background_level2Trip = pygame.image.load(os.path.join("Content/Images/game/background/background_level2Trip_v2.png")) # 導入音檔 sound_rifle_shoot = pygame.mixer.Sound(os.path.join("Content/Sound/game/rifle_fire_effect.mp3")) sound_rifle_reload = pygame.mixer.Sound(os.path.join("Content/Sound/game/rifle_reload_effect.mp3")) sound_laser_launcher = pygame.mixer.Sound(os.path.join("Content/Sound/game/laser_launcher_effect.mp3")) sound_missile_launcher = pygame.mixer.Sound(os.path.join("Content/Sound/game/missile_launcher_effect.mp3")) def draw_text(location, surf, text, text_color, size, bold, x, y): # location => # center = center # tl = topleft, tr = topright # bl = bottomleft, br = bottomright font = pygame.font.Font(text_font, size) font.set_bold(bold) text_surface = font.render(text, True, text_color) text_rect = text_surface.get_rect() if location == "center": text_rect.centerx = x text_rect.centery = y elif location == "tl": text_rect.left = x text_rect.top = y elif location == "tr": text_rect.right = x text_rect.top = y elif location == "bl": text_rect.left = x text_rect.bottom = y elif location == "br": text_rect.right = x text_rect.bottom = y surf.blit(text_surface, text_rect) def draw_Level_1_playerInformactionUI(surf, player, score, LevelStartPlayTime): # 現在時間(ticks) 1tick = 1ms nowTime = pygame.time.get_ticks() PlayTime = int((nowTime - LevelStartPlayTime) / 1000) if PlayTime > 60: PlayTime_Minute = int(PlayTime / 60) PlayTime_Second = PlayTime - (PlayTime_Minute * 60) else: PlayTime_Minute = 0 PlayTime_Second = PlayTime # 玩家屬性面板 # # 外框 300*120, 290*110 # pygame.draw.polygon(surf, (127, 127, 127), [(0, 600), (300, 600), (300, 720), (0, 720)]) # pygame.draw.polygon(surf, (200, 200, 200), [(5, 605), (295, 605), (295, 715), (5, 715)]) # # 血量背景 60*30 # pygame.draw.polygon(surf, (180, 180, 180), [(72, 610), (132, 610), (132, 640), (72, 640)]) # # 彈匣背景 86*30 # pygame.draw.polygon(surf, (180, 180, 180), [(204, 610), (290, 610), (290, 640), (204, 640)]) # # 分數欄背景 143*30 # pygame.draw.polygon(surf, (180, 180, 180), [(72, 680), (215, 680), (215, 710), (72, 710)]) # # 遊玩時間 65*60 # pygame.draw.polygon(surf, (150, 150, 150), [(225, 650), (290, 650), (290, 710), (225, 710)]) # # 畫屬性面板背景 # screen.blit(image_PlayerAttributes_Panel, (0, 600)) # 血量 # draw_text("tl", surf, "血量 ", (255, 255, 255), 26, True, 10, 608) draw_text("tl", surf, str(int(player.now_health)), (255, 255, 255), 24, True, 64, 681) # 護甲 # draw_text("tl", surf, "護甲 ", (255, 255, 255), 26, True, 10, 643) draw_text("tl", surf, str(int(player.now_armor)), (255, 255, 255), 24, True, 234, 681) # 彈匣內彈量 # draw_text("tl", surf, "彈匣 ", (255, 255, 255), 26, True, 142, 608) # if player.last_magazine_bullets > 0: draw_text("br", surf, str(player.last_magazine_bullets) + " / " + str(player.magazine_bullets), (255, 255, 255), 24, True, 1225, 713) # elif player.pressed_reload_key: # draw_text("br", surf, "換彈中", (127, 127, 127), 24, True, 1245, 713) # else: # draw_text("br", surf, "換彈中", (127, 127, 127), 24, True, 1245, 713) # 分數 # draw_text("bl", surf, "分數 ", (255, 255, 255), 26, True, 10, 712) draw_text("tr", surf, str(score), (255, 255, 255), 24, True, 1270, 5) # 遊玩時間 # draw_text("br", surf, "時間", (255, 255, 255), 26, True, 286, 684) if PlayTime_Second > 9: draw_text("center", surf, str(PlayTime_Minute) + ":" + str(PlayTime_Second), (255, 255, 255), 24, True, WIDTH / 2, 22) else: draw_text("center", surf, str(PlayTime_Minute) + ":0" + str(PlayTime_Second), (255, 255, 255), 24, True, WIDTH / 2, 22) def draw_Level_2_playerInformactionUI(surf, player, score, LevelStartPlayTime): # 現在時間(ticks) 1tick = 1ms nowTime = pygame.time.get_ticks() PlayTime = int((nowTime - LevelStartPlayTime) / 1000) if PlayTime > 60: PlayTime_Minute = int(PlayTime / 60) PlayTime_Second = PlayTime - (PlayTime_Minute * 60) else: PlayTime_Minute = 0 PlayTime_Second = PlayTime # 血量 # draw_text("tl", surf, "血量 ", (255, 255, 255), 26, True, 10, 608) draw_text("tl", surf, str(int(player.now_health)), (255, 255, 255), 24, True, 64, 681) # 護甲 # draw_text("tl", surf, "護甲 ", (255, 255, 255), 26, True, 10, 643) draw_text("tl", surf, str(int(player.now_armor)), (255, 255, 255), 24, True, 234, 681) # 飛彈數量 # draw_text("tl", surf, "彈匣 ", (255, 255, 255), 26, True, 142, 608) # if player.last_magazine_bullets > 0: draw_text("br", surf, str(player.last_missile_amount) + " / " + str(player.missile_amount_original), (255, 255, 255), 24, True, 1225, 713) # elif player.pressed_reload_key: # draw_text("tr", surf, "換彈中", (127, 127, 127), 24, True, 285, 610) # else: # draw_text("tr", surf, "換彈中", (127, 127, 127), 24, True, 285, 610) # 分數 # draw_text("bl", surf, "分數 ", (255, 255, 255), 26, True, 10, 712) draw_text("tr", surf, str(score), (255, 255, 255), 24, True, 1270, 5) # 遊玩時間 # draw_text("br", surf, "時間", (255, 255, 255), 26, True, 286, 684) if PlayTime_Second > 9: draw_text("center", surf, str(PlayTime_Minute) + ":" + str(PlayTime_Second), (255, 255, 255), 24, True, WIDTH / 2, 22) else: draw_text("center", surf, str(PlayTime_Minute) + ":0" + str(PlayTime_Second), (255, 255, 255), 24, True, WIDTH / 2, 22) def draw_lives(surf, lives, image, x, y, spacing): for i in range(lives): image_rect = image.get_rect() image_rect.x = x + spacing * i image_rect.y = y surf.blit(image, image_rect) def draw_health(surf, now_health, health, left, top, HealthBar_color, Border_Color): if now_health < 0: now_health = 0 BAR_LENGTH = 50 BAR_HEIGHT = 6 fill = (now_health / health) * BAR_LENGTH outline_rect = pygame.Rect(left, top, BAR_LENGTH, BAR_HEIGHT) fill_rect = pygame.Rect(left, top, fill, BAR_HEIGHT) pygame.draw.rect(surf, HealthBar_color, fill_rect) pygame.draw.rect(surf, Border_Color, outline_rect, 2) def draw_spriteStatus(surf, now_armor, armor, now_health, health, left, top, ArmorBar_color, HealthBar_color, Border_Color): if now_armor < 0: now_armor = 0 if now_health < 0: now_health = 0 BAR_LENGTH = 50 BAR_HEIGHT = 6 fill_health = (now_health / health) * BAR_LENGTH fill_armor = (now_armor / armor) * BAR_LENGTH outline_rect = pygame.Rect(left, top, BAR_LENGTH, BAR_HEIGHT) fill_health_rect = pygame.Rect(left, top, fill_health, BAR_HEIGHT) fill_armor_rect = pygame.Rect(left, top, fill_armor, BAR_HEIGHT) pygame.draw.rect(surf, HealthBar_color, fill_health_rect) pygame.draw.rect(surf, ArmorBar_color, fill_armor_rect) pygame.draw.rect(surf, Border_Color, outline_rect, 2) # 主畫面 def draw_main_screen(): # Tittle draw_text("center", screen, Screen_display_tittle["main"], (250, 250, 250), 64, True, WIDTH / 2, (HEIGHT / 10) + 32) # version draw_text("bl", screen, VERSION, (180, 180, 180), 18, True, 10, 715) # drawBotton startPlayGame_Button.draw(screen) gameSetting_Button.draw(screen) leaveGame_Button.draw(screen) def draw_Key_escape_screen(surf): running = True continueGame_Button = SettingPanel_ArrowButton(WIDTH / 2, 200 * (HEIGHT / 720), "繼續", 28, (0, 0, 0), False, button_background_image_normal, button_background_image_move, button_background_image_down, text_font) mainMenu_Button = SettingPanel_ArrowButton(WIDTH / 2, 331 * (HEIGHT / 720), "主選單", 28, (0, 0, 0), False, button_background_image_normal, button_background_image_move, button_background_image_down, text_font) leaveGame_Button = SettingPanel_ArrowButton(WIDTH / 2, 462 * (HEIGHT / 720), "離開", 28, (0, 0, 0), False, button_background_image_normal, button_background_image_move, button_background_image_down, text_font) while running: clock.tick(FPS) # 獲得滑鼠座標 mouse_x, mouse_y = pygame.mouse.get_pos() for event in pygame.event.get(): if event.type == pygame.QUIT: running = False break elif event.type == pygame.KEYDOWN: if event.key == pygame.K_ESCAPE: continueGame_Button.bottomMouseUp = True # 滑鼠移動事件 elif event.type == pygame.MOUSEMOTION: # 判斷滑鼠是否移動到按鈕範圍內 continueGame_Button.getFocus(mouse_x, mouse_y) mainMenu_Button.getFocus(mouse_x, mouse_y) leaveGame_Button.getFocus(mouse_x, mouse_y) # 滑鼠按下 elif event.type == pygame.MOUSEBUTTONDOWN: #滑鼠左鍵按下 if pygame.mouse.get_pressed() == (1, 0, 0): continueGame_Button.mouseDown(mouse_x, mouse_y) mainMenu_Button.mouseDown(mouse_x, mouse_y) leaveGame_Button.mouseDown(mouse_x, mouse_y) # 滑鼠彈起 elif event.type == pygame.MOUSEBUTTONUP: continueGame_Button.mouseUp() mainMenu_Button.mouseUp() leaveGame_Button.mouseUp() # surf.blit(image_setting_panel_background, (0, 0)) mainMenu_Button.draw(surf) continueGame_Button.draw(surf) leaveGame_Button.draw(surf) pygame.display.update() if continueGame_Button.bottomMouseUp: running = False if mainMenu_Button.bottomMouseUp: running = False if leaveGame_Button.bottomMouseUp: running = False if continueGame_Button.bottomMouseUp: continueGame_Button.bottomMouseUp = False return 1 if mainMenu_Button.bottomMouseUp: mainMenu_Button.bottomMouseUp = False return 2 if leaveGame_Button.bottomMouseUp: leaveGame_Button.bottomMouseUp = False return 3 def draw_passLevelScreen(surf, Level): running = True nextLevel_Button = SettingPanel_ArrowButton(440 * (WIDTH / 1280), 580 * (HEIGHT / 720), "下一關", 28, (0, 0, 0), False, button_background_image_normal, button_background_image_move, button_background_image_down, text_font) mainMenu_Button = SettingPanel_ArrowButton(840 * (WIDTH / 1280), 580 * (HEIGHT / 720), "主選單", 28, (0, 0, 0), False, button_background_image_normal, button_background_image_move, button_background_image_down, text_font) while running: clock.tick(FPS) # 獲得滑鼠座標 mouse_x, mouse_y = pygame.mouse.get_pos() for event in pygame.event.get(): if event.type == pygame.QUIT: running = False break # 滑鼠移動事件 elif event.type == pygame.MOUSEMOTION: # 判斷滑鼠是否移動到按鈕範圍內 nextLevel_Button.getFocus(mouse_x, mouse_y) mainMenu_Button.getFocus(mouse_x, mouse_y) # 滑鼠按下 elif event.type == pygame.MOUSEBUTTONDOWN: #滑鼠左鍵按下 if pygame.mouse.get_pressed() == (1, 0, 0): nextLevel_Button.mouseDown(mouse_x, mouse_y) mainMenu_Button.mouseDown(mouse_x, mouse_y) # 滑鼠彈起 elif event.type == pygame.MOUSEBUTTONUP: nextLevel_Button.mouseUp() mainMenu_Button.mouseUp() surf.blit(image_background_passLevelScreen, (0, 0)) mainMenu_Button.draw(surf) nextLevel_Button.draw(surf) draw_text("center", screen, "勝利", (255, 255, 255), 64, True, WIDTH / 2, 160) if Level == 1: draw_text("tl", screen, "空軍作戰指揮部派遣空軍戰術戰鬥機聯隊前往前線進行空對地打擊", (255, 255, 255), 24, True, 190, 242) draw_text("tl", screen, "此次打擊使敵方勢力攻勢暫緩", (255, 255, 255), 24, True, 190, 271) elif Level == 2: draw_text("tl", screen, "將敵方轟炸機與協防的戰鬥機剿滅同時", (255, 255, 255), 24, True, 190, 242) draw_text("tl", screen, "偵查中隊也偵查到了敵人戰時指揮作戰中心", (255, 255, 255), 24, True, 190, 271) pygame.display.update() if nextLevel_Button.bottomMouseUp: running = False if mainMenu_Button.bottomMouseUp: running = False if nextLevel_Button.bottomMouseUp: nextLevel_Button.bottomMouseUp = False return True if mainMenu_Button.bottomMouseUp: mainMenu_Button.bottomMouseUp = False return False def draw_failureLevelScreen(surf): running = True replayGame_Button = SettingPanel_ArrowButton(440 * (WIDTH / 1280), 580 * (HEIGHT / 720), "重玩本關", 28, (0, 0, 0), False, button_background_image_normal, button_background_image_move, button_background_image_down, text_font) mainMenu_Button = SettingPanel_ArrowButton(840 * (WIDTH / 1280), 580 * (HEIGHT / 720), "主選單", 28, (0, 0, 0), False, button_background_image_normal, button_background_image_move, button_background_image_down, text_font) while running: clock.tick(FPS) # 獲得滑鼠座標 mouse_x, mouse_y = pygame.mouse.get_pos() for event in pygame.event.get(): if event.type == pygame.QUIT: running = False break # 滑鼠移動事件 elif event.type == pygame.MOUSEMOTION: # 判斷滑鼠是否移動到按鈕範圍內 replayGame_Button.getFocus(mouse_x, mouse_y) mainMenu_Button.getFocus(mouse_x, mouse_y) # 滑鼠按下 elif event.type == pygame.MOUSEBUTTONDOWN: #滑鼠左鍵按下 if pygame.mouse.get_pressed() == (1, 0, 0): replayGame_Button.mouseDown(mouse_x, mouse_y) mainMenu_Button.mouseDown(mouse_x, mouse_y) # 滑鼠彈起 elif event.type == pygame.MOUSEBUTTONUP: replayGame_Button.mouseUp() mainMenu_Button.mouseUp() surf.blit(image_background_passLevelScreen, (0, 0)) mainMenu_Button.draw(surf) replayGame_Button.draw(surf) draw_text("center", screen, "失敗", (255, 255, 255), 64, True, WIDTH / 2, 160) draw_text("tl", screen, "再來一次會更好", (255, 255, 255), 24, True, 190, 242) pygame.display.update() if replayGame_Button.bottomMouseUp: running = False if mainMenu_Button.bottomMouseUp: running = False if replayGame_Button.bottomMouseUp: replayGame_Button.bottomMouseUp = False return True if mainMenu_Button.bottomMouseUp: mainMenu_Button.bottomMouseUp = False return False class settingPanel: def __init__(self): self.surf = screen self.settingPanel_gameConfig = gameConfig self.ScreenImageResolution_now = {} self.ScreenImageResolution_now['Width'] = self.settingPanel_gameConfig['ScreenWidth'] self.ScreenImageResolution_now['Height'] = self.settingPanel_gameConfig['ScreenHeight'] self.ScreenFPS = self.settingPanel_gameConfig['FPS'] self.FullScreen_status = self.settingPanel_gameConfig['FullScreen'] self.MainVolume_now = self.settingPanel_gameConfig['MainVolume'] self.MusicVolume_now = self.settingPanel_gameConfig['MusicVolume'] # 是否完成調整 self.finishSetting = False # 按紐 self.ScreenMode_nextOne = SettingPanel_ArrowButton(1060, 152, "", 20, (255, 255, 255), False, button_background_image_arrowButton_normal, button_background_image_arrowButton_move, button_background_image_arrowButton_down, text_font) self.ScreenMode_lastOne = SettingPanel_ArrowButton(720, 152, "", 20, (255, 255, 255), False, button_background_image_arrowButton_normal, button_background_image_arrowButton_move, button_background_image_arrowButton_down, text_font) self.MainVolume_Plus = SettingPanel_ArrowButton(1060, 334, "", 20, (255, 255, 255), False, button_background_image_arrowButton_normal, button_background_image_arrowButton_move, button_background_image_arrowButton_down, text_font) self.MainVolume_Subtract = SettingPanel_ArrowButton(720, 334, "", 20, (255, 255, 255), False, button_background_image_arrowButton_normal, button_background_image_arrowButton_move, button_background_image_arrowButton_down, text_font) self.MusicVolume_Plus = SettingPanel_ArrowButton(1060, 369, "", 20, (255, 255, 255), False, button_background_image_arrowButton_normal, button_background_image_arrowButton_move, button_background_image_arrowButton_down, text_font) self.MusicVolume_Subtract = SettingPanel_ArrowButton(720, 369, "", 20, (255, 255, 255), False, button_background_image_arrowButton_normal, button_background_image_arrowButton_move, button_background_image_arrowButton_down, text_font) self.confirm_Buttom = SettingPanel_ArrowButton(1060, 600, "確認", 24, (255, 255, 255), False, button_background_image_normal, button_background_image_move, button_background_image_down, text_font) self.apply_Buttom = SettingPanel_ArrowButton(840, 600, "套用", 24, (255, 255, 255), False, button_background_image_normal, button_background_image_move, button_background_image_down, text_font) def updateData(self): # 顯示模式切換按鈕 if self.ScreenMode_nextOne.bottomMouseUp: self.ScreenMode_nextOne.bottomMouseUp = False self.FullScreen_status = False elif self.ScreenMode_lastOne.bottomMouseUp: self.ScreenMode_lastOne.bottomMouseUp = False self.FullScreen_status = True # 主音量加減按鈕 if self.MainVolume_Plus.bottomMouseUp: self.MainVolume_Plus.bottomMouseUp = False self.MainVolume_now += 1 elif self.MainVolume_Subtract.bottomMouseUp: self.MainVolume_Subtract.bottomMouseUp = False self.MainVolume_now -= 1 # 音樂音量加減按鈕 if self.MusicVolume_Plus.bottomMouseUp: self.MusicVolume_Plus.bottomMouseUp = False self.MusicVolume_now += 1 elif self.MusicVolume_Subtract.bottomMouseUp: self.MusicVolume_Subtract.bottomMouseUp = False self.MusicVolume_now -= 1 # 確認按鈕 if self.confirm_Buttom.bottomMouseUp: self.confirm_Buttom.bottomMouseUp = False self.settingPanel_gameConfig['ScreenWidth'] = self.ScreenImageResolution_now['Width'] self.settingPanel_gameConfig['ScreenHeight'] = self.ScreenImageResolution_now['Height'] self.settingPanel_gameConfig['FPS'] = self.ScreenFPS self.settingPanel_gameConfig['FullScreen'] = self.FullScreen_status self.settingPanel_gameConfig['MainVolume'] = self.MainVolume_now self.settingPanel_gameConfig['MusicVolume'] = self.MusicVolume_now with open(CONFIG_FILE_ADDRESS, 'wb') as gameConfigFile: pickle.dump(self.settingPanel_gameConfig, gameConfigFile) self.finishSetting = True # 套用按鈕 if self.apply_Buttom.bottomMouseUp: self.apply_Buttom.bottomMouseUp = False self.settingPanel_gameConfig['ScreenWidth'] = self.ScreenImageResolution_now['Width'] self.settingPanel_gameConfig['ScreenHeight'] = self.ScreenImageResolution_now['Height'] self.settingPanel_gameConfig['FPS'] = self.ScreenFPS self.settingPanel_gameConfig['FullScreen'] = self.FullScreen_status self.settingPanel_gameConfig['MainVolume'] = self.MainVolume_now self.settingPanel_gameConfig['MusicVolume'] = self.MusicVolume_now with open(CONFIG_FILE_ADDRESS, 'wb') as gameConfigFile: pickle.dump(self.settingPanel_gameConfig, gameConfigFile) def draw(self, surf): # 畫面 draw_text("tl", surf, "顯示", (255, 255, 255), 24, True, 130, 90) # 螢幕顯示 draw_text("tl", surf, "顯示模式", (255, 255, 255), 24, True, 130, 140) if self.FullScreen_status: draw_text("center", surf, "全螢幕", (255, 255, 255), 24, True, 890, 152) else: draw_text("center", surf, "視窗化", (255, 255, 255), 24, True, 890, 152) # 寫解析度 draw_text("tl", surf, "解析度", (255, 255, 255), 24, True, 130, 175) draw_text("center", surf, str(self.ScreenImageResolution_now['Width']) + "x" + str(self.ScreenImageResolution_now['Height']), (255, 255, 255), 24, True, 890, 187) # 幀數 draw_text("tl", surf, "幀數", (255, 255, 255), 24, True, 130, 210) draw_text("center", surf, str(self.ScreenFPS), (255, 255, 255), 24, True, 890, 222) # 聲音 draw_text("tl", surf, "聲音", (255, 255, 255), 24, True, 130, 272) # 主音量 draw_text("tl", surf, "主音量", (255, 255, 255), 24, True, 130, 322) draw_text("center", surf, str(self.MainVolume_now), (255, 255, 255), 24, True, 890, 334) # 音樂音量 draw_text("tl", surf, "音樂", (255, 255, 255), 24, True, 130, 357) draw_text("center", surf, str(self.MusicVolume_now), (255, 255, 255), 24, True, 890, 369) # 按鈕 # 顯示模式 if self.FullScreen_status: self.ScreenMode_nextOne.draw(surf) else: self.ScreenMode_lastOne.draw(surf) # 主音量 if 0 < self.MainVolume_now < 10: self.MainVolume_Plus.draw(surf) self.MainVolume_Subtract.draw(surf) elif self.MainVolume_now == 10: self.MainVolume_Subtract.draw(surf) elif self.MainVolume_now == 0: self.MainVolume_Plus.draw(surf) # 音樂音量 if 0 < self.MusicVolume_now < 10: self.MusicVolume_Plus.draw(surf) self.MusicVolume_Subtract.draw(surf) elif self.MusicVolume_now == 10: self.MusicVolume_Subtract.draw(surf) elif self.MusicVolume_now == 0: self.MusicVolume_Plus.draw(surf) # 確認 self.confirm_Buttom.draw(surf) # 套用 self.apply_Buttom.draw(surf) def draw_gameStatisticsScreen(surf): with open(GAMESAVE_FILE_ADDRESS, 'rb') as gamesave: gamesave_content = pickle.load(gamesave) if not SPECIAL_VERSION: screen.blit(image_background_gameStatistics, (0, 0)) # Tittle draw_text("center", surf, Screen_display_tittle["main"], (250, 250, 250), 64, True, WIDTH / 2, (HEIGHT / 10) + 8) # version draw_text("bl", screen, VERSION, (180, 180, 180), 18, True, 10, 715) # scoreList draw_text("tl", surf, "遊玩總時長", (250, 250, 250), 26, False, 80, 150) draw_text("tl", surf, str(gamesave_content['PlayTime_total']), (250, 250, 250), 24, False, 230, 152) draw_text("tl", surf, "遊戲難度", (250, 250, 250), 26, False, 530, 150) if gamesave_content['difficult'] == "easy": draw_text("tl", surf, "簡單", (250, 250, 250), 24, False, 680, 152) if gamesave_content['difficult'] == "normal": draw_text("tl", surf, "普通", (250, 250, 250), 24, False, 680, 152) if gamesave_content['difficult'] == "hard": draw_text("tl", surf, "困難", (250, 250, 250), 24, False, 680, 152) draw_text("tl", surf, "遊戲進度", (250, 250, 250), 26, False, 960, 150) if gamesave_content['PassGame']: draw_text("tl", surf, "通關", (250, 250, 250), 24, False, 1110, 152) # 重完選項 draw_text("tl", surf, "重新挑戰", (250, 250, 250), 26, True, 80, 410) else: draw_text("tl", surf, "努力中", (250, 250, 250), 24, False, 1110, 152) # 第一關 draw_text("tl", surf, "第一關", (250, 250, 250), 26, True, 80, 190) draw_text("tl", surf, "遊玩時長", (250, 250, 250), 26, False, 80, 230) draw_text("tl", surf, str(gamesave_content['PlayTime_Level_1']), (250, 250, 250), 24, False, 230, 232) draw_text("tl", surf, "遊玩總時長", (250, 250, 250), 26, False, 80, 265) draw_text("tl", surf, str(gamesave_content['PlayTime_Level_1_total']), (250, 250, 250), 24, False, 230, 267) draw_text("tl", surf, "分數", (250, 250, 250), 26, False, 80, 300) draw_text("tl", surf, str(gamesave_content['Score_Level_1']), (250, 250, 250), 24, False, 230, 302) draw_text("tl", surf, "最高", (250, 250, 250), 26, False, 80, 335) draw_text("tl", surf, str(gamesave_content['history_HighestScore_Level_1']), (250, 250, 250), 24, False, 230, 337) # 第二關 draw_text("tl", surf, "第二關", (250, 250, 250), 26, True, 530, 190) draw_text("tl", surf, "遊玩時長", (250, 250, 250), 26, False, 530, 230) draw_text("tl", surf, str(gamesave_content['PlayTime_Level_2']), (250, 250, 250), 24, False, 680, 232) draw_text("tl", surf, "遊玩總時長", (250, 250, 250), 26, False, 530, 265) draw_text("tl", surf, str(gamesave_content['PlayTime_Level_2_total']), (250, 250, 250), 24, False, 680, 267) draw_text("tl", surf, "分數", (250, 250, 250), 26, False, 530, 300) draw_text("tl", surf, str(gamesave_content['Score_Level_2']), (250, 250, 250), 24, False, 680, 302) draw_text("tl", surf, "最高", (250, 250, 250), 26, False, 530, 335) draw_text("tl", surf, str(gamesave_content['history_HighestScore_Level_2']), (250, 250, 250), 24, False, 680, 337) # 第三關 draw_text("tl", surf, "第三關", (250, 250, 250), 26, True, 960, 190) draw_text("tl", surf, "遊玩時長", (250, 250, 250), 26, False, 960, 230) draw_text("tl", surf, str(gamesave_content['PlayTime_Level_3']), (250, 250, 250), 24, False, 1110, 232) draw_text("tl", surf, "遊玩總時長", (250, 250, 250), 26, False, 960, 265) draw_text("tl", surf, str(gamesave_content['PlayTime_Level_3_total']), (250, 250, 250), 24, False, 1110, 267) draw_text("tl", surf, "分數", (250, 250, 250), 26, False, 960, 300) draw_text("tl", surf, str(gamesave_content['Score_Level_3']), (250, 250, 250), 24, False, 1110, 302) draw_text("tl", surf, "最高", (250, 250, 250), 26, False, 960, 335) draw_text("tl", surf, str(gamesave_content['history_HighestScore_Level_3']), (250, 250, 250), 24, False, 1110, 337) else: screen.blit(image_background_gameStatistics_special, (0, 0)) # Tittle draw_text("center", surf, Screen_display_tittle["main"], (250, 250, 250), 64, True, WIDTH / 2, (HEIGHT / 10) + 8) # version draw_text("bl", screen, VERSION, (180, 180, 180), 18, True, 10, 715) # scoreList draw_text("tl", surf, "遊玩總時長", (250, 250, 250), 26, False, 80, 150) draw_text("tl", surf, str(gamesave_content['PlayTime_total']), (250, 250, 250), 24, False, 230, 152) draw_text("tl", surf, "遊戲難度", (250, 250, 250), 26, False, 530, 150) if gamesave_content['difficult'] == "easy": draw_text("tl", surf, "簡單", (250, 250, 250), 24, False, 680, 152) if gamesave_content['difficult'] == "normal": draw_text("tl", surf, "普通", (250, 250, 250), 24, False, 680, 152) if gamesave_content['difficult'] == "hard": draw_text("tl", surf, "困難", (250, 250, 250), 24, False, 680, 152) draw_text("tl", surf, "遊戲進度", (250, 250, 250), 26, False, 960, 150) if gamesave_content['PassGame']: draw_text("tl", surf, "通關", (250, 250, 250), 24, False, 1110, 152) # 重完選項 draw_text("tl", surf, "重新挑戰", (250, 250, 250), 26, True, 80, 410) else: draw_text("tl", surf, "努力中", (250, 250, 250), 24, False, 1110, 152) # 第一關 draw_text("tl", surf, "第一關", (250, 250, 250), 26, True, 80, 190) draw_text("tl", surf, "遊玩時長", (250, 250, 250), 26, False, 80, 230) draw_text("tl", surf, str(gamesave_content['PlayTime_Level_1']), (250, 250, 250), 24, False, 230, 232) draw_text("tl", surf, "遊玩總時長", (250, 250, 250), 26, False, 80, 265) draw_text("tl", surf, str(gamesave_content['PlayTime_Level_1_total']), (250, 250, 250), 24, False, 230, 267) draw_text("tl", surf, "分數", (250, 250, 250), 26, False, 80, 300) draw_text("tl", surf, str(gamesave_content['Score_Level_1']), (250, 250, 250), 24, False, 230, 302) draw_text("tl", surf, "最高", (250, 250, 250), 26, False, 80, 335) draw_text("tl", surf, str(gamesave_content['history_HighestScore_Level_1']), (250, 250, 250), 24, False, 230, 337) # 第二關 draw_text("tl", surf, "第二關", (250, 250, 250), 26, True, 530, 190) draw_text("tl", surf, "遊玩時長", (250, 250, 250), 26, False, 530, 230) draw_text("tl", surf, str(gamesave_content['PlayTime_Level_2']), (250, 250, 250), 24, False, 680, 232) draw_text("tl", surf, "遊玩總時長", (250, 250, 250), 26, False, 530, 265) draw_text("tl", surf, str(gamesave_content['PlayTime_Level_2_total']), (250, 250, 250), 24, False, 680, 267) draw_text("tl", surf, "分數", (250, 250, 250), 26, False, 530, 300) draw_text("tl", surf, str(gamesave_content['Score_Level_2']), (250, 250, 250), 24, False, 680, 302) draw_text("tl", surf, "最高", (250, 250, 250), 26, False, 530, 335) draw_text("tl", surf, str(gamesave_content['history_HighestScore_Level_2']), (250, 250, 250), 24, False, 680, 337) # 第三關 draw_text("tl", surf, "第三關", (250, 250, 250), 26, True, 960, 190) draw_text("tl", surf, "遊玩時長", (250, 250, 250), 26, False, 960, 230) draw_text("tl", surf, str(gamesave_content['PlayTime_Level_3']), (250, 250, 250), 24, False, 1110, 232) draw_text("tl", surf, "遊玩總時長", (250, 250, 250), 26, False, 960, 265) draw_text("tl", surf, str(gamesave_content['PlayTime_Level_3_total']), (250, 250, 250), 24, False, 1110, 267) draw_text("tl", surf, "分數", (250, 250, 250), 26, False, 960, 300) draw_text("tl", surf, str(gamesave_content['Score_Level_3']), (250, 250, 250), 24, False, 1110, 302) draw_text("tl", surf, "最高", (250, 250, 250), 26, False, 960, 335) draw_text("tl", surf, str(gamesave_content['history_HighestScore_Level_3']), (250, 250, 250), 24, False, 1110, 337) # 按鈕 def startPlayGame_Button_function(surf): running = True alreadyReadGameSave = False exitLoop = False while running and not alreadyReadGameSave: clock.tick(FPS) # 檢查是否有遊戲存檔 if not os.path.isfile(GAMESAVE_FILE_ADDRESS): select_difficult = True # 回主選單 mainMenu_Button = SettingPanel_ArrowButton(WIDTH - 120, HEIGHT - 52, "主選單", 28, (0, 0, 0), False, button_background_image_normal, button_background_image_move, button_background_image_down, text_font) # 難度按鈕 easy_difficult_Button = SettingPanel_ArrowButton(WIDTH / 2, 255, "簡單", 28, (0, 0, 0), False, button_background_image_normal, button_background_image_move, button_background_image_down, text_font) normal_difficult_Button = SettingPanel_ArrowButton(WIDTH / 2, 339, "普通", 28, (0, 0, 0), False, button_background_image_normal, button_background_image_move, button_background_image_down, text_font) hard_difficult_Button = SettingPanel_ArrowButton(WIDTH / 2, 423, "困難", 28, (0, 0, 0), False, button_background_image_normal, button_background_image_move, button_background_image_down, text_font) while select_difficult: clock.tick(FPS) # 獲得滑鼠座標 mouse_x, mouse_y = pygame.mouse.get_pos() # 檢查事件 for event in pygame.event.get(): if event.type == pygame.QUIT: select_difficult = False running = False break # 滑鼠移動事件 elif event.type == pygame.MOUSEMOTION: # 判斷滑鼠是否移動到按鈕範圍內 easy_difficult_Button.getFocus(mouse_x, mouse_y) normal_difficult_Button.getFocus(mouse_x, mouse_y) hard_difficult_Button.getFocus(mouse_x, mouse_y) mainMenu_Button.getFocus(mouse_x, mouse_y) # 滑鼠按下 elif event.type == pygame.MOUSEBUTTONDOWN: #滑鼠左鍵按下 if pygame.mouse.get_pressed() == (1, 0, 0): easy_difficult_Button.mouseDown(mouse_x, mouse_y) normal_difficult_Button.mouseDown(mouse_x, mouse_y) hard_difficult_Button.mouseDown(mouse_x, mouse_y) mainMenu_Button.mouseDown(mouse_x, mouse_y) # 滑鼠彈起 elif event.type == pygame.MOUSEBUTTONUP: easy_difficult_Button.mouseUp() normal_difficult_Button.mouseUp() hard_difficult_Button.mouseUp() mainMenu_Button.mouseUp() # 難度按鈕 if easy_difficult_Button.bottomMouseUp: break if normal_difficult_Button.bottomMouseUp: break if hard_difficult_Button.bottomMouseUp: break # 主畫面按鈕 if mainMenu_Button.bottomMouseUp: break # 畫面 surf.blit(main_screen_background["main"], (0, 0)) draw_text("center", surf, "選擇存檔難度", (240, 240, 240), 36, False, (WIDTH / 2), 162) easy_difficult_Button.draw(surf) normal_difficult_Button.draw(surf) hard_difficult_Button.draw(surf) mainMenu_Button.draw(surf) pygame.display.update() if easy_difficult_Button.bottomMouseUp or normal_difficult_Button.bottomMouseUp or hard_difficult_Button.bottomMouseUp: # 建立所有遊戲需儲存參數 gamesave_content = {} gamesave_content['game_checkpoint'] = 0 gamesave_content['difficult'] = "normal" gamesave_content['Score_Level_1'] = 0 gamesave_content['Score_Level_2'] = 0 gamesave_content['Score_Level_3'] = 0 gamesave_content['history_HighestScore_Level_1'] = 0 gamesave_content['history_HighestScore_Level_2'] = 0 gamesave_content['history_HighestScore_Level_3'] = 0 gamesave_content['PlayTime_Level_1'] = 0 gamesave_content['PlayTime_Level_2'] = 0 gamesave_content['PlayTime_Level_3'] = 0 gamesave_content['PlayTime_total'] = 0 gamesave_content['PlayTime_Level_1_total'] = 0 gamesave_content['PlayTime_Level_2_total'] = 0 gamesave_content['PlayTime_Level_3_total'] = 0 gamesave_content['PassGame'] = False # 難度調整 if easy_difficult_Button.bottomMouseUp: easy_difficult_Button.bottomMouseUp = False gamesave_content['difficult'] = "easy" elif normal_difficult_Button.bottomMouseUp: normal_difficult_Button.bottomMouseUp = False gamesave_content['difficult'] = "normal" elif hard_difficult_Button.bottomMouseUp: hard_difficult_Button.bottomMouseUp = False gamesave_content['difficult'] = "hard" # 將參數存到文件中 with open(GAMESAVE_FILE_ADDRESS, 'wb') as gamesave: pickle.dump(gamesave_content, gamesave) select_difficult = False running = False return gamesave_content elif mainMenu_Button.bottomMouseUp: select_difficult = False mainMenu_Button.bottomMouseUp = False break elif not alreadyReadGameSave: def loadSave_Button_function(): return True def removeSave_Button_function(): os.remove(GAMESAVE_FILE_ADDRESS) # 是否要讀檔 loadSave_Button = Button((WIDTH / 2), (HEIGHT / 2), ("讀檔"), 28, (0, 0, 0), False, button_background_image_normal, button_background_image_move, button_background_image_down, loadSave_Button_function, text_font) removeSave_Button = Button((WIDTH / 2), 260 * (HEIGHT / 720), ("開始新遊戲"), 28, (0, 0, 0), False, button_background_image_normal, button_background_image_move, button_background_image_down, removeSave_Button_function, text_font) # 回主選單 mainMenu_Button = SettingPanel_ArrowButton(WIDTH - 220, HEIGHT - 85, "主選單", 28, (0, 0, 0), False, button_background_image_normal, button_background_image_move, button_background_image_down, text_font) while os.path.isfile(GAMESAVE_FILE_ADDRESS) and not exitLoop: clock.tick(FPS) # 獲得滑鼠座標 mouse_x, mouse_y = pygame.mouse.get_pos() # 檢查事件 for event in pygame.event.get(): if event.type == pygame.QUIT: exitLoop = True running = False break # 滑鼠移動事件 elif event.type == pygame.MOUSEMOTION: # 判斷滑鼠是否移動到按鈕範圍內 loadSave_Button.getFocus(mouse_x, mouse_y) removeSave_Button.getFocus(mouse_x, mouse_y) mainMenu_Button.getFocus(mouse_x, mouse_y) # 滑鼠按下 elif event.type == pygame.MOUSEBUTTONDOWN: #滑鼠左鍵按下 if pygame.mouse.get_pressed() == (1, 0, 0): loadSave_Button.mouseDown(mouse_x, mouse_y) removeSave_Button.mouseDown(mouse_x, mouse_y) mainMenu_Button.mouseDown(mouse_x, mouse_y) # 滑鼠彈起 elif event.type == pygame.MOUSEBUTTONUP: if loadSave_Button.status == Button.DOWN: if loadSave_Button.mouseUp(): # 讀取存檔中的參數 with open(GAMESAVE_FILE_ADDRESS, 'rb') as gamesave: gamesave_content = pickle.load(gamesave) alreadyReadGameSave = True removeSave_Button.mouseUp() mainMenu_Button.mouseUp() if alreadyReadGameSave: break if mainMenu_Button.bottomMouseUp: break # 畫面 surf.blit(main_screen_background["main"], (0, 0)) draw_text("center", surf, "是否要讀取存檔", (240, 240, 240), 36, False, (WIDTH / 2), (HEIGHT / 5) + 18) loadSave_Button.draw(surf) removeSave_Button.draw(surf) mainMenu_Button.draw(surf) pygame.display.update() if alreadyReadGameSave: running = False return gamesave_content if mainMenu_Button.bottomMouseUp: mainMenu_Button.bottomMouseUp = False break def gameSetting_Button_function(surf): running = True setting_Panel = settingPanel() while running: clock.tick(FPS) mouse_x, mouse_y = pygame.mouse.get_pos() # 檢查事件 for event in pygame.event.get(): if event.type == pygame.QUIT: running = False break # 滑鼠移動事件 elif event.type == pygame.MOUSEMOTION: # 判斷滑鼠是否移動到按鈕範圍內 # 顯示模式 if setting_Panel.FullScreen_status: setting_Panel.ScreenMode_nextOne.getFocus(mouse_x, mouse_y) else: setting_Panel.ScreenMode_lastOne.getFocus(mouse_x, mouse_y) # 主音量 if 0 < setting_Panel.MainVolume_now < 10: setting_Panel.MainVolume_Plus.getFocus(mouse_x, mouse_y) setting_Panel.MainVolume_Subtract.getFocus(mouse_x, mouse_y) elif setting_Panel.MainVolume_now == 10: setting_Panel.MainVolume_Subtract.getFocus(mouse_x, mouse_y) elif setting_Panel.MainVolume_now == 0: setting_Panel.MainVolume_Plus.getFocus(mouse_x, mouse_y) # 音樂音量 if 0 < setting_Panel.MusicVolume_now < 10: setting_Panel.MusicVolume_Plus.getFocus(mouse_x, mouse_y) setting_Panel.MusicVolume_Subtract.getFocus(mouse_x, mouse_y) elif setting_Panel.MusicVolume_now == 10: setting_Panel.MusicVolume_Subtract.getFocus(mouse_x, mouse_y) elif setting_Panel.MusicVolume_now == 0: setting_Panel.MusicVolume_Plus.getFocus(mouse_x, mouse_y) # 確認 setting_Panel.confirm_Buttom.getFocus(mouse_x, mouse_y) # 套用 setting_Panel.apply_Buttom.getFocus(mouse_x, mouse_y) # 滑鼠按下 elif event.type == pygame.MOUSEBUTTONDOWN: #滑鼠左鍵按下 if pygame.mouse.get_pressed() == (1, 0, 0): # 顯示模式 if setting_Panel.FullScreen_status: setting_Panel.ScreenMode_nextOne.mouseDown(mouse_x, mouse_y) else: setting_Panel.ScreenMode_lastOne.mouseDown(mouse_x, mouse_y) # 主音量 if 0 < setting_Panel.MainVolume_now < 10: setting_Panel.MainVolume_Plus.mouseDown(mouse_x, mouse_y) setting_Panel.MainVolume_Subtract.mouseDown(mouse_x, mouse_y) elif setting_Panel.MainVolume_now == 10: setting_Panel.MainVolume_Subtract.mouseDown(mouse_x, mouse_y) elif setting_Panel.MainVolume_now == 0: setting_Panel.MainVolume_Plus.mouseDown(mouse_x, mouse_y) # 音樂音量 if 0 < setting_Panel.MusicVolume_now < 10: setting_Panel.MusicVolume_Plus.mouseDown(mouse_x, mouse_y) setting_Panel.MusicVolume_Subtract.mouseDown(mouse_x, mouse_y) elif setting_Panel.MusicVolume_now == 10: setting_Panel.MusicVolume_Subtract.mouseDown(mouse_x, mouse_y) elif setting_Panel.MusicVolume_now == 0: setting_Panel.MusicVolume_Plus.mouseDown(mouse_x, mouse_y) # 確認 setting_Panel.confirm_Buttom.mouseDown(mouse_x, mouse_y) # 套用 setting_Panel.apply_Buttom.mouseDown(mouse_x, mouse_y) # 滑鼠彈起 elif event.type == pygame.MOUSEBUTTONUP: setting_Panel.ScreenMode_nextOne.mouseUp() setting_Panel.ScreenMode_lastOne.mouseUp() setting_Panel.MainVolume_Plus.mouseUp() setting_Panel.MainVolume_Subtract.mouseUp() setting_Panel.MusicVolume_Plus.mouseUp() setting_Panel.MusicVolume_Subtract.mouseUp() setting_Panel.confirm_Buttom.mouseUp() setting_Panel.apply_Buttom.mouseUp() setting_Panel.updateData() if setting_Panel.finishSetting: running = False # 畫面 # 背景 surf.blit(main_screen_background['main'], (0, 0)) surf.blit(image_setting_panel_background, (0, 0)) setting_Panel.draw(surf) pygame.display.update() if setting_Panel.finishSetting: setting_Panel.finishSetting = False return True def leaveGame_Button_function(): return True class Button: NORMAL = 0 MOVE = 1 DOWN = 2 def __init__(self, center_x, center_y, text, text_size ,text_color, text_bold, imageNormal, imageMove = None, imageDown = None, callBackFunction = None, font = None): self.button_images = [] if not imageNormal: raise Exception("請設定普通狀態的圖片") self.button_images.append(imageNormal) self.button_images.append(imageMove) self.button_images.append(imageDown) for i in range(2, 0, -1): if not self.button_images[i]: self.button_images[i] = self.button_images[i - 1] self.callBackFunction = callBackFunction self.status = Button.NORMAL self.button_image_width = imageNormal.get_width() self.button_image_height = imageNormal.get_height() self.center_x = center_x self.center_y = center_y self.x = self.center_x - (self.button_image_width / 2) self.y = self.center_y - (self.button_image_height / 2) self.text = text self.text_size = text_size self.text_color = text_color self.text_bold = text_bold self.font = font def draw(self, surf): # 畫按鈕背景 if self.button_images[self.status]: surf.blit(self.button_images[self.status], (self.x, self.y)) # 畫文字 draw_text("center", surf, self.text, self.text_color, self.text_size, self.text_bold, self.center_x, self.center_y) def colli(self, x, y): # 碰撞檢測 if self.x < x < self.x + self.button_image_width and self.y < y < self.y + self.button_image_height: return True else: return False def getFocus(self, x, y): # 按鈕獲得焦點時 if self.status == Button.DOWN: return if self.colli(x, y): self.status = Button.MOVE else: self.status = Button.NORMAL def mouseDown(self, x, y): if self.colli(x, y): self.status = Button.DOWN def mouseUp(self): # 如果按鈕彈起則還原成普通狀態 if self.status == Button.DOWN: self.status = Button.NORMAL if self.callBackFunction: return self.callBackFunction() class startPlayGameButton: NORMAL = 0 MOVE = 1 DOWN = 2 game_save = {} def __init__(self, center_x, center_y, text, text_size ,text_color, text_bold, imageNormal, imageMove = None, imageDown = None, font = None): self.button_images = [] if not imageNormal: raise Exception("請設定普通狀態的圖片") self.button_images.append(imageNormal) self.button_images.append(imageMove) self.button_images.append(imageDown) for i in range(2, 0, -1): if not self.button_images[i]: self.button_images[i] = self.button_images[i - 1] self.status = Button.NORMAL self.button_image_width = imageNormal.get_width() self.button_image_height = imageNormal.get_height() self.center_x = center_x self.center_y = center_y self.x = self.center_x - (self.button_image_width / 2) self.y = self.center_y - (self.button_image_height / 2) self.text = text self.text_size = text_size self.text_color = text_color self.text_bold = text_bold self.font = font def draw(self, surf): # 畫按鈕背景 if self.button_images[self.status]: surf.blit(self.button_images[self.status], (self.x, self.y)) # 畫文字 draw_text("center", surf, self.text, self.text_color, self.text_size, self.text_bold, self.center_x, self.center_y) def colli(self, x, y): # 碰撞檢測 if self.x < x < self.x + self.button_image_width and self.y < y < self.y + self.button_image_height: return True else: return False def getFocus(self, x, y): # 按鈕獲得焦點時 if self.status == Button.DOWN: return if self.colli(x, y): self.status = Button.MOVE else: self.status = Button.NORMAL def mouseDown(self, x, y): if self.colli(x, y): self.status = Button.DOWN def mouseUp(self, surf): # 如果按鈕彈起則還原成普通狀態 if self.status == Button.DOWN: self.status = Button.NORMAL self.game_save = startPlayGame_Button_function(surf) if self.game_save: return True class gameSettingButton: NORMAL = 0 MOVE = 1 DOWN = 2 def __init__(self, surf, center_x, center_y, text, text_size ,text_color, text_bold, imageNormal, imageMove = None, imageDown = None, font = None): self.button_images = [] if not imageNormal: raise Exception("請設定普通狀態的圖片") self.button_images.append(imageNormal) self.button_images.append(imageMove) self.button_images.append(imageDown) for i in range(2, 0, -1): if not self.button_images[i]: self.button_images[i] = self.button_images[i - 1] self.status = Button.NORMAL self.surf = surf self.button_image_width = imageNormal.get_width() self.button_image_height = imageNormal.get_height() self.center_x = center_x self.center_y = center_y self.x = self.center_x - (self.button_image_width / 2) self.y = self.center_y - (self.button_image_height / 2) self.text = text self.text_size = text_size self.text_color = text_color self.text_bold = text_bold self.font = font def draw(self, surf): # 畫按鈕背景 if self.button_images[self.status]: surf.blit(self.button_images[self.status], (self.x, self.y)) # 畫文字 draw_text("center", surf, self.text, self.text_color, self.text_size, self.text_bold, self.center_x, self.center_y) def colli(self, x, y): # 碰撞檢測 if self.x < x < self.x + self.button_image_width and self.y < y < self.y + self.button_image_height: return True else: return False def getFocus(self, x, y): # 按鈕獲得焦點時 if self.status == Button.DOWN: return if self.colli(x, y): self.status = Button.MOVE else: self.status = Button.NORMAL def mouseDown(self, x, y): if self.colli(x, y): self.status = Button.DOWN def mouseUp(self): # 如果按鈕彈起則還原成普通狀態 if self.status == Button.DOWN: self.status = Button.NORMAL result = gameSetting_Button_function(self.surf) if result: return True class SettingPanel_ArrowButton: NORMAL = 0 MOVE = 1 DOWN = 2 def __init__(self, center_x, center_y, text, text_size ,text_color, text_bold, imageNormal, imageMove = None, imageDown = None, font = None): self.button_images = [] if not imageNormal: raise Exception("請設定普通狀態的圖片") self.button_images.append(imageNormal) self.button_images.append(imageMove) self.button_images.append(imageDown) for i in range(2, 0, -1): if not self.button_images[i]: self.button_images[i] = self.button_images[i - 1] self.status = Button.NORMAL self.button_image_width = imageNormal.get_width() self.button_image_height = imageNormal.get_height() self.center_x = center_x self.center_y = center_y self.x = self.center_x - (self.button_image_width / 2) self.y = self.center_y - (self.button_image_height / 2) self.text = text self.text_size = text_size self.text_color = text_color self.text_bold = text_bold self.font = font self.bottomMouseUp = False def draw(self, surf): # 畫按鈕背景 if self.button_images[self.status]: surf.blit(self.button_images[self.status], (self.x, self.y)) # 畫文字 draw_text("center", surf, self.text, self.text_color, self.text_size, self.text_bold, self.center_x, self.center_y) def colli(self, x, y): # 碰撞檢測 if self.x < x < self.x + self.button_image_width and self.y < y < self.y + self.button_image_height: return True else: return False def getFocus(self, x, y): # 按鈕獲得焦點時 if self.status == Button.DOWN: return if self.colli(x, y): self.status = Button.MOVE else: self.status = Button.NORMAL def mouseDown(self, x, y): if self.colli(x, y): self.status = Button.DOWN def mouseUp(self): # 如果按鈕彈起則還原成普通狀態 if self.status == Button.DOWN: self.status = Button.NORMAL self.bottomMouseUp = True # 第一關 def Level_1_draw_levelTrip(): screen.blit(image_background_level1Trip, (0, 0)) draw_text("tl", screen, '鎮守前線', (255, 255, 255), 48, True, 40 * (WIDTH / 1280), 46 * (HEIGHT / 720)) draw_text("tl", screen, '2087年在地球發生了一場全球性的襲擊', (255, 255, 255), 22, False, 45 * (WIDTH / 1280), 136 * (HEIGHT / 720)) draw_text("tl", screen, '戰場遍佈在地球的各個角落', (255, 255, 255), 22, False, 45 * (WIDTH / 1280), 168 * (HEIGHT / 720)) draw_text("tl", screen, '臺灣', (255, 255, 255), 32, True, 45 * (WIDTH / 1280), 218 * (HEIGHT / 720)) draw_text("tl", screen, '指揮部派遣ASSC前往受到襲擊的現場進行偵查行動', (255, 255, 255), 22, False, 45 * (WIDTH / 1280), 264 * (HEIGHT / 720)) draw_text("tl", screen, 'ASSC到達現場後發現在前線鎮守的部隊僅剩下一個連隊', (255, 255, 255), 22, False, 45 * (WIDTH / 1280), 296 * (HEIGHT / 720)) draw_text("tl", screen, '指揮部命令ASSC協助當地部隊鎮守前線等待支援', (255, 255, 255), 22, False, 45 * (WIDTH / 1280), 328 * (HEIGHT / 720)) draw_text("center", screen, 'WASD 或 ↑←↓→ 操控方向', (255, 255, 255), 16, False, WIDTH / 2, (580 * (HEIGHT / 720)) + 8) draw_text("center", screen, '左鍵 進行射擊 R鍵 換彈 B鍵 切換射擊模式', (255, 255, 255), 16, False, WIDTH / 2, (610 * (HEIGHT / 720)) + 8) draw_text("center", screen, '按任意鍵開始', (255, 255, 255), 16, False, WIDTH / 2, (640 * (HEIGHT / 720)) + 8) pygame.display.update() waiting = True while waiting: clock.tick(FPS) # 取得輸入 for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() return True elif event.type == pygame.KEYUP: waiting = False return False def Level_1_choice_spawnArea(): # 左上 => spawnArea = 1 # 左中 => spawnArea = 2 # 左下 => spawnArea = 3 # 右上 => spawnArea = 4 # 右中 => spawnArea = 5 # 右下 => spawnArea = 6 spawnArea = random.randint(1, 6) if spawnArea == 1: return (random.randrange(0, 640), random.randrange(0, 240)) elif spawnArea == 2: return (random.randrange(0, 520), random.randrange(240, 480)) elif spawnArea == 3: return (random.randrange(0, 640), random.randrange(480, 720)) elif spawnArea == 4: return (random.randrange(640, 1280), random.randrange(0, 240)) elif spawnArea == 5: return (random.randrange(760, 1280), random.randrange(240, 480)) elif spawnArea == 6: return (random.randrange(640, 1280), random.randrange(480, 720)) class Level_1_Player_soldier(pygame.sprite.Sprite): def __init__(self, surf): pygame.sprite.Sprite.__init__(self) self.surf = surf self.image_original = image_player_soldier['Right'][0] self.image = self.image_original.copy() self.rect = self.image.get_rect() # self.radius = 15 self.rect.centerx = WIDTH / 2 self.rect.centery = HEIGHT / 2 # 移動速度 self.speed = 3 self.speed_oblique = ((self.speed** 2) / 2)** 0.5 # 血量 self.health = 100 self.now_health = self.health # 護甲 self.armor = 100 self.now_armor = self.armor # 生命數 self.lives = 0 # 傷害百分比 self.damageMagnification = 1 # 彈匣彈量 self.magazine_bullets_original = 30 self.magazine_bullets = self.magazine_bullets_original self.last_magazine_bullets = self.magazine_bullets # 射擊模式: auto, single self.shoot_mode = "auto" # auto模式下射擊速度 self.shooting_interval = 300 # reload所需時間 self.reloadtime = 2800 # 上次射擊時間 self.last_shoot_time = 0 # 上次重新裝填時間 self.last_reloadtime = 0 self.hidden = False self.hide_time = 0 # 方向 self.direction = "Right" self.last_direction = self.direction self.image_frame = 0 self.changeImageTime = 100 self.lastChangeImageTime = pygame.time.get_ticks() self.pressed_reload_key = False self.startReloadBullet = False self.play_reload_sound = False if GameSave_content['difficult'] == "easy": self.health *= 1.2 self.now_health = self.health self.lives = 2 self.damageMagnification = self.damageMagnification * 1.2 elif GameSave_content['difficult'] == "normal": self.health *= 1 self.now_health = self.health self.lives = 1 self.damageMagnification = self.damageMagnification * 1 elif GameSave_content['difficult'] == "hard": self.health *= 1 self.now_health = self.health self.lives = 0 self.damageMagnification = self.damageMagnification * 0.8 def update(self): now = pygame.time.get_ticks() # 取得鍵盤輸入 key_pressed = pygame.key.get_pressed() # # 左上 # if key_pressed[pygame.K_w] and key_pressed[pygame.K_a]: # self.direction = "Left" # self.rotate() # self.rect.x -= self.speed_oblique # self.rect.y -= self.speed_oblique # # 右上 # elif key_pressed[pygame.K_w] and key_pressed[pygame.K_d]: # self.direction = "Right" # self.rotate() # self.rect.x += self.speed_oblique # self.rect.y -= self.speed_oblique # # 左下 # elif key_pressed[pygame.K_s] and key_pressed[pygame.K_a]: # self.direction = "Left" # self.rotate() # self.rect.x -= self.speed_oblique # self.rect.y += self.speed_oblique # # 右下 # elif key_pressed[pygame.K_s] and key_pressed[pygame.K_d]: # self.direction = "Right" # self.rotate() # self.rect.x += self.speed_oblique # self.rect.y += self.speed_oblique # 上 if key_pressed[pygame.K_w] or key_pressed[pygame.K_UP]: self.rotate() self.rect.y -= self.speed # 左 elif key_pressed[pygame.K_a] or key_pressed[pygame.K_LEFT]: # if self.direction != "Right": # self.direction = "Left" self.rotate() self.rect.x -= self.speed # 下 elif key_pressed[pygame.K_s] or key_pressed[pygame.K_DOWN]: self.rotate() self.rect.y += self.speed # 右 elif key_pressed[pygame.K_d] or key_pressed[pygame.K_RIGHT]: # if self.direction != "Right": # self.direction = "Right" self.rotate() self.rect.x += self.speed # if key_pressed[pygame.K_SPACE]: # if now - self.last_shoot_time >= self.shooting_interval and self.shoot_mode == "auto": # self.shoot() if key_pressed[pygame.K_r] and not self.pressed_reload_key: self.pressed_reload_key = True self.reload() # 取得滑鼠位置 self.mouse_x, self.mouse_y = pygame.mouse.get_pos() self.difference_x = self.mouse_x - self.rect.centerx self.difference_y = self.mouse_y - self.rect.centery # 角色方向 # 第一象限 if self.difference_x > 0 and self.difference_y < 0: if self.direction != "Right": self.direction = "Right" # 第二象限 elif self.difference_x < 0 and self.difference_y < 0: if self.direction != "Left": self.direction = "Left" # 第三象限 elif self.difference_x < 0 and self.difference_y > 0: if self.direction != "Left": self.direction = "Left" # 第四象限 elif self.difference_x > 0 and self.difference_y > 0: if self.direction != "Right": self.direction = "Right" # 重生前的隱身 if self.hidden and now - self.hide_time > 1000: self.hidden = False self.rect.center = (WIDTH / 2, HEIGHT / 2) # 將角色控制在邊界 if self.rect.top < 0: self.rect.top = 0 if self.rect.left < 0: self.rect.left = 0 if self.rect.bottom > HEIGHT and not self.hidden: self.rect.bottom = HEIGHT if self.rect.right > WIDTH: self.rect.right = WIDTH # 重新裝填彈藥 self.reload() def rotate(self): now = pygame.time.get_ticks() if self.last_direction == self.direction and now - self.lastChangeImageTime > self.changeImageTime: if self.direction == "Left": centery = self.rect.centery left = self.rect.left self.image = image_player_soldier[self.direction][self.image_frame] self.rect = self.image.get_rect() self.rect.centery = centery self.rect.left = left self.last_direction = self.direction if self.image_frame == 2: self.image_frame = 0 else: self.image_frame += 1 self.lastChangeImageTime = now elif self.direction == "Right": centery = self.rect.centery right = self.rect.right self.image = image_player_soldier[self.direction][self.image_frame] self.rect = self.image.get_rect() self.rect.centery = centery self.rect.right = right self.last_direction = self.direction if self.image_frame == 2: self.image_frame = 0 else: self.image_frame += 1 self.lastChangeImageTime = now elif self.last_direction != self.direction: center = self.rect.center self.image = image_player_soldier[self.direction][0] self.image_frame = 1 self.rect = self.image.get_rect() self.rect.center = center self.lastChangeImageTime = now self.last_direction = self.direction def reload(self): now = pygame.time.get_ticks() if self.last_magazine_bullets == 0 and not self.startReloadBullet: self.last_reloadtime = now self.startReloadBullet = True self.play_reload_sound = True elif self.pressed_reload_key and self.last_magazine_bullets < self.magazine_bullets and not self.startReloadBullet: self.last_reloadtime = now self.startReloadBullet = True self.last_magazine_bullets = 0 self.pressed_reload_key = True self.play_reload_sound = True elif self.pressed_reload_key and self.last_magazine_bullets >= self.magazine_bullets and not self.startReloadBullet: self.pressed_reload_key = False if self.last_magazine_bullets == 0 and now - self.last_reloadtime >= self.reloadtime - 550 and self.play_reload_sound: sound_rifle_reload.play() self.play_reload_sound = False if self.last_magazine_bullets == 0 and now - self.last_reloadtime >= self.reloadtime: self.last_magazine_bullets = self.magazine_bullets self.startReloadBullet = False if self.pressed_reload_key: self.pressed_reload_key = False if self.play_reload_sound: self.play_reload_sound = False def hide(self): self.hidden = True self.hide_time = pygame.time.get_ticks() self.rect.center = (WIDTH / 2, HEIGHT + HEIGHT) class Level_1_enemy_soldier(pygame.sprite.Sprite): def __init__(self, surf, enemy_centerx, enemy_centery, spawn_center): pygame.sprite.Sprite.__init__(self) self.surf = surf self.enemy_centerx = enemy_centerx self.enemy_centery = enemy_centery # self.image_original = pygame.Surface((45, 45)) # self.image_original.fill((255, 0, 0)) self.image_original = image_enemy_soldier['Right'][0] self.image = self.image_original.copy() self.rect = self.image.get_rect() # self.radius = 15 self.direction = "Right" self.choice_move_direction = 1 self.last_shoot_time = 0 self.startReloadBullet = False self.last_reloadtime = 0 self.hitted = False # 敵人生成點 self.rect.centerx , self.rect.centery = spawn_center # 移動速度 self.speedx = 2 self.speedy = 2 # 視野距離 self.frontView = 250 # 預設屬性 # 血量 self.health = 80 # 傷害百分比 self.damageMagnification = 1 # 剩餘子彈 self.last_moveAmount = 0 # 彈匣彈量 self.magazine_bullets_original = 30 # 射擊速度 self.shooting_interval = 450 # reload 速度 self.reloadtime = 5000 self.magazine_bullets = self.magazine_bullets_original self.last_magazine_bullets = self.magazine_bullets # 動畫設定 self.last_direction = self.direction self.image_frame = 0 self.changeImageTime = 100 self.lastChangeImageTime = pygame.time.get_ticks() # 難度 if GameSave_content['difficult'] == "easy": self.health *= 1 self.now_health = self.health self.damageMagnification *= 0.8 elif GameSave_content['difficult'] == "normal": self.health *= 1 self.now_health = self.health self.damageMagnification *= 1 elif GameSave_content['difficult'] == "hard": self.health *= 1.5 self.now_health = self.health self.damageMagnification *= 1.2 self.magazine_bullets_original = 45 self.magazine_bullets = self.magazine_bullets_original def update(self): now = pygame.time.get_ticks() # 將角色控制在邊界 if self.rect.top < 0: self.rect.top = 0 self.last_moveAmount = 0 if self.rect.left < 0: self.rect.left = 0 self.last_moveAmount = 0 if self.rect.bottom > HEIGHT: self.rect.bottom = HEIGHT self.last_moveAmount = 0 if self.rect.right > WIDTH: self.rect.right = WIDTH self.last_moveAmount = 0 self.move() if self.detect_enemy() and (now - self.last_shoot_time) >= self.shooting_interval: sound_rifle_shoot.play() self.shoot() else: self.shooting = False # 重新裝填彈藥 self.reload() def move(self): # 上 => spawnArea = 1 # 左 => spawnArea = 2 # 下 => spawnArea = 3 # 右 => spawnArea = 4 if self.last_moveAmount == 0: self.choice_move_direction = random.randint(1, 4) self.last_moveAmount += random.randint(1, 150) if self.choice_move_direction == 1: self.direction = "Up" self.rotate() self.rect.centery -= self.speedy self.last_moveAmount -= 1 elif self.choice_move_direction == 2: self.direction = "Left" self.rotate() self.rect.centerx -= self.speedx self.last_moveAmount -= 1 elif self.choice_move_direction == 3: self.direction = "Down" self.rotate() self.rect.centery += self.speedy self.last_moveAmount -= 1 elif self.choice_move_direction == 4: self.direction = "Right" self.rotate() self.rect.centerx += self.speedx self.last_moveAmount -= 1 def rotate(self): now = pygame.time.get_ticks() if self.last_direction == self.direction and now - self.lastChangeImageTime > self.changeImageTime: if self.direction == "Left": if self.image_frame >= 3: self.image_frame = 0 center = self.rect.center self.image = image_enemy_soldier[self.direction][self.image_frame] self.rect = self.image.get_rect() self.rect.center = center self.last_direction = self.direction if self.image_frame == 2: self.image_frame = 0 else: self.image_frame += 1 self.lastChangeImageTime = now elif self.direction == "Right": center = self.rect.center self.image = image_enemy_soldier[self.direction][self.image_frame] self.rect = self.image.get_rect() self.rect.center = center self.last_direction = self.direction if self.image_frame == 2: self.image_frame = 0 else: self.image_frame += 1 self.lastChangeImageTime = now elif self.direction == "Up": if now - self.lastChangeImageTime > self.changeImageTime: if self.last_direction == "Right": center = self.rect.center self.image = image_enemy_soldier[self.direction][self.image_frame] self.rect = self.image.get_rect() self.rect.center = center self.last_direction = "Right" if self.image_frame == 2: self.image_frame = 0 else: self.image_frame += 1 self.lastChangeImageTime = now elif self.last_direction == "Left": center = self.rect.center self.image = image_enemy_soldier[self.direction][self.image_frame] self.rect = self.image.get_rect() self.rect.center = center self.last_direction = "Left" if self.image_frame == 5: self.image_frame = 3 else: self.image_frame += 1 self.lastChangeImageTime = now elif self.direction == "Down": if now - self.lastChangeImageTime > self.changeImageTime: if self.last_direction == "Right": center = self.rect.center self.image = image_enemy_soldier[self.direction][self.image_frame] self.rect = self.image.get_rect() self.rect.center = center self.last_direction = "Right" if self.image_frame == 2: self.image_frame = 0 else: self.image_frame += 1 self.lastChangeImageTime = now elif self.last_direction == "Left": center = self.rect.center self.image = image_enemy_soldier[self.direction][self.image_frame] self.rect = self.image.get_rect() self.rect.center = center self.last_direction = "Left" if self.image_frame == 5: self.image_frame = 3 else: self.image_frame += 1 self.lastChangeImageTime = now elif self.last_direction != self.direction: if self.direction == "Right" or self.direction == "Left": center = self.rect.center self.image = image_enemy_soldier[self.direction][0] self.image_frame = 1 self.rect = self.image.get_rect() self.rect.center = center self.lastChangeImageTime = now self.last_direction = self.direction elif self.direction == "Up": if self.last_direction == "Right": center = self.rect.center self.image = image_enemy_soldier[self.direction][0] self.image_frame = 1 self.rect = self.image.get_rect() self.rect.center = center self.lastChangeImageTime = now elif self.last_direction == "Left": center = self.rect.center self.image = image_enemy_soldier[self.direction][3] self.image_frame = 4 self.rect = self.image.get_rect() self.rect.center = center self.lastChangeImageTime = now elif self.direction == "Down": if self.last_direction == "Right": center = self.rect.center self.image = image_enemy_soldier[self.direction][0] self.image_frame = 1 self.rect = self.image.get_rect() self.rect.center = center self.lastChangeImageTime = now elif self.last_direction == "Left": center = self.rect.center self.image = image_enemy_soldier[self.direction][3] self.image_frame = 4 self.rect = self.image.get_rect() self.rect.center = center self.lastChangeImageTime = now def shoot(self): now = pygame.time.get_ticks() if self.last_magazine_bullets > 0: self.shooting = True self.last_shoot_time = now bullet = Bullet_rifle_enemy(self.rect.centerx, self.rect.centery, self.direction) Level_1_all_sprites.add(bullet) Level_1_bullets.add(bullet) Level_1_enemy_bullets.add(bullet) self.last_magazine_bullets -= 1 def reload(self): now = pygame.time.get_ticks() # 重新裝填彈藥 if self.last_magazine_bullets == 0 and not self.startReloadBullet: self.last_reloadtime = now self.startReloadBullet = True elif self.last_magazine_bullets <= 10 and not self.startReloadBullet and not self.shooting: self.last_reloadtime = now self.startReloadBullet = True if self.last_magazine_bullets == 0 and now - self.last_reloadtime >= self.reloadtime: self.last_magazine_bullets = self.magazine_bullets self.startReloadBullet = False def detect_enemy(self): self.topright_x, self.topright_y = self.rect.topright self.bottomleft_x, self.bottomleft_y = self.rect.bottomleft self.bottomright_x, self.bottomright_y = self.rect.bottomright # 在上方 if self.direction == "Up" and (self.rect.x - 20) < self.enemy_centerx < (self.topright_x + 20) and (self.rect.top - self.frontView) < self.enemy_centery < self.rect.top: return True # 在左方 elif self.direction == "Left" and (self.rect.left - self.frontView) < self.enemy_centerx < self.rect.left and (self.rect.y - 20) < self.enemy_centery < (self.bottomleft_y + 20): return True # 在下方 elif self.direction == "Down" and (self.bottomleft_x - 20) < self.enemy_centerx < (self.bottomright_x + 20) and self.rect.bottom < self.enemy_centery < (self.rect.bottom + self.frontView): return True # 在右方 elif self.direction == "Right" and (self.rect.right) < self.enemy_centerx < (self.rect.right + self.frontView) and (self.topright_y - 20) < self.enemy_centery < (self.bottomright_y + 20): return True else: return False class SandBag(pygame.sprite.Sprite): def __init__(self, surf, center_x, center_y, rotate): pygame.sprite.Sprite.__init__(self) self.surf = surf self.center_x = center_x self.center_y = center_y self.rotate = rotate self.image_original = image_sandBag_front self.chooseImageAndRotate() self.image = self.image_original # self.image_original = pygame.Surface((90, 30)) # self.image_original.fill((255, 255, 0)) # self.image = pygame.transform.rotate(self.image_original, self.rotate) self.rect = self.image.get_rect() self.rect.centerx , self.rect.centery = self.center_x, self.center_y self.hitted = False # 屬性 self.health = 300 # 難度 if GameSave_content['difficult'] == "easy": self.health *= 2 self.now_health = self.health elif GameSave_content['difficult'] == "normal": self.health *= 1 self.now_health = self.health elif GameSave_content['difficult'] == "hard": self.health *= 0.75 self.now_health = self.health def chooseImageAndRotate(self): # if 0 <= self.rotate < 90 or -90 < self.rotate <= 0: # self.image_original = image_sandBag_front # elif 90 <= self.rotate < 180 or -270 <= self.rotate < -180: # self.image_original = image_sandBag_front # elif 180 <= self.rotate < 270: # self.image_original = image_sandBag_front # elif 270 <= self.rotate < 360 or 0 -180 < self.rotate <= -90: # self.image_original = image_sandBag_front if self.rotate == 0: self.image_original = image_sandBag_front elif self.rotate == 90: self.image_original = image_sandBag_right elif self.rotate == 180: self.image_original = image_sandBag_front elif self.rotate == 270: self.image_original = image_sandBag_right class Level_1_rifle(pygame.sprite.Sprite): def __init__(self, surf, equipment_role): pygame.sprite.Sprite.__init__(self) self.surf = surf self.image_weapons_original = image_weapon_M4A1 self.image_weapons_FlipHorizontally_original = image_weapon_M4A1_FlipHorizontally self.image = self.image_weapons_original.copy() self.rect = self.image.get_rect() self.equipment_role = equipment_role self.rect.centerx = self.equipment_role.rect.centerx self.rect.centery = self.equipment_role.rect.centery - 18 def update(self): now = pygame.time.get_ticks() self.rect.centerx = self.equipment_role.rect.centerx self.rect.centery = self.equipment_role.rect.centery - 18 self.mouse_x, self.mouse_y = pygame.mouse.get_pos() self.weapon_difference_x = self.mouse_x - self.rect.centerx self.weapon_difference_y = self.mouse_y - self.rect.centery self.weapon_hypotenuse = (((self.weapon_difference_x** 2) + (self.weapon_difference_y** 2))** 0.5) # 更新武器方向 self.rotate() # 取得滑鼠輸入 mouse_pressed = pygame.mouse.get_pressed() if mouse_pressed == (1, 0, 0): if now - self.equipment_role.last_shoot_time >= self.equipment_role.shooting_interval and self.equipment_role.shoot_mode == "auto": self.shoot() def rotate(self): # 第一象限 if self.weapon_difference_x > 0 and self.weapon_difference_y < 0: self.image = pygame.transform.rotate(self.image_weapons_original, (int((math.acos(self.weapon_difference_x / self.weapon_hypotenuse) / math.pi) * 180))) # 第二象限 elif self.weapon_difference_x < 0 and self.weapon_difference_y < 0: self.image = pygame.transform.rotate(self.image_weapons_FlipHorizontally_original, (int((math.acos(self.weapon_difference_x / self.weapon_hypotenuse) / math.pi) * 180) - 180)) # 第三象限 elif self.weapon_difference_x < 0 and self.weapon_difference_y > 0: self.image = pygame.transform.rotate(self.image_weapons_FlipHorizontally_original, -(int((math.acos(self.weapon_difference_x / self.weapon_hypotenuse) / math.pi) * 180) - 180)) # 第四象限 elif self.weapon_difference_x > 0 and self.weapon_difference_y > 0: self.image = pygame.transform.rotate(self.image_weapons_original, -(int((math.acos(self.weapon_difference_x / self.weapon_hypotenuse) / math.pi) * 180))) # if equipment_role.direction == "Right": center = self.rect.center self.rect = self.image.get_rect() self.rect.center = center def shoot(self): now = pygame.time.get_ticks() if not self.equipment_role.hidden: if self.equipment_role.last_magazine_bullets > 0: bullet = Bullet_rifle_player(self.rect.centerx, self.rect.centery) Level_1_all_sprites.add(bullet) Level_1_bullets.add(bullet) Level_1_friendly_bullets.add(bullet) self.equipment_role.last_magazine_bullets -= 1 self.equipment_role.last_shoot_time = now sound_rifle_shoot.play() class aimPoint(pygame.sprite.Sprite): def __init__(self, surf): pygame.sprite.Sprite.__init__(self) self.surf = surf self.image = image_aimPoint self.rect = self.image.get_rect() self.rect.center = (WIDTH / 2, HEIGHT / 2) def update(self): self.mouse_x, self.mouse_y = pygame.mouse.get_pos() self.rect.centerx = self.mouse_x self.rect.centery = self.mouse_y class Bullet_rifle_player(pygame.sprite.Sprite): def __init__(self, center_x, center_y): pygame.sprite.Sprite.__init__(self) self.image_original = pygame.transform.rotate(image_bullet_rifle, -90) self.image = self.image_original.copy() self.rect = self.image.get_rect() self.rect.centerx = center_x self.rect.centery = center_y self.mouse_x, self.mouse_y = pygame.mouse.get_pos() self.difference_x = self.mouse_x - self.rect.centerx self.difference_y = self.mouse_y - self.rect.centery self.difference_hypotenuse = ((self.difference_x** 2 + self.difference_y** 2)** 0.5) # 子彈飛行速度 self.speed = 12 * (FPS / 60) # 子彈x, y飛行值計算 self.scale = self.speed / self.difference_hypotenuse self.fly_speedx = self.difference_x * self.scale self.fly_speedy = self.difference_y * self.scale # 子彈已飛行距離 self.flyingDistance = 0 # 有效射程 self.maxFlyingDistance = 400 # 將子彈位置校正 self.rotate() def update(self): if self.flyingDistance <= self.maxFlyingDistance: self.rect.x += self.fly_speedx self.rect.y += self.fly_speedy self.flyingDistance += self.speed if self.flyingDistance > self.maxFlyingDistance or self.rect.bottom < 0 or self.rect.top > HEIGHT or self.rect.right < 0 or self.rect.left > WIDTH: self.kill() def rotate(self): # 第一象限 if self.difference_x > 0 and self.difference_y < 0: self.image = pygame.transform.rotate(self.image_original, (int((math.acos(self.difference_x / self.difference_hypotenuse) / math.pi) * 180))) # 第二象限 elif self.difference_x < 0 and self.difference_y < 0: self.image = pygame.transform.rotate(self.image_original, (int((math.acos(self.difference_x / self.difference_hypotenuse) / math.pi) * 180))) # 第三象限 elif self.difference_x < 0 and self.difference_y > 0: self.image = pygame.transform.rotate(self.image_original, -(int((math.acos(self.difference_x / self.difference_hypotenuse) / math.pi) * 180))) # 第四象限 elif self.difference_x > 0 and self.difference_y > 0: self.image = pygame.transform.rotate(self.image_original, -(int((math.acos(self.difference_x / self.difference_hypotenuse) / math.pi) * 180))) center = self.rect.center self.rect = self.image.get_rect() self.rect.center = center class Bullet_rifle_enemy(pygame.sprite.Sprite): def __init__(self, x, y, direction): pygame.sprite.Sprite.__init__(self) self.image_original = image_bullet_rifle self.rect = self.image_original.get_rect() self.image = self.image_original.copy() self.rect.centerx = x self.rect.centery = y self.direction = direction self.speed = 12 * (FPS / 60) self.flyingDistance = 0 self.maxFlyingDistance = 400 def update(self): if self.direction == "Up" and self.flyingDistance <= self.maxFlyingDistance: self.rotate() self.rect.y -= self.speed self.flyingDistance += self.speed elif self.direction == "Left" and self.flyingDistance <= self.maxFlyingDistance: self.rotate() self.rect.x -= self.speed self.flyingDistance += self.speed elif self.direction == "Down" and self.flyingDistance <= self.maxFlyingDistance: self.rotate() self.rect.y += self.speed self.flyingDistance += self.speed elif self.direction == "Right" and self.flyingDistance <= self.maxFlyingDistance: self.rotate() self.rect.x += self.speed self.flyingDistance += self.speed if self.flyingDistance > self.maxFlyingDistance or self.rect.bottom < 0 or self.rect.top > HEIGHT or self.rect.right < 0 or self.rect.left > WIDTH: self.kill() def rotate(self): if self.direction == "Up": self.image = pygame.transform.rotate(self.image_original, 0) elif self.direction == "Left": self.image = pygame.transform.rotate(self.image_original, 90) elif self.direction == "Down": self.image = pygame.transform.rotate(self.image_original, 180) elif self.direction == "Right": self.image = pygame.transform.rotate(self.image_original, 270) center = self.rect.center self.rect = self.image.get_rect() self.rect.center = center class Level_1_powerItem(pygame.sprite.Sprite): def __init__(self, center): pygame.sprite.Sprite.__init__(self) self.image_original = {} self.image_original['Medkit'] = image_medkit self.image_original['ArmorPack'] = image_armorpack self.image_original['LargeMagazine'] = image_large_magazine_rifle self.image_original['HighSpeedReload'] = image_highspeed_reload_magazine_rifle self.powerType = random.choice(['Medkit', 'ArmorPack', 'LargeMagazine', 'HighSpeedReload']) self.image = self.image_original[self.powerType].copy() self.rect = self.image.get_rect() self.rect.center = center # 第二關 def Level_2_draw_levelTrip(): screen.blit(image_background_level2Trip, (0, 0)) draw_text("tl", screen, '鎮守前線', (255, 255, 255), 48, True, 40 * (WIDTH / 1280), 46 * (HEIGHT / 720)) draw_text("tl", screen, '空軍作戰指揮部收到訊息', (255, 255, 255), 22, False, 45 * (WIDTH / 1280), 136 * (HEIGHT / 720)) draw_text("tl", screen, '發現有數架敵方高科技轟炸機、戰鬥機正在向領空範圍前進', (255, 255, 255), 22, False, 45 * (WIDTH / 1280), 168 * (HEIGHT / 720)) draw_text("tl", screen, '作戰指揮部派遣戰術戰鬥機聯隊前往攔截敵方轟炸機', (255, 255, 255), 22, False, 45 * (WIDTH / 1280), 200 * (HEIGHT / 720)) draw_text("tl", screen, '同時進行敵方基地的偵察任務', (255, 255, 255), 22, False, 45 * (WIDTH / 1280), 264 * (HEIGHT / 720)) draw_text("center", screen, 'WASD 或 ↑←↓→ 操控方向', (255, 255, 255), 16, False, WIDTH / 2, (580 * (HEIGHT / 720)) + 8) draw_text("center", screen, '空白建 進行射擊 B鍵 切換武器', (255, 255, 255), 16, False, WIDTH / 2, (610 * (HEIGHT / 720)) + 8) draw_text("center", screen, '按任意鍵開始', (255, 255, 255), 16, False, WIDTH / 2, (640 * (HEIGHT / 720)) + 8) pygame.display.update() waiting = True while waiting: clock.tick(FPS) # 取得輸入 for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() return True elif event.type == pygame.KEYUP: waiting = False return False def Level_2_new_rocks(): rock = Rock() Level_2_all_sprites.add(rock) Level_2_rocks.add(rock) def Level_2_summon_powerItem(center): # 隨機掉落道具 if GameSave_content['difficult'] == "easy" and random.random() >= 0.65: power = Level_2_powerItem(center) Level_2_all_sprites.add(power) Level_2_powerItems_group.add(power) elif GameSave_content['difficult'] == "normal" and random.random() >= 0.8: power = Level_2_powerItem(center) Level_2_all_sprites.add(power) Level_2_powerItems_group.add(power) elif GameSave_content['difficult'] == "hard" and random.random() >= 0.9: power = Level_2_powerItem(center) Level_2_all_sprites.add(power) Level_2_powerItems_group.add(power) class Level_2_Player_plane(pygame.sprite.Sprite): def __init__(self, surf): pygame.sprite.Sprite.__init__(self) self.surf = surf self.image_original = pygame.transform.scale(image_player_plane, (178, 128)) # self.image_original = pygame.Surface((40, 50)) # self.image_original.fill((0, 255, 0)) self.image = self.image_original.copy() self.rect = self.image.get_rect() self.radius = 20 self.rect.centerx = WIDTH / 2 self.rect.centery = HEIGHT - 15 # 移動速度 self.speed = 4 # 血量 self.health = 200 self.now_health = self.health # 機甲 self.armor = 1300 self.now_armor = self.armor # 生命數 self.lives = 0 # 傷害百分比 self.damageMagnification = 1 # 飛彈數量 self.missile_amount_original = 0 self.last_missile_amount = self.missile_amount_original # 武器選擇: auto, missile (激光炮, 飛彈) self.shoot_mode = "auto" # 激光炮數量 self.gun = 1 self.gun_turboTime = 0 # auto模式下射擊速度 self.shooting_interval = 300 # 上次射擊時間 self.last_shoot_time = 0 # 飛彈冷卻時間 self.missile_colddown = 3000 # 上次發射飛彈時間 self.last_launchMissile_time = 0 self.hidden = False self.hide_time = 0 if GameSave_content['difficult'] == "easy": # 血量 self.health *= 1.2 self.now_health = self.health # 機甲 self.armor *= 1.2 self.now_armor = self.armor # 生命數 self.lives = 2 # 傷害百分比 self.damageMagnification = self.damageMagnification * 1.2 # 飛彈數量 self.missile_amount_original = 20 self.last_missile_amount = self.missile_amount_original elif GameSave_content['difficult'] == "normal": # 血量 self.health *= 1 self.now_health = self.health # 機甲 self.armor *= 1 self.now_armor = self.armor # 生命數 self.lives = 1 # 傷害百分比 self.damageMagnification = self.damageMagnification * 1 # 飛彈數量 self.missile_amount_original = 15 self.last_missile_amount = self.missile_amount_original elif GameSave_content['difficult'] == "hard": # 血量 self.health *= 1 self.now_health = self.health # 機甲 self.armor *= 0.8 self.now_armor = self.armor # 生命數 self.lives = 0 # 傷害百分比 self.damageMagnification = self.damageMagnification * 0.8 # 飛彈數量 self.missile_amount_original = 10 self.last_missile_amount = self.missile_amount_original def update(self): now = pygame.time.get_ticks() # 取得鍵盤輸入 key_pressed = pygame.key.get_pressed() # 上 if key_pressed[pygame.K_w] or key_pressed[pygame.K_UP]: self.rect.y -= self.speed # 左 elif key_pressed[pygame.K_a] or key_pressed[pygame.K_LEFT]: self.rect.x -= self.speed # 下 elif key_pressed[pygame.K_s] or key_pressed[pygame.K_DOWN]: self.rect.y += self.speed # 右 elif key_pressed[pygame.K_d] or key_pressed[pygame.K_RIGHT]: self.rect.x += self.speed if key_pressed[pygame.K_SPACE]: self.shoot() # 重生前的隱身 if self.hidden and now - self.hide_time > 1000: self.hidden = False self.rect.center = (WIDTH / 2, HEIGHT / 2) # 將角色控制在邊界 if self.rect.top < 230: self.rect.top = 230 if self.rect.left < 0: self.rect.left = 0 if self.rect.bottom > HEIGHT and not self.hidden: self.rect.bottom = HEIGHT if self.rect.right > WIDTH: self.rect.right = WIDTH def shoot(self): now = pygame.time.get_ticks() if not self.hidden: if self.shoot_mode == "auto": if self.gun == 1: if now - self.last_shoot_time > self.shooting_interval: lazer = Bullet_laser_player(self.rect.centerx, self.rect.centery) Level_2_all_sprites.add(lazer) Level_2_lazers.add(lazer) Level_2_friendly_lazers.add(lazer) self.last_shoot_time = now sound_laser_launcher.play() elif self.gun == 2: if now - self.last_shoot_time > self.shooting_interval: lazer1 = Bullet_laser_player(self.rect.centerx - 30, self.rect.centery) lazer2 = Bullet_laser_player(self.rect.centerx + 30, self.rect.centery) Level_2_all_sprites.add(lazer1) Level_2_all_sprites.add(lazer2) Level_2_lazers.add(lazer1) Level_2_lazers.add(lazer2) Level_2_friendly_lazers.add(lazer1) Level_2_friendly_lazers.add(lazer2) self.last_shoot_time = now sound_laser_launcher.play() if self.shoot_mode == "missile": if now - self.last_launchMissile_time > self.missile_colddown and self.last_missile_amount > 0: self.last_missile_amount -= 1 missile = Bullet_missile_player(self.rect.centerx, self.rect.centery) Level_2_all_sprites.add(missile) Level_2_missiles.add(missile) Level_2_friendly_missiles.add(missile) self.last_launchMissile_time = now sound_missile_launcher.play() def hide(self): self.hidden = True self.hide_time = pygame.time.get_ticks() self.rect.center = (WIDTH / 2, HEIGHT + HEIGHT) class Level_2_enemy_plane(pygame.sprite.Sprite): def __init__(self, surf, centerx, centery): pygame.sprite.Sprite.__init__(self) self.surf = surf self.image_original = pygame.transform.scale(image_enemy_plane, (189, 141)) # self.image_original = pygame.Surface((40, 50)) # self.image_original.fill((255, 150, 50)) self.image = self.image_original.copy() self.rect = self.image.get_rect() self.radius = 20 self.rect.centerx = centerx self.rect.centery = centery # 移動速度 self.speed = 4 # 血量 self.health = 400 self.now_health = self.health # 機甲 self.armor = 500 self.now_armor = self.armor # 傷害百分比 self.damageMagnification = 1 # 飛彈數量 self.missile_amount_original = 0 self.last_missile_amount = self.missile_amount_original # 武器選擇: auto, missile (激光炮, 飛彈) self.shoot_mode = "auto" # auto模式下射擊速度 self.shooting_interval = 400 # 上次射擊時間 self.last_shoot_time = 0 # 飛彈冷卻時間 self.missile_colddown = 3000 # 上次發射飛彈時間 self.last_launchMissile_time = 0 # 是否開火 self.start_shoot = False self.start_shootTime = 0 # 使用雷射持續 self.usingLazer_ValidityPeriod = 6000 # 使用飛彈持續 self.usingMissile_ValidityPeriod = 10000 # 武器使用冷卻 self.shootAction_colddown = False self.shootAction_colddownTime = 5000 self.shootAction_colddownSt = 0 # 移動冷卻 self.move_colddown = 1000 self.last_moveTime = 0 self.last_moveAmount = 0 self.hitted = False if GameSave_content['difficult'] == "easy": # 血量 self.health *= 0.8 self.now_health = self.health # 機甲 self.armor *= 0.8 self.now_armor = self.armor # 傷害百分比 self.damageMagnification = self.damageMagnification * 0.8 # 飛彈數量 self.missile_amount_original = 10 self.last_missile_amount = self.missile_amount_original elif GameSave_content['difficult'] == "normal": # 血量 self.health *= 1 self.now_health = self.health # 機甲 self.armor *= 1 self.now_armor = self.armor # 傷害百分比 self.damageMagnification = self.damageMagnification * 1 # 飛彈數量 self.missile_amount_original = 15 self.last_missile_amount = self.missile_amount_original elif GameSave_content['difficult'] == "hard": # 血量 self.health *= 1.2 self.now_health = self.health # 機甲 self.armor *= 1.2 self.now_armor = self.armor # 傷害百分比 self.damageMagnification = self.damageMagnification * 1.2 # 飛彈數量 self.missile_amount_original = 20 self.last_missile_amount = self.missile_amount_original def update(self): now = pygame.time.get_ticks() if not self.start_shoot and not self.shootAction_colddown: self.choice_shoot_mode = random.randint(1, 3) if self.choice_shoot_mode == 1: self.shoot_mode = "auto" self.start_shootTime = now self.start_shoot = True elif self.choice_shoot_mode == 2 and self.last_missile_amount > 0: self.shoot_mode = "missile" self.start_shootTime = now self.start_shoot = True elif self.choice_shoot_mode == 3: self.shootAction_colddown = True self.shootAction_colddownSt = now if self.start_shoot: if now - self.start_shootTime <= self.usingLazer_ValidityPeriod: self.shoot() else: self.start_shoot = False elif self.shootAction_colddown: if now - self.shootAction_colddownSt > self.shootAction_colddownTime: self.shootAction_colddown = False self.move() # 將角色控制在邊界 if self.rect.top < 0: self.rect.top = 0 if self.rect.left < 0: self.rect.left = 0 if self.rect.bottom > HEIGHT: self.rect.bottom = HEIGHT if self.rect.right > WIDTH: self.rect.right = WIDTH def move(self): now = pygame.time.get_ticks() # 左 => spawnArea = 1 # 右 => spawnArea = 2 if self.last_moveAmount == 0 and now - self.last_moveTime > self.move_colddown: self.choice_move_direction = random.randint(1, 2) self.last_moveAmount += random.randint(1, 40) self.DoneMove = False if self.choice_move_direction == 1 and self.last_moveAmount > 0: self.rect.centerx -= self.speed self.last_moveAmount -= 1 elif self.choice_move_direction == 2 and self.last_moveAmount > 0: self.rect.centerx += self.speed self.last_moveAmount -= 1 if self.last_moveAmount == 0 and not self.DoneMove: self.last_moveTime = now self.DoneMove = True def shoot(self): now = pygame.time.get_ticks() if self.shoot_mode == "auto": if now - self.last_shoot_time > self.shooting_interval: lazer = Bullet_laser_enemy(self.rect.centerx, self.rect.centery) Level_2_all_sprites.add(lazer) Level_2_lazers.add(lazer) Level_2_enemy_lazers.add(lazer) self.last_shoot_time = now sound_laser_launcher.play() if self.shoot_mode == "missile": if now - self.last_launchMissile_time > self.missile_colddown and self.last_missile_amount > 0: self.last_missile_amount -= 1 missile = Bullet_missile_enemy(self.rect.centerx, self.rect.centery) Level_2_all_sprites.add(missile) Level_2_missiles.add(missile) Level_2_enemy_missiles.add(missile) self.last_launchMissile_time = now sound_missile_launcher.play() class Level_2_enemy_BOSS_plane(pygame.sprite.Sprite): def __init__(self, surf, centerx, centery): pygame.sprite.Sprite.__init__(self) self.surf = surf self.image_original = pygame.transform.scale(image_enemy_plane_BOSS, (283, 212)) # self.image_original = pygame.Surface((40, 50)) # self.image_original.fill((255, 150, 50)) self.image = self.image_original.copy() self.rect = self.image.get_rect() self.radius = 20 self.rect.centerx = centerx self.rect.centery = centery # 移動速度 self.speed = 5 # 血量 self.health = 1000 self.now_health = self.health # 機甲 self.armor = 1000 self.now_armor = self.armor # 傷害百分比 self.damageMagnification = 1 # 飛彈數量 self.missile_amount_original = 0 self.last_missile_amount = self.missile_amount_original # 武器選擇: auto, missile (激光炮, 飛彈) self.shoot_mode = "auto" # auto模式下射擊速度 self.shooting_interval = 300 # 上次射擊時間 self.last_shoot_time = 0 # 飛彈冷卻時間 self.missile_colddown = 3000 # 上次發射飛彈時間 self.last_launchMissile_time = 0 # 是否開火 self.start_shoot = False self.start_shootTime = 0 # 使用雷射持續 self.usingLazer_ValidityPeriod = 6000 # 使用飛彈持續 self.usingMissile_ValidityPeriod = 10000 # 武器使用冷卻 self.shootAction_colddown = False self.shootAction_colddownTime = 5000 self.shootAction_colddownSt = 0 # 移動冷卻 self.move_colddown = 1000 self.last_moveTime = 0 self.last_moveAmount = 0 self.hitted = False if GameSave_content['difficult'] == "easy": # 血量 self.health *= 0.8 self.now_health = self.health # 機甲 self.armor *= 0.8 self.now_armor = self.armor # 傷害百分比 self.damageMagnification = self.damageMagnification * 0.8 # 飛彈數量 self.missile_amount_original = 9000000 self.last_missile_amount = self.missile_amount_original elif GameSave_content['difficult'] == "normal": # 血量 self.health *= 1 self.now_health = self.health # 機甲 self.armor *= 1 self.now_armor = self.armor # 傷害百分比 self.damageMagnification = self.damageMagnification * 1 # 飛彈數量 self.missile_amount_original = 9000000 self.last_missile_amount = self.missile_amount_original elif GameSave_content['difficult'] == "hard": # 血量 self.health *= 1.2 self.now_health = self.health # 機甲 self.armor *= 1.2 self.now_armor = self.armor # 傷害百分比 self.damageMagnification = self.damageMagnification * 1.2 # 飛彈數量 self.missile_amount_original = 9000000 self.last_missile_amount = self.missile_amount_original def update(self): now = pygame.time.get_ticks() if not self.start_shoot and not self.shootAction_colddown: self.choice_shoot_mode = random.randint(1, 3) if self.choice_shoot_mode == 1: self.shoot_mode = "auto" self.start_shootTime = now self.start_shoot = True elif self.choice_shoot_mode == 2 and self.last_missile_amount > 0: self.shoot_mode = "missile" self.start_shootTime = now self.start_shoot = True elif self.choice_shoot_mode == 3: self.shootAction_colddown = True self.shootAction_colddownSt = now if self.start_shoot: if now - self.start_shootTime <= self.usingLazer_ValidityPeriod: self.shoot() else: self.start_shoot = False elif self.shootAction_colddown: if now - self.shootAction_colddownSt > self.shootAction_colddownTime: self.shootAction_colddown = False self.move() # 將角色控制在邊界 if self.rect.top < 0: self.rect.top = 0 if self.rect.left < 0: self.rect.left = 0 if self.rect.bottom > HEIGHT: self.rect.bottom = HEIGHT if self.rect.right > WIDTH: self.rect.right = WIDTH def move(self): now = pygame.time.get_ticks() # 左 => spawnArea = 1 # 右 => spawnArea = 2 if self.last_moveAmount == 0 and now - self.last_moveTime > self.move_colddown: self.choice_move_direction = random.randint(1, 2) self.last_moveAmount += random.randint(1, 50) self.DoneMove = False if self.choice_move_direction == 1 and self.last_moveAmount > 0: self.rect.centerx -= self.speed self.last_moveAmount -= 1 elif self.choice_move_direction == 2 and self.last_moveAmount > 0: self.rect.centerx += self.speed self.last_moveAmount -= 1 if self.last_moveAmount == 0 and not self.DoneMove: self.last_moveTime = now self.DoneMove = True def shoot(self): now = pygame.time.get_ticks() if self.shoot_mode == "auto": if now - self.last_shoot_time > self.shooting_interval: lazer = Bullet_laser_enemy(self.rect.centerx, self.rect.centery) Level_2_all_sprites.add(lazer) Level_2_lazers.add(lazer) Level_2_enemy_lazers.add(lazer) self.last_shoot_time = now sound_laser_launcher.play() if self.shoot_mode == "missile": if now - self.last_launchMissile_time > self.missile_colddown and self.last_missile_amount > 0: self.last_missile_amount -= 1 missile = Bullet_missile_enemy(self.rect.centerx, self.rect.centery) Level_2_all_sprites.add(missile) Level_2_missiles.add(missile) Level_2_enemy_missiles.add(missile) self.last_launchMissile_time = now sound_missile_launcher.play() def skill(self, skillNumber): lazer = {} missile = {} if skillNumber == 1: for i in range(1, 21): lazer[i] = Bullet_laser_enemy(i * (WIDTH / 21), 50) Level_2_all_sprites.add(lazer[i]) Level_2_lazers.add(lazer[i]) Level_2_enemy_lazers.add(lazer[i]) sound_laser_launcher.play() if skillNumber == 2: for i in range(1, 9): missile[i] = Bullet_missile_enemy(i * (WIDTH / 9), 50) Level_2_all_sprites.add(missile[i]) Level_2_missiles.add(missile[i]) Level_2_enemy_missiles.add(missile[i]) sound_missile_launcher.play() if skillNumber == 3: for i in range(1, 17): missile[i] = Bullet_missile_enemy(i * (WIDTH / 17), 50) Level_2_all_sprites.add(missile[i]) Level_2_missiles.add(missile[i]) Level_2_enemy_missiles.add(missile[i]) sound_missile_launcher.play() class Rock(pygame.sprite.Sprite): def __init__(self): pygame.sprite.Sprite.__init__(self) self.size = random.randint(20, 45) # self.image_original = pygame.Surface((self.size, self.size)) self.image_original = pygame.transform.scale(image_rock, (self.size, self.size)) self.image = self.image_original.copy() self.rect = self.image.get_rect() self.radius = int(self.rect.width * 0.85 / 2) # pygame.draw.circle(self.image, (255, 0, 0), self.rect.center, self.radius) self.rect.x = random.randrange(0, WIDTH - self.rect.width) self.rect.y = random.randrange(-180, -100) self.speedx = random.randrange(-2, 2) self.speedy = random.randrange(2, 8) self.total_degree = 0 self.rot_degree = random.randrange(-3, 3) def update(self): self.rotate() self.rect.y += self.speedy self.rect.x += self.speedx if self.rect.top > HEIGHT or self.rect.left > WIDTH or self.rect.right < 0: self.rect.x = random.randrange(0, WIDTH - self.rect.width) self.rect.y = random.randrange(-100, -40) self.speedx = random.randrange(-2, 2) self.speedy = random.randrange(2, 8) def rotate(self): self.total_degree += self.rot_degree self.total_degree = self.total_degree % 360 self.image = pygame.transform.rotate(self.image_original, self.total_degree) center = self.rect.center self.rect = self.image.get_rect() self.rect.center = center class Bullet_laser_player(pygame.sprite.Sprite): def __init__(self, center_x, center_y): pygame.sprite.Sprite.__init__(self) # self.image_original = pygame.Surface((6, 20)) # self.image_original.fill((255, 255, 255)) self.image_original = image_bullet_laser self.image = self.image_original.copy() self.rect = self.image.get_rect() self.rect.centerx = center_x self.rect.centery = center_y # 子彈飛行速度 self.speed = 10 * (FPS / 60) # 子彈已飛行距離 self.flyingDistance = 0 def update(self): self.rect.y -= self.speed if self.rect.bottom < 0: self.kill() class Bullet_missile_player(pygame.sprite.Sprite): def __init__(self, center_x, center_y): pygame.sprite.Sprite.__init__(self) # self.image_original = pygame.Surface((12, 30)) # self.image_original.fill((255, 255, 255)) self.image_original = image_bullet_missile self.image = self.image_original.copy() self.rect = self.image.get_rect() self.rect.centerx = center_x self.rect.centery = center_y # 子彈飛行速度 self.speed = 7 * (FPS / 60) # 子彈已飛行距離 self.flyingDistance = 0 def update(self): self.rect.y -= self.speed if self.rect.bottom < 0: self.kill() class Bullet_laser_enemy(pygame.sprite.Sprite): def __init__(self, center_x, center_y): pygame.sprite.Sprite.__init__(self) # self.image_original = pygame.Surface((6, 20)) # self.image_original.fill((255, 255, 255)) self.image_original = image_bullet_laser self.image = self.image_original.copy() self.rect = self.image.get_rect() self.rect.centerx = center_x self.rect.centery = center_y # 子彈飛行速度 self.speed = 10 * (FPS / 60) # 子彈已飛行距離 self.flyingDistance = 0 def update(self): self.rect.y += self.speed if self.rect.bottom < 0: self.kill() class Bullet_missile_enemy(pygame.sprite.Sprite): def __init__(self, center_x, center_y): pygame.sprite.Sprite.__init__(self) # self.image_original = pygame.Surface((12, 30)) # self.image_original.fill((255, 255, 255)) self.image_original = pygame.transform.rotate(image_bullet_missile, 180) self.image = self.image_original.copy() self.rect = self.image.get_rect() self.rect.centerx = center_x self.rect.centery = center_y # 子彈飛行速度 self.speed = 7 * (FPS / 60) # 子彈已飛行距離 self.flyingDistance = 0 def update(self): self.rect.y += self.speed if self.rect.bottom < 0: self.kill() class Level_2_powerItem(pygame.sprite.Sprite): def __init__(self, center): pygame.sprite.Sprite.__init__(self) self.image_original = {} self.image_original['Medkit'] = image_medkit self.image_original['RepairKit'] = image_repairKit self.image_original['TurretUpgrade'] = image_turretUpgrade self.powerType = random.choice(['Medkit', 'RepairKit', 'TurretUpgrade']) self.image = self.image_original[self.powerType].copy() self.rect = self.image.get_rect() self.rect.center = center # 下墜速度 self.speed = 2 def update(self): self.rect.centery += self.speed if self.rect.bottom < 0: self.kill() # 第三關 def Level_3_draw_levelTrip(): screen.blit(main_screen_background["main"], (0, 0)) draw_text("center", screen, '鎮守前線', (255, 255, 255), 48, True, 135 * (WIDTH / 1280), 68) draw_text("center", screen, '前線受到攻擊', (255, 255, 255), 22, False, 120 * (WIDTH / 1280), 112) draw_text("center", screen, 'WASD 或 ↑←↓→ 操控方向', (255, 255, 255), 16, False, WIDTH / 2, (580 * (HEIGHT / 720)) + 8) draw_text("center", screen, '空白鍵 進行射擊 R鍵 換彈', (255, 255, 255), 16, False, WIDTH / 2, (610 * (HEIGHT / 720)) + 8) draw_text("center", screen, '按任意鍵開始', (255, 255, 255), 16, False, WIDTH / 2, (640 * (HEIGHT / 720)) + 8) pygame.display.update() waiting = True while waiting: clock.tick(FPS) # 取得輸入 for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() return True elif event.type == pygame.KEYUP: waiting = False return False # 遊戲歷程展示廳 def draw_gameMarkerScreen(): toEndingScreen_Button = SettingPanel_ArrowButton(1024, 600 * (HEIGHT / 720), "返回", 28, (0, 0, 0), False, button_background_image_normal, button_background_image_move, button_background_image_down, text_font) screen.blit(image_background_gameMarkerScreen, (0, 0)) draw_text("center", screen, '遊戲製作', (255, 255, 255), 64, True, WIDTH / 2, 108) draw_text("tl", screen, '遊戲製作', (255, 255, 255), 26, True, 160, 176) draw_text("tl", screen, 'Kenny', (255, 255, 255), 24, False, 160, 212) # draw_text("tl", screen, '遊戲製作2', (255, 255, 255), 24, False, 160, 241) # draw_text("tl", screen, '遊戲製作3', (255, 255, 255), 24, False, 160, 270) draw_text("tl", screen, '美術製作', (255, 255, 255), 26, True, 160, 304) draw_text("tl", screen, 'Kenny', (255, 255, 255), 24, False, 160, 340) draw_text("tl", screen, 'BaconKnight', (255, 255, 255), 24, False, 160, 369) # draw_text("tl", screen, '美術3', (255, 255, 255), 24, False, 160, 398) draw_text("tl", screen, '測試人員', (255, 255, 255), 26, True, 160, 432) draw_text("tl", screen, 'BaconKnight', (255, 255, 255), 24, False, 160, 468) # draw_text("tl", screen, '測試人員2', (255, 255, 255), 24, False, 160, 499) # draw_text("tl", screen, '測試人員3', (255, 255, 255), 24, False, 160, 530) draw_text("tl", screen, '音樂素材', (255, 255, 255), 26, True, 500, 176) draw_text("tl", screen, 'YT', (255, 255, 255), 24, False, 500, 212) draw_text("tl", screen, 'YT音效庫', (255, 255, 255), 24, False, 500, 241) draw_text("tl", screen, '小森平的免費音效', (255, 255, 255), 24, False, 500, 270) draw_text("tl", screen, 'Terraria', (255, 255, 255), 24, False, 500, 299) # draw_text("tl", screen, '', (255, 255, 255), 24, False, 500, 328) # draw_text("center", screen, '按任意鍵返回', (255, 255, 255), 16, False, WIDTH / 2, (640 * (HEIGHT / 720)) + 8) pygame.display.update() waiting = True while waiting: clock.tick(FPS) # 取得輸入 mouse_x, mouse_y = pygame.mouse.get_pos() for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() return True # elif event.type == pygame.KEYUP: # waiting = False # return False # 滑鼠移動事件 elif event.type == pygame.MOUSEMOTION: # 判斷滑鼠是否移動到按鈕範圍內 toEndingScreen_Button.getFocus(mouse_x, mouse_y) # 滑鼠按下 elif event.type == pygame.MOUSEBUTTONDOWN: #滑鼠左鍵按下 if pygame.mouse.get_pressed() == (1, 0, 0): toEndingScreen_Button.mouseDown(mouse_x, mouse_y) # 滑鼠彈起 elif event.type == pygame.MOUSEBUTTONUP: toEndingScreen_Button.mouseUp() if toEndingScreen_Button.bottomMouseUp: toEndingScreen_Button.bottomMouseUp = False waiting = False return False toEndingScreen_Button.draw(screen) pygame.display.update() # 創建按鈕 startPlayGame_Button = startPlayGameButton(WIDTH / 2, 258 * (HEIGHT / 720), "遊玩", 28, (0, 0, 0), False, button_background_image_normal, button_background_image_move, button_background_image_down, text_font) gameSetting_Button = gameSettingButton(screen, WIDTH / 2, 360 * (HEIGHT / 720), "設定", 28, (0, 0, 0), False, button_background_image_normal, button_background_image_move, button_background_image_down, text_font) leaveGame_Button = Button(WIDTH / 2, 462 * (HEIGHT / 720), "離開", 28, (0, 0, 0), False, button_background_image_normal, button_background_image_move, button_background_image_down, leaveGame_Button_function, text_font) # 現在時間(ticks) 1tick = 1ms nowTime = pygame.time.get_ticks() # 主畫面動畫設定 main_screen_background_image_frame = 0 main_screen_background_image_changeTime = 75 main_screen_background_image_lastChangeTime = 0 # 存檔讀取次數 # 0 未讀擋, 1 完成第一次讀檔 gameSave_readTimes = 0 # 開始遊戲是否被點擊 startPlayGame_Button_clicked = False # 是否調整過設定 gameSetting_Button_Done = True leaveGame_Button_Return = False # 是否按下ESC Escape_KeyDown = False # ESC畫面回傳 escape_screen_return = False # 關卡開頭 show_levelTrip = True # mainScreen while program_running: clock.tick(FPS) if random.random() >= 0.998: pygame.display.set_caption(Screen_display_tittle['tittle'][(random.randint(0, len(Screen_display_tittle['tittle'])) - 1)]) # 獲得滑鼠座標 mouse_x, mouse_y = pygame.mouse.get_pos() for event in pygame.event.get(): if event.type == pygame.QUIT: program_running = False break # 滑鼠移動事件 elif event.type == pygame.MOUSEMOTION: # 判斷滑鼠是否移動到按鈕範圍內 startPlayGame_Button.getFocus(mouse_x, mouse_y) gameSetting_Button.getFocus(mouse_x, mouse_y) leaveGame_Button.getFocus(mouse_x, mouse_y) # 滑鼠按下 elif event.type == pygame.MOUSEBUTTONDOWN: #滑鼠左鍵按下 if pygame.mouse.get_pressed() == (1, 0, 0): startPlayGame_Button.mouseDown(mouse_x, mouse_y) gameSetting_Button.mouseDown(mouse_x, mouse_y) leaveGame_Button.mouseDown(mouse_x, mouse_y) # 滑鼠彈起 elif event.type == pygame.MOUSEBUTTONUP: startPlayGame_Button_clicked = startPlayGame_Button.mouseUp(screen) gameSetting_Button_Done = gameSetting_Button.mouseUp() leaveGame_Button_Return = leaveGame_Button.mouseUp() if leaveGame_Button_Return: leaveGame_Button_Return = False program_running = False break # 是否調整過設定 if gameSetting_Button_Done: gameSetting_Button_Done = False with open(CONFIG_FILE_ADDRESS, 'rb') as gameConfigFile: gameConfig = pickle.load(gameConfigFile) Enable_FullScreen = gameConfig['FullScreen'] if Enable_FullScreen: screen = pygame.display.set_mode((WIDTH, HEIGHT), pygame.FULLSCREEN) else: screen = pygame.display.set_mode((WIDTH, HEIGHT)) MainVolume = gameConfig['MainVolume'] MusicVolume = gameConfig['MusicVolume'] # 調整音量 sound_rifle_shoot.set_volume((MainVolume / 10) * 0.4) sound_rifle_reload.set_volume((MainVolume / 10)) sound_missile_launcher.set_volume((MainVolume / 10) * 0.3) sound_laser_launcher.set_volume((MainVolume / 10)) # 畫面顯示 nowTime = pygame.time.get_ticks() if nowTime - main_screen_background_image_lastChangeTime >= main_screen_background_image_changeTime: main_screen_background_image_lastChangeTime = nowTime main_screen_background_image_frame += 1 if main_screen_background_image_frame == 22: main_screen_background_image_frame = 0 screen.blit(main_screen_background['animation'][main_screen_background_image_frame], (0, 0)) draw_main_screen() pygame.display.update() # 按下遊戲開始 while startPlayGame_Button_clicked: clock.tick(FPS) for event in pygame.event.get(): if event.type == pygame.QUIT: program_running = False startPlayGame_Button_clicked = False break # 遊戲存檔讀取 if gameSave_readTimes == 0: GameSave_content = startPlayGame_Button.game_save # 檢查是否完成過遊戲 if GameSave_content['PassGame']: GameSave_content["game_checkpoint"] = 4 gameSave_readTimes = 1 # 畫面顯示 screen.fill((0, 0, 0)) pygame.display.update() # GameSave_content["game_chesckpoint"] = 4 # 關卡一 while GameSave_content["game_checkpoint"] == 0 and startPlayGame_Button_clicked: clock.tick(FPS) # 現在時間(ticks) 1tick = 1ms nowTime = pygame.time.get_ticks() # 初始化 if show_levelTrip: close = Level_1_draw_levelTrip() if close: program_running = False startPlayGame_Button_clicked = False break show_levelTrip = False # 隱藏滑鼠 pygame.mouse.set_visible(False) score = 0 pauseTime = 0 enemy_totalAmount = 9 Use_LargeMagazine = False StartUse_LargeMagazine_Time = 0 LargeMagazine_ValidityPeriod = 0 Level_1_player_bulletDamage = 25 Level_1_enemy_bulletDamage = 25 Level_1_startPlayTime = pygame.time.get_ticks() if GameSave_content['difficult'] == "easy": # 防禦時間 2min30sec ~ 3min Level_1_remaining_LevelTime = (random.randint(0, 30) + 150) * 1000 # 敵人總數量 enemy_totalAmount = 7 elif GameSave_content['difficult'] == "normal": # 防禦時間 2min30sec ~ 3min30sec Level_1_remaining_LevelTime = (random.randint(0, 60) + 150) * 1000 # 敵人總數量 enemy_totalAmount = 9 elif GameSave_content['difficult'] == "hard": # 防禦時間 2min30sec ~ 4min30sec Level_1_remaining_LevelTime = (random.randint(0, 120) + 150) * 1000 # 敵人總數量 enemy_totalAmount = 12 Level_1_enemy_number = {} Level_1_sandBag = {} # 所有物件 Level_1_all_sprites = pygame.sprite.Group() # 各項物件分組 Level_1_bullets = pygame.sprite.Group() Level_1_weapons_group = pygame.sprite.Group() # 物件分組 Level_1_friendly_sprites_group = pygame.sprite.Group() Level_1_friendly_bullets = pygame.sprite.Group() Level_1_enemy_sprites_group = pygame.sprite.Group() Level_1_enemy_bullets = pygame.sprite.Group() Level_1_powerItems_group = pygame.sprite.Group() # 產生掩體 Level_1_sandBag[1] = SandBag(screen, 535, 315, 270) Level_1_sandBag[2] = SandBag(screen, 535, 405, 270) Level_1_sandBag[3] = SandBag(screen, 745, 315, 90) Level_1_sandBag[4] = SandBag(screen, 745, 405, 90) Level_1_sandBag[5] = SandBag(screen, 595, 285, 0) Level_1_sandBag[6] = SandBag(screen, 685, 285, 0) Level_1_sandBag[7] = SandBag(screen, 685, 435, 180) for i in range(1, 8): Level_1_all_sprites.add(Level_1_sandBag[i]) # 創建玩家 player = Level_1_Player_soldier(screen) player_weapon = Level_1_rifle(screen, player) # 添增玩家至群組 Level_1_all_sprites.add(player_weapon) Level_1_all_sprites.add(player) Level_1_friendly_sprites_group.add(player) # Level_1_all_sprites.add(player_weapon) Level_1_weapons_group.add(player_weapon) # 產生電腦 for i in range(0, enemy_totalAmount, 1): Level_1_enemy_number[i] = Level_1_enemy_soldier(screen, player.rect.centerx, player.rect.centery, Level_1_choice_spawnArea()) Level_1_all_sprites.add(Level_1_enemy_number[i]) Level_1_enemy_sprites_group.add(Level_1_enemy_number[i]) # 生成準心 game_aimPoint = aimPoint(screen) Level_1_all_sprites.add(game_aimPoint) # 取得輸入 for event in pygame.event.get(): if event.type == pygame.QUIT: program_running = False startPlayGame_Button_clicked = False break elif event.type == pygame.KEYDOWN: if event.key == pygame.K_ESCAPE: Escape_KeyDown = True if event.key == pygame.K_b: if player.shoot_mode == "single": player.shoot_mode = "auto" elif player.shoot_mode == "auto": player.shoot_mode = "single" # if event.key == pygame.K_SPACE: # if player.shoot_mode == "single": # player.shoot() if event.type == pygame.MOUSEBUTTONDOWN: if player.shoot_mode == "single": player_weapon.shoot() # 更新玩家位置給敵人 for i in range(0, enemy_totalAmount, 1): if Level_1_enemy_number[i]: Level_1_enemy_number[i].enemy_centerx, Level_1_enemy_number[i].enemy_centery = player.rect.centerx, player.rect.centery # 更新遊戲 Level_1_all_sprites.update() # 是否使用擴大彈匣道具 if Use_LargeMagazine: if nowTime - StartUse_LargeMagazine_Time > LargeMagazine_ValidityPeriod: player.magazine_bullets //= 2 if player.last_magazine_bullets > player.magazine_bullets: player.last_magazine_bullets = player.magazine_bullets LargeMagazine_ValidityPeriod = 0 Use_LargeMagazine = False # 判斷電腦 for i in range(0, enemy_totalAmount, 1): # 判斷電腦 - 玩家 if Level_1_enemy_number[i]: # 判斷玩家子彈是否擊中電腦 hits = pygame.sprite.spritecollide(Level_1_enemy_number[i], Level_1_friendly_bullets, True, pygame.sprite.collide_rect) for hit in hits: Level_1_enemy_number[i].now_health -= Level_1_player_bulletDamage * player.damageMagnification if Level_1_enemy_number[i].hitted == False: Level_1_enemy_number[i].hitted = True if Level_1_enemy_number[i].now_health <= 0: score += 100 # 隨機掉落道具 if GameSave_content['difficult'] == "easy" and random.random() >= 0.6: power = Level_1_powerItem(hit.rect.center) Level_1_all_sprites.add(power) Level_1_powerItems_group.add(power) elif GameSave_content['difficult'] == "normal" and random.random() >= 0.8: power = Level_1_powerItem(hit.rect.center) Level_1_all_sprites.add(power) Level_1_powerItems_group.add(power) elif GameSave_content['difficult'] == "hard" and random.random() >= 0.9: power = Level_1_powerItem(hit.rect.center) Level_1_all_sprites.add(power) Level_1_powerItems_group.add(power) Level_1_all_sprites.remove(Level_1_enemy_number[i]) Level_1_enemy_sprites_group.remove(Level_1_enemy_number[i]) Level_1_enemy_number[i] = Level_1_enemy_soldier(screen, player.rect.centerx, player.rect.centery, Level_1_choice_spawnArea()) Level_1_all_sprites.add(Level_1_enemy_number[i]) Level_1_enemy_sprites_group.add(Level_1_enemy_number[i]) # 判斷電腦 - 掩體 # 判斷電腦是否與掩體相撞 for r in range(1, 8): if Level_1_sandBag[r]: hits = pygame.sprite.collide_rect(Level_1_enemy_number[i], Level_1_sandBag[r]) # 左側沙包 if r == 1 or r == 2: if hits: # 掩體上方 if Level_1_sandBag[r].rect.top < Level_1_enemy_number[i].rect.bottom < (Level_1_sandBag[r].rect.top + Level_1_enemy_number[i].speedy + 1) and Level_1_sandBag[r].rect.left < Level_1_enemy_number[i].rect.right and Level_1_enemy_number[i].rect.left < Level_1_sandBag[r].rect.right: Level_1_enemy_number[i].choice_move_direction = 1 Level_1_enemy_number[i].rect.bottom = Level_1_sandBag[r].rect.top # 掩體左側 if Level_1_sandBag[r].rect.left < Level_1_enemy_number[i].rect.right < Level_1_sandBag[r].rect.centerx and Level_1_sandBag[r].rect.top < Level_1_enemy_number[i].rect.bottom and Level_1_enemy_number[i].rect.top < Level_1_sandBag[r].rect.bottom: Level_1_enemy_number[i].choice_move_direction = 2 Level_1_enemy_number[i].rect.right = Level_1_sandBag[r].rect.left elif Level_1_sandBag[r].rect.left < Level_1_enemy_number[i].rect.centerx < Level_1_sandBag[r].rect.centerx and Level_1_sandBag[r].rect.top < Level_1_enemy_number[i].rect.bottom and Level_1_enemy_number[i].rect.top < Level_1_sandBag[r].rect.bottom: Level_1_enemy_number[i].choice_move_direction = 2 Level_1_enemy_number[i].rect.right = Level_1_sandBag[r].rect.left # 掩體右測 if Level_1_sandBag[r].rect.centerx < Level_1_enemy_number[i].rect.left < Level_1_sandBag[r].rect.right and Level_1_sandBag[r].rect.top < Level_1_enemy_number[i].rect.bottom and Level_1_enemy_number[i].rect.top < Level_1_sandBag[r].rect.bottom: Level_1_enemy_number[i].choice_move_direction = 4 Level_1_enemy_number[i].rect.left = Level_1_sandBag[r].rect.right elif Level_1_sandBag[r].rect.centerx < Level_1_enemy_number[i].rect.centerx < Level_1_sandBag[r].rect.right and Level_1_sandBag[r].rect.top < Level_1_enemy_number[i].rect.bottom and Level_1_enemy_number[i].rect.top < Level_1_sandBag[r].rect.bottom: Level_1_enemy_number[i].choice_move_direction = 4 Level_1_enemy_number[i].rect.left = Level_1_sandBag[r].rect.right # 掩體下方 if (Level_1_sandBag[r].rect.bottom - Level_1_enemy_number[i].speedy - 1) < Level_1_enemy_number[i].rect.top < Level_1_sandBag[r].rect.bottom and Level_1_sandBag[r].rect.left < Level_1_enemy_number[i].rect.right and Level_1_enemy_number[i].rect.left < Level_1_sandBag[r].rect.right: Level_1_enemy_number[i].choice_move_direction = 3 Level_1_enemy_number[i].rect.top = Level_1_sandBag[r].rect.bottom # 右側沙包 if r == 3 or r == 4: if hits: # 掩體上方 if Level_1_sandBag[r].rect.top < Level_1_enemy_number[i].rect.bottom < (Level_1_sandBag[r].rect.top + Level_1_enemy_number[i].speedy + 1) and Level_1_sandBag[r].rect.left < Level_1_enemy_number[i].rect.right and Level_1_enemy_number[i].rect.left < Level_1_sandBag[r].rect.right: Level_1_enemy_number[i].choice_move_direction = 1 Level_1_enemy_number[i].rect.bottom = Level_1_sandBag[r].rect.top # 掩體左側 if Level_1_sandBag[r].rect.left < Level_1_enemy_number[i].rect.right < Level_1_sandBag[r].rect.centerx and Level_1_sandBag[r].rect.top < Level_1_enemy_number[i].rect.bottom and Level_1_enemy_number[i].rect.top < Level_1_sandBag[r].rect.bottom: Level_1_enemy_number[i].choice_move_direction = 2 Level_1_enemy_number[i].rect.right = Level_1_sandBag[r].rect.left elif Level_1_sandBag[r].rect.left < Level_1_enemy_number[i].rect.centerx < Level_1_sandBag[r].rect.centerx and Level_1_sandBag[r].rect.top < Level_1_enemy_number[i].rect.bottom and Level_1_enemy_number[i].rect.top < Level_1_sandBag[r].rect.bottom: Level_1_enemy_number[i].choice_move_direction = 2 Level_1_enemy_number[i].rect.right = Level_1_sandBag[r].rect.left # 掩體右測 if Level_1_sandBag[r].rect.centerx < Level_1_enemy_number[i].rect.left < Level_1_sandBag[r].rect.right and Level_1_sandBag[r].rect.top < Level_1_enemy_number[i].rect.bottom and Level_1_enemy_number[i].rect.top < Level_1_sandBag[r].rect.bottom: Level_1_enemy_number[i].choice_move_direction = 4 Level_1_enemy_number[i].rect.left = Level_1_sandBag[r].rect.right elif Level_1_sandBag[r].rect.centerx < Level_1_enemy_number[i].rect.centerx < Level_1_sandBag[r].rect.right and Level_1_sandBag[r].rect.top < Level_1_enemy_number[i].rect.bottom and Level_1_enemy_number[i].rect.top < Level_1_sandBag[r].rect.bottom: Level_1_enemy_number[i].choice_move_direction = 4 Level_1_enemy_number[i].rect.left = Level_1_sandBag[r].rect.right # 掩體下方 if (Level_1_sandBag[r].rect.bottom - Level_1_enemy_number[i].speedy - 1) < Level_1_enemy_number[i].rect.top < Level_1_sandBag[r].rect.bottom and Level_1_sandBag[r].rect.left < Level_1_enemy_number[i].rect.right and Level_1_enemy_number[i].rect.left < Level_1_sandBag[r].rect.right: Level_1_enemy_number[i].choice_move_direction = 3 Level_1_enemy_number[i].rect.top = Level_1_sandBag[r].rect.bottom # 上方沙包 if r == 5 or r == 6: if hits: # 掩體上方 if Level_1_sandBag[r].rect.top < Level_1_enemy_number[i].rect.bottom < Level_1_sandBag[r].rect.centery and Level_1_sandBag[r].rect.left < Level_1_enemy_number[i].rect.right and Level_1_enemy_number[i].rect.left < Level_1_sandBag[r].rect.right: Level_1_enemy_number[i].choice_move_direction = 1 Level_1_enemy_number[i].rect.bottom = Level_1_sandBag[r].rect.top # 掩體下方 if Level_1_sandBag[r].rect.centery < Level_1_enemy_number[i].rect.top < Level_1_sandBag[r].rect.bottom and Level_1_sandBag[r].rect.left < Level_1_enemy_number[i].rect.right and Level_1_enemy_number[i].rect.left < Level_1_sandBag[r].rect.right: Level_1_enemy_number[i].choice_move_direction = 3 Level_1_enemy_number[i].rect.top = Level_1_sandBag[r].rect.bottom # 下方沙包 if r == 7: if hits: # 掩體上方 if Level_1_sandBag[r].rect.top < Level_1_enemy_number[i].rect.bottom < Level_1_sandBag[r].rect.centery and Level_1_sandBag[r].rect.left < Level_1_enemy_number[i].rect.right and Level_1_enemy_number[i].rect.left < Level_1_sandBag[r].rect.right: Level_1_enemy_number[i].choice_move_direction = 1 Level_1_enemy_number[i].rect.bottom = Level_1_sandBag[r].rect.top # 掩體左側 if Level_1_sandBag[r].rect.left < Level_1_enemy_number[i].rect.right < (Level_1_sandBag[r].rect.left + Level_1_enemy_number[i].speedx + 1) and Level_1_sandBag[r].rect.top < Level_1_enemy_number[i].rect.bottom and Level_1_enemy_number[i].rect.top < Level_1_sandBag[r].rect.bottom: Level_1_enemy_number[i].choice_move_direction = 2 Level_1_enemy_number[i].rect.right = Level_1_sandBag[r].rect.left elif Level_1_sandBag[r].rect.left < Level_1_enemy_number[i].rect.centerx < Level_1_sandBag[r].rect.centerx and Level_1_sandBag[r].rect.top < Level_1_enemy_number[i].rect.bottom and Level_1_enemy_number[i].rect.top < Level_1_sandBag[r].rect.bottom: Level_1_enemy_number[i].choice_move_direction = 2 Level_1_enemy_number[i].rect.right = Level_1_sandBag[r].rect.left # 掩體下方 if Level_1_sandBag[r].rect.centery < Level_1_enemy_number[i].rect.top < Level_1_sandBag[r].rect.bottom and Level_1_sandBag[r].rect.left < Level_1_enemy_number[i].rect.right and Level_1_enemy_number[i].rect.left < Level_1_sandBag[r].rect.right: Level_1_enemy_number[i].choice_move_direction = 3 Level_1_enemy_number[i].rect.top = Level_1_sandBag[r].rect.bottom # 判斷玩家 # 判斷玩家 - 電腦 # 判斷子彈是否擊中玩家 hits = pygame.sprite.spritecollide(player, Level_1_enemy_bullets, True, pygame.sprite.collide_rect) for hit in hits: if player.now_armor <= 0: player.now_health -= Level_1_enemy_bulletDamage * Level_1_enemy_number[i].damageMagnification if player.now_health <= 0 and player.lives > 0: player.lives -= 1 player.now_health = player.health player.now_armor = player.armor player.hide() # 重置彈藥 Use_LargeMagazine = False LargeMagazine_ValidityPeriod = 0 player.magazine_bullets = player.magazine_bullets_original player.last_magazine_bullets = player.magazine_bullets elif player.now_armor - Level_1_enemy_bulletDamage * 0.5 * Level_1_enemy_number[i].damageMagnification >= 0: player.now_armor -= Level_1_enemy_bulletDamage * 0.5 * Level_1_enemy_number[i].damageMagnification else: player.now_health -= (Level_1_enemy_bulletDamage * 0.5 * Level_1_enemy_number[i].damageMagnification) - player.now_armor player.now_armor = 0 # 判斷玩家是否與電腦相撞 for i in range(0, enemy_totalAmount, 1): if Level_1_enemy_number[i]: hits = pygame.sprite.collide_rect(player, Level_1_enemy_number[i]) # 處理電腦 if hits: if player.rect.top <= Level_1_enemy_number[i].rect.bottom < player.rect.centery: if Level_1_enemy_number[i].choice_move_direction == 3: Level_1_enemy_number[i].choice_move_direction = 1 # Level_1_enemy_number[i].rect.bottom = player.rect.top elif player.rect.centerx < Level_1_enemy_number[i].rect.left <= player.rect.right: if Level_1_enemy_number[i].choice_move_direction == 4: Level_1_enemy_number[i].choice_move_direction = 2 # Level_1_enemy_number[i].rect.left = player.rect.right elif player.rect.centery < Level_1_enemy_number[i].rect.top <= player.rect.bottom: if Level_1_enemy_number[i].choice_move_direction == 1: Level_1_enemy_number[i].choice_move_direction = 3 # Level_1_enemy_number[i].rect.top = player.rect.bottom elif player.rect.left <= Level_1_enemy_number[i].rect.right < player.rect.centerx: if Level_1_enemy_number[i].choice_move_direction == 2: Level_1_enemy_number[i].choice_move_direction = 4 # Level_1_enemy_number[i].rect.right = player.rect.left # 處理玩家 if hits: if Level_1_enemy_number[i].rect.centery < player.rect.top <= Level_1_enemy_number[i].rect.bottom: player.rect.top = Level_1_enemy_number[i].rect.bottom elif Level_1_enemy_number[i].rect.centerx < player.rect.left <= Level_1_enemy_number[i].rect.right: player.rect.left = Level_1_enemy_number[i].rect.right elif Level_1_enemy_number[i].rect.top <= player.rect.bottom < Level_1_enemy_number[i].rect.centery: player.rect.bottom = Level_1_enemy_number[i].rect.top elif Level_1_enemy_number[i].rect.left <= player.rect.right < Level_1_enemy_number[i].rect.centerx: player.rect.right = Level_1_enemy_number[i].rect.left # 判斷玩家 - 掩體 # 判斷玩家是否與掩體相撞 for i in range(1, 8): if Level_1_sandBag[i]: hits = pygame.sprite.collide_rect(player, Level_1_sandBag[i]) # 左側沙包 if i == 1 or i == 2: if hits: # 掩體上方 if Level_1_sandBag[i].rect.top < player.rect.bottom < (Level_1_sandBag[i].rect.top + player.speed + 1) and Level_1_sandBag[i].rect.left < player.rect.right and player.rect.left < Level_1_sandBag[i].rect.right: player.rect.bottom = Level_1_sandBag[i].rect.top # 掩體左側 if Level_1_sandBag[i].rect.left < player.rect.right < Level_1_sandBag[i].rect.centerx and Level_1_sandBag[i].rect.top < player.rect.bottom and player.rect.top < Level_1_sandBag[i].rect.bottom: player.rect.right = Level_1_sandBag[i].rect.left elif Level_1_sandBag[i].rect.left < player.rect.centerx < Level_1_sandBag[i].rect.centerx and Level_1_sandBag[i].rect.top < player.rect.bottom and player.rect.top < Level_1_sandBag[i].rect.bottom: player.rect.right = Level_1_sandBag[i].rect.left # 掩體右測 if Level_1_sandBag[i].rect.centerx < player.rect.left < Level_1_sandBag[i].rect.right and Level_1_sandBag[i].rect.top < player.rect.bottom and player.rect.top < Level_1_sandBag[i].rect.bottom: player.rect.left = Level_1_sandBag[i].rect.right elif Level_1_sandBag[i].rect.centerx < player.rect.centerx < Level_1_sandBag[i].rect.right and Level_1_sandBag[i].rect.top < player.rect.bottom and player.rect.top < Level_1_sandBag[i].rect.bottom: player.rect.left = Level_1_sandBag[i].rect.right # 掩體下方 if (Level_1_sandBag[i].rect.bottom - player.speed - 1) < player.rect.top < Level_1_sandBag[i].rect.bottom and Level_1_sandBag[i].rect.left < player.rect.right and player.rect.left < Level_1_sandBag[i].rect.right: player.rect.top = Level_1_sandBag[i].rect.bottom # 右側沙包 if i == 3 or i == 4: if hits: # 掩體上方 if Level_1_sandBag[i].rect.top < player.rect.bottom < (Level_1_sandBag[i].rect.top + player.speed + 1) and Level_1_sandBag[i].rect.left < player.rect.right and player.rect.left < Level_1_sandBag[i].rect.right: player.rect.bottom = Level_1_sandBag[i].rect.top # 掩體左側 if Level_1_sandBag[i].rect.left < player.rect.right < Level_1_sandBag[i].rect.centerx and Level_1_sandBag[i].rect.top < player.rect.bottom and player.rect.top < Level_1_sandBag[i].rect.bottom: player.rect.right = Level_1_sandBag[i].rect.left elif Level_1_sandBag[i].rect.left < player.rect.centerx < Level_1_sandBag[i].rect.centerx and Level_1_sandBag[i].rect.top < player.rect.bottom and player.rect.top < Level_1_sandBag[i].rect.bottom: player.rect.right = Level_1_sandBag[i].rect.left # 掩體右測 if Level_1_sandBag[i].rect.centerx < player.rect.left < Level_1_sandBag[i].rect.right and Level_1_sandBag[i].rect.top < player.rect.bottom and player.rect.top < Level_1_sandBag[i].rect.bottom: player.rect.left = Level_1_sandBag[i].rect.right elif Level_1_sandBag[i].rect.centerx < player.rect.centerx < Level_1_sandBag[i].rect.right and Level_1_sandBag[i].rect.top < player.rect.bottom and player.rect.top < Level_1_sandBag[i].rect.bottom: player.rect.left = Level_1_sandBag[i].rect.right # 掩體下方 if (Level_1_sandBag[i].rect.bottom - player.speed - 1) < player.rect.top < Level_1_sandBag[i].rect.bottom and Level_1_sandBag[i].rect.left < player.rect.right and player.rect.left < Level_1_sandBag[i].rect.right: player.rect.top = Level_1_sandBag[i].rect.bottom # 上方沙包 if i == 5 or i == 6: if hits: # 掩體上方 if Level_1_sandBag[i].rect.top < player.rect.bottom < Level_1_sandBag[i].rect.centery and Level_1_sandBag[i].rect.left < player.rect.right and player.rect.left < Level_1_sandBag[i].rect.right: player.rect.bottom = Level_1_sandBag[i].rect.top # 掩體下方 if Level_1_sandBag[i].rect.centery < player.rect.top < Level_1_sandBag[i].rect.bottom and Level_1_sandBag[i].rect.left < player.rect.right and player.rect.left < Level_1_sandBag[i].rect.right: player.rect.top = Level_1_sandBag[i].rect.bottom # # 下方沙包 # if i == 7: # if hits: # # 掩體上方 # if Level_1_sandBag[i].rect.top < player.rect.bottom < Level_1_sandBag[i].rect.centery and Level_1_sandBag[i].rect.left < player.rect.right and player.rect.left < Level_1_sandBag[i].rect.right: # player.rect.bottom = Level_1_sandBag[i].rect.top # # 掩體左側 # if Level_1_sandBag[i].rect.left < player.rect.right < (Level_1_sandBag[i].rect.left + player.speed + 1) and Level_1_sandBag[i].rect.top < player.rect.bottom and player.rect.top < Level_1_sandBag[i].rect.bottom: # player.rect.right = Level_1_sandBag[i].rect.left # elif Level_1_sandBag[i].rect.left < player.rect.centerx < Level_1_sandBag[i].rect.centerx and Level_1_sandBag[i].rect.top < player.rect.bottom and player.rect.top < Level_1_sandBag[i].rect.bottom: # player.rect.right = Level_1_sandBag[i].rect.left # # 掩體下方 # if Level_1_sandBag[i].rect.centery < player.rect.top < Level_1_sandBag[i].rect.bottom and Level_1_sandBag[i].rect.left < player.rect.right and player.rect.left < Level_1_sandBag[i].rect.right: # player.rect.top = Level_1_sandBag[i].rect.bottom # 判斷玩家是否取得道具 hits = pygame.sprite.spritecollide(player, Level_1_powerItems_group, True) for hit in hits: if hit.powerType == 'Medkit': player.now_health += 25 if player.now_health > player.health: player.now_health = player.health if hit.powerType == 'ArmorPack': player.now_armor += 50 if player.now_armor > 200: player.now_armor = 200 if hit.powerType == 'LargeMagazine': if not Use_LargeMagazine: StartUse_LargeMagazine_Time = nowTime Use_LargeMagazine = True LargeMagazine_ValidityPeriod += 15000 if player.magazine_bullets == player.magazine_bullets_original: player.magazine_bullets *= 2 if player.last_magazine_bullets < player.magazine_bullets: player.last_magazine_bullets = player.magazine_bullets if player.startReloadBullet: player.startReloadBullet = False if player.pressed_reload_key: player.pressed_reload_key = False if player.play_reload_sound: player.play_reload_sound = False if hit.powerType == 'HighSpeedReload': sound_rifle_reload.play() player.last_magazine_bullets = player.magazine_bullets if player.startReloadBullet: player.startReloadBullet = False if player.pressed_reload_key: player.pressed_reload_key = False if player.play_reload_sound: player.play_reload_sound = False # 判斷掩體 # 判斷掩體 - 電腦 # 判斷電腦子彈是否擊中掩體 for i in range(1, 8): if Level_1_sandBag[i]: hits = pygame.sprite.spritecollide(Level_1_sandBag[i], Level_1_enemy_bullets, True, pygame.sprite.collide_rect) for hit in hits: Level_1_sandBag[i].now_health -= int(Level_1_enemy_bulletDamage * Level_1_enemy_number[0].damageMagnification) if Level_1_sandBag[i].hitted == False: Level_1_sandBag[i].hitted = True if Level_1_sandBag[i].now_health <= 0: Level_1_all_sprites.remove(Level_1_sandBag[i]) Level_1_friendly_sprites_group.remove(Level_1_sandBag[i]) Level_1_sandBag[i] = None # 檢查玩家是否失敗 if player.now_health <= 0 and player.lives <= 0: pygame.mouse.set_visible(True) # 啟用關卡初始化 show_levelTrip = True # 檢查是否完成過遊戲 if GameSave_content['PassGame']: GameSave_content["game_checkpoint"] = 4 # 更新存檔 with open(GAMESAVE_FILE_ADDRESS, 'wb') as gamesave: pickle.dump(GameSave_content, gamesave) break else: # 呼叫遊戲失敗畫面 failureLevelScreen_return = draw_failureLevelScreen(screen) if failureLevelScreen_return: # 重新遊玩本關 # 啟用關卡初始化 show_levelTrip = True break else: # 啟用關卡初始化 show_levelTrip = True # 回到主畫面 startPlayGame_Button_clicked = False gameSave_readTimes = 0 break # 檢查是否完成通關條件 if nowTime - Level_1_startPlayTime - pauseTime >= Level_1_remaining_LevelTime: pygame.mouse.set_visible(True) # 啟用關卡初始化 show_levelTrip = True # 更新記錄點 GameSave_content["game_checkpoint"] = 1 # 記錄分數 GameSave_content['Score_Level_1'] = score if GameSave_content['Score_Level_1'] > GameSave_content['history_HighestScore_Level_1']: GameSave_content['history_HighestScore_Level_1'] = GameSave_content['Score_Level_1'] # 記錄遊玩時間(Sec) GameSave_content['PlayTime_Level_1'] = int((nowTime - Level_1_startPlayTime - pauseTime) / 1000) GameSave_content['PlayTime_Level_1_total'] += int((nowTime - Level_1_startPlayTime - pauseTime) / 1000) GameSave_content['PlayTime_total'] += GameSave_content['PlayTime_Level_1'] # 檢查是否完成過遊戲 if GameSave_content['PassGame']: GameSave_content["game_checkpoint"] = 4 # 更新存檔 with open(GAMESAVE_FILE_ADDRESS, 'wb') as gamesave: pickle.dump(GameSave_content, gamesave) # 呼叫通關畫面 passLevelScreen_return = draw_passLevelScreen(screen, 1) if passLevelScreen_return: # 前往下一關 # 啟用下一關關卡初始化 show_levelTrip = True break else: # 啟用下一關關卡初始化 show_levelTrip = True # 回到主畫面 startPlayGame_Button_clicked = False gameSave_readTimes = 0 break # 畫面顯示 # screen.fill((255, 255, 150)) screen.blit(image_background_desert, (0, 0)) Level_1_all_sprites.draw(screen) screen.blit(image_playerInformactionUI_background, (0, 0)) if player.shoot_mode == "auto": screen.blit(image_playerInformactionUI_background_autoMode, (1236, 681)) else: screen.blit(image_playerInformactionUI_background_singleMode, (1236, 681)) # 可視化圓形碰撞箱 # pygame.draw.circle(screen, (0, 255, 0), player.rect.center, player.radius) # for i in range(0, enemy_totalAmount, 1): # if Level_1_enemy_number[i]: # pygame.draw.circle(screen, (0, 255, 0), Level_1_enemy_number[i].rect.center, Level_1_enemy_number[i].radius) # 繪製血量 # 敵人 for i in range(0, enemy_totalAmount, 1): if Level_1_enemy_number[i] and Level_1_enemy_number[i].hitted: draw_health(screen, Level_1_enemy_number[i].now_health, Level_1_enemy_number[i].health, (Level_1_enemy_number[i].rect.centerx - 25), (Level_1_enemy_number[i].rect.top - 10), (255, 0, 0), (0, 0, 0)) for i in range(1, 8): if Level_1_sandBag[i] and Level_1_sandBag[i].hitted: draw_health(screen, Level_1_sandBag[i].now_health, Level_1_sandBag[i].health, (Level_1_sandBag[i].rect.centerx - 25), (Level_1_sandBag[i].rect.centery - 3), (0, 255, 0), (0, 0, 0)) # 畫角色資訊 draw_lives(screen, player.lives, image_player_livesIcon, 29, 638, 34) draw_Level_1_playerInformactionUI(screen, player, score, Level_1_startPlayTime + pauseTime) if Use_LargeMagazine: if nowTime - StartUse_LargeMagazine_Time < LargeMagazine_ValidityPeriod: screen.blit(image_large_magazine_rifle_status, (1240, 49)) draw_text("center", screen, str(int((LargeMagazine_ValidityPeriod - (nowTime - StartUse_LargeMagazine_Time)) / 1000)), (0, 0, 0), 22, False, 1255, 96) # 畫ESC選單 if Escape_KeyDown: pauseTimeSt = nowTime pygame.mouse.set_visible(True) screen.blit(image_setting_panel_background, (0, 0)) escape_screen_return = draw_Key_escape_screen(screen) # 繼續遊戲 if escape_screen_return == 1: nowTime = pygame.time.get_ticks() pauseTime += nowTime - pauseTimeSt if Use_LargeMagazine: LargeMagazine_ValidityPeriod += nowTime - pauseTimeSt escape_screen_return = 0 Escape_KeyDown = False pygame.mouse.set_visible(False) # 回到主畫面 elif escape_screen_return == 2: nowTime = pygame.time.get_ticks() pauseTime += nowTime - pauseTimeSt escape_screen_return = 0 Escape_KeyDown = False pygame.mouse.set_visible(True) # 啟用關卡初始化 show_levelTrip = True gameSave_readTimes = 0 # 結束遊戲 startPlayGame_Button_clicked = False # 離開遊戲 elif escape_screen_return == 3: escape_screen_return = 0 program_running = False startPlayGame_Button_clicked = False pygame.display.update() # 關卡二 while GameSave_content["game_checkpoint"] == 1 and startPlayGame_Button_clicked: clock.tick(FPS) # 現在時間(ticks) 1tick = 1ms nowTime = pygame.time.get_ticks() # 初始化 if show_levelTrip: close = Level_2_draw_levelTrip() if close: program_running = False startPlayGame_Button_clicked = False break show_levelTrip = False # 隱藏滑鼠 pygame.mouse.set_visible(False) score = 0 pauseTime = 0 nowRound = 0 round_colddown = 1000 totalRocksAmount = 8 killEnemyAmount = 0 Use_TurretUpgrade = False StartUse_TurretUpgrade_Time = 0 Level_2_summonBOSS_time = 0 Level_2_player_lazerDamage = 30 Level_2_player_missileDamage = 220 Level_2_enemy_lazerDamage = 20 Level_2_enemy_missileDamage = 160 Level_2_enemy_damageMagnification = 0 Level_2_enemy_damageMagnification_get = Level_2_enemy_plane(screen, -100, -100) Level_2_enemy_damageMagnification = Level_2_enemy_damageMagnification_get.damageMagnification Level_2_enemy_damageMagnification_get = None # 招術紀錄 Level_2_enemy_BOSS_Skill_1_Done = {} Level_2_enemy_BOSS_Skill_1_Done[1] = False Level_2_enemy_BOSS_Skill_1_Done[2] = False Level_2_enemy_BOSS_Skill_1_Done[3] = False Level_2_enemy_BOSS_Skill_2_Done = {} Level_2_enemy_BOSS_Skill_2_Done[1] = False Level_2_enemy_BOSS_Skill_2_Done[2] = False Level_2_enemy_BOSS_Skill_3_Done = {} Level_2_enemy_BOSS_Skill_3_Done[1] = False Level_2_startPlayTime = pygame.time.get_ticks() Level_2_finishRound = False Level_2_finishRoundTime = 0 Level_2_enemy_number = {} Level_2_enemy_BOSS = None # 所有物件 Level_2_all_sprites = pygame.sprite.Group() # 各項物件分組 Level_2_lazers = pygame.sprite.Group() Level_2_missiles = pygame.sprite.Group() Level_2_rocks = pygame.sprite.Group() # 物件分組 Level_2_friendly_sprites_group = pygame.sprite.Group() Level_2_friendly_lazers = pygame.sprite.Group() Level_2_friendly_missiles = pygame.sprite.Group() Level_2_enemy_sprites_group = pygame.sprite.Group() Level_2_enemy_lazers = pygame.sprite.Group() Level_2_enemy_missiles = pygame.sprite.Group() Level_2_powerItems_group = pygame.sprite.Group() # 創建玩家 player = Level_2_Player_plane(screen) # 添增玩家至群組 Level_2_all_sprites.add(player) Level_2_friendly_sprites_group.add(player) # 創造石頭 for i in range(totalRocksAmount): Level_2_new_rocks() # 重置電腦 for i in range(0, 7, 1): Level_2_enemy_number[i] = None for event in pygame.event.get(): if event.type == pygame.QUIT: program_running = False startPlayGame_Button_clicked = False elif event.type == pygame.KEYDOWN: if event.key == pygame.K_ESCAPE: Escape_KeyDown = True if event.key == pygame.K_b: if player.shoot_mode == "auto": player.shoot_mode = "missile" elif player.shoot_mode == "missile": player.shoot_mode = "auto" if nowRound == 0 and nowTime - Level_2_startPlayTime > round_colddown: # 生成電腦 Level_2_enemy_number[1] = Level_2_enemy_plane(screen, 320, 100) Level_2_enemy_number[2] = Level_2_enemy_plane(screen, WIDTH / 2, 100) Level_2_enemy_number[3] = Level_2_enemy_plane(screen, 960, 100) Level_2_enemy_number[4] = Level_2_enemy_plane(screen, 427, 200) Level_2_enemy_number[5] = Level_2_enemy_plane(screen, 853, 200) for i in range(1, 6): Level_2_all_sprites.add(Level_2_enemy_number[i]) Level_2_enemy_sprites_group.add(Level_2_enemy_number[i]) nowRound = 1 elif nowRound == 1 and killEnemyAmount == 5 and nowTime - Level_2_finishRoundTime > round_colddown: # 生成電腦 Level_2_enemy_number[1] = Level_2_enemy_plane(screen, 320, 70) Level_2_enemy_number[2] = Level_2_enemy_plane(screen, WIDTH / 2, 70) Level_2_enemy_number[3] = Level_2_enemy_plane(screen, 960, 70) Level_2_enemy_number[4] = Level_2_enemy_plane(screen, 427, 140) Level_2_enemy_number[5] = Level_2_enemy_plane(screen, 853, 140) Level_2_enemy_number[6] = Level_2_enemy_plane(screen, WIDTH / 2, 200) for i in range(1, 7): Level_2_all_sprites.add(Level_2_enemy_number[i]) Level_2_enemy_sprites_group.add(Level_2_enemy_number[i]) Level_2_finishRound = False nowRound = 2 elif nowRound == 2 and killEnemyAmount == 11 and nowTime - Level_2_finishRoundTime > round_colddown: # 生成BOSS Level_2_enemy_BOSS = Level_2_enemy_BOSS_plane(screen, 320, 70) Level_2_all_sprites.add(Level_2_enemy_BOSS) Level_2_enemy_sprites_group.add(Level_2_enemy_BOSS) Level_2_finishRound = False Level_2_summonBOSS_time = nowTime nowRound = 3 # 敵人BOSS全場技能 if Level_2_enemy_BOSS: # 到達指定時間 if nowTime - Level_2_summonBOSS_time > 45000 and not Level_2_enemy_BOSS_Skill_1_Done[1]: # 施放招式一 (1) Level_2_enemy_BOSS.skill(1) Level_2_enemy_BOSS_Skill_1_Done[1] = True if nowTime - Level_2_summonBOSS_time > 130000 and not Level_2_enemy_BOSS_Skill_2_Done[1]: # 施放招式二 (1) Level_2_enemy_BOSS.skill(2) Level_2_enemy_BOSS_Skill_2_Done[1] = True # 低於指定狀態 if (Level_2_enemy_BOSS.now_armor / Level_2_enemy_BOSS.armor) <= 0.5 and not Level_2_enemy_BOSS_Skill_1_Done[2]: # 施放招式一 (2) Level_2_enemy_BOSS.skill(1) Level_2_enemy_BOSS_Skill_1_Done[2] = True if (Level_2_enemy_BOSS.now_armor / Level_2_enemy_BOSS.armor) <= 0 and not Level_2_enemy_BOSS_Skill_1_Done[3]: # 施放招式一 (3) Level_2_enemy_BOSS.skill(1) Level_2_enemy_BOSS_Skill_1_Done[3] = True if (Level_2_enemy_BOSS.now_health / Level_2_enemy_BOSS.health) <= 0.5 and not Level_2_enemy_BOSS_Skill_2_Done[2]: # 施放招式二 (2) Level_2_enemy_BOSS.skill(2) Level_2_enemy_BOSS_Skill_2_Done[2] = True if (Level_2_enemy_BOSS.now_health / Level_2_enemy_BOSS.health) <= 0.2 and not Level_2_enemy_BOSS_Skill_3_Done[1]: # 施放招式三 (1) Level_2_enemy_BOSS.skill(3) Level_2_enemy_BOSS_Skill_3_Done[1] = True # 更新遊戲 Level_2_all_sprites.update() # 是否使用擴大射擊道具 if Use_TurretUpgrade: if nowTime - StartUse_TurretUpgrade_Time > player.gun_turboTime: player.gun = 1 player.gun_turboTime = 0 Use_TurretUpgrade = False # 玩家 # 玩家 - 隕石 # 判斷玩家雷射是否擊中隕石 hits = pygame.sprite.groupcollide(Level_2_rocks, Level_2_friendly_lazers, True, True) for hit in hits: score += hit.radius Level_2_summon_powerItem(hit.rect.center) Level_2_new_rocks() # 判斷玩家飛彈是否擊中隕石 hits = pygame.sprite.groupcollide(Level_2_rocks, Level_2_friendly_missiles, True, True) for hit in hits: score += hit.radius Level_2_summon_powerItem(hit.rect.center) Level_2_new_rocks() # 玩家 - 敵人 # 判斷玩家雷射是否擊中敵人 hits = pygame.sprite.groupcollide(Level_2_enemy_sprites_group, Level_2_friendly_lazers, False, True) for hit in hits: if hit.hitted == False: hit.hitted = True if hit.now_armor <= 0: hit.now_health -= Level_2_player_lazerDamage * player.damageMagnification * 1.2 if hit.now_health <= 0: killEnemyAmount += 1 score += 500 if hit.hitted == True: hit.hitted = False Level_2_all_sprites.remove(hit) Level_2_enemy_sprites_group.remove(hit) Level_2_summon_powerItem(hit.rect.center) hit = None elif hit.now_armor - (Level_2_player_lazerDamage * player.damageMagnification) >= 0: hit.now_armor -= Level_2_player_lazerDamage * player.damageMagnification else: hit.now_health -= ((Level_2_player_lazerDamage * player.damageMagnification) - hit.now_armor) * 1.2 hit.now_armor = 0 # 判斷玩家飛彈是否擊中敵人 hits = pygame.sprite.groupcollide(Level_2_enemy_sprites_group, Level_2_friendly_missiles, False, True) for hit in hits: if hit.hitted == False: hit.hitted = True if hit.now_armor <= 0: hit.now_health -= Level_2_player_missileDamage * player.damageMagnification * 1.5 if hit.now_health <= 0: killEnemyAmount += 1 score += 500 if hit.hitted == True: hit.hitted = False Level_2_all_sprites.remove(hit) Level_2_enemy_sprites_group.remove(hit) Level_2_summon_powerItem(hit.rect.center) hit = None elif hit.now_armor - (Level_2_player_missileDamage * player.damageMagnification) >= 0: hit.now_armor -= Level_2_player_missileDamage * player.damageMagnification else: hit.now_health -= ((Level_2_player_missileDamage * player.damageMagnification) - hit.now_armor) * 1.5 hit.now_armor = 0 # 判斷玩家是否取得道具 hits = pygame.sprite.spritecollide(player, Level_2_powerItems_group, True) for hit in hits: if hit.powerType == 'Medkit': player.now_health += player.health * 0.25 if player.now_health > player.health: player.now_health = player.health if hit.powerType == 'RepairKit': player.now_armor += player.armor * 0.25 if player.now_armor > player.armor: player.now_armor = player.armor if hit.powerType == 'TurretUpgrade': if not Use_TurretUpgrade: StartUse_TurretUpgrade_Time = nowTime player.gun = 2 Use_TurretUpgrade = True player.gun_turboTime += 15000 # 敵人 # 敵人 - 玩家 # 判斷敵人雷射是否擊中玩家 hits = pygame.sprite.spritecollide(player, Level_2_enemy_lazers, True, pygame.sprite.collide_circle) for hit in hits: if player.now_armor <= 0: player.now_health -= Level_2_enemy_lazerDamage * Level_2_enemy_damageMagnification * 1.2 if player.now_health <= 0 and player.lives > 0: player.lives -= 1 player.now_health = player.health player.now_armor = player.armor player.hide() elif player.now_armor - (Level_2_enemy_lazerDamage * Level_2_enemy_damageMagnification) >= 0: player.now_armor -= Level_2_enemy_lazerDamage * Level_2_enemy_damageMagnification else: player.now_health -= ((Level_2_enemy_lazerDamage * Level_2_enemy_damageMagnification) - player.now_armor) * 1.2 player.now_armor = 0 # 判斷敵人飛彈是否擊中玩家 hits = pygame.sprite.spritecollide(player, Level_2_enemy_missiles, True, pygame.sprite.collide_circle) for hit in hits: if player.now_armor <= 0: player.now_health -= Level_2_enemy_missileDamage * Level_2_enemy_damageMagnification * 1.5 if player.now_health <= 0 and player.lives > 0: player.lives -= 1 player.now_health = player.health player.now_armor = player.armor player.hide() elif player.now_armor - (Level_2_enemy_missileDamage * Level_2_enemy_damageMagnification) >= 0: player.now_armor -= Level_2_enemy_missileDamage * Level_2_enemy_damageMagnification else: player.now_health -= ((Level_2_enemy_missileDamage * Level_2_enemy_damageMagnification) - player.now_armor) * 1.5 player.now_armor = 0 # 隕石 # 隕石 - 玩家 # 判斷隕石是否擊中玩家 hits = pygame.sprite.spritecollide(player, Level_2_rocks, True, pygame.sprite.collide_circle) for hit in hits: Level_2_new_rocks() if player.now_armor <= 0: player.now_health -= hit.radius * 1.2 if player.health <= 0 and player.lives > 0: player.lives -= 1 player.now_health = player.health player.now_armor = player.armor player.hide() elif player.now_armor - hit.radius >= 0: player.now_armor -= hit.radius else: player.now_health -= hit.radius - player.now_armor player.now_armor = 0 # 檢查玩家是否失敗 if player.now_health <= 0 and player.lives <= 0: pygame.mouse.set_visible(True) # 啟用關卡初始化 show_levelTrip = True # 檢查是否完成過遊戲 if GameSave_content['PassGame']: GameSave_content["game_checkpoint"] = 4 # 更新存檔 with open(GAMESAVE_FILE_ADDRESS, 'wb') as gamesave: pickle.dump(GameSave_content, gamesave) break else: # 呼叫遊戲失敗畫面 failureLevelScreen_return = draw_failureLevelScreen(screen) if failureLevelScreen_return: # 重新遊玩本關 # 啟用關卡初始化 show_levelTrip = True break else: # 啟用關卡初始化 show_levelTrip = True # 回到主畫面 startPlayGame_Button_clicked = False gameSave_readTimes = 0 break # 檢查是否完成通關條件 if killEnemyAmount == 12 and Level_2_finishRound: pygame.mouse.set_visible(True) # 啟用關卡初始化 show_levelTrip = True # 更新記錄點 # GameSave_content["game_checkpoint"] = 2 # beta Setting GameSave_content['PassGame'] = True # 記錄分數 GameSave_content['Score_Level_2'] = score if GameSave_content['Score_Level_2'] > GameSave_content['history_HighestScore_Level_2']: GameSave_content['history_HighestScore_Level_2'] = GameSave_content['Score_Level_2'] # 記錄遊玩時間(Sec) GameSave_content['PlayTime_Level_2'] = int((nowTime - Level_2_startPlayTime - pauseTime) / 1000) GameSave_content['PlayTime_Level_2_total'] += int((nowTime - Level_2_startPlayTime - pauseTime) / 1000) GameSave_content['PlayTime_total'] += GameSave_content['PlayTime_Level_2'] # 檢查是否完成過遊戲 if GameSave_content['PassGame']: GameSave_content["game_checkpoint"] = 4 # 更新存檔 with open(GAMESAVE_FILE_ADDRESS, 'wb') as gamesave: pickle.dump(GameSave_content, gamesave) # 呼叫通關畫面 passLevelScreen_return = draw_passLevelScreen(screen, 2) if passLevelScreen_return: # 前往下一關 # 啟用下一關關卡初始化 show_levelTrip = True break else: # 啟用下一關關卡初始化 show_levelTrip = True # 回到主畫面 startPlayGame_Button_clicked = False gameSave_readTimes = 0 break # 是否完成波數 if nowRound == 1 and killEnemyAmount == 5 and not Level_2_finishRound: Level_2_finishRoundTime = nowTime Level_2_finishRound = True elif nowRound == 2 and killEnemyAmount == 11 and not Level_2_finishRound: Level_2_finishRoundTime = nowTime Level_2_finishRound = True elif nowRound == 3 and killEnemyAmount == 12 and not Level_2_finishRound: Level_2_finishRoundTime = nowTime Level_2_finishRound = True # 畫面顯示 # screen.fill((0, 0, 255)) screen.blit(image_background_space, (0, 0)) Level_2_all_sprites.draw(screen) screen.blit(image_playerInformactionUI_background, (0, 0)) screen.blit(image_bullet_missile_small, (1248, 682)) # 繪製血量 # 敵人 for i in range(1, 7): if Level_2_enemy_number[i] and Level_2_enemy_number[i].hitted: draw_spriteStatus(screen, Level_2_enemy_number[i].now_armor, Level_2_enemy_number[i].armor, Level_2_enemy_number[i].now_health, Level_2_enemy_number[i].health, (Level_2_enemy_number[i].rect.centerx - 25), ((Level_2_enemy_number[i].rect.top - 6) + 5), (101, 216, 255), (255, 0, 0), (0, 0, 0)) if Level_2_enemy_BOSS and Level_2_enemy_BOSS.hitted: draw_spriteStatus(screen, Level_2_enemy_BOSS.now_armor, Level_2_enemy_BOSS.armor, Level_2_enemy_BOSS.now_health, Level_2_enemy_BOSS.health, (Level_2_enemy_BOSS.rect.centerx - 25), ((Level_2_enemy_BOSS.rect.top - 6) + 5), (0, 127, 255), (255, 0, 0), (0, 0, 0)) # 畫角色資訊 draw_lives(screen, player.lives, image_player_livesIcon, 29, 638, 34) draw_Level_2_playerInformactionUI(screen, player, score, Level_2_startPlayTime + pauseTime) if Use_TurretUpgrade: if nowTime - StartUse_TurretUpgrade_Time < player.gun_turboTime: screen.blit(image_turretUpgrade_status, (1240, 49)) draw_text("center", screen, str(int((player.gun_turboTime - (nowTime - StartUse_TurretUpgrade_Time)) / 1000)), (255, 255, 255), 22, False, 1255, 96) # 畫ESC選單 if Escape_KeyDown: pauseTimeSt = nowTime pygame.mouse.set_visible(True) screen.blit(image_setting_panel_background, (0, 0)) escape_screen_return = draw_Key_escape_screen(screen) # 繼續遊戲 if escape_screen_return == 1: nowTime = pygame.time.get_ticks() pauseTime += nowTime - pauseTimeSt escape_screen_return = 0 Escape_KeyDown = False pygame.mouse.set_visible(False) if Level_2_summonBOSS_time > 0: Level_2_summonBOSS_time -= nowTime - pauseTimeSt if Use_TurretUpgrade: player.gun_turboTime += nowTime - pauseTimeSt # 回到主畫面 elif escape_screen_return == 2: nowTime = pygame.time.get_ticks() pauseTime += nowTime - pauseTimeSt escape_screen_return = 0 Escape_KeyDown = False pygame.mouse.set_visible(True) # 啟用關卡初始化 show_levelTrip = True gameSave_readTimes = 0 # 結束遊戲 startPlayGame_Button_clicked = False # 離開遊戲 elif escape_screen_return == 3: escape_screen_return = 0 program_running = False startPlayGame_Button_clicked = False pygame.display.update() # 關卡三 while GameSave_content["game_checkpoint"] == 2 and startPlayGame_Button_clicked: clock.tick(FPS) # 初始化 if show_levelTrip: close = Level_3_draw_levelTrip() if close: program_running = False startPlayGame_Button_clicked = False show_levelTrip = False score = 0 for event in pygame.event.get(): if event.type == pygame.QUIT: program_running = False startPlayGame_Button_clicked = False pygame.quit() # 畫面顯示 pygame.display.update() # 結局 while GameSave_content["game_checkpoint"] == 3 and startPlayGame_Button_clicked: clock.tick(FPS) for event in pygame.event.get(): if event.type == pygame.QUIT: program_running = False startPlayGame_Button_clicked = False # 畫面顯示 pygame.display.update() # 遊戲歷程展示廳 while GameSave_content["game_checkpoint"] == 4 and startPlayGame_Button_clicked: clock.tick(FPS) # 初始化 if show_levelTrip: show_levelTrip = False mainScreen_Button = SettingPanel_ArrowButton(940, 677 * (HEIGHT / 720), "主選單", 28, (0, 0, 0), False, button_background_image_normal, button_background_image_move, button_background_image_down, text_font) leaveGame_Button_gameStatistics = SettingPanel_ArrowButton(1160, 677 * (HEIGHT / 720), "離開", 28, (0, 0, 0), False, button_background_image_normal, button_background_image_move, button_background_image_down, text_font) gameMarker_Button = SettingPanel_ArrowButton(720, 677 * (HEIGHT / 720), "遊戲製作", 28, (0, 0, 0), False, button_background_image_normal, button_background_image_move, button_background_image_down, text_font) toLevel_1_Button = SettingPanel_ArrowButton(206, 499 * (HEIGHT / 720), "第一關", 28, (0, 0, 0), False, button_background_image_normal, button_background_image_move, button_background_image_down, text_font) toLevel_2_Button = SettingPanel_ArrowButton(472, 499 * (HEIGHT / 720), "第二關", 28, (0, 0, 0), False, button_background_image_normal, button_background_image_move, button_background_image_down, text_font) toLevel_3_Button = SettingPanel_ArrowButton(748, 499 * (HEIGHT / 720), "第三關", 28, (0, 0, 0), False, button_background_image_normal, button_background_image_move, button_background_image_down, text_font) toLevel_4_Button = SettingPanel_ArrowButton(1024, 499 * (HEIGHT / 720), "結局", 28, (0, 0, 0), False, button_background_image_normal, button_background_image_move, button_background_image_down, text_font) # 獲得滑鼠座標 mouse_x, mouse_y = pygame.mouse.get_pos() for event in pygame.event.get(): if event.type == pygame.QUIT: program_running = False startPlayGame_Button_clicked = False # 滑鼠移動事件 elif event.type == pygame.MOUSEMOTION: # 判斷滑鼠是否移動到按鈕範圍內 mainScreen_Button.getFocus(mouse_x, mouse_y) leaveGame_Button_gameStatistics.getFocus(mouse_x, mouse_y) gameMarker_Button.getFocus(mouse_x, mouse_y) if GameSave_content['PassGame']: toLevel_1_Button.getFocus(mouse_x, mouse_y) toLevel_2_Button.getFocus(mouse_x, mouse_y) toLevel_3_Button.getFocus(mouse_x, mouse_y) toLevel_4_Button.getFocus(mouse_x, mouse_y) # 滑鼠按下 elif event.type == pygame.MOUSEBUTTONDOWN: #滑鼠左鍵按下 if pygame.mouse.get_pressed() == (1, 0, 0): mainScreen_Button.mouseDown(mouse_x, mouse_y) leaveGame_Button_gameStatistics.mouseDown(mouse_x, mouse_y) gameMarker_Button.mouseDown(mouse_x, mouse_y) if GameSave_content['PassGame']: toLevel_1_Button.mouseDown(mouse_x, mouse_y) toLevel_2_Button.mouseDown(mouse_x, mouse_y) toLevel_3_Button.mouseDown(mouse_x, mouse_y) toLevel_4_Button.mouseDown(mouse_x, mouse_y) # 滑鼠彈起 elif event.type == pygame.MOUSEBUTTONUP: mainScreen_Button.mouseUp() leaveGame_Button_gameStatistics.mouseUp() gameMarker_Button.mouseUp() if GameSave_content['PassGame']: toLevel_1_Button.mouseUp() toLevel_2_Button.mouseUp() toLevel_3_Button.mouseUp() toLevel_4_Button.mouseUp() if leaveGame_Button_gameStatistics.bottomMouseUp: leaveGame_Button_gameStatistics.bottomMouseUp = False startPlayGame_Button_clicked = False program_running = False break if mainScreen_Button.bottomMouseUp: mainScreen_Button.bottomMouseUp = False pygame.mouse.set_visible(True) # 啟用關卡初始化 show_levelTrip = True gameSave_readTimes = 0 # 結束遊戲 startPlayGame_Button_clicked = False if gameMarker_Button.bottomMouseUp: close = draw_gameMarkerScreen() if close: program_running = False startPlayGame_Button_clicked = False break gameMarker_Button.bottomMouseUp = False if toLevel_1_Button.bottomMouseUp: toLevel_1_Button.bottomMouseUp = False GameSave_content["game_checkpoint"] = 0 # 更新存檔 with open(GAMESAVE_FILE_ADDRESS, 'wb') as gamesave: pickle.dump(GameSave_content, gamesave) pygame.mouse.set_visible(True) # 啟用關卡初始化 show_levelTrip = True # gameSave_readTimes = 0 # # 結束遊戲 # startPlayGame_Button_clicked = False if toLevel_2_Button.bottomMouseUp: toLevel_2_Button.bottomMouseUp = False GameSave_content["game_checkpoint"] = 1 # 更新存檔 with open(GAMESAVE_FILE_ADDRESS, 'wb') as gamesave: pickle.dump(GameSave_content, gamesave) pygame.mouse.set_visible(True) # 啟用關卡初始化 show_levelTrip = True # if toLevel_3_Button.bottomMouseUp: # toLevel_3_Button.bottomMouseUp = False # GameSave_content["game_checkpoint"] = 2 # # 更新存檔 # with open(GAMESAVE_FILE_ADDRESS, 'wb') as gamesave: # pickle.dump(GameSave_content, gamesave) # pygame.mouse.set_visible(True) # # 啟用關卡初始化 # show_levelTrip = True # if toLevel_4_Button.bottomMouseUp: # toLevel_4_Button.bottomMouseUp = False # GameSave_content["game_checkpoint"] = 3 # # 更新存檔 # with open(GAMESAVE_FILE_ADDRESS, 'wb') as gamesave: # pickle.dump(GameSave_content, gamesave) # pygame.mouse.set_visible(True) # # 啟用關卡初始化 # show_levelTrip = True # 畫面顯示 draw_gameStatisticsScreen(screen) mainScreen_Button.draw(screen) leaveGame_Button_gameStatistics.draw(screen) gameMarker_Button.draw(screen) if GameSave_content['PassGame']: toLevel_1_Button.draw(screen) toLevel_2_Button.draw(screen) toLevel_3_Button.draw(screen) toLevel_4_Button.draw(screen) pygame.display.update() pygame.quit()
50.897055
318
0.578398
23,657
205,675
4.776218
0.039819
0.024586
0.023931
0.023772
0.842147
0.793072
0.743289
0.708641
0.686143
0.657707
0
0.047173
0.323773
205,675
4,041
319
50.897055
0.76514
0.056643
0
0.660359
0
0
0.04238
0.022759
0
0
0
0
0
1
0.033605
false
0.006852
0.000326
0.000653
0.060359
0
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
ac5127dc07b7624b0a4995c5dd44c75ee96ef21e
11,168
py
Python
warpcmap/warpcmap.py
richardeverson/warpcmap
38952960bc3542ae5cb4c22ad788d69a0bf048ae
[ "BSD-3-Clause" ]
null
null
null
warpcmap/warpcmap.py
richardeverson/warpcmap
38952960bc3542ae5cb4c22ad788d69a0bf048ae
[ "BSD-3-Clause" ]
null
null
null
warpcmap/warpcmap.py
richardeverson/warpcmap
38952960bc3542ae5cb4c22ad788d69a0bf048ae
[ "BSD-3-Clause" ]
null
null
null
import numpy as np from scipy.special import betainc from matplotlib import cm, rcParams from matplotlib.colors import ListedColormap from matplotlib.pyplot import gca from scipy.optimize import root_scalar def warp_colormap(basemap, z, beta=1, Nentries=256): """ Construct a new colormap by warping basemap so that the colour in "middle" of the basemap is (ie, corresponding to a value of 0.5) corresponds to the value z and the rate of change of colours around z is given by beta. Parameters ---------- basemap: Matplotlib ColorMap or string naming one. The colormap to warp z: float (0 < z < 1) The location that the middle of the basemap is warped to. For instance, if the basemap is the 'jet' colourmap, so that the middle of the map is green, then in the new colourmap, green corresponds to the value z. beta: float (beta > 0) Beta controls the rate of change of colours close to z. It is approximately the gradient of the mapping between the new colours and the old colours. Values of beta in the range 1 to 5 are usual as they give more resolution to the data values close to z. beta < 1 compresses the colours close to z. Nentries: int Number of entries in the new colourmap. Returns ------- newmap: ListedColormap The warped colourmap. Example ------- Emphasise the data values around 0.8 >>> cmap = warp_colormap('jet', z=0.8, beta=3) >>> imshow(X, cmap=cmap) >>> colorbar() Note ---- If the range of the data is not [0, 1], then z is linearly mapped to the data range so if the data range is (100, 120) and z = 0.8, then the emphasised values will be around 116. """ if isinstance(basemap, str): basemap = cm.get_cmap(basemap) def objective(alpha): return betainc(alpha, beta, z) - 0.5 soln = root_scalar(objective, bracket=(1e-10, 1e2)) alpha = soln.root rgba = np.zeros((Nentries, 4)) for n, y in enumerate(np.linspace(0, 1, Nentries)): x = betainc(alpha, beta, y) rgba[n,:] = basemap(x) newmap = ListedColormap(rgba) return newmap def wimshow(X, cmap=None, vmin=None, vmax=None, vmid=None, beta=1, Nentries=256, ax=None, **kwargs): """ Convenience wrapper for `imshow` for displaying scalar data that allows setting of the range of the data values that the coloramp covers and how it is warped. Parameters ---------- X : array-like The image with scalar data. The data is visualized using a colormap. If RGB or RGBA data is to be displayed, just use `imshow` directly. The two dimensions (M, N) define the rows and columns of the image. cmap : str or `~matplotlib.colors.Colormap`, optional The Colormap instance or registered colormap name used to map scalar data to colors. Defaults to :rc:`image.cmap`. vmin, vmax : scalar, optional When using scalar data and no explicit *norm*, *vmin* and *vmax* define the data range that the colormap covers. By default, the colormap covers the complete value range of the supplied data. *vmin*, *vmax* are ignored if the *norm* parameter is used. vmid: scalar, optional The data value that the middle of the colormap is warped to. For instance, if the colormap is the 'jet' colourmap, so that the middle of the map is green, then in the new colourmap, green corresponds to the value vmid. Default is the middle of the range of the data. beta: scalar > 0, optional Beta controls the rate of change of colours close to *vmid*. Larger values of beta give a more rapid change of colour with data value. Values of beta in the range 1 to 5 are usual as they give more resolution to the data values close to *vmid*. beta < 1 compresses the colours close to *vmid*. Nentries: int, optional Number of entries in the warped colourmap. Default: 256 ax: matplotlib.axes.Axes, optional The Matplotlib axes in which to plot. Default: The current axes. Returns ------- image : `~matplotlib.image.AxesImage` Other Parameters ---------------- All other parameters are passed directly to `imshow`. """ assert len(X.shape) == 2, "wimshow only supports scalar data; use imshow for RGB and RGBA data" if cmap is None: cmap = rcParams['image.cmap'] if vmin is None: vmin = X.min() if vmax is None: vmax = X.max() if vmid is None: vmid = (vmin + vmax)/2 if ax is None: ax = gca() z = (vmid - vmin)/(vmax-vmin) warped = warp_colormap(cmap, z, beta=beta, Nentries=Nentries) return ax.imshow(X, cmap=warped, vmin=vmin, vmax=vmax, **kwargs) def wpcolormesh(*args, cmap=None, vmin=None, vmax=None, vmid=None, beta=1, Nentries=256, ax=None, **kwargs): """ Convenience wrapper for `pcolormesh` for displaying scalar data that allows setting of the range of the data values that the coloramp covers and how it is warped. Call signature:: wpcolormesh([X, Y,] C, **kwargs) *X* and *Y* can be used to specify the corners of the rectangles. Parameters ---------- C : 2D array-like The values to be color-mapped. X, Y : array-like, optional The coordinates of the corners of quadrilaterals of a pcolormesh. See `pcolormesh` for details. cmap : str or `~matplotlib.colors.Colormap`, optional The Colormap instance or registered colormap name used to map scalar data to colors. Defaults to :rc:`image.cmap`. vmin, vmax : scalar, optional When using scalar data and no explicit *norm*, *vmin* and *vmax* define the data range that the colormap covers. By default, the colormap covers the complete value range of the supplied data. *vmin*, *vmax* are ignored if the *norm* parameter is used. vmid: scalar, optional The data value that the middle of the colormap is warped to. For instance, if the colormap is the 'jet' colourmap, so that the middle of the map is green, then in the new colourmap, green corresponds to the value vmid. Default is the middle of the range of the data or (*vmin* + *vmax*)/2 if they are specified. beta: scalar > 0, optional Beta controls the rate of change of colours close to *vmid*. Larger values of beta give a more rapid change of colour with data value. Values of beta in the range 1 to 5 are usual as they give more resolution to the data values close to *vmid*. beta < 1 compresses the colours close to *vmid*. Nentries: int, optional Number of entries in the warped colourmap. Default: 256 ax: matplotlib.axes.Axes, optional The Matplotlib axes in which to plot. Default: The current axes. Returns ------- `matplotlib.collections.QuadMesh` Other Parameters ---------------- All other parameters are passed directly to `pcolormesh`. """ if len(args) == 1: C = args[0] elif len(args) == 3: C = args[2] else: raise TypeError(f'wpcolormesh() takes 1 or 3 positional arguments ' f'but {len(args)} were given') if cmap is None: cmap = rcParams['image.cmap'] if vmin is None: vmin = C.min() if vmax is None: vmax = C.max() if vmid is None: vmid = (vmin + vmax)/2 if ax is None: ax = gca() z = (vmid - vmin)/(vmax-vmin) warped = warp_colormap(cmap, z, beta=beta, Nentries=Nentries) return ax.pcolormesh(*args, cmap=warped, vmin=vmin, vmax=vmax, **kwargs) def wpcolor(*args, cmap=None, vmin=None, vmax=None, vmid=None, beta=1, Nentries=256, ax=None, **kwargs): """ Convenience wrapper for `pcolor` for displaying scalar data that allows setting of the range of the data values that the coloramp covers and how it is warped. Call signature:: wpcolor([X, Y,] C, **kwargs) *X* and *Y* can be used to specify the corners of the rectangles. Parameters ---------- C : 2D array-like The values to be color-mapped. X, Y : array-like, optional The coordinates of the corners of quadrilaterals of a pcolor. See `pcolor` for details. cmap : str or `~matplotlib.colors.Colormap`, optional The Colormap instance or registered colormap name used to map scalar data to colors. Defaults to :rc:`image.cmap`. vmin, vmax : scalar, optional When using scalar data and no explicit *norm*, *vmin* and *vmax* define the data range that the colormap covers. By default, the colormap covers the complete value range of the supplied data. *vmin*, *vmax* are ignored if the *norm* parameter is used. vmid: scalar, optional The data value that the middle of the colormap is warped to. For instance, if the colormap is the 'jet' colourmap, so that the middle of the map is green, then in the new colourmap, green corresponds to the value vmid. Default is the middle of the range of the data or (*vmin* + *vmax*)/2 if they are specified. beta: scalar > 0, optional Beta controls the rate of change of colours close to *vmid*. Larger values of beta give a more rapid change of colour with data value. Values of beta in the range 1 to 5 are usual as they give more resolution to the data values close to *vmid*. beta < 1 compresses the colours close to *vmid*. Nentries: int, optional Number of entries in the warped colourmap. Default: 256 ax: matplotlib.axes.Axes, optional The Matplotlib axes in which to plot. Default: The current axes. Returns ------- `matplotlib.collections.QuadMesh` Other Parameters ---------------- All other parameters are passed directly to `pcolor`. """ if len(args) == 1: C = args[0] elif len(args) == 3: C = args[2] else: raise TypeError(f'wpcolor() takes 1 or 3 positional arguments ' f'but {len(args)} were given') if cmap is None: cmap = rcParams['image.cmap'] if vmin is None: vmin = C.min() if vmax is None: vmax = C.max() if vmid is None: vmid = (vmin + vmax)/2 if ax is None: ax = gca() z = (vmid - vmin)/(vmax-vmin) warped = warp_colormap(cmap, z, beta=beta, Nentries=Nentries) return ax.pcolor(*args, cmap=warped, vmin=vmin, vmax=vmax, **kwargs)
32.184438
99
0.61533
1,577
11,168
4.352568
0.142042
0.022582
0.019231
0.022436
0.783217
0.76792
0.761655
0.753205
0.737179
0.729604
0
0.011935
0.302292
11,168
346
100
32.277457
0.868968
0.660727
0
0.659091
0
0
0.080548
0
0
0
0
0
0.011364
1
0.056818
false
0
0.068182
0.011364
0.181818
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
ac6a0d92c3c2c08928867c749e30dff5b4d58b86
94
py
Python
treebo_hotels/round_01_programming/exceptions_definition.py
DineshDevaraj/interview_answers
8d3d631dc96dc97ebef80604d6455c2c57c8823d
[ "MIT" ]
null
null
null
treebo_hotels/round_01_programming/exceptions_definition.py
DineshDevaraj/interview_answers
8d3d631dc96dc97ebef80604d6455c2c57c8823d
[ "MIT" ]
null
null
null
treebo_hotels/round_01_programming/exceptions_definition.py
DineshDevaraj/interview_answers
8d3d631dc96dc97ebef80604d6455c2c57c8823d
[ "MIT" ]
null
null
null
class RoomAlreadyEmpty(Exception): pass class CannotAllocateRoom(Exception): pass
10.444444
36
0.744681
8
94
8.75
0.625
0.371429
0
0
0
0
0
0
0
0
0
0
0.191489
94
8
37
11.75
0.921053
0
0
0.5
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
5
ac7b76dd1bf0f99687e40dae30efad4529eec283
1,609
py
Python
tests/test_appsync.py
compose-x/troposphere
9a94a8fafd8b4da1cd1f4239be0e7aa0681fd8d4
[ "BSD-2-Clause" ]
4,573
2015-01-02T20:31:04.000Z
2022-03-31T17:15:32.000Z
tests/test_appsync.py
compose-x/troposphere
9a94a8fafd8b4da1cd1f4239be0e7aa0681fd8d4
[ "BSD-2-Clause" ]
1,730
2015-01-02T19:24:47.000Z
2022-03-31T23:22:52.000Z
tests/test_appsync.py
compose-x/troposphere
9a94a8fafd8b4da1cd1f4239be0e7aa0681fd8d4
[ "BSD-2-Clause" ]
1,753
2015-01-01T01:24:12.000Z
2022-03-27T05:36:17.000Z
import unittest from troposphere.appsync import PipelineConfig, Resolver class TestAppsyncResolver(unittest.TestCase): def test_resolver_kind_bad_value(self): with self.assertRaisesRegex(ValueError, "Kind must be one of"): Resolver( "MutationField", DataSourceName="SomeDatasource", FieldName="Field", TypeName="Mutation", ApiId="some_api_id", Kind="SOME_KIND", PipelineConfig=PipelineConfig(Functions=["FunctionId1", "FunctionId"]), RequestMappingTemplateS3Location=("s3://bucket/key.req.vtl"), ResponseMappingTemplateS3Location=("s3://bucket/key.res.vtl"), ) def test_resolver(self): Resolver( "MutationField", DataSourceName="SomeDatasource", FieldName="Field", TypeName="Mutation", ApiId="some_api_id", Kind="PIPELINE", PipelineConfig=PipelineConfig(Functions=["FunctionId1", "FunctionId"]), RequestMappingTemplateS3Location=("s3://bucket/key.req.vtl"), ResponseMappingTemplateS3Location=("s3://bucket/key.res.vtl"), ) Resolver( "MutationField", DataSourceName="SomeDatasource", FieldName="Field", TypeName="Mutation", ApiId="some_api_id", Kind="UNIT", RequestMappingTemplateS3Location=("s3://bucket/key.req.vtl"), ResponseMappingTemplateS3Location=("s3://bucket/key.res.vtl"), )
36.568182
87
0.584214
121
1,609
7.669421
0.38843
0.051724
0.071121
0.158405
0.758621
0.758621
0.758621
0.758621
0.758621
0.758621
0
0.012389
0.2977
1,609
43
88
37.418605
0.80885
0
0
0.684211
0
0
0.231821
0.085768
0
0
0
0
0.026316
1
0.052632
false
0
0.052632
0
0.131579
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
3bb5c0fc0fe5858877ecb95993346d5875103ef1
223
py
Python
indexpy/openapi/__init__.py
2890841438/index.py
0b97d917c06cccc5c95b00a29e24d79b5ced53de
[ "Apache-2.0" ]
null
null
null
indexpy/openapi/__init__.py
2890841438/index.py
0b97d917c06cccc5c95b00a29e24d79b5ced53de
[ "Apache-2.0" ]
null
null
null
indexpy/openapi/__init__.py
2890841438/index.py
0b97d917c06cccc5c95b00a29e24d79b5ced53de
[ "Apache-2.0" ]
null
null
null
from .functions import describe_response, describe_responses, describe_extra_docs from .application import OpenAPI __all__ = [ "describe_extra_docs", "describe_response", "describe_responses", "OpenAPI", ]
22.3
81
0.757848
23
223
6.826087
0.478261
0.203822
0.305732
0.420382
0
0
0
0
0
0
0
0
0.156951
223
9
82
24.777778
0.835106
0
0
0
0
0
0.273543
0
0
0
0
0
0
1
0
false
0
0.25
0
0.25
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
3bdb9d17d118283c4eb5fc730b3d2e32b36fe68c
92
py
Python
backend/tips/admin.py
mnieber/lindyscience
468160aa6da42f45d8c37a2141a077a48410f81d
[ "MIT" ]
null
null
null
backend/tips/admin.py
mnieber/lindyscience
468160aa6da42f45d8c37a2141a077a48410f81d
[ "MIT" ]
21
2020-02-11T23:50:05.000Z
2022-02-27T17:44:29.000Z
backend/tips/admin.py
mnieber/lindyscience
468160aa6da42f45d8c37a2141a077a48410f81d
[ "MIT" ]
null
null
null
from django.contrib import admin from tips import models admin.site.register(models.Tip)
13.142857
32
0.804348
14
92
5.285714
0.714286
0
0
0
0
0
0
0
0
0
0
0
0.130435
92
6
33
15.333333
0.925
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
023617a111a9308b6f16bdaa6cdc9877a3aaa1bf
206
py
Python
plan/urls.py
18892021125/NWU-ACM-MIS-backend
9b6383bca6b5b70c33be41fc692b7adc0c83a366
[ "MIT" ]
5
2021-05-09T10:01:16.000Z
2021-06-18T01:57:30.000Z
plan/urls.py
18892021125/NWU-ACM-MIS-backend
9b6383bca6b5b70c33be41fc692b7adc0c83a366
[ "MIT" ]
1
2021-04-09T15:02:28.000Z
2021-04-09T15:02:28.000Z
plan/urls.py
18892021125/NWU-ACM-MIS-backend
9b6383bca6b5b70c33be41fc692b7adc0c83a366
[ "MIT" ]
3
2021-04-11T07:38:22.000Z
2021-06-20T01:46:45.000Z
from django.urls import path from plan.views import AnnouncementView urlpatterns = [ path('announcement/', AnnouncementView.as_view()), path('announcement/<int:id>/', AnnouncementView.as_view()), ]
29.428571
63
0.742718
23
206
6.565217
0.608696
0.211921
0.291391
0
0
0
0
0
0
0
0
0
0.116505
206
7
64
29.428571
0.82967
0
0
0
0
0
0.169082
0.10628
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
027002f33f3efd3af42de4f7fc0a3ea3790b9600
17
py
Python
semcomp23/Day2/automating-on-daily-tasks/help.py
Muramatsu2602/semcomp23
70ff288652bc361e5358275d9c08d5c48894a8af
[ "MIT" ]
null
null
null
semcomp23/Day2/automating-on-daily-tasks/help.py
Muramatsu2602/semcomp23
70ff288652bc361e5358275d9c08d5c48894a8af
[ "MIT" ]
null
null
null
semcomp23/Day2/automating-on-daily-tasks/help.py
Muramatsu2602/semcomp23
70ff288652bc361e5358275d9c08d5c48894a8af
[ "MIT" ]
null
null
null
print("hey boss")
17
17
0.705882
3
17
4
1
0
0
0
0
0
0
0
0
0
0
0
0.058824
17
1
17
17
0.75
0
0
0
0
0
0.444444
0
0
0
0
0
0
1
0
true
0
0
0
0
1
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
5
02791e68e1355bb7772427508c85b2300b73a3bb
120
py
Python
study/w3resource/exercises/python-basic/031 - 060/python-basic - 041.py
gustavomarquezinho/python
e36779aa5c4bfaf88c587f05db5bd447fd41e4a2
[ "MIT" ]
null
null
null
study/w3resource/exercises/python-basic/031 - 060/python-basic - 041.py
gustavomarquezinho/python
e36779aa5c4bfaf88c587f05db5bd447fd41e4a2
[ "MIT" ]
null
null
null
study/w3resource/exercises/python-basic/031 - 060/python-basic - 041.py
gustavomarquezinho/python
e36779aa5c4bfaf88c587f05db5bd447fd41e4a2
[ "MIT" ]
null
null
null
# 041 - Write a Python program to check whether a file exists. from os.path import isfile print(isfile('file.txt'))
30
62
0.725
20
120
4.35
0.85
0
0
0
0
0
0
0
0
0
0
0.030612
0.183333
120
4
63
30
0.857143
0.5
0
0
0
0
0.135593
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0.5
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
1
0
5
0284f1f686de8156d4dbd653b93dbdd105f30b8e
29
py
Python
morfist/legacy/__init__.py
systemallica/morfist
6a4fd33971558829abdc10d47ec4cea08657002e
[ "MIT" ]
3
2020-08-10T22:18:45.000Z
2021-03-20T20:32:26.000Z
morfist/legacy/__init__.py
systemallica/morfist
6a4fd33971558829abdc10d47ec4cea08657002e
[ "MIT" ]
null
null
null
morfist/legacy/__init__.py
systemallica/morfist
6a4fd33971558829abdc10d47ec4cea08657002e
[ "MIT" ]
1
2020-08-11T02:08:13.000Z
2020-08-11T02:08:13.000Z
from morfist.legacy import *
14.5
28
0.793103
4
29
5.75
1
0
0
0
0
0
0
0
0
0
0
0
0.137931
29
1
29
29
0.92
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
65efa6e8ebd43bc837505287c54713b6528a2046
73
py
Python
featuretools/synthesis/__init__.py
thehomebrewnerd/featuretools
c704cea13e7ed5332712b053e80de360d54f1429
[ "BSD-3-Clause" ]
3
2019-02-14T13:58:56.000Z
2021-11-08T09:23:04.000Z
featuretools/synthesis/__init__.py
BillyOtieno/featuretools
5a7e09edf02b463ad903c6d8c40daa86f208c0c0
[ "BSD-3-Clause" ]
1
2019-03-22T00:30:54.000Z
2019-03-22T00:30:54.000Z
featuretools/synthesis/__init__.py
BillyOtieno/featuretools
5a7e09edf02b463ad903c6d8c40daa86f208c0c0
[ "BSD-3-Clause" ]
1
2020-01-29T05:31:34.000Z
2020-01-29T05:31:34.000Z
from __future__ import absolute_import # flake8: noqa from .api import *
18.25
38
0.794521
10
73
5.3
0.7
0
0
0
0
0
0
0
0
0
0
0.016129
0.150685
73
3
39
24.333333
0.83871
0.164384
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
65fbdbc56ca71e880470961823fba46adedc6027
45
py
Python
teste/err/syntatic/er3.py
brenolf/python-to-c
efba22095b488bede5ff4e57e9c95696b92b7eb8
[ "MIT" ]
2
2016-05-06T01:04:02.000Z
2020-06-15T17:00:50.000Z
teste/err/syntatic/er3.py
brenolf/python-to-c
efba22095b488bede5ff4e57e9c95696b92b7eb8
[ "MIT" ]
null
null
null
teste/err/syntatic/er3.py
brenolf/python-to-c
efba22095b488bede5ff4e57e9c95696b92b7eb8
[ "MIT" ]
null
null
null
#faltou o ':' for x in range(1,10) print x
9
20
0.6
10
45
2.7
0.9
0
0
0
0
0
0
0
0
0
0
0.088235
0.244444
45
4
21
11.25
0.705882
0.266667
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0.5
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
1
0
5
5a3d3525246429ad0ff9f2d8f1eb41e3ab774aff
1,453
py
Python
test/direct_url_test.py
velniukas/jenkinsflow
ca09c4044fc9da683b2233404e071fad506167b8
[ "BSD-3-Clause" ]
12
2015-03-05T14:57:58.000Z
2021-03-30T09:22:04.000Z
test/direct_url_test.py
lhupfeldt/jenkinsflow
0eda66ea4ac4ef9cd2e07149cc9a33f93a6c40b0
[ "BSD-3-Clause" ]
3
2015-02-23T04:32:11.000Z
2016-03-06T11:51:04.000Z
test/direct_url_test.py
velniukas/jenkinsflow
ca09c4044fc9da683b2233404e071fad506167b8
[ "BSD-3-Clause" ]
4
2015-05-28T06:08:04.000Z
2019-08-26T09:35:24.000Z
# Copyright (c) 2012 - 2015 Lars Hupfeldt Nielsen, Hupfeldt IT # All rights reserved. This work is under a BSD license, see LICENSE.TXT. from jenkinsflow.flow import serial from .framework import api_select def test_direct_url_is_public_url(api_type, capsys): with api_select.api(__file__, api_type) as api: api.job('j1', max_fails=0, expect_invocations=1, expect_order=1, params=(('s1', 'Hi', 'desc'), ('c1', ('true', 'maybe', 'false'), 'desc'))) api.job('j2', max_fails=0, expect_invocations=1, expect_order=2, serial=True) with serial(api, timeout=40, job_name_prefix=api.job_name_prefix, report_interval=1, direct_url=api.public_uri) as ctrl: ctrl.invoke('j1', s1='HELLO', c1=True) ctrl.invoke('j2') sout, _ = capsys.readouterr() assert '//job' not in sout assert '/job/' in sout def test_direct_url_trailing_slash(api_type, capsys): with api_select.api(__file__, api_type) as api: api.job('j1', max_fails=0, expect_invocations=1, expect_order=1, params=(('s1', 'Hi', 'desc'),)) api.job('j2', max_fails=0, expect_invocations=1, expect_order=2, serial=True) with serial(api, timeout=40, job_name_prefix=api.job_name_prefix, report_interval=1, direct_url=api.public_uri + '/') as ctrl: ctrl.invoke('j1', s1='HELLO') ctrl.invoke('j2') sout, _ = capsys.readouterr() assert '//job' not in sout assert '/job/' in sout
42.735294
147
0.671714
220
1,453
4.2
0.336364
0.038961
0.038961
0.064935
0.74026
0.74026
0.74026
0.74026
0.74026
0.74026
0
0.03367
0.182381
1,453
33
148
44.030303
0.744108
0.090847
0
0.545455
0
0
0.062974
0
0
0
0
0
0.181818
1
0.090909
false
0
0.090909
0
0.181818
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
5a52fdb2c75fb378c3f33664585860694d616d05
64
py
Python
scanpy/data_structs/__init__.py
gioelelm/scanpy
97391a0e7908b9644b2d6640c8e26d37bdc7811e
[ "BSD-3-Clause" ]
null
null
null
scanpy/data_structs/__init__.py
gioelelm/scanpy
97391a0e7908b9644b2d6640c8e26d37bdc7811e
[ "BSD-3-Clause" ]
null
null
null
scanpy/data_structs/__init__.py
gioelelm/scanpy
97391a0e7908b9644b2d6640c8e26d37bdc7811e
[ "BSD-3-Clause" ]
1
2019-02-18T07:39:59.000Z
2019-02-18T07:39:59.000Z
from .ann_data import AnnData from .data_graph import DataGraph
21.333333
33
0.84375
10
64
5.2
0.7
0
0
0
0
0
0
0
0
0
0
0
0.125
64
2
34
32
0.928571
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
ce9a901de7fc3ab6a2cb9c1848887bf2f0921c60
74
py
Python
models/__init__.py
Rono-Barto-Co/Project-QR
e80fc5a41f25542038c090311844912790cb1478
[ "MIT" ]
3
2019-07-04T03:27:06.000Z
2019-09-06T08:52:35.000Z
models/__init__.py
Rono-Barto-Co/Project-QR
e80fc5a41f25542038c090311844912790cb1478
[ "MIT" ]
null
null
null
models/__init__.py
Rono-Barto-Co/Project-QR
e80fc5a41f25542038c090311844912790cb1478
[ "MIT" ]
null
null
null
from models.UserModel import UserModel from models.QRModel import QRModel
24.666667
38
0.864865
10
74
6.4
0.5
0.3125
0
0
0
0
0
0
0
0
0
0
0.108108
74
2
39
37
0.969697
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
ceb8c03d1f71dd7ee20718b69e74a4ef602c3153
48
py
Python
mc_atlas_uv_resolver/__main__.py
OrangeUtan/mc-atlas-uv-resolver
2cbb74163091a4830172cfd9941116fed30fec8a
[ "MIT" ]
null
null
null
mc_atlas_uv_resolver/__main__.py
OrangeUtan/mc-atlas-uv-resolver
2cbb74163091a4830172cfd9941116fed30fec8a
[ "MIT" ]
null
null
null
mc_atlas_uv_resolver/__main__.py
OrangeUtan/mc-atlas-uv-resolver
2cbb74163091a4830172cfd9941116fed30fec8a
[ "MIT" ]
null
null
null
from mc_atlas_uv_resolver.cli import app app()
12
40
0.8125
9
48
4
0.888889
0
0
0
0
0
0
0
0
0
0
0
0.125
48
3
41
16
0.857143
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
cecc79f6a04409b35bc24a55bc841b77b1354b03
91
py
Python
examples/colab-py/md6.py
chunlin-pan/DYSTA
2f93ba044e35b0a465dd8200bd64f85a14d73fe4
[ "BSD-3-Clause" ]
null
null
null
examples/colab-py/md6.py
chunlin-pan/DYSTA
2f93ba044e35b0a465dd8200bd64f85a14d73fe4
[ "BSD-3-Clause" ]
null
null
null
examples/colab-py/md6.py
chunlin-pan/DYSTA
2f93ba044e35b0a465dd8200bd64f85a14d73fe4
[ "BSD-3-Clause" ]
1
2020-08-26T11:46:54.000Z
2020-08-26T11:46:54.000Z
def module6(): data = 24.897060231734173 print('start {}end'.format('%.2f' % data))
30.333333
46
0.615385
11
91
5.090909
0.909091
0
0
0
0
0
0
0
0
0
0
0.253333
0.175824
91
3
46
30.333333
0.493333
0
0
0
0
0
0.163043
0
0
0
0
0
0
1
0.333333
false
0
0
0
0.333333
0.333333
1
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
5
ced0966c70257714d6697b3c78ef19b167a38ea0
435
py
Python
utils/baseEncode.py
DEMON1A/WEngine
ad506e4bd5f65c32acb6eaab0667f45eb118d559
[ "MIT" ]
5
2021-03-30T23:36:03.000Z
2022-02-01T19:25:19.000Z
utils/baseEncode.py
DEMON1A/WEngine
ad506e4bd5f65c32acb6eaab0667f45eb118d559
[ "MIT" ]
7
2021-04-08T18:53:08.000Z
2021-04-27T07:44:32.000Z
utils/baseEncode.py
DEMON1A/WEngine
ad506e4bd5f65c32acb6eaab0667f45eb118d559
[ "MIT" ]
1
2021-03-30T23:36:16.000Z
2021-03-30T23:36:16.000Z
import base64 def base64Encode(encodeString): encodeString = encodeString.encode('UTF-8') encodeString = base64.b64encode(encodeString) encodeString = encodeString.decode('UTF-8') return encodeString def base32Encode(encodeString): encodeString - encodeString.encode('UTF-8') encodeString = base64.b32encode(enocdeString) encodeString = encodeString.decode('UTF-8') return encodeString
29
50
0.726437
40
435
7.9
0.35
0.531646
0.341772
0.265823
0.734177
0.734177
0.734177
0.405063
0
0
0
0.050279
0.177011
435
15
51
29
0.832402
0
0
0.363636
0
0
0.047393
0
0
0
0
0
0
1
0.181818
false
0
0.090909
0
0.454545
0
0
0
0
null
1
1
1
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
ced665edf354d6e625e1aa2ecab0d4f9094d43fc
382
py
Python
app/app.py
titancat/bms
630c1b6611c26f26e3fe2e5c06cf0f7e02e8649a
[ "MIT" ]
null
null
null
app/app.py
titancat/bms
630c1b6611c26f26e3fe2e5c06cf0f7e02e8649a
[ "MIT" ]
null
null
null
app/app.py
titancat/bms
630c1b6611c26f26e3fe2e5c06cf0f7e02e8649a
[ "MIT" ]
null
null
null
from flask import Flask, render_template app = Flask(__name__) @app.route('/') def hello_world(): return render_template('pages/index.html') @app.route('/login') def render_login(): return render_template('pages/login.html') @app.route('/admin') def render_admin(): return render_template('pages/admin.html') if __name__ == '__main__': app.run(debug = True) 1
18.190476
46
0.701571
52
382
4.788462
0.442308
0.2249
0.240964
0.301205
0
0
0
0
0
0
0
0.00304
0.138743
382
20
47
19.1
0.753799
0
0
0
0
0
0.180628
0
0
0
0
0
0
1
0.214286
false
0
0.071429
0.214286
0.5
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
5
0cab3f4ad22eb1df3434383a1eb67463db777aa5
25
py
Python
extra/ios/mak/setup.py
motor-dev/Motor
98cb099fe1c2d31e455ed868cc2a25eae51e79f0
[ "BSD-3-Clause" ]
4
2015-05-13T16:28:36.000Z
2017-05-24T15:34:14.000Z
extra/ios/mak/setup.py
motor-dev/Motor
98cb099fe1c2d31e455ed868cc2a25eae51e79f0
[ "BSD-3-Clause" ]
null
null
null
extra/ios/mak/setup.py
motor-dev/Motor
98cb099fe1c2d31e455ed868cc2a25eae51e79f0
[ "BSD-3-Clause" ]
1
2017-03-21T08:28:07.000Z
2017-03-21T08:28:07.000Z
def setup(conf): pass
12.5
16
0.64
4
25
4
1
0
0
0
0
0
0
0
0
0
0
0
0.24
25
2
17
12.5
0.842105
0
0
0
0
0
0
0
0
0
0
0
0
1
0.5
false
0.5
0
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
5
0cb420fc1da46f8911e30b9c6a4937575a2c76aa
40
py
Python
venv/Lib/site-packages/hachoir/wx/__main__.py
surendra841/my-sample-test
adafe6d8964d8edcabf9c5e18bde9bdac90904b6
[ "MIT" ]
null
null
null
venv/Lib/site-packages/hachoir/wx/__main__.py
surendra841/my-sample-test
adafe6d8964d8edcabf9c5e18bde9bdac90904b6
[ "MIT" ]
null
null
null
venv/Lib/site-packages/hachoir/wx/__main__.py
surendra841/my-sample-test
adafe6d8964d8edcabf9c5e18bde9bdac90904b6
[ "MIT" ]
null
null
null
from hachoir.wx.main import main main()
13.333333
32
0.775
7
40
4.428571
0.714286
0
0
0
0
0
0
0
0
0
0
0
0.125
40
2
33
20
0.885714
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
0cc0c294cf51a99671d7c270e928c3e70e97bf79
46
py
Python
avw-calc-cli.py
RoboticMind/avw-calc
62bffc9ef7834b9be953088ec347ea7e27bfd330
[ "MIT" ]
2
2021-07-03T17:22:20.000Z
2021-07-06T16:23:41.000Z
avw-calc-cli.py
RoboticMind/avw-calc
62bffc9ef7834b9be953088ec347ea7e27bfd330
[ "MIT" ]
null
null
null
avw-calc-cli.py
RoboticMind/avw-calc
62bffc9ef7834b9be953088ec347ea7e27bfd330
[ "MIT" ]
null
null
null
from avwcalc import main main(GUI_mode=False)
15.333333
24
0.826087
8
46
4.625
0.875
0
0
0
0
0
0
0
0
0
0
0
0.108696
46
3
25
15.333333
0.902439
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
0ce1799ed2e2802146843eb15ad6a72970bdd866
409
py
Python
akad/__init__.py
rachaonline789/hellomod
ef3c8b96790169dd4c7b14458e165c20737dd184
[ "BSD-3-Clause" ]
98
2018-09-25T15:50:18.000Z
2021-09-29T12:52:57.000Z
akad/__init__.py
rachaonline789/hellomod
ef3c8b96790169dd4c7b14458e165c20737dd184
[ "BSD-3-Clause" ]
1
2021-04-30T21:07:04.000Z
2021-04-30T21:07:04.000Z
akad/__init__.py
rachaonline789/hellomod
ef3c8b96790169dd4c7b14458e165c20737dd184
[ "BSD-3-Clause" ]
83
2018-09-27T12:46:57.000Z
2022-03-12T10:54:39.000Z
__all__ = ['ttypes', 'constants', 'AccountSupervisorService', 'SpotService', 'BotService', 'LiffService', 'AgeCheckService', 'BuddyManagementService', 'BuddyService', 'ChannelApplicationProvidedService', 'ChannelService', 'MessageService', 'SnsAdaptorService', 'TalkService', 'UniversalNotificationService', 'CallService', 'AuthService', 'SquareService', 'TicketService', 'LongpollingService', 'ShopService']
204.5
408
0.784841
22
409
14.409091
1
0
0
0
0
0
0
0
0
0
0
0
0.056235
409
1
409
409
0.821244
0
0
0
0
0
0.767726
0.261614
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
0b3dc49156ff635f3b8a45f94cad37d4811ed063
193
py
Python
config_demo.py
spreusler/Twitter-API-Flask
8844ebe1c2b98b00b6748d22d758f607c8bd543b
[ "MIT" ]
null
null
null
config_demo.py
spreusler/Twitter-API-Flask
8844ebe1c2b98b00b6748d22d758f607c8bd543b
[ "MIT" ]
null
null
null
config_demo.py
spreusler/Twitter-API-Flask
8844ebe1c2b98b00b6748d22d758f607c8bd543b
[ "MIT" ]
null
null
null
# Twitter Credentials # Later used in utils.py consumer_key = 'consumer key' consumer_secret = 'consumer_secret' access_token = 'access_token' access_token_secret = 'access_token_secret'
27.571429
44
0.782383
25
193
5.68
0.48
0.309859
0.267606
0.309859
0
0
0
0
0
0
0
0
0.139896
193
6
45
32.166667
0.855422
0.217617
0
0
0
0
0.408451
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
0b3e6cb11bb692e24e0ac8cf792e1d03a3862d22
243
py
Python
triple_store_submitter/__init__.py
ds-wizard/triple-store-submission-service
5c0403895bab0133745a75c39a069202fcb7b463
[ "Apache-2.0" ]
null
null
null
triple_store_submitter/__init__.py
ds-wizard/triple-store-submission-service
5c0403895bab0133745a75c39a069202fcb7b463
[ "Apache-2.0" ]
null
null
null
triple_store_submitter/__init__.py
ds-wizard/triple-store-submission-service
5c0403895bab0133745a75c39a069202fcb7b463
[ "Apache-2.0" ]
null
null
null
from triple_store_submitter.app import init_func from triple_store_submitter.consts import PACKAGE_VERSION, PACKAGE_NAME __version__ = PACKAGE_VERSION __package_name__ = PACKAGE_NAME __all__ = ['init_func', '__version__', '__package_name__']
34.714286
71
0.847737
31
243
5.612903
0.419355
0.321839
0.310345
0.275862
0
0
0
0
0
0
0
0
0.08642
243
6
72
40.5
0.783784
0
0
0
0
0
0.148148
0
0
0
0
0
0
1
0
false
0
0.4
0
0.4
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
0b52ffd562c30be732b252c41827f3aceefb65b3
20
py
Python
working/first_file.py
sudorock/numerical-mooc
0b19e0b0f6b57712642ad6f7ef3fb08832648e79
[ "CC-BY-3.0" ]
null
null
null
working/first_file.py
sudorock/numerical-mooc
0b19e0b0f6b57712642ad6f7ef3fb08832648e79
[ "CC-BY-3.0" ]
null
null
null
working/first_file.py
sudorock/numerical-mooc
0b19e0b0f6b57712642ad6f7ef3fb08832648e79
[ "CC-BY-3.0" ]
null
null
null
print("First file")
10
19
0.7
3
20
4.666667
1
0
0
0
0
0
0
0
0
0
0
0
0.1
20
1
20
20
0.777778
0
0
0
0
0
0.5
0
0
0
0
0
0
1
0
true
0
0
0
0
1
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
5
0b8eae2b07eb0d55571a374443e36e67c17dbb36
42
py
Python
Aula 47 SQLite, Banco de Dados e Tabelas/Aula47.py
JadilsonJR/Python
99eab305249ccd02c31f1913d569a9b601eff06a
[ "MIT" ]
null
null
null
Aula 47 SQLite, Banco de Dados e Tabelas/Aula47.py
JadilsonJR/Python
99eab305249ccd02c31f1913d569a9b601eff06a
[ "MIT" ]
null
null
null
Aula 47 SQLite, Banco de Dados e Tabelas/Aula47.py
JadilsonJR/Python
99eab305249ccd02c31f1913d569a9b601eff06a
[ "MIT" ]
null
null
null
import sqlite3 from sqlite3 import Error
10.5
25
0.833333
6
42
5.833333
0.666667
0
0
0
0
0
0
0
0
0
0
0.057143
0.166667
42
3
26
14
0.942857
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
e7e9214faef5393c216f78ea9968d75c50e9d5d5
25
py
Python
dbus_async/client/__init__.py
hugosenari/dbus_async
50c1a4fef64db99f0de462e27a6b4358b8088ce2
[ "0BSD" ]
1
2016-02-03T06:27:12.000Z
2016-02-03T06:27:12.000Z
dbus_async/client/__init__.py
hugosenari/dbus_async
50c1a4fef64db99f0de462e27a6b4358b8088ce2
[ "0BSD" ]
null
null
null
dbus_async/client/__init__.py
hugosenari/dbus_async
50c1a4fef64db99f0de462e27a6b4358b8088ce2
[ "0BSD" ]
null
null
null
class Object(): pass
8.333333
15
0.6
3
25
5
1
0
0
0
0
0
0
0
0
0
0
0
0.28
25
2
16
12.5
0.833333
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
5
f01580f3ab415ed602d0b86d183a9fdda3838b73
61,642
py
Python
experiments/experiments_gdsc/convergence/nmf_np.py
ThomasBrouwer/BNMTF
34df0c3cebc5e67a5e39762b9305b75d73a2a0e0
[ "Apache-2.0" ]
16
2017-04-19T12:04:47.000Z
2021-12-03T00:50:43.000Z
experiments/experiments_gdsc/convergence/nmf_np.py
ThomasBrouwer/BNMTF
34df0c3cebc5e67a5e39762b9305b75d73a2a0e0
[ "Apache-2.0" ]
1
2017-04-20T11:26:16.000Z
2017-04-20T11:26:16.000Z
experiments/experiments_gdsc/convergence/nmf_np.py
ThomasBrouwer/BNMTF
34df0c3cebc5e67a5e39762b9305b75d73a2a0e0
[ "Apache-2.0" ]
8
2015-12-15T05:29:43.000Z
2019-06-05T03:14:11.000Z
""" Run non-probabilistic NMF on the Sanger dataset. We can plot the MSE, R2 and Rp as it converges, on the entire dataset. We give flat priors (1/10). """ import sys, os project_location = os.path.dirname(__file__)+"/../../../../" sys.path.append(project_location) from BNMTF.code.models.nmf_np import NMF from BNMTF.data_drug_sensitivity.gdsc.load_data import load_gdsc import matplotlib.pyplot as plt ########## standardised = False #standardised Sanger or unstandardised iterations = 1000 I, J, K = 622,138,25 init_UV = 'exponential' expo_prior = 1/10. # Load in data (_,R,M,_,_,_,_) = load_gdsc(standardised=standardised) # Run the VB algorithm nmf = NMF(R,M,K) nmf.initialise(init_UV,expo_prior) nmf.run(iterations) # Extract the performances across all iterations print "np_all_performances = %s" % nmf.all_performances ''' np_all_performances = {'R^2': [-22.1643872605705, -2.0902469601019193, -1.3562010888546325, -1.0391397997295644, -0.8096028382667757, -0.6295226891673975, -0.48390373019903743, -0.3636574230231868, -0.2626526483494671, -0.17658655891385333, -0.1023543530204627, -0.037661047266266845, 0.019226390251019465, 0.06964158065110382, 0.11462802731410404, 0.15501435474586744, 0.19146723675532906, 0.22452936834612958, 0.2546471955437051, 0.2821914931862083, 0.3074728587674941, 0.33075353334556556, 0.35225652937643737, 0.37217275703652897, 0.390666644435382, 0.4078806114893616, 0.42393866204633224, 0.43894929113647874, 0.45300785543272526, 0.4661985194312872, 0.47859586363992335, 0.4902662215325877, 0.5012687973440347, 0.5116566056370462, 0.5214772650493771, 0.5307736720529055, 0.5395845754479721, 0.5479450683179126, 0.5558870110185085, 0.5634393962803982, 0.5706286655103019, 0.5774789837800192, 0.5840124797036692, 0.5902494553597422, 0.5962085705643485, 0.601907005106219, 0.6073606019824858, 0.6125839942022553, 0.617590717334596, 0.6223933096518781, 0.6270034014486761, 0.631431794888718, 0.6356885355415577, 0.6397829766093587, 0.6437238367081624, 0.647519251951996, 0.6511768229900194, 0.6547036575626973, 0.6581064090712583, 0.6613913115925816, 0.6645642117188524, 0.6676305975552885, 0.6705956251694527, 0.6734641427513829, 0.6762407127137899, 0.6789296319353968, 0.6815349503277726, 0.6840604878861085, 0.6865098503667983, 0.6888864437192979, 0.691193487386438, 0.6934340265750615, 0.6956109435886286, 0.6977269683040107, 0.699784687866312, 0.7017865556684562, 0.7037348996755477, 0.7056319301483567, 0.7074797468150746, 0.7092803455357939, 0.7110356245002394, 0.7127473899954351, 0.7144173617766598, 0.7160471780723742, 0.7176384002506637, 0.7191925171728917, 0.720710949257704, 0.7221950522766494, 0.7236461209012549, 0.7250653920192275, 0.7264540478365984, 0.7278132187809356, 0.7291439862196942, 0.7304473850067735, 0.731724405869115, 0.7329759976446115, 0.734203069381548, 0.7354064923089683, 0.7365871016869847, 0.7377456985451034, 0.7388830513161552, 0.7399998973729517, 0.741096944474208, 0.7421748721257824, 0.7432343328629749, 0.7442759534591369, 0.7453003360654686, 0.7463080592866334, 0.7472996791963888, 0.7482757302972861, 0.7492367264279887, 0.7501831616217902, 0.7511155109194811, 0.7520342311394858, 0.7529397616081681, 0.7538325248528109, 0.7547129272596819, 0.755581359699477, 0.7564381981222552, 0.7572838041236682, 0.75811852548451, 0.75894269668512, 0.7597566393962825, 0.7605606629480859, 0.7613550647780791, 0.762140130860063, 0.7629161361145826, 0.7636833448023852, 0.764442010901729, 0.7651923784705794, 0.7659346819945412, 0.7666691467214164, 0.7673959889830535, 0.7681154165053414, 0.7688276287069098, 0.7695328169871907, 0.7702311650044457, 0.770922848944288, 0.7716080377791669, 0.772286893519343, 0.7729595714557043, 0.7736262203949473, 0.7742869828873792, 0.7749419954477794, 0.7755913887695659, 0.7762352879326913, 0.7768738126053827, 0.7775070772401615, 0.7781351912642546, 0.7787582592646958, 0.7793763811682828, 0.7799896524166424, 0.7805981641364955, 0.7812020033054113, 0.7818012529130485, 0.7823959921182015, 0.7829862964016367, 0.7835722377149312, 0.7841538846253789, 0.7847313024570992, 0.7853045534284345, 0.7858736967857101, 0.7864387889334666, 0.7869998835611938, 0.787557031766723, 0.7881102821762191, 0.7886596810609524, 0.7892052724508176, 0.7897470982446774, 0.7902851983176222, 0.7908196106251035, 0.7913503713040504, 0.7918775147709864, 0.7924010738171676, 0.7929210797008057, 0.7934375622363542, 0.7939505498809916, 0.7944600698181858, 0.7949661480385294, 0.79546880941771, 0.795968077791821, 0.796463976029877, 0.7969565261036665, 0.7974457491549766, 0.7979316655600843, 0.7984142949917814, 0.7988936564787191, 0.7993697684622784, 0.7998426488509376, 0.8003123150721461, 0.8007787841217776, 0.8012420726112444, 0.8017021968121849, 0.8021591726989137, 0.8026130159885694, 0.8030637421790485, 0.8035113665847793, 0.8039559043703695, 0.804397370582159, 0.8048357801777571, 0.8052711480536313, 0.8057034890707085, 0.8061328180781889, 0.8065591499354638, 0.8069824995323619, 0.8074028818075916, 0.8078203117656462, 0.8082348044920247, 0.8086463751670071, 0.8090550390778772, 0.8094608116297983, 0.8098637083553022, 0.8102637449224942, 0.8106609371419963, 0.8110553009727506, 0.8114468525266711, 0.8118356080722374, 0.8122215840370872, 0.8126047970096438, 0.8129852637398604, 0.8133630011391024, 0.8137380262792747, 0.8141103563911465, 0.8144800088620543, 0.8148470012329494, 0.8152113511948018, 0.8155730765845348, 0.8159321953804319, 0.8162887256970722, 0.8166426857798699, 0.8169940939992488, 0.8173429688444682, 0.8176893289171858, 0.8180331929247103, 0.8183745796730889, 0.8187135080599791, 0.8190499970673533, 0.8193840657540827, 0.8197157332484475, 0.8200450187405285, 0.8203719414745838, 0.8206965207414014, 0.8210187758706337, 0.8213387262231681, 0.8216563911835212, 0.8219717901523255, 0.8222849425388388, 0.8225958677535965, 0.8229045852011384, 0.8232111142728492, 0.8235154743399631, 0.8238176847466739, 0.8241177648034179, 0.8244157337803063, 0.8247116109007363, 0.8250054153351526, 0.8252971661950375, 0.8255868825270262, 0.8258745833072618, 0.8261602874359206, 0.8264440137319415, 0.8267257809279482, 0.8270056076653804, 0.8272835124898152, 0.8275595138465144, 0.8278336300761313, 0.8281058794106645, 0.8283762799695804, 0.8286448497561556, 0.8289116066539843, 0.8291765684237229, 0.8294397526999873, 0.8297011769884707, 0.8299608586632143, 0.8302188149640932, 0.830475062994449, 0.83072961971894, 0.8309825019614938, 0.831233726403505, 0.83148330958215, 0.8317312678888507, 0.831977617567926, 0.8322223747153674, 0.8324655552777667, 0.8327071750513872, 0.8329472496813577, 0.8331857946610075, 0.8334228253313234, 0.8336583568805285, 0.8338924043437757, 0.8341249826029495, 0.8343561063865836, 0.8345857902698746, 0.8348140486747861, 0.8350408958702631, 0.835266345972528, 0.8354904129454483, 0.8357131106010041, 0.8359344525998262, 0.8361544524517993, 0.8363731235167402, 0.836590479005136, 0.8368065319789495, 0.837021295352486, 0.8372347818932804, 0.8374470042230798, 0.8376579748188575, 0.8378677060138479, 0.8380762099986458, 0.8382834988223384, 0.8384895843936748, 0.838694478482245, 0.8388981927197294, 0.8391007386011274, 0.8393021274860424, 0.8395023705999748, 0.8397014790356443, 0.839899463754304, 0.8400963355871148, 0.8402921052364762, 0.8404867832774111, 0.8406803801589451, 0.8408729062054836, 0.8410643716182122, 0.8412547864764881, 0.8414441607392379, 0.8416325042463522, 0.8418198267200957, 0.8420061377664889, 0.842191446876717, 0.8423757634285023, 0.8425590966875127, 0.8427414558087193, 0.8429228498377828, 0.8431032877124127, 0.8432827782637237, 0.8434613302175795, 0.8436389521959512, 0.8438156527182072, 0.8439914402024609, 0.8441663229668646, 0.8443403092309002, 0.844513407116656, 0.8446856246501002, 0.8448569697623345, 0.8450274502908232, 0.8451970739806339, 0.845365848485643, 0.8455337813697283, 0.8457008801079628, 0.8458671520877672, 0.8460326046100899, 0.8461972448905161, 0.846361080060408, 0.8465241171680201, 0.8466863631795715, 0.8468478249803455, 0.84700850937574, 0.847168423092331, 0.8473275727788834, 0.8474859650073956, 0.8476436062740847, 0.8478005030003866, 0.84795666153393, 0.8481120881494848, 0.8482667890499311, 0.8484207703671693, 0.8485740381630464, 0.8487265984302689, 0.8488784570932708, 0.8490296200091194, 0.8491800929683452, 0.8493298816958312, 0.8494789918516061, 0.8496274290317057, 0.849775198768964, 0.8499223065338198, 0.8500687577351045, 0.8502145577208042, 0.8503597117788401, 0.8505042251378125, 0.8506481029677377, 0.8507913503807792, 0.8509339724319682, 0.8510759741199041, 0.8512173603874559, 0.8513581361224459, 0.8514983061583279, 0.8516378752748439, 0.8517768481986951, 0.8519152296041725, 0.8520530241138048, 0.8521902362989794, 0.8523268706805672, 0.8524629317295207, 0.8525984238674886, 0.8527333514673983, 0.8528677188540508, 0.8530015303046791, 0.8531347900495347, 0.8532675022724379, 0.8533996711113336, 0.8535313006588395, 0.8536623949627734, 0.8537929580266977, 0.8539229938104331, 0.8540525062305803, 0.8541814991610276, 0.8543099764334676, 0.8544379418378691, 0.8545653991229885, 0.8546923519968518, 0.8548188041272324, 0.8549447591421168, 0.8550702206301847, 0.855195192141261, 0.855319677186775, 0.855443679240215, 0.8555672017375664, 0.8556902480777596, 0.8558128216231055, 0.8559349256997114, 0.8560565635979265, 0.856177738572751, 0.8562984538442512, 0.8564187125979773, 0.8565385179853631, 0.8566578731241339, 0.856776781098699, 0.8568952449605526, 0.8570132677286544, 0.8571308523898153, 0.8572480018990907, 0.8573647191801408, 0.8574810071256125, 0.8575968685975094, 0.8577123064275531, 0.8578273234175446, 0.8579419223397221, 0.858056105937123, 0.8581698769239138, 0.8582832379857623, 0.8583961917801619, 0.8585087409367801, 0.858620888057789, 0.858732635718201, 0.8588439864662019, 0.8589549428234751, 0.8590655072855099, 0.8591756823219422, 0.8592854703768572, 0.8593948738691154, 0.8595038951926375, 0.8596125367167381, 0.8597208007864132, 0.8598286897226465, 0.859936205822704, 0.860043351360428, 0.8601501285865336, 0.8602565397288867, 0.8603625869928001, 0.8604682725613058, 0.8605735985954434, 0.8606785672345301, 0.8607831805964373, 0.860887440777864, 0.8609913498545936, 0.8610949098817724, 0.8611981228941613, 0.8613009909064069, 0.8614035159132799, 0.8615056998899494, 0.8616075447922247, 0.8617090525567911, 0.8618102251014854, 0.8619110643255072, 0.8620115721096866, 0.8621117503166927, 0.8622116007912979, 0.8623111253605975, 0.8624103258342233, 0.8625092040046067, 0.8626077616471719, 0.8627060005205683, 0.8628039223668978, 0.862901528911917, 0.8629988218652661, 0.8630958029206663, 0.8631924737561459, 0.8632888360342276, 0.8633848914021531, 0.8634806414920709, 0.8635760879212362, 0.863671232292222, 0.8637660761930909, 0.8638606211976172, 0.8639548688654421, 0.8640488207422883, 0.8641424783601305, 0.864235843237393, 0.864328916879109, 0.8644217007771228, 0.864514196410239, 0.864606405244422, 0.8646983287329503, 0.8647899683165945, 0.8648813254237772, 0.8649724014707418, 0.8650631978617173, 0.8651537159890692, 0.8652439572334719, 0.8653339229640502, 0.8654236145385429, 0.865513033303452, 0.8656021805941887, 0.8656910577352248, 0.8657796660402399, 0.8658680068122543, 0.8659560813437864, 0.8660438909169759, 0.86613143680374, 0.8662187202658805, 0.8663057425552536, 0.8663925049138637, 0.8664790085740239, 0.8665652547584681, 0.8666512446804734, 0.8667369795440001, 0.8668224605437918, 0.8669076888655154, 0.8669926656858721, 0.8670773921727074, 0.8671618694851344, 0.867246098773642, 0.867330081180213, 0.8674138178384241, 0.8674973098735582, 0.867580558402711, 0.8676635645348959, 0.8677463293711435, 0.867828854004609, 0.8679111395206602, 0.8679931869969904, 0.8680749975037054, 0.8681565721034157, 0.8682379118513373, 0.8683190177953773, 0.8683998909762369, 0.8684805324274734, 0.8685609431756192, 0.8686411242402423, 0.8687210766340477, 0.86880080136295, 0.8688802994261587, 0.8689595718162584, 0.8690386195192912, 0.869117443514825, 0.8691960447760383, 0.869274424269789, 0.8693525829566933, 0.8694305217911937, 0.8695082417216362, 0.8695857436903311, 0.8696630286336317, 0.8697400974819901, 0.8698169511600315, 0.8698935905866275, 0.8699700166749331, 0.8700462303324802, 0.8701222324612229, 0.8701980239575957, 0.8702736057125897, 0.8703489786117844, 0.8704241435354366, 0.8704991013585117, 0.870573852950754, 0.8706483991767264, 0.8707227408958863, 0.870796878962618, 0.870870814226286, 0.8709445475313041, 0.871018079717163, 0.8710914116184905, 0.8711645440650994, 0.8712374778820293, 0.8713102138896014, 0.8713827529034536, 0.8714550957345906, 0.8715272431894369, 0.8715991960698568, 0.8716709551732238, 0.8717425212924365, 0.8718138952159814, 0.8718850777279661, 0.8719560696081397, 0.8720268716319614, 0.8720974845706255, 0.8721679091910906, 0.8722381462561263, 0.8723081965243502, 0.8723780607502574, 0.872447739684252, 0.8725172340726954, 0.87258654465793, 0.8726556721783034, 0.8727246173682213, 0.8727933809581649, 0.8728619636747217, 0.8729303662406301, 0.8729985893747905, 0.8730666337923068, 0.8731345002045168, 0.8732021893190102, 0.873269701839668, 0.8733370384666866, 0.8734041998965996, 0.873471186822315, 0.8735379999331343, 0.8736046399147746, 0.873671107449403, 0.8737374032156617, 0.8738035278886829, 0.8738694821401238, 0.8739352666381832, 0.8740008820476279, 0.8740663290298164, 0.87413160824272, 0.8741967203409474, 0.8742616659757603, 0.8743264457951155, 0.8743910604436513, 0.8744555105627436, 0.8745197967905033, 0.8745839197618106, 0.8746478801083236, 0.8747116784585117, 0.8747753154376674, 0.8748387916679162, 0.8749021077682608, 0.8749652643545757, 0.8750282620396344, 0.875091101433137, 0.87515378314171, 0.875216307768939, 0.8752786759153832, 0.8753408881785883, 0.8754029451531071, 0.8754648474305148, 0.8755265955994349, 0.8755881902455376, 0.8756496319515692, 0.8757109212973717, 0.8757720588598877, 0.8758330452131877, 0.8758938809284678, 0.8759545665740908, 0.8760151027155844, 0.8760754899156533, 0.8761357287342096, 0.8761958197283797, 0.8762557634525092, 0.8763155604582021, 0.8763752112943082, 0.8764347165069574, 0.8764940766395622, 0.8765532922328372, 0.8766123638248186, 0.8766712919508624, 0.8767300771436717, 0.8767887199333125, 0.8768472208472096, 0.8769055804101825, 0.8769637991444437, 0.8770218775696123, 0.8770798162027451, 0.8771376155583188, 0.877195276148278, 0.877252798482017, 0.877310183066415, 0.8773674304058356, 0.8774245410021467, 0.8774815153547354, 0.8775383539605071, 0.8775950573139123, 0.8776516259069563, 0.8777080602292086, 0.8777643607678104, 0.8778205280074984, 0.877876562430614, 0.8779324645171027, 0.8779882347445441, 0.8780438735881586, 0.8780993815208072, 0.8781547590130276, 0.8782100065330127, 0.8782651245466621, 0.8783201135175617, 0.878374973907011, 0.8784297061740283, 0.8784843107753684, 0.8785387881655332, 0.8785931387967776, 0.878647363119127, 0.878701461580384, 0.8787554346261498, 0.8788092826998217, 0.878863006242613, 0.8789166056935642, 0.8789700814895527, 0.8790234340653081, 0.879076663853412, 0.8791297712843258, 0.8791827567863857, 0.8792356207858288, 0.879288363706793, 0.8793409859713301, 0.8793934879994255, 0.8794458702089964, 0.8794981330159162, 0.87955027683401, 0.8796023020750812, 0.8796542091489156, 0.8797059984632848, 0.8797576704239697, 0.8798092254347692, 0.8798606638975008, 0.8799119862120245, 0.8799631927762455, 0.8800142839861226, 0.8800652602356931, 0.880116121917063, 0.880166869420438, 0.8802175031341152, 0.8802680234445088, 0.8803184307361539, 0.8803687253917201, 0.8804189077920148, 0.8804689783159974, 0.8805189373407989, 0.880568785241717, 0.8806185223922365, 0.8806681491640361, 0.8807176659270032, 0.8807670730492279, 0.8808163708970402, 0.8808655598349997, 0.8809146402259118, 0.8809636124308345, 0.8810124768090938, 0.8810612337182882, 0.8811098835143113, 0.8811584265513455, 0.8812068631818725, 0.8812551937567012, 0.8813034186249601, 0.8813515381341078, 0.8813995526299566, 0.8814474624566667, 0.8814952679567641, 0.8815429694711486, 0.8815905673391012, 0.8816380618983004, 0.8816854534848201, 0.8817327424331501, 0.8817799290761975, 0.881827013745305, 0.8818739967702545, 0.8819208784792668, 0.8819676591990329, 0.8820143392547031, 0.8820609189699102, 0.8821073986667666, 0.8821537786658793, 0.8822000592863649, 0.8822462408458465, 0.8822923236604708, 0.8823383080449142, 0.8823841943123863, 0.882429982774655, 0.8824756737420398, 0.8825212675234172, 0.8825667644262519, 0.8826121647565776, 0.8826574688190273, 0.8827026769168259, 0.882747789351812, 0.8827928064244388, 0.8828377284337777, 0.8828825556775405, 0.8829272884520731, 0.8829719270523725, 0.8830164717720931, 0.8830609229035606, 0.8831052807377548, 0.8831495455643569, 0.8831937176717235, 0.8832377973469141, 0.8832817848756893, 0.883325680542528, 0.8833694846306146, 0.8834131974218771, 0.8834568191969716, 0.8835003502352953, 0.8835437908149988, 0.8835871412129859, 0.8836304017049308, 0.8836735725652739, 0.8837166540672459, 0.8837596464828463, 0.883802550082888, 0.8838453651369711, 0.8838880919135131, 0.8839307306797409, 0.8839732817017052, 0.8840157452442882, 0.8840581215712064, 0.8841004109450195, 0.8841426136271378, 0.8841847298778264, 0.8842267599562168, 0.8842687041203096, 0.8843105626269772, 0.8843523357319841, 0.8843940236899771, 0.8844356267545019, 0.8844771451780038, 0.8845185792118471, 0.8845599291062975, 0.8846011951105537, 0.8846423774727368, 0.8846834764399006, 0.8847244922580418, 0.8847654251721073, 0.8848062754259891, 0.8848470432625386, 0.8848877289235806, 0.8849283326498977, 0.8849688546812542, 0.8850092952563999, 0.8850496546130685, 0.885089932987986, 0.8851301306168858, 0.8851702477344934, 0.8852102845745586, 0.8852502413698391, 0.8852901183521156, 0.8853299157521998, 0.8853696337999266, 0.8854092727241855, 0.8854488327528978, 0.8854883141130336, 0.8855277170306242, 0.8855670417307522, 0.8856062884375753, 0.8856454573743119, 0.8856845487632614, 0.8857235628258019, 0.8857624997823959, 0.8858013598525999, 0.8858401432550622, 0.8858788502075359, 0.8859174809268766, 0.8859560356290476, 0.8859945145291371, 0.8860329178413417, 0.8860712457789952, 0.886109498554552, 0.8861476763796033, 0.8861857794648874, 0.8862238080202721, 0.8862617622547873, 0.8862996423766067, 0.8863374485930712, 0.8863751811106739, 0.8864128401350889, 0.8864504258711443, 0.8864879385228579, 0.8865253782934244, 0.8865627453852214, 0.886600039999816, 0.8866372623379716, 0.8866744125996464, 0.8867114909840061, 0.886748497689414, 0.8867854329134532, 0.8868222968529187, 0.8868590897038205, 0.8868958116614002, 0.8869324629201232, 0.8869690436736812, 0.8870055541150108, 0.8870419944362782, 0.8870783648289076, 0.8871146654835552, 0.8871508965901428, 0.8871870583378381, 0.8872231509150704, 0.887259174509538, 0.8872951293082031, 0.8873310154972973, 0.8873668332623305, 0.8874025827880906, 0.8874382642586495, 0.8874738778573615, 0.8875094237668778, 0.8875449021691368, 0.8875803132453802, 0.8876156571761489, 0.8876509341412882, 0.887686144319954, 0.8877212878906129, 0.8877563650310479, 0.8877913759183629, 0.88782632072898, 0.8878611996386557, 0.8878960128224698, 0.8879307604548423, 0.8879654427095216, 0.8880000597596028, 0.8880346117775242, 0.888069098935074, 0.8881035214033802, 0.8881378793529355, 0.8881721729535891, 0.8882064023745478, 0.8882405677843827, 0.8882746693510334, 0.8883087072418111, 0.8883426816233971, 0.888376592661856, 0.8884104405226241, 0.8884442253705324, 0.8884779473697861, 0.8885116066839902, 0.8885452034761343, 0.8885787379086167, 0.8886122101432208, 0.8886456203411417, 0.8886789686629736, 0.8887122552687258, 0.8887454803178116, 0.8887786439690656, 0.8888117463807359, 0.8888447877104905, 0.8888777681154275, 0.8889106877520604, 0.8889435467763409, 0.8889763453436483, 0.8890090836088002, 0.8890417617260493, 0.8890743798490931, 0.8891069381310699, 0.8891394367245586, 0.889171875781602, 0.8892042554536805, 0.8892365758917387, 0.8892688372461786, 0.8893010396668538, 0.8893331833030911, 0.8893652683036786, 0.8893972948168742, 0.889429262990406, 0.8894611729714775, 0.8894930249067711, 0.8895248189424381, 0.889556555224124, 0.8895882338969571, 0.8896198551055433, 0.8896514189939883, 0.8896829257058871, 0.8897143753843293, 0.8897457681718985, 0.8897771042106811, 0.8898083836422703, 0.8898396066077574, 0.8898707732477431, 0.8899018837023381, 0.8899329381111691, 0.8899639366133715, 0.8899948793476034, 0.8900257664520337, 0.890056598064366, 0.8900873743218194, 0.8901180953611398, 0.8901487613186064, 0.890179372330027, 0.8902099285307453, 0.8902404300556398, 0.890270877039125, 0.8903012696151601, 0.8903316079172466, 0.8903618920784268, 0.8903921222312949, 0.8904222985079944, 0.8904524210402208, 0.8904824899592216, 0.8905125053958011, 0.8905424674803273, 0.8905723763427157, 0.8906022321124603], 'MSE': [270.92401563963733, 36.142640266340237, 27.557450731000319, 23.849193021120882, 21.164594691897136, 19.058429025515224, 17.355311534290891, 15.948945285986492, 14.767622471548837, 13.761018226074727, 12.892819681291357, 12.136185370926354, 11.470846251947536, 10.881204675039649, 10.355056124585904, 9.8827092465238628, 9.4563668155953433, 9.0696816270156919, 8.7174321763860689, 8.3952819877651663, 8.0995984021348093, 7.8273143234522378, 7.5758214621287188, 7.3428869876110294, 7.1265877959888471, 6.9252581848537886, 6.7374478408416225, 6.5618878372622538, 6.3974629098759657, 6.2431886949250464, 6.0981929202262002, 5.9616997685332036, 5.8330168041324715, 5.7115239839348142, 5.5966643740392943, 5.4879362696398539, 5.3848864759046426, 5.2871045542171933, 5.1942178750133881, 5.1058873476485829, 5.0218037210293973, 4.9416843674214368, 4.865270476914028, 4.7923246022322408, 4.7226285035299362, 4.6559812509358194, 4.5921975493089287, 4.5311062551804806, 4.4725490604249556, 4.4163793210123838, 4.3624610123601268, 4.3106677954659087, 4.2608821802354626, 4.2129947743045202, 4.1669036072457111, 4.122513521407801, 4.0797356217827474, 4.0384867782809382, 3.9986891746338791, 3.9602698988701501, 3.9231605709279429, 3.8872970035059855, 3.85261889271999, 3.8190695355327064, 3.7865955712763704, 3.7551467448924165, 3.7246756897791351, 3.6951377283706859, 3.6664906887766326, 3.6386947359910553, 3.6117122163359165, 3.5855075139472161, 3.5600469182320951, 3.5352985013352733, 3.5112320047511911, 3.4878187343013489, 3.4650314627749776, 3.4428443395973654, 3.4212328069510769, 3.4001735218301103, 3.3796442835530067, 3.3596239663058851, 3.3400924563252863, 3.3210305933619848, 3.3024201161036095, 3.2842436112555742, 3.2664844660096461, 3.2491268236514563, 3.2321555420749308, 3.215556154996948, 3.199314835675549, 3.1834183629547996, 3.1678540894717417, 3.1526099118726041, 3.1376742428998248, 3.1230359852181193, 3.1086845068600186, 3.0946096181810305, 3.0808015502189439, 3.0672509343628853, 3.053948783243321, 3.0408864727597775, 3.0280557251697426, 3.0154485931679993, 3.0030574448892224, 2.9908749497724401, 2.9788940652302802, 2.9671080240688981, 2.9555103226094488, 2.9440947094637178, 2.932855174922381, 2.9217859409140265, 2.9108814514981045, 2.9001363638576181, 2.8895455397576835, 2.8791040374406416, 2.8688071039295067, 2.8586501677129585, 2.8486288317871624, 2.8387388670333031, 2.8289762059071726, 2.8193369364228507, 2.809817296411302, 2.8004136680367138, 2.7911225725550062, 2.7819406652987921, 2.7728647308763974, 2.7638916785700722, 2.7550185379231027, 2.7462424545036743, 2.7375606858355481, 2.7289705974851688, 2.7204696592974149, 2.7120554417699902, 2.7037256125599218, 2.6954779331144612, 2.6873102554193657, 2.6792205188583429, 2.6712067471781911, 2.6632670455534648, 2.6553995977465732, 2.6476026633571594, 2.6398745751578043, 2.6322137365108831, 2.6246186188637424, 2.6170877593172066, 2.6096197582660836, 2.6022132771065802, 2.5948670360093029, 2.5875798117543622, 2.5803504356266509, 2.5731777913683356, 2.5660608131874794, 2.5589984838194315, 2.551989832640996, 2.5450339338336629, 2.5381299045960861, 2.531276903403298, 2.5244741283119345, 2.517720815309874, 2.511016236709263, 2.5043596995821109, 2.4977505442371193, 2.4911881427374518, 2.484671897457555, 2.4782012396797808, 2.4717756282286536, 2.4653945481431769, 2.4590575093862972, 2.4527640455904138, 2.4465137128394794, 2.4403060884863561, 2.4341407700052744, 2.4280173738791317, 2.4219355345208644, 2.4158949032291961, 2.4098951471771444, 2.4039359484346803, 2.3980170030233072, 2.3921380200041278, 2.3862987205970487, 2.3804988373326448, 2.3747381132351939, 2.3690163010364307, 2.363333162421275, 2.3576884673024106, 2.3520819931261983, 2.3465135242075501, 2.3409828510940476, 2.3354897699592532, 2.3300340820243135, 2.324615593006925, 2.3192341125986773, 2.3138894539685837, 2.3085814332935062, 2.3033098693144991, 2.2980745829184159, 2.2928753967443605, 2.2877121348146634, 2.2825846221894293, 2.2774926846438546, 2.2724361483688083, 2.2674148396923153, 2.2624285848232031, 2.2574772096143159, 2.2525605393468142, 2.2476783985324542, 2.24283061073558, 2.2380169984119953, 2.2332373827660259, 2.2284915836233083, 2.2237794193198139, 2.2191007066058868, 2.2144552605650376, 2.2098428945460649, 2.2052634201086518, 2.2007166469813408, 2.1962023830312005, 2.1917204342447989, 2.1872706047194996, 2.1828526966648316, 2.1784665104127034, 2.17411184443699, 2.1697884953803999, 2.1654962580890103, 2.1612349256543202, 2.1570042894607995, 2.1528041392396142, 2.1486342631278528, 2.1444944477323937, 2.140384478198039, 2.1363041382797299, 2.1322532104178209, 2.128231475817008, 2.1242387145271668, 2.1202747055267284, 2.1163392268079981, 2.1124320554638953, 2.1085529677755548, 2.1047017393013046, 2.1008781449658334, 2.0970819591496315, 2.093312955778639, 2.0895709084134801, 2.0858555903384208, 2.0821667746492394, 2.0785042343408358, 2.074867742393165, 2.071257071856309, 2.0676719959342043, 2.0641122880664642, 2.0605777220089552, 2.0570680719123673, 2.0535831123990187, 2.0501226186375785, 2.046686366416036, 2.0432741322119892, 2.0398856932614633, 2.0365208276249445, 2.0331793142514045, 2.0298609330399415, 2.0265654648991713, 2.0232926918041745, 2.020042396851212, 2.0168143643098029, 2.0136083796729372, 2.0104242297043986, 2.0072617024841177, 2.0041205874509433, 2.0010006754435006, 1.9979017587382546, 1.994823631085807, 1.9917660877446017, 1.9887289255128457, 1.985711942757916, 1.9827149394440453, 1.9797377171574639, 1.9767800791303494, 1.9738418302619096, 1.9709227771380773, 1.9680227280494966, 1.9651414930072806, 1.9622788837573386, 1.9594347137929187, 1.9566087983654623, 1.9538009544940431, 1.9510110009731305, 1.9482387583789544, 1.9454840490744227, 1.9427466972127085, 1.9400265287395655, 1.9373233713943017, 1.9346370547096021, 1.9319674100103268, 1.9293142704109996, 1.9266774708123346, 1.9240568478969535, 1.9214522401239094, 1.9188634877223871, 1.9162904326846595, 1.9137329187581507, 1.9111907914367965, 1.9086638979516373, 1.906152087260669, 1.9036552100384734, 1.901173118664724, 1.8987056672123266, 1.8962527114353189, 1.8938141087560034, 1.8913897182517212, 1.888979400641168, 1.8865830182705992, 1.8842004350992245, 1.8818315166848345, 1.8794761301687739, 1.8771341442608156, 1.8748054292236984, 1.8724898568577555, 1.8701873004848426, 1.8678976349327716, 1.8656207365191144, 1.8633564830350704, 1.8611047537293604, 1.8588654292918507, 1.8566383918372762, 1.8544235248888936, 1.8522207133621709, 1.850029843548294, 1.8478508030980079, 1.8456834810051392, 1.8435277675905426, 1.8413835544856287, 1.839250734616489, 1.8371292021876737, 1.835018852666302, 1.832919582766195, 1.8308312904321573, 1.8287538748240948, 1.8266872363019213, 1.824631276409806, 1.8225858978610248, 1.820551004522883, 1.8185265014017704, 1.8165122946282692, 1.8145082914424924, 1.812514400179712, 1.810530530255841, 1.8085565921533431, 1.8065924974072769, 1.8046381585913362, 1.8026934893043738, 1.8007584041565918, 1.7988328187565841, 1.7969166496979836, 1.795009814546435, 1.7931122318270416, 1.7912238210115057, 1.7893445025058534, 1.7874741976379829, 1.7856128286458497, 1.7837603186652531, 1.7819165917183009, 1.7800815727017276, 1.7782551873754902, 1.7764373623516845, 1.7746280250832087, 1.7728271038531145, 1.771034527763786, 1.7692502267262484, 1.7674741314500235, 1.7657061734325354, 1.7639462849494068, 1.7621943990440485, 1.7604504495183915, 1.7587143709228115, 1.7569860985468713, 1.7552655684098897, 1.7535527172517316, 1.7518474825238863, 1.7501498023803506, 1.7484596156689134, 1.7467768619225532, 1.7451014813508752, 1.7434334148316877, 1.7417726039028063, 1.7401189907538563, 1.7384725182182743, 1.7368331297653727, 1.7352007694926641, 1.7335753821180095, 1.7319569129722434, 1.7303453079916022, 1.7287405137104483, 1.7271424772539765, 1.7255511463312132, 1.723966469227824, 1.7223883947993084, 1.7208168724640349, 1.7192518521967175, 1.7176932845215498, 1.7161411205057722, 1.7145953117531687, 1.7130558103976632, 1.7115225690971383, 1.7099955410270804, 1.7084746798745649, 1.7069599398321547, 1.7054512755919655, 1.7039486423396224, 1.7024519957487396, 1.7009612919749426, 1.69947648765022, 1.6979975398773506, 1.6965244062244476, 1.6950570447193436, 1.6935954138443066, 1.6921394725306695, 1.6906891801535127, 1.689244496526537, 1.6878053818968293, 1.6863717969397687, 1.6849437027541576, 1.6835210608570212, 1.6821038331788094, 1.6806919820585544, 1.6792854702389748, 1.6778842608618099, 1.6764883174630361, 1.675097603968291, 1.6737120846881779, 1.6723317243138089, 1.6709564879123007, 1.6695863409221787, 1.6682212491491515, 1.6668611787616514, 1.6655060962865087, 1.6641559686047194, 1.6628107629472264, 1.6614704468907271, 1.6601349883534464, 1.6588043555912697, 1.6574785171934008, 1.6561574420785599, 1.6548410994909126, 1.6535294589962002, 1.6522224904778195, 1.6509201641329208, 1.649622450468619, 1.6483293202983902, 1.6470407447380824, 1.6457566952023774, 1.6444771434009766, 1.6432020613352749, 1.6419314212944449, 1.6406651958520908, 1.6394033578626548, 1.6381458804579723, 1.6368927370438373, 1.6356439012965323, 1.6343993471595812, 1.6331590488402763, 1.6319229808065043, 1.6306911177833652, 1.6294634347500219, 1.6282399069364579, 1.6270205098202852, 1.6258052191237393, 1.6245940108104162, 1.6233868610823392, 1.6221837463767805, 1.6209846433634751, 1.6197895289414137, 1.6185983802360122, 1.6174111745963562, 1.6162278895919771, 1.6150485030103816, 1.6138729928539246, 1.6127013373373607, 1.6115335148847623, 1.6103695041269503, 1.6092092838989887, 1.6080528332371138, 1.6069001313764792, 1.6057511577484231, 1.6046058919778241, 1.6034643138807287, 1.6023264034616758, 1.6011921409113892, 1.600061506604133, 1.5989344810955197, 1.5978110451198817, 1.5966911795880816, 1.5955748655851667, 1.5944620843679025, 1.5933528173627676, 1.5922470461633476, 1.5911447525285294, 1.590045918379984, 1.588950525800175, 1.5878585570300487, 1.5867699944671694, 1.5856848206633538, 1.58460301832293, 1.5835245703003988, 1.5824494595986336, 1.5813776693667936, 1.5803091828984606, 1.5792439836296568, 1.5781820551369257, 1.5771233811355587, 1.5760679454775846, 1.5750157321501168, 1.5739667252734282, 1.5729209090992207, 1.571878268008909, 1.5708387865118496, 1.569802449243624, 1.5687692409644838, 1.5677391465575028, 1.5667121510271453, 1.5656882394974299, 1.5646673972106886, 1.5636496095255701, 1.5626348619159496, 1.5616231399690446, 1.5606144293841104, 1.559608715971011, 1.5586059856485692, 1.5576062244434075, 1.5566094184883066, 1.5556155540209091, 1.5546246173824281, 1.5536365950162108, 1.5526514734664687, 1.5516692393769003, 1.5506898794895176, 1.5497133806433359, 1.5487397297731247, 1.5477689139081814, 1.5468009201711699, 1.5458357357768591, 1.5448733480311012, 1.5439137443295048, 1.5429569121564175, 1.5420028390838558, 1.5410515127703157, 1.5401029209597736, 1.5391570514804918, 1.5382138922442801, 1.5372734312451111, 1.536335656558407, 1.5354005563398641, 1.5344681188245946, 1.5335383323261298, 1.5326111852354873, 1.531686666020202, 1.5307647632235268, 1.529845465463447, 1.5289287614318716, 1.5280146398937093, 1.5271030896860724, 1.5261940997173824, 1.5252876589666475, 1.5243837564825486, 1.5234823813827829, 1.5225835228532023, 1.5216871701469503, 1.5207933125840252, 1.519901939550196, 1.5190130404964677, 1.5181266049383981, 1.5172426224552127, 1.5163610826894274, 1.5154819753458131, 1.5146052901910254, 1.5137310170527842, 1.5128591458194085, 1.5119896664389372, 1.5111225689187311, 1.5102578433248708, 1.5093954797813338, 1.5085354684696781, 1.507677799628339, 1.506822463552062, 1.5059694505914203, 1.505118751152174, 1.5042703556948593, 1.5034242547341943, 1.5025804388384723, 1.5017388986293165, 1.5008996247808783, 1.5000626080196442, 1.4992278391236988, 1.4983953089223481, 1.49756500829587, 1.496736928174716, 1.4959110595392193, 1.4950873934192543, 1.4942659208936837, 1.4934466330899372, 1.4926295211836564, 1.4918145763983277, 1.4910017900047257, 1.4901911533206289, 1.4893826577105294, 1.4885762945850354, 1.4877720554006462, 1.4869699316594034, 1.486169914908366, 1.4853719967394849, 1.4845761687891041, 1.4837824227376262, 1.4829907503092838, 1.4822011432716871, 1.4814135934355388, 1.4806280926543853, 1.4798446328241723, 1.479063205883026, 1.4782838038109989, 1.4775064186296585, 1.4767310424018021, 1.475957667231276, 1.475186285262573, 1.4744168886806286, 1.4736494697105256, 1.4728840206172011, 1.4721205337052159, 1.4713590013184497, 1.470599415839938, 1.4698417696913595, 1.469086055333213, 1.4683322652641519, 1.4675803920210109, 1.4668304281784152, 1.4660823663486717, 1.4653361991813851, 1.4645919193633141, 1.4638495196182564, 1.4631089927065335, 1.4623703314250578, 1.4616335286070026, 1.4608985771214931, 1.4601654698735975, 1.4594341998039562, 1.4587047598885976, 1.4579771431388013, 1.4572513426008484, 1.456527351355845, 1.4558051625194186, 1.4550847692417408, 1.4543661647071775, 1.453649342134063, 1.4529342947746426, 1.4522210159147544, 1.4515094988738502, 1.4507997370045238, 1.4500917236925255, 1.4493854523566223, 1.448680916448243, 1.4479781094513986, 1.4472770248826219, 1.4465776562905104, 1.4458799972558749, 1.4451840413913386, 1.4444897823413012, 1.4437972137817241, 1.4431063294198898, 1.4424171229944263, 1.4417295882749928, 1.4410437190620879, 1.4403595091871066, 1.439676952511908, 1.4389960429288451, 1.4383167743606025, 1.4376391407598321, 1.4369631361093633, 1.4362887544216392, 1.4356159897389282, 1.4349448361329198, 1.4342752877047193, 1.4336073385846275, 1.4329409829319546, 1.4322762149350372, 1.4316130288109248, 1.4309514188052646, 1.4302913791921945, 1.4296329042742488, 1.4289759883820852, 1.4283206258743815, 1.4276668111378297, 1.4270145385867963, 1.4263638026632417, 1.4257145978367187, 1.4250669186039531, 1.424420759489097, 1.4237761150431207, 1.4231329798440568, 1.4224913484966797, 1.4218512156324439, 1.421212575909276, 1.420575424011451, 1.4199397546495274, 1.4193055625601374, 1.4186728425059085, 1.4180415892752192, 1.4174117976822205, 1.4167834625666109, 1.4161565787934969, 1.4155311412532876, 1.4149071448615074, 1.4142845845588099, 1.4136634553106404, 1.4130437521073007, 1.4124254699636463, 1.4118086039190834, 1.4111931490374108, 1.4105791004066051, 1.409966453138823, 1.4093552023701317, 1.4087453432605483, 1.4081368709937419, 1.4075297807769742, 1.4069240678410648, 1.4063197274401189, 1.4057167548514178, 1.4051151453754234, 1.4045148943354866, 1.4039159970778212, 1.403318448971407, 1.4027222454076977, 1.4021273818007345, 1.4015338535867836, 1.4009416562244335, 1.4003507851942933, 1.3997612359989542, 1.3991730041628196, 1.3985860852320768, 1.3980004747745267, 1.397416168379352, 1.3968331616571776, 1.3962514502398358, 1.3956710297802768, 1.395091895952405, 1.3945140444511439, 1.3939374709920023, 1.3933621713111981, 1.3927881411654628, 1.3922153763319645, 1.391643872608131, 1.3910736258115923, 1.3905046317799192, 1.3899368863706967, 1.3893703854613999, 1.388805124949066, 1.3882411007503941, 1.3876783088016043, 1.3871167450581752, 1.3865564054949102, 1.3859972861057217, 1.3854393829035443, 1.3848826919202455, 1.3843272092064347, 1.3837729308314874, 1.3832198528833055, 1.382667971468307, 1.3821172827111996, 1.3815677827549517, 1.3810194677607839, 1.3804723339078149, 1.3799263773931796, 1.3793815944317602, 1.3788379812562261, 1.3782955341168459, 1.3777542492813262, 1.3772141230348383, 1.3766751516798195, 1.3761373315359073, 1.375600658939891, 1.3750651302454238, 1.3745307418230954, 1.3739974900603791, 1.3734653713612535, 1.3729343821464375, 1.3724045188530287, 1.371875777934598, 1.3713481558609291, 1.3708216491180043, 1.3702962542079733, 1.3697719676488826, 1.3692487859747575, 1.3687267057353965, 1.368205723496303, 1.3676858358385189, 1.3671670393588282, 1.3666493306692045, 1.3661327063971085, 1.3656171631851779, 1.3651026976912368, 1.3645893065881025, 1.364076986563733, 1.3635657343207783, 1.3630555465767638, 1.3625464200639432, 1.3620383515291432, 1.3615313377337803, 1.3610253754536472, 1.3605204614789665, 1.3600165926141123, 1.3595137656778535, 1.3590119775028453, 1.3585112249359179, 1.3580115048377395, 1.3575128140829007, 1.3570151495597482, 1.3565185081702977, 1.3560228868301947, 1.3555282824686194, 1.3550346920281879, 1.354542112464918, 1.3540505407480796, 1.3535599738601736, 1.3530704087968932, 1.3525818425668903, 1.3520942721918909, 1.3516076947064948, 1.3511221071581776, 1.3506375066070508, 1.3501538901260814, 1.3496712548007119, 1.3491895977289901, 1.3487089160214436, 1.348229206800968, 1.3477504672027345, 1.347272694374251, 1.3467958854751994, 1.3463200376772642, 1.3458451481643237, 1.3453712141321605, 1.344898232788428, 1.34442620135266, 1.3439551170561777, 1.34348497714191, 1.343015778864578, 1.3425475194903069, 1.3420801962968334, 1.3416138065733154, 1.3411483476202442, 1.3406838167495376, 1.3402202112841732, 1.3397575285584444, 1.3392957659177744, 1.338834920718571, 1.3383749903283275, 1.3379159721253622, 1.3374578634989756, 1.337000661849219, 1.3365443645869175, 1.3360889691336051, 1.335634472921412, 1.3351808733930903, 1.3347281680018619, 1.3342763542114473, 1.3338254294960019, 1.3333753913399138, 1.332926237238002, 1.332477964695179, 1.3320305712266345, 1.3315840543576596, 1.3311384116235221, 1.3306936405696665, 1.330249738751341, 1.3298067037338033, 1.3293645330920563, 1.3289232244110125, 1.3284827752851709, 1.3280431833189195, 1.3276044461261234, 1.3271665613302768, 1.3267295265644297, 1.3262933394711105, 1.3258579977022489, 1.3254234989191911, 1.3249898407925511, 1.3245570210023314, 1.3241250372376541, 1.3236938871968651, 1.3232635685874818, 1.3228340791260211, 1.3224054165380663, 1.3219775785582579, 1.3215505629300652, 1.3211243674059658, 1.3206989897471175, 1.3202744277236611, 1.3198506791143259, 1.3194277417066602, 1.319005613296848, 1.3185842916896267, 1.3181637746983379, 1.3177440601448709, 1.3173251458595558, 1.3169070296811651, 1.3164897094568488, 1.316073183042145, 1.3156574483008208, 1.3152425031049746, 1.3148283453348564, 1.314414972878913, 1.3140023836337238, 1.3135905755039319, 1.3131795464022464, 1.3127692942493649, 1.3123598169739341, 1.3119511125125702, 1.3115431788096765, 1.3111360138175696, 1.3107296154962824, 1.3103239818137051, 1.3099191107453667, 1.3095150002744786, 1.3091116483918541, 1.3087090530960301, 1.3083072123929731, 1.3079061242961765, 1.3075057868266442, 1.3071061980128202, 1.3067073558905269, 1.306309258502943, 1.3059119039006128, 1.3055152901412919, 1.3051194152900838, 1.3047242774191727, 1.3043298746080632, 1.3039362049432763, 1.3035432665185342, 1.3031510574344716, 1.3027595757989181, 1.3023688197265799, 1.3019787873391957, 1.3015894767653418, 1.3012008861405642, 1.3008130136071829, 1.3004258573143699, 1.300039415418089, 1.299653686080962, 1.2992686674724545, 1.2988843577686, 1.2985007551521281, 1.2981178578123345, 1.2977356639451232, 1.2973541717528956, 1.296973379444589, 1.2965932852356821, 1.2962138873479294, 1.2958351840096567, 1.2954571734554625, 1.2950798539262858, 1.2947032236694818, 1.2943272809385682, 1.2939520239933622, 1.2935774510998825, 1.2932035605303414, 1.292830350563092, 1.2924578194825787, 1.2920859655794563, 1.2917147871502959, 1.2913442824977224, 1.2909744499304625, 1.2906052877631013, 1.2902367943161899, 1.2898689679161952, 1.2895018068955004, 1.2891353095923028, 1.2887694743505695, 1.2884042995201384, 1.2880397834565815, 1.2876759245212051, 1.2873127210809776, 1.2869501715086102, 1.2865882741823969, 1.2862270274863534, 1.2858664298099396, 1.2855064795482798, 1.2851471751020325, 1.2847885148773164, 1.2844304972857632, 1.2840731207444296, 1.2837163836758168, 1.28336028450785, 1.2830048216737837, 1.2826499936122202, 1.2822957987671371, 1.2819422355877486, 1.2815893025285436, 1.2812369980492491, 1.2808853206148323, 1.280534268695444, 1.2801838407663364, 1.2798340353080548, 1.2794848508060763], 'Rp': [0.24751445462281593, 0.37336785250387877, 0.43073248602830072, 0.4653384528198779, 0.4914096631506964, 0.5133139703833558, 0.53263679610013859, 0.55007534213550935, 0.56600317733707328, 0.58065859941454367, 0.59421364426051115, 0.60680213302151231, 0.6185326746476183, 0.62949565802138119, 0.63976755380737782, 0.64941383808296727, 0.65849111170769392, 0.66704869965980318, 0.67512988971985177, 0.68277290951228575, 0.69001170806527745, 0.69687658828280974, 0.70339472391951685, 0.709590585927803, 0.71548629690345245, 0.72110192792550809, 0.72645574883238095, 0.73156444055429093, 0.73644327629463591, 0.74110627696082165, 0.74556634517301845, 0.74983538134629668, 0.75392438468889023, 0.75784354144344013, 0.7616023022875763, 0.76520945048112554, 0.76867316208115388, 0.77200105933062513, 0.77520025814971205, 0.77827741051404509, 0.78123874238455115, 0.78409008775403999, 0.78683691929322797, 0.78948437600869381, 0.79203728826863451, 0.79450020050145675, 0.79687739183203399, 0.79917289488459076, 0.80139051295123687, 0.80353383570022541, 0.80560625357510462, 0.80761097101833301, 0.80955101863604528, 0.81142926440702801, 0.81324842402719755, 0.8150110704701844, 0.81671964283569731, 0.81837645454983043, 0.81998370097397677, 0.82154346647386012, 0.82305773099419755, 0.82452837618009134, 0.82595719108277621, 0.82734587748245525, 0.828696054859269, 0.83000926503912675, 0.83128697653978523, 0.83253058863951934, 0.8337414351890533, 0.83492078818535187, 0.83606986112464909, 0.83718981214989541, 0.8382817470075179, 0.839346721825873, 0.84038574572819003, 0.84139978329027942, 0.84238975685385609, 0.84335654870436927, 0.84430100312211009, 0.84522392831480153, 0.84612609823881013, 0.84700825431584847, 0.84787110705179813, 0.84871533756337558, 0.84954159901816417, 0.85035051799326888, 0.8511426957574858, 0.85191870948113813, 0.85267911337835489, 0.85342443978536564, 0.85415520017851088, 0.85487188613592313, 0.85557497024558227, 0.85626490696326374, 0.85694213342329562, 0.85760707020459315, 0.85826012205484681, 0.85890167857535094, 0.85953211486856318, 0.86015179215069681, 0.86076105833161543, 0.86136024856357629, 0.86194968576119058, 0.86252968109365957, 0.86310053445161206, 0.86366253488986999, 0.86421596104719534, 0.86476108154504849, 0.8652981553661695, 0.86582743221454006, 0.8663491528574796, 0.86686354945145838, 0.86737084585223168, 0.86787125791032227, 0.86836499375312126, 0.8688522540537893, 0.86933323228838455, 0.86980811498170207, 0.87027708194218512, 0.87074030648730882, 0.87119795565939495, 0.87165019043257053, 0.87209716591174902, 0.87253903152358026, 0.87297593120040518, 0.87340800355709014, 0.87383538206162059, 0.87425819519956072, 0.87467656663277771, 0.87509061535286825, 0.87550045582935432, 0.87590619815336423, 0.87630794817640512, 0.87670580764517048, 0.87709987433211933, 0.87749024216237659, 0.87787700133673274, 0.87826023845139745, 0.87864003661442291, 0.87901647555894946, 0.87938963175335716, 0.87975957850877129, 0.88012638608376137, 0.88049012178629149, 0.88085085007339237, 0.88120863264811089, 0.88156352855453113, 0.88191559427020472, 0.88226488379652335, 0.88261144874719699, 0.88295533843441865, 0.88329659995318555, 0.88363527826374966, 0.88397141627216669, 0.88430505490898426, 0.88463623320615337, 0.88496498837227944, 0.88529135586619256, 0.88561536946857677, 0.88593706135230832, 0.88625646215089271, 0.8865736010254438, 0.8868885057300554, 0.88720120267548486, 0.88751171699158082, 0.88782007258776086, 0.88812629221233796, 0.88843039751009634, 0.88873240907850026, 0.88903234652233909, 0.88933022850685306, 0.88962607280949968, 0.88991989637018643, 0.89021171533989796, 0.89050154512814172, 0.89078940044870136, 0.89107529536408669, 0.89135924332848004, 0.89164125722924459, 0.89192134942704904, 0.89219953179452749, 0.89247581575360602, 0.89275021231132945, 0.89302273209438976, 0.89329338538226, 0.89356218213881877, 0.89382913204295744, 0.89409424451746866, 0.89435752875682284, 0.89461899375365639, 0.89487864832389308, 0.89513650113053733, 0.89539256070639883, 0.89564683547544444, 0.89589933377296993, 0.89615006386457552, 0.89639903396408871, 0.89664625225017081, 0.89689172688191199, 0.89713546601340777, 0.89737747780716504, 0.8976177704464684, 0.89785635214690229, 0.89809323116671158, 0.89832841581638812, 0.8985619144672119, 0.89879373555906894, 0.89902388760721608, 0.89925237920847645, 0.89947921904648243, 0.89970441589617733, 0.89992797862770746, 0.90014991620962748, 0.90037023771120661, 0.9005889523045163, 0.90080606926565376, 0.90102159797541281, 0.90123554791964067, 0.90144792868882273, 0.90165874997745088, 0.90186802158279644, 0.90207575340341373, 0.90228195543708689, 0.90248663777866078, 0.90268981061735498, 0.90289148423387411, 0.90309166899729432, 0.90329037536155998, 0.90348761386200482, 0.90368339511135676, 0.9038777297958458, 0.90407062867107524, 0.90426210255772554, 0.90445216233713877, 0.90464081894686132, 0.90482808337609144, 0.90501396666113343, 0.90519847988062907, 0.90538163415095485, 0.90556344062153604, 0.90574391047013803, 0.90592305489815073, 0.90610088512604214, 0.90627741238867066, 0.90645264793073965, 0.90662660300222953, 0.90679928885409855, 0.90697071673371976, 0.90714089788076346, 0.90730984352286637, 0.90747756487154385, 0.90764407311823059, 0.9078093794302351, 0.90797349494711954, 0.90813643077680894, 0.90829819799213085, 0.90845880762723374, 0.90861827067441969, 0.90877659808062505, 0.90893380074461017, 0.9090898895137387, 0.90924487518121666, 0.90939876848330903, 0.9095515800967463, 0.90970332063620341, 0.90985400065185884, 0.91000363062722722, 0.91015222097696269, 0.91029978204489304, 0.91044632410200466, 0.91059185734469161, 0.91073639189318289, 0.91087993778977705, 0.91102250499755044, 0.91116410339890352, 0.91130474279434559, 0.91144443290130772, 0.9115831833531749, 0.91172100369820164, 0.91185790339878259, 0.91199389183051149, 0.91212897828175044, 0.91226317195272999, 0.91239648195527867, 0.91252891731217411, 0.9126604869570224, 0.91279119973372358, 0.9129210643964123, 0.91305008960924017, 0.91317828394632861, 0.91330565589170265, 0.91343221383934847, 0.91355796609335582, 0.91368292086790215, 0.91380708628772778, 0.91393047038809405, 0.91405308111527883, 0.91417492632681407, 0.91429601379193193, 0.9144163511919321, 0.91453594612067413, 0.91465480608504091, 0.91477293850550212, 0.9148903507166819, 0.91500704996784299, 0.91512304342368544, 0.91523833816476841, 0.91535294118830735, 0.91546685940889871, 0.91558009965903664, 0.9156926686900223, 0.9158045731725859, 0.91591581969771907, 0.91602641477735058, 0.91613636484518224, 0.91624567625747444, 0.91635435529383402, 0.91646240815800173, 0.91656984097866656, 0.91667665981033641, 0.91678287063405239, 0.91688847935835538, 0.91699349182000212, 0.91709791378482264, 0.91720175094857359, 0.91730500893777189, 0.91740769331049421, 0.91750980955721151, 0.91761136310171032, 0.91771235930172124, 0.91781280344995786, 0.91791270077474885, 0.91801205644101613, 0.91811087555095805, 0.91820916314491163, 0.91830692420213167, 0.91840416364162403, 0.91850088632279914, 0.91859709704648151, 0.91869280055546743, 0.91878800153537443, 0.91888270461541666, 0.91897691436908202, 0.91907063531498978, 0.91916387191748872, 0.9192566285874989, 0.91934890968311345, 0.91944071951044581, 0.91953206232416085, 0.91962294232828801, 0.91971336367691447, 0.91980333047471374, 0.91989284677775141, 0.91998191659413198, 0.92007054388448861, 0.92015873256284753, 0.92024648649708363, 0.9203338095095599, 0.9204207053778154, 0.92050717783511804, 0.92059323057102216, 0.92067886723199677, 0.92076409142202764, 0.92084890670307618, 0.92093331659570266, 0.92101732457966889, 0.92110093409436045, 0.92118414853943376, 0.92126697127522972, 0.92134940562334999, 0.92143145486715528, 0.92151312225229098, 0.92159441098711659, 0.92167532424325405, 0.92175586515600993, 0.92183603682486748, 0.92191584231394152, 0.9219952846524424, 0.92207436683514232, 0.92215309182275063, 0.92223146254246058, 0.92230948188816841, 0.92238715272115646, 0.9224644778703095, 0.92254146013263483, 0.92261810227356034, 0.92269440702745142, 0.92277037709787024, 0.92284601515805986, 0.92292132385132231, 0.92299630579126002, 0.92307096356228779, 0.92314529971999226, 0.92321931679133484, 0.92329301727513469, 0.92336640364245548, 0.92343947833676432, 0.92351224377443619, 0.92358470234503443, 0.92365685641154982, 0.9237287083109148, 0.92380026035406348, 0.92387151482650609, 0.92394247398846574, 0.9240131400751842, 0.92408351529736499, 0.92415360184132533, 0.92422340186930207, 0.92429291751983944, 0.92436215090796559, 0.92443110412553187, 0.92449977924146276, 0.92456817830206683, 0.92463630333127611, 0.92470415633092073, 0.9247717392809216, 0.92483905413973755, 0.92490610284444952, 0.92497288731105587, 0.9250394094347435, 0.92510567109015418, 0.92517167413158086, 0.92523742039327139, 0.92530291168957779, 0.92536814981530169, 0.92543313654585324, 0.92549787363748426, 0.92556236282756854, 0.92562660583478562, 0.92569060435933936, 0.92575436008318301, 0.92581787467030574, 0.92588114976686509, 0.92594418700138204, 0.92600698798509729, 0.92606955431193849, 0.92613188755901765, 0.92619398928661623, 0.92625586103847968, 0.92631750434198712, 0.92637892070833938, 0.92644011163285267, 0.92650107859498587, 0.92656182305867996, 0.92662234647252573, 0.92668265026979058, 0.92674273586889089, 0.92680260467333142, 0.92686225807195055, 0.92692169743918129, 0.92698092413515942, 0.92703993950588204, 0.92709874488344801, 0.927157341586199, 0.92721573091886078, 0.92727391417274552, 0.92733189262593951, 0.92738966754339569, 0.92744724017721591, 0.92750461176665022, 0.92756178353841712, 0.92761875670677685, 0.92767553247367573, 0.92773211202901307, 0.9277884965506209, 0.92784468720453361, 0.92790068514512858, 0.92795649151530968, 0.92801210744646878, 0.92806753405892761, 0.92812277246179042, 0.92817782375329438, 0.9282326890208602, 0.9282873693412016, 0.92834186578054911, 0.92839617939474284, 0.9284503112293484, 0.92850426231982586, 0.92855803369161805, 0.92861162636034966, 0.92866504133184713, 0.92871827960243247, 0.92877134215883173, 0.92882422997847858, 0.92887694402960364, 0.92892948527126318, 0.92898185465356076, 0.9290340531177006, 0.92908608159615991, 0.92913794101274549, 0.92918963228276574, 0.92924115631308379, 0.92929251400234336, 0.92934370624085205, 0.92939473391093996, 0.92944559788692838, 0.92949629903529407, 0.92954683821473671, 0.92959721627624303, 0.92964743406330352, 0.92969749241191013, 0.92974739215073832, 0.92979713410114784, 0.92984671907736505, 0.92989614788649966, 0.92994542132879188, 0.92999454019746985, 0.93004350527903834, 0.9300923173533181, 0.93014097719344646, 0.93018948556609871, 0.93023784323150749, 0.93028605094352279, 0.9303341094497215, 0.93038201949155297, 0.93042978180430769, 0.93047739711730026, 0.93052486615382846, 0.93057218963144095, 0.93061936826176839, 0.93066640275084833, 0.93071329379901735, 0.93076004210107077, 0.93080664834635318, 0.93085311321871755, 0.9308994373967, 0.93094562155361171, 0.93099166635749309, 0.93103757247129548, 0.93108334055287378, 0.93112897125509908, 0.9311744652258509, 0.93121982310818485, 0.93126504554034228, 0.93131013315576316, 0.93135508658325494, 0.93139990644696735, 0.93144459336644014, 0.93148914795676485, 0.93153357082853616, 0.9315778625879495, 0.93162202383686832, 0.93166605517286749, 0.93170995718925953, 0.93175373047517307, 0.93179737561562992, 0.93184089319155805, 0.93188428377981536, 0.93192754795334254, 0.9319706862810786, 0.93201369932814671, 0.9320565876557394, 0.9320993518213524, 0.93214199237864603, 0.93218450987764734, 0.93222690486465298, 0.93226917788239283, 0.93231132947002104, 0.9323533601631111, 0.93239527049381554, 0.93243706099073886, 0.93247873217918464, 0.93252028458098934, 0.93256171871469085, 0.93260303509552989, 0.93264423423546061, 0.93268531664328824, 0.93272628282450021, 0.93276713328153504, 0.93280786851367858, 0.93284848901712258, 0.93288899528499081, 0.93292938780739931, 0.93296966707151729, 0.93300983356148848, 0.93304988775856657, 0.93308983014109514, 0.93312966118455398, 0.93316938136159255, 0.93320899114203615, 0.93324849099297158, 0.93328788137864449, 0.93332716276070782, 0.93336633559796334, 0.9334054003466854, 0.93344435746037502, 0.93348320739002155, 0.93352195058392473, 0.93356058748788773, 0.93359911854510935, 0.93363754419631051, 0.93367586487967913, 0.93371408103093734, 0.93375219308335544, 0.93379020146776492, 0.93382810661258397, 0.93386590894384947, 0.93390360888522206, 0.93394120685799964, 0.9339787032811544, 0.93401609857141354, 0.93405339314308367, 0.93409058740834805, 0.93412768177702676, 0.9341646766567665, 0.93420157245297553, 0.93423836956888484, 0.9342750684054828, 0.93431166936168797, 0.93434817283422689, 0.93438457921768037, 0.93442088890454766, 0.93445710228519896, 0.93449321974798172, 0.93452924167913398, 0.93456516846281323, 0.93460100048121497, 0.93463673811446124, 0.93467238174071987, 0.93470793173611078, 0.93474338847482341, 0.9347787523290364, 0.93481402366905908, 0.9348492028631642, 0.93488429027777842, 0.93491928627739052, 0.93495419122459822, 0.93498900548012431, 0.93502372940279477, 0.93505836334961223, 0.9350929076757144, 0.93512736273437358, 0.93516172887711557, 0.93519600645360701, 0.93523019581166122, 0.93526429729743843, 0.93529831125518847, 0.9353322380274961, 0.93536607795511628, 0.93539983137707983, 0.93543349863075009, 0.93546708005165102, 0.93550057597367997, 0.93553398672901122, 0.93556731264810356, 0.93560055405974829, 0.93563371129108475, 0.9356667846675768, 0.93569977451297437, 0.9357326811494947, 0.93576550489762222, 0.93579824607629059, 0.93583090500274513, 0.93586348199268454, 0.93589597736016561, 0.9359283914177009, 0.93596072447615941, 0.935992976844919, 0.93602514883171051, 0.93605724074280727, 0.93608925288281275, 0.93612118555488188, 0.93615303906060754, 0.93618481370013262, 0.93621650977194715, 0.93624812757313902, 0.93627966739930124, 0.93631112954447748, 0.93634251430129523, 0.93637382196084207, 0.93640505281277098, 0.93643620714533282, 0.93646728524523271, 0.93649828739780272, 0.93652921388687471, 0.93656006499495015, 0.93659084100301193, 0.93662154219067573, 0.93665216883618363, 0.9366827212163219, 0.93671319960649002, 0.93674360428074011, 0.93677393551176191, 0.93680419357081346, 0.93683437872782793, 0.93686449125140203, 0.93689453140871271, 0.93692449946573231, 0.93695439568693317, 0.93698422033557172, 0.93701397367356565, 0.93704365596153016, 0.93707326745870068, 0.9371028084230939, 0.93713227911141639, 0.93716167977905596, 0.93719101068018362, 0.93722027206761049, 0.9372494641930007, 0.93727858730664448, 0.93730764165761571, 0.93733662749380775, 0.93736554506177205, 0.93739439460690455, 0.93742317637334571, 0.93745189060400569, 0.93748053754062355, 0.93750911742365162, 0.93753763049244387, 0.9375660769851013, 0.93759445713854905, 0.9376227711885472, 0.93765101936962236, 0.93767920191522258, 0.93770731905756, 0.93773537102772286, 0.93776335805567046, 0.93779128037017312, 0.93781913819889329, 0.9378469317683632, 0.937874661303989, 0.93790232703006193, 0.93792992916972706, 0.93795746794507406, 0.93798494357707118, 0.93801235628559088, 0.93803970628942046, 0.93806699380626357, 0.93809421905279278, 0.93812138224450137, 0.93814848359591618, 0.93817552332049259, 0.93820250163063523, 0.93822941873766297, 0.93825627485188101, 0.93828307018258461, 0.93830980493799443, 0.93833647932535613, 0.93836309355089376, 0.93838964781975154, 0.93841614233616799, 0.93844257730333391, 0.93846895292342514, 0.93849526939769135, 0.93852152692636204, 0.93854772570871114, 0.93857386594297865, 0.93859994782654599, 0.93862597155573446, 0.93865193732600183, 0.938677845331784, 0.9387036957666145, 0.93872948882310792, 0.93875522469288786, 0.93878090356669697, 0.93880652563435807, 0.93883209108476862, 0.9388576001059088, 0.93888305288488627, 0.9389084496078679, 0.93893379046016967, 0.93895907562617087, 0.93898430528943044, 0.93900947963257564, 0.93903459883740392, 0.93905966308482502, 0.93908467255485195, 0.93910962742671211, 0.9391345278787615, 0.93915937408846728, 0.93918416623249978, 0.93920890448667771, 0.93923358902599374, 0.93925822002461534, 0.93928279765585954, 0.9393073220923065, 0.93933179350561324, 0.93935621206673092, 0.93938057794575958, 0.93940489131200533, 0.93942915233400037, 0.9394533611794883, 0.93947751801541446, 0.93950162300793805, 0.93952567632248973, 0.93954967812369361, 0.93957362857543258, 0.93959752784083284, 0.93962137608222174, 0.939645173461232, 0.93966892013873404, 0.93969261627486367, 0.93971626202899627, 0.93973985755977452, 0.93976340302518535, 0.93978689858239783, 0.93981034438791278, 0.93983374059750813, 0.93985708736627505, 0.9398803848485302, 0.93990363319798487, 0.93992683256760035, 0.93994998310961186, 0.93997308497566634, 0.93999613831662265, 0.94001914328268987, 0.94004210002345523, 0.94006500868773724, 0.9400878694238155, 0.94011068237919315, 0.94013344770073415, 0.94015616553467163, 0.94017883602658125, 0.94020145932141508, 0.94022403556342071, 0.9402465648962518, 0.94026904746289364, 0.94029148340574953, 0.94031387286655133, 0.94033621598638462, 0.94035851290577399, 0.94038076376457469, 0.94040296870209283, 0.94042512785689669, 0.94044724136710256, 0.94046930937012485, 0.940491332002789, 0.94051330940136868, 0.94053524170149028, 0.94055712903821176, 0.94057897154601089, 0.94060076935878967, 0.94062252260984558, 0.94064423143190978, 0.94066589595713845, 0.94068751631714553, 0.94070909264295943, 0.94073062506502647, 0.94075211371323919, 0.94077355871700408, 0.94079496020503617, 0.94081631830563273, 0.94083763314647373, 0.94085890485470647, 0.94088013355694833, 0.94090131937929733, 0.94092246244724254, 0.94094356288585568, 0.94096462081957044, 0.94098563637236898, 0.94100660966765759, 0.94102754082836382, 0.94104842997689819, 0.94106927723512623, 0.94109008272439343, 0.94111084656562838, 0.94113156887913074, 0.9411522497847955, 0.94117288940194954, 0.94119348784946377, 0.94121404524570274, 0.94123456170856512, 0.94125503735541027, 0.94127547230312814, 0.94129586666816212, 0.94131622056646058, 0.94133653411345608, 0.94135680742412564, 0.9413770406130022, 0.94139723379411067, 0.94141738708103695, 0.94143750058688591, 0.94145757442429789, 0.9414776087054938, 0.94149760354214929, 0.94151755904560119, 0.9415374753266198, 0.94155735249560646, 0.94157719066248324, 0.94159698993670715, 0.94161675042737136, 0.94163647224303781, 0.9416561554918611, 0.94167580028158138, 0.94169540671948315, 0.94171497491245182, 0.94173450496690492, 0.94175399698882079, 0.94177345108383725, 0.94179286735708634, 0.94181224591329971, 0.94183158685682467, 0.94185089029159552, 0.94187015632107129, 0.94188938504834496, 0.94190857657611826, 0.94192773100663718, 0.94194684844180432, 0.94196592898305676, 0.94198497273151904, 0.94200397978777495, 0.94202295025217508, 0.94204188422458524, 0.9420607818044876, 0.94207964309100622, 0.94209846818285436, 0.94211725717830208, 0.9421360101753814, 0.94215472727163863, 0.94217340856424525, 0.94219205415001661, 0.94221066412541576, 0.94222923858645813, 0.94224777762889333, 0.94226628134798551, 0.94228474983876143, 0.94230318319575956, 0.94232158151323575, 0.94233994488500816, 0.94235827340467615, 0.94237656716534057, 0.94239482625976645, 0.94241305078044668, 0.94243124081944196, 0.94244939646849402, 0.94246751781901161, 0.94248560496201805, 0.942503657988225, 0.94252167698798905, 0.94253966205130346, 0.9425576132678658, 0.94257553072702827, 0.94259341451775391, 0.9426112647287741, 0.94262908144835678, 0.94264686476455029, 0.94266461476500973, 0.9426823315370837, 0.94270001516781887, 0.94271766574390625, 0.94273528335168832, 0.94275286807728698, 0.94277042000639655, 0.94278793922443349, 0.94280542581654292, 0.94282287986746238, 0.94284030146173103, 0.94285769068350134, 0.94287504761659069, 0.94289237234457746, 0.94290966495069606, 0.94292692551793877, 0.94294415412889021, 0.94296135086591171, 0.9429785158110312, 0.94299564904599309, 0.9430127506522562, 0.94302982071092278, 0.94304685930286736, 0.94306386650868346, 0.94308084240859835, 0.94309778708262759, 0.94311470061045721, 0.9431315830714736, 0.94314843454482122, 0.94316525510934046, 0.94318204484355506, 0.9431988038257898, 0.94321553213402431, 0.94323222984595623, 0.9432488970390619, 0.94326553379051215, 0.94328214017718481, 0.94329871627569939, 0.94331526216241968, 0.94333177791342826, 0.9433482636045345, 0.94336471931131416, 0.94338114510900573, 0.94339754107267304, 0.94341390727704133, 0.94343024379663543, 0.94344655070564043, 0.94346282807810511, 0.94347907598769432, 0.94349529450789504, 0.94351148371189297, 0.94352764367267539, 0.94354377446294713, 0.9435598761551055, 0.9435759488214206, 0.9435919925338031, 0.94360800736398109, 0.94362399338338288, 0.94363995066327166, 0.94365587927458294, 0.94367177928804746, 0.94368765077415828, 0.94370349380319163, 0.94371930844511709]} ''' # Plot the MSE values plt.figure() plt.plot(nmf.all_performances['MSE']) plt.ylim(0,10)
1,340.043478
60,704
0.849356
6,152
61,642
8.506014
0.503901
0.001147
0.000382
0
0
0
0
0
0
0
0
0.883
0.050761
61,642
46
60,705
1,340.043478
0.011314
0.002239
0
0
0
0
0.082126
0
0
0
0
0
0
0
null
null
0
0.210526
null
null
0.052632
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
1
1
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
5
f01920f8746ada1ca06ea78ddeef0ffb6a02cfed
156
py
Python
zabbix/externalscripts/nfs_mount_check.py
hirolovesbeer/hayabusa2
8cf17d7a629af743d983e4506d519d853b2edffc
[ "MIT" ]
9
2018-11-02T05:07:23.000Z
2020-01-21T08:23:56.000Z
zabbix/externalscripts/nfs_mount_check.py
hirolovesbeer/hayabusa2
8cf17d7a629af743d983e4506d519d853b2edffc
[ "MIT" ]
null
null
null
zabbix/externalscripts/nfs_mount_check.py
hirolovesbeer/hayabusa2
8cf17d7a629af743d983e4506d519d853b2edffc
[ "MIT" ]
1
2019-02-04T01:42:03.000Z
2019-02-04T01:42:03.000Z
#!/usr/bin/env python import sys from hayabusa.monitor import MountCheck program_name = sys.argv[0] check = MountCheck(program_name) check.main(sys.argv)
17.333333
39
0.782051
24
156
5
0.666667
0.283333
0.35
0
0
0
0
0
0
0
0
0.007194
0.108974
156
8
40
19.5
0.856115
0.128205
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.4
0
0.4
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
f07192f139f1660d5cf8e712c19f884fa49557e4
83
py
Python
hpbandster/optimizers/config_generators/__init__.py
RevanMacQueen/HpBandSter
3b6a5594df30796f43114f7e0e70c1dc56c11e60
[ "BSD-3-Clause" ]
546
2018-01-18T08:09:02.000Z
2022-03-25T03:06:24.000Z
hpbandster/optimizers/config_generators/__init__.py
RevanMacQueen/HpBandSter
3b6a5594df30796f43114f7e0e70c1dc56c11e60
[ "BSD-3-Clause" ]
99
2018-02-09T14:00:13.000Z
2022-01-11T17:05:44.000Z
hpbandster/optimizers/config_generators/__init__.py
RevanMacQueen/HpBandSter
3b6a5594df30796f43114f7e0e70c1dc56c11e60
[ "BSD-3-Clause" ]
126
2018-02-12T14:08:58.000Z
2022-03-08T02:50:33.000Z
from hpbandster.optimizers.config_generators.random_sampling import RandomSampling
41.5
82
0.915663
9
83
8.222222
1
0
0
0
0
0
0
0
0
0
0
0
0.048193
83
1
83
83
0.936709
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
b2bc6c2f77733e3ff5f3b35055398d4134a2596d
99
py
Python
JZ/JZ31.py
lpuls/leetcode
00e0ea28ed056c01a1e117e70f5560ada1cd8bcc
[ "MIT" ]
null
null
null
JZ/JZ31.py
lpuls/leetcode
00e0ea28ed056c01a1e117e70f5560ada1cd8bcc
[ "MIT" ]
null
null
null
JZ/JZ31.py
lpuls/leetcode
00e0ea28ed056c01a1e117e70f5560ada1cd8bcc
[ "MIT" ]
null
null
null
# _*_coding:utf-8_*_ class Solution: def NumberOf1Between1AndN_Solution(self, n): pass
19.8
48
0.69697
11
99
5.818182
0.909091
0
0
0
0
0
0
0
0
0
0
0.037975
0.20202
99
5
49
19.8
0.772152
0.181818
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0.333333
0
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
5
b2f78f6f24d942efba65627d82e18f9128c8192b
170
py
Python
dfttk/structure_builders/__init__.py
ShuangLin212/dfttk
3be059051424b3eee53e749e9b6064ee8293eff9
[ "MIT" ]
14
2019-02-27T19:11:35.000Z
2021-08-14T13:42:26.000Z
dfttk/structure_builders/__init__.py
ShuangLin212/dfttk
3be059051424b3eee53e749e9b6064ee8293eff9
[ "MIT" ]
24
2018-08-28T23:42:14.000Z
2021-09-24T14:27:38.000Z
dfttk/structure_builders/__init__.py
yiwang62/dfttk
7f57cf0b72fb56859da04b0b08671c7f37aa52ef
[ "MIT" ]
16
2019-03-06T21:27:09.000Z
2021-11-06T09:52:42.000Z
"""Functions to build Structures""" from .prl_structure import PRLStructure from .sqs import enumerate_sqs from .sqs_db import SQSDatabase, get_structures_from_database
28.333333
61
0.835294
23
170
5.913043
0.652174
0.205882
0
0
0
0
0
0
0
0
0
0
0.105882
170
5
62
34
0.894737
0.170588
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
653cfe86be4f33913cea0600412e8d8c759355cf
128
py
Python
deep_lincs/dataset/__init__.py
manzt/lincs-ae
51b2fbaa0a87580e545b5a962a418ca8abc6a3bf
[ "MIT" ]
7
2019-10-31T14:03:20.000Z
2021-07-31T01:28:47.000Z
deep_lincs/dataset/__init__.py
manzt/lincs-ae
51b2fbaa0a87580e545b5a962a418ca8abc6a3bf
[ "MIT" ]
null
null
null
deep_lincs/dataset/__init__.py
manzt/lincs-ae
51b2fbaa0a87580e545b5a962a418ca8abc6a3bf
[ "MIT" ]
1
2020-07-03T00:16:07.000Z
2020-07-03T00:16:07.000Z
"""L1000 Dataset""" __all__ = ["Dataset", "parse_settings"] from .dataset import Dataset from .load_yaml import parse_settings
21.333333
39
0.757813
16
128
5.625
0.5625
0.288889
0
0
0
0
0
0
0
0
0
0.035398
0.117188
128
5
40
25.6
0.761062
0.101563
0
0
0
0
0.192661
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
3320ceb48ca2efd973ebd05d6d0b11fe33664574
248
py
Python
ifstools/handlers/__init__.py
mon/ifstools
cfcb369a0271d6c53df38b769c496ca8149d9a51
[ "MIT" ]
72
2017-12-15T17:47:38.000Z
2022-03-27T05:57:55.000Z
ifstools/handlers/__init__.py
mon/ifstools
cfcb369a0271d6c53df38b769c496ca8149d9a51
[ "MIT" ]
19
2017-12-19T04:43:08.000Z
2020-12-14T10:44:34.000Z
ifstools/handlers/__init__.py
mon/ifstools
cfcb369a0271d6c53df38b769c496ca8149d9a51
[ "MIT" ]
14
2017-12-15T20:43:14.000Z
2020-12-29T22:07:47.000Z
from .Node import Node from .GenericFile import GenericFile from .ImageFile import ImageFile from .GenericFolder import GenericFolder from .MD5Folder import MD5Folder from .AfpFolder import AfpFolder from .TexFolder import TexFolder, ImageCanvas
24.8
45
0.842742
29
248
7.206897
0.344828
0
0
0
0
0
0
0
0
0
0
0.009217
0.125
248
9
46
27.555556
0.953917
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
336625aa00d4dea4e23c481bb784170f37e86a74
167
py
Python
fibonacci/lambdely.py
csuriano23/pycombinator
ed10b92af82533b4ad9f4e453dd4d3080919da06
[ "Unlicense" ]
null
null
null
fibonacci/lambdely.py
csuriano23/pycombinator
ed10b92af82533b4ad9f4e453dd4d3080919da06
[ "Unlicense" ]
null
null
null
fibonacci/lambdely.py
csuriano23/pycombinator
ed10b92af82533b4ad9f4e453dd4d3080919da06
[ "Unlicense" ]
null
null
null
from __future__ import absolute_import _fn = lambda f: lambda n: (n if n < 2 else f(n - 1) + f(n - 2)) def calculate(combinator, n): return combinator(_fn)(n)
18.555556
63
0.658683
29
167
3.551724
0.551724
0.038835
0
0
0
0
0
0
0
0
0
0.022901
0.215569
167
8
64
20.875
0.763359
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.25
0.25
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
684bc8672caee8f539dd1914fca1721584538b28
167
py
Python
start.py
TumkasCor/TULearn
28021bb75a535e7243040bb556fb363199a9e342
[ "MIT" ]
2
2018-02-02T07:08:50.000Z
2018-12-12T16:52:26.000Z
start.py
TumkasCor/TULearn
28021bb75a535e7243040bb556fb363199a9e342
[ "MIT" ]
null
null
null
start.py
TumkasCor/TULearn
28021bb75a535e7243040bb556fb363199a9e342
[ "MIT" ]
null
null
null
from views import app as main import os import sys from storage import Storage storage = Storage() if __name__ == "__main__": main.app.run(debug=False)
16.7
30
0.700599
24
167
4.541667
0.583333
0.256881
0
0
0
0
0
0
0
0
0
0
0.221557
167
9
31
18.555556
0.838462
0
0
0
0
0
0.050633
0
0
0
0
0
0
1
0
false
0
0.571429
0
0.571429
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
d7bb716298ad8bcbf3158767eceac69e6e91a12f
43
py
Python
app/__init__.py
mtpain/corpus
bde4a5ddf42d68f2ed7e9652325b3be975c119ac
[ "BSD-3-Clause" ]
1
2022-02-27T14:26:50.000Z
2022-02-27T14:26:50.000Z
app/__init__.py
mtpain/corpus
bde4a5ddf42d68f2ed7e9652325b3be975c119ac
[ "BSD-3-Clause" ]
13
2016-10-31T21:59:53.000Z
2017-11-20T19:26:32.000Z
app/__init__.py
mt-digital/metacorps
bde4a5ddf42d68f2ed7e9652325b3be975c119ac
[ "BSD-3-Clause" ]
null
null
null
from .app import app from . import models
10.75
20
0.744186
7
43
4.571429
0.571429
0
0
0
0
0
0
0
0
0
0
0
0.209302
43
3
21
14.333333
0.941176
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
d7ef1e43d1190a3ab5ae38f83c5aed7f9885b0eb
39
py
Python
clevrer/__init__.py
zfchenUnique/property_learner_predictor
9dae465a034c1bdf0d6fc12baee207d55837aad7
[ "MIT" ]
1
2022-02-22T03:57:26.000Z
2022-02-22T03:57:26.000Z
clevrer/__init__.py
zfchenUnique/property_learner_predictor
9dae465a034c1bdf0d6fc12baee207d55837aad7
[ "MIT" ]
null
null
null
clevrer/__init__.py
zfchenUnique/property_learner_predictor
9dae465a034c1bdf0d6fc12baee207d55837aad7
[ "MIT" ]
null
null
null
# Modules for handling CLEVRER dataset
19.5
38
0.820513
5
39
6.4
1
0
0
0
0
0
0
0
0
0
0
0
0.153846
39
1
39
39
0.969697
0.923077
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
d7f3062e104d6b72bf3f409dba9a07853fbabe0a
576
py
Python
gym_guidance_collision_avoidance_single/envs/__init__.py
xuxiyang1993/gym-guidance-collision-avoidance-single
2a532a5d86ac1e0ae31d36fa1ad7fb379ac9c932
[ "MIT" ]
4
2019-02-22T03:46:50.000Z
2021-05-15T07:26:34.000Z
gym_guidance_collision_avoidance_single/envs/__init__.py
xuxiyang1993/gym-guidance-collision-avoidance-single
2a532a5d86ac1e0ae31d36fa1ad7fb379ac9c932
[ "MIT" ]
null
null
null
gym_guidance_collision_avoidance_single/envs/__init__.py
xuxiyang1993/gym-guidance-collision-avoidance-single
2a532a5d86ac1e0ae31d36fa1ad7fb379ac9c932
[ "MIT" ]
3
2019-02-02T01:18:01.000Z
2021-02-08T16:35:20.000Z
from gym_guidance_collision_avoidance_single.envs.SingleAircraftEnv import SingleAircraftEnv from gym_guidance_collision_avoidance_single.envs.SingleAircraft2Env import SingleAircraft2Env from gym_guidance_collision_avoidance_single.envs.SingleAircraftStackEnv import SingleAircraftStackEnv from gym_guidance_collision_avoidance_single.envs.SingleAircraftHEREnv import SingleAircraftHEREnv from gym_guidance_collision_avoidance_single.envs.SingleAircraftDiscreteHEREnv import SingleAircraftDiscreteHEREnv from gym_guidance_collision_avoidance_single.envs.config import Config
82.285714
114
0.9375
60
576
8.6
0.233333
0.081395
0.174419
0.27907
0.5
0.5
0.5
0
0
0
0
0.003623
0.041667
576
6
115
96
0.931159
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
0bd3a4f0380617c4838b14e69ba936d0c635c976
88
py
Python
mayan/apps/messaging/tests/literals.py
CMU-313/fall-2021-hw2-451-unavailable-for-legal-reasons
0e4e919fd2e1ded6711354a0330135283e87f8c7
[ "Apache-2.0" ]
2
2021-09-12T19:41:19.000Z
2021-09-12T19:41:20.000Z
mayan/apps/messaging/tests/literals.py
CMU-313/fall-2021-hw2-451-unavailable-for-legal-reasons
0e4e919fd2e1ded6711354a0330135283e87f8c7
[ "Apache-2.0" ]
37
2021-09-13T01:00:12.000Z
2021-10-02T03:54:30.000Z
mayan/apps/messaging/tests/literals.py
CMU-313/fall-2021-hw2-451-unavailable-for-legal-reasons
0e4e919fd2e1ded6711354a0330135283e87f8c7
[ "Apache-2.0" ]
1
2021-09-22T13:17:30.000Z
2021-09-22T13:17:30.000Z
TEST_MESSAGE_BODY = 'test message body' TEST_MESSAGE_SUBJECT = 'test message subject'
29.333333
46
0.795455
12
88
5.5
0.333333
0.666667
0.454545
0.575758
0.621212
0
0
0
0
0
0
0
0.136364
88
2
47
44
0.868421
0
0
0
0
0
0.430233
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
0be582278fb0ecc307d174302926ae623b4d8640
4,217
py
Python
venv/Lib/site-packages/imageio/config/plugins.py
amelliaaas/tugastkc4
f442382c72379e911f3780543b95345a3b1c9407
[ "Apache-2.0" ]
1,026
2015-01-07T18:26:12.000Z
2022-03-28T17:48:39.000Z
venv/Lib/site-packages/imageio/config/plugins.py
amelliaaas/tugastkc4
f442382c72379e911f3780543b95345a3b1c9407
[ "Apache-2.0" ]
689
2015-01-12T09:28:00.000Z
2022-03-31T14:51:24.000Z
venv/Lib/site-packages/imageio/config/plugins.py
amelliaaas/tugastkc4
f442382c72379e911f3780543b95345a3b1c9407
[ "Apache-2.0" ]
271
2015-02-06T16:49:22.000Z
2022-03-31T04:32:50.000Z
known_plugins = { "BMP-FI": "imageio.plugins.freeimage", "BMP-PIL": "imageio.plugins.pillow_legacy", "BSDF": "imageio.plugins.bsdf", "BUFR-PIL": "imageio.plugins.pillow_legacy", "CUR-PIL": "imageio.plugins.pillow_legacy", "CUT-FI": "imageio.plugins.freeimage", "DCX-PIL": "imageio.plugins.pillow_legacy", "DDS-FI": "imageio.plugins.freeimage", "DDS-PIL": "imageio.plugins.pillow_legacy", "DIB-PIL": "imageio.plugins.pillow_legacy", "DICOM": "imageio.plugins.dicom", "EPS-PIL": "imageio.plugins.pillow_legacy", "EXR-FI": "imageio.plugins.freeimage", "FEI": "imageio.plugins.feisem", "FFMPEG": "imageio.plugins.ffmpeg", "FITS-PIL": "imageio.plugins.pillow_legacy", "fits": "imageio.plugins.fits", "FLI-PIL": "imageio.plugins.pillow_legacy", "FPX-PIL": "imageio.plugins.pillow_legacy", "FTEX-PIL": "imageio.plugins.pillow_legacy", "G3-FI": "imageio.plugins.freeimage", "GBR-PIL": "imageio.plugins.pillow_legacy", "GDAL": "imageio.plugins.gdal", "GIF-FI": "imageio.plugins.freeimage", "GIF-PIL": "imageio.plugins.pillow_legacy", "GRIB-PIL": "imageio.plugins.pillow_legacy", "HDF5-PIL": "imageio.plugins.pillow_legacy", "HDR-FI": "imageio.plugins.freeimage", "ICNS-PIL": "imageio.plugins.pillow_legacy", "ICO-FI": "imageio.plugins.freeimage", "ICO-PIL": "imageio.plugins.pillow_legacy", "IFF-FI": "imageio.plugins.freeimage", "IM-PIL": "imageio.plugins.pillow_legacy", "IMT-PIL": "imageio.plugins.pillow_legacy", "IPTC-PIL": "imageio.plugins.pillow_legacy", "itk": "imageio.plugins.simpleitk", "J2K-FI": "imageio.plugins.freeimage", "JNG-FI": "imageio.plugins.freeimage", "JP2-FI": "imageio.plugins.freeimage", "JPEG-FI": "imageio.plugins.freeimage", "JPEG-PIL": "imageio.plugins.pillow_legacy", "JPEG-XR-FI": "imageio.plugins.freeimage", "JPEG2000-PIL": "imageio.plugins.pillow_legacy", "KOALA-FI": "imageio.plugins.freeimage", "LYTRO-F01-RAW": "imageio.plugins.lytro", "LYTRO-ILLUM-RAW": "imageio.plugins.lytro", "LYTRO-LFP": "imageio.plugins.lytro", "LYTRO-LFR": "imageio.plugins.lytro", "MCIDAS-PIL": "imageio.plugins.pillow_legacy", "MIC-PIL": "imageio.plugins.pillow_legacy", "MPO-PIL": "imageio.plugins.pillow_legacy", "MSP-PIL": "imageio.plugins.pillow_legacy", "npz": "imageio.plugins.npz", "PBM-FI": "imageio.plugins.freeimage", "PBMRAW-FI": "imageio.plugins.freeimage", "PCD-FI": "imageio.plugins.freeimage", "PCD-PIL": "imageio.plugins.pillow_legacy", "PCX-FI": "imageio.plugins.freeimage", "PCX-PIL": "imageio.plugins.pillow_legacy", "PFM-FI": "imageio.plugins.freeimage", "PGM-FI": "imageio.plugins.freeimage", "PGMRAW-FI": "imageio.plugins.freeimage", "PICT-PIL": "imageio.plugins.pillow_legacy", "PIXAR-PIL": "imageio.plugins.pillow_legacy", "PNG-FI": "imageio.plugins.freeimage", "PNG-PIL": "imageio.plugins.pillow_legacy", "PPM-FI": "imageio.plugins.freeimage", "PPM-PIL": "imageio.plugins.pillow_legacy", "PPMRAW-FI": "imageio.plugins.freeimage", "PSD-FI": "imageio.plugins.freeimage", "PSD-PIL": "imageio.plugins.pillow_legacy", "RAS-FI": "imageio.plugins.freeimage", "RAW-FI": "imageio.plugins.freeimage", "SGI-FI": "imageio.plugins.freeimage", "SGI-PI": "imageio.plugins.pillow_legacy", "SGI-PIL": "imageio.plugins.pillow_legacy", "SPE": "imageio.plugins.spe", "SPIDER-PIL": "imageio.plugins.pillow_legacy", "SUN-PIL": "imageio.plugins.pillow_legacy", "SWF": "imageio.plugins.swf", "TARGA-FI": "imageio.plugins.freeimage", "TGA-PIL": "imageio.plugins.pillow_legacy", "TIFF-FI": "imageio.plugins.freeimage", "TIFF-PIL": "imageio.plugins.pillow_legacy", "tiff": "imageio.plugins.tifffile", "WBMP-FI": "imageio.plugins.freeimage", "WEBP-FI": "imageio.plugins.freeimage", "WMF-PIL": "imageio.plugins.pillow_legacy", "XBM-FI": "imageio.plugins.freeimage", "XBM-PIL": "imageio.plugins.pillow_legacy", "XPM-FI": "imageio.plugins.freeimage", "XPM-PIL": "imageio.plugins.pillow_legacy", "XVTHUMB-PIL": "imageio.plugins.pillow_legacy", }
43.927083
52
0.669433
502
4,217
5.535857
0.177291
0.468514
0.309464
0.402303
0.541922
0.02375
0
0
0
0
0
0.002736
0.13327
4,217
95
53
44.389474
0.757592
0
0
0
0
0
0.730614
0.550154
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
f0c8b55c2eca0b305dfee13c8d97c2cd964cc1f0
39
py
Python
tests/__init__.py
Brodinlab/olinkform
001d5274018fa97da390e28412de491da8db8d26
[ "MIT" ]
2
2021-05-19T10:17:23.000Z
2021-11-01T11:26:06.000Z
tests/__init__.py
Brodinlab/olinkform
001d5274018fa97da390e28412de491da8db8d26
[ "MIT" ]
null
null
null
tests/__init__.py
Brodinlab/olinkform
001d5274018fa97da390e28412de491da8db8d26
[ "MIT" ]
null
null
null
"""Unit test package for olinkform."""
19.5
38
0.692308
5
39
5.4
1
0
0
0
0
0
0
0
0
0
0
0
0.128205
39
1
39
39
0.794118
0.820513
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
f0cd39eb1a9a249a15890ba5d8bbdd1e196e28b2
122
py
Python
rBN/profiler/neuron_activation_profiler.py
hiroki-kyoto/LogicNet
a9105c38c60fec8e74c7d039e58625c9b3b3e691
[ "MIT" ]
null
null
null
rBN/profiler/neuron_activation_profiler.py
hiroki-kyoto/LogicNet
a9105c38c60fec8e74c7d039e58625c9b3b3e691
[ "MIT" ]
null
null
null
rBN/profiler/neuron_activation_profiler.py
hiroki-kyoto/LogicNet
a9105c38c60fec8e74c7d039e58625c9b3b3e691
[ "MIT" ]
null
null
null
import numpy as np import torch import torchvision import tqdm def profile(model, data, weight, neuron_prefix): pass
15.25
48
0.778689
18
122
5.222222
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.172131
122
7
49
17.428571
0.930693
0
0
0
0
0
0
0
0
0
0
0
0
1
0.166667
false
0.166667
0.666667
0
0.833333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
1
0
1
0
0
5
0b0c08b20a122fbfde7e4326cbc66e8d914b27a4
321
py
Python
aws_lambda_powertools/event_handler/__init__.py
stephenbawks/aws-lambda-powertools-python
6869155236787a569fcbdff60b5cc03a3055cc04
[ "MIT-0" ]
null
null
null
aws_lambda_powertools/event_handler/__init__.py
stephenbawks/aws-lambda-powertools-python
6869155236787a569fcbdff60b5cc03a3055cc04
[ "MIT-0" ]
null
null
null
aws_lambda_powertools/event_handler/__init__.py
stephenbawks/aws-lambda-powertools-python
6869155236787a569fcbdff60b5cc03a3055cc04
[ "MIT-0" ]
null
null
null
""" Event handler decorators for common Lambda events """ from .api_gateway import ALBResolver, APIGatewayHttpResolver, ApiGatewayResolver, APIGatewayRestResolver from .appsync import AppSyncResolver __all__ = ["AppSyncResolver", "APIGatewayRestResolver", "APIGatewayHttpResolver", "ALBResolver", "ApiGatewayResolver"]
35.666667
118
0.82243
25
321
10.36
0.72
0
0
0
0
0
0
0
0
0
0
0
0.090343
321
8
119
40.125
0.886986
0.152648
0
0
0
0
0.333333
0.166667
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
0b1eb24bab6336042ecc35f68b2b650a4803e6b0
286
py
Python
release/stubs.min/Autodesk/Revit/DB/__init___parts/IExtension.py
htlcnn/ironpython-stubs
780d829e2104b2789d5f4d6f32b0ec9f2930ca03
[ "MIT" ]
182
2017-06-27T02:26:15.000Z
2022-03-30T18:53:43.000Z
release/stubs.min/Autodesk/Revit/DB/__init___parts/IExtension.py
htlcnn/ironpython-stubs
780d829e2104b2789d5f4d6f32b0ec9f2930ca03
[ "MIT" ]
28
2017-06-27T13:38:23.000Z
2022-03-15T11:19:44.000Z
release/stubs.min/Autodesk/Revit/DB/__init___parts/IExtension.py
htlcnn/ironpython-stubs
780d829e2104b2789d5f4d6f32b0ec9f2930ca03
[ "MIT" ]
67
2017-06-28T09:43:59.000Z
2022-03-20T21:17:10.000Z
class IExtension: """ An interface that supports the additional operation for Extension Status """ def __init__(self,*args): """ x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """ pass
47.666667
147
0.723776
36
286
4.972222
0.638889
0.167598
0.178771
0.212291
0.346369
0.346369
0.346369
0.346369
0
0
0
0
0.15035
286
5
148
57.2
0.736626
0.734266
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0.333333
0
0
0.666667
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
5
9bd7dc79b8bcfa6f807f6cbf52a196a29c4ed8ac
173
py
Python
assignments/week2/adc_read.py
qi2018d/sensor
a0d027285393f25fac69591805886434f8b3a245
[ "MIT" ]
null
null
null
assignments/week2/adc_read.py
qi2018d/sensor
a0d027285393f25fac69591805886434f8b3a245
[ "MIT" ]
null
null
null
assignments/week2/adc_read.py
qi2018d/sensor
a0d027285393f25fac69591805886434f8b3a245
[ "MIT" ]
null
null
null
raw = int(open("/sys/bus/iio/devices/iio:device0/in_voltage0_raw").read()) scale = float(open("/sys/bus/iio/devices/iio:device0/in_voltage_scale").read()) print raw*scale
28.833333
79
0.739884
29
173
4.275862
0.517241
0.112903
0.16129
0.209677
0.516129
0.516129
0.516129
0.516129
0
0
0
0.018405
0.057803
173
5
80
34.6
0.742331
0
0
0
0
0
0.563953
0.563953
0
0
0
0
0
0
null
null
0
0
null
null
0.333333
1
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
1
null
0
0
0
0
1
0
0
0
0
0
0
0
0
5
501228982a9ca1b691dd86b461e02a387b0428ca
87
py
Python
Examples/AppKit/DatePicker/main.py
Khan/pyobjc-framework-Cocoa
f8b015ea2a72d8d78be6084fb12925c4785b8f1f
[ "MIT" ]
132
2015-01-01T10:02:42.000Z
2022-03-09T12:51:01.000Z
mac/pyobjc-framework-Cocoa/Examples/AppKit/DatePicker/main.py
mba811/music-player
7998986b34cfda2244ef622adefb839331b81a81
[ "BSD-2-Clause" ]
6
2015-01-06T08:23:19.000Z
2019-03-14T12:22:06.000Z
mac/pyobjc-framework-Cocoa/Examples/AppKit/DatePicker/main.py
mba811/music-player
7998986b34cfda2244ef622adefb839331b81a81
[ "BSD-2-Clause" ]
27
2015-02-23T11:51:43.000Z
2022-03-07T02:34:18.000Z
from PyObjCTools import AppHelper import MyWindowController AppHelper.runEventLoop()
14.5
33
0.862069
8
87
9.375
0.75
0
0
0
0
0
0
0
0
0
0
0
0.103448
87
5
34
17.4
0.961538
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
5056d6d20971528e855ee41e0589248f50d12def
231
py
Python
bin/_packageManager.py
JackHumphries9/ida
a234484cdcd0e19612911b4f548ceb40bb22fad4
[ "MIT" ]
null
null
null
bin/_packageManager.py
JackHumphries9/ida
a234484cdcd0e19612911b4f548ceb40bb22fad4
[ "MIT" ]
null
null
null
bin/_packageManager.py
JackHumphries9/ida
a234484cdcd0e19612911b4f548ceb40bb22fad4
[ "MIT" ]
null
null
null
from tkinter import * from tkinter import messagebox from bin import __tkinterp class packageManagerApp: def __init__(self): messagebox.showerror("Currently Not Supported", "This is currently not supported!")
25.666667
91
0.74026
26
231
6.346154
0.653846
0.133333
0.206061
0
0
0
0
0
0
0
0
0
0.199134
231
9
91
25.666667
0.891892
0
0
0
0
0
0.245536
0
0
0
0
0
0
1
0.166667
false
0
0.5
0
0.833333
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
ac90a7b4a104e42e031dc5cd0a1de6b1d7c14092
193
py
Python
src/log/dynamic_handler.py
iwasingh/Wikoogle
ef39b4f96347c9899721ea78403d8db84e0c2b82
[ "MIT" ]
8
2020-06-27T08:56:30.000Z
2021-09-29T21:31:24.000Z
src/log/dynamic_handler.py
iwasingh/Wikoogle
ef39b4f96347c9899721ea78403d8db84e0c2b82
[ "MIT" ]
2
2020-09-03T15:52:17.000Z
2021-03-31T19:53:56.000Z
src/log/dynamic_handler.py
iwasingh/Wikoogle
ef39b4f96347c9899721ea78403d8db84e0c2b82
[ "MIT" ]
1
2020-06-29T15:50:51.000Z
2020-06-29T15:50:51.000Z
from logging import FileHandler # class DynamicFileHandler(FileHandler): # def __init__(self, mode='a', encoding=None, delay=False): # # super().__init__(, mode, encoding, delay)
24.125
63
0.694301
21
193
6
0.761905
0
0
0
0
0
0
0
0
0
0
0
0.170984
193
7
64
27.571429
0.7875
0.777202
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
aca584092c9a58c7d2d448b0d874f3cc8eb4e2a4
84
py
Python
enthought/envisage/plugin.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
3
2016-12-09T06:05:18.000Z
2018-03-01T13:00:29.000Z
enthought/envisage/plugin.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
1
2020-12-02T00:51:32.000Z
2020-12-02T08:48:55.000Z
enthought/envisage/plugin.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
null
null
null
# proxy module from __future__ import absolute_import from envisage.plugin import *
21
38
0.833333
11
84
5.909091
0.727273
0
0
0
0
0
0
0
0
0
0
0
0.130952
84
3
39
28
0.890411
0.142857
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
acd89dca4505a3e87a81a2ae654ce9ec5f417225
158
py
Python
leetCode/KMP_is_why_KMP_2902.py
yskang/AlgorithmPracticeWithPython
f7129bd1924a7961489198f0ee052d2cd1e9cf40
[ "MIT" ]
null
null
null
leetCode/KMP_is_why_KMP_2902.py
yskang/AlgorithmPracticeWithPython
f7129bd1924a7961489198f0ee052d2cd1e9cf40
[ "MIT" ]
null
null
null
leetCode/KMP_is_why_KMP_2902.py
yskang/AlgorithmPracticeWithPython
f7129bd1924a7961489198f0ee052d2cd1e9cf40
[ "MIT" ]
null
null
null
# Title: KMP는 왜 KMP일까? # Link: https://www.acmicpc.net/problem/2902 import sys print(''.join(map(lambda a: a[0], sys.stdin.readline().strip().split('-'))))
39.5
76
0.658228
25
158
4.16
0.92
0
0
0
0
0
0
0
0
0
0
0.035211
0.101266
158
4
76
39.5
0.697183
0.398734
0
0
0
0
0.011111
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0.5
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
1
0
5
4a1f5e3fc7a89703c5296d8f776563475183499a
3,516
py
Python
level_13.py
katsukaree/chapter-weasel
fa9a6c890eb6bca1f25dd89a97ef10ea7b62c2b7
[ "MIT" ]
null
null
null
level_13.py
katsukaree/chapter-weasel
fa9a6c890eb6bca1f25dd89a97ef10ea7b62c2b7
[ "MIT" ]
null
null
null
level_13.py
katsukaree/chapter-weasel
fa9a6c890eb6bca1f25dd89a97ef10ea7b62c2b7
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 import requests import base64 import re import tempfile import urllib.parse from bs4 import BeautifulSoup from levels_credentials import credentials, folder level_url = credentials[13]["url"] level_username = credentials[13]["level"] level_password = credentials[13]["password"] next_level_url = credentials[14]["url"] next_level_username = credentials[14]["level"] next_level_pass = folder + next_level_username credentials = "%s:%s" % (level_username, level_password) auth_creds = base64.b64encode(credentials.encode("ascii")) heads = {"Authorization": "Basic %s" % auth_creds.decode("ascii")} basic_file = b"""\xff\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x01\x00`\x00`\x00\x00\xff\xdb\x00C\x00\x08\x06\x06\x07\x06\x05\x08\x07\x07\x07\t\t\x08\n\x0c\x14\r\x0c\x0b\x0b\x0c\x19\x12\x13\x0f\x14\x1d\x1a\x1f\x1e\x1d\x1a\x1c\x1c $.\' ",#\x1c\x1c(7),01444\x1f\'9=82<.342\xff\xdb\x00C\x01\t\t\t\x0c\x0b\x0c\x18\r\r\x182!\x1c!22222222222222222222222222222222222222222222222222\xff\xc0\x00\x11\x08\x00\x01\x00\x01\x03\x01"\x00\x02\x11\x01\x03\x11\x01\xff\xc4\x00\x1f\x00\x00\x01\x05\x01\x01\x01\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\xff\xc4\x00\xb5\x10\x00\x02\x01\x03\x03\x02\x04\x03\x05\x05\x04\x04\x00\x00\x01}\x01\x02\x03\x00\x04\x11\x05\x12!1A\x06\x13Qa\x07"q\x142\x81\x91\xa1\x08#B\xb1\xc1\x15R\xd1\xf0$3br\x82\t\n\x16\x17\x18\x19\x1a%&\'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz\x83\x84\x85\x86\x87\x88\x89\x8a\x92\x93\x94\x95\x96\x97\x98\x99\x9a\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xff\xc4\x00\x1f\x01\x00\x03\x01\x01\x01\x01\x01\x01\x01\x01\x01\x00\x00\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\xff\xc4\x00\xb5\x11\x00\x02\x01\x02\x04\x04\x03\x04\x07\x05\x04\x04\x00\x01\x02w\x00\x01\x02\x03\x11\x04\x05!1\x06\x12AQ\x07aq\x13"2\x81\x08\x14B\x91\xa1\xb1\xc1\t#3R\xf0\x15br\xd1\n\x16$4\xe1%\xf1\x17\x18\x19\x1a&\'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x92\x93\x94\x95\x96\x97\x98\x99\x9a\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xff\xda\x00\x0c\x03\x01\x00\x02\x11\x03\x11\x00?\x00\xf7\xfa(\xa2\x80?\xff\xd9""" payload = b'<?php $myfile = fopen("../../../../../../../..%s", "r"); echo fgets($myfile); fclose($myfile); ?>' % next_level_pass.encode("ascii") spiked_file = basic_file + payload initial_response = requests.get(level_url, headers=heads) initial_page = BeautifulSoup(initial_response.text, 'html.parser') hidden_filename = initial_page.find_all("input")[1].get("value") filename_list = re.split("\.", hidden_filename) with tempfile.NamedTemporaryFile(prefix=filename_list[0], suffix=".php") as fp: fp.write(spiked_file) fp.seek(0) files = {"uploadedfile": fp} next_data = {"MAX_FILE_SIZE": "1000", "filename":"%s.php" % filename_list[0]} next_response = requests.post(level_url, headers=heads, files=files, data=next_data) next_response_parsed = BeautifulSoup(next_response.text, 'html.parser') evil_file = next_response_parsed.find_all("a")[0].get("href") evil_file_path = level_url + evil_file next_pass = requests.get(evil_file_path, headers=heads) print(next_pass.text.strip()[-32::])
74.808511
1,872
0.742036
661
3,516
3.865356
0.343419
0.04227
0.04227
0.04227
0.255186
0.243444
0.243444
0.235225
0.231703
0.210568
0
0.209865
0.048635
3,516
46
1,873
76.434783
0.553961
0.005973
0
0
0
0.058824
0.60103
0.538065
0
0
0
0
0
1
0
false
0.176471
0.205882
0
0.205882
0.029412
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
1
0
0
0
0
0
5
4a1f6444e2b8537d0e12f4b812b194e85c7c4869
127
py
Python
FaceDetectionModule/helper_types/vector.py
Bricktheworld/rhombus-api-examples-python
b4778c3a635786070ee10a3131b1a1f7f6ebac36
[ "MIT" ]
null
null
null
FaceDetectionModule/helper_types/vector.py
Bricktheworld/rhombus-api-examples-python
b4778c3a635786070ee10a3131b1a1f7f6ebac36
[ "MIT" ]
20
2021-06-08T22:29:20.000Z
2022-01-15T19:51:46.000Z
FaceDetectionModule/helper_types/vector.py
Bricktheworld/rhombus-api-examples-python
b4778c3a635786070ee10a3131b1a1f7f6ebac36
[ "MIT" ]
9
2021-06-08T22:15:35.000Z
2022-03-03T05:19:58.000Z
class Vec2: x: float y: float def __init__(self, x:float, y:float) -> None: self.x = x self.y = y
15.875
49
0.503937
20
127
3
0.45
0.2
0.233333
0.4
0
0
0
0
0
0
0
0.0125
0.370079
127
7
50
18.142857
0.7375
0
0
0
0
0
0
0
0
0
0
0
0
1
0.166667
false
0
0
0
0.666667
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
5
c5800e4759a5c3cde10a02db8577cef1b17279a8
1,355
py
Python
tests/commands/test_product.py
marcserrat/connect-cli
4a6aafeb99a1fd87fcc9ef4f523baa66e470b1f9
[ "Apache-2.0" ]
2
2020-12-01T15:55:22.000Z
2022-02-16T10:13:58.000Z
tests/commands/test_product.py
marcserrat/connect-cli
4a6aafeb99a1fd87fcc9ef4f523baa66e470b1f9
[ "Apache-2.0" ]
null
null
null
tests/commands/test_product.py
marcserrat/connect-cli
4a6aafeb99a1fd87fcc9ef4f523baa66e470b1f9
[ "Apache-2.0" ]
null
null
null
from click.testing import CliRunner from cnctcli.ccli import cli def test_export(config_mocker, mocker): mock = mocker.patch( 'cnctcli.commands.product.dump_product', side_effect=lambda *args: 'PRD-000.xlsx', ) runner = CliRunner() result = runner.invoke( cli, [ 'product', 'export', 'PRD-000', ], ) mock.assert_called_once() assert mock.mock_calls[0][1][2] == 'PRD-000' assert mock.mock_calls[0][1][3] is None assert result.exit_code == 0 assert 'The product PRD-000 has been successfully exported to PRD-000.xlsx.\n' in result.output def test_export_custom_file(config_mocker, mocker): mock = mocker.patch( 'cnctcli.commands.product.dump_product', side_effect=lambda *args: '/tmp/my_product.xlsx', ) runner = CliRunner() result = runner.invoke( cli, [ 'product', 'export', 'PRD-000', '-o', '/tmp/my_product.xlsx' ], ) mock.assert_called_once() assert mock.mock_calls[0][1][2] == 'PRD-000' assert mock.mock_calls[0][1][3] == '/tmp/my_product.xlsx' assert result.exit_code == 0 assert 'The product PRD-000 has been successfully exported to /tmp/my_product.xlsx.\n' \ in result.output
26.568627
99
0.591882
171
1,355
4.549708
0.315789
0.061697
0.071979
0.097686
0.786632
0.737789
0.737789
0.737789
0.737789
0.737789
0
0.038974
0.280443
1,355
50
100
27.1
0.758974
0
0
0.55814
0
0
0.256827
0.071587
0
0
0
0
0.232558
1
0.046512
false
0
0.046512
0
0.093023
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
c5cca808b565588216c900809539a30be06a2f89
161
py
Python
__init__.py
gmduvvuri/spectralPhoton
41ab7539b9b1f920a29aca23989a50d07534fdb4
[ "MIT" ]
2
2018-04-26T19:52:25.000Z
2019-08-03T07:18:24.000Z
__init__.py
gmduvvuri/spectralPhoton
41ab7539b9b1f920a29aca23989a50d07534fdb4
[ "MIT" ]
null
null
null
__init__.py
gmduvvuri/spectralPhoton
41ab7539b9b1f920a29aca23989a50d07534fdb4
[ "MIT" ]
5
2018-05-16T16:38:10.000Z
2021-02-23T21:05:57.000Z
from __future__ import division, print_function, absolute_import from .data_structures import Photons, Spectrum, MultiSpectrum, GappySpectrum from . import hst
32.2
76
0.84472
19
161
6.789474
0.736842
0
0
0
0
0
0
0
0
0
0
0
0.111801
161
4
77
40.25
0.902098
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0.333333
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
c5d5b59a7fd8ffd8b2565ad711e5ae0194048042
116
py
Python
providers/config/__init__.py
kamotos/mozio_providers
721111addc1a244032490877ed316d1099f6c48d
[ "Apache-2.0" ]
null
null
null
providers/config/__init__.py
kamotos/mozio_providers
721111addc1a244032490877ed316d1099f6c48d
[ "Apache-2.0" ]
2
2021-03-19T23:56:23.000Z
2021-06-10T23:17:37.000Z
providers/config/__init__.py
kamotos/mozio_providers
721111addc1a244032490877ed316d1099f6c48d
[ "Apache-2.0" ]
null
null
null
from __future__ import absolute_import from .local import Local # noqa from .production import Production # noqa
23.2
42
0.801724
15
116
5.866667
0.466667
0
0
0
0
0
0
0
0
0
0
0
0.163793
116
4
43
29
0.907216
0.077586
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
c5de72662a180b8f5cbd14b9d8ceaf100b6f8b6c
96
py
Python
venv/lib/python3.8/site-packages/numpy/ctypeslib.py
GiulianaPola/select_repeats
17a0d053d4f874e42cf654dd142168c2ec8fbd11
[ "MIT" ]
2
2022-03-13T01:58:52.000Z
2022-03-31T06:07:54.000Z
venv/lib/python3.8/site-packages/numpy/ctypeslib.py
DesmoSearch/Desmobot
b70b45df3485351f471080deb5c785c4bc5c4beb
[ "MIT" ]
19
2021-11-20T04:09:18.000Z
2022-03-23T15:05:55.000Z
venv/lib/python3.8/site-packages/numpy/ctypeslib.py
DesmoSearch/Desmobot
b70b45df3485351f471080deb5c785c4bc5c4beb
[ "MIT" ]
null
null
null
/home/runner/.cache/pip/pool/2a/f2/c2/ff9fb98b3a4eafb976b622a8c9b05880d1afe02cfe10f175e8122239b8
96
96
0.895833
9
96
9.555556
1
0
0
0
0
0
0
0
0
0
0
0.385417
0
96
1
96
96
0.510417
0
0
0
0
0
0
0
0
1
0
0
0
0
null
null
0
0
null
null
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
0
0
0
null
1
0
0
0
1
0
0
0
0
0
0
0
0
5
a84e57088f30db37522292056240b3e20e60a9f4
176
py
Python
terrascript/template/d.py
GarnerCorp/python-terrascript
ec6c2d9114dcd3cb955dd46069f8ba487e320a8c
[ "BSD-2-Clause" ]
null
null
null
terrascript/template/d.py
GarnerCorp/python-terrascript
ec6c2d9114dcd3cb955dd46069f8ba487e320a8c
[ "BSD-2-Clause" ]
null
null
null
terrascript/template/d.py
GarnerCorp/python-terrascript
ec6c2d9114dcd3cb955dd46069f8ba487e320a8c
[ "BSD-2-Clause" ]
1
2018-11-15T16:23:05.000Z
2018-11-15T16:23:05.000Z
from terrascript import _data class template_file(_data): pass file = template_file class template_cloudinit_config(_data): pass cloudinit_config = template_cloudinit_config
22
44
0.852273
23
176
6.086957
0.434783
0.321429
0.328571
0
0
0
0
0
0
0
0
0
0.102273
176
7
45
25.142857
0.886076
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0.4
0.2
0
0.6
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
5
a85a5d27e3e70d1a21b2f1cb17d6fc6031642443
415
py
Python
datatransformer/abstractobject.py
nextfortune/datatransformer
5bdc593dc6e74c22fb630a5f3714aa209c500d16
[ "MIT" ]
null
null
null
datatransformer/abstractobject.py
nextfortune/datatransformer
5bdc593dc6e74c22fb630a5f3714aa209c500d16
[ "MIT" ]
null
null
null
datatransformer/abstractobject.py
nextfortune/datatransformer
5bdc593dc6e74c22fb630a5f3714aa209c500d16
[ "MIT" ]
null
null
null
#pylint: disable=C0114,C0115,C0116 import abc class DataTransformer(abc.ABC): @property def dimensions(self): pass @property def dense_features(self): pass @property def sparse_features(self): pass @property def feature_columns(self): pass @property def labels(self): pass @classmethod def to_dataset(cls): pass
14.310345
34
0.6
45
415
5.444444
0.533333
0.22449
0.261224
0.310204
0.220408
0
0
0
0
0
0
0.042553
0.320482
415
28
35
14.821429
0.826241
0.079518
0
0.55
0
0
0
0
0
0
0
0
0
1
0.3
false
0.3
0.05
0
0.4
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
5
a8a3e716ac78d1083240fdacdbd7a1ef6ce75069
7,540
py
Python
ms_graph/notes.py
vsnandy/ms-graph-python-client
3a06cbe074689dc02e50ba4879823a560220479a
[ "MIT" ]
39
2020-11-24T20:46:02.000Z
2022-03-29T13:47:09.000Z
ms_graph/notes.py
vsnandy/ms-graph-python-client
3a06cbe074689dc02e50ba4879823a560220479a
[ "MIT" ]
7
2021-02-11T11:43:27.000Z
2022-01-25T06:04:41.000Z
ms_graph/notes.py
vsnandy/ms-graph-python-client
3a06cbe074689dc02e50ba4879823a560220479a
[ "MIT" ]
34
2020-10-28T10:47:37.000Z
2022-02-02T09:50:04.000Z
from typing import Dict from ms_graph.session import GraphSession class Notes(): """ ## Overview: ---- Microsoft Graph lets your app get authorized access to a user's OneNote notebooks, sections, and pages in a personal or organization account. With the appropriate delegated or application permissions, your app can access the OneNote data of the signed-in user or any user in a tenant. """ def __init__(self, session: object) -> None: """Initializes the `Notes` object. ### Parameters ---- session : object An authenticated session for our Microsoft Graph Client. """ # Set the session. self.graph_session: GraphSession = session # Set the endpoint. self.endpoint = 'onenote' def list_my_notebooks(self) -> Dict: """Retrieve a list of your notebook objects. ### Returns ---- Dict: A List of `Notebook` Resource Object. """ # define the endpoints. endpoint = "me/" + self.endpoint + "/notebooks" content = self.graph_session.make_request( method='get', endpoint=endpoint ) return content def list_user_notebooks(self, user_id: str) -> Dict: """Retrieve a list of notebook objects. ### Parameters ---- user_id (str): The User's ID that is assoicated with their Graph account. ### Returns ---- Dict: A List of `Notebook` Resource Object. """ # Define the endpoint. endpoint = "users/{user_id}".format(user_id=user_id) + \ self.endpoint + "/notebooks" content = self.graph_session.make_request( method='get', endpoint=endpoint ) return content def list_group_notebooks(self, group_id: str) -> Dict: """Retrieve a list of notebook objects. ### Parameters ---- group_id (str): The Group ID that you want to pull notebooks for. ### Returns ---- Dict: A List of `Notebook` Resource Object. """ # Define the endpoint. endpoint = "groups/{group_id}".format( group_id=group_id) + self.endpoint + "/notebooks" content = self.graph_session.make_request( method='get', endpoint=endpoint ) return content def list_site_notebooks(self, site_id: str) -> Dict: """Retrieve a list of notebook objects. ### Parameters ---- site_id (str): The Site ID that you want to pull notebooks for. ### Returns ---- Dict: A List of `Notebook` Resource Object. """ # Define the endpoint. endpoint = "sites/{site_id}".format(site_id=site_id) + \ self.endpoint + "/notebooks" content = self.graph_session.make_request( method='get', endpoint=endpoint ) return content def get_my_notebook(self, notebook_id: str) -> Dict: """Retrieve a list of notebook objects. ### Parameters ---- notebook_id (str): The User's Notebook ID that you want to pull. ### Returns ---- Dict: A List of `Notebook` Resource Object. """ # define the endpoints. endpoint = "me/" + self.endpoint + "/notebooks/{notebook_id}".format( notebook_id=notebook_id ) content = self.graph_session.make_request( method='get', endpoint=endpoint ) return content def get_user_notebook(self, user_id: str, notebook_id: str) -> Dict: """Retrieve a notebook object from a user by it's ID. ### Parameters ---- user_id (str): The User's ID that is assoicated with their Graph account. notebook_id (str): The Notebook ID that you want to pull. ### Returns ---- Dict: A List of `Notebook` Resource Object. """ # Define the endpoint. endpoint = "users/{user_id}".format(user_id=user_id) + self.endpoint + "/notebooks/{notebook_id}".format( notebook_id=notebook_id ) content = self.graph_session.make_request( method='get', endpoint=endpoint ) return content def get_group_notebook(self, group_id: str, notebook_id: str) -> Dict: """Retrieve a notebook object from a Group by it's ID. ### Parameters ---- group_id (str): The Group ID that you want to pull notebooks for. notebook_id (str): The Notebook ID that you want to pull. ### Returns ---- Dict: A List of `Notebook` Resource Object. """ # Define the endpoint. endpoint = "groups/{group_id}".format(group_id=group_id) + self.endpoint + "/notebooks/{notebook_id}".format( notebook_id=notebook_id ) content = self.graph_session.make_request( method='get', endpoint=endpoint ) return content def get_site_notebook(self, site_id: str, notebook_id: str) -> Dict: """Retrieve a notebook object from a SharePoint Site by it's ID. ### Parameters ---- site_id (str): The Site ID that you want to pull notebooks for. notebook_id (str): The Notebook ID that you want to pull. ### Returns ---- Dict: A List of `Notebook` Resource Object. """ # Define the endpoint. endpoint = "sites/{site_id}".format(site_id=site_id) + self.endpoint + "/notebooks/{notebook_id}".format( notebook_id=notebook_id ) content = self.graph_session.make_request( method='get', endpoint=endpoint ) return content def list_my_notebook_sections(self, notebook_id: str) -> Dict: """Retrieve a list of onenoteSection objects from one of your notebooks. ### Parameters ---- notebook_id (str): The Notebook ID that you want to pull. ### Returns ---- Dict: A List of `Notebook` Resource Object. """ # Define the endpoint. endpoint = endpoint = "me/" + self.endpoint + "/notebooks/{notebook_id}".format( notebook_id=notebook_id ) + "/sections" content = self.graph_session.make_request( method='get', endpoint=endpoint ) return content def list_my_notebook_pages(self, section_id: str) -> Dict: """Retrieve a list of onenoteSection objects from one of your notebooks. ### Parameters ---- notebook_id (str): The Notebook ID that you want to pull. section (str): The Section ID that you want to pull. ### Returns ---- Dict: A List of `Notebook` Resource Object. """ # Define the endpoint. endpoint = endpoint = "me/{endpoint}/".format(endpoint=self.endpoint) + "/sections/{section_id}".format( section_id=section_id ) content = self.graph_session.make_request( method='get', endpoint=endpoint ) return content
25.733788
117
0.550796
818
7,540
4.944988
0.114914
0.07911
0.029419
0.051916
0.793078
0.777998
0.777998
0.777998
0.777998
0.772064
0
0
0.350133
7,540
292
118
25.821918
0.82551
0.377321
0
0.516484
0
0
0.091125
0.037507
0
0
0
0
0
1
0.120879
false
0
0.021978
0
0.263736
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
7692fc3e75e57dd80b022e932a91fa8e634840fd
520
py
Python
InnerEye/ML/configs/histo_configs/run_ids.py
faz1993/InnerEye-DeepLearning
fb258d5c9a3ba18565b5a67e7ac1f00127d9ecb9
[ "MIT" ]
1
2022-03-16T02:10:13.000Z
2022-03-16T02:10:13.000Z
InnerEye/ML/configs/histo_configs/run_ids.py
wensincai/InnerEye-DeepLearning
ccb53d01ad0f1c20336588c0066059b8de5266fd
[ "MIT" ]
null
null
null
InnerEye/ML/configs/histo_configs/run_ids.py
wensincai/InnerEye-DeepLearning
ccb53d01ad0f1c20336588c0066059b8de5266fd
[ "MIT" ]
null
null
null
innereye_ssl_checkpoint = "hsharma_panda_explore:hsharma_panda_explore_1638437076_357167ae" innereye_ssl_checkpoint_binary = "hsharma_panda_tiles_ssl:hsharma_panda_tiles_ssl_1639766433_161e03b9" innereye_ssl_checkpoint_crck_4ws = "ModifyOldSSLCheckpoint:a9259fdb-3964-4c5b-8962-4660e0b79d44" innereye_ssl_checkpoint_crck_radiomics = "ModifyOldSSLCheckpoint:704b1af8-7c75-46ed-8460-d80a0e603194" # outdated checkpoints # innereye_ssl_checkpoint_crck_radiomics = updated_transforms:updated_transforms_1636471522_5473e3ff
65
102
0.907692
60
520
7.283333
0.533333
0.125858
0.240275
0.171625
0.155606
0
0
0
0
0
0
0.188
0.038462
520
7
103
74.285714
0.686
0.228846
0
0
0
0
0.623116
0.623116
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
76992d3ed3f3d66bf162657e04c91ec021672281
3,282
py
Python
tests/test_source.py
joshuadavidthomas/django_coverage_plugin
c4ec0691906dc0923c494efc9c9236d3aa21be73
[ "Apache-2.0" ]
172
2015-01-03T20:26:42.000Z
2022-02-18T20:38:59.000Z
tests/test_source.py
joshuadavidthomas/django_coverage_plugin
c4ec0691906dc0923c494efc9c9236d3aa21be73
[ "Apache-2.0" ]
71
2015-01-17T19:22:53.000Z
2022-02-03T09:09:35.000Z
tests/test_source.py
joshuadavidthomas/django_coverage_plugin
c4ec0691906dc0923c494efc9c9236d3aa21be73
[ "Apache-2.0" ]
31
2015-01-18T14:32:46.000Z
2022-02-18T20:39:07.000Z
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt """Tests of template inheritance for django_coverage_plugin.""" from .plugin_test import DjangoPluginTestCase class FindSourceTest(DjangoPluginTestCase): def test_finding_source(self): # This is a template that is rendered. self.make_template(name="main.html", text="Hello") # These are templates that aren't rendered, but are considered renderable. self.make_template(name="unused.html", text="Not used") self.make_template(name="unused.htm", text="Not used") self.make_template(name="unused.txt", text="Not used") # These are things left behind by an editor. self.make_template(name="~unused.html", text="junk") self.make_template(name="unused=.html", text="junk") self.make_template(name="unused.html,", text="junk") # This is some other file format we don't recognize. self.make_template(name="phd.tex", text="Too complicated to read") text = self.run_django_coverage(name="main.html") self.assertEqual(text, "Hello") # The rendered file has data, and was measured. self.assert_analysis([1], name="main.html") # The unrendered files have data, and were not measured. self.assert_analysis([1], name="unused.html", missing=[1]) self.assert_analysis([1], name="unused.htm", missing=[1]) self.assert_analysis([1], name="unused.txt", missing=[1]) # The editor leave-behinds are not in the measured files. self.assert_measured_files("main.html", "unused.html", "unused.htm", "unused.txt") def test_customized_extensions(self): self.make_file(".coveragerc", """\ [run] plugins = django_coverage_plugin [django_coverage_plugin] template_extensions = html, tex """) # This is a template that is rendered. self.make_template(name="main.html", text="Hello") # These are templates that aren't rendered, but are considered renderable. self.make_template(name="unused.html", text="Not used") self.make_template(name="phd.tex", text="Too complicated to read") # These are things left behind by an editor. self.make_template(name="~unused.html", text="junk") self.make_template(name="unused=.html", text="junk") self.make_template(name="unused.html,", text="junk") # This is some other file format we don't recognize. self.make_template(name="unused.htm", text="Not used") self.make_template(name="unused.txt", text="Not used") text = self.run_django_coverage(name="main.html") self.assertEqual(text, "Hello") # The rendered file has data, and was measured. self.assert_analysis([1], name="main.html") # The unrendered files have data, and were not measured. self.assert_analysis([1], name="unused.html", missing=[1]) self.assert_analysis([1], name="phd.tex", missing=[1]) # The editor leave-behinds are not in the measured files. self.assert_measured_files("main.html", "unused.html", "phd.tex")
48.985075
90
0.659963
439
3,282
4.829157
0.234624
0.064151
0.120755
0.150943
0.789151
0.789151
0.789151
0.789151
0.768868
0.768868
0
0.005387
0.208105
3,282
66
91
49.727273
0.810312
0.287325
0
0.615385
0
0
0.269629
0.019845
0
0
0
0
0.282051
1
0.051282
false
0
0.025641
0
0.102564
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
4f37f8b258ea21482b0adf15cb9ef5199a628616
38,793
py
Python
day12/day12.py
BroderickCarlin/AdventOfCode
52d12d16f3d291a51984e6d85dbe97e604abc005
[ "MIT" ]
null
null
null
day12/day12.py
BroderickCarlin/AdventOfCode
52d12d16f3d291a51984e6d85dbe97e604abc005
[ "MIT" ]
null
null
null
day12/day12.py
BroderickCarlin/AdventOfCode
52d12d16f3d291a51984e6d85dbe97e604abc005
[ "MIT" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- pipes = "0 <-> 122, 874, 1940\n1 <-> 1099\n2 <-> 743\n3 <-> 594, 1258\n4 <-> 4, 1473\n5 <-> 109, 628, 1133, 1605\n6 <-> 470, 561, 600, 1272, 1634\n7 <-> 7, 1058, 1074, 1136\n8 <-> 879\n9 <-> 9\n10 <-> 10, 1736\n11 <-> 148, 1826\n12 <-> 774, 1394, 1495\n13 <-> 178, 410\n14 <-> 666, 763, 1696\n15 <-> 793, 1446, 1754, 1993\n16 <-> 1477\n17 <-> 1891, 1970\n18 <-> 476, 1095\n19 <-> 19\n20 <-> 581, 1380, 1817, 1877\n21 <-> 746, 1253\n22 <-> 830, 1021\n23 <-> 1115\n24 <-> 89, 1436\n25 <-> 759, 821\n26 <-> 40, 1254\n27 <-> 553, 1137, 1960\n28 <-> 100, 808\n29 <-> 279, 1223, 1591, 1726\n30 <-> 236, 325, 769, 1132\n31 <-> 425, 1377\n32 <-> 611, 1047\n33 <-> 751, 1797, 1828, 1921\n34 <-> 1563, 1681\n35 <-> 428\n36 <-> 265, 1837\n37 <-> 265, 365, 1455\n38 <-> 1600, 1690\n39 <-> 331\n40 <-> 26, 560, 1512\n41 <-> 911, 1991\n42 <-> 835\n43 <-> 680\n44 <-> 1522\n45 <-> 486, 1794\n46 <-> 170, 334, 944, 1169\n47 <-> 1086\n48 <-> 274, 924\n49 <-> 1664\n50 <-> 721\n51 <-> 1885\n52 <-> 1143, 1205\n53 <-> 148, 696\n54 <-> 1637\n55 <-> 936, 1781\n56 <-> 342, 1212\n57 <-> 911\n58 <-> 692, 1456\n59 <-> 59\n60 <-> 463, 570, 1038, 1711\n61 <-> 824, 1008, 1942\n62 <-> 165, 1926\n63 <-> 1689\n64 <-> 64, 321\n65 <-> 98, 116, 1082\n66 <-> 1426, 1497\n67 <-> 502, 951, 1514\n68 <-> 215, 610, 803\n69 <-> 264, 1660\n70 <-> 417, 648, 1142\n71 <-> 1937\n72 <-> 744, 1158\n73 <-> 466\n74 <-> 74, 673\n75 <-> 640, 1874\n76 <-> 575, 708, 1347, 1488\n77 <-> 435, 1648\n78 <-> 412\n79 <-> 347\n80 <-> 807\n81 <-> 176, 394\n82 <-> 366, 928\n83 <-> 737\n84 <-> 84, 1537\n85 <-> 1325\n86 <-> 546\n87 <-> 678, 941, 1229\n88 <-> 1325\n89 <-> 24, 89\n90 <-> 431, 988, 1453\n91 <-> 825, 957, 1249\n92 <-> 937, 1516\n93 <-> 1840\n94 <-> 916, 1445\n95 <-> 1628, 1998\n96 <-> 123\n97 <-> 355\n98 <-> 65\n99 <-> 425, 771, 1050\n100 <-> 28, 100\n101 <-> 337, 1257\n102 <-> 270, 1754\n103 <-> 103, 229\n104 <-> 157, 916\n105 <-> 1705\n106 <-> 1165\n107 <-> 1646\n108 <-> 1082\n109 <-> 5\n110 <-> 485, 1185\n111 <-> 944, 1249\n112 <-> 112, 1056\n113 <-> 1219\n114 <-> 129, 617\n115 <-> 422\n116 <-> 65\n117 <-> 200, 1802\n118 <-> 243, 1507\n119 <-> 732, 1103\n120 <-> 160\n121 <-> 320, 336\n122 <-> 0, 582, 1931\n123 <-> 96, 885, 1126, 1914\n124 <-> 124, 413\n125 <-> 125\n126 <-> 367, 655\n127 <-> 1290\n128 <-> 1085\n129 <-> 114, 1343, 1805\n130 <-> 130, 1415\n131 <-> 1626, 1734\n132 <-> 296, 573, 1575\n133 <-> 1713\n134 <-> 1243, 1530\n135 <-> 1048\n136 <-> 153, 1209\n137 <-> 137, 331\n138 <-> 555, 1350\n139 <-> 1035, 1345\n140 <-> 393, 688\n141 <-> 1037, 1998\n142 <-> 736\n143 <-> 716, 1362\n144 <-> 1319\n145 <-> 318, 445, 1471, 1608\n146 <-> 146, 294\n147 <-> 714\n148 <-> 11, 53\n149 <-> 364, 854, 1254\n150 <-> 675, 1090\n151 <-> 189, 1411, 1688\n152 <-> 683, 1614\n153 <-> 136, 1328, 1648\n154 <-> 584, 1656\n155 <-> 1972\n156 <-> 1351\n157 <-> 104, 1638\n158 <-> 165\n159 <-> 444, 1812\n160 <-> 120, 859\n161 <-> 984, 1769, 1943\n162 <-> 1098\n163 <-> 618\n164 <-> 697, 922, 1688\n165 <-> 62, 158, 1452, 1977\n166 <-> 166, 1914\n167 <-> 1996\n168 <-> 260, 843, 1057, 1433\n169 <-> 406, 736, 924\n170 <-> 46\n171 <-> 173, 833, 1104, 1149\n172 <-> 1429\n173 <-> 171, 1423\n174 <-> 174, 332\n175 <-> 655, 839\n176 <-> 81, 176, 1264\n177 <-> 177\n178 <-> 13, 1162, 1182, 1951\n179 <-> 842, 1620\n180 <-> 1294, 1442, 1809\n181 <-> 1633, 1783\n182 <-> 182, 456\n183 <-> 685\n184 <-> 760, 1974\n185 <-> 287, 775\n186 <-> 917, 1541\n187 <-> 412, 1119\n188 <-> 395\n189 <-> 151, 1370, 1792\n190 <-> 1255, 1674\n191 <-> 764, 1010\n192 <-> 192, 607, 1717\n193 <-> 1001, 1944\n194 <-> 625\n195 <-> 623\n196 <-> 1882\n197 <-> 1275\n198 <-> 1069\n199 <-> 1138, 1880\n200 <-> 117\n201 <-> 1605\n202 <-> 1041, 1044\n203 <-> 207, 301, 815, 1311\n204 <-> 204, 1711\n205 <-> 1298, 1562, 1602\n206 <-> 228\n207 <-> 203, 1480, 1713\n208 <-> 786, 1844\n209 <-> 1291, 1351, 1747\n210 <-> 1320\n211 <-> 587, 1340\n212 <-> 587, 676\n213 <-> 886\n214 <-> 1549\n215 <-> 68, 1115, 1371, 1701\n216 <-> 1127\n217 <-> 312\n218 <-> 466, 1072, 1709\n219 <-> 527\n220 <-> 793\n221 <-> 1314, 1800\n222 <-> 1941\n223 <-> 1911\n224 <-> 224, 528\n225 <-> 1030, 1084\n226 <-> 569, 1599\n227 <-> 658\n228 <-> 206, 579, 800, 1381\n229 <-> 103, 1975\n230 <-> 1068\n231 <-> 937\n232 <-> 428\n233 <-> 969, 1258\n234 <-> 1824\n235 <-> 1218\n236 <-> 30, 1410, 1470, 1651\n237 <-> 815\n238 <-> 477, 1518, 1869\n239 <-> 985, 1911\n240 <-> 809, 1047\n241 <-> 1379, 1577, 1692, 1757\n242 <-> 1127\n243 <-> 118\n244 <-> 440, 747, 771, 1051\n245 <-> 644, 725, 1332, 1862\n246 <-> 395, 1168\n247 <-> 1118\n248 <-> 1462\n249 <-> 737\n250 <-> 1254\n251 <-> 491, 1129\n252 <-> 623\n253 <-> 1046, 1872\n254 <-> 1473\n255 <-> 1220, 1672\n256 <-> 1290, 1838\n257 <-> 474, 1708, 1945\n258 <-> 728, 1297\n259 <-> 374, 464, 1637\n260 <-> 168, 1699\n261 <-> 677, 1164\n262 <-> 1507\n263 <-> 564\n264 <-> 69, 264, 912\n265 <-> 36, 37\n266 <-> 1362\n267 <-> 267\n268 <-> 275, 1873\n269 <-> 449, 766\n270 <-> 102\n271 <-> 1139, 1156\n272 <-> 369, 584\n273 <-> 311, 969\n274 <-> 48, 667\n275 <-> 268, 672, 1687\n276 <-> 1609\n277 <-> 490, 1252\n278 <-> 1236, 1984\n279 <-> 29\n280 <-> 932, 1860\n281 <-> 372, 638, 1311\n282 <-> 1199, 1308\n283 <-> 1938\n284 <-> 315, 1375, 1799\n285 <-> 1377, 1613\n286 <-> 1661\n287 <-> 185, 1248\n288 <-> 409, 1457\n289 <-> 1025\n290 <-> 606, 1486, 1925\n291 <-> 734, 1407\n292 <-> 330\n293 <-> 360, 1231\n294 <-> 146, 1887\n295 <-> 1237, 1733\n296 <-> 132, 296, 621\n297 <-> 1493, 1730\n298 <-> 1958\n299 <-> 696\n300 <-> 1300\n301 <-> 203\n302 <-> 1188, 1349\n303 <-> 750, 1701\n304 <-> 304, 503\n305 <-> 402, 630, 636, 1479\n306 <-> 1007, 1350, 1502\n307 <-> 1787\n308 <-> 1485\n309 <-> 479, 521\n310 <-> 1415\n311 <-> 273, 1942\n312 <-> 217, 387, 1357\n313 <-> 905, 1606\n314 <-> 1337, 1627\n315 <-> 284, 1509\n316 <-> 1809\n317 <-> 490, 1053, 1904\n318 <-> 145, 1789\n319 <-> 926, 1180\n320 <-> 121, 1454, 1764\n321 <-> 64, 725\n322 <-> 762, 1178\n323 <-> 918, 1064, 1957\n324 <-> 1901\n325 <-> 30\n326 <-> 483, 1827\n327 <-> 1360\n328 <-> 546, 1576\n329 <-> 526, 1667\n330 <-> 292, 823\n331 <-> 39, 137, 979\n332 <-> 174, 703, 914\n333 <-> 333, 1364\n334 <-> 46\n335 <-> 650\n336 <-> 121, 1814\n337 <-> 101\n338 <-> 740, 1239\n339 <-> 1595\n340 <-> 1076, 1544\n341 <-> 341, 623, 1540\n342 <-> 56\n343 <-> 367\n344 <-> 1547, 1878\n345 <-> 528\n346 <-> 346, 626, 1036\n347 <-> 79, 1052\n348 <-> 368, 1950\n349 <-> 631, 1765\n350 <-> 602\n351 <-> 1503, 1541, 1615, 1684\n352 <-> 1341\n353 <-> 824\n354 <-> 703, 1868\n355 <-> 97, 480, 566, 1804\n356 <-> 648, 814\n357 <-> 1656\n358 <-> 504\n359 <-> 763\n360 <-> 293, 1296\n361 <-> 361\n362 <-> 1892\n363 <-> 524\n364 <-> 149, 1268\n365 <-> 37, 1392, 1667\n366 <-> 82, 606\n367 <-> 126, 343, 677\n368 <-> 348, 500, 1101, 1300\n369 <-> 272, 527, 1785, 1833\n370 <-> 370\n371 <-> 1352, 1664\n372 <-> 281\n373 <-> 860, 1026, 1504\n374 <-> 259, 919, 1635\n375 <-> 990, 1489, 1835\n376 <-> 1389\n377 <-> 1063, 1750\n378 <-> 423\n379 <-> 1510\n380 <-> 1983\n381 <-> 517\n382 <-> 1792\n383 <-> 814\n384 <-> 1826\n385 <-> 1769\n386 <-> 1632, 1931\n387 <-> 312, 1206, 1961\n388 <-> 868, 1713\n389 <-> 721, 1781\n390 <-> 604\n391 <-> 493, 1691\n392 <-> 1331\n393 <-> 140\n394 <-> 81, 1836\n395 <-> 188, 246, 1171, 1388\n396 <-> 981, 1475, 1617\n397 <-> 397\n398 <-> 931\n399 <-> 1815\n400 <-> 1245\n401 <-> 1011\n402 <-> 305, 1911\n403 <-> 709\n404 <-> 606, 709, 1067, 1988\n405 <-> 1334, 1854\n406 <-> 169, 1552\n407 <-> 563\n408 <-> 813\n409 <-> 288, 409, 445\n410 <-> 13, 577\n411 <-> 1691\n412 <-> 78, 187, 1089\n413 <-> 124\n414 <-> 803, 1858\n415 <-> 415, 1289\n416 <-> 549, 1519\n417 <-> 70\n418 <-> 1866\n419 <-> 419, 680\n420 <-> 1727\n421 <-> 676, 1365\n422 <-> 115, 467\n423 <-> 378, 1470\n424 <-> 436, 929, 1311\n425 <-> 31, 99\n426 <-> 934\n427 <-> 596, 675, 936, 1580\n428 <-> 35, 232, 1027\n429 <-> 682, 1498\n430 <-> 430\n431 <-> 90\n432 <-> 432, 1607\n433 <-> 1312\n434 <-> 1023, 1118\n435 <-> 77, 435, 1280\n436 <-> 424, 894\n437 <-> 586, 1543\n438 <-> 1118\n439 <-> 439\n440 <-> 244\n441 <-> 441, 605\n442 <-> 1274\n443 <-> 443, 556\n444 <-> 159\n445 <-> 145, 409\n446 <-> 1258\n447 <-> 644, 940\n448 <-> 1271, 1480\n449 <-> 269, 1398\n450 <-> 871, 1094\n451 <-> 589, 1075\n452 <-> 755\n453 <-> 1518\n454 <-> 613, 796\n455 <-> 593\n456 <-> 182, 1321, 1938\n457 <-> 662, 1432\n458 <-> 916, 1812\n459 <-> 459\n460 <-> 1920, 1926\n461 <-> 1243, 1808, 1866\n462 <-> 617, 693\n463 <-> 60, 908\n464 <-> 259, 1178\n465 <-> 600\n466 <-> 73, 218\n467 <-> 422, 531, 750, 1476\n468 <-> 468\n469 <-> 901, 1204\n470 <-> 6\n471 <-> 755, 1257\n472 <-> 514\n473 <-> 873, 928\n474 <-> 257, 784\n475 <-> 1776\n476 <-> 18, 1314\n477 <-> 238\n478 <-> 1825\n479 <-> 309, 1605\n480 <-> 355\n481 <-> 1308\n482 <-> 807\n483 <-> 326, 619, 1098, 1776\n484 <-> 1837\n485 <-> 110, 525, 1601, 1893\n486 <-> 45, 1581\n487 <-> 1791\n488 <-> 758\n489 <-> 978\n490 <-> 277, 317, 792\n491 <-> 251, 1582\n492 <-> 945, 1028\n493 <-> 391, 1786\n494 <-> 1661\n495 <-> 534, 1255\n496 <-> 690, 1480\n497 <-> 631, 1195\n498 <-> 892, 903\n499 <-> 1522, 1941\n500 <-> 368, 1449, 1624\n501 <-> 706, 915, 1115\n502 <-> 67\n503 <-> 304\n504 <-> 358, 1431, 1609, 1685\n505 <-> 515\n506 <-> 1347\n507 <-> 624, 831\n508 <-> 907\n509 <-> 1127, 1970\n510 <-> 821, 1599\n511 <-> 763, 846\n512 <-> 1779\n513 <-> 537, 1033\n514 <-> 472, 1068, 1888\n515 <-> 505, 515\n516 <-> 1363, 1644\n517 <-> 381, 680\n518 <-> 853\n519 <-> 1703\n520 <-> 1851\n521 <-> 309\n522 <-> 1831\n523 <-> 1561\n524 <-> 363, 1282, 1852\n525 <-> 485, 1383\n526 <-> 329, 876, 1399\n527 <-> 219, 369, 1086\n528 <-> 224, 345, 1243\n529 <-> 719, 845, 980, 1778\n530 <-> 530, 535\n531 <-> 467\n532 <-> 603, 1522\n533 <-> 533\n534 <-> 495, 1020\n535 <-> 530, 639\n536 <-> 789\n537 <-> 513, 932, 1102\n538 <-> 653, 784, 807\n539 <-> 1186\n540 <-> 1224\n541 <-> 1068, 1320\n542 <-> 1332\n543 <-> 543, 1177\n544 <-> 1404, 1567\n545 <-> 842\n546 <-> 86, 328, 1785\n547 <-> 892, 1973\n548 <-> 1686\n549 <-> 416, 595, 1735\n550 <-> 1928\n551 <-> 850\n552 <-> 552\n553 <-> 27\n554 <-> 554\n555 <-> 138\n556 <-> 443, 1389\n557 <-> 748, 1656\n558 <-> 758\n559 <-> 596, 1812\n560 <-> 40\n561 <-> 6\n562 <-> 562, 627, 1715\n563 <-> 407, 776, 999\n564 <-> 263, 633, 962, 1130, 1653\n565 <-> 998\n566 <-> 355\n567 <-> 676, 1358\n568 <-> 871, 1313, 1853\n569 <-> 226\n570 <-> 60, 1423\n571 <-> 571, 880\n572 <-> 778, 896, 1251\n573 <-> 132, 685\n574 <-> 1212\n575 <-> 76, 1320, 1593\n576 <-> 1237, 1760\n577 <-> 410\n578 <-> 1150, 1511, 1668\n579 <-> 228, 1219, 1244\n580 <-> 701\n581 <-> 20\n582 <-> 122, 1525\n583 <-> 628, 1802\n584 <-> 154, 272\n585 <-> 698, 743, 1466, 1521\n586 <-> 437, 1394\n587 <-> 211, 212, 1856\n588 <-> 1989\n589 <-> 451\n590 <-> 644, 1192\n591 <-> 591\n592 <-> 984, 1880\n593 <-> 455, 789\n594 <-> 3, 1526, 1844, 1902\n595 <-> 549, 715, 1981\n596 <-> 427, 559, 1316\n597 <-> 1043, 1225\n598 <-> 932\n599 <-> 1064, 1065\n600 <-> 6, 465\n601 <-> 756, 946, 1050, 1570\n602 <-> 350, 1809\n603 <-> 532, 1010, 1060\n604 <-> 390, 729\n605 <-> 441\n606 <-> 290, 366, 404\n607 <-> 192\n608 <-> 1826\n609 <-> 953\n610 <-> 68\n611 <-> 32, 868\n612 <-> 1213\n613 <-> 454, 720\n614 <-> 1872\n615 <-> 615, 829, 1762\n616 <-> 990, 1784\n617 <-> 114, 462\n618 <-> 163, 1508\n619 <-> 483\n620 <-> 686, 1446\n621 <-> 296\n622 <-> 622\n623 <-> 195, 252, 341, 780, 1078\n624 <-> 507\n625 <-> 194, 1329\n626 <-> 346\n627 <-> 562\n628 <-> 5, 583, 1876\n629 <-> 1027, 1342, 1827\n630 <-> 305, 1829\n631 <-> 349, 497, 1248, 1728\n632 <-> 1552\n633 <-> 564\n634 <-> 875, 1513\n635 <-> 1150, 1410\n636 <-> 305\n637 <-> 637\n638 <-> 281, 1877\n639 <-> 535\n640 <-> 75, 649, 804\n641 <-> 967, 1739\n642 <-> 1114, 1739\n643 <-> 897, 981\n644 <-> 245, 447, 590, 960\n645 <-> 788, 1064, 1342\n646 <-> 1217\n647 <-> 675, 910, 1021\n648 <-> 70, 356, 1893\n649 <-> 640\n650 <-> 335, 1903\n651 <-> 651\n652 <-> 758, 1836\n653 <-> 538, 1515\n654 <-> 902, 1322\n655 <-> 126, 175\n656 <-> 945, 1247\n657 <-> 1957\n658 <-> 227, 1231\n659 <-> 737\n660 <-> 915\n661 <-> 692, 1299\n662 <-> 457, 962, 1081\n663 <-> 1410, 1852\n664 <-> 664, 1969\n665 <-> 872\n666 <-> 14\n667 <-> 274, 1871\n668 <-> 994\n669 <-> 1419, 1657\n670 <-> 1275\n671 <-> 671, 826\n672 <-> 275, 928, 1330, 1619\n673 <-> 74, 737, 1208\n674 <-> 1863\n675 <-> 150, 427, 647\n676 <-> 212, 421, 567\n677 <-> 261, 367, 677, 1023, 1306, 1405, 1725\n678 <-> 87\n679 <-> 1905\n680 <-> 43, 419, 517, 1232, 1382, 1395, 1875\n681 <-> 1845\n682 <-> 429, 1368, 1625, 1990\n683 <-> 152, 924, 1234\n684 <-> 1247, 1628\n685 <-> 183, 573\n686 <-> 620, 1184, 1867\n687 <-> 1080, 1636\n688 <-> 140, 1205, 1363\n689 <-> 1418, 1494\n690 <-> 496\n691 <-> 1013, 1178\n692 <-> 58, 661, 1324, 1366\n693 <-> 462, 693, 852\n694 <-> 694\n695 <-> 717\n696 <-> 53, 299, 1979\n697 <-> 164\n698 <-> 585\n699 <-> 1532\n700 <-> 855\n701 <-> 580, 744\n702 <-> 1198, 1240\n703 <-> 332, 354\n704 <-> 1361\n705 <-> 1101\n706 <-> 501\n707 <-> 707\n708 <-> 76, 795, 1235, 1302\n709 <-> 403, 404\n710 <-> 806, 1358\n711 <-> 711\n712 <-> 924, 1569, 1990\n713 <-> 1870\n714 <-> 147, 1507\n715 <-> 595\n716 <-> 143, 1039\n717 <-> 695, 1979\n718 <-> 1476\n719 <-> 529, 1061\n720 <-> 613\n721 <-> 50, 389, 1765\n722 <-> 1058\n723 <-> 723, 773, 1214\n724 <-> 724\n725 <-> 245, 321\n726 <-> 938, 1010, 1366, 1670\n727 <-> 1706\n728 <-> 258, 1264\n729 <-> 604, 729, 1396\n730 <-> 1184\n731 <-> 1524\n732 <-> 119, 1962\n733 <-> 1665, 1761\n734 <-> 291\n735 <-> 1022\n736 <-> 142, 169, 1855\n737 <-> 83, 249, 659, 673\n738 <-> 933\n739 <-> 1461, 1637\n740 <-> 338, 1065\n741 <-> 857, 943, 1100\n742 <-> 742, 1400\n743 <-> 2, 585, 743\n744 <-> 72, 701, 1417, 1588\n745 <-> 745\n746 <-> 21, 1433, 1714\n747 <-> 244\n748 <-> 557\n749 <-> 1225\n750 <-> 303, 467\n751 <-> 33\n752 <-> 851\n753 <-> 1398\n754 <-> 1293\n755 <-> 452, 471, 1868\n756 <-> 601\n757 <-> 1350, 1414\n758 <-> 488, 558, 652\n759 <-> 25, 1615\n760 <-> 184, 1274\n761 <-> 761\n762 <-> 322, 819\n763 <-> 14, 359, 511, 1542\n764 <-> 191\n765 <-> 1168\n766 <-> 269, 1167\n767 <-> 1109\n768 <-> 1784\n769 <-> 30, 769\n770 <-> 1328\n771 <-> 99, 244, 1310\n772 <-> 1378\n773 <-> 723, 882\n774 <-> 12\n775 <-> 185\n776 <-> 563\n777 <-> 817, 1559\n778 <-> 572, 1198\n779 <-> 1134\n780 <-> 623, 1645\n781 <-> 781\n782 <-> 990, 1387, 1755\n783 <-> 1015, 1391\n784 <-> 474, 538, 1531, 1804\n785 <-> 1802\n786 <-> 208, 1357\n787 <-> 787, 1233\n788 <-> 645\n789 <-> 536, 593, 1691\n790 <-> 870, 1901\n791 <-> 1888\n792 <-> 490, 1469, 1999\n793 <-> 15, 220, 1284, 1684, 1814\n794 <-> 1648\n795 <-> 708\n796 <-> 454, 1286\n797 <-> 797, 1014, 1028\n798 <-> 1079, 1531\n799 <-> 1159, 1351, 1526\n800 <-> 228, 1176, 1819\n801 <-> 1018\n802 <-> 1735\n803 <-> 68, 414, 1374, 1623\n804 <-> 640, 867, 1955\n805 <-> 805, 1843\n806 <-> 710\n807 <-> 80, 482, 538\n808 <-> 28\n809 <-> 240, 1246, 1582\n810 <-> 810, 1005\n811 <-> 811\n812 <-> 812, 1359\n813 <-> 408, 813\n814 <-> 356, 383\n815 <-> 203, 237, 848, 1720\n816 <-> 816\n817 <-> 777\n818 <-> 1169, 1828\n819 <-> 762\n820 <-> 820, 1557\n821 <-> 25, 510, 1288\n822 <-> 1073, 1883\n823 <-> 330, 925, 1323, 1883\n824 <-> 61, 353, 1820\n825 <-> 91, 1652\n826 <-> 671\n827 <-> 1183\n828 <-> 843\n829 <-> 615, 1661\n830 <-> 22\n831 <-> 507, 1054, 1439\n832 <-> 855\n833 <-> 171, 994, 1020\n834 <-> 1706\n835 <-> 42, 1951\n836 <-> 836\n837 <-> 1590\n838 <-> 1001\n839 <-> 175, 1329\n840 <-> 1274\n841 <-> 1933\n842 <-> 179, 545, 1771\n843 <-> 168, 828, 1032\n844 <-> 847, 1790\n845 <-> 529\n846 <-> 511\n847 <-> 844, 1077, 1172\n848 <-> 815, 1338, 1397, 1452\n849 <-> 1485, 1642\n850 <-> 551, 1630\n851 <-> 752, 1691, 1850\n852 <-> 693\n853 <-> 518, 1208, 1638, 1678\n854 <-> 149\n855 <-> 700, 832, 1450\n856 <-> 856\n857 <-> 741\n858 <-> 1891\n859 <-> 160, 1295, 1483\n860 <-> 373, 1214\n861 <-> 1134, 1564, 1961\n862 <-> 862, 1794\n863 <-> 942, 1671\n864 <-> 864\n865 <-> 1463, 1685\n866 <-> 1411\n867 <-> 804, 1492\n868 <-> 388, 611\n869 <-> 1417\n870 <-> 790, 872, 1910\n871 <-> 450, 568\n872 <-> 665, 870\n873 <-> 473\n874 <-> 0, 1000, 1147, 1534\n875 <-> 634, 1373, 1563\n876 <-> 526, 1517\n877 <-> 1911\n878 <-> 878\n879 <-> 8, 1887\n880 <-> 571, 927\n881 <-> 1945\n882 <-> 773\n883 <-> 909, 1141\n884 <-> 1865\n885 <-> 123, 1506\n886 <-> 213, 1511\n887 <-> 1413\n888 <-> 1640\n889 <-> 1629\n890 <-> 890, 964, 1894\n891 <-> 1242\n892 <-> 498, 547, 1082\n893 <-> 1035, 1555\n894 <-> 436, 1108\n895 <-> 1506, 1991\n896 <-> 572, 1339\n897 <-> 643, 1758\n898 <-> 967, 1481\n899 <-> 1094, 1791, 1976\n900 <-> 900, 1003\n901 <-> 469, 1420, 1751\n902 <-> 654, 1503\n903 <-> 498, 903, 1230\n904 <-> 1226\n905 <-> 313, 1208, 1749\n906 <-> 1276, 1541\n907 <-> 508, 1479\n908 <-> 463\n909 <-> 883, 909\n910 <-> 647\n911 <-> 41, 57, 1578\n912 <-> 264\n913 <-> 913, 1236\n914 <-> 332, 1800\n915 <-> 501, 660, 1386, 1429\n916 <-> 94, 104, 458, 1075, 1899\n917 <-> 186\n918 <-> 323\n919 <-> 374\n920 <-> 920\n921 <-> 1460\n922 <-> 164, 922\n923 <-> 1041\n924 <-> 48, 169, 683, 712, 1107, 1700\n925 <-> 823\n926 <-> 319, 1381\n927 <-> 880\n928 <-> 82, 473, 672, 1201\n929 <-> 424\n930 <-> 930, 1569\n931 <-> 398, 992\n932 <-> 280, 537, 598, 1292\n933 <-> 738, 1368\n934 <-> 426, 1161\n935 <-> 1086\n936 <-> 55, 427\n937 <-> 92, 231\n938 <-> 726, 1304\n939 <-> 958\n940 <-> 447, 1222\n941 <-> 87\n942 <-> 863\n943 <-> 741, 1421, 1832\n944 <-> 46, 111\n945 <-> 492, 656, 1353\n946 <-> 601\n947 <-> 1631\n948 <-> 948\n949 <-> 1434\n950 <-> 1594\n951 <-> 67, 1016, 1478\n952 <-> 1641\n953 <-> 609, 1176, 1513, 1714, 1958\n954 <-> 954\n955 <-> 955\n956 <-> 982, 1217\n957 <-> 91, 1106\n958 <-> 939, 1199, 1303, 1944\n959 <-> 1875\n960 <-> 644\n961 <-> 1619\n962 <-> 564, 662, 1884\n963 <-> 1015, 1851\n964 <-> 890\n965 <-> 1002\n966 <-> 1793\n967 <-> 641, 898\n968 <-> 968\n969 <-> 233, 273, 1212, 1978\n970 <-> 1499, 1513\n971 <-> 1106\n972 <-> 1738\n973 <-> 973\n974 <-> 1646, 1967\n975 <-> 1066\n976 <-> 1287, 1640\n977 <-> 1954\n978 <-> 489, 1697\n979 <-> 331\n980 <-> 529\n981 <-> 396, 643, 1376, 1925\n982 <-> 956\n983 <-> 1325, 1831\n984 <-> 161, 592, 1579\n985 <-> 239\n986 <-> 1104, 1830\n987 <-> 1419\n988 <-> 90, 1718, 1737\n989 <-> 1278, 1635\n990 <-> 375, 616, 782, 1973\n991 <-> 1852\n992 <-> 931, 1722, 1724\n993 <-> 1099\n994 <-> 668, 833\n995 <-> 1140, 1803\n996 <-> 996, 1673\n997 <-> 997\n998 <-> 565, 998\n999 <-> 563, 999\n1000 <-> 874, 1160\n1001 <-> 193, 838, 1011, 1710\n1002 <-> 965, 1571\n1003 <-> 900\n1004 <-> 1004\n1005 <-> 810, 1775\n1006 <-> 1006\n1007 <-> 306, 1447\n1008 <-> 61\n1009 <-> 1022, 1320\n1010 <-> 191, 603, 726, 1344\n1011 <-> 401, 1001\n1012 <-> 1112, 1194\n1013 <-> 691, 1031\n1014 <-> 797\n1015 <-> 783, 963\n1016 <-> 951, 1989\n1017 <-> 1213, 1818, 1824\n1018 <-> 801, 1062\n1019 <-> 1327\n1020 <-> 534, 833\n1021 <-> 22, 647, 1210\n1022 <-> 735, 1009, 1413\n1023 <-> 434, 677\n1024 <-> 1071\n1025 <-> 289, 1416, 1704\n1026 <-> 373\n1027 <-> 428, 629\n1028 <-> 492, 797, 1113\n1029 <-> 1038, 1268\n1030 <-> 225, 1430\n1031 <-> 1013\n1032 <-> 843\n1033 <-> 513\n1034 <-> 1179\n1035 <-> 139, 893, 1151\n1036 <-> 346, 1598\n1037 <-> 141, 1649\n1038 <-> 60, 1029\n1039 <-> 716, 1039\n1040 <-> 1040, 1042\n1041 <-> 202, 923, 1041\n1042 <-> 1040, 1918\n1043 <-> 597\n1044 <-> 202\n1045 <-> 1045\n1046 <-> 253, 1394, 1770\n1047 <-> 32, 240, 1748\n1048 <-> 135, 1348\n1049 <-> 1071\n1050 <-> 99, 601, 1953\n1051 <-> 244, 1345\n1052 <-> 347, 1686\n1053 <-> 317\n1054 <-> 831, 1872\n1055 <-> 1062, 1123, 1574, 1680\n1056 <-> 112\n1057 <-> 168\n1058 <-> 7, 722\n1059 <-> 1059\n1060 <-> 603, 1277, 1669\n1061 <-> 719\n1062 <-> 1018, 1055\n1063 <-> 377\n1064 <-> 323, 599, 645, 1229, 1796\n1065 <-> 599, 740, 1394\n1066 <-> 975, 1867\n1067 <-> 404, 1252, 1922\n1068 <-> 230, 514, 541\n1069 <-> 198, 1102\n1070 <-> 1147\n1071 <-> 1024, 1049, 1088, 1188\n1072 <-> 218, 1434, 1447\n1073 <-> 822, 1546\n1074 <-> 7\n1075 <-> 451, 916, 1610\n1076 <-> 340\n1077 <-> 847\n1078 <-> 623, 1960\n1079 <-> 798\n1080 <-> 687\n1081 <-> 662, 1238\n1082 <-> 65, 108, 892\n1083 <-> 1396\n1084 <-> 225\n1085 <-> 128, 1513, 1528\n1086 <-> 47, 527, 935\n1087 <-> 1616, 1823, 1826\n1088 <-> 1071\n1089 <-> 412\n1090 <-> 150, 1652, 1865\n1091 <-> 1091\n1092 <-> 1742\n1093 <-> 1408\n1094 <-> 450, 899, 1719, 1783\n1095 <-> 18\n1096 <-> 1145\n1097 <-> 1571, 1971\n1098 <-> 162, 483, 1268\n1099 <-> 1, 993, 1099, 1584\n1100 <-> 741, 1100\n1101 <-> 368, 705\n1102 <-> 537, 1069\n1103 <-> 119, 1586, 1939\n1104 <-> 171, 986\n1105 <-> 1211, 1443, 1913\n1106 <-> 957, 971, 1568\n1107 <-> 924, 1336, 1487, 1831\n1108 <-> 894\n1109 <-> 767, 1159, 1525\n1110 <-> 1612, 1976\n1111 <-> 1980\n1112 <-> 1012, 1588\n1113 <-> 1028\n1114 <-> 642, 1197\n1115 <-> 23, 215, 501\n1116 <-> 1992\n1117 <-> 1117\n1118 <-> 247, 434, 438\n1119 <-> 187, 1215, 1843\n1120 <-> 1267, 1270\n1121 <-> 1591, 1820\n1122 <-> 1531, 1747\n1123 <-> 1055\n1124 <-> 1654\n1125 <-> 1497\n1126 <-> 123, 1425, 1729\n1127 <-> 216, 242, 509\n1128 <-> 1580\n1129 <-> 251, 1302\n1130 <-> 564\n1131 <-> 1335, 1595\n1132 <-> 30\n1133 <-> 5, 1655\n1134 <-> 779, 861\n1135 <-> 1135\n1136 <-> 7\n1137 <-> 27\n1138 <-> 199\n1139 <-> 271, 1474\n1140 <-> 995, 1430, 1474\n1141 <-> 883\n1142 <-> 70, 1886\n1143 <-> 52, 1143\n1144 <-> 1554\n1145 <-> 1096, 1145\n1146 <-> 1776, 1917\n1147 <-> 874, 1070, 1240\n1148 <-> 1444, 1451, 1961\n1149 <-> 171\n1150 <-> 578, 635, 1583\n1151 <-> 1035, 1348\n1152 <-> 1661\n1153 <-> 1552\n1154 <-> 1154, 1947\n1155 <-> 1155, 1618\n1156 <-> 271, 1677\n1157 <-> 1491, 1592, 1884\n1158 <-> 72, 1220\n1159 <-> 799, 1109\n1160 <-> 1000\n1161 <-> 934, 1951\n1162 <-> 178, 1242, 1905\n1163 <-> 1474\n1164 <-> 261\n1165 <-> 106, 1165, 1676\n1166 <-> 1166\n1167 <-> 766, 1450, 1912, 1927\n1168 <-> 246, 765\n1169 <-> 46, 818\n1170 <-> 1689\n1171 <-> 395\n1172 <-> 847, 1250, 1689\n1173 <-> 1173\n1174 <-> 1893\n1175 <-> 1294\n1176 <-> 800, 953\n1177 <-> 543, 1315\n1178 <-> 322, 464, 691\n1179 <-> 1034, 1238\n1180 <-> 319\n1181 <-> 1996\n1182 <-> 178, 1881\n1183 <-> 827, 1552\n1184 <-> 686, 730\n1185 <-> 110, 1281\n1186 <-> 539, 1217, 1809\n1187 <-> 1242, 1257\n1188 <-> 302, 1071, 1949, 1980\n1189 <-> 1319\n1190 <-> 1947\n1191 <-> 1191\n1192 <-> 590\n1193 <-> 1204, 1260\n1194 <-> 1012\n1195 <-> 497\n1196 <-> 1196, 1516\n1197 <-> 1114\n1198 <-> 702, 778\n1199 <-> 282, 958\n1200 <-> 1664\n1201 <-> 928\n1202 <-> 1202, 1355\n1203 <-> 1203, 1966\n1204 <-> 469, 1193\n1205 <-> 52, 688\n1206 <-> 387\n1207 <-> 1993\n1208 <-> 673, 853, 905\n1209 <-> 136, 1462\n1210 <-> 1021\n1211 <-> 1105, 1211\n1212 <-> 56, 574, 969, 1705\n1213 <-> 612, 1017, 1663\n1214 <-> 723, 860\n1215 <-> 1119, 1615\n1216 <-> 1524, 1798\n1217 <-> 646, 956, 1186\n1218 <-> 235, 1580\n1219 <-> 113, 579, 1841\n1220 <-> 255, 1158, 1681\n1221 <-> 1331, 1360\n1222 <-> 940\n1223 <-> 29, 1237\n1224 <-> 540, 1523\n1225 <-> 597, 749, 1225\n1226 <-> 904, 1226\n1227 <-> 1934\n1228 <-> 1228\n1229 <-> 87, 1064\n1230 <-> 903\n1231 <-> 293, 658, 1402\n1232 <-> 680, 1417\n1233 <-> 787\n1234 <-> 683\n1235 <-> 708\n1236 <-> 278, 913\n1237 <-> 295, 576, 1223\n1238 <-> 1081, 1179, 1326, 1806\n1239 <-> 338\n1240 <-> 702, 1147\n1241 <-> 1921\n1242 <-> 891, 1162, 1187, 1965\n1243 <-> 134, 461, 528\n1244 <-> 579\n1245 <-> 400, 1245, 1864\n1246 <-> 809, 1772\n1247 <-> 656, 684\n1248 <-> 287, 631\n1249 <-> 91, 111, 1782\n1250 <-> 1172\n1251 <-> 572, 1508\n1252 <-> 277, 1067, 1505\n1253 <-> 21, 1639\n1254 <-> 26, 149, 250\n1255 <-> 190, 495\n1256 <-> 1256, 1286\n1257 <-> 101, 471, 1187\n1258 <-> 3, 233, 446, 1309\n1259 <-> 1398\n1260 <-> 1193, 1517\n1261 <-> 1300, 1807\n1262 <-> 1508\n1263 <-> 1973\n1264 <-> 176, 728, 1307\n1265 <-> 1265\n1266 <-> 1507, 1720\n1267 <-> 1120\n1268 <-> 364, 1029, 1098\n1269 <-> 1875\n1270 <-> 1120, 1915\n1271 <-> 448\n1272 <-> 6\n1273 <-> 1273\n1274 <-> 442, 760, 840\n1275 <-> 197, 670, 1450\n1276 <-> 906\n1277 <-> 1060\n1278 <-> 989, 1878, 1986\n1279 <-> 1279, 1848\n1280 <-> 435, 1915\n1281 <-> 1185\n1282 <-> 524\n1283 <-> 1678\n1284 <-> 793, 1706\n1285 <-> 1642\n1286 <-> 796, 1256, 1630\n1287 <-> 976, 1287\n1288 <-> 821\n1289 <-> 415\n1290 <-> 127, 256\n1291 <-> 209\n1292 <-> 932\n1293 <-> 754, 1293\n1294 <-> 180, 1175, 1882\n1295 <-> 859\n1296 <-> 360, 1910\n1297 <-> 258, 1426\n1298 <-> 205\n1299 <-> 661, 1954\n1300 <-> 300, 368, 1261\n1301 <-> 1834, 1847\n1302 <-> 708, 1129\n1303 <-> 958\n1304 <-> 938\n1305 <-> 1305\n1306 <-> 677\n1307 <-> 1264\n1308 <-> 282, 481\n1309 <-> 1258\n1310 <-> 771, 1392\n1311 <-> 203, 281, 424\n1312 <-> 433, 1312, 1671\n1313 <-> 568, 1409, 1861\n1314 <-> 221, 476, 1549\n1315 <-> 1177\n1316 <-> 596\n1317 <-> 1832\n1318 <-> 1468\n1319 <-> 144, 1189, 1319, 1542, 1923\n1320 <-> 210, 541, 575, 1009\n1321 <-> 456\n1322 <-> 654\n1323 <-> 823, 1385\n1324 <-> 692\n1325 <-> 85, 88, 983\n1326 <-> 1238\n1327 <-> 1019, 1387\n1328 <-> 153, 770\n1329 <-> 625, 839\n1330 <-> 672\n1331 <-> 392, 1221\n1332 <-> 245, 542\n1333 <-> 1333\n1334 <-> 405, 1987\n1335 <-> 1131, 1744\n1336 <-> 1107\n1337 <-> 314, 1379\n1338 <-> 848\n1339 <-> 896, 1523\n1340 <-> 211, 1460\n1341 <-> 352, 1459, 1849, 1878\n1342 <-> 629, 645, 1752\n1343 <-> 129\n1344 <-> 1010\n1345 <-> 139, 1051\n1346 <-> 1845\n1347 <-> 76, 506\n1348 <-> 1048, 1151\n1349 <-> 302\n1350 <-> 138, 306, 757\n1351 <-> 156, 209, 799, 1916\n1352 <-> 371, 1352\n1353 <-> 945, 1811\n1354 <-> 1871\n1355 <-> 1202, 1533\n1356 <-> 1548, 1566, 1840\n1357 <-> 312, 786\n1358 <-> 567, 710\n1359 <-> 812\n1360 <-> 327, 1221, 1659\n1361 <-> 704, 1901\n1362 <-> 143, 266, 1551\n1363 <-> 516, 688\n1364 <-> 333\n1365 <-> 421\n1366 <-> 692, 726, 1972\n1367 <-> 1367, 1946\n1368 <-> 682, 933, 1465, 1478\n1369 <-> 1369\n1370 <-> 189\n1371 <-> 215, 1572, 1870\n1372 <-> 1372\n1373 <-> 875\n1374 <-> 803\n1375 <-> 284\n1376 <-> 981, 1545\n1377 <-> 31, 285\n1378 <-> 772, 1378\n1379 <-> 241, 1337, 1587\n1380 <-> 20, 1856\n1381 <-> 228, 926\n1382 <-> 680\n1383 <-> 525\n1384 <-> 1792\n1385 <-> 1323, 1521\n1386 <-> 915\n1387 <-> 782, 1327\n1388 <-> 395, 1416, 1525\n1389 <-> 376, 556\n1390 <-> 1390, 1406\n1391 <-> 783, 1550, 1595\n1392 <-> 365, 1310, 1793\n1393 <-> 1505, 1667\n1394 <-> 12, 586, 1046, 1065\n1395 <-> 680\n1396 <-> 729, 1083\n1397 <-> 848, 1944\n1398 <-> 449, 753, 1259\n1399 <-> 526\n1400 <-> 742\n1401 <-> 1401\n1402 <-> 1231\n1403 <-> 1967\n1404 <-> 544\n1405 <-> 677\n1406 <-> 1390\n1407 <-> 291, 1407\n1408 <-> 1093, 1947\n1409 <-> 1313\n1410 <-> 236, 635, 663\n1411 <-> 151, 866\n1412 <-> 1663\n1413 <-> 887, 1022\n1414 <-> 757, 1666\n1415 <-> 130, 310\n1416 <-> 1025, 1388\n1417 <-> 744, 869, 1232, 1641\n1418 <-> 689\n1419 <-> 669, 987, 1419, 1431\n1420 <-> 901\n1421 <-> 943\n1422 <-> 1422\n1423 <-> 173, 570\n1424 <-> 1424\n1425 <-> 1126\n1426 <-> 66, 1297\n1427 <-> 1466\n1428 <-> 1523, 1626\n1429 <-> 172, 915\n1430 <-> 1030, 1140\n1431 <-> 504, 1419\n1432 <-> 457\n1433 <-> 168, 746\n1434 <-> 949, 1072, 1474\n1435 <-> 1688\n1436 <-> 24, 1624\n1437 <-> 1903\n1438 <-> 1438, 1447\n1439 <-> 831\n1440 <-> 1788\n1441 <-> 1441\n1442 <-> 180\n1443 <-> 1105\n1444 <-> 1148\n1445 <-> 94, 1693\n1446 <-> 15, 620\n1447 <-> 1007, 1072, 1438\n1448 <-> 1617\n1449 <-> 500\n1450 <-> 855, 1167, 1275\n1451 <-> 1148, 1556\n1452 <-> 165, 848\n1453 <-> 90, 1726\n1454 <-> 320, 1869\n1455 <-> 37\n1456 <-> 58\n1457 <-> 288\n1458 <-> 1637\n1459 <-> 1341\n1460 <-> 921, 1340\n1461 <-> 739, 1621\n1462 <-> 248, 1209\n1463 <-> 865\n1464 <-> 1747\n1465 <-> 1368\n1466 <-> 585, 1427, 1655\n1467 <-> 1467\n1468 <-> 1318, 1468\n1469 <-> 792\n1470 <-> 236, 423\n1471 <-> 145\n1472 <-> 1485, 1857\n1473 <-> 4, 254\n1474 <-> 1139, 1140, 1163, 1434\n1475 <-> 396, 1923\n1476 <-> 467, 718\n1477 <-> 16, 1478\n1478 <-> 951, 1368, 1477\n1479 <-> 305, 907, 1675\n1480 <-> 207, 448, 496\n1481 <-> 898, 1890\n1482 <-> 1595\n1483 <-> 859, 1502\n1484 <-> 1545\n1485 <-> 308, 849, 1472\n1486 <-> 290\n1487 <-> 1107\n1488 <-> 76\n1489 <-> 375\n1490 <-> 1490\n1491 <-> 1157, 1510\n1492 <-> 867, 1492\n1493 <-> 297, 1724\n1494 <-> 689, 1494\n1495 <-> 12\n1496 <-> 1636\n1497 <-> 66, 1125\n1498 <-> 429\n1499 <-> 970\n1500 <-> 1664\n1501 <-> 1954\n1502 <-> 306, 1483\n1503 <-> 351, 902\n1504 <-> 373, 1980\n1505 <-> 1252, 1393\n1506 <-> 885, 895\n1507 <-> 118, 262, 714, 1266\n1508 <-> 618, 1251, 1262, 1611\n1509 <-> 315\n1510 <-> 379, 1491\n1511 <-> 578, 886\n1512 <-> 40\n1513 <-> 634, 953, 970, 1085\n1514 <-> 67\n1515 <-> 653\n1516 <-> 92, 1196, 1647\n1517 <-> 876, 1260\n1518 <-> 238, 453\n1519 <-> 416, 1936\n1520 <-> 1609\n1521 <-> 585, 1385\n1522 <-> 44, 499, 532\n1523 <-> 1224, 1339, 1428, 1589\n1524 <-> 731, 1216, 1524\n1525 <-> 582, 1109, 1388\n1526 <-> 594, 799\n1527 <-> 1900, 1906\n1528 <-> 1085\n1529 <-> 1529, 1622\n1530 <-> 134, 1994\n1531 <-> 784, 798, 1122\n1532 <-> 699, 1532\n1533 <-> 1355, 1997\n1534 <-> 874, 1992\n1535 <-> 1777\n1536 <-> 1798\n1537 <-> 84\n1538 <-> 1740\n1539 <-> 1539\n1540 <-> 341\n1541 <-> 186, 351, 906\n1542 <-> 763, 1319\n1543 <-> 437, 1675\n1544 <-> 340, 1544\n1545 <-> 1376, 1484\n1546 <-> 1073, 1987\n1547 <-> 344, 1769\n1548 <-> 1356, 1990\n1549 <-> 214, 1314\n1550 <-> 1391\n1551 <-> 1362, 1929\n1552 <-> 406, 632, 1153, 1183\n1553 <-> 1916\n1554 <-> 1144, 1721, 1984\n1555 <-> 893\n1556 <-> 1451, 1963\n1557 <-> 820\n1558 <-> 1558, 1623\n1559 <-> 777, 1674\n1560 <-> 1560\n1561 <-> 523, 1564\n1562 <-> 205, 1773, 1948, 1985\n1563 <-> 34, 875\n1564 <-> 861, 1561\n1565 <-> 1941\n1566 <-> 1356, 1779\n1567 <-> 544, 1567\n1568 <-> 1106\n1569 <-> 712, 930\n1570 <-> 601\n1571 <-> 1002, 1097\n1572 <-> 1371\n1573 <-> 1573\n1574 <-> 1055, 1942\n1575 <-> 132\n1576 <-> 328\n1577 <-> 241\n1578 <-> 911\n1579 <-> 984\n1580 <-> 427, 1128, 1218\n1581 <-> 486\n1582 <-> 491, 809, 1751, 1842\n1583 <-> 1150\n1584 <-> 1099, 1839\n1585 <-> 1817\n1586 <-> 1103\n1587 <-> 1379\n1588 <-> 744, 1112\n1589 <-> 1523\n1590 <-> 837, 1590\n1591 <-> 29, 1121, 1603\n1592 <-> 1157, 1592\n1593 <-> 575\n1594 <-> 950, 1767\n1595 <-> 339, 1131, 1391, 1482\n1596 <-> 1596\n1597 <-> 1745\n1598 <-> 1036\n1599 <-> 226, 510\n1600 <-> 38\n1601 <-> 485, 1695, 1801\n1602 <-> 205\n1603 <-> 1591\n1604 <-> 1604\n1605 <-> 5, 201, 479\n1606 <-> 313\n1607 <-> 432\n1608 <-> 145, 1906\n1609 <-> 276, 504, 1520\n1610 <-> 1075\n1611 <-> 1508, 1641\n1612 <-> 1110\n1613 <-> 285\n1614 <-> 152\n1615 <-> 351, 759, 1215\n1616 <-> 1087\n1617 <-> 396, 1448\n1618 <-> 1155, 1971\n1619 <-> 672, 961\n1620 <-> 179, 1739\n1621 <-> 1461\n1622 <-> 1529, 1893\n1623 <-> 803, 1558\n1624 <-> 500, 1436\n1625 <-> 682\n1626 <-> 131, 1428\n1627 <-> 314\n1628 <-> 95, 684\n1629 <-> 889, 1629\n1630 <-> 850, 1286\n1631 <-> 947, 1631, 1952\n1632 <-> 386, 1646\n1633 <-> 181\n1634 <-> 6, 1634\n1635 <-> 374, 989\n1636 <-> 687, 1496, 1839\n1637 <-> 54, 259, 739, 1458\n1638 <-> 157, 853\n1639 <-> 1253\n1640 <-> 888, 976, 1679\n1641 <-> 952, 1417, 1611, 1810\n1642 <-> 849, 1285, 1995\n1643 <-> 1774, 1993, 1996\n1644 <-> 516\n1645 <-> 780\n1646 <-> 107, 974, 1632\n1647 <-> 1516\n1648 <-> 77, 153, 794\n1649 <-> 1037\n1650 <-> 1843\n1651 <-> 236\n1652 <-> 825, 1090\n1653 <-> 564\n1654 <-> 1124, 1977\n1655 <-> 1133, 1466\n1656 <-> 154, 357, 557\n1657 <-> 669\n1658 <-> 1670\n1659 <-> 1360, 1840\n1660 <-> 69\n1661 <-> 286, 494, 829, 1152\n1662 <-> 1662, 1663\n1663 <-> 1213, 1412, 1662\n1664 <-> 49, 371, 1200, 1500, 1937\n1665 <-> 733\n1666 <-> 1414\n1667 <-> 329, 365, 1393\n1668 <-> 578, 1934\n1669 <-> 1060, 1935\n1670 <-> 726, 1658\n1671 <-> 863, 1312, 1919\n1672 <-> 255\n1673 <-> 996\n1674 <-> 190, 1559, 1815\n1675 <-> 1479, 1543\n1676 <-> 1165\n1677 <-> 1156\n1678 <-> 853, 1283, 1889\n1679 <-> 1640\n1680 <-> 1055\n1681 <-> 34, 1220\n1682 <-> 1690, 1757\n1683 <-> 1879\n1684 <-> 351, 793\n1685 <-> 504, 865\n1686 <-> 548, 1052, 1686\n1687 <-> 275\n1688 <-> 151, 164, 1435\n1689 <-> 63, 1170, 1172\n1690 <-> 38, 1682\n1691 <-> 391, 411, 789, 851\n1692 <-> 241\n1693 <-> 1445\n1694 <-> 1717\n1695 <-> 1601\n1696 <-> 14\n1697 <-> 978, 1992\n1698 <-> 1997\n1699 <-> 260\n1700 <-> 924\n1701 <-> 215, 303\n1702 <-> 1742\n1703 <-> 519, 1905\n1704 <-> 1025\n1705 <-> 105, 1212\n1706 <-> 727, 834, 1284\n1707 <-> 1707\n1708 <-> 257\n1709 <-> 218\n1710 <-> 1001\n1711 <-> 60, 204\n1712 <-> 1712\n1713 <-> 133, 207, 388\n1714 <-> 746, 953\n1715 <-> 562\n1716 <-> 1716\n1717 <-> 192, 1694\n1718 <-> 988\n1719 <-> 1094\n1720 <-> 815, 1266\n1721 <-> 1554\n1722 <-> 992\n1723 <-> 1723\n1724 <-> 992, 1493, 1745\n1725 <-> 677, 1731\n1726 <-> 29, 1453\n1727 <-> 420, 1858\n1728 <-> 631\n1729 <-> 1126\n1730 <-> 297, 1825\n1731 <-> 1725\n1732 <-> 1732, 1799\n1733 <-> 295\n1734 <-> 131\n1735 <-> 549, 802\n1736 <-> 10, 1757\n1737 <-> 988, 1768\n1738 <-> 972, 1844\n1739 <-> 641, 642, 1620, 1739\n1740 <-> 1538, 1961\n1741 <-> 1935\n1742 <-> 1092, 1702, 1903\n1743 <-> 1845, 1945\n1744 <-> 1335, 1744\n1745 <-> 1597, 1724, 1745\n1746 <-> 1975\n1747 <-> 209, 1122, 1464\n1748 <-> 1047\n1749 <-> 905\n1750 <-> 377, 1996\n1751 <-> 901, 1582\n1752 <-> 1342\n1753 <-> 1974, 1998\n1754 <-> 15, 102\n1755 <-> 782, 1821\n1756 <-> 1756\n1757 <-> 241, 1682, 1736, 1959\n1758 <-> 897\n1759 <-> 1871\n1760 <-> 576\n1761 <-> 733, 1761\n1762 <-> 615, 1882\n1763 <-> 1825\n1764 <-> 320\n1765 <-> 349, 721\n1766 <-> 1781\n1767 <-> 1594, 1767\n1768 <-> 1737\n1769 <-> 161, 385, 1547\n1770 <-> 1046\n1771 <-> 842, 1930\n1772 <-> 1246\n1773 <-> 1562\n1774 <-> 1643\n1775 <-> 1005\n1776 <-> 475, 483, 1146, 1822, 1928\n1777 <-> 1535, 1777\n1778 <-> 529, 1857\n1779 <-> 512, 1566\n1780 <-> 1780\n1781 <-> 55, 389, 1766\n1782 <-> 1249\n1783 <-> 181, 1094, 1933\n1784 <-> 616, 768\n1785 <-> 369, 546\n1786 <-> 493\n1787 <-> 307, 1787\n1788 <-> 1440, 1972\n1789 <-> 318\n1790 <-> 844, 1790\n1791 <-> 487, 899\n1792 <-> 189, 382, 1384\n1793 <-> 966, 1392\n1794 <-> 45, 862\n1795 <-> 1944\n1796 <-> 1064\n1797 <-> 33\n1798 <-> 1216, 1536\n1799 <-> 284, 1732, 1924\n1800 <-> 221, 914\n1801 <-> 1601\n1802 <-> 117, 583, 785\n1803 <-> 995\n1804 <-> 355, 784\n1805 <-> 129\n1806 <-> 1238, 1853\n1807 <-> 1261\n1808 <-> 461\n1809 <-> 180, 316, 602, 1186\n1810 <-> 1641\n1811 <-> 1353\n1812 <-> 159, 458, 559, 1833\n1813 <-> 1880\n1814 <-> 336, 793\n1815 <-> 399, 1674\n1816 <-> 1816\n1817 <-> 20, 1585\n1818 <-> 1017\n1819 <-> 800\n1820 <-> 824, 1121, 1898\n1821 <-> 1755\n1822 <-> 1776\n1823 <-> 1087\n1824 <-> 234, 1017\n1825 <-> 478, 1730, 1763\n1826 <-> 11, 384, 608, 1087, 1884\n1827 <-> 326, 629\n1828 <-> 33, 818\n1829 <-> 630\n1830 <-> 986\n1831 <-> 522, 983, 1107\n1832 <-> 943, 1317, 1860\n1833 <-> 369, 1812\n1834 <-> 1301\n1835 <-> 375\n1836 <-> 394, 652\n1837 <-> 36, 484\n1838 <-> 256, 1912\n1839 <-> 1584, 1636\n1840 <-> 93, 1356, 1659\n1841 <-> 1219\n1842 <-> 1582, 1892\n1843 <-> 805, 1119, 1650\n1844 <-> 208, 594, 1738\n1845 <-> 681, 1346, 1743\n1846 <-> 1846\n1847 <-> 1301, 1847\n1848 <-> 1279\n1849 <-> 1341\n1850 <-> 851, 1850\n1851 <-> 520, 963\n1852 <-> 524, 663, 991, 1936\n1853 <-> 568, 1806\n1854 <-> 405\n1855 <-> 736\n1856 <-> 587, 1380\n1857 <-> 1472, 1778, 1893\n1858 <-> 414, 1727, 1896, 1983\n1859 <-> 1859\n1860 <-> 280, 1832, 1895\n1861 <-> 1313\n1862 <-> 245\n1863 <-> 674, 1863\n1864 <-> 1245\n1865 <-> 884, 1090\n1866 <-> 418, 461\n1867 <-> 686, 1066\n1868 <-> 354, 755, 1909\n1869 <-> 238, 1454\n1870 <-> 713, 1371\n1871 <-> 667, 1354, 1759\n1872 <-> 253, 614, 1054\n1873 <-> 268\n1874 <-> 75, 1927\n1875 <-> 680, 959, 1269\n1876 <-> 628\n1877 <-> 20, 638\n1878 <-> 344, 1278, 1341, 1890\n1879 <-> 1683, 1879\n1880 <-> 199, 592, 1813\n1881 <-> 1182\n1882 <-> 196, 1294, 1762\n1883 <-> 822, 823\n1884 <-> 962, 1157, 1826\n1885 <-> 51, 1923\n1886 <-> 1142\n1887 <-> 294, 879\n1888 <-> 514, 791\n1889 <-> 1678\n1890 <-> 1481, 1878\n1891 <-> 17, 858\n1892 <-> 362, 1842\n1893 <-> 485, 648, 1174, 1622, 1857\n1894 <-> 890\n1895 <-> 1860\n1896 <-> 1858\n1897 <-> 1897\n1898 <-> 1820\n1899 <-> 916\n1900 <-> 1527\n1901 <-> 324, 790, 1361, 1901\n1902 <-> 594\n1903 <-> 650, 1437, 1742, 1903, 1968\n1904 <-> 317\n1905 <-> 679, 1162, 1703\n1906 <-> 1527, 1608, 1932\n1907 <-> 1907\n1908 <-> 1908\n1909 <-> 1868\n1910 <-> 870, 1296\n1911 <-> 223, 239, 402, 877\n1912 <-> 1167, 1838\n1913 <-> 1105\n1914 <-> 123, 166\n1915 <-> 1270, 1280\n1916 <-> 1351, 1553\n1917 <-> 1146\n1918 <-> 1042\n1919 <-> 1671\n1920 <-> 460\n1921 <-> 33, 1241\n1922 <-> 1067\n1923 <-> 1319, 1475, 1885\n1924 <-> 1799\n1925 <-> 290, 981\n1926 <-> 62, 460\n1927 <-> 1167, 1874\n1928 <-> 550, 1776\n1929 <-> 1551\n1930 <-> 1771\n1931 <-> 122, 386\n1932 <-> 1906\n1933 <-> 841, 1783\n1934 <-> 1227, 1668\n1935 <-> 1669, 1741\n1936 <-> 1519, 1852\n1937 <-> 71, 1664\n1938 <-> 283, 456\n1939 <-> 1103\n1940 <-> 0\n1941 <-> 222, 499, 1565, 1941\n1942 <-> 61, 311, 1574\n1943 <-> 161\n1944 <-> 193, 958, 1397, 1795\n1945 <-> 257, 881, 1743\n1946 <-> 1367\n1947 <-> 1154, 1190, 1408\n1948 <-> 1562, 1948\n1949 <-> 1188\n1950 <-> 348\n1951 <-> 178, 835, 1161\n1952 <-> 1631\n1953 <-> 1050\n1954 <-> 977, 1299, 1501\n1955 <-> 804\n1956 <-> 1956\n1957 <-> 323, 657\n1958 <-> 298, 953\n1959 <-> 1757\n1960 <-> 27, 1078\n1961 <-> 387, 861, 1148, 1740\n1962 <-> 732, 1962\n1963 <-> 1556\n1964 <-> 1964\n1965 <-> 1242\n1966 <-> 1203\n1967 <-> 974, 1403\n1968 <-> 1903\n1969 <-> 664\n1970 <-> 17, 509, 1970\n1971 <-> 1097, 1618\n1972 <-> 155, 1366, 1788\n1973 <-> 547, 990, 1263\n1974 <-> 184, 1753\n1975 <-> 229, 1746\n1976 <-> 899, 1110\n1977 <-> 165, 1654\n1978 <-> 969\n1979 <-> 696, 717\n1980 <-> 1111, 1188, 1504\n1981 <-> 595\n1982 <-> 1982\n1983 <-> 380, 1858\n1984 <-> 278, 1554\n1985 <-> 1562\n1986 <-> 1278\n1987 <-> 1334, 1546\n1988 <-> 404\n1989 <-> 588, 1016\n1990 <-> 682, 712, 1548\n1991 <-> 41, 895\n1992 <-> 1116, 1534, 1697\n1993 <-> 15, 1207, 1643\n1994 <-> 1530\n1995 <-> 1642\n1996 <-> 167, 1181, 1643, 1750\n1997 <-> 1533, 1698\n1998 <-> 95, 141, 1753\n1999 <-> 792" def puzzle1(): programs = [] already_visited = [] IOI = [0] #index of interest num_programs = 0 for program in pipes.split("\n"): programs.append([int(a) for a in program.split(">")[1].split(",")]) while len(IOI) != 0: for pipe in programs[IOI[0]]: if not pipe in IOI and not pipe in already_visited: IOI.append(pipe) already_visited.append(IOI[0]) IOI = IOI[1:] num_programs += 1 return num_programs def puzzle2(): programs = [] group_num = 0 for program in pipes.split("\n"): programs.append([int(a) for a in program.split(">")[1].split(",")]) groups = [-1] * len(programs) for i in range(len(programs)): if groups[i] == -1: groups[i] = group_num IOI = [i] already_visited = [] while len(IOI) != 0: for pipe in programs[IOI[0]]: if not pipe in IOI and not pipe in already_visited: IOI.append(pipe) already_visited.append(IOI[0]) groups[IOI[0]] = group_num IOI = IOI[1:] group_num += 1 return group_num if __name__ == "__main__": print("1: {}".format(puzzle1())) print("2: {}".format(puzzle2()))
718.388889
37,463
0.582347
5,960
38,793
3.786745
0.677852
0.001418
0.001595
0.001152
0.015597
0.015597
0.015597
0.015597
0.015597
0.015597
0
0.611111
0.160158
38,793
54
37,464
718.388889
0.081614
0.001521
0
0.486486
0
0.027027
0.967649
0
0
0
0
0
0
1
0.054054
false
0
0
0
0.108108
0.054054
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
1
1
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
4f38fb0f48796a4984c9d9cd237aa55db338d254
78
py
Python
src/gym-proc/gym_proc/envs/__init__.py
maltegrosse/rl_procurement
5dd5487a4538d4ad64cd6a799dbab28967293f1f
[ "MIT" ]
null
null
null
src/gym-proc/gym_proc/envs/__init__.py
maltegrosse/rl_procurement
5dd5487a4538d4ad64cd6a799dbab28967293f1f
[ "MIT" ]
null
null
null
src/gym-proc/gym_proc/envs/__init__.py
maltegrosse/rl_procurement
5dd5487a4538d4ad64cd6a799dbab28967293f1f
[ "MIT" ]
null
null
null
from gym_proc.envs.proc_env import ProcurementEnv, Order, Procurement, Product
78
78
0.858974
11
78
5.909091
0.909091
0
0
0
0
0
0
0
0
0
0
0
0.076923
78
1
78
78
0.902778
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
4f4353a36455f70d3bb086ffa43e10c797e1dc38
130
py
Python
Blob_Lib/assimp-5.2.3/assimp/port/PyAssimp/scripts/3d_viewer_py3.py
antholuo/Blob_Traffic
5d6acf88044e9abc63c0ff356714179eaa4b75bf
[ "MIT" ]
null
null
null
Blob_Lib/assimp-5.2.3/assimp/port/PyAssimp/scripts/3d_viewer_py3.py
antholuo/Blob_Traffic
5d6acf88044e9abc63c0ff356714179eaa4b75bf
[ "MIT" ]
null
null
null
Blob_Lib/assimp-5.2.3/assimp/port/PyAssimp/scripts/3d_viewer_py3.py
antholuo/Blob_Traffic
5d6acf88044e9abc63c0ff356714179eaa4b75bf
[ "MIT" ]
null
null
null
version https://git-lfs.github.com/spec/v1 oid sha256:ebde06b93a398477735ce81e441f83f8baa82c575c2d8156a70e94ff7afb3eaf size 41537
32.5
75
0.884615
13
130
8.846154
1
0
0
0
0
0
0
0
0
0
0
0.370968
0.046154
130
3
76
43.333333
0.556452
0
0
0
0
0
0
0
0
1
0
0
0
0
null
null
0
0
null
null
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
0
0
0
null
1
0
0
0
1
0
0
0
0
0
0
0
0
5
4f6de1a478c18c18b078bc1ad317d90747e10ce2
88
py
Python
packages/watchmen-data-kernel/src/watchmen_data_kernel/utils/__init__.py
Indexical-Metrics-Measure-Advisory/watchmen
c54ec54d9f91034a38e51fd339ba66453d2c7a6d
[ "MIT" ]
null
null
null
packages/watchmen-data-kernel/src/watchmen_data_kernel/utils/__init__.py
Indexical-Metrics-Measure-Advisory/watchmen
c54ec54d9f91034a38e51fd339ba66453d2c7a6d
[ "MIT" ]
null
null
null
packages/watchmen-data-kernel/src/watchmen_data_kernel/utils/__init__.py
Indexical-Metrics-Measure-Advisory/watchmen
c54ec54d9f91034a38e51fd339ba66453d2c7a6d
[ "MIT" ]
null
null
null
from .variable_helper import MightAVariable, parse_function_in_variable, parse_variable
44
87
0.897727
11
88
6.727273
0.727273
0
0
0
0
0
0
0
0
0
0
0
0.068182
88
1
88
88
0.902439
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
96c39f51ad2990b3fef542f0cd0d48c7be60b6a1
4,032
py
Python
integration-test/679-less-landuse-building-label-placements.py
roman-ianivskyy/vector-datasource
3d59c0d9856d6bc2a78c4a9273b4e850c2e41d92
[ "MIT" ]
null
null
null
integration-test/679-less-landuse-building-label-placements.py
roman-ianivskyy/vector-datasource
3d59c0d9856d6bc2a78c4a9273b4e850c2e41d92
[ "MIT" ]
null
null
null
integration-test/679-less-landuse-building-label-placements.py
roman-ianivskyy/vector-datasource
3d59c0d9856d6bc2a78c4a9273b4e850c2e41d92
[ "MIT" ]
null
null
null
# -*- encoding: utf-8 -*- import dsl from shapely.wkt import loads as wkt_loads from . import FixtureTest class LessLanduseBuildingLabelPlacements(FixtureTest): def test_pier(self): # The landuse for a pier self.generate_fixtures(dsl.way(82206919, wkt_loads('POLYGON ((-122.426849807541 37.8089786736717, -122.426837680284 37.80915461355458, -122.426804173124 37.80932842386229, -122.426753238648 37.8094852005509, -122.42667813949 37.80966000368206, -122.426590374087 37.80980230150008, -122.426495691656 37.80996617430829, -122.426381695446 37.8101113813519, -122.426252966866 37.81024700702779, -122.42610276855 37.81037631604819, -122.425936490391 37.81049072098619, -122.425754132389 37.810587099202, -122.425571684554 37.81066658629568, -122.425370641594 37.8107301049385, -122.42517471903 37.8107736098545, -122.424957506395 37.81079802369498, -122.424805870775 37.81079901728138, -122.424662409824 37.81078517804159, -122.424582010606 37.8107724743269, -122.424504216502 37.81075345423587, -122.424433069932 37.81072591767768, -122.424378093036 37.81069199375939, -122.42433245862 37.81064217241178, -122.424302993879 37.8105924220012, -122.424297693818 37.8105394069047, -122.424311078716 37.81048539817969, -122.42434189093 37.81043976396991, -122.424400910245 37.81040697545338, -122.424468014396 37.81039001342301, -122.424547066141 37.81039845895331, -122.42460752276 37.81042081476407, -122.424649024926 37.81045246774188, -122.424675884553 37.81048958545409, -122.424687921978 37.81052989682989, -122.424691964397 37.81057546001328, -122.424714781605 37.81060299662759, -122.424750983711 37.8106252814059, -122.424812697971 37.8106357850571, -122.424945379138 37.81063479146851, -122.425130521918 37.81061357125258, -122.425306232388 37.81057439545318, -122.425489937863 37.81051719307118, -122.425656216023 37.81044941599798, -122.425813061871 37.81036460585538, -122.42596873991 37.81025758170368, -122.42610276855 37.8101421118383, -122.426210117227 37.81002451265628, -122.426313333653 37.80989208028149, -122.426404512654 37.80975638298231, -122.426486259345 37.80960599431378, -122.42655471097 37.80944389500019, -122.426598997913 37.80929549290848, -122.426627205013 37.80914297413997, -122.426641937384 37.8089786736717, -122.426635200019 37.80881870215168, -122.426612382811 37.80864276146838, -122.426573485759 37.8084490062172, -122.426517161391 37.80817128947058, -122.426719731487 37.80814588113949, -122.426780098275 37.80842558521829, -122.426817558022 37.80862267624071, -122.426843070176 37.80880805629729, -122.426849807541 37.8089786736717))'), { u'name': u'Municipal Pier', u'area': u'yes', u'way_area': u'13096.5', u'man_made': u'pier', u'access': u'yes', u'source': u'openstreetmap.org'})) self.assert_no_matching_feature( 14, 2620, 6330, 'landuse', {'id': 82206919, 'kind': 'pier', 'label_placement': True}) self.assert_has_feature( 15, 5240, 12661, 'landuse', {'id': 82206919, 'kind': 'pier', 'label_placement': True}) def test_building(self): # The building known as 650 California Street self.generate_fixtures(dsl.way(260520160, wkt_loads('POLYGON ((-122.405470532599 37.79301345436149, -122.405037544632 37.79306768882648, -122.404967925198 37.79272041719198, -122.405400823333 37.79266618247207, -122.405470532599 37.79301345436149))'), { u'building': u'yes', u'addr:housenumber': u'650', u'name': u'650 California Street', u'building:levels': u'33', u'way_area': u'2416.95', u'height': u'142', u'source': u'openstreetmap.org', u'alt_name': u'Hartford Building', u'addr:street': u'California Street'})) self.assert_no_matching_feature( 15, 5242, 12663, 'buildings', {'id': 260520160, 'kind': 'building', 'label_placement': True}) self.assert_has_feature( 16, 10484, 25326, 'buildings', {'id': 260520160, 'kind': 'building', 'label_placement': True})
118.588235
2,381
0.748264
467
4,032
6.406852
0.447537
0.013369
0.024064
0.015374
0.127005
0.075535
0.075535
0.062166
0
0
0
0.623586
0.123016
4,032
33
2,382
122.181818
0.222568
0.022321
0
0.363636
0
0.090909
0.738192
0
0
0
0
0
0.181818
1
0.090909
false
0
0.136364
0
0.272727
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
1
1
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
8c0ceec19448105043fd6230a860ad6ae654116f
173
py
Python
address/admin.py
AhteshamSid/College_school_management_system
a8504708ea2f347d18d4ac59198f29d05c0374d2
[ "MIT" ]
null
null
null
address/admin.py
AhteshamSid/College_school_management_system
a8504708ea2f347d18d4ac59198f29d05c0374d2
[ "MIT" ]
null
null
null
address/admin.py
AhteshamSid/College_school_management_system
a8504708ea2f347d18d4ac59198f29d05c0374d2
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import District, Upazilla, Union admin.site.register(District) admin.site.register(Upazilla) admin.site.register(Union)
24.714286
46
0.791908
23
173
5.956522
0.478261
0.19708
0.372263
0
0
0
0
0
0
0
0
0
0.115607
173
7
47
24.714286
0.895425
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.4
0
0.4
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
8c60fb37b04ea8e566b75e423809b409da787d84
111
py
Python
src/shell/set/base.py
hsravat-4590/PathFinder
ef57ab6d3d2565f7b8c2d3e4cff92287d568a433
[ "MIT" ]
null
null
null
src/shell/set/base.py
hsravat-4590/PathFinder
ef57ab6d3d2565f7b8c2d3e4cff92287d568a433
[ "MIT" ]
null
null
null
src/shell/set/base.py
hsravat-4590/PathFinder
ef57ab6d3d2565f7b8c2d3e4cff92287d568a433
[ "MIT" ]
null
null
null
class Base: # Base Class command = '' def __init__(self,command): self.command = command
13.875
31
0.585586
12
111
5.083333
0.5
0.360656
0
0
0
0
0
0
0
0
0
0
0.315315
111
7
32
15.857143
0.802632
0.09009
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0
0
0.75
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
5
4fdf20b0b6ae873370c7555181f95b2ca38e48dd
11,929
py
Python
backend/api/views/RolViewSet.py
kukiamarilla/polijira
510dbc1473db973ac71fc68fa5a9b758b90a780b
[ "MIT" ]
1
2022-03-02T02:28:49.000Z
2022-03-02T02:28:49.000Z
backend/api/views/RolViewSet.py
kukiamarilla/polijira
510dbc1473db973ac71fc68fa5a9b758b90a780b
[ "MIT" ]
22
2021-09-01T17:44:25.000Z
2021-10-07T19:39:09.000Z
backend/api/views/RolViewSet.py
kukiamarilla/polijira
510dbc1473db973ac71fc68fa5a9b758b90a780b
[ "MIT" ]
null
null
null
from django.db import transaction from rest_framework import viewsets, status from rest_framework.decorators import action from rest_framework.response import Response from backend.api.models import Rol, Permiso, Usuario from backend.api.serializers import RolSerializer, PermisoSerializer from backend.api.forms import CreateRolForm, UpdateRolForm, AgregarPermisoRolForm class RolViewSet(viewsets.ViewSet): """ RolViewSet View para el modelo Rol Args: viewsets (module): tipo de clase basado en view """ def list(self, request): """ list Lista todos los roles de sistema Args: request (Any): request Return: json: lista de roles de sistema en formato json """ usuario_request = Usuario.objects.get(user=request.user) if not usuario_request.tiene_permiso("ver_roles"): response = { "message": "No tiene permiso para realizar esta acción", "permission_required": ["ver_roles"] } return Response(response, status=status.HTTP_403_FORBIDDEN) roles = Rol.objects.all() serializer = RolSerializer(roles, many=True) return Response(serializer.data) def retrieve(self, request, pk=None): """ retrieve Obtiene un rol de sistema mediante su pk Args: request (Any): request pk (integer, opcional): primary key. Defaults to None. Returns: json: rol de sistema obtenido en formato json """ try: usuario_request = Usuario.objects.get(user=request.user) if not usuario_request.tiene_permiso("ver_roles"): response = { "message": "No tiene permiso para realizar esta acción", "permission_required": ["ver_roles"] } return Response(response, status=status.HTTP_403_FORBIDDEN) rol = Rol.objects.get(pk=pk) serializer = RolSerializer(rol, many=False) return Response(serializer.data) except Rol.DoesNotExist: response = {"message": "No existe el rol"} return Response(response, status=status.HTTP_404_NOT_FOUND) @transaction.atomic def create(self, request): """ create Crea un rol de sistema Args: request (Any): request Returns: json: rol de sistema creado en formato json """ usuario_request = Usuario.objects.get(user=request.user) if not (usuario_request.tiene_permiso("crear_roles") and usuario_request.tiene_permiso("ver_permisos")): response = { "message": "No tiene permiso para realizar esta acción", "permission_required": [ "ver_permisos", "crear_roles" ] } return Response(response, status=status.HTTP_403_FORBIDDEN) form = CreateRolForm(request.data) if not form.is_valid(): response = { "message": "Error de validacion", "errors": form.errors } return Response(response, status=status.HTTP_422_UNPROCESSABLE_ENTITY) permisos = request.data["permisos"] rol = Rol.objects.create(nombre=request.data["nombre"]) for p in permisos: perm = Permiso.objects.get(pk=p["id"]) rol.agregar_permiso(perm) serializer = RolSerializer(rol, many=False) return Response(serializer.data) def destroy(self, request, pk=None): """ destroy Elimina un rol de sistema Args: request (Any): request pk (integer, opcional): primary key. Defaults to None. """ try: usuario_request = Usuario.objects.get(user=request.user) if not (usuario_request.tiene_permiso("ver_roles") and usuario_request.tiene_permiso("eliminar_roles")): response = { "message": "No tiene permiso para realizar esta acción", "permission_required": [ "ver_roles", "eliminar_roles" ] } return Response(response, status=status.HTTP_403_FORBIDDEN) if Usuario.objects.filter(rol__pk=pk).count(): response = {"message": "Rol asignado a usuario, no se puede eliminar"} return Response(response, status=status.HTTP_403_FORBIDDEN) rol = Rol.objects.get(pk=pk) rol.delete() response = {"message": "Rol Eliminado."} return Response(response) except Rol.DoesNotExist: response = {"message": "No existe el rol"} return Response(response, status=status.HTTP_404_NOT_FOUND) def update(self, request, pk=None): """ update Obtiene un rol de sistema mediante su pk Args: request (Any): request pk (integer, opcional): primary key. Defaults to None. Returns: json: rol de sistema modificado en formato json """ try: usuario_request = Usuario.objects.get(user=request.user) if not (usuario_request.tiene_permiso("ver_permisos") and usuario_request.tiene_permiso("ver_roles") and usuario_request.tiene_permiso("modificar_roles")): response = { "message": "No tiene permiso para realizar esta acción", "permission_required": [ "ver_permisos", "ver_roles", "modificar_roles" ] } return Response(response, status=status.HTTP_403_FORBIDDEN) form = UpdateRolForm(request.data) if not form.is_valid(): response = { "message": "Error de validación", "errors": form.errors } return Response(response, status=status.HTTP_422_UNPROCESSABLE_ENTITY) if (usuario_request.rol.pk == int(pk)): response = {"message": "No puedes modificar tu propio rol"} return Response(response, status=status.HTTP_403_FORBIDDEN) rol = Rol.objects.get(pk=pk) rol_db = Rol.objects.filter(nombre=request.data["nombre"]) if len(rol_db) > 0: response = { "message": "Ya existe un rol con ese nombre", "error": "forbidden" } return Response(response, status=status.HTTP_403_FORBIDDEN) rol.nombre = request.data["nombre"] rol.save() serializer = RolSerializer(rol, many=False) return Response(serializer.data) except Rol.DoesNotExist: response = {"message": "No existe el rol"} return Response(response, status=status.HTTP_404_NOT_FOUND) @action(detail=True, methods=["GET"]) def permisos(self, request, pk=None): """ permisos Lista los permisos de un rol de sistema request (Any): request pk (integer, opcional): primary key. Defaults to None. Returns: json: lista de permisos de un rol de sistema """ try: usuario_request = Usuario.objects.get(user=request.user) if not usuario_request.tiene_permiso("ver_roles"): response = { "message": "No tiene permiso para realizar esta acción", "permission_required": ["ver_roles"] } return Response(response, status=status.HTTP_403_FORBIDDEN) rol = Rol.objects.get(pk=pk) permisos = rol.permisos.all() serializer = PermisoSerializer(permisos, many=True) return Response(serializer.data) except Rol.DoesNotExist: response = {"message": "No existe el rol"} return Response(response, status=status.HTTP_404_NOT_FOUND) @permisos.mapping.post def agregar_permiso(self, request, pk=None): """ agregar_permiso Agrega un permiso a un rol de sistema Args: request (Any): request pk (integer, opcional): primary key. Defaults to None. Returns: json: rol de sistema con nuevo permiso agregado en formato json """ try: usuario_request = Usuario.objects.get(user=request.user) if not (usuario_request.tiene_permiso("ver_permisos") and usuario_request.tiene_permiso("modificar_roles")): response = { "message": "No tiene permiso para realizar esta acción", "permission_required": [ "ver_permisos", "modificar_roles" ] } return Response(response, status=status.HTTP_403_FORBIDDEN) form = AgregarPermisoRolForm(request.data) if not form.is_valid(): response = { "message": "Error de validacion", "errors": form.errors } return Response(response, status=status.HTTP_422_UNPROCESSABLE_ENTITY) if (usuario_request.rol.pk == int(pk)): response = {"message": "No puedes modificar tu propio rol"} return Response(response, status=status.HTTP_403_FORBIDDEN) rol = Rol.objects.get(pk=pk) permiso = Permiso.objects.get(pk=request.data["id"]) rol.agregar_permiso(permiso) serializer = RolSerializer(rol, many=False) return Response(serializer.data) except Rol.DoesNotExist: response = {"message": "No existe el rol"} return Response(response, status=status.HTTP_404_NOT_FOUND) @permisos.mapping.delete def eliminar_permiso(self, request, pk=None): """ eliminar_permiso Elimina un permiso de un rol de sistema Args: request (Any): request pk (integer, opcional): primary key. Defaults to None. """ try: usuario_request = Usuario.objects.get(user=request.user) if not (usuario_request.tiene_permiso("ver_permisos") and usuario_request.tiene_permiso("modificar_roles")): response = { "message": "No tiene permiso para realizar esta acción", "permission_required": [ "ver_permisos", "modificar_roles" ] } return Response(response, status=status.HTTP_403_FORBIDDEN) if (usuario_request.rol.pk == int(pk)): response = {"message": "No puedes modificar tu propio rol"} return Response(response, status=status.HTTP_403_FORBIDDEN) rol = Rol.objects.get(pk=pk) permiso = Permiso.objects.get(pk=request.data["id"]) if rol.permisos.all().count() < 2: response = {"message": "El rol no se puede quedar sin permisos"} return Response(response, status=status.HTTP_403_FORBIDDEN) rol.eliminar_permiso(permiso) serializer = RolSerializer(rol, many=False) return Response(serializer.data) except Permiso.DoesNotExist: response = {"message": "No existe el permiso"} return Response(response, status=status.HTTP_404_NOT_FOUND) except Rol.DoesNotExist: response = {"message": "No existe el rol"} return Response(response, status=status.HTTP_404_NOT_FOUND)
41.134483
116
0.569453
1,214
11,929
5.471993
0.126853
0.067439
0.082794
0.101159
0.766973
0.755081
0.724372
0.724372
0.719103
0.686286
0
0.009415
0.341102
11,929
289
117
41.276817
0.835751
0.121636
0
0.641791
0
0
0.145413
0
0
0
0
0.00346
0
1
0.039801
false
0
0.034826
0
0.238806
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
4fe1b87689387af19b6aad8374edc0ac26bf3f00
52
py
Python
lib/model/__init__.py
starhiking/HeatmapInHeatmap
7174ea28ebf5846d1406d06c665fc09f06630022
[ "Apache-2.0" ]
null
null
null
lib/model/__init__.py
starhiking/HeatmapInHeatmap
7174ea28ebf5846d1406d06c665fc09f06630022
[ "Apache-2.0" ]
null
null
null
lib/model/__init__.py
starhiking/HeatmapInHeatmap
7174ea28ebf5846d1406d06c665fc09f06630022
[ "Apache-2.0" ]
null
null
null
from .get_hourglass import StackedHourGlass as hgnet
52
52
0.884615
7
52
6.428571
1
0
0
0
0
0
0
0
0
0
0
0
0.096154
52
1
52
52
0.957447
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
4fe892115cc83677bae4ac317278da7d0e97ee02
32
py
Python
cornflow-dags/DAG/graph_coloring/solvers/__init__.py
ggsdc/corn
4c17c46a70f95b8882bcb6a55ef7daa1f69e0456
[ "MIT" ]
2
2020-07-09T20:58:47.000Z
2020-07-20T20:40:46.000Z
cornflow-dags/DAG/graph_coloring/solvers/__init__.py
baobabsoluciones/cornflow
bd7cae22107e5fe148704d5f41d4f58f9c410b40
[ "Apache-2.0" ]
2
2022-03-31T08:42:10.000Z
2022-03-31T12:05:23.000Z
cornflow-dags/DAG/graph_coloring/solvers/__init__.py
ggsdc/corn
4c17c46a70f95b8882bcb6a55ef7daa1f69e0456
[ "MIT" ]
null
null
null
from .cp_model import OrToolsCP
16
31
0.84375
5
32
5.2
1
0
0
0
0
0
0
0
0
0
0
0
0.125
32
1
32
32
0.928571
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
4feade27997230371f09195c2dc5780c4d17c56e
48
py
Python
omnipresence/test/integration/__init__.py
kxz/omnipresence
ffb3dbc30d36331a68e8dea3a85db6a4d2928cd7
[ "BSD-3-Clause" ]
null
null
null
omnipresence/test/integration/__init__.py
kxz/omnipresence
ffb3dbc30d36331a68e8dea3a85db6a4d2928cd7
[ "BSD-3-Clause" ]
10
2016-04-05T04:36:15.000Z
2018-03-25T00:15:47.000Z
omnipresence/test/integration/__init__.py
kxz/omnipresence
ffb3dbc30d36331a68e8dea3a85db6a4d2928cd7
[ "BSD-3-Clause" ]
null
null
null
"""Integration tests for Omnipresence flows."""
24
47
0.75
5
48
7.2
1
0
0
0
0
0
0
0
0
0
0
0
0.104167
48
1
48
48
0.837209
0.854167
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
8b248ee83ff8fdce834006e3ed801e4fc3515738
147
py
Python
runtests.py
rothskeller/py-wsse-quix
8b2d9e0b4826d59ab4f92ecaaff26893d1aa57f2
[ "BSD-3-Clause" ]
10
2015-07-17T00:57:23.000Z
2018-10-28T13:06:22.000Z
runtests.py
rothskeller/py-wsse-quix
8b2d9e0b4826d59ab4f92ecaaff26893d1aa57f2
[ "BSD-3-Clause" ]
14
2016-05-19T11:29:13.000Z
2021-09-29T07:31:01.000Z
runtests.py
rothskeller/py-wsse-quix
8b2d9e0b4826d59ab4f92ecaaff26893d1aa57f2
[ "BSD-3-Clause" ]
21
2015-09-16T05:02:04.000Z
2022-01-31T11:43:31.000Z
#!/usr/bin/env python # This script exists to make the tests easier to run via ``coverage run``. import pytest import sys sys.exit(pytest.main())
21
74
0.734694
25
147
4.32
0.8
0
0
0
0
0
0
0
0
0
0
0
0.14966
147
6
75
24.5
0.864
0.632653
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
8cb2b27ff8e9ef5043dbf59b28ce1faeb4bf8977
62
py
Python
src/utils/__init__.py
PanyalaSainathReddy/authorization
63c9ed9294c16165c76d97804a47dad899933d9a
[ "MIT" ]
null
null
null
src/utils/__init__.py
PanyalaSainathReddy/authorization
63c9ed9294c16165c76d97804a47dad899933d9a
[ "MIT" ]
6
2022-02-03T11:30:26.000Z
2022-02-14T16:57:01.000Z
src/utils/__init__.py
PanyalaSainathReddy/authorization
63c9ed9294c16165c76d97804a47dad899933d9a
[ "MIT" ]
5
2022-02-03T16:15:39.000Z
2022-02-11T19:31:23.000Z
from .datetime import * # noqa from .helpers import * # noqa
31
31
0.693548
8
62
5.375
0.625
0.465116
0
0
0
0
0
0
0
0
0
0
0.209677
62
2
32
31
0.877551
0.145161
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
8cc8b8cc0f14e848c60d2c7012c32b09e5e551db
139
py
Python
Chapter09/_adapter_base.py
TranQuangDuc/Clean-Code-in-Python
3c4b4a2fde2ccf28d2e0ec5002b2e1921704164e
[ "MIT" ]
402
2018-08-19T03:09:40.000Z
2022-03-30T08:10:26.000Z
Chapter09/_adapter_base.py
TranQuangDuc/Clean-Code-in-Python
3c4b4a2fde2ccf28d2e0ec5002b2e1921704164e
[ "MIT" ]
137
2021-01-05T11:21:04.000Z
2022-03-31T11:10:11.000Z
Chapter09/_adapter_base.py
TranQuangDuc/Clean-Code-in-Python
3c4b4a2fde2ccf28d2e0ec5002b2e1921704164e
[ "MIT" ]
140
2018-09-16T05:47:46.000Z
2022-03-31T03:20:30.000Z
from log import logger class UsernameLookup: def search(self, user_namespace): logger.info("looking for %s", user_namespace)
19.857143
53
0.719424
18
139
5.444444
0.833333
0.265306
0
0
0
0
0
0
0
0
0
0
0.194245
139
6
54
23.166667
0.875
0
0
0
0
0
0.100719
0
0
0
0
0
0
1
0.25
false
0
0.25
0
0.75
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
5
8cfc3f5383e27f9a3a210b4f5e823f63c4ce4ce1
94
py
Python
setup.py
rxn4chemistry/biocatalysis-model
4f61873bf2574af96e8fab7800eca15bd980a420
[ "MIT" ]
20
2022-02-19T09:14:41.000Z
2022-03-16T07:58:14.000Z
setup.py
rxn4chemistry/biocatalysis-model
4f61873bf2574af96e8fab7800eca15bd980a420
[ "MIT" ]
null
null
null
setup.py
rxn4chemistry/biocatalysis-model
4f61873bf2574af96e8fab7800eca15bd980a420
[ "MIT" ]
6
2022-02-20T15:48:56.000Z
2022-02-24T04:51:20.000Z
"""Module installation.""" import os import setuptools setuptools.setup(install_requires=[])
15.666667
37
0.776596
10
94
7.2
0.8
0
0
0
0
0
0
0
0
0
0
0
0.085106
94
5
38
18.8
0.837209
0.212766
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
509766a12133463786d0fd115d4325b359750be0
37
py
Python
tests/__init__.py
apiology/with-op
48a214c9565a8c98729049f2b5d655ef7030a6b4
[ "MIT" ]
null
null
null
tests/__init__.py
apiology/with-op
48a214c9565a8c98729049f2b5d655ef7030a6b4
[ "MIT" ]
1
2021-12-14T18:24:40.000Z
2021-12-14T18:24:40.000Z
tests/__init__.py
apiology/with-op
48a214c9565a8c98729049f2b5d655ef7030a6b4
[ "MIT" ]
null
null
null
"""Unit test package for with-op."""
18.5
36
0.648649
6
37
4
1
0
0
0
0
0
0
0
0
0
0
0
0.135135
37
1
37
37
0.75
0.810811
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
50c914054c351b20fa3a8fc48afa8de32942b265
2,530
py
Python
plugins/tgraph.py
IzzyLord/TGraph-Bot
6a38773a9d696749fec22408030c4f5060bf8ac5
[ "MIT" ]
null
null
null
plugins/tgraph.py
IzzyLord/TGraph-Bot
6a38773a9d696749fec22408030c4f5060bf8ac5
[ "MIT" ]
null
null
null
plugins/tgraph.py
IzzyLord/TGraph-Bot
6a38773a9d696749fec22408030c4f5060bf8ac5
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # (c) @psycholy99 # @NekoneProjects from pyrogram import Client, filters from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton ,CallbackQuery import os, shutil from config import Config from telegraph import upload_file import logging from translation import Translation logging.basicConfig(level=logging.INFO) @Client.on_message(filters.photo) async def get_tgraph(bot, message): tmp = os.path.join("downloads",str(message.chat.id)) if not os.path.isdir(tmp): os.makedirs(tmp) imgdir = tmp + "/" + str(message.message_id) +".jpg" dwn = await message.reply_text("`Processing...`", True) await bot.download_media( message=message, file_name=imgdir ) await dwn.edit_text("`Uploading...`") try: response = upload_file(imgdir) except Exception as error: await dwn.edit_text(f"Oops something went wrong\n{error}") return await dwn.edit_text(f"https://telegra.ph{response[0]}") shutil.rmtree(tmp,ignore_errors=True) @Client.on_message(filters.video) async def getvideo(bot, message): tmp = os.path.join("downloads",str(message.chat.id)) if not os.path.isdir(tmp): os.makedirs(tmp) viddir = tmp + "/" + str(message.message_id) +".mp4" dwn = await message.reply_text("`Processing...`", True) await bot.download_media( message=message, file_name=viddir ) await dwn.edit_text("`Uploading...`") try: response = upload_file(viddir) except Exception as error: await dwn.edit_text(f"Oops something went wrong\n{error}") return await dwn.edit_text(f"https://telegra.ph{response[0]}") shutil.rmtree(tmp,ignore_errors=True) @Client.on_message(filters.animation) async def getanimation(bot, message): tmp = os.path.join("downloads",str(message.chat.id)) if not os.path.isdir(tmp): os.makedirs(tmp) gifdir = tmp + "/" + str(message.message_id) +".mp4" dwn = await message.reply_text("`Processing...`", True) await bot.download_media( message=message, file_name=gifdir ) await dwn.edit_text("`Uploading...`") try: response = upload_file(gifdir) except Exception as error: await dwn.edit_text(f"Oops something went wrong\n{error}") return await dwn.edit_text(f"https://telegra.ph{response[0]}") shutil.rmtree(tmp,ignore_errors=True)
33.733333
84
0.653755
325
2,530
4.990769
0.273846
0.04439
0.066584
0.088779
0.720715
0.707152
0.707152
0.707152
0.707152
0.622072
0
0.004529
0.214625
2,530
74
85
34.189189
0.811777
0.029644
0
0.6
0
0
0.132191
0
0
0
0
0
0
1
0
false
0
0.107692
0
0.153846
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
50f3e2f230af79da77fce48fa3933745cab0ed05
3,887
py
Python
tests/app/main/views/test_email_preview.py
cds-snc/notifier-admin
69aab94cb8d1711488e471cac52223c7f9f6f90e
[ "MIT" ]
16
2019-11-05T21:35:49.000Z
2022-01-12T15:00:32.000Z
tests/app/main/views/test_email_preview.py
cds-snc/notification-admin
d4056798bf889ad29893667bbb67ead2f8e466e4
[ "MIT" ]
509
2019-07-11T22:03:19.000Z
2022-03-30T15:19:26.000Z
tests/app/main/views/test_email_preview.py
cds-snc/notifier-admin
69aab94cb8d1711488e471cac52223c7f9f6f90e
[ "MIT" ]
8
2020-02-21T20:19:29.000Z
2022-03-31T14:17:02.000Z
import re import pytest from bs4 import BeautifulSoup from flask import url_for @pytest.mark.parametrize("query_args, result", [({}, True), ({"fip_banner_english": "false"}, "false")]) def test_renders(client, mocker, query_args, result): mocker.patch("app.main.views.index.HTMLEmailTemplate.__str__", return_value="rendered") response = client.get(url_for("main.email_template", **query_args)) assert response.status_code == 200 assert response.get_data(as_text=True) == "rendered" def test_displays_govuk_branding_by_default(client): response = client.get(url_for("main.email_template")) assert response.status_code == 200 def test_displays_govuk_branding(client, mock_get_email_branding_with_govuk_brand_type): response = client.get(url_for("main.email_template", branding_style="1")) assert response.status_code == 200 def test_displays_both_branding(client, mock_get_email_branding_with_both_brand_type): response = client.get(url_for("main.email_template", branding_style="1")) page = BeautifulSoup(response.data.decode("utf-8"), "html.parser") assert response.status_code == 200 mock_get_email_branding_with_both_brand_type.assert_called_once_with("1") assert page.find("img", attrs={"src": re.compile("example.png$")}) assert ( page.select("body > table:nth-of-type(2) table > tr:nth-of-type(1) > td:nth-of-type(2)")[0].get_text().strip() == "Organisation text" ) # brand text is set def test_displays_org_branding(client, mock_get_email_branding): # mock_get_email_branding has 'brand_type' of 'custom_logo' response = client.get(url_for("main.email_template", branding_style="1")) page = BeautifulSoup(response.data.decode("utf-8"), "html.parser") assert response.status_code == 200 mock_get_email_branding.assert_called_once_with("1") assert not page.find("a", attrs={"href": "https://www.gov.uk"}) assert page.find("img", attrs={"src": re.compile("example.png")}) assert not page.select("body > table > tr > td[bgcolor='#f00']") # banner colour is not set assert ( page.select("body > table:nth-of-type(1) > tr:nth-of-type(1) > td:nth-of-type(1)")[0].get_text().strip() == "Organisation text" ) # brand text is set def test_displays_org_branding_with_banner(client, mock_get_email_branding_with_custom_logo_with_background_colour_brand_type): response = client.get(url_for("main.email_template", branding_style="1")) page = BeautifulSoup(response.data.decode("utf-8"), "html.parser") assert response.status_code == 200 mock_get_email_branding_with_custom_logo_with_background_colour_brand_type.assert_called_once_with("1") assert not page.find("a", attrs={"href": "https://www.gov.uk"}) assert page.find("img", attrs={"src": re.compile("example.png")}) assert page.select("body > table > tr > td[bgcolor='#f00']") # banner colour is set assert page.select("body > table table > tr > td > span")[0].get_text().strip() == "Organisation text" # brand text is set def test_displays_org_branding_with_banner_without_brand_text(client, mock_get_email_branding_without_brand_text): # mock_get_email_branding_without_brand_text has 'brand_type' of 'custom_logo_with_background_colour' response = client.get(url_for("main.email_template", branding_style="1")) page = BeautifulSoup(response.data.decode("utf-8"), "html.parser") assert response.status_code == 200 mock_get_email_branding_without_brand_text.assert_called_once_with("1") assert not page.find("a", attrs={"href": "https://www.gov.uk"}) assert page.find("img", attrs={"src": re.compile("example.png")}) assert page.select("body > table > tr > td[bgcolor='#f00']") # banner colour is set assert not page.select("body > table table > tr > td > span") == 0 # brand text is not set
40.072165
127
0.720864
565
3,887
4.677876
0.180531
0.029134
0.049943
0.083239
0.856981
0.824442
0.790768
0.737798
0.63602
0.594022
0
0.015179
0.13558
3,887
96
128
40.489583
0.771429
0.07718
0
0.5
0
0.035714
0.231199
0.01286
0
0
0
0
0.464286
1
0.125
false
0
0.071429
0
0.196429
0
0
0
0
null
0
0
0
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
5
0fe98726d18f334dbcf6136cff83cc9429249733
27
py
Python
grelease/sample/__init__.py
mingzhang96/github-release
484ec35528f43da77605e55b6a56b39e955e8ba8
[ "Apache-2.0" ]
null
null
null
grelease/sample/__init__.py
mingzhang96/github-release
484ec35528f43da77605e55b6a56b39e955e8ba8
[ "Apache-2.0" ]
null
null
null
grelease/sample/__init__.py
mingzhang96/github-release
484ec35528f43da77605e55b6a56b39e955e8ba8
[ "Apache-2.0" ]
null
null
null
from .sample import Sample
13.5
26
0.814815
4
27
5.5
0.75
0
0
0
0
0
0
0
0
0
0
0
0.148148
27
1
27
27
0.956522
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
0fee6885dbdc537039eacd0fdfa5a7b7eebbeff0
64
py
Python
filestore/__init__.py
Caddox/pyfilestore
dc5b4842fb4c51b67ac47d2921baaba6309ff30e
[ "MIT" ]
null
null
null
filestore/__init__.py
Caddox/pyfilestore
dc5b4842fb4c51b67ac47d2921baaba6309ff30e
[ "MIT" ]
null
null
null
filestore/__init__.py
Caddox/pyfilestore
dc5b4842fb4c51b67ac47d2921baaba6309ff30e
[ "MIT" ]
null
null
null
from filestore import filestore Filestore = filestore.Filestore
21.333333
31
0.859375
7
64
7.857143
0.428571
0.981818
0.981818
0
0
0
0
0
0
0
0
0
0.109375
64
2
32
32
0.964912
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
0ffc4926788dbc03aa1f8dbda4755dd7b5ec2712
250
py
Python
src/test/tests/api_test.py
NGnius/streamq
aa31085befc7da2e3f7461698b2638a246a73eef
[ "MIT" ]
null
null
null
src/test/tests/api_test.py
NGnius/streamq
aa31085befc7da2e3f7461698b2638a246a73eef
[ "MIT" ]
null
null
null
src/test/tests/api_test.py
NGnius/streamq
aa31085befc7da2e3f7461698b2638a246a73eef
[ "MIT" ]
null
null
null
from ..objects.apicase import APICase import requests class APITest(APICase): pass # def test_connection(self): # resp = requests.get('http://localhost:5000/api/test?password=DEBUG') # self.assertEqual(resp.status_code, 200)
27.777778
78
0.7
31
250
5.580645
0.774194
0.150289
0
0
0
0
0
0
0
0
0
0.033981
0.176
250
8
79
31.25
0.805825
0.572
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.25
0.5
0
0.75
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
1
0
1
0
0
5
ba100a1e90f2a3400a62ef3e0da86ab17a810aac
217
py
Python
wsgi.py
machinekoder/speed-friending-matcher
c1d63c44e198497662c561342b64f597cb8623e9
[ "MIT" ]
4
2018-05-04T15:44:09.000Z
2019-03-17T04:54:20.000Z
wsgi.py
machinekoder/speed-friending-and-dating-matcher
c1d63c44e198497662c561342b64f597cb8623e9
[ "MIT" ]
12
2017-10-21T10:42:28.000Z
2019-02-27T10:33:04.000Z
wsgi.py
machinekoder/speed-friending-matcher
c1d63c44e198497662c561342b64f597cb8623e9
[ "MIT" ]
8
2018-01-02T10:14:19.000Z
2022-01-11T03:17:04.000Z
# coding=utf-8 from speed_friending_matcher import server from speed_friending_matcher.server import app as application server.configure( input_plugin='csv:{}', output_plugin='todo:{}:{}', matchmaker='simple' )
24.111111
61
0.769585
28
217
5.75
0.714286
0.111801
0.223602
0.310559
0
0
0
0
0
0
0
0.005155
0.105991
217
9
62
24.111111
0.824742
0.0553
0
0
0
0
0.107843
0
0
0
0
0
0
1
0
true
0
0.285714
0
0.285714
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
e83d0381e0e65c08e5e1d8188c13ce269a98b7b7
36
py
Python
test/test.py
lelandlopez/classcrawler
8fad55fca8e03b08134ca9cc46226a506f4674e8
[ "MIT" ]
null
null
null
test/test.py
lelandlopez/classcrawler
8fad55fca8e03b08134ca9cc46226a506f4674e8
[ "MIT" ]
null
null
null
test/test.py
lelandlopez/classcrawler
8fad55fca8e03b08134ca9cc46226a506f4674e8
[ "MIT" ]
null
null
null
#!/usr/bin/env python print "blah";
12
21
0.666667
6
36
4
1
0
0
0
0
0
0
0
0
0
0
0
0.111111
36
3
22
12
0.75
0.555556
0
0
0
0
0.25
0
0
0
0
0
0
0
null
null
0
0
null
null
1
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
1
0
5
e840248aed3f7b714cbde8a8a81371655371b987
78
py
Python
StringFormatter.py
vidhurraj147/pythonexample
f595034cb6e4c317812f25d8d92501f62c2ccfee
[ "Apache-2.0" ]
null
null
null
StringFormatter.py
vidhurraj147/pythonexample
f595034cb6e4c317812f25d8d92501f62c2ccfee
[ "Apache-2.0" ]
null
null
null
StringFormatter.py
vidhurraj147/pythonexample
f595034cb6e4c317812f25d8d92501f62c2ccfee
[ "Apache-2.0" ]
null
null
null
print ("This is %s and working for %s knows %d languages" %('Rahul','IBM',21))
78
78
0.653846
14
78
3.642857
0.928571
0
0
0
0
0
0
0
0
0
0
0.029851
0.141026
78
1
78
78
0.731343
0
0
0
0
0
0.708861
0
0
0
0
0
0
1
0
true
0
0
0
0
1
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
5
e857e0338e13db5296b9ba684a2b338179da5e51
76
py
Python
lastping/__init__.py
skylarr1227/FlameBountyCogs
5fc0cc4b3b931a713c142248c2e0c89f118d4d45
[ "MIT" ]
3
2019-12-29T02:39:18.000Z
2021-06-20T22:25:16.000Z
lastping/__init__.py
skylarr1227/FlameBountyCogs
5fc0cc4b3b931a713c142248c2e0c89f118d4d45
[ "MIT" ]
1
2019-11-19T14:05:43.000Z
2019-11-19T14:05:43.000Z
lastping/__init__.py
skylarr1227/FlameBountyCogs
5fc0cc4b3b931a713c142248c2e0c89f118d4d45
[ "MIT" ]
3
2019-11-18T21:29:21.000Z
2020-01-11T19:55:55.000Z
from .lastping import LastPing def setup(bot): bot.add_cog(LastPing(bot))
15.2
30
0.763158
12
76
4.75
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.118421
76
4
31
19
0.850746
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
0
1
0
0
5
e869a5e02472f737c15c421abfc369201522467b
66
py
Python
horror/__init__.py
kaylynn234/python-horror
a670e0a5b75574b5ddbb42bfc82fcbde763025e8
[ "Apache-2.0" ]
7
2020-09-30T02:56:38.000Z
2021-08-20T13:04:56.000Z
horror/__init__.py
kaylynn234/python-horror
a670e0a5b75574b5ddbb42bfc82fcbde763025e8
[ "Apache-2.0" ]
null
null
null
horror/__init__.py
kaylynn234/python-horror
a670e0a5b75574b5ddbb42bfc82fcbde763025e8
[ "Apache-2.0" ]
null
null
null
def horror(func): # Once more unto the breach return func
16.5
31
0.666667
10
66
4.4
0.9
0
0
0
0
0
0
0
0
0
0
0
0.272727
66
3
32
22
0.916667
0.378788
0
0
0
0
0
0
0
0
0
0
0
1
0.5
false
0
0
0.5
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
e86a22cbe29685aef68a2fb239aa8abfb8c024b7
74
py
Python
src/Python/Test/__init__.py
haesleinhuepf/hydra-image-processor
df15ba718ab4ed369a0b34434eab45f62e7c5377
[ "BSD-3-Clause" ]
8
2019-05-30T12:38:44.000Z
2020-02-10T20:01:45.000Z
src/Python/Test/__init__.py
ericwait/hydra-signal-processor
76cbbac389045e7b3f26344cabec5befe5dcaf69
[ "BSD-3-Clause" ]
3
2018-09-27T12:40:54.000Z
2019-10-31T20:58:49.000Z
src/Python/Test/__init__.py
ericwait/hydra-signal-processor
76cbbac389045e7b3f26344cabec5befe5dcaf69
[ "BSD-3-Clause" ]
4
2018-09-08T08:47:11.000Z
2020-01-19T11:57:26.000Z
# -*- coding: utf-8 -*- from Test.captureSnapshot import captureSnapshot
18.5
48
0.72973
8
74
6.75
0.875
0
0
0
0
0
0
0
0
0
0
0.015625
0.135135
74
3
49
24.666667
0.828125
0.283784
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
e88cd7516124ee23a2d3d6c1a989419d735689ed
159
py
Python
entity_embeddings/processor/__init__.py
awesome-archive/entity_embeddings_categorical
fcd5e11ed55587ffa1d05f23521c01f970f1aca0
[ "MIT" ]
41
2019-12-02T03:11:48.000Z
2021-04-19T02:02:18.000Z
entity_embeddings/processor/__init__.py
awesome-archive/entity_embeddings_categorical
fcd5e11ed55587ffa1d05f23521c01f970f1aca0
[ "MIT" ]
10
2020-01-28T22:37:22.000Z
2022-02-10T00:16:39.000Z
entity_embeddings/processor/__init__.py
awesome-archive/entity_embeddings_categorical
fcd5e11ed55587ffa1d05f23521c01f970f1aca0
[ "MIT" ]
10
2019-03-12T16:03:32.000Z
2019-11-05T01:27:05.000Z
from entity_embeddings.processor.processor import BinaryClassificationProcessor, MulticlassClassificationProcessor, \ RegressionProcessor, TargetProcessor
53
117
0.886792
10
159
14
0.9
0
0
0
0
0
0
0
0
0
0
0
0.075472
159
2
118
79.5
0.952381
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
e89e82ffb703e47141a2699e59e3acbdd65b329a
144
py
Python
plotly/validators/layout/xaxis/rangeselector/button/__init__.py
faezs/plotly.py
6009b5b9c746e5d2a2849ad255a4eb234b551ed7
[ "MIT" ]
1
2018-07-16T01:51:47.000Z
2018-07-16T01:51:47.000Z
plotly/validators/layout/xaxis/rangeselector/button/__init__.py
faezs/plotly.py
6009b5b9c746e5d2a2849ad255a4eb234b551ed7
[ "MIT" ]
null
null
null
plotly/validators/layout/xaxis/rangeselector/button/__init__.py
faezs/plotly.py
6009b5b9c746e5d2a2849ad255a4eb234b551ed7
[ "MIT" ]
null
null
null
from ._stepmode import StepmodeValidator from ._step import StepValidator from ._label import LabelValidator from ._count import CountValidator
28.8
40
0.861111
16
144
7.5
0.625
0
0
0
0
0
0
0
0
0
0
0
0.111111
144
4
41
36
0.9375
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
e8a5932cecf96798e43e5b5e2b1cb514adbf2c7a
72
py
Python
runtime/python/Lib/ctypes/test/__main__.py
hwaipy/InteractionFreeNode
88642b68430f57b028fd0f276a5709f89279e30d
[ "MIT" ]
207
2018-10-01T08:53:01.000Z
2022-03-14T12:15:54.000Z
Thonny/Lib/ctypes/test/__main__.py
Pydiderot/pydiderotIDE
a42fcde3ea837ae40c957469f5d87427e8ce46d3
[ "MIT" ]
30
2019-01-04T10:14:56.000Z
2020-10-12T14:00:31.000Z
Thonny/Lib/ctypes/test/__main__.py
Pydiderot/pydiderotIDE
a42fcde3ea837ae40c957469f5d87427e8ce46d3
[ "MIT" ]
76
2020-03-16T01:47:46.000Z
2022-03-21T16:37:07.000Z
from ctypes.test import load_tests import unittest unittest.main()
14.4
35
0.777778
10
72
5.5
0.8
0
0
0
0
0
0
0
0
0
0
0
0.166667
72
4
36
18
0.916667
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
2ce865b94f3e1ff230437fbc95db068cf2c1ba97
115
py
Python
Inheritance - Lab/project/sports_car.py
DiyanKalaydzhiev23/OOP---Python
7ac424d5fb08a6bd28dc36593e45d949b3ac0cd0
[ "MIT" ]
null
null
null
Inheritance - Lab/project/sports_car.py
DiyanKalaydzhiev23/OOP---Python
7ac424d5fb08a6bd28dc36593e45d949b3ac0cd0
[ "MIT" ]
null
null
null
Inheritance - Lab/project/sports_car.py
DiyanKalaydzhiev23/OOP---Python
7ac424d5fb08a6bd28dc36593e45d949b3ac0cd0
[ "MIT" ]
null
null
null
from project.car import Car class SportsCar(Car): @staticmethod def race(): return "racing..."
11.5
27
0.617391
13
115
5.461538
0.846154
0
0
0
0
0
0
0
0
0
0
0
0.269565
115
9
28
12.777778
0.845238
0
0
0
0
0
0.078947
0
0
0
0
0
0
1
0.2
true
0
0.2
0.2
0.8
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
1
1
0
0
5
fa3400e8f3c2c89ab7ca211d1cdac416de32b0e3
92
py
Python
examples/misc/flaskexamples/flaskcors/flask_source/run_flask_server.py
takipsizad/pyjs
54db0ba6747aca744f9f3c3e985a17e913dfb951
[ "ECL-2.0", "Apache-2.0" ]
739
2015-01-01T02:05:11.000Z
2022-03-30T15:26:16.000Z
examples/misc/flaskexamples/flaskcors/flask_source/run_flask_server.py
takipsizad/pyjs
54db0ba6747aca744f9f3c3e985a17e913dfb951
[ "ECL-2.0", "Apache-2.0" ]
33
2015-03-25T23:17:04.000Z
2021-08-19T08:25:22.000Z
examples/misc/flaskexamples/flaskcors/flask_source/run_flask_server.py
takipsizad/pyjs
54db0ba6747aca744f9f3c3e985a17e913dfb951
[ "ECL-2.0", "Apache-2.0" ]
167
2015-01-01T22:27:47.000Z
2022-03-17T13:29:19.000Z
from FlaskEchoApp import create_app application = create_app() application.run(debug=True)
18.4
35
0.826087
12
92
6.166667
0.75
0.243243
0.540541
0
0
0
0
0
0
0
0
0
0.097826
92
4
36
23
0.891566
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
fa3ea2e9b8e145e69e18da38728929fc8ebeae30
123
py
Python
apps/Cases/admin.py
steve-njuguna-k/Kenya-ePolice
561c33de242acf7f1d02af6395913a4a389b427f
[ "MIT" ]
1
2022-02-26T20:15:33.000Z
2022-02-26T20:15:33.000Z
apps/Cases/admin.py
steve-njuguna-k/Kenya-ePolice
561c33de242acf7f1d02af6395913a4a389b427f
[ "MIT" ]
null
null
null
apps/Cases/admin.py
steve-njuguna-k/Kenya-ePolice
561c33de242acf7f1d02af6395913a4a389b427f
[ "MIT" ]
null
null
null
from django.contrib import admin from apps.Cases.models import Case # Register your models here. admin.site.register(Case)
24.6
34
0.813008
19
123
5.263158
0.684211
0
0
0
0
0
0
0
0
0
0
0
0.113821
123
5
35
24.6
0.917431
0.211382
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
fa5b1f342b90498ab489b0f1ab7a42247e1286be
164
py
Python
components/server/src/initialization/__init__.py
Hedde/quality-time
bfbdb2c43d7883abaf54999411aa4ac4897e9043
[ "Apache-2.0" ]
null
null
null
components/server/src/initialization/__init__.py
Hedde/quality-time
bfbdb2c43d7883abaf54999411aa4ac4897e9043
[ "Apache-2.0" ]
null
null
null
components/server/src/initialization/__init__.py
Hedde/quality-time
bfbdb2c43d7883abaf54999411aa4ac4897e9043
[ "Apache-2.0" ]
null
null
null
"""Initialization functions for bottle, the database, and LDAP.""" from .database import init_database from .ldap import init_ldap from .bottle import init_bottle
27.333333
66
0.79878
23
164
5.565217
0.478261
0.234375
0
0
0
0
0
0
0
0
0
0
0.128049
164
5
67
32.8
0.895105
0.365854
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5