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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b537739617a21508d568b050d0f6898356a3b203
| 136
|
py
|
Python
|
02_Python_POO/Aula_080/main.py
|
Joao-Inacio/Curso-de-Python3
|
179d85f43f77dced640ffb143a87214538254cf3
|
[
"MIT"
] | 1
|
2021-07-19T12:31:49.000Z
|
2021-07-19T12:31:49.000Z
|
02_Python_POO/Aula_080/main.py
|
Joao-Inacio/Curso-de-Python3
|
179d85f43f77dced640ffb143a87214538254cf3
|
[
"MIT"
] | null | null | null |
02_Python_POO/Aula_080/main.py
|
Joao-Inacio/Curso-de-Python3
|
179d85f43f77dced640ffb143a87214538254cf3
|
[
"MIT"
] | null | null | null |
"""
Herança Simples (Tira dúvidas)
"""
from Aula_080.classes.interface import Interface
i1 = Interface()
i1.metodo_da_interface()
| 15.111111
| 48
| 0.735294
| 17
| 136
| 5.705882
| 0.764706
| 0.226804
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.043103
| 0.147059
| 136
| 8
| 49
| 17
| 0.793103
| 0.220588
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 1
| 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
|
b537e46bdb4cb4d76cc2c04c91347ada96b151e7
| 1,115
|
py
|
Python
|
01_Language/05_Python/study/lesson_06/19.Python的标准库.py
|
cliff363825/TwentyFour
|
09df59bd5d275e66463e343647f46027397d1233
|
[
"MIT"
] | 3
|
2020-06-28T07:42:51.000Z
|
2021-01-15T10:32:11.000Z
|
01_Language/05_Python/study/lesson_06/19.Python的标准库.py
|
cliff363825/TwentyFour
|
09df59bd5d275e66463e343647f46027397d1233
|
[
"MIT"
] | 9
|
2021-03-10T22:45:40.000Z
|
2022-02-27T06:53:20.000Z
|
01_Language/05_Python/study/lesson_06/19.Python的标准库.py
|
cliff363825/TwentyFour
|
09df59bd5d275e66463e343647f46027397d1233
|
[
"MIT"
] | 1
|
2021-01-15T10:51:24.000Z
|
2021-01-15T10:51:24.000Z
|
# 开箱即用
# 为了实现开箱即用的思想,Python中为我们提供了一个模块的标准库
# 在这个标准库中,有很多很强大的模块我们可以直接使用,
# 并且标准库会随Python的安装一同安装
# sys模块,它里面提供了一些变量和函数,使我们可以获取到Python解析器的信息
# 或者通过函数来操作Python解析器
# 引入sys模块
import sys
# pprint 模块它给我们提供了一个方法 pprint() 该方法可以用来对打印的数据做简单的格式化
import pprint
# sys.argv
# 获取执行代码时,命令行中所包含的参数
# 该属性是一个列表,列表中保存了当前命令的所有参数
# print(sys.argv)
# sys.modules
# 获取当前程序中引入的所有模块
# modules是一个字典,字典的key是模块的名字,字典的value是模块对象
# pprint.pprint(sys.modules)
# sys.path
# 他是一个列表,列表中保存的是模块的搜索路径
# ['C:\\Users\\lilichao\\Desktop\\resource\\course\\lesson_06\\code',
# 'C:\\dev\\python\\python36\\python36.zip',
# 'C:\\dev\\python\\python36\\DLLs',
# 'C:\\dev\\python\\python36\\lib',
# 'C:\\dev\\python\\python36',
# 'C:\\dev\\python\\python36\\lib\\site-packages']
# pprint.pprint(sys.path)
# sys.platform
# 表示当前Python运行的平台
# print(sys.platform)
# sys.exit()
# 函数用来退出程序
# sys.exit('程序出现异常,结束!')
# print('hello')
# os 模块让我们可以对操作系统进行访问
import os
# os.environ
# 通过这个属性可以获取到系统的环境变量
# pprint.pprint(os.environ['path'])
# os.system()
# 可以用来执行操作系统的名字
# os.system('dir')
os.system('notepad')
| 21.037736
| 70
| 0.695067
| 118
| 1,115
| 6.559322
| 0.525424
| 0.02584
| 0.064599
| 0.116279
| 0.054264
| 0
| 0
| 0
| 0
| 0
| 0
| 0.014568
| 0.138117
| 1,115
| 52
| 71
| 21.442308
| 0.790843
| 0.824215
| 0
| 0
| 0
| 0
| 0.067308
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.75
| 0
| 0.75
| 0.25
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
b55a59df1c758a91020cf8b36cb7f38179ca1ba9
| 272
|
py
|
Python
|
Python/easy/e370.py
|
tlgs/dailyprogrammer
|
6e7d3352616fa54a8e9caf8564a9cfb951eb0af9
|
[
"Unlicense"
] | 4
|
2017-10-18T02:17:02.000Z
|
2022-02-02T01:19:02.000Z
|
Python/easy/e370.py
|
tlseabra/dailyprogrammer
|
6e7d3352616fa54a8e9caf8564a9cfb951eb0af9
|
[
"Unlicense"
] | 4
|
2016-01-24T20:30:02.000Z
|
2017-01-18T16:01:23.000Z
|
Python/easy/e370.py
|
tlgs/dailyprogrammer
|
6e7d3352616fa54a8e9caf8564a9cfb951eb0af9
|
[
"Unlicense"
] | null | null | null |
# 07/01/2019
def upc(n):
digits = [int(x) for x in f'{n:011}']
M = (sum(digits[0::2]) * 3 + sum(digits[1::2])) % 10
return 0 if M == 0 else 10 - M
assert upc(4210000526) == 4
assert upc(3600029145) == 2
assert upc(12345678910) == 4
assert upc(1234567) == 0
| 20.923077
| 56
| 0.580882
| 50
| 272
| 3.16
| 0.58
| 0.227848
| 0.126582
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.303318
| 0.224265
| 272
| 12
| 57
| 22.666667
| 0.445498
| 0.036765
| 0
| 0
| 0
| 0
| 0.026923
| 0
| 0
| 0
| 0
| 0
| 0.5
| 1
| 0.125
| false
| 0
| 0
| 0
| 0.25
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
a91f0c58e5f172290aabe2d0d4946890bd868fc0
| 631
|
py
|
Python
|
python_api/primitive/primitive.py
|
openNGP/openNGP
|
085d6e2f94fcdc5c1c15a62027d31b31398842bb
|
[
"MIT"
] | 3
|
2022-03-04T09:16:20.000Z
|
2022-03-19T02:57:01.000Z
|
python_api/primitive/primitive.py
|
openNGP/openNGP
|
085d6e2f94fcdc5c1c15a62027d31b31398842bb
|
[
"MIT"
] | 2
|
2022-03-08T10:54:47.000Z
|
2022-03-11T08:58:18.000Z
|
python_api/primitive/primitive.py
|
openNGP/openNGP
|
085d6e2f94fcdc5c1c15a62027d31b31398842bb
|
[
"MIT"
] | null | null | null |
import numpy as np
from abc import ABC
class Primitive(ABC):
def __init__(self) -> None:
super().__init__()
def query(self, xyzs):
return np.array([])
def query_sigma(self, xyzs):
return np.array([])
def query_color(self, geo_features, views):
return np.array([])
def build_module_graph(self, module_key, module):
pass
def to(self, device):
raise NotImplementedError
def parameters(self):
raise NotImplementedError
def export(self):
raise NotImplementedError
def load(self, state_dict):
raise NotImplementedError
| 19.71875
| 53
| 0.63233
| 74
| 631
| 5.189189
| 0.486486
| 0.25
| 0.101563
| 0.125
| 0.151042
| 0.151042
| 0.151042
| 0
| 0
| 0
| 0
| 0
| 0.272583
| 631
| 31
| 54
| 20.354839
| 0.836601
| 0
| 0
| 0.333333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.428571
| false
| 0.047619
| 0.095238
| 0.142857
| 0.714286
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
a92802bd56d016f3f8a00477634b2dd486d5cb7a
| 140
|
py
|
Python
|
Circlearea.py
|
xreegnax/myCaptain
|
acc4a1f4dd8891985cf5b30ab977334349ca5b0c
|
[
"MIT"
] | null | null | null |
Circlearea.py
|
xreegnax/myCaptain
|
acc4a1f4dd8891985cf5b30ab977334349ca5b0c
|
[
"MIT"
] | null | null | null |
Circlearea.py
|
xreegnax/myCaptain
|
acc4a1f4dd8891985cf5b30ab977334349ca5b0c
|
[
"MIT"
] | null | null | null |
r = float(input ("Input the radius of the circle : "))
print ("The area of the circle with radius " + str(r) + " is: " + str((22/7) * r*r))
| 46.666667
| 84
| 0.592857
| 25
| 140
| 3.32
| 0.56
| 0.120482
| 0.26506
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.027273
| 0.214286
| 140
| 2
| 85
| 70
| 0.727273
| 0
| 0
| 0
| 0
| 0
| 0.521429
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.5
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
a943faf57d613ad7c286c93fabe777eaad3088ba
| 247
|
py
|
Python
|
leanerp/erpadmin/views.py
|
seLain/Leaf
|
f02e15576071429a29f76a06328d024b58a2d69e
|
[
"Apache-2.0"
] | null | null | null |
leanerp/erpadmin/views.py
|
seLain/Leaf
|
f02e15576071429a29f76a06328d024b58a2d69e
|
[
"Apache-2.0"
] | 6
|
2018-02-20T13:59:07.000Z
|
2018-03-06T17:35:41.000Z
|
leanerp/erpadmin/views.py
|
seLain/Leaf
|
f02e15576071429a29f76a06328d024b58a2d69e
|
[
"Apache-2.0"
] | 1
|
2018-03-06T17:28:07.000Z
|
2018-03-06T17:28:07.000Z
|
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
@login_required(login_url="/")
def index(request):
current_user = request.user
return render(request, 'erpadmin/index.html', {'user': current_user})
| 27.444444
| 70
| 0.789474
| 33
| 247
| 5.757576
| 0.575758
| 0.105263
| 0.189474
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.093117
| 247
| 9
| 70
| 27.444444
| 0.848214
| 0
| 0
| 0
| 0
| 0
| 0.096774
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| false
| 0
| 0.333333
| 0
| 0.666667
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
a95e11b95b2aefdf4d2f2c16e9e6dbfef63f432a
| 165
|
py
|
Python
|
wsgi.py
|
anardana/mf-analysis
|
23fdc4cf5d6751c6c6ace99a41bf2b14b3911a8c
|
[
"MIT"
] | null | null | null |
wsgi.py
|
anardana/mf-analysis
|
23fdc4cf5d6751c6c6ace99a41bf2b14b3911a8c
|
[
"MIT"
] | 2
|
2017-09-20T04:54:14.000Z
|
2017-09-20T04:55:34.000Z
|
wsgi.py
|
anardana/mf-analysis
|
23fdc4cf5d6751c6c6ace99a41bf2b14b3911a8c
|
[
"MIT"
] | null | null | null |
'''Server entry point for WSGI application (gunicorn)'''
from mf_analysis.api.controller import APP as application
if __name__ == "__main__":
application.run()
| 27.5
| 57
| 0.751515
| 21
| 165
| 5.47619
| 0.904762
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.139394
| 165
| 5
| 58
| 33
| 0.809859
| 0.30303
| 0
| 0
| 0
| 0
| 0.073395
| 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
|
a96f2c6fd60f2ba8bf338b1adfcb1dfc1fd76b2e
| 46
|
py
|
Python
|
staff/__init__.py
|
bobort/cheese
|
5200b6e1383c5c4eed02afde53e9a8389dfab743
|
[
"MIT"
] | null | null | null |
staff/__init__.py
|
bobort/cheese
|
5200b6e1383c5c4eed02afde53e9a8389dfab743
|
[
"MIT"
] | 28
|
2019-06-18T13:39:32.000Z
|
2021-10-05T22:54:12.000Z
|
staff/__init__.py
|
The-Politico/django-politico-staff
|
119c1cd3ba70d18e733d4c0cb2d4dc2f89be5428
|
[
"MIT"
] | null | null | null |
default_app_config = 'staff.apps.StaffConfig'
| 23
| 45
| 0.826087
| 6
| 46
| 6
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.065217
| 46
| 1
| 46
| 46
| 0.837209
| 0
| 0
| 0
| 0
| 0
| 0.478261
| 0.478261
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
8d17eb00d6354661e552e28b755028f966525ec4
| 8,899
|
py
|
Python
|
source/main/libs/actions/f0actions.py
|
NBRET-TOUCH-WASH/enter-the-homegeon
|
774d8bd2d201a85902af189338b0e17785f880b8
|
[
"MIT"
] | null | null | null |
source/main/libs/actions/f0actions.py
|
NBRET-TOUCH-WASH/enter-the-homegeon
|
774d8bd2d201a85902af189338b0e17785f880b8
|
[
"MIT"
] | 1
|
2021-11-06T05:02:27.000Z
|
2021-11-06T05:02:27.000Z
|
source/main/libs/actions/f0actions.py
|
NBRET-TOUCH-WASH/enter-the-homegeon
|
774d8bd2d201a85902af189338b0e17785f880b8
|
[
"MIT"
] | null | null | null |
"""
notes:
? docs:
? I said pick up the can.
§ TODO:
§ Amplify weapons on Wallhammer.
% FIXME:
% Target compromised: move in, move in.
& FIX:
& Overwatch, target one sterilized.
µ WHYNOT:
µ Overwatch reports possible hostiles inbound.
! IMPORTANT:
! Roger that. Waiting for contact. Over.
$ LOGS:
$ 28/10/2021
$ 01:54AM
$ don't really know where im going with this one
"""
#encoding
#coding:utf-8
#libraries/modules
import time
import libs.display.display as display
#libs setup
#classes
#functions
#[1]
#[2]
def hallway2_observe_painting():
print("\nYou stare intently at the painting hung on the wall to your left.\n")
time.sleep(2.0)
display.clearConsole()
print("""
~~ ================================================== ~~
|| .......:....:::.:............::::::::::::::::....: ||
|| .................................................. ||
|| .................................................. ||
|| ....................:*:**VVFFV*................... ||
|| ..................:.......*VFMMM*................. ||
|| .................V..........*FMMMV................ ||
|| *::.............*V........:.*FFMMF**:............. ||
|| *:::::::*:::::::VV..........*FFFMF**::::.......... ||
|| ********:******VVF*........:VFFFFMVV*****::::::::: ||
|| V***************VFF*......:*VFFFMFV*******::**:*:: ||
|| VV*V*******:::.*VFFFF*:***VVVVFFMFFV**********:::: ||
|| V****::::::::::*VVFFVV:......:VFFFFFV***:*:..::::: ||
|| *****::****VVVVVFFV*..........*V*VFFFV**.....:.::: ||
|| *****:..::***VVFV*............***VV**VVV*:.......: ||
|| *:***:*::::*VFFV*.............:::::**VFFFFV***:... ||
|| **::..:.:*VVFVV***:.........:*VVFVVFFMMMFFFV****:: ||
|| *V**:::::VVVVV*VVV**::*****VFMFFVVVV*VVVFFFVV***** ||
|| **:.....*VVVVVVVVVVVVV***VVFFFFFFVV**VFFFFFVVV**** ||
|| :***::*VVVVVVVVFVFVVVVVVVVFFFMMFVVFFFMFMFFFVVV**** ||
|| ****VVVVVV**VVFFFFFFVVVVFFFFFMMFFMMMFFMMMFFVVVV*** ||
|| **VVVVV*VV*VVFFFFFFFVVFFFFMMMMMMMMMMFMFFMMFFFVVV** ||
|| *VVVFV*******:....:*VVFFFFFMMMMMMMMMFFMMMMFFFFVVV* ||
|| *VVVFFVV*V***..........:*VFMMMMMMMMMMMMMFFFFFVFVV* ||
|| *FFFFMFFFFFFV*:...........:********VVFMMMFVFFFFVVV ||
|| VFFFFFFFMMMV:.....::....::***VVVVVVVFFFMMMMMMFFVV* ||
|| FMMMMMMMMFFV*:..:**VV***VVVVFMMMMMMMMMMNNMMMMFFFVV ||
|| FMMMFMMMMMFFFV*VFFFFVVVFFMMMMMMMNNNNNNNNNNMMMMFFFV ||
|| FMMMMMMMMMMMMMMMMMMFMMMMNNNNNNNN$NNNNNNNNNNMMMMMMF ||
|| FMMMMMMMMMMMMMMMMMMFMMMMMMNMMMMMMNNNNNNNNNNNMMMMMF ||
~~ ================================================== ~~\n
""")
time.sleep(2.0)
print("wow...\n")
time.sleep(1.5)
#input("(press any key to continue...) > ")
#[3]
#[4]
def bathroom_look_at_mirror():
print("\nYou look at the mirror.\n")
time.sleep(2.0)
print("You see yourself... As expected.\n")
time.sleep(2.0)
print("However... You also see something else...\n")
time.sleep(1.5)
print("It's there... It looks... Human?\n")
time.sleep(2.5)
print("No! It looks like someone, someone that's lost, that's sad, that's broke because of people they trusted...\nHow sad.")
time.sleep(1.5)
display.clearConsole()
print("""
......................................................................
......................................................................
..............................:::*VVVVVV::::..........................
..........................*VVMNNNN$$$$$$NNNNVVV:......................
......................*VMMNN$$$$$$$$$$$$$$$$$$NMV:....................
...................:*MNNN$$$$$$$$$$$$$$$$$$$$$$$NMM**:................
.................:VMN$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$NNV:..............
............:VVF$NN$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$NNV.............
...........FNN$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$NV.............
.........:FMN$$$$$NMMMMMN$$$$$$$$$$$$$$$$$$NMV*****FMN$NMF:...........
.........:$$$$NNM**:...:*MMM$$$$$$$$$$$$$NM*:.......:*$$$$:...........
.........:$$$NN*...........*$$$$$$$$$$$$$$M...........$$$$:...........
.........:$$$M:............*$$$$$$$$$$$$$NM...........$$$$:...........
.........:$$$M:...........:*$$$$$$$$$$$$$NNF*:.......:$$$$:...........
.........:$$$$N*..........VN$$$$$$$$$$$$$$$NNV......:*MN$$:...........
.........:VMNNNF*........*FN$$$$$$$$$$$$$$$$NNNNFVNNV..VMV:...........
...........MN$NNNMMV*****MNN$$$$$$$$$$$$$$$$$$$NNNN$NM.**.............
...........MN$$$$$$$$$$$$$$$$$$$$NMMNN$$MM$$$$$$$$$$NN:...............
...........*FN$$$$$$$$$$$$$$$$$$$NMV*FN$VF$$NNNNNNN$NNN*..............
............:VNN$$$$$NNFVVVVVM$$NN$NNNNNNNNVV*...:VMN$N*..............
..............:V$$$$$N*:..*VV:***VFF***:***.**.....FNNF:..............
...............:*MNN$N*:......:***VV**:.:*:.......:MNM................
..................*FN$$FVV*................*::V:*FNNF*................
...................*VNNNN$NNNV**.*V*.:**VV*..:***VV:..................
.....................::*FNN$$$NNMMV******VMMMFF*:.....................
.........................:**MMMMN$N$$$$$NMMM*:........................
................................**VN$$$$V:............................
...........................*MMMM*:...******M:.........................
............................:M$$NMMMMMN$$$$$*.........................
.............................FN$$$$$$$$$$$$$*.........................
..............................:VNNNN$$$$NNM*:.........................
..................................*VVVVVV*............................
......................................................................
......................................................................\n
""")
time.sleep(3.0)
print("You see them.\n")
time.sleep(3.0)
def bathroom_wash_hands():
print("\nYou wash your hands...\n")
time.sleep(2.0)
print("All clean! :D\n")
time.sleep(1.5)
#input("(press any key to continue...) > ")
def bathroom_pull_curtain():
print("\nYou get close to the shower curtain...\n")
time.sleep(2.0)
print("You slowly reach your hand out...\n")
time.sleep(2.0)
print("""
...............................::::...................................
............................:*********::..............................
........................::****************::..........................
......................:**********************:........................
....................:**************************:......................
.........:*****::..***********:::****************.....................
.........*****VVV*VVV******M$M*:*****************:....................
.........:*VVVVVV*VVVVV****VV*********************....................
..........:VVVVVVVVVVVVV**************************....::****:.........
.........*VVVVVVVVVVVVV***************************::**********:.......
..........:**VVVVVVVVVVVVVV************************************:......
..............:**VVVVVVVVVV**************************************.....
.................*************************************************....
...............:**************************************************:...
...........::****************VVVV**********************************...
........:**************************VVVV****************************:..
......:************************************************************:..
....:**************************************************************:..
...:***************************************************************...
..:***************************************************************:...
..:***************************************************************....
..:**************************************************************.....
..:*************************************************************......
...************************************************************.......
....:********************************************************:........
......*****************************************************:..........
........:***********************************************:.............
...........:***************************************::.................
...............:::***********V***********::::.........................
......................................................................
""")
print("SWOOSH!\n")
time.sleep(1.5)
print("You see a small squeaky duck in the shower.\nYou feel relieved.\n")
time.sleep(1.5)
#input("(press any key to continue...) > ")
#[5]
#[6]
def dining_sit():
print("\nA h , y e s .\n")
time.sleep(2.0)
print("F i n a l l y , t h e t i m e h a s c o m e :\n")
time.sleep(2.0)
print("T h e t i m e t o S I T .\n")
time.sleep(3.0)
print("You sit on one of the chairs around the dining room's table.\n")
time.sleep(3.0)
print("Your butt suddenly feels better.\n")
time.sleep(1.5)
#input("(press any key to continue...) > ")
#[7]
#[8]
#script
| 37.390756
| 129
| 0.280256
| 575
| 8,899
| 4.323478
| 0.455652
| 0.076026
| 0.080451
| 0.044248
| 0.170153
| 0.160499
| 0.098954
| 0.061142
| 0.061142
| 0.061142
| 0
| 0.007944
| 0.09473
| 8,899
| 238
| 130
| 37.390756
| 0.300397
| 0.084504
| 0
| 0.226667
| 0
| 0.013333
| 0.869121
| 0.742674
| 0
| 0
| 0
| 0.008403
| 0
| 1
| 0.033333
| true
| 0
| 0.013333
| 0
| 0.046667
| 0.146667
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
8d35fa809a2ac906ab6c7f3b7a0e3f3d14782b44
| 242
|
py
|
Python
|
setup.py
|
yyolk/tpm2-pytss
|
5485bf8c65834f8b16008895658007109e7822ad
|
[
"BSD-2-Clause"
] | 32
|
2019-11-04T15:53:27.000Z
|
2022-02-22T21:26:47.000Z
|
setup.py
|
yyolk/tpm2-pytss
|
5485bf8c65834f8b16008895658007109e7822ad
|
[
"BSD-2-Clause"
] | 285
|
2019-09-06T00:12:06.000Z
|
2022-03-22T10:33:00.000Z
|
setup.py
|
yyolk/tpm2-pytss
|
5485bf8c65834f8b16008895658007109e7822ad
|
[
"BSD-2-Clause"
] | 27
|
2019-09-06T14:45:21.000Z
|
2022-03-14T12:07:41.000Z
|
import site
import sys
from setuptools import setup
# workaround bug https://github.com/pypa/pip/issues/7953
site.ENABLE_USER_SITE = "--user" in sys.argv[1:]
setup(use_scm_version=True, cffi_modules=["scripts/libtss2_build.py:ffibuilder"])
| 26.888889
| 81
| 0.785124
| 38
| 242
| 4.842105
| 0.815789
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.027149
| 0.086777
| 242
| 8
| 82
| 30.25
| 0.80543
| 0.223141
| 0
| 0
| 0
| 0
| 0.22043
| 0.188172
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.6
| 0
| 0.6
| 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
|
8d5679fc4907ac430defdcbd74028da0963d652a
| 98
|
py
|
Python
|
ckeditor_api/apps.py
|
MelanieFJNR/Blitz-API
|
9a6daecd158fe07a6aeb80cbf586781eb688f0f9
|
[
"MIT"
] | 3
|
2019-10-22T00:16:49.000Z
|
2021-07-15T07:44:43.000Z
|
ckeditor_api/apps.py
|
MelanieFJNR/Blitz-API
|
9a6daecd158fe07a6aeb80cbf586781eb688f0f9
|
[
"MIT"
] | 1,183
|
2018-04-19T18:40:30.000Z
|
2022-03-31T21:05:05.000Z
|
ckeditor_api/apps.py
|
MelanieFJNR/Blitz-API
|
9a6daecd158fe07a6aeb80cbf586781eb688f0f9
|
[
"MIT"
] | 12
|
2018-04-17T19:16:42.000Z
|
2022-01-27T00:19:59.000Z
|
from django.apps import AppConfig
class CkeditorApiConfig(AppConfig):
name = 'ckeditor_api'
| 16.333333
| 35
| 0.77551
| 11
| 98
| 6.818182
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.153061
| 98
| 5
| 36
| 19.6
| 0.903614
| 0
| 0
| 0
| 0
| 0
| 0.122449
| 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
|
8d6b235f832a6f41bd39123f08009bfc04b7f055
| 60
|
py
|
Python
|
netpyneunit/models/backends/__init__.py
|
russelljjarvis/netpyneunit
|
3ead699cbee7bc8c55a1e432c79d68d82a2867e0
|
[
"MIT"
] | 1
|
2021-06-18T16:36:30.000Z
|
2021-06-18T16:36:30.000Z
|
netpyneunit/models/backends/__init__.py
|
russelljjarvis/netpyneunit
|
3ead699cbee7bc8c55a1e432c79d68d82a2867e0
|
[
"MIT"
] | 3
|
2021-06-18T15:21:23.000Z
|
2021-07-22T05:57:44.000Z
|
netpyneunit/models/backends/__init__.py
|
rgerkin/netpyneunit
|
44f31a7d2d1444a081c449c874cae39dc492b589
|
[
"MIT"
] | 2
|
2021-12-29T11:29:21.000Z
|
2022-01-05T04:57:11.000Z
|
import sciunit
from .netpyne_backend import NetpyneBackend
| 15
| 43
| 0.866667
| 7
| 60
| 7.285714
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.116667
| 60
| 3
| 44
| 20
| 0.962264
| 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
|
a5cb09da1d8e41879a042f541a7b00ce70431a5f
| 75
|
py
|
Python
|
project/client/__init__.py
|
TonSantos/naturA3.14
|
f311fe5e88e1ccfc6004ce4e3ede1301c4e81c75
|
[
"MIT"
] | null | null | null |
project/client/__init__.py
|
TonSantos/naturA3.14
|
f311fe5e88e1ccfc6004ce4e3ede1301c4e81c75
|
[
"MIT"
] | null | null | null |
project/client/__init__.py
|
TonSantos/naturA3.14
|
f311fe5e88e1ccfc6004ce4e3ede1301c4e81c75
|
[
"MIT"
] | null | null | null |
from .base import SemaceApiClient
from .connection import SemaceConnection
| 25
| 40
| 0.866667
| 8
| 75
| 8.125
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.106667
| 75
| 3
| 40
| 25
| 0.970149
| 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
|
a5f79f9e8948382e5b02f23b7cdb021466ad7f7d
| 316
|
py
|
Python
|
leetcode/0575_distribute_candies.py
|
jacquerie/leetcode
|
a05e6b832eb0e0740aaff7b2eb3109038ad404bf
|
[
"MIT"
] | 3
|
2018-05-10T09:56:49.000Z
|
2020-11-07T18:09:42.000Z
|
leetcode/0575_distribute_candies.py
|
jacquerie/leetcode
|
a05e6b832eb0e0740aaff7b2eb3109038ad404bf
|
[
"MIT"
] | null | null | null |
leetcode/0575_distribute_candies.py
|
jacquerie/leetcode
|
a05e6b832eb0e0740aaff7b2eb3109038ad404bf
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
class Solution:
def distributeCandies(self, candies):
return min(len(candies) / 2, len(set(candies)))
if __name__ == '__main__':
solution = Solution()
assert 3 == solution.distributeCandies([1, 1, 2, 2, 3, 3])
assert 2 == solution.distributeCandies([1, 1, 2, 3])
| 22.571429
| 62
| 0.617089
| 40
| 316
| 4.675
| 0.5
| 0.26738
| 0.278075
| 0.28877
| 0.299465
| 0
| 0
| 0
| 0
| 0
| 0
| 0.056225
| 0.212025
| 316
| 13
| 63
| 24.307692
| 0.694779
| 0.066456
| 0
| 0
| 0
| 0
| 0.027304
| 0
| 0
| 0
| 0
| 0
| 0.285714
| 1
| 0.142857
| false
| 0
| 0
| 0.142857
| 0.428571
| 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
| 1
| 0
| 0
|
0
| 4
|
a5f9f0ac0afc02cfb0f98d3dea487bde97e3a7c1
| 68
|
py
|
Python
|
src/greenbudget/app/template/__init__.py
|
nickmflorin/django-proper-architecture-testing
|
da7c4019697e85f921695144375d2f548f1e98ad
|
[
"MIT"
] | null | null | null |
src/greenbudget/app/template/__init__.py
|
nickmflorin/django-proper-architecture-testing
|
da7c4019697e85f921695144375d2f548f1e98ad
|
[
"MIT"
] | null | null | null |
src/greenbudget/app/template/__init__.py
|
nickmflorin/django-proper-architecture-testing
|
da7c4019697e85f921695144375d2f548f1e98ad
|
[
"MIT"
] | null | null | null |
default_app_config = 'greenbudget.app.template.apps.TemplateConfig'
| 34
| 67
| 0.852941
| 8
| 68
| 7
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.044118
| 68
| 1
| 68
| 68
| 0.861538
| 0
| 0
| 0
| 0
| 0
| 0.647059
| 0.647059
| 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
| 0
| 0
| 0
| 0
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
a5fcbf8048e7bc9074e1d3c362f9932b323ff70b
| 56
|
py
|
Python
|
src/main.py
|
jpa99/dependency-analyzer
|
827c43a9223cfed0fb20bec713d47bfa7d22cf19
|
[
"Unlicense"
] | null | null | null |
src/main.py
|
jpa99/dependency-analyzer
|
827c43a9223cfed0fb20bec713d47bfa7d22cf19
|
[
"Unlicense"
] | null | null | null |
src/main.py
|
jpa99/dependency-analyzer
|
827c43a9223cfed0fb20bec713d47bfa7d22cf19
|
[
"Unlicense"
] | null | null | null |
import cli
if __name__ == "__main__":
cli.parse_args()
| 14
| 26
| 0.714286
| 8
| 56
| 3.875
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.142857
| 56
| 4
| 27
| 14
| 0.645833
| 0
| 0
| 0
| 0
| 0
| 0.140351
| 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
|
57027a695cce35d9d1d94c63276fd677610f1123
| 129
|
py
|
Python
|
wiki1.py
|
Srinath-tr/Goferbot
|
0f734d01c6504c6c97dbdf45f5adf8b25c0f9fd9
|
[
"Apache-2.0",
"bzip2-1.0.6"
] | 1
|
2019-04-23T21:50:08.000Z
|
2019-04-23T21:50:08.000Z
|
wiki1.py
|
Srinath-tr/Goferbot
|
0f734d01c6504c6c97dbdf45f5adf8b25c0f9fd9
|
[
"Apache-2.0",
"bzip2-1.0.6"
] | null | null | null |
wiki1.py
|
Srinath-tr/Goferbot
|
0f734d01c6504c6c97dbdf45f5adf8b25c0f9fd9
|
[
"Apache-2.0",
"bzip2-1.0.6"
] | 2
|
2019-02-14T08:13:33.000Z
|
2019-04-23T21:47:48.000Z
|
import wikipedia
#def wiki_search(query):
p=wikipedia.page('virat kohli')
print(p)
print(p.url)
print(p.title)
print(p.content)
| 14.333333
| 31
| 0.751938
| 22
| 129
| 4.363636
| 0.636364
| 0.25
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.085271
| 129
| 8
| 32
| 16.125
| 0.813559
| 0.178295
| 0
| 0
| 0
| 0
| 0.104762
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.166667
| 0
| 0.166667
| 0.666667
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
5705d2e32429722c5ebb59fb4d63508118f1d9c6
| 30,702
|
py
|
Python
|
pyboto3/codestarnotifications.py
|
gehad-shaat/pyboto3
|
4a0c2851a8bc04fb1c71c36086f7bb257e48181d
|
[
"MIT"
] | 91
|
2016-12-31T11:38:37.000Z
|
2021-09-16T19:33:23.000Z
|
pyboto3/codestarnotifications.py
|
gehad-shaat/pyboto3
|
4a0c2851a8bc04fb1c71c36086f7bb257e48181d
|
[
"MIT"
] | 7
|
2017-01-02T18:54:23.000Z
|
2020-08-11T13:54:02.000Z
|
pyboto3/codestarnotifications.py
|
gehad-shaat/pyboto3
|
4a0c2851a8bc04fb1c71c36086f7bb257e48181d
|
[
"MIT"
] | 26
|
2016-12-31T13:11:00.000Z
|
2022-03-03T21:01:12.000Z
|
'''
The MIT License (MIT)
Copyright (c) 2016 WavyCloud
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
'''
def can_paginate(operation_name=None):
"""
Check if an operation can be paginated.
:type operation_name: string
:param operation_name: The operation name. This is the same name\nas the method name on the client. For example, if the\nmethod name is create_foo, and you\'d normally invoke the\noperation as client.create_foo(**kwargs), if the\ncreate_foo operation can be paginated, you can use the\ncall client.get_paginator('create_foo').
"""
pass
def create_notification_rule(Name=None, EventTypeIds=None, Resource=None, Targets=None, DetailType=None, ClientRequestToken=None, Tags=None, Status=None):
"""
Creates a notification rule for a resource. The rule specifies the events you want notifications about and the targets (such as SNS topics) where you want to receive them.
See also: AWS API Documentation
Exceptions
:example: response = client.create_notification_rule(
Name='string',
EventTypeIds=[
'string',
],
Resource='string',
Targets=[
{
'TargetType': 'string',
'TargetAddress': 'string'
},
],
DetailType='BASIC'|'FULL',
ClientRequestToken='string',
Tags={
'string': 'string'
},
Status='ENABLED'|'DISABLED'
)
:type Name: string
:param Name: [REQUIRED]\nThe name for the notification rule. Notifictaion rule names must be unique in your AWS account.\n
:type EventTypeIds: list
:param EventTypeIds: [REQUIRED]\nA list of event types associated with this notification rule. For a list of allowed events, see EventTypeSummary .\n\n(string) --\n\n
:type Resource: string
:param Resource: [REQUIRED]\nThe Amazon Resource Name (ARN) of the resource to associate with the notification rule. Supported resources include pipelines in AWS CodePipeline, repositories in AWS CodeCommit, and build projects in AWS CodeBuild.\n
:type Targets: list
:param Targets: [REQUIRED]\nA list of Amazon Resource Names (ARNs) of SNS topics to associate with the notification rule.\n\n(dict) --Information about the SNS topics associated with a notification rule.\n\nTargetType (string) --The target type. Can be an Amazon SNS topic.\n\nTargetAddress (string) --The Amazon Resource Name (ARN) of the SNS topic.\n\n\n\n\n
:type DetailType: string
:param DetailType: [REQUIRED]\nThe level of detail to include in the notifications for this resource. BASIC will include only the contents of the event as it would appear in AWS CloudWatch. FULL will include any supplemental information provided by AWS CodeStar Notifications and/or the service for the resource for which the notification is created.\n
:type ClientRequestToken: string
:param ClientRequestToken: A unique, client-generated idempotency token that, when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request with the same parameters is received and a token is included, the request returns information about the initial request that used that token.\n\nNote\nThe AWS SDKs prepopulate client request tokens. If you are using an AWS SDK, an idempotency token is created for you.\n\nThis field is autopopulated if not provided.\n
:type Tags: dict
:param Tags: A list of tags to apply to this notification rule. Key names cannot start with 'aws'.\n\n(string) --\n(string) --\n\n\n\n
:type Status: string
:param Status: The status of the notification rule. The default value is ENABLED. If the status is set to DISABLED, notifications aren\'t sent for the notification rule.
:rtype: dict
ReturnsResponse Syntax
{
'Arn': 'string'
}
Response Structure
(dict) --
Arn (string) --
The Amazon Resource Name (ARN) of the notification rule.
Exceptions
CodeStarNotifications.Client.exceptions.ResourceAlreadyExistsException
CodeStarNotifications.Client.exceptions.ValidationException
CodeStarNotifications.Client.exceptions.LimitExceededException
CodeStarNotifications.Client.exceptions.ConfigurationException
CodeStarNotifications.Client.exceptions.ConcurrentModificationException
CodeStarNotifications.Client.exceptions.AccessDeniedException
:return: {
'Arn': 'string'
}
:returns:
CodeStarNotifications.Client.exceptions.ResourceAlreadyExistsException
CodeStarNotifications.Client.exceptions.ValidationException
CodeStarNotifications.Client.exceptions.LimitExceededException
CodeStarNotifications.Client.exceptions.ConfigurationException
CodeStarNotifications.Client.exceptions.ConcurrentModificationException
CodeStarNotifications.Client.exceptions.AccessDeniedException
"""
pass
def delete_notification_rule(Arn=None):
"""
Deletes a notification rule for a resource.
See also: AWS API Documentation
Exceptions
:example: response = client.delete_notification_rule(
Arn='string'
)
:type Arn: string
:param Arn: [REQUIRED]\nThe Amazon Resource Name (ARN) of the notification rule you want to delete.\n
:rtype: dict
ReturnsResponse Syntax{
'Arn': 'string'
}
Response Structure
(dict) --
Arn (string) --The Amazon Resource Name (ARN) of the deleted notification rule.
Exceptions
CodeStarNotifications.Client.exceptions.ValidationException
CodeStarNotifications.Client.exceptions.LimitExceededException
CodeStarNotifications.Client.exceptions.ConcurrentModificationException
:return: {
'Arn': 'string'
}
"""
pass
def delete_target(TargetAddress=None, ForceUnsubscribeAll=None):
"""
Deletes a specified target for notifications.
See also: AWS API Documentation
Exceptions
:example: response = client.delete_target(
TargetAddress='string',
ForceUnsubscribeAll=True|False
)
:type TargetAddress: string
:param TargetAddress: [REQUIRED]\nThe Amazon Resource Name (ARN) of the SNS topic to delete.\n
:type ForceUnsubscribeAll: boolean
:param ForceUnsubscribeAll: A Boolean value that can be used to delete all associations with this SNS topic. The default value is FALSE. If set to TRUE, all associations between that target and every notification rule in your AWS account are deleted.
:rtype: dict
ReturnsResponse Syntax
{}
Response Structure
(dict) --
Exceptions
CodeStarNotifications.Client.exceptions.ValidationException
:return: {}
:returns:
(dict) --
"""
pass
def describe_notification_rule(Arn=None):
"""
Returns information about a specified notification rule.
See also: AWS API Documentation
Exceptions
:example: response = client.describe_notification_rule(
Arn='string'
)
:type Arn: string
:param Arn: [REQUIRED]\nThe Amazon Resource Name (ARN) of the notification rule.\n
:rtype: dict
ReturnsResponse Syntax{
'Arn': 'string',
'Name': 'string',
'EventTypes': [
{
'EventTypeId': 'string',
'ServiceName': 'string',
'EventTypeName': 'string',
'ResourceType': 'string'
},
],
'Resource': 'string',
'Targets': [
{
'TargetAddress': 'string',
'TargetType': 'string',
'TargetStatus': 'PENDING'|'ACTIVE'|'UNREACHABLE'|'INACTIVE'|'DEACTIVATED'
},
],
'DetailType': 'BASIC'|'FULL',
'CreatedBy': 'string',
'Status': 'ENABLED'|'DISABLED',
'CreatedTimestamp': datetime(2015, 1, 1),
'LastModifiedTimestamp': datetime(2015, 1, 1),
'Tags': {
'string': 'string'
}
}
Response Structure
(dict) --
Arn (string) --The Amazon Resource Name (ARN) of the notification rule.
Name (string) --The name of the notification rule.
EventTypes (list) --A list of the event types associated with the notification rule.
(dict) --Returns information about an event that has triggered a notification rule.
EventTypeId (string) --The system-generated ID of the event.
ServiceName (string) --The name of the service for which the event applies.
EventTypeName (string) --The name of the event.
ResourceType (string) --The resource type of the event.
Resource (string) --The Amazon Resource Name (ARN) of the resource associated with the notification rule.
Targets (list) --A list of the SNS topics associated with the notification rule.
(dict) --Information about the targets specified for a notification rule.
TargetAddress (string) --The Amazon Resource Name (ARN) of the SNS topic.
TargetType (string) --The type of the target (for example, SNS).
TargetStatus (string) --The status of the target.
DetailType (string) --The level of detail included in the notifications for this resource. BASIC will include only the contents of the event as it would appear in AWS CloudWatch. FULL will include any supplemental information provided by AWS CodeStar Notifications and/or the service for the resource for which the notification is created.
CreatedBy (string) --The name or email alias of the person who created the notification rule.
Status (string) --The status of the notification rule. Valid statuses are on (sending notifications) or off (not sending notifications).
CreatedTimestamp (datetime) --The date and time the notification rule was created, in timestamp format.
LastModifiedTimestamp (datetime) --The date and time the notification rule was most recently updated, in timestamp format.
Tags (dict) --The tags associated with the notification rule.
(string) --
(string) --
Exceptions
CodeStarNotifications.Client.exceptions.ResourceNotFoundException
CodeStarNotifications.Client.exceptions.ValidationException
:return: {
'Arn': 'string',
'Name': 'string',
'EventTypes': [
{
'EventTypeId': 'string',
'ServiceName': 'string',
'EventTypeName': 'string',
'ResourceType': 'string'
},
],
'Resource': 'string',
'Targets': [
{
'TargetAddress': 'string',
'TargetType': 'string',
'TargetStatus': 'PENDING'|'ACTIVE'|'UNREACHABLE'|'INACTIVE'|'DEACTIVATED'
},
],
'DetailType': 'BASIC'|'FULL',
'CreatedBy': 'string',
'Status': 'ENABLED'|'DISABLED',
'CreatedTimestamp': datetime(2015, 1, 1),
'LastModifiedTimestamp': datetime(2015, 1, 1),
'Tags': {
'string': 'string'
}
}
:returns:
CodeStarNotifications.Client.exceptions.ResourceNotFoundException
CodeStarNotifications.Client.exceptions.ValidationException
"""
pass
def generate_presigned_url(ClientMethod=None, Params=None, ExpiresIn=None, HttpMethod=None):
"""
Generate a presigned url given a client, its method, and arguments
:type ClientMethod: string
:param ClientMethod: The client method to presign for
:type Params: dict
:param Params: The parameters normally passed to\nClientMethod.
:type ExpiresIn: int
:param ExpiresIn: The number of seconds the presigned url is valid\nfor. By default it expires in an hour (3600 seconds)
:type HttpMethod: string
:param HttpMethod: The http method to use on the generated url. By\ndefault, the http method is whatever is used in the method\'s model.
"""
pass
def get_paginator(operation_name=None):
"""
Create a paginator for an operation.
:type operation_name: string
:param operation_name: The operation name. This is the same name\nas the method name on the client. For example, if the\nmethod name is create_foo, and you\'d normally invoke the\noperation as client.create_foo(**kwargs), if the\ncreate_foo operation can be paginated, you can use the\ncall client.get_paginator('create_foo').
:rtype: L{botocore.paginate.Paginator}
ReturnsA paginator object.
"""
pass
def get_waiter(waiter_name=None):
"""
Returns an object that can wait for some condition.
:type waiter_name: str
:param waiter_name: The name of the waiter to get. See the waiters\nsection of the service docs for a list of available waiters.
:rtype: botocore.waiter.Waiter
"""
pass
def list_event_types(Filters=None, NextToken=None, MaxResults=None):
"""
Returns information about the event types available for configuring notifications.
See also: AWS API Documentation
Exceptions
:example: response = client.list_event_types(
Filters=[
{
'Name': 'RESOURCE_TYPE'|'SERVICE_NAME',
'Value': 'string'
},
],
NextToken='string',
MaxResults=123
)
:type Filters: list
:param Filters: The filters to use to return information by service or resource type.\n\n(dict) --Information about a filter to apply to the list of returned event types. You can filter by resource type or service name.\n\nName (string) -- [REQUIRED]The system-generated name of the filter type you want to filter by.\n\nValue (string) -- [REQUIRED]The name of the resource type (for example, pipeline) or service name (for example, CodePipeline) that you want to filter by.\n\n\n\n\n
:type NextToken: string
:param NextToken: An enumeration token that, when provided in a request, returns the next batch of the results.
:type MaxResults: integer
:param MaxResults: A non-negative integer used to limit the number of returned results. The default number is 50. The maximum number of results that can be returned is 100.
:rtype: dict
ReturnsResponse Syntax
{
'EventTypes': [
{
'EventTypeId': 'string',
'ServiceName': 'string',
'EventTypeName': 'string',
'ResourceType': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
EventTypes (list) --
Information about each event, including service name, resource type, event ID, and event name.
(dict) --
Returns information about an event that has triggered a notification rule.
EventTypeId (string) --
The system-generated ID of the event.
ServiceName (string) --
The name of the service for which the event applies.
EventTypeName (string) --
The name of the event.
ResourceType (string) --
The resource type of the event.
NextToken (string) --
An enumeration token that can be used in a request to return the next batch of the results.
Exceptions
CodeStarNotifications.Client.exceptions.InvalidNextTokenException
CodeStarNotifications.Client.exceptions.ValidationException
:return: {
'EventTypes': [
{
'EventTypeId': 'string',
'ServiceName': 'string',
'EventTypeName': 'string',
'ResourceType': 'string'
},
],
'NextToken': 'string'
}
:returns:
CodeStarNotifications.Client.exceptions.InvalidNextTokenException
CodeStarNotifications.Client.exceptions.ValidationException
"""
pass
def list_notification_rules(Filters=None, NextToken=None, MaxResults=None):
"""
Returns a list of the notification rules for an AWS account.
See also: AWS API Documentation
Exceptions
:example: response = client.list_notification_rules(
Filters=[
{
'Name': 'EVENT_TYPE_ID'|'CREATED_BY'|'RESOURCE'|'TARGET_ADDRESS',
'Value': 'string'
},
],
NextToken='string',
MaxResults=123
)
:type Filters: list
:param Filters: The filters to use to return information by service or resource type. For valid values, see ListNotificationRulesFilter .\n\nNote\nA filter with the same name can appear more than once when used with OR statements. Filters with different names should be applied with AND statements.\n\n\n(dict) --Information about a filter to apply to the list of returned notification rules. You can filter by event type, owner, resource, or target.\n\nName (string) -- [REQUIRED]The name of the attribute you want to use to filter the returned notification rules.\n\nValue (string) -- [REQUIRED]The value of the attribute you want to use to filter the returned notification rules. For example, if you specify filtering by RESOURCE in Name, you might specify the ARN of a pipeline in AWS CodePipeline for the value.\n\n\n\n\n
:type NextToken: string
:param NextToken: An enumeration token that, when provided in a request, returns the next batch of the results.
:type MaxResults: integer
:param MaxResults: A non-negative integer used to limit the number of returned results. The maximum number of results that can be returned is 100.
:rtype: dict
ReturnsResponse Syntax
{
'NextToken': 'string',
'NotificationRules': [
{
'Id': 'string',
'Arn': 'string'
},
]
}
Response Structure
(dict) --
NextToken (string) --
An enumeration token that can be used in a request to return the next batch of the results.
NotificationRules (list) --
The list of notification rules for the AWS account, by Amazon Resource Name (ARN) and ID.
(dict) --
Information about a specified notification rule.
Id (string) --
The unique ID of the notification rule.
Arn (string) --
The Amazon Resource Name (ARN) of the notification rule.
Exceptions
CodeStarNotifications.Client.exceptions.InvalidNextTokenException
CodeStarNotifications.Client.exceptions.ValidationException
:return: {
'NextToken': 'string',
'NotificationRules': [
{
'Id': 'string',
'Arn': 'string'
},
]
}
:returns:
CodeStarNotifications.Client.exceptions.InvalidNextTokenException
CodeStarNotifications.Client.exceptions.ValidationException
"""
pass
def list_tags_for_resource(Arn=None):
"""
Returns a list of the tags associated with a notification rule.
See also: AWS API Documentation
Exceptions
:example: response = client.list_tags_for_resource(
Arn='string'
)
:type Arn: string
:param Arn: [REQUIRED]\nThe Amazon Resource Name (ARN) for the notification rule.\n
:rtype: dict
ReturnsResponse Syntax{
'Tags': {
'string': 'string'
}
}
Response Structure
(dict) --
Tags (dict) --The tags associated with the notification rule.
(string) --
(string) --
Exceptions
CodeStarNotifications.Client.exceptions.ResourceNotFoundException
CodeStarNotifications.Client.exceptions.ValidationException
:return: {
'Tags': {
'string': 'string'
}
}
:returns:
CodeStarNotifications.Client.exceptions.ResourceNotFoundException
CodeStarNotifications.Client.exceptions.ValidationException
"""
pass
def list_targets(Filters=None, NextToken=None, MaxResults=None):
"""
Returns a list of the notification rule targets for an AWS account.
See also: AWS API Documentation
Exceptions
:example: response = client.list_targets(
Filters=[
{
'Name': 'TARGET_TYPE'|'TARGET_ADDRESS'|'TARGET_STATUS',
'Value': 'string'
},
],
NextToken='string',
MaxResults=123
)
:type Filters: list
:param Filters: The filters to use to return information by service or resource type. Valid filters include target type, target address, and target status.\n\nNote\nA filter with the same name can appear more than once when used with OR statements. Filters with different names should be applied with AND statements.\n\n\n(dict) --Information about a filter to apply to the list of returned targets. You can filter by target type, address, or status. For example, to filter results to notification rules that have active Amazon SNS topics as targets, you could specify a ListTargetsFilter Name as TargetType and a Value of SNS, and a Name of TARGET_STATUS and a Value of ACTIVE.\n\nName (string) -- [REQUIRED]The name of the attribute you want to use to filter the returned targets.\n\nValue (string) -- [REQUIRED]The value of the attribute you want to use to filter the returned targets. For example, if you specify SNS for the Target type, you could specify an Amazon Resource Name (ARN) for a topic as the value.\n\n\n\n\n
:type NextToken: string
:param NextToken: An enumeration token that, when provided in a request, returns the next batch of the results.
:type MaxResults: integer
:param MaxResults: A non-negative integer used to limit the number of returned results. The maximum number of results that can be returned is 100.
:rtype: dict
ReturnsResponse Syntax
{
'Targets': [
{
'TargetAddress': 'string',
'TargetType': 'string',
'TargetStatus': 'PENDING'|'ACTIVE'|'UNREACHABLE'|'INACTIVE'|'DEACTIVATED'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Targets (list) --
The list of notification rule targets.
(dict) --
Information about the targets specified for a notification rule.
TargetAddress (string) --
The Amazon Resource Name (ARN) of the SNS topic.
TargetType (string) --
The type of the target (for example, SNS).
TargetStatus (string) --
The status of the target.
NextToken (string) --
An enumeration token that can be used in a request to return the next batch of results.
Exceptions
CodeStarNotifications.Client.exceptions.InvalidNextTokenException
CodeStarNotifications.Client.exceptions.ValidationException
:return: {
'Targets': [
{
'TargetAddress': 'string',
'TargetType': 'string',
'TargetStatus': 'PENDING'|'ACTIVE'|'UNREACHABLE'|'INACTIVE'|'DEACTIVATED'
},
],
'NextToken': 'string'
}
:returns:
CodeStarNotifications.Client.exceptions.InvalidNextTokenException
CodeStarNotifications.Client.exceptions.ValidationException
"""
pass
def subscribe(Arn=None, Target=None, ClientRequestToken=None):
"""
Creates an association between a notification rule and an SNS topic so that the associated target can receive notifications when the events described in the rule are triggered.
See also: AWS API Documentation
Exceptions
:example: response = client.subscribe(
Arn='string',
Target={
'TargetType': 'string',
'TargetAddress': 'string'
},
ClientRequestToken='string'
)
:type Arn: string
:param Arn: [REQUIRED]\nThe Amazon Resource Name (ARN) of the notification rule for which you want to create the association.\n
:type Target: dict
:param Target: [REQUIRED]\nInformation about the SNS topics associated with a notification rule.\n\nTargetType (string) --The target type. Can be an Amazon SNS topic.\n\nTargetAddress (string) --The Amazon Resource Name (ARN) of the SNS topic.\n\n\n
:type ClientRequestToken: string
:param ClientRequestToken: An enumeration token that, when provided in a request, returns the next batch of the results.
:rtype: dict
ReturnsResponse Syntax
{
'Arn': 'string'
}
Response Structure
(dict) --
Arn (string) --
The Amazon Resource Name (ARN) of the notification rule for which you have created assocations.
Exceptions
CodeStarNotifications.Client.exceptions.ValidationException
CodeStarNotifications.Client.exceptions.ResourceNotFoundException
:return: {
'Arn': 'string'
}
:returns:
CodeStarNotifications.Client.exceptions.ValidationException
CodeStarNotifications.Client.exceptions.ResourceNotFoundException
"""
pass
def tag_resource(Arn=None, Tags=None):
"""
Associates a set of provided tags with a notification rule.
See also: AWS API Documentation
Exceptions
:example: response = client.tag_resource(
Arn='string',
Tags={
'string': 'string'
}
)
:type Arn: string
:param Arn: [REQUIRED]\nThe Amazon Resource Name (ARN) of the notification rule to tag.\n
:type Tags: dict
:param Tags: [REQUIRED]\nThe list of tags to associate with the resource. Tag key names cannot start with 'aws'.\n\n(string) --\n(string) --\n\n\n\n
:rtype: dict
ReturnsResponse Syntax
{
'Tags': {
'string': 'string'
}
}
Response Structure
(dict) --
Tags (dict) --
The list of tags associated with the resource.
(string) --
(string) --
Exceptions
CodeStarNotifications.Client.exceptions.ResourceNotFoundException
CodeStarNotifications.Client.exceptions.ValidationException
CodeStarNotifications.Client.exceptions.ConcurrentModificationException
:return: {
'Tags': {
'string': 'string'
}
}
:returns:
(string) --
(string) --
"""
pass
def unsubscribe(Arn=None, TargetAddress=None):
"""
Removes an association between a notification rule and an Amazon SNS topic so that subscribers to that topic stop receiving notifications when the events described in the rule are triggered.
See also: AWS API Documentation
Exceptions
:example: response = client.unsubscribe(
Arn='string',
TargetAddress='string'
)
:type Arn: string
:param Arn: [REQUIRED]\nThe Amazon Resource Name (ARN) of the notification rule.\n
:type TargetAddress: string
:param TargetAddress: [REQUIRED]\nThe ARN of the SNS topic to unsubscribe from the notification rule.\n
:rtype: dict
ReturnsResponse Syntax
{
'Arn': 'string'
}
Response Structure
(dict) --
Arn (string) --
The Amazon Resource Name (ARN) of the the notification rule from which you have removed a subscription.
Exceptions
CodeStarNotifications.Client.exceptions.ValidationException
:return: {
'Arn': 'string'
}
:returns:
CodeStarNotifications.Client.exceptions.ValidationException
"""
pass
def untag_resource(Arn=None, TagKeys=None):
"""
Removes the association between one or more provided tags and a notification rule.
See also: AWS API Documentation
Exceptions
:example: response = client.untag_resource(
Arn='string',
TagKeys=[
'string',
]
)
:type Arn: string
:param Arn: [REQUIRED]\nThe Amazon Resource Name (ARN) of the notification rule from which to remove the tags.\n
:type TagKeys: list
:param TagKeys: [REQUIRED]\nThe key names of the tags to remove.\n\n(string) --\n\n
:rtype: dict
ReturnsResponse Syntax
{}
Response Structure
(dict) --
Exceptions
CodeStarNotifications.Client.exceptions.ResourceNotFoundException
CodeStarNotifications.Client.exceptions.ValidationException
CodeStarNotifications.Client.exceptions.ConcurrentModificationException
:return: {}
:returns:
(dict) --
"""
pass
def update_notification_rule(Arn=None, Name=None, Status=None, EventTypeIds=None, Targets=None, DetailType=None):
"""
Updates a notification rule for a resource. You can change the events that trigger the notification rule, the status of the rule, and the targets that receive the notifications.
See also: AWS API Documentation
Exceptions
:example: response = client.update_notification_rule(
Arn='string',
Name='string',
Status='ENABLED'|'DISABLED',
EventTypeIds=[
'string',
],
Targets=[
{
'TargetType': 'string',
'TargetAddress': 'string'
},
],
DetailType='BASIC'|'FULL'
)
:type Arn: string
:param Arn: [REQUIRED]\nThe Amazon Resource Name (ARN) of the notification rule.\n
:type Name: string
:param Name: The name of the notification rule.
:type Status: string
:param Status: The status of the notification rule. Valid statuses include enabled (sending notifications) or disabled (not sending notifications).
:type EventTypeIds: list
:param EventTypeIds: A list of event types associated with this notification rule.\n\n(string) --\n\n
:type Targets: list
:param Targets: The address and type of the targets to receive notifications from this notification rule.\n\n(dict) --Information about the SNS topics associated with a notification rule.\n\nTargetType (string) --The target type. Can be an Amazon SNS topic.\n\nTargetAddress (string) --The Amazon Resource Name (ARN) of the SNS topic.\n\n\n\n\n
:type DetailType: string
:param DetailType: The level of detail to include in the notifications for this resource. BASIC will include only the contents of the event as it would appear in AWS CloudWatch. FULL will include any supplemental information provided by AWS CodeStar Notifications and/or the service for the resource for which the notification is created.
:rtype: dict
ReturnsResponse Syntax
{}
Response Structure
(dict) --
Exceptions
CodeStarNotifications.Client.exceptions.ValidationException
CodeStarNotifications.Client.exceptions.ResourceNotFoundException
:return: {}
:returns:
(dict) --
"""
pass
| 27.961749
| 1,029
| 0.687349
| 3,603
| 30,702
| 5.83708
| 0.113794
| 0.016167
| 0.087965
| 0.023965
| 0.709904
| 0.677904
| 0.644715
| 0.627788
| 0.604013
| 0.585992
| 0
| 0.002199
| 0.229692
| 30,702
| 1,097
| 1,030
| 27.987238
| 0.887061
| 0.94831
| 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 | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
570fe80d365c3846bda0d7ad77799ce51ff9d57f
| 61
|
py
|
Python
|
src/tests/testwebapp/test_database/__init__.py
|
CreatingNull/UOS-Interface
|
2a81e67d02ca814c4c85a111f2770cf0abeb3427
|
[
"MIT"
] | 1
|
2020-11-30T05:22:30.000Z
|
2020-11-30T05:22:30.000Z
|
src/tests/testwebapp/test_database/__init__.py
|
CreatingNull/UART-Operating-System-Interface
|
1fdf0d60fe6646f09a93ac2fb3e0ed15be38c6f2
|
[
"MIT"
] | 43
|
2021-06-30T22:11:32.000Z
|
2022-03-28T22:16:06.000Z
|
src/tests/testwebapp/test_database/__init__.py
|
CreatingNull/UOS-Interface
|
2a81e67d02ca814c4c85a111f2770cf0abeb3427
|
[
"MIT"
] | null | null | null |
"""Package for testing the webapp database functionality."""
| 30.5
| 60
| 0.770492
| 7
| 61
| 6.714286
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.114754
| 61
| 1
| 61
| 61
| 0.87037
| 0.885246
| 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
|
572e122f861cd31c37d35c7751da62cc2256a1a0
| 152
|
py
|
Python
|
Strings/Whats Your Name.py
|
Code-With-Aagam/python-hackerrank
|
270c75cf2ca30916183c7fe5ca130a64c7a8ed6d
|
[
"MIT"
] | 3
|
2022-03-05T15:38:26.000Z
|
2022-03-09T13:39:30.000Z
|
Strings/Whats Your Name.py
|
Code-With-Aagam/python-hackerrank
|
270c75cf2ca30916183c7fe5ca130a64c7a8ed6d
|
[
"MIT"
] | null | null | null |
Strings/Whats Your Name.py
|
Code-With-Aagam/python-hackerrank
|
270c75cf2ca30916183c7fe5ca130a64c7a8ed6d
|
[
"MIT"
] | null | null | null |
def print_full_name(a, b):
first_name = a
last_name = b
print("Hello", first_name, last_name + "!", "You just delved into python.")
| 30.4
| 79
| 0.611842
| 23
| 152
| 3.782609
| 0.608696
| 0.114943
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.256579
| 152
| 5
| 79
| 30.4
| 0.769912
| 0
| 0
| 0
| 0
| 0
| 0.228188
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0
| 0
| 0.25
| 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
|
572fdba4515666f2446367a9c8a3e513ffabdce5
| 114
|
py
|
Python
|
Chatbot_Rest/Api/cws/cws_rest_view.py
|
guci314/Chatbot_CN
|
02044eed4a141aa8c61d6064c166f95dbdae894c
|
[
"Apache-2.0"
] | 8
|
2019-08-12T12:38:35.000Z
|
2022-02-21T03:25:04.000Z
|
Chatbot_Rest/Api/cws/cws_rest_view.py
|
JianboTang/Chatbot_CN
|
a0f7194252a189f8bc2b62fd16eb2abe432c0bf9
|
[
"Apache-2.0"
] | null | null | null |
Chatbot_Rest/Api/cws/cws_rest_view.py
|
JianboTang/Chatbot_CN
|
a0f7194252a189f8bc2b62fd16eb2abe432c0bf9
|
[
"Apache-2.0"
] | 5
|
2020-01-08T15:30:38.000Z
|
2022-02-15T02:39:46.000Z
|
#-*- coding:utf-8 _*-
"""
@author:charlesXu
@file: cws_rest_view.py
@desc: 分词和词性标注接口
@time: 2019/05/10
"""
| 11.4
| 24
| 0.614035
| 16
| 114
| 4.1875
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.094737
| 0.166667
| 114
| 9
| 25
| 12.666667
| 0.610526
| 0.868421
| 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
|
575a5d324208728b3d63af8d2b0a8556f3fd3622
| 173
|
py
|
Python
|
tests/tests_run.py
|
guilacerda/gcp-pilot
|
b31a7d4cd2de94a57c928c024e8f5b074f628224
|
[
"Apache-2.0"
] | null | null | null |
tests/tests_run.py
|
guilacerda/gcp-pilot
|
b31a7d4cd2de94a57c928c024e8f5b074f628224
|
[
"Apache-2.0"
] | 16
|
2021-01-11T00:59:42.000Z
|
2022-03-29T18:34:55.000Z
|
tests/tests_run.py
|
guilacerda/gcp-pilot
|
b31a7d4cd2de94a57c928c024e8f5b074f628224
|
[
"Apache-2.0"
] | 1
|
2021-09-17T05:38:41.000Z
|
2021-09-17T05:38:41.000Z
|
import unittest
from gcp_pilot.run import CloudRun
from tests import ClientTestMixin
class TestCloudRun(ClientTestMixin, unittest.TestCase):
_CLIENT_KLASS = CloudRun
| 19.222222
| 55
| 0.82659
| 20
| 173
| 7
| 0.7
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.132948
| 173
| 8
| 56
| 21.625
| 0.933333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.6
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
93ac493c870db8df4336ac2a28e6b5fd8ae9deec
| 180
|
py
|
Python
|
util/util.py
|
Soumil07/statsbrawl
|
9768f9e7ffd2b064f21805f1b7763cde4a05f831
|
[
"BSD-3-Clause"
] | 3
|
2019-05-21T06:33:09.000Z
|
2020-03-13T14:55:16.000Z
|
util/util.py
|
Soumil07/statsbrawl
|
9768f9e7ffd2b064f21805f1b7763cde4a05f831
|
[
"BSD-3-Clause"
] | null | null | null |
util/util.py
|
Soumil07/statsbrawl
|
9768f9e7ffd2b064f21805f1b7763cde4a05f831
|
[
"BSD-3-Clause"
] | null | null | null |
from collections import OrderedDict
def sort_dict(obj):
sorted_dict = sorted(obj.items(), key=lambda kv: kv[1])
sorted_dict.reverse()
return OrderedDict(sorted_dict)
| 22.5
| 59
| 0.733333
| 25
| 180
| 5.12
| 0.64
| 0.234375
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.006623
| 0.161111
| 180
| 7
| 60
| 25.714286
| 0.84106
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0.2
| 0
| 0.6
| 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
|
93eaf1751939c05ab275a0c2e195a0d897c38f7e
| 556
|
py
|
Python
|
tests/kyu_7_tests/test_the_mean_of_two_means.py
|
the-zebulan/CodeWars
|
1eafd1247d60955a5dfb63e4882e8ce86019f43a
|
[
"MIT"
] | 40
|
2016-03-09T12:26:20.000Z
|
2022-03-23T08:44:51.000Z
|
tests/kyu_7_tests/test_the_mean_of_two_means.py
|
akalynych/CodeWars
|
1eafd1247d60955a5dfb63e4882e8ce86019f43a
|
[
"MIT"
] | null | null | null |
tests/kyu_7_tests/test_the_mean_of_two_means.py
|
akalynych/CodeWars
|
1eafd1247d60955a5dfb63e4882e8ce86019f43a
|
[
"MIT"
] | 36
|
2016-11-07T19:59:58.000Z
|
2022-03-31T11:18:27.000Z
|
import unittest
from katas.kyu_7.the_mean_of_two_means import get_mean
class GetMeanTestCase(unittest.TestCase):
def test_equal_1(self):
self.assertEqual(get_mean([1, 3, 2, 4], 2, 3), 2.5)
def test_equal_2(self):
self.assertEqual(get_mean([1, 3, 2], 2, 2), 2.25)
def test_equal_3(self):
self.assertEqual(get_mean([1, 3, 2, 4], 1, 2), -1)
def test_equal_4(self):
self.assertEqual(get_mean([1, 3, 2, 4], 2, 8), -1)
def test_equal_5(self):
self.assertEqual(get_mean([1, -1, 2, -1], 2, 3), 0)
| 26.47619
| 59
| 0.622302
| 99
| 556
| 3.282828
| 0.282828
| 0.129231
| 0.184615
| 0.338462
| 0.455385
| 0.455385
| 0.372308
| 0.372308
| 0.283077
| 0.190769
| 0
| 0.098398
| 0.214029
| 556
| 20
| 60
| 27.8
| 0.645309
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.384615
| 1
| 0.384615
| false
| 0
| 0.153846
| 0
| 0.615385
| 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
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
93f5767ff933d337b967e5e2b0ea5d6962a5f9ce
| 71
|
py
|
Python
|
quantaq/exceptions.py
|
quant-aq/py-quantaq
|
36d2e4881c3b17a955ad5754193a6615476702de
|
[
"Apache-2.0"
] | 4
|
2020-05-31T18:39:30.000Z
|
2021-11-02T22:09:54.000Z
|
quantaq/exceptions.py
|
quant-aq/py-quantaq
|
36d2e4881c3b17a955ad5754193a6615476702de
|
[
"Apache-2.0"
] | 8
|
2019-03-04T21:17:13.000Z
|
2022-03-22T19:03:45.000Z
|
quantaq/exceptions.py
|
quant-aq/py-quantaq
|
36d2e4881c3b17a955ad5754193a6615476702de
|
[
"Apache-2.0"
] | 2
|
2019-12-16T21:45:32.000Z
|
2020-01-06T18:45:13.000Z
|
# -*- coding: utf-8 -*-
class QuantAQAPIException(Exception):
pass
| 17.75
| 37
| 0.661972
| 7
| 71
| 6.714286
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.016949
| 0.169014
| 71
| 4
| 38
| 17.75
| 0.779661
| 0.295775
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
f519bdec8d2fd7f567fec7b69da78202795c76ef
| 415
|
py
|
Python
|
src/_wheel2deb_simple/version.py
|
kazuto28/wheel2deb_simple
|
324381758d6bbad2b6400db967a02da456d943cc
|
[
"MIT"
] | null | null | null |
src/_wheel2deb_simple/version.py
|
kazuto28/wheel2deb_simple
|
324381758d6bbad2b6400db967a02da456d943cc
|
[
"MIT"
] | null | null | null |
src/_wheel2deb_simple/version.py
|
kazuto28/wheel2deb_simple
|
324381758d6bbad2b6400db967a02da456d943cc
|
[
"MIT"
] | null | null | null |
# coding: utf-8
# file generated by setuptools_scm
# don't change, don't track in version control
class Version:
def __init__(self, version):
self._p = version.split('.')
self._v = version
def __getitem__(self, key):
return self._p[key]
def __str__(self):
return self._v
def __repr__(self):
return self._v
__version__ = Version('0.1.dev5+ge0d057d.d20210625')
| 27.666667
| 52
| 0.648193
| 57
| 415
| 4.263158
| 0.561404
| 0.061728
| 0.098765
| 0.123457
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.050633
| 0.238554
| 415
| 14
| 53
| 29.642857
| 0.718354
| 0.219277
| 0
| 0.181818
| 1
| 0
| 0.0875
| 0.084375
| 0
| 0
| 0
| 0
| 0
| 1
| 0.363636
| false
| 0
| 0
| 0.272727
| 0.727273
| 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
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
f54531fdf341a1ad52a1f72419d31c96c2cb99c6
| 249
|
py
|
Python
|
Contents/Code/api_functs.py
|
Jakeman893/RoosterTeeth.bundle
|
bae551b0296523de2ac1cdc4e68b0e342768a283
|
[
"MIT"
] | null | null | null |
Contents/Code/api_functs.py
|
Jakeman893/RoosterTeeth.bundle
|
bae551b0296523de2ac1cdc4e68b0e342768a283
|
[
"MIT"
] | 9
|
2018-12-01T04:19:57.000Z
|
2019-03-10T04:46:30.000Z
|
Contents/Code/api_functs.py
|
Jakeman893/RoosterTeeth.bundle
|
bae551b0296523de2ac1cdc4e68b0e342768a283
|
[
"MIT"
] | 2
|
2018-08-10T02:33:07.000Z
|
2018-10-03T20:10:56.000Z
|
import itertools
def get_episodes(api, season_id, count=None):
if not count:
return api.season_episodes(season_id)
else:
episodes = api.season_episodes(season_id)
return list(itertools.islice(episodes, count))
| 31.125
| 54
| 0.686747
| 32
| 249
| 5.15625
| 0.5
| 0.163636
| 0.206061
| 0.278788
| 0.30303
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.228916
| 249
| 8
| 54
| 31.125
| 0.859375
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.142857
| false
| 0
| 0.142857
| 0
| 0.571429
| 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
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
f58e9cd0523e07f2893d3c87ddb15124af0b6ce8
| 166
|
py
|
Python
|
nni/nas/benchmarks/constants.py
|
weidankong/nni
|
0918ea0c52160f85bf7c910cfda0fb5591e9c447
|
[
"MIT"
] | 1
|
2022-01-20T08:50:18.000Z
|
2022-01-20T08:50:18.000Z
|
nni/nas/benchmarks/constants.py
|
weidankong/nni
|
0918ea0c52160f85bf7c910cfda0fb5591e9c447
|
[
"MIT"
] | null | null | null |
nni/nas/benchmarks/constants.py
|
weidankong/nni
|
0918ea0c52160f85bf7c910cfda0fb5591e9c447
|
[
"MIT"
] | null | null | null |
import os
# TODO: need to be refactored to support automatic download
DATABASE_DIR = os.environ.get("NASBENCHMARK_DIR", os.path.expanduser("~/.nni/nasbenchmark"))
| 23.714286
| 92
| 0.76506
| 23
| 166
| 5.434783
| 0.782609
| 0.08
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.114458
| 166
| 6
| 93
| 27.666667
| 0.85034
| 0.343373
| 0
| 0
| 0
| 0
| 0.327103
| 0
| 0
| 0
| 0
| 0.166667
| 0
| 1
| 0
| false
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
f59224380697ed6d110cd9facaaba92ffe22bb66
| 152
|
py
|
Python
|
fcg/version.py
|
mzrwalzy/fcg
|
43017874ee96f145eb377e72ddd6c4bb2b967dae
|
[
"MIT"
] | null | null | null |
fcg/version.py
|
mzrwalzy/fcg
|
43017874ee96f145eb377e72ddd6c4bb2b967dae
|
[
"MIT"
] | null | null | null |
fcg/version.py
|
mzrwalzy/fcg
|
43017874ee96f145eb377e72ddd6c4bb2b967dae
|
[
"MIT"
] | null | null | null |
# -*- coding:utf-8 -*-
# @Time : 2021/8/18 13:43
# @Author : Charon.
__version_info__ = ('1', '2', '0')
__version__ = '.'.join(__version_info__)
| 21.714286
| 40
| 0.572368
| 20
| 152
| 3.65
| 0.8
| 0.30137
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.120968
| 0.184211
| 152
| 6
| 41
| 25.333333
| 0.467742
| 0.447368
| 0
| 0
| 0
| 0
| 0.05
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
191c88865a114e455364fff0808c15ebd483d260
| 174
|
py
|
Python
|
RSAMessengerDapp/Scripts/IpfsWrapper.py
|
slothmanxyz/RSAMessengerDapp
|
3c5966196cac7749ea87ce0f42c47d159eb2ad14
|
[
"MIT"
] | null | null | null |
RSAMessengerDapp/Scripts/IpfsWrapper.py
|
slothmanxyz/RSAMessengerDapp
|
3c5966196cac7749ea87ce0f42c47d159eb2ad14
|
[
"MIT"
] | null | null | null |
RSAMessengerDapp/Scripts/IpfsWrapper.py
|
slothmanxyz/RSAMessengerDapp
|
3c5966196cac7749ea87ce0f42c47d159eb2ad14
|
[
"MIT"
] | 1
|
2021-04-05T13:27:02.000Z
|
2021-04-05T13:27:02.000Z
|
import ipfshttpclient
client = ipfshttpclient.connect()
def add(file_loc):
res = client.add(file_loc)
return res['Hash']
def cat(hash):
return client.cat(hash)
| 17.4
| 33
| 0.706897
| 24
| 174
| 5.041667
| 0.5
| 0.115702
| 0.165289
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.172414
| 174
| 10
| 34
| 17.4
| 0.840278
| 0
| 0
| 0
| 0
| 0
| 0.022857
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0
| 0.142857
| 0.142857
| 0.714286
| 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
|
191ce075d117fa15e4d980dab7b3cc87b0d5f970
| 352
|
py
|
Python
|
blaze/blir/__init__.py
|
davidfischer/blaze-core
|
19b55ed469aec742fd871b959115a3d87a89acb9
|
[
"BSD-2-Clause"
] | 1
|
2015-01-02T18:16:07.000Z
|
2015-01-02T18:16:07.000Z
|
blaze/blir/__init__.py
|
davidfischer/blaze-core
|
19b55ed469aec742fd871b959115a3d87a89acb9
|
[
"BSD-2-Clause"
] | null | null | null |
blaze/blir/__init__.py
|
davidfischer/blaze-core
|
19b55ed469aec742fd871b959115a3d87a89acb9
|
[
"BSD-2-Clause"
] | null | null | null |
from .passes import compile, CompileError
from .exc import Context, execute
from .errors import log
def bitcode(env):
""" Print LLVM bitcode for the given compiled environment """
return env['cgen'].module
def assembly(env):
""" Print x86 assembly for the given compiled environment """
return env['cgen'].module.to_native_assembly()
| 29.333333
| 65
| 0.727273
| 47
| 352
| 5.404255
| 0.574468
| 0.062992
| 0.086614
| 0.149606
| 0.385827
| 0.385827
| 0.385827
| 0.385827
| 0.385827
| 0
| 0
| 0.006849
| 0.170455
| 352
| 11
| 66
| 32
| 0.863014
| 0.306818
| 0
| 0
| 0
| 0
| 0.034783
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0.142857
| 0.428571
| 0
| 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
| 1
| 1
| 0
| 1
| 0
|
0
| 4
|
195bf25fb0d2a9fabfe38b0250a0a5be053c7a83
| 189
|
py
|
Python
|
src/use_case/subtract_action.py
|
panda-coder/py-clean-flask
|
e7b8af5056178cd1dc6161f52a909f8043dc4b66
|
[
"MIT"
] | null | null | null |
src/use_case/subtract_action.py
|
panda-coder/py-clean-flask
|
e7b8af5056178cd1dc6161f52a909f8043dc4b66
|
[
"MIT"
] | null | null | null |
src/use_case/subtract_action.py
|
panda-coder/py-clean-flask
|
e7b8af5056178cd1dc6161f52a909f8043dc4b66
|
[
"MIT"
] | null | null | null |
from domain.use_cases import Subtract
from domain.dtos import SubtractDTO
class SubtractAction(Subtract):
def calculate(self, params: SubtractDTO):
return params.x - params.y
| 23.625
| 45
| 0.761905
| 24
| 189
| 5.958333
| 0.708333
| 0.13986
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.169312
| 189
| 8
| 46
| 23.625
| 0.910828
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0.4
| 0.2
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
|
0
| 4
|
197148d2a8782e0f9f3ba2a98f0368764e737af6
| 152
|
py
|
Python
|
settings.py
|
weimingqing/Email2Push
|
a0ddf8ce48f20882efe9b1c0fb750da5b5c31503
|
[
"MIT"
] | null | null | null |
settings.py
|
weimingqing/Email2Push
|
a0ddf8ce48f20882efe9b1c0fb750da5b5c31503
|
[
"MIT"
] | null | null | null |
settings.py
|
weimingqing/Email2Push
|
a0ddf8ce48f20882efe9b1c0fb750da5b5c31503
|
[
"MIT"
] | null | null | null |
#!/usr/bin/python3
from imaplib import IMAP4_SSL
import ssl
import requests
import time
from config import *
context = ssl.SSLContext(ssl.PROTOCOL_TLS)
| 19
| 42
| 0.809211
| 23
| 152
| 5.26087
| 0.652174
| 0.14876
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.014925
| 0.118421
| 152
| 7
| 43
| 21.714286
| 0.88806
| 0.111842
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.833333
| 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
|
197237f8478fb235c91f08040b999800e6be6e83
| 279
|
py
|
Python
|
anamic/viz/__init__.py
|
brouhardlab/anamic
|
0e61e4aeb999ba91fdf0e21b55f2e132e94f94bc
|
[
"BSD-3-Clause"
] | 4
|
2019-03-27T09:49:42.000Z
|
2021-06-09T12:42:03.000Z
|
anamic/viz/__init__.py
|
hadim/anamic
|
0e61e4aeb999ba91fdf0e21b55f2e132e94f94bc
|
[
"BSD-3-Clause"
] | 7
|
2019-03-03T16:46:23.000Z
|
2019-03-03T17:01:59.000Z
|
anamic/viz/__init__.py
|
hadim/anamic
|
0e61e4aeb999ba91fdf0e21b55f2e132e94f94bc
|
[
"BSD-3-Clause"
] | 1
|
2019-03-27T09:49:46.000Z
|
2019-03-27T09:49:46.000Z
|
from .plot import viz_2d_dimers_positions
from .plot import viz_dimers
from .plot import imshow_colorbar
from .plot import show_tips
from .plot_3d import viz_dimer_positions
from .log_widget import LoggingWidget
from .viewer import ImageViewer
from .drawer import ObjectDrawer
| 25.363636
| 41
| 0.849462
| 42
| 279
| 5.404762
| 0.47619
| 0.176211
| 0.246696
| 0.14978
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.008163
| 0.121864
| 279
| 10
| 42
| 27.9
| 0.918367
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
1976b05d1ee431ccce4ecda60f43fb7fac163f86
| 251
|
py
|
Python
|
novice/01-02/modul/bubble.py
|
fakihAlim/zimera
|
69271dbcfe9d8f9b2ef72e6f6c8ce0ae4c57a9c9
|
[
"MIT"
] | null | null | null |
novice/01-02/modul/bubble.py
|
fakihAlim/zimera
|
69271dbcfe9d8f9b2ef72e6f6c8ce0ae4c57a9c9
|
[
"MIT"
] | null | null | null |
novice/01-02/modul/bubble.py
|
fakihAlim/zimera
|
69271dbcfe9d8f9b2ef72e6f6c8ce0ae4c57a9c9
|
[
"MIT"
] | null | null | null |
def sort(numbers):
for i in range(len(numbers) - 1, 0, -1):
for j in range(i):
if numbers[j] > numbers[j + 1]:
temp = numbers[j]
numbers[j] = numbers[j + 1]
numbers[j + 1] = temp
| 31.375
| 44
| 0.442231
| 35
| 251
| 3.171429
| 0.371429
| 0.432432
| 0.405405
| 0.432432
| 0.306306
| 0
| 0
| 0
| 0
| 0
| 0
| 0.041096
| 0.418327
| 251
| 7
| 45
| 35.857143
| 0.719178
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.142857
| false
| 0
| 0
| 0
| 0.142857
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
198d3d71e43e47e401ad64cfcb4c6d6cfdd5267c
| 102
|
py
|
Python
|
api/collect_points/apps.py
|
fujikawahiroaki/webspecimanager
|
d46a4feec0c695d5231b21e3311f4adbe25435cb
|
[
"BSD-2-Clause"
] | null | null | null |
api/collect_points/apps.py
|
fujikawahiroaki/webspecimanager
|
d46a4feec0c695d5231b21e3311f4adbe25435cb
|
[
"BSD-2-Clause"
] | 10
|
2020-12-07T08:54:30.000Z
|
2022-03-13T12:23:03.000Z
|
api/collect_points/apps.py
|
fujikawahiroaki/webspecimanager
|
d46a4feec0c695d5231b21e3311f4adbe25435cb
|
[
"BSD-2-Clause"
] | null | null | null |
from django.apps import AppConfig
class CollectPointsConfig(AppConfig):
name = 'collect_points'
| 17
| 37
| 0.784314
| 11
| 102
| 7.181818
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.147059
| 102
| 5
| 38
| 20.4
| 0.908046
| 0
| 0
| 0
| 0
| 0
| 0.137255
| 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
|
1990a470e5cd176472f80b682144491d47a4db94
| 45
|
py
|
Python
|
idioms_examples/list_comprehension/good.py
|
jjmerchante/Pythonic-webserver
|
b57fe35975b60d7fe8d04d63094068e54d9e3ee8
|
[
"Apache-2.0"
] | 3
|
2017-11-06T14:00:30.000Z
|
2018-04-07T08:02:40.000Z
|
idioms_examples/list_comprehension/good.py
|
jjmerchante/Pythonic-webserver
|
b57fe35975b60d7fe8d04d63094068e54d9e3ee8
|
[
"Apache-2.0"
] | null | null | null |
idioms_examples/list_comprehension/good.py
|
jjmerchante/Pythonic-webserver
|
b57fe35975b60d7fe8d04d63094068e54d9e3ee8
|
[
"Apache-2.0"
] | null | null | null |
result_list = [el for el in range(10000000)]
| 22.5
| 44
| 0.733333
| 8
| 45
| 4
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.210526
| 0.155556
| 45
| 1
| 45
| 45
| 0.631579
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 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
|
1994beab362364a64a46316cd84ddcadf4806762
| 1,259
|
py
|
Python
|
essentials_kit_management/views/post_verification_details/tests/snapshots/snap_test_case_01.py
|
RajeshKumar1490/iB_hubs_mini_project
|
f7126092400fb9a62fb4bff643dae7cda3a8d9d2
|
[
"MIT"
] | null | null | null |
essentials_kit_management/views/post_verification_details/tests/snapshots/snap_test_case_01.py
|
RajeshKumar1490/iB_hubs_mini_project
|
f7126092400fb9a62fb4bff643dae7cda3a8d9d2
|
[
"MIT"
] | 2
|
2021-09-07T07:06:00.000Z
|
2021-09-07T07:24:26.000Z
|
essentials_kit_management/views/post_verification_details/tests/snapshots/snap_test_case_01.py
|
RajeshKumar1490/iB_hubs_mini_project
|
f7126092400fb9a62fb4bff643dae7cda3a8d9d2
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
# snapshottest: v1 - https://goo.gl/zC4yUc
from __future__ import unicode_literals
from snapshottest import Snapshot
snapshots = Snapshot()
snapshots['TestCase01PostVerificationDetailsAPITestCase::test_case status'] = 400
snapshots['TestCase01PostVerificationDetailsAPITestCase::test_case body'] = {
'http_status_code': 400,
'res_status': 'INVALID_VALUE_EXCEPTION',
'response': 'Please send valid value for amount'
}
snapshots['TestCase01PostVerificationDetailsAPITestCase::test_case header_params'] = {
'content-language': [
'Content-Language',
'en'
],
'content-length': [
'116',
'Content-Length'
],
'content-type': [
'Content-Type',
'text/html; charset=utf-8'
],
'vary': [
'Accept-Language, Origin, Cookie',
'Vary'
],
'x-frame-options': [
'SAMEORIGIN',
'X-Frame-Options'
]
}
snapshots['TestCase01PostVerificationDetailsAPITestCase::test_case http_status_code'] = 400
snapshots['TestCase01PostVerificationDetailsAPITestCase::test_case res_status'] = 'INVALID_VALUE_EXCEPTION'
snapshots['TestCase01PostVerificationDetailsAPITestCase::test_case response'] = 'Please send valid value for amount'
| 27.369565
| 116
| 0.691819
| 113
| 1,259
| 7.513274
| 0.469027
| 0.374558
| 0.402827
| 0.431095
| 0.308598
| 0.087161
| 0.087161
| 0
| 0
| 0
| 0
| 0.027264
| 0.184273
| 1,259
| 45
| 117
| 27.977778
| 0.799416
| 0.049245
| 0
| 0.117647
| 0
| 0
| 0.613903
| 0.314908
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.058824
| 0
| 0.058824
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
5fe141c41a52fae15839bd22ebd86cf0b0aeb486
| 86
|
py
|
Python
|
1612.py
|
heltonricardo/URI
|
160cca22d94aa667177c9ebf2a1c9864c5e55b41
|
[
"MIT"
] | 6
|
2021-04-13T00:33:43.000Z
|
2022-02-10T10:23:59.000Z
|
1612.py
|
heltonricardo/URI
|
160cca22d94aa667177c9ebf2a1c9864c5e55b41
|
[
"MIT"
] | null | null | null |
1612.py
|
heltonricardo/URI
|
160cca22d94aa667177c9ebf2a1c9864c5e55b41
|
[
"MIT"
] | 3
|
2021-03-23T18:42:24.000Z
|
2022-02-10T10:24:07.000Z
|
from math import ceil
for g in range(int(input())):
print(ceil(int(input()) / 2))
| 21.5
| 33
| 0.639535
| 15
| 86
| 3.666667
| 0.8
| 0.290909
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.014085
| 0.174419
| 86
| 3
| 34
| 28.666667
| 0.760563
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0.333333
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
5fe4244d94d3a037e5032a52a18ee028a952b000
| 102
|
py
|
Python
|
expykit/os/__init__.py
|
fakegit/mo-han-toolbox
|
9d5bbc1fe7f12040715d3a0d3f320a1ad617aed8
|
[
"MIT"
] | 24
|
2019-12-08T03:56:32.000Z
|
2021-10-02T13:26:37.000Z
|
expykit/os/__init__.py
|
fakegit/mo-han-toolbox
|
9d5bbc1fe7f12040715d3a0d3f320a1ad617aed8
|
[
"MIT"
] | 2
|
2020-04-27T14:20:01.000Z
|
2020-07-17T06:05:33.000Z
|
expykit/os/__init__.py
|
fakegit/mo-han-toolbox
|
9d5bbc1fe7f12040715d3a0d3f320a1ad617aed8
|
[
"MIT"
] | 10
|
2019-08-06T01:11:28.000Z
|
2021-07-19T08:45:11.000Z
|
#!/usr/bin/env python3
from ezpykit.stdlib.os import *
from .clipboard import clipboard
_ref_ = path
| 17
| 32
| 0.764706
| 15
| 102
| 5.066667
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.011364
| 0.137255
| 102
| 5
| 33
| 20.4
| 0.852273
| 0.205882
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
27228f6ae40a688ddea128bc85dd539051f4218c
| 236
|
py
|
Python
|
rooms/1.json.py
|
jimfmunro/AdventureGame
|
43e3429143232020109e5f9b8f79582087b702a3
|
[
"Unlicense"
] | 3
|
2015-07-06T04:45:51.000Z
|
2017-04-07T15:00:12.000Z
|
rooms/1.json.py
|
jimfmunro/AdventureGame
|
43e3429143232020109e5f9b8f79582087b702a3
|
[
"Unlicense"
] | null | null | null |
rooms/1.json.py
|
jimfmunro/AdventureGame
|
43e3429143232020109e5f9b8f79582087b702a3
|
[
"Unlicense"
] | null | null | null |
{ "name" : "Foyer",
"description" : "You're standing in the foyer of the building. You have stepped in here to escape a roaring thunderstorm which has left you soaked. You can see a doorway to the north.",
"neighbors" : {"n" : 2}
}
| 47.2
| 187
| 0.690678
| 38
| 236
| 4.289474
| 0.763158
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.005291
| 0.199153
| 236
| 4
| 188
| 59
| 0.857143
| 0
| 0
| 0
| 0
| 0.25
| 0.830508
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 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
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
272c850c6315f3ec48a67012b78f63b7743a0eb9
| 1,241
|
py
|
Python
|
Roman_Morozov_dz_2/task_2.py
|
Wern-rm/2074_GB_Python
|
f0b7a7f4ed993a007c1aef6ec9ce266adb5a3646
|
[
"MIT"
] | null | null | null |
Roman_Morozov_dz_2/task_2.py
|
Wern-rm/2074_GB_Python
|
f0b7a7f4ed993a007c1aef6ec9ce266adb5a3646
|
[
"MIT"
] | null | null | null |
Roman_Morozov_dz_2/task_2.py
|
Wern-rm/2074_GB_Python
|
f0b7a7f4ed993a007c1aef6ec9ce266adb5a3646
|
[
"MIT"
] | null | null | null |
__author__ = 'Roman Morozov'
def convert_list_in_str(list_in: list) -> str:
# a
sort_list: list = list_in[::-1]
for i in sort_list:
if sort_list[sort_list.index(i)].isdigit() is True and sort_list[sort_list.index(i)].startswith('"') is False:
sort_list.insert(sort_list.index(i) + 1, '"')
elif sort_list[sort_list.index(i)].isdigit() is False and sort_list[sort_list.index(i)].startswith('+') is True:
sort_list.insert(sort_list.index(i) + 1, '"')
# b
sort_list = sort_list[::-1]
for i in sort_list:
if sort_list[sort_list.index(i)].isdigit() is True and sort_list[sort_list.index(i)].startswith('"') is False:
sort_list.insert(sort_list.index(i) + 1, '"')
if len(i) == 1:
sort_list[sort_list.index(i)] = '0' + i
elif sort_list[sort_list.index(i)].isdigit() is False and sort_list[sort_list.index(i)].startswith('+') is True:
sort_list.insert(sort_list.index(i) + 1, '"')
return ' '.join(sort_list)
if __name__ == '__main__':
my_list: list = ['в', '5', 'часов', '17', 'минут', 'температура', 'воздуха', 'была', '+5', 'градусов']
result: str = convert_list_in_str(my_list)
print(result)
| 40.032258
| 120
| 0.614021
| 189
| 1,241
| 3.746032
| 0.222222
| 0.361582
| 0.238701
| 0.257062
| 0.689266
| 0.689266
| 0.658192
| 0.658192
| 0.658192
| 0.658192
| 0
| 0.012295
| 0.213537
| 1,241
| 31
| 121
| 40.032258
| 0.713115
| 0.002417
| 0
| 0.47619
| 0
| 0
| 0.062298
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.047619
| false
| 0
| 0
| 0
| 0.095238
| 0.047619
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
2735c1584e33ac6e3548fe6e544d3d9e385df170
| 119
|
py
|
Python
|
service_api/fake_api/urls.py
|
Djalyarim/Test_task
|
c4f66b8ef50fcde679c4dff62ddee162064f26e0
|
[
"MIT"
] | 1
|
2022-02-01T08:29:39.000Z
|
2022-02-01T08:29:39.000Z
|
service_api/fake_api/urls.py
|
Djalyarim/Test_task
|
c4f66b8ef50fcde679c4dff62ddee162064f26e0
|
[
"MIT"
] | null | null | null |
service_api/fake_api/urls.py
|
Djalyarim/Test_task
|
c4f66b8ef50fcde679c4dff62ddee162064f26e0
|
[
"MIT"
] | null | null | null |
from django.urls import path
from .views import fake_api
urlpatterns = [
path('external-fake-api/', fake_api),
]
| 14.875
| 41
| 0.714286
| 17
| 119
| 4.882353
| 0.588235
| 0.253012
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.168067
| 119
| 7
| 42
| 17
| 0.838384
| 0
| 0
| 0
| 0
| 0
| 0.151261
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.4
| 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
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
2748aa80ed7523448512f02b3346b446402d354f
| 131
|
py
|
Python
|
Funções Def.py
|
dimagela29/Python-POO
|
61904b232b50779f37ed48a46cc317fc709a744e
|
[
"Apache-2.0",
"MIT"
] | null | null | null |
Funções Def.py
|
dimagela29/Python-POO
|
61904b232b50779f37ed48a46cc317fc709a744e
|
[
"Apache-2.0",
"MIT"
] | null | null | null |
Funções Def.py
|
dimagela29/Python-POO
|
61904b232b50779f37ed48a46cc317fc709a744e
|
[
"Apache-2.0",
"MIT"
] | null | null | null |
def func():
outra_variavel = 'Denetrius'
return outra_variavel
def func2(arg):
print(arg)
var = func()
func2(var)
| 14.555556
| 32
| 0.641221
| 17
| 131
| 4.823529
| 0.588235
| 0.317073
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.02
| 0.236641
| 131
| 8
| 33
| 16.375
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0.068702
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0
| 0
| 0
| 0.428571
| 0.142857
| 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
|
27b4b50c4d90b9dbed38705ac13a7da454e56e98
| 8,335
|
py
|
Python
|
peg/generate.py
|
ethframe/peg
|
b9529ba00ca44c0c2ac7c6b38ae3fb7169b282da
|
[
"MIT"
] | 1
|
2018-03-20T10:27:53.000Z
|
2018-03-20T10:27:53.000Z
|
peg/generate.py
|
ethframe/peg
|
b9529ba00ca44c0c2ac7c6b38ae3fb7169b282da
|
[
"MIT"
] | null | null | null |
peg/generate.py
|
ethframe/peg
|
b9529ba00ca44c0c2ac7c6b38ae3fb7169b282da
|
[
"MIT"
] | null | null | null |
from .visitor import Visitor, GenericVisitor
from .peg import *
__all__ = ("generate_visitor", "generate_py_parser", "generate_parser")
class Tags(GenericVisitor):
def __init__(self):
self.tags = []
def visit_Tag(self, node):
if node.value not in self.tags:
self.tags.append(node.value)
def generate_visitor(grammar):
tags = Tags()
tags.visit(grammar)
visitor = ["class TreeVisitor(Visitor):"]
for tag in tags.tags:
visitor.extend([
" def visit_{}(self, node):".format(tag),
" raise NotImplementedError(\"visit_{}\")".format(tag),
"",
])
return "\n".join(visitor)
class PyParserVisitor(Visitor):
def visit_Grammar(self, node):
rules = [
"def make_parser():",
" g = Grammar()",
]
for rule in node.values("rule"):
rules.append(" " + self.visit(rule))
rules.extend([
" return g({!r})".format(node.values("rule")[0]["name"].value)
])
return "\n".join(rules)
def visit_Rule(self, node):
return "g({!r}, {})".format(node["name"].value,
self.visit(node["body"]))
def visit_Sequence(self, node):
items = []
for item in node.values("item"):
if item.name in ("Choice", "Class"):
items.append("({})".format(self.visit(item)))
else:
items.append(self.visit(item))
return " * ".join(items)
def visit_Choice(self, node):
alts = []
for alt in node.values("alt"):
alts.append(self.visit(alt))
return " | ".join(alts)
def visit_Class(self, node):
items = []
for item in node.values("item"):
items.append(self.visit(item))
return " | ".join(items)
def visit_Repeat(self, node):
if node["expr"].name in ("Sequence", "Choice", "Not", "Class"):
return "({}).rep()".format(self.visit(node["expr"]))
return self.visit(node["expr"]) + ".rep()"
def visit_Repeat1(self, node):
if node["expr"].name in ("Sequence", "Choice", "Not", "Class"):
return "({}).rep1()".format(self.visit(node["expr"]))
return self.visit(node["expr"]) + ".rep1()"
def visit_Optional(self, node):
if node["expr"].name in ("Sequence", "Choice", "Not", "Class"):
return "({}).opt()".format(self.visit(node["expr"]))
return self.visit(node["expr"]) + ".opt()"
def visit_Not(self, node):
if node["expr"].name in ("Sequence", "Choice", "Class"):
return "~({})".format(self.visit(node["expr"]))
return "~" + self.visit(node["expr"])
def visit_Tag(self, node):
return "Tag({!r})".format(node.value)
def visit_Identifier(self, node):
return "g({!r})".format(node.value)
def visit_Append(self, node):
if node["expr"].name in ("Sequence", "Choice", "Not", "Class"):
return "({}).app({!r})".format(self.visit(node["expr"]),
node["name"].value)
return "{}.app({!r})".format(self.visit(node["expr"]),
node["name"].value)
def visit_Rappend(self, node):
if node["expr"].name in ("Sequence", "Choice", "Not", "Class"):
return "({}).rapp({!r})".format(self.visit(node["expr"]),
node["name"].value)
return "{}.rapp({!r})".format(self.visit(node["expr"]),
node["name"].value)
def visit_Extend(self, node):
if node["expr"].name in ("Sequence", "Choice", "Not", "Class"):
return "({}).ext()".format(self.visit(node["expr"]))
return "{}.ext()".format(self.visit(node["expr"]))
def visit_Rextend(self, node):
if node["expr"].name in ("Sequence", "Choice", "Not", "Class"):
return "({}).rext()".format(self.visit(node["expr"]))
return "{}.rext()".format(self.visit(node["expr"]))
def visit_Ignore(self, node):
if node["expr"].name in ("Sequence", "Choice", "Not", "Class"):
return "({}).ign()".format(self.visit(node["expr"]))
return "{}.ign()".format(self.visit(node["expr"]))
def visit_Range(self, node):
return "CharRange({!r}, {!r})".format(node["start"].value,
node["end"].value)
def visit_Char(self, node):
return "Literal({!r})".format(self.visit(node["char"]))
def visit_Literal(self, node):
return "Literal({!r})".format("".join(self.visit(c)
for c in node.values("char")))
def visit_Any(self, node):
return "Any()"
def visit_escape(self, node):
return {
"n": "\n",
"r": "\r",
"t": "\t",
"'": "'",
'"': '"',
"[": "[",
"]": "]",
"\\": "\\",
}[node.value]
def visit_octal(self, node):
return chr(int(node.value, 8))
def visit_char(self, node):
return node.value
def generate_py_parser(grammar):
visitor = PyParserVisitor()
return visitor.visit(grammar)
class ParserVisitor(Visitor):
def __init__(self):
self.grammar = Grammar()
def visit_Grammar(self, node):
self.grammar = Grammar()
for rule in node.values("rule"):
self.visit(rule)
return self.grammar(node.values("rule")[0]["name"].value)
def visit_Rule(self, node):
self.grammar(node["name"].value, self.visit(node["body"]))
def visit_Choice(self, node):
items = node.values("alt")
alt = self.visit(items[-1])
for item in reversed(items[:-1]):
alt = Choice(self.visit(item), alt)
return alt
def visit_Sequence(self, node):
items = node.values("item")
seq = self.visit(items[-1])
for item in reversed(items[:-1]):
seq = Sequence(self.visit(item), seq)
return seq
def visit_Epsilon(self, node):
return Epsilon()
def visit_And(self, node):
return And(self.visit(node["expr"]))
def visit_Not(self, node):
return Not(self.visit(node["expr"]))
def visit_Optional(self, node):
return Optional(self.visit(node["expr"]))
def visit_Repeat(self, node):
return Repeat(self.visit(node["expr"]))
def visit_Repeat1(self, node):
return Repeat1(self.visit(node["expr"]))
def visit_Append(self, node):
return Append(self.visit(node["expr"]), node["name"].value)
def visit_Rappend(self, node):
return Rappend(self.visit(node["expr"]), node["name"].value)
def visit_Extend(self, node):
return Extend(self.visit(node["expr"]))
def visit_Rextend(self, node):
return Rextend(self.visit(node["expr"]))
def visit_Ignore(self, node):
return Ignore(self.visit(node["expr"]))
def visit_Identifier(self, node):
return self.grammar(node.value)
def visit_Tag(self, node):
return Tag(node.value)
def visit_Literal(self, node):
return Literal("".join(self.visit(n) for n in node.values("char")))
def visit_Class(self, node):
items = node.values("item")
alt = self.visit(items[-1])
for item in reversed(items[:-1]):
alt = Choice(self.visit(item), alt)
return alt
def visit_Nothing(self, node):
return Nothing()
def visit_Range(self, node):
return CharRange(self.visit(node["start"]), self.visit(node["end"]))
def visit_Char(self, node):
return Literal(self.visit(node["char"]))
def visit_escape(self, node):
return {
"n": "\n",
"r": "\r",
"t": "\t",
"'": "'",
'"': '"',
"[": "[",
"]": "]",
"\\": "\\",
}[node.value]
def visit_octal(self, node):
return chr(int(node.value, 8))
def visit_char(self, node):
return node.value
def visit_Any(self, node):
return Any()
def generate_parser(grammar):
visitor = ParserVisitor()
return visitor.visit(grammar)
| 30.756458
| 77
| 0.526935
| 963
| 8,335
| 4.484943
| 0.089304
| 0.094466
| 0.102339
| 0.110211
| 0.712433
| 0.648067
| 0.545034
| 0.425561
| 0.412596
| 0.336652
| 0
| 0.002533
| 0.289502
| 8,335
| 270
| 78
| 30.87037
| 0.726781
| 0
| 0
| 0.531401
| 1
| 0
| 0.116857
| 0.005039
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2657
| false
| 0
| 0.009662
| 0.149758
| 0.57971
| 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
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
27c0c7cbf9228f870a73c7e418ceed92dff053d8
| 227
|
py
|
Python
|
tg/configuration/mongo/auth.py
|
sergiobrr/tg2
|
401d77d82bd9daacb9444150c63bb039bf003436
|
[
"MIT"
] | 812
|
2015-01-16T22:57:52.000Z
|
2022-03-27T04:49:40.000Z
|
tg/configuration/mongo/auth.py
|
sergiobrr/tg2
|
401d77d82bd9daacb9444150c63bb039bf003436
|
[
"MIT"
] | 74
|
2015-02-18T17:55:31.000Z
|
2021-12-13T10:41:08.000Z
|
tg/configuration/mongo/auth.py
|
sergiobrr/tg2
|
401d77d82bd9daacb9444150c63bb039bf003436
|
[
"MIT"
] | 72
|
2015-06-10T06:02:45.000Z
|
2022-03-27T08:37:24.000Z
|
# -*- coding: utf-8 -*-
from tgming.auth import MingAuthenticatorPlugin
def create_default_authenticator(user_class, translations=None, **unused):
mingauth = MingAuthenticatorPlugin(user_class)
return unused, mingauth
| 32.428571
| 74
| 0.779736
| 24
| 227
| 7.208333
| 0.791667
| 0.104046
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.005025
| 0.123348
| 227
| 6
| 75
| 37.833333
| 0.864322
| 0.092511
| 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
|
27d98775c8ccbbd61b7825281d717c4370581443
| 256
|
py
|
Python
|
geneticpython/__init__.py
|
ngocjr7/geneticpython
|
4b4157523ce13b3da56cef61282cb0a984cd317b
|
[
"MIT"
] | null | null | null |
geneticpython/__init__.py
|
ngocjr7/geneticpython
|
4b4157523ce13b3da56cef61282cb0a984cd317b
|
[
"MIT"
] | null | null | null |
geneticpython/__init__.py
|
ngocjr7/geneticpython
|
4b4157523ce13b3da56cef61282cb0a984cd317b
|
[
"MIT"
] | null | null | null |
"""
# Problem: __init__.py
# Description:
# Created by ngocjr7 on [2020-03-29 23:29:01]
"""
from __future__ import absolute_import
from .engines import *
from .callbacks import *
from .core import *
from .utils import *
from .models import *
| 19.692308
| 46
| 0.6875
| 34
| 256
| 4.911765
| 0.647059
| 0.299401
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.073529
| 0.203125
| 256
| 12
| 47
| 21.333333
| 0.745098
| 0.328125
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
27decf3bc8bcbad4575437651457a6b24c8ef834
| 130
|
py
|
Python
|
tests/test_src.py
|
12rambau/python_lib_template
|
9fef446678b195487676b36860e2218aa0710f98
|
[
"BSD-2-Clause"
] | null | null | null |
tests/test_src.py
|
12rambau/python_lib_template
|
9fef446678b195487676b36860e2218aa0710f98
|
[
"BSD-2-Clause"
] | 3
|
2022-01-18T11:00:49.000Z
|
2022-02-02T15:19:08.000Z
|
tests/test_src.py
|
12rambau/python_lib_template
|
9fef446678b195487676b36860e2218aa0710f98
|
[
"BSD-2-Clause"
] | null | null | null |
import src
class TestInit:
def test_hello_world(self):
assert src.hello_world() == "hello world !"
return
| 13
| 51
| 0.623077
| 16
| 130
| 4.875
| 0.6875
| 0.384615
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.284615
| 130
| 9
| 52
| 14.444444
| 0.83871
| 0
| 0
| 0
| 0
| 0
| 0.1
| 0
| 0
| 0
| 0
| 0
| 0.2
| 1
| 0.2
| false
| 0
| 0.2
| 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
| 0
| 0
| 1
| 0
|
0
| 4
|
27e69ce7a4384707b3b5cbd7c6bd6b2ad083d088
| 206
|
py
|
Python
|
app/config/admin.py
|
Niclnx/service-stac
|
ad9129a7130d09b2bed387d8e82575eb86fdfa7b
|
[
"BSD-3-Clause"
] | 9
|
2020-08-17T11:01:48.000Z
|
2022-01-17T22:24:13.000Z
|
app/config/admin.py
|
Niclnx/service-stac
|
ad9129a7130d09b2bed387d8e82575eb86fdfa7b
|
[
"BSD-3-Clause"
] | 100
|
2020-08-14T05:56:40.000Z
|
2022-03-01T22:39:58.000Z
|
app/config/admin.py
|
Niclnx/service-stac
|
ad9129a7130d09b2bed387d8e82575eb86fdfa7b
|
[
"BSD-3-Clause"
] | 3
|
2020-09-02T14:01:07.000Z
|
2021-07-27T06:30:26.000Z
|
from django.contrib import admin
from django.utils.translation import gettext_lazy as _
class StacAdminSite(admin.AdminSite):
site_header = _('STAC API admin')
site_title = _('geoadmin STAC API')
| 25.75
| 54
| 0.762136
| 27
| 206
| 5.592593
| 0.703704
| 0.13245
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.15534
| 206
| 7
| 55
| 29.428571
| 0.867816
| 0
| 0
| 0
| 0
| 0
| 0.150485
| 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
|
27e7c1b1743f5b67762113a3f95947ce9b298683
| 228
|
py
|
Python
|
student_service.py
|
msleia/itsserver
|
5f688b35427aa63edf19a743297290346acef812
|
[
"Apache-2.0"
] | null | null | null |
student_service.py
|
msleia/itsserver
|
5f688b35427aa63edf19a743297290346acef812
|
[
"Apache-2.0"
] | null | null | null |
student_service.py
|
msleia/itsserver
|
5f688b35427aa63edf19a743297290346acef812
|
[
"Apache-2.0"
] | null | null | null |
from tornado.web import RequestHandler
from dao import DAO
from entities import *
dao_obj = DAO()
class StudentServiceHandler(RequestHandler):
def get(self, st_exs_id, currword):
return {"cat":"cat"}
| 17.538462
| 44
| 0.688596
| 28
| 228
| 5.5
| 0.678571
| 0.116883
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.223684
| 228
| 13
| 45
| 17.538462
| 0.870057
| 0
| 0
| 0
| 0
| 0
| 0.026201
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.142857
| false
| 0
| 0.428571
| 0.142857
| 0.857143
| 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
| 0
| 0
| 1
| 1
| 1
| 0
|
0
| 4
|
27ed25e591de5f5cbb4e75687fb5a74f5da2b039
| 9,929
|
py
|
Python
|
tools/python/boutiques/tests/test_publisher.py
|
jerdra/boutiques
|
f6ee252fd1332ec686dc76dc12e52a0d69c685c3
|
[
"MIT"
] | null | null | null |
tools/python/boutiques/tests/test_publisher.py
|
jerdra/boutiques
|
f6ee252fd1332ec686dc76dc12e52a0d69c685c3
|
[
"MIT"
] | null | null | null |
tools/python/boutiques/tests/test_publisher.py
|
jerdra/boutiques
|
f6ee252fd1332ec686dc76dc12e52a0d69c685c3
|
[
"MIT"
] | null | null | null |
from boutiques import __file__ as bfile
from boutiques.publisher import ZenodoError
from boutiques.bosh import bosh
import json
import subprocess
import shutil
import tempfile
import os
import os.path as op
import sys
import mock
from boutiques_mocks import *
if sys.version_info < (2, 7):
from unittest2 import TestCase
else:
from unittest import TestCase
def mock_get_publish_then_update():
mock_record = MockZenodoRecord(1234567, "Example Boutiques Tool")
return ([mock_zenodo_test_api_fail(),
mock_zenodo_test_api(),
mock_zenodo_search([]),
mock_zenodo_test_api_fail(),
mock_zenodo_test_api(),
mock_zenodo_search([mock_record])])
# for publishing updates with --replace option
def mock_get_no_search():
return ([mock_zenodo_test_api_fail(),
mock_zenodo_test_api()])
def mock_post_publish_then_update():
return ([mock_zenodo_deposit(1234567),
mock_zenodo_upload_descriptor(),
mock_zenodo_publish(1234567),
mock_zenodo_deposit_updated(1234567, 2345678),
mock_zenodo_upload_descriptor(),
mock_zenodo_publish(2345678)])
def mock_post_publish_update_only():
return ([mock_zenodo_deposit_updated(1234567, 2345678),
mock_zenodo_upload_descriptor(),
mock_zenodo_publish(2345678)])
def mock_put():
return mock_zenodo_update_metadata()
def mock_delete():
return mock_zenodo_delete_files()
def mock_get_auth_fail():
return mock_zenodo_test_api_fail()
class TestPublisher(TestCase):
def get_examples_dir(self):
return op.join(op.dirname(bfile),
"schema", "examples")
@mock.patch('requests.get', side_effect=mock_get_publish_then_update())
@mock.patch('requests.post', side_effect=mock_post_publish_then_update())
@mock.patch('requests.put', return_value=mock_put())
@mock.patch('requests.delete', return_value=mock_delete())
def test_publication(self, mock_get, mock_post, mock_put, mock_delete):
example1_dir = op.join(self.get_examples_dir(), "example1")
example1_desc = op.join(example1_dir, "example1_docker.json")
temp_descriptor = tempfile.NamedTemporaryFile(suffix=".json")
shutil.copyfile(example1_desc, temp_descriptor.name)
# Make sure that example1.json doesn't have a DOI yet
with open(temp_descriptor.name, 'r') as fhandle:
descriptor = json.load(fhandle)
assert(descriptor.get('doi') is None)
# Test publication of a descriptor that doesn't have a DOI
doi = bosh(["publish",
temp_descriptor.name,
"--sandbox", "-y", "-v",
"--zenodo-token", "hAaW2wSBZMskxpfigTYHcuDrC"
"PWr2VeQZgBLErKbfF5RdrKhzzJi8i2hnN8r"])
assert(doi)
# Now descriptor should have a DOI
with open(temp_descriptor.name, 'r') as fhandle:
descriptor = json.load(fhandle)
assert(descriptor.get('doi') == doi)
# Test publication of a descriptor that already has a DOI
with self.assertRaises(ZenodoError) as e:
bosh(["publish",
temp_descriptor.name,
"--sandbox", "-y", "-v",
"--zenodo-token", "hAaW2wSBZMskxpfigTYHcuDrC"
"PWr2VeQZgBLErKbfF5RdrKhzzJi8i2hnN8r"])
self.assertTrue("Descriptor already has a DOI" in str(e.exception))
# Test publication of an updated version of the same descriptor
example1_desc_updated = op.join(example1_dir,
"example1_docker_updated.json")
temp_descriptor_updated = tempfile.NamedTemporaryFile(suffix=".json")
shutil.copyfile(example1_desc_updated, temp_descriptor_updated.name)
with open(temp_descriptor_updated.name, 'r') as fhandle:
descriptor_updated = json.load(fhandle)
# Publish the updated version
new_doi = bosh(["publish",
temp_descriptor_updated.name,
"--sandbox", "-y", "-v",
"--zenodo-token", "hAaW2wSBZMskxpfigTYHcuDrC"
"PWr2VeQZgBLErKbfF5RdrKhzzJi8i2hnN8r"])
assert(new_doi)
# Updated version of descriptor should have a new DOI
with open(temp_descriptor_updated.name, 'r') as fhandle:
descriptor_updated = json.load(fhandle)
assert(descriptor_updated.get('doi') == new_doi)
assert(descriptor_updated.get('doi') != doi)
@mock.patch('requests.get', return_value=mock_get_auth_fail())
def test_publisher_auth(self, mock_get):
example1_dir = op.join(self.get_examples_dir(), "example1")
# Bad token should fail
with self.assertRaises(ZenodoError) as e:
bosh(["publish",
op.join(example1_dir, "example1_docker.json"),
"--sandbox",
"-y", "-v", "--zenodo-token", "12345"])
self.assertTrue("Cannot authenticate to Zenodo" in str(e.exception))
# No token should fail
with self.assertRaises(ZenodoError) as e:
bosh(["publish",
op.join(example1_dir,
"example1_docker.json"),
"--sandbox", "-y", "-v"])
self.assertTrue("Cannot authenticate to Zenodo" in str(e.exception))
# Right token should work
self.assertTrue(bosh, ["publish",
op.join(example1_dir,
"example1_docker.json"),
"--sandbox", "-y", "-v",
"--zenodo-token",
"hAaW2wSBZMskxpfigTYHcuDrC"
"PWr2VeQZgBLErKbfF5RdrKhzzJ"
"i8i2hnN8r"])
# Now no token should work (config file must have been updated)
self.assertTrue(bosh, ["publish",
op.join(example1_dir,
"example1_docker.json"),
"--sandbox", "-y", "-v"])
@mock.patch('requests.get', return_value=mock_get_auth_fail())
def test_publisher_auth_fail_cli(self, mock_get):
example1_dir = op.join(self.get_examples_dir(), "example1")
command = ("bosh publish " + op.join(example1_dir,
"example1_docker.json") +
" --sandbox -y -v "
"--zenodo-token 12345")
process = subprocess.Popen(command, shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
process.communicate()
self.assertTrue(process.returncode)
@mock.patch('requests.get', side_effect=mock_get_no_search())
@mock.patch('requests.post', side_effect=mock_post_publish_update_only())
@mock.patch('requests.put', return_value=mock_put())
@mock.patch('requests.delete', return_value=mock_delete())
def test_publication_replace_with_id(self, mock_get, mock_post, mock_put,
mock_delete):
example1_dir = op.join(self.get_examples_dir(), "example1")
example1_desc = op.join(example1_dir, "example1_docker.json")
temp_descriptor = tempfile.NamedTemporaryFile(suffix=".json")
shutil.copyfile(example1_desc, temp_descriptor.name)
# Make sure that example1.json doesn't have a DOI yet
with open(temp_descriptor.name, 'r') as fhandle:
descriptor = json.load(fhandle)
assert (descriptor.get('doi') is None)
# Publish an updated version of an already published descriptor
doi = bosh(["publish",
temp_descriptor.name,
"--sandbox", "-y", "-v",
"--zenodo-token", "hAaW2wSBZMskxpfigTYHcuDrC"
"PWr2VeQZgBLErKbfF5RdrKhzzJi8i2hnN8r",
"--id", "zenodo.1234567"])
assert (doi)
# Now descriptor should have a DOI
with open(temp_descriptor.name, 'r') as fhandle:
descriptor = json.load(fhandle)
assert (descriptor.get('doi') == doi)
@mock.patch('requests.get', side_effect=mock_get_no_search())
@mock.patch('requests.post', side_effect=mock_post_publish_update_only())
@mock.patch('requests.put', return_value=mock_put())
@mock.patch('requests.delete', return_value=mock_delete())
def test_publication_replace_no_id(self, mock_get, mock_post, mock_put,
mock_delete):
example1_dir = op.join(self.get_examples_dir(), "example1")
example1_desc = op.join(example1_dir, "example1_docker_with_doi.json")
temp_descriptor = tempfile.NamedTemporaryFile(suffix=".json")
shutil.copyfile(example1_desc, temp_descriptor.name)
# Make sure that descriptor has a DOI
with open(temp_descriptor.name, 'r') as fhandle:
descriptor = json.load(fhandle)
assert (descriptor.get('doi') is not None)
old_doi = descriptor['doi']
# Publish an updated version of an already published descriptor
doi = bosh(["publish",
temp_descriptor.name,
"--sandbox", "-y", "-v",
"--zenodo-token", "hAaW2wSBZMskxpfigTYHcuDrC"
"PWr2VeQZgBLErKbfF5RdrKhzzJi8i2hnN8r",
"--replace"])
assert (doi)
# Now descriptor should have a DOI which should be different
# than the old DOI
with open(temp_descriptor.name, 'r') as fhandle:
descriptor = json.load(fhandle)
assert (descriptor.get('doi') == doi)
assert(descriptor.get('doi') != old_doi)
| 41.543933
| 78
| 0.601068
| 1,061
| 9,929
| 5.393025
| 0.144204
| 0.051381
| 0.041594
| 0.026739
| 0.772981
| 0.74799
| 0.712688
| 0.7036
| 0.674065
| 0.650297
| 0
| 0.02239
| 0.293786
| 9,929
| 238
| 79
| 41.718487
| 0.793639
| 0.083996
| 0
| 0.564246
| 0
| 0
| 0.145124
| 0.044959
| 0
| 0
| 0
| 0
| 0.122905
| 1
| 0.072626
| false
| 0
| 0.078212
| 0.039106
| 0.201117
| 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
|
fd6567bc5c4307e10de6a428b6c11a26b0eb8c2f
| 129
|
py
|
Python
|
myadmin/forms.py
|
JohnJohnsonOkah/savests_admin
|
39a1b8bd0bf2f130a293fa28defdfdbc1a7b640a
|
[
"MIT"
] | null | null | null |
myadmin/forms.py
|
JohnJohnsonOkah/savests_admin
|
39a1b8bd0bf2f130a293fa28defdfdbc1a7b640a
|
[
"MIT"
] | 5
|
2021-03-19T08:29:49.000Z
|
2021-09-22T19:24:54.000Z
|
myadmin/forms.py
|
jjokah/savests_admin
|
39a1b8bd0bf2f130a293fa28defdfdbc1a7b640a
|
[
"MIT"
] | null | null | null |
from django import forms
class EmailPostForm(forms.Form):
message = forms.CharField(required=False, widget=forms.Textarea)
| 21.5
| 68
| 0.782946
| 16
| 129
| 6.3125
| 0.8125
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.124031
| 129
| 5
| 69
| 25.8
| 0.893805
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
fd9155622b0d596b5c045c3d3b1f9031fa2cc836
| 1,423
|
py
|
Python
|
uniswap/entities/fractions/currency_amount.py
|
anthony-hicks/uniswap-sdk-python
|
f4e80cde23d988aa96ef28a420c689211cc26e4a
|
[
"MIT"
] | 1
|
2021-02-24T02:40:17.000Z
|
2021-02-24T02:40:17.000Z
|
uniswap/entities/fractions/currency_amount.py
|
anthony-hicks/uniswap-sdk-python
|
f4e80cde23d988aa96ef28a420c689211cc26e4a
|
[
"MIT"
] | 7
|
2021-02-07T19:46:25.000Z
|
2021-02-21T01:45:51.000Z
|
uniswap/entities/fractions/currency_amount.py
|
anthony-hicks/uniswap-sdk-python
|
f4e80cde23d988aa96ef28a420c689211cc26e4a
|
[
"MIT"
] | null | null | null |
from ..token import currency_equals
from ..currency import Currency, ETHER
from ...constants import SolidityType
from ...utils import validate_solidity_type_instance
from .fraction import Fraction
class CurrencyAmount(Fraction):
@property
def currency(self):
return self._currency
@staticmethod
def ether(amount):
""" Helper that calls the constructor with the ETHER currency
Args:
amount (int): ether amount in wei
"""
return CurrencyAmount(ETHER, amount)
def __init__(self, currency, amount):
""" amount _must_ be raw, i.e. in the native representation """
validate_solidity_type_instance(amount, SolidityType.uint256)
super().__init__(amount, 10**currency.decimals)
self._currency = currency
@property
def raw(self):
return self.numerator
def __add__(self, other):
if not currency_equals(self.currency, other.currency):
raise ValueError('TOKEN')
return CurrencyAmount(self.currency, self.raw + other.raw)
def __sub__(self, other):
if not currency_equals(self.currency, other.currency):
raise ValueError('TOKEN')
return CurrencyAmount(self.currency, self.raw - other.raw)
# TODO
def to_significant(self):
pass
# TODO
def to_fixed(self):
pass
# TODO
def to_exact(self):
pass
| 24.964912
| 71
| 0.652846
| 161
| 1,423
| 5.571429
| 0.360248
| 0.093645
| 0.0301
| 0.06243
| 0.305463
| 0.267559
| 0.267559
| 0.267559
| 0.267559
| 0.267559
| 0
| 0.004744
| 0.259311
| 1,423
| 56
| 72
| 25.410714
| 0.8463
| 0.12298
| 0
| 0.272727
| 0
| 0
| 0.008278
| 0
| 0
| 0
| 0
| 0.017857
| 0
| 1
| 0.272727
| false
| 0.090909
| 0.151515
| 0.060606
| 0.606061
| 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
| 1
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 4
|
fd923c86c1440c0006057d03a89e962305ffec61
| 391
|
py
|
Python
|
app/trefle/errors.py
|
rinkekj/greenhouse-manager
|
08eddc800eefd0eeb6dbb08ce1f0fd787c3a60c4
|
[
"MIT"
] | null | null | null |
app/trefle/errors.py
|
rinkekj/greenhouse-manager
|
08eddc800eefd0eeb6dbb08ce1f0fd787c3a60c4
|
[
"MIT"
] | null | null | null |
app/trefle/errors.py
|
rinkekj/greenhouse-manager
|
08eddc800eefd0eeb6dbb08ce1f0fd787c3a60c4
|
[
"MIT"
] | null | null | null |
from flask import render_template
from app.trefle.views import trefle
@trefle.app_errorhandler(403)
def forbidden(_):
return render_template('errors/403.html'), 403
@trefle.app_errorhandler(404)
def page_not_found(_):
return render_template('errors/404.html'), 404
@trefle.app_errorhandler(500)
def internal_server_error(_):
return render_template('errors/500.html'), 500
| 20.578947
| 50
| 0.772379
| 54
| 391
| 5.333333
| 0.425926
| 0.194444
| 0.21875
| 0.270833
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.078035
| 0.11509
| 391
| 18
| 51
| 21.722222
| 0.754335
| 0
| 0
| 0
| 0
| 0
| 0.11509
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.272727
| false
| 0
| 0.181818
| 0.272727
| 0.727273
| 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
| 1
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 4
|
fda40a4dd9f9cb60411e9119441b2fafca4274c1
| 61
|
py
|
Python
|
practice/prac2.py
|
nilavya2000/my_python
|
1323ca7cef2111cc91ef9ff3b596590e0e1c97ef
|
[
"MIT"
] | null | null | null |
practice/prac2.py
|
nilavya2000/my_python
|
1323ca7cef2111cc91ef9ff3b596590e0e1c97ef
|
[
"MIT"
] | null | null | null |
practice/prac2.py
|
nilavya2000/my_python
|
1323ca7cef2111cc91ef9ff3b596590e0e1c97ef
|
[
"MIT"
] | 1
|
2020-02-27T18:14:05.000Z
|
2020-02-27T18:14:05.000Z
|
t=[224, 228, 332, 784, 787]
new=[i/10 for i in t]
print(new)
| 15.25
| 27
| 0.606557
| 15
| 61
| 2.466667
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.34
| 0.180328
| 61
| 3
| 28
| 20.333333
| 0.4
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.333333
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
fdbbff0e30d0ed6b060ae0e7c7ba002423789f6f
| 243
|
py
|
Python
|
backend/api/apps/suite/query.py
|
vivekthoppil/InsuranceSuite
|
700392ee71f4afeefb4f2fb768402d4839b992e2
|
[
"MIT"
] | 2
|
2021-05-20T06:11:48.000Z
|
2022-02-06T16:09:54.000Z
|
backend/api/apps/suite/query.py
|
vivekthoppil/InsuranceSuite
|
700392ee71f4afeefb4f2fb768402d4839b992e2
|
[
"MIT"
] | 8
|
2021-03-10T03:57:49.000Z
|
2022-01-22T10:12:43.000Z
|
backend/api/apps/suite/query.py
|
vivekthoppil/InsuranceSuite
|
700392ee71f4afeefb4f2fb768402d4839b992e2
|
[
"MIT"
] | null | null | null |
from django.db import models
class RiskTypeQuerySet(models.QuerySet):
def get_non_deleted(self):
return self.filter(deleted=False)
def get_basic_info(self):
return self.values('id', 'name', 'description', 'deleted')
| 24.3
| 66
| 0.699588
| 31
| 243
| 5.354839
| 0.709677
| 0.072289
| 0.168675
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.18107
| 243
| 9
| 67
| 27
| 0.834171
| 0
| 0
| 0
| 0
| 0
| 0.098765
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.166667
| 0.333333
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
fdfaeabe234559e1762ea56ef0bd7cb362a21a31
| 39
|
py
|
Python
|
tests/test_shapes/__init__.py
|
stephen1000/shapepy
|
ec96f4ccb6bb7d540293c68e3d4b41a8394256ef
|
[
"Apache-2.0"
] | null | null | null |
tests/test_shapes/__init__.py
|
stephen1000/shapepy
|
ec96f4ccb6bb7d540293c68e3d4b41a8394256ef
|
[
"Apache-2.0"
] | null | null | null |
tests/test_shapes/__init__.py
|
stephen1000/shapepy
|
ec96f4ccb6bb7d540293c68e3d4b41a8394256ef
|
[
"Apache-2.0"
] | null | null | null |
""" Tests for the shapes subpackage """
| 39
| 39
| 0.692308
| 5
| 39
| 5.4
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.153846
| 39
| 1
| 39
| 39
| 0.818182
| 0.794872
| 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
|
8bf1acc6ca28fdecd7d7ac138f41b634b9d191fe
| 917
|
py
|
Python
|
aiotdlib/api/functions/get_user.py
|
jraylan/aiotdlib
|
4528fcfca7c5c69b54a878ce6ce60e934a2dcc73
|
[
"MIT"
] | 37
|
2021-05-04T10:41:41.000Z
|
2022-03-30T13:48:05.000Z
|
aiotdlib/api/functions/get_user.py
|
jraylan/aiotdlib
|
4528fcfca7c5c69b54a878ce6ce60e934a2dcc73
|
[
"MIT"
] | 13
|
2021-07-17T19:54:51.000Z
|
2022-02-26T06:50:00.000Z
|
aiotdlib/api/functions/get_user.py
|
jraylan/aiotdlib
|
4528fcfca7c5c69b54a878ce6ce60e934a2dcc73
|
[
"MIT"
] | 7
|
2021-09-22T21:27:11.000Z
|
2022-02-20T02:33:19.000Z
|
# =============================================================================== #
# #
# This file has been generated automatically!! Do not change this manually! #
# #
# =============================================================================== #
from __future__ import annotations
from pydantic import Field
from ..base_object import BaseObject
class GetUser(BaseObject):
"""
Returns information about a user by their identifier. This is an offline request if the current user is not a bot
:param user_id: User identifier
:type user_id: :class:`int`
"""
ID: str = Field("getUser", alias="@type")
user_id: int
@staticmethod
def read(q: dict) -> GetUser:
return GetUser.construct(**q)
| 32.75
| 117
| 0.429662
| 77
| 917
| 5.012987
| 0.649351
| 0.046632
| 0.051813
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.335878
| 917
| 27
| 118
| 33.962963
| 0.633826
| 0.631407
| 0
| 0
| 1
| 0
| 0.040678
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.111111
| false
| 0
| 0.333333
| 0.111111
| 0.888889
| 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
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
|
0
| 4
|
e34f33d226679140650ec3b892255a6052e52949
| 218
|
py
|
Python
|
src/users/admin.py
|
andgein/sis-2017-winter-olymp
|
e6cf290ab2c24a22ca76949895e2a6cc6d818dc0
|
[
"MIT"
] | null | null | null |
src/users/admin.py
|
andgein/sis-2017-winter-olymp
|
e6cf290ab2c24a22ca76949895e2a6cc6d818dc0
|
[
"MIT"
] | null | null | null |
src/users/admin.py
|
andgein/sis-2017-winter-olymp
|
e6cf290ab2c24a22ca76949895e2a6cc6d818dc0
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from . import models
class UserInfoAdmin(admin.ModelAdmin):
list_display = ('id', 'user', 'open_locality', 'ejudge_user_id')
admin.site.register(models.UserInfo, UserInfoAdmin)
| 21.8
| 68
| 0.761468
| 27
| 218
| 6
| 0.703704
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.119266
| 218
| 9
| 69
| 24.222222
| 0.84375
| 0
| 0
| 0
| 0
| 0
| 0.151376
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.4
| 0
| 0.8
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
e36a71151c53139e7010e0e64f92a42d66fed0f4
| 2,115
|
py
|
Python
|
Python/AgentPool/ProxyPool/ProxyDBHelper.py
|
ndlwill/iOS
|
20e693c753c17016f2bacbc42a1c6aa8b1840d29
|
[
"MIT"
] | 5
|
2020-09-06T08:22:27.000Z
|
2021-09-22T05:32:53.000Z
|
Python/AgentPool/ProxyPool/ProxyDBHelper.py
|
ndlwill/iOS
|
20e693c753c17016f2bacbc42a1c6aa8b1840d29
|
[
"MIT"
] | null | null | null |
Python/AgentPool/ProxyPool/ProxyDBHelper.py
|
ndlwill/iOS
|
20e693c753c17016f2bacbc42a1c6aa8b1840d29
|
[
"MIT"
] | 5
|
2020-04-29T11:20:00.000Z
|
2021-11-09T08:49:20.000Z
|
from redis import StrictRedis
from random import choice
import re
# from ProxyPool.Configure import *
from ProxyPool.Configure import REDIS_HOST, REDIS_PORT, REDIS_PASSWORD, REDIS_KEY
from ProxyPool.Configure import MAX_SCORE, MIN_SCORE, INITIAL_SCORE
from ProxyPool.ProxyPoolError import PoolEmptyError
# 存储模块
class RedisClient(object):
def __init__(self, host=REDIS_HOST, port=REDIS_PORT, password=REDIS_PASSWORD):
self.db = StrictRedis(host=host, port=port, password=password, decode_responses=True)
def add(self, proxy, score=INITIAL_SCORE):
'''
添加代理
:param proxy:proxy地址
:param score:
:return:
'''
if not re.match('\d+\.\d+\.\d+\.\d+\:\d+', proxy):
print('代理地址不符合规范')
return
if not self.db.zscore(REDIS_KEY, proxy):
return self.db.zadd(REDIS_KEY, score, proxy)
def random(self):
result = self.db.zrangebyscore(REDIS_KEY, MAX_SCORE, MAX_SCORE)
if len(result):
return choice(result)
else:
# 从大到小排序
result = self.db.zrevrange(REDIS_KEY, MIN_SCORE, MAX_SCORE)
if len(result):
return choice(result)
else:
raise PoolEmptyError
def decrease(self, proxy):
score = self.db.zscore(REDIS_KEY, proxy)
if score and score > MIN_SCORE:
print('代理:', proxy, 'score:', score, '-1')
return self.db.zincrby(REDIS_KEY, proxy, -1)
else:
print('代理:', proxy, 'score:', score, 'remove')
return self.db.zrem(REDIS_KEY, proxy)
def exists(self, proxy):
return not self.db.zscore(REDIS_KEY, proxy) == None
def update_score_to_max(self, proxy):
# return: 设置结果
return self.db.zadd(REDIS_KEY, MAX_SCORE, proxy)
def count(self):
return self.db.zcard(REDIS_KEY)
def total_list(self):
return self.db.zrangebyscore(REDIS_KEY, MIN_SCORE, MAX_SCORE)
def range_list(self, from_value, to_value):
return self.db.zrevrange(REDIS_KEY, from_value, to_value - 1)
| 32.045455
| 93
| 0.626478
| 270
| 2,115
| 4.740741
| 0.255556
| 0.08125
| 0.065625
| 0.065625
| 0.3
| 0.2
| 0.115625
| 0.071875
| 0.071875
| 0.071875
| 0
| 0.001931
| 0.265248
| 2,115
| 66
| 94
| 32.045455
| 0.82175
| 0.051064
| 0
| 0.162791
| 0
| 0
| 0.029637
| 0.011753
| 0
| 0
| 0
| 0
| 0
| 1
| 0.209302
| false
| 0.069767
| 0.139535
| 0.116279
| 0.627907
| 0.069767
| 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
|
e36aa086ca59532f60f570a0972ff550efa78f36
| 293
|
py
|
Python
|
Exercicios-Mundo1/ex007.py
|
WeDias/RespCEV
|
3cf0918c5c90e3b2d6dc7e57f2824436c639c04c
|
[
"MIT"
] | 1
|
2021-02-19T05:13:31.000Z
|
2021-02-19T05:13:31.000Z
|
Exercicios-Mundo1/ex007.py
|
WeDias/RespCEV
|
3cf0918c5c90e3b2d6dc7e57f2824436c639c04c
|
[
"MIT"
] | null | null | null |
Exercicios-Mundo1/ex007.py
|
WeDias/RespCEV
|
3cf0918c5c90e3b2d6dc7e57f2824436c639c04c
|
[
"MIT"
] | null | null | null |
nota1 = float(input('Digite a primeira nota '))
nota2 = float(input('Digite a segunda nota '))
nota3 = float(input('Digite a terceira nota '))
nota4 = float(input('Digite a ultima nota '))
media = (nota1 + nota2 + nota3 + nota4) / 4
print('PARABENS!! A sua média é de: {}!'.format(media))
| 48.833333
| 55
| 0.665529
| 43
| 293
| 4.534884
| 0.511628
| 0.205128
| 0.328205
| 0.348718
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.037037
| 0.170648
| 293
| 6
| 55
| 48.833333
| 0.765432
| 0
| 0
| 0
| 0
| 0
| 0.418685
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.166667
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
8b56b7a817d078c7ead6de948bf6d246ddc53470
| 192
|
py
|
Python
|
src/OTLMOW/OTLModel/BaseClasses/OTLAsset.py
|
davidvlaminck/OTLClassPython
|
71330afeb37c3ea6d9981f521ff8f4a3f8b946fc
|
[
"MIT"
] | 2
|
2022-02-01T08:58:11.000Z
|
2022-02-08T13:35:17.000Z
|
src/OTLMOW/OTLModel/BaseClasses/OTLAsset.py
|
davidvlaminck/OTLMOW
|
71330afeb37c3ea6d9981f521ff8f4a3f8b946fc
|
[
"MIT"
] | null | null | null |
src/OTLMOW/OTLModel/BaseClasses/OTLAsset.py
|
davidvlaminck/OTLMOW
|
71330afeb37c3ea6d9981f521ff8f4a3f8b946fc
|
[
"MIT"
] | null | null | null |
from abc import abstractmethod
from OTLMOW.OTLModel.BaseClasses.OTLObject import OTLObject
class OTLAsset(OTLObject):
@abstractmethod
def __init__(self):
super().__init__()
| 19.2
| 59
| 0.75
| 20
| 192
| 6.8
| 0.7
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.171875
| 192
| 9
| 60
| 21.333333
| 0.855346
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| 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
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
8b5aef5c91eea77cedbd9df0bff4b2cdaea24f50
| 322
|
py
|
Python
|
src/agents/__init__.py
|
MelleStarke/MAS_B06
|
fbedc7459006c0915428f0122d923dd41b57b51e
|
[
"MIT"
] | null | null | null |
src/agents/__init__.py
|
MelleStarke/MAS_B06
|
fbedc7459006c0915428f0122d923dd41b57b51e
|
[
"MIT"
] | null | null | null |
src/agents/__init__.py
|
MelleStarke/MAS_B06
|
fbedc7459006c0915428f0122d923dd41b57b51e
|
[
"MIT"
] | null | null | null |
from .coordinator_agent import CAgent
from .knowledge_agent import KMAgent
from .optimization_agent import OAgent
from .order_allocation_agent import OAAgent
from .project_release_agent import PRAgent
from .supplier_agent import SAgent
from .supplier_selection_agent import SSAgent
__all__ = [export for export in dir()]
| 32.2
| 45
| 0.850932
| 44
| 322
| 5.909091
| 0.545455
| 0.296154
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.111801
| 322
| 9
| 46
| 35.777778
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.875
| 0
| 0.875
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
8b5ed0b2968bb00c0cd233bd98f0df159db1dc43
| 8
|
py
|
Python
|
main.py
|
yhorodnichenko/test
|
7d2e61a170472dd4ea1cf234d82613b1dc260a34
|
[
"MIT"
] | null | null | null |
main.py
|
yhorodnichenko/test
|
7d2e61a170472dd4ea1cf234d82613b1dc260a34
|
[
"MIT"
] | null | null | null |
main.py
|
yhorodnichenko/test
|
7d2e61a170472dd4ea1cf234d82613b1dc260a34
|
[
"MIT"
] | null | null | null |
# Test
| 4
| 7
| 0.5
| 1
| 8
| 4
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.375
| 8
| 1
| 8
| 8
| 0.8
| 0.5
| 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
|
8baf3feded4c431bb463129a61e87780440dcfc1
| 61
|
py
|
Python
|
ninjalooter.py
|
ewjax/ninjalooter
|
9faf94eed56de3c375cca4d1be24eab20dc7b226
|
[
"MIT"
] | 4
|
2020-08-30T12:57:03.000Z
|
2022-03-18T15:11:13.000Z
|
ninjalooter.py
|
ewjax/ninjalooter
|
9faf94eed56de3c375cca4d1be24eab20dc7b226
|
[
"MIT"
] | 5
|
2022-01-07T03:17:32.000Z
|
2022-03-27T21:20:12.000Z
|
ninjalooter.py
|
ewjax/ninjalooter
|
9faf94eed56de3c375cca4d1be24eab20dc7b226
|
[
"MIT"
] | 1
|
2021-12-28T02:18:04.000Z
|
2021-12-28T02:18:04.000Z
|
from ninjalooter.cmd import run
print("Starting")
run.run()
| 12.2
| 31
| 0.754098
| 9
| 61
| 5.111111
| 0.777778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.114754
| 61
| 4
| 32
| 15.25
| 0.851852
| 0
| 0
| 0
| 0
| 0
| 0.131148
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0.333333
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
8bc36b1c4c6a61df95d9caf66b13284419d91fae
| 5,901
|
py
|
Python
|
tests/test_context.py
|
Hirni-Meshram5/moderngl
|
ba13c4ce4a993a35ba0415599daabecb919803d5
|
[
"MIT"
] | 916
|
2019-03-11T19:15:20.000Z
|
2022-03-31T19:22:16.000Z
|
tests/test_context.py
|
sthagen/moderngl
|
5a07bbf8990022c153b09a1ca044b3ace8e0c083
|
[
"MIT"
] | 218
|
2019-03-11T06:05:52.000Z
|
2022-03-30T16:59:22.000Z
|
tests/test_context.py
|
sthagen/moderngl
|
5a07bbf8990022c153b09a1ca044b3ace8e0c083
|
[
"MIT"
] | 110
|
2019-04-06T18:32:24.000Z
|
2022-03-21T20:30:47.000Z
|
from unittest import TestCase
import moderngl
import numpy
import platform
class ContextTests(TestCase):
def test_create_destroy(self):
"""Create and destroy a context"""
for _ in range(25):
ctx = moderngl.create_context(standalone=True)
ctx.release()
def test_context_switch(self):
"""Ensure context switching is working"""
ctx1 = moderngl.create_context(standalone=True)
ctx2 = moderngl.create_context(standalone=True)
with ctx1 as ctx:
buffer1 = ctx.buffer(reserve=1024)
with ctx2 as ctx:
buffer2 = ctx.buffer(reserve=1024)
self.assertEqual(buffer1.glo, buffer2.glo)
ctx1.release()
ctx2.release()
def test_exit(self):
"""Ensure the previous context was activated on exit"""
ctx1 = moderngl.create_context(standalone=True)
ctx2 = moderngl.create_context(standalone=True)
with ctx1 as ctx:
ctx.buffer(reserve=1024)
# Will error out if no context is active "moderngl.error.Error: cannot create buffer"
ctx1.buffer(reserve=1024)
ctx1.release()
ctx2.release()
def test_share(self):
"""Create resources with shared context"""
if platform.system().lower() in ["darwin", "linux"]:
self.skipTest('Context sharing not supported on darwin')
data1 = numpy.array([1, 2, 3, 4], dtype='u1')
data2 = numpy.array([4, 3, 2, 1], dtype='u1')
ctx1 = moderngl.create_context(standalone=True)
ctx2 = moderngl.create_context(standalone=True, share=True)
with ctx1 as ctx:
b1 = ctx.buffer(data=data1)
with ctx2 as ctx:
b2 = ctx.buffer(data=data2)
# Because the resources are shared the name should increment
self.assertEqual(b1.glo, 1)
self.assertEqual(b2.glo, 2)
# Ensure we can read the same buffer data in both contexts
with ctx1:
self.assertEqual(b1.read(), b'\x01\x02\x03\x04')
self.assertEqual(b2.read(), b'\x04\x03\x02\x01')
with ctx2:
self.assertEqual(b1.read(), b'\x01\x02\x03\x04')
self.assertEqual(b2.read(), b'\x04\x03\x02\x01')
ctx1.release()
ctx2.release()
def test_extensions(self):
ctx = moderngl.create_context(standalone=True)
# self.assertTrue("GL_ARB_vertex_array_object" in ctx.extensions)
# self.assertTrue("GL_ARB_transform_feedback2" in ctx.extensions)
# self.assertTrue("GL_ARB_shader_subroutine" in ctx.extensions)
self.assertIsInstance(ctx.extensions, set)
self.assertTrue(len(ctx.extensions) > 0)
ctx.release()
def test_attributes(self):
"""Ensure enums are present in the context instance"""
ctx = moderngl.create_context(standalone=True)
# Flags
self.assertIsInstance(ctx.NOTHING, int)
self.assertIsInstance(ctx.BLEND, int)
self.assertIsInstance(ctx.DEPTH_TEST, int)
self.assertIsInstance(ctx.CULL_FACE, int)
self.assertIsInstance(ctx.RASTERIZER_DISCARD, int)
self.assertIsInstance(ctx.PROGRAM_POINT_SIZE, int)
# Primitive modes
self.assertIsInstance(ctx.POINTS, int)
self.assertIsInstance(ctx.LINES, int)
self.assertIsInstance(ctx.LINE_LOOP, int)
self.assertIsInstance(ctx.LINE_STRIP, int)
self.assertIsInstance(ctx.TRIANGLES, int)
self.assertIsInstance(ctx.TRIANGLE_STRIP, int)
self.assertIsInstance(ctx.TRIANGLE_FAN, int)
self.assertIsInstance(ctx.LINES_ADJACENCY, int)
self.assertIsInstance(ctx.LINE_STRIP_ADJACENCY, int)
self.assertIsInstance(ctx.TRIANGLES_ADJACENCY, int)
self.assertIsInstance(ctx.TRIANGLE_STRIP_ADJACENCY, int)
self.assertIsInstance(ctx.PATCHES, int)
# Texture filters
self.assertIsInstance(ctx.LINEAR, int)
self.assertIsInstance(ctx.NEAREST, int)
self.assertIsInstance(ctx.NEAREST_MIPMAP_NEAREST, int)
self.assertIsInstance(ctx.LINEAR_MIPMAP_LINEAR, int)
self.assertIsInstance(ctx.LINEAR_MIPMAP_NEAREST, int)
self.assertIsInstance(ctx.NEAREST_MIPMAP_LINEAR, int)
# Blend functions
self.assertIsInstance(ctx.ZERO, int)
self.assertIsInstance(ctx.ONE, int)
self.assertIsInstance(ctx.SRC_COLOR, int)
self.assertIsInstance(ctx.ONE_MINUS_SRC_COLOR, int)
self.assertIsInstance(ctx.SRC_ALPHA, int)
self.assertIsInstance(ctx.ONE_MINUS_SRC_ALPHA, int)
self.assertIsInstance(ctx.DST_ALPHA, int)
self.assertIsInstance(ctx.ONE_MINUS_DST_ALPHA, int)
self.assertIsInstance(ctx.DST_COLOR, int)
self.assertIsInstance(ctx.ONE_MINUS_DST_COLOR, int)
# Blend shortcuts
self.assertIsInstance(ctx.DEFAULT_BLENDING, tuple)
self.assertIsInstance(ctx.ADDITIVE_BLENDING, tuple)
self.assertIsInstance(ctx.PREMULTIPLIED_ALPHA, tuple)
# Blend equations
self.assertIsInstance(ctx.FUNC_ADD, int)
self.assertIsInstance(ctx.FUNC_SUBTRACT, int)
self.assertIsInstance(ctx.FUNC_REVERSE_SUBTRACT, int)
self.assertIsInstance(ctx.MIN, int)
self.assertIsInstance(ctx.MAX, int)
# Provoking vertex
self.assertIsInstance(ctx.FIRST_VERTEX_CONVENTION, int)
self.assertIsInstance(ctx.LAST_VERTEX_CONVENTION, int)
def test_enable_direct(self):
ctx = moderngl.create_context(standalone=True)
ctx.error # consume error during initialization
# We already support this, but it's a safe value
GL_PROGRAM_POINT_SIZE = 0x8642
ctx.enable_direct(GL_PROGRAM_POINT_SIZE)
self.assertEqual(ctx.error, "GL_NO_ERROR")
ctx.disable_direct(GL_PROGRAM_POINT_SIZE)
self.assertEqual(ctx.error, "GL_NO_ERROR")
| 37.348101
| 93
| 0.667006
| 699
| 5,901
| 5.493562
| 0.257511
| 0.234375
| 0.269531
| 0.236979
| 0.51224
| 0.389323
| 0.251042
| 0.132292
| 0.132292
| 0.132292
| 0
| 0.023276
| 0.235553
| 5,901
| 157
| 94
| 37.585987
| 0.827976
| 0.131673
| 0
| 0.261682
| 0
| 0
| 0.027537
| 0
| 0
| 0
| 0.00118
| 0
| 0.514019
| 1
| 0.065421
| false
| 0
| 0.037383
| 0
| 0.11215
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
475985aa51df28a6dd183d452dca759f6f3f0374
| 308
|
py
|
Python
|
fauxcaml/parsing/__init__.py
|
eignnx/fauxcaml
|
082625f5803d6f676c0d63b6ce45b03a6069d720
|
[
"MIT"
] | 1
|
2019-05-11T00:49:48.000Z
|
2019-05-11T00:49:48.000Z
|
fauxcaml/parsing/__init__.py
|
eignnx/fauxcaml
|
082625f5803d6f676c0d63b6ce45b03a6069d720
|
[
"MIT"
] | 5
|
2019-04-01T21:36:17.000Z
|
2019-05-13T22:04:58.000Z
|
fauxcaml/parsing/__init__.py
|
eignnx/fauxcaml
|
082625f5803d6f676c0d63b6ce45b03a6069d720
|
[
"MIT"
] | null | null | null |
from fauxcaml.semantics import syntax
from . import lexer
from . import parser
def parse(src_text: str) -> syntax.TopLevelStmts:
return parser.parser.parse(lexer.lexer.lex(src_text))
def parse_expr(src_text: str) -> syntax.AstNode:
stmt_txt = src_text + ";;"
return parse(stmt_txt).stmts[0]
| 22
| 57
| 0.727273
| 45
| 308
| 4.822222
| 0.466667
| 0.129032
| 0.092166
| 0.147465
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.003846
| 0.155844
| 308
| 13
| 58
| 23.692308
| 0.830769
| 0
| 0
| 0
| 0
| 0
| 0.006515
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.375
| 0.125
| 0.875
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 1
| 1
| 0
|
0
| 4
|
4788621e1d40acbac1804e50db5281a69c4e3ec0
| 65
|
py
|
Python
|
yt/tests/__init__.py
|
kastalpes/yt
|
b1e197ca84433fbd61eaf44b28ff5cdb37981d4c
|
[
"BSD-3-Clause-Clear"
] | 1
|
2021-11-29T21:59:06.000Z
|
2021-11-29T21:59:06.000Z
|
yt/tests/__init__.py
|
kastalpes/yt
|
b1e197ca84433fbd61eaf44b28ff5cdb37981d4c
|
[
"BSD-3-Clause-Clear"
] | null | null | null |
yt/tests/__init__.py
|
kastalpes/yt
|
b1e197ca84433fbd61eaf44b28ff5cdb37981d4c
|
[
"BSD-3-Clause-Clear"
] | 1
|
2020-07-17T02:55:58.000Z
|
2020-07-17T02:55:58.000Z
|
"""Tests for generic yt functionality and codebase-wide tests"""
| 32.5
| 64
| 0.769231
| 9
| 65
| 5.555556
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.123077
| 65
| 1
| 65
| 65
| 0.877193
| 0.892308
| 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
|
47b15e0072d44e94bbfb9434db8338105b3126aa
| 1,414
|
py
|
Python
|
autorest/multiapi/models/mixin_operation.py
|
qwordy/autorest.python
|
6b12df51c2a39a1285546b5a771b69f5896e794f
|
[
"MIT"
] | 35
|
2018-04-03T12:15:53.000Z
|
2022-03-11T14:03:34.000Z
|
autorest/multiapi/models/mixin_operation.py
|
qwordy/autorest.python
|
6b12df51c2a39a1285546b5a771b69f5896e794f
|
[
"MIT"
] | 652
|
2017-08-28T22:44:41.000Z
|
2022-03-31T21:20:31.000Z
|
autorest/multiapi/models/mixin_operation.py
|
qwordy/autorest.python
|
6b12df51c2a39a1285546b5a771b69f5896e794f
|
[
"MIT"
] | 29
|
2017-08-28T20:57:01.000Z
|
2022-03-11T14:03:38.000Z
|
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
from typing import Any, Dict, List, TypeVar
from ..utils import _sync_or_async
T = TypeVar('T')
OrderedSet = Dict[T, None]
class MixinOperation:
def __init__(self, name: str, mixin_operation_metadata: Dict[str, Any]):
self.name = name
self.mixin_operation_metadata = mixin_operation_metadata
self._available_apis: OrderedSet[str] = {}
def signature(self, async_mode: bool) -> str:
return self.mixin_operation_metadata[_sync_or_async(async_mode)]["signature"]
def description(self, async_mode: bool) -> str:
return self.mixin_operation_metadata[_sync_or_async(async_mode)]["doc"]
def coroutine(self, async_mode: bool) -> bool:
if not async_mode:
return False
return self.mixin_operation_metadata["async"]["coroutine"]
@property
def call(self) -> str:
return self.mixin_operation_metadata["call"]
@property
def available_apis(self) -> List[str]:
return list(self._available_apis.keys())
def append_available_api(self, val: str) -> None:
self._available_apis[val] = None
| 36.25641
| 85
| 0.623055
| 163
| 1,414
| 5.147239
| 0.374233
| 0.116806
| 0.183552
| 0.154946
| 0.25149
| 0.213349
| 0.171633
| 0.171633
| 0.171633
| 0.171633
| 0
| 0
| 0.178925
| 1,414
| 38
| 86
| 37.210526
| 0.722653
| 0.211457
| 0
| 0.08
| 0
| 0
| 0.027953
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.28
| false
| 0
| 0.08
| 0.16
| 0.64
| 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
|
47dca803298ae83c1167cbfc768e2fffe00e1770
| 131
|
py
|
Python
|
app.py
|
MOHIT6879/dislexiadetection
|
b15d50d72c43f07b5827e0ebf0d1f07f5d2d4284
|
[
"MIT"
] | null | null | null |
app.py
|
MOHIT6879/dislexiadetection
|
b15d50d72c43f07b5827e0ebf0d1f07f5d2d4284
|
[
"MIT"
] | null | null | null |
app.py
|
MOHIT6879/dislexiadetection
|
b15d50d72c43f07b5827e0ebf0d1f07f5d2d4284
|
[
"MIT"
] | null | null | null |
import streamlit as st
from predict_page import main
st.sidebar.selectbox("Explore or Predict",("Explore","Predict"))
main()
| 21.833333
| 65
| 0.740458
| 18
| 131
| 5.333333
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.137405
| 131
| 5
| 66
| 26.2
| 0.849558
| 0
| 0
| 0
| 0
| 0
| 0.253968
| 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
|
47dda2d1badfbab7e0adf313bd373c1614554b48
| 292
|
py
|
Python
|
objectModel/Python/cdm/__init__.py
|
aaron-emde/CDM
|
9472e9c7694821ac4a9bbe608557d2e65aabc73e
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
objectModel/Python/cdm/__init__.py
|
aaron-emde/CDM
|
9472e9c7694821ac4a9bbe608557d2e65aabc73e
|
[
"CC-BY-4.0",
"MIT"
] | 3
|
2021-05-11T23:57:12.000Z
|
2021-08-04T05:03:05.000Z
|
objectModel/Python/cdm/__init__.py
|
aaron-emde/CDM
|
9472e9c7694821ac4a9bbe608557d2e65aabc73e
|
[
"CC-BY-4.0",
"MIT"
] | null | null | null |
# ------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation.
# All rights reserved.
# ------------------------------------------------------------------------------
name = "commondatamodel_objectmodel"
__version__ = '0.9.0preview1'
| 41.714286
| 81
| 0.342466
| 15
| 292
| 6.4
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.014652
| 0.065068
| 292
| 6
| 82
| 48.666667
| 0.333333
| 0.736301
| 0
| 0
| 0
| 0
| 0.56338
| 0.380282
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
47fe61b05f18c1ffb41b3edfad30211c2545eef9
| 87
|
py
|
Python
|
qa327_test/backend/Backend_Tests.py
|
Wiederickj/327-Repo
|
3b77c63101e423e1d43ebb8ecb127ac81354f911
|
[
"MIT"
] | null | null | null |
qa327_test/backend/Backend_Tests.py
|
Wiederickj/327-Repo
|
3b77c63101e423e1d43ebb8ecb127ac81354f911
|
[
"MIT"
] | 5
|
2020-10-08T17:24:22.000Z
|
2020-12-15T02:32:27.000Z
|
qa327_test/backend/Backend_Tests.py
|
Wiederickj/327-Repo
|
3b77c63101e423e1d43ebb8ecb127ac81354f911
|
[
"MIT"
] | null | null | null |
#Other tests stored here, ie, buy, login, logout, register, sell, update
#not yet made
| 43.5
| 73
| 0.735632
| 14
| 87
| 4.571429
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.16092
| 87
| 2
| 74
| 43.5
| 0.876712
| 0.954023
| 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
|
9a27b89c0e49236df29ca9da3c31fad3c3f0d7fe
| 198
|
py
|
Python
|
pyanalyze/__main__.py
|
sobolevn/pyanalyze
|
f3851db84e57e3ff7f8e2dd271c3b218e2d3bbcc
|
[
"Apache-2.0"
] | null | null | null |
pyanalyze/__main__.py
|
sobolevn/pyanalyze
|
f3851db84e57e3ff7f8e2dd271c3b218e2d3bbcc
|
[
"Apache-2.0"
] | null | null | null |
pyanalyze/__main__.py
|
sobolevn/pyanalyze
|
f3851db84e57e3ff7f8e2dd271c3b218e2d3bbcc
|
[
"Apache-2.0"
] | null | null | null |
from __future__ import print_function, absolute_import, division, unicode_literals
from pyanalyze.name_check_visitor import NameCheckVisitor
if __name__ == "__main__":
NameCheckVisitor.main()
| 28.285714
| 82
| 0.828283
| 22
| 198
| 6.681818
| 0.727273
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.111111
| 198
| 6
| 83
| 33
| 0.835227
| 0
| 0
| 0
| 0
| 0
| 0.040404
| 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
|
9a28ea23487d6e06338d47a15dbd8d64f0c15b71
| 188
|
py
|
Python
|
Quantum_Gates/src/gate_generator.py
|
abhishekabhishek/Quantum-Notebooks
|
6373e017a9adce6a29d2e61de153fd415620ab00
|
[
"MIT"
] | null | null | null |
Quantum_Gates/src/gate_generator.py
|
abhishekabhishek/Quantum-Notebooks
|
6373e017a9adce6a29d2e61de153fd415620ab00
|
[
"MIT"
] | null | null | null |
Quantum_Gates/src/gate_generator.py
|
abhishekabhishek/Quantum-Notebooks
|
6373e017a9adce6a29d2e61de153fd415620ab00
|
[
"MIT"
] | null | null | null |
#!/home/q/.conda/envs/qdev/bin/python3
# -*- coding: utf-8 -*-
# Python script to generate a given n-qubit gate using a sequence of standard
# gates if such a configuration is possible
| 26.857143
| 78
| 0.718085
| 31
| 188
| 4.354839
| 0.935484
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.012739
| 0.164894
| 188
| 6
| 79
| 31.333333
| 0.847134
| 0.946809
| 0
| null | 1
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
9a353274e7982e14b8b2deba4b8ae1ca4ae1a20e
| 1,963
|
py
|
Python
|
tests/integration_tests/colors.py
|
trailofbits/mcsema
|
26368053f761be05dab708bc28fb97090c64b2be
|
[
"Apache-2.0"
] | 1,301
|
2015-01-05T15:08:11.000Z
|
2019-10-22T19:35:09.000Z
|
tests/integration_tests/colors.py
|
trailofbits/mcsema
|
26368053f761be05dab708bc28fb97090c64b2be
|
[
"Apache-2.0"
] | 395
|
2015-01-05T22:10:44.000Z
|
2019-10-19T23:34:47.000Z
|
tests/integration_tests/colors.py
|
trailofbits/mcsema
|
26368053f761be05dab708bc28fb97090c64b2be
|
[
"Apache-2.0"
] | 248
|
2015-01-05T14:09:33.000Z
|
2019-10-22T09:31:07.000Z
|
# Copyright (c) 2020 Trail of Bits, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
class Colors:
class c:
green = '\033[92m'
yellow = '\033[93m'
red = '\033[91m'
magneta = '\033[95m'
bg_yellow = '\033[43m'
orange = '\033[38;5;202m'
RESET = '\033[0m'
def get_result_color(total, success):
if total == 0:
return Colors.c.magneta
if total == success:
return Colors.c.green
if success == 0:
return Colors.c.red
return Colors.c.yellow
def get_bin_result(result):
if result == 1:
return Colors.c.green
if result == 0:
return Colors.c.red
return Colors.c.magneta
def clean():
return Colors.RESET
def c(color, message):
return color + message + clean()
def fail():
return Colors.c.red
def succ():
return Colors.c.green
#TODO: Not sure if it's worth to generate these for each color from attrs dynamically
def green(message):
return c(Colors.c.green, message)
def red(message):
return c(Colors.c.red, message)
def yellow(message):
return c(Colors.c.yellow, message)
def magneta(message):
return c(Colors.c.magneta, message)
def bg_yellow(message):
return c(Colors.c.bg_yellow, message)
def orange(message):
return c(Colors.c.orange, message)
def id(message):
return message
| 25.828947
| 85
| 0.677025
| 298
| 1,963
| 4.436242
| 0.392617
| 0.079425
| 0.088502
| 0.090772
| 0.255673
| 0.161876
| 0.096823
| 0.045386
| 0
| 0
| 0
| 0.030901
| 0.225166
| 1,963
| 75
| 86
| 26.173333
| 0.838264
| 0.383597
| 0
| 0.177778
| 0
| 0
| 0.051089
| 0
| 0
| 0
| 0
| 0.013333
| 0
| 1
| 0.288889
| false
| 0
| 0
| 0.244444
| 0.755556
| 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
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
9a3b9b6032fbe2626debd14a18e5a27c3949cbfd
| 1,080
|
py
|
Python
|
user.py
|
sockduct/flaskapp
|
b749732861f02be04491b433c0cd0eef5d9d470c
|
[
"MIT"
] | null | null | null |
user.py
|
sockduct/flaskapp
|
b749732861f02be04491b433c0cd0eef5d9d470c
|
[
"MIT"
] | null | null | null |
user.py
|
sockduct/flaskapp
|
b749732861f02be04491b433c0cd0eef5d9d470c
|
[
"MIT"
] | null | null | null |
from flask_login import UserMixin
from werkzeug import check_password_hash, generate_password_hash
# UserMixin supplies needed properties and methods to the User class for the
# Flask-Login extension
class User(UserMixin):
# Unique user id via class variable
counter = 1
# Enforce user uniqueness with class variable
usernames = set()
def __init__(self, username, passwd, passwd_hash=None):
if username in User.usernames:
raise ValueError(f'Username "{username}" already in use!')
self.username = username
User.usernames.add(username)
if passwd_hash is None:
self.passwd_hash = generate_password_hash(passwd)
else:
self.passwd_hash = passwd_hash
self.id = User.counter
User.counter += 1
def __repr__(self):
return f'<User(id={self.id}, username={self.username})>'
def check_password(self, passwd):
return check_password_hash(self.passwd_hash, passwd)
@staticmethod
def exists(username):
return username in User.usernames
| 30.857143
| 76
| 0.683333
| 135
| 1,080
| 5.288889
| 0.385185
| 0.084034
| 0.058824
| 0.067227
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.002439
| 0.240741
| 1,080
| 34
| 77
| 31.764706
| 0.868293
| 0.161111
| 0
| 0
| 1
| 0
| 0.092222
| 0.028889
| 0
| 0
| 0
| 0
| 0
| 1
| 0.173913
| false
| 0.304348
| 0.086957
| 0.130435
| 0.521739
| 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
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 1
| 0
|
0
| 4
|
7bd876e1be4a32d37055e948aa84e0cc5047ceca
| 202
|
py
|
Python
|
djangofiltertest/djangofiltertest/apps/authentication/api_v1/serializers.py
|
gonzaloamadio/django-filter-test
|
7b9dbc36ca248e2113deaac03e824b123a31a4ba
|
[
"MIT"
] | null | null | null |
djangofiltertest/djangofiltertest/apps/authentication/api_v1/serializers.py
|
gonzaloamadio/django-filter-test
|
7b9dbc36ca248e2113deaac03e824b123a31a4ba
|
[
"MIT"
] | 3
|
2020-06-05T19:44:12.000Z
|
2022-03-08T21:09:34.000Z
|
djangofiltertest/djangofiltertest/apps/authentication/api_v1/serializers.py
|
gonzaloamadio/django-filter-test
|
7b9dbc36ca248e2113deaac03e824b123a31a4ba
|
[
"MIT"
] | null | null | null |
from rest_framework import serializers
from authentication import models
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = models.User
exclude = ('password',)
| 22.444444
| 50
| 0.737624
| 20
| 202
| 7.4
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.19802
| 202
| 8
| 51
| 25.25
| 0.91358
| 0
| 0
| 0
| 0
| 0
| 0.039604
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.166667
| 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
| 0
| 0
| 1
| 1
| 0
| 0
| 0
|
0
| 4
|
d000f425736f1248603d2b01ffeb50d68ca1e7ba
| 402
|
py
|
Python
|
django_asservio_core/tests/models.py
|
asservio/django-asservio-core
|
93d5a6ed1af60424863dffa1639e3343c94503fd
|
[
"Unlicense"
] | null | null | null |
django_asservio_core/tests/models.py
|
asservio/django-asservio-core
|
93d5a6ed1af60424863dffa1639e3343c94503fd
|
[
"Unlicense"
] | null | null | null |
django_asservio_core/tests/models.py
|
asservio/django-asservio-core
|
93d5a6ed1af60424863dffa1639e3343c94503fd
|
[
"Unlicense"
] | null | null | null |
from django_asservio_core.models import (
CodeDictionary, NameDictionary,
Dictionary, DescriptionDictionary
)
class Code(CodeDictionary):
"""Code dictionary."""
pass
class Name(NameDictionary):
"""Name dictionary."""
pass
class Description(DescriptionDictionary):
"""Description dictionary."""
pass
class Info(Dictionary):
"""Regular dictionary."""
pass
| 16.08
| 41
| 0.69403
| 34
| 402
| 8.147059
| 0.5
| 0.202166
| 0.205776
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.191542
| 402
| 24
| 42
| 16.75
| 0.852308
| 0.191542
| 0
| 0.333333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.333333
| 0.083333
| 0
| 0.416667
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
d068e92e43432ef24e023c24eec566a97b71e761
| 226
|
py
|
Python
|
UVa 11107 life forms/sample/generate.py
|
tadvi/uva
|
0ac0cbdf593879b4fb02a3efc09adbb031cb47d5
|
[
"MIT"
] | 1
|
2020-11-24T03:17:21.000Z
|
2020-11-24T03:17:21.000Z
|
UVa 11107 life forms/sample/generate.py
|
tadvi/uva
|
0ac0cbdf593879b4fb02a3efc09adbb031cb47d5
|
[
"MIT"
] | null | null | null |
UVa 11107 life forms/sample/generate.py
|
tadvi/uva
|
0ac0cbdf593879b4fb02a3efc09adbb031cb47d5
|
[
"MIT"
] | 1
|
2021-04-11T16:22:31.000Z
|
2021-04-11T16:22:31.000Z
|
import random
import string
import sys
sys.stdout.write("100\n")
for i in range(100):
for j in range(500):
sys.stdout.write(random.choice(string.ascii_lowercase))
sys.stdout.write('\n')
sys.stdout.write("0\n")
| 22.6
| 63
| 0.69469
| 38
| 226
| 4.105263
| 0.473684
| 0.230769
| 0.358974
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.052083
| 0.150442
| 226
| 9
| 64
| 25.111111
| 0.760417
| 0
| 0
| 0
| 0
| 0
| 0.044248
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
d0910896ee66cc14eefaa9e5e184e8f7820d3d90
| 217
|
py
|
Python
|
Source/DafnyRuntime/DafnyRuntime.py
|
joho2014/dafny
|
9fe4f27c13d01f493d0212a2420961c90474a2d2
|
[
"MIT"
] | 1
|
2022-03-28T02:34:32.000Z
|
2022-03-28T02:34:32.000Z
|
Source/DafnyRuntime/DafnyRuntime.py
|
Seanpm2001-languages/dafny
|
eb68b1f6777a135671123379db553e29eac79815
|
[
"MIT"
] | null | null | null |
Source/DafnyRuntime/DafnyRuntime.py
|
Seanpm2001-languages/dafny
|
eb68b1f6777a135671123379db553e29eac79815
|
[
"MIT"
] | null | null | null |
class _dafny:
def print(value):
if type(value) == bool:
print("true" if value else "false", end="")
elif type(value) == property:
print(value.fget(), end="")
else:
print(value, end="")
| 24.111111
| 49
| 0.562212
| 28
| 217
| 4.321429
| 0.535714
| 0.247934
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.253456
| 217
| 8
| 50
| 27.125
| 0.746914
| 0
| 0
| 0
| 0
| 0
| 0.041475
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.125
| false
| 0
| 0
| 0
| 0.25
| 0.5
| 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
| 0
| 1
|
0
| 4
|
d0b331f45d45e5396fdb72fe137c09297d6bd5be
| 139
|
py
|
Python
|
practiceforloop/multipicationforloop.py
|
poojavaibhavsahu/Pooja_Python
|
58122bfa8586883145042b11fe1cc013c803ab4f
|
[
"bzip2-1.0.6"
] | null | null | null |
practiceforloop/multipicationforloop.py
|
poojavaibhavsahu/Pooja_Python
|
58122bfa8586883145042b11fe1cc013c803ab4f
|
[
"bzip2-1.0.6"
] | null | null | null |
practiceforloop/multipicationforloop.py
|
poojavaibhavsahu/Pooja_Python
|
58122bfa8586883145042b11fe1cc013c803ab4f
|
[
"bzip2-1.0.6"
] | null | null | null |
limit=int(input("enter the limit"))
no=int(input("enter the no"))
for i in range(1,limit+1,1):
multi=no*i
print(no,"*",i,"=",multi)
| 27.8
| 35
| 0.618705
| 27
| 139
| 3.185185
| 0.481481
| 0.186047
| 0.302326
| 0.372093
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.025
| 0.136691
| 139
| 5
| 36
| 27.8
| 0.691667
| 0
| 0
| 0
| 0
| 0
| 0.207143
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.2
| 1
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
d0c1535fb70246c419c6bed704d86411a0116871
| 295
|
py
|
Python
|
Django/usersForum/app/helpers/crypt.py
|
Oluwasegun-AA/pipit
|
1ea770b0833f086066ad8e3cdf256804e56a266e
|
[
"MIT"
] | null | null | null |
Django/usersForum/app/helpers/crypt.py
|
Oluwasegun-AA/pipit
|
1ea770b0833f086066ad8e3cdf256804e56a266e
|
[
"MIT"
] | 8
|
2020-04-15T04:19:31.000Z
|
2021-03-19T07:21:20.000Z
|
flask/app/helpers/crypt.py
|
Oluwasegun-AA/pipit
|
1ea770b0833f086066ad8e3cdf256804e56a266e
|
[
"MIT"
] | null | null | null |
import bcrypt
class Password:
@staticmethod
def encrypt(password):
hash = bcrypt.hashpw(bytes(password, 'utf-8'), bcrypt.gensalt())
return hash.decode('utf-8')
@staticmethod
def decrypt(password, hash):
return bcrypt.checkpw(bytes(password, 'utf-8'), bytes(hash, 'utf-8'))
| 24.583333
| 73
| 0.691525
| 38
| 295
| 5.368421
| 0.447368
| 0.078431
| 0.156863
| 0.166667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.016
| 0.152542
| 295
| 11
| 74
| 26.818182
| 0.8
| 0
| 0
| 0.222222
| 0
| 0
| 0.067797
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.222222
| false
| 0.555556
| 0.111111
| 0.111111
| 0.666667
| 0
| 0
| 0
| 0
| null | 0
| 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
| 1
| 0
| 0
|
0
| 4
|
d0dacee40283b6be57c6acdc31d1b734fa58580d
| 334
|
py
|
Python
|
pypi/akilib/edison/test.py
|
nonNoise/akilib
|
f111514f544ef765205faebd925d19c810121dad
|
[
"MIT"
] | 29
|
2015-05-28T11:20:36.000Z
|
2018-09-07T07:35:08.000Z
|
examples/raspberrypi/akilib/edison/test.py
|
nonNoise/akilib
|
f111514f544ef765205faebd925d19c810121dad
|
[
"MIT"
] | null | null | null |
examples/raspberrypi/akilib/edison/test.py
|
nonNoise/akilib
|
f111514f544ef765205faebd925d19c810121dad
|
[
"MIT"
] | 4
|
2015-07-03T08:41:19.000Z
|
2018-09-07T07:35:51.000Z
|
############################################################
#The MIT License (MIT)
#Copyright (c) 2015 Yuta KItagami
#Project: https://github.com/nonNoise/akilib
############################################################
class test:
def __init__(self):
print "test init"
def TEST (self):
print "TEST"
| 23.857143
| 60
| 0.401198
| 28
| 334
| 4.642857
| 0.714286
| 0.138462
| 0.2
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.014337
| 0.164671
| 334
| 13
| 61
| 25.692308
| 0.451613
| 0.296407
| 0
| 0
| 0
| 0
| 0.116071
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0.4
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
ef6b1d5c69b8acec46b0e04e294a2112ce924d73
| 92
|
py
|
Python
|
SingletonInstanceException.py
|
renshj/High-Cadence-Processing
|
5d5a2df741858f6e1466d7c4b008e9245d4b780a
|
[
"MIT"
] | null | null | null |
SingletonInstanceException.py
|
renshj/High-Cadence-Processing
|
5d5a2df741858f6e1466d7c4b008e9245d4b780a
|
[
"MIT"
] | null | null | null |
SingletonInstanceException.py
|
renshj/High-Cadence-Processing
|
5d5a2df741858f6e1466d7c4b008e9245d4b780a
|
[
"MIT"
] | null | null | null |
#This file was created by Tate Hagan
class SingletonInstanceException(Exception):
pass
| 30.666667
| 45
| 0.793478
| 11
| 92
| 6.636364
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.163043
| 92
| 3
| 46
| 30.666667
| 0.948052
| 0.380435
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
ef6d8b0952395655909e4357c846ce8014c5a449
| 35
|
py
|
Python
|
env/lib/python3.7/_dummy_thread.py
|
mwikiaBundi1/Pitch-ip
|
16f2e2459abafeebd828dfff7cbc554db3b56b42
|
[
"MIT"
] | 12
|
2019-08-02T07:58:16.000Z
|
2022-01-31T23:45:08.000Z
|
env/lib/python3.7/_dummy_thread.py
|
mwikiaBundi1/Pitch-ip
|
16f2e2459abafeebd828dfff7cbc554db3b56b42
|
[
"MIT"
] | 9
|
2019-10-24T05:21:44.000Z
|
2019-10-24T05:21:49.000Z
|
env/lib/python3.7/_dummy_thread.py
|
mwikiaBundi1/Pitch-ip
|
16f2e2459abafeebd828dfff7cbc554db3b56b42
|
[
"MIT"
] | 11
|
2019-07-31T16:23:36.000Z
|
2022-01-29T08:30:07.000Z
|
/usr/lib/python3.7/_dummy_thread.py
| 35
| 35
| 0.828571
| 7
| 35
| 3.857143
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.057143
| 0
| 35
| 1
| 35
| 35
| 0.714286
| 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
|
ef8ccf6ae3008856df8bed79ed1e07b6c9edaab1
| 478
|
py
|
Python
|
core/handlers/weather_menu.py
|
kra1en/weather_bot
|
fb6039d7b348d5e7f08bdf3763dcbb1ad65c3cac
|
[
"MIT"
] | 1
|
2022-02-21T08:58:08.000Z
|
2022-02-21T08:58:08.000Z
|
core/handlers/weather_menu.py
|
kra1en/weather_bot
|
fb6039d7b348d5e7f08bdf3763dcbb1ad65c3cac
|
[
"MIT"
] | null | null | null |
core/handlers/weather_menu.py
|
kra1en/weather_bot
|
fb6039d7b348d5e7f08bdf3763dcbb1ad65c3cac
|
[
"MIT"
] | 1
|
2022-02-06T11:44:23.000Z
|
2022-02-06T11:44:23.000Z
|
from loader import dp
from markups.inline_weather import InlineWeather as iw
from core.states import WeatherStates
@dp.callback_query_handler(iw.callback_data.filter(), state = WeatherStates.show_weather)
async def weather_menu(callback_query, callback_data):
await callback_query.message.edit_text(iw.update(user_id=callback_query.from_user.id, action=callback_data["action"]))
await callback_query.message.edit_reply_markup(iw.get_markup(callback_query.from_user.id))
| 59.75
| 122
| 0.838912
| 71
| 478
| 5.366197
| 0.478873
| 0.204724
| 0.094488
| 0.131234
| 0.272966
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.073222
| 478
| 8
| 123
| 59.75
| 0.860045
| 0
| 0
| 0
| 0
| 0
| 0.012526
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.428571
| 0
| 0.428571
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
efb291cb497d360445841d6333cfe1a655568c93
| 3,436
|
py
|
Python
|
examples/api-usage/brkgaAPI/Population.py
|
SCICOM-CEFET-RJ/BRKGA
|
23e9ba6ac3abca9c6526f6f6c6e305832bc5dbcb
|
[
"MIT"
] | null | null | null |
examples/api-usage/brkgaAPI/Population.py
|
SCICOM-CEFET-RJ/BRKGA
|
23e9ba6ac3abca9c6526f6f6c6e305832bc5dbcb
|
[
"MIT"
] | null | null | null |
examples/api-usage/brkgaAPI/Population.py
|
SCICOM-CEFET-RJ/BRKGA
|
23e9ba6ac3abca9c6526f6f6c6e305832bc5dbcb
|
[
"MIT"
] | null | null | null |
# This class builds the population of chromossomes
import numpy as np
from Individual import individual
class Population:
def __init__(self, population):
self.population = population
@classmethod
def from_Population(cls, p, n):
population = [individual(n) for i in range(p)]
return cls(population)
def _sortFitness(self):
return self.population.sort(key= lambda ind: ind.fitness)
def _setFitness(self, i, f):
self.population[i].update_fitness(f)
def _getChromossome(self, i):
try:
chromossome = self.population[i].get_chromossome()
except AssertionError as error:
print(error)
return chromossome
def __operator(self, i, j):
chromossome = self.population[i].get_chromossome()
allele = chromossome[j]
return allele
def __vectorOperator(self,i):
try:
chromossome = self.population[i].get_chromossome()
except AssertionError as error:
print(error)
return chromossome
def getN(self):
return len(self.population[0].get_chromossome())
def getP(self):
return len(self.population)
def getBestFitness(self):
return self.population[0].get_fitness()
def getFitness(self,i):
return self.population[i].get_fitness()
def getChromossome(self, i):
try:
chromossome = self.population[i].get_chromossome()
except AssertionError as error:
print(error)
return chromossome
def get_individual(self, i):
return self.population[i]
| 36.553191
| 1,734
| 0.301222
| 183
| 3,436
| 5.540984
| 0.284153
| 0.179487
| 0.10355
| 0.088757
| 0.488166
| 0.434911
| 0.344181
| 0.344181
| 0.344181
| 0.344181
| 0
| 0.001692
| 0.655995
| 3,436
| 93
| 1,735
| 36.946237
| 0.856176
| 0.01397
| 0
| 0.355556
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.066667
| 1
| 0.288889
| false
| 0
| 0.044444
| 0.133333
| 0.6
| 0.066667
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 4
|
efc5ad3602ae565f09c09671da8ca6c8d3572df4
| 20,351
|
py
|
Python
|
views/resenha_views.py
|
raphaelcordon/Resenhando
|
1dfe142f8771f9d7570872ed39713b0b17e8838a
|
[
"MIT"
] | null | null | null |
views/resenha_views.py
|
raphaelcordon/Resenhando
|
1dfe142f8771f9d7570872ed39713b0b17e8838a
|
[
"MIT"
] | null | null | null |
views/resenha_views.py
|
raphaelcordon/Resenhando
|
1dfe142f8771f9d7570872ed39713b0b17e8838a
|
[
"MIT"
] | null | null | null |
from flask import render_template, session, redirect, request, url_for, flash, Blueprint
from repository.users_repos import UsersRepository
from repository.resenha_repos import ResenhaRepository
from repository.comments_repos import CommentsRepository
from repository.curtidas_repos import CurtidasRepository
from models.common import DateConversion, KeepInSession, CleanSession
from models.genres_model import genres
from thirdparty.spotify import SpotifyGetFiveArtists, SpotifyGetAlbums, \
SpotifyGetOneArtist, SpotifyGetOneAlbum, SpotifyGetOneTrack, SpotifyGetOnePlaylist, \
SpotifyGetPlaylists, SpotifyCheckUser, SpotifyGetTracks
from views.index_views import __createSessionVariables
res = Blueprint('res', __name__)
# <-- ## Artist routes beginning ## -->
@res.route('/resenhaListArtist', methods=['GET', 'POST'])
def resenhaListArtist():
artists = SpotifyGetFiveArtists(request.form['artist']).listArtists
session['resenhaArtist'] = request.form['artist']
if session['id'] != '':
comments = CommentsRepository().listAuthorId(session['id'])
likeNotifications = CurtidasRepository().listAuthorId(session['id'])
usersNotifications = UsersRepository().List()
resenhasListAll = ResenhaRepository().ListAll()
notifyComment = UsersRepository().FindById(session['id']).read_comment
notifyLike = UsersRepository().FindById(session['id']).read_like
return render_template('resenha/resenhaListArtist.html', artists=artists, comments=comments,
usersNotifications=usersNotifications, likeNotifications=likeNotifications,
resenhasListAll=resenhasListAll, notifyComment=notifyComment, notifyLike=notifyLike)
else:
return render_template('resenha/resenhaListArtist.html', artists=artists)
@res.route('/resenhaNewArtist/<artistId>/', methods=['GET', 'POST'])
def resenhaNewArtist(artistId):
if session['email'] == '' or 'email' not in session:
flash('Você precisa logar para acessar essa área', 'info')
return redirect(url_for('log.login'))
spotify = SpotifyGetOneArtist(artistId).createList()
if session['id'] != '':
comments = CommentsRepository().listAuthorId(session['id'])
likeNotifications = CurtidasRepository().listAuthorId(session['id'])
usersNotifications = UsersRepository().List()
resenhasListAll = ResenhaRepository().ListAll()
notifyComment = UsersRepository().FindById(session['id']).read_comment
notifyLike = UsersRepository().FindById(session['id']).read_like
return render_template('resenha/resenhaNew.html', spotify=spotify, tipo_review='artista', comments=comments,
usersNotifications=usersNotifications, likeNotifications=likeNotifications,
resenhasListAll=resenhasListAll, notifyComment=notifyComment, notifyLike=notifyLike)
else:
return render_template('resenha/resenhaNew.html', spotify=spotify, tipo_review='artista')
# <-- ## Artists routes ending ## -->
# <-- ## Albums routes beginning ## -->
@res.route('/resenhalistAlbums/<artistId>/', methods=['GET', 'POST'])
def resenhalistAlbums(artistId):
albums = SpotifyGetAlbums(artistId).createList()
session['resenhaAlbums'] = artistId
if session['id'] != '':
comments = CommentsRepository().listAuthorId(session['id'])
likeNotifications = CurtidasRepository().listAuthorId(session['id'])
usersNotifications = UsersRepository().List()
resenhasListAll = ResenhaRepository().ListAll()
notifyComment = UsersRepository().FindById(session['id']).read_comment
notifyLike = UsersRepository().FindById(session['id']).read_like
return render_template('resenha/resenhaListAlbums.html', albums=albums, comments=comments,
usersNotifications=usersNotifications, likeNotifications=likeNotifications,
resenhasListAll=resenhasListAll, notifyComment=notifyComment, notifyLike=notifyLike)
else:
return render_template('resenha/resenhaListAlbums.html', albums=albums)
@res.route('/resenhaNewAlbum/<albumId>/', methods=['GET', 'POST'])
def resenhaNewAlbum(albumId):
if session['email'] == '' or 'email' not in session:
flash('Você precisa logar para acessar essa área', 'info')
return redirect(url_for('log.login'))
spotify = SpotifyGetOneAlbum(albumId).createList()
if session['id'] != '':
comments = CommentsRepository().listAuthorId(session['id'])
likeNotifications = CurtidasRepository().listAuthorId(session['id'])
usersNotifications = UsersRepository().List()
resenhasListAll = ResenhaRepository().ListAll()
notifyComment = UsersRepository().FindById(session['id']).read_comment
notifyLike = UsersRepository().FindById(session['id']).read_like
return render_template('resenha/resenhaNew.html', spotify=spotify, tipo_review='album', comments=comments,
usersNotifications=usersNotifications, likeNotifications=likeNotifications,
resenhasListAll=resenhasListAll, notifyComment=notifyComment, notifyLike=notifyLike)
else:
return render_template('resenha/resenhaNew.html', spotify=spotify, tipo_review='album')
# <-- ## Albums routes ending ## -->
# <-- ## Tracks routes beginning ## -->
@res.route('/resenhaListTracks', methods=['GET', 'POST'])
def resenhaListTracks():
tracks = SpotifyGetTracks(request.form['spotifyTracks']).createList()
session['resenhaTrack'] = request.form['spotifyTracks']
if session['id'] != '':
comments = CommentsRepository().listAuthorId(session['id'])
likeNotifications = CurtidasRepository().listAuthorId(session['id'])
usersNotifications = UsersRepository().List()
resenhasListAll = ResenhaRepository().ListAll()
notifyComment = UsersRepository().FindById(session['id']).read_comment
notifyLike = UsersRepository().FindById(session['id']).read_like
return render_template('resenha/resenhaListTracks.html', tracks=tracks, comments=comments,
usersNotifications=usersNotifications, likeNotifications=likeNotifications,
resenhasListAll=resenhasListAll, notifyComment=notifyComment, notifyLike=notifyLike)
else:
return render_template('resenha/resenhaListTracks.html', tracks=tracks)
@res.route('/resenhaNewTrack/<trackId>/', methods=['GET', 'POST'])
def resenhaNewTrack(trackId):
if session['email'] == '' or 'email' not in session:
flash('Você precisa logar para acessar essa área', 'info')
return redirect(url_for('log.login'))
spotify = SpotifyGetOneTrack(trackId).createList()
if session['id'] != '':
comments = CommentsRepository().listAuthorId(session['id'])
likeNotifications = CurtidasRepository().listAuthorId(session['id'])
usersNotifications = UsersRepository().List()
resenhasListAll = ResenhaRepository().ListAll()
notifyComment = UsersRepository().FindById(session['id']).read_comment
notifyLike = UsersRepository().FindById(session['id']).read_like
return render_template('resenha/resenhaNew.html', spotify=spotify, tipo_review='track', comments=comments,
usersNotifications=usersNotifications, likeNotifications=likeNotifications,
resenhasListAll=resenhasListAll, notifyComment=notifyComment, notifyLike=notifyLike)
else:
return render_template('resenha/resenhaNew.html', spotify=spotify, tipo_review='track')
# <-- ## Playlists routes beginning ## -->
@res.route('/resenhaListPlaylists', methods=['GET', 'POST'])
def resenhaListPlaylists():
if SpotifyCheckUser(request.form['spotifyUsername']):
playlists = SpotifyGetPlaylists(request.form['spotifyUsername']).createList()
if session['id'] != '':
comments = CommentsRepository().listAuthorId(session['id'])
likeNotifications = CurtidasRepository().listAuthorId(session['id'])
usersNotifications = UsersRepository().List()
resenhasListAll = ResenhaRepository().ListAll()
notifyComment = UsersRepository().FindById(session['id']).read_comment
notifyLike = UsersRepository().FindById(session['id']).read_like
return render_template('resenha/resenhaListPlaylists.html', playlists=playlists, comments=comments,
usersNotifications=usersNotifications, likeNotifications=likeNotifications,
resenhasListAll=resenhasListAll, notifyComment=notifyComment, notifyLike=notifyLike)
else:
return render_template('resenha/resenhaListPlaylists.html', playlists=playlists)
else:
flash('Nome de usuário não encontrado', 'danger')
return redirect(url_for('res.resenhaIndex'))
@res.route('/resenhaNewPlaylist/<playlistId>/', methods=['GET', 'POST'])
def resenhaNewPlaylist(playlistId):
if session['email'] == '' or 'email' not in session:
flash('Você precisa logar para acessar essa área', 'info')
return redirect(url_for('log.login'))
spotify = SpotifyGetOnePlaylist(playlistId).createList()
if session['id'] != '':
comments = CommentsRepository().listAuthorId(session['id'])
likeNotifications = CurtidasRepository().listAuthorId(session['id'])
usersNotifications = UsersRepository().List()
resenhasListAll = ResenhaRepository().ListAll()
notifyComment = UsersRepository().FindById(session['id']).read_comment
notifyLike = UsersRepository().FindById(session['id']).read_like
return render_template('resenha/resenhaNew.html', spotify=spotify, tipo_review='playlist', comments=comments,
usersNotifications=usersNotifications, likeNotifications=likeNotifications,
resenhasListAll=resenhasListAll, notifyComment=notifyComment, notifyLike=notifyLike)
else:
return render_template('resenha/resenhaNew.html', spotify=spotify, tipo_review='playlist')
"""
@res.route('/createResenhaPlaylist', methods=['GET', 'POST'])
def createResenhaPlaylist():
if session['email'] == '' or 'email' not in session:
flash('Você precisa logar para acessar essa área', 'info')
return redirect(url_for('log.login'))
tipo_review = 'playlist'
author_id = session['id']
nome_review = request.form['nome_review']
spotify_id = request.form['spotify_id']
review = request.form['review']
genres = ''
# In case of error, review will be in session
KeepInSession(request.form['spotify_id'],
request.form['nome_review'], request.form['review'])
ResenhaRepository().New(tipo_review, author_id, nome_review, spotify_id, review, genres)
CleanSession()
flash('Resenha criada com sucesso', 'success')
return redirect(url_for('ind.home'))
"""
# <-- ## Playlists routes ending ## -->
# <-- ## Other routes beginning ## -->
@res.route('/resenhaIndex', methods=['GET', 'POST'])
def resenhaIndex():
CleanSession()
if session['email'] == '' or 'email' not in session:
session['previous'] = 'res.resenhaIndex'
flash('Você precisa logar para acessar essa área', 'info')
return redirect(url_for('log.login'))
if session['id'] != '':
comments = CommentsRepository().listAuthorId(session['id'])
likeNotifications = CurtidasRepository().listAuthorId(session['id'])
usersNotifications = UsersRepository().List()
resenhasListAll = ResenhaRepository().ListAll()
notifyComment = UsersRepository().FindById(session['id']).read_comment
notifyLike = UsersRepository().FindById(session['id']).read_like
return render_template('resenha/resenhaIndex.html', comments=comments, usersNotifications=usersNotifications,
likeNotifications=likeNotifications, resenhasListAll=resenhasListAll,
notifyComment=notifyComment, notifyLike=notifyLike)
else:
return render_template('resenha/resenhaIndex.html')
@res.route('/createResenha', methods=['GET', 'POST'])
def createResenha():
if session['email'] == '' or 'email' not in session:
flash('Você precisa logar para acessar essa área', 'info')
return redirect(url_for('log.login'))
tipo_review = request.form['tipo_review']
author_id = session['id']
nome_review = request.form['nome_review']
spotify_id = request.form['spotify_id']
review = request.form['review']
spotifyArtistId = request.form['spotifyArtistId']
if spotifyArtistId:
spotifyArtistGenres = SpotifyGetOneArtist(spotifyArtistId).createList().get('genres')
elif tipo_review == 'playlist':
spotifyArtistGenres = ''
else:
spotifyArtistGenres = SpotifyGetOneArtist(spotify_id).createList().get('genres')
# -- get Genre --
genre = ''
if spotifyArtistGenres:
for genreName, value in genres.items():
for i in spotifyArtistGenres:
if i in value:
genre = genreName
break
# In case of error, review will be in session
KeepInSession(request.form['spotify_id'],
request.form['nome_review'], request.form['review'])
ResenhaRepository().New(tipo_review, author_id, nome_review, spotify_id, review, genre)
CleanSession()
flash('Resenha criada com sucesso', 'success')
return redirect(url_for('ind.home'))
@res.route('/resenhaEdit/<int:id>', methods=['GET', 'POST'])
def resenhaEdit(id):
data = ResenhaRepository().FindById(id)
spotifyId = data.spotify_id
if data.tipo_review == 'artista':
spotify = SpotifyGetOneArtist(spotifyId).oneArtist
elif data.tipo_review == 'album':
spotify = SpotifyGetOneAlbum(spotifyId).oneAlbum
elif data.tipo_review == 'track':
spotify = SpotifyGetOneTrack(spotifyId).oneTrack
else:
spotify = SpotifyGetOnePlaylist(spotifyId).onePlaylist
if session['id'] != data.author_id:
return redirect(url_for('ind.home'))
else:
voltarButton = request.headers.get("Referer")
if session['id'] != '':
comments = CommentsRepository().listAuthorId(session['id'])
likeNotifications = CurtidasRepository().listAuthorId(session['id'])
usersNotifications = UsersRepository().List()
resenhasListAll = ResenhaRepository().ListAll()
notifyComment = UsersRepository().FindById(session['id']).read_comment
notifyLike = UsersRepository().FindById(session['id']).read_like
return render_template('resenha/resenhaEdit.html', data=data, spotify=spotify, voltarButton=voltarButton,
comments=comments, usersNotifications=usersNotifications,
likeNotifications=likeNotifications, resenhasListAll=resenhasListAll,
notifyComment=notifyComment, notifyLike=notifyLike)
else:
return render_template('resenha/resenhaEdit.html', data=data, spotify=spotify, voltarButton=voltarButton)
@res.route('/updateResenha', methods=['GET', 'POST'])
def updateResenha():
id = request.form['id']
nome_review = str(request.form['nome_review'])
review = request.form['review']
ResenhaRepository().Edit(id, nome_review, review)
flash('Resenha atualizada com sucesso', 'success')
return redirect(url_for('res.resenhado', id=id))
@res.route('/resenhado/<id>/')
def resenhado(id):
if 'id' not in session:
session['id'] = ''
data = ResenhaRepository().FindById(id)
spotifyId = data.spotify_id
if data.tipo_review == 'artista':
spotify = SpotifyGetOneArtist(spotifyId).oneArtist
elif data.tipo_review == 'album':
spotify = SpotifyGetOneAlbum(spotifyId).oneAlbum
elif data.tipo_review == 'track':
spotify = SpotifyGetOneTrack(spotifyId).oneTrack
else:
spotify = SpotifyGetOnePlaylist(spotifyId).onePlaylist
user_author = UsersRepository().FindById(data.author_id)
date = DateConversion(str(data.date_register))
like = CurtidasRepository().CountLikes(id).count
commentsList = CommentsRepository().List(id)
comment_user = UsersRepository().List()
try:
if CurtidasRepository().FindById(session['id'], id):
PNG = 'unclick'
else:
PNG = 'click'
except:
PNG = 'click'
if session['id'] != '':
comments = CommentsRepository().listAuthorId(session['id'])
likeNotifications = CurtidasRepository().listAuthorId(session['id'])
usersNotifications = UsersRepository().List()
resenhasListAll = ResenhaRepository().ListAll()
notifyComment = UsersRepository().FindById(session['id']).read_comment
notifyLike = UsersRepository().FindById(session['id']).read_like
return render_template('resenha/resenhado.html', data=data, spotify=spotify, user_author=user_author, date=date,
commentsList=commentsList, comment_user=comment_user, like=like, PNG=PNG,
comments=comments, usersNotifications=usersNotifications,
likeNotifications=likeNotifications, resenhasListAll=resenhasListAll,
notifyComment=notifyComment, notifyLike=notifyLike)
else:
return render_template('resenha/resenhado.html', data=data, spotify=spotify, user_author=user_author, date=date,
commentsList=commentsList, comment_user=comment_user, like=like, PNG=PNG)
@res.route('/resenhaViews')
def resenhaViews():
if 'id' not in session:
__createSessionVariables()
spotifyArtist = []
spotifyAlbum = []
spotifyTrack = []
spotifyPlaylist = []
users = UsersRepository().List()
reviewsArtist = ResenhaRepository().List('artista')
reviewsAlbum = ResenhaRepository().List('album')
reviewsTrack = ResenhaRepository().List('track')
reviewsPlaylist = ResenhaRepository().List('playlist')
for item in reviewsArtist:
spotifyArtist.append(SpotifyGetOneArtist(item.spotify_id).oneArtist)
for item in reviewsAlbum:
spotifyAlbum.append(SpotifyGetOneAlbum(item.spotify_id).oneAlbum)
for item in reviewsTrack:
spotifyTrack.append(SpotifyGetOneTrack(item.spotify_id).oneTrack)
for item in reviewsPlaylist:
spotifyPlaylist.append(
SpotifyGetOnePlaylist(item.spotify_id).onePlaylist)
if session['id'] != '':
comments = CommentsRepository().listAuthorId(session['id'])
likeNotifications = CurtidasRepository().listAuthorId(session['id'])
usersNotifications = UsersRepository().List()
resenhasListAll = ResenhaRepository().ListAll()
notifyComment = UsersRepository().FindById(session['id']).read_comment
notifyLike = UsersRepository().FindById(session['id']).read_like
return render_template('resenha/resenhaViews.html', reviewsArtist=reviewsArtist, reviewsAlbum=reviewsAlbum,
reviewsTrack=reviewsTrack, reviewsPlaylist=reviewsPlaylist,
users=users, spotifyArtist=spotifyArtist, spotifyAlbum=spotifyAlbum,
spotifyTrack=spotifyTrack, spotifyPlaylist=spotifyPlaylist, mainFilter='index',
comments=comments, usersNotifications=usersNotifications,
likeNotifications=likeNotifications, resenhasListAll=resenhasListAll,
notifyComment=notifyComment, notifyLike=notifyLike)
else:
return render_template('resenha/resenhaViews.html', reviewsArtist=reviewsArtist, reviewsAlbum=reviewsAlbum,
reviewsTrack=reviewsTrack, reviewsPlaylist=reviewsPlaylist,
users=users, spotifyArtist=spotifyArtist, spotifyAlbum=spotifyAlbum,
spotifyTrack=spotifyTrack, spotifyPlaylist=spotifyPlaylist, mainFilter='index')
| 46.891705
| 120
| 0.679131
| 1,748
| 20,351
| 7.827231
| 0.107551
| 0.042757
| 0.031063
| 0.056132
| 0.735784
| 0.724967
| 0.720655
| 0.717951
| 0.694635
| 0.694635
| 0
| 0
| 0.201268
| 20,351
| 434
| 121
| 46.891705
| 0.84171
| 0.016117
| 0
| 0.573668
| 0
| 0
| 0.107744
| 0.042324
| 0
| 0
| 0
| 0
| 0
| 1
| 0.043887
| false
| 0
| 0.028213
| 0
| 0.178683
| 0.00627
| 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
|
efef486e06bb93df5f3057eb7df4c353c4177871
| 73
|
py
|
Python
|
wsgi.py
|
jfsolarte/python_clean_architecture
|
56b0c0eff50bc98774a0caee12e3030789476687
|
[
"MIT"
] | null | null | null |
wsgi.py
|
jfsolarte/python_clean_architecture
|
56b0c0eff50bc98774a0caee12e3030789476687
|
[
"MIT"
] | null | null | null |
wsgi.py
|
jfsolarte/python_clean_architecture
|
56b0c0eff50bc98774a0caee12e3030789476687
|
[
"MIT"
] | null | null | null |
from python_clean_architecture.app import create_app
app = create_app()
| 18.25
| 52
| 0.835616
| 11
| 73
| 5.181818
| 0.636364
| 0.315789
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.109589
| 73
| 4
| 53
| 18.25
| 0.876923
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 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
|
4bf608c942f92983a8ba5af32f53c3003bb98b72
| 965
|
py
|
Python
|
moveit_ros/planning_interface/test/launch/move_group_ompl_constraints.test.py
|
FabianSchuetze/moveit2
|
d1960f3994daff215c4a51de15c96ce618f4d97d
|
[
"BSD-3-Clause"
] | null | null | null |
moveit_ros/planning_interface/test/launch/move_group_ompl_constraints.test.py
|
FabianSchuetze/moveit2
|
d1960f3994daff215c4a51de15c96ce618f4d97d
|
[
"BSD-3-Clause"
] | null | null | null |
moveit_ros/planning_interface/test/launch/move_group_ompl_constraints.test.py
|
FabianSchuetze/moveit2
|
d1960f3994daff215c4a51de15c96ce618f4d97d
|
[
"BSD-3-Clause"
] | null | null | null |
import os
import sys
import unittest
import launch_testing.asserts
sys.path.append(os.path.dirname(__file__))
from move_group_launch_test_common import generate_move_group_test_description
def generate_test_description():
return generate_move_group_test_description(gtest_name='move_group_ompl_constraints_test')
class TestGTestProcessActive(unittest.TestCase):
def test_gtest_run_complete(self, proc_info, ompl_constraint_test, run_move_group_node, static_tf, robot_state_publisher, fake_joint_driver_node, mongodb_server_node):
proc_info.assertWaitForShutdown(ompl_constraint_test, timeout=4000.0)
@launch_testing.post_shutdown_test()
class TestGTestProcessPostShutdown(unittest.TestCase):
def test_gtest_pass(self, proc_info, ompl_constraint_test, run_move_group_node, static_tf, robot_state_publisher, fake_joint_driver_node, mongodb_server_node):
launch_testing.asserts.assertExitCodes(proc_info, process=ompl_constraint_test)
| 45.952381
| 171
| 0.856995
| 131
| 965
| 5.801527
| 0.412214
| 0.071053
| 0.094737
| 0.055263
| 0.444737
| 0.286842
| 0.286842
| 0.286842
| 0.286842
| 0.286842
| 0
| 0.005631
| 0.079793
| 965
| 21
| 172
| 45.952381
| 0.850225
| 0
| 0
| 0
| 1
| 0
| 0.033126
| 0.033126
| 0
| 0
| 0
| 0
| 0.2
| 1
| 0.2
| false
| 0.066667
| 0.333333
| 0.066667
| 0.733333
| 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
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 1
| 0
|
0
| 4
|
ef2ff378844ef2c4ce8f1b1decc5e3b737efc37c
| 2,144
|
py
|
Python
|
HW6/problem2.py
|
anurag3/DS501
|
4a03100e1c221be2f2cdd99f74e006dc9827aa00
|
[
"MIT"
] | null | null | null |
HW6/problem2.py
|
anurag3/DS501
|
4a03100e1c221be2f2cdd99f74e006dc9827aa00
|
[
"MIT"
] | null | null | null |
HW6/problem2.py
|
anurag3/DS501
|
4a03100e1c221be2f2cdd99f74e006dc9827aa00
|
[
"MIT"
] | null | null | null |
import math
import numpy as np
# Note: please don't add any new package, you should solve this problem using only the packages above.
#-------------------------------------------------------------------------
'''
Problem 1: Linear Regression (Maximum Likelihood)
In this problem, you will implement the linear regression method based upon maximum likelihood (least square).
w'x + b = y
You could test the correctness of your code by typing `nosetests -v test1.py` in the terminal.
Note: please don't use any existing package for linear regression problem, implement your own version.
'''
#--------------------------
def compute_Phi(x,p):
'''
Compute the design matrix Phi of x for polynoial curve fitting problem.
We will construct p polynoials a the p features of the data samples.
The features of each sample, is x^0, x^1, x^2 ... x^(p-1)
Input:
x : a vector of samples in one dimensional space, a numpy vector of shape n by 1.
Here n is the number of samples.
p : the number of polynomials/features
Output:
Phi: the design/feature matrix of x, a numpy matrix of shape (n by p).
'''
#########################################
## INSERT YOUR CODE HERE
#########################################
return Phi
#--------------------------
def least_square(Phi, y):
'''
Fit a linear model on training samples. Compute the paramter w using Maximum likelihood (equal to least square).
Input:
Phi: the design/feature matrix of the training samples, a numpy matrix of shape n by p
Here n is the number of training samples, p is the number of features
y : the sample labels, a numpy vector of shape n by 1.
Output:
w: the weights of the linear regression model, a numpy float vector of shape p by 1.
Hint: you could use np.linalg.inv() to compute the inverse of a matrix
'''
#########################################
## INSERT YOUR CODE HERE
#########################################
return w
| 36.338983
| 120
| 0.557836
| 286
| 2,144
| 4.174825
| 0.374126
| 0.025126
| 0.026801
| 0.033501
| 0.19263
| 0.152429
| 0.077052
| 0.077052
| 0
| 0
| 0
| 0.005653
| 0.257463
| 2,144
| 58
| 121
| 36.965517
| 0.744347
| 0.58209
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.034483
| 0
| 1
| 0.333333
| false
| 0
| 0.333333
| 0
| 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
| 1
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
322b350d534bd7faaed6c13d0d61b18d4445eb2c
| 26
|
py
|
Python
|
optuna/version.py
|
TezRomacH/optuna
|
f27e0b518d63825190252a5964fc44b67ddb645f
|
[
"MIT"
] | 1
|
2021-10-09T16:06:45.000Z
|
2021-10-09T16:06:45.000Z
|
optuna/version.py
|
TezRomacH/optuna
|
f27e0b518d63825190252a5964fc44b67ddb645f
|
[
"MIT"
] | 2
|
2020-11-09T13:56:48.000Z
|
2021-02-10T08:20:31.000Z
|
optuna/version.py
|
crcrpar/optuna
|
d25c7ee8e103575207978ec09a14ad9a4fefa53d
|
[
"MIT"
] | 1
|
2020-12-25T03:27:49.000Z
|
2020-12-25T03:27:49.000Z
|
__version__ = "2.6.0.dev"
| 13
| 25
| 0.653846
| 5
| 26
| 2.6
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.130435
| 0.115385
| 26
| 1
| 26
| 26
| 0.434783
| 0
| 0
| 0
| 0
| 0
| 0.346154
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
323c72d69dae0db9bba41291d8ef93239ecfc18b
| 421
|
py
|
Python
|
operaciones.py
|
LizAbella13/HelloWorld
|
83763dcbfff3e05978b37c9812b1209a742271b9
|
[
"Apache-2.0"
] | null | null | null |
operaciones.py
|
LizAbella13/HelloWorld
|
83763dcbfff3e05978b37c9812b1209a742271b9
|
[
"Apache-2.0"
] | null | null | null |
operaciones.py
|
LizAbella13/HelloWorld
|
83763dcbfff3e05978b37c9812b1209a742271b9
|
[
"Apache-2.0"
] | null | null | null |
print "Ingrese un numero"
numero = int(raw_input("numero"))
print numero
print "Ingrese otro numero"
numero2= int(raw_input("numero2"))
print numero2
sum= numero + numero2
print "Suma=",sum
resta= numero - numero2
print "Resta=",resta
mult= numero * numero2
print "Multiplicacion=",mult
if numero2!=0:
div= numero / numero2
print "Division=" ,div
res= numero % numero2
print "Residuo=", res
| 17.541667
| 34
| 0.686461
| 55
| 421
| 5.218182
| 0.363636
| 0.271777
| 0.313589
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.029412
| 0.192399
| 421
| 23
| 35
| 18.304348
| 0.814706
| 0
| 0
| 0
| 0
| 0
| 0.21957
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0.529412
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
32502b6014dd44be57f09e62d5da2e16b019c0dd
| 63
|
py
|
Python
|
crash.py
|
Abhinav-ranish/pc-crasher
|
cba2d0a38ff50369f95c612fb9529d8a21688558
|
[
"MIT"
] | 1
|
2021-09-18T09:10:02.000Z
|
2021-09-18T09:10:02.000Z
|
crash.py
|
Abhinav-ranish/pc-crasher
|
cba2d0a38ff50369f95c612fb9529d8a21688558
|
[
"MIT"
] | null | null | null |
crash.py
|
Abhinav-ranish/pc-crasher
|
cba2d0a38ff50369f95c612fb9529d8a21688558
|
[
"MIT"
] | 1
|
2021-09-18T09:11:34.000Z
|
2021-09-18T09:11:34.000Z
|
from itertools import count as memoryhog
list(memoryhog(0))
| 21
| 41
| 0.777778
| 9
| 63
| 5.444444
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.018868
| 0.15873
| 63
| 3
| 42
| 21
| 0.90566
| 0
| 0
| 0
| 0
| 0
| 0
| 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
|
3275c5b48df3a3590728a15271e59ee8952a82a4
| 125
|
py
|
Python
|
student/admin.py
|
HemanthJella/ewallet
|
cc7f9b5abb7aa552b8769b9324c3d79630e5ea6a
|
[
"Apache-2.0"
] | null | null | null |
student/admin.py
|
HemanthJella/ewallet
|
cc7f9b5abb7aa552b8769b9324c3d79630e5ea6a
|
[
"Apache-2.0"
] | null | null | null |
student/admin.py
|
HemanthJella/ewallet
|
cc7f9b5abb7aa552b8769b9324c3d79630e5ea6a
|
[
"Apache-2.0"
] | null | null | null |
from django.contrib import admin
from .models import student
admin.site.register(student)
# Register your models here.
| 20.833333
| 33
| 0.776
| 17
| 125
| 5.705882
| 0.647059
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.16
| 125
| 5
| 34
| 25
| 0.92381
| 0.208
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
32763c738cbe9e8ce2c88689da4655996d912ccd
| 18,604
|
py
|
Python
|
misago/threads/tests/test_thread_start_api.py
|
HenryChenV/iJiangNan
|
68f156d264014939f0302222e16e3125119dd3e3
|
[
"MIT"
] | 1
|
2017-07-25T03:04:36.000Z
|
2017-07-25T03:04:36.000Z
|
misago/threads/tests/test_thread_start_api.py
|
HenryChenV/iJiangNan
|
68f156d264014939f0302222e16e3125119dd3e3
|
[
"MIT"
] | null | null | null |
misago/threads/tests/test_thread_start_api.py
|
HenryChenV/iJiangNan
|
68f156d264014939f0302222e16e3125119dd3e3
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.urls import reverse
from misago.acl.testutils import override_acl
from misago.categories.models import Category
from misago.users.testutils import AuthenticatedUserTestCase
class StartThreadTests(AuthenticatedUserTestCase):
def setUp(self):
super(StartThreadTests, self).setUp()
self.category = Category.objects.get(slug='first-category')
self.api_link = reverse('misago:api:thread-list')
def override_acl(self, extra_acl=None):
new_acl = self.user.acl_cache
new_acl['categories'][self.category.pk].update({
'can_see': 1,
'can_browse': 1,
'can_start_threads': 1,
'can_pin_threads': 0,
'can_close_threads': 0,
'can_hide_threads': 0,
'can_hide_own_threads': 0,
})
if extra_acl:
new_acl['categories'][self.category.pk].update(extra_acl)
if 'can_see' in extra_acl and not extra_acl['can_see']:
new_acl['visible_categories'].remove(self.category.pk)
new_acl['browseable_categories'].remove(self.category.pk)
if 'can_browse' in extra_acl and not extra_acl['can_browse']:
new_acl['browseable_categories'].remove(self.category.pk)
override_acl(self.user, new_acl)
def test_cant_start_thread_as_guest(self):
"""user has to be authenticated to be able to post thread"""
self.logout_user()
response = self.client.post(self.api_link)
self.assertEqual(response.status_code, 403)
def test_cant_see(self):
"""has no permission to see selected category"""
self.override_acl({'can_see': 0})
response = self.client.post(self.api_link, {
'category': self.category.pk,
})
self.assertContains(response, "Selected category is invalid.", status_code=400)
def test_cant_browse(self):
"""has no permission to browse selected category"""
self.override_acl({'can_browse': 0})
response = self.client.post(self.api_link, {
'category': self.category.pk,
})
self.assertContains(response, "Selected category is invalid.", status_code=400)
def test_cant_start_thread(self):
"""permission to start thread in category is validated"""
self.override_acl({'can_start_threads': 0})
response = self.client.post(self.api_link, {
'category': self.category.pk,
})
self.assertContains(
response, "You don't have permission to start new threads", status_code=400
)
def test_cant_start_thread_in_locked_category(self):
"""can't post in closed category"""
self.category.is_closed = True
self.category.save()
self.override_acl({'can_close_threads': 0})
response = self.client.post(self.api_link, {
'category': self.category.pk,
})
self.assertContains(response, "This category is closed.", status_code=400)
def test_cant_start_thread_in_invalid_category(self):
"""can't post in invalid category"""
self.category.is_closed = True
self.category.save()
self.override_acl({'can_close_threads': 0})
response = self.client.post(self.api_link, {'category': self.category.pk * 100000})
self.assertContains(response, "Selected category doesn't exist", status_code=400)
def test_empty_data(self):
"""no data sent handling has no showstoppers"""
self.override_acl()
response = self.client.post(self.api_link, data={})
self.assertEqual(response.status_code, 400)
self.assertEqual(
response.json(), {
'category': ["You have to select category to post thread in."],
'title': ["You have to enter thread title."],
'post': ["You have to enter a message."],
}
)
def test_title_is_validated(self):
"""title is validated"""
self.override_acl()
response = self.client.post(
self.api_link,
data={
'category': self.category.pk,
'title': "------",
'post': "Lorem ipsum dolor met, sit amet elit!",
}
)
self.assertEqual(response.status_code, 400)
self.assertEqual(
response.json(), {
'title': ["Thread title should contain alpha-numeric characters."],
}
)
def test_post_is_validated(self):
"""post is validated"""
self.override_acl()
response = self.client.post(
self.api_link,
data={
'category': self.category.pk,
'title': "Lorem ipsum dolor met",
'post': "a",
}
)
self.assertEqual(response.status_code, 400)
self.assertEqual(
response.json(), {
'post': ["Posted message should be at least 5 characters long (it has 1)."],
}
)
def test_can_start_thread(self):
"""endpoint creates new thread"""
self.override_acl()
response = self.client.post(
self.api_link,
data={
'category': self.category.pk,
'title': "Hello, I am test thread!",
'post': "Lorem ipsum dolor met!",
}
)
self.assertEqual(response.status_code, 200)
thread = self.user.thread_set.all()[:1][0]
response_json = response.json()
self.assertEqual(response_json['url'], thread.get_absolute_url())
self.override_acl()
response = self.client.get(thread.get_absolute_url())
self.assertContains(response, self.category.name)
self.assertContains(response, thread.title)
self.assertContains(response, "<p>Lorem ipsum dolor met!</p>")
# api increased user's threads and posts counts
self.reload_user()
self.assertEqual(self.user.threads, 1)
self.assertEqual(self.user.posts, 1)
self.assertEqual(thread.category_id, self.category.pk)
self.assertEqual(thread.title, "Hello, I am test thread!")
self.assertEqual(thread.starter_id, self.user.id)
self.assertEqual(thread.starter_name, self.user.username)
self.assertEqual(thread.starter_slug, self.user.slug)
self.assertEqual(thread.last_poster_id, self.user.id)
self.assertEqual(thread.last_poster_name, self.user.username)
self.assertEqual(thread.last_poster_slug, self.user.slug)
post = self.user.post_set.all()[:1][0]
self.assertEqual(post.category_id, self.category.pk)
self.assertEqual(post.original, 'Lorem ipsum dolor met!')
self.assertEqual(post.poster_id, self.user.id)
self.assertEqual(post.poster_name, self.user.username)
category = Category.objects.get(pk=self.category.pk)
self.assertEqual(category.threads, 1)
self.assertEqual(category.posts, 1)
self.assertEqual(category.last_thread_id, thread.id)
self.assertEqual(category.last_thread_title, thread.title)
self.assertEqual(category.last_thread_slug, thread.slug)
self.assertEqual(category.last_poster_id, self.user.id)
self.assertEqual(category.last_poster_name, self.user.username)
self.assertEqual(category.last_poster_slug, self.user.slug)
def test_start_closed_thread_no_permission(self):
"""permission is checked before thread is closed"""
self.override_acl({'can_close_threads': 0})
response = self.client.post(
self.api_link,
data={
'category': self.category.pk,
'title': "Hello, I am test thread!",
'post': "Lorem ipsum dolor met!",
'close': True,
}
)
self.assertEqual(response.status_code, 200)
thread = self.user.thread_set.all()[:1][0]
self.assertFalse(thread.is_closed)
def test_start_closed_thread(self):
"""can post closed thread"""
self.override_acl({'can_close_threads': 1})
response = self.client.post(
self.api_link,
data={
'category': self.category.pk,
'title': "Hello, I am test thread!",
'post': "Lorem ipsum dolor met!",
'close': True,
}
)
self.assertEqual(response.status_code, 200)
thread = self.user.thread_set.all()[:1][0]
self.assertTrue(thread.is_closed)
def test_start_unpinned_thread(self):
"""can post unpinned thread"""
self.override_acl({'can_pin_threads': 1})
response = self.client.post(
self.api_link,
data={
'category': self.category.pk,
'title': "Hello, I am test thread!",
'post': "Lorem ipsum dolor met!",
'pin': 0,
}
)
self.assertEqual(response.status_code, 200)
thread = self.user.thread_set.all()[:1][0]
self.assertEqual(thread.weight, 0)
def test_start_locally_pinned_thread(self):
"""can post locally pinned thread"""
self.override_acl({'can_pin_threads': 1})
response = self.client.post(
self.api_link,
data={
'category': self.category.pk,
'title': "Hello, I am test thread!",
'post': "Lorem ipsum dolor met!",
'pin': 1,
}
)
self.assertEqual(response.status_code, 200)
thread = self.user.thread_set.all()[:1][0]
self.assertEqual(thread.weight, 1)
def test_start_globally_pinned_thread(self):
"""can post globally pinned thread"""
self.override_acl({'can_pin_threads': 2})
response = self.client.post(
self.api_link,
data={
'category': self.category.pk,
'title': "Hello, I am test thread!",
'post': "Lorem ipsum dolor met!",
'pin': 2,
}
)
self.assertEqual(response.status_code, 200)
thread = self.user.thread_set.all()[:1][0]
self.assertEqual(thread.weight, 2)
def test_start_globally_pinned_thread_no_permission(self):
"""cant post globally pinned thread without permission"""
self.override_acl({'can_pin_threads': 1})
response = self.client.post(
self.api_link,
data={
'category': self.category.pk,
'title': "Hello, I am test thread!",
'post': "Lorem ipsum dolor met!",
'pin': 2,
}
)
self.assertEqual(response.status_code, 200)
thread = self.user.thread_set.all()[:1][0]
self.assertEqual(thread.weight, 0)
def test_start_locally_pinned_thread_no_permission(self):
"""cant post locally pinned thread without permission"""
self.override_acl({'can_pin_threads': 0})
response = self.client.post(
self.api_link,
data={
'category': self.category.pk,
'title': "Hello, I am test thread!",
'post': "Lorem ipsum dolor met!",
'pin': 1,
}
)
self.assertEqual(response.status_code, 200)
thread = self.user.thread_set.all()[:1][0]
self.assertEqual(thread.weight, 0)
def test_start_hidden_thread(self):
"""can post hidden thread"""
self.override_acl({'can_hide_threads': 1})
response = self.client.post(
self.api_link,
data={
'category': self.category.pk,
'title': "Hello, I am test thread!",
'post': "Lorem ipsum dolor met!",
'hide': 1,
}
)
self.assertEqual(response.status_code, 200)
thread = self.user.thread_set.all()[:1][0]
self.assertTrue(thread.is_hidden)
category = Category.objects.get(pk=self.category.pk)
self.assertNotEqual(category.last_thread_id, thread.id)
def test_start_hidden_thread_no_permission(self):
"""cant post hidden thread without permission"""
self.override_acl({'can_hide_threads': 0})
response = self.client.post(
self.api_link,
data={
'category': self.category.pk,
'title': "Hello, I am test thread!",
'post': "Lorem ipsum dolor met!",
'hide': 1,
}
)
self.assertEqual(response.status_code, 200)
thread = self.user.thread_set.all()[:1][0]
self.assertFalse(thread.is_hidden)
def test_post_unicode(self):
"""unicode characters can be posted"""
self.override_acl()
response = self.client.post(
self.api_link,
data={
'category': self.category.pk,
'title': "Brzęczyżczykiewicz",
'post': "Chrzążczyżewoszyce, powiat Łękółody.",
}
)
self.assertEqual(response.status_code, 200)
def test_category_moderation_queue(self):
"""start unapproved thread in category that requires approval"""
self.category.require_threads_approval = True
self.category.save()
response = self.client.post(
self.api_link,
data={
'category': self.category.pk,
'title': "Hello, I am test thread!",
'post': "Lorem ipsum dolor met!",
}
)
self.assertEqual(response.status_code, 200)
thread = self.user.thread_set.all()[:1][0]
self.assertTrue(thread.is_unapproved)
self.assertTrue(thread.has_unapproved_posts)
post = self.user.post_set.all()[:1][0]
self.assertTrue(post.is_unapproved)
category = Category.objects.get(slug='first-category')
self.assertEqual(category.threads, self.category.threads)
self.assertEqual(category.posts, self.category.posts)
self.assertFalse(category.last_thread_id == thread.id)
def test_category_moderation_queue_bypass(self):
"""bypass moderation queue due to user's acl"""
override_acl(self.user, {'can_approve_content': 1})
self.category.require_threads_approval = True
self.category.save()
response = self.client.post(
self.api_link,
data={
'category': self.category.pk,
'title': "Hello, I am test thread!",
'post': "Lorem ipsum dolor met!",
}
)
self.assertEqual(response.status_code, 200)
thread = self.user.thread_set.all()[:1][0]
self.assertFalse(thread.is_unapproved)
self.assertFalse(thread.has_unapproved_posts)
post = self.user.post_set.all()[:1][0]
self.assertFalse(post.is_unapproved)
category = Category.objects.get(slug='first-category')
self.assertEqual(category.threads, self.category.threads + 1)
self.assertEqual(category.posts, self.category.posts + 1)
self.assertEqual(category.last_thread_id, thread.id)
def test_user_moderation_queue(self):
"""start unapproved thread in category that requires approval"""
self.override_acl({'require_threads_approval': 1})
response = self.client.post(
self.api_link,
data={
'category': self.category.pk,
'title': "Hello, I am test thread!",
'post': "Lorem ipsum dolor met!",
}
)
self.assertEqual(response.status_code, 200)
thread = self.user.thread_set.all()[:1][0]
self.assertTrue(thread.is_unapproved)
self.assertTrue(thread.has_unapproved_posts)
post = self.user.post_set.all()[:1][0]
self.assertTrue(post.is_unapproved)
category = Category.objects.get(slug='first-category')
self.assertEqual(category.threads, self.category.threads)
self.assertEqual(category.posts, self.category.posts)
self.assertFalse(category.last_thread_id == thread.id)
def test_user_moderation_queue_bypass(self):
"""bypass moderation queue due to user's acl"""
override_acl(self.user, {'can_approve_content': 1})
self.override_acl({'require_threads_approval': 1})
response = self.client.post(
self.api_link,
data={
'category': self.category.pk,
'title': "Hello, I am test thread!",
'post': "Lorem ipsum dolor met!",
}
)
self.assertEqual(response.status_code, 200)
thread = self.user.thread_set.all()[:1][0]
self.assertFalse(thread.is_unapproved)
self.assertFalse(thread.has_unapproved_posts)
post = self.user.post_set.all()[:1][0]
self.assertFalse(post.is_unapproved)
category = Category.objects.get(slug='first-category')
self.assertEqual(category.threads, self.category.threads + 1)
self.assertEqual(category.posts, self.category.posts + 1)
self.assertEqual(category.last_thread_id, thread.id)
def test_omit_other_moderation_queues(self):
"""other queues are omitted"""
self.category.require_replies_approval = True
self.category.require_edits_approval = True
self.category.save()
self.override_acl({
'require_replies_approval': 1,
'require_edits_approval': 1,
})
response = self.client.post(
self.api_link,
data={
'category': self.category.pk,
'title': "Hello, I am test thread!",
'post': "Lorem ipsum dolor met!",
}
)
self.assertEqual(response.status_code, 200)
thread = self.user.thread_set.all()[:1][0]
self.assertFalse(thread.is_unapproved)
self.assertFalse(thread.has_unapproved_posts)
post = self.user.post_set.all()[:1][0]
self.assertFalse(post.is_unapproved)
category = Category.objects.get(slug='first-category')
self.assertEqual(category.threads, self.category.threads + 1)
self.assertEqual(category.posts, self.category.posts + 1)
self.assertEqual(category.last_thread_id, thread.id)
| 34.773832
| 92
| 0.591378
| 2,117
| 18,604
| 5.031176
| 0.086443
| 0.090132
| 0.042062
| 0.051638
| 0.804619
| 0.751291
| 0.707445
| 0.663412
| 0.621256
| 0.603042
| 0
| 0.013244
| 0.289723
| 18,604
| 534
| 93
| 34.838951
| 0.792796
| 0.054719
| 0
| 0.595534
| 0
| 0
| 0.133742
| 0.00905
| 0
| 0
| 0
| 0
| 0.233251
| 1
| 0.066998
| false
| 0.004963
| 0.012407
| 0
| 0.081886
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
32a6bc350408108059a22890ba78ca222d29f5de
| 238
|
py
|
Python
|
prettyqt/charts/horizontalbarseries.py
|
phil65/PrettyQt
|
26327670c46caa039c9bd15cb17a35ef5ad72e6c
|
[
"MIT"
] | 7
|
2019-05-01T01:34:36.000Z
|
2022-03-08T02:24:14.000Z
|
prettyqt/charts/horizontalbarseries.py
|
phil65/PrettyQt
|
26327670c46caa039c9bd15cb17a35ef5ad72e6c
|
[
"MIT"
] | 141
|
2019-04-16T11:22:01.000Z
|
2021-04-14T15:12:36.000Z
|
prettyqt/charts/horizontalbarseries.py
|
phil65/PrettyQt
|
26327670c46caa039c9bd15cb17a35ef5ad72e6c
|
[
"MIT"
] | 5
|
2019-04-17T11:48:19.000Z
|
2021-11-21T10:30:19.000Z
|
from __future__ import annotations
from prettyqt import charts
from prettyqt.qt import QtCharts
QtCharts.QHorizontalBarSeries.__bases__ = (charts.AbstractBarSeries,)
class HorizontalBarSeries(QtCharts.QHorizontalBarSeries):
pass
| 19.833333
| 69
| 0.836134
| 23
| 238
| 8.304348
| 0.608696
| 0.125654
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.113445
| 238
| 11
| 70
| 21.636364
| 0.905213
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.166667
| 0.5
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
|
0
| 4
|
32c0015a7986ea022f3d419b66ca21e8c1b9ba8b
| 658
|
py
|
Python
|
amy/extrequests/migrations/0002_auto_20190130_0839.py
|
code-review-doctor/amy
|
268c1a199510457891459f3ddd73fcce7fe2b974
|
[
"MIT"
] | 53
|
2015-01-10T17:39:19.000Z
|
2019-06-12T17:36:34.000Z
|
amy/extrequests/migrations/0002_auto_20190130_0839.py
|
code-review-doctor/amy
|
268c1a199510457891459f3ddd73fcce7fe2b974
|
[
"MIT"
] | 1,176
|
2015-01-02T06:32:47.000Z
|
2019-06-18T11:57:47.000Z
|
amy/extrequests/migrations/0002_auto_20190130_0839.py
|
code-review-doctor/amy
|
268c1a199510457891459f3ddd73fcce7fe2b974
|
[
"MIT"
] | 44
|
2015-01-03T15:08:56.000Z
|
2019-06-09T05:33:08.000Z
|
# Generated by Django 2.1.2 on 2019-01-30 08:39
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('extrequests', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='profileupdaterequest',
name='domains',
),
migrations.RemoveField(
model_name='profileupdaterequest',
name='languages',
),
migrations.RemoveField(
model_name='profileupdaterequest',
name='lessons',
),
migrations.DeleteModel(
name='ProfileUpdateRequest',
),
]
| 22.689655
| 47
| 0.566869
| 51
| 658
| 7.235294
| 0.588235
| 0.260163
| 0.211382
| 0.243902
| 0.439024
| 0.439024
| 0
| 0
| 0
| 0
| 0
| 0.042986
| 0.328267
| 658
| 28
| 48
| 23.5
| 0.791855
| 0.068389
| 0
| 0.454545
| 1
| 0
| 0.206219
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.045455
| 0
| 0.181818
| 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
|
32c410d630c4e17f2191fa22a2796b5bf79b6809
| 79
|
py
|
Python
|
op/apps.py
|
Joaxin/django-welogs
|
260a72322cdc5591ecd3ceae1dc99a66da333d2b
|
[
"MIT"
] | null | null | null |
op/apps.py
|
Joaxin/django-welogs
|
260a72322cdc5591ecd3ceae1dc99a66da333d2b
|
[
"MIT"
] | null | null | null |
op/apps.py
|
Joaxin/django-welogs
|
260a72322cdc5591ecd3ceae1dc99a66da333d2b
|
[
"MIT"
] | null | null | null |
from django.apps import AppConfig
class OpConfig(AppConfig):
name = 'op'
| 13.166667
| 33
| 0.721519
| 10
| 79
| 5.7
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.189873
| 79
| 5
| 34
| 15.8
| 0.890625
| 0
| 0
| 0
| 0
| 0
| 0.025316
| 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
|
0861282df8569903c28453dfddce41243458a6d3
| 151
|
py
|
Python
|
lander/__init__.py
|
antoinebrl/rl-mars-lander
|
77c74bc4a866e733eb6c714db2665de9e2763593
|
[
"MIT"
] | 2
|
2022-03-24T06:00:27.000Z
|
2022-03-25T14:33:48.000Z
|
lander/__init__.py
|
antoinebrl/rl-mars-lander
|
77c74bc4a866e733eb6c714db2665de9e2763593
|
[
"MIT"
] | null | null | null |
lander/__init__.py
|
antoinebrl/rl-mars-lander
|
77c74bc4a866e733eb6c714db2665de9e2763593
|
[
"MIT"
] | null | null | null |
from gym.envs.registration import register
from .environment import MarsLanderEnv
register(
id="MarsLander-v1",
entry_point=MarsLanderEnv,
)
| 16.777778
| 42
| 0.774834
| 17
| 151
| 6.823529
| 0.764706
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.007752
| 0.145695
| 151
| 8
| 43
| 18.875
| 0.891473
| 0
| 0
| 0
| 0
| 0
| 0.086093
| 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
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.