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
e05b4419b9e076c63a008102028b3f667fc31382
1,034
py
Python
train_and_test.py
esnet/hps-rl
8426652e622394a955a44c42201e2204f6bfa0f2
[ "BSD-3-Clause-LBNL" ]
null
null
null
train_and_test.py
esnet/hps-rl
8426652e622394a955a44c42201e2204f6bfa0f2
[ "BSD-3-Clause-LBNL" ]
null
null
null
train_and_test.py
esnet/hps-rl
8426652e622394a955a44c42201e2204f6bfa0f2
[ "BSD-3-Clause-LBNL" ]
null
null
null
from Steed.gymlabs.envs.cartpole_env import CartPoleEnv import Steed.simulation.rl_train_ddpg as ddpg import Steed.simulation.rl_play_ddpg as playddpg import Steed.simulation.rl_train_a2c as a2c import Steed.simulation.rl_play_a2c as playa2c import Steed.simulation.rl_play_aktr as playaktr import Steed.simulation.rl_train_aktr as aktr import Steed.simulation.rl_play_trpo as playtrpo import Steed.simulation.rl_train_trpo as trpo import torch import numpy as np from geneticalgorithm import geneticalgorithm as ga CUDA=False device = torch.device("cuda" if CUDA else "cpu") ##### Environment calling env = CartPoleEnv() test_env = CartPoleEnv() ##########################HPO######################################### ddpg.run_ddpq("Discrete",env,test_env,1,[400,300],device) #test for dynamic model playddpg.run_ddpg("Discrete",env,device) # aktr.run_aktr("Discrete",env,test_env,device) # playaktr.run_aktr("Discrete",env,device) # trpo.run_trpo("Discrete",env,test_env,device) # playtrpo.run_trpo("Discrete",env,test_env,device)
38.296296
81
0.764023
153
1,034
4.980392
0.294118
0.115486
0.220472
0.24147
0.401575
0.081365
0.081365
0
0
0
0
0.011555
0.079304
1,034
27
82
38.296296
0.788866
0.219536
0
0
0
0
0.031507
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
0eb37b96d5c71c02cb41c6c27c80736e5acaeb05
186
py
Python
tests/test_application/conftest.py
linkdd/triotp
7726438da36255c983d999490109f104655fb3fe
[ "MIT" ]
4
2021-11-26T21:39:17.000Z
2022-03-04T09:32:07.000Z
tests/test_application/conftest.py
linkdd/triotp
7726438da36255c983d999490109f104655fb3fe
[ "MIT" ]
1
2021-11-30T20:28:10.000Z
2021-12-01T01:03:28.000Z
tests/test_application/conftest.py
linkdd/triotp
7726438da36255c983d999490109f104655fb3fe
[ "MIT" ]
null
null
null
import pytest import trio class SampleData: def __init__(self): self.count = 0 self.stop = trio.Event() @pytest.fixture def test_data(): return SampleData()
12.4
32
0.645161
23
186
5
0.695652
0
0
0
0
0
0
0
0
0
0
0.007246
0.258065
186
14
33
13.285714
0.826087
0
0
0
0
0
0
0
0
0
0
0
0
1
0.222222
false
0
0.222222
0.111111
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4
0ecf6927c6d00097b9ae0b12b95395620d0093aa
4,105
py
Python
visitor.py
abusalimov/mk-sh-wrapper
a743dbf1cfc82d10da5dabae16c9ffaaee2cbd4a
[ "MIT" ]
1
2020-01-24T13:15:52.000Z
2020-01-24T13:15:52.000Z
visitor.py
abusalimov/mk-sh-wrapper
a743dbf1cfc82d10da5dabae16c9ffaaee2cbd4a
[ "MIT" ]
null
null
null
visitor.py
abusalimov/mk-sh-wrapper
a743dbf1cfc82d10da5dabae16c9ffaaee2cbd4a
[ "MIT" ]
null
null
null
from bashlex.ast import node class NodeVisitor: def _visit(self, n, *args, **kwargs): method_name = 'visit_' + n.kind visitor = getattr(self, method_name) return visitor(n, *args, **kwargs) def _visit_children(self, *children): if len(children) == 1: return self.visit(children[0]) for n in children: self.visit(n) def _visit_parts(self, parts): return [self.visit(part) for part in parts] def visit(self, n, **kwargs): if isinstance(n, list): return self._visit_children(*n, **kwargs) if not isinstance(n, node): return n k = n.kind if k == 'operator': return self._visit(n, n.op, **kwargs) if k == 'list': return self._visit(n, n.parts, **kwargs) if k == 'reservedword': return self._visit(n, n.word, **kwargs) if k == 'pipe': return self._visit(n, n.pipe, **kwargs) if k == 'pipeline': return self._visit(n, n.parts, **kwargs) if k == 'compound': return self._visit(n, n.list, n.redirects, **kwargs) if k in ('if', 'for', 'while', 'until'): return self._visit(n, n.parts, **kwargs) if k == 'command': return self._visit(n, n.parts, **kwargs) if k == 'function': return self._visit(n, n.name, n.body, n.parts, **kwargs) if k == 'redirect': return self._visit(n, n.input, n.type, n.output, n.heredoc, **kwargs) if k in ('word', 'assignment'): return self._visit(n, n.word, **kwargs) if k == 'wordtext': return self._visit(n, n.text, **kwargs) if k in ('parameter', 'tilde', 'heredoc'): return self._visit(n, n.value, **kwargs) if k in ('commandsubstitution', 'processsubstitution'): return self._visit(n, n.command, **kwargs) raise ValueError('unknown node kind %r' % k) def visit_operator(self, node, op, **kwargs): return self._visit_children(op) def visit_list(self, node, parts, **kwargs): return self._visit_children(parts) def visit_pipe(self, node, pipe, **kwargs): return self._visit_children(pipe) def visit_pipeline(self, node, parts, **kwargs): return self._visit_children(parts) def visit_compound(self, node, list_, redirects, **kwargs): return self._visit_children(list_, redirects) def visit_if(self, node, parts, **kwargs): return self._visit_children(parts) def visit_for(self, node, parts, **kwargs): return self._visit_children(parts) def visit_while(self, node, parts, **kwargs): return self._visit_children(parts) def visit_until(self, node, parts, **kwargs): return self._visit_children(parts) def visit_command(self, node, parts, **kwargs): return self._visit_children(parts) def visit_function(self, node, name, body, parts, **kwargs): return self._visit_children(name, body, parts) def visit_word(self, node, word, **kwargs): return self._visit_children(word) def visit_wordtext(self, node, text, **kwargs): return self._visit_children(text) def visit_assignment(self, node, word, **kwargs): return self._visit_children(word) def visit_reservedword(self, node, word, **kwargs): return self._visit_children(word) def visit_parameter(self, node, value, **kwargs): return self._visit_children(value) def visit_tilde(self, node, value, **kwargs): return self._visit_children(value) def visit_redirect(self, node, input_, type_, output, heredoc, **kwargs): return self._visit_children(input_, type_, output, heredoc) def visit_heredoc(self, node, value, **kwargs): return self._visit_children(value) def visit_processsubstitution(self, node, command, **kwargs): return self._visit_children(command) def visit_commandsubstitution(self, node, command, **kwargs): return self._visit_children(command)
40.643564
81
0.613642
521
4,105
4.65643
0.119002
0.144683
0.234955
0.218054
0.546167
0.424155
0.41014
0.41014
0.41014
0.292251
0
0.000653
0.25408
4,105
100
82
41.05
0.791639
0
0
0.233333
0
0
0.046053
0
0
0
0
0
0
1
0.277778
false
0
0.011111
0.244444
0.744444
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
4
0eeb22051238b483cfe79f098957693c727b3281
175
py
Python
python/message_broker_redis/mytasks.py
vleo/scriptum-notebook
bb9415e578b19e1b5811c7c5bb3c113d2cb4f88b
[ "MIT" ]
1
2017-12-14T22:30:33.000Z
2017-12-14T22:30:33.000Z
python/message_broker_redis/mytasks.py
vleo/scriptum-notebook
bb9415e578b19e1b5811c7c5bb3c113d2cb4f88b
[ "MIT" ]
4
2020-07-16T19:10:29.000Z
2021-09-01T01:28:27.000Z
python/message_broker_redis/mytasks.py
vleo/scriptum-notebook
bb9415e578b19e1b5811c7c5bb3c113d2cb4f88b
[ "MIT" ]
1
2018-11-08T08:32:48.000Z
2018-11-08T08:32:48.000Z
from __future__ import print_function from celery.decorators import task @task(default_retry_delay=300, max_retries=5) def mytask(name): return "Hello, {}".format(name)
21.875
45
0.777143
25
175
5.12
0.84
0
0
0
0
0
0
0
0
0
0
0.025974
0.12
175
7
46
25
0.805195
0
0
0
0
0
0.051429
0
0
0
0
0
0
1
0.2
false
0
0.4
0.2
0.8
0.2
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
1
0
0
0
4
0eefd212518da451d85d67c5a5f1d458525d299e
29
py
Python
ORC_R32IMAZicsr/build/Lattice_UP5K/pre_pack.py
mfkiwl/ORCs
f07111b918849078a417f9589073db284f8baf4b
[ "BSD-3-Clause" ]
3
2021-01-25T05:10:49.000Z
2021-09-13T19:46:50.000Z
ORC_R32IMAZicsr/build/Lattice_UP5K/pre_pack.py
mfkiwl/ORCs
f07111b918849078a417f9589073db284f8baf4b
[ "BSD-3-Clause" ]
null
null
null
ORC_R32IMAZicsr/build/Lattice_UP5K/pre_pack.py
mfkiwl/ORCs
f07111b918849078a417f9589073db284f8baf4b
[ "BSD-3-Clause" ]
1
2021-01-27T16:47:17.000Z
2021-01-27T16:47:17.000Z
ctx.addClock("i_clk", 12.00)
14.5
28
0.689655
6
29
3.166667
1
0
0
0
0
0
0
0
0
0
0
0.148148
0.068966
29
1
29
29
0.555556
0
0
0
0
0
0.172414
0
0
0
0
0
0
1
0
true
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
161225abb908dcb00ab2380d5b63a91429a94e8a
1,233
py
Python
stubs.min/System/Windows/Forms/__init___parts/DataGridViewCellStyleConverter.py
denfromufa/ironpython-stubs
4d2b405eda3ceed186e8adca55dd97c332c6f49d
[ "MIT" ]
1
2017-07-07T11:15:45.000Z
2017-07-07T11:15:45.000Z
stubs.min/System/Windows/Forms/__init___parts/DataGridViewCellStyleConverter.py
hdm-dt-fb/ironpython-stubs
4d2b405eda3ceed186e8adca55dd97c332c6f49d
[ "MIT" ]
null
null
null
stubs.min/System/Windows/Forms/__init___parts/DataGridViewCellStyleConverter.py
hdm-dt-fb/ironpython-stubs
4d2b405eda3ceed186e8adca55dd97c332c6f49d
[ "MIT" ]
null
null
null
class DataGridViewCellStyleConverter(TypeConverter): """ Converts System.Windows.Forms.DataGridViewCellStyle objects to and from other data types. DataGridViewCellStyleConverter() """ def CanConvertTo(self,*__args): """ CanConvertTo(self: DataGridViewCellStyleConverter,context: ITypeDescriptorContext,destinationType: Type) -> bool context: An System.ComponentModel.ITypeDescriptorContext that provides a format context. destinationType: A System.Type that represents the type you want to convert to. Returns: true if this converter can perform the conversion; otherwise,false. """ pass def ConvertTo(self,*__args): """ ConvertTo(self: DataGridViewCellStyleConverter,context: ITypeDescriptorContext,culture: CultureInfo,value: object,destinationType: Type) -> object context: An System.ComponentModel.ITypeDescriptorContext that provides a format context. culture: A System.Globalization.CultureInfo. If null is passed,the current culture is assumed. value: The System.Object to convert. destinationType: The System.Type to convert the value parameter to. Returns: An System.Object that represents the converted value. """ pass
42.517241
150
0.755069
129
1,233
7.186047
0.457364
0.02589
0.088457
0.135922
0.166127
0.166127
0.166127
0.166127
0.166127
0.166127
0
0
0.172749
1,233
28
151
44.035714
0.908824
0.818329
0
0.4
0
0
0
0
0
0
0
0
0
1
0.4
false
0.4
0
0
0.6
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
4
161f5e8e426cdbe13e930946d63adae779449206
83
py
Python
pstmgmt/pest/apps.py
aniketb97/pest_management
3acb0b1617c7832cd0c300722e6e87cb509ccc0f
[ "Apache-2.0" ]
null
null
null
pstmgmt/pest/apps.py
aniketb97/pest_management
3acb0b1617c7832cd0c300722e6e87cb509ccc0f
[ "Apache-2.0" ]
null
null
null
pstmgmt/pest/apps.py
aniketb97/pest_management
3acb0b1617c7832cd0c300722e6e87cb509ccc0f
[ "Apache-2.0" ]
null
null
null
from django.apps import AppConfig class PestConfig(AppConfig): name = 'pest'
13.833333
33
0.73494
10
83
6.1
0.9
0
0
0
0
0
0
0
0
0
0
0
0.180723
83
5
34
16.6
0.897059
0
0
0
0
0
0.048193
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
16297ed3c91c08fabff3d780321b0a9819c19422
545
py
Python
resources/dot_PyCharm/system/python_stubs/cache/689a09b61c943b8ee192c309c0b73dfc975d170afdc927b760f50a117a229bf8/perfmon.py
basepipe/developer_onboarding
05b6a776f8974c89517868131b201f11c6c2a5ad
[ "MIT" ]
1
2020-04-20T02:27:20.000Z
2020-04-20T02:27:20.000Z
resources/dot_PyCharm/system/python_stubs/cache/689a09b61c943b8ee192c309c0b73dfc975d170afdc927b760f50a117a229bf8/perfmon.py
basepipe/developer_onboarding
05b6a776f8974c89517868131b201f11c6c2a5ad
[ "MIT" ]
null
null
null
resources/dot_PyCharm/system/python_stubs/cache/689a09b61c943b8ee192c309c0b73dfc975d170afdc927b760f50a117a229bf8/perfmon.py
basepipe/developer_onboarding
05b6a776f8974c89517868131b201f11c6c2a5ad
[ "MIT" ]
null
null
null
# encoding: utf-8 # module perfmon # from C:\Python27\lib\site-packages\win32\perfmon.pyd # by generator 1.147 # no doc # no imports # functions def CounterDefinition(*args, **kwargs): # real signature unknown pass def LoadPerfCounterTextStrings(*args, **kwargs): # real signature unknown pass def ObjectType(*args, **kwargs): # real signature unknown pass def PerfMonManager(*args, **kwargs): # real signature unknown pass def UnloadPerfCounterTextStrings(*args, **kwargs): # real signature unknown pass # no classes
20.961538
75
0.724771
65
545
6.076923
0.523077
0.126582
0.177215
0.291139
0.460759
0.460759
0.374684
0
0
0
0
0.019824
0.166972
545
25
76
21.8
0.85022
0.469725
0
0.5
0
0
0
0
0
0
0
0
0
1
0.5
true
0.5
0
0
0.5
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
1
0
0
0
0
0
4
16409d5ebe83369d2c9ae067aec793d952f9caca
159
py
Python
logicTest/test10.py
mlobf/LogicRoutinePython
94c128f92bb2ab56b62cf502208377de87d33f20
[ "MIT" ]
null
null
null
logicTest/test10.py
mlobf/LogicRoutinePython
94c128f92bb2ab56b62cf502208377de87d33f20
[ "MIT" ]
null
null
null
logicTest/test10.py
mlobf/LogicRoutinePython
94c128f92bb2ab56b62cf502208377de87d33f20
[ "MIT" ]
null
null
null
temperatura_celsus = 0 def convert_celsus(temperatura_celsus): celsus = ((temperatura_celsus - 32) / 1.8) return celsus print(convert_celsus(100))
15.9
46
0.72956
20
159
5.55
0.55
0.459459
0.414414
0
0
0
0
0
0
0
0
0.060606
0.169811
159
9
47
17.666667
0.780303
0
0
0
0
0
0
0
0
0
0
0
0
1
0.2
false
0
0
0
0.4
0.2
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
164507f559fbe3fb689a9c39272593ff1fd38abc
3,495
py
Python
_build/jupyter_execute/Module6/m6_01.py
liuzhengqi1996/math452_Spring2022
b01d1d9bee4778b3069e314c775a54f16dd44053
[ "MIT" ]
null
null
null
_build/jupyter_execute/Module6/m6_01.py
liuzhengqi1996/math452_Spring2022
b01d1d9bee4778b3069e314c775a54f16dd44053
[ "MIT" ]
null
null
null
_build/jupyter_execute/Module6/m6_01.py
liuzhengqi1996/math452_Spring2022
b01d1d9bee4778b3069e314c775a54f16dd44053
[ "MIT" ]
null
null
null
#!/usr/bin/env python # coding: utf-8 # # MgNet: a special CNN based on multigrid method # In[1]: from IPython.display import IFrame IFrame(src="https://cdnapisec.kaltura.com/p/2356971/sp/235697100/embedIframeJs/uiconf_id/41416911/partner_id/2356971?iframeembed=true&playerId=kaltura_player&entry_id=1_luk1i2xr&flashvars[streamerType]=auto&flashvars[localizationCode]=en&flashvars[leadWithHTML5]=true&flashvars[sideBarContainer.plugin]=true&flashvars[sideBarContainer.position]=left&flashvars[sideBarContainer.clickToClose]=true&flashvars[chapters.plugin]=true&flashvars[chapters.layout]=vertical&flashvars[chapters.thumbnailRotator]=false&flashvars[streamSelector.plugin]=true&flashvars[EmbedPlayer.SpinnerTarget]=videoHolder&flashvars[dualScreen.plugin]=true&flashvars[hotspots.plugin]=1&flashvars[Kaltura.addCrossoriginToIframe]=true&&wid=1_s9zzktyl",width='800', height='500') # ## Download the lecture notes here: [Notes](https://sites.psu.edu/math452/files/2022/03/F01MgNet.pdf) # 1D and 2D Finite Element and Multigrid # ------------------------------------- # # 1D and 2D Comparison for Finite Element and Multigrid # # ![image](images/img1.png) # # Basic multigrid components # # ![image](images/img2.png) # # ### Multigrid algorithm for $A * \mu=f$ # # ```{prf:algorithm} A multigrid algorithm $\mu=\operatorname{MG} 1\left(f ; \mu^{0} ; J, v_{1}, \cdots, v_{J}\right)$ # :label: alg61_1 # Set up: # # $$ # f^{1}=f, \quad \mu^{1}=\mu^{0} # $$ # # Smoothing and restriction from fine to coarse level (nested) # # **For** $\ell=1: J$ do # # **For** $i=1: v_{\ell}$ do # # $$ # \mu^{\ell} \leftarrow \mu^{\ell}+S^{\ell} *\left(f^{\ell}-A_{\ell} * \mu^{\ell}\right) # $$ # # **EndFor** # # Form restricted residual and set initial guess: # # $$ # \mu^{\ell+1} \leftarrow \Pi_{\ell}^{\ell+1} \mu^{\ell}, \quad f^{\ell+1} \leftarrow R *_{2}\left(f^{\ell}-A_{\ell} * \mu^{\ell}\right)+A_{\ell+1} * \mu^{\ell+1} # $$ # # **EndFor** # # Prolongation and restriction from coarse to fine level # # **For** $\ell=J-1: 1$ do # # $$ # \mu^{\ell} \leftarrow \mu^{\ell}+R *_{2}^{\top}\left(\mu^{\ell+1}-\Pi_{\ell}^{\ell+1} \mu^{\ell}\right) # $$ # # **EndFor** # # $$ # \mu \leftarrow \mu^{1} # $$ # # ``` # # # ```{admonition} Remark # The above multigrid method # for the linear problem $A * \mu=b$ is independent of the choice of the # interpolation operation # $\Pi_{\ell}^{\ell+1}: \mathbb{R}^{n_{\ell} \times n_{\ell}} \mapsto \mathbb{R}^{n_{\ell+1} \times n_{\ell+1}}$ # and in particular, we could take $\Pi_{\ell}^{\ell+1}:=0$. But such an # operation is critical for nonlinear problems. # ``` # # ### MgNet # # ```{prf:algorithm} $\mu^{J}=\operatorname{MgNet} 1\left(f ; \mu^{0} ; J, v_{1}, \cdots, v_{J}\right)$ # :label: alg61_2 # Set up: # # $$ # \qquad f^{1}=\theta * f, \quad \mu^{1}=\mu^{0} # $$ # # Smoothing and restriction from fine to coarse level (nested) # # **For** $\ell=1: J$ do # # $\quad$ # # **For** $i=1: v_{\ell}$ do # # $$ # \quad \mu^{\ell} \leftarrow \mu^{\ell}+\sigma \circ S^{\ell} * \sigma \circ\left(f^{\ell}-A_{\ell} * \mu^{\ell}\right) # $$ # # **EndFor** # # Form restricted residual and set initial guess: # # $$ # \quad \mu^{\ell+1} \leftarrow \Pi_{\ell}^{\ell+1} \mu^{\ell}, \quad f^{\ell+1} \leftarrow R *_{2}\left(f^{\ell}-A_{\ell} * \mu^{\ell}\right)+A_{\ell+1} * \mu^{\ell+1} # $$ # # **EndFor** # ``` # # In[ ]:
28.647541
803
0.618884
497
3,495
4.287726
0.34004
0.033787
0.045049
0.021117
0.289535
0.280619
0.244955
0.244955
0.244955
0.244955
0
0.035738
0.135336
3,495
121
804
28.884298
0.669424
0.69299
0
0
0
0.5
0.80608
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
1670ca14dc7fa8652c6f45be1d900302048d81d2
225
py
Python
backend/scrapers/events/__init__.py
tcc-collab/trinity_website
7d1f9982f069a307a281b83270e4ad13fce893e5
[ "MIT" ]
null
null
null
backend/scrapers/events/__init__.py
tcc-collab/trinity_website
7d1f9982f069a307a281b83270e4ad13fce893e5
[ "MIT" ]
5
2019-10-25T16:07:06.000Z
2021-06-02T01:00:14.000Z
backend/scrapers/events/__init__.py
tcc-collab/trinity_website
7d1f9982f069a307a281b83270e4ad13fce893e5
[ "MIT" ]
1
2019-10-14T15:19:23.000Z
2019-10-14T15:19:23.000Z
""" Events package: get_top_event -> [List] list of recent 3 notices[type dict] event_page_link -> [str] link of notice page containing all notices """ from backend.scrapers.events.main import event_page_link, get_top_event
28.125
71
0.777778
36
225
4.638889
0.638889
0.071856
0.131737
0
0
0
0
0
0
0
0
0.005102
0.128889
225
7
72
32.142857
0.846939
0.635556
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
1673394289dcedaa3e732d7354c8fe99b9f7751a
304
py
Python
Engineering/CursoBasicoDePython/19_slices.py
Youngermaster/Platzi
0e125d11c0ebb0963fef923a38140313bd8f8ca7
[ "MIT" ]
null
null
null
Engineering/CursoBasicoDePython/19_slices.py
Youngermaster/Platzi
0e125d11c0ebb0963fef923a38140313bd8f8ca7
[ "MIT" ]
null
null
null
Engineering/CursoBasicoDePython/19_slices.py
Youngermaster/Platzi
0e125d11c0ebb0963fef923a38140313bd8f8ca7
[ "MIT" ]
null
null
null
my_name = "Juan Manuel Young Hoyos" print(my_name[0]) # * Both of them are equal print(my_name[0:3]) print(my_name[:3]) # * Both of them are equal print(my_name[1:len(my_name)]) print(my_name[1:]) # * Slicing with steps print(my_name[1:len(my_name):2]) # * It brings me everything print(my_name[::])
17.882353
35
0.694079
58
304
3.465517
0.413793
0.298507
0.383085
0.179104
0.442786
0.442786
0.442786
0.288557
0
0
0
0.030534
0.138158
304
16
36
19
0.736641
0.315789
0
0
0
0
0.1133
0
0
0
0
0
0
1
0
false
0
0
0
0
0.875
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
4
1677c260a7622d4ba0193897b60471ab75358d9b
415
py
Python
products/models.py
bdonald25/Product-Log
a33ddfee07b41eae79e8e3657dab19f548ea1541
[ "MIT" ]
null
null
null
products/models.py
bdonald25/Product-Log
a33ddfee07b41eae79e8e3657dab19f548ea1541
[ "MIT" ]
null
null
null
products/models.py
bdonald25/Product-Log
a33ddfee07b41eae79e8e3657dab19f548ea1541
[ "MIT" ]
null
null
null
from django.db import models class Product(models.Model): product_name = models.CharField(max_length=40000) serial_number = models.CharField(max_length=40000) warranty_info = models.CharField(max_length=40000) img = models.ImageField(upload_to='product_photos/', null=True) pdf = models.FileField(upload_to='product_pdfs/', null=True) def __unicode__(self): return self.product_name
37.727273
67
0.751807
55
415
5.4
0.563636
0.151515
0.181818
0.242424
0.292929
0
0
0
0
0
0
0.042135
0.142169
415
11
68
37.727273
0.792135
0
0
0
0
0
0.067308
0
0
0
0
0
0
1
0.111111
false
0
0.111111
0.111111
1
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
4
169b70dc2f8e2a255c8e189021272321b2e5c19e
136
py
Python
modelutils/coreml/dump.py
shonohs/modelutils
24df495ce5372c3f8a1f064f163b51150517e2de
[ "MIT" ]
1
2020-12-10T07:06:32.000Z
2020-12-10T07:06:32.000Z
modelutils/coreml/dump.py
shonohs/modelutils
24df495ce5372c3f8a1f064f163b51150517e2de
[ "MIT" ]
null
null
null
modelutils/coreml/dump.py
shonohs/modelutils
24df495ce5372c3f8a1f064f163b51150517e2de
[ "MIT" ]
null
null
null
def dump_model(filepath): import coremltools model = coremltools.models.MLModel(str(filepath)).get_spec() return str(model)
27.2
64
0.735294
17
136
5.764706
0.705882
0
0
0
0
0
0
0
0
0
0
0
0.154412
136
4
65
34
0.852174
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.25
0
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
16b8fef37267ccab1d7552088f8e093b67561aba
53
py
Python
SUMA.py
lwojcik/plspoj-problems
30bfc07ffcd9f1a33b02d52d10747fc0861559ea
[ "MIT" ]
1
2018-01-03T18:38:48.000Z
2018-01-03T18:38:48.000Z
SUMA.py
lwojcik/plspoj-problems
30bfc07ffcd9f1a33b02d52d10747fc0861559ea
[ "MIT" ]
null
null
null
SUMA.py
lwojcik/plspoj-problems
30bfc07ffcd9f1a33b02d52d10747fc0861559ea
[ "MIT" ]
null
null
null
b=0 a=0 while b: b=input() a=a+b print a
7.571429
13
0.471698
13
53
1.923077
0.461538
0
0
0
0
0
0
0
0
0
0
0.060606
0.377358
53
6
14
8.833333
0.69697
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0.166667
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
1
0
0
0
0
0
0
0
0
4
16caa7ad0f56520a5ecb88fc1382ad2cbbbed554
219
py
Python
django_htmx_extras/views/generic/__init__.py
Tiny-Tiny-App/django-htmx-extras
0fca79be532ff51d1fe0346318282a3cd23cdced
[ "MIT" ]
3
2021-08-19T07:46:01.000Z
2021-12-22T12:33:42.000Z
django_htmx_extras/views/generic/__init__.py
Tiny-Tiny-App/django-htmx-extras
0fca79be532ff51d1fe0346318282a3cd23cdced
[ "MIT" ]
null
null
null
django_htmx_extras/views/generic/__init__.py
Tiny-Tiny-App/django-htmx-extras
0fca79be532ff51d1fe0346318282a3cd23cdced
[ "MIT" ]
null
null
null
from django_htmx_extras.views.generic.base import HtmxTemplateView from django_htmx_extras.views.generic.edit import HtmxFormView, HtmxUpdateView __all__ = [ 'HtmxTemplateView', 'HtmxFormView', 'HtmxUpdateView', ]
31.285714
78
0.817352
23
219
7.434783
0.565217
0.116959
0.163743
0.233918
0.374269
0.374269
0
0
0
0
0
0
0.09589
219
6
79
36.5
0.863636
0
0
0
0
0
0.191781
0
0
0
0
0
0
1
0
false
0
0.4
0
0.4
0
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
0
0
1
0
0
0
0
4
16dcbc20ee31a85b47099e0f2d1c0f66d0e7d2fc
415
py
Python
h/presenters/annotation_base.py
pombredanne/h
9c4c2dc0d53ed5bed5183936c24b4c27b23070b4
[ "BSD-2-Clause" ]
null
null
null
h/presenters/annotation_base.py
pombredanne/h
9c4c2dc0d53ed5bed5183936c24b4c27b23070b4
[ "BSD-2-Clause" ]
null
null
null
h/presenters/annotation_base.py
pombredanne/h
9c4c2dc0d53ed5bed5183936c24b4c27b23070b4
[ "BSD-2-Clause" ]
null
null
null
"""A base presenter for common properties needed when rendering annotations.""" class AnnotationBasePresenter: def __init__(self, annotation): self.annotation = annotation @property def target(self): target = {"source": self.annotation.target_uri} if self.annotation.target_selectors: target["selector"] = self.annotation.target_selectors return [target]
27.666667
79
0.686747
42
415
6.619048
0.571429
0.251799
0.215827
0.208633
0
0
0
0
0
0
0
0
0.221687
415
14
80
29.642857
0.860681
0.175904
0
0
0
0
0.041667
0
0
0
0
0
0
1
0.222222
false
0
0
0
0.444444
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
1
0
0
0
0
0
0
0
4
16e8aaa2c3c84a6a3cef9e9fa2ac2ca03a01e6a4
86
py
Python
sqlorm/models/__init__.py
jaganadhg/swenginnpoc
33bd71472b848864947a98ede99e1875bc2f5ef4
[ "MIT" ]
null
null
null
sqlorm/models/__init__.py
jaganadhg/swenginnpoc
33bd71472b848864947a98ede99e1875bc2f5ef4
[ "MIT" ]
null
null
null
sqlorm/models/__init__.py
jaganadhg/swenginnpoc
33bd71472b848864947a98ede99e1875bc2f5ef4
[ "MIT" ]
null
null
null
#!/usr/bin/env python from .mymodels import UserData from .kaggle import KaggleData
14.333333
30
0.77907
12
86
5.583333
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.139535
86
5
31
17.2
0.905405
0.232558
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
bc4c4be4e1283a389860545ff68bf099d7167b33
6,494
py
Python
lyrics.py
HassanHarb92/BEATLES
443f6f1ca223680d0d09c6154d2fe51b15de3189
[ "MIT" ]
null
null
null
lyrics.py
HassanHarb92/BEATLES
443f6f1ca223680d0d09c6154d2fe51b15de3189
[ "MIT" ]
null
null
null
lyrics.py
HassanHarb92/BEATLES
443f6f1ca223680d0d09c6154d2fe51b15de3189
[ "MIT" ]
null
null
null
#!/usr/bin/python from __future__ import division import sys import math import cmath import numpy as np from numpy import genfromtxt import csv from decimal import Decimal import os # This file contains quotes from the BEATLES songs and/or songs written by individual members of the BEATLES # # The function is called at the end of the python script and it will randomly pick one quote from the list below # def LyricsLibrary(n): print "\nDaily Dose of Beatles!\n" if (n == 1): print "Imagine there's no heaven\nIt's easy if you try\nNo hell below us\nAbove us only sky\nImagine all the people\nliving for today\n" elif (n==2): print "You may say I'm a dreamer,\nbut I'm not the only one.\nI hope someday you'll join us.\nAnd the world will live as one.\n" elif (n == 3): print "Imagine there's no countries\nIt isn't hard to do\nNothing to kill or die for\nAnd no religion too\nImagine all the people living life in peace\n" elif (n == 4): print "Imagine no possessions\nI wonder if you can\nNo need for greed or hunger\nA brotherhood of man\n" elif (n == 5): print "Here come old flat top\nHe come groovin' up slowly\nHe got joo joo eyeballs\nHe one holy roller\nHe got hair down to his knee\nGot to be a joker\nHe just do what he please\n" elif (n == 6): print "He bad production\nHe got walrus gumboot\nHe got Ono sideboard\nHe one spinal cracker\nHe got feet down below his knee\n" elif (n == 7): print "He wear no shoeshine\nHe got toe jam football\nHe got monkey finger\nHe shoot Coca-Cola\nHe say I know you, you know me\n" elif (n == 8): print "One thing I can tell you is\nYou got to be free\n" elif (n == 9): print "It's been a hard day's night, and I've been working like a dog\nIt's been a hard day's night, I should be sleeping like a log\n" elif (n == 10): print "When I'm home everything seems to be right\nWhen I'm home feeling you holding me tight, tight, yeah\n" elif (n == 11): print "Hey Jude, don't make it bad\nTake a sad song and make it better\nRemember to let her into your heart\nThen you can start to make it better\n" elif (n == 12): print "And anytime you feel the pain\nHey Jude, refrain\nDon't carry the world upon your shoulders\n" elif (n == 13): print "Hey Jude, don't let me down\nYou have found her, now go and get her\nRemember to let her into your heart\nThen you can start to make it better\n" elif (n == 14): print "Let me take you down\b'Cause I'm going to Strawberry Fields\bNothing is real\nAnd nothing to get hung about\nStrawberry Fields forever\n" elif (n == 15): print "Living is easy with eyes closed\nMisunderstanding all you see\nIt's getting hard to be someone\nBut it all works out\nIt doesn't matter much to me\n" elif (n == 16): print "No one I think is in my tree\nI mean it must be high or low\nThat is you can't, you know, tune in\nBut it's all right\nThat is, I think, it's not too bad\n" elif (n == 17): print "In Penny Lane, there is a barber showing photographs\nOf every head he's had the pleasure to know\nAnd all the people that come and go\nStop and say, Hello\n" elif (n == 18): print "On the corner is a banker with a motorcar\nAnd little children laugh at him behind his back\nAnd the banker never wears a mac\nIn the pouring rain, very strange\n" elif (n == 19): print "Penny Lane is in my ears and in my eyes\nThere beneath the blue suburban skies\n" elif (n == 20): print "In Penny Lane there is a fireman with an hourglass\bAnd in his pocket is a portrait of the Queen\bHe likes to keep his fire engine clean\nIt's a clean machine\n" elif (n == 21): print "In Penny Lane, the barber shaves another customer\nWe see the banker sitting waiting for a trim\nAnd then the fireman rushes in\nFrom the pouring rain, very strange\n" elif (n == 22): print "I read the news today, oh boy\nAbout a lucky man who made the grade\nAnd though the news was rather sad\nWell, I just had to laugh\nI saw the photograph\n" elif (n == 23): print "He blew his mind out in a car\nHe didn't notice that the lights had changed\nA crowd of people stood and stared\nThey'd seen his face before\nNobody was really sure if he was from the House of Lords\n" elif (n == 24): print "I saw a film today, oh boy\nThe English Army had just won the war\nA crowd of people turned away\nBut I just had to look\nHaving read the book\nI'd love to turn you on\n" elif (n == 25): print "You think you've lost your love\nWell, I saw her yesterday\nIt's you she's thinking of\nAnd she told me what to say\n" elif (n == 26): print "She says she loves you\nAnd you know that can't be bad\nYes, she loves you\nAnd you know you should be glad\n" elif (n == 27): print "She said you hurt her so\nShe almost lost her mind\nBut now she said she knows\nYou're not the hurting kind\n" elif (n == 28): print "You don't need me to show the way, love\nWhy do I always have to say, love\nCome on, come on, come on, come on\nCome on, come on, come on, come on\nPlease, please me, whoa yeah, like I please you\n" elif (n == 29): print "I don't want to sound complaining\nBut you know there's always rain in my heart\nI do all the pleasing with you\nIt's so hard to reason with you\nwhoa yeah, why do you make me blue?\n" elif (n == 30): print "Dear Prudence, won't you come out to play?\nDear Prudence, greet the brand new day\n" elif (n == 31): print "Dear Prudence, open up your eyes\nDear Prudence, see the sunny skies\nThe wind is low, the birds will sing\nThat you are part of everything\nDear Prudence, won't you open up your eyes?\n" elif (n == 32): print "Dear Prudence, let me see you smile\nDear Prudence, like a little child\nThe clouds will be a daisy chain\nSo let me see you smile again\nDear Prudence, won't you let me see you smile?\n" else: print "Imagine there's no countries..." # Songs covered: # # Following up on this list: # # https://www.vulture.com/2017/06/all-213-beatles-songs-ranked-from-worst-to-best.html # # 1. Imagine # 2. Come together # 3. A Hard Day's Night # 4. Hey Jude # 5. Strawberry Fields Forever # 6. Penny Lane # 7. A Day in the Life # 8. She Loves You # 9. Please Please Me # 10. Dear Prudence #
46.719424
215
0.686326
1,221
6,494
3.647011
0.374283
0.034808
0.04177
0.010779
0.131597
0.097013
0.074107
0.054795
0.029643
0.029643
0
0.015048
0.232522
6,494
138
216
47.057971
0.878411
0.086079
0
0
0
0.38961
0.756556
0.00406
0
0
0
0
0
0
null
null
0
0.116883
null
null
0.441558
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
null
0
0
0
0
1
0
0
0
0
0
0
1
0
4
bc8131c7cfa264cb9b52ae9e534512e39bdb34d6
190
py
Python
example_project/sample_image_insert/admin.py
servee/servee
59405663e1c30d3bcb3f6918932adfc02ae1a668
[ "MIT" ]
3
2017-08-22T13:19:12.000Z
2021-12-28T23:58:17.000Z
example_project/sample_image_insert/admin.py
servee/servee
59405663e1c30d3bcb3f6918932adfc02ae1a668
[ "MIT" ]
null
null
null
example_project/sample_image_insert/admin.py
servee/servee
59405663e1c30d3bcb3f6918932adfc02ae1a668
[ "MIT" ]
null
null
null
from django.contrib import admin from sample_image_insert.models import Image class ImageAdmin(admin.ModelAdmin): list_display = ('title',) admin.site.register(Image, ImageAdmin)
21.111111
44
0.773684
24
190
6
0.708333
0
0
0
0
0
0
0
0
0
0
0
0.136842
190
8
45
23.75
0.878049
0
0
0
0
0
0.026316
0
0
0
0
0
0
1
0
false
0
0.4
0
0.8
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
bc9bd67a7ed36f0d78282a02645a026a1a00d17c
134
py
Python
itp1_4a.py
ShinjiKatoA16/aoj-itp
83d1688f41d0cd85f6eced76aebdc97e0dc6a01f
[ "MIT" ]
null
null
null
itp1_4a.py
ShinjiKatoA16/aoj-itp
83d1688f41d0cd85f6eced76aebdc97e0dc6a01f
[ "MIT" ]
null
null
null
itp1_4a.py
ShinjiKatoA16/aoj-itp
83d1688f41d0cd85f6eced76aebdc97e0dc6a01f
[ "MIT" ]
null
null
null
#!/usr/bin/python3 # -*- coding: utf-8 -*- import sys a, b = map(int, sys.stdin.readline().split()) print(a//b, a%b, round(a/b, 6))
16.75
45
0.58209
25
134
3.12
0.72
0.102564
0
0
0
0
0
0
0
0
0
0.026087
0.141791
134
7
46
19.142857
0.652174
0.291045
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0.333333
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
bca69ccd8e11e9a7eaab7d6f16631c22613f8ed8
305
py
Python
pts/core/_base.py
devmofl/M5_Accuracy_3rd
b02bd4333520d71ff01b66c0446bb07324cfb0d1
[ "Apache-2.0", "MIT" ]
9
2021-06-17T11:00:41.000Z
2021-12-14T06:09:40.000Z
pts/core/_base.py
StatMixedML/pytorch-ts
4bc2d247c70c59479d359d13d2db5739227307e8
[ "Apache-2.0", "MIT" ]
1
2021-12-01T17:42:23.000Z
2021-12-13T12:57:51.000Z
pts/core/_base.py
StatMixedML/pytorch-ts
4bc2d247c70c59479d359d13d2db5739227307e8
[ "Apache-2.0", "MIT" ]
5
2021-06-17T11:00:43.000Z
2022-03-18T13:50:52.000Z
def fqname_for(cls: type) -> str: """ Returns the fully qualified name of ``cls``. Parameters ---------- cls The class we are interested in. Returns ------- str The fully qualified name of ``cls``. """ return f"{cls.__module__}.{cls.__qualname__}"
20.333333
49
0.540984
35
305
4.457143
0.628571
0.102564
0.217949
0.269231
0.333333
0.333333
0
0
0
0
0
0
0.298361
305
15
49
20.333333
0.728972
0.554098
0
0
0
0
0.393258
0.393258
0
0
0
0
0
1
0.5
false
0
0
0
1
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
4c2a8b03f8874d08b24c34d644dab054dbcb57e0
1,472
py
Python
07patterns/leeb_substituion.py
edgells/python-commons
38c0aa0ec10304a4147ea231c92c9e34da462052
[ "MIT" ]
null
null
null
07patterns/leeb_substituion.py
edgells/python-commons
38c0aa0ec10304a4147ea231c92c9e34da462052
[ "MIT" ]
null
null
null
07patterns/leeb_substituion.py
edgells/python-commons
38c0aa0ec10304a4147ea231c92c9e34da462052
[ "MIT" ]
null
null
null
""" 里氏替换原则 父类出现的地方子类一定能够出现 """ class Database: def connect(self): pass def close_connect(self): pass def execute(self): pass def command(self): pass def insert(self, **kwargs): pass def select(self, username: str): pass def update(self, username): pass def delete(self, username): pass class UserService: def __init__(self, db: Database): self._db = db @property def db(self): return self._db def create_user(self, username, password, *args, **kwargs): return self.db.insert(username=username, password=password) def find_user(self, username): return self.db.select(username) def update_user_info(self, username): return self.db.update(username) def delete_user(self, username): return self.db.delete(username) class MysqlDatabase(Database): def __init__(self, db_type, db_host, db_port, db_name, db_user, db_password, *args, **kwargs): pass def insert(self, user): self.db.insert() def update(self, username): pass def select(self, username: str): pass def delete(self, username): pass class OracleDatabase(Database): pass def test(): # 数据在mysql userService = UserService(MysqlDatabase()) # 数据在Oracle userService = UserService(OracleDatabase()) if __name__ == '__main__': test()
17.52381
98
0.612772
168
1,472
5.190476
0.238095
0.088303
0.068807
0.075688
0.286697
0.259174
0.150229
0.080275
0
0
0
0
0.281929
1,472
84
99
17.52381
0.824976
0.028533
0
0.387755
0
0
0.005658
0
0
0
0
0
0
1
0.408163
false
0.326531
0
0.102041
0.591837
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
1
1
0
0
4
4c3c53ee708baf99b33875c7969b6b106183d417
89
py
Python
executor/module/shaping/__init__.py
alpavlenko/EvoGuess
19bc54e75cd959e445becda16fa6f488f0fb2367
[ "MIT" ]
1
2021-12-12T15:09:56.000Z
2021-12-12T15:09:56.000Z
executor/module/shaping/__init__.py
alpavlenko/EvoGuess
19bc54e75cd959e445becda16fa6f488f0fb2367
[ "MIT" ]
1
2021-10-10T09:16:57.000Z
2021-10-10T09:16:57.000Z
executor/module/shaping/__init__.py
alpavlenko/evoguess
e8510c32c8325c9fe66fc15899d378b7bf731557
[ "MIT" ]
null
null
null
from .impl import * from . import impl shapings = impl.shapings __all__ = impl.__all__
12.714286
24
0.741573
12
89
4.833333
0.416667
0.413793
0
0
0
0
0
0
0
0
0
0
0.179775
89
6
25
14.833333
0.794521
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
4c677c64a811484127f4eea4bbd3f23ade030c4f
1,085
py
Python
codes/models/networks/base_nets.py
sanchitvohra/EGVSR
c8927c3aa876fac8ce2508b00c6ed3a3d6df226c
[ "MIT" ]
709
2021-04-27T12:12:32.000Z
2022-03-31T02:02:29.000Z
codes/models/networks/base_nets.py
sanchitvohra/EGVSR
c8927c3aa876fac8ce2508b00c6ed3a3d6df226c
[ "MIT" ]
14
2021-07-13T12:04:42.000Z
2022-03-17T12:10:51.000Z
codes/models/networks/base_nets.py
riverlight/egvsr
3c0b478179f772d7fe7521655008a2d79a6b6185
[ "MIT" ]
90
2021-07-07T18:35:18.000Z
2022-03-30T07:01:44.000Z
import torch.nn as nn class BaseSequenceGenerator(nn.Module): def __init__(self): super(BaseSequenceGenerator, self).__init__() def generate_dummy_input(self, lr_size): """ use for compute per-step FLOPs and speed return random tensors that can be taken as input of <forward> """ return None def forward(self, *args, **kwargs): """ forward pass for a singe frame """ pass def forward_sequence(self, lr_data): """ forward pass for a whole sequence (for training) """ pass def infer_sequence(self, lr_data, device): """ infer for a whole sequence (for inference) """ pass class BaseSequenceDiscriminator(nn.Module): def __init__(self): super(BaseSequenceDiscriminator, self).__init__() def forward(self, *args, **kwargs): """ forward pass for a singe frame """ pass def forward_sequence(self, data, args_dict): """ forward pass for a whole sequence (for training) """ pass
25.232558
73
0.603687
125
1,085
5.04
0.392
0.031746
0.088889
0.095238
0.48254
0.450794
0.374603
0.374603
0.374603
0.238095
0
0
0.298618
1,085
42
74
25.833333
0.827858
0.314286
0
0.473684
1
0
0
0
0
0
0
0
0
1
0.421053
false
0.263158
0.052632
0
0.631579
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
4
d5cdf1079f2b9b83ca6af414f0b7da72376b6f4e
232
py
Python
exercicios/ex031.py
Matheus1199/python
c87859d4bf63ba0edea43d864fcbce4915da7e6a
[ "MIT" ]
null
null
null
exercicios/ex031.py
Matheus1199/python
c87859d4bf63ba0edea43d864fcbce4915da7e6a
[ "MIT" ]
null
null
null
exercicios/ex031.py
Matheus1199/python
c87859d4bf63ba0edea43d864fcbce4915da7e6a
[ "MIT" ]
null
null
null
km = float(input('Qual a distância da viagem? ')) print('Você está prestes a começar uma viagem de {}Km.') if km < 200: print('Você deverá pagar R${}'.format(km * 0.5)) else: print('Você deverá pagar R${}'.format(km * 0.45))
38.666667
56
0.642241
40
232
3.725
0.625
0.181208
0.201342
0.268456
0.402685
0.402685
0.402685
0.402685
0
0
0
0.041885
0.176724
232
6
57
38.666667
0.73822
0
0
0
0
0
0.51073
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
4
d5e14565e0e4dc6b76293718fc7c137209c20542
112
py
Python
77.py
thaisNY/GuanabaraPy
a0a3acbd9242a39491a365b07562037d7a936bba
[ "MIT" ]
null
null
null
77.py
thaisNY/GuanabaraPy
a0a3acbd9242a39491a365b07562037d7a936bba
[ "MIT" ]
null
null
null
77.py
thaisNY/GuanabaraPy
a0a3acbd9242a39491a365b07562037d7a936bba
[ "MIT" ]
null
null
null
#Crie uma trupla com várias palavras #Para dada palavra imprima todas as duas vogasis #Exemplo aprender : a,e,e
28
48
0.785714
19
112
4.631579
0.947368
0
0
0
0
0
0
0
0
0
0
0
0.160714
112
3
49
37.333333
0.93617
0.946429
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
910d6a875c5a96389e082ebeb54bb7b8015ec314
4,158
py
Python
scraper/src/tests/default_strategy/xpath_test.py
bhfmts/docsearch-scraper
5cac7ed4e013d4449a28958f805a97cfde47d6de
[ "MIT" ]
null
null
null
scraper/src/tests/default_strategy/xpath_test.py
bhfmts/docsearch-scraper
5cac7ed4e013d4449a28958f805a97cfde47d6de
[ "MIT" ]
null
null
null
scraper/src/tests/default_strategy/xpath_test.py
bhfmts/docsearch-scraper
5cac7ed4e013d4449a28958f805a97cfde47d6de
[ "MIT" ]
null
null
null
# coding: utf-8 import lxml.html from .abstract import get_strategy class TestGetRecordsFromDomWithXpath: def test_one_xpath(self): # Given strategy = get_strategy({ 'selectors': { 'lvl0': { 'selector': 'descendant-or-self::*[@class and contains(concat(\' \', normalize-space(@class), \' \'), \' title \')]', 'type': 'xpath' }, 'lvl1': 'h2', 'lvl2': 'h3', 'content': 'p' } }) strategy.dom = lxml.html.fromstring(""" <html><body> <h1 class="title">Foo</h1> <p>text</p> <h2>Bar</h2> <h3>Baz</h3> </body></html> """) # When actual = strategy.get_records_from_dom() # Then # First record has the global H1 assert len(actual) == 4 assert actual[0]['type'] == 'lvl0' assert actual[0]['hierarchy']['lvl0'] == 'Foo' assert actual[0]['hierarchy']['lvl1'] is None assert actual[0]['hierarchy']['lvl2'] is None assert actual[0]['content'] is None def test_two_xpath_including_one_global(self): # Given strategy = get_strategy({ 'selectors': { 'lvl0': { 'selector': 'descendant-or-self::*[@class and contains(concat(\' \', normalize-space(@class), \' \'),' ' \' title \')]', 'type': 'xpath', 'global': True }, 'lvl1': { 'selector': 'descendant-or-self::*[@class and contains(concat(\' \', normalize-space(@class), \' \'),' ' \' subtitle \')]', 'type': 'xpath' }, 'lvl2': 'h3', 'content': 'p' } }) strategy.dom = lxml.html.fromstring(""" <html><body> <p>text</p> <h2 class="subtitle">Bar</h2> <h3>Baz</h3> <h1 class="title">Foo</h1> <h1 class="title">Foo</h1> </body></html> """) # When actual = strategy.get_records_from_dom() # Then # First record has the global H1 assert len(actual) == 3 assert actual[0]['type'] == 'content' assert actual[0]['hierarchy']['lvl0'] == 'Foo Foo' assert actual[0]['hierarchy']['lvl1'] is None assert actual[0]['hierarchy']['lvl2'] is None assert actual[0]['content'] == 'text' assert actual[1]['type'] == 'lvl1' assert actual[1]['hierarchy']['lvl0'] == 'Foo Foo' assert actual[1]['hierarchy']['lvl1'] == 'Bar' assert actual[1]['hierarchy']['lvl2'] is None assert actual[1]['content'] is None def test_select_parent_with_xpath(self): # Given strategy = get_strategy({ 'selectors': { 'lvl0': { 'selector': '//li[@class="active"]/../../../*[@class="title"]', 'type': 'xpath', 'global': True }, 'lvl1': 'li.active', 'lvl2': 'h3', 'content': 'p' } }) strategy.dom = lxml.html.fromstring(""" <html><body> <p>text</p> <h3>Baz</h3> <div> <h1 class="title">Foo</h1> <div> <ul> <li class="active">Bar</li> <li>Bar 2</li> </ul> </div> </div> </body></html> """) # When actual = strategy.get_records_from_dom() # Then # First record has the global H1 assert len(actual) == 3 assert actual[0]['type'] == 'content' assert actual[0]['hierarchy']['lvl0'] == 'Foo' assert actual[0]['hierarchy']['lvl1'] is None assert actual[0]['hierarchy']['lvl2'] is None assert actual[0]['content'] == 'text'
31.263158
137
0.430736
388
4,158
4.554124
0.190722
0.135823
0.110357
0.112054
0.805886
0.735144
0.700057
0.673458
0.673458
0.640068
0
0.029235
0.399471
4,158
132
138
31.5
0.678414
0.037037
0
0.663462
0
0
0.374436
0.085213
0
0
0
0
0.221154
1
0.028846
false
0
0.019231
0
0.057692
0
0
0
0
null
0
0
0
1
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
9113b8a29569c1a310591997c2a3a97c4c907272
82
py
Python
arcade/python/arcade-theCore/17_RegularHell/139_ReplaceAllDigitsRegExp.py
netor27/codefights-arcade-solutions
69701ab06d45902c79ec9221137f90b75969d8c8
[ "MIT" ]
null
null
null
arcade/python/arcade-theCore/17_RegularHell/139_ReplaceAllDigitsRegExp.py
netor27/codefights-arcade-solutions
69701ab06d45902c79ec9221137f90b75969d8c8
[ "MIT" ]
null
null
null
arcade/python/arcade-theCore/17_RegularHell/139_ReplaceAllDigitsRegExp.py
netor27/codefights-arcade-solutions
69701ab06d45902c79ec9221137f90b75969d8c8
[ "MIT" ]
null
null
null
def replaceAllDigitsRegExp(inputString): return re.sub(r'\d','#',inputString)
27.333333
40
0.731707
9
82
6.666667
0.888889
0
0
0
0
0
0
0
0
0
0
0
0.097561
82
2
41
41
0.810811
0
0
0
0
0
0.036585
0
0
0
0
0
0
1
0.5
false
0
0
0.5
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
4
9141a73a1c4005a90765dd993106ab194e4af008
116
py
Python
tests/app_factory.py
etycomputer/simple-flask-website-simulator
1f5441f8f1bb82a7e42545e8883bbac6b450ff3c
[ "MIT" ]
null
null
null
tests/app_factory.py
etycomputer/simple-flask-website-simulator
1f5441f8f1bb82a7e42545e8883bbac6b450ff3c
[ "MIT" ]
null
null
null
tests/app_factory.py
etycomputer/simple-flask-website-simulator
1f5441f8f1bb82a7e42545e8883bbac6b450ff3c
[ "MIT" ]
null
null
null
from app import create_app def build_app(): # Create and set up the app app = create_app() return app
14.5
31
0.663793
19
116
3.894737
0.578947
0.243243
0
0
0
0
0
0
0
0
0
0
0.275862
116
7
32
16.571429
0.880952
0.215517
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.25
0
0.75
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
4
e67b10c6edbb07d19e9fc0fceeb2798f17724a25
333
py
Python
app/api/routes.py
Virtual-Commissioning/VC-HVAC_statistics-Service
079a09b1762a1a1c16ff572bd689f8320b7ac0b3
[ "CC0-1.0" ]
null
null
null
app/api/routes.py
Virtual-Commissioning/VC-HVAC_statistics-Service
079a09b1762a1a1c16ff572bd689f8320b7ac0b3
[ "CC0-1.0" ]
1
2022-02-03T12:48:50.000Z
2022-02-03T12:48:50.000Z
app/api/routes.py
Virtual-Commissioning/VC-HVAC_statistics-Service
079a09b1762a1a1c16ff572bd689f8320b7ac0b3
[ "CC0-1.0" ]
null
null
null
from app import app from flask import request from app.services import hvac_statistics @app.route('/') @app.route('/statistics_calculator', methods=['POST']) def statistics_calculator(): data = request.get_data() hvac_statistics_calculated = hvac_statistics.statistics_calculation(data) return hvac_statistics_calculated
33.3
77
0.792793
41
333
6.195122
0.439024
0.220472
0.188976
0
0
0
0
0
0
0
0
0
0.111111
333
10
78
33.3
0.858108
0
0
0
0
0
0.080838
0.065868
0
0
0
0
0
1
0.111111
false
0
0.333333
0
0.555556
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
e6aa864a8bfef660a783a190b5bd36aef3a86a38
240
py
Python
django_allauth_webauthn/admin.py
CyberDeck/django-allauth-webauthn
c4d5445859a3994b7e9468613ac6918c50e6748b
[ "MIT" ]
1
2021-11-02T03:08:28.000Z
2021-11-02T03:08:28.000Z
django_allauth_webauthn/admin.py
CyberDeck/django-allauth-webauthn
c4d5445859a3994b7e9468613ac6918c50e6748b
[ "MIT" ]
null
null
null
django_allauth_webauthn/admin.py
CyberDeck/django-allauth-webauthn
c4d5445859a3994b7e9468613ac6918c50e6748b
[ "MIT" ]
1
2021-11-17T20:32:07.000Z
2021-11-17T20:32:07.000Z
from django.contrib import admin from .models import WebauthnData @admin.register(WebauthnData) class WebauthnDataAdmin(admin.ModelAdmin): search_fields = ["name", "credential_id"] list_display = ["user", "name", "last_used_on"]
24
51
0.75
28
240
6.25
0.785714
0
0
0
0
0
0
0
0
0
0
0
0.129167
240
9
52
26.666667
0.837321
0
0
0
0
0
0.154167
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.833333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
e6b94ffdfca56bc8ef4186f8461f0c933b7df04e
133
py
Python
src_updater/cxfreeze.py
Zamiell/RebirthItemTracker-1
d5515b0680de90b7a5d5d507f7d4e32a8cead5b1
[ "BSD-2-Clause" ]
23
2021-04-03T01:45:41.000Z
2022-03-30T12:57:56.000Z
src_updater/cxfreeze.py
Zamiell/RebirthItemTracker-1
d5515b0680de90b7a5d5d507f7d4e32a8cead5b1
[ "BSD-2-Clause" ]
8
2021-04-02T20:13:11.000Z
2022-03-21T23:20:55.000Z
src_updater/cxfreeze.py
Zamiell/RebirthItemTracker-1
d5515b0680de90b7a5d5d507f7d4e32a8cead5b1
[ "BSD-2-Clause" ]
7
2021-04-04T18:54:24.000Z
2022-03-11T19:36:04.000Z
#cx freeze is for making a windows exe. this file is used by the release script to invoke it from cx_Freeze import main main.main()
26.6
92
0.774436
26
133
3.923077
0.807692
0.156863
0
0
0
0
0
0
0
0
0
0
0.18797
133
4
93
33.25
0.944444
0.684211
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
e6fb2498ba35582f3d42cc139fe51cccf5278f96
252
py
Python
editor/tasks/__init__.py
iamsayem/smart-editor
012ad2775cd33247642c629a2a92ec89e4462412
[ "MIT" ]
null
null
null
editor/tasks/__init__.py
iamsayem/smart-editor
012ad2775cd33247642c629a2a92ec89e4462412
[ "MIT" ]
null
null
null
editor/tasks/__init__.py
iamsayem/smart-editor
012ad2775cd33247642c629a2a92ec89e4462412
[ "MIT" ]
null
null
null
""" Created by Sayem on 06 March, 2021 All rights reserved. Copyright © 2020. """ from .tasks import expire_key_provide_warning_and_decrypt_existing_data __author__ = "Sayem" __all__ = ["expire_key_provide_warning_and_decrypt_existing_data"]
25.2
71
0.785714
35
252
5.057143
0.714286
0.101695
0.180791
0.259887
0.508475
0.508475
0.508475
0.508475
0
0
0
0.046083
0.138889
252
9
72
28
0.764977
0.289683
0
0
0
0
0.349693
0.319018
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
fc1ba82d6bc4315d830cb02a7dc94c57ef270d80
1,840
py
Python
deep500/lv2/event.py
khoaideptrai/deep500
0953038f64bc73c8d41d01796e07d3a23ca97822
[ "BSD-3-Clause" ]
90
2019-01-02T22:49:08.000Z
2022-02-17T21:11:38.000Z
deep500/lv2/event.py
khoaideptrai/deep500
0953038f64bc73c8d41d01796e07d3a23ca97822
[ "BSD-3-Clause" ]
4
2019-02-14T16:19:06.000Z
2022-01-11T17:54:42.000Z
deep500/lv2/event.py
khoaideptrai/deep500
0953038f64bc73c8d41d01796e07d3a23ca97822
[ "BSD-3-Clause" ]
24
2019-01-09T18:09:44.000Z
2022-01-10T13:04:42.000Z
from deep500 import Event from deep500.lv2.summaries import TrainingStatistics class StopTraining(Exception): pass class TrainingEvent(Event): """ Any event that relates to Deep500's Level 2. """ pass class OptimizerEvent(TrainingEvent): """ Optimizer events. """ def before_optimizer_step(self, executor, optimizer, inputs): pass def after_optimizer_step(self, executor, optimizer, outputs, loss): pass class SamplerEvent(TrainingEvent): """ Data staging and sampling events. """ def on_sampler_reset(self, sampler): pass def before_sampling(self, sampler, minibatch_size): pass def after_sampling(self, sampler, samples): pass class RunnerEvent(TrainingEvent): """ Training/test set loop events. """ def before_training(self, runner, training_stats: TrainingStatistics): pass def after_training(self, runner, training_stats: TrainingStatistics): pass def before_training_set(self, runner, training_stats: TrainingStatistics, sampler): pass def after_training_set(self, runner, training_stats: TrainingStatistics): pass def before_test_set(self, runner, training_stats: TrainingStatistics, sampler): pass def after_test_set(self, runner, training_stats: TrainingStatistics): pass def before_epoch(self, epoch, runner, training_stats: TrainingStatistics): pass def after_epoch(self, epoch, runner, training_stats: TrainingStatistics): pass def before_test_batch(self, runner, training_stats: TrainingStatistics, input): pass def after_test_batch(self, runner, training_stats: TrainingStatistics, output): pass
27.878788
83
0.668478
191
1,840
6.256545
0.277487
0.070293
0.158996
0.309623
0.570711
0.513808
0.513808
0.408368
0.297908
0.105439
0
0.008029
0.255435
1,840
65
84
28.307692
0.864234
0.070652
0
0.463415
0
0
0
0
0
0
0
0
0
1
0.365854
false
0.414634
0.04878
0
0.536585
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
4
fc3c692100c493b8417e66da8fb117604d1117c1
226
py
Python
tavern/testutils/pytesthook/__init__.py
brenordv/tavern
f88f954c0bfc0883c3027ab009a74e65fd892f67
[ "MIT" ]
3
2020-04-17T15:30:51.000Z
2020-08-15T05:51:38.000Z
tavern/testutils/pytesthook/__init__.py
brenordv/tavern
f88f954c0bfc0883c3027ab009a74e65fd892f67
[ "MIT" ]
null
null
null
tavern/testutils/pytesthook/__init__.py
brenordv/tavern
f88f954c0bfc0883c3027ab009a74e65fd892f67
[ "MIT" ]
1
2020-04-19T10:08:50.000Z
2020-04-19T10:08:50.000Z
from .hooks import pytest_collect_file, pytest_addoption, pytest_addhooks from .util import add_parser_options __all__ = [ "pytest_addoption", "pytest_collect_file", "pytest_addhooks", "add_parser_options", ]
22.6
73
0.761062
27
226
5.777778
0.481481
0.166667
0.217949
0.294872
0
0
0
0
0
0
0
0
0.154867
226
9
74
25.111111
0.816754
0
0
0
0
0
0.300885
0
0
0
0
0
0
1
0
false
0
0.25
0
0.25
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
fc530c808417662854ad642f79b36d29b26c6055
413
py
Python
src/locations/admin_actions.py
mrts/foodbank-campaign
fbb059f3ebe44dccde4895964242b105421a69d1
[ "MIT" ]
1
2021-03-20T10:14:21.000Z
2021-03-20T10:14:21.000Z
src/locations/admin_actions.py
mrts/foodbank-campaign
fbb059f3ebe44dccde4895964242b105421a69d1
[ "MIT" ]
4
2018-03-24T21:49:02.000Z
2021-01-13T21:31:44.000Z
src/locations/admin_actions.py
mrts/foodbank-campaign
fbb059f3ebe44dccde4895964242b105421a69d1
[ "MIT" ]
3
2018-04-15T16:34:46.000Z
2019-11-13T16:38:05.000Z
from django.shortcuts import render from django.utils.translation import ugettext_lazy as _ def list_volunteers_by_shift_and_location(modeladmin, request, queryset): return render(request, 'locations/list_volunteers_by_shift_and_location.html', context = {'locations': queryset}) list_volunteers_by_shift_and_location.short_description = _('List of volunteers by location and shift')
45.888889
103
0.789346
52
413
5.903846
0.519231
0.156352
0.156352
0.205212
0.312704
0.312704
0
0
0
0
0
0
0.142857
413
8
104
51.625
0.867232
0
0
0
0
0
0.244552
0.125908
0
0
0
0
0
1
0.142857
false
0
0.285714
0.142857
0.571429
0
0
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
0
0
0
1
1
0
0
4
fc5ac0ae78e4a7a0bf263a12617a4fe27195e50d
2,101
py
Python
third_party/python/Lib/test/test_sundry.py
appotry/cosmopolitan
af4687cc3f2331a23dc336183ab58fe001cda082
[ "ISC" ]
36
2019-06-07T20:44:06.000Z
2022-03-23T06:19:43.000Z
third_party/python/Lib/test/test_sundry.py
appotry/cosmopolitan
af4687cc3f2331a23dc336183ab58fe001cda082
[ "ISC" ]
3
2021-11-19T11:12:39.000Z
2021-11-27T03:00:35.000Z
third_party/python/Lib/test/test_sundry.py
appotry/cosmopolitan
af4687cc3f2331a23dc336183ab58fe001cda082
[ "ISC" ]
28
2019-06-27T04:11:27.000Z
2022-03-11T06:27:44.000Z
"""Do a minimal test of all the modules that aren't otherwise tested.""" import importlib import sys from test import support import unittest class TestUntestedModules(unittest.TestCase): def test_untested_modules_can_be_imported(self): untested = ('encodings', 'formatter', 'nturl2path', 'tabnanny') with support.check_warnings(quiet=True): for name in untested: try: support.import_module('test.test_{}'.format(name)) except unittest.SkipTest: importlib.import_module(name) else: self.fail('{} has tests even though test_sundry claims ' 'otherwise'.format(name)) import distutils.bcppcompiler import distutils.ccompiler import distutils.cygwinccompiler import distutils.filelist import distutils.text_file import distutils.unixccompiler import distutils.command.bdist_dumb if sys.platform.startswith('win'): import distutils.command.bdist_msi import distutils.command.bdist import distutils.command.bdist_rpm import distutils.command.bdist_wininst import distutils.command.build_clib import distutils.command.build_ext import distutils.command.build import distutils.command.clean import distutils.command.config import distutils.command.install_data import distutils.command.install_egg_info import distutils.command.install_headers import distutils.command.install_lib import distutils.command.register import distutils.command.sdist import distutils.command.upload import html.entities try: import tty # Not available on Windows except ImportError: if support.verbose: print("skipping tty") if __name__ == "__main__": unittest.main()
36.859649
76
0.612565
204
2,101
6.161765
0.47549
0.274463
0.297534
0.107399
0
0
0
0
0
0
0
0.000706
0.325559
2,101
56
77
37.517857
0.88638
0.043789
0
0.041667
0
0
0.061907
0
0
0
0
0
0
1
0.020833
false
0
0.6875
0
0.729167
0.020833
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
fc65b103b4f95ee0ec89b6c8addb126acabc16a0
195
py
Python
blockchain/routing.py
pincoin/blockchain-example
afd5ddf84851b6c8b40da89ff90fbe7577923b26
[ "MIT" ]
null
null
null
blockchain/routing.py
pincoin/blockchain-example
afd5ddf84851b6c8b40da89ff90fbe7577923b26
[ "MIT" ]
7
2019-12-04T23:36:31.000Z
2021-06-09T18:01:13.000Z
blockchain/routing.py
pincoin/pincoin-bak
afd5ddf84851b6c8b40da89ff90fbe7577923b26
[ "MIT" ]
null
null
null
from django.urls import path from . import consumers websocket_urlpatterns = [ path('ws/blockchain/peer', consumers.PeerConsumer), path('ws/blockchain/echo', consumers.EchoConsumer), ]
21.666667
55
0.748718
22
195
6.590909
0.636364
0.082759
0.22069
0
0
0
0
0
0
0
0
0
0.133333
195
8
56
24.375
0.857988
0
0
0
0
0
0.184615
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
fc6882de84561473c24a8965dff0a63c1330173a
571
py
Python
tests/fixtures/audio.py
NickleDave/vocles
897cff032af845b0a49af4a0bfdd1a3195b677a9
[ "BSD-3-Clause" ]
2
2022-01-17T14:43:38.000Z
2022-01-17T14:52:14.000Z
tests/fixtures/audio.py
NickleDave/vocles
897cff032af845b0a49af4a0bfdd1a3195b677a9
[ "BSD-3-Clause" ]
2
2022-01-18T13:54:17.000Z
2022-01-21T13:41:02.000Z
tests/fixtures/audio.py
NickleDave/vocles
897cff032af845b0a49af4a0bfdd1a3195b677a9
[ "BSD-3-Clause" ]
2
2022-02-12T13:48:51.000Z
2022-03-27T20:55:01.000Z
"""fixtures relating to audio files""" import pytest @pytest.fixture def audio_dir_cbin(source_test_data_root): return source_test_data_root.joinpath("audio_cbin_annot_notmat", "gy6or6", "032312") @pytest.fixture def audio_list_cbin(audio_dir_cbin): return sorted(audio_dir_cbin.glob("*.cbin")) @pytest.fixture def audio_dir_wav(source_test_data_root): return source_test_data_root.joinpath( "audio_wav_annot_birdsongrec", "Bird0", "Wave" ) @pytest.fixture def audio_list_wav(audio_dir_wav): return sorted(audio_dir_wav.glob("*.wav"))
22.84
88
0.763573
83
571
4.843373
0.337349
0.119403
0.159204
0.208955
0.517413
0.273632
0.273632
0.273632
0.273632
0.273632
0
0.017928
0.120841
571
24
89
23.791667
0.782869
0.056042
0
0.266667
0
0
0.153846
0.093809
0
0
0
0
0
1
0.266667
false
0
0.066667
0.266667
0.6
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4
fc7eb3a0dbeadd11aeffbf1b286308d3db4a6545
232
py
Python
terrascript/resource/cappyzawa/concourse.py
mjuenema/python-terrascript
6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d
[ "BSD-2-Clause" ]
507
2017-07-26T02:58:38.000Z
2022-01-21T12:35:13.000Z
terrascript/resource/cappyzawa/concourse.py
mjuenema/python-terrascript
6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d
[ "BSD-2-Clause" ]
135
2017-07-20T12:01:59.000Z
2021-10-04T22:25:40.000Z
terrascript/resource/cappyzawa/concourse.py
mjuenema/python-terrascript
6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d
[ "BSD-2-Clause" ]
81
2018-02-20T17:55:28.000Z
2022-01-31T07:08:40.000Z
# terrascript/resource/cappyzawa/concourse.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:14:28 UTC) import terrascript class concourse_team(terrascript.Resource): pass __all__ = [ "concourse_team", ]
17.846154
73
0.758621
29
232
5.862069
0.758621
0.223529
0
0
0
0
0
0
0
0
0
0.06
0.137931
232
12
74
19.333333
0.79
0.49569
0
0
1
0
0.122807
0
0
0
0
0
0
1
0
false
0.166667
0.166667
0
0.333333
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
4
fc8095d7448465871daee87e4a89aa6e0651a07d
303
py
Python
pyinformix/__init__.py
homedepot/pyinformix
06a037510f79d12557a0dc0b795e2a92eb79ecb3
[ "Apache-2.0" ]
null
null
null
pyinformix/__init__.py
homedepot/pyinformix
06a037510f79d12557a0dc0b795e2a92eb79ecb3
[ "Apache-2.0" ]
null
null
null
pyinformix/__init__.py
homedepot/pyinformix
06a037510f79d12557a0dc0b795e2a92eb79ecb3
[ "Apache-2.0" ]
null
null
null
from sqlalchemy.dialects import registry __version__ = '0.1.0.post1' registry.register('informix', 'pyinformix.ibm_db', 'InformixDialect') registry.register('informix.ibm_db', 'pyinformix.ibm_db', 'InformixDialect') registry.register('informix.ifx_jdbc', 'pyinformix.ifx_jdbc', 'InformixJDBCDialect')
37.875
84
0.792079
35
303
6.6
0.514286
0.207792
0.311688
0.25974
0.467532
0.467532
0.467532
0
0
0
0
0.014035
0.059406
303
7
85
43.285714
0.796491
0
0
0
0
0
0.504951
0
0
0
0
0
0
1
0
false
0
0.2
0
0.2
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
0
0
0
0
0
4
fc9411b57422bff7786a216b1a7512c61cab5ec3
77
py
Python
setup.py
jgotanegra/wallet
cc746de4123eefef5c3148120593151536e381ef
[ "MIT" ]
15
2019-05-01T06:21:41.000Z
2021-12-31T10:18:51.000Z
setup.py
jackyjqcheung/eth-wallet
cc746de4123eefef5c3148120593151536e381ef
[ "MIT" ]
17
2019-04-17T16:24:59.000Z
2021-11-06T04:14:57.000Z
setup.py
jackyjqcheung/eth-wallet
cc746de4123eefef5c3148120593151536e381ef
[ "MIT" ]
8
2019-05-03T14:56:47.000Z
2022-01-14T14:08:25.000Z
#!/usr/bin/python3 from setuptools import setup setup(use_scm_version=True)
15.4
28
0.805195
12
77
5
0.916667
0
0
0
0
0
0
0
0
0
0
0.014286
0.090909
77
4
29
19.25
0.842857
0.220779
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
fc9dee027f4e37d89121bf1b62e0549b66d7cce2
18
py
Python
cloudmesh/kubeman/__version__.py
cloudmesh/cloudmesh-kubeman
a2440cf3efddd573d07f7813567561540f6d385a
[ "Apache-2.0" ]
1
2022-03-14T18:20:21.000Z
2022-03-14T18:20:21.000Z
cloudmesh/kubeman/__version__.py
cloudmesh/cloudmesh-kubeman
a2440cf3efddd573d07f7813567561540f6d385a
[ "Apache-2.0" ]
15
2022-02-09T15:59:02.000Z
2022-03-03T00:20:29.000Z
cloudmesh/kubeman/__version__.py
cloudmesh/cloudmesh-kubeman
a2440cf3efddd573d07f7813567561540f6d385a
[ "Apache-2.0" ]
2
2022-03-12T02:50:50.000Z
2022-03-14T03:56:54.000Z
version = "4.3.4"
9
17
0.555556
4
18
2.5
0.75
0
0
0
0
0
0
0
0
0
0
0.2
0.166667
18
1
18
18
0.466667
0
0
0
0
0
0.277778
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
5d86595ad593e0db5398b6e1b5934e647451117f
8,668
py
Python
python/tests/data.py
kngwyu/rogue-gym
00de77e6c9f3d2b9ed602f93abb5526c13791ca9
[ "Apache-2.0", "MIT" ]
67
2018-11-29T03:05:59.000Z
2022-02-23T20:05:21.000Z
python/tests/data.py
kngwyu/rogue-gym
00de77e6c9f3d2b9ed602f93abb5526c13791ca9
[ "Apache-2.0", "MIT" ]
2
2019-02-27T10:44:05.000Z
2022-03-05T22:25:49.000Z
python/tests/data.py
kngwyu/rogue-gym
00de77e6c9f3d2b9ed602f93abb5526c13791ca9
[ "Apache-2.0", "MIT" ]
6
2020-05-11T01:37:53.000Z
2022-03-05T20:56:19.000Z
SEED1_DUNGEON = [ ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ... ', ' .@. ', ' ... ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '] CMD_STR = 'kHhhKK' CMD_STR5 = 'llljln' SEED1_DUNGEON2 = [ ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' --- ', ' +@. ', ' |.S ', ' | ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '] SEED1_DUNGEON3 = [ ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' S.. ', ' .@. ', ' +-- ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '] SEED1_DUNGEON_CLEAR = [ ' ', '######################### ----------------- -------------------- ', ' # |.............*.| |..................| ', '####### ############# ### ######+...............| |...*...........%..| ', '# # # # # # |...............+##+..................| ', '### ##### ############*###### ---------------+- --+----------------- ', ' # # ### ', ' ############## ######## # ', ' # ---------------+- # ', ' -----+- ############+...............| -+---- ', ' |.....| # |...............| #######+....| ', ' |.....+###### |......*........+## |..*.| ', ' |....*| |...............| |....| ', ' ----+-- |...............| ------ ', ' ### --------+-------- ', ' # #### ', ' ----+----------- -+-------- --------------- ', ' |..............| |........| |........*....| ', ' |..............| |.......*| |.............| ', ' |.....*........+###### |........| #+.............| ', ' |............@.| #########+........+#####################|.............| ', ' ---------------- ---------- --------------- ', ' ', ' '] CMD_STR2 = 'kLLjLlKkLkkLKkLKklLlkLL>' CMD_STR3 = 'nLLLlnl>' CMD_STR4 = 'JHHKHJHKLKHKHKKlllll>'
77.392857
87
0.018805
26
8,668
5.884615
0.653846
0.156863
0
0
0
0
0
0
0
0
0
0.007628
0.848754
8,668
111
88
78.09009
0.109077
0
0
0.67619
0
0
0.893516
0.027457
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
1
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
5d95f60f799fed7b38e00057d0468d6ee07f75ba
5,342
py
Python
lib/galaxy/webapps/galaxy/api/group_users.py
bopopescu/phyG
023f505b705ab953f502cbc55e90612047867583
[ "CC-BY-3.0" ]
2
2016-02-23T00:09:14.000Z
2019-02-11T07:48:44.000Z
lib/galaxy/webapps/galaxy/api/group_users.py
bopopescu/phyG
023f505b705ab953f502cbc55e90612047867583
[ "CC-BY-3.0" ]
null
null
null
lib/galaxy/webapps/galaxy/api/group_users.py
bopopescu/phyG
023f505b705ab953f502cbc55e90612047867583
[ "CC-BY-3.0" ]
6
2015-05-27T13:09:50.000Z
2019-02-11T07:48:46.000Z
""" API operations on Group objects. """ import logging from galaxy.web.base.controller import BaseAPIController, url_for from galaxy import web log = logging.getLogger( __name__ ) class GroupUsersAPIController( BaseAPIController ): @web.expose_api @web.require_admin def index( self, trans, group_id, **kwd ): """ GET /api/groups/{encoded_group_id}/users Displays a collection (list) of groups. """ decoded_group_id = trans.security.decode_id( group_id ) try: group = trans.sa_session.query( trans.app.model.Group ).get( decoded_group_id ) except: group = None if not group: trans.response.status = 400 return "Invalid group id ( %s ) specified." % str( group_id ) rval = [] try: for uga in group.users: user = uga.user encoded_id = trans.security.encode_id( user.id ) rval.append( dict( id = encoded_id, email = user.email, url = url_for( 'group_user', group_id=group_id, id=encoded_id, ) ) ) except Exception, e: rval = "Error in group API at listing users" log.error( rval + ": %s" % str(e) ) trans.response.status = 500 return rval @web.expose_api @web.require_admin def show( self, trans, id, group_id, **kwd ): """ GET /api/groups/{encoded_group_id}/users/{encoded_user_id} Displays information about a group user. """ user_id = id decoded_group_id = trans.security.decode_id( group_id ) decoded_user_id = trans.security.decode_id( user_id ) item = None try: group = trans.sa_session.query( trans.app.model.Group ).get( decoded_group_id ) user = trans.sa_session.query( trans.app.model.User ).get( decoded_user_id ) for uga in group.users: if uga.user == user: item = dict( id = user_id, email = user.email, url = url_for( 'group_user', group_id=group_id, id=user_id) ) # TODO Fix This if not item: item = "user %s not in group %s" % (user.email,group.name) except Exception, e: item = "Error in group_user API group %s user %s" % (group.name, user.email) log.error(item + ": %s" % str(e)) return item @web.expose_api @web.require_admin def update( self, trans, id, group_id, **kwd ): """ PUT /api/groups/{encoded_group_id}/users/{encoded_user_id} Adds a user to a group """ user_id = id decoded_group_id = trans.security.decode_id( group_id ) decoded_user_id = trans.security.decode_id( user_id ) item = None try: group = trans.sa_session.query( trans.app.model.Group ).get( decoded_group_id ) user = trans.sa_session.query( trans.app.model.User ).get( decoded_user_id ) for uga in group.users: if uga.user == user: item = dict( id = user_id, email = user.email, url = url_for( 'group_user', group_id=group_id, id=user_id) ) if not item: uga = trans.app.model.UserGroupAssociation( user, group ) # Add UserGroupAssociations trans.sa_session.add( uga ) trans.sa_session.flush() item = dict( id = user_id, email = user.email, url = url_for( 'group_user', group_id=group_id, id=user_id) ) except Exception, e: item = "Error in group_user API Adding user %s to group %s" % (user.email,group.name) log.error(item + ": %s" % str(e)) return item @web.expose_api @web.require_admin def delete( self, trans, id, group_id, **kwd ): """ DELETE /api/groups/{encoded_group_id}/users/{encoded_user_id} Removes a user from a group """ user_id = id decoded_group_id = trans.security.decode_id( group_id ) decoded_user_id = trans.security.decode_id( user_id ) try: group = trans.sa_session.query( trans.app.model.Group ).get( decoded_group_id ) user = trans.sa_session.query( trans.app.model.User ).get( decoded_user_id ) for uga in group.users: if uga.user == user: trans.sa_session.delete( uga ) trans.sa_session.flush() item = dict( id = user_id, email = user.email, url = url_for( 'group_user', group_id=group_id, id=user_id) ) if not item: item = "user %s not in group %s" % (user.email,group.name) except Exception, e: item = "Error in group_user API Removing user %s from group %s" % (user.email,group.name) log.error(item + ": %s" % str(e)) return item
42.736
113
0.528641
642
5,342
4.207165
0.143302
0.082932
0.039985
0.054424
0.718253
0.711588
0.691966
0.669752
0.669752
0.605331
0
0.001791
0.372707
5,342
124
114
43.080645
0.804238
0.007301
0
0.704082
0
0
0.069757
0
0
0
0
0.008065
0
0
null
null
0.010204
0.030612
null
null
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
4
5db055144eb506d4ff8f89c0e19227a56de3c9f2
29,329
py
Python
signal_WT_RN7.py
GUO-Liping/SignalProcessing
8625eef788adddd967455e1b675fca7ac3569a6b
[ "Apache-2.0" ]
3
2021-01-24T08:02:33.000Z
2021-08-15T13:19:11.000Z
signal_WT_RN7.py
GUO-Liping/SignalProcessing
8625eef788adddd967455e1b675fca7ac3569a6b
[ "Apache-2.0" ]
null
null
null
signal_WT_RN7.py
GUO-Liping/SignalProcessing
8625eef788adddd967455e1b675fca7ac3569a6b
[ "Apache-2.0" ]
null
null
null
import numpy as np import matplotlib.pyplot as plt import pywt #import pywt.data #import pandas as pd def func_round(number): if number >= 0: if number - int(number) >= 0.5: return int(number) + 1 else: return int(number) elif number < 0: if number - int(number)<=-0.5: return int(number) - 1 else: return int(number) else: print("请检查输入!") def diff_2point(data_x, data_y): diff_data=np.zeros_like(data_y) for i in range(len(data_y)-1): timestep = data_x[i+1] - data_x[i] data_step = (data_y[i+1] - data_y[i]) diff_data[i] = data_step/timestep diff_data[-1] = (data_y[-1]-data_y[-2])/timestep return diff_data # 该函数是用于将采样频率混合125Hz,250Hz,500Hz的位移捕捉离散信号通过线性插值调整为采样频率统一为最大频率500Hz的采样信号 def func_update_disp(para_time, para_disp, target_freq): max_freq = 1000 timestep = 1/max_freq time_maxnum = np.arange(para_time[0], para_time[-1]+timestep, timestep) disp_maxnum = np.zeros_like(time_maxnum) s = 0 for i in range(len(para_time)-1): # python取整函数int为向零方向取整,一定要注意一下,round为四舍五入函数,可以取整到小数位 count = func_round((para_time[i+1] - para_time[i])/timestep) disp_step = (para_disp[i+1] - para_disp[i])/count s = s + count for j in range (count): disp_maxnum[s-count+j] = para_disp[i]+j*disp_step disp_maxnum[-1] = para_disp[-1] if max_freq%target_freq==0: timestep = 1 / target_freq time_update = np.arange(para_time[0], para_time[-1], timestep) disp_update = np.zeros_like(time_update) amp = func_round(max_freq/target_freq) for k in range (len(time_update)): disp_update[k] = disp_maxnum[amp*k] else: print('最大采样频率与目标频率不为整数倍关系!') return [time_update, disp_update] def func_SNR(data): A_signal = np.max(data) - np.min(data) sub_data = data[1:] - data[:-1] A_noise = np.maximum(np.abs(np.max(sub_data)),np.abs(np.min(sub_data))) return 20*np.log10(A_signal/A_noise) # time series与disp_series 为位移时程的捕捉原始数据,包含了采样频率为500Hz,采样频率为250Hz,采样频率为125Hz等不同的时间间隔 time_series = np.array([0,0.002,0.004,0.006,0.008,0.01,0.012,0.014,0.016,0.018,0.02,0.022,0.024,0.026,0.028,0.03,0.032,0.034,0.036,0.038,0.04,0.042,0.044,0.046,0.048,0.05,0.052,0.054,0.056,0.058,0.06,0.062,0.064,0.066,0.068,0.07,0.072,0.074,0.076,0.078,0.08,0.082,0.084,0.086,0.088,0.09,0.092,0.094,0.096,0.098,0.1,0.102,0.104,0.106,0.108,0.11,0.112,0.114,0.116,0.118,0.12,0.122,0.124,0.126,0.128,0.13,0.132,0.134,0.136,0.138,0.14,0.142,0.144,0.146,0.148,0.15,0.152,0.154,0.156,0.158,0.16,0.162,0.164,0.166,0.168,0.17,0.172,0.174,0.176,0.178,0.18,0.182,0.184,0.186,0.188,0.19,0.192,0.194,0.196,0.198,0.2,0.202,0.204,0.206,0.208,0.21,0.212,0.214,0.216,0.218,0.22,0.222,0.224,0.226,0.228,0.23,0.232,0.234,0.236,0.238,0.24,0.242,0.244,0.246,0.248,0.25,0.252,0.254,0.256,0.258,0.26,0.262,0.264,0.266,0.268,0.27,0.272,0.274,0.276,0.278,0.28,0.282,0.284,0.286,0.288,0.29,0.292,0.294,0.296,0.298,0.3,0.302,0.304,0.306,0.308,0.31,0.312,0.314,0.316,0.318,0.32,0.322,0.324,0.326,0.328,0.33,0.332,0.334,0.336,0.338,0.34,0.342,0.344,0.346,0.348,0.35,0.352,0.354,0.356,0.358,0.36,0.362,0.364,0.366,0.368,0.37,0.372,0.374,0.376,0.378,0.38,0.382,0.384,0.386,0.388,0.39,0.392,0.394,0.396,0.398,0.4,0.402,0.404,0.406,0.408,0.41,0.412,0.414,0.416,0.418,0.42,0.422,0.424,0.426,0.428,0.43,0.432,0.434,0.436,0.438,0.44,0.442,0.444,0.446,0.448,0.45,0.452,0.454,0.456,0.458,0.46,0.462,0.464,0.466,0.468,0.47,0.472,0.474,0.476,0.478,0.48,0.482,0.484,0.486,0.488,0.49,0.492,0.494,0.496,0.498,0.5,0.502,0.504,0.506,0.508,0.51,0.512,0.514,0.516,0.518,0.52,0.522,0.524,0.526,0.528,0.53,0.532,0.534,0.536,0.538,0.54,0.542,0.544,0.546,0.548,0.55,0.552,0.554,0.556,0.558,0.56,0.562,0.564,0.566,0.568,0.57,0.572,0.574,0.576,0.578,0.58,0.582,0.584,0.586,0.588,0.59,0.592,0.594,0.596,0.598,0.6,0.602,0.604,0.606,0.608,0.61,0.612,0.614,0.616,0.618,0.62,0.622,0.624,0.626,0.628,0.63,0.632,0.634,0.636,0.638,0.64,0.642,0.644,0.646,0.648,0.65,0.652,0.654,0.656,0.658,0.66,0.662,0.664,0.666,0.668,0.67,0.672,0.674,0.676,0.678,0.68,0.682,0.684,0.686,0.688,0.69,0.692,0.694,0.696,0.698,0.7,0.702,0.704,0.706,0.708,0.71,0.712,0.714,0.716,0.718,0.72,0.722,0.724,0.726,0.728,0.73,0.732,0.734,0.736,0.738,0.74,0.742,0.744,0.746,0.748,0.75,0.752,0.754,0.756,0.758,0.76,0.762,0.764,0.766,0.768,0.77,0.772,0.774,0.776,0.778,0.78,0.782,0.784,0.786,0.788,0.79,0.792,0.794,0.796,0.798,0.8,0.802,0.804,0.806,0.808,0.81,0.812,0.814,0.816,0.818,0.82,0.822,0.824,0.826,0.828,0.83,0.832,0.834,0.836,0.838,0.84,0.842,0.844,0.846,0.848,0.85,0.852,0.854,0.856,0.858,0.86,0.862,0.864,0.866,0.868,0.87,0.872,0.874,0.876,0.878,0.88,0.882,0.884,0.886,0.888,0.89,0.892,0.894,0.896,0.898,0.9,0.902,0.904,0.906,0.908,0.91,0.912,0.914,0.916,0.918,0.92,0.922,0.924,0.926,0.928,0.93,0.932,0.934,0.936,0.938,0.94,0.942,0.944,0.946,0.948,0.95,0.952,0.954,0.956,0.958,0.96,0.962,0.964,0.966,0.968,0.97,0.972,0.974,0.976,0.978,0.98,0.982,0.984,0.986,0.988,0.99,0.992,0.994,0.996,0.998,1,1.002,1.004,1.006,1.008,1.01,1.012,1.014,1.016,1.018,1.02,1.022,1.024,1.026,1.028,1.03,1.032,1.034,1.036,1.038,1.04,1.042,1.044,1.046,1.048,1.05,1.052,1.054,1.056,1.058,1.06,1.062,1.064,1.066,1.068,1.07,1.072,1.074,1.076,1.078,1.08,1.082,1.084,1.086,1.088,1.09,1.092,1.094,1.096,1.098,1.1,1.102,1.104,1.106,1.108,1.11,1.112,1.114,1.116,1.118,1.12,1.122,1.124,1.126,1.128,1.13,1.132,1.134,1.136,1.138,1.14,1.142,1.144,1.146,1.148,1.15,1.152,1.154,1.156,1.158,1.16,1.162,1.164,1.166,1.168,1.17,1.172,1.174,1.176,1.178,1.18,1.182,1.184,1.186,1.188,1.19,1.192,1.194,1.196,1.198,1.2,1.202,1.204,1.206,1.208,1.21,1.212,1.214,1.216,1.218,1.22,1.222,1.224,1.226,1.228,1.23,1.232,1.234,1.236,1.238,1.24,1.242,1.244,1.246,1.248,1.25,1.252,1.254,1.256,1.258,1.26,1.262,1.264,1.266,1.268,1.27,1.272,1.274,1.276,1.278,1.28,1.282,1.284,1.286,1.288,1.29,1.292,1.294,1.296,1.298,1.3,1.302,1.304,1.306,1.308,1.31,1.312,1.314,1.316,1.318,1.32,1.322,1.324,1.326,1.328,1.33,1.332,1.334,1.336,1.338,1.34,1.342,1.344,1.346,1.348,1.35,1.352,1.354,1.356,1.358,1.36,1.362,1.364,1.366,1.368,1.37,1.372,1.374,1.376,1.378,1.38,1.382,1.384,1.386,1.388,1.39,1.392,1.394,1.396,1.398,1.4,1.402,1.404,1.406,1.408,1.41,1.412,1.414,1.416,1.418,1.42,1.422,1.424,1.426,1.428,1.43,1.432,1.434,1.436,1.438,1.44,1.442,1.444,1.446,1.448,1.45,1.452,1.454,1.456,1.458,1.46,1.462,1.464,1.466,1.468,1.47,1.472,1.474,1.476,1.478,1.48,1.482,1.484,1.486,1.488,1.49,1.492,1.494,1.496,1.498,1.5,1.502,1.504,1.506,1.508,1.51,1.512,1.514,1.516,1.518,1.52,1.522,1.524,1.526,1.528,1.53,1.532,1.534,1.536,1.538,1.54,1.542,1.544,1.546,1.548,1.55,1.552,1.554,1.556,1.558,1.56,1.562,1.564,1.566,1.568,1.57,1.572,1.574,1.576,1.578,1.58,1.582,1.584,1.586,1.588,1.59,1.592,1.594,1.596,1.598,1.6,1.602,1.604,1.606,1.608,1.61,1.612,1.614,1.616,1.618,1.62,1.622,1.624,1.626,1.628,1.63,1.632,1.634,1.636,1.638,1.64,1.642,1.644,1.646,1.648,1.65,1.652,1.654,1.656,1.658,1.66,1.662,1.664,1.666,1.668,1.67,1.672,1.674,1.676,1.678,1.68,1.682,1.684,1.686,1.688,1.69,1.692,1.694,1.696,1.698,1.7,1.702,1.704,1.706,1.708,1.71,1.712,1.714,1.716,1.718,1.72,1.722,1.724,1.726,1.728,1.73,1.732,1.734,1.736,1.738,1.74,1.742,1.744,1.746,1.748,1.75,1.752,1.754,1.756,1.76,1.764,1.768,1.772,1.776,1.78,1.784,1.788,1.792,1.796,1.8,1.804,1.808,1.812,1.816,1.82,1.824,1.828,1.832,1.836,1.84,1.844,1.848,1.852,1.856,1.86,1.864,1.868,1.872,1.876,1.88,1.884,1.888,1.892,1.896,1.9,1.904,1.908,1.912,1.916,1.92,1.924,1.928,1.932,1.936,1.94,1.944,1.948,1.952,1.956,1.96,1.964,1.968,1.972,1.976,1.98,1.984,1.988,1.992,1.996,2,2.004,2.008,2.012,2.016,2.02,2.024,2.028,2.032,2.036,2.04,2.044,2.048,2.052,2.056,2.06,2.064,2.068,2.072,2.076,2.08,2.084,2.088,2.092,2.096,2.1,2.104,2.108,2.112,2.116,2.12,2.124,2.128,2.132,2.136,2.14,2.144,2.148,2.152,2.156,2.16,2.164,2.168,2.172,2.176,2.18,2.184,2.188,2.192,2.196,2.2,2.204,2.208,2.212,2.216,2.22,2.224,2.228,2.232,2.236,2.24,2.244,2.248,2.252,2.256,2.26,2.264,2.268,2.272,2.276,2.28,2.284,2.288,2.292,2.296,2.3,2.304,2.308,2.312,2.316,2.32,2.324,2.328,2.332,2.336,2.34,2.344,2.348,2.352,2.356,2.36,2.364,2.368,2.372,2.376,2.38,2.384,2.388,2.392,2.396,2.4,2.404,2.408,2.412,2.416,2.42,2.424,2.428,2.432,2.436,2.44,2.444,2.448,2.452,2.456,2.46,2.464,2.468,2.472,2.476,2.48,2.484,2.488,2.492,2.496,2.5,2.504,2.508,2.512,2.516,2.52,2.524,2.528,2.532,2.536,2.54,2.544,2.548,2.552,2.556,2.56,2.564,2.568,2.572,2.576,2.58,2.584,2.588,2.592,2.596,2.6,2.604,2.608,2.612,2.616,2.62,2.624,2.628,2.632,2.636,2.64,2.644,2.648,2.652,2.656,2.66,2.664,2.668,2.672,2.676,2.68,2.684,2.688,2.692,2.696,2.7,2.704,2.708,2.712,2.716,2.72,2.724,2.728,2.732,2.736,2.74,2.744,2.748,2.752,2.756,2.76,2.764,2.768,2.772,2.776,2.78,2.784,2.788,2.792,2.796,2.8,2.804,2.808,2.812,2.816,2.82,2.824,2.828,2.832,2.836,2.84,2.844,2.848,2.852,2.856,2.86,2.864,2.868,2.872,2.876,2.88,2.884,2.888,2.892,2.896,2.9,2.904,2.908,2.912,2.916,2.92,2.924,2.928,2.932,2.936,2.94,2.944,2.948,2.952,2.956,2.96,2.964,2.968,2.972,2.976,2.98,2.984,2.988,2.992,2.996,3,3.004,3.008,3.012,3.016,3.02,3.024,3.028,3.032,3.036,3.04,3.044,3.048,3.052,3.056,3.06,3.064,3.068,3.072,3.076,3.08,3.084,3.088,3.092,3.096,3.1,3.104,3.108,3.112,3.116,3.12,3.124,3.128,3.132,3.136,3.14,3.144,3.148,3.152,3.156,3.16,3.164,3.168,3.172,3.176,3.18,3.184,3.188,3.192,3.196,3.2,3.204,3.208,3.212,3.216,3.22,3.224,3.228,3.232,3.236,3.24,3.244,3.248,3.252,3.256,3.26,3.264,3.268,3.272,3.276,3.28,3.284,3.288,3.292,3.296,3.3,3.304,3.308,3.312,3.316,3.32,3.324,3.328,3.332,3.336,3.34,3.344,3.348,3.352,3.356,3.36,3.364,3.368,3.372,3.376,3.38,3.384,3.388,3.392,3.396,3.4,3.404,3.408,3.412,3.416,3.42,3.424,3.428,3.432,3.436,3.44,3.444,3.448,3.452,3.456,3.46,3.464,3.468,3.472,3.476,3.48,3.484,3.488,3.492,3.496,3.5,3.504,3.508,3.512,3.516,3.52,3.524,3.528,3.532,3.536,3.54,3.544,3.548,3.552,3.556,3.56,3.564,3.568,3.572,3.576,3.58,3.584,3.588,3.592,3.596,3.6,3.604,3.608,3.612,3.616,3.62,3.624,3.628,3.632,3.636,3.64,3.644,3.648,3.652,3.656,3.66,3.664,3.668,3.676,3.684,3.692,3.7,3.708,3.716,3.724,3.732,3.74,3.748,3.756,3.764,3.772,3.78,3.788,3.796,3.804,3.812,3.82,3.828,3.836,3.844,3.852,3.86,3.868,3.876,3.884,3.892,3.9,3.908,3.916,3.924,3.932,3.94,3.948,3.956,3.964,3.972,3.98,3.988,3.996,4.004,4.012,4.02,4.028,4.036,4.044,4.052,4.06,4.068,4.076,4.084,4.092,4.1,4.108,4.116,4.124,4.14,4.156,4.172,4.188,4.204,4.22,4.236,4.252,4.268,4.284,4.3,4.316,4.332,4.348,4.364,4.38,4.396,4.412,4.428,4.444,4.46,4.476,4.492,4.508,4.524,4.54,4.556,4.572,4.588,4.604,4.62]) disp_series = np.array([0,-0.016276871,-0.03410392,-0.055031325,-0.07595873,-0.099211403,-0.11858863,-0.137965857,-0.157343084,-0.175170133,-0.19454736,-0.213924587,-0.231751636,-0.243377972,-0.27050609,-0.292983673,-0.309260544,-0.334063395,-0.353440622,-0.370492581,-0.393745254,-0.413122481,-0.432499708,-0.451876935,-0.47280434,-0.494506835,-0.516984418,-0.534811467,-0.554188694,-0.580541723,-0.598368772,-0.621621444,-0.635573048,-0.654950275,-0.670452056,-0.693704729,-0.724708292,-0.753386588,-0.774313994,-0.793691221,-0.808417913,-0.830120407,-0.850272724,-0.871975218,-0.892902623,-0.915380207,-0.933982345,-0.95490975,-0.973511888,-0.994439293,-1.015366698,-1.038619371,-1.061872043,-1.082799448,-1.100626497,-1.120778813,-1.137055684,-1.158758178,-1.177360316,-1.197512633,-1.222315483,-1.244017978,-1.264170294,-1.28432261,-1.310675639,-1.330827955,-1.350980271,-1.372682765,-1.392059992,-1.409887041,-1.430039357,-1.450191674,-1.47034399,-1.491271395,-1.509873533,-1.534676384,-1.5548287,-1.572655749,-1.591257887,-1.609084935,-1.627687073,-1.645514122,-1.666441528,-1.68116822,-1.699770358,-1.713721962,-1.733874278,-1.750151149,-1.764877841,-1.781154712,-1.798981761,-1.811383186,-1.8245597,-1.840836571,-1.840836571,-1.856338353,-1.873390313,-1.889667183,-1.898193163,-1.903618787,-1.9098195,-1.913694945,-1.915245123,-1.91757039,-1.920670747,-1.920670747,-1.920670747,-1.920670747,-1.919120569,-1.916020212,-1.9098195,-1.902843698,-1.896642985,-1.889667183,-1.88424156,-1.879591025,-1.871840134,-1.861763976,-1.853237997,-1.847037284,-1.838511304,-1.828435146,-1.819134077,-1.810608097,-1.800531939,-1.792781048,-1.784255068,-1.777279266,-1.768753286,-1.761002396,-1.751701327,-1.744725525,-1.734649367,-1.727673565,-1.716047229,-1.70674616,-1.69822018,-1.693569645,-1.684268576,-1.676517686,-1.666441528,-1.65636537,-1.64783939,-1.63931341,-1.628462163,-1.620711272,-1.612185292,-1.603659312,-1.59668351,-1.587382441,-1.576531194,-1.568005214,-1.557929056,-1.553278522,-1.545527631,-1.540102007,-1.533901294,-1.524600225,-1.517624424,-1.508323355,-1.499022286,-1.492046484,-1.483520504,-1.477319791,-1.471119079,-1.464143277,-1.458717653,-1.452516941,-1.44476605,-1.437015159,-1.430814446,-1.425388823,-1.416087754,-1.409887041,-1.40213615,-1.39438526,-1.386634369,-1.376558211,-1.367257142,-1.358731162,-1.350980271,-1.346329736,-1.337028667,-1.326952509,-1.319976708,-1.313000906,-1.307575282,-1.30137457,-1.295948946,-1.288973144,-1.281997343,-1.275021541,-1.269595917,-1.263395205,-1.257194492,-1.248668512,-1.240142532,-1.23316673,-1.226190929,-1.220765305,-1.213789503,-1.206813702,-1.202163167,-1.195962454,-1.19131192,-1.181235762,-1.17425996,-1.168834337,-1.164183802,-1.155657822,-1.147906931,-1.141706219,-1.137830773,-1.134730417,-1.129304793,-1.126204437,-1.120778813,-1.113027923,-1.106052121,-1.100626497,-1.093650696,-1.086674894,-1.082024359,-1.077373825,-1.074273468,-1.070398023,-1.067297667,-1.062647132,-1.057996598,-1.052570974,-1.046370262,-1.040169549,-1.033193747,-1.025442856,-1.019242144,-1.01381652,-1.008390896,-1.002965273,-0.995989471,-0.990563848,-0.986688402,-0.980487689,-0.976612244,-0.97118662,-0.966536086,-0.96343573,-0.959560284,-0.95490975,-0.951034304,-0.945608681,-0.942508324,-0.93785779,-0.931657077,-0.927006543,-0.923906186,-0.919255652,-0.914605117,-0.908404405,-0.905304048,-0.902203692,-0.898328247,-0.892127534,-0.887477,-0.884376643,-0.878175931,-0.874300485,-0.869649951,-0.866549594,-0.862674149,-0.860348882,-0.856473436,-0.85337308,-0.849497635,-0.8448471,-0.842521833,-0.837871298,-0.834770942,-0.831670586,-0.82779514,-0.823919695,-0.81926916,-0.816168804,-0.813068448,-0.811518269,-0.807642824,-0.805317557,-0.801442111,-0.799116844,-0.796791577,-0.792916132,-0.789040686,-0.787490508,-0.783615063,-0.781289795,-0.77741435,-0.773538904,-0.76888837,-0.767338192,-0.764237835,-0.762687657,-0.76036239,-0.756486945,-0.754161677,-0.752611499,-0.752611499,-0.751061321,-0.747960965,-0.746410787,-0.744860608,-0.742535341,-0.742535341,-0.740985163,-0.738659896,-0.737884807,-0.73478445,-0.734009361,-0.731684094,-0.729358827,-0.729358827,-0.72625847,-0.723933203,-0.722383025,-0.720832847,-0.719282669,-0.71850758,-0.71773249,-0.715407223,-0.715407223,-0.713857045,-0.711531778,-0.7099816,-0.709206511,-0.708431421,-0.706106154,-0.703005798,-0.703005798,-0.703005798,-0.70145562,-0.700680531,-0.700680531,-0.700680531,-0.699130353,-0.698355263,-0.696805085,-0.695254907,-0.695254907,-0.693704729,-0.694479818,-0.695254907,-0.694479818,-0.696805085,-0.695254907,-0.697580174,-0.696805085,-0.695254907,-0.695254907,-0.695254907,-0.697580174,-0.694479818,-0.694479818,-0.69292964,-0.696805085,-0.695254907,-0.694479818,-0.695254907,-0.695254907,-0.695254907,-0.695254907,-0.695254907,-0.695254907,-0.696029996,-0.695254907,-0.69292964,-0.695254907,-0.696805085,-0.696805085,-0.696805085,-0.696805085,-0.698355263,-0.696805085,-0.697580174,-0.696029996,-0.699130353,-0.699905442,-0.699905442,-0.699905442,-0.699905442,-0.699905442,-0.699130353,-0.699905442,-0.702230709,-0.703005798,-0.705331065,-0.707656332,-0.710756689,-0.711531778,-0.711531778,-0.713857045,-0.714632134,-0.713857045,-0.713857045,-0.713857045,-0.713857045,-0.716182312,-0.71850758,-0.720832847,-0.720832847,-0.723933203,-0.725483381,-0.727808649,-0.727808649,-0.729358827,-0.729358827,-0.730909005,-0.734009361,-0.736334628,-0.737109718,-0.737884807,-0.740210074,-0.741760252,-0.742535341,-0.744860608,-0.748736054,-0.75183641,-0.753386588,-0.756486945,-0.758812212,-0.761137479,-0.764237835,-0.765788014,-0.768113281,-0.771213637,-0.774313994,-0.776639261,-0.778964528,-0.781289795,-0.783615063,-0.787490508,-0.790590864,-0.79446631,-0.798341755,-0.799891933,-0.803767379,-0.806092646,-0.807642824,-0.812293359,-0.815393715,-0.816943893,-0.81926916,-0.823919695,-0.827020051,-0.830120407,-0.832445675,-0.835546031,-0.837096209,-0.840196566,-0.8448471,-0.848722545,-0.85337308,-0.856473436,-0.859573793,-0.864224327,-0.867324683,-0.871975218,-0.875075574,-0.878175931,-0.882051376,-0.88670191,-0.889802267,-0.894452801,-0.898328247,-0.902203692,-0.906854227,-0.91227985,-0.916930385,-0.923906186,-0.932432166,-0.93785779,-0.944833592,-0.952584483,-0.960335373,-0.965760997,-0.970411531,-0.972736799,-0.975837155,-0.978937511,-0.981262779,-0.982037868,-0.983588046,-0.989788758,-0.994439293,-0.999089827,-1.002965273,-1.007615807,-1.012266342,-1.017691965,-1.0223425,-1.026217945,-1.031643569,-1.036294103,-1.042494816,-1.04792044,-1.054121152,-1.061872043,-1.067297667,-1.071948201,-1.076598736,-1.08124927,-1.086674894,-1.091325428,-1.09830123,-1.102951765,-1.109927566,-1.117678457,-1.12387917,-1.129304793,-1.134730417,-1.138605862,-1.141706219,-1.146356753,-1.150232199,-1.154107644,-1.159533268,-1.164183802,-1.169609426,-1.176585227,-1.18278594,-1.189761742,-1.198287722,-1.206038613,-1.213789503,-1.220765305,-1.228516196,-1.236267087,-1.243242888,-1.250993779,-1.257969581,-1.264170294,-1.271146095,-1.277346808,-1.286647877,-1.293623679,-1.299824392,-1.304474926,-1.310675639,-1.320751797,-1.328502688,-1.337803757,-1.344779558,-1.350980271,-1.357180984,-1.366482053,-1.374232943,-1.381983834,-1.388959636,-1.392835081,-1.399035794,-1.407561774,-1.416862843,-1.424613734,-1.433914803,-1.443990961,-1.451741852,-1.457942564,-1.467243633,-1.475769613,-1.481970326,-1.488171039,-1.494371751,-1.504447909,-1.5121988,-1.52072478,-1.526150404,-1.534676384,-1.542427274,-1.550953254,-1.560254323,-1.568005214,-1.575756105,-1.580406639,-1.587382441,-1.594358243,-1.600558956,-1.608309846,-1.616835826,-1.624586717,-1.636213053,-1.647064301,-1.654040102,-1.660240815,-1.669541884,-1.669541884,-1.681943309,-1.692019467,-1.701320536,-1.709071427,-1.71527214,-1.726123387,-1.736199545,-1.743950436,-1.751701327,-1.759452218,-1.767978197,-1.771853643,-1.777279266,-1.789680692,-1.795106315,-1.801307028,-1.809057919,-1.812933364,-1.820684255,-1.828435146,-1.836186037,-1.84161166,-1.846262195,-1.847812373,-1.851687818,-1.857113442,-1.857888531,-1.864864333,-1.869514867,-1.873390313,-1.876490669,-1.877265758,-1.880366114,-1.880366114,-1.880366114,-1.880366114,-1.880366114,-1.877265758,-1.874940491,-1.872615224,-1.871065045,-1.8671896,-1.863314155,-1.861763976,-1.859438709,-1.851687818,-1.846262195,-1.843161838,-1.835410948,-1.828435146,-1.823009522,-1.814483542,-1.80828283,-1.801307028,-1.795106315,-1.792005959,-1.786580335,-1.780379623,-1.773403821,-1.767203108,-1.762552574,-1.756351861,-1.749376059,-1.742400258,-1.736199545,-1.729223743,-1.722247942,-1.714497051,-1.710621605,-1.70674616,-1.702870714,-1.695119824,-1.688919111,-1.684268576,-1.677292775,-1.671092062,-1.66411626,-1.660240815,-1.653265013,-1.64783939,-1.641638677,-1.636213053,-1.633112697,-1.626136895,-1.620711272,-1.616060737,-1.609860025,-1.604434401,-1.599008777,-1.592032976,-1.585057174,-1.57963155,-1.574205927,-1.57110557,-1.567230125,-1.561029412,-1.554053611,-1.547077809,-1.541652185,-1.539326918,-1.536226562,-1.530800938,-1.526925493,-1.521499869,-1.515299156,-1.509098444,-1.505222998,-1.499797375,-1.496697019,-1.492046484,-1.48739595,-1.482745415,-1.47886997,-1.475769613,-1.474219435,-1.469568901,-1.467243633,-1.464918366,-1.460267832,-1.455617297,-1.450191674,-1.445541139,-1.440115515,-1.434689892,-1.430039357,-1.426163912,-1.423063556,-1.418413021,-1.414537576,-1.409887041,-1.408336863,-1.406011596,-1.401361061,-1.398260705,-1.392835081,-1.388959636,-1.385084191,-1.378883478,-1.375783122,-1.371132587,-1.365706964,-1.36028134,-1.357956073,-1.357956073,-1.355630805,-1.353305538,-1.349430093,-1.346329736,-1.341679202,-1.338578846,-1.336253578,-1.331603044,-1.328502688,-1.324627242,-1.320751797,-1.31765144,-1.31765144,-1.313775995,-1.312225817,-1.309125461,-1.306025104,-1.302924748,-1.299049302,-1.297499124,-1.295173857,-1.292073501,-1.290523323,-1.289748233,-1.287422966,-1.287422966,-1.28432261,-1.281997343,-1.281997343,-1.278121897,-1.273471363,-1.271921185,-1.269595917,-1.268045739,-1.268045739,-1.268820828,-1.265720472,-1.263395205,-1.261845026,-1.261845026,-1.260294848,-1.259519759,-1.25874467,-1.256419403,-1.253319047,-1.252543957,-1.25021869,-1.25021869,-1.247893423,-1.246343245,-1.246343245,-1.246343245,-1.242467799,-1.242467799,-1.242467799,-1.240142532,-1.240142532,-1.237817265,-1.237817265,-1.237817265,-1.237817265,-1.237817265,-1.235491998,-1.235491998,-1.235491998,-1.235491998,-1.23316673,-1.231616552,-1.231616552,-1.230841463,-1.229291285,-1.227741107,-1.227741107,-1.227741107,-1.227741107,-1.227741107,-1.227741107,-1.227741107,-1.227741107,-1.227741107,-1.227741107,-1.227741107,-1.227741107,-1.227741107,-1.227741107,-1.227741107,-1.227741107,-1.227741107,-1.227741107,-1.227741107,-1.227741107,-1.227741107,-1.227741107,-1.227741107,-1.227741107,-1.227741107,-1.227741107,-1.227741107,-1.227741107,-1.227741107,-1.227741107,-1.227741107,-1.227741107,-1.227741107,-1.227741107,-1.227741107,-1.227741107,-1.227741107,-1.227741107,-1.230066374,-1.230841463,-1.231616552,-1.23316673,-1.234716909,-1.236267087,-1.237817265,-1.237817265,-1.240142532,-1.24169271,-1.243242888,-1.245568156,-1.247118334,-1.250993779,-1.254094136,-1.255644314,-1.257194492,-1.257194492,-1.259519759,-1.261845026,-1.262620116,-1.263395205,-1.263395205,-1.264945383,-1.26727065,-1.268820828,-1.270371006,-1.272696274,-1.274246452,-1.27579663,-1.278896986,-1.281997343,-1.285097699,-1.287422966,-1.291298412,-1.295948946,-1.30137457,-1.306800193,-1.312225817,-1.316876351,-1.323077064,-1.328502688,-1.333928311,-1.341679202,-1.345554647,-1.352530449,-1.359506251,-1.365706964,-1.372682765,-1.379658567,-1.388184547,-1.397485616,-1.404461418,-1.412212309,-1.420738288,-1.42771409,-1.43624007,-1.443215872,-1.451741852,-1.458717653,-1.464918366,-1.474994524,-1.485070682,-1.497472108,-1.508323355,-1.516849335,-1.525375315,-1.535451473,-1.543202363,-1.552503432,-1.561804501,-1.57188066,-1.57963155,-1.588932619,-1.598233688,-1.606759668,-1.616835826,-1.626911984,-1.636988142,-1.646289211,-1.65636537,-1.667991706,-1.68116822,-1.692019467,-1.70674616,-1.719147585,-1.729223743,-1.736974634,-1.747050792,-1.758677128,-1.769528376,-1.775729088,-1.784255068,-1.792005959,-1.798981761,-1.805182473,-1.810608097,-1.817583899,-1.823009522,-1.827660057,-1.832310591,-1.836961126,-1.838511304,-1.838511304,-1.83308568,-1.827660057,-1.822234433,-1.819909166,-1.812933364,-1.805182473,-1.79975685,-1.793556137,-1.787355424,-1.781929801,-1.776504177,-1.771078554,-1.763327663,-1.750151149,-1.738524812,-1.731549011,-1.723023031,-1.717597407,-1.708296338,-1.699770358,-1.690469289,-1.685818755,-1.678067864,-1.669541884,-1.661015904,-1.65559028,-1.645514122,-1.635437964,-1.630012341,-1.62226145,-1.615285648,-1.609860025,-1.604434401,-1.595908421,-1.589707708,-1.582731907,-1.577306283,-1.57188066,-1.568005214,-1.561804501,-1.557153967,-1.552503432,-1.547077809,-1.543977453,-1.540102007,-1.534676384,-1.530800938,-1.526925493,-1.521499869,-1.517624424,-1.513748978,-1.508323355,-1.506773177,-1.50367282,-1.500572464,-1.499797375,-1.49514684,-1.492046484,-1.488946128,-1.48662086,-1.484295593,-1.482745415,-1.481195237,-1.479645059,-1.477319791,-1.475769613,-1.474994524,-1.474219435,-1.474219435,-1.472669257,-1.472669257,-1.472669257,-1.471894168,-1.471894168,-1.471894168,-1.471894168,-1.471894168,-1.471894168,-1.471894168,-1.471894168,-1.471894168,-1.474994524,-1.476544702,-1.477319791,-1.480420148,-1.483520504,-1.485070682,-1.48739595,-1.489721217,-1.492046484,-1.49514684,-1.500572464,-1.504447909,-1.509098444,-1.511423711,-1.513748978,-1.517624424,-1.52072478,-1.523825136,-1.527700582,-1.531576027,-1.534676384,-1.539326918,-1.542427274,-1.544752542,-1.547852898,-1.550178165,-1.554053611,-1.559479234,-1.566455036,-1.573430838,-1.57963155,-1.584282085,-1.588932619,-1.595133332,-1.600558956,-1.605984579,-1.610635114,-1.616835826,-1.623036539,-1.628462163,-1.633887786,-1.641638677,-1.64783939,-1.654815191,-1.661790993,-1.667991706,-1.674967508,-1.682718398,-1.690469289,-1.698995269,-1.70674616,-1.714497051,-1.720697763,-1.726898476,-1.733874278,-1.74007499,-1.745500614,-1.751701327,-1.758677128,-1.766428019,-1.771853643,-1.777279266,-1.781929801,-1.786580335,-1.792005959,-1.795106315,-1.798206672,-1.802082117,-1.803632295,-1.805182473,-1.805182473,-1.805182473,-1.805182473,-1.803632295,-1.802857206,-1.79975685,-1.796656493,-1.795106315,-1.79123087,-1.786580335,-1.778829445,-1.77417891,-1.770303465,-1.764877841,-1.761002396,-1.754801683,-1.749376059,-1.745500614,-1.74085008,-1.735424456,-1.731549011,-1.726123387,-1.719922674,-1.716047229,-1.709846516,-1.703645804,-1.69822018,-1.691244378,-1.685043666,-1.678067864,-1.671867151,-1.666441528,-1.66411626,-1.659465726,-1.65559028,-1.652489924,-1.64783939,-1.643963944,-1.63931341,-1.635437964,-1.629237252,-1.626136895,-1.62226145,-1.619161094,-1.616060737,-1.61373547,-1.610635114,-1.607534757,-1.604434401,-1.603659312,-1.600558956,-1.598233688,-1.597458599,-1.595908421,-1.595908421,-1.594358243,-1.592808065,-1.592808065,-1.592032976,-1.592808065,-1.592808065,-1.592808065,-1.592808065,-1.592032976,-1.592032976,-1.592032976,-1.591257887,-1.591257887,-1.591257887,-1.591257887,-1.591257887,-1.591257887,-1.591257887,-1.591257887,-1.591257887,-1.591257887,-1.591257887,-1.593583154,-1.594358243,-1.598233688,-1.601334045,-1.603659312,-1.605984579,-1.609084935,-1.612960381,-1.616835826,-1.619161094,-1.62226145,-1.625361806,-1.628462163,-1.632337608,-1.636988142,-1.640863588,-1.644739033,-1.64783939,-1.652489924,-1.660240815,-1.665666439,-1.671092062,-1.676517686,-1.679618042,-1.683493487,-1.688919111,-1.691244378,-1.695119824,-1.69822018,-1.702095625,-1.705971071,-1.710621605,-1.714497051,-1.719147585,-1.724573209,-1.729223743,-1.734649367,-1.739299901,-1.743175347,-1.747825881,-1.750926238,-1.755576772,-1.759452218,-1.763327663,-1.76565293,-1.767978197,-1.771853643,-1.774953999,-1.775729088,-1.776504177,-1.779604534,-1.781154712,-1.781154712,-1.781154712,-1.778829445,-1.777279266,-1.774953999,-1.773403821,-1.771078554,-1.768753286,-1.767203108,-1.764877841,-1.762552574,-1.759452218,-1.756351861,-1.754026594,-1.749376059,-1.745500614,-1.742400258,-1.74007499,-1.736974634,-1.733874278,-1.729998832,-1.725348298,-1.722247942,-1.716822318,-1.713721962,-1.708296338,-1.705971071,-1.702095625,-1.69822018,-1.693569645,-1.692019467,-1.688919111,-1.686593844,-1.684268576,-1.682718398,-1.680393131,-1.678842953,-1.676517686,-1.673417329,-1.671867151,-1.667991706,-1.665666439,-1.663341171,-1.660240815,-1.657140459,-1.654815191,-1.654040102,-1.654040102,-1.654040102,-1.652489924,-1.650939746,-1.650939746,-1.648614479,-1.648614479,-1.649389568,-1.649389568,-1.649389568,-1.649389568,-1.649389568,-1.649389568,-1.649389568,-1.649389568,-1.649389568,-1.649389568,-1.649389568,-1.649389568,-1.649389568,-1.650939746,-1.654040102,-1.65636537,-1.658690637,-1.663341171,-1.661790993,-1.664891349,-1.666441528,-1.667216617,-1.669541884,-1.671867151,-1.67264224,-1.676517686,-1.680393131,-1.68116822,-1.682718398,-1.686593844,-1.690469289,-1.693569645,-1.695894913,-1.699770358,-1.702870714,-1.705195982,-1.708296338,-1.710621605,-1.712946873,-1.716047229,-1.719147585,-1.721472852,-1.724573209,-1.727673565,-1.729998832,-1.733099189,-1.734649367,-1.736199545,-1.738524812,-1.74085008,-1.743175347,-1.746275703,-1.74860097,-1.750926238,-1.751701327,-1.753251505,-1.754026594,-1.754026594,-1.755576772,-1.758677128,-1.759452218,-1.759452218,-1.75712695,-1.754026594,-1.754026594,-1.754026594,-1.751701327,-1.750151149,-1.750926238,-1.749376059,-1.749376059,-1.747825881,-1.745500614,-1.743175347,-1.74007499,-1.734649367,-1.728448654,-1.723023031,-1.716822318,-1.712946873,-1.709071427,-1.705195982,-1.701320536,-1.697445091,-1.695894913,-1.692794556,-1.6896942,-1.686593844,-1.683493487,-1.680393131,-1.678842953,-1.677292775,-1.675742597,-1.675742597,-1.674967508,-1.675742597,-1.676517686,-1.678067864,-1.679618042,-1.681943309,-1.685043666,-1.687368933,-1.6896942,-1.691244378,-1.692794556,-1.695894913,-1.698995269,-1.702095625,-1.705971071,-1.709846516,-1.713721962,-1.718372496,-1.720697763,-1.725348298,-1.728448654,-1.733099189,-1.736199545,-1.739299901,-1.741625169,-1.743175347,-1.744725525,-1.744725525,-1.744725525,-1.744725525,-1.742400258,-1.739299901,-1.737749723,-1.736199545,-1.733874278,-1.730773921,-1.728448654,-1.722247942,-1.716047229,-1.709071427,-1.705195982,-1.701320536,-1.698995269,-1.696670002,-1.695119824,-1.695119824,-1.695894913,-1.699770358,-1.703645804,-1.705971071,-1.709071427,-1.712171783,-1.718372496,-1.72379812,-1.728448654,-1.733099189,-1.735424456,-1.735424456,-1.735424456,-1.735424456,-1.735424456,-1.729998832,-1.724573209,-1.719922674,-1.716822318,-1.712946873,-1.708296338,-1.708296338]) time_updated, disp_updated = func_update_disp(time_series,disp_series, 500) velo_numerical = diff_2point(time_updated, disp_updated) acce_numerical = diff_2point(time_updated, velo_numerical) print('SNR_dB_disp=', func_SNR(disp_updated)) print('SNR_dB_veolocity=', func_SNR(velo_numerical)) print('SNR_dB_acceleration=', func_SNR(acce_numerical)) plt.plot(time_updated, acce_numerical) plt.show()
385.907895
18,645
0.732449
6,165
29,329
3.468289
0.232766
0.017772
0.019549
0.034609
0.129501
0.079085
0.079085
0.054672
0.054672
0.041951
0
0.682127
0.010502
29,329
75
18,646
391.053333
0.05465
0.008081
0
0.096774
0
0
0.002544
0
0
0
0
0
0
1
0.064516
false
0
0.048387
0
0.225806
0.080645
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
1
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
5db28dfa2a435fc146b888c9027917e91f316600
23,849
py
Python
badges.py
kaydee0502/kaggle-profile-card
cb9099b2ebe4963eb1d3dc819a7d61a50650243d
[ "MIT" ]
5
2021-04-15T07:47:54.000Z
2021-04-17T13:20:39.000Z
badges.py
kaydee0502/kaggle-profile-card
cb9099b2ebe4963eb1d3dc819a7d61a50650243d
[ "MIT" ]
null
null
null
badges.py
kaydee0502/kaggle-profile-card
cb9099b2ebe4963eb1d3dc819a7d61a50650243d
[ "MIT" ]
3
2021-04-15T14:41:29.000Z
2021-04-17T01:18:31.000Z
class Badge: def __init__(self,scale=1): self.scale=scale def gen_badge(self): return { "novice" : f""" <g xmlns="http://www.w3.org/2000/svg" transform="translate({str(345*self.scale)},15),scale(0.5)"> <path id="Selection_novice" fill="#52cd95" stroke="none" stroke-width="1" d="M 80.00,139.00 C 80.00,139.00 104.00,139.00 104.00,139.00 106.03,139.01 108.84,138.87 110.59,140.02 113.17,141.73 113.62,145.81 116.64,150.00 121.38,156.57 128.97,160.41 137.00,160.91 154.96,162.01 168.57,144.06 163.70,127.00 161.26,118.45 154.63,111.27 146.00,108.79 138.73,106.70 134.72,110.37 130.32,103.94 130.32,103.94 120.58,87.00 120.58,87.00 119.54,85.19 116.23,79.69 115.84,78.00 114.97,74.24 118.42,71.18 120.00,68.00 122.07,63.84 123.25,57.61 122.56,53.00 118.59,26.46 86.18,22.85 74.11,41.00 69.58,47.81 68.53,58.36 71.47,66.00 72.72,69.26 76.50,74.35 76.45,77.00 76.41,79.35 74.02,82.96 72.80,85.00 72.80,85.00 64.72,99.00 64.72,99.00 63.32,101.46 61.25,105.54 58.79,106.98 55.03,109.17 50.54,106.52 43.00,109.90 31.03,115.28 25.65,128.46 28.53,141.00 34.77,168.20 75.56,167.31 80.00,139.00 Z M 92.00,39.39 C 98.98,38.45 104.86,39.26 109.61,45.04 117.52,54.69 112.35,70.34 100.00,72.92 77.88,77.54 69.87,46.04 92.00,39.39 Z M 107.00,81.00 C 107.00,81.00 124.00,111.00 124.00,111.00 124.00,111.00 115.22,122.00 115.22,122.00 115.22,122.00 111.30,129.01 111.30,129.01 111.30,129.01 104.00,130.00 104.00,130.00 104.00,130.00 80.00,130.00 80.00,130.00 80.00,130.00 75.07,119.01 75.07,119.01 75.07,119.01 69.81,111.83 69.81,111.83 69.81,111.83 73.15,103.00 73.15,103.00 73.15,103.00 86.00,81.00 86.00,81.00 99.97,83.63 93.67,82.80 107.00,81.00 Z M 50.00,117.39 C 56.98,116.45 62.86,117.26 67.61,123.04 75.52,132.69 70.35,148.34 58.00,150.92 35.88,155.54 27.87,124.04 50.00,117.39 Z M 134.00,117.39 C 140.98,116.45 146.86,117.26 151.61,123.04 159.52,132.69 154.35,148.34 142.00,150.92 119.88,155.54 111.87,124.04 134.00,117.39 Z" /></g> """, "contributor" : f""" <g xmlns="http://www.w3.org/2000/svg" transform="translate({str(345*self.scale)},15),scale(0.5)"> <path id="Selection" fill="#24bfff" stroke="none" stroke-width="1" d="M 87.00,8.53 C 75.93,11.83 68.32,20.18 68.01,32.00 67.77,41.71 69.68,43.85 69.53,45.72 69.40,47.30 68.74,48.00 67.76,49.17 67.76,49.17 55.00,62.00 55.00,62.00 52.97,64.02 49.73,67.65 47.00,68.23 47.00,68.23 37.00,68.23 37.00,68.23 27.79,67.91 20.48,70.23 14.79,78.01 2.28,95.11 14.69,122.45 37.00,120.68 40.29,120.41 47.94,117.98 50.00,118.55 52.47,119.23 55.20,122.22 57.00,124.00 57.00,124.00 69.72,137.00 69.72,137.00 73.53,142.29 68.78,143.57 68.09,152.00 67.03,164.95 71.42,175.38 84.00,180.65 101.14,187.84 122.34,174.21 120.67,155.00 120.04,147.72 116.49,142.26 116.54,140.28 116.59,137.87 119.42,135.59 121.01,133.99 121.01,133.99 133.00,122.00 133.00,122.00 134.46,120.55 137.64,117.07 139.58,116.58 139.58,116.58 155.00,120.67 155.00,120.67 169.76,121.95 182.82,108.42 182.82,94.00 182.82,80.93 172.21,68.68 159.00,68.11 159.00,68.11 151.00,68.11 151.00,68.11 146.29,68.77 144.32,70.81 141.00,69.19 138.48,67.96 126.76,55.82 124.01,53.00 122.09,51.04 119.58,48.83 119.11,46.00 118.71,43.63 121.10,36.82 120.67,32.00 119.07,13.77 103.77,5.79 87.00,8.53 Z M 90.00,17.39 C 96.98,16.45 102.86,17.26 107.61,23.04 115.52,32.69 110.35,48.34 98.00,50.92 75.88,55.54 67.87,24.04 90.00,17.39 Z M 111.00,54.00 C 116.67,58.06 122.02,64.01 127.00,69.00 128.83,70.84 132.98,74.63 133.71,77.00 134.88,80.81 130.72,83.29 130.09,91.00 129.15,102.62 133.69,104.53 131.88,109.00 130.67,111.98 118.09,123.96 115.00,127.00 113.16,128.80 110.57,131.62 108.00,132.19 104.19,133.05 102.64,129.54 92.00,130.04 84.92,130.37 82.79,133.41 79.00,131.88 76.09,130.70 65.82,119.88 63.01,117.00 61.21,115.16 58.44,112.73 58.28,110.00 58.17,108.15 60.96,102.85 61.66,100.00 64.03,90.36 61.07,83.47 55.00,76.00 58.91,70.53 64.21,65.75 69.00,61.00 70.69,59.32 73.71,56.03 76.00,55.44 79.53,54.53 81.68,58.17 90.00,60.10 97.48,61.83 105.03,58.26 111.00,54.00 Z M 32.00,77.39 C 38.98,76.45 44.86,77.26 49.61,83.04 57.52,92.69 52.35,108.34 40.00,110.92 17.88,115.54 9.87,84.04 32.00,77.39 Z M 152.00,77.39 C 158.98,76.45 164.86,77.26 169.61,83.04 177.52,92.69 172.35,108.34 160.00,110.92 137.88,115.54 129.87,84.04 152.00,77.39 Z M 90.00,139.39 C 96.98,138.45 102.86,139.26 107.61,145.04 115.52,154.69 110.35,170.34 98.00,172.92 75.88,177.54 67.87,146.04 90.00,139.39 Z" /></g> """, "expert" : f""" <g xmlns="http://www.w3.org/2000/svg" transform="translate({str(345*self.scale)},15),scale(0.5)"> <path id="Selectionexpert" fill="#96518e" stroke="none" stroke-width="1" d="M 32.00,106.00 C 32.00,106.00 42.00,137.00 42.00,137.00 29.26,141.34 24.97,158.31 29.47,170.00 34.72,183.68 49.39,190.70 63.00,184.65 66.52,183.09 69.98,180.88 72.47,177.91 75.75,174.00 77.22,169.95 78.00,165.00 78.00,165.00 104.00,165.00 104.00,165.00 106.03,165.01 108.84,164.87 110.59,166.02 113.17,167.73 113.56,171.70 116.64,176.00 121.31,182.53 128.03,186.21 136.00,186.82 150.86,187.94 163.83,173.55 162.68,159.00 162.33,154.61 161.07,149.78 158.79,146.00 157.13,143.26 153.45,139.77 152.97,137.00 152.64,135.08 154.11,130.98 154.72,129.00 154.72,129.00 160.39,112.02 160.39,112.02 163.34,104.99 169.24,106.33 174.99,102.40 186.06,94.83 189.56,81.17 184.27,69.00 179.15,57.21 169.19,52.95 157.00,54.10 151.00,54.67 148.93,57.67 145.00,56.44 145.00,56.44 119.00,39.00 119.00,39.00 124.37,21.45 114.27,4.00 95.00,4.00 89.76,4.00 86.59,4.22 82.00,7.13 74.04,12.18 70.10,19.72 70.25,29.00 70.25,29.00 70.25,40.49 70.25,40.49 69.73,42.50 65.78,45.02 64.00,46.29 64.00,46.29 49.04,57.03 49.04,57.03 43.07,60.80 43.33,55.82 35.00,54.33 25.59,52.64 16.70,54.76 10.21,62.04 -5.73,79.93 10.07,111.22 32.00,106.00 Z M 91.00,13.39 C 97.94,12.45 102.92,13.31 107.61,19.04 115.15,28.26 110.84,43.81 99.00,46.79 78.82,51.87 69.90,20.19 91.00,13.39 Z M 153.00,105.00 C 153.00,105.00 144.00,134.00 144.00,134.00 134.92,134.00 129.36,133.73 122.00,140.19 119.56,142.33 116.89,145.20 115.22,148.00 114.06,149.94 112.90,153.81 111.30,155.01 109.63,156.26 106.04,156.00 104.00,156.00 104.00,156.00 78.00,156.00 78.00,156.00 75.85,146.87 70.66,139.91 62.00,135.91 56.09,133.19 53.21,134.82 50.84,132.40 49.40,130.93 48.03,126.10 47.33,124.00 47.33,124.00 41.00,103.00 41.00,103.00 49.26,97.71 53.93,90.99 54.40,81.00 54.90,70.52 48.77,69.35 56.05,63.58 59.29,61.01 72.83,50.36 76.00,50.00 79.65,49.59 81.88,53.13 88.00,55.24 97.37,58.47 108.06,54.85 114.00,47.00 120.20,49.41 126.48,55.04 132.00,59.00 133.96,60.40 137.84,62.84 138.59,65.17 139.54,68.12 136.60,70.81 136.09,77.00 135.03,90.12 141.37,99.29 153.00,105.00 Z M 25.00,63.39 C 31.94,62.45 36.92,63.31 41.61,69.04 49.15,78.26 44.84,93.81 33.00,96.79 12.82,101.87 3.90,70.19 25.00,63.39 Z M 157.00,63.39 C 163.94,62.45 168.92,63.31 173.61,69.04 181.15,78.26 176.84,93.81 165.00,96.79 144.82,101.87 135.90,70.19 157.00,63.39 Z M 49.00,143.39 C 55.94,142.45 60.92,143.31 65.61,149.04 73.15,158.26 68.84,173.81 57.00,176.79 36.82,181.87 27.90,150.19 49.00,143.39 Z M 133.00,143.39 C 139.94,142.45 144.92,143.31 149.61,149.04 157.15,158.26 152.84,173.81 141.00,176.79 120.82,181.87 111.90,150.19 133.00,143.39 Z" /></g> """, "master" : f""" <g xmlns="http://www.w3.org/2000/svg" transform="translate({str(345*self.scale)},15),scale(0.5)"> <path id="Selectionmaster" fill="#fa692b" stroke="none" stroke-width="1" d="M 73.00,35.00 C 65.80,37.10 55.32,45.06 52.00,45.37 47.86,45.76 45.80,41.49 38.00,41.04 35.40,40.89 30.45,40.92 28.00,41.55 15.51,44.77 9.69,58.06 12.53,70.00 13.68,74.85 17.04,79.43 21.01,82.37 23.11,83.92 26.63,85.27 27.98,87.39 29.71,90.10 29.00,104.95 29.00,109.00 9.36,112.73 6.04,139.89 22.04,150.44 28.00,154.38 36.29,155.04 43.00,152.75 45.50,151.90 48.88,149.66 51.00,149.47 54.22,149.20 65.17,155.73 67.90,157.90 73.11,162.05 69.73,164.99 71.93,173.00 74.71,183.17 84.36,190.40 95.00,189.90 104.40,189.45 113.55,183.21 116.21,174.00 117.83,168.40 116.09,163.47 118.02,160.38 119.19,158.51 122.13,156.93 124.00,155.80 126.69,154.18 135.91,148.22 138.58,148.46 141.65,148.72 145.14,153.57 154.00,153.96 176.55,154.95 184.63,131.07 174.36,117.01 166.34,106.02 159.22,112.76 159.00,101.00 158.95,98.11 158.59,90.53 160.02,88.30 161.95,85.29 166.71,85.49 171.82,80.67 179.74,73.20 180.83,60.03 175.03,51.00 169.23,41.97 158.07,38.66 148.00,41.79 141.98,43.67 140.28,47.30 136.72,46.24 136.72,46.24 116.00,35.00 116.00,35.00 116.67,32.25 116.92,30.85 116.99,28.00 117.09,23.58 116.99,20.10 115.09,16.00 102.92,-10.25 61.22,6.68 73.00,35.00 Z M 91.00,12.39 C 96.25,11.69 100.78,12.03 104.61,16.21 111.48,23.73 108.30,37.25 98.00,39.61 79.47,43.86 72.28,18.43 91.00,12.39 Z M 134.00,55.00 C 132.28,63.55 131.19,69.49 137.27,77.00 146.09,87.89 149.83,82.30 150.00,92.00 150.00,92.00 150.00,109.00 150.00,109.00 137.33,112.70 131.76,122.33 132.95,135.00 133.11,136.76 133.28,138.05 132.23,139.62 130.80,141.79 116.64,150.20 114.00,150.62 110.81,151.12 108.54,148.50 106.00,146.99 103.05,145.23 99.41,144.08 96.00,143.70 85.88,142.59 80.25,149.82 77.00,150.72 73.75,151.62 59.64,143.52 57.80,140.62 56.30,138.31 57.56,135.52 57.80,133.00 58.17,129.46 57.49,125.25 56.03,122.00 54.19,117.88 49.83,113.34 46.00,111.00 44.01,109.79 40.15,108.77 38.99,107.28 37.50,105.34 37.99,97.67 38.00,95.00 38.00,92.90 37.76,89.29 39.02,87.56 40.93,84.93 45.89,85.41 51.81,78.96 59.04,71.09 58.76,63.55 56.00,54.00 56.00,54.00 77.00,43.20 77.00,43.20 77.00,43.20 93.00,48.96 93.00,48.96 93.00,48.96 103.00,47.17 103.00,47.17 103.00,47.17 111.00,43.22 111.00,43.22 111.00,43.22 119.00,46.42 119.00,46.42 119.00,46.42 134.00,55.00 134.00,55.00 Z M 34.00,49.47 C 38.76,49.73 43.33,51.06 46.30,55.10 52.73,63.86 46.96,77.12 36.00,77.88 18.14,79.13 14.45,52.14 34.00,49.47 Z M 155.00,49.47 C 174.44,50.56 174.33,76.06 157.00,77.80 139.03,79.61 134.28,52.30 155.00,49.47 Z M 90.00,74.52 C 85.06,75.85 80.94,77.35 77.33,81.18 62.44,96.97 75.22,125.02 100.00,119.71 114.59,116.58 121.63,98.94 114.59,86.00 109.77,77.15 99.69,73.01 90.00,74.52 Z M 92.00,83.33 C 111.63,81.64 114.16,108.86 96.00,111.49 85.30,113.05 76.98,101.90 81.01,92.00 83.12,86.80 86.81,84.62 92.00,83.33 Z M 31.00,117.39 C 36.10,116.70 40.54,116.65 44.47,120.53 52.34,128.27 49.32,142.36 38.00,144.66 19.82,148.35 13.90,122.92 31.00,117.39 Z M 152.00,117.39 C 155.59,116.91 158.64,116.75 162.00,118.45 175.61,125.35 170.35,146.30 154.00,144.89 139.36,143.63 135.46,122.73 152.00,117.39 Z M 93.00,152.37 C 112.45,151.78 113.17,178.55 96.00,180.77 84.08,182.32 75.97,169.18 82.09,159.04 84.59,154.88 88.50,153.37 93.00,152.37 Z" /></g> """, "grandmaster" : f""" <g xmlns="http://www.w3.org/2000/svg" transform="translate({str(345*self.scale)},15),scale(0.5)"> <path id="Selection" fill="#dfac19" stroke="none" stroke-width="1" d="M 84.00,171.00 C 87.87,171.00 102.01,170.32 104.59,172.02 106.86,173.52 107.38,176.73 109.80,179.91 113.54,184.81 119.91,187.69 126.00,187.96 141.24,188.63 150.16,177.77 148.91,163.00 148.15,154.11 142.65,154.44 148.04,147.00 149.96,144.35 155.07,137.45 158.04,136.54 161.22,135.55 164.40,138.15 170.00,137.52 183.48,136.00 190.31,127.24 189.99,114.00 189.78,105.76 184.67,98.43 177.00,95.23 172.37,93.29 169.11,94.78 166.73,92.40 165.18,90.85 162.66,80.41 162.61,78.02 162.49,72.85 166.90,72.71 171.66,66.98 177.06,60.49 178.17,52.82 175.19,45.00 168.77,28.17 144.29,25.92 137.00,41.00 137.00,41.00 117.00,32.00 117.00,32.00 121.22,17.13 111.64,4.01 96.00,4.01 92.27,4.01 89.43,4.29 86.00,5.92 80.70,8.43 76.56,13.37 74.94,19.00 73.19,25.05 75.44,28.05 69.94,31.65 68.10,32.85 59.14,37.46 57.28,37.48 54.26,37.51 52.78,34.16 46.00,32.05 35.40,28.76 23.41,33.45 19.13,44.00 16.42,50.67 16.42,57.67 20.08,64.00 22.20,67.67 25.38,69.78 26.10,73.00 26.61,75.24 23.83,87.46 22.86,89.94 21.06,94.56 15.82,94.40 12.01,96.81 4.28,101.73 1.80,108.18 2.01,117.00 2.32,129.46 12.68,138.31 25.00,137.35 26.60,137.37 28.38,136.89 29.99,137.35 33.74,137.96 40.45,146.65 42.37,150.00 44.96,154.54 42.54,156.55 41.53,161.00 40.48,165.63 40.88,171.69 42.92,176.00 51.61,194.36 80.14,191.32 84.00,171.00 Z M 92.00,13.43 C 96.31,12.78 100.31,12.57 103.95,15.43 112.10,21.83 110.08,35.12 99.00,38.19 84.78,42.13 75.25,20.09 92.00,13.43 Z M 91.00,77.00 C 82.39,79.45 82.92,82.36 75.00,76.19 72.20,74.02 62.13,66.37 60.80,63.91 59.32,61.27 60.51,58.77 60.80,56.00 61.17,52.90 60.32,48.28 62.57,45.96 64.85,43.62 74.80,38.85 78.00,39.70 80.34,40.32 82.91,42.90 85.00,44.31 89.90,47.61 90.88,46.33 91.00,53.00 91.00,53.00 91.00,77.00 91.00,77.00 Z M 37.00,40.34 C 55.40,38.67 56.91,62.36 42.00,65.60 26.45,68.98 18.26,45.38 37.00,40.34 Z M 100.00,47.00 C 109.22,44.81 109.69,40.82 114.00,40.70 116.44,40.63 121.66,43.58 124.00,44.75 133.80,49.65 132.43,48.64 133.11,57.00 133.49,59.10 133.96,60.82 133.11,62.83 131.62,65.43 124.55,70.74 122.00,72.80 119.41,74.90 114.17,79.88 111.00,80.22 109.16,80.41 107.60,79.60 106.00,78.84 99.63,75.81 100.01,74.69 100.00,68.00 100.00,68.00 100.00,47.00 100.00,47.00 Z M 152.00,40.40 C 171.05,38.23 172.98,62.79 157.00,65.66 146.90,67.47 139.07,57.48 142.74,48.00 144.40,43.71 147.87,41.72 152.00,40.40 Z M 31.00,95.00 C 31.00,95.00 35.93,76.60 35.93,76.60 35.93,76.60 44.00,74.24 44.00,74.24 44.00,74.24 53.00,71.24 53.00,71.24 53.00,71.24 59.00,74.22 59.00,74.22 59.00,74.22 74.76,88.04 74.76,88.04 74.76,88.04 74.76,93.00 74.76,93.00 74.76,93.00 73.01,99.27 73.01,99.27 73.01,99.27 56.00,104.37 56.00,104.37 56.00,104.37 45.18,106.23 45.18,106.23 45.18,106.23 39.68,101.17 39.68,101.17 39.68,101.17 31.00,95.00 31.00,95.00 Z M 153.00,75.00 C 153.00,75.00 156.31,95.83 156.31,95.83 156.31,95.83 148.00,108.00 148.00,108.00 148.00,108.00 127.00,102.37 127.00,102.37 124.79,101.82 120.42,101.07 118.99,99.28 118.11,98.18 117.95,96.33 117.70,94.98 117.44,93.60 116.88,91.36 117.11,90.01 117.79,86.07 126.77,79.78 130.00,77.08 132.09,75.34 136.46,71.30 139.00,70.82 141.09,70.41 149.51,74.20 153.00,75.00 Z M 93.00,85.39 C 97.98,84.76 102.01,85.28 105.61,89.21 112.19,96.40 108.62,108.45 99.00,110.61 83.18,114.16 75.56,91.03 93.00,85.39 Z M 24.00,102.74 C 41.68,104.46 39.83,126.66 25.00,128.44 13.97,129.77 7.10,117.05 13.01,108.10 15.64,104.12 19.52,103.04 24.00,102.74 Z M 169.00,102.73 C 186.05,104.68 184.42,126.71 170.00,128.44 157.84,129.91 150.23,114.97 159.22,106.34 162.24,103.44 165.01,102.91 169.00,102.73 Z M 73.00,109.36 C 76.12,109.50 76.95,109.59 79.36,111.86 84.84,117.03 80.06,122.37 77.25,128.00 75.77,130.95 70.50,142.60 68.37,143.97 68.37,143.97 54.01,145.94 54.01,145.94 50.31,145.87 48.32,142.62 46.20,140.00 44.63,138.05 41.43,134.41 41.01,132.00 40.78,130.72 45.08,118.72 46.01,117.43 47.65,115.13 51.39,114.53 54.00,113.87 54.00,113.87 73.00,109.36 73.00,109.36 Z M 151.00,128.00 C 148.60,131.79 139.91,144.15 135.96,145.11 132.81,146.09 131.26,143.70 123.00,145.11 119.28,138.46 110.26,121.73 109.00,115.00 109.00,115.00 116.09,109.69 116.09,109.69 116.09,109.69 138.00,114.27 138.00,114.27 138.00,114.27 145.28,116.82 145.28,116.82 145.28,116.82 151.00,128.00 151.00,128.00 Z M 106.00,162.00 C 106.00,162.00 84.00,162.00 84.00,162.00 84.00,162.00 77.69,148.00 77.69,148.00 77.69,148.00 81.75,138.00 81.75,138.00 81.75,138.00 91.00,119.00 91.00,119.00 91.00,119.00 100.37,120.99 100.37,120.99 100.37,120.99 111.24,141.00 111.24,141.00 111.24,141.00 113.19,148.00 113.19,148.00 113.19,148.00 106.00,162.00 106.00,162.00 Z M 62.00,153.39 C 80.10,153.87 79.74,177.87 64.00,179.21 53.10,180.14 46.04,168.25 52.01,159.09 54.49,155.28 57.76,154.14 62.00,153.39 Z M 126.00,153.42 C 144.11,153.47 144.43,177.13 129.00,179.15 112.81,181.27 107.52,157.37 126.00,153.42 Z" /></g> """, "staff" : f""" <g xmlns="http://www.w3.org/2000/svg" transform="translate({str(345*self.scale)},15),scale(0.5)"> <path id="Selection" fill="#008abc" stroke="none" stroke-width="1" d="M 83.00,139.00 C 83.00,139.00 99.21,159.00 99.21,159.00 101.73,162.20 105.60,167.47 109.09,169.43 112.07,171.11 114.72,170.98 118.00,171.00 126.33,171.04 145.78,173.40 142.43,159.00 141.45,154.78 137.52,150.41 134.88,147.00 134.88,147.00 118.00,126.00 118.00,126.00 115.96,123.46 108.88,115.91 109.01,113.00 109.13,110.08 114.90,105.10 117.00,103.00 117.00,103.00 132.91,87.18 132.91,87.18 136.17,84.09 139.59,81.66 140.60,77.00 142.61,67.74 135.61,65.04 128.00,65.00 123.84,64.98 111.24,64.58 108.01,65.70 104.11,67.05 100.85,71.10 97.99,74.00 97.99,74.00 83.00,89.00 83.00,89.00 83.00,89.00 83.00,32.00 83.00,32.00 82.95,21.71 79.36,18.13 69.00,18.00 62.84,17.93 52.57,17.07 49.74,24.04 48.87,26.19 49.00,29.66 49.00,32.00 49.00,32.00 49.00,157.00 49.00,157.00 49.01,160.79 48.67,164.71 51.43,167.67 55.86,172.56 76.07,172.47 80.49,167.67 84.39,163.31 83.00,145.29 83.00,139.00 Z M 74.00,27.00 C 74.00,27.00 74.00,110.00 74.00,110.00 80.48,105.36 93.50,91.29 99.75,84.72 102.78,81.53 107.17,76.09 111.00,74.09 115.12,72.11 127.53,72.73 132.00,74.09 129.17,79.98 125.70,81.91 121.00,86.17 121.00,86.17 106.00,101.00 106.00,101.00 103.77,103.23 97.17,109.00 96.96,112.00 96.74,115.10 104.26,123.33 106.40,126.00 106.40,126.00 123.26,147.00 123.26,147.00 127.15,151.78 131.56,156.28 134.00,162.00 128.36,162.00 115.54,163.40 111.46,159.69 111.46,159.69 91.88,135.00 91.88,135.00 90.25,132.89 85.33,125.99 82.83,125.62 79.73,125.17 75.55,130.41 74.60,133.00 73.51,135.96 74.00,157.23 74.00,162.00 74.00,162.00 66.00,162.00 66.00,162.00 63.70,162.00 59.59,162.38 58.02,160.40 56.77,158.81 57.00,154.99 57.00,153.00 57.00,153.00 57.00,129.00 57.00,129.00 57.00,129.00 57.00,36.00 57.00,36.00 57.00,34.01 56.77,30.19 58.02,28.60 59.98,26.12 70.71,27.00 74.00,27.00 Z" /></g> """ }
46.854617
103
0.501489
5,246
23,849
2.278689
0.047274
0.006692
0.005019
0.005521
0.206207
0.165719
0.152669
0.126736
0.071273
0.054459
0
0.692288
0.328483
23,849
509
104
46.854617
0.054137
0
0
0.029474
0
0.84
0.987295
0.015724
0
0
0
0
0
1
0.004211
false
0
0
0.002105
0.008421
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
5dd6fbd7971536b957ea7eb4ccf95ebb08f43e36
289
py
Python
flaskr/graphqlr/mixins.py
jeovazero/zoas-store-api-graphql
c2ef77a2b7abdfae7b492f901c879fd2d4f9e889
[ "MIT" ]
3
2019-10-23T07:15:01.000Z
2020-05-18T16:11:31.000Z
flaskr/graphqlr/mixins.py
jeovazero/zoas-store-backend
c2ef77a2b7abdfae7b492f901c879fd2d4f9e889
[ "MIT" ]
11
2019-04-23T23:50:53.000Z
2019-05-04T15:23:16.000Z
flaskr/graphqlr/mixins.py
jeovazero/zoas-store-backend
c2ef77a2b7abdfae7b492f901c879fd2d4f9e889
[ "MIT" ]
1
2019-10-23T07:15:07.000Z
2019-10-23T07:15:07.000Z
from flask import session import uuid class SessionMixin: @classmethod def sid(cls): return str(session["u"]) @classmethod def create_session(cls): session["u"] = uuid.uuid4() @classmethod def delete_session(cls): session.pop("u", None)
17
35
0.622837
34
289
5.235294
0.558824
0.235955
0.191011
0
0
0
0
0
0
0
0
0.004695
0.262976
289
16
36
18.0625
0.830986
0
0
0.25
0
0
0.010381
0
0
0
0
0
0
1
0.25
false
0
0.166667
0.083333
0.583333
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
5de1a5545ad6470c2fa2a1766b8d3984361267f1
5,698
py
Python
tests/test_scripts.py
center-for-threat-informed-defense/attack-control-framework-mappings
2a2fb4af3147a012dd03377931101c89d4eaef83
[ "Apache-2.0" ]
269
2020-12-15T17:28:55.000Z
2022-03-31T19:05:55.000Z
tests/test_scripts.py
center-for-threat-informed-defense/attack-control-framework-mappings
2a2fb4af3147a012dd03377931101c89d4eaef83
[ "Apache-2.0" ]
31
2020-12-17T21:44:32.000Z
2022-03-08T13:57:34.000Z
tests/test_scripts.py
center-for-threat-informed-defense/attack-control-framework-mappings
2a2fb4af3147a012dd03377931101c89d4eaef83
[ "Apache-2.0" ]
51
2020-12-16T16:38:02.000Z
2022-03-15T04:20:34.000Z
import os import pathlib import subprocess import sys import pytest @pytest.fixture() def attack_domain(): return "enterprise-attack" @pytest.fixture() def dir_location(): cwd = os.getcwd() if "tests" in cwd: return os.path.dirname(cwd) else: return cwd @pytest.mark.parametrize("attack_version", ["v8.2", "v9.0"]) @pytest.mark.parametrize("rev", ["nist800-53-r4", "nist800-53-r5"]) def test_list_mappings(dir_location, attack_domain, attack_version, rev): """Tests list_mappings.py with both framework entries""" rx_controls = pathlib.Path(dir_location, "frameworks", f"ATT&CK-{attack_version}", rev, "stix", f"{rev}-controls.json") rx_mappings = pathlib.Path(dir_location, "frameworks", f"ATT&CK-{attack_version}", rev, "stix", f"{rev}-mappings.json") output_location = pathlib.Path(dir_location, "frameworks", f"ATT&CK-{attack_version}", rev, f"{rev}-mappings.xlsx") script_location = f"{dir_location}/src/list_mappings.py" child_process = subprocess.Popen([ sys.executable, script_location, "-controls", str(rx_controls), "-mappings", str(rx_mappings), "-domain", attack_domain, "-version", attack_version, "-output", str(output_location), ]) child_process.wait(timeout=240) assert child_process.returncode == 0 @pytest.mark.parametrize("attack_version", ["v8.2", "v9.0"]) @pytest.mark.parametrize("rev", ["nist800-53-r4", "nist800-53-r5"]) def test_mappings_to_heatmaps(dir_location, attack_domain, attack_version, rev): """Tests mappings_to_heatmaps.py with both framework entries""" rx_controls = pathlib.Path(dir_location, "frameworks", f"ATT&CK-{attack_version}", rev, "stix", f"{rev}-controls.json") rx_mappings = pathlib.Path(dir_location, "frameworks", f"ATT&CK-{attack_version}", rev, "stix", f"{rev}-mappings.json") output_location = pathlib.Path(dir_location, "frameworks", f"ATT&CK-{attack_version}", rev, "layers") script_location = f"{dir_location}/src/mappings_to_heatmaps.py" child_process = subprocess.Popen([ sys.executable, script_location, "-framework", rev, "-controls", str(rx_controls), "-mappings", str(rx_mappings), "-domain", attack_domain, "-version", attack_version, "-output", str(output_location), "--clear", "--build-directory", ]) child_process.wait(timeout=90) assert child_process.returncode == 0 @pytest.mark.parametrize("attack_version", ["v8.2", "v9.0"]) @pytest.mark.parametrize("rev", ["nist800-53-r4", "nist800-53-r5"]) def test_substitute(dir_location, attack_domain, attack_version, rev): """Tests substitute.py with both frameworks""" rx_controls = pathlib.Path(dir_location, "frameworks", f"ATT&CK-{attack_version}", rev, "stix", f"{rev}-controls.json") rx_mappings = pathlib.Path(dir_location, "frameworks", f"ATT&CK-{attack_version}", rev, "stix", f"{rev}-mappings.json") output_location = pathlib.Path(dir_location, "frameworks", f"ATT&CK-{attack_version}", rev, "stix", f"{rev}-enterprise-attack.json") script_location = f"{dir_location}/src/substitute.py" child_process = subprocess.Popen([ sys.executable, script_location, "-controls", str(rx_controls), "-mappings", str(rx_mappings), "-domain", attack_domain, "-version", attack_version, "-output", str(output_location), "--allow-unmapped", ]) child_process.wait(timeout=90) assert child_process.returncode == 0 def test_make(dir_location): """Test the main make.py script""" script_location = f"{dir_location}/src/make.py" child_process = subprocess.Popen([ sys.executable, script_location, ]) child_process.wait(timeout=1080) assert child_process.returncode == 0 @pytest.mark.parametrize("attack_version", ["v8.2", "v9.0"]) @pytest.mark.parametrize("rev", ["nist800-53-r4", "nist800-53-r5"]) def test_parse_framework(dir_location, attack_version, rev): """Tests parse.py with both frameworks""" rx_input_controls = pathlib.Path(dir_location, "frameworks", f"ATT&CK-{attack_version}", rev, "input", f"{rev}-controls.tsv") rx_input_mappings = pathlib.Path(dir_location, "frameworks", f"ATT&CK-{attack_version}", rev, "input", f"{rev}-mappings.tsv") rx_output_controls = pathlib.Path(dir_location, "frameworks", f"ATT&CK-{attack_version}", rev, "stix", f"{rev}-controls.json") rx_output_mappings = pathlib.Path(dir_location, "frameworks", f"ATT&CK-{attack_version}", rev, "stix", f"{rev}-mappings.json") config_location = pathlib.Path(dir_location, "frameworks", f"ATT&CK-{attack_version}", rev, "input", "config.json") script_location = f"{dir_location}/frameworks/ATT&CK-{attack_version}/{rev}/parse.py" child_process = subprocess.Popen([ sys.executable, script_location, "-input-controls", str(rx_input_controls), "-input-mappings", str(rx_input_mappings), "-output-controls", str(rx_output_controls), "-output-mappings", str(rx_output_mappings), "-config-location", str(config_location), ]) child_process.wait(timeout=90) assert child_process.returncode == 0
43.496183
98
0.629168
674
5,698
5.120178
0.121662
0.097943
0.08809
0.078238
0.789047
0.755143
0.711678
0.711678
0.673428
0.624746
0
0.018468
0.220779
5,698
130
99
43.830769
0.758784
0.037557
0
0.590909
0
0
0.263466
0.100586
0
0
0
0
0.045455
1
0.063636
false
0
0.045455
0.009091
0.136364
0
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
5dec399c34c0082bb3b609bf8090d26ce942f02b
133
py
Python
14_Sort/Step02/yj.py
StudyForCoding/BEAKJOON
84e1c5e463255e919ccf6b6a782978c205420dbf
[ "MIT" ]
null
null
null
14_Sort/Step02/yj.py
StudyForCoding/BEAKJOON
84e1c5e463255e919ccf6b6a782978c205420dbf
[ "MIT" ]
3
2020-11-04T05:38:53.000Z
2021-03-02T02:15:19.000Z
14_Sort/Step02/yj.py
StudyForCoding/BEAKJOON
84e1c5e463255e919ccf6b6a782978c205420dbf
[ "MIT" ]
null
null
null
import sys n = int(sys.stdin.readline()) num = [int(sys.stdin.readline()) for m in range(n)] num.sort() for nu in num: print(nu)
19
51
0.654135
25
133
3.48
0.56
0.137931
0.252874
0.436782
0
0
0
0
0
0
0
0
0.165414
133
7
52
19
0.783784
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.166667
0
0.166667
0.166667
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
5df9c3cdcd80dc5522ebfd390020557a9938e8bf
380
py
Python
queryset_client/tests/base/tests/__init__.py
pulina/tastypie-queryset-client
1d65ee387e256b78c44fd8be57fa64ca798ae2da
[ "MIT" ]
null
null
null
queryset_client/tests/base/tests/__init__.py
pulina/tastypie-queryset-client
1d65ee387e256b78c44fd8be57fa64ca798ae2da
[ "MIT" ]
1
2016-12-22T10:55:44.000Z
2016-12-22T10:55:44.000Z
queryset_client/tests/base/tests/__init__.py
pulina/tastypie-queryset-client
1d65ee387e256b78c44fd8be57fa64ca798ae2da
[ "MIT" ]
5
2015-04-27T11:50:28.000Z
2019-01-10T06:39:57.000Z
import warnings warnings.simplefilter('ignore', Warning) from .count import * from .create import * from .exists import * from .foreignkey import * from .get_or_create import * from .latest import * from .lazy import * from .len import * from .many_to_many import * from .model import * from .order_by import * from .paginator import * from .slice import * from .strict import *
21.111111
40
0.75
53
380
5.283019
0.433962
0.464286
0.114286
0
0
0
0
0
0
0
0
0
0.160526
380
17
41
22.352941
0.877743
0
0
0
0
0
0.015789
0
0
0
0
0
0
1
0
true
0
0.9375
0
0.9375
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
f8f5df08cd3b48fefa79d3c3b394e779643e6792
2,667
py
Python
tensorlayer/__init__.py
XJTUexperiment/tensorlayer
7184f728b35106e80f7424e09a2bde1721b82803
[ "Apache-2.0" ]
5
2018-12-06T21:10:55.000Z
2021-01-24T11:47:35.000Z
tensorlayer/__init__.py
OwenLiuzZ/tensorlayer
65c6611566aa182c4d7cbf51db7c054240c409ff
[ "Apache-2.0" ]
null
null
null
tensorlayer/__init__.py
OwenLiuzZ/tensorlayer
65c6611566aa182c4d7cbf51db7c054240c409ff
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- """Deep learning and Reinforcement learning library for Researchers and Engineers""" from __future__ import absolute_import import os from distutils.version import LooseVersion from tensorlayer.package_info import VERSION from tensorlayer.package_info import __shortversion__ from tensorlayer.package_info import __version__ from tensorlayer.package_info import __package_name__ from tensorlayer.package_info import __contact_names__ from tensorlayer.package_info import __contact_emails__ from tensorlayer.package_info import __homepage__ from tensorlayer.package_info import __repository_url__ from tensorlayer.package_info import __download_url__ from tensorlayer.package_info import __description__ from tensorlayer.package_info import __license__ from tensorlayer.package_info import __keywords__ if 'TENSORLAYER_PACKAGE_BUILDING' not in os.environ: try: import tensorflow except Exception as e: raise ImportError( "Tensorflow is not installed, please install it with the one of the following commands:\n" " - `pip install --upgrade tensorflow`\n" " - `pip install --upgrade tensorflow-gpu`" ) if ("SPHINXBUILD" not in os.environ and "READTHEDOCS" not in os.environ and LooseVersion(tensorflow.__version__) < LooseVersion("1.6.0")): raise RuntimeError( "TensorLayer does not support Tensorflow version older than 1.6.0.\n" "Please update Tensorflow with:\n" " - `pip install --upgrade tensorflow`\n" " - `pip install --upgrade tensorflow-gpu`" ) from tensorlayer import activation from tensorlayer import array_ops from tensorlayer import cost from tensorlayer import decorators from tensorlayer import files from tensorlayer import initializers from tensorlayer import iterate from tensorlayer import layers from tensorlayer import lazy_imports from tensorlayer import logging from tensorlayer import models from tensorlayer import optimizers from tensorlayer import rein from tensorlayer.lazy_imports import LazyImport # Lazy Imports db = LazyImport("tensorlayer.db") distributed = LazyImport("tensorlayer.distributed") nlp = LazyImport("tensorlayer.nlp") prepro = LazyImport("tensorlayer.prepro") utils = LazyImport("tensorlayer.utils") visualize = LazyImport("tensorlayer.visualize") # alias act = activation vis = visualize alphas = array_ops.alphas alphas_like = array_ops.alphas_like # global vars global_flag = {} global_dict = {}
34.192308
102
0.739033
304
2,667
6.217105
0.355263
0.206349
0.144444
0.165079
0.301587
0.215873
0.137566
0.137566
0.137566
0.137566
0
0.003283
0.2006
2,667
77
103
34.636364
0.883208
0.056993
0
0.068966
0
0
0.203593
0.028743
0
0
0
0
0
1
0
false
0
0.637931
0
0.637931
0
0
0
0
null
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
5d02c3951e18272098aa083c02d282200ff1082c
706
py
Python
tests/test_1742.py
sungho-joo/leetcode2github
ce7730ef40f6051df23681dd3c0e1e657abba620
[ "MIT" ]
2
2020-12-08T13:59:10.000Z
2021-05-01T05:07:39.000Z
tests/test_1742.py
sungho-joo/leetcode2github
ce7730ef40f6051df23681dd3c0e1e657abba620
[ "MIT" ]
null
null
null
tests/test_1742.py
sungho-joo/leetcode2github
ce7730ef40f6051df23681dd3c0e1e657abba620
[ "MIT" ]
1
2021-05-02T17:42:02.000Z
2021-05-02T17:42:02.000Z
#!/usr/bin/env python import pytest """ Test 1742. Maximum Number of Balls in a Box """ @pytest.fixture(scope="session") def init_variables_1742(): from src.leetcode_1742_maximum_number_of_balls_in_a_box import Solution solution = Solution() def _init_variables_1742(): return solution yield _init_variables_1742 class TestClass1742: def test_solution_0(self, init_variables_1742): assert init_variables_1742().countBalls(1, 10) == 2 def test_solution_1(self, init_variables_1742): assert init_variables_1742().countBalls(5, 15) == 2 def test_solution_2(self, init_variables_1742): assert init_variables_1742().countBalls(19, 28) == 2
22.774194
75
0.725212
98
706
4.877551
0.408163
0.24477
0.320084
0.131799
0.464435
0.464435
0.464435
0.464435
0.338912
0
0
0.110727
0.181303
706
30
76
23.533333
0.716263
0.028329
0
0
0
0
0.011041
0
0
0
0
0
0.2
1
0.333333
false
0
0.133333
0.066667
0.6
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
5d49b567f93c46d676fdb50c07aa49435c4c7002
71
py
Python
moneypy/filters/__init__.py
bajor/MoneyPy
8239059944810bf658ffa0664b2a83bdd640c8fa
[ "MIT" ]
null
null
null
moneypy/filters/__init__.py
bajor/MoneyPy
8239059944810bf658ffa0664b2a83bdd640c8fa
[ "MIT" ]
null
null
null
moneypy/filters/__init__.py
bajor/MoneyPy
8239059944810bf658ffa0664b2a83bdd640c8fa
[ "MIT" ]
null
null
null
"""Functionality related to filtering and sorting the banking data."""
35.5
70
0.774648
9
71
6.111111
1
0
0
0
0
0
0
0
0
0
0
0
0.126761
71
1
71
71
0.887097
0.901408
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
5d4acc39bdbd98ca6807e1bbca97ed32175963c8
194
py
Python
regi0/geographic/__init__.py
PEM-Humboldt/geographic-validation
e8584fdbccd40847e94fef2481bc8f420e7fddb3
[ "MIT" ]
null
null
null
regi0/geographic/__init__.py
PEM-Humboldt/geographic-validation
e8584fdbccd40847e94fef2481bc8f420e7fddb3
[ "MIT" ]
24
2021-04-30T18:02:30.000Z
2021-10-13T13:56:24.000Z
regi0/geographic/__init__.py
PEM-Humboldt/geographic-validation
e8584fdbccd40847e94fef2481bc8f420e7fddb3
[ "MIT" ]
1
2021-06-16T16:52:52.000Z
2021-06-16T16:52:52.000Z
from regi0.geographic.local import ( find_outliers, find_spatial_duplicates, get_layer_field, get_layer_field_historical, intersects_layer, intersects_layer_historical )
21.555556
36
0.773196
22
194
6.318182
0.636364
0.115108
0.18705
0
0
0
0
0
0
0
0
0.006289
0.180412
194
8
37
24.25
0.867925
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.125
0
0.125
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
5371cb3ce0eefea2489c4d6e5cfe6d7f8dab930f
190
py
Python
metaphor/redshift/usage/__main__.py
MetaphorData/connectors
e195f58ee0660b278bd72d16173937fae279eef2
[ "Apache-2.0" ]
5
2021-08-24T17:46:48.000Z
2022-01-21T03:42:31.000Z
metaphor/redshift/usage/__main__.py
MetaphorData/connectors
e195f58ee0660b278bd72d16173937fae279eef2
[ "Apache-2.0" ]
142
2021-09-02T22:16:54.000Z
2022-03-31T15:23:34.000Z
metaphor/redshift/usage/__main__.py
MetaphorData/connectors
e195f58ee0660b278bd72d16173937fae279eef2
[ "Apache-2.0" ]
null
null
null
from metaphor.common.cli import cli_main from .extractor import RedshiftUsageExtractor if __name__ == "__main__": cli_main("Redshift usage metadata extractor", RedshiftUsageExtractor)
27.142857
73
0.810526
21
190
6.857143
0.619048
0.097222
0
0
0
0
0
0
0
0
0
0
0.121053
190
6
74
31.666667
0.862275
0
0
0
0
0
0.215789
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
538eacf2f5f4ff957eb36b3f2c27c4c982200e0a
318
py
Python
opto/opto/utils/test/__init__.py
tholiao/opto
370a016a1ccef462b185b0f9538fb33aab81d566
[ "MIT" ]
5
2019-03-25T17:52:28.000Z
2022-03-19T06:20:41.000Z
opto/opto/utils/test/__init__.py
tholiao/opto
370a016a1ccef462b185b0f9538fb33aab81d566
[ "MIT" ]
null
null
null
opto/opto/utils/test/__init__.py
tholiao/opto
370a016a1ccef462b185b0f9538fb33aab81d566
[ "MIT" ]
6
2018-02-19T05:33:40.000Z
2019-11-21T04:17:22.000Z
# Compatibility Python 2/3 from __future__ import division, print_function, absolute_import from builtins import range # ---------------------------------------------------------------------------------------------------------------------- import numpy as np from dotmap import DotMap import matplotlib.pyplot as plt
35.333333
120
0.518868
29
318
5.482759
0.689655
0.150943
0
0
0
0
0
0
0
0
0
0.00692
0.091195
318
8
121
39.75
0.543253
0.449686
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0.2
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
539f8053abebd8c052e3dad40986ad1f44f3e47d
41
py
Python
data/studio21_generated/introductory/3556/starter_code.py
vijaykumawat256/Prompt-Summarization
614f5911e2acd2933440d909de2b4f86653dc214
[ "Apache-2.0" ]
null
null
null
data/studio21_generated/introductory/3556/starter_code.py
vijaykumawat256/Prompt-Summarization
614f5911e2acd2933440d909de2b4f86653dc214
[ "Apache-2.0" ]
null
null
null
data/studio21_generated/introductory/3556/starter_code.py
vijaykumawat256/Prompt-Summarization
614f5911e2acd2933440d909de2b4f86653dc214
[ "Apache-2.0" ]
null
null
null
def diamonds_and_toads(sentence,fairy):
20.5
39
0.829268
6
41
5.333333
1
0
0
0
0
0
0
0
0
0
0
0
0.073171
41
2
40
20.5
0.842105
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
4
53a75ec12849ebf51ad3d56d74c68244660f9c90
1,552
py
Python
src/modules/json_schemas.py
tensor-nsk-lesson/messenger
c232b8e3ca099fc87f723b4000f6b56e39add792
[ "MIT" ]
null
null
null
src/modules/json_schemas.py
tensor-nsk-lesson/messenger
c232b8e3ca099fc87f723b4000f6b56e39add792
[ "MIT" ]
8
2019-06-12T05:47:47.000Z
2022-02-18T02:40:01.000Z
src/modules/json_schemas.py
tensor-nsk-lesson/messenger
c232b8e3ca099fc87f723b4000f6b56e39add792
[ "MIT" ]
1
2021-03-12T13:18:56.000Z
2021-03-12T13:18:56.000Z
login_schema = { 'type': 'object', 'properties': { 'login': {'type': 'string', 'pattern': '^[0-9A-z-_]+$'}, 'password': {'type': 'string', 'pattern': '^[0-9A-z-_]+$'} }, 'required': ['login', 'password'] } register_schema = { 'type': 'object', 'properties': { 'login': {'type': 'string', 'pattern': '^[0-9A-z-_]+$'}, 'email': {'type': 'string', 'pattern': '^[0-9A-z-_]+@[0-9A-z-_]+.[0-9A-z]+$'}, 'password': {'type': 'string', 'pattern': '^[0-9A-zА-я-_]+$'}, 'first_name': {'type': 'string', 'pattern': '^[0-9A-zА-я-_]+$'}, 'second_name': {'type': 'string', 'pattern': '^[0-9A-zА-я-_]+$'} }, 'required': ['login', 'password', 'first_name', 'second_name', 'email'] } profile_update_schema = { 'type': 'object', 'properties': { 'first_name': {'type': 'string', 'pattern': '^[0-9A-zА-я-_]+$'}, 'second_name': {'type': 'string', 'pattern': '^[0-9A-zА-я-_]+$'} }, 'required': ['first_name', 'second_name'] } chat_create_schema = { 'type': 'object', 'properties': { 'name': {'type': 'string', 'pattern': '^[0-9A-zА-я-_\s][^\\r\\t\\n\\v\\f]+$'}, }, 'required': ['name'] } chat_send_msg_schema = { 'type': 'object', 'properties': { 'name': {'type': 'string', 'pattern': '^[0-9A-z-_]+$'}, }, 'required': ['name'] } password_schema = { 'type': 'object', 'properties': { 'password': {'type': 'string', 'pattern': '^[0-9A-zА-я-_]+$'}, }, 'required': ['password'] }
27.714286
86
0.476804
163
1,552
4.349693
0.190184
0.059238
0.287729
0.304654
0.702398
0.702398
0.667137
0.641749
0.578279
0.493653
0
0.022932
0.213273
1,552
56
87
27.714286
0.55774
0
0
0.458333
0
0.041667
0.495171
0.045718
0
0
0
0
0
1
0
false
0.145833
0
0
0
0
0
0
0
null
0
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
4
53c32da2afae74e387f4f0e26f5b65f90b9040c3
338
py
Python
tapioca_desk/resource_mapping/__init__.py
medeirosthiago/tapioca-desk
7d40510def79d90a49b95711af2d47a3b9ab5860
[ "MIT" ]
1
2017-09-25T19:21:38.000Z
2017-09-25T19:21:38.000Z
tapioca_desk/resource_mapping/__init__.py
medeirosthiago/tapioca-desk
7d40510def79d90a49b95711af2d47a3b9ab5860
[ "MIT" ]
4
2017-09-19T00:02:03.000Z
2017-09-19T21:24:28.000Z
tapioca_desk/resource_mapping/__init__.py
medeirosthiago/tapioca-desk
7d40510def79d90a49b95711af2d47a3b9ab5860
[ "MIT" ]
null
null
null
from .cases import CASES_MAPPING from .labels import LABELS_MAPPING from .customers import CUSTOMERS_MAPPING from .companies import COMPANIES_MAPPING RESOURCE_MAPPING = {} RESOURCE_MAPPING.update(CASES_MAPPING) RESOURCE_MAPPING.update(LABELS_MAPPING) RESOURCE_MAPPING.update(CUSTOMERS_MAPPING) RESOURCE_MAPPING.update(COMPANIES_MAPPING)
30.727273
42
0.872781
42
338
6.714286
0.214286
0.265957
0.390071
0.397163
0
0
0
0
0
0
0
0
0.071006
338
10
43
33.8
0.898089
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.444444
0
0.444444
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
53ccddbbbd3da5aab666a77b17fb7b1970cc0bd9
30
py
Python
a.1.5.py
AmanMishra148/python-repo
5b07fe19f2058fc2c909b96ae173f4346ac8d3da
[ "bzip2-1.0.6" ]
null
null
null
a.1.5.py
AmanMishra148/python-repo
5b07fe19f2058fc2c909b96ae173f4346ac8d3da
[ "bzip2-1.0.6" ]
1
2021-10-18T09:59:45.000Z
2021-10-18T09:59:45.000Z
a.1.5.py
AmanMishra148/python-repo
5b07fe19f2058fc2c909b96ae173f4346ac8d3da
[ "bzip2-1.0.6" ]
4
2021-10-18T09:40:54.000Z
2021-10-19T14:14:28.000Z
a= "Abhimanyu Singh" print(a)
10
20
0.7
5
30
4.2
0.8
0
0
0
0
0
0
0
0
0
0
0
0.133333
30
2
21
15
0.807692
0
0
0
0
0
0.5
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
4
54f25908f0f89b38b8d94db1a1eec83ee06b4628
112
py
Python
mayan/apps/smart_settings/__init__.py
Syunkolee9891/Mayan-EDMS
3759a9503a264a180b74cc8518388f15ca66ac1a
[ "Apache-2.0" ]
1
2021-06-17T18:24:25.000Z
2021-06-17T18:24:25.000Z
mayan/apps/smart_settings/__init__.py
Syunkolee9891/Mayan-EDMS
3759a9503a264a180b74cc8518388f15ca66ac1a
[ "Apache-2.0" ]
7
2020-06-06T00:01:04.000Z
2022-01-13T01:47:17.000Z
mayan/apps/smart_settings/__init__.py
Syunkolee9891/Mayan-EDMS
3759a9503a264a180b74cc8518388f15ca66ac1a
[ "Apache-2.0" ]
1
2020-07-29T21:03:27.000Z
2020-07-29T21:03:27.000Z
from __future__ import unicode_literals default_app_config = 'mayan.apps.smart_settings.apps.SmartSettingsApp'
28
70
0.866071
14
112
6.357143
0.928571
0
0
0
0
0
0
0
0
0
0
0
0.071429
112
3
71
37.333333
0.855769
0
0
0
0
0
0.419643
0.419643
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
1
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
071c3b7266c13a33409e040171d9f42b222b8704
449
py
Python
meraki/models/object_type_enum.py
bossypants22/python-sdk-test
37701d62dc18c2abb910eb790ab978913adcaf7b
[ "MIT" ]
37
2019-04-24T14:01:33.000Z
2022-01-28T01:37:21.000Z
meraki/models/object_type_enum.py
ankita66666666/meraki-python-sdk
9894089eb013318243ae48869cc5130eb37f80c0
[ "MIT" ]
10
2019-07-09T16:35:11.000Z
2021-12-07T03:47:53.000Z
meraki/models/object_type_enum.py
ankita66666666/meraki-python-sdk
9894089eb013318243ae48869cc5130eb37f80c0
[ "MIT" ]
17
2019-04-30T23:53:21.000Z
2022-02-07T22:57:44.000Z
# -*- coding: utf-8 -*- """ meraki This file was automatically generated for meraki by APIMATIC v2.0 ( https://apimatic.io ). """ class ObjectTypeEnum(object): """Implementation of the 'objectType' enum. TODO: type enum description here. Attributes: PERSON: TODO: type description here. VEHICLE: TODO: type description here. """ PERSON = 'person' VEHICLE = 'vehicle'
17.96
95
0.592428
46
449
5.782609
0.673913
0.090226
0.142857
0.172932
0
0
0
0
0
0
0
0.009494
0.296214
449
24
96
18.708333
0.832278
0.652561
0
0
1
0
0.147727
0
0
0
0
0.125
0
1
0
false
0
0
0
1
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
1
0
0
0
0
0
0
0
1
0
0
4
07223f6646d28bbe8361254170c56512be80ca0b
401
py
Python
PMIa/2014/KUCHERYAVENKO_A_I/task_1_38.py
YukkaSarasti/pythonintask
eadf4245abb65f4400a3bae30a4256b4658e009c
[ "Apache-2.0" ]
null
null
null
PMIa/2014/KUCHERYAVENKO_A_I/task_1_38.py
YukkaSarasti/pythonintask
eadf4245abb65f4400a3bae30a4256b4658e009c
[ "Apache-2.0" ]
null
null
null
PMIa/2014/KUCHERYAVENKO_A_I/task_1_38.py
YukkaSarasti/pythonintask
eadf4245abb65f4400a3bae30a4256b4658e009c
[ "Apache-2.0" ]
null
null
null
# Задача 1. Вариант 38. # Напишите программу, которая будет сообщать род деятельности и псевдоним под которым скрывается Аврора Жюпен. После вывода информации программа должна дожидаться пока пользователь нажмет Enter для выхода. # Kucheryavenko A. I. # 17.03.2016 print("Жорж Санд более известна, как французская писательница Амандина Аврора Люсиль Дюпен.") input("\n\nНажмите Enter для выхода.")
40.1
205
0.795511
54
401
5.907407
0.925926
0.050157
0.087774
0
0
0
0
0
0
0
0
0.031884
0.139651
401
9
206
44.555556
0.892754
0.638404
0
0
0
0
0.807143
0
0
0
0
0
0
1
0
true
0
0
0
0
0.5
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
1
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
4
0757ea5a3e0906e79a5d7492fa1f95d2e7a35393
1,322
py
Python
tests/test_netstrings.py
kgaughan/adjunct
b4e845d3b9c0648e6ac46ee25e484e9660f3924e
[ "MIT" ]
null
null
null
tests/test_netstrings.py
kgaughan/adjunct
b4e845d3b9c0648e6ac46ee25e484e9660f3924e
[ "MIT" ]
1
2019-02-23T14:41:35.000Z
2020-06-15T13:00:46.000Z
tests/test_netstrings.py
kgaughan/adjunct
b4e845d3b9c0648e6ac46ee25e484e9660f3924e
[ "MIT" ]
null
null
null
import unittest from adjunct.netstrings import MalformedNetstring, parse class NetstringReaderTest(unittest.TestCase): def test_empty(self): self.assertListEqual(parse(b""), []) def test_single(self): self.assertListEqual(parse(b"0:,"), [b""]) self.assertListEqual(parse(b"1:a,"), [b"a"]) self.assertListEqual(parse(b"2:ab,"), [b"ab"]) def test_long_string(self): self.assertListEqual(parse(b"10:abcdezxcvb,"), [b"abcdezxcvb"]) def test_series(self): self.assertListEqual(parse(b"0:,0:,"), [b"", b""]) self.assertListEqual(parse(b"1:a,1:a,"), [b"a", b"a"]) self.assertListEqual(parse(b"2:ab,2:ab,"), [b"ab", b"ab"]) def test_length_limit(self): with self.assertRaises(MalformedNetstring): parse(b"12345678901:b,") def test_leading_zero(self): with self.assertRaises(MalformedNetstring): parse(b"01:b,") def test_bad_length(self): with self.assertRaises(MalformedNetstring): parse(b"a:b,") def test_truncation(self): with self.assertRaises(MalformedNetstring): parse(b"5:abcd") with self.assertRaises(MalformedNetstring): parse(b"0:") with self.assertRaises(MalformedNetstring): parse(b"5:abcde")
31.47619
71
0.623298
161
1,322
5.043478
0.248447
0.103448
0.236453
0.246305
0.663793
0.565271
0.437192
0.076355
0.076355
0
0
0.026112
0.217852
1,322
41
72
32.243902
0.759188
0
0
0.193548
0
0
0.080938
0
0
0
0
0
0.451613
1
0.258065
false
0
0.064516
0
0.354839
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
1
0
1
0
0
0
0
0
0
0
4
075917da082df97778484e2c7316d68b77bd4df0
170
py
Python
OOPS/section 4/app/mymath.py
Advik-B/Learn-Python
66ac57259764e8f2c3c6513a8de6c106800d8abe
[ "MIT" ]
6
2021-07-26T14:21:25.000Z
2021-07-26T14:32:01.000Z
OOPS/section 4/app/mymath.py
Advik-B/Learn-Python
66ac57259764e8f2c3c6513a8de6c106800d8abe
[ "MIT" ]
2
2021-12-10T10:25:19.000Z
2021-12-10T10:27:15.000Z
OOPS/section 4/app/mymath.py
Advik-B/Learn-Python
66ac57259764e8f2c3c6513a8de6c106800d8abe
[ "MIT" ]
null
null
null
def add(x,y): return x + y def multiply(x,y): return x * y def subtract(x,y): return x - y def divide(x,y): return y/x def power(x,y): return x**y
12.142857
18
0.558824
35
170
2.714286
0.257143
0.189474
0.421053
0.378947
0.515789
0.410526
0
0
0
0
0
0
0.288235
170
14
19
12.142857
0.785124
0
0
0
0
0
0
0
0
0
0
0
0
1
0.5
false
0
0
0.5
1
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
4
ab027b166287d50a7dc37f2cb80197e1a6bc7014
158
py
Python
tests/cpydiff/core_function_instancevar.py
cav71/micropython
cd3ed02ca38f5c9bdf535af407b7feb48fe28904
[ "MIT" ]
1
2021-03-07T06:14:21.000Z
2021-03-07T06:14:21.000Z
tests/cpydiff/core_function_instancevar.py
cav71/micropython
cd3ed02ca38f5c9bdf535af407b7feb48fe28904
[ "MIT" ]
null
null
null
tests/cpydiff/core_function_instancevar.py
cav71/micropython
cd3ed02ca38f5c9bdf535af407b7feb48fe28904
[ "MIT" ]
null
null
null
""" categories: Core,Functions description: Assign instance variable to function cause: Unknown workaround: Unknown """ def f(): pass f.x = 0 print(f.x)
13.166667
49
0.71519
22
158
5.136364
0.818182
0.035398
0
0
0
0
0
0
0
0
0
0.007576
0.164557
158
11
50
14.363636
0.848485
0.702532
0
0
0
0
0
0
0
0
0
0
0
1
0.25
true
0.25
0
0
0.25
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
1
0
0
0
0
0
4
ab2e406ebe02f8d753f51ffed8dfa379f47acc85
226
py
Python
routml_app/models.py
routml/django-app
069454d7931ab965a6a8f885cf82b30c455c3ffa
[ "MIT" ]
null
null
null
routml_app/models.py
routml/django-app
069454d7931ab965a6a8f885cf82b30c455c3ffa
[ "MIT" ]
null
null
null
routml_app/models.py
routml/django-app
069454d7931ab965a6a8f885cf82b30c455c3ffa
[ "MIT" ]
null
null
null
from django.db import models class Url(models.Model): url = models.CharField(max_length=2000, unique=True, db_index=True) day = models.IntegerField() month = models.IntegerField() year = models.IntegerField()
28.25
71
0.721239
29
226
5.551724
0.655172
0.335404
0
0
0
0
0
0
0
0
0
0.021164
0.163717
226
7
72
32.285714
0.830688
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.166667
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
4
ab39f0781e3f4a902c3929d256e6fd2ae71e5b81
37
py
Python
pynwsradar/version.py
MatthewFlamm/pynwsradar
b026e1c91225706d2998c32dd3335b9631258be6
[ "MIT" ]
null
null
null
pynwsradar/version.py
MatthewFlamm/pynwsradar
b026e1c91225706d2998c32dd3335b9631258be6
[ "MIT" ]
2
2021-02-27T17:43:57.000Z
2021-03-11T19:31:20.000Z
pynwsradar/version.py
MatthewFlamm/pynwsradar
b026e1c91225706d2998c32dd3335b9631258be6
[ "MIT" ]
null
null
null
"""Version.""" __version__ = "0.0.1"
12.333333
21
0.567568
5
37
3.4
0.6
0
0
0
0
0
0
0
0
0
0
0.090909
0.108108
37
2
22
18.5
0.424242
0.216216
0
0
0
0
0.217391
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
ab4509160743fe591087691908a9be18384f7edc
414
py
Python
py_tdlib/constructors/encrypted_passport_element.py
Mr-TelegramBot/python-tdlib
2e2d21a742ebcd439971a32357f2d0abd0ce61eb
[ "MIT" ]
24
2018-10-05T13:04:30.000Z
2020-05-12T08:45:34.000Z
py_tdlib/constructors/encrypted_passport_element.py
MrMahdi313/python-tdlib
2e2d21a742ebcd439971a32357f2d0abd0ce61eb
[ "MIT" ]
3
2019-06-26T07:20:20.000Z
2021-05-24T13:06:56.000Z
py_tdlib/constructors/encrypted_passport_element.py
MrMahdi313/python-tdlib
2e2d21a742ebcd439971a32357f2d0abd0ce61eb
[ "MIT" ]
5
2018-10-05T14:29:28.000Z
2020-08-11T15:04:10.000Z
from ..factory import Type class encryptedPassportElement(Type): type = None # type: "PassportElementType" data = None # type: "bytes" front_side = None # type: "datedFile" reverse_side = None # type: "datedFile" selfie = None # type: "datedFile" translation = None # type: "vector<datedFile>" files = None # type: "vector<datedFile>" value = None # type: "string" hash = None # type: "string"
29.571429
48
0.676329
47
414
5.914894
0.446809
0.258993
0.183453
0.151079
0
0
0
0
0
0
0
0
0.193237
414
13
49
31.846154
0.832335
0.427536
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0.090909
0.090909
0
1
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
4
db41611861c2d8249c93b5732e7236dd86288553
173
py
Python
desafio aula4/ex2_contadores.py
FelipeFerreiraSS/logica-de-programacao_python_ads
0208bc6460e661994fb700e7b8724564f90b299f
[ "MIT" ]
null
null
null
desafio aula4/ex2_contadores.py
FelipeFerreiraSS/logica-de-programacao_python_ads
0208bc6460e661994fb700e7b8724564f90b299f
[ "MIT" ]
null
null
null
desafio aula4/ex2_contadores.py
FelipeFerreiraSS/logica-de-programacao_python_ads
0208bc6460e661994fb700e7b8724564f90b299f
[ "MIT" ]
null
null
null
inicial = int(input('Qual o numero inicial?')) final = int(input('Qual o numero final?')) x = inicial while( x <= final): if(x % 2 == 0): print(x) x = x + 1
21.625
46
0.549133
28
173
3.392857
0.5
0.168421
0.252632
0.273684
0.4
0
0
0
0
0
0
0.023622
0.265896
173
8
47
21.625
0.724409
0
0
0
0
0
0.241379
0
0
0
0
0
0
1
0
false
0
0
0
0
0.142857
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
db85c79ea5e36301830032d582270a6f1d0d8213
69
py
Python
trendfin/__init__.py
austinpkugler/trendfin
5b889197888f017cb6859e45d48c45b0bf346fb9
[ "MIT" ]
3
2021-06-04T02:58:20.000Z
2021-08-20T03:11:13.000Z
trendfin/__init__.py
austinpkugler/trendfin
5b889197888f017cb6859e45d48c45b0bf346fb9
[ "MIT" ]
null
null
null
trendfin/__init__.py
austinpkugler/trendfin
5b889197888f017cb6859e45d48c45b0bf346fb9
[ "MIT" ]
1
2021-06-12T16:51:31.000Z
2021-06-12T16:51:31.000Z
"""The ultimate package for analyzing online finance communities."""
34.5
68
0.782609
8
69
6.75
1
0
0
0
0
0
0
0
0
0
0
0
0.115942
69
1
69
69
0.885246
0.898551
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
db88733d617da170a6122c05f92c08c96223df31
43
py
Python
audio/edison/audio/__init__.py
noah95/edison
652af8ed4c99c11000a6c0136d770583a5318d8e
[ "Apache-2.0" ]
3
2020-09-16T18:43:40.000Z
2022-03-24T12:09:05.000Z
audio/edison/audio/__init__.py
noah95/edison
652af8ed4c99c11000a6c0136d770583a5318d8e
[ "Apache-2.0" ]
13
2020-11-13T18:50:47.000Z
2022-03-12T00:29:36.000Z
audio/edison/audio/__init__.py
noah95/edison
652af8ed4c99c11000a6c0136d770583a5318d8e
[ "Apache-2.0" ]
2
2020-09-16T18:43:46.000Z
2021-04-14T06:33:53.000Z
__all__=['audioutils', 'bit_depth_analyze']
43
43
0.790698
5
43
5.6
1
0
0
0
0
0
0
0
0
0
0
0
0.023256
43
1
43
43
0.666667
0
0
0
0
0
0.613636
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
db969dbc368bc886548b635efde28ab6c4a2590b
449
py
Python
python/graphscope/nx/generators/tests/test_trees.py
LI-Mingyu/GraphScope-MY
942060983d3f7f8d3a3377467386e27aba285b33
[ "Apache-2.0" ]
1
2021-12-17T03:58:08.000Z
2021-12-17T03:58:08.000Z
python/graphscope/nx/generators/tests/test_trees.py
LI-Mingyu/GraphScope-MY
942060983d3f7f8d3a3377467386e27aba285b33
[ "Apache-2.0" ]
null
null
null
python/graphscope/nx/generators/tests/test_trees.py
LI-Mingyu/GraphScope-MY
942060983d3f7f8d3a3377467386e27aba285b33
[ "Apache-2.0" ]
null
null
null
import pytest from networkx.generators.tests.test_trees import test_random_tree try: from graphscope.nx.generators.trees import NIL except ImportError: # NetworkX >=2.6 not contains NIL pass from graphscope.nx.utils import arbitrary_element from graphscope.nx.utils.compat import with_graphscope_nx_context @pytest.mark.usefixtures("graphscope_session") @with_graphscope_nx_context(test_random_tree) def test_random_tree(): pass
24.944444
65
0.815145
63
449
5.571429
0.492063
0.17094
0.119658
0.119658
0
0
0
0
0
0
0
0.005051
0.11804
449
17
66
26.411765
0.881313
0.069042
0
0.166667
0
0
0.043269
0
0
0
0
0
0
1
0.083333
true
0.166667
0.5
0
0.583333
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
1
0
1
0
0
4
dbc68366610d58b392a7781da0696038447e1120
216
py
Python
necrobot/database/dbutil.py
pancelor/necrobot
03003f0b4208c4e952cfa6b41a33d30480a351d7
[ "MIT" ]
8
2016-01-15T00:28:55.000Z
2020-02-10T21:23:11.000Z
necrobot/database/dbutil.py
pancelor/necrobot
03003f0b4208c4e952cfa6b41a33d30480a351d7
[ "MIT" ]
12
2017-01-01T22:14:54.000Z
2021-02-10T00:09:51.000Z
necrobot/database/dbutil.py
pancelor/necrobot
03003f0b4208c4e952cfa6b41a33d30480a351d7
[ "MIT" ]
18
2016-02-05T22:19:46.000Z
2020-02-12T05:11:57.000Z
league_schema_name = None def tn(tablename: str) -> str: if league_schema_name is not None: return '`{0}`.`{1}`'.format(league_schema_name, tablename) else: return '`{0}`'.format(tablename)
24
66
0.638889
29
216
4.551724
0.551724
0.272727
0.363636
0
0
0
0
0
0
0
0
0.017544
0.208333
216
8
67
27
0.754386
0
0
0
0
0
0.074074
0
0
0
0
0
0
1
0.166667
false
0
0
0
0.5
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
91b14adef1efbbe24fc883a523fac285a601e586
376
py
Python
basic/session_3/errors.py
verhulstm/python-training
b28e366402dd87deed63762c5d5cc121c12a7e92
[ "MIT" ]
null
null
null
basic/session_3/errors.py
verhulstm/python-training
b28e366402dd87deed63762c5d5cc121c12a7e92
[ "MIT" ]
null
null
null
basic/session_3/errors.py
verhulstm/python-training
b28e366402dd87deed63762c5d5cc121c12a7e92
[ "MIT" ]
null
null
null
# this is a comment. anything on a line that starts with a # is not treated by Python as code print(a) # notice all the text that was printed becouse of the error. # This is called a traceback. # It tells you what Python thinks the error is ("NameError: name 'a' is not defined") as well as # which line number ("line # 19") and which file ("errors.py") the problem is on.
53.714286
96
0.718085
70
376
3.871429
0.657143
0.04428
0.04428
0
0
0
0
0
0
0
0
0.006667
0.202128
376
6
97
62.666667
0.893333
0.93883
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
1
0
4
91ba7abf8ef2c73df57415ff9790a24712bde5a1
2,718
py
Python
kuryr_rancher/controller/handlers/pipeline.py
chenleji/kuryr-rancher
de38b7c9512bbdc0a40848853e02bacdb1890950
[ "Apache-2.0" ]
null
null
null
kuryr_rancher/controller/handlers/pipeline.py
chenleji/kuryr-rancher
de38b7c9512bbdc0a40848853e02bacdb1890950
[ "Apache-2.0" ]
null
null
null
kuryr_rancher/controller/handlers/pipeline.py
chenleji/kuryr-rancher
de38b7c9512bbdc0a40848853e02bacdb1890950
[ "Apache-2.0" ]
null
null
null
# Copyright (c) 2016 Mirantis, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from kuryr_rancher import exceptions from kuryr_rancher.handlers import asynchronous as h_async from kuryr_rancher.handlers import dispatch as h_dis from kuryr_rancher.handlers import k8s_base as h_k8s from kuryr_rancher.handlers import logging as h_log from kuryr_rancher.handlers import retry as h_retry class ControllerPipeline(h_dis.EventPipeline): """Serves as an entry point for controller Kubernetes events. `ControllerPipeline` is an entry point handler for the Kuryr-Kubernetes controller. `ControllerPipeline` allows registering :class:`kuryr_rancher.handlers.k8s_base.ResourceEventHandler`s and ensures the proper handler is called for each event that is passed to the `ControllerPipeline`. Also it ensures the following behavior: - multiple `ResourceEventHandler`s can be registered for the same resource type (`OBJECT_KIND`) - failing handlers (i.e. ones that raise `Exception`s) are retried until either the handler succeeds or a finite amount of time passes, in which case the most recent exception is logged - in case there are multiple handlers registered for the same resource type, all such handlers are considered independent (i.e. if one handler fails, other handlers will still be called regardless; and the order in which such handlers are called is not determined) - events for different Kubernetes objects can be handled concurrently - events for the same Kubernetes object are handled sequentially in the order of arrival """ def __init__(self, thread_group): self._tg = thread_group super(ControllerPipeline, self).__init__() def _wrap_consumer(self, consumer): # TODO(ivc): tune retry interval/timeout return h_log.LogExceptions(h_retry.Retry( consumer, exceptions=exceptions.ResourceNotReady)) def _wrap_dispatcher(self, dispatcher): return h_log.LogExceptions(h_async.Async(dispatcher, self._tg, h_k8s.object_link))
43.142857
78
0.729213
368
2,718
5.282609
0.470109
0.04321
0.049383
0.061728
0.134774
0.032922
0
0
0
0
0
0.005642
0.217439
2,718
62
79
43.83871
0.908322
0.654893
0
0
0
0
0
0
0
0
0
0.016129
0
1
0.1875
false
0
0.375
0.125
0.75
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
1
1
1
0
0
4
91d48b5027cb4fdfd1df1aee34a50845c807ec03
142
py
Python
tests/conftest.py
dgilland/fnc
a8d3cda717ba1c883e546a9f3cba9b2dc24c58a6
[ "MIT" ]
152
2018-08-16T02:02:46.000Z
2022-03-16T03:01:02.000Z
tests/conftest.py
dgilland/fnc
a8d3cda717ba1c883e546a9f3cba9b2dc24c58a6
[ "MIT" ]
4
2019-11-07T10:31:02.000Z
2021-05-18T15:08:54.000Z
tests/conftest.py
dgilland/fnc
a8d3cda717ba1c883e546a9f3cba9b2dc24c58a6
[ "MIT" ]
3
2020-09-14T03:04:33.000Z
2021-03-06T11:12:21.000Z
from unittest import mock import pytest @pytest.fixture def mocksleep(): with mock.patch("time.sleep") as mocked: yield mocked
14.2
44
0.704225
19
142
5.263158
0.789474
0
0
0
0
0
0
0
0
0
0
0
0.211268
142
9
45
15.777778
0.892857
0
0
0
0
0
0.070423
0
0
0
0
0
0
1
0.166667
true
0
0.333333
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
91dfb1793ca064ed071ea5a9fa1cb2e92cefc0af
169
py
Python
akshat_nbdev_test/core.py
agrawalakshat27/nbdev-test
6b30d49e954e3a3496cd50ce2eaa4737a34c0720
[ "Apache-2.0" ]
null
null
null
akshat_nbdev_test/core.py
agrawalakshat27/nbdev-test
6b30d49e954e3a3496cd50ce2eaa4737a34c0720
[ "Apache-2.0" ]
2
2021-09-28T04:31:12.000Z
2022-02-26T09:09:33.000Z
akshat_nbdev_test/core.py
agrawalakshat27/nbdev-test
6b30d49e954e3a3496cd50ce2eaa4737a34c0720
[ "Apache-2.0" ]
null
null
null
# AUTOGENERATED! DO NOT EDIT! File to edit: 00_core.ipynb (unless otherwise specified). __all__ = ['a'] # Cell def a(b): "qgerhwtejyrkafher arerhtrw" return 10
21.125
87
0.698225
23
169
4.913043
0.913043
0
0
0
0
0
0
0
0
0
0
0.029197
0.189349
169
8
88
21.125
0.79562
0.698225
0
0
1
0
0.350649
0
0
0
0
0
0
1
0.25
false
0
0
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
4
91e000859b7a0f21afd6b376af739adcbdb12f50
48
py
Python
src/cloud_radar/cf/e2e/__init__.py
WahidSyed/cloud-radar
916c3fb5524abfbb2a015f69ab1ec56e223169da
[ "Apache-2.0" ]
null
null
null
src/cloud_radar/cf/e2e/__init__.py
WahidSyed/cloud-radar
916c3fb5524abfbb2a015f69ab1ec56e223169da
[ "Apache-2.0" ]
null
null
null
src/cloud_radar/cf/e2e/__init__.py
WahidSyed/cloud-radar
916c3fb5524abfbb2a015f69ab1ec56e223169da
[ "Apache-2.0" ]
null
null
null
from ._stack import Stack __all__ = ["Stack"]
9.6
25
0.6875
6
48
4.666667
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.1875
48
4
26
12
0.717949
0
0
0
0
0
0.104167
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
37cdb6e1a6ee305835894a6ea94546212624fd27
261
py
Python
database/constants.py
hueyyeng/AssetsBrowser
eb00d495f3ed7eab3d5ef8b995f38237936037ea
[ "MIT" ]
7
2019-12-09T07:06:59.000Z
2021-11-05T22:38:01.000Z
database/constants.py
hueyyeng/AssetsBrowser
eb00d495f3ed7eab3d5ef8b995f38237936037ea
[ "MIT" ]
5
2019-01-15T03:44:39.000Z
2022-03-27T07:36:15.000Z
database/constants.py
hueyyeng/AssetsBrowser
eb00d495f3ed7eab3d5ef8b995f38237936037ea
[ "MIT" ]
null
null
null
"""Database Constants""" from database.models import ( Application, Asset, AssetItem, AssetItemFormat, Category, Project, ) DEFAULT_MODELS = [ Application, Asset, AssetItem, AssetItemFormat, Category, Project, ]
13.736842
29
0.632184
20
261
8.2
0.6
0.195122
0.304878
0.487805
0.670732
0.670732
0
0
0
0
0
0
0.275862
261
18
30
14.5
0.867725
0.068966
0
0.75
0
0
0
0
0
0
0
0
0
1
0
false
0
0.0625
0
0.0625
0
1
0
0
null
0
1
1
0
0
0
0
0
0
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
4
37cea488157c1989c17bfb690b84b99d2dc28f9c
753
py
Python
catalyst/metrics/__init__.py
elephantmipt/catalyst
6c706e4859ed7c58e5e6a5b7634176bffd0e2465
[ "Apache-2.0" ]
2
2019-04-19T21:34:31.000Z
2019-05-02T22:50:25.000Z
catalyst/metrics/__init__.py
elephantmipt/catalyst
6c706e4859ed7c58e5e6a5b7634176bffd0e2465
[ "Apache-2.0" ]
null
null
null
catalyst/metrics/__init__.py
elephantmipt/catalyst
6c706e4859ed7c58e5e6a5b7634176bffd0e2465
[ "Apache-2.0" ]
null
null
null
# flake8: noqa from catalyst.metrics.accuracy import accuracy, multi_label_accuracy from catalyst.metrics.auc import auc from catalyst.metrics.cmc_score import cmc_score, cmc_score_count from catalyst.metrics.dice import dice, calculate_dice from catalyst.metrics.f1_score import f1_score from catalyst.metrics.focal import sigmoid_focal_loss, reduced_focal_loss from catalyst.metrics.functional import ( process_multilabel_components, get_binary_statistics, get_multiclass_statistics, get_multilabel_statistics, get_default_topk_args, wrap_class_metric2dict, wrap_topk_metric2dict, ) from catalyst.metrics.iou import iou, jaccard from catalyst.metrics.mrr import mrr from catalyst.metrics.precision import average_precision
37.65
73
0.840637
102
753
5.921569
0.382353
0.198676
0.31457
0
0
0
0
0
0
0
0
0.007474
0.111554
753
19
74
39.631579
0.895366
0.015936
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.555556
0
0.555556
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
37e345f5149de22e5f6f4e5948b99b4559f4b0c5
72
py
Python
django_autoregister/__init__.py
samupl/django-admin-autoregister
3f8473e9ef16e35137a99a3ee3d9829e5285ecd6
[ "BSD-3-Clause" ]
null
null
null
django_autoregister/__init__.py
samupl/django-admin-autoregister
3f8473e9ef16e35137a99a3ee3d9829e5285ecd6
[ "BSD-3-Clause" ]
null
null
null
django_autoregister/__init__.py
samupl/django-admin-autoregister
3f8473e9ef16e35137a99a3ee3d9829e5285ecd6
[ "BSD-3-Clause" ]
null
null
null
default_app_config = 'django_autoregister.apps.DjangoAutoRegisterConfig'
72
72
0.902778
7
72
8.857143
1
0
0
0
0
0
0
0
0
0
0
0
0.027778
72
1
72
72
0.885714
0
0
0
0
0
0.671233
0.671233
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
37e7b4c46567e0f9a65247ea19a4c10550eebfb1
232
py
Python
blog/admin.py
SenJames/Car-Listing
01c51e616d60fb8f200f9f2b9891de0f2b3d5bd9
[ "MIT" ]
null
null
null
blog/admin.py
SenJames/Car-Listing
01c51e616d60fb8f200f9f2b9891de0f2b3d5bd9
[ "MIT" ]
null
null
null
blog/admin.py
SenJames/Car-Listing
01c51e616d60fb8f200f9f2b9891de0f2b3d5bd9
[ "MIT" ]
null
null
null
from django.contrib import admin from blog.models import Author, Category, Comment, Post # Register your models here. admin.site.register(Author) admin.site.register(Category) admin.site.register(Comment) admin.site.register(Post)
25.777778
55
0.810345
33
232
5.69697
0.454545
0.191489
0.361702
0
0
0
0
0
0
0
0
0
0.090517
232
9
56
25.777778
0.890995
0.112069
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
37f05fcb24b2c97d2374125a121d3d03f8ae6b66
188
py
Python
source/functions/netstat.py
Kung-327/CampusCyberInspectionTool2021
2ff64a18d750ff48ba6091bd1bf5d59bcaefa88b
[ "MIT" ]
2
2021-03-28T02:32:09.000Z
2021-03-28T04:07:54.000Z
source/functions/netstat.py
Kung-327/CampusCyberInspectionTool2021
2ff64a18d750ff48ba6091bd1bf5d59bcaefa88b
[ "MIT" ]
27
2021-03-22T12:42:28.000Z
2021-04-14T14:37:42.000Z
source/functions/netstat.py
Kung-327/CampusCyberInspectionTool2021
2ff64a18d750ff48ba6091bd1bf5d59bcaefa88b
[ "MIT" ]
19
2021-03-22T12:21:01.000Z
2021-03-31T22:06:49.000Z
from FuncBase import FuncBase import os class Netstat(): @property def Description(self): return('Netstat') def Run(self): return os.system('netstat -ano')
14.461538
40
0.632979
22
188
5.409091
0.636364
0.235294
0
0
0
0
0
0
0
0
0
0
0.260638
188
12
41
15.666667
0.856115
0
0
0
0
0
0.101064
0
0
0
0
0
0
1
0.25
false
0
0.25
0.25
0.75
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
4
530cbb175c44aa19c316fcc8b604044a3ca809b3
502
py
Python
HW5/linreg.py
miguel-mzbi/MachineLearning-DataMining
d589e89c85ccc7cba129c9a489c49f61a4298c5d
[ "MIT" ]
null
null
null
HW5/linreg.py
miguel-mzbi/MachineLearning-DataMining
d589e89c85ccc7cba129c9a489c49f61a4298c5d
[ "MIT" ]
null
null
null
HW5/linreg.py
miguel-mzbi/MachineLearning-DataMining
d589e89c85ccc7cba129c9a489c49f61a4298c5d
[ "MIT" ]
null
null
null
import numpy as np import numpy.linalg as la # Input: numpy matrix X of features, with n rows (samples), d columns (features) # X[i,j] is the j-th feature of the i-th sample # numpy vector y of scalar values, with n rows (samples), 1 column # y[i] is the scalar value of the i-th sample # Output: numpy vector theta, with d rows, 1 column # Example on how to call the function: # import linreg # theta = linreg.run(X,y) def run(X,y): return np.dot(la.pinv(X),y)
41.833333
80
0.657371
92
502
3.586957
0.48913
0.018182
0.054545
0.09697
0.084848
0
0
0
0
0
0
0.005291
0.247012
502
12
81
41.833333
0.867725
0.786853
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.5
0.25
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
1
1
0
0
4
72622a6b8ad2c47d369b4bad4e3efe752353d6db
18
py
Python
tb_lattice_viewer/__init__.py
kmkolasinski/tb-lattice-viewer
b25eb7f3ad7515a3f0f6a7da953289d96e506b6e
[ "MIT" ]
6
2020-08-25T17:32:40.000Z
2022-01-30T16:39:34.000Z
tb_lattice_viewer/__init__.py
kmkolasinski/tb-lattice-viewer
b25eb7f3ad7515a3f0f6a7da953289d96e506b6e
[ "MIT" ]
2
2018-06-23T11:10:57.000Z
2018-07-01T11:34:19.000Z
tb_lattice_viewer/__init__.py
kmkolasinski/tb-lattice-viewer
b25eb7f3ad7515a3f0f6a7da953289d96e506b6e
[ "MIT" ]
2
2021-01-02T12:59:27.000Z
2021-10-30T10:29:52.000Z
__version__ = 1.0
9
17
0.722222
3
18
3
1
0
0
0
0
0
0
0
0
0
0
0.133333
0.166667
18
1
18
18
0.466667
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
72694a364a6b13e24941075947d46487d9ce79c5
435
py
Python
pymerit/tests/test_basic.py
pingali/pymerit
37e5183c9a5b90485d620f803b7ea1159cc8c0e0
[ "MIT" ]
1
2019-01-04T04:53:36.000Z
2019-01-04T04:53:36.000Z
pymerit/tests/test_basic.py
pingali/pymerit
37e5183c9a5b90485d620f803b7ea1159cc8c0e0
[ "MIT" ]
null
null
null
pymerit/tests/test_basic.py
pingali/pymerit
37e5183c9a5b90485d620f803b7ea1159cc8c0e0
[ "MIT" ]
null
null
null
import pytest import pymerit def test_non_existent(): """ Test non-existent schema handler """ with pytest.raises(pymerit.MeritNoHandler) as exc: pymerit.find_handler("hello") def test_existent(): """ Testing default metadata """ assert pymerit.find_handler("global:default:v1") is not None assert pymerit.find_handler("global:default:v1") == pymerit.MeritDefault
20.714286
76
0.655172
49
435
5.693878
0.530612
0.11828
0.193548
0.172043
0.27957
0.27957
0.27957
0
0
0
0
0.006042
0.23908
435
20
77
21.75
0.836858
0.131034
0
0
0
0
0.112392
0
0
0
0
0
0.25
1
0.25
true
0
0.25
0
0.5
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
0
0
0
0
0
4
726e9ee27ef9a6fc6cc046a4c19257937800cbe9
246
py
Python
commmons/__init__.py
jaeseopark/commmons
fef41287c2e39873fab58c1a246d4317e9b19907
[ "MIT" ]
null
null
null
commmons/__init__.py
jaeseopark/commmons
fef41287c2e39873fab58c1a246d4317e9b19907
[ "MIT" ]
null
null
null
commmons/__init__.py
jaeseopark/commmons
fef41287c2e39873fab58c1a246d4317e9b19907
[ "MIT" ]
null
null
null
from pydash import * from .array import * from .clock import * from .fs import * from .hash import * from .html import * from .log import * from .string import * from .url import * from .zip import * from .dictionary import * from .func import *
18.923077
25
0.711382
36
246
4.861111
0.388889
0.628571
0
0
0
0
0
0
0
0
0
0
0.195122
246
12
26
20.5
0.883838
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
72779203f75dfb9c363cca0470cdf9817d9a3d8b
132
py
Python
greenline_app/admin.py
manishwins/Greenline
28085358eb6d8e500075067747f242e457117c44
[ "Apache-2.0" ]
null
null
null
greenline_app/admin.py
manishwins/Greenline
28085358eb6d8e500075067747f242e457117c44
[ "Apache-2.0" ]
null
null
null
greenline_app/admin.py
manishwins/Greenline
28085358eb6d8e500075067747f242e457117c44
[ "Apache-2.0" ]
null
null
null
from django.contrib import admin from .models import ( ContactUs, ) # Register your models here. admin.site.register(ContactUs)
13.2
32
0.765152
17
132
5.941176
0.647059
0
0
0
0
0
0
0
0
0
0
0
0.151515
132
9
33
14.666667
0.901786
0.19697
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.4
0
0.4
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
7295eb131f8cbb70f9603d8f740a25edfe774675
92
py
Python
days/03/01_basics.py
carlohcs/100-days-of-code-python-pro-bootcamp-for-2022
f7467fd1d373ee003b35511e7c14595b1108cfe9
[ "MIT" ]
null
null
null
days/03/01_basics.py
carlohcs/100-days-of-code-python-pro-bootcamp-for-2022
f7467fd1d373ee003b35511e7c14595b1108cfe9
[ "MIT" ]
null
null
null
days/03/01_basics.py
carlohcs/100-days-of-code-python-pro-bootcamp-for-2022
f7467fd1d373ee003b35511e7c14595b1108cfe9
[ "MIT" ]
null
null
null
# Convert to str number = 18 number_string = str(number) print(type(number_string)) # 'str'
18.4
34
0.728261
14
92
4.642857
0.571429
0.276923
0.461538
0
0
0
0
0
0
0
0
0.025316
0.141304
92
5
34
18.4
0.797468
0.217391
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0.333333
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
72bdbd5a0543a1e34b8c65f221d8b91ecb8fdd2e
4,477
py
Python
Lib/site-packages/win32com/servers/test_pycomtest.py
raychorn/svn_Python-2.5.1
425005b1b489ba44ec0bb989e077297e8953d9be
[ "PSF-2.0" ]
null
null
null
Lib/site-packages/win32com/servers/test_pycomtest.py
raychorn/svn_Python-2.5.1
425005b1b489ba44ec0bb989e077297e8953d9be
[ "PSF-2.0" ]
null
null
null
Lib/site-packages/win32com/servers/test_pycomtest.py
raychorn/svn_Python-2.5.1
425005b1b489ba44ec0bb989e077297e8953d9be
[ "PSF-2.0" ]
null
null
null
# This is part of the Python test suite. # The object is registered when you first run the test suite. # (and hopefully unregistered once done ;-) # Ensure the vtables in the tlb are known. from win32com import universal from win32com.server.exception import COMException from win32com.client import gencache import winerror from win32com.client import constants from win32com.server.util import wrap import pythoncom pythoncom.__future_currency__ = True # We use the constants from the module, so must insist on a gencache. # Otherwise, use of gencache is not necessary (tho still advised) gencache.EnsureModule('{6BCDCB60-5605-11D0-AE5F-CADD4C000000}', 0, 1, 1) class PyCOMTest: _typelib_guid_ = "{6BCDCB60-5605-11D0-AE5F-CADD4C000000}" _typelib_version = 1,0 _com_interfaces_ = ['IPyCOMTest'] _reg_clsid_ = "{e743d9cd-cb03-4b04-b516-11d3a81c1597}" _reg_progid_ = "Python.Test.PyCOMTest" def DoubleString(self, str): return str*2 def DoubleInOutString(self, str): return str*2 def Fire(self, nID): raise COMException(hresult=winerror.E_NOTIMPL) def GetLastVarArgs(self): raise COMException(hresult=winerror.E_NOTIMPL) def GetMultipleInterfaces(self, outinterface1, outinterface2): raise COMException(hresult=winerror.E_NOTIMPL) def GetSafeArrays(self, attrs, attrs2, ints): raise COMException(hresult=winerror.E_NOTIMPL) def GetSetDispatch(self, indisp): raise COMException(hresult=winerror.E_NOTIMPL) # Result is of type IPyCOMTest def GetSetInterface(self, ininterface): return wrap(self) def GetSetVariant(self, indisp): return indisp def TestByRefVariant(self, v): return v * 2 def TestByRefString(self, v): return v * 2 # Result is of type IPyCOMTest def GetSetInterfaceArray(self, ininterface): raise COMException(hresult=winerror.E_NOTIMPL) def GetSetUnknown(self, inunk): raise COMException(hresult=winerror.E_NOTIMPL) # Result is of type ISimpleCounter def GetSimpleCounter(self): raise COMException(hresult=winerror.E_NOTIMPL) def GetSimpleSafeArray(self, ints): raise COMException(hresult=winerror.E_NOTIMPL) def GetStruct(self): raise COMException(hresult=winerror.E_NOTIMPL) def SetIntSafeArray(self, ints): return len(ints) def SetVarArgs(self, *args): raise COMException(hresult=winerror.E_NOTIMPL) def SetVariantSafeArray(self, vars): raise COMException(hresult=winerror.E_NOTIMPL) def Start(self): raise COMException(hresult=winerror.E_NOTIMPL) def Stop(self, nID): raise COMException(hresult=winerror.E_NOTIMPL) def StopAll(self): raise COMException(hresult=winerror.E_NOTIMPL) def TakeByRefDispatch(self, inout): raise COMException(hresult=winerror.E_NOTIMPL) def TakeByRefTypedDispatch(self, inout): raise COMException(hresult=winerror.E_NOTIMPL) def Test(self, key, inval): return not inval def Test2(self, inval): return inval def Test3(self, inval): raise COMException(hresult=winerror.E_NOTIMPL) def Test4(self, inval): raise COMException(hresult=winerror.E_NOTIMPL) def Test5(self, inout): if inout == constants.TestAttr1: return constants.TestAttr1_1 elif inout == constants.TestAttr1_1: return constants.TestAttr1 else: return -1 def TestOptionals(self, strArg='def', sval=0, lval=1, dval=3.1400001049041748): raise COMException(hresult=winerror.E_NOTIMPL) def TestOptionals2(self, dval, strval='', sval=1): raise COMException(hresult=winerror.E_NOTIMPL) def CheckVariantSafeArray(self, data): return 1 def LongProp(self): return self.longval def SetLongProp(self, val): self.longval = val def ULongProp(self): return self.ulongval def SetULongProp(self, val): self.ulongval = val def IntProp(self): return self.intval def SetIntProp(self, val): self.intval = val class PyCOMTestMI(PyCOMTest): _typelib_guid_ = "{6BCDCB60-5605-11D0-AE5F-CADD4C000000}" _typelib_version = 1,0 # Interfaces with a interface name, a real IID, and an IID as a string _com_interfaces_ = ['IPyCOMTest', pythoncom.IID_IStream, str(pythoncom.IID_IStorage), ] _reg_clsid_ = "{F506E9A1-FB46-4238-A597-FA4EB69787CA}" _reg_progid_ = "Python.Test.PyCOMTestMI" if __name__ == '__main__': import win32com.server.register win32com.server.register.UseCommandLine(PyCOMTest) win32com.server.register.UseCommandLine(PyCOMTestMI)
28.515924
81
0.743132
558
4,477
5.844086
0.322581
0.109476
0.154554
0.206072
0.391598
0.373812
0.349279
0.270163
0.169273
0.074824
0
0.042257
0.164843
4,477
156
82
28.698718
0.829901
0.105651
0
0.266055
0
0
0.069064
0.060985
0
0
0
0
0
1
0.348624
false
0
0.073395
0.119266
0.678899
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4
72cb2f686f08cd516e3c5500b3b7d1f49291df47
190
py
Python
mmaction/datasets/samplers/__init__.py
kiyoon/Video-Swin-Transformer
7a0d40ced8fb52c064d1cd11ffa8b0c3bbb77607
[ "Apache-2.0" ]
648
2021-06-24T19:33:09.000Z
2022-03-31T06:27:24.000Z
mmaction/datasets/samplers/__init__.py
jayleicn/mmaction2-1
0a6fde1abb8403f1f68b568f5b4694c6f828e27e
[ "Apache-2.0" ]
53
2021-07-01T03:07:52.000Z
2022-03-27T16:15:29.000Z
mmaction/datasets/samplers/__init__.py
jayleicn/mmaction2-1
0a6fde1abb8403f1f68b568f5b4694c6f828e27e
[ "Apache-2.0" ]
117
2021-06-25T01:22:32.000Z
2022-03-31T08:33:55.000Z
from .distributed_sampler import (ClassSpecificDistributedSampler, DistributedSampler) __all__ = ['DistributedSampler', 'ClassSpecificDistributedSampler']
38
67
0.705263
9
190
14.333333
0.777778
0
0
0
0
0
0
0
0
0
0
0
0.231579
190
4
68
47.5
0.883562
0
0
0
0
0
0.257895
0.163158
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
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
0
0
1
0
0
0
0
4
72cd6d392303a675f107a6efda32b3a0e2442915
306
py
Python
core/basestore.py
miguelvm/PyTrendFollow
439232aed4d67ccf339e782b7c8b96f2dd961d43
[ "MIT" ]
158
2018-02-28T05:05:38.000Z
2022-03-31T21:02:01.000Z
core/basestore.py
miguelvm/PyTrendFollow
439232aed4d67ccf339e782b7c8b96f2dd961d43
[ "MIT" ]
23
2018-03-12T20:16:35.000Z
2021-09-03T09:02:31.000Z
core/basestore.py
miguelvm/PyTrendFollow
439232aed4d67ccf339e782b7c8b96f2dd961d43
[ "MIT" ]
54
2018-03-16T02:41:09.000Z
2021-10-09T14:52:54.000Z
from config.settings import quotes_storage """ This file imports data read/write methods for a local storage depending on the user's choice. These methods are used in core.contract_store. """ if quotes_storage == 'hdf5': from core.hdfstore import read_symbol, read_contract, write_data, drop_symbol
34
93
0.784314
47
306
4.957447
0.723404
0.111588
0
0
0
0
0
0
0
0
0
0.003831
0.147059
306
9
94
34
0.888889
0
0
0
0
0
0.025478
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
72d91b6bd34dab27e2e5ad5677e6d290771c200d
969
py
Python
itchymws/utils.py
albertoconnor/itchymws
1d6c46ad3579cfff86e48668fb99a8ee7b5c1e96
[ "MIT" ]
null
null
null
itchymws/utils.py
albertoconnor/itchymws
1d6c46ad3579cfff86e48668fb99a8ee7b5c1e96
[ "MIT" ]
null
null
null
itchymws/utils.py
albertoconnor/itchymws
1d6c46ad3579cfff86e48668fb99a8ee7b5c1e96
[ "MIT" ]
null
null
null
import hashlib import hmac import base64 from time import strftime, gmtime from datetime import datetime from dateutil import parser def calculate_signature(request, secret): """ base64 encode the hmac of the AWS_SECRET_ACCESS_KEY with the signature data. The siguature data looks like this: POST mws.amazonservices.com /Products/2011-10-01 AWSAccessKeyId=KEY&Action=GetServiceStatus&SellerId=SELLERID&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2013-01-04T03%3A13%3A24Z&Version=2011-10-01 request should be a list containing strings that represent each line above """ key = "\n".join(request).encode('utf-8') signature = hmac.new(secret.encode('utf-8'), key, hashlib.sha256).digest() return base64.b64encode(signature) def timestamp(): return timeformat(gmtime()) def timeformat(t): return strftime("%Y-%m-%dT%H:%M:%SZ", t) def parsetime(time_string): return parser.parse(time_string)
26.189189
164
0.739938
132
969
5.386364
0.606061
0.016878
0.022504
0
0
0
0
0
0
0
0
0.059902
0.155831
969
36
165
26.916667
0.809291
0.412797
0
0
0
0
0.056711
0
0
0
0
0
0
1
0.25
false
0
0.375
0.1875
0.875
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
1
1
0
0
4
f4539897032b3a442d18aaf152575488847266d7
1,458
py
Python
lapis/utilities/cache_cleanup_implementations.py
MatterMiners/lapis.caching
f03de0a174542a38e17fca1a9a5f44b09009444c
[ "MIT" ]
null
null
null
lapis/utilities/cache_cleanup_implementations.py
MatterMiners/lapis.caching
f03de0a174542a38e17fca1a9a5f44b09009444c
[ "MIT" ]
28
2020-10-20T09:45:43.000Z
2021-06-23T05:47:38.000Z
lapis/utilities/cache_cleanup_implementations.py
MatterMiners/lapis.caching
f03de0a174542a38e17fca1a9a5f44b09009444c
[ "MIT" ]
null
null
null
from typing import List, Iterable from lapis.caching.files import StoredFile def sort_files_by_cachedsince(stored_files: Iterable[StoredFile]) -> List[StoredFile]: return sorted(stored_files, key=lambda x: x.cachedsince) # async def fifo(size, storage): # print("hit fifo") # print(storage.files.keys()) # # FIFO, test different implementations # sorted_content = sorted( # list(storage.files.items()), key=lambda x: x.filespecs.cachedsince # ) # print("sorted", sorted_content) # while size < 0: # print("hit while") # size += sorted_content[0][1]["cachedsizeMB"] # storage.files.pop(sorted_content[0][0]) # await sleep(storage.placement_duration) # await storage._usedstorage.decrease( # **{"usedsize": sorted_content[0][1]["cachedsizeMB"]}) # print(storage.usedstorage) # sorted_content.pop(0) # print("after fifo ", storage.files.keys()) # # # def last_accessed(size, storage): # # FIFO, test different implementations # sorted_content = sorted( # list(storage.content.items()), key=lambda x: x[1]["lastaccessed"] # ) # while size < 0: # size += sorted_content[0][1]["cachedsizeMB"] # storage.content.pop(sorted_content[0][0]) # storage.usedstorage -= sorted_content[0][1]["cachedsizeMB"] # sorted_content.pop(0) # # # cache_cleanup = {"fifo": fifo, "lastaccessed": last_accessed}
33.906977
86
0.644033
167
1,458
5.497006
0.299401
0.155773
0.091503
0.065359
0.350763
0.217865
0.217865
0.135076
0.135076
0
0
0.014719
0.207819
1,458
42
87
34.714286
0.780087
0.794925
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.5
0.25
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
1
1
0
0
4
f4850be4e401b906f730dfeae51178ee257dfd7f
6,125
py
Python
Merged_Steps/complex_topol.py
lbfederico/gmx_scripts
c6c6faee2671c2612f69cc973e330836218692d5
[ "MIT" ]
2
2020-12-30T16:42:55.000Z
2021-05-22T01:06:59.000Z
Merged_Steps/complex_topol.py
lbfederico/gmx_scripts
c6c6faee2671c2612f69cc973e330836218692d5
[ "MIT" ]
null
null
null
Merged_Steps/complex_topol.py
lbfederico/gmx_scripts
c6c6faee2671c2612f69cc973e330836218692d5
[ "MIT" ]
1
2021-05-22T01:07:00.000Z
2021-05-22T01:07:00.000Z
import sys import argparse import textwrap #Função para encontrar numero da linha que contém o argumemnto desejado def get_line(txt): file = open('topol.top', encoding='utf8') for line_num, value in enumerate(file, 1): #le todas as linhas e valores do file começando como 1 if txt in value: #qdo encontra o 'txt' retorna o valor da linha return line_num if len(sys.argv) == 2 and sys.argv[1] == '-h': parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter, description=textwrap.dedent('''\ Este script deve ser rodado no diretorio em analise Ele cria o arquivo complex.gro e faz as adequações ao topol.top Usado para proteina e ligante ou proteina ligante e cofator sintaxe -> python3.9 complex.py prot_name lig_name cof_name as extensoes DEVEM ser adicionadas ao comando ''')) args = parser.parse_args() else: print('ERRO! em duvida acesse -h para help') if len(sys.argv) > 4: print('ERROR: Please put protein ligand and cofactor names or -h for help. ') #----------------------------------------------------------------------------------------------------- elif len(sys.argv) == 3: prot = sys.argv[1] lig = sys.argv[2] lig2 = lig.rsplit('.', 1)[0] # Abre arquivo e lê prot file = open(str(prot), 'r') prot = file.readlines() # Criar complex, parte1 -> prot sem box vector (only_prot) file = open('complex.gro', 'a+') only_prot = prot[2:-1] file.writelines([item for item in only_prot]) box_vector = prot[-1] file.close() # incluir ligante sem cabeçalho nem box vector -> incluir box vector # Abre arquivo e lê lig e complex file = open(str(lig), 'r') lig = file.readlines() lig_only = lig[2:-1] file = open('complex.gro', 'a+') file.writelines([item for item in lig_only]) file.writelines([item for item in box_vector]) file.close() # Verificar o numero de linhas (cont) e a linha2 - como esta sem cabeçalho o numero de moleculas é cont -1 file = open('complex.gro', 'r') line = file.readlines() cont = len(line) file.close() # Substituir o numero de linhas e o nome inicial file = open('complex.gro', 'w') file.write('complex' + '\n') file.write(str(cont - 1) + '\n') file = open('complex.gro', 'a') file.writelines(line) file.close() #-------------------------------------------------------------------------------------------- x = str('#include "./charmm36-mar2019.ff/forcefield.itp"') y = str('; Include Position restraint file') z = str('#mols') file = open('topol.top', 'r+', encoding='utf8') line = file.readlines() line.insert(get_line(x), f'\n; Include ligand parameters\n#include "{lig2}.prm"\n') file.seek(0) file.writelines(line) file = open('topol.top', 'r+', encoding='utf8') line = file.readlines() line.insert(get_line(y) + 4, f'; Include ligand topology\n#include "{lig2}.itp"\n\n') file.seek(0) file.writelines(line) file = open('topol.top', 'r+', encoding='utf8') line = file.readlines() line.insert(get_line(z) + 2, f'\n{lig2} 1\n') file.seek(0) file.writelines(line) #--------------------------------------------------------------------------------------------- elif len(sys.argv) == 4: prot = sys.argv[1] lig = sys.argv[2] cof = sys.argv[3] lig2 = lig.rsplit('.', 1)[0] cof2 = cof.rsplit('.', 1)[0] # Abre arquivo e lê prot file = open(str(prot), 'r') prot = file.readlines() #Criar complex, parte1 -> prot sem box vector (only_prot) file = open('complex.gro', 'a+') only_prot = prot[2:-1] file.writelines([item for item in only_prot]) box_vector = prot[-1] file.close() #incluir ligante sem cabeçalho nem box vector -> incluir box vector #Abre arquivo e lê lig e complex file = open(str(lig), 'r') lig = file.readlines() lig_only = lig[2:-1] file = open(str(cof), 'r') cof = file.readlines() cof_only = cof[2:-1] file = open('complex.gro', 'a+') file.writelines([item for item in lig_only]) file.writelines([item for item in cof_only]) file.writelines([item for item in box_vector]) file.close() #Verificar o numero de linhas (cont) e a linha2 - como esta sem cabeçalho o numero de moleculas é cont -1 file = open('complex.gro', 'r') line = file.readlines() cont = len(line) file.close() #Substituir o numero de linhas e o nome inicial file = open('complex.gro', 'w') file.write('complex' + '\n') file.write(str(cont -1)+ '\n') file = open('complex.gro', 'a') file.writelines(line) file.close() #----------------------------------------------------------------- x = str('#include "./charmm36-mar2019.ff/forcefield.itp"') y = str('; Include Position restraint file') z = str('#mols') # Abrir o topol.top -> Ler as linhas a add o argumento .prm file = open('topol.top', 'r+', encoding='utf8') line = file.readlines() line.insert(get_line(x), f'\n; Include ligand parameters\n#include "{lig2}.prm"\n#include "{cof2}.prm"\n') file.seek(0) file.writelines(line) # Abrir o topol.top -> Ler as linhas a add o argumento .itp file = open('topol.top', 'r+', encoding='utf8') line = file.readlines() line.insert(get_line(y) + 4, f'; Include ligand topology\n#include "{lig2}.itp"\n#include "{cof2}.itp"\n\n') file.seek(0) file.writelines(line) # Abrir o topol.top -> Ler as linhas a add o argumento numero de moleculas finais file = open('topol.top', 'r+', encoding='utf8') line = file.readlines() line.insert(get_line(z) + 2, f'\n{lig2} 1\n{cof2} 1\n') file.seek(0) file.writelines(line)
33.108108
112
0.558204
825
6,125
4.107879
0.204848
0.051933
0.044261
0.053113
0.7365
0.730009
0.730009
0.730009
0.699026
0.697846
0
0.018317
0.251265
6,125
184
113
33.288043
0.720672
0.224
0
0.7
0
0.016667
0.297612
0.025365
0
0
0
0
0
1
0.008333
false
0
0.025
0
0.041667
0.016667
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
f487a2bc86d5e618d190c36ba7d9e97598836bfc
34
py
Python
com_blacktensor/cop/news/covid/model/covid_news_ai.py
Jelly6489/Stock-Proj
3e7b1ad5cddc5b142f0069e024199fe969c7c7e8
[ "MIT" ]
null
null
null
com_blacktensor/cop/news/covid/model/covid_news_ai.py
Jelly6489/Stock-Proj
3e7b1ad5cddc5b142f0069e024199fe969c7c7e8
[ "MIT" ]
null
null
null
com_blacktensor/cop/news/covid/model/covid_news_ai.py
Jelly6489/Stock-Proj
3e7b1ad5cddc5b142f0069e024199fe969c7c7e8
[ "MIT" ]
2
2020-11-13T08:11:04.000Z
2020-11-14T05:32:09.000Z
class CovidNewsAi(object): ...
17
26
0.647059
3
34
7.333333
1
0
0
0
0
0
0
0
0
0
0
0
0.176471
34
2
27
17
0.785714
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
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
0
0
0
0
0
0
4
be3dfb92fdeead46fe39a674a5f7b522ae89245e
112
py
Python
201504/silsp4.py
conlee82/pythonstudy
c71bdd6404c0105a812043368f17b993a9d8a7c9
[ "Apache-2.0" ]
null
null
null
201504/silsp4.py
conlee82/pythonstudy
c71bdd6404c0105a812043368f17b993a9d8a7c9
[ "Apache-2.0" ]
null
null
null
201504/silsp4.py
conlee82/pythonstudy
c71bdd6404c0105a812043368f17b993a9d8a7c9
[ "Apache-2.0" ]
null
null
null
i=2 while i < 10: j=1 while j < 10: print(i,"*",j,"=",i*j) j += 1 i += 1
14
31
0.294643
19
112
1.736842
0.368421
0.121212
0
0
0
0
0
0
0
0
0
0.142857
0.5
112
8
32
14
0.446429
0
0
0
0
0
0.018868
0
0
0
0
0
0
1
0
false
0
0
0
0
0.142857
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4