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
cbe8529955050607cdbf1c4fa2197e1d61475e9e
920
py
Python
Robocze/zle/test_binaryTree.py
Damian9449/Python
dc9091e15356733821bbb6a768b7d5e428640340
[ "MIT" ]
1
2017-11-15T13:03:40.000Z
2017-11-15T13:03:40.000Z
Robocze/zle/test_binaryTree.py
Damian9449/Python
dc9091e15356733821bbb6a768b7d5e428640340
[ "MIT" ]
null
null
null
Robocze/zle/test_binaryTree.py
Damian9449/Python
dc9091e15356733821bbb6a768b7d5e428640340
[ "MIT" ]
null
null
null
#!/usr/bin/python import unittest from binaryTree import* class TestPoint(unittest.TestCase): def setUp(self): self.b1 = BinaryTree() self.b1.insert(8) self.b1.insert(4) self.b1.insert(12) self.b1.insert(2) self.b1.insert(6) self.b1.insert(10) self.b1.insert(14) self.b1.insert(15) self.b1.insert(16) def test_depth(self): self.assertEqual(self.b1.depth(), 5) def test_size(self): self.assertEqual(self.b1.size(), 9) def test_maximum(self): self.assertEqual(self.b1.maximum(), 16) def test_minimum(self): self.assertEqual(self.b1.minimum(), 2) def test_search(self): self.assertTrue(self.b1.search(8)) self.assertTrue(self.b1.search(8)) if __name__ == '__main__': unittest.main() # uruchamia wszystkie testy
22.439024
52
0.580435
118
920
4.415254
0.338983
0.184261
0.207294
0.176583
0.295585
0.103647
0
0
0
0
0
0.056317
0.28587
920
40
53
23
0.736682
0.045652
0
0.074074
0
0
0.009569
0
0
0
0
0
0.222222
1
0.222222
false
0
0.074074
0
0.333333
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
0
0
0
3
1dc17f6c93d77121ed293d5c5733172c8b63a46b
118
py
Python
main.py
rish-16/nam-pytorch
7c52537e6f31ee9532258c76c9cded501dcc7f5d
[ "MIT" ]
11
2021-05-30T17:28:47.000Z
2022-03-14T23:42:46.000Z
main.py
rish-16/nam-pytorch
7c52537e6f31ee9532258c76c9cded501dcc7f5d
[ "MIT" ]
null
null
null
main.py
rish-16/nam-pytorch
7c52537e6f31ee9532258c76c9cded501dcc7f5d
[ "MIT" ]
2
2021-06-10T13:38:55.000Z
2021-06-22T09:40:42.000Z
import torch from nam_pytorch import NAM nam = NAM(784, "tanh") x = torch.rand(32, 784) y = nam(x) print (y.shape)
13.111111
27
0.669492
22
118
3.545455
0.590909
0.153846
0
0
0
0
0
0
0
0
0
0.083333
0.186441
118
9
28
13.111111
0.729167
0
0
0
0
0
0.033613
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0.166667
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
1dfa96494f690d53cf9bda610985a9370f520423
109
py
Python
memento/timegate/__init__.py
pastpages/django-memento
c1849f1fb34bf629cad8f3a4dfa40bf1105ca72a
[ "MIT" ]
4
2015-08-05T02:58:33.000Z
2021-07-17T18:39:49.000Z
memento/timegate/__init__.py
pastpages/django-memento
c1849f1fb34bf629cad8f3a4dfa40bf1105ca72a
[ "MIT" ]
10
2015-05-10T02:41:19.000Z
2016-10-17T17:08:31.000Z
memento/timegate/__init__.py
pastpages/django-memento-framework
c1849f1fb34bf629cad8f3a4dfa40bf1105ca72a
[ "MIT" ]
null
null
null
from views import TimeGateView, MementoDetailView __all__ = ( "TimeGateView", "MementoDetailView" )
15.571429
49
0.733945
8
109
9.5
0.75
0.763158
0
0
0
0
0
0
0
0
0
0
0.183486
109
6
50
18.166667
0.853933
0
0
0
0
0
0.266055
0
0
0
0
0
0
1
0
false
0
0.2
0
0.2
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
3802ba03c5491976e515c7a7c16d963497d3d653
658
py
Python
tests/image/make_p_median3x3_data.py
duca/pal
44376ef5db13629268b319380104fac995f07009
[ "Apache-2.0" ]
349
2015-02-01T12:52:18.000Z
2022-03-26T20:53:38.000Z
tests/image/make_p_median3x3_data.py
duca/pal
44376ef5db13629268b319380104fac995f07009
[ "Apache-2.0" ]
163
2015-02-11T19:54:30.000Z
2017-01-30T09:19:50.000Z
tests/image/make_p_median3x3_data.py
duca/pal
44376ef5db13629268b319380104fac995f07009
[ "Apache-2.0" ]
158
2015-02-22T19:13:30.000Z
2020-11-27T12:38:04.000Z
#!/usr/bin/env python import numpy data = [ [-0.107358,-0.049577,+0.126623,-0.106948,-0.755809], [+0.051781,-0.265425,+0.548136,+0.051735,-0.026964], [+0.941475,-0.975603,+0.411370,+0.755263,-0.055232], [-0.770979,-0.360797,-0.476552,-0.656793,-0.346903], [+0.738044,-0.380252,-0.769260,+0.635805,-0.476552], ] def median3x3(input): out = [] for i in range(1, len(input) - 1): jout = [] for j in range(1, len(input[0]) - 1): tmp = numpy.median(input[i-1][j-1:j+2]+input[i][j-1:j+2]+input[i+1][j-1:j+2]) jout.append(tmp) out.append(jout) return out res=median3x3(data) for r in data: print r
26.32
89
0.585106
119
658
3.235294
0.436975
0.025974
0.023377
0.031169
0.166234
0.083117
0.057143
0
0
0
0
0.354244
0.176292
658
24
90
27.416667
0.356089
0.030395
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0.05
null
null
0.05
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
3
38181ea1c55e9507a9b6328e1b3795cb320aa8ed
219
py
Python
bfg9000/tools/cc/flags.py
thomasrockhu/bfg9000
1cd1226eab9bed2fc2ec6acccf7864fdcf2ed31a
[ "BSD-3-Clause" ]
72
2015-06-23T02:35:13.000Z
2021-12-08T01:47:40.000Z
bfg9000/tools/cc/flags.py
thomasrockhu/bfg9000
1cd1226eab9bed2fc2ec6acccf7864fdcf2ed31a
[ "BSD-3-Clause" ]
139
2015-03-01T18:48:17.000Z
2021-06-18T15:45:14.000Z
bfg9000/tools/cc/flags.py
thomasrockhu/bfg9000
1cd1226eab9bed2fc2ec6acccf7864fdcf2ed31a
[ "BSD-3-Clause" ]
19
2015-12-23T21:24:33.000Z
2022-01-06T04:04:41.000Z
from ... import options as opts optimize_flags = { opts.OptimizeValue.disable : '-O0', opts.OptimizeValue.size : '-Osize', opts.OptimizeValue.speed : '-O3', opts.OptimizeValue.linktime: '-flto', }
24.333333
42
0.648402
23
219
6.130435
0.695652
0.48227
0
0
0
0
0
0
0
0
0
0.011364
0.196347
219
8
43
27.375
0.789773
0
0
0
0
0
0.077626
0
0
0
0
0
0
1
0
false
0
0.142857
0
0.142857
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
381871675915c1cf6a5d3cfbba80f563bcddf640
4,376
py
Python
Simulated annealing/solver/neighbourGenerators/swapSpecialistTwoRandomMeetings.py
XavierCL/elementary-school-solver
2aef6f276d883bffbb9f456ace5778895078c66e
[ "MIT" ]
3
2020-04-08T02:32:31.000Z
2020-04-13T19:46:56.000Z
Simulated annealing/solver/neighbourGenerators/swapSpecialistTwoRandomMeetings.py
XavierCL/elementary-school-solver
2aef6f276d883bffbb9f456ace5778895078c66e
[ "MIT" ]
null
null
null
Simulated annealing/solver/neighbourGenerators/swapSpecialistTwoRandomMeetings.py
XavierCL/elementary-school-solver
2aef6f276d883bffbb9f456ace5778895078c66e
[ "MIT" ]
null
null
null
import solver.solutionInstance as solutionInstance import numpy as np import random def swapSpecialistTwoPeriods(self: solutionInstance.SolutionInstance): groupWithSwappedSpecialist = random.randrange(0, self.meetByPeriodByDayByLocalBySubjectByGroup.shape[0]) groupSpecialists = np.where(np.sum( self.meetByPeriodByDayByLocalBySubjectByGroup[groupWithSwappedSpecialist], axis=(1, 2, 3)) > 0)[0] if len(groupSpecialists) == 0: return None specialistWithSwappedGroup = random.choice(groupSpecialists) possibleFirstPeriods = np.where( self.meetByPeriodByDayByLocalBySubjectByGroup[groupWithSwappedSpecialist, specialistWithSwappedGroup]) firstPeriodSwap = random.randrange(0, len(possibleFirstPeriods[0])) firstLocal = possibleFirstPeriods[0][firstPeriodSwap] firstDay = possibleFirstPeriods[1][firstPeriodSwap] firstPeriod = possibleFirstPeriods[2][firstPeriodSwap] possibleSecondPeriodsNotTeachingGroup = np.where( np.sum(self.meetByPeriodByDayByLocalBySubjectByGroup[:, specialistWithSwappedGroup], axis=(0, 1)) == 0) possibleSecondPeriodsTeachingOtherGroups = np.where( np.concatenate([self.meetByPeriodByDayByLocalBySubjectByGroup[:groupWithSwappedSpecialist, specialistWithSwappedGroup, firstLocal], self.meetByPeriodByDayByLocalBySubjectByGroup[groupWithSwappedSpecialist + 1:, specialistWithSwappedGroup, firstLocal]])) if len(possibleSecondPeriodsNotTeachingGroup[0]) + len(possibleSecondPeriodsTeachingOtherGroups[0]) == 0: return None secondPeriodSwap = random.randrange(0, len(possibleSecondPeriodsNotTeachingGroup[0]) + len(possibleSecondPeriodsTeachingOtherGroups[0])) meetByPeriodByDayByLocalBySubjectByGroup = np.copy(self.meetByPeriodByDayByLocalBySubjectByGroup) if secondPeriodSwap < len(possibleSecondPeriodsNotTeachingGroup[0]): secondDay = possibleSecondPeriodsNotTeachingGroup[0][secondPeriodSwap] secondPeriod = possibleSecondPeriodsNotTeachingGroup[1][secondPeriodSwap] meetByPeriodByDayByLocalBySubjectByGroup[groupWithSwappedSpecialist, specialistWithSwappedGroup, firstLocal, firstDay, firstPeriod] = False meetByPeriodByDayByLocalBySubjectByGroup[groupWithSwappedSpecialist, specialistWithSwappedGroup, firstLocal, secondDay, secondPeriod] = True return solutionInstance.SolutionInstance(self.classesAndResources, meetByPeriodByDayByLocalBySubjectByGroup) else: secondPeriodSwap -= len(possibleSecondPeriodsNotTeachingGroup[0]) secondGroup = possibleSecondPeriodsTeachingOtherGroups[0][secondPeriodSwap] # Need to recalibrate extracted group if secondGroup >= groupWithSwappedSpecialist: secondGroup += 1 secondDay = possibleSecondPeriodsTeachingOtherGroups[1][secondPeriodSwap] secondPeriod = possibleSecondPeriodsTeachingOtherGroups[2][secondPeriodSwap] meetByPeriodByDayByLocalBySubjectByGroup[groupWithSwappedSpecialist, specialistWithSwappedGroup, firstLocal, firstDay, firstPeriod] = False meetByPeriodByDayByLocalBySubjectByGroup[groupWithSwappedSpecialist, specialistWithSwappedGroup, firstLocal, secondDay, secondPeriod] = True meetByPeriodByDayByLocalBySubjectByGroup[secondGroup, specialistWithSwappedGroup, firstLocal, firstDay, firstPeriod] = True meetByPeriodByDayByLocalBySubjectByGroup[secondGroup, specialistWithSwappedGroup, firstLocal, secondDay, secondPeriod] = False return solutionInstance.SolutionInstance(self.classesAndResources, meetByPeriodByDayByLocalBySubjectByGroup)
55.392405
116
0.663848
221
4,376
13.144796
0.226244
0.181756
0.190017
0.175559
0.413081
0.351807
0.185198
0.185198
0.185198
0.185198
0
0.009844
0.280393
4,376
79
117
55.392405
0.912671
0.007998
0
0.266667
0
0
0
0
0
0
0
0
0
1
0.016667
false
0
0.05
0
0.133333
0
0
0
1
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
38356f64de940ddd94838ec325370d0fde4d29a7
167
py
Python
docs/extension-guide.py
kant/frictionless-py
09cc98e1966d6f97f4eecb47757f45f8a946c5e7
[ "MIT" ]
null
null
null
docs/extension-guide.py
kant/frictionless-py
09cc98e1966d6f97f4eecb47757f45f8a946c5e7
[ "MIT" ]
null
null
null
docs/extension-guide.py
kant/frictionless-py
09cc98e1966d6f97f4eecb47757f45f8a946c5e7
[ "MIT" ]
null
null
null
from scripts import docs docs.from_notebook( source="https://colab.research.google.com/drive/1yj_1Nk8RwMTV2QZ-0RR_cbKN6aQQ5jAb", target="extension-guide", )
20.875
87
0.766467
21
167
5.952381
0.904762
0
0
0
0
0
0
0
0
0
0
0.04698
0.107784
167
7
88
23.857143
0.791946
0
0
0
0
0
0.526946
0
0
0
0
0
0
1
0
true
0
0.2
0
0.2
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
3
38434264b49a3b943295ee37f8f9ad30b5a5cf31
162
py
Python
tests/benchmarks/dict-methods/remove.py
abeaumont/Dictu
e7fe088ca12538582c836d4ddaf09120b2cd2810
[ "MIT" ]
116
2020-07-30T22:09:20.000Z
2022-03-09T11:08:10.000Z
tests/benchmarks/dict-methods/remove.py
abeaumont/Dictu
e7fe088ca12538582c836d4ddaf09120b2cd2810
[ "MIT" ]
130
2020-08-02T19:30:51.000Z
2022-03-27T01:13:50.000Z
tests/benchmarks/dict-methods/remove.py
abeaumont/Dictu
e7fe088ca12538582c836d4ddaf09120b2cd2810
[ "MIT" ]
50
2020-08-01T12:27:01.000Z
2022-02-24T03:46:52.000Z
import time x = {i: "Dictu is great!" for i in range(10000)} start = time.perf_counter() for i in range(10000): x.pop(i) print(time.perf_counter() - start)
18
48
0.666667
29
162
3.655172
0.551724
0.075472
0.113208
0.207547
0.301887
0
0
0
0
0
0
0.075188
0.179012
162
9
49
18
0.721805
0
0
0
0
0
0.092025
0
0
0
0
0
0
1
0
false
0
0.166667
0
0.166667
0.166667
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
0
0
0
0
0
3
384723f0575854cd326070a01165374d9e25f428
6,712
py
Python
scripts/patches/s3.py
compose-x/troposphere
9a94a8fafd8b4da1cd1f4239be0e7aa0681fd8d4
[ "BSD-2-Clause" ]
null
null
null
scripts/patches/s3.py
compose-x/troposphere
9a94a8fafd8b4da1cd1f4239be0e7aa0681fd8d4
[ "BSD-2-Clause" ]
null
null
null
scripts/patches/s3.py
compose-x/troposphere
9a94a8fafd8b4da1cd1f4239be0e7aa0681fd8d4
[ "BSD-2-Clause" ]
null
null
null
patches = [ { "op": "remove", "path": "/PropertyTypes/AWS::S3::StorageLens.S3BucketDestination/Properties/Encryption/Type", }, { "op": "add", "path": "/PropertyTypes/AWS::S3::StorageLens.S3BucketDestination/Properties/Encryption/PrimitiveType", "value": "Json", }, # Rename AWS::S3::StorageLens.DataExport to AWS::S3::StorageLens.StorageLensDataExport due to conflict with AWS::S3::Bucket.DataExport { "op": "move", "from": "/PropertyTypes/AWS::S3::StorageLens.DataExport", "path": "/PropertyTypes/AWS::S3::StorageLens.StorageLensDataExport", }, { "op": "replace", "path": "/PropertyTypes/AWS::S3::StorageLens.StorageLensConfiguration/Properties/DataExport/Type", "value": "StorageLensDataExport", }, # Rename AWS::S3::LifecycleConfiguration.Rule to AWS::S3::LifecycleConfiguration.LifecycleRule - backward compatibility { "op": "move", "from": "/PropertyTypes/AWS::S3::Bucket.Rule", "path": "/PropertyTypes/AWS::S3::Bucket.LifecycleRule", }, # backward compatibility { "op": "replace", "path": "/PropertyTypes/AWS::S3::Bucket.LifecycleConfiguration/Properties/Rules/ItemType", "value": "LifecycleRule", }, # Rename AWS::S3::Bucket.Transition to AWS::S3::Bucket.LifecycleRuleTransition - backward compatibility { "op": "move", "from": "/PropertyTypes/AWS::S3::Bucket.Transition", "path": "/PropertyTypes/AWS::S3::Bucket.LifecycleRuleTransition", }, # backward compatibility { "op": "replace", "path": "/PropertyTypes/AWS::S3::Bucket.LifecycleRule/Properties/Transition/Type", "value": "LifecycleRuleTransition", }, # backward compatibility { "op": "replace", "path": "/PropertyTypes/AWS::S3::Bucket.LifecycleRule/Properties/Transitions/ItemType", "value": "LifecycleRuleTransition", }, # Rename AWS::S3::Bucket.CorsRule to AWS::S3::Bucket.CorsRule - backward compatibility { "op": "move", "from": "/PropertyTypes/AWS::S3::Bucket.CorsRule", "path": "/PropertyTypes/AWS::S3::Bucket.CorsRules", }, # backward compatibility { "op": "replace", "path": "/PropertyTypes/AWS::S3::Bucket.CorsConfiguration/Properties/CorsRules/ItemType", "value": "CorsRules", }, # Rename AWS::S3::Bucket.FilterRule to AWS::S3::Bucket.Rules - backward compatibility { "op": "move", "from": "/PropertyTypes/AWS::S3::Bucket.FilterRule", "path": "/PropertyTypes/AWS::S3::Bucket.Rules", }, # backward compatibility { "op": "replace", "path": "/PropertyTypes/AWS::S3::Bucket.S3KeyFilter/Properties/Rules/ItemType", "value": "Rules", }, # Rename AWS::S3::Bucket.S3KeyFilter to AWS::S3::Bucket.S3Key - backward compatibility { "op": "move", "from": "/PropertyTypes/AWS::S3::Bucket.S3KeyFilter", "path": "/PropertyTypes/AWS::S3::Bucket.S3Key", }, # backward compatibility { "op": "replace", "path": "/PropertyTypes/AWS::S3::Bucket.NotificationFilter/Properties/S3Key/Type", "value": "S3Key", }, # Rename AWS::S3::Bucket.NotificationFilter to AWS::S3::Bucket.Filter - backward compatibility { "op": "move", "from": "/PropertyTypes/AWS::S3::Bucket.NotificationFilter", "path": "/PropertyTypes/AWS::S3::Bucket.Filter", }, # backward compatibility { "op": "replace", "path": "/PropertyTypes/AWS::S3::Bucket.LambdaConfiguration/Properties/Filter/Type", "value": "Filter", }, # backward compatibility { "op": "replace", "path": "/PropertyTypes/AWS::S3::Bucket.QueueConfiguration/Properties/Filter/Type", "value": "Filter", }, # backward compatibility { "op": "replace", "path": "/PropertyTypes/AWS::S3::Bucket.TopicConfiguration/Properties/Filter/Type", "value": "Filter", }, # Rename AWS::S3::Bucket.LambdaConfiguration to AWS::S3::Bucket.LambdaConfigurations - backward compatibility { "op": "move", "from": "/PropertyTypes/AWS::S3::Bucket.LambdaConfiguration", "path": "/PropertyTypes/AWS::S3::Bucket.LambdaConfigurations", }, # backward compatibility { "op": "replace", "path": "/PropertyTypes/AWS::S3::Bucket.NotificationConfiguration/Properties/LambdaConfigurations/ItemType", "value": "LambdaConfigurations", }, # Rename AWS::S3::Bucket.QueueConfigurations to AWS::S3::Bucket.QueueConfigurations - backward compatibility { "op": "move", "from": "/PropertyTypes/AWS::S3::Bucket.QueueConfiguration", "path": "/PropertyTypes/AWS::S3::Bucket.QueueConfigurations", }, # backward compatibility { "op": "replace", "path": "/PropertyTypes/AWS::S3::Bucket.NotificationConfiguration/Properties/QueueConfigurations/ItemType", "value": "QueueConfigurations", }, # Rename AWS::S3::Bucket.TopicConfiguration to AWS::S3::Bucket.TopicConfigurations - backward compatibility { "op": "move", "from": "/PropertyTypes/AWS::S3::Bucket.TopicConfiguration", "path": "/PropertyTypes/AWS::S3::Bucket.TopicConfigurations", }, # backward compatibility { "op": "replace", "path": "/PropertyTypes/AWS::S3::Bucket.NotificationConfiguration/Properties/TopicConfigurations/ItemType", "value": "TopicConfigurations", }, # Rename AWS::S3::Bucket.ReplicationDestination to AWS::S3::Bucket.ReplicationConfigurationRulesDestination - backward compatibility { "op": "move", "from": "/PropertyTypes/AWS::S3::Bucket.ReplicationDestination", "path": "/PropertyTypes/AWS::S3::Bucket.ReplicationConfigurationRulesDestination", }, # backward compatibility { "op": "replace", "path": "/PropertyTypes/AWS::S3::Bucket.ReplicationRule/Properties/Destination/Type", "value": "ReplicationConfigurationRulesDestination", }, # Rename AWS::S3::Bucket.ReplicationRule to AWS::S3::Bucket.ReplicationConfigurationRules - backward compatibility { "op": "move", "from": "/PropertyTypes/AWS::S3::Bucket.ReplicationRule", "path": "/PropertyTypes/AWS::S3::Bucket.ReplicationConfigurationRules", }, # backward compatibility { "op": "replace", "path": "/PropertyTypes/AWS::S3::Bucket.ReplicationConfiguration/Properties/Rules/ItemType", "value": "ReplicationConfigurationRules", }, ]
38.797688
138
0.626937
566
6,712
7.434629
0.10424
0.078422
0.149002
0.205323
0.684648
0.576759
0.552994
0.433935
0.399715
0.173241
0
0.014114
0.208284
6,712
172
139
39.023256
0.777757
0.236293
0
0.219178
0
0
0.627966
0.515003
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
384bad728136d89332a9c012ea9ff572672a3db2
11,408
py
Python
pysnmp/CISCO-COMMON-MGMT-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
11
2021-02-02T16:27:16.000Z
2021-08-31T06:22:49.000Z
pysnmp/CISCO-COMMON-MGMT-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
75
2021-02-24T17:30:31.000Z
2021-12-08T00:01:18.000Z
pysnmp/CISCO-COMMON-MGMT-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
10
2019-04-30T05:51:36.000Z
2022-02-16T03:33:41.000Z
# # PySNMP MIB module CISCO-COMMON-MGMT-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-COMMON-MGMT-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 17:36:17 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ValueSizeConstraint, ConstraintsIntersection, ValueRangeConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsIntersection", "ValueRangeConstraint", "ConstraintsUnion") ciscoMgmt, = mibBuilder.importSymbols("CISCO-SMI", "ciscoMgmt") SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString") usmNoPrivProtocol, usmNoAuthProtocol = mibBuilder.importSymbols("SNMP-USER-BASED-SM-MIB", "usmNoPrivProtocol", "usmNoAuthProtocol") ObjectGroup, ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "ModuleCompliance", "NotificationGroup") ModuleIdentity, TimeTicks, Counter64, Bits, MibScalar, MibTable, MibTableRow, MibTableColumn, MibIdentifier, Integer32, Unsigned32, Counter32, iso, NotificationType, ObjectIdentity, IpAddress, Gauge32, dod = mibBuilder.importSymbols("SNMPv2-SMI", "ModuleIdentity", "TimeTicks", "Counter64", "Bits", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "MibIdentifier", "Integer32", "Unsigned32", "Counter32", "iso", "NotificationType", "ObjectIdentity", "IpAddress", "Gauge32", "dod") TruthValue, StorageType, AutonomousType, DateAndTime, DisplayString, TextualConvention, RowStatus = mibBuilder.importSymbols("SNMPv2-TC", "TruthValue", "StorageType", "AutonomousType", "DateAndTime", "DisplayString", "TextualConvention", "RowStatus") ciscoCommonMgmtMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 9, 9, 443)) ciscoCommonMgmtMIB.setRevisions(('2008-06-13 00:00', '2005-06-23 00:00',)) if mibBuilder.loadTexts: ciscoCommonMgmtMIB.setLastUpdated('200806130000Z') if mibBuilder.loadTexts: ciscoCommonMgmtMIB.setOrganization('Cisco Systems Inc.') ciscoCommonMgmtNotifs = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 443, 0)) ciscoCommonMgmtMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 443, 1)) ciscoCommonMgmtMIBConform = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 443, 2)) ccmUserConfig = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 443, 1, 1)) ccmCommonMaxUsers = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 443, 1, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: ccmCommonMaxUsers.setStatus('current') ccmCommonUsers = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 443, 1, 1, 2), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: ccmCommonUsers.setStatus('current') ccmCommonUsersGlobalEnforcePriv = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 443, 1, 1, 3), TruthValue().clone('false')).setMaxAccess("readwrite") if mibBuilder.loadTexts: ccmCommonUsersGlobalEnforcePriv.setStatus('current') ccmCommonUserLastChange = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 443, 1, 1, 4), DateAndTime()).setMaxAccess("readonly") if mibBuilder.loadTexts: ccmCommonUserLastChange.setStatus('current') ccmCommonUserTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 443, 1, 1, 5), ) if mibBuilder.loadTexts: ccmCommonUserTable.setStatus('current') ccmCommonUserEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 443, 1, 1, 5, 1), ).setIndexNames((0, "CISCO-COMMON-MGMT-MIB", "ccmCommonUserName")) if mibBuilder.loadTexts: ccmCommonUserEntry.setStatus('current') ccmCommonUserName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 443, 1, 1, 5, 1, 1), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))) if mibBuilder.loadTexts: ccmCommonUserName.setStatus('current') ccmCommonUserPassword = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 443, 1, 1, 5, 1, 2), DisplayString().clone(hexValue="")).setMaxAccess("readcreate") if mibBuilder.loadTexts: ccmCommonUserPassword.setStatus('current') ccmCommonUserExpiryDate = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 443, 1, 1, 5, 1, 3), DateAndTime().clone(hexValue="0000000000000000000000")).setMaxAccess("readcreate") if mibBuilder.loadTexts: ccmCommonUserExpiryDate.setStatus('current') ccmCommonUserSshKeyFilename = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 443, 1, 1, 5, 1, 4), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 255)).clone(hexValue="")).setMaxAccess("readcreate") if mibBuilder.loadTexts: ccmCommonUserSshKeyFilename.setStatus('current') ccmCommonUserSshKeyConfigured = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 443, 1, 1, 5, 1, 5), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ccmCommonUserSshKeyConfigured.setStatus('current') ccmCommonUserSNMPAuthProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 443, 1, 1, 5, 1, 6), AutonomousType().clone((1, 3, 6, 1, 6, 3, 10, 1, 1, 1))).setMaxAccess("readcreate") if mibBuilder.loadTexts: ccmCommonUserSNMPAuthProtocol.setStatus('current') ccmCommonUserSNMPPrivProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 443, 1, 1, 5, 1, 7), AutonomousType().clone((1, 3, 6, 1, 6, 3, 10, 1, 2, 1))).setMaxAccess("readcreate") if mibBuilder.loadTexts: ccmCommonUserSNMPPrivProtocol.setStatus('current') ccmCommonUserCredType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 443, 1, 1, 5, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("none", 1), ("localCredentialStore", 2), ("remoteCredentialStore", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ccmCommonUserCredType.setStatus('current') ccmCommonUserStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 443, 1, 1, 5, 1, 9), StorageType().clone('nonVolatile')).setMaxAccess("readcreate") if mibBuilder.loadTexts: ccmCommonUserStorageType.setStatus('current') ccmCommonUserRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 443, 1, 1, 5, 1, 10), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: ccmCommonUserRowStatus.setStatus('current') ccmCommonUserRoleTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 443, 1, 1, 6), ) if mibBuilder.loadTexts: ccmCommonUserRoleTable.setStatus('current') ccmCommonUserRoleEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 443, 1, 1, 6, 1), ).setIndexNames((0, "CISCO-COMMON-MGMT-MIB", "ccmCommonUserName"), (0, "CISCO-COMMON-MGMT-MIB", "ccmCommonUserRoleName")) if mibBuilder.loadTexts: ccmCommonUserRoleEntry.setStatus('current') ccmCommonUserRoleName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 443, 1, 1, 6, 1, 1), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))) if mibBuilder.loadTexts: ccmCommonUserRoleName.setStatus('current') ccmCommonUserRoleStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 443, 1, 1, 6, 1, 2), StorageType().clone('nonVolatile')).setMaxAccess("readcreate") if mibBuilder.loadTexts: ccmCommonUserRoleStorageType.setStatus('current') ccmCommonUserRoleRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 443, 1, 1, 6, 1, 3), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: ccmCommonUserRoleRowStatus.setStatus('current') ccmCommonUserCacheTimeout = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 443, 1, 1, 7), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 86400))).setUnits('seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: ccmCommonUserCacheTimeout.setStatus('current') ciscoCommonMgmtMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 443, 2, 1)) ciscoCommonMgmtMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 443, 2, 2)) ciscoCommonMgmtMIBCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 443, 2, 1, 1)).setObjects(("CISCO-COMMON-MGMT-MIB", "ccmConfigurationGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoCommonMgmtMIBCompliance = ciscoCommonMgmtMIBCompliance.setStatus('obsolete') ciscoCommonMgmtMIBCompliance1 = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 443, 2, 1, 2)).setObjects(("CISCO-COMMON-MGMT-MIB", "ccmConfigurationGroup"), ("CISCO-COMMON-MGMT-MIB", "ccmCacheTimeoutConfigGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoCommonMgmtMIBCompliance1 = ciscoCommonMgmtMIBCompliance1.setStatus('current') ccmConfigurationGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 443, 2, 2, 1)).setObjects(("CISCO-COMMON-MGMT-MIB", "ccmCommonMaxUsers"), ("CISCO-COMMON-MGMT-MIB", "ccmCommonUsers"), ("CISCO-COMMON-MGMT-MIB", "ccmCommonUsersGlobalEnforcePriv"), ("CISCO-COMMON-MGMT-MIB", "ccmCommonUserLastChange"), ("CISCO-COMMON-MGMT-MIB", "ccmCommonUserPassword"), ("CISCO-COMMON-MGMT-MIB", "ccmCommonUserExpiryDate"), ("CISCO-COMMON-MGMT-MIB", "ccmCommonUserSshKeyFilename"), ("CISCO-COMMON-MGMT-MIB", "ccmCommonUserSshKeyConfigured"), ("CISCO-COMMON-MGMT-MIB", "ccmCommonUserSNMPAuthProtocol"), ("CISCO-COMMON-MGMT-MIB", "ccmCommonUserSNMPPrivProtocol"), ("CISCO-COMMON-MGMT-MIB", "ccmCommonUserCredType"), ("CISCO-COMMON-MGMT-MIB", "ccmCommonUserStorageType"), ("CISCO-COMMON-MGMT-MIB", "ccmCommonUserRowStatus"), ("CISCO-COMMON-MGMT-MIB", "ccmCommonUserRoleStorageType"), ("CISCO-COMMON-MGMT-MIB", "ccmCommonUserRoleRowStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ccmConfigurationGroup = ccmConfigurationGroup.setStatus('current') ccmCacheTimeoutConfigGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 443, 2, 2, 2)).setObjects(("CISCO-COMMON-MGMT-MIB", "ccmCommonUserCacheTimeout")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ccmCacheTimeoutConfigGroup = ccmCacheTimeoutConfigGroup.setStatus('current') mibBuilder.exportSymbols("CISCO-COMMON-MGMT-MIB", ccmCommonUserTable=ccmCommonUserTable, ccmCommonUserPassword=ccmCommonUserPassword, ccmCommonUserSNMPAuthProtocol=ccmCommonUserSNMPAuthProtocol, ccmCommonUserRoleStorageType=ccmCommonUserRoleStorageType, PYSNMP_MODULE_ID=ciscoCommonMgmtMIB, ccmCommonUsers=ccmCommonUsers, ciscoCommonMgmtMIB=ciscoCommonMgmtMIB, ccmCommonUserEntry=ccmCommonUserEntry, ciscoCommonMgmtMIBObjects=ciscoCommonMgmtMIBObjects, ccmConfigurationGroup=ccmConfigurationGroup, ccmCommonUserSNMPPrivProtocol=ccmCommonUserSNMPPrivProtocol, ccmCommonUserLastChange=ccmCommonUserLastChange, ccmCommonUserRoleName=ccmCommonUserRoleName, ciscoCommonMgmtMIBCompliance1=ciscoCommonMgmtMIBCompliance1, ciscoCommonMgmtMIBCompliances=ciscoCommonMgmtMIBCompliances, ccmCommonUserRoleTable=ccmCommonUserRoleTable, ccmCommonUserRoleEntry=ccmCommonUserRoleEntry, ccmCommonUserSshKeyConfigured=ccmCommonUserSshKeyConfigured, ccmUserConfig=ccmUserConfig, ciscoCommonMgmtMIBGroups=ciscoCommonMgmtMIBGroups, ccmCommonUserName=ccmCommonUserName, ccmCommonMaxUsers=ccmCommonMaxUsers, ccmCacheTimeoutConfigGroup=ccmCacheTimeoutConfigGroup, ccmCommonUserRowStatus=ccmCommonUserRowStatus, ciscoCommonMgmtMIBCompliance=ciscoCommonMgmtMIBCompliance, ccmCommonUserCredType=ccmCommonUserCredType, ccmCommonUserSshKeyFilename=ccmCommonUserSshKeyFilename, ciscoCommonMgmtNotifs=ciscoCommonMgmtNotifs, ciscoCommonMgmtMIBConform=ciscoCommonMgmtMIBConform, ccmCommonUserRoleRowStatus=ccmCommonUserRoleRowStatus, ccmCommonUsersGlobalEnforcePriv=ccmCommonUsersGlobalEnforcePriv, ccmCommonUserCacheTimeout=ccmCommonUserCacheTimeout, ccmCommonUserStorageType=ccmCommonUserStorageType, ccmCommonUserExpiryDate=ccmCommonUserExpiryDate)
132.651163
1,717
0.771914
1,208
11,408
7.288079
0.15149
0.00886
0.011926
0.015902
0.347456
0.28328
0.233076
0.201045
0.174012
0.172762
0
0.0668
0.078804
11,408
85
1,718
134.211765
0.770958
0.029453
0
0.052632
0
0
0.192895
0.093917
0
0
0
0
0
1
0
false
0.052632
0.118421
0
0.118421
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
3
384c984a66737ccb28d0f07147f3f25b8847a3a2
111
py
Python
render_order.py
dzendmitry/roguelike
e952f7b6ff11a99817438e1b17b98b30dd5bc61f
[ "BSD-2-Clause" ]
null
null
null
render_order.py
dzendmitry/roguelike
e952f7b6ff11a99817438e1b17b98b30dd5bc61f
[ "BSD-2-Clause" ]
null
null
null
render_order.py
dzendmitry/roguelike
e952f7b6ff11a99817438e1b17b98b30dd5bc61f
[ "BSD-2-Clause" ]
null
null
null
from enum import auto, Enum class RenderOrder(Enum): COPRSE = auto() ITEM = auto() ACTOR = auto()
15.857143
27
0.621622
14
111
4.928571
0.642857
0
0
0
0
0
0
0
0
0
0
0
0.261261
111
6
28
18.5
0.841463
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.2
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
0
0
1
0
0
3
6982db0bec08642a2d4c785a0cafee20f22423a8
223
py
Python
app/manage.py
brianbirir/flask-boilerplate
c454a824f31a9289a019f4b72f5cf382d9572e38
[ "MIT" ]
null
null
null
app/manage.py
brianbirir/flask-boilerplate
c454a824f31a9289a019f4b72f5cf382d9572e38
[ "MIT" ]
4
2019-04-24T09:48:34.000Z
2019-05-24T09:31:44.000Z
app/manage.py
brianbirir/flask-boilerplate
c454a824f31a9289a019f4b72f5cf382d9572e38
[ "MIT" ]
1
2019-08-28T10:48:46.000Z
2019-08-28T10:48:46.000Z
from flask_script import Manager from flask_migrate import MigrateCommand from src import create_app manager = Manager(create_app()) manager.add_command('db', MigrateCommand) if __name__ == '__main__': manager.run()
20.272727
41
0.784753
29
223
5.586207
0.586207
0.111111
0.197531
0
0
0
0
0
0
0
0
0
0.130045
223
10
42
22.3
0.835052
0
0
0
0
0
0.044843
0
0
0
0
0
0
1
0
false
0
0.428571
0
0.428571
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
699e25ec9631ae4c702eccf8b5f815ff2c2f9486
1,884
py
Python
src/eduid_scimapi/utils.py
fredrikt/eduid-scimapi
c1dfee8fa83e77228a2ffaf8547f4e03074e8d66
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
src/eduid_scimapi/utils.py
fredrikt/eduid-scimapi
c1dfee8fa83e77228a2ffaf8547f4e03074e8d66
[ "BSD-2-Clause-FreeBSD" ]
1
2020-11-12T08:51:52.000Z
2020-11-12T08:51:52.000Z
src/eduid_scimapi/utils.py
fredrikt/eduid-scimapi
c1dfee8fa83e77228a2ffaf8547f4e03074e8d66
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
import base64 from typing import AnyStr from uuid import uuid4 from bson import ObjectId def urlappend(base: str, path: str) -> str: """ :param base: Base url :param path: Path to join to base :return: Joined url Used instead of urlparse.urljoin to append path to base in an obvious way. >>> urlappend('https://test.com/base-path', 'my-path') 'https://test.com/base-path/my-path' >>> urlappend('https://test.com/base-path/', 'my-path') 'https://test.com/base-path/my-path' >>> urlappend('https://test.com/base-path/', '/my-path') 'https://test.com/base-path/my-path' >>> urlappend('https://test.com/base-path', '/my-path') 'https://test.com/base-path/my-path' >>> urlappend('https://test.com/base-path', '/my-path/') 'https://test.com/base-path/my-path/' """ path = path.lstrip('/') if not base.endswith('/'): base = '{!s}/'.format(base) return '{!s}{!s}'.format(base, path) def b64_encode(b: bytes) -> str: return base64.urlsafe_b64encode(b).decode('utf-8').strip('=') def b64_decode(data: AnyStr) -> bytes: if isinstance(data, str): _data = data.encode('utf-8') elif isinstance(data, bytes): _data = data else: raise ValueError('b64_decode needs either str or bytes') _data += b'=' * (len(_data) % 4) return base64.urlsafe_b64decode(_data) def filter_none(x): """ Recursively removes key, value pairs or items that is None. """ if isinstance(x, dict): return {k: filter_none(v) for k, v in x.items() if v is not None} elif isinstance(x, list): return [filter_none(i) for i in x if x is not None] else: return x def make_etag(version: ObjectId): return f'W/"{version}"' def get_unique_hash(): return str(uuid4()) def get_short_hash(entropy=10): return uuid4().hex[:entropy]
26.914286
78
0.620488
277
1,884
4.155235
0.32852
0.076455
0.104257
0.13901
0.264987
0.264987
0.264987
0.264987
0.264987
0.264987
0
0.016086
0.208068
1,884
69
79
27.304348
0.755362
0.360403
0
0.060606
0
0
0.067736
0
0
0
0
0
0
1
0.212121
false
0
0.121212
0.121212
0.606061
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
69b6d5fc80bac4029e47c258197828d41b409560
1,619
py
Python
finat/discontinuous.py
Justincrum/FInAT
c47206c14149fd5124eb34674e73ab93e42ea960
[ "MIT" ]
null
null
null
finat/discontinuous.py
Justincrum/FInAT
c47206c14149fd5124eb34674e73ab93e42ea960
[ "MIT" ]
null
null
null
finat/discontinuous.py
Justincrum/FInAT
c47206c14149fd5124eb34674e73ab93e42ea960
[ "MIT" ]
null
null
null
from gem.utils import cached_property from finat.finiteelementbase import FiniteElementBase class DiscontinuousElement(FiniteElementBase): """Element wrapper that makes a FInAT element discontinuous.""" def __init__(self, element): super(DiscontinuousElement, self).__init__() self.element = element @property def cell(self): return self.element.cell @property def degree(self): return self.element.degree @cached_property def formdegree(self): # Always discontinuous! return self.element.cell.get_spatial_dimension() @cached_property def _entity_dofs(self): result = {dim: {i: [] for i in entities} for dim, entities in self.cell.get_topology().items()} cell_dimension = self.cell.get_dimension() result[cell_dimension][0].extend(range(self.space_dimension())) return result def entity_dofs(self): return self._entity_dofs def space_dimension(self): return self.element.space_dimension() @property def index_shape(self): return self.element.index_shape @property def value_shape(self): return self.element.value_shape def basis_evaluation(self, order, ps, entity=None, coordinate_mapping=None): return self.element.basis_evaluation(order, ps, entity, coordinate_mapping=coordinate_mapping) def point_evaluation(self, order, refcoords, entity=None): return self.element.point_evaluation(order, refcoords, entity) @property def mapping(self): return self.element.mapping
28.403509
102
0.689314
186
1,619
5.806452
0.290323
0.112037
0.141667
0.116667
0.048148
0
0
0
0
0
0
0.000794
0.221742
1,619
56
103
28.910714
0.856349
0.049413
0
0.179487
0
0
0
0
0
0
0
0
0
1
0.307692
false
0
0.051282
0.25641
0.666667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
69ba56cb1ab1d7a991b7cc6e0712ccf961f4d432
657
py
Python
storages/s3_book_image.py
R-Mielamud/Nicolaus
05a28a19ca0127cf39b1238dc313cecd6e528c40
[ "MIT" ]
null
null
null
storages/s3_book_image.py
R-Mielamud/Nicolaus
05a28a19ca0127cf39b1238dc313cecd6e528c40
[ "MIT" ]
null
null
null
storages/s3_book_image.py
R-Mielamud/Nicolaus
05a28a19ca0127cf39b1238dc313cecd6e528c40
[ "MIT" ]
1
2021-03-09T16:06:23.000Z
2021-03-09T16:06:23.000Z
import os from django.core.files.storage import Storage from django.utils.deconstruct import deconstructible from helpers.s3 import S3BookImageUploader @deconstructible class S3BookImageStorage(Storage): def __init__(self, *args, **kwargs): self.uploader = S3BookImageUploader() super().__init__(*args, **kwargs) def _save(self, name, content): return self.uploader.upload(content, name) def url(self, name): return self.uploader.get_url(name) def get_available_name(self, name, **kwargs): file_root, file_ext = os.path.splitext(name) return self.get_alternative_name(file_root, file_ext)
31.285714
61
0.721461
81
657
5.62963
0.444444
0.078947
0.078947
0.065789
0
0
0
0
0
0
0
0.007407
0.178082
657
20
62
32.85
0.837037
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.25
0.125
0.75
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
69c4bcc265cdb2e9cba06d108b5ece934974b0f8
84
py
Python
exec23/models.py
flavio-brusamolin/learning-python
7cfdd35fe06d72d607131d2620b865d0cfa4781a
[ "MIT" ]
null
null
null
exec23/models.py
flavio-brusamolin/learning-python
7cfdd35fe06d72d607131d2620b865d0cfa4781a
[ "MIT" ]
null
null
null
exec23/models.py
flavio-brusamolin/learning-python
7cfdd35fe06d72d607131d2620b865d0cfa4781a
[ "MIT" ]
null
null
null
class Ball(object): color = str() circumference = float() brand = str()
16.8
27
0.583333
9
84
5.444444
0.888889
0
0
0
0
0
0
0
0
0
0
0
0.27381
84
4
28
21
0.803279
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
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
0
0
1
0
0
3
69c98c4ce4b0062bf1a779c07d84a31180e5495d
57
py
Python
flask_gcp_wand/secret/__init__.py
skxeve/flask_gcp_wand
cf9b6ed1806dcebb4d1e7618607697c2d690a843
[ "MIT" ]
null
null
null
flask_gcp_wand/secret/__init__.py
skxeve/flask_gcp_wand
cf9b6ed1806dcebb4d1e7618607697c2d690a843
[ "MIT" ]
null
null
null
flask_gcp_wand/secret/__init__.py
skxeve/flask_gcp_wand
cf9b6ed1806dcebb4d1e7618607697c2d690a843
[ "MIT" ]
null
null
null
from .secret_manager import Secret __all__ = ["Secret"]
14.25
34
0.754386
7
57
5.428571
0.714286
0
0
0
0
0
0
0
0
0
0
0
0.140351
57
3
35
19
0.77551
0
0
0
0
0
0.105263
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
69d658df41800ae3b6cc3a72ac82fb707cc43445
143
py
Python
2018/day-01/part1.py
amochtar/adventofcode
292e7f00a1e19d2149d00246b0a77fedfcd3bd08
[ "MIT" ]
1
2019-12-27T22:36:30.000Z
2019-12-27T22:36:30.000Z
2018/day-01/part1.py
amochtar/adventofcode
292e7f00a1e19d2149d00246b0a77fedfcd3bd08
[ "MIT" ]
null
null
null
2018/day-01/part1.py
amochtar/adventofcode
292e7f00a1e19d2149d00246b0a77fedfcd3bd08
[ "MIT" ]
null
null
null
def solve(input): print(sum(list(map(int, input)))) with open('input.txt', 'r') as f: input = f.read().splitlines() solve(input)
17.875
37
0.601399
22
143
3.909091
0.727273
0.232558
0
0
0
0
0
0
0
0
0
0
0.188811
143
7
38
20.428571
0.741379
0
0
0
0
0
0.06993
0
0
0
0
0
0
1
0.2
false
0
0
0
0.2
0.2
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
69da9c1e0a05adcec3930447c7223c70d9c5ca47
10,925
py
Python
project_re/model/MedClinical.py
pnarsina/w266_final
113cca1a3db752284e2c41f29b9e5757839b6843
[ "Apache-2.0" ]
null
null
null
project_re/model/MedClinical.py
pnarsina/w266_final
113cca1a3db752284e2c41f29b9e5757839b6843
[ "Apache-2.0" ]
null
null
null
project_re/model/MedClinical.py
pnarsina/w266_final
113cca1a3db752284e2c41f29b9e5757839b6843
[ "Apache-2.0" ]
null
null
null
import torch.nn as nn import math from transformers import BertModel import torch # from torchcrf import CRF import numpy as np from torch.autograd import Variable import torch.nn.functional as F from torch.nn import LayerNorm from .lsoftmax import LSoftmaxLinear as Lsoftmax class Biobert_fc(nn.Module): def custom_softmax(self, x): # print('In softmax function',x) y = x.cpu().detach().numpy() x = np.array([ [x1[7],x1[1],x1[2],x1[3],x1[4],x1[5],x1[6],x1[0],x1[8]] \ if ( (np.argmax(x1) == 0) and ( x1[0] - x1[7] < self.model_conf.cust_sftmx_class_beta)) else x1 for x1 in y]) means = np.mean(x, 1, keepdims=True)[0] x_exp = np.exp(x-means) x_exp_sum = np.sum(x_exp, 1, keepdims=True) final_value = torch.tensor(x_exp/x_exp_sum ) return torch.tensor(final_value, requires_grad=True) def __init__(self, device, model_config): super(Biobert_fc, self).__init__() self.model_conf = model_config if device == 'cuda': self.bert = nn.DataParallel(BertModel.from_pretrained("gsarti/biobert-nli")) self.linear1 = nn.DataParallel(nn.Linear(self.model_conf.bert_features, self.model_conf.label_classes)) self.dropout = nn.DataParallel(nn.Dropout(model_config.dropout)) if self.model_conf.act_function =="lsoftmax": self.lsoftmax = nn.DataParallel( Lsoftmax(self.model_conf.label_classes, self.model_conf.label_classes, margin=4, device = device)) else: self.bert = BertModel.from_pretrained("gsarti/biobert-nli") self.linear1 = nn.Linear(self.model_conf.bert_features, self.model_conf.label_classes) self.dropout = nn.Dropout(model_config.dropout) if self.model_conf.act_function =="lsoftmax": self.lsoftmax = Lsoftmax(self.model_conf.label_classes, self.model_conf.label_classes, margin=4, device = device) def forward(self, ids, segment_ids, mask): sequence_output, pooled_output = self.bert( ids, token_type_ids = segment_ids, attention_mask=mask) linear1_output = self.linear1(sequence_output[:,0,:].view(-1,self.model_conf.bert_features)) ## extract the 1st token's embeddings linear1_output = self.dropout(linear1_output) if self.model_conf.act_function =="softmax": out = torch.softmax(linear1_output, dim=1) elif self.model_conf.act_function =="cust_softmax": out = self.custom_softmax(linear1_output) elif self.model_conf.act_function =="lsoftmax": out = self.lsoftmax(linear1_output) return (out.squeeze()) class Biobert_cnn_fc(nn.Module): def __init__(self, device, model_config): super(Biobert_cnn_fc, self).__init__() self.model_conf = model_config # print('from model', self.model_conf.__dict__, 'in feature', self.model_conf.in_features_fc()) self.device = device if device == 'cuda': self.bert = nn.DataParallel(BertModel.from_pretrained("gsarti/biobert-nli")) #self.linear1 = nn.Linear(self.model_conf.bert_features, self.model_conf.label_classes) # Convolution layers definition self.conv_1 = nn.DataParallel(nn.Conv1d(self.model_conf.bert_features, self.model_conf.out_size, self.model_conf.kernel_1, self.model_conf.stride)) self.conv_2 = nn.DataParallel(nn.Conv1d(self.model_conf.bert_features, self.model_conf.out_size, self.model_conf.kernel_2, self.model_conf.stride)) self.conv_3 = nn.DataParallel(nn.Conv1d(self.model_conf.bert_features, self.model_conf.out_size, self.model_conf.kernel_3, self.model_conf.stride)) # Max pooling layers definition self.pool_1 = nn.DataParallel(nn.MaxPool1d(self.model_conf.kernel_1, self.model_conf.stride)) self.pool_2 = nn.DataParallel(nn.MaxPool1d(self.model_conf.kernel_2, self.model_conf.stride)) self.pool_3 = nn.DataParallel(nn.MaxPool1d(self.model_conf.kernel_3, self.model_conf.stride)) self.layer_norm = nn.DataParallel(LayerNorm(self.model_conf.in_features_fc())) # Fully connected layer definition #print("in_features_fc()", self.model_conf.in_features_fc()) self.fc = nn.DataParallel(nn.Linear(self.model_conf.in_features_fc(), self.model_conf.label_classes)) if self.model_conf.act_function =="lsoftmax": self.lsoftmax = nn.DataParallel(Lsoftmax(self.model_conf.label_classes, self.model_conf.label_classes, margin=4, device = device)) else: self.bert = BertModel.from_pretrained("gsarti/biobert-nli") #self.linear1 = nn.Linear(self.model_conf.bert_features, self.model_conf.label_classes) # Convolution layers definition self.conv_1 = nn.Conv1d(self.model_conf.bert_features, self.model_conf.out_size, self.model_conf.kernel_1, self.model_conf.stride) self.conv_2 = nn.Conv1d(self.model_conf.bert_features, self.model_conf.out_size, self.model_conf.kernel_2, self.model_conf.stride) self.conv_3 = nn.Conv1d(self.model_conf.bert_features, self.model_conf.out_size, self.model_conf.kernel_3, self.model_conf.stride) # Max pooling layers definition self.pool_1 = nn.MaxPool1d(self.model_conf.kernel_1, self.model_conf.stride) self.pool_2 = nn.MaxPool1d(self.model_conf.kernel_2, self.model_conf.stride) self.pool_3 = nn.MaxPool1d(self.model_conf.kernel_3, self.model_conf.stride) self.layer_norm = LayerNorm(self.model_conf.in_features_fc()) # Fully connected layer definition #print("in_features_fc()", self.model_conf.in_features_fc()) self.fc = nn.Linear(self.model_conf.in_features_fc(), self.model_conf.label_classes) if self.model_conf.act_function =="lsoftmax": self.lsoftmax = Lsoftmax(self.model_conf.label_classes, self.model_conf.label_classes, margin=4, device = device) #7 def custom_softmax(self, x): # print('In softmax function',x) y = x.cpu().detach().numpy() x = np.array([ [x1[7],x1[1],x1[2],x1[3],x1[4],x1[5],x1[6],x1[0],x1[8]] \ if ( (np.argmax(x1) == 0) and ( x1[0] - x1[7] < self.model_conf.cust_sftmx_class_beta)) else x1 for x1 in y]) means = np.mean(x, 1, keepdims=True)[0] x_exp = np.exp(x-means) x_exp_sum = np.sum(x_exp, 1, keepdims=True) final_value = torch.tensor(x_exp/x_exp_sum ) return torch.tensor(final_value, requires_grad=True, device = self.device) def forward(self, ids, segment_ids, mask): sequence_output, pooled_output = self.bert( ids, token_type_ids = segment_ids, attention_mask=mask) #print("sequence output type: ", type(sequence_output)) # print("sequence output shape: ", sequence_output.shape) x = sequence_output x = torch.transpose(x,1,2) # Convolution layer 1 is applied x1 = self.conv_1(x) x1 = torch.relu(x1) x1 = self.pool_1(x1) #print("x1 shape: ", x1.shape) # Convolution layer 2 is applied x2 = self.conv_2(x) x2 = torch.relu((x2)) x2 = self.pool_2(x2) #print("x2 shape: ", x2.shape) # Convolution layer 3 is applied x3 = self.conv_3(x) x3 = torch.relu(x3) x3 = self.pool_3(x3) # x3 = self.layer_norm(x3) #print("x3 shape: ", x3.shape) # The output of each convolutional layer is concatenated into a unique vector union = torch.cat((x1, x2, x3), 2) #print("union type: ", type(union)) #print("union shape: ", union.shape) union = union.reshape(union.size(0), -1) #print("union reshape type: ", type(union)) #print("union reshape shape: ", union.shape) union = self.layer_norm(union) # The "flattened" vector is passed through a fully connected layer out = self.fc(union) #print("out shape pre softmax", out.shape) # Activation function is applied if self.model_conf.act_function =="softmax": out = torch.softmax(out, dim=1) elif self.model_conf.act_function =="cust_softmax": out = self.custom_softmax(out) elif self.model_conf.act_function =="lsoftmax": out = self.lsoftmax(out) return (out.squeeze()) #print("out shape", out.squeeze().shape) # # Implement CRF layer on top of BERT # class Biobert_crf(nn.Module): # def __init__(self, device): # start_label_id =0 # stop_label_id = 8 # super(Biobert_crf, self).__init__() # self.model_conf = model_config() # if device == 'cuda2': # self.bert = nn.DataParallel(BertModel.from_pretrained("gsarti/biobert-nli")) # self.dropout = nn.DataParallel(torch.nn.Dropout(0.2)) # # Maps the output of the bert into label space. # self.hidden2label = nn.DataParallel(nn.Linear(self.model_conf.bert_features, self.model_conf.label_classes)) # self.crf = nn.DataParallel(CRF(self.model_conf.label_classes)) # else: # self.bert = BertModel.from_pretrained("gsarti/biobert-nli") # self.dropout = torch.nn.Dropout(0.2) # # Maps the output of the bert into label space. # self.hidden2label = nn.Linear(self.model_conf.bert_features, self.model_conf.label_classes) # self.crf = CRF(self.model_conf.label_classes) # # self.transitions = nn.Parameter(torch.randn(self.model_conf.label_classes, self.model_conf.label_classes)) # # self.transitions.data[start_label_id, :] = -10000 # # self.transitions.data[:, stop_label_id] = -10000 # def forward(self, ids, segment_ids, mask): # # tags = torch.tensor([ # # [0, 1], [2, 4], [3, 1],[7,8]], dtype=torch.long) # (seq_length, batch_size) # sequence_output, pooled_output = self.bert( # ids, # token_type_ids = segment_ids, # attention_mask=mask) # bert_seq_out = self.dropout(sequence_output) # bert_seq_out = self.dropout(bert_seq_out) # bert_feats = self.hidden2label(bert_seq_out) # print(bert_feats.shape) # x1 = self.crf.decode(bert_feats) # # print('shape:', np.array(x1).shape) # # print(x1) # return torch.Tensor(x1)
45.520833
159
0.626911
1,452
10,925
4.495868
0.11708
0.118566
0.171262
0.055147
0.741728
0.724418
0.714614
0.695159
0.66973
0.658701
0
0.022973
0.25492
10,925
240
160
45.520833
0.778993
0.308924
0
0.477876
0
0
0.022231
0
0
0
0
0
0
1
0.053097
false
0
0.079646
0
0.185841
0
0
0
0
null
0
0
0
0
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
69e1ec5c6f891e9549ecf58fc96af98b2741314e
675
py
Python
chibi/file/temp.py
dem4ply/chibi
1f13db8200e8e60bbb839436d4c995d6b6220957
[ "WTFPL" ]
null
null
null
chibi/file/temp.py
dem4ply/chibi
1f13db8200e8e60bbb839436d4c995d6b6220957
[ "WTFPL" ]
null
null
null
chibi/file/temp.py
dem4ply/chibi
1f13db8200e8e60bbb839436d4c995d6b6220957
[ "WTFPL" ]
null
null
null
import tempfile from .path import Chibi_path class Chibi_temp_path( Chibi_path ): def __new__( cls, *args, **kw ): args_2 = [] args_2.append( tempfile.mkdtemp() ) return str.__new__( cls, *args_2, **kw ) def __del__( self ): self.delete() def __add__( self, other ): return Chibi_path( str( self ) ) + other def temp_file( self, extension='' ): subffix = f'.{extension}' if extension else extension file_name = tempfile.mkstemp( suffix=subffix, dir=str( self ) )[1] return Chibi_path( file_name ) def temp_dir( self ): return Chibi_path( tempfile.mkdtemp( dir=str( self ) ) )
27
74
0.611852
86
675
4.453488
0.383721
0.117493
0.117493
0
0
0
0
0
0
0
0
0.008097
0.268148
675
24
75
28.125
0.767206
0
0
0
0
0
0.017778
0
0
0
0
0
0
1
0.294118
false
0
0.117647
0.117647
0.705882
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
69f07cb339230257661fd9c57ff525e4fb7a0036
150
py
Python
run.py
vitorhi/Detector-fake-news
7beba2b2a4c136573828093d39f186461fc4601d
[ "MIT" ]
null
null
null
run.py
vitorhi/Detector-fake-news
7beba2b2a4c136573828093d39f186461fc4601d
[ "MIT" ]
null
null
null
run.py
vitorhi/Detector-fake-news
7beba2b2a4c136573828093d39f186461fc4601d
[ "MIT" ]
null
null
null
from app import app import os port = int(os.environ.get("PORT", 5000)) if __name__ == '__main__': app.run(debug="True", host="0.0.0.0", port=port)
18.75
49
0.666667
27
150
3.407407
0.62963
0.065217
0.065217
0
0
0
0
0
0
0
0
0.061538
0.133333
150
8
49
18.75
0.646154
0
0
0
0
0
0.152318
0
0
0
0
0
0
1
0
false
0
0.4
0
0.4
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
69fedb153452c4357fef16bd3cc88c8c54c2465a
1,535
py
Python
yosai_dpcache/cache/proxybackend.py
YosaiProject/yosai_dpcache
85d2c2922165a12ea06315bcbb6a4d6f02729793
[ "Apache-2.0" ]
6
2015-11-23T15:25:35.000Z
2017-02-08T16:40:22.000Z
yosai_dpcache/cache/proxybackend.py
YosaiProject/yosai_dpcache
85d2c2922165a12ea06315bcbb6a4d6f02729793
[ "Apache-2.0" ]
null
null
null
yosai_dpcache/cache/proxybackend.py
YosaiProject/yosai_dpcache
85d2c2922165a12ea06315bcbb6a4d6f02729793
[ "Apache-2.0" ]
1
2019-07-04T09:38:18.000Z
2019-07-04T09:38:18.000Z
from yosai_dpcache.cache import ProxyBackend class SerializationProxy(ProxyBackend): def __init__(self, serialize, deserialize): """ serialization and de-serialization functionality is injected """ self.serialize = serialize self.deserialize = deserialize def get(self, key): serialized = self.proxied.get(key) return self.deserialize(serialized) def set(self, key, value, expiration): serialized = self.serialize(value) self.proxied.set(key, serialized, expiration) def get_multi(self, keys): multi_serialized = self.proxied.get_multi(keys) return {key: self.deserialize(value) for key, value in multi_serialized.items()} def set_multi(self, mapping, expiration): serialized_mapping = {key: self.serialize(value) for key, value in mapping.items()} self.proxied.set_multi(serialized_mapping, expiration) def delete(self, key): self.proxied.delete(key) def keys(self, pattern): return self.proxied.keys(pattern) def hmget(self, name, keys): return self.proxied.hmget(name, keys) def hmset(self, name, mapping, expiration): """ No serializing done for hmset, so this is just a passthrough. """ return self.proxied.hmset(name, mapping, expiration) def exists(self, key): return self.proxied.exists(key) # delete, delete_multi, and get_mutext operations are inherited
30.7
74
0.64886
175
1,535
5.605714
0.291429
0.100917
0.069317
0.04893
0.036697
0
0
0
0
0
0
0
0.256678
1,535
49
75
31.326531
0.859772
0.120521
0
0
0
0
0
0
0
0
0
0
0
1
0.344828
false
0
0.034483
0.103448
0.62069
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
0e119712774cd6e5d5cea5776ef1c29f8f7ed2c4
395
py
Python
v1/utils/functools.py
DucPhamTV/Bank
4905ec7d63ef4daafe2119bf6b32928d4db2d4f2
[ "MIT" ]
94
2020-07-12T23:08:47.000Z
2022-03-05T14:00:01.000Z
v1/utils/functools.py
DucPhamTV/Bank
4905ec7d63ef4daafe2119bf6b32928d4db2d4f2
[ "MIT" ]
84
2020-07-13T23:30:50.000Z
2022-03-15T15:47:46.000Z
v1/utils/functools.py
DucPhamTV/Bank
4905ec7d63ef4daafe2119bf6b32928d4db2d4f2
[ "MIT" ]
63
2020-07-13T02:46:51.000Z
2021-11-26T09:29:29.000Z
import functools def rgetattr(obj, attr, *args): """ Applies a dotted attribute string to given object and returns the value obj - Python object (ex: 'BankTransaction | ID: 1') attr - dotted attribute string (ex: 'block.sender') """ def _getattr(_obj, _attr): return getattr(_obj, _attr, *args) return functools.reduce(_getattr, [obj] + attr.split('.'))
24.6875
75
0.650633
49
395
5.122449
0.612245
0.111554
0.167331
0
0
0
0
0
0
0
0
0.003268
0.225316
395
15
76
26.333333
0.816993
0.44557
0
0
0
0
0.005128
0
0
0
0
0
0
1
0.4
false
0
0.2
0.2
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
38741e2510f6380f9de1426aad5dd78141429732
635
py
Python
classifier_procedure.py
kaan0821/Python-Handwriting-Recognition
f2af334390cbd546a4ed24bb098271f0f6198750
[ "Apache-2.0" ]
null
null
null
classifier_procedure.py
kaan0821/Python-Handwriting-Recognition
f2af334390cbd546a4ed24bb098271f0f6198750
[ "Apache-2.0" ]
null
null
null
classifier_procedure.py
kaan0821/Python-Handwriting-Recognition
f2af334390cbd546a4ed24bb098271f0f6198750
[ "Apache-2.0" ]
null
null
null
# Arda Mavi import joblib from sklearn import tree def createDecisionTree(): # Createing classifier: return tree.DecisionTreeClassifier() def getClassifier(): # Getting trained classifier: try: clf = joblib.load('Data/classifier/classifier.pkl') except: return None return clf def trainClassifier(clf, X, y): # Training classifier: return clf.fit(X, y) def getScore(clf, X, y): return clf.score(X, y) def getPredict(clf, img): # Get predict: return clf.predict(img) def saveClassifier(clf): # Save classifier: joblib.dump(clf, 'Data/classifier/classifier.pkl')
20.483871
59
0.677165
77
635
5.584416
0.480519
0.083721
0.111628
0.125581
0
0
0
0
0
0
0
0
0.215748
635
30
60
21.166667
0.863454
0.173228
0
0
0
0
0.11583
0.11583
0
0
0
0
0
1
0.333333
false
0
0.111111
0.222222
0.777778
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
38996b4ed346605932f5fe15f5ed443a0146eb1d
459
py
Python
app/admin.py
bane138/nonhumanuser
23db4f1544e5fc000618d56aa88d43f555e48034
[ "MIT" ]
null
null
null
app/admin.py
bane138/nonhumanuser
23db4f1544e5fc000618d56aa88d43f555e48034
[ "MIT" ]
8
2020-02-12T00:37:14.000Z
2021-09-22T17:41:18.000Z
app/admin.py
bane138/nonhumanuser
23db4f1544e5fc000618d56aa88d43f555e48034
[ "MIT" ]
null
null
null
from django.contrib import admin from django.contrib.auth.admin import UserAdmin as BaseUserAdmin from django.contrib.auth.models import User from app.models import Profile # Register your models here. class ProfileInline(admin.StackedInline): model = Profile can_delete = False verbose_name_plural = 'profile' class UserAdmin(admin.ModelAdmin): inlines = (ProfileInline, ) pass admin.site.unregister(User) admin.site.register(User, UserAdmin)
22.95
64
0.793028
59
459
6.118644
0.525424
0.083102
0.141274
0.116343
0
0
0
0
0
0
0
0
0.12854
459
19
65
24.157895
0.9025
0.056645
0
0
0
0
0.016241
0
0
0
0
0
0
1
0
false
0.076923
0.307692
0
0.769231
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
1
0
1
0
0
3
389e4513770ef8d933dfee7d1059da5abdb01516
152
py
Python
py/new/1.py
jeffreybreen/h2o
1d1bc87c13ca81e67f333fa6146959dc70af4d6c
[ "Apache-2.0" ]
1
2017-12-14T04:57:51.000Z
2017-12-14T04:57:51.000Z
py/new/1.py
hansight/h2o
d7eee8b69dd3538b83412989eee361d2a2883857
[ "Apache-2.0" ]
null
null
null
py/new/1.py
hansight/h2o
d7eee8b69dd3538b83412989eee361d2a2883857
[ "Apache-2.0" ]
1
2018-12-18T06:18:55.000Z
2018-12-18T06:18:55.000Z
import h2o_cloud, h2o_func h2o = h2o_cloud.build_cloud(3) h2o_func.put_file(path="/home/0xdiag/datasets/standard/covtype.data", key='covtype.hex')
16.888889
88
0.769737
25
152
4.44
0.68
0.144144
0
0
0
0
0
0
0
0
0
0.05036
0.085526
152
8
89
19
0.748201
0
0
0
0
0
0.36
0.286667
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
38ac2178cd32d80dfacbc2e02773669fb0444a59
203
py
Python
statistical_modeling/factories/acf.py
fedorpashin/statistical-modeling
2630e6811afca29cf8a616bab130ae7f9547a043
[ "MIT" ]
2
2021-05-21T15:29:05.000Z
2021-08-11T14:08:31.000Z
statistical_modeling/factories/acf.py
fedorpashin/statistical-modeling
2630e6811afca29cf8a616bab130ae7f9547a043
[ "MIT" ]
59
2021-08-11T14:08:36.000Z
2021-09-30T11:15:33.000Z
statistical_modeling/factories/acf.py
fedorpashin/statistical-modeling
2630e6811afca29cf8a616bab130ae7f9547a043
[ "MIT" ]
null
null
null
from ..sample import AnySample, SampleACF from final_class import final __all__ = [ 'ACF', ] @final class ACF: def __new__(cls, sample: AnySample, f: int): return SampleACF(sample, f)
15.615385
48
0.674877
26
203
4.923077
0.576923
0.15625
0
0
0
0
0
0
0
0
0
0
0.221675
203
12
49
16.916667
0.810127
0
0
0
0
0
0.014778
0
0
0
0
0
0
1
0.111111
false
0
0.222222
0.111111
0.555556
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
3
38b6be35e74576f1b9250729d5556be7100b6fc2
226
py
Python
PlayerState.py
LHGames-2017/superintelligence
bd9ea3d444e571a0f9607bf0f6799807f7e644ca
[ "MIT" ]
null
null
null
PlayerState.py
LHGames-2017/superintelligence
bd9ea3d444e571a0f9607bf0f6799807f7e644ca
[ "MIT" ]
null
null
null
PlayerState.py
LHGames-2017/superintelligence
bd9ea3d444e571a0f9607bf0f6799807f7e644ca
[ "MIT" ]
null
null
null
from abc import ABCMeta, abstractmethod from ServerCommands import * class PlayerState: """ Abstract class for player states """ __metaclass__ = ABCMeta def doAction(self): raise NotImplementedError()
17.384615
44
0.712389
22
226
7.136364
0.818182
0
0
0
0
0
0
0
0
0
0
0
0.221239
226
12
45
18.833333
0.892045
0.141593
0
0
0
0
0
0
0
0
0
0
0
1
0.166667
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
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
3
38ddcb0565875ac1809dd2913466ee9417f4fd66
210
py
Python
jumpscale_ms1/update.py
Jumpscale/play
c3ac8ef107748146e8fb615003a0081079e47c53
[ "Apache-2.0" ]
1
2015-10-26T10:38:30.000Z
2015-10-26T10:38:30.000Z
jumpscale_ms1/update.py
Jumpscale/play
c3ac8ef107748146e8fb615003a0081079e47c53
[ "Apache-2.0" ]
null
null
null
jumpscale_ms1/update.py
Jumpscale/play
c3ac8ef107748146e8fb615003a0081079e47c53
[ "Apache-2.0" ]
null
null
null
#fabric install script (not using jumpscale) from fabric.api import * @task def js(): """ update jumpscale """ run("jscode update -a jumpscale -r jp_jumpscale,jp_serverapps,jumpscale_core")
16.153846
82
0.685714
27
210
5.222222
0.740741
0
0
0
0
0
0
0
0
0
0
0
0.204762
210
12
83
17.5
0.844311
0.285714
0
0
0
0
0.537879
0.310606
0
0
0
0
0
1
0.25
true
0
0.25
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
0
0
0
0
0
3
c7f94cec34adf2fc126e4435144a375af59f4bd8
85
py
Python
src/quo/event.py
scalabli/quo
70b6d4129ee705930f1f8a792fc4c9247d973f9d
[ "MIT" ]
3
2022-03-13T13:22:35.000Z
2022-03-18T08:22:51.000Z
src/quo/event.py
scalabli/quo
70b6d4129ee705930f1f8a792fc4c9247d973f9d
[ "MIT" ]
1
2022-03-21T16:29:54.000Z
2022-03-21T16:29:54.000Z
src/quo/event.py
scalabli/quo
70b6d4129ee705930f1f8a792fc4c9247d973f9d
[ "MIT" ]
null
null
null
from quo.keys.key_binding.key_processor import KeyPressEvent Event = KeyPressEvent
17
60
0.847059
11
85
6.363636
0.818182
0
0
0
0
0
0
0
0
0
0
0
0.105882
85
4
61
21.25
0.921053
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
2a02d23e83c693fcf716cd9747e30f379a500bb6
117
py
Python
students.py
qqadadas/python0720
895c83f51a6cec5087cc9e661d5aefcc3e4650af
[ "Apache-2.0" ]
null
null
null
students.py
qqadadas/python0720
895c83f51a6cec5087cc9e661d5aefcc3e4650af
[ "Apache-2.0" ]
null
null
null
students.py
qqadadas/python0720
895c83f51a6cec5087cc9e661d5aefcc3e4650af
[ "Apache-2.0" ]
null
null
null
""" @author: lyh @time: 2020-08-15 @file:students @version:1.0 """ def func(): print("使用pycharm提交代码") func()
8.357143
26
0.606838
16
117
4.4375
0.9375
0
0
0
0
0
0
0
0
0
0
0.103093
0.17094
117
13
27
9
0.628866
0.495727
0
0
0
0
0.270833
0
0
0
0
0
0
1
0.333333
true
0
0
0
0.333333
0.333333
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
0
0
0
0
0
3
2a1495693f65011f6c4a217e4532f48ec585e5a9
147
py
Python
presenter/secret_config_sample.py
dkkline/CanSat14-15
153d7d5b20ecdfbb3c3e0a2d416ea79bdd4899d1
[ "MIT" ]
null
null
null
presenter/secret_config_sample.py
dkkline/CanSat14-15
153d7d5b20ecdfbb3c3e0a2d416ea79bdd4899d1
[ "MIT" ]
null
null
null
presenter/secret_config_sample.py
dkkline/CanSat14-15
153d7d5b20ecdfbb3c3e0a2d416ea79bdd4899d1
[ "MIT" ]
null
null
null
""" Contains configurations options so secret, that they may not even be commited to git! """ ADMIN_PASSWORD = "secret" SECRET_KEY = "secret key"
18.375
68
0.741497
21
147
5.095238
0.809524
0.168224
0
0
0
0
0
0
0
0
0
0
0.163265
147
7
69
21
0.869919
0.578231
0
0
0
0
0.296296
0
0
0
0
0
0
1
0
false
0.5
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
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
3
2a1e898c93b598bf38f43a1abef71f305ceac1cc
238
py
Python
tests/settings.py
jespino/django-sr
c3d6f3d498bf389b1a7157cfee32e69313fea5d3
[ "BSD-3-Clause" ]
1
2018-01-10T01:17:52.000Z
2018-01-10T01:17:52.000Z
tests/settings.py
jespino/django-sr
c3d6f3d498bf389b1a7157cfee32e69313fea5d3
[ "BSD-3-Clause" ]
null
null
null
tests/settings.py
jespino/django-sr
c3d6f3d498bf389b1a7157cfee32e69313fea5d3
[ "BSD-3-Clause" ]
2
2018-03-05T18:25:45.000Z
2019-01-31T16:48:43.000Z
SECRET_KEY = "123" INSTALLED_APPS = [ 'sr' ] SR = { 'test1': 'Test1', 'test2': { 'test3': 'Test3', }, 'test4': { 'test4': 'Test4 {0} {1}', }, 'test5': { 'test5': "<b>foo</b>", } }
12.526316
33
0.369748
22
238
3.909091
0.681818
0.232558
0
0
0
0
0
0
0
0
0
0.100671
0.37395
238
18
34
13.222222
0.47651
0
0
0
0
0
0.306723
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
2a2952da8ce0b48e88039515dc1345584195a890
93
py
Python
tests/functional/__init__.py
Belousova/ms-reservations
1030e05ba16cf95f4a056700e3d1a64f5da77bb5
[ "MIT" ]
4
2021-06-23T17:23:21.000Z
2022-02-04T12:28:37.000Z
tests/functional/__init__.py
Belousova/ms-reservations
1030e05ba16cf95f4a056700e3d1a64f5da77bb5
[ "MIT" ]
null
null
null
tests/functional/__init__.py
Belousova/ms-reservations
1030e05ba16cf95f4a056700e3d1a64f5da77bb5
[ "MIT" ]
7
2020-11-11T08:13:07.000Z
2021-12-18T15:23:44.000Z
# coding=utf-8 """ tests.functional.module ~~~~~~~~~~~~~~ Functional tests """
10.333333
27
0.494624
8
93
5.75
0.75
0
0
0
0
0
0
0
0
0
0
0.014085
0.236559
93
8
28
11.625
0.633803
0.752688
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
3
2a3b6b1b5d0ac4331721bb9cd05fdda7121bdcd8
1,111
py
Python
Relium/constant.py
Fairy-Phy/Relium
70ea037cea176f02e4768bde44dd5ee23af699b3
[ "MIT" ]
null
null
null
Relium/constant.py
Fairy-Phy/Relium
70ea037cea176f02e4768bde44dd5ee23af699b3
[ "MIT" ]
null
null
null
Relium/constant.py
Fairy-Phy/Relium
70ea037cea176f02e4768bde44dd5ee23af699b3
[ "MIT" ]
null
null
null
""" 変数(定数)置き場です 変数(定数) ---- zero_bpm : float -> 0BPMのタイミングポイントです、正確には0ではありませんがほぼ0です inf_bpm : float -> ∞BPM(10億BPM以上?)のタイミングポイントです max_offset : int -> 最大offset値です、空ノーツを生成するときにしか使い所がありません min_offset : str -> 最小offset値です、使い所がありません key_asset : List[List[int]] -> キーとポジションのリストです。1つ目がキーの値です、0, 11, 13, 15, 17, 19以上は非対応です。2つ目がポジションです、左を0として順番に並んでいます """ zero_bpm: float = 1E+100 inf_bpm: float = 1E-100 max_offset: int = 2147483647 min_offset: int = -2147483648 key_asset: list = [ [], [256], [128, 384], [85, 256, 426], [64, 192, 320, 448], [51, 153, 256, 358, 460], [42, 128, 213, 298, 384, 469], [42, 128, 213, 256, 329, 402, 475], [32, 96, 160, 224, 288, 352, 416, 480], [28, 85, 142, 199, 256, 312, 369, 426, 483], [25, 76, 128, 179, 230, 281, 332, 384, 435, 486], [], [21, 64, 106, 149, 192, 234, 277, 320, 362, 405, 448, 490], [], [18, 54, 91, 128, 164, 201, 237, 274, 310, 347, 384, 420, 457, 493], [], [16, 48, 80, 112, 144, 176, 208, 240, 272, 304, 336, 368, 400, 432, 464, 496], [], [14, 42, 71, 99, 128, 156, 184, 213, 241, 270, 298, 327, 384, 355, 412, 440, 469, 497] ]
21.784314
87
0.612061
178
1,111
3.769663
0.719101
0.04769
0.035768
0.038748
0
0
0
0
0
0
0
0.409545
0.189019
1,111
50
88
22.22
0.334073
0.345635
0
0.2
0
0
0
0
0
0
0
0
0
1
0
true
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
3
2a452f3e86783cb799e20c60473479778b939cb4
280
py
Python
ex007.py
jgabriel1607/Python
d6b75519eb8f0d4fef944e1690ba8914d81a5d16
[ "MIT" ]
null
null
null
ex007.py
jgabriel1607/Python
d6b75519eb8f0d4fef944e1690ba8914d81a5d16
[ "MIT" ]
null
null
null
ex007.py
jgabriel1607/Python
d6b75519eb8f0d4fef944e1690ba8914d81a5d16
[ "MIT" ]
null
null
null
print('Descubra a média de 2 notas: \nObs: Utilize ponto para separas as casas decimais.') a1 = float(input('Digite a nota da primeira avaliação: ')) a2 = float(input('Digite a nota da segunda avaliação: ')) m = (a1 + a2) / 2 print('A média das notas é igual a {:.1f}'.format(m))
46.666667
90
0.689286
48
280
4.020833
0.645833
0.062176
0.165803
0.176166
0.238342
0.238342
0
0
0
0
0
0.030043
0.167857
280
5
91
56
0.798283
0
0
0
0
0
0.671429
0
0
0
0
0
0
1
0
false
0
0
0
0
0.4
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
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
2a5c12675b58461a794a5aab8c6ba41da8029330
1,383
py
Python
src/model/date/date.py
PierreVieira/BrothersCoinsDataCollector
fe9cd8869227c33ba4ac964b134fa54e418de069
[ "MIT" ]
null
null
null
src/model/date/date.py
PierreVieira/BrothersCoinsDataCollector
fe9cd8869227c33ba4ac964b134fa54e418de069
[ "MIT" ]
null
null
null
src/model/date/date.py
PierreVieira/BrothersCoinsDataCollector
fe9cd8869227c33ba4ac964b134fa54e418de069
[ "MIT" ]
null
null
null
from datetime import datetime class Date: def __init__(self, date: datetime = None, date_dict: dict = None): self.__date_time = date if date is not None else datetime( year=date_dict['year'], month=date_dict['month'], day=date_dict['day'], hour=date_dict['hour'], minute=date_dict['minute'], second=date_dict['second'] ) @property def year(self): return self.__date_time.year @property def month(self): return self.__date_time.month @property def day(self): return self.__date_time.day @property def hour(self): return self.__date_time.hour @property def minute(self): return self.__date_time.minute @property def second(self): return self.__date_time.second def broken(self) -> dict: return { 'year': self.year, 'month': self.month, 'day': self.day, 'hour': self.hour, 'minute': self.minute, 'second': self.second } def cet_to_brl(self): self.__date_time += 3 def brl_to_cet(self): self.__date_time -= 3 def __add__(self, other: "Date"): self.__date_time += other.__date_time def __sub__(self, other): self.__date_time -= other.__date_time
22.672131
70
0.566884
167
1,383
4.323353
0.185629
0.144044
0.182825
0.149584
0.307479
0.124654
0
0
0
0
0
0.002137
0.32321
1,383
60
71
23.05
0.769231
0
0
0.130435
0
0
0.043415
0
0
0
0
0
0
1
0.26087
false
0
0.021739
0.152174
0.456522
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
3
2a69f644db9ba1fdefe448654c011f1bcc7b03a3
577
py
Python
lingvodoc/cache/basic/cache.py
EhrmannGit/lingvodoc
9c78f3f7272fd45ab0cfd9e670e55f54b97362df
[ "Apache-2.0" ]
1
2017-11-14T11:32:11.000Z
2017-11-14T11:32:11.000Z
lingvodoc/cache/basic/cache.py
IgorBMSTU/lingvodoc
54afdbc8b7380a092bb45e37c8719830a05ec722
[ "Apache-2.0" ]
null
null
null
lingvodoc/cache/basic/cache.py
IgorBMSTU/lingvodoc
54afdbc8b7380a092bb45e37c8719830a05ec722
[ "Apache-2.0" ]
null
null
null
__author__ = 'alexander' from dogpile.cache.api import NO_VALUE from lingvodoc.cache.api.cache import ICache class CommonCache(ICache): def __init__(self, region): """ :param region: dogpile region :return: """ self.cache = region def get(self, key): cached = self.cache.get(key) if cached is NO_VALUE: return None return cached # TODO: add try/catch handlers. def set(self, key, value): self.cache.set(key, value) def rem(self, key): self.cache.delete(key)
20.607143
44
0.596187
72
577
4.638889
0.458333
0.107784
0
0
0
0
0
0
0
0
0
0
0.30156
577
27
45
21.37037
0.828784
0.119584
0
0
0
0
0.018908
0
0
0
0
0.037037
0
1
0.266667
false
0
0.133333
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
0
0
0
0
0
0
0
null
0
0
1
0
0
1
0
0
0
0
1
0
0
3
2a6eedaef1354c2b0011f6ccf49917c0b0a577c5
373
py
Python
geokey/core/exceptions.py
universityofsussex/geokey
25e161dbc81841c57c148053dbe99facc81e84b8
[ "Apache-2.0" ]
null
null
null
geokey/core/exceptions.py
universityofsussex/geokey
25e161dbc81841c57c148053dbe99facc81e84b8
[ "Apache-2.0" ]
null
null
null
geokey/core/exceptions.py
universityofsussex/geokey
25e161dbc81841c57c148053dbe99facc81e84b8
[ "Apache-2.0" ]
null
null
null
"""Core exceptions.""" class Unauthenticated(Exception): """Thrown when user is not authenticated.""" pass class MalformedRequestData(Exception): """Thrown when request data is malformed.""" pass class InputError(Exception): """Thrown on input error.""" pass class FileTypeError(Exception): """Thrown on file type error.""" pass
14.346154
48
0.662198
39
373
6.333333
0.589744
0.242915
0.153846
0
0
0
0
0
0
0
0
0
0.211796
373
25
49
14.92
0.840136
0.386059
0
0.5
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
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
1
0
0
0
0
0
3
2a7e84bc059538bf41af72d168beb87f63894e61
282
py
Python
fixture/navigation.py
Khripach/python_training
041ea17d73b14258437cf845d06282604cbd85d1
[ "Apache-2.0" ]
null
null
null
fixture/navigation.py
Khripach/python_training
041ea17d73b14258437cf845d06282604cbd85d1
[ "Apache-2.0" ]
null
null
null
fixture/navigation.py
Khripach/python_training
041ea17d73b14258437cf845d06282604cbd85d1
[ "Apache-2.0" ]
null
null
null
class NavigationHelper: def __init__(self, app): self.app = app def open_home_page(self): wd = self.app.wd wd.get(self.app.base_url) def return_to_home_page(self): wd = self.app.wd wd.find_element_by_link_text("home").click()
20.142857
52
0.617021
42
282
3.809524
0.5
0.21875
0.15
0.175
0.3125
0.3125
0.3125
0.3125
0
0
0
0
0.269504
282
13
53
21.692308
0.776699
0
0
0.222222
0
0
0.014235
0
0
0
0
0
0
1
0.333333
false
0
0
0
0.444444
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
1
0
0
0
0
0
0
0
3
2a811cf64bc8612c156f2f6b2b37274779cef582
1,387
py
Python
pages/ajax_request_view.py
BloodLagbe/blood_lagbe
597fcabea3523c9932381c591f65c0a91cc5f74c
[ "Apache-2.0" ]
3
2021-04-24T16:30:09.000Z
2021-06-19T08:02:22.000Z
pages/ajax_request_view.py
BloodLagbe/blood_lagbe
597fcabea3523c9932381c591f65c0a91cc5f74c
[ "Apache-2.0" ]
16
2021-04-24T07:44:34.000Z
2021-04-28T17:12:25.000Z
pages/ajax_request_view.py
BloodLagbe/blood_lagbe
597fcabea3523c9932381c591f65c0a91cc5f74c
[ "Apache-2.0" ]
4
2021-04-24T23:42:51.000Z
2021-06-20T16:53:00.000Z
from django.shortcuts import render from accounts.models import User def ajax_request_filter(request): template = "pages/donor_filter.html" division_id = request.GET.get('division') district_id = request.GET.get('district') upazila_id = request.GET.get('upazila') blood_id = request.GET.get('blood') objects_list = User.objects.filter(is_active=True).order_by('-id') if division_id: if division_id == 0: objects_list = objects_list else: objects_list = objects_list.filter( profile__division__pk=division_id ) if district_id: if district_id == 0: objects_list = objects_list else: objects_list = objects_list.filter( profile__district__pk=district_id ) if upazila_id: if upazila_id == 0: objects_list = objects_list else: objects_list = objects_list.filter( profile__upazila__pk=upazila_id ) if blood_id: if blood_id == 0: objects_list = objects_list else: objects_list = objects_list.filter( profile__blood__pk=blood_id ) context = { 'objects_list': objects_list } print('----objects_list', objects_list) return render(request, template, context)
30.152174
70
0.602019
158
1,387
4.917722
0.234177
0.297297
0.23166
0.28314
0.329472
0.329472
0.329472
0.329472
0.329472
0.329472
0
0.004219
0.31651
1,387
45
71
30.822222
0.815401
0
0
0.285714
0
0
0.05912
0.016583
0
0
0
0
0
1
0.02381
false
0
0.047619
0
0.095238
0.02381
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
aa4bc86b9f2edfcfd87df089246ed5d82c255e3a
297
py
Python
Chapter05/ex5_6_3.py
MJC-code/thinkpython
c92702b64a174e85294b17d8bed870977007842b
[ "Unlicense" ]
null
null
null
Chapter05/ex5_6_3.py
MJC-code/thinkpython
c92702b64a174e85294b17d8bed870977007842b
[ "Unlicense" ]
null
null
null
Chapter05/ex5_6_3.py
MJC-code/thinkpython
c92702b64a174e85294b17d8bed870977007842b
[ "Unlicense" ]
null
null
null
import turtle bob = turtle.Turtle() def cesaro(t, x): """ Draws a Cesaro fractal with length x""" if x < 2: t.fd(x) return cesaro(t, x / 3) t.lt(85) cesaro(t, x / 3) t.rt(170) cesaro(t, x / 3) t.lt(85) cesaro(t, x / 3) cesaro(bob, 200)
14.142857
47
0.491582
51
297
2.862745
0.431373
0.239726
0.273973
0.246575
0.321918
0.315068
0.315068
0.315068
0.315068
0.315068
0
0.07772
0.350168
297
20
48
14.85
0.678756
0.121212
0
0.428571
0
0
0
0
0
0
0
0
0
1
0.071429
false
0
0.071429
0
0.214286
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
aa56026fe3106e2c17b261e622b61277f03c37e6
799
py
Python
tapis_cli/commands/taccapis/v2/apps/__init__.py
bpachev/tapis-cli
c3128fb5b63ef74e06b737bbd95ef28fb24f0d32
[ "BSD-3-Clause" ]
8
2020-10-18T22:48:23.000Z
2022-01-10T09:16:14.000Z
tapis_cli/commands/taccapis/v2/apps/__init__.py
bpachev/tapis-cli
c3128fb5b63ef74e06b737bbd95ef28fb24f0d32
[ "BSD-3-Clause" ]
238
2019-09-04T14:37:54.000Z
2020-04-15T16:24:24.000Z
tapis_cli/commands/taccapis/v2/apps/__init__.py
bpachev/tapis-cli
c3128fb5b63ef74e06b737bbd95ef28fb24f0d32
[ "BSD-3-Clause" ]
5
2019-09-20T04:23:49.000Z
2020-01-16T17:45:14.000Z
"""Apps service commands """ from tapis_cli.commands.taccapis.v2 import SERVICE_VERSION from .models import App, API_NAME from .show import AppsShow from .list import AppsList from .search import AppsSearch from .enable import AppsEnable from .disable import AppsDisable from .history import AppsHistory from .create import AppsCreate from .update import AppsUpdate from .pems_list import AppsPemsList from .pems_show import AppsPemsShow from .pems_grant import AppsPemsGrant from .pems_revoke import AppsPemsRevoke # The apps.deletePermissions method returns a 500 so command is disabled # from .pems_drop import AppsPemsDrop from .clone import AppsClone from .publish import AppsPublish from .unpublish import AppsUnpublish # Workflows from .deploy import AppsDeploy from .init import AppsInit
28.535714
72
0.831039
107
799
6.130841
0.560748
0.060976
0
0
0
0
0
0
0
0
0
0.005739
0.12766
799
27
73
29.592593
0.935438
0.173967
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
3
aa859bba5221f255ce931d7ac24e2530ee3b42ce
871
py
Python
tests/functional/tests/security/conftest.py
jfckm/ocf
f52ee37caa1ac6b9e98ca721061ee46d33a8b81a
[ "BSD-3-Clause-Clear" ]
null
null
null
tests/functional/tests/security/conftest.py
jfckm/ocf
f52ee37caa1ac6b9e98ca721061ee46d33a8b81a
[ "BSD-3-Clause-Clear" ]
null
null
null
tests/functional/tests/security/conftest.py
jfckm/ocf
f52ee37caa1ac6b9e98ca721061ee46d33a8b81a
[ "BSD-3-Clause-Clear" ]
null
null
null
# # Copyright(c) 2019 Intel Corporation # SPDX-License-Identifier: BSD-3-Clause-Clear # import os import sys from ctypes import ( c_uint64, c_uint32, c_uint16, c_int ) from tests.utils import get_random_strings, get_random_ints import pytest sys.path.append(os.path.join(os.path.dirname(__file__), os.path.pardir)) @pytest.fixture(params=get_random_ints(c_uint16)) def c_uint16_randomize(request): return request.param @pytest.fixture(params=get_random_ints(c_uint32)) def c_uint32_randomize(request): return request.param @pytest.fixture(params=get_random_ints(c_uint64)) def c_uint64_randomize(request): return request.param @pytest.fixture(params=get_random_ints(c_int)) def c_int_randomize(request): return request.param @pytest.fixture(params=get_random_strings()) def string_randomize(request): return request.param
19.795455
72
0.776119
129
871
4.968992
0.325581
0.098284
0.101404
0.171607
0.514821
0.461778
0.461778
0.410296
0.410296
0.410296
0
0.030065
0.121699
871
43
73
20.255814
0.807843
0.0907
0
0.192308
0
0
0
0
0
0
0
0
0
1
0.192308
false
0
0.192308
0.192308
0.576923
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
3
aa87e1dbe1d3ea5819438e924b8053cb7b29b509
112
py
Python
Corrections/keras_corr_1.py
Pumafi/geostats_deep_learning
3cc8b55678684e0a6d29e70cf9841e577e0e5ea1
[ "MIT" ]
null
null
null
Corrections/keras_corr_1.py
Pumafi/geostats_deep_learning
3cc8b55678684e0a6d29e70cf9841e577e0e5ea1
[ "MIT" ]
null
null
null
Corrections/keras_corr_1.py
Pumafi/geostats_deep_learning
3cc8b55678684e0a6d29e70cf9841e577e0e5ea1
[ "MIT" ]
null
null
null
output_size=128 activation='sigmoid' fc = keras.layers.Dense(output_size, activation=activation, use_bias=True)
28
74
0.821429
16
112
5.5625
0.75
0.224719
0
0
0
0
0
0
0
0
0
0.028571
0.0625
112
4
74
28
0.819048
0
0
0
0
0
0.061947
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
aa8e246d31a47f0c92f231d6de37db7c0d5c6830
229
py
Python
djangae/contrib/gauth/admin.py
oleksa-pavlenko/gae-django-project-template
2543d815378c185e422c58e5a5a65f82a0ed02e3
[ "MIT" ]
null
null
null
djangae/contrib/gauth/admin.py
oleksa-pavlenko/gae-django-project-template
2543d815378c185e422c58e5a5a65f82a0ed02e3
[ "MIT" ]
null
null
null
djangae/contrib/gauth/admin.py
oleksa-pavlenko/gae-django-project-template
2543d815378c185e422c58e5a5a65f82a0ed02e3
[ "MIT" ]
null
null
null
from django.contrib import admin # DJANGAE from djangae.contrib.gauth.models import ( GaeUser, GaeDatastoreUser, Group ) admin.site.register(GaeUser) admin.site.register(GaeDatastoreUser) admin.site.register(Group)
17.615385
42
0.772926
27
229
6.555556
0.481481
0.152542
0.288136
0
0
0
0
0
0
0
0
0
0.135371
229
12
43
19.083333
0.893939
0.030568
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.222222
0
0.222222
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
3
aa96ee1fa9c0f1873a9fd5a99bbb8927f4a3b196
145
py
Python
test/testapp_permissions/urls.py
jboegeholz/flask_urls
382fcf7763a3aa35c6e395e308546589318679d8
[ "MIT" ]
1
2021-06-21T15:18:51.000Z
2021-06-21T15:18:51.000Z
test/testapp_permissions/urls.py
jboegeholz/flask_urls
382fcf7763a3aa35c6e395e308546589318679d8
[ "MIT" ]
null
null
null
test/testapp_permissions/urls.py
jboegeholz/flask_urls
382fcf7763a3aa35c6e395e308546589318679d8
[ "MIT" ]
1
2021-09-25T15:29:45.000Z
2021-09-25T15:29:45.000Z
from test.testapp import views urls = [ ("/", views.index, ["GET"]), ("/users", views.get_users, ["GET"]), ("/home", "home.urls") ]
18.125
41
0.531034
17
145
4.470588
0.588235
0.210526
0
0
0
0
0
0
0
0
0
0
0.2
145
7
42
20.714286
0.655172
0
0
0
0
0
0.186207
0
0
0
0
0
0
1
0
false
0
0.166667
0
0.166667
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
aa9f635298e3081c7b08a03e698afc892fa594b5
1,183
py
Python
libs/python-axolotl/axolotl/tests/inmemorysessionstore.py
akshitpradhan/TomHack
837226e7b38de1140c19bc2d478eeb9e379ed1fd
[ "MIT" ]
4
2018-12-14T20:42:52.000Z
2022-02-15T07:52:44.000Z
libs/python-axolotl/axolotl/tests/inmemorysessionstore.py
akshitpradhan/TomHack
837226e7b38de1140c19bc2d478eeb9e379ed1fd
[ "MIT" ]
1
2019-09-19T00:46:55.000Z
2019-09-19T00:46:55.000Z
libs/python-axolotl/axolotl/tests/inmemorysessionstore.py
akshitpradhan/TomHack
837226e7b38de1140c19bc2d478eeb9e379ed1fd
[ "MIT" ]
2
2019-01-16T04:02:34.000Z
2020-02-26T20:46:19.000Z
# -*- coding: utf-8 -*- from ..state.sessionstore import SessionStore from ..state.sessionrecord import SessionRecord class InMemorySessionStore(SessionStore): def __init__(self): self.sessions = {} def loadSession(self, recepientId, deviceId): if self.containsSession(recepientId, deviceId): return SessionRecord(serialized=self.sessions[(recepientId, deviceId)]) else: return SessionRecord() def getSubDeviceSessions(self, recepientId): deviceIds = [] for k in self.sessions.keys(): if k[0] == recepientId: deviceIds.append(k[1]) return deviceIds def storeSession(self, recepientId, deviceId, sessionRecord): self.sessions[(recepientId, deviceId)] = sessionRecord.serialize() def containsSession(self, recepientId, deviceId): return (recepientId, deviceId) in self.sessions def deleteSession(self, recepientId, deviceId): del self.sessions[(recepientId, deviceId)] def deleteAllSessions(self, recepientId): for k in self.sessions.keys(): if k[0] == recepientId: del self.sessions[k]
31.131579
83
0.655114
113
1,183
6.823009
0.318584
0.22179
0.119326
0.120623
0.095979
0.095979
0.095979
0.095979
0.095979
0.095979
0
0.004459
0.241758
1,183
37
84
31.972973
0.855072
0.017751
0
0.153846
0
0
0
0
0
0
0
0
0
1
0.269231
false
0
0.076923
0.038462
0.538462
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
3
aab5d20f9d11f6a3bd99bd832fccf785fcd212db
251
wsgi
Python
django.wsgi
tianhuyang/fifty-market
613547a3446a59d9132b245a8cb8228f5eb0b0f9
[ "MIT" ]
null
null
null
django.wsgi
tianhuyang/fifty-market
613547a3446a59d9132b245a8cb8228f5eb0b0f9
[ "MIT" ]
null
null
null
django.wsgi
tianhuyang/fifty-market
613547a3446a59d9132b245a8cb8228f5eb0b0f9
[ "MIT" ]
null
null
null
import os import sys path = os.path.dirname(__file__) if path not in sys.path: sys.path.append(path) os.environ['DJANGO_SETTINGS_MODULE'] = 'market.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler()
22.818182
56
0.772908
37
251
5.081081
0.540541
0.111702
0.191489
0.234043
0
0
0
0
0
0
0
0
0.10757
251
11
57
22.818182
0.839286
0
0
0
0
0
0.146825
0.087302
0
0
0
0
0
1
0
false
0
0.375
0
0.375
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
0
0
0
3
aabe49f18fe8ef45e97222742698a329f7421aec
147
py
Python
en/A.py
epeios-q37/basics-exercises
98801d7ce462ead45bbec9a4b0d2b78631d62dc1
[ "MIT" ]
1
2019-07-23T15:36:51.000Z
2019-07-23T15:36:51.000Z
en/A.py
epeios-q37/programming-tutorial
98801d7ce462ead45bbec9a4b0d2b78631d62dc1
[ "MIT" ]
null
null
null
en/A.py
epeios-q37/programming-tutorial
98801d7ce462ead45bbec9a4b0d2b78631d62dc1
[ "MIT" ]
null
null
null
# coding: utf-8 import sys sys.path.append(".") from workshop.en.a import * display("Hello everyone!") display("How are you?") go()
12.25
28
0.619048
21
147
4.333333
0.857143
0
0
0
0
0
0
0
0
0
0
0.008621
0.210884
147
11
29
13.363636
0.775862
0.088435
0
0
0
0
0.231405
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
3
aabea7ca32046951a8aef7622d28db06ab252f57
136
py
Python
quiz/forms.py
sa-y-an/Qriosity2.0
f0a46533881a6a7f8cd548eadbc72570396b1141
[ "Apache-2.0" ]
null
null
null
quiz/forms.py
sa-y-an/Qriosity2.0
f0a46533881a6a7f8cd548eadbc72570396b1141
[ "Apache-2.0" ]
2
2020-06-30T16:28:26.000Z
2020-07-25T21:35:31.000Z
quiz/forms.py
sa-y-an/Qriosity2.0
f0a46533881a6a7f8cd548eadbc72570396b1141
[ "Apache-2.0" ]
4
2021-06-16T09:53:15.000Z
2021-09-18T07:40:31.000Z
from django import forms class UserAnswer(forms.Form): answer = forms.CharField( label="Your Answer Here", required=True)
19.428571
48
0.705882
17
136
5.647059
0.823529
0
0
0
0
0
0
0
0
0
0
0
0.198529
136
6
49
22.666667
0.880734
0
0
0
0
0
0.117647
0
0
0
0
0
0
1
0
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
0
0
0
0
0
1
0
0
3
aabf15fca5ca334834d10450ef8301a646a3f085
1,189
py
Python
tf_data/test_cases/test_taptap_importing_data.py
galaxy-captain/Deep-Learning
06f0f931c750db6267148f27f48ab5c0eb02abaa
[ "Apache-2.0" ]
6
2018-10-26T08:53:43.000Z
2019-06-19T15:32:45.000Z
tf_data/test_cases/test_taptap_importing_data.py
galaxy-captain/Deep-Learning
06f0f931c750db6267148f27f48ab5c0eb02abaa
[ "Apache-2.0" ]
9
2019-01-23T10:44:49.000Z
2019-01-30T14:16:10.000Z
tf_data/test_cases/test_taptap_importing_data.py
galaxy-captain/Deep-Learning
06f0f931c750db6267148f27f48ab5c0eb02abaa
[ "Apache-2.0" ]
12
2019-01-28T05:13:05.000Z
2019-02-21T07:42:47.000Z
#!/usr/bin/env python # encoding: utf-8 """ @version: v1.0.0 @author: tianhonghan @license: COPYRIGHT @ 2015 CHANGYOU.COM LIMITED @contact: tianhonghan@cyou-inc.com @site: http://www.changyou.com @software: Game Prophet System) @file: test_taptap_importing_data.py @time: 2018/12/16 18:43 """ from unittest import TestCase import pytest from tf_data.high_level_apis.logging_util import test_logger from tf_data.high_level_apis.taptap_importing_data import * class TestTaptap_importing_data(TestCase): @pytest.mark.skip(reason="no way of currnetly testing this") def test_dataset_iterator_test(self): pass # @pytest.mark.skip(reason="ignore") def test_dataset_list_files(self): dataset_list_files() test_logger.info("test_dataset_list_files is ok") def test_build_vocabulary(self): project_root = get_root_path() vocab_file_path = project_root + "/runs/taptap_review_vocab" build_vocabulary(dataset_list_files(),vocab_file_path) def test_load_vocabulary(self): project_root = get_root_path() vocab_file_path = project_root + "/runs/taptap_review_vocab" load_vocabulary(vocab_file_path)
29.725
68
0.743482
168
1,189
4.934524
0.5
0.033776
0.077201
0.033776
0.250905
0.250905
0.195416
0.195416
0.195416
0.195416
0
0.02
0.158957
1,189
39
69
30.487179
0.809
0.26577
0
0.210526
0
0
0.128621
0.084589
0
0
0
0
0
1
0.210526
false
0.052632
0.263158
0
0.526316
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
3
aac7838d0914e14a1b7115ea56a70a91ead87996
815
py
Python
app1/tasks.py
Yogi1994/task_queue
efd4fe977d9dfb3ebff2372d2ee1b7732b6769c1
[ "MIT" ]
null
null
null
app1/tasks.py
Yogi1994/task_queue
efd4fe977d9dfb3ebff2372d2ee1b7732b6769c1
[ "MIT" ]
null
null
null
app1/tasks.py
Yogi1994/task_queue
efd4fe977d9dfb3ebff2372d2ee1b7732b6769c1
[ "MIT" ]
null
null
null
from __future__ import absolute_import, unicode_literals from celery import task from celery import shared_task @shared_task def add(x, y): return x + y @shared_task def mul(x, y): return x * y @shared_task def xsum(numbers): return sum(numbers) import string from django.contrib.auth.models import User from django.utils.crypto import get_random_string @shared_task def create_random_user_accounts(total): print("start") print(total) for i in range(int(total)): username = 'user_{}'.format(get_random_string(10, string.ascii_letters)) email = '{}@example.com'.format(username) password = get_random_string(50) User.objects.create_user(username=username, email=email, password=password) return '{} random users created with success!'.format(total)
24.69697
83
0.728834
115
815
4.965217
0.46087
0.087566
0.091068
0.031524
0.08056
0.08056
0.08056
0.08056
0
0
0
0.005926
0.171779
815
33
84
24.69697
0.84
0
0
0.16
0
0
0.077206
0
0
0
0
0
0
1
0.16
false
0.08
0.24
0.12
0.56
0.08
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
1
1
0
0
3
2a9bf78a57dec543bab78a4b92ded01663f9f18b
153
py
Python
kitsune/landings/apps.py
theresnotime/kitsune
0757b267b0d332264167d31ce84e342263e1c635
[ "BSD-3-Clause" ]
null
null
null
kitsune/landings/apps.py
theresnotime/kitsune
0757b267b0d332264167d31ce84e342263e1c635
[ "BSD-3-Clause" ]
null
null
null
kitsune/landings/apps.py
theresnotime/kitsune
0757b267b0d332264167d31ce84e342263e1c635
[ "BSD-3-Clause" ]
null
null
null
from django.apps import AppConfig class LandingsConfig(AppConfig): name = "kitsune.landings" default_auto_field = "django.db.models.AutoField"
21.857143
53
0.764706
18
153
6.388889
0.888889
0
0
0
0
0
0
0
0
0
0
0
0.143791
153
6
54
25.5
0.877863
0
0
0
0
0
0.27451
0.169935
0
0
0
0
0
1
0
false
0
0.25
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
0
0
1
0
0
3
2aba098b78f32e932f2f39291c14515283628c4a
606
py
Python
groups/serializers.py
PUANEY/OnlineJudge
9756e0c7db82ce6882a07594364726be48530bd2
[ "MIT" ]
null
null
null
groups/serializers.py
PUANEY/OnlineJudge
9756e0c7db82ce6882a07594364726be48530bd2
[ "MIT" ]
null
null
null
groups/serializers.py
PUANEY/OnlineJudge
9756e0c7db82ce6882a07594364726be48530bd2
[ "MIT" ]
null
null
null
from .models import HomeWork, Groups from rest_framework import serializers class GroupsSerializer(serializers.ModelSerializer): create_time = serializers.DateTimeField(read_only=True, format='%Y-%m-%d') class Meta: model = Groups fields = "__all__" depth = 1 class HomeWorkSerializer(serializers.ModelSerializer): begin_time = serializers.DateTimeField(read_only=True, format='%Y-%m-%d') end_time = serializers.DateTimeField(read_only=True, format='%Y-%m-%d') group = GroupsSerializer() class Meta: model = HomeWork fields = "__all__"
27.545455
78
0.69802
67
606
6.089552
0.462687
0.110294
0.205882
0.235294
0.360294
0.360294
0.360294
0.360294
0.360294
0.360294
0
0.002045
0.193069
606
21
79
28.857143
0.832311
0
0
0.266667
0
0
0.062706
0
0
0
0
0
0
1
0
false
0
0.133333
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
0
0
1
0
0
3
2ac24010425a808f5103b103569586c83b9c4206
1,688
py
Python
cuenta/models.py
chelocastillo1/test
b783e64dbd3071c3ed074e9ce23da047e9bad97d
[ "CC0-1.0" ]
1
2021-12-12T22:27:52.000Z
2021-12-12T22:27:52.000Z
cuenta/models.py
chelocastillo1/test
b783e64dbd3071c3ed074e9ce23da047e9bad97d
[ "CC0-1.0" ]
null
null
null
cuenta/models.py
chelocastillo1/test
b783e64dbd3071c3ed074e9ce23da047e9bad97d
[ "CC0-1.0" ]
null
null
null
# Importamos el modelo User que vamos a heredar para crear nuestras cuentas de usuarios. from django.contrib.auth.models import User, Group from django.db import models #from django.conf import settings #User = settings.AUTH_USER_MODEL # Estas tres línes siguientes compensan el no poder hacer override sobre clases abstractas # User._meta.get_field('email')._unique = True # User._meta.get_field('email').blank = False # User._meta.get_field('email').null = False # Nos permitirá definir los tipos de usuarios en la web # class TipoUsuario(models.Model): # descripcion = models.TextField(required=True, max_length=50, unique=True) # Definimos el modelo Usuario el cual utilizaremos para iniciar sesión, publicar post, editarlos, etc. class Usuario(User):#(models.Model): # # class Meta: # proxy = True # no permite hacer override sobre clases abstractas, tales como AbstractUser #user = models.OneToOneField(User, on_delete=models.CASCADE) #email = models.EmailField(unique=True) # tipo = models.ForeignKey(TipoUsuario, on_delete=models.DO_NOTHING) def __str__(self): return self.get_username() # Devuelve True si el usuario tiene privilegios de <Administrador>. @property def EsAdministrador(self): return self.groups.filter(name = 'Administrador').exists() # Devuelve True si el usuario tiene privilegios de <Escritor>. @property def EsEscritor(self): return True #self.groups.filter(natural_key='Escritor').exists() # Devuelve True si el usuario tiene privilegios de <Lector>. @property def EsLector(self): return self.groups.filter(name = 'Lector').exists()
38.363636
102
0.725711
219
1,688
5.506849
0.493151
0.033168
0.027363
0.039801
0.270315
0.161692
0.11194
0.11194
0.077944
0
0
0.001445
0.180095
1,688
43
103
39.255814
0.869942
0.685427
0
0.214286
0
0
0.037475
0
0
0
0
0
0
1
0.285714
false
0
0.142857
0.285714
0.785714
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
2acdc164feeda1f3bbc6624bd940f1222ab94a95
184
py
Python
documents/phonetic.py
minhdua/my-vocabulary
cf9788b3a4d91089895275c7014a72b34c471277
[ "Apache-2.0" ]
null
null
null
documents/phonetic.py
minhdua/my-vocabulary
cf9788b3a4d91089895275c7014a72b34c471277
[ "Apache-2.0" ]
null
null
null
documents/phonetic.py
minhdua/my-vocabulary
cf9788b3a4d91089895275c7014a72b34c471277
[ "Apache-2.0" ]
null
null
null
from documents.base_models import AuditEntity class Phonetic(AuditEntity): def __init__(self, phonetic='', audio=''): self.phonetic = phonetic self.audio = audio
23
46
0.690217
20
184
6.1
0.6
0.196721
0
0
0
0
0
0
0
0
0
0
0.206522
184
7
47
26.285714
0.835616
0
0
0
0
0
0
0
0
0
0
0
0
1
0.2
false
0
0.2
0
0.6
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
3
2ad38365418f93b89e2220ba399fdae32306ad37
4,807
py
Python
server/employee.py
AakritiKinra/Employee-Management-System
ed92b8b7cb63d7c4f7a18ec5eec936de3beb0e3e
[ "MIT" ]
null
null
null
server/employee.py
AakritiKinra/Employee-Management-System
ed92b8b7cb63d7c4f7a18ec5eec936de3beb0e3e
[ "MIT" ]
null
null
null
server/employee.py
AakritiKinra/Employee-Management-System
ed92b8b7cb63d7c4f7a18ec5eec936de3beb0e3e
[ "MIT" ]
2
2021-05-03T14:52:59.000Z
2021-06-04T16:45:03.000Z
import sqlite3 as db conn=db.connect('employee.db') mycursor=conn.cursor() mycursor.execute("""CREATE TABLE official (id INT NOT NULL PRIMARY KEY, name VARCHAR(255) NOT NULL, join_date DATE NOT NULL, designation VARCHAR(255) NOT NULL, department VARCHAR(255) NOT NULL, monthly_salary DECIMAL(9,2) NOT NULL, email VARCHAR(255) NOT NULL, phone_num VARCHAR(255) NOT NULL);""") mycursor.execute("""CREATE TABLE salary (emp_id INT NOT NULL, monthly_salary DECIMAL(9,2) NOT NULL, bonus DECIMAL(9,2) NOT NULL DEFAULT 0,deduction DECIMAL(9,2) NOT NULL DEFAULT 0, FOREIGN KEY (emp_id) REFERENCES official(id));""") mycursor.execute("""CREATE TABLE attendance (emp_id INT NOT NULL, entry_time TIME, exit_time TIME, FOREIGN KEY (emp_id) REFERENCES official(id));""") mycursor.execute("""CREATE TABLE leaves (emp_id INT NOT NULL, leaves_allowed INT NOT NULL, leaves_taken INT NOT NULL, leaves_left INT NOT NULL, FOREIGN KEY (emp_id) REFERENCES official(id));""") mycursor.execute("""CREATE TABLE admin_login (admin_id INT NOT NULL, admin_username VARCHAR(255) NOT NULL PRIMARY KEY, admin_password VARCHAR(255) NOT NULL, FOREIGN KEY (admin_id) REFERENCES official(id));""") mycursor.execute("""CREATE TABLE emp_login (emp_id INT NOT NULL, emp_username VARCHAR(255) NOT NULL PRIMARY KEY, emp_password VARCHAR(255) NOT NULL, FOREIGN KEY (emp_id) REFERENCES official(id));""") #mycursor.execute("SHOW TABLES") #for x in mycursor: # print(x) mycursor.execute("INSERT INTO official VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')" % (101,"Druvin Sharma","20-03-19", "Officer","Sales", 25000,"druvin@gmail.com","9263836610") ) #employee mycursor.execute("INSERT INTO official VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')" % (102,"Rajeev Kumar","22-01-17", "Officer","HR",50000,"rajeev@gmail.com","80261196307")) mycursor.execute("INSERT INTO official VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')" % (103,"Rakesh Jain","01-01-20", "Officer","Finance", 15000,"rakesh@gmail.com","7291640091")) mycursor.execute("INSERT INTO official VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')" % (104,"Tanya Chawla","20-03-16", "Officer","HR", 50000,"tanya@gmail.com","9901532367")) mycursor.execute("INSERT INTO official VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')" % (105,"Tanuj Mahajan","20-03-19", "Officer","R&D", 75000,"tanuj@gmail.com","8804729581")) mycursor.execute("INSERT INTO official VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')" % (1101,"Samar Patel","01-03-10", "Admin","HR", 75000,"j@gmail.com","9320122854")) #admin #mycursor.execute("UPDATE official SET monthly_salary=25000.00 WHERE department='Sales'") #mycursor.execute("SELECT * FROM official") #myresult = mycursor.fetchall() #for x in myresult: # print(x) mycursor.execute("INSERT INTO salary (emp_id,monthly_salary,bonus) VALUES ('%s', '%s', '%s')" % (101,25000,5000)) mycursor.execute("INSERT INTO salary (emp_id,monthly_salary) VALUES ('%s', '%s')" % (102,50000)) mycursor.execute("INSERT INTO salary (emp_id,monthly_salary,bonus) VALUES ('%s', '%s', '%s')" % (103,15000,2500)) mycursor.execute("INSERT INTO salary (emp_id,monthly_salary,bonus) VALUES ('%s', '%s', '%s')" % (104,50000,2500)) mycursor.execute("INSERT INTO salary (emp_id,monthly_salary,bonus) VALUES ('%s', '%s', '%s')" % (105,75000,1000)) mycursor.execute("INSERT INTO attendance VALUES ('%s', '%s', '%s')" % (101,'08:00:54','17:30:00')) mycursor.execute("INSERT INTO attendance VALUES ('%s', '%s', '%s')" % (102,'08:15:38','18:10:11')) mycursor.execute("INSERT INTO attendance VALUES ('%s', '%s', '%s')" % (103,'07:30:43','17:15:15')) mycursor.execute("INSERT INTO leaves VALUES ('%s', '%s', '%s', '%s')" % (101,20,7,13)) mycursor.execute("INSERT INTO leaves VALUES ('%s', '%s', '%s', '%s')" % (102,20,5,15)) mycursor.execute("INSERT INTO leaves VALUES ('%s', '%s', '%s', '%s')" % (103,20,18,2)) mycursor.execute("INSERT INTO leaves VALUES ('%s', '%s', '%s', '%s')" % (104,40,21,19)) mycursor.execute("INSERT INTO leaves VALUES ('%s', '%s', '%s', '%s')" % (105,15,5,10)) mycursor.execute("INSERT INTO admin_login VALUES ('%s', '%s', '%s')" % (1101,'samar','sp_password')) mycursor.execute("INSERT INTO emp_login VALUES ('%s', '%s', '%s')" % (101,'druvin','ds_password')) mycursor.execute("INSERT INTO emp_login VALUES ('%s', '%s', '%s')" % (102,'rajeev','rk_password')) mycursor.execute("INSERT INTO emp_login VALUES ('%s', '%s', '%s')" % (103,'rakesh','rj_password')) mycursor.execute("INSERT INTO emp_login VALUES ('%s', '%s', '%s')" % (104,'tanya','tc_password')) mycursor.execute("INSERT INTO emp_login VALUES ('%s', '%s', '%s')" % (105,'tanuj','tm_password')) mycursor.close() conn.commit() conn.close()
78.803279
298
0.644269
711
4,807
4.288326
0.198312
0.0551
0.058052
0.045917
0.635946
0.568055
0.564119
0.508035
0.492293
0.409315
0
0.083551
0.12357
4,807
60
299
80.116667
0.640161
0.054088
0
0
0
0.324324
0.687018
0.030637
0
0
0
0
0
1
0
false
0.216216
0.027027
0
0.027027
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
0
1
0
0
0
0
0
3
2ad851bcb12ba050dba564e8d40b4f863c16f783
1,413
py
Python
bitvector.py
moredatarequired/bitfield-algebra
34c9febe334f4629db2124dbf5c9b144a3a169f2
[ "MIT" ]
null
null
null
bitvector.py
moredatarequired/bitfield-algebra
34c9febe334f4629db2124dbf5c9b144a3a169f2
[ "MIT" ]
null
null
null
bitvector.py
moredatarequired/bitfield-algebra
34c9febe334f4629db2124dbf5c9b144a3a169f2
[ "MIT" ]
null
null
null
import math from dataclasses import dataclass from typing import Tuple from bit_algebra import Bit @dataclass(frozen=True) class BitVector: """A vector of bits (such as byte) with known or unknown values.""" bits: Tuple[Bit] @staticmethod def new(name: str, size=8): return BitVector(bits=tuple(Bit(f"{name}{i}") for i in range(size))) @staticmethod def from_value(n: int, size=None): if size is None: size = math.ceil(math.log(n, 2)) return BitVector(tuple(Bit((n >> i) % 2) for i in range(size))) def __str__(self) -> str: return " ".join(str(b) for b in self.bits) def __len__(self): return len(self.bits) def __iter__(self): return iter(self.bits) def __getitem__(self, i: int) -> Bit: return self.bits[i] def __invert__(self): return BitVector(tuple(~b for b in self.bits)) def __and__(self, other): return BitVector(tuple(s & o for s, o in zip(self, other))) def __or__(self, other): return BitVector(tuple(s | o for s, o in zip(self, other))) def __xor__(self, other): return BitVector(tuple(s ^ o for s, o in zip(self, other))) def __lshift__(self, n: int): return BitVector(tuple([Bit(0)] * n + list(self.bits[:-n]))) def __rshift__(self, n: int): return BitVector(tuple(list(self.bits[n:]) + [Bit(0)] * n))
26.660377
76
0.611465
213
1,413
3.859155
0.300469
0.145985
0.170316
0.087591
0.341849
0.305353
0.237226
0.193431
0.193431
0.193431
0
0.004726
0.251239
1,413
52
77
27.173077
0.772212
0.043171
0
0.057143
0
0
0.007429
0
0
0
0
0
0
1
0.342857
false
0
0.114286
0.314286
0.857143
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
2ad8c59dcd2c685d0541fb1a88b5cf797fbb9623
1,381
py
Python
release/stubs.min/Autodesk/Revit/DB/__init___parts/LightingSource.py
YKato521/ironpython-stubs
b1f7c580de48528490b3ee5791b04898be95a9ae
[ "MIT" ]
null
null
null
release/stubs.min/Autodesk/Revit/DB/__init___parts/LightingSource.py
YKato521/ironpython-stubs
b1f7c580de48528490b3ee5791b04898be95a9ae
[ "MIT" ]
null
null
null
release/stubs.min/Autodesk/Revit/DB/__init___parts/LightingSource.py
YKato521/ironpython-stubs
b1f7c580de48528490b3ee5791b04898be95a9ae
[ "MIT" ]
null
null
null
class LightingSource(Enum, IComparable, IFormattable, IConvertible): """ Indicates the lighting scheme type in rendering settings. enum LightingSource,values: ExteriorArtificial (23),ExteriorSun (21),ExteriorSunAndArtificial (22),InteriorArtificial (26),InteriorSun (24),InteriorSunAndArtificial (25) """ def __eq__(self, *args): """ x.__eq__(y) <==> x==yx.__eq__(y) <==> x==yx.__eq__(y) <==> x==y """ pass def __format__(self, *args): """ __format__(formattable: IFormattable,format: str) -> str """ pass def __ge__(self, *args): pass def __gt__(self, *args): pass def __init__(self, *args): """ x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """ pass def __le__(self, *args): pass def __lt__(self, *args): pass def __ne__(self, *args): pass def __reduce_ex__(self, *args): pass def __str__(self, *args): pass ExteriorArtificial = None ExteriorSun = None ExteriorSunAndArtificial = None InteriorArtificial = None InteriorSun = None InteriorSunAndArtificial = None value__ = None
27.62
221
0.614048
141
1,381
5.340426
0.382979
0.106242
0.111554
0.119522
0.171315
0.171315
0.171315
0.150066
0.150066
0.150066
0
0.011811
0.264301
1,381
49
222
28.183673
0.729331
0.404055
0
0.357143
0
0
0
0
0
0
0
0
0
1
0.357143
false
0.357143
0
0
0.642857
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
3
2ade3af89ac386fd25af3da87e14c2f60b63340a
2,264
py
Python
tests/hw2/test_curry.py
mi-sts/spbu_python_homeworks
98cab295c7eef9710e6d122ab11cc5114342d795
[ "MIT" ]
null
null
null
tests/hw2/test_curry.py
mi-sts/spbu_python_homeworks
98cab295c7eef9710e6d122ab11cc5114342d795
[ "MIT" ]
null
null
null
tests/hw2/test_curry.py
mi-sts/spbu_python_homeworks
98cab295c7eef9710e6d122ab11cc5114342d795
[ "MIT" ]
null
null
null
import pytest from src.hw2.curry import curry_explicit, uncurry_explicit def test_curry(): function = lambda x, y, z: x + y - z curried_function = curry_explicit((lambda x, y, z: x + y - z), 3) assert curried_function(1)(3)(5) == function(1, 3, 5) def test_uncurry(): function = lambda x, y, z: x + y - z curried_function = curry_explicit(function, 3) uncurried_function = uncurry_explicit(curried_function, 3) assert uncurried_function(1, 3, 5) == function(1, 3, 5) def test_curry_uncurry(): curried_function = curry_explicit((lambda x, y, z: f"<{x},{y},{z}>"), 3) uncurried_function = uncurry_explicit(curried_function, 3) assert curried_function(123)(456)(562) == uncurried_function(123, 456, 562) def test_arbitrary_arity_freezing(): print_curried = curry_explicit(print, 2) assert print_curried(1)(2) is None def test_print_currying(capfd): print_curried = curry_explicit(print, 3) print_curried("qwe")("rty")("uiop") out, _ = capfd.readouterr() assert out == "qwe rty uiop\n" def test_curry_zero_arity(): function = lambda: "123" curried_function = curry_explicit(function, 0) assert curried_function == function def test_uncurry_zero_arity(): function = lambda: "123" curried_function = curry_explicit(function, 0) uncurried_function = uncurry_explicit(curried_function, 0) assert uncurried_function == function def test_curry_uncurry_zero_arity(): function = lambda: "123" curried_function = curry_explicit(function, 0) uncurried_function = uncurry_explicit(curried_function, 0) assert curried_function == uncurried_function def test_curry_one_arity(): function = lambda x: str(x) curried_function = curry_explicit(function, 1) assert curried_function == function def test_uncurry_one_arity(): function = lambda x: str(x) curried_function = curry_explicit(function, 1) uncurried_function = uncurry_explicit(curried_function, 1) assert uncurried_function == function def test_curry_uncurry_one_arity(): function = lambda x: str(x) curried_function = curry_explicit(function, 1) uncurried_function = uncurry_explicit(curried_function, 1) assert curried_function == uncurried_function
30.594595
79
0.723057
302
2,264
5.135762
0.145695
0.203095
0.116054
0.162476
0.78401
0.698904
0.698904
0.650548
0.573179
0.502257
0
0.0315
0.172703
2,264
73
80
31.013699
0.796583
0
0
0.509804
0
0
0.020318
0
0
0
0
0
0.215686
1
0.215686
false
0
0.039216
0
0.254902
0.098039
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
1
0
0
0
0
0
0
0
3
63001c761a1e78229dd27509a42661dbf770583a
289
py
Python
src/sentry/analytics/events/organization_joined.py
pierredup/sentry
0145e4b3bc0e775bf3482fe65f5e1a689d0dbb80
[ "BSD-3-Clause" ]
1
2019-10-17T17:46:16.000Z
2019-10-17T17:46:16.000Z
src/sentry/analytics/events/organization_joined.py
pierredup/sentry
0145e4b3bc0e775bf3482fe65f5e1a689d0dbb80
[ "BSD-3-Clause" ]
null
null
null
src/sentry/analytics/events/organization_joined.py
pierredup/sentry
0145e4b3bc0e775bf3482fe65f5e1a689d0dbb80
[ "BSD-3-Clause" ]
null
null
null
from __future__ import absolute_import from sentry import analytics class OrganizationJoinedEvent(analytics.Event): type = "organization.joined" attributes = (analytics.Attribute("user_id"), analytics.Attribute("organization_id")) analytics.register(OrganizationJoinedEvent)
22.230769
89
0.802768
28
289
8.035714
0.607143
0.16
0
0
0
0
0
0
0
0
0
0
0.110727
289
12
90
24.083333
0.875486
0
0
0
0
0
0.141869
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
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
3
6304c6e091e30747905b64d7aba470624f2a9429
48,800
py
Python
pysnmp-with-texts/BEGEMOT-PF-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
8
2019-05-09T17:04:00.000Z
2021-06-09T06:50:51.000Z
pysnmp-with-texts/BEGEMOT-PF-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
4
2019-05-31T16:42:59.000Z
2020-01-31T21:57:17.000Z
pysnmp-with-texts/BEGEMOT-PF-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
10
2019-04-30T05:51:36.000Z
2022-02-16T03:33:41.000Z
# # PySNMP MIB module BEGEMOT-PF-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/BEGEMOT-PF-MIB # Produced by pysmi-0.3.4 at Wed May 1 11:37:07 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueSizeConstraint, SingleValueConstraint, ValueRangeConstraint, ConstraintsUnion, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsUnion", "ConstraintsIntersection") begemot, = mibBuilder.importSymbols("BEGEMOT-MIB", "begemot") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") Gauge32, iso, MibScalar, MibTable, MibTableRow, MibTableColumn, ModuleIdentity, Bits, ObjectIdentity, Integer32, TimeTicks, Unsigned32, NotificationType, IpAddress, MibIdentifier, Counter32, Counter64 = mibBuilder.importSymbols("SNMPv2-SMI", "Gauge32", "iso", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ModuleIdentity", "Bits", "ObjectIdentity", "Integer32", "TimeTicks", "Unsigned32", "NotificationType", "IpAddress", "MibIdentifier", "Counter32", "Counter64") TextualConvention, DisplayString, TruthValue = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString", "TruthValue") begemotPf = ModuleIdentity((1, 3, 6, 1, 4, 1, 12325, 1, 200)) if mibBuilder.loadTexts: begemotPf.setLastUpdated('200501240000Z') if mibBuilder.loadTexts: begemotPf.setOrganization('NixSys BVBA') if mibBuilder.loadTexts: begemotPf.setContactInfo(' Philip Paeps Postal: NixSys BVBA Louizastraat 14 BE-2800 Mechelen Belgium E-Mail: philip@FreeBSD.org') if mibBuilder.loadTexts: begemotPf.setDescription('The Begemot MIB for the pf packet filter.') begemotPfObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1)) pfStatus = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 1)) pfCounter = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 2)) pfStateTable = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 3)) pfSrcNodes = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 4)) pfLimits = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 5)) pfTimeouts = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6)) pfLogInterface = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7)) pfInterfaces = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8)) pfTables = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9)) pfAltq = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 10)) pfStatusRunning = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 1, 1), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfStatusRunning.setStatus('current') if mibBuilder.loadTexts: pfStatusRunning.setDescription('True if pf is currently enabled.') pfStatusRuntime = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 1, 2), TimeTicks()).setUnits('1/100th of a Second').setMaxAccess("readonly") if mibBuilder.loadTexts: pfStatusRuntime.setStatus('current') if mibBuilder.loadTexts: pfStatusRuntime.setDescription('Indicates how long pf has been enabled. If pf is not currently enabled, indicates how long it has been disabled. If pf has not been enabled or disabled since the system was started, the value will be 0.') pfStatusDebug = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("none", 0), ("urgent", 1), ("misc", 2), ("loud", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: pfStatusDebug.setStatus('current') if mibBuilder.loadTexts: pfStatusDebug.setDescription('Indicates the debug level at which pf is running.') pfStatusHostId = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 1, 4), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfStatusHostId.setStatus('current') if mibBuilder.loadTexts: pfStatusHostId.setDescription('The (unique) host identifier of the machine running pf.') pfCounterMatch = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 2, 1), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfCounterMatch.setStatus('current') if mibBuilder.loadTexts: pfCounterMatch.setDescription('Number of packets that matched a filter rule.') pfCounterBadOffset = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 2, 2), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfCounterBadOffset.setStatus('current') if mibBuilder.loadTexts: pfCounterBadOffset.setDescription('Number of packets with bad offset.') pfCounterFragment = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 2, 3), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfCounterFragment.setStatus('current') if mibBuilder.loadTexts: pfCounterFragment.setDescription('Number of fragmented packets.') pfCounterShort = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 2, 4), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfCounterShort.setStatus('current') if mibBuilder.loadTexts: pfCounterShort.setDescription('Number of short packets.') pfCounterNormalize = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 2, 5), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfCounterNormalize.setStatus('current') if mibBuilder.loadTexts: pfCounterNormalize.setDescription('Number of normalized packets.') pfCounterMemDrop = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 2, 6), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfCounterMemDrop.setStatus('current') if mibBuilder.loadTexts: pfCounterMemDrop.setDescription('Number of packets dropped due to memory limitations.') pfStateTableCount = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 3, 1), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfStateTableCount.setStatus('current') if mibBuilder.loadTexts: pfStateTableCount.setDescription('Number of entries in the state table.') pfStateTableSearches = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 3, 2), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfStateTableSearches.setStatus('current') if mibBuilder.loadTexts: pfStateTableSearches.setDescription('Number of searches against the state table.') pfStateTableInserts = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 3, 3), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfStateTableInserts.setStatus('current') if mibBuilder.loadTexts: pfStateTableInserts.setDescription('Number of entries inserted into the state table.') pfStateTableRemovals = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 3, 4), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfStateTableRemovals.setStatus('current') if mibBuilder.loadTexts: pfStateTableRemovals.setDescription('Number of entries removed from the state table.') pfSrcNodesCount = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 4, 1), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfSrcNodesCount.setStatus('current') if mibBuilder.loadTexts: pfSrcNodesCount.setDescription('Number of entries in the source tracking table.') pfSrcNodesSearches = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 4, 2), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfSrcNodesSearches.setStatus('current') if mibBuilder.loadTexts: pfSrcNodesSearches.setDescription('Number of searches against the source tracking table.') pfSrcNodesInserts = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 4, 3), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfSrcNodesInserts.setStatus('current') if mibBuilder.loadTexts: pfSrcNodesInserts.setDescription('Number of entries inserted into the source tracking table.') pfSrcNodesRemovals = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 4, 4), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfSrcNodesRemovals.setStatus('current') if mibBuilder.loadTexts: pfSrcNodesRemovals.setDescription('Number of entries removed from the source tracking table.') pfLimitsStates = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 5, 1), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfLimitsStates.setStatus('current') if mibBuilder.loadTexts: pfLimitsStates.setDescription("Maximum number of 'keep state' rules in the ruleset.") pfLimitsSrcNodes = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 5, 2), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfLimitsSrcNodes.setStatus('current') if mibBuilder.loadTexts: pfLimitsSrcNodes.setDescription("Maximum number of 'sticky-address' or 'source-track' rules in the ruleset.") pfLimitsFrags = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 5, 3), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfLimitsFrags.setStatus('current') if mibBuilder.loadTexts: pfLimitsFrags.setDescription("Maximum number of 'scrub' rules in the ruleset.") pfTimeoutsTcpFirst = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTimeoutsTcpFirst.setStatus('current') if mibBuilder.loadTexts: pfTimeoutsTcpFirst.setDescription('State after the first packet in a connection.') pfTimeoutsTcpOpening = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTimeoutsTcpOpening.setStatus('current') if mibBuilder.loadTexts: pfTimeoutsTcpOpening.setDescription('State before the destination host ever sends a packet.') pfTimeoutsTcpEstablished = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTimeoutsTcpEstablished.setStatus('current') if mibBuilder.loadTexts: pfTimeoutsTcpEstablished.setDescription('The fully established state.') pfTimeoutsTcpClosing = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTimeoutsTcpClosing.setStatus('current') if mibBuilder.loadTexts: pfTimeoutsTcpClosing.setDescription('State after the first FIN has been sent.') pfTimeoutsTcpFinWait = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTimeoutsTcpFinWait.setStatus('current') if mibBuilder.loadTexts: pfTimeoutsTcpFinWait.setDescription('State after both FINs have been exchanged and the connection is closed.') pfTimeoutsTcpClosed = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTimeoutsTcpClosed.setStatus('current') if mibBuilder.loadTexts: pfTimeoutsTcpClosed.setDescription('State after one endpoint sends an RST.') pfTimeoutsUdpFirst = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTimeoutsUdpFirst.setStatus('current') if mibBuilder.loadTexts: pfTimeoutsUdpFirst.setDescription('State after the first packet.') pfTimeoutsUdpSingle = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTimeoutsUdpSingle.setStatus('current') if mibBuilder.loadTexts: pfTimeoutsUdpSingle.setDescription('State if the source host sends more than one packet but the destination host has never sent one back.') pfTimeoutsUdpMultiple = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTimeoutsUdpMultiple.setStatus('current') if mibBuilder.loadTexts: pfTimeoutsUdpMultiple.setDescription('State if both hosts have sent packets.') pfTimeoutsIcmpFirst = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 10), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTimeoutsIcmpFirst.setStatus('current') if mibBuilder.loadTexts: pfTimeoutsIcmpFirst.setDescription('State after the first packet.') pfTimeoutsIcmpError = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTimeoutsIcmpError.setStatus('current') if mibBuilder.loadTexts: pfTimeoutsIcmpError.setDescription('State after an ICMP error came back in response to an ICMP packet.') pfTimeoutsOtherFirst = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 12), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTimeoutsOtherFirst.setStatus('current') if mibBuilder.loadTexts: pfTimeoutsOtherFirst.setDescription('State after the first packet.') pfTimeoutsOtherSingle = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 13), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTimeoutsOtherSingle.setStatus('current') if mibBuilder.loadTexts: pfTimeoutsOtherSingle.setDescription('State if the source host sends more than one packet but the destination host has never sent one back.') pfTimeoutsOtherMultiple = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 14), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTimeoutsOtherMultiple.setStatus('current') if mibBuilder.loadTexts: pfTimeoutsOtherMultiple.setDescription('State if both hosts have sent packets.') pfTimeoutsFragment = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 15), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTimeoutsFragment.setStatus('current') if mibBuilder.loadTexts: pfTimeoutsFragment.setDescription('Seconds before an unassembled fragment is expired.') pfTimeoutsInterval = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 16), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTimeoutsInterval.setStatus('current') if mibBuilder.loadTexts: pfTimeoutsInterval.setDescription('Interval between purging expired states and fragments.') pfTimeoutsAdaptiveStart = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 17), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTimeoutsAdaptiveStart.setStatus('current') if mibBuilder.loadTexts: pfTimeoutsAdaptiveStart.setDescription('When the number of state entries exceeds this value, adaptive scaling begins.') pfTimeoutsAdaptiveEnd = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 18), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTimeoutsAdaptiveEnd.setStatus('current') if mibBuilder.loadTexts: pfTimeoutsAdaptiveEnd.setDescription('When reaching this number of state entries, all timeout values become zero, effectively purging all state entries immediately.') pfTimeoutsSrcNode = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 19), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTimeoutsSrcNode.setStatus('current') if mibBuilder.loadTexts: pfTimeoutsSrcNode.setDescription('Length of time to retain a source tracking entry after the last state expires.') pfLogInterfaceName = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 1), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfLogInterfaceName.setStatus('current') if mibBuilder.loadTexts: pfLogInterfaceName.setDescription("The name of the interface configured with 'set loginterface'. If no interface has been configured, the object will be empty.") pfLogInterfaceIp4BytesIn = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 2), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfLogInterfaceIp4BytesIn.setStatus('current') if mibBuilder.loadTexts: pfLogInterfaceIp4BytesIn.setDescription('Number of IPv4 bytes passed in on the loginterface.') pfLogInterfaceIp4BytesOut = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 3), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfLogInterfaceIp4BytesOut.setStatus('current') if mibBuilder.loadTexts: pfLogInterfaceIp4BytesOut.setDescription('Number of IPv4 bytes passed out on the loginterface.') pfLogInterfaceIp4PktsInPass = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 4), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfLogInterfaceIp4PktsInPass.setStatus('current') if mibBuilder.loadTexts: pfLogInterfaceIp4PktsInPass.setDescription('Number of IPv4 packets passed in on the loginterface.') pfLogInterfaceIp4PktsInDrop = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 5), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfLogInterfaceIp4PktsInDrop.setStatus('current') if mibBuilder.loadTexts: pfLogInterfaceIp4PktsInDrop.setDescription('Number of IPv4 packets dropped coming in on the loginterface.') pfLogInterfaceIp4PktsOutPass = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 6), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfLogInterfaceIp4PktsOutPass.setStatus('current') if mibBuilder.loadTexts: pfLogInterfaceIp4PktsOutPass.setDescription('Number of IPv4 packets passed out on the loginterface.') pfLogInterfaceIp4PktsOutDrop = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 7), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfLogInterfaceIp4PktsOutDrop.setStatus('current') if mibBuilder.loadTexts: pfLogInterfaceIp4PktsOutDrop.setDescription('Number of IPv4 packets dropped going out on the loginterface.') pfLogInterfaceIp6BytesIn = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 8), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfLogInterfaceIp6BytesIn.setStatus('current') if mibBuilder.loadTexts: pfLogInterfaceIp6BytesIn.setDescription('Number of IPv6 bytes passed in on the loginterface.') pfLogInterfaceIp6BytesOut = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 9), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfLogInterfaceIp6BytesOut.setStatus('current') if mibBuilder.loadTexts: pfLogInterfaceIp6BytesOut.setDescription('Number of IPv6 bytes passed out on the loginterface.') pfLogInterfaceIp6PktsInPass = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 10), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfLogInterfaceIp6PktsInPass.setStatus('current') if mibBuilder.loadTexts: pfLogInterfaceIp6PktsInPass.setDescription('Number of IPv6 packets passed in on the loginterface.') pfLogInterfaceIp6PktsInDrop = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 11), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfLogInterfaceIp6PktsInDrop.setStatus('current') if mibBuilder.loadTexts: pfLogInterfaceIp6PktsInDrop.setDescription('Number of IPv6 packets dropped coming in on the loginterface.') pfLogInterfaceIp6PktsOutPass = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 12), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfLogInterfaceIp6PktsOutPass.setStatus('current') if mibBuilder.loadTexts: pfLogInterfaceIp6PktsOutPass.setDescription('Number of IPv6 packets passed out on the loginterface.') pfLogInterfaceIp6PktsOutDrop = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 13), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfLogInterfaceIp6PktsOutDrop.setStatus('current') if mibBuilder.loadTexts: pfLogInterfaceIp6PktsOutDrop.setDescription('Number of IPv6 packets dropped going out on the loginterface.') pfInterfacesIfNumber = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfInterfacesIfNumber.setStatus('current') if mibBuilder.loadTexts: pfInterfacesIfNumber.setDescription('The number of network interfaces on this system.') pfInterfacesIfTable = MibTable((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2), ) if mibBuilder.loadTexts: pfInterfacesIfTable.setStatus('current') if mibBuilder.loadTexts: pfInterfacesIfTable.setDescription('Table of network interfaces, indexed on pfInterfacesIfNumber.') pfInterfacesIfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1), ).setIndexNames((0, "BEGEMOT-PF-MIB", "pfInterfacesIfIndex")) if mibBuilder.loadTexts: pfInterfacesIfEntry.setStatus('current') if mibBuilder.loadTexts: pfInterfacesIfEntry.setDescription('An entry in the pfInterfacesIfTable containing information about a particular network interface in the machine.') pfInterfacesIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))) if mibBuilder.loadTexts: pfInterfacesIfIndex.setStatus('current') if mibBuilder.loadTexts: pfInterfacesIfIndex.setDescription('A unique value, greater than zero, for each interface.') pfInterfacesIfDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 2), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfInterfacesIfDescr.setStatus('current') if mibBuilder.loadTexts: pfInterfacesIfDescr.setDescription('The name of the interface.') pfInterfacesIfType = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("group", 0), ("instance", 1), ("detached", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: pfInterfacesIfType.setStatus('current') if mibBuilder.loadTexts: pfInterfacesIfType.setDescription('Indicates whether the interface is a group inteface, an interface instance, or whether it has been removed or destroyed.') pfInterfacesIfTZero = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 4), TimeTicks()).setUnits('1/100th of a Second').setMaxAccess("readonly") if mibBuilder.loadTexts: pfInterfacesIfTZero.setStatus('current') if mibBuilder.loadTexts: pfInterfacesIfTZero.setDescription('Time since statistics were last reset or since the interface was loaded.') pfInterfacesIfRefsState = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 5), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfInterfacesIfRefsState.setStatus('current') if mibBuilder.loadTexts: pfInterfacesIfRefsState.setDescription('The number of state and/or source track entries referencing this interface.') pfInterfacesIfRefsRule = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 6), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfInterfacesIfRefsRule.setStatus('current') if mibBuilder.loadTexts: pfInterfacesIfRefsRule.setDescription('The number of rules referencing this interface.') pfInterfacesIf4BytesInPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 7), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfInterfacesIf4BytesInPass.setStatus('current') if mibBuilder.loadTexts: pfInterfacesIf4BytesInPass.setDescription('The number of IPv4 bytes passed coming in on this interface.') pfInterfacesIf4BytesInBlock = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 8), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfInterfacesIf4BytesInBlock.setStatus('current') if mibBuilder.loadTexts: pfInterfacesIf4BytesInBlock.setDescription('The number of IPv4 bytes blocked coming in on this interface.') pfInterfacesIf4BytesOutPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 9), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfInterfacesIf4BytesOutPass.setStatus('current') if mibBuilder.loadTexts: pfInterfacesIf4BytesOutPass.setDescription('The number of IPv4 bytes passed going out on this interface.') pfInterfacesIf4BytesOutBlock = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 10), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfInterfacesIf4BytesOutBlock.setStatus('current') if mibBuilder.loadTexts: pfInterfacesIf4BytesOutBlock.setDescription('The number of IPv4 bytes blocked going out on this interface.') pfInterfacesIf4PktsInPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 11), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfInterfacesIf4PktsInPass.setStatus('current') if mibBuilder.loadTexts: pfInterfacesIf4PktsInPass.setDescription('The number of IPv4 packets passed coming in on this interface.') pfInterfacesIf4PktsInBlock = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 12), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfInterfacesIf4PktsInBlock.setStatus('current') if mibBuilder.loadTexts: pfInterfacesIf4PktsInBlock.setDescription('The number of IPv4 packets blocked coming in on this interface.') pfInterfacesIf4PktsOutPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 13), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfInterfacesIf4PktsOutPass.setStatus('current') if mibBuilder.loadTexts: pfInterfacesIf4PktsOutPass.setDescription('The number of IPv4 packets passed going out on this interface.') pfInterfacesIf4PktsOutBlock = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 14), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfInterfacesIf4PktsOutBlock.setStatus('current') if mibBuilder.loadTexts: pfInterfacesIf4PktsOutBlock.setDescription('The number of IPv4 packets blocked going out on this interface.') pfInterfacesIf6BytesInPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 15), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfInterfacesIf6BytesInPass.setStatus('current') if mibBuilder.loadTexts: pfInterfacesIf6BytesInPass.setDescription('The number of IPv6 bytes passed coming in on this interface.') pfInterfacesIf6BytesInBlock = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 16), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfInterfacesIf6BytesInBlock.setStatus('current') if mibBuilder.loadTexts: pfInterfacesIf6BytesInBlock.setDescription('The number of IPv6 bytes blocked coming in on this interface.') pfInterfacesIf6BytesOutPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 17), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfInterfacesIf6BytesOutPass.setStatus('current') if mibBuilder.loadTexts: pfInterfacesIf6BytesOutPass.setDescription('The number of IPv6 bytes passed going out on this interface.') pfInterfacesIf6BytesOutBlock = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 18), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfInterfacesIf6BytesOutBlock.setStatus('current') if mibBuilder.loadTexts: pfInterfacesIf6BytesOutBlock.setDescription('The number of IPv6 bytes blocked going out on this interface.') pfInterfacesIf6PktsInPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 19), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfInterfacesIf6PktsInPass.setStatus('current') if mibBuilder.loadTexts: pfInterfacesIf6PktsInPass.setDescription('The number of IPv6 packets passed coming in on this interface.') pfInterfacesIf6PktsInBlock = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 20), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfInterfacesIf6PktsInBlock.setStatus('current') if mibBuilder.loadTexts: pfInterfacesIf6PktsInBlock.setDescription('The number of IPv6 packets blocked coming in on this interface.') pfInterfacesIf6PktsOutPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 21), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfInterfacesIf6PktsOutPass.setStatus('current') if mibBuilder.loadTexts: pfInterfacesIf6PktsOutPass.setDescription('The number of IPv6 packets passed going out on this interface.') pfInterfacesIf6PktsOutBlock = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 22), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfInterfacesIf6PktsOutBlock.setStatus('current') if mibBuilder.loadTexts: pfInterfacesIf6PktsOutBlock.setDescription('The number of IPv6 packets blocked going out on this interface.') pfTablesTblNumber = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTablesTblNumber.setStatus('current') if mibBuilder.loadTexts: pfTablesTblNumber.setDescription('The number of tables on this system.') pfTablesTblTable = MibTable((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2), ) if mibBuilder.loadTexts: pfTablesTblTable.setStatus('current') if mibBuilder.loadTexts: pfTablesTblTable.setDescription('Table of tables, index on pfTablesTblIndex.') pfTablesTblEntry = MibTableRow((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1), ).setIndexNames((0, "BEGEMOT-PF-MIB", "pfTablesTblIndex")) if mibBuilder.loadTexts: pfTablesTblEntry.setStatus('current') if mibBuilder.loadTexts: pfTablesTblEntry.setDescription('Any entry in the pfTablesTblTable containing information about a particular table on the system.') pfTablesTblIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))) if mibBuilder.loadTexts: pfTablesTblIndex.setStatus('current') if mibBuilder.loadTexts: pfTablesTblIndex.setDescription('A unique value, greater than zero, for each table.') pfTablesTblDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 2), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTablesTblDescr.setStatus('current') if mibBuilder.loadTexts: pfTablesTblDescr.setDescription('The name of the table.') pfTablesTblCount = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTablesTblCount.setStatus('current') if mibBuilder.loadTexts: pfTablesTblCount.setDescription('The number of addresses in the table.') pfTablesTblTZero = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 4), TimeTicks()).setUnits('1/100th of a Second').setMaxAccess("readonly") if mibBuilder.loadTexts: pfTablesTblTZero.setStatus('current') if mibBuilder.loadTexts: pfTablesTblTZero.setDescription('The time passed since the statistics of this table were last cleared or the time since this table was loaded, whichever is sooner.') pfTablesTblRefsAnchor = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTablesTblRefsAnchor.setStatus('current') if mibBuilder.loadTexts: pfTablesTblRefsAnchor.setDescription('The number of anchors referencing this table.') pfTablesTblRefsRule = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTablesTblRefsRule.setStatus('current') if mibBuilder.loadTexts: pfTablesTblRefsRule.setDescription('The number of rules referencing this table.') pfTablesTblEvalMatch = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 7), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTablesTblEvalMatch.setStatus('current') if mibBuilder.loadTexts: pfTablesTblEvalMatch.setDescription('The number of evaluations returning a match.') pfTablesTblEvalNoMatch = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 8), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTablesTblEvalNoMatch.setStatus('current') if mibBuilder.loadTexts: pfTablesTblEvalNoMatch.setDescription('The number of evaluations not returning a match.') pfTablesTblBytesInPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 9), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTablesTblBytesInPass.setStatus('current') if mibBuilder.loadTexts: pfTablesTblBytesInPass.setDescription('The number of bytes passed in matching the table.') pfTablesTblBytesInBlock = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 10), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTablesTblBytesInBlock.setStatus('current') if mibBuilder.loadTexts: pfTablesTblBytesInBlock.setDescription('The number of bytes blocked coming in matching the table.') pfTablesTblBytesInXPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 11), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTablesTblBytesInXPass.setStatus('current') if mibBuilder.loadTexts: pfTablesTblBytesInXPass.setDescription('The number of bytes statefully passed in where the state entry refers to the table, but the table no longer contains the address in question.') pfTablesTblBytesOutPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 12), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTablesTblBytesOutPass.setStatus('current') if mibBuilder.loadTexts: pfTablesTblBytesOutPass.setDescription('The number of bytes passed out matching the table.') pfTablesTblBytesOutBlock = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 13), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTablesTblBytesOutBlock.setStatus('current') if mibBuilder.loadTexts: pfTablesTblBytesOutBlock.setDescription('The number of bytes blocked going out matching the table.') pfTablesTblBytesOutXPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 14), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTablesTblBytesOutXPass.setStatus('current') if mibBuilder.loadTexts: pfTablesTblBytesOutXPass.setDescription('The number of bytes statefully passed out where the state entry refers to the table, but the table no longer contains the address in question.') pfTablesTblPktsInPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 15), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTablesTblPktsInPass.setStatus('current') if mibBuilder.loadTexts: pfTablesTblPktsInPass.setDescription('The number of packets passed in matching the table.') pfTablesTblPktsInBlock = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 16), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTablesTblPktsInBlock.setStatus('current') if mibBuilder.loadTexts: pfTablesTblPktsInBlock.setDescription('The number of packets blocked coming in matching the table.') pfTablesTblPktsInXPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 17), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTablesTblPktsInXPass.setStatus('current') if mibBuilder.loadTexts: pfTablesTblPktsInXPass.setDescription('The number of packets statefully passed in where the state entry refers to the table, but the table no longer contains the address in question.') pfTablesTblPktsOutPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 18), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTablesTblPktsOutPass.setStatus('current') if mibBuilder.loadTexts: pfTablesTblPktsOutPass.setDescription('The number of packets passed out matching the table.') pfTablesTblPktsOutBlock = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 19), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTablesTblPktsOutBlock.setStatus('current') if mibBuilder.loadTexts: pfTablesTblPktsOutBlock.setDescription('The number of packets blocked going out matching the table.') pfTablesTblPktsOutXPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 20), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTablesTblPktsOutXPass.setStatus('current') if mibBuilder.loadTexts: pfTablesTblPktsOutXPass.setDescription('The number of packets statefully passed out where the state entry refers to the table, but the table no longer contains the address in question.') pfTablesAddrTable = MibTable((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3), ) if mibBuilder.loadTexts: pfTablesAddrTable.setStatus('current') if mibBuilder.loadTexts: pfTablesAddrTable.setDescription('Table of addresses from every table on the system.') pfTablesAddrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1), ).setIndexNames((0, "BEGEMOT-PF-MIB", "pfTablesAddrIndex")) if mibBuilder.loadTexts: pfTablesAddrEntry.setStatus('current') if mibBuilder.loadTexts: pfTablesAddrEntry.setDescription('An entry in the pfTablesAddrTable containing information about a particular entry in a table.') pfTablesAddrIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))) if mibBuilder.loadTexts: pfTablesAddrIndex.setStatus('current') if mibBuilder.loadTexts: pfTablesAddrIndex.setDescription('A unique value, greater than zero, for each address.') pfTablesAddrNet = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1, 2), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTablesAddrNet.setStatus('current') if mibBuilder.loadTexts: pfTablesAddrNet.setDescription('The IP address of this particular table entry.') pfTablesAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTablesAddrMask.setStatus('current') if mibBuilder.loadTexts: pfTablesAddrMask.setDescription('The CIDR netmask of this particular table entry.') pfTablesAddrTZero = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1, 4), TimeTicks()).setUnits('1/100th of a Second').setMaxAccess("readonly") if mibBuilder.loadTexts: pfTablesAddrTZero.setStatus('current') if mibBuilder.loadTexts: pfTablesAddrTZero.setDescription("The time passed since this entry's statistics were last cleared, or the time passed since this entry was loaded into the table, whichever is sooner.") pfTablesAddrBytesInPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1, 5), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTablesAddrBytesInPass.setStatus('current') if mibBuilder.loadTexts: pfTablesAddrBytesInPass.setDescription('The number of inbound bytes passed as a result of this entry.') pfTablesAddrBytesInBlock = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1, 6), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTablesAddrBytesInBlock.setStatus('current') if mibBuilder.loadTexts: pfTablesAddrBytesInBlock.setDescription('The number of inbound bytes blocked as a result of this entry.') pfTablesAddrBytesOutPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1, 7), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTablesAddrBytesOutPass.setStatus('current') if mibBuilder.loadTexts: pfTablesAddrBytesOutPass.setDescription('The number of outbound bytes passed as a result of this entry.') pfTablesAddrBytesOutBlock = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1, 8), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTablesAddrBytesOutBlock.setStatus('current') if mibBuilder.loadTexts: pfTablesAddrBytesOutBlock.setDescription('The number of outbound bytes blocked as a result of this entry.') pfTablesAddrPktsInPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1, 9), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTablesAddrPktsInPass.setStatus('current') if mibBuilder.loadTexts: pfTablesAddrPktsInPass.setDescription('The number of inbound packets passed as a result of this entry.') pfTablesAddrPktsInBlock = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1, 10), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTablesAddrPktsInBlock.setStatus('current') if mibBuilder.loadTexts: pfTablesAddrPktsInBlock.setDescription('The number of inbound packets blocked as a result of this entry.') pfTablesAddrPktsOutPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1, 11), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTablesAddrPktsOutPass.setStatus('current') if mibBuilder.loadTexts: pfTablesAddrPktsOutPass.setDescription('The number of outbound packets passed as a result of this entry.') pfTablesAddrPktsOutBlock = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1, 12), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfTablesAddrPktsOutBlock.setStatus('current') if mibBuilder.loadTexts: pfTablesAddrPktsOutBlock.setDescription('The number of outbound packets blocked as a result of this entry.') pfAltqQueueNumber = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 10, 1), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfAltqQueueNumber.setStatus('current') if mibBuilder.loadTexts: pfAltqQueueNumber.setDescription('The number of queues in the active set.') pfAltqQueueTable = MibTable((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 10, 2), ) if mibBuilder.loadTexts: pfAltqQueueTable.setStatus('current') if mibBuilder.loadTexts: pfAltqQueueTable.setDescription('Table containing the rules that are active on this system.') pfAltqQueueEntry = MibTableRow((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 10, 2, 1), ).setIndexNames((0, "BEGEMOT-PF-MIB", "pfAltqQueueIndex")) if mibBuilder.loadTexts: pfAltqQueueEntry.setStatus('current') if mibBuilder.loadTexts: pfAltqQueueEntry.setDescription('An entry in the pfAltqQueueTable table.') pfAltqQueueIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 10, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))) if mibBuilder.loadTexts: pfAltqQueueIndex.setStatus('current') if mibBuilder.loadTexts: pfAltqQueueIndex.setDescription('A unique value, greater than zero, for each queue.') pfAltqQueueDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 10, 2, 1, 2), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfAltqQueueDescr.setStatus('current') if mibBuilder.loadTexts: pfAltqQueueDescr.setDescription('The name of the queue.') pfAltqQueueParent = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 10, 2, 1, 3), OctetString()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfAltqQueueParent.setStatus('current') if mibBuilder.loadTexts: pfAltqQueueParent.setDescription("Name of the queue's parent if it has one.") pfAltqQueueScheduler = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 10, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 8, 11))).clone(namedValues=NamedValues(("cbq", 1), ("hfsc", 8), ("priq", 11)))).setMaxAccess("readonly") if mibBuilder.loadTexts: pfAltqQueueScheduler.setStatus('current') if mibBuilder.loadTexts: pfAltqQueueScheduler.setDescription('Scheduler algorithm implemented by this queue.') pfAltqQueueBandwidth = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 10, 2, 1, 5), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfAltqQueueBandwidth.setStatus('current') if mibBuilder.loadTexts: pfAltqQueueBandwidth.setDescription('Bandwitch assigned to this queue.') pfAltqQueuePriority = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 10, 2, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfAltqQueuePriority.setStatus('current') if mibBuilder.loadTexts: pfAltqQueuePriority.setDescription('Priority level of the queue.') pfAltqQueueLimit = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 10, 2, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pfAltqQueueLimit.setStatus('current') if mibBuilder.loadTexts: pfAltqQueueLimit.setDescription('Maximum number of packets in the queue.') mibBuilder.exportSymbols("BEGEMOT-PF-MIB", pfTablesTblIndex=pfTablesTblIndex, pfLogInterfaceIp4PktsOutPass=pfLogInterfaceIp4PktsOutPass, pfTimeoutsTcpOpening=pfTimeoutsTcpOpening, pfStatusRunning=pfStatusRunning, pfStateTableCount=pfStateTableCount, pfSrcNodesSearches=pfSrcNodesSearches, pfCounterBadOffset=pfCounterBadOffset, pfStateTableSearches=pfStateTableSearches, pfTablesTblTable=pfTablesTblTable, pfInterfacesIf6PktsInPass=pfInterfacesIf6PktsInPass, pfInterfacesIf6BytesOutBlock=pfInterfacesIf6BytesOutBlock, pfTablesTblPktsOutPass=pfTablesTblPktsOutPass, pfLogInterfaceIp6BytesOut=pfLogInterfaceIp6BytesOut, pfStatusRuntime=pfStatusRuntime, pfLogInterfaceIp4PktsInDrop=pfLogInterfaceIp4PktsInDrop, pfInterfacesIf4PktsInBlock=pfInterfacesIf4PktsInBlock, pfAltqQueueParent=pfAltqQueueParent, pfInterfacesIfEntry=pfInterfacesIfEntry, pfTablesTblEvalNoMatch=pfTablesTblEvalNoMatch, pfTablesTblBytesOutPass=pfTablesTblBytesOutPass, PYSNMP_MODULE_ID=begemotPf, pfStatusHostId=pfStatusHostId, pfLogInterfaceIp4BytesOut=pfLogInterfaceIp4BytesOut, pfTablesAddrEntry=pfTablesAddrEntry, pfTablesTblPktsInXPass=pfTablesTblPktsInXPass, pfTimeoutsTcpClosing=pfTimeoutsTcpClosing, pfLogInterfaceIp6PktsOutDrop=pfLogInterfaceIp6PktsOutDrop, pfTablesTblBytesInPass=pfTablesTblBytesInPass, pfAltqQueueDescr=pfAltqQueueDescr, pfTimeoutsOtherFirst=pfTimeoutsOtherFirst, pfTablesTblBytesOutBlock=pfTablesTblBytesOutBlock, pfAltqQueueLimit=pfAltqQueueLimit, pfTablesTblPktsInBlock=pfTablesTblPktsInBlock, pfAltqQueueBandwidth=pfAltqQueueBandwidth, pfCounterMemDrop=pfCounterMemDrop, pfInterfacesIf6BytesInBlock=pfInterfacesIf6BytesInBlock, pfInterfaces=pfInterfaces, pfTimeoutsUdpFirst=pfTimeoutsUdpFirst, pfStateTable=pfStateTable, pfInterfacesIf4PktsOutBlock=pfInterfacesIf4PktsOutBlock, pfTimeoutsAdaptiveEnd=pfTimeoutsAdaptiveEnd, pfTablesTblEvalMatch=pfTablesTblEvalMatch, pfInterfacesIfNumber=pfInterfacesIfNumber, pfTablesTblRefsRule=pfTablesTblRefsRule, pfTimeoutsOtherMultiple=pfTimeoutsOtherMultiple, pfTimeoutsTcpFinWait=pfTimeoutsTcpFinWait, pfLogInterfaceIp6BytesIn=pfLogInterfaceIp6BytesIn, pfTablesTblPktsOutXPass=pfTablesTblPktsOutXPass, pfLimits=pfLimits, pfLogInterface=pfLogInterface, pfTimeoutsTcpEstablished=pfTimeoutsTcpEstablished, pfLogInterfaceIp6PktsInPass=pfLogInterfaceIp6PktsInPass, pfAltq=pfAltq, pfTablesTblBytesInXPass=pfTablesTblBytesInXPass, pfTablesTblTZero=pfTablesTblTZero, pfTablesTblRefsAnchor=pfTablesTblRefsAnchor, pfTablesAddrBytesInBlock=pfTablesAddrBytesInBlock, pfInterfacesIf4PktsOutPass=pfInterfacesIf4PktsOutPass, pfTimeoutsTcpClosed=pfTimeoutsTcpClosed, pfInterfacesIf6PktsOutPass=pfInterfacesIf6PktsOutPass, pfTablesAddrPktsInBlock=pfTablesAddrPktsInBlock, begemotPfObjects=begemotPfObjects, pfStateTableRemovals=pfStateTableRemovals, pfTablesAddrBytesInPass=pfTablesAddrBytesInPass, pfTablesTblPktsOutBlock=pfTablesTblPktsOutBlock, pfCounterFragment=pfCounterFragment, pfTimeoutsIcmpFirst=pfTimeoutsIcmpFirst, pfInterfacesIf4BytesOutPass=pfInterfacesIf4BytesOutPass, pfTablesAddrTable=pfTablesAddrTable, pfInterfacesIf4PktsInPass=pfInterfacesIf4PktsInPass, pfLogInterfaceIp6PktsInDrop=pfLogInterfaceIp6PktsInDrop, pfStatusDebug=pfStatusDebug, pfTimeouts=pfTimeouts, pfInterfacesIf4BytesOutBlock=pfInterfacesIf4BytesOutBlock, pfTablesAddrMask=pfTablesAddrMask, pfLogInterfaceIp4BytesIn=pfLogInterfaceIp4BytesIn, pfInterfacesIfTZero=pfInterfacesIfTZero, pfInterfacesIf6PktsOutBlock=pfInterfacesIf6PktsOutBlock, pfCounter=pfCounter, pfTablesAddrBytesOutPass=pfTablesAddrBytesOutPass, pfInterfacesIf6BytesInPass=pfInterfacesIf6BytesInPass, pfTimeoutsUdpSingle=pfTimeoutsUdpSingle, pfInterfacesIfRefsState=pfInterfacesIfRefsState, pfTables=pfTables, pfSrcNodesCount=pfSrcNodesCount, pfTimeoutsFragment=pfTimeoutsFragment, pfInterfacesIfDescr=pfInterfacesIfDescr, pfInterfacesIf6PktsInBlock=pfInterfacesIf6PktsInBlock, pfLogInterfaceIp4PktsOutDrop=pfLogInterfaceIp4PktsOutDrop, pfTablesTblEntry=pfTablesTblEntry, pfInterfacesIf4BytesInBlock=pfInterfacesIf4BytesInBlock, pfTablesAddrTZero=pfTablesAddrTZero, pfTimeoutsOtherSingle=pfTimeoutsOtherSingle, pfLogInterfaceIp4PktsInPass=pfLogInterfaceIp4PktsInPass, pfAltqQueuePriority=pfAltqQueuePriority, pfLogInterfaceIp6PktsOutPass=pfLogInterfaceIp6PktsOutPass, pfTimeoutsAdaptiveStart=pfTimeoutsAdaptiveStart, pfTimeoutsIcmpError=pfTimeoutsIcmpError, begemotPf=begemotPf, pfInterfacesIfIndex=pfInterfacesIfIndex, pfLimitsSrcNodes=pfLimitsSrcNodes, pfCounterMatch=pfCounterMatch, pfInterfacesIfType=pfInterfacesIfType, pfLimitsFrags=pfLimitsFrags, pfCounterNormalize=pfCounterNormalize, pfStateTableInserts=pfStateTableInserts, pfTimeoutsSrcNode=pfTimeoutsSrcNode, pfSrcNodes=pfSrcNodes, pfTimeoutsUdpMultiple=pfTimeoutsUdpMultiple, pfAltqQueueTable=pfAltqQueueTable, pfTablesTblPktsInPass=pfTablesTblPktsInPass, pfAltqQueueNumber=pfAltqQueueNumber, pfStatus=pfStatus, pfTablesTblNumber=pfTablesTblNumber, pfTablesAddrBytesOutBlock=pfTablesAddrBytesOutBlock, pfTablesAddrPktsOutBlock=pfTablesAddrPktsOutBlock, pfAltqQueueIndex=pfAltqQueueIndex, pfSrcNodesInserts=pfSrcNodesInserts, pfInterfacesIf4BytesInPass=pfInterfacesIf4BytesInPass, pfTablesTblDescr=pfTablesTblDescr, pfSrcNodesRemovals=pfSrcNodesRemovals, pfTablesTblCount=pfTablesTblCount, pfTablesAddrPktsInPass=pfTablesAddrPktsInPass, pfInterfacesIf6BytesOutPass=pfInterfacesIf6BytesOutPass, pfTablesTblBytesInBlock=pfTablesTblBytesInBlock, pfLimitsStates=pfLimitsStates, pfTablesAddrIndex=pfTablesAddrIndex, pfTimeoutsTcpFirst=pfTimeoutsTcpFirst, pfAltqQueueEntry=pfAltqQueueEntry, pfTablesAddrNet=pfTablesAddrNet, pfCounterShort=pfCounterShort, pfTimeoutsInterval=pfTimeoutsInterval, pfAltqQueueScheduler=pfAltqQueueScheduler, pfTablesTblBytesOutXPass=pfTablesTblBytesOutXPass, pfTablesAddrPktsOutPass=pfTablesAddrPktsOutPass, pfInterfacesIfTable=pfInterfacesIfTable, pfLogInterfaceName=pfLogInterfaceName, pfInterfacesIfRefsRule=pfInterfacesIfRefsRule)
119.90172
5,893
0.788709
5,651
48,800
6.810653
0.085826
0.079196
0.138592
0.014239
0.534986
0.387456
0.312885
0.218022
0.200899
0.148362
0
0.071707
0.090389
48,800
406
5,894
120.197044
0.795332
0.006598
0
0
0
0.027569
0.210506
0.001341
0
0
0
0
0
1
0
false
0.197995
0.017544
0
0.017544
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
3
630597bfbcae22da42de4ed7bdac4e16f23139e1
249
py
Python
while_loop.py
isobelscott/vagrant_setup
60746901f6a0b6e3c0af0cf0d7fa9580c47d229a
[ "MIT" ]
1
2020-05-23T15:59:49.000Z
2020-05-23T15:59:49.000Z
while_loop.py
isobelscott/vagrant_setup
60746901f6a0b6e3c0af0cf0d7fa9580c47d229a
[ "MIT" ]
null
null
null
while_loop.py
isobelscott/vagrant_setup
60746901f6a0b6e3c0af0cf0d7fa9580c47d229a
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 import sys if __name__ == '__main__': a_str = sys.argv[1] b_str = sys.argv[2] a = int(sys.argv[1]) b = int(sys.argv[2]) while (a <= b): print("a =" + str(a) + str(b) + ")") a = a+1
16.6
44
0.46988
41
249
2.609756
0.439024
0.261682
0.186916
0.168224
0
0
0
0
0
0
0
0.035503
0.321285
249
14
45
17.785714
0.597633
0.084337
0
0
0
0
0.053097
0
0
0
0
0
0
1
0
false
0
0.111111
0
0.111111
0.111111
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
630b73747a6c4dd07619acb1f96539d6e03d228d
312
py
Python
telnyx/api_resources/number_order.py
rjkboyle/telnyx-python
bee8bdef9efd43076e63693876f7a423f3853180
[ "MIT" ]
35
2019-07-22T20:44:09.000Z
2022-02-15T05:52:15.000Z
telnyx/api_resources/number_order.py
rjkboyle/telnyx-python
bee8bdef9efd43076e63693876f7a423f3853180
[ "MIT" ]
15
2019-08-05T21:16:41.000Z
2022-01-14T00:14:35.000Z
telnyx/api_resources/number_order.py
rjkboyle/telnyx-python
bee8bdef9efd43076e63693876f7a423f3853180
[ "MIT" ]
6
2019-08-19T17:27:39.000Z
2022-03-15T18:36:23.000Z
from __future__ import absolute_import, division, print_function from telnyx.api_resources.abstract import ( CreateableAPIResource, ListableAPIResource, UpdateableAPIResource, ) class NumberOrder(CreateableAPIResource, ListableAPIResource, UpdateableAPIResource): OBJECT_NAME = "number_order"
26
85
0.817308
26
312
9.461538
0.769231
0.325203
0.495935
0
0
0
0
0
0
0
0
0
0.128205
312
11
86
28.363636
0.904412
0
0
0
0
0
0.038462
0
0
0
0
0
0
1
0
false
0
0.25
0
0.5
0.125
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
2d50a2b5e3fda4ef6b3b49027c783b8f5620702f
2,091
py
Python
Directives.py
EklipZgit/generals-bot
d9651c406097f959e1919ecb597d18158f4f529f
[ "MIT" ]
5
2019-04-24T14:52:15.000Z
2019-07-19T10:08:40.000Z
Directives.py
EklipZgit/generals-bot
d9651c406097f959e1919ecb597d18158f4f529f
[ "MIT" ]
null
null
null
Directives.py
EklipZgit/generals-bot
d9651c406097f959e1919ecb597d18158f4f529f
[ "MIT" ]
3
2017-12-06T06:04:00.000Z
2019-06-27T15:08:03.000Z
''' @ Travis Drake (EklipZ) eklipz.io - tdrake0x45 at gmail) April 2017 Generals.io Automated Client - https://github.com/harrischristiansen/generals-bot EklipZ bot - Tries to play generals lol ''' import logging from enum import Enum class Timings(): def __init__(self, cycleTurns, quickExpandSplitTurns, splitTurns, launchTiming, offsetTurns, recalcTurn, disallowEnemyGather): self.cycleTurns = cycleTurns self.quickExpandTurns = quickExpandSplitTurns self.splitTurns = splitTurns self.offsetTurns = offsetTurns self.launchTiming = launchTiming self.nextRecalcTurn = recalcTurn self.disallowEnemyGather = disallowEnemyGather def should_recalculate(self, turn): return turn == self.nextRecalcTurn def in_quick_expand_split(self, turn): adjustedTurn = self.get_split_turn(turn) return adjustedTurn <= self.quickExpandTurns def in_gather_split(self, turn): adjustedTurn = self.get_split_turn(turn) return self.quickExpandTurns < adjustedTurn < self.splitTurns def in_expand_split(self, turn): adjustedTurn = self.get_split_turn(turn) return adjustedTurn >= self.splitTurns def in_launch_split(self, turn): adjustedTurn = self.get_split_turn(turn) return adjustedTurn >= self.launchTiming and adjustedTurn - self.launchTiming < 5 def get_split_turn(self, turn): adjustedTurn = (turn + self.offsetTurns) % self.cycleTurns return adjustedTurn def toString(self): return "C {} Q {} G {} L {} Off {}".format(self.cycleTurns, self.quickExpandTurns, self.splitTurns, self.launchTiming, self.offsetTurns) def __str__(self): return self.toString() class Directive(): def __init__(self, type = None): self.type = type # Return some number to indicate how important this move is. -1 or lower will not be made. # This doesn't necessarily need to calculate a full move etc, and should be performant. def get_priority(self): return -1 # Returns the move to be made. def get_move(self): return None # Doesn't necessarily need to recalculate if the directive is cycle-based etc. def recalculate(self, turn): return
31.208955
146
0.759923
265
2,091
5.867925
0.354717
0.092605
0.064309
0.064309
0.228939
0.169775
0.169775
0.169775
0.169775
0.169775
0
0.005643
0.152559
2,091
66
147
31.681818
0.871896
0.225251
0
0.097561
0
0
0.021197
0
0
0
0
0
0
1
0.317073
false
0
0.04878
0.146341
0.682927
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
2d94715607e69c6dee7bc3a0230571c68dd1f1ed
144
py
Python
api/urls.py
calvh/mlh-showntell
48477d600453779c8fd058b2f050fb96eef2c0e4
[ "MIT" ]
null
null
null
api/urls.py
calvh/mlh-showntell
48477d600453779c8fd058b2f050fb96eef2c0e4
[ "MIT" ]
null
null
null
api/urls.py
calvh/mlh-showntell
48477d600453779c8fd058b2f050fb96eef2c0e4
[ "MIT" ]
null
null
null
from django.urls import path from . import views urlpatterns = [ path("foods/", views.food_api), path("entries/", views.entry_api), ]
16
38
0.673611
19
144
5
0.631579
0
0
0
0
0
0
0
0
0
0
0
0.180556
144
8
39
18
0.805085
0
0
0
0
0
0.097222
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
2daffb74ce20bad412882f1bdbd63299aa068090
2,381
py
Python
python/sparktk/graph/constructors/create.py
lewisc/spark-tk
5548fc925b5c278263cbdebbd9e8c7593320c2f4
[ "ECL-2.0", "Apache-2.0" ]
34
2016-05-20T22:26:05.000Z
2022-01-21T12:55:13.000Z
python/sparktk/graph/constructors/create.py
aayushidwivedi01/spark-tk-old
fcf25f86498ac416cce77de0db4cf0aa503d20ac
[ "ECL-2.0", "Apache-2.0" ]
70
2016-06-28T01:11:21.000Z
2021-03-15T21:40:01.000Z
python/sparktk/graph/constructors/create.py
aayushidwivedi01/spark-tk-old
fcf25f86498ac416cce77de0db4cf0aa503d20ac
[ "ECL-2.0", "Apache-2.0" ]
34
2016-04-21T22:25:22.000Z
2020-10-06T09:23:43.000Z
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel Corporation  # # 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 sparktk.tkcontext import TkContext def create(source_or_vertices_frame, edges_frame=None, tc=TkContext.implicit): """ Create a sparktk Graph from two sparktk Frames (or some other source) Parameters ---------- :param source_or_vertices_frame: a graph source or a vertices frame Valid sources include: a python and spark GraphFrame, or a scala Graph Otherwise if a vertices frame is provided, then the edges_frame arg must also be supplied. A vertices frame defines the vertices for the graph and must have a schema with a column named "id" which provides unique vertex ID. All other columns are treated as vertex properties. If a column is also found named "vertex_type", it will be used as a special label to denote the type of vertex, for example, when interfacing with logic (such as a graph DB) which expects a specific vertex type. :param edges_frame: (valid only if the source_or_vertices_frame arg is a vertices Frame) An edge frame defines the edges of the graph; schema must have columns names "src" and "dst" which provide the vertex ids of the edge. All other columns are treated as edge properties. If a column is also found named "edge_type", it will be used as a special label to denote the type of edge, for example, when interfacing with logic (such as a graph DB) which expects a specific edge type. """ TkContext.validate(tc) from sparktk.graph.graph import Graph return Graph(tc, source_or_vertices_frame, edges_frame)
52.911111
120
0.676186
345
2,381
4.614493
0.417391
0.065327
0.040201
0.052764
0.263819
0.263819
0.190955
0.190955
0.146985
0.146985
0
0.005211
0.274675
2,381
44
121
54.113636
0.916618
0.847963
0
0
0
0
0
0
0
0
0
0
0
1
0.2
false
0
0.4
0
0.8
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
3
2dccbd17609469504ca9898579c31aea07006b58
248
py
Python
my-python-lab/appfunctions.py
baizoukou/my-python-lab
510fa2c23a272cb5b9e9a2dca2967797b2a1195b
[ "MIT" ]
null
null
null
my-python-lab/appfunctions.py
baizoukou/my-python-lab
510fa2c23a272cb5b9e9a2dca2967797b2a1195b
[ "MIT" ]
null
null
null
my-python-lab/appfunctions.py
baizoukou/my-python-lab
510fa2c23a272cb5b9e9a2dca2967797b2a1195b
[ "MIT" ]
null
null
null
def Awana_Academy(name, age): ## say to python that all the code that come after that line is going to be in d function print("Hello " + name + "you are " + age + "years old ") Awana_Academy("Alex " , "45") Awana_Academy("Donald ", "12")
41.333333
120
0.653226
40
248
3.975
0.775
0.226415
0
0
0
0
0
0
0
0
0
0.020619
0.217742
248
5
121
49.6
0.798969
0.346774
0
0
0
0
0.261438
0
0
0
0
0
0
1
0.25
false
0
0
0
0.25
0.25
0
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
3
2dd1f3206ae6327640ba41290cc054191e36fad9
1,240
py
Python
lale/util/VisitorPathError.py
Bhaskers-Blu-Org1/lale
6d3a361ccf2377027fba84a15d0ec38ba285ff4c
[ "Apache-2.0" ]
null
null
null
lale/util/VisitorPathError.py
Bhaskers-Blu-Org1/lale
6d3a361ccf2377027fba84a15d0ec38ba285ff4c
[ "Apache-2.0" ]
null
null
null
lale/util/VisitorPathError.py
Bhaskers-Blu-Org1/lale
6d3a361ccf2377027fba84a15d0ec38ba285ff4c
[ "Apache-2.0" ]
1
2020-07-30T10:06:23.000Z
2020-07-30T10:06:23.000Z
# Copyright 2019 IBM Corporation # # 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 typing import Any, Iterator, List, Optional class VisitorPathError(ValueError): _path:List[Any] def __init__(self, path:List[Any], message:Optional[str]=None): super().__init__(message) self._path = path def push_parent_path(self, part:Any)->None: self._path.append(part) @property def path(self)->Iterator[Any]: return reversed(self._path) def get_message_str(self)->str: return super().__str__() def path_string(self)->str: return "->".join(map(str, self.path)) def __str__(self): pstr = self.path_string() return f"[{pstr}]: {self.get_message_str()}"
29.52381
74
0.695968
175
1,240
4.771429
0.531429
0.071856
0.031138
0.038323
0
0
0
0
0
0
0
0.00804
0.197581
1,240
41
75
30.243902
0.831156
0.441935
0
0
0
0
0.053097
0.035398
0
0
0
0
0
1
0.333333
false
0
0.055556
0.166667
0.722222
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
2dd7760834a4bb79845c38073d41d38a401a17c9
156
py
Python
setup.py
lsaether/md-tooltips
c67346d0657367a651eced2dc0e0ba5c048a026a
[ "Naumen", "Condor-1.1", "MS-PL" ]
4
2020-02-27T19:07:04.000Z
2021-12-02T00:53:37.000Z
setup.py
lsaether/md-tooltips
c67346d0657367a651eced2dc0e0ba5c048a026a
[ "Naumen", "Condor-1.1", "MS-PL" ]
2
2019-11-11T15:04:41.000Z
2021-05-03T10:09:05.000Z
setup.py
lsaether/md-tooltips
c67346d0657367a651eced2dc0e0ba5c048a026a
[ "Naumen", "Condor-1.1", "MS-PL" ]
4
2020-02-27T17:44:11.000Z
2021-05-18T11:39:26.000Z
from setuptools import setup setup( name='md-tooltips', version='1.3.1', py_modules=['mdtooltips'], install_requires = ['markdown>=2.5'], )
19.5
41
0.641026
20
156
4.9
0.9
0
0
0
0
0
0
0
0
0
0
0.039063
0.179487
156
8
42
19.5
0.726563
0
0
0
0
0
0.248408
0
0
0
0
0
0
1
0
true
0
0.142857
0
0.142857
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
3
2def48b6f9cae6956d859e87cebb915ed386dbcd
1,365
py
Python
katas/kyu_7/Scoring_Tests.py
dusadamey/CodeWars
386de2427c8a590fc2e65adf979658e817dd131a
[ "MIT" ]
null
null
null
katas/kyu_7/Scoring_Tests.py
dusadamey/CodeWars
386de2427c8a590fc2e65adf979658e817dd131a
[ "MIT" ]
null
null
null
katas/kyu_7/Scoring_Tests.py
dusadamey/CodeWars
386de2427c8a590fc2e65adf979658e817dd131a
[ "MIT" ]
1
2021-10-30T15:45:40.000Z
2021-10-30T15:45:40.000Z
# https://www.codewars.com/kata/55d2aee99f30dbbf8b000001/ ''' Details : A new school year is approaching, which also means students will be taking tests. The tests in this kata are to be graded in different ways. A certain number of points will be given for each correct answer and a certain number of points will be deducted for each incorrect answer. For ommitted answers, points will either be awarded, deducted, or no points will be given at all. Return the number of points someone has scored on varying tests of different lengths. The given parameters will be: An array containing a series of 0s, 1s, and 2s, where 0 is a correct answer, 1 is an omitted answer, and 2 is an incorrect answer. The points awarded for correct answers The points awarded for omitted answers (note that this may be negative) The points deducted for incorrect answers (hint: this value has to be subtracted) Note: The input will always be valid (an array and three numbers) Examples #1: [0, 0, 0, 0, 2, 1, 0], 2, 0, 1 --> 9 because: 5 correct answers: 5*2 = 10 1 omitted answer: 1*0 = 0 1 wrong answer: 1*1 = 1 which is: 10 + 0 - 1 = 9 #2: [0, 1, 0, 0, 2, 1, 0, 2, 2, 1], 3, -1, 2) --> 3 because: 4*3 + 3*-1 - 3*2 = 3 ''' def score_test(tests, right, omit, wrong): return tests.count(0) * right + tests.count(1) * omit - tests.count(2) * wrong
34.125
296
0.704762
245
1,365
3.922449
0.387755
0.031217
0.043704
0.033299
0.07076
0.07076
0.058273
0
0
0
0
0.06938
0.208059
1,365
39
297
35
0.819611
0.897436
0
0
0
0
0
0
0
0
0
0
0
1
0.5
false
0
0
0.5
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
3
9306d5b3483e8913b4a04d702091fb5efbc3f444
241
py
Python
pkg_resources/tests/test_markers.py
techtonik/setuptools
aec3649c91a2a55e218edd038571931704a8e3a6
[ "MIT" ]
1
2022-03-12T13:27:21.000Z
2022-03-12T13:27:21.000Z
pkg_resources/tests/test_markers.py
techtonik/setuptools
aec3649c91a2a55e218edd038571931704a8e3a6
[ "MIT" ]
null
null
null
pkg_resources/tests/test_markers.py
techtonik/setuptools
aec3649c91a2a55e218edd038571931704a8e3a6
[ "MIT" ]
1
2022-03-12T13:27:24.000Z
2022-03-12T13:27:24.000Z
from unittest import mock from pkg_resources import evaluate_marker @mock.patch('platform.python_version', return_value='2.7.10') def test_ordering(python_version_mock): assert evaluate_marker("python_full_version > '2.7.3'") is True
26.777778
67
0.792531
37
241
4.891892
0.675676
0.154696
0
0
0
0
0
0
0
0
0
0.032407
0.103734
241
8
68
30.125
0.805556
0
0
0
0
0
0.240664
0.095436
0
0
0
0
0.2
1
0.2
false
0
0.4
0
0.6
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
0
0
1
0
1
0
0
3
932f77b362c63775cc0922efcf808e2f2af1e968
304
py
Python
sales/search_urls.py
EDario333/minegocito
5dd0869fa2510bb8152f4a117f33b2a30bb6d69c
[ "MIT" ]
null
null
null
sales/search_urls.py
EDario333/minegocito
5dd0869fa2510bb8152f4a117f33b2a30bb6d69c
[ "MIT" ]
null
null
null
sales/search_urls.py
EDario333/minegocito
5dd0869fa2510bb8152f4a117f33b2a30bb6d69c
[ "MIT" ]
null
null
null
from django.conf.urls import url, include from . search_views import \ by_identifier, \ by_unique_sale_user urlpatterns = [ url(r'^by-identifier', by_identifier, name='search-sale-by-identifier'), url(r'^by-unique-sale-user', by_unique_sale_user, name='search-sale-by-unique-sale-user'), ]
30.4
93
0.733553
46
304
4.652174
0.369565
0.224299
0.224299
0.299065
0
0
0
0
0
0
0
0
0.121711
304
10
94
30.4
0.801498
0
0
0
0
0
0.304054
0.189189
0
0
0
0
0
1
0
false
0
0.25
0
0.25
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
934680beea62af79ab9b5be09f49faee77888f35
278
py
Python
ujirani/views.py
maxwellharon/Ujirani
da920c804a942b9e7383a5266a4a5a92eeccae68
[ "MIT" ]
null
null
null
ujirani/views.py
maxwellharon/Ujirani
da920c804a942b9e7383a5266a4a5a92eeccae68
[ "MIT" ]
null
null
null
ujirani/views.py
maxwellharon/Ujirani
da920c804a942b9e7383a5266a4a5a92eeccae68
[ "MIT" ]
null
null
null
from django.views.generic import TemplateView from django.contrib.auth.mixins import LoginRequiredMixin ''' This view function is responsible for when the user logs in and sees the homepage ''' class HomePage(LoginRequiredMixin, TemplateView): template_name = 'index.html'
30.888889
81
0.802158
36
278
6.166667
0.805556
0.09009
0
0
0
0
0
0
0
0
0
0
0.129496
278
8
82
34.75
0.917355
0
0
0
0
0
0.05291
0
0
0
0
0
0
1
0
false
0
0.5
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
0
0
1
0
1
0
0
3
934a719a886813de9d5b0568563a8090a14f9a68
2,137
py
Python
src/sima/post/blueprints/statisticaloperation.py
SINTEF/simapy
650b8c2f15503dad98e2bfc0d0788509593822c7
[ "MIT" ]
null
null
null
src/sima/post/blueprints/statisticaloperation.py
SINTEF/simapy
650b8c2f15503dad98e2bfc0d0788509593822c7
[ "MIT" ]
null
null
null
src/sima/post/blueprints/statisticaloperation.py
SINTEF/simapy
650b8c2f15503dad98e2bfc0d0788509593822c7
[ "MIT" ]
null
null
null
# # Generated with StatisticalOperationBlueprint from dmt.blueprint import Blueprint from dmt.dimension import Dimension from dmt.attribute import Attribute from dmt.enum_attribute import EnumAttribute from dmt.blueprint_attribute import BlueprintAttribute from .operationnode import OperationNodeBlueprint class StatisticalOperationBlueprint(OperationNodeBlueprint): """""" def __init__(self, name="StatisticalOperation", package_path="sima/post", description=""): super().__init__(name,package_path,description) self.attributes.append(Attribute("name","string","",default="")) self.attributes.append(Attribute("description","string","",default="")) self.attributes.append(Attribute("_id","string","",default="")) self.attributes.append(BlueprintAttribute("scriptableValues","sima/sima/ScriptableValue","",True,Dimension("*"))) self.attributes.append(Attribute("x","integer","",default=0)) self.attributes.append(Attribute("y","integer","",default=0)) self.attributes.append(Attribute("h","integer","",default=0)) self.attributes.append(Attribute("w","integer","",default=0)) self.attributes.append(BlueprintAttribute("controlSignalInputSlots","sima/post/ControlSignalInputSlot","",True,Dimension("*"))) self.attributes.append(Attribute("renameOutput","boolean","",default=True)) self.attributes.append(EnumAttribute("operation","sima/post/StatisticsOperation","")) self.attributes.append(Attribute("combine","boolean","This will run the operation a second time on the transformed input to produce a combined output such as maxima of maxima etc.",default=False)) self.attributes.append(BlueprintAttribute("inputSlot","sima/post/InputSlot","",True)) self.attributes.append(BlueprintAttribute("outputSlot","sima/post/OutputSlot","",True)) self.attributes.append(Attribute("outputIndex","boolean","Output the index of the event ( valid for maxima and minima)",default=False)) self.attributes.append(Attribute("combinedName","string","Name of output when using combined operation",default=""))
71.233333
204
0.737015
224
2,137
6.973214
0.352679
0.143406
0.204866
0.204225
0.276569
0.214469
0.084507
0
0
0
0
0.002107
0.111839
2,137
30
205
71.233333
0.820864
0.02059
0
0
1
0.04
0.28263
0.052303
0
0
0
0
0
1
0.04
false
0
0.24
0
0.32
0.32
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
93722e7c65cc770ac2c11290ae9bd0b1291ad9e2
243
py
Python
pytest/response/PublishDataResponse.py
IshaySela/PubSub
d25a90458c4fb178dc3c8eb8a0f204d0c4347043
[ "MIT" ]
null
null
null
pytest/response/PublishDataResponse.py
IshaySela/PubSub
d25a90458c4fb178dc3c8eb8a0f204d0c4347043
[ "MIT" ]
null
null
null
pytest/response/PublishDataResponse.py
IshaySela/PubSub
d25a90458c4fb178dc3c8eb8a0f204d0c4347043
[ "MIT" ]
null
null
null
import json class PublishDataResponse: status:int def __init__(self, status:int): self.status = status @staticmethod def from_raw_json(raw_json:str): return PublishDataResponse(json.loads(raw_json)["Status"])
22.090909
66
0.699588
29
243
5.586207
0.517241
0.12963
0
0
0
0
0
0
0
0
0
0
0.205761
243
11
66
22.090909
0.839378
0
0
0
0
0
0.02459
0
0
0
0
0
0
1
0.25
false
0
0.125
0.125
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
3
fa805751d11bec252ba11095e9c0e936c4cf1d14
240
py
Python
utils/json.py
MisileLab/Crayonbot
98c2b0ff482a685cd324d94176a1a3f6e423deb3
[ "MIT" ]
null
null
null
utils/json.py
MisileLab/Crayonbot
98c2b0ff482a685cd324d94176a1a3f6e423deb3
[ "MIT" ]
null
null
null
utils/json.py
MisileLab/Crayonbot
98c2b0ff482a685cd324d94176a1a3f6e423deb3
[ "MIT" ]
1
2022-01-13T09:45:57.000Z
2022-01-13T09:45:57.000Z
import json def loadjson(src): with open(src, "r", encoding="utf-8") as f: return json.load(f) def savejson(src, data): with open(src, "w", encoding="utf-8") as f: json.dump(data, f, ensure_ascii=False)
21.818182
48
0.5875
38
240
3.684211
0.578947
0.114286
0.157143
0.2
0.214286
0
0
0
0
0
0
0.011173
0.254167
240
11
49
21.818182
0.77095
0
0
0
0
0
0.051948
0
0
0
0
0
0
1
0.285714
false
0
0.142857
0
0.571429
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
3
fa8380d6d963e8919e6b1c702ff245baa72a68cd
1,355
py
Python
darknet_2_pb/layers/mish.py
wdian/model_transform
44fdd120ca4434a686d36c18978fc248ef4b7d7f
[ "Apache-2.0" ]
null
null
null
darknet_2_pb/layers/mish.py
wdian/model_transform
44fdd120ca4434a686d36c18978fc248ef4b7d7f
[ "Apache-2.0" ]
null
null
null
darknet_2_pb/layers/mish.py
wdian/model_transform
44fdd120ca4434a686d36c18978fc248ef4b7d7f
[ "Apache-2.0" ]
null
null
null
# -*- coding:utf-8 -*- # """ ------------------------------------------------------------------- Copyright (c) 2019-2022 Snow Lake Inc. All rights reserved. Description : File Name: mish.py Author : wangdian@snowlake-tech.com create date: 2021/7/8 ------------------------------------------------------------------- """ from keras import backend as K from keras.engine.base_layer import Layer class Mish(Layer): """ Mish Activation Function. .. math:: mish(x) = x * tanh(softplus(x)) = x * tanh(ln(1 + e^{x})) Shape: - Input: Arbitrary. Use the keyword argument `input_shape` (tuple of integers, does not include the samples axis) when using this layer as the first layer in a model. - Output: Same shape as the input. Examples: Swish 的表达式为 f(x) = x · sigmoid(x) >> X_input = Input(input_shape) >> X = Mish()(X_input) """ def __init__(self, **kwargs): super(Mish, self).__init__(**kwargs) self.supports_masking = True def call(self, inputs): return inputs * K.tanh(K.softplus(inputs)) # return inputs * K.sigmoid(inputs) def get_config(self): config = super(Mish, self).get_config() return config def compute_output_shape(self, input_shape): return input_shape
29.456522
67
0.546125
164
1,355
4.396341
0.54878
0.011096
0.016644
0.052705
0
0
0
0
0
0
0
0.015733
0.249446
1,355
45
68
30.111111
0.692232
0.594096
0
0
0
0
0
0
0
0
0
0
0
1
0.307692
false
0
0.153846
0.153846
0.769231
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
fa85056d0d9b2ed3cae822af5ad2950d2c9b968b
48
py
Python
src/__init__.py
HuskyHacks/the-crown-defcon615
74df87ab31c06e92f88d48c251bb4d9b712adc77
[ "MIT" ]
42
2022-01-10T02:16:09.000Z
2022-02-22T00:37:48.000Z
src/__init__.py
HuskyHacks/the-crown-defcon615
74df87ab31c06e92f88d48c251bb4d9b712adc77
[ "MIT" ]
null
null
null
src/__init__.py
HuskyHacks/the-crown-defcon615
74df87ab31c06e92f88d48c251bb4d9b712adc77
[ "MIT" ]
6
2022-01-11T02:46:47.000Z
2022-01-26T01:11:21.000Z
__all__ = ["whoami", "pe_parse", "digital_rain"]
48
48
0.6875
6
48
4.5
1
0
0
0
0
0
0
0
0
0
0
0
0.083333
48
1
48
48
0.613636
0
0
0
0
0
0.530612
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
fa9dbb0ecf6939d2fc2af5ec467a4793b767277a
86
py
Python
show_color_scales.py
TheGerbilvonSteuben/PythonDataVisualization
34a569a888287a1ba26c0467090a9429ac6fc928
[ "CC0-1.0" ]
null
null
null
show_color_scales.py
TheGerbilvonSteuben/PythonDataVisualization
34a569a888287a1ba26c0467090a9429ac6fc928
[ "CC0-1.0" ]
null
null
null
show_color_scales.py
TheGerbilvonSteuben/PythonDataVisualization
34a569a888287a1ba26c0467090a9429ac6fc928
[ "CC0-1.0" ]
null
null
null
from plotly import colors for key in colors.PLOTLY_SCALES.keys(): print(key)
17.2
40
0.709302
13
86
4.615385
0.769231
0
0
0
0
0
0
0
0
0
0
0
0.209302
86
4
41
21.5
0.882353
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
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
0
0
1
0
0
0
0
3
faa2e48d83c1bbacef2e6f8ce1bda1de427f1230
1,040
py
Python
hyperion/pdfs/core/pdf.py
jsalt2019-diadet/hyperion
14a11436d62f3c15cd9b1f70bcce3eafbea2f753
[ "Apache-2.0" ]
9
2019-09-22T05:19:59.000Z
2022-03-05T18:03:37.000Z
hyperion/pdfs/core/pdf.py
jsalt2019-diadet/hyperion
14a11436d62f3c15cd9b1f70bcce3eafbea2f753
[ "Apache-2.0" ]
null
null
null
hyperion/pdfs/core/pdf.py
jsalt2019-diadet/hyperion
14a11436d62f3c15cd9b1f70bcce3eafbea2f753
[ "Apache-2.0" ]
4
2019-10-10T06:34:05.000Z
2022-03-05T18:03:56.000Z
""" Copyright 2018 Johns Hopkins University (Author: Jesus Villalba) Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) """ from __future__ import absolute_import from __future__ import print_function from __future__ import division from six.moves import xrange import numpy as np from abc import ABCMeta, abstractmethod from ...hyp_model import HypModel class PDF(HypModel): __metaclass__ = ABCMeta def __init__(self, x_dim=1, **kwargs): super(PDF, self).__init__(**kwargs) self.x_dim = x_dim def get_config(self): config = {'x_dim': self.x_dim } base_config = super(PDF, self).get_config() return dict(list(base_config.items()) + list(config.items())) @abstractmethod def log_prob(self, x): pass def eval_llk(self, x): return self.log_prob(x) @abstractmethod def sample(self, num_samples): pass def generate(self, num_samples, **kwargs): return self.generate(num_samples, **kwargs)
22.608696
69
0.661538
136
1,040
4.75
0.455882
0.0387
0.074303
0
0
0
0
0
0
0
0
0.011307
0.234615
1,040
45
70
23.111111
0.800251
0.117308
0
0.153846
0
0
0.005513
0
0
0
0
0
0
1
0.230769
false
0.076923
0.269231
0.076923
0.692308
0.038462
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
3
faabaab6339db3f6daf41e20feb07a922ead5b6e
93
py
Python
mud5games/apps.py
badCompany55/testDjangoDeploy
80681fc070eb062dd51cb6787af1796c99ebd69c
[ "MIT" ]
2
2019-09-21T23:17:06.000Z
2019-09-27T03:09:09.000Z
mud5games/apps.py
badCompany55/testDjangoDeploy
80681fc070eb062dd51cb6787af1796c99ebd69c
[ "MIT" ]
16
2019-09-30T01:33:25.000Z
2022-02-10T10:16:28.000Z
mud5games/apps.py
zacheryirvin/testDjangoDeploy
80681fc070eb062dd51cb6787af1796c99ebd69c
[ "MIT" ]
1
2019-09-19T01:47:10.000Z
2019-09-19T01:47:10.000Z
from django.apps import AppConfig class Mud5GamesConfig(AppConfig): name = 'mud5games'
15.5
33
0.763441
10
93
7.1
0.9
0
0
0
0
0
0
0
0
0
0
0.025641
0.16129
93
5
34
18.6
0.884615
0
0
0
0
0
0.096774
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
fae0852fdefec3aa304e90303d623af8b058bfd5
4,841
py
Python
tests/media/test_upmedia.py
allenyummy/Sanga
ff4cc60e0fd05cac49bdf15ad8a57dfedcf75fd0
[ "MIT" ]
2
2021-09-01T13:39:58.000Z
2021-09-01T13:41:49.000Z
tests/media/test_upmedia.py
allenyummy/Sanga
ff4cc60e0fd05cac49bdf15ad8a57dfedcf75fd0
[ "MIT" ]
3
2021-08-31T06:00:23.000Z
2021-09-01T08:52:41.000Z
tests/media/test_upmedia.py
allenyummy/Sanga
ff4cc60e0fd05cac49bdf15ad8a57dfedcf75fd0
[ "MIT" ]
null
null
null
# encoding=utf-8 # Author: Yu-Lun Chiang # Description: Test NewsCrawler import logging import pytest from collections import namedtuple from Sanga.media import upmedia from Sanga.struct import NewsStruct logger = logging.getLogger(__name__) TEST_DATA = namedtuple( typename="TEST_DATA", field_names=[ "name", "link", "expected_output", ], ) TEST_DATA_1 = TEST_DATA( name="上報_1", link="https://www.upmedia.mg/news_info.php?SerialNo=121668", expected_output=NewsStruct( title="【時間軸】美軍撤軍阿富汗後 神學士只花一個月武力奪權--上報", content="\n\n\n\n\n\n\n \n編按:美軍在7月2日倉皇地撤出阿富汗最大基地巴格拉姆空軍基地,儘管拜登政府稱會持續支持阿富汗政府,但沒想到短短一個月左右,在8月15日武裝團體神學士就進入首都喀布爾,喀布爾不戰而降,美軍扶持的阿富汗政府在短短一個月左右垮台,《上報》整理關鍵事件時間軸,回顧這一個月的關鍵事件。\n \n\n \n關鍵報導\n \n阿富汗神學士造訪中國 王毅期許能與新疆獨立運動劃清界線\n \n王毅在會談中先是批評了美國與北約倉促撤軍「實際上標誌著美對阿政策的失敗,阿富汗人民有了穩定和發展自己國家的重要機遇。」\n \n\n神學士代表團在天津會見王毅。(中國外交部)\n \n阿富汗神學士奪下鄰巴基斯坦邊境第二大關卡 美國準備撤出2500名當地翻譯員\n \n一名神學士士兵表示「經過20年美國的殘暴以及他們的走狗之後,斯平布爾達克再度被神學士拿下...聖戰士(Mujahideen )和人們的頑強抵抗迫使敵人逃跑,看阿,那是伊斯蘭酋長國的旗幟。」\n \n神學士奪下阿富汗鄰巴基斯坦第二大關卡。(湯森路透)\n \n \n【神學士擴張版圖】美將領公開警告 撤軍將導致阿富汗內戰惡夢再起\n \n始終不信任神學士的指揮官表示,倘若真的將部隊全數撤離,必然讓阿富汗政府失去依靠與協助,如今的神學士,一方面藉由和談、拖延爭取時間,另一方面又不斷在國內「開疆闢土」,打從5月份至今,該團體已經掌握阿富汗370個行政區當中的50個,勢力愈來愈逼近首都喀布爾(Kabul)。\n \n駐紮阿富汗的美軍,將在9月11日全數撤離。(湯森路透)\n \n \n \n \n \n \n \n \n \n \n \n \n", keywords=["阿富汗", "神學士", "塔利班", "甘尼", "美國", "美軍"], category="國際", media="上報", datetime="2021-08-16T12:50:00", link="https://www.upmedia.mg/news_info.php?SerialNo=121668", ), ) TEST_DATA_2 = TEST_DATA( name="上報_2", link="https://www.upmedia.mg/news_info.php?SerialNo=121781", expected_output=NewsStruct( title="設立海外秘密監獄? 中國女子稱在杜拜被中國使館帶到小黑屋關押8天 --上報", content="\n\n\n\n\n\n\n \n《美聯社》報導訪問一名中國女性,指稱中國政府在杜拜設立秘密監獄,裡面關押維吾爾人。\n\n \n該名稱為吳姓女子(Wu Huan)今年26歲,因為未婚夫是中國異見人士,因此嘗試逃離被遣返回中國。該名女子向美聯社透露自己是在杜拜的飯店遭到綁架,並且被中國官員監禁在一棟由別墅改裝的監獄內,他同時在關押地點發現有另外兩名維吾爾人囚犯。\n \n吳姓女子稱,在關押期間,她遭到訊問以及被迫簽屬法律文件虛假指控未婚夫騷擾她。在6月8日她終於被釋放出來,現在人在荷蘭尋求庇護。\n \n她的未婚夫今年19歲,因為在網路上張貼貼文質疑中國官媒對2019年香港抗議的報導以及中印邊界衝突而遭到中國官方追捕。兩人實際上並非維吾爾族人而是漢人。\n \n\nA young woman says she was held at a Chinese-run secret detention facility in Dubai along with at least two Uyghurs. The account is the only testimony known to experts that Beijing has set up a so-called \"black site\" in another country. https://t.co/sPqcXlmHqO\r\n— The Associated Press (@AP) August 16, 2021\n\n \n事發經過\n \n根據吳姓女子說詞,她是在5月27日在自己入住的飯店遭到中國官員訊問,接著被杜拜警方帶到警局後關押三天,期間個人手機和財物暫時遭到沒收。\n \n到了第三天,一名自稱來自中國駐杜拜領事館的人員來拜訪她,並詢問她是否接受外國資金來反對中國。她則回應她非常愛國。接著吳姓女子被使館人員扣上手銬押上一台TOYOTA,接著開了半小時載到郊區一間白色的別墅,從外面看到房間窗戶被改成單獨監禁房間。\n \n接著她被帶到小房間,門被改成重金屬門,屋內只有一張小床,而只有在送食物時才會被打開。另外她被帶去另外一個房間接受訊問好幾次,所有的人都戴口罩因此看不清楚面貌。\n \n在監禁期間,她聽到有維吾爾族人婦女用中文大喊「我不想回到中國,我想回土耳其。」\n \n最後她被迫簽下一份阿拉伯文與英文的文件,聲稱她的未婚夫騷擾她。\n \n\n#Uyghurs in Turkey have been doing a campaign, called ' Where Is My Family?' over the past months, to seek the whereabouts of their family members in East Turkistan. They go to every corner of Turkey, to spread and raise the awareness of Uyghur Genocide. @MeryemFaruh8111 @hrw pic.twitter.com/zrNzQvDXBN\r\n— UyghurInfo (@UyghurInfo) August 14, 2021\n\n \n中國小黑屋延伸海外?\n \n這是首次有人提出證詞中國在海外設立「小黑屋」,類似場所在海外國家,這種場所通常是官方請人去「喝茶」,意味著官方透過非正式手段進行訊問逼供,被請去的人不會有律師資源也不會有收到法院傳票。中國官方經常藉此恐嚇上訪人士。\n \n報導指出,美聯社尚無法核實吳姓女子的說法,吳姓女子也無法指出該場所的具體位置。但美聯社掌握證據指出中國官員訊問她的對話紀錄,以及她從監獄傳送訊息求救的簡訊。\n \n中國外交部發言人華春瑩在16日記者會上否認這件事情,但該提問並沒有在外交部官方紀錄上公開。\n \n抗議者在紐約聲援遭到關押的維吾爾人。(湯森路透)\n \n另外,杜拜當地警方也否認協助中國逮捕該名女子,並稱該名女子在三個月前已經自由地離開了杜唄。「杜拜不會在沒有國際接受的程序和當地執法程序之下逮捕任何外國公民,也不會容許外國政府設立任何拘禁場所。」\n \n報導訪問了中研院法律研所的陳玉潔助教,她表示儘管她未曾聽說過中國政府把類似場所設立到另外一個國家,但這符合中國政府常用各種官方或非官方手段把特定人士抓回國的企圖。\n \n近年來,國際上傳出不少中國政府試圖把維吾爾族人抓回國的案例,包括土耳其、沙烏地阿拉伯等維吾爾族人逃難的目的地國。根據維吾爾人權組織統計,1997到2007年之間公開資料有89名維吾爾人從9個國家遭到遣返回中國,從2014年至今則攀升到了20個國家1327人。\n \n中國在新疆設立可容納數十萬人的「再教育營」,國際社會指責該設施類似集中營,犯下非法監禁、文化滅絕等嚴重侵犯人權的罪刑。\n \n\nThanks to @ChinaFile for the invitation to write about this important subject. https://t.co/r5XnQQtJdW\r\n— Yu-Jie Chen (@yujiechentw) July 30, 2021\n\n \n報導指出,杜拜也有遣返維吾爾族的紀錄,一名法律倡議者Radha Stirling稱她曾協助多名來自印度、約旦等地的公民曾被杜拜秘密拘禁。\n", keywords=["杜拜", "維吾爾", "中國"], category="國際", media="上報", datetime="2021-08-17T13:00:00", link="https://www.upmedia.mg/news_info.php?SerialNo=121781", ), ) TEST_DATA_LIST = [TEST_DATA_1, TEST_DATA_2] @pytest.fixture(scope="module") def newsCrawler(): logger.warning("Init News Crawler ...") return upmedia.UpMedia() @pytest.mark.parametrize( argnames="name, link, expected_output", argvalues=[tuple(t) for t in TEST_DATA_LIST], ids=[ f"{t.name}, {t.link[:50]+'...' if len(t.link) > 50 else t.link}" for t in TEST_DATA_LIST ], ) def test_get_info( newsCrawler, name, link, expected_output, ): output = newsCrawler.getInfo(link=link) assert NewsStruct.__2dict__(output) == NewsStruct.__2dict__(expected_output)
63.697368
2,303
0.762652
583
4,841
6.26072
0.559177
0.020822
0.020548
0.020822
0.100274
0.090959
0.081096
0.06411
0.063836
0.055068
0
0.033855
0.115265
4,841
75
2,304
64.546667
0.817651
0.013634
0
0.229508
0
0.065574
0.729616
0.415217
0
0
0
0
0.016393
1
0.032787
false
0
0.098361
0
0.147541
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
faf9acbede76ccd00d7cd2d6ae36177e8da68930
2,472
gyp
Python
packager/media/filters/filters.gyp
nevil/shaka-packager
a217cdce294b5162ae305a310b2e53e73c4d0481
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
packager/media/filters/filters.gyp
nevil/shaka-packager
a217cdce294b5162ae305a310b2e53e73c4d0481
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
packager/media/filters/filters.gyp
nevil/shaka-packager
a217cdce294b5162ae305a310b2e53e73c4d0481
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
# Copyright 2014 Google Inc. All rights reserved. # # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE filters or at # https://developers.google.com/open-source/licenses/bsd { 'includes': [ '../../common.gypi', ], 'targets': [ { 'target_name': 'filters', 'type': '<(component)', 'sources': [ 'avc_decoder_configuration.cc', 'avc_decoder_configuration.h', 'decoder_configuration.cc', 'decoder_configuration.h', 'ec3_audio_util.cc', 'ec3_audio_util.h', 'h264_byte_to_unit_stream_converter.cc', 'h264_byte_to_unit_stream_converter.h', 'h264_parser.cc', 'h264_parser.h', 'h265_byte_to_unit_stream_converter.cc', 'h265_byte_to_unit_stream_converter.h', 'h265_parser.cc', 'h265_parser.h', 'h26x_bit_reader.cc', 'h26x_bit_reader.h', 'h26x_byte_to_unit_stream_converter.cc', 'h26x_byte_to_unit_stream_converter.h', 'hevc_decoder_configuration.cc', 'hevc_decoder_configuration.h', 'nal_unit_to_byte_stream_converter.cc', 'nal_unit_to_byte_stream_converter.h', 'nalu_reader.cc', 'nalu_reader.h', 'vp_codec_configuration.cc', 'vp_codec_configuration.h', 'vp8_parser.cc', 'vp8_parser.h', 'vp9_parser.cc', 'vp9_parser.h', 'vpx_parser.h', ], 'dependencies': [ '../../base/base.gyp:base', ], }, { 'target_name': 'filters_unittest', 'type': '<(gtest_target_type)', 'sources': [ 'avc_decoder_configuration_unittest.cc', 'ec3_audio_util_unittest.cc', 'h264_byte_to_unit_stream_converter_unittest.cc', 'h264_parser_unittest.cc', 'h265_byte_to_unit_stream_converter_unittest.cc', 'h265_parser_unittest.cc', 'h26x_bit_reader_unittest.cc', 'hevc_decoder_configuration_unittest.cc', 'nal_unit_to_byte_stream_converter_unittest.cc', 'nalu_reader_unittest.cc', 'vp_codec_configuration_unittest.cc', 'vp8_parser_unittest.cc', 'vp9_parser_unittest.cc', ], 'dependencies': [ '../../media/base/media_base.gyp:media_base', '../../testing/gmock.gyp:gmock', '../../testing/gtest.gyp:gtest', '../test/media_test.gyp:media_test_support', 'filters', ], }, ], }
30.9
57
0.613269
289
2,472
4.809689
0.273356
0.093525
0.057554
0.092086
0.253957
0.253957
0.146763
0
0
0
0
0.031823
0.25
2,472
79
58
31.291139
0.717907
0.084142
0
0.136986
0
0
0.641275
0.476085
0
0
0
0
0
1
0
true
0
0
0
0
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
1
1
null
0
0
0
0
0
0
1
0
0
0
0
0
0
3
4f0cb05896848b118b9bdcc3254c6c6fe235f356
304
py
Python
plugins/teedoc-plugin-markdown-parser/teedoc_plugin_markdown_parser/renderer.py
Neutree/teedoc
e909be61546e3817b872bd5005b9b867c6843e60
[ "MIT" ]
29
2021-02-05T10:00:45.000Z
2022-03-30T06:42:15.000Z
plugins/teedoc-plugin-markdown-parser/teedoc_plugin_markdown_parser/renderer.py
Neutree/teedoc
e909be61546e3817b872bd5005b9b867c6843e60
[ "MIT" ]
13
2021-08-06T03:39:31.000Z
2022-03-29T10:39:53.000Z
plugins/teedoc-plugin-markdown-parser/teedoc_plugin_markdown_parser/renderer.py
Neutree/teedoc
e909be61546e3817b872bd5005b9b867c6843e60
[ "MIT" ]
4
2021-02-23T08:31:35.000Z
2022-03-06T20:10:44.000Z
import mistune mistune_version = mistune.__version__.split(".") # 0.8.4, 2.0.0rc1 mistune_version = int(mistune_version[0]) * 10 + int(mistune_version[1]) # 8, 20 if mistune_version >= 20: from .renderer_new import create_markdown_parser else: from .renderer_old import create_markdown_parser
27.636364
80
0.753289
45
304
4.755556
0.488889
0.392523
0.158879
0.242991
0
0
0
0
0
0
0
0.061069
0.138158
304
10
81
30.4
0.755725
0.069079
0
0
0
0
0.00361
0
0
0
0
0
0
1
0
false
0
0.428571
0
0.428571
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
0
0
0
3
8793aaaec2fe62bbad3730eb76038db250c6edb4
133
py
Python
Codeforces/89 Beta Division 2/Problem A/A.py
VastoLorde95/Competitive-Programming
6c990656178fb0cd33354cbe5508164207012f24
[ "MIT" ]
170
2017-07-25T14:47:29.000Z
2022-01-26T19:16:31.000Z
Codeforces/89 Beta Division 2/Problem A/A.py
navodit15/Competitive-Programming
6c990656178fb0cd33354cbe5508164207012f24
[ "MIT" ]
null
null
null
Codeforces/89 Beta Division 2/Problem A/A.py
navodit15/Competitive-Programming
6c990656178fb0cd33354cbe5508164207012f24
[ "MIT" ]
55
2017-07-28T06:17:33.000Z
2021-10-31T03:06:22.000Z
d = {"A","E","I","O","U","Y"} s = raw_input() res = "" for c in s: if c.upper() not in d: res += '.' res += c.lower() print res
14.777778
29
0.458647
27
133
2.222222
0.703704
0
0
0
0
0
0
0
0
0
0
0
0.233083
133
8
30
16.625
0.588235
0
0
0
0
0
0.052632
0
0
0
0
0
0
0
null
null
0
0
null
null
0.125
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
3
879ef71dab92fadc5fbb38e65583f806e68b9c57
344
py
Python
shared/exceptions.py
conducto/conducto
b480780905f5a25e8c803b60ca7cdf6976ce5ef6
[ "Apache-2.0" ]
25
2020-05-07T22:51:11.000Z
2021-11-17T16:14:42.000Z
shared/exceptions.py
conducto/conducto
b480780905f5a25e8c803b60ca7cdf6976ce5ef6
[ "Apache-2.0" ]
3
2020-04-21T06:38:02.000Z
2020-05-31T01:57:19.000Z
shared/exceptions.py
conducto/conducto
b480780905f5a25e8c803b60ca7cdf6976ce5ef6
[ "Apache-2.0" ]
2
2020-05-14T01:47:32.000Z
2020-06-03T21:58:12.000Z
# TODO -- co.api.InvalidResponse is used in (client) public code. This should # move to private. class ClientError(Exception): def __init__(self, status_code, message): Exception.__init__(self) self.status_code = status_code self.message = message def to_dict(self): return {"message": self.message}
26.461538
78
0.674419
43
344
5.116279
0.581395
0.136364
0.127273
0
0
0
0
0
0
0
0
0
0.226744
344
12
79
28.666667
0.827068
0.270349
0
0
0
0
0.028226
0
0
0
0
0.083333
0
1
0.285714
false
0
0
0.142857
0.571429
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
1
0
0
0
1
0
0
0
3
879f2f30942922e4faafb6967e509ff9a929838e
251
py
Python
desafios/Mundo 1/Ex002.py
duartecgustavo/Python---Estudos-
13a47f115dd24ef475addaed7b0c860a7b3817ca
[ "MIT" ]
6
2021-01-20T20:43:39.000Z
2021-08-13T15:44:10.000Z
desafios/Mundo 1/Ex002.py
duartecgustavo/PythonProgress
13a47f115dd24ef475addaed7b0c860a7b3817ca
[ "MIT" ]
null
null
null
desafios/Mundo 1/Ex002.py
duartecgustavo/PythonProgress
13a47f115dd24ef475addaed7b0c860a7b3817ca
[ "MIT" ]
1
2020-09-06T03:34:19.000Z
2020-09-06T03:34:19.000Z
# Desafio 2 - Aula 5 : Primeiro 'input' e lista simplês com cores. nome = input('Me diga seu nome: ') cor = {'azul' : '\033[34m', 'limpa' : '\033[m'} print(f'Seu nome é,\033[34m{nome}{cor["limpa"]}!') print(f'Seu nome é \033[34m{nome}\033[m!')
35.857143
66
0.601594
44
251
3.431818
0.545455
0.139073
0.119205
0.172185
0.317881
0.317881
0.317881
0.317881
0
0
0
0.110577
0.171315
251
7
67
35.857143
0.615385
0.25498
0
0
0
0
0.607527
0.27957
0
0
0
0
0
1
0
false
0
0
0
0
0.4
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
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
87a154385d45b56e6c223157f7178b20d73dac15
219
py
Python
apps/home/serializers.py
elgedawy/hidc
09fbd96590e6d4534cb14be46928700e2a58404d
[ "MIT" ]
null
null
null
apps/home/serializers.py
elgedawy/hidc
09fbd96590e6d4534cb14be46928700e2a58404d
[ "MIT" ]
null
null
null
apps/home/serializers.py
elgedawy/hidc
09fbd96590e6d4534cb14be46928700e2a58404d
[ "MIT" ]
null
null
null
from dataclasses import field from rest_framework import serializers from .models import Request class RequestSerializer(serializers.ModelSerializer): class Meta: model = Request fields = '__all__'
24.333333
53
0.757991
23
219
7
0.695652
0
0
0
0
0
0
0
0
0
0
0
0.196347
219
9
54
24.333333
0.914773
0
0
0
0
0
0.031818
0
0
0
0
0
0
1
0
false
0
0.428571
0
0.714286
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
3
87cf50cebc755e5554d107b13249502e275e2dfa
11,593
py
Python
tests/manifolds/test_symmetric_positive_definite.py
navigator8972/pymanopt
b9f53fa2d187c22ae75f65c71aeeb2bfa8b9c37f
[ "BSD-3-Clause" ]
null
null
null
tests/manifolds/test_symmetric_positive_definite.py
navigator8972/pymanopt
b9f53fa2d187c22ae75f65c71aeeb2bfa8b9c37f
[ "BSD-3-Clause" ]
null
null
null
tests/manifolds/test_symmetric_positive_definite.py
navigator8972/pymanopt
b9f53fa2d187c22ae75f65c71aeeb2bfa8b9c37f
[ "BSD-3-Clause" ]
null
null
null
import autograd.numpy as np import numpy.testing as np_testing from scipy.linalg import eigvalsh, expm, logm from pymanopt.manifolds import SymmetricPositiveDefinite from pymanopt.tools.multi import multiexpm, multilogm, multisym, multitransp from ._manifold_tests import ManifoldTestCase def geodesic(point_a, point_b, alpha): if alpha < 0 or 1 < alpha: raise ValueError("Exponent must be in [0,1]") c = np.linalg.cholesky(point_a) c_inv = np.linalg.inv(c) log_cbc = multilogm( c_inv @ point_b @ multitransp(c_inv), positive_definite=True, ) powm = multiexpm(alpha * log_cbc, symmetric=False) return c @ powm @ multitransp(c) class TestSingleSymmetricPositiveDefiniteManifold(ManifoldTestCase): def setUp(self): self.n = n = 15 self.manifold = SymmetricPositiveDefinite(n) super().setUp() def test_random_point(self): # Just test that rand returns a point on the manifold and two # different matrices generated by rand aren't too close together n = self.n manifold = self.manifold x = manifold.random_point() assert np.shape(x) == (n, n) # Check symmetry np_testing.assert_allclose(x, multisym(x)) # Check positivity of eigenvalues w = np.linalg.eigvalsh(x) assert (w > [0]).all() def test_dist(self): manifold = self.manifold x = manifold.random_point() y = manifold.random_point() z = manifold.random_point() # Test separability np_testing.assert_almost_equal(manifold.dist(x, x), 0.0) # Test symmetry np_testing.assert_almost_equal( manifold.dist(x, y), manifold.dist(y, x) ) # Test triangle inequality assert manifold.dist(x, y) <= manifold.dist(x, z) + manifold.dist(z, y) # Test alternative implementation (see equation (6.14) in [Bha2007]). d = np.sqrt((np.log(eigvalsh(x, y)) ** 2).sum()) np_testing.assert_almost_equal(manifold.dist(x, y), d) # Test exponential metric increasing property # (see equation (6.8) in [Bha2007]). assert manifold.dist(x, y) >= np.linalg.norm(logm(x) - logm(y)) # check that dist is consistent with log np_testing.assert_almost_equal( manifold.dist(x, y), manifold.norm(x, manifold.log(x, y)) ) # Test invariance under inversion np_testing.assert_almost_equal( manifold.dist(x, y), manifold.dist(np.linalg.inv(y), np.linalg.inv(x)), ) # Test congruence-invariance a = np.random.normal(size=(self.n, self.n)) # must be invertible axa = a @ x @ multitransp(a) aya = a @ y @ multitransp(a) np_testing.assert_almost_equal( manifold.dist(x, y), manifold.dist(axa, aya) ) # Test proportionality (see equation (6.12) in [Bha2007]). alpha = np.random.uniform() np_testing.assert_almost_equal( manifold.dist(x, geodesic(x, y, alpha)), alpha * manifold.dist(x, y), ) def test_exp(self): manifold = self.manifold x = manifold.random_point() u = manifold.random_tangent_vector(x) e = expm(np.linalg.solve(x, u)) np_testing.assert_allclose(x @ e, manifold.exp(x, u)) u = u * 1e-6 np_testing.assert_allclose(manifold.exp(x, u), x + u) def test_random_tangent_vector(self): # Just test that random_tangent_vector returns an element of the tangent space # with norm 1 and that two random_tangent_vectors are different. manifold = self.manifold x = manifold.random_point() u = manifold.random_tangent_vector(x) v = manifold.random_tangent_vector(x) np_testing.assert_allclose(multisym(u), u) np_testing.assert_almost_equal(1, manifold.norm(x, u)) assert np.linalg.norm(u - v) > 1e-3 def test_norm(self): manifold = self.manifold x = manifold.random_point() np_testing.assert_almost_equal( manifold.norm(np.eye(self.n), x), np.linalg.norm(x) ) def test_exp_log_inverse(self): manifold = self.manifold x = manifold.random_point() y = manifold.random_point() u = manifold.log(x, y) np_testing.assert_allclose(manifold.exp(x, u), y) def test_log_exp_inverse(self): manifold = self.manifold x = manifold.random_point() u = manifold.random_tangent_vector(x) y = manifold.exp(x, u) np_testing.assert_allclose(manifold.log(x, y), u) class TestMultiSymmetricPositiveDefiniteManifold(ManifoldTestCase): def setUp(self): self.n = n = 10 self.k = k = 3 self.manifold = SymmetricPositiveDefinite(n, k=k) super().setUp() def test_dim(self): manifold = self.manifold n = self.n k = self.k np_testing.assert_equal(manifold.dim, 0.5 * k * n * (n + 1)) def test_typical_dist(self): manifold = self.manifold np_testing.assert_equal(manifold.typical_dist, np.sqrt(manifold.dim)) def test_dist(self): # n = self.n manifold = self.manifold x = manifold.random_point() y = manifold.random_point() z = manifold.random_point() # Test separability np_testing.assert_almost_equal(manifold.dist(x, x), 0.0) # Test symmetry np_testing.assert_almost_equal( manifold.dist(x, y), manifold.dist(y, x) ) # Test triangle inequality assert manifold.dist(x, y) <= manifold.dist(x, z) + manifold.dist(z, y) # Test exponential metric increasing property # (see equation (6.8) in [Bha2007]). logx, logy = multilogm(x), multilogm(y) assert manifold.dist(x, y) >= np.linalg.norm(logx - logy) # check that dist is consistent with log np_testing.assert_almost_equal( manifold.dist(x, y), manifold.norm(x, manifold.log(x, y)) ) # Test invariance under inversion np_testing.assert_almost_equal( manifold.dist(x, y), manifold.dist(np.linalg.inv(y), np.linalg.inv(x)), ) # Test congruence-invariance a = np.random.normal(size=(self.n, self.n)) # must be invertible axa = a @ x @ multitransp(a) aya = a @ y @ multitransp(a) np_testing.assert_almost_equal( manifold.dist(x, y), manifold.dist(axa, aya) ) # Test proportionality (see equation (6.12) in [Bha2007]). alpha = np.random.uniform() np_testing.assert_almost_equal( manifold.dist(x, geodesic(x, y, alpha)), alpha * manifold.dist(x, y), ) def test_inner_product(self): manifold = self.manifold k = self.k n = self.n x = manifold.random_point() a, b = np.random.normal(size=(2, k, n, n)) np_testing.assert_almost_equal( np.tensordot(a, b.transpose((0, 2, 1)), axes=a.ndim), manifold.inner_product(x, x @ a, x @ b), ) def test_projection(self): manifold = self.manifold x = manifold.random_point() a = np.random.normal(size=(self.k, self.n, self.n)) np_testing.assert_allclose(manifold.projection(x, a), multisym(a)) def test_euclidean_to_riemannian_gradient(self): manifold = self.manifold x = manifold.random_point() u = np.random.normal(size=(self.k, self.n, self.n)) np_testing.assert_allclose( manifold.euclidean_to_riemannian_gradient(x, u), x @ multisym(u) @ x, ) def test_euclidean_to_riemannian_gradient_from_cost(self): self.run_gradient_test() def test_euclidean_to_riemannian_hessian(self): # Use manopt's slow method manifold = self.manifold n = self.n k = self.k x = manifold.random_point() egrad, ehess = np.random.normal(size=(2, k, n, n)) u = manifold.random_tangent_vector(x) Hess = x @ multisym(ehess) @ x + 2 * multisym(u @ multisym(egrad) @ x) # Correction factor for the non-constant metric Hess = Hess - multisym(u @ multisym(egrad) @ x) np_testing.assert_almost_equal( Hess, manifold.euclidean_to_riemannian_hessian(x, egrad, ehess, u) ) def test_norm(self): manifold = self.manifold x = manifold.random_point() Id = np.array(self.k * [np.eye(self.n)]) np_testing.assert_almost_equal(manifold.norm(Id, x), np.linalg.norm(x)) def test_random_point(self): # Just test that rand returns a point on the manifold and two # different matrices generated by rand aren't too close together k = self.k n = self.n manifold = self.manifold x = manifold.random_point() assert np.shape(x) == (k, n, n) # Check symmetry np_testing.assert_allclose(x, multisym(x)) # Check positivity of eigenvalues w = np.linalg.eigvalsh(x) assert (w > [[0]]).all() def test_random_tangent_vector(self): # Just test that random_tangent_vector returns an element of the tangent space # with norm 1 and that two random_tangent_vectors are different. manifold = self.manifold x = manifold.random_point() u = manifold.random_tangent_vector(x) v = manifold.random_tangent_vector(x) np_testing.assert_allclose(multisym(u), u) np_testing.assert_almost_equal(1, manifold.norm(x, u)) assert np.linalg.norm(u - v) > 1e-3 def test_transport(self): manifold = self.manifold x = manifold.random_point() y = manifold.random_point() u = manifold.random_tangent_vector(x) np_testing.assert_allclose(manifold.transport(x, y, u), u) def test_exp(self): # Test against manopt implementation, test that for small vectors # exp(x, u) = x + u. manifold = self.manifold x = manifold.random_point() u = manifold.random_tangent_vector(x) e = np.zeros((self.k, self.n, self.n)) for i in range(self.k): e[i] = expm(np.linalg.solve(x[i], u[i])) np_testing.assert_allclose(x @ e, manifold.exp(x, u)) u = u * 1e-6 np_testing.assert_allclose(manifold.exp(x, u), x + u) def test_retraction(self): # Check that result is on manifold and for small vectors # retr(x, u) = x + u. manifold = self.manifold x = manifold.random_point() u = manifold.random_tangent_vector(x) y = manifold.retraction(x, u) assert np.shape(y) == (self.k, self.n, self.n) # Check symmetry np_testing.assert_allclose(y, multisym(y)) # Check positivity of eigenvalues w = np.linalg.eigvalsh(y) assert (w > [[0]]).all() u = u * 1e-6 np_testing.assert_allclose(manifold.retraction(x, u), x + u) def test_exp_log_inverse(self): manifold = self.manifold x = manifold.random_point() y = manifold.random_point() u = manifold.log(x, y) np_testing.assert_allclose(manifold.exp(x, u), y) def test_log_exp_inverse(self): manifold = self.manifold x = manifold.random_point() u = manifold.random_tangent_vector(x) y = manifold.exp(x, u) np_testing.assert_allclose(manifold.log(x, y), u)
34.097059
86
0.610713
1,541
11,593
4.44841
0.123945
0.051204
0.083151
0.058352
0.774179
0.736397
0.709847
0.679358
0.65062
0.61736
0
0.008727
0.278444
11,593
339
87
34.19764
0.810759
0.137497
0
0.64557
0
0
0.002511
0
0
0
0
0
0.21097
1
0.109705
false
0
0.025316
0
0.147679
0
0
0
0
null
0
0
0
0
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
87dd596ebc705bb161b7b86a3cf7b6d2524b82b8
262
py
Python
meeting (1)/color.py
ilia85-star/WebScraper
2a86f71eba8dbfca8d46208e7a7c4504799d6bc0
[ "MIT" ]
null
null
null
meeting (1)/color.py
ilia85-star/WebScraper
2a86f71eba8dbfca8d46208e7a7c4504799d6bc0
[ "MIT" ]
null
null
null
meeting (1)/color.py
ilia85-star/WebScraper
2a86f71eba8dbfca8d46208e7a7c4504799d6bc0
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 class Color(): black = "\u001b[30m" red = "\u001b[31m" green = "\u001b[32m" yellow = "\u001b[33m" blue = "\u001b[34m" magenta = "\u001b[35m" cyan = "\u001b[36m" white = "\u001b[37m" reset = "\u001b[0m"
20.153846
26
0.538168
33
262
4.272727
0.757576
0
0
0
0
0
0
0
0
0
0
0.231959
0.259542
262
12
27
21.833333
0.494845
0.080153
0
0
0
0
0.370833
0
0
0
0
0
0
1
0
false
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
3
87e01fbca82f22178a864fe75aa8119590a73a99
248
py
Python
molecule/default/tests/test_default.py
sansible/ruby
8c7a294c6e56eec297ff9c969055f96dcbaa9741
[ "MIT" ]
1
2018-01-24T08:20:58.000Z
2018-01-24T08:20:58.000Z
molecule/default/tests/test_default.py
sansible/ruby
8c7a294c6e56eec297ff9c969055f96dcbaa9741
[ "MIT" ]
3
2016-09-30T15:46:43.000Z
2018-02-16T12:55:24.000Z
molecule/default/tests/test_default.py
sansible/ruby
8c7a294c6e56eec297ff9c969055f96dcbaa9741
[ "MIT" ]
1
2021-01-03T18:24:45.000Z
2021-01-03T18:24:45.000Z
import os import testinfra.utils.ansible_runner testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') def test_ruby_installed(host): host.package("ruby2.2").is_installed
22.545455
63
0.794355
33
248
5.69697
0.69697
0.148936
0.223404
0.287234
0
0
0
0
0
0
0
0.008889
0.092742
248
10
64
24.8
0.826667
0
0
0
0
0
0.133065
0.092742
0
0
0
0
0
1
0.166667
false
0
0.333333
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
0
0
0
1
0
0
0
0
3
87e0f638ed04e208ee128e3b339e280ef6905a9b
209
py
Python
elementable/exceptions.py
lilyminium/elementary
d522a92af4b777a86ca2b238a112ed7bfcb352ed
[ "MIT" ]
1
2022-01-31T16:42:22.000Z
2022-01-31T16:42:22.000Z
elementable/exceptions.py
lilyminium/elementary
d522a92af4b777a86ca2b238a112ed7bfcb352ed
[ "MIT" ]
6
2022-01-31T00:28:13.000Z
2022-02-01T02:46:15.000Z
elementable/exceptions.py
lilyminium/pyelementary
d522a92af4b777a86ca2b238a112ed7bfcb352ed
[ "MIT" ]
null
null
null
class ElementableError(Exception): pass class InvalidElementError(KeyError, ElementableError): def __init__(self, msg): msg = f"Element {msg} is not supported" super().__init__(msg)
20.9
54
0.688995
22
209
6.181818
0.727273
0
0
0
0
0
0
0
0
0
0
0
0.210526
209
9
55
23.222222
0.824242
0
0
0
0
0
0.143541
0
0
0
0
0
0
1
0.166667
false
0.166667
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
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
3
87e5e4fba314d992b9e871647d149a16cd3d0d4e
768
py
Python
books/models.py
Fredy/Library-Py
6d77f0afadc3d651c680fc149ac0d1993dd9f4ff
[ "MIT" ]
null
null
null
books/models.py
Fredy/Library-Py
6d77f0afadc3d651c680fc149ac0d1993dd9f4ff
[ "MIT" ]
null
null
null
books/models.py
Fredy/Library-Py
6d77f0afadc3d651c680fc149ac0d1993dd9f4ff
[ "MIT" ]
null
null
null
from django.db import models class Author(models.Model): first_name = models.CharField(max_length=20) last_name = models.CharField(max_length=20) birth_date = models.DateField() def __str__(self): return ' '.join([self.first_name, self.last_name]) class Genre(models.Model): name = models.CharField(max_length=20) def __str__(self): return self.name class Book(models.Model): title = models.CharField(max_length=50) authors = models.ManyToManyField(Author) pub_date = models.DateField() edition = models.IntegerField() cover_url = models.CharField(max_length=100) stock = models.IntegerField(default=0) genres = models.ManyToManyField(Genre) def __str__(self): return self.title
24.774194
58
0.700521
97
768
5.298969
0.402062
0.145914
0.175097
0.233463
0.252918
0.175097
0
0
0
0
0
0.019293
0.190104
768
30
59
25.6
0.807074
0
0
0.142857
0
0
0.001302
0
0
0
0
0
0
1
0.142857
false
0
0.047619
0.142857
1
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
3
87f34581e1f094c7dc99dee560838071f409e517
162
py
Python
src/nip/NTIPAliasFlag.py
roozhou/botty
a67a87845687cdf6900af10a13dc7170684faa9a
[ "MIT" ]
null
null
null
src/nip/NTIPAliasFlag.py
roozhou/botty
a67a87845687cdf6900af10a13dc7170684faa9a
[ "MIT" ]
null
null
null
src/nip/NTIPAliasFlag.py
roozhou/botty
a67a87845687cdf6900af10a13dc7170684faa9a
[ "MIT" ]
null
null
null
NTIPAliasFlag = {} NTIPAliasFlag["identified"]="0x10" NTIPAliasFlag["eth"]="0x400000" NTIPAliasFlag["ethereal"]="0x400000" NTIPAliasFlag["runeword"]="0x4000000"
23.142857
37
0.759259
13
162
9.461538
0.615385
0.341463
0
0
0
0
0
0
0
0
0
0.162338
0.049383
162
6
38
27
0.636364
0
0
0
0
0
0.360248
0
0
0
0.180124
0
0
1
0
false
0
0
0
0
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
3
87ff7173909399138649f994dc13110243694f98
472
py
Python
tests/functional-utils/test_functional_tools.py
carver/ethereum-utils
7ec2495b25107776cb4e0e4a79af8a8c64f622c4
[ "MIT" ]
1
2018-02-09T01:30:27.000Z
2018-02-09T01:30:27.000Z
tests/functional-utils/test_functional_tools.py
carver/ethereum-utils
7ec2495b25107776cb4e0e4a79af8a8c64f622c4
[ "MIT" ]
null
null
null
tests/functional-utils/test_functional_tools.py
carver/ethereum-utils
7ec2495b25107776cb4e0e4a79af8a8c64f622c4
[ "MIT" ]
2
2017-06-13T15:17:09.000Z
2021-06-17T11:09:32.000Z
from eth_utils.functional import compose def test_composition_no_functions(): fn = compose() assert fn(5) == 5 def test_composition_single_function(): def fn(x): return x * 2 assert compose(fn)(5) == 10 def test_composition_multiple_function(): def fn(x): return x + 1 assert compose(fn, fn, fn)(5) == 8 def test_ordering_is_preserved(): assert compose( lambda v: v * 3, lambda v: v + 1, )(1) == 4
16.857143
41
0.610169
68
472
4.044118
0.441176
0.101818
0.196364
0.101818
0.152727
0.152727
0
0
0
0
0
0.038012
0.275424
472
27
42
17.481481
0.766082
0
0
0.117647
0
0
0
0
0
0
0
0
0.235294
1
0.352941
false
0
0.058824
0.117647
0.529412
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
3
e210434be14b24348a7db5da19eae2e7c7a45471
245
py
Python
watchmen/raw_data/mapping.py
Indexical-Metrics-Measure-Advisory/watchmen-data-processor
d50b93e92868500552416997707d71720487bd77
[ "MIT" ]
null
null
null
watchmen/raw_data/mapping.py
Indexical-Metrics-Measure-Advisory/watchmen-data-processor
d50b93e92868500552416997707d71720487bd77
[ "MIT" ]
null
null
null
watchmen/raw_data/mapping.py
Indexical-Metrics-Measure-Advisory/watchmen-data-processor
d50b93e92868500552416997707d71720487bd77
[ "MIT" ]
null
null
null
from watchmen.common.watchmen_model import WatchmenModel class Mapping(WatchmenModel): mapping_id: int source_entity_id: int source_entity_name: str target_topic_id: int target_topic_name: str mapping_detail_list: list
22.272727
56
0.77551
33
245
5.393939
0.545455
0.08427
0.123596
0.191011
0
0
0
0
0
0
0
0
0.179592
245
10
57
24.5
0.885572
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.125
0
1
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
1
0
0
3
3554752f1a0210cda0928491d002f995503af5bc
5,030
py
Python
geomstats/backend/tensorflow.py
tolgabirdal/geomstats
27667a9fbd8d3b8fa7a5da0e34d880ce0ad39d51
[ "MIT" ]
null
null
null
geomstats/backend/tensorflow.py
tolgabirdal/geomstats
27667a9fbd8d3b8fa7a5da0e34d880ce0ad39d51
[ "MIT" ]
null
null
null
geomstats/backend/tensorflow.py
tolgabirdal/geomstats
27667a9fbd8d3b8fa7a5da0e34d880ce0ad39d51
[ "MIT" ]
null
null
null
"""Tensorflow based computation backend.""" import tensorflow as tf int8 = tf.int8 int32 = tf.int32 int64 = tf.int64 float16 = tf.float16 float32 = tf.float32 float64 = tf.float64 def while_loop(*args, **kwargs): return tf.while_loop(*args, **kwargs) def logical_or(x, y): return tf.logical_or(x, y) def get_mask_i_float(i, n): range_n = arange(n) i_float = cast(array([i]), int32)[0] mask_i = equal(range_n, i_float) mask_i_float = cast(mask_i, float32) return mask_i_float def gather(*args, **kwargs): return tf.gather(*args, **kwargs) def where(*args, **kwargs): return tf.where(*args, **kwargs) def vectorize(x, pyfunc, multiple_args=False, dtype=None, **kwargs): if multiple_args: return tf.map_fn(lambda x: pyfunc(*x), elems=x, dtype=dtype) return tf.map_fn(pyfunc, elems=x, dtype=dtype) def sign(x): return tf.sign(x) def hsplit(x, n_splits): return tf.split(x, num_or_size_splits=n_splits, axis=1) def amax(x): return tf.reduce_max(x) def real(x): return tf.real(x) def cond(*args, **kwargs): return tf.cond(*args, **kwargs) def reshape(*args, **kwargs): return tf.reshape(*args, **kwargs) def arange(*args, **kwargs): return tf.range(*args, **kwargs) def outer(x, y): return tf.einsum('i,j->ij', x, y) def copy(x): return tf.Variable(x) def linspace(start, stop, num): return tf.linspace(start, stop, num) def mod(x, y): return tf.mod(x, y) def boolean_mask(x, mask, name='boolean_mask', axis=None): return tf.boolean_mask(x, mask, name, axis) def exp(x): return tf.exp(x) def log(x): return tf.log(x) def hstack(x): return tf.concat(x, axis=1) def vstack(x): return tf.concat(x, axis=0) def cast(x, dtype): return tf.cast(x, dtype) def divide(x1, x2): return tf.divide(x1, x2) def tile(x, reps): return tf.tile(x, reps) def eval(x): if tf.executing_eagerly(): return x return x.eval() def abs(x): return tf.abs(x) def zeros(x): return tf.zeros(x) def ones(x): return tf.ones(x) def sin(x): return tf.sin(x) def cos(x): return tf.cos(x) def cosh(x): return tf.cosh(x) def sinh(x): return tf.sinh(x) def tanh(x): return tf.tanh(x) def arccosh(x): return tf.acosh(x) def tan(x): return tf.tan(x) def arcsin(x): return tf.asin(x) def arccos(x): return tf.acos(x) def shape(x): return tf.shape(x) def ndim(x): x = array(x) dims = x.get_shape()._dims if dims is not None: return len(dims) return None def dot(x, y): return tf.tensordot(x, y, axes=1) def maximum(x, y): return tf.maximum(x, y) def greater(x, y): return tf.greater(x, y) def greater_equal(x, y): return tf.greater_equal(x, y) def equal(x, y): return tf.equal(x, y) def to_ndarray(x, to_ndim, axis=0): if ndim(x) == to_ndim - 1: x = tf.expand_dims(x, axis=axis) return x def sqrt(x): return tf.sqrt(x) def isclose(x, y, rtol=1e-05, atol=1e-08): rhs = tf.constant(atol) + tf.constant(rtol) * tf.abs(y) return tf.less_equal(tf.abs(tf.subtract(x, y)), rhs) def allclose(x, y, rtol=1e-05, atol=1e-08): return tf.reduce_all(isclose(x, y, rtol=rtol, atol=atol)) def less(x, y): return tf.less(x, y) def less_equal(x, y): return tf.less_equal(x, y) def eye(n, m=None): if m is None: m = n n = cast(n, dtype=int32) m = cast(m, dtype=int32) return tf.eye(num_rows=n, num_columns=m) def matmul(x, y): return tf.matmul(x, y) def argmax(*args, **kwargs): return tf.argmax(*args, **kwargs) def sum(*args, **kwargs): return tf.reduce_sum(*args, **kwargs) def einsum(equation, *inputs, **kwargs): return tf.einsum(equation, *inputs, **kwargs) def transpose(x, axes=None): return tf.transpose(x, perm=axes) def squeeze(x, **kwargs): return tf.squeeze(x, **kwargs) def zeros_like(x): return tf.zeros_like(x) def ones_like(x): return tf.ones_like(x) def trace(x, **kwargs): return tf.trace(x) def array(x): return tf.convert_to_tensor(x) def all(bool_tensor, axis=None, keepdims=False): bool_tensor = tf.cast(bool_tensor, tf.bool) all_true = tf.reduce_all(bool_tensor, axis, keepdims) return all_true def concatenate(*args, **kwargs): return tf.concat(*args, **kwargs) def asarray(x): return x def expand_dims(x, axis=None): return tf.expand_dims(x, axis) def clip(x, min_value, max_value): return tf.clip_by_value(x, min_value, max_value) def floor(x): return tf.floor(x) def diag(a): return tf.map_fn( lambda x: tf.diag(x), a) def cross(a, b): return tf.cross(a, b) def stack(*args, **kwargs): return tf.stack(*args, **kwargs) def arctan2(*args, **kwargs): return tf.atan2(*args, **kwargs) def diagonal(*args, **kwargs): return tf.linalg.diag_part(*args) def mean(x, axis=None): return tf.reduce_mean(x, axis)
15.150602
68
0.626839
856
5,030
3.601636
0.192757
0.179046
0.0759
0.070062
0.118716
0.037626
0.011677
0.011677
0
0
0
0.013945
0.215905
5,030
331
69
15.196375
0.767748
0.007356
0
0.016854
0
0
0.00381
0
0
0
0
0
0
1
0.41573
false
0
0.005618
0.370787
0.853933
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
3
355dfcb6c8d33e2748ee481458e4fbcec11c77b1
539
py
Python
mwarp1d/ui/figures/artists/__init__.py
0todd0000/mwarp1d
7b40a47e6c112a8da5a1b67aff890fc77fe83d71
[ "MIT" ]
null
null
null
mwarp1d/ui/figures/artists/__init__.py
0todd0000/mwarp1d
7b40a47e6c112a8da5a1b67aff890fc77fe83d71
[ "MIT" ]
6
2019-11-25T08:15:05.000Z
2020-02-07T13:05:59.000Z
mwarp1d/ui/figures/artists/__init__.py
0todd0000/mwarp1d
7b40a47e6c112a8da5a1b67aff890fc77fe83d71
[ "MIT" ]
2
2019-11-28T02:58:14.000Z
2019-12-18T11:45:33.000Z
from . collection import TemplateWithLandmarks, SourceWithLandmarks from . crosshairs import Crosshairs,CrosshairsManual from . draggable_points import SourceLandmarks, TemplateLandmarks from . selectable_line import Source,Template from . stack import SelectionStack from . template_source_plot import TemplateSourcePlot from . vertical_reference import VerticalReference from . warpable_line import WarpableSource,WarpableTemplate from . warp_marker import WarpMarker from . template_source_plot_manual import TemplateSourcePlotManual
41.461538
67
0.871985
55
539
8.363636
0.545455
0.043478
0.078261
0.095652
0
0
0
0
0
0
0
0
0.100186
539
13
68
41.461538
0.948454
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
3