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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c20cc5b9985041baad3774577e490b609d522ba0
| 2,094
|
py
|
Python
|
app/models/order/order.py
|
Hugking/lin-cms-flask
|
5f79e744e60d0f1b81c6e8bd045ab4ffa00043ce
|
[
"MIT"
] | null | null | null |
app/models/order/order.py
|
Hugking/lin-cms-flask
|
5f79e744e60d0f1b81c6e8bd045ab4ffa00043ce
|
[
"MIT"
] | null | null | null |
app/models/order/order.py
|
Hugking/lin-cms-flask
|
5f79e744e60d0f1b81c6e8bd045ab4ffa00043ce
|
[
"MIT"
] | null | null | null |
from lin.exception import NotFound, ParameterException
from lin.interface import InfoCrud as Base
from sqlalchemy import Column, String, Integer, DECIMAL,Text, ForeignKey,DateTime,Index, Boolean
class Order(Base):
id = Column(Integer, primary_key=True, autoincrement=True)
order_sn = Column(String(40),nullable=False,default='')
member_id = Column(Integer, index=True,nullable=False,default='')
order_status = Column(Integer,index=True,nullable=False,default='0')
shipping_status = Column(Integer,index=True,nullable=False,default='0')
pay_status = Column(Integer,index=True,nullable=False,default='0')
consignee = Column(String(60),nullable=False,default='')
country = Column(Integer,nullable=False,default='0')
province = Column(Integer,nullable=False,default='0')
city = Column(Integer,nullable=False,default='0')
district = Column(Integer,nullable=False,default='0')
address = Column(String(255),nullable=False,default='')
mobile = Column(String(60),nullable=False,default='')
postscript = Column(String(255),nullable=False,default='')
shipping_fee = Column(DECIMAL(10,2),nullable=False,default='0.00')
pay_name = Column(String(255),nullable=False,default='')
pay_id = Column(Integer,index=True,nullable=False,default='0')
actual_price = Column(DECIMAL(10,2),nullable=False,default='0.00')# 实际支付金额
integral = Column(Integer,nullable=False,default='0')
integral_money = Column(Integer,nullable=False,default='0.00')
order_price = Column(DECIMAL(10,2),nullable=False,default='0.00')# 订单总价
goods_price = Column(DECIMAL(10,2),nullable=False,default='0.00')# 商品总价
add_time = Column(DateTime)
confirm_time = Column(DateTime)
pay_time = Column(DateTime)
freight_price = Column(DECIMAL(10,2),nullable=False,default='0.00')# 配送费用
coupon_id = Column(Integer,nullable=False,default='0')# 优惠卷id
parent_id = Column(Integer,nullable=False,default='0')
coupon_price = Column(DECIMAL(10,2),nullable=False,default='0.00')
callback_status = Column(Boolean,nullable=False,default='True')
| 58.166667
| 96
| 0.734002
| 280
| 2,094
| 5.414286
| 0.246429
| 0.222955
| 0.343008
| 0.24934
| 0.624011
| 0.622691
| 0.374011
| 0.326517
| 0.26781
| 0.145119
| 0
| 0.035078
| 0.115091
| 2,094
| 35
| 97
| 59.828571
| 0.783055
| 0.012894
| 0
| 0
| 0
| 0
| 0.020864
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.088235
| 0
| 1
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
c23062c67bdcc2fa00c5389f9be25bb77f07d3c9
| 17
|
py
|
Python
|
aiogithubapi/objects/users/__init__.py
|
timmo001/aiogithubapi
|
9d33bad77e49f8ee720bcd81c2cbab8a4cf8ebac
|
[
"MIT"
] | 8
|
2019-07-24T18:14:25.000Z
|
2022-03-01T18:33:53.000Z
|
aiogithubapi/objects/users/__init__.py
|
timmo001/aiogithubapi
|
9d33bad77e49f8ee720bcd81c2cbab8a4cf8ebac
|
[
"MIT"
] | 33
|
2019-12-18T22:15:06.000Z
|
2022-03-30T06:08:38.000Z
|
aiogithubapi/objects/users/__init__.py
|
timmo001/aiogithubapi
|
9d33bad77e49f8ee720bcd81c2cbab8a4cf8ebac
|
[
"MIT"
] | 14
|
2019-09-02T17:50:16.000Z
|
2022-03-14T10:30:37.000Z
|
"""Deprecated"""
| 8.5
| 16
| 0.588235
| 1
| 17
| 10
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.058824
| 17
| 1
| 17
| 17
| 0.625
| 0.588235
| 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
|
c2495098acf24554f050526c8e8dee8fd2bb78cc
| 312
|
py
|
Python
|
src/aijack/collaborative/fedgems/__init__.py
|
Koukyosyumei/AIJack
|
9545d3828907b54965ede85e0e12cb32eef54294
|
[
"MIT"
] | 24
|
2021-11-17T02:16:47.000Z
|
2022-03-27T01:04:08.000Z
|
src/aijack/collaborative/fedgems/__init__.py
|
Koukyosyumei/AIJack
|
9545d3828907b54965ede85e0e12cb32eef54294
|
[
"MIT"
] | 9
|
2021-12-03T06:09:27.000Z
|
2022-03-29T06:33:53.000Z
|
src/aijack/collaborative/fedgems/__init__.py
|
Koukyosyumei/AIJack
|
9545d3828907b54965ede85e0e12cb32eef54294
|
[
"MIT"
] | 5
|
2022-01-12T09:58:04.000Z
|
2022-03-17T09:29:04.000Z
|
"""Implementation of `Cheng, Sijie, et al. "FedGEMS: Federated Learning of Larger
Server Models via Selective Knowledge Fusion." arXiv preprint arXiv:2110.11027 (2021).`"""
from .api import FedGEMSAPI # noqa: F401
from .client import FedGEMSClient # noqa : F401
from .server import FedGEMSServer # noqa: F401
| 52
| 90
| 0.759615
| 41
| 312
| 5.780488
| 0.731707
| 0.101266
| 0.101266
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.082707
| 0.147436
| 312
| 5
| 91
| 62.4
| 0.808271
| 0.644231
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 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
|
dfaf7c99f0b30dfa6cbcc5c9a28cd2525b87f5ce
| 86
|
py
|
Python
|
obj/Any CPU/Release/Package/PackageTmp/wsgi.py
|
jdehorty/python-sample-vscode-flask-tutorial
|
04caabe83e0bc74a79ae5f406ec9ab44284d2758
|
[
"MIT"
] | null | null | null |
obj/Any CPU/Release/Package/PackageTmp/wsgi.py
|
jdehorty/python-sample-vscode-flask-tutorial
|
04caabe83e0bc74a79ae5f406ec9ab44284d2758
|
[
"MIT"
] | null | null | null |
obj/Any CPU/Release/Package/PackageTmp/wsgi.py
|
jdehorty/python-sample-vscode-flask-tutorial
|
04caabe83e0bc74a79ae5f406ec9ab44284d2758
|
[
"MIT"
] | null | null | null |
# wsgi.py
# !/usr/bin/env python -W ignore::DeprecationWarning
import app
app.run()
| 12.285714
| 52
| 0.709302
| 13
| 86
| 4.692308
| 0.923077
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.139535
| 86
| 6
| 53
| 14.333333
| 0.824324
| 0.674419
| 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
|
dfc62afb9348185aa1cc0c8a9ec1ea13da157ca4
| 135
|
py
|
Python
|
Day-056/01-getpass_echo.py
|
arvimal/100DaysofCode-Python
|
01e59f45b4dc06a3be9e9900456a6bd439752911
|
[
"MIT"
] | 1
|
2020-06-15T05:59:01.000Z
|
2020-06-15T05:59:01.000Z
|
Day-056/01-getpass_echo.py
|
arvimal/100DaysofCode-Python
|
01e59f45b4dc06a3be9e9900456a6bd439752911
|
[
"MIT"
] | null | null | null |
Day-056/01-getpass_echo.py
|
arvimal/100DaysofCode-Python
|
01e59f45b4dc06a3be9e9900456a6bd439752911
|
[
"MIT"
] | 7
|
2020-01-24T23:03:58.000Z
|
2021-05-31T01:00:27.000Z
|
#!/usr/bin/env python3
import getpass
import sys
passwd = getpass.getpass(stream=sys.stderr)
print("You entered: {}".format(passwd))
| 16.875
| 43
| 0.740741
| 19
| 135
| 5.263158
| 0.736842
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.008264
| 0.103704
| 135
| 7
| 44
| 19.285714
| 0.818182
| 0.155556
| 0
| 0
| 0
| 0
| 0.132743
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.75
| 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
| 0
| 1
| 1
| 0
| 0
| 0
|
0
| 4
|
dfe484dd3cf6da54d01fddf93e35699094c66638
| 160
|
py
|
Python
|
pedrec/models/experiments/dataset_description.py
|
noboevbo/PedRec
|
891d19bd6a2c7a7d71c2e41d37e7b4c4bfc7762e
|
[
"MIT"
] | 1
|
2022-03-09T01:24:10.000Z
|
2022-03-09T01:24:10.000Z
|
pedrec/models/experiments/dataset_description.py
|
noboevbo/PedRec
|
891d19bd6a2c7a7d71c2e41d37e7b4c4bfc7762e
|
[
"MIT"
] | null | null | null |
pedrec/models/experiments/dataset_description.py
|
noboevbo/PedRec
|
891d19bd6a2c7a7d71c2e41d37e7b4c4bfc7762e
|
[
"MIT"
] | null | null | null |
from dataclasses import dataclass
@dataclass()
class DatasetDescription(object):
name: str
subsampling: int
full_length: int
used_length: int
| 16
| 33
| 0.73125
| 18
| 160
| 6.388889
| 0.777778
| 0.156522
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.20625
| 160
| 9
| 34
| 17.777778
| 0.905512
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.142857
| 0
| 0.857143
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
5f1d36c1371ea5d6865431821ee84670a3052f81
| 61
|
py
|
Python
|
src/django_future/__init__.py
|
smartpr/django-future
|
8f0031994a509c3d07aa972232760331fb8e5ed1
|
[
"MIT"
] | null | null | null |
src/django_future/__init__.py
|
smartpr/django-future
|
8f0031994a509c3d07aa972232760331fb8e5ed1
|
[
"MIT"
] | null | null | null |
src/django_future/__init__.py
|
smartpr/django-future
|
8f0031994a509c3d07aa972232760331fb8e5ed1
|
[
"MIT"
] | null | null | null |
default_app_config = 'django_future.apps.DjangoFutureConfig'
| 30.5
| 60
| 0.868852
| 7
| 61
| 7.142857
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.04918
| 61
| 1
| 61
| 61
| 0.862069
| 0
| 0
| 0
| 0
| 0
| 0.606557
| 0.606557
| 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
|
a06cbd7686067c5d1d0d108e8a30bc4b8feb3660
| 120
|
py
|
Python
|
Instagram/Interact/urls.py
|
garchaaman19/Insta_clone
|
eccf0fd305967d8701a10e586d08cb789f03c8fa
|
[
"MIT"
] | null | null | null |
Instagram/Interact/urls.py
|
garchaaman19/Insta_clone
|
eccf0fd305967d8701a10e586d08cb789f03c8fa
|
[
"MIT"
] | null | null | null |
Instagram/Interact/urls.py
|
garchaaman19/Insta_clone
|
eccf0fd305967d8701a10e586d08cb789f03c8fa
|
[
"MIT"
] | null | null | null |
from django.urls import path
from .views import CreateUserAPI
urlpatterns=[path('createuser',CreateUserAPI.as_view())]
| 24
| 56
| 0.808333
| 15
| 120
| 6.4
| 0.733333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.083333
| 120
| 5
| 56
| 24
| 0.872727
| 0
| 0
| 0
| 0
| 0
| 0.082645
| 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
|
a07b7d3271127ec3d4df552e49911c73969b2213
| 260
|
py
|
Python
|
rul_pm/datasets/lives_dataset.py
|
lucianolorenti/rul_pm
|
da9dfad79129dd47d24923cfd6c833869ef7b6a7
|
[
"MIT"
] | 1
|
2021-09-01T13:13:10.000Z
|
2021-09-01T13:13:10.000Z
|
rul_pm/datasets/lives_dataset.py
|
lucianolorenti/rul_pm
|
da9dfad79129dd47d24923cfd6c833869ef7b6a7
|
[
"MIT"
] | 3
|
2021-08-24T15:23:52.000Z
|
2021-11-09T10:28:51.000Z
|
rul_pm/datasets/lives_dataset.py
|
lucianolorenti/rul_pm
|
da9dfad79129dd47d24923cfd6c833869ef7b6a7
|
[
"MIT"
] | 1
|
2021-12-25T14:00:16.000Z
|
2021-12-25T14:00:16.000Z
|
from abc import abstractmethod, abstractproperty
from temporis.dataset.ts_dataset import AbstractTimeSeriesDataset
class AbstractLivesDataset(AbstractTimeSeriesDataset):
@abstractproperty
def rul_column(self) -> str:
raise NotImplementedError
| 32.5
| 65
| 0.819231
| 23
| 260
| 9.173913
| 0.782609
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.134615
| 260
| 8
| 66
| 32.5
| 0.937778
| 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
|
a09e3691c7bbfadc213e666c44de0dd723708a74
| 146
|
py
|
Python
|
api_keys.py
|
ElenaSezionova/python-api-challenge
|
72f8c5fc80edca5c2bee48dee6a1adbe536b9eaa
|
[
"ADSL"
] | null | null | null |
api_keys.py
|
ElenaSezionova/python-api-challenge
|
72f8c5fc80edca5c2bee48dee6a1adbe536b9eaa
|
[
"ADSL"
] | null | null | null |
api_keys.py
|
ElenaSezionova/python-api-challenge
|
72f8c5fc80edca5c2bee48dee6a1adbe536b9eaa
|
[
"ADSL"
] | null | null | null |
# OpenWeatherMap API Key
weather_api_key = "9cfaeb3dbd4832137f0fb5f0e12ca0f4"
# Google API Key
g_key = "AIzaSyBwiWBdcMksrxnWzcOvCM1cjxhqV8017_A"
| 24.333333
| 52
| 0.842466
| 14
| 146
| 8.5
| 0.642857
| 0.151261
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.160305
| 0.10274
| 146
| 5
| 53
| 29.2
| 0.748092
| 0.253425
| 0
| 0
| 0
| 0
| 0.669811
| 0.669811
| 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
|
a09e9b2d5c80056ae4659b98de115c501db0c908
| 296
|
py
|
Python
|
crawler/oda/oda_product.py
|
dangrasso/oda-crawler
|
bb8f58c27fe762d175677b14297b3be95f77f394
|
[
"MIT"
] | null | null | null |
crawler/oda/oda_product.py
|
dangrasso/oda-crawler
|
bb8f58c27fe762d175677b14297b3be95f77f394
|
[
"MIT"
] | null | null | null |
crawler/oda/oda_product.py
|
dangrasso/oda-crawler
|
bb8f58c27fe762d175677b14297b3be95f77f394
|
[
"MIT"
] | null | null | null |
from dataclasses import dataclass
from typing import Optional
@dataclass
class Product:
id: str
name: Optional[str]
brand: Optional[str]
price: Optional[str]
category_0: Optional[str]
category_1: Optional[str]
category_2: Optional[str]
category_3: Optional[str]
| 19.733333
| 33
| 0.712838
| 38
| 296
| 5.447368
| 0.473684
| 0.371981
| 0.36715
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.017021
| 0.206081
| 296
| 14
| 34
| 21.142857
| 0.86383
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.166667
| 0
| 0.916667
| 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
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
39f9f63b8039432cf478d86e499ca57c48433431
| 543
|
py
|
Python
|
pytglib/api/functions/get_database_statistics.py
|
iTeam-co/pytglib
|
e5e75e0a85f89b77762209b32a61b0a883c0ae61
|
[
"MIT"
] | 6
|
2019-10-30T08:57:27.000Z
|
2021-02-08T14:17:43.000Z
|
pytglib/api/functions/get_database_statistics.py
|
iTeam-co/python-telegram
|
e5e75e0a85f89b77762209b32a61b0a883c0ae61
|
[
"MIT"
] | 1
|
2021-08-19T05:44:10.000Z
|
2021-08-19T07:14:56.000Z
|
pytglib/api/functions/get_database_statistics.py
|
iTeam-co/python-telegram
|
e5e75e0a85f89b77762209b32a61b0a883c0ae61
|
[
"MIT"
] | 5
|
2019-12-04T05:30:39.000Z
|
2021-05-21T18:23:32.000Z
|
from ..utils import Object
class GetDatabaseStatistics(Object):
"""
Returns database statistics
Attributes:
ID (:obj:`str`): ``GetDatabaseStatistics``
No parameters required.
Returns:
DatabaseStatistics
Raises:
:class:`telegram.Error`
"""
ID = "getDatabaseStatistics"
def __init__(self, extra=None, **kwargs):
self.extra = extra
pass
@staticmethod
def read(q: dict, *args) -> "GetDatabaseStatistics":
return GetDatabaseStatistics()
| 17.516129
| 56
| 0.61326
| 45
| 543
| 7.311111
| 0.733333
| 0.054711
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.281768
| 543
| 30
| 57
| 18.1
| 0.84359
| 0.335175
| 0
| 0
| 0
| 0
| 0.133333
| 0.133333
| 0
| 0
| 0
| 0
| 0
| 1
| 0.222222
| false
| 0.111111
| 0.111111
| 0.111111
| 0.666667
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
|
0
| 4
|
261acd3face7f09797cd511111c8f87c994c5623
| 89
|
py
|
Python
|
src/dialogs/__init__.py
|
StevenBaby/chess
|
1aa3065d974351df58a5620c78ca80a10a385321
|
[
"MIT"
] | 10
|
2021-06-17T21:45:59.000Z
|
2022-03-23T04:02:45.000Z
|
src/dialogs/__init__.py
|
StevenBaby/chess
|
1aa3065d974351df58a5620c78ca80a10a385321
|
[
"MIT"
] | 2
|
2021-05-30T11:52:44.000Z
|
2021-06-29T11:06:31.000Z
|
src/dialogs/__init__.py
|
StevenBaby/chess
|
1aa3065d974351df58a5620c78ca80a10a385321
|
[
"MIT"
] | 1
|
2021-06-19T03:41:23.000Z
|
2021-06-19T03:41:23.000Z
|
'''
(C) Copyright 2021 Steven;
@author: Steven kangweibaby@163.com
@date: 2021-06-30
'''
| 14.833333
| 35
| 0.685393
| 13
| 89
| 4.692308
| 0.846154
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.192308
| 0.123596
| 89
| 5
| 36
| 17.8
| 0.589744
| 0.898876
| 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
|
265d5d0bea909e9736137b335f095e44a6475eac
| 93
|
py
|
Python
|
01_-_hello_world.py
|
LukaIgnjatovic/freeCodeCamp.org---Learn-Python---Full-Course-for-Beginners
|
6e4fc54203da15921bd6562c1fa7a915b45b4ad1
|
[
"MIT"
] | 12
|
2018-11-05T10:52:19.000Z
|
2022-03-08T07:12:44.000Z
|
01_-_hello_world.py
|
LukaIgnjatovic/freeCodeCamp.org---Learn-Python---Full-Course-for-Beginners
|
6e4fc54203da15921bd6562c1fa7a915b45b4ad1
|
[
"MIT"
] | null | null | null |
01_-_hello_world.py
|
LukaIgnjatovic/freeCodeCamp.org---Learn-Python---Full-Course-for-Beginners
|
6e4fc54203da15921bd6562c1fa7a915b45b4ad1
|
[
"MIT"
] | 17
|
2019-01-13T08:09:45.000Z
|
2022-03-14T22:51:44.000Z
|
# "print" function prints the string that was given to it as an input.
print("Hello world!")
| 31
| 70
| 0.731183
| 16
| 93
| 4.25
| 0.9375
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.172043
| 93
| 2
| 71
| 46.5
| 0.883117
| 0.731183
| 0
| 0
| 0
| 0
| 0.521739
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
2671cd63e956feebbd09c94e1793d6e926b77359
| 15
|
py
|
Python
|
openml_data_integration/protobuf_generator/openml_1480/myconstants.py
|
tuix/tutorials
|
733d35a8a39df079e8c2432c441b70785ab08440
|
[
"Apache-2.0"
] | 8
|
2020-04-21T13:29:04.000Z
|
2021-12-13T08:59:09.000Z
|
openml_data_integration/protobuf_generator/openml_1480/myconstants.py
|
tuix/tutorials
|
733d35a8a39df079e8c2432c441b70785ab08440
|
[
"Apache-2.0"
] | 3
|
2021-04-27T11:03:04.000Z
|
2021-05-24T18:22:57.000Z
|
openml_data_integration/protobuf_generator/openml_1480/myconstants.py
|
tuix/tutorials
|
733d35a8a39df079e8c2432c441b70785ab08440
|
[
"Apache-2.0"
] | 6
|
2020-07-06T08:23:25.000Z
|
2021-11-24T10:39:34.000Z
|
DATA_ID = 1480
| 7.5
| 14
| 0.733333
| 3
| 15
| 3.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.333333
| 0.2
| 15
| 1
| 15
| 15
| 0.5
| 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
|
26744bbbe2d0b31d7063cbf425bd912f11dcb858
| 117
|
py
|
Python
|
optimizers.py
|
Judithle98/BachelorThesis
|
263cd589b5bfc22bdecc304430fd76816d42101b
|
[
"CC0-1.0"
] | null | null | null |
optimizers.py
|
Judithle98/BachelorThesis
|
263cd589b5bfc22bdecc304430fd76816d42101b
|
[
"CC0-1.0"
] | null | null | null |
optimizers.py
|
Judithle98/BachelorThesis
|
263cd589b5bfc22bdecc304430fd76816d42101b
|
[
"CC0-1.0"
] | null | null | null |
class Optimizer:
pass
class RandomRestartOptimizer(Optimizer):
def __init__(self, N=10):
self.N=N
| 13
| 40
| 0.666667
| 14
| 117
| 5.285714
| 0.642857
| 0.135135
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.022472
| 0.239316
| 117
| 9
| 41
| 13
| 0.808989
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0.2
| 0
| 0
| 0.6
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 4
|
267a24e89010dd844c50b4f3f5f5b56a241cca55
| 189
|
py
|
Python
|
merf/__init__.py
|
lidscott1/merf
|
07453e0a3968a3a5ec01c79f6ce4f97d8a74058a
|
[
"MIT"
] | null | null | null |
merf/__init__.py
|
lidscott1/merf
|
07453e0a3968a3a5ec01c79f6ce4f97d8a74058a
|
[
"MIT"
] | null | null | null |
merf/__init__.py
|
lidscott1/merf
|
07453e0a3968a3a5ec01c79f6ce4f97d8a74058a
|
[
"MIT"
] | null | null | null |
import logging
logging.basicConfig(
format='%(levelname)-8s [%(filename)s:%(lineno)d] %(message)s',
level=logging.INFO)
from .merf import MERF
from .utils import MERFDataGenerator
| 23.625
| 67
| 0.730159
| 24
| 189
| 5.75
| 0.708333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.006061
| 0.126984
| 189
| 7
| 68
| 27
| 0.830303
| 0
| 0
| 0
| 0
| 0
| 0.280423
| 0.132275
| 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
|
cd003c8d4e5d8946bbbe5c83c3d9c2ff0a64b781
| 134
|
py
|
Python
|
algorithm/sort/TimSort.py
|
kosyachniy/dev
|
39bb5c5ee10780bfcd8a59cf59cfb1a348ac52a4
|
[
"Apache-2.0"
] | 13
|
2018-12-17T23:30:54.000Z
|
2021-12-29T14:31:43.000Z
|
algorithm/sort/TimSort.py
|
kosyachniy/dev
|
39bb5c5ee10780bfcd8a59cf59cfb1a348ac52a4
|
[
"Apache-2.0"
] | 36
|
2018-06-07T21:34:13.000Z
|
2022-03-13T21:01:43.000Z
|
algorithm/sort/TimSort.py
|
kosyachniy/dev
|
39bb5c5ee10780bfcd8a59cf59cfb1a348ac52a4
|
[
"Apache-2.0"
] | 2
|
2021-01-03T11:47:20.000Z
|
2021-12-29T14:31:49.000Z
|
import timeit
start=timeit.default_timer()
a=[1,5,7,3,6,6,2566,774,2,0,0,0,-3]
a.sort()
print(a)
print(timeit.default_timer()-start)
| 16.75
| 35
| 0.708955
| 29
| 134
| 3.206897
| 0.586207
| 0.27957
| 0.387097
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.142857
| 0.059701
| 134
| 8
| 36
| 16.75
| 0.595238
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.166667
| 0
| 0.166667
| 0.333333
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
cd703f027a2b7c7b176c49220a30bea4537e094b
| 549
|
py
|
Python
|
uq360/utils/transformers/original_features.py
|
Sclare87/UQ360
|
2378bfa4a8d61f813afbf6854341888434c9eb11
|
[
"Apache-2.0"
] | 148
|
2021-05-27T20:52:51.000Z
|
2022-03-16T22:49:48.000Z
|
uq360/utils/transformers/original_features.py
|
Sclare87/UQ360
|
2378bfa4a8d61f813afbf6854341888434c9eb11
|
[
"Apache-2.0"
] | 9
|
2021-06-21T18:45:07.000Z
|
2021-11-08T14:42:30.000Z
|
uq360/utils/transformers/original_features.py
|
Sclare87/UQ360
|
2378bfa4a8d61f813afbf6854341888434c9eb11
|
[
"Apache-2.0"
] | 27
|
2021-06-01T18:29:02.000Z
|
2022-03-02T06:56:03.000Z
|
from uq360.utils.transformers.feature_transformer import FeatureTransformer
class OriginalFeaturesTransformer(FeatureTransformer):
'''
Dummy/identity transformer which passes the data array through unchanged.
'''
def __init__(self):
super(OriginalFeaturesTransformer, self).__init__()
@classmethod
def name(cls):
return ('original_features')
def transform(self, x, predictions):
return x
def save(self, output_dir=None):
pass
def load(self, input_dir=None):
pass
| 23.869565
| 77
| 0.686703
| 56
| 549
| 6.517857
| 0.696429
| 0.038356
| 0.060274
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.007092
| 0.229508
| 549
| 22
| 78
| 24.954545
| 0.855792
| 0.132969
| 0
| 0.153846
| 0
| 0
| 0.036957
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.384615
| false
| 0.153846
| 0.076923
| 0.153846
| 0.692308
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
|
0
| 4
|
cd8de7d69923d5672ab52bad8b7dcd99d99c5cb3
| 1,990
|
py
|
Python
|
rta/read/test_isoquant_import.py
|
MatteoLacki/rta
|
93944d6fc934126e0bb4d076c8b4213cadbe49a1
|
[
"BSD-2-Clause"
] | 1
|
2018-05-31T14:31:18.000Z
|
2018-05-31T14:31:18.000Z
|
rta/read/test_isoquant_import.py
|
MatteoLacki/rta
|
93944d6fc934126e0bb4d076c8b4213cadbe49a1
|
[
"BSD-2-Clause"
] | null | null | null |
rta/read/test_isoquant_import.py
|
MatteoLacki/rta
|
93944d6fc934126e0bb4d076c8b4213cadbe49a1
|
[
"BSD-2-Clause"
] | null | null | null |
"""Develop the calibrator."""
%load_ext autoreload
%autoreload 2
%load_ext line_profiler
import matplotlib.pyplot as plt
from rta.config import *
from rta.plotters.runs import plot_runs,\
plot_experiment_comparison
from rta.quality_control.process_project import process_project
# # the first HELA dataset I've analysed.
# data_path = "../../../Data/annotated_and_unanottated_data.csv"
# # Ute's data-sets for microflow.
# data_path = "~/ms/Matteo/4Ute/2016-141 HYE Microflow_20180716_MF_120min_paper.csv"
# data = pd.read_csv(data_path)
# First shoot, than ask.
mass_projects = ["Proj__15272392369260_8293106731954075_100_1",
"Proj__15272392369260_8293106731954075_100_2",
"Proj__15272392369260_8293106731954075_100_3",
"Proj__15264893889320_6353458109334729_100_8",
"Proj__15264893889320_6353458109334729_100_11",
"Proj__15260213186990_6379462481554944_100_8",
"Proj__15260213186990_6379462481554944_100_10",
"Proj__15272392369260_8293106731954075_100_8",
"Proj__15264893889320_6353458109334729_100_17",
"Proj__15264893889320_6353458109334729_100_18"]
results = {}
for project in mass_projects:
results[project] = process_project(project, password, user, ip)
plot_runs(c.D, title=title, run_2_name=run_2_name)
plot_experiment_comparison()
c, run_2_name, project, title = results[mass_projects[-1]]
plot_runs(c.D, title=title, run_2_name=run_2_name)
plot_experiment_comparison(results,
["Proj__15272392369260_8293106731954075_100_8",
"Proj__15264893889320_6353458109334729_100_17"])
plot_experiment_comparison(results,
["Proj__15264893889320_6353458109334729_100_8",
"Proj__15260213186990_6379462481554944_100_10",
"Proj__15272392369260_8293106731954075_100_1"],
plt_style = 'default')
| 38.269231
| 84
| 0.714573
| 224
| 1,990
| 5.821429
| 0.388393
| 0.082822
| 0.156442
| 0.170245
| 0.447086
| 0.388037
| 0.304448
| 0.304448
| 0.304448
| 0.304448
| 0
| 0.343038
| 0.20603
| 1,990
| 51
| 85
| 39.019608
| 0.482278
| 0.134673
| 0
| 0.181818
| 0
| 0
| 0.390969
| 0.386809
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0.030303
| 0.121212
| null | null | 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
cd960014085ab7db7e7a22d23d144e71644ced73
| 111
|
py
|
Python
|
example/users/admin.py
|
supercodepoet/django-authority
|
9c17430b03ed1c0a51cf50194786100601c3ea2e
|
[
"BSD-3-Clause"
] | 1
|
2015-05-26T10:16:30.000Z
|
2015-05-26T10:16:30.000Z
|
example/users/admin.py
|
supercodepoet/django-authority
|
9c17430b03ed1c0a51cf50194786100601c3ea2e
|
[
"BSD-3-Clause"
] | null | null | null |
example/users/admin.py
|
supercodepoet/django-authority
|
9c17430b03ed1c0a51cf50194786100601c3ea2e
|
[
"BSD-3-Clause"
] | null | null | null |
from django.contrib.auth.admin import UserAdmin
from example.users.User
admin.site.register(User, UserAdmin)
| 18.5
| 47
| 0.81982
| 16
| 111
| 5.6875
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.09009
| 111
| 5
| 48
| 22.2
| 0.90099
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.333333
| null | null | 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
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
26c1a206cb4012e82c96d0597d4c93d520002991
| 285
|
py
|
Python
|
src/masonite_package_sync/utils.py
|
girardinsamuel/masonite-package-sync
|
8d3c631592c666b922bbd1b204ae4db5713ca023
|
[
"MIT"
] | null | null | null |
src/masonite_package_sync/utils.py
|
girardinsamuel/masonite-package-sync
|
8d3c631592c666b922bbd1b204ae4db5713ca023
|
[
"MIT"
] | null | null | null |
src/masonite_package_sync/utils.py
|
girardinsamuel/masonite-package-sync
|
8d3c631592c666b922bbd1b204ae4db5713ca023
|
[
"MIT"
] | null | null | null |
def replace_string_in_file(filepath, searched, replaced):
with open(filepath) as f:
file_source = f.read()
# replace all occurences
replace_string = file_source.replace(searched, replaced)
with open(filepath, "w") as f:
f.write(replace_string)
| 31.666667
| 64
| 0.673684
| 37
| 285
| 5
| 0.486486
| 0.210811
| 0.216216
| 0.259459
| 0.345946
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.231579
| 285
| 8
| 65
| 35.625
| 0.844749
| 0.077193
| 0
| 0
| 0
| 0
| 0.003831
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| false
| 0
| 0
| 0
| 0.166667
| 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
|
26cd3a2bb6ca9a6aab3f385e09bc05b0e1740331
| 68
|
py
|
Python
|
ambari-agent/src/main/python/resource_management/core/exceptions.py
|
boydos/incubator-ambari
|
e10d85756dd55729c20aeda2baa0d6c93c4ca31d
|
[
"Apache-2.0"
] | 2
|
2018-06-06T14:21:11.000Z
|
2018-06-06T14:22:50.000Z
|
ambari-agent/src/main/python/resource_management/core/exceptions.py
|
boydos/incubator-ambari
|
e10d85756dd55729c20aeda2baa0d6c93c4ca31d
|
[
"Apache-2.0"
] | null | null | null |
ambari-agent/src/main/python/resource_management/core/exceptions.py
|
boydos/incubator-ambari
|
e10d85756dd55729c20aeda2baa0d6c93c4ca31d
|
[
"Apache-2.0"
] | null | null | null |
class Fail(Exception):
pass
class InvalidArgument(Fail):
pass
| 9.714286
| 28
| 0.735294
| 8
| 68
| 6.25
| 0.625
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.176471
| 68
| 6
| 29
| 11.333333
| 0.892857
| 0
| 0
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 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
|
26d474883a340a3bcf89466855c18d283879ec1f
| 76
|
py
|
Python
|
organice/models.py
|
bittner/django-organice
|
7621e4cf2361db84b42d77e5e72e341559eb9906
|
[
"Apache-2.0"
] | 34
|
2015-04-22T12:47:32.000Z
|
2022-03-18T02:16:17.000Z
|
organice/models.py
|
TebelloX/django-organice
|
7621e4cf2361db84b42d77e5e72e341559eb9906
|
[
"Apache-2.0"
] | 13
|
2015-07-24T05:25:56.000Z
|
2020-09-02T17:38:35.000Z
|
organice/models.py
|
TebelloX/django-organice
|
7621e4cf2361db84b42d77e5e72e341559eb9906
|
[
"Apache-2.0"
] | 14
|
2015-05-01T20:42:49.000Z
|
2022-03-25T01:12:34.000Z
|
"""
No real model, just an empty file to make Django load the fixtures.
"""
| 19
| 67
| 0.697368
| 13
| 76
| 4.076923
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.197368
| 76
| 3
| 68
| 25.333333
| 0.868852
| 0.881579
| 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
|
26f05c903e8b626a141fe763eeed44e975f4a402
| 747
|
py
|
Python
|
constants.py
|
hbontempo-br/broker-api
|
992118bcb2754df34053a6dd56020d2e3002ce78
|
[
"MIT"
] | null | null | null |
constants.py
|
hbontempo-br/broker-api
|
992118bcb2754df34053a6dd56020d2e3002ce78
|
[
"MIT"
] | null | null | null |
constants.py
|
hbontempo-br/broker-api
|
992118bcb2754df34053a6dd56020d2e3002ce78
|
[
"MIT"
] | null | null | null |
import os
from utils.environment import get_environment_variable
# ------- GENERAL ------- #
SERVICE_ROOT = os.path.abspath(os.path.dirname(__file__))
PROJECT_ROOT = os.path.abspath(os.path.join(SERVICE_ROOT, os.pardir))
SERVICE_NAME = get_environment_variable("SERVICE_NAME", "broker-api")
COMMIT = get_environment_variable("COMMIT", "COMMIT")
# ------- DB INFO ------- #
DB_USER = get_environment_variable("DB_USER")
DB_PASSWORD = get_environment_variable("DB_PASSWORD")
DB_ADDRESS = get_environment_variable("DB_ADDRESS")
DB_PORT = get_environment_variable("DB_PORT", "3306")
DB_DATABASE = get_environment_variable("DB_DATABASE", "broker")
# ------- SCHEMA ------- #
SCHEMA_FILE = os.path.join(SERVICE_ROOT, "documentation", "schema.yaml")
| 37.35
| 72
| 0.742972
| 96
| 747
| 5.395833
| 0.333333
| 0.216216
| 0.339768
| 0.23166
| 0.158301
| 0.088803
| 0
| 0
| 0
| 0
| 0
| 0.005848
| 0.084337
| 747
| 19
| 73
| 39.315789
| 0.751462
| 0.096386
| 0
| 0
| 0
| 0
| 0.170915
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.083333
| 0.166667
| 0
| 0.166667
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
f83fda338deb39e6752e0faedf4b5fd97009cdc9
| 25
|
py
|
Python
|
TEST3D/GUI/0010200_page_pixsel/cleanup.py
|
usnistgov/OOF3D
|
4fd423a48aea9c5dc207520f02de53ae184be74c
|
[
"X11"
] | 31
|
2015-04-01T15:59:36.000Z
|
2022-03-18T20:21:47.000Z
|
TEST3D/GUI/0010200_page_pixsel/cleanup.py
|
usnistgov/OOF3D
|
4fd423a48aea9c5dc207520f02de53ae184be74c
|
[
"X11"
] | 3
|
2015-02-06T19:30:24.000Z
|
2017-05-25T14:14:31.000Z
|
TEST3D/GUI/0010200_page_pixsel/cleanup.py
|
usnistgov/OOF3D
|
4fd423a48aea9c5dc207520f02de53ae184be74c
|
[
"X11"
] | 7
|
2015-01-23T15:19:22.000Z
|
2021-06-09T09:03:59.000Z
|
removefile('pixsel.log')
| 12.5
| 24
| 0.76
| 3
| 25
| 6.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.04
| 25
| 1
| 25
| 25
| 0.791667
| 0
| 0
| 0
| 0
| 0
| 0.4
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
f84ff12aad0645a3ba6d2b9f7986ea611b8c0740
| 48
|
py
|
Python
|
Grammar/02Var and types/hello_word.py
|
Abraham-Thomas/shiyanlou-code
|
ae3b940b406ba4af942dd51627fd93e85effe5b9
|
[
"MIT"
] | null | null | null |
Grammar/02Var and types/hello_word.py
|
Abraham-Thomas/shiyanlou-code
|
ae3b940b406ba4af942dd51627fd93e85effe5b9
|
[
"MIT"
] | null | null | null |
Grammar/02Var and types/hello_word.py
|
Abraham-Thomas/shiyanlou-code
|
ae3b940b406ba4af942dd51627fd93e85effe5b9
|
[
"MIT"
] | null | null | null |
message = "Hello Python world!"
print(message)
| 12
| 31
| 0.729167
| 6
| 48
| 5.833333
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.145833
| 48
| 3
| 32
| 16
| 0.853659
| 0
| 0
| 0
| 0
| 0
| 0.395833
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.5
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
f8543075ec3280d01d66eb6454016a1c234ba89b
| 24
|
py
|
Python
|
demo/apps/hello/__init__.py
|
mysidewalk/pykc-meetup1
|
258dfb8debc46174c089cfb0583cb88b03fbbe07
|
[
"MIT"
] | null | null | null |
demo/apps/hello/__init__.py
|
mysidewalk/pykc-meetup1
|
258dfb8debc46174c089cfb0583cb88b03fbbe07
|
[
"MIT"
] | null | null | null |
demo/apps/hello/__init__.py
|
mysidewalk/pykc-meetup1
|
258dfb8debc46174c089cfb0583cb88b03fbbe07
|
[
"MIT"
] | null | null | null |
""" Hello world app
"""
| 8
| 19
| 0.541667
| 3
| 24
| 4.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.208333
| 24
| 2
| 20
| 12
| 0.684211
| 0.625
| 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
|
f86aafde96be1084e84a233789edbf89f503cde6
| 113
|
py
|
Python
|
implementation/wrong.py
|
sr9000/stepik_code_task_baking
|
60a5197f659db1734132eeb9d82624f1b7aaeb3f
|
[
"MIT"
] | null | null | null |
implementation/wrong.py
|
sr9000/stepik_code_task_baking
|
60a5197f659db1734132eeb9d82624f1b7aaeb3f
|
[
"MIT"
] | null | null | null |
implementation/wrong.py
|
sr9000/stepik_code_task_baking
|
60a5197f659db1734132eeb9d82624f1b7aaeb3f
|
[
"MIT"
] | null | null | null |
from pre_definition.tag import wrong
@wrong
def plus1(n):
print(n + 1)
@wrong
def noway(n):
print(n)
| 9.416667
| 36
| 0.646018
| 19
| 113
| 3.789474
| 0.631579
| 0.222222
| 0.194444
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.022989
| 0.230089
| 113
| 11
| 37
| 10.272727
| 0.804598
| 0
| 0
| 0.285714
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0
| 0.142857
| 0
| 0.428571
| 0.285714
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
f882dbc0473240cba4b9cb499360bf1629372cfb
| 67
|
py
|
Python
|
aiida_castep/workflows/__init__.py
|
asamli/aiida-castep
|
893113152460a632439c91652211381091566645
|
[
"MIT"
] | 3
|
2021-09-02T16:02:47.000Z
|
2021-12-17T22:38:20.000Z
|
aiida_castep/workflows/__init__.py
|
asamli/aiida-castep
|
893113152460a632439c91652211381091566645
|
[
"MIT"
] | 16
|
2020-05-07T07:58:01.000Z
|
2022-03-21T11:35:35.000Z
|
aiida_castep/workflows/__init__.py
|
asamli/aiida-castep
|
893113152460a632439c91652211381091566645
|
[
"MIT"
] | 3
|
2020-05-25T13:05:51.000Z
|
2021-12-17T22:39:12.000Z
|
"""
Sub-package of workchain and workfuctions for aiida-castep
"""
| 16.75
| 58
| 0.746269
| 9
| 67
| 5.555556
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.134328
| 67
| 3
| 59
| 22.333333
| 0.862069
| 0.865672
| 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
|
f886d2525b5880e8d47bb153058d681896087d79
| 363
|
py
|
Python
|
raiden/tests/unit/utils/test_formatting.py
|
tirkarthi/raiden
|
dbd03ddda039332b54ec0c02d81cbe1100bc8028
|
[
"MIT"
] | 2,101
|
2016-06-01T11:31:49.000Z
|
2022-03-27T20:13:19.000Z
|
raiden/tests/unit/utils/test_formatting.py
|
tirkarthi/raiden
|
dbd03ddda039332b54ec0c02d81cbe1100bc8028
|
[
"MIT"
] | 5,291
|
2016-06-01T18:14:04.000Z
|
2022-03-31T11:19:09.000Z
|
raiden/tests/unit/utils/test_formatting.py
|
tirkarthi/raiden
|
dbd03ddda039332b54ec0c02d81cbe1100bc8028
|
[
"MIT"
] | 484
|
2016-06-01T18:21:06.000Z
|
2022-03-22T10:29:45.000Z
|
import os
from eth_utils import to_checksum_address as eth_utils_checksum
from raiden.utils.formatting import to_checksum_address
from raiden.utils.typing import Address
def test_random_addresses():
for _ in range(100):
address_bytes = Address(os.urandom(20))
assert eth_utils_checksum(address_bytes) == to_checksum_address(address_bytes)
| 27.923077
| 86
| 0.793388
| 52
| 363
| 5.211538
| 0.461538
| 0.221402
| 0.188192
| 0.169742
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.016129
| 0.146006
| 363
| 12
| 87
| 30.25
| 0.858065
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125
| 1
| 0.125
| false
| 0
| 0.5
| 0
| 0.625
| 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
| 1
| 0
| 0
| 0
|
0
| 4
|
f8870764592f360880ae8e4c0975132a7535ce49
| 89
|
py
|
Python
|
abc178/b.py
|
nishio/atcoder
|
8db36537b5d8580745d5f98312162506ad7d7ab4
|
[
"MIT"
] | 1
|
2021-03-09T04:28:13.000Z
|
2021-03-09T04:28:13.000Z
|
abc178/b.py
|
nishio/atcoder
|
8db36537b5d8580745d5f98312162506ad7d7ab4
|
[
"MIT"
] | null | null | null |
abc178/b.py
|
nishio/atcoder
|
8db36537b5d8580745d5f98312162506ad7d7ab4
|
[
"MIT"
] | null | null | null |
A, B, C, D = map(int, input().split())
print(max(x * y for x in [A, B] for y in [C, D]))
| 29.666667
| 49
| 0.516854
| 22
| 89
| 2.090909
| 0.636364
| 0.086957
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.224719
| 89
| 2
| 50
| 44.5
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 0.5
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
f8b4fc852c49f9b7f4810fc5e30fdebee9fa3250
| 32
|
py
|
Python
|
env/lib/python3.7/__future__.py
|
mwikiaBundi1/Pitch-ip
|
16f2e2459abafeebd828dfff7cbc554db3b56b42
|
[
"MIT"
] | 12
|
2019-08-02T07:58:16.000Z
|
2022-01-31T23:45:08.000Z
|
env/lib/python3.7/__future__.py
|
mwikiaBundi1/Pitch-ip
|
16f2e2459abafeebd828dfff7cbc554db3b56b42
|
[
"MIT"
] | 9
|
2021-03-19T02:17:08.000Z
|
2022-03-12T00:01:38.000Z
|
env/lib/python3.7/__future__.py
|
mwikiaBundi1/Pitch-ip
|
16f2e2459abafeebd828dfff7cbc554db3b56b42
|
[
"MIT"
] | 11
|
2019-07-31T16:23:36.000Z
|
2022-01-29T08:30:07.000Z
|
/usr/lib/python3.7/__future__.py
| 32
| 32
| 0.8125
| 6
| 32
| 3.666667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.0625
| 0
| 32
| 1
| 32
| 32
| 0.625
| 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
|
3e14210cc030ce3f7670478505157f1f5ce0fafa
| 608
|
py
|
Python
|
runfile/exceptions.py
|
awkspace/runfile
|
4f457099c6b12c1d08b3bd960ee49fc3da04b0e3
|
[
"MIT"
] | 1
|
2021-08-20T02:21:53.000Z
|
2021-08-20T02:21:53.000Z
|
runfile/exceptions.py
|
awkspace/runfile
|
4f457099c6b12c1d08b3bd960ee49fc3da04b0e3
|
[
"MIT"
] | null | null | null |
runfile/exceptions.py
|
awkspace/runfile
|
4f457099c6b12c1d08b3bd960ee49fc3da04b0e3
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python3
class RunfileFormatError(Exception):
pass
class RunfileNotFoundError(Exception):
def __init__(self, path):
self.path = path
class TargetNotFoundError(Exception):
def __init__(self, target=None):
self.target = target
class TargetExecutionError(Exception):
def __init__(self, exit_code):
self.exit_code = exit_code
class CodeBlockExecutionError(Exception):
def __init__(self, exit_code):
self.exit_code = exit_code
class ContainerBuildError(Exception):
def __init__(self, exit_code):
self.exit_code = exit_code
| 19.612903
| 41
| 0.712171
| 68
| 608
| 5.941176
| 0.308824
| 0.178218
| 0.178218
| 0.247525
| 0.381188
| 0.381188
| 0.381188
| 0.381188
| 0.381188
| 0.381188
| 0
| 0.002053
| 0.199013
| 608
| 30
| 42
| 20.266667
| 0.827515
| 0.034539
| 0
| 0.352941
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.294118
| false
| 0.058824
| 0
| 0
| 0.647059
| 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
| 0
| 1
| 0
|
0
| 4
|
3e36349cf503a86256f690d89715bf64dcf047d4
| 130
|
py
|
Python
|
oidc_server/oidc_provider_settings.py
|
vicalloy/oidc-server
|
fbef282dc3c33f29e857d35fea05fc2a49b0a6d2
|
[
"MIT"
] | 7
|
2022-02-17T07:25:39.000Z
|
2022-03-27T11:15:48.000Z
|
oidc_server/oidc_provider_settings.py
|
vicalloy/oidc-server
|
fbef282dc3c33f29e857d35fea05fc2a49b0a6d2
|
[
"MIT"
] | 2
|
2022-03-27T11:15:45.000Z
|
2022-03-31T01:04:01.000Z
|
oidc_server/oidc_provider_settings.py
|
vicalloy/oidc-server
|
fbef282dc3c33f29e857d35fea05fc2a49b0a6d2
|
[
"MIT"
] | 1
|
2022-03-02T11:44:01.000Z
|
2022-03-02T11:44:01.000Z
|
def userinfo(claims, user):
claims["name"] = user.username
claims["preferred_username"] = user.username
return claims
| 26
| 48
| 0.7
| 15
| 130
| 6
| 0.533333
| 0.266667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.176923
| 130
| 4
| 49
| 32.5
| 0.841122
| 0
| 0
| 0
| 0
| 0
| 0.169231
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
3e5d9fa374f41367a44effee56611b99e5ed78e8
| 84
|
py
|
Python
|
hibro/wsgi.py
|
DavidMStraub/HiBro
|
ce08d4c091994a0e9f503712378fe357385ac4c8
|
[
"MIT"
] | 8
|
2019-12-30T14:05:54.000Z
|
2021-09-19T21:28:36.000Z
|
hibro/wsgi.py
|
DavidMStraub/HiBro
|
ce08d4c091994a0e9f503712378fe357385ac4c8
|
[
"MIT"
] | 1
|
2020-03-08T10:59:24.000Z
|
2020-06-08T18:22:23.000Z
|
hibro/wsgi.py
|
DavidMStraub/HiBro
|
ce08d4c091994a0e9f503712378fe357385ac4c8
|
[
"MIT"
] | 1
|
2020-10-18T16:37:21.000Z
|
2020-10-18T16:37:21.000Z
|
from .dashboard import create_app
app = create_app(config_file="hibro-config.yaml")
| 28
| 49
| 0.809524
| 13
| 84
| 5
| 0.692308
| 0.276923
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.083333
| 84
| 3
| 49
| 28
| 0.844156
| 0
| 0
| 0
| 0
| 0
| 0.2
| 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
|
3e7d10e4d8bb197a829b29abaee322dbef27f715
| 131
|
py
|
Python
|
codes/course5/demo101.py
|
BigShuang/big-shuang-python-introductory-course
|
c4fd1343c4c539567180072c749b68bda7c28075
|
[
"MIT"
] | null | null | null |
codes/course5/demo101.py
|
BigShuang/big-shuang-python-introductory-course
|
c4fd1343c4c539567180072c749b68bda7c28075
|
[
"MIT"
] | null | null | null |
codes/course5/demo101.py
|
BigShuang/big-shuang-python-introductory-course
|
c4fd1343c4c539567180072c749b68bda7c28075
|
[
"MIT"
] | null | null | null |
num = input("Please enter a num: ")
while not num.isdigit():
num = input("Please enter a num: ")
print("Your num: %s" % num)
| 18.714286
| 39
| 0.610687
| 21
| 131
| 3.809524
| 0.52381
| 0.2
| 0.35
| 0.475
| 0.575
| 0.575
| 0
| 0
| 0
| 0
| 0
| 0
| 0.21374
| 131
| 6
| 40
| 21.833333
| 0.776699
| 0
| 0
| 0.5
| 0
| 0
| 0.4
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.25
| 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
|
3e8a37e2a2b50b7ddc45d0f1deaff0e70c0f1ebd
| 161
|
py
|
Python
|
ml_modulation/modulators/exceptions.py
|
DmitryBelikov/ml-modulation
|
510d05c751c3450c0063eee82918fb5947c55b26
|
[
"MIT"
] | null | null | null |
ml_modulation/modulators/exceptions.py
|
DmitryBelikov/ml-modulation
|
510d05c751c3450c0063eee82918fb5947c55b26
|
[
"MIT"
] | null | null | null |
ml_modulation/modulators/exceptions.py
|
DmitryBelikov/ml-modulation
|
510d05c751c3450c0063eee82918fb5947c55b26
|
[
"MIT"
] | null | null | null |
class ModulationException(Exception):
pass
class EncodingException(ModulationException):
pass
class DecodingException(ModulationException):
pass
| 14.636364
| 45
| 0.78882
| 12
| 161
| 10.583333
| 0.5
| 0.141732
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.15528
| 161
| 10
| 46
| 16.1
| 0.933824
| 0
| 0
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
3e918893f0b4db7c166232c2fe9a98bc438e1e59
| 152
|
py
|
Python
|
timed while loop.py
|
hwdevops/pyxows
|
caadd107f53bef683c23ffcd84af46dde189c1f2
|
[
"MIT"
] | null | null | null |
timed while loop.py
|
hwdevops/pyxows
|
caadd107f53bef683c23ffcd84af46dde189c1f2
|
[
"MIT"
] | null | null | null |
timed while loop.py
|
hwdevops/pyxows
|
caadd107f53bef683c23ffcd84af46dde189c1f2
|
[
"MIT"
] | null | null | null |
import time
duration = 20 # [seconds]
time_start = time.time()
while time.time() < time_start + duration:
print(time.time())
time.sleep(.5)
| 16.888889
| 42
| 0.651316
| 21
| 152
| 4.619048
| 0.47619
| 0.412371
| 0.247423
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.02459
| 0.197368
| 152
| 8
| 43
| 19
| 0.770492
| 0.059211
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.166667
| 0
| 0.166667
| 0.166667
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
e413006e6dd214b130c93f1b7bbe8b6760929831
| 241
|
py
|
Python
|
abandoned/admin.py
|
Kunstmord/abandoned
|
d6ed86ace6521144699b668d0e91497a7b3b6dc2
|
[
"MIT"
] | null | null | null |
abandoned/admin.py
|
Kunstmord/abandoned
|
d6ed86ace6521144699b668d0e91497a7b3b6dc2
|
[
"MIT"
] | 10
|
2015-01-10T15:08:50.000Z
|
2015-03-28T18:48:49.000Z
|
abandoned/admin.py
|
Kunstmord/abandoned
|
d6ed86ace6521144699b668d0e91497a7b3b6dc2
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from abandoned.models import Tag, Project, Author, Reason, Language
admin.site.register(Tag)
admin.site.register(Project)
admin.site.register(Author)
admin.site.register(Reason)
admin.site.register(Language)
| 30.125
| 67
| 0.821577
| 34
| 241
| 5.823529
| 0.411765
| 0.227273
| 0.429293
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.070539
| 241
| 8
| 68
| 30.125
| 0.883929
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.285714
| 0
| 0.285714
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
e4295da2f7812b00aee90ea339be9189b4602eb0
| 352
|
py
|
Python
|
LFA/class_assembly_line.py
|
joao-frohlich/BCC
|
9ed74eb6d921d1280f48680677a2140c5383368d
|
[
"Apache-2.0"
] | 10
|
2020-12-08T20:18:15.000Z
|
2021-06-07T20:00:07.000Z
|
LFA/class_assembly_line.py
|
joao-frohlich/BCC
|
9ed74eb6d921d1280f48680677a2140c5383368d
|
[
"Apache-2.0"
] | 2
|
2021-06-28T03:42:13.000Z
|
2021-06-28T16:53:13.000Z
|
LFA/class_assembly_line.py
|
joao-frohlich/BCC
|
9ed74eb6d921d1280f48680677a2140c5383368d
|
[
"Apache-2.0"
] | 2
|
2021-01-14T19:59:20.000Z
|
2021-06-15T11:53:21.000Z
|
from utils import *
from class_moore import Moore
class Assembly_Line:
def __init__(self, assembly_type):
self.automaton = Moore(*read_7_tuple_from_data(assembly_type))
self.type = self.automaton.name
def __len__(self):
return self.automaton.capacity
def __str__(self):
return str(self.automaton.output)
| 23.466667
| 70
| 0.704545
| 46
| 352
| 4.956522
| 0.478261
| 0.22807
| 0.140351
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.00361
| 0.213068
| 352
| 14
| 71
| 25.142857
| 0.819495
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.3
| false
| 0
| 0.2
| 0.2
| 0.8
| 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
|
e446c6b72b1180701247061836cd43880629e196
| 335
|
py
|
Python
|
civilpy/__init__.py
|
drparks71/CivilPy
|
96b714970d326ee1da3cc0578e05fba8ea751660
|
[
"MIT"
] | 2
|
2021-09-22T00:03:20.000Z
|
2021-09-24T03:06:13.000Z
|
civilpy/__init__.py
|
drparks71/CivilPy
|
96b714970d326ee1da3cc0578e05fba8ea751660
|
[
"MIT"
] | null | null | null |
civilpy/__init__.py
|
drparks71/CivilPy
|
96b714970d326ee1da3cc0578e05fba8ea751660
|
[
"MIT"
] | null | null | null |
import sympy as sym
import numpy as np
import pint
import civilpy
unit = pint.UnitRegistry()
from civilpy import structural
from civilpy import geotechnical
from civilpy import general
from civilpy import environmental
from civilpy import systems_management
from civilpy import transportation
from civilpy import water_resources
| 17.631579
| 38
| 0.841791
| 45
| 335
| 6.222222
| 0.444444
| 0.275
| 0.425
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.146269
| 335
| 18
| 39
| 18.611111
| 0.979021
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.916667
| 0
| 0.916667
| 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
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
e45c7d6fa9c363e47d8b85736a918a7bd0983c29
| 25
|
py
|
Python
|
processing/__init__.py
|
jakebrinkmann/lagoon-emperor-penguin
|
03de04028ee771a635b162a29990b868504c51d5
|
[
"Unlicense"
] | null | null | null |
processing/__init__.py
|
jakebrinkmann/lagoon-emperor-penguin
|
03de04028ee771a635b162a29990b868504c51d5
|
[
"Unlicense"
] | null | null | null |
processing/__init__.py
|
jakebrinkmann/lagoon-emperor-penguin
|
03de04028ee771a635b162a29990b868504c51d5
|
[
"Unlicense"
] | null | null | null |
__version__ = '3.0.dev1'
| 12.5
| 24
| 0.68
| 4
| 25
| 3.25
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.136364
| 0.12
| 25
| 1
| 25
| 25
| 0.454545
| 0
| 0
| 0
| 0
| 0
| 0.32
| 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
|
e464f66c16f718f99363b762b12f121ab2773792
| 6,382
|
py
|
Python
|
test/model/declare/node_declaration_test.py
|
Manu343726/biicode-common
|
91b32c6fd1e4a72ce5451183f1766d313cd0e420
|
[
"MIT"
] | 17
|
2015-04-15T09:40:23.000Z
|
2017-05-17T20:34:49.000Z
|
test/model/declare/node_declaration_test.py
|
Manu343726/biicode-common
|
91b32c6fd1e4a72ce5451183f1766d313cd0e420
|
[
"MIT"
] | 2
|
2015-04-22T11:29:36.000Z
|
2018-09-25T09:31:09.000Z
|
test/model/declare/node_declaration_test.py
|
bowlofstew/common
|
45e9ca902be7bbbdd73dafe3ab8957bc4a006020
|
[
"MIT"
] | 22
|
2015-04-15T09:46:00.000Z
|
2020-09-29T17:03:31.000Z
|
from unittest import TestCase
from biicode.common.model.brl.block_cell_name import BlockCellName
from biicode.common.model.declare.node_declaration import NodeDeclaration
from nose.plugins.attrib import attr
@attr('node')
class TestNodeDeclaration(TestCase):
def test_usual_node_import(self):
cut = NodeDeclaration("fran/noderedis")
self.assertEquals("fran/noderedis", cut.block())
def test_metrics_require(self):
cut = NodeDeclaration("metrics")
self.assertEquals(None, cut.block())
def test_path_rel_require(self):
cut = NodeDeclaration("./")
self.assertEquals(None, cut.block())
def test_extension_namelist(self):
cut = NodeDeclaration("fran/noderedis/index")
self.assertItemsEqual(["fran/noderedis/index.json",
"fran/noderedis/index.js",
"fran/noderedis/index.node"], cut._extension_name)
def test_extension_namelist_with_relative(self):
cut = NodeDeclaration(".lib/queue")
cut.extension_namelist()
self.assertItemsEqual([".lib/queue.json",
".lib/queue.js",
".lib/queue.node"], cut._extension_name)
def test_extension_namelist_with_extension(self):
cut = NodeDeclaration("fran/noderedis/index.js")
cut.extension_namelist()
self.assertItemsEqual(["fran/noderedis/index.js"], cut._extension_name)
def test_explicit_node_require(self):
cut = NodeDeclaration("fran/noderedis/index.js")
self.assertEquals("fran/noderedis", cut.block())
self.assertEquals(BlockCellName("fran/noderedis/index.js"), cut.block_cell_name())
def test_relative_require(self):
cut = NodeDeclaration("../parser")
origin_block_cell_name = BlockCellName("fran/noderedis/other/other.js")
block_cell_names = [BlockCellName("fran/noderedis/index.js"),
BlockCellName("fran/noderedis/other/other.js"),
BlockCellName("fran/noderedis/parser.js")]
self.assertItemsEqual(set(["fran/noderedis/parser.js"]),
cut.match(block_cell_names, origin_block_cell_name))
def test_relative_require_not_found(self):
cut = NodeDeclaration("../parser")
origin_block_cell_name = BlockCellName("fran/noderedis/other/thing/other.js")
block_cell_names = [BlockCellName("fran/noderedis/index.js"),
BlockCellName("fran/noderedis/other/thing/other.js"),
BlockCellName("fran/noderedis/parser.js")]
self.assertItemsEqual(set(), cut.match(block_cell_names, origin_block_cell_name))
def test_one_level_relative_require(self):
cut = NodeDeclaration("./lib/queue")
origin_block_cell_name = BlockCellName("fran/noderedis/index.js")
block_cell_names = [BlockCellName("fran/noderedis/index.js"),
BlockCellName("fran/noderedis/lib/queue.js"),
BlockCellName("fran/noderedis/lib/parser.js")]
self.assertItemsEqual(set(["fran/noderedis/lib/queue.js"]),
cut.match(block_cell_names, origin_block_cell_name))
def test_one_level_relative_require_with_depth(self):
cut = NodeDeclaration("./lib/parser/queue")
origin_block_cell_name = BlockCellName("fran/noderedis/index.js")
block_cell_names = [BlockCellName("fran/noderedis/index.js"),
BlockCellName("fran/noderedis/lib/queue.js"),
BlockCellName("fran/noderedis/lib/parser/queue.js")]
self.assertItemsEqual(set(["fran/noderedis/lib/parser/queue.js"]),
cut.match(block_cell_names, origin_block_cell_name))
def test_match_with_implicit_require(self):
cut = NodeDeclaration("fran/noderedis")
block_cell_names = [BlockCellName("fran/noderedis/index.js"),
BlockCellName("fran/noderedis/other.js")]
self.assertItemsEqual(set([BlockCellName("fran/noderedis/index.js")]),
cut.match(block_cell_names))
def test_match_with_implicit_require_with_index_and_package(self):
cut = NodeDeclaration("fran/noderedis")
block_cell_names = [BlockCellName("fran/noderedis/index.js"),
BlockCellName("fran/noderedis/package.json"),
BlockCellName("fran/noderedis/other.js")]
self.assertItemsEqual(set([BlockCellName("fran/noderedis/index.js"),
BlockCellName("fran/noderedis/package.json")]),
cut.match(block_cell_names))
def test_match_with_implicit_require_nothing_found(self):
cut = NodeDeclaration("fran/noderedis")
block_cell_names = [BlockCellName("fran/noderedis/other.js")]
self.assertItemsEqual(set(), cut.match(block_cell_names))
def test_same_path_relative_index_require(self):
cut = NodeDeclaration("./")
origin_block_cell_name = BlockCellName("fran/noderedis/bench.js")
block_cell_names = [BlockCellName("fran/noderedis/index.js"),
BlockCellName("fran/noderedis/client.js")]
m = cut.match(block_cell_names, origin_block_cell_name)
self.assertItemsEqual(set(["fran/noderedis/index.js"]), m)
def test_package_json_recognition(self):
cut = NodeDeclaration("fran/noderedis")
block_cell_names = [BlockCellName("fran/noderedis/package.json"),
BlockCellName("fran/noderedis/other.js")]
self.assertItemsEqual(set([BlockCellName("fran/noderedis/package.json")]),
cut.match(block_cell_names))
def test_normalize_declaration(self):
cut = NodeDeclaration("fran/noderedis")
block_cell_names = [BlockCellName("fran/noderedis/package.json")]
self.assertEquals(cut, cut.normalize(block_cell_names))
def test_normalize_declaration_package_and_index(self):
cut = NodeDeclaration("fran/noderedis")
block_cell_names = [BlockCellName("fran/noderedis/index.js"),
BlockCellName("fran/noderedis/package.json")]
self.assertEquals(cut, cut.normalize(block_cell_names))
| 45.585714
| 90
| 0.646819
| 671
| 6,382
| 5.918033
| 0.101341
| 0.180055
| 0.229161
| 0.090657
| 0.833291
| 0.772098
| 0.712667
| 0.609922
| 0.608663
| 0.562327
| 0
| 0
| 0.235663
| 6,382
| 139
| 91
| 45.913669
| 0.814063
| 0
| 0
| 0.419048
| 0
| 0
| 0.219837
| 0.178941
| 0
| 0
| 0
| 0
| 0.180952
| 1
| 0.171429
| false
| 0
| 0.047619
| 0
| 0.228571
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
e465bd2cd030834af54a332a451d7a70e191117a
| 223
|
py
|
Python
|
examples/flask/my_site/config.py
|
monokrome/patreon-python
|
09aad6800c6b9f33e026712a43e5f7e7c7a2a391
|
[
"Apache-2.0"
] | null | null | null |
examples/flask/my_site/config.py
|
monokrome/patreon-python
|
09aad6800c6b9f33e026712a43e5f7e7c7a2a391
|
[
"Apache-2.0"
] | null | null | null |
examples/flask/my_site/config.py
|
monokrome/patreon-python
|
09aad6800c6b9f33e026712a43e5f7e7c7a2a391
|
[
"Apache-2.0"
] | null | null | null |
# Fill all this out with your information
patreon_client_id = None
patreon_client_secret = None
patreon_creator_refresh_token = None
patreon_creator_access_token = None
patreon_creator_id = None
patreon_redirect_uri = None
| 27.875
| 41
| 0.852018
| 33
| 223
| 5.333333
| 0.545455
| 0.3125
| 0.306818
| 0.261364
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.116592
| 223
| 7
| 42
| 31.857143
| 0.893401
| 0.174888
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 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
|
e47a8084bc5461fc15a8a0c6fc2ae5b6b9cc63f1
| 1,578
|
py
|
Python
|
client/clients/models.py
|
kim-chae-yeon/My.CL
|
2ca236e1791197ee331a6740bf7b5b75147fc995
|
[
"MIT"
] | null | null | null |
client/clients/models.py
|
kim-chae-yeon/My.CL
|
2ca236e1791197ee331a6740bf7b5b75147fc995
|
[
"MIT"
] | 8
|
2021-09-26T18:50:19.000Z
|
2021-12-09T14:38:47.000Z
|
client/clients/models.py
|
kim-chae-yeon/My.CL
|
2ca236e1791197ee331a6740bf7b5b75147fc995
|
[
"MIT"
] | 2
|
2021-12-02T12:46:11.000Z
|
2021-12-11T13:31:50.000Z
|
from djongo import models
class Recommendation(models.Model):
lecture_id = models.CharField(max_length=20)
lecture_name = models.CharField(max_length=100)
class Meta:
abstract = True
class CategoryLog(models.Model):
_id = models.ObjectIdField()
user_id = models.IntegerField(blank=True)
add_date = models.DateTimeField(auto_now_add=True)
grade = models.CharField(max_length=20)
subject = models.CharField(max_length=20)
achivement = models.CharField(max_length=20)
site = models.CharField(max_length=20)
tag_jobdam = models.CharField(max_length=20)
tag_pilgi = models.CharField(max_length=20)
tag_jindo = models.CharField(max_length=20)
objects = models.DjongoManager()
class Lecture(models.Model) :
title = models.CharField(max_length=100)
teacher = models.CharField(max_length=100)
subject = models.CharField(max_length=100)
grade = models.CharField(max_length=100)
link = models.CharField(max_length=200)
class ReviewLog(models.Model):
_id = models.ObjectIdField()
user_id = models.IntegerField(blank=True)
lecture_id = models.CharField(blank=True, max_length=30)
lecture_title = models.CharField(blank=True, max_length=30)
add_date = models.DateTimeField(auto_now_add=True)
achivement = models.CharField(max_length=20)
tag_jobdam = models.CharField(max_length=20)
tag_pilgi = models.CharField(max_length=20)
tag_jindo = models.CharField(max_length=20)
lec_comment = models.CharField(max_length = 1000)
objects = models.DjongoManager()
| 35.863636
| 63
| 0.739544
| 205
| 1,578
| 5.487805
| 0.229268
| 0.28
| 0.304
| 0.405333
| 0.729778
| 0.519111
| 0.478222
| 0.416
| 0.344889
| 0.344889
| 0
| 0.037594
| 0.157161
| 1,578
| 44
| 64
| 35.863636
| 0.808271
| 0
| 0
| 0.444444
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.027778
| 0
| 0.972222
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
e480e6d621dd50f200c7bd3b580988cca74ecc53
| 72
|
py
|
Python
|
__init__.py
|
KonstantinosRekoumis/CFD_CNN_Thesis
|
086c378df21ddac9e7902cac05daf514121c76a2
|
[
"MIT"
] | null | null | null |
__init__.py
|
KonstantinosRekoumis/CFD_CNN_Thesis
|
086c378df21ddac9e7902cac05daf514121c76a2
|
[
"MIT"
] | null | null | null |
__init__.py
|
KonstantinosRekoumis/CFD_CNN_Thesis
|
086c378df21ddac9e7902cac05daf514121c76a2
|
[
"MIT"
] | null | null | null |
"""
Some random dude proposed this to be the solution to my problems
"""
| 24
| 64
| 0.736111
| 12
| 72
| 4.416667
| 0.916667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.180556
| 72
| 3
| 65
| 24
| 0.898305
| 0.888889
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
e49735eb562ee900157badeb515e209416e782fa
| 93
|
py
|
Python
|
mysite/pollstree/apps.py
|
fabioamafra/django-tutorial
|
b2beb7fc2d998589634611c48f22a486a4032be5
|
[
"MIT"
] | null | null | null |
mysite/pollstree/apps.py
|
fabioamafra/django-tutorial
|
b2beb7fc2d998589634611c48f22a486a4032be5
|
[
"MIT"
] | 16
|
2019-11-14T01:28:03.000Z
|
2022-02-10T10:23:42.000Z
|
mysite/pollstree/apps.py
|
fabioamafra/django-tutorial
|
b2beb7fc2d998589634611c48f22a486a4032be5
|
[
"MIT"
] | 3
|
2019-11-14T00:58:54.000Z
|
2019-11-14T01:05:32.000Z
|
from django.apps import AppConfig
class PollstreeConfig(AppConfig):
name = 'pollstree'
| 15.5
| 33
| 0.763441
| 10
| 93
| 7.1
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.16129
| 93
| 5
| 34
| 18.6
| 0.910256
| 0
| 0
| 0
| 0
| 0
| 0.096774
| 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
|
e4b156663c690e4b425b5bfa2d41201014f307ab
| 333
|
py
|
Python
|
python/chapter2/exercise3.py
|
gonditeniz/cracking-coding-interview
|
00243f806dc88ae6edac0120188359aa1a5357a6
|
[
"MIT"
] | null | null | null |
python/chapter2/exercise3.py
|
gonditeniz/cracking-coding-interview
|
00243f806dc88ae6edac0120188359aa1a5357a6
|
[
"MIT"
] | null | null | null |
python/chapter2/exercise3.py
|
gonditeniz/cracking-coding-interview
|
00243f806dc88ae6edac0120188359aa1a5357a6
|
[
"MIT"
] | null | null | null |
class Node:
next_node = None
data = 0
def __init__(self, value):
self.data = value
def run(input_data):
if input_data is None or input_data.next_node is None:
return False
input_data.data = input_data.next_node.data
input_data.next_node = input_data.next_node.next_node
return True
| 22.2
| 58
| 0.678679
| 52
| 333
| 4.019231
| 0.346154
| 0.301435
| 0.248804
| 0.325359
| 0.200957
| 0
| 0
| 0
| 0
| 0
| 0
| 0.004032
| 0.255255
| 333
| 14
| 59
| 23.785714
| 0.83871
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.181818
| false
| 0
| 0
| 0
| 0.636364
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
e4c45c3db5068e419301740fe1e740d3d2de33a7
| 175
|
py
|
Python
|
design_patterns/abstract_factory/abstract_products/coffe_table.py
|
amommendes/python-fluente
|
04b3b257802c368acd313f93ef42aee8c4564d9c
|
[
"Apache-2.0"
] | null | null | null |
design_patterns/abstract_factory/abstract_products/coffe_table.py
|
amommendes/python-fluente
|
04b3b257802c368acd313f93ef42aee8c4564d9c
|
[
"Apache-2.0"
] | 2
|
2020-04-02T06:03:34.000Z
|
2021-08-23T20:40:32.000Z
|
design_patterns/abstract_factory/abstract_products/coffe_table.py
|
amommendes/python-fluente
|
04b3b257802c368acd313f93ef42aee8c4564d9c
|
[
"Apache-2.0"
] | null | null | null |
from abc import ABC,abstractmethod
class CoffeTable(ABC):
@abstractmethod
def size(self):
pass
@abstractmethod
def color(self):
pass
| 11.666667
| 34
| 0.611429
| 18
| 175
| 5.944444
| 0.611111
| 0.317757
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.32
| 175
| 14
| 35
| 12.5
| 0.89916
| 0
| 0
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0.25
| 0.125
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
e4e615eb535aee4734b30d6939effaec19e55cd6
| 137
|
py
|
Python
|
roll_witch/rolling/protocols/targetable.py
|
DavidWylie/RollWitch
|
9fe16db2117b1cbce02d2206cd529c4bfcc93f55
|
[
"BSD-3-Clause"
] | null | null | null |
roll_witch/rolling/protocols/targetable.py
|
DavidWylie/RollWitch
|
9fe16db2117b1cbce02d2206cd529c4bfcc93f55
|
[
"BSD-3-Clause"
] | 1
|
2020-10-26T17:29:27.000Z
|
2020-10-27T13:43:44.000Z
|
roll_witch/rolling/protocols/targetable.py
|
DavidWylie/RollWitch
|
9fe16db2117b1cbce02d2206cd529c4bfcc93f55
|
[
"BSD-3-Clause"
] | null | null | null |
from typing import Protocol
class Targetable(Protocol):
target_number: int
def has_target(self) -> bool:
return False
| 15.222222
| 33
| 0.693431
| 17
| 137
| 5.470588
| 0.882353
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.240876
| 137
| 8
| 34
| 17.125
| 0.894231
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0.2
| 0.2
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
e4f185b741c71e4e6190c8f7b1ca92caa2e5f639
| 111
|
py
|
Python
|
tests/__init__.py
|
sjoerdk/sitdown
|
2b8ba4da037e1ee098f4a88341b1202bdebde7c4
|
[
"MIT"
] | 101
|
2018-04-11T14:48:04.000Z
|
2022-03-28T00:29:48.000Z
|
tests/__init__.py
|
sjoerdk/sitdown
|
2b8ba4da037e1ee098f4a88341b1202bdebde7c4
|
[
"MIT"
] | 1,733
|
2018-03-21T11:56:16.000Z
|
2022-03-31T14:58:30.000Z
|
tests/__init__.py
|
sjoerdk/sitdown
|
2b8ba4da037e1ee098f4a88341b1202bdebde7c4
|
[
"MIT"
] | 42
|
2018-06-08T05:49:07.000Z
|
2022-03-29T08:43:01.000Z
|
from pathlib import Path
BASE_PATH = Path(__file__).parent.absolute()
RESOURCE_PATH = BASE_PATH / "resources"
| 22.2
| 44
| 0.783784
| 15
| 111
| 5.333333
| 0.666667
| 0.2
| 0.3
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.117117
| 111
| 4
| 45
| 27.75
| 0.816327
| 0
| 0
| 0
| 0
| 0
| 0.081081
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
e4f4f26afad3b716d2e113d6809aa087ecfe6fd9
| 228
|
py
|
Python
|
Python/1013.py
|
lucasferreiraa/uri-judge-respostas
|
f5fc659d53c6b512a3624764041675e62d3fa053
|
[
"MIT"
] | null | null | null |
Python/1013.py
|
lucasferreiraa/uri-judge-respostas
|
f5fc659d53c6b512a3624764041675e62d3fa053
|
[
"MIT"
] | null | null | null |
Python/1013.py
|
lucasferreiraa/uri-judge-respostas
|
f5fc659d53c6b512a3624764041675e62d3fa053
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
# URI Judge - Problema 1013
a, b, c = map(int, input().split())
if a > (b and c):
print(str(a) + " eh o maior")
elif b > c:
print(str(b) + " eh o maior")
else:
print(str(c) + " eh o maior")
| 19
| 35
| 0.517544
| 41
| 228
| 2.878049
| 0.560976
| 0.20339
| 0.20339
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.029762
| 0.263158
| 228
| 11
| 36
| 20.727273
| 0.672619
| 0.20614
| 0
| 0
| 0
| 0
| 0.185393
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 0.428571
| 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
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
9028a43c0b6bed7eb351129b3f04043099d22a1d
| 157
|
py
|
Python
|
train.py
|
bethskw/fakelegends
|
72284e8e33858a1a3efdba43e463f7c2edc66492
|
[
"MIT"
] | 4
|
2018-09-03T14:36:07.000Z
|
2020-04-06T15:52:46.000Z
|
train.py
|
bethskw/fakelegends
|
72284e8e33858a1a3efdba43e463f7c2edc66492
|
[
"MIT"
] | null | null | null |
train.py
|
bethskw/fakelegends
|
72284e8e33858a1a3efdba43e463f7c2edc66492
|
[
"MIT"
] | 1
|
2019-03-24T21:48:01.000Z
|
2019-03-24T21:48:01.000Z
|
from textgenrnn import textgenrnn
#t=textgenrnn()
t = textgenrnn('textgenrnn_weights.hdf5')
t.train_from_file('legendary_creatures.txt', num_epochs=10)
| 15.7
| 59
| 0.789809
| 21
| 157
| 5.666667
| 0.666667
| 0.184874
| 0.352941
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.021127
| 0.095541
| 157
| 9
| 60
| 17.444444
| 0.816901
| 0.089172
| 0
| 0
| 0
| 0
| 0.333333
| 0.333333
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
5fa1c64c9b8d83594f7a4af0de233d2822915be2
| 64
|
py
|
Python
|
tests/__init__.py
|
steven-murray/pydftools
|
7d3edcf0d91901a364a199fd35ac211a8bb84779
|
[
"MIT"
] | null | null | null |
tests/__init__.py
|
steven-murray/pydftools
|
7d3edcf0d91901a364a199fd35ac211a8bb84779
|
[
"MIT"
] | 3
|
2019-09-30T01:11:52.000Z
|
2019-10-09T04:57:57.000Z
|
tests/__init__.py
|
steven-murray/pydftools
|
7d3edcf0d91901a364a199fd35ac211a8bb84779
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
"""Unit test package for pydftools."""
| 16
| 38
| 0.578125
| 8
| 64
| 4.625
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.018868
| 0.171875
| 64
| 3
| 39
| 21.333333
| 0.679245
| 0.859375
| 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
|
5fa3e9f4787eecea74b09aa62f1185badbf551f4
| 197
|
py
|
Python
|
itertoolsCombinationsWithReplacement.py
|
Pratyaksh7/PythonPrograms-Hackerrank
|
171108851f8f90336123e383f945e8d36922d53b
|
[
"MIT"
] | null | null | null |
itertoolsCombinationsWithReplacement.py
|
Pratyaksh7/PythonPrograms-Hackerrank
|
171108851f8f90336123e383f945e8d36922d53b
|
[
"MIT"
] | null | null | null |
itertoolsCombinationsWithReplacement.py
|
Pratyaksh7/PythonPrograms-Hackerrank
|
171108851f8f90336123e383f945e8d36922d53b
|
[
"MIT"
] | null | null | null |
from itertools import combinations_with_replacement
n = input().split()
string = n[0].upper()
k = int(n[1])
for i in combinations_with_replacement(sorted(string), k):
print(''.join(i))
| 24.625
| 59
| 0.690355
| 29
| 197
| 4.551724
| 0.724138
| 0.242424
| 0.409091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.012048
| 0.15736
| 197
| 8
| 60
| 24.625
| 0.783133
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.166667
| 0
| 0.166667
| 0.166667
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
5faaac0726a811efcc7249f96383873171347346
| 99
|
py
|
Python
|
rsmanage/__init__.py
|
Kandongwe/RunestoneServer
|
f555868521b3717beec0ec42dbcbcb443c64686c
|
[
"MIT"
] | null | null | null |
rsmanage/__init__.py
|
Kandongwe/RunestoneServer
|
f555868521b3717beec0ec42dbcbcb443c64686c
|
[
"MIT"
] | null | null | null |
rsmanage/__init__.py
|
Kandongwe/RunestoneServer
|
f555868521b3717beec0ec42dbcbcb443c64686c
|
[
"MIT"
] | null | null | null |
# *********
# |docname|
# *********
# This is required by Poetry for `rsmanage.py` to be a script.
| 19.8
| 62
| 0.535354
| 13
| 99
| 4.076923
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.181818
| 99
| 4
| 63
| 24.75
| 0.654321
| 0.909091
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
5fc3fa7e2291a387816d425efb55a1d1bf29f1ac
| 88
|
py
|
Python
|
desafios/exe_001.py
|
jacaboyjr/pythonbirds
|
90be950f75514cf6c585e5cdb4d91b054fb98761
|
[
"MIT"
] | null | null | null |
desafios/exe_001.py
|
jacaboyjr/pythonbirds
|
90be950f75514cf6c585e5cdb4d91b054fb98761
|
[
"MIT"
] | null | null | null |
desafios/exe_001.py
|
jacaboyjr/pythonbirds
|
90be950f75514cf6c585e5cdb4d91b054fb98761
|
[
"MIT"
] | 1
|
2020-09-05T14:19:42.000Z
|
2020-09-05T14:19:42.000Z
|
nome = input('Digite o seu nome : ')
print(f'Senha bem Vindo {nome} ao mundo do Python')
| 44
| 51
| 0.693182
| 16
| 88
| 3.8125
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.170455
| 88
| 2
| 51
| 44
| 0.835616
| 0
| 0
| 0
| 0
| 0
| 0.685393
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 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
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
396a70238e8de31518ed7613abd05274cedb5ba1
| 151
|
py
|
Python
|
main.py
|
philipgold/demo-global-variables-between-files
|
919728a22850c145d2dc8a14d1269fbe2da04e6d
|
[
"MIT"
] | null | null | null |
main.py
|
philipgold/demo-global-variables-between-files
|
919728a22850c145d2dc8a14d1269fbe2da04e6d
|
[
"MIT"
] | null | null | null |
main.py
|
philipgold/demo-global-variables-between-files
|
919728a22850c145d2dc8a14d1269fbe2da04e6d
|
[
"MIT"
] | null | null | null |
import settings
import subfile
settings.init() # Call only once
subfile.stuff() # Do stuff with global var
print settings.myList[0] # Check the result
| 25.166667
| 43
| 0.774834
| 23
| 151
| 5.086957
| 0.782609
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.007752
| 0.145695
| 151
| 6
| 43
| 25.166667
| 0.899225
| 0.370861
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.4
| null | null | 0.2
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
396a832268dd9b37c65964b6d5caec6aa5300f45
| 223
|
py
|
Python
|
spotutil/utilities/newspot.py
|
wri/spotutil
|
6e74ce4586814b4eac868ef51c213e847c11ea13
|
[
"MIT"
] | 1
|
2018-12-05T16:19:53.000Z
|
2018-12-05T16:19:53.000Z
|
spotutil/utilities/newspot.py
|
wri/spotutil
|
6e74ce4586814b4eac868ef51c213e847c11ea13
|
[
"MIT"
] | null | null | null |
spotutil/utilities/newspot.py
|
wri/spotutil
|
6e74ce4586814b4eac868ef51c213e847c11ea13
|
[
"MIT"
] | 1
|
2020-12-15T18:50:33.000Z
|
2020-12-15T18:50:33.000Z
|
from spotutil.utilities import spot_instance
def newspot(instance_type, key_pair, price, disk_size, ami_id):
instance = spot_instance.Instance(instance_type, key_pair, price, disk_size, ami_id)
instance.start()
| 24.777778
| 88
| 0.780269
| 32
| 223
| 5.125
| 0.53125
| 0.146341
| 0.182927
| 0.231707
| 0.54878
| 0.54878
| 0.54878
| 0.54878
| 0.54878
| 0.54878
| 0
| 0
| 0.134529
| 223
| 8
| 89
| 27.875
| 0.849741
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0
| 0.5
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
396cf9cc09e710e1c2e9f1af5b07d31074e5ac50
| 159
|
py
|
Python
|
Lambda Functions/lamda-with-filter.py
|
manish1822510059/Python-1000-program
|
d03c1920fe63a7e32ac5bd9a13e2766d7a25756c
|
[
"Apache-2.0"
] | 1
|
2021-03-06T03:33:42.000Z
|
2021-03-06T03:33:42.000Z
|
Lambda Functions/lamda-with-filter.py
|
manish1822510059/Python-1000-programs
|
d03c1920fe63a7e32ac5bd9a13e2766d7a25756c
|
[
"Apache-2.0"
] | null | null | null |
Lambda Functions/lamda-with-filter.py
|
manish1822510059/Python-1000-programs
|
d03c1920fe63a7e32ac5bd9a13e2766d7a25756c
|
[
"Apache-2.0"
] | null | null | null |
number = [1,3,6,2,7,5,8,9,0]
result = filter(lambda x:x>5,number)
print("Number List",number)
print("Number Smaller than 5 in the list are:",list(result))
| 31.8
| 61
| 0.679245
| 32
| 159
| 3.375
| 0.65625
| 0.203704
| 0.314815
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.07971
| 0.132075
| 159
| 4
| 62
| 39.75
| 0.702899
| 0
| 0
| 0
| 0
| 0
| 0.316129
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.5
| 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
| 0
| 0
| 0
| 1
|
0
| 4
|
397023375d68cbad11cd6d0c9428f9184caaade2
| 11
|
py
|
Python
|
api.py
|
oxff644/detector
|
ca3a1ac39faf6b82995b2a311f05db74762cfde3
|
[
"MIT"
] | 6
|
2021-03-01T13:34:47.000Z
|
2022-03-02T13:58:44.000Z
|
api.py
|
oxff644/detector
|
ca3a1ac39faf6b82995b2a311f05db74762cfde3
|
[
"MIT"
] | null | null | null |
api.py
|
oxff644/detector
|
ca3a1ac39faf6b82995b2a311f05db74762cfde3
|
[
"MIT"
] | 3
|
2021-03-30T09:03:46.000Z
|
2022-03-02T18:14:31.000Z
|
# fast-api
| 5.5
| 10
| 0.636364
| 2
| 11
| 3.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.181818
| 11
| 1
| 11
| 11
| 0.777778
| 0.727273
| 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
|
399e0eb4c52bad899646ffaec412b5b6f17476dc
| 247
|
py
|
Python
|
001085StepikPythonIntrO/Stepik001085PythonIntrOсh01p06st01С01_20200410.py
|
SafonovMikhail/python_000577
|
739f764e80f1ca354386f00b8e9db1df8c96531d
|
[
"Apache-2.0"
] | null | null | null |
001085StepikPythonIntrO/Stepik001085PythonIntrOсh01p06st01С01_20200410.py
|
SafonovMikhail/python_000577
|
739f764e80f1ca354386f00b8e9db1df8c96531d
|
[
"Apache-2.0"
] | null | null | null |
001085StepikPythonIntrO/Stepik001085PythonIntrOсh01p06st01С01_20200410.py
|
SafonovMikhail/python_000577
|
739f764e80f1ca354386f00b8e9db1df8c96531d
|
[
"Apache-2.0"
] | null | null | null |
mypass = input()
if ("1234" or "qwerty" in mypass) or (len(mypass) < 8):
print("Bad password")
elif ("1" or "2" or "3" or "4" or "5" or "6" or "7" or "8" or "9" or "0") not in mypass:
print("Bad password")
else:
print("Good password")
| 30.875
| 88
| 0.57085
| 45
| 247
| 3.133333
| 0.555556
| 0.113475
| 0.22695
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.078125
| 0.222672
| 247
| 7
| 89
| 35.285714
| 0.65625
| 0
| 0
| 0.285714
| 0
| 0
| 0.230769
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.857143
| 0
| 0
| 0
| 0.428571
| 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
| 1
| 0
| 0
| 0
| 1
|
0
| 4
|
39b5c14c9562374806c07540aab5b8f9e68390bc
| 2,624
|
py
|
Python
|
mtconnect/standard_list.py
|
Badzi007/MTConnect-Python-Agent
|
43d84c4d8c50cebdbde1976a0c9828ab49920a61
|
[
"Apache-2.0"
] | 1
|
2021-02-08T16:02:06.000Z
|
2021-02-08T16:02:06.000Z
|
mtconnect/standard_list.py
|
Badzi007/MTConnect-Python-Agent
|
43d84c4d8c50cebdbde1976a0c9828ab49920a61
|
[
"Apache-2.0"
] | 1
|
2021-02-04T15:37:05.000Z
|
2021-02-04T15:37:05.000Z
|
mtconnect/standard_list.py
|
Badzi007/MTConnect-Python-Agent
|
43d84c4d8c50cebdbde1976a0c9828ab49920a61
|
[
"Apache-2.0"
] | 2
|
2022-02-28T13:30:49.000Z
|
2022-03-21T05:51:49.000Z
|
MTC_DataID_list = ['ACTUATOR','CHUCK_INTERLOCK','COMMUNICATIONS','DATA_RANGE','DIRECTION','END_OF_BAR','HARDWARE','INTERFACE_STATE','LOGIC_PROGRAM','MOTION_PROGRAM','SYSTEM','ACCELERATION','ACCUMULATED_TIME','ANGULAR_ACCELERATION','ANGULAR_VELOCITY','AMPERAGE','ALTERNATING','DIRECT','ACTUAL','TARGET','ANGLE','ACTUAL','COMMANDED','AXIS_FEEDRATE','ACTUAL','COMMANDED','JOG','PROGRAMMED','RAPID','OVERRIDE','CLOCK_TIME','CONCENTRATION','CONDUCTIVITY','DISPLACEMENT','ELECTRICAL_ENERGY','EQUIPMENT_TIMER','LOADED','WORKING','OPERATING','POWERED','DELAY','FILL_LEVEL','FLOW','FREQUENCY','LENGTH','STANDARD','REMAINING','USEABLE','LINEAR_FORCE','LOAD','MASS','PATH_FEEDRATE','ACTUAL','COMMANDED','JOG','PROGRAMMED','RAPID','OVERRIDE','PATH_POSITION','ACTUAL','COMMANDED','TARGET','PROBE','PH','POSITION','ACTUAL','COMMANDED','PROGRAMMED','TARGET','POWER_FACTOR','PRESSURE','PROCESS_TIMER','PROCESS','DELAY','RESISTANCE','ROTARY_VELOCITY','ACTUAL','COMMANDED','PROGRAMMED','OVERRIDE','SOUND_LEVEL','NO_SCALE','A_SCALE','B_SCALE','C_SCALE','D_SCALE','SPINDLE_SPEED','ACTUAL','COMMANDED','OVERRIDE','STRAIN','TEMPERATURE','TENSION','TILT','TORQUE','VOLT_AMPERE','VOLT_AMPERE_REACTIVE','VELOCITY','VISCOSITY','VOLTAGE','ALTERNATING','DIRECT','ACTUAL','TARGET','WATTAGE','ACTUAL','TARGET','ACTUATOR_STATE','ALARM','ACTIVE_AXES','','','AVAILABILITY','AXIS_COUPLING','','','AXIS_FEEDRATE_OVERRIDE','JOG','PROGRAMMED','RAPID','AXIS_INTERLOCK','AXIS_STATE','BLOCK','BLOCK_COUNT','CHUCK_INTERLOCK','MANUAL_UNCLAMP','CHUCK_STATE','CODE','COMPOSITION_STATE','ACTION','LATERAL','MOTION','SWITCHED','VERTICAL','CONTROLLER_MODE','CONTROLLER_MODE_OVERRIDE','DRY_RUN','SINGLE_BLOCK','MACHINE_AXIS_LOCK','OPTIONAL_STOP','TOOL_CHANGE_STOP','COUPLED_AXES','DIRECTION','ROTARY','LINEAR','DOOR_STATE','END_OF_BAR','PRIMARY','AUXILIARY','EMERGENCY_STOP','EQUIPMENT_MODE','LOADED','WORKING','OPERATING','POWERED','DELAY','EXECUTION','FUNCTIONAL_MODE','HARDNESS','ROCKWELL','VICKERS','SHORE','BRINELL','LEEB','MOHS','INTERFACE_STATE','LINE','MAXIMUM','MINIMUM','LINE_LABEL','LINE_NUMBER','ABSOLUTE','INCREMENTAL','MATERIAL','MESSAGE','OPERATOR_ID','PALLET_ID','PART_COUNT','ALL','GOOD','BAD','TARGET','REMAINING','PART_ID','PART_NUMBER','PATH_FEEDRATE_OVERRIDE','JOG','PROGRAMMED','RAPID','PATH_MODE','POWER_STATE','','','LINE','CONTROL','POWER_STATUS','PROGRAM','PROGRAM_EDIT','PROGRAM_EDIT_NAME','PROGRAM_COMMENT','PROGRAM_HEADER','ROTARY_MODE','ROTARY_VELOCITY_OVERRIDE','SERIAL_NUMBER','SPINDLE_INTERLOCK','TOOL_ASSET_ID','TOOL_NUMBER','TOOL_OFFSET','RADIAL','LENGTH','USER','OPERATOR','MAINTENANCE','SET_UP','WIRE','WORKHOLDING_ID','WORK_OFFSET']
| 1,312
| 2,622
| 0.749619
| 304
| 2,624
| 6.167763
| 0.546053
| 0.056
| 0.0384
| 0.030933
| 0.1248
| 0.052267
| 0.052267
| 0
| 0
| 0
| 0
| 0
| 0.001524
| 2,624
| 2
| 2,622
| 1,312
| 0.715649
| 0
| 0
| 0
| 0
| 0
| 0.744186
| 0.035074
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
39ecf72dfe73c064a4f8a15c53def0b0f510e61e
| 1,938
|
py
|
Python
|
test/test_media_api.py
|
CrowdEmotion/crowdemotion-api-client-python
|
b5ec57030e36d2b2c32cc5a43b804d7a34401c16
|
[
"Apache-2.0"
] | 1
|
2018-06-14T05:12:54.000Z
|
2018-06-14T05:12:54.000Z
|
test/test_media_api.py
|
CrowdEmotion/crowdemotion-api-client-python
|
b5ec57030e36d2b2c32cc5a43b804d7a34401c16
|
[
"Apache-2.0"
] | null | null | null |
test/test_media_api.py
|
CrowdEmotion/crowdemotion-api-client-python
|
b5ec57030e36d2b2c32cc5a43b804d7a34401c16
|
[
"Apache-2.0"
] | null | null | null |
# coding: utf-8
"""
CloudEmotion API v1
CrowdEmotion API
OpenAPI spec version: 1.1.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
from __future__ import absolute_import
import os
import sys
import unittest
import crowdemotion_api_client_python
from crowdemotion_api_client_python.rest import ApiException
from crowdemotion_api_client_python.apis.media_api import MediaApi
class TestMediaApi(unittest.TestCase):
""" MediaApi unit test stubs """
def setUp(self):
self.api = crowdemotion_api_client_python.apis.media_api.MediaApi()
def tearDown(self):
pass
def test_media_get(self):
"""
Test case for media_get
Find all registered Media
"""
pass
def test_media_media_id_delete(self):
"""
Test case for media_media_id_delete
Delete Media
"""
pass
def test_media_media_id_get(self):
"""
Test case for media_media_id_get
Find a Media
"""
pass
def test_media_media_id_put(self):
"""
Test case for media_media_id_put
Update a Media
"""
pass
def test_media_post(self):
"""
Test case for media_post
Create new Media
"""
pass
if __name__ == '__main__':
unittest.main()
| 22.022727
| 76
| 0.659959
| 256
| 1,938
| 4.785156
| 0.453125
| 0.04898
| 0.058776
| 0.065306
| 0.283265
| 0.238367
| 0.198367
| 0
| 0
| 0
| 0
| 0.00641
| 0.275542
| 1,938
| 87
| 77
| 22.275862
| 0.866097
| 0.484004
| 0
| 0.25
| 1
| 0
| 0.010323
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.291667
| false
| 0.25
| 0.291667
| 0
| 0.625
| 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
| 1
| 0
| 0
| 1
| 0
|
0
| 4
|
f2f2e9bc1828e129787a954b213cecf4f57baf29
| 87
|
py
|
Python
|
nntts/models/__init__.py
|
entn-at/efficient_tts
|
5e6ea55d0c9694f7e30eecb5048976088f1a3c66
|
[
"MIT"
] | 111
|
2020-12-12T09:14:45.000Z
|
2022-03-31T07:44:09.000Z
|
nntts/models/__init__.py
|
entn-at/efficient_tts
|
5e6ea55d0c9694f7e30eecb5048976088f1a3c66
|
[
"MIT"
] | 13
|
2020-12-13T06:34:17.000Z
|
2021-11-10T09:29:52.000Z
|
nntts/models/__init__.py
|
entn-at/efficient_tts
|
5e6ea55d0c9694f7e30eecb5048976088f1a3c66
|
[
"MIT"
] | 20
|
2020-12-12T15:47:52.000Z
|
2022-03-31T03:22:13.000Z
|
from .efficient_tts import EfficientTTSCNN
from .duration_model import DurationModel
| 29
| 43
| 0.862069
| 10
| 87
| 7.3
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.114943
| 87
| 2
| 44
| 43.5
| 0.948052
| 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
|
840beaf082639afd1f3606fd6ec6c3a661146cef
| 91
|
py
|
Python
|
pizzeriaproj/pizzeria/apps.py
|
generocha/pizzeria
|
9076d45e3ffc01ba93a7f6854db39b1005de090e
|
[
"MIT"
] | null | null | null |
pizzeriaproj/pizzeria/apps.py
|
generocha/pizzeria
|
9076d45e3ffc01ba93a7f6854db39b1005de090e
|
[
"MIT"
] | null | null | null |
pizzeriaproj/pizzeria/apps.py
|
generocha/pizzeria
|
9076d45e3ffc01ba93a7f6854db39b1005de090e
|
[
"MIT"
] | null | null | null |
from django.apps import AppConfig
class PizzeriaConfig(AppConfig):
name = 'pizzeria'
| 15.166667
| 33
| 0.758242
| 10
| 91
| 6.9
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.164835
| 91
| 5
| 34
| 18.2
| 0.907895
| 0
| 0
| 0
| 0
| 0
| 0.087912
| 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
|
84352dba4dd9dc569cba045b10d8498dbef4e6ff
| 87
|
py
|
Python
|
chime/cogs/__init__.py
|
realmayus/chime
|
a9ad4c6e6d02ed99d45b94b6cf8ca0694ef3b6fc
|
[
"MIT"
] | 3
|
2020-06-06T11:57:36.000Z
|
2020-06-19T09:51:56.000Z
|
chime/cogs/__init__.py
|
realmayus/chime
|
a9ad4c6e6d02ed99d45b94b6cf8ca0694ef3b6fc
|
[
"MIT"
] | 4
|
2020-06-19T09:42:31.000Z
|
2020-11-08T13:10:10.000Z
|
chime/cogs/__init__.py
|
realmayus/chime
|
a9ad4c6e6d02ed99d45b94b6cf8ca0694ef3b6fc
|
[
"MIT"
] | 1
|
2020-06-30T10:41:55.000Z
|
2020-06-30T10:41:55.000Z
|
"""All the cogs that chime features. All of them interact directly with discord.py."""
| 43.5
| 86
| 0.747126
| 14
| 87
| 4.642857
| 0.928571
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.149425
| 87
| 1
| 87
| 87
| 0.878378
| 0.91954
| 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
|
845cf52003a95601241ce86de56978e65c24ce33
| 113
|
py
|
Python
|
slurry/environments/__init__.py
|
andersea/gasio
|
cc772b2611ac96c307ebc2520471eca32974987e
|
[
"MIT"
] | 11
|
2020-08-16T18:10:35.000Z
|
2022-01-27T15:03:09.000Z
|
slurry/environments/__init__.py
|
andersea/gasio
|
cc772b2611ac96c307ebc2520471eca32974987e
|
[
"MIT"
] | 1
|
2020-12-27T20:00:21.000Z
|
2021-08-05T19:46:58.000Z
|
slurry/environments/__init__.py
|
andersea/gasio
|
cc772b2611ac96c307ebc2520471eca32974987e
|
[
"MIT"
] | 3
|
2021-01-17T01:15:08.000Z
|
2021-05-13T05:42:24.000Z
|
from ._trio import TrioSection
from ._threading import ThreadSection
from ._multiprocessing import ProcessSection
| 37.666667
| 44
| 0.876106
| 12
| 113
| 8
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.097345
| 113
| 3
| 44
| 37.666667
| 0.941176
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
84650a64f53bc2af5654b5c41d0f17bd1e1d4168
| 261
|
py
|
Python
|
OpenGLCffi/GLES3/EXT/EXT/draw_transform_feedback.py
|
cydenix/OpenGLCffi
|
c78f51ae5e6b655eb2ea98f072771cf69e2197f3
|
[
"MIT"
] | null | null | null |
OpenGLCffi/GLES3/EXT/EXT/draw_transform_feedback.py
|
cydenix/OpenGLCffi
|
c78f51ae5e6b655eb2ea98f072771cf69e2197f3
|
[
"MIT"
] | null | null | null |
OpenGLCffi/GLES3/EXT/EXT/draw_transform_feedback.py
|
cydenix/OpenGLCffi
|
c78f51ae5e6b655eb2ea98f072771cf69e2197f3
|
[
"MIT"
] | null | null | null |
from OpenGLCffi.GLES3 import params
@params(api='gles3', prms=['mode', 'id'])
def glDrawTransformFeedbackEXT(mode, id):
pass
@params(api='gles3', prms=['mode', 'id', 'instancecount'])
def glDrawTransformFeedbackInstancedEXT(mode, id, instancecount):
pass
| 21.75
| 65
| 0.735632
| 29
| 261
| 6.62069
| 0.482759
| 0.125
| 0.145833
| 0.1875
| 0.25
| 0.25
| 0
| 0
| 0
| 0
| 0
| 0.012766
| 0.099617
| 261
| 11
| 66
| 23.727273
| 0.804255
| 0
| 0
| 0.285714
| 0
| 0
| 0.135135
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0.285714
| 0.142857
| 0
| 0.428571
| 0
| 1
| 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
| 0
| 0
| 0
|
0
| 4
|
ffe46d375ab70f7bc12925a9d6afe4f9d279f423
| 133
|
py
|
Python
|
rover/controls-systems/mobility/GNSS/usb0ip.py
|
CSUFTitanRover/TitanRover2018
|
4926d377322a37ba644d7e852faa305fb8bb9b55
|
[
"Apache-2.0"
] | 16
|
2017-09-01T23:33:17.000Z
|
2021-01-04T02:41:19.000Z
|
rover/controls-systems/mobility/GNSS/usb0ip.py
|
WesleyBaxter/TitanRover2018
|
be69fa908ed0cbb1f4fe4708d0394881b3a4b105
|
[
"Apache-2.0"
] | 56
|
2017-08-30T01:14:46.000Z
|
2021-02-28T22:18:44.000Z
|
rover/controls-systems/mobility/GNSS/usb0ip.py
|
WesleyBaxter/TitanRover2018
|
be69fa908ed0cbb1f4fe4708d0394881b3a4b105
|
[
"Apache-2.0"
] | 15
|
2017-09-14T19:55:55.000Z
|
2020-05-03T19:44:39.000Z
|
from subprocess import Popen
from time import sleep
while True:
Popen(["ifconfig", "usb0", "192.168.2.2"])
sleep(5)
| 19
| 50
| 0.631579
| 19
| 133
| 4.421053
| 0.736842
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.098039
| 0.233083
| 133
| 7
| 51
| 19
| 0.72549
| 0
| 0
| 0
| 0
| 0
| 0.171642
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.4
| 0
| 0.4
| 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
|
0833cb16bacc83a912b0c97443f36b08e05758a2
| 294
|
py
|
Python
|
src/forms.py
|
jorzel/quotes-storage
|
e2b42e07d2fbf2db7c375865f06a277f15a17dd9
|
[
"MIT"
] | null | null | null |
src/forms.py
|
jorzel/quotes-storage
|
e2b42e07d2fbf2db7c375865f06a277f15a17dd9
|
[
"MIT"
] | null | null | null |
src/forms.py
|
jorzel/quotes-storage
|
e2b42e07d2fbf2db7c375865f06a277f15a17dd9
|
[
"MIT"
] | null | null | null |
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField
from wtforms.validators import DataRequired
class BookForm(FlaskForm):
title = StringField(validators=[DataRequired()])
author = StringField(validators=[DataRequired()])
submit = SubmitField('Add book')
| 29.4
| 53
| 0.778912
| 30
| 294
| 7.6
| 0.566667
| 0.096491
| 0.289474
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.132653
| 294
| 9
| 54
| 32.666667
| 0.894118
| 0
| 0
| 0
| 0
| 0
| 0.027211
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.428571
| 0
| 1
| 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
|
f24b40ecd7bca194626e1f3db4f36a88bc8c7ca2
| 130
|
py
|
Python
|
kwat/array/check_sorted.py
|
KwatME/ccal
|
d96dfa811482eee067f346386a2181ec514625f4
|
[
"MIT"
] | 5
|
2017-05-05T17:50:28.000Z
|
2019-01-30T19:23:02.000Z
|
kwat/array/check_sorted.py
|
KwatME/ccal
|
d96dfa811482eee067f346386a2181ec514625f4
|
[
"MIT"
] | 5
|
2017-05-05T01:52:31.000Z
|
2019-04-20T21:06:05.000Z
|
kwat/array/check_sorted.py
|
KwatME/ccal
|
d96dfa811482eee067f346386a2181ec514625f4
|
[
"MIT"
] | 5
|
2017-07-17T18:55:54.000Z
|
2019-02-02T04:46:19.000Z
|
from numpy import diff
def check_sorted(nu___):
di_ = diff(nu___.ravel())
return (di_ <= 0).all() or (0 <= di_).all()
| 14.444444
| 47
| 0.6
| 20
| 130
| 3.4
| 0.7
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.019802
| 0.223077
| 130
| 8
| 48
| 16.25
| 0.653465
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 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
|
f26405c56e122a934109bdf5f9d060e003308ffe
| 302
|
py
|
Python
|
pyaz/batch/location/quotas/__init__.py
|
py-az-cli/py-az-cli
|
9a7dc44e360c096a5a2f15595353e9dad88a9792
|
[
"MIT"
] | null | null | null |
pyaz/batch/location/quotas/__init__.py
|
py-az-cli/py-az-cli
|
9a7dc44e360c096a5a2f15595353e9dad88a9792
|
[
"MIT"
] | null | null | null |
pyaz/batch/location/quotas/__init__.py
|
py-az-cli/py-az-cli
|
9a7dc44e360c096a5a2f15595353e9dad88a9792
|
[
"MIT"
] | 1
|
2022-02-03T09:12:01.000Z
|
2022-02-03T09:12:01.000Z
|
'''
Manage Batch service quotas at the region level.
'''
from .... pyaz_utils import _call_az
def show(location):
'''
Required Parameters:
- location -- The region for which to display the Batch service quotas.
'''
return _call_az("az batch location quotas show", locals())
| 20.133333
| 75
| 0.665563
| 39
| 302
| 5.025641
| 0.641026
| 0.122449
| 0.183673
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.228477
| 302
| 14
| 76
| 21.571429
| 0.841202
| 0.466887
| 0
| 0
| 0
| 0
| 0.228346
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.333333
| 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
| 1
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
f27a0fc9e6e0539e75de96d840e99ddf1ddffd8a
| 4,096
|
py
|
Python
|
S4/S4 Library/generated/protocolbuffers/PersistenceBlobs_pb2.py
|
NeonOcean/Environment
|
ca658cf66e8fd6866c22a4a0136d415705b36d26
|
[
"CC-BY-4.0"
] | 1
|
2021-05-20T19:33:37.000Z
|
2021-05-20T19:33:37.000Z
|
S4/S4 Library/generated/protocolbuffers/PersistenceBlobs_pb2.py
|
NeonOcean/Environment
|
ca658cf66e8fd6866c22a4a0136d415705b36d26
|
[
"CC-BY-4.0"
] | null | null | null |
S4/S4 Library/generated/protocolbuffers/PersistenceBlobs_pb2.py
|
NeonOcean/Environment
|
ca658cf66e8fd6866c22a4a0136d415705b36d26
|
[
"CC-BY-4.0"
] | null | null | null |
from google.protobuf import descriptor
from google.protobuf import message
from google.protobuf import reflection
from google.protobuf import descriptor_pb2
import protocolbuffers.Consts_pb2 as Consts_pb2
import protocolbuffers.S4Common_pb2 as S4Common_pb2
DESCRIPTOR = descriptor.FileDescriptor(name='PersistenceBlobs.proto', package='EA.Sims4.Persistence', serialized_pb='\n\x16PersistenceBlobs.proto\x12\x14EA.Sims4.Persistence\x1a\x0cConsts.proto\x1a\x0eS4Common.proto"\x8c\x02\n\x1eBlobSimFacialCustomizationData\x12\x13\n\x07sculpts\x18\x01 \x03(\x04B\x02\x10\x01\x12U\n\x0eface_modifiers\x18\x02 \x03(\x0b2=.EA.Sims4.Persistence.BlobSimFacialCustomizationData.Modifier\x12U\n\x0ebody_modifiers\x18\x03 \x03(\x0b2=.EA.Sims4.Persistence.BlobSimFacialCustomizationData.Modifier\x1a\'\n\x08Modifier\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12\x0e\n\x06amount\x18\x02 \x01(\x02')
_BLOBSIMFACIALCUSTOMIZATIONDATA_MODIFIER = descriptor.Descriptor(name='Modifier', full_name='EA.Sims4.Persistence.BlobSimFacialCustomizationData.Modifier', filename=None, file=DESCRIPTOR, containing_type=None, fields=[descriptor.FieldDescriptor(name='key', full_name='EA.Sims4.Persistence.BlobSimFacialCustomizationData.Modifier.key', index=0, number=1, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), descriptor.FieldDescriptor(name='amount', full_name='EA.Sims4.Persistence.BlobSimFacialCustomizationData.Modifier.amount', index=1, number=2, type=2, cpp_type=6, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None)], extensions=[], nested_types=[], enum_types=[], options=None, is_extendable=False, extension_ranges=[], serialized_start=308, serialized_end=347)
_BLOBSIMFACIALCUSTOMIZATIONDATA = descriptor.Descriptor(name='BlobSimFacialCustomizationData', full_name='EA.Sims4.Persistence.BlobSimFacialCustomizationData', filename=None, file=DESCRIPTOR, containing_type=None, fields=[descriptor.FieldDescriptor(name='sculpts', full_name='EA.Sims4.Persistence.BlobSimFacialCustomizationData.sculpts', index=0, number=1, type=4, cpp_type=4, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=descriptor._ParseOptions(descriptor_pb2.FieldOptions(), '\x10\x01')), descriptor.FieldDescriptor(name='face_modifiers', full_name='EA.Sims4.Persistence.BlobSimFacialCustomizationData.face_modifiers', index=1, number=2, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), descriptor.FieldDescriptor(name='body_modifiers', full_name='EA.Sims4.Persistence.BlobSimFacialCustomizationData.body_modifiers', index=2, number=3, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None)], extensions=[], nested_types=[_BLOBSIMFACIALCUSTOMIZATIONDATA_MODIFIER], enum_types=[], options=None, is_extendable=False, extension_ranges=[], serialized_start=79, serialized_end=347)
_BLOBSIMFACIALCUSTOMIZATIONDATA_MODIFIER.containing_type = _BLOBSIMFACIALCUSTOMIZATIONDATA
_BLOBSIMFACIALCUSTOMIZATIONDATA.fields_by_name['face_modifiers'].message_type = _BLOBSIMFACIALCUSTOMIZATIONDATA_MODIFIER
_BLOBSIMFACIALCUSTOMIZATIONDATA.fields_by_name['body_modifiers'].message_type = _BLOBSIMFACIALCUSTOMIZATIONDATA_MODIFIER
DESCRIPTOR.message_types_by_name['BlobSimFacialCustomizationData'] = _BLOBSIMFACIALCUSTOMIZATIONDATA
class BlobSimFacialCustomizationData(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
class Modifier(message.Message, metaclass=reflection.GeneratedProtocolMessageType):
DESCRIPTOR = _BLOBSIMFACIALCUSTOMIZATIONDATA_MODIFIER
DESCRIPTOR = _BLOBSIMFACIALCUSTOMIZATIONDATA
| 195.047619
| 1,464
| 0.842529
| 488
| 4,096
| 6.846311
| 0.209016
| 0.040706
| 0.053876
| 0.129303
| 0.601018
| 0.500449
| 0.466926
| 0.332834
| 0.332834
| 0.332834
| 0
| 0.038589
| 0.044678
| 4,096
| 20
| 1,465
| 204.8
| 0.815231
| 0
| 0
| 0
| 0
| 0.470588
| 0.252686
| 0.225586
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.352941
| 0
| 0.529412
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
f2a559434c4bcb4195911136173049b18499c350
| 78
|
py
|
Python
|
configs/mmcls/classification_onnxruntime_dynamic.py
|
aegis-rider/mmdeploy
|
230596bad92fafadb36cf0a69c57d80522cc7c60
|
[
"Apache-2.0"
] | 746
|
2021-12-27T10:50:28.000Z
|
2022-03-31T13:34:14.000Z
|
configs/mmcls/classification_onnxruntime_dynamic.py
|
aegis-rider/mmdeploy
|
230596bad92fafadb36cf0a69c57d80522cc7c60
|
[
"Apache-2.0"
] | 253
|
2021-12-28T05:59:13.000Z
|
2022-03-31T18:22:25.000Z
|
configs/mmcls/classification_onnxruntime_dynamic.py
|
aegis-rider/mmdeploy
|
230596bad92fafadb36cf0a69c57d80522cc7c60
|
[
"Apache-2.0"
] | 147
|
2021-12-27T10:50:33.000Z
|
2022-03-30T10:44:20.000Z
|
_base_ = ['./classification_dynamic.py', '../_base_/backends/onnxruntime.py']
| 39
| 77
| 0.730769
| 8
| 78
| 6.5
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.051282
| 78
| 1
| 78
| 78
| 0.702703
| 0
| 0
| 0
| 0
| 0
| 0.769231
| 0.769231
| 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
|
f2ac5517981b43d9b4eb5eb57a93ec2a3869ee66
| 366
|
py
|
Python
|
django/src/views.py
|
cloudsweb/square
|
5ad0b50abc182253789ccd9ae5fb6ebd19234adf
|
[
"MIT"
] | null | null | null |
django/src/views.py
|
cloudsweb/square
|
5ad0b50abc182253789ccd9ae5fb6ebd19234adf
|
[
"MIT"
] | null | null | null |
django/src/views.py
|
cloudsweb/square
|
5ad0b50abc182253789ccd9ae5fb6ebd19234adf
|
[
"MIT"
] | null | null | null |
from django.shortcuts import render
from django.http import HttpRequest, HttpResponse
# Create your views here.
def index(request: HttpRequest):
return HttpResponse("Hello, world. You're at the index.")
def create_user(request: HttpRequest):
if request.method != 'POST':
return HttpResponse("method not supported", status=405)
# TODO: parse request.body
| 30.5
| 59
| 0.759563
| 48
| 366
| 5.770833
| 0.6875
| 0.072202
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.009554
| 0.142077
| 366
| 11
| 60
| 33.272727
| 0.872611
| 0.131148
| 0
| 0
| 0
| 0
| 0.184127
| 0
| 0
| 0
| 0
| 0.090909
| 0
| 1
| 0.285714
| false
| 0
| 0.285714
| 0.142857
| 0.857143
| 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
|
4b37897dc4c08744bd985fc093cc3859f7f067f4
| 141
|
py
|
Python
|
py_moysklad/entities/context.py
|
upmarket-cc/py_moysklad
|
e026e611344c38f8a8d4f428781fcfb315aaaa60
|
[
"MIT"
] | null | null | null |
py_moysklad/entities/context.py
|
upmarket-cc/py_moysklad
|
e026e611344c38f8a8d4f428781fcfb315aaaa60
|
[
"MIT"
] | null | null | null |
py_moysklad/entities/context.py
|
upmarket-cc/py_moysklad
|
e026e611344c38f8a8d4f428781fcfb315aaaa60
|
[
"MIT"
] | null | null | null |
from pydantic import BaseModel
from py_moysklad.entities.agents.employee import Employee
class Context(BaseModel):
employee: Employee
| 17.625
| 57
| 0.815603
| 17
| 141
| 6.705882
| 0.647059
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.134752
| 141
| 7
| 58
| 20.142857
| 0.934426
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 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
|
4b4443e4c41e8f31860e575ad803d3a426bda51a
| 71
|
py
|
Python
|
tests/__init__.py
|
danielegts/gcalendar2trello
|
0237441652b44686e824346b70822bd6784327ce
|
[
"Apache-2.0"
] | null | null | null |
tests/__init__.py
|
danielegts/gcalendar2trello
|
0237441652b44686e824346b70822bd6784327ce
|
[
"Apache-2.0"
] | null | null | null |
tests/__init__.py
|
danielegts/gcalendar2trello
|
0237441652b44686e824346b70822bd6784327ce
|
[
"Apache-2.0"
] | null | null | null |
# -*- coding: utf-8 -*-
"""Unit test package for gcalendar2trello."""
| 17.75
| 45
| 0.619718
| 8
| 71
| 5.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.033333
| 0.15493
| 71
| 3
| 46
| 23.666667
| 0.7
| 0.873239
| 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
|
4b657e003bafddd061607a94d37a959fd863cf5e
| 80
|
py
|
Python
|
src/tests/__init__.py
|
bspeagle/py_git_diff
|
1674afc1dfac0408372e11945f4a36b297b77e66
|
[
"MIT"
] | null | null | null |
src/tests/__init__.py
|
bspeagle/py_git_diff
|
1674afc1dfac0408372e11945f4a36b297b77e66
|
[
"MIT"
] | null | null | null |
src/tests/__init__.py
|
bspeagle/py_git_diff
|
1674afc1dfac0408372e11945f4a36b297b77e66
|
[
"MIT"
] | null | null | null |
"""
Init stuff.
"""
import helpers.startup as Startup
Startup.load_env_vars()
| 10
| 33
| 0.725
| 11
| 80
| 5.090909
| 0.818182
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.1375
| 80
| 7
| 34
| 11.428571
| 0.811594
| 0.1375
| 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
|
4b6592c28b4eb3f74c0ba0bc03e83ecaba525e29
| 87
|
py
|
Python
|
packages/server/invites/src/domain/entities/values/__init__.py
|
gbartoczevicz/moosic
|
003ff5cff628505093cc08ad0fbd273272172a51
|
[
"MIT"
] | 3
|
2021-09-30T00:41:31.000Z
|
2022-03-15T00:14:23.000Z
|
packages/server/invites/src/domain/entities/values/__init__.py
|
gbartoczevicz/moosic
|
003ff5cff628505093cc08ad0fbd273272172a51
|
[
"MIT"
] | 13
|
2021-09-20T22:29:52.000Z
|
2021-12-05T01:59:34.000Z
|
packages/server/invites/src/domain/entities/values/__init__.py
|
gabrielbartoczevicz/moosic
|
003ff5cff628505093cc08ad0fbd273272172a51
|
[
"MIT"
] | 1
|
2021-11-10T22:11:55.000Z
|
2021-11-10T22:11:55.000Z
|
from .comment import Comment
from .location import Location
from .rating import Rating
| 21.75
| 30
| 0.827586
| 12
| 87
| 6
| 0.416667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.137931
| 87
| 3
| 31
| 29
| 0.96
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
4b6e0ac9edf12eccc34065d1fc1b9cf36ac8a4e5
| 98
|
py
|
Python
|
DDM/solver/__init__.py
|
anonymrelease/VQ-DDM
|
ddda1127398b217373104d8e2913549e87f585d4
|
[
"MIT"
] | null | null | null |
DDM/solver/__init__.py
|
anonymrelease/VQ-DDM
|
ddda1127398b217373104d8e2913549e87f585d4
|
[
"MIT"
] | null | null | null |
DDM/solver/__init__.py
|
anonymrelease/VQ-DDM
|
ddda1127398b217373104d8e2913549e87f585d4
|
[
"MIT"
] | 2
|
2022-02-01T07:43:09.000Z
|
2022-02-27T12:02:09.000Z
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on: 2021/07/10 12:48
@Author: Merc2
'''
| 14
| 28
| 0.581633
| 16
| 98
| 3.5625
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.168675
| 0.153061
| 98
| 6
| 29
| 16.333333
| 0.518072
| 0.877551
| 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
|
4b9c2c64908d6248c0740ca58c20d1f7200bd0d0
| 21,935
|
py
|
Python
|
tests/alerts_test.py
|
jsonar/elastalert
|
1317f13bf8ed957121d88a7d013ebf53a6be6d72
|
[
"Apache-2.0"
] | 1
|
2020-11-17T13:35:56.000Z
|
2020-11-17T13:35:56.000Z
|
tests/alerts_test.py
|
jsonar/elastalert
|
1317f13bf8ed957121d88a7d013ebf53a6be6d72
|
[
"Apache-2.0"
] | 3
|
2018-11-16T00:21:03.000Z
|
2019-02-08T20:31:38.000Z
|
tests/alerts_test.py
|
jsonar/elastalert
|
1317f13bf8ed957121d88a7d013ebf53a6be6d72
|
[
"Apache-2.0"
] | 1
|
2021-12-08T10:27:37.000Z
|
2021-12-08T10:27:37.000Z
|
# -*- coding: utf-8 -*-
import datetime
import json
import mock
import pytest
from elastalert.alerts import Alerter
from elastalert.alerts import BasicMatchString
from elastalert.alerts import EmailAlerter
from elastalert.opsgenie import OpsGenieAlerter
from elastalert.util import ts_add
class mock_rule:
def get_match_str(self, event):
return str(event)
def test_basic_match_string(ea):
ea.rules[0]['top_count_keys'] = ['username']
match = {'@timestamp': '1918-01-17', 'field': 'value', 'top_events_username': {'bob': 10, 'mallory': 5}}
alert_text = unicode(BasicMatchString(ea.rules[0], match))
assert 'anytest' in alert_text
assert 'some stuff happened' in alert_text
assert 'username' in alert_text
assert 'bob: 10' in alert_text
assert 'field: value' in alert_text
# Non serializable objects don't cause errors
match['non-serializable'] = {open: 10}
alert_text = unicode(BasicMatchString(ea.rules[0], match))
# unicode objects dont cause errors
match['snowman'] = u'☃'
alert_text = unicode(BasicMatchString(ea.rules[0], match))
# Pretty printed objects
match.pop('non-serializable')
match['object'] = {'this': {'that': [1, 2, "3"]}}
alert_text = unicode(BasicMatchString(ea.rules[0], match))
assert '"this": {\n "that": [\n 1, \n 2, \n "3"\n ]\n }' in alert_text
ea.rules[0]['alert_text'] = 'custom text'
alert_text = unicode(BasicMatchString(ea.rules[0], match))
assert 'custom text' in alert_text
assert 'anytest' not in alert_text
ea.rules[0]['alert_text_type'] = 'alert_text_only'
alert_text = unicode(BasicMatchString(ea.rules[0], match))
assert 'custom text' in alert_text
assert 'some stuff happened' not in alert_text
assert 'username' not in alert_text
assert 'field: value' not in alert_text
ea.rules[0]['alert_text_type'] = 'exclude_fields'
alert_text = unicode(BasicMatchString(ea.rules[0], match))
assert 'custom text' in alert_text
assert 'some stuff happened' in alert_text
assert 'username' in alert_text
assert 'field: value' not in alert_text
def test_email():
rule = {'name': 'test alert', 'email': ['testing@test.test', 'test@test.test'], 'from_addr': 'testfrom@test.test',
'type': mock_rule(), 'timestamp_field': '@timestamp', 'email_reply_to': 'test@example.com', 'owner': 'owner_value',
'alert_subject': 'Test alert for {0}, owned by {1}', 'alert_subject_args': ['test_term', 'owner'], 'snowman': u'☃'}
with mock.patch('elastalert.alerts.SMTP') as mock_smtp:
mock_smtp.return_value = mock.Mock()
alert = EmailAlerter(rule)
alert.alert([{'test_term': 'test_value'}])
expected = [mock.call('localhost'),
mock.call().ehlo(),
mock.call().has_extn('STARTTLS'),
mock.call().starttls(certfile=None, keyfile=None),
mock.call().sendmail(mock.ANY, ['testing@test.test', 'test@test.test'], mock.ANY),
mock.call().close()]
assert mock_smtp.mock_calls == expected
body = mock_smtp.mock_calls[4][1][2]
assert 'Reply-To: test@example.com' in body
assert 'To: testing@test.test' in body
assert 'From: testfrom@test.test' in body
assert 'Subject: Test alert for test_value, owned by owner_value' in body
def test_email_from_field():
rule = {'name': 'test alert', 'email': ['testing@test.test'], 'email_add_domain': 'example.com',
'type': mock_rule(), 'timestamp_field': '@timestamp', 'email_from_field': 'data.user', 'owner': 'owner_value'}
# Found, without @
with mock.patch('elastalert.alerts.SMTP') as mock_smtp:
mock_smtp.return_value = mock.Mock()
alert = EmailAlerter(rule)
alert.alert([{'data': {'user': 'qlo'}}])
assert mock_smtp.mock_calls[4][1][1] == ['qlo@example.com']
# Found, with @
rule['email_add_domain'] = '@example.com'
with mock.patch('elastalert.alerts.SMTP') as mock_smtp:
mock_smtp.return_value = mock.Mock()
alert = EmailAlerter(rule)
alert.alert([{'data': {'user': 'qlo'}}])
assert mock_smtp.mock_calls[4][1][1] == ['qlo@example.com']
# Found, list
with mock.patch('elastalert.alerts.SMTP') as mock_smtp:
mock_smtp.return_value = mock.Mock()
alert = EmailAlerter(rule)
alert.alert([{'data': {'user': ['qlo', 'foo']}}])
assert mock_smtp.mock_calls[4][1][1] == ['qlo@example.com', 'foo@example.com']
# Not found
with mock.patch('elastalert.alerts.SMTP') as mock_smtp:
mock_smtp.return_value = mock.Mock()
alert = EmailAlerter(rule)
alert.alert([{'data': {'foo': 'qlo'}}])
assert mock_smtp.mock_calls[4][1][1] == ['testing@test.test']
# Found, wrong type
with mock.patch('elastalert.alerts.SMTP') as mock_smtp:
mock_smtp.return_value = mock.Mock()
alert = EmailAlerter(rule)
alert.alert([{'data': {'user': 17}}])
assert mock_smtp.mock_calls[4][1][1] == ['testing@test.test']
def test_email_with_unicode_strings():
rule = {'name': 'test alert', 'email': u'testing@test.test', 'from_addr': 'testfrom@test.test',
'type': mock_rule(), 'timestamp_field': '@timestamp', 'email_reply_to': 'test@example.com', 'owner': 'owner_value',
'alert_subject': 'Test alert for {0}, owned by {1}', 'alert_subject_args': ['test_term', 'owner'], 'snowman': u'☃'}
with mock.patch('elastalert.alerts.SMTP') as mock_smtp:
mock_smtp.return_value = mock.Mock()
alert = EmailAlerter(rule)
alert.alert([{'test_term': 'test_value'}])
expected = [mock.call('localhost'),
mock.call().ehlo(),
mock.call().has_extn('STARTTLS'),
mock.call().starttls(certfile=None, keyfile=None),
mock.call().sendmail(mock.ANY, [u'testing@test.test'], mock.ANY),
mock.call().close()]
assert mock_smtp.mock_calls == expected
body = mock_smtp.mock_calls[4][1][2]
assert 'Reply-To: test@example.com' in body
assert 'To: testing@test.test' in body
assert 'From: testfrom@test.test' in body
assert 'Subject: Test alert for test_value, owned by owner_value' in body
def test_email_with_auth():
rule = {'name': 'test alert', 'email': ['testing@test.test', 'test@test.test'], 'from_addr': 'testfrom@test.test',
'type': mock_rule(), 'timestamp_field': '@timestamp', 'email_reply_to': 'test@example.com',
'alert_subject': 'Test alert for {0}', 'alert_subject_args': ['test_term'], 'smtp_auth_file': 'file.txt',
'rule_file': '/tmp/foo.yaml'}
with mock.patch('elastalert.alerts.SMTP') as mock_smtp:
with mock.patch('elastalert.alerts.yaml_loader') as mock_open:
mock_open.return_value = {'user': 'someone', 'password': 'hunter2'}
mock_smtp.return_value = mock.Mock()
alert = EmailAlerter(rule)
alert.alert([{'test_term': 'test_value'}])
expected = [mock.call('localhost'),
mock.call().ehlo(),
mock.call().has_extn('STARTTLS'),
mock.call().starttls(certfile=None, keyfile=None),
mock.call().login('someone', 'hunter2'),
mock.call().sendmail(mock.ANY, ['testing@test.test', 'test@test.test'], mock.ANY),
mock.call().close()]
assert mock_smtp.mock_calls == expected
def test_email_with_cert_key():
rule = {'name': 'test alert', 'email': ['testing@test.test', 'test@test.test'], 'from_addr': 'testfrom@test.test',
'type': mock_rule(), 'timestamp_field': '@timestamp', 'email_reply_to': 'test@example.com',
'alert_subject': 'Test alert for {0}', 'alert_subject_args': ['test_term'], 'smtp_auth_file': 'file.txt',
'smtp_cert_file': 'dummy/cert.crt', 'smtp_key_file': 'dummy/client.key', 'rule_file': '/tmp/foo.yaml'}
with mock.patch('elastalert.alerts.SMTP') as mock_smtp:
with mock.patch('elastalert.alerts.yaml_loader') as mock_open:
mock_open.return_value = {'user': 'someone', 'password': 'hunter2'}
mock_smtp.return_value = mock.Mock()
alert = EmailAlerter(rule)
alert.alert([{'test_term': 'test_value'}])
expected = [mock.call('localhost'),
mock.call().ehlo(),
mock.call().has_extn('STARTTLS'),
mock.call().starttls(certfile='dummy/cert.crt', keyfile='dummy/client.key'),
mock.call().login('someone', 'hunter2'),
mock.call().sendmail(mock.ANY, ['testing@test.test', 'test@test.test'], mock.ANY),
mock.call().close()]
assert mock_smtp.mock_calls == expected
def test_email_with_cc():
rule = {'name': 'test alert', 'email': ['testing@test.test', 'test@test.test'], 'from_addr': 'testfrom@test.test',
'type': mock_rule(), 'timestamp_field': '@timestamp', 'email_reply_to': 'test@example.com',
'cc': 'tester@testing.testing'}
with mock.patch('elastalert.alerts.SMTP') as mock_smtp:
mock_smtp.return_value = mock.Mock()
alert = EmailAlerter(rule)
alert.alert([{'test_term': 'test_value'}])
expected = [mock.call('localhost'),
mock.call().ehlo(),
mock.call().has_extn('STARTTLS'),
mock.call().starttls(certfile=None, keyfile=None),
mock.call().sendmail(mock.ANY, ['testing@test.test', 'test@test.test', 'tester@testing.testing'], mock.ANY),
mock.call().close()]
assert mock_smtp.mock_calls == expected
body = mock_smtp.mock_calls[4][1][2]
assert 'Reply-To: test@example.com' in body
assert 'To: testing@test.test' in body
assert 'CC: tester@testing.testing' in body
assert 'From: testfrom@test.test' in body
def test_email_with_bcc():
rule = {'name': 'test alert', 'email': ['testing@test.test', 'test@test.test'], 'from_addr': 'testfrom@test.test',
'type': mock_rule(), 'timestamp_field': '@timestamp', 'email_reply_to': 'test@example.com',
'bcc': 'tester@testing.testing'}
with mock.patch('elastalert.alerts.SMTP') as mock_smtp:
mock_smtp.return_value = mock.Mock()
alert = EmailAlerter(rule)
alert.alert([{'test_term': 'test_value'}])
expected = [mock.call('localhost'),
mock.call().ehlo(),
mock.call().has_extn('STARTTLS'),
mock.call().starttls(certfile=None, keyfile=None),
mock.call().sendmail(mock.ANY, ['testing@test.test', 'test@test.test', 'tester@testing.testing'], mock.ANY),
mock.call().close()]
assert mock_smtp.mock_calls == expected
body = mock_smtp.mock_calls[4][1][2]
assert 'Reply-To: test@example.com' in body
assert 'To: testing@test.test' in body
assert 'CC: tester@testing.testing' not in body
assert 'From: testfrom@test.test' in body
def test_email_with_cc_and_bcc():
rule = {'name': 'test alert', 'email': ['testing@test.test', 'test@test.test'], 'from_addr': 'testfrom@test.test',
'type': mock_rule(), 'timestamp_field': '@timestamp', 'email_reply_to': 'test@example.com',
'cc': ['test1@test.com', 'test2@test.com'], 'bcc': 'tester@testing.testing'}
with mock.patch('elastalert.alerts.SMTP') as mock_smtp:
mock_smtp.return_value = mock.Mock()
alert = EmailAlerter(rule)
alert.alert([{'test_term': 'test_value'}])
expected = [mock.call('localhost'),
mock.call().ehlo(),
mock.call().has_extn('STARTTLS'),
mock.call().starttls(certfile=None, keyfile=None),
mock.call().sendmail(
mock.ANY,
[
'testing@test.test',
'test@test.test',
'test1@test.com',
'test2@test.com',
'tester@testing.testing'
],
mock.ANY
),
mock.call().close()]
assert mock_smtp.mock_calls == expected
body = mock_smtp.mock_calls[4][1][2]
assert 'Reply-To: test@example.com' in body
assert 'To: testing@test.test' in body
assert 'CC: test1@test.com,test2@test.com' in body
assert 'From: testfrom@test.test' in body
def test_email_with_args():
rule = {
'name': 'test alert',
'email': ['testing@test.test', 'test@test.test'],
'from_addr': 'testfrom@test.test',
'type': mock_rule(),
'timestamp_field': '@timestamp',
'email_reply_to': 'test@example.com',
'alert_subject': 'Test alert for {0} {1}',
'alert_subject_args': ['test_term', 'test.term'],
'alert_text': 'Test alert for {0} and {1} {2}',
'alert_text_args': ['test_arg1', 'test_arg2', 'test.arg3'],
'alert_missing_value': '<CUSTOM MISSING VALUE>'
}
with mock.patch('elastalert.alerts.SMTP') as mock_smtp:
mock_smtp.return_value = mock.Mock()
alert = EmailAlerter(rule)
alert.alert([{'test_term': 'test_value', 'test_arg1': 'testing', 'test': {'term': ':)', 'arg3': u'☃'}}])
expected = [mock.call('localhost'),
mock.call().ehlo(),
mock.call().has_extn('STARTTLS'),
mock.call().starttls(certfile=None, keyfile=None),
mock.call().sendmail(mock.ANY, ['testing@test.test', 'test@test.test'], mock.ANY),
mock.call().close()]
assert mock_smtp.mock_calls == expected
body = mock_smtp.mock_calls[4][1][2]
# Extract the MIME encoded message body
body_text = body.split('\n\n')[-1][:-1].decode('base64')
assert 'testing' in body_text
assert '<CUSTOM MISSING VALUE>' in body_text
assert '☃' in body_text
assert 'Reply-To: test@example.com' in body
assert 'To: testing@test.test' in body
assert 'From: testfrom@test.test' in body
assert 'Subject: Test alert for test_value :)' in body
def test_email_query_key_in_subject():
rule = {'name': 'test alert', 'email': ['testing@test.test', 'test@test.test'],
'type': mock_rule(), 'timestamp_field': '@timestamp', 'email_reply_to': 'test@example.com',
'query_key': 'username'}
with mock.patch('elastalert.alerts.SMTP') as mock_smtp:
mock_smtp.return_value = mock.Mock()
alert = EmailAlerter(rule)
alert.alert([{'test_term': 'test_value', 'username': 'werbenjagermanjensen'}])
body = mock_smtp.mock_calls[4][1][2]
lines = body.split('\n')
found_subject = False
for line in lines:
if line.startswith('Subject'):
assert 'werbenjagermanjensen' in line
found_subject = True
assert found_subject
def test_opsgenie_basic():
rule = {'name': 'testOGalert', 'opsgenie_key': 'ogkey',
'opsgenie_account': 'genies', 'opsgenie_addr': 'https://api.opsgenie.com/v2/alerts',
'opsgenie_recipients': ['lytics'], 'type': mock_rule()}
with mock.patch('requests.post') as mock_post:
alert = OpsGenieAlerter(rule)
alert.alert([{'@timestamp': '2014-10-31T00:00:00'}])
print("mock_post: {0}".format(mock_post._mock_call_args_list))
mcal = mock_post._mock_call_args_list
print('mcal: {0}'.format(mcal[0]))
assert mcal[0][0][0] == ('https://api.opsgenie.com/v2/alerts')
assert mock_post.called
assert mcal[0][1]['headers']['Authorization'] == 'GenieKey ogkey'
assert mcal[0][1]['json']['source'] == 'ElastAlert'
assert mcal[0][1]['json']['responders'] == [{'id': 'lytics', 'type': 'user'}]
assert mcal[0][1]['json']['source'] == 'ElastAlert'
def test_opsgenie_frequency():
rule = {'name': 'testOGalert', 'opsgenie_key': 'ogkey',
'opsgenie_account': 'genies', 'opsgenie_addr': 'https://api.opsgenie.com/v2/alerts',
'opsgenie_recipients': ['lytics'], 'type': mock_rule(),
'filter': [{'query': {'query_string': {'query': '*hihi*'}}}],
'alert': 'opsgenie'}
with mock.patch('requests.post') as mock_post:
alert = OpsGenieAlerter(rule)
alert.alert([{'@timestamp': '2014-10-31T00:00:00'}])
assert alert.get_info()['recipients'] == rule['opsgenie_recipients']
print("mock_post: {0}".format(mock_post._mock_call_args_list))
mcal = mock_post._mock_call_args_list
print('mcal: {0}'.format(mcal[0]))
assert mcal[0][0][0] == ('https://api.opsgenie.com/v2/alerts')
assert mock_post.called
assert mcal[0][1]['headers']['Authorization'] == 'GenieKey ogkey'
assert mcal[0][1]['json']['source'] == 'ElastAlert'
assert mcal[0][1]['json']['responders'] == [{'id': 'lytics', 'type': 'user'}]
assert mcal[0][1]['json']['source'] == 'ElastAlert'
assert mcal[0][1]['json']['source'] == 'ElastAlert'
def test_kibana(ea):
rule = {'filter': [{'query': {'query_string': {'query': 'xy:z'}}}],
'name': 'Test rule!',
'es_host': 'test.testing',
'es_port': 12345,
'timeframe': datetime.timedelta(hours=1),
'index': 'logstash-test',
'include': ['@timestamp'],
'timestamp_field': '@timestamp'}
match = {'@timestamp': '2014-10-10T00:00:00'}
with mock.patch("elastalert.elastalert.elasticsearch_client") as mock_es:
mock_create = mock.Mock(return_value={'_id': 'ABCDEFGH'})
mock_es_inst = mock.Mock()
mock_es_inst.index = mock_create
mock_es_inst.host = 'test.testing'
mock_es_inst.port = 12345
mock_es.return_value = mock_es_inst
link = ea.generate_kibana_db(rule, match)
assert 'http://test.testing:12345/_plugin/kibana/#/dashboard/temp/ABCDEFGH' == link
# Name and index
dashboard = json.loads(mock_create.call_args_list[0][1]['body']['dashboard'])
assert dashboard['index']['default'] == 'logstash-test'
assert 'Test rule!' in dashboard['title']
# Filters and time range
filters = dashboard['services']['filter']['list']
assert 'xy:z' in filters['1']['query']
assert filters['1']['type'] == 'querystring'
time_range = filters['0']
assert time_range['from'] == ts_add(match['@timestamp'], -rule['timeframe'])
assert time_range['to'] == ts_add(match['@timestamp'], datetime.timedelta(minutes=10))
# Included fields active in table
assert dashboard['rows'][1]['panels'][0]['fields'] == ['@timestamp']
def test_alert_text_kw(ea):
rule = ea.rules[0].copy()
rule['alert_text'] = '{field} at {time}'
rule['alert_text_kw'] = {
'@timestamp': 'time',
'field': 'field',
}
match = {'@timestamp': '1918-01-17', 'field': 'value'}
alert_text = unicode(BasicMatchString(rule, match))
body = '{field} at {@timestamp}'.format(**match)
assert body in alert_text
def test_alert_text_global_substitution(ea):
rule = ea.rules[0].copy()
rule['owner'] = 'the owner from rule'
rule['priority'] = 'priority from rule'
rule['abc'] = 'abc from rule'
rule['alert_text'] = 'Priority: {0}; Owner: {1}; Abc: {2}'
rule['alert_text_args'] = ['priority', 'owner', 'abc']
match = {
'@timestamp': '2016-01-01',
'field': 'field_value',
'abc': 'abc from match',
}
alert_text = unicode(BasicMatchString(rule, match))
assert 'Priority: priority from rule' in alert_text
assert 'Owner: the owner from rule' in alert_text
# When the key exists in both places, it will come from the match
assert 'Abc: abc from match' in alert_text
def test_alert_text_kw_global_substitution(ea):
rule = ea.rules[0].copy()
rule['foo_rule'] = 'foo from rule'
rule['owner'] = 'the owner from rule'
rule['abc'] = 'abc from rule'
rule['alert_text'] = 'Owner: {owner}; Foo: {foo}; Abc: {abc}'
rule['alert_text_kw'] = {
'owner': 'owner',
'foo_rule': 'foo',
'abc': 'abc',
}
match = {
'@timestamp': '2016-01-01',
'field': 'field_value',
'abc': 'abc from match',
}
alert_text = unicode(BasicMatchString(rule, match))
assert 'Owner: the owner from rule' in alert_text
assert 'Foo: foo from rule' in alert_text
# When the key exists in both places, it will come from the match
assert 'Abc: abc from match' in alert_text
def test_resolving_rule_references(ea):
rule = {
'name': 'test_rule',
'type': mock_rule(),
'owner': 'the_owner',
'priority': 2,
'list_of_things': [
'1',
'$owner$',
[
'11',
'$owner$',
],
],
'nested_dict': {
'nested_one': '1',
'nested_owner': '$owner$',
},
'resolved_string_reference': '$owner$',
'resolved_int_reference': '$priority$',
'unresolved_reference': '$foo$',
}
alert = Alerter(rule)
assert 'the_owner' == alert.rule['resolved_string_reference']
assert 2 == alert.rule['resolved_int_reference']
assert '$foo$' == alert.rule['unresolved_reference']
assert 'the_owner' == alert.rule['list_of_things'][1]
assert 'the_owner' == alert.rule['list_of_things'][2][1]
assert 'the_owner' == alert.rule['nested_dict']['nested_owner']
| 42.101727
| 128
| 0.592295
| 2,697
| 21,935
| 4.655543
| 0.098999
| 0.054157
| 0.043007
| 0.038229
| 0.761628
| 0.749283
| 0.729611
| 0.70978
| 0.689949
| 0.668764
| 0
| 0.014468
| 0.24062
| 21,935
| 520
| 129
| 42.182692
| 0.739029
| 0.019558
| 0
| 0.57385
| 0
| 0.002421
| 0.32035
| 0.032901
| 0
| 0
| 0
| 0
| 0.225182
| 1
| 0.046005
| false
| 0.004843
| 0.021792
| 0.002421
| 0.072639
| 0.009685
| 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
|
29953c6d280174491558ecdcf1eedbb1435e38e9
| 115
|
py
|
Python
|
pra subir/pythonexercicios/ex3.py
|
daianebandeira88/curso-python
|
763f5f36b6d7329549ad861c63acc3c84aade887
|
[
"MIT"
] | null | null | null |
pra subir/pythonexercicios/ex3.py
|
daianebandeira88/curso-python
|
763f5f36b6d7329549ad861c63acc3c84aade887
|
[
"MIT"
] | null | null | null |
pra subir/pythonexercicios/ex3.py
|
daianebandeira88/curso-python
|
763f5f36b6d7329549ad861c63acc3c84aade887
|
[
"MIT"
] | null | null | null |
l=[0]*10
for i in range(len(l)):
l[i]=i*2
print(0 in l)
print(1 in l)
print(2 in l)
print(3 in l)
print(4 in l)
| 14.375
| 23
| 0.591304
| 33
| 115
| 2.060606
| 0.393939
| 0.220588
| 0.470588
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.098901
| 0.208696
| 115
| 8
| 24
| 14.375
| 0.648352
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.625
| 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
| 0
| 0
| 0
| 1
|
0
| 4
|
29a5e93ccc398aea2cf6b054918df1113146f8ee
| 167
|
py
|
Python
|
venv/Lib/site-packages/problog/nnf_formula.py
|
szervoudakis/OpinionMine
|
70ab18747ec0b32b59ed1936a04872acffdbd2f9
|
[
"Apache-2.0"
] | 1
|
2021-06-01T06:03:00.000Z
|
2021-06-01T06:03:00.000Z
|
venv/Lib/site-packages/problog/nnf_formula.py
|
szervoudakis/OpinionMine
|
70ab18747ec0b32b59ed1936a04872acffdbd2f9
|
[
"Apache-2.0"
] | null | null | null |
venv/Lib/site-packages/problog/nnf_formula.py
|
szervoudakis/OpinionMine
|
70ab18747ec0b32b59ed1936a04872acffdbd2f9
|
[
"Apache-2.0"
] | 1
|
2021-06-25T14:59:34.000Z
|
2021-06-25T14:59:34.000Z
|
from ddnnf_formula import DDNNF as NNF
import warnings
warnings.warn("The class nnf_formula.NNF has been renamed to ddnnf_formula.DDNNF. Please update your code!")
| 27.833333
| 109
| 0.808383
| 27
| 167
| 4.888889
| 0.666667
| 0.181818
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.137725
| 167
| 5
| 110
| 33.4
| 0.916667
| 0
| 0
| 0
| 0
| 0
| 0.550898
| 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
|
29dc3a4a4625a80e8d004c0715022823260db52f
| 78
|
py
|
Python
|
common/validators/__init__.py
|
oil-rope/oil-and-rope
|
6d59c87d4809f120417a90c1624952085486bb06
|
[
"MIT"
] | 8
|
2019-08-27T20:08:22.000Z
|
2021-07-23T22:49:47.000Z
|
common/validators/__init__.py
|
oil-rope/oil-and-rope
|
6d59c87d4809f120417a90c1624952085486bb06
|
[
"MIT"
] | 73
|
2020-03-11T18:07:29.000Z
|
2022-03-28T18:07:47.000Z
|
common/validators/__init__.py
|
oil-rope/oil-and-rope
|
6d59c87d4809f120417a90c1624952085486bb06
|
[
"MIT"
] | 4
|
2020-02-22T19:44:17.000Z
|
2022-03-08T09:42:45.000Z
|
from .files import validate_file_size
__all__ = [
'validate_file_size'
]
| 13
| 37
| 0.74359
| 10
| 78
| 5
| 0.7
| 0.48
| 0.64
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.179487
| 78
| 5
| 38
| 15.6
| 0.78125
| 0
| 0
| 0
| 0
| 0
| 0.230769
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.25
| 0
| 0.25
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
4b00bf3794d63e54df7152f704bccaf31317ca2a
| 140
|
py
|
Python
|
chord.py
|
Gredelston/johann
|
2c85238ad603987686d2d6c7be6abe806b963e02
|
[
"MIT"
] | 2
|
2019-06-19T14:09:09.000Z
|
2019-06-19T14:21:05.000Z
|
chord.py
|
Gredelston/johann
|
2c85238ad603987686d2d6c7be6abe806b963e02
|
[
"MIT"
] | 1
|
2019-06-19T02:18:34.000Z
|
2019-06-19T02:18:34.000Z
|
chord.py
|
Gredelston/johann
|
2c85238ad603987686d2d6c7be6abe806b963e02
|
[
"MIT"
] | null | null | null |
class Chord(object):
def __init__(self):
self.tones = []
def add_tone(self, tone):
self.tones.append(tone)
| 23.333333
| 31
| 0.557143
| 17
| 140
| 4.294118
| 0.588235
| 0.246575
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.314286
| 140
| 6
| 31
| 23.333333
| 0.760417
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.4
| false
| 0
| 0
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
4b044dbd0738df756528fbf83b5e521118db09e9
| 2,911
|
py
|
Python
|
ansuite.py
|
anonik9900/Anonik-Suite
|
c47099e96dac5e6e1eec68637b41de33ff57e058
|
[
"Apache-2.0"
] | null | null | null |
ansuite.py
|
anonik9900/Anonik-Suite
|
c47099e96dac5e6e1eec68637b41de33ff57e058
|
[
"Apache-2.0"
] | null | null | null |
ansuite.py
|
anonik9900/Anonik-Suite
|
c47099e96dac5e6e1eec68637b41de33ff57e058
|
[
"Apache-2.0"
] | null | null | null |
#!/usr/bin/env python3
import random
import string
import subprocess #Process commands
import socket #Process socket data
import pyfiglet
import sys
import os
from subprocess import call
def MenuShell():
ascii_banner = pyfiglet.figlet_format("Anonik Suite")
print(ascii_banner)
print ("{< Devolved By Anonik V 0.1>}")
print("")
def SplashScreen():
print (" . ) )")
print (" ( (| .")
print (" ) )\/ ( ( (")
print (" * ( (( / ))\)) ( ) )")
print (" ( \ )\( | ))( ) (|")
print (" >) ))/ | )/ \(( ) \ ")
print (" ( ( . -. V )/ )( ( ")
print (" \ / . \ . \)) ))")
print (" )( ( | | ) . ( /")
print (" )( ,')) \ / \( `. )")
print (" (\> ,'/__ )) __`. /")
print (" ( \ | / ___ ( \/ ___ \ | ( (")
print (" \.) |/ / \__ __/ \ \| ))")
print (" . \. |> \ | __ | / <| /")
print (" )/ \____/ :..: \____/ \ <")
print (" ) \ (|__ . / ;: \ __| ) (")
print (" (( )\) ~--_ -- -- _--~ / ))")
print (" \ ( | || || | ( /")
print (" \. | ||_ _|| | /")
print (" > : | ~V+-I_I_I-+V~ | : (.")
print (" ( \: T\ _ _ /T : ./")
print (" \ : T^T T-+-T T^T ;<")
print (" \..`_ -+- _' )")
print (" ) . `--=.._____..=--'. ./ (")
def listatool():
print("YouTube Downloader | digita - ytdown \n")
print("Backdoor Backfucker | digita - backfucker \n")
print("Password Generator | digita - makepsw \n")
return MenuPrincipale()
def Funzioni():
print ("Ciao")
def MenuPrincipale():
ascii_banner = pyfiglet.figlet_format("Anonik Suite")
print(ascii_banner)
print("")
print ("============================================")
print(" MENU PRINCIPALE ")
print ("")
print ("Seleziona (1) per la lista dei tools")
print("")
print ("Altrimenti digita il comando da lanciare")
print ("")
print ("============================================")
sceltaMenu = input("root@anoniksuite: ")
if sceltaMenu == str("1"):
return (listatool())
if sceltaMenu == str("ytdown"):
print("")
call(["python3", "tools/ytd.py"])
#xec(open('test1.py').read())
#call(["python3", "test/test1.py"])
if sceltaMenu == str("backfucker"):
print("")
call(["python3", "tools/backfucker.py"])
if sceltaMenu == str("makepsw"):
print("")
call(["python3", "tools/pswf.py"])
else:
print("Errore: Invalid Input")
os.system('clear')
return MenuPrincipale()
print (MenuShell())
print (SplashScreen())
print (MenuPrincipale())
| 25.991071
| 59
| 0.404328
| 215
| 2,911
| 5.246512
| 0.376744
| 0.212766
| 0.226064
| 0.248227
| 0.207447
| 0.202128
| 0.202128
| 0.202128
| 0.169326
| 0.169326
| 0
| 0.005889
| 0.358296
| 2,911
| 111
| 60
| 26.225225
| 0.597966
| 0.040879
| 0
| 0.210526
| 0
| 0
| 0.546825
| 0.031575
| 0
| 0
| 0
| 0
| 0
| 1
| 0.065789
| false
| 0.013158
| 0.105263
| 0
| 0.210526
| 0.631579
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
4b0d0cdfeb09bf4c03f462fe1bf9725daa564acb
| 285
|
py
|
Python
|
05.Drawing Figures with Loops/squareFrame.py
|
nikolayvutov/Python
|
55163496dac452a7110b7f76edc6894ee195f1fe
|
[
"MIT"
] | null | null | null |
05.Drawing Figures with Loops/squareFrame.py
|
nikolayvutov/Python
|
55163496dac452a7110b7f76edc6894ee195f1fe
|
[
"MIT"
] | null | null | null |
05.Drawing Figures with Loops/squareFrame.py
|
nikolayvutov/Python
|
55163496dac452a7110b7f76edc6894ee195f1fe
|
[
"MIT"
] | null | null | null |
n = int(input())
print('+', end='')
for i in range(n-2):
print(' -', end='')
print(' +')
for k in range(n-2):
print('|', end='')
for row in range(n-2):
print(' -', end='')
print(' |')
print('+', end='')
for j in range(n-2):
print(' -', end='')
print(' +')
| 17.8125
| 27
| 0.442105
| 42
| 285
| 3
| 0.309524
| 0.380952
| 0.253968
| 0.285714
| 0.65873
| 0.65873
| 0.52381
| 0
| 0
| 0
| 0
| 0.018519
| 0.242105
| 285
| 15
| 28
| 19
| 0.564815
| 0
| 0
| 0.5
| 0
| 0
| 0.052632
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.642857
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
4b20bba0a75a955a524ef7557476f245038e6fad
| 136
|
py
|
Python
|
testing/ejemplo/app.py
|
rauljrz/curso_python
|
f241125f0a51c39899f5d59537dca9e7b4c53489
|
[
"Apache-2.0"
] | null | null | null |
testing/ejemplo/app.py
|
rauljrz/curso_python
|
f241125f0a51c39899f5d59537dca9e7b4c53489
|
[
"Apache-2.0"
] | null | null | null |
testing/ejemplo/app.py
|
rauljrz/curso_python
|
f241125f0a51c39899f5d59537dca9e7b4c53489
|
[
"Apache-2.0"
] | null | null | null |
import requests
def bajar_datos(url):
"""Hace un GET del endpoint y devuelve JSON."""
res = requests.get(url)
return res.json()
| 17
| 49
| 0.691176
| 21
| 136
| 4.428571
| 0.761905
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.183824
| 136
| 8
| 50
| 17
| 0.837838
| 0.301471
| 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
|
d9a10352c4f69b557de904553a42e7cdb227d69c
| 174
|
py
|
Python
|
bayesnet/tensor/constant.py
|
ctgk/bayes
|
96eab9305eaeecc5a5b032cdf92a8285de4f60bf
|
[
"MIT"
] | 21
|
2019-01-08T05:58:41.000Z
|
2021-11-26T14:24:11.000Z
|
bayesnet/tensor/constant.py
|
ctgk/bayes
|
96eab9305eaeecc5a5b032cdf92a8285de4f60bf
|
[
"MIT"
] | null | null | null |
bayesnet/tensor/constant.py
|
ctgk/bayes
|
96eab9305eaeecc5a5b032cdf92a8285de4f60bf
|
[
"MIT"
] | 11
|
2019-05-04T13:44:19.000Z
|
2021-08-05T04:26:19.000Z
|
from bayesnet.tensor.tensor import Tensor
class Constant(Tensor):
"""
constant tensor class
"""
def __init__(self, value):
super().__init__(value)
| 15.818182
| 41
| 0.643678
| 19
| 174
| 5.473684
| 0.578947
| 0.211538
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.241379
| 174
| 10
| 42
| 17.4
| 0.787879
| 0.12069
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 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
|
d9a46f53b76e4fe134bcd74f1104e73dcec986aa
| 82
|
py
|
Python
|
ckanapi/version.py
|
muccg/ckanapi
|
f26fb83a8287b41a18994b36b22693c95f8f3516
|
[
"MIT"
] | 128
|
2015-01-13T05:18:31.000Z
|
2022-03-18T03:15:43.000Z
|
ckanapi/version.py
|
muccg/ckanapi
|
f26fb83a8287b41a18994b36b22693c95f8f3516
|
[
"MIT"
] | 134
|
2015-02-04T15:22:25.000Z
|
2022-03-18T19:14:12.000Z
|
ckanapi/version.py
|
muccg/ckanapi
|
f26fb83a8287b41a18994b36b22693c95f8f3516
|
[
"MIT"
] | 80
|
2015-01-09T20:47:41.000Z
|
2022-03-25T15:04:32.000Z
|
import pkg_resources
__version__ = pkg_resources.require("ckanapi")[0].version
| 13.666667
| 57
| 0.792683
| 10
| 82
| 5.9
| 0.7
| 0.40678
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.013514
| 0.097561
| 82
| 5
| 58
| 16.4
| 0.783784
| 0
| 0
| 0
| 0
| 0
| 0.0875
| 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
|
d9e18d8cb1ac415f958aca109314f19d0ba5c0df
| 59
|
py
|
Python
|
gym_tetris/_constants/__init__.py
|
Olloxan/gym-tetris
|
87424d8813eac100d360ec2ce6df6dcf0e3ef9d3
|
[
"MIT"
] | null | null | null |
gym_tetris/_constants/__init__.py
|
Olloxan/gym-tetris
|
87424d8813eac100d360ec2ce6df6dcf0e3ef9d3
|
[
"MIT"
] | null | null | null |
gym_tetris/_constants/__init__.py
|
Olloxan/gym-tetris
|
87424d8813eac100d360ec2ce6df6dcf0e3ef9d3
|
[
"MIT"
] | null | null | null |
"""Modules with constant values for the parent package."""
| 29.5
| 58
| 0.745763
| 8
| 59
| 5.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.135593
| 59
| 1
| 59
| 59
| 0.862745
| 0.881356
| 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
|
8a177472ca8bbdf37a4c74135a86b7a1448276bb
| 36,896
|
py
|
Python
|
horovod/torch/mpi_ops.py
|
heyfey/horovod
|
7a697111eef7d88899551c176e31cde5ab61545c
|
[
"Apache-2.0"
] | 2
|
2021-04-03T13:53:21.000Z
|
2021-04-03T13:53:26.000Z
|
horovod/torch/mpi_ops.py
|
heyfey/horovod
|
7a697111eef7d88899551c176e31cde5ab61545c
|
[
"Apache-2.0"
] | 4
|
2021-04-15T15:14:24.000Z
|
2021-05-25T10:53:23.000Z
|
horovod/torch/mpi_ops.py
|
heyfey/horovod
|
7a697111eef7d88899551c176e31cde5ab61545c
|
[
"Apache-2.0"
] | 1
|
2021-04-16T06:28:54.000Z
|
2021-04-16T06:28:54.000Z
|
# Copyright 2019 Uber Technologies, Inc. All Rights Reserved.
# Modifications copyright Microsoft
# Modifications copyright (C) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# Load all the necessary PyTorch C types.
import torch
import warnings
from horovod.common.basics import HorovodBasics as _HorovodBasics
from horovod.common.exceptions import HorovodInternalError
from horovod.common.util import check_installed_version, get_average_backwards_compatibility_fun, gpu_available, num_rank_is_power_2
from horovod.torch.compression import Compression
# Check possible symbol not found error from pytorch version mismatch
try:
from horovod.torch import mpi_lib_v2 as mpi_lib
except Exception as e:
check_installed_version('pytorch', torch.__version__, e)
raise e
else:
check_installed_version('pytorch', torch.__version__)
_NULL = ""
_basics = _HorovodBasics(__file__, 'mpi_lib_v2')
# import basic methods
init = _basics.init
is_initialized = _basics.is_initialized
start_timeline = _basics.start_timeline
stop_timeline = _basics.stop_timeline
size = _basics.size
local_size = _basics.local_size
cross_size = _basics.cross_size
rank = _basics.rank
local_rank = _basics.local_rank
cross_rank = _basics.cross_rank
mpi_threads_supported = _basics.mpi_threads_supported
mpi_enabled = _basics.mpi_enabled
mpi_built = _basics.mpi_built
gloo_enabled = _basics.gloo_enabled
gloo_built = _basics.gloo_built
nccl_built = _basics.nccl_built
ddl_built = _basics.ddl_built
ccl_built = _basics.ccl_built
cuda_built = _basics.cuda_built
rocm_built = _basics.rocm_built
def shutdown(*args, **kwargs):
mpi_lib.horovod_torch_reset()
return _basics.shutdown(*args, **kwargs)
# import reduction op values
Average = _basics.Average
Sum = _basics.Sum
Adasum = _basics.Adasum
is_homogeneous = _basics.is_homogeneous
handle_average_backwards_compatibility = get_average_backwards_compatibility_fun(_basics)
# Schema: handle -> input, output
# We keep input in order to make sure it does not get garbage collected
# before the operation is finished.
_handle_map = {}
def _check_function(function_factory, tensor):
function = function_factory(tensor)
if not hasattr(mpi_lib, function):
raise ValueError('Tensor type %s is not supported.' % tensor.type())
if not tensor.is_contiguous():
raise ValueError('Tensor is required to be contiguous.')
return function
def _allreduce_function_factory(tensor):
return 'horovod_torch_allreduce_async_' + tensor.type().replace('.', '_')
def _allreduce_async(tensor, output, name, op, prescale_factor, postscale_factor):
# Set the divisor for reduced gradients to average when necessary
if op == Average:
if rocm_built():
# For ROCm, perform averaging at framework level
divisor = size()
op = Sum
else:
divisor = 1
elif op == Adasum:
if tensor.device.type != 'cpu' and gpu_available('torch'):
if nccl_built():
if not is_homogeneous():
raise NotImplementedError('Running GPU Adasum on heterogeneous cluster is not supported yet.')
elif not num_rank_is_power_2(int(size() / local_size())):
raise NotImplementedError('Running GPU Adasum with non-power of 2 nodes is not supported yet.')
if rocm_built():
# For ROCm, perform averaging at framework level
divisor = local_size()
else:
divisor = 1
else:
warnings.warn('Adasum reduction does not currently support GPU reduction using MPI. Tensors are '
'copied to CPU memory instead. To use Adasum for GPU reduction, please compile Horovod '
'with HOROVOD_GPU_OPERATIONS=NCCL.')
divisor = 1
else:
if not num_rank_is_power_2(size()):
raise NotImplementedError('Running Adasum with non-power of 2 ranks is not supported yet.')
divisor = 1
else:
divisor = 1
function = _check_function(_allreduce_function_factory, tensor)
try:
handle = getattr(mpi_lib, function)(tensor, output, divisor,
name.encode() if name is not None else _NULL, op,
prescale_factor, postscale_factor)
except RuntimeError as e:
raise HorovodInternalError(e)
_handle_map[handle] = (tensor, output)
return handle
def allreduce_async(tensor, average=None, name=None, op=None,
prescale_factor=1.0, postscale_factor=1.0):
"""
A function that performs asynchronous averaging or summation of the input tensor
over all the Horovod processes. The input tensor is not modified.
The reduction operation is keyed by the name. If name is not provided, an incremented
auto-generated name is used. The tensor type and shape must be the same on all
Horovod processes for a given name. The reduction will not start until all processes
are ready to send and receive the tensor.
Arguments:
tensor: A tensor to reduce.
average:
.. warning:: .. deprecated:: 0.19.0
Use `op` instead. Will be removed in v0.21.0.
name: A name of the reduction operation.
op: The reduction operation to combine tensors across different
ranks. Defaults to Average if None is given.
prescale_factor: Multiplicative factor to scale tensor before allreduce.
postscale_factor: Multiplicative factor to scale tensor after allreduce.
Returns:
A handle to the allreduce operation that can be used with `poll()` or
`synchronize()`.
"""
op = handle_average_backwards_compatibility(op, average)
output = tensor.new(tensor.shape)
return _allreduce_async(tensor, output, name, op, prescale_factor, postscale_factor)
class HorovodAllreduce(torch.autograd.Function):
"""An autograd function that performs allreduce on a tensor."""
@staticmethod
def forward(ctx, tensor, average, name, op, prescale_factor, postscale_factor):
ctx.average = average
ctx.op = op
ctx.prescale_factor = prescale_factor
ctx.postscale_factor = postscale_factor
handle = allreduce_async(tensor, average, name, op, prescale_factor, postscale_factor)
return synchronize(handle)
@staticmethod
def backward(ctx, grad_output):
return allreduce(grad_output, average=ctx.average, op=ctx.op,
prescale_factor=ctx.prescale_factor,
postscale_factor=ctx.postscale_factor), None, None, None, None, None
def allreduce(tensor, average=None, name=None, compression=Compression.none, op=None,
prescale_factor=1.0, postscale_factor=1.0):
"""
A function that performs averaging or summation of the input tensor over all the
Horovod processes. The input tensor is not modified.
The reduction operation is keyed by the name. If name is not provided, an incremented
auto-generated name is used. The tensor type and shape must be the same on all
Horovod processes for a given name. The reduction will not start until all processes
are ready to send and receive the tensor.
This acts as a thin wrapper around an autograd function. If your input
tensor requires gradients, then callings this function will allow gradients
to be computed and backpropagated.
Arguments:
tensor: A tensor to reduce.
average:
.. warning:: .. deprecated:: 0.19.0
Use `op` instead. Will be removed in v0.21.0.
name: A name of the reduction operation.
compression: Compression algorithm used during allreduce to reduce the amount
of data sent during the each parameter update step. Defaults to
not using compression.
op: The reduction operation to combine tensors across different ranks. Defaults
to Average if None is given.
prescale_factor: Multiplicative factor to scale tensor before allreduce.
postscale_factor: Multiplicative factor to scale tensor after allreduce.
Returns:
A tensor of the same shape and type as `tensor`, averaged or summed across all
processes.
"""
tensor_compressed, ctx = compression.compress(tensor)
summed_tensor_compressed = HorovodAllreduce.apply(tensor_compressed, average, name, op,
prescale_factor, postscale_factor)
return compression.decompress(summed_tensor_compressed, ctx)
def allreduce_async_(tensor, average=None, name=None, op=None,
prescale_factor=1.0, postscale_factor=1.0):
"""
A function that performs asynchronous in-place averaging or summation of the input
tensor over all the Horovod processes.
The reduction operation is keyed by the name. If name is not provided, an incremented
auto-generated name is used. The tensor type and shape must be the same on all
Horovod processes for a given name. The reduction will not start until all processes
are ready to send and receive the tensor.
Arguments:
tensor: A tensor to reduce.
average:
.. warning:: .. deprecated:: 0.19.0
Use `op` instead. Will be removed in v0.21.0.
name: A name of the reduction operation.
op: The reduction operation to combine tensors across different ranks. Defaults to
Average if None is given.
prescale_factor: Multiplicative factor to scale tensor before allreduce.
postscale_factor: Multiplicative factor to scale tensor after allreduce.
Returns:
A handle to the allreduce operation that can be used with `poll()` or
`synchronize()`.
"""
op = handle_average_backwards_compatibility(op, average)
return _allreduce_async(tensor, tensor, name, op, prescale_factor, postscale_factor)
def allreduce_(tensor, average=None, name=None, op=None,
prescale_factor=1.0, postscale_factor=1.0):
"""
A function that performs in-place averaging or summation of the input tensor over
all the Horovod processes.
The reduction operation is keyed by the name. If name is not provided, an incremented
auto-generated name is used. The tensor type and shape must be the same on all
Horovod processes for a given name. The reduction will not start until all processes
are ready to send and receive the tensor.
Arguments:
tensor: A tensor to reduce.
average:
.. warning:: .. deprecated:: 0.19.0
Use `op` instead. Will be removed in v0.21.0.
name: A name of the reduction operation.
op: The reduction operation to combine tensors across different ranks. Defaults to
Average if None is given.
prescale_factor: Multiplicative factor to scale tensor before allreduce.
postscale_factor: Multiplicative factor to scale tensor after allreduce.
Returns:
A tensor of the same shape and type as `tensor`, averaged or summed across all
processes.
"""
handle = allreduce_async_(tensor, average, name, op, prescale_factor, postscale_factor)
return synchronize(handle)
def _grouped_allreduce_function_factory(tensor):
return 'horovod_torch_grouped_allreduce_async_' + tensor.type().replace('.', '_')
def _grouped_allreduce_async(tensors, outputs, name, op, prescale_factor, postscale_factor):
# Set the divisor for reduced gradients to average when necessary
if op == Average:
if rocm_built():
# For ROCm, perform averaging at framework level
divisor = size()
op = Sum
else:
divisor = 1
elif op == Adasum:
if tensors[0].device.type != 'cpu' and gpu_available('torch'):
if nccl_built():
if not is_homogeneous():
raise NotImplementedError('Running GPU Adasum on heterogeneous cluster is not supported yet.')
elif not num_rank_is_power_2(int(size() / local_size())):
raise NotImplementedError('Running GPU Adasum with non-power of 2 nodes is not supported yet.')
if rocm_built():
# For ROCm, perform averaging at framework level
divisor = local_size()
else:
divisor = 1
else:
warnings.warn('Adasum reduction does not currently support GPU reduction using MPI. Tensors are '
'copied to CPU memory instead. To use Adasum for GPU reduction, please compile Horovod '
'with HOROVOD_GPU_OPERATIONS=NCCL.')
divisor = 1
else:
if not num_rank_is_power_2(size()):
raise NotImplementedError('Running Adasum with non-power of 2 ranks is not supported yet.')
divisor = 1
else:
divisor = 1
function = _check_function(_grouped_allreduce_function_factory, tensors[0])
try:
handle = getattr(mpi_lib, function)(tensors, outputs, divisor,
name.encode() if name is not None else _NULL, op,
prescale_factor, postscale_factor)
except RuntimeError as e:
raise HorovodInternalError(e)
_handle_map[handle] = (tuple(tensors), tuple(outputs))
return handle
def grouped_allreduce_async(tensors, average=None, name=None, op=None,
prescale_factor=1.0, postscale_factor=1.0):
"""
A function that performs asynchronous averaging or summation of the input tensor
list over all the Horovod processes. The input tensors are not modified.
The reduction operations are keyed by the base name. If a base name is not
provided, an incremented auto-generated base name is used. Reductions are
performed across tensors in the same list position. The tensor type and
shape must be the same on all Horovod processes for tensors sharing
positions in the input tensor list. The reduction will not start until all
processes are ready to send and receive the tensors.
Arguments:
tensors: A list of tensors to reduce.
average:
.. warning:: .. deprecated:: 0.19.0
Use `op` instead. Will be removed in v0.21.0.
name: A base name to use for the group reduction operation.
op: The reduction operation to combine tensors across different
ranks. Defaults to Average if None is given.
prescale_factor: Multiplicative factor to scale tensor before allreduce.
postscale_factor: Multiplicative factor to scale tensor after allreduce.
Returns:
A handle to the group allreduce operation that can be used with `poll()` or
`synchronize()`.
"""
op = handle_average_backwards_compatibility(op, average)
outputs = [t.new(t.shape) for t in tensors]
return _grouped_allreduce_async(tensors, outputs, name, op, prescale_factor, postscale_factor)
class HorovodGroupedAllreduce(torch.autograd.Function):
"""An autograd function that performs allreduce on a list of tensors."""
@staticmethod
def forward(ctx, average, name, op, prescale_factor, postscale_factor, *tensors):
ctx.average = average
ctx.op = op
ctx.prescale_factor = prescale_factor
ctx.postscale_factor = postscale_factor
handle = grouped_allreduce_async(list(tensors), average, name, op, prescale_factor, postscale_factor)
return synchronize(handle)
@staticmethod
def backward(ctx, *grad_output):
grad_reduced = grouped_allreduce(list(grad_output), average=ctx.average, op=ctx.op,
prescale_factor=ctx.prescale_factor,
postscale_factor=ctx.postscale_factor)
return (None, None, None, None, None, *grad_reduced)
def grouped_allreduce(tensors, average=None, name=None, compression=Compression.none, op=None,
prescale_factor=1.0, postscale_factor=1.0):
"""
A function that performs averaging or summation of the input tensor
list over all the Horovod processes. The input tensors are not modified.
The reduction operations are keyed by the base name. If a base name is not
provided, an incremented auto-generated base name is used. Reductions are
performed across tensors in the same list position. The tensor type and
shape must be the same on all Horovod processes for tensors sharing
positions in the input tensor list. The reduction will not start until all
processes are ready to send and receive the tensors.
This acts as a thin wrapper around an autograd function. If your input
tensors require gradients, then calling this function will allow gradients
to be computed and backpropagated.
Arguments:
tensors: A list of tensors to reduce.
average:
.. warning:: .. deprecated:: 0.19.0
Use `op` instead. Will be removed in v0.21.0.
name: A base name to use for the group reduction operation.
compression: Compression algorithm used during allreduce to reduce the amount
of data sent during the each parameter update step. Defaults to
not using compression.
op: The reduction operation to combine tensors across different ranks. Defaults
to Average if None is given.
prescale_factor: Multiplicative factor to scale tensor before allreduce.
postscale_factor: Multiplicative factor to scale tensor after allreduce.
Returns:
A list containing tensors of the same shape and type as in `tensors`,
averaged or summed across all processes.
"""
tensors_compressed, ctxs = zip(*[compression.compress(t) for t in tensors])
summed_tensors_compressed = HorovodGroupedAllreduce.apply(average, name, op,
prescale_factor, postscale_factor,
*tensors_compressed)
return [compression.decompress(t, ctx) for t, ctx in zip(summed_tensors_compressed, ctxs)]
def grouped_allreduce_async_(tensors, average=None, name=None, op=None,
prescale_factor=1.0, postscale_factor=1.0):
"""
A function that performs asynchronous in-place averaging or summation of the input
tensors over all the Horovod processes.
The reduction operations are keyed by the base name. If a base name is not
provided, an incremented auto-generated base name is used. Reductions are
performed across tensors in the same list position. The tensor type and
shape must be the same on all Horovod processes for tensors sharing
positions in the input tensor list. The reduction will not start until all
processes are ready to send and receive the tensors.
Arguments:
tensors: A list of tensors to reduce.
average:
.. warning:: .. deprecated:: 0.19.0
Use `op` instead. Will be removed in v0.21.0.
name: A base name to use for the group reduction operation.
op: The reduction operation to combine tensors across different ranks. Defaults to
Average if None is given.
prescale_factor: Multiplicative factor to scale tensor before allreduce.
postscale_factor: Multiplicative factor to scale tensor after allreduce.
Returns:
A handle to the group allreduce operation that can be used with `poll()` or
`synchronize()`.
"""
op = handle_average_backwards_compatibility(op, average)
return _grouped_allreduce_async(tensors, tensors, name, op, prescale_factor, postscale_factor)
def grouped_allreduce_(tensors, average=None, name=None, op=None,
prescale_factor=1.0, postscale_factor=1.0):
"""
A function that performs in-place averaging or summation of the input tensors over
all the Horovod processes.
The reduction operations are keyed by the base name. If a base name is not
provided, an incremented auto-generated base name is used. Reductions are
performed across tensors in the same list position. The tensor type and
shape must be the same on all Horovod processes for tensors sharing
positions in the input tensor list. The reduction will not start until all
processes are ready to send and receive the tensors.
Arguments:
tensors: A list of tensors to reduce.
average:
.. warning:: .. deprecated:: 0.19.0
Use `op` instead. Will be removed in v0.21.0.
name: A base name to use for the group reduction operation.
op: The reduction operation to combine tensors across different ranks. Defaults to
Average if None is given.
prescale_factor: Multiplicative factor to scale tensor before allreduce.
postscale_factor: Multiplicative factor to scale tensor after allreduce.
Returns:
A list containing tensors of the same shape and type as in `tensors`,
averaged or summed across all processes.
"""
handle = grouped_allreduce_async_(tensors, average, name, op, prescale_factor, postscale_factor)
return synchronize(handle)
def sparse_allreduce_async(tensor, name, op):
# Allgather aggregates along the first dimension, so we need to transpose the
# indices to enforce correct concatenation behavior, then transpose back prior to
# constructing the new aggregated sparse gradient
t = tensor
indices_handle = allgather_async(t._indices().transpose(0, 1).contiguous(), name=f'{name}.indices')
values_handle = allgather_async(t._values(), name=f'{name}.values')
def handle():
indices = synchronize(indices_handle)
values = synchronize(values_handle)
values = (values / size()) if op == Average else values
if indices.dim() == 0 or values.dim() == 0:
return t.new().resize_as_(t)
return t.new(indices.transpose(0, 1), values, t.size())
return handle
def _allgather_function_factory(tensor):
return 'horovod_torch_allgather_async_' + tensor.type().replace('.', '_')
def _allgather_async(tensor, output, name):
function = _check_function(_allgather_function_factory, tensor)
try:
handle = getattr(mpi_lib, function)(
tensor, output, name.encode() if name is not None else _NULL)
except RuntimeError as e:
raise HorovodInternalError(e)
_handle_map[handle] = (tensor, output)
return handle
def allgather_async(tensor, name=None):
"""
A function that asynchronously concatenates the input tensor with the same input
tensor on all other Horovod processes. The input tensor is not modified.
The concatenation is done on the first dimension, so the input tensors on the
different processes must have the same rank and shape, except for the first
dimension, which is allowed to be different.
Arguments:
tensor: A tensor to allgather.
name: A name of the allgather operation.
Returns:
A handle to the allgather operation that can be used with `poll()` or
`synchronize()`.
"""
output = tensor.new()
return _allgather_async(tensor, output, name)
class HorovodAllgather(torch.autograd.Function):
"""An autograd function that performs allgather on a tensor."""
@staticmethod
def forward(ctx, tensor, name):
ctx.dim = tensor.shape[0]
handle = allgather_async(tensor, name)
return synchronize(handle)
@staticmethod
def backward(ctx, grad_output):
grad_reduced = allreduce(grad_output, average=True)
dim_t = torch.IntTensor([ctx.dim])
dim = allgather(dim_t).view(size())
r = rank()
offset = torch.sum(dim.narrow(0, 0, r)).item() if r != 0 else 0
return grad_reduced.narrow(0, offset, ctx.dim), None
def allgather(tensor, name=None):
"""
A function that concatenates the input tensor with the same input tensor on
all other Horovod processes. The input tensor is not modified.
The concatenation is done on the first dimension, so the input tensors on the
different processes must have the same rank and shape, except for the first
dimension, which is allowed to be different.
This acts as a thin wrapper around an autograd function. If your input
tensor requires gradients, then callings this function will allow gradients
to be computed and backpropagated.
Arguments:
tensor: A tensor to allgather.
name: A name of the allgather operation.
Returns:
A tensor of the same type as `tensor`, concatenated on dimension zero
across all processes. The shape is identical to the input shape, except for
the first dimension, which may be greater and is the sum of all first
dimensions of the tensors in different Horovod processes.
"""
return HorovodAllgather.apply(tensor, name)
def _broadcast_function_factory(tensor):
return 'horovod_torch_broadcast_async_' + tensor.type().replace('.', '_')
def _broadcast_async(tensor, output, root_rank, name):
function = _check_function(_broadcast_function_factory, tensor)
try:
handle = getattr(mpi_lib, function)(
tensor, output, root_rank, name.encode() if name is not None else _NULL)
except RuntimeError as e:
raise HorovodInternalError(e)
_handle_map[handle] = (tensor, output)
return handle
def broadcast_async(tensor, root_rank, name=None):
"""
A function that asynchronously broadcasts the input tensor on root rank to the same
input tensor on all other Horovod processes. The input tensor is not modified.
The broadcast operation is keyed by the name. If name is not provided, an incremented
auto-generated name is used. The tensor type and shape must be the same on all
Horovod processes for a given name. The broadcast will not start until all processes
are ready to send and receive the tensor.
Arguments:
tensor: A tensor to broadcast.
root_rank: The rank to broadcast the value from.
name: A name of the broadcast operation.
Returns:
A handle to the broadcast operation that can be used with `poll()` or
`synchronize()`.
"""
output = tensor.new(tensor.shape)
return _broadcast_async(tensor, output, root_rank, name)
class HorovodBroadcast(torch.autograd.Function):
"""An autograd function that broadcasts a tensor."""
@staticmethod
def forward(ctx, tensor, root_rank, name):
ctx.root_rank = root_rank
handle = broadcast_async(tensor, root_rank, name)
return synchronize(handle)
@staticmethod
def backward(ctx, grad_output):
grad_reduced = allreduce(grad_output, average=True)
if rank() != ctx.root_rank:
grad_reduced *= 0
return grad_reduced, None, None
def broadcast(tensor, root_rank, name=None):
"""
A function that broadcasts the input tensor on root rank to the same input tensor
on all other Horovod processes. The input tensor is not modified.
The broadcast operation is keyed by the name. If name is not provided, an incremented
auto-generated name is used. The tensor type and shape must be the same on all
Horovod processes for a given name. The broadcast will not start until all processes
are ready to send and receive the tensor.
This acts as a thin wrapper around an autograd function. If your input
tensor requires gradients, then callings this function will allow gradients
to be computed and backpropagated.
Arguments:
tensor: A tensor to broadcast.
root_rank: The rank to broadcast the value from.
name: A name of the broadcast operation.
Returns:
A tensor of the same shape and type as `tensor`, with the value broadcasted
from root rank.
"""
return HorovodBroadcast.apply(tensor, root_rank, name)
def broadcast_async_(tensor, root_rank, name=None):
"""
A function that asynchronously broadcasts the input tensor on root rank to the same
input tensor on all other Horovod processes. The operation is performed in-place.
The broadcast operation is keyed by the name. If name is not provided, an incremented
auto-generated name is used. The tensor type and shape must be the same on all
Horovod processes for a given name. The broadcast will not start until all processes
are ready to send and receive the tensor.
Arguments:
tensor: A tensor to broadcast.
root_rank: The rank to broadcast the value from.
name: A name of the broadcast operation.
Returns:
A handle to the broadcast operation that can be used with `poll()` or
`synchronize()`.
"""
return _broadcast_async(tensor, tensor, root_rank, name)
def broadcast_(tensor, root_rank, name=None):
"""
A function that broadcasts the input tensor on root rank to the same input tensor
on all other Horovod processes. The operation is performed in-place.
The broadcast operation is keyed by the name. If name is not provided, an incremented
auto-generated name is used. The tensor type and shape must be the same on all
Horovod processes for a given name. The broadcast will not start until all processes
are ready to send and receive the tensor.
Arguments:
tensor: A tensor to broadcast.
root_rank: The rank to broadcast the value from.
name: A name of the broadcast operation.
Returns:
A tensor of the same shape and type as `tensor`, with the value broadcasted
from root rank.
"""
handle = broadcast_async_(tensor, root_rank, name)
return synchronize(handle)
def _alltoall_function_factory(tensor):
return 'horovod_torch_alltoall_async_' + tensor.type().replace('.', '_')
def _alltoall_async(tensor, splits, output, output_received_splits, name):
if splits is None:
# If splits not provided, create empty tensor as placeholder
splits = torch.tensor([], dtype=torch.int32, device='cpu')
elif not isinstance(splits, torch.Tensor):
splits = torch.tensor(splits, dtype=torch.int32, device='cpu')
function = _check_function(_alltoall_function_factory, tensor)
try:
handle = getattr(mpi_lib, function)(
tensor, splits, output, output_received_splits, name.encode() if name is not None else _NULL)
except RuntimeError as e:
raise HorovodInternalError(e)
_handle_map[handle] = (tensor, splits, (output, output_received_splits))
return handle
def alltoall_async(tensor, splits=None, name=None):
"""
A function that scatters slices of the input tensor to all other Horovod processes
and returns a tensor of gathered slices from all other Horovod processes. The input
tensor is not modified.
The slicing is done on the first dimension, so the input tensors on
the different processes must have the same rank and shape, except for the
first dimension, which is allowed to be different.
Arguments:
tensor: A tensor to distribute with alltoall.
splits: A tensor of integers in rank order describing how many
elements in `tensor` to send to each worker. Splitting is
applied along the first dimension of `tensor`. If `splits` is
not provided, the first dimension is split equally by the
number of Horovod processes.
name: A name of the alltoall operation.
Returns:
A handle to the alltoall operation that can be used with `poll()` or
`synchronize()`.
"""
output = tensor.new()
if isinstance(splits, torch.Tensor):
output_received_splits = splits.new()
else:
output_received_splits = torch.empty(size(), dtype=torch.int32, device='cpu')
return _alltoall_async(tensor, splits, output, output_received_splits, name)
class HorovodAlltoall(torch.autograd.Function):
"""An autograd function that performs alltoall on a tensor."""
@staticmethod
def forward(ctx, tensor, splits, name):
handle = alltoall_async(tensor, splits, name)
output, received_splits = synchronize(handle)
ctx.recvsplits = received_splits
if splits is None:
return output
else:
ctx.mark_non_differentiable(received_splits)
return output, received_splits
@staticmethod
def backward(ctx, grad_output, *dead_gradients):
grad_wrt_tensor, _ = alltoall(grad_output, splits=ctx.recvsplits)
return grad_wrt_tensor, None, None
def alltoall(tensor, splits=None, name=None):
"""
A function that scatters slices of the input tensor to all other Horovod processes
and returns a tensor of gathered slices from all other Horovod processes. The input
tensor is not modified.
The slicing is done on the first dimension, so the input tensors on
the different processes must have the same rank and shape, except for the
first dimension, which is allowed to be different.
This acts as a thin wrapper around an autograd function. If your input
tensor requires gradients, then callings this function will allow gradients
to be computed and backpropagated.
Arguments:
tensor: A tensor to distribute with alltoall.
splits: A tensor of integers in rank order describing how many
elements in `tensor` to send to each worker. Splitting is
applied along the first dimension of `tensor`. If `splits` is
not provided, the first dimension is split equally by the
number of Horovod processes.
name: A name of the alltoall operation.
Returns:
1) A tensor containing the gathered tensor data from all workers.
2) If `splits` has been provided: A tensor of integers in rank order
describing how many elements in the output tensor have been received
from each worker.
"""
return HorovodAlltoall.apply(tensor, splits, name)
def poll(handle):
"""
Polls an allreduce, allgather or broadcast handle to determine whether underlying
asynchronous operation has completed. After `poll()` returns `True`, `synchronize()`
will return without blocking.
Arguments:
handle: A handle returned by an allreduce, allgather or broadcast asynchronous
operation.
Returns:
A flag indicating whether the operation has completed.
"""
return mpi_lib.horovod_torch_poll(handle) != 0
def synchronize(handle):
"""
Synchronizes an asynchronous allreduce, allgather, alltoall or broadcast operation until
it's completed. Returns the result of the operation.
Arguments:
handle: A handle returned by an allreduce, allgather, alltoall or broadcast asynchronous
operation.
Returns:
A single output tensor of the operation or a tuple of multiple output tensors.
"""
if handle not in _handle_map:
return
try:
mpi_lib.horovod_torch_wait_and_clear(handle)
output = _handle_map.pop(handle)[-1]
return output
except RuntimeError as e:
raise HorovodInternalError(e)
def join(device=-1):
"""A function that indicates that the rank finished processing data.
All ranks that did not call join() continue to process allreduce operations.
This function blocks Python thread until all ranks join.
Arguments:
device: An id of the device to create temprorary zero tensors (default -1, CPU)
Returns:
Id of the rank that joined last.
"""
try:
return mpi_lib.horovod_torch_join(device)
except RuntimeError as e:
raise HorovodInternalError(e)
| 41.08686
| 132
| 0.685521
| 4,825
| 36,896
| 5.139689
| 0.088497
| 0.022582
| 0.014678
| 0.021049
| 0.774507
| 0.752934
| 0.727973
| 0.705956
| 0.687729
| 0.6791
| 0
| 0.005648
| 0.251382
| 36,896
| 897
| 133
| 41.132664
| 0.892183
| 0.520219
| 0
| 0.449848
| 0
| 0
| 0.067796
| 0.013164
| 0
| 0
| 0
| 0
| 0
| 1
| 0.130699
| false
| 0
| 0.021277
| 0.018237
| 0.306991
| 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
|
8a2c109b5e273d0a69f2c463552597c6ca6fbda4
| 222
|
py
|
Python
|
nimare/base/annotate.py
|
Julio-Yanes/NiMARE
|
36bb05034041998519814b55fe402489147fdd63
|
[
"MIT"
] | null | null | null |
nimare/base/annotate.py
|
Julio-Yanes/NiMARE
|
36bb05034041998519814b55fe402489147fdd63
|
[
"MIT"
] | null | null | null |
nimare/base/annotate.py
|
Julio-Yanes/NiMARE
|
36bb05034041998519814b55fe402489147fdd63
|
[
"MIT"
] | null | null | null |
"""
Base classes for meta-analytic annotation methods.
"""
from .base import NiMAREBase
class AnnotationModel(NiMAREBase):
"""
Base class for topic and vector models.
"""
def __init__(self):
pass
| 17.076923
| 50
| 0.666667
| 25
| 222
| 5.76
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.234234
| 222
| 12
| 51
| 18.5
| 0.847059
| 0.405405
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0.25
| 0.25
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 4
|
8a4d38c0db2017ef38f5a1f2eaaacc5251512936
| 76
|
py
|
Python
|
security/backends/logging/__init__.py
|
druids/django-security
|
bca889ff1a58378a038a08ca365162d9e3ef3fbf
|
[
"MIT"
] | 9
|
2019-03-12T12:31:20.000Z
|
2021-01-22T13:31:36.000Z
|
security/backends/logging/__init__.py
|
druids/django-security
|
bca889ff1a58378a038a08ca365162d9e3ef3fbf
|
[
"MIT"
] | 28
|
2019-12-05T12:20:49.000Z
|
2022-03-25T08:15:10.000Z
|
security/backends/logging/__init__.py
|
druids/django-security
|
bca889ff1a58378a038a08ca365162d9e3ef3fbf
|
[
"MIT"
] | 5
|
2019-07-10T15:29:44.000Z
|
2021-02-01T12:50:56.000Z
|
default_app_config = 'security.backends.logging.app.SecurityLoggingBackend'
| 38
| 75
| 0.868421
| 8
| 76
| 8
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.039474
| 76
| 1
| 76
| 76
| 0.876712
| 0
| 0
| 0
| 0
| 0
| 0.684211
| 0.684211
| 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
|
8aa0625d67ae374942ecb586fde9a37dd06e794b
| 63
|
py
|
Python
|
Retired/Differences of Triangles.py
|
mwk0408/codewars_solutions
|
9b4f502b5f159e68024d494e19a96a226acad5e5
|
[
"MIT"
] | 6
|
2020-09-03T09:32:25.000Z
|
2020-12-07T04:10:01.000Z
|
Retired/Differences of Triangles.py
|
mwk0408/codewars_solutions
|
9b4f502b5f159e68024d494e19a96a226acad5e5
|
[
"MIT"
] | 1
|
2021-12-13T15:30:21.000Z
|
2021-12-13T15:30:21.000Z
|
Retired/Differences of Triangles.py
|
mwk0408/codewars_solutions
|
9b4f502b5f159e68024d494e19a96a226acad5e5
|
[
"MIT"
] | null | null | null |
def diff_of_tri_numbers(n, m):
return n*(n+1)//2-m*(m+1)//2
| 31.5
| 32
| 0.603175
| 16
| 63
| 2.1875
| 0.625
| 0.114286
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.072727
| 0.126984
| 63
| 2
| 32
| 31.5
| 0.563636
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 0
| 0
| 0.5
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 4
|
8aa7b77687addd0d37ec023a06eb5efeaf919379
| 174
|
py
|
Python
|
Admin_Automation-master/www/cgi-bin/caas/caas_pyton.py
|
agirishkumar/Automate-admin-tasks
|
1eb9a6f0aa8a65d09abef69b9b1cc42816c4043f
|
[
"MIT"
] | null | null | null |
Admin_Automation-master/www/cgi-bin/caas/caas_pyton.py
|
agirishkumar/Automate-admin-tasks
|
1eb9a6f0aa8a65d09abef69b9b1cc42816c4043f
|
[
"MIT"
] | null | null | null |
Admin_Automation-master/www/cgi-bin/caas/caas_pyton.py
|
agirishkumar/Automate-admin-tasks
|
1eb9a6f0aa8a65d09abef69b9b1cc42816c4043f
|
[
"MIT"
] | null | null | null |
#!/usr/bin/python36
print("content-type: text/html")
import subprocess as sp
import cgi
import cgitb
cgitb.enable()
print("location: http://192.168.43.125:3200")
print()
| 13.384615
| 45
| 0.724138
| 27
| 174
| 4.666667
| 0.814815
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.109677
| 0.109195
| 174
| 12
| 46
| 14.5
| 0.703226
| 0.103448
| 0
| 0
| 0
| 0
| 0.380645
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.428571
| 0
| 0.428571
| 0.428571
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
|
0
| 4
|
8abc74711c870ba2d5649f99ad630f849f79254f
| 152
|
py
|
Python
|
__init__.py
|
lz677/Alien-Invasion
|
a9f4e84944bfee2136cd7abacf71a77cc15e2275
|
[
"MIT"
] | null | null | null |
__init__.py
|
lz677/Alien-Invasion
|
a9f4e84944bfee2136cd7abacf71a77cc15e2275
|
[
"MIT"
] | null | null | null |
__init__.py
|
lz677/Alien-Invasion
|
a9f4e84944bfee2136cd7abacf71a77cc15e2275
|
[
"MIT"
] | null | null | null |
# /usr/bin/python3
# -*- coding: utf-8 -*-
# @Author : Zhe LIU
# @Email : 937150058@qq.com
# @File : __init__.py.py
# @Time : 2019/8/28 15:28
| 19
| 29
| 0.559211
| 23
| 152
| 3.521739
| 0.869565
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.188034
| 0.230263
| 152
| 7
| 30
| 21.714286
| 0.504274
| 0.907895
| 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
|
8acd78f2f9ec3e8b967e8a292da4e943feb79771
| 171
|
py
|
Python
|
emol/emol/views/__init__.py
|
lrt512/emol
|
e1dd3462632a525c3b9701d4fd9a332d19c93b85
|
[
"MIT"
] | null | null | null |
emol/emol/views/__init__.py
|
lrt512/emol
|
e1dd3462632a525c3b9701d4fd9a332d19c93b85
|
[
"MIT"
] | null | null | null |
emol/emol/views/__init__.py
|
lrt512/emol
|
e1dd3462632a525c3b9701d4fd9a332d19c93b85
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
"""Module for flask views.
Only the home page view is defined in this scope. All other views are defined
in nested modules for partitioning.
"""
| 21.375
| 77
| 0.707602
| 27
| 171
| 4.481481
| 0.851852
| 0.14876
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.007194
| 0.187135
| 171
| 7
| 78
| 24.428571
| 0.863309
| 0.94152
| 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
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.