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
ad953f5ac6cdc2aa8e9241ffa9879367916a0a41
1,599
py
Python
tests/tracer/test_context.py
melancholy/dd-trace-py
32d463e5465466bc876c85a45880a84824d9b47c
[ "Apache-2.0", "BSD-3-Clause" ]
308
2016-12-07T16:49:27.000Z
2022-03-15T10:06:45.000Z
tests/tracer/test_context.py
melancholy/dd-trace-py
32d463e5465466bc876c85a45880a84824d9b47c
[ "Apache-2.0", "BSD-3-Clause" ]
1,928
2016-11-28T17:13:18.000Z
2022-03-31T21:43:19.000Z
tests/tracer/test_context.py
melancholy/dd-trace-py
32d463e5465466bc876c85a45880a84824d9b47c
[ "Apache-2.0", "BSD-3-Clause" ]
311
2016-11-27T03:01:49.000Z
2022-03-18T21:34:03.000Z
import pytest from ddtrace.context import Context from ddtrace.span import Span @pytest.mark.parametrize( "ctx1,ctx2", [ (Context(), Context()), (Context(trace_id=123), Context(trace_id=123)), ( Context(trace_id=123, span_id=321, dd_origin="synthetics", sampling_priority=2), Context(trace_id=123, span_id=321, dd_origin="synthetics", sampling_priority=2), ), ], ) def test_eq(ctx1, ctx2): assert ctx1 == ctx2 @pytest.mark.parametrize( "ctx1,ctx2", [ (Context(), Span(None, "")), (Context(), None), (Context(), object()), (None, Context()), (Context(), 5), (5, Context()), ( Context(trace_id=123, span_id=321, dd_origin="synthetics", sampling_priority=2), Context(trace_id=1234, span_id=321, dd_origin="synthetics", sampling_priority=2), ), ( Context(trace_id=123, span_id=321, dd_origin="synthetics", sampling_priority=2), Context(trace_id=123, span_id=3210, dd_origin="synthetics", sampling_priority=2), ), ( Context(trace_id=123, span_id=321, dd_origin="synthetics", sampling_priority=2), Context(trace_id=123, span_id=321, dd_origin="synthetics1", sampling_priority=2), ), ( Context(trace_id=123, span_id=321, dd_origin="synthetics", sampling_priority=2), Context(trace_id=123, span_id=321, dd_origin="synthetics", sampling_priority=0), ), ], ) def test_not_eq(ctx1, ctx2): assert ctx1 != ctx2
31.352941
93
0.602251
192
1,599
4.78125
0.166667
0.156863
0.183007
0.203704
0.828976
0.813725
0.683007
0.683007
0.64597
0.64597
0
0.077694
0.251407
1,599
50
94
31.98
0.689223
0
0
0.377778
0
0
0.074422
0
0
0
0
0
0.044444
1
0.044444
false
0
0.066667
0
0.111111
0
0
0
0
null
0
1
1
1
1
0
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
5
d10879f505005e443d70afbdbdacbe7443e60b4b
102
py
Python
powermate/__init__.py
sparkyb/powermate
3bd3f02679a0150bad0a3ac4aba03c5c38d3e991
[ "MIT" ]
1
2022-03-13T00:38:56.000Z
2022-03-13T00:38:56.000Z
powermate/__init__.py
sparkyb/powermate
3bd3f02679a0150bad0a3ac4aba03c5c38d3e991
[ "MIT" ]
null
null
null
powermate/__init__.py
sparkyb/powermate
3bd3f02679a0150bad0a3ac4aba03c5c38d3e991
[ "MIT" ]
null
null
null
import platform if platform.system() == 'Windows': from .win import * else: from .linux import *
14.571429
34
0.676471
13
102
5.307692
0.692308
0
0
0
0
0
0
0
0
0
0
0
0.196078
102
6
35
17
0.841463
0
0
0
0
0
0.068627
0
0
0
0
0
0
1
0
true
0
0.6
0
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
1
0
1
0
1
0
0
5
d1145b7e0d05d3820b91807243d82701cfc26535
105
py
Python
interpreter/code/integration.py
choosewhatulike/500lines
fba689d101eb5600f5c8f4d7fd79912498e950e2
[ "CC-BY-3.0" ]
26,185
2015-01-01T04:59:51.000Z
2022-03-31T10:20:14.000Z
interpreter/code/integration.py
fsxchen/500lines
3f2cd407ebedaf0a3cfa6858c4cf94543067433d
[ "CC-BY-3.0" ]
160
2015-01-05T12:20:21.000Z
2021-10-03T07:25:43.000Z
interpreter/code/integration.py
fsxchen/500lines
3f2cd407ebedaf0a3cfa6858c4cf94543067433d
[ "CC-BY-3.0" ]
6,572
2015-01-01T01:31:00.000Z
2022-03-31T07:31:22.000Z
# A file to test if pyvm works from the command line. def it_works(): print("Success!") it_works()
15
53
0.67619
18
105
3.833333
0.833333
0.202899
0
0
0
0
0
0
0
0
0
0
0.209524
105
6
54
17.5
0.831325
0.485714
0
0
0
0
0.153846
0
0
0
0
0
0
1
0.333333
true
0
0
0
0.333333
0.333333
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
0
0
0
0
0
5
d11aad508fdd5bc8cfcd3b8a0377eff81c8b94dc
111
py
Python
Unit 07 Lists and Functions/01 Lists and Functions/Function Recap/7-Strings in Functions.py
lpython2006e/python-samples
b94ba67ce0d7798ecf796dadae206aa75da58301
[ "MIT" ]
null
null
null
Unit 07 Lists and Functions/01 Lists and Functions/Function Recap/7-Strings in Functions.py
lpython2006e/python-samples
b94ba67ce0d7798ecf796dadae206aa75da58301
[ "MIT" ]
null
null
null
Unit 07 Lists and Functions/01 Lists and Functions/Function Recap/7-Strings in Functions.py
lpython2006e/python-samples
b94ba67ce0d7798ecf796dadae206aa75da58301
[ "MIT" ]
null
null
null
n = "Hello" # Your function here! def string_function(s): return s + 'world' print(string_function(n))
11.1
25
0.666667
16
111
4.5
0.6875
0.388889
0
0
0
0
0
0
0
0
0
0
0.198198
111
9
26
12.333333
0.808989
0.171171
0
0
0
0
0.111111
0
0
0
0
0
0
1
0.25
false
0
0
0.25
0.5
0.25
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
5
d13e64b52ac54ad4ac8cd310146ad5a173239aef
75
py
Python
sandbox.py
alecramsay/ushouse
d191f65734aabd6e4b314792d1a1c71039e7cf97
[ "MIT" ]
null
null
null
sandbox.py
alecramsay/ushouse
d191f65734aabd6e4b314792d1a1c71039e7cf97
[ "MIT" ]
null
null
null
sandbox.py
alecramsay/ushouse
d191f65734aabd6e4b314792d1a1c71039e7cf97
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # # SANDBOX, THROWAWAY CODE from ushouse import *
10.714286
25
0.706667
10
75
5.3
1
0
0
0
0
0
0
0
0
0
0
0.016129
0.173333
75
6
26
12.5
0.83871
0.6
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
d143daf74c65adc8cb6f5f3b8fda7232bb904855
137
py
Python
Semana01Atividade1/data_formatada.py
Marvingms7/IFPI
0f6d50e4a7e1016e58cd227b477b3ce08e19c61a
[ "MIT" ]
null
null
null
Semana01Atividade1/data_formatada.py
Marvingms7/IFPI
0f6d50e4a7e1016e58cd227b477b3ce08e19c61a
[ "MIT" ]
null
null
null
Semana01Atividade1/data_formatada.py
Marvingms7/IFPI
0f6d50e4a7e1016e58cd227b477b3ce08e19c61a
[ "MIT" ]
null
null
null
dia = int(input("Digite um dia: ")) mes = int(input("Digite um mes: ")) ano = int(input("Digite um ano: ")) print (f' {dia}/{mes}/{ano}')
34.25
35
0.591241
23
137
3.521739
0.391304
0.296296
0.518519
0.592593
0
0
0
0
0
0
0
0
0.145985
137
4
36
34.25
0.692308
0
0
0
0
0
0.456522
0
0
0
0
0
0
1
0
false
0
0
0
0
0.25
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
d15d936c1aadffc6d4e7fe4d433298b26bd3ed19
52
py
Python
bsp/TC264D/PikaScript/main.py
GorgonMeducer/pikascript
fefe9afb17d14c1a3bbe75c4c6a83d65831f451e
[ "MIT" ]
228
2021-09-11T06:09:43.000Z
2022-03-30T08:09:01.000Z
bsp/TC264D/PikaScript/main.py
GorgonMeducer/pikascript
fefe9afb17d14c1a3bbe75c4c6a83d65831f451e
[ "MIT" ]
48
2021-09-25T01:23:43.000Z
2022-03-31T07:34:43.000Z
bsp/TC264D/PikaScript/main.py
GorgonMeducer/pikascript
fefe9afb17d14c1a3bbe75c4c6a83d65831f451e
[ "MIT" ]
31
2021-09-17T12:06:45.000Z
2022-03-19T16:10:11.000Z
import PikaStdLib print('hello PikaScript @TC264')
17.333333
33
0.788462
6
52
6.833333
1
0
0
0
0
0
0
0
0
0
0
0.065217
0.115385
52
3
33
17.333333
0.826087
0
0
0
0
0
0.45283
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0.5
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
1
0
5
d16127f270d7487f879b41992c2746df55978b9b
99
py
Python
Exercicios6/exemploDefault.py
vinihf/Prog1_ADS_2019
97d2e0cddf72c00a73d0bc3070bb9731e66e19e2
[ "CC-BY-4.0" ]
1
2019-04-18T13:43:15.000Z
2019-04-18T13:43:15.000Z
Exercicios6/exemploDefault.py
vinihf/Prog1_ADS_2019
97d2e0cddf72c00a73d0bc3070bb9731e66e19e2
[ "CC-BY-4.0" ]
null
null
null
Exercicios6/exemploDefault.py
vinihf/Prog1_ADS_2019
97d2e0cddf72c00a73d0bc3070bb9731e66e19e2
[ "CC-BY-4.0" ]
null
null
null
def funcao(x = 1,y = 1): return 2*x+y print(funcao(2,3)) print(funcao(3,2)) print(funcao(1,2))
16.5
24
0.616162
22
99
2.772727
0.409091
0.540984
0
0
0
0
0
0
0
0
0
0.107143
0.151515
99
6
25
16.5
0.619048
0
0
0
0
0
0
0
0
0
0
0
0
1
0.2
false
0
0
0.2
0.4
0.6
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
0
1
0
1
0
5
66f6a52a0a3184c60a11bbb75dace84d352fe528
32
py
Python
witmotionservo/__init__.py
meseta/py-witmotion-servo
35d050c1eac09f945bd940025728687d9b376179
[ "MIT" ]
3
2020-09-04T15:06:43.000Z
2022-01-15T13:22:45.000Z
witmotionservo/__init__.py
meseta/py-witmotion-servo
35d050c1eac09f945bd940025728687d9b376179
[ "MIT" ]
null
null
null
witmotionservo/__init__.py
meseta/py-witmotion-servo
35d050c1eac09f945bd940025728687d9b376179
[ "MIT" ]
null
null
null
from .main import WitmotionServo
32
32
0.875
4
32
7
1
0
0
0
0
0
0
0
0
0
0
0
0.09375
32
1
32
32
0.965517
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
0f0065432581a87cf51482812719b9f057d51040
1,692
py
Python
terrascript/resource/NetApp/netapp_cloudmanager.py
mjuenema/python-terrascript
6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d
[ "BSD-2-Clause" ]
507
2017-07-26T02:58:38.000Z
2022-01-21T12:35:13.000Z
terrascript/resource/NetApp/netapp_cloudmanager.py
mjuenema/python-terrascript
6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d
[ "BSD-2-Clause" ]
135
2017-07-20T12:01:59.000Z
2021-10-04T22:25:40.000Z
terrascript/resource/NetApp/netapp_cloudmanager.py
mjuenema/python-terrascript
6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d
[ "BSD-2-Clause" ]
81
2018-02-20T17:55:28.000Z
2022-01-31T07:08:40.000Z
# terrascript/resource/NetApp/netapp_cloudmanager.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:22:08 UTC) import terrascript class netapp_cloudmanager_aggregate(terrascript.Resource): pass class netapp_cloudmanager_anf_volume(terrascript.Resource): pass class netapp_cloudmanager_aws_fsx(terrascript.Resource): pass class netapp_cloudmanager_cifs_server(terrascript.Resource): pass class netapp_cloudmanager_connector_aws(terrascript.Resource): pass class netapp_cloudmanager_connector_azure(terrascript.Resource): pass class netapp_cloudmanager_connector_gcp(terrascript.Resource): pass class netapp_cloudmanager_cvo_aws(terrascript.Resource): pass class netapp_cloudmanager_cvo_azure(terrascript.Resource): pass class netapp_cloudmanager_cvo_gcp(terrascript.Resource): pass class netapp_cloudmanager_cvs_gcp_volume(terrascript.Resource): pass class netapp_cloudmanager_nss_account(terrascript.Resource): pass class netapp_cloudmanager_snapmirror(terrascript.Resource): pass class netapp_cloudmanager_volume(terrascript.Resource): pass __all__ = [ "netapp_cloudmanager_aggregate", "netapp_cloudmanager_anf_volume", "netapp_cloudmanager_aws_fsx", "netapp_cloudmanager_cifs_server", "netapp_cloudmanager_connector_aws", "netapp_cloudmanager_connector_azure", "netapp_cloudmanager_connector_gcp", "netapp_cloudmanager_cvo_aws", "netapp_cloudmanager_cvo_azure", "netapp_cloudmanager_cvo_gcp", "netapp_cloudmanager_cvs_gcp_volume", "netapp_cloudmanager_nss_account", "netapp_cloudmanager_snapmirror", "netapp_cloudmanager_volume", ]
21.692308
73
0.805556
186
1,692
6.870968
0.193548
0.408451
0.251956
0.28482
0.550861
0.522692
0.378717
0
0
0
0
0.008119
0.126478
1,692
77
74
21.974026
0.856563
0.072104
0
0.311111
1
0
0.269304
0.269304
0
0
0
0
0
1
0
false
0.311111
0.022222
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
1
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
5
0f155216a541115f79695803b37e7edb47f166a1
55
py
Python
hwmatcher/neigh_search/__init__.py
georg3tom/matching-handwritten-document-images
a86d197b0f84bf6c0733bc75d5aff3d1b2263d60
[ "MIT" ]
1
2020-12-24T07:13:39.000Z
2020-12-24T07:13:39.000Z
hwmatcher/neigh_search/__init__.py
georg3tom/matching-handwritten-document-images
a86d197b0f84bf6c0733bc75d5aff3d1b2263d60
[ "MIT" ]
null
null
null
hwmatcher/neigh_search/__init__.py
georg3tom/matching-handwritten-document-images
a86d197b0f84bf6c0733bc75d5aff3d1b2263d60
[ "MIT" ]
null
null
null
from .lsh import LSHIndex from .l2 import L2ExactIndex
18.333333
28
0.818182
8
55
5.625
0.75
0
0
0
0
0
0
0
0
0
0
0.042553
0.145455
55
2
29
27.5
0.914894
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
0f417a517cde3edd75aef72dd3240a0bcba6d285
29
py
Python
forge/blade/hook/__init__.py
jarbus/neural-mmo
7ad02fab50f2781c0a71f7d2afd10c1503110736
[ "MIT" ]
1,450
2019-03-04T15:47:38.000Z
2022-03-30T03:33:35.000Z
forge/blade/hook/__init__.py
jarbus/neural-mmo
7ad02fab50f2781c0a71f7d2afd10c1503110736
[ "MIT" ]
34
2019-03-05T09:50:38.000Z
2021-08-31T15:20:27.000Z
forge/blade/hook/__init__.py
LaudateCorpus1/neural-mmo
a9a7c34a1fb24fbf252e2958bdb869c213e580a3
[ "MIT" ]
164
2019-03-04T16:09:19.000Z
2022-02-26T15:43:40.000Z
from .modules import modules
14.5
28
0.827586
4
29
6
0.75
0
0
0
0
0
0
0
0
0
0
0
0.137931
29
1
29
29
0.96
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
0f7fbd3995dbd9665333def992033f65c0b5252f
181
py
Python
HotelManagement/RoomsManagement/urls.py
sriram012/Hotel-Management
94a838895a69843ba0112e9a5ea5674362eb66a3
[ "Unlicense" ]
null
null
null
HotelManagement/RoomsManagement/urls.py
sriram012/Hotel-Management
94a838895a69843ba0112e9a5ea5674362eb66a3
[ "Unlicense" ]
null
null
null
HotelManagement/RoomsManagement/urls.py
sriram012/Hotel-Management
94a838895a69843ba0112e9a5ea5674362eb66a3
[ "Unlicense" ]
1
2019-01-05T12:53:57.000Z
2019-01-05T12:53:57.000Z
from django.urls import path, re_path from .views import * app_name = 'rooms_management' urlpatterns = [ path('room_management_login/', room_management_login, name='login') ]
20.111111
71
0.751381
24
181
5.375
0.583333
0.217054
0.294574
0
0
0
0
0
0
0
0
0
0.138122
181
8
72
22.625
0.826923
0
0
0
0
0
0.237569
0.121547
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
7e6b3d101838903a27e6bb4f977a6a32345068ea
150
py
Python
src/python/Sandbox.py
computer-geek64/accessible-audio-keyboard
2544166917505ed51d738b8d5300062fbbd3a2fd
[ "MIT" ]
null
null
null
src/python/Sandbox.py
computer-geek64/accessible-audio-keyboard
2544166917505ed51d738b8d5300062fbbd3a2fd
[ "MIT" ]
null
null
null
src/python/Sandbox.py
computer-geek64/accessible-audio-keyboard
2544166917505ed51d738b8d5300062fbbd3a2fd
[ "MIT" ]
null
null
null
#!/usr/bin/python3 # Sandbox.py # Ashish D'Souza # November 15th, 2018 import Autocomplete print(Autocomplete.predict_word("h", max_suggestions=7))
16.666667
56
0.76
21
150
5.333333
0.952381
0
0
0
0
0
0
0
0
0
0
0.059701
0.106667
150
9
56
16.666667
0.776119
0.42
0
0
0
0
0.011905
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0.5
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
1
0
5
7e8a44561abac2ee3050ccb1548862eb055ee97f
90
py
Python
utils_gao/__init__.py
pjgao/utils_gao
038a77a6038d635f54c7644ad3439cbc6af3e5c3
[ "MIT" ]
null
null
null
utils_gao/__init__.py
pjgao/utils_gao
038a77a6038d635f54c7644ad3439cbc6af3e5c3
[ "MIT" ]
null
null
null
utils_gao/__init__.py
pjgao/utils_gao
038a77a6038d635f54c7644ad3439cbc6af3e5c3
[ "MIT" ]
null
null
null
#!/usr/bin/env python # encoding=utf-8 def test(): print('utils_gao, making for ml')
15
37
0.655556
15
90
3.866667
1
0
0
0
0
0
0
0
0
0
0
0.013333
0.166667
90
6
37
15
0.76
0.388889
0
0
0
0
0.444444
0
0
0
0
0
0
1
0.5
true
0
0
0
0.5
0.5
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
0
0
0
1
0
5
0e482a12807516d7d13314e6840f61e6d7d4fecc
119
py
Python
torch_pipeline/autotorch/models/__init__.py
Fanxingye/AutoDL
6f409aefc8b81e5fe47df57b82332c8df427875d
[ "Apache-2.0" ]
1
2021-11-04T09:19:14.000Z
2021-11-04T09:19:14.000Z
torch_pipeline/autotorch/models/__init__.py
Fanxingye/AutoDL
6f409aefc8b81e5fe47df57b82332c8df427875d
[ "Apache-2.0" ]
null
null
null
torch_pipeline/autotorch/models/__init__.py
Fanxingye/AutoDL
6f409aefc8b81e5fe47df57b82332c8df427875d
[ "Apache-2.0" ]
null
null
null
from .model_zoo import get_model_list from .network import init_network __all__ = ['get_model_list', 'init_network']
19.833333
44
0.798319
18
119
4.666667
0.5
0.190476
0.285714
0
0
0
0
0
0
0
0
0
0.117647
119
5
45
23.8
0.8
0
0
0
0
0
0.218487
0
0
0
0
0
0
1
0
false
0
0.666667
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
1
0
0
5
0e59d8c855a245dd5b0e8d7754d06eae99c10973
962
py
Python
tfmiss/keras/layers/__init__.py
shkarupa-alex/tfmiss
4fe1bb3a47327c07711f910ee53319167032b6af
[ "MIT" ]
1
2019-06-25T15:58:20.000Z
2019-06-25T15:58:20.000Z
tfmiss/keras/layers/__init__.py
shkarupa-alex/tfmiss
4fe1bb3a47327c07711f910ee53319167032b6af
[ "MIT" ]
1
2021-11-11T12:56:51.000Z
2021-11-11T12:56:51.000Z
tfmiss/keras/layers/__init__.py
shkarupa-alex/tfmiss
4fe1bb3a47327c07711f910ee53319167032b6af
[ "MIT" ]
2
2020-02-11T15:46:58.000Z
2021-11-21T02:47:36.000Z
from __future__ import absolute_import from __future__ import division from __future__ import print_function from tfmiss.keras.layers.attention import SelfAttentionWithContext, MultiplicativeSelfAttention, AdditiveSelfAttention from tfmiss.keras.layers.dcnv2 import DCNv2 from tfmiss.keras.layers.dropout import TimestepDropout from tfmiss.keras.layers.embedding import AdaptiveEmbedding from tfmiss.keras.layers.preprocessing import WordShape from tfmiss.keras.layers.qrnn import QRNN from tfmiss.keras.layers.scale import L2Scale from tfmiss.keras.layers.softmax import AdaptiveSoftmax, NoiseContrastiveEstimation, SampledSofmax from tfmiss.keras.layers.tcn import TemporalConvNet from tfmiss.keras.layers.temp import Reduction from tfmiss.keras.layers.todense import ToDense from tfmiss.keras.layers.wordvec import WordEmbedding, CharNgramEmbedding, CharBpeEmbedding, CharCnnEmbedding from tfmiss.keras.layers.wrappers import MapFlat, WeightNorm, WithRagged
53.444444
118
0.873181
114
962
7.245614
0.368421
0.157385
0.236077
0.330508
0
0
0
0
0
0
0
0.003378
0.076923
962
17
119
56.588235
0.926802
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0.0625
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
1
0
0
5
0e75138e7d50415f1ed7f7ff6d55fe940b2fc7d2
215
py
Python
server/app_config.py
abhishekm47/WebRTC-Server-Python
78bcc00bc0d42e8cb1c4632dda850b9f63e42c45
[ "MIT" ]
3
2021-07-31T14:18:05.000Z
2021-09-06T14:59:04.000Z
server/app_config.py
abhishekm47/WebRTC-Server-Python
78bcc00bc0d42e8cb1c4632dda850b9f63e42c45
[ "MIT" ]
null
null
null
server/app_config.py
abhishekm47/WebRTC-Server-Python
78bcc00bc0d42e8cb1c4632dda850b9f63e42c45
[ "MIT" ]
1
2021-07-25T08:32:19.000Z
2021-07-25T08:32:19.000Z
import tornado.options tornado.options.define('port') tornado.options.define('loglevel') tornado.options.define('address') tornado.options.define('public_address') tornado.options.parse_config_file("server.conf")
23.888889
48
0.809302
27
215
6.333333
0.481481
0.491228
0.467836
0
0
0
0
0
0
0
0
0
0.04186
215
8
49
26.875
0.830097
0
0
0
0
0
0.205607
0
0
0
0
0
0
1
0
true
0
0.166667
0
0.166667
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
1
0
0
0
0
0
0
5
0e9d2d54ea1407aad61b1bfc71c8ce95e086038b
44
py
Python
src/preproc/__init__.py
rewolfiluac/convert-torch2trt-demo
9b9a3646bdf8b82af2149e73b4cd57939c6729cd
[ "MIT" ]
null
null
null
src/preproc/__init__.py
rewolfiluac/convert-torch2trt-demo
9b9a3646bdf8b82af2149e73b4cd57939c6729cd
[ "MIT" ]
null
null
null
src/preproc/__init__.py
rewolfiluac/convert-torch2trt-demo
9b9a3646bdf8b82af2149e73b4cd57939c6729cd
[ "MIT" ]
null
null
null
from .preproc import padToSquare, normalize
22
43
0.840909
5
44
7.4
1
0
0
0
0
0
0
0
0
0
0
0
0.113636
44
1
44
44
0.948718
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
0e9e71d7aa8244a3fa29ff3fbe1fb00e2e35b1f3
79
py
Python
moredata/enricher/osm/__init__.py
thomassonobe/more-data
b3d4a8e32f385a69749c8139915e3638fcced37b
[ "BSD-3-Clause" ]
null
null
null
moredata/enricher/osm/__init__.py
thomassonobe/more-data
b3d4a8e32f385a69749c8139915e3638fcced37b
[ "BSD-3-Clause" ]
null
null
null
moredata/enricher/osm/__init__.py
thomassonobe/more-data
b3d4a8e32f385a69749c8139915e3638fcced37b
[ "BSD-3-Clause" ]
null
null
null
from .functional_region_connector import * from .osm_places_connector import *
26.333333
42
0.848101
10
79
6.3
0.7
0.47619
0
0
0
0
0
0
0
0
0
0
0.101266
79
2
43
39.5
0.887324
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
7d1ca5f628d5fed53413cf727d517aedeb3146fe
160
py
Python
app/auth/__init__.py
LemmyMwaura/Personal-log
cec2186497a7c4829ba07fb5522ac06a9192b5b3
[ "MIT" ]
null
null
null
app/auth/__init__.py
LemmyMwaura/Personal-log
cec2186497a7c4829ba07fb5522ac06a9192b5b3
[ "MIT" ]
null
null
null
app/auth/__init__.py
LemmyMwaura/Personal-log
cec2186497a7c4829ba07fb5522ac06a9192b5b3
[ "MIT" ]
1
2022-03-15T07:50:08.000Z
2022-03-15T07:50:08.000Z
from flask import Blueprint,render_template auth = Blueprint("auth", __name__, static_folder='static', template_folder='templates') from app.auth import views
32
87
0.80625
21
160
5.809524
0.619048
0
0
0
0
0
0
0
0
0
0
0
0.09375
160
4
88
40
0.841379
0
0
0
0
0
0.11875
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0.666667
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
1
0
5
7d21c95b3fcbe4915cd84fca84c50f3a2183e815
1,217
py
Python
tests/test_math_operations.py
latera/hyaml
4dc020434d25c182f8477ddd5582398e51501274
[ "Apache-2.0" ]
3
2020-04-12T15:55:11.000Z
2021-08-02T16:26:21.000Z
tests/test_math_operations.py
latera/hyaml
4dc020434d25c182f8477ddd5582398e51501274
[ "Apache-2.0" ]
null
null
null
tests/test_math_operations.py
latera/hyaml
4dc020434d25c182f8477ddd5582398e51501274
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python from unittest import main from tests import TranslationCase as TestCase class TestMathOperations(TestCase): def test_addition(self): self.assertTranslated("4 + 5", "4 + 5") self.assertTranslated("4 + 5 + 9", "4 + 5 + 9") def test_subtraction(self): self.assertTranslated("4 - 5", "4 - 5") self.assertTranslated("4 - 5 - -9", "4 - 5 - -9") def test_multiplication(self): self.assertTranslated("4*5", "4 * 5") self.assertTranslated(" 4 * 5 *-9", "4 * 5 * -9") def test_division(self): self.assertTranslated("9.0 / 5.1", "9.0 / 5.1") def test_modulo(self): self.assertTranslated("5 % 2", "5 % 2") def test_lack_of_spaces(self): self.assertTranslated("3-5", "3 - 5") self.assertTranslated("-3--5", "-3 - -5") class TestMathOpPrecedence(TestCase): def test_mult_with_addition(self): self.assertTranslated("4 + 5 * 3", "4 + 5 * 3") class TestGrouping(TestCase): def test_associating_to_right(self): self.assertTranslated("4 - (3 - 2 - 1)", "4 - (3 - 2 - 1)") def test_associating_to_left(self): self.assertTranslated("(4 - 3) - 2", "(4 - 3) - 2")
28.97619
67
0.593262
163
1,217
4.325153
0.251534
0.039716
0.306383
0.21844
0.46383
0.46383
0.259574
0.259574
0.259574
0.259574
0
0.075512
0.238291
1,217
41
68
29.682927
0.685005
0.016434
0
0
0
0
0.171405
0
0
0
0
0
0.481481
1
0.333333
false
0
0.074074
0
0.518519
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
1
0
1
0
0
0
0
1
0
0
5
7d303e144bacde0d8772be9fa0c81f7480907696
257
py
Python
103.py
KuKuKai/104-108code
b6aabd73a2205a2d23ea901ef9dac39b3e7d9593
[ "MIT" ]
null
null
null
103.py
KuKuKai/104-108code
b6aabd73a2205a2d23ea901ef9dac39b3e7d9593
[ "MIT" ]
null
null
null
103.py
KuKuKai/104-108code
b6aabd73a2205a2d23ea901ef9dac39b3e7d9593
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ Created on Tue Oct 9 20:09:13 2018 @author: JinJheng """ a=input() b=input() c=input() d=input() print('|%10s %10s|' %(a,b)) print('|%10s %10s|' %(c,d)) print('|%-10s %-10s|' %(a,b)) print('|%-10s %-10s|' %(c,d))
17.133333
36
0.490272
42
257
3
0.5
0.253968
0.349206
0.190476
0.412698
0.412698
0.412698
0.412698
0.412698
0.412698
0
0.133971
0.18677
257
15
37
17.133333
0.4689
0.299611
0
0
0
0
0.301887
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
0
0
0
null
1
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
0
0
0
0
0
0
0
0
1
0
5
adcbc9cd741bf4cc0b4a8d41479da410fcaf7a78
145
py
Python
util.py
cako/portal-investidor-scraper
8e0f0574477fbe78f58df7b2e4f4248adfe4ecd9
[ "MIT" ]
null
null
null
util.py
cako/portal-investidor-scraper
8e0f0574477fbe78f58df7b2e4f4248adfe4ecd9
[ "MIT" ]
null
null
null
util.py
cako/portal-investidor-scraper
8e0f0574477fbe78f58df7b2e4f4248adfe4ecd9
[ "MIT" ]
null
null
null
import json def as_json(handler): def loadJson(self, response): return handler(self, json.loads(response.text)) return loadJson
20.714286
55
0.703448
19
145
5.315789
0.578947
0
0
0
0
0
0
0
0
0
0
0
0.2
145
7
56
20.714286
0.87069
0
0
0
0
0
0
0
0
0
0
0
0
1
0.4
false
0
0.2
0.2
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
cb3bd9083e62e9ff67e0542aa8ef82b66a123fe4
15,167
py
Python
tests/test_config.py
yavook/kiwi-scp
ca4263d913cfbdedc8b14334e3cad61c3b95f0a7
[ "MIT" ]
null
null
null
tests/test_config.py
yavook/kiwi-scp
ca4263d913cfbdedc8b14334e3cad61c3b95f0a7
[ "MIT" ]
null
null
null
tests/test_config.py
yavook/kiwi-scp
ca4263d913cfbdedc8b14334e3cad61c3b95f0a7
[ "MIT" ]
null
null
null
from ipaddress import IPv4Network from pathlib import Path import pytest from pydantic import ValidationError from kiwi_scp.config import KiwiConfig from kiwi_scp.yaml import YAML class UnCoercibleError(ValueError): pass class UnCoercible: """A class that doesn't have a string representation""" def __str__(self): raise UnCoercibleError() def __repr__(self) -> str: return "UnCoercible()" class TestDefault: def test(self): import toml c = KiwiConfig() version = toml.load("./pyproject.toml")["tool"]["poetry"]["version"] assert c == KiwiConfig.from_default() assert c.version == version assert len(c.shells) == 1 assert c.shells[0] == Path("/bin/bash") assert c.projects == [] assert c.environment == {} assert c.storage.directory == Path("/var/local/kiwi") assert c.network.name == "kiwi_hub" assert c.network.cidr == IPv4Network("10.22.46.0/24") kiwi_dict = { "version": version, "shells": ["/bin/bash"], "storage": {"directory": "/var/local/kiwi"}, "network": { "name": "kiwi_hub", "cidr": "10.22.46.0/24", }, } assert c.kiwi_dict == kiwi_dict assert c.kiwi_yml == YAML().dump_kiwi_yml(kiwi_dict) class TestVersion: def test_valid(self): c = KiwiConfig(version="0.0.0") assert c.version == "0.0.0" c = KiwiConfig(version="0.0") assert c.version == "0.0" c = KiwiConfig(version="0") assert c.version == "0" c = KiwiConfig(version=1.0) assert c.version == "1.0" c = KiwiConfig(version=1) assert c.version == "1" def test_invalid(self): # definitely not a version with pytest.raises(ValidationError) as exc_info: KiwiConfig(version="dnaf") assert len(exc_info.value.errors()) == 1 error = exc_info.value.errors()[0] assert error["msg"].find("string does not match regex") != -1 assert error["type"] == "value_error.str.regex" # almost a version with pytest.raises(ValidationError) as exc_info: c = KiwiConfig(version="0.0.0alpha") print(c.version) assert len(exc_info.value.errors()) == 1 error = exc_info.value.errors()[0] assert error["msg"].find("string does not match regex") != -1 assert error["type"] == "value_error.str.regex" class TestShells: def test_empty(self): c = KiwiConfig(shells=None) assert c == KiwiConfig(shells=[]) assert c.shells == [] def test_list(self): c = KiwiConfig(shells=["/bin/sh", "sh"]) assert len(c.shells) == 2 assert c.shells[0] == Path("/bin/sh") assert c.shells[1] == Path("sh") c = KiwiConfig(shells=["/bin/bash"]) assert len(c.shells) == 1 assert c.shells[0] == Path("/bin/bash") def test_dict(self): c = KiwiConfig(shells={"/bin/bash": None}) assert len(c.shells) == 1 assert c.shells[0] == Path("/bin/bash") def test_coercible(self): c = KiwiConfig(shells="/bin/bash") assert c == KiwiConfig(shells=Path("/bin/bash")) assert len(c.shells) == 1 assert c.shells[0] == Path("/bin/bash") c = KiwiConfig(shells=123) assert len(c.shells) == 1 assert c.shells[0] == Path("123") def test_uncoercible(self): with pytest.raises(ValidationError) as exc_info: KiwiConfig(shells=UnCoercible()) assert len(exc_info.value.errors()) == 1 error = exc_info.value.errors()[0] assert error["msg"] == "Invalid 'KiwiConfig'.'shells' Format: UnCoercible()" assert error["type"] == "value_error.invalidformat" with pytest.raises(ValidationError) as exc_info: KiwiConfig(shells=["/bin/bash", UnCoercible()]) assert len(exc_info.value.errors()) == 1 error = exc_info.value.errors()[0] assert error["msg"] == "value is not a valid path" assert error["type"] == "type_error.path" class TestProject: def test_empty(self): c = KiwiConfig(projects=None) assert c == KiwiConfig(projects=[]) assert c.projects == [] assert c.get_project_config("invalid") is None def test_long(self): kiwi_dict = { "name": "project", "enabled": False, "override_storage": {"directory": "/test/directory"}, } c = KiwiConfig(projects=[kiwi_dict]) assert len(c.projects) == 1 p = c.projects[0] assert p.name == "project" assert p == c.get_project_config("project") assert not p.enabled assert p.override_storage is not None assert c.kiwi_dict["projects"][0] == kiwi_dict def test_storage_str(self): kiwi_dict = { "name": "project", "enabled": False, "override_storage": "/test/directory", } c = KiwiConfig(projects=[kiwi_dict]) assert len(c.projects) == 1 p = c.projects[0] assert p.name == "project" assert not p.enabled assert p.override_storage is not None def test_storage_list(self): kiwi_dict = { "name": "project", "enabled": False, "override_storage": ["/test/directory"], } c = KiwiConfig(projects=[kiwi_dict]) assert len(c.projects) == 1 p = c.projects[0] assert p.name == "project" assert not p.enabled assert p.override_storage is not None def test_storage_invalid(self): kiwi_dict = { "name": "project", "enabled": False, "override_storage": True, } with pytest.raises(ValidationError) as exc_info: KiwiConfig(projects=[kiwi_dict]) assert len(exc_info.value.errors()) == 1 error = exc_info.value.errors()[0] assert error["msg"] == "Invalid 'StorageConfig' Format: '{}'" assert error["type"] == "value_error.invalidformat" def test_short(self): kiwi_dict = { "project": False, } c = KiwiConfig(projects=[kiwi_dict]) assert len(c.projects) == 1 p = c.projects[0] assert p.name == "project" assert not p.enabled assert p.override_storage is None resulting_kiwi_dict = { "name": "project", "enabled": False, } assert p.kiwi_dict == resulting_kiwi_dict def test_dict(self): c = KiwiConfig(projects={"name": "project"}) assert c == KiwiConfig(projects=[{"name": "project"}]) assert len(c.projects) == 1 p = c.projects[0] assert p.name == "project" assert p.enabled assert p.override_storage is None def test_reserved_name(self): with pytest.raises(ValidationError) as exc_info: KiwiConfig(projects={"name": "config"}) assert len(exc_info.value.errors()) == 1 error = exc_info.value.errors()[0] assert error["msg"] == "Project name 'config' is reserved!" assert error["type"] == "value_error.projectnamereserved" def test_invalid_dict(self): with pytest.raises(ValidationError) as exc_info: KiwiConfig(projects={ "random key 1": "random value 1", "random key 2": "random value 2", }) assert len(exc_info.value.errors()) == 1 error = exc_info.value.errors()[0] assert error["msg"] == "Invalid 'ProjectConfig' Format: " \ "{'random key 1': 'random value 1', 'random key 2': 'random value 2'}" assert error["type"] == "value_error.invalidformat" def test_coercible(self): c = KiwiConfig(projects="project") assert c == KiwiConfig(projects=["project"]) assert len(c.projects) == 1 p = c.projects[0] assert p.name == "project" assert p.enabled assert p.override_storage is None def test_uncoercible(self): with pytest.raises(ValidationError) as exc_info: KiwiConfig(projects=["valid", UnCoercible()]) assert len(exc_info.value.errors()) == 1 error = exc_info.value.errors()[0] assert error["msg"] == "Invalid 'KiwiConfig'.'projects' Format: ['valid', UnCoercible()]" assert error["type"] == "value_error.invalidformat" with pytest.raises(ValidationError) as exc_info: KiwiConfig(projects=UnCoercible()) assert len(exc_info.value.errors()) == 1 error = exc_info.value.errors()[0] assert error["msg"] == "Invalid 'KiwiConfig'.'projects' Format: UnCoercible()" assert error["type"] == "value_error.invalidformat" class TestEnvironment: def test_empty(self): c = KiwiConfig(environment=None) assert c.environment == {} def test_dict(self): c = KiwiConfig(environment={}) assert c.environment == {} kiwi_dict = {"variable": "value"} c = KiwiConfig(environment=kiwi_dict) assert len(c.environment) == 1 assert "variable" in c.environment assert c.environment["variable"] == "value" assert c.kiwi_dict["environment"] == kiwi_dict def test_list(self): c = KiwiConfig(environment=[]) assert c.environment == {} c = KiwiConfig(environment=[ "variable=value", ]) assert len(c.environment) == 1 assert "variable" in c.environment assert c.environment["variable"] == "value" c = KiwiConfig(environment=[ "variable", ]) assert len(c.environment) == 1 assert "variable" in c.environment assert c.environment["variable"] is None c = KiwiConfig(environment=[ 123, ]) assert len(c.environment) == 1 assert "123" in c.environment assert c.environment["123"] is None def test_coercible(self): c = KiwiConfig(environment="variable=value") assert len(c.environment) == 1 assert "variable" in c.environment assert c.environment["variable"] == "value" c = KiwiConfig(environment="variable") assert len(c.environment) == 1 assert "variable" in c.environment assert c.environment["variable"] is None c = KiwiConfig(environment=123) assert len(c.environment) == 1 assert "123" in c.environment assert c.environment["123"] is None c = KiwiConfig(environment=123.4) assert len(c.environment) == 1 assert "123.4" in c.environment assert c.environment["123.4"] is None def test_uncoercible(self): with pytest.raises(ValidationError) as exc_info: KiwiConfig(environment=UnCoercible()) assert len(exc_info.value.errors()) == 1 error = exc_info.value.errors()[0] assert error["msg"] == "Invalid 'KiwiConfig'.'environment' Format: UnCoercible()" assert error["type"] == "value_error.invalidformat" with pytest.raises(ValidationError) as exc_info: KiwiConfig(environment=["valid", UnCoercible()]) assert len(exc_info.value.errors()) == 1 error = exc_info.value.errors()[0] assert error["msg"] == "Invalid 'KiwiConfig'.'environment' Format: None" assert error["type"] == "value_error.invalidformat" class TestStorage: def test_empty(self): with pytest.raises(ValidationError) as exc_info: KiwiConfig(storage=None) assert len(exc_info.value.errors()) == 1 error = exc_info.value.errors()[0] assert error["msg"] == "Member 'KiwiConfig'.'storage' is required!" assert error["type"] == "value_error.missingmember" def test_dict(self): kiwi_dict = {"directory": "/test/directory"} c = KiwiConfig(storage=kiwi_dict) assert c.storage.directory == Path("/test/directory") assert c.storage.kiwi_dict == kiwi_dict def test_invalid_dict(self): with pytest.raises(ValidationError) as exc_info: KiwiConfig(storage={"random key": "random value"}) assert len(exc_info.value.errors()) == 1 error = exc_info.value.errors()[0] assert error["msg"] == "Invalid 'StorageConfig' Format: \"{'random key': 'random value'}\"" assert error["type"] == "value_error.invalidformat" def test_str(self): c = KiwiConfig(storage="/test/directory") assert c.storage.directory == Path("/test/directory") def test_list(self): c = KiwiConfig(storage=["/test/directory"]) assert c.storage.directory == Path("/test/directory") def test_invalid(self): with pytest.raises(ValidationError) as exc_info: KiwiConfig(storage=True) assert len(exc_info.value.errors()) == 1 error = exc_info.value.errors()[0] assert error["msg"] == "Invalid 'StorageConfig' Format: '{}'" assert error["type"] == "value_error.invalidformat" class TestNetwork: def test_empty(self): with pytest.raises(ValidationError) as exc_info: KiwiConfig(network=None) assert len(exc_info.value.errors()) == 1 error = exc_info.value.errors()[0] assert error["msg"] == "Member 'KiwiConfig'.'network' is required!" assert error["type"] == "value_error.missingmember" def test_dict(self): kiwi_dict = { "name": "test_hub", "cidr": "1.2.3.4/32", } c = KiwiConfig(network=kiwi_dict) assert c == KiwiConfig(network={ "name": "TEST_HUB", "cidr": "1.2.3.4/32", }) assert c.network.name == "test_hub" assert c.network.cidr == IPv4Network("1.2.3.4/32") assert c.network.kiwi_dict == kiwi_dict def test_invalid_dict(self): with pytest.raises(ValidationError) as exc_info: KiwiConfig(network={"name": "test_hub"}) assert len(exc_info.value.errors()) == 1 error = exc_info.value.errors()[0] assert error["msg"] == "field required" assert error["type"] == "value_error.missing" with pytest.raises(ValidationError) as exc_info: KiwiConfig(network={ "name": "test_hub", "cidr": "1.2.3.4/123", }) assert len(exc_info.value.errors()) == 1 error = exc_info.value.errors()[0] assert error["msg"] == "value is not a valid IPv4 network" assert error["type"] == "value_error.ipv4network" def test_invalid(self): with pytest.raises(ValidationError) as exc_info: KiwiConfig(network=True) assert len(exc_info.value.errors()) == 1 error = exc_info.value.errors()[0] assert error["msg"] == "Invalid 'KiwiConfig'.'network' Format: True" assert error["type"] == "value_error.invalidformat"
30.827236
101
0.582647
1,754
15,167
4.935576
0.074686
0.043664
0.049902
0.074853
0.821994
0.772554
0.70313
0.67044
0.648724
0.611875
0
0.016943
0.280082
15,167
491
102
30.89002
0.775895
0.006066
0
0.556787
0
0
0.162729
0.038559
0
0
0
0
0.421053
1
0.099723
false
0.00277
0.019391
0.00277
0.146814
0.00277
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
1
0
0
0
0
0
0
0
0
0
5
cb54dece1075d6c3a73b44e0bce7d595983edc49
870
py
Python
ursina/shaders/__init__.py
DropBear586/ursina
d1ce0d1d4decab07708a401bb2440c3e2df20930
[ "MIT" ]
1
2021-05-26T12:35:35.000Z
2021-05-26T12:35:35.000Z
ursina/shaders/__init__.py
Lewis7Lewis/ursina
38fd34c820dcfe5be7e82db16323631570cdf96a
[ "MIT" ]
null
null
null
ursina/shaders/__init__.py
Lewis7Lewis/ursina
38fd34c820dcfe5be7e82db16323631570cdf96a
[ "MIT" ]
null
null
null
from ursina.shaders.unlit_shader import unlit_shader from ursina.shaders.lit_with_shadows_shader import lit_with_shadows_shader from ursina.shaders.normals_shader import normals_shader from ursina.shaders.basic_lighting_shader import basic_lighting_shader from ursina.shaders.triplanar_shader import triplanar_shader from ursina.shaders.matcap_shader import matcap_shader from ursina.shaders.colored_lights_shader import colored_lights_shader # post processing effects from ursina.shaders.screenspace_shaders.camera_vertical_blur import camera_vertical_blur_shader from ursina.shaders.screenspace_shaders.camera_contrast import camera_contrast_shader from ursina.shaders.screenspace_shaders.camera_grayscale import camera_grayscale_shader from ursina.shaders.screenspace_shaders.fxaa import fxaa_shader from ursina.shaders.screenspace_shaders.ssao import ssao_shader
51.176471
95
0.902299
120
870
6.208333
0.225
0.161074
0.273826
0.308725
0.291275
0.291275
0.126175
0
0
0
0
0
0.063218
870
16
96
54.375
0.91411
0.026437
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
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
1
0
0
5
cbe63023ef847da380dfff93fe0ea53bb59faa7b
1,968
py
Python
Python Interactive Window/mtcars.py
zooba/PyDataExample
9087d6f26a007e8fe45ce5b9f26433f6fcd1b442
[ "MIT" ]
null
null
null
Python Interactive Window/mtcars.py
zooba/PyDataExample
9087d6f26a007e8fe45ce5b9f26433f6fcd1b442
[ "MIT" ]
null
null
null
Python Interactive Window/mtcars.py
zooba/PyDataExample
9087d6f26a007e8fe45ce5b9f26433f6fcd1b442
[ "MIT" ]
null
null
null
# Loads the 'mtcars' dataset into a pandas DataFrame # # This is the same dataset as appears in R. def _mtcars(): _csv = ''',mpg,cyl,disp,hp,drat,wt,qsec,vs,am,gear,carb Mazda RX4,21,6,160,110,3.9,2.62,16.46,0,1,4,4 Mazda RX4 Wag,21,6,160,110,3.9,2.875,17.02,0,1,4,4 Datsun 710,22.8,4,108,93,3.85,2.32,18.61,1,1,4,1 Hornet 4 Drive,21.4,6,258,110,3.08,3.215,19.44,1,0,3,1 Hornet Sportabout,18.7,8,360,175,3.15,3.44,17.02,0,0,3,2 Valiant,18.1,6,225,105,2.76,3.46,20.22,1,0,3,1 Duster 360,14.3,8,360,245,3.21,3.57,15.84,0,0,3,4 Merc 240D,24.4,4,146.7,62,3.69,3.19,20,1,0,4,2 Merc 230,22.8,4,140.8,95,3.92,3.15,22.9,1,0,4,2 Merc 280,19.2,6,167.6,123,3.92,3.44,18.3,1,0,4,4 Merc 280C,17.8,6,167.6,123,3.92,3.44,18.9,1,0,4,4 Merc 450SE,16.4,8,275.8,180,3.07,4.07,17.4,0,0,3,3 Merc 450SL,17.3,8,275.8,180,3.07,3.73,17.6,0,0,3,3 Merc 450SLC,15.2,8,275.8,180,3.07,3.78,18,0,0,3,3 Cadillac Fleetwood,10.4,8,472,205,2.93,5.25,17.98,0,0,3,4 Lincoln Continental,10.4,8,460,215,3,5.424,17.82,0,0,3,4 Chrysler Imperial,14.7,8,440,230,3.23,5.345,17.42,0,0,3,4 Fiat 128,32.4,4,78.7,66,4.08,2.2,19.47,1,1,4,1 Honda Civic,30.4,4,75.7,52,4.93,1.615,18.52,1,1,4,2 Toyota Corolla,33.9,4,71.1,65,4.22,1.835,19.9,1,1,4,1 Toyota Corona,21.5,4,120.1,97,3.7,2.465,20.01,1,0,3,1 Dodge Challenger,15.5,8,318,150,2.76,3.52,16.87,0,0,3,2 AMC Javelin,15.2,8,304,150,3.15,3.435,17.3,0,0,3,2 Camaro Z28,13.3,8,350,245,3.73,3.84,15.41,0,0,3,4 Pontiac Firebird,19.2,8,400,175,3.08,3.845,17.05,0,0,3,2 Fiat X1-9,27.3,4,79,66,4.08,1.935,18.9,1,1,4,1 Porsche 914-2,26,4,120.3,91,4.43,2.14,16.7,0,1,5,2 Lotus Europa,30.4,4,95.1,113,3.77,1.513,16.9,1,1,5,2 Ford Pantera L,15.8,8,351,264,4.22,3.17,14.5,0,1,5,4 Ferrari Dino,19.7,6,145,175,3.62,2.77,15.5,0,1,5,6 Maserati Bora,15,8,301,335,3.54,3.57,14.6,0,1,5,8 Volvo 142E,21.4,4,121,109,4.11,2.78,18.6,1,1,4,2''' from io import StringIO from pandas import read_csv return read_csv(StringIO(_csv), index_col=0) mtcars = _mtcars() del _mtcars
43.733333
59
0.670224
606
1,968
2.163366
0.330033
0.022883
0.02746
0.015256
0.113654
0.069413
0.061022
0.024409
0.024409
0
0
0.431362
0.063516
1,968
44
60
44.727273
0.279978
0.046748
0
0
0
0.846154
0.904915
0.774573
0
0
0
0
0
1
0.025641
false
0
0.051282
0
0.102564
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
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
cbe7dee49e0eefc9a02804a18b06ba122fb10bc6
113
py
Python
python/testData/refactoring/rename/epydocRenameType_after.py
truthiswill/intellij-community
fff88cfb0dc168eea18ecb745d3e5b93f57b0b95
[ "Apache-2.0" ]
2
2019-04-28T07:48:50.000Z
2020-12-11T14:18:08.000Z
python/testData/refactoring/rename/epydocRenameType_after.py
truthiswill/intellij-community
fff88cfb0dc168eea18ecb745d3e5b93f57b0b95
[ "Apache-2.0" ]
173
2018-07-05T13:59:39.000Z
2018-08-09T01:12:03.000Z
python/testData/refactoring/rename/epydocRenameType_after.py
truthiswill/intellij-community
fff88cfb0dc168eea18ecb745d3e5b93f57b0b95
[ "Apache-2.0" ]
2
2020-03-15T08:57:37.000Z
2020-04-07T04:48:14.000Z
class Shazam: pass def foo(p): """ @param p: the magic word @type p: Shazam @return: """
12.555556
28
0.504425
15
113
3.8
0.8
0
0
0
0
0
0
0
0
0
0
0
0.353982
113
9
29
12.555556
0.780822
0.433628
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0.333333
0
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
5
1dcb1d0ca9a3fedfe39e1a7239c50663548c06f8
39
py
Python
test/integration/LambdaDeclare/two parameters return int.py
HighSchoolHacking/GLS-Draft
9e418b6290e7c8e3f2da87668784bdba1cde5a76
[ "MIT" ]
30
2019-10-29T12:47:50.000Z
2022-02-12T06:41:39.000Z
test/integration/LambdaDeclare/two parameters return int.py
HighSchoolHacking/GLS-Draft
9e418b6290e7c8e3f2da87668784bdba1cde5a76
[ "MIT" ]
247
2017-09-21T17:11:18.000Z
2019-10-08T12:59:07.000Z
test/integration/LambdaDeclare/two parameters return int.py
HighSchoolHacking/GLS-Draft
9e418b6290e7c8e3f2da87668784bdba1cde5a76
[ "MIT" ]
17
2017-10-01T16:53:20.000Z
2018-11-28T07:20:35.000Z
# int(abc, int, def, int, abc + def) #
9.75
34
0.538462
7
39
3
0.428571
0.571429
0
0
0
0
0
0
0
0
0
0
0.230769
39
3
35
13
0.7
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0
1
1
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
1
0
0
0
0
0
0
0
0
5
1dcc6f97d6d7a94e3a1694182fa838f60819fe27
22
py
Python
csl_yolo/aug/__init__.py
angusll/kaggle_greatbarrierreef
cf1065833a8009be765f8d5d3f81a0c39485f312
[ "Apache-2.0" ]
63
2021-07-08T10:19:30.000Z
2022-03-20T15:24:36.000Z
csl_yolo/aug/__init__.py
angusll/kaggle_greatbarrierreef
cf1065833a8009be765f8d5d3f81a0c39485f312
[ "Apache-2.0" ]
6
2021-07-17T07:26:05.000Z
2021-11-11T02:26:40.000Z
csl_yolo/aug/__init__.py
angusll/kaggle_greatbarrierreef
cf1065833a8009be765f8d5d3f81a0c39485f312
[ "Apache-2.0" ]
12
2021-07-14T06:25:44.000Z
2022-01-24T01:04:27.000Z
from .augment import *
22
22
0.772727
3
22
5.666667
1
0
0
0
0
0
0
0
0
0
0
0
0.136364
22
1
22
22
0.894737
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
1de09020d3dfe24acad0d484e0ab40b39e0a076e
164
py
Python
app/lib/database/__init__.py
kuco23/PokerThing
a401bb9e59b02e2dd211d1776d68cc3e8966a7ed
[ "MIT" ]
null
null
null
app/lib/database/__init__.py
kuco23/PokerThing
a401bb9e59b02e2dd211d1776d68cc3e8966a7ed
[ "MIT" ]
1
2020-04-17T21:27:12.000Z
2020-04-29T16:14:47.000Z
app/lib/database/__init__.py
kuco23/PokerThing
a401bb9e59b02e2dd211d1776d68cc3e8966a7ed
[ "MIT" ]
null
null
null
from ._enums import ( DbTable, DbPlayerTurn, DbPlayerAction, table_enum ) from ._tables import * from ._browser import DbBrowser from ._game import DbGame
20.5
43
0.756098
19
164
6.263158
0.684211
0
0
0
0
0
0
0
0
0
0
0
0.182927
164
7
44
23.428571
0.88806
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.571429
0
0.571429
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
1deb6099f60b2ef9bf6f804988f25ed87fdbbab3
1,522
py
Python
main.py
SuiMingYang/BilibiliBulletComment
b4270c1bc5b242c6d5c3ddcc17a176f3e976ad35
[ "MIT" ]
2
2020-11-23T13:06:43.000Z
2021-04-15T09:28:13.000Z
main.py
SuiMingYang/BilibiliBulletComment
b4270c1bc5b242c6d5c3ddcc17a176f3e976ad35
[ "MIT" ]
null
null
null
main.py
SuiMingYang/BilibiliBulletComment
b4270c1bc5b242c6d5c3ddcc17a176f3e976ad35
[ "MIT" ]
null
null
null
import schedule import time from up_fan_rank import stat schedule.every().minutes.do(stat,'fans') # 每隔 10 分钟运行一次 job 函数 schedule.every().minutes.do(stat,'playNum') # 每隔 10 分钟运行一次 job 函数 # schedule.every(10).minutes.do(stat,time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time())),'playNum') # 每隔 10 分钟运行一次 job 函数 # # schedule.every().hour.do(job) # 每隔 1 小时运行一次 job 函数 # schedule.every().hour.do(stat,'fans') # 每隔 1 小时运行一次 job 函数 # schedule.every().hour.do(stat,'playNum') # 每隔 1 小时运行一次 job 函数 # schedule.every().day.at("22:30").do(stat,'fans') # 每天在 10:30 时间点运行 job 函数 # schedule.every().day.at("22:30").do(stat,'fans') # 每天在 10:30 时间点运行 job 函数 # schedule.every().day.at("22:30").do(stat,'playNum') # 每天在 10:30 时间点运行 job 函数 # schedule.every().monday.do(job) # 每周一 运行一次 job 函数 # schedule.every().wednesday.at("13:15").do(job) # 每周三 13:15 时间点运行 job 函数 # schedule.every().saturday.at("17:56").do(stat,time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time())),'playNum') # 每周三 13:15 时间点运行 job 函数 # schedule.every().minute.at(":01").do(stat,time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time())),'playNum') # 每分钟的 17 秒时间点运行 job 函数 # schedule.every().minute.at(":30").do(stat,time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time())),'fans') # 每分钟的 17 秒时间点运行 job 函数 while True: schedule.run_pending() # 运行所有可以运行的任务 time.sleep(1)
69.181818
150
0.600526
242
1,522
3.764463
0.223141
0.19978
0.18551
0.256861
0.772777
0.698134
0.654226
0.613611
0.445664
0.445664
0
0.049221
0.19908
1,522
22
151
69.181818
0.698113
0.819974
0
0
0
0
0.044715
0
0
0
0
0
0
1
0
true
0
0.375
0
0.375
0
0
0
0
null
0
1
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
0
1
0
1
0
0
0
0
5
3802988d0ed5ef9386e2cb9f3a3ff8c5ddfed7d1
270
py
Python
docsie_universal_importer/providers/dropbox/serializers.py
Zarif99/test-universal
062972ed64d9f048de702ab1edf4025cffca2abb
[ "BSD-3-Clause" ]
null
null
null
docsie_universal_importer/providers/dropbox/serializers.py
Zarif99/test-universal
062972ed64d9f048de702ab1edf4025cffca2abb
[ "BSD-3-Clause" ]
null
null
null
docsie_universal_importer/providers/dropbox/serializers.py
Zarif99/test-universal
062972ed64d9f048de702ab1edf4025cffca2abb
[ "BSD-3-Clause" ]
null
null
null
from docsie_universal_importer.providers.base import StorageTreeRequestSerializer, DownloaderRequestSerializer class DropboxStorageTreeRequestSerializer(StorageTreeRequestSerializer): pass class DropboxDownloaderSerializer(DownloaderRequestSerializer): pass
27
110
0.881481
17
270
13.882353
0.764706
0
0
0
0
0
0
0
0
0
0
0
0.085185
270
9
111
30
0.955466
0
0
0.4
0
0
0
0
0
0
0
0
0
1
0
true
0.4
0.2
0
0.6
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
5
38458b0abf2113c1040424845c60ec034d2355bc
80
py
Python
ssseg/modules/models/segmentors/gcnet/__init__.py
zhizhangxian/sssegmentation
90613f6e0abf4cdd729cf382ab2a915e106d8649
[ "MIT" ]
411
2020-10-22T02:24:57.000Z
2022-03-31T11:19:17.000Z
ssseg/modules/models/segmentors/gcnet/__init__.py
zhizhangxian/sssegmentation
90613f6e0abf4cdd729cf382ab2a915e106d8649
[ "MIT" ]
24
2020-12-21T03:53:54.000Z
2022-03-17T06:50:00.000Z
ssseg/modules/models/segmentors/gcnet/__init__.py
zhizhangxian/sssegmentation
90613f6e0abf4cdd729cf382ab2a915e106d8649
[ "MIT" ]
59
2020-12-04T03:40:12.000Z
2022-03-30T09:12:47.000Z
'''initialize''' from .gcnet import GCNet from .contextblock import ContextBlock
26.666667
38
0.8
9
80
7.111111
0.555556
0
0
0
0
0
0
0
0
0
0
0
0.1
80
3
38
26.666667
0.888889
0.125
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
6998b368e4d73d8c4fb7252db78a81f8d1ff7449
69
py
Python
Programmers/src/12917/solution.py
lstar2397/algorithms
686ea882079e26111f86b5bd5a7ab1b14ccf0fa2
[ "MIT" ]
null
null
null
Programmers/src/12917/solution.py
lstar2397/algorithms
686ea882079e26111f86b5bd5a7ab1b14ccf0fa2
[ "MIT" ]
null
null
null
Programmers/src/12917/solution.py
lstar2397/algorithms
686ea882079e26111f86b5bd5a7ab1b14ccf0fa2
[ "MIT" ]
null
null
null
def solution(s): return ''.join(sorted(s, key=ord, reverse=True))
34.5
52
0.666667
11
69
4.181818
0.909091
0
0
0
0
0
0
0
0
0
0
0
0.130435
69
2
52
34.5
0.766667
0
0
0
0
0
0
0
0
0
0
0
0
1
0.5
false
0
0
0.5
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
699ce53f297d6aad75367145769f1d0948eb2228
2,035
py
Python
testing/transformer.py
Sean-Mabli/aiinpy
827e4f85861436c0332046fa8aa84e24153513d6
[ "MIT" ]
2
2021-04-19T21:49:34.000Z
2021-05-17T21:03:08.000Z
testing/transformer.py
Sean-Mabli/aiinpy
827e4f85861436c0332046fa8aa84e24153513d6
[ "MIT" ]
null
null
null
testing/transformer.py
Sean-Mabli/aiinpy
827e4f85861436c0332046fa8aa84e24153513d6
[ "MIT" ]
null
null
null
import testsrc as ai import numpy as np def basicselfattention(input): weights = np.dot(input, input.T) weights = ai.stablesoftmax().forward(weights) out = weights @ input return out def singleheadselfattention(input): inToKey = ai.nn(inshape=input.shape, outshape=input.shape, activation=ai.identity, learningrate=0) inToQuery = ai.nn(inshape=input.shape, outshape=input.shape, activation=ai.identity, learningrate=0) inToValue = ai.nn(inshape=input.shape, outshape=input.shape, activation=ai.identity, learningrate=0) Key = inToKey.forward(input) Query = inToQuery.forward(input) Value = inToValue.forward(input) out = np.dot(Query, Key.T) # MatMul out = out / input.shape[1] ** 0.5 # Scale out[np.triu_indices(out.shape[0], 1)] = float('-inf') # Mask (opt.) out = ai.stablesoftmax().forward(out) # SoftMax out = out @ Value # MatMul return out def multiheadselfattention(input, NumOfHeads): inToKey = ai.nn(inshape=input.shape, outshape=(input.shape[0], input.shape[1] * NumOfHeads), activation=ai.identity, learningrate=0) inToQuery = ai.nn(inshape=input.shape, outshape=(input.shape[0], input.shape[1] * NumOfHeads), activation=ai.identity, learningrate=0) inToValue = ai.nn(inshape=input.shape, outshape=(input.shape[0], input.shape[1] * NumOfHeads), activation=ai.identity, learningrate=0) KeyQueryValueToout = ai.nn(inshape=(input.shape[0], input.shape[1] * NumOfHeads), outshape=input.shape, activation=ai.identity, learningrate=0) Key = inToKey.forward(input) Query = inToQuery.forward(input) Value = inToValue.forward(input) out = np.dot(Query, Key.T) # MatMul out = out / input.shape[1] ** 0.5 # Scale out[np.triu_indices(out.shape[0], 1)] = float('-inf') # Mask (opt.) out = ai.stablesoftmax().forward(out) # SoftMax out = out @ Value # MatMul out = KeyQueryValueToout.forward(out) return out input = np.array([[1, 0, 0], [0, 0, 1]]) print(basicselfattention(input)) print(singleheadselfattention(input)) print(multiheadselfattention(input, 8))
38.396226
145
0.718919
277
2,035
5.274368
0.173285
0.136893
0.052704
0.07666
0.732375
0.724846
0.724846
0.702943
0.702943
0.693361
0
0.018079
0.130221
2,035
53
146
38.396226
0.807345
0.038821
0
0.487179
0
0
0.004111
0
0
0
0
0
0
1
0.076923
false
0
0.051282
0
0.205128
0.076923
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
69b01552210c9fba20823352bf99feeb3d1bad7c
414
py
Python
tsheets/models/current_totals.py
eturpin/api_python
fac15d06ef2510972ed3c812bb16a675d4e30e3c
[ "MIT" ]
6
2018-12-16T19:53:57.000Z
2020-11-22T12:36:57.000Z
tsheets/models/current_totals.py
eturpin/api_python
fac15d06ef2510972ed3c812bb16a675d4e30e3c
[ "MIT" ]
6
2019-02-01T13:51:59.000Z
2020-11-23T22:42:57.000Z
tsheets/models/current_totals.py
eturpin/api_python
fac15d06ef2510972ed3c812bb16a675d4e30e3c
[ "MIT" ]
8
2018-12-16T19:53:48.000Z
2021-11-24T17:08:04.000Z
from tsheets.model import Model from datetime import date, datetime class CurrentTotals(Model): pass CurrentTotals.add_field("user_id", int) CurrentTotals.add_field("on_the_clock", bool) CurrentTotals.add_field("timesheet_id", int) CurrentTotals.add_field("jobcode_id", int) CurrentTotals.add_field("group_id", int) CurrentTotals.add_field("shift_seconds", int) CurrentTotals.add_field("day_seconds", int)
25.875
45
0.804348
57
414
5.578947
0.421053
0.352201
0.462264
0.377358
0.327044
0
0
0
0
0
0
0
0.082126
414
15
46
27.6
0.836842
0
0
0
0
0
0.176329
0
0
0
0
0
0
1
0
true
0.090909
0.181818
0
0.272727
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
1
0
0
0
0
0
5
69c1e3d3711395361aec1de75273de0587121b90
20,232
py
Python
planner/tests/test_backend.py
tboonma/thairepose
89aff7836a29bfee58a633db10c19d5e1ce4475f
[ "MIT" ]
4
2021-11-07T05:50:41.000Z
2021-12-01T08:57:12.000Z
planner/tests/test_backend.py
tboonma/thairepose
89aff7836a29bfee58a633db10c19d5e1ce4475f
[ "MIT" ]
111
2021-10-19T09:24:14.000Z
2021-11-28T18:02:21.000Z
planner/tests/test_backend.py
tboonma/thairepose
89aff7836a29bfee58a633db10c19d5e1ce4475f
[ "MIT" ]
2
2021-11-28T06:37:03.000Z
2022-01-16T18:17:02.000Z
import datetime import json from django.core.exceptions import ObjectDoesNotExist from django.urls import reverse from planner.tests import test_index from ..models import Plan, Place, MAX_DAYS_PER_PLAN, MAX_PLACES_PER_DAY from ..views import MAX_PLACE_PER_REQUEST class BackendPostMethodTest(test_index.ViewTest): """Tests for ajax calling POST method to server.""" def setUp(self): """Initialize planner, user and places in a plan.""" super().setUp() self.place_details1 = { 'day': 1, 'sequence': 1, 'place_id': "5678", 'place_name': "Kasetsart", 'place_vicinity': "Bangkok" } self.place1 = Place.objects.create(day=self.place_details1['day'], sequence=self.place_details1['sequence'], place_id=self.place_details1['place_id'], place_name=self.place_details1['place_name'], place_vicinity=self.place_details1['place_vicinity'], departure_time=datetime.time(0, 0), plan=self.plan) self.place_details2 = { 'day': 1, 'sequence': 2, 'place_id': "9012", 'place_name': "Central Ladprao", 'place_vicinity': "Bangkok" } self.place2 = Place.objects.create(day=self.place_details2['day'], sequence=self.place_details2['sequence'], place_id=self.place_details2['place_id'], place_name=self.place_details2['place_name'], place_vicinity=self.place_details2['place_vicinity'], departure_time=datetime.time(0, 0), plan=self.plan) self.place1.save() self.place2.save() def test_change_name(self): """Test changing planner name.""" new_name = "NewPlan" response = self.client.post(reverse("planner:post_edit"), {'planner_id': self.plan.id, 'name': new_name}) self.assertEqual(json.loads(response.content)['status'], "OK") new_plan_status = Plan.objects.get(pk=self.plan.id) # get current plan with new information self.assertEqual(new_plan_status.name, new_name) def test_change_days(self): """Test changing planner days.""" new_days = MAX_DAYS_PER_PLAN response = self.client.post(reverse("planner:post_edit"), {'planner_id': self.plan.id, 'days': new_days}) self.assertEqual(json.loads(response.content)['status'], "OK") new_plan_status = Plan.objects.get(pk=self.plan.id) # get current plan with new information self.assertEqual(new_plan_status.days, new_days) def test_change_invalid_days(self): """Test changing planner days to invalid amount that can be in situation that over the limit od days or be negative.""" # Test changing over limit. new_days = MAX_DAYS_PER_PLAN + 10 response = self.client.post(reverse("planner:post_edit"), {'planner_id': self.plan.id, 'days': new_days}) self.assertEqual(json.loads(response.content)['status'], "OK") new_plan_status = Plan.objects.get(pk=self.plan.id) # get current plan with new information self.assertEqual(new_plan_status.days, MAX_DAYS_PER_PLAN) # should be changed to MAX_DAYS_PER_PLAN # Test changing to negative value. new_days = -4 response = self.client.post(reverse("planner:post_edit"), {'planner_id': self.plan.id, 'days': new_days}) self.assertEqual(json.loads(response.content)['status'], "OK") new_plan_status = Plan.objects.get(pk=self.plan.id) # get current plan with new information self.assertEqual(new_plan_status.days, 1) # should be changed to 1 def test_change_publish(self): """Test changing publish status.""" if self.plan.status == 0: new_status = 1 else: new_status = 0 response = self.client.post(reverse("planner:post_edit"), {'planner_id': self.plan.id, 'publish': new_status}) self.assertEqual(json.loads(response.content)['status'], "OK") new_plan_status = Plan.objects.get(pk=self.plan.id) # get current plan with new information self.assertEqual(new_plan_status.status, new_status) def test_add_place_to_the_plan(self): """Test adding a place to the current plan.""" new_place_day = 1 new_place_sequence = self.plan.place_set.all().count() + 1 new_place = {"day": new_place_day, "sequence": new_place_sequence, "place_id": "5678", "place_name": "Central Ladprao", "place_vicinity": "Bangkok", "arrival_time": "", "departure_time": "00:00"} response = self.client.post(reverse("planner:post_edit"), {'planner_id': self.plan.id, 'addPlace': json.dumps(new_place)}) self.assertEqual(json.loads(response.content)['status'], "OK") # get new place with new information new_place_status = Place.objects.get(plan=self.plan.id, day=new_place_day, sequence=new_place_sequence) self.assertEqual(new_place_status.place_id, new_place['place_id']) self.assertEqual(new_place_status.place_name, new_place['place_name']) def test_add_invalid_place_argument(self): """Test add place to the database without specify day.""" new_place_sequence = 10 new_place = {"sequence": new_place_sequence, "place_id": "5678", "place_name": "Central Ladprao", "place_vicinity": "Bangkok", "arrival_time": "", "departure_time": "00:00"} response = self.client.post(reverse("planner:post_edit"), {'planner_id': self.plan.id, 'addPlace': json.dumps(new_place)}) self.assertEqual(json.loads(response.content)['status'], "Day not provided.") def test_add_place_with_missing_info(self): """Test adding place into a plan with missing some not important data.""" new_place_day = 1 new_place_sequence = self.plan.place_set.all().count() + 1 new_place = {"day": new_place_day, "sequence": new_place_sequence, "place_id": "5678"} response = self.client.post(reverse("planner:post_edit"), {'planner_id': self.plan.id, 'addPlace': json.dumps(new_place)}) self.assertEqual(json.loads(response.content)['status'], "OK") def test_add_place_with_arrival(self): """Test adding a place to the plan with specified arrival time.""" new_place_day = 1 new_place_sequence = self.plan.place_set.all().count() + 1 new_place_hour = 9 new_place_minute = 11 new_place = {"day": new_place_day, "sequence": new_place_sequence, "place_id": "5678", "place_name": "Central Ladprao", "place_vicinity": "Bangkok", "arrival_time": f"{str(new_place_hour).zfill(2)}:{str(new_place_minute).zfill(2)}", "departure_time": "10:12"} response = self.client.post(reverse("planner:post_edit"), {'planner_id': self.plan.id, 'addPlace': json.dumps(new_place)}) self.assertEqual(json.loads(response.content)['status'], "OK") # get new place with new information new_place_status = Place.objects.get(plan=self.plan.id, day=new_place_day, sequence=new_place_sequence) self.assertEqual(new_place_status.arrival_time, datetime.time(new_place_hour, new_place_minute)) self.assertEqual(new_place_status.place_id, new_place['place_id']) self.assertEqual(new_place_status.place_name, new_place['place_name']) def test_delete_place_from_plan(self): """Test deleting a place from the plan.""" response = self.client.post(reverse("planner:post_edit"), {'planner_id': self.plan.id, 'delPlace': json.dumps(self.place_details1)}) self.assertEqual(json.loads(response.content)['status'], "OK") # get new status of planner, shouldn't be any place in the plan. new_plan_status = Plan.objects.get(pk=self.plan.id) with self.assertRaises(ObjectDoesNotExist): new_plan_status.place_set.get(pk=self.place1.id) def test_delete_place_not_exist_from_plan(self): """Test deleting a place from the plan which place order is incorrect.""" self.place_details1['sequence'] = 2 response = self.client.post(reverse("planner:post_edit"), {'planner_id': self.plan.id, 'delPlace': json.dumps(self.place_details1)}) self.assertEqual(json.loads(response.content)['status'], "Place not found.") def test_move_place_up(self): """Test moving place up to previous sequence.""" self.place_details2['day_moved'] = False response = self.client.post(reverse("planner:post_edit"), {'planner_id': self.plan.id, 'moveUp': json.dumps(self.place_details2)}) self.assertEqual(json.loads(response.content)['status'], "OK") # get new status of planner, only sequence should change. new_plan_status = Plan.objects.get(pk=self.plan.id) new_plan_status.place_set.get(place_name=self.place_details2['place_name'], day=self.place_details2['day'], sequence=self.place_details2['sequence'] - 1) def test_move_place_down(self): """Test moving place down to next sequence.""" self.place_details1['day_moved'] = False response = self.client.post(reverse("planner:post_edit"), {'planner_id': self.plan.id, 'moveDown': json.dumps(self.place_details1)}) self.assertEqual(json.loads(response.content)['status'], "OK") # get new status of planner, only sequence should change. new_plan_status = Plan.objects.get(pk=self.plan.id) new_plan_status.place_set.get(place_name=self.place_details1['place_name'], day=self.place_details1['day'], sequence=self.place_details1['sequence'] + 1) def test_move_place_up_and_change_day(self): """Test moving place up to previous day.""" new_place_details = { 'day': 2, 'sequence': 1, 'place_id': "9012", 'place_name': "Central World", 'place_vicinity': "Bangkok", 'day_moved': True, 'day_destination': 1 } new_place = Place.objects.create(day=new_place_details['day'], sequence=new_place_details['sequence'], place_id=new_place_details['place_id'], place_name=new_place_details['place_name'], place_vicinity=new_place_details['place_vicinity'], departure_time=datetime.time(0, 0), plan=self.plan) new_place.save() response = self.client.post(reverse("planner:post_edit"), {'planner_id': self.plan.id, 'moveUp': json.dumps(new_place_details)}) self.assertEqual(json.loads(response.content)['status'], "OK") # get new status of planner, sequence and day should change. new_plan_status = Plan.objects.get(pk=self.plan.id) new_plan_status.place_set.get(place_name=new_place_details['place_name'], day=new_place_details['day_destination']) def test_move_place_down_to_next_day(self): """Test moving place down to next day.""" self.place_details2['day_destination'] = 2 self.place_details2['day_moved'] = True response = self.client.post(reverse("planner:post_edit"), {'planner_id': self.plan.id, 'moveDown': json.dumps(self.place_details2)}) self.assertEqual(json.loads(response.content)['status'], "OK") # get new status of planner, sequence and day should change. new_plan_status = Plan.objects.get(pk=self.plan.id) new_plan_status.place_set.get(place_name=self.place_details2['place_name'], day=self.place_details2['day_destination']) def test_invalid_place_move_up(self): """Test move up invalid place. Should do nothing and return Place not found.""" self.place_details2['day_moved'] = False self.place_details2['sequence'] = 3 response = self.client.post(reverse("planner:post_edit"), {'planner_id': self.plan.id, 'moveUp': json.dumps(self.place_details2)}) self.assertEqual(json.loads(response.content)['status'], "Place not found.") def test_invalid_place_move_down(self): """Test move down invalid place. Should do nothing and return Place not found.""" self.place_details2['day_moved'] = False self.place_details2['sequence'] = 3 response = self.client.post(reverse("planner:post_edit"), {'planner_id': self.plan.id, 'moveDown': json.dumps(self.place_details2)}) self.assertEqual(json.loads(response.content)['status'], "Place not found.") def test_change_time(self): """Test changing arrival and departure time for each place.""" self.place_details1['arrival'] = "10:00" self.place_details1['departure'] = "10:30" self.place_details2['arrival'] = "11:00" self.place_details2['departure'] = "11:30" response = self.client.post(reverse("planner:post_edit"), {'planner_id': self.plan.id, 'changeTime': json.dumps([self.place_details1, self.place_details2])}) self.assertEqual(json.loads(response.content)['status'], "OK") # get new status of planner, only time should change. new_plan_status = Plan.objects.get(pk=self.plan.id) new_place_details1 = new_plan_status.place_set.get(place_name=self.place_details1['place_name'], day=self.place_details1['day'], sequence=self.place_details1['sequence']) new_place_details2 = new_plan_status.place_set.get(place_name=self.place_details2['place_name'], day=self.place_details2['day'], sequence=self.place_details2['sequence']) self.assertEqual(new_place_details1.arrival_time, datetime.time(10, 0)) self.assertEqual(new_place_details1.departure_time, datetime.time(10, 30)) self.assertEqual(new_place_details2.arrival_time, datetime.time(11, 0)) self.assertEqual(new_place_details2.departure_time, datetime.time(11, 30)) def test_change_time_without_detail(self): """Test changing arrival and departure time for each place without specify arrival time.""" self.place_details1['arrival'] = "" self.place_details1['departure'] = "10:30" self.place_details2['arrival'] = "" self.place_details2['departure'] = "11:30" response = self.client.post(reverse("planner:post_edit"), {'planner_id': self.plan.id, 'changeTime': json.dumps([self.place_details1, self.place_details2])}) self.assertEqual(json.loads(response.content)['status'], "OK") # get new status of planner, only time should change. new_plan_status = Plan.objects.get(pk=self.plan.id) new_place_details1 = new_plan_status.place_set.get(place_name=self.place_details1['place_name'], day=self.place_details1['day'], sequence=self.place_details1['sequence']) new_place_details2 = new_plan_status.place_set.get(place_name=self.place_details2['place_name'], day=self.place_details2['day'], sequence=self.place_details2['sequence']) self.assertEqual(new_place_details1.arrival_time, None) self.assertEqual(new_place_details1.departure_time, datetime.time(10, 30)) self.assertEqual(new_place_details2.arrival_time, None) self.assertEqual(new_place_details2.departure_time, datetime.time(11, 30)) def test_change_time_contains_invalid_place(self): """Test change time with incorrect position in database.""" place_details1_backup = self.place_details1.copy() self.place_details1['arrival'] = "10:00" self.place_details1['day'] = 3 self.place_details1['departure'] = "10:30" self.place_details2['arrival'] = "10:45" self.place_details2['departure'] = "11:30" response = self.client.post(reverse("planner:post_edit"), {'planner_id': self.plan.id, 'changeTime': json.dumps([self.place_details1, self.place_details2])}) self.assertEqual(json.loads(response.content)['status'], "OK") # get new status of planner, only second place should change. self.place_details1 = place_details1_backup.copy() new_plan_status = Plan.objects.get(pk=self.plan.id) new_place_details1 = new_plan_status.place_set.get(place_name=self.place_details1['place_name'], day=self.place_details1['day'], sequence=self.place_details1['sequence']) new_place_details2 = new_plan_status.place_set.get(place_name=self.place_details2['place_name'], day=self.place_details2['day'], sequence=self.place_details2['sequence']) # arrival and departure shouldn't change for first place. self.assertEqual(new_place_details1.arrival_time, None) self.assertEqual(new_place_details1.departure_time, datetime.time(0, 0)) self.assertEqual(new_place_details2.arrival_time, datetime.time(10, 45)) self.assertEqual(new_place_details2.departure_time, datetime.time(11, 30)) def test_invalid_get_travel_time(self): """Test invalid context calling function get_travel_time()""" # testing context contains places more than MAX_PLACE_PER_REQUEST context = [{"place_id": "HelloWorld"} for _ in range(MAX_PLACE_PER_REQUEST + 5)] response = self.client.post(reverse("planner:get_travel_time"), {'places': json.dumps(context)}) self.assertEqual(json.loads(response.content)['status'], "TOO MANY PLACES") # testing context contains only 1 place so it cannot get direction. context = [{"place_id": "HelloWorld"}] response = self.client.post(reverse("planner:get_travel_time"), {'places': json.dumps(context)}) self.assertEqual(json.loads(response.content)['status'], "NOT ENOUGH PLACE")
58.643478
111
0.590648
2,330
20,232
4.893562
0.082833
0.0592
0.059639
0.042449
0.795211
0.76776
0.735046
0.704876
0.704876
0.692685
0
0.017862
0.294385
20,232
344
112
58.813953
0.780821
0.108986
0
0.580645
0
0
0.126684
0.006094
0
0
0
0
0.16129
1
0.075269
false
0
0.02509
0
0.103943
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
69e375a6a5385f3d00be05ba26311f69a5720320
56
py
Python
mmorpg/old/Model/Direction/direction.py
InnovAnon-Inc/MAiZE
6b7b266d85f8932557013e3c32bcc728c53f616f
[ "Unlicense" ]
null
null
null
mmorpg/old/Model/Direction/direction.py
InnovAnon-Inc/MAiZE
6b7b266d85f8932557013e3c32bcc728c53f616f
[ "Unlicense" ]
null
null
null
mmorpg/old/Model/Direction/direction.py
InnovAnon-Inc/MAiZE
6b7b266d85f8932557013e3c32bcc728c53f616f
[ "Unlicense" ]
null
null
null
class Direction: def __repr__ (self): return str (self)
28
39
0.75
8
56
4.75
0.875
0
0
0
0
0
0
0
0
0
0
0
0.142857
56
2
39
28
0.791667
0
0
0
0
0
0
0
0
0
0
0
0
1
0.5
false
0
0
0.5
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
69e9a762c83d0f1240d06887804fece40f3bdbf2
66
py
Python
plugins/content/__init__.py
KVSword/mankabot
fc7e379db96f327eb5df8d730ba05e440460531b
[ "MIT" ]
null
null
null
plugins/content/__init__.py
KVSword/mankabot
fc7e379db96f327eb5df8d730ba05e440460531b
[ "MIT" ]
null
null
null
plugins/content/__init__.py
KVSword/mankabot
fc7e379db96f327eb5df8d730ba05e440460531b
[ "MIT" ]
null
null
null
"""Pack with plugins that can generate content or information."""
33
65
0.757576
9
66
5.555556
1
0
0
0
0
0
0
0
0
0
0
0
0.136364
66
1
66
66
0.877193
0.893939
0
null
1
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
1
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
69ffed6cb34d7a54654a3faf6a405da2e4eb8f2f
3,831
py
Python
venv/lib/python3.6/site-packages/tensorflow/_api/v1/ragged/__init__.py
yuxuan1995liu/darkflowyolo_detection
a7807e9b85833e3f877d46bb60e8fa7d0596a10b
[ "MIT" ]
1
2019-04-11T13:23:09.000Z
2019-04-11T13:23:09.000Z
Lib/site-packages/tensorflow/_api/v1/ragged/__init__.py
caiyongji/Anaconda-py36.5-tensorflow-built-env
f4eb40b5ca3f49dfc929ff3ad2b4bb877e9663e2
[ "PSF-2.0" ]
null
null
null
Lib/site-packages/tensorflow/_api/v1/ragged/__init__.py
caiyongji/Anaconda-py36.5-tensorflow-built-env
f4eb40b5ca3f49dfc929ff3ad2b4bb877e9663e2
[ "PSF-2.0" ]
null
null
null
# This file is MACHINE GENERATED! Do not edit. # Generated by: tensorflow/python/tools/api/generator/create_python_api.py script. """Ragged Tensors. This package defines ops for manipulating ragged tensors (`tf.RaggedTensor`), which are tensors with non-uniform shapes. In particular, each `RaggedTensor` has one or more *ragged dimensions*, which are dimensions whose slices may have different lengths. For example, the inner (column) dimension of `rt=[[3, 1, 4, 1], [], [5, 9, 2], [6], []]` is ragged, since the column slices (`rt[0, :]`, ..., `rt[4, :]`) have different lengths. For a more detailed description of ragged tensors, see the `tf.RaggedTensor` class documentation and the [Ragged Tensor Guide](/guides/ragged_tensor). ### Additional ops that support `RaggedTensor` * `tf.debugging.check_numerics` * `tf.identity` * `tf.ones_like` * `tf.ones_like` * `tf.zeros_like` * `tf.zeros_like` * `tf.clip_by_value` * `tf.math.abs` * `tf.math.acos` * `tf.math.acosh` * `tf.math.angle` * `tf.math.asin` * `tf.math.asinh` * `tf.math.atan` * `tf.math.atanh` * `tf.dtypes.cast` * `tf.math.ceil` * `tf.math.conj` * `tf.math.cos` * `tf.math.cosh` * `tf.math.digamma` * `tf.math.erf` * `tf.math.erfc` * `tf.math.exp` * `tf.math.expm1` * `tf.math.floor` * `tf.math.imag` * `tf.math.is_finite` * `tf.math.is_inf` * `tf.math.is_nan` * `tf.math.lgamma` * `tf.math.log` * `tf.math.log1p` * `tf.math.log_sigmoid` * `tf.math.logical_not` * `tf.math.negative` * `tf.math.real` * `tf.math.reciprocal` * `tf.math.rint` * `tf.math.round` * `tf.math.rsqrt` * `tf.dtypes.saturate_cast` * `tf.math.sign` * `tf.math.sin` * `tf.math.sinh` * `tf.math.sqrt` * `tf.math.square` * `tf.math.tan` * `tf.io.decode_compressed` * `tf.strings.to_number` * `tf.strings.to_hash_bucket` * `tf.dtypes.as_string` * `tf.io.decode_base64` * `tf.io.encode_base64` * `tf.strings.regex_full_match` * `tf.strings.regex_replace` * `tf.strings.strip` * `tf.strings.to_hash_bucket` * `tf.strings.to_hash_bucket_fast` * `tf.strings.to_hash_bucket_strong` * `tf.strings.substr` * `tf.strings.substr` * `tf.strings.length` * `tf.strings.length` * `tf.strings.unicode_script` * `tf.math.add_n` * `tf.strings.join` * `tf.math.add` * `tf.math.atan2` * `tf.dtypes.complex` * `tf.div_no_nan` * `tf.math.divide` * `tf.math.equal` * `tf.math.floordiv` * `tf.floormod` * `tf.math.greater` * `tf.math.greater_equal` * `tf.math.less` * `tf.math.less_equal` * `tf.math.logical_and` * `tf.math.logical_or` * `tf.math.logical_xor` * `tf.math.maximum` * `tf.math.minimum` * `tf.math.multiply` * `tf.math.not_equal` * `tf.math.pow` * `tf.realdiv` * `tf.math.squared_difference` * `tf.math.subtract` * `tf.math.truediv` * `tf.truncatediv` * `tf.truncatemod` * `tf.batch_gather` * `tf.concat` * `tf.expand_dims` * `tf.expand_dims` * `tf.gather` * `tf.gather` * `tf.gather_nd` * `tf.stack` * `tf.tile` * `tf.where` * `tf.math.unsorted_segment_sum` * `tf.math.unsorted_segment_prod` * `tf.math.unsorted_segment_min` * `tf.math.unsorted_segment_max` * `tf.math.unsorted_segment_mean` * `tf.math.unsorted_segment_sqrt_n` * `tf.math.reduce_sum` * `tf.math.reduce_prod` * `tf.math.reduce_min` * `tf.math.reduce_max` * `tf.math.reduce_mean` * `tf.math.reduce_any` * `tf.reduce_all` """ from __future__ import print_function as _print_function from tensorflow.python.ops.ragged.ragged_factory_ops import constant from tensorflow.python.ops.ragged.ragged_factory_ops import constant_value from tensorflow.python.ops.ragged.ragged_functional_ops import map_flat_values from tensorflow.python.ops.ragged.ragged_math_ops import range from tensorflow.python.ops.ragged.ragged_tensor_value import RaggedTensorValue from tensorflow.python.ops.ragged.segment_id_ops import row_splits_to_segment_ids from tensorflow.python.ops.ragged.segment_id_ops import segment_ids_to_row_splits del _print_function
26.239726
82
0.721222
598
3,831
4.448161
0.352843
0.162406
0.052632
0.060526
0.18797
0.136466
0.079699
0.079699
0.079699
0.044361
0
0.004932
0.100235
3,831
145
83
26.42069
0.766754
0.838162
0
0
1
0
0
0
0
0
0
0
0
1
0
true
0
0.888889
0
0.888889
0.222222
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
0e150447401951c6f3e6e5ba315e047be3c6c014
1,701
py
Python
mars/tensor/expressions/indexing/flatnonzero.py
lmatz/mars
45f9166b54eb91b21e66cef8b590a41aa8ac9569
[ "Apache-2.0" ]
1
2018-12-26T08:37:04.000Z
2018-12-26T08:37:04.000Z
mars/tensor/expressions/indexing/flatnonzero.py
lmatz/mars
45f9166b54eb91b21e66cef8b590a41aa8ac9569
[ "Apache-2.0" ]
null
null
null
mars/tensor/expressions/indexing/flatnonzero.py
lmatz/mars
45f9166b54eb91b21e66cef8b590a41aa8ac9569
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 1999-2018 Alibaba Group Holding Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from .nonzero import nonzero def flatnonzero(a): """ Return indices that are non-zero in the flattened version of a. This is equivalent to a.ravel().nonzero()[0]. Parameters ---------- a : Tensor Input tensor. Returns ------- res : Tensor Output tensor, containing the indices of the elements of `a.ravel()` that are non-zero. See Also -------- nonzero : Return the indices of the non-zero elements of the input tensor. ravel : Return a 1-D tensor containing the elements of the input tensor. Examples -------- >>> import mars.tensor as mt >>> x = mt.arange(-2, 3) >>> x.execute() array([-2, -1, 0, 1, 2]) >>> mt.flatnonzero(x).execute() array([0, 1, 3, 4]) Use the indices of the non-zero elements as an index array to extract these elements: >>> x.ravel()[mt.flatnonzero(x)].execute() # TODO(jisheng): accomplish this after fancy indexing is supported """ from ..base import ravel return nonzero(ravel(a))[0]
28.35
114
0.653733
246
1,701
4.520325
0.479675
0.053957
0.032374
0.040468
0.089928
0.053957
0.053957
0
0
0
0
0.020626
0.230453
1,701
59
115
28.830508
0.828877
0.844797
0
0
0
0
0
0
0
0
0
0.016949
0
1
0.25
false
0
0.5
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
1
0
0
1
0
0
1
0
1
0
0
5
386a127f029c13feb21d36c0ed324892b19adfe3
5,746
py
Python
indra/tests/test_belief_engine.py
jmuhlich/indra
feab2c08541ea73f328579faa6a21b08082cb026
[ "BSD-2-Clause" ]
null
null
null
indra/tests/test_belief_engine.py
jmuhlich/indra
feab2c08541ea73f328579faa6a21b08082cb026
[ "BSD-2-Clause" ]
null
null
null
indra/tests/test_belief_engine.py
jmuhlich/indra
feab2c08541ea73f328579faa6a21b08082cb026
[ "BSD-2-Clause" ]
null
null
null
from __future__ import absolute_import, print_function, unicode_literals from builtins import dict, str from indra.statements import * from indra.belief import BeliefEngine from indra.belief import _get_belief_package ev1 = Evidence(source_api='reach') ev2 = Evidence(source_api='trips') ev3 = Evidence(source_api='assertion') def test_prior_prob_one(): be = BeliefEngine() prob = 1 - (be.prior_probs['rand']['reach'] + be.prior_probs['syst']['reach']) st = Phosphorylation(None, Agent('a'), evidence=[ev1]) assert(st.belief == 1) be.set_prior_probs([st]) assert(st.belief == prob) def test_prior_prob_two_same(): be = BeliefEngine() prob = 1 - (be.prior_probs['rand']['reach']**2 + be.prior_probs['syst']['reach']) st = Phosphorylation(None, Agent('a'), evidence=[ev1, ev1]) assert(st.belief == 1) be.set_prior_probs([st]) assert(st.belief == prob) def test_prior_prob_two_different(): be = BeliefEngine() prob = 1 - (be.prior_probs['rand']['reach'] + be.prior_probs['syst']['reach']) * \ (be.prior_probs['rand']['trips'] + be.prior_probs['syst']['trips']) st = Phosphorylation(None, Agent('a'), evidence=[ev1, ev2]) assert(st.belief == 1) be.set_prior_probs([st]) assert(st.belief == prob) def test_prior_prob_one_two(): be = BeliefEngine() prob = 1 - (be.prior_probs['rand']['reach']**2 + be.prior_probs['syst']['reach']) * \ (be.prior_probs['rand']['trips'] + be.prior_probs['syst']['trips']) st = Phosphorylation(None, Agent('a'), evidence=[ev1, ev1, ev2]) assert(st.belief == 1) be.set_prior_probs([st]) assert(st.belief == prob) def test_prior_prob_assertion(): be = BeliefEngine() st = Phosphorylation(None, Agent('a'), evidence=[ev1, ev1, ev2, ev3]) assert(st.belief == 1) be.set_prior_probs([st]) assert(st.belief == 1) def test_hierarchy_probs1(): be = BeliefEngine() st1 = Phosphorylation(None, Agent('a'), evidence=[ev1]) st2 = Phosphorylation(None, Agent('b'), evidence=[ev2]) st2.supports = [st1] st1.supported_by = [st2] st1.belief = 0.5 st2.belief = 0.8 be.set_hierarchy_probs([st1, st2]) assert(st1.belief == 0.5) assert(st2.belief == 0.9) def test_hierarchy_probs2(): be = BeliefEngine() st1 = Phosphorylation(None, Agent('a'), evidence=[ev1]) st2 = Phosphorylation(None, Agent('b'), evidence=[ev2]) st3 = Phosphorylation(None, Agent('c'), evidence=[ev3]) st2.supports = [st1] st3.supports = [st1, st2] st1.supported_by = [st2, st3] st2.supported_by = [st3] st1.belief = 0.5 st2.belief = 0.8 st3.belief = 0.2 be.set_hierarchy_probs([st1, st2, st3]) assert(st1.belief == 0.5) assert(st2.belief == 0.9) assert(st3.belief == 0.92) def test_hierarchy_probs3(): be = BeliefEngine() st1 = Phosphorylation(None, Agent('a'), evidence=[ev1]) st2 = Phosphorylation(None, Agent('b'), evidence=[ev2]) st3 = Phosphorylation(None, Agent('c'), evidence=[ev3]) st3.supports = [st1, st2] st1.supported_by = [st3] st2.supported_by = [st3] st1.belief = 0.5 st2.belief = 0.8 st3.belief = 0.2 be.set_hierarchy_probs([st1, st2, st3]) assert(st1.belief == 0.5) assert(st2.belief == 0.8) assert(st3.belief == 0.92) def test_hierarchy_probs4(): be = BeliefEngine() st1 = Phosphorylation(None, Agent('a'), evidence=[ev1]) st2 = Phosphorylation(None, Agent('b'), evidence=[ev2]) st3 = Phosphorylation(None, Agent('c'), evidence=[ev3]) st4 = Phosphorylation(None, Agent('d'), evidence=[ev1]) st4.supports = [st1, st2, st3] st3.supports = [st1] st2.supports = [st1] st1.supported_by = [st2, st3, st4] st2.supported_by = [st4] st3.supported_by = [st4] st1.belief = 0.5 st2.belief = 0.8 st3.belief = 0.2 st4.belief = 0.6 be.set_hierarchy_probs([st1, st2, st3]) assert(st1.belief == 0.5) assert(st2.belief == 0.9) assert(st3.belief == 0.6) assert(st4.belief == 0.968) def test_get_belief_package1(): st1 = Phosphorylation(None, Agent('a')) st1.belief = 0.53 package = _get_belief_package(st1) assert(len(package) == 1) assert(package[0][0] == 0.53) assert(package[0][1] == st1.matches_key()) def test_get_belief_package2(): st1 = Phosphorylation(None, Agent('A1')) st2 = Phosphorylation(None, Agent('A')) st1.supported_by = [st2] st2.supports = [st1] st1.belief = 0.8 st2.belief = 0.6 package = _get_belief_package(st1) assert(len(package) == 1) assert(package[0][0] == 0.8) assert(package[0][1] == st1.matches_key()) package = _get_belief_package(st2) assert(len(package) == 2) assert(package[0][0] == 0.8) assert(package[0][1] == st1.matches_key()) assert(package[1][0] == 0.6) assert(package[1][1] == st2.matches_key()) def test_get_belief_package3(): st1 = Phosphorylation(Agent('B'), Agent('A1')) st2 = Phosphorylation(None, Agent('A1')) st3 = Phosphorylation(None, Agent('A')) st1.supported_by = [st2, st3] st2.supported_by = [st3] st2.supports = [st1] st3.supports = [st1, st2] st1.belief = 0.8 st2.belief = 0.6 st3.belief = 0.7 package = _get_belief_package(st1) assert(len(package) == 1) assert(set([p[0] for p in package]) == set([0.8])) package = _get_belief_package(st2) assert(len(package) == 2) assert(set([p[0] for p in package]) == set([0.6, 0.8])) package = _get_belief_package(st3) assert(len(package) == 3) assert(set([p[0] for p in package]) == set([0.6, 0.7, 0.8]))
31.228261
73
0.617125
801
5,746
4.28839
0.102372
0.061135
0.153712
0.087336
0.801164
0.784862
0.745269
0.710044
0.638137
0.609607
0
0.061606
0.209015
5,746
183
74
31.398907
0.694169
0
0
0.66242
0
0
0.026806
0
0
0
0
0
0.261147
1
0.076433
false
0
0.031847
0
0.10828
0.006369
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
38847a2339755df17e10a7e333a7d94f04836159
218
py
Python
api/serializers/user_serializers.py
tarikyayla/reddit_dashboard
e5ecf3349a5c9333793c3ae5375bc4a0e501a16c
[ "MIT" ]
null
null
null
api/serializers/user_serializers.py
tarikyayla/reddit_dashboard
e5ecf3349a5c9333793c3ae5375bc4a0e501a16c
[ "MIT" ]
null
null
null
api/serializers/user_serializers.py
tarikyayla/reddit_dashboard
e5ecf3349a5c9333793c3ae5375bc4a0e501a16c
[ "MIT" ]
1
2020-11-27T23:24:09.000Z
2020-11-27T23:24:09.000Z
from rest_framework import serializers from api.exceptions.validation_exception import ValidationException from django.contrib.auth import login, authenticate, checks from reddit_dashboard.models import DashboardUser
36.333333
67
0.880734
26
218
7.269231
0.769231
0
0
0
0
0
0
0
0
0
0
0
0.087156
218
5
68
43.6
0.949749
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
38878e1c50266aabed136ddd7864cbc16c8b70cd
61
py
Python
app/api/resources/Contests.py
Eddyjim/BB-LTI-CoddingContestTool
a9ade64565826f27a3e7f80c0c692895b6b77ce2
[ "MIT" ]
null
null
null
app/api/resources/Contests.py
Eddyjim/BB-LTI-CoddingContestTool
a9ade64565826f27a3e7f80c0c692895b6b77ce2
[ "MIT" ]
null
null
null
app/api/resources/Contests.py
Eddyjim/BB-LTI-CoddingContestTool
a9ade64565826f27a3e7f80c0c692895b6b77ce2
[ "MIT" ]
null
null
null
""" app.api.resources.Contests -------------------------- """
15.25
26
0.377049
4
61
5.75
1
0
0
0
0
0
0
0
0
0
0
0
0.04918
61
4
27
15.25
0.396552
0.868852
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
1
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
389f6bba9ffa80f0cd1ec95450184c93b9e342d1
18,377
py
Python
example/src/order_stub/order_bill_pb2.py
DDS-DS/pytest-grpc
a4df9263324fc584c1b4f4a796a2f8424dd56b2b
[ "MIT" ]
null
null
null
example/src/order_stub/order_bill_pb2.py
DDS-DS/pytest-grpc
a4df9263324fc584c1b4f4a796a2f8424dd56b2b
[ "MIT" ]
null
null
null
example/src/order_stub/order_bill_pb2.py
DDS-DS/pytest-grpc
a4df9263324fc584c1b4f4a796a2f8424dd56b2b
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: order_bill.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() import code_pb2 as code__pb2 DESCRIPTOR = _descriptor.FileDescriptor( name='order_bill.proto', package='order', syntax='proto3', serialized_options=b'Z\027app/protocol/grpc/order', create_key=_descriptor._internal_create_key, serialized_pb=b'\n\x10order_bill.proto\x12\x05order\x1a\ncode.proto\"\xc2\x02\n\tOrderBill\x12\n\n\x02id\x18\x01 \x01(\t\x12\x10\n\x08order_id\x18\x02 \x01(\t\x12\x10\n\x08trade_id\x18\x03 \x01(\t\x12\x12\n\npayment_id\x18\x04 \x01(\t\x12\x1a\n\x12platform_method_id\x18\x05 \x01(\t\x12\x15\n\rplatform_name\x18\x06 \x01(\t\x12\x13\n\x0bmethod_name\x18\x07 \x01(\t\x12\x11\n\tbill_type\x18\x08 \x01(\t\x12\x16\n\x0epayment_status\x18\t \x01(\t\x12\x0e\n\x06\x61mount\x18\n \x01(\x03\x12\x10\n\x08\x63urrency\x18\x0b \x01(\t\x12\x0f\n\x07\x63ountry\x18\x0c \x01(\t\x12\x11\n\tcreate_at\x18\r \x01(\x03\x12\x11\n\tupdate_at\x18\x0e \x01(\x03\x12\x15\n\rbusiness_code\x18\x0f \x01(\t\x12\x0e\n\x06pay_at\x18\x10 \x01(\x03\"}\n\x12OrderBillCreateReq\x12\x15\n\rbusiness_code\x18\x01 \x01(\t\x12\x0f\n\x07user_id\x18\x02 \x01(\t\x12\x10\n\x08username\x18\x03 \x01(\t\x12\x1a\n\x12platform_method_id\x18\x04 \x01(\t\x12\x11\n\torder_ids\x18\x05 \x03(\t\"r\n\x15OrderBillCreateResult\x12\x10\n\x08trade_id\x18\x01 \x01(\t\x12\x0e\n\x06\x61mount\x18\x02 \x01(\x03\x12\x10\n\x08\x63urrency\x18\x03 \x01(\t\x12\x18\n\x04\x63ode\x18\x04 \x01(\x0e\x32\n.code.Code\x12\x0b\n\x03msg\x18\x05 \x01(\t\"k\n\x13OrderBillListResult\x12\x1e\n\x04\x64\x61ta\x18\x01 \x03(\x0b\x32\x10.order.OrderBill\x12\r\n\x05total\x18\x02 \x01(\x03\x12\x18\n\x04\x63ode\x18\x03 \x01(\x0e\x32\n.code.Code\x12\x0b\n\x03msg\x18\x04 \x01(\tB\x19Z\x17\x61pp/protocol/grpc/orderb\x06proto3' , dependencies=[code__pb2.DESCRIPTOR,]) _ORDERBILL = _descriptor.Descriptor( name='OrderBill', full_name='order.OrderBill', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='id', full_name='order.OrderBill.id', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='order_id', full_name='order.OrderBill.order_id', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='trade_id', full_name='order.OrderBill.trade_id', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='payment_id', full_name='order.OrderBill.payment_id', index=3, number=4, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='platform_method_id', full_name='order.OrderBill.platform_method_id', index=4, number=5, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='platform_name', full_name='order.OrderBill.platform_name', index=5, number=6, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='method_name', full_name='order.OrderBill.method_name', index=6, number=7, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='bill_type', full_name='order.OrderBill.bill_type', index=7, number=8, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='payment_status', full_name='order.OrderBill.payment_status', index=8, number=9, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='amount', full_name='order.OrderBill.amount', index=9, number=10, type=3, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='currency', full_name='order.OrderBill.currency', index=10, number=11, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='country', full_name='order.OrderBill.country', index=11, number=12, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='create_at', full_name='order.OrderBill.create_at', index=12, number=13, type=3, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='update_at', full_name='order.OrderBill.update_at', index=13, number=14, type=3, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='business_code', full_name='order.OrderBill.business_code', index=14, number=15, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='pay_at', full_name='order.OrderBill.pay_at', index=15, number=16, type=3, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=40, serialized_end=362, ) _ORDERBILLCREATEREQ = _descriptor.Descriptor( name='OrderBillCreateReq', full_name='order.OrderBillCreateReq', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='business_code', full_name='order.OrderBillCreateReq.business_code', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='user_id', full_name='order.OrderBillCreateReq.user_id', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='username', full_name='order.OrderBillCreateReq.username', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='platform_method_id', full_name='order.OrderBillCreateReq.platform_method_id', index=3, number=4, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='order_ids', full_name='order.OrderBillCreateReq.order_ids', index=4, number=5, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=364, serialized_end=489, ) _ORDERBILLCREATERESULT = _descriptor.Descriptor( name='OrderBillCreateResult', full_name='order.OrderBillCreateResult', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='trade_id', full_name='order.OrderBillCreateResult.trade_id', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='amount', full_name='order.OrderBillCreateResult.amount', index=1, number=2, type=3, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='currency', full_name='order.OrderBillCreateResult.currency', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='code', full_name='order.OrderBillCreateResult.code', index=3, number=4, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='msg', full_name='order.OrderBillCreateResult.msg', index=4, number=5, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=491, serialized_end=605, ) _ORDERBILLLISTRESULT = _descriptor.Descriptor( name='OrderBillListResult', full_name='order.OrderBillListResult', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='data', full_name='order.OrderBillListResult.data', index=0, number=1, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='total', full_name='order.OrderBillListResult.total', index=1, number=2, type=3, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='code', full_name='order.OrderBillListResult.code', index=2, number=3, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='msg', full_name='order.OrderBillListResult.msg', index=3, number=4, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=607, serialized_end=714, ) _ORDERBILLCREATERESULT.fields_by_name['code'].enum_type = code__pb2._CODE _ORDERBILLLISTRESULT.fields_by_name['data'].message_type = _ORDERBILL _ORDERBILLLISTRESULT.fields_by_name['code'].enum_type = code__pb2._CODE DESCRIPTOR.message_types_by_name['OrderBill'] = _ORDERBILL DESCRIPTOR.message_types_by_name['OrderBillCreateReq'] = _ORDERBILLCREATEREQ DESCRIPTOR.message_types_by_name['OrderBillCreateResult'] = _ORDERBILLCREATERESULT DESCRIPTOR.message_types_by_name['OrderBillListResult'] = _ORDERBILLLISTRESULT _sym_db.RegisterFileDescriptor(DESCRIPTOR) OrderBill = _reflection.GeneratedProtocolMessageType('OrderBill', (_message.Message,), { 'DESCRIPTOR' : _ORDERBILL, '__module__' : 'order_bill_pb2' # @@protoc_insertion_point(class_scope:order.OrderBill) }) _sym_db.RegisterMessage(OrderBill) OrderBillCreateReq = _reflection.GeneratedProtocolMessageType('OrderBillCreateReq', (_message.Message,), { 'DESCRIPTOR' : _ORDERBILLCREATEREQ, '__module__' : 'order_bill_pb2' # @@protoc_insertion_point(class_scope:order.OrderBillCreateReq) }) _sym_db.RegisterMessage(OrderBillCreateReq) OrderBillCreateResult = _reflection.GeneratedProtocolMessageType('OrderBillCreateResult', (_message.Message,), { 'DESCRIPTOR' : _ORDERBILLCREATERESULT, '__module__' : 'order_bill_pb2' # @@protoc_insertion_point(class_scope:order.OrderBillCreateResult) }) _sym_db.RegisterMessage(OrderBillCreateResult) OrderBillListResult = _reflection.GeneratedProtocolMessageType('OrderBillListResult', (_message.Message,), { 'DESCRIPTOR' : _ORDERBILLLISTRESULT, '__module__' : 'order_bill_pb2' # @@protoc_insertion_point(class_scope:order.OrderBillListResult) }) _sym_db.RegisterMessage(OrderBillListResult) DESCRIPTOR._options = None # @@protoc_insertion_point(module_scope)
48.488127
1,451
0.750014
2,431
18,377
5.3587
0.080214
0.057726
0.088969
0.072542
0.751977
0.706533
0.693406
0.693406
0.67529
0.66485
0
0.038545
0.124721
18,377
378
1,452
48.616402
0.77134
0.024814
0
0.702312
1
0.00289
0.177473
0.135534
0
0
0
0
0
1
0
false
0
0.014451
0
0.014451
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
0
1
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
38a6b5060f6eba6220e2b85c714bfa971ccf7cb2
54
py
Python
pysmine/__init__.py
luisgrases/pysmine
05107edfba4cbd1684e8f97d91ef4fb62b995275
[ "MIT" ]
3
2020-01-16T18:08:36.000Z
2020-01-17T05:20:11.000Z
pysmine/__init__.py
luisgrases/pysmine
05107edfba4cbd1684e8f97d91ef4fb62b995275
[ "MIT" ]
null
null
null
pysmine/__init__.py
luisgrases/pysmine
05107edfba4cbd1684e8f97d91ef4fb62b995275
[ "MIT" ]
null
null
null
from .bdd import with_nested_specs, it, when, describe
54
54
0.814815
9
54
4.666667
1
0
0
0
0
0
0
0
0
0
0
0
0.111111
54
1
54
54
0.875
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
38b87c240ba428f6eef33c85bb6bc413a6258e62
57
py
Python
functions/__init__.py
Shuzhengz/nasa-spaceapps-2020
6d4e5925a66fd4bb557597682df39bb89015927e
[ "MIT" ]
1
2021-11-25T03:16:19.000Z
2021-11-25T03:16:19.000Z
functions/__init__.py
Shuzhengz/nasa-spaceapps-2020
6d4e5925a66fd4bb557597682df39bb89015927e
[ "MIT" ]
6
2021-06-08T22:31:29.000Z
2022-03-12T00:49:16.000Z
functions/__init__.py
Shuzhengz/nasa-spaceapps-2020
6d4e5925a66fd4bb557597682df39bb89015927e
[ "MIT" ]
null
null
null
from .images import Images from .spectral import Spectral
28.5
30
0.842105
8
57
6
0.5
0
0
0
0
0
0
0
0
0
0
0
0.122807
57
2
30
28.5
0.96
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
38bbd195abce5afc7fcfc367d8e4a1dc37651db0
151
py
Python
src/sanakirja/__init__.py
easai/sanakirja
8548e09d0bb9720fb13af02187f286440707db87
[ "MIT" ]
null
null
null
src/sanakirja/__init__.py
easai/sanakirja
8548e09d0bb9720fb13af02187f286440707db87
[ "MIT" ]
null
null
null
src/sanakirja/__init__.py
easai/sanakirja
8548e09d0bb9720fb13af02187f286440707db87
[ "MIT" ]
null
null
null
from .api import Sana as Sana from .api import SanaKirja as SanaKirja from .api import API_URL as API_URL __all__ = ['Sana', 'SanaKirja', 'API_URL']
21.571429
42
0.741722
25
151
4.2
0.32
0.2
0.371429
0
0
0
0
0
0
0
0
0
0.165563
151
6
43
25.166667
0.833333
0
0
0
0
0
0.13245
0
0
0
0
0
0
1
0
false
0
0.75
0
0.75
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
38d1a4c92e49a43e985f9cacd6c9ba1fca4778ff
3,791
py
Python
tests/test_udp_datagram_parsing.py
thecode/aioswitcher
5ac068766bb44b5cc6008425021c91c6ffb858f9
[ "Apache-2.0" ]
11
2020-04-11T22:25:15.000Z
2022-02-20T12:55:49.000Z
tests/test_udp_datagram_parsing.py
thecode/aioswitcher
5ac068766bb44b5cc6008425021c91c6ffb858f9
[ "Apache-2.0" ]
440
2019-04-26T15:41:59.000Z
2022-03-31T05:07:04.000Z
tests/test_udp_datagram_parsing.py
thecode/aioswitcher
5ac068766bb44b5cc6008425021c91c6ffb858f9
[ "Apache-2.0" ]
5
2019-05-24T11:45:22.000Z
2021-05-30T08:25:23.000Z
# Copyright Tomer Figenblat. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Switcher integration broadcast message parsing utility functions test cases.""" from binascii import unhexlify from pathlib import Path from assertpy import assert_that from pytest import mark from aioswitcher.bridge import DatagramParser from aioswitcher.device import DeviceState, DeviceType @mark.parametrize("type_suffix, expected_type", [ ("mini", DeviceType.MINI), ("power_plug", DeviceType.POWER_PLUG), ("touch", DeviceType.TOUCH), ("v2_esp", DeviceType.V2_ESP), ("v2_qca", DeviceType.V2_QCA), ("v4", DeviceType.V4), ]) def test_datagram_state_off(resource_path, type_suffix, expected_type): sut_datagram = Path(f'{resource_path}_{type_suffix}.txt').read_text().replace('\n', '').encode() sut_parser = DatagramParser(unhexlify(sut_datagram)) assert_that(sut_parser.is_switcher_originator()).is_true() assert_that(sut_parser.get_ip()).is_equal_to("192.168.1.33") assert_that(sut_parser.get_mac()).is_equal_to("12:A1:A2:1A:BC:1A") assert_that(sut_parser.get_name()).is_equal_to("My Switcher Boiler") assert_that(sut_parser.get_device_id()).is_equal_to("aaaaaa") assert_that(sut_parser.get_device_state()).is_equal_to(DeviceState.OFF) assert_that(sut_parser.get_device_type()).is_equal_to(expected_type) assert_that(sut_parser.get_power_consumption()).is_equal_to(0) if not expected_type == DeviceType.POWER_PLUG: assert_that(sut_parser.get_remaining()).is_equal_to("00:00:00") assert_that(sut_parser.get_auto_shutdown()).is_equal_to("03:00:00") @mark.parametrize("type_suffix, expected_type", [ ("mini", DeviceType.MINI), ("power_plug", DeviceType.POWER_PLUG), ("touch", DeviceType.TOUCH), ("v2_esp", DeviceType.V2_ESP), ("v2_qca", DeviceType.V2_QCA), ("v4", DeviceType.V4), ]) def test_datagram_state_on(resource_path, type_suffix, expected_type): sut_datagram = Path(f'{resource_path}_{type_suffix}.txt').read_text().replace('\n', '').encode() sut_parser = DatagramParser(unhexlify(sut_datagram)) assert_that(sut_parser.is_switcher_originator()).is_true() assert_that(sut_parser.get_ip()).is_equal_to("192.168.1.33") assert_that(sut_parser.get_mac()).is_equal_to("12:A1:A2:1A:BC:1A") assert_that(sut_parser.get_name()).is_equal_to("My Switcher Boiler") assert_that(sut_parser.get_device_id()).is_equal_to("aaaaaa") assert_that(sut_parser.get_device_state()).is_equal_to(DeviceState.ON) assert_that(sut_parser.get_device_type()).is_equal_to(expected_type) assert_that(sut_parser.get_power_consumption()).is_equal_to(2600) if not expected_type == DeviceType.POWER_PLUG: assert_that(sut_parser.get_remaining()).is_equal_to("01:30:00") assert_that(sut_parser.get_auto_shutdown()).is_equal_to("03:00:00") @mark.parametrize("type_suffix", ["too_short", "wrong_start"]) def test_a_faulty_datagram(resource_path, type_suffix): sut_datagram = Path(f'{resource_path}_{type_suffix}.txt').read_text().replace('\n', '').encode() sut_parser = DatagramParser(unhexlify(sut_datagram)) assert_that(sut_parser.is_switcher_originator()).is_false()
45.130952
101
0.734371
548
3,791
4.75365
0.273723
0.082917
0.104798
0.153167
0.700192
0.700192
0.700192
0.700192
0.700192
0.700192
0
0.022866
0.134793
3,791
83
102
45.674699
0.771341
0.165128
0
0.690909
0
0
0.127937
0.032311
0
0
0
0
0.4
1
0.054545
false
0
0.109091
0
0.163636
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
38dd16a5048d5f0a75a3cc96aafeeaced039cf5b
4,764
py
Python
FAE/DataContainer/DataBalance.py
Eggiverse/FAE
1b953ba6dfcced83e5929eeaa8f525ec4acde5ed
[ "MIT" ]
null
null
null
FAE/DataContainer/DataBalance.py
Eggiverse/FAE
1b953ba6dfcced83e5929eeaa8f525ec4acde5ed
[ "MIT" ]
null
null
null
FAE/DataContainer/DataBalance.py
Eggiverse/FAE
1b953ba6dfcced83e5929eeaa8f525ec4acde5ed
[ "MIT" ]
null
null
null
'''. Jul 03, 2018. Yang SONG, songyangmri@gmail.com ''' import numpy as np from random import shuffle import os import pandas as pd from abc import abstractmethod from imblearn.under_sampling import RandomUnderSampler from imblearn.over_sampling import RandomOverSampler, SMOTE from FAE.DataContainer.DataContainer import DataContainer class DataBalance: ''' To deal with the data imbalance. ''' def __init__(self): pass def Run(self, data_container, store_path=''): if store_path: if os.path.isdir(store_path): data_container.Save(os.path.join(store_path, 'non_balance_features.csv')) else: data_container.Save(store_path) return data_container class DownSampling(DataBalance): def __init__(self): super(DownSampling, self).__init__() def GetCaseNameFromAllCaseNames(self, data_container, one_case_data): one_case_data = np.squeeze(one_case_data) all_case_data = data_container.GetArray() all_case_name = data_container.GetCaseName() if one_case_data.size != all_case_data.shape[1]: print('The number of features should be same in DataBalance!') for case_index in range(len(all_case_name)): if (one_case_data == all_case_data[case_index, :]).all(): return all_case_name[case_index] print('Not Find Case Name') return 'Not Find Case Name' def Run(self, data_container, store_path=''): data, label, feature_name, label_name = data_container.GetData() rus = RandomUnderSampler(random_state=0) data_resampled, label_resampled = rus.fit_sample(data, label) new_case_name = [] for index in range(data_resampled.shape[0]): new_case_name.append(self.GetCaseNameFromAllCaseNames(data_container, data_resampled[index, :])) new_data_container = DataContainer(data_resampled, label_resampled, data_container.GetFeatureName(), new_case_name) if store_path != '': if os.path.isdir(store_path): new_data_container.Save(os.path.join(store_path, 'downsampling_features.csv')) else: new_data_container.Save(store_path) return new_data_container class UpSampling(DataBalance): def __init__(self): super(UpSampling, self).__init__() def GetCaseNameFromAllCaseNames(self, data_container, one_case_data): one_case_data = np.squeeze(one_case_data) all_case_data = data_container.GetArray() all_case_name = data_container.GetCaseName() if one_case_data.size != all_case_data.shape[1]: print('The number of features should be same in DataBalance!') for case_index in range(len(all_case_name)): if (one_case_data == all_case_data[case_index, :]).all(): return all_case_name[case_index] print('Not Find Case Name') return 'Not Find Case Name' def Run(self, data_container, store_path=''): data, label, feature_name, label_name = data_container.GetData() rus = RandomOverSampler(random_state=0) data_resampled, label_resampled = rus.fit_sample(data, label) new_case_name = [] for index in range(data_resampled.shape[0]): new_case_name.append(self.GetCaseNameFromAllCaseNames(data_container, data_resampled[index, :])) new_data_container = DataContainer(data_resampled, label_resampled, data_container.GetFeatureName(), new_case_name) if store_path != '': if os.path.isdir(store_path): new_data_container.Save(os.path.join(store_path, 'upsampling_features.csv')) else: new_data_container.Save(store_path) return new_data_container class SmoteSampling(DataBalance): def __init__(self, **kwargs): super(SmoteSampling, self).__init__() self.__model = SMOTE(**kwargs, random_state=0) def Run(self, data_container, store_path=''): data, label, feature_name, label_name = data_container.GetData() data_resampled, label_resampled = self.__model.fit_sample(data, label) new_case_name = ['Generate' + str(index) for index in range(data_resampled.shape[0])] new_data_container = DataContainer(data_resampled, label_resampled, data_container.GetFeatureName(), new_case_name) if store_path != '': if os.path.isdir(store_path): new_data_container.Save(os.path.join(store_path, 'smote_features.csv')) else: new_data_container.Save(store_path) return new_data_container
37.809524
123
0.666037
580
4,764
5.127586
0.17069
0.14425
0.06456
0.054472
0.786483
0.768325
0.757566
0.737054
0.72495
0.702421
0
0.003876
0.241814
4,764
125
124
38.112
0.819491
0.017003
0
0.67033
0
0
0.05924
0.015454
0
0
0
0
0
1
0.10989
false
0.010989
0.087912
0
0.32967
0.043956
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
2a01a625d180b1a36ed1ba301e7d1e330c9d209d
1,725
py
Python
crypot/RSA/franklin/franklin3.py
sayoojsamuel/crypot
6f72eab486c69fe4a8184693e585d08491c95fb3
[ "MIT" ]
7
2020-09-23T01:56:20.000Z
2022-02-23T01:59:53.000Z
crypot/RSA/franklin/franklin3.py
sayoojsamuel/crypot
6f72eab486c69fe4a8184693e585d08491c95fb3
[ "MIT" ]
null
null
null
crypot/RSA/franklin/franklin3.py
sayoojsamuel/crypot
6f72eab486c69fe4a8184693e585d08491c95fb3
[ "MIT" ]
1
2020-09-30T19:48:10.000Z
2020-09-30T19:48:10.000Z
#https://ctf-wiki.github.io/ctf-wiki/crypto/asymmetric/rsa/rsa_coppersmith_attack/#related-message-attack import binascii def attack(c1, c2, b, e, n): PR.<x>=PolynomialRing(Zmod(n)) g1 = x^e - c1 g2 = (x+b)^e - c2 def gcd(g1, g2): while g2: g1, g2 = g2, g1 % g2 return g1.monic() return -gcd(g1, g2)[0] c1 , = 0x547995f4e2f4c007e6bb2a6913a3d685974a72b05bec02e8c03ba64278c9347d8aaaff672ad8460a8cf5bffa5d787c5bb724d1cee07e221e028d9b8bc24360208840fbdfd4794733adcac45c38ad0225fde19a6a4c38e4207368f5902c871efdf1bdf4760b1a98ec1417893c8fce8389b6434c0fee73b13c284e8c9fb5c77e420a2b5b1a1c10b2a7a3545e95c1d47835c2718 L' , c2 , = 0x547995f4e2f4c007e6bb2a6913a3d685974a72b05bec02e8c03ba64278c9347d8aaaff672ad8460a8cf5bffa5d787c72722fe4fe5a901e2531b3dbcb87e5aa19bbceecbf9f32eacefe81777d9bdca781b1ec8f8b68799b4aa4c6ad120506222c7f0c3e11b37dd0ce08381fabf9c14bc74929bf524645989ae2df77c8608d0512c1cc4150765ab8350843b57a2464f848d8e08 L' N = 25357901189172733149625332391537064578265003249917817682864120663898336510922113258397441378239342349767317285221295832462413300376704507936359046120943334215078540903962128719706077067557948218308700143138420408053500628616299338204718213283481833513373696170774425619886049408103217179262264003765695390547355624867951379789924247597370496546249898924648274419164899831191925127182066301237673243423539604219274397539786859420866329885285232179983055763704201023213087119895321260046617760702320473069743688778438854899409292527695993045482549594428191729963645157765855337481923730481041849389812984896044723939553 e = 3 a = 1 id1 = 1002 id2 = 2614 b = id2 - id1 m1 = attack(c1,c2, b,e,n) print binascii.unhexlify("%x" % int(m1 - id1))
69
622
0.864928
91
1,725
16.373626
0.505495
0.010738
0.013423
0.014765
0.01745
0.01745
0
0
0
0
0
0.642857
0.082899
1,725
24
623
71.875
0.298989
0.05971
0
0
0
0
0.001235
0
0
1
0.364198
0
0
0
null
null
0
0.05
null
null
0.05
0
0
1
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
1
0
0
0
1
0
0
0
0
0
0
0
0
5
2a131f8587061d77cf27f4bc567971c5d629bb32
9,750
py
Python
tests/unit/test_cloud.py
hateno/aws-serverless-python
0f8f8ce2765e5f05346420d1e7173f4ff9d5879c
[ "Apache-2.0" ]
null
null
null
tests/unit/test_cloud.py
hateno/aws-serverless-python
0f8f8ce2765e5f05346420d1e7173f4ff9d5879c
[ "Apache-2.0" ]
null
null
null
tests/unit/test_cloud.py
hateno/aws-serverless-python
0f8f8ce2765e5f05346420d1e7173f4ff9d5879c
[ "Apache-2.0" ]
null
null
null
import datetime import pytest import uuid import troposphere.awslambda import troposphere.iam from dateutil.tz import tzutc from sam.cloud import Cloud @pytest.fixture def cloud(settings, pill): cloud = Cloud(settings, session=pill.session) return cloud def _validate_resources(cloud): ''' helper method to validate cloud template's resources ''' for name, resource in cloud.template.resources.items(): resource.validate() def test_cloud(cloud, settings): assert(cloud is not None) assert(cloud.name == settings['name']) def test_s3_template(cloud): s3name = 'UnitTestS3Bucket' s3description = 'UnitTestS3Bucket Description' cloud.add_s3_bucket(s3name, bucket_description=s3description) assert(s3name in cloud.template.resources) assert(s3name in cloud.template.outputs) assert(cloud.template.outputs[s3name].properties['Description'] == s3description) def test_deploy(cloud, pill): response = {'ResponseMetadata': {'HTTPHeaders': {'content-length': '123', 'content-type': 'text/xml', 'date': 'xyz', 'x-amzn-requestid': 'xyz'}, 'HTTPStatusCode': 200, 'RequestId': 'xyz', 'RetryAttempts': 0}, 'StackSummaries': []} pill.save_response(service='cloudformation', operation='ListStacks', response_data=response, http_response=200) response = { "status_code": 200, "data": { "StackId": "arn:aws:cloudformation:us-east-1:123:stack/TestStackName/xyz", "ResponseMetadata": { "RequestId": "xyz", "HTTPStatusCode": 200, "HTTPHeaders": { "x-amzn-requestid": "xyz", "content-type": "text/xml", "content-length": "123"}, "RetryAttempts": 0 } } } pill.save_response(service='cloudformation', operation='CreateStack', response_data=response, http_response=200) cloud.add_s3_bucket('UnitTestS3Bucket') status = cloud.deploy() assert(status['status_code'] == 200) def test_deploy_dry(cloud, pill): response = {'ResponseMetadata': {'HTTPHeaders': {'content-length': '123', 'content-type': 'text/xml', 'date': 'xyz', 'x-amzn-requestid': 'xyz'}, 'HTTPStatusCode': 200, 'RequestId': 'xyz', 'RetryAttempts': 0}, 'StackSummaries': []} pill.save_response(service='cloudformation', operation='ListStacks', response_data=response, http_response=200) cloud.add_s3_bucket('UnitTestS3Bucket') status = cloud.deploy(dry=True) assert(status is None) def test_deploy_replace(cloud, pill): response = {'ResponseMetadata': {'HTTPHeaders': {'content-length': '123', 'content-type': 'text/xml', 'date': 'xyz', 'x-amzn-requestid': 'xyz'}, 'HTTPStatusCode': 200, 'RequestId': 'xyz', 'RetryAttempts': 0}, 'StackSummaries': [{'CreationTime': datetime.datetime(2018, 1, 1, tzinfo=tzutc()), 'StackId': 'arn:aws:cloudformation:us-east-1:123:stack/TestStackName/xyz', 'StackName': cloud.name, 'StackStatus': 'CREATE_COMPLETE'}]} pill.save_response(service='cloudformation', operation='ListStacks', response_data=response, http_response=200) response = {'ResponseMetadata': {'HTTPStatusCode': 200}} pill.save_response(service='cloudformation', operation='DeleteStack', response_data=response, http_response=200) response = {'ResponseMetadata': {'HTTPHeaders': {'content-length': '123', 'content-type': 'text/xml', 'date': 'xyz', 'x-amzn-requestid': 'xyz'}, 'HTTPStatusCode': 200, 'RequestId': 'xyz', 'RetryAttempts': 0}, 'StackSummaries': []} pill.save_response(service='cloudformation', operation='ListStacks', response_data=response, http_response=200) response = { "status_code": 200, "data": { "StackId": "arn:aws:cloudformation:us-east-1:123:stack/TestStackName/xyz", "ResponseMetadata": { "RequestId": "xyz", "HTTPStatusCode": 200, "HTTPHeaders": { "x-amzn-requestid": "xyz", "content-type": "text/xml", "content-length": "123"}, "RetryAttempts": 0 } } } pill.save_response(service='cloudformation', operation='CreateStack', response_data=response, http_response=200) status = cloud.deploy() assert(status['status_code'] == 200) def test_stack_exists(cloud, pill): response = {'ResponseMetadata': {'HTTPHeaders': {'content-length': '123', 'content-type': 'text/xml', 'date': 'xyz', 'x-amzn-requestid': 'xyz'}, 'HTTPStatusCode': 200, 'RequestId': 'xyz', 'RetryAttempts': 0}, 'StackSummaries': [{'CreationTime': datetime.datetime(2018, 1, 1, tzinfo=tzutc()), 'StackId': 'arn:aws:cloudformation:us-east-1:123:stack/TestStackName/xyz', 'StackName': cloud.name, 'StackStatus': 'CREATE_COMPLETE'}]} pill.save_response(service='cloudformation', operation='ListStacks', response_data=response, http_response=200) status = cloud.stack_exists(cloud.name) assert(status) def test_stack_ready(cloud, pill): response = {'ResponseMetadata': {'HTTPHeaders': {'content-length': '123', 'content-type': 'text/xml', 'date': 'xyz', 'x-amzn-requestid': 'xyz'}, 'HTTPStatusCode': 200, 'RequestId': 'xyz', 'RetryAttempts': 0}, 'StackSummaries': [{'CreationTime': datetime.datetime(2018, 1, 1, tzinfo=tzutc()), 'StackId': 'arn:aws:cloudformation:us-east-1:123:stack/TestStackName/xyz', 'StackName': cloud.name, 'StackStatus': 'CREATE_COMPLETE'}]} pill.save_response(service='cloudformation', operation='ListStacks', response_data=response, http_response=200) status = cloud.stack_ready(cloud.name) assert(status) def test_lambda(cloud): lambda_name = 'UnitTestLambdaFunction' cloud.add_lambda(lambda_name) assert(lambda_name in cloud.template.resources) _validate_resources(cloud) def test_create_lambda_role(cloud): lambda_role_name = 'UnitTestLambdaRole' role = cloud.create_lambda_role(lambda_role_name) assert(role.name == lambda_role_name) _validate_resources(cloud) def create_api_gateway_fails_without_lambda_function(cloud): apigateway_name = 'UnitTestAPIGateway' with pytest.raises(AssertionError): apigateway = cloud.add_api_gateway(apigateway_name) def test_create_lambda_first_before_creating_api_gateway(cloud): lambda_name = 'UnitTestLambdaFunction' cloud.add_lambda(lambda_name) assert(lambda_name in cloud.template.resources) apigateway_name = 'UnitTestAPIGateway' apigateway = cloud.add_api_gateway(apigateway_name) assert(apigateway_name in cloud.template.resources) _validate_resources(cloud) def test_list_stack_resources(cloud, pill): response = { "StackResourceSummaries": [ { "LogicalResourceId": "LambdaExecutionRole", "PhysicalResourceId": cloud.name, "ResourceType": "AWS::IAM::Role", "LastUpdatedTimestamp": { "__class__": "datetime", "year": 2018, "month": 3, "day": 18, "hour": 17, "minute": 24, "second": 33, "microsecond": 565000 }, "ResourceStatus": "CREATE_COMPLETE" } ] } pill.save_response(service='cloudformation', operation='ListStackResources', response_data=response, http_response=200) resources = cloud.list_stack_resources() assert(resources[0]['PhysicalResourceId'] == cloud.name) def test_get_stack_resource_by_type(cloud, pill): response = { "StackResourceSummaries": [ { "LogicalResourceId": "LambdaExecutionRole", "PhysicalResourceId": cloud.name, "ResourceType": troposphere.iam.Role.resource_type, "LastUpdatedTimestamp": { "__class__": "datetime", "year": 2018, "month": 3, "day": 18, "hour": 17, "minute": 24, "second": 33, "microsecond": 565000 }, "ResourceStatus": "CREATE_COMPLETE" } ] } pill.save_response(service='cloudformation', operation='ListStackResources', response_data=response, http_response=200) resource = cloud.get_resource(troposphere.iam.Role.resource_type) assert(resource['PhysicalResourceId'] == cloud.name) def test_get_stack_resource_not_found(cloud, pill): response = { 'StackResourceSummaries': [] } pill.save_response(service='cloudformation', operation='ListStackResources', response_data=response, http_response=200) resource = cloud.get_resource('') assert(resource is None) def test_get_cloud_function_name(cloud, pill): response = {'ResponseMetadata': {'HTTPHeaders': {'content-length': '123', 'content-type': 'text/xml', 'date': 'xyz', 'x-amzn-requestid': 'xyz'}, 'HTTPStatusCode': 200, 'RequestId': 'xyz', 'RetryAttempts': 0}, 'StackSummaries': [{'CreationTime': datetime.datetime(2018, 1, 1, tzinfo=tzutc()), 'StackId': 'arn:aws:cloudformation:us-east-1:123:stack/TestStackName/xyz', 'StackName': cloud.name, 'StackStatus': 'CREATE_COMPLETE'}]} pill.save_response(service='cloudformation', operation='ListStacks', response_data=response, http_response=200) response = { "StackResourceSummaries": [ { "LogicalResourceId": "LambdaExecutionRole", "PhysicalResourceId": cloud.name, "ResourceType": troposphere.awslambda.Function.resource_type, "LastUpdatedTimestamp": { "__class__": "datetime", "year": 2018, "month": 3, "day": 18, "hour": 17, "minute": 24, "second": 33, "microsecond": 565000 }, "ResourceStatus": "CREATE_COMPLETE" } ] } pill.save_response(service='cloudformation', operation='ListStackResources', response_data=response, http_response=200) function_name = 'UnitTestFunctionName' cloud.add_lambda(function_name) cloud_function_name = cloud.function_name assert(cloud.name == cloud_function_name) def test_is_deployed(cloud, pill): response = {'ResponseMetadata': {'HTTPHeaders': {'content-length': '123', 'content-type': 'text/xml', 'date': 'xyz', 'x-amzn-requestid': 'xyz'}, 'HTTPStatusCode': 200, 'RequestId': 'xyz', 'RetryAttempts': 0}, 'StackSummaries': [{'CreationTime': datetime.datetime(2018, 1, 1, tzinfo=tzutc()), 'StackId': 'arn:aws:cloudformation:us-east-1:123:stack/TestStackName/xyz', 'StackName': cloud.name, 'StackStatus': 'CREATE_COMPLETE'}]} pill.save_response(service='cloudformation', operation='ListStacks', response_data=response, http_response=200) result = cloud.is_deployed() assert(result)
62.101911
431
0.727897
1,083
9,750
6.391505
0.131117
0.034672
0.034672
0.049841
0.790812
0.77102
0.756284
0.744149
0.722335
0.705143
0
0.03015
0.108718
9,750
156
432
62.5
0.766398
0.005333
0
0.409091
0
0
0.354162
0.057013
0
0
0
0
0.181818
1
0.163636
false
0
0.063636
0
0.236364
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
2a3229a0fa6d4b74606f012ad1f6f5cf96bbc85e
2,850
py
Python
tests/test_s1_download.py
d-chambers/OpenSarToolkit
0edf4b1e43a66b6d0a675d007c2053a053dc60df
[ "MIT" ]
131
2018-11-23T10:56:41.000Z
2022-03-31T02:53:40.000Z
tests/test_s1_download.py
d-chambers/OpenSarToolkit
0edf4b1e43a66b6d0a675d007c2053a053dc60df
[ "MIT" ]
64
2019-09-14T14:33:37.000Z
2022-03-29T07:23:40.000Z
tests/test_s1_download.py
d-chambers/OpenSarToolkit
0edf4b1e43a66b6d0a675d007c2053a053dc60df
[ "MIT" ]
45
2019-01-29T14:16:53.000Z
2022-03-27T12:39:39.000Z
import pytest import os import pandas as pd from tempfile import TemporaryDirectory from ost.helpers.asf import check_connection as check_connection_asf from ost.helpers.scihub import check_connection as check_connection_scihub, connect from ost.helpers.settings import HERBERT_USER from ost.s1.download import download_sentinel1 from ost.helpers.helpers import check_zipfile @pytest.mark.skip(reason="not running in pip build") def test_asf_connection(): herbert_uname = HERBERT_USER["uname"] herbert_password = HERBERT_USER["asf_pword"] response_code = check_connection_asf(uname=herbert_uname, pword=herbert_password) control_code = 200 assert response_code == control_code @pytest.mark.skip(reason="not running in pip build") def test_esa_scihub_connection(s1_grd_notnr_ost_product): herbert_uname = HERBERT_USER["uname"] herbert_password = HERBERT_USER["pword"] response_code = check_connection_scihub(uname=herbert_uname, pword=herbert_password) control_code = 200 assert response_code == control_code opener = connect( base_url="https://apihub.copernicus.eu/apihub/", uname=herbert_uname, pword=herbert_password, ) control_uuid = "1b43fb7d-bd2c-41cd-86a1-3442b1fbd5bb" uuid = s1_grd_notnr_ost_product[1].scihub_uuid(opener) assert uuid == control_uuid @pytest.mark.skip(reason="not running in pip build") def test_esa_scihub_download(s1_grd_notnr_ost_product, mirror=1): herbert_uname = HERBERT_USER["uname"] herbert_password = HERBERT_USER["pword"] df = pd.DataFrame({"identifier": [s1_grd_notnr_ost_product[1].scene_id]}) with TemporaryDirectory(dir=os.getcwd()) as temp: download_sentinel1( inventory_df=df, download_dir=temp, mirror=mirror, concurrent=1, uname=herbert_uname, pword=herbert_password, ) product_path = s1_grd_notnr_ost_product[1].get_path(download_dir=temp) return_code = check_zipfile(product_path) assert return_code is None @pytest.mark.skip(reason="not running in pip build") def test_asf_download(s1_grd_notnr_ost_product, mirror=2): herbert_uname = HERBERT_USER["uname"] herbert_password = HERBERT_USER["asf_pword"] df = pd.DataFrame({"identifier": [s1_grd_notnr_ost_product[1].scene_id]}) with TemporaryDirectory(dir=os.getcwd()) as temp: download_sentinel1( inventory_df=df, download_dir=temp, mirror=mirror, concurrent=1, uname=herbert_uname, pword=herbert_password, ) from ost.helpers.helpers import check_zipfile product_path = s1_grd_notnr_ost_product[1].get_path(download_dir=temp) return_code = check_zipfile(product_path) assert return_code is None
36.075949
88
0.723509
374
2,850
5.197861
0.205882
0.080247
0.041152
0.053498
0.8143
0.776235
0.726337
0.628601
0.628601
0.628601
0
0.018663
0.191579
2,850
78
89
36.538462
0.825087
0
0
0.666667
0
0
0.082807
0.012632
0
0
0
0
0.075758
1
0.060606
false
0.136364
0.151515
0
0.212121
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
1
0
0
0
0
0
5
2a4d49dd1f1b696e01135b545c8561c0e5186583
130
py
Python
solutions/1st-operators/l1_a18.py
Jhynn/programming-concepts-and-logic
0ffa71c6259296813d3951f21e8d0d69dd523545
[ "CC-BY-4.0" ]
4
2021-08-03T01:13:34.000Z
2021-09-29T21:47:41.000Z
solutions/1st-operators/l1_a18.py
Jhynn/programming-concepts-and-logic
0ffa71c6259296813d3951f21e8d0d69dd523545
[ "CC-BY-4.0" ]
null
null
null
solutions/1st-operators/l1_a18.py
Jhynn/programming-concepts-and-logic
0ffa71c6259296813d3951f21e8d0d69dd523545
[ "CC-BY-4.0" ]
null
null
null
n = int(input('How many sides the convex polygon have: ')) nd = (n * (n - 3)) / 2 print(f'The convex polygon have {nd} sides.')
21.666667
58
0.615385
23
130
3.478261
0.652174
0.225
0.4
0.5
0.55
0
0
0
0
0
0
0.019417
0.207692
130
5
59
26
0.757282
0
0
0
0
0
0.576923
0
0
0
0
0
0
1
0
false
0
0
0
0
0.333333
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
2a522fd38c3f6a51339c813b23aaa8a38fa3dc4e
42
py
Python
src/repository/__init__.py
ianlet/spaceship-ci
c61df12778b024078a19d9d97e44dc7d219201b9
[ "Apache-2.0" ]
null
null
null
src/repository/__init__.py
ianlet/spaceship-ci
c61df12778b024078a19d9d97e44dc7d219201b9
[ "Apache-2.0" ]
null
null
null
src/repository/__init__.py
ianlet/spaceship-ci
c61df12778b024078a19d9d97e44dc7d219201b9
[ "Apache-2.0" ]
null
null
null
from .git_repository import GitRepository
21
41
0.880952
5
42
7.2
1
0
0
0
0
0
0
0
0
0
0
0
0.095238
42
1
42
42
0.947368
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
aa567a899989876ce396a9bfbfd0b428474132d1
84
py
Python
analysis/__init__.py
antoneri/mapping-hypergraphs
f81425c6bbd45b0537f8a0da2ddc24ec79730593
[ "MIT" ]
10
2021-01-11T07:36:37.000Z
2022-02-07T13:20:18.000Z
analysis/__init__.py
antoneri/mapping-hypergraphs
f81425c6bbd45b0537f8a0da2ddc24ec79730593
[ "MIT" ]
null
null
null
analysis/__init__.py
antoneri/mapping-hypergraphs
f81425c6bbd45b0537f8a0da2ddc24ec79730593
[ "MIT" ]
1
2021-06-14T15:33:13.000Z
2021-06-14T15:33:13.000Z
from .ami import * from .plot import * from .stats import * from .wjaccard import *
16.8
23
0.714286
12
84
5
0.5
0.5
0
0
0
0
0
0
0
0
0
0
0.190476
84
4
24
21
0.882353
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
aacc52555958b8eddc61176026ccf0514cf34bd4
246
py
Python
fp/errors.py
vol1ura/free-proxy
0b018cc1afdcf196cb77afd6a3885209102018ce
[ "MIT" ]
null
null
null
fp/errors.py
vol1ura/free-proxy
0b018cc1afdcf196cb77afd6a3885209102018ce
[ "MIT" ]
null
null
null
fp/errors.py
vol1ura/free-proxy
0b018cc1afdcf196cb77afd6a3885209102018ce
[ "MIT" ]
null
null
null
'''FreeProxy exceptions module''' class FreeProxyException(Exception): '''Exception class with message as a required parameter''' def __init__(self, message) -> None: self.message = message super().__init__(self.message)
30.75
62
0.691057
26
246
6.230769
0.653846
0.203704
0.185185
0
0
0
0
0
0
0
0
0
0.191057
246
7
63
35.142857
0.81407
0.325203
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0
0
0.5
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
5
aad2780f70e595efe46cbef063d5e14f21920fd6
44
py
Python
python_files/working/chr_iteration_test.py
csebesta/mechanimation
8cbbf092df1ea0909726c5b81fcda71654d7d396
[ "MIT" ]
null
null
null
python_files/working/chr_iteration_test.py
csebesta/mechanimation
8cbbf092df1ea0909726c5b81fcda71654d7d396
[ "MIT" ]
null
null
null
python_files/working/chr_iteration_test.py
csebesta/mechanimation
8cbbf092df1ea0909726c5b81fcda71654d7d396
[ "MIT" ]
null
null
null
for i in range(75, 225): print chr(i)
14.666667
25
0.568182
9
44
2.777778
0.888889
0
0
0
0
0
0
0
0
0
0
0.16129
0.295455
44
2
26
22
0.645161
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0.5
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
1
0
5
2a9affb0c3ee5bb1ae0ce208beb45706ac043a5d
62
py
Python
rgbd_seg/models/__init__.py
tomchol/ShapeConv
41ead20854daed43b59ef978665fa53f113cbb65
[ "Apache-2.0" ]
438
2019-12-17T12:31:15.000Z
2022-03-03T08:43:15.000Z
rgbd_seg/models/__init__.py
tomchol/ShapeConv
41ead20854daed43b59ef978665fa53f113cbb65
[ "Apache-2.0" ]
25
2019-12-23T08:57:47.000Z
2021-12-05T02:50:10.000Z
rgbd_seg/models/__init__.py
tomchol/ShapeConv
41ead20854daed43b59ef978665fa53f113cbb65
[ "Apache-2.0" ]
56
2019-12-17T12:06:08.000Z
2021-12-16T06:23:19.000Z
from .builder import build_model from .registry import MODELS
20.666667
32
0.83871
9
62
5.666667
0.777778
0
0
0
0
0
0
0
0
0
0
0
0.129032
62
2
33
31
0.944444
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
2a9e4802d24734634730efcc78d9d8c807f791a3
1,985
py
Python
tests/test_power.py
austinpeel/jax_cosmo
39404b339580ea671f3afebeedd44ca19a363c90
[ "MIT" ]
null
null
null
tests/test_power.py
austinpeel/jax_cosmo
39404b339580ea671f3afebeedd44ca19a363c90
[ "MIT" ]
null
null
null
tests/test_power.py
austinpeel/jax_cosmo
39404b339580ea671f3afebeedd44ca19a363c90
[ "MIT" ]
null
null
null
import jax.numpy as jnp import numpy as np import pyccl as ccl from numpy.testing import assert_allclose import jax_cosmo.power as power import jax_cosmo.transfer as tklib from jax_cosmo import Cosmology def test_eisenstein_hu(): # We first define equivalent CCL and jax_cosmo cosmologies cosmo_ccl = ccl.Cosmology( Omega_c=0.3, Omega_b=0.05, h=0.7, sigma8=0.8, n_s=0.96, Neff=0, transfer_function="eisenstein_hu", matter_power_spectrum="linear", ) cosmo_jax = Cosmology( Omega_c=0.3, Omega_b=0.05, h=0.7, sigma8=0.8, n_s=0.96, Omega_k=0.0, w0=-1.0, wa=0.0, ) # Test array of scales k = np.logspace(-4, 2, 512) # Computing matter power spectrum pk_ccl = ccl.linear_matter_power(cosmo_ccl, k, 1.0) pk_jax = ( power.linear_matter_power(cosmo_jax, k / cosmo_jax.h, a=1.0) / cosmo_jax.h ** 3 ) assert_allclose(pk_ccl, pk_jax, rtol=0.5e-2) def test_halofit(): # We first define equivalent CCL and jax_cosmo cosmologies cosmo_ccl = ccl.Cosmology( Omega_c=0.3, Omega_b=0.05, h=0.7, sigma8=0.8, n_s=0.96, Neff=0, transfer_function="eisenstein_hu", matter_power_spectrum="halofit", ) cosmo_jax = Cosmology( Omega_c=0.3, Omega_b=0.05, h=0.7, sigma8=0.8, n_s=0.96, Omega_k=0.0, w0=-1.0, wa=0.0, ) # Test array of scales k = np.logspace(-4, 2, 512) # Computing matter power spectrum pk_ccl = ccl.nonlin_matter_power(cosmo_ccl, k, 1.0) pk_jax = ( power.nonlinear_matter_power( cosmo_jax, k / cosmo_jax.h, a=1.0, transfer_fn=tklib.Eisenstein_Hu, nonlinear_fn=power.halofit, ) / cosmo_jax.h ** 3 ) assert_allclose(pk_ccl, pk_jax, rtol=0.5e-2)
22.556818
87
0.575819
304
1,985
3.549342
0.213816
0.081557
0.055607
0.059314
0.730306
0.730306
0.730306
0.730306
0.730306
0.730306
0
0.069424
0.317884
1,985
87
88
22.816092
0.727474
0.110327
0
0.588235
0
0
0.022172
0
0
0
0
0
0.044118
1
0.029412
false
0
0.102941
0
0.132353
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
2ab0a8c01411537b4a0acbe698a00c0f569c906d
96
py
Python
venv/lib/python3.8/site-packages/numpy/matrixlib/setup.py
Retraces/UkraineBot
3d5d7f8aaa58fa0cb8b98733b8808e5dfbdb8b71
[ "MIT" ]
2
2022-03-13T01:58:52.000Z
2022-03-31T06:07:54.000Z
venv/lib/python3.8/site-packages/numpy/matrixlib/setup.py
DesmoSearch/Desmobot
b70b45df3485351f471080deb5c785c4bc5c4beb
[ "MIT" ]
19
2021-11-20T04:09:18.000Z
2022-03-23T15:05:55.000Z
venv/lib/python3.8/site-packages/numpy/matrixlib/setup.py
DesmoSearch/Desmobot
b70b45df3485351f471080deb5c785c4bc5c4beb
[ "MIT" ]
null
null
null
/home/runner/.cache/pip/pool/d6/be/c9/46448ce07c95a2b82d8e82891962dc39c3cedf09af8afa5e12c56d0048
96
96
0.895833
9
96
9.555556
1
0
0
0
0
0
0
0
0
0
0
0.395833
0
96
1
96
96
0.5
0
0
0
0
0
0
0
0
1
0
0
0
0
null
null
0
0
null
null
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
0
0
0
null
1
0
0
0
1
0
0
0
0
0
0
0
0
5
2abd7885617b38771cb6ccea338f59ddc2b42232
91
py
Python
BOJ_Solved/BOJ-14623.py
CodingLeeSeungHoon/Python_Algorithm_TeamNote
1e92986999b45aa9951e12e67b23062e410e9b36
[ "MIT" ]
7
2021-11-19T14:50:59.000Z
2022-02-25T20:00:20.000Z
BOJ_Solved/BOJ-14623.py
CodingLeeSeungHoon/Python_Algorithm_TeamNote
1e92986999b45aa9951e12e67b23062e410e9b36
[ "MIT" ]
null
null
null
BOJ_Solved/BOJ-14623.py
CodingLeeSeungHoon/Python_Algorithm_TeamNote
1e92986999b45aa9951e12e67b23062e410e9b36
[ "MIT" ]
null
null
null
""" 백준 14623번 : 감정이입 """ B1 = int(input(), 2) B2 = int(input(), 2) print(bin(B1 * B2)[2:])
13
23
0.516484
16
91
2.9375
0.625
0.340426
0.382979
0
0
0
0
0
0
0
0
0.162162
0.186813
91
7
23
13
0.472973
0.175824
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0.333333
1
0
0
null
1
1
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
5
6317c91b120892818a9324dd8b62243a5d111c72
245
py
Python
lecciones/33/cadenas_1.py
ImAlexisSaez/curso-python-desde-0
c4a84dae0804adefe4ee6024b411d8ed288da759
[ "MIT" ]
2
2020-08-31T02:17:36.000Z
2022-01-29T15:25:27.000Z
lecciones/33/cadenas_1.py
ImAlexisSaez/curso-python-desde-0
c4a84dae0804adefe4ee6024b411d8ed288da759
[ "MIT" ]
null
null
null
lecciones/33/cadenas_1.py
ImAlexisSaez/curso-python-desde-0
c4a84dae0804adefe4ee6024b411d8ed288da759
[ "MIT" ]
null
null
null
nombre_usuario = input("Introduce tu nombre de usuario: ") print("El nombre es:", nombre_usuario) print("El nombre es:", nombre_usuario.upper()) print("El nombre es:", nombre_usuario.lower()) print("El nombre es:", nombre_usuario.capitalize())
35
58
0.738776
35
245
5.028571
0.342857
0.369318
0.295455
0.340909
0.676136
0.676136
0.357955
0
0
0
0
0
0.102041
245
6
59
40.833333
0.8
0
0
0
0
0
0.342857
0
0
0
0
0
0
1
0
false
0
0
0
0
0.8
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
1
0
5
2d5a94c4a7edbfde0ca8dbf29deb05d426b7d014
1,381
py
Python
complexModules/models.py
BVPIEEE/hackathon_portal
0a67704ae42d5680c6f4d05ca9c63a1f06f556c0
[ "Apache-2.0" ]
3
2020-04-07T12:25:59.000Z
2020-04-16T18:21:27.000Z
complexModules/models.py
BVPIEEE/hackathon_portal
0a67704ae42d5680c6f4d05ca9c63a1f06f556c0
[ "Apache-2.0" ]
3
2021-03-30T12:57:08.000Z
2021-09-22T18:48:35.000Z
complexModules/models.py
BVPIEEE/hackathon_portal
0a67704ae42d5680c6f4d05ca9c63a1f06f556c0
[ "Apache-2.0" ]
1
2020-04-16T18:21:38.000Z
2020-04-16T18:21:38.000Z
from django.db import models # Create your models here. class scoringModel(models.Model): client = models.CharField(max_length=1000, null=True, blank=True) api_key = models.CharField(max_length=1000, null=True, blank=True) def __str__(self): return str(self.client) class submissionModel(models.Model): sheet_id = models.TextField(null = False, blank=False) round = models.IntegerField(null=False, blank=False) state_column = models.CharField(max_length=255, null=False, blank=False) form_link = models.TextField(null=False, blank=False) def __str__(self): return str(self.round) class gradeModel(models.Model): sheet_id = models.TextField(null = False, blank=False) round = models.IntegerField(null=False, blank=False) state_column = models.CharField(max_length=255, null=True, blank=True) form_link = models.TextField(null=False, blank=False) def __str__(self): return str(self.round) class currentRound(models.Model): round = models.IntegerField(null=False, blank=False) class roundDetails(models.Model): round = models.IntegerField(null=False, blank=False) round_todo = models.TextField(null=False, blank=False) round_info = models.TextField(null=False, blank=False) round_template = models.TextField(null=False,blank=False)
37.324324
77
0.707458
177
1,381
5.372881
0.242938
0.113565
0.176656
0.239748
0.797056
0.791798
0.731861
0.649842
0.649842
0.443743
0
0.012378
0.181028
1,381
37
78
37.324324
0.82847
0.017379
0
0.481481
0
0
0
0
0
0
0
0
0
1
0.111111
false
0
0.037037
0.111111
1
0
0
0
0
null
0
0
1
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
5
2d9ff592389554b4a321a1578fceca83402c4407
254
py
Python
Data/Packages/Package Control/package_control/downloaders/win_downloader_exception.py
koery/win-sublime
1b16cbe9858eced52567971286109250df787d36
[ "MIT" ]
1
2016-11-20T13:50:40.000Z
2016-11-20T13:50:40.000Z
package_control/downloaders/win_downloader_exception.py
davidpeckham/package_control
81fb07067d8188c3ad31e2ec841bd1fe8f08cfcb
[ "Unlicense", "MIT" ]
null
null
null
package_control/downloaders/win_downloader_exception.py
davidpeckham/package_control
81fb07067d8188c3ad31e2ec841bd1fe8f08cfcb
[ "Unlicense", "MIT" ]
1
2019-10-09T22:27:04.000Z
2019-10-09T22:27:04.000Z
from .downloader_exception import DownloaderException class WinDownloaderException(DownloaderException): """ If the WinInetDownloader ran into a windows-specific error. The means we should retry with the UrllibDownloader. """ pass
23.090909
76
0.759843
26
254
7.384615
0.884615
0
0
0
0
0
0
0
0
0
0
0
0.188976
254
10
77
25.4
0.932039
0.440945
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.333333
0.333333
0
0.666667
0
1
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
0
1
1
1
0
1
0
0
5
2da8e05656a37692cec155f0c31e478ce7f83a42
39
py
Python
custom_components/reversotts/__init__.py
shlomifgm/HomeAssistant
6b86b81c33cdd9b0d6a9af0dc74b163f0aeb2112
[ "MIT" ]
4
2021-10-30T13:28:31.000Z
2021-11-04T14:50:39.000Z
custom_components/reversotts/__init__.py
shlomifgm/HomeAssistant
6b86b81c33cdd9b0d6a9af0dc74b163f0aeb2112
[ "MIT" ]
11
2021-10-30T15:23:09.000Z
2021-11-25T18:40:53.000Z
custom_components/reversotts/__init__.py
shlomifgm/HomeAssistant
6b86b81c33cdd9b0d6a9af0dc74b163f0aeb2112
[ "MIT" ]
null
null
null
"""Support for reverso integration."""
19.5
38
0.717949
4
39
7
1
0
0
0
0
0
0
0
0
0
0
0
0.102564
39
1
39
39
0.8
0.820513
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
2dae2fe590e574d93c25890b99cbb251c850e3ac
49
py
Python
tormiddleware/__init__.py
8W9aG/scrapy-tor-downloader
3be60d7369fd443af0de4a5cbc7483310e33b660
[ "MIT" ]
1
2022-03-15T05:20:52.000Z
2022-03-15T05:20:52.000Z
tormiddleware/__init__.py
8W9aG/scrapy-tor-downloader
3be60d7369fd443af0de4a5cbc7483310e33b660
[ "MIT" ]
null
null
null
tormiddleware/__init__.py
8W9aG/scrapy-tor-downloader
3be60d7369fd443af0de4a5cbc7483310e33b660
[ "MIT" ]
null
null
null
"""The main module for scrapy-tor-downloader."""
24.5
48
0.714286
7
49
5
1
0
0
0
0
0
0
0
0
0
0
0
0.102041
49
1
49
49
0.795455
0.857143
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
2dd071f5d0656d973a0389f869b6e2c37e8f3dbc
275
py
Python
python/database/ReaderBase.py
coreyjadams/harvard_production
233f20ef62ca34375f09417f4a507aa977c53a2a
[ "MIT" ]
null
null
null
python/database/ReaderBase.py
coreyjadams/harvard_production
233f20ef62ca34375f09417f4a507aa977c53a2a
[ "MIT" ]
null
null
null
python/database/ReaderBase.py
coreyjadams/harvard_production
233f20ef62ca34375f09417f4a507aa977c53a2a
[ "MIT" ]
1
2018-10-15T16:44:55.000Z
2018-10-15T16:44:55.000Z
import sys, os from MySQLdb import Error as Error from connect_db import read_connection class ReaderBase(object): def __init__(self): self._password_file = "/n/home00/cadams/mysqldb" def connect(self): return read_connection(self._password_file)
21.153846
56
0.734545
37
275
5.162162
0.621622
0.146597
0.167539
0
0
0
0
0
0
0
0
0.008969
0.189091
275
13
57
21.153846
0.847534
0
0
0
0
0
0.086957
0.086957
0
0
0
0
0
1
0.25
false
0.25
0.375
0.125
0.875
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
1
1
1
0
0
5
9312bbd8c513e1f30df78329f805837e13cf3b4f
83
py
Python
fileio/__init__.py
sunil3590/lets-learn
2ba1badef3337510a092b1bf82386f51c2c697ab
[ "Unlicense" ]
null
null
null
fileio/__init__.py
sunil3590/lets-learn
2ba1badef3337510a092b1bf82386f51c2c697ab
[ "Unlicense" ]
null
null
null
fileio/__init__.py
sunil3590/lets-learn
2ba1badef3337510a092b1bf82386f51c2c697ab
[ "Unlicense" ]
null
null
null
from fileio.file_reader import File print('fileio package is getting initialized')
27.666667
46
0.831325
12
83
5.666667
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.108434
83
2
47
41.5
0.918919
0
0
0
0
0
0.445783
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0.5
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
1
0
5
937d23ff388053c02a7e390494bab0fedb4b0afb
82
py
Python
referral/models/__init__.py
exolever/django-earlyparrot
031b7f2d67e1e78d525f85ae10e82d4cc0c198f3
[ "MIT" ]
null
null
null
referral/models/__init__.py
exolever/django-earlyparrot
031b7f2d67e1e78d525f85ae10e82d4cc0c198f3
[ "MIT" ]
7
2019-09-04T10:59:39.000Z
2019-12-12T22:16:25.000Z
referral/models/__init__.py
exolever/django-earlyparrot
031b7f2d67e1e78d525f85ae10e82d4cc0c198f3
[ "MIT" ]
null
null
null
from .campaign import Campaign # noqa from .subscriber import Subscriber # noqa
27.333333
42
0.780488
10
82
6.4
0.5
0
0
0
0
0
0
0
0
0
0
0
0.170732
82
2
43
41
0.941176
0.109756
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
fac4c606ca424058c1d066cf290580c2c1213302
239
py
Python
project-euler/40.py
hydroo/coding-and-math-exercises
c0c9b8ae48e043b0809e4c592444f3e4bc3222d8
[ "CC0-1.0" ]
2
2015-05-29T21:03:26.000Z
2019-11-11T02:10:53.000Z
project-euler/40.py
hydroo/coding-and-math-exercises
c0c9b8ae48e043b0809e4c592444f3e4bc3222d8
[ "CC0-1.0" ]
null
null
null
project-euler/40.py
hydroo/coding-and-math-exercises
c0c9b8ae48e043b0809e4c592444f3e4bc3222d8
[ "CC0-1.0" ]
null
null
null
#! /usr/bin/python nr = 1 s = "" a = 0 while nr < 1000000 : s += str(nr) nr += 1 print str(int(s[1 - 1]) * int(s[10 - 1]) * int(s[100 - 1]) * int(s[1000 - 1]) * int(s[10000 - 1]) * int(s[100000 - 1]) * int(s[1000000 - 1]))
14.058824
141
0.468619
46
239
2.434783
0.391304
0.25
0.267857
0
0
0
0
0
0
0
0
0.260116
0.276151
239
16
142
14.9375
0.387283
0.07113
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0.142857
0
0
0
null
1
1
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
5
facdcae742df17efa81bc1c22dde71a3fc650f65
191
py
Python
Exercício feitos pela primeira vez/ex013.py
Claayton/pythonExerciciosLinux
696cdb16983638418bd0d0d4fe44dc72662b9c97
[ "MIT" ]
1
2021-01-23T15:43:34.000Z
2021-01-23T15:43:34.000Z
Exercício feitos pela primeira vez/ex013.py
Claayton/pythonExerciciosLinux
696cdb16983638418bd0d0d4fe44dc72662b9c97
[ "MIT" ]
null
null
null
Exercício feitos pela primeira vez/ex013.py
Claayton/pythonExerciciosLinux
696cdb16983638418bd0d0d4fe44dc72662b9c97
[ "MIT" ]
null
null
null
#Exercício013 x = float(input('Qual o seu salário? ')) print('Se o seu salário é {:.2f} reais\nEntão com 15% de aumento você passará a ganhar {:.2f} reais'.format(x, x+x*15/100)) print('xD')
38.2
123
0.680628
35
191
3.714286
0.714286
0.061538
0.169231
0
0
0
0
0
0
0
0
0.073171
0.141361
191
4
124
47.75
0.719512
0.062827
0
0
0
0.333333
0.640449
0
0
0
0
0
0
1
0
false
0.333333
0
0
0
0.666667
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
1
1
0
null
0
0
0
0
0
0
0
1
0
0
0
1
0
5
faf118af42f092ef7148a6c6d49871e854bf5e1a
103
py
Python
blog/blog/views.py
allanliebold/blog_project
7e0ca59b5629b12ea59ceb944343912438fd07da
[ "MIT" ]
null
null
null
blog/blog/views.py
allanliebold/blog_project
7e0ca59b5629b12ea59ceb944343912438fd07da
[ "MIT" ]
null
null
null
blog/blog/views.py
allanliebold/blog_project
7e0ca59b5629b12ea59ceb944343912438fd07da
[ "MIT" ]
null
null
null
"""blog view definitions.""" from django.http import HttpResponse from django.shortcuts import render
20.6
36
0.796117
13
103
6.307692
0.769231
0.243902
0
0
0
0
0
0
0
0
0
0
0.116505
103
4
37
25.75
0.901099
0.213592
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
8786f768ec37b7895ada313eaa03b3fbdf404a20
899
py
Python
matplotlib/subplot.py
mk43/python-practice-project
4260456c1006c1f3e2a6f00bcb2639d6e8a71e5e
[ "Apache-2.0" ]
7
2018-05-29T07:14:22.000Z
2020-03-05T06:45:04.000Z
matplotlib/subplot.py
mk43/python-practice-project
4260456c1006c1f3e2a6f00bcb2639d6e8a71e5e
[ "Apache-2.0" ]
null
null
null
matplotlib/subplot.py
mk43/python-practice-project
4260456c1006c1f3e2a6f00bcb2639d6e8a71e5e
[ "Apache-2.0" ]
5
2018-11-08T04:03:48.000Z
2020-03-05T06:45:06.000Z
import matplotlib.pyplot as plt # example 1: ############################### plt.figure(figsize=(6, 4)) # plt.subplot(n_rows, n_cols, plot_num) plt.subplot(2, 2, 1) plt.plot([0, 1], [0, 1]) plt.subplot(222) plt.plot([0, 1], [0, 2]) plt.subplot(223) plt.plot([0, 1], [0, 3]) plt.subplot(224) plt.plot([0, 1], [0, 4]) plt.tight_layout() # example 2: ############################### plt.figure(figsize=(6, 4)) # plt.subplot(n_rows, n_cols, plot_num) plt.subplot(2, 1, 1) # figure splits into 2 rows, 1 col, plot to the 1st sub-fig plt.plot([0, 1], [0, 1]) plt.subplot(234) # figure splits into 2 rows, 3 col, plot to the 4th sub-fig plt.plot([0, 1], [0, 2]) plt.subplot(235) # figure splits into 2 rows, 3 col, plot to the 5th sub-fig plt.plot([0, 1], [0, 3]) plt.subplot(236) # figure splits into 2 rows, 3 col, plot to the 6th sub-fig plt.plot([0, 1], [0, 4]) plt.tight_layout() plt.show()
20.906977
59
0.600667
171
899
3.111111
0.233918
0.18797
0.120301
0.135338
0.817669
0.778195
0.778195
0.733083
0.496241
0.402256
0
0.096606
0.147942
899
43
60
20.906977
0.597911
0.365962
0
0.545455
0
0
0
0
0
0
0
0
0
1
0
true
0
0.045455
0
0.045455
0
0
0
0
null
0
0
0
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
8795497bf1795f89a88f37bd67f34c1e86b59e51
153
py
Python
openedx_webhooks/lib/webhooks_data/__init__.py
openedx/openedx-webhooks
78bd7b66ac349db025f6af2098bde15ea2afed20
[ "Apache-2.0" ]
null
null
null
openedx_webhooks/lib/webhooks_data/__init__.py
openedx/openedx-webhooks
78bd7b66ac349db025f6af2098bde15ea2afed20
[ "Apache-2.0" ]
7
2022-01-24T14:48:56.000Z
2022-03-25T19:52:26.000Z
openedx_webhooks/lib/webhooks_data/__init__.py
openedx/openedx-webhooks
78bd7b66ac349db025f6af2098bde15ea2afed20
[ "Apache-2.0" ]
null
null
null
""" Tools to work with the webhooks data files. A copy of those data files is expected at the `openedx_webhooks.info.DATA_FILES_URL_BASE` location. """
25.5
99
0.771242
26
153
4.384615
0.769231
0.236842
0
0
0
0
0
0
0
0
0
0
0.150327
153
5
100
30.6
0.876923
0.941176
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
87a9075d7dc32f2a723d3b6a46285861642b7389
4,633
py
Python
.github/scripts/test_print_latest_commits.py
qqaatw/pytorch
44764f131b040a41a6dcf1304bb635c574bf5a3b
[ "Intel" ]
null
null
null
.github/scripts/test_print_latest_commits.py
qqaatw/pytorch
44764f131b040a41a6dcf1304bb635c574bf5a3b
[ "Intel" ]
null
null
null
.github/scripts/test_print_latest_commits.py
qqaatw/pytorch
44764f131b040a41a6dcf1304bb635c574bf5a3b
[ "Intel" ]
null
null
null
from unittest import TestCase, main, mock from typing import Any, List, Dict from print_latest_commits import isGreen, WorkflowCheck workflowNames = [ "pull", "trunk", "Lint", "linux-binary-libtorch-pre-cxx11", "android-tests", "windows-binary-wheel", "periodic", "docker-release-builds", "nightly", "pr-labels", "Close stale pull requests", "Update S3 HTML indices for download.pytorch.org", "Create Release" ] def set_workflow_job_status(workflow: List[Dict[str, Any]], name: str, status: str) -> List[Dict[str, Any]]: for check in workflow: if check['workflowName'] == name: check['conclusion'] = status return workflow class TestChecks: def make_test_checks(self) -> List[Dict[str, Any]]: workflow_checks = [] for i in range(len(workflowNames)): workflow_checks.append(WorkflowCheck( workflowName=workflowNames[i], name="test/job", jobName="job", conclusion="success", )._asdict()) return workflow_checks class TestPrintCommits(TestCase): @mock.patch('print_latest_commits.get_commit_results', return_value=TestChecks().make_test_checks()) def test_all_successful(self, mock_get_commit_results: Any) -> None: "Test with workflows are successful" workflow_checks = mock_get_commit_results() self.assertTrue(isGreen("sha", workflow_checks)[0]) @mock.patch('print_latest_commits.get_commit_results', return_value=TestChecks().make_test_checks()) def test_necessary_successful(self, mock_get_commit_results: Any) -> None: "Test with necessary workflows are successful" workflow_checks = mock_get_commit_results() workflow_checks = set_workflow_job_status(workflow_checks, workflowNames[8], "failed") workflow_checks = set_workflow_job_status(workflow_checks, workflowNames[9], "failed") workflow_checks = set_workflow_job_status(workflow_checks, workflowNames[10], "failed") workflow_checks = set_workflow_job_status(workflow_checks, workflowNames[11], "failed") workflow_checks = set_workflow_job_status(workflow_checks, workflowNames[12], "failed") self.assertTrue(isGreen("sha", workflow_checks)[0]) @mock.patch('print_latest_commits.get_commit_results', return_value=TestChecks().make_test_checks()) def test_necessary_skipped(self, mock_get_commit_results: Any) -> None: "Test with necessary job (ex: pull) skipped" workflow_checks = mock_get_commit_results() workflow_checks = set_workflow_job_status(workflow_checks, "pull", "skipped") result = isGreen("sha", workflow_checks) self.assertFalse(result[0]) self.assertEqual(result[1], "pull checks were not successful") @mock.patch('print_latest_commits.get_commit_results', return_value=TestChecks().make_test_checks()) def test_skippable_skipped(self, mock_get_commit_results: Any) -> None: "Test with skippable jobs (periodic and docker-release-builds skipped" workflow_checks = mock_get_commit_results() workflow_checks = set_workflow_job_status(workflow_checks, "periodic", "skipped") workflow_checks = set_workflow_job_status(workflow_checks, "docker-release-builds", "skipped") self.assertTrue(isGreen("sha", workflow_checks)) @mock.patch('print_latest_commits.get_commit_results', return_value=TestChecks().make_test_checks()) def test_necessary_failed(self, mock_get_commit_results: Any) -> None: "Test with necessary job (ex: Lint) failed" workflow_checks = mock_get_commit_results() workflow_checks = set_workflow_job_status(workflow_checks, "Lint", "failed") result = isGreen("sha", workflow_checks) self.assertFalse(result[0]) self.assertEqual(result[1], "Lint checks were not successful") @mock.patch('print_latest_commits.get_commit_results', return_value=TestChecks().make_test_checks()) def test_skippable_failed(self, mock_get_commit_results: Any) -> None: "Test with skippable job (ex: docker-release-builds) failing" workflow_checks = mock_get_commit_results() workflow_checks = set_workflow_job_status(workflow_checks, "periodic", "skipped") workflow_checks = set_workflow_job_status(workflow_checks, "docker-release-builds", "failed") result = isGreen("sha", workflow_checks) self.assertFalse(result[0]) self.assertEqual(result[1], "docker-release-builds checks were not successful") if __name__ == "__main__": main()
48.768421
108
0.710986
554
4,633
5.628159
0.193141
0.166132
0.092367
0.076972
0.725144
0.716164
0.703977
0.703977
0.703977
0.674792
0
0.005001
0.180013
4,633
94
109
49.287234
0.815741
0.063242
0
0.261905
0
0
0.224908
0.08461
0
0
0
0
0.107143
1
0.095238
false
0
0.035714
0
0.178571
0.083333
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
87d0cb966bee4662afb01098c32f13ce00cdc305
77
py
Python
wpy/__init__.py
dulichan/wpython
0e8319dd0d9e8d8cb362a6a373a07bc8c2ff5e81
[ "WTFPL" ]
null
null
null
wpy/__init__.py
dulichan/wpython
0e8319dd0d9e8d8cb362a6a373a07bc8c2ff5e81
[ "WTFPL" ]
null
null
null
wpy/__init__.py
dulichan/wpython
0e8319dd0d9e8d8cb362a6a373a07bc8c2ff5e81
[ "WTFPL" ]
null
null
null
from Artifact import Artifact from ArtifactGenerator import ArtifactGenerator
38.5
47
0.909091
8
77
8.75
0.5
0
0
0
0
0
0
0
0
0
0
0
0.090909
77
2
47
38.5
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
87f75af06c14c25daa3da420c01e363061e182c8
196
py
Python
serve.py
akshayAithal/result_linker
5dd051ef355f9e50c735cffbbf14e5f20f677699
[ "Apache-2.0" ]
null
null
null
serve.py
akshayAithal/result_linker
5dd051ef355f9e50c735cffbbf14e5f20f677699
[ "Apache-2.0" ]
null
null
null
serve.py
akshayAithal/result_linker
5dd051ef355f9e50c735cffbbf14e5f20f677699
[ "Apache-2.0" ]
null
null
null
from waitress import serve from result_linker.logger import logger from result_linker.app import create_app serve(create_app(config_filename="config.py"), host='0.0.0.0', port=2323, threads = 10)
39.2
87
0.80102
33
196
4.606061
0.545455
0.039474
0.210526
0
0
0
0
0
0
0
0
0.05618
0.091837
196
5
87
39.2
0.797753
0
0
0
0
0
0.081218
0
0
0
0
0
0
1
0
true
0
0.75
0
0.75
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
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
354fe8f3794b905f9791e808f0963f8b5bbdf168
117
py
Python
src/repositories/__init__.py
viniciustr/vagas-challenge-api
37d5752de3aee1a195ca862529371e4359e4c3b5
[ "MIT" ]
null
null
null
src/repositories/__init__.py
viniciustr/vagas-challenge-api
37d5752de3aee1a195ca862529371e4359e4c3b5
[ "MIT" ]
null
null
null
src/repositories/__init__.py
viniciustr/vagas-challenge-api
37d5752de3aee1a195ca862529371e4359e4c3b5
[ "MIT" ]
null
null
null
from .pessoa import PessoaRepository from .vaga import VagaRepository from .candidatura import CandidaturaRepository
29.25
46
0.871795
12
117
8.5
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.102564
117
3
47
39
0.971429
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
3553ca23e6f62f5ec4147a6ebdb521b18d7c50c3
50
py
Python
src/cloud_messaging.py
asserty308/spacex_server
097a54451dd2b37ccfb93206c76dc6cc2d238c07
[ "MIT" ]
null
null
null
src/cloud_messaging.py
asserty308/spacex_server
097a54451dd2b37ccfb93206c76dc6cc2d238c07
[ "MIT" ]
null
null
null
src/cloud_messaging.py
asserty308/spacex_server
097a54451dd2b37ccfb93206c76dc6cc2d238c07
[ "MIT" ]
null
null
null
# TODO: Connect to Firebase and send cloud message
50
50
0.8
8
50
5
1
0
0
0
0
0
0
0
0
0
0
0
0.16
50
1
50
50
0.952381
0.96
0
null
0
null
0
0
null
0
0
1
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
1
0
0
0
1
0
0
0
0
0
0
5
3578810f2f2e4b6427eee351f05578f0a87c30e7
117
py
Python
src/handlerchief/i_builder.py
kokaib/python-handlerchief
179de323f64d39be6087d1ab0b35bb835fa5959e
[ "MIT" ]
null
null
null
src/handlerchief/i_builder.py
kokaib/python-handlerchief
179de323f64d39be6087d1ab0b35bb835fa5959e
[ "MIT" ]
null
null
null
src/handlerchief/i_builder.py
kokaib/python-handlerchief
179de323f64d39be6087d1ab0b35bb835fa5959e
[ "MIT" ]
null
null
null
from abc import ABC, abstractmethod class IBuilder(ABC): """""" @abstractmethod def build(self): """"""
11.7
35
0.615385
12
117
6
0.75
0.472222
0
0
0
0
0
0
0
0
0
0
0.213675
117
9
36
13
0.782609
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.25
0
0.75
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
5
35c3c9278b57b1e3efeb0a6574a8cb912dccbdce
44
py
Python
pmix/__init__.py
jkpr/pmix
96a88ca8fdcbc0aa91061cc8f77f5aba8eb7acb2
[ "MIT" ]
1
2018-07-26T05:51:02.000Z
2018-07-26T05:51:02.000Z
pmix/__init__.py
jkpr/pmix
96a88ca8fdcbc0aa91061cc8f77f5aba8eb7acb2
[ "MIT" ]
14
2017-05-06T16:28:14.000Z
2018-08-24T17:00:17.000Z
pmix/__init__.py
jkpr/pmix
96a88ca8fdcbc0aa91061cc8f77f5aba8eb7acb2
[ "MIT" ]
2
2017-03-15T00:25:14.000Z
2018-07-09T19:09:36.000Z
"""A mixed bag of utilities for PMA2020."""
22
43
0.681818
7
44
4.285714
1
0
0
0
0
0
0
0
0
0
0
0.108108
0.159091
44
1
44
44
0.702703
0.840909
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
ea548e050ae2c969b049ef88d2811a7f922d767d
81
py
Python
bolt/cogs/infractions/__init__.py
HeavyLobster/bolt
d50dd59d119a627bfac32fbed2544433f066399b
[ "0BSD" ]
null
null
null
bolt/cogs/infractions/__init__.py
HeavyLobster/bolt
d50dd59d119a627bfac32fbed2544433f066399b
[ "0BSD" ]
null
null
null
bolt/cogs/infractions/__init__.py
HeavyLobster/bolt
d50dd59d119a627bfac32fbed2544433f066399b
[ "0BSD" ]
null
null
null
from .cog import Infractions def setup(bot): bot.add_cog(Infractions(bot))
13.5
33
0.728395
12
81
4.833333
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.160494
81
5
34
16.2
0.852941
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
0
1
0
0
5
578e3f0411ef47cdbd5ba397459364fc95ed0f31
79
py
Python
iapcompython/exe_2_3.py
edmilsonlibanio/Ola-Mundo-Python
33fb08da5878f2784983c623df04d2bbdfb30f25
[ "MIT" ]
null
null
null
iapcompython/exe_2_3.py
edmilsonlibanio/Ola-Mundo-Python
33fb08da5878f2784983c623df04d2bbdfb30f25
[ "MIT" ]
null
null
null
iapcompython/exe_2_3.py
edmilsonlibanio/Ola-Mundo-Python
33fb08da5878f2784983c623df04d2bbdfb30f25
[ "MIT" ]
null
null
null
# Faça um programa que exiba seu nome na tela. print('Edmilson Libanio Paulo')
26.333333
46
0.759494
13
79
4.615385
1
0
0
0
0
0
0
0
0
0
0
0
0.164557
79
3
47
26.333333
0.909091
0.556962
0
0
0
0
0.647059
0
0
0
0
0
0
1
0
true
0
0
0
0
1
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
5
57939d30777b0904ee273aea2cd393501c0a1650
92
py
Python
core/templatetags/__init__.py
mark-barrett/RESTBroker
d9b0a3574d2970443fdf40c70ab9ceb8d72614f4
[ "MIT" ]
null
null
null
core/templatetags/__init__.py
mark-barrett/RESTBroker
d9b0a3574d2970443fdf40c70ab9ceb8d72614f4
[ "MIT" ]
null
null
null
core/templatetags/__init__.py
mark-barrett/RESTBroker
d9b0a3574d2970443fdf40c70ab9ceb8d72614f4
[ "MIT" ]
null
null
null
# Developed by Mark Barrett # http://markbarrettdesign.com # https://github.com/mark-barrett
30.666667
33
0.771739
12
92
5.916667
0.75
0.309859
0
0
0
0
0
0
0
0
0
0
0.086957
92
3
33
30.666667
0.845238
0.934783
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
579a2be04e16316d8be0d7f70981ffc10bbfc3ad
44
py
Python
something/return/python/hello.py
EduFreit4s/Tecnicas-de-Program
360a2addabe8226b4abc78b26fd6ece0297892f4
[ "MIT" ]
5
2019-10-03T22:14:13.000Z
2020-02-18T00:23:55.000Z
something/return/python/hello.py
EduFreit4s/Tecnicas-de-Program
360a2addabe8226b4abc78b26fd6ece0297892f4
[ "MIT" ]
null
null
null
something/return/python/hello.py
EduFreit4s/Tecnicas-de-Program
360a2addabe8226b4abc78b26fd6ece0297892f4
[ "MIT" ]
2
2019-10-24T21:32:53.000Z
2019-12-05T18:36:56.000Z
while True : print("MC Poze do Rodo")
14.666667
28
0.590909
7
44
3.714286
1
0
0
0
0
0
0
0
0
0
0
0
0.295455
44
3
28
14.666667
0.83871
0
0
0
0
0
0.357143
0
0
0
0
0
0
1
0
true
0
0
0
0
0.5
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
5
57af400a058cd2f3f3890e958c6316e4a16250cd
127
py
Python
Test.py
nint8835/CallableModules
674e2d832ac2bd20a5ef839148b551d5ef85bf82
[ "MIT" ]
1
2018-03-29T14:30:11.000Z
2018-03-29T14:30:11.000Z
Test.py
nint8835/CallableModules
674e2d832ac2bd20a5ef839148b551d5ef85bf82
[ "MIT" ]
1
2018-02-01T00:08:32.000Z
2018-03-28T20:34:42.000Z
Test.py
nint8835/CallableModules
674e2d832ac2bd20a5ef839148b551d5ef85bf82
[ "MIT" ]
null
null
null
import TestModule print(TestModule) TestModule(1, 2, 3, abc=123) print(TestModule.a) print(TestModule.b) print(TestModule.c)
14.111111
28
0.771654
19
127
5.157895
0.578947
0.612245
0
0
0
0
0
0
0
0
0
0.052174
0.094488
127
8
29
15.875
0.8
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.166667
0
0.166667
0.666667
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
5
57bb4f20a7b978aa0415147b8c096f71d147f5cb
46
py
Python
templated_mail/__init__.py
AvocadoCoop/avocado-templated-mail
fa1c6140b480fc2c0cb8cf45aada66de0215e6ed
[ "BSD-3-Clause" ]
null
null
null
templated_mail/__init__.py
AvocadoCoop/avocado-templated-mail
fa1c6140b480fc2c0cb8cf45aada66de0215e6ed
[ "BSD-3-Clause" ]
null
null
null
templated_mail/__init__.py
AvocadoCoop/avocado-templated-mail
fa1c6140b480fc2c0cb8cf45aada66de0215e6ed
[ "BSD-3-Clause" ]
null
null
null
from .send import send_templated_mail # noqa
23
45
0.804348
7
46
5
0.857143
0
0
0
0
0
0
0
0
0
0
0
0.152174
46
1
46
46
0.897436
0.086957
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
57de820547e9e528a579f915e64e986847d74704
1,237
py
Python
python/tHome/sma/test/gridRelayStatus.py
ZigmundRat/T-Home
5dc8689f52d87dac890051e540b338b009293ced
[ "BSD-2-Clause" ]
18
2016-04-17T19:39:28.000Z
2020-11-19T06:55:20.000Z
python/tHome/sma/test/gridRelayStatus.py
ZigmundRat/T-Home
5dc8689f52d87dac890051e540b338b009293ced
[ "BSD-2-Clause" ]
6
2016-10-31T13:53:45.000Z
2019-03-20T20:47:03.000Z
python/tHome/sma/test/gridRelayStatus.py
ZigmundRat/T-Home
5dc8689f52d87dac890051e540b338b009293ced
[ "BSD-2-Clause" ]
12
2016-10-31T12:29:08.000Z
2021-12-28T12:18:28.000Z
import unittest from FakeSocket import FakeSocket import tHome as T #=========================================================================== #=========================================================================== class TestGridRelayStatus ( T.util.test.Case ) : def test_GridRelayStatus( self ): reply = """ 53 4D 41 00 00 04 02 A0 00 00 00 01 00 4E 00 10 60 65 13 90 7D 00 AB 94 40 3B 00 A0 F7 00 E0 27 06 72 00 00 00 00 00 00 0A 80 01 02 80 51 06 00 00 00 06 00 00 00 01 64 41 08 85 22 AF 53 33 00 00 01 37 01 00 00 FD FF FF 00 FE FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 """ l = T.sma.Link( "fake", connect=False ) try: l.socket = FakeSocket( T.util.hex.toBytes( reply ) ) o1 = l.gridRelayStatus() l.decode = False buf, decoder = l.gridRelayStatus() o2 = decoder( buf ) finally: l.socket = None right = T.util.Data( gridStatus = 'Closed', ) print o1 for k in right.keys(): r = right[k] self.eq( getattr( o1, k ), r, k ) self.eq( getattr( o2, k ), r, k ) #===========================================================================
27.488889
76
0.459984
182
1,237
3.120879
0.450549
0.239437
0.274648
0.295775
0.09507
0.09507
0.073944
0.073944
0.073944
0.073944
0
0.199773
0.287793
1,237
44
77
28.113636
0.444949
0.181892
0
0
0
0
0.302279
0
0
0
0
0
0
0
null
null
0
0.088235
null
null
0.029412
0
0
0
null
1
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
0
1
0
0
0
0
0
0
0
0
5
57f8984ca64650187c1a74930a275f25c5c77c2b
531
py
Python
src/repositories/git_repository.py
anwaramoon/gitops-connector
3939b1cae147e4f0b80a4b77cb23fd252d02e21d
[ "MIT" ]
24
2021-07-22T23:13:30.000Z
2022-03-30T00:11:07.000Z
src/repositories/git_repository.py
anwaramoon/gitops-connector
3939b1cae147e4f0b80a4b77cb23fd252d02e21d
[ "MIT" ]
6
2021-07-29T22:45:24.000Z
2022-02-18T02:09:25.000Z
src/repositories/git_repository.py
anwaramoon/gitops-connector
3939b1cae147e4f0b80a4b77cb23fd252d02e21d
[ "MIT" ]
4
2021-09-09T20:30:39.000Z
2022-03-24T14:30:31.000Z
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. from abc import ABC, abstractmethod class GitRepositoryInterface(ABC): @abstractmethod def post_commit_status(self, commit_status): pass @abstractmethod def get_pr_num(self, commit_id) -> str: pass @abstractmethod def get_pr_metadata(self, commit_id): pass @abstractmethod def get_prs(self, pr_status): pass @abstractmethod def get_commit_message(self, commit_id): pass
18.964286
48
0.679849
62
531
5.596774
0.467742
0.244957
0.242075
0.276657
0.253602
0
0
0
0
0
0
0
0.250471
531
27
49
19.666667
0.871859
0.12806
0
0.588235
0
0
0
0
0
0
0
0
0
1
0.294118
false
0.294118
0.058824
0
0.411765
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
5
17d850af67b17f539d213fce4afe9cc8490bec3d
83
py
Python
models/regression/adv_efficientnet_late/__init__.py
neurips2021vat/Variance-Aware-Training
2dcd017ef06e81e299448bdd9da65fa682835127
[ "BSD-2-Clause" ]
null
null
null
models/regression/adv_efficientnet_late/__init__.py
neurips2021vat/Variance-Aware-Training
2dcd017ef06e81e299448bdd9da65fa682835127
[ "BSD-2-Clause" ]
null
null
null
models/regression/adv_efficientnet_late/__init__.py
neurips2021vat/Variance-Aware-Training
2dcd017ef06e81e299448bdd9da65fa682835127
[ "BSD-2-Clause" ]
null
null
null
from models.regression.adv_efficientnet_late.model import Model # pyflakes.ignore
41.5
82
0.855422
11
83
6.272727
0.909091
0
0
0
0
0
0
0
0
0
0
0
0.084337
83
1
83
83
0.907895
0.180723
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
aa0f9f6f5b2dc34ab2da175df2fecf281e834ce2
89
py
Python
demos/mixed/01-cshlib-cxxprogram/scripts/asd/test2.py
pustotnik/raven
adb75d04a1ce719266eb34c29b35151dfaf91a8a
[ "BSD-3-Clause" ]
2
2019-10-14T05:05:34.000Z
2022-03-28T04:55:00.000Z
demos/mixed/01-cshlib-cxxprogram/scripts/asd/test2.py
pustotnik/raven
adb75d04a1ce719266eb34c29b35151dfaf91a8a
[ "BSD-3-Clause" ]
42
2020-08-25T07:59:32.000Z
2021-11-15T03:12:29.000Z
demos/mixed/01-cshlib-cxxprogram/scripts/asd/test2.py
pustotnik/raven
adb75d04a1ce719266eb34c29b35151dfaf91a8a
[ "BSD-3-Clause" ]
1
2021-08-13T13:59:51.000Z
2021-08-13T13:59:51.000Z
#!/usr/bin/env python # encoding: utf-8 import sys import os print("it is a test #2!")
11.125
25
0.662921
17
89
3.470588
0.941176
0
0
0
0
0
0
0
0
0
0
0.027397
0.179775
89
7
26
12.714286
0.780822
0.404494
0
0
0
0
0.313725
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0.333333
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
a4cbc62e32fe7ba361ba689c40b9fc79ce706f15
1,070
py
Python
benchmarks/Evolution/both/evolution/trait_cards/__init__.py
nuprl/retic_performance
621211c2f40251ce5364c33e72e4067e34a32013
[ "MIT" ]
3
2018-08-03T02:41:29.000Z
2021-03-19T03:18:47.000Z
benchmarks/Evolution/both/evolution/trait_cards/__init__.py
nuprl/retic_performance
621211c2f40251ce5364c33e72e4067e34a32013
[ "MIT" ]
3
2018-02-04T17:53:56.000Z
2018-11-10T17:06:57.000Z
benchmarks/Evolution/both/evolution/trait_cards/__init__.py
nuprl/retic_performance
621211c2f40251ce5364c33e72e4067e34a32013
[ "MIT" ]
1
2018-08-04T00:14:12.000Z
2018-08-04T00:14:12.000Z
from evolution.trait_cards.cards import TraitCard from evolution.trait_cards.ambush import AmbushCard from evolution.trait_cards.burrowing import BurrowingCard from evolution.trait_cards.carnivore import CarnivoreCard from evolution.trait_cards.climbing import ClimbingCard from evolution.trait_cards.cooperation import CooperationCard from evolution.trait_cards.fat_tissue import FatTissueCard from evolution.trait_cards.foraging import ForagingCard from evolution.trait_cards.hard_shell import HardShellCard from evolution.trait_cards.herding import HerdingCard from evolution.trait_cards.horn import HornCard from evolution.trait_cards.herding import HerdingCard from evolution.trait_cards.long_neck import LongNeckCard from evolution.trait_cards.pack_hunting import PackHuntingCard from evolution.trait_cards.fertile import FertileCard from evolution.trait_cards.foraging import ForagingCard from evolution.trait_cards.scavenger import ScavengerCard from evolution.trait_cards.symbiosis import SymbiosisCard from evolution.trait_cards.warning import WarningCallCard
53.5
62
0.893458
137
1,070
6.810219
0.306569
0.264737
0.366559
0.468382
0.304394
0.304394
0.304394
0.304394
0.304394
0.304394
0
0
0.071028
1,070
19
63
56.315789
0.938632
0
0
0.210526
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
1
0
0
0
0
5
a4d7bba4e1b684ec99548e1e1f79bba351aeb43c
64
py
Python
tests/functional/services/catalog/utils/api/__init__.py
rbrady/anchore-engine
5a5c492d76b5f911e60be422912fe8d42a74872b
[ "Apache-2.0" ]
1,484
2017-09-11T19:08:42.000Z
2022-03-29T07:47:44.000Z
tests/functional/services/catalog/utils/api/__init__.py
rbrady/anchore-engine
5a5c492d76b5f911e60be422912fe8d42a74872b
[ "Apache-2.0" ]
913
2017-09-27T20:37:53.000Z
2022-03-29T17:21:28.000Z
tests/functional/services/catalog/utils/api/__init__.py
rbrady/anchore-engine
5a5c492d76b5f911e60be422912fe8d42a74872b
[ "Apache-2.0" ]
294
2017-09-12T16:54:03.000Z
2022-03-14T01:28:51.000Z
from tests.functional.services.catalog.utils.api import objects
32
63
0.859375
9
64
6.111111
1
0
0
0
0
0
0
0
0
0
0
0
0.0625
64
1
64
64
0.916667
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
a4ea0829edc5a293b23023f1c51bfec507b7136a
154
py
Python
libactors/aio/multiwaiter/__init__.py
DanielSolomon/libactors
b4e7147ccb3cee2e52bac7cefc65a51a549d5dd7
[ "MIT" ]
1
2021-10-03T19:33:33.000Z
2021-10-03T19:33:33.000Z
libactors/aio/multiwaiter/__init__.py
DanielSolomon/libactors
b4e7147ccb3cee2e52bac7cefc65a51a549d5dd7
[ "MIT" ]
null
null
null
libactors/aio/multiwaiter/__init__.py
DanielSolomon/libactors
b4e7147ccb3cee2e52bac7cefc65a51a549d5dd7
[ "MIT" ]
null
null
null
from . import exceptions from .multiwaiter import MultiWaiter, in_multi_waiter __all__ = [ 'exceptions', 'MultiWaiter', 'in_multi_waiter', ]
17.111111
53
0.714286
16
154
6.375
0.5
0.254902
0.352941
0.470588
0
0
0
0
0
0
0
0
0.188312
154
8
54
19.25
0.816
0
0
0
0
0
0.233766
0
0
0
0
0
0
1
0
false
0
0.285714
0
0.285714
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
35007d4e72a53a194415617d129c65c56e436556
3,666
py
Python
src/genie/libs/parser/asa/tests/ShowRoute/cli/equal/golden_output_4_expected.py
balmasea/genieparser
d1e71a96dfb081e0a8591707b9d4872decd5d9d3
[ "Apache-2.0" ]
null
null
null
src/genie/libs/parser/asa/tests/ShowRoute/cli/equal/golden_output_4_expected.py
balmasea/genieparser
d1e71a96dfb081e0a8591707b9d4872decd5d9d3
[ "Apache-2.0" ]
null
null
null
src/genie/libs/parser/asa/tests/ShowRoute/cli/equal/golden_output_4_expected.py
balmasea/genieparser
d1e71a96dfb081e0a8591707b9d4872decd5d9d3
[ "Apache-2.0" ]
null
null
null
expected_output = { "vrf": { "default": { "address_family": { "ipv4": { "routes": { "0.0.0.0/0": { "candidate_default": True, "active": True, "route": "0.0.0.0/0", "source_protocol_codes": "S", "source_protocol": "static", "metric": 0, "route_preference": 1, "next_hop": { "next_hop_list": { 1: { "index": 1, "next_hop": "192.2.0.1", "outgoing_interface_name": "Outside-Port-Channel" } } } }, "1.1.1.0/24": { "candidate_default": False, "active": True, "date": "2d19h", "route": "1.1.1.0/24", "source_protocol_codes": "B", "source_protocol": "bgp", "metric": 0, "route_preference": 20, "next_hop": { "next_hop_list": { 1: { "index": 1, "next_hop": "10.98.126.1" } } } }, "4.33.104.119/32": { "candidate_default": False, "active": True, "date": "2d19h", "route": "4.33.104.119/32", "source_protocol_codes": "B", "source_protocol": "bgp", "metric": 0, "route_preference": 20, "next_hop": { "next_hop_list": { 1: { "index": 1, "next_hop": "10.98.126.1" } } } }, }, "tunneled_routes": { "0.0.0.0/0": { "candidate_default": False, "active": True, "route": "0.0.0.0/0", "source_protocol_codes": "S", "source_protocol": "static", "metric": 0, "route_preference": 255, "next_hop": { "next_hop_list": { 1: { "index": 1, "next_hop": "10.98.126.1", "outgoing_interface_name": "Inside-Port-Channel" } } } } } } } } } }
42.627907
89
0.219313
194
3,666
3.92268
0.262887
0.04205
0.047306
0.04205
0.816032
0.764783
0.764783
0.764783
0.575558
0.575558
0
0.095938
0.684397
3,666
86
90
42.627907
0.561798
0
0
0.523256
0
0
0.213253
0.035451
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
0
0
1
1
1
1
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
35037ce3e7ee45542233a6b60bf8145cf80e5d28
888
py
Python
critters/migrations/0004_auto_20200418_1312.py
cfletcher1856/acnhcritters
7cf7910d23c80d589ec471822f9cb15826eff4c6
[ "Apache-2.0" ]
null
null
null
critters/migrations/0004_auto_20200418_1312.py
cfletcher1856/acnhcritters
7cf7910d23c80d589ec471822f9cb15826eff4c6
[ "Apache-2.0" ]
5
2021-03-19T03:04:16.000Z
2021-06-10T19:09:33.000Z
critters/migrations/0004_auto_20200418_1312.py
cfletcher1856/acnhcritters
7cf7910d23c80d589ec471822f9cb15826eff4c6
[ "Apache-2.0" ]
null
null
null
# Generated by Django 3.0.5 on 2020-04-18 18:12 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('critters', '0003_auto_20200418_1306'), ] operations = [ migrations.AlterField( model_name='bug', name='end_time', field=models.IntegerField(default=0, null=True), ), migrations.AlterField( model_name='bug', name='start_time', field=models.IntegerField(default=0, null=True), ), migrations.AlterField( model_name='fish', name='end_time', field=models.IntegerField(default=0, null=True), ), migrations.AlterField( model_name='fish', name='start_time', field=models.IntegerField(default=0, null=True), ), ]
26.117647
60
0.558559
89
888
5.449438
0.426966
0.164948
0.206186
0.239175
0.68866
0.68866
0.616495
0.616495
0.616495
0.616495
0
0.05814
0.322072
888
33
61
26.909091
0.747508
0.050676
0
0.740741
1
0
0.096314
0.027348
0
0
0
0
0
1
0
false
0
0.037037
0
0.148148
0
0
0
0
null
0
1
1
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
1091393c9e2ab6f1fe65a264d09005ed45675245
108
py
Python
data_structures/double_ended_queue.py
maneeshd/Algorithms-and-DataStructures
5c50de586657f0135edaa2e624dfe2648c9c4eef
[ "MIT" ]
null
null
null
data_structures/double_ended_queue.py
maneeshd/Algorithms-and-DataStructures
5c50de586657f0135edaa2e624dfe2648c9c4eef
[ "MIT" ]
null
null
null
data_structures/double_ended_queue.py
maneeshd/Algorithms-and-DataStructures
5c50de586657f0135edaa2e624dfe2648c9c4eef
[ "MIT" ]
null
null
null
""" Author: Maneesh D <maneeshd77@gmail.com> Double-Ended-Queue """ from __future__ import absolute_import
15.428571
40
0.768519
14
108
5.571429
0.928571
0
0
0
0
0
0
0
0
0
0
0.020833
0.111111
108
6
41
18
0.791667
0.555556
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
109d6498891c135578873c0f24ec0b90ac89cfb2
50
py
Python
python/testData/inspections/PyAsyncCallInspection/ScheduleTask37/asyncio/tasks.py
jnthn/intellij-community
8fa7c8a3ace62400c838e0d5926a7be106aa8557
[ "Apache-2.0" ]
2
2019-04-28T07:48:50.000Z
2020-12-11T14:18:08.000Z
python/testData/inspections/PyAsyncCallInspection/ScheduleTask37/asyncio/tasks.py
Cyril-lamirand/intellij-community
60ab6c61b82fc761dd68363eca7d9d69663cfa39
[ "Apache-2.0" ]
173
2018-07-05T13:59:39.000Z
2018-08-09T01:12:03.000Z
python/testData/inspections/PyAsyncCallInspection/ScheduleTask37/asyncio/tasks.py
Cyril-lamirand/intellij-community
60ab6c61b82fc761dd68363eca7d9d69663cfa39
[ "Apache-2.0" ]
2
2020-03-15T08:57:37.000Z
2020-04-07T04:48:14.000Z
class Task: def __await__(self): pass
12.5
24
0.58
6
50
4.166667
1
0
0
0
0
0
0
0
0
0
0
0
0.34
50
4
25
12.5
0.757576
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0.333333
0
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
5