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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5b1068acce4c878ce5df34ba4a15dde5b1154908 | 592 | py | Python | shell_pop_ups/shopping_cart/sales/shopping_cart.py | orionsring/basic_python | 2556d1b3d95334f41cf688f61d4e65bbf38e701a | [
"MIT"
] | null | null | null | shell_pop_ups/shopping_cart/sales/shopping_cart.py | orionsring/basic_python | 2556d1b3d95334f41cf688f61d4e65bbf38e701a | [
"MIT"
] | null | null | null | shell_pop_ups/shopping_cart/sales/shopping_cart.py | orionsring/basic_python | 2556d1b3d95334f41cf688f61d4e65bbf38e701a | [
"MIT"
] | null | null | null |
class Cart:
def __init__(self):
self._contents = dict()
def __repr__(self):
return "{0} {1}".format(Cart, self.__dict__)
def process(self, order):
if order.add:
if not order.item in self._contents:
self._contents[order.item] = 0
self._contents[order.item] += 1
elif order.delete:
if order.item in self._contents:
self._contents[order.item] -= 1
if self._contents[order.item] <= 0:
del self.contents[order.item]
| 23.68 | 53 | 0.511824 | 67 | 592 | 4.238806 | 0.328358 | 0.338028 | 0.299296 | 0.369718 | 0.471831 | 0.309859 | 0.309859 | 0.309859 | 0.309859 | 0 | 0 | 0.016349 | 0.380068 | 592 | 24 | 54 | 24.666667 | 0.757493 | 0 | 0 | 0 | 0 | 0 | 0.012456 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0 | 0.066667 | 0.333333 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
5b17378bdf67794a5c8f3fd64f5949c730f89ad2 | 288 | py | Python | gr/model/usuario/Habilidade.py | Aresjr/Guerreiro | c378836d8d5b41cba8585170459a070eed673356 | [
"Apache-2.0"
] | null | null | null | gr/model/usuario/Habilidade.py | Aresjr/Guerreiro | c378836d8d5b41cba8585170459a070eed673356 | [
"Apache-2.0"
] | 4 | 2020-07-11T00:20:57.000Z | 2020-08-06T11:58:23.000Z | gr/model/usuario/Habilidade.py | Aresjr/Guerreiro | c378836d8d5b41cba8585170459a070eed673356 | [
"Apache-2.0"
] | null | null | null | from app import db
class Habilidade(db.Model):
id = db.Column(db.Integer, primary_key=True)
descricao = db.Column(db.String(255), unique=True)
habPai = db.relationship('Habilidade')
habPaiId = db.Column(db.ForeignKey(id))
del_ = db.Column(db.Boolean, default=False)
| 28.8 | 54 | 0.701389 | 41 | 288 | 4.878049 | 0.609756 | 0.16 | 0.2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012397 | 0.159722 | 288 | 9 | 55 | 32 | 0.81405 | 0 | 0 | 0 | 0 | 0 | 0.034722 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.142857 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
5b1910ab51717e5e2128e8317808630b66a9f232 | 97 | py | Python | pandemic_response_analyzer/datasources/apps.py | sedatozturke/swe-573-2020f | 3368b352076a57eadcfd40ea408666cc8a00d8df | [
"MIT"
] | null | null | null | pandemic_response_analyzer/datasources/apps.py | sedatozturke/swe-573-2020f | 3368b352076a57eadcfd40ea408666cc8a00d8df | [
"MIT"
] | 6 | 2020-11-02T19:47:46.000Z | 2020-11-10T15:31:04.000Z | pandemic_response_analyzer/datasources/apps.py | sedatozturke/swe-573-2020f | 3368b352076a57eadcfd40ea408666cc8a00d8df | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class DatasourcesConfig(AppConfig):
name = 'datasources'
| 16.166667 | 35 | 0.773196 | 10 | 97 | 7.5 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.154639 | 97 | 5 | 36 | 19.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 | 0 | 0 | 0 | 3 |
5b1f798fe74454b5f562f57aa9c913e2d8fcf37d | 692 | py | Python | pegomancy/grammar_items.py | doom/pegomancy | 15b8c7857e25deeeb6d4ed190a2ef99cd70eee12 | [
"MIT"
] | 1 | 2022-02-09T11:22:42.000Z | 2022-02-09T11:22:42.000Z | pegomancy/grammar_items.py | doom/pegomancy | 15b8c7857e25deeeb6d4ed190a2ef99cd70eee12 | [
"MIT"
] | null | null | null | pegomancy/grammar_items.py | doom/pegomancy | 15b8c7857e25deeeb6d4ed190a2ef99cd70eee12 | [
"MIT"
] | null | null | null | from abc import abstractmethod, ABCMeta
class ItemAttributes:
def __init__(self, name: str = None, ignore: bool = False):
self.name = name
self.ignore = ignore
def is_named(self) -> bool:
return self.name is not None
def is_ignored(self) -> bool:
return self.ignore
def __repr__(self):
return f"ItemAttributes(name={self.name!r}, ignore={self.ignore!r})"
class AbstractItem(metaclass=ABCMeta):
@abstractmethod
def generate_condition(self) -> str:
pass
@staticmethod
def is_nested() -> bool:
return False
class NestedItemMixin:
@staticmethod
def is_nested() -> bool:
return True
| 20.969697 | 76 | 0.640173 | 82 | 692 | 5.243902 | 0.402439 | 0.074419 | 0.065116 | 0.083721 | 0.153488 | 0.153488 | 0 | 0 | 0 | 0 | 0 | 0 | 0.261561 | 692 | 32 | 77 | 21.625 | 0.841487 | 0 | 0 | 0.181818 | 0 | 0 | 0.083815 | 0.08237 | 0 | 0 | 0 | 0 | 0 | 1 | 0.318182 | false | 0.045455 | 0.045455 | 0.227273 | 0.727273 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
d297bb187adc1b97f750aae433f96d0f0d3fa79b | 15,464 | py | Python | htmlLib.py | IceTiki/getCpdailyQrcode | 69af2f38f452943f9fef4be1ec50b818fc689eb0 | [
"MIT"
] | null | null | null | htmlLib.py | IceTiki/getCpdailyQrcode | 69af2f38f452943f9fef4be1ec50b818fc689eb0 | [
"MIT"
] | null | null | null | htmlLib.py | IceTiki/getCpdailyQrcode | 69af2f38f452943f9fef4be1ec50b818fc689eb0 | [
"MIT"
] | null | null | null | # 复制源自https://tool.g3w.cn/jrxy/
flowCss="""<style type="text/css">
.bg-lv1[data-v-09009c6b] {
background-color: #f4f4f4
}
.bg-lv2[data-v-09009c6b] {
background-color: #f9f9f9
}
.bg-lv3[data-v-09009c6b] {
background-color: #fff
}
.thin-line[data-v-09009c6b] {
position: absolute;
display: block;
top: 0;
left: 0;
width: 200%;
height: 200%;
transform: scale(.5);
transform-origin: 0 0;
-webkit-transform: scale(.5);
-webkit-transform-origin: 0 0;
box-sizing: border-box;
pointer-events: none
}
.loc__tip--success[data-v-09009c6b]:before {
background-color: #7fce38
}
.loc__tip--failed[data-v-09009c6b]:before,
.loc__tip--success[data-v-09009c6b]:before {
content: "";
width: .5rem;
height: .5rem;
line-height: .5rem;
margin-right: .4rem;
display: inline-block;
border-radius: 50%
}
.loc__tip--failed[data-v-09009c6b]:before {
background-color: #ed5c00
}
.tip-color[data-v-09009c6b] {
color: #92969c
}
.mt-8[data-v-09009c6b] {
margin-top: 8px
}
.mt-10[data-v-09009c6b] {
margin-top: 10px
}
.mt-16[data-v-09009c6b] {
margin-top: 16px
}
.mt-24[data-v-09009c6b] {
margin-top: 24px
}
.mb-8[data-v-09009c6b] {
margin-bottom: 8px
}
.mb-10[data-v-09009c6b] {
margin-bottom: 10px
}
.mb-16[data-v-09009c6b] {
margin-bottom: 16px
}
.mb-24[data-v-09009c6b] {
margin-bottom: 24px
}
.mv-8[data-v-09009c6b] {
margin: 8px 0
}
.mv-10[data-v-09009c6b] {
margin: 10px 0
}
.mv-16[data-v-09009c6b] {
margin: 16px 0
}
.mv-24[data-v-09009c6b] {
margin: 24px 0
}
.leave-detail[data-v-09009c6b] {
position: relative;
background-color: #fff
}
.leave-detail .audit-pass[data-v-09009c6b] {
position: absolute;
z-index: 1;
right: 16px;
top: 48px;
width: 80px
}
.leave-detail .detail__subtitle[data-v-09009c6b] {
line-height: 1.5rem;
padding-left: .75rem;
color: #bdc0c5;
background-color: #f4f6f8;
font-size: .7rem
}
.leave-detail .detail__item[data-v-09009c6b] {
margin-top: .1rem;
display: flex;
font-size: .7rem
}
.leave-detail .detail__item .detail_item__label[data-v-09009c6b] {
width: 4.5rem;
color: #92969c
}
.leave-detail .detail__item .detail_item__value[data-v-09009c6b] {
flex: 1 0 0;
overflow-wrap: break-word;
word-break: break-all
}
.leave-detail .detail__item .detail_item__value .detail_item__value--danger[data-v-09009c6b] {
color: #ed3f14
}
.leave-detail .detail__item .out__school[data-v-09009c6b] {
display: flex;
align-items: center
}
.detail__main[data-v-09009c6b] {
padding: .75rem;
background-color: #fff;
position: relative
}
.detail__main[data-v-09009c6b]:before {
position: absolute;
display: block;
top: 0;
width: 200%;
height: 200%;
transform: scale(.5);
transform-origin: 0 0;
-webkit-transform: scale(.5);
-webkit-transform-origin: 0 0;
box-sizing: border-box;
pointer-events: none;
content: "";
left: 0;
border-top: 1px solid #e9eaec;
border-bottom: 1px solid #e9eaec
}
.detail__content[data-v-09009c6b] {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 2.4rem;
overflow-y: scroll;
color: #1c2438
}
.bottom-0[data-v-09009c6b] {
bottom: 0 !important
}
.detail__main__header[data-v-09009c6b] {
margin-bottom: .4rem
}
.detail__comment[data-v-09009c6b] {
padding: .75rem;
background-color: #fff;
position: relative
}
.detail__comment[data-v-09009c6b]:before {
position: absolute;
display: block;
top: 0;
width: 200%;
height: 200%;
transform: scale(.5);
transform-origin: 0 0;
-webkit-transform: scale(.5);
-webkit-transform-origin: 0 0;
box-sizing: border-box;
pointer-events: none;
content: "";
left: 0;
border-top: 1px solid #e9eaec;
border-bottom: 1px solid #e9eaec
}
.detail__audit__date[data-v-09009c6b] {
float: right;
font-size: .6rem;
color: #bdc0c5
}
.detail__comment__desc[data-v-09009c6b] {
font-size: .7rem
}
.status-complete .detail__content[data-v-09009c6b],
.status-processing .detail__content[data-v-09009c6b] {
bottom: 0
}
.status-complete .detail__bottom[data-v-09009c6b],
.status-processing .detail__bottom[data-v-09009c6b] {
display: none
}
.btn-area[data-v-09009c6b] {
padding: .6rem 0;
overflow: hidden
}
.btn-processing[data-v-09009c6b] {
display: block;
margin: .4rem 1rem;
transform: translateZ(0)
}
.btn-processing--share[data-v-09009c6b] {
color: #2f343b;
background-color: #fff;
border: 1px solid #dddee1
}
</style>"""
flowCss_2="""<style type="text/css">
@keyframes move {
0% {
color: inherit
}
to {
background-position: 60px 0
}
}
.status-flag {
font-size: 0;
height: 110px
}
.status-flag .flag-dom {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
color: #fff
}
.status-flag .flag-dom .status-text-bold {
font-weight: 400;
font-style: normal;
font-size: 32px;
letter-spacing: 4px;
color: #fff;
line-height: 32px;
margin-top: 5px
}
.status-flag .flag-dom .status-svg-text {
font-family: Microsoft YaHei Regular, Microsoft YaHei;
font-weight: 400;
font-style: normal;
color: #fff;
display: flex;
align-items: center;
font-size: 16px;
margin-top: -5px;
letter-spacing: 2px
}
.status-flag .flag-dom .status-svg-text .svg-icon {
margin-right: 5px;
margin-top: 7px
}
.status-flag .flag-dom .flag-text {
flex: 1;
display: flex;
align-items: center;
flex-direction: column;
justify-content: center
}
.status-flag .flag-dom .no-shrink {
flex-shrink: 0
}
.status-flag .flag-dom .dynamic-strip {
width: 100%;
height: 16px;
margin: 0 auto;
background-size: 60px 60px;
display: flex;
align-items: center;
justify-content: center;
background-image: linear-gradient(135deg, #fff, #fff 25%, transparent 0, transparent 50%, #fff 0, #fff 75%, transparent 0, transparent 0);
animation: move 1s linear infinite;
-webkit-animation: move 1s linear infinite
}
.status-flag .flag-dom .dynamic-strip .now-time {
background: rgba(0, 0, 0, .5);
color: #fff;
text-align: center;
padding: 0 5px;
font-size: 12px;
border-radius: 7px
}
.status-flag .flag-warning {
background: linear-gradient(180deg, #f66c08 1%, #f8aa24)
}
.status-flag .flag-success {
background: linear-gradient(180deg, #00a857, #00dd73)
}
.status-flag .flag-error {
background: linear-gradient(180deg, #f40, #f79677 97%)
}
.status-flag .flag-grey {
background: linear-gradient(0deg, #9ea7b4, #657180)
}
</style>"""
css="""<link type="text/css" rel="stylesheet" href="./xx/index.css">"""
div_1="""<div data-v-09009c6b="" class="status-flag">
<div class="flag-dom flag-success">
<span class="grxx">个人信息 ></span>
<div class="flag-text">
<div class="status-svg-text">
<div class="pick-svg svg-icon">
<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="17px" height="17px" xmlns="http://www.w3.org/2000/svg">
<g transform="matrix(1 0 0 1 -134 -146 )">
<path d="M 14.01171875 7.205078125 C 14.14453125 7.072265625 14.2109375 6.90625 14.2109375 6.70703125 C 14.2109375 6.50043402777778 14.14453125 6.33072916666666 14.01171875 6.19791666666666 L 13.0045572916667 5.20182291666666 C 12.8643663194444 5.06163194444444 12.6983506944445 4.99153645833334 12.5065104166667 4.99153645833334 C 12.3146701388889 4.99153645833334 12.1486545138889 5.06163194444444 12.0084635416667 5.20182291666666 L 7.49283854166671 9.70638020833333 L 4.99153645833329 7.205078125 C 4.85134548611107 7.06488715277778 4.68532986111107 6.99479166666666 4.49348958333329 6.99479166666666 C 4.30164930555557 6.99479166666666 4.13563368055557 7.06488715277778 3.99544270833329 7.205078125 L 2.98828125 8.201171875 C 2.85546875 8.333984375 2.7890625 8.50368923611111 2.7890625 8.71028645833334 C 2.7890625 8.90950520833333 2.85546875 9.07552083333333 2.98828125 9.20833333333333 L 6.99479166666671 13.21484375 C 7.13498263888893 13.3550347222222 7.30099826388893 13.4251302083333 7.49283854166671 13.4251302083333 C 7.69205729166671 13.4251302083333 7.86176215277778 13.3550347222222 8.001953125 13.21484375 L 14.01171875 7.205078125 Z M 15.8600260416667 4.2333984375 C 16.6200086805556 5.53569878472222 17 6.95789930555555 17 8.5 C 17 10.0421006944444 16.6200086805556 11.4643012152778 15.8600260416667 12.7666015625 C 15.1000434027778 14.0689019097222 14.0689019097222 15.1000434027778 12.7666015625 15.8600260416667 C 11.4643012152778 16.6200086805556 10.0421006944444 17 8.5 17 C 6.95789930555557 17 5.53569878472222 16.6200086805556 4.2333984375 15.8600260416667 C 2.93109809027779 15.1000434027778 1.89995659722221 14.0689019097222 1.13997395833329 12.7666015625 C 0.37999131944443 11.4643012152778 0 10.0421006944444 0 8.5 C 0 6.95789930555555 0.37999131944443 5.53569878472222 1.13997395833329 4.2333984375 C 1.89995659722221 2.93109809027778 2.93109809027779 1.89995659722222 4.2333984375 1.13997395833333 C 5.53569878472222 0.379991319444438 6.95789930555557 0 8.5 0 C 10.0421006944444 0 11.4643012152778 0.379991319444438 12.7666015625 1.13997395833333 C 14.0689019097222 1.89995659722222 15.1000434027778 2.93109809027778 15.8600260416667 4.2333984375 Z " fill-rule="nonzero" fill="#ffffff" stroke="none" transform="matrix(1 0 0 1 134 146 )"></path>
</g>
</svg></div> <span>审批已通过</span>
</div>
<div class="status-text-bold">
正在休假中
</div>
</div>
<div class="dynamic-strip no-shrink">
<div class="now-time">
<span id="nowTime">当前时间: 2022-01-08 08:09:03 </span>
</div>
</div>
</div>
</div>"""
timeJs="""<script type="text/javascript">
var newDate = '';
getLangDate();
function dateFilter(date) { //值小于10时,在前面补0
if (date < 10) {
return "0" + date;
}
return date;
}
function getLangDate() {
var dateObj = new Date(); //表示当前系统时间的Date对象
var year = dateObj.getFullYear(); //当前系统时间的完整年份值
var month = dateObj.getMonth() + 1; //当前系统时间的月份值
var date = dateObj.getDate(); //当前系统时间的月份中的日
var day = dateObj.getDay(); //当前系统时间中的星期值
var weeks = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
var week = weeks[day]; //根据星期值,从数组中获取对应的星期字符串
var hour = dateObj.getHours(); //当前系统时间的小时值
var minute = dateObj.getMinutes(); //当前系统时间的分钟值
var second = dateObj.getSeconds(); //当前系统时间的秒钟值
var timeValue = "" + ((hour >= 12) ? (hour >= 18) ? "晚上" : "下午" : "上午"); //当前时间属于上午、晚上还是下午
newDate = dateFilter(year) + "-" + dateFilter(month) + "-" + dateFilter(date) + " " + dateFilter(hour) + ":" +
dateFilter(minute) + ":" + dateFilter(second);
document.getElementById("nowTime").innerHTML = "当前时间: " + newDate + " ";
setTimeout(getLangDate, 1000);
}
</script>""" | 37.262651 | 2,386 | 0.478337 | 1,459 | 15,464 | 5.024674 | 0.259767 | 0.031374 | 0.081571 | 0.036284 | 0.299686 | 0.189469 | 0.154549 | 0.110353 | 0.110353 | 0.102442 | 0 | 0.273746 | 0.417227 | 15,464 | 415 | 2,387 | 37.262651 | 0.539725 | 0.001875 | 0 | 0.26513 | 0 | 0.020173 | 0.99494 | 0.120506 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.002882 | 0.002882 | 0 | 0.008646 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
d2d7694f74bb8d7e7c9a8a06feb4e359b6edc8ed | 60 | py | Python | nayami/common/__init__.py | Coderhypo/namiya | e5501643a726809f2e907bcd2cd9d14034447996 | [
"Apache-2.0"
] | null | null | null | nayami/common/__init__.py | Coderhypo/namiya | e5501643a726809f2e907bcd2cd9d14034447996 | [
"Apache-2.0"
] | null | null | null | nayami/common/__init__.py | Coderhypo/namiya | e5501643a726809f2e907bcd2cd9d14034447996 | [
"Apache-2.0"
] | null | null | null | for m in ['api', 'route']:
__import__('nayami.%s' % m)
| 15 | 31 | 0.533333 | 9 | 60 | 3.111111 | 0.888889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.216667 | 60 | 3 | 32 | 20 | 0.595745 | 0 | 0 | 0 | 0 | 0 | 0.288136 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
d2ed4b734c49118f13d98a2635f96c13e794484e | 353 | py | Python | RL/enumerate_states.py | alexborio/Projects | a85ad4aab370b009de14e3696e06aad92ca4859f | [
"MIT"
] | null | null | null | RL/enumerate_states.py | alexborio/Projects | a85ad4aab370b009de14e3696e06aad92ca4859f | [
"MIT"
] | null | null | null | RL/enumerate_states.py | alexborio/Projects | a85ad4aab370b009de14e3696e06aad92ca4859f | [
"MIT"
] | null | null | null | def enumerate_states(n_states, state_len, state, results):
if n_states > 0:
for sym in ('x', 'o', '_'):
enumerate_states(n_states - 1, state_len, state + sym, results)
if len(state) == state_len:
results.append(state)
state_len = 9
results = []
enumerate_states(state_len, state_len, '', results)
print('done')
| 20.764706 | 75 | 0.631728 | 49 | 353 | 4.285714 | 0.387755 | 0.228571 | 0.185714 | 0.209524 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011029 | 0.229462 | 353 | 16 | 76 | 22.0625 | 0.761029 | 0 | 0 | 0 | 0 | 0 | 0.019886 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.1 | false | 0 | 0 | 0 | 0.1 | 0.1 | 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 | 0 | 0 | 3 |
d2f4a1cad1e12fa5b80d7196f9893827b27ae0f6 | 1,957 | py | Python | pinject/binding_keys.py | suraj-testing2/Android_Soda | bfc90fe03a3c41340f4af9077c20433ed87854db | [
"Apache-2.0"
] | 1,032 | 2015-01-05T10:37:19.000Z | 2022-03-31T22:18:16.000Z | pinject/binding_keys.py | suraj-testing2/Android_Soda | bfc90fe03a3c41340f4af9077c20433ed87854db | [
"Apache-2.0"
] | 44 | 2015-01-20T20:52:56.000Z | 2021-11-12T06:49:32.000Z | pinject/binding_keys.py | suraj-testing2/Android_Soda | bfc90fe03a3c41340f4af9077c20433ed87854db | [
"Apache-2.0"
] | 85 | 2015-01-14T08:58:41.000Z | 2022-03-11T15:44:14.000Z | """Copyright 2013 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
from . import annotations
class BindingKey(object):
"""The key for a binding."""
def __init__(self, name, annotation):
"""Initializer.
Args:
name: the name of the bound arg
annotation: an Annotation
"""
self._name = name
self._annotation = annotation
def __repr__(self):
return '<{0}>'.format(self)
def __str__(self):
return 'the binding name "{0}" ({1})'.format(
self._name, self.annotation_as_adjective())
def annotation_as_adjective(self):
return self._annotation.as_adjective()
def __eq__(self, other):
return (isinstance(other, BindingKey) and
self._name == other._name and
self._annotation == other._annotation)
def __ne__(self, other):
return not (self == other)
def __hash__(self):
return hash(self._name) ^ hash(self._annotation)
def new(arg_name, annotated_with=None):
"""Creates a BindingKey.
Args:
arg_name: the name of the bound arg
annotation: an Annotation, or None to create an unannotated binding key
Returns:
a new BindingKey
"""
if annotated_with is not None:
annotation = annotations.Annotation(annotated_with)
else:
annotation = annotations.NO_ANNOTATION
return BindingKey(arg_name, annotation)
| 28.362319 | 77 | 0.670925 | 251 | 1,957 | 5.047809 | 0.414343 | 0.047356 | 0.049724 | 0.025257 | 0.116811 | 0.072612 | 0.072612 | 0.072612 | 0.072612 | 0.072612 | 0 | 0.007442 | 0.244762 | 1,957 | 68 | 78 | 28.779412 | 0.849797 | 0.432294 | 0 | 0 | 0 | 0 | 0.032008 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.307692 | false | 0 | 0.038462 | 0.230769 | 0.653846 | 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 | 0 | 1 | 1 | 0 | 0 | 3 |
d2f8095d4b2d27518ae92976a200c802ed96c0e9 | 5,199 | py | Python | src/OTLMOW/OTLModel/Datatypes/KlBetonomgevingsklasse.py | davidvlaminck/OTLClassPython | 71330afeb37c3ea6d9981f521ff8f4a3f8b946fc | [
"MIT"
] | 2 | 2022-02-01T08:58:11.000Z | 2022-02-08T13:35:17.000Z | src/OTLMOW/OTLModel/Datatypes/KlBetonomgevingsklasse.py | davidvlaminck/OTLMOW | 71330afeb37c3ea6d9981f521ff8f4a3f8b946fc | [
"MIT"
] | null | null | null | src/OTLMOW/OTLModel/Datatypes/KlBetonomgevingsklasse.py | davidvlaminck/OTLMOW | 71330afeb37c3ea6d9981f521ff8f4a3f8b946fc | [
"MIT"
] | null | null | null | # coding=utf-8
from OTLMOW.OTLModel.Datatypes.KeuzelijstField import KeuzelijstField
from OTLMOW.OTLModel.Datatypes.KeuzelijstWaarde import KeuzelijstWaarde
# Generated with OTLEnumerationCreator. To modify: extend, do not edit
class KlBetonomgevingsklasse(KeuzelijstField):
"""Omgevingsklasse waaraan het beton wordt blootgesteld."""
naam = 'KlBetonomgevingsklasse'
label = 'Betonomgevingsklasse'
objectUri = 'https://wegenenverkeer.data.vlaanderen.be/ns/implementatieelement#KlBetonomgevingsklasse'
definition = 'Omgevingsklasse waaraan het beton wordt blootgesteld.'
codelist = 'https://wegenenverkeer.data.vlaanderen.be/id/conceptscheme/KlBetonomgevingsklasse'
options = {
'e-0': KeuzelijstWaarde(invulwaarde='e-0',
label='E0',
definitie='Niet schadelijk.',
objectUri='https://wegenenverkeer.data.vlaanderen.be/id/concept/KlBetonomgevingsklasse/e-0'),
'e-a-1': KeuzelijstWaarde(invulwaarde='e-a-1',
label='EA1',
definitie='Zwak agressieve chemische omgeving volgens tabel 2 van NBN EN 206-1:2001.',
objectUri='https://wegenenverkeer.data.vlaanderen.be/id/concept/KlBetonomgevingsklasse/e-a-1'),
'e-a-2': KeuzelijstWaarde(invulwaarde='e-a-2',
label='EA2',
definitie='Middelmatig agressieve chemische omgeving volgens tabel 2 van NBN EN 206-1:2001.',
objectUri='https://wegenenverkeer.data.vlaanderen.be/id/concept/KlBetonomgevingsklasse/e-a-2'),
'e-a-3': KeuzelijstWaarde(invulwaarde='e-a-3',
label='EA3',
definitie='Sterk agressieve chemische omgeving volgens tabel 2 van NBN EN 206-1:2001.',
objectUri='https://wegenenverkeer.data.vlaanderen.be/id/concept/KlBetonomgevingsklasse/e-a-3'),
'e-e-1': KeuzelijstWaarde(invulwaarde='e-e-1',
label='EE1',
definitie='Buitenomgeving : geen vorst.',
objectUri='https://wegenenverkeer.data.vlaanderen.be/id/concept/KlBetonomgevingsklasse/e-e-1'),
'e-e-2': KeuzelijstWaarde(invulwaarde='e-e-2',
label='EE2',
definitie='Buitenomgeving : vorst, geen contact met regen.',
objectUri='https://wegenenverkeer.data.vlaanderen.be/id/concept/KlBetonomgevingsklasse/e-e-2'),
'e-e-3': KeuzelijstWaarde(invulwaarde='e-e-3',
label='EE3',
definitie='Buitenomgeving : vorst, contact met regen.',
objectUri='https://wegenenverkeer.data.vlaanderen.be/id/concept/KlBetonomgevingsklasse/e-e-3'),
'e-e-4': KeuzelijstWaarde(invulwaarde='e-e-4',
label='EE4',
definitie='Buitenomgeving : vorst en dooizouten (aanwezigheid van ter plaatse ontdooid of opspattend of aflopend dooizouthoudend water).',
objectUri='https://wegenenverkeer.data.vlaanderen.be/id/concept/KlBetonomgevingsklasse/e-e-4'),
'e-s-1': KeuzelijstWaarde(invulwaarde='e-s-1',
label='ES1',
definitie='Zeeomgeving : geen contact met zeewater, wel contact met zeelucht (tot 3 km van de kust) en/of brak water, en geen contact met vorst.',
objectUri='https://wegenenverkeer.data.vlaanderen.be/id/concept/KlBetonomgevingsklasse/e-s-1'),
'e-s-2': KeuzelijstWaarde(invulwaarde='e-s-2',
label='ES2',
definitie='Zeeomgeving : geen contact met zeewater, wel contact met zeelucht (tot 3 km van de kust) en/of brak water, en wel contact met vorst.',
objectUri='https://wegenenverkeer.data.vlaanderen.be/id/concept/KlBetonomgevingsklasse/e-s-2'),
'e-s-3': KeuzelijstWaarde(invulwaarde='e-s-3',
label='ES3',
definitie='Zeeomgeving : contact met zeewater en ondergedompeld.',
objectUri='https://wegenenverkeer.data.vlaanderen.be/id/concept/KlBetonomgevingsklasse/e-s-3'),
'e-s-4': KeuzelijstWaarde(invulwaarde='e-s-4',
label='ES4',
definitie='Zeeomgeving : contact met zeewater en getijden- en spatzone.',
objectUri='https://wegenenverkeer.data.vlaanderen.be/id/concept/KlBetonomgevingsklasse/e-s-4'),
'ei': KeuzelijstWaarde(invulwaarde='ei',
label='EI',
definitie='Binnenomgeving.',
objectUri='https://wegenenverkeer.data.vlaanderen.be/id/concept/KlBetonomgevingsklasse/ei')
}
| 75.347826 | 180 | 0.565301 | 488 | 5,199 | 6.022541 | 0.227459 | 0.096972 | 0.117387 | 0.168425 | 0.568901 | 0.568901 | 0.482137 | 0.482137 | 0.482137 | 0.456618 | 0 | 0.02221 | 0.324485 | 5,199 | 68 | 181 | 76.455882 | 0.814636 | 0.026159 | 0 | 0 | 1 | 0.209677 | 0.464293 | 0.004352 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.032258 | 0 | 0.145161 | 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 | 1 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
96022dd76b490fec46cac25f47ad44c4de618cc9 | 134 | py | Python | weather/urls.py | karanverma7/MySite_Django | fbb2e3e9374fee5d24f83c52f2320d5c1067a08c | [
"MIT"
] | null | null | null | weather/urls.py | karanverma7/MySite_Django | fbb2e3e9374fee5d24f83c52f2320d5c1067a08c | [
"MIT"
] | null | null | null | weather/urls.py | karanverma7/MySite_Django | fbb2e3e9374fee5d24f83c52f2320d5c1067a08c | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
app_name = 'weather'
urlpatterns = [
path('', views.Index, name='index')
] | 19.142857 | 40 | 0.656716 | 17 | 134 | 5.117647 | 0.647059 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.208955 | 134 | 7 | 41 | 19.142857 | 0.820755 | 0 | 0 | 0 | 0 | 0 | 0.093023 | 0 | 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 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
9605ece57ff1b883400f295ce7b194179d9188d4 | 366 | py | Python | portfolio/views.py | jhonattanrgc21/web-personal | 142b931c6e49d41f99b026a2acede67143bb1ab1 | [
"MIT"
] | null | null | null | portfolio/views.py | jhonattanrgc21/web-personal | 142b931c6e49d41f99b026a2acede67143bb1ab1 | [
"MIT"
] | null | null | null | portfolio/views.py | jhonattanrgc21/web-personal | 142b931c6e49d41f99b026a2acede67143bb1ab1 | [
"MIT"
] | null | null | null | # Vistas de la app Portfolio
from django.shortcuts import render
from .models import Project
def portfolio(request):
''' Obtiene una lista con todos los proyectos
registrados en la BD y los renderiza a la
vista portfolio.html '''
projects = Project.objects.all()
return render(request, 'portfolio/portfolio.html', {'projects': projects}) | 36.6 | 78 | 0.718579 | 48 | 366 | 5.479167 | 0.6875 | 0.098859 | 0.159696 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.196721 | 366 | 10 | 78 | 36.6 | 0.894558 | 0.363388 | 0 | 0 | 0 | 0 | 0.151659 | 0.113744 | 0 | 0 | 0 | 0.1 | 0 | 1 | 0.2 | false | 0 | 0.4 | 0 | 0.8 | 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 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
9606e59348ea930d3866b0a7fe62fcf6488819c0 | 302 | py | Python | skeleton/skeleton/context_processors.py | CulturePlex/skeleton | d7219a7896117d3a45a29d900d553ec03024705d | [
"MIT"
] | null | null | null | skeleton/skeleton/context_processors.py | CulturePlex/skeleton | d7219a7896117d3a45a29d900d553ec03024705d | [
"MIT"
] | null | null | null | skeleton/skeleton/context_processors.py | CulturePlex/skeleton | d7219a7896117d3a45a29d900d553ec03024705d | [
"MIT"
] | null | null | null | from django.conf import settings
def project_name(request):
return {'PROJECT_NAME': getattr(settings, 'PROJECT_NAME', None)}
def footer_info(request):
return {'FOOTER_INFO': getattr(settings, 'FOOTER_INFO', None)}
def theme(request):
return {'THEME': getattr(settings, 'THEME', None)} | 23.230769 | 68 | 0.718543 | 38 | 302 | 5.552632 | 0.394737 | 0.156398 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.139073 | 302 | 13 | 69 | 23.230769 | 0.811538 | 0 | 0 | 0 | 0 | 0 | 0.184818 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.428571 | false | 0 | 0.142857 | 0.428571 | 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 | 0 | 1 | 1 | 0 | 0 | 3 |
96225264155c53d1e90fc72a2aee9f6ae32bfba7 | 1,925 | py | Python | src/uvm/comps/uvm_scoreboard.py | rodrigomelo9/uvm-python | e3127eba2cc1519a61dc6f736d862a8dcd6fce20 | [
"Apache-2.0"
] | 140 | 2020-01-18T00:14:17.000Z | 2022-03-29T10:57:24.000Z | src/uvm/comps/uvm_scoreboard.py | Mohsannaeem/uvm-python | 1b8768a1358d133465ede9cadddae651664b1d53 | [
"Apache-2.0"
] | 24 | 2020-01-18T18:40:58.000Z | 2021-03-25T17:39:07.000Z | src/uvm/comps/uvm_scoreboard.py | Mohsannaeem/uvm-python | 1b8768a1358d133465ede9cadddae651664b1d53 | [
"Apache-2.0"
] | 34 | 2020-01-18T12:22:59.000Z | 2022-02-11T07:03:11.000Z | #//
#//-----------------------------------------------------------------------------
#// Copyright 2007-2011 Mentor Graphics Corporation
#// Copyright 2007-2010 Cadence Design Systems, Inc.
#// Copyright 2010 Synopsys, Inc.
#// Copyright 2019 Tuomas Poikela
#// All Rights Reserved Worldwide
#//
#// Licensed under the Apache License, Version 2.0 (the
#// "License"); you may not use this file except in
#// compliance with the License. You may obtain a copy of
#// the License at
#//
#// http://www.apache.org/licenses/LICENSE-2.0
#//
#// Unless required by applicable law or agreed to in
#// writing, software distributed under the License is
#// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
#// CONDITIONS OF ANY KIND, either express or implied. See
#// the License for the specific language governing
#// permissions and limitations under the License.
#//-----------------------------------------------------------------------------
from ..base.uvm_component import UVMComponent
class UVMScoreboard(UVMComponent):
"""
The `UVMScoreboard` class should be used as the base class for
user-defined scoreboards.
Deriving from `UVMScoreboard` will allow you to distinguish scoreboards from
other component types inheriting directly from `UVMComponent`. Such
scoreboards will automatically inherit and benefit from features that may be
added to `UVMScoreboard` in the future.
"""
# // Function: new
# //
# // Creates and initializes an instance of this class using the normal
# // constructor arguments for `UVMComponent`: ~name~ is the name of the
# // instance, and ~parent~ is the handle to the hierarchical parent, if any.
def __init__(self, name, parent):
UVMComponent.__init__(self, name, parent)
type_name = "uvm_scoreboard"
def get_type_name(self):
return UVMScoreboard.type_name
| 38.5 | 82 | 0.644156 | 227 | 1,925 | 5.400881 | 0.568282 | 0.04894 | 0.021207 | 0.026101 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.017983 | 0.191169 | 1,925 | 49 | 83 | 39.285714 | 0.769428 | 0.797403 | 0 | 0 | 0 | 0 | 0.042683 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0.142857 | 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 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
824903884f76739360a9eb051ac2308c342d3aee | 1,165 | py | Python | maxcube/deadline.py | mweinelt/python-maxcube-api | 8eebfd4e944b22c738d509b8ef4d7f35a4a48870 | [
"MIT"
] | 9 | 2018-09-09T08:54:37.000Z | 2021-02-25T22:46:47.000Z | maxcube/deadline.py | mweinelt/python-maxcube-api | 8eebfd4e944b22c738d509b8ef4d7f35a4a48870 | [
"MIT"
] | 13 | 2016-03-26T18:40:01.000Z | 2018-04-29T07:01:26.000Z | maxcube/deadline.py | mweinelt/python-maxcube-api | 8eebfd4e944b22c738d509b8ef4d7f35a4a48870 | [
"MIT"
] | 14 | 2016-03-26T18:11:03.000Z | 2018-04-29T05:41:36.000Z | from dataclasses import dataclass
from math import inf
from time import time
@dataclass(frozen=True)
class Timeout:
name: str
duration: float
class Deadline:
def __init__(self, timeout: Timeout, *, parent=None):
if parent is None:
self.__deadline = time() + timeout.duration
else:
self.__deadline = min(time() + timeout.duration, parent.__deadline)
self.__timeout = timeout
self.__parent = parent
def name(self) -> str:
return f"{self.__timeout.name}[{self.remaining():.3g}/{self.__timeout.duration:.3g}]"
def fullname(self) -> str:
if self.__parent is None:
return self.name()
return self.__parent.fullname() + ":" + self.name()
def remaining(self, *, lower_bound: float = 0, upper_bound: float = inf) -> float:
return min(max(lower_bound, self.__deadline - time()), upper_bound)
def is_expired(self) -> bool:
return self.remaining() <= 0
def subtimeout(self, timeout: Timeout) -> "Deadline":
return Deadline(timeout, parent=self)
def __str__(self) -> str:
return "Deadline " + self.fullname()
| 29.125 | 93 | 0.630043 | 138 | 1,165 | 5.07971 | 0.275362 | 0.078459 | 0.077033 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004551 | 0.245494 | 1,165 | 39 | 94 | 29.871795 | 0.792947 | 0 | 0 | 0 | 0 | 0.034483 | 0.079828 | 0.064378 | 0 | 0 | 0 | 0 | 0 | 1 | 0.241379 | false | 0 | 0.103448 | 0.172414 | 0.724138 | 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 | 0 | 1 | 1 | 0 | 0 | 3 |
82572c94b51f12381696c0ef39b89def09f7a1c7 | 18 | py | Python | pymodori/__init__.py | bfmcneill/pymodori | cc59b8330f5708e6944a2fca9d56992e23ae8a94 | [
"MIT"
] | null | null | null | pymodori/__init__.py | bfmcneill/pymodori | cc59b8330f5708e6944a2fca9d56992e23ae8a94 | [
"MIT"
] | null | null | null | pymodori/__init__.py | bfmcneill/pymodori | cc59b8330f5708e6944a2fca9d56992e23ae8a94 | [
"MIT"
] | null | null | null | name = "pymodori"
| 9 | 17 | 0.666667 | 2 | 18 | 6 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 18 | 1 | 18 | 18 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0.444444 | 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 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
82612632a396e030fca0f4f338c849cb673cffd1 | 2,020 | py | Python | tests/unit/row/test_rowwrapper.py | brunns/brunns-row | 1d966257548e5c6242dfe8d2177838b1b94feb04 | [
"MIT"
] | 1 | 2019-03-15T12:51:28.000Z | 2019-03-15T12:51:28.000Z | tests/unit/row/test_rowwrapper.py | brunns/brunns-row | 1d966257548e5c6242dfe8d2177838b1b94feb04 | [
"MIT"
] | 4 | 2019-02-20T21:10:06.000Z | 2021-06-25T15:37:12.000Z | tests/unit/row/test_rowwrapper.py | brunns/brunns-row | 1d966257548e5c6242dfe8d2177838b1b94feb04 | [
"MIT"
] | null | null | null | # encoding=utf-8
import logging
from hamcrest import assert_that, has_properties
from brunns.row.rowwrapper import RowWrapper
logger = logging.getLogger(__name__)
def test_identifiers_fixed_for_mapping_row():
# Given
wrapper = RowWrapper(["column-name", "Another One", "3rd Column"])
# When
row = wrapper(
{"column-name": "value", "Another One": "another-value", "3rd Column": "3rd value"}
)
# Then
assert_that(
row,
has_properties(column_name="value", Another_One="another-value", a_3rd_Column="3rd value"),
)
def test_identifiers_fixed_for_positional_row():
# Given
wrapper = RowWrapper(["column-name", "Another One", "3rd Column"])
# When
row = wrapper(["value", "another", "yet another"])
# Then
assert_that(
row, has_properties(column_name="value", Another_One="another", a_3rd_Column="yet another")
)
def test_column_identifiers_deduplication_for_mapping_row():
# Given
wrapper = RowWrapper(["column-name", "column$name"])
# When
row = wrapper({"column-name": "value", "column$name": "another-value"})
# Then
assert_that(row, has_properties(column_name="value", column_name_2="another-value"))
def test_column_identifiers_deduplication_for_positional_row():
# Given
wrapper = RowWrapper(["column-name", "column-name", "column$name"])
# When
row = wrapper(["value", "another", "yet another"])
# Then
assert_that(
row,
has_properties(column_name="value", column_name_2="another", column_name_3="yet another"),
)
def test_lower_cased_identifiers():
# Given
wrapper = RowWrapper(["column-name", "Another One", "3rd Column"], force_lower_case_ids=True)
# When
row = wrapper(
{"column-name": "value", "Another One": "another-value", "3rd Column": "3rd value"}
)
# Then
assert_that(
row,
has_properties(column_name="value", another_one="another-value", a_3rd_column="3rd value"),
)
| 25.56962 | 99 | 0.659406 | 242 | 2,020 | 5.239669 | 0.181818 | 0.157729 | 0.094637 | 0.11041 | 0.816246 | 0.772082 | 0.701893 | 0.682965 | 0.57571 | 0.535489 | 0 | 0.009883 | 0.198515 | 2,020 | 78 | 100 | 25.897436 | 0.773317 | 0.046535 | 0 | 0.384615 | 0 | 0 | 0.247774 | 0 | 0 | 0 | 0 | 0 | 0.153846 | 1 | 0.128205 | false | 0 | 0.076923 | 0 | 0.205128 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
82676842929da1227d2c6bcc9921673c7b9a951e | 336 | py | Python | src/resources/__init__.py | fibasile/ticket-gateway | 811a216281a17150adca3edf691f9cf5a1478d2f | [
"MIT"
] | null | null | null | src/resources/__init__.py | fibasile/ticket-gateway | 811a216281a17150adca3edf691f9cf5a1478d2f | [
"MIT"
] | null | null | null | src/resources/__init__.py | fibasile/ticket-gateway | 811a216281a17150adca3edf691f9cf5a1478d2f | [
"MIT"
] | null | null | null | # from .user import UserResource
from .channel import ChannelResource
from .tracker import TrackerResource
from .ticket import TicketResource
from .tickets import TicketsResource
from .members import MembersResource
from .discussion import DiscussionsResource
from .authorize import AuthorizeResource
from .client import ClientResource
| 33.6 | 43 | 0.860119 | 36 | 336 | 8.027778 | 0.555556 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.110119 | 336 | 9 | 44 | 37.333333 | 0.966555 | 0.089286 | 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 | 0 | 0 | 0 | 3 |
827125d2182c21299db60d9c6a60db4c6c74f70b | 195 | py | Python | sigda/user/forms.py | yangluoshen/sigda | 83a2149d07edfbe56be95d5dc2a316c044bee54e | [
"BSD-2-Clause"
] | null | null | null | sigda/user/forms.py | yangluoshen/sigda | 83a2149d07edfbe56be95d5dc2a316c044bee54e | [
"BSD-2-Clause"
] | 3 | 2017-08-21T07:26:11.000Z | 2017-11-09T02:19:23.000Z | sigda/user/forms.py | yangluoshen/sigda | 83a2149d07edfbe56be95d5dc2a316c044bee54e | [
"BSD-2-Clause"
] | null | null | null | #coding:utf-8
from wtforms import (Form, StringField, DateTimeField)
class UserForm(Form):
name = StringField('name')
passwd = StringField('passwd')
email = StringField('email')
| 16.25 | 54 | 0.692308 | 21 | 195 | 6.428571 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.00625 | 0.179487 | 195 | 11 | 55 | 17.727273 | 0.8375 | 0.061538 | 0 | 0 | 0 | 0 | 0.083333 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.2 | 0.2 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
827df6c5960b5e04cacac94852e43b8851862693 | 207 | py | Python | bardhub/playlist/serializers.py | migdotcom/music-library | 4648ea02e4b071c4a287eba09202045963992873 | [
"MIT"
] | null | null | null | bardhub/playlist/serializers.py | migdotcom/music-library | 4648ea02e4b071c4a287eba09202045963992873 | [
"MIT"
] | null | null | null | bardhub/playlist/serializers.py | migdotcom/music-library | 4648ea02e4b071c4a287eba09202045963992873 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from .models import Playlist
# Serializer
class PlaylistSerializer(serializers.ModelSerializer):
class Meta:
model = Playlist
fields = '__all__'
| 18.818182 | 54 | 0.73913 | 20 | 207 | 7.4 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.207729 | 207 | 10 | 55 | 20.7 | 0.902439 | 0.048309 | 0 | 0 | 0 | 0 | 0.035897 | 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 | 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 | 3 |
8291f77bc45f172ff513d83dc24d1b9a81d4a2c3 | 775 | py | Python | src/models/storage/frame.py | SND96/Eva | d58084bf6431dff99416d3cae5a564a747496a75 | [
"Apache-2.0"
] | null | null | null | src/models/storage/frame.py | SND96/Eva | d58084bf6431dff99416d3cae5a564a747496a75 | [
"Apache-2.0"
] | null | null | null | src/models/storage/frame.py | SND96/Eva | d58084bf6431dff99416d3cae5a564a747496a75 | [
"Apache-2.0"
] | 1 | 2020-02-19T02:11:39.000Z | 2020-02-19T02:11:39.000Z | import numpy as np
class Frame:
"""
Data model used for storing video frame related information
Arguments:
index (int): The index of the frame in video
data (numpy.ndarray): Frame object from video
info (FrameInfo): Contains properties of the frame
"""
def __init__(self, index, data, info):
self._data = data
self._index = index
self._info = info
@property
def data(self):
return self._data
@property
def index(self):
return self._index
@property
def info(self):
return self._info
def __eq__(self, other):
return self.index == other.index and \
np.array_equal(self.data, other.data) and \
self.info == other.info
| 21.527778 | 63 | 0.59871 | 97 | 775 | 4.628866 | 0.381443 | 0.080178 | 0.093541 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.317419 | 775 | 35 | 64 | 22.142857 | 0.848771 | 0.290323 | 0 | 0.157895 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.263158 | false | 0 | 0.052632 | 0.210526 | 0.578947 | 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 | 0 | 1 | 1 | 0 | 0 | 3 |
82b2cee878c37e44f9be9f636e46462f668bd016 | 6,231 | py | Python | tests/query/stateless/test_yield.py | panda-sheep/nebula-graph | 27f832a16413d6dab06ca2bf9e931547306c3819 | [
"Apache-2.0"
] | 1 | 2021-08-23T05:55:55.000Z | 2021-08-23T05:55:55.000Z | tests/query/stateless/test_yield.py | panda-sheep/nebula-graph | 27f832a16413d6dab06ca2bf9e931547306c3819 | [
"Apache-2.0"
] | null | null | null | tests/query/stateless/test_yield.py | panda-sheep/nebula-graph | 27f832a16413d6dab06ca2bf9e931547306c3819 | [
"Apache-2.0"
] | null | null | null | # --coding:utf-8--
#
# Copyright (c) 2020 vesoft inc. All rights reserved.
#
# This source code is licensed under Apache 2.0 License,
# attached with Common Clause Condition 1.0, found in the LICENSES directory.
import time
from tests.common.nebula_test_suite import NebulaTestSuite
class TestYield(NebulaTestSuite):
@classmethod
def prepare(self):
resp = self.execute(
'CREATE SPACE IF NOT EXISTS test(partition_num={partition_num}, replica_factor={replica_factor})'
.format(partition_num=self.partition_num,
replica_factor=self.replica_factor))
self.check_resp_succeeded(resp)
time.sleep(self.graph_delay)
resp = self.execute('USE test')
self.check_resp_succeeded(resp)
@classmethod
def cleanup(self):
resp = self.execute('drop space test')
self.check_resp_succeeded(resp)
def test_yield(self):
# test addition
cmd = "yield 2+2"
resp = self.execute_query(cmd)
self.check_resp_succeeded(resp)
expect_result = [[4]]
self.check_result(resp.rows, expect_result)
# test sub
cmd = "yield 2-2"
resp = self.execute_query(cmd)
self.check_resp_succeeded(resp)
expect_result = [[0]]
self.check_result(resp.rows, expect_result)
#test Unary delimiter
cmd = "yield -3 as a"
resp = self.execute_query(cmd)
self.check_resp_succeeded(resp)
expect_result = [[-3]]
self.check_result(resp.rows, expect_result)
#test Multiplication
cmd = "yield 2*2"
resp = self.execute_query(cmd)
self.check_resp_succeeded(resp)
expect_result = [[4]]
self.check_result(resp.rows, expect_result)
# test Division
cmd = "yield 2/2"
resp = self.execute_query(cmd)
self.check_resp_succeeded(resp)
expect_result = [[1]]
self.check_result(resp.rows, expect_result)
# test Modulo division
cmd = "yield 3%2"
resp = self.execute_query(cmd)
self.check_resp_succeeded(resp)
expect_result = [[1]]
self.check_result(resp.rows, expect_result)
# test Power
cmd = "yield pow(3,4)"
resp = self.execute_query(cmd)
self.check_resp_succeeded(resp)
expect_result = [[81]]
self.check_result(resp.rows, expect_result)
# test abs
cmd = "yield abs(-9)"
resp = self.execute_query(cmd)
self.check_resp_succeeded(resp)
expect_result = [[9]]
self.check_result(resp.rows, expect_result)
#test ceil
cmd = "yield ceil(0.9)"
resp = self.execute_query(cmd)
self.check_resp_succeeded(resp)
expect_result = [[1.0000]]
self.check_result(resp.rows, expect_result)
# test floor
cmd = "yield floor(0.9)"
resp = self.execute_query(cmd)
self.check_resp_succeeded(resp)
expect_result = [[0.0]]
self.check_result(resp.rows, expect_result)
#test rand
cmd = "yield rand32()"
resp = self.execute(cmd)
self.check_resp_succeeded(resp)
cmd = "yield rand32(1000)"
resp = self.execute(cmd)
self.check_resp_succeeded(resp)
cmd = "yield rand32(1000,2000)"
resp = self.execute(cmd)
self.check_resp_succeeded(resp)
cmd = "yield rand64()"
resp = self.execute(cmd)
self.check_resp_succeeded(resp)
cmd = "yield rand64(1000)"
resp = self.execute(cmd)
self.check_resp_succeeded(resp)
cmd = "yield rand64(1000,200000)"
resp = self.execute(cmd)
self.check_resp_succeeded(resp)
# test exp
cmd = "yield exp(2)"
resp = self.execute(cmd)
self.check_resp_succeeded(resp)
#test round
cmd = "yield round(0.9)"
resp = self.execute_query(cmd)
self.check_resp_succeeded(resp)
expect_result = [[1.0000]]
self.check_result(resp.rows, expect_result)
# test floor
cmd = "yield floor(0.9)"
resp = self.execute_query(cmd)
self.check_resp_succeeded(resp)
expect_result = [[0.0]]
self.check_result(resp.rows, expect_result)
# test log
cmd = "yield log(0.9)"
resp = self.execute(cmd)
self.check_resp_succeeded(resp)
# test log10
cmd = "yield log10(27)"
resp = self.execute(cmd)
self.check_resp_succeeded(resp)
# test sqrt
cmd = "yield sqrt(256)"
resp = self.execute(cmd)
self.check_resp_succeeded(resp)
# test cos
cmd = "yield cos(0.9)"
resp = self.execute(cmd)
self.check_resp_succeeded(resp)
# test substr
cmd = "yield substr('hello',1,3)"
resp = self.execute_query(cmd)
self.check_resp_succeeded(resp)
expect_result = [["hel"]]
self.check_result(resp.rows, expect_result)
#test lower
cmd = "yield lower('HellO')"
resp = self.execute_query(cmd)
self.check_resp_succeeded(resp)
expect_result = [["hello"]]
self.check_result(resp.rows, expect_result)
# test strcat
cmd = "yield 'a'+'b'"
resp = self.execute_query(cmd)
self.check_resp_succeeded(resp)
expect_result = [["ab"]]
self.check_result(resp.rows, expect_result)
# test strlength
cmd = "yield length('Hullo')"
resp = self.execute_query(cmd)
self.check_resp_succeeded(resp)
expect_result = [[5]]
self.check_result(resp.rows, expect_result)
# test strhash
cmd = "yield hash('hello')"
resp = self.execute(cmd)
self.check_resp_succeeded(resp)
# test strcasecmp
cmd = 'yield strcasecmp("hello", "world")'
resp = self.execute(cmd)
self.check_resp_succeeded(resp)
# test strlpad
cmd = 'yield lpad("Hello", 8, "1")'
resp = self.execute(cmd)
self.check_resp_succeeded(resp)
cmd = 'yield (timestamp)(now())'
resp = self.execute_query(cmd)
self.check_resp_succeeded(resp)
| 33.320856 | 109 | 0.599262 | 766 | 6,231 | 4.685379 | 0.16188 | 0.125383 | 0.142101 | 0.208415 | 0.720535 | 0.713291 | 0.696573 | 0.696573 | 0.620507 | 0.609641 | 0 | 0.025119 | 0.290804 | 6,231 | 186 | 110 | 33.5 | 0.787056 | 0.081046 | 0 | 0.65035 | 0 | 0 | 0.112575 | 0.011767 | 0.006993 | 0 | 0 | 0 | 0 | 1 | 0.020979 | false | 0 | 0.013986 | 0 | 0.041958 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
82d77402fbe23fae9ec43685bfdaf1836f78360a | 2,656 | py | Python | scrapy/contrib/spiderqueue.py | chongiadung/choinho | d2a216fe7a5064d73cdee3e928a7beef7f511fd1 | [
"MIT"
] | null | null | null | scrapy/contrib/spiderqueue.py | chongiadung/choinho | d2a216fe7a5064d73cdee3e928a7beef7f511fd1 | [
"MIT"
] | 10 | 2020-02-11T23:34:28.000Z | 2022-03-11T23:16:12.000Z | scrapy/contrib/spiderqueue.py | chongiadung/choinho | d2a216fe7a5064d73cdee3e928a7beef7f511fd1 | [
"MIT"
] | 3 | 2018-08-05T14:54:25.000Z | 2021-06-07T01:49:59.000Z | from zope.interface import implements
from twisted.internet import threads
from boto.sqs.connection import SQSConnection
from boto.sqs.message import Message
from boto.sqs import regions
from scrapy.interfaces import ISpiderQueue
from scrapy.utils.py26 import json
class SQSSpiderQueue(object):
implements(ISpiderQueue)
def __init__(self, *a, **kw):
self.queue_name = kw.pop('queue_name', 'scrapy')
self.region_name = kw.pop('region_name', 'us-east-1')
self.visibility_timeout = kw.pop('visibility_timeout', 7200)
self.aws_access_key_id = kw.pop('aws_access_key_id', None)
self.aws_secret_access_key = kw.pop('aws_secret_access_key', None)
self.region = self._get_region(self.region_name)
self.conn.create_queue(self.queue_name)
super(SQSSpiderQueue, self).__init__(*a, **kw)
@classmethod
def from_settings(cls, settings):
return cls(
queue_name=settings['SQS_QUEUE'],
region_name=settings['SQS_REGION'],
visibility_timeout=settings.getint('SQS_VISIBILITY_TIMEOUT'),
aws_access_key_id=settings['AWS_ACCESS_KEY_ID'],
aws_secret_access_key=settings['AWS_SECRET_ACCESS_KEY']
)
def _get_region(self, name):
return [r for r in regions() if r.name == name][0]
@property
def conn(self):
return SQSConnection(self.aws_access_key_id, self.aws_secret_access_key, \
region=self.region)
@property
def queue(self):
return self.conn.get_queue(self.queue_name)
def _queue_method(self, method, *a, **kw):
return getattr(self.queue, method)(*a, **kw)
def pop(self):
return threads.deferToThread(self._pop)
def _pop(self):
msgs = self.queue.get_messages(1, visibility_timeout=self.visibility_timeout)
if msgs:
msg = msgs[0]
msg.delete()
return json.loads(msg.get_body())
def add(self, name, **spider_args):
d = spider_args.copy()
d['name'] = name
msg = Message(body=json.dumps(d))
return threads.deferToThread(self._queue_method, 'write', msg)
def count(self):
return threads.deferToThread(self._queue_method, 'count')
def list(self):
return threads.deferToThread(self._list)
def _list(self):
msgs = []
m = self.queue.read(visibility_timeout=100)
while m:
msgs.append(json.loads(m.get_body()))
m = self.queue.read(visibility_timeout=100)
return msgs
def clear(self):
return threads.deferToThread(self._queue_method, 'clear')
| 32.390244 | 85 | 0.653238 | 342 | 2,656 | 4.833333 | 0.24269 | 0.054446 | 0.036298 | 0.042347 | 0.209921 | 0.120387 | 0.095584 | 0 | 0 | 0 | 0 | 0.00787 | 0.234563 | 2,656 | 81 | 86 | 32.790123 | 0.805214 | 0 | 0 | 0.0625 | 0 | 0 | 0.071536 | 0.024096 | 0 | 0 | 0 | 0 | 0 | 1 | 0.203125 | false | 0 | 0.109375 | 0.140625 | 0.515625 | 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 | 0 | 1 | 1 | 0 | 0 | 3 |
82dc566d2158599961a3d5ed354d32832b16eaaf | 3,228 | py | Python | etl/parsers/etw/Microsoft_Windows_RPC_Events.py | IMULMUL/etl-parser | 76b7c046866ce0469cd129ee3f7bb3799b34e271 | [
"Apache-2.0"
] | 104 | 2020-03-04T14:31:31.000Z | 2022-03-28T02:59:36.000Z | etl/parsers/etw/Microsoft_Windows_RPC_Events.py | IMULMUL/etl-parser | 76b7c046866ce0469cd129ee3f7bb3799b34e271 | [
"Apache-2.0"
] | 7 | 2020-04-20T09:18:39.000Z | 2022-03-19T17:06:19.000Z | etl/parsers/etw/Microsoft_Windows_RPC_Events.py | IMULMUL/etl-parser | 76b7c046866ce0469cd129ee3f7bb3799b34e271 | [
"Apache-2.0"
] | 16 | 2020-03-05T18:55:59.000Z | 2022-03-01T10:19:28.000Z | # -*- coding: utf-8 -*-
"""
Microsoft-Windows-RPC-Events
GUID : f4aed7c7-a898-4627-b053-44a7caa12fcd
"""
from construct import Int8sl, Int8ul, Int16ul, Int16sl, Int32sl, Int32ul, Int64sl, Int64ul, Bytes, Double, Float32l, Struct
from etl.utils import WString, CString, SystemTime, Guid
from etl.dtyp import Sid
from etl.parsers.etw.core import Etw, declare, guid
@declare(guid=guid("f4aed7c7-a898-4627-b053-44a7caa12fcd"), event_id=2, version=0)
class Microsoft_Windows_RPC_Events_2_0(Etw):
pattern = Struct(
"ApplicationName" / WString,
"ProcessId" / Int32ul,
"RPCProtocolSequence" / WString,
"InterfaceGUID" / Guid
)
@declare(guid=guid("f4aed7c7-a898-4627-b053-44a7caa12fcd"), event_id=3, version=0)
class Microsoft_Windows_RPC_Events_3_0(Etw):
pattern = Struct(
"ApplicationName" / WString,
"ProcessId" / Int32ul,
"RPCProtocolSequence" / WString,
"InterfaceGUID" / Guid
)
@declare(guid=guid("f4aed7c7-a898-4627-b053-44a7caa12fcd"), event_id=4, version=0)
class Microsoft_Windows_RPC_Events_4_0(Etw):
pattern = Struct(
"ApplicationName" / WString,
"ProcessId" / Int32ul
)
@declare(guid=guid("f4aed7c7-a898-4627-b053-44a7caa12fcd"), event_id=5, version=0)
class Microsoft_Windows_RPC_Events_5_0(Etw):
pattern = Struct(
"ApplicationName" / WString,
"ProcessId" / Int32ul,
"RPCProtocolSequence" / WString,
"InterfaceGUID" / Guid
)
@declare(guid=guid("f4aed7c7-a898-4627-b053-44a7caa12fcd"), event_id=6, version=0)
class Microsoft_Windows_RPC_Events_6_0(Etw):
pattern = Struct(
"ApplicationName" / WString,
"ProcessId" / Int32ul,
"RPCProtocolSequence" / WString
)
@declare(guid=guid("f4aed7c7-a898-4627-b053-44a7caa12fcd"), event_id=7, version=0)
class Microsoft_Windows_RPC_Events_7_0(Etw):
pattern = Struct(
"ApplicationName" / WString,
"ProcessId" / Int32ul,
"RPCProtocolSequence" / WString,
"InterfaceGUID" / Guid
)
@declare(guid=guid("f4aed7c7-a898-4627-b053-44a7caa12fcd"), event_id=8, version=0)
class Microsoft_Windows_RPC_Events_8_0(Etw):
pattern = Struct(
"ApplicationName" / WString,
"ProcessId" / Int32ul,
"RPCProtocolSequence" / WString,
"RPCEndpoint" / WString,
"InterfaceGUID" / Guid,
"RPCStatus" / Int32ul
)
@declare(guid=guid("f4aed7c7-a898-4627-b053-44a7caa12fcd"), event_id=9, version=0)
class Microsoft_Windows_RPC_Events_9_0(Etw):
pattern = Struct(
"ApplicationName" / WString,
"ProcessId" / WString
)
@declare(guid=guid("f4aed7c7-a898-4627-b053-44a7caa12fcd"), event_id=10, version=0)
class Microsoft_Windows_RPC_Events_10_0(Etw):
pattern = Struct(
"ApplicationName" / WString,
"ProcessId" / WString,
"ExpectedInterfaceID" / WString,
"ReceivedInterfaceID" / WString
)
@declare(guid=guid("f4aed7c7-a898-4627-b053-44a7caa12fcd"), event_id=11, version=0)
class Microsoft_Windows_RPC_Events_11_0(Etw):
pattern = Struct(
"ApplicationName" / WString,
"ProcessId" / WString,
"InterfaceId" / Guid,
"Method" / Int32sl
)
| 29.888889 | 123 | 0.67689 | 354 | 3,228 | 6.002825 | 0.180791 | 0.082824 | 0.098353 | 0.129412 | 0.822588 | 0.822588 | 0.805647 | 0.626824 | 0.529882 | 0.529882 | 0 | 0.107074 | 0.198575 | 3,228 | 107 | 124 | 30.168224 | 0.714341 | 0.02943 | 0 | 0.45679 | 0 | 0 | 0.273367 | 0.115237 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.049383 | 0 | 0.296296 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
7d542993d1a4ad76f2ea1470eebac508b651fc74 | 2,529 | py | Python | eccodes/high_level/codesfile.py | cchwala/eccodes-python | 3dd337a7e36a4fb2b7e3ab6eeb31c67aaf0b763b | [
"Apache-2.0"
] | null | null | null | eccodes/high_level/codesfile.py | cchwala/eccodes-python | 3dd337a7e36a4fb2b7e3ab6eeb31c67aaf0b763b | [
"Apache-2.0"
] | null | null | null | eccodes/high_level/codesfile.py | cchwala/eccodes-python | 3dd337a7e36a4fb2b7e3ab6eeb31c67aaf0b763b | [
"Apache-2.0"
] | null | null | null | """
Note: The high-level Python interface is currently experimental and may change in a future release.
``CodesFile`` class that implements a file that is readable by ecCodes and
closes itself and its messages when it is no longer needed.
Author: Daniel Lee, DWD, 2016
"""
from .. import eccodes
import io
class CodesFile(io.FileIO):
"""
An abstract class to specify and/or implement common behaviour that files
read by ecCodes should implement.
A {prod_type} file handle meant for use in a context manager.
Individual messages can be accessed using the ``next`` method. Of course,
it is also possible to iterate over each message in the file::
>>> with {classname}(filename) as {alias}:
... # Print number of messages in file
... len({alias})
... # Open all messages in file
... for msg in {alias}:
... print(msg[key_name])
... len({alias}.open_messages)
>>> # When the file is closed, any open messages are closed
>>> len({alias}.open_messages)
"""
#: Type of messages belonging to this file
MessageClass = None
def __init__(self, filename, mode="rb"):
"""Open file and receive codes file handle."""
#: File handle for working with actual file on disc
#: The class holds the file it works with because ecCodes'
# typechecking does not allow using inherited classes.
self.file_handle = open(filename, mode)
#: Number of message in file currently being read
self.message = 0
#: Open messages
self.open_messages = []
self.name = filename
def __exit__(self, exception_type, exception_value, traceback):
"""Close all open messages, release file handle and close file."""
while self.open_messages:
# Note: if the message was manually closed, this has no effect
self.open_messages.pop().close()
self.file_handle.close()
def __len__(self):
"""Return total number of messages in file."""
return eccodes.codes_count_in_file(self.file_handle)
def __enter__(self):
return self
def close(self):
"""Possibility to manually close file."""
self.__exit__(None, None, None)
def __iter__(self):
return self
def next(self):
try:
return self.MessageClass(self)
except IOError:
raise StopIteration()
def __next__(self):
return self.next()
| 31.6125 | 99 | 0.631079 | 324 | 2,529 | 4.79321 | 0.435185 | 0.061816 | 0.027044 | 0.023181 | 0.028332 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002747 | 0.280348 | 2,529 | 79 | 100 | 32.012658 | 0.850549 | 0.572163 | 0 | 0.071429 | 0 | 0 | 0.002039 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0.071429 | 0.107143 | 0.607143 | 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 | 0 | 1 | 1 | 0 | 0 | 3 |
7d587f734d3d896704a84f9c66098dc58d1fcb06 | 213 | py | Python | EventFilter/Configuration/python/DigiToRaw_EventContent_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | EventFilter/Configuration/python/DigiToRaw_EventContent_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | EventFilter/Configuration/python/DigiToRaw_EventContent_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
DigiToRawFEVT = cms.PSet(
outputCommands = cms.untracked.vstring('keep FEDRawDataCollection_source_*_*',
'keep FEDRawDataCollection_rawDataCollector_*_*')
)
| 26.625 | 83 | 0.769953 | 19 | 213 | 8.315789 | 0.789474 | 0.303797 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.13615 | 213 | 7 | 84 | 30.428571 | 0.858696 | 0 | 0 | 0 | 0 | 0 | 0.386792 | 0.339623 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.2 | 0 | 0.2 | 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 | 0 | 0 | 0 | 3 |
7d77e5b91a3c932e8120ebe7ba58c640a12db373 | 312 | py | Python | cloudify_graphql/loader/blueprint.py | jcollado/cloudify-graphql | 32ddfe7e108826aaebcd169e91ec993d35638cef | [
"MIT"
] | null | null | null | cloudify_graphql/loader/blueprint.py | jcollado/cloudify-graphql | 32ddfe7e108826aaebcd169e91ec993d35638cef | [
"MIT"
] | null | null | null | cloudify_graphql/loader/blueprint.py | jcollado/cloudify-graphql | 32ddfe7e108826aaebcd169e91ec993d35638cef | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Blueprint module."""
from cloudify_graphql.loader import Loader
class BlueprintLoader(Loader):
"""Blueprint loader."""
ENDPOINT = 'blueprints'
@property
def model_cls(self):
from cloudify_graphql.model.blueprint import Blueprint
return Blueprint
| 17.333333 | 62 | 0.673077 | 32 | 312 | 6.46875 | 0.625 | 0.115942 | 0.183575 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004065 | 0.211538 | 312 | 17 | 63 | 18.352941 | 0.837398 | 0.185897 | 0 | 0 | 0 | 0 | 0.041152 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.285714 | 0 | 0.857143 | 0.571429 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 3 |
7dabc0f317d500d3b96d732ed90ed89ec67049d6 | 1,188 | py | Python | backend/app/tests/conftest.py | rickh94/smlib | ff75a9523fb1113d934f6ff8c994b1427ca0d764 | [
"MIT"
] | null | null | null | backend/app/tests/conftest.py | rickh94/smlib | ff75a9523fb1113d934f6ff8c994b1427ca0d764 | [
"MIT"
] | 3 | 2021-06-16T19:52:53.000Z | 2022-01-13T02:39:27.000Z | backend/app/tests/conftest.py | rickh94/smlib | ff75a9523fb1113d934f6ff8c994b1427ca0d764 | [
"MIT"
] | null | null | null | import os
import uuid
from urllib.parse import quote_plus
import pymongo
import pytest
from motor import motor_asyncio
from starlette.testclient import TestClient
from app.main import app
@pytest.fixture
def db_name():
return str(uuid.uuid4())
@pytest.fixture
def db(db_name):
db_uri = "mongodb://{username}:{password}@{host}:{port}".format(
username=quote_plus(os.getenv("DB_USERNAME", "root")),
password=quote_plus(os.getenv("DB_PASSWORD", "root")),
host=quote_plus(os.getenv("DB_HOST", "localhost")),
port=quote_plus(os.getenv("DB_PORT", "27017")),
)
db_client = pymongo.MongoClient(db_uri)
return db_client[db_name]
@pytest.fixture
def async_db(db_name):
db_uri = "mongodb://{username}:{password}@{host}:{port}".format(
username=quote_plus(os.getenv("DB_USERNAME", "root")),
password=quote_plus(os.getenv("DB_PASSWORD", "root")),
host=quote_plus(os.getenv("DB_HOST", "localhost")),
port=quote_plus(os.getenv("DB_PORT", "27017")),
)
db_client = motor_asyncio.AsyncIOMotorClient(db_uri)
return db_client[db_name]
@pytest.fixture
def test_client():
return TestClient(app)
| 25.826087 | 68 | 0.691077 | 162 | 1,188 | 4.858025 | 0.240741 | 0.102922 | 0.111817 | 0.172808 | 0.622618 | 0.622618 | 0.622618 | 0.622618 | 0.622618 | 0.622618 | 0 | 0.011011 | 0.159091 | 1,188 | 45 | 69 | 26.4 | 0.776777 | 0 | 0 | 0.470588 | 0 | 0 | 0.173401 | 0.075758 | 0 | 0 | 0 | 0 | 0 | 1 | 0.117647 | false | 0.117647 | 0.235294 | 0.058824 | 0.470588 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
7db1a232096726c6c7372c9b8353d8f9771077d3 | 263 | py | Python | pkgs/sdk-pkg/src/genie/libs/sdk/apis/nxos/__init__.py | jbronikowski/genielibs | 200a34e5fe4838a27b5a80d5973651b2e34ccafb | [
"Apache-2.0"
] | 94 | 2018-04-30T20:29:15.000Z | 2022-03-29T13:40:31.000Z | pkgs/sdk-pkg/src/genie/libs/sdk/apis/nxos/__init__.py | jbronikowski/genielibs | 200a34e5fe4838a27b5a80d5973651b2e34ccafb | [
"Apache-2.0"
] | 67 | 2018-12-06T21:08:09.000Z | 2022-03-29T18:00:46.000Z | pkgs/sdk-pkg/src/genie/libs/sdk/apis/nxos/__init__.py | jbronikowski/genielibs | 200a34e5fe4838a27b5a80d5973651b2e34ccafb | [
"Apache-2.0"
] | 49 | 2018-06-29T18:59:03.000Z | 2022-03-10T02:07:59.000Z | # Enable abstraction using this directory name as the abstraction token
try:
from genie import abstract
abstract.declare_token(__name__)
except Exception as e:
import warnings
warnings.warn('Could not declare abstraction token: ' + str(e))
| 32.875 | 72 | 0.737643 | 34 | 263 | 5.558824 | 0.676471 | 0.169312 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.205323 | 263 | 7 | 73 | 37.571429 | 0.904306 | 0.262357 | 0 | 0 | 0 | 0 | 0.2 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.333333 | 0 | 0.333333 | 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 | 0 | 0 | 0 | 3 |
7dbb741815b105e7962a515c42d975f87632a899 | 2,785 | py | Python | Vol1B/PageRank/spec.py | joshualy/numerical_computing | 9f474e36fe85ae663bd20e2f2d06265d1f095173 | [
"CC-BY-3.0"
] | null | null | null | Vol1B/PageRank/spec.py | joshualy/numerical_computing | 9f474e36fe85ae663bd20e2f2d06265d1f095173 | [
"CC-BY-3.0"
] | null | null | null | Vol1B/PageRank/spec.py | joshualy/numerical_computing | 9f474e36fe85ae663bd20e2f2d06265d1f095173 | [
"CC-BY-3.0"
] | 1 | 2019-11-05T14:45:03.000Z | 2019-11-05T14:45:03.000Z | import numpy as np
import scipy.sparse as spar
import scipy.linalg as la
from scipy.sparse import linalg as sla
def to_matrix(filename,n):
'''
Return the nxn adjacency matrix described by datafile.
INPUTS:
datafile (.txt file): A .txt file describing a directed graph. Lines
describing edges should have the form '<from node>\t<to node>\n'.
The file may also include comments.
n (int): The number of nodes in the graph described by datafile
RETURN:
Return a SciPy sparse `dok_matrix'.
'''
pass
def calculateK(A,N):
'''
Compute the matrix K as described in the lab.
Input:
A (array): adjacency matrix of an array
N (int): the datasize of the array
Return:
K (array)
'''
pass
def iter_solve(adj, N=None, d=.85, tol=1E-5):
'''
Return the page ranks of the network described by `adj`.
Iterate through the PageRank algorithm until the error is less than `tol'.
Inputs:
adj - A NumPy array representing the adjacency matrix of a directed graph
N (int) - Restrict the computation to the first `N` nodes of the graph.
Defaults to N=None; in this case, the entire matrix is used.
d - The damping factor, a float between 0 and 1.
Defaults to .85.
tol - Stop iterating when the change in approximations to the solution is
less than `tol'. Defaults to 1E-5.
Returns:
The approximation to the steady state.
'''
pass
def eig_solve( adj, N=None, d=.85):
'''
Return the page ranks of the network described by `adj`. Use the
eigenvalue solver in \li{scipy.linalg} to calculate the steady state
of the PageRank algorithm
Inputs:
adj - A NumPy array representing the adjacency matrix of a directed graph
N - Restrict the computation to the first `N` nodes of the graph.
Defaults to N=None; in this case, the entire matrix is used.
d - The damping factor, a float between 0 and 1.
Defaults to .85.
Returns:
The approximation to the steady state.
'''
pass
def team_rank(filename='ncaa2013.csv'):
'''
Use your iterative PageRank solver to predict the rankings of the teams in
the given dataset of games.
The dataset should have two columns, representing winning and losing teams.
Each row represents a game, with the winner on the left, loser on the right.
Parse this data to create the adjacency matrix, and feed this into the
solver to predict the team ranks.
Inputs:
filename (optional) - The name of the dataset.
Returns:
ranks - A list of the ranks of the teams in order "best" to "worst"
teams - A list of the names of the teams, also in order "best" to "worst"
'''
pass
| 35.705128 | 80 | 0.665709 | 428 | 2,785 | 4.320093 | 0.343458 | 0.03245 | 0.022715 | 0.014062 | 0.359113 | 0.339643 | 0.322336 | 0.322336 | 0.322336 | 0.27258 | 0 | 0.009818 | 0.268582 | 2,785 | 77 | 81 | 36.168831 | 0.897889 | 0.793896 | 0 | 0.357143 | 0 | 0 | 0.033241 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.357143 | false | 0.357143 | 0.285714 | 0 | 0.642857 | 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 | 0 | 1 | 0 | 0 | 3 |
7dcc996677307733992143c5139b7ed06d683cd4 | 28,501 | py | Python | sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py | dubiety/azure-sdk-for-python | 62ffa839f5d753594cf0fe63668f454a9d87a346 | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py | ellhe-blaster/azure-sdk-for-python | 82193ba5e81cc5e5e5a5239bba58abe62e86f469 | [
"MIT"
] | null | null | null | sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py | ellhe-blaster/azure-sdk-for-python | 82193ba5e81cc5e5e5a5239bba58abe62e86f469 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from ._models_py3 import ARMProxyResource
from ._models_py3 import ARMResourceProperties
from ._models_py3 import AnalyticalStorageConfiguration
from ._models_py3 import ApiProperties
from ._models_py3 import AuthenticationMethodLdapProperties
from ._models_py3 import AutoUpgradePolicyResource
from ._models_py3 import AutoscaleSettings
from ._models_py3 import AutoscaleSettingsResource
from ._models_py3 import AzureBlobDataTransferDataSourceSink
from ._models_py3 import BackupInformation
from ._models_py3 import BackupPolicy
from ._models_py3 import BackupPolicyMigrationState
from ._models_py3 import BackupResource
from ._models_py3 import BackupResourceProperties
from ._models_py3 import Capability
from ._models_py3 import Capacity
from ._models_py3 import CassandraClusterPublicStatus
from ._models_py3 import CassandraClusterPublicStatusDataCentersItem
from ._models_py3 import CassandraKeyspaceCreateUpdateParameters
from ._models_py3 import CassandraKeyspaceGetPropertiesOptions
from ._models_py3 import CassandraKeyspaceGetPropertiesResource
from ._models_py3 import CassandraKeyspaceGetResults
from ._models_py3 import CassandraKeyspaceListResult
from ._models_py3 import CassandraKeyspaceResource
from ._models_py3 import CassandraPartitionKey
from ._models_py3 import CassandraSchema
from ._models_py3 import CassandraTableCreateUpdateParameters
from ._models_py3 import CassandraTableGetPropertiesOptions
from ._models_py3 import CassandraTableGetPropertiesResource
from ._models_py3 import CassandraTableGetResults
from ._models_py3 import CassandraTableListResult
from ._models_py3 import CassandraTableResource
from ._models_py3 import CassandraViewCreateUpdateParameters
from ._models_py3 import CassandraViewGetPropertiesOptions
from ._models_py3 import CassandraViewGetPropertiesResource
from ._models_py3 import CassandraViewGetResults
from ._models_py3 import CassandraViewListResult
from ._models_py3 import CassandraViewResource
from ._models_py3 import Certificate
from ._models_py3 import ClientEncryptionIncludedPath
from ._models_py3 import ClientEncryptionKeyCreateUpdateParameters
from ._models_py3 import ClientEncryptionKeyGetPropertiesResource
from ._models_py3 import ClientEncryptionKeyGetResults
from ._models_py3 import ClientEncryptionKeyResource
from ._models_py3 import ClientEncryptionKeysListResult
from ._models_py3 import ClientEncryptionPolicy
from ._models_py3 import ClusterKey
from ._models_py3 import ClusterResource
from ._models_py3 import ClusterResourceProperties
from ._models_py3 import Column
from ._models_py3 import CommandOutput
from ._models_py3 import CommandPostBody
from ._models_py3 import Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties
from ._models_py3 import ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacentersItemsPropertiesNodesItems
from ._models_py3 import CompositePath
from ._models_py3 import ConflictResolutionPolicy
from ._models_py3 import ConnectionError
from ._models_py3 import ConsistencyPolicy
from ._models_py3 import ContainerPartitionKey
from ._models_py3 import ContinuousBackupInformation
from ._models_py3 import ContinuousBackupRestoreLocation
from ._models_py3 import ContinuousModeBackupPolicy
from ._models_py3 import ContinuousModeProperties
from ._models_py3 import CorsPolicy
from ._models_py3 import CosmosCassandraDataTransferDataSourceSink
from ._models_py3 import CosmosSqlDataTransferDataSourceSink
from ._models_py3 import CreateJobRequest
from ._models_py3 import CreateUpdateOptions
from ._models_py3 import DataCenterResource
from ._models_py3 import DataCenterResourceProperties
from ._models_py3 import DataTransferDataSourceSink
from ._models_py3 import DataTransferJobFeedResults
from ._models_py3 import DataTransferJobGetResults
from ._models_py3 import DataTransferJobProperties
from ._models_py3 import DataTransferRegionalServiceResource
from ._models_py3 import DataTransferServiceResource
from ._models_py3 import DataTransferServiceResourceProperties
from ._models_py3 import DatabaseAccountConnectionString
from ._models_py3 import DatabaseAccountCreateUpdateParameters
from ._models_py3 import DatabaseAccountGetResults
from ._models_py3 import DatabaseAccountListConnectionStringsResult
from ._models_py3 import DatabaseAccountListKeysResult
from ._models_py3 import DatabaseAccountListReadOnlyKeysResult
from ._models_py3 import DatabaseAccountRegenerateKeyParameters
from ._models_py3 import DatabaseAccountUpdateParameters
from ._models_py3 import DatabaseAccountsListResult
from ._models_py3 import DatabaseRestoreResource
from ._models_py3 import DiagnosticLogSettings
from ._models_py3 import ErrorResponse
from ._models_py3 import ExcludedPath
from ._models_py3 import ExtendedResourceProperties
from ._models_py3 import FailoverPolicies
from ._models_py3 import FailoverPolicy
from ._models_py3 import GraphAPIComputeRegionalServiceResource
from ._models_py3 import GraphAPIComputeServiceResource
from ._models_py3 import GraphAPIComputeServiceResourceProperties
from ._models_py3 import GraphResource
from ._models_py3 import GraphResourceCreateUpdateParameters
from ._models_py3 import GraphResourceGetPropertiesOptions
from ._models_py3 import GraphResourceGetPropertiesResource
from ._models_py3 import GraphResourceGetResults
from ._models_py3 import GraphResourcesListResult
from ._models_py3 import GremlinDatabaseCreateUpdateParameters
from ._models_py3 import GremlinDatabaseGetPropertiesOptions
from ._models_py3 import GremlinDatabaseGetPropertiesResource
from ._models_py3 import GremlinDatabaseGetResults
from ._models_py3 import GremlinDatabaseListResult
from ._models_py3 import GremlinDatabaseResource
from ._models_py3 import GremlinDatabaseRestoreResource
from ._models_py3 import GremlinGraphCreateUpdateParameters
from ._models_py3 import GremlinGraphGetPropertiesOptions
from ._models_py3 import GremlinGraphGetPropertiesResource
from ._models_py3 import GremlinGraphGetResults
from ._models_py3 import GremlinGraphListResult
from ._models_py3 import GremlinGraphResource
from ._models_py3 import IncludedPath
from ._models_py3 import Indexes
from ._models_py3 import IndexingPolicy
from ._models_py3 import IpAddressOrRange
from ._models_py3 import KeyWrapMetadata
from ._models_py3 import ListBackups
from ._models_py3 import ListClusters
from ._models_py3 import ListDataCenters
from ._models_py3 import Location
from ._models_py3 import LocationGetResult
from ._models_py3 import LocationListResult
from ._models_py3 import LocationProperties
from ._models_py3 import ManagedCassandraARMResourceProperties
from ._models_py3 import ManagedCassandraManagedServiceIdentity
from ._models_py3 import ManagedCassandraReaperStatus
from ._models_py3 import ManagedServiceIdentity
from ._models_py3 import MaterializedViewsBuilderRegionalServiceResource
from ._models_py3 import MaterializedViewsBuilderServiceResource
from ._models_py3 import MaterializedViewsBuilderServiceResourceProperties
from ._models_py3 import MergeParameters
from ._models_py3 import Metric
from ._models_py3 import MetricAvailability
from ._models_py3 import MetricDefinition
from ._models_py3 import MetricDefinitionsListResult
from ._models_py3 import MetricListResult
from ._models_py3 import MetricName
from ._models_py3 import MetricValue
from ._models_py3 import MongoDBCollectionCreateUpdateParameters
from ._models_py3 import MongoDBCollectionGetPropertiesOptions
from ._models_py3 import MongoDBCollectionGetPropertiesResource
from ._models_py3 import MongoDBCollectionGetResults
from ._models_py3 import MongoDBCollectionListResult
from ._models_py3 import MongoDBCollectionResource
from ._models_py3 import MongoDBDatabaseCreateUpdateParameters
from ._models_py3 import MongoDBDatabaseGetPropertiesOptions
from ._models_py3 import MongoDBDatabaseGetPropertiesResource
from ._models_py3 import MongoDBDatabaseGetResults
from ._models_py3 import MongoDBDatabaseListResult
from ._models_py3 import MongoDBDatabaseResource
from ._models_py3 import MongoIndex
from ._models_py3 import MongoIndexKeys
from ._models_py3 import MongoIndexOptions
from ._models_py3 import MongoRoleDefinitionCreateUpdateParameters
from ._models_py3 import MongoRoleDefinitionGetResults
from ._models_py3 import MongoRoleDefinitionListResult
from ._models_py3 import MongoUserDefinitionCreateUpdateParameters
from ._models_py3 import MongoUserDefinitionGetResults
from ._models_py3 import MongoUserDefinitionListResult
from ._models_py3 import NotebookWorkspace
from ._models_py3 import NotebookWorkspaceConnectionInfoResult
from ._models_py3 import NotebookWorkspaceCreateUpdateParameters
from ._models_py3 import NotebookWorkspaceListResult
from ._models_py3 import Operation
from ._models_py3 import OperationDisplay
from ._models_py3 import OperationListResult
from ._models_py3 import OptionsResource
from ._models_py3 import PartitionMetric
from ._models_py3 import PartitionMetricListResult
from ._models_py3 import PartitionUsage
from ._models_py3 import PartitionUsagesResult
from ._models_py3 import PercentileMetric
from ._models_py3 import PercentileMetricListResult
from ._models_py3 import PercentileMetricValue
from ._models_py3 import PeriodicModeBackupPolicy
from ._models_py3 import PeriodicModeProperties
from ._models_py3 import Permission
from ._models_py3 import PhysicalPartitionId
from ._models_py3 import PhysicalPartitionStorageInfo
from ._models_py3 import PhysicalPartitionStorageInfoCollection
from ._models_py3 import PhysicalPartitionThroughputInfoProperties
from ._models_py3 import PhysicalPartitionThroughputInfoResource
from ._models_py3 import PhysicalPartitionThroughputInfoResult
from ._models_py3 import PhysicalPartitionThroughputInfoResultPropertiesResource
from ._models_py3 import PrivateEndpointConnection
from ._models_py3 import PrivateEndpointConnectionListResult
from ._models_py3 import PrivateEndpointProperty
from ._models_py3 import PrivateLinkResource
from ._models_py3 import PrivateLinkResourceListResult
from ._models_py3 import PrivateLinkServiceConnectionStateProperty
from ._models_py3 import Privilege
from ._models_py3 import PrivilegeResource
from ._models_py3 import ProxyResource
from ._models_py3 import RedistributeThroughputParameters
from ._models_py3 import RedistributeThroughputPropertiesResource
from ._models_py3 import RegionForOnlineOffline
from ._models_py3 import RegionalServiceResource
from ._models_py3 import Resource
from ._models_py3 import RestorableDatabaseAccountGetResult
from ._models_py3 import RestorableDatabaseAccountsListResult
from ._models_py3 import RestorableGremlinDatabaseGetResult
from ._models_py3 import RestorableGremlinDatabasePropertiesResource
from ._models_py3 import RestorableGremlinDatabasesListResult
from ._models_py3 import RestorableGremlinGraphGetResult
from ._models_py3 import RestorableGremlinGraphPropertiesResource
from ._models_py3 import RestorableGremlinGraphsListResult
from ._models_py3 import RestorableGremlinResourcesListResult
from ._models_py3 import RestorableLocationResource
from ._models_py3 import RestorableMongodbCollectionGetResult
from ._models_py3 import RestorableMongodbCollectionPropertiesResource
from ._models_py3 import RestorableMongodbCollectionsListResult
from ._models_py3 import RestorableMongodbDatabaseGetResult
from ._models_py3 import RestorableMongodbDatabasePropertiesResource
from ._models_py3 import RestorableMongodbDatabasesListResult
from ._models_py3 import RestorableMongodbResourcesListResult
from ._models_py3 import RestorableSqlContainerGetResult
from ._models_py3 import RestorableSqlContainerPropertiesResource
from ._models_py3 import RestorableSqlContainerPropertiesResourceContainer
from ._models_py3 import RestorableSqlContainersListResult
from ._models_py3 import RestorableSqlDatabaseGetResult
from ._models_py3 import RestorableSqlDatabasePropertiesResource
from ._models_py3 import RestorableSqlDatabasePropertiesResourceDatabase
from ._models_py3 import RestorableSqlDatabasesListResult
from ._models_py3 import RestorableSqlResourcesListResult
from ._models_py3 import RestorableTableGetResult
from ._models_py3 import RestorableTablePropertiesResource
from ._models_py3 import RestorableTableResourcesListResult
from ._models_py3 import RestorableTablesListResult
from ._models_py3 import RestoreParameters
from ._models_py3 import RetrieveThroughputParameters
from ._models_py3 import RetrieveThroughputPropertiesResource
from ._models_py3 import Role
from ._models_py3 import SeedNode
from ._models_py3 import ServiceResource
from ._models_py3 import ServiceResourceCreateUpdateParameters
from ._models_py3 import ServiceResourceListResult
from ._models_py3 import ServiceResourceProperties
from ._models_py3 import SpatialSpec
from ._models_py3 import SqlContainerCreateUpdateParameters
from ._models_py3 import SqlContainerGetPropertiesOptions
from ._models_py3 import SqlContainerGetPropertiesResource
from ._models_py3 import SqlContainerGetResults
from ._models_py3 import SqlContainerListResult
from ._models_py3 import SqlContainerResource
from ._models_py3 import SqlDatabaseCreateUpdateParameters
from ._models_py3 import SqlDatabaseGetPropertiesOptions
from ._models_py3 import SqlDatabaseGetPropertiesResource
from ._models_py3 import SqlDatabaseGetResults
from ._models_py3 import SqlDatabaseListResult
from ._models_py3 import SqlDatabaseResource
from ._models_py3 import SqlDedicatedGatewayRegionalServiceResource
from ._models_py3 import SqlDedicatedGatewayServiceResource
from ._models_py3 import SqlDedicatedGatewayServiceResourceProperties
from ._models_py3 import SqlRoleAssignmentCreateUpdateParameters
from ._models_py3 import SqlRoleAssignmentGetResults
from ._models_py3 import SqlRoleAssignmentListResult
from ._models_py3 import SqlRoleDefinitionCreateUpdateParameters
from ._models_py3 import SqlRoleDefinitionGetResults
from ._models_py3 import SqlRoleDefinitionListResult
from ._models_py3 import SqlStoredProcedureCreateUpdateParameters
from ._models_py3 import SqlStoredProcedureGetPropertiesResource
from ._models_py3 import SqlStoredProcedureGetResults
from ._models_py3 import SqlStoredProcedureListResult
from ._models_py3 import SqlStoredProcedureResource
from ._models_py3 import SqlTriggerCreateUpdateParameters
from ._models_py3 import SqlTriggerGetPropertiesResource
from ._models_py3 import SqlTriggerGetResults
from ._models_py3 import SqlTriggerListResult
from ._models_py3 import SqlTriggerResource
from ._models_py3 import SqlUserDefinedFunctionCreateUpdateParameters
from ._models_py3 import SqlUserDefinedFunctionGetPropertiesResource
from ._models_py3 import SqlUserDefinedFunctionGetResults
from ._models_py3 import SqlUserDefinedFunctionListResult
from ._models_py3 import SqlUserDefinedFunctionResource
from ._models_py3 import SystemData
from ._models_py3 import TableCreateUpdateParameters
from ._models_py3 import TableGetPropertiesOptions
from ._models_py3 import TableGetPropertiesResource
from ._models_py3 import TableGetResults
from ._models_py3 import TableListResult
from ._models_py3 import TableResource
from ._models_py3 import ThroughputPolicyResource
from ._models_py3 import ThroughputSettingsGetPropertiesResource
from ._models_py3 import ThroughputSettingsGetResults
from ._models_py3 import ThroughputSettingsResource
from ._models_py3 import ThroughputSettingsUpdateParameters
from ._models_py3 import UniqueKey
from ._models_py3 import UniqueKeyPolicy
from ._models_py3 import Usage
from ._models_py3 import UsagesResult
from ._models_py3 import VirtualNetworkRule
from ._cosmos_db_management_client_enums import (
AnalyticalStorageSchemaType,
ApiType,
AuthenticationMethod,
BackupPolicyMigrationStatus,
BackupPolicyType,
BackupStorageRedundancy,
CompositePathSortOrder,
ConflictResolutionMode,
ConnectionState,
ConnectorOffer,
ContinuousTier,
CreateMode,
CreatedByType,
DataTransferComponent,
DataType,
DatabaseAccountKind,
DefaultConsistencyLevel,
EnableFullTextQuery,
IndexKind,
IndexingMode,
KeyKind,
ManagedCassandraProvisioningState,
ManagedCassandraResourceIdentityType,
MongoRoleDefinitionType,
NetworkAclBypass,
NodeState,
NodeStatus,
NotebookWorkspaceName,
OperationType,
PartitionKind,
PrimaryAggregationType,
PublicNetworkAccess,
ResourceIdentityType,
RestoreMode,
RoleDefinitionType,
ServerVersion,
ServiceSize,
ServiceStatus,
ServiceType,
SpatialType,
ThroughputPolicyType,
TriggerOperation,
TriggerType,
UnitType,
)
__all__ = [
'ARMProxyResource',
'ARMResourceProperties',
'AnalyticalStorageConfiguration',
'ApiProperties',
'AuthenticationMethodLdapProperties',
'AutoUpgradePolicyResource',
'AutoscaleSettings',
'AutoscaleSettingsResource',
'AzureBlobDataTransferDataSourceSink',
'BackupInformation',
'BackupPolicy',
'BackupPolicyMigrationState',
'BackupResource',
'BackupResourceProperties',
'Capability',
'Capacity',
'CassandraClusterPublicStatus',
'CassandraClusterPublicStatusDataCentersItem',
'CassandraKeyspaceCreateUpdateParameters',
'CassandraKeyspaceGetPropertiesOptions',
'CassandraKeyspaceGetPropertiesResource',
'CassandraKeyspaceGetResults',
'CassandraKeyspaceListResult',
'CassandraKeyspaceResource',
'CassandraPartitionKey',
'CassandraSchema',
'CassandraTableCreateUpdateParameters',
'CassandraTableGetPropertiesOptions',
'CassandraTableGetPropertiesResource',
'CassandraTableGetResults',
'CassandraTableListResult',
'CassandraTableResource',
'CassandraViewCreateUpdateParameters',
'CassandraViewGetPropertiesOptions',
'CassandraViewGetPropertiesResource',
'CassandraViewGetResults',
'CassandraViewListResult',
'CassandraViewResource',
'Certificate',
'ClientEncryptionIncludedPath',
'ClientEncryptionKeyCreateUpdateParameters',
'ClientEncryptionKeyGetPropertiesResource',
'ClientEncryptionKeyGetResults',
'ClientEncryptionKeyResource',
'ClientEncryptionKeysListResult',
'ClientEncryptionPolicy',
'ClusterKey',
'ClusterResource',
'ClusterResourceProperties',
'Column',
'CommandOutput',
'CommandPostBody',
'Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties',
'ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacentersItemsPropertiesNodesItems',
'CompositePath',
'ConflictResolutionPolicy',
'ConnectionError',
'ConsistencyPolicy',
'ContainerPartitionKey',
'ContinuousBackupInformation',
'ContinuousBackupRestoreLocation',
'ContinuousModeBackupPolicy',
'ContinuousModeProperties',
'CorsPolicy',
'CosmosCassandraDataTransferDataSourceSink',
'CosmosSqlDataTransferDataSourceSink',
'CreateJobRequest',
'CreateUpdateOptions',
'DataCenterResource',
'DataCenterResourceProperties',
'DataTransferDataSourceSink',
'DataTransferJobFeedResults',
'DataTransferJobGetResults',
'DataTransferJobProperties',
'DataTransferRegionalServiceResource',
'DataTransferServiceResource',
'DataTransferServiceResourceProperties',
'DatabaseAccountConnectionString',
'DatabaseAccountCreateUpdateParameters',
'DatabaseAccountGetResults',
'DatabaseAccountListConnectionStringsResult',
'DatabaseAccountListKeysResult',
'DatabaseAccountListReadOnlyKeysResult',
'DatabaseAccountRegenerateKeyParameters',
'DatabaseAccountUpdateParameters',
'DatabaseAccountsListResult',
'DatabaseRestoreResource',
'DiagnosticLogSettings',
'ErrorResponse',
'ExcludedPath',
'ExtendedResourceProperties',
'FailoverPolicies',
'FailoverPolicy',
'GraphAPIComputeRegionalServiceResource',
'GraphAPIComputeServiceResource',
'GraphAPIComputeServiceResourceProperties',
'GraphResource',
'GraphResourceCreateUpdateParameters',
'GraphResourceGetPropertiesOptions',
'GraphResourceGetPropertiesResource',
'GraphResourceGetResults',
'GraphResourcesListResult',
'GremlinDatabaseCreateUpdateParameters',
'GremlinDatabaseGetPropertiesOptions',
'GremlinDatabaseGetPropertiesResource',
'GremlinDatabaseGetResults',
'GremlinDatabaseListResult',
'GremlinDatabaseResource',
'GremlinDatabaseRestoreResource',
'GremlinGraphCreateUpdateParameters',
'GremlinGraphGetPropertiesOptions',
'GremlinGraphGetPropertiesResource',
'GremlinGraphGetResults',
'GremlinGraphListResult',
'GremlinGraphResource',
'IncludedPath',
'Indexes',
'IndexingPolicy',
'IpAddressOrRange',
'KeyWrapMetadata',
'ListBackups',
'ListClusters',
'ListDataCenters',
'Location',
'LocationGetResult',
'LocationListResult',
'LocationProperties',
'ManagedCassandraARMResourceProperties',
'ManagedCassandraManagedServiceIdentity',
'ManagedCassandraReaperStatus',
'ManagedServiceIdentity',
'MaterializedViewsBuilderRegionalServiceResource',
'MaterializedViewsBuilderServiceResource',
'MaterializedViewsBuilderServiceResourceProperties',
'MergeParameters',
'Metric',
'MetricAvailability',
'MetricDefinition',
'MetricDefinitionsListResult',
'MetricListResult',
'MetricName',
'MetricValue',
'MongoDBCollectionCreateUpdateParameters',
'MongoDBCollectionGetPropertiesOptions',
'MongoDBCollectionGetPropertiesResource',
'MongoDBCollectionGetResults',
'MongoDBCollectionListResult',
'MongoDBCollectionResource',
'MongoDBDatabaseCreateUpdateParameters',
'MongoDBDatabaseGetPropertiesOptions',
'MongoDBDatabaseGetPropertiesResource',
'MongoDBDatabaseGetResults',
'MongoDBDatabaseListResult',
'MongoDBDatabaseResource',
'MongoIndex',
'MongoIndexKeys',
'MongoIndexOptions',
'MongoRoleDefinitionCreateUpdateParameters',
'MongoRoleDefinitionGetResults',
'MongoRoleDefinitionListResult',
'MongoUserDefinitionCreateUpdateParameters',
'MongoUserDefinitionGetResults',
'MongoUserDefinitionListResult',
'NotebookWorkspace',
'NotebookWorkspaceConnectionInfoResult',
'NotebookWorkspaceCreateUpdateParameters',
'NotebookWorkspaceListResult',
'Operation',
'OperationDisplay',
'OperationListResult',
'OptionsResource',
'PartitionMetric',
'PartitionMetricListResult',
'PartitionUsage',
'PartitionUsagesResult',
'PercentileMetric',
'PercentileMetricListResult',
'PercentileMetricValue',
'PeriodicModeBackupPolicy',
'PeriodicModeProperties',
'Permission',
'PhysicalPartitionId',
'PhysicalPartitionStorageInfo',
'PhysicalPartitionStorageInfoCollection',
'PhysicalPartitionThroughputInfoProperties',
'PhysicalPartitionThroughputInfoResource',
'PhysicalPartitionThroughputInfoResult',
'PhysicalPartitionThroughputInfoResultPropertiesResource',
'PrivateEndpointConnection',
'PrivateEndpointConnectionListResult',
'PrivateEndpointProperty',
'PrivateLinkResource',
'PrivateLinkResourceListResult',
'PrivateLinkServiceConnectionStateProperty',
'Privilege',
'PrivilegeResource',
'ProxyResource',
'RedistributeThroughputParameters',
'RedistributeThroughputPropertiesResource',
'RegionForOnlineOffline',
'RegionalServiceResource',
'Resource',
'RestorableDatabaseAccountGetResult',
'RestorableDatabaseAccountsListResult',
'RestorableGremlinDatabaseGetResult',
'RestorableGremlinDatabasePropertiesResource',
'RestorableGremlinDatabasesListResult',
'RestorableGremlinGraphGetResult',
'RestorableGremlinGraphPropertiesResource',
'RestorableGremlinGraphsListResult',
'RestorableGremlinResourcesListResult',
'RestorableLocationResource',
'RestorableMongodbCollectionGetResult',
'RestorableMongodbCollectionPropertiesResource',
'RestorableMongodbCollectionsListResult',
'RestorableMongodbDatabaseGetResult',
'RestorableMongodbDatabasePropertiesResource',
'RestorableMongodbDatabasesListResult',
'RestorableMongodbResourcesListResult',
'RestorableSqlContainerGetResult',
'RestorableSqlContainerPropertiesResource',
'RestorableSqlContainerPropertiesResourceContainer',
'RestorableSqlContainersListResult',
'RestorableSqlDatabaseGetResult',
'RestorableSqlDatabasePropertiesResource',
'RestorableSqlDatabasePropertiesResourceDatabase',
'RestorableSqlDatabasesListResult',
'RestorableSqlResourcesListResult',
'RestorableTableGetResult',
'RestorableTablePropertiesResource',
'RestorableTableResourcesListResult',
'RestorableTablesListResult',
'RestoreParameters',
'RetrieveThroughputParameters',
'RetrieveThroughputPropertiesResource',
'Role',
'SeedNode',
'ServiceResource',
'ServiceResourceCreateUpdateParameters',
'ServiceResourceListResult',
'ServiceResourceProperties',
'SpatialSpec',
'SqlContainerCreateUpdateParameters',
'SqlContainerGetPropertiesOptions',
'SqlContainerGetPropertiesResource',
'SqlContainerGetResults',
'SqlContainerListResult',
'SqlContainerResource',
'SqlDatabaseCreateUpdateParameters',
'SqlDatabaseGetPropertiesOptions',
'SqlDatabaseGetPropertiesResource',
'SqlDatabaseGetResults',
'SqlDatabaseListResult',
'SqlDatabaseResource',
'SqlDedicatedGatewayRegionalServiceResource',
'SqlDedicatedGatewayServiceResource',
'SqlDedicatedGatewayServiceResourceProperties',
'SqlRoleAssignmentCreateUpdateParameters',
'SqlRoleAssignmentGetResults',
'SqlRoleAssignmentListResult',
'SqlRoleDefinitionCreateUpdateParameters',
'SqlRoleDefinitionGetResults',
'SqlRoleDefinitionListResult',
'SqlStoredProcedureCreateUpdateParameters',
'SqlStoredProcedureGetPropertiesResource',
'SqlStoredProcedureGetResults',
'SqlStoredProcedureListResult',
'SqlStoredProcedureResource',
'SqlTriggerCreateUpdateParameters',
'SqlTriggerGetPropertiesResource',
'SqlTriggerGetResults',
'SqlTriggerListResult',
'SqlTriggerResource',
'SqlUserDefinedFunctionCreateUpdateParameters',
'SqlUserDefinedFunctionGetPropertiesResource',
'SqlUserDefinedFunctionGetResults',
'SqlUserDefinedFunctionListResult',
'SqlUserDefinedFunctionResource',
'SystemData',
'TableCreateUpdateParameters',
'TableGetPropertiesOptions',
'TableGetPropertiesResource',
'TableGetResults',
'TableListResult',
'TableResource',
'ThroughputPolicyResource',
'ThroughputSettingsGetPropertiesResource',
'ThroughputSettingsGetResults',
'ThroughputSettingsResource',
'ThroughputSettingsUpdateParameters',
'UniqueKey',
'UniqueKeyPolicy',
'Usage',
'UsagesResult',
'VirtualNetworkRule',
'AnalyticalStorageSchemaType',
'ApiType',
'AuthenticationMethod',
'BackupPolicyMigrationStatus',
'BackupPolicyType',
'BackupStorageRedundancy',
'CompositePathSortOrder',
'ConflictResolutionMode',
'ConnectionState',
'ConnectorOffer',
'ContinuousTier',
'CreateMode',
'CreatedByType',
'DataTransferComponent',
'DataType',
'DatabaseAccountKind',
'DefaultConsistencyLevel',
'EnableFullTextQuery',
'IndexKind',
'IndexingMode',
'KeyKind',
'ManagedCassandraProvisioningState',
'ManagedCassandraResourceIdentityType',
'MongoRoleDefinitionType',
'NetworkAclBypass',
'NodeState',
'NodeStatus',
'NotebookWorkspaceName',
'OperationType',
'PartitionKind',
'PrimaryAggregationType',
'PublicNetworkAccess',
'ResourceIdentityType',
'RestoreMode',
'RoleDefinitionType',
'ServerVersion',
'ServiceSize',
'ServiceStatus',
'ServiceType',
'SpatialType',
'ThroughputPolicyType',
'TriggerOperation',
'TriggerType',
'UnitType',
]
| 41.067723 | 123 | 0.835409 | 1,913 | 28,501 | 12.133298 | 0.202823 | 0.127095 | 0.165223 | 0.24148 | 0.062557 | 0.062557 | 0.062557 | 0.062557 | 0.062557 | 0.062557 | 0 | 0.012234 | 0.110908 | 28,501 | 693 | 124 | 41.126984 | 0.903749 | 0.015859 | 0 | 0 | 0 | 0 | 0.308798 | 0.252095 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.002933 | 0.434018 | 0 | 0.434018 | 0 | 0 | 0 | 1 | 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 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
7debf583d8b0eaf11c3ae29fcdcb7ee8dab0a085 | 3,402 | py | Python | tests/functions/test_get_type.py | georgeharker/typish | 1c043beb74d89e62b10339a2a964f60ec175adfa | [
"MIT"
] | 16 | 2019-08-03T13:57:17.000Z | 2021-11-08T11:51:52.000Z | tests/functions/test_get_type.py | georgeharker/typish | 1c043beb74d89e62b10339a2a964f60ec175adfa | [
"MIT"
] | 27 | 2019-09-11T13:24:38.000Z | 2022-02-11T07:04:12.000Z | tests/functions/test_get_type.py | georgeharker/typish | 1c043beb74d89e62b10339a2a964f60ec175adfa | [
"MIT"
] | 7 | 2019-11-18T16:50:09.000Z | 2021-11-01T14:34:39.000Z | from typing import Dict, Set, List, Tuple, Type, Callable, Any, Awaitable, Union
from unittest import TestCase
import numpy
from typish import get_type, instance_of, NoneType, Unknown
class TestGetType(TestCase):
def test_get_type_list(self):
self.assertEqual(List[int], get_type([1, 2, 3]))
self.assertEqual(List[object], get_type([1, 2, '3']))
self.assertEqual(List[Unknown], get_type([]))
def test_get_type_list_with_union(self):
self.assertEqual(List[Union[int, str, float]], get_type([1, '2', 3.0], True))
def test_get_type_set(self):
self.assertEqual(Set[int], get_type({1, 2, 3}))
self.assertEqual(Set[object], get_type({1, 2, '3'}))
self.assertEqual(Set[Unknown], get_type(set([])))
def test_get_type_dict(self):
self.assertEqual(Dict[str, int], get_type({'a': 1, 'b': 2}))
self.assertEqual(Dict[int, object], get_type({1: 'a', 2: 2}))
self.assertEqual(Dict[Unknown, Unknown], get_type({}))
def test_get_type_tuple(self):
self.assertEqual(Tuple[int, int, int], get_type((1, 2, 3)))
self.assertEqual(Tuple[int, str, str], get_type((1, '2', '3')))
def test_get_type_callable(self):
def func1(x: int, y: str) -> object:
pass
def func2() -> int:
pass
def func3(x: int):
pass
def func4():
pass
def func5(x):
pass
def func6(l: List[List[List[int]]]):
pass
self.assertEqual(Callable[[int, str], object], get_type((func1)))
self.assertEqual(Callable[[], int], get_type(func2))
self.assertEqual(Callable[[int], NoneType], get_type(func3))
self.assertEqual(Callable, get_type(func4))
self.assertEqual(Callable[[Any], NoneType], get_type(func5))
self.assertEqual(Callable[[List[List[List[int]]]], NoneType], get_type(func6))
def test_get_type_async(self):
async def func(x: int) -> str:
return '42'
self.assertEqual(Callable[[int], Awaitable[str]], get_type(func))
def test_get_type_lambda(self):
self.assertEqual(Callable[[Unknown, Unknown], Unknown], get_type(lambda x, y: 42))
self.assertEqual(Callable[[], Unknown], get_type(lambda: 42))
def test_get_type_deep(self):
self.assertEqual(List[List[int]], get_type([[1, 2], [3]]))
self.assertEqual(List[List[object]], get_type([[1, 2], ['3']]))
deep = [[[1, 2]], [[3]], [[4], [5, '6']]]
self.assertEqual(List[List[List[object]]], get_type(deep))
self.assertEqual(Dict[str, List[List[List[object]]]], get_type({'a': deep}))
def test_get_type_type(self):
self.assertEqual(Type[int], get_type(int))
def test_get_type_some_class(self):
class SomeRandomClass:
pass
self.assertEqual(SomeRandomClass, get_type(SomeRandomClass()))
def test_get_type_any(self):
any_type = get_type(Any)
self.assertEqual(Any, any_type)
def test_get_type_union(self):
union_type = get_type(Union[int, str])
# The following line should not raise.
Union[(union_type,)]
self.assertTrue(instance_of(Union[int, str], union_type))
def test_get_type_of_ndarray(self):
arr_type = get_type(numpy.array([1, 2, 3]))
self.assertEqual(numpy.ndarray, arr_type)
| 32.711538 | 90 | 0.617872 | 464 | 3,402 | 4.344828 | 0.150862 | 0.15625 | 0.069444 | 0.097222 | 0.209325 | 0.161706 | 0.136905 | 0.099206 | 0.035714 | 0.035714 | 0 | 0.022779 | 0.22575 | 3,402 | 103 | 91 | 33.029126 | 0.742597 | 0.010582 | 0 | 0.1 | 0 | 0 | 0.003864 | 0 | 0 | 0 | 0 | 0 | 0.428571 | 1 | 0.285714 | false | 0.1 | 0.057143 | 0 | 0.385714 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
814af747328f40b41e13dc88d5bf7e15cc94299c | 161 | py | Python | code/environment/harold/envs/__init__.py | alandevine/HAROLD | c0afa07d83b87c67e273d5840a547bc436ac9646 | [
"MIT"
] | null | null | null | code/environment/harold/envs/__init__.py | alandevine/HAROLD | c0afa07d83b87c67e273d5840a547bc436ac9646 | [
"MIT"
] | null | null | null | code/environment/harold/envs/__init__.py | alandevine/HAROLD | c0afa07d83b87c67e273d5840a547bc436ac9646 | [
"MIT"
] | null | null | null | from gym.envs.registration import register
register(
id='HaroldReach-v0',
entry_point='envs.harold_reach_env:HaroldReach',
max_episode_steps=200
)
| 17.888889 | 52 | 0.757764 | 21 | 161 | 5.571429 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.028986 | 0.142857 | 161 | 8 | 53 | 20.125 | 0.818841 | 0 | 0 | 0 | 0 | 0 | 0.29375 | 0.20625 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.166667 | 0 | 0.166667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
814bb0a961e0c9cef8c81478a3d11c98008acd0d | 1,741 | py | Python | scripts/west_commands/runners/misc.py | maxvankessel/zephyr | 769d91b922b736860244b22e25328d91d9a17657 | [
"Apache-2.0"
] | 6,224 | 2016-06-24T20:04:19.000Z | 2022-03-31T20:33:45.000Z | scripts/west_commands/runners/misc.py | Conexiotechnologies/zephyr | fde24ac1f25d09eb9722ce4edc6e2d3f844b5bce | [
"Apache-2.0"
] | 32,027 | 2017-03-24T00:02:32.000Z | 2022-03-31T23:45:53.000Z | scripts/west_commands/runners/misc.py | Conexiotechnologies/zephyr | fde24ac1f25d09eb9722ce4edc6e2d3f844b5bce | [
"Apache-2.0"
] | 4,374 | 2016-08-11T07:28:47.000Z | 2022-03-31T14:44:59.000Z | # Copyright (c) 2019, Nordic Semiconductor ASA
#
# SPDX-License-Identifier: Apache-2.0
'''Catch-all module for miscellaneous devices which can't use a
generic or widely used tool like J-Link, OpenOCD, etc.
Please use this sparingly and only when your setup is exotic and
you're willing to handle requests for help. E.g. if your "board" is a
core on a special-purpose SoC which requires a complicated script to
network boot.'''
from runners.core import ZephyrBinaryRunner, RunnerCaps
import argparse
class MiscFlasher(ZephyrBinaryRunner):
'''Runner for handling special purpose flashing commands.'''
def __init__(self, cfg, cmd, args):
super().__init__(cfg)
if not cmd:
# This is a board definition error, not a user error,
# so we can do it now and not in do_run().
raise ValueError('no command was given')
self.cmd = cmd
self.args = args
@classmethod
def name(cls):
return 'misc-flasher'
@classmethod
def capabilities(cls):
return RunnerCaps(commands={'flash'})
@classmethod
def do_add_parser(cls, parser):
parser.add_argument('cmd',
help='''command to run; it will be passed the
build directory as its first argument''')
parser.add_argument('args', nargs=argparse.REMAINDER,
help='''additional arguments to pass after the build
directory''')
@classmethod
def do_create(cls, cfg, args):
return MiscFlasher(cfg, args.cmd, args.args)
def do_run(self, *args, **kwargs):
self.require(self.cmd)
self.check_call([self.cmd, self.cfg.build_dir] + self.args)
| 33.480769 | 80 | 0.638139 | 229 | 1,741 | 4.777293 | 0.576419 | 0.051188 | 0.02925 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004728 | 0.271109 | 1,741 | 51 | 81 | 34.137255 | 0.857368 | 0.323952 | 0 | 0.137931 | 0 | 0 | 0.197074 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.206897 | false | 0.068966 | 0.068966 | 0.103448 | 0.413793 | 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 | 0 | 0 | 0 | 3 |
814e840b73410f81350066d11bb8f5c62d1ca3c2 | 594 | py | Python | PP4E/Examples/PP4E/Integrate/Embed/prioredition-2x/TestApi/WithPackages/pkgdir/testapi.py | BeacherHou/Python-_Markdown- | 015d79a02d32f49395b80ca10919b3a09b72c4df | [
"MIT"
] | null | null | null | PP4E/Examples/PP4E/Integrate/Embed/prioredition-2x/TestApi/WithPackages/pkgdir/testapi.py | BeacherHou/Python-_Markdown- | 015d79a02d32f49395b80ca10919b3a09b72c4df | [
"MIT"
] | null | null | null | PP4E/Examples/PP4E/Integrate/Embed/prioredition-2x/TestApi/WithPackages/pkgdir/testapi.py | BeacherHou/Python-_Markdown- | 015d79a02d32f49395b80ca10919b3a09b72c4df | [
"MIT"
] | null | null | null | ####################################################
# package version -- named "pkgdir.testapi"
# this function is loaded and run by testapi.c;
# change this file between calls: auto-reload mode
# gets the new version each time 'func' is called;
# for the test, the last line was changed to:
# return x + y
# return x * y
# return x \ y - syntax error
# return x / 0 - zero-divide error
# return pow(x, y)
####################################################
def func(x, y): # called by C
return x + y # change me
| 34.941176 | 53 | 0.473064 | 73 | 594 | 3.849315 | 0.616438 | 0.042705 | 0.113879 | 0.099644 | 0.085409 | 0.085409 | 0 | 0 | 0 | 0 | 0 | 0.002347 | 0.282828 | 594 | 16 | 54 | 37.125 | 0.657277 | 0.649832 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | false | 0 | 0 | 0.5 | 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 | 0 | 1 | 1 | 0 | 0 | 3 |
814f39eedc405c24b55fabf2db6d89e91c07c2ae | 2,382 | py | Python | topic/migrations/0001_initial.py | passenger37/blog | 362d501d39282c6776faa2ac55eab8b2389b51e6 | [
"MIT"
] | null | null | null | topic/migrations/0001_initial.py | passenger37/blog | 362d501d39282c6776faa2ac55eab8b2389b51e6 | [
"MIT"
] | null | null | null | topic/migrations/0001_initial.py | passenger37/blog | 362d501d39282c6776faa2ac55eab8b2389b51e6 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.4 on 2021-07-31 01:20
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('accounts', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Topic',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('text', models.CharField(max_length=200)),
('date_added', models.DateTimeField(auto_now=True)),
('entry', models.TextField(default='')),
('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='topic_user', to='accounts.profile')),
],
),
migrations.CreateModel(
name='UpVote',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('topic', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='topic.topic')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='upvote_user', to='accounts.profile')),
],
),
migrations.CreateModel(
name='DownVote',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('topic', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='topic.topic')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='downvote_user', to='accounts.profile')),
],
),
migrations.CreateModel(
name='Comment',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('comment', models.TextField(default='')),
('date_added', models.DateTimeField(auto_now=True)),
('topic', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='topic.topic')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comment_user', to='accounts.profile')),
],
),
]
| 44.943396 | 142 | 0.598657 | 245 | 2,382 | 5.685714 | 0.253061 | 0.051687 | 0.080402 | 0.126346 | 0.733668 | 0.733668 | 0.733668 | 0.578607 | 0.578607 | 0.578607 | 0 | 0.012367 | 0.253149 | 2,382 | 52 | 143 | 45.807692 | 0.770658 | 0.018892 | 0 | 0.555556 | 1 | 0 | 0.116916 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.044444 | 0 | 0.133333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 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 | 3 |
814f7b2f436fc791a7d273ca797a13ad008bd2dc | 231 | py | Python | src/GUIMLEV1.1/Mle.py | Steins7/MyLittleERP | f0220196136c1a0eff5dd7de469dfdb3466c1d5d | [
"MIT"
] | null | null | null | src/GUIMLEV1.1/Mle.py | Steins7/MyLittleERP | f0220196136c1a0eff5dd7de469dfdb3466c1d5d | [
"MIT"
] | null | null | null | src/GUIMLEV1.1/Mle.py | Steins7/MyLittleERP | f0220196136c1a0eff5dd7de469dfdb3466c1d5d | [
"MIT"
] | 1 | 2019-06-03T21:18:21.000Z | 2019-06-03T21:18:21.000Z | import tkinter as tk
from matplotlib.figure import Figure
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
class Mle(tk.Tk):
def __init__(self,*args,**kwargs):
tk.Tk.__init__(self,*args,**kwargs)
| 21 | 63 | 0.735931 | 31 | 231 | 5.193548 | 0.580645 | 0.173913 | 0.149068 | 0.223602 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.160173 | 231 | 10 | 64 | 23.1 | 0.829897 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.5 | 0 | 0.833333 | 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 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
817167cbd24e4afef7da15b631bcd22bb1f80f87 | 567 | py | Python | core/verifier.py | littlezz/SPHG | 7d02d0edb9062272727ef7e556c79fcb61aa3732 | [
"MIT"
] | null | null | null | core/verifier.py | littlezz/SPHG | 7d02d0edb9062272727ef7e556c79fcb61aa3732 | [
"MIT"
] | 1 | 2015-10-30T08:14:53.000Z | 2015-10-30T17:03:41.000Z | core/verifier.py | littlezz/SPHG | 7d02d0edb9062272727ef7e556c79fcb61aa3732 | [
"MIT"
] | null | null | null | __author__ = 'zz'
class BaseVerifier:
def verify(self, value):
raise NotImplementedError
class IntVerifier(BaseVerifier):
def __index__(self, upper, bot):
self.upper = upper
self.bot = bot
def verify(self, value):
if isinstance(value, int):
return False
if not (self.bot <= value <= self.upper):
return False
return True
class StringNotEmptyVerifier(BaseVerifier):
def verify(self, value):
if str(value).strip():
return True
return False
| 17.181818 | 49 | 0.592593 | 60 | 567 | 5.466667 | 0.4 | 0.137195 | 0.118902 | 0.164634 | 0.25 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.319224 | 567 | 32 | 50 | 17.71875 | 0.849741 | 0 | 0 | 0.421053 | 0 | 0 | 0.003546 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.210526 | false | 0 | 0 | 0 | 0.631579 | 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 | 0 | 1 | 0 | 0 | 3 |
81825d6c2578f8c1e9744bafadaab24670e78e74 | 98 | py | Python | turtle_shell/apps.py | srijyothsna/django-turtle-shell | bd892ed090004919dd744dc21d028007b8364098 | [
"MIT"
] | 1 | 2021-05-13T16:10:02.000Z | 2021-05-13T16:10:02.000Z | turtle_shell/apps.py | srijyothsna/django-turtle-shell | bd892ed090004919dd744dc21d028007b8364098 | [
"MIT"
] | 1 | 2022-01-07T01:23:13.000Z | 2022-01-07T01:23:13.000Z | turtle_shell/apps.py | srijyothsna/django-turtle-shell | bd892ed090004919dd744dc21d028007b8364098 | [
"MIT"
] | 1 | 2021-12-15T17:06:28.000Z | 2021-12-15T17:06:28.000Z | from django.apps import AppConfig
class TurtleShellConfig(AppConfig):
name = "turtle_shell"
| 16.333333 | 35 | 0.77551 | 11 | 98 | 6.818182 | 0.909091 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.153061 | 98 | 5 | 36 | 19.6 | 0.903614 | 0 | 0 | 0 | 0 | 0 | 0.122449 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
81c49a3e56373afd82bc57ef43c4aeae96456c3b | 164 | py | Python | tasks/test.py | Mcamargo85/SiMo-Discoverer | e308c01dd24f4543deafcf104e02f0b593ea6acb | [
"Apache-2.0"
] | null | null | null | tasks/test.py | Mcamargo85/SiMo-Discoverer | e308c01dd24f4543deafcf104e02f0b593ea6acb | [
"Apache-2.0"
] | null | null | null | tasks/test.py | Mcamargo85/SiMo-Discoverer | e308c01dd24f4543deafcf104e02f0b593ea6acb | [
"Apache-2.0"
] | null | null | null | from invoke import task
@task
def unit(ctx):
ctx.run("pytest -v -m 'not integration'")
@task
def integration(ctx):
ctx.run("pytest -v -m 'integration'") | 14.909091 | 45 | 0.658537 | 25 | 164 | 4.32 | 0.52 | 0.12963 | 0.166667 | 0.277778 | 0.314815 | 0.314815 | 0 | 0 | 0 | 0 | 0 | 0 | 0.182927 | 164 | 11 | 46 | 14.909091 | 0.80597 | 0 | 0 | 0.285714 | 0 | 0 | 0.339394 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0.142857 | 0 | 0.428571 | 0 | 1 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
81ccc202d50d2f3aad140f7cfdd555da97812d82 | 1,436 | py | Python | src/image.py | LeonGeorgi/ballsurf | 4ae5fdb21e67d84ff7a0168481720dcd10155705 | [
"MIT"
] | null | null | null | src/image.py | LeonGeorgi/ballsurf | 4ae5fdb21e67d84ff7a0168481720dcd10155705 | [
"MIT"
] | null | null | null | src/image.py | LeonGeorgi/ballsurf | 4ae5fdb21e67d84ff7a0168481720dcd10155705 | [
"MIT"
] | null | null | null | from typing import Dict, Tuple
import pygame
class Cache:
def __init__(self, filename, mirrored):
self.image = pygame.image.load(filename)
self.image = pygame.transform.flip(self.image, mirrored, False)
self.sizes: Dict[Tuple[int, int], pygame.Surface] = {}
def scale(self, width: int, height: int) -> pygame.Surface:
key = (width, height)
if key not in self.sizes:
img = pygame.transform.scale(self.image, (width, height))
self.sizes[key] = img
return self.sizes[key]
def clear(self):
self.sizes = {}
class CachedImage:
cache: Dict[Tuple[str, bool], Cache] = {}
def __init__(self, filename: str, mirrored: bool = False):
self.filename = filename
self.mirrored = mirrored
self.key = (filename, mirrored)
if self.key not in CachedImage.cache:
CachedImage.cache[self.key] = Cache(filename, mirrored)
@property
def original(self) -> pygame.Surface:
return CachedImage.cache[self.key].image
def get_width(self) -> int:
return self.original.get_width()
def get_height(self) -> int:
return self.original.get_height()
def scale(self, width: int, height: int):
return CachedImage.cache[self.key].scale(width, height)
@staticmethod
def clear_cache():
for cache in CachedImage.cache.values():
cache.clear()
| 27.615385 | 71 | 0.624652 | 175 | 1,436 | 5.051429 | 0.228571 | 0.108597 | 0.067873 | 0.078054 | 0.248869 | 0.128959 | 0.065611 | 0 | 0 | 0 | 0 | 0 | 0.256964 | 1,436 | 51 | 72 | 28.156863 | 0.828491 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.055556 | 0.111111 | 0.527778 | 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 | 0 | 1 | 1 | 0 | 0 | 3 |
c4a10d8295b0b7033d07ca9fc9d28f17080f4033 | 82 | py | Python | desafio001.py | DeBrites/py-mundo1 | 0827c7094e6c099fa5866b292dfe344cb3602e7a | [
"MIT"
] | null | null | null | desafio001.py | DeBrites/py-mundo1 | 0827c7094e6c099fa5866b292dfe344cb3602e7a | [
"MIT"
] | null | null | null | desafio001.py | DeBrites/py-mundo1 | 0827c7094e6c099fa5866b292dfe344cb3602e7a | [
"MIT"
] | null | null | null | nome = input('Qual é o seu nome? ')
print('Olá',nome,'. É um prazer te conhecer!') | 41 | 46 | 0.646341 | 15 | 82 | 3.533333 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.158537 | 82 | 2 | 46 | 41 | 0.768116 | 0 | 0 | 0 | 0 | 0 | 0.578313 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.5 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
c4a94bb63947bd2cd2d3d242add70492ec3699cf | 2,109 | py | Python | src/models.py | theskumar/django-twilio-sms-2 | 122b61c2049168723973c91c66caa9ddb42e6266 | [
"MIT"
] | 4 | 2015-01-30T17:35:49.000Z | 2016-12-08T20:29:39.000Z | src/models.py | theskumar/django-twilio-sms-2 | 122b61c2049168723973c91c66caa9ddb42e6266 | [
"MIT"
] | null | null | null | src/models.py | theskumar/django-twilio-sms-2 | 122b61c2049168723973c91c66caa9ddb42e6266 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
# Third Party Stuff
from django.db import models
from django.utils.timezone import now as tznow
from django.utils.translation import ugettext_lazy as _
class IncomingSMS(models.Model):
sms_sid = models.CharField(max_length=34)
account_sid = models.CharField(max_length=34)
from_number = models.CharField(max_length=30)
from_city = models.CharField(max_length=30, default="", blank=True)
from_state = models.CharField(max_length=30, default="", blank=True)
from_zip = models.CharField(max_length=30, default="", blank=True)
from_country = models.CharField(max_length=120, default="", blank=True)
to_number = models.CharField(max_length=30)
body = models.TextField(max_length=160, default="", blank=True)
created_at = models.DateTimeField(auto_now_add=True)
class Meta:
verbose_name = _("Incoming SMS")
verbose_name_plural = _("Incoming SMS")
class OutgoingSMS(models.Model):
sms_sid = models.CharField(max_length=34, default="", blank=True)
account_sid = models.CharField(max_length=34, default="", blank=True)
from_number = models.CharField(max_length=30)
to_number = models.CharField(max_length=30)
to_parsed = models.CharField(max_length=30, default="", blank=True)
body = models.TextField(max_length=160, default="", blank=True)
created_at = models.DateTimeField(auto_now_add=True)
sent_at = models.DateTimeField(null=True, blank=True)
delivered_at = models.DateTimeField(null=True, blank=True)
status = models.CharField(max_length=20, default="", blank=True)
price = models.DecimalField(
max_digits=5, decimal_places=2, null=True, blank=True)
price_unit = models.CharField(max_length=3, default="", blank=True)
class Meta:
verbose_name = _("Outgoing SMS")
verbose_name_plural = _("Outgoing SMS")
def save(self, *args, **kwargs):
if self.status == "sent" and not self.delivered_at:
self.delivered_at = tznow()
super(OutgoingSMS, self).save(*args, **kwargs)
| 35.745763 | 75 | 0.711238 | 280 | 2,109 | 5.142857 | 0.292857 | 0.10625 | 0.1875 | 0.25 | 0.5625 | 0.531944 | 0.531944 | 0.350694 | 0.321528 | 0.123611 | 0 | 0.022159 | 0.165481 | 2,109 | 58 | 76 | 36.362069 | 0.796023 | 0.018492 | 0 | 0.25641 | 0 | 0 | 0.025157 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.025641 | false | 0 | 0.102564 | 0 | 0.794872 | 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 | 0 | 0 | 1 | 0 | 0 | 3 |
c4b4090460919880096e26a3781105c7afcef437 | 1,168 | py | Python | qualifier/deploy/cohorte-home/repo/jsonrpclib/__init__.py | isandlaTech/cohorte-devtools | 9ba9021369188d2f0ad5c845ef242fd5a7097b57 | [
"Apache-2.0"
] | 1 | 2017-03-04T14:37:15.000Z | 2017-03-04T14:37:15.000Z | qualifier/deploy/cohorte-home/repo/jsonrpclib/__init__.py | isandlaTech/cohorte-devtools | 9ba9021369188d2f0ad5c845ef242fd5a7097b57 | [
"Apache-2.0"
] | 4 | 2017-08-21T08:17:14.000Z | 2018-03-02T13:51:43.000Z | qualifier/deploy/cohorte-home/repo/jsonrpclib/__init__.py | isandlaTech/cohorte-devtools | 9ba9021369188d2f0ad5c845ef242fd5a7097b57 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
Aliases to ease access to jsonrpclib classes
:authors: Josh Marshall, Thomas Calmant
:copyright: Copyright 2015, isandlaTech
:license: Apache License 2.0
:version: 0.2.6
..
Copyright 2015 isandlaTech
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
# Easy access to utility methods and classes
from jsonrpclib.jsonrpc import Server, ServerProxy
from jsonrpclib.jsonrpc import MultiCall, Fault, ProtocolError, AppError
from jsonrpclib.jsonrpc import loads, dumps, load, dump
from jsonrpclib.jsonrpc import jloads, jdumps
import jsonrpclib.history as history
import jsonrpclib.utils as utils
| 33.371429 | 76 | 0.763699 | 166 | 1,168 | 5.373494 | 0.60241 | 0.067265 | 0.09417 | 0.121076 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.018653 | 0.173801 | 1,168 | 34 | 77 | 34.352941 | 0.905699 | 0.733733 | 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 | 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 | 3 |
c4cb6a94606e3f93d0c9a09236ed597c84697733 | 80 | py | Python | woe_scoring/__init__.py | kiraplenkin/woe_scoring | db23fc1965e9da9213330e4b3c04b0a75a130123 | [
"MIT"
] | 4 | 2021-04-07T19:50:48.000Z | 2021-09-28T10:36:09.000Z | woe_scoring/__init__.py | kiraplenkin/scorecard | db23fc1965e9da9213330e4b3c04b0a75a130123 | [
"MIT"
] | 22 | 2021-04-14T06:31:32.000Z | 2022-03-31T14:39:30.000Z | woe_scoring/__init__.py | kiraplenkin/scorecard | db23fc1965e9da9213330e4b3c04b0a75a130123 | [
"MIT"
] | 3 | 2021-11-30T11:49:08.000Z | 2022-01-10T14:16:38.000Z | from woe_scoring.core import WOETransformer, CreateModel
__version__ = "0.3.4"
| 20 | 56 | 0.8 | 11 | 80 | 5.363636 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.042254 | 0.1125 | 80 | 3 | 57 | 26.666667 | 0.788732 | 0 | 0 | 0 | 0 | 0 | 0.0625 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
c4d5e6e458c800348ebb8d5f3fa0ba94ab1f8cc8 | 258 | wsgi | Python | archivedigitization.wsgi | JoanChirinos/ArchiveDigitization | c7dafb1b4dfe31178f4ff8a2f6e29292c0ae14ca | [
"MIT"
] | null | null | null | archivedigitization.wsgi | JoanChirinos/ArchiveDigitization | c7dafb1b4dfe31178f4ff8a2f6e29292c0ae14ca | [
"MIT"
] | null | null | null | archivedigitization.wsgi | JoanChirinos/ArchiveDigitization | c7dafb1b4dfe31178f4ff8a2f6e29292c0ae14ca | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import sys
import logging
logging.basicConfig(stream=sys.stderr)
sys.path.insert(0,"/var/www/ArchiveDigitization/ArchiveDigitization/")
sys.path.insert(1,"/var/www/ArchiveDigitization/")
from ArchiveDigitization import app as application
| 28.666667 | 70 | 0.813953 | 33 | 258 | 6.363636 | 0.606061 | 0.066667 | 0.12381 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012346 | 0.05814 | 258 | 8 | 71 | 32.25 | 0.851852 | 0.065891 | 0 | 0 | 0 | 0 | 0.325 | 0.325 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 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 | 0 | 0 | 0 | 3 |
c4ddedac763228d3cd08f1d8429af30b5eae8095 | 349 | py | Python | sources/classic/sql_storage/repository.py | variasov/classic_sql_storage | 597c8cf5816351aaa2e0b9cf91a0ea2d132c39f4 | [
"MIT"
] | 3 | 2021-10-12T06:50:35.000Z | 2021-11-12T08:19:57.000Z | sources/classic/sql_storage/repository.py | variasov/classic_sql_storage | 597c8cf5816351aaa2e0b9cf91a0ea2d132c39f4 | [
"MIT"
] | null | null | null | sources/classic/sql_storage/repository.py | variasov/classic_sql_storage | 597c8cf5816351aaa2e0b9cf91a0ea2d132c39f4 | [
"MIT"
] | null | null | null | from sqlalchemy.orm import Session
from classic.components import component
from .transactions import TransactionContext
@component
class BaseRepository:
"""
Base class for Repositories, using SQLAlchemy
"""
context: TransactionContext
@property
def session(self) -> Session:
return self.context.current_session
| 19.388889 | 49 | 0.74212 | 35 | 349 | 7.371429 | 0.628571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.197708 | 349 | 17 | 50 | 20.529412 | 0.921429 | 0.12894 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0 | 0.333333 | 0.111111 | 0.777778 | 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 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 3 |
c4de4b8039aaffdd7fe9e3bd54299f42a1f5ba70 | 340 | py | Python | colors.py | mariochampion/gpt3-robo-writingpartner | e7b06fc99de0a31fa9982ce8095c0b4cdda95d14 | [
"MIT"
] | null | null | null | colors.py | mariochampion/gpt3-robo-writingpartner | e7b06fc99de0a31fa9982ce8095c0b4cdda95d14 | [
"MIT"
] | null | null | null | colors.py | mariochampion/gpt3-robo-writingpartner | e7b06fc99de0a31fa9982ce8095c0b4cdda95d14 | [
"MIT"
] | null | null | null | #######################################
## ADD SOME COLOR
# pinched and tweaked from https://github.com/impshum/Multi-Quote/blob/master/run.py
class color:
white, cyan, blue, red, green, yellow, magenta, black, gray, bold = '\033[0m', '\033[96m','\033[94m', '\033[91m','\033[92m','\033[93m','\033[95m', '\033[30m', '\033[30m', "\033[1m" | 68 | 184 | 0.570588 | 49 | 340 | 3.959184 | 0.77551 | 0.061856 | 0.092784 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.156352 | 0.097059 | 340 | 5 | 184 | 68 | 0.47557 | 0.285294 | 0 | 0 | 0 | 0 | 0.38806 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
c4e071fb7003cd922964dafed549b1381f7f6a82 | 279 | py | Python | output/models/nist_data/atomic/date_time/schema_instance/nistschema_sv_iv_atomic_date_time_min_exclusive_5_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/nist_data/atomic/date_time/schema_instance/nistschema_sv_iv_atomic_date_time_min_exclusive_5_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/nist_data/atomic/date_time/schema_instance/nistschema_sv_iv_atomic_date_time_min_exclusive_5_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from output.models.nist_data.atomic.date_time.schema_instance.nistschema_sv_iv_atomic_date_time_min_exclusive_5_xsd.nistschema_sv_iv_atomic_date_time_min_exclusive_5 import NistschemaSvIvAtomicDateTimeMinExclusive5
__all__ = [
"NistschemaSvIvAtomicDateTimeMinExclusive5",
]
| 46.5 | 214 | 0.903226 | 33 | 279 | 6.909091 | 0.606061 | 0.131579 | 0.184211 | 0.175439 | 0.359649 | 0.359649 | 0.359649 | 0.359649 | 0.359649 | 0 | 0 | 0.015094 | 0.050179 | 279 | 5 | 215 | 55.8 | 0.845283 | 0 | 0 | 0 | 0 | 0 | 0.146953 | 0.146953 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
c4e0d2c0915f4570eb2ec88abb4ec98218844e18 | 9,635 | py | Python | river/feature_extraction/agg.py | mathco-wf/river | c6ff38fa4ce4843ede1cba77248e0370a67a36f6 | [
"BSD-3-Clause"
] | 4 | 2019-04-09T16:51:08.000Z | 2021-07-26T15:43:30.000Z | river/feature_extraction/agg.py | mathco-wf/river | c6ff38fa4ce4843ede1cba77248e0370a67a36f6 | [
"BSD-3-Clause"
] | null | null | null | river/feature_extraction/agg.py | mathco-wf/river | c6ff38fa4ce4843ede1cba77248e0370a67a36f6 | [
"BSD-3-Clause"
] | 1 | 2021-10-19T03:16:07.000Z | 2021-10-19T03:16:07.000Z | import collections
import copy
import functools
import typing
from river import base, stats
__all__ = ["Agg", "TargetAgg"]
class Agg(base.Transformer):
"""Computes a streaming aggregate.
This transformer allows to compute an aggregate statistic, very much like the groupby method
from `pandas`, but on a streaming dataset. This makes use of the streaming statistics from the
`stats` module.
When `learn_one` is called, the running statistic `how` of group `by` is updated with the value
of `on`. Meanwhile, the output of `transform_one` is a single-element dictionary, where the key
is the name of the aggregate and the value is the current value of the statistic for the
relevant group. The key is automatically inferred from the parameters.
Note that you can use a `compose.TransformerUnion` to extract many aggregate statistics in a
concise manner.
Parameters
----------
on
The feature on which to compute the aggregate statistic.
by
The feature by which to group the data.
how
The statistic to compute.
Attributes
----------
groups : collections.defaultdict
Maps group keys to univariate statistics.
feature_name : str
The name of the feature used in the output.
Examples
--------
Consider the following dataset:
>>> X = [
... {'country': 'France', 'place': 'Taco Bell', 'revenue': 42},
... {'country': 'Sweden', 'place': 'Burger King', 'revenue': 16},
... {'country': 'France', 'place': 'Burger King', 'revenue': 24},
... {'country': 'Sweden', 'place': 'Taco Bell', 'revenue': 58},
... {'country': 'Sweden', 'place': 'Burger King', 'revenue': 20},
... {'country': 'France', 'place': 'Taco Bell', 'revenue': 50},
... {'country': 'France', 'place': 'Burger King', 'revenue': 10},
... {'country': 'Sweden', 'place': 'Taco Bell', 'revenue': 80}
... ]
As an example, we can calculate the average (how) revenue (on) for each place (by):
>>> from river import feature_extraction as fx
>>> from river import stats
>>> agg = fx.Agg(
... on='revenue',
... by='place',
... how=stats.Mean()
... )
>>> for x in X:
... agg = agg.learn_one(x)
... print(agg.transform_one(x))
{'revenue_mean_by_place': 42.0}
{'revenue_mean_by_place': 16.0}
{'revenue_mean_by_place': 20.0}
{'revenue_mean_by_place': 50.0}
{'revenue_mean_by_place': 20.0}
{'revenue_mean_by_place': 50.0}
{'revenue_mean_by_place': 17.5}
{'revenue_mean_by_place': 57.5}
You can compute an aggregate over multiple keys by passing a tuple to the `by` argument.
For instance, we can compute the maximum (how) revenue (on) per place as well as per
day (by):
>>> agg = fx.Agg(
... on='revenue',
... by=['place', 'country'],
... how=stats.Max()
... )
>>> for x in X:
... agg = agg.learn_one(x)
... print(agg.transform_one(x))
{'revenue_max_by_place_and_country': 42}
{'revenue_max_by_place_and_country': 16}
{'revenue_max_by_place_and_country': 24}
{'revenue_max_by_place_and_country': 58}
{'revenue_max_by_place_and_country': 20}
{'revenue_max_by_place_and_country': 50}
{'revenue_max_by_place_and_country': 24}
{'revenue_max_by_place_and_country': 80}
You can use a `compose.TransformerUnion` in order to calculate multiple aggregates in one
go. The latter can be constructed by using the `+` operator:
>>> agg = (
... fx.Agg(on='revenue', by='place', how=stats.Mean()) +
... fx.Agg(on='revenue', by=['place', 'country'], how=stats.Max())
... )
>>> import pprint
>>> for x in X:
... agg = agg.learn_one(x)
... pprint.pprint(agg.transform_one(x))
{'revenue_max_by_place_and_country': 42, 'revenue_mean_by_place': 42.0}
{'revenue_max_by_place_and_country': 16, 'revenue_mean_by_place': 16.0}
{'revenue_max_by_place_and_country': 24, 'revenue_mean_by_place': 20.0}
{'revenue_max_by_place_and_country': 58, 'revenue_mean_by_place': 50.0}
{'revenue_max_by_place_and_country': 20, 'revenue_mean_by_place': 20.0}
{'revenue_max_by_place_and_country': 50, 'revenue_mean_by_place': 50.0}
{'revenue_max_by_place_and_country': 24, 'revenue_mean_by_place': 17.5}
{'revenue_max_by_place_and_country': 80, 'revenue_mean_by_place': 57.5}
References
----------
[^1]: [Streaming groupbys in pandas for big datasets](https://maxhalford.github.io/blog/pandas-streaming-groupby/)
"""
def __init__(
self, on: str, by: typing.Union[str, typing.List[str]], how: stats.Univariate
):
self.on = on
self.by = by if isinstance(by, list) else [by]
self.how = how
self.groups = collections.defaultdict(functools.partial(copy.deepcopy, how))
self.feature_name = f'{self.on}_{self.how.name}_by_{"_and_".join(self.by)}'
def _get_key(self, x):
return "_".join(str(x[k]) for k in self.by)
def learn_one(self, x):
self.groups[self._get_key(x)].update(x[self.on])
return self
def transform_one(self, x):
return {self.feature_name: self.groups[self._get_key(x)].get()}
def __str__(self):
return self.feature_name
class TargetAgg(base.SupervisedTransformer):
"""Computes a streaming aggregate of the target values.
This transformer is identical to `feature_extraction.Agg`, the only difference is that it
operates on the target rather than on a feature. At each step, the running statistic `how` of
target values in group `by` is updated with the target. It is therefore a supervised
transformer.
Parameters
----------
by
The feature by which to group the target values.
how
The statistic to compute.
target_name
The target name which is used in the result.
Attributes
----------
groups
Maps group keys to univariate statistics.
feature_name
The name of the feature in the output.
Examples
--------
Consider the following dataset, where the second value of each value is the target:
>>> dataset = [
... ({'country': 'France', 'place': 'Taco Bell'}, 42),
... ({'country': 'Sweden', 'place': 'Burger King'}, 16),
... ({'country': 'France', 'place': 'Burger King'}, 24),
... ({'country': 'Sweden', 'place': 'Taco Bell'}, 58),
... ({'country': 'Sweden', 'place': 'Burger King'}, 20),
... ({'country': 'France', 'place': 'Taco Bell'}, 50),
... ({'country': 'France', 'place': 'Burger King'}, 10),
... ({'country': 'Sweden', 'place': 'Taco Bell'}, 80)
... ]
As an example, let's perform a target encoding of the `place` feature. Instead of simply
updating a running average, we use a `stats.BayesianMean` which allows us to incorporate
some prior knowledge. This makes subsequent models less prone to overfitting. Indeed, it
dampens the fact that too few samples might have been seen within a group.
>>> from river import feature_extraction
>>> from river import stats
>>> agg = feature_extraction.TargetAgg(
... by='place',
... how=stats.BayesianMean(
... prior=3,
... prior_weight=1
... )
... )
>>> for x, y in dataset:
... print(agg.transform_one(x))
... agg = agg.learn_one(x, y)
{'target_bayes_mean_by_place': 3.0}
{'target_bayes_mean_by_place': 3.0}
{'target_bayes_mean_by_place': 9.5}
{'target_bayes_mean_by_place': 22.5}
{'target_bayes_mean_by_place': 14.333}
{'target_bayes_mean_by_place': 34.333}
{'target_bayes_mean_by_place': 15.75}
{'target_bayes_mean_by_place': 38.25}
Just like with `feature_extraction.Agg`, we can specify multiple features on which to
group the data:
>>> agg = feature_extraction.TargetAgg(
... by=['place', 'country'],
... how=stats.BayesianMean(
... prior=3,
... prior_weight=1
... )
... )
>>> for x, y in dataset:
... print(agg.transform_one(x))
... agg = agg.learn_one(x, y)
{'target_bayes_mean_by_place_and_country': 3.0}
{'target_bayes_mean_by_place_and_country': 3.0}
{'target_bayes_mean_by_place_and_country': 3.0}
{'target_bayes_mean_by_place_and_country': 3.0}
{'target_bayes_mean_by_place_and_country': 9.5}
{'target_bayes_mean_by_place_and_country': 22.5}
{'target_bayes_mean_by_place_and_country': 13.5}
{'target_bayes_mean_by_place_and_country': 30.5}
References
----------
1. [Streaming groupbys in pandas for big datasets](https://maxhalford.github.io/blog/streaming-groupbys-in-pandas-for-big-datasets/)
"""
def __init__(
self,
by: typing.Union[str, typing.List[str]],
how: stats.Univariate,
target_name="target",
):
self.by = by if isinstance(by, list) else [by]
self.how = how
self.target_name = target_name
self.groups = collections.defaultdict(functools.partial(copy.deepcopy, how))
self.feature_name = f'{target_name}_{how.name}_by_{"_and_".join(self.by)}'
def _get_key(self, x):
return "_".join(str(x[k]) for k in self.by)
def learn_one(self, x, y):
self.groups[self._get_key(x)].update(y)
return self
def transform_one(self, x):
return {self.feature_name: self.groups[self._get_key(x)].get()}
def __str__(self):
return self.feature_name
| 35.164234 | 136 | 0.628127 | 1,316 | 9,635 | 4.379179 | 0.177052 | 0.065591 | 0.061079 | 0.070796 | 0.673955 | 0.619122 | 0.487593 | 0.443693 | 0.363005 | 0.359188 | 0 | 0.02207 | 0.228749 | 9,635 | 273 | 137 | 35.29304 | 0.753465 | 0.747483 | 0 | 0.533333 | 0 | 0.022222 | 0.071595 | 0.059953 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.111111 | 0.133333 | 0.555556 | 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 | 0 | 1 | 1 | 0 | 0 | 3 |
c4e884d6a217216411210ac48f2cb0f0b305fe63 | 873 | py | Python | audionmf/util/nmf_util.py | argoneuscze/AudioNMF | 04f360653bb0df3d5ed19bf2eb1459bff16a944c | [
"MIT"
] | null | null | null | audionmf/util/nmf_util.py | argoneuscze/AudioNMF | 04f360653bb0df3d5ed19bf2eb1459bff16a944c | [
"MIT"
] | null | null | null | audionmf/util/nmf_util.py | argoneuscze/AudioNMF | 04f360653bb0df3d5ed19bf2eb1459bff16a944c | [
"MIT"
] | null | null | null | import numpy
from audionmf.transforms.nmf import NMF
def nmf_matrix(matrix, max_iter=100, rank=30):
# increment the matrix to make sure it's positive
matrix_inc, min_val = increment_by_min(matrix)
# TODO save
# use Kullback-Leibler divergence
# nmf = nimfa.Nmf(matrix_inc, max_iter=max_iter, rank=rank, objective='div', update='divergence')()
# W = nmf.basis()
# H = nmf.coef()
# calculate NMF
nmf = NMF(matrix_inc, max_iter=max_iter, rank=rank)
W, H = nmf.factorize()
return W, H, min_val
def nmf_matrix_original(W, H, min_val):
# get the original matrix
matrix = numpy.matmul(W, H) - min_val
return matrix
def increment_by_min(matrix):
# increments matrix by its lowest value and returns the structure and the absolute value
min_val = abs(numpy.amin(matrix))
return matrix + min_val, min_val
| 25.676471 | 103 | 0.691867 | 134 | 873 | 4.343284 | 0.410448 | 0.072165 | 0.025773 | 0.041237 | 0.116838 | 0.116838 | 0.116838 | 0.116838 | 0.116838 | 0 | 0 | 0.007246 | 0.209622 | 873 | 33 | 104 | 26.454545 | 0.836232 | 0.392898 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.030303 | 0 | 1 | 0.230769 | false | 0 | 0.153846 | 0 | 0.615385 | 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 | 0 | 1 | 0 | 0 | 3 |
1ef20c616def04d76372ae4b816973344a22f228 | 1,203 | py | Python | tests/exp_test.py | Na2CuCl4/latex2sympy | 40f3b16ad13f8ab12d7704bb422cf8580b45b380 | [
"MIT"
] | 26 | 2021-05-12T09:48:28.000Z | 2022-03-31T08:33:57.000Z | tests/exp_test.py | Na2CuCl4/latex2sympy | 40f3b16ad13f8ab12d7704bb422cf8580b45b380 | [
"MIT"
] | null | null | null | tests/exp_test.py | Na2CuCl4/latex2sympy | 40f3b16ad13f8ab12d7704bb422cf8580b45b380 | [
"MIT"
] | 3 | 2021-10-09T03:16:53.000Z | 2022-02-18T13:23:40.000Z | from .context import assert_equal
import pytest
from sympy import exp, sin, Symbol, E
x = Symbol('x', real=True)
y = Symbol('y', real=True)
def test_exp_letter():
assert_equal("e", E)
assert_equal("e", exp(1))
def test_exp_func():
assert_equal("\\exp(3)", exp(3))
def test_exp_func_no_delim():
assert_equal("\\exp3", exp(3))
def test_exp_command_symbol():
assert_equal("\\exponentialE", E)
assert_equal("\\exponentialE", exp(1))
def test_exp_command_symbol_expression():
assert_equal("\\exponentialE^{3}", exp(3))
def test_exp_command_symbol_multiplied():
'''
\\exponentialE is NOT a function, so using the following notation equates to multiplication
'''
assert_equal("\\exponentialE (3)", E * 3)
assert_equal("\\exponentialE \\left( 3\\right)", E * 3)
assert_equal("\\exponentialE \\times 3", E * 3)
def test_exp_numeric():
assert_equal("e^3", exp(3))
def test_exp_symbol():
assert_equal("e^x", exp(x))
def test_exp_symbol_expr():
assert_equal("e^{x+y}", exp(x + y))
def test_exp_symbol_expr_group():
assert_equal("e^{(x+y)}", exp(x + y))
def test_exp_expr():
assert_equal("\\sin(x)*e^x", sin(x) * exp(x))
| 20.741379 | 95 | 0.657523 | 185 | 1,203 | 4.016216 | 0.248649 | 0.236878 | 0.148048 | 0.074024 | 0.355316 | 0.192463 | 0.15074 | 0.078062 | 0.078062 | 0.078062 | 0 | 0.015952 | 0.166251 | 1,203 | 57 | 96 | 21.105263 | 0.724826 | 0.074813 | 0 | 0 | 0 | 0 | 0.156934 | 0 | 0 | 0 | 0 | 0 | 0.516129 | 1 | 0.354839 | false | 0 | 0.096774 | 0 | 0.451613 | 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 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
1ef36cbeff54a3029d59b7978e1ede454a9c1799 | 175 | py | Python | src/colors.py | 0xbadd/breakout | 0d53163995acbeb2333bf1468d0dee92f6bf5513 | [
"Unlicense"
] | null | null | null | src/colors.py | 0xbadd/breakout | 0d53163995acbeb2333bf1468d0dee92f6bf5513 | [
"Unlicense"
] | null | null | null | src/colors.py | 0xbadd/breakout | 0d53163995acbeb2333bf1468d0dee92f6bf5513 | [
"Unlicense"
] | null | null | null | BLACK = (0, 0, 0)
GREY = (142, 142, 142)
RED = (200, 72, 72)
ORANGE = (198, 108, 58)
BROWN = (180, 122, 48)
YELLOW = (162, 162, 42)
GREEN = (72, 160, 72)
BLUE = (66, 72, 200)
| 19.444444 | 23 | 0.542857 | 32 | 175 | 2.96875 | 0.6875 | 0.042105 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.422222 | 0.228571 | 175 | 8 | 24 | 21.875 | 0.281481 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
1efefd4f6361c8e325f5e923e953554970c39738 | 177 | py | Python | Python/generator/nextp2p3.py | afcarl/algorithms--MartinThoma | 722426dbc8ed709486134e1989cba353046fb8d7 | [
"MIT"
] | null | null | null | Python/generator/nextp2p3.py | afcarl/algorithms--MartinThoma | 722426dbc8ed709486134e1989cba353046fb8d7 | [
"MIT"
] | null | null | null | Python/generator/nextp2p3.py | afcarl/algorithms--MartinThoma | 722426dbc8ed709486134e1989cba353046fb8d7 | [
"MIT"
] | 1 | 2019-02-20T08:51:34.000Z | 2019-02-20T08:51:34.000Z | #!/usr/bin/env python
def square_gen(is_true):
i = 0
while True:
yield i**2
i += 1
g = square_gen(False)
print(next(g))
print(next(g))
print(next(g))
| 12.642857 | 24 | 0.570621 | 31 | 177 | 3.16129 | 0.612903 | 0.27551 | 0.306122 | 0.306122 | 0.306122 | 0.306122 | 0 | 0 | 0 | 0 | 0 | 0.023077 | 0.265537 | 177 | 13 | 25 | 13.615385 | 0.730769 | 0.112994 | 0 | 0.333333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0 | 0 | 0 | 0.111111 | 0.333333 | 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 | 0 | 0 | 3 |
4805b2a4a707c70ee9becd4fb197585c4ce2aeb2 | 44 | py | Python | app/meta.py | Ayushk4/MedImaging | dbc8968f076385be0c8db42210817ae0940fa26a | [
"MIT"
] | null | null | null | app/meta.py | Ayushk4/MedImaging | dbc8968f076385be0c8db42210817ae0940fa26a | [
"MIT"
] | null | null | null | app/meta.py | Ayushk4/MedImaging | dbc8968f076385be0c8db42210817ae0940fa26a | [
"MIT"
] | null | null | null | INFO = u"""
## Prompt Engineers
""".strip()
| 11 | 19 | 0.568182 | 5 | 44 | 5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.159091 | 44 | 3 | 20 | 14.666667 | 0.675676 | 0 | 0 | 0 | 0 | 0 | 0.477273 | 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 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
480b44f70f23bf1868452261f70327b3e21d8579 | 565 | py | Python | deprecated/InitializeDiffusionRates.py | PellelNitram/corona_contact_tracing | df5a6ba18b84397b721893fb5eb89889dc82ab2f | [
"MIT"
] | 6 | 2020-03-21T20:44:54.000Z | 2020-05-14T05:32:49.000Z | deprecated/InitializeDiffusionRates.py | PellelNitram/corona_contact_tracing | df5a6ba18b84397b721893fb5eb89889dc82ab2f | [
"MIT"
] | null | null | null | deprecated/InitializeDiffusionRates.py | PellelNitram/corona_contact_tracing | df5a6ba18b84397b721893fb5eb89889dc82ab2f | [
"MIT"
] | 2 | 2020-03-22T15:37:41.000Z | 2020-03-31T10:11:24.000Z | # Generated with SMOP 0.41
from libsmop import *
# InitializeDiffusionRates.m
@function
def InitializeDiffusionRates(numberOfAgents=None,*args,**kwargs):
varargin = InitializeDiffusionRates.varargin
nargin = InitializeDiffusionRates.nargin
p=6
# InitializeDiffusionRates.m:3
xmin=0
# InitializeDiffusionRates.m:4
xmax=1
# InitializeDiffusionRates.m:5
diffusionRates=xmin + dot((xmax - xmin),sum(rand(numberOfAgents,p),2)) / p
# InitializeDiffusionRates.m:6
return diffusionRates
if __name__ == '__main__':
pass
| 23.541667 | 78 | 0.729204 | 58 | 565 | 6.965517 | 0.62069 | 0.309406 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.023605 | 0.175221 | 565 | 24 | 79 | 23.541667 | 0.843348 | 0.297345 | 0 | 0 | 1 | 0 | 0.02046 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.083333 | false | 0.083333 | 0.083333 | 0 | 0.25 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
48116a0807b8e61c84f25bf15d79eed0243f4998 | 63 | py | Python | airbyte-integrations/connectors/source-recurly/source_recurly/__init__.py | rajatariya21/airbyte | 11e70a7a96e2682b479afbe6f709b9a5fe9c4a8d | [
"MIT"
] | 6,215 | 2020-09-21T13:45:56.000Z | 2022-03-31T21:21:45.000Z | airbyte-integrations/connectors/source-recurly/source_recurly/__init__.py | rajatariya21/airbyte | 11e70a7a96e2682b479afbe6f709b9a5fe9c4a8d | [
"MIT"
] | 8,448 | 2020-09-21T00:43:50.000Z | 2022-03-31T23:56:06.000Z | airbyte-integrations/connectors/source-recurly/source_recurly/__init__.py | rajatariya21/airbyte | 11e70a7a96e2682b479afbe6f709b9a5fe9c4a8d | [
"MIT"
] | 1,251 | 2020-09-20T05:48:47.000Z | 2022-03-31T10:41:29.000Z | from .source import SourceRecurly
__all__ = ["SourceRecurly"]
| 15.75 | 33 | 0.777778 | 6 | 63 | 7.5 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.126984 | 63 | 3 | 34 | 21 | 0.818182 | 0 | 0 | 0 | 0 | 0 | 0.206349 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
481f5560a464a8b0a0888473d5a20c7b3809fe88 | 15,829 | py | Python | custom/softsplat/softmax_splatting.py | maylilyo/wd60 | 638a8eaca598def1adea06d1221fc08ca63b06fe | [
"MIT"
] | null | null | null | custom/softsplat/softmax_splatting.py | maylilyo/wd60 | 638a8eaca598def1adea06d1221fc08ca63b06fe | [
"MIT"
] | null | null | null | custom/softsplat/softmax_splatting.py | maylilyo/wd60 | 638a8eaca598def1adea06d1221fc08ca63b06fe | [
"MIT"
] | null | null | null | # Standard
import re
# PIP
import cupy
import torch
kernel_Softsplat_updateOutput = """
extern "C" __global__ void kernel_Softsplat_updateOutput(
const int n,
const float* input,
const float* flow,
float* output
) { for (int intIndex = (blockIdx.x * blockDim.x) + threadIdx.x; intIndex < n; intIndex += blockDim.x * gridDim.x) {
const int intN = ( intIndex / SIZE_3(output) / SIZE_2(output) / SIZE_1(output) ) % SIZE_0(output);
const int intC = ( intIndex / SIZE_3(output) / SIZE_2(output) ) % SIZE_1(output);
const int intY = ( intIndex / SIZE_3(output) ) % SIZE_2(output);
const int intX = ( intIndex ) % SIZE_3(output);
float fltOutputX = (float) (intX) + VALUE_4(flow, intN, 0, intY, intX);
float fltOutputY = (float) (intY) + VALUE_4(flow, intN, 1, intY, intX);
int intNorthwestX = (int) (floor(fltOutputX));
int intNorthwestY = (int) (floor(fltOutputY));
int intNortheastX = intNorthwestX + 1;
int intNortheastY = intNorthwestY;
int intSouthwestX = intNorthwestX;
int intSouthwestY = intNorthwestY + 1;
int intSoutheastX = intNorthwestX + 1;
int intSoutheastY = intNorthwestY + 1;
float fltNorthwest = ((float) (intSoutheastX) - fltOutputX ) * ((float) (intSoutheastY) - fltOutputY );
float fltNortheast = (fltOutputX - (float) (intSouthwestX)) * ((float) (intSouthwestY) - fltOutputY );
float fltSouthwest = ((float) (intNortheastX) - fltOutputX ) * (fltOutputY - (float) (intNortheastY));
float fltSoutheast = (fltOutputX - (float) (intNorthwestX)) * (fltOutputY - (float) (intNorthwestY));
if ((intNorthwestX >= 0) & (intNorthwestX < SIZE_3(output)) & (intNorthwestY >= 0) & (intNorthwestY < SIZE_2(output))) {
atomicAdd(&output[OFFSET_4(output, intN, intC, intNorthwestY, intNorthwestX)], VALUE_4(input, intN, intC, intY, intX) * fltNorthwest);
}
if ((intNortheastX >= 0) & (intNortheastX < SIZE_3(output)) & (intNortheastY >= 0) & (intNortheastY < SIZE_2(output))) {
atomicAdd(&output[OFFSET_4(output, intN, intC, intNortheastY, intNortheastX)], VALUE_4(input, intN, intC, intY, intX) * fltNortheast);
}
if ((intSouthwestX >= 0) & (intSouthwestX < SIZE_3(output)) & (intSouthwestY >= 0) & (intSouthwestY < SIZE_2(output))) {
atomicAdd(&output[OFFSET_4(output, intN, intC, intSouthwestY, intSouthwestX)], VALUE_4(input, intN, intC, intY, intX) * fltSouthwest);
}
if ((intSoutheastX >= 0) & (intSoutheastX < SIZE_3(output)) & (intSoutheastY >= 0) & (intSoutheastY < SIZE_2(output))) {
atomicAdd(&output[OFFSET_4(output, intN, intC, intSoutheastY, intSoutheastX)], VALUE_4(input, intN, intC, intY, intX) * fltSoutheast);
}
} }
"""
kernel_Softsplat_updateGradInput = """
extern "C" __global__ void kernel_Softsplat_updateGradInput(
const int n,
const float* input,
const float* flow,
const float* grad_output,
float* grad_input,
float* grad_flow
) { for (int intIndex = (blockIdx.x * blockDim.x) + threadIdx.x; intIndex < n; intIndex += blockDim.x * gridDim.x) {
const int intN = ( intIndex / SIZE_3(grad_input) / SIZE_2(grad_input) / SIZE_1(grad_input) ) % SIZE_0(grad_input);
const int intC = ( intIndex / SIZE_3(grad_input) / SIZE_2(grad_input) ) % SIZE_1(grad_input);
const int intY = ( intIndex / SIZE_3(grad_input) ) % SIZE_2(grad_input);
const int intX = ( intIndex ) % SIZE_3(grad_input);
float fltGradInput = 0.0;
float fltOutputX = (float) (intX) + VALUE_4(flow, intN, 0, intY, intX);
float fltOutputY = (float) (intY) + VALUE_4(flow, intN, 1, intY, intX);
int intNorthwestX = (int) (floor(fltOutputX));
int intNorthwestY = (int) (floor(fltOutputY));
int intNortheastX = intNorthwestX + 1;
int intNortheastY = intNorthwestY;
int intSouthwestX = intNorthwestX;
int intSouthwestY = intNorthwestY + 1;
int intSoutheastX = intNorthwestX + 1;
int intSoutheastY = intNorthwestY + 1;
float fltNorthwest = ((float) (intSoutheastX) - fltOutputX ) * ((float) (intSoutheastY) - fltOutputY );
float fltNortheast = (fltOutputX - (float) (intSouthwestX)) * ((float) (intSouthwestY) - fltOutputY );
float fltSouthwest = ((float) (intNortheastX) - fltOutputX ) * (fltOutputY - (float) (intNortheastY));
float fltSoutheast = (fltOutputX - (float) (intNorthwestX)) * (fltOutputY - (float) (intNorthwestY));
if ((intNorthwestX >= 0) & (intNorthwestX < SIZE_3(grad_output)) & (intNorthwestY >= 0) & (intNorthwestY < SIZE_2(grad_output))) {
fltGradInput += VALUE_4(grad_output, intN, intC, intNorthwestY, intNorthwestX) * fltNorthwest;
}
if ((intNortheastX >= 0) & (intNortheastX < SIZE_3(grad_output)) & (intNortheastY >= 0) & (intNortheastY < SIZE_2(grad_output))) {
fltGradInput += VALUE_4(grad_output, intN, intC, intNortheastY, intNortheastX) * fltNortheast;
}
if ((intSouthwestX >= 0) & (intSouthwestX < SIZE_3(grad_output)) & (intSouthwestY >= 0) & (intSouthwestY < SIZE_2(grad_output))) {
fltGradInput += VALUE_4(grad_output, intN, intC, intSouthwestY, intSouthwestX) * fltSouthwest;
}
if ((intSoutheastX >= 0) & (intSoutheastX < SIZE_3(grad_output)) & (intSoutheastY >= 0) & (intSoutheastY < SIZE_2(grad_output))) {
fltGradInput += VALUE_4(grad_output, intN, intC, intSoutheastY, intSoutheastX) * fltSoutheast;
}
grad_input[intIndex] = fltGradInput;
} }
"""
kernel_Softsplat_updateGradFlow = """
extern "C" __global__ void kernel_Softsplat_updateGradFlow(
const int n,
const float* input,
const float* flow,
const float* grad_output,
float* grad_input,
float* grad_flow
) { for (int intIndex = (blockIdx.x * blockDim.x) + threadIdx.x; intIndex < n; intIndex += blockDim.x * gridDim.x) {
float fltGradFlow = 0.0;
const int intN = ( intIndex / SIZE_3(grad_flow) / SIZE_2(grad_flow) / SIZE_1(grad_flow) ) % SIZE_0(grad_flow);
const int intC = ( intIndex / SIZE_3(grad_flow) / SIZE_2(grad_flow) ) % SIZE_1(grad_flow);
const int intY = ( intIndex / SIZE_3(grad_flow) ) % SIZE_2(grad_flow);
const int intX = ( intIndex ) % SIZE_3(grad_flow);
float fltOutputX = (float) (intX) + VALUE_4(flow, intN, 0, intY, intX);
float fltOutputY = (float) (intY) + VALUE_4(flow, intN, 1, intY, intX);
int intNorthwestX = (int) (floor(fltOutputX));
int intNorthwestY = (int) (floor(fltOutputY));
int intNortheastX = intNorthwestX + 1;
int intNortheastY = intNorthwestY;
int intSouthwestX = intNorthwestX;
int intSouthwestY = intNorthwestY + 1;
int intSoutheastX = intNorthwestX + 1;
int intSoutheastY = intNorthwestY + 1;
float fltNorthwest = 0.0;
float fltNortheast = 0.0;
float fltSouthwest = 0.0;
float fltSoutheast = 0.0;
if (intC == 0) {
fltNorthwest = ((float) (-1.0)) * ((float) (intSoutheastY) - fltOutputY );
fltNortheast = ((float) (+1.0)) * ((float) (intSouthwestY) - fltOutputY );
fltSouthwest = ((float) (-1.0)) * (fltOutputY - (float) (intNortheastY));
fltSoutheast = ((float) (+1.0)) * (fltOutputY - (float) (intNorthwestY));
} else if (intC == 1) {
fltNorthwest = ((float) (intSoutheastX) - fltOutputX ) * ((float) (-1.0));
fltNortheast = (fltOutputX - (float) (intSouthwestX)) * ((float) (-1.0));
fltSouthwest = ((float) (intNortheastX) - fltOutputX ) * ((float) (+1.0));
fltSoutheast = (fltOutputX - (float) (intNorthwestX)) * ((float) (+1.0));
}
for (int intChannel = 0; intChannel < SIZE_1(grad_output); intChannel += 1) {
float fltInput = VALUE_4(input, intN, intChannel, intY, intX);
if ((intNorthwestX >= 0) & (intNorthwestX < SIZE_3(grad_output)) & (intNorthwestY >= 0) & (intNorthwestY < SIZE_2(grad_output))) {
fltGradFlow += fltInput * VALUE_4(grad_output, intN, intChannel, intNorthwestY, intNorthwestX) * fltNorthwest;
}
if ((intNortheastX >= 0) & (intNortheastX < SIZE_3(grad_output)) & (intNortheastY >= 0) & (intNortheastY < SIZE_2(grad_output))) {
fltGradFlow += fltInput * VALUE_4(grad_output, intN, intChannel, intNortheastY, intNortheastX) * fltNortheast;
}
if ((intSouthwestX >= 0) & (intSouthwestX < SIZE_3(grad_output)) & (intSouthwestY >= 0) & (intSouthwestY < SIZE_2(grad_output))) {
fltGradFlow += fltInput * VALUE_4(grad_output, intN, intChannel, intSouthwestY, intSouthwestX) * fltSouthwest;
}
if ((intSoutheastX >= 0) & (intSoutheastX < SIZE_3(grad_output)) & (intSoutheastY >= 0) & (intSoutheastY < SIZE_2(grad_output))) {
fltGradFlow += fltInput * VALUE_4(grad_output, intN, intChannel, intSoutheastY, intSoutheastX) * fltSoutheast;
}
}
grad_flow[intIndex] = fltGradFlow;
} }
"""
def cupy_kernel(func_name, var_object):
kernel_name = globals()[func_name]
while True:
match_object = re.search("(SIZE_)([0-4])(\()([^\)]*)(\))", kernel_name)
if match_object is None:
break
tensor_name = match_object.group(4)
size_list = var_object[tensor_name].size()
index = int(match_object.group(2))
kernel_name = kernel_name.replace(match_object.group(), str(size_list[index]))
while True:
match_object = re.search("(OFFSET_)([0-4])(\()([^\)]+)(\))", kernel_name)
if match_object is None:
break
num_args = int(match_object.group(2))
args_list = match_object.group(4).split(",")
tensor_name = args_list[0]
stride_list = var_object[tensor_name].stride()
index_list = []
for index in range(num_args):
tmp = args_list[index + 1].replace("{", "(").replace("}", ")").strip()
tmp = f"(({tmp})*{stride_list[index]})"
index_list.append(tmp)
kernel_name = kernel_name.replace(match_object.group(0), f'({"+".join(index_list)})')
while True:
match_object = re.search("(VALUE_)([0-4])(\()([^\)]+)(\))", kernel_name)
if match_object is None:
break
num_args = int(match_object.group(2))
args_list = match_object.group(4).split(",")
tensor_name = args_list[0]
stride_list = var_object[tensor_name].stride()
index_list = []
for index in range(num_args):
tmp = args_list[index + 1].replace("{", "(").replace("}", ")").strip()
tmp = f"(({tmp})*{stride_list[index]})"
index_list.append(tmp)
kernel_name = kernel_name.replace(match_object.group(0), tensor_name + f'[{"+".join(index_list)}]')
return kernel_name
@cupy.memoize(for_each_device=True)
def cupy_launch(func_name, kernel_name):
return cupy.cuda.compile_with_cache(kernel_name).get_function(func_name)
class SoftSplatFunc(torch.autograd.Function):
@staticmethod
def forward(self, input, flow):
self.save_for_backward(input, flow)
[num_samples, input_depth, input_height, input_width] = input.shape
flow_depth, flow_height, flow_width = (
flow.shape[1],
flow.shape[2],
flow.shape[3],
)
assert flow_depth == 2
assert input_height == flow_height
assert input_width == flow_width
assert input.is_contiguous()
assert flow.is_contiguous()
output = input.new_zeros([num_samples, input_depth, input_height, input_width])
n = output.nelement()
cupy_launch("kernel_Softsplat_updateOutput", cupy_kernel("kernel_Softsplat_updateOutput", {"input": input, "flow": flow, "output": output},),)(
grid=tuple([int((n + 512 - 1) / 512), 1, 1]),
block=tuple([512, 1, 1]),
args=[n, input.data_ptr(), flow.data_ptr(), output.data_ptr()],
)
return output
@staticmethod
def backward(self, grad_output):
input, flow = self.saved_tensors
[num_samples, input_depth, input_height, input_width] = input.shape
flow_depth, flow_height, flow_width = (
flow.shape[1],
flow.shape[2],
flow.shape[3],
)
assert flow_depth == 2
assert input_height == flow_height
assert input_width == flow_width
assert grad_output.is_contiguous()
if self.needs_input_grad[0]:
grad_input = input.new_zeros([num_samples, input_depth, input_height, input_width])
else:
grad_input = None
if self.needs_input_grad[1]:
grad_flow = input.new_zeros([num_samples, flow_depth, flow_height, flow_width])
else:
grad_flow = None
if grad_input is not None:
n = grad_input.nelement()
cupy_launch(
"kernel_Softsplat_updateGradInput",
cupy_kernel(
"kernel_Softsplat_updateGradInput",
{
"input": input,
"flow": flow,
"grad_output": grad_output,
"grad_input": grad_input,
"grad_flow": grad_flow,
},
),
)(
grid=tuple([int((n + 512 - 1) / 512), 1, 1]),
block=tuple([512, 1, 1]),
args=[
n,
input.data_ptr(),
flow.data_ptr(),
grad_output.data_ptr(),
grad_input.data_ptr(),
None,
],
)
if grad_flow is not None:
n = grad_flow.nelement()
cupy_launch(
"kernel_Softsplat_updateGradFlow",
cupy_kernel(
"kernel_Softsplat_updateGradFlow",
{
"input": input,
"flow": flow,
"grad_output": grad_output,
"grad_input": grad_input,
"grad_flow": grad_flow,
},
),
)(
grid=tuple([int((n + 512 - 1) / 512), 1, 1]),
block=tuple([512, 1, 1]),
args=[
n,
input.data_ptr(),
flow.data_ptr(),
grad_output.data_ptr(),
None,
grad_flow.data_ptr(),
],
)
return grad_input, grad_flow
def softmax_splatting(input, flow, metric):
assert metric is None or metric.shape[1] == 1
# https://github.com/sniklaus/softmax-splatting/issues/38
metric = metric.clip(None, 20.0).exp()
input = torch.cat([input * metric, metric], dim=1)
out = SoftSplatFunc.apply(input, flow)
normalize = out[:, -1:, :, :]
normalize[normalize == 0.0] = 1.0
out = out[:, :-1, :, :] / normalize
return out
| 43.13079 | 151 | 0.568766 | 1,632 | 15,829 | 5.310049 | 0.092525 | 0.040388 | 0.016617 | 0.015694 | 0.774983 | 0.716594 | 0.671706 | 0.62624 | 0.621279 | 0.608816 | 0 | 0.021392 | 0.303051 | 15,829 | 366 | 152 | 43.248634 | 0.764141 | 0.004296 | 0 | 0.548276 | 0 | 0.134483 | 0.63521 | 0.049756 | 0 | 0 | 0 | 0 | 0.034483 | 1 | 0.017241 | false | 0 | 0.010345 | 0.003448 | 0.048276 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
4832e390b7b44c9fe436c8cbff80fb81fae2706b | 2,698 | py | Python | gui/main_window/docks/properties/property_widgets/solver_info.py | anglebinbin/Barista-tool | 2d51507fb3566881923f0b273127f59d23ed317f | [
"MIT"
] | 1 | 2020-02-11T19:05:17.000Z | 2020-02-11T19:05:17.000Z | gui/main_window/docks/properties/property_widgets/solver_info.py | anglebinbin/Barista-tool | 2d51507fb3566881923f0b273127f59d23ed317f | [
"MIT"
] | null | null | null | gui/main_window/docks/properties/property_widgets/solver_info.py | anglebinbin/Barista-tool | 2d51507fb3566881923f0b273127f59d23ed317f | [
"MIT"
] | null | null | null | import backend.caffe.proto_info as info
from gui.main_window.docks.properties.property_widgets import data
from gui.main_window.docks.properties.property_widgets import layer_info
from gui.main_window.docks.properties.property_widgets.types import *
class SolverPropertyInfoBuilder(data.PropertyInfoBuilder):
""" Builds info docks for the solver part of the state dictionary """
def buildInfo(self, name, protoparameter, uri=None):
if uri == []:
return SolverRootInfo(name, protoparameter)
return PropertyInfo(name, protoparameter, uri)
def buildRootInfo(self, name=""):
""" Builds "solver" info object of the state dictionary """
from backend.caffe.path_loader import PathLoader
proto = PathLoader().importProto()
protosolver = proto.SolverParameter()
descr = info.ParameterGroupDescriptor(protosolver)
params = descr.parameter().copy()
return self.buildInfo(name,params, [])
class SolverRootInfo(data.PropertyInfo):
""" Represent the info about the parameters of a solver"""
def __init__(self, name, params):
self._name = name
self.params = params
def typeEntryString(self):
return self.typeString()
def typeString(self):
return GroupType
def enumOptions(self):
return []
def name(self):
return self._name
def deprecated(self):
return False
def description(self):
return ""
def prototype(self):
return {}
def subparameter(self):
""" Returns the subparameter of an entry in this dictionary (the layer id subparemter = "parameters","type")"""
return self.params
def isEditable(self):
return True
def isRequired(self):
return True
class PropertyInfo(layer_info.PropertyInfo):
def __init__(self, name, meta, uri):
super(PropertyInfo,self).__init__(name,meta,uri)
def isEditable(self):
uri = self.uri
if uri and len(uri) > 0:
if uri in [["net"], ["net_param"]]: return False
return True
def isRequired(self):
uri = self.uri
if uri and len(uri) > 0:
if uri in [["net"]]: return True
return False
def typeString(self):
if self.uri == ["type"]:
return EnumType
return super(PropertyInfo, self).typeString()
def enumOptions(self):
if self.uri == ["type"]:
return info.CaffeMetaInformation().availableSolverTypes()
return super(PropertyInfo, self).enumOptions()
def subparameter(self):
params = super(PropertyInfo,self).subparameter() #type: dict
return params
| 29.977778 | 119 | 0.647517 | 300 | 2,698 | 5.74 | 0.293333 | 0.052265 | 0.04878 | 0.029617 | 0.194541 | 0.165505 | 0.138792 | 0.138792 | 0.138792 | 0.045296 | 0 | 0.000991 | 0.252039 | 2,698 | 89 | 120 | 30.314607 | 0.852329 | 0.104893 | 0 | 0.328125 | 0 | 0 | 0.009623 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.296875 | false | 0 | 0.09375 | 0.140625 | 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 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
485f4ddaaca219491ad3fce420fa20cacae156a1 | 337 | py | Python | sandbox/grist/functions/__init__.py | combinatorist/grist-core | 9a6369a4ff2ebe9f0ad477cd43b90fb2b8341b36 | [
"Apache-2.0"
] | null | null | null | sandbox/grist/functions/__init__.py | combinatorist/grist-core | 9a6369a4ff2ebe9f0ad477cd43b90fb2b8341b36 | [
"Apache-2.0"
] | null | null | null | sandbox/grist/functions/__init__.py | combinatorist/grist-core | 9a6369a4ff2ebe9f0ad477cd43b90fb2b8341b36 | [
"Apache-2.0"
] | null | null | null | # pylint: disable=wildcard-import
from date import *
from info import *
from logical import *
from lookup import *
from math import *
from stats import *
from text import *
from schedule import *
# Export all uppercase names, for use with `from functions import *`.
__all__ = [k for k in dir() if not k.startswith('_') and k.isupper()]
| 25.923077 | 69 | 0.72997 | 51 | 337 | 4.72549 | 0.568627 | 0.33195 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.178042 | 337 | 12 | 70 | 28.083333 | 0.870036 | 0.293769 | 0 | 0 | 0 | 0 | 0.004255 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.888889 | 0 | 0.888889 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
487228d751544331edc579181b5aa56b6a46c803 | 142 | py | Python | src/chatapp/urls.py | omkumar01/major-project | 57dc229a17c7783142d0270f52181883f5b8a7f0 | [
"MIT"
] | null | null | null | src/chatapp/urls.py | omkumar01/major-project | 57dc229a17c7783142d0270f52181883f5b8a7f0 | [
"MIT"
] | null | null | null | src/chatapp/urls.py | omkumar01/major-project | 57dc229a17c7783142d0270f52181883f5b8a7f0 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.urls import path
from .views import ChatApp
urlpatterns = [
path("", ChatApp.as_view()),
]
| 15.777778 | 32 | 0.725352 | 19 | 142 | 5.368421 | 0.631579 | 0.196078 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.169014 | 142 | 8 | 33 | 17.75 | 0.864407 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
487ebc59b3affebaa31f243f3897cf2905cf8bd9 | 171 | py | Python | problem0545.py | kmarcini/Project-Euler-Python | d644e8e1ec4fac70a9ab407ad5e1f0a75547c8d3 | [
"BSD-3-Clause"
] | null | null | null | problem0545.py | kmarcini/Project-Euler-Python | d644e8e1ec4fac70a9ab407ad5e1f0a75547c8d3 | [
"BSD-3-Clause"
] | null | null | null | problem0545.py | kmarcini/Project-Euler-Python | d644e8e1ec4fac70a9ab407ad5e1f0a75547c8d3 | [
"BSD-3-Clause"
] | null | null | null | ###########################
#
# #545 Faulhaber's Formulas - Project Euler
# https://projecteuler.net/problem=545
#
# Code by Kevin Marciniak
#
###########################
| 19 | 43 | 0.48538 | 15 | 171 | 5.533333 | 0.933333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.039474 | 0.111111 | 171 | 8 | 44 | 21.375 | 0.506579 | 0.590643 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
6f8f75dd24e500db247d93ca94f679c34878442f | 467 | py | Python | tests/test_storage_alibaba.py | Accelize/apyfal | 22dfe791e0956d3d3353daeba0c7a21dfe2f9b77 | [
"Apache-2.0"
] | 5 | 2018-09-23T23:15:06.000Z | 2019-07-04T00:19:44.000Z | tests/test_storage_alibaba.py | Accelize/apyfal | 22dfe791e0956d3d3353daeba0c7a21dfe2f9b77 | [
"Apache-2.0"
] | null | null | null | tests/test_storage_alibaba.py | Accelize/apyfal | 22dfe791e0956d3d3353daeba0c7a21dfe2f9b77 | [
"Apache-2.0"
] | 4 | 2018-07-17T08:39:41.000Z | 2020-01-10T23:15:38.000Z | # coding=utf-8
"""apyfal.storage.oss tests"""
import pytest
from tests.test_storage import (
run_full_real_test_sequence, import_from_generic_test)
def test_ossclass_import():
"""OSSStorage import"""
# Test: Import by factory without errors
import_from_generic_test('Alibaba')
@pytest.mark.need_csp
@pytest.mark.need_csp_alibaba
def test_ossclass_real(tmpdir):
"""OSSStorage in real case"""
run_full_real_test_sequence('Alibaba', tmpdir)
| 23.35 | 58 | 0.75803 | 65 | 467 | 5.107692 | 0.461538 | 0.042169 | 0.066265 | 0.090361 | 0.138554 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002475 | 0.134904 | 467 | 19 | 59 | 24.578947 | 0.819307 | 0.254818 | 0 | 0 | 0 | 0 | 0.042296 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.555556 | 0 | 0.777778 | 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 | 0 | 1 | 0 | 0 | 3 |
6f9096ef33b6a146886f471e4ff2bb1b1ea4ebd2 | 185 | py | Python | Exercicios_Resolvidos/Parte 1/Semana 8/Exercícios adicionais/maior_elemento.py | EmersonAires/Introducao_a_ciencia_da_computacao_com_Python | 152f95410a638d84adf97367be17ec67fdb8bf3c | [
"MIT"
] | null | null | null | Exercicios_Resolvidos/Parte 1/Semana 8/Exercícios adicionais/maior_elemento.py | EmersonAires/Introducao_a_ciencia_da_computacao_com_Python | 152f95410a638d84adf97367be17ec67fdb8bf3c | [
"MIT"
] | null | null | null | Exercicios_Resolvidos/Parte 1/Semana 8/Exercícios adicionais/maior_elemento.py | EmersonAires/Introducao_a_ciencia_da_computacao_com_Python | 152f95410a638d84adf97367be17ec67fdb8bf3c | [
"MIT"
] | null | null | null | def maior_elemento(lista):
elemento_ref = lista[0]
maior_elemento = 0
for i in lista:
if i >= elemento_ref:
maior_elemento = i
return maior_elemento | 23.125 | 30 | 0.627027 | 25 | 185 | 4.4 | 0.44 | 0.472727 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.015625 | 0.308108 | 185 | 8 | 31 | 23.125 | 0.84375 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0 | 0 | 0.285714 | 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 | 0 | 0 | 0 | 3 |
6fb4714a7dbe880ee400824407aaf42461a211c8 | 164 | py | Python | xyadmin/__init__.py | wangyuanjun1988/django-xyadmin | f40e9e530a009d820e2b1893818522cbe7675023 | [
"MIT"
] | null | null | null | xyadmin/__init__.py | wangyuanjun1988/django-xyadmin | f40e9e530a009d820e2b1893818522cbe7675023 | [
"MIT"
] | null | null | null | xyadmin/__init__.py | wangyuanjun1988/django-xyadmin | f40e9e530a009d820e2b1893818522cbe7675023 | [
"MIT"
] | 1 | 2020-12-01T06:34:36.000Z | 2020-12-01T06:34:36.000Z | from __future__ import absolute_import, unicode_literals
import pymysql
pymysql.install_as_MySQLdb()
from .celery import app as celery_app
__all__ = ['celery_app'] | 27.333333 | 56 | 0.835366 | 23 | 164 | 5.347826 | 0.565217 | 0.146341 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.103659 | 164 | 6 | 57 | 27.333333 | 0.836735 | 0 | 0 | 0 | 0 | 0 | 0.060606 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.6 | 0 | 0.6 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
6fbf90e8b3b00fd68abe651e85a208dd65aebe6f | 85 | py | Python | pytube/version.py | irahorecka/pytube | 97c17434e5f70897d294362315f48d76c84a9bec | [
"Unlicense"
] | null | null | null | pytube/version.py | irahorecka/pytube | 97c17434e5f70897d294362315f48d76c84a9bec | [
"Unlicense"
] | null | null | null | pytube/version.py | irahorecka/pytube | 97c17434e5f70897d294362315f48d76c84a9bec | [
"Unlicense"
] | null | null | null | __version__ = "11.0.2-2022.02.08"
if __name__ == "__main__":
print(__version__)
| 17 | 33 | 0.670588 | 12 | 85 | 3.416667 | 0.916667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 0.152941 | 85 | 4 | 34 | 21.25 | 0.402778 | 0 | 0 | 0 | 0 | 0 | 0.294118 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.333333 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 | 3 |
6fca0a99fd4ae92214359746d20f9dc2896a4d88 | 207 | py | Python | pyretri/evaluate/__init__.py | dongan-beta/PyRetri | 8756d5d5813a5211b58855373b6c6cd33d7a11f6 | [
"Apache-2.0"
] | 1,063 | 2020-04-21T12:42:05.000Z | 2022-03-31T06:32:50.000Z | pyretri/evaluate/__init__.py | dongan-beta/PyRetri | 8756d5d5813a5211b58855373b6c6cd33d7a11f6 | [
"Apache-2.0"
] | 39 | 2020-05-07T07:24:19.000Z | 2022-02-02T23:49:23.000Z | pyretri/evaluate/__init__.py | dongan-beta/PyRetri | 8756d5d5813a5211b58855373b6c6cd33d7a11f6 | [
"Apache-2.0"
] | 174 | 2020-04-26T04:33:11.000Z | 2022-03-17T02:58:45.000Z | # -*- coding: utf-8 -*-
from yacs.config import CfgNode
from .config import get_evaluate_cfg
from .builder import build_evaluate_helper
__all__ = [
'get_evaluate_cfg',
'build_evaluate_helper',
]
| 15.923077 | 42 | 0.729469 | 27 | 207 | 5.148148 | 0.555556 | 0.172662 | 0.201439 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005814 | 0.169082 | 207 | 12 | 43 | 17.25 | 0.802326 | 0.101449 | 0 | 0 | 0 | 0 | 0.201087 | 0.11413 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.428571 | 0 | 0.428571 | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
6fd1b08f48d2da00823a8bdd626550b7eca1daa9 | 364 | py | Python | github/create/profile/src/main.py | rogerio-ignacio-developer/formulas-github | 12cf7401f31e4a6212289b839c02de1d612c8271 | [
"Apache-2.0"
] | 32 | 2021-01-27T17:43:23.000Z | 2022-03-23T18:00:41.000Z | github/create/profile/src/main.py | rogerio-ignacio-developer/formulas-github | 12cf7401f31e4a6212289b839c02de1d612c8271 | [
"Apache-2.0"
] | 12 | 2021-01-26T18:14:59.000Z | 2021-10-04T12:24:41.000Z | github/create/profile/src/main.py | rogerio-ignacio-developer/formulas-github | 12cf7401f31e4a6212289b839c02de1d612c8271 | [
"Apache-2.0"
] | 11 | 2021-01-28T13:54:24.000Z | 2022-03-16T12:16:27.000Z | #!/usr/bin/python3
import os
from formula import formula
username = os.environ.get("RIT_GITHUB_USER")
name = os.environ.get("RIT_NAME")
job = os.environ.get("RIT_JOB")
company = os.environ.get("RIT_COMPANY")
hardskills = os.environ.get("RIT_HARD_SKILLS")
accounts = os.environ.get("RIT_ACCOUNTS")
formula.run(username, name, job, company, hardskills, accounts)
| 26 | 63 | 0.755495 | 55 | 364 | 4.854545 | 0.381818 | 0.202247 | 0.269663 | 0.337079 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.00303 | 0.093407 | 364 | 13 | 64 | 28 | 0.806061 | 0.046703 | 0 | 0 | 0 | 0 | 0.196532 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.222222 | 0 | 0.222222 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
6ff8fd27d66086bf4c8e1ed8affbd6442d82cf21 | 59 | py | Python | md_click/__init__.py | shalgrim/md-click | fdf4348c83143e157047a0d53a63d79db51ac0cb | [
"BSD-3-Clause"
] | 3 | 2021-03-15T18:50:16.000Z | 2022-01-17T11:43:31.000Z | md_click/__init__.py | shalgrim/md-click | fdf4348c83143e157047a0d53a63d79db51ac0cb | [
"BSD-3-Clause"
] | 1 | 2022-03-31T07:52:18.000Z | 2022-03-31T07:52:18.000Z | md_click/__init__.py | shalgrim/md-click | fdf4348c83143e157047a0d53a63d79db51ac0cb | [
"BSD-3-Clause"
] | 1 | 2021-06-21T21:45:28.000Z | 2021-06-21T21:45:28.000Z | from .main import cli
__version__ = 1.0
__all__ = ['cli'] | 11.8 | 21 | 0.677966 | 9 | 59 | 3.555556 | 0.888889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.041667 | 0.186441 | 59 | 5 | 22 | 11.8 | 0.625 | 0 | 0 | 0 | 0 | 0 | 0.05 | 0 | 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 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
6ffd9c63f0a7ffcf9c600d6163ead83b738acf55 | 5,065 | py | Python | tests/api/db/test_background_tasks.py | george0st/mlrun | 6467d3a5ceadf6cd35512b84b3ddc3da611cf39a | [
"Apache-2.0"
] | null | null | null | tests/api/db/test_background_tasks.py | george0st/mlrun | 6467d3a5ceadf6cd35512b84b3ddc3da611cf39a | [
"Apache-2.0"
] | null | null | null | tests/api/db/test_background_tasks.py | george0st/mlrun | 6467d3a5ceadf6cd35512b84b3ddc3da611cf39a | [
"Apache-2.0"
] | null | null | null | import time
import pytest
from sqlalchemy.orm import Session
import mlrun.api.initial_data
import mlrun.errors
from mlrun.api import schemas
from mlrun.api.db.base import DBInterface
from tests.api.db.conftest import dbs
@pytest.mark.parametrize(
"db,db_session", [(dbs[0], dbs[0])], indirect=["db", "db_session"]
)
def test_store_project_background_task(db: DBInterface, db_session: Session):
project = "test-project"
db.store_background_task(db_session, "test", timeout=600, project=project)
background_task = db.get_background_task(db_session, "test", project=project)
assert background_task.metadata.name == "test"
assert background_task.status.state == "running"
@pytest.mark.parametrize(
"db,db_session", [(dbs[0], dbs[0])], indirect=["db", "db_session"]
)
def test_get_project_background_task_with_timeout_exceeded(
db: DBInterface, db_session: Session
):
project = "test-project"
db.store_background_task(db_session, "test", timeout=1, project=project)
background_task = db.get_background_task(db_session, "test", project=project)
assert background_task.status.state == "running"
time.sleep(1)
background_task = db.get_background_task(db_session, "test", project=project)
assert background_task.status.state == "failed"
@pytest.mark.parametrize(
"db,db_session", [(dbs[0], dbs[0])], indirect=["db", "db_session"]
)
def test_get_project_background_task_doesnt_exists(
db: DBInterface, db_session: Session
):
project = "test-project"
with pytest.raises(mlrun.errors.MLRunNotFoundError):
db.get_background_task(db_session, "test", project=project)
@pytest.mark.parametrize(
"db,db_session", [(dbs[0], dbs[0])], indirect=["db", "db_session"]
)
def test_store_project_background_task_after_status_updated(
db: DBInterface, db_session: Session
):
project = "test-project"
db.store_background_task(db_session, "test", project=project)
background_task = db.get_background_task(db_session, "test", project=project)
assert background_task.status.state == schemas.BackgroundTaskState.running
db.store_background_task(
db_session, "test", state=schemas.BackgroundTaskState.failed, project=project
)
background_task = db.get_background_task(db_session, "test", project=project)
assert background_task.status.state == schemas.BackgroundTaskState.failed
# Expecting to fail
with pytest.raises(mlrun.errors.MLRunRuntimeError):
db.store_background_task(
db_session,
"test",
state=schemas.BackgroundTaskState.running,
project=project,
)
# expecting to fail, because terminal state is terminal which means it is not supposed to change
with pytest.raises(mlrun.errors.MLRunRuntimeError):
db.store_background_task(
db_session,
"test",
state=schemas.BackgroundTaskState.succeeded,
project=project,
)
db.store_background_task(
db_session, "test", state=schemas.BackgroundTaskState.failed, project=project
)
@pytest.mark.parametrize(
"db,db_session", [(dbs[0], dbs[0])], indirect=["db", "db_session"]
)
def test_get_project_background_task_with_disabled_timeout(
db: DBInterface, db_session: Session
):
task_name = "test"
project = "test-project"
task_timeout = 0
mlrun.mlconf.background_tasks.timeout_mode = "disabled"
db.store_background_task(
db_session, name=task_name, timeout=task_timeout, project=project
)
background_task = db.get_background_task(db_session, task_name, project)
# expecting to be None because if mode is disabled and timeout provided it ignores it
assert background_task.metadata.timeout is None
# expecting created and updated time to be equal because mode disabled even if timeout exceeded
assert background_task.metadata.created == background_task.metadata.updated
assert background_task.status.state == mlrun.api.schemas.BackgroundTaskState.running
task_name = "test1"
db.store_background_task(db_session, name=task_name, project=project)
# because timeout default mode is disabled, expecting not to enrich the background task timeout
background_task = db.get_background_task(db_session, task_name, project)
assert background_task.metadata.timeout is None
assert background_task.metadata.created == background_task.metadata.updated
assert background_task.status.state == mlrun.api.schemas.BackgroundTaskState.running
db.store_background_task(
db_session,
name=task_name,
project=project,
state=mlrun.api.schemas.BackgroundTaskState.succeeded,
)
background_task_new = db.get_background_task(db_session, task_name, project)
assert (
background_task_new.status.state
== mlrun.api.schemas.BackgroundTaskState.succeeded
)
assert background_task_new.metadata.updated > background_task.metadata.updated
assert background_task_new.metadata.created == background_task.metadata.created
| 39.263566 | 100 | 0.737414 | 633 | 5,065 | 5.668246 | 0.129542 | 0.202899 | 0.120401 | 0.121795 | 0.775362 | 0.737737 | 0.696767 | 0.665831 | 0.65078 | 0.628205 | 0 | 0.004009 | 0.162883 | 5,065 | 128 | 101 | 39.570313 | 0.842217 | 0.075814 | 0 | 0.523364 | 0 | 0 | 0.059465 | 0 | 0 | 0 | 0 | 0 | 0.140187 | 1 | 0.046729 | false | 0 | 0.074766 | 0 | 0.121495 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
d232317cb2c8434042c65df9b9bde70677ded493 | 222 | py | Python | chapter_02_data_structures/section_2_2_collections/2_28_collections_deque_rotate.py | wuxiaofeng8764/P3SL_Example | 8ce1877af7372211b20836f799a8c44679577b7c | [
"MIT"
] | null | null | null | chapter_02_data_structures/section_2_2_collections/2_28_collections_deque_rotate.py | wuxiaofeng8764/P3SL_Example | 8ce1877af7372211b20836f799a8c44679577b7c | [
"MIT"
] | null | null | null | chapter_02_data_structures/section_2_2_collections/2_28_collections_deque_rotate.py | wuxiaofeng8764/P3SL_Example | 8ce1877af7372211b20836f799a8c44679577b7c | [
"MIT"
] | null | null | null | import collections
d = collections.deque(range(10))
print('Normal :', d)
d = collections.deque(range(10))
d.rotate(2)
print('Right rotation:', d)
d = collections.deque(range(10))
d.rotate(-2)
print('Left rotation :', d) | 18.5 | 32 | 0.693694 | 34 | 222 | 4.529412 | 0.382353 | 0.233766 | 0.331169 | 0.428571 | 0.649351 | 0.493506 | 0.493506 | 0.493506 | 0.493506 | 0.493506 | 0 | 0.040609 | 0.112613 | 222 | 12 | 33 | 18.5 | 0.741117 | 0 | 0 | 0.333333 | 0 | 0 | 0.170404 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.111111 | 0 | 0.111111 | 0.333333 | 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 | 0 | 0 | 3 |
d24cade9b026d7ed7d829ad95cf6ec4c2bdc22cb | 66 | py | Python | chat/tests/__init__.py | michaeldove/abode | 0357c4bcda5290d5f8f6d93783acd3258219584c | [
"MIT"
] | null | null | null | chat/tests/__init__.py | michaeldove/abode | 0357c4bcda5290d5f8f6d93783acd3258219584c | [
"MIT"
] | null | null | null | chat/tests/__init__.py | michaeldove/abode | 0357c4bcda5290d5f8f6d93783acd3258219584c | [
"MIT"
] | null | null | null | import doctest
suite = doctest.DocFileSuite('human_protocol.txt')
| 22 | 50 | 0.818182 | 8 | 66 | 6.625 | 0.875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.075758 | 66 | 2 | 51 | 33 | 0.868852 | 0 | 0 | 0 | 0 | 0 | 0.272727 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
d25ab0e13a45742914f16f9998b0532d4827caed | 831 | py | Python | problem_solving/algorithms/implementation/between_two_sets.py | scouvreur/hackerrank | 93a52ed6a744ce41fd215d8007435a682228fa01 | [
"MIT"
] | 1 | 2021-01-28T14:23:24.000Z | 2021-01-28T14:23:24.000Z | problem_solving/algorithms/implementation/between_two_sets.py | scouvreur/hackerrank | 93a52ed6a744ce41fd215d8007435a682228fa01 | [
"MIT"
] | null | null | null | problem_solving/algorithms/implementation/between_two_sets.py | scouvreur/hackerrank | 93a52ed6a744ce41fd215d8007435a682228fa01 | [
"MIT"
] | null | null | null | #!/bin/python3
from typing import List
# Complete the 'get_total_x' function below.
#
# The function is expected to return an INTEGER.
# The function accepts following parameters:
# 1. INTEGER_ARRAY a
# 2. INTEGER_ARRAY b
#
def get_total_x(a: List[int], b: List[int]) -> int:
# Write your code here
return None
def test_get_total_x():
"""Test for get_total_x function."""
assert get_total_x(a=[2, 6], b=[24, 36]) == 2
assert get_total_x(a=[3, 4], b=[24, 48]) == 2
assert get_total_x(a=[2, 4], b=[16, 32, 96]) == 3
test_get_total_x()
# first_multiple_input = input().rstrip().split()
# n = int(first_multiple_input[0])
# m = int(first_multiple_input[1])
# arr = list(map(int, input().rstrip().split()))
# brr = list(map(int, input().rstrip().split()))
# total = get_total_x(arr, brr)
# print(total)
| 25.181818 | 53 | 0.658243 | 140 | 831 | 3.707143 | 0.414286 | 0.138728 | 0.156069 | 0.077071 | 0.200385 | 0.200385 | 0 | 0 | 0 | 0 | 0 | 0.04058 | 0.169675 | 831 | 32 | 54 | 25.96875 | 0.711594 | 0.588448 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.03125 | 0.375 | 1 | 0.25 | false | 0 | 0.125 | 0.125 | 0.5 | 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 | 0 | 0 | 0 | 3 |
d25bb65151dfe019944becf2e04cc2871896f933 | 601 | py | Python | Module 1/Chapter08/mockdbhelper.py | nikitabrazhnik/flask2 | fd7a7e26f00402da09ee2159253cc1958df54814 | [
"MIT"
] | 40 | 2017-02-11T18:28:53.000Z | 2021-10-04T04:52:49.000Z | Module 1/Chapter08/mockdbhelper.py | nikitabrazhnik/flask2 | fd7a7e26f00402da09ee2159253cc1958df54814 | [
"MIT"
] | 1 | 2018-06-15T13:46:47.000Z | 2018-06-15T13:46:47.000Z | Module 1/Chapter08/mockdbhelper.py | nikitabrazhnik/flask2 | fd7a7e26f00402da09ee2159253cc1958df54814 | [
"MIT"
] | 40 | 2017-04-11T12:01:22.000Z | 2021-05-30T18:05:27.000Z | class MockDBHelper:
def connect(self, database="crimemap"):
pass
def add_crime(self, category, date, latitude, longitude, description):
data = [category, date, latitude, longitude, description]
for i in data:
print i, type(i)
def get_all_crimes(self):
return [{'latitude': -33.301304,
'longitude': 26.523355,
'date': "2000-01-01",
'category': "mugging",
'description': "mock description"}]
def add_input(self, data):
pass
def clear_all(self):
pass
| 26.130435 | 74 | 0.547421 | 63 | 601 | 5.142857 | 0.555556 | 0.04321 | 0.123457 | 0.179012 | 0.246914 | 0 | 0 | 0 | 0 | 0 | 0 | 0.06 | 0.334443 | 601 | 22 | 75 | 27.318182 | 0.75 | 0 | 0 | 0.176471 | 0 | 0 | 0.134775 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.176471 | 0 | null | null | 0.058824 | 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 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
d26a7cdf9fd07c15f914cb1233c65148066ecdeb | 66 | py | Python | cupyimg/scipy/stats/distributions.py | haesleinhuepf/cupyimg | 1fbe5d5ed53a030eb0dfbf618a0b194af1cac2ae | [
"BSD-3-Clause"
] | 39 | 2020-03-28T14:36:45.000Z | 2022-02-26T20:39:24.000Z | cupyimg/scipy/stats/distributions.py | haesleinhuepf/cupyimg | 1fbe5d5ed53a030eb0dfbf618a0b194af1cac2ae | [
"BSD-3-Clause"
] | 10 | 2020-09-02T18:19:37.000Z | 2022-03-11T08:48:29.000Z | cupyimg/scipy/stats/distributions.py | haesleinhuepf/cupyimg | 1fbe5d5ed53a030eb0dfbf618a0b194af1cac2ae | [
"BSD-3-Clause"
] | 4 | 2020-04-13T21:24:14.000Z | 2021-06-17T18:07:22.000Z | from ._distn_infrastructure import entropy
__all__ = ["entropy"]
| 16.5 | 42 | 0.787879 | 7 | 66 | 6.571429 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.121212 | 66 | 3 | 43 | 22 | 0.793103 | 0 | 0 | 0 | 0 | 0 | 0.106061 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
d27904dd8322e36e8d336569366f36cf62041db8 | 12,896 | py | Python | pysnmp-with-texts/ASCEND-MIBSCRTY-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/ASCEND-MIBSCRTY-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/ASCEND-MIBSCRTY-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 ASCEND-MIBSCRTY-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ASCEND-MIBSCRTY-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:28:15 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)
#
configuration, = mibBuilder.importSymbols("ASCEND-MIB", "configuration")
ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsIntersection, ValueSizeConstraint, ValueRangeConstraint, SingleValueConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ValueSizeConstraint", "ValueRangeConstraint", "SingleValueConstraint", "ConstraintsUnion")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
ObjectIdentity, IpAddress, TimeTicks, iso, Gauge32, MibIdentifier, Integer32, ModuleIdentity, Unsigned32, Bits, Counter32, MibScalar, MibTable, MibTableRow, MibTableColumn, Counter64, NotificationType = mibBuilder.importSymbols("SNMPv2-SMI", "ObjectIdentity", "IpAddress", "TimeTicks", "iso", "Gauge32", "MibIdentifier", "Integer32", "ModuleIdentity", "Unsigned32", "Bits", "Counter32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Counter64", "NotificationType")
TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString")
class DisplayString(OctetString):
pass
mibsecurityProfile = MibIdentifier((1, 3, 6, 1, 4, 1, 529, 23, 107))
mibsecurityProfileTable = MibTable((1, 3, 6, 1, 4, 1, 529, 23, 107, 1), )
if mibBuilder.loadTexts: mibsecurityProfileTable.setStatus('mandatory')
if mibBuilder.loadTexts: mibsecurityProfileTable.setDescription('A list of mibsecurityProfile profile entries.')
mibsecurityProfileEntry = MibTableRow((1, 3, 6, 1, 4, 1, 529, 23, 107, 1, 1), ).setIndexNames((0, "ASCEND-MIBSCRTY-MIB", "securityProfile-Name"))
if mibBuilder.loadTexts: mibsecurityProfileEntry.setStatus('mandatory')
if mibBuilder.loadTexts: mibsecurityProfileEntry.setDescription('A mibsecurityProfile entry containing objects that maps to the parameters of mibsecurityProfile profile.')
securityProfile_Name = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 107, 1, 1, 1), DisplayString()).setLabel("securityProfile-Name").setMaxAccess("readonly")
if mibBuilder.loadTexts: securityProfile_Name.setStatus('mandatory')
if mibBuilder.loadTexts: securityProfile_Name.setDescription('Profile name.')
securityProfile_Password = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 107, 1, 1, 2), DisplayString()).setLabel("securityProfile-Password").setMaxAccess("readwrite")
if mibBuilder.loadTexts: securityProfile_Password.setStatus('mandatory')
if mibBuilder.loadTexts: securityProfile_Password.setDescription('Password to access the security levels defined by this profile.')
securityProfile_Operations = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 107, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setLabel("securityProfile-Operations").setMaxAccess("readwrite")
if mibBuilder.loadTexts: securityProfile_Operations.setStatus('mandatory')
if mibBuilder.loadTexts: securityProfile_Operations.setDescription('TRUE = able to do things other than look.')
securityProfile_EditSecurity = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 107, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setLabel("securityProfile-EditSecurity").setMaxAccess("readwrite")
if mibBuilder.loadTexts: securityProfile_EditSecurity.setStatus('mandatory')
if mibBuilder.loadTexts: securityProfile_EditSecurity.setDescription('TRUE = able to edit the security profiles.')
securityProfile_EditSystem = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 107, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setLabel("securityProfile-EditSystem").setMaxAccess("readwrite")
if mibBuilder.loadTexts: securityProfile_EditSystem.setStatus('mandatory')
if mibBuilder.loadTexts: securityProfile_EditSystem.setDescription('TRUE = able to edit the system profiles.')
securityProfile_EditLine = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 107, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setLabel("securityProfile-EditLine").setMaxAccess("readwrite")
if mibBuilder.loadTexts: securityProfile_EditLine.setStatus('mandatory')
if mibBuilder.loadTexts: securityProfile_EditLine.setDescription('TRUE = able to edit the line profile.')
securityProfile_EditOwnPort = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 107, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setLabel("securityProfile-EditOwnPort").setMaxAccess("readwrite")
if mibBuilder.loadTexts: securityProfile_EditOwnPort.setStatus('mandatory')
if mibBuilder.loadTexts: securityProfile_EditOwnPort.setDescription('TRUE = able to edit port associated port profile (for remote terminal).')
securityProfile_EditAllPort = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 107, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setLabel("securityProfile-EditAllPort").setMaxAccess("readwrite")
if mibBuilder.loadTexts: securityProfile_EditAllPort.setStatus('mandatory')
if mibBuilder.loadTexts: securityProfile_EditAllPort.setDescription('TRUE = able to edit all port profiles.')
securityProfile_EditCurCall = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 107, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setLabel("securityProfile-EditCurCall").setMaxAccess("readwrite")
if mibBuilder.loadTexts: securityProfile_EditCurCall.setStatus('mandatory')
if mibBuilder.loadTexts: securityProfile_EditCurCall.setDescription('TRUE = able to edit the current call profile.')
securityProfile_EditOwnCall = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 107, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setLabel("securityProfile-EditOwnCall").setMaxAccess("readwrite")
if mibBuilder.loadTexts: securityProfile_EditOwnCall.setStatus('mandatory')
if mibBuilder.loadTexts: securityProfile_EditOwnCall.setDescription('TRUE = able to edit port associated call profiles (for remote terminal).')
securityProfile_EditComCall = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 107, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setLabel("securityProfile-EditComCall").setMaxAccess("readwrite")
if mibBuilder.loadTexts: securityProfile_EditComCall.setStatus('mandatory')
if mibBuilder.loadTexts: securityProfile_EditComCall.setDescription('TRUE = able to edit the common call profiles (for remote terminal).')
securityProfile_EditAllCall = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 107, 1, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setLabel("securityProfile-EditAllCall").setMaxAccess("readwrite")
if mibBuilder.loadTexts: securityProfile_EditAllCall.setStatus('mandatory')
if mibBuilder.loadTexts: securityProfile_EditAllCall.setDescription('TRUE = able to edit all call profiles.')
securityProfile_SysDiag = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 107, 1, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setLabel("securityProfile-SysDiag").setMaxAccess("readwrite")
if mibBuilder.loadTexts: securityProfile_SysDiag.setStatus('mandatory')
if mibBuilder.loadTexts: securityProfile_SysDiag.setDescription('TRUE = able to perform system diagnostics.')
securityProfile_OwnPortDiag = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 107, 1, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setLabel("securityProfile-OwnPortDiag").setMaxAccess("readwrite")
if mibBuilder.loadTexts: securityProfile_OwnPortDiag.setStatus('mandatory')
if mibBuilder.loadTexts: securityProfile_OwnPortDiag.setDescription('TRUE = able to perform port associated port diagnostics (for remote terminal).')
securityProfile_AllPortDiag = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 107, 1, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setLabel("securityProfile-AllPortDiag").setMaxAccess("readwrite")
if mibBuilder.loadTexts: securityProfile_AllPortDiag.setStatus('mandatory')
if mibBuilder.loadTexts: securityProfile_AllPortDiag.setDescription('TRUE = able to perform port diagnostics for all ports.')
securityProfile_Download = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 107, 1, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setLabel("securityProfile-Download").setMaxAccess("readwrite")
if mibBuilder.loadTexts: securityProfile_Download.setStatus('mandatory')
if mibBuilder.loadTexts: securityProfile_Download.setDescription('TRUE = able to download configuration.')
securityProfile_Upload = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 107, 1, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setLabel("securityProfile-Upload").setMaxAccess("readwrite")
if mibBuilder.loadTexts: securityProfile_Upload.setStatus('mandatory')
if mibBuilder.loadTexts: securityProfile_Upload.setDescription('TRUE = able to upload configuration.')
securityProfile_FieldService = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 107, 1, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setLabel("securityProfile-FieldService").setMaxAccess("readwrite")
if mibBuilder.loadTexts: securityProfile_FieldService.setStatus('mandatory')
if mibBuilder.loadTexts: securityProfile_FieldService.setDescription('TRUE = able to perform field service.')
securityProfile_UseTacacsPlus = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 107, 1, 1, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("no", 1), ("yes", 2)))).setLabel("securityProfile-UseTacacsPlus").setMaxAccess("readwrite")
if mibBuilder.loadTexts: securityProfile_UseTacacsPlus.setStatus('mandatory')
if mibBuilder.loadTexts: securityProfile_UseTacacsPlus.setDescription('Use TACACS+ to authenticate security level changes')
securityProfile_Action_o = MibScalar((1, 3, 6, 1, 4, 1, 529, 23, 107, 1, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("noAction", 1), ("createProfile", 2), ("deleteProfile", 3)))).setLabel("securityProfile-Action-o").setMaxAccess("readwrite")
if mibBuilder.loadTexts: securityProfile_Action_o.setStatus('mandatory')
if mibBuilder.loadTexts: securityProfile_Action_o.setDescription('')
mibBuilder.exportSymbols("ASCEND-MIBSCRTY-MIB", securityProfile_Action_o=securityProfile_Action_o, mibsecurityProfileEntry=mibsecurityProfileEntry, securityProfile_EditComCall=securityProfile_EditComCall, securityProfile_EditLine=securityProfile_EditLine, securityProfile_FieldService=securityProfile_FieldService, securityProfile_EditOwnCall=securityProfile_EditOwnCall, securityProfile_Upload=securityProfile_Upload, DisplayString=DisplayString, mibsecurityProfile=mibsecurityProfile, securityProfile_EditCurCall=securityProfile_EditCurCall, securityProfile_Name=securityProfile_Name, securityProfile_Download=securityProfile_Download, securityProfile_UseTacacsPlus=securityProfile_UseTacacsPlus, securityProfile_OwnPortDiag=securityProfile_OwnPortDiag, securityProfile_Operations=securityProfile_Operations, securityProfile_EditSecurity=securityProfile_EditSecurity, securityProfile_AllPortDiag=securityProfile_AllPortDiag, securityProfile_Password=securityProfile_Password, securityProfile_EditSystem=securityProfile_EditSystem, securityProfile_SysDiag=securityProfile_SysDiag, securityProfile_EditAllPort=securityProfile_EditAllPort, mibsecurityProfileTable=mibsecurityProfileTable, securityProfile_EditAllCall=securityProfile_EditAllCall, securityProfile_EditOwnPort=securityProfile_EditOwnPort)
| 149.953488 | 1,301 | 0.796914 | 1,403 | 12,896 | 7.250178 | 0.138988 | 0.051907 | 0.090838 | 0.141565 | 0.631144 | 0.557806 | 0.306921 | 0.292175 | 0.292175 | 0.290798 | 0 | 0.047773 | 0.066687 | 12,896 | 85 | 1,302 | 151.717647 | 0.797358 | 0.025744 | 0 | 0 | 0 | 0 | 0.205655 | 0.042851 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.064935 | 0.090909 | 0 | 0.103896 | 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 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
96538465faafdbf86c48d7db147560a56a728296 | 212 | py | Python | scripts/packages/gnocchi/gnocchi/__main__.py | kristianmk/tator | 0eb75ee9333316b06f773de2b75e8e797a98ffdb | [
"MIT"
] | 50 | 2019-09-18T14:32:18.000Z | 2022-03-31T16:26:07.000Z | scripts/packages/gnocchi/gnocchi/__main__.py | kristianmk/tator | 0eb75ee9333316b06f773de2b75e8e797a98ffdb | [
"MIT"
] | 566 | 2019-09-18T16:33:40.000Z | 2022-03-31T20:01:38.000Z | scripts/packages/gnocchi/gnocchi/__main__.py | kristianmk/tator | 0eb75ee9333316b06f773de2b75e8e797a98ffdb | [
"MIT"
] | 19 | 2019-09-21T20:08:12.000Z | 2022-03-17T14:53:11.000Z | #!/usr/bin/env python3
""" Entry point """
import gnocchi.project
import logging
import sys
if __name__ == '__main__':
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
gnocchi.project.start()
| 19.272727 | 62 | 0.726415 | 27 | 212 | 5.407407 | 0.740741 | 0.191781 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005464 | 0.136792 | 212 | 10 | 63 | 21.2 | 0.79235 | 0.160377 | 0 | 0 | 0 | 0 | 0.046784 | 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 | 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 | 3 |
96730d86f3ba0c79d73099fcc167cb7e557c7447 | 708 | py | Python | dirbot/spiders/user_fan.py | jingzhou123/tieba-crawler | a2f5c901c9111151de0e0aafa5673e68bdceb1e9 | [
"MIT"
] | 33 | 2015-12-01T12:49:21.000Z | 2021-02-22T12:27:49.000Z | dirbot/spiders/user_fan.py | jingzhou123/tieba-crawler | a2f5c901c9111151de0e0aafa5673e68bdceb1e9 | [
"MIT"
] | null | null | null | dirbot/spiders/user_fan.py | jingzhou123/tieba-crawler | a2f5c901c9111151de0e0aafa5673e68bdceb1e9 | [
"MIT"
] | 9 | 2016-03-16T04:47:56.000Z | 2020-03-14T15:50:51.000Z | #coding=utf-8
from dirbot.items import User
from user import UserSpider
from scrapy import Request, Selector
from urlparse import urlparse, parse_qs
import logging
import json
class UserFanSpider(UserSpider):
"""Docstring for UserSpider. """
name = 'user_fan'# 命名规则 user_{从哪种渠道获得的用户名称}
def query_some_records(self, start_index = 0, num = 50):
"""TODO: Docstring for query_some_records.
:start_index: TODO
:num: TODO
:returns: TODO
"""
cursor = self.conn.cursor()
cursor.execute("""
SELECT name from fan limit %s, %s
""", (
start_index,
num
))# 去重
return cursor.fetchall()
| 21.454545 | 60 | 0.610169 | 82 | 708 | 5.146341 | 0.560976 | 0.07109 | 0.075829 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008 | 0.293785 | 708 | 32 | 61 | 22.125 | 0.836 | 0.216102 | 0 | 0 | 0 | 0 | 0.124016 | 0 | 0 | 0 | 0 | 0.125 | 0 | 1 | 0.058824 | false | 0 | 0.352941 | 0 | 0.588235 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
967aea0d400e196148895d09ba2981dcb641d55f | 2,211 | py | Python | armagarch/distModel.py | iankhr/armagarch | 5d292b54cde992cca47024aaeb8d4120f0665a7d | [
"MIT"
] | 45 | 2018-09-11T07:16:20.000Z | 2022-03-14T08:49:23.000Z | armagarch/distModel.py | Myngahuynh/armagarch | 5d292b54cde992cca47024aaeb8d4120f0665a7d | [
"MIT"
] | 5 | 2019-01-04T11:00:23.000Z | 2021-12-04T11:29:43.000Z | armagarch/distModel.py | Myngahuynh/armagarch | 5d292b54cde992cca47024aaeb8d4120f0665a7d | [
"MIT"
] | 28 | 2018-10-25T07:11:04.000Z | 2022-03-31T16:06:20.000Z | # -*- coding: utf-8 -*-
"""
Created on Fri Jun 26 12:23:59 2020
This class is a template for future distribution models
@author: Ian Khrashchevskyi
"""
import numpy as np
class DistModel(object):
"""
Parameters
----------
params : dict, optional
params is a dict that contains all of the . The default is None.
data : DataFrame, optional
data is a DataFrame with the values to be used in . The default is None.
Returns
-------
None.
"""
def __init__(self, params=None, data = None):
self._data = data
self._params = params
self.type = 'DistModel'
self._giveName()
self._setConstraints()
pass
def _setConstraints(self, data=None):
self._constraints = {'Mean':(-np.Inf, np.inf), 'Var':(0,np.inf),\
'other':None}
def _giveName(self):
self._name = 'Dist'
self._pnum = 1
self._varnames = ['Mean','Var']
self._startingValues = 0
pass
def func_constr(self, params):
"""
"""
return None
def lls(self, data=None, params=None):
pass
def ll(self, data = None, params = None):
return np.sum(self.lls(data, params))
def cdf(self):
pass
def pdf(self):
pass
def invcdf(self):
pass
def invpdf(self):
pass
def simulate(self, nobs = 1):
pass
@property
def reqpars(self):
return self._reqPars
@property
def name(self):
return self._name
@property
def params(self):
return self._params
@property
def pnum(self):
return self._pnum
@property
def constr(self):
return self._constraints
@property
def varNames(self):
return self._varnames
@property
def startVals(self):
return self._startingValues | 19.394737 | 85 | 0.483944 | 224 | 2,211 | 4.674107 | 0.375 | 0.0468 | 0.093601 | 0.030564 | 0.042025 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013292 | 0.421529 | 2,211 | 114 | 86 | 19.394737 | 0.805317 | 0.178652 | 0 | 0.272727 | 0 | 0 | 0.019938 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.327273 | false | 0.145455 | 0.018182 | 0.145455 | 0.527273 | 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 | 0 | 0 | 0 | 3 |
96818e054be71ea32fb8c7f1d8e78b59aaa5433e | 11,853 | py | Python | pysnmp-with-texts/IEEE8021-MIRP-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-MIRP-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-MIRP-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-MIRP-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/IEEE8021-MIRP-MIB
# Produced by pysmi-0.3.4 at Wed May 1 13:52:27 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)
#
Integer, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsIntersection, ValueRangeConstraint, ValueSizeConstraint, SingleValueConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ValueRangeConstraint", "ValueSizeConstraint", "SingleValueConstraint", "ConstraintsUnion")
ieee8021BridgeBasePortEntry, = mibBuilder.importSymbols("IEEE8021-BRIDGE-MIB", "ieee8021BridgeBasePortEntry")
ieee8021PbbBackboneEdgeBridgeObjects, = mibBuilder.importSymbols("IEEE8021-PBB-MIB", "ieee8021PbbBackboneEdgeBridgeObjects")
IEEE8021BridgePortNumberOrZero, = mibBuilder.importSymbols("IEEE8021-TC-MIB", "IEEE8021BridgePortNumberOrZero")
VlanIdOrNone, = mibBuilder.importSymbols("Q-BRIDGE-MIB", "VlanIdOrNone")
ObjectGroup, ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "ModuleCompliance", "NotificationGroup")
systemGroup, = mibBuilder.importSymbols("SNMPv2-MIB", "systemGroup")
Counter64, Counter32, NotificationType, TimeTicks, ModuleIdentity, MibIdentifier, Gauge32, ObjectIdentity, Integer32, MibScalar, MibTable, MibTableRow, MibTableColumn, iso, Unsigned32, IpAddress, Bits = mibBuilder.importSymbols("SNMPv2-SMI", "Counter64", "Counter32", "NotificationType", "TimeTicks", "ModuleIdentity", "MibIdentifier", "Gauge32", "ObjectIdentity", "Integer32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "iso", "Unsigned32", "IpAddress", "Bits")
TextualConvention, DisplayString, TruthValue = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString", "TruthValue")
ieee8021MirpMib = ModuleIdentity((1, 3, 111, 2, 802, 1, 1, 23))
ieee8021MirpMib.setRevisions(('2011-04-05 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: ieee8021MirpMib.setRevisionsDescriptions(('Included in IEEE Std. 802.1Qbe-2011 Copyright (C) IEEE802.1.',))
if mibBuilder.loadTexts: ieee8021MirpMib.setLastUpdated('201104050000Z')
if mibBuilder.loadTexts: ieee8021MirpMib.setOrganization('IEEE 802.1 Working Group')
if mibBuilder.loadTexts: ieee8021MirpMib.setContactInfo('WG-URL: http://grouper.ieee.org/groups/802/1/index.html WG-EMail: stds-802-1@ieee.org Contact: Norman Finn c/o Tony Jeffree, IEEE 802.1 Working Group Chair Postal: IEEE Standards Board 445 Hoes Lane P.O. Box 1331 Piscataway, NJ 08855-1331 USA E-mail: tony@jeffree.co.uk ')
if mibBuilder.loadTexts: ieee8021MirpMib.setDescription('Multiple I-SID Registration Protocol module for managing IEEE 802.1Qbe ')
ieee8021MirpMIBObjects = MibIdentifier((1, 3, 111, 2, 802, 1, 1, 23, 1))
ieee8021MirpConformance = MibIdentifier((1, 3, 111, 2, 802, 1, 1, 23, 2))
ieee8021MirpPortTable = MibTable((1, 3, 111, 2, 802, 1, 1, 23, 1, 1), )
if mibBuilder.loadTexts: ieee8021MirpPortTable.setReference('12.9.2')
if mibBuilder.loadTexts: ieee8021MirpPortTable.setStatus('current')
if mibBuilder.loadTexts: ieee8021MirpPortTable.setDescription('A table that contains controls for the Multiple I-SID Registration Protocol (MIRP) state machines for all of the Ports of a Bridge.')
ieee8021MirpPortEntry = MibTableRow((1, 3, 111, 2, 802, 1, 1, 23, 1, 1, 1), )
ieee8021BridgeBasePortEntry.registerAugmentions(("IEEE8021-MIRP-MIB", "ieee8021MirpPortEntry"))
ieee8021MirpPortEntry.setIndexNames(*ieee8021BridgeBasePortEntry.getIndexNames())
if mibBuilder.loadTexts: ieee8021MirpPortEntry.setStatus('current')
if mibBuilder.loadTexts: ieee8021MirpPortEntry.setDescription('Each entry contains the MIRP Participant controls for one Port.')
ieee8021MirpPortEnabledStatus = MibTableColumn((1, 3, 111, 2, 802, 1, 1, 23, 1, 1, 1, 1), TruthValue().clone('true')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ieee8021MirpPortEnabledStatus.setReference('12.7.7.1, 12.7.7.2, 39.2.1.11')
if mibBuilder.loadTexts: ieee8021MirpPortEnabledStatus.setStatus('current')
if mibBuilder.loadTexts: ieee8021MirpPortEnabledStatus.setDescription("The state of MIRP operation on this port. The value true(1) indicates that MIRP is enabled on this port, as long as ieee8021PbbMirpEnableStatus is also enabled for this component. When false(2) but ieee8021PbbMirpEnableStatus is still enabled for the device, MIRP is disabled on this port. If MIRP is enabled on a VIP, then the MIRP Participant is enabled on that VIP's PIP. If MIRP is enabled on none of the VIPs on a PIP, then the MIRP Participant on the PIP is diabled; any MIRP packets received will be silently discarded, and no MIRP registrations will be propagated from the PIP. A transition from all VIPs on a PIP false(2) to at least one VIP on the PIP true(1) will cause a reset of all MIRP state machines on this PIP. If MIRP is enabled on any port not a VIP, then the MIRP Participant is enabled on that port. If MIRP is disabled on a non-VIP port, then MIRP packets received will be silently discarded, and no MIRP registrations will be propagated from the port. A transition from false(2) to true(1) will cause a reset of all MIRP state machines on a non-VIP port. The value of this object MUST be retained across reinitializations of the management system.")
ieee8021PbbMirpEnableStatus = MibScalar((1, 3, 111, 2, 802, 1, 1, 9, 1, 1, 1, 7), TruthValue().clone('false')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ieee8021PbbMirpEnableStatus.setReference('12.16.1.1.3:i, 12.16.1.2.2:b')
if mibBuilder.loadTexts: ieee8021PbbMirpEnableStatus.setStatus('current')
if mibBuilder.loadTexts: ieee8021PbbMirpEnableStatus.setDescription('The administrative status requested by management for MIRP. The value true(1) indicates that MIRP should be enabled on this component, on all ports for which it has not been specifically disabled. When false(2), MIRP is disabled on all ports. This object affects all MIRP Applicant and Registrar state machines. A transition from false(2) to true(1) will cause a reset of all MIRP state machines on all ports. The value of this object MUST be retained across reinitializations of the management system.')
ieee8021PbbMirpBvid = MibScalar((1, 3, 111, 2, 802, 1, 1, 9, 1, 1, 1, 8), VlanIdOrNone()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ieee8021PbbMirpBvid.setReference('12.16.1.1.3:j, 12.16.1.2.2:c')
if mibBuilder.loadTexts: ieee8021PbbMirpBvid.setStatus('current')
if mibBuilder.loadTexts: ieee8021PbbMirpBvid.setDescription('The B-VID to which received MIRPDUs are to be assigned, or 0, if they are to be sent on the CBP PVID.')
ieee8021PbbMirpDestSelector = MibScalar((1, 3, 111, 2, 802, 1, 1, 9, 1, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("cbpMirpGroup", 1), ("cbpMirpVlan", 2), ("cbpMirpTable", 3))).clone('cbpMirpGroup')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ieee8021PbbMirpDestSelector.setReference('Table 8-1, 12.16.1.1.3:k, 12.16.1.2.2:d')
if mibBuilder.loadTexts: ieee8021PbbMirpDestSelector.setStatus('current')
if mibBuilder.loadTexts: ieee8021PbbMirpDestSelector.setDescription('An enumerated value specifying what destination_address and vlan_identifier are to be used when the MIRP Participant transmits an MIRPDU towards the MAC relay entity: cbpMirpGroup (1) Use the Nearest Customer Bridge group address from Table 8-1 with the MIRP B-VID. cbpMirpVlan (2) Use the Nearest Customer Bridge group address from Table 8-1 with the Backbone VLAN Identifier field from the Backbone Service Instance table. cbpMirpTable (3) Use the Default Backbone Destination and Backbone VLAN Identifier fields from the Backbone Service Instance table. The value of this object MUST be retained across reinitializations of the management system.')
ieee8021PbbMirpPnpEnable = MibScalar((1, 3, 111, 2, 802, 1, 1, 9, 1, 1, 1, 10), TruthValue().clone('true')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ieee8021PbbMirpPnpEnable.setReference('12.16.1.1.3:j, 12.16.1.2.2:c')
if mibBuilder.loadTexts: ieee8021PbbMirpPnpEnable.setStatus('current')
if mibBuilder.loadTexts: ieee8021PbbMirpPnpEnable.setDescription('A Boolean value specifying the administrative status requested by management for attaching a MIRP Participant to a PNP if and only if this system is a Backbone Edge Bridge (BEB): true(1) The BEB is to attach a MIRP Participant to exactly one Port, either a management Port with no LAN connection external to the BEB, or a PNP. false(2) No MIRP Participant is to be present on any PNP (or on the MAC Relay-facing side of a CBP). The value of this object MUST be retained across reinitializations of the management system. ')
ieee8021PbbMirpPnpPortNumber = MibScalar((1, 3, 111, 2, 802, 1, 1, 9, 1, 1, 1, 11), IEEE8021BridgePortNumberOrZero()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ieee8021PbbMirpPnpPortNumber.setReference('12.16.1.1.3:j, 12.16.1.2.2:c')
if mibBuilder.loadTexts: ieee8021PbbMirpPnpPortNumber.setStatus('current')
if mibBuilder.loadTexts: ieee8021PbbMirpPnpPortNumber.setDescription('The Bridge Port Number of the Provider Network Port (PNP) that has an associated MIRP Participant, or 0, if no Bridge Port has an associated MIRP Participant. This object indexes an entry in the Bridge Port Table. The system SHALL ensure that either ieee8021PbbMirpPnpPortNumber contains 0, or that the indexed ieee8021BridgeBasePortType object contains the value providerNetworkPort(3).')
ieee8021MirpCompliances = MibIdentifier((1, 3, 111, 2, 802, 1, 1, 23, 2, 1))
ieee8021MirpGroups = MibIdentifier((1, 3, 111, 2, 802, 1, 1, 23, 2, 2))
ieee8021MirpReqdGroup = ObjectGroup((1, 3, 111, 2, 802, 1, 1, 23, 2, 2, 1)).setObjects(("IEEE8021-MIRP-MIB", "ieee8021MirpPortEnabledStatus"), ("IEEE8021-MIRP-MIB", "ieee8021PbbMirpEnableStatus"), ("IEEE8021-MIRP-MIB", "ieee8021PbbMirpBvid"), ("IEEE8021-MIRP-MIB", "ieee8021PbbMirpDestSelector"), ("IEEE8021-MIRP-MIB", "ieee8021PbbMirpPnpEnable"), ("IEEE8021-MIRP-MIB", "ieee8021PbbMirpPnpPortNumber"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ieee8021MirpReqdGroup = ieee8021MirpReqdGroup.setStatus('current')
if mibBuilder.loadTexts: ieee8021MirpReqdGroup.setDescription('Objects in the MIRP augmentation required group.')
ieee8021MirpBridgeCompliance = ModuleCompliance((1, 3, 111, 2, 802, 1, 1, 23, 2, 1, 1)).setObjects(("SNMPv2-MIB", "systemGroup"), ("IEEE8021-MIRP-MIB", "ieee8021MirpReqdGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ieee8021MirpBridgeCompliance = ieee8021MirpBridgeCompliance.setStatus('current')
if mibBuilder.loadTexts: ieee8021MirpBridgeCompliance.setDescription('The compliance statement for support by a bridge of the IEEE8021-MIRP-MIB module.')
mibBuilder.exportSymbols("IEEE8021-MIRP-MIB", ieee8021PbbMirpBvid=ieee8021PbbMirpBvid, ieee8021MirpMib=ieee8021MirpMib, ieee8021MirpPortEntry=ieee8021MirpPortEntry, ieee8021MirpGroups=ieee8021MirpGroups, ieee8021MirpMIBObjects=ieee8021MirpMIBObjects, ieee8021MirpBridgeCompliance=ieee8021MirpBridgeCompliance, ieee8021MirpReqdGroup=ieee8021MirpReqdGroup, ieee8021MirpCompliances=ieee8021MirpCompliances, ieee8021MirpPortEnabledStatus=ieee8021MirpPortEnabledStatus, PYSNMP_MODULE_ID=ieee8021MirpMib, ieee8021PbbMirpEnableStatus=ieee8021PbbMirpEnableStatus, ieee8021MirpConformance=ieee8021MirpConformance, ieee8021PbbMirpDestSelector=ieee8021PbbMirpDestSelector, ieee8021PbbMirpPnpPortNumber=ieee8021PbbMirpPnpPortNumber, ieee8021PbbMirpPnpEnable=ieee8021PbbMirpPnpEnable, ieee8021MirpPortTable=ieee8021MirpPortTable)
| 158.04 | 1,244 | 0.796423 | 1,496 | 11,853 | 6.307487 | 0.233957 | 0.007842 | 0.066766 | 0.009538 | 0.318355 | 0.216405 | 0.202734 | 0.186414 | 0.185036 | 0.182175 | 0 | 0.09257 | 0.099553 | 11,853 | 74 | 1,245 | 160.175676 | 0.79153 | 0.027672 | 0 | 0.046154 | 0 | 0.215385 | 0.479159 | 0.038642 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.169231 | 0 | 0.169231 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
96aaa8376e9a1af3863d7b83e298de5caf7ac846 | 105 | py | Python | main.py | phelipegustavo/depressive-disorders-data-mining | f98a983f5472c2f2a54f4c913daa222c0a996364 | [
"MIT"
] | 1 | 2021-09-24T09:15:37.000Z | 2021-09-24T09:15:37.000Z | main.py | phelipegustavo/depressive-disorders-data-mining | f98a983f5472c2f2a54f4c913daa222c0a996364 | [
"MIT"
] | null | null | null | main.py | phelipegustavo/depressive-disorders-data-mining | f98a983f5472c2f2a54f4c913daa222c0a996364 | [
"MIT"
] | null | null | null | from Mining import Mining
from Parser import Parser
mining = Mining('depressive', 'pmc')
mining.start()
| 17.5 | 36 | 0.761905 | 14 | 105 | 5.714286 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.133333 | 105 | 5 | 37 | 21 | 0.879121 | 0 | 0 | 0 | 0 | 0 | 0.12381 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
736c817ad34b80216b6e6f1781ba1c98b656f0b2 | 970 | py | Python | examples/method_components.py | maniospas/pyfop | ca0b06ed3ed7a8bfcba7daa1d3247b5623655193 | [
"Apache-2.0"
] | null | null | null | examples/method_components.py | maniospas/pyfop | ca0b06ed3ed7a8bfcba7daa1d3247b5623655193 | [
"Apache-2.0"
] | null | null | null | examples/method_components.py | maniospas/pyfop | ca0b06ed3ed7a8bfcba7daa1d3247b5623655193 | [
"Apache-2.0"
] | null | null | null | from pyfop import lazy, Aspect, Priority
import numpy as np
@lazy
def tautology(x):
return x
@lazy
def normalize(x, norm=Aspect(2, Priority.LOW)):
return x / (np.sum(x**norm))**(1./norm)
@lazy
def offset(x):
return x+np.eps()
@lazy
def dot(x, y):
return np.sum(x*y)
@lazy
def KLdivergence(x, y, norm=Aspect(1), epsilon=Aspect(np.finfo(float).eps)):
if norm != 1:
raise Exception("KLDivergence should not work on non-L1 normalizations")
return np.sum(x*np.log(x/(y+epsilon)+epsilon))
class Similarity:
def __init__(self, transform, measure, **kwargs):
self.transform = transform
self.measure = measure
self.kwargs = kwargs
def __call__(self, x, y):
return self.measure(self.transform(x), self.transform(y)).call(**self.kwargs)
x = np.array([1., 1., 1.])
#y = np.array([1., 1., 1.])
y = np.array([1., 0., 1.])
print(Similarity(normalize, KLdivergence, norm=1, epsilon=Aspect())(x, y))
| 21.086957 | 85 | 0.636082 | 150 | 970 | 4.06 | 0.326667 | 0.019704 | 0.029557 | 0.039409 | 0.049261 | 0.049261 | 0.049261 | 0.049261 | 0.049261 | 0 | 0 | 0.019108 | 0.190722 | 970 | 45 | 86 | 21.555556 | 0.756688 | 0.026804 | 0 | 0.172414 | 0 | 0 | 0.056204 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.241379 | false | 0 | 0.068966 | 0.172414 | 0.551724 | 0.034483 | 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 | 0 | 1 | 1 | 0 | 0 | 3 |
736ea6495532c62d57b30cf5f03d3878f6164766 | 4,468 | py | Python | front_end/test_conf.py | darwinharianto/detBlendProc | c367c8a07e488bf6342d49048be4cc36041303a0 | [
"Apache-2.0"
] | null | null | null | front_end/test_conf.py | darwinharianto/detBlendProc | c367c8a07e488bf6342d49048be4cc36041303a0 | [
"Apache-2.0"
] | null | null | null | front_end/test_conf.py | darwinharianto/detBlendProc | c367c8a07e488bf6342d49048be4cc36041303a0 | [
"Apache-2.0"
] | null | null | null | cfg.dataloader.evaluator=detectron2.evaluation.COCOEvaluator(dataset_name='coco_2017_val')
cfg.dataloader.test=detectron2.data.build_detection_test_loader(dataset=detectron2.data.get_detection_dataset_dicts(filter_empty=False, names='coco_2017_val'), mapper=detectron2.data.DatasetMapper(augmentations=[detectron2.data.transforms.ResizeShortestEdge(max_size=1333, short_edge_length=800)], image_format='BGR', is_train=False), num_workers=4)
cfg.dataloader.train=detectron2.data.build_detection_train_loader(dataset=detectron2.data.get_detection_dataset_dicts(names='coco_2017_train'), mapper=detectron2.data.DatasetMapper(augmentations=[detectron2.data.transforms.ResizeScale(max_scale=2.0, min_scale=0.1, target_height=1024, target_width=1024),detectron2.data.transforms.FixedSizeCrop(crop_size=[1024,1024]),detectron2.data.transforms.RandomFlip(horizontal=True)], image_format='BGR', is_train=True, recompute_boxes=True, use_instance_mask=True), num_workers=4, total_batch_size=64)
cfg.lr_multiplier=detectron2.solver.WarmupParamScheduler(scheduler=fvcore.common.param_scheduler.MultiStepParamScheduler(milestones=[163889,177546], num_updates=184375, values=[1.0,0.1,0.01]), warmup_factor=0.067, warmup_length=0.002711864406779661)
cfg.model=detectron2.modeling.GeneralizedRCNN(backbone=detectron2.modeling.FPN(bottom_up=detectron2.modeling.backbone.RegNet(block_class=<class 'detectron2.modeling.backbone.regnet.ResBottleneckBlock'>, depth=23, group_width=40, norm='SyncBN', out_features=['s1','s2','s3','s4'], stem_class=<class 'detectron2.modeling.backbone.regnet.SimpleStem'>, stem_width=32, w_0=96, w_a=38.65, w_m=2.43), in_features=['s1','s2','s3','s4'], norm='SyncBN', out_channels=256, top_block=detectron2.modeling.backbone.fpn.LastLevelMaxPool()), input_format='BGR', pixel_mean=[103.53,116.28,123.675], pixel_std=[57.375,57.12,58.395], proposal_generator=detectron2.modeling.proposal_generator.RPN(anchor_generator=detectron2.modeling.anchor_generator.DefaultAnchorGenerator(aspect_ratios=[0.5,1.0,2.0], offset=0.0, sizes=[[32],[64],[128],[256],[512]], strides=[4,8,16,32,64]), anchor_matcher=detectron2.modeling.matcher.Matcher(allow_low_quality_matches=True, labels=[0,-1,1], thresholds=[0.3,0.7]), batch_size_per_image=256, box2box_transform=detectron2.modeling.box_regression.Box2BoxTransform(weights=[1.0,1.0,1.0,1.0]), head=detectron2.modeling.proposal_generator.StandardRPNHead(conv_dims=[-1,-1], in_channels=256, num_anchors=3), in_features=['p2','p3','p4','p5','p6'], nms_thresh=0.7, positive_fraction=0.5, post_nms_topk=[1000,1000], pre_nms_topk=[2000,1000]), roi_heads=detectron2.modeling.StandardROIHeads(batch_size_per_image=512, box_head=detectron2.modeling.roi_heads.FastRCNNConvFCHead(conv_dims=[256,256,256,256], conv_norm=<function <lambda> at 0x7f2f3a33c488>, fc_dims=[1024], input_shape=ShapeSpec(channels=256, height=7, width=7, stride=None)), box_in_features=['p2','p3','p4','p5'], box_pooler=detectron2.modeling.poolers.ROIPooler(output_size=7, pooler_type='ROIAlignV2', sampling_ratio=0, scales=[0.25,0.125,0.0625,0.03125]), box_predictor=detectron2.modeling.FastRCNNOutputLayers(box2box_transform=detectron2.modeling.box_regression.Box2BoxTransform(weights=[10,10,5,5]), input_shape=ShapeSpec(channels=1024, height=None, width=None, stride=None), num_classes=80, test_score_thresh=0.05), mask_head=detectron2.modeling.roi_heads.MaskRCNNConvUpsampleHead(conv_dims=[256,256,256,256,256], conv_norm=<function <lambda> at 0x7f2f3a33c488>, input_shape=ShapeSpec(channels=256, height=14, width=14, stride=None), num_classes=80), mask_in_features=['p2','p3','p4','p5'], mask_pooler=detectron2.modeling.poolers.ROIPooler(output_size=14, pooler_type='ROIAlignV2', sampling_ratio=0, scales=[0.25,0.125,0.0625,0.03125]), num_classes=80, positive_fraction=0.25, proposal_matcher=detectron2.modeling.matcher.Matcher(allow_low_quality_matches=False, labels=[0,1], thresholds=[0.5])))
cfg.optimizer=torch.optim.SGD(lr=0.1, momentum=0.9, params=detectron2.solver.get_default_optimizer_params(weight_decay_norm=0.0), weight_decay=4e-05)
cfg.train.amp.enabled=True
cfg.train.checkpointer.max_to_keep=100
cfg.train.checkpointer.period=5000
cfg.train.cudnn_benchmark=True
cfg.train.ddp.broadcast_buffers=False
cfg.train.ddp.find_unused_parameters=False
cfg.train.ddp.fp16_compression=True
cfg.train.device='cuda'
cfg.train.eval_period=5000
cfg.train.init_checkpoint=''
cfg.train.log_period=20
cfg.train.max_iter=184375
cfg.train.output_dir='./output' | 235.157895 | 2,673 | 0.816249 | 678 | 4,468 | 5.168142 | 0.384956 | 0.097603 | 0.012842 | 0.027397 | 0.352454 | 0.301655 | 0.234018 | 0.205479 | 0.096461 | 0.061644 | 0 | 0.099563 | 0.026634 | 4,468 | 19 | 2,674 | 235.157895 | 0.706139 | 0 | 0 | 0 | 0 | 0 | 0.052808 | 0.022376 | 0 | 0 | 0.006265 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 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 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
73768d4f12086278e49383178c743ede67c73090 | 544 | py | Python | arekit/contrib/networks/context/architectures/att_ends_pcnn.py | nicolay-r/AREk | 19c39ec0dc9a17464cade03b9c4da0c6d1d21191 | [
"MIT"
] | 18 | 2019-12-14T18:43:11.000Z | 2022-03-21T05:55:36.000Z | arekit/contrib/networks/context/architectures/att_ends_pcnn.py | nicolay-r/AREk | 19c39ec0dc9a17464cade03b9c4da0c6d1d21191 | [
"MIT"
] | 284 | 2020-08-08T20:52:44.000Z | 2022-03-31T05:26:20.000Z | arekit/contrib/networks/context/architectures/att_ends_pcnn.py | nicolay-r/AREk | 19c39ec0dc9a17464cade03b9c4da0c6d1d21191 | [
"MIT"
] | 1 | 2021-08-07T13:17:43.000Z | 2021-08-07T13:17:43.000Z | import tensorflow as tf
from arekit.contrib.networks.context.architectures.base.att_pcnn_base import AttentionPCNNBase
from arekit.contrib.networks.sample import InputSample
class AttentionEndsPCNN(AttentionPCNNBase):
"""
Attention model based on entity pair ends and
PCNN architecture for sentence encoding.
"""
def get_att_input(self):
return tf.stack([self.get_input_parameter(InputSample.I_SUBJ_IND),
self.get_input_parameter(InputSample.I_OBJ_IND)],
axis=-1)
| 34 | 94 | 0.716912 | 65 | 544 | 5.815385 | 0.661538 | 0.05291 | 0.089947 | 0.132275 | 0.174603 | 0.174603 | 0 | 0 | 0 | 0 | 0 | 0.002331 | 0.211397 | 544 | 15 | 95 | 36.266667 | 0.878788 | 0.158088 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0.375 | 0.125 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 3 |
73a8f455eab3052b1eeb0ac0f4fd2965333c2b5d | 192 | py | Python | plugins/mysqlconf.py | fisdap/bosun | b79f6313a00cfdff5e3394dd76bce5c68709147c | [
"MIT"
] | 2,915 | 2015-01-02T08:25:50.000Z | 2022-03-28T12:38:55.000Z | plugins/mysqlconf.py | fisdap/bosun | b79f6313a00cfdff5e3394dd76bce5c68709147c | [
"MIT"
] | 1,553 | 2015-01-01T21:32:47.000Z | 2022-02-20T12:23:58.000Z | plugins/mysqlconf.py | fisdap/bosun | b79f6313a00cfdff5e3394dd76bce5c68709147c | [
"MIT"
] | 632 | 2015-01-02T15:01:29.000Z | 2022-03-22T09:47:33.000Z | #!/usr/bin/env python
def get_user_password(sockfile):
"""Given the path of a socket file, returns a tuple (user, password)."""
return ("root", file('/etc/mysql/root.pw').read().strip())
| 32 | 74 | 0.677083 | 30 | 192 | 4.266667 | 0.833333 | 0.1875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.125 | 192 | 5 | 75 | 38.4 | 0.761905 | 0.453125 | 0 | 0 | 0 | 0 | 0.222222 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | false | 0.5 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
73a9f84dd1741ac77df461882f852899f943be6f | 1,049 | py | Python | appengine/findit/model/base_build_model.py | mithro/chromium-infra | d27ac0b230bedae4bc968515b02927cf9e17c2b7 | [
"BSD-3-Clause"
] | 1 | 2018-01-02T05:47:07.000Z | 2018-01-02T05:47:07.000Z | appengine/findit/model/base_build_model.py | mithro/chromium-infra | d27ac0b230bedae4bc968515b02927cf9e17c2b7 | [
"BSD-3-Clause"
] | null | null | null | appengine/findit/model/base_build_model.py | mithro/chromium-infra | d27ac0b230bedae4bc968515b02927cf9e17c2b7 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from google.appengine.ext import ndb
class BaseBuildModel(ndb.Model): # pragma: no cover
"""A base class to provide computed properties from the key.
The computed properties are master name, builder name, and build number.
Subclasses should set its key as:
build_id = BaseBuildModel.CreateBuildId(
master_name, builder_name, build_number)
ndb.Key('KindName', build_id, 'Optional_KindName', optional_id, ...)
"""
@staticmethod
def CreateBuildId(master_name, builder_name, build_number):
return '%s/%s/%s' % (master_name, builder_name, build_number)
@ndb.ComputedProperty
def master_name(self):
return self.key.pairs()[0][1].split('/')[0]
@ndb.ComputedProperty
def builder_name(self):
return self.key.pairs()[0][1].split('/')[1]
@ndb.ComputedProperty
def build_number(self):
return int(self.key.pairs()[0][1].split('/')[2])
| 31.787879 | 74 | 0.714967 | 149 | 1,049 | 4.926175 | 0.483221 | 0.06812 | 0.092643 | 0.114441 | 0.290191 | 0.290191 | 0.264305 | 0.089918 | 0.089918 | 0 | 0 | 0.01479 | 0.162059 | 1,049 | 32 | 75 | 32.78125 | 0.82025 | 0.476644 | 0 | 0.214286 | 0 | 0 | 0.020873 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0.071429 | 0.285714 | 0.714286 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
73add520ea3daaffe0608bf6f92a2f27cabc1fef | 322 | py | Python | ch0/ch0-1.py | ValentynaGorbachenko/cd2 | ad9e05092ddca9bfef29f185b23fdf5b22099e05 | [
"MIT"
] | null | null | null | ch0/ch0-1.py | ValentynaGorbachenko/cd2 | ad9e05092ddca9bfef29f185b23fdf5b22099e05 | [
"MIT"
] | null | null | null | ch0/ch0-1.py | ValentynaGorbachenko/cd2 | ad9e05092ddca9bfef29f185b23fdf5b22099e05 | [
"MIT"
] | null | null | null | # Setting and Swapping
'''
Set myNumber to 8 and myName to your name. Now swap myNumber into myNane and vice versa.
'''
myName = "Valentyna"
myNumber = 8
print myName, myNumber
print type(myName)
print type(myNumber)
x = myName
myName = myNumber
myNumber = x
print myName, myNumber
print type(myName)
print type(myNumber) | 20.125 | 88 | 0.757764 | 48 | 322 | 5.083333 | 0.416667 | 0.147541 | 0.155738 | 0.196721 | 0.418033 | 0.418033 | 0.418033 | 0.418033 | 0.418033 | 0 | 0 | 0.007407 | 0.161491 | 322 | 16 | 89 | 20.125 | 0.896296 | 0.062112 | 0 | 0.545455 | 0 | 0 | 0.043902 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.545455 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
73ae0bdc8015d67bd7e161c2042d73488896f3e0 | 229 | py | Python | mediaan_days/urls.py | icaka98/mediaan_days | 18f55030c7c4f66a9b18af67be121365c6fa9c86 | [
"MIT"
] | 1 | 2020-06-21T21:37:29.000Z | 2020-06-21T21:37:29.000Z | mediaan_days/urls.py | icaka98/mediaan_days | 18f55030c7c4f66a9b18af67be121365c6fa9c86 | [
"MIT"
] | 5 | 2021-04-08T21:49:08.000Z | 2022-02-10T09:38:24.000Z | mediaan_days/urls.py | icaka98/mediaan_days | 18f55030c7c4f66a9b18af67be121365c6fa9c86 | [
"MIT"
] | 1 | 2020-06-28T17:53:57.000Z | 2020-06-28T17:53:57.000Z | from django.contrib import admin
from django.urls import path, include, re_path
urlpatterns = [
path('admin/', admin.site.urls),
re_path(r'^days/$', include('main_days.urls')),
path(r'', include('main_days.urls'))
]
| 25.444444 | 51 | 0.681223 | 33 | 229 | 4.606061 | 0.424242 | 0.131579 | 0.197368 | 0.25 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.144105 | 229 | 8 | 52 | 28.625 | 0.77551 | 0 | 0 | 0 | 0 | 0 | 0.179039 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.285714 | 0 | 0.285714 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
73b8023caa4f9ff3033f850435ec761e1c23ba41 | 784 | py | Python | BondGraphTools/exceptions.py | likerobotics/BondGraphTools | f8d7531454ac36cf717b37926f0ebdafe2bef9a6 | [
"Apache-2.0"
] | 1 | 2018-05-01T13:28:55.000Z | 2018-05-01T13:28:55.000Z | BondGraphTools/exceptions.py | likerobotics/BondGraphTools | f8d7531454ac36cf717b37926f0ebdafe2bef9a6 | [
"Apache-2.0"
] | 49 | 2018-02-20T04:31:24.000Z | 2018-09-14T06:14:48.000Z | BondGraphTools/exceptions.py | likerobotics/BondGraphTools | f8d7531454ac36cf717b37926f0ebdafe2bef9a6 | [
"Apache-2.0"
] | 3 | 2018-08-13T01:25:00.000Z | 2018-09-14T11:07:17.000Z | """Exceptions and errors for BondGraphTools"""
class InvalidPortException(Exception):
"""Exception for trying to access a port that is in use, or does not
exist """
pass
class InvalidComponentException(Exception):
"""Exception for when trying to use a model that can't be found, or is of
the wrong type"""
class ModelParsingError(Exception):
"""Exception for problems generating symbolic equations from string"""
class ModelException(Exception):
"""Exception for inconsistent or invalid models when running simulations"""
class SymbolicException(Exception):
"""Exception for when there are issues in model reduction or symbolic
manipulation"""
class SolverException(Exception):
"""Exception for issues running numerical solving."""
| 26.133333 | 79 | 0.741071 | 93 | 784 | 6.247312 | 0.591398 | 0.185886 | 0.216867 | 0.086059 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.177296 | 784 | 29 | 80 | 27.034483 | 0.900775 | 0.589286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.142857 | 0 | 0 | 0.857143 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
73deea78042572ca0fc93e48b45cae1f7552b9b1 | 71 | py | Python | python/kids/sum.py | walterfan/snippets | 62f87720c411093fcff888f25b338afd1d99a6f9 | [
"Apache-2.0"
] | 1 | 2021-06-18T09:31:59.000Z | 2021-06-18T09:31:59.000Z | python/kids/sum.py | walterfan/snippets | 62f87720c411093fcff888f25b338afd1d99a6f9 | [
"Apache-2.0"
] | 10 | 2020-12-12T08:12:06.000Z | 2022-03-02T06:54:10.000Z | python/kids/sum.py | walterfan/snippets | 62f87720c411093fcff888f25b338afd1d99a6f9 | [
"Apache-2.0"
] | null | null | null | sum = 0
for i in range (101):
print i
sum = sum + i
print sum
| 10.142857 | 21 | 0.549296 | 14 | 71 | 2.785714 | 0.571429 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.088889 | 0.366197 | 71 | 6 | 22 | 11.833333 | 0.777778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.4 | 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 | 0 | 0 | 3 |
73df707bbb17471b6e101a7c006ac21df56d643b | 511 | py | Python | scoring/views/home.py | alextenczar/3-julian-alex | 9f2aa71769dd6eb6e7dd9e63236c3e7874f02de7 | [
"MIT"
] | null | null | null | scoring/views/home.py | alextenczar/3-julian-alex | 9f2aa71769dd6eb6e7dd9e63236c3e7874f02de7 | [
"MIT"
] | 3 | 2021-06-09T19:34:38.000Z | 2022-02-10T12:25:27.000Z | scoring/views/home.py | alextenczar/3-julian-alex | 9f2aa71769dd6eb6e7dd9e63236c3e7874f02de7 | [
"MIT"
] | null | null | null | from django.views.generic import ListView
from scoring.models import *
from django.shortcuts import render
class HomeListView(ListView):
model = Judge
template_name = 'home.html'
def home(request):
return render(request, 'home.html')
#return render(ListView, 'home.html')
#def import_db(request):
# f = open('Open Scoring UNH Ver09.csv', 'r')
# for line in f:
# line = line.split(',')
# tmp = Judge.object.create()
# tmp.judge_id = line[]
| 24.333333 | 52 | 0.626223 | 64 | 511 | 4.953125 | 0.5625 | 0.07571 | 0.069401 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005208 | 0.248532 | 511 | 20 | 53 | 25.55 | 0.820313 | 0.426614 | 0 | 0 | 0 | 0 | 0.06338 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0.375 | 0.125 | 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 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 3 |
73e9bc79d0b58408169e58a0a67fb34a83f478ad | 490 | py | Python | bluebottle/test/factory_models/payments.py | maykinmedia/bluebottle | 355d4729662b5e9a03398efb4fe882e0f8cfa28d | [
"BSD-3-Clause"
] | null | null | null | bluebottle/test/factory_models/payments.py | maykinmedia/bluebottle | 355d4729662b5e9a03398efb4fe882e0f8cfa28d | [
"BSD-3-Clause"
] | null | null | null | bluebottle/test/factory_models/payments.py | maykinmedia/bluebottle | 355d4729662b5e9a03398efb4fe882e0f8cfa28d | [
"BSD-3-Clause"
] | null | null | null | import factory
from bluebottle.payments.models import Payment, OrderPayment
from bluebottle.payments_logger.models import PaymentLogEntry
from .orders import OrderFactory
class OrderPaymentFactory(factory.DjangoModelFactory):
FACTORY_FOR = OrderPayment
payment_method = 'mock'
amount = 100
order = factory.SubFactory(OrderFactory)
class PaymentFactory(factory.DjangoModelFactory):
FACTORY_FOR = Payment
order_payment = factory.SubFactory(OrderPaymentFactory)
| 24.5 | 61 | 0.804082 | 48 | 490 | 8.104167 | 0.479167 | 0.071979 | 0.113111 | 0.179949 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007109 | 0.138776 | 490 | 19 | 62 | 25.789474 | 0.914692 | 0 | 0 | 0 | 0 | 0 | 0.008163 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 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 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
73ea1d2fbde3b35cf73f0f8f80d7ad31ccf18983 | 84 | py | Python | Assignment-2.2.py | cnaseeb/Programming-for-Everybody-Getting-Started-with-Python- | 70b4b3395e986d51580feac18db2bc810beeb5d8 | [
"Apache-2.0"
] | 1 | 2020-09-27T22:45:25.000Z | 2020-09-27T22:45:25.000Z | Assignment-2.2.py | cnaseeb/Programming-for-Everybody-Getting-Started-with-Python- | 70b4b3395e986d51580feac18db2bc810beeb5d8 | [
"Apache-2.0"
] | null | null | null | Assignment-2.2.py | cnaseeb/Programming-for-Everybody-Getting-Started-with-Python- | 70b4b3395e986d51580feac18db2bc810beeb5d8 | [
"Apache-2.0"
] | null | null | null | # The code below almost works
name = input("Enter your name")
print("Hello", name)
| 16.8 | 31 | 0.702381 | 13 | 84 | 4.538462 | 0.846154 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 84 | 4 | 32 | 21 | 0.842857 | 0.321429 | 0 | 0 | 0 | 0 | 0.363636 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.5 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
73feaef510ce416453d8a03f7a4ae54dc8304fd7 | 122 | py | Python | Unit 3/3.5/3.5.7 Rectangle, Pt2.py | shashwat73/cse | 60e49307e57105cf9916c7329f53f891c5e81fdb | [
"MIT"
] | 1 | 2021-04-08T14:02:49.000Z | 2021-04-08T14:02:49.000Z | Unit 3/3.5/3.5.7 Rectangle, Pt2.py | shashwat73/cse | 60e49307e57105cf9916c7329f53f891c5e81fdb | [
"MIT"
] | null | null | null | Unit 3/3.5/3.5.7 Rectangle, Pt2.py | shashwat73/cse | 60e49307e57105cf9916c7329f53f891c5e81fdb | [
"MIT"
] | null | null | null | area = 50
perimeter = 30
width = 1281
length = 1913
print "Area" + str(area)
print "Perimeter" + str(perimeter)
| 13.555556 | 35 | 0.639344 | 16 | 122 | 4.875 | 0.625 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.130435 | 0.245902 | 122 | 8 | 36 | 15.25 | 0.717391 | 0 | 0 | 0 | 0 | 0 | 0.114035 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.333333 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
fb43f0f73e6d947789bb44c3bfd201d27141ef48 | 1,396 | py | Python | deep-rl/lib/python2.7/site-packages/OpenGL/GL/EXT/texture_mirror_clamp.py | ShujaKhalid/deep-rl | 99c6ba6c3095d1bfdab81bd01395ced96bddd611 | [
"MIT"
] | 210 | 2016-04-09T14:26:00.000Z | 2022-03-25T18:36:19.000Z | deep-rl/lib/python2.7/site-packages/OpenGL/GL/EXT/texture_mirror_clamp.py | ShujaKhalid/deep-rl | 99c6ba6c3095d1bfdab81bd01395ced96bddd611 | [
"MIT"
] | 72 | 2016-09-04T09:30:19.000Z | 2022-03-27T17:06:53.000Z | deep-rl/lib/python2.7/site-packages/OpenGL/GL/EXT/texture_mirror_clamp.py | ShujaKhalid/deep-rl | 99c6ba6c3095d1bfdab81bd01395ced96bddd611 | [
"MIT"
] | 64 | 2016-04-09T14:26:49.000Z | 2022-03-21T11:19:47.000Z | '''OpenGL extension EXT.texture_mirror_clamp
This module customises the behaviour of the
OpenGL.raw.GL.EXT.texture_mirror_clamp to provide a more
Python-friendly API
Overview (from the spec)
EXT_texture_mirror_clamp extends the set of texture wrap modes to
include three modes (GL_MIRROR_CLAMP_EXT, GL_MIRROR_CLAMP_TO_EDGE_EXT,
GL_MIRROR_CLAMP_TO_BORDER_EXT) that effectively use a texture map
twice as large as the original image in which the additional half
of the new image is a mirror image of the original image.
This new mode relaxes the need to generate images whose opposite
edges match by using the original image to generate a matching
"mirror image". This mode allows the texture to be mirrored only
once in the negative s, t, and r directions.
The official definition of this extension is available here:
http://www.opengl.org/registry/specs/EXT/texture_mirror_clamp.txt
'''
from OpenGL import platform, constant, arrays
from OpenGL import extensions, wrapper
import ctypes
from OpenGL.raw.GL import _types, _glgets
from OpenGL.raw.GL.EXT.texture_mirror_clamp import *
from OpenGL.raw.GL.EXT.texture_mirror_clamp import _EXTENSION_NAME
def glInitTextureMirrorClampEXT():
'''Return boolean indicating whether this extension is available'''
from OpenGL import extensions
return extensions.hasGLExtension( _EXTENSION_NAME )
### END AUTOGENERATED SECTION | 38.777778 | 71 | 0.809456 | 216 | 1,396 | 5.083333 | 0.462963 | 0.090164 | 0.087432 | 0.114754 | 0.138434 | 0.105647 | 0.105647 | 0.076503 | 0.076503 | 0 | 0 | 0 | 0.143266 | 1,396 | 36 | 72 | 38.777778 | 0.91806 | 0.762178 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | true | 0 | 0.777778 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
fb480eac991bbe43cd718ee6ec58ee58f439dd25 | 140 | py | Python | setup.py | ottiram/pyMMAX2 | 9bd65b21553607deba3fc7eda7149866f79c056b | [
"Apache-2.0"
] | null | null | null | setup.py | ottiram/pyMMAX2 | 9bd65b21553607deba3fc7eda7149866f79c056b | [
"Apache-2.0"
] | null | null | null | setup.py | ottiram/pyMMAX2 | 9bd65b21553607deba3fc7eda7149866f79c056b | [
"Apache-2.0"
] | null | null | null | from setuptools import setup
setup(
name='PyMMAX2',
packages=['pymmax2'],
include_package_data=True,
version="0.65.2"
) | 17.5 | 30 | 0.65 | 17 | 140 | 5.235294 | 0.882353 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.054545 | 0.214286 | 140 | 8 | 31 | 17.5 | 0.754545 | 0 | 0 | 0 | 0 | 0 | 0.141844 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.142857 | 0 | 0.142857 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
fb60bb72c8d6f4c9e4d5885ac4a4422f6f1d3e81 | 194 | py | Python | authlib/oidc/core/grants/__init__.py | YPCrumble/authlib | 782a0fced780849418dc2a869528d10387e24b65 | [
"BSD-3-Clause"
] | 1 | 2021-12-23T06:38:11.000Z | 2021-12-23T06:38:11.000Z | authlib/oidc/core/grants/__init__.py | YPCrumble/authlib | 782a0fced780849418dc2a869528d10387e24b65 | [
"BSD-3-Clause"
] | 10 | 2020-09-30T05:41:05.000Z | 2021-11-03T08:55:31.000Z | authlib/oidc/core/grants/__init__.py | YPCrumble/authlib | 782a0fced780849418dc2a869528d10387e24b65 | [
"BSD-3-Clause"
] | 2 | 2021-09-22T07:55:39.000Z | 2022-03-12T10:05:39.000Z | from .code import OpenIDCode
from .implicit import OpenIDImplicitGrant
from .hybrid import OpenIDHybridGrant
__all__ = [
'OpenIDCode',
'OpenIDImplicitGrant',
'OpenIDHybridGrant',
]
| 19.4 | 41 | 0.757732 | 16 | 194 | 8.9375 | 0.5625 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.164948 | 194 | 9 | 42 | 21.555556 | 0.882716 | 0 | 0 | 0 | 0 | 0 | 0.237113 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.375 | 0 | 0.375 | 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 | 0 | 0 | 0 | 3 |
fb85cce7c7b849b82d5a4b9c21dc79acef2f8d2e | 1,015 | py | Python | aiotdlib/api/types/connected_websites.py | jraylan/aiotdlib | 4528fcfca7c5c69b54a878ce6ce60e934a2dcc73 | [
"MIT"
] | 37 | 2021-05-04T10:41:41.000Z | 2022-03-30T13:48:05.000Z | aiotdlib/api/types/connected_websites.py | jraylan/aiotdlib | 4528fcfca7c5c69b54a878ce6ce60e934a2dcc73 | [
"MIT"
] | 13 | 2021-07-17T19:54:51.000Z | 2022-02-26T06:50:00.000Z | aiotdlib/api/types/connected_websites.py | jraylan/aiotdlib | 4528fcfca7c5c69b54a878ce6ce60e934a2dcc73 | [
"MIT"
] | 7 | 2021-09-22T21:27:11.000Z | 2022-02-20T02:33:19.000Z | # =============================================================================== #
# #
# This file has been generated automatically!! Do not change this manually! #
# #
# =============================================================================== #
from __future__ import annotations
from pydantic import Field
from .connected_website import ConnectedWebsite
from ..base_object import BaseObject
class ConnectedWebsites(BaseObject):
"""
Contains a list of websites the current user is logged in with Telegram
:param websites: List of connected websites
:type websites: :class:`list[ConnectedWebsite]`
"""
ID: str = Field("connectedWebsites", alias="@type")
websites: list[ConnectedWebsite]
@staticmethod
def read(q: dict) -> ConnectedWebsites:
return ConnectedWebsites.construct(**q)
| 35 | 83 | 0.482759 | 75 | 1,015 | 6.453333 | 0.653333 | 0.024793 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.301478 | 1,015 | 28 | 84 | 36.25 | 0.682652 | 0.560591 | 0 | 0 | 1 | 0 | 0.054591 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.1 | false | 0 | 0.4 | 0.1 | 0.9 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
fb97a0dfd8b5b2131799fefdf8500293745e5162 | 484 | py | Python | chainerrl/v_function.py | takeratta/chainerrl | 51a2762246db2964fe97e596fd98a1a1cbfea19a | [
"MIT"
] | 4 | 2019-05-05T21:37:09.000Z | 2020-06-04T11:40:51.000Z | chainerrl/v_function.py | takeratta/chainerrl | 51a2762246db2964fe97e596fd98a1a1cbfea19a | [
"MIT"
] | 1 | 2018-05-29T06:38:22.000Z | 2018-05-29T06:38:22.000Z | chainerrl/v_function.py | takeratta/chainerrl | 51a2762246db2964fe97e596fd98a1a1cbfea19a | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from builtins import * # NOQA
from future import standard_library
standard_library.install_aliases()
from abc import ABCMeta
from abc import abstractmethod
from future.utils import with_metaclass
class VFunction(with_metaclass(ABCMeta, object)):
@abstractmethod
def __call__(self, x):
raise NotImplementedError()
| 24.2 | 49 | 0.816116 | 59 | 484 | 6.220339 | 0.508475 | 0.163488 | 0.217984 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.144628 | 484 | 19 | 50 | 25.473684 | 0.886473 | 0.008264 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.071429 | false | 0 | 0.642857 | 0 | 0.785714 | 0.071429 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
fbadd1db80d7b87f1090c3a61f08321539d49b51 | 64 | py | Python | pycharm/0621/__init__.py | jsqwert/ML-Class | 276c052bbe37914c289391d0d2d1be03e471086d | [
"Apache-2.0"
] | null | null | null | pycharm/0621/__init__.py | jsqwert/ML-Class | 276c052bbe37914c289391d0d2d1be03e471086d | [
"Apache-2.0"
] | null | null | null | pycharm/0621/__init__.py | jsqwert/ML-Class | 276c052bbe37914c289391d0d2d1be03e471086d | [
"Apache-2.0"
] | null | null | null | # -- encoding:utf-8 --
"""
Create by ibf on 2018/6/21
"""
| 10.666667 | 27 | 0.5 | 10 | 64 | 3.2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.170213 | 0.265625 | 64 | 5 | 28 | 12.8 | 0.510638 | 0.75 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
fbadf4fdf55082cae10494b64685bf59b329e6c4 | 349 | py | Python | runtests.py | matwey/django-eremaea2 | 71dd65cf9b53a6b256e8445f8adc7c05b78ebe70 | [
"BSD-2-Clause"
] | null | null | null | runtests.py | matwey/django-eremaea2 | 71dd65cf9b53a6b256e8445f8adc7c05b78ebe70 | [
"BSD-2-Clause"
] | 12 | 2016-04-03T14:54:39.000Z | 2021-12-26T12:43:57.000Z | runtests.py | matwey/django-eremaea2 | 71dd65cf9b53a6b256e8445f8adc7c05b78ebe70 | [
"BSD-2-Clause"
] | 1 | 2020-07-10T18:20:27.000Z | 2020-07-10T18:20:27.000Z | #!/usr/bin/env python
import os
def runtests():
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.test_settings")
try:
from django import setup
setup()
except ImportError:
pass
from django.core.management import call_command
os.sys.exit(call_command("test", "tests.test_all", verbosity=2))
if __name__ == "__main__":
runtests()
| 19.388889 | 71 | 0.74212 | 48 | 349 | 5.104167 | 0.6875 | 0.073469 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003289 | 0.12894 | 349 | 17 | 72 | 20.529412 | 0.802632 | 0.057307 | 0 | 0 | 0 | 0 | 0.204268 | 0.067073 | 0 | 0 | 0 | 0 | 0 | 1 | 0.083333 | true | 0.083333 | 0.333333 | 0 | 0.416667 | 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 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.