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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3dc4895f3e285719c3414694717e526da04af8f4
| 4,339
|
py
|
Python
|
test/_deprecated/test_field.py
|
giladbarnea/timefred
|
36cc8b0f09d38c0ed7b3e659ce337a75cd8b0c60
|
[
"MIT"
] | null | null | null |
test/_deprecated/test_field.py
|
giladbarnea/timefred
|
36cc8b0f09d38c0ed7b3e659ce337a75cd8b0c60
|
[
"MIT"
] | null | null | null |
test/_deprecated/test_field.py
|
giladbarnea/timefred
|
36cc8b0f09d38c0ed7b3e659ce337a75cd8b0c60
|
[
"MIT"
] | null | null | null |
import inspect
import re
from test.testutils import assert_raises
from timefred.dikt import Field
from timefred.dikt.dikt import UNSET
def test__get__():
class HasField:
foo = Field()
has_field = HasField()
with assert_raises(AttributeError, re.compile(r"HasField\.foo is unset")):
getattr(has_field, 'foo')
class HasFieldWithDefault:
foo = Field(default='bar')
has_field_w_default = HasFieldWithDefault()
assert has_field_w_default.foo == 'bar'
class HasFieldWithDefaultFactory:
foo = Field(default_factory=list)
has_field_w_default_factory = HasFieldWithDefaultFactory()
assert has_field_w_default_factory.foo == list()
class HasFieldWithDefaultValueAndFactory:
foo = Field(default='hi', default_factory=list)
has_field_w_default_val_and_factory = HasFieldWithDefaultValueAndFactory()
assert has_field_w_default_val_and_factory.foo == ['h', 'i']
def testcached_value():
class HasFieldWithDefault:
foo = Field(default='bar')
has_field_w_default = HasFieldWithDefault()
foo_field = inspect.getattr_static(has_field_w_default, 'foo')
assert foo_field.cached_value is UNSET
assert has_field_w_default.foo == 'bar'
assert foo_field.cached_value == 'bar'
class HasFieldWithDefaultFactory:
foo = Field(default_factory=list)
has_field_w_default_factory = HasFieldWithDefaultFactory()
foo_field = inspect.getattr_static(has_field_w_default_factory, 'foo')
assert foo_field.cached_value is UNSET
assert has_field_w_default_factory.foo == list()
assert foo_field.cached_value == list()
class HasFieldWithDefaultValueAndFactory:
foo = Field(default=1, default_factory=lambda x:x+1)
has_field_w_default_val_and_factory = HasFieldWithDefaultValueAndFactory()
foo_field = inspect.getattr_static(has_field_w_default_val_and_factory, 'foo')
assert foo_field.cached_value is UNSET
assert has_field_w_default_val_and_factory.foo == 2
assert has_field_w_default_val_and_factory.foo == 2
assert foo_field.cached_value == 2
def test__set__():
class HasField:
foo = Field()
def __init__(self, foo) -> None:
self.foo = foo
has_field = HasField("bar")
assert has_field.foo == "bar"
class HasFieldWithDefaultFactory:
foo = Field(default_factory=str)
increases = Field(default_factory=lambda x:x+1)
def __init__(self, foo) -> None:
self.foo = foo
has_field_w_default_factory = HasFieldWithDefaultFactory(42)
foo_field = inspect.getattr_static(has_field_w_default_factory, 'foo')
assert foo_field.cached_value is UNSET # cached_value is only set in __get__, after applying default_factory
assert has_field_w_default_factory.foo == '42'
assert foo_field.cached_value == '42'
has_field_w_default_factory.foo = 1337
assert foo_field.cached_value is UNSET # cached_value = UNSET in __set__
assert has_field_w_default_factory.foo == '1337'
assert foo_field.cached_value == '1337'
increases_field = inspect.getattr_static(has_field_w_default_factory, 'increases')
assert increases_field.cached_value is UNSET
has_field_w_default_factory.increases = 1
assert increases_field.cached_value is UNSET
assert has_field_w_default_factory.increases == 2
assert increases_field.cached_value == 2
# does not increase if has cached_value:
assert has_field_w_default_factory.increases == 2
assert increases_field.cached_value == 2
has_field_w_default_factory.increases = 10
assert increases_field.cached_value is UNSET
assert has_field_w_default_factory.increases == 11
assert increases_field.cached_value == 11
# does not increase if has cached_value:
assert has_field_w_default_factory.increases == 11
assert increases_field.cached_value == 11
def test__delete__():
class HasField:
foo = Field()
def __init__(self, foo) -> None:
self.foo = foo
has_field = HasField("bar")
assert has_field.foo == "bar"
del has_field.foo
with assert_raises(AttributeError, re.compile(r"HasField\.foo is unset")):
getattr(has_field, 'foo')
foo_field = inspect.getattr_static(has_field, 'foo')
assert foo_field.cached_value is UNSET
| 33.376923
| 113
| 0.73381
| 572
| 4,339
| 5.176573
| 0.113636
| 0.099966
| 0.085106
| 0.1513
| 0.89463
| 0.862884
| 0.771023
| 0.717663
| 0.627828
| 0.559271
| 0
| 0.011067
| 0.187831
| 4,339
| 129
| 114
| 33.635659
| 0.829171
| 0.040793
| 0
| 0.666667
| 0
| 0
| 0.028145
| 0
| 0
| 0
| 0
| 0
| 0.387097
| 1
| 0.075269
| false
| 0
| 0.053763
| 0
| 0.354839
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
3dd150dd361f79094d784a29a7864bee0356f911
| 144
|
py
|
Python
|
utils/__init__.py
|
LindgeW/TextLevelGNN
|
e63c80a4be553c3f55c4810d736c46d7b98e7369
|
[
"Apache-2.0"
] | 40
|
2020-09-08T12:41:25.000Z
|
2022-02-09T08:22:36.000Z
|
utils/__init__.py
|
LindgeW/TextLevelGNN
|
e63c80a4be553c3f55c4810d736c46d7b98e7369
|
[
"Apache-2.0"
] | 10
|
2020-09-11T01:30:12.000Z
|
2021-05-28T12:00:32.000Z
|
utils/__init__.py
|
LindgeW/TextLevelGNN
|
e63c80a4be553c3f55c4810d736c46d7b98e7369
|
[
"Apache-2.0"
] | 6
|
2020-09-18T02:39:30.000Z
|
2021-08-19T06:13:31.000Z
|
# -*- coding: utf-8 -*-
# @Time : 2020/9/7 9:38
# @Author : wlz
# @Project : TextLevelGNN
# @File : __init__.py.py
# @Software: PyCharm
| 24
| 27
| 0.569444
| 19
| 144
| 4.105263
| 0.894737
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.09009
| 0.229167
| 144
| 6
| 28
| 24
| 0.612613
| 0.916667
| 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
|
9a745e7c955fa3c613db4c54db3ae7ade9865cf3
| 25
|
py
|
Python
|
engineering_tool/__init__.py
|
pinyoothotaboot/engineering_tool
|
9a97335f4fb41d5715a412d9e7d9ecda0475cf68
|
[
"MIT"
] | 3
|
2018-09-04T17:03:01.000Z
|
2018-09-12T17:53:17.000Z
|
engineering_tool/__init__.py
|
pinyoothotaboot/engineering_tool
|
9a97335f4fb41d5715a412d9e7d9ecda0475cf68
|
[
"MIT"
] | null | null | null |
engineering_tool/__init__.py
|
pinyoothotaboot/engineering_tool
|
9a97335f4fb41d5715a412d9e7d9ecda0475cf68
|
[
"MIT"
] | null | null | null |
name = "engineering_tool"
| 25
| 25
| 0.8
| 3
| 25
| 6.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.08
| 25
| 1
| 25
| 25
| 0.826087
| 0
| 0
| 0
| 0
| 0
| 0.615385
| 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
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
9a79361d9538980b9b41c77ba63da00415a5219c
| 722
|
py
|
Python
|
Solutions/6_7/portfolio.py
|
senon/practical-python
|
40a3f124366798bdea051afe6e20f16de8a3c002
|
[
"CC-BY-4.0"
] | 1
|
2021-01-30T16:11:38.000Z
|
2021-01-30T16:11:38.000Z
|
Solutions/6_7/portfolio.py
|
senon/practical-python
|
40a3f124366798bdea051afe6e20f16de8a3c002
|
[
"CC-BY-4.0"
] | null | null | null |
Solutions/6_7/portfolio.py
|
senon/practical-python
|
40a3f124366798bdea051afe6e20f16de8a3c002
|
[
"CC-BY-4.0"
] | 1
|
2021-01-30T16:11:46.000Z
|
2021-01-30T16:11:46.000Z
|
# portfolio.py
class Portfolio:
def __init__(self, holdings):
self._holdings = holdings
def __iter__(self):
return self._holdings.__iter__()
def __len__(self):
return len(self._holdings)
def __getitem__(self, index):
return self._holdings[index]
def __contains__(self, name):
return any([s.name == name for s in self._holdings])
@property
def total_cost(self):
return sum([s.shares * s.price for s in self._holdings])
def tabulate_shares(self):
from collections import Counter
total_shares = Counter()
for s in self._holdings:
total_shares[s.name] += s.shares
return total_shares
| 22.5625
| 64
| 0.623269
| 88
| 722
| 4.704545
| 0.329545
| 0.231884
| 0.043478
| 0.072464
| 0.130435
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.283934
| 722
| 31
| 65
| 23.290323
| 0.800774
| 0.016621
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.35
| false
| 0
| 0.05
| 0.25
| 0.75
| 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
|
9a85ec22a6f950f6034e30a371f4b6597b3be791
| 56
|
py
|
Python
|
code/abc152_b_01.py
|
KoyanagiHitoshi/AtCoder
|
731892543769b5df15254e1f32b756190378d292
|
[
"MIT"
] | 3
|
2019-08-16T16:55:48.000Z
|
2021-04-11T10:21:40.000Z
|
code/abc152_b_01.py
|
KoyanagiHitoshi/AtCoder
|
731892543769b5df15254e1f32b756190378d292
|
[
"MIT"
] | null | null | null |
code/abc152_b_01.py
|
KoyanagiHitoshi/AtCoder
|
731892543769b5df15254e1f32b756190378d292
|
[
"MIT"
] | null | null | null |
a,b=input().split()
print(a*int(b) if a<b else b*int(a))
| 28
| 36
| 0.625
| 15
| 56
| 2.333333
| 0.533333
| 0.114286
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.089286
| 56
| 2
| 36
| 28
| 0.686275
| 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
|
9ac2d0262cc080b5fc0c8432b36dca575486b5ac
| 36
|
py
|
Python
|
src/benchmark/__init__.py
|
renkekuhlmann/gams-benchmark
|
91a5a5ee5ba97de63fbbc4c2b6f0b25c5897caf6
|
[
"MIT"
] | null | null | null |
src/benchmark/__init__.py
|
renkekuhlmann/gams-benchmark
|
91a5a5ee5ba97de63fbbc4c2b6f0b25c5897caf6
|
[
"MIT"
] | null | null | null |
src/benchmark/__init__.py
|
renkekuhlmann/gams-benchmark
|
91a5a5ee5ba97de63fbbc4c2b6f0b25c5897caf6
|
[
"MIT"
] | null | null | null |
""" Initialization of Benchmark """
| 18
| 35
| 0.694444
| 3
| 36
| 8.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.138889
| 36
| 1
| 36
| 36
| 0.806452
| 0.75
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
b101cb433ca73c61a870e8b8b2b2cb15d590a639
| 869
|
py
|
Python
|
osm_nbi/dbbase.py
|
ed1000/osm_nbi_flask
|
d942b4d8aecea0a10b07a466d1694151636d9e7b
|
[
"Apache-2.0"
] | null | null | null |
osm_nbi/dbbase.py
|
ed1000/osm_nbi_flask
|
d942b4d8aecea0a10b07a466d1694151636d9e7b
|
[
"Apache-2.0"
] | null | null | null |
osm_nbi/dbbase.py
|
ed1000/osm_nbi_flask
|
d942b4d8aecea0a10b07a466d1694151636d9e7b
|
[
"Apache-2.0"
] | 1
|
2022-03-15T15:45:57.000Z
|
2022-03-15T15:45:57.000Z
|
from http import HTTPStatus
__author__ = "Alfonso Tierno <alfonso.tiernosepulveda@telefonica.com>"
class DbException(Exception):
def __init__(self, message, http_code=HTTPStatus.NOT_FOUND):
# TODO change to http.HTTPStatus instead of int that allows .value and .name
self.http_code = http_code
Exception.__init__(self, "database exception " + message)
class DbBase(object):
def __init__(self):
pass
def db_connect(self, config):
pass
def db_disconnect(self):
pass
def get_list(self, table, filter={}):
pass
def get_one(self, table, filter={}, fail_on_empty=True, fail_on_more=True):
pass
def create(self, table, indata):
pass
def del_list(self, table, filter={}):
pass
def del_one(self, table, filter={}, fail_on_empty=True):
pass
| 22.282051
| 84
| 0.652474
| 111
| 869
| 4.81982
| 0.468468
| 0.091589
| 0.11215
| 0.071028
| 0.220561
| 0.220561
| 0.123364
| 0.123364
| 0
| 0
| 0
| 0
| 0.247411
| 869
| 38
| 85
| 22.868421
| 0.818043
| 0.085155
| 0
| 0.347826
| 0
| 0
| 0.093317
| 0.050441
| 0
| 0
| 0
| 0.026316
| 0
| 1
| 0.391304
| false
| 0.347826
| 0.043478
| 0
| 0.521739
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 4
|
b1048e735a0c1d4a20fda92e859e258da33c9c11
| 75
|
py
|
Python
|
drone_control/stop.py
|
maxhchen/eecs149-final-project
|
4b3fd66c59d2f60f85006c8781fbb5eb0e50723a
|
[
"MIT"
] | 1
|
2022-01-15T20:26:47.000Z
|
2022-01-15T20:26:47.000Z
|
drone_control/stop.py
|
maxhchen/eecs149-final-project
|
4b3fd66c59d2f60f85006c8781fbb5eb0e50723a
|
[
"MIT"
] | null | null | null |
drone_control/stop.py
|
maxhchen/eecs149-final-project
|
4b3fd66c59d2f60f85006c8781fbb5eb0e50723a
|
[
"MIT"
] | null | null | null |
from djitellopy import Tello
tello = Tello()
tello.connect()
tello.land()
| 12.5
| 28
| 0.746667
| 10
| 75
| 5.6
| 0.6
| 0.535714
| 0.535714
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.133333
| 75
| 5
| 29
| 15
| 0.861538
| 0
| 0
| 0
| 0
| 0
| 0
| 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
|
b10d0f044b186b957d87fde9a7a42d096c50aad8
| 14,117
|
py
|
Python
|
neo/test/iotest/test_asciisignalio.py
|
Warfley/python-neo
|
875e23a417e1a65d5cb45403e6e3261155e2741d
|
[
"BSD-3-Clause"
] | 1
|
2020-06-08T14:00:03.000Z
|
2020-06-08T14:00:03.000Z
|
neo/test/iotest/test_asciisignalio.py
|
Warfley/python-neo
|
875e23a417e1a65d5cb45403e6e3261155e2741d
|
[
"BSD-3-Clause"
] | 22
|
2016-09-13T13:31:25.000Z
|
2019-05-14T17:07:16.000Z
|
neo/test/iotest/test_asciisignalio.py
|
Warfley/python-neo
|
875e23a417e1a65d5cb45403e6e3261155e2741d
|
[
"BSD-3-Clause"
] | null | null | null |
"""
Tests of neo.io.asciisignalio
"""
import os
import unittest
import json
import csv
import numpy as np
import quantities as pq
from numpy.testing import assert_array_almost_equal, assert_array_equal
from neo.io import AsciiSignalIO
from neo.test.iotest.common_io_test import BaseTestIO
from neo.core import AnalogSignal, Segment, Block
class TestAsciiSignalIOWithTestFiles(BaseTestIO, unittest.TestCase):
ioclass = AsciiSignalIO
files_to_download = [ # 'File_asciisignal_1.asc',
'File_asciisignal_2.txt',
'File_asciisignal_3.txt',
]
files_to_test = files_to_download
class TestAsciiSignalIO(unittest.TestCase):
def test_genfromtxt_expect_success(self):
sample_data = np.random.uniform(size=(200, 3))
filename = "test_genfromtxt_expect_success.txt"
np.savetxt(filename, sample_data, delimiter=' ')
sampling_rate = 1 * pq.kHz
io = AsciiSignalIO(filename, sampling_rate=sampling_rate, delimiter=' ',
units='mV', method='genfromtxt')
block = io.read_block()
signal1 = block.segments[0].analogsignals[1]
assert_array_almost_equal(signal1.reshape(-1).magnitude, sample_data[:, 1],
decimal=6)
self.assertEqual(len(block.segments[0].analogsignals), 3)
self.assertEqual(signal1.t_stop, sample_data.shape[0] / sampling_rate)
self.assertEqual(signal1.units, pq.mV)
os.remove(filename)
# test_genfromtxt_expect_failure
def test_csv_expect_success(self):
filename = 'test_csv_expect_success.csv'
sample_data = [
(-65, -65, -65, 0.5),
(-64.8, -64.5, -64.0, 0.6),
(-64.6, -64.2, -77.0, 0.7),
(-64.3, -64.0, -99.9, 0.8)
]
with open(filename, 'w') as csvfile:
writer = csv.writer(csvfile, delimiter=',',
quotechar='|', quoting=csv.QUOTE_MINIMAL)
for row in sample_data:
writer.writerow(row)
io = AsciiSignalIO(filename, usecols=(0, 1, 3), timecolumn=2,
# note that timecolumn applies to the remaining columns
# after applying usecols
time_units="ms", delimiter=',', units="mV", method='csv',
signal_group_mode='all-in-one', t_start=0.5)
block = io.read_block()
signal = block.segments[0].analogsignals[0]
self.assertEqual(signal.shape, (4, 2)) # two columns remaining after usecols
# and timecolumn applied
assert_array_almost_equal(signal[:, 1].reshape(-1).magnitude,
np.array(sample_data)[:, 1],
decimal=5)
self.assertAlmostEqual(signal.sampling_period, 0.1 * pq.ms)
os.remove(filename)
# test_csv_expect_failure
# test_homemade_expect_success
def test_homemade_expect_success(self):
filename = 'test_homemade_expect_success.txt'
sample_data = [
(-65, -65, -65, 0.5),
(-64.8, -64.5, -64.0, 0.6),
(-64.6, -64.2, -77.0, 0.7),
(-64.3, -64.0, -99.9, 0.8)
]
with open(filename, 'w') as datafile:
datafile.write("# a comment\n")
for row in sample_data:
datafile.write("\t ".join(map(str, row)) + "\t\n")
io = AsciiSignalIO(filename, usecols=(0, 1, 3), timecolumn=2, skiprows=1,
time_units="ms", delimiter='\t', units="mV", method='homemade',
signal_group_mode='all-in-one', t_start=0.5)
block = io.read_block()
signal = block.segments[0].analogsignals[0]
self.assertEqual(signal.shape, (4, 2)) # two columns remaining after usecols
# and timecolumn applied
assert_array_almost_equal(signal[:, 1].reshape(-1).magnitude,
np.array(sample_data)[:, 1],
decimal=5)
self.assertAlmostEqual(signal.sampling_period, 0.1 * pq.ms)
os.remove(filename)
# test_homemade_expect_failure
def test_callable_expect_success(self):
sample_data = np.random.uniform(size=(200, 3))
filename = "test_genfromtxt_expect_success.txt"
np.savetxt(filename, sample_data, delimiter=' ')
sampling_rate = 1 * pq.kHz
def reader(filename, comment_rows):
return np.genfromtxt(filename, delimiter=' ', usecols=None,
skip_header=comment_rows or 0, dtype='f')
io = AsciiSignalIO(filename, sampling_rate=sampling_rate, delimiter=' ',
units='mV', method=reader)
block = io.read_block()
signal1 = block.segments[0].analogsignals[1]
assert_array_almost_equal(signal1.reshape(-1).magnitude, sample_data[:, 1],
decimal=6)
self.assertEqual(len(block.segments[0].analogsignals), 3)
self.assertEqual(signal1.t_stop, sample_data.shape[0] / sampling_rate)
self.assertEqual(signal1.units, pq.mV)
os.remove(filename)
# test usecols
# test skiprows
def test_timecolumn(self):
sample_data = np.random.uniform(size=(200, 3))
sampling_period = 0.5
time_data = sampling_period * np.arange(sample_data.shape[0])
combined_data = np.hstack((sample_data, time_data[:, np.newaxis]))
filename = "test_multichannel.txt"
np.savetxt(filename, combined_data, delimiter=' ')
io = AsciiSignalIO(filename, delimiter=' ',
units='mV', method='genfromtxt', timecolumn=-1,
time_units='ms', signal_group_mode='split-all')
block = io.read_block()
signal1 = block.segments[0].analogsignals[1]
assert_array_almost_equal(signal1.reshape(-1).magnitude, sample_data[:, 1],
decimal=6)
self.assertEqual(signal1.sampling_period, sampling_period * pq.ms)
self.assertEqual(len(block.segments[0].analogsignals), 3)
self.assertEqual(signal1.t_stop, sample_data.shape[0] * sampling_period * pq.ms)
self.assertEqual(signal1.units, pq.mV)
os.remove(filename)
def test_multichannel(self):
sample_data = np.random.uniform(size=(200, 3))
filename = "test_multichannel.txt"
np.savetxt(filename, sample_data, delimiter=' ')
sampling_rate = 1 * pq.kHz
io = AsciiSignalIO(filename, sampling_rate=sampling_rate, delimiter=' ',
units='mV', method='genfromtxt',
signal_group_mode='all-in-one')
block = io.read_block()
signal = block.segments[0].analogsignals[0]
assert_array_almost_equal(signal.magnitude, sample_data,
decimal=6)
self.assertEqual(len(block.segments[0].analogsignals), 1)
self.assertEqual(signal.t_stop, sample_data.shape[0] / sampling_rate)
self.assertEqual(signal.units, pq.mV)
os.remove(filename)
def test_multichannel_with_timecolumn(self):
sample_data = np.random.uniform(size=(200, 3))
sampling_period = 0.5
time_data = sampling_period * np.arange(sample_data.shape[0])
combined_data = np.hstack((time_data[:, np.newaxis], sample_data))
filename = "test_multichannel.txt"
np.savetxt(filename, combined_data, delimiter=' ')
io = AsciiSignalIO(filename, delimiter=' ',
units='mV', method='genfromtxt', timecolumn=0,
time_units='ms',
signal_group_mode='all-in-one')
block = io.read_block()
signal = block.segments[0].analogsignals[0]
assert_array_almost_equal(signal.magnitude, sample_data,
decimal=6)
self.assertEqual(signal.sampling_period, sampling_period * pq.ms)
self.assertEqual(len(block.segments[0].analogsignals), 1)
self.assertEqual(signal.t_stop, sample_data.shape[0] * sampling_period * pq.ms)
self.assertEqual(signal.units, pq.mV)
os.remove(filename)
def test_multichannel_with_negative_timecolumn(self):
sample_data = np.random.uniform(size=(200, 3))
sampling_period = 0.5
time_data = sampling_period * np.arange(sample_data.shape[0])
combined_data = np.hstack((sample_data, time_data[:, np.newaxis]))
filename = "test_multichannel.txt"
np.savetxt(filename, combined_data, delimiter=' ')
io = AsciiSignalIO(filename, delimiter=' ',
units='mV', method='genfromtxt', timecolumn=-1,
time_units='ms',
signal_group_mode='all-in-one')
block = io.read_block()
signal = block.segments[0].analogsignals[0]
assert_array_almost_equal(signal.magnitude, sample_data,
decimal=6)
self.assertEqual(signal.sampling_period, sampling_period * pq.ms)
self.assertEqual(len(block.segments[0].analogsignals), 1)
self.assertEqual(signal.t_stop, sample_data.shape[0] * sampling_period * pq.ms)
self.assertEqual(signal.units, pq.mV)
os.remove(filename)
# test write without timecolumn
# test write with timecolumn
# test write with units/timeunits different from those of signal
def test_read_with_json_metadata(self):
sample_data = np.random.uniform(size=(200, 3))
filename = "test_read_with_json_metadata.txt"
metadata_filename = "test_read_with_json_metadata_about.json"
np.savetxt(filename, sample_data, delimiter=' ')
metadata = {
"filename": filename,
"delimiter": " ",
"timecolumn": None,
"units": "mV",
"time_units": "ms",
"sampling_rate": {
"value": 1.0,
"units": "kHz"
},
"method": "genfromtxt",
"signal_group_mode": 'split-all'
}
with open(metadata_filename, "w") as fp:
json.dump(metadata, fp)
expected_sampling_rate = 1 * pq.kHz
io = AsciiSignalIO(filename)
block = io.read_block()
signal1 = block.segments[0].analogsignals[1]
assert_array_almost_equal(signal1.reshape(-1).magnitude, sample_data[:, 1],
decimal=6)
self.assertEqual(len(block.segments[0].analogsignals), 3)
self.assertEqual(signal1.sampling_rate, expected_sampling_rate)
self.assertEqual(signal1.t_stop, sample_data.shape[0] / signal1.sampling_rate)
self.assertEqual(signal1.units, pq.mV)
os.remove(filename)
os.remove(metadata_filename)
def test_roundtrip_with_json_metadata(self):
sample_data = np.random.uniform(size=(200, 3))
filename = "test_roundtrip_with_json_metadata.txt"
metadata_filename = "test_roundtrip_with_json_metadata_about.json"
signal1 = AnalogSignal(sample_data, units="pA", sampling_rate=2 * pq.kHz)
seg1 = Segment()
block1 = Block()
seg1.analogsignals.append(signal1)
seg1.block = block1
block1.segments.append(seg1)
iow = AsciiSignalIO(filename, metadata_filename=metadata_filename)
iow.write_block(block1)
self.assert_(os.path.exists(metadata_filename))
ior = AsciiSignalIO(filename)
block2 = ior.read_block()
assert len(block2.segments[0].analogsignals) == 3
signal2 = block2.segments[0].analogsignals[1]
assert_array_almost_equal(signal1.magnitude[:, 1], signal2.magnitude.reshape(-1),
decimal=7)
self.assertEqual(signal1.units, signal2.units)
self.assertEqual(signal1.sampling_rate, signal2.sampling_rate)
assert_array_equal(signal1.times, signal2.times)
os.remove(filename)
os.remove(metadata_filename)
def test_genfromtxt_irregular_expect_success(self):
sample_data = np.random.uniform(size=(200, 3))
sample_data[:, 0] = np.sort(sample_data[:, 0]) # make column 0 the time column
filename = "test_genfromtxt_irregular_expect_success.txt"
np.savetxt(filename, sample_data, delimiter=' ')
io = AsciiSignalIO(filename, delimiter=' ', timecolumn=0,
units='mV', method='genfromtxt', signal_group_mode='split-all')
block = io.read_block()
signal1 = block.segments[0].irregularlysampledsignals[1]
assert_array_almost_equal(signal1.reshape(-1).magnitude, sample_data[:, 2],
decimal=6)
self.assertEqual(len(block.segments[0].analogsignals), 0)
self.assertEqual(len(block.segments[0].irregularlysampledsignals), 2)
self.assertEqual(signal1.units, pq.mV)
os.remove(filename)
def test_irregular_multichannel(self):
sample_data = np.random.uniform(size=(200, 3))
sample_data[:, 0] = np.sort(sample_data[:, 0]) # make column 0 the time column
filename = "test_irregular_multichannel.txt"
np.savetxt(filename, sample_data, delimiter=' ')
io = AsciiSignalIO(filename, delimiter=' ', timecolumn=0,
units='mV', method='genfromtxt', signal_group_mode='all-in-one')
block = io.read_block()
signal = block.segments[0].irregularlysampledsignals[0]
assert_array_almost_equal(signal.magnitude, sample_data[:, 1:3],
decimal=6)
self.assertEqual(len(block.segments[0].analogsignals), 0)
self.assertEqual(len(block.segments[0].irregularlysampledsignals), 1)
self.assertEqual(signal.shape, (200, 2))
self.assertEqual(signal.units, pq.mV)
os.remove(filename)
if __name__ == "__main__":
unittest.main()
| 42.014881
| 91
| 0.607849
| 1,609
| 14,117
| 5.139838
| 0.113114
| 0.05925
| 0.037243
| 0.058767
| 0.757316
| 0.726965
| 0.715599
| 0.700967
| 0.693108
| 0.648609
| 0
| 0.030253
| 0.276475
| 14,117
| 335
| 92
| 42.140299
| 0.77942
| 0.040448
| 0
| 0.576336
| 0
| 0
| 0.062347
| 0.035648
| 0
| 0
| 0
| 0
| 0.206107
| 1
| 0.049618
| false
| 0
| 0.038168
| 0.003817
| 0.110687
| 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
|
b1125a0395ff6607518312493fc4e948b8bb70ed
| 106
|
py
|
Python
|
child_management/apps.py
|
waicindia/clms-prototype
|
8c32c440ca8a132e9fc70a3d94f27333f957a4f3
|
[
"MIT"
] | null | null | null |
child_management/apps.py
|
waicindia/clms-prototype
|
8c32c440ca8a132e9fc70a3d94f27333f957a4f3
|
[
"MIT"
] | null | null | null |
child_management/apps.py
|
waicindia/clms-prototype
|
8c32c440ca8a132e9fc70a3d94f27333f957a4f3
|
[
"MIT"
] | null | null | null |
from django.apps import AppConfig
class ChildManagementConfig(AppConfig):
name = 'child_management'
| 17.666667
| 39
| 0.792453
| 11
| 106
| 7.545455
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.141509
| 106
| 5
| 40
| 21.2
| 0.912088
| 0
| 0
| 0
| 0
| 0
| 0.150943
| 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
|
b159ee630ce5a091c402c6e3c8f54dc710e01abf
| 122
|
py
|
Python
|
Statistics/Variance.py
|
rn44/statsCalculator
|
b827edfc49d9251c7490ede3e578b58b49d9bb13
|
[
"MIT"
] | null | null | null |
Statistics/Variance.py
|
rn44/statsCalculator
|
b827edfc49d9251c7490ede3e578b58b49d9bb13
|
[
"MIT"
] | null | null | null |
Statistics/Variance.py
|
rn44/statsCalculator
|
b827edfc49d9251c7490ede3e578b58b49d9bb13
|
[
"MIT"
] | 2
|
2020-11-07T03:34:17.000Z
|
2020-12-10T16:34:55.000Z
|
from Statistics.Mean import mean
def variance(a):
avg = mean(a)
return sum((k - avg) ** 2 for k in a) / len(a)
| 15.25
| 50
| 0.598361
| 22
| 122
| 3.318182
| 0.681818
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.011111
| 0.262295
| 122
| 7
| 51
| 17.428571
| 0.8
| 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
|
b15bc6908ca0c367925dd360432fef2bc6cc9fd8
| 303
|
py
|
Python
|
Closure_Project/rest_api/admin.py
|
nmdanny/Closure
|
a97bc84deb0346ff293769a8aec5c0256458b3e7
|
[
"MIT"
] | 2
|
2021-07-03T12:10:08.000Z
|
2021-07-13T10:54:07.000Z
|
Closure_Project/rest_api/admin.py
|
nmdanny/Closure
|
a97bc84deb0346ff293769a8aec5c0256458b3e7
|
[
"MIT"
] | 103
|
2021-05-02T10:52:57.000Z
|
2021-08-28T19:45:44.000Z
|
Closure_Project/rest_api/admin.py
|
nmdanny/Closure
|
a97bc84deb0346ff293769a8aec5c0256458b3e7
|
[
"MIT"
] | 13
|
2021-06-11T12:41:03.000Z
|
2021-08-23T23:35:48.000Z
|
from django.contrib import admin
# Register your models here.
from django.contrib import admin
from .models import Course, Student, CourseGroup, Track, Take
admin.site.register(Course)
admin.site.register(Student)
admin.site.register(CourseGroup)
admin.site.register(Track)
admin.site.register(Take)
| 23.307692
| 61
| 0.808581
| 42
| 303
| 5.833333
| 0.357143
| 0.183673
| 0.346939
| 0.187755
| 0.228571
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.09571
| 303
| 12
| 62
| 25.25
| 0.894161
| 0.085809
| 0
| 0.25
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.375
| 0
| 0.375
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
b164663fbf92e1a40367246480cc6a72dad76b32
| 420
|
py
|
Python
|
dqp/exceptions.py
|
vercer-cmt/django-query-preparer
|
555dfd4d9293949b7f36f2c679e284753ba86301
|
[
"MIT"
] | 6
|
2020-02-17T10:41:47.000Z
|
2021-08-20T00:19:52.000Z
|
dqp/exceptions.py
|
vercer-cmt/django-query-preparer
|
555dfd4d9293949b7f36f2c679e284753ba86301
|
[
"MIT"
] | null | null | null |
dqp/exceptions.py
|
vercer-cmt/django-query-preparer
|
555dfd4d9293949b7f36f2c679e284753ba86301
|
[
"MIT"
] | null | null | null |
# Copyright (c) 2020, Vercer Ltd. Rights set out in LICENCE.txt
class StatementAlreadyPreparedException(Exception):
pass
class StatementNotPreparedException(Exception):
pass
class PreparedQueryNotSupported(Exception):
pass
class CannotAlterPreparedStatementQuerySet(Exception):
pass
class PreparedStatementNotYetExecuted(Exception):
pass
class StatementNotRegistered(Exception):
pass
| 16.153846
| 63
| 0.788095
| 35
| 420
| 9.457143
| 0.571429
| 0.23565
| 0.271903
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.011268
| 0.154762
| 420
| 25
| 64
| 16.8
| 0.921127
| 0.145238
| 0
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
b191d115bcec0babc2233d8b5d45c674e5eb6421
| 1,438
|
py
|
Python
|
examples/django_sql_injection_extra.py
|
mikelolasagasti/bandit
|
3dca7820158ea04668878186a29d34e81bbd7fe3
|
[
"Apache-2.0"
] | 4,016
|
2018-04-26T13:01:54.000Z
|
2022-03-31T15:57:41.000Z
|
examples/django_sql_injection_extra.py
|
lweslen/bandit
|
2bd1ffaae1b83102af8587dcbeecd0b402dbec4e
|
[
"Apache-2.0"
] | 570
|
2018-04-26T10:07:41.000Z
|
2022-03-29T18:55:09.000Z
|
examples/django_sql_injection_extra.py
|
lweslen/bandit
|
2bd1ffaae1b83102af8587dcbeecd0b402dbec4e
|
[
"Apache-2.0"
] | 484
|
2018-04-26T09:59:46.000Z
|
2022-03-31T18:00:50.000Z
|
from django.contrib.auth.models import User
User.objects.filter(username='admin').extra(
select={'test': 'secure'},
where=['secure'],
tables=['secure']
)
User.objects.filter(username='admin').extra({'test': 'secure'})
User.objects.filter(username='admin').extra(select={'test': 'secure'})
User.objects.filter(username='admin').extra(where=['secure'])
User.objects.filter(username='admin').extra(dict(could_be='insecure'))
User.objects.filter(username='admin').extra(select=dict(could_be='insecure'))
query = '"username") AS "username", * FROM "auth_user" WHERE 1=1 OR "username"=? --'
User.objects.filter(username='admin').extra(select={'test': query})
User.objects.filter(username='admin').extra(select={'test': '%secure' % 'nos'})
User.objects.filter(username='admin').extra(select={'test': '{}secure'.format('nos')})
where_var = ['1=1) OR 1=1 AND (1=1']
User.objects.filter(username='admin').extra(where=where_var)
where_str = '1=1) OR 1=1 AND (1=1'
User.objects.filter(username='admin').extra(where=[where_str])
User.objects.filter(username='admin').extra(where=['%secure' % 'nos'])
User.objects.filter(username='admin').extra(where=['{}secure'.format('no')])
tables_var = ['django_content_type" WHERE "auth_user"."username"="admin']
User.objects.all().extra(tables=tables_var).distinct()
tables_str = 'django_content_type" WHERE "auth_user"."username"="admin'
User.objects.all().extra(tables=[tables_str]).distinct()
| 47.933333
| 86
| 0.712796
| 201
| 1,438
| 5.014925
| 0.174129
| 0.16369
| 0.219246
| 0.322421
| 0.77381
| 0.77381
| 0.77381
| 0.657738
| 0.460317
| 0.257937
| 0
| 0.010355
| 0.059805
| 1,438
| 29
| 87
| 49.586207
| 0.735207
| 0
| 0
| 0
| 0
| 0.04
| 0.283727
| 0.040334
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.04
| 0
| 0.04
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
49489313ec209fc58b20e194172630dc6968564b
| 182
|
py
|
Python
|
sympy/series/benchmarks/bench_limit.py
|
Michal-Gagala/sympy
|
3cc756c2af73b5506102abaeefd1b654e286e2c8
|
[
"MIT"
] | null | null | null |
sympy/series/benchmarks/bench_limit.py
|
Michal-Gagala/sympy
|
3cc756c2af73b5506102abaeefd1b654e286e2c8
|
[
"MIT"
] | null | null | null |
sympy/series/benchmarks/bench_limit.py
|
Michal-Gagala/sympy
|
3cc756c2af73b5506102abaeefd1b654e286e2c8
|
[
"MIT"
] | null | null | null |
from sympy.core.numbers import oo
from sympy.core.symbol import Symbol
from sympy.series.limits import limit
x = Symbol('x')
def timeit_limit_1x():
limit(1/x, x, oo)
| 18.2
| 38
| 0.697802
| 30
| 182
| 4.166667
| 0.5
| 0.216
| 0.208
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.013699
| 0.197802
| 182
| 9
| 39
| 20.222222
| 0.842466
| 0
| 0
| 0
| 0
| 0
| 0.00578
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| false
| 0
| 0.5
| 0
| 0.666667
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
495009b5d8420c2af78bdf8156f1aabb2fe90c1e
| 5,321
|
py
|
Python
|
Keywords/DeliveryView/info.py
|
cassie01/PumpLibrary
|
c2a4884a36f4c6c6552fa942143ae5d21c120b41
|
[
"Apache-2.0"
] | null | null | null |
Keywords/DeliveryView/info.py
|
cassie01/PumpLibrary
|
c2a4884a36f4c6c6552fa942143ae5d21c120b41
|
[
"Apache-2.0"
] | null | null | null |
Keywords/DeliveryView/info.py
|
cassie01/PumpLibrary
|
c2a4884a36f4c6c6552fa942143ae5d21c120b41
|
[
"Apache-2.0"
] | null | null | null |
# -*-coding:utf-8 -*-
from Keywords.keywordgroup import KeywordGroup
class Info(KeywordGroup):
"""
This class is used to define all related methods with information.
"""
def get_system_status(self):
"""
This method is used to get system status.
:return: system status
"""
request_command = self.parser_invoker.get_system_status_command_bytes(self.sequence_id, self.product_id)
response_command_content = self.connectObj.send_receive_command(request_command)
return response_command_content
def get_basic_mode_rate_unit(self):
"""
This method is used to get rate unit on basic mode.
:return: rate unit
"""
request_command = self.parser_invoker.get_basic_mode_rate_unit_command_bytes(self.sequence_id, self.product_id)
response_command_content = self.connectObj.send_receive_command(request_command)
return response_command_content
def get_switch_status(self, switch_mask):
"""
This method is used to get switch status.
:param switch_mask:
contain one or more switch:
Edit rate at run time 0x01
Locked after startup 0x02
Save last infusion program 0x04
Night mode 0x08
Automatic brand recognition 0x10
Drug store 0x20
Touch-tone 0x40
Drop speed sensor 0x80
Delayed infusion using KVO rate 0x100
Delayed infusion 0x200
:return: switch status
"""
# if switch_mask == "savelastinfusionprocedure":
# switch_mask = 0x04
# elif switch_mask == "nightmode":
# switch_mask = 0x08
# elif switch_mask == "keytone":
# switch_mask = 0x40
# elif switch_mask == "delaystart":
# switch_mask = 0x200
# else:
# print("Invalid switch_mask!")
# return
request_command = self.parser_invoker.get_switch_status_command_bytes(self.sequence_id, self.product_id,
switch_mask)
response_command_content = self.connectObj.send_receive_command(request_command)
return response_command_content
def set_switch_status(self, switch_mask, switch_status):
"""
This method is used to set switch status.
:param switch_mask:
contain one or more switch:
Edit rate at run time 0x01
Locked after startup 0x02
Save last infusion program 0x04
Night mode 0x08
Automatic brand recognition 0x10
Drug store 0x20
Touch-tone 0x40
Drop speed sensor 0x80
Delayed infusion using KVO rate 0x100
Delayed infusion 0x200
:param switch_status:
switch status:
Off 0x00
On 0x01
:return: None
"""
# if switch_mask == "savelastinfusionprocedure":
# switch_mask = 0x04
# if switch_status == "on":
# switch_status = 0x04
# elif switch_status == "off":
# switch_status = 0x00
# else:
# print("Unexpected switch_status!")
# return
# elif switch_mask == "nightmode":
# switch_mask = 0x08
# if switch_status == "on":
# switch_status = 0x08
# elif switch_status == "off":
# switch_status = 0x00
# else:
# print("Unexpected switch_status!")
# return
# elif switch_mask == "keytone":
# switch_mask = 0x40
# if switch_status == "on":
# switch_status = 0x40
# elif switch_status == "off":
# switch_status = 0x00
# else:
# print("Unexpected switch_status!")
# return
# elif switch_mask == "delaystart":
# switch_mask = 0x200
# if switch_status == "on":
# switch_status = 0x200
# elif switch_status == "off":
# switch_status = 0x00
# else:
# print("Unexpected switch_status!")
# return
# else:
# print("Invalid switch_mask!")
# return
request_command = self.parser_invoker.set_switch_status_command_bytes(self.sequence_id, self.product_id,
switch_mask,
switch_status)
response_command_content = self.connectObj.send_receive_command(request_command)
return response_command_content
| 39.708955
| 119
| 0.501973
| 479
| 5,321
| 5.327766
| 0.208768
| 0.145768
| 0.068966
| 0.025078
| 0.86873
| 0.827978
| 0.748041
| 0.617947
| 0.617947
| 0.615596
| 0
| 0.040803
| 0.438076
| 5,321
| 133
| 120
| 40.007519
| 0.812709
| 0.544634
| 0
| 0.380952
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.190476
| false
| 0
| 0.047619
| 0
| 0.47619
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
b8c5061821d1ea9bc9cba99462e8b256162e3172
| 781
|
py
|
Python
|
env/macActEnvWrapper.py
|
WeihaoTan/gym_cooking_env
|
a2d40f2342d5ad505a8321429e1fd4a0d5f4afba
|
[
"MIT"
] | null | null | null |
env/macActEnvWrapper.py
|
WeihaoTan/gym_cooking_env
|
a2d40f2342d5ad505a8321429e1fd4a0d5f4afba
|
[
"MIT"
] | null | null | null |
env/macActEnvWrapper.py
|
WeihaoTan/gym_cooking_env
|
a2d40f2342d5ad505a8321429e1fd4a0d5f4afba
|
[
"MIT"
] | null | null | null |
from gym import Wrapper
class MacEnvWrapper(Wrapper):
def __init__(self, env):
super(MacEnvWrapper, self).__init__(env)
@property
def n_agent(self):
return self.env.n_agent
@property
def obs_size(self):
return self.env.obs_size
@property
def n_action(self):
return self.env.n_action
@property
def action_spaces(self):
return self.env.action_spaces
def reset(self): self.env.reset()
def step(self, macro_actions):
obs, reward, done, info = self.env.run(macro_actions)
return obs, reward, done, info
def action_space_sample(self):
return self.env.macro_action_sample()
def get_avail_actions(self):
return self.env.get_avail_actions()
| 22.970588
| 61
| 0.644046
| 103
| 781
| 4.631068
| 0.300971
| 0.132075
| 0.176101
| 0.213836
| 0.075472
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.262484
| 781
| 34
| 62
| 22.970588
| 0.828125
| 0
| 0
| 0.166667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.375
| false
| 0
| 0.041667
| 0.25
| 0.75
| 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
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
b8e8a44cc9bca6a94c7ea51f35b0512d6dfa4956
| 670
|
py
|
Python
|
trade_system/offers/services.py
|
Artsiom-Shlapakou/trade-system
|
41c7bd6779b159d1c867968f5230d4ccbc37995a
|
[
"MIT"
] | null | null | null |
trade_system/offers/services.py
|
Artsiom-Shlapakou/trade-system
|
41c7bd6779b159d1c867968f5230d4ccbc37995a
|
[
"MIT"
] | null | null | null |
trade_system/offers/services.py
|
Artsiom-Shlapakou/trade-system
|
41c7bd6779b159d1c867968f5230d4ccbc37995a
|
[
"MIT"
] | null | null | null |
from trade_system.offers.models import Offer
from trade_system.offers.choises import BUY, SALE
def _get_active_offers():
return Offer.objects.filter(is_active=True)
def get_opened_purchase_offers():
return _get_active_offers().filter(order_type=BUY).order_by('price')
def get_opened_sale_offers():
return _get_active_offers().filter(order_type=SALE).order_by('price')
def _get_users_offers(self):
return Offer.objects.filter(user=self.request.user).filter(is_active=True)
def get_users_purchase_offers():
return _get_users_offers().filter(order_type=BUY)
def get_users_sale_offers():
return _get_users_offers().filter(order_type=SALE)
| 25.769231
| 78
| 0.789552
| 101
| 670
| 4.841584
| 0.277228
| 0.07362
| 0.122699
| 0.171779
| 0.539877
| 0.437628
| 0.339468
| 0.339468
| 0
| 0
| 0
| 0
| 0.101493
| 670
| 26
| 79
| 25.769231
| 0.812292
| 0
| 0
| 0
| 0
| 0
| 0.014903
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.428571
| false
| 0
| 0.142857
| 0.428571
| 1
| 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
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
b8f332510155f32213e6e3e4955a984daae03b66
| 499
|
py
|
Python
|
src/sentry/tsdb/dummy.py
|
ChadKillingsworth/sentry
|
ffcb9007a95a83ee267935fe605f8ee8f03a85a5
|
[
"BSD-3-Clause"
] | null | null | null |
src/sentry/tsdb/dummy.py
|
ChadKillingsworth/sentry
|
ffcb9007a95a83ee267935fe605f8ee8f03a85a5
|
[
"BSD-3-Clause"
] | null | null | null |
src/sentry/tsdb/dummy.py
|
ChadKillingsworth/sentry
|
ffcb9007a95a83ee267935fe605f8ee8f03a85a5
|
[
"BSD-3-Clause"
] | null | null | null |
"""
sentry.tsdb.dummy
~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from sentry.tsdb.base import BaseTSDB
class DummyTSDB(BaseTSDB):
"""
A no-op time-series storage.
"""
def incr(self, model, key, timestamp=None, count=1):
pass
def get_range(self, model, keys, start, end, rollup=None):
return dict((k, []) for k in keys)
| 22.681818
| 75
| 0.647295
| 70
| 499
| 4.528571
| 0.728571
| 0.063091
| 0.088328
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.022613
| 0.202405
| 499
| 21
| 76
| 23.761905
| 0.773869
| 0.372745
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0.142857
| 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
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
|
0
| 4
|
7705c2e11ba1c108059f1ccac3d55f08fe3f9490
| 70
|
py
|
Python
|
django_query_debug/__init__.py
|
RouganStriker/django-query-debug
|
aa23934ce7c184b925f2d622171f7042878e1802
|
[
"MIT"
] | 8
|
2019-01-18T18:02:33.000Z
|
2020-10-22T23:47:47.000Z
|
django_query_debug/__init__.py
|
RouganStriker/django-query-debug
|
aa23934ce7c184b925f2d622171f7042878e1802
|
[
"MIT"
] | 2
|
2020-01-13T20:35:07.000Z
|
2021-11-09T16:34:05.000Z
|
django_query_debug/__init__.py
|
RouganStriker/django-query-debug
|
aa23934ce7c184b925f2d622171f7042878e1802
|
[
"MIT"
] | null | null | null |
default_app_config = 'django_query_debug.apps.DjangoQueryDebugConfig'
| 35
| 69
| 0.885714
| 8
| 70
| 7.25
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.042857
| 70
| 1
| 70
| 70
| 0.865672
| 0
| 0
| 0
| 0
| 0
| 0.657143
| 0.657143
| 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
|
771ba0570a71f51e14dc586dc2436271c2a859cf
| 640
|
py
|
Python
|
tap_google_analytics/error.py
|
polar-analytics/saidtezel-tap-google-analytics
|
2f1eca9b700e7711109c95cdaf6968855ba57447
|
[
"MIT"
] | 3
|
2020-02-21T19:21:42.000Z
|
2021-04-13T01:11:31.000Z
|
tap_google_analytics/error.py
|
polar-analytics/saidtezel-tap-google-analytics
|
2f1eca9b700e7711109c95cdaf6968855ba57447
|
[
"MIT"
] | null | null | null |
tap_google_analytics/error.py
|
polar-analytics/saidtezel-tap-google-analytics
|
2f1eca9b700e7711109c95cdaf6968855ba57447
|
[
"MIT"
] | 4
|
2020-06-11T16:41:46.000Z
|
2021-01-04T08:44:02.000Z
|
class GaApiError(Exception):
"""Base exception for API errors."""
class GaInvalidArgumentError(GaApiError):
"""Exception for errors on the report definition."""
class GaAuthenticationError(GaApiError):
"""Exception for UNAUTHENTICATED && PERMISSION_DENIED errors."""
class GaRateLimitError(GaApiError):
"""Exception for Rate Limit errors."""
class GaQuotaExceededError(GaApiError):
"""Exception for Quota Exceeded errors."""
class GaBackendServerError(GaApiError):
"""Exception for 500 and 503 backend errors that are Google's fault"""
class GaUnknownError(GaApiError):
"""Exception for unknown errors."""
| 30.47619
| 74
| 0.745313
| 65
| 640
| 7.323077
| 0.523077
| 0.279412
| 0.277311
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.010929
| 0.142188
| 640
| 20
| 75
| 32
| 0.856102
| 0.470313
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 1
| 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
|
774f80933a4b8dceffded2e29dab70b58144bcc6
| 306
|
py
|
Python
|
src/FileManager.py
|
Adrian-Samoticha/zmija
|
c4ee1623c98cae8e794508daab77fbf29e259982
|
[
"MIT"
] | 3
|
2021-07-05T11:53:39.000Z
|
2021-11-23T10:22:53.000Z
|
src/FileManager.py
|
Adrian-Samoticha/zmija
|
c4ee1623c98cae8e794508daab77fbf29e259982
|
[
"MIT"
] | null | null | null |
src/FileManager.py
|
Adrian-Samoticha/zmija
|
c4ee1623c98cae8e794508daab77fbf29e259982
|
[
"MIT"
] | null | null | null |
import os
from glob import glob
class FileManager:
def get_file_paths(path):
return [
y for x in os.walk(path)
for y in glob(os.path.join(x[0], '*'))
if os.path.isfile(y)
]
def open_file_readonly(path):
return open(path, "r")
def open_file_writeonly(path):
return open(path, "w")
| 19.125
| 41
| 0.666667
| 53
| 306
| 3.735849
| 0.490566
| 0.151515
| 0.111111
| 0.181818
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.004082
| 0.199346
| 306
| 16
| 42
| 19.125
| 0.804082
| 0
| 0
| 0
| 0
| 0
| 0.009772
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.230769
| false
| 0
| 0.153846
| 0.230769
| 0.692308
| 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
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
62100839452f81233e7ff0c5d50eff915af5f011
| 144
|
py
|
Python
|
capstone/plugins/helpers/__init__.py
|
trevorstam/udacity_data-engineering
|
065f4fd7578cb961a3eca0f732fdbdad42a19343
|
[
"MIT"
] | null | null | null |
capstone/plugins/helpers/__init__.py
|
trevorstam/udacity_data-engineering
|
065f4fd7578cb961a3eca0f732fdbdad42a19343
|
[
"MIT"
] | null | null | null |
capstone/plugins/helpers/__init__.py
|
trevorstam/udacity_data-engineering
|
065f4fd7578cb961a3eca0f732fdbdad42a19343
|
[
"MIT"
] | null | null | null |
from helpers.table_configs import sas_source_code_tables_data, copy_s3_keys
__all__ = [
'sas_source_code_tables_data',
'copy_s3_keys'
]
| 24
| 75
| 0.798611
| 22
| 144
| 4.454545
| 0.636364
| 0.183673
| 0.265306
| 0.387755
| 0.673469
| 0.673469
| 0.673469
| 0.673469
| 0
| 0
| 0
| 0.016
| 0.131944
| 144
| 6
| 76
| 24
| 0.768
| 0
| 0
| 0
| 0
| 0
| 0.268966
| 0.186207
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.2
| 0
| 0.2
| 0
| 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
|
622a4925052d7ace3f4ed880c5478cb313b2230a
| 102
|
py
|
Python
|
WebApplication/annotations/apps.py
|
tuh8888/CommandLineTextAnnotation
|
bbb4af473f1229571221bd814d4d7b627b01543a
|
[
"MIT"
] | null | null | null |
WebApplication/annotations/apps.py
|
tuh8888/CommandLineTextAnnotation
|
bbb4af473f1229571221bd814d4d7b627b01543a
|
[
"MIT"
] | null | null | null |
WebApplication/annotations/apps.py
|
tuh8888/CommandLineTextAnnotation
|
bbb4af473f1229571221bd814d4d7b627b01543a
|
[
"MIT"
] | null | null | null |
from django.apps import AppConfig
class AnnotationsConfig(AppConfig):
name = 'annotations'
| 17
| 36
| 0.735294
| 10
| 102
| 7.5
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.196078
| 102
| 5
| 37
| 20.4
| 0.914634
| 0
| 0
| 0
| 0
| 0
| 0.113402
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
6261fc396f8aacdbbe23e570cfd7c923b45f966d
| 155
|
py
|
Python
|
src/panel_components/fluent/widgets/__init__.py
|
MarcSkovMadsen/panel-components
|
ca176f605006165889cbbd3c775d24cdcc4f964d
|
[
"MIT"
] | 5
|
2020-09-30T03:10:33.000Z
|
2022-02-04T19:54:58.000Z
|
src/panel_components/fluent/widgets/__init__.py
|
MarcSkovMadsen/panel-components
|
ca176f605006165889cbbd3c775d24cdcc4f964d
|
[
"MIT"
] | null | null | null |
src/panel_components/fluent/widgets/__init__.py
|
MarcSkovMadsen/panel-components
|
ca176f605006165889cbbd3c775d24cdcc4f964d
|
[
"MIT"
] | 1
|
2021-11-08T19:00:45.000Z
|
2021-11-08T19:00:45.000Z
|
"""# Fluent Design Widgets
See https://github.com/microsoft/fluentui/tree/master/packages/web-components
"""
from .fluent_button import FluentButton
| 25.833333
| 78
| 0.767742
| 19
| 155
| 6.210526
| 0.947368
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.109677
| 155
| 5
| 79
| 31
| 0.855072
| 0.658065
| 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
|
626fd243c7e07fd25f3edd13c32b84d08951f854
| 108
|
py
|
Python
|
dork/__main__.py
|
cs-3250/dork
|
042acff87011f27781d59976bc4382fdcb6e15f9
|
[
"MIT"
] | null | null | null |
dork/__main__.py
|
cs-3250/dork
|
042acff87011f27781d59976bc4382fdcb6e15f9
|
[
"MIT"
] | 25
|
2019-06-19T00:55:15.000Z
|
2019-07-31T02:00:51.000Z
|
dork/__main__.py
|
cs-3250/dork
|
042acff87011f27781d59976bc4382fdcb6e15f9
|
[
"MIT"
] | 1
|
2019-06-14T18:57:17.000Z
|
2019-06-14T18:57:17.000Z
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Dork main run script"""
from dork.cli import main
main()
| 13.5
| 26
| 0.62037
| 17
| 108
| 3.941176
| 0.823529
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.011111
| 0.166667
| 108
| 7
| 27
| 15.428571
| 0.733333
| 0.583333
| 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
|
656a2b1ae870b9c3a5ac88f0357d36d3d31ae376
| 445
|
py
|
Python
|
experiment_automator/exceptions.py
|
mpolatcan/ml-notifier
|
1f2a7edcbd3edb49b1dcf03e43f3863720b466ac
|
[
"Apache-2.0"
] | 1
|
2018-10-09T20:07:19.000Z
|
2018-10-09T20:07:19.000Z
|
experiment_automator/exceptions.py
|
mpolatcan/experiment-automator
|
1f2a7edcbd3edb49b1dcf03e43f3863720b466ac
|
[
"Apache-2.0"
] | null | null | null |
experiment_automator/exceptions.py
|
mpolatcan/experiment-automator
|
1f2a7edcbd3edb49b1dcf03e43f3863720b466ac
|
[
"Apache-2.0"
] | null | null | null |
class ConfigNotFoundException(Exception):
def __init__(self, message):
super().__init__(message)
class WorkingDirectoryDoesNotExistException(Exception):
def __init__(self, message):
super().__init__(message)
class ImageUploaderException(Exception):
def __init__(self, message):
super().__init__(message)
class OAuthException(Exception):
def __init__(self, message):
super().__init__(message)
| 24.722222
| 55
| 0.719101
| 40
| 445
| 7.2
| 0.275
| 0.166667
| 0.222222
| 0.277778
| 0.649306
| 0.649306
| 0.649306
| 0.649306
| 0.5
| 0
| 0
| 0
| 0.173034
| 445
| 18
| 56
| 24.722222
| 0.782609
| 0
| 0
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0
| 0.666667
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
6585b54ccdd968d8a8721ff6f734ac17e7b6767a
| 227
|
py
|
Python
|
cfgov/v1/image_formats.py
|
adebisi-aden/consumerfinance.gov
|
8c0f5afac341823c59f73b0c6bd60592e0f5eaca
|
[
"CC0-1.0"
] | 37
|
2020-08-18T19:52:39.000Z
|
2022-03-23T08:08:41.000Z
|
cfgov/v1/image_formats.py
|
adebisi-aden/consumerfinance.gov
|
8c0f5afac341823c59f73b0c6bd60592e0f5eaca
|
[
"CC0-1.0"
] | 338
|
2020-08-14T20:46:36.000Z
|
2022-03-31T20:49:32.000Z
|
cfgov/v1/image_formats.py
|
adebisi-aden/consumerfinance.gov
|
8c0f5afac341823c59f73b0c6bd60592e0f5eaca
|
[
"CC0-1.0"
] | 14
|
2020-10-21T15:27:03.000Z
|
2022-03-17T03:16:36.000Z
|
from wagtail.images.formats import Format, register_image_format
register_image_format(
Format(
'bleed',
'Bleed into left/right margins',
'richtext-image image-bleed',
'width-1170'
)
)
| 18.916667
| 64
| 0.643172
| 25
| 227
| 5.68
| 0.64
| 0.197183
| 0.267606
| 0.352113
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.02381
| 0.259912
| 227
| 11
| 65
| 20.636364
| 0.821429
| 0
| 0
| 0
| 0
| 0
| 0.30837
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.111111
| 0
| 0.111111
| 0
| 1
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
6590770d65fc9487d0780a8a08d46ce498c55e9e
| 3,268
|
py
|
Python
|
tests/tabular/test_tabular_supervised.py
|
tianhaoz95/autokeras
|
11a25553d310aeac29b5cd2f99965e5970a5254a
|
[
"MIT"
] | 1
|
2019-06-12T17:02:44.000Z
|
2019-06-12T17:02:44.000Z
|
tests/tabular/test_tabular_supervised.py
|
tianhaoz95/autokeras
|
11a25553d310aeac29b5cd2f99965e5970a5254a
|
[
"MIT"
] | null | null | null |
tests/tabular/test_tabular_supervised.py
|
tianhaoz95/autokeras
|
11a25553d310aeac29b5cd2f99965e5970a5254a
|
[
"MIT"
] | 1
|
2019-06-27T17:23:26.000Z
|
2019-06-27T17:23:26.000Z
|
import pytest
from autokeras.tabular.tabular_supervised import *
from tests.common import clean_dir, TEST_TEMP_DIR
def test_fit__evalute_predict_classification():
# binary classification
clean_dir(TEST_TEMP_DIR)
clf = TabularClassifier(path=TEST_TEMP_DIR)
nsample = 59
feat_exist_ind = [0, 5]
for ntime in feat_exist_ind:
for nnum in feat_exist_ind:
for ncat in feat_exist_ind:
for nmvc in feat_exist_ind:
datainfo = {'loaded_feat_types': [ntime, nnum, ncat, nmvc]}
num_feat = ntime + nnum + ncat + nmvc
x_num = np.random.random([nsample, nnum])
x_time = np.random.random([nsample, ntime])
x_cat = np.random.randint(0, 40, [nsample, ncat])
x_mvc = np.random.randint(0, 10, [nsample, nmvc])
train_x = np.concatenate([x_num, x_time, x_cat, x_mvc], axis=1)
train_y = np.random.randint(0, 2, nsample)
print(datainfo)
if num_feat == 0:
with pytest.raises(ValueError):
clf.fit(train_x, train_y, datainfo=datainfo)
else:
clf.fit(train_x, train_y, datainfo=datainfo)
results = clf.predict(train_x)
assert all(map(lambda result: result in train_y, results))
score = clf.evaluate(train_x, train_y)
assert score >= 0.0
# multiclass:
nsample = 10000
[ntime, nnum, ncat, nmvc] = [3, 15, 3, 3]
datainfo = {'loaded_feat_types': [ntime, nnum, ncat, nmvc]}
x_num = np.random.random([nsample, nnum])
x_time = np.random.random([nsample, ntime])
x_cat = np.random.randint(0, 200, [nsample, ncat])
x_mvc = np.random.randint(0, 10, [nsample, nmvc])
train_x = np.concatenate([x_num, x_time, x_cat, x_mvc], axis=1)
train_y = np.random.randint(0, 3, nsample)
clf.fit(train_x, train_y, datainfo=datainfo)
results = clf.predict(train_x)
assert all(map(lambda result: result in train_y, results))
score = clf.evaluate(train_x, train_y)
assert score >= 0.0
clean_dir(TEST_TEMP_DIR)
def test_fit_predict_evalute_regression():
clean_dir(TEST_TEMP_DIR)
clf = TabularRegressor(path=TEST_TEMP_DIR)
nsample = 10000
[ntime, nnum, ncat, nmvc] = [3, 15, 3, 3]
datainfo = {'loaded_feat_types': [ntime, nnum, ncat, nmvc]}
x_num = np.random.random([nsample, nnum])
x_time = np.random.random([nsample, ntime])
x_cat = np.random.randint(0, 200, [nsample, ncat])
x_mvc = np.random.randint(0, 10, [nsample, nmvc])
train_x = np.concatenate([x_num, x_time, x_cat, x_mvc], axis=1)
train_y = train_x[:, 5]
clf.fit(train_x, train_y, datainfo=datainfo)
results = clf.predict(train_x)
assert len(results) == len(train_x)
score = clf.evaluate(train_x, train_y)
assert score >= 0.0
# test different model loading in predict
clf.clf = None
results = clf.predict(train_x)
assert len(results) == len(train_x)
clf.clf = None
clf.save_filename = None
results = clf.predict(train_x)
assert len(results) == len(train_x)
clean_dir(TEST_TEMP_DIR)
| 39.853659
| 83
| 0.613831
| 459
| 3,268
| 4.14597
| 0.176471
| 0.059905
| 0.063058
| 0.067262
| 0.794535
| 0.738308
| 0.715187
| 0.715187
| 0.645822
| 0.645822
| 0
| 0.02478
| 0.27142
| 3,268
| 81
| 84
| 40.345679
| 0.774465
| 0.022338
| 0
| 0.671429
| 0
| 0
| 0.015982
| 0
| 0
| 0
| 0
| 0
| 0.114286
| 1
| 0.028571
| false
| 0
| 0.042857
| 0
| 0.071429
| 0.014286
| 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
|
659b559c5ea79db2dbc7aea8963d30e717e49979
| 143
|
py
|
Python
|
examples/formal_project/sampleproject/base.py
|
reorx/torext
|
84c4300ebc7fab0dbd11cf8b020bc7d4d1570171
|
[
"MIT"
] | 31
|
2015-03-20T14:11:11.000Z
|
2020-10-19T08:07:45.000Z
|
examples/formal_project/sampleproject/base.py
|
reorx/torext
|
84c4300ebc7fab0dbd11cf8b020bc7d4d1570171
|
[
"MIT"
] | 1
|
2016-09-15T07:17:26.000Z
|
2016-09-15T07:17:26.000Z
|
examples/formal_project/sampleproject/base.py
|
reorx/torext
|
84c4300ebc7fab0dbd11cf8b020bc7d4d1570171
|
[
"MIT"
] | 8
|
2015-03-04T04:08:57.000Z
|
2019-08-31T03:03:42.000Z
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from torext.handlers import BaseHandler
class MyBaseHandler(BaseHandler):
visit_count = 0
| 15.888889
| 39
| 0.706294
| 18
| 143
| 5.555556
| 0.944444
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.016667
| 0.160839
| 143
| 8
| 40
| 17.875
| 0.816667
| 0.293706
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
659f38d7ff32d206a0e11362c1e4934657483e40
| 23
|
py
|
Python
|
doebase/_version.py
|
brsynth/doebase
|
93d4dac2aefe83cb06a6601d04e50a4507bb03ce
|
[
"MIT"
] | null | null | null |
doebase/_version.py
|
brsynth/doebase
|
93d4dac2aefe83cb06a6601d04e50a4507bb03ce
|
[
"MIT"
] | null | null | null |
doebase/_version.py
|
brsynth/doebase
|
93d4dac2aefe83cb06a6601d04e50a4507bb03ce
|
[
"MIT"
] | null | null | null |
__version__ = "v2.0.1"
| 11.5
| 22
| 0.652174
| 4
| 23
| 2.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.15
| 0.130435
| 23
| 1
| 23
| 23
| 0.4
| 0
| 0
| 0
| 0
| 0
| 0.26087
| 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
|
65a740331e158a2b62d3207a08a9c814628cca2c
| 1,252
|
py
|
Python
|
src/Models/Model.py
|
goncaloasimoes/net-pro-sim
|
77f766661229327df16bef1e6813152e02350459
|
[
"MIT"
] | 1
|
2022-01-04T00:03:05.000Z
|
2022-01-04T00:03:05.000Z
|
src/Models/Model.py
|
goncaloasimoes/nps
|
77f766661229327df16bef1e6813152e02350459
|
[
"MIT"
] | null | null | null |
src/Models/Model.py
|
goncaloasimoes/nps
|
77f766661229327df16bef1e6813152e02350459
|
[
"MIT"
] | null | null | null |
# Generic Model
from .Auxiliaries.Transitions import Transitions
class GenericModel:
def __init__(self, states = [], parameters = {}, transitions = {}):
self.states = states
self.parameters = parameters
self.transitions = Transitions(transitions)
def end_condition(self, time_step, network):
pass
def get_states_to_update(self, network):
'''
Which states should be updated.
The normal behavior is for all states to be updated every step. But in some cases we
might want to change these dynamically, like when simulating timescales of transitions.
'''
return self.states
def get_states_for_strategy(self):
'''
TODO: example { inf: I, vac: R }
'''
return {}
def get_states(self):
return self.states
def get_transitions(self):
return self.transitions
def get_parameters(self):
return self.parameters
def get_parameter(self, name):
return self.parameters[name]
def set_parameter(self, parameter, value):
self.parameters[parameter] = value
def set_parameters(self, parameters):
self.parameters = {**self.parameters, **parameters}
| 28.454545
| 99
| 0.638179
| 140
| 1,252
| 5.578571
| 0.428571
| 0.12548
| 0.046095
| 0.048656
| 0.122919
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.277157
| 1,252
| 44
| 100
| 28.454545
| 0.862983
| 0.201278
| 0
| 0.083333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.022727
| 0
| 1
| 0.416667
| false
| 0.041667
| 0.041667
| 0.166667
| 0.75
| 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
|
65b0134d4a6da88bf4bde75f17ba434ecf5eb7e2
| 195
|
py
|
Python
|
flask_backend/run.py
|
shafqatshad/AnmieRecommenderSystem
|
f58d6ab2b3614aa81208ec844ef99963c988c69d
|
[
"Apache-2.0"
] | null | null | null |
flask_backend/run.py
|
shafqatshad/AnmieRecommenderSystem
|
f58d6ab2b3614aa81208ec844ef99963c988c69d
|
[
"Apache-2.0"
] | null | null | null |
flask_backend/run.py
|
shafqatshad/AnmieRecommenderSystem
|
f58d6ab2b3614aa81208ec844ef99963c988c69d
|
[
"Apache-2.0"
] | null | null | null |
from anime_flask import app as working_app
# from flask_socketio import *
# socketio = SocketIO(app, logger=True)
if __name__ == '__main__':
# socketio.run(app, debug=True)
working_app.run()
| 27.857143
| 42
| 0.74359
| 28
| 195
| 4.75
| 0.535714
| 0.150376
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.14359
| 195
| 7
| 43
| 27.857143
| 0.796407
| 0.492308
| 0
| 0
| 0
| 0
| 0.083333
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
65c81fcc066ba3b4c2b69eba075415457cbe835a
| 35
|
py
|
Python
|
tests/conftest.py
|
aflaisler/kaggle-avazu-ctr
|
8acbed0f732d72146127076b07f61568212e1d0c
|
[
"BSD-3-Clause"
] | null | null | null |
tests/conftest.py
|
aflaisler/kaggle-avazu-ctr
|
8acbed0f732d72146127076b07f61568212e1d0c
|
[
"BSD-3-Clause"
] | null | null | null |
tests/conftest.py
|
aflaisler/kaggle-avazu-ctr
|
8acbed0f732d72146127076b07f61568212e1d0c
|
[
"BSD-3-Clause"
] | null | null | null |
"""Setup constants for testing."""
| 17.5
| 34
| 0.685714
| 4
| 35
| 6
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.114286
| 35
| 1
| 35
| 35
| 0.774194
| 0.8
| 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
|
65ca22bd7831d1bf8bc8352622bdd7818e88396c
| 50
|
py
|
Python
|
stats/__init__.py
|
RossBrunton/RThing
|
9c9b352b93eab4ff1f841cbca9ea3c1a0d6f6929
|
[
"MIT"
] | null | null | null |
stats/__init__.py
|
RossBrunton/RThing
|
9c9b352b93eab4ff1f841cbca9ea3c1a0d6f6929
|
[
"MIT"
] | null | null | null |
stats/__init__.py
|
RossBrunton/RThing
|
9c9b352b93eab4ff1f841cbca9ea3c1a0d6f6929
|
[
"MIT"
] | null | null | null |
"""Stuff for generating and viewing statistics"""
| 25
| 49
| 0.76
| 6
| 50
| 6.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.12
| 50
| 1
| 50
| 50
| 0.863636
| 0.86
| 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
|
65dc783714c447b7c3af6cd676a626a4b46aa0ac
| 359
|
py
|
Python
|
app/Forms/OntoRel_delForm.py
|
xuyuhanGithub/deploytest
|
ffc975558eec5fdc5872d8b9a93236538914997b
|
[
"MIT"
] | null | null | null |
app/Forms/OntoRel_delForm.py
|
xuyuhanGithub/deploytest
|
ffc975558eec5fdc5872d8b9a93236538914997b
|
[
"MIT"
] | null | null | null |
app/Forms/OntoRel_delForm.py
|
xuyuhanGithub/deploytest
|
ffc975558eec5fdc5872d8b9a93236538914997b
|
[
"MIT"
] | null | null | null |
from flask_wtf import Form
from wtforms import StringField, BooleanField, RadioField, SubmitField, SelectField
from wtforms.validators import DataRequired, Length
class OntoRelDelForm(Form):
onto_name =SelectField('onto_name',validators=[DataRequired(), Length(2, 20)])
onto_rel =SelectField('onto_rel',validators=[DataRequired(), Length(2, 20)])
| 32.636364
| 83
| 0.78273
| 42
| 359
| 6.571429
| 0.5
| 0.195652
| 0.202899
| 0.210145
| 0.224638
| 0
| 0
| 0
| 0
| 0
| 0
| 0.01875
| 0.108635
| 359
| 10
| 84
| 35.9
| 0.84375
| 0
| 0
| 0
| 0
| 0
| 0.047619
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
65e3134e28b77e5a3be8fb00b8ee4de2c806274d
| 106
|
py
|
Python
|
6 kyu/Break camelCase.py
|
mwk0408/codewars_solutions
|
9b4f502b5f159e68024d494e19a96a226acad5e5
|
[
"MIT"
] | 6
|
2020-09-03T09:32:25.000Z
|
2020-12-07T04:10:01.000Z
|
6 kyu/Break camelCase.py
|
mwk0408/codewars_solutions
|
9b4f502b5f159e68024d494e19a96a226acad5e5
|
[
"MIT"
] | 1
|
2021-12-13T15:30:21.000Z
|
2021-12-13T15:30:21.000Z
|
6 kyu/Break camelCase.py
|
mwk0408/codewars_solutions
|
9b4f502b5f159e68024d494e19a96a226acad5e5
|
[
"MIT"
] | null | null | null |
def solution(s):
return "".join(char.replace(char," "+char) if char.isupper() else char for char in s)
| 53
| 89
| 0.679245
| 18
| 106
| 4
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.150943
| 106
| 2
| 89
| 53
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0.009346
| 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
|
02b25a4096e6dad7582719d3945aa75024e9c159
| 25,884
|
py
|
Python
|
pysnmp-with-texts/IEEE8021-TC-MIB.py
|
agustinhenze/mibs.snmplabs.com
|
1fc5c07860542b89212f4c8ab807057d9a9206c7
|
[
"Apache-2.0"
] | 8
|
2019-05-09T17:04:00.000Z
|
2021-06-09T06:50:51.000Z
|
pysnmp-with-texts/IEEE8021-TC-MIB.py
|
agustinhenze/mibs.snmplabs.com
|
1fc5c07860542b89212f4c8ab807057d9a9206c7
|
[
"Apache-2.0"
] | 4
|
2019-05-31T16:42:59.000Z
|
2020-01-31T21:57:17.000Z
|
pysnmp-with-texts/IEEE8021-TC-MIB.py
|
agustinhenze/mibs.snmplabs.com
|
1fc5c07860542b89212f4c8ab807057d9a9206c7
|
[
"Apache-2.0"
] | 10
|
2019-04-30T05:51:36.000Z
|
2022-02-16T03:33:41.000Z
|
#
# PySNMP MIB module IEEE8021-TC-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/IEEE8021-TC-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:13:10 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
SingleValueConstraint, ConstraintsIntersection, ConstraintsUnion, ValueSizeConstraint, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsIntersection", "ConstraintsUnion", "ValueSizeConstraint", "ValueRangeConstraint")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
Counter64, org, iso, MibIdentifier, ModuleIdentity, Unsigned32, Integer32, Gauge32, IpAddress, NotificationType, ObjectIdentity, MibScalar, MibTable, MibTableRow, MibTableColumn, Counter32, Bits, TimeTicks = mibBuilder.importSymbols("SNMPv2-SMI", "Counter64", "org", "iso", "MibIdentifier", "ModuleIdentity", "Unsigned32", "Integer32", "Gauge32", "IpAddress", "NotificationType", "ObjectIdentity", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Counter32", "Bits", "TimeTicks")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
ieee8021TcMib = ModuleIdentity((1, 3, 111, 2, 802, 1, 1, 1))
ieee8021TcMib.setRevisions(('2014-12-15 00:00', '2012-02-15 00:00', '2011-08-23 00:00', '2011-04-06 00:00', '2011-02-27 00:00', '2008-11-18 00:00', '2008-10-15 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: ieee8021TcMib.setRevisionsDescriptions(('Published as part of IEEE Std 802.1Q 2014 revision. Cross references updated and corrected. Updating of definition of IEEE8021PbbIngressEgress New identifier types for new SPBM MA types', 'Modified IEEE8021BridgePortType textual convention to include stationFacingBridgePort, uplinkAccessPort, and uplinkRelayPort types.', 'Modified textual conventions to support the IEEE 802.1 MIBs for PBB-TE Infrastructure Protection Switching.', 'Modified textual conventions to support Remote Customer Service Interfaces.', 'Minor edits to contact information etc. as part of 2011 revision of IEEE Std 802.1Q.', 'Added textual conventions needed to support the IEEE 802.1 MIBs for PBB-TE. Additionally, some textual conventions were modified for the same reason.', 'Initial version.',))
if mibBuilder.loadTexts: ieee8021TcMib.setLastUpdated('201412150000Z')
if mibBuilder.loadTexts: ieee8021TcMib.setOrganization('IEEE 802.1 Working Group')
if mibBuilder.loadTexts: ieee8021TcMib.setContactInfo(' WG-URL: http://grouper.ieee.org/groups/802/1/index.html WG-EMail: stds-802-1@ieee.org Contact: IEEE 802.1 Working Group Chair Postal: C/O IEEE 802.1 Working Group IEEE Standards Association 445 Hoes Lane P.O. Box 1331 Piscataway NJ 08855-1331 USA E-mail: STDS-802-1-L@LISTSERV.IEEE.ORG')
if mibBuilder.loadTexts: ieee8021TcMib.setDescription('Textual conventions used throughout the various IEEE 802.1 MIB modules. Unless otherwise indicated, the references in this MIB module are to IEEE Std 802.1Q-2014. Copyright (C) IEEE (2014). This version of this MIB module is part of IEEE Std 802.1Q; see the draft itself for full legal notices.')
ieee802dot1mibs = MibIdentifier((1, 3, 111, 2, 802, 1, 1))
class IEEE8021PbbComponentIdentifier(TextualConvention, Unsigned32):
reference = '12.3 l)'
description = 'The component identifier is used to distinguish between the multiple virtual Bridge instances within a PB or PBB. Each virtual Bridge instance is called a component. In simple situations where there is only a single component the default value is 1. The component is identified by a component identifier unique within the BEB and by a MAC address unique within the PBBN. Each component is associated with a Backbone Edge Bridge (BEB) Configuration managed object.'
status = 'current'
displayHint = 'd'
subtypeSpec = Unsigned32.subtypeSpec + ValueRangeConstraint(1, 4294967295)
class IEEE8021PbbComponentIdentifierOrZero(TextualConvention, Unsigned32):
reference = '12.3 l)'
description = "The component identifier is used to distinguish between the multiple virtual Bridge instances within a PB or PBB. In simple situations where there is only a single component the default value is 1. The component is identified by a component identifier unique within the BEB and by a MAC address unique within the PBBN. Each component is associated with a Backbone Edge Bridge (BEB) Configuration managed object. The special value '0' means 'no component identifier'. When this TC is used as the SYNTAX of an object, that object must specify the exact meaning for this value."
status = 'current'
displayHint = 'd'
subtypeSpec = Unsigned32.subtypeSpec + ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 4294967295), )
class IEEE8021PbbServiceIdentifier(TextualConvention, Unsigned32):
reference = '12.16.3, 12.16.5'
description = 'The service instance identifier is used at the Customer Backbone Port of a PBB to distinguish a service instance (Local-SID). If the Local-SID field is supported, it is used to perform a bidirectional 1:1 mapping between the Backbone I-SID and the Local-SID. If the Local-SID field is not supported, the Local-SID value is the same as the Backbone I-SID value.'
status = 'current'
displayHint = 'd'
subtypeSpec = Unsigned32.subtypeSpec + ValueRangeConstraint(256, 16777214)
class IEEE8021PbbServiceIdentifierOrUnassigned(TextualConvention, Unsigned32):
reference = '12.16.3, 12.16.5'
description = 'The service instance identifier is used at the Customer Backbone Port of a PBB to distinguish a service instance (Local-SID). If the Local-SID field is supported, it is used to perform a bidirectional 1:1 mapping between the Backbone I-SID and the Local-SID. If the Local-SID field is not supported, the Local-SID value is the same as the Backbone I-SID value. The special value of 1 indicates an unassigned I-SID.'
status = 'current'
displayHint = 'd'
subtypeSpec = Unsigned32.subtypeSpec + ConstraintsUnion(ValueRangeConstraint(1, 1), ValueRangeConstraint(256, 16777214), )
class IEEE8021PbbIngressEgress(TextualConvention, Bits):
reference = '12.16.3, 12.16.5'
description = 'A 2 bit selector which determines if frames on this VIP may ingress to the PBBN but not egress the PBBN, egress to the PBBN but not ingress the PBBN, or both ingress and egress the PBBN.'
status = 'current'
namedValues = NamedValues(("ingress", 0), ("egress", 1))
class IEEE8021PriorityCodePoint(TextualConvention, Integer32):
reference = '12.6.2.6'
description = 'Bridge ports may encode or decode the PCP value of the frames that traverse the port. This textual convention names the possible encoding and decoding schemes that the port may use. The priority and drop_eligible parameters are encoded in the Priority Code Point (PCP) field of the VLAN tag using the Priority Code Point Encoding Table for the Port, and they are decoded from the PCP using the Priority Code Point Decoding Table.'
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))
namedValues = NamedValues(("codePoint8p0d", 1), ("codePoint7p1d", 2), ("codePoint6p2d", 3), ("codePoint5p3d", 4))
class IEEE8021BridgePortNumber(TextualConvention, Unsigned32):
reference = '17.3.2.2'
description = 'An integer that uniquely identifies a Bridge Port, as specified in 17.3.2.2. This value is used within the spanning tree protocol to identify this port to neighbor Bridges.'
status = 'current'
displayHint = 'd'
subtypeSpec = Unsigned32.subtypeSpec + ValueRangeConstraint(1, 65535)
class IEEE8021BridgePortNumberOrZero(TextualConvention, Unsigned32):
reference = '17.3.2.2'
description = 'An integer that uniquely identifies a Bridge Port. The value 0 means no port number, and this must be clarified in the DESCRIPTION clause of any object defined using this TEXTUAL-CONVENTION.'
status = 'current'
displayHint = 'd'
subtypeSpec = Unsigned32.subtypeSpec + ValueRangeConstraint(0, 65535)
class IEEE8021BridgePortType(TextualConvention, Integer32):
reference = '40.4, 12.13.1.1, 12.13.1.2, 12.16, 12.16.1.1.3 12.16.2.1, 12.26'
description = "A port type. The possible port types are: customerVlanPort(2) - Indicates a port is a C-tag aware port of an enterprise VLAN aware Bridge. providerNetworkPort(3) - Indicates a port is an S-tag aware port of a Provider Bridge or Backbone Edge Bridge used for connections within a PBN or PBBN. customerNetworkPort(4) - Indicates a port is an S-tag aware port of a Provider Bridge or Backbone Edge Bridge used for connections to the exterior of a PBN or PBBN. customerEdgePort(5) - Indicates a port is a C-tag aware port of a Provider Bridge used for connections to the exterior of a PBN or PBBN. customerBackbonePort(6) - Indicates a port is a I-tag aware port of a Backbone Edge Bridge's B-component. virtualInstancePort(7) - Indicates a port is a virtual S-tag aware port within a Backbone Edge Bridge's I-component which is responsible for handling S-tagged traffic for a specific backbone service instance. dBridgePort(8) - Indicates a port is a VLAN-unaware member of an 802.1D Bridge. remoteCustomerAccessPort (9) - Indicates a port is an S-tag aware port of a Provider Bridge used for connections to remote customer interface LANs through another PBN. stationFacingBridgePort (10) - Indicates a port of a Bridge that supports the EVB status parameters (40.4) with an EVBMode parameter value of EVB Bridge. uplinkAccessPort (11) - Indicates a port on a Port-mapping S-VLAN component that connects an EVB Bridge with an EVB station. uplinkRelayPort (12) - Indicates a port of an edge relay that supports the EVB status parameters (40.4) with an EVBMode parameter value of EVB station."
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12))
namedValues = NamedValues(("none", 1), ("customerVlanPort", 2), ("providerNetworkPort", 3), ("customerNetworkPort", 4), ("customerEdgePort", 5), ("customerBackbonePort", 6), ("virtualInstancePort", 7), ("dBridgePort", 8), ("remoteCustomerAccessPort", 9), ("stationFacingBridgePort", 10), ("uplinkAccessPort", 11), ("uplinkRelayPort", 12))
class IEEE8021VlanIndex(TextualConvention, Unsigned32):
reference = '9.6'
description = 'A value used to index per-VLAN tables: values of 0 and 4095 are not permitted. If the value is between 1 and 4094 inclusive, it represents an IEEE 802.1Q VLAN-ID with global scope within a given bridged domain (see VlanId textual convention). If the value is greater than 4095, then it represents a VLAN with scope local to the particular agent, i.e., one without a global VLAN-ID assigned to it. Such VLANs are outside the scope of IEEE 802.1Q, but it is convenient to be able to manage them in the same way using this MIB.'
status = 'current'
displayHint = 'd'
subtypeSpec = Unsigned32.subtypeSpec + ConstraintsUnion(ValueRangeConstraint(1, 4094), ValueRangeConstraint(4096, 4294967295), )
class IEEE8021VlanIndexOrWildcard(TextualConvention, Unsigned32):
reference = '9.6'
description = "A value used to index per-VLAN tables. The value 0 is not permitted, while the value 4095 represents a 'wildcard' value. An object whose SYNTAX is IEEE8021VlanIndexOrWildcard must specify in its DESCRIPTION the specific meaning of the wildcard value. If the value is between 1 and 4094 inclusive, it represents an IEEE 802.1Q VLAN-ID with global scope within a given bridged domain (see VlanId textual convention). If the value is greater than 4095, then it represents a VLAN with scope local to the particular agent, i.e., one without a global VLAN-ID assigned to it. Such VLANs are outside the scope of IEEE 802.1Q, but it is convenient to be able to manage them in the same way using this MIB."
status = 'current'
displayHint = 'd'
subtypeSpec = Unsigned32.subtypeSpec + ValueRangeConstraint(1, 4294967295)
class IEEE8021MstIdentifier(TextualConvention, Unsigned32):
description = 'In an MSTP Bridge, an MSTID, i.e., a value used to identify a spanning tree (or MST) instance. In the PBB-TE environment the value 4094 is used to identify VIDs managed by the PBB-TE procedures.'
status = 'current'
displayHint = 'd'
subtypeSpec = Unsigned32.subtypeSpec + ValueRangeConstraint(1, 4094)
class IEEE8021ServiceSelectorType(TextualConvention, Integer32):
description = 'A value that represents a type (and thereby the format) of a IEEE8021ServiceSelectorValue. The value can be one of the following: ieeeReserved(0) Reserved for definition by IEEE 802.1 recommend to not use zero unless absolutely needed. vlanId(1) 12-Bit identifier as described in IEEE802.1Q. isid(2) 24-Bit identifier as described in IEEE802.1ah. tesid(3) 32 Bit identifier as described below. segid(4) 32 Bit identifier as described below. path-tesid(5) 32 Bit identifier as described below. group-isid(6) 24 Bit identifier as described below. ieeeReserved(7) Reserved for definition by IEEE 802.1 To support future extensions, the IEEE8021ServiceSelectorType textual convention SHOULD NOT be subtyped in object type definitions. It MAY be subtyped in compliance statements in order to require only a subset of these address types for a compliant implementation. The tesid is used as a service selector for MAs that are present in Bridges that implement PBB-TE functionality. A selector of this type is interpreted as a 32 bit unsigned value of type IEEE8021PbbTeTSidId. This type is used to index the ieee8021PbbTeTeSiEspTable to find the ESPs which comprise the TE Service Instance named by this TE-SID value. The segid is used as a service selector for MAs that are present in Bridges that implement IPS functionality. A selector of this type is interpreted as a 32 bit unsigned value of type IEEE8021TeipsSegid. This type is used to index the Ieee8021TeipsSegTable to find the SMPs which comprise the Infrastructure Segment named by this segid value. The path-tesid is used as a service selector for SPBM path MAs. A selector of this type is interpreted as a 32 bit unsigned value corresponding to the MA index dot1agCfmMaIndex. This type is used to index the dot1agCfmMepSpbmEspTable to find the ESPs which comprise the SPBM path associated with an SPBM path MA. The group-isid is used as a service selector for SPBM group MAs. A selector of this type is interpreted as a 24 bit unsigned value corresponding to the I-SID associated with an SPBM group MA. Implementations MUST ensure that IEEE8021ServiceSelectorType objects and any dependent objects (e.g., IEEE8021ServiceSelectorValue objects) are consistent. An inconsistentValue error MUST be generated if an attempt to change an IEEE8021ServiceSelectorType object would, for example, lead to an undefined IEEE8021ServiceSelectorValue value.'
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))
namedValues = NamedValues(("vlanId", 1), ("isid", 2), ("tesid", 3), ("segid", 4), ("path-tesid", 5), ("group-isid", 6), ("ieeeReserved", 7))
class IEEE8021ServiceSelectorValueOrNone(TextualConvention, Unsigned32):
description = "An integer that uniquely identifies a generic MAC Service, or none. Examples of service selectors are a VLAN-ID (IEEE 802.1Q) and an I-SID (IEEE 802.1ah). An IEEE8021ServiceSelectorValueOrNone value is always interpreted within the context of an IEEE8021ServiceSelectorType value. Every usage of the IEEE8021ServiceSelectorValueOrNone textual convention is required to specify the IEEE8021ServiceSelectorType object that provides the context. It is suggested that the IEEE8021ServiceSelectorType object be logically registered before the object(s) that use the IEEE8021ServiceSelectorValueOrNone textual convention, if they appear in the same logical row. The value of an IEEE8021ServiceSelectorValueOrNone object must always be consistent with the value of the associated IEEE8021ServiceSelectorType object. Attempts to set an IEEE8021ServiceSelectorValueOrNone object to a value inconsistent with the associated IEEE8021ServiceSelectorType must fail with an inconsistentValue error. The special value of zero is used to indicate that no service selector is present or used. This can be used in any situation where an object or a table entry MUST either refer to a specific service, or not make a selection. Note that a MIB object that is defined using this TEXTUAL-CONVENTION SHOULD clarify the meaning of 'no service' (i.e., the special value 0), as well as the maximum value (i.e., 4094, for a VLAN ID)."
status = 'current'
displayHint = 'd'
subtypeSpec = Unsigned32.subtypeSpec + ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 4294967295), )
class IEEE8021ServiceSelectorValue(TextualConvention, Unsigned32):
description = 'An integer that uniquely identifies a generic MAC Service. Examples of service selectors are a VLAN-ID (IEEE 802.1Q) and an I-SID (IEEE 802.1ah). An IEEE8021ServiceSelectorValue value is always interpreted within the context of an IEEE8021ServiceSelectorType value. Every usage of the IEEE8021ServiceSelectorValue textual convention is required to specify the IEEE8021ServiceSelectorType object that provides the context. It is suggested that the IEEE8021ServiceSelectorType object be logically registered before the object(s) that use the IEEE8021ServiceSelectorValue textual convention, if they appear in the same logical row. The value of an IEEE8021ServiceSelectorValue object must always be consistent with the value of the associated IEEE8021ServiceSelectorType object. Attempts to set an IEEE8021ServiceSelectorValue object to a value inconsistent with the associated IEEE8021ServiceSelectorType must fail with an inconsistentValue error. Note that a MIB object that is defined using this TEXTUAL-CONVENTION SHOULD clarify the maximum value (i.e., 4094, for a VLAN ID).'
status = 'current'
displayHint = 'd'
subtypeSpec = Unsigned32.subtypeSpec + ValueRangeConstraint(1, 4294967295)
class IEEE8021PortAcceptableFrameTypes(TextualConvention, Integer32):
reference = '12.10.1.3, 12.13.3.3, 12.13.3.4'
description = 'Acceptable frame types on a port.'
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3))
namedValues = NamedValues(("admitAll", 1), ("admitUntaggedAndPriority", 2), ("admitTagged", 3))
class IEEE8021PriorityValue(TextualConvention, Unsigned32):
reference = '12.13.3.3'
description = 'An 802.1Q user priority value.'
status = 'current'
displayHint = 'd'
subtypeSpec = Unsigned32.subtypeSpec + ValueRangeConstraint(0, 7)
class IEEE8021PbbTeProtectionGroupId(TextualConvention, Unsigned32):
reference = '12.18.2'
description = 'The PbbTeProtectionGroupId identifier is used to distinguish protection group instances present in the B Component of an IB-BEB.'
status = 'current'
displayHint = 'd'
subtypeSpec = Unsigned32.subtypeSpec + ValueRangeConstraint(1, 429467295)
class IEEE8021PbbTeEsp(TextualConvention, OctetString):
reference = '3.75'
description = 'This textual convention is used to represent the logical components that comprise the 3-tuple that identifies an Ethernet Switched Path. The 3-tuple consists of a destination MAC address, a source MAC address and a VID. Bytes (1..6) of this textual convention contain the ESP-MAC-DA, bytes (7..12) contain the ESP-MAC-SA, and bytes (13..14) contain the ESP-VID.'
status = 'current'
subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(14, 14)
fixedLength = 14
class IEEE8021PbbTeTSidId(TextualConvention, Unsigned32):
reference = '3.240'
description = 'This textual convention is used to represent an identifier that refers to a TE Service Instance. Note that, internally a TE-SID is implementation dependent. This textual convention defines the external representation of TE-SID values.'
status = 'current'
displayHint = 'd'
subtypeSpec = Unsigned32.subtypeSpec + ValueRangeConstraint(1, 42947295)
class IEEE8021PbbTeProtectionGroupConfigAdmin(TextualConvention, Integer32):
reference = '26.10.3.3.5 26.10.3.3.6 26.10.3.3.7 12.18.2.3.2'
description = 'This textual convention is used to represent administrative commands that can be issued to a protection group. The value noAdmin(1) is used to indicate that no administrative action is to be performed.'
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))
namedValues = NamedValues(("clear", 1), ("lockOutProtection", 2), ("forceSwitch", 3), ("manualSwitchToProtection", 4), ("manualSwitchToWorking", 5))
class IEEE8021PbbTeProtectionGroupActiveRequests(TextualConvention, Integer32):
reference = '12.18.2.1.3 d)'
description = 'This textual convention is used to represent the status of active requests within a protection group.'
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))
namedValues = NamedValues(("noRequest", 1), ("loP", 2), ("fs", 3), ("pSFH", 4), ("wSFH", 5), ("manualSwitchToProtection", 6), ("manualSwitchToWorking", 7))
class IEEE8021TeipsIpgid(TextualConvention, Unsigned32):
reference = '12.24.1.1.3 a)'
description = 'The TEIPS IPG identifier is used to distinguish IPG instances present in a PBB.'
status = 'current'
displayHint = 'd'
subtypeSpec = Unsigned32.subtypeSpec + ValueRangeConstraint(1, 429467295)
class IEEE8021TeipsSegid(TextualConvention, Unsigned32):
reference = '26.11.1'
description = 'This textual convention is used to represent an identifier that refers to an Infrastructure Segment. Note that, internally a SEG-ID implementation dependent. This textual convention defines the external representation of SEG-ID values.'
status = 'current'
displayHint = 'd'
subtypeSpec = Unsigned32.subtypeSpec + ValueRangeConstraint(1, 42947295)
class IEEE8021TeipsSmpid(TextualConvention, OctetString):
reference = '26.11.1'
description = 'This textual convention is used to represent the logical components that comprise the 3-tuple that identifies a Segment Monitoring Path (SMP). The 3-tuple consists of a destination MAC address, a source MAC address and a VID. Bytes (1..6) of this textual convention contain the SMP-MAC-DA, bytes (7..12) contain the SMP-MAC-SA, and bytes (13..14) contain the SMP-VID.'
status = 'current'
subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(14, 14)
fixedLength = 14
class IEEE8021TeipsIpgConfigAdmin(TextualConvention, Integer32):
reference = '12.24.2.1.3 h)'
description = 'This textual convention is used to represent administrative commands that can be issued to an IPG. The value clear(1) is used to indicate that no administrative action is to be performed.'
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))
namedValues = NamedValues(("clear", 1), ("lockOutProtection", 2), ("forceSwitch", 3), ("manualSwitchToProtection", 4), ("manualSwitchToWorking", 5))
class IEEE8021TeipsIpgConfigActiveRequests(TextualConvention, Integer32):
reference = '12.24.2.1.3 d)'
description = 'This textual convention is used to represent the status of active requests within an IPG.'
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))
namedValues = NamedValues(("noRequest", 1), ("loP", 2), ("fs", 3), ("pSFH", 4), ("wSFH", 5), ("manualSwitchToProtection", 6), ("manualSwitchToWorking", 7))
mibBuilder.exportSymbols("IEEE8021-TC-MIB", IEEE8021BridgePortNumber=IEEE8021BridgePortNumber, IEEE8021ServiceSelectorValue=IEEE8021ServiceSelectorValue, IEEE8021PortAcceptableFrameTypes=IEEE8021PortAcceptableFrameTypes, IEEE8021TeipsSegid=IEEE8021TeipsSegid, IEEE8021PbbIngressEgress=IEEE8021PbbIngressEgress, IEEE8021BridgePortType=IEEE8021BridgePortType, IEEE8021PriorityValue=IEEE8021PriorityValue, IEEE8021TeipsIpgid=IEEE8021TeipsIpgid, IEEE8021PbbTeProtectionGroupConfigAdmin=IEEE8021PbbTeProtectionGroupConfigAdmin, IEEE8021VlanIndexOrWildcard=IEEE8021VlanIndexOrWildcard, IEEE8021TeipsIpgConfigActiveRequests=IEEE8021TeipsIpgConfigActiveRequests, ieee8021TcMib=ieee8021TcMib, IEEE8021PbbServiceIdentifier=IEEE8021PbbServiceIdentifier, IEEE8021ServiceSelectorValueOrNone=IEEE8021ServiceSelectorValueOrNone, IEEE8021VlanIndex=IEEE8021VlanIndex, IEEE8021ServiceSelectorType=IEEE8021ServiceSelectorType, IEEE8021PbbTeProtectionGroupActiveRequests=IEEE8021PbbTeProtectionGroupActiveRequests, IEEE8021MstIdentifier=IEEE8021MstIdentifier, IEEE8021PbbServiceIdentifierOrUnassigned=IEEE8021PbbServiceIdentifierOrUnassigned, IEEE8021PbbTeEsp=IEEE8021PbbTeEsp, IEEE8021PbbComponentIdentifier=IEEE8021PbbComponentIdentifier, IEEE8021PbbTeTSidId=IEEE8021PbbTeTSidId, IEEE8021TeipsSmpid=IEEE8021TeipsSmpid, PYSNMP_MODULE_ID=ieee8021TcMib, IEEE8021PbbTeProtectionGroupId=IEEE8021PbbTeProtectionGroupId, ieee802dot1mibs=ieee802dot1mibs, IEEE8021PriorityCodePoint=IEEE8021PriorityCodePoint, IEEE8021TeipsIpgConfigAdmin=IEEE8021TeipsIpgConfigAdmin, IEEE8021PbbComponentIdentifierOrZero=IEEE8021PbbComponentIdentifierOrZero, IEEE8021BridgePortNumberOrZero=IEEE8021BridgePortNumberOrZero)
| 126.263415
| 2,420
| 0.78508
| 3,364
| 25,884
| 6.039834
| 0.178954
| 0.008564
| 0.008269
| 0.019687
| 0.535437
| 0.502855
| 0.489615
| 0.476819
| 0.464908
| 0.445516
| 0
| 0.070011
| 0.1397
| 25,884
| 204
| 2,421
| 126.882353
| 0.84242
| 0.012517
| 0
| 0.439306
| 0
| 0.16763
| 0.620054
| 0.054636
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.034682
| 0
| 0.942197
| 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
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
02dad5c5393d72a0780bdfb4e0ff39d6814067ce
| 2,228
|
py
|
Python
|
tbot/migrations/20190504_01_rueSL-discord-log.py
|
thomaserlang/tbot
|
99cfa204d86ef35cf2cc9482ae5a44abb35b443a
|
[
"MIT"
] | null | null | null |
tbot/migrations/20190504_01_rueSL-discord-log.py
|
thomaserlang/tbot
|
99cfa204d86ef35cf2cc9482ae5a44abb35b443a
|
[
"MIT"
] | 10
|
2022-02-14T11:40:20.000Z
|
2022-03-09T22:44:03.000Z
|
tbot/migrations/20190504_01_rueSL-discord-log.py
|
thomaserlang/tbot
|
99cfa204d86ef35cf2cc9482ae5a44abb35b443a
|
[
"MIT"
] | 1
|
2020-09-19T16:38:24.000Z
|
2020-09-19T16:38:24.000Z
|
"""
discord_log
"""
from yoyo import step
__depends__ = {'20190202_03_8ebYl-twitch-timers'}
steps = [
step('''
CREATE TABLE IF NOT EXISTS `discord_chatlog` (
`id` varchar(30) NOT NULL,
`server_id` varchar(30) DEFAULT NULL,
`channel_id` varchar(30) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`message` text,
`attachments` text,
`user` varchar(32) DEFAULT NULL,
`user_id` varchar(30) DEFAULT NULL,
`user_discriminator` varchar(10) DEFAULT NULL,
`deleted` enum('Y','N') DEFAULT 'N',
`deleted_at` datetime DEFAULT NULL,
`member_nick` varchar(32) DEFAULT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8mb4;
'''),
step('''
CREATE TABLE IF NOT EXISTS `discord_chatlog_versions` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`entry_id` varchar(30) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`message` text,
`attachments` text,
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8mb4;
'''),
step('''
CREATE TABLE IF NOT EXISTS `discord_server_join_log` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`server_id` VARCHAR(30) NOT NULL,
`action` TINYINT UNSIGNED NOT NULL COMMENT '0 is leave 1 is joined',
`user_id` VARCHAR(30) NOT NULL,
`user` VARCHAR(32) NOT NULL,
`user_discriminator` VARCHAR(10) NOT NULL,
`member_nick` VARCHAR(32) DEFAULT NULL,
`created_at` DATETIME NOT NULL,
PRIMARY KEY (`id`)
) COLLATE='utf8mb4_unicode_ci';
'''),
step('''
CREATE TABLE IF NOT EXISTS `discord_voice_join_log` (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`server_id` VARCHAR(30) NOT NULL,
`user` VARCHAR(32) NOT NULL,
`user_id` VARCHAR(30) NOT NULL,
`user_discriminator` VARCHAR(10) NOT NULL,
`member_nick` VARCHAR(32) DEFAULT NULL,
`action` TINYINT NOT NULL COMMENT '0 is leave 1 is joined',
`channel_id` VARCHAR(30) NOT NULL,
`channel_name` VARCHAR(32) NOT NULL,
`created_at` DATETIME NOT NULL,
PRIMARY KEY (`id`)
) COLLATE='utf8mb4_unicode_ci';
''')
]
| 33.253731
| 76
| 0.623878
| 283
| 2,228
| 4.75265
| 0.240283
| 0.09368
| 0.081784
| 0.062454
| 0.813383
| 0.728625
| 0.728625
| 0.667658
| 0.552416
| 0.50632
| 0
| 0.041768
| 0.258528
| 2,228
| 66
| 77
| 33.757576
| 0.772397
| 0.004937
| 0
| 0.583333
| 0
| 0
| 0.942055
| 0.074242
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.016667
| 0
| 0.016667
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
02fb3abb66abd3620130993561d16d7477c0c830
| 292
|
py
|
Python
|
components/collector/src/source_collectors/cobertura/uncovered_branches.py
|
kargaranamir/quality-time
|
1c427c61bee9d31c3526f0a01be2218a7e167c23
|
[
"Apache-2.0"
] | 33
|
2016-01-20T07:35:48.000Z
|
2022-03-14T09:20:51.000Z
|
components/collector/src/source_collectors/cobertura/uncovered_branches.py
|
kargaranamir/quality-time
|
1c427c61bee9d31c3526f0a01be2218a7e167c23
|
[
"Apache-2.0"
] | 2,410
|
2016-01-22T18:13:01.000Z
|
2022-03-31T16:57:34.000Z
|
components/collector/src/source_collectors/cobertura/uncovered_branches.py
|
kargaranamir/quality-time
|
1c427c61bee9d31c3526f0a01be2218a7e167c23
|
[
"Apache-2.0"
] | 21
|
2016-01-16T11:49:23.000Z
|
2022-01-14T21:53:22.000Z
|
"""Cobertura coverage report uncovered branches collector."""
from .base import CoberturaCoverageBaseClass
class CoberturaUncoveredBranches(CoberturaCoverageBaseClass):
"""Source class to get the number of uncovered lines from Cobertura XML reports."""
coverage_type = "branches"
| 29.2
| 87
| 0.791096
| 29
| 292
| 7.931034
| 0.758621
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.136986
| 292
| 9
| 88
| 32.444444
| 0.912698
| 0.455479
| 0
| 0
| 0
| 0
| 0.054054
| 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
|
f3186060f8a7e0f73345e711be4038650ff3a9c3
| 5,696
|
py
|
Python
|
google/ads/google_ads/v6/proto/services/feed_item_target_service_pb2_grpc.py
|
jphanwebstaurant/google-ads-python
|
600812b2afcc4d57f00b47dfe436620ce50bfe9b
|
[
"Apache-2.0"
] | 1
|
2021-04-09T04:28:47.000Z
|
2021-04-09T04:28:47.000Z
|
google/ads/google_ads/v6/proto/services/feed_item_target_service_pb2_grpc.py
|
jphanwebstaurant/google-ads-python
|
600812b2afcc4d57f00b47dfe436620ce50bfe9b
|
[
"Apache-2.0"
] | null | null | null |
google/ads/google_ads/v6/proto/services/feed_item_target_service_pb2_grpc.py
|
jphanwebstaurant/google-ads-python
|
600812b2afcc4d57f00b47dfe436620ce50bfe9b
|
[
"Apache-2.0"
] | null | null | null |
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from google.ads.google_ads.v6.proto.resources import feed_item_target_pb2 as google_dot_ads_dot_googleads__v6_dot_proto_dot_resources_dot_feed__item__target__pb2
from google.ads.google_ads.v6.proto.services import feed_item_target_service_pb2 as google_dot_ads_dot_googleads__v6_dot_proto_dot_services_dot_feed__item__target__service__pb2
class FeedItemTargetServiceStub(object):
"""Proto file describing the FeedItemTarget service.
Service to manage feed item targets.
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.GetFeedItemTarget = channel.unary_unary(
'/google.ads.googleads.v6.services.FeedItemTargetService/GetFeedItemTarget',
request_serializer=google_dot_ads_dot_googleads__v6_dot_proto_dot_services_dot_feed__item__target__service__pb2.GetFeedItemTargetRequest.SerializeToString,
response_deserializer=google_dot_ads_dot_googleads__v6_dot_proto_dot_resources_dot_feed__item__target__pb2.FeedItemTarget.FromString,
)
self.MutateFeedItemTargets = channel.unary_unary(
'/google.ads.googleads.v6.services.FeedItemTargetService/MutateFeedItemTargets',
request_serializer=google_dot_ads_dot_googleads__v6_dot_proto_dot_services_dot_feed__item__target__service__pb2.MutateFeedItemTargetsRequest.SerializeToString,
response_deserializer=google_dot_ads_dot_googleads__v6_dot_proto_dot_services_dot_feed__item__target__service__pb2.MutateFeedItemTargetsResponse.FromString,
)
class FeedItemTargetServiceServicer(object):
"""Proto file describing the FeedItemTarget service.
Service to manage feed item targets.
"""
def GetFeedItemTarget(self, request, context):
"""Returns the requested feed item targets in full detail.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def MutateFeedItemTargets(self, request, context):
"""Creates or removes feed item targets. Operation statuses are returned.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_FeedItemTargetServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
'GetFeedItemTarget': grpc.unary_unary_rpc_method_handler(
servicer.GetFeedItemTarget,
request_deserializer=google_dot_ads_dot_googleads__v6_dot_proto_dot_services_dot_feed__item__target__service__pb2.GetFeedItemTargetRequest.FromString,
response_serializer=google_dot_ads_dot_googleads__v6_dot_proto_dot_resources_dot_feed__item__target__pb2.FeedItemTarget.SerializeToString,
),
'MutateFeedItemTargets': grpc.unary_unary_rpc_method_handler(
servicer.MutateFeedItemTargets,
request_deserializer=google_dot_ads_dot_googleads__v6_dot_proto_dot_services_dot_feed__item__target__service__pb2.MutateFeedItemTargetsRequest.FromString,
response_serializer=google_dot_ads_dot_googleads__v6_dot_proto_dot_services_dot_feed__item__target__service__pb2.MutateFeedItemTargetsResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'google.ads.googleads.v6.services.FeedItemTargetService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
# This class is part of an EXPERIMENTAL API.
class FeedItemTargetService(object):
"""Proto file describing the FeedItemTarget service.
Service to manage feed item targets.
"""
@staticmethod
def GetFeedItemTarget(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/google.ads.googleads.v6.services.FeedItemTargetService/GetFeedItemTarget',
google_dot_ads_dot_googleads__v6_dot_proto_dot_services_dot_feed__item__target__service__pb2.GetFeedItemTargetRequest.SerializeToString,
google_dot_ads_dot_googleads__v6_dot_proto_dot_resources_dot_feed__item__target__pb2.FeedItemTarget.FromString,
options, channel_credentials,
call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def MutateFeedItemTargets(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/google.ads.googleads.v6.services.FeedItemTargetService/MutateFeedItemTargets',
google_dot_ads_dot_googleads__v6_dot_proto_dot_services_dot_feed__item__target__service__pb2.MutateFeedItemTargetsRequest.SerializeToString,
google_dot_ads_dot_googleads__v6_dot_proto_dot_services_dot_feed__item__target__service__pb2.MutateFeedItemTargetsResponse.FromString,
options, channel_credentials,
call_credentials, compression, wait_for_ready, timeout, metadata)
| 51.781818
| 181
| 0.753687
| 606
| 5,696
| 6.523102
| 0.183168
| 0.042499
| 0.056666
| 0.053124
| 0.767518
| 0.762206
| 0.74981
| 0.696686
| 0.696686
| 0.663294
| 0
| 0.008002
| 0.188202
| 5,696
| 109
| 182
| 52.256881
| 0.846886
| 0.112184
| 0
| 0.422535
| 1
| 0
| 0.097424
| 0.075483
| 0
| 0
| 0
| 0
| 0
| 1
| 0.084507
| false
| 0
| 0.042254
| 0.028169
| 0.197183
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
b844799a51618d2c664689cc00e903342f64e3f2
| 102
|
py
|
Python
|
example_contests/fk_2014_delta/problems/pizza/solution.py
|
ForritunarkeppniFramhaldsskolanna/epsilon
|
a31260ad33aba3d1846cda585840d7e7d2f2349c
|
[
"MIT"
] | 6
|
2016-03-28T13:57:54.000Z
|
2017-07-25T06:04:05.000Z
|
example_contests/fk_2014_delta/problems/pizza/solution.py
|
ForritunarkeppniFramhaldsskolanna/epsilon
|
a31260ad33aba3d1846cda585840d7e7d2f2349c
|
[
"MIT"
] | 25
|
2015-01-23T18:02:35.000Z
|
2015-03-17T01:40:27.000Z
|
example_contests/fk_2014_delta/problems/pizza/solution.py
|
ForritunarkeppniFramhaldsskolanna/epsilon
|
a31260ad33aba3d1846cda585840d7e7d2f2349c
|
[
"MIT"
] | 3
|
2016-06-28T00:48:38.000Z
|
2017-05-25T05:29:25.000Z
|
from math import ceil
n = int(input())
print(int(ceil(sum( int(input()) for _ in range(n)) / 8.0)))
| 17
| 60
| 0.627451
| 19
| 102
| 3.315789
| 0.736842
| 0.253968
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.023529
| 0.166667
| 102
| 5
| 61
| 20.4
| 0.717647
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0.333333
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
b84b53328f6141df0eb09fde970c641d50f0da29
| 212
|
py
|
Python
|
src/sparkstart.py
|
pambot/ozymandias
|
21dd8323c586e0d5019be10e831afde1d32a8e71
|
[
"MIT"
] | 33
|
2017-11-29T06:43:56.000Z
|
2021-07-23T14:00:05.000Z
|
src/sparkstart.py
|
pambot/ozymandias
|
21dd8323c586e0d5019be10e831afde1d32a8e71
|
[
"MIT"
] | 1
|
2017-12-11T09:26:28.000Z
|
2017-12-11T09:26:28.000Z
|
src/sparkstart.py
|
pambot/ozymandias
|
21dd8323c586e0d5019be10e831afde1d32a8e71
|
[
"MIT"
] | 15
|
2018-01-21T15:48:33.000Z
|
2022-02-12T19:58:09.000Z
|
import cv2
MODEL_PATH = '/home/ubuntu/models/'
models = (
cv2.CascadeClassifier(MODEL_PATH + 'haarcascade_frontalface_default.xml'),
cv2.CascadeClassifier(MODEL_PATH + 'haarcascade_profileface.xml'),
)
| 23.555556
| 78
| 0.759434
| 23
| 212
| 6.73913
| 0.565217
| 0.174194
| 0.322581
| 0.374194
| 0.516129
| 0
| 0
| 0
| 0
| 0
| 0
| 0.016043
| 0.117925
| 212
| 8
| 79
| 26.5
| 0.812834
| 0
| 0
| 0
| 0
| 0
| 0.386792
| 0.292453
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.166667
| 0
| 0.166667
| 0
| 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
|
b87ca24c71fc7609cddd73312e6b045163a5e1e3
| 55
|
py
|
Python
|
marmot/features/tfidf_feature_extractor.py
|
qe-team/marmot
|
38e09ff1d0a3025a6b7edeaaf6086ed047ec45ff
|
[
"0BSD"
] | 19
|
2015-08-21T13:06:37.000Z
|
2021-07-26T09:56:29.000Z
|
marmot/features/tfidf_feature_extractor.py
|
qe-team/marmot
|
38e09ff1d0a3025a6b7edeaaf6086ed047ec45ff
|
[
"0BSD"
] | 36
|
2015-01-13T13:01:07.000Z
|
2016-06-22T06:59:59.000Z
|
marmot/features/tfidf_feature_extractor.py
|
qe-team/marmot
|
38e09ff1d0a3025a6b7edeaaf6086ed047ec45ff
|
[
"0BSD"
] | 8
|
2015-12-11T16:41:47.000Z
|
2019-04-08T16:28:40.000Z
|
# build a tfidf index in def __init__(corpus_file_name)
| 55
| 55
| 0.818182
| 10
| 55
| 3.9
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.127273
| 55
| 1
| 55
| 55
| 0.8125
| 0.963636
| 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
|
b89aedf0a62068f56fb557254ac4d4f019a87fa1
| 95
|
py
|
Python
|
src/whiteboard/apps.py
|
Ameesha2001/Ekyam-scl-maxo
|
d9a8ec0e2d297d20fcf9139cfe50a7c814cdb2f5
|
[
"MIT"
] | 10
|
2021-01-02T14:54:33.000Z
|
2022-02-09T07:11:05.000Z
|
src/whiteboard/apps.py
|
Ameesha2001/Ekyam-scl-maxo
|
d9a8ec0e2d297d20fcf9139cfe50a7c814cdb2f5
|
[
"MIT"
] | 2
|
2021-01-06T09:04:24.000Z
|
2021-01-08T06:20:34.000Z
|
src/whiteboard/apps.py
|
Ameesha2001/Ekyam-scl-maxo
|
d9a8ec0e2d297d20fcf9139cfe50a7c814cdb2f5
|
[
"MIT"
] | 8
|
2020-12-24T07:58:24.000Z
|
2022-01-04T15:22:30.000Z
|
from django.apps import AppConfig
class WhiteboardConfig(AppConfig):
name = 'whiteboard'
| 15.833333
| 34
| 0.768421
| 10
| 95
| 7.3
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.157895
| 95
| 5
| 35
| 19
| 0.9125
| 0
| 0
| 0
| 0
| 0
| 0.105263
| 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
|
b8b45b14ea03c64e028381396f0807655dee97b0
| 223
|
py
|
Python
|
helpers.py
|
markoelez/basicfs
|
5738ed9125795cd90eda223fcff2296753bb161b
|
[
"MIT"
] | null | null | null |
helpers.py
|
markoelez/basicfs
|
5738ed9125795cd90eda223fcff2296753bb161b
|
[
"MIT"
] | null | null | null |
helpers.py
|
markoelez/basicfs
|
5738ed9125795cd90eda223fcff2296753bb161b
|
[
"MIT"
] | null | null | null |
def respond(start_response, code, headers=[('Content-type', 'text/plain')], body=b''):
start_response(code, headers)
return [body]
def key2path(key):
b = key.encode('utf-8')
return hashlib.md5(b).digest()
| 24.777778
| 86
| 0.654709
| 31
| 223
| 4.645161
| 0.677419
| 0.180556
| 0.236111
| 0.333333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.015957
| 0.156951
| 223
| 8
| 87
| 27.875
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0.121622
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0
| 0.666667
| 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
|
b210f20a0c53b1341ae8c551bf19196a463f8e65
| 7,588
|
py
|
Python
|
src/main/resources/pytz/zoneinfo/Europe/Amsterdam.py
|
TheEin/swagger-maven-plugin
|
cf93dce2d5c8d3534f4cf8c612b11e2d2313871b
|
[
"Apache-2.0"
] | 65
|
2015-11-14T13:46:01.000Z
|
2021-08-14T05:54:04.000Z
|
lib/pytz/zoneinfo/Europe/Amsterdam.py
|
tjsavage/polymer-dashboard
|
19bc467f1206613f8eec646b6f2bc43cc319ef75
|
[
"CNRI-Python",
"Linux-OpenIB"
] | 13
|
2016-03-31T20:00:17.000Z
|
2021-08-20T14:52:31.000Z
|
lib/pytz/zoneinfo/Europe/Amsterdam.py
|
tjsavage/polymer-dashboard
|
19bc467f1206613f8eec646b6f2bc43cc319ef75
|
[
"CNRI-Python",
"Linux-OpenIB"
] | 20
|
2015-03-18T08:41:37.000Z
|
2020-12-18T02:58:30.000Z
|
'''tzinfo timezone information for Europe/Amsterdam.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Amsterdam(DstTzInfo):
'''Europe/Amsterdam timezone definition. See datetime.tzinfo for details'''
zone = 'Europe/Amsterdam'
_utc_transition_times = [
d(1,1,1,0,0,0),
d(1916,4,30,23,40,28),
d(1916,9,30,22,40,28),
d(1917,4,16,1,40,28),
d(1917,9,17,1,40,28),
d(1918,4,1,1,40,28),
d(1918,9,30,1,40,28),
d(1919,4,7,1,40,28),
d(1919,9,29,1,40,28),
d(1920,4,5,1,40,28),
d(1920,9,27,1,40,28),
d(1921,4,4,1,40,28),
d(1921,9,26,1,40,28),
d(1922,3,26,1,40,28),
d(1922,10,8,1,40,28),
d(1923,6,1,1,40,28),
d(1923,10,7,1,40,28),
d(1924,3,30,1,40,28),
d(1924,10,5,1,40,28),
d(1925,6,5,1,40,28),
d(1925,10,4,1,40,28),
d(1926,5,15,1,40,28),
d(1926,10,3,1,40,28),
d(1927,5,15,1,40,28),
d(1927,10,2,1,40,28),
d(1928,5,15,1,40,28),
d(1928,10,7,1,40,28),
d(1929,5,15,1,40,28),
d(1929,10,6,1,40,28),
d(1930,5,15,1,40,28),
d(1930,10,5,1,40,28),
d(1931,5,15,1,40,28),
d(1931,10,4,1,40,28),
d(1932,5,22,1,40,28),
d(1932,10,2,1,40,28),
d(1933,5,15,1,40,28),
d(1933,10,8,1,40,28),
d(1934,5,15,1,40,28),
d(1934,10,7,1,40,28),
d(1935,5,15,1,40,28),
d(1935,10,6,1,40,28),
d(1936,5,15,1,40,28),
d(1936,10,4,1,40,28),
d(1937,5,22,1,40,28),
d(1937,6,30,22,40,28),
d(1937,10,3,1,40,0),
d(1938,5,15,1,40,0),
d(1938,10,2,1,40,0),
d(1939,5,15,1,40,0),
d(1939,10,8,1,40,0),
d(1940,5,15,23,40,0),
d(1942,11,2,1,0,0),
d(1943,3,29,1,0,0),
d(1943,10,4,1,0,0),
d(1944,4,3,1,0,0),
d(1944,10,2,1,0,0),
d(1945,4,2,1,0,0),
d(1945,9,16,1,0,0),
d(1976,12,31,23,0,0),
d(1977,4,3,1,0,0),
d(1977,9,25,1,0,0),
d(1978,4,2,1,0,0),
d(1978,10,1,1,0,0),
d(1979,4,1,1,0,0),
d(1979,9,30,1,0,0),
d(1980,4,6,1,0,0),
d(1980,9,28,1,0,0),
d(1981,3,29,1,0,0),
d(1981,9,27,1,0,0),
d(1982,3,28,1,0,0),
d(1982,9,26,1,0,0),
d(1983,3,27,1,0,0),
d(1983,9,25,1,0,0),
d(1984,3,25,1,0,0),
d(1984,9,30,1,0,0),
d(1985,3,31,1,0,0),
d(1985,9,29,1,0,0),
d(1986,3,30,1,0,0),
d(1986,9,28,1,0,0),
d(1987,3,29,1,0,0),
d(1987,9,27,1,0,0),
d(1988,3,27,1,0,0),
d(1988,9,25,1,0,0),
d(1989,3,26,1,0,0),
d(1989,9,24,1,0,0),
d(1990,3,25,1,0,0),
d(1990,9,30,1,0,0),
d(1991,3,31,1,0,0),
d(1991,9,29,1,0,0),
d(1992,3,29,1,0,0),
d(1992,9,27,1,0,0),
d(1993,3,28,1,0,0),
d(1993,9,26,1,0,0),
d(1994,3,27,1,0,0),
d(1994,9,25,1,0,0),
d(1995,3,26,1,0,0),
d(1995,9,24,1,0,0),
d(1996,3,31,1,0,0),
d(1996,10,27,1,0,0),
d(1997,3,30,1,0,0),
d(1997,10,26,1,0,0),
d(1998,3,29,1,0,0),
d(1998,10,25,1,0,0),
d(1999,3,28,1,0,0),
d(1999,10,31,1,0,0),
d(2000,3,26,1,0,0),
d(2000,10,29,1,0,0),
d(2001,3,25,1,0,0),
d(2001,10,28,1,0,0),
d(2002,3,31,1,0,0),
d(2002,10,27,1,0,0),
d(2003,3,30,1,0,0),
d(2003,10,26,1,0,0),
d(2004,3,28,1,0,0),
d(2004,10,31,1,0,0),
d(2005,3,27,1,0,0),
d(2005,10,30,1,0,0),
d(2006,3,26,1,0,0),
d(2006,10,29,1,0,0),
d(2007,3,25,1,0,0),
d(2007,10,28,1,0,0),
d(2008,3,30,1,0,0),
d(2008,10,26,1,0,0),
d(2009,3,29,1,0,0),
d(2009,10,25,1,0,0),
d(2010,3,28,1,0,0),
d(2010,10,31,1,0,0),
d(2011,3,27,1,0,0),
d(2011,10,30,1,0,0),
d(2012,3,25,1,0,0),
d(2012,10,28,1,0,0),
d(2013,3,31,1,0,0),
d(2013,10,27,1,0,0),
d(2014,3,30,1,0,0),
d(2014,10,26,1,0,0),
d(2015,3,29,1,0,0),
d(2015,10,25,1,0,0),
d(2016,3,27,1,0,0),
d(2016,10,30,1,0,0),
d(2017,3,26,1,0,0),
d(2017,10,29,1,0,0),
d(2018,3,25,1,0,0),
d(2018,10,28,1,0,0),
d(2019,3,31,1,0,0),
d(2019,10,27,1,0,0),
d(2020,3,29,1,0,0),
d(2020,10,25,1,0,0),
d(2021,3,28,1,0,0),
d(2021,10,31,1,0,0),
d(2022,3,27,1,0,0),
d(2022,10,30,1,0,0),
d(2023,3,26,1,0,0),
d(2023,10,29,1,0,0),
d(2024,3,31,1,0,0),
d(2024,10,27,1,0,0),
d(2025,3,30,1,0,0),
d(2025,10,26,1,0,0),
d(2026,3,29,1,0,0),
d(2026,10,25,1,0,0),
d(2027,3,28,1,0,0),
d(2027,10,31,1,0,0),
d(2028,3,26,1,0,0),
d(2028,10,29,1,0,0),
d(2029,3,25,1,0,0),
d(2029,10,28,1,0,0),
d(2030,3,31,1,0,0),
d(2030,10,27,1,0,0),
d(2031,3,30,1,0,0),
d(2031,10,26,1,0,0),
d(2032,3,28,1,0,0),
d(2032,10,31,1,0,0),
d(2033,3,27,1,0,0),
d(2033,10,30,1,0,0),
d(2034,3,26,1,0,0),
d(2034,10,29,1,0,0),
d(2035,3,25,1,0,0),
d(2035,10,28,1,0,0),
d(2036,3,30,1,0,0),
d(2036,10,26,1,0,0),
d(2037,3,29,1,0,0),
d(2037,10,25,1,0,0),
]
_transition_info = [
i(1200,0,'AMT'),
i(4800,3600,'NST'),
i(1200,0,'AMT'),
i(4800,3600,'NST'),
i(1200,0,'AMT'),
i(4800,3600,'NST'),
i(1200,0,'AMT'),
i(4800,3600,'NST'),
i(1200,0,'AMT'),
i(4800,3600,'NST'),
i(1200,0,'AMT'),
i(4800,3600,'NST'),
i(1200,0,'AMT'),
i(4800,3600,'NST'),
i(1200,0,'AMT'),
i(4800,3600,'NST'),
i(1200,0,'AMT'),
i(4800,3600,'NST'),
i(1200,0,'AMT'),
i(4800,3600,'NST'),
i(1200,0,'AMT'),
i(4800,3600,'NST'),
i(1200,0,'AMT'),
i(4800,3600,'NST'),
i(1200,0,'AMT'),
i(4800,3600,'NST'),
i(1200,0,'AMT'),
i(4800,3600,'NST'),
i(1200,0,'AMT'),
i(4800,3600,'NST'),
i(1200,0,'AMT'),
i(4800,3600,'NST'),
i(1200,0,'AMT'),
i(4800,3600,'NST'),
i(1200,0,'AMT'),
i(4800,3600,'NST'),
i(1200,0,'AMT'),
i(4800,3600,'NST'),
i(1200,0,'AMT'),
i(4800,3600,'NST'),
i(1200,0,'AMT'),
i(4800,3600,'NST'),
i(1200,0,'AMT'),
i(4800,3600,'NST'),
i(4800,3600,'NEST'),
i(1200,0,'NET'),
i(4800,3600,'NEST'),
i(1200,0,'NET'),
i(4800,3600,'NEST'),
i(1200,0,'NET'),
i(7200,6000,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
i(7200,3600,'CEST'),
i(3600,0,'CET'),
]
Amsterdam = Amsterdam()
| 19.91601
| 79
| 0.57894
| 2,040
| 7,588
| 2.15
| 0.07549
| 0.062016
| 0.088919
| 0.116735
| 0.910169
| 0.72663
| 0.446648
| 0.446648
| 0.446648
| 0.446648
| 0
| 0.43547
| 0.058513
| 7,588
| 380
| 80
| 19.968421
| 0.178471
| 0.015683
| 0
| 0.483871
| 0
| 0
| 0.084082
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.008065
| 0
| 0.018817
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
b214708e68ccea1990ac2a08cca28d4257ebd17a
| 3,069
|
py
|
Python
|
stable_nalu/functional/nac_weight.py
|
bmistry4/nalm-benchmark
|
273c95cc75241f56e48bcd0b18b043969ef82004
|
[
"MIT"
] | null | null | null |
stable_nalu/functional/nac_weight.py
|
bmistry4/nalm-benchmark
|
273c95cc75241f56e48bcd0b18b043969ef82004
|
[
"MIT"
] | null | null | null |
stable_nalu/functional/nac_weight.py
|
bmistry4/nalm-benchmark
|
273c95cc75241f56e48bcd0b18b043969ef82004
|
[
"MIT"
] | null | null | null |
import torch
from .golden_ratio_base import sigmoid, tanh
class NACWeight(torch.autograd.Function):
r"""Implements the NAC weight operator
w = tanh(\hat{w}) * sigmoid(\hat{m})
"""
@staticmethod
def forward(ctx, w_hat, m_hat):
tanh_w_hat = torch.tanh(w_hat)
sigmoid_m_hat = torch.sigmoid(m_hat)
ctx.save_for_backward(tanh_w_hat, sigmoid_m_hat)
return tanh_w_hat * sigmoid_m_hat
@staticmethod
def backward(ctx, grad_output):
tanh_w_hat, sigmoid_m_hat = ctx.saved_tensors
return (
grad_output * (1 - tanh_w_hat*tanh_w_hat)*sigmoid_m_hat,
grad_output * tanh_w_hat*sigmoid_m_hat*(1-sigmoid_m_hat)
)
class NACWeightSign(torch.autograd.Function):
r"""Implements the NAC weight operator but with a hard gradient for \hat{m}
w = tanh(\hat{w}) * sigmoid(\hat{m})
dL/d\hat{m} = (dL/dw) (dw/d\hat{m})
= (dL/dw) * 0.1 * sign(\hat{w}) * sigmoid(\hat{m}) * (1 - sigmoid(\hat{m}))
"""
@staticmethod
def forward(ctx, w_hat, m_hat):
tanh_w_hat = torch.tanh(w_hat)
sigmoid_m_hat = torch.sigmoid(m_hat)
ctx.save_for_backward(w_hat, tanh_w_hat, sigmoid_m_hat)
return tanh_w_hat * sigmoid_m_hat
@staticmethod
def backward(ctx, grad_output):
w_hat, tanh_w_hat, sigmoid_m_hat = ctx.saved_tensors
return (
grad_output * (1 - tanh_w_hat*tanh_w_hat)*sigmoid_m_hat,
grad_output * 0.1*torch.sign(w_hat)*sigmoid_m_hat*(1-sigmoid_m_hat)
)
class NACWeightIndependent(torch.autograd.Function):
r"""Implements the NAC weight operator but with independent optimization.
The optimiation of \hat{w} is independent of \hat{m} and vice versa.
w = tanh(\hat{w}) * sigmoid(\hat{m})
dL/d\hat{w} = (dL/dw) (dw/d\hat{w})
= (dL/dw) (1 - tanh(\hat{w})^2)
dL/d\hat{m} = (dL/dw) (dw/d\hat{m})
= (dL/dw) sigmoid(\hat{m}) * (1 - sigmoid(\hat{m}))
"""
@staticmethod
def forward(ctx, w_hat, m_hat):
tanh_w_hat = torch.tanh(w_hat)
sigmoid_m_hat = torch.sigmoid(m_hat)
ctx.save_for_backward(tanh_w_hat, sigmoid_m_hat)
return tanh_w_hat * sigmoid_m_hat
@staticmethod
def backward(ctx, grad_output):
tanh_w_hat, sigmoid_m_hat = ctx.saved_tensors
return (
grad_output * (1 - tanh_w_hat*tanh_w_hat),
grad_output * sigmoid_m_hat*(1-sigmoid_m_hat)
)
def nac_base_e(w_hat, m_hat):
return torch.tanh(w_hat) * torch.sigmoid(m_hat)
def nac_base_golden_ratio(w_hat, m_hat):
return tanh(w_hat) * sigmoid(m_hat)
def nac_weight(w_hat, m_hat, mode='normal'):
if mode == 'normal':
# return nac_base_e(w_hat, m_hat)
return NACWeight.apply(w_hat, m_hat)
elif mode == 'sign':
return NACWeightSign.apply(w_hat, m_hat)
elif mode == 'independent':
return NACWeightIndependent.apply(w_hat, m_hat)
elif mode == 'golden-ratio':
return nac_base_golden_ratio(w_hat, m_hat)
| 30.69
| 91
| 0.634409
| 479
| 3,069
| 3.764092
| 0.127349
| 0.084304
| 0.152524
| 0.113145
| 0.798669
| 0.779811
| 0.770383
| 0.717693
| 0.660011
| 0.615086
| 0
| 0.006014
| 0.241447
| 3,069
| 99
| 92
| 31
| 0.768471
| 0.227761
| 0
| 0.5
| 0
| 0
| 0.016971
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.15
| false
| 0
| 0.033333
| 0.033333
| 0.433333
| 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
|
b225f38f1a8a2092893e556a3313c9aa1f331c7e
| 188
|
py
|
Python
|
0x19-making_change/0-main.py
|
alzheimeer/holbertonschool-interview
|
9641bbaa2eb8f05bee8e51fc65e6c208f4058e53
|
[
"MIT"
] | null | null | null |
0x19-making_change/0-main.py
|
alzheimeer/holbertonschool-interview
|
9641bbaa2eb8f05bee8e51fc65e6c208f4058e53
|
[
"MIT"
] | null | null | null |
0x19-making_change/0-main.py
|
alzheimeer/holbertonschool-interview
|
9641bbaa2eb8f05bee8e51fc65e6c208f4058e53
|
[
"MIT"
] | 2
|
2020-04-29T15:15:37.000Z
|
2020-10-29T02:12:37.000Z
|
#!/usr/bin/python3
"""
Main file for testing
"""
makeChange = __import__('0-making_change').makeChange
print(makeChange([1, 2, 25], 37))
print(makeChange([1256, 54, 48, 16, 102], 1453))
| 18.8
| 53
| 0.680851
| 27
| 188
| 4.555556
| 0.851852
| 0.243902
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.150602
| 0.117021
| 188
| 10
| 54
| 18.8
| 0.590361
| 0.207447
| 0
| 0
| 0
| 0
| 0.105634
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0.666667
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
|
0
| 4
|
b28d50919111d1b3b111f6daf42b6acf4004e097
| 126
|
py
|
Python
|
deploy.py
|
britiger/osm-gtfs-checker
|
897c997dc18a5be1da936c4a893b24d234e10cac
|
[
"MIT"
] | null | null | null |
deploy.py
|
britiger/osm-gtfs-checker
|
897c997dc18a5be1da936c4a893b24d234e10cac
|
[
"MIT"
] | null | null | null |
deploy.py
|
britiger/osm-gtfs-checker
|
897c997dc18a5be1da936c4a893b24d234e10cac
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python3
from models import db
import routes
# create tables
db.create_all()
# import data
routes.get_stops()
| 12.6
| 22
| 0.753968
| 20
| 126
| 4.65
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.009259
| 0.142857
| 126
| 9
| 23
| 14
| 0.851852
| 0.373016
| 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
|
b290af817acacbdae1f6252eb4512f951eee793f
| 172
|
py
|
Python
|
Docker/Docker Compose/blog/blog_backend/blog/urls.py
|
F-Shahali/web_workshop
|
f48648ba82e325c612e7aa496f0e1f58a020af36
|
[
"MIT"
] | 80
|
2020-02-08T19:51:12.000Z
|
2022-03-05T12:11:53.000Z
|
Docker/Docker Compose/blog/blog_backend/blog/urls.py
|
F-Shahali/web_workshop
|
f48648ba82e325c612e7aa496f0e1f58a020af36
|
[
"MIT"
] | 36
|
2020-01-10T10:09:27.000Z
|
2022-03-02T10:52:57.000Z
|
Docker/Docker Compose/blog/blog_backend/blog/urls.py
|
F-Shahali/web_workshop
|
f48648ba82e325c612e7aa496f0e1f58a020af36
|
[
"MIT"
] | 73
|
2020-01-09T10:19:19.000Z
|
2022-02-08T16:43:28.000Z
|
from . import views
from rest_framework.routers import SimpleRouter
router = SimpleRouter()
router.register("posts", views.PostViewSet, "posts")
urlpatterns = router.urls
| 24.571429
| 52
| 0.796512
| 20
| 172
| 6.8
| 0.65
| 0.264706
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.104651
| 172
| 7
| 53
| 24.571429
| 0.883117
| 0
| 0
| 0
| 0
| 0
| 0.057803
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.4
| 0
| 0.4
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
a230c4fa3434b7a400813038eea4e1ebe5b5156a
| 27
|
py
|
Python
|
env/lib/python2.7/sre.py
|
lindamar/ecclesi
|
cad07fc78daf6facd1b74cc1cb1872aaf4771fa2
|
[
"MIT"
] | 145
|
2017-01-19T23:33:03.000Z
|
2021-06-05T05:34:55.000Z
|
env/lib/python2.7/sre.py
|
lindamar/ecclesi
|
cad07fc78daf6facd1b74cc1cb1872aaf4771fa2
|
[
"MIT"
] | 17
|
2017-02-03T20:51:39.000Z
|
2020-05-21T11:33:52.000Z
|
env/lib/python2.7/sre.py
|
lindamar/ecclesi
|
cad07fc78daf6facd1b74cc1cb1872aaf4771fa2
|
[
"MIT"
] | 44
|
2017-02-04T19:40:03.000Z
|
2020-10-01T19:24:19.000Z
|
/usr/lib64/python2.7/sre.py
| 27
| 27
| 0.777778
| 6
| 27
| 3.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.148148
| 0
| 27
| 1
| 27
| 27
| 0.62963
| 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
|
a23428a64fb358fb788947cfaf14634490920149
| 113
|
py
|
Python
|
Day3/exampledoc/setup.py
|
digirak/codeastro
|
5e476e9153288539bc1a830a2bd0798b11a7cdec
|
[
"BSD-3-Clause"
] | null | null | null |
Day3/exampledoc/setup.py
|
digirak/codeastro
|
5e476e9153288539bc1a830a2bd0798b11a7cdec
|
[
"BSD-3-Clause"
] | null | null | null |
Day3/exampledoc/setup.py
|
digirak/codeastro
|
5e476e9153288539bc1a830a2bd0798b11a7cdec
|
[
"BSD-3-Clause"
] | null | null | null |
from setuptools import setup, find_packages
setup(
name='HelloWorld',
version='0.1',
packages=find_packages()
)
| 14.125
| 43
| 0.769912
| 15
| 113
| 5.666667
| 0.733333
| 0.282353
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.019608
| 0.097345
| 113
| 7
| 44
| 16.142857
| 0.813725
| 0
| 0
| 0
| 0
| 0
| 0.116071
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.166667
| 0
| 0.166667
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
a25c3dc28ef9a5308db92df97554f801823c8552
| 309
|
py
|
Python
|
tests/test_f1score.py
|
LucaCappelletti94/keras_metrics
|
2af59d26f7134a65e8332a29a3f7ae712b928f0e
|
[
"MIT"
] | 14
|
2019-06-14T10:37:11.000Z
|
2021-09-17T11:42:48.000Z
|
tests/test_f1score.py
|
LucaCappelletti94/keras_metrics
|
2af59d26f7134a65e8332a29a3f7ae712b928f0e
|
[
"MIT"
] | 5
|
2019-06-15T07:11:45.000Z
|
2021-01-04T16:46:40.000Z
|
tests/test_f1score.py
|
LucaCappelletti94/keras_metrics
|
2af59d26f7134a65e8332a29a3f7ae712b928f0e
|
[
"MIT"
] | 1
|
2019-12-02T08:00:25.000Z
|
2019-12-02T08:00:25.000Z
|
import numpy as np
from extra_keras_metrics import F1Score
from sklearn.metrics import f1_score as baseline
from .utils import compare_metrics
def f1score_score(y_true, y_pred):
return baseline(y_true, np.round(y_pred).astype(int))
def test_precision():
compare_metrics(F1Score(), f1score_score)
| 22.071429
| 57
| 0.79288
| 48
| 309
| 4.854167
| 0.520833
| 0.111588
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.018657
| 0.132686
| 309
| 13
| 58
| 23.769231
| 0.850746
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.5
| 0.125
| 0.875
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 1
| 1
| 0
|
0
| 4
|
a262efda6edf2938b61a2dc62ec175b762c6edea
| 308
|
py
|
Python
|
bin/PythonDAnCE/generator/internal_endpoint.py
|
jwillemsen/DAnCE
|
516ff2b502001e7b42e717af8b3034be6df2544d
|
[
"DOC"
] | 8
|
2016-07-20T00:56:05.000Z
|
2020-10-04T12:31:16.000Z
|
bin/PythonDAnCE/generator/internal_endpoint.py
|
jwillemsen/DAnCE
|
516ff2b502001e7b42e717af8b3034be6df2544d
|
[
"DOC"
] | 5
|
2016-06-20T16:16:23.000Z
|
2019-06-26T12:18:45.000Z
|
bin/PythonDAnCE/generator/internal_endpoint.py
|
jwillemsen/DAnCE
|
516ff2b502001e7b42e717af8b3034be6df2544d
|
[
"DOC"
] | 12
|
2016-04-20T10:01:06.000Z
|
2021-12-24T17:24:04.000Z
|
from templet import stringfunction
@stringfunction
def template (name, provider, kind, instance) :
"""
<internalEndpoint>
<portName>${name}</portName>
<provider>${provider}</provider>
<kind>${kind}</kind>
<instance xmi:idref="${instance}" />
</internalEndpoint>
"""
| 22
| 47
| 0.623377
| 26
| 308
| 7.384615
| 0.538462
| 0.125
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.207792
| 308
| 13
| 48
| 23.692308
| 0.786885
| 0.538961
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.333333
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 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
|
a2858fb94e0208716f70764d1aa29b5ec63afde2
| 640
|
py
|
Python
|
test_text2.py
|
slzatz/esp8266
|
687a0ff1cf2326f7c911e90026811036575932d1
|
[
"MIT"
] | 2
|
2017-05-25T23:15:22.000Z
|
2019-09-29T02:13:13.000Z
|
test_text2.py
|
slzatz/esp8266
|
687a0ff1cf2326f7c911e90026811036575932d1
|
[
"MIT"
] | null | null | null |
test_text2.py
|
slzatz/esp8266
|
687a0ff1cf2326f7c911e90026811036575932d1
|
[
"MIT"
] | 2
|
2019-09-29T02:13:14.000Z
|
2019-11-06T07:49:21.000Z
|
'''
Can either be used by ampy or placed on esp8266 to test writing to the ili9341 with a larger font:
font2.py. Also uses ili9341_text2.py and rgb_text2.py
'''
import machine
import ili9341_text2 as ili
spi = machine.SPI(1, baudrate=32000000)
display = ili.ILI9341(spi, cs=machine.Pin(0), dc=machine.Pin(15))
color = ((255,0,0),(0,255,0),(0,0,255),(255,255,0),(0,255,255),(255,0,255),(255,255,255),(255,0,0),(0,255,0),(0,0,255),(255,255,0),(0,255,255),(255,0,255),(255,255,255),(255,0,0),(0,255,0))
display.fill(0)
for x,y in enumerate(range(0,310,20)):
display.draw_text(10,y,"Micropython Rocks "+str(y),ili.color565(*color[x]))
| 37.647059
| 189
| 0.68125
| 130
| 640
| 3.323077
| 0.446154
| 0.222222
| 0.208333
| 0.138889
| 0.231481
| 0.231481
| 0.231481
| 0.231481
| 0.231481
| 0.231481
| 0
| 0.256499
| 0.098438
| 640
| 16
| 190
| 40
| 0.492201
| 0.239063
| 0
| 0
| 0
| 0
| 0.037657
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.25
| 0
| 0.25
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
a2906042bf62908ee6eb4f783ca22519ccd4a834
| 885
|
py
|
Python
|
setup.py
|
invictuscapital/nameko-twilio
|
0a31e9ddc03386ab1f97dfeb8bc4a2f2b3377b5f
|
[
"Apache-2.0"
] | null | null | null |
setup.py
|
invictuscapital/nameko-twilio
|
0a31e9ddc03386ab1f97dfeb8bc4a2f2b3377b5f
|
[
"Apache-2.0"
] | null | null | null |
setup.py
|
invictuscapital/nameko-twilio
|
0a31e9ddc03386ab1f97dfeb8bc4a2f2b3377b5f
|
[
"Apache-2.0"
] | null | null | null |
from setuptools import setup
setup(
name='nameko-twilio',
version='0.1',
url='https://github.com/invictuscapital/nameko-twilio/',
license='Apache License, Version 2.0',
author='raybotha',
author_email='rabotha42@gmail.com',
py_modules=['nameko_twilio'],
install_requires=[
"nameko>=2.0.0",
"twilio",
],
description='Twilio dependency for nameko services',
classifiers=[
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
],
)
| 30.517241
| 61
| 0.59774
| 92
| 885
| 5.706522
| 0.5
| 0.253333
| 0.333333
| 0.247619
| 0.102857
| 0
| 0
| 0
| 0
| 0
| 0
| 0.033133
| 0.249718
| 885
| 28
| 62
| 31.607143
| 0.75753
| 0
| 0
| 0.076923
| 0
| 0
| 0.59209
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.038462
| 0
| 0.038462
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
a2c76a67e9ce2664effad46f432e4c9996f74f28
| 159
|
py
|
Python
|
teste03.py
|
felipemor/Basicos-de-python
|
16a1f7c831b9fbeb692c725ace434acc36b7fcf8
|
[
"MIT"
] | null | null | null |
teste03.py
|
felipemor/Basicos-de-python
|
16a1f7c831b9fbeb692c725ace434acc36b7fcf8
|
[
"MIT"
] | null | null | null |
teste03.py
|
felipemor/Basicos-de-python
|
16a1f7c831b9fbeb692c725ace434acc36b7fcf8
|
[
"MIT"
] | null | null | null |
a=int(input('Qual o primeiro número ?'))
b=int(input('Qual o segundo número ?'))
c=a+b
print('Olá Felipe a soma entre {} e {} é {}'.format(a,b,c))
| 17.666667
| 60
| 0.584906
| 29
| 159
| 3.206897
| 0.62069
| 0.172043
| 0.258065
| 0.27957
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.207547
| 159
| 8
| 61
| 19.875
| 0.738095
| 0
| 0
| 0
| 0
| 0
| 0.564626
| 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
|
a2dc0985596af490724953a13340c1c97a27b6ce
| 118
|
py
|
Python
|
programs/l4py.py
|
beborngod/language_patrol
|
bd520b5f92c14f9478f2ba893879fcdf16ea559d
|
[
"BSD-3-Clause"
] | 6
|
2021-01-18T13:56:08.000Z
|
2022-01-31T22:58:50.000Z
|
programs/l4py.py
|
beborngod/language_patrol
|
bd520b5f92c14f9478f2ba893879fcdf16ea559d
|
[
"BSD-3-Clause"
] | null | null | null |
programs/l4py.py
|
beborngod/language_patrol
|
bd520b5f92c14f9478f2ba893879fcdf16ea559d
|
[
"BSD-3-Clause"
] | 3
|
2021-01-18T13:47:05.000Z
|
2021-06-12T14:13:40.000Z
|
#!/usr/bin/python3
# My first program on Python!
print ("Hello World!")
for cntr in range(0,11):
print (cntr)
| 19.666667
| 29
| 0.644068
| 19
| 118
| 4
| 0.894737
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.042553
| 0.20339
| 118
| 5
| 30
| 23.6
| 0.765957
| 0.381356
| 0
| 0
| 0
| 0
| 0.169014
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0.666667
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
0c0bf186b5ebd8562f07b184d04686273bcb1f6b
| 627
|
py
|
Python
|
tests/test_424.py
|
sungho-joo/leetcode2github
|
ce7730ef40f6051df23681dd3c0e1e657abba620
|
[
"MIT"
] | null | null | null |
tests/test_424.py
|
sungho-joo/leetcode2github
|
ce7730ef40f6051df23681dd3c0e1e657abba620
|
[
"MIT"
] | null | null | null |
tests/test_424.py
|
sungho-joo/leetcode2github
|
ce7730ef40f6051df23681dd3c0e1e657abba620
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python
import pytest
"""
Test 424. Longest Repeating Character Replacement
"""
@pytest.fixture(scope="session")
def init_variables_424():
from src.leetcode_424_longest_repeating_character_replacement import Solution
solution = Solution()
def _init_variables_424():
return solution
yield _init_variables_424
class TestClass424:
def test_solution_0(self, init_variables_424):
assert init_variables_424().characterReplacement("ABAB", 2) == 4
def test_solution_1(self, init_variables_424):
assert init_variables_424().characterReplacement("AABABBA", 1) == 4
| 22.392857
| 81
| 0.741627
| 76
| 627
| 5.789474
| 0.460526
| 0.206818
| 0.254545
| 0.127273
| 0.459091
| 0.281818
| 0.281818
| 0.281818
| 0.281818
| 0
| 0
| 0.068834
| 0.165869
| 627
| 27
| 82
| 23.222222
| 0.772467
| 0.031898
| 0
| 0
| 0
| 0
| 0.032787
| 0
| 0
| 0
| 0
| 0
| 0.153846
| 1
| 0.307692
| false
| 0
| 0.153846
| 0.076923
| 0.615385
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
0c1e17b3592107a4bb6ea218ca16cdfde7993586
| 193
|
py
|
Python
|
webscrapingtool/restapi/throttles.py
|
jpbonson/WebScrapingTool
|
3aaa06517b5da754ff8cdcd2434ae03c63251a28
|
[
"MIT"
] | 3
|
2018-06-26T00:00:40.000Z
|
2018-12-21T13:17:49.000Z
|
webscrapingtool/restapi/throttles.py
|
jpbonson/WebScrapingTool
|
3aaa06517b5da754ff8cdcd2434ae03c63251a28
|
[
"MIT"
] | 4
|
2020-02-11T21:43:47.000Z
|
2021-12-13T20:38:27.000Z
|
webscrapingtool/restapi/throttles.py
|
jpbonson/WebScrapingTool
|
3aaa06517b5da754ff8cdcd2434ae03c63251a28
|
[
"MIT"
] | 1
|
2020-12-02T09:28:16.000Z
|
2020-12-02T09:28:16.000Z
|
from rest_framework.throttling import UserRateThrottle
class BurstRateThrottle(UserRateThrottle):
scope = 'burst'
class SustainedRateThrottle(UserRateThrottle):
scope = 'sustained'
| 19.3
| 54
| 0.797927
| 16
| 193
| 9.5625
| 0.75
| 0.27451
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.134715
| 193
| 9
| 55
| 21.444444
| 0.916168
| 0
| 0
| 0
| 0
| 0
| 0.072539
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.2
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
0c31be9ff251753803750eb057d53f1d2c10879b
| 8,240
|
py
|
Python
|
yasql/apps/sqlquery/models.py
|
Fanduzi/YaSQL
|
bc6366a9b1c1e9ed84fd24ea2b4a21f8f99d0af5
|
[
"Apache-2.0"
] | 443
|
2018-02-08T02:53:48.000Z
|
2020-10-13T10:01:55.000Z
|
yasql/apps/sqlquery/models.py
|
Fanduzi/YaSQL
|
bc6366a9b1c1e9ed84fd24ea2b4a21f8f99d0af5
|
[
"Apache-2.0"
] | 27
|
2020-10-14T10:01:52.000Z
|
2022-03-12T00:49:47.000Z
|
yasql/apps/sqlquery/models.py
|
Fanduzi/YaSQL
|
bc6366a9b1c1e9ed84fd24ea2b4a21f8f99d0af5
|
[
"Apache-2.0"
] | 148
|
2018-03-15T06:07:25.000Z
|
2020-08-17T14:58:45.000Z
|
from django.db import models
# Create your models here.
from sqlorders.models import DbConfig
from users.models import UserAccounts
class DbQuerySchemas(models.Model):
"""
存储远程查询数据库的库名
"""
id = models.AutoField(primary_key=True, verbose_name=u'主键ID')
cid = models.ForeignKey(DbConfig, blank=True, null=True, on_delete=models.SET_NULL, verbose_name='数据库')
schema = models.CharField(null=False, max_length=64, default='', verbose_name=u'库名')
created_at = models.DateTimeField(auto_now_add=True, verbose_name=u'创建时间')
updated_at = models.DateTimeField(auto_now=True, verbose_name=u'更新时间')
def __str__(self):
return '.'.join([self.cid.comment, self.schema])
def display_comment(self):
return self.cid.comment
display_comment.short_description = '主机'
class Meta:
verbose_name = u'DB查询库'
verbose_name_plural = verbose_name
unique_together = (('cid', 'schema'),)
default_permissions = ()
app_label = 'sqlquery'
db_table = 'yasql_sqlquery_schemas'
class DbQueryTables(models.Model):
"""
存储远程查询数据库的表名
"""
id = models.AutoField(primary_key=True, verbose_name=u'主键ID')
schema = models.ForeignKey(DbQuerySchemas, blank=True, null=True, on_delete=models.SET_NULL, verbose_name='库名')
table = models.CharField(null=False, max_length=128, default='', verbose_name=u'表名')
created_at = models.DateTimeField(auto_now_add=True, verbose_name=u'创建时间')
updated_at = models.DateTimeField(auto_now=True, verbose_name=u'更新时间')
def __str__(self):
return '.'.join([self.schema.cid.comment, self.schema.schema, self.table])
def display_comment(self):
return self.schema.cid.comment
def display_schema(self):
return self.schema.schema
display_comment.short_description = '主机'
display_schema.short_description = '库名'
class Meta:
verbose_name = u'DB查询表'
verbose_name_plural = verbose_name
default_permissions = ()
app_label = 'sqlquery'
db_table = 'yasql_sqlquery_tables'
class DbQueryUserPrivs(models.Model):
id = models.AutoField(primary_key=True, verbose_name=u'主键ID')
user = models.ForeignKey(UserAccounts, blank=True, null=True, on_delete=models.SET_NULL, verbose_name='用户')
schemas = models.ManyToManyField(DbQuerySchemas, verbose_name='允许访问的库')
created_at = models.DateTimeField(auto_now_add=True, verbose_name=u'创建时间')
updated_at = models.DateTimeField(auto_now=True, verbose_name=u'更新时间')
def __str__(self):
return self.user.username
class Meta:
verbose_name = u'DB查询用户权限'
verbose_name_plural = verbose_name
default_permissions = ()
app_label = 'sqlquery'
db_table = 'yasql_sqlquery_user_privileges'
class DbQueryGroupPrivs(models.Model):
id = models.AutoField(primary_key=True, verbose_name=u'主键ID')
group = models.CharField(null=False, max_length=128, default='', verbose_name=u'组名')
user = models.ManyToManyField(UserAccounts, verbose_name='用户')
schemas = models.ManyToManyField(DbQuerySchemas, verbose_name='允许访问的库')
created_at = models.DateTimeField(auto_now_add=True, verbose_name=u'创建时间')
updated_at = models.DateTimeField(auto_now=True, verbose_name=u'更新时间')
def __str__(self):
return self.group
class Meta:
verbose_name = u'DB查询组权限'
verbose_name_plural = verbose_name
default_permissions = ()
app_label = 'sqlquery'
db_table = 'yasql_sqlquery_group_privileges'
class DbQueryUserAllowedTables(models.Model):
id = models.AutoField(primary_key=True, verbose_name=u'主键ID')
tables = models.ForeignKey(DbQueryTables, blank=True, null=True, on_delete=models.SET_NULL, verbose_name='表')
user_privs = models.ForeignKey(DbQueryUserPrivs, blank=True, null=True, on_delete=models.SET_NULL,
verbose_name='权限')
created_at = models.DateTimeField(auto_now_add=True, verbose_name=u'创建时间')
updated_at = models.DateTimeField(auto_now=True, verbose_name=u'更新时间')
def __str__(self):
return '.'.join([self.tables.schema.cid.comment, self.tables.schema.schema, self.tables.table])
class Meta:
verbose_name = u'允许用户访问的表'
verbose_name_plural = verbose_name
default_permissions = ()
app_label = 'sqlquery'
db_table = 'yasql_sqlquery_user_allowed_tables'
class DbQueryUserDenyTables(models.Model):
id = models.AutoField(primary_key=True, verbose_name=u'主键ID')
tables = models.ForeignKey(DbQueryTables, blank=True, null=True, on_delete=models.SET_NULL, verbose_name='表')
user_privs = models.ForeignKey(DbQueryUserPrivs, blank=True, null=True, on_delete=models.SET_NULL,
verbose_name='权限')
created_at = models.DateTimeField(auto_now_add=True, verbose_name=u'创建时间')
updated_at = models.DateTimeField(auto_now=True, verbose_name=u'更新时间')
def __str__(self):
return '.'.join([self.tables.schema.cid.comment, self.tables.schema.schema, self.tables.table])
class Meta:
verbose_name = u'禁止用户访问的表'
verbose_name_plural = verbose_name
default_permissions = ()
app_label = 'sqlquery'
db_table = 'yasql_sqlquery_user_deny_tables'
class DbQueryGroupAllowedTables(models.Model):
id = models.AutoField(primary_key=True, verbose_name=u'主键ID')
tables = models.ForeignKey(DbQueryTables, blank=True, null=True, on_delete=models.SET_NULL, verbose_name='表')
group_privs = models.ForeignKey(DbQueryGroupPrivs, blank=True, null=True, on_delete=models.SET_NULL,
verbose_name='权限')
created_at = models.DateTimeField(auto_now_add=True, verbose_name=u'创建时间')
updated_at = models.DateTimeField(auto_now=True, verbose_name=u'更新时间')
def __str__(self):
return '.'.join([self.tables.schema.cid.comment, self.tables.schema.schema, self.tables.table])
class Meta:
verbose_name = u'允许组访问的表'
verbose_name_plural = verbose_name
default_permissions = ()
app_label = 'sqlquery'
db_table = 'yasql_sqlquery_group_allowed_tables'
class DbQueryGroupDenyTables(models.Model):
id = models.AutoField(primary_key=True, verbose_name=u'主键ID')
tables = models.ForeignKey(DbQueryTables, blank=True, null=True, on_delete=models.SET_NULL, verbose_name='表')
group_privs = models.ForeignKey(DbQueryGroupPrivs, blank=True, null=True, on_delete=models.SET_NULL,
verbose_name='权限')
created_at = models.DateTimeField(auto_now_add=True, verbose_name=u'创建时间')
updated_at = models.DateTimeField(auto_now=True, verbose_name=u'更新时间')
def __str__(self):
return '.'.join([self.tables.schema.cid.comment, self.tables.schema.schema, self.tables.table])
class Meta:
verbose_name = u'禁止组访问的表'
verbose_name_plural = verbose_name
default_permissions = ()
app_label = 'sqlquery'
db_table = 'yasql_sqlquery_group_deny_tables'
class DbQueryLog(models.Model):
id = models.AutoField(primary_key=True, verbose_name=u'主键id')
username = models.CharField(max_length=64, null=False, verbose_name=u'用户名')
host = models.CharField(max_length=256, null=False, verbose_name=u'目标数据库地址')
schema = models.CharField(null=False, max_length=128, default='', verbose_name=u'目标数据库')
tables = models.CharField(null=False, max_length=200, default='', verbose_name=u'目标表名')
query_sql = models.TextField(null=False, default='', verbose_name=u'查询SQL')
query_consume_time = models.FloatField(null=False, default=0.000, verbose_name=u'查询耗时,单位s')
query_status = models.CharField(max_length=2048, default='', verbose_name=u'查询是否成功或失败的原因')
affected_rows = models.IntegerField(default=0, null=False, verbose_name=u'影响影响行数')
created_at = models.DateTimeField(auto_now_add=True, verbose_name=u'查询时间')
class Meta:
verbose_name = u'DB查询日志'
verbose_name_plural = verbose_name
index_together = (('username',), ('schema',), ('tables',),)
default_permissions = ()
app_label = 'sqlquery'
db_table = 'yasql_sqlquery_log'
| 39.615385
| 115
| 0.704126
| 1,036
| 8,240
| 5.333977
| 0.128378
| 0.155266
| 0.099891
| 0.07528
| 0.770177
| 0.71806
| 0.700869
| 0.692725
| 0.692725
| 0.673181
| 0
| 0.004153
| 0.181796
| 8,240
| 207
| 116
| 39.806763
| 0.815485
| 0.006189
| 0
| 0.608108
| 0
| 0
| 0.076122
| 0.028929
| 0
| 0
| 0
| 0
| 0
| 1
| 0.074324
| false
| 0
| 0.02027
| 0.074324
| 0.635135
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
0c411a090bbe1743b5bb30eae91653a93216c39f
| 183
|
py
|
Python
|
10.6-10.22/findwanshu.py
|
Rythsman/My-python-exercise
|
4ad5aa163fd17073fd44f73bd1640c65365eae05
|
[
"MIT"
] | null | null | null |
10.6-10.22/findwanshu.py
|
Rythsman/My-python-exercise
|
4ad5aa163fd17073fd44f73bd1640c65365eae05
|
[
"MIT"
] | null | null | null |
10.6-10.22/findwanshu.py
|
Rythsman/My-python-exercise
|
4ad5aa163fd17073fd44f73bd1640c65365eae05
|
[
"MIT"
] | null | null | null |
for i in range(2,1001):
s = i
for j in range(1,i):
if i % j == 0:
s -= j
if s == 0: #减完再看是否符合完数的定义
print (i)
| 20.333333
| 43
| 0.333333
| 26
| 183
| 2.346154
| 0.5
| 0.229508
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.097561
| 0.551913
| 183
| 8
| 44
| 22.875
| 0.646341
| 0.071038
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.142857
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 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
|
0c416dbd73e12a21ddda91bf3d42f6cf70878400
| 141
|
py
|
Python
|
init.py
|
000Nobody/YouTube-Downloader
|
6d2518664ed9235c8b5e5f23723ed5f7a10a5649
|
[
"MIT"
] | 11
|
2020-07-26T12:02:54.000Z
|
2021-09-18T15:00:54.000Z
|
init.py
|
000Nobody/YouTube-Downloader
|
6d2518664ed9235c8b5e5f23723ed5f7a10a5649
|
[
"MIT"
] | null | null | null |
init.py
|
000Nobody/YouTube-Downloader
|
6d2518664ed9235c8b5e5f23723ed5f7a10a5649
|
[
"MIT"
] | 5
|
2020-07-28T08:32:40.000Z
|
2022-03-31T07:02:14.000Z
|
import subprocess
import os
if not os.path.isdir('Downloads'):
os.mkdir('Downloads')
subprocess.run('streamlit run main.py', shell=True)
| 23.5
| 51
| 0.744681
| 21
| 141
| 5
| 0.714286
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.113475
| 141
| 6
| 51
| 23.5
| 0.84
| 0
| 0
| 0
| 0
| 0
| 0.274648
| 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
|
0c4dcb6536b58176277a5c14f4eee90938cce677
| 80
|
py
|
Python
|
test/extensions/secondorder/hbp/__init__.py
|
jabader97/backpack
|
089daafa0d611e13901fd7ecf8a0d708ce7a5928
|
[
"MIT"
] | 395
|
2019-10-04T09:37:52.000Z
|
2022-03-29T18:00:56.000Z
|
test/extensions/secondorder/hbp/__init__.py
|
jabader97/backpack
|
089daafa0d611e13901fd7ecf8a0d708ce7a5928
|
[
"MIT"
] | 78
|
2019-10-11T18:56:43.000Z
|
2022-03-23T01:49:54.000Z
|
test/extensions/secondorder/hbp/__init__.py
|
jabader97/backpack
|
089daafa0d611e13901fd7ecf8a0d708ce7a5928
|
[
"MIT"
] | 50
|
2019-10-03T16:31:10.000Z
|
2022-03-15T19:36:14.000Z
|
"""Tests for ``backpack.extensions.secondorder.hbp`` (Kronecker curvatures)."""
| 40
| 79
| 0.7375
| 8
| 80
| 7.375
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.0625
| 80
| 1
| 80
| 80
| 0.786667
| 0.9125
| 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
|
0c51946b6caaff126e5719277dbf9758e2399e01
| 45
|
py
|
Python
|
src/api/__init__.py
|
jhernandez18p/mobyapp
|
4add7bd3b3f1e933bbb6941674bf84f4c4462685
|
[
"MIT"
] | null | null | null |
src/api/__init__.py
|
jhernandez18p/mobyapp
|
4add7bd3b3f1e933bbb6941674bf84f4c4462685
|
[
"MIT"
] | 7
|
2020-06-05T17:31:06.000Z
|
2022-03-11T23:16:34.000Z
|
src/api/__init__.py
|
jhernandez18p/mobyapp
|
4add7bd3b3f1e933bbb6941674bf84f4c4462685
|
[
"MIT"
] | null | null | null |
default_app_config = 'src.api.apps.ApiConfig'
| 45
| 45
| 0.822222
| 7
| 45
| 5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.044444
| 45
| 1
| 45
| 45
| 0.813953
| 0
| 0
| 0
| 0
| 0
| 0.478261
| 0.478261
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
a7568b953ee1847c852c92fe63ff30cdbcfe1605
| 18
|
py
|
Python
|
.idea/VirtualEnvironment/Lib/site-packages/tests/outcomes/feedback_on_exception/feedback_on_exception_test_4/main.py
|
Vladpetr/NewsPortal
|
cd4127fbc09d9c8f5e65c8ae699856c6d380a320
|
[
"Apache-2.0"
] | 1
|
2018-10-10T06:54:32.000Z
|
2018-10-10T06:54:32.000Z
|
.idea/VirtualEnvironment/Lib/site-packages/tests/outcomes/feedback_on_exception/feedback_on_exception_test_4/main.py
|
Vladpetr/NewsPortal
|
cd4127fbc09d9c8f5e65c8ae699856c6d380a320
|
[
"Apache-2.0"
] | 6
|
2020-11-28T20:23:42.000Z
|
2021-08-29T20:52:54.000Z
|
.idea/VirtualEnvironment/Lib/site-packages/tests/outcomes/feedback_on_exception/feedback_on_exception_test_4/main.py
|
Vladpetr/NewsPortal
|
cd4127fbc09d9c8f5e65c8ae699856c6d380a320
|
[
"Apache-2.0"
] | null | null | null |
raise Exception()
| 9
| 17
| 0.777778
| 2
| 18
| 7
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.111111
| 18
| 1
| 18
| 18
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 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
|
a7a83327d15a1097f7a97649290626f181e6830d
| 88
|
py
|
Python
|
language-python-test/test/features/raise/raise.py
|
wbadart/language-python
|
6c048c215ff7fe4a5d5cc36ba3c17a666af74821
|
[
"BSD-3-Clause"
] | 137
|
2015-02-13T21:03:23.000Z
|
2021-11-24T03:53:55.000Z
|
language-python-test/test/features/raise/raise.py
|
wbadart/language-python
|
6c048c215ff7fe4a5d5cc36ba3c17a666af74821
|
[
"BSD-3-Clause"
] | 2
|
2015-03-07T14:08:33.000Z
|
2015-10-13T02:00:40.000Z
|
language-python-test/test/features/raise/raise.py
|
wbadart/language-python
|
6c048c215ff7fe4a5d5cc36ba3c17a666af74821
|
[
"BSD-3-Clause"
] | 4
|
2015-05-03T22:07:27.000Z
|
2018-09-10T08:55:03.000Z
|
class C(Exception):
pass
try:
raise C
except C:
print("caught exception")
| 11
| 29
| 0.625
| 12
| 88
| 4.583333
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.272727
| 88
| 7
| 30
| 12.571429
| 0.859375
| 0
| 0
| 0
| 0
| 0
| 0.181818
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.166667
| 0
| 0
| 0.166667
| 0.166667
| 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
|
a7b1c2ddb925eb81cd74b4ddfb34dd792c4ebb80
| 98
|
py
|
Python
|
Project_Codev0.1/Class-diagram_Classes/Xrhsths.py
|
cyberseihis/Wallsource
|
4bd981e75c3ebf97c9673ffb80147ef2bdf7d61a
|
[
"MIT"
] | null | null | null |
Project_Codev0.1/Class-diagram_Classes/Xrhsths.py
|
cyberseihis/Wallsource
|
4bd981e75c3ebf97c9673ffb80147ef2bdf7d61a
|
[
"MIT"
] | null | null | null |
Project_Codev0.1/Class-diagram_Classes/Xrhsths.py
|
cyberseihis/Wallsource
|
4bd981e75c3ebf97c9673ffb80147ef2bdf7d61a
|
[
"MIT"
] | null | null | null |
class Xrhsths:
def setXrhsthsname(self, Xrhsthsname: str):
self.Xrhsthsname = Xrhsthsname;
| 19.6
| 43
| 0.744898
| 10
| 98
| 7.3
| 0.7
| 0.410959
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.163265
| 98
| 4
| 44
| 24.5
| 0.890244
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
ac09000444125ab0a644581d3f7d594f7a5aa9ea
| 726
|
py
|
Python
|
backend/pages/migrations/0005_remove_product_category_remove_sale_product_and_more.py
|
jrmsrs/minimercado
|
3698eb3ff2df58c803380a3fc2f58e39260fcf56
|
[
"MIT"
] | null | null | null |
backend/pages/migrations/0005_remove_product_category_remove_sale_product_and_more.py
|
jrmsrs/minimercado
|
3698eb3ff2df58c803380a3fc2f58e39260fcf56
|
[
"MIT"
] | null | null | null |
backend/pages/migrations/0005_remove_product_category_remove_sale_product_and_more.py
|
jrmsrs/minimercado
|
3698eb3ff2df58c803380a3fc2f58e39260fcf56
|
[
"MIT"
] | null | null | null |
# Generated by Django 4.0.3 on 2022-03-30 04:45
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('pages', '0004_rename_product_name_sale_product'),
]
operations = [
migrations.RemoveField(
model_name='product',
name='category',
),
migrations.RemoveField(
model_name='sale',
name='product',
),
migrations.DeleteModel(
name='Category',
),
migrations.DeleteModel(
name='Product',
),
migrations.DeleteModel(
name='Sale',
),
migrations.DeleteModel(
name='Sector',
),
]
| 21.352941
| 59
| 0.523416
| 60
| 726
| 6.216667
| 0.516667
| 0.225201
| 0.268097
| 0.160858
| 0.193029
| 0
| 0
| 0
| 0
| 0
| 0
| 0.041215
| 0.365014
| 726
| 33
| 60
| 22
| 0.767896
| 0.061983
| 0
| 0.444444
| 1
| 0
| 0.136966
| 0.054492
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.037037
| 0
| 0.148148
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
ac35f5fbbc3fc8a6e7122f5976366ff183706426
| 259
|
py
|
Python
|
test/fixtures/src/%ModelName%.py
|
EndyKaufman/source-generator
|
e0b6cceeb522bf889fb8d6c5e588843170bd890d
|
[
"MIT"
] | null | null | null |
test/fixtures/src/%ModelName%.py
|
EndyKaufman/source-generator
|
e0b6cceeb522bf889fb8d6c5e588843170bd890d
|
[
"MIT"
] | 4
|
2017-11-20T12:17:29.000Z
|
2020-05-25T08:33:08.000Z
|
test/fixtures/src/%ModelName%.py
|
EndyKaufman/srcgen
|
e0b6cceeb522bf889fb8d6c5e588843170bd890d
|
[
"MIT"
] | null | null | null |
from __future__ import unicode_literals
from django.db import models
from django.contrib.auth.models import User
'''
%replace me%
'''
class <%=ModelName%>(models.Model):
title = models.TextField(max_length=512)
name = models.TextField(max_length=512)
| 25.9
| 44
| 0.756757
| 35
| 259
| 5.4
| 0.628571
| 0.10582
| 0.190476
| 0.253968
| 0.285714
| 0
| 0
| 0
| 0
| 0
| 0
| 0.026432
| 0.123552
| 259
| 10
| 45
| 25.9
| 0.806167
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.5
| null | null | 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
3bbd78e29213735ab22c07f749c83cee0d425911
| 167
|
py
|
Python
|
tests/mai.py
|
Ag-elf/sencyber-tools
|
efa7832bca94938e8fe5aec4218a6b66a433cdbf
|
[
"MIT"
] | null | null | null |
tests/mai.py
|
Ag-elf/sencyber-tools
|
efa7832bca94938e8fe5aec4218a6b66a433cdbf
|
[
"MIT"
] | null | null | null |
tests/mai.py
|
Ag-elf/sencyber-tools
|
efa7832bca94938e8fe5aec4218a6b66a433cdbf
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
# @Time : 2021/6/2 10:50
# @Author : Shigure_Hotaru
# @Email : minjie96@sencyber.cn
# @File : mai.py
# @Version : Python 3.8.5 +
| 23.857143
| 34
| 0.550898
| 24
| 167
| 3.791667
| 0.958333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.128
| 0.251497
| 167
| 6
| 35
| 27.833333
| 0.6
| 0.922156
| 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
|
3bc943cbcfb1ada1e155bd78036b29fc694b2e8d
| 1,679
|
py
|
Python
|
registry/migrations/0002_auto_20210304_1509.py
|
Nephilim-Jack/regUserBack
|
00bc28088ea9d4c681c26d1317da6a14b36e38c5
|
[
"MIT"
] | null | null | null |
registry/migrations/0002_auto_20210304_1509.py
|
Nephilim-Jack/regUserBack
|
00bc28088ea9d4c681c26d1317da6a14b36e38c5
|
[
"MIT"
] | null | null | null |
registry/migrations/0002_auto_20210304_1509.py
|
Nephilim-Jack/regUserBack
|
00bc28088ea9d4c681c26d1317da6a14b36e38c5
|
[
"MIT"
] | null | null | null |
# Generated by Django 3.1.7 on 2021-03-04 18:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('registry', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='profile',
name='cep',
field=models.IntegerField(null=True, verbose_name='cep'),
),
migrations.AlterField(
model_name='profile',
name='city',
field=models.CharField(max_length=256, null=True, verbose_name='city'),
),
migrations.AlterField(
model_name='profile',
name='country',
field=models.CharField(max_length=256, null=True, verbose_name='country'),
),
migrations.AlterField(
model_name='profile',
name='cpf',
field=models.IntegerField(null=True, verbose_name='cpf'),
),
migrations.AlterField(
model_name='profile',
name='houseNumber',
field=models.PositiveIntegerField(null=True, verbose_name='houseNumber'),
),
migrations.AlterField(
model_name='profile',
name='pis',
field=models.IntegerField(null=True, verbose_name='pis'),
),
migrations.AlterField(
model_name='profile',
name='state',
field=models.CharField(max_length=256, null=True, verbose_name='state'),
),
migrations.AlterField(
model_name='profile',
name='street',
field=models.CharField(max_length=256, null=True, verbose_name='street'),
),
]
| 31.092593
| 86
| 0.564026
| 159
| 1,679
| 5.823899
| 0.289308
| 0.172786
| 0.215983
| 0.25054
| 0.701944
| 0.701944
| 0.356371
| 0.220302
| 0.220302
| 0.220302
| 0
| 0.026793
| 0.310899
| 1,679
| 53
| 87
| 31.679245
| 0.773552
| 0.026802
| 0
| 0.510638
| 1
| 0
| 0.098039
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.021277
| 0
| 0.085106
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
3bd0b93851bb8c91db53f0ae3c78c5b16ad59b72
| 5,893
|
py
|
Python
|
auction/testing/test_models.py
|
AnthonyNicklin/newage-auctions
|
f829c9761e4fef0c084cf0244a4617a4bda8e0c2
|
[
"FSFAP"
] | 1
|
2021-07-29T07:47:10.000Z
|
2021-07-29T07:47:10.000Z
|
auction/testing/test_models.py
|
AnthonyNicklin/newage-auctions
|
f829c9761e4fef0c084cf0244a4617a4bda8e0c2
|
[
"FSFAP"
] | 9
|
2019-12-19T21:27:23.000Z
|
2022-01-13T01:59:10.000Z
|
auction/testing/test_models.py
|
AnthonyNicklin/newage-auctions
|
f829c9761e4fef0c084cf0244a4617a4bda8e0c2
|
[
"FSFAP"
] | 1
|
2020-02-11T19:50:45.000Z
|
2020-02-11T19:50:45.000Z
|
from django.test import TestCase
from django.contrib.auth.models import User
from datetime import datetime
from auction.models import Lot, Auction, Bid
class LotModelTest(TestCase):
""" Tests fot the Lot model """
@classmethod
# Set up non-modified objects used by all test methods
def setUpTestData(cls):
Lot.objects.create(id=1, name='Tommy Gun', origin='USA',
description="Gun used by gangsters in the 50's", age=50, category='military')
def test_name_label(self):
lot_obj = Lot.objects.get(id=1)
field_label = lot_obj._meta.get_field('name').verbose_name
self.assertEquals(field_label, 'name')
def test_name_max_length(self):
lot_obj = Lot.objects.get(id=1)
max_length = lot_obj._meta.get_field('name').max_length
self.assertEquals(max_length, 200)
def test_origin_label(self):
lot_obj = Lot.objects.get(id=1)
field_label = lot_obj._meta.get_field('origin').verbose_name
self.assertEquals(field_label, 'origin')
def test_origin_max_length(self):
lot_obj = Lot.objects.get(id=1)
max_length = lot_obj._meta.get_field('origin').max_length
self.assertEquals(max_length, 200)
def test_description_label(self):
lot_obj = Lot.objects.get(id=1)
field_label = lot_obj._meta.get_field('description').verbose_name
self.assertEquals(field_label, 'description')
def test_age_label(self):
lot_obj = Lot.objects.get(id=1)
field_label = lot_obj._meta.get_field('age').verbose_name
self.assertEquals(field_label, 'age')
class AuctionModelTest(TestCase):
""" Tests for the Auction model """
@classmethod
# Set up non-modified objects used by all test methods
def setUpTestData(cls):
Lot.objects.create(id=1, name='Tommy Gun', origin='USA',
description="Gun used by gangsters in the 50's", age=50, category='military')
user = User.objects.create_user(
username='John12', email='john.smith@gmail.com', password='akdf34983!',
first_name='John', last_name='Smith'
)
user.save()
lot_obj = Lot.objects.get(id=1)
user_obj = User.objects.get(id=1)
Auction.objects.create(id=1, lot=lot_obj, description='Testing model',
number_of_bids=3, time_starting=datetime.now(),
time_ending="2020-02-02 16:30", expired=False,
winner=user_obj, winning_bid=40.00, paid=False)
def test_lot_label(self):
auction_obj = Auction.objects.get(id=1)
field_label = auction_obj._meta.get_field('lot').verbose_name
self.assertEquals(field_label, 'lot')
def test_description_label(self):
auction_obj = Auction.objects.get(id=1)
field_label = auction_obj._meta.get_field('description').verbose_name
self.assertEquals(field_label, 'description')
def test_number_of_bids_label(self):
auction_obj = Auction.objects.get(id=1)
field_label = auction_obj._meta.get_field('number_of_bids').verbose_name
self.assertEquals(field_label, 'number of bids')
def test_time_starting_label(self):
auction_obj = Auction.objects.get(id=1)
field_label = auction_obj._meta.get_field('time_starting').verbose_name
self.assertEquals(field_label, 'time starting')
def test_time_ending_label(self):
auction_obj = Auction.objects.get(id=1)
field_label = auction_obj._meta.get_field('time_ending').verbose_name
self.assertEquals(field_label, 'time ending')
def test_expired_label(self):
auction_obj = Auction.objects.get(id=1)
field_label = auction_obj._meta.get_field('expired').verbose_name
self.assertEquals(field_label, 'expired')
def test_winner_label(self):
auction_obj = Auction.objects.get(id=1)
field_label = auction_obj._meta.get_field('winner').verbose_name
self.assertEquals(field_label, 'winner')
def test_winning_bid_label(self):
auction_obj = Auction.objects.get(id=1)
field_label = auction_obj._meta.get_field('winning_bid').verbose_name
self.assertEquals(field_label, 'winning bid')
def test_paid_label(self):
auction_obj = Auction.objects.get(id=1)
field_label = auction_obj._meta.get_field('paid').verbose_name
self.assertEquals(field_label, 'paid')
class BidModelTest(TestCase):
""" Tests for the Bid model """
@classmethod
# Set up non-modified objects used by all test methods
def setUpTestData(cls):
Lot.objects.create(id=1, name='Tommy Gun', origin='USA',
description="Gun used by gangsters in the 50's", age=50, category='military')
user = User.objects.create_user(
username='John12', email='john.smith@gmail.com', password='akdf34983!',
first_name='John', last_name='Smith'
)
user.save()
lot_obj = Lot.objects.get(id=1)
user_obj = User.objects.get(id=1)
Auction.objects.create(id=1, lot=lot_obj, description='Testing model',
number_of_bids=3, time_starting=datetime.now(),
time_ending="2020-02-02 16:30", expired=False,
winner=user_obj, winning_bid=40.00, paid=False)
auction_obj = Auction.objects.get(id=1)
Bid.objects.create(id=1, auction=auction_obj, user=user_obj, bid_amount=9999999.99,
bid_time=datetime.now())
def test_bid_amount_label(self):
bid_obj = Bid.objects.get(id=1)
field_label = bid_obj._meta.get_field('bid_amount').verbose_name
self.assertEquals(field_label, 'bid amount')
def test_bid_time_label(self):
bid_obj = Bid.objects.get(id=1)
field_label = bid_obj._meta.get_field('bid_time').verbose_name
self.assertEquals(field_label, 'bid time')
| 41.5
| 91
| 0.671814
| 812
| 5,893
| 4.631773
| 0.119458
| 0.079766
| 0.070194
| 0.076044
| 0.821856
| 0.814145
| 0.720287
| 0.669237
| 0.669237
| 0.645839
| 0
| 0.022165
| 0.211437
| 5,893
| 142
| 92
| 41.5
| 0.787175
| 0.040387
| 0
| 0.5
| 0
| 0
| 0.099556
| 0
| 0
| 0
| 0
| 0
| 0.151786
| 1
| 0.178571
| false
| 0.017857
| 0.035714
| 0
| 0.241071
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
3be07ce28f7c2fa19ea3a03320997f69f1ed10d0
| 89
|
py
|
Python
|
zmk/utility/apps.py
|
frenebo/ZMOD
|
58159fcbf61200c1ec2d6b92fca0cd9d4e83a208
|
[
"Apache-2.0"
] | 2
|
2021-02-22T18:36:21.000Z
|
2021-06-12T20:28:43.000Z
|
zmk/utility/apps.py
|
frenebo/ZMOD
|
58159fcbf61200c1ec2d6b92fca0cd9d4e83a208
|
[
"Apache-2.0"
] | 20
|
2020-09-26T01:04:36.000Z
|
2022-03-02T08:38:18.000Z
|
zmk/utility/apps.py
|
frenebo/ZMOD
|
58159fcbf61200c1ec2d6b92fca0cd9d4e83a208
|
[
"Apache-2.0"
] | 2
|
2019-09-07T15:10:14.000Z
|
2020-09-04T01:51:19.000Z
|
from django.apps import AppConfig
class UtilityConfig(AppConfig):
name = 'utility'
| 14.833333
| 33
| 0.752809
| 10
| 89
| 6.7
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.168539
| 89
| 5
| 34
| 17.8
| 0.905405
| 0
| 0
| 0
| 0
| 0
| 0.078652
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
3be1bbcc3513cf17974180de0b5c5f603cf2527d
| 143
|
py
|
Python
|
scenarios/card_show/executable.py
|
DisruptiveLabs/balanced-python
|
dbabd8a1c8cd0728d322f6f1caa08891d590e0a1
|
[
"MIT"
] | null | null | null |
scenarios/card_show/executable.py
|
DisruptiveLabs/balanced-python
|
dbabd8a1c8cd0728d322f6f1caa08891d590e0a1
|
[
"MIT"
] | null | null | null |
scenarios/card_show/executable.py
|
DisruptiveLabs/balanced-python
|
dbabd8a1c8cd0728d322f6f1caa08891d590e0a1
|
[
"MIT"
] | null | null | null |
import balanced
balanced.configure('ak-test-1kvvievk0Qqw5wQPsrlM9g7wQwNe62cyc')
card = balanced.Card.fetch('/cards/CC2uc8iPDjgyxOXHVtnZloyI')
| 28.6
| 63
| 0.839161
| 13
| 143
| 9.230769
| 0.769231
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.066176
| 0.048951
| 143
| 5
| 64
| 28.6
| 0.816176
| 0
| 0
| 0
| 0
| 0
| 0.5
| 0.5
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
ce20236258b096b821ddcf431ab02c155ac3e893
| 152
|
py
|
Python
|
mre/pymod_test.py
|
ashgen/carma
|
1e3cf04ce1efe3164c34cb1804e786fa92db0261
|
[
"Apache-2.0"
] | 53
|
2020-04-09T13:03:51.000Z
|
2022-03-24T13:03:43.000Z
|
mre/pymod_test.py
|
ashgen/carma
|
1e3cf04ce1efe3164c34cb1804e786fa92db0261
|
[
"Apache-2.0"
] | 69
|
2020-05-02T21:55:04.000Z
|
2022-03-04T13:54:17.000Z
|
mre/pymod_test.py
|
ashgen/carma
|
1e3cf04ce1efe3164c34cb1804e786fa92db0261
|
[
"Apache-2.0"
] | 14
|
2020-05-18T13:39:38.000Z
|
2022-02-17T08:23:35.000Z
|
from build.pymod import test_runtime_error
try:
test_runtime_error()
except RuntimeError as e:
print(e)
print('successfully caught error')
| 19
| 42
| 0.75
| 21
| 152
| 5.238095
| 0.714286
| 0.2
| 0.290909
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.177632
| 152
| 7
| 43
| 21.714286
| 0.88
| 0
| 0
| 0
| 0
| 0
| 0.164474
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.166667
| 0
| 0.166667
| 0.333333
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
ce44b0b478b8cd0c40f11ba8737b6d40c6f43142
| 1,465
|
py
|
Python
|
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/simulator/cudadrv/devices.py
|
jeikabu/lumberyard
|
07228c605ce16cbf5aaa209a94a3cb9d6c1a4115
|
[
"AML"
] | 8
|
2019-10-07T16:33:47.000Z
|
2020-12-07T03:59:58.000Z
|
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/simulator/cudadrv/devices.py
|
jeikabu/lumberyard
|
07228c605ce16cbf5aaa209a94a3cb9d6c1a4115
|
[
"AML"
] | 1
|
2018-04-03T22:37:40.000Z
|
2018-04-03T23:53:43.000Z
|
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cuda/simulator/cudadrv/devices.py
|
jeikabu/lumberyard
|
07228c605ce16cbf5aaa209a94a3cb9d6c1a4115
|
[
"AML"
] | 5
|
2020-08-27T20:44:18.000Z
|
2021-08-21T22:54:11.000Z
|
class FakeCUDAContext(object):
'''
This stub implements functionality only for simulating a single GPU
at the moment.
'''
def __init__(self, device):
self._device = device
def __enter__(self):
pass
def __exit__(self, exc_type, exc_val, exc_tb):
pass
def __str__(self):
return "<Managed Device {self.id}>".format(self=self)
@property
def id(self):
return self._device
@property
def compute_capability(self):
return (5, 2)
class FakeDeviceList(object):
'''
This stub implements a device list containing a single GPU. It also
keeps track of the GPU status, i.e. whether the context is closed or not,
which may have been set by the user calling reset()
'''
def __init__(self):
self.lst = (FakeCUDAContext(0),)
self.closed = False
def __getitem__(self, devnum):
self.closed = False
return self.lst[devnum]
def __str__(self):
return ', '.join([str(d) for d in self.lst])
def __iter__(self):
return iter(self.lst)
def __len__(self):
return len(self.lst)
@property
def current(self):
if self.closed:
return None
return self.lst[0]
gpus = FakeDeviceList()
def reset():
gpus[0].closed = True
def require_context(func):
'''
In the simulator, a context is always "available", so this is a no-op.
'''
return func
| 21.231884
| 77
| 0.610239
| 191
| 1,465
| 4.455497
| 0.450262
| 0.070505
| 0.032902
| 0.056404
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.004798
| 0.288737
| 1,465
| 68
| 78
| 21.544118
| 0.8119
| 0.23686
| 0
| 0.236842
| 0
| 0
| 0.026415
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.368421
| false
| 0.052632
| 0
| 0.157895
| 0.684211
| 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
|
cbecb6e3e76ac4b093a7b173c67642caf021da64
| 224
|
py
|
Python
|
nipype/workflows/smri/freesurfer/__init__.py
|
sebastientourbier/nipype
|
99c5904176481520c5bf42a501aae1a12184e672
|
[
"Apache-2.0"
] | 2
|
2019-01-25T18:20:51.000Z
|
2019-07-30T20:51:51.000Z
|
nipype/workflows/smri/freesurfer/__init__.py
|
sebastientourbier/nipype
|
99c5904176481520c5bf42a501aae1a12184e672
|
[
"Apache-2.0"
] | null | null | null |
nipype/workflows/smri/freesurfer/__init__.py
|
sebastientourbier/nipype
|
99c5904176481520c5bf42a501aae1a12184e672
|
[
"Apache-2.0"
] | 2
|
2018-01-25T19:48:17.000Z
|
2019-01-25T18:20:52.000Z
|
# -*- coding: utf-8 -*-
from .utils import (create_getmask_flow, create_get_stats_flow, create_tessellation_flow)
from .bem import create_bem_flow
from .recon import create_skullstripped_recon_flow, create_reconall_workflow
| 44.8
| 89
| 0.834821
| 32
| 224
| 5.40625
| 0.53125
| 0.208092
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.004902
| 0.089286
| 224
| 4
| 90
| 56
| 0.843137
| 0.09375
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 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
|
020db382bf4fca2c43f0b00c63641aec22c8d99f
| 112
|
py
|
Python
|
scripts/remake_cache.py
|
OpenJUB/jCourse
|
a2b953480b913c3d2cf9774afd5802b0c5364189
|
[
"MIT"
] | null | null | null |
scripts/remake_cache.py
|
OpenJUB/jCourse
|
a2b953480b913c3d2cf9774afd5802b0c5364189
|
[
"MIT"
] | null | null | null |
scripts/remake_cache.py
|
OpenJUB/jCourse
|
a2b953480b913c3d2cf9774afd5802b0c5364189
|
[
"MIT"
] | null | null | null |
from app.cache import *
if is_marked_timeline_cache():
create_timeline_cache()
delete_timeline_cache()
| 18.666667
| 30
| 0.767857
| 15
| 112
| 5.266667
| 0.666667
| 0.493671
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.151786
| 112
| 5
| 31
| 22.4
| 0.831579
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.25
| 0
| 0.25
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
0215f5b7dc6d98e25b4aacca4efa6942eca9dceb
| 408
|
py
|
Python
|
ampel_mit_fsm.py
|
Efe-Haspolat/Ampel_mit_FSM
|
34a59467359c1ab4bffe105838e1243ba8b8067f
|
[
"MIT"
] | null | null | null |
ampel_mit_fsm.py
|
Efe-Haspolat/Ampel_mit_FSM
|
34a59467359c1ab4bffe105838e1243ba8b8067f
|
[
"MIT"
] | null | null | null |
ampel_mit_fsm.py
|
Efe-Haspolat/Ampel_mit_FSM
|
34a59467359c1ab4bffe105838e1243ba8b8067f
|
[
"MIT"
] | null | null | null |
from ampel import FsmEfe
import time
class AmpelFsm(FsmEfe):
pass
ampel = FsmEfe("ROT", "GELB", "GRÜN", 10, 2, 10)
ampel2 = FsmEfe()
ampel.trafik_isiklarini_calistir()
ampel2.trafik_isiklarini_calistir()
while True:
ampel.trafik_isiklarini_calistir() # girilen argümanlara göre renk ve süreler ile oluşacak
print("")
ampel2.trafik_isiklarini_calistir() # varsayılan değerler kullanılacak
| 24
| 94
| 0.757353
| 50
| 408
| 6.02
| 0.62
| 0.212625
| 0.318937
| 0.192691
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.022989
| 0.147059
| 408
| 17
| 95
| 24
| 0.841954
| 0.210784
| 0
| 0.333333
| 0
| 0
| 0.034375
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.083333
| 0.166667
| 0
| 0.25
| 0.083333
| 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
|
022c62bc2ceea4c304f481eb0a6958568f81a70a
| 141
|
py
|
Python
|
schemas.py
|
qracer/fastapi-shortener-api
|
3f17bda81be9ca37e01b7b8a6ee3d9e70fac78e9
|
[
"Apache-2.0"
] | null | null | null |
schemas.py
|
qracer/fastapi-shortener-api
|
3f17bda81be9ca37e01b7b8a6ee3d9e70fac78e9
|
[
"Apache-2.0"
] | null | null | null |
schemas.py
|
qracer/fastapi-shortener-api
|
3f17bda81be9ca37e01b7b8a6ee3d9e70fac78e9
|
[
"Apache-2.0"
] | null | null | null |
from pydantic import BaseModel, AnyUrl
class URL(BaseModel):
url: AnyUrl
class URLtoURL(BaseModel):
url: str
shortened_url: str
| 17.625
| 38
| 0.730496
| 18
| 141
| 5.666667
| 0.555556
| 0.215686
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.198582
| 141
| 8
| 39
| 17.625
| 0.902655
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.166667
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
0238b90e8740fad91bbf53a17df323ba08a62443
| 728
|
py
|
Python
|
mysite/userApp/models.py
|
98ZhaoJeffrey/Glorious-Future
|
4dd86a838062fac4bc0c1e10cbb008c241b4c835
|
[
"MIT"
] | 1
|
2021-03-09T01:11:37.000Z
|
2021-03-09T01:11:37.000Z
|
mysite/userApp/models.py
|
98ZhaoJeffrey/Glorious-Future
|
4dd86a838062fac4bc0c1e10cbb008c241b4c835
|
[
"MIT"
] | null | null | null |
mysite/userApp/models.py
|
98ZhaoJeffrey/Glorious-Future
|
4dd86a838062fac4bc0c1e10cbb008c241b4c835
|
[
"MIT"
] | null | null | null |
from django.db import models
from django.contrib.auth.models import AbstractUser
from django.template.defaultfilters import slugify
class User(AbstractUser):
location = models.CharField(max_length=30, blank=True)
def __str__(self):
return self.get_username()
def can_view_post(self):
"""
Checks if the user is a student or superuser
Args:
-----
None
Return:
boolean: (True if student or superuser, false is organization)
"""
#only students and admins may use the search, submitForm functions
#organizations are considered staff but not super users
return (not bool(self.is_staff) or self.is_superuser)
| 24.266667
| 74
| 0.659341
| 90
| 728
| 5.222222
| 0.666667
| 0.06383
| 0.076596
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.003766
| 0.270604
| 728
| 29
| 75
| 25.103448
| 0.881356
| 0.350275
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.222222
| false
| 0
| 0.333333
| 0.111111
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 1
| 1
| 0
|
0
| 4
|
02533bf4633f117057598524595ecfe802ae30bc
| 45
|
py
|
Python
|
mlprodict/onnx_conv/parsers/__init__.py
|
henrywu2019/mlprodict
|
4c09dc39d5ba7a7235fa321d80c81b5bf4f078ad
|
[
"MIT"
] | 1
|
2020-12-18T03:49:53.000Z
|
2020-12-18T03:49:53.000Z
|
mlprodict/onnx_conv/parsers/__init__.py
|
henrywu2019/mlprodict
|
4c09dc39d5ba7a7235fa321d80c81b5bf4f078ad
|
[
"MIT"
] | null | null | null |
mlprodict/onnx_conv/parsers/__init__.py
|
henrywu2019/mlprodict
|
4c09dc39d5ba7a7235fa321d80c81b5bf4f078ad
|
[
"MIT"
] | null | null | null |
"""
@file
@brief Shortcut to *parsers*.
"""
| 9
| 30
| 0.577778
| 5
| 45
| 5.2
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.177778
| 45
| 4
| 31
| 11.25
| 0.702703
| 0.8
| 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
|
026a7acdd533719065dcc1c7c1955565b13d6f6f
| 525
|
py
|
Python
|
mongoengine/queryset/__init__.py
|
rembish/mongoengine
|
e305c31eaaa2c68cd1e7ab30ee7c3c4b4d01d782
|
[
"MIT"
] | 21
|
2015-08-05T03:40:28.000Z
|
2021-06-05T05:29:55.000Z
|
mongoengine/queryset/__init__.py
|
rembish/mongoengine
|
e305c31eaaa2c68cd1e7ab30ee7c3c4b4d01d782
|
[
"MIT"
] | 9
|
2015-07-24T23:13:06.000Z
|
2022-02-25T17:34:09.000Z
|
mongoengine/queryset/__init__.py
|
rembish/mongoengine
|
e305c31eaaa2c68cd1e7ab30ee7c3c4b4d01d782
|
[
"MIT"
] | 5
|
2015-11-18T23:20:20.000Z
|
2021-02-02T02:31:07.000Z
|
from mongoengine.errors import (DoesNotExist, MultipleObjectsReturned,
InvalidQueryError, OperationError,
NotUniqueError)
from mongoengine.queryset.field_list import *
from mongoengine.queryset.manager import *
from mongoengine.queryset.queryset import *
from mongoengine.queryset.transform import *
from mongoengine.queryset.visitor import *
__all__ = (field_list.__all__ + manager.__all__ + queryset.__all__ +
transform.__all__ + visitor.__all__)
| 43.75
| 70
| 0.71619
| 47
| 525
| 7.446809
| 0.340426
| 0.257143
| 0.328571
| 0.331429
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.219048
| 525
| 11
| 71
| 47.727273
| 0.853659
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.6
| 0
| 0.6
| 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
|
027396056e23ad745f6d5a26924d0d96ec3592bc
| 61
|
py
|
Python
|
src/izi/apps/partner/__init__.py
|
izi-core/izi-core
|
21176be2d41f0cf54ca954f294209c585f643dba
|
[
"BSD-3-Clause"
] | null | null | null |
src/izi/apps/partner/__init__.py
|
izi-core/izi-core
|
21176be2d41f0cf54ca954f294209c585f643dba
|
[
"BSD-3-Clause"
] | null | null | null |
src/izi/apps/partner/__init__.py
|
izi-core/izi-core
|
21176be2d41f0cf54ca954f294209c585f643dba
|
[
"BSD-3-Clause"
] | null | null | null |
default_app_config = 'izi.apps.partner.config.PartnerConfig'
| 30.5
| 60
| 0.836066
| 8
| 61
| 6.125
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.04918
| 61
| 1
| 61
| 61
| 0.844828
| 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
|
5a3c2044899cb2aee8d987f9cc3adf2a18c284f3
| 71
|
py
|
Python
|
tests/__init__.py
|
flannsmith/DublinBikesApp
|
a0ee344f2d3d06ba924804123d8583cd74cdb815
|
[
"MIT"
] | null | null | null |
tests/__init__.py
|
flannsmith/DublinBikesApp
|
a0ee344f2d3d06ba924804123d8583cd74cdb815
|
[
"MIT"
] | null | null | null |
tests/__init__.py
|
flannsmith/DublinBikesApp
|
a0ee344f2d3d06ba924804123d8583cd74cdb815
|
[
"MIT"
] | 1
|
2018-03-21T18:21:50.000Z
|
2018-03-21T18:21:50.000Z
|
# -*- coding: utf-8 -*-
"""Unit test package for dublin_bikes_app."""
| 17.75
| 45
| 0.619718
| 10
| 71
| 4.2
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.016667
| 0.15493
| 71
| 3
| 46
| 23.666667
| 0.683333
| 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
|
5a80aec71536cfbc86d7bc64cadce0aa43ac7303
| 231
|
py
|
Python
|
accounts/tests/__init__.py
|
bbengfort/ledger
|
f3b961be568d3a373228ee2ccf52afc7fb7ca9a8
|
[
"MIT"
] | 1
|
2018-08-15T22:34:33.000Z
|
2018-08-15T22:34:33.000Z
|
accounts/tests/__init__.py
|
bbengfort/ledger
|
f3b961be568d3a373228ee2ccf52afc7fb7ca9a8
|
[
"MIT"
] | 75
|
2018-05-07T21:13:27.000Z
|
2021-09-22T17:45:20.000Z
|
accounts/tests/__init__.py
|
bbengfort/ledger
|
f3b961be568d3a373228ee2ccf52afc7fb7ca9a8
|
[
"MIT"
] | 2
|
2018-08-15T22:34:34.000Z
|
2020-07-04T17:27:41.000Z
|
# accounts.tests
# Tests for the account app
#
# Author: Benjamin Bengfort <benjamin@bengfort.com>
# Created: Wed May 02 15:41:44 2018 -0400
#
# ID: __init__.py [0395481] benjamin@bengfort.com $
"""
Tests for the account app
"""
| 19.25
| 52
| 0.705628
| 34
| 231
| 4.676471
| 0.676471
| 0.301887
| 0.138365
| 0.226415
| 0.264151
| 0
| 0
| 0
| 0
| 0
| 0
| 0.119171
| 0.164502
| 231
| 11
| 53
| 21
| 0.704663
| 0.900433
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 0
| 0
| 0
| null | 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
ce49638b4b749847e8cc278e3d16e2909c92eae4
| 167
|
py
|
Python
|
odoo-13.0/addons/l10n_et/__init__.py
|
VaibhavBhujade/Blockchain-ERP-interoperability
|
b5190a037fb6615386f7cbad024d51b0abd4ba03
|
[
"MIT"
] | 1
|
2019-12-19T01:53:13.000Z
|
2019-12-19T01:53:13.000Z
|
odoo-13.0/addons/l10n_et/__init__.py
|
VaibhavBhujade/Blockchain-ERP-interoperability
|
b5190a037fb6615386f7cbad024d51b0abd4ba03
|
[
"MIT"
] | null | null | null |
odoo-13.0/addons/l10n_et/__init__.py
|
VaibhavBhujade/Blockchain-ERP-interoperability
|
b5190a037fb6615386f7cbad024d51b0abd4ba03
|
[
"MIT"
] | null | null | null |
#-*- coding:utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Copyright (C) 2012 Michael Telahun Makonnen <mmakonnen@gmail.com>.
| 33.4
| 74
| 0.730539
| 24
| 167
| 5.083333
| 0.958333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.035211
| 0.149701
| 167
| 4
| 75
| 41.75
| 0.823944
| 0.958084
| 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
|
ce5abea315181b4dbabd247efe955deabc4bc8e0
| 1,667
|
py
|
Python
|
credential.py
|
seron-ux/Password-Locker
|
b0c1726cf46f60faff6ffcb9959c750e1f7ad84f
|
[
"MIT"
] | null | null | null |
credential.py
|
seron-ux/Password-Locker
|
b0c1726cf46f60faff6ffcb9959c750e1f7ad84f
|
[
"MIT"
] | null | null | null |
credential.py
|
seron-ux/Password-Locker
|
b0c1726cf46f60faff6ffcb9959c750e1f7ad84f
|
[
"MIT"
] | null | null | null |
import random
import string
# import pyperclip
class Credential:
"""
Class that generates new instances of credentials.
"""
credential_list = [] # empty credentials list
def __init__(self,account,username, password):
"""
method that defines user credential to be stored
"""
self.account = account
self.username = username
self.password = password
def save_credential(self):
'''
method that saves credential objects into application
'''
credential.Credential_list.append(self)
def delete_credential(self):
'''
method deletes a saved credential from credential_list
'''
Credential.Credential_list.remove(self)
@classmethod
def find_credential(cls,account):
"""
method that takes in account_name and returns a credentials that matches account_name
"""
for Credential in cls.credential_list:
if Credential.account == account:
return Credential
@classmethod
def credential_exist(cls,name):
'''
method that checks if a credential exists from the credetial list
Args:
name: name to search if it exists
Returns:
Boolean: True or false depending if credential exists
'''
for Credential in cls.credential_list:
if credential_name == name:
return True
return False
@classmethod
def display_credential(cls):
'''
method that returns the credential list
'''
return cls.credential_list
| 25.646154
| 93
| 0.605879
| 171
| 1,667
| 5.795322
| 0.374269
| 0.113017
| 0.051463
| 0.036327
| 0.088799
| 0.088799
| 0.088799
| 0.088799
| 0
| 0
| 0
| 0
| 0.331134
| 1,667
| 65
| 94
| 25.646154
| 0.888789
| 0.329934
| 0
| 0.192308
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.230769
| false
| 0.076923
| 0.076923
| 0
| 0.538462
| 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
|
ce75f00404e234d3c92333724c1734637caae606
| 248
|
py
|
Python
|
website/search/exceptions.py
|
DanielSBrown/osf.io
|
98dda2ac237377197acacce78274bc0a4ce8f303
|
[
"Apache-2.0"
] | 1
|
2015-10-02T18:35:53.000Z
|
2015-10-02T18:35:53.000Z
|
website/search/exceptions.py
|
DanielSBrown/osf.io
|
98dda2ac237377197acacce78274bc0a4ce8f303
|
[
"Apache-2.0"
] | 18
|
2020-03-24T15:26:02.000Z
|
2022-03-08T21:30:39.000Z
|
website/search/exceptions.py
|
DanielSBrown/osf.io
|
98dda2ac237377197acacce78274bc0a4ce8f303
|
[
"Apache-2.0"
] | 1
|
2018-11-06T11:03:48.000Z
|
2018-11-06T11:03:48.000Z
|
# custom exceptions for ElasticSearch
class SearchException(Exception):
pass
class IndexNotFoundError(SearchException):
pass
class MalformedQueryError(SearchException):
pass
class SearchUnavailableError(SearchException):
pass
| 15.5
| 46
| 0.790323
| 20
| 248
| 9.8
| 0.55
| 0.137755
| 0.244898
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.157258
| 248
| 15
| 47
| 16.533333
| 0.937799
| 0.141129
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
ce78dac225c25c6b26f19a7b047345e717220901
| 928
|
py
|
Python
|
scripts/analyze_stackdmp.py
|
proddy/MyESP
|
7619bd91bd72a64791fe52a077ce9b7bfd6ad34b
|
[
"MIT"
] | null | null | null |
scripts/analyze_stackdmp.py
|
proddy/MyESP
|
7619bd91bd72a64791fe52a077ce9b7bfd6ad34b
|
[
"MIT"
] | null | null | null |
scripts/analyze_stackdmp.py
|
proddy/MyESP
|
7619bd91bd72a64791fe52a077ce9b7bfd6ad34b
|
[
"MIT"
] | 3
|
2019-12-28T20:09:46.000Z
|
2020-11-28T09:40:16.000Z
|
#!/usr/bin/env python
from subprocess import call
import os
# example stackdmp.txt would contain text like below copied & pasted from a 'crash dump' command:
# >>>stack>>>
# 3fffff20: 3fff32f0 00000003 3fff3028 402101b2
# 3fffff30: 3fffdad0 3fff3280 0000000d 402148aa
# 3fffff40: 3fffdad0 3fff3280 3fff326c 3fff32f0
# 3fffff50: 0000000d 3fff326c 3fff3028 402103bd
# 3fffff60: 0000000d 3fff34cc 40211de4 3fff34cc
# 3fffff70: 3fff3028 3fff14c4 3fff301c 3fff34cc
# 3fffff80: 3fffdad0 3fff14c4 3fff3028 40210493
# 3fffff90: 3fffdad0 00000000 3fff14c4 4020a738
# 3fffffa0: 3fffdad0 00000000 3fff349c 40211e90
# 3fffffb0: feefeffe feefeffe 3ffe8558 40100b01
# <<<stack<<<
call(['python', 'scripts/decoder.py ', '-s', '-e', os.getcwd()+"/.pio/build/debug/firmware_debug_1_9_1b3.elf", 'scripts/stackdmp.txt'])
# example for linux:
# % python scripts/decoder_linux.py -s -e .pio/build/debug/firmware_d1_mini.elf scripts/stackdmp.txt
| 38.666667
| 135
| 0.775862
| 118
| 928
| 6.042373
| 0.627119
| 0.046283
| 0.056101
| 0.058906
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.271726
| 0.119612
| 928
| 23
| 136
| 40.347826
| 0.600979
| 0.773707
| 0
| 0
| 0
| 0
| 0.479381
| 0.226804
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
ce8fb1426dbb9c3a71962b84319b0b2ac80b5a14
| 133
|
py
|
Python
|
products/urls.py
|
Walachul/milestone4
|
ce3be4d39b5d28141f41d4783d3e7211480ce64d
|
[
"MIT"
] | null | null | null |
products/urls.py
|
Walachul/milestone4
|
ce3be4d39b5d28141f41d4783d3e7211480ce64d
|
[
"MIT"
] | 7
|
2020-02-12T03:15:31.000Z
|
2022-03-12T00:01:18.000Z
|
products/urls.py
|
Code-Institute-Submissions/Walachul-milestone4
|
ce3be4d39b5d28141f41d4783d3e7211480ce64d
|
[
"MIT"
] | 1
|
2020-01-12T12:49:10.000Z
|
2020-01-12T12:49:10.000Z
|
from django.conf.urls import url, include
from .views import all_items
urlpatterns = [url(r"^$", all_items, name="products-home")]
| 22.166667
| 59
| 0.736842
| 20
| 133
| 4.8
| 0.75
| 0.166667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.120301
| 133
| 5
| 60
| 26.6
| 0.820513
| 0
| 0
| 0
| 0
| 0
| 0.113636
| 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
|
cec5837c5ce2ece44c9c18ede781d3a57534daa3
| 489
|
py
|
Python
|
books/PythonAutomate/pdf_word_documents/reading_word.py
|
zeroam/TIL
|
43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1
|
[
"MIT"
] | null | null | null |
books/PythonAutomate/pdf_word_documents/reading_word.py
|
zeroam/TIL
|
43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1
|
[
"MIT"
] | null | null | null |
books/PythonAutomate/pdf_word_documents/reading_word.py
|
zeroam/TIL
|
43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1
|
[
"MIT"
] | null | null | null |
"""reading_word.py
워드 문서 읽기
"""
import docx
doc = docx.Document("demo.docx")
print(len(doc.paragraphs)) # paragraph 갯수
print(doc.paragraphs[0].text) # 첫번째 paragraph 문자열
print(doc.paragraphs[1].text) # 두번째 paragraph 문자열
print(len(doc.paragraphs[1].runs)) # 두번쨰 paragraph의 run 갯수
print(doc.paragraphs[1].runs[0].text) # 두번쨰 paragraph의 첫번째 run 문자열
print(doc.paragraphs[1].runs[1].text) # 두번쨰 paragraph의 두번째 run 문자열
print(doc.paragraphs[1].runs[2].text) # 두번쨰 paragraph의 세번째 run 문자열
| 30.5625
| 67
| 0.725971
| 81
| 489
| 4.37037
| 0.345679
| 0.257062
| 0.254237
| 0.214689
| 0.29096
| 0.163842
| 0.163842
| 0
| 0
| 0
| 0
| 0.021028
| 0.124744
| 489
| 15
| 68
| 32.6
| 0.806075
| 0.361963
| 0
| 0
| 0
| 0
| 0.0301
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.111111
| 0
| 0.111111
| 0.777778
| 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
|
0c882ba38a1a45a2e381cb6d5b8332cc2f14aef3
| 621
|
py
|
Python
|
stlearn/__init__.py
|
duypham2108/stLearn
|
91b6bae91b29aba8b4f055bf92da13f1558ddbe8
|
[
"BSD-3-Clause"
] | null | null | null |
stlearn/__init__.py
|
duypham2108/stLearn
|
91b6bae91b29aba8b4f055bf92da13f1558ddbe8
|
[
"BSD-3-Clause"
] | null | null | null |
stlearn/__init__.py
|
duypham2108/stLearn
|
91b6bae91b29aba8b4f055bf92da13f1558ddbe8
|
[
"BSD-3-Clause"
] | 1
|
2019-12-12T12:46:55.000Z
|
2019-12-12T12:46:55.000Z
|
"""Top-level package for stLearn."""
__author__ = """Genomics and Machine Learning lab"""
__email__ = "duy.pham@uq.edu.au"
__version__ = "0.4.0"
from . import add
from . import pp
from . import em
from . import tl
from . import pl
from . import spatial
from . import datasets
# Wrapper
from .wrapper.read import ReadSlideSeq
from .wrapper.read import Read10X
from .wrapper.read import ReadOldST
from .wrapper.read import ReadMERFISH
from .wrapper.read import ReadSeqFish
from .wrapper.read import create_stlearn
from ._settings import settings
from .wrapper.convert_scanpy import convert_scanpy
# from . import cli
| 22.178571
| 52
| 0.771337
| 88
| 621
| 5.261364
| 0.465909
| 0.172786
| 0.194384
| 0.272138
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.009416
| 0.144928
| 621
| 27
| 53
| 23
| 0.862524
| 0.091787
| 0
| 0
| 0
| 0
| 0.100539
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.833333
| 0
| 0.833333
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
0cacd854c7a8a3b19e8a3fba687245c0c945c0fb
| 250
|
py
|
Python
|
speakup/articles/views.py
|
zeus0123/BlogRepository
|
57cc93fa2382bbe121138aa5fca1d34743a7846c
|
[
"MIT"
] | null | null | null |
speakup/articles/views.py
|
zeus0123/BlogRepository
|
57cc93fa2382bbe121138aa5fca1d34743a7846c
|
[
"MIT"
] | null | null | null |
speakup/articles/views.py
|
zeus0123/BlogRepository
|
57cc93fa2382bbe121138aa5fca1d34743a7846c
|
[
"MIT"
] | null | null | null |
from django.shortcuts import render
from .models import Article
# Create your views here.
def article_list(request):
articles = Article.objects.all().order_by('date')
return render(request,'articles/article_list.html',{'articles': articles})
| 35.714286
| 78
| 0.764
| 33
| 250
| 5.69697
| 0.666667
| 0.117021
| 0.234043
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.116
| 250
| 7
| 78
| 35.714286
| 0.850679
| 0.092
| 0
| 0
| 0
| 0
| 0.168142
| 0.115044
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0.4
| 0
| 0.8
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
0cbe21803e140e7a3d3f3831d13ace308048ac6f
| 434
|
py
|
Python
|
sqlflow_models/__init__.py
|
sneaxiy/models-2
|
07a75db1016876916037478053f9f54e1b6708b5
|
[
"Apache-2.0"
] | null | null | null |
sqlflow_models/__init__.py
|
sneaxiy/models-2
|
07a75db1016876916037478053f9f54e1b6708b5
|
[
"Apache-2.0"
] | null | null | null |
sqlflow_models/__init__.py
|
sneaxiy/models-2
|
07a75db1016876916037478053f9f54e1b6708b5
|
[
"Apache-2.0"
] | null | null | null |
from ._version import __version__
from .dnnclassifier import DNNClassifier
from .dnnregressor import DNNRegressor
from .lstmclassifier import StackedBiLSTMClassifier
from .deep_embedding_cluster import DeepEmbeddingClusterModel
from .dnnclassifier_functional_api_example import dnnclassifier_functional_model
from .lstm_based_time_series_beta0 import LSTMBasedTimeSeriesModel
from .auto_estimator import AutoClassifier, AutoRegressor
| 48.222222
| 80
| 0.903226
| 45
| 434
| 8.333333
| 0.555556
| 0.090667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.002494
| 0.076037
| 434
| 8
| 81
| 54.25
| 0.932668
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 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
|
0cca8ffaab5dcb3bb8ddfc3c96672d6e3b391937
| 185
|
py
|
Python
|
src/api/serializers.py
|
SleepNoMore/test1
|
8ff67daabe3b446d62ab509888eee747336c77d6
|
[
"MIT"
] | null | null | null |
src/api/serializers.py
|
SleepNoMore/test1
|
8ff67daabe3b446d62ab509888eee747336c77d6
|
[
"MIT"
] | null | null | null |
src/api/serializers.py
|
SleepNoMore/test1
|
8ff67daabe3b446d62ab509888eee747336c77d6
|
[
"MIT"
] | null | null | null |
from rest_framework.serializers import ModelSerializer
from .models import Book
class BookSerializer(ModelSerializer):
class Meta:
model = Book
fields = "__all__"
| 20.555556
| 54
| 0.72973
| 19
| 185
| 6.842105
| 0.736842
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.216216
| 185
| 8
| 55
| 23.125
| 0.896552
| 0
| 0
| 0
| 0
| 0
| 0.037838
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 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
|
0cd02c90642771acab7f9b92a2175e147517a71b
| 192
|
py
|
Python
|
ws/handler/event/appliance/light/show/ending_hue.py
|
fabaff/automate-ws
|
a9442f287692787e3f253e1ff23758bec8f3902e
|
[
"MIT"
] | null | null | null |
ws/handler/event/appliance/light/show/ending_hue.py
|
fabaff/automate-ws
|
a9442f287692787e3f253e1ff23758bec8f3902e
|
[
"MIT"
] | 1
|
2021-12-21T11:34:47.000Z
|
2021-12-21T11:34:47.000Z
|
ws/handler/event/appliance/light/show/ending_hue.py
|
fabaff/automate-ws
|
a9442f287692787e3f253e1ff23758bec8f3902e
|
[
"MIT"
] | 1
|
2021-12-21T10:10:13.000Z
|
2021-12-21T10:10:13.000Z
|
import home
from ws.handler.event.appliance.light.hue import Handler as Parent
class Handler(Parent):
KLASS = home.appliance.light.event.show.ending_hue.Event
LABEL = "Ending hue"
| 19.2
| 66
| 0.755208
| 28
| 192
| 5.142857
| 0.571429
| 0.194444
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.151042
| 192
| 9
| 67
| 21.333333
| 0.883436
| 0
| 0
| 0
| 0
| 0
| 0.052083
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.4
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
0ce4064d38bbeffc520b2afe5fe8be1823399dd2
| 28
|
py
|
Python
|
data/studio21_generated/introductory/3617/starter_code.py
|
vijaykumawat256/Prompt-Summarization
|
614f5911e2acd2933440d909de2b4f86653dc214
|
[
"Apache-2.0"
] | null | null | null |
data/studio21_generated/introductory/3617/starter_code.py
|
vijaykumawat256/Prompt-Summarization
|
614f5911e2acd2933440d909de2b4f86653dc214
|
[
"Apache-2.0"
] | null | null | null |
data/studio21_generated/introductory/3617/starter_code.py
|
vijaykumawat256/Prompt-Summarization
|
614f5911e2acd2933440d909de2b4f86653dc214
|
[
"Apache-2.0"
] | null | null | null |
def is_zero_balanced(arr):
| 14
| 26
| 0.785714
| 5
| 28
| 4
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.107143
| 28
| 2
| 27
| 14
| 0.8
| 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
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.