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
ba01fa0a52b489962a736d36092f48f17a3d2800
51
py
Python
1-Machine-Learning/0-Basic-Knowledge/Math-Knowledge/GMM.py
yzy1996/Artificial-Intelligence
30a9a2ce1602b9fa9be5981e98885c1c4244cbbd
[ "MIT" ]
7
2019-11-09T02:55:35.000Z
2021-08-16T12:43:44.000Z
4-Archived/Knowledge/GMM.py
yzy1996/Machine-Learning
67c58ee5603fe25d789b3c4b3fa3929c5ac82c1f
[ "MIT" ]
3
2020-10-13T03:12:03.000Z
2021-03-21T09:03:02.000Z
4-Archived/Knowledge/GMM.py
yzy1996/Machine-Learning
67c58ee5603fe25d789b3c4b3fa3929c5ac82c1f
[ "MIT" ]
6
2020-06-07T08:14:15.000Z
2021-08-02T09:04:31.000Z
''' 混合高斯模型 使用多个高斯模型来拟合数据分布 ''' import numpy as np
7.285714
18
0.705882
6
51
6
1
0
0
0
0
0
0
0
0
0
0
0
0.176471
51
6
19
8.5
0.857143
0.431373
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
0
0
0
4
ba03c7612f86df91d7ee18658bef4eedbec16d11
49
py
Python
servers/__init__.py
shubhamdipt/monitoring-dashboard
ae4524f1c179cf735fdc17673865bdbdb463ee3e
[ "MIT" ]
1
2021-08-08T14:40:09.000Z
2021-08-08T14:40:09.000Z
servers/__init__.py
shubhamdipt/monitoring-dashboard
ae4524f1c179cf735fdc17673865bdbdb463ee3e
[ "MIT" ]
null
null
null
servers/__init__.py
shubhamdipt/monitoring-dashboard
ae4524f1c179cf735fdc17673865bdbdb463ee3e
[ "MIT" ]
null
null
null
default_app_config = 'servers.apps.ServersConfig'
49
49
0.857143
6
49
6.666667
1
0
0
0
0
0
0
0
0
0
0
0
0.040816
49
1
49
49
0.851064
0
0
0
0
0
0.52
0.52
0
0
0
0
0
1
0
false
0
0
0
0
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
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
ba0ad8ee524c81c0738f3b1a9b9dc55e45851dd6
257
py
Python
spikey/core/__init__.py
SpikeyCNS/spikey
03a49073491974eff01bc017fd8eadb822e13f0d
[ "MIT" ]
4
2021-02-25T20:53:41.000Z
2022-01-18T15:27:07.000Z
spikey/core/__init__.py
SpikeyCNS/spikey
03a49073491974eff01bc017fd8eadb822e13f0d
[ "MIT" ]
5
2021-03-06T05:35:10.000Z
2021-03-31T09:27:57.000Z
spikey/core/__init__.py
SpikeyCNS/spikey
03a49073491974eff01bc017fd8eadb822e13f0d
[ "MIT" ]
null
null
null
""" Core __init__. """ try: from spikey.core.callback import ExperimentCallback, RLCallback, TDCallback from spikey.core.training_loop import TrainingLoop, GenericLoop except ImportError as e: raise ImportError(f"core/__init__.py failed: {e}")
25.7
79
0.758755
31
257
6
0.709677
0.086022
0.150538
0
0
0
0
0
0
0
0
0
0.143969
257
9
80
28.555556
0.845455
0.054475
0
0
0
0
0.119149
0
0
0
0
0
0
1
0
true
0
0.8
0
0.8
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
0
1
0
1
0
0
4
e84d152037bd2e3dced364c3e47b92c7a6bfda36
210
py
Python
tests/test_utils.py
szarnyasg/pygraphblas
7465ef6fcc77c9901869b70ddf1d77a86570c336
[ "Apache-2.0" ]
null
null
null
tests/test_utils.py
szarnyasg/pygraphblas
7465ef6fcc77c9901869b70ddf1d77a86570c336
[ "Apache-2.0" ]
null
null
null
tests/test_utils.py
szarnyasg/pygraphblas
7465ef6fcc77c9901869b70ddf1d77a86570c336
[ "Apache-2.0" ]
null
null
null
from pygraphblas import * def test_add_identity(): A = Matrix.sparse(INT8, 10, 10) assert add_identity(A) == 10 A = Matrix.sparse(INT8, 10, 10) A[5,5] = 42 assert add_identity(A) == 9
21
35
0.614286
33
210
3.787879
0.484848
0.264
0.288
0.272
0.336
0.336
0
0
0
0
0
0.10828
0.252381
210
9
36
23.333333
0.687898
0
0
0.285714
0
0
0
0
0
0
0
0
0.285714
1
0.142857
false
0
0.142857
0
0.285714
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
0
0
0
0
0
4
e8569d7c3bbbd06495a3be7b58b262f1f38b3a3d
1,518
py
Python
lib/environment/shape.py
vyahello/snakegame-gui
1eb23744174035f49dd0a33c48d365e8b3836178
[ "MIT" ]
null
null
null
lib/environment/shape.py
vyahello/snakegame-gui
1eb23744174035f49dd0a33c48d365e8b3836178
[ "MIT" ]
null
null
null
lib/environment/shape.py
vyahello/snakegame-gui
1eb23744174035f49dd0a33c48d365e8b3836178
[ "MIT" ]
null
null
null
from abc import ABC, abstractmethod from typing import Tuple, Iterable, Any from pygame.rect import Rect class Shape(ABC): """Abstract shape interface.""" @abstractmethod def shape(self) -> Any: pass @abstractmethod def top_left(self) -> Tuple: pass @abstractmethod def top_right(self) -> Iterable: pass @abstractmethod def size(self) -> Tuple: pass @abstractmethod def bottom_right(self) -> Iterable: pass @abstractmethod def bottom_left(self) -> Iterable: pass @abstractmethod def inflate(self, x: int, y: int) -> Rect: pass class Rectangle(Shape): """Rectangle shape.""" def __init__(self, position: Iterable) -> None: self._shape: Rect = Rect(position) self._top_left: Tuple = (0, 0) def shape(self) -> Any: return self._shape @property def top_left(self) -> Tuple: return self._top_left @top_left.setter def top_left(self, position: Tuple) -> None: self._top_left = position @property def top_right(self) -> Iterable: return self._shape.topright @property def bottom_left(self) -> Iterable: return self._shape.bottomleft @property def bottom_right(self) -> Iterable: return self._shape.bottomright @property def size(self) -> Tuple: return self._shape.size def inflate(self, x: int, y: int) -> Rect: return self._shape.inflate(x, y)
20.513514
51
0.614625
178
1,518
5.089888
0.207865
0.131347
0.139073
0.046358
0.424945
0.211921
0.057395
0.057395
0
0
0
0.001833
0.281291
1,518
73
52
20.794521
0.828598
0.027668
0
0.647059
0
0
0
0
0
0
0
0
0
1
0.313725
false
0.137255
0.058824
0.137255
0.54902
0
0
0
0
null
0
0
0
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
1
1
0
0
4
e8817a9d7c1201faed352ef258a2c751aff02a0a
88
py
Python
run.py
tildecross/tildex-txdb
bc32e1875c55cedfbf4ce7d00174b4b7bf68525f
[ "BSD-3-Clause" ]
null
null
null
run.py
tildecross/tildex-txdb
bc32e1875c55cedfbf4ce7d00174b4b7bf68525f
[ "BSD-3-Clause" ]
1
2017-10-15T01:11:11.000Z
2019-10-18T20:02:32.000Z
run.py
tildecross/tildex-txdb
bc32e1875c55cedfbf4ce7d00174b4b7bf68525f
[ "BSD-3-Clause" ]
null
null
null
#!env/bin/python3 from app import app app.run(debug=True, host="localhost", port=8202)
17.6
48
0.738636
15
88
4.333333
0.866667
0
0
0
0
0
0
0
0
0
0
0.063291
0.102273
88
4
49
22
0.759494
0.181818
0
0
0
0
0.126761
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
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
0
0
0
4
e89d13c3f0f4c6c26ca619df2f3d4497d8221a2b
76
py
Python
utils/__init__.py
MaLiN2223/py_proj_transport
4e0ee156ef4b42ddb5e0971ca0603b39b0796785
[ "MIT" ]
null
null
null
utils/__init__.py
MaLiN2223/py_proj_transport
4e0ee156ef4b42ddb5e0971ca0603b39b0796785
[ "MIT" ]
null
null
null
utils/__init__.py
MaLiN2223/py_proj_transport
4e0ee156ef4b42ddb5e0971ca0603b39b0796785
[ "MIT" ]
null
null
null
""" This module contains utility classes and methods to be used in tests """
25.333333
68
0.75
12
76
4.75
1
0
0
0
0
0
0
0
0
0
0
0
0.171053
76
3
69
25.333333
0.904762
0.894737
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
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
4
e8c2719a32612a325b383c39169bc8d4bf73f6f4
125
py
Python
mercury/plugin/smart_grid/__init__.py
greenlsi/mercury_mso_framework
8b9639e5cb4b2c526a65861c93a9fe9db2460ea4
[ "Apache-2.0" ]
1
2020-07-21T11:22:39.000Z
2020-07-21T11:22:39.000Z
mercury/plugin/smart_grid/__init__.py
greenlsi/mercury_mso_framework
8b9639e5cb4b2c526a65861c93a9fe9db2460ea4
[ "Apache-2.0" ]
2
2021-08-25T16:09:58.000Z
2022-02-10T02:21:03.000Z
mercury/plugin/smart_grid/__init__.py
greenlsi/mercury_mso_framework
8b9639e5cb4b2c526a65861c93a9fe9db2460ea4
[ "Apache-2.0" ]
1
2021-02-24T15:54:09.000Z
2021-02-24T15:54:09.000Z
from .provider import EnergyProvider from .pwr_source import PowerSource from .consumption_manager import ConsumptionManager
31.25
51
0.88
14
125
7.714286
0.714286
0
0
0
0
0
0
0
0
0
0
0
0.096
125
3
52
41.666667
0.955752
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
0
0
0
4
e8ccfb7cc77d87449e215a705b8af7a4549c6e04
15,854
py
Python
selfdrive/car/hyundai/values.py
agegold/OPKR080
3a12e00f4f0b95be9cd19d10f34eab1823b72252
[ "MIT" ]
null
null
null
selfdrive/car/hyundai/values.py
agegold/OPKR080
3a12e00f4f0b95be9cd19d10f34eab1823b72252
[ "MIT" ]
null
null
null
selfdrive/car/hyundai/values.py
agegold/OPKR080
3a12e00f4f0b95be9cd19d10f34eab1823b72252
[ "MIT" ]
2
2021-01-19T15:45:57.000Z
2021-01-19T15:54:18.000Z
# flake8: noqa from cereal import car from selfdrive.car import dbc_dict from common.params import Params Ecu = car.CarParams.Ecu # Steer torque limits class SteerLimitParams: params = Params() STEER_MAX = int(params.get('SteerMaxAdj')) # 409 is the max, 255 is stock STEER_DELTA_UP = int(params.get('SteerDeltaUpAdj')) STEER_DELTA_DOWN = int(params.get('SteerDeltaDownAdj')) STEER_DRIVER_ALLOWANCE = 50 STEER_DRIVER_MULTIPLIER = 2 STEER_DRIVER_FACTOR = 1 class CAR: # genesis GENESIS = "GENESIS 2015-2016" GENESIS_G70 = "GENESIS G70 2018" GENESIS_G80 = "GENESIS G80 2017" GENESIS_G90 = "GENESIS G90 2017" # hyundai ELANTRA = "HYUNDAI ELANTRA LIMITED ULTIMATE 2017" ELANTRA_GT_I30 = "HYUNDAI I30 N LINE 2019 & GT 2018 DCT" SONATA = "HYUNDAI SONATA 2020" SONATA_HEV = "HYUNDAI SONATA HEV 2020" SONATA19 = "HYUNDAI SONATA 2019" SONATA19_HEV = "HYUNDAI SONATA 2019 HEV" KONA = "HYUNDAI KONA 2019" KONA_EV = "HYUNDAI KONA EV 2019" KONA_HEV = "HYUNDAI KONA HEV 2019" IONIQ_EV = "HYUNDAI IONIQ ELECTRIC LIMITED 2019" IONIQ_HEV = "HYUNDAI IONIQ HYBRID PREMIUM 2017" SANTA_FE = "HYUNDAI SANTA FE LIMITED 2019" PALISADE = "HYUNDAI PALISADE 2020" VELOSTER = "HYUNDAI VELOSTER 2019" GRANDEUR = "GRANDEUR IG 2017-2020" GRANDEUR_HEV = "GRANDEUR IG HEV 2019-2020" NEXO = "HYUNDAI NEXO" # kia FORTE = "KIA FORTE E 2018" OPTIMA = "KIA OPTIMA SX 2019 & 2016" OPTIMA_HEV = "KIA OPTIMA HYBRID 2017 & SPORTS 2019" SPORTAGE = "KIA SPORTAGE S 2020" SORENTO = "KIA SORENTO GT LINE 2018" STINGER = "KIA STINGER GT2 2018" NIRO_EV = "KIA NIRO EV 2020 PLATINUM" NIRO_HEV = "KIA NIRO HEV 2018" CEED = "KIA CEED 2019" CADENZA = "KIA K7 2016-2019" CADENZA_HEV = "KIA K7 HEV 2016-2019" class Buttons: NONE = 0 RES_ACCEL = 1 SET_DECEL = 2 GAP_DIST = 3 CANCEL = 4 params = Params() fingerprint_issued_fix = params.get('FingerprintIssuedFix') == "1" if fingerprint_issued_fix: # 핑거인식문제 혹은 다른차량과 핑거프린트 충돌이 나는경우 여기다가 핑거를 넣으시고 개발자 메뉴에서 핑거프린트 이슈차량 전용을 켜면 적용됩니다. FINGERPRINTS = { # genesis CAR.GENESIS: [{}], CAR.GENESIS_G70: [{}], CAR.GENESIS_G80: [{}], CAR.GENESIS_G90: [{}], # hyundai CAR.ELANTRA: [{}], CAR.ELANTRA_GT_I30: [{}], CAR.SONATA: [{}], CAR.SONATA_HEV: [{}], CAR.SONATA19: [{}], CAR.SONATA19_HEV: [{}], CAR.KONA: [{}], CAR.KONA_EV: [{}], CAR.KONA_HEV: [{}], CAR.IONIQ_HEV: [{}], CAR.IONIQ_EV: [{}], CAR.SANTA_FE: [{}], CAR.PALISADE: [{}], CAR.VELOSTER: [{}], CAR.GRANDEUR: [{}], CAR.GRANDEUR_HEV: [{}], CAR.NEXO: [{}], # kia CAR.FORTE: [{}], CAR.OPTIMA: [{}], CAR.OPTIMA_HEV: [{}], CAR.SPORTAGE: [{}], CAR.SORENTO: [{}], CAR.STINGER: [{}], CAR.NIRO_EV: [{}], CAR.NIRO_HEV: [{}], CAR.CEED: [{}], CAR.CADENZA: [{}], CAR.CADENZA_HEV: [{}] } else: # 핑거 프린트 이슈 없는 차량은 이곳에 넣으세요. FINGERPRINTS = { # genesis CAR.GENESIS: [{}], CAR.GENESIS_G70: [{}], CAR.GENESIS_G80: [{}], CAR.GENESIS_G90: [{}], # hyundai CAR.ELANTRA: [{}], CAR.ELANTRA_GT_I30: [{}], CAR.SONATA: [{}], CAR.SONATA_HEV: [{}], CAR.SONATA19: [{}], CAR.SONATA19_HEV: [{}], CAR.KONA: [{}], CAR.KONA_EV: [{}], CAR.KONA_HEV: [{}], CAR.IONIQ_HEV: [{68: 8, 127: 8, 304: 8, 320: 8, 339: 8, 352: 8, 356: 4, 544: 8, 576: 8, 593: 8, 688: 5, 881: 8, 882: 8, 897: 8, 902: 8, 903: 8, 916: 8, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1136: 6, 1173: 8, 1225: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1291: 8, 1292: 8, 1294: 8, 1322: 8, 1345: 8, 1348: 8, 1355: 8, 1363: 8, 1369: 8, 1407: 8, 1419: 8, 1427: 6, 1429: 8, 1430: 8, 1448: 8, 1456: 4, 1470:8, 1476: 8, 1535: 8}, {68: 8, 127: 8, 304: 8, 320: 8, 339: 8, 352: 8, 356: 4, 544: 8, 576:8, 593: 8, 688: 5, 832: 8, 881: 8, 882: 8, 897: 8, 902: 8, 903: 8, 916: 8, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1136: 6, 1173: 8, 1225: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1291: 8, 1292: 8, 1294: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1355: 8, 1363: 8, 1369: 8, 1407: 8, 1427: 6, 1429: 8, 1430: 8, 1448: 8, 1456: 4, 1470: 8, 1476: 8, 1535: 8}, {68: 8, 127: 8, 304: 8, 320: 8, 339: 8, 352: 8, 544: 8, 576: 8, 832: 8, 881: 8, 882: 8, 902: 8, 903: 8, 916: 8, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1136: 6, 1173: 8, 1225: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1291: 8, 1292: 8, 1294: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1355: 8, 1363: 8, 1369: 8, 1407: 8, 1427: 6, 1429: 8, 1430: 8, 1448: 8, 1456: 4, 1470: 8, 1476: 8, 1535: 8}], CAR.IONIQ_EV: [{127: 8, 304: 8, 320: 8, 339: 8, 352: 8, 356: 4, 544: 7, 593: 8, 688: 5, 832: 8, 881: 8, 882: 8, 897: 8, 902: 8, 903: 8, 916: 8, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1136: 8, 1151: 6, 1168: 7, 1173: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1291: 8, 1292: 8, 1294: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1355: 8, 1363: 8, 1369: 8, 1407: 8, 1419: 8, 1425: 2, 1426: 8, 1427: 6, 1429: 8, 1430: 8, 1456: 4, 1470: 8, 1507: 8, 1535: 8}, {127: 8, 304: 8, 320: 8, 339: 8, 352: 8, 356: 4, 544: 7, 545: 8, 546: 8, 548: 8, 549: 8, 593: 8, 688: 5, 832: 8, 881: 8, 882: 8, 897: 8, 902: 8, 903: 8, 916: 8, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1136: 8, 1151: 6, 1168: 7, 1173: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1291: 8, 1292: 8, 1294: 8, 1322: 8, 1345: 8, 1348: 8, 1355: 8, 1363: 8, 1369: 8, 1407: 8, 1419: 8, 1426: 8, 1427: 6, 1429: 8, 1430: 8, 1456: 4, 1470: 8, 1507: 8, 1535: 8}, {127: 8, 304: 8, 320: 8, 339: 8, 352: 8, 356: 4, 544: 7, 546: 8, 832: 8, 881: 8, 882: 8, 902: 8, 903: 8, 916: 8, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1136: 8, 1151: 6, 1168: 7, 1173: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1291: 8, 1292: 8, 1294: 8, 1322: 8, 1345: 8, 1348: 8, 1355: 8, 1363: 8, 1369: 8, 1407: 8, 1419: 8, 1426: 8, 1427: 6, 1429: 8, 1430: 8, 1456: 4, 1470: 8, 1507: 8}], CAR.SANTA_FE: [{}], CAR.PALISADE: [{}], CAR.VELOSTER: [{}], CAR.GRANDEUR: [{67: 8, 68: 8, 127: 8, 304: 8, 320: 8, 339: 8, 356: 4, 516: 8, 524: 8, 528: 8, 532: 8, 544: 8, 576: 8, 593: 8, 608: 8, 688: 5, 809: 8, 832: 8, 854: 8, 870: 7, 871: 8, 872: 8, 897: 8, 902: 8, 903: 8, 905: 8, 909: 8, 913: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1078: 4, 1107: 5, 1136: 8, 1151: 8, 1155: 8, 1156: 8, 1157: 4, 1162: 8, 1164: 8, 1168: 8, 1170: 8, 1173: 8, 1180: 8, 1186: 2, 1191: 2, 1193: 8, 1210: 8, 1225: 8, 1227: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1342: 8, 1345: 8, 1348: 8, 1363: 8, 1369: 8, 1371: 8, 1378: 8, 1384: 8, 1407: 8, 1419: 8, 1427: 6, 1456: 4, 1470: 8},{ 67: 8, 68: 8, 127: 8, 304: 8, 320: 8, 339: 8, 356: 4, 544: 8, 593: 8, 608: 8, 688: 5, 809: 8, 854 : 7, 870: 7, 871: 8, 872: 8, 897: 8, 902: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1078: 4, 1136: 8 , 1151: 6, 1162: 4, 1168: 7, 1170: 8, 1173: 8, 1185: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312 : 8, 1322: 8, 1345: 8, 1348: 8, 1363: 8, 1369: 8, 1371: 8, 1378: 4, 1384: 8, 1407: 8, 1419: 8, 1425: 2, 1427: 6 , 1456: 4, 1470: 8},{ 67: 8, 68: 8, 127: 8, 304: 8, 320: 8, 339: 8, 356: 4, 544: 8, 546: 8, 547: 8, 549: 8, 593: 8, 608: 8, 688: 5, 809: 8, 832: 8, 854: 7, 870: 7, 871: 8, 872: 8, 897: 8, 902: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1078: 4, 1136: 8, 1151: 6, 1156: 8, 1157: 4, 1162: 4, 1168: 7, 1170: 8, 1173: 8, 1185: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1363: 8, 1369: 8, 1384: 8, 1407: 8, 1419: 8, 1427: 6, 1456: 4, 1470: 8},{ 67: 8, 68: 8, 127: 8, 304: 8, 320: 8, 339: 8, 356: 4, 544: 8, 546: 8, 593: 8, 608: 8, 688: 5, 809: 8, 832: 8, 854: 7, 870: 7, 871: 8, 872: 8, 897: 8, 902: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1078: 4, 1136: 8, 1151: 6, 1156: 8, 1157: 4, 1162: 4, 1168: 7, 1170: 8, 1173: 8, 1185: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1363: 8, 1369: 8, 1371: 8, 1378: 4, 1384: 8, 1407: 8, 1419: 8, 1425: 2, 1427: 6, 1456: 4, 1470: 8},{ 67: 8, 68: 8, 127: 8, 304: 8, 320: 8, 339: 8, 356: 4, 544: 8, 593: 8, 608: 8, 688: 5, 809: 8, 832: 8, 854: 7, 870: 7, 871: 8, 872: 8, 897: 8, 902: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1078: 4, 1136: 8, 1151: 6, 1156: 8, 1157: 4, 1162: 4, 1168: 7, 1170: 8, 1173: 8, 1185: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1363: 8, 1369: 8, 1371: 8, 1378: 4, 1384: 8, 1407: 8, 1419: 8, 1425: 2, 1427: 6, 1456: 4, 1470: 8},{ 67: 8, 68: 8, 127: 8, 304: 8, 320: 8, 339: 8, 356: 4, 544: 8, 593: 8, 608: 8, 688: 5, 809: 8, 832: 8, 854: 7, 870: 7, 871: 8, 872: 8, 897: 8, 902: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1078: 4, 1136: 8, 1151: 6, 1156: 8, 1162: 4, 1168: 7, 1170: 8, 1173: 8, 1185: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1363: 8, 1369: 8, 1371: 8, 1378: 4, 1384: 8, 1407: 8, 1419: 8, 1425: 2, 1427: 6, 1456: 4, 1470: 8}], CAR.GRANDEUR_HEV: [{68: 8, 127: 8, 304: 8, 320: 8, 339: 8, 352: 8, 356: 4, 544: 8, 546: 8, 576: 8, 593: 8, 688: 5, 832: 8, 881: 8, 882: 8, 897: 8, 902: 8, 903: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1078: 4, 1136: 6, 1151: 6, 1156: 8, 1157: 4, 1168: 7, 1173: 8, 1185: 8, 1225: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1291: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1355: 8, 1363: 8, 1369: 8, 1371: 8, 1378: 4, 1407: 8, 1419: 8, 1425: 2, 1427: 6, 1429: 8, 1430: 8, 1448: 8, 1456: 4, 1470: 8, 1476: 8, 1535: 8},{ 127: 8, 304: 8, 320: 8, 339: 8, 352: 8, 356: 4, 544: 8, 576: 8, 593: 8, 688: 5, 832: 8, 865: 8, 881: 8, 882: 8, 897: 8, 902: 8, 903: 8, 905: 8, 909: 8, 913: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1078: 4, 1108: 8, 1136: 6, 1138: 5, 1151: 8, 1155: 8, 1156: 8, 1157: 4, 1162: 8, 1164: 8, 1168: 8, 1173: 8, 1180: 8, 1186: 2, 1191: 2, 1193: 8, 1210: 8, 1225: 8, 1227: 8, 1265: 4, 1268: 8, 1280: 1, 1287: 4, 1290: 8, 1291: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1342: 8, 1345: 8, 1348: 8, 1355: 8, 1363: 8, 1369: 8, 1371: 8, 1378: 8, 1407: 8, 1419: 8, 1427: 6, 1429: 8, 1430: 8, 1448: 8, 1456: 4, 1470: 8, 1476: 8, 1535: 8},{ 127: 8, 304: 8, 320: 8, 339: 8, 352: 8, 356: 4, 516: 8, 544: 8, 576: 8, 593: 8, 688: 5, 832: 8, 865: 8, 881: 8, 882: 8, 897: 8, 902: 8, 903: 8, 905: 8, 909: 8, 913: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1078: 4, 1108: 8, 1136: 6, 1138: 5, 1151: 8, 1155: 8, 1156: 8, 1157: 4, 1162: 8, 1164: 8, 1168: 8, 1173: 8, 1180: 8, 1186: 2, 1191: 2, 1193: 8, 1210: 8, 1225: 8, 1227: 8, 1265: 4, 1268: 8, 1280: 1, 1287: 4, 1290: 8, 1291: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1342: 8, 1345: 8, 1348: 8, 1355: 8, 1363: 8, 1369: 8, 1371: 8, 1378: 8, 1407: 8, 1419: 8, 1427: 6, 1429: 8, 1430: 8, 1448: 8, 1456: 4, 1470: 8, 1476: 8, 1535: 8},{ 68: 8, 127: 8, 304: 8, 320: 8, 339: 8, 352: 8, 356: 4, 544: 8, 546: 8, 576: 8, 593: 8, 688: 5, 832: 8, 881: 8, 882: 8, 897: 8, 902: 8, 903: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1078: 4, 1136: 6, 1151: 6, 1156: 8, 1157: 4, 1168: 7, 1173: 8, 1185: 8, 1225: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1291: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1355: 8, 1363: 8, 1369: 8, 1379: 8, 1407: 8, 1419: 8, 1425: 2, 1427: 6, 1429: 8, 1430: 8, 1448: 8, 1456: 4, 1470: 8, 1476: 8, 1535: 8}], CAR.NEXO: [{}], # kia CAR.FORTE: [{}], CAR.OPTIMA: [{}], CAR.OPTIMA_HEV: [{}], CAR.SPORTAGE: [{}], CAR.SORENTO: [{}], CAR.STINGER: [{}], CAR.NIRO_EV: [{}], CAR.NIRO_HEV: [{}], CAR.CEED: [{}], CAR.CADENZA: [{}], CAR.CADENZA_HEV: [{}] } # Don't use these fingerprints for fingerprinting, they are still used for ECU detection IGNORED_FINGERPRINTS = [CAR.VELOSTER, CAR.GENESIS_G70, CAR.KONA] CHECKSUM = { "crc8": [CAR.SANTA_FE, CAR.SONATA, CAR.PALISADE, CAR.SONATA_HEV], "6B": [CAR.SORENTO, CAR.GENESIS], } FEATURES = { # 캔오류 관련, 오류가 발생하는 경우는 본인 차종에 맞지 않는 캔신호가 들어오기때문입니다. 대부분 이곳을 수정하면 해결되나, 부득이 판다코드를 수정해야 될수도 있습니다. # debug 코드가 포함되어 있으면, /data/openpilot/selfdrive/debug 안에 몇가지 툴이 들어있습니다. 실행하시면 디버그에 도움이 되실겁니다. 팟팅!!! # Use Cluster for Gear Selection, rather than Transmission "use_cluster_gears": {CAR.ELANTRA, CAR.KONA, CAR.ELANTRA_GT_I30, CAR.CADENZA, CAR.GRANDEUR}, # Use TCU Message for Gear Selection "use_tcu_gears": {CAR.OPTIMA, CAR.SONATA19, CAR.VELOSTER}, # Use E_GEAR Message for Gear Selection "use_elect_gears": {CAR.SONATA_HEV, CAR.SONATA19_HEV, CAR.KONA_EV, CAR.KONA_HEV, CAR.IONIQ_EV, CAR.IONIQ_HEV, CAR.GRANDEUR_HEV, CAR.NEXO, CAR.OPTIMA_HEV, CAR.CADENZA_HEV, CAR.NIRO_EV, CAR.NIRO_HEV}, # 전기차 or 하이브리드 기어인식 부분 # Use E_EMS11 Message for Gas and Brake for Hybrid/ELectric "use_elect_ems": {CAR.SONATA_HEV, CAR.SONATA19_HEV, CAR.KONA_EV, CAR.KONA_HEV, CAR.IONIQ_EV, CAR.IONIQ_HEV, CAR.GRANDEUR_HEV, CAR.NEXO, CAR.OPTIMA_HEV, CAR.CADENZA_HEV, CAR.NIRO_EV, CAR.NIRO_HEV}, # 전기차 or 하이브리드 차량 넣어주세요.(가속페달관련) # send LFA MFA message for new HKG models "send_lfa_mfa": {CAR.GRANDEUR_HEV, CAR.GRANDEUR, CAR.KONA_HEV}, #차량의 LFA아이콘(핸들모양 아이콘)을 켜지게 하려면 여기다가 본인 차종을 넣으세요. "has_scc13": set([]), "has_scc14": set([]), # these cars use the FCA11 message for the AEB and FCW signals, all others use SCC12 "use_fca": {CAR.SONATA, CAR.ELANTRA, CAR.ELANTRA_GT_I30, CAR.PALISADE, CAR.GENESIS_G70, CAR.GRANDEUR_HEV, CAR.KONA_HEV}, # 전방추돌관련 계기판 오류가 발생할 경우 여기다 본인 차종을 넣어보세요. "use_bsm": {CAR.SONATA, CAR.PALISADE, CAR.GENESIS, CAR.GENESIS_G70, CAR.GENESIS_G80, CAR.GENESIS_G90, CAR.NEXO, CAR.KONA, CAR.SONATA_HEV, CAR.SONATA19_HEV, CAR.KONA_EV, CAR.KONA_HEV, CAR.IONIQ_EV, CAR.IONIQ_HEV, CAR.GRANDEUR_HEV, CAR.OPTIMA_HEV, CAR.CADENZA_HEV, CAR.NIRO_EV, CAR.NIRO_HEV, CAR.ELANTRA, CAR.KONA, CAR.ELANTRA_GT_I30, CAR.CADENZA, CAR.GRANDEUR, CAR.OPTIMA, CAR.SONATA19, CAR.VELOSTER}, #후측방 감지 BSM 옵션이 있는 차량의 경우 넣어주세요. } DBC = { # genesis CAR.GENESIS: dbc_dict('hyundai_kia_generic', None), CAR.GENESIS_G70: dbc_dict('hyundai_kia_generic', None), CAR.GENESIS_G80: dbc_dict('hyundai_kia_generic', None), CAR.GENESIS_G90: dbc_dict('hyundai_kia_generic', None), # hyundai CAR.ELANTRA: dbc_dict('hyundai_kia_generic', None), CAR.ELANTRA_GT_I30: dbc_dict('hyundai_kia_generic', None), CAR.SONATA: dbc_dict('hyundai_kia_generic', None), CAR.SONATA_HEV: dbc_dict('hyundai_kia_generic', None), CAR.SONATA19: dbc_dict('hyundai_kia_generic', None), CAR.SONATA19_HEV: dbc_dict('hyundai_kia_generic', None), CAR.KONA: dbc_dict('hyundai_kia_generic', None), CAR.KONA_EV: dbc_dict('hyundai_kia_generic', None), CAR.KONA_HEV: dbc_dict('hyundai_kia_generic', None), CAR.IONIQ_EV: dbc_dict('hyundai_kia_generic', None), CAR.IONIQ_HEV: dbc_dict('hyundai_kia_generic', None), CAR.SANTA_FE: dbc_dict('hyundai_kia_generic', None), CAR.PALISADE: dbc_dict('hyundai_kia_generic', None), CAR.VELOSTER: dbc_dict('hyundai_kia_generic', None), CAR.GRANDEUR: dbc_dict('hyundai_kia_generic', None), CAR.GRANDEUR_HEV: dbc_dict('hyundai_kia_generic', None), CAR.NEXO: dbc_dict('hyundai_kia_generic', None), # kia CAR.FORTE: dbc_dict('hyundai_kia_generic', None), CAR.OPTIMA: dbc_dict('hyundai_kia_generic', None), CAR.OPTIMA_HEV: dbc_dict('hyundai_kia_generic', None), CAR.SPORTAGE: dbc_dict('hyundai_kia_generic', None), CAR.SORENTO: dbc_dict('hyundai_kia_generic', None), CAR.STINGER: dbc_dict('hyundai_kia_generic', None), CAR.NIRO_EV: dbc_dict('hyundai_kia_generic', None), CAR.NIRO_HEV: dbc_dict('hyundai_kia_generic', None), CAR.CEED: dbc_dict('hyundai_kia_generic', None), CAR.CADENZA: dbc_dict('hyundai_kia_generic', None), CAR.CADENZA_HEV: dbc_dict('hyundai_kia_generic', None), } STEER_THRESHOLD = 150
70.150442
656
0.595055
2,929
15,854
3.1352
0.118129
0.023522
0.048786
0.05924
0.730045
0.71469
0.70184
0.677012
0.579876
0.570293
0
0.356573
0.217421
15,854
225
657
70.462222
0.383574
0.063706
0
0.324607
0
0
0.100527
0
0
0
0
0
0
1
0
false
0
0.015707
0
0.26178
0.010471
0
0
0
null
0
0
0
0
1
1
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
2cdf4d07ac3dc5fe02900f164bcf1938199e4ed3
254
py
Python
Beginner/Day6/utilitiesmodule.py
vishipayyallore/LearningPython_2019
f72d5af61ad96721442b7ebfc33518c2a879eb64
[ "MIT" ]
null
null
null
Beginner/Day6/utilitiesmodule.py
vishipayyallore/LearningPython_2019
f72d5af61ad96721442b7ebfc33518c2a879eb64
[ "MIT" ]
null
null
null
Beginner/Day6/utilitiesmodule.py
vishipayyallore/LearningPython_2019
f72d5af61ad96721442b7ebfc33518c2a879eb64
[ "MIT" ]
null
null
null
def banner(message, length, header='=', footer='*'): print() print(header * length) print((' ' * (length//2 - len(message)//2)), message) print(footer * length) def banner_v2(length, footer='-'): print(footer * length) print()
21.166667
57
0.586614
29
254
5.103448
0.344828
0.121622
0.22973
0
0
0
0
0
0
0
0
0.014925
0.208661
254
11
58
23.090909
0.721393
0
0
0.5
0
0
0.01581
0
0
0
0
0
0
1
0.25
false
0
0
0
0.25
0.75
1
0
0
null
0
1
0
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
0
0
1
0
4
2cf62110e3ab8800a99fcb288cf2cfd2fa6ffec9
141
py
Python
Codewars/you're a square/you're a square.py
adoreblvnk/code_solutions
03e4261241dd33a4232dabe0e9450d344f7ccc6d
[ "MIT" ]
null
null
null
Codewars/you're a square/you're a square.py
adoreblvnk/code_solutions
03e4261241dd33a4232dabe0e9450d344f7ccc6d
[ "MIT" ]
null
null
null
Codewars/you're a square/you're a square.py
adoreblvnk/code_solutions
03e4261241dd33a4232dabe0e9450d344f7ccc6d
[ "MIT" ]
null
null
null
from math import isqrt is_square = lambda n: isqrt(n) ** 2 == n if n >= 0 else False def is_square_soln(n): pass print(is_square(-1))
15.666667
61
0.659574
27
141
3.296296
0.666667
0.269663
0
0
0
0
0
0
0
0
0
0.027027
0.212766
141
9
62
15.666667
0.774775
0
0
0
0
0
0
0
0
0
0
0
0
1
0.2
false
0.2
0.2
0
0.4
0.2
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
1
0
0
0
0
0
4
2cfcfb9e9b672e889b4728cb7b9faa88f7e34168
72
py
Python
2019/Python/Day_6/__init__.py
airstandley/AdventofCode
86b7e289d67ba3ea31a78f4a4005253098f47254
[ "MIT" ]
null
null
null
2019/Python/Day_6/__init__.py
airstandley/AdventofCode
86b7e289d67ba3ea31a78f4a4005253098f47254
[ "MIT" ]
null
null
null
2019/Python/Day_6/__init__.py
airstandley/AdventofCode
86b7e289d67ba3ea31a78f4a4005253098f47254
[ "MIT" ]
null
null
null
""" Day 6: Universal Orbit Map (https://adventofcode.com/2019/day/6) """
24
64
0.680556
11
72
4.454545
0.818182
0.163265
0
0
0
0
0
0
0
0
0
0.092308
0.097222
72
3
65
24
0.661538
0.888889
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
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
4
fa078e49a61057ac1da2c5e2c17b188b1fbf01de
128
py
Python
shit.py
rangehow/TransformerForMT
48ec2fb5350003063290f2ad14d55c642517c026
[ "MIT" ]
null
null
null
shit.py
rangehow/TransformerForMT
48ec2fb5350003063290f2ad14d55c642517c026
[ "MIT" ]
null
null
null
shit.py
rangehow/TransformerForMT
48ec2fb5350003063290f2ad14d55c642517c026
[ "MIT" ]
null
null
null
import math from typing import List import numpy as np import torch a = torch.randn(4, 3,2) print(a) print(torch.argmax(a, -1))
16
26
0.734375
25
128
3.76
0.68
0
0
0
0
0
0
0
0
0
0
0.036697
0.148438
128
8
26
16
0.825688
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.571429
0
0.571429
0.285714
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
0
1
0
1
0
0
4
fa0a0031b6771b43d0976594e38309c2e2f0ab94
156
py
Python
submissions/templatetags/auth_extras.py
lesves/acceptor
07c3e144e93f27e8355effbfe95a1f01dc818a90
[ "MIT" ]
1
2022-01-03T21:42:37.000Z
2022-01-03T21:42:37.000Z
submissions/templatetags/auth_extras.py
lesves/acceptor
07c3e144e93f27e8355effbfe95a1f01dc818a90
[ "MIT" ]
null
null
null
submissions/templatetags/auth_extras.py
lesves/acceptor
07c3e144e93f27e8355effbfe95a1f01dc818a90
[ "MIT" ]
null
null
null
from django import template register = template.Library() @register.filter def has_group(user, name): return user.groups.filter(name=name).exists()
19.5
50
0.75
21
156
5.52381
0.714286
0
0
0
0
0
0
0
0
0
0
0
0.134615
156
7
51
22.285714
0.859259
0
0
0
0
0
0
0
0
0
0
0
0
1
0.2
false
0
0.2
0.2
0.6
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
0
0
1
1
0
0
4
fa37e3137008518d11130aa95cb3494298511577
2,049
py
Python
marqeta/response_models/business_proprietor_response_model.py
marqeta/marqeta-python
66fa690eb910825c510a391720b0fe717fac0234
[ "MIT" ]
21
2019-04-12T09:02:17.000Z
2022-02-18T11:39:06.000Z
marqeta/response_models/business_proprietor_response_model.py
marqeta/marqeta-python
66fa690eb910825c510a391720b0fe717fac0234
[ "MIT" ]
1
2020-07-22T21:27:40.000Z
2020-07-23T17:38:43.000Z
marqeta/response_models/business_proprietor_response_model.py
marqeta/marqeta-python
66fa690eb910825c510a391720b0fe717fac0234
[ "MIT" ]
10
2019-05-08T14:20:37.000Z
2021-09-20T18:09:26.000Z
from datetime import datetime, date from marqeta.response_models.address_response_model import AddressResponseModel from marqeta.response_models.identification_response_model import IdentificationResponseModel from marqeta.response_models import datetime_object import json import re class BusinessProprietorResponseModel(object): def __init__(self, json_response): self.json_response = json_response def __str__(self): return json.dumps(self.json_response, default=self.json_serial) @staticmethod def json_serial(o): if isinstance(o, datetime) or isinstance(o, date): return o.__str__() @property def first_name(self): return self.json_response.get('first_name', None) @property def middle_name(self): return self.json_response.get('middle_name', None) @property def last_name(self): return self.json_response.get('last_name', None) @property def alternative_names(self): return self.json_response.get('alternative_names', None) @property def title(self): return self.json_response.get('title', None) @property def home(self): if 'home' in self.json_response: return AddressResponseModel(self.json_response['home']) @property def ssn(self): return self.json_response.get('ssn', None) @property def dob(self): if 'dob' in self.json_response: return datetime_object('dob', self.json_response) @property def phone(self): return self.json_response.get('phone', None) @property def email(self): return self.json_response.get('email', None) @property def identifications(self): if 'identifications' in self.json_response: return [IdentificationResponseModel(val) for val in self.json_response['identifications']] def __repr__(self): return '<Marqeta.response_models.business_proprietor_response_model.BusinessProprietorResponseModel>' + self.__str__()
25.936709
127
0.697413
239
2,049
5.723849
0.217573
0.105263
0.19883
0.105263
0.230994
0.178363
0.072368
0
0
0
0
0
0.211323
2,049
78
128
26.269231
0.846535
0
0
0.207547
0
0
0.098097
0.0449
0
0
0
0
0
1
0.283019
false
0
0.113208
0.188679
0.679245
0
0
0
0
null
0
1
0
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
1
0
0
4
fa49a5157a06abdd46d0a0ba0bf6a84c8195c2b0
254
py
Python
output/models/nist_data/atomic/duration/schema_instance/nistschema_sv_iv_atomic_duration_pattern_1_xsd/__init__.py
tefra/xsdata-w3c-tests
b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f
[ "MIT" ]
1
2021-08-14T17:59:21.000Z
2021-08-14T17:59:21.000Z
output/models/nist_data/atomic/duration/schema_instance/nistschema_sv_iv_atomic_duration_pattern_1_xsd/__init__.py
tefra/xsdata-w3c-tests
b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f
[ "MIT" ]
4
2020-02-12T21:30:44.000Z
2020-04-15T20:06:46.000Z
output/models/nist_data/atomic/duration/schema_instance/nistschema_sv_iv_atomic_duration_pattern_1_xsd/__init__.py
tefra/xsdata-w3c-tests
b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f
[ "MIT" ]
null
null
null
from output.models.nist_data.atomic.duration.schema_instance.nistschema_sv_iv_atomic_duration_pattern_1_xsd.nistschema_sv_iv_atomic_duration_pattern_1 import NistschemaSvIvAtomicDurationPattern1 __all__ = [ "NistschemaSvIvAtomicDurationPattern1", ]
42.333333
194
0.893701
28
254
7.428571
0.642857
0.201923
0.134615
0.192308
0.346154
0.346154
0.346154
0
0
0
0
0.016667
0.055118
254
5
195
50.8
0.85
0
0
0
0
0
0.141732
0.141732
0
0
0
0
0
1
0
false
0
0.25
0
0.25
0
1
0
0
null
1
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
0
0
0
0
0
0
0
4
fa60dfbb5a27f65a90d0edd2f3424a73f6bf1539
290
py
Python
sb_backend/app/service/setup/service_noseriesline.py
DmitriyGrigoriev/sb-fastapi
1aef3db6ce26ea054e048e5927552d48c2eccbfb
[ "MIT" ]
null
null
null
sb_backend/app/service/setup/service_noseriesline.py
DmitriyGrigoriev/sb-fastapi
1aef3db6ce26ea054e048e5927552d48c2eccbfb
[ "MIT" ]
null
null
null
sb_backend/app/service/setup/service_noseriesline.py
DmitriyGrigoriev/sb-fastapi
1aef3db6ce26ea054e048e5927552d48c2eccbfb
[ "MIT" ]
null
null
null
from sqlmodel import SQLModel from sb_backend.app.service.base.base_service import ServiceBase from sb_backend.app.crud.setup.crud_noseriesline import CRUDBase, noseriesline class ServiceBase(ServiceBase[CRUDBase, SQLModel, SQLModel]): pass noseriesline_s = ServiceBase(noseriesline)
32.222222
78
0.841379
36
290
6.638889
0.444444
0.050209
0.108787
0.133891
0
0
0
0
0
0
0
0
0.093103
290
8
79
36.25
0.908745
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0.166667
0.5
0
0.666667
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
0
1
1
0
1
0
0
4
fa6fa5a701f70f4832c2cbf824364381684d1511
4,567
py
Python
tests/player_state_test.py
the-gigi/dominion
2bccad2e51a574c881372d32819e2e3049d93e78
[ "MIT" ]
2
2020-04-16T03:21:25.000Z
2022-01-15T18:24:08.000Z
tests/player_state_test.py
the-gigi/dominion
2bccad2e51a574c881372d32819e2e3049d93e78
[ "MIT" ]
36
2020-07-03T04:42:50.000Z
2020-07-05T18:30:57.000Z
tests/player_state_test.py
the-gigi/dominion
2bccad2e51a574c881372d32819e2e3049d93e78
[ "MIT" ]
null
null
null
import unittest from dominion_game_engine.card_util import * from dominion_game_engine.cards import * from dominion_game_engine.player_state import PlayerState class TestPlayerState(unittest.TestCase): def setUp(self): card_types = get_card_types().values() piles = setup_piles(card_types, 4) self.player_state = PlayerState('tester1', piles) def test_initialize_draw_deck(self): """ √ Create new player state √ Check if the player has exactly 7 coppers and 3 estates in their Draw Deck """ self.player_state.draw_deck.cards += self.player_state.hand self.player_state.hand = [] num_coppers = sum(1 if type(c) == Copper else 0 for c in self.player_state.draw_deck.cards) num_estates = sum(1 if type(c) == Estate else 0 for c in self.player_state.draw_deck.cards) self.assertEqual(num_coppers, 7) self.assertEqual(num_estates, 3) def test_draw_cards(self): """ draw 0 cards draw 1 card with no cards in deck or discard draw multiple cards with no cards in deck or discard draw 1 card with no cards in deck and 1 card in discard draw multiple cards with no cards in deck and 1 card in discard draw 1 card with 1 card in deck and multiple cards in discard draw multiple cards with 1 card in deck and multiple cards in discard draw 1 card with multiple cards in deck draw multiple cards with multiple cards in deck """ # draw 0 cards copper = Copper() silver = Silver() gold = Gold() estate = Estate() self.player_state.hand = [copper] self.player_state.draw_deck.cards = [silver] self.player_state.discard_pile.cards = [] self.player_state.draw_cards(0) expected = [copper] self.assertEqual(self.player_state.hand, expected) self.assertEqual(self.player_state.draw_deck.cards, [silver]) # draw 1 card with no cards in deck or discard self.player_state.hand = [copper] self.player_state.draw_deck.cards = [] expected = [copper] self.player_state.draw_cards(1) self.assertEqual(self.player_state.hand, expected) expected = [copper] self.player_state.draw_cards(3) self.assertEqual(self.player_state.hand, expected) # draw 1 card with no cards in deck and 1 card in discard self.player_state.hand = [copper] self.player_state.draw_deck.cards = [] self.player_state.discard_pile.cards = [silver] self.player_state.draw_cards(1) expected = [copper, silver] self.assertEqual(self.player_state.hand, expected) # draw multiple cards with no cards in deck and 1 card in discard self.player_state.hand = [copper] self.player_state.draw_deck.cards = [] self.player_state.discard_pile.cards = [silver] expected = [copper, silver] self.player_state.draw_cards(3) self.assertEqual(self.player_state.hand, expected) # draw 1 card with 1 card in deck and multiple cards in discard self.player_state.hand = [copper] self.player_state.draw_deck.cards = [silver] self.player_state.discard_pile.cards = [gold, estate] self.player_state.draw_cards(1) expected = [copper, silver] self.assertEqual(self.player_state.hand, expected) # draw multiple cards with 1 card in deck and multiple cards in discard self.player_state.hand = [copper] self.player_state.draw_deck.cards = [silver] self.player_state.draw_cards(3) expected = as_dict([copper, silver, gold, estate]) self.assertEqual(as_dict(self.player_state.hand), expected) # draw 1 card with multiple cards in deck self.player_state.hand = [copper] self.player_state.draw_deck.cards = [silver, gold, estate] self.player_state.discard_pile.cards = [] self.player_state.draw_cards(1) expected = [copper, silver] self.assertEqual(self.player_state.hand, expected) # draw multiple cards with multiple cards in deck self.player_state.hand = [copper] self.player_state.draw_deck.cards = [silver, gold, estate] self.player_state.discard_pile.cards = [] self.player_state.draw_cards(3) expected = [copper, silver, gold, estate] self.assertEqual(self.player_state.hand, expected) if __name__ == '__main__': unittest.main()
38.378151
99
0.662798
622
4,567
4.699357
0.109325
0.1844
0.241191
0.136504
0.804311
0.769073
0.747178
0.661991
0.635648
0.596989
0
0.010841
0.252682
4,567
118
100
38.70339
0.845004
0.209109
0
0.60274
0
0
0.004303
0
0
0
0
0
0.164384
1
0.041096
false
0
0.054795
0
0.109589
0
0
0
0
null
0
1
0
1
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
4
d707022831c9689c8fc33323a8b72036d852d9e5
96
py
Python
scuole/cohorts/apps.py
texastribune/scuole
8ab316ee50ef0d8e71b94b50dc889d10c6e83412
[ "MIT" ]
1
2019-03-12T04:30:02.000Z
2019-03-12T04:30:02.000Z
scuole/cohorts/apps.py
texastribune/scuole
8ab316ee50ef0d8e71b94b50dc889d10c6e83412
[ "MIT" ]
616
2017-08-18T21:15:39.000Z
2022-03-25T11:17:10.000Z
scuole/cohorts/apps.py
texastribune/scuole
8ab316ee50ef0d8e71b94b50dc889d10c6e83412
[ "MIT" ]
null
null
null
from django.apps import AppConfig class CohortsConfig(AppConfig): name = 'scuole.cohorts'
16
33
0.760417
11
96
6.636364
0.909091
0
0
0
0
0
0
0
0
0
0
0
0.15625
96
5
34
19.2
0.901235
0
0
0
0
0
0.145833
0
0
0
0
0
0
1
0
false
0
0.333333
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
0
0
1
0
1
0
0
4
d710c8f60cb9024bad5b455bf64fd5e34f00636a
736
py
Python
PIP/Class Program/ClassQuestion5.py
ankitrajbiswal/SEM_5
db716e242e77149a4091e0e564356ddc724aeff0
[ "Apache-2.0" ]
10
2021-04-24T11:46:48.000Z
2022-01-17T05:14:37.000Z
PIP/Class Program/ClassQuestion5.py
ankitrajbiswal/SEM_5
db716e242e77149a4091e0e564356ddc724aeff0
[ "Apache-2.0" ]
2
2021-06-28T11:51:50.000Z
2021-11-01T08:21:53.000Z
PIP/Class Program/ClassQuestion5.py
ankitrajbiswal/SEM_5
db716e242e77149a4091e0e564356ddc724aeff0
[ "Apache-2.0" ]
16
2021-04-24T11:46:58.000Z
2022-03-02T05:08:19.000Z
'''def operations(a,b,c): if(c=='+'): return a+b elif(c=='-'): return a-b elif(c=='*'): return a*b elif(c=='/'): return a/b elif(c=='%'): return a%b elif(c=='**'): return a**b elif(c=='//'): return a//b else: print("Non specfied soperation") print(operations(10,5,'+')) print(operations(10,5,'-')) print(operations(10,5,'*')) print(operations(10,5,'/')) print(operations(10,5,'%')) print(operations(10,2,'**')) print(operations(10,3,'//')) print(operations((int(input("Enter a "))),int(input("Enter b ")),input("Enter c ")))''' def evaluate(): print(eval(input("Enter an arithmetic expression: "))) evaluate()
26.285714
88
0.509511
96
736
3.90625
0.260417
0.042667
0.149333
0.168
0.517333
0.517333
0.517333
0.517333
0.517333
0.517333
0
0.037433
0.237772
736
28
89
26.285714
0.631016
0.838315
0
0
0
0
0.367816
0
0
0
0
0
0
1
0.333333
true
0
0
0
0.333333
0.333333
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
0
0
0
0
0
4
d72176db25b837eec39504c5b4f9c46b726440a8
97
py
Python
libraries/exhibitions/apps.py
chris-lawton/libraries_wagtail
60c2484b137bb33763da2e49b191b1a380f3d56f
[ "ECL-2.0" ]
9
2017-12-19T21:15:23.000Z
2022-03-23T08:11:52.000Z
libraries/exhibitions/apps.py
chris-lawton/libraries_wagtail
60c2484b137bb33763da2e49b191b1a380f3d56f
[ "ECL-2.0" ]
140
2017-07-12T00:09:53.000Z
2021-11-02T17:30:43.000Z
libraries/exhibitions/apps.py
chris-lawton/libraries_wagtail
60c2484b137bb33763da2e49b191b1a380f3d56f
[ "ECL-2.0" ]
3
2017-08-21T10:47:34.000Z
2020-08-20T14:04:18.000Z
from django.apps import AppConfig class ExhibitionsConfig(AppConfig): name = 'exhibitions'
16.166667
35
0.773196
10
97
7.5
0.9
0
0
0
0
0
0
0
0
0
0
0
0.154639
97
5
36
19.4
0.914634
0
0
0
0
0
0.113402
0
0
0
0
0
0
1
0
false
0
0.333333
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
0
0
1
0
1
0
0
4
d729c41c45e0ad91c39b5482430d352eba2c6c9e
699
py
Python
src/backend/common/sitevars/flask_secrets.py
ofekashery/the-blue-alliance
df0e47d054161fe742ac6198a6684247d0713279
[ "MIT" ]
266
2015-01-04T00:10:48.000Z
2022-03-28T18:42:05.000Z
src/backend/common/sitevars/flask_secrets.py
ofekashery/the-blue-alliance
df0e47d054161fe742ac6198a6684247d0713279
[ "MIT" ]
2,673
2015-01-01T20:14:33.000Z
2022-03-31T18:17:16.000Z
src/backend/common/sitevars/flask_secrets.py
ofekashery/the-blue-alliance
df0e47d054161fe742ac6198a6684247d0713279
[ "MIT" ]
230
2015-01-04T00:10:48.000Z
2022-03-26T18:12:04.000Z
from typing import TypedDict from backend.common.sitevars.sitevar import Sitevar class ContentType(TypedDict): secret_key: str class FlaskSecrets(Sitevar[ContentType]): DEFAULT_SECRET_KEY: str = "thebluealliance" @staticmethod def key() -> str: return "flask.secrets" @staticmethod def description() -> str: return "Secret key for Flask session" @staticmethod def default_value() -> ContentType: return ContentType(secret_key=FlaskSecrets.DEFAULT_SECRET_KEY) @classmethod def secret_key(cls) -> str: secret_key = cls.get().get("secret_key") return secret_key if secret_key else FlaskSecrets.DEFAULT_SECRET_KEY
24.103448
76
0.706724
80
699
6
0.375
0.20625
0.1
0.116667
0
0
0
0
0
0
0
0
0.20887
699
28
77
24.964286
0.867993
0
0
0.157895
0
0
0.094421
0
0
0
0
0
0
1
0.210526
false
0
0.105263
0.157895
0.736842
0
0
0
0
null
1
0
0
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
1
0
0
4
d74152884389e5fc3f13b32b2c1f5a681bd2affe
211
py
Python
org/miggy/setup.py
DarkSession/fd-api
e319000dd12ca88c3ddd736b739d904279f69b8b
[ "CC-BY-4.0" ]
20
2017-10-03T21:47:39.000Z
2022-01-27T21:06:53.000Z
org/miggy/setup.py
DarkSession/fd-api
e319000dd12ca88c3ddd736b739d904279f69b8b
[ "CC-BY-4.0" ]
1
2021-10-13T15:49:57.000Z
2021-11-05T18:58:21.000Z
org/miggy/setup.py
DarkSession/fd-api
e319000dd12ca88c3ddd736b739d904279f69b8b
[ "CC-BY-4.0" ]
7
2020-02-07T13:43:29.000Z
2022-03-26T13:13:55.000Z
# vim: textwidth=0 wrapmargin=0 tabstop=2 shiftwidth=2 softtabstop=2 smartindent smarttab from setuptools import setup, find_namespace_packages setup( name="org.miggy", packages=find_namespace_packages() )
26.375
89
0.805687
28
211
5.928571
0.714286
0.156627
0.253012
0
0
0
0
0
0
0
0
0.026596
0.109005
211
7
90
30.142857
0.856383
0.412322
0
0
0
0
0.07377
0
0
0
0
0
0
1
0
true
0
0.2
0
0.2
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
0
0
0
0
0
4
d751efb295d54d9e30bbe118adcaa7556e4e4646
67
py
Python
Python Crash Course/12_use_module.py
rfaria/full-stack-python
1e764d4a1468d849d20005846e49ff900787d1ed
[ "MIT" ]
1
2022-01-17T19:55:52.000Z
2022-01-17T19:55:52.000Z
Python Crash Course/12_use_module.py
rfaria/full-stack-python
1e764d4a1468d849d20005846e49ff900787d1ed
[ "MIT" ]
null
null
null
Python Crash Course/12_use_module.py
rfaria/full-stack-python
1e764d4a1468d849d20005846e49ff900787d1ed
[ "MIT" ]
null
null
null
import new_module as nm if __name__ == '__main__': nm.say_hi()
16.75
26
0.686567
11
67
3.272727
0.909091
0
0
0
0
0
0
0
0
0
0
0
0.19403
67
4
27
16.75
0.666667
0
0
0
0
0
0.117647
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
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
0
0
0
4
d759b3383f0a3272c487bb9c3a6da4112544bbe3
173
py
Python
exp01_string.py
psb2509/learning-python3
38bd16f85d458b69ed677c72315c1023f83afc3d
[ "MIT" ]
null
null
null
exp01_string.py
psb2509/learning-python3
38bd16f85d458b69ed677c72315c1023f83afc3d
[ "MIT" ]
4
2018-09-09T16:47:46.000Z
2018-09-10T12:18:43.000Z
exp01_string.py
psb2509/learning-python3
38bd16f85d458b69ed677c72315c1023f83afc3d
[ "MIT" ]
null
null
null
print(4+3); print("Hello"); print('Who are you'); print('This is Pradeep\'s python program'); print(r'C:\Users\N51254\Documents\NetBeansProjects'); print("Pradeep "*5);
28.833333
54
0.687861
26
173
4.576923
0.769231
0
0
0
0
0
0
0
0
0
0
0.051282
0.098266
173
6
55
28.833333
0.711538
0
0
0
0
0
0.485207
0.248521
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
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
4
d75a625bfb5e6d5e2d2d9e1471c8fa852109fb7f
17
py
Python
haul2/src/__init__.py
hotkeymuc/haul2
bac20b684fd81c24b91e505002723a6577c2b883
[ "MIT" ]
null
null
null
haul2/src/__init__.py
hotkeymuc/haul2
bac20b684fd81c24b91e505002723a6577c2b883
[ "MIT" ]
null
null
null
haul2/src/__init__.py
hotkeymuc/haul2
bac20b684fd81c24b91e505002723a6577c2b883
[ "MIT" ]
null
null
null
__all__ = ["htk"]
17
17
0.588235
2
17
3
1
0
0
0
0
0
0
0
0
0
0
0
0.117647
17
1
17
17
0.4
0
0
0
0
0
0.166667
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
d7870e58d2f2ce7682797454d2079370c26d1673
1,150
py
Python
test/util_test.py
quiet-oceans/libais
61ed34683c01662925f4b9ed69b10885dcb3bc79
[ "Apache-2.0" ]
161
2015-02-10T16:40:25.000Z
2022-02-11T10:17:28.000Z
test/util_test.py
quiet-oceans/libais
61ed34683c01662925f4b9ed69b10885dcb3bc79
[ "Apache-2.0" ]
179
2015-01-14T23:19:25.000Z
2021-10-15T23:32:14.000Z
test/util_test.py
quiet-oceans/libais
61ed34683c01662925f4b9ed69b10885dcb3bc79
[ "Apache-2.0" ]
88
2015-01-19T05:10:39.000Z
2022-03-09T06:59:27.000Z
#!/usr/bin/env python """Tests for ais.util.""" import unittest from ais import util import six class UtilTest(unittest.TestCase): def testMaybeToNumber(self): self.assertEqual(util.MaybeToNumber(None), None) self.assertEqual(util.MaybeToNumber([]), []) self.assertEqual(util.MaybeToNumber({}), {}) self.assertEqual(util.MaybeToNumber('a'), 'a') self.assertEqual(util.MaybeToNumber(1), 1) self.assertEqual(util.MaybeToNumber(-3.12), -3.12) self.assertEqual(util.MaybeToNumber('-1'), -1) self.assertIsInstance(util.MaybeToNumber('-1'), int) self.assertEqual(util.MaybeToNumber('42.0'), 42.0) self.assertIsInstance(util.MaybeToNumber('42.0'), float) value = 9999999999999999999999999 value_str = '9999999999999999999999999' self.assertEqual(util.MaybeToNumber(value_str), value) self.assertIsInstance(util.MaybeToNumber(value_str), six.integer_types) self.assertEqual( util.MaybeToNumber('1e99999999999999999999999'), float('inf')) self.assertEqual( util.MaybeToNumber('-1e99999999999999999999999'), float('-inf')) if __name__ == '__main__': unittest.main()
30.263158
75
0.715652
124
1,150
6.540323
0.322581
0.293465
0.257707
0.434032
0.37238
0.37238
0.37238
0.118372
0
0
0
0.118236
0.132174
1,150
37
76
31.081081
0.694389
0.034783
0
0.08
0
0
0.095109
0.068841
0
0
0
0
0.56
1
0.04
false
0
0.12
0
0.2
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
1
0
0
0
0
0
0
0
0
0
4
ad07b147f4f90acb57865d0385c6621563004a6f
2,115
py
Python
compiler/extensions/python/runtime/src/zserio/bitfield.py
PeachOS/zserio
ea01f6906c125a6baab7e8ed865eeb08cd46c37c
[ "BSD-3-Clause" ]
2
2019-02-06T17:50:24.000Z
2019-11-20T16:51:34.000Z
compiler/extensions/python/runtime/src/zserio/bitfield.py
PeachOS/zserio
ea01f6906c125a6baab7e8ed865eeb08cd46c37c
[ "BSD-3-Clause" ]
1
2019-11-25T16:25:51.000Z
2019-11-25T18:09:39.000Z
compiler/extensions/python/runtime/src/zserio/bitfield.py
PeachOS/zserio
ea01f6906c125a6baab7e8ed865eeb08cd46c37c
[ "BSD-3-Clause" ]
null
null
null
""" The module provides help methods for bit fields calculation. """ from zserio.exception import PythonRuntimeException def getBitFieldLowerBound(length): """ Gets the lower bound of a unsigned bitfield type with given length. :param length: Length of the unsigned bitfield in bits. :returns: The lowest value the unsigned bitfield can hold. :raises PythonRuntimeException: If unsigned bitfield with wrong length has been specified. """ _checkBitFieldLength(length, MAX_UNSIGNED_BITFIELD_BITS) return 0 def getBitFieldUpperBound(length): """ Gets the upper bound of a unsigned bitfield type with given length. :param length: Length of the unsigned bitfield in bits. :returns: The largest value the unsigned bitfield can hold. :raises PythonRuntimeException: If unsigned bitfield with wrong length has been specified. """ _checkBitFieldLength(length, MAX_UNSIGNED_BITFIELD_BITS) return (1 << length) - 1 def getSignedBitFieldLowerBound(length): """ Gets the lower bound of a signed bitfield type with given length. :param length: Length of the signed bitfield in bits. :returns: The lowest value the signed bitfield can hold. :raises PythonRuntimeException: If signed bitfield with wrong length has been specified. """ _checkBitFieldLength(length, MAX_SIGNED_BITFIELD_BITS) return -(1 << (length - 1)) def getSignedBitFieldUpperBound(length): """ Gets the upper bound of a signed bitfield type with given length. :param length: Length of the signed bitfield in bits. :returns: The largest value the signed bitfield can hold. :raises PythonRuntimeException: If signed bitfield with wrong length has been specified. """ _checkBitFieldLength(length, MAX_SIGNED_BITFIELD_BITS) return (1 << (length - 1)) - 1 def _checkBitFieldLength(length, maxBitFieldLength): if length <= 0 or length > maxBitFieldLength: raise PythonRuntimeException("Asking for bound of bitfield with invalid length %d!" % length) MAX_SIGNED_BITFIELD_BITS = 64 MAX_UNSIGNED_BITFIELD_BITS = 63
34.112903
101
0.74279
261
2,115
5.931034
0.229885
0.113695
0.033592
0.054264
0.75646
0.739018
0.739018
0.683463
0.666667
0.666667
0
0.007625
0.193853
2,115
61
102
34.672131
0.900293
0.541844
0
0.222222
0
0
0.060961
0
0
0
0
0
0
1
0.277778
false
0
0.055556
0
0.555556
0
0
0
0
null
0
0
0
0
1
1
0
0
1
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
0
0
0
0
4
ad229f171cc9684921e7ee20ce7549cff09359f6
204
py
Python
server/app/__init__.py
mrchipzhou/simple-android-demo
69b7f40924b8e62fab6cc2fcccb89f3e728e6ef4
[ "MIT" ]
null
null
null
server/app/__init__.py
mrchipzhou/simple-android-demo
69b7f40924b8e62fab6cc2fcccb89f3e728e6ef4
[ "MIT" ]
null
null
null
server/app/__init__.py
mrchipzhou/simple-android-demo
69b7f40924b8e62fab6cc2fcccb89f3e728e6ef4
[ "MIT" ]
null
null
null
from flask import Flask from . import user from . import attendance app = Flask(__name__) app.register_blueprint(user.bp, url_prefix='/User') app.register_blueprint(attendance.bp, url_prefix='/Attend')
22.666667
59
0.784314
29
204
5.241379
0.448276
0.131579
0.263158
0
0
0
0
0
0
0
0
0
0.102941
204
8
60
25.5
0.830601
0
0
0
0
0
0.058824
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0.333333
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
0
0
0
4
ad5c12d313589ae7fb0ab9514bf6274dd4fef970
64
py
Python
KAMA1ShortOnly/custom_indicators/__init__.py
ysdede/jesse_strategies
ade9f4ba42cec11207c766d267b9d8feb8bce648
[ "CC0-1.0" ]
38
2021-09-18T15:33:28.000Z
2022-02-21T17:29:08.000Z
ott2butKAMA1/custom_indicators/__init__.py
ysdede/jesse_strategies
ade9f4ba42cec11207c766d267b9d8feb8bce648
[ "CC0-1.0" ]
4
2022-01-02T14:46:12.000Z
2022-02-16T18:39:41.000Z
KAMA1ShortOnly/custom_indicators/__init__.py
ysdede/jesse_strategies
ade9f4ba42cec11207c766d267b9d8feb8bce648
[ "CC0-1.0" ]
11
2021-10-19T06:21:43.000Z
2022-02-21T17:29:10.000Z
from .ott import ott from .var import var from .rma import rma
12.8
20
0.75
12
64
4
0.416667
0
0
0
0
0
0
0
0
0
0
0
0.203125
64
4
21
16
0.941176
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
0
0
0
4
ad696db21a9d22c4ded15d5a9823102815ab634c
18,027
py
Python
codewars/difficulty_level_6kyu/football_yellow_and_red_cards/test_solution_football_yellow_and_red_cards.py
aleattene/python-codewars-challenges
86cfed8179193780763a0e36ef2f1ea4729a992f
[ "MIT" ]
1
2021-12-16T16:31:11.000Z
2021-12-16T16:31:11.000Z
codewars/difficulty_level_6kyu/football_yellow_and_red_cards/test_solution_football_yellow_and_red_cards.py
aleattene/python-codewars-challenges
86cfed8179193780763a0e36ef2f1ea4729a992f
[ "MIT" ]
2
2022-01-09T22:12:53.000Z
2022-01-13T10:34:52.000Z
codewars/difficulty_level_6kyu/football_yellow_and_red_cards/test_solution_football_yellow_and_red_cards.py
aleattene/python-codewars-challenges
86cfed8179193780763a0e36ef2f1ea4729a992f
[ "MIT" ]
1
2022-03-10T05:17:10.000Z
2022-03-10T05:17:10.000Z
""" To start the tests, type from CLI: python test_solution_sum_of_missing_numbers.py """ import unittest from solution_football_yellow_and_red_cards import men_still_standing class TestSolution(unittest.TestCase): def test_simple_cases(self): self.assertEqual(men_still_standing([]), (11, 11)) self.assertEqual(men_still_standing(["A4Y", "A4Y"]), (10, 11)) self.assertEqual(men_still_standing(["A4Y", "A4R"]), (10, 11)) self.assertEqual(men_still_standing(["A4Y", "A5R", "B5R", "A4Y", "B6Y"]), (9, 10)) self.assertEqual(men_still_standing(["A4R", "A4R", "A4R"]), (10, 11)) self.assertEqual(men_still_standing(["A4R", "A6R", "A8R", "A10R", "A11R"]), (6, 11)) pass def test_advanced_cases(self): self.assertEqual(men_still_standing(['A11R', 'A8Y', 'B1R', 'A10Y', 'A9Y']), (10, 10)) self.assertEqual(men_still_standing(['A8Y', 'B5Y', 'A8Y', 'B9R', 'A6R', 'B6Y', 'B7R', 'B7R', 'A6Y', 'A11R', 'B9R', 'A4R', 'A2Y', 'B10Y']), (7, 9)) self.assertEqual(men_still_standing(['A5Y', 'A2Y', 'A10Y', 'A1R', 'A6Y', 'B2R', 'B6Y']), (10, 10)) self.assertEqual(men_still_standing(['B7Y', 'A5Y', 'B1Y', 'B6Y', 'A1Y', 'A9R', 'A10R', 'B7Y', 'B1Y', 'A10R', 'B7Y', 'A1Y', 'B2Y', 'A11R', 'A3Y', 'B3Y', 'A4Y', 'B10R', 'B1R', 'B2Y']), (7, 7)) self.assertEqual(men_still_standing(['A3Y', 'B3Y', 'B11Y', 'A2Y', 'A2Y', 'A1R', 'A7Y', 'A2R', 'B2Y', 'A9Y', 'A10Y', 'A6R', 'A6R', 'A1R', 'B3R', 'A8Y', 'A11Y', 'B4Y', 'B6Y']), (8, 10)) self.assertEqual(men_still_standing(['A4R', 'A8Y', 'A5Y', 'B5Y', 'A5Y', 'B1R', 'B2R', 'B8R', 'A9Y']), (9, 8)) self.assertEqual(men_still_standing(['A1R', 'A11R', 'A5R', 'A2Y', 'A10Y', 'B8R', 'B4R', 'B10R', 'A6R', 'A7Y', 'A1R', 'A8Y', 'A9R']), (6, 8)) self.assertEqual(men_still_standing(['A11R', 'B1Y', 'A9Y', 'B7R', 'A8Y', 'A3Y', 'B1Y', 'B5Y', 'B8Y', 'B4R', 'A2R', 'A11Y']), (9, 8)) self.assertEqual(men_still_standing(['B3R', 'B2R', 'A3Y', 'B1Y', 'B1Y', 'B7R', 'B3Y', 'A11R']), (10, 7)) self.assertEqual(men_still_standing(['A4Y', 'B11Y', 'A2R', 'B4R', 'A9Y', 'A4R', 'A9R', 'A11Y', 'B1Y', 'B4Y', 'B8Y', 'A1Y', 'B11R', 'A4Y', 'A10Y', 'B8R', 'B8R']), (8, 8)) self.assertEqual(men_still_standing(['A4Y', 'B11Y', 'A8Y', 'A10R', 'B7Y', 'A1Y', 'A11R', 'A2Y', 'A1R', 'A4Y', 'A5R', 'A4Y', 'B3Y', 'B6R', 'A7Y']), (6, 11)) self.assertEqual(men_still_standing(['B3Y', 'B7R', 'B1Y', 'B6Y', 'A11R', 'B6Y', 'B8Y', 'A4Y', 'B9Y', 'B11Y', 'B8Y']), (10, 8)) self.assertEqual(men_still_standing(['A1R', 'B5Y', 'B6Y', 'B9R', 'B1R', 'A11Y', 'B6Y', 'A4Y', 'B2Y', 'B9Y', 'A10Y', 'A11R', 'B5Y', 'B8R', 'A11R']), (9, 6)) self.assertEqual(men_still_standing(['A5Y', 'A1R', 'A3R', 'A10R', 'B6Y', 'B5Y', 'B8Y', 'B2Y', 'B11R', 'B7Y', 'A10Y']), (8, 10)) self.assertEqual(men_still_standing(['B2Y', 'A8Y', 'A6Y', 'B11Y', 'A1Y', 'A5Y', 'A6Y', 'A9R', 'A11Y', 'A1Y', 'A1R', 'A10R', 'B3Y', 'B8Y', 'A8Y']), (6, 11)) self.assertEqual(men_still_standing(['B5Y', 'A9Y', 'A5R', 'B8Y', 'A11Y', 'B9Y', 'A6Y', 'B8Y']), (10, 10)) self.assertEqual(men_still_standing(['A9R', 'B9R', 'B7Y', 'B9Y', 'A3R', 'B1Y', 'A3Y', 'A9R', 'A4Y', 'B7Y', 'B4Y', 'B8Y', 'A9Y', 'A8R', 'B7Y', 'B6Y', 'B10Y', 'A10Y', 'A5Y', 'A10R', 'B2Y', 'B10Y', 'A8Y']), (7, 8)) self.assertEqual(men_still_standing(['A9Y', 'B10R', 'A5Y', 'A1Y', 'B1R', 'A4R']), (10, 9)) self.assertEqual(men_still_standing(['B11R', 'B3R', 'A10Y', 'B1Y', 'A9Y', 'B11Y', 'B4Y', 'A6Y', 'A11Y', 'B1R', 'A9Y', 'B3R', 'A3Y', 'A2Y', 'B2Y', 'B4R']), (10, 7)) self.assertEqual(men_still_standing(['B4Y', 'B4Y', 'B4Y', 'A1Y', 'A9Y', 'B3Y', 'B1Y', 'A9Y', 'A11R', 'A1R', 'B7Y', 'B5R', 'B7Y', 'B1Y']), (8, 7)) self.assertEqual(men_still_standing(['A2R', 'A2Y', 'B9Y', 'B6Y']), (10, 11)) self.assertEqual(men_still_standing(['B6R', 'B6R', 'A9Y', 'B4R', 'A5Y', 'A9R', 'A10R', 'A9Y', 'A11Y', 'A2R', 'B2Y', 'A3R', 'B11Y', 'B4Y', 'A7Y', 'A3Y']), (7, 9)) self.assertEqual(men_still_standing(['B2Y', 'B2Y', 'A10R', 'A8R', 'A8Y', 'B11R', 'A11Y', 'A5R', 'A8R', 'A10R', 'B8R']), (8, 8)) self.assertEqual(men_still_standing(['B7R', 'B10Y', 'B6Y', 'A3Y']), (11, 10)) self.assertEqual(men_still_standing(['A10Y', 'A9R', 'A2R', 'B5Y', 'A8Y', 'B8R', 'A11R', 'B3Y', 'B5Y', 'A6R', 'B3Y', 'B7Y', 'B1Y', 'A6R', 'A6Y', 'A9R', 'B3Y']), (7, 8)) self.assertEqual(men_still_standing(['B6R', 'B7Y', 'A2Y', 'B2Y', 'A11Y', 'B11R', 'B10Y', 'B7R', 'A1Y', 'B7Y', 'B7Y', 'A3Y', 'A4Y', 'B5Y', 'B3R', 'B4R', 'A2Y', 'A2R', 'A2R', 'A3Y', 'A4R', 'A3Y', 'A5Y']), (11, 6)) self.assertEqual(men_still_standing(['B9R', 'B9Y', 'B7Y', 'B11Y', 'B6R', 'A1Y', 'B6R', 'B6Y', 'A8Y', 'B8Y', 'B11Y', 'B10R', 'A9Y', 'B10R', 'A2Y', 'A9R', 'B10Y']), (10, 7)) self.assertEqual(men_still_standing(['B5Y', 'B6Y', 'B4R', 'A3Y', 'A3Y', 'A3Y', 'A11R', 'B6Y', 'B9Y', 'B8Y']), (9, 9)) self.assertEqual(men_still_standing(['A5R', 'A4R', 'B8Y', 'A6Y', 'A8R', 'B7R', 'B9Y', 'B6Y', 'B4Y', 'A5Y', 'A1Y', 'A10Y', 'B6Y', 'B1R', 'B8R', 'B8R', 'B7R', 'A2Y', 'B6R', 'A2Y', 'B11Y', 'B10Y', 'B8R']), (7, 7)) self.assertEqual(men_still_standing(['A9Y', 'A11Y', 'A10Y', 'A3Y']), (11, 11)) self.assertEqual(men_still_standing(['B5R', 'A6Y', 'B2Y', 'A2Y', 'A5R', 'A6Y']), (9, 10)) self.assertEqual(men_still_standing(['A9R', 'B5Y', 'A11R', 'B11Y', 'A11R', 'A6Y', 'B5R', 'A10Y', 'B6Y', 'A9Y', 'B7R', 'A5R', 'B10R', 'B7Y', 'B11Y', 'B4Y', 'B7Y', 'A6Y', 'A10Y', 'B7Y', 'A11Y', 'A11Y', 'B10R', 'A2Y']), (6, 7)) self.assertEqual(men_still_standing(['B2Y', 'A4Y', 'A10Y', 'B10Y', 'A3Y', 'B3Y', 'A7R', 'A10Y', 'A5Y', 'A2R', 'A11Y', 'B5Y', 'A7Y', 'B1R', 'B1Y', 'B6Y', 'B9Y', 'A8R', 'B1Y', 'B1Y', 'A5Y']), (6, 10)) self.assertEqual(men_still_standing(['B4R']), (11, 10)) self.assertEqual(men_still_standing(['B10R']), (11, 10)) self.assertEqual(men_still_standing(['A5Y', 'A7Y']), (11, 11)) self.assertEqual(men_still_standing(['B10Y', 'B9Y', 'A8Y', 'A8Y', 'A3R', 'A8Y', 'A6Y', 'B11Y', 'A6Y', 'A3Y', 'A8R', 'B5Y', 'B5Y', 'B1Y', 'B10R', 'A2Y', 'A8R', 'A1Y', 'B7Y', 'B11R']), (8, 8)) self.assertEqual(men_still_standing(['B2Y', 'A3R', 'A2R', 'B5R', 'B2Y', 'B5Y', 'A8Y', 'B5Y', 'B8Y', 'B3Y', 'B11R', 'B11Y']), (9, 8)) self.assertEqual(men_still_standing(['B9Y', 'A9R', 'A9Y', 'B8R', 'A8R', 'A9R', 'A8R', 'B10R', 'B9R', 'A3R', 'B7Y', 'A7R', 'B9Y', 'B2R', 'A5Y', 'A7Y', 'B3R', 'A10Y', 'B1R', 'A10Y', 'B4Y', 'A11Y', 'A10R']), (7, 6)) self.assertEqual(men_still_standing(['A10R']), (10, 11)) self.assertEqual(men_still_standing(['A6Y', 'B2R', 'B8Y', 'A3R', 'A5Y', 'B6Y', 'B3Y', 'B6Y', 'A4Y', 'B9Y', 'A9Y', 'A6Y']), (9, 9)) self.assertEqual(men_still_standing(['A5Y', 'B4R', 'A7Y', 'A4Y', 'B11Y', 'B8Y', 'A11Y', 'A5R', 'A3Y', 'A8Y', 'B6Y', 'B5Y', 'A10R', 'A1R', 'B6R', 'A2R', 'B2R', 'B8R', 'B2R', 'A5Y', 'A8Y', 'A9R', 'B8Y', 'B5Y']), (6, 7)) self.assertEqual(men_still_standing(['B7Y', 'B8Y', 'B11R', 'B4R', 'B8Y', 'A11Y', 'B10Y', 'B2Y', 'B1Y', 'B3Y', 'B6R', 'A8R', 'B5Y', 'A6Y', 'B11Y', 'B2Y', 'A3R', 'A5Y', 'A10Y']), (10, 6)) self.assertEqual(men_still_standing(['B10Y', 'A7Y', 'A8Y', 'B5R', 'A2R', 'A2R', 'B1Y', 'A8R', 'A5Y', 'A9Y', 'B4Y', 'B5Y', 'A4Y']), (9, 10)) self.assertEqual(men_still_standing(['A5Y', 'B7Y', 'B8Y', 'B3R', 'A7R', 'B8Y', 'B7Y', 'B6Y', 'B1R', 'A5R', 'B4Y', 'B3Y', 'B1Y', 'B11R']), (9, 6)) self.assertEqual(men_still_standing(['A3Y', 'A3Y', 'A6Y', 'B11R', 'B3Y', 'A4Y', 'B3Y', 'B8Y', 'B9R', 'A10Y', 'A6Y', 'A8R', 'B4Y', 'A11Y']), (8, 8)) self.assertEqual(men_still_standing(['B5R', 'B6Y', 'A2R', 'B7Y', 'A7Y', 'A4Y', 'A4R', 'B9Y', 'A6Y', 'A5Y', 'B4Y', 'A10R', 'B9Y', 'B9Y', 'B7R', 'A9R', 'A10Y']), (7, 8)) self.assertEqual(men_still_standing(['A2Y', 'B6Y', 'B5R', 'B9R', 'B6Y', 'B9Y', 'B2Y', 'B2R', 'A7R', 'B5R', 'A2Y', 'A3R', 'A6Y', 'B4Y', 'A4Y', 'B5Y', 'A4R', 'B2Y', 'B3R']), (7, 6)) self.assertEqual(men_still_standing(['B7R', 'A8R', 'A3Y', 'B8Y', 'A3R', 'A8R', 'B6Y', 'B11R', 'B3Y', 'A2Y', 'A9R']), (8, 9)) self.assertEqual(men_still_standing(['A3Y', 'B6Y', 'A5Y', 'A3R', 'A11Y', 'B10Y', 'B6Y', 'A9Y', 'B1R', 'A7Y', 'A11Y', 'A8Y', 'B6Y', 'A7Y', 'B10Y', 'A4Y', 'B9R', 'B4Y', 'A4Y', 'B10Y', 'B11R', 'A3Y']), (7, 6)) self.assertEqual(men_still_standing(['A5Y', 'B2Y', 'B5R', 'B5R', 'A4R', 'B3Y', 'B4Y', 'A3Y', 'B4Y', 'B5R', 'B2Y', 'B2R', 'B1Y', 'B9Y', 'A8R', 'A4Y', 'A2R']), (8, 8)) self.assertEqual(men_still_standing(['B1Y', 'B1Y']), (11, 10)) self.assertEqual(men_still_standing(['A1R', 'B11Y', 'A8Y', 'B6Y', 'B8Y', 'A11R', 'A2Y', 'B3R', 'B2Y', 'A9Y', 'B2R', 'A9Y']), (8, 9)) self.assertEqual(men_still_standing(['A9Y', 'A3Y', 'A6Y', 'B6Y', 'A8Y', 'B4Y', 'A7Y', 'A2Y', 'A4R', 'B9Y', 'B6Y', 'B6R', 'A10R']), (9, 10)) self.assertEqual(men_still_standing(['B9Y', 'B4R', 'B3Y', 'A8Y', 'B6Y']), (11, 10)) self.assertEqual(men_still_standing(['B6R', 'B2Y', 'A5Y', 'B11Y', 'B7Y', 'A5Y', 'A3R', 'B10Y', 'B2Y', 'A4R']), (8, 9)) self.assertEqual(men_still_standing(['A7Y', 'B2Y', 'A6R', 'B5R', 'B5Y', 'B3R', 'B4Y', 'B11Y', 'A6Y', 'A9Y', 'B5R', 'A10Y', 'B1Y', 'A3Y', 'A11Y', 'A6Y', 'A9R']), (9, 9)) self.assertEqual(men_still_standing(['A10Y', 'A1Y', 'B8Y', 'A9Y', 'A4Y', 'B4Y', 'B2Y', 'A2Y', 'B7R']), (11, 10)) self.assertEqual(men_still_standing(['A7Y', 'B6Y', 'A1R', 'B8Y', 'B7R', 'B11Y', 'B2Y', 'A7R', 'A11Y', 'B3Y', 'B9Y', 'A5Y', 'B11Y', 'B3Y', 'B8Y', 'A2Y', 'A4Y', 'A6R', 'A4Y', 'A7Y', 'A2Y', 'A11Y', 'B3R', 'B1Y', 'A11Y']), (6, 7)) self.assertEqual(men_still_standing(['B5Y', 'A6Y', 'B5R', 'B9R', 'A7R', 'A7Y', 'B6Y', 'A1R', 'B9Y', 'A8Y', 'A5Y', 'B9Y', 'B6R', 'A11Y', 'A8Y', 'B2R', 'B6Y', 'A5Y', 'A10R', 'A11R', 'B4Y', 'B4Y', 'A4Y']), (6, 7)) self.assertEqual(men_still_standing(['B7R', 'A5Y', 'B10R', 'A2Y', 'B3R', 'A2Y', 'B6Y', 'B5R', 'B4R', 'B7Y', 'B10R', 'A2R', 'A4R', 'B8Y', 'B8Y', 'B10Y', 'A10R']), (10, 6)) self.assertEqual(men_still_standing(['B2Y', 'A8Y', 'B7Y', 'B8Y', 'A11Y', 'B10R', 'B2Y', 'B11Y', 'A4R', 'B3Y', 'B1Y', 'B5R', 'B5Y', 'B3Y', 'B1Y']), (10, 6)) self.assertEqual(men_still_standing(['B11R', 'A6R', 'A10Y', 'A3Y', 'A5R', 'A2Y', 'A10Y', 'B6Y', 'A11R', 'A9Y', 'A7Y', 'A2R', 'A3Y', 'B10Y']), (6, 10)) self.assertEqual(men_still_standing(['A1R', 'A7Y', 'A9Y', 'A2Y', 'B9Y', 'B1Y', 'A3R', 'A8Y']), (9, 11)) self.assertEqual(men_still_standing(['A5Y', 'A3Y', 'A5R', 'B3Y', 'A1Y', 'B9Y', 'A1R', 'B5Y']), (9, 11)) self.assertEqual(men_still_standing(['A4Y', 'B6R', 'A5R', 'A7Y', 'B7Y', 'B8Y', 'A9Y', 'B9Y', 'B1Y', 'B6Y', 'B2Y']), (10, 10)) self.assertEqual(men_still_standing(['A2Y', 'A10Y', 'A5Y', 'A2Y', 'B1Y', 'B4Y', 'B2Y', 'A10Y']), (9, 11)) self.assertEqual(men_still_standing(['B2Y', 'A4Y', 'A2R', 'A6Y', 'A2Y', 'A10R', 'A8Y', 'A6Y', 'A10R', 'A10R', 'B2Y', 'B2R', 'B10R', 'A3Y', 'A5Y', 'A1R', 'B5Y', 'B8R', 'A7Y', 'A2R', 'B1Y']), (7, 8)) self.assertEqual(men_still_standing(['A2R', 'B11Y', 'A9R', 'A9Y', 'A6Y', 'B4R', 'B3R', 'A7Y', 'B8Y', 'A4Y', 'A6R', 'B3Y']), (8, 9)) self.assertEqual(men_still_standing(['B10Y', 'B1R', 'A1Y', 'A10R', 'B10Y', 'A6R', 'A4Y', 'A2R', 'B9Y', 'A1Y', 'B5Y', 'A7R', 'A1R', 'A2Y', 'B7R', 'B4R', 'B6R', 'A7Y', 'A4R', 'A2Y', 'B2Y', 'A7R', 'B5Y', 'B7Y']), (6, 9)) self.assertEqual(men_still_standing(['B3R', 'A10Y', 'A3R', 'B7Y', 'B11Y', 'B1Y', 'B3Y', 'B10R', 'A1Y', 'B9Y', 'A4Y', 'A2Y', 'B2R']), (10, 8)) self.assertEqual(men_still_standing(['A9Y', 'A8R', 'A3Y', 'B4R', 'A9Y', 'A7Y', 'A2R', 'A2R', 'B9Y', 'B7Y', 'A10Y', 'B2Y', 'B9Y', 'A4R', 'A4Y', 'A1Y', 'A10R', 'A11R', 'B3Y', 'B3Y', 'A4Y', 'B6Y']), (6, 9)) self.assertEqual(men_still_standing(['B8Y', 'B1Y', 'A9R', 'A6Y', 'B2Y']), (10, 11)) self.assertEqual(men_still_standing(['A6R', 'A4R', 'B11Y', 'A10R', 'B6Y', 'B6Y', 'A5Y', 'B10R', 'A1Y', 'A4Y', 'A5Y', 'B2Y', 'B5Y', 'B4Y', 'B11Y', 'B11R', 'B6R', 'A6R', 'A9R', 'B11Y', 'A9Y', 'A10Y', 'B8Y', 'A6Y']), (6, 8)) self.assertEqual(men_still_standing(['A4R', 'A9Y', 'B3R', 'B5Y', 'A10R', 'B10Y', 'B6Y', 'A11Y', 'A7Y', 'B9R', 'B3Y']), (9, 9)) self.assertEqual(men_still_standing(['B9Y', 'B7Y', 'A4Y', 'A1Y', 'B8Y', 'A2R', 'B11Y', 'A1R', 'B11Y', 'A7Y', 'A6R']), (8, 10)) self.assertEqual(men_still_standing(['A11Y', 'B10Y', 'B7Y', 'A8R', 'B8R', 'A2Y', 'B7R', 'A9Y', 'B3R', 'A8Y', 'B9R', 'B8Y', 'A6Y', 'A9Y', 'B9Y', 'A2Y', 'B6Y', 'A1Y', 'A8Y', 'B11R', 'A5R', 'A11Y', 'A11Y', 'B8Y']), (8, 6)) self.assertEqual(men_still_standing(['A2Y', 'A2Y', 'B5Y', 'A11Y', 'B9Y', 'A6Y', 'B8R', 'B10R', 'B9R', 'A2Y', 'A10Y', 'A4Y', 'B10Y', 'B1Y', 'B3R']), (10, 7)) self.assertEqual(men_still_standing(['A10R', 'B10Y', 'A3R', 'A9R', 'A2Y', 'B10Y', 'B8Y', 'B2R', 'A3R', 'B7Y']), (8, 9)) self.assertEqual(men_still_standing(['B9Y', 'B5Y', 'A8Y']), (11, 11)) self.assertEqual(men_still_standing(['B10R', 'A10R', 'B7Y', 'B11Y', 'B11Y', 'B1R', 'A7Y', 'A6R']), (9, 8)) self.assertEqual(men_still_standing(['B11Y', 'A6R', 'B11Y', 'A9R', 'A2Y', 'B11R', 'B11Y', 'B8R', 'B9Y', 'B10Y', 'A6Y']), (9, 9)) self.assertEqual(men_still_standing(['B10Y', 'A3R', 'B8R', 'B10Y', 'A6Y', 'A2R', 'A11R', 'B7R', 'B3Y', 'A7R', 'B4Y', 'A5R', 'B8Y', 'A9Y', 'A11Y', 'A10Y', 'A6Y', 'A4R', 'A9R', 'B10R', 'B3Y']), (6, 8)) self.assertEqual(men_still_standing(['A1R', 'B7Y', 'A5Y', 'B10Y', 'A1Y', 'A7Y', 'B11Y', 'A3Y', 'B11Y', 'B1R', 'A11R', 'B11Y', 'A10Y', 'A10Y', 'B4Y', 'B4R', 'A9R']), (7, 8)) self.assertEqual(men_still_standing(['A9R', 'A11R', 'B5Y', 'A5Y']), (9, 11)) self.assertEqual(men_still_standing(['A5Y', 'A3Y', 'B5Y', 'B5Y', 'A7Y', 'B7Y', 'A2R', 'A1Y', 'B2Y', 'B11Y', 'A5R']), (9, 10)) self.assertEqual(men_still_standing(['B7Y', 'A10Y', 'A4R', 'A7R', 'B1R', 'A5R', 'B5Y', 'A11Y', 'A10R', 'A11Y', 'B3Y']), (6, 10)) self.assertEqual(men_still_standing(['B8Y', 'B11Y', 'A9R', 'A5Y', 'B7R', 'A5Y', 'A10Y']), (9, 10)) self.assertEqual(men_still_standing(['A9R', 'B9Y', 'A10Y', 'B8Y', 'A10Y', 'A10Y', 'A6Y', 'B2Y']), (9, 11)) if __name__ == '__main__': """ The following instruction executes the tests by discovering all classes present in this file that inherit from unittest.TestCase. """ unittest.main()
90.58794
120
0.419315
1,919
18,027
3.827514
0.052632
0.104561
0.209122
0.297481
0.479101
0.479101
0.441661
0.056501
0.010892
0
0
0.138196
0.328452
18,027
198
121
91.045455
0.468528
0.004493
0
0
0
0
0.21329
0
0
0
0
0
0.513514
1
0.010811
false
0.005405
0.010811
0
0.027027
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
4
ad7a1bbb5678c63627d8c2c4ee4f69245d892027
89
py
Python
rorow/feusers/apps.py
derhelge/rorow
deac733dd8632773970b27325c9417a51c3491f3
[ "MIT" ]
null
null
null
rorow/feusers/apps.py
derhelge/rorow
deac733dd8632773970b27325c9417a51c3491f3
[ "MIT" ]
null
null
null
rorow/feusers/apps.py
derhelge/rorow
deac733dd8632773970b27325c9417a51c3491f3
[ "MIT" ]
null
null
null
from django.apps import AppConfig class FeusersConfig(AppConfig): name = 'feusers'
14.833333
33
0.752809
10
89
6.7
0.9
0
0
0
0
0
0
0
0
0
0
0
0.168539
89
5
34
17.8
0.905405
0
0
0
0
0
0.078652
0
0
0
0
0
0
1
0
false
0
0.333333
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
0
0
1
0
1
0
0
4
ad7b47e123d628383cdc106058dd002388aefb9d
238
py
Python
buck/__init__.py
bukzor/buck.pprint
3b3b2620838512cf8e39d3070964cda1f1b57025
[ "MIT" ]
4
2015-11-24T18:34:39.000Z
2019-09-04T13:53:12.000Z
buck/__init__.py
bukzor/buck.pprint
3b3b2620838512cf8e39d3070964cda1f1b57025
[ "MIT" ]
2
2017-02-01T01:29:13.000Z
2020-11-10T03:55:45.000Z
buck/__init__.py
bukzor/buck.pprint
3b3b2620838512cf8e39d3070964cda1f1b57025
[ "MIT" ]
1
2017-03-05T03:36:57.000Z
2017-03-05T03:36:57.000Z
# This is a namespace package. See also: # http://pythonhosted.org/distribute/setuptools.html#namespace-packages # http://osdir.com/ml/python.distutils.devel/2006-08/msg00029.html __import__('pkg_resources').declare_namespace(__name__)
47.6
73
0.798319
32
238
5.625
0.875
0
0
0
0
0
0
0
0
0
0
0.049327
0.063025
238
4
74
59.5
0.757848
0.731092
0
0
0
0
0.220339
0
0
0
0
0
0
1
0
true
0
1
0
1
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
0
1
0
1
0
0
4
ad8bbb939788d04c4a798ed4657ccace4dec673e
43
py
Python
src/python/WMCore/WMRuntime/Scripts/__init__.py
khurtado/WMCore
f74e252412e49189a92962945a94f93bec81cd1e
[ "Apache-2.0" ]
21
2015-11-19T16:18:45.000Z
2021-12-02T18:20:39.000Z
src/python/WMCore/WMRuntime/Scripts/__init__.py
khurtado/WMCore
f74e252412e49189a92962945a94f93bec81cd1e
[ "Apache-2.0" ]
5,671
2015-01-06T14:38:52.000Z
2022-03-31T22:11:14.000Z
src/python/WMCore/WMRuntime/Scripts/__init__.py
khurtado/WMCore
f74e252412e49189a92962945a94f93bec81cd1e
[ "Apache-2.0" ]
67
2015-01-21T15:55:38.000Z
2022-02-03T19:53:13.000Z
#!/usr/bin/env python """ _Scripts_ """
5.375
21
0.55814
5
43
4.4
1
0
0
0
0
0
0
0
0
0
0
0
0.186047
43
7
22
6.142857
0.628571
0.697674
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
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
a8df969a1e348281f45c3f81e7d78518202537bb
72
py
Python
aioblescan/__init__.py
nasa-watchdog/aioblescan-ucsb
1202906f6a96208f1887f0026a802c034019b068
[ "MIT" ]
2
2019-10-11T19:13:34.000Z
2020-06-03T14:11:33.000Z
aioblescan/__init__.py
nasa-watchdog/aioblescan-ucsb
1202906f6a96208f1887f0026a802c034019b068
[ "MIT" ]
null
null
null
aioblescan/__init__.py
nasa-watchdog/aioblescan-ucsb
1202906f6a96208f1887f0026a802c034019b068
[ "MIT" ]
4
2019-11-19T22:42:17.000Z
2022-01-18T21:56:31.000Z
# from .aioblescan import * from . import plugins __version__ = '0.2.1'
14.4
25
0.708333
10
72
4.7
0.8
0
0
0
0
0
0
0
0
0
0
0.05
0.166667
72
4
26
18
0.733333
0
0
0
0
0
0.070423
0
0
0
0
0
0
1
0
false
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
0
0
1
0
1
0
0
4
a8f537040119b192daaa8da6c2ebd5f6aff85c58
22,554
py
Python
test/FileTest.py
ytyaru/Python.File.Dir.Stat.20180402093000
f66e5eff603c62e24dd25f4aea034ce288059c66
[ "CC0-1.0" ]
null
null
null
test/FileTest.py
ytyaru/Python.File.Dir.Stat.20180402093000
f66e5eff603c62e24dd25f4aea034ce288059c66
[ "CC0-1.0" ]
null
null
null
test/FileTest.py
ytyaru/Python.File.Dir.Stat.20180402093000
f66e5eff603c62e24dd25f4aea034ce288059c66
[ "CC0-1.0" ]
null
null
null
import sys, os, os.path, pathlib print(pathlib.Path(__file__).parent.parent / 'src') sys.path.append(str(pathlib.Path(__file__).parent.parent / 'src')) from File import File from Directory import Directory import unittest import time, datetime class FileTest(unittest.TestCase): # ---------------------------- # クラスメソッド # ---------------------------- def test_IsExist(self): self.assertTrue(File.IsExist(__file__)) # 存在するがファイルでないためFalse self.assertTrue(not File.IsExist(os.path.dirname(__file__))) self.assertTrue(not File.IsExist('/NotExistDir.txt')) def test_Create_Delete(self): target = '/tmp/work/__TEST__/a.txt' self.assertTrue(not File.IsExist(target)) File.Create(target) self.assertTrue(File.IsExist(target)) self.assertTrue(0 == File.GetSize(target)) File.Delete(target) self.assertTrue(not File.IsExist(target)) target = '/tmp/work/__TEST__/A/B/C/d.e' self.assertTrue(not File.IsExist(target)) File.Create(target) self.assertTrue(File.IsExist(target)) File.Delete(target) self.assertTrue(not File.IsExist(target)) target = '/tmp/work/__TEST__' Directory.Delete(target) def test_CreateDummy(self): target = '/tmp/work/__TEST__/a.txt' self.assertTrue(not File.IsExist(target)) File.CreateDummy(target, 1024) self.assertTrue(File.IsExist(target)) self.assertTrue(1024 == File.GetSize(target)) File.Delete(target) self.assertTrue(not File.IsExist(target)) target = '/tmp/work/__TEST__/A/B/C/d.e' self.assertTrue(not File.IsExist(target)) File.CreateDummy(target, 4096) self.assertTrue(File.IsExist(target)) self.assertTrue(4096 == File.GetSize(target)) File.Delete(target) self.assertTrue(not File.IsExist(target)) target = '/tmp/work/__TEST__' Directory.Delete(target) def test_Copy(self): target = '/tmp/work/__TEST__/a.txt' self.assertTrue(not File.IsExist(target)) File.CreateDummy(target, 1024) File.Copy(target, '/tmp/work/__TEST__/b.txt') self.assertTrue(File.IsExist('/tmp/work/__TEST__/b.txt')) self.assertTrue(1024 == File.GetSize('/tmp/work/__TEST__/a.txt')) self.assertTrue(1024 == File.GetSize('/tmp/work/__TEST__/b.txt')) self.assertTrue(not os.path.exists('/tmp/work/__TEST_2__')) with self.assertRaises(IsADirectoryError) as e: File.Copy('/tmp/work/__TEST__', '/tmp/work/__TEST_2__') self.assertTrue(not os.path.exists('/tmp/work/__TEST_2__')) with self.assertRaises(IsADirectoryError) as e: File.Copy('/tmp/work/__TEST__', '/tmp/work/__TEST_2__/c.txt') self.assertTrue(not os.path.exists('/tmp/work/__TEST_2__/c.txt')) File.Copy('/tmp/work/__TEST__/a.txt', '/tmp/work/__TEST_2__') self.assertTrue(os.path.exists('/tmp/work/__TEST_2__')) self.assertTrue(1024 == File.GetSize('/tmp/work/__TEST_2__')) File.Delete('/tmp/work/__TEST__/a.txt') File.Delete('/tmp/work/__TEST__/b.txt') File.Delete('/tmp/work/__TEST_2__') Directory.Delete('/tmp/work/__TEST__') def test_Move_single(self): target = '/tmp/work/__TEST__/a.txt' self.assertTrue(not File.IsExist(target)) self.assertTrue(not File.IsExist('/tmp/work/__TEST_2__')) File.Create(target) File.Move(target, '/tmp/work/__TEST_2__/b.txt') self.assertTrue(not File.IsExist(target)) self.assertTrue(File.IsExist('/tmp/work/__TEST_2__/b.txt')) Directory.Delete('/tmp/work/__TEST_2__') Directory.Delete('/tmp/work/__TEST__') # ---------------------------- # インスタンスメソッド # ---------------------------- def test_init_relative_error(self): with self.assertRaises(ValueError) as e: d = File('A') self.assertEqual('引数pathは絶対パスにしてください。path=\'{}\''.format('A'), e.exception.args[0]) def test_mk_rm(self): target_root = '/tmp/work/__TEST__' target = '/tmp/work/__TEST__/a.txt' d = File(target) self.assertTrue(not File.IsExist(target)) d.mk() self.assertEqual(target, d.Path) self.assertTrue(File.IsExist(target)) self.assertTrue(not File.IsExist(os.path.join(target_root, 'A/a.txt'))) d.mk('A/a.txt') self.assertEqual(target, d.Path) self.assertTrue(File.IsExist(os.path.join(target_root, 'A/a.txt'))) self.assertTrue(not File.IsExist(os.path.join(target_root, 'B/BB/BBB/b.txt'))) d.mk('B/BB/BBB/b.txt') self.assertEqual(target, d.Path) self.assertTrue(File.IsExist(os.path.join(target_root, 'B/BB/BBB/b.txt'))) self.assertTrue(not File.IsExist(os.path.join('/tmp/work/__TEST__/C/c.txt'))) d.mk('/tmp/work/__TEST__/C/c.txt') self.assertEqual(target, d.Path) self.assertTrue(File.IsExist(os.path.join('/tmp/work/__TEST__/C/c.txt'))) d.rm() Directory.Delete('/tmp/work/__TEST__') def test_mk_dummy(self): target_root = '/tmp/work/__TEST__' target = '/tmp/work/__TEST__/a.txt' d = File(target) self.assertTrue(not File.IsExist(target_root)) self.assertTrue(d.Stat is None) d.mk_dummy(1024) self.assertEqual(target, d.Path) self.assertEqual(1024, d.Size) self.assertTrue(File.IsExist(target)) self.assertTrue(not File.IsExist(os.path.join(target_root, 'A/a.txt'))) d.mk_dummy(2048, 'A/a.txt') self.assertEqual(target, d.Path) self.assertEqual(2048, File.GetSize('/tmp/work/__TEST__/A/a.txt')) self.assertTrue(File.IsExist(os.path.join(target_root, 'A/a.txt'))) self.assertTrue(not File.IsExist(os.path.join(target_root, 'B/BB/BBB/b.txt'))) d.mk_dummy(3072, 'B/BB/BBB/b.txt') self.assertEqual(target, d.Path) #self.assertEqual(3072, d.Size) self.assertEqual(3072, File.GetSize('/tmp/work/__TEST__/B/BB/BBB/b.txt')) self.assertTrue(File.IsExist(os.path.join(target_root, 'B/BB/BBB/b.txt'))) self.assertTrue(not File.IsExist(os.path.join('/tmp/work/__TEST__/C/c.txt'))) d.mk_dummy(4096, '/tmp/work/__TEST__/C/c.txt') self.assertEqual(target, d.Path) #self.assertEqual(4096, d.Size) self.assertEqual(4096, File.GetSize('/tmp/work/__TEST__/C/c.txt')) self.assertTrue(File.IsExist(os.path.join('/tmp/work/__TEST__/C/c.txt'))) Directory.Delete('/tmp/work/__TEST__') def test_mk_rm_raise(self): target_root = '/tmp/work/__TEST__' target = '/tmp/work/__TEST__/a.txt' d = File(target) self.assertTrue(not File.IsExist(target_root)) with self.assertRaises(ValueError) as e: d.mk('/tmp/work/A') self.assertEqual('引数pathは未指定か次のパスの相対パス、または次のパス配下を指定してください。{}'.format(target_root), e.exception.args[0]) with self.assertRaises(ValueError) as e: d.rm('/tmp/work/A') self.assertEqual('引数pathは未指定か次のパスの相対パス、または次のパス配下を指定してください。{}'.format(target_root), e.exception.args[0]) Directory.Delete('/tmp/work/__TEST__') def test_cp_single(self): target_root = '/tmp/work/__TEST__' target= '/tmp/work/__TEST__/a.txt' d = File(target) self.assertEqual(target, d.Path) self.assertTrue(not File.IsExist(target)) d.mk() self.assertEqual(target, d.Path) self.assertTrue(File.IsExist(target)) self.assertTrue(not File.IsExist('/tmp/work/__TEST_2__')) res = d.cp('/tmp/work/__TEST_2__/a.txt') self.assertEqual(target, d.Path) self.assertTrue(File.IsExist('/tmp/work/__TEST_2__/a.txt')) self.assertEqual('/tmp/work/__TEST_2__/a.txt', res) self.assertEqual('/tmp/work/__TEST__/a.txt', d.Path) d.rm() self.assertTrue(not File.IsExist('/tmp/work/__TEST__/a.txt')) self.assertTrue(Directory.IsExist('/tmp/work/__TEST__')) self.assertEqual(target, d.Path) Directory.Delete('/tmp/work/__TEST__') Directory.Delete('/tmp/work/__TEST_2__') self.assertTrue(not Directory.IsExist('/tmp/work/__TEST_2__')) self.assertTrue(not Directory.IsExist('/tmp/work/__TEST__')) def test_cp_tree(self): target_root = '/tmp/work/__TEST__' target = '/tmp/work/__TEST__/a.txt' d = File(target) self.assertEqual(target, d.Path) self.assertTrue(not File.IsExist(d.Path)) with self.assertRaises(FileNotFoundError) as e: d.cp('/tmp/work/__TEST_2__/a.txt') d.mk() self.assertEqual(target, d.Path) self.assertTrue(File.IsExist(d.Path)) d.mk('A/a.txt') self.assertEqual(target, d.Path) self.assertTrue(not Directory.IsExist('/tmp/work/__TEST_2__')) d.cp('/tmp/work/__TEST_2__/A/a.txt') self.assertEqual(target, d.Path) self.assertTrue(File.IsExist('/tmp/work/__TEST_2__/A/a.txt')) d.rm() self.assertEqual(target, d.Path) Directory.Delete('/tmp/work/__TEST_2__') Directory.Delete('/tmp/work/__TEST__') self.assertTrue(not File.IsExist('/tmp/work/__TEST__')) self.assertTrue(not File.IsExist('/tmp/work/__TEST_2__')) def test_mv_single(self): target = '/tmp/work/__TEST__/a.txt' self.assertTrue(not File.IsExist(target)) d = File(target) self.assertEqual(target, d.Path) with self.assertRaises(FileNotFoundError) as e: d.mv('/tmp/work/__TEST_2__/a.txt') d.mk() self.assertEqual(target, d.Path) self.assertTrue(File.IsExist(target)) self.assertTrue(not File.IsExist('/tmp/work/__TEST_2__/a.txt')) d.mv('/tmp/work/__TEST_2__/a.txt') self.assertEqual('/tmp/work/__TEST_2__/a.txt', d.Path) self.assertTrue(not File.IsExist(target)) self.assertTrue(File.IsExist('/tmp/work/__TEST_2__/a.txt')) Directory.Delete('/tmp/work/__TEST_2__') Directory.Delete('/tmp/work/__TEST__') def test_mv_tree(self): target = '/tmp/work/__TEST__/a.txt' self.assertTrue(not File.IsExist(target)) self.assertTrue(not File.IsExist('/tmp/work/__TEST_2__/a.txt')) d = File(target) self.assertEqual(target, d.Path) with self.assertRaises(FileNotFoundError) as e: d.mv('/tmp/work/__TEST_2__/a.txt') d.mk('B/b.txt') self.assertEqual(target, d.Path) self.assertTrue(File.IsExist('/tmp/work/__TEST__/B/b.txt')) self.assertTrue(not File.IsExist('/tmp/work/__TEST__/a.txt')) d.mk() d.mv('/tmp/work/__TEST_2__/a.txt') self.assertEqual('/tmp/work/__TEST_2__/a.txt', d.Path) self.assertTrue(File.IsExist('/tmp/work/__TEST_2__/a.txt')) self.assertTrue(not File.IsExist(target)) self.assertTrue(Directory.IsExist('/tmp/work/__TEST_2__')) self.assertTrue(not File.IsExist('/tmp/work/__TEST_2__/B/b.txt')) Directory.Delete('/tmp/work/__TEST_2__') Directory.Delete('/tmp/work/__TEST__') # ---------------------------- # Stat # ---------------------------- def __MakeDummy(self, path, size): os.makedirs(os.path.dirname(path), exist_ok=True) if os.path.isfile(path): os.remove(path) # メタデータ初期化 with open(path, 'wb') as f: f.write(b'\0'*size) # ---------------------------- # クラスメソッド # ---------------------------- def test_GetSize(self): target_root = '/tmp/work/__TEST__' path_a = os.path.join(target_root, 'a.dummy') File.CreateDummy(path_a, 1024) self.assertEqual(1024, File.GetSize(path_a)) path_b = os.path.join(target_root, 'B', 'b.dummy') File.CreateDummy(path_b , 2048) self.assertEqual(2048, File.GetSize(path_b)) path_c = os.path.join(target_root, 'C', 'c.dummy') File.CreateDummy(path_c, 3072) self.assertEqual(3072, File.GetSize(path_c)) path_d = os.path.join(target_root, 'D/DD/d.dummy') File.CreateDummy(path_d, 4096) self.assertEqual(4096, File.GetSize(path_d)) Directory.Delete(target_root) def test_Mode_Get_Set_Name(self): target_root = '/tmp/work/__TEST__' target_dummy = os.path.join(target_root, 'a.dummy') File.CreateDummy(target_dummy, 1024) mode = File.GetMode(target_dummy) print(mode) print(oct(mode)) File.SetMode(target_dummy, 0o755) self.assertEqual(0o100755, File.GetMode(target_dummy)) self.assertEqual('-rwxr-xr-x', File.GetModeName(target_dummy)) File.SetMode(target_dummy, '-rwxrwxrwx') self.assertEqual(0o100777, File.GetMode(target_dummy)) File.SetMode(target_dummy, 0o644) self.assertEqual(0o100644, File.GetMode(target_dummy)) self.assertEqual('-rw-r--r--', File.GetModeName(target_dummy)) Directory.Delete(target_root) def test_SetModeFromName_Error(self): target_root = '/tmp/work/__TEST__' target_dummy = os.path.join(target_root, 'a.dummy') File.CreateDummy(target_dummy, 1024) mode_name = 'Invalid-Text' with self.assertRaises(ValueError) as e: File.SetMode(target_dummy, mode_name ) mode_names = [ '---', '--x', '-w-', '-wx', 'r--', 'r-x', 'rw-', 'rwx' ] self.assertEqual('引数mode_nameが不正値です。\'{}\'。\'-rwxrwxrwx\'の書式で入力してください。owner, group, other, の順に次のパターンのいずれかを指定します。pattern={}。r,w,xはそれぞれ、読込、書込、実行の権限です。-は権限なしを意味します。'.format(mode_name, mode_names), e.exception.args[0]) Directory.Delete(target_root) def test_Modified_Get_Set(self): target_root = '/tmp/work/__TEST__' target_dummy = os.path.join(target_root, 'a.dummy') File.CreateDummy(target_dummy, 1024) self.assertTrue(tuple == type(File.GetModified(target_dummy))) self.assertTrue(2 == len(File.GetModified(target_dummy))) self.assertTrue(float == type(File.GetModified(target_dummy)[0])) self.assertTrue(datetime.datetime == type(File.GetModified(target_dummy)[1])) #print(type(File.GetModified(target_dummy)[0])) #print(type(File.GetModified(target_dummy)[1])) dt1 = datetime.datetime.strptime('1999/12/31 23:59:59', '%Y/%m/%d %H:%M:%S') dt2 = datetime.datetime.strptime('2345/01/02 12:34:56', '%Y/%m/%d %H:%M:%S') epoch, dt = File.GetModified(target_dummy) self.assertTrue(dt1 != dt) self.assertTrue(dt2 != dt) File.SetModified(target_dummy, dt1) self.assertTrue(int(time.mktime(dt1.timetuple())) == File.GetModified(target_dummy)[0]) self.assertTrue(dt1 == File.GetModified(target_dummy)[1]) self.assertTrue(dt1 != File.GetChangedMeta(target_dummy)[1]) self.assertTrue(dt1 != File.GetAccessed(target_dummy)[1]) Directory.Delete(target_root) def test_Accessed_Get_Set(self): target_root = '/tmp/work/__TEST__' target_dummy = os.path.join(target_root, 'a.dummy') File.CreateDummy(target_dummy, 1024) self.assertTrue(tuple == type(File.GetAccessed(target_dummy))) self.assertTrue(2 == len(File.GetAccessed(target_dummy))) self.assertTrue(float == type(File.GetAccessed(target_dummy)[0])) self.assertTrue(datetime.datetime == type(File.GetAccessed(target_dummy)[1])) dt1 = datetime.datetime.strptime('1999/12/31 23:59:59', '%Y/%m/%d %H:%M:%S') dt2 = datetime.datetime.strptime('2345/01/02 12:34:56', '%Y/%m/%d %H:%M:%S') epoch, dt = File.GetAccessed(target_dummy) self.assertTrue(dt1 != dt) self.assertTrue(dt2 != dt) File.SetAccessed(target_dummy, dt1) self.assertTrue(int(time.mktime(dt1.timetuple())) == File.GetAccessed(target_dummy)[0]) self.assertTrue(dt1 == File.GetAccessed(target_dummy)[1]) self.assertTrue(dt1 != File.GetModified(target_dummy)[1]) self.assertTrue(dt1 != File.GetChangedMeta(target_dummy)[1]) Directory.Delete(target_root) def test_GetChangedMeta(self): target_root = '/tmp/work/__TEST__' target_dummy = os.path.join(target_root, 'a.dummy') File.CreateDummy(target_dummy, 1024) self.assertTrue(hasattr(File, 'GetChangedMeta')) self.assertTrue(hasattr(File, 'GetCreated')) print(File.GetChangedMeta(target_dummy)) print(File.GetCreated(target_dummy)) Directory.Delete(target_root) def test_Ids(self): target_root = '/tmp/work/__TEST__' target_dummy = os.path.join(target_root, 'a.dummy') File.CreateDummy(target_dummy, 1024) self.assertTrue(hasattr(File, 'OwnUserId')) self.assertTrue(hasattr(File, 'OwnGroupId')) self.assertTrue(hasattr(File, 'HardLinkNum')) self.assertTrue(hasattr(File, 'INode')) self.assertTrue(hasattr(File, 'DeviceId')) print(File.GetOwnUserId(target_dummy)) print(File.GetOwnGroupId(target_dummy)) print(File.GetHardLinkNum(target_dummy)) print(File.GetINode(target_dummy)) print(File.GetDeviceId(target_dummy)) Directory.Delete(target_root) # ---------------------------- # インスタンスメソッド # ---------------------------- """ def test_Stat(self): target_root = '/tmp/work/__TEST__' target_dummy = os.path.join(target_root, 'a.dummy') File.CreateDummy(target_dummy, 1024) s = File(target_root) self.assertEqual(File, type(s)) self.assertEqual(os.stat_result, type(s.Stat)) Directory.Delete(target_root) """ def test_Path(self): target_root = '/tmp/work/__TEST__' target_dummy = os.path.join(target_root, 'a.dummy') File.CreateDummy(target_dummy, 1024) s = File(target_root) self.assertEqual('/tmp/work/__TEST__', s.Path) Directory.Delete(target_root) def test_Size(self): target_root = '/tmp/work/__TEST__' target_dummy = os.path.join(target_root, 'a.dummy') s = File(target_dummy) s.mk_dummy(1024) self.assertEqual(1024, s.Size) s = File('/tmp/work/__TEST__/B/b.txt') s.mk_dummy(2048) self.assertEqual(2048, s.Size) s = File('/tmp/work/__TEST__/C/c.txt') s.mk_dummy(3072) self.assertEqual(3072, s.Size) s = File('/tmp/work/__TEST__/D/DD/d.txt') s.mk_dummy(4096) self.assertEqual(4096, s.Size) Directory.Delete(target_root) def test_Mode(self): target_root = '/tmp/work/__TEST__' target_dummy = os.path.join(target_root, 'a.dummy') File.CreateDummy(target_dummy, 1024) s = File(target_root) s.Mode = 0o777 self.assertEqual(0o40777, s.Mode) self.assertEqual('drwxrwxrwx', s.ModeName) s.Mode = 0o644 self.assertEqual(0o40644, s.Mode) self.assertEqual('drw-r--r--', s.ModeName) s.Mode = '-rwxrwxrwx' self.assertEqual(0o40777, s.Mode) self.assertEqual('drwxrwxrwx', s.ModeName) Directory.Delete(target_root) def test_Modified(self): target_root = '/tmp/work/__TEST__' target_dummy = os.path.join(target_root, 'a.dummy') File.CreateDummy(target_dummy, 1024) s = File(target_root) self.assertTrue(tuple == type(s.Modified)) self.assertTrue(2 == len(s.Modified)) self.assertTrue(float == type(s.Modified[0])) self.assertTrue(datetime.datetime == type(s.Modified[1])) dt1 = datetime.datetime.strptime('1999/12/31 23:59:59', '%Y/%m/%d %H:%M:%S') dt2 = datetime.datetime.strptime('2345/01/02 12:34:56', '%Y/%m/%d %H:%M:%S') epoch, dt = s.Modified self.assertTrue(dt1 != dt) self.assertTrue(dt2 != dt) s.Modified = dt1 self.assertTrue(int(time.mktime(dt1.timetuple())) == s.Modified[0]) self.assertTrue(dt1 == s.Modified[1]) self.assertTrue(dt1 != s.Accessed[1]) self.assertTrue(dt1 != s.Created[1]) self.assertTrue(dt1 != s.ChangedMeta[1]) Directory.Delete(target_root) def test_Accessed(self): target_root = '/tmp/work/__TEST__' target_dummy = os.path.join(target_root, 'a.dummy') File.CreateDummy(target_dummy, 1024) s = File(target_root) self.assertTrue(tuple == type(s.Accessed)) self.assertTrue(2 == len(s.Accessed)) self.assertTrue(float == type(s.Accessed[0])) self.assertTrue(datetime.datetime == type(s.Accessed[1])) dt1 = datetime.datetime.strptime('1999/12/31 23:59:59', '%Y/%m/%d %H:%M:%S') dt2 = datetime.datetime.strptime('2345/01/02 12:34:56', '%Y/%m/%d %H:%M:%S') epoch, dt = s.Accessed self.assertTrue(dt1 != dt) self.assertTrue(dt2 != dt) s.Accessed = dt1 self.assertTrue(int(time.mktime(dt1.timetuple())) == s.Accessed[0]) self.assertTrue(dt1 == s.Accessed[1]) self.assertTrue(dt1 != s.Modified[1]) self.assertTrue(dt1 != s.Created[1]) self.assertTrue(dt1 != s.ChangedMeta[1]) Directory.Delete(target_root) def test_ChangedMeta(self): target_root = '/tmp/work/__TEST__' target_dummy = os.path.join(target_root, 'a.dummy') File.CreateDummy(target_dummy, 1024) s = File(target_root) self.assertTrue(hasattr(s, 'ChangedMeta')) self.assertTrue(hasattr(s, 'Created')) print(s.ChangedMeta) print(s.Created) Directory.Delete(target_root) def test_Ids_Property(self): target_root = '/tmp/work/__TEST__' target_dummy = os.path.join(target_root, 'a.dummy') File.CreateDummy(target_dummy, 1024) s = File(target_root) self.assertTrue(hasattr(s, 'OwnUserId')) self.assertTrue(hasattr(s, 'OwnGroupId')) self.assertTrue(hasattr(s, 'HardLinkNum')) self.assertTrue(hasattr(s, 'INode')) self.assertTrue(hasattr(s, 'DeviceId')) print(s.OwnUserId) print(s.OwnGroupId) print(s.HardLinkNum) print(s.INode) print(s.DeviceId) Directory.Delete(target_root) if __name__ == '__main__': unittest.main()
41.689464
222
0.6202
2,889
22,554
4.589477
0.067844
0.139377
0.092918
0.035297
0.810318
0.775549
0.721623
0.648013
0.619428
0.569047
0
0.026578
0.215926
22,554
540
223
41.766667
0.723196
0.022745
0
0.528889
0
0.002222
0.163729
0.075635
0
0
0
0
0.431111
1
0.062222
false
0
0.011111
0
0.075556
0.037778
0
0
0
null
0
0
0
1
1
1
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
4
d105fd819be01d37eabcfc76984d50eb4c0e68fb
20,654
py
Python
tests/unit/test_searchtools.py
canonical/hotsos
1960e80a3f7529045c44798b0d3ac27d75036562
[ "Apache-2.0" ]
6
2021-10-01T19:46:14.000Z
2022-03-31T17:05:08.000Z
tests/unit/test_searchtools.py
canonical/hotsos
1960e80a3f7529045c44798b0d3ac27d75036562
[ "Apache-2.0" ]
111
2021-10-01T18:18:17.000Z
2022-03-29T12:23:20.000Z
tests/unit/test_searchtools.py
canonical/hotsos
1960e80a3f7529045c44798b0d3ac27d75036562
[ "Apache-2.0" ]
10
2021-09-29T14:47:54.000Z
2022-03-18T14:52:16.000Z
import glob import os import tempfile from unittest import mock from . import utils from hotsos.core.config import setup_config, HotSOSConfig from hotsos.core.searchtools import ( FileSearcher, FilterDef, SearchDef, SearchResult, SequenceSearchDef, ) FILTER_TEST_1 = """blah blah ERROR blah blah blah ERROR blah blah blah INFO blah """ SEQ_TEST_1 = """a start point leads to an ending """ SEQ_TEST_2 = """a start point another start point leads to an ending """ SEQ_TEST_3 = """a start point another start point leads to an ending a start point """ SEQ_TEST_4 = """a start point another start point value is 3 """ SEQ_TEST_5 = """a start point another start point value is 3 another start point value is 4 """ SEQ_TEST_6 = """section 1 1_1 1_2 section 2 2_1 """ SEQ_TEST_7 = """section 1 1_1 1_2 section 2 2_1 section 3 3_1 """ MULTI_SEQ_TEST = """ sectionB 1 1_1 sectionA 1 1_1 sectionB 2 2_2 sectionA 2 2_1 """ class TestSearchTools(utils.BaseTestCase): @mock.patch.object(os, "environ", {}) @mock.patch.object(os, "cpu_count") def test_filesearcher_num_cpus_no_override(self, mock_cpu_count): mock_cpu_count.return_value = 3 with mock.patch.object(FileSearcher, 'num_files_to_search', 4): s = FileSearcher() self.assertEqual(s.num_cpus, 3) @mock.patch.object(os, "environ", {}) @mock.patch.object(os, "cpu_count") def test_filesearcher_num_cpus_files_capped(self, mock_cpu_count): mock_cpu_count.return_value = 3 with mock.patch.object(FileSearcher, 'num_files_to_search', 2): s = FileSearcher() self.assertEqual(s.num_cpus, 2) @mock.patch.object(os, "cpu_count") def test_filesearcher_num_cpus_w_override(self, mock_cpu_count): setup_config(MAX_PARALLEL_TASKS=2) mock_cpu_count.return_value = 3 with mock.patch.object(FileSearcher, 'num_files_to_search', 4): s = FileSearcher() self.assertEqual(s.num_cpus, 2) def test_filesearcher_logs(self): expected = {9891: '2022-02-09 22:50:18.131', 9892: '2022-02-09 22:50:19.703'} logs_root = "var/log/neutron/" filepath = os.path.join(HotSOSConfig.DATA_ROOT, logs_root, 'neutron-openvswitch-agent.log.2.gz') globpath = os.path.join(HotSOSConfig.DATA_ROOT, logs_root, 'neutron-l3-agent.log') globpath_file1 = os.path.join(HotSOSConfig.DATA_ROOT, logs_root, 'neutron-l3-agent.log') globpath_file2 = os.path.join(HotSOSConfig.DATA_ROOT, logs_root, 'neutron-l3-agent.log.1.gz') s = FileSearcher() sd = SearchDef(r'^(\S+\s+[0-9:\.]+)\s+.+full sync.+', tag="T1") s.add_search_term(sd, filepath) sd = SearchDef(r'^(\S+\s+[0-9:\.]+)\s+.+ERROR.+', tag="T2") s.add_search_term(sd, filepath) sd = SearchDef((r'^(\S+\s+[0-9:\.]+)\s+.+ INFO .+ Router [0-9a-f\-]+' '.+'), tag="T3") s.add_search_term(sd, globpath) sd = SearchDef(r'non-existant-pattern', tag="T4") # search for something that doesn't exist to test that code path s.add_search_term(sd, globpath) results = s.search() self.assertEqual(set(results.files), set([filepath, globpath])) self.assertEqual(len(results.find_by_path(filepath)), 1220) tag_results = results.find_by_tag("T1", path=filepath) self.assertEqual(len(tag_results), 2) for result in tag_results: ln = result.linenumber self.assertEqual(result.tag, "T1") self.assertEqual(result.get(1), expected[ln]) tag_results = results.find_by_tag("T1") self.assertEqual(len(tag_results), 2) for result in tag_results: ln = result.linenumber self.assertEqual(result.tag, "T1") self.assertEqual(result.get(1), expected[ln]) self.assertEqual(len(results.find_by_path(globpath_file1)), 1) self.assertEqual(len(results.find_by_path(globpath_file2)), 0) # these files have the same content so expect same result from both expected = {5380: '2022-02-10 16:09:22.641'} path_results = results.find_by_path(globpath_file1) for result in path_results: ln = result.linenumber self.assertEqual(result.tag, "T3") self.assertEqual(result.get(1), expected[ln]) path_results = results.find_by_path(globpath_file2) for result in path_results: ln = result.linenumber self.assertEqual(result.tag, "T3") self.assertEqual(result.get(1), expected[ln]) def test_filesearcher_network_info(self): filepath = os.path.join(HotSOSConfig.DATA_ROOT, 'sos_commands', 'networking', 'ip_-d_address') filepath2 = os.path.join(HotSOSConfig.DATA_ROOT, 'sos_commands', 'networking', 'ip_-s_-d_link') ip = "10.0.0.128" mac = "22:c2:7b:1c:12:1b" s = FileSearcher() sd = SearchDef(r".+({}).+".format(ip)) s.add_search_term(sd, filepath) sd = SearchDef(r"^\s+link/ether\s+({})\s+.+".format(mac)) s.add_search_term(sd, filepath2) results = s.search() self.assertEqual(set(results.files), set([filepath, filepath2])) self.assertEqual(len(results.find_by_path(filepath)), 1) self.assertEqual(len(results.find_by_path(filepath2)), 2) self.assertEqual(results.find_by_path(filepath)[0].linenumber, 38) for result in results.find_by_path(filepath): self.assertEqual(result.get(1), ip) expected = {52: mac, 141: mac} for result in results.find_by_path(filepath2): ln = result.linenumber self.assertEqual(result.tag, None) self.assertEqual(result.get(1), expected[ln]) def test_filesearcher_error(self): s = FileSearcher() with mock.patch.object(SearchResult, '__init__') as mock_init: def fake_init(*args, **kwargs): raise EOFError("some error") mock_init.side_effect = fake_init path = os.path.join(HotSOSConfig.DATA_ROOT) s.add_search_term(SearchDef("."), path) s.search() def test_filesearch_filesort(self): ordered_contents = [] self.maxDiff = None with tempfile.TemporaryDirectory() as dtmp: os.mknod(os.path.join(dtmp, "my-test-agent.log")) ordered_contents.append("my-test-agent.log") os.mknod(os.path.join(dtmp, "my-test-agent.log.1")) ordered_contents.append("my-test-agent.log.1") # add in an erroneous file that does not follow logrotate format os.mknod(os.path.join(dtmp, "my-test-agent.log.tar.gz")) for i in range(2, 100): fname = "my-test-agent.log.{}.gz".format(i) os.mknod(os.path.join(dtmp, fname)) ordered_contents.append(fname) self.assertEqual(FileSearcher().logrotate_file_sort(fname), i) ordered_contents.append("my-test-agent.log.tar.gz") contents = os.listdir(dtmp) self.assertEqual(sorted(contents, key=FileSearcher().logrotate_file_sort), ordered_contents) def test_filesearch_glob_filesort(self): dir_contents = [] self.maxDiff = None with tempfile.TemporaryDirectory() as dtmp: dir_contents.append(os.path.join(dtmp, "my-test-agent.0.log")) dir_contents.append(os.path.join(dtmp, "my-test-agent.1.log")) dir_contents.append(os.path.join(dtmp, "my-test-agent.1.log.1")) dir_contents.append(os.path.join(dtmp, "my-test-agent.2.log")) dir_contents.append(os.path.join(dtmp, "my-test-agent.16.log")) dir_contents.append(os.path.join(dtmp, "my-test-agent.49.log")) dir_contents.append(os.path.join(dtmp, "my-test-agent.49.log.1")) dir_contents.append(os.path.join(dtmp, "my-test-agent.77.log")) dir_contents.append(os.path.join(dtmp, "my-test-agent.100.log")) dir_contents.append(os.path.join(dtmp, "my-test-agent.100.log.1")) dir_contents.append(os.path.join(dtmp, "my-test-agent.110.log")) dir_contents.append(os.path.join(dtmp, "my-test-agent.142.log")) dir_contents.append(os.path.join(dtmp, "my-test-agent.183.log")) for e in dir_contents: os.mknod(e) for i in range(2, HotSOSConfig.MAX_LOGROTATE_DEPTH + 10): fname = os.path.join(dtmp, "my-test-agent.1.log.{}.gz".format(i)) os.mknod(fname) if i <= HotSOSConfig.MAX_LOGROTATE_DEPTH: dir_contents.append(fname) for i in range(2, HotSOSConfig.MAX_LOGROTATE_DEPTH + 10): fname = os.path.join(dtmp, "my-test-agent.49.log.{}.gz".format(i)) os.mknod(fname) if i <= HotSOSConfig.MAX_LOGROTATE_DEPTH: dir_contents.append(fname) for i in range(2, HotSOSConfig.MAX_LOGROTATE_DEPTH + 10): fname = os.path.join(dtmp, "my-test-agent.100.log.{}.gz".format(i)) os.mknod(fname) if i <= HotSOSConfig.MAX_LOGROTATE_DEPTH: dir_contents.append(fname) exp = sorted(dir_contents) path = os.path.join(dtmp, 'my-test-agent*.log*') act = sorted(FileSearcher().filtered_paths(glob.glob(path))) self.assertEqual(act, exp) def test_sequence_searcher(self): with tempfile.NamedTemporaryFile(mode='w', delete=False) as ftmp: ftmp.write(SEQ_TEST_1) ftmp.close() s = FileSearcher() sd = SequenceSearchDef(start=SearchDef( r"^a\S* (start\S*) point\S*"), body=SearchDef(r"leads to"), end=SearchDef(r"^an (ending)$"), tag="seq-search-test1") s.add_search_term(sd, path=ftmp.name) results = s.search() sections = results.find_sequence_sections(sd) self.assertEqual(len(sections), 1) for id in sections: for r in sections[id]: if r.tag == sd.start_tag: self.assertEqual(r.get(1), "start") elif r.tag == sd.end_tag: self.assertEqual(r.get(1), "ending") os.remove(ftmp.name) def test_sequence_searcher_overlapping(self): with tempfile.NamedTemporaryFile(mode='w', delete=False) as ftmp: ftmp.write(SEQ_TEST_2) ftmp.close() s = FileSearcher() sd = SequenceSearchDef(start=SearchDef( r"^(a\S*) (start\S*) point\S*"), body=SearchDef(r"leads to"), end=SearchDef(r"^an (ending)$"), tag="seq-search-test2") s.add_search_term(sd, path=ftmp.name) results = s.search() sections = results.find_sequence_sections(sd) self.assertEqual(len(sections), 1) for id in sections: for r in sections[id]: if r.tag == sd.start_tag: self.assertEqual(r.get(1), "another") elif r.tag == sd.end_tag: self.assertEqual(r.get(1), "ending") os.remove(ftmp.name) def test_sequence_searcher_overlapping_incomplete(self): with tempfile.NamedTemporaryFile(mode='w', delete=False) as ftmp: ftmp.write(SEQ_TEST_3) ftmp.close() s = FileSearcher() sd = SequenceSearchDef(start=SearchDef( r"^(a\S*) (start\S*) point\S*"), body=SearchDef(r"leads to"), end=SearchDef(r"^an (ending)$"), tag="seq-search-test3") s.add_search_term(sd, path=ftmp.name) results = s.search() sections = results.find_sequence_sections(sd) self.assertEqual(len(sections), 1) for id in sections: for r in sections[id]: if r.tag == sd.start_tag: self.assertEqual(r.get(1), "another") elif r.tag == sd.end_tag: self.assertEqual(r.get(1), "ending") os.remove(ftmp.name) def test_sequence_searcher_incomplete_eof_match(self): with tempfile.NamedTemporaryFile(mode='w', delete=False) as ftmp: ftmp.write(SEQ_TEST_4) ftmp.close() s = FileSearcher() sd = SequenceSearchDef(start=SearchDef( r"^(a\S*) (start\S*) point\S*"), body=SearchDef(r"value is (\S+)"), end=SearchDef(r"^$"), tag="seq-search-test4") s.add_search_term(sd, path=ftmp.name) results = s.search() sections = results.find_sequence_sections(sd) self.assertEqual(len(sections), 1) for id in sections: for r in sections[id]: if r.tag == sd.start_tag: self.assertEqual(r.get(1), "another") elif r.tag == sd.body_tag: self.assertEqual(r.get(1), "3") elif r.tag == sd.end_tag: self.assertEqual(r.get(0), "") os.remove(ftmp.name) def test_sequence_searcher_multiple_sections(self): with tempfile.NamedTemporaryFile(mode='w', delete=False) as ftmp: ftmp.write(SEQ_TEST_5) ftmp.close() s = FileSearcher() sd = SequenceSearchDef(start=SearchDef( r"^(a\S*) (start\S*) point\S*"), body=SearchDef(r"value is (\S+)"), end=SearchDef(r"^$"), tag="seq-search-test5") s.add_search_term(sd, path=ftmp.name) results = s.search() sections = results.find_sequence_sections(sd) self.assertEqual(len(sections), 2) for id in sections: for r in sections[id]: if r.tag == sd.start_tag: self.assertEqual(r.get(1), "another") elif r.tag == sd.body_tag: self.assertTrue(r.get(1) in ["3", "4"]) elif r.tag == sd.end_tag: self.assertEqual(r.get(0), "") os.remove(ftmp.name) def test_sequence_searcher_eof(self): """ Test scenario: * multiple sections that end with start of the next * start def matches any start * end def matches any start * file ends before start of next """ with tempfile.NamedTemporaryFile(mode='w', delete=False) as ftmp: ftmp.write(SEQ_TEST_6) ftmp.close() s = FileSearcher() sd = SequenceSearchDef(start=SearchDef(r"^section (\d+)"), body=SearchDef(r"\d_\d"), tag="seq-search-test6") s.add_search_term(sd, path=ftmp.name) results = s.search() sections = results.find_sequence_sections(sd) self.assertEqual(len(sections), 2) for id in sections: for r in sections[id]: if r.tag == sd.start_tag: section = r.get(1) self.assertTrue(r.get(1) in ["1", "2"]) elif r.tag == sd.body_tag: if section == "1": self.assertTrue(r.get(0) in ["1_1", "1_2"]) else: self.assertTrue(r.get(0) in ["2_1"]) os.remove(ftmp.name) def test_sequence_searcher_section_start_end_same(self): """ Test scenario: * multiple sections that end with start of the next * start def matches unique start * end def matches any start """ with tempfile.NamedTemporaryFile(mode='w', delete=False) as ftmp: ftmp.write(SEQ_TEST_7) ftmp.close() s = FileSearcher() sd = SequenceSearchDef(start=SearchDef(r"^section (2)"), body=SearchDef(r"\d_\d"), end=SearchDef( r"^section (\d+)"), tag="seq-search-test7") s.add_search_term(sd, path=ftmp.name) results = s.search() sections = results.find_sequence_sections(sd) self.assertEqual(len(sections), 1) for id in sections: for r in sections[id]: if r.tag == sd.start_tag: self.assertEqual(r.get(1), "2") elif r.tag == sd.body_tag: self.assertTrue(r.get(0) in ["2_1"]) os.remove(ftmp.name) def test_sequence_searcher_multi_sequence(self): """ Test scenario: * search containing multiple seqeunce definitions * data containing 2 results of each where one is incomplete * test that single incomplete result gets removed """ with tempfile.NamedTemporaryFile(mode='w', delete=False) as ftmp: ftmp.write(MULTI_SEQ_TEST) ftmp.close() s = FileSearcher() sdA = SequenceSearchDef(start=SearchDef(r"^sectionA (\d+)"), body=SearchDef(r"\d_\d"), end=SearchDef( r"^section\S+ (\d+)"), tag="seqA-search-test") sdB = SequenceSearchDef(start=SearchDef(r"^sectionB (\d+)"), body=SearchDef(r"\d_\d"), end=SearchDef( r"^section\S+ (\d+)"), tag="seqB-search-test") s.add_search_term(sdA, path=ftmp.name) s.add_search_term(sdB, path=ftmp.name) results = s.search() sections = results.find_sequence_sections(sdA) self.assertEqual(len(sections), 1) sections = results.find_sequence_sections(sdB) self.assertEqual(len(sections), 2) os.remove(ftmp.name) def test_search_filter(self): with tempfile.NamedTemporaryFile(mode='w', delete=False) as ftmp: ftmp.write(FILTER_TEST_1) ftmp.close() s = FileSearcher() fd = FilterDef(r" (INFO)") s.add_filter_term(fd, path=ftmp.name) sd = SearchDef(r".+ INFO (.+)") s.add_search_term(sd, path=ftmp.name) results = s.search().find_by_path(ftmp.name) self.assertEqual(len(results), 1) for r in results: self.assertEqual(r.get(1), "blah") os.remove(ftmp.name) def test_search_filter_invert_match(self): with tempfile.NamedTemporaryFile(mode='w', delete=False) as ftmp: ftmp.write(FILTER_TEST_1) ftmp.close() s = FileSearcher() fd = FilterDef(r" (ERROR)", invert_match=True) s.add_filter_term(fd, path=ftmp.name) sd = SearchDef(r".+ INFO (.+)") s.add_search_term(sd, path=ftmp.name) results = s.search().find_by_path(ftmp.name) self.assertEqual(len(results), 1) for r in results: self.assertEqual(r.get(1), "blah") os.remove(ftmp.name)
39.56705
79
0.534812
2,443
20,654
4.380679
0.111339
0.072884
0.026163
0.027472
0.795833
0.766399
0.737058
0.704635
0.666791
0.640908
0
0.022405
0.345212
20,654
521
80
39.642994
0.768929
0.0321
0
0.584862
0
0.002294
0.11059
0.023388
0
0
0
0
0.130734
1
0.043578
false
0
0.016055
0
0.061927
0
0
0
0
null
0
0
0
0
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
4
d10c91aeb1ebbaeec21b56fc9e92b2459863b1e8
160
py
Python
app/models/forms.py
raimota/Gerador-Validador-CPF_CNPJ
e2af5ec35995b63b4bb739af92e9532563d9ed12
[ "MIT" ]
null
null
null
app/models/forms.py
raimota/Gerador-Validador-CPF_CNPJ
e2af5ec35995b63b4bb739af92e9532563d9ed12
[ "MIT" ]
null
null
null
app/models/forms.py
raimota/Gerador-Validador-CPF_CNPJ
e2af5ec35995b63b4bb739af92e9532563d9ed12
[ "MIT" ]
null
null
null
from flask_wtf import FlaskForm from wtforms import StringField from wtforms.validators import DataRequired class Campos(FlaskForm): es = StringField('es')
26.666667
43
0.8125
20
160
6.45
0.6
0.170543
0
0
0
0
0
0
0
0
0
0
0.13125
160
6
44
26.666667
0.928058
0
0
0
0
0
0.012422
0
0
0
0
0
0
1
0
false
0
0.6
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
0
0
1
0
1
0
0
4
d113b6f34bb07a1a16e4fef926c78e11ef306ee3
129
py
Python
cwf2neo/tests/__init__.py
sintax1/cwf2neo
25a8186798a6611f91e4b39052c3baa2023fb5b1
[ "Apache-2.0" ]
1
2021-06-02T11:44:00.000Z
2021-06-02T11:44:00.000Z
cwf2neo/tests/__init__.py
sintax1/cwf2neo
25a8186798a6611f91e4b39052c3baa2023fb5b1
[ "Apache-2.0" ]
null
null
null
cwf2neo/tests/__init__.py
sintax1/cwf2neo
25a8186798a6611f91e4b39052c3baa2023fb5b1
[ "Apache-2.0" ]
1
2021-11-27T00:33:28.000Z
2021-11-27T00:33:28.000Z
import sys # NOQA import os current_path = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, current_path + '/../')
21.5
57
0.72093
20
129
4.35
0.55
0.252874
0
0
0
0
0
0
0
0
0
0.008696
0.108527
129
5
58
25.8
0.747826
0.031008
0
0
0
0
0.03252
0
0
0
0
0
0
1
0
false
0
0.5
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
0
0
1
0
0
0
0
4
d12838004d4065065c15278b26ac7643b7d1e6b3
8,553
py
Python
tests/settings/test_custom_metrics.py
proknow/proknow-python
c4ca0be6f606db655b711d3490febdec9c139570
[ "MIT" ]
2
2019-03-16T21:41:45.000Z
2022-02-09T16:01:58.000Z
tests/settings/test_custom_metrics.py
proknow/proknow-python
c4ca0be6f606db655b711d3490febdec9c139570
[ "MIT" ]
7
2019-02-25T15:04:30.000Z
2021-12-13T15:15:38.000Z
tests/settings/test_custom_metrics.py
proknow/proknow-python
c4ca0be6f606db655b711d3490febdec9c139570
[ "MIT" ]
3
2020-07-10T14:18:55.000Z
2021-09-14T09:47:41.000Z
import pytest import re from proknow import Exceptions def test_create(app, custom_metric_generator): pk = app.pk # Verify returned CustomMetricItem params, custom_metric = custom_metric_generator() assert custom_metric.name == params["name"] assert custom_metric.context == params["context"] assert custom_metric.type == params["type"] # Assert item can be found in query custom_metrics = pk.custom_metrics.query() for custom_metric in custom_metrics: if custom_metric.name == params["name"]: custom_metric_match = custom_metric break else: custom_metric_match = None assert custom_metric_match is not None assert custom_metric_match.name == params["name"] assert custom_metric_match.context == params["context"] assert custom_metric_match.type == params["type"] def test_create_failure(app, custom_metric_generator): pk = app.pk params, custom_metric = custom_metric_generator() # Assert error is raised for duplicate custom metric with pytest.raises(Exceptions.HttpError) as err_wrapper: pk.custom_metrics.create(**params) assert err_wrapper.value.status_code == 409 assert err_wrapper.value.body == 'Custom metric already exists with name "' + params["name"] + '"' def test_delete(app, custom_metric_generator): pk = app.pk params, custom_metric = custom_metric_generator(do_not_mark=True) # Verify custom metric was deleted successfully custom_metric.delete() for custom_metric in pk.custom_metrics.query(): if custom_metric.name == params["name"]: match = custom_metric break else: match = None assert match is None def test_delete_failure(app, custom_metric_generator): pk = app.pk params, custom_metric = custom_metric_generator(do_not_mark=True) custom_metric.delete() # Assert error is raised when attempting to delete protected custom metric with pytest.raises(Exceptions.HttpError) as err_wrapper: custom_metric.delete() assert err_wrapper.value.status_code == 404 assert err_wrapper.value.body == 'Custom metric "' + custom_metric.id + '" not found' def test_find(app, custom_metric_generator): pk = app.pk params, custom_metric = custom_metric_generator(name="Find Me") expr = re.compile(r"ind M") # Find with no args found = pk.custom_metrics.find() assert found is None # Find using predicate found = pk.custom_metrics.find(lambda ws: expr.search(ws.data["name"]) is not None) assert found is not None assert found.name == params["name"] assert found.context == params["context"] assert found.type == params["type"] # Find using props found = pk.custom_metrics.find(id=custom_metric.id, name=params["name"]) assert found is not None assert found.name == params["name"] assert found.context == params["context"] assert found.type == params["type"] # Find using both found = pk.custom_metrics.find(lambda ws: expr.search(ws.data["name"]) is not None, id=custom_metric.id, name=params["name"]) assert found is not None assert found.name == params["name"] assert found.context == params["context"] assert found.type == params["type"] # Find failure found = pk.custom_metrics.find(lambda ws: expr.search(ws.data["id"]) is not None) assert found is None found = pk.custom_metrics.find(id=custom_metric.id, name=params["name"].lower()) assert found is None def test_query(app, custom_metric_generator): pk = app.pk params1, custom_metric1 = custom_metric_generator() params2, custom_metric2 = custom_metric_generator() # Verify test 1 for custom_metric in pk.custom_metrics.query(): if custom_metric.name == params1["name"]: match = custom_metric break else: match = None assert match is not None assert match.name == params1["name"] assert match.context == params1["context"] assert match.type == params1["type"] # Verify test 2 for custom_metric in pk.custom_metrics.query(): if custom_metric.name == params2["name"]: match = custom_metric break else: match = None assert match is not None assert match.name == params2["name"] assert match.context == params2["context"] assert match.type == params2["type"] def test_resolve(app, custom_metric_generator): pk = app.pk params, custom_metric = custom_metric_generator() # Test resolve by id resolved = pk.custom_metrics.resolve(custom_metric.id) assert resolved is not None assert resolved.name == params["name"] assert resolved.context == params["context"] assert resolved.type == params["type"] # Test resolve by name resolved = pk.custom_metrics.resolve(params["name"]) assert resolved is not None assert resolved.name == params["name"] assert resolved.context == params["context"] assert resolved.type == params["type"] def test_resolve_failure(app): pk = app.pk # Test resolve by id with pytest.raises(Exceptions.CustomMetricLookupError) as err_wrapper: pk.custom_metrics.resolve("00000000000000000000000000000000") assert err_wrapper.value.message == "Custom metric with id `00000000000000000000000000000000` not found." # Test resolve by name with pytest.raises(Exceptions.CustomMetricLookupError) as err_wrapper: pk.custom_metrics.resolve("My Metric") assert err_wrapper.value.message == "Custom metric with name `My Metric` not found." def test_resolve_by_id(app, custom_metric_generator): pk = app.pk params, custom_metric = custom_metric_generator() resolved = pk.custom_metrics.resolve_by_id(custom_metric.id) assert resolved is not None assert resolved.name == params["name"] assert resolved.context == params["context"] assert resolved.type == params["type"] def test_resolve_by_id_failure(app): pk = app.pk with pytest.raises(Exceptions.CustomMetricLookupError) as err_wrapper: pk.custom_metrics.resolve_by_id("00000000000000000000000000000000") assert err_wrapper.value.message == "Custom metric with id `00000000000000000000000000000000` not found." def test_resolve_by_name(app, custom_metric_generator): pk = app.pk params, custom_metric = custom_metric_generator(name="custom-lower1") resolved = pk.custom_metrics.resolve_by_name(params["name"]) assert resolved is not None assert resolved.name == params["name"] assert resolved.context == params["context"] assert resolved.type == params["type"] resolved = pk.custom_metrics.resolve_by_name(params["name"].upper()) assert resolved is not None assert resolved.name == params["name"] assert resolved.context == params["context"] assert resolved.type == params["type"] def test_resolve_by_name_failure(app): pk = app.pk with pytest.raises(Exceptions.CustomMetricLookupError) as err_wrapper: pk.custom_metrics.resolve("My Custom Metric") assert err_wrapper.value.message == "Custom metric with name `My Custom Metric` not found." def test_update(app, custom_metric_generator): pk = app.pk resource_prefix = app.resource_prefix params, custom_metric = custom_metric_generator() # Verify custom metric was updated successfully updated_name = resource_prefix + "Updated Custom Metric Name" custom_metric.name = updated_name custom_metric.context = "image_set" custom_metric.save() custom_metrics = pk.custom_metrics.query() for custom_metric in custom_metrics: if custom_metric.name == updated_name: custom_metric_match = custom_metric break else: custom_metric_match = None assert custom_metric_match is not None assert custom_metric_match.name == updated_name assert custom_metric_match.context == "image_set" assert custom_metric_match.type == params["type"] def test_update_failure(app, custom_metric_generator): pk = app.pk params1, _ = custom_metric_generator() params2, custom_metric = custom_metric_generator() # Assert error is raised for duplicate workspace with pytest.raises(Exceptions.HttpError) as err_wrapper: custom_metric.name = params1["name"] custom_metric.save() assert err_wrapper.value.status_code == 409 assert err_wrapper.value.body == 'Custom metric already exists with name "' + params1["name"] + '"'
35.342975
129
0.70677
1,110
8,553
5.255856
0.097297
0.189236
0.08639
0.035996
0.82722
0.787796
0.727117
0.694549
0.693349
0.649126
0
0.022694
0.196305
8,553
241
130
35.489627
0.826011
0.061031
0
0.611429
0
0
0.092986
0.016475
0
0
0
0
0.371429
1
0.08
false
0
0.017143
0
0.097143
0
0
0
0
null
0
0
0
1
1
1
0
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
4
d16e58dab4d8d43ee2c7010a1953ed764c83accd
531
py
Python
python/15_bsearch/bsearch_recursion.py
shipan3452/algo
0494cc0d8f5daf108daf4358c4531a29279dd380
[ "Apache-2.0" ]
22,028
2018-09-27T05:55:19.000Z
2022-03-30T10:44:46.000Z
python/15_bsearch/bsearch_recursion.py
wangjing013/algo
b2c1228ff915287ad7ebeae4355fa26854ea1557
[ "Apache-2.0" ]
164
2018-10-06T15:11:08.000Z
2022-03-28T10:04:34.000Z
python/15_bsearch/bsearch_recursion.py
wangjing013/algo
b2c1228ff915287ad7ebeae4355fa26854ea1557
[ "Apache-2.0" ]
7,250
2018-09-30T00:45:25.000Z
2022-03-31T20:15:33.000Z
""" Author: dreamkong """ from typing import List def bsearch(nums: List[int], target: int) -> int: return bsearch_internally(nums, 0, len(nums)-1, target) def bsearch_internally(nums: List[int], low: int, high: int, target: int) -> int: if low > high: return -1 mid = low+int((high-low) >> 2) if nums[mid] == target: return mid elif nums[mid] < target: return bsearch_internally(nums, mid+1, high, target) else: return bsearch_internally(nums, low, mid-1, target)
23.086957
81
0.619586
74
531
4.391892
0.310811
0.209231
0.258462
0.249231
0
0
0
0
0
0
0
0.014925
0.242938
531
22
82
24.136364
0.793532
0.032015
0
0
0
0
0
0
0
0
0
0
0
1
0.153846
false
0
0.076923
0.076923
0.615385
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
0
0
0
0
0
1
0
0
4
0f162b0c31fb0578dd692face5da5fae3fc2df41
278
py
Python
app/utils/weak_random.py
michel-rodrigues/viggio_backend
f419f0b939209722e1eb1e272f33de172cd5c1f1
[ "MIT" ]
null
null
null
app/utils/weak_random.py
michel-rodrigues/viggio_backend
f419f0b939209722e1eb1e272f33de172cd5c1f1
[ "MIT" ]
null
null
null
app/utils/weak_random.py
michel-rodrigues/viggio_backend
f419f0b939209722e1eb1e272f33de172cd5c1f1
[ "MIT" ]
null
null
null
import random import string def random_string_digits(string_length=10): """Generate a random string of letters and digits.""" letters_and_digits = string.ascii_letters + string.digits return ''.join(random.choice(letters_and_digits) for _ in range(string_length))
30.888889
83
0.769784
39
278
5.230769
0.487179
0.147059
0.235294
0
0
0
0
0
0
0
0
0.008368
0.140288
278
8
84
34.75
0.845188
0.169065
0
0
1
0
0
0
0
0
0
0
0
1
0.2
false
0
0.4
0
0.8
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
0f4590671b6b3912fdd3111d3e454e140576dfa5
190
py
Python
dask_image/__init__.py
akhalighi/dask-image
8ff0f16dba8a874c7d8d3adf4e5e8bac5f4ee1bf
[ "BSD-3-Clause" ]
2
2020-06-05T07:17:57.000Z
2020-06-05T09:10:16.000Z
dask_image/__init__.py
akhalighi/dask-image
8ff0f16dba8a874c7d8d3adf4e5e8bac5f4ee1bf
[ "BSD-3-Clause" ]
15
2016-11-01T12:54:03.000Z
2019-02-28T18:16:48.000Z
mplview/__init__.py
jakirkham/mplview
0847e4ccf3c4247cb72f35600b7f5f553b429c2d
[ "BSD-3-Clause" ]
1
2016-11-17T06:09:16.000Z
2016-11-17T06:09:16.000Z
# -*- coding: utf-8 -*- __author__ = """John Kirkham""" __email__ = "kirkhamj@janelia.hhmi.org" from ._version import get_versions __version__ = get_versions()['version'] del get_versions
21.111111
39
0.721053
23
190
5.26087
0.73913
0.272727
0.297521
0
0
0
0
0
0
0
0
0.005988
0.121053
190
8
40
23.75
0.718563
0.110526
0
0
0
0
0.263473
0.149701
0
0
0
0
0
1
0
false
0
0.2
0
0.2
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
0
0
0
0
0
4
0f4e902dad9f3ec645661170ae5c6747b0ba3683
307
py
Python
menpo/io/input/landmark_image.py
yuxiang-zhou/menpo
01deaf3808cbe7a3d9db5542ac9d9f53cd81743a
[ "BSD-3-Clause" ]
null
null
null
menpo/io/input/landmark_image.py
yuxiang-zhou/menpo
01deaf3808cbe7a3d9db5542ac9d9f53cd81743a
[ "BSD-3-Clause" ]
1
2019-03-09T16:01:46.000Z
2019-03-09T16:01:46.000Z
menpo/io/input/landmark_image.py
yuxiang-zhou/menpo
01deaf3808cbe7a3d9db5542ac9d9f53cd81743a
[ "BSD-3-Clause" ]
1
2020-05-01T09:55:57.000Z
2020-05-01T09:55:57.000Z
from functools import partial from .landmark import asf_importer, pts_importer asf_image_importer = partial(asf_importer, image_origin=True) asf_image_importer.__doc__ = asf_importer.__doc__ pts_image_importer = partial(pts_importer, image_origin=True) pts_image_importer.__doc__ = pts_importer.__doc__
27.909091
61
0.85342
43
307
5.348837
0.27907
0.226087
0.13913
0.2
0
0
0
0
0
0
0
0
0.087948
307
10
62
30.7
0.821429
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
1
0
1
0
0
0
0
null
1
0
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
0
0
0
1
0
1
0
0
4
0f50e2935cc8d40993b0200cc3b73be06a60af61
372
py
Python
renomearArquivo.py
MarianaFRocha/Manipulacao-de-Arquivos
ee1c23e98579cb987d5df159536c6f366657efb0
[ "MIT" ]
null
null
null
renomearArquivo.py
MarianaFRocha/Manipulacao-de-Arquivos
ee1c23e98579cb987d5df159536c6f366657efb0
[ "MIT" ]
null
null
null
renomearArquivo.py
MarianaFRocha/Manipulacao-de-Arquivos
ee1c23e98579cb987d5df159536c6f366657efb0
[ "MIT" ]
null
null
null
import os # exemplo alterado de EX_10.5.py para 10_5.py for nome in os.listdir('./Minicurso/Minicurso API'): # alterar conforme sua necessidade de geração de nomes e layout de arquivos os.rename("./Minicurso/Minicurso API/"+nome, "./Minicurso/Minicurso API/"+nome+"_Minicurso_API.png") print("arquivo " + nome + " alterado para " +nome+"_Minicurso_API")
46.5
104
0.712366
54
372
4.796296
0.537037
0.23166
0.243243
0.19305
0.227799
0
0
0
0
0
0
0.019169
0.158602
372
8
105
46.5
0.808307
0.317204
0
0
0
0
0.532258
0.254032
0
0
0
0
0
1
0
false
0
0.25
0
0.25
0.25
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
0
0
0
0
0
4
0f6dc02e799dc65a7634ed67eacfd39cd76ca1b9
210
py
Python
library/render_partial.py
pythononwheels/diary
87ffd08d0dffe979799d9f441014bd5d71f00fc6
[ "MIT" ]
null
null
null
library/render_partial.py
pythononwheels/diary
87ffd08d0dffe979799d9f441014bd5d71f00fc6
[ "MIT" ]
null
null
null
library/render_partial.py
pythononwheels/diary
87ffd08d0dffe979799d9f441014bd5d71f00fc6
[ "MIT" ]
null
null
null
# # One Tornado UIModule to render them all ;) # import tornado.web class RenderPatialModule(tornado.web.UIModule): def render(self, partial=None): return "<h1>Hello, world!</h1><p>" + str(partial) + "</p>"
26.25
60
0.695238
29
210
5.034483
0.724138
0.136986
0
0
0
0
0
0
0
0
0
0.010989
0.133333
210
8
60
26.25
0.791209
0.2
0
0
0
0
0.175758
0
0
0
0
0
0
1
0.25
false
0
0.25
0.25
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
0
0
0
4
0f716674c3dc2ac73901984ceb01683e57a08e32
4,487
py
Python
python-client/cloudera/director/v8/models/__init__.py
daanknoope/director-sdk
a099fedd5afe365aedbb50daa75de048ef6f7ab4
[ "Apache-2.0" ]
24
2015-03-04T01:39:36.000Z
2020-06-30T13:34:27.000Z
python-client/cloudera/director/v8/models/__init__.py
daanknoope/director-sdk
a099fedd5afe365aedbb50daa75de048ef6f7ab4
[ "Apache-2.0" ]
5
2015-11-04T08:18:47.000Z
2019-01-05T11:12:19.000Z
python-client/cloudera/director/v8/models/__init__.py
daanknoope/director-sdk
a099fedd5afe365aedbb50daa75de048ef6f7ab4
[ "Apache-2.0" ]
26
2015-02-24T21:13:53.000Z
2020-12-15T06:01:46.000Z
# coding: utf-8 # flake8: noqa """ Licensed to Cloudera, Inc. under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Cloudera, Inc. licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ from __future__ import absolute_import # import models into model package from cloudera.director.v8.models.capabilities import Capabilities from cloudera.director.v8.models.cloud_provider_metadata import CloudProviderMetadata from cloudera.director.v8.models.cluster import Cluster from cloudera.director.v8.models.cluster_template import ClusterTemplate from cloudera.director.v8.models.configuration_property import ConfigurationProperty from cloudera.director.v8.models.configuration_property_value import ConfigurationPropertyValue from cloudera.director.v8.models.deployment import Deployment from cloudera.director.v8.models.deployment_template import DeploymentTemplate from cloudera.director.v8.models.diagnostic_data_summary import DiagnosticDataSummary from cloudera.director.v8.models.display_property import DisplayProperty from cloudera.director.v8.models.environment import Environment from cloudera.director.v8.models.error_info import ErrorInfo from cloudera.director.v8.models.eula import Eula from cloudera.director.v8.models.external_database import ExternalDatabase from cloudera.director.v8.models.external_database_server import ExternalDatabaseServer from cloudera.director.v8.models.external_database_server_template import ExternalDatabaseServerTemplate from cloudera.director.v8.models.external_database_server_usage import ExternalDatabaseServerUsage from cloudera.director.v8.models.external_database_template import ExternalDatabaseTemplate from cloudera.director.v8.models.health import Health from cloudera.director.v8.models.health_check import HealthCheck from cloudera.director.v8.models.import_result import ImportResult from cloudera.director.v8.models.import_status import ImportStatus from cloudera.director.v8.models.instance import Instance from cloudera.director.v8.models.instance_provider_config import InstanceProviderConfig from cloudera.director.v8.models.instance_state import InstanceState from cloudera.director.v8.models.instance_template import InstanceTemplate from cloudera.director.v8.models.login import Login from cloudera.director.v8.models.metering_setting import MeteringSetting from cloudera.director.v8.models.metrics import Metrics from cloudera.director.v8.models.migrating_group import MigratingGroup from cloudera.director.v8.models.migration import Migration from cloudera.director.v8.models.notification import Notification from cloudera.director.v8.models.password_change import PasswordChange from cloudera.director.v8.models.resource_provider_metadata import ResourceProviderMetadata from cloudera.director.v8.models.service import Service from cloudera.director.v8.models.ssh_credentials import SshCredentials from cloudera.director.v8.models.status import Status from cloudera.director.v8.models.time_series import TimeSeries from cloudera.director.v8.models.time_series_aggregate_statistics import TimeSeriesAggregateStatistics from cloudera.director.v8.models.time_series_cross_entity_metadata import TimeSeriesCrossEntityMetadata from cloudera.director.v8.models.time_series_data import TimeSeriesData from cloudera.director.v8.models.time_series_metadata import TimeSeriesMetadata from cloudera.director.v8.models.time_series_response import TimeSeriesResponse from cloudera.director.v8.models.time_series_response_list import TimeSeriesResponseList from cloudera.director.v8.models.time_series_row import TimeSeriesRow from cloudera.director.v8.models.user import User from cloudera.director.v8.models.validation_exception_condition import ValidationExceptionCondition from cloudera.director.v8.models.virtual_instance import VirtualInstance from cloudera.director.v8.models.virtual_instance_group import VirtualInstanceGroup
59.826667
104
0.872075
583
4,487
6.602058
0.307033
0.152767
0.254612
0.280073
0.448948
0.303455
0.192777
0.062873
0
0
0
0.01325
0.074883
4,487
74
105
60.635135
0.913997
0.178516
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.02
1
0
1
0
0
0
0
null
0
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
0
1
0
1
0
0
0
0
4
7e20dfa0bd8d4cf4dfc335988fbdb52ffa2d141f
110
py
Python
EduRec/meta/__init__.py
tswsxk/EduRec
b7514acc4dea805375fe512534d8ab6ad8916374
[ "MIT" ]
2
2021-03-03T11:04:53.000Z
2021-09-03T09:12:32.000Z
EduRec/meta/__init__.py
tswsxk/EduRec
b7514acc4dea805375fe512534d8ab6ad8916374
[ "MIT" ]
null
null
null
EduRec/meta/__init__.py
tswsxk/EduRec
b7514acc4dea805375fe512534d8ab6ad8916374
[ "MIT" ]
1
2021-03-22T02:55:53.000Z
2021-03-22T02:55:53.000Z
# coding: utf-8 # 2021/2/10 @ tongshiwei from .MeasurementModel import MeasurementModel from .SLM import SLM
18.333333
46
0.772727
15
110
5.666667
0.733333
0
0
0
0
0
0
0
0
0
0
0.085106
0.145455
110
5
47
22
0.819149
0.327273
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
0
0
0
4
7e245908b2f4ad986cdcf99565e90fb90d1d0b11
94
py
Python
tadataka/feature/__init__.py
IshitaTakeshi/Tadataka
852c7afb904503005e51884408e1492ef0be836f
[ "Apache-2.0" ]
54
2019-11-15T16:30:34.000Z
2022-01-13T15:18:54.000Z
tadataka/feature/__init__.py
IshitaTakeshi/Tadataka
852c7afb904503005e51884408e1492ef0be836f
[ "Apache-2.0" ]
11
2019-02-28T08:28:24.000Z
2020-04-07T04:47:12.000Z
tadataka/feature/__init__.py
IshitaTakeshi/Tadataka
852c7afb904503005e51884408e1492ef0be836f
[ "Apache-2.0" ]
1
2020-02-26T13:59:40.000Z
2020-02-26T13:59:40.000Z
from tadataka.feature.feature import ( extract_features, empty_match, Features, Matcher )
23.5
52
0.787234
11
94
6.545455
0.818182
0
0
0
0
0
0
0
0
0
0
0
0.138298
94
3
53
31.333333
0.888889
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
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
0
0
0
4
7e30930c06c92e07eeb6ff1012f99ba08b74bc72
213
py
Python
dzdp-server/app/source/job_creator.py
Onekki/dzdp
a4625b8ef998ed09845442837b8a7b6369011f5d
[ "MIT" ]
null
null
null
dzdp-server/app/source/job_creator.py
Onekki/dzdp
a4625b8ef998ed09845442837b8a7b6369011f5d
[ "MIT" ]
null
null
null
dzdp-server/app/source/job_creator.py
Onekki/dzdp
a4625b8ef998ed09845442837b8a7b6369011f5d
[ "MIT" ]
null
null
null
from fetcher.source.fetcher import Fetcher from fetcher.source.managers.notification import FetcherException def fetch(config_dict): f = Fetcher(config_dict) f.start() return "Job has been finished"
23.666667
65
0.769953
28
213
5.785714
0.642857
0.135802
0.209877
0
0
0
0
0
0
0
0
0
0.15493
213
8
66
26.625
0.9
0
0
0
0
0
0.098592
0
0
0
0
0
0
1
0.166667
false
0
0.333333
0
0.666667
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
0
0
0
4
7e437dbe2c2eaddadfb12c0e71bcb7d0e968c5b2
136
py
Python
projectname/tests/__init__.py
Casokaks/light-python-template
1298b0283c6a7b3f2cfffabd278848f4fb8e21fa
[ "MIT" ]
null
null
null
projectname/tests/__init__.py
Casokaks/light-python-template
1298b0283c6a7b3f2cfffabd278848f4fb8e21fa
[ "MIT" ]
null
null
null
projectname/tests/__init__.py
Casokaks/light-python-template
1298b0283c6a7b3f2cfffabd278848f4fb8e21fa
[ "MIT" ]
null
null
null
""" Test init module ================================== Author: Casokaks (https://github.com/Casokaks/) Created on: Aug 15th 2021 """
15.111111
47
0.514706
14
136
5
0.928571
0
0
0
0
0
0
0
0
0
0
0.05
0.117647
136
8
48
17
0.533333
0.926471
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
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
4
7e72b5817d31b0de3104c24886db921a7779c4b5
630
py
Python
pysatModels/models/__init__.py
pysat/pysatModelUtils
e563c36531632cd68b4e15d2ac6099fa3cb45aef
[ "BSD-3-Clause" ]
null
null
null
pysatModels/models/__init__.py
pysat/pysatModelUtils
e563c36531632cd68b4e15d2ac6099fa3cb45aef
[ "BSD-3-Clause" ]
17
2019-09-18T18:19:00.000Z
2020-01-30T18:41:59.000Z
pysatModels/models/__init__.py
pysat/pysatModelUtils
e563c36531632cd68b4e15d2ac6099fa3cb45aef
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2022, pysat development team # Full license can be found in License.md # ----------------------------------------------------------------------------- """Routines for loading model data into a pysat Instrument object.""" # Import key modules and skip F401 testing in flake8 from pysatModels.models import methods # noqa: F401 from pysatModels.models import pydineof_dineof # noqa: F401 from pysatModels.models import sami2py_sami2 # noqa: F401 from pysatModels.models import ucar_tiegcm # noqa: F401 __all__ = ['pydineof_dineof', 'sami2py_sami2', 'ucar_tiegcm']
42
79
0.663492
78
630
5.230769
0.628205
0.147059
0.205882
0.264706
0.257353
0.257353
0
0
0
0
0
0.045704
0.131746
630
14
80
45
0.700183
0.574603
0
0
0
0
0.15415
0
0
0
0
0
0
1
0
false
0
0.8
0
0.8
0
0
0
0
null
0
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
0
0
0
1
0
1
0
0
4
7e9a6ec65ac1ad83068e34348790df72fdb98a91
177
py
Python
Userful_Script/decimal_to_binary.py
abc907558136/Pytorch-learning
24c3da7eb134e0b9058a6f8329a311196cbc528b
[ "Apache-2.0" ]
1
2019-12-19T04:49:57.000Z
2019-12-19T04:49:57.000Z
Userful_Script/decimal_to_binary.py
abc907558136/Pytorch-Learning
24c3da7eb134e0b9058a6f8329a311196cbc528b
[ "Apache-2.0" ]
null
null
null
Userful_Script/decimal_to_binary.py
abc907558136/Pytorch-Learning
24c3da7eb134e0b9058a6f8329a311196cbc528b
[ "Apache-2.0" ]
null
null
null
import numpy as np # Represent each input by an array of its binary digits. def binary_encode(i, num_digits): return np.array([i >> d & 1 for d in range(num_digits)])[::-1]
35.4
66
0.700565
33
177
3.666667
0.727273
0.14876
0
0
0
0
0
0
0
0
0
0.013793
0.180791
177
5
66
35.4
0.82069
0.305085
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0.333333
1
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
1
0
0
1
1
0
0
0
4
7eac896f2fd732187498b92ce5df251097f85bad
340
py
Python
codewars/7 kyu/convert-number-to-string.py
sirken/coding-practice
9c5e23b2c24f525a89a5e1d15ce3aec3ad1a01ab
[ "MIT" ]
null
null
null
codewars/7 kyu/convert-number-to-string.py
sirken/coding-practice
9c5e23b2c24f525a89a5e1d15ce3aec3ad1a01ab
[ "MIT" ]
null
null
null
codewars/7 kyu/convert-number-to-string.py
sirken/coding-practice
9c5e23b2c24f525a89a5e1d15ce3aec3ad1a01ab
[ "MIT" ]
null
null
null
from Test import Test, Test as test ''' We need a function that can transform a number into a string. What ways of achieving this do you know? Examples: number_to_string(123) /* returns '123' */ number_to_string(999) /* returns '999' */ ''' def number_to_string(num): return str(num) test.assert_equals(number_to_string(67), '67');
21.25
61
0.723529
56
340
4.232143
0.607143
0.135021
0.236287
0
0
0
0
0
0
0
0
0.055944
0.158824
340
16
62
21.25
0.772727
0
0
0
0
0
0.014815
0
0
0
0
0
0.25
1
0.25
false
0
0.25
0.25
0.75
0
0
0
0
null
0
1
0
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
1
0
0
4
0e1f4a5b7788dcd9e9439809509e149a2ed438c4
505
py
Python
events/migrations/0043_remove_premium_restrictions.py
alysivji/GetTogether
403d9945fff019701de41d081ad4452e771e1ce1
[ "BSD-2-Clause" ]
446
2018-01-21T09:22:41.000Z
2022-03-25T17:46:12.000Z
events/migrations/0043_remove_premium_restrictions.py
alysivji/GetTogether
403d9945fff019701de41d081ad4452e771e1ce1
[ "BSD-2-Clause" ]
272
2018-01-03T16:55:39.000Z
2022-03-11T23:12:30.000Z
events/migrations/0043_remove_premium_restrictions.py
alysivji/GetTogether
403d9945fff019701de41d081ad4452e771e1ce1
[ "BSD-2-Clause" ]
100
2018-01-27T02:04:15.000Z
2021-09-09T09:02:21.000Z
# Generated by Django 2.0 on 2018-08-25 14:19 from django.db import migrations class Migration(migrations.Migration): dependencies = [("events", "0042_allow_team_without_country")] operations = [ migrations.RemoveField(model_name="team", name="is_premium"), migrations.RemoveField(model_name="team", name="premium_by"), migrations.RemoveField(model_name="team", name="premium_expires"), migrations.RemoveField(model_name="team", name="premium_started"), ]
31.5625
74
0.710891
60
505
5.783333
0.533333
0.242075
0.299712
0.345821
0.498559
0.498559
0.389049
0
0
0
0
0.042254
0.156436
505
15
75
33.666667
0.7723
0.085149
0
0
1
0
0.223913
0.067391
0
0
0
0
0
1
0
false
0
0.111111
0
0.444444
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
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
0e465c7c5db67591f279b01b569e5ac410ce6462
506
py
Python
terrascript/data/nomad.py
amlodzianowski/python-terrascript
1111affe6cd30d9b8b7bc74ae4e27590f7d4dc49
[ "BSD-2-Clause" ]
null
null
null
terrascript/data/nomad.py
amlodzianowski/python-terrascript
1111affe6cd30d9b8b7bc74ae4e27590f7d4dc49
[ "BSD-2-Clause" ]
null
null
null
terrascript/data/nomad.py
amlodzianowski/python-terrascript
1111affe6cd30d9b8b7bc74ae4e27590f7d4dc49
[ "BSD-2-Clause" ]
null
null
null
# terrascript/data/nomad.py import terrascript class nomad_acl_policy(terrascript.Data): pass class nomad_acl_token(terrascript.Data): pass class nomad_deployments(terrascript.Data): pass class nomad_job(terrascript.Data): pass class nomad_namespaces(terrascript.Data): pass class nomad_regions(terrascript.Data): pass __all__ = [ "nomad_acl_policy", "nomad_acl_token", "nomad_deployments", "nomad_job", "nomad_namespaces", "nomad_regions", ]
13.315789
42
0.715415
59
506
5.79661
0.254237
0.307018
0.333333
0.350877
0.423977
0
0
0
0
0
0
0
0.187747
506
37
43
13.675676
0.832117
0.049407
0
0.285714
0
0
0.179541
0
0
0
0
0
0
1
0
false
0.285714
0.047619
0
0.333333
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
0
0
1
0
0
0
0
0
4
0e49ee0d9a2475f1064dcee3fd80cff56b6b1889
165
py
Python
project/settings/prod/cors.py
danielbraga/hcap
a3ca0d6963cff19ed6ec0436cce84e2b41615454
[ "MIT" ]
null
null
null
project/settings/prod/cors.py
danielbraga/hcap
a3ca0d6963cff19ed6ec0436cce84e2b41615454
[ "MIT" ]
null
null
null
project/settings/prod/cors.py
danielbraga/hcap
a3ca0d6963cff19ed6ec0436cce84e2b41615454
[ "MIT" ]
null
null
null
""" django: https://docs.djangoproject.com/en/3.0/ref/settings/#allowed-hosts """ from ..env import env ALLOWED_HOSTS = env("HCAP__ALLOWED_HOSTS", default=[])
18.333333
69
0.70303
23
165
4.869565
0.73913
0.321429
0
0
0
0
0
0
0
0
0
0.013605
0.109091
165
8
70
20.625
0.748299
0.466667
0
0
0
0
0.2375
0
0
0
0
0
0
1
0
false
0
0.5
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
0
0
1
0
0
0
0
4
0e5bec43e7ad02e792ccbf34c4c1ba79010d99ec
143
py
Python
tags/ctx.py
NoUMelon/phen-cogs
f8d4de3a91f428114d66fd36ba38ecbd5ace83a3
[ "MIT" ]
1
2021-06-01T10:12:09.000Z
2021-06-01T10:12:09.000Z
tags/ctx.py
NoUMelon/phen-cogs
f8d4de3a91f428114d66fd36ba38ecbd5ace83a3
[ "MIT" ]
null
null
null
tags/ctx.py
NoUMelon/phen-cogs
f8d4de3a91f428114d66fd36ba38ecbd5ace83a3
[ "MIT" ]
null
null
null
from redbot.core.commands import Context class SilentContext(Context): async def send(self, content: str = None, **kwargs): pass
20.428571
56
0.699301
18
143
5.555556
0.944444
0
0
0
0
0
0
0
0
0
0
0
0.202797
143
6
57
23.833333
0.877193
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.25
0.25
0
0.5
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
1
0
0
0
0
0
4
0e707d91371c2482346143a84f5ea61d4dc577a1
497
py
Python
Telecom.py
BeatrizRCorreia/health-informatics-project1
bb3d619ac7b0509758b041db8970b72121a07b3d
[ "MIT" ]
null
null
null
Telecom.py
BeatrizRCorreia/health-informatics-project1
bb3d619ac7b0509758b041db8970b72121a07b3d
[ "MIT" ]
null
null
null
Telecom.py
BeatrizRCorreia/health-informatics-project1
bb3d619ac7b0509758b041db8970b72121a07b3d
[ "MIT" ]
null
null
null
class Telecom: def __init__(self, contact_db_id, system, value, use, rank, period): self.contact_db_id = contact_db_id self.system = system self.value = value self.use = use self.rank = rank self.period = period def get_contact_db_id(self): return self.contact_db_id def get_system(self): return self.system def get_value(self): return self.value def get_use(self): return self.use def get_rank(self): return self.rank def get_period(self): return self.period
18.407407
69
0.72837
81
497
4.222222
0.185185
0.105263
0.245614
0.131579
0
0
0
0
0
0
0
0
0.179074
497
27
70
18.407407
0.838235
0
0
0
0
0
0
0
0
0
0
0
0
1
0.35
false
0
0
0.3
0.7
0
0
0
0
null
0
1
0
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
1
0
0
4
0e75958c82fc2714586320be787064c237d82eab
123
py
Python
condition/leap year or not using conditional operator.py
PraghadeshManivannan/Python
7a42269c5f8cfd9178f1ed39ffc2afea1dd6c5aa
[ "MIT" ]
null
null
null
condition/leap year or not using conditional operator.py
PraghadeshManivannan/Python
7a42269c5f8cfd9178f1ed39ffc2afea1dd6c5aa
[ "MIT" ]
null
null
null
condition/leap year or not using conditional operator.py
PraghadeshManivannan/Python
7a42269c5f8cfd9178f1ed39ffc2afea1dd6c5aa
[ "MIT" ]
null
null
null
a = int(input("Enter the year:")) print(a,"is leap year") if a%4 == 0 and a%400 == 0 else print(a,"is not a leap year")
41
87
0.601626
27
123
2.740741
0.592593
0.162162
0.216216
0
0
0
0
0
0
0
0
0.061224
0.203252
123
2
88
61.5
0.693878
0
0
0
0
0
0.371901
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
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
0
0
0
1
0
4
0e8d1d299b98c3c9fde54963bdd473b0d3eb4f2b
187
py
Python
Tests/Aula_20.py
o-Ian/Practice-Python
1e4b2d0788e70006096a53a7cf038db3148ba4b7
[ "MIT" ]
4
2021-04-23T18:07:58.000Z
2021-05-12T11:38:14.000Z
Tests/Aula_20.py
o-Ian/Practice-Python
1e4b2d0788e70006096a53a7cf038db3148ba4b7
[ "MIT" ]
null
null
null
Tests/Aula_20.py
o-Ian/Practice-Python
1e4b2d0788e70006096a53a7cf038db3148ba4b7
[ "MIT" ]
null
null
null
def lin(): print('-' * 35) # Principal program lin() print(' IAN STIGLIANO SILVA ') lin() lin() print(' CURSO EM VÍDEO ') lin() lin() print(' GUSTAVO GUANABARA ') lin()
12.466667
34
0.572193
23
187
4.652174
0.608696
0.299065
0.205607
0
0
0
0
0
0
0
0
0.014184
0.245989
187
14
35
13.357143
0.744681
0.090909
0
0.545455
0
0
0.410714
0
0
0
0
0
0
1
0.090909
true
0
0
0
0.090909
0.363636
1
0
0
null
1
1
0
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
0
1
0
0
0
0
0
0
4
0ea94d6989972b8a0054db5ba41efd5546eaa245
219
py
Python
tests/test_logging.py
makaimann/fault
8c805415f398e64971d18fbd3014bc0b59fb38b8
[ "BSD-3-Clause" ]
31
2018-07-16T15:03:14.000Z
2022-03-10T08:36:09.000Z
tests/test_logging.py
makaimann/fault
8c805415f398e64971d18fbd3014bc0b59fb38b8
[ "BSD-3-Clause" ]
216
2018-07-18T20:00:34.000Z
2021-10-05T17:40:47.000Z
tests/test_logging.py
makaimann/fault
8c805415f398e64971d18fbd3014bc0b59fb38b8
[ "BSD-3-Clause" ]
10
2019-02-17T00:56:58.000Z
2021-11-05T13:31:37.000Z
import fault.logging def test_logging_smoke(): fault.logging.info("some info msg") fault.logging.debug("some debug msg") fault.logging.warning("some warning msg") fault.logging.error("some error msg")
24.333333
45
0.716895
31
219
5
0.387097
0.387097
0.290323
0
0
0
0
0
0
0
0
0
0.155251
219
8
46
27.375
0.837838
0
0
0
0
0
0.260274
0
0
0
0
0
0
1
0.166667
true
0
0.166667
0
0.333333
0
0
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
1
0
0
0
0
0
0
4
7eba7ca1ca7a464de4552b722ba1235657cc1c18
126
py
Python
roomlistwatcher/infrastructure/producing/topics.py
dnguyen0304/room-list-watcher
7ac4d5172de22dd8906662da521995c8e06c2617
[ "MIT" ]
null
null
null
roomlistwatcher/infrastructure/producing/topics.py
dnguyen0304/room-list-watcher
7ac4d5172de22dd8906662da521995c8e06c2617
[ "MIT" ]
null
null
null
roomlistwatcher/infrastructure/producing/topics.py
dnguyen0304/room-list-watcher
7ac4d5172de22dd8906662da521995c8e06c2617
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- from roomlistwatcher.common import utility class Topic(utility.AutomatedEnum): ROOM_FOUND = ()
15.75
42
0.698413
14
126
6.214286
0.928571
0
0
0
0
0
0
0
0
0
0
0.009524
0.166667
126
7
43
18
0.819048
0.166667
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.333333
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
0
0
1
0
1
0
0
4
7ec971469d93f6ab0b3357bd1986c1d75f158264
1,336
py
Python
wrappers.py
FlanOfFlans/Capone
ac09fabac8eb9a2be6233ec7cdcc14e954427226
[ "MIT" ]
null
null
null
wrappers.py
FlanOfFlans/Capone
ac09fabac8eb9a2be6233ec7cdcc14e954427226
[ "MIT" ]
4
2020-02-07T08:26:32.000Z
2021-02-28T21:04:22.000Z
wrappers.py
FlanOfFlans/Capone
ac09fabac8eb9a2be6233ec7cdcc14e954427226
[ "MIT" ]
null
null
null
import discord class CaponeServer(): def __init__(self, discord_server): self._discord_server = discord_server def get_members(self): return map(CaponeUser, self._discord_server.members()) def equals(self, other): return self._discord_server == other._discord_server class CaponeChannel(): def __init__(self, discord_channel): self._discord_channel = discord_channel def get_members(self): return map(CaponeUser, self._discord_channel.members()) def get_name(self): return self._discord_channel.name def get_server(self): return CaponeServer(self._discord_channel.server) def is_private(self): return isinstance(self._discord_channel, discord.abc.PrivateChannel) def equals(self, other): return self._discord_channel == other._discord_channel async def send(self, message, source="???"): self._discord_channel.send(message) class CaponeUser(): def __init__(self, discord_user): self._discord_user = discord_user def __str__(self): return "{0}#{1}".format(self.get_name(), self.get_discriminator()) def get_name(self): return self._discord_user.name def get_discriminator(self): return self._discord_user.discriminator def equals(self, other): return self._discord_user == other._discord_user async def send(self, message, source="???"): self._discord_user.send(message)
24.740741
70
0.765719
177
1,336
5.40113
0.186441
0.207113
0.150628
0.056485
0.387029
0.356695
0.356695
0.182008
0.098326
0
0
0.001702
0.120509
1,336
54
71
24.740741
0.811915
0
0
0.25
0
0
0.009723
0
0
0
0
0
0
1
0.388889
false
0
0.027778
0.305556
0.805556
0
0
0
0
null
1
0
0
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
1
0
0
4
7ef2ed2970e3ddb3c9692d6c9d5d53f3c44e44e9
93
py
Python
amadeus/shopping/availability/__init__.py
minjikarin/amadeus-python
14a004912ee8c36ee4fd79651ea1b23afe6b2a6e
[ "MIT" ]
125
2018-04-09T07:27:24.000Z
2022-02-22T11:45:20.000Z
amadeus/shopping/availability/__init__.py
minjikarin/amadeus-python
14a004912ee8c36ee4fd79651ea1b23afe6b2a6e
[ "MIT" ]
58
2018-03-29T14:58:01.000Z
2022-03-17T10:18:07.000Z
amadeus/shopping/availability/__init__.py
minjikarin/amadeus-python
14a004912ee8c36ee4fd79651ea1b23afe6b2a6e
[ "MIT" ]
58
2018-04-06T10:56:20.000Z
2022-03-04T01:23:24.000Z
from ._flight_availabilities import FlightAvailabilities __all__ = ['FlightAvailabilities']
23.25
56
0.849462
7
93
10.428571
0.857143
0
0
0
0
0
0
0
0
0
0
0
0.086022
93
3
57
31
0.858824
0
0
0
0
0
0.215054
0
0
0
0
0
0
1
0
false
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
0
0
1
0
0
0
0
4
7d270ae80a04b95ae0734653fb57ab760e18861b
191
py
Python
api/guids/urls.py
gaybro8777/osf.io
30408511510a40bc393565817b343ef5fd76ab14
[ "Apache-2.0" ]
628
2015-01-15T04:33:22.000Z
2022-03-30T06:40:10.000Z
api/guids/urls.py
gaybro8777/osf.io
30408511510a40bc393565817b343ef5fd76ab14
[ "Apache-2.0" ]
4,712
2015-01-02T01:41:53.000Z
2022-03-30T14:18:40.000Z
api/guids/urls.py
Johnetordoff/osf.io
de10bf249c46cede04c78f7e6f7e352c69e6e6b5
[ "Apache-2.0" ]
371
2015-01-12T16:14:08.000Z
2022-03-31T18:58:29.000Z
from django.conf.urls import url from api.guids import views app_name = 'osf' urlpatterns = [ url(r'^(?P<guids>\w+)/$', views.GuidDetail.as_view(), name=views.GuidDetail.view_name), ]
19.1
91
0.696335
29
191
4.482759
0.655172
0.230769
0
0
0
0
0
0
0
0
0
0
0.13089
191
9
92
21.222222
0.783133
0
0
0
0
0
0.104712
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
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
0
0
0
4
bc03d7e1e8567f7bd294e43c4cbf61eccfd77084
128
py
Python
Deploying_Models/deploying_sentiment_classifier/SAGunicorn.py
oke-aditya/Machine_Learning
3dd40ae2b9cba1890e7060448e75c14194b27775
[ "MIT" ]
15
2019-11-16T11:09:24.000Z
2022-01-09T01:58:03.000Z
Deploying_Models/deploying_sentiment_classifier/SAGunicorn.py
oke-aditya/Machine_Learning
3dd40ae2b9cba1890e7060448e75c14194b27775
[ "MIT" ]
1
2021-11-10T19:46:00.000Z
2021-11-10T19:46:00.000Z
Deploying_Models/deploying_sentiment_classifier/SAGunicorn.py
oke-aditya/Machine_Learning
3dd40ae2b9cba1890e7060448e75c14194b27775
[ "MIT" ]
null
null
null
from flask_adv_deploy import app # Note Gunicorn is not supported in Windows machine. if __name__ == "__main__": app.run()
21.333333
52
0.742188
19
128
4.473684
0.947368
0
0
0
0
0
0
0
0
0
0
0
0.179688
128
5
53
25.6
0.809524
0.390625
0
0
0
0
0.105263
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
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
0
0
0
4
bc13edd4a944944871cf4bb67afafb4e4e45becb
41,794
py
Python
Fase II/team04/storageManager.py
estrada-usac/EDD20DIC-PROYECTO
843347de97af5e432d97c99ef490024d6f3ff49e
[ "MIT" ]
null
null
null
Fase II/team04/storageManager.py
estrada-usac/EDD20DIC-PROYECTO
843347de97af5e432d97c99ef490024d6f3ff49e
[ "MIT" ]
3
2020-12-22T15:17:16.000Z
2021-01-08T17:37:22.000Z
Fase II/team04/storageManager.py
estrada-usac/EDD20DIC-PROYECTO
843347de97af5e432d97c99ef490024d6f3ff49e
[ "MIT" ]
null
null
null
# Package: Storage Manager # License: Released under MIT License # Notice: Copyright (c) 2020 TytusDB Team # Developers: Alexis Peralta from storage.avl import avlMode from storage.b import BMode from storage.bplus import BPlusMode from storage.hash import HashMode from storage.isam import ISAMMode from storage.json_mode import jsonMode from storage.dict import DictMode from storage.b import Serializable from DBList import DBList import re import codificar from random import randint MODES = ['avl', 'b', 'bplus', 'dict', 'isam', 'json', 'hash'] HEX_SYMBOLS = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"] VALID_ENCODING = ["utf8", "iso-8859-1", "ascii"] DB_NAME_PATTERN = "^[a-zA-Z][a-zA-Z0-9#@$_]*" # Obteniendo la lista general de bases de datos a partir del binario almacenado # Si no existe el binario, se crea una nueva lista de bases de datos y se almacena # el binario try: databases = Serializable.rollback("lista_bases_de_datos") except FileNotFoundError: databases = DBList() Serializable.commit(databases, "lista_bases_de_datos") # Descripción: # Crea una nueva base de datos # Parámetros: # database:str - El nombre de la nueva base de datos # mode:str - El modo de almacenamiento a utilizar en la base de datos # encoding:str - La codificación utilizada por la base de datos # Valores de Retorno: # 0 - Operación exitosa # 1 - Error en la operación # 2 - Base de datos existente # 3 - Modo incorrecto # 4 - Codificación incorrecta def createDatabase(database: str, mode: str, encoding: str) -> int: if encoding not in VALID_ENCODING: return 4 if databases.search(database) != None: return 2 if mode == "avl": code = avlMode.createDatabase(database) elif mode == "b": code = BMode.createDatabase(database) elif mode == "bplus": code = BPlusMode.createDatabase(database) elif mode == "dict": code = DictMode.createDatabase(database) elif mode == "isam": code = ISAMMode.createDatabase(database) elif mode == "json": code = jsonMode.createDatabase(database) elif mode == "hash": code = HashMode.createDatabase(database) else: return 3 if code == 0: databases.create(database, mode, encoding) try: for i in range(5): try: Serializable.commit(databases, "lista_bases_de_datos") except: continue except: code_drop = dropDatabase(database) if code_drop == 0: databases.delete(database) return 1 else: for i in range(4): code_drop = dropDatabase(database) if code_drop == 0: databases.delete(database) break return 1 return code # Descripción: # Crea una nueva base de datos # Parámetros: # database:str - El nombre de la nueva base de datos # mode:str - El modo de almacenamiento a utilizar en la base de datos # encoding:str - La codificación utilizada por la base de datos # Valores de Retorno: # 0 - Operación exitosa # 1 - Error en la operación # 2 - Base de datos existente # 3 - Modo incorrecto # 4 - Codificación incorrecta def __create_database_sp(database: str, mode: str, encoding: str) -> int: if encoding not in VALID_ENCODING: return 4 dbs = databases.find_all(database) if dbs != None: for db in dbs: if db.name == database and db.mode == mode: # Ya existe esta base de datos alternativa return 0 if mode == "avl": code = avlMode.createDatabase(database) elif mode == "b": code = BMode.createDatabase(database) elif mode == "bplus": code = BPlusMode.createDatabase(database) elif mode == "dict": code = DictMode.createDatabase(database) elif mode == "isam": code = ISAMMode.createDatabase(database) elif mode == "json": code = jsonMode.createDatabase(database) elif mode == "hash": code = HashMode.createDatabase(database) else: return 3 if code == 0: databases.create(database, mode, encoding) try: for i in range(5): try: Serializable.commit(databases, "lista_bases_de_datos") except: continue except: code_drop = dropDatabase(database) if code_drop == 0: databases.delete(database) return 1 else: for i in range(4): code_drop = dropDatabase(database) if code_drop == 0: databases.delete(database) break return 1 return code # Descripción: # Devuelve un nombre aleatorio que no existe entre las bases de datos # Valores de retorno: # str - Un nombre no utilizado entre las bases de datos def temp_name(): temp_database_name = HEX_SYMBOLS[randint(10, len(HEX_SYMBOLS)-1)] for x in range(4): temp_database_name += HEX_SYMBOLS[randint(0, len(HEX_SYMBOLS)-1)] while databases.search(temp_database_name) != None: temp_database_name += HEX_SYMBOLS[randint(0, len(HEX_SYMBOLS)-1)] return temp_database_name # Descripción: # Cambia el modo de almacenamiento de una base de datos # Parámetros: # database:str - El nombre de la base de datos que se desea modificar # mode:str - Es un string indicando el modo 'avl', 'b', 'bplus', 'dict', 'isam', 'json', 'hash' # Valores de retorno: # 0 - Operación exitosa # 1 - Error en la operación # 2 - database no existente # 4 - modo incorrecto def alterDatabaseMode(database: str, mode: str) -> int: dbs = databases.find_all(database) if dbs == []: return 2 if mode not in MODES: return 4 tables = showTables(database) temp_db_name = temp_name() createDatabase(temp_db_name, mode, dbs[0].encoding) for table in tables: aux_table = databases.find_table(database, table) if createTable(temp_db_name, table, aux_table.columns) != 0: dropDatabase(temp_db_name) return 1 if aux_table.pk != []: if alterAddPK(temp_db_name, table, aux_table.pk) != 0: dropDatabase(temp_db_name) return 1 registers = extractTable(database, table) for register in registers: if insert(temp_db_name, table, register) != 0: dropDatabase(temp_db_name) return 1 if dropDatabase(database) != 0: dropDatabase(temp_db_name) return 1 if alterDatabase(temp_db_name, database) != 0: return 1 return 0 # Descripción: # Cambia el modo de almacenamiento de una tabla de una base de datos especificada # Parámetros: # database:str - El nombre de la base de datos que se desea modificar # table:str - El nombre de la tabla que se desea modificar # mode:str - Es un string indicando el modo 'avl', 'b', 'bplus', 'dict', 'isam', 'json', 'hash' # Valores de retorno: # 0 - Operación exitosa # 1 - Error en la operación # 2 - database no existente # 3 - table no existente # 4 - modo incorrecto def alterTableMode(database: str, table: str, mode: str) -> int: dbs = databases.find_all(database) if dbs == []: return 2 if databases.find_table(database, table) == None: return 3 if mode not in MODES: return 4 for db in dbs: tb = db.tables.search(table) if tb != None: # Revisando si la tabla ya se encuentra en una base de datos con el modo indicado if db.mode == mode: return 0 # Se revisa si ya existe una base de datos alternativa con el modo indicado alt_db_exists = False for aux in dbs: if aux.name == database and aux.mode == mode and aux.encoding == db.encoding: alt_db_exists = True # Extraer los registros de la tabla registers = extractTable(database, table) if alt_db_exists: # Crear tabla en esta base de datos if __create_table_sp(database, table, tb.columns, mode) != 0: return 1 # Insertar registros for register in registers: if __insert_sp(database, table, register, mode) != 0: return 1 else: # Crear base de datos y tabla e insertar las tuplas if __create_database_sp(database, mode, db.encoding) != 0: return 1 # Crear tabla en esta base de datos if __create_table_sp(database, table, tb.columns, mode) != 0: return 1 # Insertar registros for register in registers: if __insert_sp(database, table, register, mode) != 0: return 1 # Eliminar tabla original if __drop_table_sp(database, table, db.mode) != 0: return 1 if db.tables.first == None: if __drop_database_sp(db.name, db.mode) != 0: return 1 return 0 return 1 # Descripción: # Devuelve una lista con los nombres de las bases de datos # Valores de retorno: # Lista de strings con los nombres de las bases de datos # Si ocurrió un error devuelve una lista vacía # Si no hay bases de datos devuelve una lista vacía def showDatabases() -> list: return databases.list_databases_diff() # Descripción: # Renombra la base de datos databaseOld por databaseNew # Parámetros: # databaseOld:str - Nombre actual de la base de datos, debe cumplir con las reglas de identificadores de SQL # databaseNew:str - Nuevo nombre de la base de datos, debe cumplir con las reglas de identificadores de SQL # Valores de retorno: # 0 - Operación exitosa # 1 - Error en la operación # 2 - databaseOld no existente # 3 - databaseNew existente def alterDatabase(databaseOld: str, databaseNew: str) -> int: if re.search(DB_NAME_PATTERN, databaseOld) and re.search(DB_NAME_PATTERN, databaseNew): if databases.search(databaseNew) != None: return 3 dbs = databases.find_all(databaseOld) if dbs == []: return 2 for db in dbs: if db.mode == "avl": code = avlMode.alterDatabase(databaseOld, databaseNew) elif db.mode == "b": code = BMode.alterDatabase(databaseOld, databaseNew) elif db.mode == "bplus": code = BPlusMode.alterDatabase(databaseOld, databaseNew) elif db.mode == "dict": code = DictMode.alterDatabase(databaseOld, databaseNew) elif db.mode == "isam": code = ISAMMode.alterDatabase(databaseOld, databaseNew) elif db.mode == "json": code = jsonMode.alterDatabase(databaseOld, databaseNew) elif db.mode == "hash": code = HashMode.alterDatabase(databaseOld, databaseNew) if code == 0: db.name = databaseNew try: Serializable.commit(databases, "lista_bases_de_datos") return 0 except: db.name = databaseOld return 1 else: return 1 # Descripción: # Elimina por completo la base de datos indicada en database # Parámetros: # database:str - Es el nombre de la base de datos que se desea eliminar, debe cumplir con las reglas de identificadores de SQL # Valores de retorno: # 0 - Operación exitosa # 1 - Error en la operación # 2 - Base de datos no existente def dropDatabase(database: str) -> int: if re.search(DB_NAME_PATTERN, database): dbs = databases.find_all(database) if dbs == []: return 2 for db in dbs: if db.mode == "avl": code = avlMode.dropDatabase(database) elif db.mode == "b": code = BMode.dropDatabase(database) elif db.mode == "bplus": code = BPlusMode.dropDatabase(database) elif db.mode == "dict": code = DictMode.dropDatabase(database) elif db.mode == "isam": code = ISAMMode.dropDatabase(database) elif db.mode == "json": code = jsonMode.dropDatabase(database) elif db.mode == "hash": code = HashMode.dropDatabase(database) if code == 0: databases.delete(db.name) for x in range(5): try: Serializable.commit(databases, "lista_bases_de_datos") return 0 except: continue return 1 else: return 1 # Descripción: # Elimina por la base de datos con el nombre y modo indicados # Parámetros: # database:str - Es el nombre de la base de datos que se desea eliminar, debe cumplir con las reglas de identificadores de SQL # mode:str - El modo de almacenamiento utilizado por la base de datos que se desea eliminar # Valores de retorno: # 0 - Operación exitosa # 1 - Error en la operación # 2 - Base de datos no existente # 4 - Modo incorrecto def __drop_database_sp(database: str, mode: str) -> int: if re.search(DB_NAME_PATTERN, database): dbs = databases.find_all(database) if dbs == []: return 2 if mode not in MODES: return 4 for db in dbs: if db.mode == mode == "avl": code = avlMode.dropDatabase(database) elif db.mode == mode == "b": code = BMode.dropDatabase(database) elif db.mode == mode == "bplus": code = BPlusMode.dropDatabase(database) elif db.mode == mode == "dict": code = DictMode.dropDatabase(database) elif db.mode == mode == "isam": code = ISAMMode.dropDatabase(database) elif db.mode == mode == "json": code = jsonMode.dropDatabase(database) elif db.mode == mode == "hash": code = HashMode.dropDatabase(database) else: continue if code == 0: databases.delete_sp(db.name, db.mode) for x in range(5): try: Serializable.commit(databases, "lista_bases_de_datos") return 0 except: continue return 1 else: return 1 # Descripción: # Crea una nueva tabla en la base de datos indicada # Parámetros: # database:str - El nombre de la base de datos a la que se desea agregar la tabla # table:str - El nombre de la nueva tabla # numberColumns:int - La cantidad de columnas que manejará la tabla # Valores de Retorno: # 0 - Operación exitosa # 1 - Error en la operación # 2 - Base de datos inexistente # 3 - Tabla existente def createTable(database: str, table: str, numberColumns: int) -> int: db = databases.search(database) if db == None: return 2 if table in showTables(database): return 3 if db.mode == "avl": result = avlMode.createTable(database, table, numberColumns) elif db.mode == "b": result = BMode.createTable(database, table, numberColumns) elif db.mode == "bplus": result = BPlusMode.createTable(database, table, numberColumns) elif db.mode == "dict": result = DictMode.createTable(database, table, numberColumns) elif db.mode == "isam": result = ISAMMode.createTable(database, table, numberColumns) elif db.mode == "json": result = jsonMode.createTable(database, table, numberColumns) elif db.mode == "hash": result = HashMode.createTable(database, table, numberColumns) if result == 0: if db.tables.create(table, numberColumns) == 0: for x in range(5): try: Serializable.commit(databases, "lista_bases_de_datos") return result except: continue return 1 return result # Descripción: # Crea una nueva tabla en la base de datos indicada con el modo indicado # Parámetros: # database:str - El nombre de la base de datos a la que se desea agregar la tabla # table:str - El nombre de la nueva tabla # numberColumns:int - La cantidad de columnas que manejará la tabla # mode:str - El modo de almacenamiento utilizado por la base de datos # Valores de Retorno: # 0 - Operación exitosa # 1 - Error en la operación # 2 - Base de datos inexistente # 3 - Tabla existente # 4 - Modo incorrecto def __create_table_sp(database: str, table: str, numberColumns: int, mode: str) -> int: dbs = databases.find_all(database) if dbs == []: return 2 # if table in showTables(database): # return 3 if mode not in MODES: return 4 for db in dbs: if db.mode == mode == "avl": result = avlMode.createTable(database, table, numberColumns) elif db.mode == mode == "b": result = BMode.createTable(database, table, numberColumns) elif db.mode == mode == "bplus": result = BPlusMode.createTable(database, table, numberColumns) elif db.mode == mode == "dict": result = DictMode.createTable(database, table, numberColumns) elif db.mode == mode == "isam": result = ISAMMode.createTable(database, table, numberColumns) elif db.mode == mode == "json": result = jsonMode.createTable(database, table, numberColumns) elif db.mode == mode == "hash": result = HashMode.createTable(database, table, numberColumns) else: continue if result == 0: if db.tables.create(table, numberColumns) == 0: for x in range(5): try: Serializable.commit(databases, "lista_bases_de_datos") return result except: continue return 1 return result # Descripción: # Devuelve una lista con los nombres de todas las tablas de la base de datos # Parámetros: # database:str - El nombre de la base de datos cuyas tablas se desean obtener # Valores de retorno: # Si existen la base de datos y las tablas devuelve una lista de nombres de tablas # Si existe la base de datos, pero no existen tablas devuelve una lista vacía # Si no existe la base de datos devuelve None def showTables(database: str) -> list: dbs = databases.find_all(database) if dbs == []: return None result = [] for db in dbs: if db.mode == "avl": result += avlMode.showTables(database) elif db.mode == "b": result += BMode.showTables(database) elif db.mode == "bplus": result += BPlusMode.showTables(database) elif db.mode == "dict": result += DictMode.showTables(database) elif db.mode == "isam": result += ISAMMode.showTables(database) elif db.mode == "json": result += jsonMode.showTables(database) elif db.mode == "hash": result += HashMode.showTables(database) return result # Descripción: # Elimina la llave primaria actual en la información de la tabla, manteniendo el índice # actual de la estructura del árbol hasta que se invoque de nuevo el alterAddPK() # Parámetros: # database:str - El nombre de la base de datos a utilizar # table:str - El nombre de la tabla a utilizar # Valores de retorno: # 0 - Operación exitosa # 1 - Error en la operación # 2 - database no existente # 3 - table no existente # 4 - pk no existente def alterDropPK(database: str, table: str) -> int: dbs = databases.find_all(database) if dbs == []: return 2 for db in dbs: if db.mode == "avl": result = avlMode.alterDropPK(database, table) elif db.mode == "b": result = BMode.alterDropPK(database, table) elif db.mode == "bplus": result = BPlusMode.alterDropPK(database, table) elif db.mode == "dict": result = DictMode.alterDropPK(database, table) elif db.mode == "isam": result = ISAMMode.alterDropPK(database, table) elif db.mode == "json": result = jsonMode.alterDropPK(database, table) elif db.mode == "hash": result = HashMode.alterDropPK(database, table) if result != 3: if result == 0: db.tables.search(table).pk = [] for x in range(5): try: Serializable.commit(databases, "lista_bases_de_datos") return result except: break return 1 break return result # Descripción: # Agrega una columna al final de cada registro de la tabla y base de datos especificada # Parámetros: # database:str - El nombre de la base de datos a utilizar # table:str - El nombre de la tabla a utilizar # default:any - Es el valor que se establecerá en a la nueva columna para los registros existentes # Valores de retorno: # 0 - Operación exitosa # 1 - Error en la operación # 2 - database no existente # 3 - table no existente def alterAddColumn(database: str, table: str, default: any) -> int: dbs = databases.find_all(database) if dbs == []: return 2 for db in dbs: if db.mode == "avl": result = avlMode.alterAddColumn(database, table, default) elif db.mode == "b": result = BMode.alterAddColumn(database, table, default) elif db.mode == "bplus": result = BPlusMode.alterAddColumn(database, table, default) elif db.mode == "dict": result = DictMode.alterAddColumn(database, table, default) elif db.mode == "isam": result = ISAMMode.alterAddColumn(database, table, default) elif db.mode == "json": result = jsonMode.alterAddColumn(database, table, default) elif db.mode == "hash": result = HashMode.alterAddColumn(database, table, default) if result != 3: if result == 0: db.search(table).columns += 1 for x in range(5): try: Serializable.commit(databases, "lista_bases_de_datos") return result except: break return 1 break return result # Descripción: # Eliminar una n-ésima columna de cada registro de la tabla excepto si son llaves primarias # Parámetros: # database:str - El nombre de la base de datos a utilizar # table:str - El nombre de la tabla a utilizar # columnNumber:int - El número de la columna a eliminar # Valores de retorno: # 0 - Operación exitosa # 1 - Error en la operación # 2 - database no existe # 3 - table no existe # 4 - Llave no puede eliminarse o tabla quedarse sin columnas # 5 - Columna fuera de límites def alterDropColumn(database: str, table: str, columnNumber: int) -> int: dbs = databases.find_all(database) if dbs == []: return 2 for db in dbs: if db.mode == "avl": result = avlMode.alterDropColumn(database, table, columnNumber) elif db.mode == "b": result = BMode.alterDropColumn(database, table, columnNumber) elif db.mode == "bplus": result = BPlusMode.alterDropColumn(database, table, columnNumber) elif db.mode == "dict": result = DictMode.alterDropColumn(database, table, columnNumber) elif db.mode == "isam": result = ISAMMode.alterDropColumn(database, table, columnNumber) elif db.mode == "json": result = jsonMode.alterDropColumn(database, table, columnNumber) elif db.mode == "hash": result = HashMode.alterDropColumn(database, table, columnNumber) if result != 3: if result == 0: db.search(table).columns -= 1 for x in range(5): try: Serializable.commit(databases, "lista_bases_de_datos") return result except: break return 1 break return result # Descripción: # Convierte un string en bytes utilizando la codificación especificada # Parámetros: # text:str - El texto que se desea codificar # encoding:str - El tipo de codificación que se desea utilizar # Valores de retorno: # bytes - El objeto de tipo bytes con el texto codificado # None - Error durante la codificación def codificar(text, encoding): if encoding not in VALID_ENCODING: return None try: if encoding == "utf8": return bytes(text, encoding = "utf-8") if encoding == "iso-8859-1": return bytes(text, encoding = "iso-8859-1") if encoding == "ascii": return bytes(text, encoding = "ascii") return None except: return None # Descripción: # Inserta un registro en la estructura de datos asociada a la tabla y la base de datos # Parámetros: # database:str - El nombre de la base de datos a utilizar # table:str - El nombre de la tabla a utilizar # register:list - Es una lista de elementos que represent un registro # Valores de retorno: # 0 - Operación exitosa # 1 - Error en la operación # 2 - database no existente # 3 - table no existente # 4 - Llave primaria duplicada # 5 - Columnas fuera de límites def insert(database: str, table: str, register: list): dbs = databases.find_all(database) if dbs == []: return 2 for db in dbs: # for x in range(0, len(register)): # aux = codificar(register[x], db.encoding) # if aux == None: # return 1 # register[x] = aux if db.mode == "avl": result = avlMode.insert(database, table, register) elif db.mode == "b": result = BMode.insert(database, table, register) elif db.mode == "bplus": result = BPlusMode.insert(database, table, register) elif db.mode == "dict": result = DictMode.insert(database, table, register) elif db.mode == "isam": result = ISAMMode.insert(database, table, register) elif db.mode == "json": result = jsonMode.insert(database, table, register) elif db.mode == "hash": result = HashMode.insert(database, table, register) if result != 3: break return result # Descripción: # Inserta un registro en la estructura de datos asociada a la tabla y la base de datos con el modo indicado # Parámetros: # database:str - El nombre de la base de datos a utilizar # table:str - El nombre de la tabla a utilizar # register:list - Es una lista de elementos que represent un registro # mode:str - El modo de la base de datos en la que se desea insertar # Valores de retorno: # 0 - Operación exitosa # 1 - Error en la operación # 2 - database no existente # 3 - table no existente # 4 - Llave primaria duplicada # 5 - Columnas fuera de límites # 6 - Modo incorrecto def __insert_sp(database: str, table: str, register: list, mode: str): dbs = databases.find_all(database) if dbs == []: return 2 tb = databases.find_table(database, table) if tb == None: return 3 if len(register) != tb.columns: return 5 if mode not in MODES: return 6 for db in dbs: # for x in range(0, len(register)): # aux = codificar(register[x], db.encoding) # if aux == None: # return 1 # register[x] = aux if db.mode == mode == "avl": result = avlMode.insert(database, table, register) elif db.mode == mode == "b": result = BMode.insert(database, table, register) elif db.mode == mode == "bplus": result = BPlusMode.insert(database, table, register) elif db.mode == mode == "dict": result = DictMode.insert(database, table, register) elif db.mode == mode == "isam": result = ISAMMode.insert(database, table, register) elif db.mode == mode == "json": result = jsonMode.insert(database, table, register) elif db.mode == mode == "hash": result = HashMode.insert(database, table, register) else: continue if result != 3: break return result # Descripción: # Carga un archivo CSV de una ruta especificada indicando la base de datos y tabla donde será almacenado # Parámetros: # file:str - Ruta del archivo CSV a utilizar # database:str - El nombre de la base de datos a utilizar # table:str - El nombre de la tabla a utilizar # Valores de retorno: # Lista con los valores enteros que devuelve el insert por cada fila del CSV # Si ocurrió un error o el archivo CSV no tiene filas devuelve una lista vacía def loadCSV(file: str, database: str, table: str) -> list: try: result = [] with open(file, "r") as csv: for line in csv: register = line.strip().split(",") result += [insert(database, table, register)] return result except: return [] def delete(database: str, table: str, columns: list): db = databases.search(database) if db == None: return 2 if db.mode == "avl": result = avlMode.delete(database, table, columns) elif db.mode == "b": result = BMode.delete(database, table, columns) elif db.mode == "bplus": result = BPlusMode.delete(database, table, columns) elif db.mode == "dict": result = DictMode.delete(database, table, columns) elif db.mode == "isam": result = ISAMMode.delete(database, table, columns) elif db.mode == "json": result = jsonMode.delete(database, table, columns) elif db.mode == "hash": result = HashMode.delete(database, table, columns) return result def extractTable(database,table): dbs = databases.find_all(database) if dbs == []: return None if databases.find_table(database, table) == None: return None result = [] for db in dbs: tb = db.tables.search(table) if tb != None: if db.mode == "avl": result = avlMode.extractTable(database,table) elif db.mode == "b": result = BMode.extractTable(database,table) elif db.mode == "bplus": result = BPlusMode.extractTable(database,table) elif db.mode == "dict": result = DictMode.extractTable(database,table) elif db.mode == "isam": result = ISAMMode.extractTable(database,table) elif db.mode == "json": result = jsonMode.extractTable(database,table) elif db.mode == "hash": result = HashMode.extractTable(database,table) else: continue return result def extractRangeTable(database: str, table: str, columnNumber: int, lower: any, upper: any) -> list: db = databases.search(database) if db == None: return None if db.mode == "avl": result = avlMode.extractRangeTable(database,table,columnNumber,lower, upper) elif db.mode == "b": result = BMode.extractRangeTable(database,table,columnNumber,lower, upper) elif db.mode == "bplus": result = BPlusMode.extractRangeTable(database,table,columnNumber,lower, upper) elif db.mode == "dict": result = DictMode.extractRangeTable(database,table,columnNumber,lower, upper) elif db.mode == "isam": result = ISAMMode.extractRangeTable(database,table,columnNumber,lower, upper) elif db.mode == "json": result = jsonMode.extractRangeTable(database,table,columnNumber,lower, upper) elif db.mode == "hash": result = HashMode.extractRangeTable(database,table,columnNumber,lower, upper) return result def alterTable(database, tableOld, tableNew): dbs = databases.find_all(database) if dbs == []: return 2 for db in dbs: if db.mode == "avl": result = avlMode.alterTable(database,tableOld,tableNew) elif db.mode == "b": result = BMode.alterTable(database,tableOld,tableNew) elif db.mode == "bplus": result = BPlusMode.alterTable(database,tableOld,tableNew) elif db.mode == "dict": result = DictMode.alterTable(database,tableOld,tableNew) elif db.mode == "isam": result = ISAMMode.alterTable(database,tableOld,tableNew) elif db.mode == "json": result = jsonMode.alterTable(database,tableOld,tableNew) elif db.mode == "hash": result = HashMode.alterTable(database,tableOld,tableNew) if result != 3: if result == 0: db.tables.search(tableOld).name = tableNew for x in range(5): try: Serializable.commit(databases, "lista_bases_de_datos") return result except: break return 1 break return result def dropTable(database,table): dbs = databases.find_all(database) if dbs == []: return 2 for db in dbs: if db.mode == "avl": result = avlMode.dropTable(database, table) elif db.mode == "b": result = BMode.dropTable(database, table) elif db.mode == "bplus": result = BPlusMode.dropTable(database, table) elif db.mode == "dict": result = DictMode.dropTable(database, table) elif db.mode == "isam": result = ISAMMode.dropTable(database, table) elif db.mode == "json": result = jsonMode.dropTable(database, table) elif db.mode == "hash": result = HashMode.dropTable(database, table) if result != 3: if result == 0: db.tables.delete(table) for x in range(5): try: Serializable.commit(databases, "lista_bases_de_datos") return result except: break return 1 break return result # Descripción: # Elimina una tabla especificada en una base de datos con el nombre y modo especificados. # Parámetros: # database:str - El nombre de la base de datos que se va a utilizar # table:str - El nombre de la tabla que se desea eliminar # mode:str - El modo que debe tener la base de datos que se va a utilizar # Valores de retorno: # 0 - Operación exitosa # 1 - Error durante la operación # 2 - database no existe # 3 - table no existe def __drop_table_sp(database, table, mode): dbs = databases.find_all(database) if dbs == []: return 2 if databases.find_table(database, table) == None: return 3 for db in dbs: if db.mode == mode == "avl": result = avlMode.dropTable(database, table) elif db.mode == mode == "b": result = BMode.dropTable(database, table) elif db.mode == mode == "bplus": result = BPlusMode.dropTable(database, table) elif db.mode == mode == "dict": result = DictMode.dropTable(database, table) elif db.mode == mode == "isam": result = ISAMMode.dropTable(database, table) elif db.mode == mode == "json": result = jsonMode.dropTable(database, table) elif db.mode == mode == "hash": result = HashMode.dropTable(database, table) else: continue if result != 3: if result == 0: db.tables.delete(table) for x in range(5): try: Serializable.commit(databases, "lista_bases_de_datos") return result except: break return 1 break return result def extractRow(database, table, columns): db = databases.search(database) if db == None: return 2 if db.mode == "avl": result = avlMode.extractRow(database, table, columns) elif db.mode == "b": result = BMode.extractRow(database, table, columns) elif db.mode == "bplus": result = BPlusMode.extractRow(database, table, columns) elif db.mode == "dict": result = DictMode.extractRow(database, table, columns) elif db.mode == "isam": result = ISAMMode.extractRow(database, table, columns) elif db.mode == "json": result = jsonMode.extractRow(database, table, columns) elif db.mode == "hash": result = HashMode.extractRow(database, table, columns) return result def update(database, table, register, columns): db = databases.search(database) if db == None: return 2 if db.mode == "avl": result = avlMode.update(database, table, register, columns) elif db.mode == "b": result = BMode.update(database, table, register, columns) elif db.mode == "bplus": result = BPlusMode.update(database, table, register, columns) elif db.mode == "dict": result = DictMode.update(database, table, register, columns) elif db.mode == "isam": result = ISAMMode.update(database, table, register, columns) elif db.mode == "json": result = jsonMode.update(database, table, register, columns) elif db.mode == "hash": result = HashMode.update(database, table, register, columns) return result def truncate(database, table): db = databases.search(database) if db == None: return 2 if db.mode == "avl": result = avlMode.truncate(database, table) elif db.mode == "b": result = BMode.truncate(database, table) elif db.mode == "bplus": result = BPlusMode.truncate(database, table) elif db.mode == "dict": result = DictMode.truncate(database, table) elif db.mode == "isam": result = ISAMMode.truncate(database, table) elif db.mode == "json": result = jsonMode.truncate(database, table) elif db.mode == "hash": result = HashMode.truncate(database, table) return result def alterAddPK(database, table, columns): dbs = databases.find_all(database) if dbs == []: return 2 for db in dbs: if db.mode == "avl": result = avlMode.alterAddPK(database, table, columns) elif db.mode == "b": result = BMode.alterAddPK(database, table, columns) elif db.mode == "bplus": result = BPlusMode.alterAddPK(database, table, columns) elif db.mode == "dict": result = DictMode.alterAddPK(database, table, columns) elif db.mode == "isam": result = ISAMMode.alterAddPK(database, table, columns) elif db.mode == "json": result = jsonMode.alterAddPK(database, table, columns) elif db.mode == "hash": result = HashMode.alterAddPK(database, table, columns) if result != 3: if result == 0: db.tables.search(table).pk += columns for x in range(5): try: Serializable.commit(databases, "lista_bases_de_datos") return result except: break return 1 break return result
39.502836
131
0.568933
4,741
41,794
4.9749
0.067707
0.038667
0.053422
0.019842
0.81065
0.782668
0.700967
0.636437
0.564233
0.480709
0
0.009153
0.341269
41,794
1,058
132
39.502836
0.847554
0.230727
0
0.749364
0
0
0.033088
0.00081
0
0
0
0
0
1
0.036896
false
0
0.015267
0.001272
0.20229
0
0
0
0
null
0
0
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
bc1bb7a3ffc94e487eae34a752e77501805ef163
31
py
Python
tests/tests/dummy.py
cjhall1283/pylint_runner
64dae35dd07886524278c90c62270ae7a7d3a7a7
[ "MIT" ]
16
2016-01-14T17:38:39.000Z
2020-10-30T13:41:33.000Z
tests/tests/dummy.py
cjhall1283/pylint_runner
64dae35dd07886524278c90c62270ae7a7d3a7a7
[ "MIT" ]
12
2015-03-19T13:56:18.000Z
2020-09-11T12:09:16.000Z
tests/tests/dummy.py
cjhall1283/pylint_runner
64dae35dd07886524278c90c62270ae7a7d3a7a7
[ "MIT" ]
7
2017-02-14T01:03:22.000Z
2021-08-25T16:34:17.000Z
""" Dummy file for testing """
7.75
22
0.612903
4
31
4.75
1
0
0
0
0
0
0
0
0
0
0
0
0.193548
31
3
23
10.333333
0.76
0.709677
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
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
bc29e1bc3e6578fac96ebc8b4d22ae86f30e35fb
188
py
Python
04-ClassMembers/member.py
bakhshalipour/boost-python3-mac
dd86f2a1d2460118878282b794a87c821cd38a3a
[ "BSL-1.0" ]
null
null
null
04-ClassMembers/member.py
bakhshalipour/boost-python3-mac
dd86f2a1d2460118878282b794a87c821cd38a3a
[ "BSL-1.0" ]
null
null
null
04-ClassMembers/member.py
bakhshalipour/boost-python3-mac
dd86f2a1d2460118878282b794a87c821cd38a3a
[ "BSL-1.0" ]
null
null
null
#!/usr/bin/env python3 import member m1 = member.SomeClass("Pavel") print ("name =",m1.name) m1.name = "Gunther" print ("name =",m1.name) m1.number = 7.3 print ("number =",m1.number)
13.428571
30
0.648936
29
188
4.206897
0.517241
0.196721
0.245902
0.245902
0.278689
0
0
0
0
0
0
0.055901
0.143617
188
13
31
14.461538
0.701863
0.111702
0
0.285714
0
0
0.193939
0
0
0
0
0
0
1
0
false
0
0.142857
0
0.142857
0.428571
1
0
0
null
0
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
0
0
0
0
0
0
1
0
4
bc2f04c16bdbecd969f22b63a971bad1b03dcc0a
56
py
Python
piodispatch/__init__.py
Kiruse/PioDispatch
ae4b6199795d2cc0ad8451cc17b57a4b517fdbda
[ "MIT" ]
null
null
null
piodispatch/__init__.py
Kiruse/PioDispatch
ae4b6199795d2cc0ad8451cc17b57a4b517fdbda
[ "MIT" ]
null
null
null
piodispatch/__init__.py
Kiruse/PioDispatch
ae4b6199795d2cc0ad8451cc17b57a4b517fdbda
[ "MIT" ]
null
null
null
from .piodispatch import dispatch, ascoroutine, shutdown
56
56
0.857143
6
56
8
1
0
0
0
0
0
0
0
0
0
0
0
0.089286
56
1
56
56
0.941176
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
0
0
0
4
70e0a6a13cc5a05c0b7485409fd0055a7d8eb46a
93
py
Python
constants.py
supro200/sdwan-auto-upgrade
3339d56203c678398da98ac2a6398f2edd66c245
[ "MIT" ]
2
2021-01-18T18:42:24.000Z
2021-02-01T01:21:18.000Z
constants.py
supro200/sdwan-auto-upgrade
3339d56203c678398da98ac2a6398f2edd66c245
[ "MIT" ]
null
null
null
constants.py
supro200/sdwan-auto-upgrade
3339d56203c678398da98ac2a6398f2edd66c245
[ "MIT" ]
null
null
null
JUMPHOST = "jumphost" VMANAGE = "10.121.6.35" AZURE_STORAGE_ACCOUNT = "azure-storage-account"
31
47
0.763441
13
93
5.307692
0.692308
0.347826
0.550725
0
0
0
0
0
0
0
0
0.094118
0.086022
93
3
47
31
0.717647
0
0
0
0
0
0.425532
0.223404
0
0
0
0
0
1
0
false
0
0
0
0
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
0
0
0
0
0
4
70f6a101e87e43f1c6e0155f7b03c05850afb19f
250
py
Python
arts_localisation/beam_models/__init__.py
loostrum/arts_localisation
e3f3d1c8c0f4ee66d731634294b7b126ee28be1c
[ "Apache-2.0" ]
1
2020-08-19T11:52:04.000Z
2020-08-19T11:52:04.000Z
arts_localisation/beam_models/__init__.py
loostrum/arts_localisation
e3f3d1c8c0f4ee66d731634294b7b126ee28be1c
[ "Apache-2.0" ]
10
2021-02-03T08:52:51.000Z
2022-03-04T10:03:56.000Z
arts_localisation/beam_models/__init__.py
loostrum/arts_localisation
e3f3d1c8c0f4ee66d731634294b7b126ee28be1c
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python from .beamformer import BeamFormer from .compound_beam import CompoundBeam from .sb_generator import SBGenerator from .simulate_sb_pattern import SBPattern __all__ = ['BeamFormer', 'CompoundBeam', 'SBPattern', 'SBGenerator']
25
68
0.8
29
250
6.62069
0.586207
0
0
0
0
0
0
0
0
0
0
0
0.108
250
9
69
27.777778
0.860987
0.08
0
0
0
0
0.183406
0
0
0
0
0
0
1
0
false
0
0.8
0
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
0
0
1
0
1
0
0
4
70f8bfd61dc80c47f58e8869a7a7e8ed2cf2c065
379
py
Python
tests/test_transforms.py
KIT-MBS/nnicotine
3681391d05d0a2d92e16431f5bc985cd6ff606fd
[ "MIT" ]
2
2021-03-28T02:02:30.000Z
2021-09-09T23:27:39.000Z
tests/test_transforms.py
KIT-MBS/nnicotine
3681391d05d0a2d92e16431f5bc985cd6ff606fd
[ "MIT" ]
null
null
null
tests/test_transforms.py
KIT-MBS/nnicotine
3681391d05d0a2d92e16431f5bc985cd6ff606fd
[ "MIT" ]
null
null
null
from collections import OrderedDict from pytest import approx def test_RandomDrop(): sample = None raise def test_TrimToTarget(): raise def test_ComputeCouplings(): raise def test_ToCategorical(): raise def test_ToTensor_sample(): raise def test_ToTensor_label(): raise def test_ToDistance(): raise def test_ToBinnedDistance(): raise
13.068966
35
0.722955
44
379
6
0.431818
0.212121
0.318182
0.151515
0
0
0
0
0
0
0
0
0.211082
379
28
36
13.535714
0.882943
0
0
0.421053
0
0
0
0
0
0
0
0
0
1
0.421053
false
0
0.105263
0
0.526316
0
0
0
0
null
1
1
0
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
0
1
0
0
4
cb1307c481c9beb955137f8e7e42252585de4aba
574
py
Python
bots/raspador_template/raspador_template_pilot.py
xyla-io/raspador
4e77234239d44a83faf5c1d3a6d022a9e3861f25
[ "MIT" ]
null
null
null
bots/raspador_template/raspador_template_pilot.py
xyla-io/raspador
4e77234239d44a83faf5c1d3a6d022a9e3861f25
[ "MIT" ]
null
null
null
bots/raspador_template/raspador_template_pilot.py
xyla-io/raspador
4e77234239d44a83faf5c1d3a6d022a9e3861f25
[ "MIT" ]
null
null
null
from raspador import Pilot, UserInteractor, BrowserInteractor from typing import Dict, List class RaspadorTemplatePilot(Pilot): config: Dict[str, any] sign_in_wait = 3.0 def __init__(self, config: Dict[str, any], user: UserInteractor, browser: BrowserInteractor): self.config = config super().__init__(user=user, browser=browser) @property def email(self) -> str: return self.config['email'] @property def password(self) -> str: return self.config['password'] @property def base_url(self) -> str: return self.config['base_url']
26.090909
95
0.709059
72
574
5.486111
0.430556
0.126582
0.098734
0.129114
0.174684
0
0
0
0
0
0
0.004219
0.174216
574
22
96
26.090909
0.829114
0
0
0.176471
0
0
0.036522
0
0
0
0
0
0
1
0.235294
false
0.117647
0.117647
0.176471
0.705882
0
0
0
0
null
0
0
0
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
1
1
0
0
4
cb2cc7212e69c1cafb5036e456b7f734ca0ecc36
146
py
Python
api/apps/boxes/apps.py
polart/vagrant-registry
47fa53a93d506f2501f333a256ccf36e49970789
[ "MIT" ]
8
2020-03-16T21:41:08.000Z
2021-12-16T05:44:04.000Z
api/apps/boxes/apps.py
polart/vagrant-registry
47fa53a93d506f2501f333a256ccf36e49970789
[ "MIT" ]
6
2020-03-21T11:23:18.000Z
2022-02-27T01:16:18.000Z
api/apps/boxes/apps.py
polart/vagrant-registry
47fa53a93d506f2501f333a256ccf36e49970789
[ "MIT" ]
null
null
null
from django.apps import AppConfig class BoxesConfig(AppConfig): name = 'apps.boxes' def ready(self): import apps.boxes.signals
16.222222
33
0.691781
18
146
5.611111
0.722222
0.178218
0
0
0
0
0
0
0
0
0
0
0.219178
146
8
34
18.25
0.885965
0
0
0
0
0
0.068493
0
0
0
0
0
0
1
0.2
false
0
0.4
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
0
0
1
0
1
0
0
4
cb4b79bd2a64b669c02e75a4cc2d59b49df0e3ce
12,449
py
Python
test/test_igp_shortcuts.py
tim-fiola/network_traffic_modeler_py3
d2bd7287ea86fb22ec41c2522164d5761fc225dd
[ "Apache-2.0" ]
102
2018-09-16T00:14:05.000Z
2022-03-24T09:07:37.000Z
test/test_igp_shortcuts.py
tim-fiola/network_traffic_modeler_py3
d2bd7287ea86fb22ec41c2522164d5761fc225dd
[ "Apache-2.0" ]
17
2019-01-17T14:00:50.000Z
2021-05-05T14:59:36.000Z
test/test_igp_shortcuts.py
tim-fiola/network_traffic_modeler_py3
d2bd7287ea86fb22ec41c2522164d5761fc225dd
[ "Apache-2.0" ]
10
2019-08-14T20:57:34.000Z
2022-03-24T09:07:42.000Z
import unittest from pyNTM import FlexModel from pyNTM import ModelException from pyNTM import PerformanceModel class TestIGPShortcuts(unittest.TestCase): def test_traffic_on_shortcut_lsps(self): """ Verify Interface and LSP traffic when IGP shortcuts enabled in baseline model. """ # The demands should take LSPs starting on the first # node that has shortcuts and should take the LSP that # leads it closest to the demand destination model = FlexModel.load_model_file( "test/igp_shortcuts_model_mult_lsps_in_path.csv" ) model.update_simulation() # Get all the interface objects int_a_b = model.get_interface_object("A-B", "A") int_b_c = model.get_interface_object("B-C", "B") int_c_d = model.get_interface_object("C-D", "C") int_d_e = model.get_interface_object("D-E", "D") int_e_f = model.get_interface_object("E-F", "E") int_a_g = model.get_interface_object("A-G", "A") int_g_f = model.get_interface_object("G-F", "G") # Get all LSP objects lsp_b_d_1 = model.get_rsvp_lsp("B", "D", "lsp_b_d_1") lsp_b_d_2 = model.get_rsvp_lsp("B", "D", "lsp_b_d_2") lsp_c_e_1 = model.get_rsvp_lsp("C", "E", "lsp_c_e_1") lsp_d_f_1 = model.get_rsvp_lsp("D", "F", "lsp_d_f_1") # Get demand objects dmd_a_f_1 = model.get_demand_object("A", "F", "dmd_a_f_1") dmd_d_f_1 = model.get_demand_object("D", "F", "dmd_d_f_1") # Verify traffic on LSPs self.assertEqual(lsp_b_d_1.traffic_on_lsp(model), 2.5) self.assertEqual(lsp_b_d_2.traffic_on_lsp(model), 2.5) self.assertEqual(lsp_c_e_1.traffic_on_lsp(model), 0) self.assertEqual(lsp_d_f_1.traffic_on_lsp(model), 13.0) # Verify demand paths self.assertIn([int_a_g, int_g_f], dmd_a_f_1.path) self.assertIn([int_a_b, lsp_b_d_1, lsp_d_f_1], dmd_a_f_1.path) self.assertIn([int_a_b, lsp_b_d_2, lsp_d_f_1], dmd_a_f_1.path) self.assertEqual(dmd_d_f_1.path, [[lsp_d_f_1]]) # Verify interface traffic self.assertEqual(int_a_b.traffic, 5.0) self.assertEqual(int_b_c.traffic, 5.0) self.assertEqual(int_c_d.traffic, 5.0) self.assertEqual(int_d_e.traffic, 13.0) self.assertEqual(int_e_f.traffic, 13.0) self.assertEqual(int_a_g.traffic, 5.0) self.assertEqual(int_g_f.traffic, 5.0) # Verify LSPs on interfaces self.assertIn(lsp_b_d_1, int_b_c.lsps(model)) self.assertIn(lsp_b_d_2, int_b_c.lsps(model)) self.assertIn(lsp_b_d_1, int_c_d.lsps(model)) self.assertIn(lsp_b_d_2, int_c_d.lsps(model)) self.assertIn(lsp_b_d_2, int_c_d.lsps(model)) self.assertIn(lsp_c_e_1, int_c_d.lsps(model)) def test_igp_shortcut_node_attributes(self): # The IGP shortcut attribute should be True model = FlexModel.load_model_file( "test/igp_shortcuts_model_mult_lsps_in_path.csv" ) node_b = model.get_node_object("B") self.assertTrue(node_b.igp_shortcuts_enabled) # Remove igp_shortcuts_enabled on node B, traffic should appear on lsp_c_e_1 # and disappear from lsp_b_d_1/2 and lsp_d_f_1 def test_remove_shortcuts_node_b(self): model = FlexModel.load_model_file( "test/igp_shortcuts_model_mult_lsps_in_path.csv" ) node_b = model.get_node_object("B") node_b.igp_shortcuts_enabled = False model.update_simulation() # Get LSP objects lsp_b_d_1 = model.get_rsvp_lsp("B", "D", "lsp_b_d_1") lsp_b_d_2 = model.get_rsvp_lsp("B", "D", "lsp_b_d_2") lsp_c_e_1 = model.get_rsvp_lsp("C", "E", "lsp_c_e_1") lsp_d_f_1 = model.get_rsvp_lsp("D", "F", "lsp_d_f_1") dmd_a_f_1 = model.get_demand_object("A", "F", "dmd_a_f_1") dmd_d_f_1 = model.get_demand_object("D", "F", "dmd_d_f_1") # Half the traffic from dmd_a_f_1 should be on lsp_c_e_1 self.assertEqual(lsp_c_e_1.traffic_on_lsp(model), 5.0) # dmd_a_f_1 should be the only demand on lsp_c_e_1 self.assertEqual(lsp_c_e_1.demands_on_lsp(model), [dmd_a_f_1]) # dmd_d_f_1 should be the only demand on lsp_d_f_1 self.assertEqual(lsp_d_f_1.demands_on_lsp(model), [dmd_d_f_1]) # LSPs from B to D should have no demands and no traffic self.assertEqual(lsp_b_d_1.demands_on_lsp(model), []) self.assertEqual(lsp_b_d_2.demands_on_lsp(model), []) self.assertEqual(lsp_b_d_1.traffic_on_lsp(model), 0) self.assertEqual(lsp_b_d_2.traffic_on_lsp(model), 0) def test_demands_no_shortcuts(self): """ The demand should take the LSP if the IGP shortcut attribute is True on node B. When the IGP shortcut attribute is turned to False, the demand should only IGP route. Change all igp_shortcuts_enabled flags to False. Test LSP and Interface traffic. """ model = FlexModel.load_model_file( "test/igp_shortcuts_model_mult_lsps_in_path.csv" ) model.update_simulation() # Get all LSP objects lsp_b_d_1 = model.get_rsvp_lsp("B", "D", "lsp_b_d_1") lsp_b_d_2 = model.get_rsvp_lsp("B", "D", "lsp_b_d_2") lsp_c_e_1 = model.get_rsvp_lsp("C", "E", "lsp_c_e_1") lsp_d_f_1 = model.get_rsvp_lsp("D", "F", "lsp_d_f_1") # Get some node objects node_b = model.get_node_object("B") node_c = model.get_node_object("C") node_d = model.get_node_object("D") node_e = model.get_node_object("E") # Get LSP object dmd_d_f_1 = model.get_demand_object("D", "F", "dmd_d_f_1") # Set the node igp_shortcuts_enabled attribute to False node_b.igp_shortcuts_enabled = False node_c.igp_shortcuts_enabled = False node_d.igp_shortcuts_enabled = False node_e.igp_shortcuts_enabled = False model.update_simulation() # Only lsp_d_f_1 should have traffic/demands self.assertEqual(lsp_b_d_1.demands_on_lsp(model), []) self.assertEqual(lsp_b_d_2.demands_on_lsp(model), []) self.assertEqual(lsp_c_e_1.demands_on_lsp(model), []) self.assertEqual(lsp_b_d_1.traffic_on_lsp(model), 0) self.assertEqual(lsp_b_d_2.traffic_on_lsp(model), 0) self.assertEqual(lsp_c_e_1.traffic_on_lsp(model), 0) self.assertEqual(lsp_d_f_1.demands_on_lsp(model), [dmd_d_f_1]) self.assertEqual(lsp_d_f_1.traffic_on_lsp(model), 8.0) def test_igp_shortcut_perf_model(self): model = PerformanceModel.load_model_file("test/igp_routing_topology.csv") node_a = model.get_node_object("A") node_a.igp_shortcuts_enabled = True err_msg = "igp_shortcuts_enabled not allowed in PerformanceModel, but present on these Nodes" with self.assertRaises(ModelException) as context: model.update_simulation() self.assertIn(err_msg, context.exception.args[0][1][0].keys()) # If one LSP from B to D is assigned a lower metric, traffic should # not split at A def test_changed_metric(self): model = FlexModel.load_model_file( "test/igp_shortcuts_model_mult_lsps_in_path.csv" ) # Get all the interface objects int_a_b = model.get_interface_object("A-B", "A") int_b_c = model.get_interface_object("B-C", "B") int_c_d = model.get_interface_object("C-D", "C") int_d_e = model.get_interface_object("D-E", "D") int_e_f = model.get_interface_object("E-F", "E") int_a_g = model.get_interface_object("A-G", "A") int_g_f = model.get_interface_object("G-F", "G") # Get all LSP objects lsp_b_d_1 = model.get_rsvp_lsp("B", "D", "lsp_b_d_1") lsp_b_d_2 = model.get_rsvp_lsp("B", "D", "lsp_b_d_2") lsp_c_e_1 = model.get_rsvp_lsp("C", "E", "lsp_c_e_1") lsp_d_f_1 = model.get_rsvp_lsp("D", "F", "lsp_d_f_1") # Get demand objects dmd_a_f_1 = model.get_demand_object("A", "F", "dmd_a_f_1") dmd_d_f_1 = model.get_demand_object("D", "F", "dmd_d_f_1") # Give lsp a lower than default metric lsp_b_d_1.manual_metric = 15 model.update_simulation() dmd_path_1 = [int_a_b, lsp_b_d_1, lsp_d_f_1] # Confirm demand path self.assertIn(dmd_path_1, dmd_a_f_1.path) # Verify traffic on LSPs self.assertEqual(lsp_b_d_1.traffic_on_lsp(model), 10) self.assertEqual(lsp_b_d_2.traffic_on_lsp(model), 0) self.assertEqual(lsp_c_e_1.traffic_on_lsp(model), 0) self.assertEqual(lsp_d_f_1.traffic_on_lsp(model), 18.0) # Verify demand paths self.assertNotIn([int_a_g, int_g_f], dmd_a_f_1.path) self.assertIn([int_a_b, lsp_b_d_1, lsp_d_f_1], dmd_a_f_1.path) self.assertNotIn(lsp_b_d_2, dmd_a_f_1.path) self.assertEqual(dmd_d_f_1.path, [[lsp_d_f_1]]) # Verify interface traffic self.assertEqual(int_a_b.traffic, 10.0) self.assertEqual(int_b_c.traffic, 10.0) self.assertEqual(int_c_d.traffic, 10.0) self.assertEqual(int_d_e.traffic, 18.0) self.assertEqual(int_e_f.traffic, 18.0) self.assertEqual(int_a_g.traffic, 0.0) self.assertEqual(int_g_f.traffic, 0.0) # Verify LSPs on interfaces self.assertIn(lsp_b_d_1, int_b_c.lsps(model)) self.assertIn(lsp_b_d_2, int_b_c.lsps(model)) self.assertIn(lsp_b_d_1, int_c_d.lsps(model)) self.assertIn(lsp_b_d_2, int_c_d.lsps(model)) self.assertIn(lsp_b_d_2, int_c_d.lsps(model)) self.assertIn(lsp_c_e_1, int_c_d.lsps(model)) # Give lsp_b_d_1 a higher than default metric lsp_b_d_1.manual_metric = 25 model.update_simulation() dmd_path_2_1 = [int_a_g, int_g_f] dmd_path_2_2 = [int_a_b, lsp_b_d_2, lsp_d_f_1] # Confirm demand path self.assertIn(dmd_path_2_1, dmd_a_f_1.path) self.assertIn(dmd_path_2_2, dmd_a_f_1.path) # Verify traffic on LSPs self.assertEqual(lsp_b_d_1.traffic_on_lsp(model), 0) self.assertEqual(lsp_b_d_2.traffic_on_lsp(model), 5) self.assertEqual(lsp_c_e_1.traffic_on_lsp(model), 0) self.assertEqual(lsp_d_f_1.traffic_on_lsp(model), 13.0) # Verify demand paths self.assertIn([int_a_g, int_g_f], dmd_a_f_1.path) self.assertNotIn(lsp_b_d_1, dmd_a_f_1.path) self.assertIn([int_a_b, lsp_b_d_2, lsp_d_f_1], dmd_a_f_1.path) self.assertEqual(dmd_d_f_1.path, [[lsp_d_f_1]]) # Verify interface traffic self.assertEqual(int_a_b.traffic, 5.0) self.assertEqual(int_b_c.traffic, 5.0) self.assertEqual(int_c_d.traffic, 5.0) self.assertEqual(int_d_e.traffic, 13.0) self.assertEqual(int_e_f.traffic, 13.0) self.assertEqual(int_a_g.traffic, 5.0) self.assertEqual(int_g_f.traffic, 5.0) # Verify LSPs on interfaces self.assertIn(lsp_b_d_1, int_b_c.lsps(model)) self.assertIn(lsp_b_d_2, int_b_c.lsps(model)) self.assertIn(lsp_b_d_1, int_c_d.lsps(model)) self.assertIn(lsp_b_d_2, int_c_d.lsps(model)) self.assertIn(lsp_b_d_2, int_c_d.lsps(model)) self.assertIn(lsp_c_e_1, int_c_d.lsps(model)) # If an LSP from A to F is added, all traffic should take that LSP def test_direct_lsp_preemption(self): model = FlexModel.load_model_file( "test/igp_shortcuts_model_mult_lsps_in_path.csv" ) dmd_a_f_1 = model.get_demand_object("A", "F", "dmd_a_f_1") model.add_rsvp_lsp("A", "F", "lsp_a_f_1") lsp_a_f_1 = model.get_rsvp_lsp("A", "F", "lsp_a_f_1") lsp_b_d_1 = model.get_rsvp_lsp("B", "D", "lsp_b_d_1") int_a_g = model.get_interface_object("A-G", "A") int_a_b = model.get_interface_object("A-B", "A") model.update_simulation() # Make sure dmd_a_f_1 takes lsp_a_f_1 self.assertEqual(lsp_a_f_1.demands_on_lsp(model), [dmd_a_f_1]) self.assertEqual(lsp_a_f_1.traffic_on_lsp(model), 10) self.assertEqual(lsp_b_d_1.traffic_on_lsp(model), 0) self.assertEqual(lsp_b_d_1.demands_on_lsp(model), []) # lsp_a_f_1 will take path with fewest hops self.assertEqual(int_a_g.traffic, 10) self.assertEqual(int_a_b.traffic, 0)
40.288026
101
0.662383
2,170
12,449
3.382488
0.065438
0.019619
0.047684
0.026975
0.785831
0.75218
0.733924
0.697003
0.688965
0.657221
0
0.026931
0.227488
12,449
308
102
40.418831
0.7363
0.142903
0
0.664921
0
0
0.071476
0.030903
0
0
0
0
0.471204
1
0.036649
false
0
0.020942
0
0.062827
0
0
0
0
null
0
0
0
0
1
1
0
0
1
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
4
cb4e5f859ce8ac9363882484ef9e2ee69ad80da8
238
py
Python
examples/quiet.py
NiumXp/slog
5635c0cf49fb8dd096f843cfed83e669e68da3de
[ "MIT" ]
null
null
null
examples/quiet.py
NiumXp/slog
5635c0cf49fb8dd096f843cfed83e669e68da3de
[ "MIT" ]
null
null
null
examples/quiet.py
NiumXp/slog
5635c0cf49fb8dd096f843cfed83e669e68da3de
[ "MIT" ]
null
null
null
import slog slog.quiet("debbug") slog.debbug("Hi!") slog.warning("Debbug?") slog.unquiet() slog.debbug("Aaaaaaaaa") with slog.quiet("debbug"): slog.debbug("Hello!") slog.info("Hi!") slog.info("Debbug?") slog.debbug("Hey.")
12.526316
26
0.651261
32
238
4.84375
0.375
0.258065
0.309677
0.245161
0.322581
0
0
0
0
0
0
0
0.117647
238
18
27
13.222222
0.738095
0
0
0
0
0
0.214286
0
0
0
0
0
0
1
0
true
0
0.090909
0
0.090909
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
0
1
0
0
0
0
0
0
4
cbc5080d810af6158c768f9c9a1d4621bd817296
233
py
Python
wordVerification.py
Androcks/SlideWord
0ea3ff886ee142fa2211667d1bd9b73da66129e9
[ "Apache-2.0" ]
null
null
null
wordVerification.py
Androcks/SlideWord
0ea3ff886ee142fa2211667d1bd9b73da66129e9
[ "Apache-2.0" ]
null
null
null
wordVerification.py
Androcks/SlideWord
0ea3ff886ee142fa2211667d1bd9b73da66129e9
[ "Apache-2.0" ]
null
null
null
import enchant ##Use our custom word list wordList = enchant.request_pwl_dict("truncListWords.txt") ##Takes our string from the stage and checks it def checkForWord(playerString) : return wordList.check(playerString)
23.3
58
0.755365
30
233
5.8
0.866667
0
0
0
0
0
0
0
0
0
0
0
0.171674
233
9
59
25.888889
0.901554
0.296137
0
0
0
0
0.119205
0
0
0
0
0
0
1
0.25
false
0
0.25
0.25
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
1
0
0
0
1
1
0
0
4
cbd13396135d0966c93e66018afe90dc4090a475
4,933
py
Python
mmtbx/regression/fix_cablam/tst_one_resid_rotation.py
hbrunie/cctbx_project
2d8cb383d50fe20cdbbe4bebae8ed35fabce61e5
[ "BSD-3-Clause-LBNL" ]
2
2021-03-18T12:31:57.000Z
2022-03-14T06:27:06.000Z
mmtbx/regression/fix_cablam/tst_one_resid_rotation.py
hbrunie/cctbx_project
2d8cb383d50fe20cdbbe4bebae8ed35fabce61e5
[ "BSD-3-Clause-LBNL" ]
null
null
null
mmtbx/regression/fix_cablam/tst_one_resid_rotation.py
hbrunie/cctbx_project
2d8cb383d50fe20cdbbe4bebae8ed35fabce61e5
[ "BSD-3-Clause-LBNL" ]
1
2021-03-26T12:52:30.000Z
2021-03-26T12:52:30.000Z
from __future__ import absolute_import, division, print_function import iotbx.pdb import mmtbx.model from mmtbx.building.cablam_idealization import cablam_idealization, master_phil import sys import libtbx.load_env pdb_str = """\ ATOM 2327 N GLY A 318 169.195 115.930 63.690 1.00216.32 N ATOM 2328 CA GLY A 318 169.975 114.907 64.348 1.00193.16 C ATOM 2329 C GLY A 318 169.246 113.598 64.539 1.00197.19 C ATOM 2330 O GLY A 318 168.148 113.399 64.016 1.00193.16 O ATOM 2331 N GLN A 319 169.849 112.700 65.308 1.00184.03 N ATOM 2332 CA GLN A 319 169.232 111.415 65.589 1.00195.95 C ATOM 2333 C GLN A 319 169.246 111.137 67.080 1.00193.64 C ATOM 2334 O GLN A 319 168.185 111.047 67.708 1.00229.34 O ATOM 2335 CB GLN A 319 169.941 110.308 64.822 1.00201.09 C ATOM 2336 CG GLN A 319 169.719 110.407 63.336 1.00236.37 C ATOM 2337 CD GLN A 319 168.255 110.312 62.966 1.00254.36 C ATOM 2338 OE1 GLN A 319 167.506 109.520 63.536 1.00280.71 O ATOM 2339 NE2 GLN A 319 167.836 111.126 62.007 1.00220.80 N ATOM 2340 N ALA A 320 170.446 111.006 67.646 1.00140.99 N ATOM 2341 CA ALA A 320 170.595 110.942 69.090 1.00197.51 C ATOM 2342 C ALA A 320 169.906 109.734 69.704 1.00203.65 C ATOM 2343 O ALA A 320 168.789 109.863 70.203 1.00242.54 O ATOM 2344 CB ALA A 320 170.069 112.226 69.727 1.00240.45 C ATOM 2345 N LYS A 321 170.554 108.566 69.662 1.00164.18 N ATOM 2346 CA LYS A 321 169.963 107.306 70.104 1.00134.95 C ATOM 2347 C LYS A 321 169.103 107.477 71.344 1.00134.95 C ATOM 2348 O LYS A 321 167.904 107.194 71.302 1.00134.95 O ATOM 2349 CB LYS A 321 171.040 106.265 70.421 1.00145.47 C ATOM 2350 CG LYS A 321 171.950 105.868 69.279 1.00164.10 C ATOM 2351 CD LYS A 321 171.197 105.229 68.138 1.00145.47 C ATOM 2352 CE LYS A 321 172.173 104.777 67.070 1.00145.80 C ATOM 2353 NZ LYS A 321 171.487 104.149 65.918 1.00145.93 N ATOM 2354 N ARG A 322 169.682 107.900 72.454 1.00185.62 N ATOM 2355 CA ARG A 322 168.888 108.089 73.652 1.00142.57 C ATOM 2356 C ARG A 322 169.546 109.124 74.551 1.00128.56 C ATOM 2357 O ARG A 322 170.758 109.341 74.474 1.00128.56 O ATOM 2358 CB ARG A 322 168.719 106.769 74.369 1.00115.16 C ATOM 2359 CG ARG A 322 167.669 106.817 75.430 1.00133.21 C ATOM 2360 CD ARG A 322 167.578 105.605 76.270 1.00149.50 C ATOM 2361 NE ARG A 322 168.665 105.482 77.219 1.00115.16 N ATOM 2362 CZ ARG A 322 168.912 104.370 77.883 1.00115.16 C ATOM 2363 NH1 ARG A 322 168.133 103.302 77.715 1.00116.90 N ATOM 2364 NH2 ARG A 322 169.915 104.340 78.745 1.00115.16 N ATOM 2365 N VAL A 323 168.740 109.783 75.382 1.00121.29 N ATOM 2366 CA VAL A 323 169.198 110.884 76.220 1.00121.29 C ATOM 2367 C VAL A 323 168.668 110.712 77.632 1.00139.86 C ATOM 2368 O VAL A 323 167.480 110.430 77.835 1.00121.29 O ATOM 2369 CB VAL A 323 168.795 112.246 75.654 1.00117.56 C ATOM 2370 CG1 VAL A 323 168.912 113.310 76.710 1.00151.93 C ATOM 2371 CG2 VAL A 323 169.721 112.603 74.534 1.00121.07 C """ def exercise_no_sidechains(prefix="tst_one_resid_rotation_no_sidechains"): pdb_inp = iotbx.pdb.input(lines=pdb_str.split('\n'), source_info=None) model = mmtbx.model.manager( model_input = pdb_inp) with open("%s_start.pdb" % prefix, 'w') as f: f.write(model.model_as_pdb()) s = model.selection("name N or name CA or name C or name O") model = model.select(s) ci = cablam_idealization(model = model, params=master_phil.extract().cablam_idealization, log=sys.stdout) pdb_txt = model.model_as_pdb() def exercise_yes_sidechains(prefix="tst_one_resid_rotation_yes_sidechains"): pdb_inp = iotbx.pdb.input(lines=pdb_str.split('\n'), source_info=None) model = mmtbx.model.manager( model_input = pdb_inp) with open("%s_start.pdb" % prefix, 'w') as f: f.write(model.model_as_pdb()) ci = cablam_idealization(model = model, params=master_phil.extract().cablam_idealization, log=sys.stdout) pdb_txt = model.model_as_pdb() if __name__ == '__main__': if (not libtbx.env.has_module(name="probe")): print("Skipping: probe not configured") else: exercise_no_sidechains() exercise_yes_sidechains()
59.433735
107
0.598419
927
4,933
3.113269
0.387271
0.045045
0.026681
0.017325
0.233541
0.197505
0.17325
0.17325
0.17325
0.17325
0
0.4319
0.321305
4,933
82
108
60.158537
0.430108
0
0
0.181818
0
0.584416
0.758159
0.014798
0
0
0
0
0
1
0.025974
false
0
0.077922
0
0.103896
0.025974
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
cbdac3877bab597aa23c31ff7320e50f74d4b377
381
py
Python
hpc/config_manager.py
PRIDE-Toolsuite/trackhub-creator
ade2cfafeaad95088664caecacb783b501c170aa
[ "Apache-2.0" ]
null
null
null
hpc/config_manager.py
PRIDE-Toolsuite/trackhub-creator
ade2cfafeaad95088664caecacb783b501c170aa
[ "Apache-2.0" ]
null
null
null
hpc/config_manager.py
PRIDE-Toolsuite/trackhub-creator
ade2cfafeaad95088664caecacb783b501c170aa
[ "Apache-2.0" ]
null
null
null
# # Author    : Manuel Bernal Llinares # Project   : trackhub-creator # Timestamp : 11-09-2017 11:10 # --- # © 2017 Manuel Bernal Llinares <mbdebian@gmail.com> # All rights reserved. # """ Configuration Manager for this HPC Module """ if __name__ == '__main__': print("ERROR: This script is part of a pipeline collection and it is not meant to be run in stand alone mode")
23.8125
114
0.695538
55
381
4.690909
0.872727
0.093023
0.155039
0
0
0
0
0
0
0
0
0.052459
0.199475
381
15
115
25.4
0.790164
0.55643
0
0
0
0.5
0.712418
0
0
0
0
0
0
1
0
true
0
0
0
0
0.5
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
4
1dae9ce676e6495c35381a8c5c2d8862347c3bd0
28
py
Python
oarepo_whitenoise/__init__.py
oarepo/oarepo-whitenoise
e72a875edc2a8db3c7805c65ed7e73927d20f056
[ "MIT" ]
null
null
null
oarepo_whitenoise/__init__.py
oarepo/oarepo-whitenoise
e72a875edc2a8db3c7805c65ed7e73927d20f056
[ "MIT" ]
null
null
null
oarepo_whitenoise/__init__.py
oarepo/oarepo-whitenoise
e72a875edc2a8db3c7805c65ed7e73927d20f056
[ "MIT" ]
1
2021-06-28T12:21:33.000Z
2021-06-28T12:21:33.000Z
"""Nothing here, really."""
14
27
0.607143
3
28
5.666667
1
0
0
0
0
0
0
0
0
0
0
0
0.107143
28
1
28
28
0.68
0.75
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
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
1db1f7c927cfaedb78f62fb3695b46b8ba415747
1,810
py
Python
shimmer/apps/SimpleAccelGyro/simpleAccelGyroRecv.py
tinyos-io/tinyos-3.x-contrib
3aaf036722a2afc0c0aad588459a5c3e00bd3c01
[ "BSD-3-Clause", "MIT" ]
1
2020-02-28T20:35:09.000Z
2020-02-28T20:35:09.000Z
shimmer/apps/SimpleAccelGyro/simpleAccelGyroRecv.py
tinyos-io/tinyos-3.x-contrib
3aaf036722a2afc0c0aad588459a5c3e00bd3c01
[ "BSD-3-Clause", "MIT" ]
null
null
null
shimmer/apps/SimpleAccelGyro/simpleAccelGyroRecv.py
tinyos-io/tinyos-3.x-contrib
3aaf036722a2afc0c0aad588459a5c3e00bd3c01
[ "BSD-3-Clause", "MIT" ]
null
null
null
#!/usr/bin/python import sys, os, struct, array, time try: import tos except ImportError: import posix sys.path = [os.path.join(posix.environ['TOSROOT'], 'support', 'sdk', 'python')] + sys.path import tos if len(sys.argv) < 2: print "no device specified" print "example:" print " simpleAccelGyroRecv.py /dev/ttyUSB5" else: try: ser = tos.Serial(sys.argv[1], 115200) am = tos.AM(ser) except: print "ERROR: Unable to initialize serial port connection to", sys.argv[1] sys.exit(-1) try: while True: packet = am.read(timeout=5) if packet: if len(packet.data) < 2: print "skipping truncated packet" pass elif len(packet.data) != 100: print packet.data else: count = int(packet.data[1]) + (int(packet.data[0]<<8)) for i in range(2,86,14): accelx = int(packet.data[i + 1] << 8) + int(packet.data[i]) accely = int(packet.data[i + 3] << 8) + int(packet.data[i + 2]) accelz = int(packet.data[i + 5] << 8) + int(packet.data[i + 4]) gyrox = int(packet.data[i + 7] << 8) + int(packet.data[i + 6]) gyroy = int(packet.data[i + 9] << 8) + int(packet.data[i + 8]) gyroz = int(packet.data[i + 11] << 8) + int(packet.data[i + 10]) rawbatt = int(packet.data[i + 13] << 8) + int(packet.data[i + 12]) batt = rawbatt / 4095.0 * 3.0 * 2.0 print "%d %d %d %d %d %d %d %d %5.3f" % (packet.source, count, accelx, accely, accelz, gyrox, gyroy, gyroz, batt) sys.stdout.flush() except KeyboardInterrupt: print "All done"
36.938776
131
0.508287
242
1,810
3.801653
0.38843
0.206522
0.226087
0.213043
0.122826
0.008696
0.008696
0
0
0
0
0.049622
0.343094
1,810
48
132
37.708333
0.724138
0.00884
0
0.166667
0
0
0.113218
0.01227
0
0
0
0
0
0
null
null
0.02381
0.119048
null
null
0.190476
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
1
0
0
0
0
0
0
0
0
4
1ddaabf5260925241474b1020f7b0e3d597421f5
126
py
Python
fts/backends/xapian.py
filwaitman/django-fts
af9f10d760e543288c21a8f4239288c2e415b9e9
[ "BSD-3-Clause" ]
null
null
null
fts/backends/xapian.py
filwaitman/django-fts
af9f10d760e543288c21a8f4239288c2e415b9e9
[ "BSD-3-Clause" ]
9
2020-02-11T23:38:20.000Z
2022-03-11T23:16:29.000Z
3rdparty/odeoncg-django-fts-odeon-9ea3a64/fts/backends/unported/xapian.py
cltrudeau/django-yacon
d462c88cf98bf8eef50a0696b265fa28dfdb40eb
[ "MIT" ]
2
2017-09-10T11:27:51.000Z
2019-12-28T00:12:58.000Z
from fts.backends.base import InvalidFtsBackendError raise InvalidFtsBackendError("Xapian FTS backend not yet implemented")
42
70
0.849206
14
126
7.642857
0.857143
0
0
0
0
0
0
0
0
0
0
0
0.103175
126
3
70
42
0.946903
0
0
0
0
0
0.304
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
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
0
0
0
4
38442d4e520a2a7cf2672966f74e1bda1da32461
199
py
Python
profiles_app/serializers.py
foropolo/task
bf44361537f97db4bd8efe189b16958b6c8f8491
[ "MIT" ]
null
null
null
profiles_app/serializers.py
foropolo/task
bf44361537f97db4bd8efe189b16958b6c8f8491
[ "MIT" ]
7
2020-06-06T00:01:49.000Z
2022-02-10T11:31:54.000Z
profiles_app/serializers.py
foropolo/task
bf44361537f97db4bd8efe189b16958b6c8f8491
[ "MIT" ]
null
null
null
from rest_framework import serializers class HelloSerializer(serializers.Serializer): """Serializes a name field for testing out APIView""" city_name = serializers.CharField(max_length=30)
28.428571
57
0.788945
24
199
6.416667
0.875
0
0
0
0
0
0
0
0
0
0
0.011628
0.135678
199
6
58
33.166667
0.883721
0.236181
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.333333
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
0
0
1
0
1
0
0
4
69a8f7469bd91e8fef4f395d57b80e477d69a8db
71
py
Python
gather/glasgowpicarro/__init__.py
openghg/gather
0096cfe66b0093cdd294fa2a67c060d7fc28d2fa
[ "Apache-2.0" ]
null
null
null
gather/glasgowpicarro/__init__.py
openghg/gather
0096cfe66b0093cdd294fa2a67c060d7fc28d2fa
[ "Apache-2.0" ]
null
null
null
gather/glasgowpicarro/__init__.py
openghg/gather
0096cfe66b0093cdd294fa2a67c060d7fc28d2fa
[ "Apache-2.0" ]
null
null
null
from ._process import process_pipeline __all__ = ["process_pipeline"]
17.75
38
0.802817
8
71
6.25
0.625
0.6
0
0
0
0
0
0
0
0
0
0
0.112676
71
3
39
23.666667
0.793651
0
0
0
0
0
0.225352
0
0
0
0
0
0
1
0
false
0
0.5
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
0
0
1
0
0
0
0
4
69e1d274afce02fe0eb56c0874758437df337b90
134
py
Python
graphs/__init__.py
kateshostak/expander-lib
c1c7c0bec977fdc6492e4e08a1d1757783462c76
[ "MIT" ]
null
null
null
graphs/__init__.py
kateshostak/expander-lib
c1c7c0bec977fdc6492e4e08a1d1757783462c76
[ "MIT" ]
null
null
null
graphs/__init__.py
kateshostak/expander-lib
c1c7c0bec977fdc6492e4e08a1d1757783462c76
[ "MIT" ]
null
null
null
from .abstract_graph import AbstractGraph from .matrix_graph import MatrixGraph __all__ = [ "AbstractGraph", "MatrixGraph", ]
19.142857
41
0.753731
13
134
7.307692
0.615385
0.231579
0
0
0
0
0
0
0
0
0
0
0.164179
134
7
42
19.142857
0.848214
0
0
0
0
0
0.177778
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
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
0
0
0
4
0e14cf2f5e13c579c96107e8e4c16365f6b6c29e
175
py
Python
Usage.py
josephworks/PythonWS
7391580de63291018094037f87b930fe44c6eae8
[ "MIT" ]
null
null
null
Usage.py
josephworks/PythonWS
7391580de63291018094037f87b930fe44c6eae8
[ "MIT" ]
3
2019-02-23T00:30:07.000Z
2020-09-28T05:25:20.000Z
Usage.py
josephworks/PythonWS
7391580de63291018094037f87b930fe44c6eae8
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 print("""\ Usage: thingy [OPTIONS] -h Display this usage message -H hostname Hostname to connect to """)
25
57
0.52
19
175
4.789474
0.789474
0
0
0
0
0
0
0
0
0
0
0.009091
0.371429
175
6
58
29.166667
0.818182
0.12
0
0
0
0
0.901961
0
0
0
0
0
0
1
0
true
0
0
0
0
0.2
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
0
0
4
3860c236069152282ade2ef47710a9608a5cce61
452
py
Python
Solutions.py/2563/r1_bird.py
TianTcl/KU01-challenge
5a0069840e26d9a8cf8fa592679341154fcb3a15
[ "MIT" ]
2
2021-10-30T06:27:48.000Z
2021-10-30T08:14:50.000Z
Solutions.py/2563/r1_bird.py
TianTcl/KU01-challenge
5a0069840e26d9a8cf8fa592679341154fcb3a15
[ "MIT" ]
null
null
null
Solutions.py/2563/r1_bird.py
TianTcl/KU01-challenge
5a0069840e26d9a8cf8fa592679341154fcb3a15
[ "MIT" ]
null
null
null
tree_count, tree_hinput, tree_chosen = int(input()), input().split(), 0 tree_height = [int(x) for x in tree_hinput] for each_tree in range(tree_count): if each_tree==0 and tree_height[0]>tree_height[1]:tree_chosen+=1 elif each_tree==tree_count-1 and tree_height[each_tree]>tree_height[each_tree-1]:tree_chosen+=1 elif tree_height[each_tree-1]<tree_height[each_tree]>tree_height[each_tree+1]:tree_chosen+=1 print(tree_chosen) # Passed
56.5
100
0.75885
82
452
3.865854
0.243902
0.252366
0.22082
0.283912
0.425868
0.362776
0.302839
0.302839
0.302839
0.302839
0
0.027295
0.108407
452
8
101
56.5
0.759305
0.013274
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0.142857
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
0
0
0
0
0
4
386af50e69b05e3ea517743c301c1934214c6742
696
py
Python
workout_plan_server/adapters/mysql/impl/mysql_exercise_repository.py
vitorsm/workout-plan-server
74e315550c11a1afd684d1497693ff16afc4f9d8
[ "MIT" ]
null
null
null
workout_plan_server/adapters/mysql/impl/mysql_exercise_repository.py
vitorsm/workout-plan-server
74e315550c11a1afd684d1497693ff16afc4f9d8
[ "MIT" ]
null
null
null
workout_plan_server/adapters/mysql/impl/mysql_exercise_repository.py
vitorsm/workout-plan-server
74e315550c11a1afd684d1497693ff16afc4f9d8
[ "MIT" ]
null
null
null
from uuid import uuid4 from flask_sqlalchemy import SQLAlchemy from workout_plan_server.adapters.mysql.generic_repository import GenericRepository from workout_plan_server.adapters.mysql.models.exercise_model import ExerciseModel from workout_plan_server.domain.entities.exercise import Exercise from workout_plan_server.services.ports.exercise_repository import ExerciseRepository class MySQLExerciseRepository(GenericRepository[ExerciseModel], ExerciseRepository): def get_mapper(self): return def __init__(self, db: SQLAlchemy): super().__init__(db, ExerciseModel) def merge_model_with_persisted_model(self, new_model: object) -> object: return None
33.142857
85
0.817529
81
696
6.703704
0.481481
0.081031
0.110497
0.154696
0.12523
0.12523
0
0
0
0
0
0.001642
0.125
696
20
86
34.8
0.889984
0
0
0
0
0
0
0
0
0
0
0
0
1
0.230769
false
0
0.461538
0.153846
0.923077
0
0
0
0
null
0
0
0
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
1
1
1
0
0
4
386cca9eb1e6638f6f9a9784464bc329651f71b7
34
py
Python
src/hackeme/backend/hackvm/type_codes.py
ThomasBollmeier/hackeme-native
1bd9eac3eb057661045bcc1a612f8fc704f6d809
[ "Apache-2.0" ]
null
null
null
src/hackeme/backend/hackvm/type_codes.py
ThomasBollmeier/hackeme-native
1bd9eac3eb057661045bcc1a612f8fc704f6d809
[ "Apache-2.0" ]
null
null
null
src/hackeme/backend/hackvm/type_codes.py
ThomasBollmeier/hackeme-native
1bd9eac3eb057661045bcc1a612f8fc704f6d809
[ "Apache-2.0" ]
null
null
null
class TypeCodes: LIST = 1
11.333333
16
0.558824
4
34
4.75
1
0
0
0
0
0
0
0
0
0
0
0.047619
0.382353
34
3
17
11.333333
0.857143
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
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
0
0
0
0
1
0
0
4
38960fd0dbb8b90644b976de856162ef1dd45d60
9,859
py
Python
resources.py
luca-penasa/circle-craters
62881f7fa7f032c8377dee130598ec7a93ccdae3
[ "BSD-3-Clause" ]
1
2021-02-01T13:59:29.000Z
2021-02-01T13:59:29.000Z
resources.py
europlanet-gmap/circle-craters
62881f7fa7f032c8377dee130598ec7a93ccdae3
[ "BSD-3-Clause" ]
null
null
null
resources.py
europlanet-gmap/circle-craters
62881f7fa7f032c8377dee130598ec7a93ccdae3
[ "BSD-3-Clause" ]
1
2020-10-21T13:50:34.000Z
2020-10-21T13:50:34.000Z
# -*- coding: utf-8 -*- # Resource object code # # Created by: The Resource Compiler for PyQt5 (Qt v5.15.0) # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore qt_resource_data = b"\ \x00\x00\x01\x64\ \x89\ \x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\ \x00\x00\x18\x00\x00\x00\x18\x08\x04\x00\x00\x00\x4a\x7e\xf5\x73\ \x00\x00\x00\x20\x63\x48\x52\x4d\x00\x00\x7a\x26\x00\x00\x80\x84\ \x00\x00\xfa\x00\x00\x00\x80\xe8\x00\x00\x75\x30\x00\x00\xea\x60\ \x00\x00\x3a\x98\x00\x00\x17\x70\x9c\xba\x51\x3c\x00\x00\x00\x02\ \x62\x4b\x47\x44\x00\xff\x87\x8f\xcc\xbf\x00\x00\x00\x09\x70\x48\ \x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\x00\x9a\x9c\x18\x00\ \x00\x00\xdc\x49\x44\x41\x54\x38\xcb\xbd\x92\x41\x0e\x82\x30\x10\ \x45\x5f\x5c\xe0\x21\x24\x1e\xca\x04\x23\x91\x70\x26\x20\x26\xde\ \x41\xa3\x47\xc2\x34\xe0\x46\xbc\x00\x6c\x70\xa5\x9d\x99\x56\x97\ \xce\xac\xfe\xf4\xbf\x64\xfa\x5b\xf8\x77\x2d\x29\xb9\xe2\x98\x98\ \x70\x5c\x28\x58\xfe\xb2\xef\xb8\x33\x9b\xee\xd9\xc6\xcd\x0b\x8e\ \x81\xf9\xdd\x07\x16\x21\x20\xed\x0f\x2a\x6a\x06\x85\x04\xcb\x48\ \xfb\x0a\x80\x54\x21\x99\xbe\xaa\xdc\xbd\xfa\xcc\x1b\x31\xed\x48\ \x3c\x50\xaa\x8d\xeb\x28\x30\xb3\xf7\xc0\x55\x1d\x0c\xa4\x00\xac\ \x79\xaa\xf9\xd9\x03\xce\xa4\x32\xd0\xd0\x18\xfb\xcc\xcd\x03\xd3\ \xd7\x40\x65\x8f\x21\x60\xe3\xd4\x7a\xb4\x2b\xd9\x38\xad\x6e\x3d\ \x70\x89\xc6\x69\xf5\xc9\x03\x45\x34\x4e\xab\x73\xf9\x70\x7d\x24\ \x4e\xad\x9d\x7c\x38\xd8\x46\xe3\x94\x7a\x63\x7f\xd3\xe1\x67\xa4\ \x75\xec\x7b\x7f\x47\xaa\xd8\xf7\x06\xc8\xe8\x02\xb3\x0b\x97\x91\ \x95\xb0\xe7\xcc\x8d\x91\x91\x96\x13\xb9\xbe\xea\x3f\xea\x05\xa7\ \xf0\xfd\xeb\x14\xb8\xd5\x70\x00\x00\x00\x00\x49\x45\x4e\x44\xae\ \x42\x60\x82\ \x00\x00\x00\xda\ \x3c\ \x73\x76\x67\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\x74\x74\x70\x3a\ \x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\ \x30\x2f\x73\x76\x67\x22\x20\x77\x69\x64\x74\x68\x3d\x22\x34\x38\ \x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x34\x38\x22\x20\x76\x69\ \x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\x20\x34\x38\x20\x34\x38\ \x22\x3e\x3c\x70\x61\x74\x68\x20\x64\x3d\x22\x4d\x32\x33\x2e\x39\ \x39\x20\x33\x37\x2e\x30\x38\x4c\x39\x2e\x32\x34\x20\x32\x35\x2e\ \x36\x31\x20\x36\x20\x32\x38\x2e\x31\x33\x6c\x31\x38\x20\x31\x34\ \x20\x31\x38\x2d\x31\x34\x2d\x33\x2e\x32\x36\x2d\x32\x2e\x35\x33\ \x2d\x31\x34\x2e\x37\x35\x20\x31\x31\x2e\x34\x38\x7a\x4d\x32\x34\ \x20\x33\x32\x6c\x31\x34\x2e\x37\x33\x2d\x31\x31\x2e\x34\x35\x4c\ \x34\x32\x20\x31\x38\x20\x32\x34\x20\x34\x20\x36\x20\x31\x38\x6c\ \x33\x2e\x32\x36\x20\x32\x2e\x35\x33\x4c\x32\x34\x20\x33\x32\x7a\ \x22\x2f\x3e\x3c\x2f\x73\x76\x67\x3e\ \x00\x00\x01\x58\ \x3c\ \x73\x76\x67\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\x74\x74\x70\x3a\ \x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\ \x30\x2f\x73\x76\x67\x22\x20\x77\x69\x64\x74\x68\x3d\x22\x34\x38\ \x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x34\x38\x22\x20\x76\x69\ \x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\x20\x34\x38\x20\x34\x38\ \x22\x3e\x3c\x70\x61\x74\x68\x20\x64\x3d\x22\x4d\x34\x31\x2e\x30\ \x39\x20\x31\x30\x2e\x34\x35\x6c\x2d\x32\x2e\x37\x37\x2d\x33\x2e\ \x33\x36\x43\x33\x37\x2e\x37\x36\x20\x36\x2e\x34\x33\x20\x33\x36\ \x2e\x39\x33\x20\x36\x20\x33\x36\x20\x36\x48\x31\x32\x63\x2d\x2e\ \x39\x33\x20\x30\x2d\x31\x2e\x37\x36\x2e\x34\x33\x2d\x32\x2e\x33\ \x31\x20\x31\x2e\x30\x39\x6c\x2d\x32\x2e\x37\x37\x20\x33\x2e\x33\ \x36\x43\x36\x2e\x33\x34\x20\x31\x31\x2e\x31\x35\x20\x36\x20\x31\ \x32\x2e\x30\x33\x20\x36\x20\x31\x33\x76\x32\x35\x63\x30\x20\x32\ \x2e\x32\x31\x20\x31\x2e\x37\x39\x20\x34\x20\x34\x20\x34\x68\x32\ \x38\x63\x32\x2e\x32\x31\x20\x30\x20\x34\x2d\x31\x2e\x37\x39\x20\ \x34\x2d\x34\x56\x31\x33\x63\x30\x2d\x2e\x39\x37\x2d\x2e\x33\x34\ \x2d\x31\x2e\x38\x35\x2d\x2e\x39\x31\x2d\x32\x2e\x35\x35\x7a\x4d\ \x32\x34\x20\x33\x35\x4c\x31\x33\x20\x32\x34\x68\x37\x76\x2d\x34\ \x68\x38\x76\x34\x68\x37\x4c\x32\x34\x20\x33\x35\x7a\x4d\x31\x30\ \x2e\x32\x35\x20\x31\x30\x6c\x31\x2e\x36\x33\x2d\x32\x68\x32\x34\ \x6c\x31\x2e\x38\x37\x20\x32\x68\x2d\x32\x37\x2e\x35\x7a\x22\x2f\ \x3e\x3c\x2f\x73\x76\x67\x3e\ \x00\x00\x01\x58\ \x3c\ \x73\x76\x67\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\x74\x74\x70\x3a\ \x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\ \x30\x2f\x73\x76\x67\x22\x20\x77\x69\x64\x74\x68\x3d\x22\x34\x38\ \x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x34\x38\x22\x20\x76\x69\ \x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\x20\x34\x38\x20\x34\x38\ \x22\x3e\x3c\x70\x61\x74\x68\x20\x64\x3d\x22\x4d\x33\x39\x2e\x36\ \x32\x20\x32\x39\x2e\x39\x38\x4c\x34\x32\x20\x32\x38\x2e\x31\x33\ \x6c\x2d\x32\x2e\x38\x35\x2d\x32\x2e\x38\x35\x2d\x32\x2e\x33\x38\ \x20\x31\x2e\x38\x35\x20\x32\x2e\x38\x35\x20\x32\x2e\x38\x35\x7a\ \x6d\x2d\x2e\x38\x39\x2d\x39\x2e\x34\x33\x4c\x34\x32\x20\x31\x38\ \x20\x32\x34\x20\x34\x6c\x2d\x35\x2e\x38\x33\x20\x34\x2e\x35\x33\ \x20\x31\x35\x2e\x37\x35\x20\x31\x35\x2e\x37\x35\x20\x34\x2e\x38\ \x31\x2d\x33\x2e\x37\x33\x7a\x4d\x36\x2e\x35\x35\x20\x32\x4c\x34\ \x20\x34\x2e\x35\x35\x6c\x38\x2e\x34\x34\x20\x38\x2e\x34\x34\x4c\ \x36\x20\x31\x38\x6c\x33\x2e\x32\x36\x20\x32\x2e\x35\x33\x4c\x32\ \x34\x20\x33\x32\x6c\x34\x2e\x31\x39\x2d\x33\x2e\x32\x36\x20\x32\ \x2e\x38\x35\x20\x32\x2e\x38\x35\x2d\x37\x2e\x30\x36\x20\x35\x2e\ \x34\x39\x4c\x39\x2e\x32\x34\x20\x32\x35\x2e\x36\x31\x20\x36\x20\ \x32\x38\x2e\x31\x33\x6c\x31\x38\x20\x31\x34\x20\x39\x2e\x38\x39\ \x2d\x37\x2e\x37\x4c\x34\x31\x2e\x34\x36\x20\x34\x32\x20\x34\x34\ \x20\x33\x39\x2e\x34\x35\x20\x36\x2e\x35\x35\x20\x32\x7a\x22\x2f\ \x3e\x3c\x2f\x73\x76\x67\x3e\ \x00\x00\x01\x13\ \x3c\ \x73\x76\x67\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\x74\x74\x70\x3a\ \x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\ \x30\x2f\x73\x76\x67\x22\x20\x77\x69\x64\x74\x68\x3d\x22\x34\x38\ \x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x34\x38\x22\x20\x76\x69\ \x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\x20\x34\x38\x20\x34\x38\ \x22\x3e\x3c\x70\x61\x74\x68\x20\x64\x3d\x22\x4d\x32\x36\x20\x31\ \x34\x68\x2d\x34\x76\x38\x68\x2d\x38\x76\x34\x68\x38\x76\x38\x68\ \x34\x76\x2d\x38\x68\x38\x76\x2d\x34\x68\x2d\x38\x76\x2d\x38\x7a\ \x4d\x32\x34\x20\x34\x43\x31\x32\x2e\x39\x35\x20\x34\x20\x34\x20\ \x31\x32\x2e\x39\x35\x20\x34\x20\x32\x34\x73\x38\x2e\x39\x35\x20\ \x32\x30\x20\x32\x30\x20\x32\x30\x20\x32\x30\x2d\x38\x2e\x39\x35\ \x20\x32\x30\x2d\x32\x30\x53\x33\x35\x2e\x30\x35\x20\x34\x20\x32\ \x34\x20\x34\x7a\x6d\x30\x20\x33\x36\x63\x2d\x38\x2e\x38\x32\x20\ \x30\x2d\x31\x36\x2d\x37\x2e\x31\x38\x2d\x31\x36\x2d\x31\x36\x53\ \x31\x35\x2e\x31\x38\x20\x38\x20\x32\x34\x20\x38\x73\x31\x36\x20\ \x37\x2e\x31\x38\x20\x31\x36\x20\x31\x36\x2d\x37\x2e\x31\x38\x20\ \x31\x36\x2d\x31\x36\x20\x31\x36\x7a\x22\x2f\x3e\x3c\x2f\x73\x76\ \x67\x3e\ " qt_resource_name = b"\ \x00\x07\ \x07\x3b\xe0\xb3\ \x00\x70\ \x00\x6c\x00\x75\x00\x67\x00\x69\x00\x6e\x00\x73\ \x00\x0d\ \x0e\x99\xe8\x93\ \x00\x43\ \x00\x69\x00\x72\x00\x63\x00\x6c\x00\x65\x00\x43\x00\x72\x00\x61\x00\x74\x00\x65\x00\x72\x00\x73\ \x00\x05\ \x00\x6f\xa6\x53\ \x00\x69\ \x00\x63\x00\x6f\x00\x6e\x00\x73\ \x00\x08\ \x0a\x61\x5a\xa7\ \x00\x69\ \x00\x63\x00\x6f\x00\x6e\x00\x2e\x00\x70\x00\x6e\x00\x67\ \x00\x12\ \x0b\x0d\xf4\x27\ \x00\x69\ \x00\x63\x00\x5f\x00\x6c\x00\x61\x00\x79\x00\x65\x00\x72\x00\x73\x00\x5f\x00\x34\x00\x38\x00\x70\x00\x78\x00\x2e\x00\x73\x00\x76\ \x00\x67\ \x00\x13\ \x0f\x34\x1f\x27\ \x00\x69\ \x00\x63\x00\x5f\x00\x61\x00\x72\x00\x63\x00\x68\x00\x69\x00\x76\x00\x65\x00\x5f\x00\x34\x00\x38\x00\x70\x00\x78\x00\x2e\x00\x73\ \x00\x76\x00\x67\ \x00\x18\ \x02\xe6\x9c\xa7\ \x00\x69\ \x00\x63\x00\x5f\x00\x6c\x00\x61\x00\x79\x00\x65\x00\x72\x00\x73\x00\x5f\x00\x63\x00\x6c\x00\x65\x00\x61\x00\x72\x00\x5f\x00\x34\ \x00\x38\x00\x70\x00\x78\x00\x2e\x00\x73\x00\x76\x00\x67\ \x00\x1e\ \x0d\xce\xb3\x87\ \x00\x69\ \x00\x63\x00\x5f\x00\x61\x00\x64\x00\x64\x00\x5f\x00\x63\x00\x69\x00\x72\x00\x63\x00\x6c\x00\x65\x00\x5f\x00\x6f\x00\x75\x00\x74\ \x00\x6c\x00\x69\x00\x6e\x00\x65\x00\x5f\x00\x34\x00\x38\x00\x70\x00\x78\x00\x2e\x00\x73\x00\x76\x00\x67\ " qt_resource_struct_v1 = b"\ \x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\ \x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\ \x00\x00\x00\x14\x00\x02\x00\x00\x00\x02\x00\x00\x00\x03\ \x00\x00\x00\x34\x00\x02\x00\x00\x00\x04\x00\x00\x00\x05\ \x00\x00\x00\x44\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ \x00\x00\x00\xb0\x00\x00\x00\x00\x00\x01\x00\x00\x03\xa2\ \x00\x00\x00\x5a\x00\x00\x00\x00\x00\x01\x00\x00\x01\x68\ \x00\x00\x00\xe6\x00\x00\x00\x00\x00\x01\x00\x00\x04\xfe\ \x00\x00\x00\x84\x00\x00\x00\x00\x00\x01\x00\x00\x02\x46\ " qt_resource_struct_v2 = b"\ \x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\ \x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\ \x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x14\x00\x02\x00\x00\x00\x02\x00\x00\x00\x03\ \x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x34\x00\x02\x00\x00\x00\x04\x00\x00\x00\x05\ \x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x44\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ \x00\x00\x01\x75\x3f\xfb\xd6\x9f\ \x00\x00\x00\xb0\x00\x00\x00\x00\x00\x01\x00\x00\x03\xa2\ \x00\x00\x01\x75\x3f\xfb\xd6\x9f\ \x00\x00\x00\x5a\x00\x00\x00\x00\x00\x01\x00\x00\x01\x68\ \x00\x00\x01\x75\x3f\xfb\xd6\x9f\ \x00\x00\x00\xe6\x00\x00\x00\x00\x00\x01\x00\x00\x04\xfe\ \x00\x00\x01\x75\x3f\xfb\xd6\x9f\ \x00\x00\x00\x84\x00\x00\x00\x00\x00\x01\x00\x00\x02\x46\ \x00\x00\x01\x75\x3f\xfb\xd6\x9f\ " qt_version = [int(v) for v in QtCore.qVersion().split('.')] if qt_version < [5, 8, 0]: rcc_version = 1 qt_resource_struct = qt_resource_struct_v1 else: rcc_version = 2 qt_resource_struct = qt_resource_struct_v2 def qInitResources(): QtCore.qRegisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data) def qCleanupResources(): QtCore.qUnregisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data) qInitResources()
46.947619
129
0.723299
2,294
9,859
3.091979
0.112467
0.17341
0.157338
0.115043
0.588749
0.551107
0.513746
0.483293
0.465529
0.445228
0
0.39521
0.030125
9,859
209
130
47.172249
0.34658
0.015417
0
0.316062
0
0.626943
0.000103
0
0
1
0
0
0
1
0.010363
false
0
0.005181
0
0.015544
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
4
2a0163abf280cb04a1d37410665435dd6e038977
495
py
Python
tests/test_socfaker_application.py
priamai/soc-faker
51b587f0cec52212136905280406e915006d2afc
[ "MIT" ]
122
2020-02-21T16:06:54.000Z
2022-03-21T13:53:03.000Z
tests/test_socfaker_application.py
priamai/soc-faker
51b587f0cec52212136905280406e915006d2afc
[ "MIT" ]
13
2020-01-29T16:37:05.000Z
2022-01-27T21:30:10.000Z
tests/test_socfaker_application.py
priamai/soc-faker
51b587f0cec52212136905280406e915006d2afc
[ "MIT" ]
20
2020-04-10T11:59:29.000Z
2022-02-10T09:20:26.000Z
def test_socfaker_application_status(socfaker_fixture): assert socfaker_fixture.application.status in ['Active', 'Inactive', 'Legacy'] def test_socfaker_application_account_status(socfaker_fixture): assert socfaker_fixture.application.account_status in ['Enabled', 'Disabled'] def test_socfaker_name(socfaker_fixture): assert socfaker_fixture.application.name def test_socfaker_application_logon_timestamp(socfaker_fixture): assert socfaker_fixture.application.logon_timestamp
45
82
0.842424
58
495
6.793103
0.293103
0.304569
0.152284
0.294416
0.507614
0.507614
0.269036
0
0
0
0
0
0.082828
495
11
83
45
0.867841
0
0
0
0
0
0.070565
0
0
0
0
0
0.5
1
0.5
false
0
0
0
0.5
0
0
0
0
null
1
0
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
1
0
1
0
0
0
0
0
0
0
4
2a0c50108ad0d192b72ca77b3ab58cf9d7e8b047
113
py
Python
constants.py
mattdeitke/allenact-1
70f106b32a38424e862399a76d84f607838063be
[ "MIT" ]
1
2020-09-10T13:09:14.000Z
2020-09-10T13:09:14.000Z
constants.py
mattdeitke/allenact-1
70f106b32a38424e862399a76d84f607838063be
[ "MIT" ]
null
null
null
constants.py
mattdeitke/allenact-1
70f106b32a38424e862399a76d84f607838063be
[ "MIT" ]
null
null
null
import os from pathlib import Path ABS_PATH_OF_TOP_LEVEL_DIR = os.path.abspath(os.path.dirname(Path(__file__)))
22.6
76
0.814159
20
113
4.15
0.65
0.144578
0
0
0
0
0
0
0
0
0
0
0.088496
113
4
77
28.25
0.805825
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
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
0
0
1
0
1
0
0
4
2a2d6edb0fce651f5c81ecdcc1654544c63224b4
254
py
Python
src/app/admin/__init__.py
schwetzen/liblr
408235a4f539a05f54f0376dbf9dbcd83957db03
[ "Apache-2.0" ]
null
null
null
src/app/admin/__init__.py
schwetzen/liblr
408235a4f539a05f54f0376dbf9dbcd83957db03
[ "Apache-2.0" ]
1
2018-12-07T22:15:28.000Z
2018-12-07T22:15:28.000Z
src/app/admin/__init__.py
schwetzen/liblr
408235a4f539a05f54f0376dbf9dbcd83957db03
[ "Apache-2.0" ]
2
2018-12-07T20:59:53.000Z
2018-12-17T21:02:21.000Z
from django.contrib import admin from app.models import * from app.admin.tip import ReadingTipAdmin from app.admin.user import UserAdmin # Register your models here. admin.site.register(User, UserAdmin) admin.site.register(ReadingTip, ReadingTipAdmin)
25.4
48
0.818898
35
254
5.942857
0.457143
0.100962
0.115385
0
0
0
0
0
0
0
0
0
0.106299
254
9
49
28.222222
0.9163
0.102362
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
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
0
1
0
1
0
0
4
2a3de723ee6980cbdbd514d26ca2d35bda76c165
195
py
Python
tests/test_input_laplace_time_ebcs.py
Gkdnz/SfePy
a3a39d4e087705e9e0e8884cbf63513a2ded2108
[ "BSD-3-Clause" ]
null
null
null
tests/test_input_laplace_time_ebcs.py
Gkdnz/SfePy
a3a39d4e087705e9e0e8884cbf63513a2ded2108
[ "BSD-3-Clause" ]
null
null
null
tests/test_input_laplace_time_ebcs.py
Gkdnz/SfePy
a3a39d4e087705e9e0e8884cbf63513a2ded2108
[ "BSD-3-Clause" ]
2
2019-01-14T03:12:34.000Z
2021-05-25T11:44:50.000Z
input_name = '../examples/diffusion/laplace_time_ebcs.py' output_name_trunk = 'test_laplace_time_ebcs' from tests_basic import TestInputEvolutionary class Test(TestInputEvolutionary): pass
24.375
57
0.825641
24
195
6.333333
0.75
0.144737
0.197368
0
0
0
0
0
0
0
0
0
0.097436
195
7
58
27.857143
0.863636
0
0
0
0
0
0.328205
0.328205
0
0
0
0
0
1
0
false
0.2
0.2
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
0
1
0
0
0
0
0
4
2a54c4b02d79ac04b72ebbd0cef513843105c1f0
227
py
Python
src/learners/__init__.py
OscarPedaVendere/sc2MultiAgentES
54df34eb94f00294c2bcd1ac5a0c14386c0bbceb
[ "Apache-2.0" ]
null
null
null
src/learners/__init__.py
OscarPedaVendere/sc2MultiAgentES
54df34eb94f00294c2bcd1ac5a0c14386c0bbceb
[ "Apache-2.0" ]
4
2021-03-19T03:43:34.000Z
2022-01-13T01:39:12.000Z
src/learners/__init__.py
OscarPedaVendere/sc2MultiAgentES
54df34eb94f00294c2bcd1ac5a0c14386c0bbceb
[ "Apache-2.0" ]
null
null
null
from .q_learner import QLearner from .coma_learner import COMALearner from .es_learner import ESLearner REGISTRY = {} REGISTRY["q_learner"] = QLearner REGISTRY["coma_learner"] = COMALearner REGISTRY["es_learner"] = ESLearner
22.7
38
0.792952
28
227
6.214286
0.357143
0.224138
0
0
0
0
0
0
0
0
0
0
0.114537
227
9
39
25.222222
0.865672
0
0
0
0
0
0.136564
0
0
0
0
0
0
1
0
false
0
0.428571
0
0.428571
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
0
0
0
4
2a6ed08ae7b12c0e3073c649e6772dd81c550a9f
74
py
Python
test/__init__.py
shikajiro/picosdk-python-wrappers
c441870e1d39aa6a85b3cfd5acb1b3968669a7cf
[ "0BSD" ]
114
2018-10-05T07:11:20.000Z
2022-03-14T15:51:15.000Z
test/__init__.py
shikajiro/picosdk-python-wrappers
c441870e1d39aa6a85b3cfd5acb1b3968669a7cf
[ "0BSD" ]
26
2018-09-24T13:43:55.000Z
2021-05-03T21:18:02.000Z
test/__init__.py
shikajiro/picosdk-python-wrappers
c441870e1d39aa6a85b3cfd5acb1b3968669a7cf
[ "0BSD" ]
84
2018-09-14T16:05:32.000Z
2022-03-30T19:25:56.000Z
# # Copyright (C) 2018 Pico Technology Ltd. See LICENSE file for terms. #
18.5
69
0.716216
11
74
4.818182
1
0
0
0
0
0
0
0
0
0
0
0.066667
0.189189
74
3
70
24.666667
0.816667
0.905405
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
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
4
2a7afbc42adc7196fbe7873b0d70fede0a2ca8a1
186
py
Python
gentelella/registeration/forms.py
horoyoii/admin_dashboard_edgex
9aea5e43eeb3da17d9e9c65c3ed0337fe7694cb8
[ "MIT" ]
2
2020-05-24T20:34:41.000Z
2021-08-28T07:27:45.000Z
dashboard/registeration/forms.py
horoyoii/graduation_piece
4f907a10636e3862d09e950c6eb5f12e95b1a8e5
[ "MIT" ]
5
2021-03-19T09:14:10.000Z
2021-06-10T19:54:28.000Z
gentelella/registeration/forms.py
horoyoii/admin_dashboard_edgex
9aea5e43eeb3da17d9e9c65c3ed0337fe7694cb8
[ "MIT" ]
1
2020-04-04T07:58:51.000Z
2020-04-04T07:58:51.000Z
from django import forms from .models import * class ProfileFormModel(forms.ModelForm): class Meta: model = Device_profile fields = ['device_profile_file']
14.307692
40
0.672043
20
186
6.1
0.7
0.213115
0
0
0
0
0
0
0
0
0
0
0.258065
186
13
41
14.307692
0.884058
0
0
0
0
0
0.101604
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.666667
0
1
0
0
null
1
0
0
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
0
0
0
1
0
1
0
0
4
2a8363a38588e48c3e8be09e652671f8d40a05b1
152
py
Python
bot/typings/common.py
Axelancerr/Life
1e214af2a46439a756c442967be4bfa8b05fd99c
[ "MIT" ]
27
2020-10-18T04:35:00.000Z
2021-08-03T13:21:27.000Z
dashboard/typings/common.py
Axelancerr/Life-dashboard
ecde503c1a90fdedd680ae19d22b3f5c9da4c4c2
[ "MIT" ]
19
2020-12-04T23:03:51.000Z
2021-08-14T20:21:53.000Z
dashboard/typings/common.py
Axelancerr/Life-dashboard
ecde503c1a90fdedd680ae19d22b3f5c9da4c4c2
[ "MIT" ]
7
2020-10-26T18:51:17.000Z
2021-07-07T05:39:01.000Z
# Future from __future__ import annotations # Standard Library from typing import Literal ImageFormat = Literal["webp", "jpeg", "jpg", "png", "gif"]
16.888889
58
0.723684
18
152
5.888889
0.777778
0
0
0
0
0
0
0
0
0
0
0
0.151316
152
8
59
19
0.821705
0.151316
0
0
0
0
0.134921
0
0
0
0
0
0
1
0
false
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
0
0
1
0
1
0
0
4