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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
57f95ca5bbe9ef79c0bb275f4252ce6aff606279
| 95
|
py
|
Python
|
fba/data/datasets/__init__.py
|
hukkelas/full_body_anonymization
|
c61745b137c84ffb742ef6ab2f4721db4acf22b7
|
[
"MIT"
] | 27
|
2022-01-06T20:15:24.000Z
|
2022-03-29T11:54:49.000Z
|
fba/data/datasets/__init__.py
|
hukkelas/full_body_anonymization
|
c61745b137c84ffb742ef6ab2f4721db4acf22b7
|
[
"MIT"
] | 2
|
2022-03-17T06:04:23.000Z
|
2022-03-25T08:50:57.000Z
|
fba/data/datasets/__init__.py
|
hukkelas/full_body_anonymization
|
c61745b137c84ffb742ef6ab2f4721db4acf22b7
|
[
"MIT"
] | 2
|
2022-01-07T13:16:59.000Z
|
2022-01-16T02:10:50.000Z
|
from .build import build_dataset
from .cse import CocoCSE
from .deep_fashion import DeepFashion
| 31.666667
| 37
| 0.852632
| 14
| 95
| 5.642857
| 0.642857
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.115789
| 95
| 3
| 37
| 31.666667
| 0.940476
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
17aa219cc98ced57a25e6590b42a1d62ff792a41
| 168
|
py
|
Python
|
tests/web_platform/CSS2/normal_flow/test_block_formatting_contexts.py
|
jonboland/colosseum
|
cbf974be54fd7f6fddbe7285704cfaf7a866c5c5
|
[
"BSD-3-Clause"
] | 71
|
2015-04-13T09:44:14.000Z
|
2019-03-24T01:03:02.000Z
|
tests/web_platform/CSS2/normal_flow/test_block_formatting_contexts.py
|
jonboland/colosseum
|
cbf974be54fd7f6fddbe7285704cfaf7a866c5c5
|
[
"BSD-3-Clause"
] | 35
|
2019-05-06T15:26:09.000Z
|
2022-03-28T06:30:33.000Z
|
tests/web_platform/CSS2/normal_flow/test_block_formatting_contexts.py
|
jonboland/colosseum
|
cbf974be54fd7f6fddbe7285704cfaf7a866c5c5
|
[
"BSD-3-Clause"
] | 139
|
2015-05-30T18:37:43.000Z
|
2019-03-27T17:14:05.000Z
|
from tests.utils import W3CTestCase
class TestBlockFormattingContexts(W3CTestCase):
vars().update(W3CTestCase.find_tests(__file__, 'block-formatting-contexts-'))
| 28
| 81
| 0.809524
| 17
| 168
| 7.705882
| 0.823529
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.019481
| 0.083333
| 168
| 5
| 82
| 33.6
| 0.831169
| 0
| 0
| 0
| 0
| 0
| 0.154762
| 0.154762
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
17d6501b6ac0eda946b2c483d253d6e23fbb4a47
| 52
|
py
|
Python
|
ice/error/__init__.py
|
reavessm/Ice
|
e78d046abfd6006b1a81d1cbdb516b7c3e141ac9
|
[
"MIT"
] | 578
|
2015-01-02T12:43:52.000Z
|
2022-03-27T23:45:32.000Z
|
ice/error/__init__.py
|
reavessm/Ice
|
e78d046abfd6006b1a81d1cbdb516b7c3e141ac9
|
[
"MIT"
] | 271
|
2015-01-05T01:56:38.000Z
|
2021-08-14T02:51:24.000Z
|
ice/error/__init__.py
|
reavessm/Ice
|
e78d046abfd6006b1a81d1cbdb516b7c3e141ac9
|
[
"MIT"
] | 156
|
2015-01-07T15:43:20.000Z
|
2021-12-11T19:10:44.000Z
|
from human_readable_error import HumanReadableError
| 26
| 51
| 0.923077
| 6
| 52
| 7.666667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.076923
| 52
| 2
| 51
| 26
| 0.958333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
17ffa6dbaef85227b6c098b9b1fe55bf58611b40
| 77
|
py
|
Python
|
2020-04-16 - Python Medellin - Creating a chat service with WebSockets/Examples/Chat/app/blueprints/__init__.py
|
williamegomezo/Talks
|
0b123c6c8dec9c1a2357c142b617109068caf060
|
[
"MIT"
] | 2
|
2020-04-24T23:03:41.000Z
|
2020-11-10T15:08:38.000Z
|
2020-04-16 - Python Medellin - Creating a chat service with WebSockets/Examples/Chat/app/blueprints/__init__.py
|
williamegomezo/Talks
|
0b123c6c8dec9c1a2357c142b617109068caf060
|
[
"MIT"
] | 5
|
2021-03-10T11:42:15.000Z
|
2022-02-10T21:38:54.000Z
|
2020-04-16 - Python Medellin - Creating a chat service with WebSockets/Examples/Chat/app/blueprints/__init__.py
|
williamegomezo/Talks
|
0b123c6c8dec9c1a2357c142b617109068caf060
|
[
"MIT"
] | 4
|
2020-10-01T04:32:27.000Z
|
2022-02-14T15:08:16.000Z
|
from .auth import auth_blueprint
from .websockets import websockets_blueprint
| 38.5
| 44
| 0.883117
| 10
| 77
| 6.6
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.090909
| 77
| 2
| 44
| 38.5
| 0.942857
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 1
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
|
0
| 5
|
aa1baf1f2219412da1096ceed51d9dc0ea5ebce7
| 1,334
|
py
|
Python
|
src/Zope2/utilities/zpasswd.py
|
hitotsunorb1/Zope
|
6beac6385e1a302903889561385013874ef94cb1
|
[
"ZPL-2.1"
] | null | null | null |
src/Zope2/utilities/zpasswd.py
|
hitotsunorb1/Zope
|
6beac6385e1a302903889561385013874ef94cb1
|
[
"ZPL-2.1"
] | null | null | null |
src/Zope2/utilities/zpasswd.py
|
hitotsunorb1/Zope
|
6beac6385e1a302903889561385013874ef94cb1
|
[
"ZPL-2.1"
] | null | null | null |
##############################################################################
#
# Copyright (c) 2001,2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
#
##############################################################################
from zope.deferredimport import deprecated
# BBB Zope 5.0
deprecated(
'Please import from ZServer.Zope2.utilities.zpasswd',
generate_salt='ZServer.Zope2.utilities.zpasswd:generate_salt',
generate_passwd='ZServer.Zope2.utilities.zpasswd:generate_passwd',
write_generated_password=('ZServer.Zope2.utilities.zpasswd:'
'write_generated_password'),
write_access='ZServer.Zope2.utilities.zpasswd:write_access',
get_password='ZServer.Zope2.utilities.zpasswd:get_password',
write_inituser='ZServer.Zope2.utilities.zpasswd:write_inituser',
usage='ZServer.Zope2.utilities.zpasswd:usage',
main='ZServer.Zope2.utilities.zpasswd:main',
)
| 43.032258
| 78
| 0.670165
| 150
| 1,334
| 5.866667
| 0.493333
| 0.122727
| 0.214773
| 0.286364
| 0.294318
| 0.090909
| 0
| 0
| 0
| 0
| 0
| 0.018119
| 0.131184
| 1,334
| 30
| 79
| 44.466667
| 0.741156
| 0.353823
| 0
| 0
| 0
| 0
| 0.584416
| 0.556999
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.769231
| 0.153846
| 0
| 0.153846
| 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
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
aa332a45bfb905d979237fb5523fc7d93eb62577
| 90
|
py
|
Python
|
meteoblue_dataset_sdk/caching/__init__.py
|
tibz7/python-dataset-sdk
|
304649d1884f4e41702d029edd02717be81c9bad
|
[
"MIT"
] | 4
|
2020-11-26T18:01:49.000Z
|
2021-09-16T16:25:35.000Z
|
meteoblue_dataset_sdk/caching/__init__.py
|
darfnic/python-dataset-sdk
|
74db4db321a2667828f78cffd899ba83deca43d1
|
[
"MIT"
] | 3
|
2021-02-08T13:45:06.000Z
|
2021-11-22T13:48:59.000Z
|
meteoblue_dataset_sdk/caching/__init__.py
|
darfnic/python-dataset-sdk
|
74db4db321a2667828f78cffd899ba83deca43d1
|
[
"MIT"
] | 5
|
2020-11-30T11:40:50.000Z
|
2021-11-22T13:39:00.000Z
|
from .abstractcache import AbstractCache # noqa
from .filecache import FileCache # noqa
| 30
| 48
| 0.8
| 10
| 90
| 7.2
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.155556
| 90
| 2
| 49
| 45
| 0.947368
| 0.1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
a4adda4e4ddbba6704fcb0c1f7c5f0e7a522265a
| 1,725
|
py
|
Python
|
accounts/forms.py
|
Josue-cloudU/Biblioteca
|
cfb41f286488e540390ffe2973caf448da5d289b
|
[
"MIT"
] | null | null | null |
accounts/forms.py
|
Josue-cloudU/Biblioteca
|
cfb41f286488e540390ffe2973caf448da5d289b
|
[
"MIT"
] | null | null | null |
accounts/forms.py
|
Josue-cloudU/Biblioteca
|
cfb41f286488e540390ffe2973caf448da5d289b
|
[
"MIT"
] | null | null | null |
from django import forms
from django.forms import ModelForm
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
class CustomUserForm(UserCreationForm):
class Meta:
model = User
fields = ('username', 'first_name', 'last_name', 'email', 'password1', 'password2',)
def clean_email(self):
email = self.cleaned_data["email"]
if User.objects.filter(email=email).exists():
raise forms.ValidationError('Correo ya esta registrado')
return email
class CustomUserStaffForm(UserCreationForm):
class Meta:
model = User
fields = ('username', 'first_name', 'last_name', 'email', 'password1', 'password2', 'is_staff')
def clean_email(self):
email = self.cleaned_data["email"]
if User.objects.filter(email=email).exists():
raise forms.ValidationError('Correo ya esta registrado')
return email
class UpdateUserForm(UserCreationForm):
class Meta:
model = User
fields = ('username', 'first_name', 'last_name', 'email', 'is_active', 'is_staff')
widgets = {
'password1': forms.TextInput(
attrs = {
'class': 'form-control',
'readonly': True
}
),
'password2': forms.TextInput(
attrs = {
'class': 'form-control',
'readonly': True
}
)
}
def clean_email(self):
email = self.cleaned_data["email"]
if User.objects.filter(email=email).exists():
raise forms.ValidationError('Correo ya esta registrado')
return email
| 33.823529
| 103
| 0.582609
| 169
| 1,725
| 5.857988
| 0.295858
| 0.054545
| 0.075758
| 0.090909
| 0.762626
| 0.762626
| 0.762626
| 0.762626
| 0.667677
| 0.667677
| 0
| 0.004992
| 0.303188
| 1,725
| 50
| 104
| 34.5
| 0.818636
| 0
| 0
| 0.6
| 0
| 0
| 0.182609
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.066667
| false
| 0.088889
| 0.088889
| 0
| 0.355556
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
a4d6639d82bf1e797bcadcfe86f9d95b02c1234d
| 3,112
|
py
|
Python
|
tests/bak/stock_S153_3rd/ui_display_klines.py
|
garywangiam02/vnpy
|
fbb168bf977d95ae874e92a3655c6c893db16a1f
|
[
"MIT"
] | null | null | null |
tests/bak/stock_S153_3rd/ui_display_klines.py
|
garywangiam02/vnpy
|
fbb168bf977d95ae874e92a3655c6c893db16a1f
|
[
"MIT"
] | null | null | null |
tests/bak/stock_S153_3rd/ui_display_klines.py
|
garywangiam02/vnpy
|
fbb168bf977d95ae874e92a3655c6c893db16a1f
|
[
"MIT"
] | null | null | null |
# flake8: noqa
"""
多周期显示K线,
时间点同步
华富资产/李来佳
"""
from vnpy.trader.ui.kline.kline import *
from vnpy.trader.ui.kline.crosshair import Crosshair
import sys
import os
import ctypes
import platform
system = platform.system()
os.environ["VNPY_TESTING"] = "1"
# 将repostory的目录,作为根目录,添加到系统环境中。
ROOT_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))
sys.path.append(ROOT_PATH)
if __name__ == '__main__':
# K线界面
try:
kline_settings = {
"D1":
{
"data_file": "log/stock_3rd_buy_1024_1921_300750.SZSE/stock_S153_300750.SZSE_300750.SZSE_D1.csv",
"main_indicators": [
"ma55", "ma89"
], # ,"upper","lower"
"sub_indicators": [
"dif", 'dea'
], # "dif",'dea',, 'macd'
"trade_file": "log/stock_3rd_buy_1024_1921_300750.SZSE/stock_S153_300750.SZSE_trade.csv",
# "dist_file": "log/stock_3rd_buy_1024_1921_300750.SZSE/stock_s144_000651.SZSE_dist.csv",
"bi_file": "log/stock_3rd_buy_1024_1921_300750.SZSE/stock_S153_300750.SZSE_300750.SZSE_D1_bi.csv",
"duan_file": "log/stock_3rd_buy_1024_1921_300750.SZSE/stock_S153_300750.SZSE_300750.SZSE_D1_duan.csv",
"bi_zs_file": "log/stock_3rd_buy_1024_1921_300750.SZSE/stock_S153_300750.SZSE_300750.SZSE_D1_zs.csv",
# "dist_include_list": ["short_break","top_div","top_div2",
# "long_break", "rev","break_fail","break_fail2","break_fail3"
# ]
},
"M30":
{
"data_file": "log/stock_3rd_buy_1024_1921_300750.SZSE/stock_S153_300750.SZSE_300750.SZSE_M30.csv",
"main_indicators": [
"ma55", "ma89"
], # ,"upper","lower"
"sub_indicators": [
"dif", 'dea'
], # "dif",'dea',, 'macd'
"trade_file": "log/stock_3rd_buy_1024_1921_300750.SZSE/stock_S153_300750.SZSE_trade.csv",
# "dist_file": "log/stock_3rd_buy_1024_1921_300750.SZSE/stock_s144_000651.SZSE_dist.csv",
"bi_file": "log/stock_3rd_buy_1024_1921_300750.SZSE/stock_S153_300750.SZSE_300750.SZSE_M30_bi.csv",
"duan_file": "log/stock_3rd_buy_1024_1921_300750.SZSE/stock_S153_300750.SZSE_300750.SZSE_M30_duan.csv",
"bi_zs_file": "log/stock_3rd_buy_1024_1921_300750.SZSE/stock_S153_300750.SZSE_300750.SZSE_M30_zs.csv",
# "dist_include_list": ["short_break","top_div","top_div2",
# "long_break", "rev","break_fail","break_fail2","break_fail3"
# ]
}
}
display_multi_grid(kline_settings)
except Exception as ex:
print(u'exception:{},trace:{}'.format(str(ex), traceback.format_exc()))
| 42.630137
| 123
| 0.558805
| 363
| 3,112
| 4.333333
| 0.253444
| 0.190718
| 0.091545
| 0.114431
| 0.761602
| 0.734901
| 0.734901
| 0.734901
| 0.734901
| 0.734901
| 0
| 0.172543
| 0.316517
| 3,112
| 72
| 124
| 43.222222
| 0.566996
| 0.210154
| 0
| 0.311111
| 0
| 0
| 0.428982
| 0.344417
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.133333
| 0
| 0.133333
| 0.022222
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 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
| 5
|
3504b555f358df64616f85ef9495c3b751001964
| 267
|
py
|
Python
|
tests/arbpack/arbloader.py
|
Reskov/pypyr
|
67bc1795493c19e648e12f776a644f92e3bd2fc8
|
[
"Apache-2.0"
] | 261
|
2020-08-18T19:31:29.000Z
|
2022-03-31T14:54:06.000Z
|
tests/arbpack/arbloader.py
|
Reskov/pypyr
|
67bc1795493c19e648e12f776a644f92e3bd2fc8
|
[
"Apache-2.0"
] | 73
|
2020-08-14T20:21:14.000Z
|
2022-03-14T14:00:16.000Z
|
tests/arbpack/arbloader.py
|
Reskov/pypyr
|
67bc1795493c19e648e12f776a644f92e3bd2fc8
|
[
"Apache-2.0"
] | 15
|
2020-09-30T12:15:50.000Z
|
2022-03-30T07:25:40.000Z
|
"""Test custom loader which returns directly the same thing that was passed."""
def get_pipeline_definition(pipeline_name, working_dir):
"""Return inputs as a mock pipeline loader stub."""
return {'pipeline_name': pipeline_name, 'working_dir': working_dir}
| 38.142857
| 79
| 0.756554
| 37
| 267
| 5.243243
| 0.675676
| 0.185567
| 0.195876
| 0.226804
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.142322
| 267
| 6
| 80
| 44.5
| 0.847162
| 0.445693
| 0
| 0
| 0
| 0
| 0.175182
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
354aef7ce9ad8bce6638d12ce3077069b173a03d
| 2,044
|
py
|
Python
|
repos/.cache/init.vim/.dein/test/rplugin/python3/deoplete/test_util.py
|
adaschevici/neovm
|
93f9589bca95b239c63d0e56164232be1b9eadc5
|
[
"MIT"
] | null | null | null |
repos/.cache/init.vim/.dein/test/rplugin/python3/deoplete/test_util.py
|
adaschevici/neovm
|
93f9589bca95b239c63d0e56164232be1b9eadc5
|
[
"MIT"
] | null | null | null |
repos/.cache/init.vim/.dein/test/rplugin/python3/deoplete/test_util.py
|
adaschevici/neovm
|
93f9589bca95b239c63d0e56164232be1b9eadc5
|
[
"MIT"
] | null | null | null |
import deoplete.util as util
def test_pos():
assert util.bytepos2charpos('utf-8', 'foo bar', 3) == 3
assert util.bytepos2charpos('utf-8', 'あああ', 3) == 1
assert util.charpos2bytepos('utf-8', 'foo bar', 3) == 3
assert util.charpos2bytepos('utf-8', 'あああ', 3) == 9
def test_custom():
custom = {'source':{}}
custom['source'] = {'_': {'mark': ''}, 'java': {'converters': []}}
assert util.get_custom(custom, 'java', 'mark', 'foobar') == ''
assert util.get_custom(custom, 'java', 'converters', 'foobar') == []
assert util.get_custom(custom, 'foo', 'mark', 'foobar') == ''
assert util.get_custom(custom, 'foo', 'converters', 'foobar') == 'foobar'
def test_globruntime():
assert util.globruntime('/usr', 'bin') == ['/usr/bin']
def test_binary_search():
assert util.binary_search_begin([], '') == -1
assert util.binary_search_begin([{'word': 'abc'}], 'abc') == 0
assert util.binary_search_begin([
{'word': 'aaa'}, {'word': 'abc'},
], 'abc') == 1
assert util.binary_search_begin([
{'word': 'a'}, {'word': 'aaa'}, {'word': 'abc'},
], 'abc') == 2
assert util.binary_search_begin([
{'word': 'a'}, {'word': 'aaa'}, {'word': 'AbC'},
], 'abc') == 2
assert util.binary_search_begin([
{'word': 'a'}, {'word': 'aaa'}, {'word': 'abc'},
], 'b') == -1
assert util.binary_search_begin([
{'word': 'a'}, {'word': 'aaa'}, {'word': 'aac'}, {'word': 'abc'},
], 'aa') == 1
assert util.binary_search_end([], '') == -1
assert util.binary_search_end([{'word': 'abc'}], 'abc') == 0
assert util.binary_search_end([
{'word': 'aaa'}, {'word': 'abc'},
], 'abc') == 1
assert util.binary_search_end([
{'word': 'a'}, {'word': 'aaa'}, {'word': 'abc'},
], 'abc') == 2
assert util.binary_search_end([
{'word': 'a'}, {'word': 'aaa'}, {'word': 'abc'},
], 'b') == -1
assert util.binary_search_end([
{'word': 'a'}, {'word': 'aaa'}, {'word': 'aac'}, {'word': 'abc'},
], 'aa') == 2
| 35.859649
| 77
| 0.526908
| 246
| 2,044
| 4.231707
| 0.166667
| 0.211335
| 0.199808
| 0.274736
| 0.805956
| 0.695485
| 0.631124
| 0.476465
| 0.370797
| 0.347743
| 0
| 0.017912
| 0.207926
| 2,044
| 56
| 78
| 36.5
| 0.625077
| 0
| 0
| 0.510638
| 0
| 0
| 0.182975
| 0
| 0
| 0
| 0
| 0
| 0.468085
| 1
| 0.085106
| false
| 0
| 0.021277
| 0
| 0.106383
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
1049e977d58387b6e5e84562b7178afc07d2c32a
| 11,784
|
py
|
Python
|
tests/layer_tests/onnx_tests/test_reshape.py
|
pfinashx/openvino
|
1d417e888b508415510fb0a92e4a9264cf8bdef7
|
[
"Apache-2.0"
] | 1
|
2022-02-26T17:33:44.000Z
|
2022-02-26T17:33:44.000Z
|
tests/layer_tests/onnx_tests/test_reshape.py
|
pfinashx/openvino
|
1d417e888b508415510fb0a92e4a9264cf8bdef7
|
[
"Apache-2.0"
] | 18
|
2022-01-21T08:42:58.000Z
|
2022-03-28T13:21:31.000Z
|
tests/layer_tests/onnx_tests/test_reshape.py
|
pfinashx/openvino
|
1d417e888b508415510fb0a92e4a9264cf8bdef7
|
[
"Apache-2.0"
] | null | null | null |
# Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
from common.layer_test_class import check_ir_version
from common.onnx_layer_test_class import Caffe2OnnxLayerTest
from unit_tests.utils.graph import build_graph
class TestReshape(Caffe2OnnxLayerTest):
def create_reshape_net(self, input_shape, output_shape, ir_version):
"""
ONNX net IR net
Input->Reshape->Output => Input->Reshape
"""
#
# Create ONNX model
#
import onnx
from onnx import helper
from onnx import TensorProto
input = helper.make_tensor_value_info('input', TensorProto.FLOAT, input_shape)
output = helper.make_tensor_value_info('output', TensorProto.FLOAT, output_shape)
node_shape_def = onnx.helper.make_node(
'Constant',
inputs=[],
outputs=['shape'],
value=helper.make_tensor(
name='const_tensor',
data_type=TensorProto.INT64,
dims=[len(output_shape)],
vals=output_shape,
),
)
node_reshape_def = onnx.helper.make_node(
'Reshape',
inputs=['input', 'shape'],
outputs=['output']
)
# Create the graph (GraphProto)
graph_def = helper.make_graph(
[node_shape_def, node_reshape_def],
'test_reshape_model',
[input],
[output],
)
# Create the model (ModelProto)
onnx_net = helper.make_model(graph_def, producer_name='test_reshape_model')
#
# Create reference IR net
# Please, specify 'type': 'Input' for input node
# Moreover, do not forget to validate ALL layer attributes!!!
#
ref_net = None
if check_ir_version(10, None, ir_version):
nodes_attributes = {
'input': {'kind': 'op', 'type': 'Parameter'},
'input_data': {'shape': input_shape, 'kind': 'data'},
'input_data_1': {'shape': [len(output_shape)], 'value': output_shape, 'kind': 'data'},
'const_1': {'kind': 'op', 'type': 'Const'},
'const_data_1': {'shape': [len(output_shape)], 'value': None, 'kind': 'data'}, # 'value': output_shape,
'reshape': {'kind': 'op', 'type': 'Reshape'},
'reshape_data': {'shape': output_shape, 'kind': 'data'},
'result': {'kind': 'op', 'type': 'Result'}
}
ref_net = build_graph(nodes_attributes,
[('input', 'input_data'),
('input_data_1', 'const_1'),
('const_1', 'const_data_1'),
('const_data_1', 'reshape'),
('input_data', 'reshape'),
('reshape', 'reshape_data'),
('reshape_data', 'result')
])
return onnx_net, ref_net
def create_reshape_net_const(self, input_shape, output_shape, ir_version):
"""
ONNX net IR net
Input->Concat(+reshaped const)->Output => Input->Concat(+const)
"""
#
# Create ONNX model
#
import onnx
from onnx import helper
from onnx import TensorProto
import numpy as np
concat_axis = 0
concat_output_shape = output_shape.copy()
concat_output_shape[concat_axis] *= 2
input = helper.make_tensor_value_info('input', TensorProto.FLOAT, output_shape)
output = helper.make_tensor_value_info('output', TensorProto.FLOAT, concat_output_shape)
const_number = np.prod(input_shape)
constant = np.random.randint(-127, 127, const_number).astype(np.float)
node_const_def = onnx.helper.make_node(
'Constant',
inputs=[],
outputs=['const1'],
value=helper.make_tensor(
name='const_tensor',
data_type=TensorProto.FLOAT,
dims=input_shape,
vals=constant,
),
)
node_shape_def = onnx.helper.make_node(
'Constant',
inputs=[],
outputs=['shape'],
value=helper.make_tensor(
name='const_tensor',
data_type=TensorProto.INT64,
dims=[len(output_shape)],
vals=output_shape,
),
)
node_reshape_def = onnx.helper.make_node(
'Reshape',
inputs=['const1', 'shape'],
outputs=['reshape1']
)
node_concat_def = onnx.helper.make_node(
'Concat',
inputs=['input', 'reshape1'],
outputs=['output'],
axis=concat_axis
)
# Create the graph (GraphProto)
graph_def = helper.make_graph(
[node_const_def, node_shape_def, node_reshape_def, node_concat_def],
'test_reshape_model',
[input],
[output],
)
# Create the model (ModelProto)
onnx_net = helper.make_model(graph_def, producer_name='test_reshape_model')
#
# Create reference IR net
# Please, specify 'type': 'Input' for input node
# Moreover, do not forget to validate ALL layer attributes!!!
#
ref_net = None
if check_ir_version(10, None, ir_version):
nodes_attributes = {
'input': {'kind': 'op', 'type': 'Parameter'},
'input_data': {'shape': output_shape, 'kind': 'data'},
'input_const_data': {'kind': 'data', 'value': constant},
'const': {'kind': 'op', 'type': 'Const'},
'const_data': {'shape': output_shape, 'value': None, 'kind': 'data'},
'concat': {'kind': 'op', 'type': 'Concat', 'axis': concat_axis},
'concat_data': {'shape': concat_output_shape, 'kind': 'data'},
'result': {'kind': 'op', 'type': 'Result'}
}
ref_net = build_graph(nodes_attributes,
[('input', 'input_data'),
('input_const_data', 'const'),
('const', 'const_data'),
('input_data', 'concat'),
('const_data', 'concat'),
('concat', 'concat_data'),
('concat_data', 'result'),
])
return onnx_net, ref_net
test_data_5D = [dict(input_shape=[4, 6, 8, 10, 12], output_shape=[4, 6, 8, 120]),
dict(input_shape=[4, 6, 8, 10, 12], output_shape=[4, 6, 80, 12]),
dict(input_shape=[4, 6, 8, 10, 12], output_shape=[4, 48, 10, 12]),
dict(input_shape=[4, 6, 8, 10, 12], output_shape=[24, 8, 10, 12]),
dict(input_shape=[4, 6, 8, 10], output_shape=[2, 2, 6, 8, 10]),
dict(input_shape=[4, 6, 8, 10], output_shape=[4, 2, 3, 8, 10]),
dict(input_shape=[4, 6, 8, 10], output_shape=[4, 6, 2, 4, 10]),
dict(input_shape=[4, 6, 8, 10], output_shape=[4, 6, 8, 2, 5])]
test_data_5D_precommit = [dict(input_shape=[2, 4, 6, 8, 10], output_shape=[8, 6, 8, 10])]
test_data_4D = [dict(input_shape=[4, 6, 8, 10], output_shape=[24, 8, 10]),
dict(input_shape=[4, 6, 8, 10], output_shape=[4, 48, 10]),
dict(input_shape=[4, 6, 8, 10], output_shape=[4, 6, 80]),
dict(input_shape=[4, 6, 8, 10], output_shape=[192, 10]),
dict(input_shape=[4, 6, 8, 10], output_shape=[4, 480]),
dict(input_shape=[4, 6, 8], output_shape=[2, 2, 6, 8]),
dict(input_shape=[4, 6, 8], output_shape=[4, 2, 3, 8]),
dict(input_shape=[4, 6, 8], output_shape=[4, 6, 2, 4]),
dict(input_shape=[4, 6], output_shape=[2, 2, 2, 3])]
test_data_4D_precommit = [dict(input_shape=[2, 4, 6, 8], output_shape=[48, 8])]
test_data_3D = [dict(input_shape=[4, 6, 8], output_shape=[24, 8]),
dict(input_shape=[4, 6, 8], output_shape=[4, 48]),
dict(input_shape=[4, 6], output_shape=[2, 2, 6]),
dict(input_shape=[4, 6], output_shape=[4, 2, 3]),
dict(input_shape=[4, 6], output_shape=[2, 4, 3])]
test_data_3D_precommit = [dict(input_shape=[2, 4, 6], output_shape=[8, 6])]
@pytest.mark.parametrize("params", test_data_5D_precommit)
@pytest.mark.precommit
def test_reshape_5D_precommit(self, params, ie_device, precision, ir_version, temp_dir):
self._test(*self.create_reshape_net(**params, ir_version=ir_version), ie_device, precision, ir_version,
temp_dir=temp_dir)
@pytest.mark.parametrize("params", test_data_4D_precommit)
@pytest.mark.precommit
def test_reshape_4D_precommit(self, params, ie_device, precision, ir_version, temp_dir):
self._test(*self.create_reshape_net(**params, ir_version=ir_version), ie_device, precision, ir_version,
temp_dir=temp_dir)
@pytest.mark.parametrize("params", test_data_3D_precommit)
@pytest.mark.precommit
def test_reshape_3D_precommit(self, params, ie_device, precision, ir_version, temp_dir):
self._test(*self.create_reshape_net(**params, ir_version=ir_version), ie_device, precision, ir_version,
temp_dir=temp_dir)
@pytest.mark.parametrize("params", test_data_5D)
@pytest.mark.nightly
@pytest.mark.precommit
def test_reshape_5D(self, params, ie_device, precision, ir_version, temp_dir):
self._test(*self.create_reshape_net(**params, ir_version=ir_version), ie_device, precision, ir_version,
temp_dir=temp_dir)
@pytest.mark.parametrize("params", test_data_4D)
@pytest.mark.nightly
def test_reshape_4D(self, params, ie_device, precision, ir_version, temp_dir):
self._test(*self.create_reshape_net(**params, ir_version=ir_version), ie_device, precision, ir_version,
temp_dir=temp_dir)
@pytest.mark.parametrize("params", test_data_3D)
@pytest.mark.nightly
def test_reshape_3D(self, params, ie_device, precision, ir_version, temp_dir):
self._test(*self.create_reshape_net(**params, ir_version=ir_version), ie_device, precision, ir_version,
temp_dir=temp_dir)
@pytest.mark.parametrize("params", test_data_5D)
@pytest.mark.nightly
def test_reshape_const_5D(self, params, ie_device, precision, ir_version, temp_dir):
self._test(*self.create_reshape_net_const(**params, ir_version=ir_version), ie_device, precision, ir_version,
temp_dir=temp_dir)
@pytest.mark.parametrize("params", test_data_4D)
@pytest.mark.nightly
def test_reshape_const_4D(self, params, ie_device, precision, ir_version, temp_dir):
self._test(*self.create_reshape_net_const(**params, ir_version=ir_version), ie_device, precision, ir_version,
temp_dir=temp_dir)
@pytest.mark.parametrize("params", test_data_3D)
@pytest.mark.nightly
def test_reshape_const_3D(self, params, ie_device, precision, ir_version, temp_dir):
self._test(*self.create_reshape_net_const(**params, ir_version=ir_version), ie_device, precision, ir_version,
temp_dir=temp_dir)
| 41.492958
| 120
| 0.553123
| 1,374
| 11,784
| 4.455604
| 0.091703
| 0.080856
| 0.032016
| 0.053904
| 0.803822
| 0.795492
| 0.765273
| 0.700588
| 0.671186
| 0.629369
| 0
| 0.035515
| 0.316616
| 11,784
| 283
| 121
| 41.639576
| 0.724699
| 0.06424
| 0
| 0.482587
| 0
| 0
| 0.085774
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.054726
| false
| 0
| 0.054726
| 0
| 0.154229
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
104fce97f5df98b98d8689c7d7f94245b4a8e69a
| 219
|
py
|
Python
|
profiles/models.py
|
andriov/footStore-django-webServer
|
5741cc78b857e2f73ea12b6f387c22c4f2788d30
|
[
"MIT"
] | null | null | null |
profiles/models.py
|
andriov/footStore-django-webServer
|
5741cc78b857e2f73ea12b6f387c22c4f2788d30
|
[
"MIT"
] | 10
|
2020-06-05T17:43:35.000Z
|
2022-02-11T03:38:45.000Z
|
profiles/models.py
|
andriov/footStore-django-webServer
|
5741cc78b857e2f73ea12b6f387c22c4f2788d30
|
[
"MIT"
] | null | null | null |
from django.db import models
# Here we implement a custom profiled user, this user extends the
# django's AbstractUser, the parent class handles all the authentification
# process whereas this class adds some fields.
| 31.285714
| 74
| 0.799087
| 33
| 219
| 5.30303
| 0.818182
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.164384
| 219
| 6
| 75
| 36.5
| 0.956284
| 0.826484
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
1073d1e2f0f00dc80e131625e4587ea85bcc55cd
| 22
|
py
|
Python
|
src/retrieve.py
|
krishnadurai/ColBERT
|
24f5ed52c24978690727c058917d1325b5eeafb9
|
[
"MIT"
] | 16
|
2021-05-03T12:16:26.000Z
|
2022-03-10T08:10:48.000Z
|
src/retrieve.py
|
krishnadurai/ColBERT
|
24f5ed52c24978690727c058917d1325b5eeafb9
|
[
"MIT"
] | 10
|
2021-07-22T09:31:40.000Z
|
2022-02-17T16:28:42.000Z
|
src/retrieve.py
|
krishnadurai/ColBERT
|
24f5ed52c24978690727c058917d1325b5eeafb9
|
[
"MIT"
] | 7
|
2021-03-28T10:50:41.000Z
|
2022-03-09T15:57:27.000Z
|
# To be released soon.
| 22
| 22
| 0.727273
| 4
| 22
| 4
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.181818
| 22
| 1
| 22
| 22
| 0.888889
| 0.909091
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
108626599fde810e4fa024374302fb546fe7c551
| 112
|
py
|
Python
|
jobs/admin.py
|
akshitbhatia/Python-Django-Project
|
d64f02eb8682e14243c38241af660b54a22d0db9
|
[
"bzip2-1.0.6"
] | null | null | null |
jobs/admin.py
|
akshitbhatia/Python-Django-Project
|
d64f02eb8682e14243c38241af660b54a22d0db9
|
[
"bzip2-1.0.6"
] | 1
|
2021-09-13T14:24:01.000Z
|
2021-09-13T14:24:01.000Z
|
portfolio-project/jobs/admin.py
|
victorbrittoferreira/django_blog
|
4b6e7b0f51e33332b468f939386012bdaf2a0761
|
[
"BSD-3-Clause"
] | null | null | null |
from django.contrib import admin
# Register your models here.
from .models import Job
admin.site.register(Job)
| 18.666667
| 32
| 0.794643
| 17
| 112
| 5.235294
| 0.647059
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.133929
| 112
| 6
| 33
| 18.666667
| 0.917526
| 0.232143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
108f9470046cbaa3910767669d84ace10f57d5c5
| 526
|
py
|
Python
|
qutip/solve/__init__.py
|
jakelishman/qutip
|
fbb7fad5bc205910228db622d90601c82db45e4b
|
[
"BSD-3-Clause"
] | null | null | null |
qutip/solve/__init__.py
|
jakelishman/qutip
|
fbb7fad5bc205910228db622d90601c82db45e4b
|
[
"BSD-3-Clause"
] | 2
|
2020-07-13T12:11:30.000Z
|
2020-08-09T22:45:05.000Z
|
qutip/solve/__init__.py
|
jakelishman/qutip
|
fbb7fad5bc205910228db622d90601c82db45e4b
|
[
"BSD-3-Clause"
] | null | null | null |
from .bloch_redfield import *
from ._brtensor import bloch_redfield_tensor
from .correlation import *
from .countstat import *
from .floquet import *
from .mcsolve import *
from .mesolve import *
from . import nonmarkov
from .pdpsolve import *
from .piqs import *
from .propagator import *
from .rcsolve import *
from .scattering import *
from .sesolve import *
from .solver import *
from .steadystate import *
from .stochastic import *
# TODO: most of these don't have a __all__ leaking names, ex:
del np
del Qobj
del debug
| 22.869565
| 61
| 0.764259
| 73
| 526
| 5.39726
| 0.506849
| 0.35533
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.165399
| 526
| 22
| 62
| 23.909091
| 0.897494
| 0.112167
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.045455
| 0
| 1
| 0
| true
| 0
| 0.85
| 0
| 0.85
| 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
| 1
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
52a463d2bfca7ad4dd85eda5934472314dc74a13
| 103
|
py
|
Python
|
natch/decorators/gt.py
|
ertgl/natch
|
5729725c6eed1596071ac984e3ddfdc21a15af0a
|
[
"MIT"
] | 2
|
2020-05-24T23:41:00.000Z
|
2020-05-25T09:18:08.000Z
|
natch/decorators/gt.py
|
ertgl/natch
|
5729725c6eed1596071ac984e3ddfdc21a15af0a
|
[
"MIT"
] | null | null | null |
natch/decorators/gt.py
|
ertgl/natch
|
5729725c6eed1596071ac984e3ddfdc21a15af0a
|
[
"MIT"
] | null | null | null |
from natch.core import Decoration
from natch.rules import Gt
gt = Decoration.make_rule_decorator(Gt)
| 17.166667
| 39
| 0.815534
| 16
| 103
| 5.125
| 0.625
| 0.219512
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.126214
| 103
| 5
| 40
| 20.6
| 0.911111
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
52cdfc5f40a98651ce68d3425d46bfb526d7f93c
| 93
|
py
|
Python
|
src/modeling/prediction_head/__init__.py
|
Julienbeaulieu/kaggle-computer-vision-competition
|
7bc6bcb8b85d81ff1544040c403e356c0a3c8060
|
[
"MIT"
] | 14
|
2020-12-07T22:24:17.000Z
|
2022-03-30T05:11:55.000Z
|
src/modeling/prediction_head/__init__.py
|
Julienbeaulieu/kaggle-computer-vision-competition
|
7bc6bcb8b85d81ff1544040c403e356c0a3c8060
|
[
"MIT"
] | null | null | null |
src/modeling/prediction_head/__init__.py
|
Julienbeaulieu/kaggle-computer-vision-competition
|
7bc6bcb8b85d81ff1544040c403e356c0a3c8060
|
[
"MIT"
] | 4
|
2020-02-22T17:54:23.000Z
|
2022-01-31T06:41:11.000Z
|
from .build import HEAD_REGISTRY, build_head
from .simple_head import build_simple_pred_head
| 31
| 47
| 0.870968
| 15
| 93
| 5
| 0.466667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.096774
| 93
| 2
| 48
| 46.5
| 0.892857
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
52e3a613985a2aa9abebecbbe5bf0fa16ec63dac
| 207
|
py
|
Python
|
core/views/user/__init__.py
|
moxuanchen/BMS
|
1d688f9ebc3efbd812948f930069f2a7109cd873
|
[
"Apache-2.0"
] | null | null | null |
core/views/user/__init__.py
|
moxuanchen/BMS
|
1d688f9ebc3efbd812948f930069f2a7109cd873
|
[
"Apache-2.0"
] | null | null | null |
core/views/user/__init__.py
|
moxuanchen/BMS
|
1d688f9ebc3efbd812948f930069f2a7109cd873
|
[
"Apache-2.0"
] | null | null | null |
# -*- coding: utf-8 -*-
from flask import Blueprint
client = Blueprint('client', __name__, template_folder='templates', static_folder='static', url_prefix='/client')
import signin
import user
import book
| 20.7
| 113
| 0.743961
| 26
| 207
| 5.653846
| 0.692308
| 0.204082
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.005495
| 0.120773
| 207
| 9
| 114
| 23
| 0.802198
| 0.101449
| 0
| 0
| 0
| 0
| 0.152174
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.8
| 0
| 0.8
| 0.4
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
52e4182a0e55a7972afb001695e148d83711de3d
| 1,350
|
py
|
Python
|
tests/__init__.py
|
aroig/nnutil2
|
1fc77df351d4eee1166688e25a94287a5cfa27c4
|
[
"BSD-3-Clause"
] | null | null | null |
tests/__init__.py
|
aroig/nnutil2
|
1fc77df351d4eee1166688e25a94287a5cfa27c4
|
[
"BSD-3-Clause"
] | 3
|
2020-11-13T18:33:29.000Z
|
2021-08-25T15:55:57.000Z
|
tests/__init__.py
|
aroig/nnutil2
|
1fc77df351d4eee1166688e25a94287a5cfa27c4
|
[
"BSD-3-Clause"
] | null | null | null |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# nnutil2 - Tensorflow utilities for training neural networks
# Copyright (c) 2019, Abdó Roig-Maranges <abdo.roig@gmail.com>
#
# This file is part of 'nnutil2'.
#
# This file may be modified and distributed under the terms of the 3-clause BSD
# license. See the LICENSE file for details.
import unittest
from .layers_identity import *
from .layers_segment import *
from .layers_conv import *
from .layers_conv_function import *
from .layers_pooling import *
from .layers_global_pooling import *
from .layers_squeeze_excitation import *
from .layers_bottleneck import *
from .layers_pipelined_segment import *
from .data_parse_json import *
from .data_merge import *
from .nest_flat_tensor import *
from .util_shape import *
from .util_interpolate_shape import *
from .linalg_trace_mc import *
from .linalg_dotprod import *
from .linalg_orthogonalize import *
from .linalg_symmetric_lanczos import *
from .linalg_generalized_trace import *
from .linalg_symmetrize import *
from .linalg_linear_operator_hessian import *
from .linalg_linear_operator_approx_hessian import *
from .linalg_linear_operator_jacobian import *
from .linalg_linear_operator_symmetrize import *
from .linalg_linear_operator_antisymmetrize import *
from .linalg_tensor_matvec import *
from .initializers_approx_identity import *
| 32.926829
| 79
| 0.807407
| 185
| 1,350
| 5.621622
| 0.448649
| 0.25
| 0.184615
| 0.105769
| 0.176923
| 0.148077
| 0
| 0
| 0
| 0
| 0
| 0.006768
| 0.124444
| 1,350
| 40
| 80
| 33.75
| 0.873096
| 0.234074
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
52e8f005ed21e6c4b6b249bc370c61c0a1fc1d94
| 278
|
py
|
Python
|
plugins/threatstack/icon_threatstack/actions/__init__.py
|
lukaszlaszuk/insightconnect-plugins
|
8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892
|
[
"MIT"
] | 46
|
2019-06-05T20:47:58.000Z
|
2022-03-29T10:18:01.000Z
|
plugins/threatstack/icon_threatstack/actions/__init__.py
|
lukaszlaszuk/insightconnect-plugins
|
8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892
|
[
"MIT"
] | 386
|
2019-06-07T20:20:39.000Z
|
2022-03-30T17:35:01.000Z
|
plugins/threatstack/icon_threatstack/actions/__init__.py
|
lukaszlaszuk/insightconnect-plugins
|
8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892
|
[
"MIT"
] | 43
|
2019-07-09T14:13:58.000Z
|
2022-03-28T12:04:46.000Z
|
# GENERATED BY KOMAND SDK - DO NOT EDIT
from .get_agent.action import GetAgent
from .get_agents.action import GetAgents
from .get_alert.action import GetAlert
from .get_alerts.action import GetAlerts
from .get_events.action import GetEvents
from .get_rule.action import GetRule
| 34.75
| 40
| 0.830935
| 43
| 278
| 5.232558
| 0.534884
| 0.186667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.118705
| 278
| 7
| 41
| 39.714286
| 0.918367
| 0.133094
| 0
| 0
| 1
| 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
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
52f13ec9cd8c6f42537dfb7f5395395a6df29822
| 75
|
py
|
Python
|
settings/14IDADAC1_4_settings.py
|
bopopescu/Lauecollect
|
60ae2b05ea8596ba0decf426e37aeaca0bc8b6be
|
[
"MIT"
] | null | null | null |
settings/14IDADAC1_4_settings.py
|
bopopescu/Lauecollect
|
60ae2b05ea8596ba0decf426e37aeaca0bc8b6be
|
[
"MIT"
] | 1
|
2019-10-22T21:28:31.000Z
|
2019-10-22T21:39:12.000Z
|
settings/14IDADAC1_4_settings.py
|
bopopescu/Lauecollect
|
60ae2b05ea8596ba0decf426e37aeaca0bc8b6be
|
[
"MIT"
] | 2
|
2019-06-06T15:06:46.000Z
|
2020-07-20T02:03:22.000Z
|
VAL.filename = '//mx340hs/data/anfinrud_1810/Archive//14IDA.DAC1_4.VAL.txt'
| 75
| 75
| 0.786667
| 12
| 75
| 4.75
| 0.916667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.150685
| 0.026667
| 75
| 1
| 75
| 75
| 0.630137
| 0
| 0
| 0
| 0
| 0
| 0.763158
| 0.763158
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
5e074a252f838708a4a3822883f7c68565c33b65
| 69
|
py
|
Python
|
Python_Projects/OS-app/server.py
|
ArturWagnerBusiness/Projects-2018-2020
|
37a217dc325f3ba42d8a7a1a743e5b6f8fab5df4
|
[
"MIT"
] | null | null | null |
Python_Projects/OS-app/server.py
|
ArturWagnerBusiness/Projects-2018-2020
|
37a217dc325f3ba42d8a7a1a743e5b6f8fab5df4
|
[
"MIT"
] | null | null | null |
Python_Projects/OS-app/server.py
|
ArturWagnerBusiness/Projects-2018-2020
|
37a217dc325f3ba42d8a7a1a743e5b6f8fab5df4
|
[
"MIT"
] | null | null | null |
import _thread as thread
from time import sleep
from os import system
| 23
| 24
| 0.84058
| 12
| 69
| 4.75
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.15942
| 69
| 3
| 25
| 23
| 0.982759
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
5e07e75e9ed05504f04da2d4314fd5ba45479275
| 107
|
py
|
Python
|
ummon/features/ps_color/__init__.py
|
matherm/ummon3
|
08476d21ce17cc95180525d48202a1690dfc8a08
|
[
"BSD-3-Clause"
] | 1
|
2022-02-10T06:47:13.000Z
|
2022-02-10T06:47:13.000Z
|
ummon/features/ps_color/__init__.py
|
matherm/ummon3
|
08476d21ce17cc95180525d48202a1690dfc8a08
|
[
"BSD-3-Clause"
] | null | null | null |
ummon/features/ps_color/__init__.py
|
matherm/ummon3
|
08476d21ce17cc95180525d48202a1690dfc8a08
|
[
"BSD-3-Clause"
] | null | null | null |
__all__ = ['psUtils', 'textureColorAnalysis', 'steerablePyramid', 'reconstructFromPyramid', 'featurecache']
| 107
| 107
| 0.785047
| 6
| 107
| 13.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.056075
| 107
| 1
| 107
| 107
| 0.792079
| 0
| 0
| 0
| 0
| 0
| 0.712963
| 0.203704
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
5e0e4aedf75a748b00d30ad1534447b7e8cc4f45
| 139
|
py
|
Python
|
analyze_3d.py
|
Song-Jingyu/Carla-Roadside-Dataset-Generator
|
0f14a49069b6d8d0f4df93b3b0cd7f66608147f9
|
[
"MIT"
] | 4
|
2021-11-02T20:36:39.000Z
|
2022-03-08T09:46:55.000Z
|
analyze_3d.py
|
Song-Jingyu/Carla-Roadside-Dataset-Generator
|
0f14a49069b6d8d0f4df93b3b0cd7f66608147f9
|
[
"MIT"
] | null | null | null |
analyze_3d.py
|
Song-Jingyu/Carla-Roadside-Dataset-Generator
|
0f14a49069b6d8d0f4df93b3b0cd7f66608147f9
|
[
"MIT"
] | null | null | null |
import numpy as np
box = np.load('./data/obj/000090_3d.npy')
id = np.load('./data/obj/000090_id.npy')
print(box)
print(len(box))
print(id)
| 19.857143
| 41
| 0.690647
| 27
| 139
| 3.481481
| 0.518519
| 0.12766
| 0.212766
| 0.276596
| 0.404255
| 0
| 0
| 0
| 0
| 0
| 0
| 0.103175
| 0.093525
| 139
| 7
| 42
| 19.857143
| 0.642857
| 0
| 0
| 0
| 0
| 0
| 0.342857
| 0.342857
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.166667
| 0
| 0.166667
| 0.5
| 1
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
5e1a63f521c76b804abe65361101524cdc726f24
| 2,477
|
py
|
Python
|
pinax/documents/tests/test.py
|
pinax/pinax-documents
|
6fa0b9d42563dc28c6159fe1591e910f88aba4f2
|
[
"MIT"
] | 54
|
2015-06-02T11:32:42.000Z
|
2022-03-31T20:22:29.000Z
|
pinax/documents/tests/test.py
|
pinax/pinax-documents
|
6fa0b9d42563dc28c6159fe1591e910f88aba4f2
|
[
"MIT"
] | 21
|
2015-10-21T16:09:53.000Z
|
2020-08-31T17:25:34.000Z
|
pinax/documents/tests/test.py
|
pinax/pinax-documents
|
6fa0b9d42563dc28c6159fe1591e910f88aba4f2
|
[
"MIT"
] | 27
|
2015-06-18T11:14:47.000Z
|
2021-08-31T21:32:12.000Z
|
from django.core.files.uploadedfile import SimpleUploadedFile
from test_plus.test import TestCase as PlusTestCase
from ..exceptions import DuplicateDocumentNameError, DuplicateFolderNameError
from ..models import Document, Folder
class BaseTest(PlusTestCase):
def setUp(self):
self.user = self.make_user("eldarion")
class FolderTestCase(BaseTest):
def test_cannot_have_duplicate_sibling_folder_names(self):
Folder.objects.create(name="Foo", author=self.user, modified_by=self.user)
with self.assertRaises(DuplicateFolderNameError):
Folder.objects.create(name="Foo", author=self.user, modified_by=self.user)
def test_can_have_duplicate_folder_names_at_different_paths(self):
foo = Folder.objects.create(name="Foo", author=self.user, modified_by=self.user)
bar = Folder.objects.create(name="Bar", parent=foo, author=self.user, modified_by=self.user)
Folder.objects.create(name="Foo", parent=bar, author=self.user, modified_by=self.user)
with self.assertRaises(DuplicateFolderNameError):
Folder.objects.create(name="Bar", parent=foo, author=self.user, modified_by=self.user)
class DocumentTestCase(BaseTest):
def test_cannot_have_duplicate_sibling_document_names(self):
simple_file = SimpleUploadedFile("delicious.txt", b"something tasty")
Document.objects.create(name="Foo", author=self.user, file=simple_file, modified_by=self.user)
with self.assertRaises(DuplicateDocumentNameError):
Document.objects.create(name="Foo", author=self.user, file=simple_file, modified_by=self.user)
def test_can_have_duplicate_document_names_at_different_paths(self):
simple_file = SimpleUploadedFile("delicious.txt", b"something tasty")
foo = Folder.objects.create(name="Foo", author=self.user, modified_by=self.user)
bar = Folder.objects.create(name="Bar", parent=foo, author=self.user, modified_by=self.user)
Document.objects.create(name="Foo", author=self.user, file=simple_file, modified_by=self.user)
Document.objects.create(name="Bar", folder=foo, author=self.user, file=simple_file, modified_by=self.user)
Document.objects.create(name="Foo", folder=bar, author=self.user, file=simple_file, modified_by=self.user)
with self.assertRaises(DuplicateDocumentNameError):
Document.objects.create(name="Bar", folder=foo, author=self.user, file=simple_file, modified_by=self.user)
| 52.702128
| 118
| 0.748082
| 319
| 2,477
| 5.645768
| 0.172414
| 0.128817
| 0.132149
| 0.139922
| 0.79789
| 0.757912
| 0.757912
| 0.712382
| 0.712382
| 0.619656
| 0
| 0
| 0.136052
| 2,477
| 46
| 119
| 53.847826
| 0.841589
| 0
| 0
| 0.515152
| 0
| 0
| 0.042794
| 0
| 0
| 0
| 0
| 0
| 0.121212
| 1
| 0.151515
| false
| 0
| 0.121212
| 0
| 0.363636
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 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
| 5
|
eabd35ccd7652446f82a7fafb25ec7b9ab6f6b8e
| 181
|
py
|
Python
|
app/models/__init__.py
|
erik-at-techsanity/fastapi-template
|
f73b75ee461f0b8774adb41f9fccdab52314a1e3
|
[
"MIT"
] | 3
|
2021-04-20T23:44:52.000Z
|
2022-02-16T02:24:43.000Z
|
app/models/__init__.py
|
erik-at-techsanity/fastapi-template
|
f73b75ee461f0b8774adb41f9fccdab52314a1e3
|
[
"MIT"
] | null | null | null |
app/models/__init__.py
|
erik-at-techsanity/fastapi-template
|
f73b75ee461f0b8774adb41f9fccdab52314a1e3
|
[
"MIT"
] | null | null | null |
# Standard Library Imports
# None
# 3rd-Party Imports
from mongoengine import Document
# App-Local Imports
from app.models.product import Product
class Base(Document):
pass
| 13.923077
| 38
| 0.767956
| 24
| 181
| 5.791667
| 0.708333
| 0.158273
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.006667
| 0.171271
| 181
| 12
| 39
| 15.083333
| 0.92
| 0.359116
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.25
| 0.5
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
|
0
| 5
|
ead26b5ba953db58456beaba2b9d10f5906262e1
| 101
|
py
|
Python
|
samples/client/petstore-security-test/python/petstore_api/apis/__init__.py
|
wwadge/swagger-codegen
|
777619d4d106b7b387f8ee8469f4ec43f3cdfdc7
|
[
"Apache-2.0"
] | 14,570
|
2015-01-01T21:46:46.000Z
|
2022-03-31T22:28:15.000Z
|
samples/client/petstore-security-test/python/petstore_api/apis/__init__.py
|
wwadge/swagger-codegen
|
777619d4d106b7b387f8ee8469f4ec43f3cdfdc7
|
[
"Apache-2.0"
] | 9,058
|
2015-01-08T15:49:17.000Z
|
2022-03-31T13:10:01.000Z
|
samples/client/petstore-security-test/python/petstore_api/apis/__init__.py
|
LaudateCorpus1/swagger-codegen
|
e4f322ce197f1d6a0643de80f9a20bb521480426
|
[
"Apache-2.0"
] | 6,907
|
2015-01-02T05:29:47.000Z
|
2022-03-31T00:55:45.000Z
|
from __future__ import absolute_import
# import apis into api package
from .fake_api import FakeApi
| 20.2
| 38
| 0.831683
| 15
| 101
| 5.2
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.148515
| 101
| 4
| 39
| 25.25
| 0.906977
| 0.277228
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
eadc0067708d8146b02eed53664f24b9b64ed717
| 57
|
py
|
Python
|
artificial_idiot/example_player/__init__.py
|
Dovermore/artificial_intelligence_project
|
2d71afd241490b456dd58e71b8f1fa92e8e2f0b7
|
[
"MIT"
] | null | null | null |
artificial_idiot/example_player/__init__.py
|
Dovermore/artificial_intelligence_project
|
2d71afd241490b456dd58e71b8f1fa92e8e2f0b7
|
[
"MIT"
] | null | null | null |
artificial_idiot/example_player/__init__.py
|
Dovermore/artificial_intelligence_project
|
2d71afd241490b456dd58e71b8f1fa92e8e2f0b7
|
[
"MIT"
] | null | null | null |
from example_player.player import ExamplePlayer as Player
| 57
| 57
| 0.894737
| 8
| 57
| 6.25
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.087719
| 57
| 1
| 57
| 57
| 0.961538
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
eaeac10f6fb4ba346053079416c0c154ce032105
| 1,586
|
py
|
Python
|
server/processes/migrations/0155_auto_20210824_0628.py
|
CloudReactor/task_manager
|
464ca74371064fabb9a21b1f5bacba30360932ab
|
[
"Fair"
] | null | null | null |
server/processes/migrations/0155_auto_20210824_0628.py
|
CloudReactor/task_manager
|
464ca74371064fabb9a21b1f5bacba30360932ab
|
[
"Fair"
] | 6
|
2021-11-01T01:35:40.000Z
|
2022-02-11T03:33:06.000Z
|
server/processes/migrations/0155_auto_20210824_0628.py
|
CloudReactor/task_manager
|
464ca74371064fabb9a21b1f5bacba30360932ab
|
[
"Fair"
] | null | null | null |
# Generated by Django 3.2.6 on 2021-08-24 06:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('processes', '0154_task_aws_ecs_service_tags'),
]
operations = [
migrations.AlterField(
model_name='task',
name='environment_variables_overrides',
field=models.JSONField(blank=True, null=True),
),
migrations.AlterField(
model_name='task',
name='other_metadata',
field=models.JSONField(blank=True, null=True),
),
migrations.AlterField(
model_name='taskexecution',
name='environment_variables_overrides',
field=models.JSONField(blank=True, null=True),
),
migrations.AlterField(
model_name='taskexecution',
name='other_instance_metadata',
field=models.JSONField(blank=True, null=True),
),
migrations.AlterField(
model_name='taskexecution',
name='other_runtime_metadata',
field=models.JSONField(blank=True, null=True),
),
migrations.AlterField(
model_name='workflowexecution',
name='workflow_snapshot',
field=models.JSONField(blank=True, null=True),
),
migrations.AlterField(
model_name='workflowtaskinstance',
name='environment_variables_overrides',
field=models.JSONField(blank=True, null=True),
),
]
| 32.367347
| 59
| 0.575032
| 141
| 1,586
| 6.297872
| 0.340426
| 0.157658
| 0.197072
| 0.228604
| 0.736486
| 0.736486
| 0.690315
| 0.690315
| 0.690315
| 0.690315
| 0
| 0.017625
| 0.320303
| 1,586
| 48
| 60
| 33.041667
| 0.806122
| 0.028373
| 0
| 0.690476
| 1
| 0
| 0.195842
| 0.112676
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.02381
| 0
| 0.095238
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
eaee0db231fc468c07550e445bb19bd0d51c63bc
| 117
|
py
|
Python
|
project_euler/solutions/problem_20.py
|
cryvate/project-euler
|
6ed13880d7916c34554559f5f71662a863735eda
|
[
"MIT"
] | null | null | null |
project_euler/solutions/problem_20.py
|
cryvate/project-euler
|
6ed13880d7916c34554559f5f71662a863735eda
|
[
"MIT"
] | 9
|
2017-02-20T23:41:40.000Z
|
2017-04-16T15:36:54.000Z
|
project_euler/solutions/problem_20.py
|
cryvate/project-euler
|
6ed13880d7916c34554559f5f71662a863735eda
|
[
"MIT"
] | null | null | null |
from math import factorial
def solve(n: int=100) -> str:
return sum(int(digit) for digit in str(factorial(n)))
| 19.5
| 57
| 0.692308
| 20
| 117
| 4.05
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.03125
| 0.179487
| 117
| 5
| 58
| 23.4
| 0.8125
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.333333
| 0.333333
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 1
| 0
| 0
|
0
| 5
|
d804c847c4f93861c0c931bf4764e88ae1603979
| 181
|
py
|
Python
|
seleniumpm/webelements/textelement.py
|
dougPhilips/python-seleniumpm
|
4ddff760cd4486bfd48efdb77e33fb4574dc0e5d
|
[
"Apache-2.0"
] | 2
|
2020-01-13T14:41:08.000Z
|
2020-01-29T10:21:04.000Z
|
seleniumpm/webelements/textelement.py
|
dougPhilips/python-seleniumpm
|
4ddff760cd4486bfd48efdb77e33fb4574dc0e5d
|
[
"Apache-2.0"
] | 1
|
2018-05-29T14:47:55.000Z
|
2018-05-29T14:47:55.000Z
|
seleniumpm/webelements/textelement.py
|
dougPhilips/python-seleniumpm
|
4ddff760cd4486bfd48efdb77e33fb4574dc0e5d
|
[
"Apache-2.0"
] | null | null | null |
from seleniumpm.webelements.element import Element
class TextElement(Element):
def __init__(self, driver, locator):
super(TextElement, self).__init__(driver, locator)
| 25.857143
| 58
| 0.756906
| 20
| 181
| 6.45
| 0.65
| 0.20155
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.149171
| 181
| 6
| 59
| 30.166667
| 0.837662
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
d824047b038d5df58d347212be5200c0a17152e7
| 186
|
py
|
Python
|
backend/user_profile/routers.py
|
HamzaouiSatoripop/mission_coach
|
ef31a7b34544d49acbc28fd7b3aeb778c7d9077a
|
[
"MIT"
] | null | null | null |
backend/user_profile/routers.py
|
HamzaouiSatoripop/mission_coach
|
ef31a7b34544d49acbc28fd7b3aeb778c7d9077a
|
[
"MIT"
] | null | null | null |
backend/user_profile/routers.py
|
HamzaouiSatoripop/mission_coach
|
ef31a7b34544d49acbc28fd7b3aeb778c7d9077a
|
[
"MIT"
] | null | null | null |
from rest_framework import routers
from user_profile.views import UserProfileViewSet
user_profile_router = routers.DefaultRouter()
user_profile_router.register('', UserProfileViewSet)
| 31
| 52
| 0.860215
| 21
| 186
| 7.333333
| 0.571429
| 0.214286
| 0.220779
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.080645
| 186
| 6
| 52
| 31
| 0.900585
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
dc256c97e7ec4a7fc2d3fd31603bf3a5c326fe1d
| 118
|
py
|
Python
|
RSaverBackend/admin.py
|
Sammy-Barasa/ReceiptSavingAppBackend
|
839bdeb898416f442a47c2e092f98a81654f8e07
|
[
"MIT"
] | null | null | null |
RSaverBackend/admin.py
|
Sammy-Barasa/ReceiptSavingAppBackend
|
839bdeb898416f442a47c2e092f98a81654f8e07
|
[
"MIT"
] | 9
|
2021-04-08T19:39:12.000Z
|
2022-03-12T00:46:02.000Z
|
RSaverBackend/admin.py
|
Sammy-Barasa/ReceiptSavingAppBackend
|
839bdeb898416f442a47c2e092f98a81654f8e07
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from .models import Receipt
# Register your models here.
admin.site.register(Receipt)
| 29.5
| 32
| 0.822034
| 17
| 118
| 5.705882
| 0.647059
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.110169
| 118
| 4
| 33
| 29.5
| 0.92381
| 0.220339
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
dc7cc30079f804d94d254d6c8794f29cd9ec77de
| 340
|
py
|
Python
|
exerciciosCeV/ex074.py
|
riancarlos04/primeiros-passos-phyton
|
f1b16bd0206fd60472c969ba793b822ab92f67e9
|
[
"MIT"
] | null | null | null |
exerciciosCeV/ex074.py
|
riancarlos04/primeiros-passos-phyton
|
f1b16bd0206fd60472c969ba793b822ab92f67e9
|
[
"MIT"
] | null | null | null |
exerciciosCeV/ex074.py
|
riancarlos04/primeiros-passos-phyton
|
f1b16bd0206fd60472c969ba793b822ab92f67e9
|
[
"MIT"
] | null | null | null |
from random import randint
numeros = ((randint(1,10)), (randint(1,10)),
(randint(1,10)), (randint(1,10)),
(randint(1,10)), (randint(1,10)))
print('Os números sorteados foram: ', end='')
for c in numeros:
print(c, end=' ')
print(f'\nO maior numero foi: {max(numeros)}')
print(f'O menor número foi: {min(numeros)}')
| 34
| 46
| 0.605882
| 52
| 340
| 3.961538
| 0.5
| 0.23301
| 0.291262
| 0.412621
| 0.291262
| 0.291262
| 0.291262
| 0.291262
| 0.291262
| 0.291262
| 0
| 0.064516
| 0.179412
| 340
| 9
| 47
| 37.777778
| 0.673835
| 0
| 0
| 0
| 0
| 0
| 0.291176
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.111111
| 0
| 0.111111
| 0.444444
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
dc9c68b7771ce6e5a88e73cba5e0e36b8de7e23d
| 189
|
py
|
Python
|
tyrell/decider/__init__.py
|
rodamber/Tyrell
|
ea737b8749af17340a62fd2b0840d8f6c48cfdfc
|
[
"Apache-2.0"
] | null | null | null |
tyrell/decider/__init__.py
|
rodamber/Tyrell
|
ea737b8749af17340a62fd2b0840d8f6c48cfdfc
|
[
"Apache-2.0"
] | 2
|
2019-01-23T17:09:01.000Z
|
2019-03-26T09:41:10.000Z
|
tyrell/decider/__init__.py
|
rodamber/Tyrell
|
ea737b8749af17340a62fd2b0840d8f6c48cfdfc
|
[
"Apache-2.0"
] | null | null | null |
from .result import ok, bad
from .blame import Blame
from .decider import Decider
from .example_base import Example, ExampleDecider
from .example_constraint import ExampleConstraintDecider
| 31.5
| 56
| 0.846561
| 24
| 189
| 6.583333
| 0.5
| 0.139241
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.116402
| 189
| 5
| 57
| 37.8
| 0.946108
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
f49c5c6e11f2246bff5f784842b73925f69058fd
| 135
|
py
|
Python
|
util.py
|
istvanmegyeri/mnist_code_examples
|
1233b3cd6a15dfde69f3df18b5f06fe17c3d3317
|
[
"MIT"
] | null | null | null |
util.py
|
istvanmegyeri/mnist_code_examples
|
1233b3cd6a15dfde69f3df18b5f06fe17c3d3317
|
[
"MIT"
] | null | null | null |
util.py
|
istvanmegyeri/mnist_code_examples
|
1233b3cd6a15dfde69f3df18b5f06fe17c3d3317
|
[
"MIT"
] | null | null | null |
import os
def mk_parent_dir(f_name):
if not os.path.isdir(os.path.dirname(f_name)):
os.makedirs(os.path.dirname(f_name))
| 19.285714
| 50
| 0.696296
| 25
| 135
| 3.56
| 0.56
| 0.168539
| 0.292135
| 0.314607
| 0.404494
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.162963
| 135
| 6
| 51
| 22.5
| 0.787611
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
f4bd9531568643560b3dccf7266a48f3d6e05e53
| 99
|
py
|
Python
|
group.py
|
bismark163/Tests
|
3a98557862ba052246453241809d6b45b518036c
|
[
"Apache-2.0"
] | null | null | null |
group.py
|
bismark163/Tests
|
3a98557862ba052246453241809d6b45b518036c
|
[
"Apache-2.0"
] | null | null | null |
group.py
|
bismark163/Tests
|
3a98557862ba052246453241809d6b45b518036c
|
[
"Apache-2.0"
] | null | null | null |
class ggg:
def __init__(self, mail, passw):
self.mail = mail
self.passw = passw
| 24.75
| 36
| 0.585859
| 13
| 99
| 4.153846
| 0.538462
| 0.296296
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.313131
| 99
| 4
| 37
| 24.75
| 0.794118
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
f4f07a4adb082e6dce91b1ad05fd105dac98ab6b
| 17,782
|
py
|
Python
|
lib/peach/peach/nn/lrules.py
|
serddmitry/goog_challenge
|
3d81460e815d8adfea1e43c59906adbd402ee3c2
|
[
"Apache-1.1"
] | 1
|
2016-08-09T21:34:05.000Z
|
2016-08-09T21:34:05.000Z
|
lib/peach/peach/nn/lrules.py
|
serddmitry/goog_challenge
|
3d81460e815d8adfea1e43c59906adbd402ee3c2
|
[
"Apache-1.1"
] | null | null | null |
lib/peach/peach/nn/lrules.py
|
serddmitry/goog_challenge
|
3d81460e815d8adfea1e43c59906adbd402ee3c2
|
[
"Apache-1.1"
] | null | null | null |
################################################################################
# Peach - Computational Intelligence for Python
# Jose Alexandre Nalon
#
# This file: nn/lrules.py
# Learning rules for neural networks
################################################################################
# Doc string, reStructuredText formatted:
__doc__ = """
Learning rules for neural networks and base classes for custom learning.
This sub-package implements learning methods commonly used with neural networks.
There are a lot of different topologies and different learning methods for each
one. It is very difficult to find a consistent framework for defining learning
methods, in consequence. This method defines some base classes that are coupled
with the neural networks that they are supposed to work with. Also, based on
these classes, some of the traditional methods are implemented.
If you want to implement a different learning method, you must subclass the
correct base class. Consult the classes below. Also, pay attention to how the
implementation is expected to behave. Since learning algorithms are usually
somewhat complex, care should be taken to make everything work accordingly.
"""
################################################################################
from numpy import ones, hstack, reshape, dot, sum, exp
_BIAS = ones((1, 1), dtype=float)
"""This constant vector is defined to implement in a fast way the bias of a
neuron, as an input of value 1, stacked over the real input to the neuron."""
################################################################################
# Classes
################################################################################
class FFLearning(object):
'''
Base class for FeedForwarding Multilayer neural networks.
As a base class, this class doesn't do anything. You should subclass this
class if you want to implement a learning method for multilayer networks.
A learning method for a neural net of this kind must deal with a
``FeedForward`` instance. A ``FeedForward`` object is a list of ``Layers``
(consulting the documentation of these classes is important!). Each layer is
a bidimensional array, where each line represents the synaptic weights of a
single neuron. So, a multilayer network is actually a three-dimensional
array, if you will. Usually, though, learning methods for this kind of net
propagate some measure of the error from the output back to the input (the
``BackPropagation`` method, for instance).
A class implementing a learning method should have at least two methods:
__init__
The ``__init__`` method should initialize the object. It is in general
used to configure some property of the learning algorithm, such as the
learning rate.
__call__
The ``__call__`` interface is how the method should interact with the
neural network. It should have the following signature::
__call__(self, nn, x, d)
where ``nn`` is the ``FeedForward`` instance to be modified *in loco*,
``x`` is the input vector and ``d`` is the desired response of the net
for that particular input vector. It should return nothing.
'''
def __call__(self, nn, x, d):
'''
The ``__call__`` interface.
Read the documentation for this class for more information. A call to
the class should have the following parameters:
:Parameters:
nn
A ``FeedForward`` neural network instance that is going to be
modified by the learning algorithm. The modification is made *in
loco*, that is, the synaptic weights of ``nn`` should be modified
in place, and not returned from this function.
x
The input vector from the training set.
d
The desired response for the given input vector.
'''
raise NotImplementedError, 'learning rule not defined'
################################################################################
class LMS(FFLearning):
'''
The Least-Mean-Square (LMS) learning method.
The LMS method is a very simple method of learning, thoroughly described in
virtually every book about the subject. Please, consult a good book on
neural networks for more information. This implementation tries to use the
``numpy`` routines as much as possible for better efficiency.
'''
def __init__(self, lrate=0.05):
'''
Initializes the object.
:Parameters:
lrate
Learning rate to be used in the algorithm. Defaults to 0.05.
'''
self.lrate = lrate
'''Learning rate used in the algorithm.'''
def __call__(self, nn, x, d):
'''
The ``__call__`` interface.
The learning implementation. Read the documentation for the base class
for more information. A call to the class should have the following
parameters:
:Parameters:
nn
A ``FeedForward`` neural network instance that is going to be
modified by the learning algorithm. The modification is made *in
loco*, that is, the synaptic weights of ``nn`` should be modified
in place, and not returned from this function.
x
The input vector from the training set.
d
The desired response for the given input vector.
'''
# g would be like the local error gradient for each neuron. In LMS, this
# serves only to propagate the error
d = reshape(d, (nn.y.shape))
g = d - nn.y
# The error is backpropagated, thus the lists are inverted. To combine
# each layer, we ``zip`` them.
for w1, w2 in zip(nn[:-1][::-1], nn[1:][::-1]):
# xs is the input vector, transposed because of backpropagation.
xs = w1.y.transpose()
# Adjusts for bias.
if w2.bias:
xs = hstack((_BIAS, xs))
wt = w2.weights[:, 1:].transpose()
else:
wt = w2.weights.transpose()
# Update synaptic weights
dw = self.lrate * dot(g, xs)
w2.weights = w2.weights + dw
# Backpropagate the error.
g = dot(wt, g)
# Repeat the procedure for the first layer.
w = nn[0]
xs = x.reshape((1, w.inputs))
if w.bias:
xs = hstack((_BIAS, xs))
dw = self.lrate * dot(g, xs)
w.weights = w.weights + dw
WidrowHoff = LMS
'''Alias for the LMS class'''
DeltaRule = LMS
'''Alias for the LMS class'''
################################################################################
class BackPropagation(FFLearning):
'''
The BackPropagation learning method.
The backpropagation method is a very simple method of learning, thoroughly
described in virtually every book about the subject. Please, consult a good
book on neural networks for more information. This implementation tries to
use the ``numpy`` routines as much as possible for better efficiency.
'''
def __init__(self, lrate=0.05):
'''
Initializes the object.
:Parameters:
lrate
Learning rate to be used in the algorithm. Defaults to 0.05.
'''
self.lrate = lrate
'''Learning rate used in the algorithm.'''
def __call__(self, nn, x, d):
'''
The ``__call__`` interface.
The learning implementation. Read the documentation for the base class
for more information. A call to the class should have the following
parameters:
:Parameters:
nn
A ``FeedForward`` neural network instance that is going to be
modified by the learning algorithm. The modification is made *in
loco*, that is, the synaptic weights of ``nn`` should be modified
in place, and not returned from this function.
x
The input vector from the training set.
d
The desired response for the given input vector.
'''
# g is the local error gradient for each neuron.
d = reshape(d, (nn.y.shape))
g = (d - nn.y) * nn[-1].phi.d(nn[-1].v)
# The error is backpropagated, thus the lists are inverted. To combine
# each layer, we ``zip`` them.
for w1, w2 in zip(nn[:-1][::-1], nn[1:][::-1]):
# xs is the input vector, transposed because of backpropagation.
xs = w1.y.transpose()
# Adjusts for bias.
if w2.bias:
xs = hstack((_BIAS, xs))
wt = w2.weights[:, 1:].transpose()
else:
wt = w2.weights.transpose()
# Update synaptic weights
dw = self.lrate * dot(g, xs)
w2.weights = w2.weights + dw
# Backpropagate the error.
g = dot(wt, g) * w1.phi.d(w1.v)
# Repeat the procedure for the first layer.
w = nn[0]
xs = x.reshape((1, w.inputs))
if w.bias:
xs = hstack((_BIAS, xs))
dw = self.lrate * dot(g, xs)
w.weights = w.weights + dw
################################################################################
class SOMLearning(object):
'''
Base class for Self-Organizing Maps.
As a base class, this class doesn't do anything. You should subclass this
class if you want to implement a learning method for self-organizing maps.
A learning method for a neural net of this kind must deal with a ``SOM``
instance. A ``SOM`` object is a ``Layer`` (consulting the documentation of
these classes is important!).
A class implementing a learning method should have at least two methods:
__init__
The ``__init__`` method should initialize the object. It is in general
used to configure some property of the learning algorithm, such as the
learning rate.
__call__
The ``__call__`` interface is how the method should interact with the
neural network. It should have the following signature::
__call__(self, nn, x)
where ``nn`` is the ``SOM`` instance to be modified *in loco*, and ``x``
is the input vector. It should return nothing.
'''
def __call__(self, nn, x, d):
'''
The ``__call__`` interface.
Read the documentation for this class for more information. A call to
the class should have the following parameters:
:Parameters:
nn
A ``SOM`` neural network instance that is going to be modified by
the learning algorithm. The modification is made *in loco*, that is,
the synaptic weights of ``nn`` should be modified in place, and not
returned from this function.
x
The input vector from the training set.
'''
raise NotImplementedError, 'learning rule not defined'
################################################################################
class WinnerTakesAll(SOMLearning):
'''
Purely competitive learning method without learning rate adjust.
A winner-takes-all strategy detects the winner on the self-organizing map
and adjusts it in the direction of the input vector, scaled by the learning
rate. Its tendency is to cluster around the gravity center of the points in
the training set.
'''
def __init__(self, lrate=0.05):
'''
Initializes the object.
:Parameters:
lrate
Learning rate to be used in the algorithm. Defaults to 0.05.
'''
self.lrate = lrate
'''Learning rate used with the algorithm.'''
def __call__(self, nn, x):
'''
The ``__call__`` interface.
The learning implementation. Read the documentation for the base class
for more information. A call to the class should have the following
parameters:
:Parameters:
nn
A ``SOM`` neural network instance that is going to be modified by
the learning algorithm. The modification is made *in loco*, that is,
the synaptic weights of ``nn`` should be modified in place, and not
returned from this function.
x
The input vector from the training set.
'''
xs = x.reshape((nn.inputs, 1))
i = nn.y
w = nn.weights
dw = self.lrate * (x - w[i])
w[i] = w[i] + dw
WTA = WinnerTakesAll
'''Alias for the ``WinnerTakesAll`` class'''
################################################################################
class Competitive(SOMLearning):
'''
Competitive learning with time adjust of the learning rate.
A competitive strategy detects the winner on the self-organizing map and
adjusts it in the direction of the input vector, scaled by the learning
rate. Its tendency is to cluster around the gravity center of the points in
the training set. As time passes, the learning rate grows smaller, this
allows for better adjustment of the synaptic weights.
'''
def __init__(self, lrate=0.05, tl=1000.):
'''
Initializes the object.
:Parameters:
lrate
Learning rate to be used in the algorithm. Defaults to 0.05.
tl
Time constant that measures how many iterations will be needed to
reduce the learning rate to a small value. Defaults to 1000.
'''
self.lrate = lrate
self.__lrate = 1.0
self.__lrm = exp(-1.0/float(tl))
def __call__(self, nn, x):
'''
The ``__call__`` interface.
The learning implementation. Read the documentation for the base class
for more information. A call to the class should have the following
parameters:
:Parameters:
nn
A ``SOM`` neural network instance that is going to be modified by
the learning algorithm. The modification is made *in loco*, that is,
the synaptic weights of ``nn`` should be modified in place, and not
returned from this function.
x
The input vector from the training set.
'''
xs = x.reshape((nn.inputs, 1))
i = nn.y
w = nn.weights
# Adjusts the learning rate according to an exponential rule
lrate = self.lrate * self.__lrate
self.__lrate = self.__lrate * self.__lrm
# Updates the weights
dw = lrate * (x - w[i])
w[i] = w[i] + dw
################################################################################
class Cooperative(SOMLearning):
'''
Cooperative learning with time adjust of the learning rate and neighborhood
function to propagate cooperation
A cooperative strategy detects the winner on the self-organizing map and
adjusts it in the direction of the input vector, scaled by the learning
rate. Its tendency is to cluster around the gravity center of the points in
the training set. As time passes, the learning rate grows smaller, this
allows for better adjustment of the synaptic weights.
Also, a neighborhood is defined on the winner. Neurons close to the winner
are also updated in the direction of the input vector, although with a
smaller scale determined by the neighborhood function. A neighborhood
function is 1. at 0., and decreases monotonically as the distance increases.
*There are issues with this class!* -- some of the class capabilities are
yet to be developed.
'''
def __init__(self, lrate=0.05, tl=1000, tn=1000):
'''
Initializes the object.
:Parameters:
lrate
Learning rate to be used in the algorithm. Defaults to 0.05.
tl
Time constant that measures how many iterations will be needed to
reduce the learning rate to a small value. Defaults to 1000.
tn
Time constant that measures how many iterations will be needed to
shrink the neighborhood. Defaults to 1000.
'''
self.__neighbor = 1.0
self.__lrate = 1.0
self.__lrm = exp(-1.0/float(tl))
self.__nbm = exp(-1.0/float(tn))
self.__s0 = float(s0)
def __call__(self, nn, x):
'''
The ``__call__`` interface.
The learning implementation. Read the documentation for the base class
for more information. A call to the class should have the following
parameters:
:Parameters:
nn
A ``SOM`` neural network instance that is going to be modified by
the learning algorithm. The modification is made *in loco*, that is,
the synaptic weights of ``nn`` should be modified in place, and not
returned from this function.
x
The input vector from the training set.
'''
xs = x.reshape((nn.inputs, 1))
i = nn.y
w = nn.weights
wi = nn.weights[i, :]
# Adjusts the learning rate according to an exponential rule
lrate = nn.lrate * self.__lrate
self.__lrate = self.__lrate * self.__lrm
# Apply neighborhood function.
s = self.__s0 * self.__neighbor
self.__neighbor = self.__neighbor * self.__nbm
d = sum((wi - w)**2, axis=1)
h = exp(-d/(2*s**2))
# Updates the weights
dw = lrate * h * (x - w).transpose()
w = w + dw.transpose()
nn.weights = w
################################################################################
# Test
if __name__ == "__main__":
pass
| 36.663918
| 80
| 0.59071
| 2,254
| 17,782
| 4.583407
| 0.154392
| 0.028748
| 0.020327
| 0.019166
| 0.75075
| 0.734585
| 0.72326
| 0.702739
| 0.680476
| 0.670216
| 0
| 0.009075
| 0.287369
| 17,782
| 485
| 81
| 36.663918
| 0.806187
| 0.059498
| 0
| 0.575221
| 0
| 0
| 0.190004
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0.00885
| 0.00885
| null | null | 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
f4fa58398d3e39742800cf3dffdb80242e88913b
| 56
|
py
|
Python
|
src/psion/oauth2/authentication/__init__.py
|
revensky/psion
|
dfe38a1a4f4d6a5029d0973dbe1326415df6d512
|
[
"MIT"
] | 2
|
2021-02-22T22:12:23.000Z
|
2021-02-22T22:48:33.000Z
|
src/psion/oauth2/authentication/__init__.py
|
revensky/psion
|
dfe38a1a4f4d6a5029d0973dbe1326415df6d512
|
[
"MIT"
] | null | null | null |
src/psion/oauth2/authentication/__init__.py
|
revensky/psion
|
dfe38a1a4f4d6a5029d0973dbe1326415df6d512
|
[
"MIT"
] | null | null | null |
from .client_authentication import ClientAuthentication
| 28
| 55
| 0.910714
| 5
| 56
| 10
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.071429
| 56
| 1
| 56
| 56
| 0.961538
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
760912059c1d4300b7003cf2f721139b61605a11
| 69
|
py
|
Python
|
LuoguCodes/AT277.py
|
Anguei/OI-Codes
|
0ef271e9af0619d4c236e314cd6d8708d356536a
|
[
"MIT"
] | null | null | null |
LuoguCodes/AT277.py
|
Anguei/OI-Codes
|
0ef271e9af0619d4c236e314cd6d8708d356536a
|
[
"MIT"
] | null | null | null |
LuoguCodes/AT277.py
|
Anguei/OI-Codes
|
0ef271e9af0619d4c236e314cd6d8708d356536a
|
[
"MIT"
] | null | null | null |
n = int(raw_input())
print (n // 10) * 100 + min((n % 10) * 15, 100)
| 23
| 47
| 0.507246
| 13
| 69
| 2.615385
| 0.692308
| 0.176471
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.226415
| 0.231884
| 69
| 2
| 48
| 34.5
| 0.415094
| 0
| 0
| 0
| 0
| 0
| 0
| 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
| 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
| 1
|
0
| 5
|
760a25addd5afed0dc68215774047c77c1b1a05a
| 5,694
|
py
|
Python
|
stars/test/test_player.py
|
therussellhome/inherit_the_stars
|
aa498103e1683625f762afee8c95ffcebb77ca03
|
[
"Unlicense"
] | null | null | null |
stars/test/test_player.py
|
therussellhome/inherit_the_stars
|
aa498103e1683625f762afee8c95ffcebb77ca03
|
[
"Unlicense"
] | null | null | null |
stars/test/test_player.py
|
therussellhome/inherit_the_stars
|
aa498103e1683625f762afee8c95ffcebb77ca03
|
[
"Unlicense"
] | null | null | null |
import unittest
from .. import *
class PlayerTestCase(unittest.TestCase):
def test_do_research(self):
#TODO
return
p = player.Player()
p.energy = 1000000
p.energy_minister.allocate_budget(p.energy)
p.energy_minister.research_budget = 100
p.research_field = 'energy'
p.tech_level.energy = 0
p.next_tech_cost.energy = 100
p._do_research()
self.assertEqual(p.tech_level.energy, 1)
self.assertEqual(p.energy_minister.research_budget, 0)
p.energy_minister.research_budget = 300
p.research_field = 'energy'
p.tech_level.energy = 0
p.next_tech_cost.energy = 100
p._do_research()
self.assertEqual(p.tech_level.energy, 2)
self.assertEqual(p.energy_minister.research_budget, 0)
def test_calc_research_cost(self):
# TODO
pass
def test_calc_next_research_field(self):
# TODO
pass
def test_allocate(self):
return # TODO these tests predate the move to player
m = energy_minister.EnergyMinister()
# test 1
m.energy_minister_construction_percent = 100
m.energy_minister_mattrans_percent = 100
m.energy_minister_research_percent = 100
m.allocate_budget(100)
self.assertEqual(m.construction_budget, 100)
self.assertEqual(m.mattrans_budget, 0)
self.assertEqual(m.research_budget, 0)
self.assertEqual(m.unallocated_budget, 0)
# test 2
m.energy_minister_construction_percent = 0
m.energy_minister_mattrans_percent = 100
m.energy_minister_research_percent = 100
m.allocate_budget(100)
self.assertEqual(m.construction_budget, 0)
self.assertEqual(m.mattrans_budget, 100)
self.assertEqual(m.research_budget, 0)
self.assertEqual(m.unallocated_budget, 0)
# test 3
m.energy_minister_construction_percent = 0
m.energy_minister_mattrans_percent = 0
m.energy_minister_research_percent = 100
m.allocate_budget(100)
self.assertEqual(m.construction_budget, 0)
self.assertEqual(m.mattrans_budget, 0)
self.assertEqual(m.research_budget, 100)
self.assertEqual(m.unallocated_budget, 0)
# test 4
m.energy_minister_construction_percent = 0
m.energy_minister_mattrans_percent = 0
m.energy_minister_research_percent = 0
m.allocate_budget(100)
self.assertEqual(m.construction_budget, 0)
self.assertEqual(m.mattrans_budget, 0)
self.assertEqual(m.research_budget, 0)
self.assertEqual(m.unallocated_budget, 100)
# test 5
m.energy_minister_construction_percent = 10
m.energy_minister_mattrans_percent = 10
m.energy_minister_research_percent = 10
m.allocate_budget(100)
self.assertEqual(m.construction_budget, 10)
self.assertEqual(m.mattrans_budget, 10)
self.assertEqual(m.research_budget, 10)
self.assertEqual(m.unallocated_budget, 70)
def test_check_budget(self):
return # TODO these tests predate the move to player
m = energy_minister.EnergyMinister()
m.energy_minister_construction_percent = 40
m.energy_minister_mattrans_percent = 30
m.energy_minister_research_percent = 20
m.allocate_budget(100)
self.assertEqual(m.check_budget('ship', 30), 30)
self.assertEqual(m.check_budget('ship', 40), 40)
self.assertEqual(m.check_budget('ship', 111), 40)
self.assertEqual(m.check_budget('planetary', 111), 40)
self.assertEqual(m.check_budget('baryogenesis', 111), 40)
self.assertEqual(m.check_budget('mattrans', 111), 30)
self.assertEqual(m.check_budget('research', 111), 20)
self.assertEqual(m.check_budget('trade', 111), 100)
m.energy_minister_mattrans_use_surplus = True
self.assertEqual(m.check_budget('mattrans', 111), 70)
m.energy_minister_research_use_surplus = True
self.assertEqual(m.check_budget('research', 111), 90)
self.assertEqual(m.construction_budget, 40)
self.assertEqual(m.mattrans_budget, 30)
self.assertEqual(m.research_budget, 20)
self.assertEqual(m.unallocated_budget, 10)
def test_spend_budget(self):
return # TODO these tests predate the move to player
m = energy_minister.EnergyMinister()
m.energy_minister_construction_percent = 40
m.energy_minister_mattrans_percent = 30
m.energy_minister_research_percent = 20
m.allocate_budget(100)
# Construction
self.assertEqual(m.spend_budget('ship', 1), 1)
self.assertEqual(m.construction_budget, 39)
self.assertEqual(m.spend_budget('planetary', 1), 1)
self.assertEqual(m.construction_budget, 38)
self.assertEqual(m.spend_budget('baryogenesis', 1), 1)
self.assertEqual(m.construction_budget, 37)
# Mattrans
self.assertEqual(m.spend_budget('mattrans', 111), 30)
self.assertEqual(m.mattrans_budget, 0)
m.energy_minister_mattrans_use_surplus = True
self.assertEqual(m.spend_budget('mattrans', 5), 5)
self.assertEqual(m.mattrans_budget, -5)
# Research
self.assertEqual(m.spend_budget('research', 111), 20)
self.assertEqual(m.research_budget, 0)
m.energy_minister_research_use_surplus = True
self.assertEqual(m.spend_budget('research', 111), 32)
self.assertEqual(m.research_budget, -32)
# Unallocated
self.assertEqual(m.spend_budget('trade', 111), 10)
self.assertEqual(m.unallocated_budget, 0)
| 41.867647
| 65
| 0.67457
| 708
| 5,694
| 5.175141
| 0.096045
| 0.22107
| 0.218341
| 0.057314
| 0.894105
| 0.726801
| 0.669214
| 0.546124
| 0.509552
| 0.49536
| 0
| 0.050766
| 0.231999
| 5,694
| 135
| 66
| 42.177778
| 0.787103
| 0.03934
| 0
| 0.521368
| 0
| 0
| 0.026398
| 0
| 0
| 0
| 0
| 0.007407
| 0.461538
| 1
| 0.051282
| false
| 0.017094
| 0.017094
| 0
| 0.111111
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
762ca0f6cff6c836eddfcba63490fcf3d342f031
| 349
|
py
|
Python
|
pyscf/neo/__init__.py
|
zc62/pyscf
|
4ed05044d44d49c3ffd4d2e098e9031478fb39e7
|
[
"Apache-2.0"
] | null | null | null |
pyscf/neo/__init__.py
|
zc62/pyscf
|
4ed05044d44d49c3ffd4d2e098e9031478fb39e7
|
[
"Apache-2.0"
] | null | null | null |
pyscf/neo/__init__.py
|
zc62/pyscf
|
4ed05044d44d49c3ffd4d2e098e9031478fb39e7
|
[
"Apache-2.0"
] | null | null | null |
#!/usr/bin/env python
from pyscf.neo.mole import Mole
from pyscf.neo.hf import HF
from pyscf.neo.ks import KS
from pyscf.neo.cdft import CDFT
from pyscf.neo.grad import Gradients
from pyscf.neo.cphf import CPHF
from pyscf.neo.hessian import Hessian
from pyscf.neo.ase import Pyscf_NEO, Pyscf_DFT
from pyscf.neo.mp2 import MP2
#import pyscf.neo.pbc
| 26.846154
| 46
| 0.802292
| 65
| 349
| 4.276923
| 0.307692
| 0.316547
| 0.388489
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.006515
| 0.120344
| 349
| 12
| 47
| 29.083333
| 0.899023
| 0.114613
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
52060d23e685dce277bc7a0f01f3af1e4214baa0
| 3,189
|
py
|
Python
|
src/compas/datastructures/__init__.py
|
adacko/compas
|
47c443ad3825897ec7ed932ec20734c2f08ef120
|
[
"MIT"
] | null | null | null |
src/compas/datastructures/__init__.py
|
adacko/compas
|
47c443ad3825897ec7ed932ec20734c2f08ef120
|
[
"MIT"
] | null | null | null |
src/compas/datastructures/__init__.py
|
adacko/compas
|
47c443ad3825897ec7ed932ec20734c2f08ef120
|
[
"MIT"
] | 1
|
2022-01-16T02:32:43.000Z
|
2022-01-16T02:32:43.000Z
|
"""
********************************************************************************
datastructures
********************************************************************************
.. currentmodule:: compas.datastructures
Mesh
====
The mesh is implemented as a half-edge datastructure.
It is meant for the representation of polygonal *"surface"* meshes. A mesh can be
connected or disconnected. A mesh can be closed or open. A mesh can be comprised
of only vertices.
.. autosummary::
:toctree: generated/
:nosignatures:
Mesh
Mesh matrices
-------------
.. autosummary::
:toctree: generated/
:nosignatures:
mesh_adjacency_matrix
mesh_connectivity_matrix
mesh_degree_matrix
mesh_face_matrix
mesh_laplacian_matrix
.. autosummary::
:toctree: generated/
:nosignatures:
trimesh_cotangent_laplacian_matrix
trimesh_vertexarea_matrix
Mesh algorithms
---------------
.. autosummary::
:toctree: generated/
:nosignatures:
mesh_bounding_box
mesh_bounding_box_xy
mesh_oriented_bounding_box_numpy
mesh_oriented_bounding_box_xy_numpy
mesh_contours_numpy
mesh_dual
mesh_geodesic_distances
mesh_isolines_numpy
mesh_planarize_faces
mesh_quads_to_triangles
mesh_smooth_centroid
mesh_smooth_area
mesh_subdivide
mesh_subdivide_tri
mesh_subdivide_corner
mesh_subdivide_quad
mesh_subdivide_catmullclark
mesh_subdivide_doosabin
mesh_transform
mesh_transformed
.. autosummary::
:toctree: generated/
:nosignatures:
trimesh_gaussian_curvature
trimesh_remesh
trimesh_subdivide_loop
Mesh helpers
------------
.. autosummary::
:toctree: generated/
:nosignatures:
mesh_delete_duplicate_vertices
mesh_face_adjacency
mesh_flip_cycles
mesh_is_connected
mesh_unify_cycles
Network
=======
The network is a connectivity graph.
It is meant for the representation of networks of vertices connected by edges.
The edges are directed. A network does not have faces. A network can be connected
or disconnected. A network with vertices only is also a valid network.
.. autosummary::
:toctree: generated/
:nosignatures:
Network
Network algorithms
------------------
.. autosummary::
:toctree: generated/
:nosignatures:
network_complement
network_count_crossings
network_dual
network_embed_in_plane
network_find_crossings
network_find_faces
network_is_connected
network_is_crossed
network_is_planar
network_is_planar_embedding
network_is_xy
network_smooth_centroid
VolMesh
=======
The volmesh is a cellular mesh. It is implemented as
a half-plane, the three-dimensional equivalent of a half-edge. It can, for example,
be used for the representation of subdivided/partitioned polyhedra.
.. autosummary::
:toctree: generated/
:nosignatures:
VolMesh
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
class Datastructure(object):
pass
from .network import *
from .mesh import *
from .volmesh import *
__all__ = [name for name in dir() if not name.startswith('_')]
| 20.574194
| 83
| 0.698965
| 357
| 3,189
| 5.915966
| 0.361345
| 0.076705
| 0.115057
| 0.166193
| 0.253788
| 0.056818
| 0.029356
| 0
| 0
| 0
| 0
| 0
| 0.18407
| 3,189
| 154
| 84
| 20.707792
| 0.811683
| 0.908435
| 0
| 0
| 0
| 0
| 0.003534
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.111111
| 0.666667
| 0
| 0.777778
| 0.111111
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 1
| 0
|
0
| 5
|
5210c18714c689062802f8dfb64ab77d6eba1984
| 80
|
py
|
Python
|
rascil/workflows/rsexecute/image/__init__.py
|
SKA-ScienceDataProcessor/rascil
|
bd3b47f779e18e184781e2928ad1539d1fdc1c9b
|
[
"Apache-2.0"
] | 7
|
2019-12-14T13:42:33.000Z
|
2022-01-28T03:31:45.000Z
|
rascil/workflows/rsexecute/image/__init__.py
|
SKA-ScienceDataProcessor/rascil
|
bd3b47f779e18e184781e2928ad1539d1fdc1c9b
|
[
"Apache-2.0"
] | 6
|
2020-01-08T09:40:08.000Z
|
2020-06-11T14:56:13.000Z
|
rascil/workflows/rsexecute/image/__init__.py
|
SKA-ScienceDataProcessor/rascil
|
bd3b47f779e18e184781e2928ad1539d1fdc1c9b
|
[
"Apache-2.0"
] | 3
|
2020-01-14T11:14:16.000Z
|
2020-09-15T05:21:06.000Z
|
"""
Workflows for operating on images
"""
from .image_rsexecute import *
| 10
| 37
| 0.675
| 9
| 80
| 5.888889
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.225
| 80
| 7
| 38
| 11.428571
| 0.854839
| 0.4125
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
5286466fc8368c7af260fdb530bdc863fbbdfed2
| 44
|
py
|
Python
|
flash_air_music/convert/__init__.py
|
Robpol86/FlashAirMusic
|
acc5db1c4a1590623168eed05e48a8975f340d9f
|
[
"MIT"
] | null | null | null |
flash_air_music/convert/__init__.py
|
Robpol86/FlashAirMusic
|
acc5db1c4a1590623168eed05e48a8975f340d9f
|
[
"MIT"
] | 5
|
2016-01-03T08:39:06.000Z
|
2016-02-16T03:30:50.000Z
|
flash_air_music/convert/__init__.py
|
Robpol86/FlashAirMusic
|
acc5db1c4a1590623168eed05e48a8975f340d9f
|
[
"MIT"
] | null | null | null |
"""Handles converting FLAC files to MP3."""
| 22
| 43
| 0.704545
| 6
| 44
| 5.166667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.026316
| 0.136364
| 44
| 1
| 44
| 44
| 0.789474
| 0.840909
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
870f0563926746a11490ed3bcbda85e0daded7db
| 213
|
py
|
Python
|
lazylawyer/database/table_appeals.py
|
branislav1991/LazyLawyer
|
ff4433158e123cd505874da896946dc791e9c573
|
[
"MIT"
] | null | null | null |
lazylawyer/database/table_appeals.py
|
branislav1991/LazyLawyer
|
ff4433158e123cd505874da896946dc791e9c573
|
[
"MIT"
] | null | null | null |
lazylawyer/database/table_appeals.py
|
branislav1991/LazyLawyer
|
ff4433158e123cd505874da896946dc791e9c573
|
[
"MIT"
] | null | null | null |
from lazylawyer.database import database as db
def write_appeals(appeals):
"""Stores all appeals reference to the database.
"""
db.batch_insert_check('appeals', appeals, attrs=['orig_case_id'])
| 30.428571
| 70
| 0.713615
| 28
| 213
| 5.25
| 0.75
| 0.190476
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.178404
| 213
| 6
| 71
| 35.5
| 0.84
| 0.211268
| 0
| 0
| 0
| 0
| 0.125828
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.333333
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
87187b29e35e40077fcb6a48e16e33514906d5d1
| 43
|
py
|
Python
|
Chapter12/run.py
|
shalevy1/Flask-Framework-Cookbook-Second-Edition
|
e219c3c243f147fa6ebd09c114b08ea2b9109cfa
|
[
"MIT"
] | 42
|
2019-07-21T09:10:17.000Z
|
2022-02-21T01:12:18.000Z
|
Chapter12/run.py
|
shalevy1/Flask-Framework-Cookbook-Second-Edition
|
e219c3c243f147fa6ebd09c114b08ea2b9109cfa
|
[
"MIT"
] | 2
|
2019-09-11T16:17:06.000Z
|
2021-03-01T18:46:20.000Z
|
Chapter12/run.py
|
shalevy1/Flask-Framework-Cookbook-Second-Edition
|
e219c3c243f147fa6ebd09c114b08ea2b9109cfa
|
[
"MIT"
] | 45
|
2019-07-17T22:50:28.000Z
|
2022-03-23T13:52:59.000Z
|
from my_app import app
app.run(debug=True)
| 14.333333
| 22
| 0.790698
| 9
| 43
| 3.666667
| 0.777778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.116279
| 43
| 2
| 23
| 21.5
| 0.868421
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
87652a6548a857dcb3c2c0ce34f6a848940238f4
| 40
|
py
|
Python
|
src/multitfa/data/__init__.py
|
biosustain/multitfa
|
ab5a9bf6c19a94a221c9a137cccfcacdc2c1cb50
|
[
"Apache-2.0"
] | 4
|
2020-11-27T20:25:57.000Z
|
2021-03-12T22:01:34.000Z
|
src/multitfa/data/__init__.py
|
biosustain/multitfa
|
ab5a9bf6c19a94a221c9a137cccfcacdc2c1cb50
|
[
"Apache-2.0"
] | 8
|
2020-11-29T23:56:31.000Z
|
2021-04-09T11:23:17.000Z
|
src/multitfa/data/__init__.py
|
biosustain/multitfa
|
ab5a9bf6c19a94a221c9a137cccfcacdc2c1cb50
|
[
"Apache-2.0"
] | 1
|
2021-11-11T09:22:57.000Z
|
2021-11-11T09:22:57.000Z
|
"""Provide data file to the package."""
| 20
| 39
| 0.675
| 6
| 40
| 4.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.15
| 40
| 1
| 40
| 40
| 0.794118
| 0.825
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
876d6a278d755862379ea5ca9e828a1fe542edf0
| 171
|
py
|
Python
|
webserver/moduler/controller/controller.py
|
akhtarnabeel/ecoforecastCS
|
31bfeb3d663fb113bac9efe86caea4bf908fa434
|
[
"MIT"
] | null | null | null |
webserver/moduler/controller/controller.py
|
akhtarnabeel/ecoforecastCS
|
31bfeb3d663fb113bac9efe86caea4bf908fa434
|
[
"MIT"
] | null | null | null |
webserver/moduler/controller/controller.py
|
akhtarnabeel/ecoforecastCS
|
31bfeb3d663fb113bac9efe86caea4bf908fa434
|
[
"MIT"
] | 2
|
2020-05-01T17:58:17.000Z
|
2020-07-27T20:38:40.000Z
|
#!usr/bin/python
import configparser; config = configparser.ConfigParser();config.read('config.cfg')
if __name__=="__main__":
print type(config['web-server']['port'])
| 21.375
| 83
| 0.730994
| 21
| 171
| 5.571429
| 0.761905
| 0.307692
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.081871
| 171
| 7
| 84
| 24.428571
| 0.745223
| 0.087719
| 0
| 0
| 0
| 0
| 0.206452
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.333333
| null | null | 0.333333
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
877a9c066e653111dc5487f48676ab61735f5176
| 173
|
py
|
Python
|
users/forms.py
|
frankdevelopero/django-frikr
|
1845ea0a571f0285afc042618aacb6d7d87d7353
|
[
"MIT"
] | null | null | null |
users/forms.py
|
frankdevelopero/django-frikr
|
1845ea0a571f0285afc042618aacb6d7d87d7353
|
[
"MIT"
] | null | null | null |
users/forms.py
|
frankdevelopero/django-frikr
|
1845ea0a571f0285afc042618aacb6d7d87d7353
|
[
"MIT"
] | null | null | null |
from django import forms
class LoginForm(forms.Form):
usr = forms.CharField(label="Usuario")
pwd = forms.CharField(label="Contraseña", widget=forms.PasswordInput)
| 24.714286
| 73
| 0.745665
| 21
| 173
| 6.142857
| 0.714286
| 0.217054
| 0.294574
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.132948
| 173
| 6
| 74
| 28.833333
| 0.86
| 0
| 0
| 0
| 0
| 0
| 0.098266
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.25
| 0.25
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
5ea5b896308612a702c41a31972ca1127a9b11ad
| 923
|
py
|
Python
|
docs/jnpr_healthbot_swagger/swagger_client/api/__init__.py
|
minefuto/healthbot-py-client
|
bb81452c974456af44299aebf32a73abeda8a943
|
[
"Apache-2.0"
] | null | null | null |
docs/jnpr_healthbot_swagger/swagger_client/api/__init__.py
|
minefuto/healthbot-py-client
|
bb81452c974456af44299aebf32a73abeda8a943
|
[
"Apache-2.0"
] | null | null | null |
docs/jnpr_healthbot_swagger/swagger_client/api/__init__.py
|
minefuto/healthbot-py-client
|
bb81452c974456af44299aebf32a73abeda8a943
|
[
"Apache-2.0"
] | null | null | null |
from __future__ import absolute_import
# flake8: noqa
# import apis into api package
from swagger_client.api.administration_api import AdministrationApi
from swagger_client.api.authentication_api import AuthenticationApi
from swagger_client.api.configuration_api import ConfigurationApi
from swagger_client.api.data_source_api import DataSourceApi
from swagger_client.api.data_store_api import DataStoreApi
from swagger_client.api.debug_api import DebugApi
from swagger_client.api.default_api import DefaultApi
from swagger_client.api.documentation_api import DocumentationApi
from swagger_client.api.facts_api import FactsApi
from swagger_client.api.instance_schedule_state_api import InstanceScheduleStateApi
from swagger_client.api.license_api import LicenseApi
from swagger_client.api.logs_api import LogsApi
from swagger_client.api.services_api import ServicesApi
from swagger_client.api.system_api import SystemApi
| 46.15
| 83
| 0.889491
| 128
| 923
| 6.125
| 0.335938
| 0.196429
| 0.303571
| 0.357143
| 0.061224
| 0
| 0
| 0
| 0
| 0
| 0
| 0.001174
| 0.076923
| 923
| 19
| 84
| 48.578947
| 0.919014
| 0.04442
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
5ed4893aa3d82971eb07e8a3cc9763f23cff15b4
| 30
|
py
|
Python
|
bibserver/auth/__init__.py
|
jgoldfar/bibserver
|
ccf0e60f1983bb5db4c2594bbd8187139556be90
|
[
"MIT"
] | 47
|
2015-01-07T06:53:22.000Z
|
2021-02-27T08:48:43.000Z
|
bibserver/auth/__init__.py
|
dartar/bibserver
|
0640592200476bd97dfe9678173d30759bdbce30
|
[
"OML"
] | 10
|
2015-02-08T12:48:27.000Z
|
2018-11-08T02:47:19.000Z
|
bibserver/auth/__init__.py
|
dartar/bibserver
|
0640592200476bd97dfe9678173d30759bdbce30
|
[
"OML"
] | 21
|
2015-01-16T06:31:43.000Z
|
2021-02-27T08:49:18.000Z
|
import collection
import user
| 10
| 17
| 0.866667
| 4
| 30
| 6.5
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.133333
| 30
| 2
| 18
| 15
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
0db43653000af9adcec19e6e0656f6027aeb666c
| 333
|
py
|
Python
|
tests/stores.py
|
meghabhoj/NEWBAZAAR
|
cb1405dcb2c8b4812ddf724d5a3c07b2f77c1b34
|
[
"BSD-2-Clause-FreeBSD"
] | null | null | null |
tests/stores.py
|
meghabhoj/NEWBAZAAR
|
cb1405dcb2c8b4812ddf724d5a3c07b2f77c1b34
|
[
"BSD-2-Clause-FreeBSD"
] | null | null | null |
tests/stores.py
|
meghabhoj/NEWBAZAAR
|
cb1405dcb2c8b4812ddf724d5a3c07b2f77c1b34
|
[
"BSD-2-Clause-FreeBSD"
] | null | null | null |
from __future__ import absolute_import
from __future__ import unicode_literals
from bazaar.listings.stores.strategies import DefaultStoreStrategy
class Store1(DefaultStoreStrategy):
def get_store_name(self):
return "Store 1"
class Store2(DefaultStoreStrategy):
def get_store_name(self):
return "Store 2"
| 22.2
| 66
| 0.777778
| 39
| 333
| 6.282051
| 0.564103
| 0.081633
| 0.130612
| 0.253061
| 0.408163
| 0.408163
| 0.408163
| 0.408163
| 0
| 0
| 0
| 0.014388
| 0.165165
| 333
| 14
| 67
| 23.785714
| 0.866906
| 0
| 0
| 0.222222
| 0
| 0
| 0.042042
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.222222
| false
| 0
| 0.333333
| 0.222222
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 1
| 1
| 0
|
0
| 5
|
21cdcdb0a1f00e654cce586794038d395dd30b80
| 46
|
py
|
Python
|
test/formatters/samplecode/black/in.py
|
mohkale/apheleia
|
75074a2f11e29aeca376b3004270a93ce44e59de
|
[
"MIT"
] | null | null | null |
test/formatters/samplecode/black/in.py
|
mohkale/apheleia
|
75074a2f11e29aeca376b3004270a93ce44e59de
|
[
"MIT"
] | null | null | null |
test/formatters/samplecode/black/in.py
|
mohkale/apheleia
|
75074a2f11e29aeca376b3004270a93ce44e59de
|
[
"MIT"
] | null | null | null |
def asdjf ( l,
a):
3
+4
| 9.2
| 20
| 0.26087
| 6
| 46
| 2
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.117647
| 0.630435
| 46
| 4
| 21
| 11.5
| 0.588235
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0
| 0
| 0.25
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
21d125253f8a5cda1806b69aa7684a98a8e79afe
| 161
|
py
|
Python
|
best_cn_finetune/preprocess/__init__.py
|
you-know-who-2017/QA_MRC
|
323591995ac4ca0ca39e6101f6ff1c6f88104bc8
|
[
"MIT"
] | null | null | null |
best_cn_finetune/preprocess/__init__.py
|
you-know-who-2017/QA_MRC
|
323591995ac4ca0ca39e6101f6ff1c6f88104bc8
|
[
"MIT"
] | null | null | null |
best_cn_finetune/preprocess/__init__.py
|
you-know-who-2017/QA_MRC
|
323591995ac4ca0ca39e6101f6ff1c6f88104bc8
|
[
"MIT"
] | null | null | null |
'''
Author: geekli
Date: 2020-12-28 15:53:18
LastEditTime: 2020-12-28 15:53:19
LastEditors: your name
Description:
FilePath: \QA_MRC\preprocess\__init__.py
'''
| 17.888889
| 40
| 0.745342
| 26
| 161
| 4.423077
| 0.807692
| 0.104348
| 0.13913
| 0.173913
| 0.208696
| 0
| 0
| 0
| 0
| 0
| 0
| 0.194444
| 0.10559
| 161
| 8
| 41
| 20.125
| 0.604167
| 0.944099
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
21f0a27826fe6d05bf6a7d288647b63d5e047d8e
| 112
|
py
|
Python
|
battlehack20/engine/__init__.py
|
cooljoseph1/battlehack20-minimal
|
3a1207b7eeb48123664d870706971907bbe8c101
|
[
"MIT"
] | 1
|
2021-01-01T19:02:34.000Z
|
2021-01-01T19:02:34.000Z
|
battlehack20/engine/__init__.py
|
cooljoseph1/battlehack20-minimal
|
3a1207b7eeb48123664d870706971907bbe8c101
|
[
"MIT"
] | null | null | null |
battlehack20/engine/__init__.py
|
cooljoseph1/battlehack20-minimal
|
3a1207b7eeb48123664d870706971907bbe8c101
|
[
"MIT"
] | null | null | null |
from .container import CodeContainer
from .game import Game, GameConstants
from .basicviewer import BasicViewer
| 28
| 37
| 0.848214
| 13
| 112
| 7.307692
| 0.538462
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.116071
| 112
| 3
| 38
| 37.333333
| 0.959596
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
21f9e26af5d975c9a2fcbd148cf8f461ec5ebcb9
| 76
|
py
|
Python
|
Scheduling and Launching/openme.py
|
Piraato/Learn-Python
|
ae33680b61bbf41f5c0c29c79544b54e59df80b2
|
[
"MIT"
] | null | null | null |
Scheduling and Launching/openme.py
|
Piraato/Learn-Python
|
ae33680b61bbf41f5c0c29c79544b54e59df80b2
|
[
"MIT"
] | null | null | null |
Scheduling and Launching/openme.py
|
Piraato/Learn-Python
|
ae33680b61bbf41f5c0c29c79544b54e59df80b2
|
[
"MIT"
] | null | null | null |
print("Very well, you can run Python scripts from a Python script.")
input()
| 38
| 68
| 0.75
| 13
| 76
| 4.384615
| 0.923077
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.144737
| 76
| 2
| 69
| 38
| 0.876923
| 0
| 0
| 0
| 0
| 0
| 0.766234
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 0.5
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
21fdc764a84fb352ca7b3148dd8aba7ab9037b6c
| 28,087
|
py
|
Python
|
Functions/SimulationType/DC.py
|
SunYongshuai/SunSpice
|
7f9368a7af1421a63b69dcce3decc6d06ff1ff6b
|
[
"Apache-2.0"
] | 1
|
2018-12-10T06:06:54.000Z
|
2018-12-10T06:06:54.000Z
|
Functions/SimulationType/DC.py
|
SunYongshuai/SunSpice
|
7f9368a7af1421a63b69dcce3decc6d06ff1ff6b
|
[
"Apache-2.0"
] | null | null | null |
Functions/SimulationType/DC.py
|
SunYongshuai/SunSpice
|
7f9368a7af1421a63b69dcce3decc6d06ff1ff6b
|
[
"Apache-2.0"
] | null | null | null |
#!/usr/bin/python3
# -*- encoding="UTF-8" -*-
#Import Package
import numpy as np
from tkinter.messagebox import *
import parameters
from Functions.string2num import string2num
def getOutTitleDC():
if len(parameters.listDCParam) == 1:
paramName = parameters.listDCParam[0].paramName
WriteString = str(paramName) + '\t'
for index in parameters.NodesDict:
if index == '0':
pass
else:
WriteString = WriteString + 'v_' + index + '\t'
#V -> Pluse -> SinV -> E -> F -> H -> L
#Source Current
for index in parameters.listDCV:
WriteString = WriteString + 'i_' + index.name + '\t'
for index in parameters.listPulseV:
WriteString = WriteString + 'i_' + index.name + '\t'
for index in parameters.listSinV:
WriteString = WriteString + 'i_' + index.name + '\t'
for index in parameters.listE:
WriteString = WriteString + 'i_' + index.name + '\t'
for index in parameters.listF:
WriteString = WriteString + 'i_' + index.name + '\t'
for index in parameters.listH:
WriteString = WriteString + 'i_' + index.name + '\t'
for index in parameters.listL:
WriteString = WriteString + 'i_' + index.name + '\t'
#Elem Current
for index in parameters.listR:
WriteString = WriteString + 'i_' + index.name + '\t'
for index in parameters.listD:
WriteString = WriteString + 'i_' + index.name + '\t'
for index in parameters.listG:
WriteString = WriteString + 'i_' + index.name + '\t'
for index in parameters.listM:
WriteString = WriteString + 'i_' + index.name + '\t'
return WriteString
def getOutDataDC(MatResult):
WriteString = ''
for node in parameters.NodesDict:
if node != '0':
WriteString = WriteString + str(MatResult[parameters.NodesDict.get(node)-1,0]) + '\t'
for index in range(len(parameters.listDCV)):
#V -> Pluse -> SinV -> E -> F -> H -> L
matAddr = len(parameters.NodesDict) + index - 1
WriteString = WriteString + str(MatResult[matAddr,0]) + '\t'
for index in range(len(parameters.listPulseV)):
#V -> Pluse -> SinV -> E -> F -> H -> L
matAddr = len(parameters.NodesDict) + len(parameters.listDCV) + index - 1
WriteString = WriteString + str(MatResult[matAddr,0]) + '\t'
for index in range(len(parameters.listSinV)):
#V -> Pluse -> SinV -> E -> F -> H -> L
matAddr = len(parameters.NodesDict) + len(parameters.listDCV) + len(parameters.listPulseV) + index - 1
WriteString = WriteString + str(MatResult[matAddr,0]) + '\t'
for index in range(len(parameters.listE)):
#V -> Pluse -> SinV -> E -> F -> H -> L
matAddr = len(parameters.NodesDict) + len(parameters.listDCV) + len(parameters.listPulseV) + len(parameters.listSinV) + index - 1
WriteString = WriteString + str(MatResult[matAddr,0]) + '\t'
for index in range(len(parameters.listF)):
#V -> Pluse -> SinV -> E -> F -> H -> L
matAddr = len(parameters.NodesDict) + len(parameters.listDCV) + len(parameters.listPulseV) + len(parameters.listSinV) + len(parameters.listE) + index - 1
WriteString = WriteString + str(MatResult[matAddr,0]) + '\t'
for index in range(len(parameters.listH)):
#V -> Pluse -> SinV -> E -> F -> H -> L
matAddr = len(parameters.NodesDict) + len(parameters.listDCV) + len(parameters.listPulseV) + len(parameters.listSinV) + len(parameters.listE) + len(parameters.listF) + 2 * index - 1
WriteString = WriteString + str(MatResult[matAddr,0]) + '\t'
for index in range(len(parameters.listL)):
#V -> Pluse -> SinV -> E -> F -> H -> L
matAddr = len(parameters.NodesDict) + len(parameters.listDCV) + len(parameters.listPulseV) + len(parameters.listSinV) + len(parameters.listE) + len(parameters.listF) + 2 * len(parameters.listH) + index - 1
WriteString = WriteString + str(MatResult[matAddr,0]) + '\t'
for resistor in parameters.listR:
port1 = parameters.NodesDict.get(resistor.port1)
port2 = parameters.NodesDict.get(resistor.port2)
Rvalue = string2num(resistor.value)
if (port1 != 0) & (port2 != 0):
R_V = MatResult[port1-1,0] - MatResult[port2-1,0]
elif (port1 == 0) & (port2 != 0):
R_V = -1 * MatResult[port2-1,0]
elif (port1 != 0) & (port2 == 0):
R_V = MatResult[port1-1,0]
else:
R_V = 0
WriteString = WriteString + str(R_V / Rvalue) + '\t'
for diode in parameters.listD:
port1 = parameters.NodesDict.get(diode.port1)
port2 = parameters.NodesDict.get(diode.port2)
if (port1 != 0) & (port2 != 0):
D_V = MatResult[port1-1,0] - MatResult[port2-1,0]
elif (port1 == 0) & (port2 != 0):
D_V = -1 * MatResult[port2-1,0]
elif (port1 != 0) & (port2 == 0):
D_V = MatResult[port1-1,0]
else:
D_V = 0
D_I = diode.getI_V(D_V)
WriteString = WriteString + str(D_I) + '\t'
for MosFet in parameters.listM:
pass
for vccs_g in parameters.listG:
ctlNodePos = parameters.NodesDict.get(vccs_g.ctlNodePos)
ctlNodeNeg = parameters.NodesDict.get(vccs_g.ctlNodeNeg)
if (ctlNodePos != 0) & (ctlNodeNeg != 0):
C_V = MatResult[ctlNodePos-1,0] - MatResult[ctlNodeNeg-1,0]
elif (port1 == 0) & (port2 != 0):
C_V = -1 * MatResult[ctlNodeNeg-1,0]
elif (port1 != 0) & (port2 == 0):
C_V = MatResult[ctlNodePos,0]
else:
C_V = 0
vccs_I = vccs_g.getI(C_V)
WriteString = WriteString + str(vccs_I) + '\t'
return WriteString
def DCSimulation():
if len(parameters.listDCParam) == 0:
print("Warning: No DC Simulation Parameter!")
print('')
return
elif len(parameters.listDCParam) == 1:
print('Info: DC Simulation ...')
ParamName = parameters.listDCParam[0].paramName
print("Info: --Param:", ParamName)
StartVal = parameters.listDCParam[0].paramValueStart
StopVal = parameters.listDCParam[0].paramValueStop
StepVal = parameters.listDCParam[0].paramValueStep
#PiontNum = parameters.listDCParam[0].default_PointNum
if ParamName in parameters.ParamDict:
flagParam = True
Value_Param = parameters.ParamDict.get(ParamName) #Store Origin Param Value
else:
parameters.ParamDict[ParamName] = StartVal
flagParam = False
Val_Temp = StartVal #Sweep Temp
NodeNum = len(parameters.NodesDict) - 1 # Nodes but GND
branchnum = len(parameters.listDCV) + len(parameters.listPulseV) + len(parameters.listSinV) + len(parameters.listE) + len(parameters.listF) + 2 * len(parameters.listH) + len(parameters.listL)
#V -> Pluse -> SinV -> E -> F -> H -> L
MatNum = NodeNum + branchnum
MatStamps = np.mat(np.zeros((MatNum,MatNum)))
MatRhs = np.mat(np.zeros((MatNum,1)))
MatResult = np.mat(np.zeros((MatNum,1)))
fileResult = open(parameters.NetlistPath+'.dc','w')
fileResult.write('*\tDC Result\n')
WriteString = getOutTitleDC()
fileResult.write(WriteString + '\n')
#for index in range(NodeNum): #No Load I of Voltage Source
# MatResult[index,0] = parameters.opValue[index]
InitFlag = True
while Val_Temp <= StopVal:
print(Val_Temp)
parameters.ParamDict[ParamName] = Val_Temp
if (len(parameters.listD) != 0) | (len(parameters.listM) != 0): #Unlinear Diode Devices
if (len(parameters.listD)!=0):
MarkPort = parameters.NodesDict.get(parameters.listD[0].port1)
elif len(parameters.listM) != 0:
MarkPort = parameters.NodesDict.get(parameters.listM[0].portD)
else:
print("Error: Logic Error!") #Wouldn't Here
exit()
lastVMarkPort = 1.8 #No Mater
VMarkPort = 0.9
while abs(VMarkPort - lastVMarkPort) > 0.01:
MatStamps = np.mat(np.zeros((MatNum,MatNum)))
MatRhs = np.mat(np.zeros((MatNum,1)))
for elem in parameters.listR: #Load R
elem.loadMatResistor()
for keyPoint in elem.StampMatDict:
MatStamps[keyPoint.pointX,keyPoint.pointY] += elem.StampMatDict.get(keyPoint)
for elem in parameters.listD: #load D
port1 = parameters.NodesDict.get(elem.port1)
port2 = parameters.NodesDict.get(elem.port2)
if (port1 != 0) & (port2 != 0):
ResultVd_temp = MatResult[port1-1,0] - MatResult[port2-1,0]
elif port1 == 0:
ResultVd_temp = -1 * MatResult[port2-1,0]
elif port2 == 0:
ResultVd_temp = MatResult[port1-1,0]
else:
ResultVd_temp = 0
elem.loadMatDiode(ResultVd_temp)
for keyPoint in elem.StampMatDict:
MatStamps[keyPoint.pointX,keyPoint.pointY] += elem.StampMatDict.get(keyPoint)
for keyPoint in elem.RHSMatDict:
MatRhs[keyPoint.pointX,keyPoint.pointY] += elem.RHSMatDict.get(keyPoint)
for elem in range(len(parameters.listE)): #Load E
#V -> Pluse -> SinV -> E -> F -> H -> L
matAddr = len(parameters.NodesDict) + len(parameters.listDCV) + len(parameters.listPulseV) + len(parameters.listSinV) + elem - 1
parameters.listE[elem].loadMatE(matAddr)
for keyPoint in parameters.listE[elem].matStampsE:
MatStamps[keyPoint.pointX,keyPoint.pointY] = parameters.listE[elem].matStampsE.get(keyPoint)
for elem in range(len(parameters.listF)): #loadF
#V -> Pluse -> SinV -> E -> F -> H -> L
portCtlPos = parameters.NodesDict.get(parameters.listF[elem].ctlNodePos)
portCtlNeg = parameters.NodesDict.get(parameters.listF[elem].ctlNodePos)
matAddr = len(parameters.NodesDict) + len(parameters.listDCV) + len(parameters.listPulseV) + len(parameters.listSinV) + len(parameters.listE) + elem - 1
Vctl = MatResult[portCtlPos-1] - MatResult[portCtlNeg-1]
parameters.listF[elem].loadMatF(matAddr,Vctl)
for keyPoint in parameters.listF[elem].matStampsF:
MatStamps[keyPoint.pointX,keyPoint.pointY] = parameters.listF[elem].matStampsF.get(keyPoint)
for keyPoint in parameters.listF[elem].matStampsF:
MatRhs[keyPoint.pointX,keyPoint.pointY] = parameters.listF[elem].matRhsF.get(keyPoint)
for elem in parameters.listG: #loadG
elem.loadMatG()
for keyPoint in elem.matStampsG:
MatStamps[keyPoint.pointX,keyPoint.pointY] += elem.matStampsG.get(keyPoint)
for elem in range(len(parameters.listH)): #load H
#V -> Pluse -> SinV -> E -> F -> H -> L
matAddr = len(parameters.NodesDict) + len(parameters.listDCV) + len(parameters.listPulseV) + len(parameters.listSinV) + len(parameters.listE) + len(parameters.listF) + 2 * elem - 1
portCtlPos = parameters.NodesDict.get(parameters.listH[elem].ctlNodePos)
portCtlNeg = parameters.NodesDict.get(parameters.listH[elem].ctlNodePos)
Vctl = MatResult[portCtlPos-1] - MatResult[portCtlNeg-1]
parameters.listH[elem].loadMatH(matAddr,Vctl)
MatRhs[matAddr+1] = string2num(parameters.listH[elem].transResValue)
for keyPoint in parameters.listH[elem].matStampsH:
MatStamps[keyPoint.pointX,keyPoint.pointY] = parameters.listH[elem].matStampsH.get(keyPoint)
for elem in parameters.listDCI: #load DC Is
elem.loadMatDCIs()
for keyPoint in elem.RHSMatDict:
MatRhs[keyPoint.pointX,keyPoint.pointY] += elem.RHSMatDict.get(keyPoint)
for elem in range(len(parameters.listDCV)): #load DC Vs
#V -> Pluse -> SinV -> E -> F -> H -> L
VsDC = parameters.listDCV[elem]
matAddr = len(parameters.NodesDict) + elem - 1
portPos = parameters.NodesDict.get(VsDC.portPos)
portNeg = parameters.NodesDict.get(VsDC.portNeg)
DCV_Value = string2num(VsDC.value)
MatRhs[matAddr,0] = DCV_Value
if portPos != 0:
MatStamps[matAddr,portPos-1] = 1
MatStamps[portPos-1,matAddr] = 1
if portNeg != 0:
MatStamps[matAddr,portNeg-1] = -1
MatStamps[portNeg-1,matAddr] = -1
for elem in range(len(parameters.listPulseV)): #load DC Pluse
#V -> Pluse -> SinV -> E -> F -> H -> L
VsPluseDC = parameters.listPulseV[elem]
matAddr = len(parameters.NodesDict) + len(parameters.listDCV) + elem - 1
portPos = parameters.NodesDict.get(VsPluseDC.portPos)
portNeg = parameters.NodesDict.get(VsPluseDC.portNeg)
Pluse_DCValue = VsPluseDC.getVoltage(0)
MatRhs[matAddr,0] = Pluse_DCValue
if portPos != 0:
MatStamps[matAddr,portPos-1] = 1
MatStamps[portPos-1,matAddr] = 1
if portNeg != 0:
MatStamps[matAddr,portNeg-1] = -1
MatStamps[portNeg-1,matAddr] = -1
for elem in range(len(parameters.listSinV)): #load DC sin Vs
#V -> Pluse -> SinV -> E -> F -> H -> L
VsSinDC = parameters.listSinV[elem]
matAddr = len(parameters.NodesDict) + len(parameters.listDCV) + len(parameters.listPulseV) + elem - 1
portPos = parameters.NodesDict.get(VsSinDC.portPos)
portNeg = parameters.NodesDict.get(VsSinDC.portNeg)
Sin_DcValue = VsSinDC.getValue(0)
MatRhs[matAddr,0] = Sin_DcValue
if portPos != 0:
MatStamps[matAddr,portPos-1] = 1
MatStamps[portPos-1,matAddr] = 1
if portNeg != 0:
MatStamps[matAddr,portNeg-1] = -1
MatStamps[portNeg-1,matAddr] = -1
for elem in range(len(parameters.listL)): #Load L in DC simulation
LTemp = parameters.listL[elem]
#V -> Pluse -> SinV -> E -> F -> H -> L
matAddr = len(parameters.NodesDict) + len(parameters.listDCV) + len(parameters.listPulseV) + len(parameters.listSinV) + len(parameters.listE) + len(parameters.listF) + 2 * len(parameters.listH) + elem - 1
portPos = parameters.NodesDict.get(LTemp.port1)
portNeg = parameters.NodesDict.get(LTemp,port2)
if portPos != 0:
MatStamps[matAddr,portPos-1] = 1
MatStamps[portPos-1,matAddr] = 1
if portNeg != 0:
MatStamps[matAddr,portNeg-1] = -1
MatStamps[portNeg-1,matAddr] = -1
for elem in parameters.listM:
portD = parameters.NodesDict.get(elem.portD)
portG = parameters.NodesDict.get(elem.portG)
portS = parameters.NodesDict.get(elem.portS)
portB = parameters.NodesDict.get(elem.portB)
if portD == 0:
Vd = 0
else:
Vd = MatResult[portD-1,0]
if portG == 0:
Vg = 0
else:
Vg = MatResult[portG-1,0]
if portS == 0:
Vs = 0
else:
Vs = MatResult[portS-1,0]
if portB == 0:
pass
#Vb = 0
else:
pass
#Vb = MatResult[portB-1,0]
Vds = Vd - Vs
if(elem.MosType == 'pmos'):
if Vd > Vs:
Vgs = Vg-Vd
else:
Vgs = Vg-Vs
elif(elem.MosType == 'nmos'):
if Vd < Vs:
Vgs = Vg-Vd
else:
Vgs = Vg-Vs
if(InitFlag):
if(elem.MosType == 'pmos'):
#Vds = -1.3
Vgs = -1.3
elif (elem.MosType == 'nmos'):
#Vds = 0.6
Vgs = 0.5
else:
pass
Ids = elem.getIds(vgs=Vgs,vds=Vds)
Gm = elem.getGm(vds=Vds,vgs=Vgs)
Gds = elem.getGds(vds=Vds,vgs=Vgs)
if portD != 0:
MatRhs[portD-1,0] -= Ids
MatStamps[portD-1,portD-1] += Gds
if portS != 0:
MatRhs[portS-1,0] += Ids
MatStamps[portS-1,portS-1] += (Gds + Gm)
if (portD!=0) & (portS!=0):
MatStamps[portD-1,portS-1] -= (Gds + Gm)
MatStamps[portS-1,portD-1] -= Gds
if (portD!=0) & (portG!=0):
MatStamps[portD-1,portG-1] += Gm
if (portS!=0) & (portG!=0):
MatStamps[portS-1,portG-1] -= Gm
InitFlag = False
MatResult = np.linalg.solve(MatStamps,MatRhs) #Result
lastVMarkPort = VMarkPort
VMarkPort = MatResult[MarkPort-1,0]
else:
MatStamps = np.mat(np.zeros((MatNum,MatNum)))
MatRhs = np.mat(np.zeros((MatNum,1)))
for elem in parameters.listR: #Load R
elem.loadMatResistor()
for keyPoint in elem.StampMatDict:
MatStamps[keyPoint.pointX,keyPoint.pointY] += elem.StampMatDict.get(keyPoint)
for elem in range(len(parameters.listE)): #Load E
#V -> Pluse -> SinV -> E -> F -> H -> L
matAddr = len(parameters.NodesDict) + len(parameters.listDCV) + len(parameters.listPulseV) + len(parameters.listSinV) + elem - 1
parameters.listE[elem].loadMatE(matAddr)
for keyPoint in parameters.listE[elem].matStampsE:
MatStamps[keyPoint.pointX,keyPoint.pointY] = parameters.listE[elem].matStampsE.get(keyPoint)
for elem in range(len(parameters.listF)): #loadF
#V -> Pluse -> SinV -> E -> F -> H -> L
portCtlPos = parameters.NodesDict.get(parameters.listF[elem].ctlNodePos)
portCtlNeg = parameters.NodesDict.get(parameters.listF[elem].ctlNodePos)
matAddr = len(parameters.NodesDict) + len(parameters.listDCV) + len(parameters.listPulseV) + len(parameters.listSinV) + len(parameters.listE) + elem - 1
Vctl = MatResult[portCtlPos-1] - MatResult[portCtlNeg-1]
parameters.listF[elem].loadMatF(matAddr,Vctl)
for keyPoint in parameters.listF[elem].matStampsF:
MatStamps[keyPoint.pointX,keyPoint.pointY] = parameters.listF[elem].matStampsF.get(keyPoint)
for keyPoint in parameters.listF[elem].matStampsF:
MatRhs[keyPoint.pointX,keyPoint.pointY] = parameters.listF[elem].matRhsF.get(keyPoint)
for elem in parameters.listG: #loadG
elem.loadMatG()
for keyPoint in elem.matStampsG:
MatStamps[keyPoint.pointX,keyPoint.pointY] += elem.matStampsG.get(keyPoint)
for elem in range(len(parameters.listH)): #load H
#V -> Pluse -> SinV -> E -> F -> H -> L
matAddr = len(parameters.NodesDict) + len(parameters.listDCV) + len(parameters.listPulseV) + len(parameters.listSinV) + len(parameters.listE) + len(parameters.listF) + 2 * elem - 1
portCtlPos = parameters.NodesDict.get(parameters.listH[elem].ctlNodePos)
portCtlNeg = parameters.NodesDict.get(parameters.listH[elem].ctlNodePos)
Vctl = MatResult[portCtlPos-1] - MatResult[portCtlNeg-1]
parameters.listH[elem].loadMatH(matAddr,Vctl)
MatRhs[matAddr+1] = string2num(parameters.listH[elem].transResValue)
for keyPoint in parameters.listH[elem].matStampsH:
MatStamps[keyPoint.pointX,keyPoint.pointY] = parameters.listH[elem].matStampsH.get(keyPoint)
for elem in parameters.listDCI: #load DC Is
elem.loadMatDCIs()
for keyPoint in elem.RHSMatDict:
MatRhs[keyPoint.pointX,keyPoint.pointY] += elem.RHSMatDict.get(keyPoint)
for elem in range(len(parameters.listDCV)): #load DC Vs
#V -> Pluse -> SinV -> E -> F -> H -> L
VsDC = parameters.listDCV[elem]
matAddr = len(parameters.NodesDict) + elem - 1
portPos = parameters.NodesDict.get(VsDC.portPos)
portNeg = parameters.NodesDict.get(VsDC.portNeg)
DCV_Value = string2num(VsDC.value)
MatRhs[matAddr,0] = DCV_Value
if portPos != 0:
MatStamps[matAddr,portPos-1] = 1
MatStamps[portPos-1,matAddr] = 1
if portNeg != 0:
MatStamps[matAddr,portNeg-1] = -1
MatStamps[portNeg-1,matAddr] = -1
for elem in range(len(parameters.listPulseV)): #load DC Pluse
#V -> Pluse -> SinV -> E -> F -> H -> L
VsPluseDC = parameters.listPulseV[elem]
matAddr = len(parameters.NodesDict) + len(parameters.listDCV) + elem - 1
portPos = parameters.NodesDict.get(VsPluseDC.portPos)
portNeg = parameters.NodesDict.get(VsPluseDC.portNeg)
Pluse_DCValue = VsPluseDC.getVoltage(0)
MatRhs[matAddr,0] = Pluse_DCValue
if portPos != 0:
MatStamps[matAddr,portPos-1] = 1
MatStamps[portPos-1,matAddr] = 1
if portNeg != 0:
MatStamps[matAddr,portNeg-1] = -1
MatStamps[portNeg-1,matAddr] = -1
for elem in range(len(parameters.listSinV)): #load DC sin Vs
#V -> Pluse -> SinV -> E -> F -> H -> L
VsSinDC = parameters.listSinV[elem]
matAddr = len(parameters.NodesDict) + len(parameters.listDCV) + len(parameters.listPulseV) + elem - 1
portPos = parameters.NodesDict.get(VsSinDC.portPos)
portNeg = parameters.NodesDict.get(VsSinDC.portNeg)
Sin_DcValue = VsSinDC.getValue(0)
MatRhs[matAddr,0] = Sin_DcValue
if portPos != 0:
MatStamps[matAddr,portPos-1] = 1
MatStamps[portPos-1,matAddr] = 1
if portNeg != 0:
MatStamps[matAddr,portNeg-1] = -1
MatStamps[portNeg-1,matAddr] = -1
for elem in range(len(parameters.listL)): #Load L in DC simulation
LTemp = parameters.listL[elem]
#V -> Pluse -> SinV -> E -> F -> H -> L
matAddr = len(parameters.NodesDict) + len(parameters.listDCV) + len(parameters.listPulseV) + len(parameters.listSinV) + len(parameters.listE) + len(parameters.listF) + 2 * len(parameters.listH) + elem - 1
portPos = parameters.NodesDict.get(LTemp.port1)
portNeg = parameters.NodesDict.get(LTemp.port2)
if portPos != 0:
MatStamps[matAddr,portPos-1] = 1
MatStamps[portPos-1,matAddr] = 1
if portNeg != 0:
MatStamps[matAddr,portNeg-1] = -1
MatStamps[portNeg-1,matAddr] = -1
MatResult = np.linalg.solve(MatStamps,MatRhs) #Result
WriteString = str(Val_Temp) + '\t'
WriteString = WriteString + getOutDataDC(MatResult)
fileResult.write(WriteString + '\n')
Val_Temp = Val_Temp + StepVal
if flagParam:
parameters.ParamDict[ParamName] = Value_Param
fileResult.close()
print('Info: End DC Simulation ...')
elif len(parameters.listDCParam) == 2:
print("Info: SWEEP:",parameters.listDCParam[0].paramName,parameters.listDCParam[1].paramName)
else:
print("Error: Error Expression of DC Simulation" )
showinfo('DC','DC Simulation End!')
| 48.176672
| 228
| 0.492505
| 2,635
| 28,087
| 5.225806
| 0.080076
| 0.114234
| 0.062309
| 0.018373
| 0.768555
| 0.732898
| 0.716485
| 0.709223
| 0.703268
| 0.703268
| 0
| 0.020227
| 0.403283
| 28,087
| 582
| 229
| 48.25945
| 0.801372
| 0.052729
| 0
| 0.584541
| 0
| 0
| 0.011497
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.007246
| false
| 0.012077
| 0.009662
| 0
| 0.024155
| 0.021739
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 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
| 5
|
df227861def510f0f5f06f374d8f1e4544483d6a
| 44
|
py
|
Python
|
redistrib/exceptions.py
|
sunyi00/redis-trib.py
|
6b25af25d691b7578cc4c683c044905401b3e870
|
[
"MIT"
] | null | null | null |
redistrib/exceptions.py
|
sunyi00/redis-trib.py
|
6b25af25d691b7578cc4c683c044905401b3e870
|
[
"MIT"
] | null | null | null |
redistrib/exceptions.py
|
sunyi00/redis-trib.py
|
6b25af25d691b7578cc4c683c044905401b3e870
|
[
"MIT"
] | 1
|
2018-09-27T09:52:53.000Z
|
2018-09-27T09:52:53.000Z
|
class RedisStatusError(Exception):
pass
| 14.666667
| 34
| 0.772727
| 4
| 44
| 8.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.159091
| 44
| 2
| 35
| 22
| 0.918919
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
df2cb546e59d1e0f0b0e034c6d5c8d0552eb31b0
| 148
|
py
|
Python
|
FATS/__init__.py
|
cridonoso/FATS-slim
|
a79429d87bb74f430bcbf72a5b3cf1bfb12908c1
|
[
"MIT"
] | 68
|
2015-07-08T06:39:53.000Z
|
2022-03-31T16:34:16.000Z
|
FATS/__init__.py
|
cridonoso/FATS-slim
|
a79429d87bb74f430bcbf72a5b3cf1bfb12908c1
|
[
"MIT"
] | 7
|
2017-04-01T04:03:57.000Z
|
2020-02-27T02:50:21.000Z
|
FATS/__init__.py
|
cridonoso/FATS-slim
|
a79429d87bb74f430bcbf72a5b3cf1bfb12908c1
|
[
"MIT"
] | 45
|
2015-08-06T20:11:05.000Z
|
2022-03-31T16:34:26.000Z
|
from .import_lightcurve import ReadLC_MACHO
from .Feature import FeatureSpace
from .alignLC import Align_LC
from .PreprocessLC import Preprocess_LC
| 29.6
| 43
| 0.864865
| 20
| 148
| 6.2
| 0.6
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.108108
| 148
| 4
| 44
| 37
| 0.939394
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
df30c65c005e4996721841cf4d4cd23814b2376e
| 7,843
|
py
|
Python
|
tools/include_tracer.py
|
nagineni/chromium-crosswalk
|
5725642f1c67d0f97e8613ec1c3e8107ab53fdf8
|
[
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2
|
2015-03-04T02:36:53.000Z
|
2016-06-25T11:22:17.000Z
|
tools/include_tracer.py
|
j4ckfrost/android_external_chromium_org
|
a1a3dad8b08d1fcf6b6b36c267158ed63217c780
|
[
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null |
tools/include_tracer.py
|
j4ckfrost/android_external_chromium_org
|
a1a3dad8b08d1fcf6b6b36c267158ed63217c780
|
[
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 4
|
2015-02-09T08:49:30.000Z
|
2017-08-26T02:03:34.000Z
|
#!/usr/bin/env python
# Copyright (c) 2011 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.
# based on an almost identical script by: jyrki@google.com (Jyrki Alakuijala)
"""Prints out include dependencies in chrome.
Since it ignores defines, it gives just a rough estimation of file size.
Usage:
tools/include_tracer.py chrome/browser/ui/browser.h
"""
import os
import sys
# Created by copying the command line for prerender_browsertest.cc, replacing
# spaces with newlines, and dropping everything except -F and -I switches.
# TODO(port): Add windows, linux directories.
INCLUDE_PATHS = [
'',
'gpu',
'skia/config',
'skia/ext',
'testing/gmock/include',
'testing/gtest/include',
'third_party/GTM',
'third_party/WebKit/Source',
'third_party/WebKit/Source/wtf',
'third_party/WebKit/Source/core',
'third_party/WebKit/Source/core/accessibility',
'third_party/WebKit/Source/core/accessibility/chromium',
'third_party/WebKit/Source/core/bindings',
'third_party/WebKit/Source/core/bindings/generic',
'third_party/WebKit/Source/core/bindings/v8',
'third_party/WebKit/Source/core/bindings/v8/custom',
'third_party/WebKit/Source/core/bindings/v8/specialization',
'third_party/WebKit/Source/core/bridge',
'third_party/WebKit/Source/core/bridge/jni',
'third_party/WebKit/Source/core/bridge/jni/v8',
'third_party/WebKit/Source/core/css',
'third_party/WebKit/Source/core/dom',
'third_party/WebKit/Source/core/dom/default',
'third_party/WebKit/Source/core/editing',
'third_party/WebKit/Source/core/fileapi',
'third_party/WebKit/Source/core/history',
'third_party/WebKit/Source/core/html',
'third_party/WebKit/Source/core/html/canvas',
'third_party/WebKit/Source/core/html/parser',
'third_party/WebKit/Source/core/html/shadow',
'third_party/WebKit/Source/core/inspector',
'third_party/WebKit/Source/core/loader',
'third_party/WebKit/Source/core/loader/appcache',
'third_party/WebKit/Source/core/loader/archive',
'third_party/WebKit/Source/core/loader/cache',
'third_party/WebKit/Source/core/loader/icon',
'third_party/WebKit/Source/core/mathml',
'third_party/WebKit/Source/core/notifications',
'third_party/WebKit/Source/core/page',
'third_party/WebKit/Source/core/page/animation',
'third_party/WebKit/Source/core/page/chromium',
'third_party/WebKit/Source/core/platform',
'third_party/WebKit/Source/core/platform/animation',
'third_party/WebKit/Source/core/platform/audio',
'third_party/WebKit/Source/core/platform/audio/chromium',
'third_party/WebKit/Source/core/platform/audio/mac',
'third_party/WebKit/Source/core/platform/chromium',
'third_party/WebKit/Source/core/platform/cocoa',
'third_party/WebKit/Source/core/platform/graphics',
'third_party/WebKit/Source/core/platform/graphics/cg',
'third_party/WebKit/Source/core/platform/graphics/chromium',
'third_party/WebKit/Source/core/platform/graphics/cocoa',
'third_party/WebKit/Source/core/platform/graphics/filters',
'third_party/WebKit/Source/core/platform/graphics/gpu',
'third_party/WebKit/Source/core/platform/graphics/mac',
'third_party/WebKit/Source/core/platform/graphics/opentype',
'third_party/WebKit/Source/core/platform/graphics/skia',
'third_party/WebKit/Source/core/platform/graphics/transforms',
'third_party/WebKit/Source/core/platform/image-decoders',
'third_party/WebKit/Source/core/platform/image-decoders/bmp',
'third_party/WebKit/Source/core/platform/image-decoders/gif',
'third_party/WebKit/Source/core/platform/image-decoders/ico',
'third_party/WebKit/Source/core/platform/image-decoders/jpeg',
'third_party/WebKit/Source/core/platform/image-decoders/png',
'third_party/WebKit/Source/core/platform/image-decoders/skia',
'third_party/WebKit/Source/core/platform/image-decoders/webp',
'third_party/WebKit/Source/core/platform/image-decoders/xbm',
'third_party/WebKit/Source/core/platform/image-encoders/skia',
'third_party/WebKit/Source/core/platform/mac',
'third_party/WebKit/Source/core/platform/mock',
'third_party/WebKit/Source/core/platform/network',
'third_party/WebKit/Source/core/platform/network/chromium',
'third_party/WebKit/Source/core/platform/sql',
'third_party/WebKit/Source/core/platform/text',
'third_party/WebKit/Source/core/platform/text/mac',
'third_party/WebKit/Source/core/platform/text/transcoder',
'third_party/WebKit/Source/core/plugins',
'third_party/WebKit/Source/core/plugins/chromium',
'third_party/WebKit/Source/core/rendering',
'third_party/WebKit/Source/core/rendering/style',
'third_party/WebKit/Source/core/rendering/svg',
'third_party/WebKit/Source/core/storage',
'third_party/WebKit/Source/core/storage/chromium',
'third_party/WebKit/Source/core/svg',
'third_party/WebKit/Source/core/svg/animation',
'third_party/WebKit/Source/core/svg/graphics',
'third_party/WebKit/Source/core/svg/graphics/filters',
'third_party/WebKit/Source/core/svg/properties',
'third_party/WebKit/Source/core/webaudio',
'third_party/WebKit/Source/core/websockets',
'third_party/WebKit/Source/core/workers',
'third_party/WebKit/Source/core/xml',
'third_party/WebKit/Source/public',
'third_party/WebKit/Source/web',
'third_party/cld',
'third_party/icu/public/common',
'third_party/icu/public/i18n',
'third_party/npapi',
'third_party/npapi/bindings',
'third_party/protobuf',
'third_party/protobuf/src',
'third_party/skia/gpu/include',
'third_party/skia/include/config',
'third_party/skia/include/core',
'third_party/skia/include/effects',
'third_party/skia/include/gpu',
'third_party/skia/include/pdf',
'third_party/skia/include/ports',
'v8/include',
'xcodebuild/Debug/include',
'xcodebuild/DerivedSources/Debug/chrome',
'xcodebuild/DerivedSources/Debug/policy',
'xcodebuild/DerivedSources/Debug/protoc_out',
'xcodebuild/DerivedSources/Debug/webkit',
'xcodebuild/DerivedSources/Debug/webkit/bindings',
]
def Walk(seen, filename, parent, indent):
"""Returns the size of |filename| plus the size of all files included by
|filename| and prints the include tree of |filename| to stdout. Every file
is visited at most once.
"""
total_bytes = 0
# .proto(devel) filename translation
if filename.endswith('.pb.h'):
basename = filename[:-5]
if os.path.exists(basename + '.proto'):
filename = basename + '.proto'
else:
print 'could not find ', filename
# Show and count files only once.
if filename in seen:
return total_bytes
seen.add(filename)
# Display the paths.
print ' ' * indent + filename
# Skip system includes.
if filename[0] == '<':
return total_bytes
# Find file in all include paths.
resolved_filename = filename
for root in INCLUDE_PATHS + [os.path.dirname(parent)]:
if os.path.exists(os.path.join(root, filename)):
resolved_filename = os.path.join(root, filename)
break
# Recurse.
if os.path.exists(resolved_filename):
lines = open(resolved_filename).readlines()
else:
print ' ' * (indent + 2) + "-- not found"
lines = []
for line in lines:
line = line.strip()
if line.startswith('#include "'):
total_bytes += Walk(
seen, line.split('"')[1], resolved_filename, indent + 2)
elif line.startswith('#include '):
include = '<' + line.split('<')[1].split('>')[0] + '>'
total_bytes += Walk(
seen, include, resolved_filename, indent + 2)
elif line.startswith('import '):
total_bytes += Walk(
seen, line.split('"')[1], resolved_filename, indent + 2)
return total_bytes + len("".join(lines))
def main():
bytes = Walk(set(), sys.argv[1], '', 0)
print
print float(bytes) / (1 << 20), "megabytes of chrome source"
if __name__ == '__main__':
sys.exit(main())
| 38.635468
| 77
| 0.740405
| 1,061
| 7,843
| 5.351555
| 0.235627
| 0.179641
| 0.245157
| 0.337091
| 0.576964
| 0.518845
| 0.339204
| 0.109017
| 0.017964
| 0.017964
| 0
| 0.003873
| 0.111182
| 7,843
| 202
| 78
| 38.826733
| 0.810644
| 0.076246
| 0
| 0.055556
| 0
| 0
| 0.689248
| 0.658362
| 0
| 0
| 0
| 0.004951
| 0
| 0
| null | null | 0
| 0.018519
| null | null | 0.030864
| 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
| 1
| 1
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
df5093399be491b1e4faa393720b9b653870b11a
| 91
|
py
|
Python
|
powerspot/__init__.py
|
theolamayo/spotify-scripts
|
d464e7ab631d1dd46957396d4a8802fe8482bbca
|
[
"MIT"
] | 1
|
2020-11-23T22:45:50.000Z
|
2020-11-23T22:45:50.000Z
|
powerspot/__init__.py
|
theolamayo/spotify-scripts
|
d464e7ab631d1dd46957396d4a8802fe8482bbca
|
[
"MIT"
] | null | null | null |
powerspot/__init__.py
|
theolamayo/spotify-scripts
|
d464e7ab631d1dd46957396d4a8802fe8482bbca
|
[
"MIT"
] | null | null | null |
from . import io, operations, ui
__version__ = "0.2"
__all__ = ["io", "operations", "ui"]
| 18.2
| 36
| 0.637363
| 12
| 91
| 4.166667
| 0.75
| 0.48
| 0.56
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.026316
| 0.164835
| 91
| 4
| 37
| 22.75
| 0.631579
| 0
| 0
| 0
| 0
| 0
| 0.186813
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 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
| 5
|
df66ab464b13a513e66e9302a7958b1b756ed3c8
| 1,627
|
py
|
Python
|
src/spotify/migrations/0002_auto_20210413_1733.py
|
rryanburton/kwmgt
|
0e8f9657d48ed5b9021d6316caa55c982f9e2800
|
[
"MIT"
] | null | null | null |
src/spotify/migrations/0002_auto_20210413_1733.py
|
rryanburton/kwmgt
|
0e8f9657d48ed5b9021d6316caa55c982f9e2800
|
[
"MIT"
] | null | null | null |
src/spotify/migrations/0002_auto_20210413_1733.py
|
rryanburton/kwmgt
|
0e8f9657d48ed5b9021d6316caa55c982f9e2800
|
[
"MIT"
] | null | null | null |
# Generated by Django 3.2 on 2021-04-13 17:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('spotify', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='artist',
name='external_urls',
field=models.URLField(null=True),
),
migrations.AlterField(
model_name='artist',
name='followers',
field=models.IntegerField(null=True),
),
migrations.AlterField(
model_name='artist',
name='genres',
field=models.CharField(max_length=255, null=True),
),
migrations.AlterField(
model_name='artist',
name='href',
field=models.URLField(null=True),
),
migrations.AlterField(
model_name='artist',
name='images',
field=models.JSONField(null=True),
),
migrations.AlterField(
model_name='artist',
name='popularity',
field=models.IntegerField(null=True),
),
migrations.AlterField(
model_name='artist',
name='spotify_id',
field=models.IntegerField(null=True),
),
migrations.AlterField(
model_name='artist',
name='type',
field=models.CharField(max_length=255, null=True),
),
migrations.AlterField(
model_name='artist',
name='uri',
field=models.CharField(max_length=255, null=True),
),
]
| 27.576271
| 62
| 0.531039
| 145
| 1,627
| 5.855172
| 0.324138
| 0.212014
| 0.265018
| 0.30742
| 0.737338
| 0.737338
| 0.691402
| 0.691402
| 0.588928
| 0.588928
| 0
| 0.025544
| 0.350338
| 1,627
| 58
| 63
| 28.051724
| 0.777673
| 0.026429
| 0
| 0.673077
| 1
| 0
| 0.087231
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.019231
| 0
| 0.076923
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
df753d701a9c63bb526e1e2a53b201e6a617af51
| 334
|
py
|
Python
|
server/app/services/devices/views/__init__.py
|
goodfree/ActorCloud
|
e8db470830ea6f6f208ad43c2e56a2e8976bc468
|
[
"Apache-2.0"
] | 173
|
2019-06-10T07:14:49.000Z
|
2022-03-31T08:42:36.000Z
|
server/app/services/devices/views/__init__.py
|
zlyz12345/ActorCloud
|
9c34b371c23464981323ef9865d9913bde1fe09c
|
[
"Apache-2.0"
] | 27
|
2019-06-12T08:25:29.000Z
|
2022-02-26T11:37:15.000Z
|
server/app/services/devices/views/__init__.py
|
zlyz12345/ActorCloud
|
9c34b371c23464981323ef9865d9913bde1fe09c
|
[
"Apache-2.0"
] | 67
|
2019-06-10T08:40:05.000Z
|
2022-03-09T03:43:56.000Z
|
from flask import Blueprint
bp = Blueprint('devices', __name__)
from . import emqx # noqa: E402
from . import devices # noqa: E402
from . import select_options # noqa: E402
from . import groups # noqa: E402
from . import security # noqa: E402
__all__ = [
'bp', 'emqx', 'devices', 'groups', 'security', 'select_options'
]
| 20.875
| 67
| 0.679641
| 42
| 334
| 5.166667
| 0.357143
| 0.230415
| 0.221198
| 0.331797
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.05597
| 0.197605
| 334
| 15
| 68
| 22.266667
| 0.753731
| 0.161677
| 0
| 0
| 0
| 0
| 0.175182
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.6
| 0
| 0.6
| 0.2
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
df7fa36afb82dd6a775f3e50e8df92a47b653553
| 236
|
py
|
Python
|
googlesearchpy/utils.py
|
meads2/googlesearch
|
63e6a5afd7f7956a78de5b1543489acbd5de428a
|
[
"MIT"
] | null | null | null |
googlesearchpy/utils.py
|
meads2/googlesearch
|
63e6a5afd7f7956a78de5b1543489acbd5de428a
|
[
"MIT"
] | null | null | null |
googlesearchpy/utils.py
|
meads2/googlesearch
|
63e6a5afd7f7956a78de5b1543489acbd5de428a
|
[
"MIT"
] | null | null | null |
import pandas
from uuid import uuid4
import requests
import boto3
def download_file(file_url):
'''
'''
pass
def upload_file(file, dest):
'''
'''
pass
def create_file_name(filename):
'''
'''
pass
| 10.727273
| 31
| 0.597458
| 28
| 236
| 4.857143
| 0.607143
| 0.117647
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.011834
| 0.283898
| 236
| 21
| 32
| 11.238095
| 0.792899
| 0
| 0
| 0.3
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.3
| false
| 0.3
| 0.4
| 0
| 0.7
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 1
| 0
| 1
| 0
|
0
| 5
|
df86d5c6b4b089e29b6cb8ffc873290fe6e91206
| 184
|
py
|
Python
|
script/idp_testdrv.py
|
skanct/pysaml2
|
0c1e26a6dd8759962857a30ebd67f63fe9e881ee
|
[
"Apache-2.0"
] | 249
|
2018-03-01T09:47:04.000Z
|
2022-03-26T04:51:26.000Z
|
desktop/core/ext-py/pysaml2-4.4.0/script/idp_testdrv.py
|
zks888/hue
|
93a8c370713e70b216c428caa2f75185ef809deb
|
[
"Apache-2.0"
] | 416
|
2018-02-21T15:18:35.000Z
|
2022-03-04T16:59:36.000Z
|
desktop/core/ext-py/pysaml2-4.4.0/script/idp_testdrv.py
|
zks888/hue
|
93a8c370713e70b216c428caa2f75185ef809deb
|
[
"Apache-2.0"
] | 203
|
2018-02-21T13:53:12.000Z
|
2022-03-08T22:22:17.000Z
|
#!/usr/bin/env python
__author__ = 'rohe0002'
#from idp_test import saml2base
from idp_test import SAML2client
from idp_test.check import factory
cli = SAML2client(factory)
cli.run()
| 20.444444
| 34
| 0.793478
| 27
| 184
| 5.148148
| 0.592593
| 0.151079
| 0.23741
| 0.244604
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.04321
| 0.119565
| 184
| 9
| 35
| 20.444444
| 0.814815
| 0.271739
| 0
| 0
| 0
| 0
| 0.06015
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.4
| 0
| 0.4
| 0
| 1
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
df95e33af5973f76af473d1aa018e47f13e911d4
| 4,930
|
py
|
Python
|
src/ctc/rpc/rpc_executors_async/rpc_state_executors_async.py
|
fei-protocol/checkthechain
|
ec838f3d0d44af228f45394d9ba8d8eb7f677520
|
[
"MIT"
] | 94
|
2022-02-15T19:34:49.000Z
|
2022-03-26T19:26:22.000Z
|
src/ctc/rpc/rpc_executors_async/rpc_state_executors_async.py
|
fei-protocol/checkthechain
|
ec838f3d0d44af228f45394d9ba8d8eb7f677520
|
[
"MIT"
] | 7
|
2022-03-03T02:58:47.000Z
|
2022-03-11T18:41:05.000Z
|
src/ctc/rpc/rpc_executors_async/rpc_state_executors_async.py
|
fei-protocol/checkthechain
|
ec838f3d0d44af228f45394d9ba8d8eb7f677520
|
[
"MIT"
] | 7
|
2022-02-15T17:53:07.000Z
|
2022-03-17T19:14:17.000Z
|
from __future__ import annotations
import typing
from ctc import evm
from ctc import spec
from .. import rpc_constructors
from .. import rpc_digestors
from .. import rpc_request
async def async_eth_call(
to_address: spec.Address,
from_address: spec.BinaryData | None = None,
gas: spec.BinaryData | None = None,
gas_price: spec.BinaryData | None = None,
value_sent: spec.BinaryData | None = None,
block_number: spec.BlockNumberReference | None = None,
call_data: spec.BinaryData | None = None,
function_parameters: typing.Sequence[typing.Any]
| typing.Mapping[str, typing.Any]
| None = None,
function_abi: spec.FunctionABI | None = None,
provider: spec.ProviderSpec = None,
decode_response: bool = True,
delist_single_outputs: bool = True,
package_named_outputs: bool = False,
fill_empty: bool = False,
empty_token: typing.Any = None,
**function_abi_query: typing.Any,
) -> spec.RpcSingularResponse:
if function_abi is None:
if call_data is None or decode_response:
function_abi = await evm.async_get_function_abi(
contract_address=to_address, **function_abi_query
)
# construct request
request = rpc_constructors.construct_eth_call(
to_address=to_address,
from_address=from_address,
gas=gas,
gas_price=gas_price,
value_sent=value_sent,
block_number=block_number,
call_data=call_data,
function_parameters=function_parameters,
function_abi=function_abi,
)
# make request
response = await rpc_request.async_send(request, provider=provider)
# digest response
return rpc_digestors.digest_eth_call(
response,
function_abi=function_abi,
decode_response=decode_response,
delist_single_outputs=delist_single_outputs,
package_named_outputs=package_named_outputs,
fill_empty=fill_empty,
empty_token=empty_token,
)
async def async_eth_estimate_gas(
to_address: spec.Address,
from_address: spec.BinaryData | None = None,
gas: spec.BinaryData | None = None,
gas_price: spec.BinaryData | None = None,
value_sent: spec.BinaryData | None = None,
call_data: spec.BinaryData | None = None,
function_parameters: typing.Sequence[typing.Any]
| typing.Mapping[str, typing.Any]
| None = None,
function_abi: spec.FunctionABI | None = None,
provider: spec.ProviderSpec = None,
decode_response: bool = True,
**function_abi_query: typing.Any,
) -> spec.RpcSingularResponse:
if function_abi is None:
function_abi = await evm.async_get_function_abi(
contract_address=to_address, **function_abi_query
)
request = rpc_constructors.construct_eth_estimate_gas(
to_address=to_address,
from_address=from_address,
gas=gas,
gas_price=gas_price,
value_sent=value_sent,
call_data=call_data,
function_parameters=function_parameters,
function_abi=function_abi,
)
response = await rpc_request.async_send(request, provider=provider)
return rpc_digestors.digest_eth_estimate_gas(
response,
decode_response=decode_response,
)
async def async_eth_get_balance(
address: spec.Address,
block_number: spec.BlockNumberReference | None = None,
provider: spec.ProviderSpec = None,
decode_response: bool = True,
) -> spec.RpcSingularResponse:
if block_number is None:
block_number = 'latest'
request = rpc_constructors.construct_eth_get_balance(
address=address,
block_number=block_number,
)
response = await rpc_request.async_send(request, provider=provider)
return rpc_digestors.digest_eth_get_balance(
response,
decode_response=decode_response,
)
async def async_eth_get_storage_at(
address: spec.Address,
position: spec.BinaryData,
block_number: spec.BlockNumberReference | None = None,
provider: spec.ProviderSpec = None,
) -> spec.RpcSingularResponse:
if block_number is None:
block_number = 'latest'
request = rpc_constructors.construct_eth_get_storage_at(
address=address,
position=position,
block_number=block_number,
)
response = await rpc_request.async_send(request, provider=provider)
return rpc_digestors.digest_eth_get_storage_at(response)
async def async_eth_get_code(
address: spec.Address,
block_number: spec.BlockNumberReference | None = None,
provider: spec.ProviderSpec = None,
) -> spec.RpcSingularResponse:
if block_number is None:
block_number = 'latest'
request = rpc_constructors.construct_eth_get_code(
address=address,
block_number=block_number,
)
response = await rpc_request.async_send(request, provider=provider)
return rpc_digestors.digest_eth_get_code(response)
| 31.806452
| 71
| 0.704665
| 585
| 4,930
| 5.622222
| 0.121368
| 0.043782
| 0.054728
| 0.06689
| 0.799331
| 0.753116
| 0.734266
| 0.734266
| 0.734266
| 0.717543
| 0
| 0
| 0.218256
| 4,930
| 154
| 72
| 32.012987
| 0.853399
| 0.009331
| 0
| 0.674242
| 0
| 0
| 0.003689
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.05303
| 0
| 0.090909
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 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
| 5
|
10f0ab8a942c51c67acca8df3fafde0f77b99972
| 86,336
|
py
|
Python
|
ChatBot/chatbot_search/chatbot_sentence_vec_by_bert.py
|
joleo/nlp_xiaojiang
|
6de490e1e6ef3213b288f447f0a222c2a16dd77b
|
[
"MIT"
] | null | null | null |
ChatBot/chatbot_search/chatbot_sentence_vec_by_bert.py
|
joleo/nlp_xiaojiang
|
6de490e1e6ef3213b288f447f0a222c2a16dd77b
|
[
"MIT"
] | null | null | null |
ChatBot/chatbot_search/chatbot_sentence_vec_by_bert.py
|
joleo/nlp_xiaojiang
|
6de490e1e6ef3213b288f447f0a222c2a16dd77b
|
[
"MIT"
] | 2
|
2021-01-18T10:07:20.000Z
|
2022-01-12T10:09:47.000Z
|
# -*- coding: UTF-8 -*-
# !/usr/bin/python
# @time :2019/5/12 13:16
# @author :Mo
# @function :chatbot based search, encode sentence_vec by bert
def chatbot_sentence_vec_by_bert_own():
"""bert encode is writted by my own"""
from FeatureProject.bert.extract_keras_bert_feature import KerasBertVector
from conf.path_config import chicken_and_gossip_path
from utils.text_tools import txtRead
import numpy as np
# 读取数据和一些参数,这里只取了100个标准问题
topk = 5
matrix_ques_save_path = "doc_vecs_chicken_and_gossip"
questions = txtRead(chicken_and_gossip_path, encodeType='utf-8')
ques = [ques.split('\t')[0] for ques in questions][0:100]
# 生成标准问题的bert句向量
bert_vector = KerasBertVector()
ques_basic_vecs = bert_vector.bert_encode(ques)
# 线上你可以生成,直接调用,然后直接load就好
np.savetxt(matrix_ques_save_path, ques_basic_vecs)
# matrix_ques = np.loadtxt(matrix_ques_save_path)
query_bert_vec = bert_vector.bert_encode(["小姜机器人是什么"])[0]
query_bert_vec = np.array(query_bert_vec)
print(query_bert_vec)
# 矩阵点乘,很快的,你也可以用annoy等工具,计算就更加快了
qq_score = np.sum(query_bert_vec * ques_basic_vecs, axis=1) / np.linalg.norm(ques_basic_vecs, axis=1)
topk_idx = np.argsort(qq_score)[::-1][:topk]
for idx in topk_idx:
print('小姜机器人回答检索: %s\t%s' % (qq_score[idx], questions[idx]))
while True:
print("你的问题:")
query = input()
query_bert_vec = bert_vector.bert_encode([query])[0]
query_bert_vec = np.array(query_bert_vec)
# 矩阵点乘,很快的,你也可以用annoy等工具,计算就更加快了
qq_score = np.sum(query_bert_vec * ques_basic_vecs, axis=1) / np.linalg.norm(ques_basic_vecs, axis=1)
topk_idx = np.argsort(qq_score)[::-1][:topk]
for idx in topk_idx:
print('小姜机器人回答检索: %s\t%s' % (qq_score[idx], questions[idx]))
def chatbot_sentence_vec_by_bert_bertasserver():
"""bert encode is used bert as server"""
from conf.path_config import chicken_and_gossip_path
from bert_serving.client import BertClient
from utils.text_tools import txtRead
import numpy as np
topk = 5
matrix_ques_save_path = "doc_vecs_chicken_and_gossip"
questions = txtRead(chicken_and_gossip_path, encodeType='utf-8')
ques = [ques.split('\t')[0] for ques in questions][0:100]
bc = BertClient(ip = 'localhost')
doc_vecs = bc.encode(ques)
np.savetxt(matrix_ques_save_path, doc_vecs)
# matrix_ques = np.loadtxt(matrix_ques_save_path)
while True:
query = input('你问: ')
query_vec = bc.encode([query])[0]
query_bert_vec = np.array(query_bert_vec)
# compute normalized dot product as score
score = np.sum(query_vec * doc_vecs, axis=1) / np.linalg.norm(doc_vecs, axis=1)
topk_idx = np.argsort(score)[::-1][:topk]
for idx in topk_idx:
print('小姜机器人回答: %s\t%s' % (score[idx], questions[idx]))
if __name__=="__main__":
chatbot_sentence_vec_by_bert_own()
# chatbot_sentence_vec_by_bert_bertasserver()
# result
# 小姜机器人是什么
# Tokens: ['[CLS]', '小', '姜', '机', '器', '人', '是', '什', '么', '[SEP]']
# (1, 32, 768)
# [CLS] [768] [1.0393640995025635, -0.31394684314727783, -0.08567211031913757, -0.12281288206577301, 0.5685704946517944, -0.6734460592269897, 0.3936116099357605, -0.14657911658287048, -0.5451663732528687, 0.8552711009979248, -0.3694000840187073, -0.0018898732960224152, -0.005383625626564026, 0.15833452343940735, 2.392857074737549, -1.370668649673462, 0.9063063263893127, -1.142601490020752, -0.3274427652359009, -0.0483686625957489, -0.3603387475013733, 0.3079147934913635, -1.9008374214172363, -0.3452332615852356, 0.2769089639186859, 0.36075833439826965, -0.6220439672470093, -0.37962478399276733, -0.22173452377319336, 0.23706544935703278, -0.35481616854667664, 0.08377914130687714, 0.07834005355834961, 0.01608183979988098, 0.5389248728752136, -0.05104628950357437, -0.0463351309299469, 0.6286687850952148, 0.5550581812858582, 0.29511526226997375, -0.18117117881774902, -0.8892947435379028, 0.35202541947364807, 2.5349209308624268, 0.2730821371078491, -0.5735995769500732, 0.5421597957611084, -0.12932351231575012, -0.1580323725938797, 0.9569751024246216, -0.5882872343063354, 13.529970169067383, 2.0034232139587402, 0.6951251029968262, -0.5622572898864746, -0.1711845099925995, 0.2610630393028259, 0.28804582357406616, 0.5975360870361328, -0.3334871530532837, 0.17786279320716858, -1.4801167249679565, 0.31919431686401367, 1.429368257522583, 0.5202251076698303, -0.6386469602584839, 0.7738403081893921, -0.797601580619812, -1.7268284559249878, 0.17042164504528046, -0.2284141182899475, 0.24068456888198853, 1.0906034708023071, 0.46066683530807495, -0.22198253870010376, 1.173426628112793, -0.6383375525474548, 0.3471369743347168, 0.3537029027938843, 0.29926207661628723, 1.0131189823150635, -0.13712811470031738, -1.8245162963867188, 0.11569234728813171, -0.8640097975730896, -0.1749742031097412, -0.011555582284927368, -2.962400197982788, -0.11627554893493652, 0.24945443868637085, -0.3100139796733856, -0.8704608082771301, 0.032162562012672424, 0.6128078699111938, -1.1174049377441406, -0.44977766275405884, 0.17657610774040222, 0.4162853956222534, 0.6937737464904785, -2.9513731002807617, 0.38357841968536377, 1.7391315698623657, 0.5794513821601868, -0.38206565380096436, -1.0564782619476318, 0.14102795720100403, 0.31357455253601074, -0.2747744619846344, -0.3244108557701111, -0.4872910976409912, -0.7251763343811035, -0.3837529718875885, 0.24528835713863373, 0.6830307841300964, -0.1088501513004303, 0.12314638495445251, -0.24819502234458923, 1.0839656591415405, -2.670776128768921, 0.5944135189056396, 0.3986028730869293, -0.05877089500427246, -0.7175740003585815, -0.4379426836967468, -0.19564220309257507, -0.7169078588485718, 0.0030374452471733093, 1.0794694423675537, -0.11942365765571594, -0.6889951825141907, 1.95603609085083, 0.11340025067329407, 0.4678863286972046, -0.6270723342895508, 2.311574935913086, -0.8113616108894348, -0.3659091591835022, -0.6428304314613342, -0.9594523310661316, 0.23884108662605286, -1.3684000968933105, -0.690689206123352, -0.00838884711265564, 0.39292675256729126, 2.119372844696045, 0.04040103405714035, -0.11456340551376343, 0.015392228960990906, 1.2311854362487793, -0.046399034559726715, -1.3781243562698364, 0.5994658470153809, 0.4316205382347107, 0.044444456696510315, 0.5325354337692261, -1.1179237365722656, -0.024991288781166077, -0.4842575490474701, -0.654776930809021, -0.03246501088142395, -0.21410058438777924, 0.8774051666259766, -0.7459532618522644, -0.25158822536468506, -0.041556134819984436, -1.3501412868499756, -0.38786593079566956, 0.5247678756713867, -0.08411864936351776, 0.9078837037086487, 0.06668921560049057, 1.3836820125579834, 0.14796993136405945, 0.7352832555770874, -0.26403743028640747, -1.382176160812378, 0.17314867675304413, -0.6145512461662292, -0.7105323076248169, -0.639667272567749, -0.1825159788131714, 0.1757025420665741, -0.06639575958251953, 1.0266070365905762, -0.04459512233734131, -0.942766547203064, 0.35117611289024353, -0.09589405357837677, 0.15646091103553772, -0.2489067018032074, -0.4757929742336273, 1.4963650703430176, -3.8375892639160156, -1.125215768814087, 0.11426828801631927, 0.7319279909133911, -0.4793435037136078, -0.08055523037910461, -0.6498105525970459, 1.330226182937622, -0.767677903175354, -1.0113219022750854, -0.1875268816947937, -0.7547234296798706, -0.7324925661087036, 0.8555399179458618, -0.22023382782936096, 0.08166798949241638, 0.42404651641845703, 0.4217571020126343, -0.08496545255184174, -0.4639720320701599, -0.08549687266349792, 0.11486810445785522, 0.014650970697402954, 0.928145170211792, 1.7324540615081787, 0.35004931688308716, -0.23908495903015137, -1.1047712564468384, 0.06631737947463989, 0.6066029071807861, 0.5651320815086365, -0.686876118183136, -0.4084278643131256, 0.041524410247802734, -0.32491180300712585, 0.7272577285766602, -0.2967689335346222, -0.39164304733276367, 0.7326894402503967, -1.037513017654419, -0.2947050631046295, -0.5900390148162842, -0.45508116483688354, 0.06542198359966278, 0.34646064043045044, 0.7848807573318481, 0.8663140535354614, 0.15388602018356323, 0.01518973708152771, -0.5112730264663696, -0.9820221066474915, -0.265686571598053, -0.11338577419519424, 1.0446759462356567, 0.22747312486171722, 0.41790157556533813, -0.846001923084259, -0.3298998177051544, -0.5850996971130371, 0.685137927532196, -0.44857412576675415, -1.6691421270370483, 0.30494070053100586, 0.285444051027298, 1.2830568552017212, 0.42796385288238525, 0.32015544176101685, -0.5118119120597839, 0.5177421569824219, -0.5582244396209717, 0.4734779894351959, 0.3841489255428314, -0.08896642178297043, 0.41101324558258057, 3.302192211151123, -1.6114025115966797, 1.2247281074523926, 0.2591051161289215, -0.5630861520767212, 0.1482764482498169, 0.6570146083831787, 0.7148151993751526, -1.8664922714233398, -0.42903560400009155, 0.4595433175563812, 1.0260326862335205, 1.0998669862747192, -0.7587367296218872, 0.10187511146068573, -0.17247571051120758, 0.1842833310365677, -0.24146747589111328, 0.8463143110275269, -0.04841041564941406, 0.3939945697784424, 1.11798894405365, 0.3030907213687897, 0.20580124855041504, -0.8673887848854065, 0.6875064969062805, -0.0949491560459137, 1.151665449142456, 3.44063663482666, -0.01811183989048004, 0.6953613758087158, 0.23410934209823608, 0.8601164221763611, 0.9806221723556519, -0.3090303838253021, -0.04875170439481735, 0.3547508418560028, 0.8266265392303467, -0.5158435106277466, -0.2203104943037033, -0.6994569301605225, -0.8490405678749084, -1.1711769104003906, 0.05271817743778229, 0.9057762622833252, 0.7658257484436035, 0.050104737281799316, 0.23512278497219086, 0.7854899168014526, -0.8049912452697754, -0.6358420848846436, -0.8687168955802917, -1.037772297859192, -0.48705893754959106, -0.872538685798645, -0.3925281763076782, 0.5900484919548035, 1.308942198753357, 0.4550360441207886, -0.3307679295539856, 1.3428549766540527, -0.6910381317138672, 0.5195334553718567, 0.2417294681072235, 0.4292243421077728, 0.33380672335624695, 0.29642874002456665, -0.3568708896636963, 1.0596129894256592, -0.023354679346084595, -0.021873511373996735, 0.4691203534603119, 0.9936549663543701, -0.5132080316543579, 0.9309756755828857, -0.0435909777879715, 0.5513582229614258, 0.002806425094604492, 0.3143504858016968, -0.03220248222351074, 0.409281849861145, 0.1891966611146927, 0.12097416818141937, -1.3350553512573242, -1.332608699798584, -0.8775850534439087, -0.9554033875465393, 0.21868500113487244, -1.358860731124878, 1.634242057800293, 0.3185383975505829, 0.7157171368598938, 0.9095699191093445, 0.2764788866043091, -0.3132152259349823, 1.0906206369400024, -0.5535367727279663, -1.963536262512207, 0.445904016494751, 0.29366517066955566, 0.8938524127006531, 0.2094426453113556, 0.6533538103103638, -0.8820308446884155, -0.1885322630405426, 0.32854872941970825, 0.05052271485328674, -0.8957158923149109, -0.1259736865758896, 0.0614781454205513, -0.24110767245292664, 0.5958307981491089, 1.0880773067474365, -0.8448076248168945, -0.18200814723968506, 0.025652602314949036, -0.11371709406375885, -4.2636823654174805, 0.49037042260169983, -0.5793126225471497, 0.1286333054304123, -0.9713305830955505, 0.994056761264801, -0.9629271626472473, -1.0090351104736328, 0.8683590888977051, -0.5173664689064026, -1.7113308906555176, 0.7225280404090881, 1.294363021850586, 0.07891878485679626, -0.43197184801101685, 0.10857413709163666, -1.0328291654586792, -1.2394520044326782, 0.5970273613929749, 1.6733423471450806, -0.5601459741592407, -0.3178316652774811, -1.5754461288452148, 0.9935235977172852, 0.06740419566631317, 1.4791171550750732, -0.9345505237579346, -0.37930238246917725, 0.331820547580719, 0.4014897346496582, -0.48881232738494873, 0.9590104818344116, 0.5023470520973206, -0.047364383935928345, -0.7771788835525513, 0.6445488929748535, -0.6611612439155579, 0.42583486437797546, 0.6640713214874268, -2.4451019763946533, -0.4446567893028259, 0.5402612686157227, -1.5619834661483765, 0.11103729903697968, 0.0720236673951149, -1.0298588275909424, 1.2613070011138916, 0.268846333026886, 0.02242356166243553, -0.2912015914916992, 0.8465366363525391, -0.12878191471099854, 0.23823276162147522, -0.7912580966949463, 0.16552583873271942, 0.07682719826698303, 0.03596639633178711, 0.618706464767456, -0.8725828528404236, -0.3766016364097595, 1.0806834697723389, 1.6137094497680664, 1.6948652267456055, -0.22753238677978516, 0.27712753415107727, -0.6496586203575134, -0.21981775760650635, 0.4522777199745178, -0.39081862568855286, -1.029226303100586, -0.10414773225784302, -0.441707044839859, 0.2414306104183197, -1.2284561395645142, 1.0406458377838135, -1.74244225025177, 1.6481366157531738, 0.6732252836227417, 0.2150914967060089, 0.2031371295452118, 0.7108206152915955, 0.5635879039764404, -0.27661967277526855, -0.26785752177238464, -0.8063616156578064, -0.20705486834049225, 0.19609194993972778, -1.1310937404632568, 0.02918866276741028, 0.18111339211463928, 0.06118643283843994, 0.09755441546440125, -0.45386162400245667, -0.3440943658351898, -0.32668066024780273, -1.0928459167480469, -1.6380661725997925, 0.7102787494659424, -1.0305511951446533, 3.45426344871521, -0.801641583442688, 1.1312146186828613, 0.5013564825057983, -0.5230643153190613, 0.03315015882253647, 0.5032712817192078, -0.18282905220985413, -0.2527451813220978, 0.19830437004566193, 0.0075774528086185455, -0.767789900302887, -0.32297444343566895, 1.0229229927062988, 1.1790592670440674, -0.6858135461807251, 0.6466878652572632, 0.7030930519104004, -0.9260056018829346, -0.2493380308151245, 0.8735028505325317, -0.9988552927970886, 0.02605525031685829, 0.3044910430908203, -0.7436833381652832, -0.21889753639698029, -1.1034619808197021, -0.3591030240058899, 0.6111456155776978, 0.20647627115249634, 0.41164830327033997, -0.8840419054031372, 0.7064993381500244, 0.014509528875350952, -0.9978616237640381, 0.6833433508872986, 0.04416200518608093, 0.1324133574962616, -1.4808411598205566, 0.33116796612739563, 0.5300851464271545, 0.2695471942424774, -0.33054542541503906, -1.08912992477417, 0.3626489043235779, 0.7452893257141113, 0.7855616211891174, -1.454584002494812, 0.2830025553703308, -0.386371910572052, 0.8680127859115601, 0.233538419008255, -0.3539624512195587, 0.8915678262710571, 1.222000002861023, -0.5467571020126343, 1.1761376857757568, 0.4659765660762787, -0.10240273922681808, -0.03351156413555145, 0.26345545053482056, -0.5977382659912109, -0.15899759531021118, -0.4679335057735443, 0.4362480342388153, -0.42562708258628845, -0.7765315771102905, 1.6063389778137207, -0.8840594291687012, 0.9212234616279602, -0.2891073524951935, 0.6556053161621094, -0.5731973648071289, 0.8649685978889465, -1.0068089962005615, -0.18250180780887604, 0.9943163394927979, -0.249552384018898, 0.039320044219493866, 0.015799522399902344, 0.028559613972902298, -0.7696949243545532, -0.465707927942276, -0.1004343181848526, 0.4241652190685272, 0.29238563776016235, 0.9280701875686646, 0.2562389373779297, -0.19587364792823792, -0.17729049921035767, 0.05121392756700516, 0.7580090761184692, 0.7032148838043213, 0.6007342338562012, -0.6270080804824829, 0.9129643440246582, 0.9650322198867798, -0.6352081298828125, 1.1712051630020142, -0.05241229385137558, -0.45325982570648193, -1.0782016515731812, 0.2945493161678314, 0.10578308254480362, -0.26966118812561035, 0.04102446138858795, 0.21919354796409607, 0.29471659660339355, 1.3061431646347046, 0.21855583786964417, 0.15574893355369568, -0.6430723667144775, -0.2278270721435547, -0.18983396887779236, 0.2648279070854187, 0.2687186598777771, -0.09910212457180023, 0.5761136412620544, -1.3666666746139526, 0.1032581776380539, 0.7485387921333313, 0.18967989087104797, 2.07381010055542, -0.0387326180934906, 0.31854432821273804, -0.10957591235637665, -0.30754852294921875, 0.628326952457428, 0.0721748024225235, 0.05150926113128662, 0.12249238789081573, 0.5481188297271729, 0.3588549792766571, 0.8573632836341858, 0.583362877368927, -0.5162450075149536, -0.172942653298378, 0.02463555335998535, 0.11570310592651367, -1.5428348779678345, -0.334606409072876, 0.4399941563606262, 0.882591187953949, 1.3096742630004883, 0.5482164621353149, -0.7562257647514343, -0.045211270451545715, 0.42973145842552185, -0.4527057707309723, 0.5613487958908081, -0.14321856200695038, -0.4149778485298157, 1.1518337726593018, 0.03796003758907318, 0.29475265741348267, 0.4785069227218628, 1.0851726531982422, -1.7377843856811523, -0.11898565292358398, -0.10768938809633255, -0.5555472373962402, 0.17503120005130768, 0.4201439619064331, -1.028656005859375, -0.4962877035140991, -0.20779645442962646, 1.2763292789459229, -0.6626241207122803, 0.8296007513999939, 0.9012804627418518, 0.6043409109115601, 0.7111780643463135, 0.2796786427497864, -0.9860675930976868, 1.3089534044265747, -0.848642885684967, 0.5607987642288208, -0.8372105956077576, 0.28760939836502075, 0.058021873235702515, 1.7119874954223633, 0.9443587064743042, -0.2684830129146576, 0.30822402238845825, -0.6166646480560303, -0.3013598620891571, -0.13814030587673187, -1.1712441444396973, 0.7591502666473389, -0.2750362753868103, 0.6327939629554749, -0.6151797771453857, -1.2511980533599854, 1.45670747756958, -0.19959114491939545, -0.5005579590797424, -0.23995110392570496, -0.10842227935791016, -0.32417210936546326, -1.1563670635223389, 0.5998862385749817, 0.12111502885818481, -0.3829588294029236, -0.6028792858123779, -0.4440579414367676, -0.9685969948768616, 0.4051600396633148, 0.8104796409606934, -0.1489437371492386, 1.079170823097229, 0.4430067539215088, -0.6646348237991333, -1.74846613407135, -1.4558192491531372, -0.14752602577209473, 1.316192388534546, 0.22136107087135315, -0.5012724995613098, -0.12234920263290405, 0.3419454097747803, 0.1581020951271057, -1.1394883394241333, -1.4092646837234497, -0.9180330038070679, -0.09290523827075958, 0.8365627527236938, -0.854001522064209, 0.5521027445793152, -0.55048668384552, -0.5067843198776245, -0.3464510142803192, -0.8704931139945984, -0.7632593512535095, 1.6639128923416138, -0.7172688245773315, -1.737605094909668, -0.07170195877552032, 0.4930247366428375, 1.5721981525421143, -0.6016665697097778, 0.464435875415802, 0.7904404997825623, -0.6348875761032104, -0.3038531243801117, -0.3362879157066345, -0.31530946493148804, 0.14910349249839783, -1.417451024055481, -0.4710491895675659, -1.0826337337493896, 0.5495731830596924, 1.895046591758728, 0.20535409450531006, 0.9173596501350403, 3.357970714569092, 0.13453897833824158, -0.07278941571712494, -0.27837032079696655, 0.13945752382278442, 0.48070669174194336, -1.9531567096710205, 0.4830702841281891, -0.6365683078765869, 0.5758416652679443, 0.3910081684589386, 0.0015049055218696594, 0.8636984825134277, -0.24023380875587463, -0.9468706846237183, -0.5880921483039856, 1.885053277015686, -0.19099147617816925, -1.1987566947937012, -0.8956226706504822, -0.5463157296180725, -1.2801237106323242, -0.19831085205078125, 0.14944887161254883, 0.4946858584880829, -0.4049077033996582, 0.3898269534111023, -0.38325101137161255, 0.2377244234085083, 0.2654089033603668, 0.4208860993385315, 0.4263348877429962]
# 小 [768] [0.7013989090919495, -0.40084660053253174, -0.3503463864326477, -0.28014230728149414, 0.24524623155593872, -1.4014935493469238, -0.48182061314582825, 0.7045496702194214, -0.7937867641448975, 0.9948133230209351, 0.27720558643341064, -0.4045335054397583, 0.6907503604888916, 1.2042298316955566, 0.4897122383117676, -0.5221295952796936, 0.2876770496368408, 0.11579891294240952, 0.7904666662216187, 0.5078139305114746, 0.16494320333003998, -0.18098613619804382, -1.733884334564209, 0.17450891435146332, -0.09746397286653519, 0.5122889280319214, 0.019689559936523438, 0.41357332468032837, 0.5941380262374878, -0.00970509648323059, 0.03642579913139343, 0.48857560753822327, -0.07429119944572449, -0.18101593852043152, 1.028360366821289, -0.21736660599708557, -0.2383638322353363, 0.20419947803020477, 0.31829702854156494, -0.3149590492248535, -0.2510703206062317, 0.2534271478652954, 0.14567868411540985, 0.2319338172674179, 0.3649413585662842, 0.1805674433708191, -0.5328909158706665, 0.5089345574378967, 0.02326032519340515, 0.5185285806655884, -0.03602488338947296, 13.23004150390625, 0.31943079829216003, 0.31819868087768555, -0.5628607869148254, -0.34770768880844116, -0.3704322576522827, 0.733135461807251, 0.39142081141471863, -0.07821756601333618, 0.6557053923606873, -1.4232524633407593, 0.1223931536078453, 0.35612303018569946, 0.5520858764648438, -0.14224457740783691, -0.6926642656326294, -0.21290065348148346, -0.727562427520752, 0.2542659044265747, -0.21905115246772766, -0.43252062797546387, 0.15269272029399872, -0.268587201833725, -0.6478168368339539, -0.09649889171123505, 0.10818810760974884, 0.2659958004951477, -0.346390962600708, -0.23846548795700073, 0.7241268157958984, -0.0521911084651947, 0.11241340637207031, 0.04608302190899849, -0.9711634516716003, -0.9330838918685913, 0.17905132472515106, -0.2551179528236389, 0.44264543056488037, -0.4120326638221741, -0.5413451194763184, 0.08398193120956421, -0.395668625831604, 0.9123923182487488, -1.1473755836486816, -0.5696380734443665, 0.8185130953788757, 0.6347101926803589, -0.26726728677749634, -0.182166188955307, 0.12661710381507874, 0.5086371302604675, 0.4014352262020111, 0.10769515484571457, 0.30653589963912964, 0.5972214341163635, -0.21417462825775146, -0.33978620171546936, 0.367564857006073, -0.4109450876712799, -0.8661223649978638, -0.17045378684997559, -0.02865658700466156, 0.14752477407455444, -0.047945618629455566, -0.5561912059783936, -0.05496034398674965, -0.34370046854019165, -1.2060298919677734, -0.06461216509342194, 0.4678424894809723, 0.8913548588752747, -0.33447980880737305, -0.2494858205318451, -0.48272737860679626, -0.4084215760231018, -0.3778826892375946, 0.6545575857162476, 0.5170661211013794, -0.8236882090568542, -0.36036837100982666, -0.46584826707839966, 0.7188559174537659, -0.564550518989563, 0.47952741384506226, -0.3798064589500427, -0.21900220215320587, -0.15563258528709412, -0.08829883486032486, -0.17994266748428345, -0.399281769990921, -0.4733112156391144, -0.21865881979465485, -0.12982884049415588, -0.3553037941455841, -0.308330774307251, 0.43909066915512085, 1.1502102613449097, 1.3080053329467773, 0.4716566205024719, -0.38191860914230347, 0.6847177147865295, 0.033568382263183594, -0.051911868155002594, 0.1490195393562317, 0.03159429877996445, 0.6111795902252197, -0.142357736825943, -0.40086889266967773, -0.0010315850377082825, -0.10361557453870773, -0.6477687954902649, 0.4214332103729248, -0.3108117878437042, -0.7002725005149841, 0.28235751390457153, 0.46478331089019775, -0.2929864525794983, -0.4169715344905853, 0.019363999366760254, -0.9090567827224731, 0.825052797794342, -0.01956877112388611, 0.22363334894180298, 0.10886000841856003, 0.4221210479736328, 0.38689321279525757, 0.8455225825309753, -0.42093002796173096, -0.04850585758686066, -0.04252397641539574, -0.4345197081565857, 0.05996394902467728, 0.763900637626648, 0.0038746967911720276, -0.3794044256210327, -0.11921600997447968, 0.6130219101905823, 0.46403050422668457, -0.07894879579544067, 0.5592401623725891, 0.24492678046226501, -0.7543622255325317, -0.34816864132881165, 0.698305606842041, 0.0386841744184494, -0.9570581912994385, 0.062332551926374435, -0.26435816287994385, 0.7102740406990051, -0.4852522909641266, -0.09100893139839172, -0.017934922128915787, -0.7206844091415405, -0.4539732336997986, -0.20684418082237244, -0.34784215688705444, 0.038087934255599976, 0.2584626078605652, -0.2852102816104889, -0.2957034707069397, 0.172571063041687, 0.7650099396705627, 0.13382618129253387, -0.26045337319374084, 0.9154592752456665, -0.13383787870407104, 0.18402554094791412, -0.2594204545021057, -1.2605700492858887, 0.45659878849983215, -0.7214091420173645, -0.6106175184249878, -0.618371307849884, -0.5539055466651917, 0.204253688454628, -0.5832352638244629, 0.23134346306324005, -0.036675937473773956, 0.7453190088272095, 0.7695425748825073, 0.038111403584480286, 0.3135799467563629, -0.1922348439693451, 0.43151336908340454, -0.4633033275604248, -0.07247912883758545, -0.40591758489608765, 0.19670897722244263, -0.13164451718330383, 0.9334826469421387, 0.49510765075683594, 0.07696268707513809, -0.5143380761146545, -1.6099224090576172, 0.23425889015197754, -0.38530123233795166, -0.33030012249946594, -0.2909112274646759, -0.6540465354919434, 0.7469956278800964, 0.9024442434310913, 0.48356783390045166, -0.9677979946136475, 0.10275474190711975, 0.11695751547813416, 0.8409345149993896, 0.12792854011058807, 0.557050347328186, -0.39183950424194336, 0.1732078492641449, -0.7493748664855957, -0.6757387518882751, -0.07659223675727844, 1.4940180778503418, 0.5874550342559814, 0.7671024799346924, -0.07616135478019714, 0.5489071607589722, -0.5804027318954468, 0.3699231445789337, 0.5327297449111938, 0.3937101364135742, 0.022715523838996887, -0.16108770668506622, -0.08219786733388901, 0.09265700727701187, 0.115011066198349, 0.4041610658168793, -0.5470716953277588, 0.04770117998123169, -0.22883912920951843, 1.200775384902954, -0.13151249289512634, -0.3276633024215698, 0.7200837135314941, 0.13817723095417023, -0.017010703682899475, -0.027614489197731018, -0.5906144380569458, -0.8919573426246643, 0.21873724460601807, 1.1369404792785645, 0.40667790174484253, 1.1117912530899048, -0.9211739301681519, 0.5205991268157959, 0.9117486476898193, 0.7525516748428345, 0.6873624324798584, 0.4240536093711853, 0.4663665294647217, 0.15621080994606018, -0.10126189887523651, 0.5561619400978088, 0.4205675721168518, 0.1232026219367981, 0.19420838356018066, -1.0594499111175537, 0.5230753421783447, 0.9318461418151855, 0.19158662855625153, -0.4610242247581482, 0.5009779930114746, 0.5316307544708252, -0.34674304723739624, -0.1617138683795929, 0.5370383858680725, -0.43992185592651367, 0.20256203413009644, 0.02997240424156189, -0.0922597199678421, -0.3322228193283081, 0.34245797991752625, 0.850525975227356, -0.1465587615966797, 0.24548743665218353, -0.13992448151111603, -0.14334754645824432, 0.8455655574798584, 0.4101276397705078, -1.1193522214889526, -0.5134591460227966, -0.28171223402023315, 0.062105730175971985, 0.3836020827293396, 0.23404258489608765, 0.7916979193687439, 0.9079307317733765, 0.4923971891403198, 0.8419100046157837, 0.21364696323871613, -0.00879448652267456, -1.3459155559539795, 0.4160989820957184, 0.6414791941642761, -0.25458240509033203, -0.9678725600242615, 0.07803598046302795, 0.532265305519104, -1.032174825668335, -0.8008978366851807, 0.25818365812301636, 0.45422857999801636, 0.10435996949672699, 0.6010710597038269, 0.3996149003505707, -0.4052494466304779, -0.24342788755893707, -0.020202085375785828, -1.378513216972351, 0.8588359355926514, -0.7083520293235779, -0.19448798894882202, 0.7699877023696899, 1.1101438999176025, 0.37186047434806824, 0.5183505415916443, -0.27332714200019836, -0.5027561187744141, 0.011202502995729446, -0.16257300972938538, 0.023765668272972107, -1.03634512424469, 0.0903192013502121, 0.3757071793079376, -0.7444166541099548, -0.56452476978302, 0.6637561917304993, -0.20810675621032715, -0.6620482206344604, 0.3807688355445862, -0.188426673412323, -0.5185731649398804, 0.012616433203220367, 0.843212366104126, -0.6210675239562988, -0.368583083152771, 0.5904543399810791, 0.041483815759420395, 0.1319473832845688, 0.4558955729007721, 0.31536367535591125, -0.09041084349155426, -0.2939686179161072, -0.130146786570549, 0.015598520636558533, -0.4862630367279053, 0.8126729130744934, -0.23003238439559937, 0.477424293756485, -0.0026653409004211426, 0.4017375707626343, -0.30640333890914917, -0.004425559192895889, 0.028408244252204895, 0.037062183022499084, -0.23955050110816956, -0.0015135854482650757, -0.059503223747015, -0.532334566116333, -0.03803466260433197, -0.25091272592544556, -0.9855427742004395, -0.6361819505691528, 0.2503422200679779, -0.12640275061130524, 0.037553317844867706, 0.6865237951278687, -0.8517855405807495, -0.2854560911655426, 1.3007742166519165, -0.5460042357444763, 0.3035416603088379, 0.9181758761405945, -0.1839943677186966, 0.5571103692054749, -0.2506279945373535, 0.5457409620285034, -0.4143323302268982, -0.32610371708869934, -1.0012035369873047, 0.5456304550170898, -0.023207880556583405, 0.7866176962852478, -0.6510930061340332, -0.7592753171920776, 0.7738873958587646, -0.36700353026390076, -0.7955207824707031, -0.046416305005550385, 0.33254769444465637, -0.018341518938541412, 0.7954043745994568, -0.23544490337371826, 0.39870473742485046, 0.3792450726032257, 0.22527505457401276, 0.28890448808670044, -0.7078229188919067, -0.7257093191146851, 0.13239535689353943, 1.0463895797729492, -0.13584542274475098, 0.47556230425834656, -0.35191810131073, -0.12912112474441528, 0.21969515085220337, 0.21531306207180023, 0.9988532066345215, 0.2939809262752533, 0.4469587802886963, 0.014175280928611755, 0.09894001483917236, -0.6517905592918396, 0.5256032347679138, 0.34888407588005066, -1.007314682006836, 0.3245511054992676, 0.26118895411491394, -1.8493404388427734, -0.21469832956790924, 0.4657120108604431, 1.3396819829940796, -1.038519024848938, -1.880774736404419, -0.4618298411369324, -1.2982860803604126, -0.6094486117362976, -1.0031119585037231, 0.9920470714569092, -0.17077535390853882, 0.22621417045593262, 0.05883896350860596, 0.4081602096557617, 0.08253012597560883, -0.15396404266357422, 0.2502714991569519, -0.20370781421661377, 0.2616540193557739, 0.08403923362493515, -0.7013542652130127, -0.14421428740024567, -0.45693981647491455, -0.3525978922843933, -0.5601159930229187, 0.1783474087715149, 0.8282248973846436, 0.4572295844554901, -0.21410752832889557, 0.4783684015274048, 0.027490749955177307, 0.8548067212104797, -0.18013355135917664, -1.4634945392608643, 0.33487340807914734, 0.5705845355987549, 0.09640941023826599, -0.10788267850875854, 0.37480711936950684, -0.20644669234752655, 0.1794741302728653, 1.1257156133651733, 0.36446040868759155, -0.28648239374160767, -0.34580379724502563, 0.3310939371585846, -0.4585098326206207, 0.08406198024749756, -0.12571245431900024, -0.3161194920539856, 0.12948490679264069, -0.35604530572891235, -0.08380590379238129, 0.6370394229888916, -0.12649865448474884, -0.0956459492444992, 0.34881895780563354, -0.1346760094165802, 0.857384204864502, 0.5473636984825134, -0.4574007987976074, 0.14326059818267822, -0.23212406039237976, 0.42583584785461426, 0.8198283314704895, 0.24816446006298065, -0.23933032155036926, 0.1003686785697937, 0.2264319360256195, 0.3387030065059662, -1.112030029296875, 1.4895167350769043, -0.6002962589263916, -0.5108840465545654, -0.4652741253376007, 1.313594937324524, -0.025284335017204285, -0.17773808538913727, 1.4705435037612915, -0.03121045231819153, 0.613803505897522, -0.18447597324848175, -0.17536406219005585, -0.10262218117713928, 0.52413010597229, -1.5945324897766113, -0.31809002161026, 0.4200713038444519, 0.015072051435709, 1.3141226768493652, 0.08445565402507782, -0.5116710662841797, -0.008806020021438599, -1.082666039466858, -0.030459925532341003, 0.09646815061569214, -0.3901498317718506, -0.019319377839565277, 1.0195424556732178, -0.045339297503232956, 4.419684410095215e-05, 0.4766201376914978, 0.5062703490257263, 0.27879276871681213, -0.09782207012176514, -1.1144320964813232, -1.3688886165618896, 0.9850181341171265, 0.07102049887180328, -0.1437574326992035, 0.6361362934112549, 0.01855386048555374, -0.7659485340118408, 0.7174509763717651, -0.5383057594299316, -0.053413428366184235, 0.042780108749866486, 0.8338913917541504, 0.4769856333732605, 0.803007960319519, -0.004285082221031189, -0.3993411362171173, 1.1545122861862183, 0.20573067665100098, 1.635200023651123, -0.45596545934677124, 0.02667096257209778, 0.4555508494377136, -0.20769737660884857, -0.7581297159194946, 0.6300312876701355, 0.9054320454597473, -0.21323749423027039, 0.11388175189495087, -0.15106722712516785, 0.05708959698677063, 0.05968587100505829, -0.1927778124809265, 0.6082191467285156, 0.1383221596479416, -0.8484735488891602, 0.3571664094924927, 0.2937043607234955, 0.3412974178791046, -0.39616382122039795, 0.520408034324646, 0.040460437536239624, -0.7541270852088928, 0.12263599038124084, 0.07682596147060394, -0.6082082986831665, -0.45474720001220703, -0.6831029057502747, -0.09843950718641281, -0.10778579115867615, 1.1649143695831299, -0.8092693090438843, 0.2953748404979706, 0.5294805765151978, 0.09302978217601776, -0.41970163583755493, -0.046343252062797546, 0.2442377656698227, 0.5653333067893982, 0.6693557500839233, 0.3377127945423126, -0.4521883726119995, 0.4263923466205597, -0.279693067073822, 0.29103052616119385, 0.4549216032028198, 0.0519997738301754, -0.272079735994339, -0.797416090965271, 0.10753251612186432, 0.0003309398889541626, -0.649528980255127, 0.8334336280822754, 0.47911524772644043, -0.26202392578125, -1.118293285369873, -0.4296376407146454, 0.6655025482177734, 0.5039054155349731, 0.2555999755859375, 1.1827120780944824, -0.7343178987503052, -0.5360293984413147, -0.9152728915214539, -0.13695895671844482, -0.4112270474433899, 0.186353862285614, -0.5720657706260681, 0.6172796487808228, -0.26822608709335327, 0.0201239176094532, -0.04355117678642273, -0.3238610625267029, 0.7161229252815247, 0.03687203675508499, -0.2680744230747223, 0.33872002363204956, 0.42729777097702026, -0.3692821264266968, 0.19269464910030365, 0.9233946204185486, 0.00443015992641449, -0.17358353734016418, -0.9292057752609253, -0.8872808814048767, -0.5024338960647583, 0.7199664115905762, -0.8556364178657532, 0.15793563425540924, -0.12997938692569733, -1.7492921352386475, 0.03145798295736313, -0.11053497344255447, 0.6892877221107483, -0.15088240802288055, 1.2101361751556396, -0.930793821811676, -0.24474480748176575, -0.6200026869773865, -1.604097604751587, -0.2153247445821762, 0.0729808583855629, 0.12817168235778809, -0.12198908627033234, 0.3810355067253113, 0.26228806376457214, -0.42868056893348694, -0.7406836152076721, 0.14704744517803192, -0.2619759142398834, -1.0258471965789795, -0.26117587089538574, -0.08214855194091797, -0.32731324434280396, -0.06980019062757492, -0.7569618821144104, 1.2414437532424927, -0.2815742492675781, 0.9059455394744873, 0.6587957143783569, 0.7109844088554382, -1.6745747327804565, 0.6290963888168335, 0.02116052806377411, 0.10683228075504303, 0.4530281126499176, 1.0099679231643677, -0.09457001090049744, 0.04982811212539673, -0.21659576892852783, -0.31152164936065674, -0.21511852741241455, -0.004111588001251221, -0.15232539176940918, -1.0348753929138184, -0.8017587065696716, -0.31414666771888733, -0.007066197693347931, 0.4074004888534546, 1.1062926054000854, 0.2123027890920639, -0.4398769736289978, 0.21041011810302734, 1.1827301979064941, 0.4411563575267792, -0.2615290582180023, -1.1874953508377075, 1.3925453424453735, -0.2288007140159607, 0.44675523042678833, -0.5156071186065674, -0.4418421685695648, 0.5494926571846008, 1.4516713619232178, -0.497292160987854, -0.143882617354393, 0.20984265208244324, -0.48577216267585754, 1.0410962104797363, -0.268934428691864, -0.25815314054489136, -0.6215166449546814, -0.3495209217071533, -0.011735036969184875, 0.6202811002731323, -0.3088752031326294, 0.5109761953353882, -0.10180380940437317, 0.4888511300086975, -0.6728417277336121, -0.3615540862083435, -0.5397417545318604]
# 姜 [768] [1.0106569528579712, -0.27137959003448486, 0.09393742680549622, 0.6953784227371216, 0.4734943211078644, -0.6130077242851257, -0.33104902505874634, -0.03615070879459381, -0.28247225284576416, 0.31788867712020874, -0.17650438845157623, -0.06455767899751663, -0.4088568687438965, 0.8131961822509766, -0.09444671869277954, 0.13819551467895508, 0.5051586627960205, -0.3483096957206726, 0.7101518511772156, 0.8226726055145264, -0.5989391803741455, 0.0778450220823288, -0.5069450736045837, 0.43287092447280884, -0.713090181350708, 0.8348826766014099, 0.010615795850753784, -1.064554214477539, -0.3733416199684143, 0.042520999908447266, -0.1731286346912384, -0.3677111268043518, 0.18560880422592163, 0.585864245891571, -0.053779784590005875, 0.13234886527061462, -0.3883933424949646, -0.5801894664764404, -0.45982861518859863, 0.0397505909204483, -0.41735291481018066, -0.018075719475746155, -0.27741631865501404, -0.17461684346199036, 0.6913106441497803, -0.5149487257003784, -0.528899610042572, -0.16717688739299774, 0.8328471183776855, -0.19275212287902832, 0.6121247410774231, 15.560067176818848, -0.051855623722076416, -0.2152201384305954, -0.3032488226890564, -0.35043492913246155, 0.4050554037094116, 0.21610766649246216, -0.7066866755485535, -0.3539537191390991, 1.0224692821502686, -0.7625547647476196, 0.6852949261665344, 0.9509583115577698, 1.0056840181350708, -0.41951441764831543, -0.22968338429927826, 0.5898982286453247, 0.20143015682697296, -0.1084325760602951, -0.21202638745307922, -0.9565489292144775, 0.024526625871658325, -0.9090474843978882, -0.09870332479476929, -0.39533179998397827, -0.23334531486034393, -0.22382520139217377, 1.25403892993927, 0.4754701554775238, -0.574294924736023, -0.5368213057518005, -0.5074710845947266, -0.2482823133468628, -1.1410056352615356, -0.18617479503154755, -0.15582191944122314, -0.7233618497848511, 0.2019628882408142, -0.17693068087100983, -0.30613428354263306, -0.14541751146316528, -0.057204719632864, 0.34010469913482666, -0.5445607304573059, 0.17515310645103455, 0.294074147939682, 0.7048047780990601, -0.4050421118736267, 0.3672322928905487, -0.5460731983184814, -0.9808655381202698, -0.6008406281471252, -0.8742020130157471, -0.23096267879009247, 1.2226409912109375, -0.8112392425537109, 0.442126989364624, -0.22831018269062042, -0.33399927616119385, -0.9376748204231262, -0.3336676061153412, 0.3842361867427826, 1.0054562091827393, 0.2549053132534027, 0.15865494310855865, -0.47453761100769043, 1.1897118091583252, -0.24472254514694214, 0.22657060623168945, 0.15227189660072327, 0.6727102994918823, 0.10422945022583008, -0.17226937413215637, -0.9654797911643982, -0.6647681593894958, 0.06862989068031311, 0.5283148884773254, -0.32867684960365295, -0.0762769877910614, -0.14115110039710999, 0.7530517578125, -0.16991493105888367, 0.7908857464790344, -0.37593936920166016, -0.6043486595153809, 0.6509555578231812, 0.03758719563484192, 0.2655574679374695, -0.318638414144516, 1.0554786920547485, 0.6238742470741272, 0.001530468463897705, 0.5724338293075562, -0.5276020765304565, -0.8272277116775513, -0.29036015272140503, 0.11291992664337158, 0.2716823220252991, 0.791230320930481, -0.4521922767162323, 0.7602934241294861, 0.5997920036315918, -0.03978124260902405, 0.1158510148525238, -0.4664846658706665, 0.1445721536874771, -0.6058518290519714, 0.22610777616500854, -0.060956552624702454, -0.0732792466878891, -0.9117758274078369, -0.6582678556442261, 1.0903699398040771, -0.25631436705589294, -0.19475001096725464, -0.6696800589561462, -0.0774887204170227, -0.47994107007980347, 0.43099698424339294, 0.5291703343391418, 1.3256275653839111, 0.34366950392723083, 0.23323246836662292, -0.46123945713043213, -1.0261671543121338, -1.0175960063934326, -0.14049872756004333, 0.3117375373840332, 0.12183813750743866, 0.24921253323554993, 0.2544766664505005, -0.27326536178588867, 0.7037964463233948, 0.6106562614440918, -0.4055634140968323, -0.09840890765190125, -0.3204032778739929, 0.33774787187576294, 0.07735437154769897, -0.854256272315979, 0.24553927779197693, 0.5348302125930786, -0.29185962677001953, 0.007019050419330597, 0.23220157623291016, 0.3078577518463135, -0.043269187211990356, 0.7260786890983582, 1.0989196300506592, -1.240097165107727, 0.19045642018318176, -0.8118463158607483, -1.0588949918746948, -0.6199281811714172, 0.32201454043388367, -0.211781308054924, -0.6937525272369385, -0.3605771064758301, -0.18622928857803345, -0.5481463670730591, 0.21481657028198242, -0.22832870483398438, 0.4097766876220703, -0.06354185938835144, -0.11515101790428162, -0.16366948187351227, 0.3543333411216736, -0.7168283462524414, -0.5669307112693787, 0.5771821141242981, 0.16646642982959747, 0.12319234013557434, -0.4651942849159241, -0.12520048022270203, 0.38621920347213745, -0.3299334645271301, 0.7876265048980713, 0.06191111356019974, -0.22460293769836426, 0.2500832676887512, -0.3397037386894226, -0.30196836590766907, -0.2406534105539322, 0.3063400387763977, 0.17494268715381622, -0.23449887335300446, -0.2775562107563019, -0.36744192242622375, 0.3241075277328491, -0.07495397329330444, -0.22829465568065643, -0.32646381855010986, -0.27674371004104614, -0.78630530834198, 0.9896001815795898, -0.5452889204025269, -1.0856599807739258, -1.1928751468658447, -1.0764753818511963, -0.11026786267757416, 0.5535271167755127, 0.2613922953605652, -0.6168026328086853, 0.3853183686733246, 0.15042687952518463, 0.1347229778766632, -0.9730783700942993, 0.42061829566955566, 0.2823726534843445, -0.05522940307855606, -1.269803762435913, -0.5731205344200134, -0.5964072346687317, 0.41444823145866394, 0.4502410888671875, 0.2897934913635254, -0.6401699185371399, 0.88671875, -0.22265173494815826, -0.2632809281349182, 0.7611514925956726, 0.0668049305677414, -0.291705459356308, -0.07833287119865417, 0.08969016373157501, -0.4683302938938141, 0.01415378600358963, -0.4915953278541565, -0.14371147751808167, -0.4027441442012787, -0.38698238134384155, 0.8170691728591919, 0.1779346913099289, -0.09561605751514435, 0.08469582349061966, 0.10585039854049683, -0.54559725522995, 0.5544789433479309, 0.1519535481929779, -0.08379606902599335, 0.01159009337425232, -0.04991556704044342, 0.8343212604522705, 0.9706562757492065, 0.08109811693429947, -0.4458504617214203, 0.08370769023895264, -0.07190727442502975, 0.05288213491439819, -0.554484486579895, 0.28568753600120544, 0.16374742984771729, 0.012240249663591385, -0.3731851875782013, -0.3430514335632324, 0.05027439072728157, 0.08784414827823639, 0.39549875259399414, -0.08864952623844147, 1.5751290321350098, -0.15538716316223145, -0.8910859823226929, 0.5350778102874756, 0.2625517249107361, 0.6452372074127197, -0.46887484192848206, 0.719342827796936, 0.9072881937026978, 0.04889947921037674, 0.11087726056575775, -0.14473506808280945, -0.322784423828125, 1.3353960514068604, 0.783949613571167, -0.3649306893348694, 0.16998867690563202, -0.8980803489685059, 0.36550596356391907, 0.01746043562889099, -0.045479290187358856, 0.06671877205371857, 0.2521043121814728, 0.16578473150730133, 0.5967051386833191, -0.21043968200683594, -0.519384503364563, 0.7211219668388367, 0.9290754795074463, -0.3668443560600281, -0.22232991456985474, -0.27287882566452026, 0.04513201117515564, -0.48123136162757874, -0.17931479215621948, 0.6876886487007141, -0.4231555759906769, -0.6000145673751831, -1.0014396905899048, -1.1892211437225342, -0.7147970795631409, 0.018822181969881058, -0.8145707249641418, -0.7688978910446167, 0.01249493658542633, 0.46709030866622925, 0.030754119157791138, 0.7604665756225586, -0.130562424659729, 0.25571608543395996, -0.3427865505218506, 0.4109957814216614, -0.9352792501449585, 0.494087815284729, 0.1351032555103302, 0.3602140247821808, 0.7514642477035522, 0.32587897777557373, 0.2756393253803253, 0.05268260836601257, 0.24442428350448608, -0.8469954133033752, -0.12747587263584137, 0.16464298963546753, -0.2622349262237549, -0.35266026854515076, 0.088682621717453, 0.14014941453933716, -0.8065412044525146, 0.2892509698867798, -0.6629637479782104, 0.038639411330223083, -0.055214449763298035, 0.25294870138168335, 0.9543139934539795, -0.07425785064697266, 0.1010567843914032, -0.9452214241027832, 0.7823441028594971, 0.06072046607732773, -0.08829200267791748, 0.30375805497169495, -0.8104556202888489, -0.4559635818004608, -0.5845915079116821, 1.5339879989624023, 0.6895607709884644, 0.20580518245697021, 0.3766555190086365, 0.7865481376647949, -0.2894113063812256, 0.42650872468948364, -0.7058194279670715, 1.0050302743911743, 1.177198886871338, -0.6446174383163452, 0.5711679458618164, -0.4994161128997803, 0.51649010181427, 0.46689411997795105, -0.3129280209541321, -0.4256724417209625, -0.17255690693855286, -0.1704544872045517, -0.11413444578647614, 0.3417927026748657, 0.43595218658447266, -0.47370052337646484, 0.19455236196517944, -0.07628151774406433, 0.0365319550037384, -0.004407122731208801, 0.12426771968603134, 0.5834029912948608, -0.039054930210113525, -0.5228404998779297, 0.3388969302177429, -0.5134310722351074, 0.16533809900283813, -0.23923102021217346, -0.15396009385585785, 0.041668932884931564, 1.0546163320541382, 1.0269169807434082, 0.17795014381408691, -0.2079671025276184, -0.18525385856628418, 0.6654438376426697, 0.8632418513298035, -0.4073604643344879, 0.13623487949371338, -0.475900262594223, 0.7027544975280762, 0.5120522379875183, -0.6987074017524719, 0.3874332010746002, -0.11856107413768768, 0.0351865291595459, -0.6770492792129517, -1.102729320526123, -0.2687925100326538, -0.45065462589263916, 0.8800620436668396, 0.9926012754440308, 0.08357404917478561, 0.43068641424179077, 0.24544689059257507, 0.1412651091814041, 0.10379765182733536, 0.0804566815495491, 0.39879152178764343, 1.2447710037231445, -0.23495563864707947, 0.18791592121124268, 0.6582162380218506, 0.4399683475494385, 0.12322833389043808, -0.674278736114502, -0.2707236409187317, -0.39800286293029785, -0.1682882010936737, -0.7041257619857788, 0.15428628027439117, 0.9745721220970154, -0.15351451933383942, 0.37905365228652954, -1.205926537513733, -0.29975050687789917, -0.5017616748809814, 0.4010814130306244, 0.5813636779785156, -0.06097850203514099, 0.31831273436546326, -0.24653910100460052, 0.3073461353778839, 0.45555755496025085, -0.6208304762840271, 0.6767346262931824, 0.4096854329109192, -0.33944642543792725, 0.6076157093048096, -0.13826149702072144, 0.33164262771606445, -0.9113804697990417, 0.5487406849861145, -0.35150280594825745, 1.9392324686050415, -0.3946129083633423, -0.26522451639175415, 0.3220922350883484, -0.23859746754169464, -0.8655949831008911, 0.17281734943389893, -0.8957681059837341, -0.2758970260620117, 0.9294942021369934, -0.10735750943422318, -0.5333803296089172, -0.9215904474258423, -0.4176746904850006, 0.37320971488952637, -0.8201680779457092, 0.3245187997817993, -0.23586151003837585, 0.13125377893447876, 0.7410202026367188, -0.6903454065322876, 0.1401752084493637, 0.6954556107521057, -0.6839625239372253, -0.849360466003418, 0.6618831157684326, -0.6875144243240356, 0.5101175308227539, -0.00428999587893486, -0.3091307282447815, 0.2887691855430603, 1.010500192642212, 0.2012331187725067, -0.5309796929359436, 1.1901605129241943, 0.9626589417457581, 1.1551021337509155, 0.43132781982421875, 0.10780759155750275, 0.3236645460128784, -0.34909841418266296, -0.0023592039942741394, 0.3017524182796478, 1.0583012104034424, -0.06276935338973999, -0.6511721014976501, 0.9633312225341797, -0.3383081257343292, 0.2428184449672699, -0.20986877381801605, 0.837676465511322, -0.37245166301727295, -0.7040591835975647, 0.3243277966976166, 1.0139319896697998, -0.805443286895752, -0.21892735362052917, -0.0831575095653534, 0.1774819940328598, -0.3376131057739258, -0.5670257806777954, -0.1636182963848114, 0.6493915319442749, -0.4890676736831665, 0.9170722365379333, 0.2721596956253052, -0.9819134473800659, -0.26335376501083374, -0.3771848678588867, -0.5403455495834351, 0.6064140200614929, -0.4921939969062805, -0.2746698260307312, 0.7518019080162048, 0.4652197062969208, -0.7965797185897827, 0.5166282057762146, -0.06622213125228882, 0.3194899559020996, -0.1467362344264984, -0.01290033757686615, -0.25878003239631653, 0.6012439727783203, -1.0059623718261719, -0.06939394772052765, -0.5356093049049377, 0.46654176712036133, -0.8258576989173889, 0.23100724816322327, 0.6930490732192993, 0.5483785271644592, -0.33032721281051636, -0.1971842646598816, 0.32857179641723633, 0.5121667981147766, -0.9511289000511169, -0.6999440789222717, 0.9958173036575317, 0.6298509836196899, 0.375819593667984, 0.14503201842308044, -0.06837476789951324, 0.039035700261592865, -0.42203599214553833, 0.09790699183940887, -0.5444461703300476, -0.26407456398010254, -0.6322538256645203, 0.11828494071960449, -0.6254180073738098, -0.9299921989440918, -0.5898528099060059, -0.3441736102104187, 0.26239028573036194, 0.07910572737455368, -0.9078372120857239, 0.018419401720166206, 0.18120691180229187, -0.3953382968902588, -0.5339053869247437, -0.8570364713668823, 1.1327601671218872, -0.12327650189399719, -0.5193181037902832, 0.2778783440589905, -0.9866445064544678, 0.19904033839702606, -0.027322620153427124, 0.007714379578828812, 0.5873473286628723, 0.5950506925582886, -0.708776593208313, 0.059111252427101135, -0.01289321482181549, -0.41321617364883423, -0.6081637144088745, 0.018483273684978485, -0.011856764554977417, -0.5727798938751221, 0.260545015335083, -0.12298623472452164, 0.8220200538635254, 0.2635458707809448, -0.658449649810791, -0.43768933415412903, 0.38090890645980835, 0.6252462863922119, -0.18057894706726074, -0.20106060802936554, -0.3400825560092926, -0.3169688582420349, 0.22122977674007416, 0.08213742822408676, 0.15857309103012085, 0.565809965133667, -0.44901522994041443, -0.09906734526157379, 0.26841825246810913, -0.327279657125473, 1.3978745937347412, 0.770933985710144, 0.032770127058029175, 0.35123658180236816, -0.3964875042438507, 0.6750889420509338, 0.18378916382789612, 0.9974991679191589, 0.293337345123291, 0.11685150116682053, -0.028982259333133698, 0.8045889139175415, 0.955053985118866, 0.06578364968299866, 0.6816713213920593, 0.5604342818260193, -0.8267966508865356, 0.9839953184127808, 0.8946499824523926, -0.5164777040481567, 0.5181025266647339, 0.3597002923488617, -0.48687928915023804, 0.43457159399986267, 0.0481274276971817, -0.7938475012779236, 0.29083913564682007, 0.48485231399536133, -0.5654752850532532, -0.06090119481086731, -0.04410354793071747, -1.0727158784866333, 0.4042057991027832, 0.5969193577766418, 0.9070255160331726, -0.4057219624519348, -0.3948343098163605, 0.3368903696537018, -0.2183629274368286, -0.43824994564056396, -1.0226335525512695, 0.2364140897989273, 0.9437463283538818, 0.5388559699058533, -0.32596123218536377, -0.3322448134422302, 1.3327902555465698, -0.28608959913253784, -0.7046443223953247, -0.06610044091939926, -0.475662499666214, 0.13142602145671844, -0.8154958486557007, 0.31403207778930664, 0.1204448714852333, -0.40247660875320435, -1.4161019325256348, 0.2609536647796631, -0.851134717464447, -0.3132208585739136, -0.04882436245679855, -0.2208118587732315, -0.11634807288646698, 0.11954177916049957, -0.2530675232410431, 0.008707642555236816, -0.0599001944065094, -0.034950897097587585, 0.1958865523338318, 0.16274085640907288, -0.641849935054779, -0.5339943766593933, -0.44205689430236816, 0.38625749945640564, -0.3544226288795471, -0.022702649235725403, 0.7092485427856445, 0.6356050968170166, 0.6080727577209473, -0.727171778678894, -0.21359848976135254, -0.3981005847454071, -0.18357057869434357, 0.4878550171852112, 0.6998398900032043, 0.07237705588340759, 0.4488148093223572, 0.38516345620155334, 1.6246497631072998, -0.42702528834342957, 0.005806773900985718, 0.035778120160102844, 0.8971848487854004, 0.7281110882759094, 1.9502613544464111, -0.9668819308280945, -0.2565195560455322, -0.15595346689224243, -0.21717022359371185, -0.22400468587875366, -0.3526044487953186, -0.853661835193634, -0.23256981372833252, 0.5181578993797302, -0.3182638883590698, 0.2673046886920929, -0.6060003638267517, 0.19739726185798645, -0.523084282875061, 0.3871862292289734, 0.7653819918632507, 0.3651330769062042, 0.32460862398147583]
# 机 [768] [0.06010199338197708, 0.24451978504657745, -0.5891311764717102, 0.11891326308250427, 1.3827686309814453, -0.02632889151573181, -0.5028846263885498, 0.519509494304657, -0.3986203670501709, 0.15344084799289703, -0.0691082701086998, 0.10058999061584473, 0.0649043619632721, -0.03721120208501816, -0.22049462795257568, -0.5938263535499573, 0.597602367401123, 0.7199863791465759, 0.8957920074462891, 1.4729554653167725, -0.5464328527450562, 0.1000714898109436, -0.5366384983062744, -0.16785427927970886, 0.3329857587814331, 0.11853432655334473, -0.21361079812049866, -1.3115923404693604, 0.23145431280136108, 0.2861739993095398, 0.18566612899303436, -0.24116933345794678, 1.4869163036346436, 0.2273845225572586, -0.5196429491043091, 0.4961903691291809, -1.5830020904541016, -0.7390942573547363, -0.05900222063064575, -1.666506290435791, 0.09090521931648254, -1.1691399812698364, 1.308651089668274, 0.6760890483856201, -0.22367875277996063, 0.0075526162981987, -0.3355269134044647, -1.1315757036209106, 2.177260160446167, 1.1903718709945679, -0.2666979432106018, 10.677083969116211, -0.3752991259098053, 0.7395467758178711, 0.2537824511528015, -1.163533091545105, 0.4186877906322479, -0.032997146248817444, 0.19523179531097412, 0.2047090232372284, 0.04334205389022827, 0.24725735187530518, -0.3704075515270233, 0.4714221656322479, 0.7919231653213501, -0.4111452102661133, 0.11320765316486359, 0.4229353666305542, 0.20250701904296875, 0.48623451590538025, 0.34673064947128296, 0.27985918521881104, -0.8004564642906189, 0.2261795699596405, 0.49212390184402466, -0.5544049739837646, -0.22184357047080994, -0.5168362855911255, 0.4916303753852844, 0.2435663342475891, -0.28936848044395447, 0.05426102876663208, -0.2542640268802643, 0.7103915810585022, -1.3097013235092163, -0.6812054514884949, -0.38137373328208923, 0.35757580399513245, 0.5599746704101562, -0.8894659280776978, -0.4999987781047821, 0.19511951506137848, -0.2536734938621521, 0.4336288571357727, -0.4179166555404663, 0.3782655596733093, -0.49700435996055603, 0.15618008375167847, -0.5666488409042358, 0.21525996923446655, 0.07949128746986389, 0.019041195511817932, -0.04141947627067566, 0.11145591735839844, 0.03574863076210022, 1.6114070415496826, 0.5000990629196167, -1.0955158472061157, -1.2668720483779907, 0.4358159005641937, -0.3549959361553192, -0.09019792824983597, -0.25050053000450134, -0.32153987884521484, 0.6069348454475403, -0.13890677690505981, 0.12717577815055847, 1.7183234691619873, 0.14844074845314026, 0.5427603125572205, 0.5536370873451233, 1.575773000717163, 0.9540340304374695, 0.09905087947845459, -0.410592645406723, -0.885555624961853, 0.08249820023775101, 0.20762822031974792, -0.5096715092658997, -0.5039941072463989, 1.2697030305862427, 0.8704719543457031, 1.2794504165649414, -0.6060962677001953, 0.08748915791511536, -0.778082013130188, -0.44052109122276306, -0.5006035566329956, -0.9283109903335571, -0.5675036907196045, 0.5223066210746765, 1.155895471572876, 0.14270132780075073, 0.9921962022781372, -0.9905741214752197, -0.3292789161205292, 0.1617697775363922, -0.8849731087684631, -0.14257600903511047, 0.17618943750858307, -1.2572804689407349, 0.46818727254867554, -0.2834770679473877, 0.1011388897895813, 0.104466512799263, 0.051777541637420654, 1.7501935958862305, -0.9912354946136475, 0.9172625541687012, 0.2792014479637146, 0.14738671481609344, 0.004317641258239746, -1.0981898307800293, 0.491294264793396, -0.5147110819816589, -0.21191845834255219, 1.1056764125823975, 0.1908450722694397, 0.7502333521842957, 0.8314027786254883, -0.2943481206893921, -0.06071850657463074, -0.36476945877075195, 0.8093426823616028, -0.22975406050682068, -0.07344982028007507, -0.5104179382324219, -0.1950806826353073, 0.31923991441726685, 0.6311241388320923, 0.3942614197731018, 0.9768105149269104, -0.6491969227790833, 0.6460438966751099, 0.45409873127937317, -1.1366928815841675, -0.400310218334198, 0.026917368173599243, 0.030899617820978165, -1.0171067714691162, 0.8068937063217163, 0.051458895206451416, 0.6306607723236084, 0.07325354963541031, -0.02779574692249298, -0.7782092690467834, -0.13810564577579498, -0.8472804427146912, 0.6482178568840027, 0.4343738853931427, 0.02709771692752838, 0.6197317838668823, 0.40377363562583923, 0.32891786098480225, 0.28032687306404114, -0.3728634715080261, 0.6113978624343872, -0.5838435292243958, 0.07036449015140533, -0.9232779741287231, -0.1716209053993225, 0.18794547021389008, 0.21134935319423676, 0.7441083788871765, -0.15072643756866455, -0.3314012587070465, 0.8386950492858887, 0.31759756803512573, -1.1539667844772339, -0.23354876041412354, 0.004865571856498718, -0.6814230680465698, 0.1396559625864029, -0.7512000799179077, 0.5360117554664612, -0.5626001358032227, -0.8710578083992004, 0.3943248987197876, -0.4605798125267029, 0.1916351318359375, 0.5186425447463989, 0.4920642673969269, 0.7940809726715088, 0.17801275849342346, -0.1692269742488861, -0.5595366358757019, -1.333336591720581, 0.6521267890930176, -1.2025609016418457, 0.46765005588531494, 0.6973038911819458, -0.8448268175125122, -0.38452714681625366, 0.38044315576553345, 0.11158636212348938, -0.2568868398666382, -0.7011480331420898, -0.47922635078430176, 0.8483399152755737, 0.01606065034866333, 0.503218948841095, 0.7936661243438721, -0.08617737889289856, -0.4550914466381073, 0.13926130533218384, 0.3841448128223419, 0.8877164125442505, -0.26270514726638794, -0.24086283147335052, -0.5306749939918518, -0.3050627112388611, -0.701528787612915, 0.10642820596694946, -1.2822301387786865, -0.4391228258609772, 0.039306264370679855, 1.2063424587249756, 0.057361457496881485, 1.097434639930725, 0.22745585441589355, -0.6274304389953613, -1.026311993598938, 0.14053557813167572, -0.05195605754852295, -0.9638622403144836, -0.3230445981025696, -0.01900370419025421, 1.4262382984161377, 0.649415135383606, -0.42175817489624023, -0.6776343584060669, 0.37521830201148987, -0.20172807574272156, 0.3863174319267273, -0.32300418615341187, -0.008129501715302467, -0.3294215202331543, 0.3791787326335907, -0.18606245517730713, 0.30991706252098083, 0.3327719271183014, -0.5626586675643921, 0.30327290296554565, 0.21221861243247986, 1.948738932609558, 0.3315269351005554, 0.2693924307823181, 0.4036996364593506, 0.19902408123016357, 0.8048022389411926, -0.0351838693022728, -0.5737357139587402, 0.6155307292938232, 1.1870872974395752, -0.2882426083087921, -1.0801044702529907, 0.26638513803482056, 0.5966808199882507, 0.9726555943489075, -0.1501065492630005, 0.9258439540863037, 1.2528265714645386, 1.2588248252868652, -0.806333065032959, -0.8805230259895325, -0.15087763965129852, -0.2847970724105835, 0.672758936882019, 0.26627612113952637, 1.1378295421600342, -0.619570791721344, -0.9002147912979126, -0.3571842908859253, 1.0100427865982056, 0.5378096103668213, 0.5114866495132446, 1.1594512462615967, -0.27746057510375977, 0.11041821539402008, 0.18010100722312927, -0.5645062923431396, -0.07544514536857605, -1.4434187412261963, 0.05500251054763794, -0.26769089698791504, -0.9936579465866089, 1.2443819046020508, 0.7977599501609802, -0.24335189163684845, -0.6539674997329712, 1.5583406686782837, -1.2546510696411133, -0.4349431097507477, 0.33049094676971436, -0.3763435482978821, -1.4328351020812988, 0.0416681170463562, 0.39224621653556824, 0.8423866033554077, -0.2756112217903137, -1.2752584218978882, 0.5106049180030823, 0.40484029054641724, -0.8905808925628662, -0.4331875443458557, 0.4016709327697754, 0.2866097092628479, 1.2761409282684326, -0.46098989248275757, -0.2015545666217804, -0.378663033246994, 0.5110960006713867, -0.2277693748474121, -0.24474219977855682, -0.07232805341482162, -0.5796211957931519, -0.10277930647134781, 0.2612836956977844, 0.38846689462661743, -1.4894943237304688, 0.6702402830123901, 0.5581533312797546, 0.09927672892808914, 0.23355862498283386, -1.0243487358093262, -0.9972022771835327, 0.22344738245010376, 0.8336789608001709, 0.3860499858856201, 0.8949747085571289, 0.0677570104598999, 0.09251850843429565, 0.6226048469543457, 0.18166570365428925, 0.9726380705833435, -0.3115488588809967, -0.3855094313621521, 0.3794298768043518, 0.8248649835586548, 0.0897994190454483, 0.10146042704582214, 1.1636674404144287, -0.11927694082260132, -0.3710288107395172, 1.3929755687713623, 0.5037785172462463, -1.1649837493896484, 0.4922938942909241, -0.5030602216720581, 0.5020602941513062, -0.22137252986431122, 0.633650541305542, -0.309434175491333, 0.3422635495662689, 1.6334331035614014, -1.0533831119537354, 0.44681310653686523, 2.067044973373413, 0.6485514640808105, -0.13126935064792633, 0.20722296833992004, 0.40203988552093506, -0.5506085753440857, -0.33008119463920593, 0.7456136345863342, 1.0645771026611328, 1.3177025318145752, -0.5473485589027405, 0.6771531701087952, -0.055791743099689484, -0.8640657663345337, 0.14461641013622284, 0.27330267429351807, -1.0750987529754639, 1.1683379411697388, -1.2023444175720215, -0.31937679648399353, 1.6147184371948242, -0.4784092307090759, -0.8045318126678467, -0.4362436532974243, -0.25589123368263245, 0.36014267802238464, 0.9487563371658325, -0.17910432815551758, 0.3987158238887787, 0.10952530801296234, 0.2764410376548767, -0.1560775339603424, -0.7290219068527222, -0.5428542494773865, -1.3265247344970703, 1.232373595237732, 0.4849308133125305, -0.14763978123664856, 0.31936413049697876, 1.2021582126617432, -0.05124080181121826, -0.09181465208530426, 0.2434772104024887, -0.06675949692726135, -0.28656554222106934, -0.8584275245666504, -0.5915392637252808, 0.023611634969711304, 0.49566495418548584, 0.33882710337638855, 1.3456487655639648, 0.4403266906738281, 1.4287985563278198, -0.8890992999076843, 1.4584672451019287, -0.4026137590408325, -0.5072425007820129, 0.738946795463562, -0.2318536341190338, 0.491513729095459, -0.5863957405090332, -0.791823148727417, -0.35420310497283936, 0.1283658742904663, -0.37278977036476135, -0.17611894011497498, 0.6541166305541992, -0.07941006124019623, 1.27907133102417, 0.0551513135433197, 0.8870424032211304, -2.3530263900756836, -0.33697670698165894, -0.3901437819004059, 1.379183053970337, 0.15988405048847198, -0.1737646907567978, -0.34959179162979126, -0.4075344204902649, 0.14333927631378174, -0.2616020441055298, -0.0987151563167572, 0.7011851072311401, -0.48126184940338135, -0.0994236171245575, 0.02522490918636322, -0.4694935977458954, -1.044831395149231, 0.4844616949558258, -0.004442721605300903, -0.9075477123260498, 0.31898772716522217, 0.0026455745100975037, 0.08563540875911713, -0.8046911954879761, 0.4876980781555176, -1.028488278388977, 0.3586440682411194, -0.07959270477294922, 0.6913782358169556, -0.6852188110351562, -0.16601085662841797, -0.3559313118457794, -0.39354950189590454, -0.8636708855628967, 0.11018887162208557, -0.998241126537323, -1.0408867597579956, 1.1771894693374634, -1.1550827026367188, 0.587679922580719, 0.6919980049133301, 0.7129180431365967, -1.2021740674972534, 0.5371319055557251, -0.11623954772949219, -0.3831631541252136, 0.2973766028881073, -1.205342173576355, 0.3178013563156128, -0.0761953592300415, 0.08907926082611084, -1.0805555582046509, 0.43527740240097046, 0.05048304796218872, 0.23441892862319946, 0.5573804974555969, 0.9216461181640625, 0.38475364446640015, -0.4530751407146454, -0.33623260259628296, 0.5640428066253662, 0.5869417190551758, 0.12259683758020401, -1.314158320426941, 0.02260752022266388, -0.27127426862716675, -0.08102712780237198, 0.03301972150802612, 0.3725551962852478, -0.5305841565132141, -0.32778576016426086, -0.38799959421157837, -1.3149333000183105, -0.33548927307128906, -0.6285329461097717, 0.1115797907114029, -0.09516239166259766, -0.704616129398346, 0.17601513862609863, -0.07645043730735779, 0.2963460683822632, -0.5200899839401245, 0.17364823818206787, 1.0268378257751465, -0.75385582447052, -0.15102365612983704, 0.4308429956436157, 0.08217695355415344, 0.30912864208221436, -1.095872402191162, -0.8110876083374023, 0.37473341822624207, 0.12615889310836792, -0.3828336298465729, 0.23824922740459442, 0.6354528665542603, -0.8818939924240112, 0.45322176814079285, -0.706051230430603, 0.025850504636764526, 0.021731048822402954, 0.6247569918632507, 0.7206968069076538, -0.20711341500282288, -0.49476462602615356, -1.3687688112258911, -1.0244396924972534, -0.6156498789787292, 0.2552332878112793, 0.46927791833877563, -0.059785306453704834, 0.5222265124320984, 0.8464916944503784, 0.015197984874248505, 0.1705404371023178, 0.4355364441871643, -1.2212941646575928, -1.302013874053955, 0.08277973532676697, -0.7401541471481323, -0.41292017698287964, -0.5697945356369019, -0.1085033118724823, 0.5168744325637817, -0.8689554333686829, 0.9440678358078003, 0.3631657063961029, 0.6930688619613647, -0.261049747467041, -0.645176887512207, -1.1692161560058594, 1.3376041650772095, 0.09641849994659424, -0.011782459914684296, -0.8615455031394958, -0.3578832447528839, 0.37833088636398315, 1.2329834699630737, -0.5374269485473633, 0.49623098969459534, 0.4680635631084442, -0.6706074476242065, -1.1152454614639282, -0.00640670582652092, -0.11111798882484436, 0.44099023938179016, -0.25768792629241943, 0.801510751247406, 0.902164101600647, -0.07952243089675903, -0.06378173828125, -0.03739956021308899, 0.10369212925434113, 0.3751007914543152, -0.4458857774734497, 0.7431509494781494, 1.1497440338134766, 0.2279253900051117, -0.8749423027038574, 0.5496058464050293, 1.429203748703003, -0.6189945340156555, 0.34244465827941895, -0.28553691506385803, -0.6924086809158325, 0.1343311071395874, -0.47138091921806335, 0.7011252045631409, -0.15529868006706238, 0.5402214527130127, -0.929444432258606, -0.5891609787940979, -1.2644169330596924, 0.040289267897605896, 0.19540908932685852, 0.5817223787307739, 1.0270366668701172, 0.229378804564476, 1.0627756118774414, 0.22391250729560852, 0.5628386735916138, 0.7624497413635254, 0.44640836119651794, 0.71442711353302, 0.6296993494033813, -0.8645405173301697, 0.13552527129650116, 0.35975080728530884, 0.024806298315525055, -1.0298489332199097, -0.396747350692749, -0.16690495610237122, 1.0138235092163086, -0.8116598725318909, 2.1493165493011475, -0.5407942533493042, -1.0526838302612305, 0.32752305269241333, 0.19563646614551544, -0.6309012174606323, 0.4760264456272125, -0.13770419359207153, -0.20295283198356628, -1.191309928894043, 0.5415747761726379, -0.5926333069801331, 0.9446982741355896, 0.03961604833602905, -0.013114012777805328, 0.6784154176712036, 0.3923458755016327, -0.27192309498786926, -0.30893027782440186, 0.44161373376846313, -0.9701354503631592, -0.7154232263565063, -1.3433420658111572, 4.591142654418945, -1.2300100326538086, 0.7728877663612366, -0.11938497424125671, -0.24254921078681946, -0.9527028799057007, -0.023920580744743347, -0.28122276067733765, 0.07608148455619812, -0.23159721493721008, -0.024871379137039185, -0.07860498130321503, 0.17278090119361877, -0.1119416356086731, 0.11623325943946838, -1.1602567434310913, 0.4567076861858368, -0.8268020153045654, 0.04684615135192871, -0.9242035150527954, 0.7812117338180542, -0.9980908632278442, -0.20734676718711853, 0.3976990580558777, -0.6943503618240356, 0.6651202440261841, -0.4428955018520355, -0.5895990133285522, -0.16190391778945923, -0.15441979467868805, -0.2637207806110382, -0.8220709562301636, -0.7759997844696045, -0.511989176273346, -0.6283292174339294, -0.5440883040428162, 0.5803619623184204, 0.9277993440628052, -0.3253106474876404, 0.7510417699813843, 1.7628846168518066, -0.21192312240600586, -0.6288543939590454, 0.053591907024383545, 0.499576210975647, -0.7931627631187439, 0.4697733521461487, -0.3008604943752289, -0.0366005003452301, -0.2817532420158386, -0.0666101723909378, 0.06220225989818573, 0.4505699872970581, -0.16136163473129272, 1.613295078277588, -0.729518711566925, -0.22327160835266113, 0.08287549018859863, -0.01638190448284149, 0.27997490763664246, -0.32266175746917725, 1.6958160400390625, 1.1313945055007935, 0.6225196123123169, -0.9410449266433716, 0.7336055040359497, 0.28890135884284973, 1.5285240411758423, -0.0661163255572319, -1.2093055248260498, 0.8478402495384216, -0.6935744881629944, 0.26136714220046997]
# 器 [768] [0.3271118402481079, 0.2398865669965744, -0.26556262373924255, -0.38872283697128296, 0.9435732364654541, -0.3661479353904724, -0.6954675912857056, 0.19333912432193756, -0.22752153873443604, 0.26810914278030396, -0.5432969927787781, -0.4094058871269226, 0.6032847762107849, -0.5610200762748718, -0.4453972280025482, -1.000609278678894, -0.06937005370855331, 0.6202160716056824, 0.4119313359260559, 0.4210115671157837, 0.12100037187337875, 0.3913929760456085, -0.08765214681625366, -0.9499040842056274, -0.8148966431617737, -0.11970411241054535, -0.30000609159469604, -0.5417401790618896, -0.25347262620925903, -0.524329662322998, -0.06674641370773315, -0.6281113624572754, 0.9840056896209717, -0.7947376370429993, 0.24148796498775482, 0.13187652826309204, -1.032694935798645, -0.00526544451713562, -0.17758840322494507, -0.3363928496837616, 0.4344666600227356, 0.16133065521717072, 0.6182820796966553, 0.4538533389568329, -0.02535724639892578, -0.4383530914783478, -0.5959160327911377, -0.7004311680793762, 0.8187060356140137, 0.5304467678070068, 0.0159761980175972, 10.522496223449707, -0.0018093883991241455, -0.07990603893995285, -0.19579525291919708, -0.7058683633804321, 0.41594165563583374, 0.012569710612297058, -0.24755242466926575, -0.3383980691432953, 0.012956827878952026, -0.08334898948669434, 0.42139720916748047, 0.030239351093769073, 0.1528605967760086, -0.2155143767595291, 0.19223807752132416, 0.12208801507949829, -0.5508213043212891, 0.1901569813489914, 0.22771307826042175, 0.601189374923706, -0.771701991558075, 0.3722255825996399, 0.9486677050590515, -0.3227282762527466, 0.4871130585670471, -0.47680991888046265, -0.3006134033203125, -1.3994803428649902, -0.7482055425643921, -0.10722532868385315, -0.6809541583061218, 0.20669299364089966, -0.3757933974266052, 0.592327356338501, -0.3437092900276184, -0.11102795600891113, -0.19540497660636902, -1.0187499523162842, 0.4516494572162628, 1.07876718044281, 0.12232829630374908, 0.8063575029373169, -0.3856174349784851, -0.08372308313846588, -0.9449412822723389, -0.4780502915382385, -0.3206540644168854, -0.03378314524888992, -0.7460082769393921, 0.6413986682891846, -0.052413761615753174, -0.02204720675945282, -0.28071045875549316, 1.5065038204193115, 0.732836127281189, 0.3552510142326355, -0.34116649627685547, -0.45585379004478455, -0.6105547547340393, -0.08750391006469727, -0.7657686471939087, 0.4989810585975647, 0.3558407723903656, 0.8562963604927063, 0.6423413753509521, 2.065176010131836, 0.37114885449409485, 0.22514650225639343, 0.30496957898139954, 0.9754883050918579, -0.05592459440231323, -0.4025263488292694, -0.4800476133823395, -0.8217689990997314, -0.5836721062660217, 0.5026370882987976, -0.1495783030986786, -0.4154338538646698, 0.2088952660560608, 0.11310335993766785, 0.37655144929885864, 0.40334799885749817, -0.11103767156600952, 0.027122654020786285, 0.3867420256137848, -0.15173105895519257, -1.0065363645553589, -0.5528773069381714, 0.13941136002540588, 0.35534176230430603, 0.07397922873497009, 0.12197071313858032, 0.04010164737701416, -0.8363338708877563, -0.4613051414489746, -0.19628113508224487, 0.5075901746749878, -0.07812410593032837, -0.5237783789634705, 0.3710453510284424, 0.44257891178131104, 0.22598230838775635, -0.8700827956199646, -0.17076057195663452, 0.13001811504364014, -0.6840368509292603, 1.480686902999878, 0.015991710126399994, 0.13776956498622894, -0.28921210765838623, -0.7988049983978271, -0.024952590465545654, -0.0004863142967224121, -0.8608806133270264, 0.040570393204689026, 0.7668197751045227, 0.7578950524330139, -0.4262399673461914, -0.5794854164123535, -0.08025449514389038, 0.09050670266151428, 0.3859277665615082, -0.7027846574783325, 0.24263055622577667, -0.7823705077171326, -0.336649090051651, 0.36104992032051086, 1.1047968864440918, -0.1284320056438446, 0.5659098029136658, 0.5243451595306396, -0.33733853697776794, 0.8196552395820618, -0.11885756254196167, -0.07634618878364563, -0.17617586255073547, 0.3333442211151123, -0.4189654588699341, 0.7709958553314209, 0.21778079867362976, 0.639013946056366, -0.3253941535949707, 0.3770740032196045, -0.6739015579223633, -0.1754390001296997, -0.20486487448215485, 0.13503088057041168, -0.3166104853153229, 0.06823118031024933, -0.34857895970344543, -0.36777883768081665, 0.19212888181209564, -0.2932841181755066, -0.07147061824798584, 0.10792813450098038, -0.6299639940261841, -0.2693709135055542, -0.15908755362033844, 0.6939390301704407, 0.16532060503959656, 0.751899778842926, 0.1503978818655014, -1.2919211387634277, 0.04261945188045502, 0.6073105335235596, 0.32440128922462463, -0.4783836603164673, -0.3875177502632141, 0.29179877042770386, 0.16566121578216553, -0.452995240688324, -0.15300068259239197, -0.4575681984424591, -0.056289270520210266, -0.46576592326164246, -0.001427873969078064, 0.021359354257583618, 0.04581841826438904, 0.61818528175354, 0.6884229779243469, -0.051963381469249725, -0.05906379222869873, -0.7444359064102173, -0.5868096947669983, -0.6280919909477234, -0.25793153047561646, -0.046454668045043945, 0.5608730316162109, 0.05432373285293579, -0.6654195189476013, -0.02401117980480194, -0.13490954041481018, -0.6136406660079956, 0.05974678695201874, -0.26347193121910095, -0.3302127718925476, -0.2850499153137207, -0.04146485775709152, -0.1713777631521225, 0.026493653655052185, 0.08996614068746567, -1.110485315322876, -0.31239986419677734, -0.175812765955925, 0.376038134098053, -0.20089080929756165, 0.2206980437040329, -0.3088287115097046, 0.12499800324440002, 0.17740318179130554, -0.37894266843795776, 0.074787437915802, 1.2970619201660156, -0.1769745945930481, 1.0074759721755981, -0.4648493230342865, 0.7401442527770996, 0.5193971395492554, -0.0946158766746521, 0.5752142667770386, 0.046241264790296555, -0.618910551071167, -1.3211315870285034, -0.4674948751926422, -0.2815861105918884, 1.315609097480774, -0.08441460132598877, -0.6256957650184631, 0.18379300832748413, -0.11530131101608276, 0.4894713759422302, 0.4665593206882477, 0.13699311017990112, -0.5902743935585022, -0.12454105913639069, 0.2688139081001282, 0.8842904567718506, 0.024550437927246094, 0.03558109700679779, -0.06794953346252441, -0.0627412348985672, 0.007284760475158691, 1.8998926877975464, 0.5116308331489563, -0.6253881454467773, -0.07682681083679199, 0.28092247247695923, 0.964269757270813, -0.44733306765556335, -0.42062151432037354, -0.031235694885253906, 0.9777795076370239, 0.07898062467575073, -0.1329210102558136, 0.45361822843551636, 0.5339779853820801, 0.038710832595825195, -0.026392623782157898, 0.046834588050842285, 0.10825245082378387, -0.8931022882461548, 0.15447849035263062, -0.8651176691055298, -0.3032534718513489, -0.9290450215339661, 0.258084774017334, 0.9488183259963989, 0.451992392539978, -0.5329271554946899, -0.16742613911628723, -0.2128605842590332, 0.3578305244445801, 0.620207667350769, 0.5691002011299133, 0.48645609617233276, -1.1376848220825195, 0.29179733991622925, 0.052847981452941895, 0.045639052987098694, 0.09848666191101074, -0.27597951889038086, 0.20132625102996826, -0.014316022396087646, -0.8463947176933289, 0.12408789992332458, 0.8780382871627808, -0.5971583724021912, -0.10175340622663498, 0.5997899770736694, -0.4155144691467285, 0.14958582818508148, -0.04424862563610077, -0.2913857400417328, 0.2040621042251587, -0.28553226590156555, 0.6423404216766357, 1.0892970561981201, -0.05319300293922424, -0.8824529647827148, -0.563022255897522, -0.45208078622817993, -1.1249130964279175, 0.029118657112121582, 0.42539602518081665, 1.0431973934173584, 1.0158262252807617, -0.325011670589447, -0.6989456415176392, -0.6276254653930664, 1.0117017030715942, -0.31940460205078125, -1.3612301349639893, -0.1316656768321991, -0.35878369212150574, -0.2381991446018219, 0.17211095988750458, 0.13761860132217407, -0.6800463199615479, 0.44687002897262573, 0.0349118709564209, 0.7409529685974121, -0.09928414970636368, -0.5217446088790894, -0.2388678640127182, -0.39473605155944824, 0.8076604604721069, -0.06677679717540741, 0.4392961859703064, -0.11348382383584976, 0.6623642444610596, 0.5387639999389648, 0.7077582478523254, 0.8468586206436157, 0.1072375476360321, 0.04910345375537872, -0.04207261651754379, 0.5496394634246826, -0.2395164668560028, -0.30253246426582336, 0.27775752544403076, -0.08223329484462738, -0.0410611629486084, 1.4050993919372559, 0.31755805015563965, 0.05937248468399048, 0.4617568850517273, -0.200197234749794, 0.4999473989009857, -1.0856341123580933, 0.333285391330719, -0.06586183607578278, 0.7542735934257507, 0.4141361713409424, -0.8817558884620667, 0.7312418818473816, 1.3922048807144165, 0.36981692910194397, 0.3104446530342102, -0.3066532611846924, 0.6123530864715576, -0.6576187610626221, 0.0486375093460083, -0.2271752953529358, 0.8344030976295471, 0.9492483139038086, -0.3496466875076294, 0.5019941329956055, -0.0018671900033950806, -0.526263952255249, -0.6632636785507202, -0.118105947971344, -0.28706127405166626, 0.8234825134277344, -0.27974486351013184, -0.312287300825119, 1.2370779514312744, 0.2658666968345642, 0.23743519186973572, 0.5217164754867554, 0.8754464387893677, -0.8510128855705261, 0.8291226625442505, -0.37806200981140137, -0.19135653972625732, -0.563336193561554, 0.7733801007270813, 0.530430793762207, -1.0721697807312012, -0.2859354615211487, 0.7670531868934631, 0.674965500831604, 0.42617547512054443, -0.07692287117242813, 0.9244350790977478, 0.9006996750831604, 0.0267258882522583, -0.026250628754496574, 0.6122151613235474, 0.3188105821609497, -0.6231327056884766, -0.2977389395236969, -0.3502053916454315, 0.3128226399421692, -0.5777525305747986, -0.2640935778617859, 1.3723808526992798, 0.21685023605823517, -0.23056340217590332, -1.1824980974197388, 0.7598018050193787, 0.058122873306274414, -0.38508105278015137, 0.27766913175582886, 0.37310048937797546, -0.8357014656066895, -0.476264625787735, -0.22602777183055878, -0.33937907218933105, -0.26999881863594055, -0.6225466728210449, 0.13800859451293945, 0.9453465342521667, 0.2860640287399292, 0.016493799164891243, 0.5143194198608398, 0.12777377665042877, -2.1392619609832764, -0.01673409342765808, -0.08492186665534973, 0.16602742671966553, 1.0147037506103516, -0.35844844579696655, 0.6940205693244934, -0.12351220846176147, -0.3386117219924927, 0.3107481300830841, -0.6312853097915649, 0.05704149603843689, 0.42574387788772583, -0.024379238486289978, -0.20096853375434875, 0.5067150592803955, -0.6117691993713379, 0.1211492121219635, 0.7877265810966492, 0.2815989851951599, 0.32696568965911865, -0.7455092668533325, 0.5626188516616821, -0.058070287108421326, -0.19919684529304504, -1.2425812482833862, -0.10496018826961517, 0.6140255928039551, -0.03563804179430008, -0.09912675619125366, -0.09116107225418091, -0.4725971221923828, -0.363994836807251, -0.8463783264160156, 0.03653223067522049, -1.223466396331787, 0.47182685136795044, 0.7361264228820801, 0.025047792121767998, 0.5523139238357544, -0.06283406168222427, 0.899376392364502, -1.166929006576538, 0.4127541780471802, -0.37254562973976135, -0.251674622297287, 0.2141081988811493, -0.21562393009662628, 0.4642828404903412, -0.16873320937156677, 0.18329505622386932, -0.7972169518470764, 1.6900509595870972, 0.7641552090644836, 1.023636817932129, 0.9052605628967285, -0.9581515789031982, 0.328560471534729, -0.9299558401107788, -0.9174761176109314, 0.5745185613632202, 0.38594600558280945, -0.05128300189971924, -1.1434943675994873, 0.5701208114624023, -0.4198416471481323, -0.2947249412536621, 0.47279566526412964, 0.13152530789375305, 0.09714499115943909, -0.2935739755630493, 0.14955195784568787, -0.5168606042861938, 0.09604512155056, -1.5767298936843872, -0.3891443610191345, -0.14503318071365356, -0.6339356899261475, 0.6842127442359924, 0.23537474870681763, 0.23914358019828796, -0.2792940139770508, 0.34133419394493103, 0.7319027185440063, -0.36885151267051697, -0.0972747653722763, 0.03204743564128876, 1.02753484249115, -0.00177803635597229, -0.8476541042327881, -0.22021445631980896, 0.27356916666030884, -0.017357468605041504, -0.4486820101737976, 0.3961375951766968, -0.08200153708457947, -0.4314427971839905, 0.6824147701263428, -1.4583771228790283, -0.19091826677322388, 0.4599168300628662, -0.372165322303772, 0.20153608918190002, 0.16964073479175568, -0.01575438678264618, -0.8068089485168457, -0.13008072972297668, -1.6336301565170288, 1.1947355270385742, 0.01888170838356018, 0.06030479073524475, -0.04281531274318695, 0.23285965621471405, -0.44996029138565063, 0.6904721260070801, 0.2867075204849243, -0.8642791509628296, 0.3528270721435547, 0.4116230309009552, 0.2909386456012726, 0.07793422788381577, -0.8654399514198303, -0.08702608942985535, 0.38782209157943726, 0.5474531650543213, -0.3799401819705963, 1.1628963947296143, 0.6848013401031494, 0.4013929069042206, 0.3740784525871277, -1.153745412826538, 0.4271526038646698, -0.0014039278030395508, -0.08261420577764511, -0.10496174544095993, 0.6577809453010559, -0.08970949053764343, 0.13260143995285034, 0.6350550651550293, 0.5989487767219543, 1.2619227170944214, -0.15962448716163635, -0.49833327531814575, -0.20972603559494019, -0.20676802098751068, 0.5453957319259644, 0.3336436152458191, 0.1518980860710144, 0.2697107195854187, -0.035666584968566895, 0.5280819535255432, -0.030844122171401978, -0.5740718245506287, -0.05253838747739792, -0.1028929278254509, -0.32131755352020264, 0.8663873672485352, 0.1711731255054474, 0.38178277015686035, 0.7068312168121338, 0.3486272096633911, 0.286386638879776, 0.007424905896186829, -0.06252631545066833, -0.4250168800354004, 0.5850660800933838, -0.31713786721229553, 0.2530931830406189, -0.12535175681114197, -0.15886425971984863, -0.19718994200229645, -0.5385422706604004, -0.13422363996505737, 0.8806891441345215, -0.1607273668050766, -0.2587206959724426, 1.1161143779754639, -0.28844714164733887, 1.4745609760284424, 0.6576626300811768, 0.6837910413742065, -0.06848273426294327, 0.5790087580680847, 1.2112653255462646, -0.32088643312454224, 0.038744598627090454, -0.6866986751556396, -0.653823733329773, 0.11934200674295425, -0.5365331172943115, -0.06001271307468414, -0.07706001400947571, 0.7905871272087097, -0.24879688024520874, 1.7306722402572632, 0.7608837485313416, -1.0936836004257202, -0.04977685213088989, -0.16149954497814178, -0.14416824281215668, 1.033026099205017, -0.02459883689880371, 0.24764883518218994, -0.5844156742095947, 0.4510768949985504, -0.32717421650886536, 0.3681490421295166, 0.17862367630004883, 0.22569552063941956, -0.08211812376976013, 0.06384297460317612, 0.5121382474899292, -0.23144862055778503, 0.3685431480407715, -0.7736953496932983, -0.3942034840583801, -0.407838374376297, 5.95603084564209, 0.6394795775413513, -0.3032582700252533, 0.6517899036407471, -0.12587353587150574, -0.8916573524475098, 0.08764195442199707, 0.023333795368671417, 0.264376699924469, -1.4119831323623657, 0.13214126229286194, -0.40981513261795044, 0.6759250164031982, -0.34610986709594727, 0.41956180334091187, -0.5828118920326233, 0.32867351174354553, -0.8105259537696838, 0.6413087844848633, 0.05105811357498169, 0.296119749546051, -0.9144022464752197, 0.18195289373397827, -0.5877746939659119, -0.45317378640174866, 0.511062741279602, -1.2207585573196411, -0.7903684377670288, 0.5686142444610596, 0.5583428740501404, 0.6013209819793701, -0.41930997371673584, -0.6664741039276123, -0.9942090511322021, -0.0761297345161438, 0.22103513777256012, 0.04493473470211029, 0.4838815927505493, 0.6327858567237854, 0.3677760064601898, 0.19292563199996948, -0.8724125027656555, -0.47280019521713257, 0.7851178050041199, 0.6771436929702759, 0.5169581174850464, 0.16998490691184998, -0.3868885040283203, 0.6680024266242981, -0.2681344747543335, -0.7201371192932129, -0.4177223742008209, 0.2260323464870453, 0.28738346695899963, 1.9850044250488281, -0.2886892557144165, 0.3519212305545807, -0.5045930743217468, 0.04052524268627167, 0.40773794054985046, -0.6109652519226074, 1.8357938528060913, 0.7263497114181519, 0.6930569410324097, -0.194664865732193, 0.8395650386810303, -0.38293248414993286, 0.09116001427173615, 1.1147868633270264, -0.11913329362869263, 0.40922969579696655, 0.21586789190769196, -0.056883543729782104]
# 人 [768] [0.28108522295951843, 0.07525806128978729, 0.34229356050491333, 0.05783651024103165, 0.15294507145881653, -0.5328042507171631, -0.6923714876174927, 0.6324507594108582, -0.19637152552604675, 0.621239423751831, -0.18979576230049133, -1.4416723251342773, -0.5282493233680725, 0.14964699745178223, 0.5647559762001038, 0.7093667387962341, 0.35276854038238525, 0.2540609538555145, 1.0417835712432861, 0.17702028155326843, -0.2127196192741394, 0.13350613415241241, 0.7829400300979614, -0.07452761381864548, 0.041157662868499756, -0.2610462009906769, 0.3677729368209839, -1.004981279373169, 0.17429125308990479, -0.3832709789276123, -0.0765601322054863, 0.21026620268821716, 0.09452462196350098, -0.0347372442483902, 0.008736878633499146, -0.24195481836795807, -0.6913324594497681, 0.45660340785980225, 0.28900861740112305, 0.3698764741420746, 0.09640347957611084, 0.24376536905765533, 0.5111780166625977, 0.4632512927055359, 0.2256012111902237, -0.38602858781814575, -1.2221267223358154, -1.06699800491333, 0.8323937058448792, 0.6332876682281494, 0.9847374558448792, 11.431238174438477, 0.08030705153942108, -0.5634109973907471, 0.16656994819641113, 0.024258464574813843, 0.7124134302139282, 0.36049678921699524, -0.2579343914985657, -0.4839024543762207, -0.2797757387161255, 0.19234338402748108, -0.25664493441581726, 0.472922682762146, 0.5196115374565125, -0.7703583240509033, 0.24810610711574554, 0.4290614724159241, -0.21951138973236084, -0.4147152304649353, 0.8018250465393066, 0.5077885389328003, -0.9355421662330627, 0.07942992448806763, 0.0076829493045806885, -0.9560081362724304, 0.030546069145202637, -0.8363357782363892, -0.2917442321777344, -0.8632226586341858, -0.5942226648330688, 0.29339462518692017, -1.280080795288086, -0.3848802447319031, -0.649321436882019, 0.3960466682910919, -0.5446368455886841, -0.5080733895301819, 0.20997753739356995, 0.05554210767149925, -0.4556169807910919, -0.08602336049079895, 0.09583023190498352, 0.2242724895477295, -0.38566938042640686, -0.33203959465026855, -1.0535087585449219, -2.1986281871795654, -0.30312293767929077, -0.9996970891952515, -0.6665645241737366, -0.20975446701049805, 0.1741030514240265, -0.7940362691879272, -0.17459028959274292, 0.5206230878829956, -0.18285183608531952, 0.134397953748703, -0.964256763458252, -0.4436376392841339, -0.36404067277908325, 0.40125012397766113, 0.8932784795761108, 0.5221062898635864, 0.3605510890483856, 0.1881365031003952, 0.433641254901886, 1.5821797847747803, -0.2167215347290039, 0.6520259380340576, 0.2035215049982071, 0.48246681690216064, -0.31714242696762085, 0.24047553539276123, -0.3073540925979614, -1.332682490348816, -0.02192789316177368, 0.2924443185329437, -0.3183808922767639, 0.4149169325828552, 0.2792930603027344, -0.07717074453830719, 1.6913739442825317, 0.40769097208976746, -0.21851569414138794, -1.0361289978027344, 0.25582218170166016, 0.07622536271810532, -0.7013002038002014, -1.1194427013397217, -0.32200413942337036, 0.3157781660556793, -0.2570304572582245, 0.3225705325603485, 0.027198493480682373, -0.045928969979286194, 0.11507914215326309, -0.
| 928.344086
| 16,060
| 0.82553
| 8,444
| 86,336
| 8.424562
| 0.488039
| 0.001392
| 0.001856
| 0.001518
| 0.018935
| 0.018935
| 0.015983
| 0.014816
| 0.014816
| 0.012792
| 0
| 0.847688
| 0.05445
| 86,336
| 92
| 16,061
| 938.434783
| 0.023715
| 0.969885
| 0
| 0.56
| 0
| 0
| 0.061035
| 0.021827
| 0
| 0
| 0
| 0
| 0
| 1
| 0.04
| false
| 0
| 0.16
| 0
| 0.2
| 0.1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
803ecddcb511e7194a77ad5b27290b4e5012e784
| 48
|
py
|
Python
|
change_case.py
|
mariongb81/TeamProject
|
c29c765ff8313563d17aea845caefc18631cafac
|
[
"MIT"
] | null | null | null |
change_case.py
|
mariongb81/TeamProject
|
c29c765ff8313563d17aea845caefc18631cafac
|
[
"MIT"
] | 4
|
2021-11-16T02:36:24.000Z
|
2021-11-26T03:33:57.000Z
|
change_case.py
|
mariongb81/TeamProject
|
c29c765ff8313563d17aea845caefc18631cafac
|
[
"MIT"
] | 4
|
2021-11-16T01:02:42.000Z
|
2021-11-27T03:07:36.000Z
|
print( input("ingrese su cadena" ).swapcase())
| 16
| 46
| 0.6875
| 6
| 48
| 5.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125
| 48
| 2
| 47
| 24
| 0.785714
| 0
| 0
| 0
| 0
| 0
| 0.361702
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
33da2612b90a61e970432c500d11f4363c18626f
| 30
|
py
|
Python
|
.history/ClassFiles/PythonModulesPackages/ImportingModules/Pychache/File1_20210107135307.py
|
minefarmer/Comprehensive-Python
|
f97b9b83ec328fc4e4815607e6a65de90bb8de66
|
[
"Unlicense"
] | null | null | null |
.history/ClassFiles/PythonModulesPackages/ImportingModules/Pychache/File1_20210107135307.py
|
minefarmer/Comprehensive-Python
|
f97b9b83ec328fc4e4815607e6a65de90bb8de66
|
[
"Unlicense"
] | null | null | null |
.history/ClassFiles/PythonModulesPackages/ImportingModules/Pychache/File1_20210107135307.py
|
minefarmer/Comprehensive-Python
|
f97b9b83ec328fc4e4815607e6a65de90bb8de66
|
[
"Unlicense"
] | null | null | null |
print("Hello from file 1")
pr
| 10
| 26
| 0.7
| 6
| 30
| 3.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.04
| 0.166667
| 30
| 3
| 27
| 10
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0.548387
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 0.5
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 5
|
33e09c1449da0336671f91f7a7e5ef0d6d953474
| 86
|
py
|
Python
|
testprojects/pants-plugins/src/python/test_pants_plugin/__init__.py
|
revl/pants
|
8ad83e4ca80c095d44efceafd8b41e575da39c65
|
[
"Apache-2.0"
] | 1
|
2020-06-13T22:01:39.000Z
|
2020-06-13T22:01:39.000Z
|
testprojects/pants-plugins/src/python/test_pants_plugin/__init__.py
|
revl/pants
|
8ad83e4ca80c095d44efceafd8b41e575da39c65
|
[
"Apache-2.0"
] | 1
|
2018-09-04T17:37:34.000Z
|
2018-09-04T19:42:58.000Z
|
testprojects/pants-plugins/src/python/test_pants_plugin/__init__.py
|
revl/pants
|
8ad83e4ca80c095d44efceafd8b41e575da39c65
|
[
"Apache-2.0"
] | 3
|
2020-06-30T08:28:13.000Z
|
2021-07-28T09:35:57.000Z
|
__import__("pkg_resources").declare_namespace(__name__) # type: ignore[attr-defined]
| 43
| 85
| 0.802326
| 10
| 86
| 5.9
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.05814
| 86
| 1
| 86
| 86
| 0.728395
| 0.302326
| 0
| 0
| 0
| 0
| 0.224138
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
33e6c4a804a5c34f1f8e8f628f3414186d87ca4d
| 110
|
py
|
Python
|
import_csv_fix_field_limit/models.py
|
ShaheenHossain/itpp-labs-misc-addons13
|
bf62dc5bc1abdc18d78e9560a286babbe1d0e082
|
[
"MIT"
] | null | null | null |
import_csv_fix_field_limit/models.py
|
ShaheenHossain/itpp-labs-misc-addons13
|
bf62dc5bc1abdc18d78e9560a286babbe1d0e082
|
[
"MIT"
] | null | null | null |
import_csv_fix_field_limit/models.py
|
ShaheenHossain/itpp-labs-misc-addons13
|
bf62dc5bc1abdc18d78e9560a286babbe1d0e082
|
[
"MIT"
] | 3
|
2020-08-25T01:57:59.000Z
|
2021-09-11T15:38:02.000Z
|
# -*- coding: utf-8 -*-
import sys
from odoo.tools import convert
convert.csv.field_size_limit(sys.maxsize)
| 15.714286
| 41
| 0.736364
| 17
| 110
| 4.647059
| 0.823529
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.010417
| 0.127273
| 110
| 6
| 42
| 18.333333
| 0.8125
| 0.190909
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
d50db675488cc0120d66ef219cb9713d49a77950
| 126
|
py
|
Python
|
core/models/py_utils/__init__.py
|
OctopusRice/LineNet
|
a03ce3bf741dc497ae6bc680cd779128bda1a34b
|
[
"BSD-3-Clause"
] | 1
|
2020-12-03T03:07:15.000Z
|
2020-12-03T03:07:15.000Z
|
core/models/py_utils/__init__.py
|
OctopusRice/LineNet
|
a03ce3bf741dc497ae6bc680cd779128bda1a34b
|
[
"BSD-3-Clause"
] | 1
|
2019-08-23T09:27:33.000Z
|
2019-08-29T01:46:12.000Z
|
core/models/py_utils/__init__.py
|
OctopusRice/LineNet
|
a03ce3bf741dc497ae6bc680cd779128bda1a34b
|
[
"BSD-3-Clause"
] | null | null | null |
from ._cpools import TopPool, BottomPool, LeftPool, RightPool
from ._cpools_lines import HorizontalLinePool, VerticalLinePool
| 42
| 63
| 0.857143
| 13
| 126
| 8.076923
| 0.769231
| 0.190476
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.095238
| 126
| 2
| 64
| 63
| 0.921053
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
1d5e45170b1659e845321f052e99691ec4fa47d1
| 94,637
|
py
|
Python
|
gameserver/tests.py
|
hammertoe/didactic-spork
|
8d02836f9d3a0d707eea22d480553a8fdc35a0df
|
[
"Apache-2.0"
] | null | null | null |
gameserver/tests.py
|
hammertoe/didactic-spork
|
8d02836f9d3a0d707eea22d480553a8fdc35a0df
|
[
"Apache-2.0"
] | 1
|
2017-02-14T12:00:14.000Z
|
2017-02-14T12:00:14.000Z
|
gameserver/tests.py
|
hammertoe/didactic-spork
|
8d02836f9d3a0d707eea22d480553a8fdc35a0df
|
[
"Apache-2.0"
] | null | null | null |
import unittest
from datetime import datetime, timedelta
import time
import dateutil
import mock
import transaction
import flask_testing
from models import Base, Edge, Node, Player, Goal, Policy, Funding, Budget
from network import Network
from game import Game, get_game
from utils import random
from wallet import Wallet
from main import app
from settings import APP_VERSION
from database import get_db
import json
def fake_get_random_goal(self):
goals = tuple(self.get_goals())
if goals:
return sorted(goals, key=lambda x: x.name)[0]
def fake_get_n_policies(self, n=5):
policies = list(self.get_policies())
if not policies:
return []
return sorted(policies, key=lambda x: x.name)[:n]
goal_patcher = mock.patch('gameserver.game.Game.get_random_goal', new=fake_get_random_goal)
policy_patcher = mock.patch('gameserver.game.Game.get_n_policies', new=fake_get_n_policies)
goal_patcher.start()
policy_patcher.start()
class ModelTestCase(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
class SimpleModelTests(ModelTestCase):
def testNodeEdgeRelationship(self):
n1 = Node.new('node 1')
n2 = Node.new('node 2')
e1 = Edge.new(n1, n2, 1.0)
self.assertEqual(e1.higher_node, n1)
self.assertEqual(e1.lower_node, n2)
def testNodeEdgeBackRelationship(self):
n1 = Node.new('node 1')
n2 = Node.new('node 2')
e1 = Edge.new(n1, n2, 1.0)
self.assertEqual(n1.children, [n2,])
self.assertEqual(n2.parents, [n1,])
def testNodeSetBalance(self):
n1 = Node.new('node 1', balance=1000)
self.assertEqual(n1.balance, 1000.0)
def setup_with_context_manager(testcase, cm):
"""Use a contextmanager to setUp a test case."""
val = cm.__enter__()
testcase.addCleanup(cm.__exit__, None, None, None)
return val
class ControllerTestCase(ModelTestCase):
def setUp(self):
ModelTestCase.setUp(self)
app.config['ZODB_STORAGE'] = 'memory://'
app.config['TESTING'] = True
setup_with_context_manager(self, app.test_request_context())
self.game = get_game()
self.game.start(2017, 2025, 10, 12000000)
test_client = self.game.add_client('tests')
self.api_key = test_client.id
self.client = app.test_client()
def tearDown(self):
db = get_db()
del db['game']
def add_20_goals_and_policies(self):
for x in range(20):
id = "G{}".format(x)
g = Goal(id=id)
g.name = id
self.game.network.goals[g.id] = g
id = "P{}".format(x)
p = Policy(id=id)
p.name = id
self.game.network.policies[p.id] = p
class ViewTestCase(ControllerTestCase):
pass
class CoreGameTests(ControllerTestCase):
def testRandomGoalIsRandom(self):
self.add_20_goals_and_policies()
g = self.game.get_random_goal()
self.assertEqual(g.id, 'G0')
goal_patcher.stop()
g1 = self.game.get_random_goal()
g2 = self.game.get_random_goal()
g3 = self.game.get_random_goal()
self.assertFalse(g1.id == g2.id == g3.id)
goal_patcher.start()
def testGetNPoliciesIsRandom(self):
self.add_20_goals_and_policies()
policies = self.game.get_n_policies()
self.assertEqual([p.name for p in policies], [u'P0', u'P1', u'P10', u'P11', u'P12'])
policy_patcher.stop()
policies1 = [p.name for p in self.game.get_n_policies()]
policies2 = [p.name for p in self.game.get_n_policies()]
policies3 = [p.name for p in self.game.get_n_policies()]
self.assertFalse(policies1 == policies2 == policies3)
policy_patcher.start()
def testAddPlayer(self):
p1 = self.game.create_player('Matt')
self.assertEqual(self.game.get_player(p1.id), p1)
self.assertEqual(self.game.num_players, 1)
p2 = self.game.create_player('Simon')
self.assertEqual(self.game.get_player(p2.id), p2)
self.assertEqual(self.game.num_players, 2)
def testGameCreatePlayer(self):
self.add_20_goals_and_policies()
p = self.game.create_player('Matt')
self.assertEqual(self.game.get_player(p.id), p)
self.assertEqual(self.game.get_goal(p.goal_id).name, 'G0')
policies = p.policies
self.assertEqual(sorted([x for x in policies]), sorted([u'P0', u'P1', u'P10', u'P11', u'P12']))
def testGameClearPlayers(self):
self.add_20_goals_and_policies()
p1 = self.game.create_player('Matt')
p2 = self.game.create_player('Simon')
self.assertEqual(len(self.game.network.players), 2)
self.assertEqual(len(self.game.network.goals), 20)
self.game.clear_players()
self.assertEqual(len(self.game.network.players), 0)
self.assertEqual(len(self.game.network.goals), 20)
def testPlayerHasWallet(self):
p = self.game.create_player('Matt')
self.assertEqual(self.game.get_player(p.id), p)
self.assertAlmostEqual(p.balance, self.game.settings.budget_per_cycle)
def testPlayerSetBalance(self):
p = self.game.create_player('Matt')
p.balance = 5000
self.assertAlmostEqual(p.balance, 5000.0)
def testAddPolicy(self):
p = self.game.add_policy('Arms Embargo', leak=0.1)
self.assertEqual(self.game.get_policy(p.id), p)
self.assertEqual(self.game.get_policy(p.id).leak, 0.1)
def testAddWalletToPolicy(self):
po1 = self.game.add_policy('Arms Embargo', leak=0.1)
p1 = self.game.create_player('Matt')
w1 = Wallet([(p1.id, 100)])
po1.wallet = w1
self.assertIn(p1.id, w1.todict())
self.assertEqual(po1.wallet, w1)
def testAddGoal(self):
g = self.game.add_goal('World Peace', leak=0.5)
self.assertEqual(self.game.get_goal(g.id), g)
self.assertEqual(self.game.get_goal(g.id).leak, 0.5)
def testGetRandomGoal(self):
self.add_20_goals_and_policies()
self.assertEqual(self.game.get_random_goal().name, 'G0')
def testAddPlayerAndGoal(self):
g1 = self.game.add_goal('World Peace')
p1 = self.game.create_player('Matt', goal_id=g1.id)
self.assertEqual(p1.goal_id, g1.id)
self.assertIn(p1, self.game.get_players_for_goal(g1.id))
def testAddWalletToGoal(self):
g = self.game.add_goal('World Peace')
p1 = self.game.create_player('Matt')
w1 = Wallet([(p1.id, 100.0)])
g.wallet = w1
self.assertEqual(g.wallet, w1)
def testGetNPolicies(self):
g1 = self.game.add_goal('A')
self.add_20_goals_and_policies()
policies = [u'P0', u'P1', u'P10', u'P11', u'P12']
self.assertEqual([x.name for x in self.game.get_n_policies()], policies)
def testModifyPolicies(self):
p1 = self.game.add_policy('Policy 1', leak=0.1)
p2 = self.game.add_policy('Policy 2', leak=0.2)
self.assertEqual(self.game.get_policy(p1.id).leak, 0.1)
p1.leak = 0.3
self.assertEqual(self.game.get_policy(p1.id).leak, 0.3)
self.assertEqual(self.game.get_policy(p2.id).leak, 0.2)
def testChildParentRelationship(self):
a = Node.new('A')
b = Node.new('B')
l = self.game.add_link(a, b, 1.0)
self.assertIn(a, b.parents)
self.assertIn(b, a.children)
def testPlayerFundedPolicies(self):
p1 = self.game.add_policy('Policy 1')
p2 = self.game.add_policy('Policy 2')
p3 = self.game.add_policy('Policy 3')
p = self.game.create_player('Matt')
self.game.set_policy_funding_for_player(p, [(p1.id,20), (p2.id,30), (p3.id, 0)])
self.assertEqual(sorted(p.policies), sorted([p1.id,p2.id,p3.id]))
self.assertEqual(sorted(p.funded_policies), sorted([p1.id,p2.id]))
def testSimpleNetwork(self):
n1 = self.game.add_policy('Policy 1')
n2 = self.game.add_goal('Goal 1')
l1 = self.game.add_link(n1, n2, 0.5)
self.assertEqual(self.game.get_link(l1.id), l1)
self.assertIn(n2, n1.children)
def testMultiLevelNetwork(self):
n1 = self.game.add_policy('Policy 1')
n2 = self.game.add_policy('Policy 2')
n3 = self.game.add_goal('Goal 1')
l1 = self.game.add_link(n1, n2, 0.5)
l2 = self.game.add_link(n2, n3, 0.5)
self.assertEqual(n3, n1.children[0].children[0])
def testAddWallets(self):
n1 = self.game.add_policy('Policy 1')
p1 = self.game.create_player('Matt')
self.assertEqual(n1.balance, 0)
w1 = Wallet([(p1.id, 5.0)])
self.assertEqual(n1.balance, 0)
n1.wallet = w1
self.assertEqual(n1.balance, 5.0)
w2 = Wallet([(p1.id, 10.0)])
n1.wallet &= w2
self.assertEqual(n1.balance, 15.0)
def testNodeLeak100(self):
n1 = self.game.add_policy('Policy 1', leak=1.0)
p1 = self.game.create_player('Matt')
p2 = self.game.create_player('Simon')
n1.wallet = Wallet([(p1.id, 5.0),
(p2.id, 10.0),])
self.assertEqual(n1.balance, 15.0)
n1.do_leak()
self.assertEqual(n1.balance, 0.0)
n1.do_leak()
self.assertEqual(n1.balance, 0.0)
def testNodeLeak0(self):
n1 = self.game.add_policy('Policy 1', leak=0.0)
p1 = self.game.create_player('Matt')
n1.wallet = Wallet([(p1.id, 15.0)])
self.assertEqual(n1.balance, 15.0)
n1.do_leak()
self.assertEqual(n1.balance, 15.0)
n1.do_leak()
self.assertEqual(n1.balance, 15.0)
def testNodeLeak20(self):
n1 = self.game.add_policy('Policy 1', leak=0.2)
p1 = self.game.create_player('Matt')
p2 = self.game.create_player('Simon')
n1.wallet = Wallet([(p1.id, 5.0),
(p2.id, 10.0),])
self.assertEqual(n1.balance, 15.0)
n1.do_leak()
self.assertAlmostEqual(n1.balance, 12.0, 5)
n1.do_leak()
self.assertAlmostEqual(n1.balance, 9.6, 5)
# Check the individual wallets
d = n1.wallet.todict()
self.assertAlmostEqual(d[p1.id], 3.2, 5)
self.assertAlmostEqual(d[p2.id], 6.4, 5)
def testNodeLeakNegative20(self):
n1 = self.game.add_policy('Policy 1', leak=0.2)
g1 = self.game.add_goal('Goal 1', leak=0.2)
p1 = self.game.create_player('Matt')
p2 = self.game.create_player('Simon')
g1.wallet = Wallet([(p1.id, 5.0),
(p2.id, 10.0),])
# add a negative impact edge
l1 = self.game.add_link(n1, g1, -0.5)
self.assertEqual(g1.balance, 15.0)
g1.do_leak()
self.assertAlmostEqual(g1.balance, 4.5)
g1.do_leak()
self.assertAlmostEqual(g1.balance, 1.35)
# Check the individual wallets
d = g1.wallet.todict()
self.assertAlmostEqual(d[p1.id], 0.45, 5)
self.assertAlmostEqual(d[p2.id], 0.9, 5)
###
def testTransferWalletToWallet(self):
p1 = self.game.create_player('Matt')
w1 = Wallet([(p1.id, 100.0)])
w2 = Wallet([(p1.id, 20.0)])
self.assertAlmostEqual(w1.total, 100.0)
self.assertAlmostEqual(w2.total, 20.0)
w1.transfer(w2, 30.0)
self.assertAlmostEqual(w1.total, 70.0)
self.assertAlmostEqual(w2.total, 50.0)
def testTransferToWalletInsufficientFunds(self):
n1 = self.game.add_policy('Policy 1')
p1 = self.game.create_player('Matt')
n1.wallet = Wallet([(p1.id, 100.0)])
n2 = self.game.add_policy('Policy 2')
self.assertAlmostEqual(n1.balance, 100.0)
self.assertAlmostEqual(n2.balance, 0.0)
with self.assertRaises(ValueError):
n1.wallet.transfer(n2.wallet, 110.0)
self.assertAlmostEqual(n1.wallet.total, 100.0)
self.assertAlmostEqual(n2.wallet.total, 0.0)
def testAllocateFunds(self):
p1 = self.game.create_player('Matt', balance=1000)
n1 = self.game.add_policy('Policy 1', leak=1.0)
self.assertEqual(p1.balance, 1000.0)
self.assertEqual(n1.balance, 0.0)
self.game.do_propogate_funds()
self.assertEqual(p1.balance, 1000.0)
self.assertEqual(n1.balance, 0.0)
self.game.set_policy_funding_for_player(p1, [(n1.id, 100),])
self.game.do_propogate_funds()
self.assertEqual(p1.balance, 900.0)
self.assertEqual(n1.balance, 100.0)
def testAllocateDifferentFunds(self):
p1 = self.game.create_player('Matt', balance=1000)
n1 = self.game.add_policy('Policy 1', leak=1.0)
self.game.set_policy_funding_for_player(p1, [(n1.id, 60),])
self.game.do_propogate_funds()
self.assertEqual(p1.balance, 940.0)
self.assertEqual(n1.balance, 60.0)
self.game.set_policy_funding_for_player(p1, [(n1.id, 80),])
self.game.do_propogate_funds()
self.assertEqual(p1.balance, 860.0)
self.assertEqual(n1.balance, 140.0)
def testDeleteFunds(self):
p1 = self.game.create_player('Matt')
p1.balance = 1000.0
n1 = self.game.add_policy('Policy 1', leak=1.0)
self.game.set_policy_funding_for_player(p1, [(n1.id, 100),])
self.game.do_propogate_funds()
self.assertEqual(p1.balance, 900.0)
self.assertEqual(n1.balance, 100.0)
self.game.set_policy_funding_for_player(p1, [(n1.id, 0),])
self.game.do_propogate_funds()
self.assertEqual(p1.balance, 900.0)
self.assertEqual(n1.balance, 100.0)
# test that we keep the link even when funding stopped
self.assertEqual(len(p1.policies), 1)
def testGameTotalInflow(self):
p1 = self.game.create_player('Matt')
self.assertEqual(self.game.total_players_inflow, 1000)
p2 = self.game.create_player('Simon')
self.assertEqual(self.game.total_players_inflow, 2000)
def testGameTotalActiveInflow(self):
p1 = self.game.create_player('Matt')
p1.unclaimed_budget = 1500000
self.assertEqual(self.game.total_active_players_inflow, 1000)
p2 = self.game.create_player('Simon')
self.assertEqual(self.game.total_active_players_inflow, 2000)
p1.last_budget_claim = datetime.now()-timedelta(hours=6)
self.assertEqual(self.game.total_active_players_inflow, 1000)
p1.claim_budget()
self.assertEqual(self.game.total_active_players_inflow, 2000)
def testPlayerTotalFunding(self):
p1 = self.game.create_player('Matt', balance=1000)
po1 = self.game.add_policy('Policy 1', leak=1.0)
po2 = self.game.add_policy('Policy 2', leak=1.0)
po3 = self.game.add_policy('Policy 3', leak=1.0)
self.game.set_policy_funding_for_player(p1, [(po1.id, 10), (po2.id, 20), (po3.id, 30)])
self.assertEqual(p1.total_funding, 60)
self.game.set_policy_funding_for_player(p1, [(po1.id, 10), (po2.id, 20), (po3.id, 10)])
self.assertEqual(p1.total_funding, 40)
self.game.set_policy_funding_for_player(p1, [(po1.id, 10), (po2.id, 0), (po3.id, 10)])
self.assertEqual(p1.total_funding, 20)
def testPlayerMaxOutflow(self):
p1 = self.game.create_player('Matt')
self.assertEqual(p1.max_outflow, self.game.settings.max_spend_per_tick)
def testPlayerExceedMaxOutflow(self):
p1 = self.game.create_player('Matt', balance=1000, max_outflow=1000)
po1 = self.game.add_policy('Policy 1', leak=1.0)
self.game.set_policy_funding_for_player(p1, [(po1.id, 100),])
po2 = self.game.add_policy('Policy 2', leak=1.0)
self.game.set_policy_funding_for_player(p1, [(po2.id, 200),])
po3 = self.game.add_policy('Policy 3', leak=1.0)
self.game.set_policy_funding_for_player(p1, [(po1.id, 100), (po2.id, 200)])
with self.assertRaises(ValueError):
self.game.set_policy_funding_for_player(p1, [(po1.id, 100), (po2.id, 200), (po3.id, 800)])
self.assertEqual(p1.total_funding, 300)
self.game.set_policy_funding_for_player(p1, [(po1.id, 100), (po2.id, 200), (po3.id, 700)])
self.assertEqual(p1.total_funding, 1000)
def testGoalActive(self):
p1 = self.game.create_player('Player 1', balance=1000)
po1 = self.game.add_policy('Policy 1')
g1 = self.game.add_goal('Goal 1', activation=400)
l1 = self.game.add_link(po1, g1, 200.0)
p1.goal_id = g1.id
self.game.set_policy_funding_for_player(p1, [(po1.id, 200.0),])
self.assertAlmostEqual(self.game.goal_funded_by_player(p1.id), 0.0)
self.game.do_propogate_funds()
self.assertAlmostEqual(p1.balance, 800)
self.assertAlmostEqual(g1.balance, 200)
self.assertAlmostEqual(self.game.goal_funded_by_player(p1.id), 200)
self.assertFalse(g1.active)
self.game.do_propogate_funds()
self.assertTrue(g1.active)
def testNodeActivationFromPlayer(self):
p1 = self.game.create_player('Matt', balance=1000)
po1 = self.game.add_policy('Policy 1', activation=0.2)
self.assertFalse(po1.active)
self.assertAlmostEqual(po1.active_level, 0)
self.game.set_policy_funding_for_player(p1, [(po1.id, 200.0),])
self.game.do_propogate_funds()
self.assertTrue(po1.active)
def testNodeActivationFromNode(self):
p1 = self.game.create_player('Matt', balance=10000)
po1 = self.game.add_policy('Policy 1', activation=0.1)
self.assertAlmostEqual(po1.active_level, 0)
self.assertFalse(po1.active)
po2 = self.game.add_policy('Policy 2', activation=0.2)
l1 = self.game.add_link(po1, po2, 50.0)
self.assertAlmostEqual(po1.active, 0.0)
self.assertFalse(po1.active)
self.game.set_policy_funding_for_player(p1, [(po1.id, 200.0),])
for x in range(5):
self.game.do_propogate_funds()
self.assertTrue(po1.active)
self.assertAlmostEqual(po1.active_level, 0.2)
self.assertAlmostEqual(po1.active_percent, 2.0)
self.assertFalse(po2.active)
self.game.set_policy_funding_for_player(p1, [(po1.id, 400.0),])
self.assertTrue(po1.active)
self.assertAlmostEqual(po1.active_percent, 2.0)
self.assertFalse(po2.active)
self.assertAlmostEqual(po2.active_percent, 0.25)
l1.weight = 400.0
self.game.do_propogate_funds()
self.assertTrue(po1.active)
self.assertTrue(po2.active)
self.assertAlmostEqual(po2.active_percent, 2.0)
def testTwoPlayersFundPolicy(self):
p1 = self.game.create_player('Matt', balance=1000)
p2 = self.game.create_player('Simon', balance=1000)
n1 = self.game.add_policy('Policy 1')
self.game.set_policy_funding_for_player(p1, [(n1.id, 100),])
self.game.set_policy_funding_for_player(p2, [(n1.id, 90),])
self.game.do_propogate_funds()
self.assertEqual(p1.balance, 900.0)
self.assertEqual(p2.balance, 910.0)
self.assertEqual(n1.balance, 190.0)
def testGameTransferFunds(self):
p1 = self.game.create_player('Matt', balance=1000)
p2 = self.game.create_player('Simon', balance=1000)
p3 = self.game.create_player('Rich', balance=1000)
n1 = self.game.add_policy('Policy 1')
self.game.set_policy_funding_for_player(p1, [(n1.id, 10),])
self.game.set_policy_funding_for_player(p2, [(n1.id, 20),])
self.game.set_policy_funding_for_player(p3, [(n1.id, 50),])
self.game.do_propogate_funds()
self.assertEqual(p1.balance, 990.0)
self.assertEqual(p2.balance, 980.0)
self.assertEqual(p3.balance, 950.0)
self.assertEqual(n1.balance, 80.0)
def testGameTransferFundsNoMaxLevel(self):
p1 = self.game.create_player('Matt', balance=1000)
n1 = self.game.add_policy('Policy 1', max_level=0)
self.game.set_policy_funding_for_player(p1, [(n1.id, 10),])
self.game.do_propogate_funds()
self.assertEqual(p1.balance, 990.0)
self.assertEqual(n1.balance, 10.0)
def testGameTransferFundsMaxLevel(self):
p1 = self.game.create_player('Matt', balance=1000)
n1 = self.game.add_policy('Policy 1', leak=1.0, max_level=5.0)
self.game.set_policy_funding_for_player(p1, [(n1.id, 10),])
self.game.do_propogate_funds()
self.assertEqual(p1.balance, 990.0)
self.assertEqual(n1.balance, 5.0)
def testGameTransferFundsMaxLevelMultiplePlayers(self):
p1 = self.game.create_player('Matt', balance=1000)
p2 = self.game.create_player('Simon', balance=1000)
n1 = self.game.add_policy('Policy 1', max_level=5.0)
self.game.set_policy_funding_for_player(p1, [(n1.id, 10),])
self.game.set_policy_funding_for_player(p2, [(n1.id, 5),])
self.game.do_propogate_funds()
self.assertEqual(p1.balance, 990.0)
self.assertEqual(p2.balance, 995.0)
self.assertEqual(n1.balance, 5.0)
def testGameTransferFundsComplex(self):
p1 = self.game.create_player('Matt', balance=1000)
p2 = self.game.create_player('Simon', balance=1000)
p3 = self.game.create_player('Rich', balance=1000)
n1 = self.game.add_policy('Policy 1')
n2 = self.game.add_policy('Policy 2')
self.game.set_policy_funding_for_player(p1, [(n1.id, 10),])
self.game.set_policy_funding_for_player(p2, [(n1.id, 20),(n2.id, 50)])
self.game.set_policy_funding_for_player(p3, [(n1.id, 50),(n2.id, 40)])
self.game.do_propogate_funds()
self.assertEqual(p1.balance, 990.0)
self.assertEqual(p2.balance, 930.0)
self.assertEqual(p3.balance, 910.0)
self.assertEqual(n1.balance, 80.0)
self.assertEqual(n2.balance, 90.0)
def testAllocateFundsMultiplePolicies(self):
p1 = self.game.create_player('Matt', balance=1000)
n1 = self.game.add_policy('Policy 1')
n2 = self.game.add_policy('Policy 2')
self.assertEqual(p1.balance, 1000.0)
self.assertEqual(n1.balance, 0.0)
self.assertEqual(n2.balance, 0.0)
self.game.do_propogate_funds()
self.assertEqual(p1.balance, 1000.0)
self.assertEqual(n1.balance, 0.0)
self.assertEqual(n2.balance, 0.0)
self.game.set_policy_funding_for_player(p1, [(n1.id, 10), (n2.id, 30)])
self.game.do_propogate_funds()
self.assertEqual(p1.balance, 960.0)
self.assertEqual(n1.balance, 10.0)
self.assertEqual(n2.balance, 30.0)
def testGameLeak100(self):
n1 = self.game.add_policy('Policy 1', leak=1.0)
n2 = self.game.add_policy('Policy 2', leak=1.0)
p1 = self.game.create_player('Matt')
n1.wallet = Wallet([(p1.id, 100.0)])
n2.wallet = Wallet([(p1.id, 100.0)])
self.assertEqual(n1.balance, 100.0)
self.assertEqual(n2.balance, 100.0)
self.game.do_leak()
self.assertEqual(n1.balance, 0.0)
self.assertEqual(n2.balance, 0.0)
def testGameLeak0_100(self):
n1 = self.game.add_policy('Policy 1', leak=0.0)
n2 = self.game.add_policy('Policy 2', leak=1.0)
p1 = self.game.create_player('Matt')
n1.wallet = Wallet([(p1.id, 100.0)])
n2.wallet = Wallet([(p1.id, 100.0)])
self.assertEqual(n1.balance, 100.0)
self.assertEqual(n2.balance, 100.0)
self.game.do_leak()
self.assertEqual(n1.balance, 100.0)
self.assertEqual(n2.balance, 0.0)
def testGameLeak50(self):
n1 = self.game.add_policy('Policy 1', leak=0.5)
n2 = self.game.add_policy('Policy 2', leak=0.2)
p1 = self.game.create_player('Matt')
n1.wallet = Wallet([(p1.id, 100.0)])
n2.wallet = Wallet([(p1.id, 100.0)])
self.assertEqual(n1.balance, 100.0)
self.assertEqual(n2.balance, 100.0)
self.game.do_leak()
self.assertAlmostEqual(n1.balance, 50.0)
self.assertAlmostEqual(n2.balance, 80.0)
self.game.do_leak()
self.assertAlmostEqual(n1.balance, 25.0)
self.assertAlmostEqual(n2.balance, 64.0)
def testGameGetWallets(self):
p1 = self.game.create_player('Matt', balance=1000)
p2 = self.game.create_player('Simon', balance=1000)
n1 = self.game.add_policy('Policy 1')
self.game.set_policy_funding_for_player(p1, [(n1.id, 100),])
self.game.set_policy_funding_for_player(p2, [(n1.id, 90),])
self.game.do_propogate_funds()
self.assertEqual(p1.balance, 900.0)
self.assertEqual(p2.balance, 910.0)
self.assertEqual(n1.balance, 190.0)
expected = {p1.id: 100.0,
p2.id: 90.0,}
wallets = self.game.get_wallets_by_location(n1.id)
self.assertEqual(wallets, expected)
def testFundPlayers(self):
p1 = self.game.create_player('Matt')
p2 = self.game.create_player('Simon')
p3 = self.game.create_player('Rich')
self.game.do_replenish_budget()
self.assertAlmostEqual(p1.balance, self.game.settings.budget_per_cycle)
self.assertAlmostEqual(p2.balance, self.game.settings.budget_per_cycle)
self.assertAlmostEqual(p3.balance, self.game.settings.budget_per_cycle)
n1 = self.game.add_policy('Policy 1')
p1.transfer_funds_to_node(n1, 100)
p2.transfer_funds_to_node(n1, 200)
p3.transfer_funds_to_node(n1, 400)
self.assertAlmostEqual(p1.balance, self.game.settings.budget_per_cycle-100)
self.assertAlmostEqual(p2.balance, self.game.settings.budget_per_cycle-200)
self.assertAlmostEqual(p3.balance, self.game.settings.budget_per_cycle-400)
self.assertAlmostEqual(n1.balance, 100+200+400)
self.game.do_replenish_budget()
self.assertAlmostEqual(p1.balance, self.game.settings.budget_per_cycle-100)
self.assertAlmostEqual(p2.balance, self.game.settings.budget_per_cycle-200)
self.assertAlmostEqual(p3.balance, self.game.settings.budget_per_cycle-400)
self.assertAlmostEqual(p1.unclaimed_budget, self.game.settings.budget_per_cycle)
self.assertAlmostEqual(p2.unclaimed_budget, self.game.settings.budget_per_cycle)
self.assertAlmostEqual(p3.unclaimed_budget, self.game.settings.budget_per_cycle)
self.assertAlmostEqual(n1.balance, 100+200+400)
def testGameTransfer15_30(self):
n1 = self.game.add_policy('Policy 1')
n2 = self.game.add_policy('Policy 2')
n3 = self.game.add_policy('Policy 3')
p1 = self.game.create_player('Matt')
l1 = self.game.add_link(n1, n2, 15.0)
l2 = self.game.add_link(n1, n3, 30.0)
self.game.network.rank()
self.game.do_replenish_budget()
p1.transfer_funds_to_node(n1, 100)
self.assertEqual(n1.balance, 100)
self.assertEqual(n2.balance, 0)
self.assertEqual(n3.balance, 0)
self.game.do_propogate_funds()
self.assertAlmostEqual(n1.balance, 55.0)
self.assertAlmostEqual(n2.balance, 15.0)
self.assertAlmostEqual(n3.balance, 30.0)
self.game.do_propogate_funds()
self.assertAlmostEqual(n1.balance, 10.0)
self.assertAlmostEqual(n2.balance, 30.0)
self.assertAlmostEqual(n3.balance, 60.0)
def testRankNodes(self):
n1 = self.game.add_policy('Policy 1', leak=0.5)
n2 = self.game.add_policy('Policy 2', leak=0.5)
n3 = self.game.add_policy('Policy 3', leak=0.5)
n4 = self.game.add_policy('Policy 4', leak=0.5)
n5 = self.game.add_policy('Policy 5', leak=0.5)
g1 = self.game.add_goal('Goal 1', leak=0.5)
g2 = self.game.add_goal('Goal 2', leak=0.5)
g3 = self.game.add_goal('Goal 3', leak=0.5)
p1 = self.game.create_player('Matt')
l1 = self.game.add_link(n1, n2, 4.0)
l2 = self.game.add_link(n1, n3, 3.0)
l3 = self.game.add_link(n3, n5, 3.0)
l4 = self.game.add_link(n5, n4, 3.0)
l5 = self.game.add_link(n2, g1, 1.0)
l6 = self.game.add_link(n4, g2, 3.0)
l7 = self.game.add_link(n3, g3, 5.0)
self.game.do_replenish_budget()
self.assertEqual(n1.balance, 0)
self.assertEqual(n2.balance, 0)
self.assertEqual(n3.balance, 0)
self.assertEqual(g1.balance, 0)
self.assertEqual(g2.balance, 0)
self.assertEqual(g3.balance, 0)
self.game.network.rank()
self.assertEqual(self.game.get_ranked_nodes(), [ n1, n2, n3, n5, g1, g3, n4, g2 ])
def testGameTransfer50_goal(self):
n1 = self.game.add_policy('Policy 1', leak=0.5)
n2 = self.game.add_policy('Policy 2', leak=0.5)
n3 = self.game.add_policy('Policy 3', leak=0.5)
g1 = self.game.add_goal('Goal 1', leak=0.5)
g2 = self.game.add_goal('Goal 2', leak=0.5)
g3 = self.game.add_goal('Goal 3', leak=0.5)
p1 = self.game.create_player('Matt')
l1 = self.game.add_link(n1, n2, 4.0)
l2 = self.game.add_link(n1, n3, 3.0)
l3 = self.game.add_link(n2, g1, 1.0)
l4 = self.game.add_link(n3, g2, 3.0)
l5 = self.game.add_link(n3, g3, 5.0)
self.game.do_replenish_budget()
self.assertEqual(n1.balance, 0)
self.assertEqual(n2.balance, 0)
self.assertEqual(n3.balance, 0)
self.assertEqual(g1.balance, 0)
self.assertEqual(g2.balance, 0)
self.assertEqual(g3.balance, 0)
for i in range(200):
p1.transfer_funds_to_node(n1, 10)
p1.transfer_funds_to_node(n2, 10)
p1.transfer_funds_to_node(n3, 10)
self.game.do_propogate_funds()
self.assertAlmostEqual(n1.balance, 600.0)
self.assertAlmostEqual(n2.balance, 2600.0)
self.assertAlmostEqual(n3.balance, 1000.0)
self.assertAlmostEqual(g1.balance, 200.0)
self.assertAlmostEqual(g2.balance, 600.0)
self.assertAlmostEqual(g3.balance, 1000.0)
def testSimpleNetwork(self):
p1 = self.game.create_player('Player 1', balance=1000)
po1 = self.game.add_policy('Policy 1')
g1 = self.game.add_goal('Goal 1')
g2 = self.game.add_goal('Goal 2')
l1 = self.game.add_link(po1, g1, 3.0)
l2 = self.game.add_link(po1, g2, 4.0)
p1.transfer_funds_to_node(po1, 10)
self.game.do_propogate_funds()
self.assertAlmostEqual(p1.balance, 990)
self.assertAlmostEqual(g1.balance, 3.0)
self.assertAlmostEqual(g2.balance, 4.0)
def testSimpleNetworkLessThanBalance(self):
p1 = self.game.create_player('Player 1', balance=1000)
po1 = self.game.add_policy('Policy 1')
g1 = self.game.add_goal('Goal 1')
g2 = self.game.add_goal('Goal 2')
l1 = self.game.add_link(po1, g1, 10.0)
l2 = self.game.add_link(po1, g2, 40.0)
p1.transfer_funds_to_node(po1, 10)
self.game.do_propogate_funds()
self.assertAlmostEqual(p1.balance, 990)
self.assertAlmostEqual(g1.balance, 2.0)
self.assertAlmostEqual(g2.balance, 8.0)
def testSimpleNetworkTwoWallets(self):
p1 = self.game.create_player('Player 1', balance=1000)
p2 = self.game.create_player('Player 2', balance=1000)
po1 = self.game.add_policy('Policy 1')
g1 = self.game.add_goal('Goal 1',)
g2 = self.game.add_goal('Goal 2')
l1 = self.game.add_link(po1, g1, 3.0)
l2 = self.game.add_link(po1, g2, 5.0)
p1.transfer_funds_to_node(po1, 10)
p2.transfer_funds_to_node(po1, 30)
self.game.do_propogate_funds()
self.assertAlmostEqual(p1.balance, 990)
self.assertAlmostEqual(p2.balance, 970)
self.assertAlmostEqual(g1.balance, 3.0)
self.assertEqual(g1.wallet_owner_map, {p1.id: 0.75,
p2.id: 2.25})
self.assertAlmostEqual(g2.balance, 5.0)
self.assertEqual(g2.wallet_owner_map, {p1.id: 1.25,
p2.id: 3.75})
def testSimpleNetworkTwoWalletsLessThanBalance(self):
p1 = self.game.create_player('Player 1', balance=1000)
p2 = self.game.create_player('Player 2', balance=1000)
po1 = self.game.add_policy('Policy 1')
g1 = self.game.add_goal('Goal 1')
g2 = self.game.add_goal('Goal 2')
l1 = self.game.add_link(po1, g1, 3.0)
l2 = self.game.add_link(po1, g2, 5.0)
p1.transfer_funds_to_node(po1, 1)
p2.transfer_funds_to_node(po1, 3)
self.assertAlmostEqual(p1.balance, 999)
self.assertAlmostEqual(p2.balance, 997)
self.assertAlmostEqual(po1.balance, 4)
self.game.do_propogate_funds()
self.assertAlmostEqual(g1.balance, 1.5)
self.assertEqual(g1.wallet_owner_map, {p1.id: 0.375,
p2.id: 1.125})
self.assertAlmostEqual(g2.balance, 2.5)
self.assertEqual(g2.wallet_owner_map, {p1.id: 0.625,
p2.id: 1.875})
def testSimplePlayerCoinsNetwork(self):
p1 = self.game.create_player('Matt', balance=1000)
po1 = self.game.add_policy('Arms Embargo', leak=0.1)
self.game.set_policy_funding_for_player(p1, [(po1.id, 50),])
self.assertEqual(p1.balance, 1000)
self.assertEqual(po1.balance, 0)
p1.transfer_funds_to_node(po1, 60)
self.assertEqual(po1.balance, 60)
self.assertEqual(p1.balance, 940)
self.assertEqual(po1.balance, 60)
def testTransferPartialFunds(self):
p1 = self.game.create_player('Matt', balance=1000)
po1 = self.game.add_policy('Arms Embargo')
self.game.set_policy_funding_for_player(p1, [(po1.id, 100.0),])
g1 = self.game.add_goal('World Peace')
l1 = self.game.add_link(po1, g1, 1.0)
self.game.do_propogate_funds()
self.assertEqual(p1.balance, 900)
self.assertEqual(po1.balance, 99.0)
self.assertEqual(g1.balance, 1.0)
def testTransferFullFunds(self):
p1 = self.game.create_player('Matt', balance=1000)
po1 = self.game.add_policy('Arms Embargo', leak=0.1)
self.game.set_policy_funding_for_player(p1, [(po1.id, 100),])
g1 = self.game.add_goal('World Peace', leak=1.0)
l1 = self.game.add_link(po1, g1, 2.0)
self.game.do_propogate_funds()
self.assertEqual(p1.balance, 900)
self.assertEqual(po1.balance, 98.0)
self.assertEqual(g1.balance, 2.0)
def testTransferGreaterThan100_300(self):
p1 = self.game.create_player('Matt', balance=1000)
po1 = self.game.add_policy('Arms Embargo', leak=0.1)
self.game.set_policy_funding_for_player(p1, [(po1.id, 3.0),])
self.assertEqual(p1.balance, 1000)
self.assertEqual(po1.balance, 0)
for x in range(50):
self.game.do_propogate_funds()
self.assertEqual(p1.balance, 850)
self.assertEqual(po1.balance, 150)
def testTransferSlowFunds(self):
p1 = self.game.create_player('Matt', balance=1000)
po1 = self.game.add_policy('Arms Embargo', leak=0.1)
self.game.set_policy_funding_for_player(p1, [(po1.id, 1.0)])
g1 = self.game.add_goal('World Peace', leak=1.0)
l1 = self.game.add_link(po1, g1, 2.0)
self.game.do_propogate_funds()
self.assertEqual(p1.balance, 999)
self.assertEqual(po1.balance, 0.0)
self.assertEqual(g1.balance, 1.0)
self.game.do_propogate_funds()
self.assertEqual(p1.balance, 998)
self.assertEqual(po1.balance, 0.0)
self.assertEqual(g1.balance, 2.0)
self.game.do_propogate_funds()
self.assertEqual(p1.balance, 997)
self.assertEqual(po1.balance, 0.0)
self.assertEqual(g1.balance, 3.0)
self.game.do_propogate_funds()
self.assertEqual(p1.balance, 996)
self.assertEqual(po1.balance, 0.0)
self.assertEqual(g1.balance, 4.0)
self.game.do_propogate_funds()
self.assertEqual(p1.balance, 995)
self.assertEqual(po1.balance, 0.0)
self.assertEqual(g1.balance, 5.0)
def testTransferFastFunds(self):
p1 = self.game.create_player('Matt', balance=1000)
po1 = self.game.add_policy('Arms Embargo', leak=0.1)
self.game.set_policy_funding_for_player(p1, [(po1.id, 3.0),])
g1 = self.game.add_goal('World Peace', leak=1.0)
l1 = self.game.add_link(po1, g1, 1.0)
self.game.do_propogate_funds()
self.assertEqual(p1.balance, 997)
self.assertEqual(po1.balance, 2.0)
self.assertEqual(g1.balance, 1.0)
self.game.do_propogate_funds()
self.assertEqual(p1.balance, 994)
self.assertEqual(po1.balance, 4.0)
self.assertEqual(g1.balance, 2.0)
self.game.do_propogate_funds()
self.assertEqual(p1.balance, 991)
self.assertEqual(po1.balance, 6.0)
self.assertEqual(g1.balance, 3.0)
self.game.do_propogate_funds()
self.assertEqual(p1.balance, 988)
self.assertEqual(po1.balance, 8.0)
self.assertEqual(g1.balance, 4.0)
self.game.do_propogate_funds()
self.assertEqual(p1.balance, 985)
self.assertEqual(po1.balance, 10.0)
self.assertEqual(g1.balance, 5.0)
def testMoreComplexPlayerCoinsNetwork(self):
p1 = self.game.create_player('Matt', balance=1000)
po1 = self.game.add_policy('Arms Embargo')
po2 = self.game.add_policy('Pollution control')
self.game.set_policy_funding_for_player(p1, [(po1.id, 0.5), (po2.id, 1.0)])
g1 = self.game.add_goal('World Peace')
g2 = self.game.add_goal('Clean Water')
l3 = self.game.add_link(po1, g1, 1.0)
l4 = self.game.add_link(po2, g2, 2.0)
self.assertEqual(p1.balance, 1000)
self.assertEqual(po1.balance, 0)
for x in range(100):
self.game.do_propogate_funds()
self.assertEqual(p1.balance, 850)
self.assertEqual(po1.balance, 0)
self.assertEqual(po2.balance, 0)
self.assertEqual(g1.balance, 50)
self.assertEqual(g2.balance, 100)
def testMoreComplexPlayerCoinsNetworkWithFullTick(self):
p1 = self.game.create_player('Matt', balance=5000)
po1 = self.game.add_policy('Arms Embargo', leak=0.1)
po2 = self.game.add_policy('Pollution control', leak=0.1)
self.game.set_policy_funding_for_player(p1, [(po1.id, 10.0), (po2.id, 15.0)])
g1 = self.game.add_goal('World Peace', leak=0.5)
g2 = self.game.add_goal('Clean Water', leak=0.5)
l3 = self.game.add_link(po1, g1, 5.0)
l4 = self.game.add_link(po2, g2, 9.0)
self.assertEqual(p1.balance, 5000)
self.assertEqual(po1.balance, 0)
for x in range(100):
self.game.tick()
self.assertEqual(p1.balance, 2500)
self.assertAlmostEqual(po1.balance, 50, 2)
self.assertAlmostEqual(po2.balance, 60, 2)
self.assertEqual(g1.balance, 10.0)
self.assertEqual(g2.balance, 18.0)
def testTwoPlayersFundAPolicyEqually(self):
p1 = self.game.create_player('Matt', balance=1000)
p2 = self.game.create_player('Simon', balance=1000)
po1 = self.game.add_policy('Arms Embargo', leak=0.1)
self.game.set_policy_funding_for_player(p1, [(po1.id, 1.0),])
self.game.set_policy_funding_for_player(p2, [(po1.id, 1.0),])
self.assertEqual(po1.balance, 0)
for x in range(100):
self.game.do_propogate_funds()
self.assertEqual(p1.balance, 900)
self.assertEqual(p2.balance, 900)
self.assertEqual(po1.balance, 200)
def testActivationLevelLow(self):
p1 = self.game.create_player('Matt', balance=1000)
po1 = self.game.add_policy('Arms Embargo', leak=0.1, activation=0.2)
g1 = self.game.add_goal('World Peace', leak=0.5)
f = self.game.set_policy_funding_for_player(p1, [(po1.id, 5.0),])
l2 = self.game.add_link(po1, g1, 1.0)
self.assertEqual(po1.balance, 0)
for x in range(100):
self.game.do_propogate_funds()
self.assertEqual(p1.balance, 500.0)
self.assertEqual(po1.balance, 500.0)
self.assertEqual(g1.balance, 0)
def testActivationLevelHigh(self):
p1 = self.game.create_player('Matt', balance=10000)
po1 = self.game.add_policy('Arms Embargo', leak=0.1, activation=0.2)
g1 = self.game.add_goal('World Peace', leak=0.5)
f = self.game.set_policy_funding_for_player(p1, [(po1.id, 250.0),])
l2 = self.game.add_link(po1, g1, 1.0)
self.assertEqual(po1.balance, 0)
for x in range(10):
self.game.do_propogate_funds()
self.assertEqual(p1.balance, 7500)
self.assertEqual(po1.balance, 2490)
self.assertEqual(g1.balance, 10)
def testGetBudget(self):
self.add_20_goals_and_policies()
player = self.game.create_player('Matt', balance=1000)
budget = self.game.get_policy_funding_for_player(player)
actual = sorted([ {'policy_id': p, 'amount': amount} for (p,amount) in budget ])
expected = sorted([{'amount': 0.0, 'policy_id': 'P0'},
{'amount': 0.0, 'policy_id': 'P1'},
{'amount': 0.0, 'policy_id': 'P10'},
{'amount': 0.0, 'policy_id': 'P11'},
{'amount': 0.0, 'policy_id': 'P12'}])
self.assertEqual(expected, actual)
def testSetBudget(self):
self.add_20_goals_and_policies()
player = self.game.create_player('Matt', balance=1000)
fundings = [ ('P0', 10),
('P1', 20),
('P2', 30),
]
self.game.set_policy_funding_for_player(player, fundings)
budget = self.game.get_policy_funding_for_player(player)
actual = sorted([ {'policy_id': p, 'amount': amount} for (p,amount) in budget if amount > 0])
expected = sorted([{'amount': 10.0, 'policy_id': 'P0'},
{'amount': 20.0, 'policy_id': 'P1'},
{'amount': 30.0, 'policy_id': 'P2'}])
self.assertEqual(expected, actual)
def testCreateTable(self):
p1 = self.game.create_player('Matt')
p2 = self.game.create_player('Simon')
table = self.game.create_table('table a')
self.assertEqual(list(table.players), [])
self.game.add_player_to_table(p1.id, table.id)
self.assertEqual(list(table.players), [p1.id,])
self.game.add_player_to_table(p2.id, table.id)
self.assertEqual(sorted(list(table.players)), sorted([p1.id,p2.id]))
self.game.remove_player_from_table(p1.id, table.id)
self.assertEqual(list(table.players), [p2.id,])
@unittest.skip("needs fixing after network re-jig")
def testGetNetworkForTable(self):
data = json.load(open('examples/network.json', 'r'))
self.game.create_network(data)
t1 = self.game.create_table('T1')
p1 = self.game.create_player('Matt')
p2 = self.game.create_player('Simon')
p3 = self.game.create_player('Richard')
table_uuid = default_uuid()
self.assertEqual(self.game.get_network_for_table('nonexistant'), None)
table = self.game.get_network_for_table(t1.id)
self.assertEqual(len(table['goals']), 6)
self.assertEqual(len(table['policies']), 30)
t1.players.append(p1)
table = self.game.get_network_for_table(t1.id)
self.assertEqual(len(table['goals']), 1)
self.assertEqual(len(table['policies']), 5)
t1.players.append(p2)
table = self.game.get_network_for_table(t1.id)
self.assertEqual(len(table['goals']), 2)
self.assertEqual(len(table['policies']), 7)
p2.table = None
table = self.game.get_network_for_table(t1.id)
self.assertEqual(len(table['goals']), 1)
self.assertEqual(len(table['policies']), 5)
def testTopPlayers(self):
g1 = self.game.add_goal('G1')
g2 = self.game.add_goal('G2')
po1 = self.game.add_policy('Po1')
po2 = self.game.add_policy('Po2')
self.game.add_link(po1, g1, 100)
self.game.add_link(po2, g2, 100)
p1 = self.game.create_player('Matt', goal_id=g1.id)
p2 = self.game.create_player('Simon', goal_id=g1.id)
p3 = self.game.create_player('Richard', goal_id=g2.id)
self.game.set_policy_funding_for_player(p1, [(po1.id, 10),])
self.game.set_policy_funding_for_player(p2, [(po1.id, 20),(po2.id, 40),])
self.game.set_policy_funding_for_player(p3, [(po2.id, 15),])
self.game.tick()
self.assertEqual(p1.balance, 1499990)
self.assertEqual(p2.balance, 1499940)
self.assertEqual(p3.balance, 1499985)
top = self.game.top_players()
self.assertEqual(top, [p2,p3,p1])
self.game.set_policy_funding_for_player(p1, [(po1.id, 100),])
self.game.tick()
top = self.game.top_players()
self.assertEqual(top, [p1,p2,p3])
def testGoalFunded(self):
g1 = self.game.add_goal('G1')
g2 = self.game.add_goal('G2')
po1 = self.game.add_policy('Po1')
po2 = self.game.add_policy('Po2')
l1 = self.game.add_link(po1, g1, 100)
l2 = self.game.add_link(po2, g2, 100)
p1 = self.game.create_player('Matt', balance=1000, goal_id=g1.id)
self.assertEqual(self.game.goal_funded_by_player(p1.id), 0)
self.game.set_policy_funding_for_player(p1, [(po1.id, 10), (po2.id, 30)])
self.game.tick()
self.assertEqual(p1.balance, 960)
self.assertEqual(self.game.goal_funded_by_player(p1.id), 10)
self.game.tick()
self.assertEqual(p1.balance, 920)
self.assertEqual(self.game.goal_funded_by_player(p1.id), 20)
self.assertEqual(g2.balance, 60)
def testOfferPolicy(self):
p1 = self.game.create_player('Matt')
po1 = self.game.add_policy('Arms Embargo', leak=0.1)
self.game.set_policy_funding_for_player(p1, [(po1.id, 0),])
data = self.game.offer_policy(p1.id, po1.id, 5000)
self.assertEqual(data['seller_id'], p1.id)
self.assertEqual(data['policy_id'], po1.id)
self.assertEqual(data['price'], 5000)
self.assertEqual(len(data['checksum']), 40)
def testBuyPolicy(self):
seller = self.game.create_player('Matt')
buyer = self.game.create_player('Simon')
self.assertEqual(seller.balance, 1500000)
self.assertEqual(buyer.balance, 1500000)
p1 = self.game.add_policy('Policy 1')
self.game.set_policy_funding_for_player(seller, [(p1.id, 0),])
self.assertIn(p1.id, seller.policies)
self.assertNotIn(p1.id, buyer.policies)
offer = self.game.offer_policy(seller.id, p1.id, 20000)
self.game.buy_policy(buyer.id, offer)
self.assertIn(p1.id, buyer.policies)
self.assertIn(p1.id, seller.policies)
self.assertEqual(seller.balance, 1500000+20000)
self.assertEqual(buyer.balance, 1500000-20000)
def testBuyPolicyFailDupe(self):
seller = self.game.create_player('Matt')
buyer = self.game.create_player('Simon')
self.assertEqual(seller.balance, 1500000)
self.assertEqual(buyer.balance, 1500000)
p1 = self.game.add_policy('Policy 1')
self.game.set_policy_funding_for_player(seller, [(p1.id, 0),])
self.game.set_policy_funding_for_player(buyer, [(p1.id, 0),])
self.assertIn(p1.id, seller.policies)
self.assertIn(p1.id, buyer.policies)
offer = self.game.offer_policy(seller.id, p1.id, 20000)
with self.assertRaises(ValueError):
self.game.buy_policy(buyer.id, offer)
self.assertIn(p1.id, buyer.policies)
self.assertIn(p1.id, seller.policies)
self.assertEqual(seller.balance, 1500000)
self.assertEqual(buyer.balance, 1500000)
def testBuyPolicyFailNoFunds(self):
seller = self.game.create_player('Matt')
buyer = self.game.create_player('Simon')
self.assertEqual(seller.balance, 1500000)
self.assertEqual(buyer.balance, 1500000)
p1 = self.game.add_policy('Policy 1')
self.game.set_policy_funding_for_player(seller, [(p1.id, 0),])
self.assertIn(p1.id, seller.policies)
self.assertNotIn(p1.id, buyer.policies)
offer = self.game.offer_policy(seller.id, p1.id, 2000000)
with self.assertRaises(ValueError):
self.game.buy_policy(buyer.id, offer)
self.assertNotIn(p1.id, buyer.policies)
self.assertIn(p1.id, seller.policies)
self.assertEqual(seller.balance, 1500000)
self.assertEqual(buyer.balance, 1500000)
def testBuyPolicyFailNoPolicy(self):
seller = self.game.create_player('Matt')
buyer = self.game.create_player('Simon')
self.assertEqual(seller.balance, 1500000)
self.assertEqual(buyer.balance, 1500000)
p1 = self.game.add_policy('Policy 1')
self.assertNotIn(p1, seller.policies)
self.assertNotIn(p1, buyer.policies)
with self.assertRaises(ValueError):
offer = self.game.offer_policy(seller.id, p1.id, 20000)
self.game.buy_policy(buyer.id, offer)
self.assertNotIn(p1, buyer.policies)
self.assertNotIn(p1, seller.policies)
self.assertEqual(seller.balance, 1500000)
self.assertEqual(buyer.balance, 1500000)
def testGameStartStop(self):
self.assertTrue(self.game.is_running())
year = self.game.stop()
self.assertEqual(year, 2017)
self.assertFalse(self.game.is_running())
def testMessages(self):
messages = tuple(self.game.get_messages())
self.assertEqual(len(messages), 0)
t1 = datetime.now()
m1 = self.game.add_message(t1, "policy", "message 1")
messages = tuple(self.game.get_messages())
self.assertEqual(len(messages), 1)
self.assertEqual(messages[0].timestamp, t1)
self.assertEqual(messages[0].message, "message 1")
self.assertEqual(messages[0].type, "policy")
t2 = datetime.now()
m2 = self.game.add_message(t2, "event", "message 2")
messages = tuple(self.game.get_messages())
self.assertEqual(len(messages), 2)
self.game.clear_messages()
messages = tuple(self.game.get_messages())
self.assertEqual(len(messages), 0)
def testClaimBudget(self):
p1 = self.game.create_player('Matt')
p1.balance = 1000
p1.unclaimed_budget = 1500000
p1.claim_budget()
self.assertEqual(p1.balance, 1500000)
self.assertEqual(p1.unclaimed_budget, 0)
# 2nd claim with no unclaimed budget should do no-op
p1.balance = 1400000
p1.claim_budget()
self.assertEqual(p1.balance, 1400000)
self.assertEqual(p1.unclaimed_budget, 0)
class DataLoadTests(ControllerTestCase):
def testCreateNetwork(self):
json_file = open('examples/example-network.json', 'r')
self.game.create_network(json.load(json_file))
self.assertEqual(80, len(self.game.network.edges))
self.assertEqual(44, len(self.game.network.ranked_nodes))
self.assertEqual(37, len(self.game.network.policies))
self.assertEqual(7, len(self.game.network.goals))
self.assertEqual(80, len(self.game.network.edges))
self.assertEqual(37, len(self.game.network.policies))
self.assertEqual(7, len(self.game.network.goals))
def testGetNetwork(self):
p1 = self.game.create_player('Matt', balance=5000)
po1 = self.game.add_policy('Arms Embargo', leak=0.1)
po2 = self.game.add_policy('Pollution control', leak=0.1)
self.game.set_policy_funding_for_player(p1, [(po1.id, 10.0), (po2.id, 15.0),])
g1 = self.game.add_goal('World Peace', leak=0.5)
g2 = self.game.add_goal('Clean Water', leak=0.5)
g3 = self.game.add_goal('Equal Rights', leak=0.2)
l3 = self.game.add_link(po1, g1, 5.0)
l4 = self.game.add_link(po2, g2, 9.0)
self.assertEqual(p1.balance, 5000)
self.assertEqual(po1.balance, 0)
for x in range(20):
self.game.tick()
network = self.game.get_network()
policies = tuple(network['policies'])
goals = tuple(network['goals'])
self.assertEqual(len(policies), 2)
self.assertEqual(len(goals), 3)
# todo: add more tests here
def testClearNetwork(self):
json_file = open('examples/example-network.json', 'r')
self.game.create_network(json.load(json_file))
n = self.game.network
self.assertEqual(80, len(n.edges))
self.assertEqual(44, len(n.ranked_nodes))
self.assertEqual(37, len(n.policies))
self.assertEqual(7, len(n.goals))
self.game.clear_network()
n = self.game.network
self.assertEqual(0, len(n.edges))
self.assertEqual(0, len(n.ranked_nodes))
self.assertEqual(0, len(n.policies))
self.assertEqual(0, len(n.goals))
def testGetWallets(self):
self.add_20_goals_and_policies()
p1 = self.game.create_player('Matt')
p2 = self.game.create_player('Simon')
new_fundings = []
fundings = self.game.get_policy_funding_for_player(p1)
for i,(p_id,a) in enumerate(fundings):
new_fundings.append((p_id,i))
self.game.set_policy_funding_for_player(p1, new_fundings)
new_fundings = []
fundings = self.game.get_policy_funding_for_player(p2)
for i,(p_id,a) in enumerate(fundings):
new_fundings.append((p_id,i))
self.game.set_policy_funding_for_player(p2, new_fundings)
self.game.network.rank()
self.game.do_propogate_funds()
nodes = [ self.game.network.policies[x] for x in
set(p1.policies.keys() + p2.policies.keys()) ]
wallets = []
for n in nodes:
for player_id,amount in n.wallet.todict().items():
wallets.append(dict(location=n.id,
owner=self.game.get_player(player_id).id,
balance=float("{:.2f}".format(amount))))
expected = [{'owner': p1.id, 'balance': 1.0, 'location': 'P1'},
{'owner': p2.id, 'balance': 1.0, 'location': 'P1'},
{'owner': p1.id, 'balance': 2.0, 'location': 'P10'},
{'owner': p2.id, 'balance': 2.0, 'location': 'P10'},
{'owner': p2.id, 'balance': 3.0, 'location': 'P11'},
{'owner': p1.id, 'balance': 3.0, 'location': 'P11'},
{'owner': p1.id, 'balance': 4.0, 'location': 'P12'},
{'owner': p2.id, 'balance': 4.0, 'location': 'P12'}]
self.assertEqual(sorted(expected), sorted(wallets))
class RestAPITests(ViewTestCase):
def testTick(self):
transaction.commit()
headers = {'X-API-KEY': self.api_key}
response = self.client.put("/v1/game/tick",
headers=headers,
content_type='application/json')
self.assertEquals(response.status_code, 200)
def testPlayerFunding(self):
headers = {'X-API-KEY': self.api_key}
p1 = self.game.create_player('Matt', balance=1000)
p2 = self.game.create_player('Simon', balance=0)
n1 = self.game.add_policy('Policy 1')
n2 = self.game.add_policy('Policy 2')
self.game.set_policy_funding_for_player(p1, [(n1.id, 100), (n2.id, 100),])
self.game.set_policy_funding_for_player(p2, [(n2.id, 200),])
transaction.commit()
# temp unavailable as not computed yet
response = self.client.get("/v1/game/player_fundings",
headers=headers,
content_type='application/json')
self.assertEquals(response.status_code, 200)
response = self.client.put("/v1/game/tick",
headers=headers,
content_type='application/json')
self.assertEquals(response.status_code, 200)
response = self.client.get("/v1/game/player_fundings",
headers=headers,
content_type='application/json')
self.assertEquals(response.status_code, 200)
expected = [{'id': p1.id,
'name': p1.name,
'funding': [{'id': n1.id,
'amount_set': 100,
'amount_actual': 100},
{'id': n2.id,
'amount_set': 100,
'amount_actual': 100,},
]},
{'id': p2.id,
'name': p2.name,
'funding': [{'id': n2.id,
'amount_set': 200,
'amount_actual': 0},
]}
]
self.assertEqual(sorted(expected), sorted(response.json))
def testGetSpecificPlayer(self):
name = 'Matt'
player = self.game.create_player(name)
id = player.id
transaction.commit()
headers = {'X-API-KEY': self.api_key}
response = self.client.get("/v1/players/{}".format(id), headers=headers)
self.assertEquals(response.status_code, 200)
self.assertDictContainsSubset(dict(name=name, id=id), response.json)
self.assertFalse(response.json.has_key('token'))
def testGetNonExistentPlayer(self):
transaction.commit()
headers = {'X-API-KEY': self.api_key}
response = self.client.get("/v1/players/nobody", headers=headers)
self.assertEquals(response.status_code, 404)
def testCreateNewPlayer(self):
data = dict(name='Matt')
transaction.commit()
headers = {'X-API-KEY': self.api_key}
response = self.client.post("/v1/players/", data=json.dumps(data),
headers=headers,
content_type='application/json')
self.assertEquals(response.status_code, 201)
id = response.json['id']
token = response.json['token']
player = self.game.get_player(id)
self.assertEquals(id, player.id)
self.assertEquals(token, player.token)
def testCreateThenGetNewPlayer(self):
transaction.commit()
name = 'Matt {}'.format(time.time())
data = dict(name=name)
headers = {'X-API-KEY': self.api_key}
response = self.client.post("/v1/players/", data=json.dumps(data),
headers=headers,
content_type='application/json')
self.assertEquals(response.status_code, 201)
id = response.json['id']
response = self.client.get("/v1/players/{}".format(id), headers=headers)
self.assertEquals(response.status_code, 200)
self.assertDictContainsSubset(dict(name=name, id=id), response.json)
self.assertFalse(response.json.has_key('token'))
def testCreateThenGetNewPlayerWithNodes(self):
# create some nodes first
self.add_20_goals_and_policies()
transaction.commit()
name = 'Matt {}'.format(time.time())
data = dict(name=name)
headers = {'X-API-KEY': self.api_key}
response = self.client.post("/v1/players/", data=json.dumps(data),
headers=headers,
content_type='application/json')
self.assertEquals(response.status_code, 201)
id = response.json['id']
response = self.client.get("/v1/players/{}".format(id), headers=headers)
self.assertEquals(response.status_code, 200)
self.assertDictContainsSubset(dict(name=name, id=id), response.json)
self.assertEquals(response.json['goal']['id'], 'G0')
policies = response.json['policies']
policies = [ x['id'] for x in policies ]
policies.sort()
self.assertEquals(policies, [u'P0', u'P1', u'P10', u'P11', u'P12'])
self.assertFalse(response.json.has_key('token'))
name = 'Simon {}'.format(time.time())
data = dict(name=name)
response = self.client.post("/v1/players/", data=json.dumps(data),
headers=headers,
content_type='application/json')
self.assertEquals(response.status_code, 201)
id = response.json['id']
response = self.client.get("/v1/players/{}".format(id), headers=headers)
self.assertEquals(response.status_code, 200)
self.assertDictContainsSubset(dict(name=name, id=id), response.json)
self.assertEquals(response.json['goal']['id'], 'G0')
policies = response.json['policies']
policies = [ x['id'] for x in policies ]
policies.sort()
self.assertEquals(policies, [u'P0', u'P1', u'P10', u'P11', u'P12'])
self.assertFalse(response.json.has_key('token'))
@unittest.skip("needs fixing after network re-jig")
def testGetNetwork(self):
p1 = self.game.create_player('Matt')
p1.balance = 5000
po1 = self.game.add_policy('Arms Embargo', 0.1)
self.game.add_fund(p1, po1, 10.0)
po2 = self.game.add_policy('Pollution control', 0.1)
self.game.add_fund(p1, po2, 15.0)
g1 = self.game.add_goal('World Peace', 0.5)
g2 = self.game.add_goal('Clean Water', 0.5)
g3 = self.game.add_goal('Equal Rights', 0.2)
l3 = self.game.add_link(po1, g1, 5.0)
l4 = self.game.add_link(po2, g2, 9.0)
self.assertEqual(p1.balance, 5000)
self.assertEqual(po1.balance, 0)
for x in range(20):
self.game.tick()
headers = {'X-API-KEY': self.api_key}
response = self.client.get("/v1/network/", headers=headers)
self.assertEquals(response.status_code, 200)
self.assertEquals(len(response.json['policies']), 2)
self.assertEquals(len(response.json['goals']), 3)
def testCreateNetwork(self):
data = json.load(open('examples/example-network.json', 'r'))
transaction.commit()
headers = {'X-API-KEY': self.api_key}
response = self.client.post("/v1/network/", data=json.dumps(data),
headers=headers,
content_type='application/json')
self.assertEquals(response.status_code, 201)
self.game.populate()
self.assertEqual(80, len(self.game.network.edges))
self.assertEqual(44, len(self.game.network.ranked_nodes))
self.assertEqual(37, len(self.game.network.policies))
self.assertEqual(7, len(self.game.network.goals))
self.assertEqual(80, len(self.game.network.edges))
self.assertEqual(37, len(self.game.network.policies))
self.assertEqual(7, len(self.game.network.goals))
@unittest.skip("needs fixing after network re-jig")
def testCreateThenGetNetwork(self):
data = json.load(open('examples/example-network.json', 'r'))
headers = {'X-API-KEY': self.api_key}
response = self.client.post("/v1/network/", data=json.dumps(data),
headers=headers,
content_type='application/json')
self.assertEquals(response.status_code, 201)
response = self.client.get("/v1/network/", headers=headers)
self.assertEquals(response.status_code, 200)
self.assertEquals(len(response.json['policies']), 37)
self.assertEquals(len(response.json['goals']), 7)
self.assertEqual(data, response.json)
def testUpdateNetwork(self):
data = json.load(open('examples/example-network.json', 'r'))
self.game.create_network(data)
self.game.tick()
self.assertEqual(80, len(self.game.network.edges))
self.assertEqual(44, len(self.game.network.ranked_nodes))
self.assertEqual(37, len(self.game.network.policies))
self.assertEqual(7, len(self.game.network.goals))
transaction.commit()
headers = {'X-API-KEY': self.api_key}
response = self.client.get("/v1/network/", headers=headers)
self.assertEquals(response.status_code, 200)
self.assertEquals(len(response.json['policies']), 37)
self.assertEquals(len(response.json['goals']), 7)
expected = response.json
e = expected['goals'][0]
e['short_name'] = 'new short name'
e['group'] = 1
e['name'] = 'long name'
e['max_amount'] = 100.0
e['activation_amount'] = 10.0
e['leakage'] = 0.2
id_ = e['id']
response2 = self.client.put("/v1/network/", data=json.dumps(expected),
headers=headers,
content_type='application/json')
self.assertEquals(response2.status_code, 200)
d = { x['id']: x for x in response2.json['goals'] }
self.assertEqual(d[id_]['short_name'], 'new short name')
# remove generation time
del expected['generated']
self.assertEqual(sorted(expected), sorted(response2.json))
def testCreateTable(self):
transaction.commit()
data = {'name': 'Table A'}
headers = {'X-API-KEY': self.api_key}
response = self.client.post("/v1/tables/", data=json.dumps(data),
headers=headers,
content_type='application/json')
self.assertEquals(response.status_code, 201)
self.assertEquals(response.json['name'], 'Table A')
self.assertEquals(response.json['players'], [])
id = response.json['id']
self.assertEquals(self.game.get_table(id).id, id)
def testDeleteTable(self):
table = self.game.create_table('Table A')
id = table.id
transaction.commit()
headers = {'X-API-KEY': self.api_key}
response = self.client.delete("/v1/tables/{}".format(id),
headers=headers,
content_type='application/json')
self.assertEquals(response.status_code, 200)
self.assertEquals(self.game.get_table(id), None)
def testGetTableEmpty(self):
data = json.load(open('examples/example-network.json', 'r'))
self.game.create_network(data)
table = self.game.create_table('Table A')
transaction.commit()
headers = {'X-API-KEY': self.api_key}
response = self.client.get("/v1/tables/{}".format(table.id), headers=headers)
self.assertEquals(response.status_code, 200)
result = response.json
self.assertEquals(result['id'], table.id)
self.assertEquals(result['name'], 'Table A')
self.assertEquals(result['players'], [])
self.assertEquals(len(result['network']['nodes']), 44)
self.assertEquals(len(result['network']['links']), 80)
def testGetTableWithOnePlayer(self):
data = json.load(open('examples/example-network.json', 'r'))
self.game.create_network(data)
p1 = self.game.create_player('Matt')
self.game.set_policy_funding_for_player(p1, [(sorted(p1.policies)[0], 10)],)
table = self.game.create_table('Table A')
self.game.add_player_to_table(p1.id, table.id)
transaction.commit()
headers = {'X-API-KEY': self.api_key}
response = self.client.get("/v1/tables/{}".format(table.id), headers=headers)
self.assertEquals(response.status_code, 200)
result = response.json
self.assertEquals(result['id'], table.id)
self.assertEquals(result['name'], 'Table A')
self.assertEquals(result['players'][0]['name'], 'Matt')
self.assertEquals(len(result['network']['nodes']), 5)
self.assertEquals(len(result['network']['links']), 2)
def testGetTableWithTwoPlayers(self):
data = json.load(open('examples/example-network.json', 'r'))
self.game.create_network(data)
p1 = self.game.create_player('Matt')
p2 = self.game.create_player('Simon')
self.game.set_policy_funding_for_player(p1, [(sorted(p1.policies)[0], 10)],)
self.game.set_policy_funding_for_player(p2, [(sorted(p2.policies)[1], 10)],)
table = self.game.create_table('Table A')
self.game.add_player_to_table(p1.id, table.id)
self.game.add_player_to_table(p2.id, table.id)
transaction.commit()
headers = {'X-API-KEY': self.api_key}
response = self.client.get("/v1/tables/{}".format(table.id), headers=headers)
self.assertEquals(response.status_code, 200)
result = response.json
self.assertEquals(result['id'], table.id)
self.assertEquals(result['name'], 'Table A')
self.assertEquals(sorted(result['players'])[0]['name'], 'Matt')
self.assertEquals(len(result['network']['nodes']), 7)
self.assertEquals(len(result['network']['links']), 3)
def testGetTableChecksum(self):
data = json.load(open('examples/example-network.json', 'r'))
self.game.create_network(data)
p1 = self.game.create_player('Matt')
p2 = self.game.create_player('Simon')
self.game.set_policy_funding_for_player(p1, [(sorted(p1.policies)[0], 10), (sorted(p1.policies)[1], 0)])
self.game.set_policy_funding_for_player(p2, [(sorted(p2.policies)[1], 10), (sorted(p2.policies)[2], 0)])
table = self.game.create_table('Table A')
# table.players.append(p1)
self.game.add_player_to_table(p1.id, table.id)
self.game.tick()
transaction.commit()
headers = {'X-API-KEY': self.api_key}
response = self.client.get("/v1/tables/{}".format(table.id), headers=headers)
self.assertEquals(response.status_code, 200)
result = response.json
chksum1 = result['layout_checksum']
response = self.client.get("/v1/tables/{}".format(table.id), headers=headers)
self.assertEquals(response.status_code, 200)
result = response.json
self.assertEqual(chksum1, result['layout_checksum'])
# p1.policies[0].lower_edges[0].weight = 0.5
fundings = self.game.get_policy_funding_for_player(p1)
fundings = [(fundings[0][0], 0.5), (fundings[1][0], 0)]
self.game.set_policy_funding_for_player(p1, fundings)
response = self.client.get("/v1/tables/{}".format(table.id), headers=headers)
self.assertEquals(response.status_code, 200)
result = response.json
self.assertEqual(chksum1, result['layout_checksum'])
# p1.fund(p1.policies[1], 10)
fundings = self.game.get_policy_funding_for_player(p1)
fundings = [(fundings[0][0], 10), (fundings[1][0], 10)]
self.game.set_policy_funding_for_player(p1, fundings)
self.game.tick()
transaction.commit()
response = self.client.get("/v1/tables/{}".format(table.id), headers=headers)
self.assertEquals(response.status_code, 200)
result = response.json
self.assertNotEqual(chksum1, result['layout_checksum'])
def testGetFunding(self):
self.add_20_goals_and_policies()
name = 'Matt'
player = self.game.create_player(name)
id = player.id
self.game.set_policy_funding_for_player(player, [(p_id,a) for a,p_id in enumerate(player.policies)])
funding = []
for amount,policy in enumerate(player.policies):
funding.append({u'to_id': policy,
u'amount': amount,
u'from_id': id})
transaction.commit()
headers = {'X-USER-KEY': player.token,
'X-API-KEY': self.api_key}
response = self.client.get("/v1/players/{}/funding".format(id),
headers=headers)
self.assertEquals(response.status_code, 200)
self.assertEquals(sorted(funding), sorted(response.json))
def testGetFundingFailAuth(self):
self.add_20_goals_and_policies()
name = 'Matt'
player = self.game.create_player(name)
id = player.id
funding = []
for amount,edge in enumerate(player.lower_edges):
edge.weight = amount
dest_id = edge.higher_node.id
funding.append({'from_id':id, 'to_id': dest_id, 'amount': amount})
headers = {'X-USER-KEY': 'bogus',
'X-API-KEY': self.api_key}
response = self.client.get("/v1/players/{}/funding".format(id),
headers=headers)
self.assertEquals(response.status_code, 401)
def testSetFunding(self):
for x in range(5):
p = self.game.add_policy("P{}".format(x))
name = 'Matt'
player = self.game.create_player(name)
id = player.id
fundings = self.game.get_policy_funding_for_player(player)
self.assertEqual([ amount for (_,amount) in fundings ], [0,0,0,0,0])
new_fundings = [ {"from_id": player.id, "to_id": policy_id, "amount": i} for (i,(policy_id,amount)) in enumerate(fundings) ]
transaction.commit()
headers = {'X-USER-KEY': player.token,
'X-API-KEY': self.api_key}
response = self.client.put("/v1/players/{}/funding".format(id),
data=json.dumps(new_fundings),
headers=headers,
content_type='application/json')
self.assertEquals(response.status_code, 200)
actual = self.game.get_policy_funding_for_player(player)
self.assertEqual([ amount for (_,amount) in actual ], [0,1,2,3,4])
def testSetFundingMaxOverflow(self):
for x in range(5):
p = self.game.add_policy("P{}".format(x))
name = 'Matt'
player = self.game.create_player(name)
id = player.id
fundings = self.game.get_policy_funding_for_player(player)
self.assertEqual([ amount for (_,amount) in fundings ], [0,0,0,0,0])
new_fundings = [ {"from_id": player.id, "to_id": policy_id, "amount": i*200} for (i,(policy_id,amount)) in enumerate(fundings) ]
transaction.commit()
headers = {'X-API-KEY': self.api_key,
'X-USER-KEY': player.token}
response = self.client.put("/v1/players/{}/funding".format(id),
data=json.dumps(new_fundings),
headers=headers,
content_type='application/json')
self.assertEquals(response.status_code, 400)
def testGetWallets(self):
self.add_20_goals_and_policies()
p1 = self.game.create_player('Matt')
p2 = self.game.create_player('Simon')
new_fundings = []
fundings = self.game.get_policy_funding_for_player(p1)
for i,(p_id,a) in enumerate(fundings):
new_fundings.append((p_id,i))
self.game.set_policy_funding_for_player(p1, new_fundings)
new_fundings = []
fundings = self.game.get_policy_funding_for_player(p2)
for i,(p_id,a) in enumerate(fundings):
new_fundings.append((p_id,i))
self.game.set_policy_funding_for_player(p2, new_fundings)
self.game.network.rank()
self.game.do_propogate_funds()
transaction.commit()
wallets = []
nodes = set(p1.policies.keys() + p2.policies.keys())
for n in nodes:
headers = {'X-API-KEY': self.api_key}
response = self.client.get("/v1/network/{}/wallets".format(n), headers=headers)
if response.status_code == 200:
wallets.extend(response.json)
expected = [{'owner': p1.id, 'balance': 1.0, 'location': 'P1'},
{'owner': p2.id, 'balance': 1.0, 'location': 'P1'},
{'owner': p1.id, 'balance': 2.0, 'location': 'P10'},
{'owner': p2.id, 'balance': 2.0, 'location': 'P10'},
{'owner': p2.id, 'balance': 3.0, 'location': 'P11'},
{'owner': p1.id, 'balance': 3.0, 'location': 'P11'},
{'owner': p1.id, 'balance': 4.0, 'location': 'P12'},
{'owner': p2.id, 'balance': 4.0, 'location': 'P12'}]
self.assertEqual(sorted(expected), sorted(wallets))
def testGetNode(self):
n1 = self.game.add_policy('A')
transaction.commit()
headers = {'X-API-KEY': self.api_key}
response = self.client.get("/v1/network/{}".format(n1.id), headers=headers)
self.assertEqual(response.status_code, 200)
self.assertEqual(response.json['id'], n1.id)
self.assertEqual(response.json['name'], 'A')
def testGetOfferDefaultPrice(self):
seller = self.game.create_player('Matt', balance=1500000)
self.assertEqual(seller.balance, 1500000)
p1 = self.game.add_policy('Policy 1')
self.game.set_policy_funding_for_player(seller, [(p1.id, 0),])
self.assertIn(p1.id, seller.policies)
transaction.commit()
headers = {'X-USER-KEY': seller.token,
'X-API-KEY': self.api_key}
response = self.client.get("/v1/players/{}/policies/{}/offer".format(seller.id, p1.id),
headers=headers)
self.assertEqual(response.status_code, 200)
offer = response.json
self.assertEqual(offer['price'], self.game.default_offer_price)
def testGetOfferCustomPrice(self):
seller = self.game.create_player('Matt', balance=1500000)
self.assertEqual(seller.balance, 1500000)
p1 = self.game.add_policy('Policy 1')
self.game.set_policy_funding_for_player(seller, [(p1.id, 0),])
self.assertIn(p1.id, seller.policies)
transaction.commit()
headers = {'X-USER-KEY': seller.token,
'X-API-KEY': self.api_key}
response = self.client.get("/v1/players/{}/policies/{}/offer?price={}".format(seller.id, p1.id, 0),
headers=headers)
self.assertEqual(response.status_code, 200)
offer = response.json
self.assertEqual(offer['price'], 0)
def testBuyPolicy(self):
seller = self.game.create_player('Matt')
buyer = self.game.create_player('Simon')
self.assertEqual(seller.balance, 1500000)
self.assertEqual(buyer.balance, 1500000)
p1 = self.game.add_policy('Policy 1')
self.game.set_policy_funding_for_player(seller, [(p1.id, 0),])
self.assertIn(p1.id, seller.policies)
self.assertNotIn(p1.id, buyer.policies)
transaction.commit()
headers = {'X-USER-KEY': seller.token,
'X-API-KEY': self.api_key}
response = self.client.get("/v1/players/{}/policies/{}/offer".format(seller.id, p1.id),
headers=headers)
self.assertEqual(response.status_code, 200)
offer = response.json
headers = {'X-USER-KEY': buyer.token,
'X-API-KEY': self.api_key}
response = self.client.post("/v1/players/{}/policies/".format(buyer.id),
data=json.dumps(offer),
headers=headers,
content_type='application/json')
self.assertEqual(response.status_code, 200)
self.assertIn(p1.id, buyer.policies)
self.assertIn(p1.id, seller.policies)
self.assertEqual(seller.balance, 1500000+300000)
self.assertEqual(buyer.balance, 1500000-300000)
def testBuyPolicyFail(self):
seller = self.game.create_player('Matt')
buyer = self.game.create_player('Simon', balance=1000)
self.assertEqual(seller.balance, 1500000)
self.assertEqual(buyer.balance, 1000)
p1 = self.game.add_policy('Policy 1')
self.game.set_policy_funding_for_player(seller, [(p1.id, 0),])
self.assertIn(p1.id, seller.policies)
self.assertNotIn(p1.id, buyer.policies)
transaction.commit()
headers = {'X-USER-KEY': seller.token,
'X-API-KEY': self.api_key}
response = self.client.get("/v1/players/{}/policies/{}/offer".format(seller.id, p1.id),
headers=headers)
self.assertEqual(response.status_code, 200)
offer = response.json
headers = {'X-USER-KEY': buyer.token,
'X-API-KEY': self.api_key}
response = self.client.post("/v1/players/{}/policies/".format(buyer.id),
data=json.dumps(offer),
headers=headers,
content_type='application/json')
self.assertEqual(response.status_code, 400)
self.assertNotIn(p1.id, buyer.policies)
self.assertIn(p1.id, seller.policies)
self.assertEqual(seller.balance, 1500000)
self.assertEqual(buyer.balance, 1000)
def testLeagueTable(self):
g1 = self.game.add_goal('G1')
g2 = self.game.add_goal('G2')
p1 = self.game.create_player('Matt', goal_id=g1.id)
p2 = self.game.create_player('Simon', goal_id=g1.id)
p3 = self.game.create_player('Richard', goal_id=g2.id)
po1 = self.game.add_policy('po1')
po2 = self.game.add_policy('po2')
self.game.add_link(po1, g1, 100)
self.game.add_link(po2, g2, 100)
self.game.set_policy_funding_for_player(p1, [(po1.id, 10),])
self.game.set_policy_funding_for_player(p2, [(po1.id, 20),])
self.game.set_policy_funding_for_player(p3, [(po2.id, 15),])
self.game.tick()
self.assertEqual(p1.balance, 1499990)
self.assertEqual(p2.balance, 1499980)
self.assertEqual(p3.balance, 1499985)
# p1.calc_goal_funded()
# p2.calc_goal_funded()
# p3.calc_goal_funded()
transaction.commit()
headers = {'X-API-KEY': self.api_key}
response = self.client.get("/v1/game/league_table", headers=headers)
self.assertEqual(response.status_code, 200)
expected = {'rows': [{'id': p2.id,
'name': p2.name,
'goal': 'G1',
'goal_total': '30.00',
'goal_contribution': '20.00',},
{'id': p3.id,
'name': p3.name,
'goal': 'G2',
'goal_total': '15.00',
'goal_contribution': '15.00',},
{'id': p1.id,
'name': p1.name,
'goal': 'G1',
'goal_total': '30.00',
'goal_contribution': '10.00',}
]}
self.assertEqual(response.json, expected)
def testAddPlayerToTable(self):
p1 = self.game.create_player('Matt')
table = self.game.create_table('Table A')
self.assertNotIn(p1, table.players)
transaction.commit()
headers = {'X-USER-KEY': p1.token,
'X-API-KEY': self.api_key}
response = self.client.put("/v1/players/{}/table/{}".format(p1.id, table.id),
headers=headers,
content_type='application/json')
self.assertEquals(response.status_code, 200)
self.assertIn(p1.id, table.players)
def testAddPlayerToNonexistantTable(self):
p1 = self.game.create_player('Matt')
table = self.game.create_table('Table A')
self.assertNotIn(p1, table.players)
transaction.commit()
headers = {'X-USER-KEY': p1.token,
'X-API-KEY': self.api_key}
response = self.client.put("/v1/players/{}/table/{}".format(p1.id, 'bogus'),
headers=headers,
content_type='application/json')
self.assertEquals(response.status_code, 404)
self.assertNotIn(p1, table.players)
def testAddNonexistantPlayerToTable(self):
p1 = self.game.create_player('Matt')
table = self.game.create_table('Table A')
self.assertNotIn(p1, table.players)
transaction.commit()
headers = {'X-USER-KEY': p1.token,
'X-API-KEY': self.api_key}
response = self.client.put("/v1/players/{}/table/{}".format('bogus', table.id),
headers=headers,
content_type='application/json')
self.assertEquals(response.status_code, 404)
self.assertNotIn(p1, table.players)
def testRemovePlayerFromTable(self):
p1 = self.game.create_player('Matt')
table = self.game.create_table('Table A')
self.game.add_player_to_table(p1.id, table.id)
self.assertIn(p1.id, table.players)
transaction.commit()
headers = {'X-USER-KEY': p1.token,
'X-API-KEY': self.api_key}
response = self.client.delete("/v1/players/{}/table/{}".format(p1.id, table.id),
headers=headers,
content_type='application/json')
self.assertEquals(response.status_code, 200)
self.assertNotIn(p1.id, tuple(table.players))
def testRemoveAllPlayersFromTable(self):
p1 = self.game.create_player('Matt')
p2 = self.game.create_player('Simon')
table = self.game.create_table('Table A')
self.game.add_player_to_table(p1.id, table.id)
self.game.add_player_to_table(p2.id, table.id)
self.assertIn(p1.id, table.players)
self.assertIn(p2.id, table.players)
transaction.commit()
headers = {'X-USER-KEY': p1.token,
'X-API-KEY': self.api_key}
response = self.client.put("/v1/tables/{}/clear".format(table.id),
headers=headers,
content_type='application/json')
self.assertEquals(response.status_code, 200)
self.assertEquals(tuple(table.players), ())
self.assertEquals(p1.table_id, None)
self.assertEquals(p2.table_id, None)
def testSetMessages(self):
transaction.commit()
headers = {'X-API-KEY': self.api_key}
data = {'budgets': [{'time': '2017-02-22T12:50:00',
'message': 'message 1',
},
{'time': '2017-02-22T12:51:00Z',
'message': 'message 2',
}],
'events': [{'time': '2017-02-22T13:50:00',
'message': 'message 3',
},
{'time': '2017-02-22T13:51:00',
'message': 'message 4',
}],
}
response = self.client.put("/v1/game/messages",
headers=headers,
data=json.dumps(data),
content_type='application/json')
self.assertEquals(response.status_code, 200)
messages = self.game.get_messages()
self.assertEqual(len(tuple(messages)), 4)
def testGetMessages(self):
t1 = datetime(2017,02,22,12,50)
m1 = self.game.add_message(t1, "budget", "message 1")
t2 = datetime(2017,02,22,13,50)
m2 = self.game.add_message(t2, "event", "message 2")
transaction.commit()
headers = {'X-API-KEY': self.api_key}
response = self.client.get("/v1/game/messages", headers=headers)
self.assertEqual(response.status_code, 200)
expected = {'budgets': [{'time': '2017-02-22T12:50:00Z',
'message': 'message 1'}
],
'events': [{'time': '2017-02-22T13:50:00Z',
'message': 'message 2'},
],
}
self.assertEqual(sorted(response.json.items()), sorted(expected.items()))
def testClaimBudget(self):
p1 = self.game.create_player('Matt', balance=1000, unclaimed_budget=1500000)
transaction.commit()
headers = {'X-USER-KEY': p1.token,
'X-API-KEY': self.api_key}
response = self.client.put("/v1/players/{}/claim_budget".format(p1.id),
headers=headers,
content_type='application/json')
self.assertEqual(response.status_code, 200)
self.assertEqual(p1.balance, 1500000)
self.assertEqual(p1.unclaimed_budget, 0)
# 2nd claim with no unclaimed budget should do no-op
p1.balance = 1400000
transaction.commit()
headers = {'X-USER-KEY': p1.token,
'X-API-KEY': self.api_key}
response = self.client.put("/v1/players/{}/claim_budget".format(p1.id),
headers=headers,
content_type='application/json')
self.assertEqual(response.status_code, 200)
self.assertEqual(p1.balance, 1400000)
self.assertEqual(p1.unclaimed_budget, 0)
def testGetGameMetadata(self):
transaction.commit()
headers = {'X-API-KEY': self.api_key}
response = self.client.get("/v1/game",
headers=headers,
content_type='application/json')
self.assertEqual(response.status_code, 200)
data = response.json
self.assertEqual(data['game_year'], 2017)
game_year_start = dateutil.parser.parse(data['game_year_start']).replace(tzinfo=None)
self.assertLess((datetime.now() - game_year_start).seconds, 5)
self.assertEqual(data['next_game_year'], 2018)
next_game_year_start = dateutil.parser.parse(data['next_game_year_start']).replace(tzinfo=None)
self.assertEqual(next_game_year_start - game_year_start, timedelta(minutes=75))
self.assertEqual(data['version'], APP_VERSION)
self.assertEqual(data['total_players_inflow'], 0.0)
self.assertEqual(data['budget_per_cycle'], 1500000.0)
self.assertEqual(data['max_spend_per_tick'], 1000)
def testMissingAPIKey(self):
response = self.client.get("/v1/game",
content_type='application/json')
self.assertEqual(response.status_code, 401)
def testBadAPIKey(self):
headers = {'X-API-KEY': "boguskey"}
response = self.client.get("/v1/game",
headers=headers,
content_type='application/json')
self.assertEqual(response.status_code, 401)
class NetworkTests(ModelTestCase):
def testPlayerFunding(self):
p1 = Player.new('Matt', balance=1000)
p2 = Player.new('Simon', balance=0)
n1 = Policy.new('Policy 1')
n2 = Policy.new('Policy 2')
p1.policies = {n1.id: 100, n2.id: 100}
p2.policies = {n2.id: 200}
policies = [n1, n2]
players = [p1, p2]
network = Network(policies, [], [], players)
self.assertEqual(p1.balance, 1000)
self.assertEqual(p2.balance, 0)
network.fund_network()
self.assertEqual(p1.balance, 800)
self.assertEqual(p2.balance, 0)
def testPolicyGoalPropogation(self):
n1 = Policy.new('Policy 1', balance=100)
g1 = Goal.new('Goal 1')
e1 = Edge.new(n1, g1, 1.0)
policies = [n1,]
goals = [g1,]
edges = [e1,]
network = Network(policies, goals, edges, [])
self.assertEqual(n1.balance, 100)
self.assertEqual(g1.balance, 0)
network.propagate()
self.assertEqual(n1.balance, 99)
self.assertEqual(g1.balance, 1)
def testAddWalletToPolicy(self):
po1 = Policy.new('Arms Embargo')
p1 = Player.new('Matt')
w1 = Wallet([(p1.id, 100)])
po1.wallet = w1
self.assertIn(p1.id, w1.todict())
self.assertEqual(po1.wallet, w1)
def testNodeActivationFromPlayer(self):
p1 = Player.new('Matt', balance=1000)
po1 = Policy.new('Policy 1', activation=0.2)
self.assertFalse(po1.active)
self.assertAlmostEqual(po1.active_level, 0)
p1.policies = {po1: 200.0}
policies = [po1,]
players = [p1,]
network = Network(policies, [], [], players)
self.assertFalse(po1.active)
network.propagate()
self.assertTrue(po1.active)
if __name__ == '__main__':
unittest.main()
| 35.969973
| 136
| 0.595613
| 11,926
| 94,637
| 4.602801
| 0.046872
| 0.092544
| 0.041681
| 0.047729
| 0.809174
| 0.757328
| 0.729346
| 0.687993
| 0.665331
| 0.635582
| 0
| 0.058834
| 0.265425
| 94,637
| 2,630
| 137
| 35.98365
| 0.730789
| 0.005843
| 0
| 0.608741
| 0
| 0
| 0.068287
| 0.009179
| 0
| 0
| 0
| 0.00038
| 0.30911
| 0
| null | null | 0.00158
| 0.008425
| null | null | 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
1d7466097245fe0f589e9cc748e16317321ada97
| 48
|
py
|
Python
|
tests/conftest.py
|
jonra1993/rasa-sdk
|
2fe9e16a54e709166c7a1eba1d46bd6228e5ea6b
|
[
"Apache-2.0"
] | 172
|
2019-05-14T19:34:55.000Z
|
2022-03-25T04:34:20.000Z
|
tests/conftest.py
|
jonra1993/rasa-sdk
|
2fe9e16a54e709166c7a1eba1d46bd6228e5ea6b
|
[
"Apache-2.0"
] | 451
|
2019-05-13T15:29:38.000Z
|
2022-03-28T09:00:52.000Z
|
tests/conftest.py
|
jonra1993/rasa-sdk
|
2fe9e16a54e709166c7a1eba1d46bd6228e5ea6b
|
[
"Apache-2.0"
] | 160
|
2019-05-16T05:05:48.000Z
|
2022-03-25T04:34:24.000Z
|
from sanic import Sanic
Sanic.test_mode = True
| 12
| 23
| 0.791667
| 8
| 48
| 4.625
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.166667
| 48
| 3
| 24
| 16
| 0.925
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
1d86bc38917264012599c7189b3e1f9a968ddcaa
| 46
|
py
|
Python
|
scripts/example.py
|
fernandascovino/FGV_Criptography
|
9fbc9bb5f1bd4099538be112565e4ac3fffc62c1
|
[
"MIT"
] | 1
|
2018-10-03T16:17:14.000Z
|
2018-10-03T16:17:14.000Z
|
scripts/example.py
|
JoaoCarabetta/cities-science
|
ee430d75bd0abb04485926a6f30fb23992b3f598
|
[
"MIT"
] | null | null | null |
scripts/example.py
|
JoaoCarabetta/cities-science
|
ee430d75bd0abb04485926a6f30fb23992b3f598
|
[
"MIT"
] | null | null | null |
import scripts.other_module as om
om.get_me()
| 15.333333
| 33
| 0.804348
| 9
| 46
| 3.888889
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.108696
| 46
| 3
| 34
| 15.333333
| 0.853659
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
1d8ed043ae4252f0d1547399b9aa09ae4c55b2e4
| 82
|
py
|
Python
|
meinheld/__init__.py
|
IPetrik/meinheld
|
1253ad7edf2febaa0b644db3953650c70bc6c234
|
[
"BSD-3-Clause"
] | null | null | null |
meinheld/__init__.py
|
IPetrik/meinheld
|
1253ad7edf2febaa0b644db3953650c70bc6c234
|
[
"BSD-3-Clause"
] | null | null | null |
meinheld/__init__.py
|
IPetrik/meinheld
|
1253ad7edf2febaa0b644db3953650c70bc6c234
|
[
"BSD-3-Clause"
] | null | null | null |
from meinheld.server import *
from meinheld import mlogging
__version__ = '1.0.1'
| 20.5
| 29
| 0.780488
| 12
| 82
| 5
| 0.666667
| 0.4
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.042254
| 0.134146
| 82
| 3
| 30
| 27.333333
| 0.802817
| 0
| 0
| 0
| 0
| 0
| 0.060976
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
1d96409b70dfd29939216befd660664abf857a96
| 135
|
py
|
Python
|
src/fintrist_ds/__init__.py
|
tristanbrown/fintrist
|
38875e4f2c3ab4db31195c798c4262a2f51e4a22
|
[
"MIT"
] | null | null | null |
src/fintrist_ds/__init__.py
|
tristanbrown/fintrist
|
38875e4f2c3ab4db31195c798c4262a2f51e4a22
|
[
"MIT"
] | null | null | null |
src/fintrist_ds/__init__.py
|
tristanbrown/fintrist
|
38875e4f2c3ab4db31195c798c4262a2f51e4a22
|
[
"MIT"
] | 1
|
2022-01-21T21:10:38.000Z
|
2022-01-21T21:10:38.000Z
|
"""
Import all of the processing functions.
"""
from .engine import *
from .manage import *
from .services import *
from .viz import *
| 16.875
| 39
| 0.711111
| 18
| 135
| 5.333333
| 0.611111
| 0.3125
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.177778
| 135
| 7
| 40
| 19.285714
| 0.864865
| 0.288889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
1d96e779fc8d314da75088210a5bba32a3719d6f
| 43
|
py
|
Python
|
tests/tasks/secrets/__init__.py
|
concreted/prefect
|
dd732f5990ee2b0f3d816adb285168fd63b239e4
|
[
"Apache-2.0"
] | 8,633
|
2019-03-23T17:51:03.000Z
|
2022-03-31T22:17:42.000Z
|
tests/tasks/secrets/__init__.py
|
concreted/prefect
|
dd732f5990ee2b0f3d816adb285168fd63b239e4
|
[
"Apache-2.0"
] | 3,903
|
2019-03-23T19:11:21.000Z
|
2022-03-31T23:21:23.000Z
|
tests/tasks/secrets/__init__.py
|
concreted/prefect
|
dd732f5990ee2b0f3d816adb285168fd63b239e4
|
[
"Apache-2.0"
] | 937
|
2019-03-23T18:49:44.000Z
|
2022-03-31T21:45:13.000Z
|
import pytest
pytest.importorskip("hvac")
| 10.75
| 27
| 0.790698
| 5
| 43
| 6.8
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.093023
| 43
| 3
| 28
| 14.333333
| 0.871795
| 0
| 0
| 0
| 0
| 0
| 0.093023
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
1d9bc600cb86c39242efe33e2263b3b50c5a51bf
| 230
|
py
|
Python
|
apps/tg_bot/urls.py
|
VladimirLazor/Lohika
|
a36407feeb2e3ade4f8c689030f343d88ff47a92
|
[
"Apache-2.0"
] | null | null | null |
apps/tg_bot/urls.py
|
VladimirLazor/Lohika
|
a36407feeb2e3ade4f8c689030f343d88ff47a92
|
[
"Apache-2.0"
] | 9
|
2021-03-19T15:59:10.000Z
|
2022-03-12T00:57:56.000Z
|
apps/tg_bot/urls.py
|
VladimirLazor/Lohika
|
a36407feeb2e3ade4f8c689030f343d88ff47a92
|
[
"Apache-2.0"
] | null | null | null |
from django.urls import path
from django.views.decorators.csrf import csrf_exempt
from config.settings import TG_WEB_HOOK_URL
from .views import tg_web_hook
urlpatterns = [
path(TG_WEB_HOOK_URL, csrf_exempt(tg_web_hook)),
]
| 23
| 52
| 0.813043
| 38
| 230
| 4.605263
| 0.421053
| 0.114286
| 0.205714
| 0.171429
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.121739
| 230
| 9
| 53
| 25.555556
| 0.866337
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.571429
| 0
| 0.571429
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
1da6ecd7cf81d6949311f2c3cbbf6ad20aecc35c
| 164
|
py
|
Python
|
deepa2/metrics/__init__.py
|
debatelab/deepa2
|
1a9e8c357d7e3924808c703ec9f4a6611a4b5f93
|
[
"Apache-2.0"
] | null | null | null |
deepa2/metrics/__init__.py
|
debatelab/deepa2
|
1a9e8c357d7e3924808c703ec9f4a6611a4b5f93
|
[
"Apache-2.0"
] | null | null | null |
deepa2/metrics/__init__.py
|
debatelab/deepa2
|
1a9e8c357d7e3924808c703ec9f4a6611a4b5f93
|
[
"Apache-2.0"
] | null | null | null |
"""Classes for evaluating generated DeepA2 records"""
# flake8: noqa
# pylint: skip-file
from deepa2.metrics.metric_handler import (
DA2PredictionEvaluator,
)
| 20.5
| 53
| 0.762195
| 18
| 164
| 6.888889
| 0.944444
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.028369
| 0.140244
| 164
| 7
| 54
| 23.428571
| 0.851064
| 0.481707
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
d52947496bda3409d71bc7bd9fc3a5aeeb797a0a
| 202
|
py
|
Python
|
locomotive/models/__init__.py
|
maxmouchet/sncf-cli
|
841a6a941630a3f460d566f50118881fff542034
|
[
"MIT"
] | 22
|
2020-05-20T23:56:26.000Z
|
2022-01-29T01:13:29.000Z
|
locomotive/models/__init__.py
|
maxmouchet/sncf-cli
|
841a6a941630a3f460d566f50118881fff542034
|
[
"MIT"
] | 8
|
2019-06-10T08:27:38.000Z
|
2020-01-30T14:12:10.000Z
|
locomotive/models/__init__.py
|
maxmouchet/sncf-cli
|
841a6a941630a3f460d566f50118881fff542034
|
[
"MIT"
] | null | null | null |
"""
Models shared between locomotive modules.
"""
from .board import BoardEntry
from .journey import Journey, Proposal, Segment, Transport
from .passenger import Passenger
from .station import Station
| 22.444444
| 58
| 0.79703
| 24
| 202
| 6.708333
| 0.625
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.133663
| 202
| 8
| 59
| 25.25
| 0.92
| 0.20297
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.25
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
|
0
| 5
|
d56088b13e056734a3376fd9aad22a5e70b7c4da
| 8,223
|
py
|
Python
|
uos3/configUp/migrations/0001_initial.py
|
aliaksei135/telecommand-server
|
eb6f23f03ff75a18a5115f3038bb4d4192594627
|
[
"MIT"
] | null | null | null |
uos3/configUp/migrations/0001_initial.py
|
aliaksei135/telecommand-server
|
eb6f23f03ff75a18a5115f3038bb4d4192594627
|
[
"MIT"
] | null | null | null |
uos3/configUp/migrations/0001_initial.py
|
aliaksei135/telecommand-server
|
eb6f23f03ff75a18a5115f3038bb4d4192594627
|
[
"MIT"
] | 1
|
2020-04-22T20:39:49.000Z
|
2020-04-22T20:39:49.000Z
|
# Generated by Django 2.2.6 on 2019-11-01 18:25
import datetime
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='config',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('date_submitted', models.DateTimeField(auto_now_add=True)),
('date_modified', models.DateTimeField(auto_now=True)),
('user_submitted', models.CharField(default='uos3', editable=False, max_length=64)),
('confirmed_uplink', models.BooleanField(default=False, editable=False)),
('date_uplink',
models.DateTimeField(blank=True, default=datetime.datetime(1970, 1, 1, 0, 0), editable=False)),
('tx_enable', models.BooleanField(choices=[(0, 'Off'), (1, 'On')], default=True)),
('tx_interval', models.PositiveSmallIntegerField(
validators=[django.core.validators.MinValueValidator(0),
django.core.validators.MaxValueValidator(255)])),
('tx_interval_downlink', models.IntegerField(choices=[(0, '0 ms'), (50, '500 ms'), (60, '600 ms'), (70, '700 ms'), (80, '800 ms'), (90, '900 ms'), (100, '1000 ms'), (150, '1500 ms'), (200, '2000 ms')])),
('tx_datarate', models.IntegerField(choices=[(0, '0.25 kbps'), (3, '0.5 kbps'), (6, '1 kbps'), (9, '3 kbps'), (12, '6 kbps')])),
('tx_power', models.IntegerField(choices=[(0, '10 mW'), (3, '50 mW'), (6, '100 mW'), (9, '200 mW'), (12, '300 mW')])),
('batt_overtemp', models.PositiveSmallIntegerField(
validators=[django.core.validators.MinValueValidator(0),
django.core.validators.MaxValueValidator(255)])),
('obc_overtemp', models.PositiveSmallIntegerField(
validators=[django.core.validators.MinValueValidator(0),
django.core.validators.MaxValueValidator(255)])),
('pa_overtemp', models.PositiveSmallIntegerField(
validators=[django.core.validators.MinValueValidator(0),
django.core.validators.MaxValueValidator(255)])),
('low_voltage_threshold', models.FloatField(validators=[django.core.validators.MinValueValidator(0),
django.core.validators.MaxValueValidator(
25.5)])),
('low_voltage_recovery', models.FloatField(validators=[django.core.validators.MinValueValidator(0),
django.core.validators.MaxValueValidator(
25.5)])),
('eps_health_acquisition_interval', models.PositiveIntegerField(
validators=[django.core.validators.MinValueValidator(0),
django.core.validators.MaxValueValidator(65535)])),
('check_health_acquisition_interval', models.PositiveIntegerField(
validators=[django.core.validators.MinValueValidator(0),
django.core.validators.MaxValueValidator(65535)])),
('imu_acquisition_interval', models.PositiveIntegerField(
validators=[django.core.validators.MinValueValidator(0),
django.core.validators.MaxValueValidator(65535)])),
('imu_sample_count', models.PositiveSmallIntegerField(
validators=[django.core.validators.MinValueValidator(0),
django.core.validators.MaxValueValidator(16)])),
('imu_sample_interval', models.PositiveSmallIntegerField(
validators=[django.core.validators.MinValueValidator(10),
django.core.validators.MaxValueValidator(2550)])),
('imu_gyro_bandwidth', models.IntegerField(
choices=[(0, '5Hz'), (1, '10Hz'), (2, '20Hz'), (3, '41Hz'), (4, '92Hz'), (5, '184Hz'), (6, '250Hz'),
(7, '3600Hz')])),
('imu_gyro_measurement_range',
models.IntegerField(choices=[(0, '+250dps'), (1, '+500dps'), (2, '+1000dps'), (3, '+2000dps')])),
('gps_acquisition_interval', models.PositiveIntegerField(
validators=[django.core.validators.MinValueValidator(0),
django.core.validators.MaxValueValidator(65535)])),
('gps_sample_count', models.PositiveSmallIntegerField(
validators=[django.core.validators.MinValueValidator(0),
django.core.validators.MaxValueValidator(16)])),
('gps_sample_interval', models.PositiveSmallIntegerField(
validators=[django.core.validators.MinValueValidator(10),
django.core.validators.MaxValueValidator(2550)])),
('image_acquisition_profile', models.IntegerField(choices=[(0, '1600x1200'), (1, '640x480')])),
('power_rail_1', models.IntegerField(choices=[(0, 'Off'), (1, 'On')], default=True)),
('power_rail_3', models.IntegerField(choices=[(0, 'Off'), (1, 'On')], default=True)),
('power_rail_5', models.IntegerField(choices=[(0, 'Off'), (1, 'On')], default=True)),
('power_rail_6', models.IntegerField(choices=[(0, 'Off'), (1, 'On')], default=True)),
('imu_accel_enabled', models.IntegerField(choices=[(0, 'Off'), (1, 'On')], default=False)),
('imu_gyro_enabled', models.IntegerField(choices=[(0, 'Off'), (1, 'On')], default=False)),
('imu_magno_enabled', models.IntegerField(choices=[(0, 'Off'), (1, 'On')], default=False)),
('silent_flag', models.BooleanField(choices=[(0, 'Off'), (1, 'On')], default=False)),
('time', models.BigIntegerField(validators=[django.core.validators.MinValueValidator(0),
django.core.validators.MaxValueValidator(4294967295)])),
('operational_mode', models.IntegerField(choices=[(0, 'Deployment Phases'), (1, 'Nominal Operations'), (3, 'Safe Mode')])),
('self_test', models.IntegerField(choices=[(0, 'Off'), (1, 'On')], default=False)),
('reset_power_rail_1', models.IntegerField(choices=[(0, 'Off'), (1, 'On')], default=False)),
('reset_power_rail_2', models.IntegerField(choices=[(0, 'Off'), (1, 'On')], default=False)),
('reset_power_rail_3', models.IntegerField(choices=[(0, 'Off'), (1, 'On')], default=False)),
('reset_power_rail_4', models.IntegerField(choices=[(0, 'Off'), (1, 'On')], default=False)),
('reset_power_rail_5', models.IntegerField(choices=[(0, 'Off'), (1, 'On')], default=False)),
('reset_power_rail_6', models.IntegerField(choices=[(0, 'Off'), (1, 'On')], default=False)),
('telemetry_go_silent', models.PositiveSmallIntegerField(
validators=[django.core.validators.MinValueValidator(0),
django.core.validators.MaxValueValidator(32768)])),
('downlink_stop_time', models.BigIntegerField(validators=[django.core.validators.MinValueValidator(0),
django.core.validators.MaxValueValidator(
4294967295)])),
('image_acquisition_time', models.BigIntegerField(
validators=[django.core.validators.MinValueValidator(0),
django.core.validators.MaxValueValidator(4294967295)])),
],
),
]
| 75.440367
| 219
| 0.548705
| 718
| 8,223
| 6.157382
| 0.225627
| 0.083691
| 0.167383
| 0.123501
| 0.720651
| 0.708437
| 0.708437
| 0.706401
| 0.686949
| 0.684913
| 0
| 0.055333
| 0.301107
| 8,223
| 108
| 220
| 76.138889
| 0.713938
| 0.005472
| 0
| 0.33
| 1
| 0
| 0.134173
| 0.025196
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.03
| 0
| 0.07
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
d573e4185d520f3b0945c93a25dc8a1b391318cd
| 51
|
py
|
Python
|
unsplash_get/__init__.py
|
streanger/unsplash_get
|
9de91c973fb9c449db9795fdd83cae7843f6f1e8
|
[
"MIT"
] | 3
|
2020-07-23T11:33:31.000Z
|
2020-08-31T23:06:56.000Z
|
unsplash_get/__init__.py
|
streanger/unsplash_get
|
9de91c973fb9c449db9795fdd83cae7843f6f1e8
|
[
"MIT"
] | null | null | null |
unsplash_get/__init__.py
|
streanger/unsplash_get
|
9de91c973fb9c449db9795fdd83cae7843f6f1e8
|
[
"MIT"
] | null | null | null |
from .unsplash_get import save_img, search, example
| 51
| 51
| 0.843137
| 8
| 51
| 5.125
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.098039
| 51
| 1
| 51
| 51
| 0.891304
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
d57a504252f56e17f3bbc279ef28f03c57999728
| 45
|
py
|
Python
|
platform/core/polyaxon/libs/repos/git/exceptions.py
|
hackerwins/polyaxon
|
ff56a098283ca872abfbaae6ba8abba479ffa394
|
[
"Apache-2.0"
] | null | null | null |
platform/core/polyaxon/libs/repos/git/exceptions.py
|
hackerwins/polyaxon
|
ff56a098283ca872abfbaae6ba8abba479ffa394
|
[
"Apache-2.0"
] | null | null | null |
platform/core/polyaxon/libs/repos/git/exceptions.py
|
hackerwins/polyaxon
|
ff56a098283ca872abfbaae6ba8abba479ffa394
|
[
"Apache-2.0"
] | null | null | null |
class GitCloneException(Exception):
pass
| 15
| 35
| 0.777778
| 4
| 45
| 8.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.155556
| 45
| 2
| 36
| 22.5
| 0.921053
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
63483a1b74f7107fb533b7c581ef3d45942dcd1a
| 310
|
py
|
Python
|
src/dolphindb/month.py
|
premprabhat/api-python-cpp
|
8543c91ba6b0ea26e07dd27e9a0f6a8654384a03
|
[
"Apache-2.0"
] | 1
|
2021-08-28T04:02:12.000Z
|
2021-08-28T04:02:12.000Z
|
src/dolphindb/month.py
|
premprabhat/api-python-cpp
|
8543c91ba6b0ea26e07dd27e9a0f6a8654384a03
|
[
"Apache-2.0"
] | null | null | null |
src/dolphindb/month.py
|
premprabhat/api-python-cpp
|
8543c91ba6b0ea26e07dd27e9a0f6a8654384a03
|
[
"Apache-2.0"
] | 1
|
2022-01-27T11:11:12.000Z
|
2022-01-27T11:11:12.000Z
|
class month(object):
def __init__(self, year=None, month = None):
self.__year = year
self.__month = month
def __str__(self):
if self.__month > 9:
return str(self.__year) + '-' + str(self.__month) + 'M'
return str(self.__year) + '-0' + str(self.__month) + 'M'
| 38.75
| 67
| 0.564516
| 40
| 310
| 3.825
| 0.35
| 0.228758
| 0.169935
| 0.222222
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.008969
| 0.280645
| 310
| 8
| 68
| 38.75
| 0.67713
| 0
| 0
| 0
| 0
| 0
| 0.016077
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0
| 0
| 0.625
| 0
| 0
| 0
| 0
| null | 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 5
|
6349f6b9df91ef831b4fab9e98c2dfc2a30fb406
| 50
|
py
|
Python
|
jellyConnect/__init_.py
|
jay4842/jellyDatabaseConnector
|
6d5528db245e25b2d4ef19148337635596703145
|
[
"MIT"
] | null | null | null |
jellyConnect/__init_.py
|
jay4842/jellyDatabaseConnector
|
6d5528db245e25b2d4ef19148337635596703145
|
[
"MIT"
] | null | null | null |
jellyConnect/__init_.py
|
jay4842/jellyDatabaseConnector
|
6d5528db245e25b2d4ef19148337635596703145
|
[
"MIT"
] | null | null | null |
from connection import *
from queryEngine import *
| 25
| 25
| 0.82
| 6
| 50
| 6.833333
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.14
| 50
| 2
| 25
| 25
| 0.953488
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
63579a88721e0d3e200a379d5e13ea6f5c821b4d
| 27
|
py
|
Python
|
mp_sort/virtenv/lib/python3.6/site-packages/transcrypt/development/automated_tests/transcrypt/div_issues/issue55/sub1.py
|
ang-jason/fip_powerx_mini_projects-foxtrot
|
37e3671969b516369e2d1c7cab5890b75c489f56
|
[
"MIT"
] | 2,200
|
2016-10-12T16:47:13.000Z
|
2022-03-30T16:40:35.000Z
|
mp_sort/virtenv/lib/python3.6/site-packages/transcrypt/development/automated_tests/transcrypt/div_issues/issue55/sub1.py
|
ang-jason/fip_powerx_mini_projects-foxtrot
|
37e3671969b516369e2d1c7cab5890b75c489f56
|
[
"MIT"
] | 672
|
2016-10-12T16:36:48.000Z
|
2022-03-25T00:57:04.000Z
|
mp_sort/virtenv/lib/python3.6/site-packages/transcrypt/development/automated_tests/transcrypt/div_issues/issue55/sub1.py
|
ang-jason/fip_powerx_mini_projects-foxtrot
|
37e3671969b516369e2d1c7cab5890b75c489f56
|
[
"MIT"
] | 230
|
2016-10-20T14:31:40.000Z
|
2022-03-16T15:57:15.000Z
|
p = 'p'
q = 'q'
r = 'r'
| 6.75
| 8
| 0.222222
| 6
| 27
| 1
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.444444
| 27
| 3
| 9
| 9
| 0.4
| 0
| 0
| 0
| 0
| 0
| 0.125
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 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
| 5
|
6363782e48bd5eaedc0c8edeecafa798bb0dc04d
| 94
|
py
|
Python
|
heronpy/connectors/textfiles/__init__.py
|
ajorgensen/heron
|
6430c51a4a6030e93018e0ed40e5936a64317636
|
[
"Apache-2.0"
] | 2
|
2016-07-04T07:10:31.000Z
|
2018-03-28T16:59:02.000Z
|
heronpy/connectors/textfiles/__init__.py
|
ajorgensen/heron
|
6430c51a4a6030e93018e0ed40e5936a64317636
|
[
"Apache-2.0"
] | null | null | null |
heronpy/connectors/textfiles/__init__.py
|
ajorgensen/heron
|
6430c51a4a6030e93018e0ed40e5936a64317636
|
[
"Apache-2.0"
] | 1
|
2017-06-05T17:55:45.000Z
|
2017-06-05T17:55:45.000Z
|
'''module for textfiles connectors'''
__import__('pkg_resources').declare_namespace(__name__)
| 31.333333
| 55
| 0.808511
| 10
| 94
| 6.6
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.053191
| 94
| 2
| 56
| 47
| 0.741573
| 0.329787
| 0
| 0
| 0
| 0
| 0.22807
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
63872bec7ad482c58ec938d8ed3b9e283f7be51a
| 135
|
py
|
Python
|
core/__init__.py
|
david-wm-sanders/oeo
|
1ce26ddcd83d957183eefaae508c2a6800d47e94
|
[
"MIT"
] | 1
|
2019-07-28T04:40:16.000Z
|
2019-07-28T04:40:16.000Z
|
core/__init__.py
|
david-wm-sanders/oeo
|
1ce26ddcd83d957183eefaae508c2a6800d47e94
|
[
"MIT"
] | null | null | null |
core/__init__.py
|
david-wm-sanders/oeo
|
1ce26ddcd83d957183eefaae508c2a6800d47e94
|
[
"MIT"
] | null | null | null |
from .oeo import Oeo
from .element import Element
from .stats import Stats
from .move import Move, MoveCategory
from .item import Item
| 22.5
| 36
| 0.8
| 21
| 135
| 5.142857
| 0.380952
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.155556
| 135
| 5
| 37
| 27
| 0.947368
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
638fa7d83e983c9f58b992517e42b211927ac9d7
| 101
|
py
|
Python
|
smaland/totp.py
|
emilwareus/smaland
|
b455199b072c84bcf6d576c92fc18004e0cbe60b
|
[
"MIT"
] | 3
|
2020-03-15T21:07:48.000Z
|
2021-03-15T20:37:39.000Z
|
smaland/totp.py
|
emilwareus/smaland
|
b455199b072c84bcf6d576c92fc18004e0cbe60b
|
[
"MIT"
] | null | null | null |
smaland/totp.py
|
emilwareus/smaland
|
b455199b072c84bcf6d576c92fc18004e0cbe60b
|
[
"MIT"
] | 1
|
2020-04-05T08:17:14.000Z
|
2020-04-05T08:17:14.000Z
|
import os
import pyotp
def totp(secret):
totp = pyotp.TOTP(secret)
return totp.now()
| 10.1
| 29
| 0.633663
| 14
| 101
| 4.571429
| 0.571429
| 0.3125
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.267327
| 101
| 9
| 30
| 11.222222
| 0.864865
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0.4
| 0
| 0.8
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
892c1c86b81f563a72783ae080f4de286ab23459
| 100
|
py
|
Python
|
gym_invaders/ai_invader/model/__init__.py
|
Jh123x/Orbital
|
6f8f2da4fd26ef1d77c0c6183230c3a5e6bf0bb9
|
[
"MIT"
] | 4
|
2020-05-15T11:17:09.000Z
|
2020-06-30T01:11:41.000Z
|
gym_invaders/ai_invader/model/__init__.py
|
Jh123x/Orbital
|
6f8f2da4fd26ef1d77c0c6183230c3a5e6bf0bb9
|
[
"MIT"
] | 10
|
2020-05-16T10:45:32.000Z
|
2020-07-27T07:17:02.000Z
|
gym_invaders/ai_invader/model/__init__.py
|
Jh123x/Orbital
|
6f8f2da4fd26ef1d77c0c6183230c3a5e6bf0bb9
|
[
"MIT"
] | null | null | null |
from .basemodel import BaseModel
from .dqncnn import DQNCNN
from .evolutionary import EvolutionaryAI
| 33.333333
| 40
| 0.86
| 12
| 100
| 7.166667
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.11
| 100
| 3
| 40
| 33.333333
| 0.966292
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
89993688fedbe2f0628f63817147515cb76bd3bd
| 165
|
py
|
Python
|
rick_db/__init__.py
|
oddbit-project/rick_db
|
02910c071f3ad58fdd88b2a27bfdd2bc61497d42
|
[
"MIT"
] | null | null | null |
rick_db/__init__.py
|
oddbit-project/rick_db
|
02910c071f3ad58fdd88b2a27bfdd2bc61497d42
|
[
"MIT"
] | null | null | null |
rick_db/__init__.py
|
oddbit-project/rick_db
|
02910c071f3ad58fdd88b2a27bfdd2bc61497d42
|
[
"MIT"
] | null | null | null |
from .version import get_version
from .mapper import Record, fieldmapper, RecordError
from .repository import Repository, RepositoryError
from .dbgrid import DbGrid
| 33
| 52
| 0.842424
| 20
| 165
| 6.9
| 0.55
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.115152
| 165
| 4
| 53
| 41.25
| 0.945205
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
899e83412ff2fa1525c82aac7177cf47f340579c
| 295
|
py
|
Python
|
deepr/config/__init__.py
|
Mbompr/deepr
|
1fb28e15aeeac6ef2d8e5b678feb380f2b1951f2
|
[
"Apache-2.0"
] | null | null | null |
deepr/config/__init__.py
|
Mbompr/deepr
|
1fb28e15aeeac6ef2d8e5b678feb380f2b1951f2
|
[
"Apache-2.0"
] | null | null | null |
deepr/config/__init__.py
|
Mbompr/deepr
|
1fb28e15aeeac6ef2d8e5b678feb380f2b1951f2
|
[
"Apache-2.0"
] | null | null | null |
# pylint: disable=unused-import,missing-docstring
from deepr.config.base import parse_config, from_config
from deepr.config.macros import ismacro, fill_macros, find_macro_params, assert_no_macros
from deepr.config.references import isreference, fill_references
import deepr.config.experimental
| 42.142857
| 89
| 0.857627
| 41
| 295
| 5.97561
| 0.536585
| 0.179592
| 0.183673
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.077966
| 295
| 6
| 90
| 49.166667
| 0.900735
| 0.159322
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.25
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
89b1f8a6a9a4624639e3d660ae0e8c94693d43c4
| 117
|
py
|
Python
|
loopsAndFunctions/function.py
|
Oritsegbubemi/python-backend
|
bfd2d9c5ed13829317feb64edecf4bf17fc5f937
|
[
"Apache-2.0"
] | null | null | null |
loopsAndFunctions/function.py
|
Oritsegbubemi/python-backend
|
bfd2d9c5ed13829317feb64edecf4bf17fc5f937
|
[
"Apache-2.0"
] | null | null | null |
loopsAndFunctions/function.py
|
Oritsegbubemi/python-backend
|
bfd2d9c5ed13829317feb64edecf4bf17fc5f937
|
[
"Apache-2.0"
] | null | null | null |
def textRepeater(name):
return name + ' called something inside a function \n'
print(textRepeater('Seyi') * 4)
| 19.5
| 58
| 0.700855
| 15
| 117
| 5.466667
| 0.866667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.010417
| 0.179487
| 117
| 5
| 59
| 23.4
| 0.84375
| 0
| 0
| 0
| 0
| 0
| 0.358974
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0.333333
| 0.666667
| 0.333333
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
986fc1135486d171a1e649556cb3989527131ad3
| 133
|
py
|
Python
|
tests/regularizedtau/__init__.py
|
TukisTukis/linvpy
|
471fb8b456af3bf22ced5e8fe1ec0fbbad8a08c8
|
[
"BSD-2-Clause"
] | 16
|
2016-10-18T03:36:47.000Z
|
2020-03-02T08:01:21.000Z
|
tests/regularizedtau/__init__.py
|
TukisTukis/linvpy
|
471fb8b456af3bf22ced5e8fe1ec0fbbad8a08c8
|
[
"BSD-2-Clause"
] | 3
|
2016-10-18T03:37:19.000Z
|
2019-01-24T13:02:28.000Z
|
tests/regularizedtau/__init__.py
|
TukisTukis/linvpy
|
471fb8b456af3bf22ced5e8fe1ec0fbbad8a08c8
|
[
"BSD-2-Clause"
] | 4
|
2017-04-07T07:03:55.000Z
|
2020-07-17T03:40:10.000Z
|
# __all__ = ['linvpy_latest', 'toolboxutilities_latest', 'toolboxinverse_latest']
# in your __init__.py
from regularizedtau import *
| 33.25
| 81
| 0.781955
| 14
| 133
| 6.642857
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.105263
| 133
| 4
| 82
| 33.25
| 0.781513
| 0.744361
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
9882fd7a26e84caf45194e8eb71a993e438a8861
| 149
|
py
|
Python
|
abm/abm/agents/__init__.py
|
giacrava/sbp-adoption-abm
|
18f683caac8aa0efecfcce18598305b1670b6dba
|
[
"MIT"
] | null | null | null |
abm/abm/agents/__init__.py
|
giacrava/sbp-adoption-abm
|
18f683caac8aa0efecfcce18598305b1670b6dba
|
[
"MIT"
] | null | null | null |
abm/abm/agents/__init__.py
|
giacrava/sbp-adoption-abm
|
18f683caac8aa0efecfcce18598305b1670b6dba
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
from .municipality import Municipality
from .government import Government
from .environment import MunicipalityEnvironment
| 21.285714
| 48
| 0.791946
| 15
| 149
| 7.866667
| 0.6
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.007692
| 0.127517
| 149
| 6
| 49
| 24.833333
| 0.9
| 0.14094
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
989c00ae5a2652cb4f51a767565665fceecf4f71
| 105
|
py
|
Python
|
nmmis/contrib/place/admin.py
|
mgrsantox/nmmis
|
77f5bc0907c4fa7babe177a07ea144c2ac8b2eca
|
[
"BSD-2-Clause"
] | null | null | null |
nmmis/contrib/place/admin.py
|
mgrsantox/nmmis
|
77f5bc0907c4fa7babe177a07ea144c2ac8b2eca
|
[
"BSD-2-Clause"
] | null | null | null |
nmmis/contrib/place/admin.py
|
mgrsantox/nmmis
|
77f5bc0907c4fa7babe177a07ea144c2ac8b2eca
|
[
"BSD-2-Clause"
] | null | null | null |
from django.contrib import admin
from nmmis.contrib.place.models import Place
admin.site.register(Place)
| 26.25
| 44
| 0.838095
| 16
| 105
| 5.5
| 0.625
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.085714
| 105
| 4
| 45
| 26.25
| 0.916667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
98ae7cc0bf9eb0897447c4658aa679311159c417
| 13,723
|
py
|
Python
|
mpitest/test_par_doe.py
|
naylor-b/OpenMDAO1
|
49d82f6601b33db9bdcf7d146d030d55e3b62ef4
|
[
"Apache-2.0"
] | 17
|
2018-01-11T20:13:59.000Z
|
2022-03-22T03:46:05.000Z
|
mpitest/test_par_doe.py
|
naylor-b/OpenMDAO1
|
49d82f6601b33db9bdcf7d146d030d55e3b62ef4
|
[
"Apache-2.0"
] | 6
|
2017-10-19T23:14:14.000Z
|
2020-11-22T17:30:57.000Z
|
mpitest/test_par_doe.py
|
naylor-b/OpenMDAO1
|
49d82f6601b33db9bdcf7d146d030d55e3b62ef4
|
[
"Apache-2.0"
] | 10
|
2018-04-12T22:13:33.000Z
|
2020-05-07T10:02:59.000Z
|
#!/usr/bin/env python
""" Running DOE experiments (in parallel)"""
from __future__ import print_function
import sys
import time
import traceback
import numpy as np
import unittest
from openmdao.api import IndepVarComp, Component, Group, Problem, \
FullFactorialDriver, AnalysisError
from openmdao.test.exec_comp_for_test import ExecComp4Test
from openmdao.core.mpi_wrap import MPI, debug, MultiProcFailCheck
from openmdao.test.mpi_util import MPITestCase
if MPI: # pragma: no cover
# if you called this script with 'mpirun', then use the petsc data passing
from openmdao.core.petsc_impl import PetscImpl as impl
else:
# if you didn't use `mpirun`, then use the numpy data passing
from openmdao.api import BasicImpl as impl
class ParallelDOETestCase(MPITestCase):
N_PROCS = 4
def test_doe(self):
problem = Problem(impl=impl)
root = problem.root = Group()
root.add('indep_var', IndepVarComp('x', val=1.0))
root.add('const', IndepVarComp('c', val=2.0))
root.add('mult', ExecComp4Test("y=c*x"))
root.connect('indep_var.x', 'mult.x')
root.connect('const.c', 'mult.c')
num_levels = 25
problem.driver = FullFactorialDriver(num_levels=num_levels,
num_par_doe=self.N_PROCS)
problem.driver.options['auto_add_response'] = True
problem.driver.add_desvar('indep_var.x',
lower=1.0, upper=float(num_levels))
problem.driver.add_objective('mult.y')
problem.setup(check=False)
problem.run()
num_cases = 0
for responses, success, msg in problem.driver.get_responses():
responses = dict(responses)
self.assertEqual(responses['indep_var.x']*2.0,
responses['mult.y'])
num_cases += 1
if MPI:
lens = problem.comm.allgather(num_cases)
self.assertEqual(sum(lens), num_levels)
else:
self.assertEqual(num_cases, num_levels)
def test_doe_fail_hard(self):
problem = Problem(impl=impl)
root = problem.root = Group()
root.add('indep_var', IndepVarComp('x', val=1.0))
root.add('const', IndepVarComp('c', val=2.0))
if MPI:
fail_rank = 1 # raise exception from this rank
npardoe = self.N_PROCS
else:
fail_rank = 0
npardoe = 1
root.add('mult', ExecComp4Test("y=c*x", fail_rank=fail_rank,
fails=[3], fail_hard=True))
root.connect('indep_var.x', 'mult.x')
root.connect('const.c', 'mult.c')
num_levels = 25
problem.driver = FullFactorialDriver(num_levels=num_levels,
num_par_doe=npardoe)
problem.driver.options['auto_add_response'] = True
problem.driver.add_desvar('indep_var.x',
lower=1.0, upper=float(num_levels))
problem.driver.add_objective('mult.y')
problem.setup(check=False)
try:
problem.run()
except Exception as err:
with MultiProcFailCheck(self.comm):
if self.comm.rank == fail_rank:
self.assertEqual(str(err), "OMG, a critical error!")
else:
self.assertEqual(str(err),
"an exception was raised by another MPI process.")
else:
if MPI:
self.fail('exception expected')
nsucc = 0
nfail = 0
num_cases = 0
for responses, success, msg in problem.driver.get_responses():
responses = dict(responses)
num_cases += 1
if success:
self.assertEqual(responses['indep_var.x']*2.0,
responses['mult.y'])
nsucc += 1
else:
nfail += 1
self.assertEqual(nfail, 0) # hard errors aren't saved
if MPI:
lens = problem.comm.allgather(num_cases)
self.assertEqual(sum(lens), 12)
else:
self.assertTrue(num_cases < num_levels)
def test_doe_fail_analysis_error(self):
problem = Problem(impl=impl)
root = problem.root = Group()
root.add('indep_var', IndepVarComp('x', val=1.0))
root.add('const', IndepVarComp('c', val=2.0))
if MPI:
fail_rank = 1 # raise exception from this rank
npardoe = self.N_PROCS
else:
fail_rank = 0
npardoe = 1
root.add('mult', ExecComp4Test("y=c*x", fail_rank=fail_rank,
fails=[3,4]))
root.connect('indep_var.x', 'mult.x')
root.connect('const.c', 'mult.c')
num_levels = 25
problem.driver = FullFactorialDriver(num_levels=num_levels,
num_par_doe=npardoe)
problem.driver.options['auto_add_response'] = True
problem.driver.add_desvar('indep_var.x',
lower=1.0, upper=float(num_levels))
problem.driver.add_objective('mult.y')
problem.driver.add_response('mult.case_rank')
problem.setup(check=False)
problem.run()
fails_in_fail_rank = 0
nfails = 0
num_cases = 0
for responses, success, msg in problem.driver.get_responses():
responses = dict(responses)
num_cases += 1
if success:
self.assertEqual(responses['indep_var.x']*2.0,
responses['mult.y'])
else:
nfails += 1
if responses['mult.case_rank'] == fail_rank:
fails_in_fail_rank += 1
if MPI:
lens = problem.comm.allgather(num_cases)
self.assertEqual(sum(lens), 25)
if self.comm.rank == 0:
self.assertEqual(fails_in_fail_rank, 2)
self.assertEqual(nfails, 2)
else:
self.assertEqual(num_cases, 25)
self.assertEqual(nfails, 2)
class LBParallelDOETestCase(MPITestCase):
N_PROCS = 5
def test_load_balanced_doe(self):
problem = Problem(impl=impl)
root = problem.root = Group()
root.add('indep_var', IndepVarComp('x', val=1.0))
root.add('const', IndepVarComp('c', val=2.0))
root.add('mult', ExecComp4Test("y=c*x"))
root.connect('indep_var.x', 'mult.x')
root.connect('const.c', 'mult.c')
num_levels = 25
problem.driver = FullFactorialDriver(num_levels=num_levels,
num_par_doe=self.N_PROCS,
load_balance=True)
problem.driver.options['auto_add_response'] = True
problem.driver.add_desvar('indep_var.x',
lower=1.0, upper=float(num_levels))
problem.driver.add_objective('mult.y')
problem.setup(check=False)
problem.run()
num_cases = 0
for responses, success, msg in problem.driver.get_responses():
responses = dict(responses)
num_cases += 1
if success:
self.assertEqual(responses['indep_var.x']*2.0,
responses['mult.y'])
if MPI:
lens = problem.comm.allgather(num_cases)
self.assertEqual(sum(lens), num_levels)
else:
self.assertEqual(num_cases, num_levels)
def test_load_balanced_doe_crit_fail(self):
if MPI is None:
raise unittest.SkipTest("Can't run this test (even in serial) without mpi4py and petsc4py")
problem = Problem(impl=impl)
root = problem.root = Group()
root.add('indep_var', IndepVarComp('x', val=1.0))
root.add('const', IndepVarComp('c', val=2.0))
fail_rank = 1 # raise exception from this rank
root.add('mult', ExecComp4Test("y=c*x", fail_rank=fail_rank,
fails=[1], fail_hard=True))
root.connect('indep_var.x', 'mult.x')
root.connect('const.c', 'mult.c')
num_levels = 25
problem.driver = FullFactorialDriver(num_levels=num_levels,
num_par_doe=self.N_PROCS,
load_balance=True)
problem.driver.options['auto_add_response'] = True
problem.driver.add_desvar('indep_var.x',
lower=1.0, upper=float(num_levels))
problem.driver.add_objective('mult.y')
problem.setup(check=False)
problem.run()
nsucc = 0
nfail = 0
num_cases = 0
for responses, success, msg in problem.driver.get_responses():
responses = dict(responses)
num_cases += 1
if success:
self.assertEqual(responses['indep_var.x']*2.0,
responses['mult.y'])
nsucc += 1
else:
nfail += 1
# in load balanced mode, we can't really predict how many cases
# will actually run before we terminate, so just check to see if
# we at least have less than the full set we'd have if nothing
# went wrong.
if MPI:
lens = problem.comm.allgather(num_cases)
self.assertTrue(sum(lens) < num_levels,
"Cases run (%d) should be less than total cases (%d)" %
(sum(lens), num_levels))
else:
self.assertTrue(num_cases < num_levels)
self.assertEqual(nfail, 0) # hard failure cases are not saved
def test_load_balanced_doe_soft_fail(self):
problem = Problem(impl=impl)
root = problem.root = Group()
root.add('indep_var', IndepVarComp('x', val=1.0))
root.add('const', IndepVarComp('c', val=2.0))
if MPI:
fail_rank = 1 # raise exception from this rank
else:
fail_rank = 0
fail_idxs = [3,4,5]
root.add('mult', ExecComp4Test("y=c*x", fail_rank=fail_rank,
fails=fail_idxs))
root.connect('indep_var.x', 'mult.x')
root.connect('const.c', 'mult.c')
num_levels = 25
problem.driver = FullFactorialDriver(num_levels=num_levels,
num_par_doe=self.N_PROCS,
load_balance=True)
problem.driver.options['auto_add_response'] = True
problem.driver.add_desvar('indep_var.x',
lower=1.0, upper=float(num_levels))
problem.driver.add_objective('mult.y')
problem.driver.add_response('mult.case_rank')
problem.setup(check=False)
problem.run()
nfails = 0
num_cases = 0
cases_in_fail_rank = 0
for responses, success, msg in problem.driver.get_responses():
responses = dict(responses)
num_cases += 1
if success:
self.assertEqual(responses['indep_var.x']*2.0,
responses['mult.y'])
else:
nfails += 1
if responses['mult.case_rank'] == fail_rank:
cases_in_fail_rank += 1
if MPI and self.comm.rank > 0:
self.assertEqual(num_cases, 0)
else:
self.assertEqual(num_cases, num_levels)
if self.comm.rank == 0:
# FIXME: for now, all cases get sent back to the master process (0),
# even when recorders are parallel.
# there's a chance that the fail rank didn't get enough
# cases to actually fail 3 times, so we need to check
# how many cases it actually got.
if cases_in_fail_rank > 5:
self.assertEqual(nfails, 3)
elif cases_in_fail_rank > 4:
self.assertEqual(nfails, 2)
elif cases_in_fail_rank > 3:
self.assertEqual(nfails, 1)
else:
self.assertEqual(nfails, 0)
else:
self.assertEqual(nfails, 0)
class LBParallelDOETestCase6(MPITestCase):
N_PROCS = 6
def test_load_balanced_doe(self):
problem = Problem(impl=impl)
root = problem.root = Group()
root.add('indep_var', IndepVarComp('x', val=1.0))
root.add('const', IndepVarComp('c', val=2.0))
root.add('mult', ExecComp4Test("y=c*x"))
root.connect('indep_var.x', 'mult.x')
root.connect('const.c', 'mult.c')
num_levels = 25
problem.driver = FullFactorialDriver(num_levels=num_levels,
num_par_doe=self.N_PROCS,
load_balance=True)
problem.driver.options['auto_add_response'] = True
problem.driver.add_desvar('indep_var.x',
lower=1.0, upper=float(num_levels))
problem.driver.add_objective('mult.y')
problem.setup(check=False)
problem.run()
num_cases = 0
for responses, success, msg in problem.driver.get_responses():
responses = dict(responses)
num_cases += 1
self.assertEqual(responses['indep_var.x']*2.0,
responses['mult.y'])
if MPI:
lens = problem.comm.allgather(num_cases)
self.assertEqual(sum(lens), num_levels)
else:
self.assertEqual(num_cases, num_levels)
if __name__ == '__main__':
from openmdao.test.mpi_util import mpirun_tests
mpirun_tests()
| 34.221945
| 103
| 0.55345
| 1,627
| 13,723
| 4.510756
| 0.133989
| 0.047827
| 0.025753
| 0.020984
| 0.762638
| 0.7298
| 0.708543
| 0.701322
| 0.685925
| 0.680338
| 0
| 0.017133
| 0.340742
| 13,723
| 400
| 104
| 34.3075
| 0.794075
| 0.060264
| 0
| 0.800654
| 0
| 0
| 0.078316
| 0
| 0
| 0
| 0
| 0.0025
| 0.107843
| 1
| 0.022876
| false
| 0
| 0.042484
| 0
| 0.084967
| 0.003268
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
98b13a41184605b434409c1a6321ec30bf1c9205
| 133
|
py
|
Python
|
review_request/admin.py
|
Portfolio-APPS/web-app
|
57dc3243fc17d1429f30b9337e2633197505671c
|
[
"MIT"
] | 4
|
2019-10-09T19:12:46.000Z
|
2021-07-10T10:59:33.000Z
|
review_request/admin.py
|
Portfolio-APPS/web-app
|
57dc3243fc17d1429f30b9337e2633197505671c
|
[
"MIT"
] | 7
|
2020-06-05T18:11:24.000Z
|
2022-03-11T23:20:15.000Z
|
review_request/admin.py
|
Portfolio-APPS/web-app
|
57dc3243fc17d1429f30b9337e2633197505671c
|
[
"MIT"
] | 1
|
2018-11-19T17:07:38.000Z
|
2018-11-19T17:07:38.000Z
|
from django.contrib import admin
from .models import ReviewRequest
# Register your models here.
admin.site.register(ReviewRequest)
| 19
| 34
| 0.819549
| 17
| 133
| 6.411765
| 0.647059
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.120301
| 133
| 6
| 35
| 22.166667
| 0.931624
| 0.195489
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.