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
b8949bc9b7149f521dbe7be12fc0a5b13b612894
160
py
Python
demo/4.custom-pricing/oscardemo/dashboard/catalogue/config.py
h3zTr0n/allstores
30644374819fa024be14d5bbace9aed0c3d092fc
[ "MIT" ]
34
2016-03-09T17:53:04.000Z
2021-01-17T05:24:58.000Z
demo/4.custom-pricing/oscardemo/dashboard/catalogue/config.py
h3zTr0n/allstores
30644374819fa024be14d5bbace9aed0c3d092fc
[ "MIT" ]
1
2017-02-06T01:36:22.000Z
2017-02-19T06:33:12.000Z
demo/4.custom-pricing/oscardemo/dashboard/catalogue/config.py
h3zTr0n/allstores
30644374819fa024be14d5bbace9aed0c3d092fc
[ "MIT" ]
16
2016-04-26T06:43:30.000Z
2020-07-07T00:17:54.000Z
from oscar.apps.dashboard.catalogue import config class CatalogueDashboardConfig(config.CatalogueDashboardConfig): name = 'oscardemo.dashboard.catalogue'
26.666667
64
0.83125
15
160
8.866667
0.733333
0.270677
0
0
0
0
0
0
0
0
0
0
0.09375
160
5
65
32
0.917241
0
0
0
0
0
0.18125
0.18125
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
b89f99f1b869825319883e613f0390d6fc5fdddf
177
py
Python
sender/setup.py
kaminski-pawel/send-emails
aff7b930754394ea72100ca9ec93362e198f0eda
[ "MIT" ]
null
null
null
sender/setup.py
kaminski-pawel/send-emails
aff7b930754394ea72100ca9ec93362e198f0eda
[ "MIT" ]
null
null
null
sender/setup.py
kaminski-pawel/send-emails
aff7b930754394ea72100ca9ec93362e198f0eda
[ "MIT" ]
null
null
null
import os from dotenv import load_dotenv from setuptools import setup, find_packages load_dotenv() setup(name='sender', version=os.getenv('VERSION'), packages=find_packages())
25.285714
76
0.80226
25
177
5.52
0.52
0.144928
0
0
0
0
0
0
0
0
0
0
0.090395
177
6
77
29.5
0.857143
0
0
0
0
0
0.073446
0
0
0
0
0
0
1
0
true
0
0.6
0
0.6
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
b8c5001c4d84243bb8d5593bf5f25e3b64a431d3
38
py
Python
examples/hello3.py
mcandre/stank
6992b8a0281cee8b24affa91e83daa7d79ea82f4
[ "BSD-2-Clause-FreeBSD" ]
49
2017-08-10T12:53:33.000Z
2022-03-04T23:52:48.000Z
examples/hello3.py
mcandre/stank
6992b8a0281cee8b24affa91e83daa7d79ea82f4
[ "BSD-2-Clause-FreeBSD" ]
108
2017-08-10T18:55:48.000Z
2021-09-23T01:32:06.000Z
examples/hello3.py
mcandre/stank
6992b8a0281cee8b24affa91e83daa7d79ea82f4
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
#!/usr/bin/env python3 print("Hello")
12.666667
22
0.684211
6
38
4.333333
1
0
0
0
0
0
0
0
0
0
0
0.028571
0.078947
38
2
23
19
0.714286
0.552632
0
0
0
0
0.3125
0
0
0
0
0
0
1
0
true
0
0
0
0
1
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
5
b2259b60b1ecf57dbf639e376f3590a6400efcbf
68
py
Python
Assignment/cool.py
vitorgt/SSC0142
ad721aec1c708c9782e8eacc0958178bc1543df5
[ "MIT" ]
null
null
null
Assignment/cool.py
vitorgt/SSC0142
ad721aec1c708c9782e8eacc0958178bc1543df5
[ "MIT" ]
null
null
null
Assignment/cool.py
vitorgt/SSC0142
ad721aec1c708c9782e8eacc0958178bc1543df5
[ "MIT" ]
null
null
null
#!/usr/bin/python3 import actuator actuator.Actuator("COOL", 1.5)
11.333333
30
0.720588
10
68
4.9
0.8
0.653061
0
0
0
0
0
0
0
0
0
0.04918
0.102941
68
5
31
13.6
0.754098
0.25
0
0
0
0
0.08
0
0
0
0
0
0
1
0
true
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
1
0
1
0
0
0
0
5
b2292344f56b24c54c9727193a6e508aacfb8143
590
py
Python
rest_admin/core/serializers.py
avsd/django-rest-admin
8aaf00b36d3caed70fb81d24f939b7ee88ef9c1c
[ "BSD-3-Clause" ]
2
2016-03-17T20:59:52.000Z
2016-05-15T00:20:02.000Z
rest_admin/core/serializers.py
avsd/django-rest-admin
8aaf00b36d3caed70fb81d24f939b7ee88ef9c1c
[ "BSD-3-Clause" ]
1
2017-04-12T23:40:24.000Z
2017-04-13T03:52:16.000Z
rest_admin/core/serializers.py
avsd/django-rest-admin
8aaf00b36d3caed70fb81d24f939b7ee88ef9c1c
[ "BSD-3-Clause" ]
null
null
null
from rest_framework import serializers class ModelAdminSerializer(serializers.Serializer): """Serializes instance of model with request-specific permissions.""" name = serializers.CharField() object_name = serializers.CharField() # TODO: Deprecated model_name = serializers.CharField() perms = serializers.DictField() class AdminAppSerializer(serializers.Serializer): """Serializes instance of Django app (with list of models inside it).""" name = serializers.CharField() app_label = serializers.CharField() models = ModelAdminSerializer(many=True)
34.705882
76
0.752542
59
590
7.457627
0.559322
0.227273
0.218182
0.177273
0.186364
0
0
0
0
0
0
0
0.154237
590
16
77
36.875
0.881764
0.250847
0
0.2
0
0
0
0
0
0
0
0.0625
0
1
0
false
0
0.1
0
1
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
1
0
0
5
b25aaa15b37df294f000164548e3a40d9d2d11bf
34
py
Python
emencia_paste_djangocms_2/django_buildout/project/utils/models.py
emencia/emencia_paste_djangocms_2
23bc97aef2f235f1be1fc5ba8ffce53064a5b6ca
[ "MIT" ]
1
2015-01-17T21:38:50.000Z
2015-01-17T21:38:50.000Z
emencia_paste_djangocms_3/django_buildout/project/utils/models.py
emencia/emencia_paste_djangocms_3
29eabbcb17e21996a6e1d99592fc719dc8833b59
[ "MIT" ]
5
2015-01-28T15:51:02.000Z
2015-03-16T15:51:15.000Z
emencia_paste_djangocms_2/django_buildout/project/utils/models.py
emencia/emencia_paste_djangocms_2
23bc97aef2f235f1be1fc5ba8ffce53064a5b6ca
[ "MIT" ]
null
null
null
# This app does not have any model
34
34
0.764706
7
34
3.714286
1
0
0
0
0
0
0
0
0
0
0
0
0.205882
34
1
34
34
0.962963
0.941176
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
b2667d5975fe76ab0a8c07cfef4d27a10fc3561d
27
py
Python
mincall/eval/__init__.py
nmiculinic/minion-basecaller
73a134c8ed3715e79319780e24a171dd21713408
[ "MIT" ]
7
2017-07-13T15:08:16.000Z
2021-04-24T16:39:11.000Z
mincall/eval/__init__.py
nmiculinic/minion-basecaller
73a134c8ed3715e79319780e24a171dd21713408
[ "MIT" ]
4
2018-01-09T13:50:57.000Z
2020-07-15T15:33:35.000Z
mincall/eval/__init__.py
nmiculinic/minion-basecaller
73a134c8ed3715e79319780e24a171dd21713408
[ "MIT" ]
1
2018-03-24T22:48:25.000Z
2018-03-24T22:48:25.000Z
from .eval import add_args
13.5
26
0.814815
5
27
4.2
1
0
0
0
0
0
0
0
0
0
0
0
0.148148
27
1
27
27
0.913043
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
b2acd47ac7d46672c6c5916baa828af50d68a1b7
338
py
Python
nighres/laminar/__init__.py
JuliaHuck/nighres
9f3bd14d5ad27cc44f04569c791c8543819a1795
[ "Apache-2.0" ]
null
null
null
nighres/laminar/__init__.py
JuliaHuck/nighres
9f3bd14d5ad27cc44f04569c791c8543819a1795
[ "Apache-2.0" ]
null
null
null
nighres/laminar/__init__.py
JuliaHuck/nighres
9f3bd14d5ad27cc44f04569c791c8543819a1795
[ "Apache-2.0" ]
null
null
null
from nighres.laminar.volumetric_layering import volumetric_layering from nighres.laminar.profile_sampling import profile_sampling from nighres.laminar.profile_averaging import profile_averaging from nighres.laminar.profile_meshing import profile_meshing from nighres.laminar.laminar_iterative_smoothing import laminar_iterative_smoothing
56.333333
83
0.911243
42
338
7.047619
0.285714
0.185811
0.304054
0.253378
0
0
0
0
0
0
0
0
0.059172
338
5
84
67.6
0.930818
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
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
1
0
0
0
0
5
a236f22d77de01d82d1307909dee08ba91db7bf6
295
py
Python
web_frontend/condor_copasi_db/admin.py
Nucleoos/condor-copasi
dcf069cfdb7ce9a5198b5fd495f98fa6433310ca
[ "Artistic-2.0" ]
3
2020-09-11T13:06:52.000Z
2022-02-21T15:03:17.000Z
web_frontend/condor_copasi_db/admin.py
Nucleoos/condor-copasi
dcf069cfdb7ce9a5198b5fd495f98fa6433310ca
[ "Artistic-2.0" ]
null
null
null
web_frontend/condor_copasi_db/admin.py
Nucleoos/condor-copasi
dcf069cfdb7ce9a5198b5fd495f98fa6433310ca
[ "Artistic-2.0" ]
2
2016-10-17T00:22:23.000Z
2021-12-20T13:12:54.000Z
from django.contrib import admin from web_frontend.condor_copasi_db.models import * admin.site.register(Job) admin.site.register(CondorJob) #Hide the 'group' field from the admin site from django.contrib.auth.models import Group from django.contrib import admin admin.site.unregister(Group)
26.818182
50
0.816949
45
295
5.288889
0.466667
0.151261
0.214286
0.193277
0.235294
0
0
0
0
0
0
0
0.105085
295
10
51
29.5
0.901515
0.142373
0
0.285714
0
0
0
0
0
0
0
0
0
1
0
true
0
0.571429
0
0.571429
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
a23cd3310e197629ca82eff7c0278e71c14056d5
32
py
Python
dasladen/__main__.py
pagotti/dasladen
75bb384a2048619bd8fe5dd4588cb438dc02e589
[ "MIT" ]
2
2020-06-01T09:34:45.000Z
2021-03-16T15:42:30.000Z
dasladen/__main__.py
pagotti/dasladen
75bb384a2048619bd8fe5dd4588cb438dc02e589
[ "MIT" ]
2
2021-04-20T16:45:46.000Z
2021-07-02T15:48:46.000Z
dasladen/__main__.py
pagotti/dasladen
75bb384a2048619bd8fe5dd4588cb438dc02e589
[ "MIT" ]
2
2020-04-17T23:28:30.000Z
2020-06-01T09:37:56.000Z
from . import base base.main()
8
18
0.6875
5
32
4.4
0.8
0
0
0
0
0
0
0
0
0
0
0
0.1875
32
3
19
10.666667
0.846154
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
a25a9c973cb1847d1dae92b0a54a00fb70b36da9
34
py
Python
tests/chef_pytestt.py
jcewbank/chef
aa2a2fa55dfda0500544636da4247ee498616d7c
[ "MIT" ]
null
null
null
tests/chef_pytestt.py
jcewbank/chef
aa2a2fa55dfda0500544636da4247ee498616d7c
[ "MIT" ]
null
null
null
tests/chef_pytestt.py
jcewbank/chef
aa2a2fa55dfda0500544636da4247ee498616d7c
[ "MIT" ]
null
null
null
from chef import chef as fut fut.
11.333333
28
0.764706
7
34
3.714286
0.714286
0
0
0
0
0
0
0
0
0
0
0
0.205882
34
3
29
11.333333
0.962963
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0.5
null
null
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
5
a2842165bd7c594cb9d1f0bd9f2c0f3fa39eed53
107
py
Python
src/__init__.py
char-lie/software_design
8784cc5f4dea1e1290f8e3ea0425677d1cbeb273
[ "MIT" ]
null
null
null
src/__init__.py
char-lie/software_design
8784cc5f4dea1e1290f8e3ea0425677d1cbeb273
[ "MIT" ]
4
2016-02-23T14:27:43.000Z
2016-02-24T19:08:46.000Z
src/__init__.py
char-lie/software_design
8784cc5f4dea1e1290f8e3ea0425677d1cbeb273
[ "MIT" ]
null
null
null
from TransactionManager import TransactionManager import utils __all__ = ['TransactionManager', 'utils']
17.833333
49
0.813084
9
107
9.222222
0.555556
0.578313
0
0
0
0
0
0
0
0
0
0
0.11215
107
5
50
21.4
0.873684
0
0
0
0
0
0.216981
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
a28bb23978b3be58fff9b39c0fe3370c3b50ca97
6,606
py
Python
imcsdk/mometa/kmip/KmipServer.py
vadimkuznetsov/imcsdk
ed038ce1dbc8031f99d2dfb3ccee3bf0b48309d8
[ "Apache-2.0" ]
null
null
null
imcsdk/mometa/kmip/KmipServer.py
vadimkuznetsov/imcsdk
ed038ce1dbc8031f99d2dfb3ccee3bf0b48309d8
[ "Apache-2.0" ]
null
null
null
imcsdk/mometa/kmip/KmipServer.py
vadimkuznetsov/imcsdk
ed038ce1dbc8031f99d2dfb3ccee3bf0b48309d8
[ "Apache-2.0" ]
1
2019-11-10T18:42:04.000Z
2019-11-10T18:42:04.000Z
"""This module contains the general information for KmipServer ManagedObject.""" from ...imcmo import ManagedObject from ...imccoremeta import MoPropertyMeta, MoMeta from ...imcmeta import VersionMeta class KmipServerConsts: ADMIN_ACTION_DELETE = "delete" ADMIN_ACTION_TEST_CONNECTION = "test-connection" class KmipServer(ManagedObject): """This is KmipServer class.""" consts = KmipServerConsts() naming_props = set([u'id']) mo_meta = { "classic": MoMeta("KmipServer", "kmipServer", "kmip-server-[id]", VersionMeta.Version302b, "InputOutput", 0x1ff, [], ["admin", "read-only", "user"], [u'kmipManagement'], [], ["Get", "Set"]), "modular": MoMeta("KmipServer", "kmipServer", "kmip-server-[id]", VersionMeta.Version303a, "InputOutput", 0x1ff, [], ["admin", "read-only", "user"], [u'kmipManagement'], [], ["Get", "Set"]) } prop_meta = { "classic": { "admin_action": MoPropertyMeta("admin_action", "adminAction", "string", VersionMeta.Version302b, MoPropertyMeta.READ_WRITE, 0x2, 0, 510, None, ["delete", "test-connection"], []), "child_action": MoPropertyMeta("child_action", "childAction", "string", VersionMeta.Version302b, MoPropertyMeta.INTERNAL, None, None, None, None, [], []), "dn": MoPropertyMeta("dn", "dn", "string", VersionMeta.Version302b, MoPropertyMeta.READ_WRITE, 0x4, 0, 255, None, [], []), "id": MoPropertyMeta("id", "id", "string", VersionMeta.Version302b, MoPropertyMeta.NAMING, 0x8, 0, 510, None, [], ["1-2"]), "ip_address": MoPropertyMeta("ip_address", "ipAddress", "string", VersionMeta.Version302b, MoPropertyMeta.READ_WRITE, 0x10, 0, 255, r"""(([0-9A-Fa-f]{1,4}:([0-9A-Fa-f]{1,4}:([0-9A-Fa-f]{1,4}:([0-9A-Fa-f]{1,4}:([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{0,4}|:[0-9A-Fa-f]{1,4})?|(:[0-9A-Fa-f]{1,4}){0,2})|(:[0-9A-Fa-f]{1,4}){0,3})|(:[0-9A-Fa-f]{1,4}){0,4})|:(:[0-9A-Fa-f]{1,4}){0,5})((:[0-9A-Fa-f]{1,4}){2}|:(25[0-5]|(2[0-4]|1[0-9]|[1-9])?[0-9])(\.(25[0-5]|(2[0-4]|1[0-9]|[1-9])?[0-9])){3})|(([0-9A-Fa-f]{1,4}:){1,6}|:):[0-9A-Fa-f]{0,4}|([0-9A-Fa-f]{1,4}:){7}:) |((([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6})|(([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?)+)|([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]))""", [], []), "port": MoPropertyMeta("port", "port", "uint", VersionMeta.Version302b, MoPropertyMeta.READ_WRITE, 0x20, None, None, None, [], ["1-65535"]), "rn": MoPropertyMeta("rn", "rn", "string", VersionMeta.Version302b, MoPropertyMeta.READ_WRITE, 0x40, 0, 255, None, [], []), "status": MoPropertyMeta("status", "status", "string", VersionMeta.Version302b, MoPropertyMeta.READ_WRITE, 0x80, None, None, None, ["", "created", "deleted", "modified", "removed"], []), "test_connction_status": MoPropertyMeta("test_connction_status", "testConnctionStatus", "string", VersionMeta.Version302b, MoPropertyMeta.READ_ONLY, None, 0, 510, None, [], []), "timeout": MoPropertyMeta("timeout", "timeout", "uint", VersionMeta.Version302b, MoPropertyMeta.READ_WRITE, 0x100, None, None, None, [], ["0-250"]), }, "modular": { "admin_action": MoPropertyMeta("admin_action", "adminAction", "string", VersionMeta.Version303a, MoPropertyMeta.READ_WRITE, 0x2, 0, 510, None, ["delete", "test-connection"], []), "child_action": MoPropertyMeta("child_action", "childAction", "string", VersionMeta.Version303a, MoPropertyMeta.INTERNAL, None, None, None, None, [], []), "dn": MoPropertyMeta("dn", "dn", "string", VersionMeta.Version303a, MoPropertyMeta.READ_WRITE, 0x4, 0, 255, None, [], []), "id": MoPropertyMeta("id", "id", "string", VersionMeta.Version303a, MoPropertyMeta.NAMING, 0x8, 0, 510, None, [], ["1-2"]), "ip_address": MoPropertyMeta("ip_address", "ipAddress", "string", VersionMeta.Version303a, MoPropertyMeta.READ_WRITE, 0x10, 0, 255, r"""([0-9A-Fa-f]{1,4}:([0-9A-Fa-f]{1,4}:([0-9A-Fa-f]{1,4}:([0-9A-Fa-f]{1,4}:([0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{0,4}|:[0-9A-Fa-f]{1,4})?|(:[0-9A-Fa-f]{1,4}){0,2})|(:[0-9A-Fa-f]{1,4}){0,3})|(:[0-9A-Fa-f]{1,4}){0,4})|:(:[0-9A-Fa-f]{1,4}){0,5})((:[0-9A-Fa-f]{1,4}){2}|:(25[0-5]|(2[0-4]|1[0-9]|[1-9])?[0-9])(\.(25[0-5]|(2[0-4]|1[0-9]|[1-9])?[0-9])){3})|(([0-9A-Fa-f]{1,4}:){1,6}|:):[0-9A-Fa-f]{0,4}|([0-9A-Fa-f]{1,4}:){7}:""", [], []), "port": MoPropertyMeta("port", "port", "uint", VersionMeta.Version303a, MoPropertyMeta.READ_WRITE, 0x20, None, None, None, [], ["1-65535"]), "rn": MoPropertyMeta("rn", "rn", "string", VersionMeta.Version303a, MoPropertyMeta.READ_WRITE, 0x40, 0, 255, None, [], []), "status": MoPropertyMeta("status", "status", "string", VersionMeta.Version303a, MoPropertyMeta.READ_WRITE, 0x80, None, None, None, ["", "created", "deleted", "modified", "removed"], []), "test_connction_status": MoPropertyMeta("test_connction_status", "testConnctionStatus", "string", VersionMeta.Version303a, MoPropertyMeta.READ_ONLY, None, 0, 510, None, [], []), "timeout": MoPropertyMeta("timeout", "timeout", "uint", VersionMeta.Version303a, MoPropertyMeta.READ_WRITE, 0x100, None, None, None, [], ["0-250"]), }, } prop_map = { "classic": { "adminAction": "admin_action", "childAction": "child_action", "dn": "dn", "id": "id", "ipAddress": "ip_address", "port": "port", "rn": "rn", "status": "status", "testConnctionStatus": "test_connction_status", "timeout": "timeout", }, "modular": { "adminAction": "admin_action", "childAction": "child_action", "dn": "dn", "id": "id", "ipAddress": "ip_address", "port": "port", "rn": "rn", "status": "status", "testConnctionStatus": "test_connction_status", "timeout": "timeout", }, } def __init__(self, parent_mo_or_dn, id, **kwargs): self._dirty_mask = 0 self.id = id self.admin_action = None self.child_action = None self.ip_address = None self.port = None self.status = None self.test_connction_status = None self.timeout = None ManagedObject.__init__(self, "KmipServer", parent_mo_or_dn, **kwargs)
67.408163
897
0.570845
886
6,606
4.170429
0.123025
0.024357
0.040595
0.048714
0.813261
0.807307
0.742625
0.716103
0.681461
0.657645
0
0.089956
0.177112
6,606
97
898
68.103093
0.589772
0.015138
0
0.315789
0
0.026316
0.368032
0.195257
0
0
0.010779
0
0
1
0.013158
false
0
0.039474
0
0.171053
0
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
a2908f0ca2a66c391f9d55b98ef9a640e3abdd11
4,650
py
Python
tests/unit/dataactvalidator/test_fabs37_detached_award_financial_assistance_2.py
COEJKnight/one
6a5f8cd9468ab368019eb2597821b7837f74d9e2
[ "CC0-1.0" ]
1
2018-10-29T12:54:44.000Z
2018-10-29T12:54:44.000Z
tests/unit/dataactvalidator/test_fabs37_detached_award_financial_assistance_2.py
COEJKnight/one
6a5f8cd9468ab368019eb2597821b7837f74d9e2
[ "CC0-1.0" ]
null
null
null
tests/unit/dataactvalidator/test_fabs37_detached_award_financial_assistance_2.py
COEJKnight/one
6a5f8cd9468ab368019eb2597821b7837f74d9e2
[ "CC0-1.0" ]
null
null
null
from tests.unit.dataactcore.factories.staging import DetachedAwardFinancialAssistanceFactory from dataactcore.models.domainModels import CFDAProgram from tests.unit.dataactvalidator.utils import number_of_errors, query_columns _FILE = 'fabs37_detached_award_financial_assistance_2' def test_column_headers(database): expected_subset = {"row_number", "cfda_number", "action_date", "action_type", "correction_late_delete_ind"} actual = set(query_columns(_FILE, database)) assert expected_subset == actual def test_pubished_date_success(database): """ Test valid. For (ActionType = B, C, or D), the CFDA_Number need NOT be active as of the ActionDate. Not apply to those with CorrectionLateDeleteIndicator = C. Active date: publish_date <= action_date <= archive_date (Fails validation if active). """ cfda = CFDAProgram(program_number=12.340, published_date="20130427", archived_date="") det_award_1 = DetachedAwardFinancialAssistanceFactory(cfda_number="12.340", action_date='20140528', action_type='B', correction_late_delete_ind="B") det_award_2 = DetachedAwardFinancialAssistanceFactory(cfda_number="12.340", action_date='20140428', action_type='C', correction_late_delete_ind="D") det_award_3 = DetachedAwardFinancialAssistanceFactory(cfda_number="12.340", action_date='20140428', action_type='D', correction_late_delete_ind=None) errors = number_of_errors(_FILE, database, models=[det_award_1, det_award_2, det_award_3, cfda]) assert errors == 0 cfda = CFDAProgram(program_number=12.340, published_date="20130427", archived_date="20140427") det_award_1 = DetachedAwardFinancialAssistanceFactory(cfda_number="12.340", action_date='20130528', action_type='B', correction_late_delete_ind="B") det_award_2 = DetachedAwardFinancialAssistanceFactory(cfda_number="12.340", action_date='20130428', action_type='C', correction_late_delete_ind="D") det_award_3 = DetachedAwardFinancialAssistanceFactory(cfda_number="12.340", action_date='20130428', action_type='D', correction_late_delete_ind=None) errors = number_of_errors(_FILE, database, models=[det_award_1, det_award_2, det_award_3, cfda]) assert errors == 0 def test_pubished_date_failure(database): """ Test invalid. For (ActionType = B, C, or D), the CFDA_Number need NOT be active as of the ActionDate. Not apply to those with CorrectionLateDeleteIndicator = C. Active date: publish_date <= action_date <= archive_date (Fails validation if active). If action date is < published_date, should trigger a warning. """ cfda = CFDAProgram(program_number=12.340, published_date="20130427", archived_date="") det_award_1 = DetachedAwardFinancialAssistanceFactory(cfda_number="12.340", action_date='20120528', action_type='B', correction_late_delete_ind="B") det_award_2 = DetachedAwardFinancialAssistanceFactory(cfda_number="12.340", action_date='20120427', action_type='C', correction_late_delete_ind="D") det_award_3 = DetachedAwardFinancialAssistanceFactory(cfda_number="12.340", action_date='20120428', action_type='D', correction_late_delete_ind=None) errors = number_of_errors(_FILE, database, models=[det_award_1, det_award_2, det_award_3, cfda]) assert errors == 3 cfda = CFDAProgram(program_number=12.340, published_date="20130427", archived_date="20140528") det_award_1 = DetachedAwardFinancialAssistanceFactory(cfda_number="12.340", action_date='20120528', action_type='B', correction_late_delete_ind="B") det_award_2 = DetachedAwardFinancialAssistanceFactory(cfda_number="12.340", action_date='20150427', action_type='C', correction_late_delete_ind="D") det_award_3 = DetachedAwardFinancialAssistanceFactory(cfda_number="12.340", action_date='20150428', action_type='D', correction_late_delete_ind=None) errors = number_of_errors(_FILE, database, models=[det_award_1, det_award_2, det_award_3, cfda]) assert errors == 3
69.402985
111
0.664516
513
4,650
5.670565
0.191033
0.066002
0.060502
0.102784
0.791337
0.791337
0.791337
0.791337
0.791337
0.791337
0
0.072608
0.244731
4,650
66
112
70.454545
0.755695
0.119355
0
0.521739
0
0
0.086558
0.017361
0
0
0
0
0.108696
1
0.065217
false
0
0.065217
0
0.130435
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
a29c2b2ee5f89cac5107df2b25ca5dfac920eb38
284
py
Python
python/graphscope/experimental/nx/tests/algorithms/forward/test_cluster.py
wenyuanyu/GraphScope
a40ccaf70557e608d8b091eb25ab04477f99ce21
[ "Apache-2.0" ]
2
2020-12-15T08:42:10.000Z
2022-01-14T09:13:16.000Z
python/graphscope/experimental/nx/tests/algorithms/forward/test_cluster.py
wenyuanyu/GraphScope
a40ccaf70557e608d8b091eb25ab04477f99ce21
[ "Apache-2.0" ]
1
2020-12-22T13:15:40.000Z
2020-12-22T13:15:40.000Z
python/graphscope/experimental/nx/tests/algorithms/forward/test_cluster.py
wenyuanyu/GraphScope
a40ccaf70557e608d8b091eb25ab04477f99ce21
[ "Apache-2.0" ]
1
2021-11-23T03:40:43.000Z
2021-11-23T03:40:43.000Z
import networkx.algorithms.tests.test_cluster import pytest from graphscope.experimental.nx.utils.compat import import_as_graphscope_nx import_as_graphscope_nx(networkx.algorithms.tests.test_cluster, decorators=pytest.mark.usefixtures("graphscope_session"))
35.5
81
0.802817
34
284
6.441176
0.529412
0.164384
0.210046
0.246575
0.310502
0
0
0
0
0
0
0
0.126761
284
7
82
40.571429
0.883065
0
0
0
0
0
0.06338
0
0
0
0
0
0
1
0
true
0
0.8
0
0.8
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
1
0
0
0
0
5
a2d31d7a292453267c89f4871b76f2ff15a99dda
308
py
Python
teste.py
felipegarciamf/ES-17-2
60bb5b2215a31a15e3cf4c02beaf65eb673c62ec
[ "Apache-2.0" ]
null
null
null
teste.py
felipegarciamf/ES-17-2
60bb5b2215a31a15e3cf4c02beaf65eb673c62ec
[ "Apache-2.0" ]
6
2019-08-01T02:43:04.000Z
2019-08-01T03:03:32.000Z
teste.py
felipegarciamf/ES-17-2
60bb5b2215a31a15e3cf4c02beaf65eb673c62ec
[ "Apache-2.0" ]
null
null
null
import pytest from principal import somar from principal import sub def test_somar(): """ docstring for test somar""" assert somar(2, 3)==5 def test_sub(): """ docstring for test subtrair """ assert sub(2,2)==0 def test_mult(): """ docstring for test mult """ assert mult(2,3)==6
18.117647
39
0.642857
46
308
4.23913
0.391304
0.107692
0.246154
0
0
0
0
0
0
0
0
0.0375
0.220779
308
16
40
19.25
0.775
0.25
0
0
0
0
0
0
0
0
0
0
0.333333
1
0.333333
true
0
0.333333
0
0.666667
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
1
0
1
0
0
5
a2e53f68110fead4e033d2c7f1b3081579a56e02
200
py
Python
venv/Lib/site-packages/tools37/actions/Action.py
GabrielAmare/Darts
182748d821b8c1838071f3b28724d0d9b095dcf9
[ "MIT" ]
null
null
null
venv/Lib/site-packages/tools37/actions/Action.py
GabrielAmare/Darts
182748d821b8c1838071f3b28724d0d9b095dcf9
[ "MIT" ]
null
null
null
venv/Lib/site-packages/tools37/actions/Action.py
GabrielAmare/Darts
182748d821b8c1838071f3b28724d0d9b095dcf9
[ "MIT" ]
null
null
null
class Action: def do(self) -> None: raise NotImplementedError def undo(self) -> None: raise NotImplementedError def redo(self) -> None: raise NotImplementedError
20
33
0.63
20
200
6.3
0.5
0.190476
0.309524
0.761905
0.555556
0
0
0
0
0
0
0
0.29
200
9
34
22.222222
0.887324
0
0
0.428571
0
0
0
0
0
0
0
0
0
1
0.428571
false
0
0
0
0.571429
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
5
0c14b1456a2f702d0f316ecc68963d39441e99ea
85
py
Python
codegen/generator/browser/__init__.py
fangyi-zhou/TypeScript-Multiparty-Sessions
216ae5806fc9d901086e8e773ef241fc9848c544
[ "MIT" ]
4
2020-09-09T12:40:17.000Z
2021-12-05T21:43:49.000Z
codegen/generator/browser/__init__.py
fangyi-zhou/TypeScript-Multiparty-Sessions
216ae5806fc9d901086e8e773ef241fc9848c544
[ "MIT" ]
19
2020-03-31T08:11:47.000Z
2022-02-27T11:13:47.000Z
codegen/generator/browser/__init__.py
fangyi-zhou/TypeScript-Multiparty-Sessions
216ae5806fc9d901086e8e773ef241fc9848c544
[ "MIT" ]
2
2020-04-15T14:45:12.000Z
2021-01-13T13:54:15.000Z
from codegen.generator.browser.browser_codegen_strategy import BrowserCodegenStrategy
85
85
0.929412
9
85
8.555556
0.777778
0
0
0
0
0
0
0
0
0
0
0
0.035294
85
1
85
85
0.939024
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
0c177fa0e38b1c22c9362dabe50ec7d3d5c22ddc
42
py
Python
twitterwall/__main__.py
johnTheSloth/TwitterWall
a0938b466f72caaf8e742bea7713f87fc59d1743
[ "CC0-1.0" ]
null
null
null
twitterwall/__main__.py
johnTheSloth/TwitterWall
a0938b466f72caaf8e742bea7713f87fc59d1743
[ "CC0-1.0" ]
null
null
null
twitterwall/__main__.py
johnTheSloth/TwitterWall
a0938b466f72caaf8e742bea7713f87fc59d1743
[ "CC0-1.0" ]
null
null
null
from .twitterwallCore import main main()
10.5
33
0.785714
5
42
6.6
0.8
0
0
0
0
0
0
0
0
0
0
0
0.142857
42
3
34
14
0.916667
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
0c317a1cfb41845131e321038e75787a936dae6e
119
py
Python
zeroservices/services/__init__.py
Lothiraldan/ZeroServices
c6b0bdf755be6bcc0ff6070aabcfb36f0e4c2f37
[ "MIT" ]
21
2015-01-31T17:45:42.000Z
2017-11-12T05:02:44.000Z
zeroservices/services/__init__.py
Lothiraldan/ZeroServices
c6b0bdf755be6bcc0ff6070aabcfb36f0e4c2f37
[ "MIT" ]
7
2015-01-07T09:52:06.000Z
2015-02-01T00:59:35.000Z
zeroservices/services/__init__.py
Lothiraldan/ZeroServices
c6b0bdf755be6bcc0ff6070aabcfb36f0e4c2f37
[ "MIT" ]
2
2017-06-29T19:40:42.000Z
2019-06-01T12:18:56.000Z
from .http_interface import get_http_interface, BasicAuth from .http_client import BaseHTTPClient, BasicAuthHTTPClient
39.666667
60
0.882353
14
119
7.214286
0.642857
0.158416
0
0
0
0
0
0
0
0
0
0
0.084034
119
2
61
59.5
0.926606
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
0c36315dcbf42c426b6de225e29b6ed73f2364a6
4,848
py
Python
backend/app/utils/config.py
aidoraide/react-flask-postgres-boilerplate-with-docker
901cdbbd8d86df38a24adf48a5570dca655935ca
[ "Apache-2.0" ]
null
null
null
backend/app/utils/config.py
aidoraide/react-flask-postgres-boilerplate-with-docker
901cdbbd8d86df38a24adf48a5570dca655935ca
[ "Apache-2.0" ]
null
null
null
backend/app/utils/config.py
aidoraide/react-flask-postgres-boilerplate-with-docker
901cdbbd8d86df38a24adf48a5570dca655935ca
[ "Apache-2.0" ]
null
null
null
import os class DevConfig(object): DEBUG = True TESTING = True SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://dev:mypassword@db/application' SQLALCHEMY_TRACK_MODIFICATIONS = False JWT_PRIVATE_KEY = """ -----BEGIN RSA PRIVATE KEY----- MIIJJwIBAAKCAgEA0l5r3gFotNNKg7N7tikj8umiMnznIEE/QbreCIvU2o4jHlck jLRqfiBEf+I/795Ve2Uewcd7qq14FtZZ6PdbW+3kGZUn5Ox8LChS/RWdeLSkVQCN NJEO+oMTFqhKujJV7DWmPknDkFzBmYuCtYFm1yaSimH1G4kF+Z0i7RATngwGRCxC RstSd2jAACVlpkztCUTVo8uWSHC0odPBIPC32pgRu7zSR0UWKXW4Rqbbh427j6X8 3sjQept5tI6tdWgQdThVaGTdpelTpyc9EfeoIM+E8bH6kjKwmjzZcOF6iZ81CiZo JRhFINlP4Lpaxtd/8jSfbdJLdIL38qRDCEBNK3Htwt+i6rm1WD+WkLjMDH4l88M2 lhx0aOLMPYeVF8euD/1KoHFcPbUtUOQq87inAw20GWO2GQp0Kz6jDmbYQHW0V2xc 6kvvzI5TMW7kgQhNwb71/HEEgdv+JqFz2XDwFbkbBrCn5Ko5VrmIksZtEBE7Zgmb MUMdfrLwzxcHdm/Tuw/Y7ljmCf6qLZtskH/vEHd1PdSj2WIECrXTAjNO0qO+vSXK yWsY9TurEENQDA9F7yLf5Mm+jhnTiOcgBXBYjh41UXJZ2vO39Dp/D1lwmyjfSg/L /VqD/T5fwVaay9mvm3Mxjr90DNdRvu28oDpPJ6Rh1yVHtKocQBpQxS9HVGMCAwEA AQKCAgAqJXSi89FQeQxyumDMrA1hu2EdkFyV37yWpKObPriUWOm8SGUwM20qe7h9 joyUuAyUPjwdQqQKG9r1aFh3DielkVGjtnhZqu9twV5vCgeUiUxrI0MnBvDjS6Nl ZK4kA7WnL1BxJkIiCBNZedPkHVrHPBkb1GhQ7fDeg5bdu9zSS0JuIhfdKxsIhVoC LXviB4Nt2fabbExdkwb9bPlCajfLebAD1t6iHLtF7ynOLdvJmqG7M9wnnj/2cHO/ st4ZqZGyimjCE4M8nDSARqI7mUx71leiPLAg3jr3i71cmi/8poLv16YB2Izw+djB A1TwhXhCxDw0um8Xlq2qVTKA0rEi5+XSjGwfH+GSXsKKnI1W7+imWfEUSkFOvSeq nE39rDDWhkBPc/YeOHv4UCjxKNIZhdbIAOPNeWE3E/VbSxB7HT+f0bgObnEkXRJv dPBIo1P8cmnlHASdV6MjrWQmBakPkaPzB3MsVy/9DSwUUCPMpqsH2FoFvHCS5Xam He+tqDNdlF6qRg9y5g1E31gQ8xIPo3988Z2ETVk7IJg9NeG4vseRO8ko3V9xQCrd qHaVGfesU3AofuVcC3OeYiZbk9a+asR99oTwEeFRg5zbnMvGDrzS/+ypFxKGu4uf rTNtSSntkiH5cCXhOmltG36Z5L3IUHekt3JWv+3fOSxZ1rjGwQKCAQEA+RitHq8w uO946o5b+TAthdYohwZ+Kk2y4nrPbuwg1pJoa4gBphvMVr20k7m9Hu0zWXm275wc +a491rQpXOp/Uzod5hXNQ/6O0UdWapXdU24tbO7hhOCgECahPnUmLdkrwPQqXMQQ 7iBIF/SC3YBrHb80d+EOfnOhWdh+8lCws+0H9utWrEXsPjRa/j+Mbl+kPoaQceB2 S/o662xsLB/GDaafzaKxGh4rAXDeGidiD6tAbanNNro0C+qSvjUIaJ8+OgtV9CrA X7gASz6H8N3bcTj9b+PpeOo6Jw6yXbcsDLlLKgdxpYjmQ7FLEp4bWzeJ2x+KaCPG j7asxlehaoJ4cQKCAQEA2DL5tjcoPatF67CO6/xajwi9k1Akg+HTtMcK5Pr4iX0+ iRZPAWx22vsyKw+VeqlZUUDwUpHi2hbVFuTPRYRZLh9Yp7LaTSqMMQo1G1GwdyHz 43igwPp7birTt3X1FrtApAy4nst1ojLx6JDL8BjjS2KkYbAwwh9yTpNFfIiwSg5I kbCXnwWPyC2MLXoQSm8LGGOJI2NOSPl2sPMWb2X6/WyJryVkRH7QUXdD1qQ1KOJt SskQdOp63z1tXv00SCMFibe2ucATE0BYSehMkoElSdzHrV3IZI1dlijKyyB8Q9VP T0uoT1DIcBcBd3RbtLYb7dY48oDjua2JhR1ikXCkEwKCAQASaUyCdBh50tlxHMyX goQa3FVqhYRVxCBwtPsYC8PxmCi3qfnVOUDFOIhcUuIzovykpGZtF3Dc05AminJ0 N7DpieYj14CwgeQ0e71ba3BMdlxNLOrmU2QBTZmlcCs+QEsHnAR1jthhgWlSu/Pg Q1mnfTZ3ld7oYcuPRH09k9E7u01XZtWlLhXkEyKWoEPU9KTDKlcK07hqrTglpoHo UQDmiWZOYLQOZiRvmtQPwtFwrwu4D1DntqOaLeBixrC0avDCgYv83BwT9xmudhS+ LOfHWpsA5iufkFB0CpYMbzmGRzvTA3HW9mNupXATFDSZbWV3GMG2KM7IWIw0rM11 fedBAoIBAHoEEvBmorxjPDvvUkoXCxjsiuln8qPHwM6nAxwGFFysJa4CvCYGi/G8 kSzCR8+JYhI8fyVqlkgVWL/p9Jy8PASOxl8mzpN8btCCfURkzx39OILpongnJaAg ZYqF9QOWPL4ZO9zK4SHgdKyXg7GGqkjya+mCIZJ9Yuq7rRzCnBO/ie9HZdrmraYB JrrHyAfqMa3bBxvEwProZ7coCkJmoMeECRSjGrqZg4JmuA+cbzAa0inB3hrN9vik 12QjrO0Fbuuxlluw7lMQHoPfqc+JOX09MChE5ILzUZ0ceo83T0qNSYxsG5pf8i9o nHhJYDRWDt8k5tDeMyeorBNHaUjB9KcCggEAY0ZxFS1Lt+cvT+4+/kDx3y3fCWxO QgDRvgeQw40nqZwkyFWcKxw2hOfRpXRGa4tZ0nCQ9OIlqlo/T7NxZiQO1eBex3Z5 Z4nWloqeNw7/yX6cSYEghkPyUvtt6etP+C1L2E5wtw8bmbRVdj/ZnLDh+NgwyBDr 6LVCKBXI4CW4UKK+Uik4rePNtRETDa4ZV3/WDd7s5+9/1eiMWNQuhl5bpF9zE4os 1vn0nlwZI6CxLZO9rlNN4WYgC9GGbWKK5XdgA2WJC+yzFcMBRcZAITxK/HEYhN8y 13XfF/VfSZWzujVxeFgeRU5bmxmHRDaKM/2ahsxdlSD9dciIXt5d7DQMfw== -----END RSA PRIVATE KEY----- """.lstrip() JWT_PUBLIC_KEY = """ -----BEGIN PUBLIC KEY----- MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0l5r3gFotNNKg7N7tikj 8umiMnznIEE/QbreCIvU2o4jHlckjLRqfiBEf+I/795Ve2Uewcd7qq14FtZZ6Pdb W+3kGZUn5Ox8LChS/RWdeLSkVQCNNJEO+oMTFqhKujJV7DWmPknDkFzBmYuCtYFm 1yaSimH1G4kF+Z0i7RATngwGRCxCRstSd2jAACVlpkztCUTVo8uWSHC0odPBIPC3 2pgRu7zSR0UWKXW4Rqbbh427j6X83sjQept5tI6tdWgQdThVaGTdpelTpyc9Efeo IM+E8bH6kjKwmjzZcOF6iZ81CiZoJRhFINlP4Lpaxtd/8jSfbdJLdIL38qRDCEBN K3Htwt+i6rm1WD+WkLjMDH4l88M2lhx0aOLMPYeVF8euD/1KoHFcPbUtUOQq87in Aw20GWO2GQp0Kz6jDmbYQHW0V2xc6kvvzI5TMW7kgQhNwb71/HEEgdv+JqFz2XDw FbkbBrCn5Ko5VrmIksZtEBE7ZgmbMUMdfrLwzxcHdm/Tuw/Y7ljmCf6qLZtskH/v EHd1PdSj2WIECrXTAjNO0qO+vSXKyWsY9TurEENQDA9F7yLf5Mm+jhnTiOcgBXBY jh41UXJZ2vO39Dp/D1lwmyjfSg/L/VqD/T5fwVaay9mvm3Mxjr90DNdRvu28oDpP J6Rh1yVHtKocQBpQxS9HVGMCAwEAAQ== -----END PUBLIC KEY----- """.lstrip() # Flask mail setup MAIL_SERVER = 'smtp.gmail.com' MAIL_PORT = 465 MAIL_USE_TLS = False MAIL_USE_SSL = True MAIL_DEBUG = True MAIL_USERNAME = 'testflaskmail12345@gmail.com' MAIL_PASSWORD = 'TestFlaskMail12345!' MAIL_DEFAULT_SENDER = None MAIL_MAX_EMAILS = None MAIL_SUPPRESS_SEND = False MAIL_ASCII_ATTACHMENTS = False if os.environ.get('FLASK_ENV') == 'production': # TODO make a prod config raise Exception('No config for production yet') else: Config = DevConfig
49.469388
83
0.901196
279
4,848
15.566308
0.810036
0.006908
0.005987
0
0
0
0
0
0
0
0
0.126005
0.050536
4,848
97
84
49.979381
0.81751
0.008251
0
0.022222
0
0
0.874922
0.821436
0
1
0
0.010309
0
1
0
false
0.022222
0.011111
0
0.211111
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
null
1
0
1
0
0
0
0
0
0
0
0
0
0
5
0c39bd3daeb080afd15c14a3152b0cf27ccf5122
25
py
Python
tests/resources/py/02_exp.py
jasonsatran/duckrun
bfdfa95f68e51e16991ef01bdd8fb606cdb076db
[ "MIT" ]
null
null
null
tests/resources/py/02_exp.py
jasonsatran/duckrun
bfdfa95f68e51e16991ef01bdd8fb606cdb076db
[ "MIT" ]
null
null
null
tests/resources/py/02_exp.py
jasonsatran/duckrun
bfdfa95f68e51e16991ef01bdd8fb606cdb076db
[ "MIT" ]
null
null
null
import math math.exp(99)
8.333333
12
0.76
5
25
3.8
0.8
0
0
0
0
0
0
0
0
0
0
0.090909
0.12
25
2
13
12.5
0.772727
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
0c65ba65718cef4e865589dd4ea14881b4729045
170
py
Python
tests/neuralnet/test_air_passengers_CPU_theano.py
jmabry/pyaf
afbc15a851a2445a7824bf255af612dc429265af
[ "BSD-3-Clause" ]
null
null
null
tests/neuralnet/test_air_passengers_CPU_theano.py
jmabry/pyaf
afbc15a851a2445a7824bf255af612dc429265af
[ "BSD-3-Clause" ]
1
2019-11-30T23:39:38.000Z
2019-12-01T04:34:35.000Z
tests/neuralnet/test_air_passengers_CPU_theano.py
jmabry/pyaf
afbc15a851a2445a7824bf255af612dc429265af
[ "BSD-3-Clause" ]
null
null
null
import os os.environ["THEANO_FLAGS"] = "device=cpu" os.environ["KERAS_BACKEND"] = "theano" import pyaf.tests.neuralnet.test_air_passengers_GPU as air air.buildModel();
21.25
58
0.770588
25
170
5.04
0.72
0.142857
0
0
0
0
0
0
0
0
0
0
0.088235
170
7
59
24.285714
0.812903
0
0
0
0
0
0.241176
0
0
0
0
0
0
1
0
true
0.2
0.4
0
0.4
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
1
0
0
0
0
5
a73ed47bac77e5e7284cef6604389ed66312704c
281
py
Python
app/apps/auth/forms.py
235/Bookmarkly_Django
e7fc33613bdd22484cfeac1274805f69f5a0fb78
[ "Unlicense" ]
1
2016-06-27T19:30:48.000Z
2016-06-27T19:30:48.000Z
app/apps/auth/forms.py
235/Bookmarkly_Django
e7fc33613bdd22484cfeac1274805f69f5a0fb78
[ "Unlicense" ]
null
null
null
app/apps/auth/forms.py
235/Bookmarkly_Django
e7fc33613bdd22484cfeac1274805f69f5a0fb78
[ "Unlicense" ]
null
null
null
from django import forms class RegisterForm(forms.Form): username = forms.CharField(max_length=100) password = forms.CharField() email = forms.EmailField() class LoginForm(forms.Form): username = forms.CharField(max_length=100) password = forms.CharField()
21.615385
46
0.725979
33
281
6.121212
0.484848
0.277228
0.168317
0.217822
0.643564
0.643564
0.643564
0.643564
0.643564
0.643564
0
0.025641
0.16726
281
12
47
23.416667
0.837607
0
0
0.5
0
0
0
0
0
0
0
0
0
1
0
false
0.25
0.125
0
1
0
0
0
0
null
1
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
5
a7464da7112f376045c2ed6fcaf4d62110e29ef6
21
py
Python
main.py
radajin/first_project
671d1021fa51f35f568fed5507da859fb2b11d67
[ "MIT" ]
null
null
null
main.py
radajin/first_project
671d1021fa51f35f568fed5507da859fb2b11d67
[ "MIT" ]
null
null
null
main.py
radajin/first_project
671d1021fa51f35f568fed5507da859fb2b11d67
[ "MIT" ]
null
null
null
print('hello git 5')
10.5
20
0.666667
4
21
3.5
1
0
0
0
0
0
0
0
0
0
0
0.055556
0.142857
21
1
21
21
0.722222
0
0
0
0
0
0.52381
0
0
0
0
0
0
1
0
true
0
0
0
0
1
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
5
a762f504c93303e32e61be54afe08e63f58fa9d7
86
py
Python
neoOkpara/Phase-1/Day11/currentCallStack.py
CodedLadiesInnovateTech/-python-challenge-solutions
430cd3eb84a2905a286819eef384ee484d8eb9e7
[ "MIT" ]
6
2020-05-23T19:53:25.000Z
2021-05-08T20:21:30.000Z
neoOkpara/Phase-1/Day11/currentCallStack.py
CodedLadiesInnovateTech/-python-challenge-solutions
430cd3eb84a2905a286819eef384ee484d8eb9e7
[ "MIT" ]
8
2020-05-14T18:53:12.000Z
2020-07-03T00:06:20.000Z
neoOkpara/Phase-1/Day11/currentCallStack.py
CodedLadiesInnovateTech/-python-challenge-solutions
430cd3eb84a2905a286819eef384ee484d8eb9e7
[ "MIT" ]
39
2020-05-10T20:55:02.000Z
2020-09-12T17:40:59.000Z
import traceback def f1(): return abc() def abc(): traceback.print_stack() f1()
7.818182
34
0.662791
12
86
4.666667
0.666667
0
0
0
0
0
0
0
0
0
0
0.028571
0.186047
86
10
35
8.6
0.771429
0
0
0
0
0
0
0
0
0
0
0
0
1
0.5
true
0
0.25
0.25
0.75
0.25
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
0
1
1
0
0
5
a7da70e293945673687df4acdb8d5f28e693a9da
266
py
Python
model/__init__.py
fingerecho/proms-4.0
6c3a1fd62c9394761664e100fc1dde50fd79dc11
[ "CC-BY-4.0" ]
2
2019-11-23T03:56:28.000Z
2019-12-03T15:48:34.000Z
model/__init__.py
fingerecho/proms-4.0
6c3a1fd62c9394761664e100fc1dde50fd79dc11
[ "CC-BY-4.0" ]
null
null
null
model/__init__.py
fingerecho/proms-4.0
6c3a1fd62c9394761664e100fc1dde50fd79dc11
[ "CC-BY-4.0" ]
3
2019-04-12T18:09:35.000Z
2020-03-14T14:38:45.000Z
#from .register import Registry from .register import RegisterRenderer from .report import ReportRenderer from .entity import EntityRenderer from .agent import AgentRenderer from .activity import ActivityRenderer from .reportingsystem import ReportingSystemRenderer
33.25
52
0.864662
28
266
8.214286
0.535714
0.104348
0.156522
0
0
0
0
0
0
0
0
0
0.105263
266
7
53
38
0.966387
0.112782
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
ac140932bf895f0047bc8325b7a0a73b9f0806a0
890
py
Python
tests/domain/test_call.py
aldo774/telephone_bill
d59360b894e2ea5381c413b55852cb47b1e9a392
[ "MIT" ]
null
null
null
tests/domain/test_call.py
aldo774/telephone_bill
d59360b894e2ea5381c413b55852cb47b1e9a392
[ "MIT" ]
null
null
null
tests/domain/test_call.py
aldo774/telephone_bill
d59360b894e2ea5381c413b55852cb47b1e9a392
[ "MIT" ]
null
null
null
from telephone_bill.domain.call import Call def test_call_model_init(): call = Call( destination='8899999999', start_date='2018-01-01', start_time='01:00:00', duration='0h1m0s', price=0.36) assert call.destination == '8899999999' assert call.start_date == '2018-01-01' assert call.start_time == '01:00:00' assert call.duration == '0h1m0s' assert call.price == 0.36 def test_call_model_from_dict(): call = Call.from_dict({ 'destination': '8899999999', 'start_date': '2018-01-01', 'start_time': '01:00:00', 'duration': '0h1m0s', 'price': 0.36, }) assert call.destination == '8899999999' assert call.start_date == '2018-01-01' assert call.start_time == '01:00:00' assert call.duration == '0h1m0s' assert call.price == 0.36
26.969697
44
0.586517
112
890
4.508929
0.223214
0.19802
0.10297
0.118812
0.792079
0.792079
0.792079
0.792079
0.792079
0.792079
0
0.184615
0.269663
890
32
45
27.8125
0.592308
0
0
0.384615
0
0
0.20979
0
0
0
0
0
0.384615
1
0.076923
false
0
0.038462
0
0.115385
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
ac71475f80f071c898fe51176a24e6596250f02e
10,952
py
Python
tests/test_api.py
ephes/django-cast
34b6aab98f7e9a750116ec2949e9cda4f2dcb127
[ "BSD-3-Clause" ]
11
2018-12-23T15:58:35.000Z
2021-10-04T12:14:46.000Z
tests/test_api.py
ephes/django-cast
34b6aab98f7e9a750116ec2949e9cda4f2dcb127
[ "BSD-3-Clause" ]
9
2018-11-18T12:12:29.000Z
2022-02-27T09:51:36.000Z
tests/test_api.py
ephes/django-cast
34b6aab98f7e9a750116ec2949e9cda4f2dcb127
[ "BSD-3-Clause" ]
12
2018-11-17T15:13:09.000Z
2020-05-02T00:10:07.000Z
import pytest from datetime import timedelta from django.urls import reverse from .factories import UserFactory from cast.models import Request from cast.access_log import pandas_rows_to_dict from cast.access_log import get_last_request_position from cast.access_log import get_dataframe_from_position class TestBlogImage: @classmethod def setup_class(cls): cls.list_url = reverse("cast:api:image_list") cls.detail_url = reverse("cast:api:image_detail", kwargs={"pk": 1}) @pytest.mark.django_db def test_image_list_endpoint_without_authentication(self, api_client): """Check for not authenticated status code if trying to access the list endpoint without being authenticated. """ r = api_client.get(self.list_url, format="json") assert r.status_code == 403 @pytest.mark.django_db def test_image_detail_endpoint_without_authentication(self, api_client): """Check for not authenticated status code if trying to access the detail endpoint without being authenticated. """ r = api_client.get(self.detail_url, format="json") assert r.status_code == 403 @pytest.mark.django_db def test_image_list_endpoint_with_authentication(self, api_client): """Check for list result when accessing the list endpoint being logged in. """ user = UserFactory() api_client.login(username=user.username, password="password") r = api_client.get(self.list_url, format="json") # dont redirect to login page assert r.status_code == 200 assert "results" in r.json() class TestBlogGallery: @classmethod def setup_class(cls): cls.list_url = reverse("cast:api:gallery_list") cls.detail_url = reverse("cast:api:gallery_detail", kwargs={"pk": 1}) @pytest.mark.django_db def test_gallery_list_endpoint_without_authentication(self, api_client): """Check for not authenticated status code if trying to access the list endpoint without being authenticated. """ r = api_client.get(self.list_url, format="json") assert r.status_code == 403 @pytest.mark.django_db def test_gallery_detail_endpoint_without_authentication(self, api_client): """Check for not authenticated status code if trying to access the detail endpoint without being authenticated. """ r = api_client.get(self.detail_url, format="json") assert r.status_code == 403 @pytest.mark.django_db def test_gallery_list_endpoint_with_authentication(self, api_client): """Check for list result when accessing the list endpoint being logged in. """ user = UserFactory() api_client.login(username=user.username, password="password") r = api_client.get(self.list_url, format="json") # dont redirect to login page assert r.status_code == 200 assert "results" in r.json() class TestBlogVideo: @classmethod def setup_class(cls): cls.list_url = reverse("cast:api:video_list") cls.detail_url = reverse("cast:api:video_detail", kwargs={"pk": 1}) @pytest.mark.django_db def test_video_list_endpoint_without_authentication(self, api_client): """Check for not authenticated status code if trying to access the list endpoint without being authenticated. """ r = api_client.get(self.list_url, format="json") assert r.status_code == 403 @pytest.mark.django_db def test_video_detail_endpoint_without_authentication(self, api_client): """Check for not authenticated status code if trying to access the detail endpoint without being authenticated. """ r = api_client.get(self.detail_url, format="json") assert r.status_code == 403 @pytest.mark.django_db def test_video_list_endpoint_with_authentication(self, api_client): """Check for list result when accessing the list endpoint being logged in. """ user = UserFactory() api_client.login(username=user.username, password="password") r = api_client.get(self.list_url, format="json") # dont redirect to login page assert r.status_code == 200 assert "results" in r.json() class TestBlogAudio: @classmethod def setup_class(cls): cls.list_url = reverse("cast:api:audio_list") cls.detail_url = reverse("cast:api:audio_detail", kwargs={"pk": 1}) @pytest.mark.django_db def test_audio_list_endpoint_without_authentication(self, api_client): """Check for not authenticated status code if trying to access the list endpoint without being authenticated. """ r = api_client.get(self.list_url, format="json") assert r.status_code == 403 @pytest.mark.django_db def test_audio_detail_endpoint_without_authentication(self, api_client): """Check for not authenticated status code if trying to access the detail endpoint without being authenticated. """ r = api_client.get(self.detail_url, format="json") assert r.status_code == 403 @pytest.mark.django_db def test_audio_list_endpoint_with_authentication(self, api_client): """Check for list result when accessing the list endpoint being logged in. """ user = UserFactory() api_client.login(username=user.username, password="password") r = api_client.get(self.list_url, format="json") # dont redirect to login page assert r.status_code == 200 assert "results" in r.json() class TestPodcastAudio: @pytest.mark.django_db def test_podlove_detail_endpoint_without_authentication(self, api_client, audio): """Should be accessible without authentication.""" podlove_detail_url = reverse( "cast:api:audio_podlove_detail", kwargs={"pk": audio.pk} ) r = api_client.get(podlove_detail_url, format="json") assert r.status_code == 200 @pytest.mark.django_db def test_podlove_detail_endpoint_duration(self, api_client, audio): """Test whether microseconds get stripped away from duration via api - they have to be for podlove player to work. """ delta = timedelta(days=0, hours=1, minutes=10, seconds=20, microseconds=40) audio.duration = delta audio.save() assert "." in str(audio.duration) podlove_detail_url = reverse( "cast:api:audio_podlove_detail", kwargs={"pk": audio.pk} ) r = api_client.get(podlove_detail_url, format="json") assert "." not in r.json()["duration"] @pytest.mark.django_db def test_podlove_detail_endpoint_chaptermarks( self, api_client, audio, chaptermarks ): """Test whether chaptermarks get delivered via podlove endpoint.""" print("chaptermarks: ", chaptermarks) podlove_detail_url = reverse( "cast:api:audio_podlove_detail", kwargs={"pk": audio.pk} ) r = api_client.get(podlove_detail_url, format="json") chapters = r.json()["chapters"] for chapter in chapters: # assert microseconds are stripped away assert "." not in chapter["start"] assert ":" in chapter["start"] assert len(chapters) == 3 # assert reordering assert chapters[-1]["title"] == "coughing" class TestRequest: @classmethod def setup_class(cls): cls.list_url = reverse("cast:api:request_list") @pytest.mark.django_db def test_request_list_endpoint_without_authentication(self, api_client): """Should not be accessible without authentication.""" r = api_client.get(self.list_url, format="json") assert r.status_code == 403 @pytest.mark.django_db def test_request_list_endpoint_with_authentication(self, api_client): """Check for list result when accessing the list endpoint being logged in. """ user = UserFactory() api_client.login(username=user.username, password="password") r = api_client.get(self.list_url, format="json") # dont redirect to login page assert r.status_code == 200 assert "results" in r.json() @pytest.mark.django_db def test_request_list_endpoint_non_bulk_insert(self, api_client, access_log_path): user = UserFactory() api_client.login(username=user.username, password="password") df = get_dataframe_from_position(access_log_path, start_position=0) raw_rows = df.fillna("").to_dict(orient="rows") rows = pandas_rows_to_dict(raw_rows) row = rows[0] r = api_client.post(self.list_url, data=row, format="json") assert r.status_code == 201 @pytest.mark.django_db def test_request_list_endpoint_bulk_insert(self, api_client, access_log_path): user = UserFactory() api_client.login(username=user.username, password="password") df = get_dataframe_from_position(access_log_path, start_position=0) raw_rows = df.fillna("").to_dict(orient="rows") rows = pandas_rows_to_dict(raw_rows) r = api_client.post(self.list_url, data=rows, format="json") assert r.status_code == 201 assert Request.objects.count() == df.shape[0] @pytest.mark.django_db def test_request_list_endpoint_incremental_insert( self, api_client, access_log_path ): user = UserFactory() api_client.login(username=user.username, password="password") Request.objects.all().delete() # insert just first row df = get_dataframe_from_position(access_log_path, start_position=0) raw_rows = df.fillna("").to_dict(orient="rows") rows = pandas_rows_to_dict(raw_rows) row = rows[0] r = api_client.post(self.list_url, data=row, format="json") assert r.status_code == 201 # get last position (should be 4 because first 5 are the same) last_request = Request.objects.all().order_by("-timestamp")[0] last_position = get_last_request_position(access_log_path, last_request) assert last_position == 4 # insert starting at position 4 df = get_dataframe_from_position(access_log_path, start_position=last_position) raw_rows = df.fillna("").to_dict(orient="rows") rows = pandas_rows_to_dict(raw_rows) r = api_client.post(self.list_url, data=rows, format="json") assert r.status_code == 201 # assert number of unique lines in access.log and objects in database are equal # we omitted some lines intentionally number_of_unique_lines = 0 with open(access_log_path) as f: number_of_unique_lines = len(set([_ for _ in f])) assert Request.objects.count() == number_of_unique_lines
39.25448
88
0.672754
1,426
10,952
4.931276
0.115007
0.062713
0.029863
0.051195
0.799772
0.790529
0.782423
0.755688
0.754124
0.705347
0
0.009865
0.231739
10,952
278
89
39.395683
0.825885
0.174854
0
0.615385
0
0
0.063434
0.024707
0
0
0
0
0.181319
1
0.137363
false
0.043956
0.043956
0
0.214286
0.005495
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
3bcfc6a497f6e8282d4eefbe304936fd68ab3f0b
23
py
Python
starter/__init__.py
gnott/elife-bot
584c315d15d1289e0d2c27c28aaaae31174812e4
[ "MIT" ]
null
null
null
starter/__init__.py
gnott/elife-bot
584c315d15d1289e0d2c27c28aaaae31174812e4
[ "MIT" ]
null
null
null
starter/__init__.py
gnott/elife-bot
584c315d15d1289e0d2c27c28aaaae31174812e4
[ "MIT" ]
null
null
null
# eLife starter modules
23
23
0.826087
3
23
6.333333
1
0
0
0
0
0
0
0
0
0
0
0
0.130435
23
1
23
23
0.95
0.913043
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
3beb17f20ef4b1d6d172a44f9e3aa8c88bc64595
124
py
Python
bitirmetezi/venv/Lib/site-packages/plot/tk/arrayTK/__init__.py
busraltun/IMPLEMENTATIONOFEYECONTROLLEDVIRTUALKEYBOARD
fa3a9b150419a17aa82f41b068a5d69d0ff0d0f3
[ "MIT" ]
1
2020-04-10T08:14:43.000Z
2020-04-10T08:14:43.000Z
bitirmetezi/venv/Lib/site-packages/plot/tk/arrayTK/__init__.py
busraltun/IMPLEMENTATIONOFEYECONTROLLEDVIRTUALKEYBOARD
fa3a9b150419a17aa82f41b068a5d69d0ff0d0f3
[ "MIT" ]
1
2016-11-30T20:37:27.000Z
2016-12-12T11:55:50.000Z
bitirmetezi/venv/Lib/site-packages/plot/tk/arrayTK/__init__.py
busraltun/IMPLEMENTATIONOFEYECONTROLLEDVIRTUALKEYBOARD
fa3a9b150419a17aa82f41b068a5d69d0ff0d0f3
[ "MIT" ]
1
2019-12-18T07:56:00.000Z
2019-12-18T07:56:00.000Z
from .minmax import minmax from .smooth import smooth from .all_indexes import all_indexes from .transpose import transpose
24.8
36
0.83871
18
124
5.666667
0.388889
0.196078
0
0
0
0
0
0
0
0
0
0
0.129032
124
4
37
31
0.944444
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
3bfc5aa829cca805754d633cea0e859746484ccc
97
py
Python
i.py
zgana/manatee
bf79507523e9f84321d15de685709d51ddf9125c
[ "WTFPL" ]
null
null
null
i.py
zgana/manatee
bf79507523e9f84321d15de685709d51ddf9125c
[ "WTFPL" ]
null
null
null
i.py
zgana/manatee
bf79507523e9f84321d15de685709d51ddf9125c
[ "WTFPL" ]
null
null
null
# imports for interactive use import logging from manateelog import * from mainwindow import *
13.857143
29
0.793814
12
97
6.416667
0.75
0
0
0
0
0
0
0
0
0
0
0
0.175258
97
6
30
16.166667
0.9625
0.278351
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
0221e3cfbeacd2da39e909b16333bc66ca595b43
75
py
Python
lightnlp/tc/__init__.py
CNLPT/lightNLP
c7f128422ba5b16f514bb294145cb3b562e95829
[ "Apache-2.0" ]
889
2019-03-11T00:58:46.000Z
2022-03-27T07:12:06.000Z
lightnlp/tc/__init__.py
CNLPT/lightNLP
c7f128422ba5b16f514bb294145cb3b562e95829
[ "Apache-2.0" ]
14
2019-03-25T09:21:38.000Z
2020-12-28T11:41:55.000Z
lightnlp/tc/__init__.py
CNLPT/lightNLP
c7f128422ba5b16f514bb294145cb3b562e95829
[ "Apache-2.0" ]
237
2019-03-19T08:30:17.000Z
2022-03-14T03:38:30.000Z
from .sa.module import SA from .re.module import RE __all__ = ['SA', 'RE']
18.75
25
0.68
13
75
3.615385
0.461538
0.510638
0
0
0
0
0
0
0
0
0
0
0.16
75
3
26
25
0.746032
0
0
0
0
0
0.053333
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
02427500fbd7a07685d4cb090582f6a2ab628f54
87
py
Python
stop.py
reinspect/amok
adc014b42ec7375c5965aa709873b3911b28e470
[ "MIT" ]
null
null
null
stop.py
reinspect/amok
adc014b42ec7375c5965aa709873b3911b28e470
[ "MIT" ]
null
null
null
stop.py
reinspect/amok
adc014b42ec7375c5965aa709873b3911b28e470
[ "MIT" ]
null
null
null
import os from core.msg import * os.system('pkill -f ./core/server.py') print(killMsg)
17.4
38
0.724138
15
87
4.2
0.8
0.253968
0
0
0
0
0
0
0
0
0
0
0.114943
87
5
39
17.4
0.818182
0
0
0
0
0
0.284091
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0.25
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
02448542663494e7cdb7beff685af3cedf2a6431
189
py
Python
handroll/exceptions.py
iter8ve/handroll
55a97080b82ac5dcec1e974379b22fbaacf18c99
[ "BSD-2-Clause" ]
17
2015-02-28T07:36:13.000Z
2022-01-22T13:49:22.000Z
handroll/exceptions.py
iter8ve/handroll
55a97080b82ac5dcec1e974379b22fbaacf18c99
[ "BSD-2-Clause" ]
61
2015-02-24T01:12:56.000Z
2017-10-21T18:53:26.000Z
handroll/exceptions.py
iter8ve/handroll
55a97080b82ac5dcec1e974379b22fbaacf18c99
[ "BSD-2-Clause" ]
3
2019-02-04T16:33:08.000Z
2021-04-20T08:58:56.000Z
# Copyright (c) 2017, Matt Layman class AbortError(Exception): """Any fatal errors that would prevent handroll from proceeding should signal with the ``AbortError`` exception."""
27
74
0.730159
23
189
6
0.913043
0.275362
0
0
0
0
0
0
0
0
0
0.025641
0.174603
189
6
75
31.5
0.858974
0.751323
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
1
0
0
5
027717736b1a1289c3ae7a068d422b4c933d6fae
80
py
Python
generator/system/plant/simulator/__init__.py
SimkaNed/lw_cw
72d878820f20ac73dc7c14f5ccd70471dda4d6da
[ "MIT" ]
null
null
null
generator/system/plant/simulator/__init__.py
SimkaNed/lw_cw
72d878820f20ac73dc7c14f5ccd70471dda4d6da
[ "MIT" ]
null
null
null
generator/system/plant/simulator/__init__.py
SimkaNed/lw_cw
72d878820f20ac73dc7c14f5ccd70471dda4d6da
[ "MIT" ]
null
null
null
# SIMULATOR PROCESS # TODO: # RUNGE_KUTTA SIMULATOR # STEP # DYNAMICAL_SYSTEM
16
24
0.75
9
80
6.444444
0.888889
0
0
0
0
0
0
0
0
0
0
0
0.175
80
5
25
16
0.878788
0.875
0
null
0
null
0
0
null
0
0
0.2
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
1
0
0
0
1
0
0
0
0
0
0
5
027c830c75bb01ee6fb2f23883ed3d7ebc5fdf3e
78
py
Python
0python-demo/6sugar/testbuiltins.py
dikuznet/python-test-book
baf85ae62dbf09f83ea3dcf6f613410d28cbe6f8
[ "MIT" ]
null
null
null
0python-demo/6sugar/testbuiltins.py
dikuznet/python-test-book
baf85ae62dbf09f83ea3dcf6f613410d28cbe6f8
[ "MIT" ]
null
null
null
0python-demo/6sugar/testbuiltins.py
dikuznet/python-test-book
baf85ae62dbf09f83ea3dcf6f613410d28cbe6f8
[ "MIT" ]
null
null
null
import math print(dir()) print(globals()) print(dir(__builtins__)) x,y = 1,1
11.142857
24
0.692308
13
78
3.846154
0.692308
0.32
0
0
0
0
0
0
0
0
0
0.028986
0.115385
78
6
25
13
0.695652
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.2
0
0.2
0.6
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
5
02819dda7775e0e05b8ebcbbd23d570543db5501
145
py
Python
hello_fabric3/fabfile.py
flaviogf/Exemplos
fc666429f6e90c388e201fb7b7d5801e3c25bd25
[ "MIT" ]
null
null
null
hello_fabric3/fabfile.py
flaviogf/Exemplos
fc666429f6e90c388e201fb7b7d5801e3c25bd25
[ "MIT" ]
5
2019-12-29T04:58:10.000Z
2021-03-11T04:35:15.000Z
hello_fabric3/fabfile.py
flaviogf/Exemplos
fc666429f6e90c388e201fb7b7d5801e3c25bd25
[ "MIT" ]
null
null
null
import warnings from fabric.api import run warnings.filterwarnings(action='ignore', module='.*paramiko.*') def hello(): run('echo "OK"')
14.5
63
0.696552
18
145
5.611111
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.137931
145
9
64
16.111111
0.808
0
0
0
0
0
0.186207
0
0
0
0
0
0
1
0.2
true
0
0.4
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
1
0
1
0
1
0
0
5
5a2b5c8d3e09725498e2d465038f33f27c71cc99
7,698
py
Python
experiment3.py
JordyBottelier/arpsas
1d10f18d082b71ad2931852b8d88ad963add8fbe
[ "MIT" ]
4
2021-02-23T01:11:24.000Z
2022-01-14T13:29:42.000Z
experiment3.py
JordyBottelier/arpsas
1d10f18d082b71ad2931852b8d88ad963add8fbe
[ "MIT" ]
4
2021-03-18T20:36:03.000Z
2022-01-13T00:47:32.000Z
experiment3.py
JordyBottelier/arpsas
1d10f18d082b71ad2931852b8d88ad963add8fbe
[ "MIT" ]
2
2021-02-23T01:12:12.000Z
2021-06-27T17:48:30.000Z
""" Number of instances/column vs scores experiment. The code in all experiment files is very ugly, but it I did not see the use in creating beautifull code for all experiments since it is a 'press enter and rerun them' setup """ from schema_matching import * from schema_matching.misc_func import * from sklearn.metrics import accuracy_score from pandas_ml import ConfusionMatrix from sklearn.metrics import confusion_matrix from os.path import isfile import os import math def execute_test(sm, test_folder, skip_unknown=False): """ for all the schemas in the test folder, read them and classify them, also compute precision, recall, f_measure and accuracy. """ sr = Schema_Reader() actual = [] predicted = [] for filename in sorted(os.listdir(test_folder)): print(filename) path = test_folder + filename try: if(isfile(path)): headers, columns = sr.get_duplicate_columns(path, skip_unknown) print("done") actual += headers result_headers = None if skip_unknown: result_headers = sm.test_schema_matcher(columns, 0, False) else: result_headers = sm.test_schema_matcher(columns, 0.4, True) predicted += result_headers except: print("Fail") # break # print(ConfusionMatrix(actual, predicted)) return actual, predicted def experiment3_inliers(): data_folder = 'data_train/' gm = Graph_Maker() x = [30, 60, 90, 120, 150, 0] number_of_columns = 100 accuracies = [] # accuracies = [0.4, 0.4, 0.4] classes = ['city', 'country', 'date', 'gender', 'house_number',\ 'legal_type', 'postcode', 'province', 'sbi_code', 'sbi_description', 'telephone_nr'] sf_main = Storage_Files(data_folder, classes) tmp = [] for i in x: print("Fingerprint") print(i) # --- Fingerprint ccc = Column_Classification_Config() ccc.add_feature('feature_main', 'Fingerprint', [sf_main, number_of_columns, i, False, False]) ccc.add_matcher('matcher', 'Fingerprint_Matcher', {'feature_main': 'fingerprint'}) # main classifier sm = Schema_Matcher(ccc) actual, predicted = execute_test(sm, 'data_test/', True) accuracy = accuracy_score(actual, predicted) tmp.append(accuracy) gm.append_y(tmp) tmp = [] for i in x: print("SFM") print(i) # --- Fingerprint ccc = Column_Classification_Config() ccc.add_feature('feature_main', 'Syntax_Feature_Model', [sf_main, 1, i * 100, False, False]) ccc.add_matcher('matcher', 'Syntax_Matcher', {'feature_main': 'syntax'}) # main classifier sm = Schema_Matcher(ccc) actual, predicted = execute_test(sm, 'data_test/', True) accuracy = accuracy_score(actual, predicted) tmp.append(accuracy) gm.append_y(tmp) tmp = [] for i in x: print("W2V") print(i) # --- Word2Vec Matcher ccc = Column_Classification_Config() ccc.add_feature('feature_main', 'Corpus', [sf_main, number_of_columns, i, False, False]) ccc.add_matcher('matcher', 'Word2Vec_Matcher', {'feature_main': 'corpus'}) # main classifier sm = Schema_Matcher(ccc) actual, predicted = execute_test(sm, 'data_test/', True) accuracy = accuracy_score(actual, predicted) tmp.append(accuracy) gm.append_y(tmp) # gm.append_y([0.6, 0.7, 0.6, 0.8, 0.7, 0.9]) # gm.append_y([0.6, 0.5, 0.3, 0.4, 0.5, 0.7]) x = [30, 60, 90, 120, 150, 180] xticks = [30, 60, 90, 120, 150, 0] gm.add_x(x) gm.store(filename="/graph_maker/exp1.3a") gm.plot_line_n("Number of Instances per Column", "Accuracy", "Accuracy vs Number of Instances per Column" ,["Fingerprint",\ "Syntax Feature Model Matcher","Word2Vec Matcher"], xticks=xticks) def experiment3_outliers(): """ Run a full experiment on all matchers including outliers and measure precision, recall, f-measure and accuracy """ data_folder = 'data_train/' gm = Graph_Maker() x = [30, 60, 90, 120, 150, 0] number_of_columns = 100 min_number_of_columns = 20 examples_per_class = 0 classes = ['city', 'country', 'date', 'gender', 'house_number',\ 'legal_type', 'postcode', 'province', 'sbi_code', 'sbi_description', 'telephone_nr'] sf_main = Storage_Files(data_folder, classes) tmp_acc = [] tmp_prec = [] tmp_rec = [] tmp_fmeasure = [] for i in x: print("Fingerprint") # --- Fingerprint ccc = Column_Classification_Config() ccc.add_feature('feature_main', 'Fingerprint', [sf_main, number_of_columns, i, False, False]) ccc.add_matcher('matcher', 'Fingerprint_Matcher', {'feature_main': 'fingerprint'}) # main classifier sm = Schema_Matcher(ccc) actual, predicted = execute_test(sm, 'data_test/', False) accuracy = accuracy_score(actual, predicted) tmp_acc.append(accuracy) tmp_prec.append(precision(actual, predicted)) tmp_rec.append(recall(actual, predicted)) tmp_fmeasure.append(f_measure(actual, predicted)) gm.append_y(tmp_acc) gm.append_y(tmp_prec) gm.append_y(tmp_rec) gm.append_y(tmp_fmeasure) tmp_acc = [] tmp_prec = [] tmp_rec = [] tmp_fmeasure = [] for i in x: print("SFM") # --- Fingerprint ccc = Column_Classification_Config() ccc.add_feature('feature_main', 'Syntax_Feature_Model', [sf_main, 1, i * 100, False, False]) ccc.add_matcher('matcher', 'Syntax_Matcher', {'feature_main': 'syntax'}) # main classifier sm = Schema_Matcher(ccc) actual, predicted = execute_test(sm, 'data_test/', False) accuracy = accuracy_score(actual, predicted) tmp_acc.append(accuracy) tmp_prec.append(precision(actual, predicted)) tmp_rec.append(recall(actual, predicted)) tmp_fmeasure.append(f_measure(actual, predicted)) gm.append_y(tmp_acc) gm.append_y(tmp_prec) gm.append_y(tmp_rec) gm.append_y(tmp_fmeasure) tmp_acc = [] tmp_prec = [] tmp_rec = [] tmp_fmeasure = [] for i in x: print("W2V") # --- Word2Vec Matcher ccc = Column_Classification_Config() ccc.add_feature('feature_main', 'Corpus', [sf_main, number_of_columns, i, False, False]) ccc.add_matcher('matcher', 'Word2Vec_Matcher', {'feature_main': 'corpus'}) # main classifier sm = Schema_Matcher(ccc) actual, predicted = execute_test(sm, 'data_test/', False) accuracy = accuracy_score(actual, predicted) tmp_acc.append(accuracy) tmp_prec.append(precision(actual, predicted)) tmp_rec.append(recall(actual, predicted)) tmp_fmeasure.append(f_measure(actual, predicted)) gm.append_y(tmp_acc) gm.append_y(tmp_prec) gm.append_y(tmp_rec) gm.append_y(tmp_fmeasure) # gm.add_x(x) x = [30, 60, 90, 120, 150, 180] gm.append_x(x) gm.append_x(x) gm.append_x(x) # gm.append_y([0.4, 0.4, 0.4, 0.4, 0.4, 0.4]) # gm.append_y([0.5, 0.5, 0.5, 0.5, 0.5, 0.5]) # gm.append_y([0.62, 0.62, 0.62, 0.34, 0.74, 0.62]) # gm.append_y([0.23, 0.23, 0.28, 0.21, 0.24, 0.24]) # gm.append_y([0.4, 0.4, 0.4, 0.4, 0.4, 0.4]) # gm.append_y([0.5, 0.5, 0.5, 0.5, 0.5, 0.5]) # gm.append_y([0.62, 0.62, 0.62, 0.34, 0.74, 0.62]) # gm.append_y([0.23, 0.23, 0.28, 0.21, 0.24, 0.24]) # gm.append_y([0.4, 0.4, 0.4, 0.4, 0.4, 0.4]) # gm.append_y([0.5, 0.5, 0.5, 0.5, 0.5, 0.5]) # gm.append_y([0.62, 0.62, 0.62, 0.34, 0.74, 0.62]) # gm.append_y([0.23, 0.23, 0.28, 0.21, 0.24, 0.24]) gm.store(filename="/graph_maker/exp1.3b") subtitles = ["Fingerprint", "Syntax Feature Model Matcher", "Word2Vec Matcher"] labels = ["Accuracy", "Precision", "Recall", "F-Measure"] xticks = [30, 60, 90, 120, 150, 0] gm.subplot_n("Number of Instances per Column", "Scores", "Scores vs Number of Instances per Column" ,subtitles, labels*3, xticks=xticks) if __name__ == '__main__': # experiment3_inliers() # experiment3_outliers() gm = Graph_Maker() gm.load(filename="/graph_maker/exp1.3a") xticks = [30, 60, 90, 120, 150, 0] gm.plot_line_n("Number of Instances per Column", "Accuracy", "Accuracy vs Number of Instances per Column" ,["Fingerprint",\ "Syntax Feature Model Matcher","Word2Vec Matcher"], xticks=xticks)
33.181034
137
0.696545
1,195
7,698
4.291213
0.156485
0.049922
0.050897
0.013261
0.771061
0.765991
0.716264
0.700078
0.672582
0.672582
0
0.052575
0.147571
7,698
232
138
33.181034
0.728894
0.188231
0
0.745455
0
0
0.196703
0
0
0
0
0
0
1
0.018182
false
0
0.048485
0
0.072727
0.115152
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
5a2e29949b3878b904bf581bd4e1551c939f7d92
72
py
Python
dastr/__init__.py
kinleyid/dastr
357bcccc561b6a07427fb9d2516136185e4e6246
[ "MIT" ]
null
null
null
dastr/__init__.py
kinleyid/dastr
357bcccc561b6a07427fb9d2516136185e4e6246
[ "MIT" ]
null
null
null
dastr/__init__.py
kinleyid/dastr
357bcccc561b6a07427fb9d2516136185e4e6246
[ "MIT" ]
null
null
null
from dastr.dastr import json_to_params, read, translate, todelim, write
36
71
0.819444
11
72
5.181818
0.909091
0
0
0
0
0
0
0
0
0
0
0
0.111111
72
2
71
36
0.890625
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
5a5a9f972857b8a0f52267c7286d051aeef218ed
74
py
Python
knx_stack/definition/layer/network/__init__.py
majamassarini/knx-stack
11a9baac6b7600649b5fbca43c93b200b23676b4
[ "MIT" ]
2
2021-07-28T07:42:28.000Z
2022-01-25T18:56:05.000Z
knx_stack/definition/layer/network/__init__.py
majamassarini/knx-stack
11a9baac6b7600649b5fbca43c93b200b23676b4
[ "MIT" ]
6
2021-07-25T21:36:01.000Z
2022-02-20T21:11:31.000Z
knx_stack/definition/layer/network/__init__.py
majamassarini/knx-stack
11a9baac6b7600649b5fbca43c93b200b23676b4
[ "MIT" ]
null
null
null
from knx_stack.definition.layer.network.address_table import AddressTable
37
73
0.891892
10
74
6.4
1
0
0
0
0
0
0
0
0
0
0
0
0.054054
74
1
74
74
0.914286
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
ce79551d2cec7a1b7e2398e5e6ef6591e4d8375f
201
py
Python
bobstack/sipmessaging/concretesipmessages/referSIPRequest.py
bobjects/BobStack
c177b286075044832f44baf9ace201780c8b4320
[ "Apache-2.0" ]
null
null
null
bobstack/sipmessaging/concretesipmessages/referSIPRequest.py
bobjects/BobStack
c177b286075044832f44baf9ace201780c8b4320
[ "Apache-2.0" ]
null
null
null
bobstack/sipmessaging/concretesipmessages/referSIPRequest.py
bobjects/BobStack
c177b286075044832f44baf9ace201780c8b4320
[ "Apache-2.0" ]
null
null
null
from ...sipmessaging import SIPRequest class REFERSIPRequest(SIPRequest): @property def is_refer_request(self): return True @property def is_known(self): return True
16.75
38
0.676617
22
201
6.045455
0.681818
0.165414
0.195489
0
0
0
0
0
0
0
0
0
0.253731
201
11
39
18.272727
0.886667
0
0
0.5
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.125
0.25
0.75
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
ce7b0b11f0b5b01b84482d036c7a326e43f08c5f
59
py
Python
enthought/pyface/mdi_application_window.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
3
2016-12-09T06:05:18.000Z
2018-03-01T13:00:29.000Z
enthought/pyface/mdi_application_window.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
1
2020-12-02T00:51:32.000Z
2020-12-02T08:48:55.000Z
enthought/pyface/mdi_application_window.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
null
null
null
# proxy module from pyface.mdi_application_window import *
19.666667
43
0.830508
8
59
5.875
1
0
0
0
0
0
0
0
0
0
0
0
0.118644
59
2
44
29.5
0.903846
0.20339
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
ce8d0908267816d39ae24ec7ba0fba4670a84fc5
218
py
Python
ansible_bender/exceptions.py
11mariom/ansible-bender
4cf3887bf8d7f1819d5904b9a103d48edc06a8d1
[ "MIT" ]
null
null
null
ansible_bender/exceptions.py
11mariom/ansible-bender
4cf3887bf8d7f1819d5904b9a103d48edc06a8d1
[ "MIT" ]
1
2019-11-06T21:02:17.000Z
2019-11-07T04:44:57.000Z
ansible_bender/exceptions.py
11mariom/ansible-bender
4cf3887bf8d7f1819d5904b9a103d48edc06a8d1
[ "MIT" ]
null
null
null
class AbBuildUnsuccesful(Exception): """ Build was not successful """ def __init__(self, msg, output): self.msg = msg self.output = output def __str__(self): return "%s" % self.msg
24.222222
36
0.600917
25
218
4.92
0.6
0.170732
0
0
0
0
0
0
0
0
0
0
0.279817
218
8
37
27.25
0.783439
0.110092
0
0
0
0
0.010753
0
0
0
0
0
0
1
0.333333
false
0
0
0.166667
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
0c7e2ff0deea8cce12deed8d169ddac6e0c21e16
143
py
Python
print without newline.py
manand881/Python-Programs
eb970cb1b21d4aede0102c60425eb8a1d4ac605c
[ "MIT" ]
null
null
null
print without newline.py
manand881/Python-Programs
eb970cb1b21d4aede0102c60425eb8a1d4ac605c
[ "MIT" ]
null
null
null
print without newline.py
manand881/Python-Programs
eb970cb1b21d4aede0102c60425eb8a1d4ac605c
[ "MIT" ]
null
null
null
#Print without newline or space print("\n") for j in range(10): print("") for i in range(10): print(' @ ', end="") print("\n")
17.875
31
0.538462
22
143
3.5
0.590909
0.155844
0.233766
0.363636
0
0
0
0
0
0
0
0.037383
0.251748
143
8
32
17.875
0.682243
0.20979
0
0.333333
0
0
0.061947
0
0
0
0
0
0
1
0
false
0
0
0
0
0.666667
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
5
0b4f846a543e554d64f2f7d8adb1ee057a744cbb
43
py
Python
command/test/integration/fake_repository/commit_023/x.py
skylerberg/pyre-check
e7967e5ee65dd09608f162cdb36a5b0919aeb5e3
[ "MIT" ]
5
2019-02-14T19:46:47.000Z
2020-01-16T05:48:45.000Z
command/test/integration/fake_repository/commit_023/x.py
skylerberg/pyre-check
e7967e5ee65dd09608f162cdb36a5b0919aeb5e3
[ "MIT" ]
4
2022-02-15T02:42:33.000Z
2022-02-28T01:30:07.000Z
command/test/integration/fake_repository/commit_023/x.py
skylerberg/pyre-check
e7967e5ee65dd09608f162cdb36a5b0919aeb5e3
[ "MIT" ]
2
2019-02-14T19:46:23.000Z
2020-07-13T03:53:04.000Z
import a v: a.A reveal_type(var) # noqa
7.166667
24
0.651163
9
43
3
0.777778
0
0
0
0
0
0
0
0
0
0
0
0.232558
43
5
25
8.6
0.818182
0.093023
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
0b5a4fa7e15a78caff0dfa18f727d2e3f703340c
173
py
Python
tests/plugins/loading/plugins/nosetup/nosetup.py
doraskayo/buildstream
1c72d4342ae7df360808de22c5e49f55dbb6bec6
[ "Apache-2.0" ]
null
null
null
tests/plugins/loading/plugins/nosetup/nosetup.py
doraskayo/buildstream
1c72d4342ae7df360808de22c5e49f55dbb6bec6
[ "Apache-2.0" ]
null
null
null
tests/plugins/loading/plugins/nosetup/nosetup.py
doraskayo/buildstream
1c72d4342ae7df360808de22c5e49f55dbb6bec6
[ "Apache-2.0" ]
null
null
null
# A plugin is supposed to define a setup function # which returns the type that the plugin provides # # This plugin fails to do so def useless(): print("Hello World")
19.222222
49
0.722543
28
173
4.464286
0.821429
0
0
0
0
0
0
0
0
0
0
0
0.213873
173
8
50
21.625
0.919118
0.705202
0
0
0
0
0.23913
0
0
0
0
0
0
1
0.5
true
0
0
0
0.5
0.5
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
0
0
0
1
0
5
e7ed6320bc29af83559d6e0ccb602bc33b2048a2
212
py
Python
src/ufdl/annotations_plugin/audio/speech/specifier/__init__.py
waikato-ufdl/ufdl-annotations-plugin
9eb3d807e35215ad9cfbd4aa651d7f7142e83efe
[ "Apache-2.0" ]
null
null
null
src/ufdl/annotations_plugin/audio/speech/specifier/__init__.py
waikato-ufdl/ufdl-annotations-plugin
9eb3d807e35215ad9cfbd4aa651d7f7142e83efe
[ "Apache-2.0" ]
4
2020-07-29T04:09:13.000Z
2020-11-22T20:52:18.000Z
src/ufdl/annotations_plugin/audio/speech/specifier/__init__.py
waikato-ufdl/ufdl-annotations-plugin
9eb3d807e35215ad9cfbd4aa651d7f7142e83efe
[ "Apache-2.0" ]
null
null
null
""" Defines the specifiers of the speech domain components. """ from ._UFDLSpeechSinkStageSpecifier import UFDLSpeechSinkStageSpecifier from ._UFDLSpeechSourceStageSpecifier import UFDLSpeechSourceStageSpecifier
35.333333
75
0.872642
16
212
11.4375
0.6875
0
0
0
0
0
0
0
0
0
0
0
0.084906
212
5
76
42.4
0.943299
0.259434
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
f0289b0d5eee8dc8516d1b3a5c51a0a312a50b8a
168
py
Python
tests/unit/test_all.py
nismod/open-gira
be70e1734272d0b8ed60697264e22bf083305faf
[ "MIT" ]
1
2022-02-12T14:37:09.000Z
2022-02-12T14:37:09.000Z
tests/unit/test_all.py
nismod/open-gira
be70e1734272d0b8ed60697264e22bf083305faf
[ "MIT" ]
29
2022-01-10T10:02:54.000Z
2022-03-31T17:27:56.000Z
tests/unit/test_all.py
nismod/open-gira
be70e1734272d0b8ed60697264e22bf083305faf
[ "MIT" ]
null
null
null
import os import sys import common sys.path.insert(0, os.path.dirname(__file__)) def test_all(): common.run_test('all', 'snakemake all -j1 --keep-target-files')
16.8
67
0.720238
27
168
4.259259
0.666667
0.121739
0
0
0
0
0
0
0
0
0
0.013699
0.130952
168
9
68
18.666667
0.773973
0
0
0
0
0
0.238095
0
0
0
0
0
0
1
0.166667
true
0
0.5
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
f0394ae7bb626a55220120f44cebda186442a8fd
169
py
Python
tests/test_get_quote.py
kadaliao/random-quote-generator
be067e1fa1c0274397699f585c389af5bdc5d41c
[ "MIT" ]
null
null
null
tests/test_get_quote.py
kadaliao/random-quote-generator
be067e1fa1c0274397699f585c389af5bdc5d41c
[ "MIT" ]
null
null
null
tests/test_get_quote.py
kadaliao/random-quote-generator
be067e1fa1c0274397699f585c389af5bdc5d41c
[ "MIT" ]
null
null
null
from random_quote_generator import get_quote from random_quote_generator.quotes import quotes def test_get_quote(): quote = get_quote() assert quote in quotes
21.125
48
0.798817
25
169
5.08
0.44
0.188976
0.23622
0.377953
0
0
0
0
0
0
0
0
0.159763
169
7
49
24.142857
0.894366
0
0
0
0
0
0
0
0
0
0
0
0.2
1
0.2
false
0
0.4
0
0.6
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
f05259cb95937a533fa1666eb29557da38b49342
195
py
Python
app/resources/__init__.py
netai/stockbag_backend
b5bbc09fea896bcb1c03091579f6de658bff4c13
[ "MIT" ]
null
null
null
app/resources/__init__.py
netai/stockbag_backend
b5bbc09fea896bcb1c03091579f6de658bff4c13
[ "MIT" ]
null
null
null
app/resources/__init__.py
netai/stockbag_backend
b5bbc09fea896bcb1c03091579f6de658bff4c13
[ "MIT" ]
null
null
null
from .auth_resource import Login from .user_resource import User from .holding_resource import Holding, HoldingAddExit, HoldingList from .note_resource import Note from .fund_resource import Fund
39
66
0.85641
27
195
6
0.407407
0.432099
0
0
0
0
0
0
0
0
0
0
0.107692
195
5
67
39
0.931034
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
f05738c8e44d70bbda2ff8cb19feed42a12e579c
133
py
Python
friend_rating_server/web/form/login_form.py
ConanYu/FriendRatingServer
6aec0f1849036da4bbcd2669e42a1c7647e9f0c6
[ "MIT" ]
1
2021-05-13T13:16:28.000Z
2021-05-13T13:16:28.000Z
friend_rating_server/web/form/login_form.py
ConanYu/FriendRatingServer
6aec0f1849036da4bbcd2669e42a1c7647e9f0c6
[ "MIT" ]
1
2021-05-13T13:19:52.000Z
2021-10-09T03:50:02.000Z
friend_rating_server/web/form/login_form.py
ConanYu/FriendRatingServer
6aec0f1849036da4bbcd2669e42a1c7647e9f0c6
[ "MIT" ]
2
2021-05-15T12:47:32.000Z
2021-05-22T03:54:57.000Z
from django import forms class LoginForm(forms.Form): password = forms.CharField(max_length=256, widget=forms.PasswordInput())
22.166667
76
0.774436
17
133
6
0.823529
0
0
0
0
0
0
0
0
0
0
0.025641
0.120301
133
5
77
26.6
0.846154
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0.333333
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
1
1
0
1
0
0
5
f06491115da8bcc824122d74b4b13db9310c3fbf
155
py
Python
tasks/__init__.py
princeton-vl/selfstudy
d18ab26c11843557ee75aaccf6ccb63de85b397c
[ "BSD-3-Clause" ]
55
2020-04-01T15:07:43.000Z
2022-02-21T14:27:54.000Z
tasks/__init__.py
princeton-vl/selfstudy
d18ab26c11843557ee75aaccf6ccb63de85b397c
[ "BSD-3-Clause" ]
null
null
null
tasks/__init__.py
princeton-vl/selfstudy
d18ab26c11843557ee75aaccf6ccb63de85b397c
[ "BSD-3-Clause" ]
2
2020-04-27T12:59:34.000Z
2021-03-27T22:07:13.000Z
from .classify import * from .cmc import CMCTask from .rotate import RotateTask from .vae import VAETask from .amdim import AMDIMTask from .depth import *
22.142857
30
0.793548
22
155
5.590909
0.545455
0
0
0
0
0
0
0
0
0
0
0
0.154839
155
6
31
25.833333
0.938931
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
b2f9dd147094689b3b66ac54aba2e510ccaaacc6
2,189
py
Python
mail/mail.py
bewallyt/Classy
f4a672f759da862b37b3980151c37cb0d05504d6
[ "MIT" ]
null
null
null
mail/mail.py
bewallyt/Classy
f4a672f759da862b37b3980151c37cb0d05504d6
[ "MIT" ]
null
null
null
mail/mail.py
bewallyt/Classy
f4a672f759da862b37b3980151c37cb0d05504d6
[ "MIT" ]
null
null
null
from django.core.mail import EmailMessage import datetime def send_post(post): when = post.day_of_week + ', ' + post.show_date if post.not_all_day: when = when + ' at ' + post.show_begin_time email = EmailMessage(to=[post.author.email]) email.template_name = 'post' email.global_merge_vars = { 'content': post.content, 'description': post.description_event, 'location': post.location_event, 'when': when } email.send_at = post.notify_when email.use_template_subject = True email.use_template_from = False email.send(fail_silently=False) response = email.mandrill_response[0] print response return response def send_shared_post(post, email_address, send_time): when = post.day_of_week + ', ' + post.show_date if post.not_all_day: when = when + ' at ' + post.show_begin_time email = EmailMessage(to=[email_address]) email.template_name = 'post' email.global_merge_vars = { 'content': post.content, 'description': post.description_event, 'location': post.location_event, 'when': when } email.send_at = send_time email.use_template_subject = True email.use_template_from = False email.send(fail_silently=False) response = email.mandrill_response[0] print response return response def send_pud(pud): email = EmailMessage(to=[pud.author.email]) email.template_name = 'pud' email.global_merge_vars = { 'content': pud.content, 'priority': pud.priority } email.send_at = pud.created_at + datetime.timedelta(days=pud.notify_when) email.use_template_subject = True email.use_template_from = False email.send(fail_silently=False) if pud.need_repeat: if pud.repeat == 'Daily': email.send_at = email.send_at + datetime.timedelta(days=1) elif pud.repeat == 'Weekly': email.send_at = email.send_at + datetime.timedelta(weeks=1) email.send(fail_silently=False) response = email.mandrill_response[0] print response return response
30.830986
78
0.647328
270
2,189
5.007407
0.222222
0.073225
0.056953
0.06213
0.781805
0.732988
0.732988
0.732988
0.675296
0.675296
0
0.003054
0.25217
2,189
71
79
30.830986
0.822847
0
0
0.633333
0
0
0.051415
0
0
0
0
0
0
0
null
null
0
0.033333
null
null
0.05
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
5
652a6ea67a1fa014efcd6c570af36f2722fd9910
29
py
Python
spec/simple.py
szatkus/polybug
7ec1877d39a75aed5f24f88a91262d6d9a733659
[ "MIT" ]
null
null
null
spec/simple.py
szatkus/polybug
7ec1877d39a75aed5f24f88a91262d6d9a733659
[ "MIT" ]
1
2018-05-21T20:18:13.000Z
2018-05-21T20:18:13.000Z
spec/simple.py
szatkus/polybug
7ec1877d39a75aed5f24f88a91262d6d9a733659
[ "MIT" ]
null
null
null
print("test") print("test2")
9.666667
14
0.655172
4
29
4.75
0.75
0
0
0
0
0
0
0
0
0
0
0.037037
0.068966
29
2
15
14.5
0.666667
0
0
0
0
0
0.310345
0
0
0
0
0
0
1
0
true
0
0
0
0
1
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
5
e8e2abfb83b18844cf348cb29fa820bccccaed1a
141
py
Python
nimare/meta/__init__.py
Julio-Yanes/NiMARE
36bb05034041998519814b55fe402489147fdd63
[ "MIT" ]
null
null
null
nimare/meta/__init__.py
Julio-Yanes/NiMARE
36bb05034041998519814b55fe402489147fdd63
[ "MIT" ]
null
null
null
nimare/meta/__init__.py
Julio-Yanes/NiMARE
36bb05034041998519814b55fe402489147fdd63
[ "MIT" ]
null
null
null
""" Top-level namespace for meta-analyses. """ from . import cbma from . import ibma from . import esma __all__ = ['cbma', 'ibma', 'esma']
14.1
38
0.659574
19
141
4.684211
0.631579
0.337079
0
0
0
0
0
0
0
0
0
0
0.177305
141
9
39
15.666667
0.767241
0.269504
0
0
0
0
0.126316
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
1
0
0
5
3306884b6f9e9ea2190ad7cf9889f93e3e5ccea8
39
py
Python
Day1_print/print.py
ariv14/python_day1
6a649d19669a3952aa55509754a91afebe215066
[ "Apache-2.0" ]
null
null
null
Day1_print/print.py
ariv14/python_day1
6a649d19669a3952aa55509754a91afebe215066
[ "Apache-2.0" ]
null
null
null
Day1_print/print.py
ariv14/python_day1
6a649d19669a3952aa55509754a91afebe215066
[ "Apache-2.0" ]
null
null
null
# Print function print("Hello world!")
13
21
0.717949
5
39
5.6
0.8
0
0
0
0
0
0
0
0
0
0
0
0.128205
39
2
22
19.5
0.823529
0.358974
0
0
0
0
0.521739
0
0
0
0
0
0
1
0
true
0
0
0
0
1
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
5
33080f54bfb987125e9310ef27e676b05651212f
59
py
Python
dynamic_db_router/__init__.py
jaredlewis/django-dynamic-db-router
ea13d6b0e51e58fe894f453b2a1641892f9bc3dd
[ "MIT" ]
58
2015-05-14T22:48:02.000Z
2021-07-12T23:18:17.000Z
dynamic_db_router/__init__.py
jaredlewis/django-dynamic-db-router
ea13d6b0e51e58fe894f453b2a1641892f9bc3dd
[ "MIT" ]
5
2015-02-19T06:37:53.000Z
2021-12-02T12:48:08.000Z
dynamic_db_router/__init__.py
jaredlewis/django-dynamic-db-router
ea13d6b0e51e58fe894f453b2a1641892f9bc3dd
[ "MIT" ]
20
2015-02-18T22:46:34.000Z
2022-01-08T19:19:18.000Z
from .router import DynamicDbRouter, in_database # NOQA
29.5
58
0.779661
7
59
6.428571
1
0
0
0
0
0
0
0
0
0
0
0
0.169492
59
1
59
59
0.918367
0.067797
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
3312a3a032fdf14475cb8cca7911e35f891ffa9a
127
py
Python
app_head.py
project-k-0-1/project-k
fa5be043a3c82daee992d28db25519e2b1b53289
[ "MIT" ]
1
2018-11-30T17:09:11.000Z
2018-11-30T17:09:11.000Z
app_head.py
Kahroo/kahroo
fa5be043a3c82daee992d28db25519e2b1b53289
[ "MIT" ]
null
null
null
app_head.py
Kahroo/kahroo
fa5be043a3c82daee992d28db25519e2b1b53289
[ "MIT" ]
2
2020-12-03T04:30:45.000Z
2021-04-21T09:59:37.000Z
""" html head """ def get_head(content): """ xxx """ return_data = '<head>'+ content +'</head>' return return_data
21.166667
46
0.566929
15
127
4.6
0.533333
0.318841
0
0
0
0
0
0
0
0
0
0
0.220472
127
5
47
25.4
0.69697
0.110236
0
0
0
0
0.131313
0
0
0
0
0
0
1
0.333333
false
0
0
0
0.666667
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
5
33340fe0a83bf5f0537db77d36796931d6943b18
1,610
py
Python
web/addons/COMPS/__openerp__.py
diogocs1/comps
63df07f6cf21c41e4527c06e2d0499f23f4322e7
[ "Apache-2.0" ]
null
null
null
web/addons/COMPS/__openerp__.py
diogocs1/comps
63df07f6cf21c41e4527c06e2d0499f23f4322e7
[ "Apache-2.0" ]
null
null
null
web/addons/COMPS/__openerp__.py
diogocs1/comps
63df07f6cf21c41e4527c06e2d0499f23f4322e7
[ "Apache-2.0" ]
null
null
null
# encoding: UTF-8 { "name":u'CoMPS', 'version': '1.0', 'category': u'Saúde', 'depends':[], 'data':[ 'views/qweb/comps_template.xml', 'security/comps_security.xml', 'security/ir.model.access.csv', 'views/cadastro_usuarios_view.xml', 'views/cadastro_escola_view.xml', 'views/cadastro_avaliador_view.xml', 'views/cadastro_aluno_view.xml', 'views/avaliacao_imc_view.xml', "views/avaliacao_abdominal_view.xml", "views/avaliacao_perimetro_view.xml", "views/avaliacao_dobras_cutaneas_view.xml", "views/avaliacao_impulsao_horizontal_view.xml", "views/avaliacao_sentar_alcancar_view.xml", "views/avaliacao_preensao_manual_view.xml", "views/avaliacao_lancamento_unilateral_view.xml", "views/avaliacao_lancamento_simultaneo_view.xml", "views/avaliacao_corrida_25m_view.xml", "views/avaliacao_shutllerun_10x5m_view.xml", "views/avaliacao_shutllerun_20m_view.xml", "views/avaliacao_equilibrio_retaguarda_view.xml", "views/avaliacao_saltos_laterais_view.xml", "views/avaliacao_transposicao_lateral_view.xml", "views/avaliacao_saltos_monopedais_perna_direita_view.xml", "views/avaliacoes_pendentes_view.xml", ], 'css': [ 'static/src/css/*.css', ], 'js': [ 'static/src/js/*.js' ], 'installable': True, 'application': True, 'auto_install': False, }
38.333333
71
0.610559
165
1,610
5.593939
0.418182
0.159263
0.260022
0.36403
0.192849
0
0
0
0
0
0
0.008467
0.26646
1,610
42
72
38.333333
0.773074
0.009317
0
0.073171
0
0
0.638645
0.563363
0
0
0
0
0
1
0
true
0
0
0
0
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
1
1
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
3341e4451b3e90d61045338d985f82ca048531a6
100
py
Python
clip/__init__.py
Wuziyi616/CLIP
ef2d10cda88e30f4410c1f98abfb7c95b6e5a598
[ "MIT" ]
null
null
null
clip/__init__.py
Wuziyi616/CLIP
ef2d10cda88e30f4410c1f98abfb7c95b6e5a598
[ "MIT" ]
null
null
null
clip/__init__.py
Wuziyi616/CLIP
ef2d10cda88e30f4410c1f98abfb7c95b6e5a598
[ "MIT" ]
1
2021-12-04T00:21:14.000Z
2021-12-04T00:21:14.000Z
from .clip import * from .model import convert_weights, convert_models_to_fp32, freeze_text_encoder
33.333333
79
0.85
15
100
5.266667
0.8
0
0
0
0
0
0
0
0
0
0
0.022222
0.1
100
2
80
50
0.855556
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
334a9cafe8b3449672bf7848ad9ffc75b18b3ce9
105
py
Python
skip/history/skip/data/__init__.py
houzeyu2683/k1
398d44183019781c02340c6b70a586b67bc6bb4d
[ "Apache-2.0" ]
null
null
null
skip/history/skip/data/__init__.py
houzeyu2683/k1
398d44183019781c02340c6b70a586b67bc6bb4d
[ "Apache-2.0" ]
null
null
null
skip/history/skip/data/__init__.py
houzeyu2683/k1
398d44183019781c02340c6b70a586b67bc6bb4d
[ "Apache-2.0" ]
null
null
null
from .table import table from .split import split from .dataset import dataset from .cache import cache
17.5
28
0.8
16
105
5.25
0.375
0
0
0
0
0
0
0
0
0
0
0
0.161905
105
5
29
21
0.954545
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
336b5c94c6348990ded89868f25d6c9cd2a34f85
45,751
py
Python
objects/CSCG/_3d/mesh/domain/regions/region/interpolations/transfinite.py
mathischeap/mifem
3242e253fb01ca205a76568eaac7bbdb99e3f059
[ "MIT" ]
1
2020-10-14T12:48:35.000Z
2020-10-14T12:48:35.000Z
objects/CSCG/_3d/mesh/domain/regions/region/interpolations/transfinite.py
mathischeap/mifem
3242e253fb01ca205a76568eaac7bbdb99e3f059
[ "MIT" ]
null
null
null
objects/CSCG/_3d/mesh/domain/regions/region/interpolations/transfinite.py
mathischeap/mifem
3242e253fb01ca205a76568eaac7bbdb99e3f059
[ "MIT" ]
null
null
null
from root.config.main import * import random from objects.CSCG._3d.mesh.domain.regions.region.interpolations.base import InterpolationBase from screws.exceptions import ThreeDimensionalTransfiniteInterpolationError from screws.numerical._2d_space.Jacobian_21 import NumericalPartialDerivative_xy class Transfinite(InterpolationBase): """ The Transfinite interpolation in 3D. """ def __init__(self, region): """ To initialize a transfinite interpolation, we take a regions as input. Parameters ---------- region : Region """ super().__init__(region) assert all([region._side_geometries_[key].__class__.__name__ != 'Free' for key in region._side_geometries_]), \ " <Transfinite> : I do not accept `Free` side geometries. " self.___check_line_consistency___() self.___check_Jacobian___() self._freeze_self_() def ___check_line_consistency___(self): """ We know that trace to a line from two sides should result in the same line function. So we do this check to see if the provided _side_geometries_ are correct. Notice that we do not have to check the corner consistency anymore if this check is all right. """ I = random.randint(2, 4) rst = np.linspace(0, 1, I) _NW_, _WN_ = self.___NW___(rst), self.___WN___(rst) _NE_, _EN_ = self.___NE___(rst), self.___EN___(rst) _NB_, _BN_ = self.___NB___(rst), self.___BN___(rst) _NF_, _FN_ = self.___NF___(rst), self.___FN___(rst) _SW_, _WS_ = self.___SW___(rst), self.___WS___(rst) _SE_, _ES_ = self.___SE___(rst), self.___ES___(rst) _SB_, _BS_ = self.___SB___(rst), self.___BS___(rst) _SF_, _FS_ = self.___SF___(rst), self.___FS___(rst) _WB_, _BW_ = self.___WB___(rst), self.___BW___(rst) _WF_, _FW_ = self.___WF___(rst), self.___FW___(rst) _EB_, _BE_ = self.___EB___(rst), self.___BE___(rst) _EF_, _FE_ = self.___EF___(rst), self.___FE___(rst) try: for i in range(3): np.testing.assert_array_almost_equal(_NW_[i], _WN_[i]) np.testing.assert_array_almost_equal(_NE_[i], _EN_[i]) np.testing.assert_array_almost_equal(_NB_[i], _BN_[i]) np.testing.assert_array_almost_equal(_NF_[i], _FN_[i]) np.testing.assert_array_almost_equal(_SW_[i], _WS_[i]) np.testing.assert_array_almost_equal(_SE_[i], _ES_[i]) np.testing.assert_array_almost_equal(_SB_[i], _BS_[i]) np.testing.assert_array_almost_equal(_SF_[i], _FS_[i]) np.testing.assert_array_almost_equal(_WB_[i], _BW_[i]) np.testing.assert_array_almost_equal(_WF_[i], _FW_[i]) np.testing.assert_array_almost_equal(_EB_[i], _BE_[i]) np.testing.assert_array_almost_equal(_EF_[i], _FE_[i]) raise_Error = False except AssertionError: raise_Error = True raise_Error = cOmm.allreduce(raise_Error, op=MPI.LOR) if raise_Error: raise ThreeDimensionalTransfiniteInterpolationError( "Something is wrong with 3d TransfiniteInterpolation") def ___check_Jacobian___(self): """ """ p = np.random.rand(7, 5) q = np.random.rand(7, 5) for side in ('N', 'S', 'W', 'E', 'B', 'F'): X = self._region_._side_geometries_[side].X Y = self._region_._side_geometries_[side].Y Z = self._region_._side_geometries_[side].Z Xp = self._region_._side_geometries_[side].Xp Xq = self._region_._side_geometries_[side].Xq Yp = self._region_._side_geometries_[side].Yp Yq = self._region_._side_geometries_[side].Yq Zp = self._region_._side_geometries_[side].Zp Zq = self._region_._side_geometries_[side].Zq XNJ = NumericalPartialDerivative_xy(X, p, q) assert all(XNJ.check_total(Xp, Xq)), " <Transfinite> : X, Xp, Xq wrong" YNJ = NumericalPartialDerivative_xy(Y, p, q) assert all(YNJ.check_total(Yp, Yq)), " <Transfinite> : Y, Yp, Yq wrong" ZNJ = NumericalPartialDerivative_xy(Z, p, q) assert all(ZNJ.check_total(Zp, Zq)), " <Transfinite> : Z, Zp, Zq wrong" def mapping(self, r, s, t): """ r, s, t be in [0, 1]. """ r, s, t = self.___check_rst___(r, s, t) N = self.___NnN___(s, t) S = self.___SsS___(s, t) W = self.___WwW___(r, t) E = self.___EeE___(r, t) B = self.___BbB___(r, s) F = self.___FfF___(r, s) NW = self.___NW___(t) NE = self.___NE___(t) SW = self.___SW___(t) SE = self.___SE___(t) NB = self.___NB___(s) NF = self.___NF___(s) SB = self.___SB___(s) SF = self.___SF___(s) WB = self.___WB___(r) WF = self.___WF___(r) EB = self.___EB___(r) EF = self.___EF___(r) NWB = self.___N_W_B___ NWF = self.___N_W_F___ NEB = self.___N_E_B___ NEF = self.___N_E_F___ SWB = self.___S_W_B___ SWF = self.___S_W_F___ SEB = self.___S_E_B___ SEF = self.___S_E_F___ x1 = (1 - r) * N + r * S x2 = (1 - s) * W + s * E x3 = (1 - t) * B + t * F x12 = (1 - r) * (1 - s) * NW + (1 - r) * s * NE + r * (1 - s) * SW + r * s * SE x13 = (1 - r) * (1 - t) * NB + (1 - r) * t * NF + r * (1 - t) * SB + r * t * SF x23 = (1 - s) * (1 - t) * WB + (1 - s) * t * WF + s * (1 - t) * EB + s * t * EF x123 = [None, None, None] for i in range(3): x123[i] = + (1 - r) * (1 - s) * (1 - t) * NWB[i] \ + (1 - r) * (1 - s) * t * NWF[i] \ + (1 - r) * s * (1 - t) * NEB[i] \ + (1 - r) * s * t * NEF[i] \ + r * (1 - s) * (1 - t) * SWB[i] \ + r * (1 - s) * t * SWF[i] \ + r * s * (1 - t) * SEB[i] \ + r * s * t * SEF[i] X = x1 + x2 + x3 - x12 - x13 - x23 + x123 return X def mapping_X(self, r, s, t): """ r, s, t be in [0, 1]. """ r, s, t = self.___check_rst___(r, s, t) N = self.___NnN___(s, t)[0] S = self.___SsS___(s, t)[0] W = self.___WwW___(r, t)[0] E = self.___EeE___(r, t)[0] B = self.___BbB___(r, s)[0] F = self.___FfF___(r, s)[0] NW = self.___NW___(t)[0] NE = self.___NE___(t)[0] SW = self.___SW___(t)[0] SE = self.___SE___(t)[0] NB = self.___NB___(s)[0] NF = self.___NF___(s)[0] SB = self.___SB___(s)[0] SF = self.___SF___(s)[0] WB = self.___WB___(r)[0] WF = self.___WF___(r)[0] EB = self.___EB___(r)[0] EF = self.___EF___(r)[0] NWB = self.___N_W_B___[0] NWF = self.___N_W_F___[0] NEB = self.___N_E_B___[0] NEF = self.___N_E_F___[0] SWB = self.___S_W_B___[0] SWF = self.___S_W_F___[0] SEB = self.___S_E_B___[0] SEF = self.___S_E_F___[0] x1 = (1 - r) * N + r * S x2 = (1 - s) * W + s * E x3 = (1 - t) * B + t * F x12 = (1 - r) * (1 - s) * NW + (1 - r) * s * NE + r * (1 - s) * SW + r * s * SE x13 = (1 - r) * (1 - t) * NB + (1 - r) * t * NF + r * (1 - t) * SB + r * t * SF x23 = (1 - s) * (1 - t) * WB + (1 - s) * t * WF + s * (1 - t) * EB + s * t * EF x123 = + (1 - r) * (1 - s) * (1 - t) * NWB \ + (1 - r) * (1 - s) * t * NWF \ + (1 - r) * s * (1 - t) * NEB \ + (1 - r) * s * t * NEF \ + r * (1 - s) * (1 - t) * SWB \ + r * (1 - s) * t * SWF \ + r * s * (1 - t) * SEB \ + r * s * t * SEF X = x1 + x2 + x3 - x12 - x13 - x23 + x123 return X def mapping_Y(self, r, s, t): """ r, s, t be in [0, 1]. """ r, s, t = self.___check_rst___(r, s, t) N = self.___NnN___(s, t)[1] S = self.___SsS___(s, t)[1] W = self.___WwW___(r, t)[1] E = self.___EeE___(r, t)[1] B = self.___BbB___(r, s)[1] F = self.___FfF___(r, s)[1] NW = self.___NW___(t)[1] NE = self.___NE___(t)[1] SW = self.___SW___(t)[1] SE = self.___SE___(t)[1] NB = self.___NB___(s)[1] NF = self.___NF___(s)[1] SB = self.___SB___(s)[1] SF = self.___SF___(s)[1] WB = self.___WB___(r)[1] WF = self.___WF___(r)[1] EB = self.___EB___(r)[1] EF = self.___EF___(r)[1] NWB = self.___N_W_B___[1] NWF = self.___N_W_F___[1] NEB = self.___N_E_B___[1] NEF = self.___N_E_F___[1] SWB = self.___S_W_B___[1] SWF = self.___S_W_F___[1] SEB = self.___S_E_B___[1] SEF = self.___S_E_F___[1] x1 = (1 - r) * N + r * S x2 = (1 - s) * W + s * E x3 = (1 - t) * B + t * F x12 = (1 - r) * (1 - s) * NW + (1 - r) * s * NE + r * (1 - s) * SW + r * s * SE x13 = (1 - r) * (1 - t) * NB + (1 - r) * t * NF + r * (1 - t) * SB + r * t * SF x23 = (1 - s) * (1 - t) * WB + (1 - s) * t * WF + s * (1 - t) * EB + s * t * EF x123 = + (1 - r) * (1 - s) * (1 - t) * NWB \ + (1 - r) * (1 - s) * t * NWF \ + (1 - r) * s * (1 - t) * NEB \ + (1 - r) * s * t * NEF \ + r * (1 - s) * (1 - t) * SWB \ + r * (1 - s) * t * SWF \ + r * s * (1 - t) * SEB \ + r * s * t * SEF Y = x1 + x2 + x3 - x12 - x13 - x23 + x123 return Y def mapping_Z(self, r, s, t): """ r, s, t be in [0, 1]. """ r, s, t = self.___check_rst___(r, s, t) N = self.___NnN___(s, t)[2] S = self.___SsS___(s, t)[2] W = self.___WwW___(r, t)[2] E = self.___EeE___(r, t)[2] B = self.___BbB___(r, s)[2] F = self.___FfF___(r, s)[2] NW = self.___NW___(t)[2] NE = self.___NE___(t)[2] SW = self.___SW___(t)[2] SE = self.___SE___(t)[2] NB = self.___NB___(s)[2] NF = self.___NF___(s)[2] SB = self.___SB___(s)[2] SF = self.___SF___(s)[2] WB = self.___WB___(r)[2] WF = self.___WF___(r)[2] EB = self.___EB___(r)[2] EF = self.___EF___(r)[2] NWB = self.___N_W_B___[2] NWF = self.___N_W_F___[2] NEB = self.___N_E_B___[2] NEF = self.___N_E_F___[2] SWB = self.___S_W_B___[2] SWF = self.___S_W_F___[2] SEB = self.___S_E_B___[2] SEF = self.___S_E_F___[2] x1 = (1 - r) * N + r * S x2 = (1 - s) * W + s * E x3 = (1 - t) * B + t * F x12 = (1 - r) * (1 - s) * NW + (1 - r) * s * NE + r * (1 - s) * SW + r * s * SE x13 = (1 - r) * (1 - t) * NB + (1 - r) * t * NF + r * (1 - t) * SB + r * t * SF x23 = (1 - s) * (1 - t) * WB + (1 - s) * t * WF + s * (1 - t) * EB + s * t * EF x123 = + (1 - r) * (1 - s) * (1 - t) * NWB \ + (1 - r) * (1 - s) * t * NWF \ + (1 - r) * s * (1 - t) * NEB \ + (1 - r) * s * t * NEF \ + r * (1 - s) * (1 - t) * SWB \ + r * (1 - s) * t * SWF \ + r * s * (1 - t) * SEB \ + r * s * t * SEF Z = x1 + x2 + x3 - x12 - x13 - x23 + x123 return Z def Jacobian_matrix(self, r, s, t): """ r, s, t be in [0, 1]. """ r, s, t = self.___check_rst___(r, s, t) _1_ = np.ones(np.shape(r)) N = self.___NnN___(s, t) S = self.___SsS___(s, t) Ns = self.___Ns_Ns___(s, t) Ss = self.___Ss_Ss___(s, t) Nt = self.___Nt_Nt___(s, t) St = self.___St_St___(s, t) W = self.___WwW___(r, t) E = self.___EeE___(r, t) Wr = self.___Wr_Wr___(r, t) Er = self.___Er_Er___(r, t) Wt = self.___Wt_Wt___(r, t) Et = self.___Et_Et___(r, t) B = self.___BbB___(r, s) F = self.___FfF___(r, s) Br = self.___Br_Br___(r, s) Fr = self.___Fr_Fr___(r, s) Bs = self.___Bs_Bs___(r, s) Fs = self.___Fs_Fs___(r, s) NW = self.___NW___(t) NE = self.___NE___(t) SW = self.___SW___(t) SE = self.___SE___(t) NWt = self.___NW_t___(t) NEt = self.___NE_t___(t) SWt = self.___SW_t___(t) SEt = self.___SE_t___(t) NB = self.___NB___(s) NF = self.___NF___(s) SB = self.___SB___(s) SF = self.___SF___(s) NBs = self.___NB_s___(s) NFs = self.___NF_s___(s) SBs = self.___SB_s___(s) SFs = self.___SF_s___(s) WB = self.___WB___(r) WF = self.___WF___(r) EB = self.___EB___(r) EF = self.___EF___(r) WBr = self.___WB_r___(r) WFr = self.___WF_r___(r) EBr = self.___EB_r___(r) EFr = self.___EF_r___(r) NWB = self.___N_W_B___ NWF = self.___N_W_F___ NEB = self.___N_E_B___ NEF = self.___N_E_F___ SWB = self.___S_W_B___ SWF = self.___S_W_F___ SEB = self.___S_E_B___ SEF = self.___S_E_F___ x1 = -_1_ * N + _1_ * S x2 = (1 - s) * Wr + s * Er x3 = (1 - t) * Br + t * Fr x12 = -s * NE - (1 - s) * NW + (1 - s) * SW + s * SE x13 = -t * NF - (1 - t) * NB + (1 - t) * SB + t * SF x23 = (1 - s) * (1 - t) * WBr + (1 - s) * t * WFr + s * (1 - t) * EBr + s * t * EFr x123 = [None, None, None] for i in range(3): x123[i] = - (1 - s) * (1 - t) * NWB[i] \ - (1 - s) * t * NWF[i] \ - s * (1 - t) * NEB[i] \ - s * t * NEF[i] \ + (1 - s) * (1 - t) * SWB[i] \ + (1 - s) * t * SWF[i] \ + s * (1 - t) * SEB[i] \ + s * t * SEF[i] xr, yr, zr = x1 + x2 + x3 - x12 - x13 - x23 + x123 x1 = (1 - r) * Ns + r * Ss x2 = -_1_ * W + _1_ * E x3 = (1 - t) * Bs + t * Fs x12 = -(1 - r) * NW + (1 - r) * NE - r * SW + r * SE x13 = (1 - r) * (1 - t) * NBs + (1 - r) * t * NFs + r * (1 - t) * SBs + r * t * SFs x23 = -t * WF - (1 - t) * WB + (1 - t) * EB + t * EF x123 = [None, None, None] for i in range(3): x123[i] = - (1 - r) * (1 - t) * NWB[i] \ - (1 - r) * t * NWF[i] \ + (1 - r) * (1 - t) * NEB[i] \ + (1 - r) * t * NEF[i] \ - r * (1 - t) * SWB[i] \ - r * t * SWF[i] \ + r * (1 - t) * SEB[i] \ + r * t * SEF[i] xs, ys, zs = x1 + x2 + x3 - x12 - x13 - x23 + x123 x1 = (1 - r) * Nt + r * St x2 = (1 - s) * Wt + s * Et x3 = -_1_ * B + _1_ * F x12 = (1 - r) * (1 - s) * NWt + (1 - r) * s * NEt + r * (1 - s) * SWt + r * s * SEt x13 = -(1 - r) * NB + (1 - r) * NF - r * SB + r * SF x23 = -(1 - s) * WB + (1 - s) * WF - s * EB + s * EF x123 = [None, None, None] for i in range(3): x123[i] = - (1 - r) * (1 - s) * NWB[i] \ + (1 - r) * (1 - s) * NWF[i] \ - (1 - r) * s * NEB[i] \ + (1 - r) * s * NEF[i] \ - r * (1 - s) * SWB[i] \ + r * (1 - s) * SWF[i] \ - r * s * SEB[i] \ + r * s * SEF[i] xt, yt, zt = x1 + x2 + x3 - x12 - x13 - x23 + x123 return ((xr, xs, xt), (yr, ys, yt), (zr, zs, zt)) def Jacobian_Xr(self, r, s, t): """ r, s, t be in [0, 1]. """ r, s, t = self.___check_rst___(r, s, t) _1_ = np.ones(np.shape(r)) N = self.___NnN___(s, t)[0] S = self.___SsS___(s, t)[0] Wr = self.___Wr_Wr___(r, t)[0] Er = self.___Er_Er___(r, t)[0] Br = self.___Br_Br___(r, s)[0] Fr = self.___Fr_Fr___(r, s)[0] NW = self.___NW___(t)[0] NE = self.___NE___(t)[0] SW = self.___SW___(t)[0] SE = self.___SE___(t)[0] NB = self.___NB___(s)[0] NF = self.___NF___(s)[0] SB = self.___SB___(s)[0] SF = self.___SF___(s)[0] WBr = self.___WB_r___(r)[0] WFr = self.___WF_r___(r)[0] EBr = self.___EB_r___(r)[0] EFr = self.___EF_r___(r)[0] NWB = self.___N_W_B___[0] NWF = self.___N_W_F___[0] NEB = self.___N_E_B___[0] NEF = self.___N_E_F___[0] SWB = self.___S_W_B___[0] SWF = self.___S_W_F___[0] SEB = self.___S_E_B___[0] SEF = self.___S_E_F___[0] x1 = -_1_ * N + _1_ * S x2 = (1 - s) * Wr + s * Er x3 = (1 - t) * Br + t * Fr x12 = -s * NE - (1 - s) * NW + (1 - s) * SW + s * SE x13 = -t * NF - (1 - t) * NB + (1 - t) * SB + t * SF x23 = (1 - s) * (1 - t) * WBr + (1 - s) * t * WFr + s * (1 - t) * EBr + s * t * EFr x123 = - (1 - s) * (1 - t) * NWB \ - (1 - s) * t * NWF \ - s * (1 - t) * NEB \ - s * t * NEF \ + (1 - s) * (1 - t) * SWB \ + (1 - s) * t * SWF \ + s * (1 - t) * SEB \ + s * t * SEF xr = x1 + x2 + x3 - x12 - x13 - x23 + x123 return xr def Jacobian_Xs(self, r, s, t): """ r, s, t be in [0, 1]. """ r, s, t = self.___check_rst___(r, s, t) _1_ = np.ones(np.shape(r)) Ns = self.___Ns_Ns___(s, t)[0] Ss = self.___Ss_Ss___(s, t)[0] W = self.___WwW___(r, t)[0] E = self.___EeE___(r, t)[0] Bs = self.___Bs_Bs___(r, s)[0] Fs = self.___Fs_Fs___(r, s)[0] NW = self.___NW___(t)[0] NE = self.___NE___(t)[0] SW = self.___SW___(t)[0] SE = self.___SE___(t)[0] NBs = self.___NB_s___(s)[0] NFs = self.___NF_s___(s)[0] SBs = self.___SB_s___(s)[0] SFs = self.___SF_s___(s)[0] WB = self.___WB___(r)[0] WF = self.___WF___(r)[0] EB = self.___EB___(r)[0] EF = self.___EF___(r)[0] NWB = self.___N_W_B___[0] NWF = self.___N_W_F___[0] NEB = self.___N_E_B___[0] NEF = self.___N_E_F___[0] SWB = self.___S_W_B___[0] SWF = self.___S_W_F___[0] SEB = self.___S_E_B___[0] SEF = self.___S_E_F___[0] x1 = (1 - r) * Ns + r * Ss x2 = -_1_ * W + _1_ * E x3 = (1 - t) * Bs + t * Fs x12 = -(1 - r) * NW + (1 - r) * NE - r * SW + r * SE x13 = (1 - r) * (1 - t) * NBs + (1 - r) * t * NFs + r * (1 - t) * SBs + r * t * SFs x23 = -t * WF - (1 - t) * WB + (1 - t) * EB + t * EF x123 = - (1 - r) * (1 - t) * NWB \ - (1 - r) * t * NWF \ + (1 - r) * (1 - t) * NEB \ + (1 - r) * t * NEF \ - r * (1 - t) * SWB \ - r * t * SWF \ + r * (1 - t) * SEB \ + r * t * SEF xs = x1 + x2 + x3 - x12 - x13 - x23 + x123 return xs def Jacobian_Xt(self, r, s, t): """ r, s, t be in [0, 1]. """ r, s, t = self.___check_rst___(r, s, t) _1_ = np.ones(np.shape(r)) Nt = self.___Nt_Nt___(s, t)[0] St = self.___St_St___(s, t)[0] Wt = self.___Wt_Wt___(r, t)[0] Et = self.___Et_Et___(r, t)[0] B = self.___BbB___(r, s)[0] F = self.___FfF___(r, s)[0] NWt = self.___NW_t___(t)[0] NEt = self.___NE_t___(t)[0] SWt = self.___SW_t___(t)[0] SEt = self.___SE_t___(t)[0] NB = self.___NB___(s)[0] NF = self.___NF___(s)[0] SB = self.___SB___(s)[0] SF = self.___SF___(s)[0] WB = self.___WB___(r)[0] WF = self.___WF___(r)[0] EB = self.___EB___(r)[0] EF = self.___EF___(r)[0] NWB = self.___N_W_B___[0] NWF = self.___N_W_F___[0] NEB = self.___N_E_B___[0] NEF = self.___N_E_F___[0] SWB = self.___S_W_B___[0] SWF = self.___S_W_F___[0] SEB = self.___S_E_B___[0] SEF = self.___S_E_F___[0] x1 = (1 - r) * Nt + r * St x2 = (1 - s) * Wt + s * Et x3 = -_1_ * B + _1_ * F x12 = (1 - r) * (1 - s) * NWt + (1 - r) * s * NEt + r * (1 - s) * SWt + r * s * SEt x13 = -(1 - r) * NB + (1 - r) * NF - r * SB + r * SF x23 = -(1 - s) * WB + (1 - s) * WF - s * EB + s * EF x123 = - (1 - r) * (1 - s) * NWB \ + (1 - r) * (1 - s) * NWF \ - (1 - r) * s * NEB \ + (1 - r) * s * NEF \ - r * (1 - s) * SWB \ + r * (1 - s) * SWF \ - r * s * SEB \ + r * s * SEF xt = x1 + x2 + x3 - x12 - x13 - x23 + x123 return xt def Jacobian_Yr(self, r, s, t): """ r, s, t be in [0, 1]. """ r, s, t = self.___check_rst___(r, s, t) _1_ = np.ones(np.shape(r)) N = self.___NnN___(s, t)[1] S = self.___SsS___(s, t)[1] Wr = self.___Wr_Wr___(r, t)[1] Er = self.___Er_Er___(r, t)[1] Br = self.___Br_Br___(r, s)[1] Fr = self.___Fr_Fr___(r, s)[1] NW = self.___NW___(t)[1] NE = self.___NE___(t)[1] SW = self.___SW___(t)[1] SE = self.___SE___(t)[1] NB = self.___NB___(s)[1] NF = self.___NF___(s)[1] SB = self.___SB___(s)[1] SF = self.___SF___(s)[1] WBr = self.___WB_r___(r)[1] WFr = self.___WF_r___(r)[1] EBr = self.___EB_r___(r)[1] EFr = self.___EF_r___(r)[1] NWB = self.___N_W_B___[1] NWF = self.___N_W_F___[1] NEB = self.___N_E_B___[1] NEF = self.___N_E_F___[1] SWB = self.___S_W_B___[1] SWF = self.___S_W_F___[1] SEB = self.___S_E_B___[1] SEF = self.___S_E_F___[1] x1 = -_1_ * N + _1_ * S x2 = (1 - s) * Wr + s * Er x3 = (1 - t) * Br + t * Fr x12 = -s * NE - (1 - s) * NW + (1 - s) * SW + s * SE x13 = -t * NF - (1 - t) * NB + (1 - t) * SB + t * SF x23 = (1 - s) * (1 - t) * WBr + (1 - s) * t * WFr + s * (1 - t) * EBr + s * t * EFr x123 = - (1 - s) * (1 - t) * NWB \ - (1 - s) * t * NWF \ - s * (1 - t) * NEB \ - s * t * NEF \ + (1 - s) * (1 - t) * SWB \ + (1 - s) * t * SWF \ + s * (1 - t) * SEB \ + s * t * SEF yr = x1 + x2 + x3 - x12 - x13 - x23 + x123 return yr def Jacobian_Ys(self, r, s, t): """ r, s, t be in [0, 1]. """ r, s, t = self.___check_rst___(r, s, t) _1_ = np.ones(np.shape(r)) Ns = self.___Ns_Ns___(s, t)[1] Ss = self.___Ss_Ss___(s, t)[1] W = self.___WwW___(r, t)[1] E = self.___EeE___(r, t)[1] Bs = self.___Bs_Bs___(r, s)[1] Fs = self.___Fs_Fs___(r, s)[1] NW = self.___NW___(t)[1] NE = self.___NE___(t)[1] SW = self.___SW___(t)[1] SE = self.___SE___(t)[1] NBs = self.___NB_s___(s)[1] NFs = self.___NF_s___(s)[1] SBs = self.___SB_s___(s)[1] SFs = self.___SF_s___(s)[1] WB = self.___WB___(r)[1] WF = self.___WF___(r)[1] EB = self.___EB___(r)[1] EF = self.___EF___(r)[1] NWB = self.___N_W_B___[1] NWF = self.___N_W_F___[1] NEB = self.___N_E_B___[1] NEF = self.___N_E_F___[1] SWB = self.___S_W_B___[1] SWF = self.___S_W_F___[1] SEB = self.___S_E_B___[1] SEF = self.___S_E_F___[1] x1 = (1 - r) * Ns + r * Ss x2 = -_1_ * W + _1_ * E x3 = (1 - t) * Bs + t * Fs x12 = -(1 - r) * NW + (1 - r) * NE - r * SW + r * SE x13 = (1 - r) * (1 - t) * NBs + (1 - r) * t * NFs + r * (1 - t) * SBs + r * t * SFs x23 = -t * WF - (1 - t) * WB + (1 - t) * EB + t * EF x123 = - (1 - r) * (1 - t) * NWB \ - (1 - r) * t * NWF \ + (1 - r) * (1 - t) * NEB \ + (1 - r) * t * NEF \ - r * (1 - t) * SWB \ - r * t * SWF \ + r * (1 - t) * SEB \ + r * t * SEF ys = x1 + x2 + x3 - x12 - x13 - x23 + x123 return ys def Jacobian_Yt(self, r, s, t): """ r, s, t be in [0, 1]. """ r, s, t = self.___check_rst___(r, s, t) _1_ = np.ones(np.shape(r)) Nt = self.___Nt_Nt___(s, t)[1] St = self.___St_St___(s, t)[1] Wt = self.___Wt_Wt___(r, t)[1] Et = self.___Et_Et___(r, t)[1] B = self.___BbB___(r, s)[1] F = self.___FfF___(r, s)[1] NWt = self.___NW_t___(t)[1] NEt = self.___NE_t___(t)[1] SWt = self.___SW_t___(t)[1] SEt = self.___SE_t___(t)[1] NB = self.___NB___(s)[1] NF = self.___NF___(s)[1] SB = self.___SB___(s)[1] SF = self.___SF___(s)[1] WB = self.___WB___(r)[1] WF = self.___WF___(r)[1] EB = self.___EB___(r)[1] EF = self.___EF___(r)[1] NWB = self.___N_W_B___[1] NWF = self.___N_W_F___[1] NEB = self.___N_E_B___[1] NEF = self.___N_E_F___[1] SWB = self.___S_W_B___[1] SWF = self.___S_W_F___[1] SEB = self.___S_E_B___[1] SEF = self.___S_E_F___[1] x1 = (1 - r) * Nt + r * St x2 = (1 - s) * Wt + s * Et x3 = -_1_ * B + _1_ * F x12 = (1 - r) * (1 - s) * NWt + (1 - r) * s * NEt + r * (1 - s) * SWt + r * s * SEt x13 = -(1 - r) * NB + (1 - r) * NF - r * SB + r * SF x23 = -(1 - s) * WB + (1 - s) * WF - s * EB + s * EF x123 = - (1 - r) * (1 - s) * NWB \ + (1 - r) * (1 - s) * NWF \ - (1 - r) * s * NEB \ + (1 - r) * s * NEF \ - r * (1 - s) * SWB \ + r * (1 - s) * SWF \ - r * s * SEB \ + r * s * SEF yt = x1 + x2 + x3 - x12 - x13 - x23 + x123 return yt def Jacobian_Zr(self, r, s, t): """ r, s, t be in [0, 1]. """ r, s, t = self.___check_rst___(r, s, t) _1_ = np.ones(np.shape(r)) N = self.___NnN___(s, t)[2] S = self.___SsS___(s, t)[2] Wr = self.___Wr_Wr___(r, t)[2] Er = self.___Er_Er___(r, t)[2] Br = self.___Br_Br___(r, s)[2] Fr = self.___Fr_Fr___(r, s)[2] NW = self.___NW___(t)[2] NE = self.___NE___(t)[2] SW = self.___SW___(t)[2] SE = self.___SE___(t)[2] NB = self.___NB___(s)[2] NF = self.___NF___(s)[2] SB = self.___SB___(s)[2] SF = self.___SF___(s)[2] WBr = self.___WB_r___(r)[2] WFr = self.___WF_r___(r)[2] EBr = self.___EB_r___(r)[2] EFr = self.___EF_r___(r)[2] NWB = self.___N_W_B___[2] NWF = self.___N_W_F___[2] NEB = self.___N_E_B___[2] NEF = self.___N_E_F___[2] SWB = self.___S_W_B___[2] SWF = self.___S_W_F___[2] SEB = self.___S_E_B___[2] SEF = self.___S_E_F___[2] x1 = -_1_ * N + _1_ * S x2 = (1 - s) * Wr + s * Er x3 = (1 - t) * Br + t * Fr x12 = -s * NE - (1 - s) * NW + (1 - s) * SW + s * SE x13 = -t * NF - (1 - t) * NB + (1 - t) * SB + t * SF x23 = (1 - s) * (1 - t) * WBr + (1 - s) * t * WFr + s * (1 - t) * EBr + s * t * EFr x123 = - (1 - s) * (1 - t) * NWB \ - (1 - s) * t * NWF \ - s * (1 - t) * NEB \ - s * t * NEF \ + (1 - s) * (1 - t) * SWB \ + (1 - s) * t * SWF \ + s * (1 - t) * SEB \ + s * t * SEF zr = x1 + x2 + x3 - x12 - x13 - x23 + x123 return zr def Jacobian_Zs(self, r, s, t): """ r, s, t be in [0, 1]. """ r, s, t = self.___check_rst___(r, s, t) _1_ = np.ones(np.shape(r)) Ns = self.___Ns_Ns___(s, t)[2] Ss = self.___Ss_Ss___(s, t)[2] W = self.___WwW___(r, t)[2] E = self.___EeE___(r, t)[2] Bs = self.___Bs_Bs___(r, s)[2] Fs = self.___Fs_Fs___(r, s)[2] NW = self.___NW___(t)[2] NE = self.___NE___(t)[2] SW = self.___SW___(t)[2] SE = self.___SE___(t)[2] NBs = self.___NB_s___(s)[2] NFs = self.___NF_s___(s)[2] SBs = self.___SB_s___(s)[2] SFs = self.___SF_s___(s)[2] WB = self.___WB___(r)[2] WF = self.___WF___(r)[2] EB = self.___EB___(r)[2] EF = self.___EF___(r)[2] NWB = self.___N_W_B___[2] NWF = self.___N_W_F___[2] NEB = self.___N_E_B___[2] NEF = self.___N_E_F___[2] SWB = self.___S_W_B___[2] SWF = self.___S_W_F___[2] SEB = self.___S_E_B___[2] SEF = self.___S_E_F___[2] x1 = (1 - r) * Ns + r * Ss x2 = -_1_ * W + _1_ * E x3 = (1 - t) * Bs + t * Fs x12 = -(1 - r) * NW + (1 - r) * NE - r * SW + r * SE x13 = (1 - r) * (1 - t) * NBs + (1 - r) * t * NFs + r * (1 - t) * SBs + r * t * SFs x23 = -t * WF - (1 - t) * WB + (1 - t) * EB + t * EF x123 = - (1 - r) * (1 - t) * NWB \ - (1 - r) * t * NWF \ + (1 - r) * (1 - t) * NEB \ + (1 - r) * t * NEF \ - r * (1 - t) * SWB \ - r * t * SWF \ + r * (1 - t) * SEB \ + r * t * SEF zs = x1 + x2 + x3 - x12 - x13 - x23 + x123 return zs def Jacobian_Zt(self, r, s, t): """ r, s, t be in [0, 1]. """ r, s, t = self.___check_rst___(r, s, t) _1_ = np.ones(np.shape(r)) Nt = self.___Nt_Nt___(s, t)[2] St = self.___St_St___(s, t)[2] Wt = self.___Wt_Wt___(r, t)[2] Et = self.___Et_Et___(r, t)[2] B = self.___BbB___(r, s)[2] F = self.___FfF___(r, s)[2] NWt = self.___NW_t___(t)[2] NEt = self.___NE_t___(t)[2] SWt = self.___SW_t___(t)[2] SEt = self.___SE_t___(t)[2] NB = self.___NB___(s)[2] NF = self.___NF___(s)[2] SB = self.___SB___(s)[2] SF = self.___SF___(s)[2] WB = self.___WB___(r)[2] WF = self.___WF___(r)[2] EB = self.___EB___(r)[2] EF = self.___EF___(r)[2] NWB = self.___N_W_B___[2] NWF = self.___N_W_F___[2] NEB = self.___N_E_B___[2] NEF = self.___N_E_F___[2] SWB = self.___S_W_B___[2] SWF = self.___S_W_F___[2] SEB = self.___S_E_B___[2] SEF = self.___S_E_F___[2] x1 = (1 - r) * Nt + r * St x2 = (1 - s) * Wt + s * Et x3 = -_1_ * B + _1_ * F x12 = (1 - r) * (1 - s) * NWt + (1 - r) * s * NEt + r * (1 - s) * SWt + r * s * SEt x13 = -(1 - r) * NB + (1 - r) * NF - r * SB + r * SF x23 = -(1 - s) * WB + (1 - s) * WF - s * EB + s * EF x123 = - (1 - r) * (1 - s) * NWB \ + (1 - r) * (1 - s) * NWF \ - (1 - r) * s * NEB \ + (1 - r) * s * NEF \ - r * (1 - s) * SWB \ + r * (1 - s) * SWF \ - r * s * SEB \ + r * s * SEF zt = x1 + x2 + x3 - x12 - x13 - x23 + x123 return zt def Jacobian_X_(self, r, s, t): return self.Jacobian_Xr(r, s, t), self.Jacobian_Xs(r, s, t), self.Jacobian_Xt(r, s, t) def Jacobian_Y_(self, r, s, t): return self.Jacobian_Yr(r, s, t), self.Jacobian_Ys(r, s, t), self.Jacobian_Yt(r, s, t) def Jacobian_Z_(self, r, s, t): return self.Jacobian_Zr(r, s, t), self.Jacobian_Zs(r, s, t), self.Jacobian_Zt(r, s, t) def ___NnN___(self, s, t): return (self._region_._side_geometries_['N'].X(s, t), self._region_._side_geometries_['N'].Y(s, t), self._region_._side_geometries_['N'].Z(s, t)) def ___Ns_Ns___(self, s, t): return (self._region_._side_geometries_['N'].Xp(s, t), self._region_._side_geometries_['N'].Yp(s, t), self._region_._side_geometries_['N'].Zp(s, t)) def ___Nt_Nt___(self, s, t): return (self._region_._side_geometries_['N'].Xq(s, t), self._region_._side_geometries_['N'].Yq(s, t), self._region_._side_geometries_['N'].Zq(s, t)) def ___SsS___(self, s, t): return (self._region_._side_geometries_['S'].X(s, t), self._region_._side_geometries_['S'].Y(s, t), self._region_._side_geometries_['S'].Z(s, t)) def ___Ss_Ss___(self, s, t): return (self._region_._side_geometries_['S'].Xp(s, t), self._region_._side_geometries_['S'].Yp(s, t), self._region_._side_geometries_['S'].Zp(s, t)) def ___St_St___(self, s, t): return (self._region_._side_geometries_['S'].Xq(s, t), self._region_._side_geometries_['S'].Yq(s, t), self._region_._side_geometries_['S'].Zq(s, t)) def ___WwW___(self, r, t): return (self._region_._side_geometries_['W'].X(r, t), self._region_._side_geometries_['W'].Y(r, t), self._region_._side_geometries_['W'].Z(r, t)) def ___Wr_Wr___(self, r, t): return (self._region_._side_geometries_['W'].Xp(r, t), self._region_._side_geometries_['W'].Yp(r, t), self._region_._side_geometries_['W'].Zp(r, t)) def ___Wt_Wt___(self, r, t): return (self._region_._side_geometries_['W'].Xq(r, t), self._region_._side_geometries_['W'].Yq(r, t), self._region_._side_geometries_['W'].Zq(r, t)) def ___EeE___(self, r, t): return (self._region_._side_geometries_['E'].X(r, t), self._region_._side_geometries_['E'].Y(r, t), self._region_._side_geometries_['E'].Z(r, t)) def ___Er_Er___(self, r, t): return (self._region_._side_geometries_['E'].Xp(r, t), self._region_._side_geometries_['E'].Yp(r, t), self._region_._side_geometries_['E'].Zp(r, t)) def ___Et_Et___(self, r, t): return (self._region_._side_geometries_['E'].Xq(r, t), self._region_._side_geometries_['E'].Yq(r, t), self._region_._side_geometries_['E'].Zq(r, t)) def ___BbB___(self, r, s): return (self._region_._side_geometries_['B'].X(r, s), self._region_._side_geometries_['B'].Y(r, s), self._region_._side_geometries_['B'].Z(r, s)) def ___Br_Br___(self, r, s): return (self._region_._side_geometries_['B'].Xp(r, s), self._region_._side_geometries_['B'].Yp(r, s), self._region_._side_geometries_['B'].Zp(r, s)) def ___Bs_Bs___(self, r, s): return (self._region_._side_geometries_['B'].Xq(r, s), self._region_._side_geometries_['B'].Yq(r, s), self._region_._side_geometries_['B'].Zq(r, s)) def ___FfF___(self, r, s): return (self._region_._side_geometries_['F'].X(r, s), self._region_._side_geometries_['F'].Y(r, s), self._region_._side_geometries_['F'].Z(r, s)) def ___Fr_Fr___(self, r, s): return (self._region_._side_geometries_['F'].Xp(r, s), self._region_._side_geometries_['F'].Yp(r, s), self._region_._side_geometries_['F'].Zp(r, s)) def ___Fs_Fs___(self, r, s): return (self._region_._side_geometries_['F'].Xq(r, s), self._region_._side_geometries_['F'].Yq(r, s), self._region_._side_geometries_['F'].Zq(r, s)) def ___NW___(self, t): return (self._region_._side_geometries_['N'].X(0, t), self._region_._side_geometries_['N'].Y(0, t), self._region_._side_geometries_['N'].Z(0, t)) def ___NW_t___(self, t): return (self._region_._side_geometries_['N'].Xq(0, t), self._region_._side_geometries_['N'].Yq(0, t), self._region_._side_geometries_['N'].Zq(0, t)) def ___NE___(self, t): return (self._region_._side_geometries_['N'].X(1, t), self._region_._side_geometries_['N'].Y(1, t), self._region_._side_geometries_['N'].Z(1, t)) def ___NE_t___(self, t): return (self._region_._side_geometries_['N'].Xq(1, t), self._region_._side_geometries_['N'].Yq(1, t), self._region_._side_geometries_['N'].Zq(1, t)) def ___NB___(self, s): return (self._region_._side_geometries_['N'].X(s, 0), self._region_._side_geometries_['N'].Y(s, 0), self._region_._side_geometries_['N'].Z(s, 0)) def ___NB_s___(self, s): return (self._region_._side_geometries_['N'].Xp(s, 0), self._region_._side_geometries_['N'].Yp(s, 0), self._region_._side_geometries_['N'].Zp(s, 0)) def ___NF___(self, s): return (self._region_._side_geometries_['N'].X(s, 1), self._region_._side_geometries_['N'].Y(s, 1), self._region_._side_geometries_['N'].Z(s, 1)) def ___NF_s___(self, s): return (self._region_._side_geometries_['N'].Xp(s, 1), self._region_._side_geometries_['N'].Yp(s, 1), self._region_._side_geometries_['N'].Zp(s, 1)) def ___SW___(self, t): return (self._region_._side_geometries_['S'].X(0, t), self._region_._side_geometries_['S'].Y(0, t), self._region_._side_geometries_['S'].Z(0, t)) def ___SW_t___(self, t): return (self._region_._side_geometries_['S'].Xq(0, t), self._region_._side_geometries_['S'].Yq(0, t), self._region_._side_geometries_['S'].Zq(0, t)) def ___SE___(self, t): return (self._region_._side_geometries_['S'].X(1, t), self._region_._side_geometries_['S'].Y(1, t), self._region_._side_geometries_['S'].Z(1, t)) def ___SE_t___(self, t): return (self._region_._side_geometries_['S'].Xq(1, t), self._region_._side_geometries_['S'].Yq(1, t), self._region_._side_geometries_['S'].Zq(1, t)) def ___SB___(self, s): return (self._region_._side_geometries_['S'].X(s, 0), self._region_._side_geometries_['S'].Y(s, 0), self._region_._side_geometries_['S'].Z(s, 0)) def ___SB_s___(self, s): return (self._region_._side_geometries_['S'].Xp(s, 0), self._region_._side_geometries_['S'].Yp(s, 0), self._region_._side_geometries_['S'].Zp(s, 0)) def ___SF___(self, s): return (self._region_._side_geometries_['S'].X(s, 1), self._region_._side_geometries_['S'].Y(s, 1), self._region_._side_geometries_['S'].Z(s, 1)) def ___SF_s___(self, s): return (self._region_._side_geometries_['S'].Xp(s, 1), self._region_._side_geometries_['S'].Yp(s, 1), self._region_._side_geometries_['S'].Zp(s, 1)) def ___WN___(self, t): return (self._region_._side_geometries_['W'].X(0, t), self._region_._side_geometries_['W'].Y(0, t), self._region_._side_geometries_['W'].Z(0, t)) def ___WS___(self, t): return (self._region_._side_geometries_['W'].X(1, t), self._region_._side_geometries_['W'].Y(1, t), self._region_._side_geometries_['W'].Z(1, t)) def ___WB___(self, r): return (self._region_._side_geometries_['W'].X(r, 0), self._region_._side_geometries_['W'].Y(r, 0), self._region_._side_geometries_['W'].Z(r, 0)) def ___WB_r___(self, r): return (self._region_._side_geometries_['W'].Xp(r, 0), self._region_._side_geometries_['W'].Yp(r, 0), self._region_._side_geometries_['W'].Zp(r, 0)) def ___WF___(self, r): return (self._region_._side_geometries_['W'].X(r, 1), self._region_._side_geometries_['W'].Y(r, 1), self._region_._side_geometries_['W'].Z(r, 1)) def ___WF_r___(self, r): return (self._region_._side_geometries_['W'].Xp(r, 1), self._region_._side_geometries_['W'].Yp(r, 1), self._region_._side_geometries_['W'].Zp(r, 1)) def ___EN___(self, t): return (self._region_._side_geometries_['E'].X(0, t), self._region_._side_geometries_['E'].Y(0, t), self._region_._side_geometries_['E'].Z(0, t)) def ___ES___(self, t): return (self._region_._side_geometries_['E'].X(1, t), self._region_._side_geometries_['E'].Y(1, t), self._region_._side_geometries_['E'].Z(1, t)) def ___EB___(self, r): return (self._region_._side_geometries_['E'].X(r, 0), self._region_._side_geometries_['E'].Y(r, 0), self._region_._side_geometries_['E'].Z(r, 0)) def ___EB_r___(self, r): return (self._region_._side_geometries_['E'].Xp(r, 0), self._region_._side_geometries_['E'].Yp(r, 0), self._region_._side_geometries_['E'].Zp(r, 0)) def ___EF___(self, r): return (self._region_._side_geometries_['E'].X(r, 1), self._region_._side_geometries_['E'].Y(r, 1), self._region_._side_geometries_['E'].Z(r, 1)) def ___EF_r___(self, r): return (self._region_._side_geometries_['E'].Xp(r, 1), self._region_._side_geometries_['E'].Yp(r, 1), self._region_._side_geometries_['E'].Zp(r, 1)) def ___BN___(self, s): return (self._region_._side_geometries_['B'].X(0, s), self._region_._side_geometries_['B'].Y(0, s), self._region_._side_geometries_['B'].Z(0, s)) def ___BS___(self, s): return (self._region_._side_geometries_['B'].X(1, s), self._region_._side_geometries_['B'].Y(1, s), self._region_._side_geometries_['B'].Z(1, s)) def ___BW___(self, r): return (self._region_._side_geometries_['B'].X(r, 0), self._region_._side_geometries_['B'].Y(r, 0), self._region_._side_geometries_['B'].Z(r, 0)) def ___BE___(self, r): return (self._region_._side_geometries_['B'].X(r, 1), self._region_._side_geometries_['B'].Y(r, 1), self._region_._side_geometries_['B'].Z(r, 1)) def ___FN___(self, s): return (self._region_._side_geometries_['F'].X(0, s), self._region_._side_geometries_['F'].Y(0, s), self._region_._side_geometries_['F'].Z(0, s)) def ___FS___(self, s): return (self._region_._side_geometries_['F'].X(1, s), self._region_._side_geometries_['F'].Y(1, s), self._region_._side_geometries_['F'].Z(1, s)) def ___FW___(self, r): return (self._region_._side_geometries_['F'].X(r, 0), self._region_._side_geometries_['F'].Y(r, 0), self._region_._side_geometries_['F'].Z(r, 0)) def ___FE___(self, r): return (self._region_._side_geometries_['F'].X(r, 1), self._region_._side_geometries_['F'].Y(r, 1), self._region_._side_geometries_['F'].Z(r, 1)) @property def ___N_W_B___(self): return (self._region_._side_geometries_['N'].X(0, 0), self._region_._side_geometries_['N'].Y(0, 0), self._region_._side_geometries_['N'].Z(0, 0)) @property def ___N_W_F___(self): return (self._region_._side_geometries_['N'].X(0, 1), self._region_._side_geometries_['N'].Y(0, 1), self._region_._side_geometries_['N'].Z(0, 1)) @property def ___N_E_B___(self): return (self._region_._side_geometries_['N'].X(1, 0), self._region_._side_geometries_['N'].Y(1, 0), self._region_._side_geometries_['N'].Z(1, 0)) @property def ___N_E_F___(self): return (self._region_._side_geometries_['N'].X(1, 1), self._region_._side_geometries_['N'].Y(1, 1), self._region_._side_geometries_['N'].Z(1, 1)) @property def ___S_W_B___(self): return (self._region_._side_geometries_['S'].X(0, 0), self._region_._side_geometries_['S'].Y(0, 0), self._region_._side_geometries_['S'].Z(0, 0)) @property def ___S_W_F___(self): return (self._region_._side_geometries_['S'].X(0, 1), self._region_._side_geometries_['S'].Y(0, 1), self._region_._side_geometries_['S'].Z(0, 1)) @property def ___S_E_B___(self): return (self._region_._side_geometries_['S'].X(1, 0), self._region_._side_geometries_['S'].Y(1, 0), self._region_._side_geometries_['S'].Z(1, 0)) @property def ___S_E_F___(self): return (self._region_._side_geometries_['S'].X(1, 1), self._region_._side_geometries_['S'].Y(1, 1), self._region_._side_geometries_['S'].Z(1, 1))
35.576205
94
0.469039
6,802
45,751
2.481623
0.032343
0.165047
0.233412
0.277251
0.854443
0.788626
0.755273
0.520557
0.504384
0.415699
0
0.043249
0.358659
45,751
1,286
95
35.576205
0.532036
0.015803
0
0.518119
0
0
0.008924
0.000535
0
0
0
0
0.01665
1
0.080313
false
0
0.004897
0.063663
0.163565
0
0
0
0
null
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
33728260ea45a2ad8fd5c4a895fb7e069cc0bc54
116
py
Python
other/soundhound2018_summer_qual_a.py
ryosuke0825/atcoder_python
185cdbe7db44ecca1aaf357858d16d31ce515ddb
[ "MIT" ]
null
null
null
other/soundhound2018_summer_qual_a.py
ryosuke0825/atcoder_python
185cdbe7db44ecca1aaf357858d16d31ce515ddb
[ "MIT" ]
null
null
null
other/soundhound2018_summer_qual_a.py
ryosuke0825/atcoder_python
185cdbe7db44ecca1aaf357858d16d31ce515ddb
[ "MIT" ]
null
null
null
a, b = map(int, input().split()) if a + b == 15: print('+') elif a*b == 15: print('*') else: print('x')
14.5
32
0.448276
19
116
2.736842
0.631579
0.115385
0.153846
0.346154
0
0
0
0
0
0
0
0.047059
0.267241
116
7
33
16.571429
0.564706
0
0
0
0
0
0.025862
0
0
0
0
0
0
1
0
true
0
0
0
0
0.428571
1
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
5
681f7a5bdb8ef670ef2a9f9a2390be4eb9cfff97
64
py
Python
outlook_msg/__init__.py
hiendang/outlook_msg
c151ada05a09cc45e5c6492432be851f935c52b2
[ "Apache-2.0" ]
17
2018-11-14T21:06:23.000Z
2021-12-10T13:01:53.000Z
outlook_msg/__init__.py
hiendang/outlook_msg
c151ada05a09cc45e5c6492432be851f935c52b2
[ "Apache-2.0" ]
3
2019-06-26T13:32:10.000Z
2021-11-10T05:39:01.000Z
outlook_msg/__init__.py
hiendang/outlook_msg
c151ada05a09cc45e5c6492432be851f935c52b2
[ "Apache-2.0" ]
6
2020-07-23T08:10:32.000Z
2021-12-10T12:20:52.000Z
from .message import Message from .attachment import Attachment
21.333333
34
0.84375
8
64
6.75
0.5
0
0
0
0
0
0
0
0
0
0
0
0.125
64
2
35
32
0.964286
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
681fe1172597970c2192168c8591e4758fb04d4e
132
py
Python
cases/1.py
minakoyang/YY_python2.7_interpreter_in_CPP
e949f4bbd27752e6dbfef0a887d9567345d512f4
[ "MIT" ]
1
2019-04-30T16:27:19.000Z
2019-04-30T16:27:19.000Z
cases/1.py
minakoyang/YY_python2.7_interpreter_in_CPP
e949f4bbd27752e6dbfef0a887d9567345d512f4
[ "MIT" ]
null
null
null
cases/1.py
minakoyang/YY_python2.7_interpreter_in_CPP
e949f4bbd27752e6dbfef0a887d9567345d512f4
[ "MIT" ]
null
null
null
x = 10 print 2*x + 5*x y = 7 print 2*x - y print 2*y - 2*x print 2*x - 2 * y print x * 5*y print x/y print 5*x/2*y print 5*y/2*x
10.153846
17
0.55303
40
132
1.825
0.175
0.136986
0.287671
0.219178
0
0
0
0
0
0
0
0.157895
0.280303
132
12
18
11
0.610526
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0.8
0
0
1
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
1
0
5
68530c51130f01971842ceb416cf1540f66f94ba
80
py
Python
adie/tests/__init__.py
willstrawson/adie_ongoingthoughts
a9ba9e8e4326fd528db72eac8ed5cc932fc490b5
[ "MIT" ]
1
2021-06-04T15:39:14.000Z
2021-06-04T15:39:14.000Z
adie/tests/__init__.py
willstrawson/adie_ongoingthoughts
a9ba9e8e4326fd528db72eac8ed5cc932fc490b5
[ "MIT" ]
27
2020-11-30T11:13:00.000Z
2021-05-02T07:58:37.000Z
adie/tests/__init__.py
willstrawson/adie_ongoingthoughts
a9ba9e8e4326fd528db72eac8ed5cc932fc490b5
[ "MIT" ]
4
2020-11-27T13:49:31.000Z
2021-04-28T15:51:09.000Z
from .utils import get_test_data_path __all__ = [ "get_test_data_path", ]
11.428571
37
0.725
12
80
4
0.666667
0.291667
0.458333
0.625
0
0
0
0
0
0
0
0
0.1875
80
6
38
13.333333
0.738462
0
0
0
0
0
0.225
0
0
0
0
0
0
1
0
false
0
0.25
0
0.25
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
6875286730b8549def36bcfcdb5227731d44bec2
39
py
Python
gnu_linux_box/key.py
shivag1992/WearableIntelligenceSystem
362b6053cfe1ca5425f4d116dbbe42f3c924a4ae
[ "MIT" ]
null
null
null
gnu_linux_box/key.py
shivag1992/WearableIntelligenceSystem
362b6053cfe1ca5425f4d116dbbe42f3c924a4ae
[ "MIT" ]
null
null
null
gnu_linux_box/key.py
shivag1992/WearableIntelligenceSystem
362b6053cfe1ca5425f4d116dbbe42f3c924a4ae
[ "MIT" ]
null
null
null
aes_key = "TEMPORARYKEY_CHANGETHISKEY"
19.5
38
0.846154
4
39
7.75
1
0
0
0
0
0
0
0
0
0
0
0
0.076923
39
1
39
39
0.861111
0
0
0
0
0
0.666667
0.666667
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
d7d4d89d93cdaf97c945ef81da7f134221f3ff04
436
py
Python
python/line_ending_check.py
kev0960/ModooCode
aae17e3be86da2f39bf93d7a91364b2a6a348525
[ "Apache-2.0" ]
39
2019-02-26T08:21:06.000Z
2022-03-24T06:38:25.000Z
python/line_ending_check.py
kev0960/ModooCode
aae17e3be86da2f39bf93d7a91364b2a6a348525
[ "Apache-2.0" ]
9
2019-03-01T05:07:44.000Z
2022-02-21T07:39:11.000Z
python/line_ending_check.py
kev0960/ModooCode
aae17e3be86da2f39bf93d7a91364b2a6a348525
[ "Apache-2.0" ]
5
2021-02-08T05:52:01.000Z
2022-03-08T06:37:34.000Z
import os for file in os.listdir("/home/jaebum/ModooCode/python/md"): with open(os.path.join("/home/jaebum/ModooCode/python/md", file)) as f: content = f.read() if '\r\n' in content: print("CRLF found in ", file) for file in os.listdir("/home/jaebum/ModooCode/md"): with open(os.path.join("/home/jaebum/ModooCode/md", file)) as f: content = f.read() if '\r\n' in content: print("CRLF found in ", file)
31.142857
73
0.642202
72
436
3.888889
0.347222
0.142857
0.271429
0.078571
0.971429
0.928571
0.928571
0.928571
0.664286
0.385714
0
0
0.178899
436
13
74
33.538462
0.782123
0
0
0.545455
0
0
0.344037
0.261468
0
0
0
0
0
1
0
false
0
0.090909
0
0.090909
0.181818
0
0
0
null
0
1
0
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
cc250b3f49edfaeac3cd151ba006e86e60e59876
30
py
Python
src/mappings.py
kclconsult/ehr-fhir-mapper
6b8a0aab903eebbcdf6d6c7abcba479be059012d
[ "MIT" ]
3
2020-09-11T09:34:37.000Z
2021-02-08T19:15:03.000Z
src/mappings.py
kclhi/ehr-fhir-converter
fbe0f419dc6eac1c1f8c4d02470a7483c2416ae9
[ "MIT" ]
null
null
null
src/mappings.py
kclhi/ehr-fhir-converter
fbe0f419dc6eac1c1f8c4d02470a7483c2416ae9
[ "MIT" ]
5
2020-05-01T13:14:57.000Z
2022-01-26T22:12:48.000Z
from Default.mappings import *
30
30
0.833333
4
30
6.25
1
0
0
0
0
0
0
0
0
0
0
0
0.1
30
1
30
30
0.925926
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
0bfe1720db3698960d11a197703bbffb61f06df8
83
py
Python
src/gui/__init__.py
asattelmaier/deutschlandradio
ed25796805cdbe0a31296525c11275831c5af453
[ "MIT" ]
null
null
null
src/gui/__init__.py
asattelmaier/deutschlandradio
ed25796805cdbe0a31296525c11275831c5af453
[ "MIT" ]
null
null
null
src/gui/__init__.py
asattelmaier/deutschlandradio
ed25796805cdbe0a31296525c11275831c5af453
[ "MIT" ]
null
null
null
from .menu_builder import MenuBuilder from .app_menu_factory import AppMenuFactory
27.666667
44
0.879518
11
83
6.363636
0.727273
0
0
0
0
0
0
0
0
0
0
0
0.096386
83
2
45
41.5
0.933333
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
0422e5e9cab1d9f43f07435c688d64c76d9a367f
58
py
Python
src/modules/config/__init__.py
volodymyrPivoshenko/fastapi-demo
3dee6419ca048f90a12e3241580b693f1d5225b7
[ "MIT" ]
1
2021-04-25T08:57:54.000Z
2021-04-25T08:57:54.000Z
src/modules/config/__init__.py
volodymyrPivoshenko/fastapi-demo
3dee6419ca048f90a12e3241580b693f1d5225b7
[ "MIT" ]
1
2021-04-21T14:56:31.000Z
2021-04-21T14:56:31.000Z
src/modules/config/__init__.py
volodymyrPivoshenko/fastapi-demo
3dee6419ca048f90a12e3241580b693f1d5225b7
[ "MIT" ]
null
null
null
""" Configuration. """ from .config import Configuration
9.666667
33
0.724138
5
58
8.4
0.8
0
0
0
0
0
0
0
0
0
0
0
0.137931
58
5
34
11.6
0.84
0.241379
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
04329017e66799b79dec3fbb4aeb954c17783f7f
24,511
py
Python
ci-scripts/dlrnapi_promoter/test_logic_unit.py
rdo-infra/ci-conf
619de7cfce62cd3f98c771ad3dd790765cb7a791
[ "Apache-2.0" ]
8
2016-10-06T13:24:04.000Z
2021-11-04T20:51:23.000Z
ci-scripts/dlrnapi_promoter/test_logic_unit.py
rdo-infra/ci-conf
619de7cfce62cd3f98c771ad3dd790765cb7a791
[ "Apache-2.0" ]
8
2020-02-26T20:11:29.000Z
2021-09-23T23:23:47.000Z
ci-scripts/dlrnapi_promoter/test_logic_unit.py
rdo-infra/ci-conf
619de7cfce62cd3f98c771ad3dd790765cb7a791
[ "Apache-2.0" ]
9
2016-04-08T14:38:06.000Z
2021-11-01T18:43:30.000Z
from common import PromotionError from dlrn_client import HashChangedError try: # Python3 imports from unittest import mock from unittest.mock import patch except ImportError: # Python2 imports from mock import patch import mock from dlrn_hash import DlrnCommitDistroExtendedHash, DlrnHash from test_unit_fixtures import ConfigSetup class TestPromote(ConfigSetup): @patch('logging.Logger.exception') @patch('logging.Logger.error') @patch('dlrn_client.DlrnClient.check_named_hashes_unchanged') @patch('dlrn_client.DlrnClient.promote') @patch('registries_client.RegistriesClient.promote') @patch('qcow_client.QcowClient.promote') def test_promote_failure(self, mock_qcow_client, mock_registries_client, mock_dlrn_client, mock_check_named_hashes, mock_log_error, mock_log_exception): mock_dlrn_client.return_value = None mock_qcow_client.side_effect = PromotionError mock_registries_client.return_value = None mock_check_named_hashes.return_value = None candidate_hash = DlrnCommitDistroExtendedHash(commit_hash='a', distro_hash='b') with self.assertRaises(PromotionError): self.promoter.promote(candidate_hash, 'tripleo-ci-testing', 'tripleo-ci-staging-promoted') mock_log_error.assert_has_calls([ mock.call("Candidate hash '%s': client %s FAILED promotion attempt " "to %s" "", candidate_hash, 'qcow_client', 'tripleo-ci-staging-promoted') ]) self.assertTrue(mock_log_exception.called) self.assertTrue(mock_registries_client.called) self.assertTrue(mock_qcow_client.called) self.assertFalse(mock_dlrn_client.called) @patch('logging.Logger.debug') @patch('dlrn_client.DlrnClient.check_named_hashes_unchanged') @patch('dlrn_client.DlrnClient.promote') @patch('registries_client.RegistriesClient.promote') @patch('qcow_client.QcowClient.promote') def test_promote_only_dlrn_client_allowed(self, mock_qcow_client, mock_registries_client, mock_dlrn_client, mock_check_named_hashes, mock_log_debug): candidate_hash = DlrnCommitDistroExtendedHash(commit_hash='a', distro_hash='b') mock_check_named_hashes.return_value = None self.promoter.promote(candidate_hash, 'tripleo-ci-testing', 'tripleo-ci-staging-promoted', allowed_clients=['dlrn_client']) mock_log_debug.assert_has_calls([ mock.call("Candidate hash '%s': clients allowed to promote: %s", candidate_hash, 'dlrn_client'), ]) self.assertFalse(mock_registries_client.called) self.assertFalse(mock_qcow_client.called) self.assertTrue(mock_dlrn_client.called) @patch('logging.Logger.warning') @patch('logging.Logger.debug') @patch('logging.Logger.error') @patch('logging.Logger.info') @patch('dlrn_client.DlrnClient.check_named_hashes_unchanged') @patch('dlrn_client.DlrnClient.promote') @patch('registries_client.RegistriesClient.promote') @patch('qcow_client.QcowClient.promote') def test_promote_success(self, mock_qcow_client, mock_registries_client, mock_dlrn_client, mock_check_named_hashes, mock_log_info, mock_log_error, mock_log_debug, mock_log_warning): candidate_hash = DlrnCommitDistroExtendedHash(commit_hash='a', distro_hash='b') mock_check_named_hashes.return_value = None # The order here is VERY important, and we MUST ensure it's respected allowed_clients = [ 'registries_client', 'qcow_client', 'dlrn_client' ] mock_dlrn_client.return_value = None mock_qcow_client.return_value = None mock_registries_client.return_value = None promoted_pair = \ self.promoter.promote(candidate_hash, 'tripleo-ci-testing', 'tripleo-ci-staging-promoted') mock_log_debug.assert_has_calls([ mock.call("Candidate hash '%s': clients allowed to promote: %s", candidate_hash, ', '.join(allowed_clients)), mock.call("Candidate hash '%s': client %s SUCCESSFUL promotion", candidate_hash, allowed_clients[0]), mock.call("Candidate hash '%s': client %s SUCCESSFUL promotion", candidate_hash, allowed_clients[1]), mock.call("Candidate hash '%s': client %s SUCCESSFUL promotion", candidate_hash, allowed_clients[2]), ]) mock_log_info.assert_has_calls([ mock.call("Candidate hash '%s': attempting promotion", candidate_hash), mock.call("Candidate hash '%s': SUCCESSFUL promotion to %s", candidate_hash, 'tripleo-ci-staging-promoted'), ]) self.assertFalse(mock_log_warning.called) self.assertFalse(mock_log_error.called) self.assertTrue(mock_check_named_hashes.called) self.assertTrue(mock_registries_client.called) self.assertTrue(mock_qcow_client.called) self.assertTrue(mock_dlrn_client.called) self.assertEqual(promoted_pair, (candidate_hash, 'tripleo-ci-staging-promoted')) @patch('logging.Logger.debug') @patch('dlrn_client.DlrnClient.check_named_hashes_unchanged') @patch('dlrn_client.DlrnClient.promote') @patch('registries_client.RegistriesClient.promote') @patch('qcow_client.QcowClient.promote') def test_promote_check_named_hashes_failed(self, mock_qcow_client, mock_registries_client, mock_dlrn_client, mock_check_named_hashes, mock_log_debug): candidate_hash = DlrnCommitDistroExtendedHash(commit_hash='a', distro_hash='b') mock_check_named_hashes.side_effect = HashChangedError with self.assertRaises(HashChangedError): self.promoter.promote(candidate_hash, 'tripleo-ci-testing', 'tripleo-ci-staging-promoted') self.assertFalse(mock_registries_client.called) self.assertFalse(mock_qcow_client.called) self.assertFalse(mock_dlrn_client.called) class TestPromoteLabelToLabel(ConfigSetup): @patch('logging.Logger.debug') @patch('logging.Logger.error') @patch('logging.Logger.info') @patch('logging.Logger.warning') @patch('logic.Promoter.select_candidates') @patch('logic.Promoter.promote') @patch('dlrn_client.DlrnClient.fetch_jobs') @patch('dlrn_client.DlrnClient.get_civotes_info') def test_promote_label_to_label_missing_jobs(self, mock_civotes, mock_fetch_jobs, mock_promote, mock_select_candidates, mock_log_warning, mock_log_info, mock_log_error, mock_log_debug): ci_votes = "http://host.to/detailspage.html" mock_civotes.return_value = ci_votes successful_jobs = [ 'periodic-tripleo-centos-7-master-containers-build-push', ] mock_fetch_jobs.return_value = successful_jobs candidate_hash = DlrnCommitDistroExtendedHash(commit_hash='a', distro_hash='b') mock_select_candidates.return_value = [ candidate_hash ] promoted_pair = self.promoter.promote_label_to_label( 'tripleo-ci-testing', 'tripleo-ci-staging-promoted') mock_log_warning.assert_has_calls([ mock.call("Candidate hash '%s': criteria NOT met for promotion to " "%s", candidate_hash, 'tripleo-ci-staging-promoted'), ]) mock_log_info.assert_has_calls([ mock.call("Candidate label '%s': %d candidates", 'tripleo-ci-testing', 1), mock.call("Candidate label '%s': Checking candidates that meet " "promotion criteria for target label '%s'", 'tripleo-ci-testing', 'tripleo-ci-staging-promoted'), mock.call("Candidate hash '%s': vote details page - %s", candidate_hash, ci_votes), ]) self.assertFalse(mock_promote.called) self.assertFalse(mock_log_error.called) self.assertEqual(promoted_pair, ()) @patch('logging.Logger.error') @patch('logging.Logger.warning') @patch('logic.Promoter.select_candidates') @patch('logic.Promoter.promote') @patch('dlrn_client.DlrnClient.fetch_jobs') @patch('dlrn_client.DlrnClient.get_civotes_info') def test_promote_label_to_label_missing_jobs_no_successful( self, mock_civotes, mock_fetch_jobs, mock_promote, mock_select_candidates, mock_log_warning, mock_log_error): ci_votes = "http://host.to/detailspage.html" mock_civotes.return_value = ci_votes successful_jobs = [] mock_fetch_jobs.return_value = successful_jobs candidate_hash = DlrnCommitDistroExtendedHash(commit_hash='a', distro_hash='b') mock_select_candidates.return_value = [ candidate_hash ] promoted_pair = self.promoter.promote_label_to_label( 'tripleo-ci-testing', 'tripleo-ci-staging-promoted') mock_log_warning.assert_has_calls([ mock.call("Candidate hash '%s': NO successful jobs", candidate_hash), ]) self.assertFalse(mock_promote.called) self.assertFalse(mock_log_error.called) self.assertEqual(promoted_pair, ()) @patch('logging.Logger.error') @patch('logging.Logger.info') @patch('logging.Logger.warning') @patch('logic.Promoter.select_candidates') @patch('logic.Promoter.promote') @patch('dlrn_client.DlrnClient.fetch_jobs') def test_promote_label_to_label_no_candidates(self, mock_fetch_jobs, mock_promote, mock_select_candidates, mock_log_warning, mock_log_info, mock_log_error): mock_select_candidates.return_value = [] promoted_pair = self.promoter.promote_label_to_label( 'tripleo-ci-testing', 'tripleo-ci-staging-promoted') mock_log_warning.assert_has_calls([ mock.call("Candidate label '%s': No candidate hashes", 'tripleo-ci-testing') ]) self.assertFalse(mock_fetch_jobs.called) self.assertFalse(mock_promote.called) self.assertFalse(mock_log_info.called) self.assertFalse(mock_log_error.called) self.assertEqual(promoted_pair, ()) @patch('logging.Logger.debug') @patch('logging.Logger.error') @patch('logging.Logger.info') @patch('logging.Logger.warning') @patch('logic.Promoter.select_candidates') @patch('logic.Promoter.promote') @patch('dlrn_client.DlrnClient.fetch_jobs') @patch('dlrn_client.DlrnClient.get_civotes_info') def test_promote_label_to_label_success(self, mock_civotes, mock_fetch_jobs, mock_promote, mock_select_candidates, mock_log_warning, mock_log_info, mock_log_error, mock_log_debug): ci_votes = "http://host.to/detailspage.html" candidate_hashes = [ DlrnCommitDistroExtendedHash(commit_hash='a', distro_hash='b'), DlrnCommitDistroExtendedHash(commit_hash='c', distro_hash='c') ] required_set = { 'staging-job-1', 'staging-job-2' } pair = (candidate_hashes[0], 'tripleo-ci-staging-promoted') mock_promote.return_value = pair mock_civotes.return_value = ci_votes mock_select_candidates.return_value = candidate_hashes mock_fetch_jobs.return_value = list(required_set) promoted_pair = self.promoter.promote_label_to_label( 'tripleo-ci-testing', 'tripleo-ci-staging-promoted') mock_log_info.assert_has_calls([ mock.call("Candidate label '%s': %d candidates", 'tripleo-ci-testing', 2), mock.call("Candidate label '%s': Checking candidates that meet " "promotion criteria for target label '%s'", 'tripleo-ci-testing', 'tripleo-ci-staging-promoted'), mock.call("Candidate hash '%s': vote details page - %s", candidate_hashes[0], ci_votes), mock.call("Candidate hash '%s': criteria met, attempting promotion " "to %s", candidate_hashes[0], 'tripleo-ci-staging-promoted'), ]) self.assertFalse(mock_log_warning.called) self.assertFalse(mock_log_error.called) self.assertEqual(promoted_pair, pair) # Ensure that we stop at the first promotion self.assertEqual(mock_promote.call_count, 1) @patch('logging.Logger.error') @patch('logging.Logger.warning') @patch('logic.Promoter.select_candidates') @patch('logic.Promoter.promote') @patch('dlrn_client.DlrnClient.fetch_jobs') @patch('dlrn_client.DlrnClient.get_civotes_info') def test_promote_label_to_label_empty_promoted_pair( self, mock_civotes, mock_fetch_jobs, mock_promote, mock_select_candidates, mock_log_warning, mock_log_error): ci_votes = "http://host.to/detailspage.html" candidate_hashes = [ DlrnCommitDistroExtendedHash(commit_hash='a', distro_hash='b'), DlrnCommitDistroExtendedHash(commit_hash='c', distro_hash='c') ] required_set = { 'staging-job-1', 'staging-job-2' } mock_promote.side_effect = [(), ()] mock_civotes.return_value = ci_votes mock_select_candidates.return_value = candidate_hashes mock_fetch_jobs.return_value = list(required_set) promoted_pair = self.promoter.promote_label_to_label( 'tripleo-ci-testing', 'tripleo-ci-staging-promoted') self.assertFalse(mock_log_warning.called) self.assertFalse(mock_log_error.called) # Ensure that we try two promotions self.assertEqual(mock_promote.call_count, 2) self.assertEqual(promoted_pair, ()) class TestPromoteAll(ConfigSetup): @patch('logging.Logger.info') @patch('dlrn_client.DlrnClient.fetch_current_named_hashes') @patch('logic.Promoter.promote_label_to_label') def test_promote_all_success(self, mock_promote_label_to_label, mock_fetch_named_hashes, mock_log_info): mock_promote_label_to_label.return_value = ('label', 'hash') promoted_pairs = self.promoter.promote_all() mock_fetch_named_hashes.assert_has_calls([ mock.call(store=True) ]) mock_log_info.assert_has_calls([ mock.call('Starting promotion attempts for all labels'), mock.call("Candidate label '%s': Attempting promotion to '%s'", 'tripleo-ci-staging', 'tripleo-ci-staging-promoted'), mock.call("Summary: Promoted 1 hashes this round"), mock.call('------- -------- Promoter terminated normally') ]) mock_promote_label_to_label.assert_has_calls([ mock.call('tripleo-ci-staging', 'tripleo-ci-staging-promoted') ]) self.assertEqual(promoted_pairs, [('label', 'hash')]) @patch('dlrnapi_client.DefaultApi.api_promotions_get') @patch('logging.Logger.info') @patch('logging.Logger.warning') @patch('logging.Logger.error') @patch('logic.Promoter.promote_label_to_label') def test_promote_all_failure(self, mock_promote_label_to_label, mock_log_error, mock_log_warning, mock_log_info, mock_dlrn_api_promotions): mock_promote_label_to_label.side_effect = PromotionError promoted_pairs = self.promoter.promote_all() mock_log_error.assert_has_calls([ mock.call("Error while trying to promote %s to %s", 'tripleo-ci-staging', 'tripleo-ci-staging-promoted') ]) mock_log_warning.assert_has_calls([ mock.call("Candidate label '%s': NO candidate " "hash promoted to %s", 'tripleo-ci-staging', 'tripleo-ci-staging-promoted') ]) self.assertTrue(mock_dlrn_api_promotions.called) # Ensure we terminate normally even in case of promotion failure mock_log_info.assert_has_calls([ mock.call('------- -------- Promoter terminated normally') ]) self.assertEqual(promoted_pairs, []) class TestSelectCandidates(ConfigSetup): @mock.patch('dlrn_client.DlrnClient.fetch_promotions') def test_no_hashes_fetched_returns_empty_list(self, fetch_hashes_mock): old_hashes = [] candidate_hashes = [] fetch_hashes_mock.side_effect = [candidate_hashes, old_hashes] obtained_hashes = self.promoter.select_candidates( 'candidate_label', 'target_label') fetch_hashes_mock.assert_has_calls([ mock.call('candidate_label', count='10'), ]) assert (len(obtained_hashes) == 0) @mock.patch('dlrn_client.DlrnClient.fetch_promotions') def test_no_candidates_returns_empty_list(self, fetch_hashes_mock): hash_dict = { 'timestamp': '1528085424', 'commit_hash': 'd1c5379369b24effdccfe5dde3e93bd21884eda5', 'distro_hash': 'cd4fb616ac3065794b8a9156bbe70ede3d77eff5' } hash = DlrnHash(source=hash_dict) old_hashes = [hash] candidate_hashes = [] fetch_hashes_mock.side_effect = [candidate_hashes, old_hashes] obtained_hashes = self.promoter.select_candidates( 'candidate_label', 'target_label') assert (len(obtained_hashes) == 0) fetch_hashes_mock.assert_has_calls([ mock.call('candidate_label', count='10'), ]) @mock.patch('dlrn_client.DlrnClient.fetch_promotions') def test_no_old_hashes_returns_candidates(self, fetch_hashes_mock): old_hashes = [] hash1_dict = { 'timestamp': '1528085424', 'commit_hash': 'd1c5379369b24effdccfe5dde3e93bd21884eda5', 'distro_hash': 'cd4fb616ac3065794b8a9156bbe70ede3d77eff5' } hash1 = DlrnHash(source=hash1_dict) hash2_dict = { 'timestamp': '1528085434', 'commit_hash': 'd1c5379369b24effdccfe5dde3e93bd21884eda6', 'distro_hash': 'cd4fb616ac3065794b8a9156bbe70ede3d77eff6' } hash2 = DlrnHash(source=hash2_dict) candidate_hashes = [hash1, hash2] fetch_hashes_mock.side_effect = [candidate_hashes, old_hashes] obtained_hashes = self.promoter.select_candidates( 'candidate_label', 'target_label') fetch_hashes_mock.assert_has_calls([ mock.call('candidate_label', count='10'), mock.call('target_label') ]) assert (obtained_hashes == candidate_hashes) @mock.patch('dlrn_client.DlrnClient.fetch_promotions') def test_old_hashes_get_filtered_from_candidates(self, fetch_hashes_mock): old_hashes_dicts = [ { 'timestamp': '1528085424', 'commit_hash': 'd1c5379369b24effdccfe5dde3e93bd21884ed24', 'distro_hash': 'cd4fb616ac3065794b8a9156bbe70ede3d77ef24' }, { 'timestamp': '1528085425', 'commit_hash': 'd1c5379369b24effdccfe5dde3e93bd21884ed25', 'distro_hash': 'cd4fb616ac3065794b8a9156bbe70ede3d77ef25' } ] old_hashes = [] for hash_dict in old_hashes_dicts: old_hashes.append(DlrnHash(source=hash_dict)) # hashes here must be in order, as fetch_hashes now would return the # list in reverse timestamp order candidate_hashes_dicts = [ { 'timestamp': '1528085427', 'commit_hash': 'd1c5379369b24effdccfe5dde3e93bd21884ed27', 'distro_hash': 'cd4fb616ac3065794b8a9156bbe70ede3d77ef27' }, { 'timestamp': '1528085426', 'commit_hash': 'd1c5379369b24effdccfe5dde3e93bd21884ed26', 'distro_hash': 'cd4fb616ac3065794b8a9156bbe70ede3d77ef26' }, { 'timestamp': '1528085425', 'commit_hash': 'd1c5379369b24effdccfe5dde3e93bd21884ed25', 'distro_hash': 'cd4fb616ac3065794b8a9156bbe70ede3d77ef25' }, { 'timestamp': '1528085424', 'commit_hash': 'd1c5379369b24effdccfe5dde3e93bd21884ed24', 'distro_hash': 'cd4fb616ac3065794b8a9156bbe70ede3d77ef24' }, { 'timestamp': '1528085423', 'commit_hash': 'd1c5379369b24effdccfe5dde3e93bd21884ed23', 'distro_hash': 'cd4fb616ac3065794b8a9156bbe70ede3d77ef23' }, ] candidate_hashes = [] for hash_dict in candidate_hashes_dicts: candidate_hashes.append(DlrnHash(source=hash_dict)) expected_hashes_dicts = [ { 'timestamp': '1528085427', 'commit_hash': 'd1c5379369b24effdccfe5dde3e93bd21884ed27', 'distro_hash': 'cd4fb616ac3065794b8a9156bbe70ede3d77ef27' }, { 'timestamp': '1528085426', 'commit_hash': 'd1c5379369b24effdccfe5dde3e93bd21884ed26', 'distro_hash': 'cd4fb616ac3065794b8a9156bbe70ede3d77ef26' }, ] expected_hashes = [] for hash_dict in expected_hashes_dicts: expected_hashes.append(DlrnHash(source=hash_dict)) fetch_hashes_mock.side_effect = [candidate_hashes, old_hashes] obtained_hashes = self.promoter.select_candidates( 'candidate_label', 'target_label') fetch_hashes_mock.assert_has_calls([ mock.call('candidate_label', count='10'), mock.call('target_label') ]) assert (obtained_hashes == expected_hashes)
43.926523
80
0.588226
2,301
24,511
5.943937
0.092134
0.026102
0.035534
0.040214
0.823938
0.790524
0.762594
0.725817
0.691453
0.620458
0
0.040677
0.319979
24,511
557
81
44.005386
0.779878
0.01379
0
0.672
0
0
0.257242
0.135946
0
0
0
0
0.128
1
0.03
false
0
0.018
0
0.056
0
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
0458eb4a87747b71effa3100078c0bf7db84fac6
2,012
py
Python
tx_salaries/migrations/0004_auto_20160329_1047.py
texastribune/tx_salaries
197d8da4e1783216830b8d0a5adb23c0200fd3e8
[ "Apache-2.0" ]
6
2016-05-18T05:53:44.000Z
2019-06-13T18:27:50.000Z
tx_salaries/migrations/0004_auto_20160329_1047.py
texastribune/tx_salaries
197d8da4e1783216830b8d0a5adb23c0200fd3e8
[ "Apache-2.0" ]
64
2015-02-13T18:29:04.000Z
2018-06-15T19:48:56.000Z
tx_salaries/migrations/0004_auto_20160329_1047.py
texastribune/tx_salaries
197d8da4e1783216830b8d0a5adb23c0200fd3e8
[ "Apache-2.0" ]
2
2015-05-08T19:22:12.000Z
2016-07-11T16:57:49.000Z
# -*- coding: utf-8 -*- # Generated by Django 1.9.4 on 2016-03-29 15:47 from __future__ import unicode_literals from django.db import migrations, models import tx_people.fields import tx_people.utils class Migration(migrations.Migration): dependencies = [ ('tx_salaries', '0003_auto_20160329_1017'), ] operations = [ migrations.AlterField( model_name='employee', name='compensation', field=models.DecimalField(db_index=True, decimal_places=2, max_digits=12), ), migrations.AlterField( model_name='employee', name='tenure', field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True), ), migrations.AlterField( model_name='organizationstats', name='highest_paid', field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True), ), migrations.AlterField( model_name='organizationstats', name='lowest_paid', field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True), ), migrations.AlterField( model_name='organizationstats', name='median_paid', field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True), ), migrations.AlterField( model_name='positionstats', name='highest_paid', field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True), ), migrations.AlterField( model_name='positionstats', name='lowest_paid', field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True), ), migrations.AlterField( model_name='positionstats', name='median_paid', field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True), ), ]
34.689655
94
0.615805
211
2,012
5.672986
0.28436
0.133668
0.167084
0.193818
0.765246
0.765246
0.696742
0.672515
0.672515
0.672515
0
0.038199
0.271372
2,012
57
95
35.298246
0.778308
0.0333
0
0.74
1
0
0.116375
0.011843
0
0
0
0
0
1
0
false
0
0.08
0
0.14
0
0
0
0
null
0
0
1
0
1
0
0
0
1
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
f08f8a6dae3efe17833eddbe5ac833727c5815fc
35
py
Python
ryanair/__init__.py
cohaolain/ryanair-py
c756285c9e22017ace44fe3045819e731c5950ba
[ "MIT" ]
3
2022-02-23T11:49:18.000Z
2022-03-29T20:23:19.000Z
ryanair/__init__.py
cohaolain/ryanair-py
c756285c9e22017ace44fe3045819e731c5950ba
[ "MIT" ]
null
null
null
ryanair/__init__.py
cohaolain/ryanair-py
c756285c9e22017ace44fe3045819e731c5950ba
[ "MIT" ]
null
null
null
from ryanair.ryanair import Ryanair
35
35
0.885714
5
35
6.2
0.6
0
0
0
0
0
0
0
0
0
0
0
0.085714
35
1
35
35
0.96875
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
f0c8281a5a9c9375944d5199f27ebf7c60ec4ecb
39
py
Python
chariothy_common/exception.py
chariothy/pycommon
470d4d3404ea1a1c6a4e5f7fb4c9b02b123c2971
[ "MIT" ]
null
null
null
chariothy_common/exception.py
chariothy/pycommon
470d4d3404ea1a1c6a4e5f7fb4c9b02b123c2971
[ "MIT" ]
null
null
null
chariothy_common/exception.py
chariothy/pycommon
470d4d3404ea1a1c6a4e5f7fb4c9b02b123c2971
[ "MIT" ]
null
null
null
class AppToolError(Exception): pass
19.5
30
0.769231
4
39
7.5
1
0
0
0
0
0
0
0
0
0
0
0
0.153846
39
2
31
19.5
0.909091
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
5
f0e1546ad4ea9379177831f7f059c2ebdb00b2ea
204
py
Python
main_downloaded.py
Bodhis4ttva/LHC_Net
8b47dff5117b078a99183afd1d103da06f37361c
[ "MIT" ]
9
2021-12-02T01:57:01.000Z
2022-03-30T13:48:42.000Z
main_downloaded.py
Bodhis4ttva/LHC_Net
8b47dff5117b078a99183afd1d103da06f37361c
[ "MIT" ]
null
null
null
main_downloaded.py
Bodhis4ttva/LHC_Net
8b47dff5117b078a99183afd1d103da06f37361c
[ "MIT" ]
4
2022-02-28T12:53:43.000Z
2022-03-30T09:34:50.000Z
exec(open("Download_Data.py").read()) exec(open("ETL.py").read()) exec(open("Download_Models.py").read()) exec(open("LHC_Downloaded_Eval.py").read()) exec(open("Controller_Downloaded_Eval.py").read())
40.8
50
0.715686
31
204
4.516129
0.387097
0.285714
0.285714
0.4
0
0
0
0
0
0
0
0
0.039216
204
5
50
40.8
0.714286
0
0
0
0
0
0.452736
0.253731
0
0
0
0
0
1
0
true
0
0
0
0
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
f0e602d83468d97dcbd4ebb1156e1f223fbb4efb
119
py
Python
whatsapp_tracker/data_structures/setup_data_structures.py
itay-bardugo/whatsapp_tracker
c53a309b08bf47597c8191ec0a155a1fe1536842
[ "MIT" ]
1
2021-09-25T12:22:35.000Z
2021-09-25T12:22:35.000Z
whatsapp_tracker/data_structures/setup_data_structures.py
itay-bardugo/whatsapp_tracker
c53a309b08bf47597c8191ec0a155a1fe1536842
[ "MIT" ]
null
null
null
whatsapp_tracker/data_structures/setup_data_structures.py
itay-bardugo/whatsapp_tracker
c53a309b08bf47597c8191ec0a155a1fe1536842
[ "MIT" ]
null
null
null
from collections import namedtuple SetupSeleniumDataStructure = namedtuple('SetupSeleniumDataStructure', ('driver',))
29.75
82
0.831933
8
119
12.375
0.75
0.727273
0
0
0
0
0
0
0
0
0
0
0.07563
119
3
83
39.666667
0.9
0
0
0
0
0
0.268908
0.218487
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
1
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
5
f0f17119bc54b6e9026d944faf728c6a183559c5
244
py
Python
LnkParse3/target/internet.py
ernix/LnkParse3
ab8b2c796a501b103eb74142762e7fe9f4f1960a
[ "MIT" ]
null
null
null
LnkParse3/target/internet.py
ernix/LnkParse3
ab8b2c796a501b103eb74142762e7fe9f4f1960a
[ "MIT" ]
null
null
null
LnkParse3/target/internet.py
ernix/LnkParse3
ab8b2c796a501b103eb74142762e7fe9f4f1960a
[ "MIT" ]
null
null
null
from LnkParse3.target.lnk_target_base import LnkTargetBase # https://github.com/libyal/libfwsi/blob/master/documentation/Windows%20Shell%20Item%20format.asciidoc#37-uri-shell-item # TODO: rename to uri class Internet(LnkTargetBase): pass
30.5
120
0.811475
33
244
5.939394
0.909091
0
0
0
0
0
0
0
0
0
0
0.040179
0.081967
244
7
121
34.857143
0.834821
0.561475
0
0
0
0
0
0
0
0
0
0.142857
0
1
0
true
0.333333
0.333333
0
0.666667
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
1
0
0
0
1
1
1
0
0
0
0
5
f0fe813404b9472b982a3d5c76a01046ca05a82d
6,168
py
Python
src/human_lambdas/user_handler/tests/test_invite_endpoint.py
Human-Lambdas/human-lambdas
9a2f2317f0c8dbfbfa88f3ba4994de7e6b2c4d50
[ "Apache-2.0" ]
25
2021-06-08T08:00:08.000Z
2022-03-17T22:49:10.000Z
src/human_lambdas/user_handler/tests/test_invite_endpoint.py
Human-Lambdas/human-lambdas
9a2f2317f0c8dbfbfa88f3ba4994de7e6b2c4d50
[ "Apache-2.0" ]
null
null
null
src/human_lambdas/user_handler/tests/test_invite_endpoint.py
Human-Lambdas/human-lambdas
9a2f2317f0c8dbfbfa88f3ba4994de7e6b2c4d50
[ "Apache-2.0" ]
5
2021-06-15T09:57:46.000Z
2022-02-03T16:18:33.000Z
import logging from django.test.utils import override_settings from rest_framework import status from rest_framework.test import APITestCase from human_lambdas.user_handler.models import Organization, User logger = logging.getLogger(__name__) logging.disable(logging.DEBUG) class TestInvite(APITestCase): def setUp(self): self.preset_user_name = "foo" self.preset_user_email = "foo@bar.com" self.preset_changed_email = "bar@foo.com" self.organization_name = "barinc" self.preset_user_password = "foowordbar" user = User(name=self.preset_user_name, email=self.preset_user_email) user.set_password(self.preset_user_password) user.save() response = self.client.post( "/v1/users/token", {"email": "foo@bar.com", "password": "foowordbar"} ) self.access_token = response.data["access"] self.refresh = response.data["refresh"] organization = Organization(name=self.organization_name) organization.save() self.org_id = organization.id organization.add_admin(user) @override_settings(DEBUG=True) def test_endpoint_call(self): self.client.credentials(HTTP_AUTHORIZATION="Bearer " + self.access_token) response = self.client.post( "/v1/orgs/{0}/invite".format(self.org_id), {"emails": "seanfahy45@gmail.com,alpha@beta.com,gamma@delta.com"}, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @override_settings(DEBUG=True) def test_endpoint_call_with_spaces(self): self.client.credentials(HTTP_AUTHORIZATION="Bearer " + self.access_token) response = self.client.post( "/v1/orgs/{0}/invite".format(self.org_id), {"emails": "lambda@sigma.com ,alpha@beta.com, gamma@delta.com "}, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @override_settings(DEBUG=True) def test_endpoint_call_duplicate_emails(self): self.client.credentials(HTTP_AUTHORIZATION="Bearer " + self.access_token) response = self.client.post( "/v1/orgs/{0}/invite".format(self.org_id), { "emails": "lambda@sigma.com,alpha@beta.com,gamma@delta.com,alpha@beta.com", }, ) self.assertEqual(response.status_code, status.HTTP_200_OK) @override_settings(DEBUG=True) def test_endpoint_call_no_jwt(self): response = self.client.post( "/v1/orgs/{0}/invite".format(self.org_id), {"emails": "lambda@sigma.com,alpha@beta.com,gamma@delta.com"}, ) self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED) @override_settings(DEBUG=True) def test_endpoint_call_already_added_email(self): self.client.credentials(HTTP_AUTHORIZATION="Bearer " + self.access_token) response = self.client.post( "/v1/orgs/{0}/invite".format(self.org_id), {"emails": "lambda@sigma.com,foo@bar.com,gamma@delta.com"}, ) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) @override_settings(DEBUG=True) def test_endpoint_call_invalid_emails(self): self.client.credentials(HTTP_AUTHORIZATION="Bearer " + self.access_token) response = self.client.post( "/v1/orgs/{0}/invite".format(self.org_id), {"emails": "lambda@sigma.com,foo@foo,bar.com"}, ) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) @override_settings(DEBUG=True) def test_endpoint_call_invalid_emails_and_already_added_emails(self): self.client.credentials(HTTP_AUTHORIZATION="Bearer " + self.access_token) response = self.client.post( "/v1/orgs/{0}/invite".format(self.org_id), {"emails": "lambda@sigma.com,foo@foo,bar.com,foo@bar.com"}, ) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) @override_settings(DEBUG=True) def test_endpoint_call_email_with_underscore(self): self.client.credentials(HTTP_AUTHORIZATION="Bearer " + self.access_token) response = self.client.post( "/v1/orgs/{0}/invite".format(self.org_id), {"emails": "lam__bda@sigma.com,foo@foobarinc.com"}, ) self.assertEqual(response.status_code, status.HTTP_200_OK) def test_endpoint_call_get(self): self.client.credentials(HTTP_AUTHORIZATION="Bearer " + self.access_token) response = self.client.get("/v1/orgs/{0}/invite".format(self.org_id)) self.assertEqual(response.status_code, status.HTTP_200_OK) def test_endpoint_call_delete(self): self.client.credentials(HTTP_AUTHORIZATION="Bearer " + self.access_token) response = self.client.post( "/v1/orgs/{0}/invite".format(self.org_id), {"emails": "delete@me.com"}, ) response = self.client.delete( "/v1/orgs/{0}/invite".format(self.org_id), {"email": "delete@me.com"} ) self.assertEqual(response.status_code, status.HTTP_200_OK) def test_endpoint_call_patch(self): self.client.credentials(HTTP_AUTHORIZATION="Bearer " + self.access_token) response = self.client.post( "/v1/orgs/{0}/invite".format(self.org_id), {"emails": "patch@me.com"}, ) self.assertEqual(response.status_code, status.HTTP_200_OK) response = self.client.patch( "/v1/orgs/{0}/invite".format(self.org_id), {"email": "patch@me.com", "admin": True}, ) self.assertEqual(response.status_code, status.HTTP_200_OK) response = self.client.get("/v1/orgs/{0}/invite".format(self.org_id)) self.assertEqual(response.status_code, status.HTTP_200_OK) def test_endpoint_call_delete_no_invite(self): self.client.credentials(HTTP_AUTHORIZATION="Bearer " + self.access_token) response = self.client.delete( "/v1/orgs/{0}/invite".format(self.org_id), {"email": "delete@me.com"} ) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
42.246575
91
0.661965
762
6,168
5.132546
0.128609
0.069036
0.073638
0.049859
0.764255
0.758118
0.758118
0.758118
0.735617
0.72718
0
0.015322
0.206388
6,168
145
92
42.537931
0.783657
0
0
0.496
0
0.008
0.159533
0.051232
0
0
0
0
0.112
1
0.104
false
0.024
0.04
0
0.152
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
9beec96bcecb2d1d2e9cbff2af883058c9b85122
58
py
Python
drl_grasping/envs/randomizers/__init__.py
Tiamat-Tech/drl_grasping
e67efee1cdbeeb3cb1e4d028890bbfc601e7840c
[ "BSD-3-Clause" ]
126
2020-11-02T11:08:07.000Z
2022-03-31T16:25:06.000Z
drl_grasping/envs/randomizers/__init__.py
Tiamat-Tech/drl_grasping
e67efee1cdbeeb3cb1e4d028890bbfc601e7840c
[ "BSD-3-Clause" ]
68
2020-11-02T13:18:29.000Z
2022-02-27T17:38:50.000Z
drl_grasping/envs/randomizers/__init__.py
Tiamat-Tech/drl_grasping
e67efee1cdbeeb3cb1e4d028890bbfc601e7840c
[ "BSD-3-Clause" ]
27
2021-01-20T16:15:41.000Z
2022-03-15T10:44:43.000Z
from .manipulation import ManipulationGazeboEnvRandomizer
29
57
0.913793
4
58
13.25
1
0
0
0
0
0
0
0
0
0
0
0
0.068966
58
1
58
58
0.981481
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
9befad094245918eb47297d5dade47947a1d92fe
53
py
Python
server/app/users/viewsets/custom/__init__.py
catvitalio/personal-budget
b4470115ebbfd185a8a781a2024787cbfe822639
[ "MIT" ]
null
null
null
server/app/users/viewsets/custom/__init__.py
catvitalio/personal-budget
b4470115ebbfd185a8a781a2024787cbfe822639
[ "MIT" ]
null
null
null
server/app/users/viewsets/custom/__init__.py
catvitalio/personal-budget
b4470115ebbfd185a8a781a2024787cbfe822639
[ "MIT" ]
null
null
null
from .obtain_auth_token import CustomObtainAuthToken
26.5
52
0.90566
6
53
7.666667
1
0
0
0
0
0
0
0
0
0
0
0
0.075472
53
1
53
53
0.938776
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
9bf3c4869bce2da6c9f2b945a366d030b97d015a
96
py
Python
lenz/__init__.py
zhzLuke96/lenz
be1b902b1ea5541b3262bc01b6172399a424ba65
[ "MIT" ]
null
null
null
lenz/__init__.py
zhzLuke96/lenz
be1b902b1ea5541b3262bc01b6172399a424ba65
[ "MIT" ]
null
null
null
lenz/__init__.py
zhzLuke96/lenz
be1b902b1ea5541b3262bc01b6172399a424ba65
[ "MIT" ]
null
null
null
from .clipper import BM from .favor import favor from .word_dig import dig_words,clear_knowWord
24
46
0.833333
16
96
4.8125
0.625
0
0
0
0
0
0
0
0
0
0
0
0.125
96
3
47
32
0.916667
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
502cfa2d758acf084a5ea0f4ef4062cdc3894d76
84
py
Python
Codewars/Gauss_needs_help - (7 kyu).py
maxcohen31/A-bored-math-student
007beb4dabf7b4406f48e9a3a967c29d032eab89
[ "MIT" ]
null
null
null
Codewars/Gauss_needs_help - (7 kyu).py
maxcohen31/A-bored-math-student
007beb4dabf7b4406f48e9a3a967c29d032eab89
[ "MIT" ]
null
null
null
Codewars/Gauss_needs_help - (7 kyu).py
maxcohen31/A-bored-math-student
007beb4dabf7b4406f48e9a3a967c29d032eab89
[ "MIT" ]
null
null
null
def f(n): return n * (n + 1) // 2 if isinstance(n, int) and n > 0 else None
28
69
0.52381
17
84
2.588235
0.764706
0
0
0
0
0
0
0
0
0
0
0.052632
0.321429
84
3
70
28
0.719298
0
0
0
0
0
0
0
0
0
0
0
0
1
0.5
false
0
0
0.5
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
ac94558207e972143b586c9ac471de2b1c4cedf0
1,490
py
Python
opacus/tests/grad_samples/layer_norm_test.py
dorry1996/opacus
92111c6cd019e300e7844830f2630e4ed81aa7d1
[ "Apache-2.0" ]
1
2021-04-20T06:24:45.000Z
2021-04-20T06:24:45.000Z
opacus/tests/grad_samples/layer_norm_test.py
dorry1996/opacus
92111c6cd019e300e7844830f2630e4ed81aa7d1
[ "Apache-2.0" ]
4
2021-09-20T22:26:11.000Z
2022-02-27T13:43:09.000Z
opacus/tests/grad_samples/layer_norm_test.py
PenelopeCorsica/opacus
42fec65c6ea96a86af8109be2eecc79c0e1b686e
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved import torch import torch.nn as nn from .common import GradSampleHooks_test class LayerNorm_test(GradSampleHooks_test): def test_2d_input_1d_norm(self): N, W = 32, 17 norm = nn.LayerNorm(W, elementwise_affine=True) x = torch.randn([N, W]) self.run_test(x, norm, batch_first=True) def test_3d_input_1d_norm(self): N, Z, W = 32, 4, 10 norm = nn.LayerNorm(W, elementwise_affine=True) x = torch.randn([N, Z, W]) self.run_test(x, norm, batch_first=True) def test_3d_input_2d_norm(self): N, Z, W = 32, 4, 10 norm = nn.LayerNorm([Z, W], elementwise_affine=True) x = torch.randn([N, Z, W]) self.run_test(x, norm, batch_first=True) def test_4d_input_1d_norm(self): N, C, H, W = 32, 4, 3, 10 norm = nn.LayerNorm(W, elementwise_affine=True) x = torch.randn([N, C, H, W]) self.run_test(x, norm, batch_first=True) def test_4d_input_2d_norm(self): N, C, H, W = 32, 4, 3, 10 norm = nn.LayerNorm([H, W], elementwise_affine=True) x = torch.randn([N, C, H, W]) self.run_test(x, norm, batch_first=True) def test_4d_input_3d_norm(self): N, C, H, W = 32, 4, 3, 10 norm = nn.LayerNorm([C, H, W], elementwise_affine=True) x = torch.randn([N, C, H, W]) self.run_test(x, norm, batch_first=True)
31.702128
70
0.60604
245
1,490
3.502041
0.2
0.018648
0.024476
0.153846
0.780886
0.752914
0.752914
0.752914
0.752914
0.752914
0
0.040798
0.259732
1,490
46
71
32.391304
0.737081
0.060403
0
0.558824
0
0
0
0
0
0
0
0
0
1
0.176471
false
0
0.088235
0
0.294118
0
0
0
0
null
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
acc11228910f4b6918fa413d64b947b75ac1289d
6,910
py
Python
orchestra/utils/tests/test_common_helpers.py
code-review-doctor/orchestra
1ba58d26c508e89d2050dc9b0c8439eb1eadd014
[ "Apache-2.0" ]
444
2016-07-25T05:24:30.000Z
2022-02-21T08:12:29.000Z
orchestra/utils/tests/test_common_helpers.py
code-review-doctor/orchestra
1ba58d26c508e89d2050dc9b0c8439eb1eadd014
[ "Apache-2.0" ]
395
2016-07-26T20:49:59.000Z
2022-03-15T20:58:45.000Z
orchestra/utils/tests/test_common_helpers.py
code-review-doctor/orchestra
1ba58d26c508e89d2050dc9b0c8439eb1eadd014
[ "Apache-2.0" ]
63
2016-07-26T04:10:21.000Z
2022-03-29T03:32:19.000Z
from django.test import TestCase from unittest.mock import patch from orchestra.models import Todo from orchestra.tests.helpers.fixtures import WorkerFactory from orchestra.tests.helpers.fixtures import UserFactory from orchestra.tests.helpers.fixtures import TodoFactory from orchestra.tests.helpers.fixtures import StepFactory from orchestra.tests.helpers.fixtures import ProjectFactory from orchestra.utils.common_helpers import get_update_message from orchestra.utils.common_helpers import notify_single_todo_update class ViewHelpersTests(TestCase): def setUp(self): super().setUp() self.project = ProjectFactory() step = StepFactory() self.old_title = 'Old title' self.new_title = 'New title' self.old_details = 'Old details' self.new_details = 'New details' self.old_todo = TodoFactory( title=self.old_title, details=self.old_details, project=self.project, step=step) self.new_todo = TodoFactory( title=self.new_title, details=self.new_details, status=Todo.Status.COMPLETED.value, project=self.project, step=step) self.sender = UserFactory() def test_empty_msg_if_no_updates(self): old_todo = self.new_todo msg = get_update_message(old_todo, self.new_todo, self.sender) expected_msg = '' self.assertEqual(msg, expected_msg) def test_fields_updated_completed_with_sender(self): msg = get_update_message(self.old_todo, self.new_todo, self.sender) expected_msg = ( '{} has updated `{}`: marked complete, ' 'changed title and details' ).format(self.sender.username, self.new_todo.title) self.assertEqual(msg, expected_msg) # Reversing the change msg = get_update_message(self.new_todo, self.old_todo, self.sender) expected_msg = ( '{} has updated `{}`: marked incomplete, ' 'changed title and details' ).format(self.sender.username, self.old_todo.title) self.assertEqual(msg, expected_msg) def test_fields_updated_completed_without_sender(self): msg = get_update_message(self.old_todo, self.new_todo) expected_msg = ( '`{}` has been updated: marked complete, ' 'changed title and details' ).format(self.new_todo.title) self.assertEqual(msg, expected_msg) # Reversing the change msg = get_update_message(self.new_todo, self.old_todo) expected_msg = ( '`{}` has been updated: marked incomplete, ' 'changed title and details' ).format(self.old_todo.title) self.assertEqual(msg, expected_msg) def test_fields_not_updated_completed(self): new_todo = TodoFactory( title=self.old_title, details=self.old_details, status=Todo.Status.COMPLETED.value) msg = get_update_message(self.old_todo, new_todo, self.sender) expected_msg = '{} has updated `{}`: marked complete'.format( self.sender.username, new_todo.title) self.assertEqual(msg, expected_msg) # Reversing the change msg = get_update_message(new_todo, self.old_todo, self.sender) expected_msg = '{} has updated `{}`: marked incomplete'.format( self.sender.username, new_todo.title) self.assertEqual(msg, expected_msg) def test_fields_not_updated_not_relevant(self): new_todo = TodoFactory( title=self.old_title, details=self.old_details, status=Todo.Status.DECLINED.value) msg = get_update_message(self.old_todo, new_todo, self.sender) expected_msg = '{} has updated `{}`: marked not relevant'.format( self.sender.username, new_todo.title) self.assertEqual(msg, expected_msg) # No sender msg = get_update_message(self.old_todo, new_todo) expected_msg = '`{}` has been updated: marked not relevant'.format( new_todo.title) self.assertEqual(msg, expected_msg) # Reversing the change msg = get_update_message(new_todo, self.old_todo) expected_msg = '`{}` has been updated: marked relevant'.format( new_todo.title) self.assertEqual(msg, expected_msg) def test_fields_updated(self): old_todo = TodoFactory( title=self.old_title, details=self.old_details) new_todo = TodoFactory( title=self.new_title, details=self.new_details) msg = get_update_message(old_todo, new_todo, self.sender) expected_msg = ( '{} has updated `{}`: changed title and details').format( self.sender.username, new_todo.title) self.assertEqual(msg, expected_msg) # Only title has changed old_todo = TodoFactory( title=self.old_title, details=self.old_details) new_todo = TodoFactory( title=self.new_title, details=self.old_details) msg = get_update_message(old_todo, new_todo, self.sender) expected_msg = ( '{} has updated `{}`: changed title').format( self.sender.username, new_todo.title) self.assertEqual(msg, expected_msg) @patch('orchestra.utils.common_helpers.message_experts_slack_group') def test_notify_single_todo_update(self, mock_slack): # Level 0 todos WorkerFactory(user=self.sender) notify_single_todo_update( self.sender, self.old_todo, self.new_todo) self.assertEqual(mock_slack.call_count, 1) # Level 1 todos parent_todo_level_1 = TodoFactory(title='Parent todo') old_todo = TodoFactory( title=self.old_title, parent_todo=parent_todo_level_1, project=self.project, details=self.old_details) new_todo = TodoFactory( title=self.new_title, parent_todo=parent_todo_level_1, project=self.project, details=self.new_details) notify_single_todo_update(self.sender, old_todo, new_todo) self.assertEqual(mock_slack.call_count, 2) # Level 2 todos parent_todo_level_2 = TodoFactory( title='Parent todo', parent_todo=parent_todo_level_1) old_todo = TodoFactory( title=self.old_title, parent_todo=parent_todo_level_2, project=self.project, details=self.old_details) new_todo = TodoFactory( title=self.new_title, parent_todo=parent_todo_level_2, project=self.project, details=self.new_details) notify_single_todo_update(self.sender, old_todo, new_todo) self.assertEqual(mock_slack.call_count, 2)
38.603352
75
0.643994
820
6,910
5.165854
0.09878
0.05288
0.038952
0.067989
0.84136
0.827668
0.717422
0.713881
0.69051
0.630312
0
0.002565
0.26657
6,910
178
76
38.820225
0.833268
0.022865
0
0.550336
0
0
0.097004
0.008603
0
0
0
0.005618
0.100671
1
0.053691
false
0
0.067114
0
0.127517
0
0
0
0
null
0
0
0
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
aceb16bc73c90655ecc1b45e26b5615aac66074f
101
py
Python
gtts/tokenizer/__init__.py
onsunsl/gTTS
c7ea4fb8a3ababd9dfa9fb35b99232be4347cce6
[ "MIT" ]
3
2019-04-10T18:14:46.000Z
2020-10-26T05:08:05.000Z
gtts/tokenizer/__init__.py
onsunsl/gTTS
c7ea4fb8a3ababd9dfa9fb35b99232be4347cce6
[ "MIT" ]
null
null
null
gtts/tokenizer/__init__.py
onsunsl/gTTS
c7ea4fb8a3ababd9dfa9fb35b99232be4347cce6
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -* from .core import RegexBuilder, PreProcessorRegex, PreProcessorSub, Tokenizer
33.666667
77
0.762376
10
101
7.7
1
0
0
0
0
0
0
0
0
0
0
0.011236
0.118812
101
2
78
50.5
0.853933
0.19802
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
acf5fda3f3362b06bbf39c1152b9bc75996671aa
76
py
Python
afterglow_core/views/public_api/__init__.py
SkynetRTN/afterglow-access-server
3d8d62f622577fdd1ae7b0076cb536251f7bf0cd
[ "Apache-2.0" ]
2
2021-05-24T15:12:07.000Z
2022-02-17T19:58:16.000Z
afterglow_core/views/public_api/__init__.py
SkynetRTN/afterglow-access-server
3d8d62f622577fdd1ae7b0076cb536251f7bf0cd
[ "Apache-2.0" ]
1
2022-02-27T03:01:06.000Z
2022-02-27T03:01:06.000Z
afterglow_core/views/public_api/__init__.py
SkynetRTN/afterglow-access-server
3d8d62f622577fdd1ae7b0076cb536251f7bf0cd
[ "Apache-2.0" ]
2
2021-06-08T18:16:40.000Z
2021-07-09T14:19:49.000Z
""" Afterglow Core: views for all public API versions """ from . import v1
12.666667
49
0.697368
11
76
4.818182
1
0
0
0
0
0
0
0
0
0
0
0.016393
0.197368
76
5
50
15.2
0.852459
0.644737
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
4a17a383ac65a80ef23430148eca21cd0cb3ea48
125
py
Python
visits_detector/core/__init__.py
AlexFridman/visits-detector
3df0c719c60c751ad449341fe5f68383352e8f5e
[ "MIT" ]
null
null
null
visits_detector/core/__init__.py
AlexFridman/visits-detector
3df0c719c60c751ad449341fe5f68383352e8f5e
[ "MIT" ]
null
null
null
visits_detector/core/__init__.py
AlexFridman/visits-detector
3df0c719c60c751ad449341fe5f68383352e8f5e
[ "MIT" ]
null
null
null
from extract_events_reducer import ExtractEventsReducer from filter_and_map_to_index_mapper import FilterAndMapToIndexMapper
41.666667
68
0.936
15
125
7.333333
0.866667
0
0
0
0
0
0
0
0
0
0
0
0.064
125
2
69
62.5
0.940171
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
c597923e9669982436ad215a2a6597e783b7981e
373
py
Python
library/library_project/books/models.py
yadav-vikas/Django_REST_api
d37609b7d6776d8409185021ead7c94eb344e5eb
[ "MIT" ]
null
null
null
library/library_project/books/models.py
yadav-vikas/Django_REST_api
d37609b7d6776d8409185021ead7c94eb344e5eb
[ "MIT" ]
null
null
null
library/library_project/books/models.py
yadav-vikas/Django_REST_api
d37609b7d6776d8409185021ead7c94eb344e5eb
[ "MIT" ]
null
null
null
from django.db import models class Book(models.Model): title = models.CharField(max_length=250) subtitle = models.CharField(max_length=250) author = models.CharField(max_length=100) isbn = models.CharField(max_length=13) #an ISBN is a unique, 13-character identifier assigned to every published book. def __str__(self): return self.title
28.692308
83
0.726542
52
373
5.057692
0.615385
0.228137
0.273764
0.365019
0.205323
0
0
0
0
0
0
0.042763
0.184987
373
12
84
31.083333
0.822368
0.209115
0
0
0
0
0
0
0
0
0
0
0
1
0.125
false
0
0.125
0.125
1
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
5
c59c4d0c74e4459e813f633c55e894584fb7ca00
157
py
Python
DiscreteMath/descartes_multiplication.py
limitedeternity/some-gists
c9e3279a0e2c1eef2b10b28f61176ac7a7ffa1fe
[ "MIT" ]
4
2019-12-15T17:17:35.000Z
2022-01-08T22:28:54.000Z
DiscreteMath/descartes_multiplication.py
limitedeternity/some-gists
c9e3279a0e2c1eef2b10b28f61176ac7a7ffa1fe
[ "MIT" ]
null
null
null
DiscreteMath/descartes_multiplication.py
limitedeternity/some-gists
c9e3279a0e2c1eef2b10b28f61176ac7a7ffa1fe
[ "MIT" ]
null
null
null
from functools import reduce from itertools import product # -> [(1, 1), (1, 4), (2, 1), (2, 4), (3, 1), (3, 4)] list(reduce(product, [(1, 2, 3), (1, 4)]))
26.166667
53
0.541401
28
157
3.035714
0.392857
0.188235
0
0
0
0
0
0
0
0
0
0.132813
0.184713
157
5
54
31.4
0.53125
0.324841
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
c5ac803e24649b72cdabe2230f4496fc3e249926
178
py
Python
lmctl/environment/__init__.py
manojn97/lmctl
844925cb414722351efac90cb97f10c1185eef7a
[ "Apache-2.0" ]
3
2021-07-19T09:46:01.000Z
2022-03-07T13:51:25.000Z
lmctl/environment/__init__.py
manojn97/lmctl
844925cb414722351efac90cb97f10c1185eef7a
[ "Apache-2.0" ]
43
2019-08-27T12:36:29.000Z
2020-08-27T14:50:40.000Z
lmctl/environment/__init__.py
manojn97/lmctl
844925cb414722351efac90cb97f10c1185eef7a
[ "Apache-2.0" ]
7
2020-09-22T20:32:17.000Z
2022-03-29T12:25:51.000Z
from .armenv import ArmEnvironment, ArmSession, ArmSessionConfig from .lmenv import TNCOEnvironment, LmEnvironment, LmSession, LmSessionConfig from .group import EnvironmentGroup
59.333333
77
0.865169
17
178
9.058824
0.764706
0
0
0
0
0
0
0
0
0
0
0
0.089888
178
3
78
59.333333
0.950617
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
681927c17d6c08423e779772e6caffdfa831f104
29
py
Python
model/__init__.py
ResByte/aptos-blindness-pytorch
7e0825336d1c1a82c8a4a405102df713580ec184
[ "Apache-2.0" ]
null
null
null
model/__init__.py
ResByte/aptos-blindness-pytorch
7e0825336d1c1a82c8a4a405102df713580ec184
[ "Apache-2.0" ]
null
null
null
model/__init__.py
ResByte/aptos-blindness-pytorch
7e0825336d1c1a82c8a4a405102df713580ec184
[ "Apache-2.0" ]
null
null
null
from .model import AptosModel
29
29
0.862069
4
29
6.25
1
0
0
0
0
0
0
0
0
0
0
0
0.103448
29
1
29
29
0.961538
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
a892d34d1fc00b5db25c96bb5a9e42918811789b
236
py
Python
CREED_VTK/telescope/__init__.py
thomasgas/CREED_VTK
2bc1a684305303620278f410d602d25b179a0d92
[ "MIT" ]
null
null
null
CREED_VTK/telescope/__init__.py
thomasgas/CREED_VTK
2bc1a684305303620278f410d602d25b179a0d92
[ "MIT" ]
7
2018-12-07T16:33:52.000Z
2019-03-20T22:29:32.000Z
CREED_VTK/telescope/__init__.py
thomasgas/CREED_VTK
2bc1a684305303620278f410d602d25b179a0d92
[ "MIT" ]
null
null
null
from .LST import * from .MST import * from .SST import * __all__ = ['LST_tel_structure', 'LST_create_mirror_plane', 'MST_create_mirror_plane', 'MST_tel_structure', 'SST_primary_mirror_plane', 'SST_tel_structure']
29.5
59
0.707627
31
236
4.774194
0.387097
0.243243
0.22973
0.27027
0
0
0
0
0
0
0
0
0.182203
236
7
60
33.714286
0.766839
0
0
0
0
0
0.512712
0.29661
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
a89f61edf125edb5dca380c8db0a42e23add23d0
210
py
Python
setup.py
bpizzani/BankAccountPackage
60b158dbb8b7a619fb7713cbca279800e80c233f
[ "MIT" ]
null
null
null
setup.py
bpizzani/BankAccountPackage
60b158dbb8b7a619fb7713cbca279800e80c233f
[ "MIT" ]
null
null
null
setup.py
bpizzani/BankAccountPackage
60b158dbb8b7a619fb7713cbca279800e80c233f
[ "MIT" ]
null
null
null
from setuptools import setup setup(name="bank_account_pizzani", version = "0.1", description = "Bank Account", packages = ["bank_account_pizzani"], author = "Bruno Pizzani Mendoza", zip_safe=False)
26.25
38
0.719048
26
210
5.615385
0.730769
0.226027
0.246575
0
0
0
0
0
0
0
0
0.011299
0.157143
210
8
39
26.25
0.813559
0
0
0
0
0
0.372549
0
0
0
0
0
0
1
0
true
0
0.142857
0
0.142857
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
1
0
0
0
0
0
0
5
767ab749b9f526f04bb7ea0a206f6d3ce8f6f874
79
py
Python
ac_compiler/util/__init__.py
nicklambourne/crafting-a-compiler
4dde7390f4bdf83dedaca2e8b8b83ee42d270638
[ "BSD-3-Clause" ]
4
2020-04-03T14:06:46.000Z
2021-12-20T12:53:10.000Z
ac_compiler/util/__init__.py
nicklambourne/crafting-a-compiler
4dde7390f4bdf83dedaca2e8b8b83ee42d270638
[ "BSD-3-Clause" ]
null
null
null
ac_compiler/util/__init__.py
nicklambourne/crafting-a-compiler
4dde7390f4bdf83dedaca2e8b8b83ee42d270638
[ "BSD-3-Clause" ]
1
2021-02-11T22:34:39.000Z
2021-02-11T22:34:39.000Z
from .error import LexicalError, SyntaxParsingError, SymbolError, SemanticError
79
79
0.873418
7
79
9.857143
1
0
0
0
0
0
0
0
0
0
0
0
0.075949
79
1
79
79
0.945205
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
76c6cbdd30dae099456d9ff16393ef8ad736f1a7
42,388
py
Python
src/ifeatpro/features.py
deeprob/ifeatpro
e91006334d3644529df0005304d3ba9639be8824
[ "MIT" ]
null
null
null
src/ifeatpro/features.py
deeprob/ifeatpro
e91006334d3644529df0005304d3ba9639be8824
[ "MIT" ]
null
null
null
src/ifeatpro/features.py
deeprob/ifeatpro
e91006334d3644529df0005304d3ba9639be8824
[ "MIT" ]
null
null
null
import re from collections import Counter import os import math import numpy as np from importlib.resources import open_text from . import data FEAT_TYPES = ('aac', 'cksaap', 'tpc', 'dpc', 'dde', 'gaac', 'cksaagp', 'gtpc', 'gdpc', 'moran', 'geary', 'nmbroto', 'ctdc', 'ctdt', 'ctdd', 'ctriad', 'ksctriad', 'socnumber', 'qsorder', 'paac', 'apaac') def read_fasta(file): """ Reads a fasta file and returns a list of lists where the inner list contains an enzyme name and sequence. :param file: filepath to the fasta file :return: nested list where each inner list contains an enzyme name and its sequence """ if not os.path.exists(file): raise ValueError('Error: "' + file + '" does not exist.') with open(file) as f: records = f.read() if re.search('>', records) is None: raise TypeError('The input file does not seem to be in fasta format.') records = records.split('>')[1:] myFasta = [] for fasta in records: array = fasta.split('\n') name, sequence = array[0].split()[0], re.sub('[^ARNDCQEGHILKMFPSTWYV-]', '-', ''.join(array[1:]).upper()) myFasta.append([name, sequence]) return myFasta def min_seq_len(fastas): """ A function to determine the length of the shortest sequence in the given fasta file :param fastas: :return: """ minLen = 10000 for i in fastas: if minLen > len(i[1]): minLen = len(i[1]) return minLen def min_seq_len_norm_aa(fastas): """ A function to determine the length of the shortest sequence in the given fasta file where sequences can only be represented by the set of 20 "Normal" amino acids :param fastas: :return: """ minLen = 10000 for i in fastas: if minLen > len(re.sub('-', '', i[1])): minLen = len(re.sub('-', '', i[1])) return minLen def save_csv(encodings, file='encoding.csv'): """ Save the protein feature encodings in a csv file :param encodings: :param file: :return: """ with open(file, 'w') as f: for lines in encodings: f.write(','.join(map(str, lines))) f.write('\n') return None def aac(fastas, **kw): """ Function to create Amino Acid Composition encoding of protein sequences :param fastas: protein sequences in fasta format :param kw: optional keyword arguments that can be provided by the user :return: Amino Acid Composition encoding """ AA = kw['order'] if kw['order'] is not None else 'ACDEFGHIKLMNPQRSTVWY' encodings = [] for i in fastas: name, sequence = i[0], re.sub('-', '', i[1]) count = Counter(sequence) for key in count: count[key] = count[key] / len(sequence) code = [name] for aa in AA: code.append(count[aa]) encodings.append(code) return encodings def apaac(fastas, lambda_value=30, w=0.05, **kw): """ Function to generate the pseudo amino acid encoding of protein sequences :param fastas: :param lambda_value: :param w: :param kw: Not required in this case. It is given to increase make function calling generalizable :return: """ if min_seq_len_norm_aa(fastas) < lambda_value + 1: raise AssertionError('All sequences should have length larger than parameter lambda_value:' + str(lambda_value + 1)) # data_dir = os.path.dirname(os.path.realpath(__file__)) # data_file = os.path.join(data_dir, 'data', 'PAAC.txt') # with open(data_file) as f: # records = f.readlines() records = open_text(data, "PAAC.txt").readlines() AA = ''.join(records[0].rstrip().split()[1:]) AADict = {} for i in range(len(AA)): AADict[AA[i]] = i AAProperty = [] AAPropertyNames = [] for i in range(1, len(records) - 1): array = records[i].rstrip().split() if records[i].rstrip() != '' else None AAProperty.append([float(j) for j in array[1:]]) AAPropertyNames.append(array[0]) AAProperty1 = [] for i in AAProperty: meanI = sum(i) / 20 fenmu = math.sqrt(sum([(j - meanI) ** 2 for j in i]) / 20) AAProperty1.append([(j - meanI) / fenmu for j in i]) encodings = [] for i in fastas: name, sequence = i[0], re.sub('-', '', i[1]) code = [name] theta = [] for n in range(1, lambda_value + 1): for j in range(len(AAProperty1)): theta.append(sum([AAProperty1[j][AADict[sequence[k]]] * AAProperty1[j][AADict[sequence[k + n]]] for k in range(len(sequence) - n)]) / (len(sequence) - n)) myDict = {} for aa in AA: myDict[aa] = sequence.count(aa) code = code + [myDict[aa] / (1 + w * sum(theta)) for aa in AA] code = code + [w * value / (1 + w * sum(theta)) for value in theta] encodings.append(code) return encodings def gen_group_pairs(group_key): """ Helper function for cksaagp :param group_key: :return: """ gPair = {} for key1 in group_key: for key2 in group_key: gPair[key1 + '.' + key2] = 0 return gPair def cksaagp(fastas, gap=5, **kw): """ Function to generate cksaagp encoding of protein sequences :param fastas: :param gap: :param kw: :return: """ if gap < 0: raise AssertionError('Gap should be equal or greater than zero') if min_seq_len(fastas) < gap + 2: raise AssertionError(f"All sequences should have length greater than the (gap value) + 2 = {str(gap + 2)}") group = { 'alphaticr': 'GAVLMI', 'aromatic': 'FYW', 'postivecharger': 'KRH', 'negativecharger': 'DE', 'uncharger': 'STCPNQ' } AA = 'ARNDCQEGHILKMFPSTWYV' groupKey = group.keys() index = {} for key in groupKey: for aa in group[key]: index[aa] = key gPairIndex = [] for key1 in groupKey: for key2 in groupKey: gPairIndex.append(key1 + '.' + key2) encodings = [] for i in fastas: name, sequence = i[0], re.sub('-', '', i[1]) code = [name] for g in range(gap + 1): gPair = gen_group_pairs(groupKey) sum_var = 0 for p1 in range(len(sequence)): p2 = p1 + g + 1 if p2 < len(sequence) and sequence[p1] in AA and sequence[p2] in AA: gPair[index[sequence[p1]] + '.' + index[sequence[p2]]] = gPair[index[sequence[p1]] + '.' + index[ sequence[p2]]] + 1 sum_var = sum_var + 1 if sum_var == 0: for _ in gPairIndex: code.append(0) else: for gp in gPairIndex: code.append(gPair[gp] / sum_var) encodings.append(code) return encodings def cksaap(fastas, gap=5, **kw): """ Function to generate cksaap encoding for protein sequences :param fastas: :param gap: :param kw: :return: """ if gap < 0: raise AssertionError("Gap should be equal or greater than zero") if min_seq_len(fastas) < gap + 2: raise AssertionError(f"All sequences should have length greater than the (gap value) + 2 = {str(gap + 2)}") AA = kw['order'] if kw['order'] is not None else 'ACDEFGHIKLMNPQRSTVWY' encodings = [] aaPairs = [] for aa1 in AA: for aa2 in AA: aaPairs.append(aa1 + aa2) for i in fastas: name, sequence = i[0], i[1] code = [name] for g in range(gap + 1): myDict = {} for pair in aaPairs: myDict[pair] = 0 sum_var = 0 for index1 in range(len(sequence)): index2 = index1 + g + 1 if index1 < len(sequence) and index2 < len(sequence) and sequence[index1] in AA \ and sequence[index2] in AA: myDict[sequence[index1] + sequence[index2]] = myDict[sequence[index1] + sequence[index2]] + 1 sum_var = sum_var + 1 for pair in aaPairs: code.append(myDict[pair] / sum_var) encodings.append(code) return encodings def count_ctdc(seq1, seq2): """ helper function for ctdc encoding :param seq1: :param seq2: :return: """ sum_var = 0 for aa in seq1: sum_var = sum_var + seq2.count(aa) return sum_var def ctdc(fastas, **kw): """ Function to generate ctdc encoding for protein sequences :param fastas: :param kw: :return: """ group1 = { 'hydrophobicity_PRAM900101': 'RKEDQN', 'hydrophobicity_ARGP820101': 'QSTNGDE', 'hydrophobicity_ZIMJ680101': 'QNGSWTDERA', 'hydrophobicity_PONP930101': 'KPDESNQT', 'hydrophobicity_CASG920101': 'KDEQPSRNTG', 'hydrophobicity_ENGD860101': 'RDKENQHYP', 'hydrophobicity_FASG890101': 'KERSQD', 'normwaalsvolume': 'GASTPDC', 'polarity': 'LIFWCMVY', 'polarizability': 'GASDT', 'charge': 'KR', 'secondarystruct': 'EALMQKRH', 'solventaccess': 'ALFCGIVW' } group2 = { 'hydrophobicity_PRAM900101': 'GASTPHY', 'hydrophobicity_ARGP820101': 'RAHCKMV', 'hydrophobicity_ZIMJ680101': 'HMCKV', 'hydrophobicity_PONP930101': 'GRHA', 'hydrophobicity_CASG920101': 'AHYMLV', 'hydrophobicity_ENGD860101': 'SGTAW', 'hydrophobicity_FASG890101': 'NTPG', 'normwaalsvolume': 'NVEQIL', 'polarity': 'PATGS', 'polarizability': 'CPNVEQIL', 'charge': 'ANCQGHILMFPSTWYV', 'secondarystruct': 'VIYCWFT', 'solventaccess': 'RKQEND' } group3 = { 'hydrophobicity_PRAM900101': 'CLVIMFW', 'hydrophobicity_ARGP820101': 'LYPFIW', 'hydrophobicity_ZIMJ680101': 'LPFYI', 'hydrophobicity_PONP930101': 'YMFWLCVI', 'hydrophobicity_CASG920101': 'FIWC', 'hydrophobicity_ENGD860101': 'CVLIMF', 'hydrophobicity_FASG890101': 'AYHWVMFLIC', 'normwaalsvolume': 'MHKFRYW', 'polarity': 'HQRKNED', 'polarizability': 'KMHFRYW', 'charge': 'DE', 'secondarystruct': 'GNPSD', 'solventaccess': 'MSPTHY' } groups = [group1, group2, group3] property_var = ( 'hydrophobicity_PRAM900101', 'hydrophobicity_ARGP820101', 'hydrophobicity_ZIMJ680101', 'hydrophobicity_PONP930101', 'hydrophobicity_CASG920101', 'hydrophobicity_ENGD860101', 'hydrophobicity_FASG890101', 'normwaalsvolume', 'polarity', 'polarizability', 'charge', 'secondarystruct', 'solventaccess') encodings = [] for i in fastas: name, sequence = i[0], re.sub('-', '', i[1]) code = [name] for p in property_var: c1 = count_ctdc(group1[p], sequence) / len(sequence) c2 = count_ctdc(group2[p], sequence) / len(sequence) c3 = 1 - c1 - c2 code = code + [c1, c2, c3] encodings.append(code) return encodings def count_ctdd(aa_set, sequence): """ helper function for ctdd encoding :param aa_set: :param sequence: :return: """ number = 0 for aa in sequence: if aa in aa_set: number = number + 1 cutoffNums = [1, math.floor(0.25 * number), math.floor(0.50 * number), math.floor(0.75 * number), number] cutoffNums = [i if i >= 1 else 1 for i in cutoffNums] code = [] for cutoff in cutoffNums: myCount = 0 for i in range(len(sequence)): if sequence[i] in aa_set: myCount += 1 if myCount == cutoff: code.append((i + 1) / len(sequence) * 100) break if myCount == 0: code.append(0) return code def ctdd(fastas, **kw): """ Function to generate ctdd encoding for protein sequences :param fastas: :param kw: :return: """ group1 = { 'hydrophobicity_PRAM900101': 'RKEDQN', 'hydrophobicity_ARGP820101': 'QSTNGDE', 'hydrophobicity_ZIMJ680101': 'QNGSWTDERA', 'hydrophobicity_PONP930101': 'KPDESNQT', 'hydrophobicity_CASG920101': 'KDEQPSRNTG', 'hydrophobicity_ENGD860101': 'RDKENQHYP', 'hydrophobicity_FASG890101': 'KERSQD', 'normwaalsvolume': 'GASTPDC', 'polarity': 'LIFWCMVY', 'polarizability': 'GASDT', 'charge': 'KR', 'secondarystruct': 'EALMQKRH', 'solventaccess': 'ALFCGIVW' } group2 = { 'hydrophobicity_PRAM900101': 'GASTPHY', 'hydrophobicity_ARGP820101': 'RAHCKMV', 'hydrophobicity_ZIMJ680101': 'HMCKV', 'hydrophobicity_PONP930101': 'GRHA', 'hydrophobicity_CASG920101': 'AHYMLV', 'hydrophobicity_ENGD860101': 'SGTAW', 'hydrophobicity_FASG890101': 'NTPG', 'normwaalsvolume': 'NVEQIL', 'polarity': 'PATGS', 'polarizability': 'CPNVEQIL', 'charge': 'ANCQGHILMFPSTWYV', 'secondarystruct': 'VIYCWFT', 'solventaccess': 'RKQEND' } group3 = { 'hydrophobicity_PRAM900101': 'CLVIMFW', 'hydrophobicity_ARGP820101': 'LYPFIW', 'hydrophobicity_ZIMJ680101': 'LPFYI', 'hydrophobicity_PONP930101': 'YMFWLCVI', 'hydrophobicity_CASG920101': 'FIWC', 'hydrophobicity_ENGD860101': 'CVLIMF', 'hydrophobicity_FASG890101': 'AYHWVMFLIC', 'normwaalsvolume': 'MHKFRYW', 'polarity': 'HQRKNED', 'polarizability': 'KMHFRYW', 'charge': 'DE', 'secondarystruct': 'GNPSD', 'solventaccess': 'MSPTHY' } property_var = ( 'hydrophobicity_PRAM900101', 'hydrophobicity_ARGP820101', 'hydrophobicity_ZIMJ680101', 'hydrophobicity_PONP930101', 'hydrophobicity_CASG920101', 'hydrophobicity_ENGD860101', 'hydrophobicity_FASG890101', 'normwaalsvolume', 'polarity', 'polarizability', 'charge', 'secondarystruct', 'solventaccess') encodings = [] for i in fastas: name, sequence = i[0], re.sub('-', '', i[1]) code = [name] for p in property_var: code = code + count_ctdd(group1[p], sequence) + \ count_ctdd(group2[p], sequence) + count_ctdd(group3[p], sequence) encodings.append(code) return encodings def ctdt(fastas, **kw): """ Function to generate ctdt encoding for protein sequences :param fastas: :param kw: :return: """ group1 = { 'hydrophobicity_PRAM900101': 'RKEDQN', 'hydrophobicity_ARGP820101': 'QSTNGDE', 'hydrophobicity_ZIMJ680101': 'QNGSWTDERA', 'hydrophobicity_PONP930101': 'KPDESNQT', 'hydrophobicity_CASG920101': 'KDEQPSRNTG', 'hydrophobicity_ENGD860101': 'RDKENQHYP', 'hydrophobicity_FASG890101': 'KERSQD', 'normwaalsvolume': 'GASTPDC', 'polarity': 'LIFWCMVY', 'polarizability': 'GASDT', 'charge': 'KR', 'secondarystruct': 'EALMQKRH', 'solventaccess': 'ALFCGIVW' } group2 = { 'hydrophobicity_PRAM900101': 'GASTPHY', 'hydrophobicity_ARGP820101': 'RAHCKMV', 'hydrophobicity_ZIMJ680101': 'HMCKV', 'hydrophobicity_PONP930101': 'GRHA', 'hydrophobicity_CASG920101': 'AHYMLV', 'hydrophobicity_ENGD860101': 'SGTAW', 'hydrophobicity_FASG890101': 'NTPG', 'normwaalsvolume': 'NVEQIL', 'polarity': 'PATGS', 'polarizability': 'CPNVEQIL', 'charge': 'ANCQGHILMFPSTWYV', 'secondarystruct': 'VIYCWFT', 'solventaccess': 'RKQEND' } group3 = { 'hydrophobicity_PRAM900101': 'CLVIMFW', 'hydrophobicity_ARGP820101': 'LYPFIW', 'hydrophobicity_ZIMJ680101': 'LPFYI', 'hydrophobicity_PONP930101': 'YMFWLCVI', 'hydrophobicity_CASG920101': 'FIWC', 'hydrophobicity_ENGD860101': 'CVLIMF', 'hydrophobicity_FASG890101': 'AYHWVMFLIC', 'normwaalsvolume': 'MHKFRYW', 'polarity': 'HQRKNED', 'polarizability': 'KMHFRYW', 'charge': 'DE', 'secondarystruct': 'GNPSD', 'solventaccess': 'MSPTHY' } property_var = ( 'hydrophobicity_PRAM900101', 'hydrophobicity_ARGP820101', 'hydrophobicity_ZIMJ680101', 'hydrophobicity_PONP930101', 'hydrophobicity_CASG920101', 'hydrophobicity_ENGD860101', 'hydrophobicity_FASG890101', 'normwaalsvolume', 'polarity', 'polarizability', 'charge', 'secondarystruct', 'solventaccess') encodings = [] for i in fastas: name, sequence = i[0], re.sub('-', '', i[1]) code = [name] aaPair = [sequence[j:j + 2] for j in range(len(sequence) - 1)] for p in property_var: c1221, c1331, c2332 = 0, 0, 0 for pair in aaPair: if (pair[0] in group1[p] and pair[1] in group2[p]) or (pair[0] in group2[p] and pair[1] in group1[p]): c1221 = c1221 + 1 continue if (pair[0] in group1[p] and pair[1] in group3[p]) or (pair[0] in group3[p] and pair[1] in group1[p]): c1331 = c1331 + 1 continue if (pair[0] in group2[p] and pair[1] in group3[p]) or (pair[0] in group3[p] and pair[1] in group2[p]): c2332 = c2332 + 1 code = code + [c1221 / len(aaPair), c1331 / len(aaPair), c2332 / len(aaPair)] encodings.append(code) return encodings def calc_ksctriad(sequence, gap, features, aa_dict): """ Helper function for ctraid and ksctraid :param sequence: :param gap: :param features: :param aa_dict: :return: """ res = [] for g in range(gap + 1): myDict = {} for f in features: myDict[f] = 0 for i in range(len(sequence)): if i + gap + 1 < len(sequence) and i + 2 * gap + 2 < len(sequence): fea = aa_dict[sequence[i]] + '.' + aa_dict[sequence[i + gap + 1]] + '.' + aa_dict[ sequence[i + 2 * gap + 2]] myDict[fea] = myDict[fea] + 1 maxValue, minValue = max(myDict.values()), min(myDict.values()) for f in features: res.append((myDict[f] - minValue) / maxValue) return res def ctriad(fastas, **kw): """ Function to generate ctriad encoding for protein sequences :param fastas: :param kw: :return: """ # TODO: Need to check if the gap parameter should be kept or is it only needed for ksctriad AAGroup = { 'g1': 'AGV', 'g2': 'ILFP', 'g3': 'YMTS', 'g4': 'HNQW', 'g5': 'RK', 'g6': 'DE', 'g7': 'C' } myGroups = sorted(AAGroup.keys()) AADict = {} for g in myGroups: for aa in AAGroup[g]: AADict[aa] = g features = [f1 + '.' + f2 + '.' + f3 for f1 in myGroups for f2 in myGroups for f3 in myGroups] encodings = [] for i in fastas: name, sequence = i[0], re.sub('-', '', i[1]) code = [name] if len(sequence) < 3: print('Error: for "CTriad" encoding, the input fasta sequences should be greater than 3. \n\n') return 0 code = code + calc_ksctriad(sequence, 0, features, AADict) encodings.append(code) return encodings def dde(fastas, **kw): """ Function to generate dde encoding for protein sequences :param fastas: :param kw: :return: """ AA = kw['order'] if kw['order'] is not None else 'ACDEFGHIKLMNPQRSTVWY' myCodons = { 'A': 4, 'C': 2, 'D': 2, 'E': 2, 'F': 2, 'G': 4, 'H': 2, 'I': 3, 'K': 2, 'L': 6, 'M': 1, 'N': 2, 'P': 4, 'Q': 2, 'R': 6, 'S': 6, 'T': 4, 'V': 4, 'W': 1, 'Y': 2 } encodings = [] diPeptides = [aa1 + aa2 for aa1 in AA for aa2 in AA] myTM = [] for pair in diPeptides: myTM.append((myCodons[pair[0]] / 61) * (myCodons[pair[1]] / 61)) AADict = {} for i in range(len(AA)): AADict[AA[i]] = i for i in fastas: name, sequence = i[0], re.sub('-', '', i[1]) code = [name] tmpCode = [0] * 400 for j in range(len(sequence) - 2 + 1): tmpCode[AADict[sequence[j]] * 20 + AADict[sequence[j + 1]]] = tmpCode[AADict[sequence[j]] * 20 + AADict[ sequence[j + 1]]] + 1 if sum(tmpCode) != 0: tmpCode = [i / sum(tmpCode) for i in tmpCode] myTV = [] for j in range(len(myTM)): myTV.append(myTM[j] * (1 - myTM[j]) / (len(sequence) - 1)) for j in range(len(tmpCode)): tmpCode[j] = (tmpCode[j] - myTM[j]) / math.sqrt(myTV[j]) code = code + tmpCode encodings.append(code) return encodings def dpc(fastas, **kw): """ Function to generate dpc encoding for protein sequences :param fastas: :param kw: :return: """ AA = kw['order'] if kw['order'] is not None else 'ACDEFGHIKLMNPQRSTVWY' encodings = [] diPeptides = [aa1 + aa2 for aa1 in AA for aa2 in AA] AADict = {} for i in range(len(AA)): AADict[AA[i]] = i for i in fastas: name, sequence = i[0], re.sub('-', '', i[1]) code = [name] tmpCode = [0] * 400 for j in range(len(sequence) - 2 + 1): tmpCode[AADict[sequence[j]] * 20 + AADict[sequence[j + 1]]] = tmpCode[AADict[sequence[j]] * 20 + AADict[ sequence[j + 1]]] + 1 if sum(tmpCode) != 0: tmpCode = [i / sum(tmpCode) for i in tmpCode] code = code + tmpCode encodings.append(code) return encodings def gaac(fastas, **kw): """ Function to generate gaac encoding for protein sequences :param fastas: :param kw: :return: """ group = { 'alphatic': 'GAVLMI', 'aromatic': 'FYW', 'postivecharge': 'KRH', 'negativecharge': 'DE', 'uncharge': 'STCPNQ' } groupKey = group.keys() encodings = [] for i in fastas: name, sequence = i[0], re.sub('-', '', i[1]) code = [name] count = Counter(sequence) myDict = {} for key in groupKey: for aa in group[key]: myDict[key] = myDict.get(key, 0) + count[aa] for key in groupKey: code.append(myDict[key] / len(sequence)) encodings.append(code) return encodings def gdpc(fastas, **kw): """ Function to generate gdpc encoding for protein sequences :param fastas: :param kw: :return: """ group = { 'alphaticr': 'GAVLMI', 'aromatic': 'FYW', 'postivecharger': 'KRH', 'negativecharger': 'DE', 'uncharger': 'STCPNQ' } groupKey = group.keys() dipeptide = [g1 + '.' + g2 for g1 in groupKey for g2 in groupKey] index = {} for key in groupKey: for aa in group[key]: index[aa] = key encodings = [] for i in fastas: name, sequence = i[0], re.sub('-', '', i[1]) code = [name] myDict = {} for t in dipeptide: myDict[t] = 0 sum_var = 0 for j in range(len(sequence) - 2 + 1): myDict[index[sequence[j]] + '.' + index[sequence[j + 1]]] = myDict[index[sequence[j]] + '.' + index[ sequence[j + 1]]] + 1 sum_var = sum_var + 1 if sum_var == 0: for _ in dipeptide: code.append(0) else: for t in dipeptide: code.append(myDict[t] / sum_var) encodings.append(code) return encodings def geary(fastas, props=('CIDH920105', 'BHAR880101', 'CHAM820101', 'CHAM820102', 'CHOC760101', 'BIGC670101', 'CHAM810101', 'DAYM780201'), nlag=30, **kw): """ Function to generate geary encoding for protein sequences :param fastas: :param props: :param nlag: :param kw: :return: """ if min_seq_len_norm_aa(fastas) < nlag + 1: raise AssertionError(f"All sequences should have length greater than nlag+1: {str(nlag + 1)}") AA = 'ARNDCQEGHILKMFPSTWYV' data_dir = os.path.dirname(os.path.realpath(__file__)) data_file = os.path.join(data_dir, 'data', 'AAidx.txt') with open(data_file) as f: records = f.readlines()[1:] myDict = {} for i in records: array = i.rstrip().split('\t') myDict[array[0]] = array[1:] aa_idx = [] aa_idx_name = [] for i in props: if i in myDict: aa_idx.append(myDict[i]) aa_idx_name.append(i) else: print('"' + i + '" properties not exist.') return None aa_idx1 = np.array([float(j) for i in aa_idx for j in i]) aa_idx = aa_idx1.reshape((len(aa_idx), 20)) propMean = np.mean(aa_idx, axis=1) propStd = np.std(aa_idx, axis=1) for i in range(len(aa_idx)): for j in range(len(aa_idx[i])): aa_idx[i][j] = (aa_idx[i][j] - propMean[i]) / propStd[i] index = {} for i in range(len(AA)): index[AA[i]] = i encodings = [] for i in fastas: name, sequence = i[0], re.sub('-', '', i[1]) code = [name] N = len(sequence) for prop in range(len(props)): xmean = sum([aa_idx[prop][index[aa]] for aa in sequence]) / N for n in range(1, nlag + 1): if len(sequence) > nlag: # if key is '-', then the value is 0 rn = (N - 1) / (2 * (N - n)) * ((sum( [(aa_idx[prop][index.get(sequence[j], 0)] - aa_idx[prop][index.get(sequence[j + n], 0)]) ** 2 for j in range(len(sequence) - n)])) / (sum([(aa_idx[prop][index.get(sequence[j], 0)] - xmean) ** 2 for j in range(len(sequence))]))) else: rn = 'NA' code.append(rn) encodings.append(code) return encodings def gtpc(fastas, **kw): """ Function to generate gtpc encoding for protein sequences :param fastas: :param kw: :return: """ group = { 'alphaticr': 'GAVLMI', 'aromatic': 'FYW', 'postivecharger': 'KRH', 'negativecharger': 'DE', 'uncharger': 'STCPNQ' } groupKey = group.keys() triple = [g1 + '.' + g2 + '.' + g3 for g1 in groupKey for g2 in groupKey for g3 in groupKey] index = {} for key in groupKey: for aa in group[key]: index[aa] = key encodings = [] for i in fastas: name, sequence = i[0], re.sub('-', '', i[1]) code = [name] myDict = {} for t in triple: myDict[t] = 0 sum_var = 0 for j in range(len(sequence) - 3 + 1): myDict[index[sequence[j]] + '.' + index[sequence[j + 1]] + '.' + index[sequence[j + 2]]] = \ myDict[index[sequence[j]] + '.' + index[sequence[j + 1]] + '.' + index[sequence[j + 2]]] + 1 sum_var = sum_var + 1 if sum_var == 0: for _ in triple: code.append(0) else: for t in triple: code.append(myDict[t] / sum_var) encodings.append(code) return encodings def ksctriad(fastas, gap=0, **kw): """ Function to generate ksctriad encoding for protein sequences :param fastas: :param gap: :param kw: :return: """ AAGroup = { 'g1': 'AGV', 'g2': 'ILFP', 'g3': 'YMTS', 'g4': 'HNQW', 'g5': 'RK', 'g6': 'DE', 'g7': 'C' } myGroups = sorted(AAGroup.keys()) AADict = {} for g in myGroups: for aa in AAGroup[g]: AADict[aa] = g features = [f1 + '.' + f2 + '.' + f3 for f1 in myGroups for f2 in myGroups for f3 in myGroups] encodings = [] for i in fastas: name, sequence = i[0], re.sub('-', '', i[1]) code = [name] if len(sequence) < 2 * gap + 3: raise AssertionError(f"All sequences should have length greater than (2*gap+3): {str(2*gap+3)}") code = code + calc_ksctriad(sequence, gap, features, AADict) encodings.append(code) return encodings def moran(fastas, props=('CIDH920105', 'BHAR880101', 'CHAM820101', 'CHAM820102', 'CHOC760101', 'BIGC670101', 'CHAM810101', 'DAYM780201'), nlag=30, **kw): if min_seq_len_norm_aa(fastas) < nlag + 1: raise AssertionError(f"All sequences should have length greater than nlag+1: {str(nlag + 1)}") AA = 'ARNDCQEGHILKMFPSTWYV' data_dir = os.path.dirname(os.path.realpath(__file__)) data_file = os.path.join(data_dir, 'data', 'AAidx.txt') with open(data_file) as f: records = f.readlines()[1:] myDict = {} for i in records: array = i.rstrip().split('\t') myDict[array[0]] = array[1:] aa_idx = [] aa_idx_name = [] for i in props: if i in myDict: aa_idx.append(myDict[i]) aa_idx_name.append(i) else: print('"' + i + '" properties not exist.') return None aa_idx1 = np.array([float(j) for i in aa_idx for j in i]) aa_idx = aa_idx1.reshape((len(aa_idx), 20)) propMean = np.mean(aa_idx, axis=1) propStd = np.std(aa_idx, axis=1) for i in range(len(aa_idx)): for j in range(len(aa_idx[i])): aa_idx[i][j] = (aa_idx[i][j] - propMean[i]) / propStd[i] index = {} for i in range(len(AA)): index[AA[i]] = i encodings = [] for i in fastas: name, sequence = i[0], re.sub('-', '', i[1]) code = [name] N = len(sequence) for prop in range(len(props)): xmean = sum([aa_idx[prop][index[aa]] for aa in sequence]) / N for n in range(1, nlag + 1): if len(sequence) > nlag: # if key is '-', then the value is 0 fenzi = sum([(aa_idx[prop][index.get(sequence[j], 0)] - xmean) * ( aa_idx[prop][index.get(sequence[j + n], 0)] - xmean) for j in range(len(sequence) - n)]) / (N - n) fenmu = sum( [(aa_idx[prop][index.get(sequence[j], 0)] - xmean) ** 2 for j in range(len(sequence))]) / N rn = fenzi / fenmu else: rn = 'NA' code.append(rn) encodings.append(code) return encodings def nmbroto(fastas, props=('CIDH920105', 'BHAR880101', 'CHAM820101', 'CHAM820102', 'CHOC760101', 'BIGC670101', 'CHAM810101', 'DAYM780201'), nlag=30, **kw): """ Function to generate nmbroto encoding for protein sequences :param fastas: :param props: :param nlag: :param kw: :return: """ if min_seq_len_norm_aa(fastas) < nlag + 1: raise AssertionError(f"All sequences should have length greater than nlag+1: {str(nlag + 1)}") AA = 'ARNDCQEGHILKMFPSTWYV' data_dir = os.path.dirname(os.path.realpath(__file__)) data_file = os.path.join(data_dir, 'data', 'AAidx.txt') with open(data_file) as f: records = f.readlines()[1:] myDict = {} for i in records: array = i.rstrip().split('\t') myDict[array[0]] = array[1:] aa_idx = [] aa_idx_name = [] for i in props: if i in myDict: aa_idx.append(myDict[i]) aa_idx_name.append(i) else: print('"' + i + '" properties not exist.') return None aa_idx1 = np.array([float(j) for i in aa_idx for j in i]) aa_idx = aa_idx1.reshape((len(aa_idx), 20)) pstd = np.std(aa_idx, axis=1) pmean = np.average(aa_idx, axis=1) for i in range(len(aa_idx)): for j in range(len(aa_idx[i])): aa_idx[i][j] = (aa_idx[i][j] - pmean[i]) / pstd[i] index = {} for i in range(len(AA)): index[AA[i]] = i encodings = [] for i in fastas: name, sequence = i[0], re.sub('-', '', i[1]) code = [name] N = len(sequence) for prop in range(len(props)): for n in range(1, nlag + 1): if len(sequence) > nlag: # if key is '-', then the value is 0 rn = sum( [aa_idx[prop][index.get(sequence[j], 0)] * aa_idx[prop][index.get(sequence[j + n], 0)] for j in range(len(sequence) - n)]) / (N - n) else: rn = 'NA' code.append(rn) encodings.append(code) return encodings def r_value(aa1, aa2, aa_dict, matrix): """ :param aa1: :param aa2: :param aa_dict: :param matrix: :return: """ return sum([(matrix[i][aa_dict[aa1]] - matrix[i][aa_dict[aa2]]) ** 2 for i in range(len(matrix))]) / len(matrix) def paac(fastas, lambda_value=30, w=0.05, **kw): """ Function to generate paac encoding for protein sequences :param fastas: :param lambda_value: :param w: :param kw: :return: """ if min_seq_len_norm_aa(fastas) < lambda_value + 1: raise AssertionError(f'All sequences should have length greater than lambda_value+1: {str(lambda_value + 1)}') data_dir = os.path.dirname(os.path.realpath(__file__)) data_file = os.path.join(data_dir, 'data', 'PAAC.txt') with open(data_file) as f: records = f.readlines() AA = ''.join(records[0].rstrip().split()[1:]) AADict = {} for i in range(len(AA)): AADict[AA[i]] = i AAProperty = [] AAPropertyNames = [] for i in range(1, len(records)): array = records[i].rstrip().split() if records[i].rstrip() != '' else None AAProperty.append([float(j) for j in array[1:]]) AAPropertyNames.append(array[0]) AAProperty1 = [] for i in AAProperty: meanI = sum(i) / 20 fenmu = math.sqrt(sum([(j - meanI) ** 2 for j in i]) / 20) AAProperty1.append([(j - meanI) / fenmu for j in i]) encodings = [] for i in fastas: name, sequence = i[0], re.sub('-', '', i[1]) code = [name] theta = [] for n in range(1, lambda_value + 1): theta.append( sum([r_value(sequence[j], sequence[j + n], AADict, AAProperty1) for j in range(len(sequence) - n)]) / ( len(sequence) - n)) myDict = {} for aa in AA: myDict[aa] = sequence.count(aa) code = code + [myDict[aa] / (1 + w * sum(theta)) for aa in AA] code = code + [(w * j) / (1 + w * sum(theta)) for j in theta] encodings.append(code) return encodings def qsorder(fastas, nlag=30, w=0.1, **kw): """ Function to generate qsorder encoding for protein sequences :param fastas: :param nlag: :param w: :param kw: :return: """ if min_seq_len_norm_aa(fastas) < nlag + 1: raise AssertionError(f'All sequences should have length greater than the nlag+1: {str(nlag + 1)}') data_dir = os.path.dirname(os.path.realpath(__file__)) data_file = os.path.join(data_dir, 'data', 'Schneider-Wrede.txt') data_file1 = os.path.join(data_dir, 'data', 'Grantham.txt') AA = 'ACDEFGHIKLMNPQRSTVWY' AA1 = 'ARNDCQEGHILKMFPSTWYV' DictAA = {} for i in range(len(AA)): DictAA[AA[i]] = i DictAA1 = {} for i in range(len(AA1)): DictAA1[AA1[i]] = i with open(data_file) as f: records = f.readlines()[1:] AADistance = [] for i in records: array = i.rstrip().split()[1:] if i.rstrip() != '' else None AADistance.append(array) AADistance = np.array( [float(AADistance[i][j]) for i in range(len(AADistance)) for j in range(len(AADistance[i]))]).reshape((20, 20)) with open(data_file1) as f: records = f.readlines()[1:] AADistance1 = [] for i in records: array = i.rstrip().split()[1:] if i.rstrip() != '' else None AADistance1.append(array) AADistance1 = np.array( [float(AADistance1[i][j]) for i in range(len(AADistance1)) for j in range(len(AADistance1[i]))]).reshape( (20, 20)) encodings = [] for i in fastas: name, sequence = i[0], re.sub('-', '', i[1]) code = [name] arraySW = [] arrayGM = [] for n in range(1, nlag + 1): arraySW.append( sum([AADistance[DictAA[sequence[j]]][DictAA[sequence[j + n]]] ** 2 for j in range(len(sequence) - n)])) arrayGM.append(sum( [AADistance1[DictAA1[sequence[j]]][DictAA1[sequence[j + n]]] ** 2 for j in range(len(sequence) - n)])) myDict = {} for aa in AA1: myDict[aa] = sequence.count(aa) for aa in AA1: code.append(myDict[aa] / (1 + w * sum(arraySW))) for aa in AA1: code.append(myDict[aa] / (1 + w * sum(arrayGM))) for num in arraySW: code.append((w * num) / (1 + w * sum(arraySW))) for num in arrayGM: code.append((w * num) / (1 + w * sum(arrayGM))) encodings.append(code) return encodings def socnumber(fastas, nlag=30, **kw): """ Function to generate socnumber encoding for protein sequences :param fastas: :param nlag: :param kw: :return: """ if min_seq_len_norm_aa(fastas) < nlag + 1: print('Error: all the sequence length should be larger than the nlag+1: ' + str(nlag + 1) + '\n\n') return 0 data_dir = os.path.dirname(os.path.realpath(__file__)) data_file = os.path.join(data_dir, 'data', 'Schneider-Wrede.txt') data_file1 = os.path.join(data_dir, 'data', 'Grantham.txt') AA = 'ACDEFGHIKLMNPQRSTVWY' AA1 = 'ARNDCQEGHILKMFPSTWYV' DictAA = {} for i in range(len(AA)): DictAA[AA[i]] = i DictAA1 = {} for i in range(len(AA1)): DictAA1[AA1[i]] = i with open(data_file) as f: records = f.readlines()[1:] AADistance = [] for i in records: array = i.rstrip().split()[1:] if i.rstrip() != '' else None AADistance.append(array) AADistance = np.array( [float(AADistance[i][j]) for i in range(len(AADistance)) for j in range(len(AADistance[i]))]).reshape((20, 20)) with open(data_file1) as f: records = f.readlines()[1:] AADistance1 = [] for i in records: array = i.rstrip().split()[1:] if i.rstrip() != '' else None AADistance1.append(array) AADistance1 = np.array( [float(AADistance1[i][j]) for i in range(len(AADistance1)) for j in range(len(AADistance1[i]))]).reshape( (20, 20)) encodings = [] for i in fastas: name, sequence = i[0], re.sub('-', '', i[1]) code = [name] for n in range(1, nlag + 1): code.append(sum( [AADistance[DictAA[sequence[j]]][DictAA[sequence[j + n]]] ** 2 for j in range(len(sequence) - n)]) / ( len(sequence) - n)) for n in range(1, nlag + 1): code.append(sum([AADistance1[DictAA1[sequence[j]]][DictAA1[sequence[j + n]]] ** 2 for j in range(len(sequence) - n)]) / (len(sequence) - n)) encodings.append(code) return encodings def tpc(fastas, **kw): """ Function to generate tpc encoding for protein sequences :param fastas: :param kw: :return: """ AA = kw['order'] if kw['order'] is not None else 'ACDEFGHIKLMNPQRSTVWY' encodings = [] triPeptides = [aa1 + aa2 + aa3 for aa1 in AA for aa2 in AA for aa3 in AA] AADict = {} for i in range(len(AA)): AADict[AA[i]] = i for i in fastas: name, sequence = i[0], re.sub('-', '', i[1]) code = [name] tmpCode = [0] * 8000 for j in range(len(sequence) - 3 + 1): tmpCode[AADict[sequence[j]] * 400 + AADict[sequence[j + 1]] * 20 + AADict[sequence[j + 2]]] = \ tmpCode[AADict[sequence[j]] * 400 + AADict[sequence[j + 1]] * 20 + AADict[sequence[j + 2]]] + 1 if sum(tmpCode) != 0: tmpCode = [i / sum(tmpCode) for i in tmpCode] code = code + tmpCode encodings.append(code) return encodings def get_feature(protein_fasta_file, feature_type, output_dir): """ A function to create numerically encoded feature of a specific type for protein sequences :param protein_fasta_file: The path to a file that contains all the protein sequences in fasta format :param feature_type: The feature encoding type. Must be one of the 21 types mentioned in README :param output_dir: The path to a directory where the feature encoded files will be stored :return: Name of the output file where the features are stored """ if feature_type not in FEAT_TYPES: raise ValueError(f"feature_type must be one of {FEAT_TYPES}") fastas = read_fasta(protein_fasta_file) myOrder = 'ACDEFGHIKLMNPQRSTVWY' kw = {'order': myOrder} myFun = f"{feature_type}(fastas, **kw)" print('Descriptor type: ' + feature_type) encodings = eval(myFun) if os.path.exists(output_dir): if os.path.isdir(output_dir): output_file = os.path.join(output_dir, feature_type+'.csv') save_csv(encodings, output_file) return output_file else: raise OSError(f"output_dir: {output_dir} is not a directory!") else: raise OSError(f"output_dir: {output_dir} does not exist!") pass def get_all_features(fasta_file, output_dir): """ A function to create 21 numerically encoded features for protein sequences :param fasta_file: The path to a file that contains all the protein sequences in fasta format :param output_dir: The path to a directory where the feature encoded files will be stored :return: None """ for ft in FEAT_TYPES: get_feature(fasta_file, ft, output_dir) return
31.144747
121
0.551052
5,124
42,388
4.486924
0.085285
0.009134
0.017224
0.01244
0.779522
0.747684
0.72972
0.70558
0.679701
0.662042
0
0.043997
0.309899
42,388
1,360
122
31.167647
0.741966
0.102741
0
0.708686
0
0.004237
0.168476
0.057802
0
0
0
0.000735
0.011653
1
0.033898
false
0.001059
0.007415
0
0.080508
0.006356
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
4f313fd561713bd5d9466cda6f47f2b2066069bf
45
py
Python
test/testpack/anotherpack/anothermod.py
optimistiCli/ishwest_py3_toolbox
9181f8c874c90e42fb5c84128d1e74320f17bae9
[ "MIT" ]
null
null
null
test/testpack/anotherpack/anothermod.py
optimistiCli/ishwest_py3_toolbox
9181f8c874c90e42fb5c84128d1e74320f17bae9
[ "MIT" ]
null
null
null
test/testpack/anotherpack/anothermod.py
optimistiCli/ishwest_py3_toolbox
9181f8c874c90e42fb5c84128d1e74320f17bae9
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 class Oma(): pass
11.25
22
0.622222
7
45
4
1
0
0
0
0
0
0
0
0
0
0
0.027778
0.2
45
4
23
11.25
0.75
0.466667
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
5
4f6d0afb8a268374e3b1c5ba07a513f210657007
129
py
Python
venv/lib/python3.8/site-packages/crispy_forms/templates/bootstrap/layout/tab-link.html.py
Solurix/Flashcards-Django
03c863f6722936093927785a2b20b6b668bb743d
[ "MIT" ]
1
2021-05-16T03:20:23.000Z
2021-05-16T03:20:23.000Z
venv/lib/python3.8/site-packages/crispy_forms/templates/bootstrap3/layout/tab-link.html.py
Solurix/Flashcards-Django
03c863f6722936093927785a2b20b6b668bb743d
[ "MIT" ]
4
2021-03-30T14:06:09.000Z
2021-09-22T19:26:31.000Z
venv/lib/python3.8/site-packages/crispy_forms/templates/bootstrap3/layout/tab-link.html.py
Solurix/Flashcards-Django
03c863f6722936093927785a2b20b6b668bb743d
[ "MIT" ]
null
null
null
XXX XXXXXXXXXXXXXXXBB BBBBBBBB BB BBBBBBBBBBBBBB XXXXXXBBBBBXXXX XXXXXXXX XXXXXXXXXXXXXXXXXXFFFFFFFFBB BBBBBBBBBBXBBBBBXXXXXXXXX
64.5
128
0.930233
9
129
13.333333
1
0
0
0
0
0
0
0
0
0
0
0
0.069767
129
1
129
129
1
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
5
4f73d9ce60115378d13700603c019f7ad6179b81
208
py
Python
noheavenbot/utils/database_tables/__init__.py
Molanito13/noheaven-bot
ad126d4601321ecabff9d1d214ce7d3f4e258c3e
[ "MIT" ]
3
2018-10-13T14:05:24.000Z
2018-12-25T21:40:21.000Z
noheavenbot/utils/database_tables/__init__.py
Molanito13/noheaven-bot
ad126d4601321ecabff9d1d214ce7d3f4e258c3e
[ "MIT" ]
2
2018-10-08T14:33:39.000Z
2020-03-02T18:00:47.000Z
noheavenbot/utils/database_tables/__init__.py
Molanito13/noheaven-bot
ad126d4601321ecabff9d1d214ce7d3f4e258c3e
[ "MIT" ]
5
2018-10-08T14:18:58.000Z
2020-11-01T17:55:51.000Z
from .table_garch import Garch from .table_todo import Todo from .table_channels_name import TextChannels from .table_trusted_bots import TrustedBot __all__ = ['Garch', 'Todo', 'TextChannels', 'TrustedBot']
29.714286
57
0.802885
27
208
5.814815
0.444444
0.229299
0
0
0
0
0
0
0
0
0
0
0.110577
208
6
58
34.666667
0.848649
0
0
0
0
0
0.149038
0
0
0
0
0
0
1
0
false
0
0.8
0
0.8
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5