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
c7bdc00a703f9d9365f1e0cb6268d0db5ac49f6b
884
py
Python
api/serializers.py
VsevolodOn/eventManager
4bbdbd1d377710b09a6b260cbbab0507475be586
[ "MIT" ]
null
null
null
api/serializers.py
VsevolodOn/eventManager
4bbdbd1d377710b09a6b260cbbab0507475be586
[ "MIT" ]
null
null
null
api/serializers.py
VsevolodOn/eventManager
4bbdbd1d377710b09a6b260cbbab0507475be586
[ "MIT" ]
null
null
null
from rest_framework import serializers from django.contrib.auth.models import User from core.models import * class UserSerializer(serializers.ModelSerializer): class Meta: model = User fields = ['first_name', 'email', 'password'] class TypeEventSerializer(serializers.ModelSerializer): class Meta: model = TypeEvent fields = ['id', 'Name'] class TypeVisitorSerializer(serializers.ModelSerializer): class Meta: model = TypeVisitor fields = ['id', 'Name'] class EventSerializer(serializers.ModelSerializer): class Meta: model = Event fields = ['id', 'name', 'startDate', 'endDate', 'address', 'type', 'description'] class VisitorSerializer(serializers.ModelSerializer): class Meta: model = Visitor fields = ['id', 'event', 'arrivalDate', 'fullName', 'type']
25.257143
67
0.653846
81
884
7.111111
0.45679
0.225694
0.269097
0.303819
0.347222
0
0
0
0
0
0
0
0.230769
884
34
68
26
0.847059
0
0
0.291667
0
0
0.123303
0
0
0
0
0
0
1
0
false
0.041667
0.125
0
0.541667
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
4
c7f678956cb37f4291bb343c8e35f557dda42a76
152
py
Python
generate_report/urls.py
amandabezerra/2018.1-Cardinals
cedaf7c9771eda6b25c35fdf722fa25e5c832114
[ "MIT" ]
5
2018-03-26T15:27:01.000Z
2018-06-21T21:28:09.000Z
generate_report/urls.py
fga-eps-mds/2018.1-Cardinals
cedaf7c9771eda6b25c35fdf722fa25e5c832114
[ "MIT" ]
135
2018-03-22T16:22:29.000Z
2018-06-29T20:55:28.000Z
generate_report/urls.py
amandabezerra/2018.1-Cardinals
cedaf7c9771eda6b25c35fdf722fa25e5c832114
[ "MIT" ]
11
2018-03-23T23:56:49.000Z
2018-07-03T15:12:04.000Z
from django.urls import path from generate_report import views urlpatterns = [ path('pdf_view/<int:repo_id>/', views.pdf_view, name='pdf_view'), ]
21.714286
69
0.736842
23
152
4.652174
0.652174
0.196262
0
0
0
0
0
0
0
0
0
0
0.131579
152
6
70
25.333333
0.810606
0
0
0
1
0
0.203947
0.151316
0
0
0
0
0
1
0
false
0
0.4
0
0.4
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
1bfae6aef617e36538ca5315fc1ec9902e20b581
213
py
Python
app/demo/relations/apps.py
frankhood/django-material-admin
ea384bdf8ebcc59532fcb605519a8e9362e96414
[ "MIT" ]
270
2018-09-14T07:55:04.000Z
2022-03-31T13:12:41.000Z
app/demo/relations/apps.py
frankhood/django-material-admin
ea384bdf8ebcc59532fcb605519a8e9362e96414
[ "MIT" ]
107
2019-03-26T20:35:23.000Z
2022-03-15T15:34:38.000Z
app/demo/relations/apps.py
frankhood/django-material-admin
ea384bdf8ebcc59532fcb605519a8e9362e96414
[ "MIT" ]
66
2018-11-05T13:07:14.000Z
2022-03-31T17:17:22.000Z
from django.apps import AppConfig from django.utils.translation import ugettext_lazy as _ class RelationsConfig(AppConfig): name = 'demo.relations' icon_name = 'layers' verbose_name = _('Relations')
23.666667
55
0.751174
25
213
6.2
0.72
0.129032
0
0
0
0
0
0
0
0
0
0
0.164319
213
8
56
26.625
0.870787
0
0
0
0
0
0.13615
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
401c8ab428d6a57788d77eb09e037053930d4dc9
174
py
Python
xstripe/views.py
ajharry69/django-xpay
ebfe09ffa615293dbea6b6d8e1ffd65f8d283d15
[ "Apache-2.0" ]
null
null
null
xstripe/views.py
ajharry69/django-xpay
ebfe09ffa615293dbea6b6d8e1ffd65f8d283d15
[ "Apache-2.0" ]
5
2021-03-30T14:04:24.000Z
2021-09-22T19:21:25.000Z
xstripe/views.py
ajharry69/django-xpay
ebfe09ffa615293dbea6b6d8e1ffd65f8d283d15
[ "Apache-2.0" ]
1
2020-11-30T04:46:48.000Z
2020-11-30T04:46:48.000Z
from xauth.views import CreateAPIView from .serializers import ClientSecretSerializer class ClientSecretView(CreateAPIView): serializer_class = ClientSecretSerializer
21.75
47
0.850575
15
174
9.8
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.114943
174
7
48
24.857143
0.954545
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.5
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
4032a214ee1b8a2e7427df829be56449cb47d032
156
py
Python
ui/__init__.py
originalMemory/formula-manager
df12ec546d2a5fb41e0ca06191e6616ff41fb698
[ "MIT" ]
null
null
null
ui/__init__.py
originalMemory/formula-manager
df12ec546d2a5fb41e0ca06191e6616ff41fb698
[ "MIT" ]
null
null
null
ui/__init__.py
originalMemory/formula-manager
df12ec546d2a5fb41e0ca06191e6616ff41fb698
[ "MIT" ]
null
null
null
# coding=utf-8 """ @project : formula-manager @ide : PyCharm @file : __init__.py @author : illusion @desc : @create : 2021/8/8 11:13 上午:54 """
15.6
31
0.596154
22
156
4.045455
0.909091
0
0
0
0
0
0
0
0
0
0
0.108333
0.230769
156
9
32
17.333333
0.633333
0.935897
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
404c7b62ac8e2f0e3318130d2d924ffb529d2e4c
156
py
Python
kolibri/utils/__init__.py
MBKayro/kolibri
0a38a5fb665503cf8f848b2f65938e73bfaa5989
[ "MIT" ]
545
2016-01-19T19:26:55.000Z
2022-03-20T00:13:04.000Z
kolibri/utils/__init__.py
MBKayro/kolibri
0a38a5fb665503cf8f848b2f65938e73bfaa5989
[ "MIT" ]
8,329
2016-01-19T19:32:02.000Z
2022-03-31T21:23:12.000Z
kolibri/utils/__init__.py
MBKayro/kolibri
0a38a5fb665503cf8f848b2f65938e73bfaa5989
[ "MIT" ]
493
2016-01-19T19:26:48.000Z
2022-03-28T14:35:05.000Z
""" Do not import anything from the rest of Kolibri in this module, it's crucial that it can be loaded without the settings/configuration/django stack! """
31.2
76
0.769231
26
156
4.615385
0.923077
0
0
0
0
0
0
0
0
0
0
0
0.160256
156
4
77
39
0.916031
0.942308
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
405a8fe74eee36937d977b5ae47c9477bf0b7e7c
286
py
Python
MKVBatchMultiplex/jobs/__init__.py
akai10tsuki/mkvbatchmultiplex
0a45cf915c4817d377c4b717e95fc4ea21758f85
[ "MIT" ]
22
2019-01-29T23:12:16.000Z
2022-03-26T07:42:19.000Z
MKVBatchMultiplex/jobs/__init__.py
akai10tsuki/mkvbatchmultiplex
0a45cf915c4817d377c4b717e95fc4ea21758f85
[ "MIT" ]
12
2020-06-28T16:53:42.000Z
2021-12-14T00:33:31.000Z
MKVBatchMultiplex/jobs/__init__.py
akai10tsuki/mkvbatchmultiplex
0a45cf915c4817d377c4b717e95fc4ea21758f85
[ "MIT" ]
1
2021-10-18T16:27:47.000Z
2021-10-18T16:27:47.000Z
""" Import jobs module entry point """ from .JobKeys import JobHistoryKey, JobKey, JobStatus, JobsTableKey, jobStatusTooltip from .JobQueue import JobInfo, JobQueue from .jobsDB import addToDb, removeFromDb, saveToDb from .RunJobs import RunJobs from .SqlJobsTable import SqlJobsTable
28.6
85
0.814685
32
286
7.28125
0.625
0
0
0
0
0
0
0
0
0
0
0
0.122378
286
9
86
31.777778
0.928287
0.104895
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
405ef3412b2cd3e5cd26a21e005d5eecd9b25c90
158
py
Python
src/SimilarNeuron/utils/__init__.py
luxuncang/similar-neuron
b0bab30270e768ec70551d26d709e692d00f62a9
[ "MIT" ]
4
2021-12-02T15:54:09.000Z
2021-12-09T14:22:05.000Z
src/SimilarNeuron/utils/__init__.py
luxuncang/similar-neuron
b0bab30270e768ec70551d26d709e692d00f62a9
[ "MIT" ]
13
2021-12-03T07:04:39.000Z
2022-03-09T08:38:39.000Z
src/SimilarNeuron/utils/__init__.py
luxuncang/similar-neuron
b0bab30270e768ec70551d26d709e692d00f62a9
[ "MIT" ]
1
2021-12-13T14:39:12.000Z
2021-12-13T14:39:12.000Z
from .dicttool import dictBSF, dictDFS, dictfilter from .agreement import BaseAgreement, BaseSwitch, Switch, Agreement from .container import TimeBoundCache
52.666667
68
0.835443
17
158
7.764706
0.705882
0
0
0
0
0
0
0
0
0
0
0
0.113924
158
3
69
52.666667
0.942857
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
40a4d6235d7031ed41c1574cbfca10a351479b21
865
py
Python
OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GL/ARB/clear_buffer_object.py
JE-Chen/je_old_repo
a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5
[ "MIT" ]
null
null
null
OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GL/ARB/clear_buffer_object.py
JE-Chen/je_old_repo
a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5
[ "MIT" ]
null
null
null
OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GL/ARB/clear_buffer_object.py
JE-Chen/je_old_repo
a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5
[ "MIT" ]
null
null
null
'''Autogenerated by xml_generate script, do not edit!''' from OpenGL import platform as _p, arrays # Code generation uses this from OpenGL.raw.GL import _types as _cs # End users want this... from OpenGL.raw.GL._types import * from OpenGL.raw.GL import _errors from OpenGL.constant import Constant as _C import ctypes _EXTENSION_NAME = 'GL_ARB_clear_buffer_object' def _f( function ): return _p.createFunction( function,_p.PLATFORM.GL,'GL_ARB_clear_buffer_object',error_checker=_errors._error_checker) @_f @_p.types(None,_cs.GLenum,_cs.GLenum,_cs.GLenum,_cs.GLenum,ctypes.c_void_p) def glClearBufferData(target,internalformat,format,type,data):pass @_f @_p.types(None,_cs.GLenum,_cs.GLenum,_cs.GLintptr,_cs.GLsizeiptr,_cs.GLenum,_cs.GLenum,ctypes.c_void_p) def glClearBufferSubData(target,internalformat,offset,size,format,type,data):pass
41.190476
121
0.790751
133
865
4.827068
0.43609
0.099688
0.093458
0.124611
0.353583
0.183801
0.183801
0.183801
0.183801
0
0
0
0.104046
865
20
122
43.25
0.828387
0.115607
0
0.133333
1
0
0.070461
0.070461
0
0
0
0
0
1
0.2
false
0.133333
0.4
0.066667
0.666667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
1
1
0
1
0
0
4
40ce6c377da3181b43ff3dd6daba28f2d525451d
266
py
Python
application/core/port/create_account_activation_token_port.py
yntonfon/dashboard-plus
1a4f2cf0c4d640f91d5c0aa974d0266552fb4e3d
[ "MIT" ]
null
null
null
application/core/port/create_account_activation_token_port.py
yntonfon/dashboard-plus
1a4f2cf0c4d640f91d5c0aa974d0266552fb4e3d
[ "MIT" ]
4
2018-04-10T18:13:13.000Z
2018-05-15T15:53:13.000Z
application/core/port/create_account_activation_token_port.py
yntonfon/dashboard-plus
1a4f2cf0c4d640f91d5c0aa974d0266552fb4e3d
[ "MIT" ]
null
null
null
import abc class CreateAccountActivationTokenPort(metaclass=abc.ABCMeta): @abc.abstractmethod def create_account_activation_token(self, payload): raise NotImplementedError('users must define create_account_activation_token to use this base class')
33.25
109
0.808271
30
266
6.966667
0.766667
0.124402
0.220096
0.267943
0
0
0
0
0
0
0
0
0.135338
266
7
110
38
0.908696
0
0
0
0
0
0.270677
0.116541
0
0
0
0
0
1
0.2
false
0
0.2
0
0.6
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
4
40cef126e1026c923c7e1c898f353357689ef9b3
280
py
Python
utils/hash.py
sonudoo/password-manager
6fa1d2ebeba5b0f9cff200b32a581321d109b9cd
[ "MIT" ]
null
null
null
utils/hash.py
sonudoo/password-manager
6fa1d2ebeba5b0f9cff200b32a581321d109b9cd
[ "MIT" ]
null
null
null
utils/hash.py
sonudoo/password-manager
6fa1d2ebeba5b0f9cff200b32a581321d109b9cd
[ "MIT" ]
null
null
null
import hashlib def generate_hash(text): """Generates SHA2 as hex string. Uses internal hashlib. Args: text (str): The text whose hex is to be ca Returns: str: SHA2 string as hex characters """ return hashlib.sha256(text.encode()).hexdigest()
23.333333
59
0.653571
38
280
4.789474
0.710526
0.054945
0
0
0
0
0
0
0
0
0
0.023923
0.253571
280
11
60
25.454545
0.84689
0.546429
0
0
1
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
1
0
0
1
0
1
0
0
4
40d4317e681128848a3a4dbc1adab4f7b2f2cd56
107
py
Python
user_profiles_api/apps.py
achin1992/Achin92
4011ab6bf19b4855bf61e547fe895ac666fb328a
[ "MIT" ]
null
null
null
user_profiles_api/apps.py
achin1992/Achin92
4011ab6bf19b4855bf61e547fe895ac666fb328a
[ "MIT" ]
5
2021-03-19T11:35:57.000Z
2022-02-10T10:46:08.000Z
user_profiles_api/apps.py
achin1992/Achin92
4011ab6bf19b4855bf61e547fe895ac666fb328a
[ "MIT" ]
null
null
null
from django.apps import AppConfig class UserProfilesApiConfig(AppConfig): name = 'user_profiles_api'
17.833333
39
0.794393
12
107
6.916667
0.916667
0
0
0
0
0
0
0
0
0
0
0
0.140187
107
5
40
21.4
0.902174
0
0
0
0
0
0.158879
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
905d0cf08ab2c0cc79f5439e65f14dc6e9c47af3
895
py
Python
fast_api_server/services/crypto_info.py
parithy86/Python-api-frameworks
a19ca4a8f2ef92e6fc314fed5afe7350a1d771e8
[ "Apache-2.0" ]
null
null
null
fast_api_server/services/crypto_info.py
parithy86/Python-api-frameworks
a19ca4a8f2ef92e6fc314fed5afe7350a1d771e8
[ "Apache-2.0" ]
null
null
null
fast_api_server/services/crypto_info.py
parithy86/Python-api-frameworks
a19ca4a8f2ef92e6fc314fed5afe7350a1d771e8
[ "Apache-2.0" ]
null
null
null
import requests from fast_api_server.constants.constants import Constants async def get_crypto_details(request): response = requests.get(Constants.URL.format("bitcoin")) if 'error' in response.json(): return {"status": "failure"}, Constants.RESPONSE_500 else: if response.status_code in Constants.RESPONSE_CODES_SUCCESS: return response.text, response.status_code else: return {"status": "failure"}, response.status_code async def get_crypto(request): response = requests.get(Constants.URL.format(request.get('coin'))) if 'error' in response.json(): return {"status": "failure"}, Constants.RESPONSE_500 else: if response.status_code in Constants.RESPONSE_CODES_SUCCESS: return response.text, response.status_code else: return {"status": "failure"}, response.status_code
34.423077
70
0.687151
105
895
5.695238
0.295238
0.140468
0.180602
0.056856
0.789298
0.789298
0.789298
0.64214
0.64214
0.64214
0
0.008451
0.206704
895
25
71
35.8
0.833803
0
0
0.7
0
0
0.081564
0
0
0
0
0
0
1
0
false
0
0.1
0
0.4
0
0
0
0
null
0
1
0
0
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
906b69799e529edddd9e5349252b01ca87041a52
77
py
Python
pylint/examples/without_issues/example.py
jcortejoso/cloud-builders-community
80bbc3dfbabf39d7594e08ed0ae57b1a2114cb99
[ "Apache-2.0" ]
1,031
2017-10-24T14:35:13.000Z
2022-03-29T16:24:08.000Z
pylint/examples/without_issues/example.py
jcortejoso/cloud-builders-community
80bbc3dfbabf39d7594e08ed0ae57b1a2114cb99
[ "Apache-2.0" ]
431
2017-10-28T22:03:36.000Z
2022-03-23T15:10:50.000Z
pylint/examples/without_issues/example.py
jcortejoso/cloud-builders-community
80bbc3dfbabf39d7594e08ed0ae57b1a2114cb99
[ "Apache-2.0" ]
891
2017-10-24T14:39:17.000Z
2022-03-31T09:02:52.000Z
#!/usr/bin/env python3 '''This is Example module''' print("useless script")
15.4
28
0.688312
11
77
4.818182
1
0
0
0
0
0
0
0
0
0
0
0.014706
0.116883
77
4
29
19.25
0.764706
0.571429
0
0
0
0
0.518519
0
0
0
0
0
0
1
0
true
0
0
0
0
1
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
4
908f4bfcea58830b7f2e422ae22ac445ef65b2f4
22,128
py
Python
python version/tests/unit_tests/katona/logic/test_answer_checker.py
psychology-experiments/Five-square-problem
750861bd93baca6ade7624687236f516aa6c485d
[ "MIT" ]
null
null
null
python version/tests/unit_tests/katona/logic/test_answer_checker.py
psychology-experiments/Five-square-problem
750861bd93baca6ade7624687236f516aa6c485d
[ "MIT" ]
null
null
null
python version/tests/unit_tests/katona/logic/test_answer_checker.py
psychology-experiments/Five-square-problem
750861bd93baca6ade7624687236f516aa6c485d
[ "MIT" ]
null
null
null
import random import pytest from katona.logic.essential import AnswerChecker from katona.logic.movement import MousePressEvent class ClickEventFactory: start_event = "stick chosen" finish_event = "stick placed" def __init__(self, solutions: dict, grid, movable_elements): self._solutions = solutions self._grid = grid self._movable_elements = movable_elements self._useless_grid = self._find_useless_positions() self._useless_movables = self._find_useless_movable_elements() self._not_used_solutions = self._create_not_used_solutions() self._not_used_useless_grid = list(self._useless_grid) self._not_used_movables = list(self._useless_movables) def _create_not_used_solutions(self): not_used_solutions = {key: {} for key in self._solutions.keys()} for solution in self._solutions: for part in self._solutions[solution]: not_used_solutions[solution][part] = list(self._solutions[solution][part]) # print(self._solutions) # print(not_used_solutions) return not_used_solutions def _find_useless_movable_elements(self): start_solutions = [] for solution in self._solutions.values(): start_solutions.extend(solution["sticks"]) solution_elements = set(start_solutions) return tuple(set(self._movable_elements) - solution_elements) def _find_useless_positions(self): useful_grid_elements = [] for positions_groups in self._solutions.values(): for position_type in positions_groups: useful_grid_elements.extend(position_type) return tuple(set(DEFAULT_GRID) - set(useful_grid_elements)) def generate_events(self, correctness, solution_types=None): start_time = 0.1 generated_events = {"start": [], "finish": [], } if solution_types is None: solution_types = [None] * len(correctness) for (correct_start, correct_finish), solution_type in zip(correctness, solution_types): chosen_stick, placed_to = self._generate_start_event(correct_start, solution_type) current_time = random.uniform(start_time, start_time + random.uniform(1, 5)) start_time = current_time generated_start_event = MousePressEvent(self.start_event, chosen_stick, placed_to, current_time) placed_to = self._generate_finish_event(correct_start, solution_type) current_time = random.uniform(start_time, start_time + random.uniform(1, 5)) start_time = current_time generated_finish_event = MousePressEvent(self.finish_event, chosen_stick, placed_to, current_time) generated_events["start"].append(generated_start_event) generated_events["finish"].append(generated_finish_event) self._reset_to_default() return generated_events["start"], generated_events["finish"] def _reset_to_default(self): self._not_used_solutions = self._create_not_used_solutions() self._not_used_useless_grid = list(self._useless_grid) self._not_used_movables = list(self._useless_movables) random.shuffle(self._not_used_movables) def _generate_start_event(self, correct, solution_type): if correct: if solution_type is not None: stick = self._not_used_solutions[solution_type]["sticks"].pop() else: solution_type_start = random.choice(list(self._solutions.keys())) stick = self._not_used_solutions[solution_type_start]["sticks"].pop() chosen_stick = stick else: chosen_stick = self._not_used_movables.pop() placed_to = chosen_stick return chosen_stick, placed_to def _generate_finish_event(self, correct, solution_type): if correct: if solution_type is not None: placed_to = self._not_used_solutions[solution_type]["positions"].pop() else: solution_type_finish = random.choice(list(self._solutions.keys())) placed_to = self._not_used_solutions[solution_type_finish]["positions"].pop() else: placed_to = self._not_used_useless_grid.pop() return placed_to DEFAULT_SOLUTION = {'left': {'sticks': ((10, 5), (9, 4), (11, 4)), 'positions': ((10, 3), (9, 3), (11, 3))}, 'right': {'sticks': ((10, 6), (9, 6), (11, 6)), 'positions': ((10, 8), (9, 7), (11, 7))}, 'up': {'sticks': ((9, 5), (8, 5), (8, 6)), 'positions': ((6, 5), (5, 5), (6, 6))}, 'down': {'sticks': ((11, 5), (12, 5), (12, 6)), 'positions': ((14, 5), (15, 5), (14, 6))}} grid_horizontal_idx = [(row, col) for col in range(1, 10) for row in range(1, 20, 2) ] grid_vertical_idx = [(row, col) for col in range(1, 11) for row in range(2, 19, 2) ] DEFAULT_GRID = grid_horizontal_idx + grid_vertical_idx DEFAULT_GRID.sort() MOVABLE_ELEMENTS = ((9, 4), (10, 4), (11, 4), (8, 5), (7, 5), (8, 6), (10, 5), (9, 5), (11, 5), (10, 6), (9, 6), (10, 7), (11, 6), (12, 5), (13, 5), (12, 6)) click_factory = ClickEventFactory(solutions=DEFAULT_SOLUTION, grid=DEFAULT_GRID, movable_elements=MOVABLE_ELEMENTS) @pytest.fixture() def default_answer_checker(): yield AnswerChecker(DEFAULT_SOLUTION) class TestAnswerChecker: def test_three_utterly_wrong_moves_return_false(self, default_answer_checker): start_clicks, finish_clicks = click_factory.generate_events(correctness=[[False, False], [False, False], [False, False], ]) result = [] for start_click, finish_click in zip(start_clicks, finish_clicks): default_answer_checker.is_approach_solution(start_click) result.append(default_answer_checker. is_approach_solution(finish_click)) message = f"Three utterly wrong moves should return 3 False, but got {result} instead" assert not any(result), message def test_three_start_right_placed_wrong_moves_return_false(self, default_answer_checker): start_clicks, finish_clicks = click_factory.generate_events(correctness=[[True, False], [True, False], [True, False], ], solution_types=["up", "up", "up"]) result = [] for start_click, finish_click in zip(start_clicks, finish_clicks): default_answer_checker.is_approach_solution(start_click) result.append(default_answer_checker. is_approach_solution(finish_click)) message = f"Three start right placed wrong moves should return 3 False," \ f" but got {result} instead" assert not any(result), message def test_three_start_wrong_placed_right_moves_return_false(self, default_answer_checker): start_clicks, finish_clicks = click_factory.generate_events(correctness=[[False, True], [False, True], [False, True], ], solution_types=["up", "up", "up"]) result = [] for start_click, finish_click in zip(start_clicks, finish_clicks): default_answer_checker.is_approach_solution(start_click) result.append(default_answer_checker. is_approach_solution(finish_click)) message = f"Three start right placed wrong moves should return 3 False," \ f" but got {result} instead" assert not any(result), message def test_right_return_right_from_other_solution_sequence_of_moves(self, default_answer_checker): start_clicks = (("stick chosen", 1.28, DEFAULT_SOLUTION["down"]["sticks"][0]), ("stick chosen", 5.87, DEFAULT_SOLUTION["down"]["positions"][0]), ("stick chosen", 9.87, DEFAULT_SOLUTION["right"]["sticks"][0]), ) finish_clicks = (("stick placed", 2.28, DEFAULT_SOLUTION["down"]["positions"][0]), ("stick placed", 6.87, DEFAULT_SOLUTION["down"]["sticks"][0]), ("stick placed", 10.87, DEFAULT_SOLUTION["right"]["positions"][0]), ) result = [] for start_click, finish_click in zip(start_clicks, finish_clicks): default_answer_checker.is_approach_solution(start_click) result.append(default_answer_checker. is_approach_solution(finish_click)) expect = [True, False, False] actual = result message = f"Second solution should not be accepted as correct third move" \ f" stick return also is wrong thus results should be {expect}," \ f" but got {result} instead" assert expect == actual, message def test_right_wrong_wrong_sequence_of_moves(self, default_answer_checker): start_clicks = (("stick chosen", 1.28, DEFAULT_SOLUTION["down"]["sticks"][0]), ("stick chosen", 4.28, DEFAULT_SOLUTION["down"]["sticks"][1]), ("stick chosen", 8.28, DEFAULT_SOLUTION["down"]["sticks"][2]), ) finish_clicks = (("stick placed", 2.28, DEFAULT_SOLUTION["down"]["positions"][0]), ("stick placed", 6.87, DEFAULT_SOLUTION["left"]["positions"][0]), ("stick placed", 10.87, DEFAULT_SOLUTION["right"]["positions"][0]), ) result = [] for start_click, finish_click in zip(start_clicks, finish_clicks): default_answer_checker.is_approach_solution(start_click) result.append(default_answer_checker. is_approach_solution(finish_click)) expect = [True, False, False] actual = result message = f"Right, wrong, wrong moves should return {expect}, but return {actual}" assert expect == actual, message def test_wrong_right_wrong_sequence_of_moves(self, default_answer_checker): start_clicks = (("stick chosen", 1.28, DEFAULT_SOLUTION["up"]["sticks"][0]), ("stick chosen", 4.28, DEFAULT_SOLUTION["up"]["sticks"][1]), ("stick chosen", 8.28, DEFAULT_SOLUTION["up"]["sticks"][2]), ) finish_clicks = (("stick placed", 2.28, DEFAULT_SOLUTION["down"]["positions"][0]), ("stick placed", 6.87, DEFAULT_SOLUTION["up"]["positions"][0]), ("stick placed", 10.87, DEFAULT_SOLUTION["right"]["positions"][0]), ) result = [] for start_click, finish_click in zip(start_clicks, finish_clicks): default_answer_checker.is_approach_solution(start_click) result.append(default_answer_checker. is_approach_solution(finish_click)) expect = [False, True, False] actual = result message = f"Wrong, right, wrong moves should return {expect}, but return {actual}" assert expect == actual, message def test_wrong_wrong_right_sequence_of_moves(self, default_answer_checker): start_clicks = (("stick chosen", 1.28, DEFAULT_SOLUTION["left"]["sticks"][0]), ("stick chosen", 4.28, DEFAULT_SOLUTION["left"]["sticks"][1]), ("stick chosen", 8.28, DEFAULT_SOLUTION["left"]["sticks"][2]), ) finish_clicks = (("stick placed", 2.28, DEFAULT_SOLUTION["down"]["positions"][0]), ("stick placed", 6.87, DEFAULT_SOLUTION["up"]["positions"][0]), ("stick placed", 10.87, DEFAULT_SOLUTION["left"]["positions"][0]), ) result = [] for start_click, finish_click in zip(start_clicks, finish_clicks): default_answer_checker.is_approach_solution(start_click) result.append(default_answer_checker. is_approach_solution(finish_click)) expect = [False, False, True] actual = result message = f"Right, wrong, wrong moves should return {expect}, but return {actual}" assert expect == actual, message def test_wrong_right_right_sequence_of_moves(self, default_answer_checker): start_clicks = (("stick chosen", 1.28, DEFAULT_SOLUTION["left"]["sticks"][0]), ("stick chosen", 4.28, DEFAULT_SOLUTION["right"]["sticks"][1]), ("stick chosen", 8.28, DEFAULT_SOLUTION["right"]["sticks"][2]), ) finish_clicks = (("stick placed", 2.28, DEFAULT_SOLUTION["down"]["positions"][0]), ("stick placed", 6.87, DEFAULT_SOLUTION["right"]["positions"][0]), ("stick placed", 10.87, DEFAULT_SOLUTION["right"]["positions"][1]), ) result = [] for start_click, finish_click in zip(start_clicks, finish_clicks): default_answer_checker.is_approach_solution(start_click) result.append(default_answer_checker. is_approach_solution(finish_click)) expect = [False, True, True] actual = result message = f"Wrong, right, right moves should return {expect}, but return {actual}" assert expect == actual, message def test_right_wrong_right_sequence_of_moves(self, default_answer_checker): start_clicks = (("stick chosen", 1.28, DEFAULT_SOLUTION["left"]["sticks"][0]), ("stick chosen", 4.28, DEFAULT_SOLUTION["right"]["sticks"][1]), ("stick chosen", 8.28, DEFAULT_SOLUTION["left"]["sticks"][2]), ) finish_clicks = (("stick placed", 2.28, DEFAULT_SOLUTION["left"]["positions"][0]), ("stick placed", 6.87, DEFAULT_SOLUTION["up"]["positions"][0]), ("stick placed", 10.87, DEFAULT_SOLUTION["left"]["positions"][1]), ) result = [] for start_click, finish_click in zip(start_clicks, finish_clicks): default_answer_checker.is_approach_solution(start_click) result.append(default_answer_checker. is_approach_solution(finish_click)) expect = [True, False, True] actual = result message = f"Right, wrong, right moves should return {expect}, but return {actual}" assert expect == actual, message def test_right_right_wrong_sequence_of_moves(self, default_answer_checker): start_clicks = (("stick chosen", 1.28, DEFAULT_SOLUTION["up"]["sticks"][0]), ("stick chosen", 4.28, DEFAULT_SOLUTION["up"]["sticks"][1]), ("stick chosen", 8.28, DEFAULT_SOLUTION["down"]["sticks"][2]), ) finish_clicks = (("stick placed", 2.28, DEFAULT_SOLUTION["up"]["positions"][0]), ("stick placed", 6.87, DEFAULT_SOLUTION["up"]["positions"][2]), ("stick placed", 10.87, DEFAULT_SOLUTION["right"]["positions"][1]), ) result = [] for start_click, finish_click in zip(start_clicks, finish_clicks): default_answer_checker.is_approach_solution(start_click) result.append(default_answer_checker. is_approach_solution(finish_click)) expect = [True, True, False] actual = result message = f"Right, wrong, right moves should return {expect}, but return {actual}" assert expect == actual, message def test_impossibility_of_switching_solution_type_after_first_right_move(self, default_answer_checker): start_clicks = (("stick chosen", 1.28, DEFAULT_SOLUTION["up"]["sticks"][0]), ("stick chosen", 4.28, DEFAULT_SOLUTION["left"]["sticks"][1]), ) finish_clicks = (("stick placed", 2.28, DEFAULT_SOLUTION["up"]["positions"][0]), ("stick placed", 6.87, DEFAULT_SOLUTION["left"]["positions"][2]), ) result = [] for start_click, finish_click in zip(start_clicks, finish_clicks): default_answer_checker.is_approach_solution(start_click) result.append(default_answer_checker. is_approach_solution(finish_click)) expect = False actual = result[1] message = f"Solution type cannot be changed after first correct move ({expect})" \ f", but checker allowed ({actual})" assert expect == actual, message def test_impossibility_of_switching_solution_type_after_two_right_moves(self, default_answer_checker): start_clicks, finish_clicks = click_factory.generate_events(correctness=[[True, True]] * 3, solution_types=["up", "up", "down"]) answers = [] for start_click, finish_click in zip(start_clicks, finish_clicks): default_answer_checker.is_approach_solution(start_click) result = default_answer_checker.is_approach_solution(finish_click) answers.append(result) expect = False actual = answers[2] message = f"Solution type cannot be changed after two consecutive correct moves ({expect})" \ f", but checker allowed ({actual})" assert expect == actual, message def test_up_solution(self, default_answer_checker): start_clicks, finish_clicks = click_factory.generate_events(correctness=[[True, True]] * 3, solution_types=["up"] * 3) answers = [] for start_click, finish_click in zip(start_clicks, finish_clicks): default_answer_checker.is_approach_solution(start_click) result = default_answer_checker.is_approach_solution(finish_click) answers.append(result) message = f"Correct up solutions do not work, got {answers}" assert all(answers), message def test_down_solution(self, default_answer_checker): start_clicks, finish_clicks = click_factory.generate_events(correctness=[[True, True]] * 3, solution_types=["down"] * 3) answers = [] for start_click, finish_click in zip(start_clicks, finish_clicks): default_answer_checker.is_approach_solution(start_click) result = default_answer_checker.is_approach_solution(finish_click) answers.append(result) message = f"Correct down solutions do not work, got {answers}" assert all(answers), message def test_left_solution(self, default_answer_checker): start_clicks, finish_clicks = click_factory.generate_events(correctness=[[True, True]] * 3, solution_types=["left"] * 3) answers = [] for start_click, finish_click in zip(start_clicks, finish_clicks): default_answer_checker.is_approach_solution(start_click) result = default_answer_checker.is_approach_solution(finish_click) answers.append(result) message = f"Correct left solutions do not work, got {answers}" assert all(answers), message def test_right_solution(self, default_answer_checker): start_clicks, finish_clicks = click_factory.generate_events(correctness=[[True, True]] * 3, solution_types=["right"] * 3) answers = [] for start_click, finish_click in zip(start_clicks, finish_clicks): default_answer_checker.is_approach_solution(start_click) result = default_answer_checker.is_approach_solution(finish_click) answers.append(result) message = f"Correct right solutions do not work, got {answers}" assert all(answers), message def test_can_switch_and_accept_new_solution(self, default_answer_checker): # two right sets of moves generation start_clicks, finish_clicks = click_factory.generate_events(correctness=[[True, True]] * 6, solution_types=["up"] * 3 + ["down"] * 3) answers = [] for start_click, finish_click in zip(start_clicks, finish_clicks): default_answer_checker.is_approach_solution(start_click) result = default_answer_checker.is_approach_solution(finish_click) answers.append(result) message = f"Should accept all moves as correct, but got {answers}" assert all(answers), message if __name__ == '__main__': pytest.main()
49.064302
110
0.57791
2,365
22,128
5.102326
0.069767
0.056021
0.086185
0.061987
0.778653
0.757521
0.734648
0.71882
0.695699
0.695699
0
0.021927
0.315754
22,128
450
111
49.173333
0.775048
0.003751
0
0.524862
0
0
0.115285
0
0
0
0
0
0.046961
1
0.071823
false
0
0.01105
0
0.110497
0
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
90b20d1ecc89c5cfd546da5d93442744325e6eb5
54
py
Python
tests/test_io/test_cx/__init__.py
djinnome/pybel
6ffc1df662fef51f4d740daf6d7643010a9d5be8
[ "MIT" ]
103
2016-10-25T05:51:26.000Z
2022-03-23T02:21:12.000Z
tests/test_io/test_cx/__init__.py
djinnome/pybel
6ffc1df662fef51f4d740daf6d7643010a9d5be8
[ "MIT" ]
444
2016-10-22T13:09:10.000Z
2022-03-21T12:01:39.000Z
tests/test_io/test_cx/__init__.py
cthoyt/pybel
ed66f013a77f9cbc513892b0dad1025b8f68bb46
[ "Apache-2.0" ]
38
2017-01-06T03:32:38.000Z
2022-03-19T11:27:30.000Z
# -*- coding: utf-8 -*- """Test cases for CX I/O."""
13.5
28
0.481481
9
54
2.888889
1
0
0
0
0
0
0
0
0
0
0
0.023256
0.203704
54
3
29
18
0.581395
0.833333
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
90bf4ccb00099a21d3a10554b99fdd55e31e6211
53
py
Python
learn-python-hard-way/ex1-print.py
hugomarques/python-snippets
c206b50d2f2c22ed5e7d09a20d28f85a91f90713
[ "MIT" ]
null
null
null
learn-python-hard-way/ex1-print.py
hugomarques/python-snippets
c206b50d2f2c22ed5e7d09a20d28f85a91f90713
[ "MIT" ]
null
null
null
learn-python-hard-way/ex1-print.py
hugomarques/python-snippets
c206b50d2f2c22ed5e7d09a20d28f85a91f90713
[ "MIT" ]
null
null
null
print "Hello world" print "Hi" print "Learning again"
17.666667
22
0.754717
8
53
5
0.75
0
0
0
0
0
0
0
0
0
0
0
0.132075
53
3
22
17.666667
0.869565
0
0
0
0
0
0.5
0
0
0
0
0
0
0
null
null
0
0
null
null
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
1
0
0
0
0
0
0
1
0
4
90d39296fde1749a8f20bc9b519669eec35b62bb
29
py
Python
isdigit.py
Srinivassan-Ramamurthy/python_programs
53b390669c7e88532c67d80b758a9199d6fde8cf
[ "bzip2-1.0.6" ]
null
null
null
isdigit.py
Srinivassan-Ramamurthy/python_programs
53b390669c7e88532c67d80b758a9199d6fde8cf
[ "bzip2-1.0.6" ]
null
null
null
isdigit.py
Srinivassan-Ramamurthy/python_programs
53b390669c7e88532c67d80b758a9199d6fde8cf
[ "bzip2-1.0.6" ]
null
null
null
a=input() print(a.isdigit())
9.666667
18
0.655172
5
29
3.8
0.8
0
0
0
0
0
0
0
0
0
0
0
0.068966
29
2
19
14.5
0.703704
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
4
90eb0555bf505163ee46aab1c282428c8c0eacd6
53
py
Python
hooks/nrpe_hooks.py
CanonicalBootStack/nrpe-charm
dc1e367461b64c94f9fbe381c1c31d82af732f59
[ "MIT" ]
null
null
null
hooks/nrpe_hooks.py
CanonicalBootStack/nrpe-charm
dc1e367461b64c94f9fbe381c1c31d82af732f59
[ "MIT" ]
null
null
null
hooks/nrpe_hooks.py
CanonicalBootStack/nrpe-charm
dc1e367461b64c94f9fbe381c1c31d82af732f59
[ "MIT" ]
null
null
null
#!/usr/bin/python3 import services services.manage()
13.25
18
0.773585
7
53
5.857143
0.857143
0
0
0
0
0
0
0
0
0
0
0.020408
0.075472
53
3
19
17.666667
0.816327
0.320755
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
90ee13e9a58c3b6546ccca8087104fc7ea82ad8f
274
py
Python
kra/models/OperationResult.py
smpio/kube-resource-analyzer
d214b7c32bc5e404ac951f66cf0914fcae1f580f
[ "MIT" ]
null
null
null
kra/models/OperationResult.py
smpio/kube-resource-analyzer
d214b7c32bc5e404ac951f66cf0914fcae1f580f
[ "MIT" ]
50
2021-05-26T14:15:09.000Z
2021-07-24T12:08:14.000Z
kra/models/OperationResult.py
smpio/kube-resource-analyzer
d214b7c32bc5e404ac951f66cf0914fcae1f580f
[ "MIT" ]
null
null
null
from django.db import models class OperationResult(models.Model): finished_at = models.DateTimeField() data = models.JSONField(blank=True, null=True) error = models.JSONField(blank=True, null=True) def __str__(self): return str(self.data or 'OK')
24.909091
51
0.70438
36
274
5.222222
0.638889
0.159574
0.212766
0.255319
0.340426
0.340426
0
0
0
0
0
0
0.182482
274
10
52
27.4
0.839286
0
0
0
0
0
0.007299
0
0
0
0
0
0
1
0.142857
false
0
0.142857
0.142857
1
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
4
2901e974d1482389389f2ee37e68b3250c0a3cf3
326
py
Python
nmrglue/fileio/__init__.py
kaustubhmote/nmrglue
9d940f1a79991892ca456d6d08dc0b4062fa8fc9
[ "BSD-3-Clause" ]
150
2015-01-16T12:24:13.000Z
2022-03-03T18:01:18.000Z
nmrglue/fileio/__init__.py
kaustubhmote/nmrglue
9d940f1a79991892ca456d6d08dc0b4062fa8fc9
[ "BSD-3-Clause" ]
129
2015-01-13T04:58:56.000Z
2022-03-02T13:39:16.000Z
nmrglue/fileio/__init__.py
kaustubhmote/nmrglue
9d940f1a79991892ca456d6d08dc0b4062fa8fc9
[ "BSD-3-Clause" ]
88
2015-02-16T20:04:12.000Z
2022-03-10T06:50:30.000Z
from . import bruker from . import convert from . import jcampdx from . import nmrml from . import pipe from . import rnmrtk from . import simpson from . import sparky from . import tecmag from . import varian # replicate varian namespace in agilent from . import varian as agilent from . import table from . import spinsolve
21.733333
39
0.773006
46
326
5.478261
0.413043
0.515873
0.126984
0
0
0
0
0
0
0
0
0
0.184049
326
14
40
23.285714
0.947368
0.113497
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
29046f2cad8cf5157abeed2a578d435120805310
166
py
Python
init.py
achariso/gans-thesis
cde09fec4b617da47b74f5ecbf2ac2f9444c3634
[ "MIT" ]
2
2021-07-28T07:48:20.000Z
2021-07-29T13:14:42.000Z
init.py
achariso/gans-thesis
cde09fec4b617da47b74f5ecbf2ac2f9444c3634
[ "MIT" ]
1
2021-10-31T21:15:39.000Z
2021-10-31T21:15:39.000Z
init.py
achariso/gans-thesis
cde09fec4b617da47b74f5ecbf2ac2f9444c3634
[ "MIT" ]
null
null
null
import os pwd = os.getcwd() os.environ['PYTHONPATH'] = f'{pwd}:{pwd}/src' if not 'PYTHONPATH' in os.environ else \ f'{os.environ["PYTHONPATH"]}:{pwd}:{pwd}/src'
27.666667
86
0.644578
26
166
4.115385
0.461538
0.252336
0.35514
0
0
0
0
0
0
0
0
0
0.126506
166
5
87
33.2
0.737931
0
0
0
0
0
0.463855
0.253012
0
0
0
0
0
1
0
false
0
0.25
0
0.25
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
292238a4ccc5b84c0b7c78ed285639de33d87c54
13,900
py
Python
sdk/python/pulumi_alicloud/edas/instance_cluster_attachment.py
pulumi/pulumi-alicloud
9c34d84b4588a7c885c6bec1f03b5016e5a41683
[ "ECL-2.0", "Apache-2.0" ]
42
2019-03-18T06:34:37.000Z
2022-03-24T07:08:57.000Z
sdk/python/pulumi_alicloud/edas/instance_cluster_attachment.py
pulumi/pulumi-alicloud
9c34d84b4588a7c885c6bec1f03b5016e5a41683
[ "ECL-2.0", "Apache-2.0" ]
152
2019-04-15T21:03:44.000Z
2022-03-29T18:00:57.000Z
sdk/python/pulumi_alicloud/edas/instance_cluster_attachment.py
pulumi/pulumi-alicloud
9c34d84b4588a7c885c6bec1f03b5016e5a41683
[ "ECL-2.0", "Apache-2.0" ]
3
2020-08-26T17:30:07.000Z
2021-07-05T01:37:45.000Z
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import _utilities __all__ = ['InstanceClusterAttachmentArgs', 'InstanceClusterAttachment'] @pulumi.input_type class InstanceClusterAttachmentArgs: def __init__(__self__, *, cluster_id: pulumi.Input[str], instance_ids: pulumi.Input[Sequence[pulumi.Input[str]]]): """ The set of arguments for constructing a InstanceClusterAttachment resource. :param pulumi.Input[str] cluster_id: The ID of the cluster that you want to create the application. :param pulumi.Input[Sequence[pulumi.Input[str]]] instance_ids: The ID of instance. Type: list. """ pulumi.set(__self__, "cluster_id", cluster_id) pulumi.set(__self__, "instance_ids", instance_ids) @property @pulumi.getter(name="clusterId") def cluster_id(self) -> pulumi.Input[str]: """ The ID of the cluster that you want to create the application. """ return pulumi.get(self, "cluster_id") @cluster_id.setter def cluster_id(self, value: pulumi.Input[str]): pulumi.set(self, "cluster_id", value) @property @pulumi.getter(name="instanceIds") def instance_ids(self) -> pulumi.Input[Sequence[pulumi.Input[str]]]: """ The ID of instance. Type: list. """ return pulumi.get(self, "instance_ids") @instance_ids.setter def instance_ids(self, value: pulumi.Input[Sequence[pulumi.Input[str]]]): pulumi.set(self, "instance_ids", value) @pulumi.input_type class _InstanceClusterAttachmentState: def __init__(__self__, *, cluster_id: Optional[pulumi.Input[str]] = None, cluster_member_ids: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None, ecu_map: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None, instance_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, status_map: Optional[pulumi.Input[Mapping[str, pulumi.Input[int]]]] = None): """ Input properties used for looking up and filtering InstanceClusterAttachment resources. :param pulumi.Input[str] cluster_id: The ID of the cluster that you want to create the application. :param pulumi.Input[Mapping[str, pulumi.Input[str]]] cluster_member_ids: The cluster members map of the resource supplied above. The key is instance_id and the value is cluster_member_id. :param pulumi.Input[Mapping[str, pulumi.Input[str]]] ecu_map: The ecu map of the resource supplied above. The key is instance_id and the value is ecu_id. :param pulumi.Input[Sequence[pulumi.Input[str]]] instance_ids: The ID of instance. Type: list. :param pulumi.Input[Mapping[str, pulumi.Input[int]]] status_map: The status map of the resource supplied above. The key is instance_id and the values are 1(running) 0(converting) -1(failed) and -2(offline). """ if cluster_id is not None: pulumi.set(__self__, "cluster_id", cluster_id) if cluster_member_ids is not None: pulumi.set(__self__, "cluster_member_ids", cluster_member_ids) if ecu_map is not None: pulumi.set(__self__, "ecu_map", ecu_map) if instance_ids is not None: pulumi.set(__self__, "instance_ids", instance_ids) if status_map is not None: pulumi.set(__self__, "status_map", status_map) @property @pulumi.getter(name="clusterId") def cluster_id(self) -> Optional[pulumi.Input[str]]: """ The ID of the cluster that you want to create the application. """ return pulumi.get(self, "cluster_id") @cluster_id.setter def cluster_id(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "cluster_id", value) @property @pulumi.getter(name="clusterMemberIds") def cluster_member_ids(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]: """ The cluster members map of the resource supplied above. The key is instance_id and the value is cluster_member_id. """ return pulumi.get(self, "cluster_member_ids") @cluster_member_ids.setter def cluster_member_ids(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]): pulumi.set(self, "cluster_member_ids", value) @property @pulumi.getter(name="ecuMap") def ecu_map(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]: """ The ecu map of the resource supplied above. The key is instance_id and the value is ecu_id. """ return pulumi.get(self, "ecu_map") @ecu_map.setter def ecu_map(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]): pulumi.set(self, "ecu_map", value) @property @pulumi.getter(name="instanceIds") def instance_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]: """ The ID of instance. Type: list. """ return pulumi.get(self, "instance_ids") @instance_ids.setter def instance_ids(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]): pulumi.set(self, "instance_ids", value) @property @pulumi.getter(name="statusMap") def status_map(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[int]]]]: """ The status map of the resource supplied above. The key is instance_id and the values are 1(running) 0(converting) -1(failed) and -2(offline). """ return pulumi.get(self, "status_map") @status_map.setter def status_map(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[int]]]]): pulumi.set(self, "status_map", value) class InstanceClusterAttachment(pulumi.CustomResource): @overload def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, cluster_id: Optional[pulumi.Input[str]] = None, instance_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, __props__=None): """ Provides an EDAS instance cluster attachment resource. > **NOTE:** Available in 1.82.0+ ## Example Usage Basic Usage ```python import pulumi import pulumi_alicloud as alicloud default = alicloud.edas.InstanceClusterAttachment("default", cluster_id=var["cluster_id"], instance_ids=var["instance_ids"]) ``` :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[str] cluster_id: The ID of the cluster that you want to create the application. :param pulumi.Input[Sequence[pulumi.Input[str]]] instance_ids: The ID of instance. Type: list. """ ... @overload def __init__(__self__, resource_name: str, args: InstanceClusterAttachmentArgs, opts: Optional[pulumi.ResourceOptions] = None): """ Provides an EDAS instance cluster attachment resource. > **NOTE:** Available in 1.82.0+ ## Example Usage Basic Usage ```python import pulumi import pulumi_alicloud as alicloud default = alicloud.edas.InstanceClusterAttachment("default", cluster_id=var["cluster_id"], instance_ids=var["instance_ids"]) ``` :param str resource_name: The name of the resource. :param InstanceClusterAttachmentArgs args: The arguments to use to populate this resource's properties. :param pulumi.ResourceOptions opts: Options for the resource. """ ... def __init__(__self__, resource_name: str, *args, **kwargs): resource_args, opts = _utilities.get_resource_args_opts(InstanceClusterAttachmentArgs, pulumi.ResourceOptions, *args, **kwargs) if resource_args is not None: __self__._internal_init(resource_name, opts, **resource_args.__dict__) else: __self__._internal_init(resource_name, *args, **kwargs) def _internal_init(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, cluster_id: Optional[pulumi.Input[str]] = None, instance_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, __props__=None): if opts is None: opts = pulumi.ResourceOptions() if not isinstance(opts, pulumi.ResourceOptions): raise TypeError('Expected resource options to be a ResourceOptions instance') if opts.version is None: opts.version = _utilities.get_version() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') __props__ = InstanceClusterAttachmentArgs.__new__(InstanceClusterAttachmentArgs) if cluster_id is None and not opts.urn: raise TypeError("Missing required property 'cluster_id'") __props__.__dict__["cluster_id"] = cluster_id if instance_ids is None and not opts.urn: raise TypeError("Missing required property 'instance_ids'") __props__.__dict__["instance_ids"] = instance_ids __props__.__dict__["cluster_member_ids"] = None __props__.__dict__["ecu_map"] = None __props__.__dict__["status_map"] = None super(InstanceClusterAttachment, __self__).__init__( 'alicloud:edas/instanceClusterAttachment:InstanceClusterAttachment', resource_name, __props__, opts) @staticmethod def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions] = None, cluster_id: Optional[pulumi.Input[str]] = None, cluster_member_ids: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None, ecu_map: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None, instance_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, status_map: Optional[pulumi.Input[Mapping[str, pulumi.Input[int]]]] = None) -> 'InstanceClusterAttachment': """ Get an existing InstanceClusterAttachment resource's state with the given name, id, and optional extra properties used to qualify the lookup. :param str resource_name: The unique name of the resulting resource. :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. :param pulumi.ResourceOptions opts: Options for the resource. :param pulumi.Input[str] cluster_id: The ID of the cluster that you want to create the application. :param pulumi.Input[Mapping[str, pulumi.Input[str]]] cluster_member_ids: The cluster members map of the resource supplied above. The key is instance_id and the value is cluster_member_id. :param pulumi.Input[Mapping[str, pulumi.Input[str]]] ecu_map: The ecu map of the resource supplied above. The key is instance_id and the value is ecu_id. :param pulumi.Input[Sequence[pulumi.Input[str]]] instance_ids: The ID of instance. Type: list. :param pulumi.Input[Mapping[str, pulumi.Input[int]]] status_map: The status map of the resource supplied above. The key is instance_id and the values are 1(running) 0(converting) -1(failed) and -2(offline). """ opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) __props__ = _InstanceClusterAttachmentState.__new__(_InstanceClusterAttachmentState) __props__.__dict__["cluster_id"] = cluster_id __props__.__dict__["cluster_member_ids"] = cluster_member_ids __props__.__dict__["ecu_map"] = ecu_map __props__.__dict__["instance_ids"] = instance_ids __props__.__dict__["status_map"] = status_map return InstanceClusterAttachment(resource_name, opts=opts, __props__=__props__) @property @pulumi.getter(name="clusterId") def cluster_id(self) -> pulumi.Output[str]: """ The ID of the cluster that you want to create the application. """ return pulumi.get(self, "cluster_id") @property @pulumi.getter(name="clusterMemberIds") def cluster_member_ids(self) -> pulumi.Output[Mapping[str, str]]: """ The cluster members map of the resource supplied above. The key is instance_id and the value is cluster_member_id. """ return pulumi.get(self, "cluster_member_ids") @property @pulumi.getter(name="ecuMap") def ecu_map(self) -> pulumi.Output[Mapping[str, str]]: """ The ecu map of the resource supplied above. The key is instance_id and the value is ecu_id. """ return pulumi.get(self, "ecu_map") @property @pulumi.getter(name="instanceIds") def instance_ids(self) -> pulumi.Output[Sequence[str]]: """ The ID of instance. Type: list. """ return pulumi.get(self, "instance_ids") @property @pulumi.getter(name="statusMap") def status_map(self) -> pulumi.Output[Mapping[str, int]]: """ The status map of the resource supplied above. The key is instance_id and the values are 1(running) 0(converting) -1(failed) and -2(offline). """ return pulumi.get(self, "status_map")
44.694534
214
0.657914
1,704
13,900
5.120892
0.096831
0.099587
0.064176
0.043319
0.765414
0.727596
0.713271
0.660784
0.645427
0.6146
0
0.00236
0.237986
13,900
310
215
44.83871
0.821469
0.325612
0
0.488095
1
0
0.105269
0.016676
0
0
0
0
0
1
0.154762
false
0.005952
0.029762
0
0.279762
0
0
0
0
null
0
0
0
0
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
2923eb13d7e3591c6d6bf922fb8e836d3ace7c3e
134
py
Python
octue/utils/__init__.py
octue/octue-sdk-python
31c6e9358d3401ca708f5b3da702bfe3be3e52ce
[ "MIT" ]
5
2020-10-01T12:43:10.000Z
2022-03-14T17:26:25.000Z
octue/utils/__init__.py
octue/octue-sdk-python
31c6e9358d3401ca708f5b3da702bfe3be3e52ce
[ "MIT" ]
322
2020-06-24T15:55:22.000Z
2022-03-30T11:49:28.000Z
octue/utils/__init__.py
octue/octue-sdk-python
31c6e9358d3401ca708f5b3da702bfe3be3e52ce
[ "MIT" ]
null
null
null
from .gen_uuid import gen_uuid from .isfile import isfile from .isfolder import isfolder __all__ = "gen_uuid", "isfile", "isfolder"
19.142857
42
0.768657
19
134
5.052632
0.368421
0.21875
0
0
0
0
0
0
0
0
0
0
0.141791
134
6
43
22.333333
0.834783
0
0
0
0
0
0.164179
0
0
0
0
0
0
1
0
false
0
0.75
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
0
0
0
1
0
0
0
0
4
2927d70ed4f55a492a6d16eb1d0b3713f6d496f5
65
py
Python
scripts/__init__.py
TheSoftwareFactory/lokki-wp8
c132e9244a269f87e61f9846dd2aefa6afe4a90d
[ "Apache-2.0" ]
10
2015-12-21T15:54:11.000Z
2021-03-22T19:12:18.000Z
scripts/__init__.py
TheSoftwareFactory/lokki-wp8
c132e9244a269f87e61f9846dd2aefa6afe4a90d
[ "Apache-2.0" ]
1
2015-02-21T10:23:00.000Z
2015-02-21T10:23:00.000Z
src/tests/sample_app/__init__.py
F-Secure/resource-api
d84ffcbc802f2bbbb06588e65f1d4798c6e4262f
[ "Apache-2.0" ]
7
2015-01-13T11:49:18.000Z
2017-05-08T06:47:30.000Z
""" Copyright (c) 2014-2015 F-Secure See LICENSE for details """
13
32
0.692308
10
65
4.5
1
0
0
0
0
0
0
0
0
0
0
0.145455
0.153846
65
4
33
16.25
0.672727
0.861538
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
296f3df4792bed170db60d60e539ffa2257c8bba
91
py
Python
EventApp/apps.py
BalaDeveloper2094/SocialEventApp
9a9df67b6bfd62175f3416158465bc8aef9f8966
[ "Unlicense" ]
null
null
null
EventApp/apps.py
BalaDeveloper2094/SocialEventApp
9a9df67b6bfd62175f3416158465bc8aef9f8966
[ "Unlicense" ]
null
null
null
EventApp/apps.py
BalaDeveloper2094/SocialEventApp
9a9df67b6bfd62175f3416158465bc8aef9f8966
[ "Unlicense" ]
null
null
null
from django.apps import AppConfig class EventappConfig(AppConfig): name = 'EventApp'
15.166667
33
0.758242
10
91
6.9
0.9
0
0
0
0
0
0
0
0
0
0
0
0.164835
91
5
34
18.2
0.907895
0
0
0
0
0
0.087912
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
2971f43a0043c99a380b0f9fb3514c5b4fbf98d8
79
py
Python
pages/themes/beginners/stringsNumbersVariablesComments/HW/acad_to_astro_hours.py
ProgressBG-Python-Course/ProgressBG-VC2-Python
03b892a42ee1fad3d4f97e328e06a4b1573fd356
[ "MIT" ]
null
null
null
pages/themes/beginners/stringsNumbersVariablesComments/HW/acad_to_astro_hours.py
ProgressBG-Python-Course/ProgressBG-VC2-Python
03b892a42ee1fad3d4f97e328e06a4b1573fd356
[ "MIT" ]
null
null
null
pages/themes/beginners/stringsNumbersVariablesComments/HW/acad_to_astro_hours.py
ProgressBG-Python-Course/ProgressBG-VC2-Python
03b892a42ee1fad3d4f97e328e06a4b1573fd356
[ "MIT" ]
null
null
null
# Solution without using variables to store values print((64*40 + 64/4*20)/60)
26.333333
50
0.734177
14
79
4.142857
0.928571
0
0
0
0
0
0
0
0
0
0
0.161765
0.139241
79
2
51
39.5
0.691176
0.607595
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0
0
0
1
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
4
297f47868a8dff7f8f1c4aa951eb097c3e69cdf8
993
py
Python
Hackaton-drafts/PhotoHack/server_watch_service_receiver.py
RedSerge/fun
8fbcb7a3a00c046e93cff1dbbafb1936afa4b25e
[ "MIT" ]
null
null
null
Hackaton-drafts/PhotoHack/server_watch_service_receiver.py
RedSerge/fun
8fbcb7a3a00c046e93cff1dbbafb1936afa4b25e
[ "MIT" ]
null
null
null
Hackaton-drafts/PhotoHack/server_watch_service_receiver.py
RedSerge/fun
8fbcb7a3a00c046e93cff1dbbafb1936afa4b25e
[ "MIT" ]
null
null
null
import urllib.request import time import os.path def getsignal(): u2 = urllib.request.urlopen('http://tzteam.pythonanywhere.com/requested') return u2.read() state=0 fname="work.jpg" while True: time.sleep(2) if getsignal()!=b'free': u2 = urllib.request.urlopen('http://tzteam.pythonanywhere.com/uploads/work.jpg') if not os.path.isfile(fname): with open(fname,"wb") as f: f.write(u2.read()) urllib.request.urlopen('http://tzteam.pythonanywhere.com/token?keyid=b2385a41e9d9e4a7194a8dae01b871fe287992947f127473677d96b72d1bf5c737fe80c2e7a9109e53e6eb3fd06a3e41e4179b5b4a0eb173c80f1f989ccd63fc256c6d765cbb11d4e2d9c50c10cb1341aa5cfce9d83af45f4b65b999c87b801963705566a86444a98c9d21d5bf6878fcc78f68be1d3b1d3f4d00dd04badb7983aa6eb64353457e5a3ef1ef08ad47db4bd558f9a5d0b6a1464e6f40712e448f70e3fef4ffb60a826e6ffaa136de15cdc58d64444d4e487391bcbbba0e77fb4098987266a44a0767bd1c886640f933727fada66db9751bd245b252412bc7e6b41e8f58e9f7c182590cab6c81f4376409923dd1ce10b74ab55642d97ddcef690f')
49.65
583
0.864048
73
993
11.753425
0.561644
0.060606
0.06993
0.083916
0.168998
0.168998
0.168998
0.114219
0
0
0
0.341126
0.052367
993
19
584
52.263158
0.57067
0
0
0
0
0
0.664653
0
0
1
0
0
0
1
0.0625
false
0
0.1875
0
0.3125
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
4
462b81038545c4f415bb7c6a8636b3b15017e663
403
py
Python
src/code/data-structures/Queue/Queue.test.py
angshumanHalder/discord-bot
5b3b6042c901a1563abeee48ee8f267aa5c79fe2
[ "MIT" ]
null
null
null
src/code/data-structures/Queue/Queue.test.py
angshumanHalder/discord-bot
5b3b6042c901a1563abeee48ee8f267aa5c79fe2
[ "MIT" ]
null
null
null
src/code/data-structures/Queue/Queue.test.py
angshumanHalder/discord-bot
5b3b6042c901a1563abeee48ee8f267aa5c79fe2
[ "MIT" ]
null
null
null
from Queue import Queue queue = Queue() assert queue.is_empty() is True queue.enqueue(1) assert queue.is_empty() is False queue.enqueue(2) assert queue.size() == 2 assert queue.peek() == 1 assert queue.size() == 2 assert queue.dequeue() == 1 assert queue.size() == 1 assert queue.peek() == 2 assert queue.size() == 1 assert queue.dequeue() == 2 assert queue.size() == 0 assert queue.is_empty() is True
22.388889
32
0.699752
66
403
4.227273
0.227273
0.473118
0.215054
0.193548
0.630824
0.55914
0
0
0
0
0
0.031884
0.143921
403
17
33
23.705882
0.776812
0
0
0.375
0
0
0
0
0
0
0
0
0.75
1
0
false
0
0.0625
0
0.0625
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
4
4640d85b97428d4907c495193cdc9f610342460d
424
py
Python
offprem/environments.py
Fauxsys/offprem
9fe4764b24578b1ada43cfab600379b55fed038d
[ "MIT" ]
null
null
null
offprem/environments.py
Fauxsys/offprem
9fe4764b24578b1ada43cfab600379b55fed038d
[ "MIT" ]
null
null
null
offprem/environments.py
Fauxsys/offprem
9fe4764b24578b1ada43cfab600379b55fed038d
[ "MIT" ]
null
null
null
import logging import boto3 from offprem.offprem import ConfigureVPC def select_profile(): return input(f'Select a profile: {boto3.session.Session().available_profiles}\n') def select_vpc(): return input(f'Select a VPC:\n{ConfigureVPC.configuration_file_parser.sections()}\n') logging.basicConfig(format='{name} - {levelname} - {message}', level=logging.INFO, style='{') logger = logging.getLogger(__name__)
23.555556
93
0.75
54
424
5.722222
0.592593
0.058252
0.07767
0.116505
0.122977
0
0
0
0
0
0
0.005305
0.110849
424
17
94
24.941176
0.814324
0
0
0
0
0
0.389151
0.247642
0
0
0
0
0
1
0.222222
false
0
0.333333
0.222222
0.777778
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
1
1
0
0
4
46507403098b6ecd621ff7d4b238345364c39e28
930
py
Python
tests/integration/unit_test/test_unit_test_dotnet6.py
dancfox/aws-sam-cli-app-templates
d59c5aa0dba2dd5d260e00f163a55eabfa201f15
[ "Apache-2.0" ]
null
null
null
tests/integration/unit_test/test_unit_test_dotnet6.py
dancfox/aws-sam-cli-app-templates
d59c5aa0dba2dd5d260e00f163a55eabfa201f15
[ "Apache-2.0" ]
null
null
null
tests/integration/unit_test/test_unit_test_dotnet6.py
dancfox/aws-sam-cli-app-templates
d59c5aa0dba2dd5d260e00f163a55eabfa201f15
[ "Apache-2.0" ]
null
null
null
# dotnet unit tests are executed from test directories, so code_directories point to test directories from tests.integration.unit_test.unit_test_base import UnitTestBase class UnitTest_dotnet6_cookiecutter_aws_sam_hello_dotnet(UnitTestBase.DotNetCoreUnitTestBase): directory = "dotnet6/cookiecutter-aws-sam-hello-dotnet" code_directories = ["test/HelloWorld.Test"] # FIXME: fix and re-enable the test # class UnitTest_dotnet6_cookiecutter_aws_sam_hello_powershell(UnitTestBase.DotNetCoreUnitTestBase): # directory = "dotnet6/cookiecutter-aws-sam-hello-powershell" # code_directories = ["test/HelloWorld.Test"] class UnitTest_dotnet6_cookiecutter_aws_sam_hello_step_functions_sample_app(UnitTestBase.DotNetCoreUnitTestBase): directory = "dotnet6/cookiecutter-aws-sam-hello-step-functions-sample-app" code_directories = ["tests/StockBuyer.Test", "tests/StockChecker.Test", "tests/StockSeller.Test"]
42.272727
113
0.81828
110
930
6.663636
0.363636
0.155525
0.180082
0.204638
0.673943
0.589359
0.545703
0.48704
0.141883
0
0
0.007126
0.094624
930
21
114
44.285714
0.86342
0.369892
0
0
0
0
0.32409
0.289428
0
0
0
0.047619
0
1
0
false
0
0.142857
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
1
0
0
0
0
0
0
0
1
0
0
4
468fd5508e0820a60a7dc3beeca773c74640565b
88
py
Python
apps/opds/apps.py
EvilFlowersCatalog/EvilFlowersCatalog
30ac54eabe548cdb4ffd2d4aa1180de91eb25964
[ "MIT" ]
3
2022-02-10T09:19:58.000Z
2022-03-25T22:42:08.000Z
apps/opds/apps.py
EvilFlowersCatalog/EvilFlowersCatalog
30ac54eabe548cdb4ffd2d4aa1180de91eb25964
[ "MIT" ]
9
2022-01-21T14:01:14.000Z
2022-02-23T18:59:42.000Z
apps/opds/apps.py
EvilFlowersCatalog/EvilFlowersCatalog
30ac54eabe548cdb4ffd2d4aa1180de91eb25964
[ "MIT" ]
1
2021-06-22T21:23:41.000Z
2021-06-22T21:23:41.000Z
from django.apps import AppConfig class OpdsConfig(AppConfig): name = 'apps.opds'
14.666667
33
0.738636
11
88
5.909091
0.818182
0
0
0
0
0
0
0
0
0
0
0
0.170455
88
5
34
17.6
0.890411
0
0
0
0
0
0.102273
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
469c6d94f6f6329af3942add6a41bf2a5eda1a86
7,948
py
Python
tests/test_search.py
chbrandt/npt
7d58db9987c8f4d93c4e61e1fc98cce38733d06e
[ "MIT" ]
2
2020-09-28T08:22:54.000Z
2020-09-28T13:17:25.000Z
tests/test_search.py
chbrandt/gpt-neanias
aa7c2e88972f9af280b7f02ee11170df6c967b55
[ "MIT" ]
2
2022-02-18T16:38:13.000Z
2022-02-18T16:56:33.000Z
tests/test_search.py
chbrandt/gpt-neanias
aa7c2e88972f9af280b7f02ee11170df6c967b55
[ "MIT" ]
1
2022-03-15T09:03:51.000Z
2022-03-15T09:03:51.000Z
import pytest from npt.search import ode from npt import cli expected_results = { 'bbox_small': { 'ctx': { 'contain': { 'ODEResults': {'Count': '1', 'Products': {'Product': {'BB_georeferenced': 'True', 'Center_georeferenced': 'True', 'Center_latitude': '0.0198', 'Center_longitude': '0', 'Comment': 'Meridiani Planum', 'Data_Set_Id': 'MRO-M-CTX-2-EDR-L0-V1.0', 'Easternmost_longitude': '359.82', 'Emission_angle': '0.2', 'External_url': 'https://pds-imaging.jpl.nasa.gov/pds/prod?q=OFSN+%3D/data/mro/mars_reconnaissance_orbiter/ctx/mrox_0433/data/P16_007361_1800_XN_00S000W.IMG+AND+RT+%3D+PDS_ZIPN', 'External_url2': 'http://viewer.mars.asu.edu/planetview/inst/ctx/P16_007361_1800_XN_00S000W#start', 'FilesURL': 'https://ode.rsl.wustl.edu/mars/productfiles.aspx?product_id=P16_007361_1800_XN_00S000W&product_idGeo=9083270', 'Footprint_C0_geometry': 'POLYGON ((0.18 0.4052, 0.27 -0.3064, -0.18 -0.3657, -0.26 0.3558, 0.18 0.4052))', 'Footprint_geometry': 'GEOMETRYCOLLECTION (POLYGON ((360 -0.342, 359.82 -0.3657, 359.74 0.3558, 360 0.385, 360 -0.342)), POLYGON ((0.18 0.4052, 0.27 -0.3064, 0 -0.342, 0.18 0.4052)))', 'Footprint_GL_geometry': 'POLYGON ((0.18 0.4052, 0.27 -0.3064, 359.82 -0.3657, 359.74 0.3558, 0.18 0.4052))', 'Footprint_NP_geometry': 'MULTIPOLYGON EMPTY', 'Footprint_souce': 'PDS Archive Index Table', 'Footprint_SP_geometry': 'MULTIPOLYGON EMPTY', 'Footprints_cross_meridian': 'True', 'ihid': 'MRO', 'iid': 'CTX', 'Incidence_angle': '44.11', 'LabelFileName': 'p16_007361_1800_xn_00s000w.img', 'LabelURL': 'https://pds-imaging.jpl.nasa.gov/data/mro/mars_reconnaissance_orbiter/ctx/mrox_0433/data/P16_007361_1800_XN_00S000W.IMG', 'Map_scale': '5.34', 'Maximum_latitude': '0.4052', 'Minimum_latitude': '-0.3657', 'Observation_time': '2008-02-21T00:58:55.697', 'ODE_notes': {'ODE_note': ['NOTE: Product Type set by ODE', 'NOTE: Instrument Host Id set by ODE', 'NOTE: No SC Clock Stop Count so SC Clock Start Count used for Stop Count', 'NOTE: Label keyword Orbit number value used for start orbit number value', 'NOTE: Label keyword Orbit number value used for stop orbit number value', 'NOTE: Observation time set to mid-point between start time and stop time', 'NOTE: Index Record:', '"MROX_0433","DATA/P16_007361_1800_XN_00S000W.IMG","4A_04_102202D500","P16_007361_1800_XN_00S000W","2008-02-21T00:58:48.971","CTX ","NIFL ",5056, 7168, 1, 5.34, 1.14, 0.20, 44.11, 43.91,360.00, 0.02, 0.18, -0.37,359.73, -0.31, 0.26, 0.36,359.82, 0.41,"PSP ","MARS ","0888022748:232 ",292.8, 1.877,"195/238/229", 0, 26.74, 43.40, 266.93,3663.12, 266.93,"N",277.00,207.64, 42.25, 14.22, 0.01, 0.03,244340641.9, 34.81,14.83, 90.1,"Meridiani Planum ","OK ", 7361', 'NOTE: Map scale set from index table entry', 'NOTE: Emission angle set from index table entry', 'NOTE: Incidence angle set from index table entry', 'NOTE: Phase set from index table entry', 'NOTE: Solar distance set from index table entry', 'NOTE: Solar longitude set from index table entry', 'NOTE: CTX location data updated from index table entry']}, 'pdsid': 'P16_007361_1800_XN_00S000W', 'PDSVolume_Id': 'MROX_0433', 'Phase_angle': '43.91', 'Pole_state': 'none', 'Producer_id': 'MRO_CTX_TEAM', 'Product_creation_time': '2008-07-17T04:09:49.000', 'Product_files': {'Product_file': [{'Description': 'PRODUCT DATA FILE WITH LABEL', 'FileName': 'P16_007361_1800_XN_00S000W.IMG', 'KBytes': '35001', 'Type': 'Product', 'URL': 'https://pds-imaging.jpl.nasa.gov/data/mro/mars_reconnaissance_orbiter/ctx/mrox_0433/data/P16_007361_1800_XN_00S000W.IMG'}, {'Description': 'BROWSE IMAGE', 'FileName': 'P16_007361_1800_XN_00S000W.IMG.JPEG', 'KBytes': '12', 'Type': 'Browse', 'URL': 'https://pds-imaging.jpl.nasa.gov/data/mro/mars_reconnaissance_orbiter/ctx/mrox_0433/extras/browse/P16_007361_1800_XN_00S000W.IMG.jpeg'}, {'Description': 'THUMBNAIL IMAGE', 'FileName': 'P16_007361_1800_XN_00S000W.IMG.JPEG_SMALL', 'KBytes': '1', 'Type': 'Browse', 'URL': 'https://pds-imaging.jpl.nasa.gov/data/mro/mars_reconnaissance_orbiter/ctx/mrox_0433/extras/thumbnail/P16_007361_1800_XN_00S000W.IMG.jpeg_small'}, {'Creation_date': '2020-01-15T21:11:26.016', 'Description': 'PRODUCT KML FILE <A HREF="PAGEHELP/QUICKSTARTGUIDE/ABOUTFOOTPRINTS.HTM" TARGET="_BLANK">HELP</A>', 'FileName': 'P16_007361_1800_XN_00S000W_IMG.KML', 'KBytes': '3', 'Type': 'Derived', 'URL': 'https://ode.rsl.wustl.edu/mars/datafile/kmlfiles/mro-m-ctx-2-edr-l0-v1/mrox_0433/data/p16_007361_1800_xn_00s000w_img.kml'}, {'Creation_date': '2020-01-15T21:11:25.930', 'Description': 'PRODUCT FOOTPRINT SHAPEFILES (TAR.GZ) <A HREF="PAGEHELP/QUICKSTARTGUIDE/ABOUTFOOTPRINTS.HTM" TARGET="_BLANK">HELP</A>', 'FileName': 'P16_007361_1800_XN_00S000W_IMG.TAR.GZ', 'KBytes': '4', 'Type': 'Derived', 'URL': 'https://ode.rsl.wustl.edu/mars/datafile/shapefiles/mro-m-ctx-2-edr-l0-v1/mrox_0433/data/p16_007361_1800_xn_00s000w_img.tar.gz'}, {'Creation_date': '2020-01-15T21:11:25.832', 'Description': 'PRODUCT FOOTPRINT SHAPEFILES (ZIP) <A HREF="PAGEHELP/QUICKSTARTGUIDE/ABOUTFOOTPRINTS.HTM" TARGET="_BLANK">HELP</A>', 'FileName': 'P16_007361_1800_XN_00S000W_IMG.ZIP', 'KBytes': '29', 'Type': 'Derived', 'URL': 'https://ode.rsl.wustl.edu/mars/datafile/shapefiles/mro-m-ctx-2-edr-l0-v1/mrox_0433/data/p16_007361_1800_xn_00s000w_img.zip'}]}, 'ProductURL': 'https://ode.rsl.wustl.edu/mars/indexproductpage.aspx?product_id=P16_007361_1800_XN_00S000W&product_idGeo=9083270', 'pt': 'EDR', 'RelativePathtoVol': 'data\\', 'Solar_distance': '244340641.9', 'Solar_longitude': '34.81', 'SpaceCraft_clock_start_count': '0888022748:232', 'SpaceCraft_clock_stop_count': '0888022748:232', 'Start_orbit_number': '7361', 'Stop_orbit_number': '7361', 'Target_name': 'MARS', 'UTC_start_time': '2008-02-21T00:58:48.971', 'UTC_stop_time': '2008-02-21T00:59:02.424', 'Westernmost_longitude': '0.18'}}, 'QuerySummary': {'Date': '2020-11-24T13:25:48.247', 'easternlon': '1', 'ihid': 'mro', 'iid': 'ctx', 'loc': 'o', 'maxlat': '1', 'minlat': '-1', 'output': 'JSON', 'pt': 'edr', 'query': 'PRODUCT', 'Query_Elapsed_Time': '00:00:00.2499868', 'results': 'FMPC', 'target': 'mars', 'westernlon': '359'}, 'Status': 'Success'} } } } } @pytest.fixture def bbox_empty(): return {'minlat':0, 'maxlat':0, 'eastlon':0, 'westlon':0} @pytest.fixture def bbox_small(): return {'minlat':-1, 'maxlat':1, 'westlon':359, 'eastlon':1} @pytest.fixture def dataset_ctx(): return 'mars/mro/ctx/edr' class TestCLI: def test_empty_arguments(self): res = cli._search() assert res == False def test_bbox_empty(self, bbox_empty, dataset_ctx): res = cli._search(bbox=bbox_empty, dataset=dataset_ctx) assert res is None class TestODE: partial_results = {} # def test_payload_setup(self, bbox_small, dataset_ctx): # payload = ode._set_payload(bbox_small, # dataset_ctx.split('/'), # how='contain') # print(payload) def test_bbox_empty(self, bbox_empty, dataset_ctx): res = ode.bounding_box(bbox_empty, dataset=dataset_ctx) assert res is None def test_bbox_small_contain(self, bbox_small, dataset_ctx): res = ode.bounding_box(bbox_small, dataset=dataset_ctx, how='contains') assert res['ODEResults']['Status'].lower() == 'success' assert int(res['ODEResults']['Count']) == 1 assert isinstance(res['ODEResults']['Products'], dict) assert res['ODEResults']['QuerySummary']['query'].lower() == 'product' self.partial_results['bbox_small_contain'] = res def test_parse_results_bbox_small_contain(self, dataset_ctx): odejson = self.partial_results['bbox_small_contain'] print(type(odejson), odejson) res = ode.parse_products(odejson, ode.DESCRIPTORS[dataset_ctx]) assert len(res) == 1
118.626866
6,079
0.693256
1,184
7,948
4.453547
0.271115
0.035843
0.051773
0.059738
0.466338
0.439788
0.391997
0.320121
0.288451
0.249953
0
0.149971
0.125818
7,948
66
6,080
120.424242
0.608952
0.027554
0
0.155556
0
0.377778
0.700117
0.139713
0
0
0
0
0.177778
1
0.177778
false
0
0.066667
0.066667
0.377778
0.044444
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
d3bde72764ec6e4bf3b233c999a5301592565408
71
py
Python
tests/__init__.py
starofrainnight/freeplane-helper
99398c9597baa79ddc480041b86668783084b783
[ "Apache-2.0" ]
null
null
null
tests/__init__.py
starofrainnight/freeplane-helper
99398c9597baa79ddc480041b86668783084b783
[ "Apache-2.0" ]
null
null
null
tests/__init__.py
starofrainnight/freeplane-helper
99398c9597baa79ddc480041b86668783084b783
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- """Unit test package for freeplane-helper."""
17.75
45
0.605634
9
71
4.777778
1
0
0
0
0
0
0
0
0
0
0
0.016667
0.15493
71
3
46
23.666667
0.7
0.873239
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
d3fdaab9cc38b3173fc58ad6164cdd5e5a278fb5
11,447
py
Python
tests/pf/test_sensitivity_PFproblem.py
kimjaed/simpeg
b8d716f86a4ea07ba3085fabb24c2bc974788040
[ "MIT" ]
3
2020-11-27T03:18:28.000Z
2022-03-18T01:29:58.000Z
tests/pf/test_sensitivity_PFproblem.py
kimjaed/simpeg
b8d716f86a4ea07ba3085fabb24c2bc974788040
[ "MIT" ]
null
null
null
tests/pf/test_sensitivity_PFproblem.py
kimjaed/simpeg
b8d716f86a4ea07ba3085fabb24c2bc974788040
[ "MIT" ]
1
2020-05-26T17:00:53.000Z
2020-05-26T17:00:53.000Z
# from __future__ import print_function # import unittest # from SimPEG import * # from simpegPF import BaseMag # import matplotlib.pyplot as plt # import simpegPF as PF # from scipy.constants import mu_0 # class MagSensProblemTests(unittest.TestCase): # def setUp(self): # cs = 25. # hxind = [(cs, 5, -1.3), (cs, 21), (cs, 5, 1.3)] # hyind = [(cs, 5, -1.3), (cs, 21), (cs, 5, 1.3)] # hzind = [(cs, 5, -1.3), (cs, 20), (cs, 5, 1.3)] # M = Mesh.TensorMesh([hxind, hyind, hzind], 'CCC') # chibkg = 0.001 # chiblk = 0.01 # chi = np.ones(M.nC)*chibkg # Inc = 90. # Dec = 0. # Btot = 51000 # b0 = PF.MagAnalytics.IDTtoxyz(Inc, Dec, Btot) # sph_ind = PF.MagAnalytics.spheremodel(M, 0., 0., 0., 100) # chi[sph_ind] = chiblk # model = PF.BaseMag.BaseMagMap(M) # survey = BaseMag.BaseMagSurvey() # survey.setBackgroundField(Inc, Dec, Btot) # xr = np.linspace(-300, 300, 41) # yr = np.linspace(-300, 300, 41) # X, Y = np.meshgrid(xr, yr) # Z = np.ones((xr.size, yr.size))*150 # rxLoc = np.c_[Utils.mkvc(X), Utils.mkvc(Y), Utils.mkvc(Z)] # survey.rxLoc = rxLoc # prob = PF.Magnetics.Problem3D_DiffSecondary(M, muMap=model) # prob.pair(survey) # dpre = survey.dpred(chi) # fields = prob.fields(chi) # self.u = fields['u'] # self.B = fields['B'] # self.survey = survey # self.model = model # self.prob = prob # self.M = M # self.chi = chi # def test_mass(self): # print('\n >>Derivative for MfMuI works.') # mu = self.model*self.chi # def MfmuI(mu): # chi = mu/mu_0-1 # self.prob.makeMassMatrices(chi) # vol = self.prob.mesh.vol # aveF2CC = self.prob.mesh.aveF2CC # MfMuI = self.prob.MfMuI.diagonal() # return MfMuI # def dMfmuI(mu, v): # chi = mu/mu_0-1 # self.prob.makeMassMatrices(chi) # vol = self.prob.mesh.vol # aveF2CC = self.prob.mesh.aveF2CC # MfMuI = self.prob.MfMuI.diagonal() # dMfMuI = Utils.sdiag(MfMuI**2)*aveF2CC.T*Utils.sdiag(vol*1./mu**2) # return dMfMuI*v # d_mu = mu*0.8 # derChk = lambda m: [MfmuI(m), lambda mx: dMfmuI(self.chi, mx)] # passed = Tests.checkDerivative(derChk, mu, num=4, dx = d_mu, plotIt=False) # self.assertTrue(passed) # def test_dCdm_Av(self): # print('\n >>Derivative for Cm_A.') # Div = self.prob._Div # vol = self.prob.mesh.vol # aveF2CC = self.prob.mesh.aveF2CC # def Cm_A(chi): # dmudm = self.model.deriv(chi) # u = self.u # # chi = mu/mu_0-1 # self.prob.makeMassMatrices(chi) # mu = self.model*(self.chi) # A = self.prob.getA(self.chi) # MfMuIvec = 1/self.prob.MfMui.diagonal() # dMfMuI = Utils.sdiag(MfMuIvec**2)*aveF2CC.T*Utils.sdiag(vol*1./mu**2) # Cm_A = A*u # return Cm_A # def dCdm_A(chi, v): # dmudm = self.model.deriv(chi) # u = self.u # self.prob.makeMassMatrices(chi) # mu = self.model*self.chi # A = self.prob.getA(self.chi) # MfMuIvec = 1/self.prob.MfMui.diagonal() # dMfMuI = Utils.sdiag(MfMuIvec**2)*aveF2CC.T*Utils.sdiag(vol*1./mu**2) # Cm_A = A*u # dCdm_A = Div * (Utils.sdiag( Div.T * u ) * dMfMuI * dmudm) # return dCdm_A*v # d_chi = self.chi*0.8 # derChk = lambda m: [Cm_A(m), lambda mx: dCdm_A(self.chi, mx)] # passed = Tests.checkDerivative(derChk, self.chi, num=4, dx = d_chi, plotIt=False) # self.assertTrue(passed) # def test_dCdmu_RHS(self): # print('\n >>Derivative for Cm_RHS.') # u = self.u # Div = self.prob._Div # mu = self.model*self.chi # vol = self.prob.mesh.vol # Mc = Utils.sdiag(vol) # aveF2CC = self.prob.mesh.aveF2CC # B0 = self.prob.getB0() # Dface = self.prob.mesh.faceDiv # def Cm_RHS(chi): # self.prob.makeMassMatrices(chi) # dmudm = self.model.deriv(chi) # dchidmu = Utils.sdiag(1/(dmudm.diagonal())) # Bbc, Bbc_const = PF.MagAnalytics.CongruousMagBC(self.prob.mesh, self.survey.B0, chi) # MfMuIvec = 1/self.prob.MfMui.diagonal() # dMfMuI = Utils.sdiag(MfMuIvec**2)*aveF2CC.T*Utils.sdiag(vol*1./mu**2) # RHS1 = Div*self.prob.MfMuI*self.prob.MfMu0*B0 # RHS2 = Mc*Dface*self.prob._Pout.T*Bbc # RHS = RHS1 + RHS2 + Div*B0 # return RHS # def dCdm_RHS(chi, v): # self.prob.makeMassMatrices(chi) # dmudm = self.model.deriv(chi) # dmdmu = Utils.sdiag(1/(dmudm.diagonal())) # Bbc, Bbc_const = PF.MagAnalytics.CongruousMagBC(self.prob.mesh, self.survey.B0, chi) # MfMuIvec = 1/self.prob.MfMui.diagonal() # dMfMuI = Utils.sdiag(MfMuIvec**2)*aveF2CC.T*Utils.sdiag(vol*1./mu**2) # dCdm_RHS1 = Div * (Utils.sdiag( self.prob.MfMu0*B0 ) * dMfMuI) # temp1 = (Dface*(self.prob._Pout.T*Bbc_const*Bbc)) # dCdm_RHS2v = (Utils.sdiag(vol)*temp1)*np.inner(vol, v) # dCdm_RHSv = dCdm_RHS1*(dmudm*v) + dCdm_RHS2v # return dCdm_RHSv # d_chi = self.chi*0.8 # derChk = lambda m: [Cm_RHS(m), lambda mx: dCdm_RHS(self.chi, mx)] # passed = Tests.checkDerivative(derChk, self.chi, num=4, dx = d_chi, plotIt=False) # self.assertTrue(passed) # # def test_dudm(self): # # print(">> Derivative test for dudm") # # u = self.u # # Div = self.prob._Div # # mu = self.model*(self.chi) # # vol = self.prob.mesh.vol # # Mc = Utils.sdiag(vol) # # aveF2CC = self.prob.mesh.aveF2CC # # B0 = self.prob.getB0() # # Dface = self.prob.mesh.faceDiv # # def ufun(chi): # # u = self.prob.fields(chi)['u'] # # return u # # def dudm(chi, v): # # chi = mu/mu_0-1 # # self.prob.makeMassMatrices(chi) # # u = self.u # # dmudm = self.model.deriv(chi) # # dmdmu = Utils.sdiag(1/(dmudm.diagonal())) # # Bbc, Bbc_const = PF.MagAnalytics.CongruousMagBC(self.prob.mesh, self.survey.B0, chi) # # MfMuIvec = 1/self.prob.MfMui.diagonal() # # dMfMuI = Utils.sdiag(MfMuIvec**2)*aveF2CC.T*Utils.sdiag(vol*1./mu**2) # # dCdu = self.prob.getA(chi) # # dCdm_A = Div * ( Utils.sdiag( Div.T * u )* dMfMuI *dmudm ) # # dCdm_RHS1 = Div * (Utils.sdiag( self.prob.MfMu0*B0 ) * dMfMuI) # # temp1 = (Dface*(self.prob._Pout.T*Bbc_const*Bbc)) # # dCdm_RHS2v = (Utils.sdiag(vol)*temp1)*np.inner(vol, v) # # dCdm_RHSv = dCdm_RHS1*(dmudm*v) + dCdm_RHS2v # # dCdm_v = dCdm_A*v - dCdm_RHSv # # m1 = sp.linalg.interface.aslinearoperator(Utils.sdiag(1/dCdu.diagonal())) # # sol, info = sp.linalg.bicgstab(dCdu, dCdm_v, tol=1e-8, maxiter=1000, M=m1) # # dudm = -sol # # return dudm # # d_chi = 10.0*self.chi #np.random.rand(mesh.nCz) # # d_sph_ind = PF.MagAnalytics.spheremodel(self.prob.mesh, 0., 0., -50., 50) # # d_chi[d_sph_ind] = 0.1 # # derChk = lambda m: [ufun(m), lambda mx: dudm(self.chi, mx)] # # # TODO: I am not sure why the order get worse as step decreases .. --; # # passed = Tests.checkDerivative(derChk, self.chi, num=2, dx = d_chi, plotIt=False) # # self.assertTrue(passed) # # def test_dBdm(self): # # print(">> Derivative test for dBdm") # # u = self.u # # Div = self.prob._Div # # mu = self.model*(self.chi) # # vol = self.prob.mesh.vol # # Mc = Utils.sdiag(vol) # # aveF2CC = self.prob.mesh.aveF2CC # # B0 = self.prob.getB0() # # Dface = self.prob.mesh.faceDiv # # def Bfun(chi): # # B = self.prob.fields(chi)['B'] # # return B # # def dBdm(chi, v): # # chi = mu/mu_0-1 # # self.prob.makeMassMatrices(chi) # # u = self.u # # dmudm = self.model.deriv(chi) # # dmdmu = Utils.sdiag(1/(dmudm.diagonal())) # # Bbc, Bbc_const = PF.MagAnalytics.CongruousMagBC(self.prob.mesh, self.survey.B0, chi) # # MfMuIvec = 1/self.prob.MfMui.diagonal() # # dMfMuI = Utils.sdiag(MfMuIvec**2)*aveF2CC.T*Utils.sdiag(vol*1./mu**2) # # dCdu = self.prob.getA(chi) # # dCdm_A = Div * ( Utils.sdiag( Div.T * u )* dMfMuI *dmudm ) # # dCdm_RHS1 = Div * (Utils.sdiag( self.prob.MfMu0*B0 ) * dMfMuI) # # temp1 = (Dface*(self.prob._Pout.T*Bbc_const*Bbc)) # # dCdm_RHS2v = (Utils.sdiag(vol)*temp1)*np.inner(vol, v) # # dCdm_RHSv = dCdm_RHS1*(dmudm*v) + dCdm_RHS2v # # dCdm_v = dCdm_A*v - dCdm_RHSv # # m1 = sp.linalg.interface.aslinearoperator(Utils.sdiag(1/dCdu.diagonal())) # # sol, info = sp.linalg.bicgstab(dCdu, dCdm_v, tol=1e-8, maxiter=1000, M=m1) # # dudm = -sol # # dBdmv = ( Utils.sdiag(self.prob.MfMu0*B0)*(dMfMuI * (dmudm*v)) \ # # - Utils.sdiag(Div.T*u)*(dMfMuI* (dmudm*v)) \ # # - self.prob.MfMuI*(Div.T* (dudm)) ) # # return dBdmv # # d_chi = 10.0*self.chi #np.random.rand(mesh.nCz) # # d_sph_ind = PF.MagAnalytics.spheremodel(self.prob.mesh, 0., 0., -50., 50) # # d_chi[d_sph_ind] = 0.1 # # derChk = lambda m: [Bfun(m), lambda mx: dBdm(self.chi, mx)] # # # TODO: I am not sure why the order get worse as step decreases .. --; # # passed = Tests.checkDerivative(derChk, self.chi, num=2, dx = d_chi, plotIt=False) # # self.assertTrue(passed) # def test_Jvec(self): # print(">> Derivative test for Jvec") # d_chi = 10.0*self.chi #np.random.rand(mesh.nCz) # d_sph_ind = PF.MagAnalytics.spheremodel(self.prob.mesh, 0., 0., -50., 50) # d_chi[d_sph_ind] = 0.1 # derChk = lambda m: (self.survey.dpred(m), lambda v: self.prob.Jvec(m, v)) # # TODO: I am not sure why the order get worse as step decreases .. --; # passed = Tests.checkDerivative(derChk, self.chi, num=2, dx = d_chi, plotIt=False) # self.assertTrue(passed) # def test_Jtvec(self): # print(">> Derivative test for Jtvec") # dobs = self.survey.dpred(self.chi) # def misfit(m): # dpre = self.survey.dpred(m) # misfit = 0.5*np.linalg.norm(dpre-dobs)**2 # residual = dpre-dobs # dmisfit = self.prob.Jtvec(self.chi, residual) # return misfit, dmisfit # # TODO: I am not sure why the order get worse as step decreases .. --; # passed = Tests.checkDerivative(misfit, self.chi, num=4, plotIt=False) # self.assertTrue(passed) # if __name__ == '__main__': # unittest.main()
37.165584
100
0.527737
1,492
11,447
3.97185
0.129357
0.087749
0.044549
0.03645
0.747891
0.703172
0.690685
0.665035
0.655586
0.636855
0
0.030504
0.315541
11,447
307
101
37.286645
0.725846
0.944265
0
null
0
null
0
0
null
0
0
0.003257
null
1
null
true
0
0
null
null
null
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
310dc6c153a76e9fa449cc19549061151714351b
40
py
Python
galho/__version__.py
joaopalmeiro/galho
ad68d760ccb8200ec547a151408a53c4a30435c6
[ "MIT" ]
null
null
null
galho/__version__.py
joaopalmeiro/galho
ad68d760ccb8200ec547a151408a53c4a30435c6
[ "MIT" ]
1
2020-09-05T17:17:09.000Z
2020-09-05T17:17:09.000Z
galho/__version__.py
joaopalmeiro/galho
ad68d760ccb8200ec547a151408a53c4a30435c6
[ "MIT" ]
null
null
null
# __version__.py __version__ = "0.1.0"
10
21
0.675
6
40
3.166667
0.666667
0
0
0
0
0
0
0
0
0
0
0.088235
0.15
40
3
22
13.333333
0.470588
0.35
0
0
0
0
0.208333
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
311140a949d5a04c904004ab772b924236d8f193
142
py
Python
EventViewer/Source/GUIDefaults.py
cericdahl/SBCcode
90a7841a5c1208d64f71a332289d9005a011aa21
[ "MIT" ]
4
2018-08-27T18:02:34.000Z
2020-06-09T21:19:04.000Z
EventViewer/Source/GUIDefaults.py
SBC-Collaboration/SBC-Analysis
90a7841a5c1208d64f71a332289d9005a011aa21
[ "MIT" ]
null
null
null
EventViewer/Source/GUIDefaults.py
SBC-Collaboration/SBC-Analysis
90a7841a5c1208d64f71a332289d9005a011aa21
[ "MIT" ]
4
2019-06-20T21:36:26.000Z
2020-11-10T17:23:14.000Z
BACKGROUND = "red" FONT_NAME = "Consolas" FONT_SIZE = 19 DEFAULT_FONT = (FONT_NAME, FONT_SIZE) HEADER_FONT = (FONT_NAME, int(FONT_SIZE*1.3))
20.285714
45
0.739437
23
142
4.217391
0.521739
0.247423
0.247423
0
0
0
0
0
0
0
0
0.032258
0.126761
142
7
45
20.285714
0.75
0
0
0
0
0
0.077465
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
312b213f976479b0215a7727698ee1bfd9661229
473
py
Python
shiftscheduler/util/date_util.py
c-rainbow/nurse-scheduling
8537c875e46772700499a89dec3a30a796434fe0
[ "MIT" ]
2
2020-04-16T17:03:56.000Z
2021-04-08T17:23:21.000Z
shiftscheduler/util/date_util.py
c-rainbow/nurse-scheduling
8537c875e46772700499a89dec3a30a796434fe0
[ "MIT" ]
null
null
null
shiftscheduler/util/date_util.py
c-rainbow/nurse-scheduling
8537c875e46772700499a89dec3a30a796434fe0
[ "MIT" ]
1
2020-05-04T18:03:59.000Z
2020-05-04T18:03:59.000Z
import datetime # Generate all dates in between [start_date, end_date], both inclusive. def GenerateAllDates(start_date, end_date): output = [] for n in range((end_date - start_date).days + 1): output.append((start_date + datetime.timedelta(days=n))) return output # Generate all dates in string form of 2020-05-31 def GenerateAllDateStrs(start_date, end_date): output = GenerateAllDates(start_date, end_date) return [str(o) for o in output]
31.533333
71
0.725159
69
473
4.811594
0.463768
0.162651
0.144578
0.192771
0.277108
0
0
0
0
0
0
0.023136
0.17759
473
15
72
31.533333
0.830334
0.247357
0
0
1
0
0
0
0
0
0
0
0
1
0.222222
false
0
0.111111
0
0.555556
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
31318e1385d52b5abcbbf0ac68925bab27f32a38
213
py
Python
tests/test_fullscreen.py
gitter-badger/pywebview
2770330bc265b65dedd7874d579c2c9fde22159e
[ "BSD-3-Clause" ]
1
2021-11-22T05:24:27.000Z
2021-11-22T05:24:27.000Z
tests/test_fullscreen.py
gitter-badger/pywebview
2770330bc265b65dedd7874d579c2c9fde22159e
[ "BSD-3-Clause" ]
null
null
null
tests/test_fullscreen.py
gitter-badger/pywebview
2770330bc265b65dedd7874d579c2c9fde22159e
[ "BSD-3-Clause" ]
3
2021-02-09T22:27:34.000Z
2021-12-28T14:49:23.000Z
import webview from .util import run_test def test_fullscreen(): run_test(webview, fullscreen) def fullscreen(): webview.create_window('Fullscreen test', 'https://www.example.org', fullscreen=True)
15.214286
88
0.737089
27
213
5.666667
0.555556
0.091503
0
0
0
0
0
0
0
0
0
0
0.14554
213
13
89
16.384615
0.840659
0
0
0
0
0
0.180952
0
0
0
0
0
0
1
0.333333
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
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
1
0
0
0
0
4
314f0d2f7a2fb8fc157080cbb5be4faafafa35dc
55,008
py
Python
cardboard/cards/sets/lorwyn.py
Julian/cardboard
6ab676d04b38bf9b0d0c4a849364159947b8ea7f
[ "MIT" ]
5
2015-03-23T10:25:40.000Z
2021-05-29T06:00:40.000Z
cardboard/cards/sets/lorwyn.py
Julian/cardboard
6ab676d04b38bf9b0d0c4a849364159947b8ea7f
[ "MIT" ]
null
null
null
cardboard/cards/sets/lorwyn.py
Julian/cardboard
6ab676d04b38bf9b0d0c4a849364159947b8ea7f
[ "MIT" ]
1
2019-02-17T14:45:29.000Z
2019-02-17T14:45:29.000Z
from cardboard import types from cardboard.ability import ( AbilityNotImplemented, spell, activated, triggered, static ) from cardboard.cards import card, common, keywords, match @card("Kithkin Greatheart") def kithkin_greatheart(card, abilities): def kithkin_greatheart(): return AbilityNotImplemented return kithkin_greatheart, @card("Auntie's Hovel") def aunties_hovel(card, abilities): def aunties_hovel(): return AbilityNotImplemented def aunties_hovel(): return AbilityNotImplemented return aunties_hovel, aunties_hovel, @card("Hoarder's Greed") def hoarders_greed(card, abilities): def hoarders_greed(): return AbilityNotImplemented return hoarders_greed, @card("Kithkin Healer") def kithkin_healer(card, abilities): def kithkin_healer(): return AbilityNotImplemented return kithkin_healer, @card("Ghostly Changeling") def ghostly_changeling(card, abilities): def ghostly_changeling(): return AbilityNotImplemented def ghostly_changeling(): return AbilityNotImplemented return ghostly_changeling, ghostly_changeling, @card("Nath's Elite") def naths_elite(card, abilities): def naths_elite(): return AbilityNotImplemented def naths_elite(): return AbilityNotImplemented return naths_elite, naths_elite, @card("Battlewand Oak") def battlewand_oak(card, abilities): def battlewand_oak(): return AbilityNotImplemented def battlewand_oak(): return AbilityNotImplemented return battlewand_oak, battlewand_oak, @card("Flamekin Brawler") def flamekin_brawler(card, abilities): def flamekin_brawler(): return AbilityNotImplemented return flamekin_brawler, @card("Mosswort Bridge") def mosswort_bridge(card, abilities): def mosswort_bridge(): return AbilityNotImplemented def mosswort_bridge(): return AbilityNotImplemented def mosswort_bridge(): return AbilityNotImplemented return mosswort_bridge, mosswort_bridge, mosswort_bridge, @card("Boggart Forager") def boggart_forager(card, abilities): def boggart_forager(): return AbilityNotImplemented return boggart_forager, @card("Gilt-Leaf Seer") def giltleaf_seer(card, abilities): def giltleaf_seer(): return AbilityNotImplemented return giltleaf_seer, @card("Inner-Flame Acolyte") def innerflame_acolyte(card, abilities): def innerflame_acolyte(): return AbilityNotImplemented def innerflame_acolyte(): return AbilityNotImplemented return innerflame_acolyte, innerflame_acolyte, @card("Nightshade Stinger") def nightshade_stinger(card, abilities): def nightshade_stinger(): return AbilityNotImplemented def nightshade_stinger(): return AbilityNotImplemented return nightshade_stinger, nightshade_stinger, @card("Arbiter of Knollridge") def arbiter_of_knollridge(card, abilities): def arbiter_of_knollridge(): return AbilityNotImplemented def arbiter_of_knollridge(): return AbilityNotImplemented return arbiter_of_knollridge, arbiter_of_knollridge, @card("Incendiary Command") def incendiary_command(card, abilities): def incendiary_command(): return AbilityNotImplemented return incendiary_command, @card("Bog-Strider Ash") def bogstrider_ash(card, abilities): def bogstrider_ash(): return AbilityNotImplemented def bogstrider_ash(): return AbilityNotImplemented return bogstrider_ash, bogstrider_ash, @card("Wydwen, the Biting Gale") def wydwen_the_biting_gale(card, abilities): def wydwen_the_biting_gale(): return AbilityNotImplemented def wydwen_the_biting_gale(): return AbilityNotImplemented def wydwen_the_biting_gale(): return AbilityNotImplemented return wydwen_the_biting_gale, wydwen_the_biting_gale, wydwen_the_biting_gale, @card("Caterwauling Boggart") def caterwauling_boggart(card, abilities): def caterwauling_boggart(): return AbilityNotImplemented def caterwauling_boggart(): return AbilityNotImplemented return caterwauling_boggart, caterwauling_boggart, @card("Primal Command") def primal_command(card, abilities): def primal_command(): return AbilityNotImplemented return primal_command, @card("Goldmeadow Dodger") def goldmeadow_dodger(card, abilities): def goldmeadow_dodger(): return AbilityNotImplemented return goldmeadow_dodger, @card("Sunrise Sovereign") def sunrise_sovereign(card, abilities): def sunrise_sovereign(): return AbilityNotImplemented return sunrise_sovereign, @card("Moonglove Winnower") def moonglove_winnower(card, abilities): def moonglove_winnower(): return AbilityNotImplemented return moonglove_winnower, @card("Woodland Changeling") def woodland_changeling(card, abilities): def woodland_changeling(): return AbilityNotImplemented return woodland_changeling, @card("Spring Cleaning") def spring_cleaning(card, abilities): def spring_cleaning(): return AbilityNotImplemented return spring_cleaning, @card("Captivating Glance") def captivating_glance(card, abilities): def captivating_glance(): return AbilityNotImplemented def captivating_glance(): return AbilityNotImplemented return captivating_glance, captivating_glance, @card("Wren's Run Vanquisher") def wrens_run_vanquisher(card, abilities): def wrens_run_vanquisher(): return AbilityNotImplemented def wrens_run_vanquisher(): return AbilityNotImplemented return wrens_run_vanquisher, wrens_run_vanquisher, @card("Lowland Oaf") def lowland_oaf(card, abilities): def lowland_oaf(): return AbilityNotImplemented return lowland_oaf, @card("Fathom Trawl") def fathom_trawl(card, abilities): def fathom_trawl(): return AbilityNotImplemented return fathom_trawl, @card("Heat Shimmer") def heat_shimmer(card, abilities): def heat_shimmer(): return AbilityNotImplemented return heat_shimmer, @card("Thousand-Year Elixir") def thousandyear_elixir(card, abilities): def thousandyear_elixir(): return AbilityNotImplemented def thousandyear_elixir(): return AbilityNotImplemented return thousandyear_elixir, thousandyear_elixir, @card("Hearthcage Giant") def hearthcage_giant(card, abilities): def hearthcage_giant(): return AbilityNotImplemented def hearthcage_giant(): return AbilityNotImplemented return hearthcage_giant, hearthcage_giant, @card("Austere Command") def austere_command(card, abilities): def austere_command(): return AbilityNotImplemented return austere_command, @card("Kinsbaile Skirmisher") def kinsbaile_skirmisher(card, abilities): def kinsbaile_skirmisher(): return AbilityNotImplemented return kinsbaile_skirmisher, @card("Wren's Run Packmaster") def wrens_run_packmaster(card, abilities): def wrens_run_packmaster(): return AbilityNotImplemented def wrens_run_packmaster(): return AbilityNotImplemented def wrens_run_packmaster(): return AbilityNotImplemented return wrens_run_packmaster, wrens_run_packmaster, wrens_run_packmaster, @card("Treefolk Harbinger") def treefolk_harbinger(card, abilities): def treefolk_harbinger(): return AbilityNotImplemented return treefolk_harbinger, @card("Flamekin Bladewhirl") def flamekin_bladewhirl(card, abilities): def flamekin_bladewhirl(): return AbilityNotImplemented return flamekin_bladewhirl, @card("Epic Proportions") def epic_proportions(card, abilities): def epic_proportions(): return AbilityNotImplemented def epic_proportions(): return AbilityNotImplemented def epic_proportions(): return AbilityNotImplemented return epic_proportions, epic_proportions, epic_proportions, @card("Ashling's Prerogative") def ashlings_prerogative(card, abilities): def ashlings_prerogative(): return AbilityNotImplemented def ashlings_prerogative(): return AbilityNotImplemented def ashlings_prerogative(): return AbilityNotImplemented return ashlings_prerogative, ashlings_prerogative, ashlings_prerogative, @card("Triclopean Sight") def triclopean_sight(card, abilities): def triclopean_sight(): return AbilityNotImplemented def triclopean_sight(): return AbilityNotImplemented def triclopean_sight(): return AbilityNotImplemented def triclopean_sight(): return AbilityNotImplemented return triclopean_sight, triclopean_sight, triclopean_sight, triclopean_sight, @card("Harpoon Sniper") def harpoon_sniper(card, abilities): def harpoon_sniper(): return AbilityNotImplemented return harpoon_sniper, @card("Oaken Brawler") def oaken_brawler(card, abilities): def oaken_brawler(): return AbilityNotImplemented return oaken_brawler, @card("Hornet Harasser") def hornet_harasser(card, abilities): def hornet_harasser(): return AbilityNotImplemented return hornet_harasser, @card("Protective Bubble") def protective_bubble(card, abilities): def protective_bubble(): return AbilityNotImplemented def protective_bubble(): return AbilityNotImplemented return protective_bubble, protective_bubble, @card("Thieving Sprite") def thieving_sprite(card, abilities): def thieving_sprite(): return AbilityNotImplemented def thieving_sprite(): return AbilityNotImplemented return thieving_sprite, thieving_sprite, @card("Knight of Meadowgrain") def knight_of_meadowgrain(card, abilities): def knight_of_meadowgrain(): return AbilityNotImplemented def knight_of_meadowgrain(): return AbilityNotImplemented return knight_of_meadowgrain, knight_of_meadowgrain, @card("Galepowder Mage") def galepowder_mage(card, abilities): def galepowder_mage(): return AbilityNotImplemented def galepowder_mage(): return AbilityNotImplemented return galepowder_mage, galepowder_mage, @card("Gaddock Teeg") def gaddock_teeg(card, abilities): def gaddock_teeg(): return AbilityNotImplemented def gaddock_teeg(): return AbilityNotImplemented return gaddock_teeg, gaddock_teeg, @card("Fire-Belly Changeling") def firebelly_changeling(card, abilities): def firebelly_changeling(): return AbilityNotImplemented def firebelly_changeling(): return AbilityNotImplemented return firebelly_changeling, firebelly_changeling, @card("Hostility") def hostility(card, abilities): def hostility(): return AbilityNotImplemented def hostility(): return AbilityNotImplemented def hostility(): return AbilityNotImplemented return hostility, hostility, hostility, @card("Profane Command") def profane_command(card, abilities): def profane_command(): return AbilityNotImplemented return profane_command, @card("Secluded Glen") def secluded_glen(card, abilities): def secluded_glen(): return AbilityNotImplemented def secluded_glen(): return AbilityNotImplemented return secluded_glen, secluded_glen, @card("Oakgnarl Warrior") def oakgnarl_warrior(card, abilities): def oakgnarl_warrior(): return AbilityNotImplemented return oakgnarl_warrior, @card("Footbottom Feast") def footbottom_feast(card, abilities): def footbottom_feast(): return AbilityNotImplemented def footbottom_feast(): return AbilityNotImplemented return footbottom_feast, footbottom_feast, @card("Dreamspoiler Witches") def dreamspoiler_witches(card, abilities): def dreamspoiler_witches(): return AbilityNotImplemented def dreamspoiler_witches(): return AbilityNotImplemented return dreamspoiler_witches, dreamspoiler_witches, @card("Weed Strangle") def weed_strangle(card, abilities): def weed_strangle(): return AbilityNotImplemented return weed_strangle, @card("Changeling Titan") def changeling_titan(card, abilities): def changeling_titan(): return AbilityNotImplemented def changeling_titan(): return AbilityNotImplemented return changeling_titan, changeling_titan, @card("Nath of the Gilt-Leaf") def nath_of_the_giltleaf(card, abilities): def nath_of_the_giltleaf(): return AbilityNotImplemented def nath_of_the_giltleaf(): return AbilityNotImplemented return nath_of_the_giltleaf, nath_of_the_giltleaf, @card("Ashling the Pilgrim") def ashling_the_pilgrim(card, abilities): def ashling_the_pilgrim(): return AbilityNotImplemented return ashling_the_pilgrim, @card("Flamekin Spitfire") def flamekin_spitfire(card, abilities): def flamekin_spitfire(): return AbilityNotImplemented return flamekin_spitfire, @card("Faerie Harbinger") def faerie_harbinger(card, abilities): def faerie_harbinger(): return AbilityNotImplemented def faerie_harbinger(): return AbilityNotImplemented def faerie_harbinger(): return AbilityNotImplemented return faerie_harbinger, faerie_harbinger, faerie_harbinger, @card("Herbal Poultice") def herbal_poultice(card, abilities): def herbal_poultice(): return AbilityNotImplemented return herbal_poultice, @card("Elvish Handservant") def elvish_handservant(card, abilities): def elvish_handservant(): return AbilityNotImplemented return elvish_handservant, @card("Mournwhelk") def mournwhelk(card, abilities): def mournwhelk(): return AbilityNotImplemented def mournwhelk(): return AbilityNotImplemented return mournwhelk, mournwhelk, @card("Hillcomber Giant") def hillcomber_giant(card, abilities): def hillcomber_giant(): return AbilityNotImplemented return hillcomber_giant, @card("Battle Mastery") def battle_mastery(card, abilities): def battle_mastery(): return AbilityNotImplemented def battle_mastery(): return AbilityNotImplemented return battle_mastery, battle_mastery, @card("Turtleshell Changeling") def turtleshell_changeling(card, abilities): def turtleshell_changeling(): return AbilityNotImplemented def turtleshell_changeling(): return AbilityNotImplemented return turtleshell_changeling, turtleshell_changeling, @card("Cloudcrown Oak") def cloudcrown_oak(card, abilities): def cloudcrown_oak(): return AbilityNotImplemented return cloudcrown_oak, @card("Ancient Amphitheater") def ancient_amphitheater(card, abilities): def ancient_amphitheater(): return AbilityNotImplemented def ancient_amphitheater(): return AbilityNotImplemented return ancient_amphitheater, ancient_amphitheater, @card("Imperious Perfect") def imperious_perfect(card, abilities): def imperious_perfect(): return AbilityNotImplemented def imperious_perfect(): return AbilityNotImplemented return imperious_perfect, imperious_perfect, @card("Colfenor's Urn") def colfenors_urn(card, abilities): def colfenors_urn(): return AbilityNotImplemented def colfenors_urn(): return AbilityNotImplemented return colfenors_urn, colfenors_urn, @card("Wispmare") def wispmare(card, abilities): def wispmare(): return AbilityNotImplemented def wispmare(): return AbilityNotImplemented def wispmare(): return AbilityNotImplemented return wispmare, wispmare, wispmare, @card("Forced Fruition") def forced_fruition(card, abilities): def forced_fruition(): return AbilityNotImplemented return forced_fruition, @card("Benthicore") def benthicore(card, abilities): def benthicore(): return AbilityNotImplemented def benthicore(): return AbilityNotImplemented return benthicore, benthicore, @card("Flamekin Harbinger") def flamekin_harbinger(card, abilities): def flamekin_harbinger(): return AbilityNotImplemented return flamekin_harbinger, @card("Warren Pilferers") def warren_pilferers(card, abilities): def warren_pilferers(): return AbilityNotImplemented return warren_pilferers, @card("Warren-Scourge Elf") def warrenscourge_elf(card, abilities): def warrenscourge_elf(): return AbilityNotImplemented return warrenscourge_elf, @card("Purity") def purity(card, abilities): def purity(): return AbilityNotImplemented def purity(): return AbilityNotImplemented def purity(): return AbilityNotImplemented return purity, purity, purity, @card("Hurly-Burly") def hurlyburly(card, abilities): def hurlyburly(): return AbilityNotImplemented return hurlyburly, @card("Immaculate Magistrate") def immaculate_magistrate(card, abilities): def immaculate_magistrate(): return AbilityNotImplemented return immaculate_magistrate, @card("Ponder") def ponder(card, abilities): def ponder(): return AbilityNotImplemented def ponder(): return AbilityNotImplemented return ponder, ponder, @card("Cloudgoat Ranger") def cloudgoat_ranger(card, abilities): def cloudgoat_ranger(): return AbilityNotImplemented def cloudgoat_ranger(): return AbilityNotImplemented return cloudgoat_ranger, cloudgoat_ranger, @card("Sentinels of Glen Elendra") def sentinels_of_glen_elendra(card, abilities): def sentinels_of_glen_elendra(): return AbilityNotImplemented def sentinels_of_glen_elendra(): return AbilityNotImplemented return sentinels_of_glen_elendra, sentinels_of_glen_elendra, @card("Woodland Guidance") def woodland_guidance(card, abilities): def woodland_guidance(): return AbilityNotImplemented def woodland_guidance(): return AbilityNotImplemented return woodland_guidance, woodland_guidance, @card("Facevaulter") def facevaulter(card, abilities): def facevaulter(): return AbilityNotImplemented return facevaulter, @card("Stinkdrinker Daredevil") def stinkdrinker_daredevil(card, abilities): def stinkdrinker_daredevil(): return AbilityNotImplemented return stinkdrinker_daredevil, @card("Nova Chaser") def nova_chaser(card, abilities): def nova_chaser(): return AbilityNotImplemented def nova_chaser(): return AbilityNotImplemented return nova_chaser, nova_chaser, @card("Goatnapper") def goatnapper(card, abilities): def goatnapper(): return AbilityNotImplemented return goatnapper, @card("Ethereal Whiskergill") def ethereal_whiskergill(card, abilities): def ethereal_whiskergill(): return AbilityNotImplemented def ethereal_whiskergill(): return AbilityNotImplemented return ethereal_whiskergill, ethereal_whiskergill, @card("Mulldrifter") def mulldrifter(card, abilities): def mulldrifter(): return AbilityNotImplemented def mulldrifter(): return AbilityNotImplemented def mulldrifter(): return AbilityNotImplemented return mulldrifter, mulldrifter, mulldrifter, @card("Surgespanner") def surgespanner(card, abilities): def surgespanner(): return AbilityNotImplemented return surgespanner, @card("Vigor") def vigor(card, abilities): def vigor(): return AbilityNotImplemented def vigor(): return AbilityNotImplemented def vigor(): return AbilityNotImplemented return vigor, vigor, vigor, @card("Cairn Wanderer") def cairn_wanderer(card, abilities): def cairn_wanderer(): return AbilityNotImplemented def cairn_wanderer(): return AbilityNotImplemented return cairn_wanderer, cairn_wanderer, @card("Twinning Glass") def twinning_glass(card, abilities): def twinning_glass(): return AbilityNotImplemented return twinning_glass, @card("Final Revels") def final_revels(card, abilities): def final_revels(): return AbilityNotImplemented return final_revels, @card("Knucklebone Witch") def knucklebone_witch(card, abilities): def knucklebone_witch(): return AbilityNotImplemented return knucklebone_witch, @card("Fallowsage") def fallowsage(card, abilities): def fallowsage(): return AbilityNotImplemented return fallowsage, @card("Brion Stoutarm") def brion_stoutarm(card, abilities): def brion_stoutarm(): return AbilityNotImplemented def brion_stoutarm(): return AbilityNotImplemented return brion_stoutarm, brion_stoutarm, @card("Avian Changeling") def avian_changeling(card, abilities): def avian_changeling(): return AbilityNotImplemented def avian_changeling(): return AbilityNotImplemented return avian_changeling, avian_changeling, @card("Wort, Boggart Auntie") def wort_boggart_auntie(card, abilities): def wort_boggart_auntie(): return AbilityNotImplemented def wort_boggart_auntie(): return AbilityNotImplemented return wort_boggart_auntie, wort_boggart_auntie, @card("Wizened Cenn") def wizened_cenn(card, abilities): def wizened_cenn(): return AbilityNotImplemented return wizened_cenn, @card("Wanderwine Hub") def wanderwine_hub(card, abilities): def wanderwine_hub(): return AbilityNotImplemented def wanderwine_hub(): return AbilityNotImplemented return wanderwine_hub, wanderwine_hub, @card("Silvergill Douser") def silvergill_douser(card, abilities): def silvergill_douser(): return AbilityNotImplemented return silvergill_douser, @card("Lys Alana Scarblade") def lys_alana_scarblade(card, abilities): def lys_alana_scarblade(): return AbilityNotImplemented return lys_alana_scarblade, @card("Elvish Eulogist") def elvish_eulogist(card, abilities): def elvish_eulogist(): return AbilityNotImplemented return elvish_eulogist, @card("Mad Auntie") def mad_auntie(card, abilities): def mad_auntie(): return AbilityNotImplemented def mad_auntie(): return AbilityNotImplemented return mad_auntie, mad_auntie, @card("Pollen Lullaby") def pollen_lullaby(card, abilities): def pollen_lullaby(): return AbilityNotImplemented return pollen_lullaby, @card("Oona's Prowler") def oonas_prowler(card, abilities): def oonas_prowler(): return AbilityNotImplemented def oonas_prowler(): return AbilityNotImplemented return oonas_prowler, oonas_prowler, @card("Lash Out") def lash_out(card, abilities): def lash_out(): return AbilityNotImplemented return lash_out, @card("Sylvan Echoes") def sylvan_echoes(card, abilities): def sylvan_echoes(): return AbilityNotImplemented return sylvan_echoes, @card("Nettlevine Blight") def nettlevine_blight(card, abilities): def nettlevine_blight(): return AbilityNotImplemented def nettlevine_blight(): return AbilityNotImplemented return nettlevine_blight, nettlevine_blight, @card("Dawnfluke") def dawnfluke(card, abilities): def dawnfluke(): return AbilityNotImplemented def dawnfluke(): return AbilityNotImplemented def dawnfluke(): return AbilityNotImplemented return dawnfluke, dawnfluke, dawnfluke, @card("Howltooth Hollow") def howltooth_hollow(card, abilities): def howltooth_hollow(): return AbilityNotImplemented def howltooth_hollow(): return AbilityNotImplemented def howltooth_hollow(): return AbilityNotImplemented return howltooth_hollow, howltooth_hollow, howltooth_hollow, @card("Smokebraider") def smokebraider(card, abilities): def smokebraider(): return AbilityNotImplemented return smokebraider, @card("Boggart Loggers") def boggart_loggers(card, abilities): def boggart_loggers(): return AbilityNotImplemented def boggart_loggers(): return AbilityNotImplemented return boggart_loggers, boggart_loggers, @card("Glarewielder") def glarewielder(card, abilities): def glarewielder(): return AbilityNotImplemented def glarewielder(): return AbilityNotImplemented def glarewielder(): return AbilityNotImplemented return glarewielder, glarewielder, glarewielder, @card("Soulbright Flamekin") def soulbright_flamekin(card, abilities): def soulbright_flamekin(): return AbilityNotImplemented return soulbright_flamekin, @card("Leaf Gilder") def leaf_gilder(card, abilities): def leaf_gilder(): return AbilityNotImplemented return leaf_gilder, @card("Wild Ricochet") def wild_ricochet(card, abilities): def wild_ricochet(): return AbilityNotImplemented return wild_ricochet, @card("Kinsbaile Balloonist") def kinsbaile_balloonist(card, abilities): def kinsbaile_balloonist(): return AbilityNotImplemented def kinsbaile_balloonist(): return AbilityNotImplemented return kinsbaile_balloonist, kinsbaile_balloonist, @card("Amoeboid Changeling") def amoeboid_changeling(card, abilities): def amoeboid_changeling(): return AbilityNotImplemented def amoeboid_changeling(): return AbilityNotImplemented def amoeboid_changeling(): return AbilityNotImplemented return amoeboid_changeling, amoeboid_changeling, amoeboid_changeling, @card("Thorntooth Witch") def thorntooth_witch(card, abilities): def thorntooth_witch(): return AbilityNotImplemented return thorntooth_witch, @card("Zephyr Net") def zephyr_net(card, abilities): def zephyr_net(): return AbilityNotImplemented def zephyr_net(): return AbilityNotImplemented return zephyr_net, zephyr_net, @card("Wanderwine Prophets") def wanderwine_prophets(card, abilities): def wanderwine_prophets(): return AbilityNotImplemented def wanderwine_prophets(): return AbilityNotImplemented return wanderwine_prophets, wanderwine_prophets, @card("Fistful of Force") def fistful_of_force(card, abilities): def fistful_of_force(): return AbilityNotImplemented return fistful_of_force, @card("Cryptic Command") def cryptic_command(card, abilities): def cryptic_command(): return AbilityNotImplemented return cryptic_command, @card("Drowner of Secrets") def drowner_of_secrets(card, abilities): def drowner_of_secrets(): return AbilityNotImplemented return drowner_of_secrets, @card("Elvish Harbinger") def elvish_harbinger(card, abilities): def elvish_harbinger(): return AbilityNotImplemented def elvish_harbinger(): return AbilityNotImplemented return elvish_harbinger, elvish_harbinger, @card("Lace with Moonglove") def lace_with_moonglove(card, abilities): def lace_with_moonglove(): return AbilityNotImplemented def lace_with_moonglove(): return AbilityNotImplemented return lace_with_moonglove, lace_with_moonglove, @card("Familiar's Ruse") def familiars_ruse(card, abilities): def familiars_ruse(): return AbilityNotImplemented def familiars_ruse(): return AbilityNotImplemented return familiars_ruse, familiars_ruse, @card("Stonybrook Angler") def stonybrook_angler(card, abilities): def stonybrook_angler(): return AbilityNotImplemented return stonybrook_angler, @card("Shelldock Isle") def shelldock_isle(card, abilities): def shelldock_isle(): return AbilityNotImplemented def shelldock_isle(): return AbilityNotImplemented def shelldock_isle(): return AbilityNotImplemented return shelldock_isle, shelldock_isle, shelldock_isle, @card("Spinerock Knoll") def spinerock_knoll(card, abilities): def spinerock_knoll(): return AbilityNotImplemented def spinerock_knoll(): return AbilityNotImplemented def spinerock_knoll(): return AbilityNotImplemented return spinerock_knoll, spinerock_knoll, spinerock_knoll, @card("Sower of Temptation") def sower_of_temptation(card, abilities): def sower_of_temptation(): return AbilityNotImplemented def sower_of_temptation(): return AbilityNotImplemented return sower_of_temptation, sower_of_temptation, @card("Merrow Harbinger") def merrow_harbinger(card, abilities): def merrow_harbinger(): return AbilityNotImplemented def merrow_harbinger(): return AbilityNotImplemented return merrow_harbinger, merrow_harbinger, @card("Runed Stalactite") def runed_stalactite(card, abilities): def runed_stalactite(): return AbilityNotImplemented def runed_stalactite(): return AbilityNotImplemented return runed_stalactite, runed_stalactite, @card("Nath's Buffoon") def naths_buffoon(card, abilities): def naths_buffoon(): return AbilityNotImplemented return naths_buffoon, @card("Mistbind Clique") def mistbind_clique(card, abilities): def mistbind_clique(): return AbilityNotImplemented def mistbind_clique(): return AbilityNotImplemented def mistbind_clique(): return AbilityNotImplemented def mistbind_clique(): return AbilityNotImplemented return mistbind_clique, mistbind_clique, mistbind_clique, mistbind_clique, @card("Heal the Scars") def heal_the_scars(card, abilities): def heal_the_scars(): return AbilityNotImplemented return heal_the_scars, @card("Broken Ambitions") def broken_ambitions(card, abilities): def broken_ambitions(): return AbilityNotImplemented return broken_ambitions, @card("Cenn's Heir") def cenns_heir(card, abilities): def cenns_heir(): return AbilityNotImplemented return cenns_heir, @card("Dauntless Dourbark") def dauntless_dourbark(card, abilities): def dauntless_dourbark(): return AbilityNotImplemented def dauntless_dourbark(): return AbilityNotImplemented return dauntless_dourbark, dauntless_dourbark, @card("Jace Beleren") def jace_beleren(card, abilities): def jace_beleren(): return AbilityNotImplemented def jace_beleren(): return AbilityNotImplemented def jace_beleren(): return AbilityNotImplemented return jace_beleren, jace_beleren, jace_beleren, @card("Hunter of Eyeblights") def hunter_of_eyeblights(card, abilities): def hunter_of_eyeblights(): return AbilityNotImplemented def hunter_of_eyeblights(): return AbilityNotImplemented return hunter_of_eyeblights, hunter_of_eyeblights, @card("Timber Protector") def timber_protector(card, abilities): def timber_protector(): return AbilityNotImplemented def timber_protector(): return AbilityNotImplemented return timber_protector, timber_protector, @card("Changeling Berserker") def changeling_berserker(card, abilities): def changeling_berserker(): return AbilityNotImplemented def changeling_berserker(): return AbilityNotImplemented def changeling_berserker(): return AbilityNotImplemented return changeling_berserker, changeling_berserker, changeling_berserker, @card("Kithkin Daggerdare") def kithkin_daggerdare(card, abilities): def kithkin_daggerdare(): return AbilityNotImplemented return kithkin_daggerdare, @card("Sygg, River Guide") def sygg_river_guide(card, abilities): def sygg_river_guide(): return AbilityNotImplemented def sygg_river_guide(): return AbilityNotImplemented return sygg_river_guide, sygg_river_guide, @card("Lammastide Weave") def lammastide_weave(card, abilities): def lammastide_weave(): return AbilityNotImplemented def lammastide_weave(): return AbilityNotImplemented return lammastide_weave, lammastide_weave, @card("Changeling Hero") def changeling_hero(card, abilities): def changeling_hero(): return AbilityNotImplemented def changeling_hero(): return AbilityNotImplemented def changeling_hero(): return AbilityNotImplemented return changeling_hero, changeling_hero, changeling_hero, @card("Ceaseless Searblades") def ceaseless_searblades(card, abilities): def ceaseless_searblades(): return AbilityNotImplemented return ceaseless_searblades, @card("Guardian of Cloverdell") def guardian_of_cloverdell(card, abilities): def guardian_of_cloverdell(): return AbilityNotImplemented def guardian_of_cloverdell(): return AbilityNotImplemented return guardian_of_cloverdell, guardian_of_cloverdell, @card("Springjack Knight") def springjack_knight(card, abilities): def springjack_knight(): return AbilityNotImplemented return springjack_knight, @card("Judge of Currents") def judge_of_currents(card, abilities): def judge_of_currents(): return AbilityNotImplemented return judge_of_currents, @card("Lys Alana Huntmaster") def lys_alana_huntmaster(card, abilities): def lys_alana_huntmaster(): return AbilityNotImplemented return lys_alana_huntmaster, @card("Guile") def guile(card, abilities): def guile(): return AbilityNotImplemented def guile(): return AbilityNotImplemented def guile(): return AbilityNotImplemented return guile, guile, guile, @card("Veteran of the Depths") def veteran_of_the_depths(card, abilities): def veteran_of_the_depths(): return AbilityNotImplemented return veteran_of_the_depths, @card("Briarhorn") def briarhorn(card, abilities): def briarhorn(): return AbilityNotImplemented def briarhorn(): return AbilityNotImplemented def briarhorn(): return AbilityNotImplemented return briarhorn, briarhorn, briarhorn, @card("Deathrender") def deathrender(card, abilities): def deathrender(): return AbilityNotImplemented def deathrender(): return AbilityNotImplemented def deathrender(): return AbilityNotImplemented return deathrender, deathrender, deathrender, @card("Cloudthresher") def cloudthresher(card, abilities): def cloudthresher(): return AbilityNotImplemented def cloudthresher(): return AbilityNotImplemented def cloudthresher(): return AbilityNotImplemented def cloudthresher(): return AbilityNotImplemented return cloudthresher, cloudthresher, cloudthresher, cloudthresher, @card("Thoughtseize") def thoughtseize(card, abilities): def thoughtseize(): return AbilityNotImplemented return thoughtseize, @card("Goldmeadow Harrier") def goldmeadow_harrier(card, abilities): def goldmeadow_harrier(): return AbilityNotImplemented return goldmeadow_harrier, @card("Spellstutter Sprite") def spellstutter_sprite(card, abilities): def spellstutter_sprite(): return AbilityNotImplemented def spellstutter_sprite(): return AbilityNotImplemented def spellstutter_sprite(): return AbilityNotImplemented return spellstutter_sprite, spellstutter_sprite, spellstutter_sprite, @card("Nectar Faerie") def nectar_faerie(card, abilities): def nectar_faerie(): return AbilityNotImplemented def nectar_faerie(): return AbilityNotImplemented return nectar_faerie, nectar_faerie, @card("Glen Elendra Pranksters") def glen_elendra_pranksters(card, abilities): def glen_elendra_pranksters(): return AbilityNotImplemented def glen_elendra_pranksters(): return AbilityNotImplemented return glen_elendra_pranksters, glen_elendra_pranksters, @card("Inner-Flame Igniter") def innerflame_igniter(card, abilities): def innerflame_igniter(): return AbilityNotImplemented return innerflame_igniter, @card("Bog Hoodlums") def bog_hoodlums(card, abilities): def bog_hoodlums(): return AbilityNotImplemented def bog_hoodlums(): return AbilityNotImplemented return bog_hoodlums, bog_hoodlums, @card("Marsh Flitter") def marsh_flitter(card, abilities): def marsh_flitter(): return AbilityNotImplemented def marsh_flitter(): return AbilityNotImplemented def marsh_flitter(): return AbilityNotImplemented return marsh_flitter, marsh_flitter, marsh_flitter, @card("Elvish Branchbender") def elvish_branchbender(card, abilities): def elvish_branchbender(): return AbilityNotImplemented return elvish_branchbender, @card("Ringskipper") def ringskipper(card, abilities): def ringskipper(): return AbilityNotImplemented def ringskipper(): return AbilityNotImplemented return ringskipper, ringskipper, @card("Kithkin Mourncaller") def kithkin_mourncaller(card, abilities): def kithkin_mourncaller(): return AbilityNotImplemented return kithkin_mourncaller, @card("Vivid Marsh") def vivid_marsh(card, abilities): def vivid_marsh(): return AbilityNotImplemented def vivid_marsh(): return AbilityNotImplemented def vivid_marsh(): return AbilityNotImplemented return vivid_marsh, vivid_marsh, vivid_marsh, @card("Soaring Hope") def soaring_hope(card, abilities): def soaring_hope(): return AbilityNotImplemented def soaring_hope(): return AbilityNotImplemented def soaring_hope(): return AbilityNotImplemented def soaring_hope(): return AbilityNotImplemented return soaring_hope, soaring_hope, soaring_hope, soaring_hope, @card("Vivid Creek") def vivid_creek(card, abilities): def vivid_creek(): return AbilityNotImplemented def vivid_creek(): return AbilityNotImplemented def vivid_creek(): return AbilityNotImplemented return vivid_creek, vivid_creek, vivid_creek, @card("Tar Pitcher") def tar_pitcher(card, abilities): def tar_pitcher(): return AbilityNotImplemented return tar_pitcher, @card("Pestermite") def pestermite(card, abilities): def pestermite(): return AbilityNotImplemented def pestermite(): return AbilityNotImplemented def pestermite(): return AbilityNotImplemented return pestermite, pestermite, pestermite, @card("Tideshaper Mystic") def tideshaper_mystic(card, abilities): def tideshaper_mystic(): return AbilityNotImplemented return tideshaper_mystic, @card("Seedguide Ash") def seedguide_ash(card, abilities): def seedguide_ash(): return AbilityNotImplemented return seedguide_ash, @card("Lairwatch Giant") def lairwatch_giant(card, abilities): def lairwatch_giant(): return AbilityNotImplemented def lairwatch_giant(): return AbilityNotImplemented return lairwatch_giant, lairwatch_giant, @card("Shimmering Grotto") def shimmering_grotto(card, abilities): def shimmering_grotto(): return AbilityNotImplemented def shimmering_grotto(): return AbilityNotImplemented return shimmering_grotto, shimmering_grotto, @card("Horde of Notions") def horde_of_notions(card, abilities): def horde_of_notions(): return AbilityNotImplemented def horde_of_notions(): return AbilityNotImplemented return horde_of_notions, horde_of_notions, @card("Incandescent Soulstoke") def incandescent_soulstoke(card, abilities): def incandescent_soulstoke(): return AbilityNotImplemented def incandescent_soulstoke(): return AbilityNotImplemented return incandescent_soulstoke, incandescent_soulstoke, @card("Exiled Boggart") def exiled_boggart(card, abilities): def exiled_boggart(): return AbilityNotImplemented return exiled_boggart, @card("Faultgrinder") def faultgrinder(card, abilities): def faultgrinder(): return AbilityNotImplemented def faultgrinder(): return AbilityNotImplemented def faultgrinder(): return AbilityNotImplemented return faultgrinder, faultgrinder, faultgrinder, @card("Boggart Harbinger") def boggart_harbinger(card, abilities): def boggart_harbinger(): return AbilityNotImplemented return boggart_harbinger, @card("Oblivion Ring") def oblivion_ring(card, abilities): def oblivion_ring(): return AbilityNotImplemented def oblivion_ring(): return AbilityNotImplemented return oblivion_ring, oblivion_ring, @card("Burrenton Forge-Tender") def burrenton_forgetender(card, abilities): def burrenton_forgetender(): return AbilityNotImplemented def burrenton_forgetender(): return AbilityNotImplemented return burrenton_forgetender, burrenton_forgetender, @card("Giant Harbinger") def giant_harbinger(card, abilities): def giant_harbinger(): return AbilityNotImplemented return giant_harbinger, @card("Jagged-Scar Archers") def jaggedscar_archers(card, abilities): def jaggedscar_archers(): return AbilityNotImplemented def jaggedscar_archers(): return AbilityNotImplemented return jaggedscar_archers, jaggedscar_archers, @card("Silvergill Adept") def silvergill_adept(card, abilities): def silvergill_adept(): return AbilityNotImplemented def silvergill_adept(): return AbilityNotImplemented return silvergill_adept, silvergill_adept, @card("Boggart Mob") def boggart_mob(card, abilities): def boggart_mob(): return AbilityNotImplemented def boggart_mob(): return AbilityNotImplemented return boggart_mob, boggart_mob, @card("Deeptread Merrow") def deeptread_merrow(card, abilities): def deeptread_merrow(): return AbilityNotImplemented return deeptread_merrow, @card("Needle Drop") def needle_drop(card, abilities): def needle_drop(): return AbilityNotImplemented def needle_drop(): return AbilityNotImplemented return needle_drop, needle_drop, @card("Boggart Sprite-Chaser") def boggart_spritechaser(card, abilities): def boggart_spritechaser(): return AbilityNotImplemented return boggart_spritechaser, @card("Streambed Aquitects") def streambed_aquitects(card, abilities): def streambed_aquitects(): return AbilityNotImplemented def streambed_aquitects(): return AbilityNotImplemented return streambed_aquitects, streambed_aquitects, @card("Incremental Growth") def incremental_growth(card, abilities): def incremental_growth(): return AbilityNotImplemented return incremental_growth, @card("Rings of Brighthearth") def rings_of_brighthearth(card, abilities): def rings_of_brighthearth(): return AbilityNotImplemented return rings_of_brighthearth, @card("Kithkin Harbinger") def kithkin_harbinger(card, abilities): def kithkin_harbinger(): return AbilityNotImplemented return kithkin_harbinger, @card("Wellgabber Apothecary") def wellgabber_apothecary(card, abilities): def wellgabber_apothecary(): return AbilityNotImplemented return wellgabber_apothecary, @card("Shriekmaw") def shriekmaw(card, abilities): def shriekmaw(): return AbilityNotImplemented def shriekmaw(): return AbilityNotImplemented def shriekmaw(): return AbilityNotImplemented return shriekmaw, shriekmaw, shriekmaw, @card("Neck Snap") def neck_snap(card, abilities): def neck_snap(): return AbilityNotImplemented return neck_snap, @card("Dolmen Gate") def dolmen_gate(card, abilities): def dolmen_gate(): return AbilityNotImplemented return dolmen_gate, @card("Brigid, Hero of Kinsbaile") def brigid_hero_of_kinsbaile(card, abilities): def brigid_hero_of_kinsbaile(): return AbilityNotImplemented def brigid_hero_of_kinsbaile(): return AbilityNotImplemented return brigid_hero_of_kinsbaile, brigid_hero_of_kinsbaile, @card("Whirlpool Whelm") def whirlpool_whelm(card, abilities): def whirlpool_whelm(): return AbilityNotImplemented return whirlpool_whelm, @card("Wanderer's Twig") def wanderers_twig(card, abilities): def wanderers_twig(): return AbilityNotImplemented return wanderers_twig, @card("Colfenor's Plans") def colfenors_plans(card, abilities): def colfenors_plans(): return AbilityNotImplemented def colfenors_plans(): return AbilityNotImplemented def colfenors_plans(): return AbilityNotImplemented def colfenors_plans(): return AbilityNotImplemented return colfenors_plans, colfenors_plans, colfenors_plans, colfenors_plans, @card("Moonglove Extract") def moonglove_extract(card, abilities): def moonglove_extract(): return AbilityNotImplemented return moonglove_extract, @card("Vivid Grove") def vivid_grove(card, abilities): def vivid_grove(): return AbilityNotImplemented def vivid_grove(): return AbilityNotImplemented def vivid_grove(): return AbilityNotImplemented return vivid_grove, vivid_grove, vivid_grove, @card("Ajani Goldmane") def ajani_goldmane(card, abilities): def ajani_goldmane(): return AbilityNotImplemented def ajani_goldmane(): return AbilityNotImplemented def ajani_goldmane(): return AbilityNotImplemented return ajani_goldmane, ajani_goldmane, ajani_goldmane, @card("Gilt-Leaf Palace") def giltleaf_palace(card, abilities): def giltleaf_palace(): return AbilityNotImplemented def giltleaf_palace(): return AbilityNotImplemented return giltleaf_palace, giltleaf_palace, @card("Windbrisk Heights") def windbrisk_heights(card, abilities): def windbrisk_heights(): return AbilityNotImplemented def windbrisk_heights(): return AbilityNotImplemented def windbrisk_heights(): return AbilityNotImplemented return windbrisk_heights, windbrisk_heights, windbrisk_heights, @card("Hunt Down") def hunt_down(card, abilities): def hunt_down(): return AbilityNotImplemented return hunt_down, @card("Quill-Slinger Boggart") def quillslinger_boggart(card, abilities): def quillslinger_boggart(): return AbilityNotImplemented return quillslinger_boggart, @card("Inkfathom Divers") def inkfathom_divers(card, abilities): def inkfathom_divers(): return AbilityNotImplemented def inkfathom_divers(): return AbilityNotImplemented return inkfathom_divers, inkfathom_divers, @card("Ingot Chewer") def ingot_chewer(card, abilities): def ingot_chewer(): return AbilityNotImplemented def ingot_chewer(): return AbilityNotImplemented return ingot_chewer, ingot_chewer, @card("Vivid Crag") def vivid_crag(card, abilities): def vivid_crag(): return AbilityNotImplemented def vivid_crag(): return AbilityNotImplemented def vivid_crag(): return AbilityNotImplemented return vivid_crag, vivid_crag, vivid_crag, @card("Springleaf Drum") def springleaf_drum(card, abilities): def springleaf_drum(): return AbilityNotImplemented return springleaf_drum, @card("Dread") def dread(card, abilities): def dread(): return AbilityNotImplemented def dread(): return AbilityNotImplemented def dread(): return AbilityNotImplemented return dread, dread, dread, @card("Entangling Trap") def entangling_trap(card, abilities): def entangling_trap(): return AbilityNotImplemented return entangling_trap, @card("Merrow Reejerey") def merrow_reejerey(card, abilities): def merrow_reejerey(): return AbilityNotImplemented def merrow_reejerey(): return AbilityNotImplemented return merrow_reejerey, merrow_reejerey, @card("Mirror Entity") def mirror_entity(card, abilities): def mirror_entity(): return AbilityNotImplemented def mirror_entity(): return AbilityNotImplemented return mirror_entity, mirror_entity, @card("Glimmerdust Nap") def glimmerdust_nap(card, abilities): def glimmerdust_nap(): return AbilityNotImplemented def glimmerdust_nap(): return AbilityNotImplemented return glimmerdust_nap, glimmerdust_nap, @card("Garruk Wildspeaker") def garruk_wildspeaker(card, abilities): def garruk_wildspeaker(): return AbilityNotImplemented def garruk_wildspeaker(): return AbilityNotImplemented def garruk_wildspeaker(): return AbilityNotImplemented return garruk_wildspeaker, garruk_wildspeaker, garruk_wildspeaker, @card("Goldmeadow Stalwart") def goldmeadow_stalwart(card, abilities): def goldmeadow_stalwart(): return AbilityNotImplemented return goldmeadow_stalwart, @card("Masked Admirers") def masked_admirers(card, abilities): def masked_admirers(): return AbilityNotImplemented def masked_admirers(): return AbilityNotImplemented return masked_admirers, masked_admirers, @card("Black Poplar Shaman") def black_poplar_shaman(card, abilities): def black_poplar_shaman(): return AbilityNotImplemented return black_poplar_shaman, @card("Scion of Oona") def scion_of_oona(card, abilities): def scion_of_oona(): return AbilityNotImplemented def scion_of_oona(): return AbilityNotImplemented def scion_of_oona(): return AbilityNotImplemented def scion_of_oona(): return AbilityNotImplemented return scion_of_oona, scion_of_oona, scion_of_oona, scion_of_oona, @card("Plover Knights") def plover_knights(card, abilities): def plover_knights(): return AbilityNotImplemented return plover_knights, @card("Skeletal Changeling") def skeletal_changeling(card, abilities): def skeletal_changeling(): return AbilityNotImplemented def skeletal_changeling(): return AbilityNotImplemented return skeletal_changeling, skeletal_changeling, @card("Thorn of Amethyst") def thorn_of_amethyst(card, abilities): def thorn_of_amethyst(): return AbilityNotImplemented return thorn_of_amethyst, @card("Scarred Vinebreeder") def scarred_vinebreeder(card, abilities): def scarred_vinebreeder(): return AbilityNotImplemented return scarred_vinebreeder, @card("Adder-Staff Boggart") def adderstaff_boggart(card, abilities): def adderstaff_boggart(): return AbilityNotImplemented return adderstaff_boggart, @card("Sentry Oak") def sentry_oak(card, abilities): def sentry_oak(): return AbilityNotImplemented def sentry_oak(): return AbilityNotImplemented return sentry_oak, sentry_oak, @card("Spiderwig Boggart") def spiderwig_boggart(card, abilities): def spiderwig_boggart(): return AbilityNotImplemented return spiderwig_boggart, @card("Chandra Nalaar") def chandra_nalaar(card, abilities): def chandra_nalaar(): return AbilityNotImplemented def chandra_nalaar(): return AbilityNotImplemented def chandra_nalaar(): return AbilityNotImplemented return chandra_nalaar, chandra_nalaar, chandra_nalaar, @card("Thundercloud Shaman") def thundercloud_shaman(card, abilities): def thundercloud_shaman(): return AbilityNotImplemented return thundercloud_shaman, @card("Shapesharer") def shapesharer(card, abilities): def shapesharer(): return AbilityNotImplemented def shapesharer(): return AbilityNotImplemented return shapesharer, shapesharer, @card("Mudbutton Torchrunner") def mudbutton_torchrunner(card, abilities): def mudbutton_torchrunner(): return AbilityNotImplemented return mudbutton_torchrunner, @card("Liliana Vess") def liliana_vess(card, abilities): def liliana_vess(): return AbilityNotImplemented def liliana_vess(): return AbilityNotImplemented def liliana_vess(): return AbilityNotImplemented return liliana_vess, liliana_vess, liliana_vess, @card("Hamletback Goliath") def hamletback_goliath(card, abilities): def hamletback_goliath(): return AbilityNotImplemented return hamletback_goliath, @card("Paperfin Rascal") def paperfin_rascal(card, abilities): def paperfin_rascal(): return AbilityNotImplemented return paperfin_rascal, @card("Makeshift Mannequin") def makeshift_mannequin(card, abilities): def makeshift_mannequin(): return AbilityNotImplemented return makeshift_mannequin, @card("Blind-Spot Giant") def blindspot_giant(card, abilities): def blindspot_giant(): return AbilityNotImplemented return blindspot_giant, @card("Vivid Meadow") def vivid_meadow(card, abilities): def vivid_meadow(): return AbilityNotImplemented def vivid_meadow(): return AbilityNotImplemented def vivid_meadow(): return AbilityNotImplemented return vivid_meadow, vivid_meadow, vivid_meadow, @card("Squeaking Pie Sneak") def squeaking_pie_sneak(card, abilities): def squeaking_pie_sneak(): return AbilityNotImplemented def squeaking_pie_sneak(): return AbilityNotImplemented return squeaking_pie_sneak, squeaking_pie_sneak, @card("Scattering Stroke") def scattering_stroke(card, abilities): def scattering_stroke(): return AbilityNotImplemented return scattering_stroke, @card("Thoughtweft Trio") def thoughtweft_trio(card, abilities): def thoughtweft_trio(): return AbilityNotImplemented def thoughtweft_trio(): return AbilityNotImplemented def thoughtweft_trio(): return AbilityNotImplemented return thoughtweft_trio, thoughtweft_trio, thoughtweft_trio, @card("AEthersnipe") def aethersnipe(card, abilities): def aethersnipe(): return AbilityNotImplemented def aethersnipe(): return AbilityNotImplemented return aethersnipe, aethersnipe,
19.723198
82
0.726294
5,315
55,008
7.307432
0.082973
0.301707
0.101753
0.009012
0.371173
0.20379
0.167435
0.159711
0.116455
0.115322
0
0
0.200934
55,008
2,789
83
19.723198
0.883608
0
0
0.468401
0
0
0.069589
0
0
0
0
0
0
1
0.421933
false
0
0.001859
0.268897
0.845725
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4
316963a15eec3c2a44abb5664886e012922c2359
116
py
Python
atv2/api/__init__.py
LucasS03/dev_web_example_flask
3d36995c9c045e73eb49a0854c292a7f1adf685c
[ "MIT" ]
null
null
null
atv2/api/__init__.py
LucasS03/dev_web_example_flask
3d36995c9c045e73eb49a0854c292a7f1adf685c
[ "MIT" ]
null
null
null
atv2/api/__init__.py
LucasS03/dev_web_example_flask
3d36995c9c045e73eb49a0854c292a7f1adf685c
[ "MIT" ]
null
null
null
from flask import Flask app = Flask(__name__) # app.config['DEBUG'] = True app.debug = True from api import routes
16.571429
28
0.732759
18
116
4.5
0.555556
0.222222
0
0
0
0
0
0
0
0
0
0
0.163793
116
7
29
16.571429
0.835052
0.224138
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
317fb0132c027db67ebb244e7cbcef609492b7aa
534
py
Python
geedataextract/AfricanPhenologyDataset_GEEphen_buf50km_2000_2020.py
ehurme/geedataextract
48fac9e6883bc6a4fd33dca7d66368e2f861e9ed
[ "MIT" ]
null
null
null
geedataextract/AfricanPhenologyDataset_GEEphen_buf50km_2000_2020.py
ehurme/geedataextract
48fac9e6883bc6a4fd33dca7d66368e2f861e9ed
[ "MIT" ]
null
null
null
geedataextract/AfricanPhenologyDataset_GEEphen_buf50km_2000_2020.py
ehurme/geedataextract
48fac9e6883bc6a4fd33dca7d66368e2f861e9ed
[ "MIT" ]
null
null
null
from downloadData import GEEphenMODIS GEEphenMODIS('AfricanPhenologyDataset',metric = ['NumCycles', 'MidGreenup_1', 'MidGreenup_2', 'Peak_1', 'Peak_2', 'EVI_Amplitude_1', 'EVI_Amplitude_2','EVI_Area_1', 'EVI_Area_2', 'QA_Overall_1', 'QA_Overall_2'], buf =50000, poly=0, username = 'edwardhurme', folderOut = "AfricanPhenologyDataset", scalePix = 500, startYear = 2000, endYear = 2020) # 'MidGreenup_1', 'MidGreenup_2', 'Peak_1', 'Peak_2', 'EVI_Amplitude_1', 'EVI_Amplitude_2','EVI_Area_1', 'EVI_Area_2', 'QA_Overall_1', 'QA_Overall_2'
178
346
0.754682
74
534
5.013514
0.391892
0.043127
0.113208
0.118598
0.506739
0.506739
0.506739
0.506739
0.506739
0.506739
0
0.075356
0.080524
534
3
347
178
0.680244
0.275281
0
0
0
0
0.455959
0.119171
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
3187ff78cff3b0c5df423f96428df7e768be7f80
355
py
Python
lang/python/rakuten/bal.py
liuyang1/test
a4560e0c9ffd0bc054d55bbcf12a894ab5b7d417
[ "MIT" ]
8
2015-06-07T13:25:48.000Z
2022-03-22T23:14:50.000Z
lang/python/rakuten/bal.py
liuyang1/test
a4560e0c9ffd0bc054d55bbcf12a894ab5b7d417
[ "MIT" ]
30
2016-01-29T01:36:41.000Z
2018-09-19T07:01:22.000Z
lang/python/rakuten/bal.py
liuyang1/test
a4560e0c9ffd0bc054d55bbcf12a894ab5b7d417
[ "MIT" ]
null
null
null
def solution(A): l = 0 r = sum(A) for i in range(len(A)): r -= A[i] if l == r: return i l += A[i] return -1 A = [-7, 1, 5, 2, -4, 3, 0] print solution(A) A = [0, 3, -4, 2, 5, 1, -7] print solution(A) #A = [0 for i in range(10**7)] #print solution(A) A = [1, 1, 1] print solution(A) print solution([])
16.904762
30
0.459155
69
355
2.362319
0.318841
0.276074
0.343558
0.276074
0.300614
0
0
0
0
0
0
0.097872
0.338028
355
20
31
17.75
0.595745
0.129577
0
0.1875
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0.25
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
1
0
0
0
0
0
0
0
0
4
9edbb4c38547aa19d61489bdad6acb979b6d44bd
959
py
Python
Lib/site-packages/openpyxl/packaging/interface.py
percevalm/aumyproject
b24b38005188ce9dd41ed663cf54dad5464afef3
[ "bzip2-1.0.6" ]
1
2019-12-15T01:44:17.000Z
2019-12-15T01:44:17.000Z
Lib/site-packages/openpyxl/packaging/interface.py
percevalm/aumyproject
b24b38005188ce9dd41ed663cf54dad5464afef3
[ "bzip2-1.0.6" ]
16
2020-03-24T17:30:37.000Z
2022-03-11T23:57:41.000Z
Lib/site-packages/openpyxl/packaging/interface.py
percevalm/aumyproject
b24b38005188ce9dd41ed663cf54dad5464afef3
[ "bzip2-1.0.6" ]
null
null
null
from __future__ import absolute_import # Copyright (c) 2010-2017 openpyxl from abc import abstractproperty from openpyxl.compat.abc import ABC class ISerialisableFile(ABC): """ Interface for Serialisable classes that represent files in the archive """ @abstractproperty def id(self): """ Object id making it unique """ pass @abstractproperty def _path(self): """ File path in the archive """ pass @abstractproperty def _namespace(self): """ Qualified namespace when serialised """ pass @abstractproperty def _type(self): """ The content type for the manifest """ @abstractproperty def _rel_type(self): """ The content type for relationships """ @abstractproperty def _rel_id(self): """ Links object with parent """
16.534483
74
0.570386
91
959
5.879121
0.505495
0.213084
0.128972
0.06729
0.093458
0.093458
0
0
0
0
0
0.012862
0.351408
959
57
75
16.824561
0.847267
0.298227
0
0.473684
0
0
0
0
0
0
0
0
0
1
0.315789
false
0.157895
0.157895
0
0.526316
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
4
9ee411a70fef679ca0c3b94b9c2b791e1797b9d4
41,671
py
Python
corehq/apps/userreports/tests/test_report_aggregation.py
omari-funzone/commcare-hq
5edb462c891fc08e51c4babd7acdf12c0006a602
[ "BSD-3-Clause" ]
null
null
null
corehq/apps/userreports/tests/test_report_aggregation.py
omari-funzone/commcare-hq
5edb462c891fc08e51c4babd7acdf12c0006a602
[ "BSD-3-Clause" ]
34
2020-12-11T18:51:17.000Z
2022-02-21T10:13:26.000Z
corehq/apps/userreports/tests/test_report_aggregation.py
omari-funzone/commcare-hq
5edb462c891fc08e51c4babd7acdf12c0006a602
[ "BSD-3-Clause" ]
null
null
null
from freezegun import freeze_time from django.http import HttpRequest from django.test import TestCase from corehq.apps.userreports.exceptions import BadSpecError, UserReportsError from corehq.apps.userreports.models import ( DataSourceConfiguration, ReportConfiguration, ) from corehq.apps.userreports.reports.view import ConfigurableReportView from corehq.apps.userreports.tasks import rebuild_indicators from corehq.apps.userreports.tests.test_view import ConfigurableReportTestMixin from corehq.apps.userreports.util import get_indicator_adapter class ConfigurableReportAggregationTestMixin(ConfigurableReportTestMixin): def _create_report(self, aggregation_columns, columns, filters=None, sort_expression=None): report_config = ReportConfiguration( domain=self.domain, config_id=self.data_source._id, title='foo', aggregation_columns=aggregation_columns, columns=columns, filters=filters or [], ) if sort_expression: report_config.sort_expression = sort_expression report_config.save() return report_config def _create_view(self, report_config): view = ConfigurableReportView(request=HttpRequest()) view._domain = self.domain view._lang = "en" view._report_config_id = report_config._id return view class TestReportAggregationSQL(ConfigurableReportAggregationTestMixin, TestCase): """ Integration tests for configurable report aggregation """ @classmethod def _create_data(cls): """ Populate the database with some cases """ for row in [ {"first_name": "Alan", "number": 4, "rank": 2}, {"first_name": "Alan", "number": 2, "rank": 1}, {"first_name": "Ada", "number": 3, "rank": 1}, ]: cls._new_case(row).save() @classmethod def _create_data_source(cls): cls.data_source = DataSourceConfiguration( domain=cls.domain, display_name=cls.domain, referenced_doc_type='CommCareCase', table_id="foo", configured_filter={ "type": "boolean_expression", "operator": "eq", "expression": { "type": "property_name", "property_name": "type" }, "property_value": cls.case_type, }, configured_indicators=[ { "type": "expression", "expression": { "type": "property_name", "property_name": 'first_name' }, "column_id": 'indicator_col_id_first_name', "display_name": 'indicator_display_name_first_name', "datatype": "string" }, { "type": "expression", "expression": { "type": "property_name", "property_name": 'number' }, "column_id": 'indicator_col_id_number', "datatype": "integer" }, { "type": "expression", "expression": { "type": "property_name", "property_name": 'rank' }, "column_id": 'indicator_col_id_rank', "datatype": "integer" }, ], ) cls.data_source.validate() cls.data_source.save() rebuild_indicators(cls.data_source._id) cls.adapter = get_indicator_adapter(cls.data_source) @classmethod def setUpClass(cls): super(TestReportAggregationSQL, cls).setUpClass() cls._create_data() cls._create_data_source() @classmethod def tearDownClass(cls): cls.adapter.drop_table() cls._delete_everything() super(TestReportAggregationSQL, cls).tearDownClass() def test_aggregation_by_column_not_in_report(self): """ Confirm that aggregation works when the aggregated by column does not appear in the report columns. """ report_config = self._create_report( aggregation_columns=['indicator_col_id_first_name'], columns=[{ "type": "field", "display": "report_column_display_number", "field": 'indicator_col_id_number', 'column_id': 'report_column_col_id_number', 'aggregation': 'sum' }] ) view = self._create_view(report_config) self.assertEqual( view.export_table, [[ 'foo', [ ['report_column_display_number'], [3], [6] ] ]] ) def test_aggregation_by_column_in_report(self): """ Confirm that aggregation works when the aggregated by column appears in the report columns (and no column_id is specified for the report column). """ report_config = self._create_report( aggregation_columns=['indicator_col_id_first_name'], columns=[ { "type": "field", "display": "report_column_display_first_name", "field": 'indicator_col_id_first_name', 'aggregation': 'simple' }, { "type": "field", "display": "report_column_display_number", "field": 'indicator_col_id_number', 'column_id': 'report_column_col_id_number', 'aggregation': 'sum' }, { "type": "array_agg_last_value", "display": "report_column_display_last_number", 'field': 'indicator_col_id_number', 'column_id': 'report_column_id_last_number', 'order_by_col': 'indicator_col_id_rank' } ] ) view = self._create_view(report_config) self.assertEqual( view.export_table, [[ 'foo', [ ['report_column_display_first_name', 'report_column_display_number', 'report_column_display_last_number'], ['Ada', 3, 3], ['Alan', 6, 4] ] ]] ) def test_max_aggregation_by_string_column(self): report_config = self._create_report( aggregation_columns=['indicator_col_id_number'], columns=[ { "type": "field", "display": "report_column_display_first_name", "field": 'indicator_col_id_first_name', 'aggregation': 'max' }, { "type": "field", "display": "report_column_display_number", "field": 'indicator_col_id_number', 'column_id': 'report_column_col_id_number', 'aggregation': 'simple' } ], sort_expression=[ { "field": "report_column_col_id_number", "order": "DESC" }, ] ) view = self._create_view(report_config) self.assertEqual( view.export_table, [[ 'foo', [ ['report_column_display_first_name', 'report_column_display_number'], ['Alan', 4], ['Ada', 3], ['Alan', 2], ] ]] ) def test_aggregation_by_indicator_in_percent_column(self): report_config = self._create_report( aggregation_columns=['indicator_col_id_number'], columns=[ { "type": "percent", "display": "report_column_display_percent", "denominator": { "type": "field", "field": 'indicator_col_id_number', "aggregation": "sum", "column_id": "report_column_numerator" }, "numerator": { "type": "field", "field": 'indicator_col_id_number', "aggregation": "sum", }, "column_id": "report_column_percent" } ] ) view = self._create_view(report_config) self.assertEqual( view.export_table, [[ 'foo', [ ['report_column_display_percent'], ['100%'], ['100%'], ['100%'], ] ]] ) def test_aggregation_by_column_with_new_id(self): """ Confirm that aggregation works when the aggregated by column appears in the report columns with a column_id that differs from the corresponding indicator column_id """ report_config = self._create_report( aggregation_columns=['indicator_col_id_first_name'], columns=[ { "type": "field", "display": "report_column_display_first_name", "field": 'indicator_col_id_first_name', 'column_id': 'report_column_col_id_first_name', 'aggregation': 'simple' }, { "type": "field", "display": "report_column_display_number", "field": 'indicator_col_id_number', 'column_id': 'report_column_col_id_number', 'aggregation': 'sum' } ] ) view = self._create_view(report_config) self.assertEqual( view.export_table, [[ 'foo', [ ['report_column_display_first_name', 'report_column_display_number'], ['Ada', 3], ['Alan', 6] ] ]] ) def test_aggregation_no_group_by(self): report_config = self._create_report( aggregation_columns=[], columns=[ { "type": "field", "display": "report_column_display_number", "field": 'indicator_col_id_number', 'aggregation': 'max' } ] ) view = self._create_view(report_config) self.assertEqual( view.export_table, [[ 'foo', [ ['report_column_display_number'], [4], ] ]] ) def test_sort_expression(self): report_config = self._create_report( aggregation_columns=['indicator_col_id_first_name'], columns=[{ "type": "field", "display": "indicator_col_id_first_name", "field": 'indicator_col_id_first_name', 'column_id': 'indicator_col_id_first_name', 'aggregation': 'simple' }] ) default_sorted_view = self._create_view(report_config) self.assertEqual( default_sorted_view.export_table, [[ 'foo', [ ['indicator_col_id_first_name'], ['Ada'], ['Alan'] ] ]] ) report_config.sort_expression = [{ 'field': 'indicator_col_id_first_name', 'order': 'ASC', }] report_config.save() ascending_sorted_view = self._create_view(report_config) self.assertEqual( ascending_sorted_view.export_table, [[ 'foo', [ ['indicator_col_id_first_name'], ['Ada'], ['Alan'] ] ]] ) report_config.sort_expression = [{ 'field': 'indicator_col_id_first_name', 'order': 'DESC', }] report_config.save() descending_sorted_view = self._create_view(report_config) self.assertEqual( descending_sorted_view.export_table, [[ 'foo', [ ['indicator_col_id_first_name'], ['Alan'], ['Ada'] ] ]] ) def test_total_row(self): report_config = self._create_report( aggregation_columns=['indicator_col_id_first_name'], columns=[ { "type": "field", "display": "report_column_display_first_name", "field": 'indicator_col_id_first_name', 'column_id': 'report_column_col_id_first_name', 'aggregation': 'simple', }, { "type": "field", "display": "sum_report_column_display_number", "field": 'indicator_col_id_number', 'column_id': 'sum_report_column_display_number', 'aggregation': 'sum', 'calculate_total': True, }, { "type": "field", "display": "min_report_column_display_number", "field": 'indicator_col_id_number', 'column_id': 'min_report_column_display_number', 'aggregation': 'min', 'calculate_total': False, }, ] ) view = self._create_view(report_config) self.assertEqual( view.export_table, [[ 'foo', [ [ 'report_column_display_first_name', 'sum_report_column_display_number', 'min_report_column_display_number', ], ['Ada', 3, 3], ['Alan', 6, 2], ['Total', 9, ''], ] ]] ) def test_no_total_row(self): report_config = self._create_report( aggregation_columns=['indicator_col_id_first_name'], columns=[ { "type": "field", "display": "report_column_display_first_name", "field": 'indicator_col_id_first_name', 'column_id': 'report_column_col_id_first_name', 'aggregation': 'simple', }, { "type": "field", "display": "sum_report_column_display_number", "field": 'indicator_col_id_number', 'column_id': 'sum_report_column_display_number', 'aggregation': 'sum', 'calculate_total': False, }, { "type": "field", "display": "min_report_column_display_number", "field": 'indicator_col_id_number', 'column_id': 'min_report_column_display_number', 'aggregation': 'min', 'calculate_total': False, }, ] ) view = self._create_view(report_config) self.assertEqual( view.export_table, [[ 'foo', [ [ 'report_column_display_first_name', 'sum_report_column_display_number', 'min_report_column_display_number', ], ['Ada', 3, 3], ['Alan', 6, 2], ] ]] ) def test_total_row_first_column_value(self): report_config = self._create_report( aggregation_columns=['indicator_col_id_first_name'], columns=[ { "type": "field", "display": "sum_report_column_display_number", "field": 'indicator_col_id_number', 'column_id': 'sum_report_column_display_number', 'aggregation': 'sum', 'calculate_total': True, }, { "type": "field", "display": "report_column_display_first_name", "field": 'indicator_col_id_first_name', 'column_id': 'report_column_col_id_first_name', 'aggregation': 'simple', }, { "type": "field", "display": "min_report_column_display_number", "field": 'indicator_col_id_number', 'column_id': 'min_report_column_display_number', 'aggregation': 'min', 'calculate_total': False, }, ] ) view = self._create_view(report_config) self.assertEqual( view.export_table, [[ 'foo', [ [ 'sum_report_column_display_number', 'report_column_display_first_name', 'min_report_column_display_number', ], [3, 'Ada', 3], [6, 'Alan', 2], [9, '', ''], ] ]] ) def test_totaling_noninteger_column(self): report_config = self._create_report( aggregation_columns=['indicator_col_id_first_name'], columns=[ { "type": "field", "display": "report_column_display_first_name", "field": 'indicator_col_id_first_name', 'column_id': 'report_column_col_id_first_name', 'aggregation': 'simple', 'calculate_total': True, }, ] ) view = self._create_view(report_config) with self.assertRaises(UserReportsError): view.export_table def test_total_row_with_expanded_column(self): report_config = self._create_report( aggregation_columns=['indicator_col_id_first_name'], columns=[ { "type": "field", "display": "sum_report_column_display_number", "field": 'indicator_col_id_number', 'column_id': 'sum_report_column_display_number', 'aggregation': 'sum', 'calculate_total': True, }, { "type": "expanded", "display": "report_column_display_first_name", "field": 'indicator_col_id_first_name', 'column_id': 'report_column_col_id_first_name', 'calculate_total': True, }, { "type": "field", "display": "min_report_column_display_number", "field": 'indicator_col_id_number', 'column_id': 'min_report_column_display_number', 'aggregation': 'min', 'calculate_total': False, }, ], ) view = self._create_view(report_config) self.assertEqual( view.export_table, [[ 'foo', [ [ 'sum_report_column_display_number', 'report_column_display_first_name-Ada', 'report_column_display_first_name-Alan', 'min_report_column_display_number', ], [3, 1, 0, 3], [6, 0, 2, 2], [9, 1, 2, ''], ] ]] ) @freeze_time("2020-12-30") class TestReportMultipleAggregationsSQL(ConfigurableReportAggregationTestMixin, TestCase): @classmethod def _create_data(cls): for row in [ { "state": "MA", "city": "Boston", "number": 4, "age_at_registration": 1, "date": "2019-10-30" }, { "state": "MA", "city": "Boston", "number": 3, "age_at_registration": 5, "date": "2019-09-30" }, { "state": "MA", "city": "Cambridge", "number": 2, "age_at_registration": 8, "date": "2019-09-29" }, { "state": "TN", "city": "Nashville", "number": 1, "age_at_registration": 14, "date": "2018-10-15" }, ]: cls._new_case(row).save() @classmethod def _create_data_source(cls): cls.data_source = DataSourceConfiguration( domain=cls.domain, display_name=cls.domain, referenced_doc_type='CommCareCase', table_id="foo", configured_filter={ "type": "boolean_expression", "operator": "eq", "expression": { "type": "property_name", "property_name": "type" }, "property_value": cls.case_type, }, configured_indicators=[ { "type": "expression", "expression": { "type": "property_name", "property_name": 'state' }, "column_id": 'indicator_col_id_state', "display_name": 'indicator_display_name_state', "datatype": "string" }, # Except for column_id, this indicator is identical to the indicator above { "type": "expression", "expression": { "type": "property_name", "property_name": 'state' }, "column_id": 'report_column_col_id_state', "display_name": 'indicator_display_name_state', "datatype": "string" }, { "type": "expression", "expression": { "type": "property_name", "property_name": 'city' }, "column_id": 'indicator_col_id_city', "display_name": 'indicator_display_name_city', "datatype": "string" }, { "type": "expression", "expression": { "type": "property_name", "property_name": 'number' }, "column_id": 'indicator_col_id_number', "datatype": "integer" }, { "type": "expression", "expression": { "type": "property_name", "property_name": 'age_at_registration' }, "column_id": 'age_at_registration', "datatype": "integer" }, { "type": "expression", "expression": { "type": "property_name", "property_name": 'date' }, "column_id": 'date', "datatype": "date" }, ], ) cls.data_source.validate() cls.data_source.save() rebuild_indicators(cls.data_source._id) adapter = get_indicator_adapter(cls.data_source) cls.adapter = adapter @classmethod def setUpClass(cls): super(TestReportMultipleAggregationsSQL, cls).setUpClass() cls._create_data() cls._create_data_source() @classmethod def tearDownClass(cls): cls.adapter.drop_table() cls._delete_everything() super(TestReportMultipleAggregationsSQL, cls).tearDownClass() def _create_default_report(self, filters=None): return self._create_report( aggregation_columns=[ 'indicator_col_id_state', 'indicator_col_id_city' ], columns=[ { "type": "field", "display": "report_column_display_state", "field": 'indicator_col_id_state', 'column_id': 'report_column_col_id_state', 'aggregation': 'simple' }, { "type": "field", "display": "report_column_display_city", "field": 'indicator_col_id_city', 'column_id': 'report_column_col_id_city', 'aggregation': 'simple' }, { "type": "field", "display": "report_column_display_number", "field": 'indicator_col_id_number', 'column_id': 'report_column_col_id_number', 'aggregation': 'sum' } ], filters=filters, ) def test_with_multiple_agg_columns(self): report_config = self._create_default_report() view = self._create_view(report_config) self.assertEqual( view.export_table, [[ 'foo', [ [ 'report_column_display_state', 'report_column_display_city', 'report_column_display_number' ], ['MA', 'Boston', 7], ['MA', 'Cambridge', 2], ['TN', 'Nashville', 1], ] ]] ) def test_aggregate_by_column_id_slash_data_source_indicator(self): # Aggregate by the report column_id, which also happens to be a column # in the data source. This has caused a bug in the past. report_config = self._create_report( aggregation_columns=[ 'report_column_col_id_state', ], columns=[ { "type": "field", "display": "report_column_display_state", "field": 'indicator_col_id_state', 'column_id': 'report_column_col_id_state', 'aggregation': 'simple' }, { "type": "field", "display": "report_column_display_number", "field": 'indicator_col_id_number', 'column_id': 'report_column_col_id_number', 'aggregation': 'sum' } ], ) view = self._create_view(report_config) table = view.export_table[0][1] self.assertEqual(len(table), 3) for table_row in [ ['report_column_display_state', 'report_column_display_number'], ['MA', 9], ['TN', 1], ]: self.assertIn(table_row, table) def test_with_prefilter(self): report_config = self._create_default_report( filters=[ { "pre_value": "MA", "datatype": "string", "pre_operator": "=", "display": "", "field": "indicator_col_id_state", "type": "pre", "slug": "indicator_col_id_state_1" }, ] ) view = self._create_view(report_config) self.assertEqual( view.export_table, [[ 'foo', [ [ 'report_column_display_state', 'report_column_display_city', 'report_column_display_number' ], ['MA', 'Boston', 7], ['MA', 'Cambridge', 2], ] ]] ) def test_aggregate_date(self): report_config = self._create_report( aggregation_columns=[ 'indicator_col_id_state', 'month', ], columns=[ { 'type': 'field', 'display': 'report_column_display_state', 'field': 'indicator_col_id_state', 'column_id': 'report_column_col_id_state', 'aggregation': 'simple' }, { 'type': 'aggregate_date', 'display': 'month', 'field': 'date', 'column_id': 'month', 'aggregation': 'simple', 'format': '%Y-%m' }, { 'type': 'field', 'display': 'report_column_display_number', 'field': 'indicator_col_id_number', 'column_id': 'report_column_col_id_number', 'aggregation': 'sum' } ], filters=None, sort_expression=[ { "field": "month", "order": "DESC" }, ], ) view = self._create_view(report_config) self.assertEqual( view.export_table, [['foo', [['report_column_display_state', 'month', 'report_column_display_number'], ['MA', '2019-10', 4], ['MA', '2019-09', 5], ['TN', '2018-10', 1]]]] ) def test_integer_buckets(self): report_config = self._create_report( aggregation_columns=[ 'indicator_col_id_state', 'age_range', ], columns=[ { 'type': 'field', 'display': 'state', 'field': 'indicator_col_id_state', 'column_id': 'state', 'aggregation': 'simple' }, { 'type': 'integer_buckets', 'display': 'age_range', 'column_id': 'age_range', 'field': 'age_at_registration', 'ranges': { '0-6': [0, 6], '7-12': [7, 12], }, 'else_': '13+' }, { 'type': 'field', 'display': 'report_column_display_number', 'field': 'indicator_col_id_number', 'column_id': 'report_column_col_id_number', 'aggregation': 'sum' } ], filters=None, ) view = self._create_view(report_config) table = view.export_table[0][1] self.assertEqual(len(table), 4) for table_row in [ ['state', 'age_range', 'report_column_display_number'], ['MA', '0-6', 7], ['MA', '7-12', 2], ['TN', '13+', 1], ]: self.assertIn(table_row, table) def test_bad_integer_buckets_specs(self): report_config = self._create_report( aggregation_columns=[ 'indicator_col_id_state', 'age_range', ], columns=[ { 'type': 'field', 'display': 'state', 'field': 'indicator_col_id_state', 'column_id': 'state', 'aggregation': 'simple' }, { 'type': 'integer_buckets', 'display': 'age_range', 'column_id': 'age_range', 'field': 'age_at_registration', 'ranges': { '0-6': [0], # badly-formed range '7-12': [7, 12], }, 'else_': '13+' } ], filters=None, ) view = self._create_view(report_config) with self.assertRaises(BadSpecError): view.export_table report_config = self._create_report( aggregation_columns=[ 'indicator_col_id_state', 'age_range', ], columns=[ { 'type': 'field', 'display': 'state', 'field': 'indicator_col_id_state', 'column_id': 'state', 'aggregation': 'simple' }, { 'type': 'integer_buckets', 'display': 'age_range', 'column_id': 'age_range', 'field': 'age_at_registration', 'ranges': { '0-6': [0, '6; select'], # not a number '7-12': [7, 12], }, 'else_': '13+' } ], filters=None, ) view = self._create_view(report_config) with self.assertRaises(BadSpecError): view.export_table def test_age_in_months_buckets(self): report_config = self._create_report( aggregation_columns=[ 'indicator_col_id_state', 'months_ago', ], columns=[ { 'type': 'field', 'display': 'state', 'field': 'indicator_col_id_state', 'column_id': 'state', 'aggregation': 'simple' }, { 'type': 'age_in_months_buckets', 'display': 'months_ago', 'column_id': 'months_ago', 'field': 'date', 'ranges': { '0-12': [0, 12], '12-24': [12, 24], }, 'else_': '24+' }, { 'type': 'field', 'display': 'report_column_display_number', 'field': 'indicator_col_id_number', 'column_id': 'report_column_col_id_number', 'aggregation': 'sum' } ], filters=None, ) view = self._create_view(report_config) table = view.export_table[0][1] self.assertEqual(len(table), 3) for table_row in [ ['state', 'months_ago', 'report_column_display_number'], ['MA', '12-24', 9], ['TN', '24+', 1], ]: self.assertIn(table_row, table) def test_sum_when(self): report_config = self._create_report( aggregation_columns=[ 'indicator_col_id_state', ], columns=[ { 'type': 'field', 'display': 'state', 'field': 'indicator_col_id_state', 'column_id': 'state', 'aggregation': 'simple' }, { 'type': 'sum_when', 'display': 'under_six_month_olds', 'field': 'age_at_registration', 'column_id': 'under_six_month_olds', 'whens': [ ["age_at_registration < 6", 1], ], 'else_': 0 }, { 'type': 'sum_when_template', 'display': 'under_x_month_olds_template', 'field': 'age_at_registration', 'column_id': 'under_x_month_olds_template', 'whens': [ { 'type': 'under_x_months', 'binds': [6], 'then': 1, }, ], 'else_': 0 }, { 'type': 'field', 'display': 'report_column_display_number', 'field': 'indicator_col_id_number', 'column_id': 'report_column_col_id_number', 'aggregation': 'sum' } ], filters=None, ) view = self._create_view(report_config) table = view.export_table[0][1] self.assertEqual(len(table), 3) for table_row in [ [ 'state', 'under_six_month_olds', 'under_x_month_olds_template', 'report_column_display_number', ], ['MA', 2, 2, 9], ['TN', 0, 0, 1], ]: self.assertIn(table_row, table) report_config = self._create_report( aggregation_columns=[ 'indicator_col_id_state', ], columns=[ { 'type': 'field', 'display': 'state', 'field': 'indicator_col_id_state', 'column_id': 'state', 'aggregation': 'simple' }, { 'type': 'sum_when_template', 'display': 'under_six_month_olds', 'field': 'age_at_registration', 'column_id': 'under_six_month_olds', 'whens': [ { 'type': 'under_x_months', 'binds': [6, 7], # Too many binds 'then': 1, }, ], 'else_': 0 }, { 'type': 'field', 'display': 'report_column_display_number', 'field': 'indicator_col_id_number', 'column_id': 'report_column_col_id_number', 'aggregation': 'sum' } ], filters=None, ) view = self._create_view(report_config) with self.assertRaises(BadSpecError): view.export_table def test_doc_id_aggregation(self): # this uses a cheat to get all rows in the table # grouping on only doc_id works because PostgreSQL knows # it is a unique column # adding this is a workaround for sql-agg which would otherwise # only return the last row from the query results report_config = self._create_report( aggregation_columns=[ 'doc_id', ], columns=[ { "type": "field", "display": "report_column_display_state", "field": 'indicator_col_id_state', 'column_id': 'report_column_col_id_state', 'aggregation': 'simple' }, { "type": "field", "display": "report_column_display_city", "field": 'indicator_col_id_city', 'column_id': 'report_column_col_id_city', 'aggregation': 'simple' }, ], filters=None, ) view = self._create_view(report_config) table = view.export_table[0][1] self.assertEqual(len(table), 5) for table_row in [ ['report_column_display_state', 'report_column_display_city'], ['MA', 'Boston'], ['MA', 'Boston'], ['MA', 'Cambridge'], ['TN', 'Nashville'] ]: self.assertIn(table_row, table)
34.668053
95
0.431403
3,178
41,671
5.248584
0.078666
0.081295
0.093405
0.071942
0.782614
0.73759
0.727938
0.705276
0.695384
0.676259
0
0.010318
0.465072
41,671
1,201
96
34.696919
0.737966
0.023518
0
0.600179
0
0
0.253176
0.132631
0
0
0
0
0.026834
1
0.028623
false
0
0.00805
0.000894
0.042039
0
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
731b5390e8d45d8c46a4cc53498184b38543e2af
99
py
Python
tools/yaml2json.py
wenq1/duktape
5ed3eee19b291f3b3de0b212cc62c0aba0ab4ecb
[ "MIT" ]
322
2017-06-12T16:56:49.000Z
2022-03-27T15:46:38.000Z
tools/yaml2json.py
KiraanRK/esp32-duktape
1b7fbcb8bd6bfc346d92df30ec099df7f13b03aa
[ "MIT" ]
426
2017-08-30T04:47:34.000Z
2022-03-25T21:01:11.000Z
tools/yaml2json.py
KiraanRK/esp32-duktape
1b7fbcb8bd6bfc346d92df30ec099df7f13b03aa
[ "MIT" ]
194
2017-07-03T23:34:08.000Z
2022-03-16T09:09:22.000Z
import os, sys, json, yaml if __name__ == '__main__': print(json.dumps(yaml.load(sys.stdin)))
19.8
43
0.676768
15
99
3.933333
0.8
0
0
0
0
0
0
0
0
0
0
0
0.151515
99
4
44
24.75
0.702381
0
0
0
0
0
0.080808
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0.333333
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
73213e0e18abd5b17cfa791a57cbc896493f6650
56
py
Python
sqlflow/__init__.py
Yancey1989/pysqlflow
d6f96ac0c4f93863fcb3ac159142f78b9ad58548
[ "Apache-2.0" ]
null
null
null
sqlflow/__init__.py
Yancey1989/pysqlflow
d6f96ac0c4f93863fcb3ac159142f78b9ad58548
[ "Apache-2.0" ]
null
null
null
sqlflow/__init__.py
Yancey1989/pysqlflow
d6f96ac0c4f93863fcb3ac159142f78b9ad58548
[ "Apache-2.0" ]
null
null
null
from .client import * from ._version import __version__
18.666667
33
0.803571
7
56
5.714286
0.571429
0
0
0
0
0
0
0
0
0
0
0
0.142857
56
2
34
28
0.833333
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
735ec2796014c36c867aafa0b5fad40fa97b3670
884
py
Python
navigation/costmap_2d/cmake/costmap_2d-genmsg-context.py
mrsd16teamd/loco_car
36e4ed685f9463ad689ca72eec80e0f05f1ad66c
[ "MIT" ]
48
2016-11-10T06:00:27.000Z
2022-03-01T12:57:23.000Z
navigation/costmap_2d/cmake/costmap_2d-genmsg-context.py
mrsd16teamd/loco_car
36e4ed685f9463ad689ca72eec80e0f05f1ad66c
[ "MIT" ]
6
2017-04-03T05:39:06.000Z
2017-07-27T02:35:44.000Z
navigation/costmap_2d/cmake/costmap_2d-genmsg-context.py
mrsd16teamd/loco_car
36e4ed685f9463ad689ca72eec80e0f05f1ad66c
[ "MIT" ]
20
2017-02-28T13:24:31.000Z
2021-12-06T12:36:46.000Z
# generated from genmsg/cmake/pkg-genmsg.context.in messages_str = "/home/ubuntu/catkin_ws/src/navigation/costmap_2d/msg/VoxelGrid.msg" services_str = "" pkg_name = "costmap_2d" dependencies_str = "std_msgs;geometry_msgs;map_msgs" langs = "gencpp;genlisp;genpy" dep_include_paths_str = "costmap_2d;/home/ubuntu/catkin_ws/src/navigation/costmap_2d/msg;std_msgs;/opt/ros/indigo/share/std_msgs/cmake/../msg;geometry_msgs;/opt/ros/indigo/share/geometry_msgs/cmake/../msg;map_msgs;/opt/ros/indigo/share/map_msgs/cmake/../msg;sensor_msgs;/opt/ros/indigo/share/sensor_msgs/cmake/../msg;nav_msgs;/opt/ros/indigo/share/nav_msgs/cmake/../msg;actionlib_msgs;/opt/ros/indigo/share/actionlib_msgs/cmake/../msg" PYTHON_EXECUTABLE = "/usr/bin/python" package_has_static_sources = '' == 'TRUE' genmsg_check_deps_script = "/opt/ros/indigo/share/genmsg/cmake/../../../lib/genmsg/genmsg_check_deps.py"
73.666667
435
0.789593
140
884
4.721429
0.385714
0.06354
0.12708
0.18003
0.320726
0.130106
0.130106
0.130106
0.130106
0
0
0.004706
0.038462
884
11
436
80.363636
0.772941
0.05543
0
0
1
0.111111
0.756303
0.697479
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
b4044064fc639f642f9746120c32a9209d0d1cb8
38
py
Python
address_fixer.py
DarthSpector/Poster-Adder
97a86338987dd8cbcdf56414f53932c0370dcfc2
[ "MIT" ]
null
null
null
address_fixer.py
DarthSpector/Poster-Adder
97a86338987dd8cbcdf56414f53932c0370dcfc2
[ "MIT" ]
null
null
null
address_fixer.py
DarthSpector/Poster-Adder
97a86338987dd8cbcdf56414f53932c0370dcfc2
[ "MIT" ]
null
null
null
rx=str((input ("emt"))) print(rx)
9.5
24
0.526316
6
38
3.333333
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.184211
38
4
25
9.5
0.645161
0
0
0
0
0
0.088235
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
4
b40e379407834c2a22e3abbdd8ce6c05dab38956
196
py
Python
python/it4k/__init__.py
stes/it4kids
2968143cfe6d487cf891e6cdd8dd0ddc29761656
[ "MIT" ]
8
2016-01-22T20:01:35.000Z
2022-03-18T16:14:00.000Z
python/it4k/__init__.py
stes/it4kids
2968143cfe6d487cf891e6cdd8dd0ddc29761656
[ "MIT" ]
72
2015-11-14T16:40:57.000Z
2016-11-08T20:19:04.000Z
python/it4k/__init__.py
IT4Kids/it4kids
2968143cfe6d487cf891e6cdd8dd0ddc29761656
[ "MIT" ]
4
2016-05-15T10:16:51.000Z
2020-05-03T18:50:29.000Z
from .app import App, mainApp from .entity import Entity from .tools import background, calcFunction def init(): global mainApp if not mainApp: mainApp = App() return mainApp
19.6
43
0.69898
25
196
5.48
0.56
0
0
0
0
0
0
0
0
0
0
0
0.239796
196
9
44
21.777778
0.919463
0
0
0
0
0
0
0
0
0
0
0
0
1
0.125
false
0
0.375
0
0.625
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
b46c2c7b65e2a29e9b6e34cc1fab4a24add779f5
28,409
py
Python
tests/Advanced/seenat.py
aws-lumberyard-dev/o3de-azslc
bafacbe822da625da22ceba09e8fcdcf18d8d09b
[ "Apache-2.0", "MIT" ]
13
2021-07-23T00:11:20.000Z
2022-02-09T07:59:20.000Z
tests/Advanced/seenat.py
aws-lumberyard-dev/o3de-azslc
bafacbe822da625da22ceba09e8fcdcf18d8d09b
[ "Apache-2.0", "MIT" ]
10
2021-09-14T12:12:22.000Z
2022-03-30T21:27:10.000Z
tests/Advanced/seenat.py
aws-lumberyard-dev/o3de-azslc
bafacbe822da625da22ceba09e8fcdcf18d8d09b
[ "Apache-2.0", "MIT" ]
5
2021-07-19T23:49:51.000Z
2021-12-02T05:13:35.000Z
#!/usr/bin/python # -*- coding: utf-8 -*- """ Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. SPDX-License-Identifier: Apache-2.0 OR MIT """ import sys import os sys.path.append("..") from clr import * import testfuncs def testVariables(thefile, compilerPath, silent): '''return number of successes''' symbols, ok = testfuncs.buildAndGetSymbols(thefile, compilerPath, silent) if ok: predicates = [] # check that there is global variable `a` predicates.append(lambda: symbols["Symbol '/a'"]['kind'] == 'Variable') predicates.append(lambda: symbols["Symbol '/a'"]['type']['core']['name'] == '?int') # and its only reference is at line 41 predicates.append(lambda: len(symbols["Symbol '/a'"]['references']) == 1) predicates.append(lambda: symbols["Symbol '/a'"]['references'][0]['line'] == 42) # .. a + b; # now check global var `b` predicates.append(lambda: symbols["Symbol '/b'"]['kind'] == 'Variable') predicates.append(lambda: symbols["Symbol '/b'"]['type']['core']['name'] == '?int') predicates.append(lambda: symbols["Symbol '/b'"]['storage'] == 'Static Const') # it appears in 2 places: predicates.append(lambda: len(symbols["Symbol '/b'"]['references']) == 2) predicates.append(lambda: symbols["Symbol '/b'"]['references'][0]['line'] == 10) # c = b; predicates.append(lambda: symbols["Symbol '/b'"]['references'][1]['line'] == 42) # .. a + b; # check member variable `c` predicates.append(lambda: len(symbols["Symbol '/S/c'"]['references']) == 5) predicates.append(lambda: symbols["Symbol '/S/c'"]['references'][0]['line'] == 10) # c = b; predicates.append(lambda: symbols["Symbol '/S/c'"]['references'][1]['line'] == 11) # return c; predicates.append(lambda: symbols["Symbol '/S/c'"]['references'][2]['line'] == 30) # param.c; predicates.append(lambda: symbols["Symbol '/S/c'"]['references'][3]['line'] == 31) # param.c (first appearance) predicates.append(lambda: symbols["Symbol '/S/c'"]['references'][4]['line'] == 31) # param.c; (last appearance) # check deep nested `d` predicates.append(lambda: len(symbols["Symbol '/S/N/NN/NNN/d'"]['references']) == 2) predicates.append(lambda: symbols["Symbol '/S/N/NN/NNN/d'"]['references'][0]['line'] == 44) # the 's' in `if (s.n.nn.nnn.d)` predicates.append(lambda: symbols["Symbol '/S/N/NN/NNN/d'"]['references'][1]['line'] == 50) # on the right of assignment # check refs to global `s` of UDT predicates.append(lambda: symbols["Symbol '/s'"]['references'][0]['line'] == 36) # ref to ::s as passed to func(s) predicates.append(lambda: symbols["Symbol '/s'"]['references'][1]['line'] == 44) # ref to ::s in the s.n.nn... expression predicates.append(lambda: symbols["Symbol '/s'"]['references'][2]['line'] == 48) # ref to ::s in assignment RHS # check ref to local var `c` predicates.append(lambda: symbols["Symbol '/main()/c'"]['references'][0]['line'] == 41) # first assignment (LHS) # check refs to s1: (local var of type sampler)() predicates.append(lambda: symbols["Symbol '/main()/s1'"]['references'][0]['line'] == 53) predicates.append(lambda: symbols["Symbol '/main()/s1'"]['references'][0]['col'] == 33) # check refs to s2: (local var of type sampler)() predicates.append(lambda: symbols["Symbol '/main()/s2'"]['references'][0]['line'] == 57) predicates.append(lambda: symbols["Symbol '/main()/s2'"]['references'][0]['col'] == 42) # check refs to tex in the if scope predicates.append(lambda: symbols["Symbol '/main()/$bk1/tex'"]['references'][0]['line'] == 53) predicates.append(lambda: symbols["Symbol '/main()/$bk1/tex'"]['references'][0]['col'] == 21) # check refs to tex after the if scope predicates.append(lambda: symbols["Symbol '/main()/tex'"]['references'][0]['line'] == 57) predicates.append(lambda: symbols["Symbol '/main()/tex'"]['references'][0]['col'] == 31) if not silent: print (fg.CYAN+ style.BRIGHT+ "variable references verification..."+ style.RESET_ALL) ok = testfuncs.verifyAllPredicates(predicates, symbols, silent) if ok and not silent: print (style.BRIGHT+ "OK! "+ str(len(predicates)) + " variable references predicates verified."+ style.RESET_ALL) return ok def testFunctions(thefile, compilerPath, silent): '''return number of successes''' symbols, ok = testfuncs.buildAndGetSymbols(thefile, compilerPath, silent) if ok: predicates = [] # check all references of func() predicates.append(lambda: symbols["Symbol '/func()'"]['kind'] == 'Function') predicates.append(lambda: symbols["Symbol '/func()'"]['references'][0]['line'] == 1) # first declaration predicates.append(lambda: symbols["Symbol '/func()'"]['references'][1]['line'] == 5) # call in psmain predicates.append(lambda: symbols["Symbol '/func()'"]['references'][2]['line'] == 14) # re-declaration predicates.append(lambda: symbols["Symbol '/func()'"]['references'][3]['line'] == 25) # in typeof expression predicates.append(lambda: symbols["Symbol '/func()'"]['references'][4]['line'] == 26) # in switch condition expression predicates.append(lambda: symbols["Symbol '/func()'"]['references'][5]['line'] == 29) # call in assignment predicates.append(lambda: symbols["Symbol '/func()'"]['references'][6]['line'] == 35) # ref 7 in constructor # note that "nope" cases didn't appear as false positive references, otherwise they would have # disrupted the index. if not silent: print (fg.CYAN+ style.BRIGHT+ "functions references verification..."+ style.RESET_ALL) ok = testfuncs.verifyAllPredicates(predicates, symbols, silent) if ok and not silent: print (style.BRIGHT+ "OK! "+ str(len(predicates))+ " function references predicates verified."+ style.RESET_ALL) return ok def testMethods(thefile, compilerPath, silent): '''return number of successes''' symbols, ok = testfuncs.buildAndGetSymbols(thefile, compilerPath, silent) if ok: predicates = [] # let's verify that there is a free function with name f at global scope predicates.append(lambda: symbols["Symbol '/f(?int)'"]['kind'] == 'Function') # this is a symbol meant to lead the tool to possible confusion predicates.append(lambda: symbols["Symbol '/f(?int)'"]['line'] == 1) predicates.append(lambda: symbols["Symbol '/_(?int)'"]['kind'] == 'Function') # just there test function call expressions with minimal visual pollution predicates.append(lambda: symbols["Symbol '/_(?int)'"]['line'] == 2) # setup ok, let's see the references to the Parent/f family predicates.append(lambda: symbols["Symbol '/Parent/f(?int)'"]['kind'] == 'Function') predicates.append(lambda: len(symbols["Symbol '/Parent/f(?int)'"]['references']) <= 1) # one ref to itself max. since you can't call it directly. predicates.append(lambda: symbols["Symbol '/Parent/f(?int)'"]["has overriding children"][0]["name"] == "/Child/f(?int)") # one child does override # let's check the child also back-refers to this parent: predicates.append(lambda: symbols["Symbol '/Child/f(?int)'"]["is hiding base symbol"] == "/Parent/f(?int)") # let's checkout the references of this child: appearanceLines = [16, 21, 23, 24, 33, 34, 37] # as per comments in the file ref, ref2, ref3... for ii, line in enumerate(appearanceLines): predicates.append(lambda ii=ii, line=line: symbols["Symbol '/Child/f(?int)'"]['references'][ii]['line'] == line) if not silent: print (fg.CYAN+ style.BRIGHT+ "methods references verification..."+ style.RESET_ALL) ok = testfuncs.verifyAllPredicates(predicates, symbols, silent) if ok and not silent: print (style.BRIGHT+ "OK! "+ str(len(predicates))+ " methods references predicates verified."+ style.RESET_ALL) return ok def testStructs(thefile, compilerPath, silent): '''return number of successes''' symbols, ok = testfuncs.buildAndGetSymbols(thefile, compilerPath, silent) if ok: predicates = [] appearanceLines = [7, 12, 13, 15, 20, 29, 36, 40] # as per comments in the file ref, ref2, ref3... for ii, line in enumerate(appearanceLines): predicates.append(lambda ii=ii, line=line: symbols["Symbol '/S'"]['references'][ii]['line'] == line) if not silent: print (fg.CYAN+ style.BRIGHT+ "structs references verification..."+ style.RESET_ALL) ok = testfuncs.verifyAllPredicates(predicates, symbols, silent) if ok and not silent: print (style.BRIGHT+ "OK! "+ str(len(predicates))+ " structs references predicates verified."+ style.RESET_ALL) return ok def testSRGs(thefile, compilerPath, silent): '''return number of successes''' symbols, ok = testfuncs.buildAndGetSymbols(thefile, compilerPath, silent) if ok: predicates = [] # let's check MySRG appearances = [(24,5), (29,5), (29,24), (30,12), (31,14), (33,15), (35,17), (39,48), (41,19), (41,41)] # line:col for ii, lineCol in enumerate(appearances): predicates.append(lambda ii=ii, lineCol=lineCol: symbols["Symbol '/MySRG'"]['references'][ii]['line'] == lineCol[0]) predicates.append(lambda ii=ii, lineCol=lineCol: symbols["Symbol '/MySRG'"]['references'][ii]['col'] == lineCol[1]) # let's check Inner appearances = [(17,22), (24,12), (29,12), (30,19), (31,23)] for ii, lineCol in enumerate(appearances): predicates.append(lambda ii=ii, lineCol=lineCol: symbols["Symbol '/MySRG/Inner'"]['references'][ii]['line'] == lineCol[0]) predicates.append(lambda ii=ii, lineCol=lineCol: symbols["Symbol '/MySRG/Inner'"]['references'][ii]['col'] == lineCol[1]) # let's check m_mat appearances = [(30,26), (30,43), (41,57)] for ii, lineCol in enumerate(appearances): predicates.append(lambda ii=ii, lineCol=lineCol: symbols["Symbol '/MySRG/Inner/m_mat'"]['references'][ii]['line'] == lineCol[0]) predicates.append(lambda ii=ii, lineCol=lineCol: symbols["Symbol '/MySRG/Inner/m_mat'"]['references'][ii]['col'] == lineCol[1]) # check one appearance of Deep predicates.append(lambda: symbols["Symbol '/MySRG/Inner/Deep'"]['references'][0]['line'] == 32) predicates.append(lambda: symbols["Symbol '/MySRG/Inner/Deep'"]['references'][0]['col'] == 21) # check m_h (as a leaf) predicates.append(lambda: symbols["Symbol '/MySRG/Inner/Deep/m_h'"]['references'][0]['line'] == 32) predicates.append(lambda: symbols["Symbol '/MySRG/Inner/Deep/m_h'"]['references'][0]['col'] == 29) predicates.append(lambda: symbols["Symbol '/MySRG/Inner/Deep/m_h'"]['references'][1]['line'] == 32) predicates.append(lambda: symbols["Symbol '/MySRG/Inner/Deep/m_h'"]['references'][1]['col'] == 55) # check m_deep (as an instance declared from a type grammar rule) predicates.append(lambda: symbols["Symbol '/MySRG/Inner/m_deep'"]['references'][0]['line'] == 32) predicates.append(lambda: symbols["Symbol '/MySRG/Inner/m_deep'"]['references'][0]['col'] == 48) # check m_stb as a special type of data (structured buffer) predicates.append(lambda: symbols["Symbol '/MySRG/m_stb'"]['references'][0]['line'] == 29) predicates.append(lambda: symbols["Symbol '/MySRG/m_stb'"]['references'][0]['col'] == 31) predicates.append(lambda: symbols["Symbol '/MySRG/m_stb'"]['references'][1]['line'] == 41) predicates.append(lambda: symbols["Symbol '/MySRG/m_stb'"]['references'][1]['col'] == 48) # check ref to SData as a local variable type predicates.append(lambda: symbols["Symbol '/SData'"]['references'][0]['line'] == 36) predicates.append(lambda: symbols["Symbol '/SData'"]['references'][0]['col'] == 5) # check sampler ref line 34 predicates.append(lambda: symbols["Symbol '/MySRG/m_sampler'"]['references'][0]['line'] == 35) # ref to d, clr, s predicates.append(lambda: symbols["Symbol '/main()/d'"]['references'][0]['line'] == 37) predicates.append(lambda: symbols["Symbol '/SData/clr'"]['references'][0]['line'] == 37) predicates.append(lambda: symbols["Symbol '/main()/s'"]['references'][0]['line'] == 37) # ref to f at the end predicates.append(lambda: symbols["Symbol '/main()/f'"]['references'][0]['line'] == 41) predicates.append(lambda: symbols["Symbol '/main()/f'"]['references'][0]['col'] == 31) # worldmatrix predicates.append(lambda: symbols["Symbol '/MySRG/m_worldMatrix'"]['references'][0]['line'] == 39) predicates.append(lambda: symbols["Symbol '/MySRG/m_worldMatrix'"]['references'][0]['col'] == 55) if not silent: print (fg.CYAN+ style.BRIGHT+ "SRG references verification..."+ style.RESET_ALL) ok = testfuncs.verifyAllPredicates(predicates, symbols, silent) if ok and not silent: print (style.BRIGHT+ "OK! "+ str(len(predicates))+ " SRG references predicates verified."+ style.RESET_ALL) return ok def testCBs(thefile, compilerPath, silent): '''return number of successes''' symbols, ok = testfuncs.buildAndGetSymbols(thefile, compilerPath, silent) if ok: predicates = [] # let's check that m_diffuseColor appears in the good places appearances = [(17,34), (26,48), (43,49), (45,38), (51,18)] # line:col for ii, lineCol in enumerate(appearances): predicates.append(lambda ii=ii, lineCol=lineCol: symbols["Symbol '/MySRGOne/InnerStruct/m_diffuseColor'"]['references'][ii]['line'] == lineCol[0]) predicates.append(lambda ii=ii, lineCol=lineCol: symbols["Symbol '/MySRGOne/InnerStruct/m_diffuseColor'"]['references'][ii]['col'] == lineCol[1]) # let's check the real materialConstants references appearances = [(17,16), (26,30), (42,29), (43,31), (44,49)] # line:col for ii, lineCol in enumerate(appearances): predicates.append(lambda ii=ii, lineCol=lineCol: symbols["Symbol '/MySRGOne/materialConstants'"]['references'][ii]['line'] == lineCol[0]) predicates.append(lambda ii=ii, lineCol=lineCol: symbols["Symbol '/MySRGOne/materialConstants'"]['references'][ii]['col'] == lineCol[1]) # let's check the global decoy main/materialConstants references appearances = [(41,5), (45,20), (48,17)] # line:col for ii, lineCol in enumerate(appearances): predicates.append(lambda ii=ii, lineCol=lineCol: symbols["Symbol '/materialConstants'"]['references'][ii]['line'] == lineCol[0]) predicates.append(lambda ii=ii, lineCol=lineCol: symbols["Symbol '/materialConstants'"]['references'][ii]['col'] == lineCol[1]) # let's check the local decoy main/materialConstants references appearances = [(47,19), (49,24)] # line:col for ii, lineCol in enumerate(appearances): predicates.append(lambda ii=ii, lineCol=lineCol: symbols["Symbol '/main(?float2)/MySRGOne/materialConstants'"]['references'][ii]['line'] == lineCol[0]) predicates.append(lambda ii=ii, lineCol=lineCol: symbols["Symbol '/main(?float2)/MySRGOne/materialConstants'"]['references'][ii]['col'] == lineCol[1]) if not silent: print (fg.CYAN+ style.BRIGHT+ "CB references verification..."+ style.RESET_ALL) ok = testfuncs.verifyAllPredicates(predicates, symbols, silent) if ok and not silent: print (style.BRIGHT+ "OK! "+ str(len(predicates))+ " CB references verified."+ style.RESET_ALL) return ok # test Member Access Expression def testMAE(thefile, compilerPath, silent): '''return number of successes''' symbols, ok = testfuncs.buildAndGetSymbols(thefile, compilerPath, silent) if ok: predicates = [] predicates.append(lambda: symbols["Symbol '/A'"]['references'][0]['line'] == 8) predicates.append(lambda: symbols["Symbol '/A'"]['references'][0]['col'] == 5) predicates.append(lambda: symbols["Symbol '/A'"]['references'][1]['line'] == 9) predicates.append(lambda: symbols["Symbol '/A'"]['references'][1]['col'] == 7) if not silent: print (fg.CYAN+ style.BRIGHT+ "qualified-id verification..."+ style.RESET_ALL) ok = testfuncs.verifyAllPredicates(predicates, symbols, silent) if ok and not silent: print (style.BRIGHT+ "OK! "+ str(len(predicates))+ " qualified-id verified."+ style.RESET_ALL) return ok # test Deported Method definition test file def testDeported(thefile, compilerPath, silent): '''return number of successes''' symbols, ok = testfuncs.buildAndGetSymbols(thefile, compilerPath, silent) if ok: predicates = [] # check * predicates.append(lambda: symbols["Symbol '/Random/Next()'"]['line'] == 20) predicates.append(lambda: symbols["Symbol '/Random/Next()'"]['def line'] == 34) predicates.append(lambda: symbols["Symbol '/Random/Next()'"]['references'][0]['line'] == 20) predicates.append(lambda: symbols["Symbol '/Random/Next()'"]['references'][1]['line'] == 29) # check ** predicates.append(lambda: symbols["Symbol '/Random/cur'"]['line'] == 23) predicates.append(lambda: symbols["Symbol '/Random/cur'"]['references'][0]['line'] == 28) predicates.append(lambda: symbols["Symbol '/Random/cur'"]['references'][1]['line'] == 38) # check *** predicates.append(lambda: symbols["Symbol '/Random/Init()'"]['line'] == 26) predicates.append(lambda: symbols["Symbol '/Random/Init()'"]['def line'] == 26) predicates.append(lambda: symbols["Symbol '/Random/Init()'"]['references'][0]['line'] == 37) predicates.append(lambda: symbols["Symbol '/Random/Init()'"]['references'][1]['line'] == 45) if not silent: print (fg.CYAN+ style.BRIGHT+ " deported-methods verification..."+ style.RESET_ALL) ok = testfuncs.verifyAllPredicates(predicates, symbols, silent) if ok and not silent: print (style.BRIGHT+ "OK! "+ str(len(predicates))+ " deported-methods verified."+ style.RESET_ALL) return ok # test typealias is registered and doesn't break the reference chain of other user defined types def testTypealias(thefile, compilerPath, silent): '''return number of successes''' symbols, ok = testfuncs.buildAndGetSymbols(thefile, compilerPath, silent) if ok: predicates = [] # check for the understanding of the access of the stuff variable through indirect structuredbuffer access predicates.append(lambda: symbols["Symbol '/PassVars/stuff'"]['references'][0]['line'] == 15) # check for registration of the alias itself predicates.append(lambda: symbols["Symbol '/StructBuf'"]['kind'] == 'TypeAlias') predicates.append(lambda: symbols["Symbol '/StructBuf'"]['canonical type']['generic']['name'] == '/PassVars') if not silent: print (fg.CYAN+ style.BRIGHT+ " alias predicates verification..."+ style.RESET_ALL) ok = testfuncs.verifyAllPredicates(predicates, symbols, silent) if ok and not silent: print (style.BRIGHT+ "OK! "+ str(len(predicates))+ " alias predicates verified."+ style.RESET_ALL) return ok def testFunctionOverloads(thefile, compilerPath, silent): '''return number of successes''' symbols, ok = testfuncs.buildAndGetSymbols(thefile, compilerPath, silent) if ok: predicates = [] predicates.append(lambda: symbols["Symbol '/MySRG/Metal'"]['kind'] == "Struct") predicates.append(lambda: symbols["Symbol '/MySRG/Barrel'"]['kind'] == "Struct") predicates.append(lambda: symbols["Symbol '/MySRG/Barrel'"]['kind'] == "Struct") predicates.append(lambda: symbols["Symbol '/MySRG/MakeMat(?float)'"]['kind'] == "Function") predicates.append(lambda: symbols["Symbol '/MySRG/MakeMat(?float)'"]['references'][0]['line'] == 53) predicates.append(lambda: symbols["Symbol '/MySRG/MakeMat(?float)'"]['references'][1]['line'] == 58) predicates.append(lambda: symbols["Symbol '/MySRG/MakeMat'"]['kind'] == 'OverloadSet') predicates.append(lambda: symbols["Symbol '/MySRG/MakeMat'"]['functions'][0] == '/MySRG/MakeMat(/MySRG/Metal)') predicates.append(lambda: symbols["Symbol '/MySRG/MakeMat'"]['functions'][1] == '/MySRG/MakeMat(?float)') predicates.append(lambda: not symbols["Symbol '/MySRG/MakeMat'"]['references']) predicates.append(lambda: symbols["Symbol '/MySRG/MakeMat(/MySRG/Metal)'"]['references'][0]['line'] == 55) # because of use of * multiply, azslc can't resolve the overload, so the set holds the reference predicates.append(lambda: symbols["Symbol '/MySRG/Luminosity'"]['references'][0]['line'] == 63) if not silent: print (fg.CYAN+ style.BRIGHT+ " overload predicates verification..."+ style.RESET_ALL) ok = testfuncs.verifyAllPredicates(predicates, symbols, silent) if ok and not silent: print (style.BRIGHT+ "OK! "+ str(len(predicates))+ " overload predicates verified."+ style.RESET_ALL) return ok def testUnnamedBlocks(thefile, compilerPath, silent): '''return number of successes''' symbols, ok = testfuncs.buildAndGetSymbols(thefile, compilerPath, silent) if ok: predicates = [] predicates.append(lambda: symbols["Symbol '/S'"]['kind'] == "Class") predicates.append(lambda: symbols["Symbol '/S/i'"]['kind'] == "Variable") predicates.append(lambda: symbols["Symbol '/S/i'"]['references'][0]['line'] == 21) predicates.append(lambda: symbols["Symbol '/S/i'"]['references'][1]['line'] == 25) predicates.append(lambda: symbols["Symbol '/S/i'"]['references'][2]['line'] == 69) predicates.append(lambda: symbols["Symbol '/S/i'"]['references'][3]['line'] == 72) predicates.append(lambda: symbols["Symbol '/i'"]['kind'] == "Variable") predicates.append(lambda: symbols["Symbol '/i'"]['references'][0]['line'] == 16) predicates.append(lambda: symbols["Symbol '/i'"]['references'][1]['line'] == 18) predicates.append(lambda: symbols["Symbol '/i'"]['references'][2]['line'] == 29) predicates.append(lambda: symbols["Symbol '/i'"]['references'][3]['line'] == 70) predicates.append(lambda: symbols["Symbol '/f()/$bk0/i'"]['type']['core']['name'] == '?int') predicates.append(lambda: symbols["Symbol '/f()/$bk0/i'"]['line'] == 14) predicates.append(lambda: symbols["Symbol '/f()/$bk0/i'"]['references'][0]['line'] == 15) predicates.append(lambda: symbols["Symbol '/f()/i'"]['type']['core']['name'] == '?int') predicates.append(lambda: symbols["Symbol '/f()/i'"]['line'] == 23) predicates.append(lambda: symbols["Symbol '/f()/i'"]['references'][0]['line'] == 28) predicates.append(lambda: symbols["Symbol '/f()/i'"]['references'][1]['line'] == 58) predicates.append(lambda: symbols["Symbol '/f()/$sw1/$bk2/i'"]['line'] == 33) predicates.append(lambda: symbols["Symbol '/f()/$sw1/$bk2/i'"]['references'][0]['line'] == 34) predicates.append(lambda: symbols["Symbol '/f()/$sw1/i'"]['line'] == 37) predicates.append(lambda: symbols["Symbol '/f()/$sw1/i'"]['references'][0]['line'] == 40) predicates.append(lambda: symbols["Symbol '/f()/$for3/i'"]['line'] == 43) predicates.append(lambda: symbols["Symbol '/f()/$for3/i'"]['references'][0]['line'] == 43) predicates.append(lambda: symbols["Symbol '/f()/$for3/i'"]['references'][1]['line'] == 43) predicates.append(lambda: symbols["Symbol '/f()/$for3/i'"]['references'][2]['line'] == 45) predicates.append(lambda: symbols["Symbol '/f()/$for3/i'"]['references'][3]['line'] == 45) predicates.append(lambda: symbols["Symbol '/f()/$bk4/i'"]['line'] == 50) predicates.append(lambda: symbols["Symbol '/f()/$bk4/i'"]['references'][0]['line'] == 51) predicates.append(lambda: symbols["Symbol '/f()/$bk4/i'"]['references'][1]['line'] == 51) predicates.append(lambda: symbols["Symbol '/f()/$bk5/i'"]['line'] == 56) predicates.append(lambda: symbols["Symbol '/f()/$bk5/i'"]['references'][0]['line'] == 57) predicates.append(lambda: symbols["Symbol '/f()/$bk5/i'"]['references'][1]['line'] == 57) predicates.append(lambda: symbols["Symbol '/f()/$for6/i'"]['line'] == 60) predicates.append(lambda: symbols["Symbol '/f()/$for6/i'"]['references'][0]['line'] == 60) predicates.append(lambda: symbols["Symbol '/f()/$for6/i'"]['references'][1]['line'] == 60) predicates.append(lambda: symbols["Symbol '/f()/$for7/i'"]['line'] == 63) predicates.append(lambda: symbols["Symbol '/f()/$for7/i'"]['references'][0]['line'] == 63) predicates.append(lambda: symbols["Symbol '/f()/$for7/i'"]['references'][1]['line'] == 64) predicates.append(lambda: symbols["Symbol '/S/f()/j'"]['line'] == 75) if not silent: print (fg.CYAN+ style.BRIGHT+ " shadowed symbols predicates verification..."+ style.RESET_ALL) ok = testfuncs.verifyAllPredicates(predicates, symbols, silent) if ok and not silent: print (style.BRIGHT+ "OK! "+ str(len(predicates))+ " shadowed symbols predicates verified."+ style.RESET_ALL) return ok result = 0 # to define for sub-tests resultFailed = 0 def doTests(compiler, silent, azdxcpath): global result global resultFailed # Working directory should have been set to this script's directory by the calling parent # You can get it once doTests() is called, but not during initialization of the module, # because at that time it will still be set to the working directory of the calling script workDir = os.getcwd() if not silent: print ("testing for variables...") if testVariables(os.path.join(workDir, "seenat-variables.azsl"), compiler, silent): result += 1 else: resultFailed += 1 if not silent: print ("testing for functions...") if testFunctions(os.path.join(workDir, "seenat-functions.azsl"), compiler, silent): result += 1 else: resultFailed += 1 if not silent: print ("testing for methods...") if testMethods(os.path.join(workDir, "seenat-methods.azsl"), compiler, silent): result += 1 else: resultFailed += 1 if not silent: print ("testing for structs...") if testStructs(os.path.join(workDir, "seenat-structs.azsl"), compiler, silent): result += 1 else: resultFailed += 1 if not silent: print ("testing for SRGs...") if testSRGs(os.path.join(workDir, "seenat-srgs.azsl"), compiler, silent): result += 1 else: resultFailed += 1 if not silent: print ("testing for constant buffers...") if testCBs(os.path.join(workDir, "seenat-cb.azsl"), compiler, silent): result += 1 else: resultFailed += 1 if not silent: print ("testing for qualification in member access expression RHS...") if testMAE(os.path.join(workDir, "seenat-MAE-qualifiedRHS.azsl"), compiler, silent): result += 1 else: resultFailed += 1 if not silent: print ("testing for deported methods...") if testDeported(os.path.join(workDir, "seenat-deported-methods.azsl"), compiler, silent): result += 1 else: resultFailed += 1 if not silent: print ("testing for type alias...") if testTypealias(os.path.join(workDir, "seenat-typedef.azsl"), compiler, silent): result += 1 else: resultFailed += 1 if not silent: print ("testing for function overloading...") if testFunctionOverloads(os.path.join(workDir, "seenat-function-overloads.azsl"), compiler, silent): result += 1 else: resultFailed += 1 if not silent: print ("testing for unnamed blocks...") if testUnnamedBlocks(os.path.join(workDir, "seenat-unnamed-blocks.azsl"), compiler, silent): result += 1 else: resultFailed += 1 if __name__ == "__main__": print ("please call from testapp.py")
59.808421
163
0.635151
3,435
28,409
5.237263
0.118777
0.137854
0.18955
0.214397
0.780378
0.751251
0.717454
0.644191
0.528516
0.431462
0
0.023647
0.178324
28,409
474
164
59.934599
0.747033
0.11954
0
0.27673
0
0
0.263702
0.028308
0
0
0
0
0
1
0.037736
false
0.006289
0.012579
0
0.084906
0.106918
0
0
0
null
0
1
1
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
b471df45f32b164443335db7113ca50438e627f1
127
py
Python
data/__init__.py
yizt/crnn.pytorch
2f626841f35c8f69a23518ee2496554cac080cff
[ "Apache-2.0" ]
197
2020-01-11T06:45:45.000Z
2022-03-27T01:51:46.000Z
data/__init__.py
17865135532/crnn.pytorch
2f626841f35c8f69a23518ee2496554cac080cff
[ "Apache-2.0" ]
32
2020-03-16T04:53:15.000Z
2022-02-21T11:00:17.000Z
data/__init__.py
17865135532/crnn.pytorch
2f626841f35c8f69a23518ee2496554cac080cff
[ "Apache-2.0" ]
55
2020-03-02T12:03:05.000Z
2021-11-24T08:04:11.000Z
# -*- coding: utf-8 -*- """ @File : __init__.py @Time : 2019/12/22 下午8:52 @Author : yizuotian @Description : """
18.142857
29
0.527559
15
127
4.2
1
0
0
0
0
0
0
0
0
0
0
0.12766
0.259843
127
7
30
18.142857
0.542553
0.889764
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
b48072715d688421b7738487d8637cfb7a18e081
57
py
Python
mstk/visualize/__init__.py
KalebMoon/mstk
3fa908fc2b3e13efd42814c08014e1cf3b70f435
[ "MIT" ]
null
null
null
mstk/visualize/__init__.py
KalebMoon/mstk
3fa908fc2b3e13efd42814c08014e1cf3b70f435
[ "MIT" ]
null
null
null
mstk/visualize/__init__.py
KalebMoon/mstk
3fa908fc2b3e13efd42814c08014e1cf3b70f435
[ "MIT" ]
null
null
null
""" Visualzation toolkits and its supporting modules """
19
52
0.754386
6
57
7.166667
1
0
0
0
0
0
0
0
0
0
0
0
0.140351
57
2
53
28.5
0.877551
0.842105
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
b4827e95b649498b2640e5e1238c038ded697a13
247
py
Python
models/VerticalStabilizer.py
Shreeyam/AVD_Initial_Sizing
b4a83159796f3c4b0ad35b79c443bd78f85a9b9e
[ "MIT" ]
null
null
null
models/VerticalStabilizer.py
Shreeyam/AVD_Initial_Sizing
b4a83159796f3c4b0ad35b79c443bd78f85a9b9e
[ "MIT" ]
null
null
null
models/VerticalStabilizer.py
Shreeyam/AVD_Initial_Sizing
b4a83159796f3c4b0ad35b79c443bd78f85a9b9e
[ "MIT" ]
null
null
null
from .liftDevice import * class VerticalStabilizer(LiftDevice): def __init__(self, taper_ratio, aspect_ratio, sweep, lift_curve, zero_lift, C_HT): super().__init__(0, taper_ratio, aspect_ratio, sweep, lift_curve, zero_lift) self.C_HT = C_HT
35.285714
83
0.777328
37
247
4.675676
0.513514
0.052023
0.184971
0.242775
0.49711
0.49711
0.49711
0.49711
0.49711
0
0
0.004587
0.117409
247
6
84
41.166667
0.788991
0
0
0
0
0
0
0
0
0
0
0
0
1
0.2
false
0
0.2
0
0.6
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
4
c30feb654fcd44fb2721b7e79e19d466b6371324
58
py
Python
scripts/lint.py
limn2o4/bilibili_api
dc518016c7649be2a135ccb8badb091712754a3d
[ "MIT" ]
null
null
null
scripts/lint.py
limn2o4/bilibili_api
dc518016c7649be2a135ccb8badb091712754a3d
[ "MIT" ]
null
null
null
scripts/lint.py
limn2o4/bilibili_api
dc518016c7649be2a135ccb8badb091712754a3d
[ "MIT" ]
null
null
null
import os exit(os.system('pylint -E ./bilibili_api'))
14.5
44
0.672414
9
58
4.222222
0.888889
0
0
0
0
0
0
0
0
0
0
0
0.155172
58
3
45
19.333333
0.77551
0
0
0
0
0
0.436364
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
c3108529ca3b942e669d5b47fce235c65da00a54
79
py
Python
pkgbuilder/__init__.py
jcrd/python-pkgbuilder
e58916ca934d7e49ecc5cad661d79953cb11a062
[ "MIT" ]
null
null
null
pkgbuilder/__init__.py
jcrd/python-pkgbuilder
e58916ca934d7e49ecc5cad661d79953cb11a062
[ "MIT" ]
1
2019-11-25T13:11:01.000Z
2019-12-18T20:29:26.000Z
pkgbuilder/__init__.py
jcrd/python-pkgbuilder
e58916ca934d7e49ecc5cad661d79953cb11a062
[ "MIT" ]
null
null
null
""" A pacman package builder. .. moduleauthor:: James Reed <jcrd@tuta.io> """
13.166667
43
0.658228
10
79
5.2
1
0
0
0
0
0
0
0
0
0
0
0
0.151899
79
5
44
15.8
0.776119
0.886076
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
c329504b1730770e0b9b12e7708c693394f11dd2
182
py
Python
src/core/toga/interface/widgets/multilinetextinput.py
jrwdunham/toga
db343c99d0f174aea86c4656849ea25ffb7bfe7a
[ "BSD-3-Clause" ]
null
null
null
src/core/toga/interface/widgets/multilinetextinput.py
jrwdunham/toga
db343c99d0f174aea86c4656849ea25ffb7bfe7a
[ "BSD-3-Clause" ]
null
null
null
src/core/toga/interface/widgets/multilinetextinput.py
jrwdunham/toga
db343c99d0f174aea86c4656849ea25ffb7bfe7a
[ "BSD-3-Clause" ]
null
null
null
from .base import Widget class MultilineTextInput(Widget): def __init__(self, id=None, style=None, initial=None): super().__init__(id=id, style=style, initial=initial)
26
61
0.71978
24
182
5.125
0.583333
0
0
0
0
0
0
0
0
0
0
0
0.153846
182
6
62
30.333333
0.798701
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.25
0
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
c33c37851a03c0c4ef3223c75394d8d3388fb4b4
8,928
py
Python
src/cosmosdb-preview/azext_cosmosdb_preview/tests/latest/test_cosmosdb-rbac_scenario.py
Mannan2812/azure-cli-extensions
e2b34efe23795f6db9c59100534a40f0813c3d95
[ "MIT" ]
2
2021-03-24T21:06:20.000Z
2021-03-24T21:07:58.000Z
src/cosmosdb-preview/azext_cosmosdb_preview/tests/latest/test_cosmosdb-rbac_scenario.py
Mannan2812/azure-cli-extensions
e2b34efe23795f6db9c59100534a40f0813c3d95
[ "MIT" ]
3
2020-05-27T20:16:26.000Z
2020-07-23T19:46:49.000Z
src/cosmosdb-preview/azext_cosmosdb_preview/tests/latest/test_cosmosdb-rbac_scenario.py
Mannan2812/azure-cli-extensions
e2b34efe23795f6db9c59100534a40f0813c3d95
[ "MIT" ]
5
2020-05-09T17:47:09.000Z
2020-10-01T19:52:06.000Z
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer) class Cosmosdb_previewRbacScenarioTest(ScenarioTest): @ResourceGroupPreparer(name_prefix='cli_test_cosmosdb_sql_role') def test_cosmosdb_sql_role(self, resource_group): acc_name = self.create_random_name(prefix='cli', length=15) db_name = self.create_random_name(prefix='cli', length=15) subscription = self.get_subscription_id() role_def_id = 'be79875a-2cc4-40d5-8958-566017875b39' role_def_id2 = '6328f5f7-dbf7-4244-bba8-fbb9d8066506' role_assignment_id = 'cb8ed2d7-2371-4e3c-bd31-6cc1560e84f8' role_assignment_id2 = '09d117e6-ab6a-4a8b-948a-c6c34aa631db' role_definition_create_body = ' {{ \\"Id\\": \\"{0}\\", \\"RoleName\\": \\"roleName\\", \\"Type\\": \\"CustomRole\\", \\"AssignableScopes\\": [ \\"/\\" ], \\"DataActions\\": [ \\"Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/create\\", \\"Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read\\" ] }} '.format(role_def_id) role_definition_update_body = ' {{ \\"Id\\": \\"{0}\\", \\"RoleName\\": \\"roleName2\\", \\"Type\\": \\"CustomRole\\", \\"AssignableScopes\\": [ \\"/\\" ], \\"Permissions\\": [ {{ \\"DataActions\\": [ \\"Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/create\\" ] }}, {{ \\"DataActions\\": [ \\"Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read\\" ] }} ] }}'.format(role_def_id) role_definition_create_body2 = ' {{ \\"Id\\": \\"{0}\\", \\"RoleName\\": \\"roleName3\\", \\"Type\\": \\"CustomRole\\", \\"AssignableScopes\\": [ \\"/\\" ], \\"Permissions\\": [ {{ \\"DataActions\\": [ \\"Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/create\\" ] }}, {{ \\"DataActions\\": [ \\"Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read\\" ] }}, {{ \\"DataActions\\": [ \\"Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/replace\\" ] }} ] }}'.format(role_def_id2) fully_qualified_role_def_id = '/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.DocumentDB/databaseAccounts/{2}/sqlRoleDefinitions/{3}'.format(subscription, resource_group, acc_name, role_def_id) fully_qualified_role_def_id2 = '/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.DocumentDB/databaseAccounts/{2}/sqlRoleDefinitions/{3}'.format(subscription, resource_group, acc_name, role_def_id2) fully_qualified_role_assignment_id = '/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.DocumentDB/databaseAccounts/{2}/sqlRoleAssignments/{3}'.format(subscription, resource_group, acc_name, role_assignment_id) fully_qualified_role_assignment_id2 = '/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.DocumentDB/databaseAccounts/{2}/sqlRoleAssignments/{3}'.format(subscription, resource_group, acc_name, role_assignment_id2) assignable_scope = '/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.DocumentDB/databaseAccounts/{2}'.format(subscription, resource_group, acc_name) scope = '/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.DocumentDB/databaseAccounts/{2}/dbs/{3}'.format(subscription, resource_group, acc_name, db_name) principal_id = 'ed4c2395-a18c-4018-afb3-6e521e7534d2' self.kwargs.update({ 'acc': acc_name, 'db_name': db_name, 'create_body': role_definition_create_body, 'update_body': role_definition_update_body, 'create_body2': role_definition_create_body2, 'role_def_id': role_def_id, 'fully_qualified_role_def_id': fully_qualified_role_def_id, 'role_def_id2': role_def_id2, 'fully_qualified_role_def_id2': fully_qualified_role_def_id2, 'role_assignment_id': role_assignment_id, 'role_assignment_id2': role_assignment_id2, 'fully_qualified_role_assignment_id': fully_qualified_role_assignment_id, 'fully_qualified_role_assignment_id2': fully_qualified_role_assignment_id2, 'scope': scope, 'principal_id': principal_id }) self.cmd('az cosmosdb create -n {acc} -g {rg} --locations regionName=eastus2') self.cmd('az cosmosdb sql database create -g {rg} -a {acc} -n {db_name}') self.cmd('az cosmosdb sql role definition create -g {rg} -a {acc} -b "{create_body}"', checks=[ self.check('id', fully_qualified_role_def_id), self.check('roleName', 'roleName'), self.check('sqlRoleDefinitionGetResultsType', 'CustomRole'), self.check('assignableScopes[0]', assignable_scope), self.check('length(permissions)', 1) ]) assert self.cmd('az cosmosdb sql role definition exists -g {rg} -a {acc} -i {role_def_id}').get_output_in_json() self.cmd('az cosmosdb sql role definition show -g {rg} -a {acc} -i {role_def_id}', checks=[ self.check('roleName', 'roleName') ]) self.cmd('az cosmosdb sql role definition update -g {rg} -a {acc} -b "{update_body}"', checks=[ self.check('id', fully_qualified_role_def_id), self.check('roleName', 'roleName2'), self.check('sqlRoleDefinitionGetResultsType', 'CustomRole'), self.check('assignableScopes[0]', assignable_scope), self.check('length(permissions)', 2) ]) self.cmd('az cosmosdb sql role definition create -g {rg} -a {acc} -b "{create_body2}"', checks=[ self.check('id', fully_qualified_role_def_id2), self.check('roleName', 'roleName3'), self.check('sqlRoleDefinitionGetResultsType', 'CustomRole'), self.check('assignableScopes[0]', assignable_scope), self.check('length(permissions)', 3) ]) role_definition_list = self.cmd('az cosmosdb sql role definition list -g {rg} -a {acc}').get_output_in_json() assert len(role_definition_list) == 2 self.cmd('az cosmosdb sql role assignment create -g {rg} -a {acc} -s {scope} -p {principal_id} -d {fully_qualified_role_def_id} -i {role_assignment_id}', checks=[ self.check('id', fully_qualified_role_assignment_id), self.check('roleDefinitionId', fully_qualified_role_def_id), self.check('scope', scope), self.check('principalId', principal_id) ]) assert self.cmd('az cosmosdb sql role assignment exists -g {rg} -a {acc} -i {role_assignment_id}').get_output_in_json() self.cmd('az cosmosdb sql role assignment show -g {rg} -a {acc} -i {role_assignment_id}', checks=[ self.check('id', fully_qualified_role_assignment_id) ]) self.cmd('az cosmosdb sql role assignment update -g {rg} -a {acc} -d {role_def_id2} -i {fully_qualified_role_assignment_id}', checks=[ self.check('id', fully_qualified_role_assignment_id), self.check('roleDefinitionId', fully_qualified_role_def_id2), self.check('scope', scope), self.check('principalId', principal_id) ]) self.cmd('az cosmosdb sql role assignment create -g {rg} -a {acc} -s {scope} -p {principal_id} -n roleName2 -i {role_assignment_id2}', checks=[ self.check('id', fully_qualified_role_assignment_id2), self.check('roleDefinitionId', fully_qualified_role_def_id), self.check('scope', scope), self.check('principalId', principal_id) ]) role_assignment_list = self.cmd('az cosmosdb sql role assignment list -g {rg} -a {acc}').get_output_in_json() assert len(role_assignment_list) == 2 self.cmd('az cosmosdb sql role assignment delete -g {rg} -a {acc} -i {role_assignment_id} --yes') self.cmd('az cosmosdb sql role assignment delete -g {rg} -a {acc} -i {role_assignment_id2} --yes') role_assignment_list = self.cmd('az cosmosdb sql role assignment list -g {rg} -a {acc}').get_output_in_json() assert len(role_assignment_list) == 0 self.cmd('az cosmosdb sql role definition delete -g {rg} -a {acc} -i {role_def_id} --yes') self.cmd('az cosmosdb sql role definition delete -g {rg} -a {acc} -i {fully_qualified_role_def_id2} --yes') role_definition_list = self.cmd('az cosmosdb sql role definition list -g {rg} -a {acc}').get_output_in_json() assert len(role_definition_list) == 0
72
544
0.64897
1,013
8,928
5.46002
0.137216
0.096185
0.08136
0.061472
0.806364
0.766769
0.748689
0.679805
0.604592
0.564455
0
0.024048
0.184924
8,928
123
545
72.585366
0.736018
0.037634
0
0.30303
0
0.222222
0.501536
0.21491
0
0
0
0
0.060606
1
0.010101
false
0
0.010101
0
0.030303
0
0
0
0
null
0
0
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
c36228ecac9de8be3b9e642bdd9ce175005c09e4
1,152
py
Python
lib/systems/beta-d-arabinopyranose.py
pulsar-chem/BPModule
f8e64e04fdb01947708f098e833600c459c2ff0e
[ "BSD-3-Clause" ]
null
null
null
lib/systems/beta-d-arabinopyranose.py
pulsar-chem/BPModule
f8e64e04fdb01947708f098e833600c459c2ff0e
[ "BSD-3-Clause" ]
null
null
null
lib/systems/beta-d-arabinopyranose.py
pulsar-chem/BPModule
f8e64e04fdb01947708f098e833600c459c2ff0e
[ "BSD-3-Clause" ]
null
null
null
import pulsar as psr def load_ref_system(): """ Returns beta-d-arabinopyranose as found in the IQMol fragment library. All credit to https://github.com/nutjunkie/IQmol """ return psr.make_system(""" C 1.3689 0.3330 -0.6120 O 0.3286 1.0898 -1.2545 C -0.9636 0.4720 -1.3357 C -1.4635 0.1147 0.0717 O -2.6767 -0.6200 -0.1698 C -0.4875 -0.8429 0.7907 O -0.4889 -2.1319 0.1645 C 0.9737 -0.3641 0.7176 O 1.1026 0.5391 1.8196 O 2.3060 1.3526 -0.2746 H -0.9101 -0.4199 -1.9869 H -1.5777 1.2565 -1.8170 H 1.8474 -0.3368 -1.3526 H 1.6596 -1.2297 0.8992 H -0.7798 -0.9921 1.8582 H -1.6620 1.0190 0.6846 H 1.9095 2.2435 -0.4698 H 1.8827 1.1421 1.6652 H -1.3747 -2.3021 -0.2495 H -3.2517 -0.6008 0.6240 """)
41.142857
78
0.41059
171
1,152
2.748538
0.54386
0.029787
0
0
0
0
0
0
0
0
0
0.507614
0.486979
1,152
27
79
42.666667
0.287648
0.103299
0
0
0
0
0.917078
0
0
0
0
0
0
1
0.041667
true
0
0.041667
0
0.125
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
1
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
5edbd00e90cd498f5b33b3279e1a65a20f69f398
106
py
Python
check_data_integrity/check/args/__init__.py
mpmuc84/helper-scripts
573353827d94f65efe763a93770ba75bcda90fff
[ "BSD-2-Clause" ]
4
2018-10-11T09:48:39.000Z
2019-11-12T06:17:17.000Z
check_data_integrity/check/args/__init__.py
mpmuc84/helper-scripts
573353827d94f65efe763a93770ba75bcda90fff
[ "BSD-2-Clause" ]
26
2017-11-10T15:46:03.000Z
2021-08-13T12:02:27.000Z
check_data_integrity/check/args/__init__.py
mpmuc84/helper-scripts
573353827d94f65efe763a93770ba75bcda90fff
[ "BSD-2-Clause" ]
21
2017-10-12T11:47:37.000Z
2021-05-05T13:07:59.000Z
""" This package contains modules used for parsing and representing the arguments of the check script. """
35.333333
98
0.783019
15
106
5.533333
0.933333
0
0
0
0
0
0
0
0
0
0
0
0.150943
106
3
99
35.333333
0.922222
0.924528
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
5ee5f5acc66088af4bfbbb9301c8aef489896b4a
131
py
Python
tests/first_test.py
nkbeebe/FW-Airsim
aabdf6cc8f7b68317b4bcf394340ae8a420eeb89
[ "MIT" ]
null
null
null
tests/first_test.py
nkbeebe/FW-Airsim
aabdf6cc8f7b68317b4bcf394340ae8a420eeb89
[ "MIT" ]
null
null
null
tests/first_test.py
nkbeebe/FW-Airsim
aabdf6cc8f7b68317b4bcf394340ae8a420eeb89
[ "MIT" ]
null
null
null
# from unittest import TestCase # class TryTesting(TestCase): # def test_always_passes(self): # self.assertTrue(True)
21.833333
35
0.70229
15
131
6
0.866667
0
0
0
0
0
0
0
0
0
0
0
0.198473
131
6
36
21.833333
0.857143
0.923664
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
5efa6e151c01168ce72103ab601a9bfb9f7028c8
54
py
Python
wsgi.py
vtrmantovani/sample-flask-docker
7e001cd8eeb09cdffb3b38d14b1ed137cf07da20
[ "MIT" ]
null
null
null
wsgi.py
vtrmantovani/sample-flask-docker
7e001cd8eeb09cdffb3b38d14b1ed137cf07da20
[ "MIT" ]
null
null
null
wsgi.py
vtrmantovani/sample-flask-docker
7e001cd8eeb09cdffb3b38d14b1ed137cf07da20
[ "MIT" ]
1
2020-04-21T22:58:28.000Z
2020-04-21T22:58:28.000Z
from sfd import create_app application = create_app()
18
26
0.814815
8
54
5.25
0.75
0.428571
0
0
0
0
0
0
0
0
0
0
0.12963
54
3
27
18
0.893617
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
5efb646beb0c767d402a2f3c2d6a865de7107cac
763
py
Python
tech_project/lib/python2.7/site-packages/phonenumbers/shortdata/region_DK.py
priyamshah112/Project-Descripton-Blog
8e01016c6be79776c4f5ca75563fa3daa839e39e
[ "MIT" ]
2,424
2015-01-05T05:34:45.000Z
2022-03-28T22:37:53.000Z
tech_project/lib/python2.7/site-packages/phonenumbers/shortdata/region_DK.py
priyamshah112/Project-Descripton-Blog
8e01016c6be79776c4f5ca75563fa3daa839e39e
[ "MIT" ]
166
2015-01-30T23:59:18.000Z
2022-03-14T21:08:42.000Z
tech_project/lib/python2.7/site-packages/phonenumbers/shortdata/region_DK.py
priyamshah112/Project-Descripton-Blog
8e01016c6be79776c4f5ca75563fa3daa839e39e
[ "MIT" ]
345
2015-01-02T00:33:27.000Z
2022-03-26T13:06:57.000Z
"""Auto-generated file, do not edit by hand. DK metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_DK = PhoneMetadata(id='DK', country_code=None, international_prefix=None, general_desc=PhoneNumberDesc(national_number_pattern='1\\d\\d(?:\\d(?:\\d{2})?)?', possible_length=(3, 4, 6)), toll_free=PhoneNumberDesc(national_number_pattern='11(?:[24]|6\\d{3})', example_number='112', possible_length=(3, 6)), emergency=PhoneNumberDesc(national_number_pattern='11[24]', example_number='112', possible_length=(3,)), short_code=PhoneNumberDesc(national_number_pattern='1(?:1(?:[2-48]|6(?:00[06]|111))|8(?:[08]1|1[0238]|28|30|5[13]))', example_number='112', possible_length=(3, 4, 6)), short_data=True)
76.3
171
0.722149
110
763
4.8
0.509091
0.174242
0.219697
0.272727
0.503788
0.327652
0
0
0
0
0
0.083688
0.076016
763
9
172
84.777778
0.665248
0.069463
0
0
1
0.142857
0.176136
0.12642
0
0
0
0
0
1
0
false
0
0.142857
0
0.142857
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
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
6f04ee9dc90e88b6a767cffb8dadaa013be4c9c3
180
gyp
Python
binding.gyp
dickeylth/require-verify
fc813397ceb1f34a11cdfc4078fa3e142b67bc97
[ "MIT" ]
1
2022-02-13T03:06:49.000Z
2022-02-13T03:06:49.000Z
binding.gyp
dickeylth/require-verify
fc813397ceb1f34a11cdfc4078fa3e142b67bc97
[ "MIT" ]
null
null
null
binding.gyp
dickeylth/require-verify
fc813397ceb1f34a11cdfc4078fa3e142b67bc97
[ "MIT" ]
null
null
null
{ "targets": [ { "target_name": "index", "sources": ["src/index.cc"], "defines": [ 'ENC_PUBLIC_KEY="<!(echo $ENC_PUBLIC_KEY)"' ] }, ], }
16.363636
51
0.438889
16
180
4.625
0.75
0.243243
0.324324
0
0
0
0
0
0
0
0
0
0.327778
180
11
52
16.363636
0.61157
0
0
0
0
0
0.497238
0.127072
0
0
0
0
0
1
0
true
0
0
0
0
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
6f3c9e162f77d0598b411a65498b7e4652c44563
37
py
Python
ch_08/PythonForTheLab/__init__.py
PFTL/py4lab
e1ba563c3ffa14e85710c42c65a2975924060369
[ "MIT" ]
9
2020-04-28T02:58:23.000Z
2021-09-05T22:00:47.000Z
ch_07/PythonForTheLab/__init__.py
PFTL/py4lab
e1ba563c3ffa14e85710c42c65a2975924060369
[ "MIT" ]
null
null
null
ch_07/PythonForTheLab/__init__.py
PFTL/py4lab
e1ba563c3ffa14e85710c42c65a2975924060369
[ "MIT" ]
3
2020-07-04T17:15:02.000Z
2021-03-03T07:49:09.000Z
import pint ur = pint.UnitRegistry()
12.333333
24
0.756757
5
37
5.6
0.8
0
0
0
0
0
0
0
0
0
0
0
0.135135
37
3
24
12.333333
0.875
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
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
0
0
1
0
0
0
0
4
6f653fe448d319f18a6f880811f35e219e41e645
90
py
Python
script/test.py
Nanra/UNBK-Untuk-Tunanetra
d181c5814c286b99f009224434416fdab0fde322
[ "MIT" ]
2
2018-03-23T08:30:37.000Z
2018-03-23T08:53:09.000Z
script/test.py
Nanra/UNBK-Untuk-Tunanetra
d181c5814c286b99f009224434416fdab0fde322
[ "MIT" ]
null
null
null
script/test.py
Nanra/UNBK-Untuk-Tunanetra
d181c5814c286b99f009224434416fdab0fde322
[ "MIT" ]
null
null
null
import os import time for i in range (1,6): print i,"Hello Bosskuh" time.sleep(1)
15
27
0.655556
17
90
3.470588
0.764706
0
0
0
0
0
0
0
0
0
0
0.043478
0.233333
90
5
28
18
0.811594
0
0
0
0
0
0.144444
0
0
0
0
0
0
0
null
null
0
0.4
null
null
0.2
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
4
6f6543033b9cc0985b50f464f1ece60c0ca37184
128
py
Python
Uni-Office/app.py
TaqsBlaze/Office
ac5d82205839ff4fc8d585bb7af110db996b67b6
[ "Apache-2.0" ]
null
null
null
Uni-Office/app.py
TaqsBlaze/Office
ac5d82205839ff4fc8d585bb7af110db996b67b6
[ "Apache-2.0" ]
null
null
null
Uni-Office/app.py
TaqsBlaze/Office
ac5d82205839ff4fc8d585bb7af110db996b67b6
[ "Apache-2.0" ]
null
null
null
from Office import UniOffice if __name__ == "__main__": UniOffice.run(host='0.0.0.0', port = 80, debug = True)
14.222222
58
0.609375
18
128
3.888889
0.777778
0.085714
0.085714
0
0
0
0
0
0
0
0
0.0625
0.25
128
9
58
14.222222
0.666667
0
0
0
0
0
0.123967
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
6f6c76d6de7fc64dd6e4b3ef220b7a22a9ed4424
523
py
Python
solutions/problem_157.py
ksvr444/daily-coding-problem
5d9f488f81c616847ee4e9e48974523ec2d598d7
[ "MIT" ]
1,921
2018-11-13T18:19:56.000Z
2021-11-15T14:25:41.000Z
solutions/problem_157.py
MohitIndian/daily-coding-problem
5d9f488f81c616847ee4e9e48974523ec2d598d7
[ "MIT" ]
2
2019-07-19T01:06:16.000Z
2019-08-01T22:21:36.000Z
solutions/problem_157.py
MohitIndian/daily-coding-problem
5d9f488f81c616847ee4e9e48974523ec2d598d7
[ "MIT" ]
1,066
2018-11-19T19:06:55.000Z
2021-11-13T12:33:56.000Z
def check_palindrome_rearrangement(string): chars = set() for char in string: if char not in chars: chars.add(char) else: chars.remove(char) return len(chars) < 2 # Tests assert check_palindrome_rearrangement("carrace") assert not check_palindrome_rearrangement("daily") assert not check_palindrome_rearrangement("abac") assert check_palindrome_rearrangement("abacc") assert check_palindrome_rearrangement("aabb") assert not check_palindrome_rearrangement("aabbcccd")
27.526316
53
0.739962
61
523
6.114754
0.42623
0.281501
0.525469
0.273458
0.297587
0
0
0
0
0
0
0.002326
0.17782
523
18
54
29.055556
0.865116
0.00956
0
0
0
0
0.063953
0
0
0
0
0
0.428571
1
0.071429
false
0
0
0
0.142857
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
4
4892476a217c84c6c8d424c0252cf7261e61d01d
318
py
Python
acmicpc/1193/test.py
morenice/learn_algorithms
d8cf1b9f95f134fae4fedf305453f143ab7cbde1
[ "MIT" ]
null
null
null
acmicpc/1193/test.py
morenice/learn_algorithms
d8cf1b9f95f134fae4fedf305453f143ab7cbde1
[ "MIT" ]
null
null
null
acmicpc/1193/test.py
morenice/learn_algorithms
d8cf1b9f95f134fae4fedf305453f143ab7cbde1
[ "MIT" ]
null
null
null
import unittest import solve class SolveTest(unittest.TestCase): def test_solve(self): self.assertEqual(solve.find_fraction(14), '2/4') self.assertEqual(solve.find_fraction(1), '1/1') self.assertEqual(solve.find_fraction(5), '2/2') self.assertEqual(solve.find_fraction(8), '2/3')
28.909091
56
0.68239
44
318
4.818182
0.431818
0.283019
0.377358
0.45283
0.603774
0
0
0
0
0
0
0.049242
0.169811
318
10
57
31.8
0.753788
0
0
0
0
0
0.037736
0
0
0
0
0
0.5
1
0.125
false
0
0.25
0
0.5
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
4
48afc4dda924bb7b5fa9855a6faef61637f5552e
308
py
Python
setup.py
julie-data/campaigns-measures-package
d7dde84ff8c6fd65932d8f0739d4684dc7b80dcb
[ "MIT" ]
null
null
null
setup.py
julie-data/campaigns-measures-package
d7dde84ff8c6fd65932d8f0739d4684dc7b80dcb
[ "MIT" ]
null
null
null
setup.py
julie-data/campaigns-measures-package
d7dde84ff8c6fd65932d8f0739d4684dc7b80dcb
[ "MIT" ]
null
null
null
from setuptools import setup setup(name='campaign_metrics_julie_data', version='0.1', description='Measures of campaigns per email and on site', packages=['campaign_metrics_julie_data'], author = 'Julie Trinco', author_email = 'julie_trinco@hotmail.com', zip_safe=False)
30.8
64
0.701299
39
308
5.307692
0.74359
0.144928
0.193237
0.231884
0
0
0
0
0
0
0
0.008065
0.194805
308
9
65
34.222222
0.826613
0
0
0
0
0
0.441558
0.253247
0
0
0
0
0
1
0
true
0
0.125
0
0.125
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
1
0
0
0
0
0
0
4
48b04b861302fb50ea5f14b0f980d2991b1e69d6
89
py
Python
app/shorten/apps.py
nebril/shortly
b2d051f2fa799e0a51e96582dce304e7cdc8dbe6
[ "MIT" ]
4
2019-06-29T02:41:50.000Z
2019-07-02T05:27:14.000Z
new_pro/shorten/apps.py
yadavshani67/url_short
5c41007e7a047047a1f821444207f965767b0717
[ "Apache-2.0" ]
null
null
null
new_pro/shorten/apps.py
yadavshani67/url_short
5c41007e7a047047a1f821444207f965767b0717
[ "Apache-2.0" ]
null
null
null
from django.apps import AppConfig class ShortenConfig(AppConfig): name = 'shorten'
14.833333
33
0.752809
10
89
6.7
0.9
0
0
0
0
0
0
0
0
0
0
0
0.168539
89
5
34
17.8
0.905405
0
0
0
0
0
0.078652
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
48b2cee8b725e7223e3b9cf60b226b8c2e831805
829
py
Python
LEMP/config.py
dipta007/SEMal
8c89e385ff946a2f9b9c5cefff3e0becc8e6a455
[ "MIT" ]
1
2020-07-02T00:39:15.000Z
2020-07-02T00:39:15.000Z
LEMP/config.py
dipta007/SEMal
8c89e385ff946a2f9b9c5cefff3e0becc8e6a455
[ "MIT" ]
7
2020-11-13T18:35:24.000Z
2022-02-26T22:50:33.000Z
LEMP/config.py
dipta007/SEMal
8c89e385ff946a2f9b9c5cefff3e0becc8e6a455
[ "MIT" ]
1
2020-10-12T01:51:22.000Z
2020-10-12T01:51:22.000Z
human = { "PSSM_folder": '../data/Malonylation/Human/PSSM/', "SPD3_folder": '../data/Malonylation/Human/SPD3/', "encoded_file": '../data/Malonylation/Human/HM_encoded.csv', "data_folder": '../data/Malonylation/Human/HSA+SPD3/', "output": '../data/lemp/human/lemp_features.npz', "output_lemp_compare": '../data/lemp/human/semal_features.npz', "model": "../data/rotation_forest_human.pkl", } mice = { "PSSM_folder": '../data/Malonylation/Mice/PSSM/', "SPD3_folder": '../data/Malonylation/Mice/SPD3/', "encoded_file": '../data/Malonylation/Mice/MM_encoded.csv', "data_folder": '../data/Malonylation/Mice/HSA+SPD3/', "output": '../data/lemp/mice/lemp_features.npz', "output_lemp_compare": '../data/lemp/mice/semal_features.npz', "model": "../data/rotation_forest_mice.pkl", }
41.45
67
0.66345
100
829
5.28
0.23
0.242424
0.25
0.153409
0.746212
0.435606
0.299242
0.151515
0
0
0
0.008152
0.112183
829
19
68
43.631579
0.709239
0
0
0
0
0
0.768396
0.587455
0
0
0
0
0
1
0
false
0
0
0
0
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
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
48c0951652feb88af968ae18a4099bfdfcac36a8
216
py
Python
string/Indexing.py
UgainJain/LearnPythonByDoing
4784c334d7f485223a29592ab47c6c017ec67145
[ "MIT" ]
5
2018-11-06T11:15:35.000Z
2020-07-29T21:54:28.000Z
string/Indexing.py
UgainJain/LearnPythonByDoing
4784c334d7f485223a29592ab47c6c017ec67145
[ "MIT" ]
1
2018-11-13T13:22:11.000Z
2018-11-13T13:22:11.000Z
string/Indexing.py
UgainJain/LearnPythonByDoing
4784c334d7f485223a29592ab47c6c017ec67145
[ "MIT" ]
11
2018-11-06T11:12:21.000Z
2019-07-12T11:43:05.000Z
#It will print the index of e vowels = ['a', 'e', 'i', 'o', 'i'] index = vowels.index("e") print(index) #It will print the index of o vowels = ['a', 'e', 'i', 'o', 'i'] index=vowels.index("o") print(index)
21.6
35
0.555556
38
216
3.157895
0.289474
0.1
0.183333
0.233333
0.8
0.8
0.45
0.45
0.45
0
0
0
0.203704
216
9
36
24
0.697674
0.259259
0
0.666667
0
0
0.080537
0
0
0
0
0
0
1
0
false
0
0
0
0
0.333333
0
0
0
null
0
1
1
0
1
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
48c3abb793cd4def73463045e5c31870104b609f
75
py
Python
models/core/__init__.py
tranaj2/Crockpot
435a3c89fffeb94dbab24845fac11a75c795444a
[ "MIT" ]
null
null
null
models/core/__init__.py
tranaj2/Crockpot
435a3c89fffeb94dbab24845fac11a75c795444a
[ "MIT" ]
5
2018-02-21T03:40:48.000Z
2018-04-17T06:38:48.000Z
models/core/__init__.py
tranaj2/CrockPot
435a3c89fffeb94dbab24845fac11a75c795444a
[ "MIT" ]
null
null
null
""" Contains classes that are used to model the core parts of CrockPot """
37.5
74
0.733333
12
75
4.583333
1
0
0
0
0
0
0
0
0
0
0
0
0.186667
75
1
75
75
0.901639
0.88
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
48c7bf6267c9f4edb57a1324b959b5c1c1aa30d9
5,220
py
Python
tests/test_path_select.py
Konubinix/Flexget
1379e346370ef144b9a02f761fc187497b6097e2
[ "MIT" ]
1
2017-08-25T07:17:04.000Z
2017-08-25T07:17:04.000Z
tests/test_path_select.py
Konubinix/Flexget
1379e346370ef144b9a02f761fc187497b6097e2
[ "MIT" ]
1
2015-11-10T01:07:54.000Z
2015-11-10T01:07:54.000Z
tests/test_path_select.py
Konubinix/Flexget
1379e346370ef144b9a02f761fc187497b6097e2
[ "MIT" ]
null
null
null
from __future__ import unicode_literals, division, absolute_import from tests import FlexGetBase import os import mock from flexget.config_schema import parse_size def mock_os_disk_stats(folder): used, total = os.path.basename(folder).split(',') used_bytes = parse_size(used) total_bytes = parse_size(total) free_bytes = total_bytes - used_bytes return free_bytes, total_bytes class TestPathSelect(FlexGetBase): __yaml__ = """ tasks: test_most_free: mock: - {title: 'Existence.2012'} path_select: to_field: path within: 0 select: most_free paths: - /data/1.5G,100G - /data/50G,100G - /data/1G,100G test_most_free_within: mock: - {title: 'Existence.2012'} path_select: to_field: path within: 1G select: most_free paths: - /data/49.5G,100G - /data/60G,100G - /data/50G,100G - /data/50.5G,100G - /data/80G,100G test_most_used: mock: - {title: 'Existence.2012'} path_select: to_field: path within: 1G select: most_used paths: - /data/90G,100G - /data/80G,100G - /data/90.5G,100G - /data/88G,100G test_most_free_percent: mock: - {title: 'Existence.2012'} path_select: to_field: path within: 2% select: most_free_percent paths: - /data/50G,100G - /data/40G,50G - /data/65G,80G - /data/50.5G,100G test_most_free_percent_within: mock: - {title: 'Existence.2012'} path_select: to_field: path within: 2% select: most_free_percent paths: - /data/50G,100G - /data/50.5G,100G - /data/52G,100G - /data/57G,100G - /data/80G,100G test_most_used_percent: mock: - {title: 'Existence.2012'} path_select: to_field: path within: 2% select: most_used_percent paths: - /data/99G,100G - /data/49G,50G - /data/40.5G,50G - /data/90.5G,100G """ @mock.patch('flexget.plugins.modify.path_select.os_disk_stats', side_effect=mock_os_disk_stats) def test_most_free(self, disk_static_func): self.execute_task('test_most_free') assert self.task.entries[0].get('path') == "/data/1G,100G" @mock.patch('flexget.plugins.modify.path_select.os_disk_stats', side_effect=mock_os_disk_stats) def test_most_free_within(self, disk_static_func): for i in range(0, 3): self.execute_task('test_most_free_within') assert self.task.entries[0].get('path') in [ "/data/49.5G,100G", "/data/50.5G,100G", "/data/50G,100G", ], "path %s not in list" % self.task.entries[0].get('path') @mock.patch('flexget.plugins.modify.path_select.os_disk_stats', side_effect=mock_os_disk_stats) def test_most_free_percent(self, disk_static_func): for i in range(0, 2): self.execute_task('test_most_free_percent') assert self.task.entries[0].get('path') in [ '/data/50.5G,100G', '/data/50G,100G', ], "path %s not in list" % self.task.entries[0].get('path') @mock.patch('flexget.plugins.modify.path_select.os_disk_stats', side_effect=mock_os_disk_stats) def test_most_free_percent_within(self, disk_static_func): for i in range(0, 2): self.execute_task('test_most_free_percent_within') assert self.task.entries[0].get('path') in [ '/data/50G,100G', '/data/50.5G,100G', '/data/52G,100G', ], "path %s not in list" % self.task.entries[0].get('path') @mock.patch('flexget.plugins.modify.path_select.os_disk_stats', side_effect=mock_os_disk_stats) def test_most_used_percent(self, disk_static_func): for i in range(0, 2): self.execute_task('test_most_used_percent') assert self.task.entries[0].get('path') in [ '/data/99G,100G', '/data/49G,50G', ], "path %s not in list" % self.task.entries[0].get('path') @mock.patch('flexget.plugins.modify.path_select.os_disk_stats', side_effect=mock_os_disk_stats) def test_most_used(self, disk_static_func): for i in range(0, 2): self.execute_task('test_most_used') assert self.task.entries[0].get('path') in [ '/data/90G,100G', '/data/90.5G,100G', ], "path %s not in list" % self.task.entries[0].get('path')
34.8
99
0.529119
627
5,220
4.1563
0.137161
0.067536
0.054873
0.067536
0.810437
0.75518
0.718342
0.689563
0.679202
0.665771
0
0.073236
0.356513
5,220
149
100
35.033557
0.70259
0
0
0.559701
0
0
0.567925
0.091972
0
0
0
0
0.044776
1
0.052239
false
0
0.037313
0
0.11194
0
0
0
0
null
0
0
0
1
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
5b1c1000a73834ae8c2f1297582393a876a39d27
393
py
Python
mollie/api/resources/settlement_chargebacks.py
bryanwills/mollie-api-python
8122569ae83f07ad07893f3dd56e9a60bcccae05
[ "BSD-2-Clause" ]
95
2015-02-22T23:32:13.000Z
2022-02-17T21:28:19.000Z
mollie/api/resources/settlement_chargebacks.py
bryanwills/mollie-api-python
8122569ae83f07ad07893f3dd56e9a60bcccae05
[ "BSD-2-Clause" ]
108
2015-02-26T08:51:35.000Z
2021-10-10T12:57:55.000Z
mollie/api/resources/settlement_chargebacks.py
bryanwills/mollie-api-python
8122569ae83f07ad07893f3dd56e9a60bcccae05
[ "BSD-2-Clause" ]
70
2015-01-17T17:47:56.000Z
2022-01-18T17:31:12.000Z
from .chargebacks import Chargebacks class SettlementChargebacks(Chargebacks): settlement_id = None def get_resource_name(self): return f"settlements/{self.settlement_id}/chargebacks" def with_parent_id(self, settlement_id): self.settlement_id = settlement_id return self def on(self, settlement): return self.with_parent_id(settlement.id)
24.5625
62
0.725191
47
393
5.829787
0.404255
0.262774
0.175182
0.131387
0
0
0
0
0
0
0
0
0.201018
393
15
63
26.2
0.872611
0
0
0
0
0
0.111959
0.111959
0
0
0
0
0
1
0.3
false
0
0.1
0.2
0.9
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4
5b23775eafa142415b0a787085aa881f2dc7df34
135
py
Python
search/urls.py
redhat-beyond/roo.me
7d711c1828a8951c7e29be796f9f26ed61e2b683
[ "MIT" ]
7
2021-03-08T18:15:44.000Z
2021-05-24T21:04:24.000Z
search/urls.py
AmitAharoni/roo.me
eb93ed99ab8635543a5e9489893e6718344ddfd9
[ "MIT" ]
232
2021-03-08T15:35:56.000Z
2021-06-06T21:33:10.000Z
search/urls.py
AmitAharoni/roo.me
eb93ed99ab8635543a5e9489893e6718344ddfd9
[ "MIT" ]
7
2021-03-08T13:11:46.000Z
2021-03-22T06:58:39.000Z
from django.urls import path from . import views as search_views urlpatterns = [ path('', search_views.search, name='search'), ]
16.875
49
0.711111
18
135
5.222222
0.555556
0.234043
0
0
0
0
0
0
0
0
0
0
0.17037
135
7
50
19.285714
0.839286
0
0
0
0
0
0.044444
0
0
0
0
0
0
1
0
false
0
0.4
0
0.4
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
d29c3ac58e333021338c1bbc4a0e1135b793e0d4
26
py
Python
linearalgebra-gp/__init__.py
gpetitpas/linearalgebra-gp
d92a821d5ea82a7534370cd12e75b694fb0e2a40
[ "MIT" ]
null
null
null
linearalgebra-gp/__init__.py
gpetitpas/linearalgebra-gp
d92a821d5ea82a7534370cd12e75b694fb0e2a40
[ "MIT" ]
null
null
null
linearalgebra-gp/__init__.py
gpetitpas/linearalgebra-gp
d92a821d5ea82a7534370cd12e75b694fb0e2a40
[ "MIT" ]
null
null
null
name == "linearalgebra-gp"
26
26
0.730769
3
26
6.333333
1
0
0
0
0
0
0
0
0
0
0
0
0.076923
26
1
26
26
0.791667
0
0
0
0
0
0.592593
0
0
0
0
0
0
1
0
true
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
d2e18c5ba549620c1670f9e356108d16d36982fc
2,759
py
Python
Problem8.py
MancaStrah/Project-Euler
058fda4a0b4ee89a1b3882e5602057a7a2675337
[ "MIT" ]
null
null
null
Problem8.py
MancaStrah/Project-Euler
058fda4a0b4ee89a1b3882e5602057a7a2675337
[ "MIT" ]
null
null
null
Problem8.py
MancaStrah/Project-Euler
058fda4a0b4ee89a1b3882e5602057a7a2675337
[ "MIT" ]
null
null
null
# The four adjacent digits in the 1000-digit number that have the greatest product are 9 × 9 × 8 × 9 = 5832. # # 73167176531330624919225119674426574742355349194934 # 96983520312774506326239578318016984801869478851843 # 85861560789112949495459501737958331952853208805511 # 12540698747158523863050715693290963295227443043557 # 66896648950445244523161731856403098711121722383113 # 62229893423380308135336276614282806444486645238749 # 30358907296290491560440772390713810515859307960866 # 70172427121883998797908792274921901699720888093776 # 65727333001053367881220235421809751254540594752243 # 52584907711670556013604839586446706324415722155397 # 53697817977846174064955149290862569321978468622482 # 83972241375657056057490261407972968652414535100474 # 82166370484403199890008895243450658541227588666881 # 16427171479924442928230863465674813919123162824586 # 17866458359124566529476545682848912883142607690042 # 24219022671055626321111109370544217506941658960408 # 07198403850962455444362981230987879927244284909188 # 84580156166097919133875499200524063689912560717606 # 05886116467109405077541002256983155200055935729725 # 71636269561882670428252483600823257530420752963450 # # Find the thirteen adjacent digits in the 1000-digit number that have the greatest product. What is the value of this product? number = 7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843858615607891129494954595017379583319528532088055111254069874715852386305071569329096329522744304355766896648950445244523161731856403098711121722383113622298934233803081353362766142828064444866452387493035890729629049156044077239071381051585930796086670172427121883998797908792274921901699720888093776657273330010533678812202354218097512545405947522435258490771167055601360483958644670632441572215539753697817977846174064955149290862569321978468622482839722413756570560574902614079729686524145351004748216637048440319989000889524345065854122758866688116427171479924442928230863465674813919123162824586178664583591245665294765456828489128831426076900422421902267105562632111110937054421750694165896040807198403850962455444362981230987879927244284909188845801561660979191338754992005240636899125607176060588611646710940507754100225698315520005593572972571636269561882670428252483600823257530420752963450 def kta_stevka ( k ) : stevka = ( number // (10 ** ( 1000 - k ) ) ) % 10 return stevka def produkti_trinajstih ( k ) : produkt = 1 for i in range ( k, k + 13): produkt = produkt * ( kta_stevka ( i ) ) return produkt produkti = list () k = 1 while k < 987 : produkti.append ( produkti_trinajstih ( k ) ) k += 1 produkti.sort () print ( produkti [ - 1] )
56.306122
1,010
0.870605
118
2,759
20.347458
0.550847
0.011662
0.013328
0.015827
0.049979
0.049979
0.049979
0.049979
0.049979
0.049979
0
0.817122
0.098224
2,759
48
1,011
57.479167
0.146704
0.454513
0
0
0
0
0
0
0
0
0
0
0
1
0.125
false
0
0
0
0.25
0.0625
0
0
1
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
d2f9c0c6693428846754cca46dc660eb31bf5da6
213
py
Python
tests/testapp/views.py
Thermondo/viewflow-extensions
5d2bbfe28ced7dda3e6832b96ea031c1b871053e
[ "Apache-2.0" ]
16
2016-03-11T14:30:48.000Z
2021-01-19T08:09:19.000Z
tests/testapp/views.py
Thermondo/viewflow-extensions
5d2bbfe28ced7dda3e6832b96ea031c1b871053e
[ "Apache-2.0" ]
32
2016-05-23T10:59:09.000Z
2019-01-03T09:13:11.000Z
tests/testapp/views.py
Thermondo/viewflow-extensions
5d2bbfe28ced7dda3e6832b96ea031c1b871053e
[ "Apache-2.0" ]
7
2016-03-11T17:55:47.000Z
2020-02-24T18:20:58.000Z
from viewflow.flow.views import UpdateProcessView from viewflow_extensions.views import SavableViewActivationMixin class SavableProcessView(SavableViewActivationMixin, UpdateProcessView): fields = ['text']
26.625
72
0.84507
18
213
9.944444
0.666667
0.134078
0
0
0
0
0
0
0
0
0
0
0.098592
213
7
73
30.428571
0.932292
0
0
0
0
0
0.018779
0
0
0
0
0
0
1
0
false
0
0.5
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
d2fb1b4b0f512cea3bc63f518573a2cbe6fca7ed
458
py
Python
payroll/authentication/passcode_generator.py
the-krafty-koder/pay-3
20426ef00b78c2a65fb4031a7692866bd22a991a
[ "MIT" ]
1
2021-03-26T19:39:30.000Z
2021-03-26T19:39:30.000Z
payroll/authentication/passcode_generator.py
the-krafty-koder/pay-3
20426ef00b78c2a65fb4031a7692866bd22a991a
[ "MIT" ]
12
2020-10-27T22:47:01.000Z
2022-03-12T00:42:49.000Z
payroll/authentication/passcode_generator.py
the-krafty-koder/pay-3
20426ef00b78c2a65fb4031a7692866bd22a991a
[ "MIT" ]
null
null
null
from django.core.signing import TimestampSigner class GeneratePassCode: def __init__(self, firm_name, employee_id): self.firm_name = firm_name self.employee_id = employee_id def get_string(self,id_string): signer = TimestampSigner(salt="extra") value = signer.sign(id_string) return value def get_code(self): code = self.get_string(f'{self.firm_name}:{self.employee_id}') return code
24.105263
70
0.674672
59
458
4.949153
0.423729
0.109589
0.123288
0.136986
0.150685
0
0
0
0
0
0
0
0.233624
458
18
71
25.444444
0.831909
0
0
0
1
0
0.087336
0.076419
0
0
0
0
0
1
0.25
false
0.083333
0.083333
0
0.583333
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
4
9604a3ddb228b1152e9969597f355722c78d0efb
319
py
Python
sentivi/ensemble.py
vndee/sentivi
3df2c604d4f9934be9019ac3d6fdef48c6cc7c33
[ "MIT" ]
13
2020-10-01T07:38:30.000Z
2022-02-09T10:30:04.000Z
sentivi/ensemble.py
vndee/sentivi
3df2c604d4f9934be9019ac3d6fdef48c6cc7c33
[ "MIT" ]
null
null
null
sentivi/ensemble.py
vndee/sentivi
3df2c604d4f9934be9019ac3d6fdef48c6cc7c33
[ "MIT" ]
4
2020-10-01T07:55:47.000Z
2022-01-13T03:33:28.000Z
class SimpleWeightedEnsemble(object): def __init__(self): super(SimpleWeightedEnsemble, self).__init__() class XGBoostEnsemble(object): def __init__(self): super(XGBoostEnsemble, self).__init__() class MLPEnsemble(object): def __init__(self): super(MLPEnsemble, self).__init__()
22.785714
54
0.705329
30
319
6.7
0.3
0.134328
0.19403
0.253731
0.328358
0
0
0
0
0
0
0
0.181818
319
13
55
24.538462
0.770115
0
0
0.333333
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0
0
0.666667
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
96234e24a680aee3fcb333b23036230abcfae1aa
1,660
py
Python
activity/templatetags/custom_ui_tags.py
lyonkvalid/Audifye
e60c65526437f615ec26992230a0a3f136e88c84
[ "MIT" ]
1
2021-06-24T10:05:41.000Z
2021-06-24T10:05:41.000Z
activity/templatetags/custom_ui_tags.py
lyonkvalid/Audifye
e60c65526437f615ec26992230a0a3f136e88c84
[ "MIT" ]
null
null
null
activity/templatetags/custom_ui_tags.py
lyonkvalid/Audifye
e60c65526437f615ec26992230a0a3f136e88c84
[ "MIT" ]
null
null
null
from django import template import random from models.models import * from authentication.models import * register = template.Library() @register.simple_tag def eval_string(value): return eval(value) @register.simple_tag def concat_prefix_and_surfix(prefix, value, surfix): return prefix+value+surfix @register.simple_tag def replace_string(string, replace, value): return string.replace(replace, value) @register.filter def includes(string, value): return string.find(value) > 0 @register.simple_tag def randomNumber(): return random.randint(0, 100000) @register.simple_tag def playlist_exist(request, id): if request.user.is_authenticated: try: my_library = MyLibrary.objects.get(user=request.user) return my_library.playlists.filter(collection__id=id).exists except: return False else: return False from core import const @register.simple_tag def get_genres(): return const.GENRES @register.simple_tag def get_moods(): return const.MOODS @register.simple_tag def is_following(request_user, user): return request_user.following.filter(id=user.id).exists() @register.simple_tag def random_color(): colors = ["0d6efd", "6610f2", "6f42c1", "d63384", "198754", "0dcaf0", "20c997", "dc3545", "ffc107"] return "#{}".format(colors[random.randint(0, len(colors) -1)]) @register.simple_tag def mul_calc(a, b): return a * b @register.simple_tag def get_plan_id(plan): return list(filter(lambda subscription: subscription[0] == verification["data"]["plan"], const.SUBSCRIPTIONS))[0][0] @register.simple_tag def set_plan(request, plan): kyc = request.user.kyc kyc.plans = plan kyc.save()
23.380282
118
0.744578
229
1,660
5.253275
0.353712
0.139651
0.169576
0.199501
0.092269
0
0
0
0
0
0
0.033981
0.131325
1,660
71
119
23.380282
0.800277
0
0
0.254545
0
0
0.039133
0
0
0
0
0
0
1
0.236364
false
0
0.090909
0.181818
0.581818
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4
826d5fd9eb7efcfcf09cab8053d14ea6be05dd29
1,363
py
Python
backend/dndapi/races/models.py
cyaconiello/dndapi
7f4709f152ae820d17efea4da8671665fef01907
[ "MIT" ]
null
null
null
backend/dndapi/races/models.py
cyaconiello/dndapi
7f4709f152ae820d17efea4da8671665fef01907
[ "MIT" ]
2
2022-03-08T20:49:43.000Z
2022-03-08T23:18:19.000Z
backend/dndapi/races/models.py
cyaconiello/dndapi
7f4709f152ae820d17efea4da8671665fef01907
[ "MIT" ]
null
null
null
import uuid from django.db import models from multiselectfield import MultiSelectField from common.util.choices import ( size_choices, language_choices, ) class Race(models.Model): race_uuid = models.UUIDField(default=uuid.uuid4, unique=True, editable=False) name = models.CharField(max_length=120, unique=True) description = models.TextField(blank=True) size = models.CharField( max_length=10, choices=size_choices, default=size_choices[2][0] ) speed = models.PositiveIntegerField(default=30) strength_ability_increase = models.PositiveIntegerField(default=0) dexterity_ability_increase = models.PositiveIntegerField(default=0) constitution_ability_increase = models.PositiveIntegerField(default=0) intelligince_ability_increase = models.PositiveIntegerField(default=0) wisdom_ability_increase = models.PositiveIntegerField(default=0) charisma_ability_increase = models.PositiveIntegerField(default=0) additional_ability_increases = models.PositiveIntegerField( help_text="For every additional +1 to stat attribute increase this value by 1. (example: Half Elf gets 2 addional stat increase by 1, so this value would be 2.)", default=0, ) languages = MultiSelectField(choices=language_choices, null=True, blank=True) def __str__(self): return self.name
38.942857
170
0.76449
161
1,363
6.304348
0.440994
0.204926
0.227586
0.242365
0.289655
0.289655
0
0
0
0
0
0.019097
0.154806
1,363
34
171
40.088235
0.861979
0
0
0
0
0.035714
0.109318
0
0
0
0
0
0
1
0.035714
false
0
0.142857
0.035714
0.714286
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
4
8281a46f54219b4687289f0455cbbbda17804a5c
159
py
Python
nn/__init__.py
marella/nn
1ace22a2a9435f9807ee15b67c886d12460546e3
[ "MIT" ]
2
2018-05-09T02:09:43.000Z
2021-07-22T03:57:12.000Z
nn/__init__.py
marella/nn
1ace22a2a9435f9807ee15b67c886d12460546e3
[ "MIT" ]
null
null
null
nn/__init__.py
marella/nn
1ace22a2a9435f9807ee15b67c886d12460546e3
[ "MIT" ]
null
null
null
from tensorflow.keras import * from .layers import * from .optimizers import * from .core import * from . import layers from . import optimizers tf = to_tf
14.454545
30
0.742138
22
159
5.318182
0.409091
0.34188
0
0
0
0
0
0
0
0
0
0
0.188679
159
10
31
15.9
0.906977
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.857143
0
0.857143
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
8284705e1c431230ed9ee2e890fbd6652868b298
92
py
Python
GBM/EOR_Andrea/Readme.py
joshlyman/TextureAnalysis
bfbedbd53f62396fdef383408089b37e5ab511d0
[ "MIT" ]
1
2020-07-06T01:47:49.000Z
2020-07-06T01:47:49.000Z
GBM/EOR_Andrea/Readme.py
kumarneeraj2005/TextureAnalysis
bfbedbd53f62396fdef383408089b37e5ab511d0
[ "MIT" ]
null
null
null
GBM/EOR_Andrea/Readme.py
kumarneeraj2005/TextureAnalysis
bfbedbd53f62396fdef383408089b37e5ab511d0
[ "MIT" ]
1
2020-06-22T08:26:10.000Z
2020-06-22T08:26:10.000Z
# This package is for Dr. Andrea's addtional brain image folder "EOR" shared in summer 2017.
92
92
0.771739
16
92
4.4375
1
0
0
0
0
0
0
0
0
0
0
0.051948
0.163043
92
1
92
92
0.87013
0.978261
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
8294f2f48ee3aeb51a4d35ba311ea57008b475f6
79
py
Python
django_faucet_pipeline/tests/testapp/__init__.py
ngrewe/django-faucet-pipeline
73f5cd33b41cd4f39ed46df7ab7a3787e702f2b0
[ "MIT" ]
3
2020-09-27T21:20:49.000Z
2020-10-01T06:11:42.000Z
django_faucet_pipeline/tests/testapp/__init__.py
ngrewe/django-faucet-pipeline
73f5cd33b41cd4f39ed46df7ab7a3787e702f2b0
[ "MIT" ]
null
null
null
django_faucet_pipeline/tests/testapp/__init__.py
ngrewe/django-faucet-pipeline
73f5cd33b41cd4f39ed46df7ab7a3787e702f2b0
[ "MIT" ]
null
null
null
default_app_config = "django_faucet_pipeline.tests.testapp.apps.TestAppConfig"
39.5
78
0.873418
10
79
6.5
1
0
0
0
0
0
0
0
0
0
0
0
0.037975
79
1
79
79
0.855263
0
0
0
0
0
0.696203
0.696203
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
82b7c47235a3e6c59f28610f81d144fe1d197b07
11,371
py
Python
migrations/versions/51c45c33b356_ajout_données_radon.py
betagouv/indice_pollution
112f262397686110475ed360101b311e76d5d914
[ "MIT" ]
2
2020-09-02T20:17:22.000Z
2022-03-04T21:06:28.000Z
migrations/versions/51c45c33b356_ajout_données_radon.py
betagouv/indice_pollution
112f262397686110475ed360101b311e76d5d914
[ "MIT" ]
34
2020-08-13T11:47:13.000Z
2022-03-31T08:05:37.000Z
migrations/versions/51c45c33b356_ajout_données_radon.py
betagouv/indice_pollution
112f262397686110475ed360101b311e76d5d914
[ "MIT" ]
null
null
null
"""Ajout données radon Revision ID: 51c45c33b356 Revises: 60d538317728 Create Date: 2021-06-21 10:37:18.850467 """ from re import subn from alembic import op import sqlalchemy as sa from sqlalchemy.dialects.postgresql import insert import requests import csv from sqlalchemy.sql.expression import bindparam, select, text from sqlalchemy.sql.selectable import subquery # revision identifiers, used by Alembic. revision = '51c45c33b356' down_revision = '60d538317728' branch_labels = None depends_on = None oudated_communes = ['80608', '79261', '60475', '79039', '50206', '11097', '71587', '16051', '51651', '22357', '88392', '78251', '17392', '76525', '49319', '74182', '16314', '49304', '39566', '28044', '24079', '79171', '39347', '39023', '08152', '22253', '14164', '30157', '14551', '55164', '39195', '14568', '73002', '50171', '29129', '27651', '14688', '25399', '14423', '39264', '89174', '67402', '90073', '05043', '39303', '50163', '53004', '14176', '49366', '50001', '61496', '24103', '49207', '39542', '33338', '50018', '39135', '76729', '79279', '69211', '72116', '46327', '89484', '60455', '61161', '76191', '35147', '39113', '27344', '85048', '09317', '14616', '79292', '14013', '74011', '14128', '28115', '02733', '49065', '62294', '53241', '73266', '80594', '14151', '49141', '44017', '16214', '48060', '76127', '41092', '71288', '25587', '33092', '73203', '35113', '88234', '50427', '49158', '49274', '41263', '61154', '41005', '72082', '50438', '86278', '79054', '14373', '87136', '61477', '79222', '24561', '49051', '89109', '23121', '24283', '28412', '61299', '86277', '61311', '41064', '63078', '62431', '50154', '76080', '48133', '49289', '73118', '89001', '27058', '50220', '65312', '24170', '73163', '53092', '79098', '61437', '14433', '50631', '16017', '65122', '16376', '69114', '79328', '27510', '50524', '31307', '50080', '71304', '25319', '73260', '72081', '39036', '79260', '79027', '14417', '53032', '86188', '28150', '39115', '14279', '14750', '38274', '01205', '24402', '16386', '24204', '49037', '24166', '14387', '22154', '50318', '43176', '24475', '50385', '48014', '27647', '37209', '35209', '24503', '49365', '27581', '31298', '14596', '52351', '39243', '50534', '31438', '49189', '38025', '39414', '39158', '24092', '14350', '39440', '14296', '24447', '14662', '38293', '39089', '35303', '41170', '17352', '72108', '72159', '25123', '01186', '24127', '81113', '63133', '49078', '49318', '18239', '55030', '27551', '73111', '61325', '62210', '38312', '16202', '49136', '07256', '17169', '76674', '24178', '79004', '39417', '16410', '89421', '28093', '73045', '78524', '16296', '48180', '50465', '49044', '24041', '38534', '74120', '48078', '14313', '14081', '74274', '50320', '26184', '60096', '14413', '44160', '21486', '14600', '27265', '85299', '81226', '61004', '24369', '16344', '16033', '14757', '08042', '39186', '14450', '50325', '52262', '16294', '79318', '69101', '79219', '28241', '41033', '60080', '38435', '49186', '14002', '80532', '74022', '14763', '71180', '50140', '28311', '79107', '14307', '50354', '71055', '16259', '49227', '08072', '14339', '16332', '49305', '79247', '46278', '67014', '70475', '61231', '49198', '24389', '27175', '14235', '49103', '50622', '01316', '14208', '85044', '56038', '01414', '45267', '25027', '24033', '51271', '40048', '79264', '17103', '50257', '60038', '14212', '79168', '89078', '61019', '14604', '28083', '38121', '73287', '61318', '14359', '28356', '27600', '46274', '53095', '57523', '70497', '72284', '57585', '28204', '39562', '79214', '67439', '87055', '50100', '53244', '50620', '24333', '61471', '85168', '16115', '86056', '01097', '86030', '24368', '14004', '50581', '37135', '24181', '79011', '28165', '01154', '64020', '14074', '27402', '30190', '79033', '28318', '39148', '14142', '35301', '49159', '50623', '21621', '27626', '49226', '50605', '60453', '69237', '60300', '50611', '69147', '50477', '14008', '69251', '49335', '91222', '24233', '22038', '14189', '49254', '50573', '60694', '27268', '01122', '15227', '19183', '86208', '01172', '28017', '24530', '87196', '22167', '46248', '49175', '39123', '48047', '76248', '24431', '14109', '39069', '14186', '03318', '14493', '36206', '14099', '35011', '50636', '51261', '22078', '16391', '69224', '80551', '77399', '79330', '14386', '16417', '27253', '14294', '24093', '35254', '17272', '16274', '35100', '16328', '69073', '14217', '19032', '69146', '50313', '86146', '14525', '80209', '50460', '49088', '72097', '46300', '77149', '01059', '16309', '74245', '78503', '50057', '69213', '37120', '85027', '27452', '46099', '53254', '28112', '69223', '39483', '49091', '48189', '50014', '54342', '89340', '50037', '42291', '49309', '73112', '91182', '76607', '14517', '01442', '02434', '61009', '24433', '49150', '39564', '50583', '69015', '24344', '27150', '56138', '46158', '14580', '70375', '27648', '85224', '79178', '49317', '14544', '80761', '29203', '53159', '57432', '35269', '14691', '14157', '14158', '72063', '26297', '15047', '79075', '50223', '16129', '61057', '14376', '14481', '50308', '49184', '41015', '50640', '50073', '80389', '41082', '61083', '38016', '46298', '72240', '53231', '25531', '27657', '22247', '42082', '79051', '61173', '73167', '49087', '86067', '14548', '46285', '79327', '72033', '14056', '60690', '48084', '28262', '49376', '16247', '05141', '95259', '24198', '49047', '61449', '38014', '79282', '27523', '50608', '52225', '65480', '01144', '50485', '50627', '49122', '73127', '77491', '04198', '61157', '27297', '05150', '73198', '25250', '28250', '35053', '57722', '69048', '39395', '79045', '56183', '39506', '49062', '14505', '49115', '50516', '27274', '49250', '61383', '14073', '76078', '14185', '50007', '28066', '14581', '24235', '40107', '27588', '39484', '89381', '01413', '14608', '50333', '14690', '25137', '49197', '81301', '51411', '18123', '49354', '27642', '21073', '76639', '02301', '41272', '14201', '08443', '50107', '08079', '79044', '28133', '07252', '61403', '24065', '40302', '49337', '46067', '79035', '41240', '24203', '28376', '61504', '50103', '01221', '14382', '50244', '24047', '25576', '50187', '50020', '33107', '14477', '38367', '14722', '19127', '19185', '69210', '14331', '60649', '60532', '49156', '12020', '14444', '01341', '49073', '24427', '25610', '29219', '49234', '53138', '11298', '50119', '50449', '35348', '80419', '76044', '49144', '25140', '86043', '48142', '28002', '41011', '22123', '09286', '35341', '08371', '14666', '53014', '14702', '22007', '54506', '02475', '49187', '41202', '16228', '37102', '02344', '07016', '50043', '53205', '14703', '74110', '86219', '28295', '49001', '27549', '37227', '41197', '35293', '79068', '85052', '14422', '15044', '48195', '09302', '24579', '49233', '29149', '89448', '14577', '27491', '28063', '49046', '73144', '01218', '46077', '61285', '53215', '01091', '49013', '24391', '79314', '48122', '49105', '33267', '09135', '49108', '14192', '48125', '35083', '16149', '01417', '61172', '25593', '79199', '73056', '08493', '38306', '50248', '14513', '39287', '49096', '74268', '46014', '50131', '22173', '15099', '08475', '50337', '72384', '74204', '15136', '49098', '49282', '53065', '79321', '49202', '49119', '86060', '61468', '48023', '88235', '53207', '44093', '81260', '53006', '50404', '28340', '35048', '50503', '48101', '41165', '81296', '24258', '14671', '73244', '11329', '44219', '54341', '49052', '79188', '49208', '14729', '14031', '24099', '38302', '87173', '61110', '05175', '22298', '49363', '85060', '50089', '77028', '14462', '44191', '23231', '42004', '48154', '48184', '79240', '19218', '72203', '14472', '24270', '49104', '38125', '22290', '48057', '14489', '48183', '49277', '35267', '41257', '48120', '05120', '14597', '89260', '79211', '17189', '50348', '28101', '14268', '50323', '16156', '21513', '72117', '86166', '85107', '49149', '56016', '33091', '85166', '14695', '15035', '27131', '79173', '49173', '69185', '49327', '41210', '73080', '28224', '28205', '27270', '48093', '73143', '05088', '49081', '15031', '16004', '14611', '16411', '63127', '56059', '87184', '26354', '15171', '61131', '23126', '73046', '39341', '79006', '61315', '16094', '85217', '46331', '72304', '69195', '36072', '22100', '49290', '48197', '49077', '14219', '49014', '89473', '38305', '48164', '14508', '27092', '39224', '81241', '48076', '50301', '56064', '40009', '35323', '79325', '79043', '74217', '15145', '14749', '48040', '69222', '14372', '27416', '07135', '18222', '69150', '86021', '58022', '14416', '50386', '24044', '27093', '09028', '80447', '39075', '50358', '27607', '22192', '39309', '86071', '24249', '80175', '50242', '21658', '70345', '34330', '35344', '27143', '74093', '50600', '49191', '14415', '50125', '39064', '50160', '32074', '67560', '49229', '14075', '39549', '97127', '97500', '97500'] def upgrade(): potentiel_radon = sa.Table( "potentiel_radon", sa.MetaData(), sa.Column("zone_id", sa.Integer), sa.Column("classe_potentiel", sa.Integer), schema="indice_schema" ) commune_table = sa.Table( "commune", sa.MetaData(), sa.Column("zone_id", sa.Integer()), sa.Column("insee", sa.Integer), schema="indice_schema" ) r = requests.get('https://static.data.gouv.fr/resources/connaitre-le-potentiel-radon-de-ma-commune/20190506-174309/radon.csv') decoded_content = r.content.decode('utf-8') lines = decoded_content.splitlines() reader = csv.reader(lines, delimiter=';') def format_insee(i: str): try: return f"{int(i.strip()):05}" except ValueError: return i def insert_potentiel(rows): for row in rows: insee = format_insee(row[2]) if row[2] else None if not row[2] or insee in oudated_communes: continue op.execute( insert(potentiel_radon).values( { "zone_id": sa.select((commune_table.c.zone_id,)).where(commune_table.c.insee==insee), "classe_potentiel": int(row[3]) } ).on_conflict_do_nothing() ) rows = [] next(reader) for row in reader: rows.append(row) if len(rows) < 100: continue insert_potentiel(rows) rows = [] insert_potentiel(rows) def downgrade(): sa.execute('TRUNCATE TABLE indice_schema.potentiel_radon')
135.369048
9,208
0.522118
1,178
11,371
5.013582
0.881155
0.011852
0.004064
0.006096
0.023027
0.013884
0.013884
0.013884
0.013884
0.013884
0
0.523554
0.214053
11,371
83
9,209
137
0.137294
0.013016
0
0.163934
0
0.016393
0.436954
0.002586
0
0
0
0
0
1
0.065574
false
0
0.131148
0
0.229508
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
1
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
82e744ea1c63aae0b57e5b6a6f7bc9d3cc4570b5
201
py
Python
python/tests/test_TokenEntity.py
vt-dev/sdk
ccd6d2b6dd940bf335a1d40ff7a7ea77f3e297d0
[ "Apache-2.0" ]
10
2017-05-25T18:20:44.000Z
2018-04-15T16:24:35.000Z
python/tests/test_TokenEntity.py
vt-dev/sdk
ccd6d2b6dd940bf335a1d40ff7a7ea77f3e297d0
[ "Apache-2.0" ]
4
2019-11-13T01:47:24.000Z
2021-01-20T22:05:47.000Z
python/tests/test_TokenEntity.py
vt-dev/sdk
ccd6d2b6dd940bf335a1d40ff7a7ea77f3e297d0
[ "Apache-2.0" ]
5
2017-06-20T02:08:30.000Z
2018-04-26T15:54:58.000Z
from sdk.data.Entities import Token def test_get_bearer(): token = Token('private', 'refresh') assert token.get_bearer() == "Bearer private" assert token.get_bearer() != "Bearer refresh"
25.125
49
0.696517
26
201
5.230769
0.5
0.198529
0.205882
0.294118
0.382353
0
0
0
0
0
0
0
0.169154
201
7
50
28.714286
0.814371
0
0
0
0
0
0.208955
0
0
0
0
0
0.4
1
0.2
false
0
0.2
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
0
0
0
0
0
4
7d6f5ec1efd920b56e2000b17a3b1e279dabe591
1,227
py
Python
guirpc/amqp/domain/encoding.py
guiloga/guirpc
fe740c4f318265df8b4331c682edb4cb7fe4bd89
[ "MIT" ]
3
2021-02-01T22:48:10.000Z
2021-05-28T12:36:04.000Z
guirpc/amqp/domain/encoding.py
guiloga/guirpc
fe740c4f318265df8b4331c682edb4cb7fe4bd89
[ "MIT" ]
1
2021-05-28T12:51:43.000Z
2021-06-13T09:33:23.000Z
guirpc/amqp/domain/encoding.py
guiloga/guirpc
fe740c4f318265df8b4331c682edb4cb7fe4bd89
[ "MIT" ]
null
null
null
import base64 class StringEncoder: """ String to Bytes encoder/decoder. """ @classmethod def encode(cls, stream_str: str, codec="ascii") -> bytes: return stream_str.encode(encoding=codec) @classmethod def decode(cls, bytes_obj: bytes, codec="ascii") -> str: return bytes_obj.decode(encoding=codec) class BytesEncoder: """ Bytes encoder/decoder. This applies binary transformations from a bytes-like object to a bytes mapping with codec base64. """ # TODO: Maybe extend this class allowing other type # of binary transformations. BINARY_CODECS = ("base64",) @classmethod def encode( cls, stream_bytes: bytes, binary_codec=BINARY_CODECS[0] ) -> bytes: _encoder = getattr(cls, f"enc_{binary_codec}") return _encoder(stream_bytes) @classmethod def decode(cls, bytes_obj: bytes, binary_codec=BINARY_CODECS[0]) -> bytes: _decoder = getattr(cls, f"dec_{binary_codec}") return _decoder(bytes_obj) @staticmethod def enc_base64(bytes_: bytes): return base64.encodebytes(bytes_) @staticmethod def dec_base64(bytes_: bytes): return base64.decodebytes(bytes_)
25.5625
78
0.665037
144
1,227
5.479167
0.333333
0.070976
0.048162
0.058302
0.315589
0.171103
0.171103
0
0
0
0
0.017058
0.235534
1,227
47
79
26.106383
0.824094
0.189894
0
0.230769
0
0
0.054507
0
0
0
0
0.021277
0
1
0.230769
false
0
0.038462
0.153846
0.615385
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
1
0
0
0
1
1
0
0
4
7d6f5f545e1e1fd22663052f83b955fe64014e64
120
py
Python
pizzaapp/admin.py
TheVishwajeetJagtap/Pizza-Delivery
31743a5da75a5db0d94f5c2110db70b3e0d5a9a1
[ "MIT" ]
null
null
null
pizzaapp/admin.py
TheVishwajeetJagtap/Pizza-Delivery
31743a5da75a5db0d94f5c2110db70b3e0d5a9a1
[ "MIT" ]
null
null
null
pizzaapp/admin.py
TheVishwajeetJagtap/Pizza-Delivery
31743a5da75a5db0d94f5c2110db70b3e0d5a9a1
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import PizzaModel # Register your models here. admin.register(PizzaModel)
24
32
0.825
16
120
6.1875
0.625
0
0
0
0
0
0
0
0
0
0
0
0.116667
120
4
33
30
0.933962
0.216667
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
7d7367a4f33f492d59a39d60351958e2edcdebe9
224
py
Python
wikimetrics/api/__init__.py
wikimedia/analytics-wikimetrics
1d2036657b06ccd16ecfc76edd3f9a6119ff75f4
[ "MIT" ]
6
2015-01-28T05:59:08.000Z
2018-01-09T07:48:57.000Z
wikimetrics/api/__init__.py
wikimedia/analytics-wikimetrics
1d2036657b06ccd16ecfc76edd3f9a6119ff75f4
[ "MIT" ]
2
2020-05-09T16:36:43.000Z
2020-05-09T16:52:35.000Z
wikimetrics/api/__init__.py
wikimedia/analytics-wikimetrics
1d2036657b06ccd16ecfc76edd3f9a6119ff75f4
[ "MIT" ]
1
2016-01-13T07:19:44.000Z
2016-01-13T07:19:44.000Z
from file_manager import * from centralauth import * from cohorts import * from tags import * from replication_lag import * from reports import * from batch import * # ignore flake8 because of F403 violation # flake8: noqa
20.363636
41
0.78125
31
224
5.580645
0.580645
0.346821
0
0
0
0
0
0
0
0
0
0.027027
0.174107
224
10
42
22.4
0.908108
0.232143
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
7d8c8ba89f86ecff47ee7218086b46f1b2abbefa
148
py
Python
sorter-runner.py
underhood31/py-sorts
5bff2b3280010b619d1ab3e0e71f0701c8d90080
[ "MIT" ]
10
2018-04-18T05:30:41.000Z
2021-04-17T17:01:49.000Z
sorter-runner.py
underhood31/py-sorts
5bff2b3280010b619d1ab3e0e71f0701c8d90080
[ "MIT" ]
1
2018-04-14T14:02:26.000Z
2018-04-16T12:31:42.000Z
sorter-runner.py
underhood31/py-sorts
5bff2b3280010b619d1ab3e0e71f0701c8d90080
[ "MIT" ]
3
2018-04-18T12:19:18.000Z
2019-09-14T13:25:28.000Z
"""Convenience wrapper for running py_sorter directly from source tree.""" from py_sorter.sorter import main if __name__ == '__main__': main()
24.666667
74
0.743243
20
148
5
0.7
0.16
0
0
0
0
0
0
0
0
0
0
0.155405
148
6
75
24.666667
0.8
0.459459
0
0
0
0
0.106667
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
7dd6e3cf4e091d5839dc0289bb5b5d17f995a1fb
220
py
Python
django_yubico/urls.py
StevenMonty/django_yubico
42d70eb8be4fb01233022fa3605ab0bc8e24a39e
[ "BSD-3-Clause" ]
1
2021-10-21T16:30:46.000Z
2021-10-21T16:30:46.000Z
django_yubico/urls.py
StevenMonty/django_yubico
42d70eb8be4fb01233022fa3605ab0bc8e24a39e
[ "BSD-3-Clause" ]
null
null
null
django_yubico/urls.py
StevenMonty/django_yubico
42d70eb8be4fb01233022fa3605ab0bc8e24a39e
[ "BSD-3-Clause" ]
null
null
null
from django.conf.urls import url from django_yubico.views import login, password urlpatterns = [ url(r'^login', login, name='yubico_django_login'), url(r'^password', password, name='yubico_django_password'), ]
24.444444
63
0.736364
30
220
5.233333
0.433333
0.127389
0.203822
0
0
0
0
0
0
0
0
0
0.131818
220
8
64
27.5
0.82199
0
0
0
0
0
0.254545
0.1
0
0
0
0
0
1
0
false
0.333333
0.333333
0
0.333333
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
1
0
0
0
0
4
7dde006dad16ec899c5436aacaea69afdcf5e1a0
135
py
Python
src/algorithms/matrix/__init__.py
iamantony/PythonNotes
4ed740378bd5e031e2c21675f33ae8e199a48bbb
[ "MIT" ]
null
null
null
src/algorithms/matrix/__init__.py
iamantony/PythonNotes
4ed740378bd5e031e2c21675f33ae8e199a48bbb
[ "MIT" ]
null
null
null
src/algorithms/matrix/__init__.py
iamantony/PythonNotes
4ed740378bd5e031e2c21675f33ae8e199a48bbb
[ "MIT" ]
null
null
null
__author__ = 'Antony Cherepanov' from strassen_multiplication import StrassenMultiplication __all__ = [strassen_multiplication]
22.5
59
0.822222
11
135
9.181818
0.818182
0.435644
0
0
0
0
0
0
0
0
0
0
0.133333
135
5
60
27
0.863248
0
0
0
0
0
0.130769
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
814507ee9751e728c073948f93edf7cc0c409b01
568
py
Python
tests/root_chain/contracts/data_structures/test_priority_queue.py
josojo/plasma-mvp
2c1d6d324ea164b2081c628170da4bae59c9018e
[ "Apache-2.0" ]
null
null
null
tests/root_chain/contracts/data_structures/test_priority_queue.py
josojo/plasma-mvp
2c1d6d324ea164b2081c628170da4bae59c9018e
[ "Apache-2.0" ]
null
null
null
tests/root_chain/contracts/data_structures/test_priority_queue.py
josojo/plasma-mvp
2c1d6d324ea164b2081c628170da4bae59c9018e
[ "Apache-2.0" ]
null
null
null
import pytest @pytest.fixture def priority_queue(get_contract): return get_contract('DataStructures/PriorityQueue.sol') def test_priority_queue(t, priority_queue): priority_queue.insert(2) priority_queue.insert(5) priority_queue.insert(3) assert priority_queue.getMin() == 2 priority_queue.insert(1) assert priority_queue.getMin() == 1 assert priority_queue.delMin() == 1 assert priority_queue.delMin() == 2 assert priority_queue.getMin() == 3 assert priority_queue.delMin() == 3 assert priority_queue.delMin() == 5
27.047619
59
0.725352
73
568
5.410959
0.30137
0.460759
0.336709
0.253165
0.263291
0
0
0
0
0
0
0.023207
0.165493
568
20
60
28.4
0.810127
0
0
0
0
0
0.056338
0.056338
0
0
0
0
0.4375
1
0.125
false
0
0.0625
0.0625
0.25
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
4
8145bedd1ec3ff631d5ee29aaf9ca8e9f4799725
363
py
Python
pandaharvester/harvestercredmanager/dummy_cred_manager.py
tsulaiav/harvester
ca3f78348019dd616738f2da7d50e81700a8e6b9
[ "Apache-2.0" ]
7
2019-08-30T07:35:48.000Z
2022-02-13T14:46:53.000Z
pandaharvester/harvestercredmanager/dummy_cred_manager.py
tsulaiav/harvester
ca3f78348019dd616738f2da7d50e81700a8e6b9
[ "Apache-2.0" ]
29
2019-09-20T14:04:37.000Z
2021-09-13T12:53:05.000Z
pandaharvester/harvestercredmanager/dummy_cred_manager.py
tsulaiav/harvester
ca3f78348019dd616738f2da7d50e81700a8e6b9
[ "Apache-2.0" ]
15
2019-07-30T11:48:29.000Z
2022-03-29T21:49:05.000Z
from .base_cred_manager import BaseCredManager # dummy credential manager class DummyCredManager(BaseCredManager): # constructor def __init__(self, **kwarg): BaseCredManager.__init__(self, **kwarg) # check proxy def check_credential(self): return True # renew proxy def renew_credential(self): return True, ''
20.166667
47
0.68595
37
363
6.405405
0.540541
0.067511
0.109705
0.202532
0
0
0
0
0
0
0
0
0.23416
363
17
48
21.352941
0.852518
0.165289
0
0
0
0
0
0
0
0
0
0
0
1
0.375
false
0
0.125
0.25
0.875
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4
814bdef758bf60d84e79d3614d67df208f8eda9c
117
py
Python
app/view/popup/popup_interface.py
maciejslawik/muscle-imbalance-detector
d6a608373d7063c3df22a3d7b09ab0fab8b1096c
[ "MIT" ]
null
null
null
app/view/popup/popup_interface.py
maciejslawik/muscle-imbalance-detector
d6a608373d7063c3df22a3d7b09ab0fab8b1096c
[ "MIT" ]
null
null
null
app/view/popup/popup_interface.py
maciejslawik/muscle-imbalance-detector
d6a608373d7063c3df22a3d7b09ab0fab8b1096c
[ "MIT" ]
null
null
null
from abc import abstractmethod class PopupInterface: @abstractmethod def show(self) -> None: pass
13
30
0.675214
12
117
6.583333
0.916667
0
0
0
0
0
0
0
0
0
0
0
0.264957
117
8
31
14.625
0.918605
0
0
0
0
0
0
0
0
0
0
0
0
1
0.2
false
0.2
0.2
0
0.6
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
4
81532b5d84cb4a9f93f5eef0e55077ff6316607e
7,264
py
Python
tests/unit/room/lobby/test_lobby_service.py
hmajid2301/banter-bus-core-api
79a304965b58f0cb131e0770ffc3bd734ec4dc60
[ "Apache-2.0" ]
null
null
null
tests/unit/room/lobby/test_lobby_service.py
hmajid2301/banter-bus-core-api
79a304965b58f0cb131e0770ffc3bd734ec4dc60
[ "Apache-2.0" ]
null
null
null
tests/unit/room/lobby/test_lobby_service.py
hmajid2301/banter-bus-core-api
79a304965b58f0cb131e0770ffc3bd734ec4dc60
[ "Apache-2.0" ]
null
null
null
from typing import List import pytest from pytest_mock import MockFixture from app.player.player_exceptions import PlayerNotFound from app.player.player_models import NewPlayer, Player from app.room.room_exceptions import ( NicknameExistsException, RoomHasNoHostError, RoomNotFound, RoomNotJoinableError, ) from app.room.room_models import Room, RoomState from tests.unit.factories import PlayerFactory, RoomFactory, get_new_player from tests.unit.get_services import get_lobby_service, get_room_service @pytest.fixture(autouse=True) def mock_beanie_document(mocker: MockFixture): mocker.patch("beanie.odm.documents.Document.get_settings") @pytest.mark.asyncio async def test_should_join_empty_room(): existing_room: Room = RoomFactory.build(state=RoomState.CREATED) lobby_service = get_lobby_service(rooms=[existing_room]) new_player = get_new_player() room_players = await lobby_service.join(room_id=existing_room.room_id, new_player=new_player) expected_player = Player(**new_player.dict(), room_id=existing_room.room_id, player_id=room_players.player_id) assert room_players.players == [expected_player] assert room_players.host_player_nickname == expected_player.nickname @pytest.mark.asyncio async def test_should_not_join_finished_room(): existing_room: Room = RoomFactory.build(state=RoomState.FINISHED) lobby_service = get_lobby_service(rooms=[existing_room]) new_player = get_new_player() with pytest.raises(RoomNotJoinableError): await lobby_service.join(room_id=existing_room.room_id, new_player=new_player) @pytest.mark.asyncio async def test_should_join_non_empty_room(): existing_room: Room = RoomFactory.build(state=RoomState.CREATED) existing_players: List[Player] = PlayerFactory.build_batch(3, room_id=existing_room.room_id) lobby_service = get_lobby_service(rooms=[existing_room], players=existing_players) existing_room.host = existing_players[0].player_id new_player = get_new_player() room_players = await lobby_service.join(room_id=existing_room.room_id, new_player=new_player) expected_player = Player(**new_player.dict(), room_id=existing_room.room_id, player_id=room_players.player_id) expected_players = [expected_player, *existing_players] assert _sort_list_by_player_id(room_players.players) == _sort_list_by_player_id(expected_players) assert room_players.host_player_nickname != expected_player.nickname @pytest.mark.asyncio async def test_should_not_join_room_nickname_exists(): existing_room: Room = RoomFactory.build(state=RoomState.CREATED) existing_players: List[Player] = PlayerFactory.build_batch(3, room_id=existing_room.room_id) lobby_service = get_lobby_service(rooms=[existing_room], players=existing_players) existing_room.host = existing_players[0].player_id player: Player = PlayerFactory.build(nickname=existing_players[0].nickname) new_player = NewPlayer(**player.dict()) with pytest.raises(NicknameExistsException): await lobby_service.join(room_id=existing_room.room_id, new_player=new_player) @pytest.mark.asyncio async def test_should_rejoin_room(): existing_room: Room = RoomFactory.build(state=RoomState.CREATED) existing_players: List[Player] = PlayerFactory.build_batch(3, room_id=existing_room.room_id) lobby_service = get_lobby_service(rooms=[existing_room], players=existing_players) first_player_id = existing_players[0].player_id first_player_sid = existing_players[0].latest_sid existing_room.host = first_player_id room_players = await lobby_service.rejoin(player_id=first_player_id, latest_sid=first_player_sid) assert room_players.host_player_nickname == existing_players[0].nickname assert _sort_list_by_player_id(room_players.players) == _sort_list_by_player_id(existing_players) @pytest.mark.asyncio async def test_should_not_rejoin_in_finished_room(): existing_room: Room = RoomFactory.build(state=RoomState.FINISHED) existing_players: List[Player] = PlayerFactory.build_batch(3, room_id=existing_room.room_id) lobby_service = get_lobby_service(rooms=[existing_room], players=existing_players) first_player_id = existing_players[0].player_id first_player_sid = existing_players[0].latest_sid existing_room.host = first_player_id with pytest.raises(RoomNotJoinableError): await lobby_service.rejoin(player_id=first_player_id, latest_sid=first_player_sid) @pytest.mark.asyncio async def test_should_not_rejoin_room_player_not_found(): existing_room: Room = RoomFactory.build(state=RoomState.CREATED) existing_players: List[Player] = PlayerFactory.build_batch(3, room_id=existing_room.room_id) lobby_service = get_lobby_service(rooms=[existing_room], players=existing_players) first_player_sid = existing_players[0].latest_sid existing_room.host = existing_players[0].player_id with pytest.raises(PlayerNotFound): await lobby_service.rejoin(player_id="player-id-unknown", latest_sid=first_player_sid) @pytest.mark.asyncio async def test_should_not_rejoin_room_has_no_host(): existing_room: Room = RoomFactory.build(state=RoomState.CREATED) existing_players: List[Player] = PlayerFactory.build_batch(3, room_id=existing_room.room_id) lobby_service = get_lobby_service(rooms=[existing_room], players=existing_players) first_player_id = existing_players[0].player_id first_player_sid = existing_players[0].latest_sid with pytest.raises(RoomHasNoHostError): await lobby_service.rejoin(player_id=first_player_id, latest_sid=first_player_sid) @pytest.mark.asyncio async def test_should_not_rejoin_room_not_found(): existing_room: Room = RoomFactory.build(state=RoomState.CREATED) lobby_service = get_lobby_service(rooms=[existing_room]) existing_players: List[Player] = PlayerFactory.build_batch(3, room_id="unknown-room-id") lobby_service = get_lobby_service(rooms=[existing_room], players=existing_players) existing_room.host = existing_players[0].player_id first_player_id = existing_players[0].player_id first_player_sid = existing_players[0].latest_sid with pytest.raises(RoomNotFound): await lobby_service.rejoin(player_id=first_player_id, latest_sid=first_player_sid) @pytest.mark.asyncio async def test_should_update_room_host(): room_id = "4d18ac45-8034-4f8e-b636-cf730b17e51a" room_host_player_id = "5a18ac45-9876-4f8e-b636-cf730b17e59l" existing_room: Room = RoomFactory.build(state=RoomState.CREATED, room_id=room_id, host=room_host_player_id) existing_players: List[Player] = PlayerFactory.build_batch(3, room_id=room_id) lobby_service = get_lobby_service(rooms=[existing_room], players=existing_players) existing_players[0].player_id = room_host_player_id player_disconnected = existing_players[1] await lobby_service.update_host(room=existing_room, old_host_id=player_disconnected.player_id) room_service = get_room_service(rooms=[existing_room]) room = await room_service.get(room_id=existing_room.room_id) assert not room.host == player_disconnected.player_id def _sort_list_by_player_id(players: List[Player]): players.sort(key=lambda p: p.player_id, reverse=True)
42.729412
114
0.800523
1,007
7,264
5.389275
0.095333
0.092869
0.070757
0.043118
0.763589
0.742031
0.725447
0.71218
0.690068
0.681961
0
0.010383
0.111646
7,264
169
115
42.982249
0.830621
0
0
0.541667
0
0
0.020099
0.015694
0
0
0
0
0.058333
1
0.016667
false
0
0.075
0
0.091667
0
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
81ad8754886e039ffd26bbeff57e836d8948a5ea
114
py
Python
sphinx/python-intro/source/code/oneoffcoder/control/multicompare.py
oneoffcoder/books
84619477294a3e37e0d7538adf819113c9e8dcb8
[ "CC-BY-4.0" ]
26
2020-05-05T08:07:43.000Z
2022-02-12T03:28:15.000Z
sphinx/python-intro/source/code/oneoffcoder/control/multicompare.py
oneoffcoder/books
84619477294a3e37e0d7538adf819113c9e8dcb8
[ "CC-BY-4.0" ]
19
2021-03-10T00:33:51.000Z
2022-03-02T13:04:32.000Z
sphinx/python-intro/source/code/oneoffcoder/control/multicompare.py
oneoffcoder/books
84619477294a3e37e0d7538adf819113c9e8dcb8
[ "CC-BY-4.0" ]
2
2022-01-09T16:48:21.000Z
2022-02-19T17:06:50.000Z
a = 10 if 0 <= a < 5: print('[0, 5)') elif 5 <= a < 8: print('[5, 8)') else: print('[8, +Infinity)')
12.666667
27
0.412281
20
114
2.35
0.5
0
0
0
0
0
0
0
0
0
0
0.139241
0.307018
114
8
28
14.25
0.455696
0
0
0
0
0
0.22807
0
0
0
0
0
0
1
0
false
0
0
0
0
0.428571
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
4