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
da5666d0eab8ab20297dd79c0c4178a5b01084cc
400
py
Python
quotes/routes.py
vsgobbi/Quotes-Pyramid-REST-API
78dfc6e7bccdc7fbbf8d3ef7c10712727a74db42
[ "FTL", "CNRI-Python" ]
null
null
null
quotes/routes.py
vsgobbi/Quotes-Pyramid-REST-API
78dfc6e7bccdc7fbbf8d3ef7c10712727a74db42
[ "FTL", "CNRI-Python" ]
null
null
null
quotes/routes.py
vsgobbi/Quotes-Pyramid-REST-API
78dfc6e7bccdc7fbbf8d3ef7c10712727a74db42
[ "FTL", "CNRI-Python" ]
null
null
null
def includeme(config): config.add_route('index', '/') config.add_route('home', '/home') config.add_route('quotes', '/quotes') config.add_route('random_quote', '/quotes/random') config.add_route('get_quote', '/quotes/{id}') config.add_route('delete_quote', '/delete/{id}') config.add_route('get_sessions', '/sessions') config.add_route('get_session', '/sessions/{id}')
40
54
0.6625
51
400
4.941176
0.294118
0.285714
0.444444
0.202381
0
0
0
0
0
0
0
0
0.125
400
9
55
44.444444
0.72
0
0
0
0
0
0.3625
0
0
0
0
0
0
1
0.111111
false
0
0
0
0.111111
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
da64fd555e9d82bb0a95ebb00d1a900b6407ae9b
181
py
Python
appserver/neo4japp/services/annotations/lmdb_service.py
SBRG/lifelike
a7b715f38b389a585c10e6d0d067345937455c13
[ "MIT" ]
8
2022-01-28T08:43:07.000Z
2022-03-23T11:18:10.000Z
appserver/neo4japp/services/annotations/lmdb_service.py
SBRG/lifelike
a7b715f38b389a585c10e6d0d067345937455c13
[ "MIT" ]
23
2022-02-14T15:25:00.000Z
2022-03-28T15:30:45.000Z
appserver/neo4japp/services/annotations/lmdb_service.py
SBRG/lifelike
a7b715f38b389a585c10e6d0d067345937455c13
[ "MIT" ]
5
2022-01-28T15:45:44.000Z
2022-03-14T11:36:49.000Z
from .lmdb_connection import LMDBConnection class LMDBService(LMDBConnection): def __init__(self, dirpath: str, **kwargs) -> None: super().__init__(dirpath, **kwargs)
25.857143
55
0.718232
19
181
6.368421
0.789474
0
0
0
0
0
0
0
0
0
0
0
0.160221
181
6
56
30.166667
0.796053
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.25
0
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
da662fb851a025be172c78d897899c175c67f5e4
148
py
Python
User/transform.py
rvock/Sublime-Text-Preferences
fbe408bc4740dee984d37336aa2888c8aaa0d74b
[ "MIT" ]
1
2015-05-18T15:52:47.000Z
2015-05-18T15:52:47.000Z
User/transform.py
rvock/Sublime-Text-Preferences
fbe408bc4740dee984d37336aa2888c8aaa0d74b
[ "MIT" ]
null
null
null
User/transform.py
rvock/Sublime-Text-Preferences
fbe408bc4740dee984d37336aa2888c8aaa0d74b
[ "MIT" ]
null
null
null
import string import sublime import sublime_plugin import zlib class GzdecodeCommand(Transformer): transformer = lambda s: zlib.decompress(s),
18.5
47
0.804054
18
148
6.555556
0.611111
0.220339
0
0
0
0
0
0
0
0
0
0
0.135135
148
7
48
21.142857
0.921875
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.666667
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
da724733b43cfc0be66a674b41056936cad9202f
68
py
Python
engineer/contrib/__init__.py
tylerbutler/engineer
1fdcae512a828ea681be8c469f6863b974260614
[ "MIT" ]
6
2015-09-21T17:50:43.000Z
2021-04-13T07:27:39.000Z
engineer/contrib/__init__.py
pridkett/engineer
2d0227f65fbd977cb84f138c043cdbf8f6ab5351
[ "MIT" ]
40
2015-08-25T00:33:28.000Z
2020-09-22T17:54:52.000Z
engineer/contrib/__init__.py
pridkett/engineer
2d0227f65fbd977cb84f138c043cdbf8f6ab5351
[ "MIT" ]
5
2016-03-26T15:02:56.000Z
2017-03-16T00:06:10.000Z
# coding=utf-8 __author__ = 'Tyler Butler <tyler@tylerbutler.com>'
17
51
0.735294
9
68
5.111111
0.888889
0
0
0
0
0
0
0
0
0
0
0.016667
0.117647
68
3
52
22.666667
0.75
0.176471
0
0
0
0
0.666667
0.425926
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
da742b444649015cf8914cf3d6ec23695d5c962f
63
py
Python
galibrate/__init__.py
blakeaw/GAlibrate
cb16b4b7644cd191194bd45df7301b6a3f5b3726
[ "MIT" ]
6
2019-07-22T19:52:31.000Z
2020-07-03T14:43:52.000Z
galibrate/__init__.py
blakeaw/GAlibrate
cb16b4b7644cd191194bd45df7301b6a3f5b3726
[ "MIT" ]
1
2020-01-30T08:55:30.000Z
2020-02-24T21:37:27.000Z
galibrate/__init__.py
blakeaw/GAlibrate
cb16b4b7644cd191194bd45df7301b6a3f5b3726
[ "MIT" ]
2
2019-08-04T14:56:27.000Z
2020-09-25T22:02:11.000Z
"""Initialize the galibrate package. """ from .gao import GAO
15.75
36
0.714286
8
63
5.625
0.875
0
0
0
0
0
0
0
0
0
0
0
0.15873
63
3
37
21
0.849057
0.52381
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
da842af1dfa7814ce255f2215aac0e4a34924d14
153
py
Python
pydec/io/__init__.py
michaels10/pydec
738c3d9cf1cedc95a61be63fae36073e038d08bc
[ "BSD-3-Clause" ]
null
null
null
pydec/io/__init__.py
michaels10/pydec
738c3d9cf1cedc95a61be63fae36073e038d08bc
[ "BSD-3-Clause" ]
null
null
null
pydec/io/__init__.py
michaels10/pydec
738c3d9cf1cedc95a61be63fae36073e038d08bc
[ "BSD-3-Clause" ]
null
null
null
"PyDEC mesh and array IO" from info import __doc__ from meshio import * from arrayio import * __all__ = filter(lambda s:not s.startswith('_'),dir())
15.3
54
0.72549
23
153
4.434783
0.782609
0
0
0
0
0
0
0
0
0
0
0
0.169935
153
9
55
17
0.80315
0.150327
0
0
0
0
0.157895
0
0
0
0
0
0
1
0
false
0
0.6
0
0.6
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
e509c6e785d37348c425782cb1474db703cfe589
189
py
Python
convenient/decorators.py
ixc/glamkit-convenient
e88bcbe3f7f9405ff25ad4bebe405b858e550cff
[ "BSD-3-Clause" ]
null
null
null
convenient/decorators.py
ixc/glamkit-convenient
e88bcbe3f7f9405ff25ad4bebe405b858e550cff
[ "BSD-3-Clause" ]
null
null
null
convenient/decorators.py
ixc/glamkit-convenient
e88bcbe3f7f9405ff25ad4bebe405b858e550cff
[ "BSD-3-Clause" ]
null
null
null
from django.db.models.signals import post_save def post_save_handler(model): def renderer(func): post_save.connect(func, sender=model) return func return renderer
21
46
0.714286
26
189
5.038462
0.615385
0.183206
0
0
0
0
0
0
0
0
0
0
0.21164
189
8
47
23.625
0.879195
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.166667
0
0.833333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
e513218ff831cf2de2be8b2f5896a27816679d0f
191
py
Python
pylib/pointprocesses/__init__.py
ManifoldFR/hawkes-process-rust
04d80ff6d01e8bc1857378b07f4548970af4eea0
[ "MIT" ]
28
2018-07-01T16:50:00.000Z
2021-12-11T21:12:54.000Z
pylib/pointprocesses/__init__.py
ManifoldFR/hawkes-process-rust
04d80ff6d01e8bc1857378b07f4548970af4eea0
[ "MIT" ]
4
2018-10-14T18:07:16.000Z
2019-08-17T15:46:36.000Z
pylib/pointprocesses/__init__.py
ManifoldFR/hawkes-process-rust
04d80ff6d01e8bc1857378b07f4548970af4eea0
[ "MIT" ]
1
2021-02-03T09:01:38.000Z
2021-02-03T09:01:38.000Z
""" Algorithms for simulating point processes, stochastic processes used in statistical models. Implemented in the Rust programming language. """ from . import temporal from . import spatial
27.285714
91
0.801047
23
191
6.652174
0.826087
0.130719
0
0
0
0
0
0
0
0
0
0
0.141361
191
6
92
31.833333
0.932927
0.717277
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
e51a5b44e443410e385ada130b1824ffd9dfe587
222
py
Python
fourth-year/EGC/EGC-1230-julgomrod/decide/census/models.py
JulianGR/university
2f643825b238892d602baf0c8e71e4c1b0fdefc2
[ "MIT" ]
null
null
null
fourth-year/EGC/EGC-1230-julgomrod/decide/census/models.py
JulianGR/university
2f643825b238892d602baf0c8e71e4c1b0fdefc2
[ "MIT" ]
null
null
null
fourth-year/EGC/EGC-1230-julgomrod/decide/census/models.py
JulianGR/university
2f643825b238892d602baf0c8e71e4c1b0fdefc2
[ "MIT" ]
null
null
null
from django.db import models class Census(models.Model): voting_id = models.PositiveIntegerField() voter_id = models.PositiveIntegerField() class Meta: unique_together = (('voting_id', 'voter_id'),)
22.2
54
0.702703
25
222
6.04
0.6
0.10596
0.370861
0
0
0
0
0
0
0
0
0
0.184685
222
9
55
24.666667
0.834254
0
0
0
0
0
0.076577
0
0
0
0
0
0
1
0
false
0
0.166667
0
0.833333
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
4
e528e0a96a50141b306acdb4c05ba5972ca225b6
64
py
Python
lib/python/treadmill/tests/syscall/__init__.py
vrautela/treadmill
05e47fa8acdf8bad7af78e737efb26ea6488de82
[ "Apache-2.0" ]
133
2016-09-15T13:36:12.000Z
2021-01-18T06:29:13.000Z
tests/syscall/__init__.py
bretttegart/treadmill
812109e31c503a6eddaee2d3f2e1faf2833b6aaf
[ "Apache-2.0" ]
108
2016-12-28T23:41:27.000Z
2020-03-05T21:20:37.000Z
tests/syscall/__init__.py
bretttegart/treadmill
812109e31c503a6eddaee2d3f2e1faf2833b6aaf
[ "Apache-2.0" ]
69
2016-09-23T20:38:58.000Z
2020-11-11T02:31:21.000Z
"""Tests for treadmill's linux direct system call interface."""
32
63
0.75
9
64
5.333333
1
0
0
0
0
0
0
0
0
0
0
0
0.125
64
1
64
64
0.857143
0.890625
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
e5770772c02156617fec76103f8caaedacce3328
58
py
Python
mlds/my_dataset/my_dataset.py
Conchylicultor/mlds
2620293c28dc16b8c43a45a68c411f769a231668
[ "Apache-2.0" ]
null
null
null
mlds/my_dataset/my_dataset.py
Conchylicultor/mlds
2620293c28dc16b8c43a45a68c411f769a231668
[ "Apache-2.0" ]
null
null
null
mlds/my_dataset/my_dataset.py
Conchylicultor/mlds
2620293c28dc16b8c43a45a68c411f769a231668
[ "Apache-2.0" ]
null
null
null
"""MyDataset implementation.""" class MyDataset: pass
9.666667
31
0.706897
5
58
8.2
0.8
0
0
0
0
0
0
0
0
0
0
0
0.155172
58
5
32
11.6
0.836735
0.431034
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.5
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
1
1
0
0
0
0
0
4
e586391736921661c3fe764c987b3ab322558a70
221
py
Python
chariot/transformer/text/lower_normalizer.py
Y-Kuro-u/chariot
032f3eecdd55b30c65351e1e636c939c4b20919e
[ "Apache-2.0" ]
134
2018-06-11T01:40:14.000Z
2021-11-15T12:34:38.000Z
chariot/transformer/text/lower_normalizer.py
Y-Kuro-u/chariot
032f3eecdd55b30c65351e1e636c939c4b20919e
[ "Apache-2.0" ]
10
2018-06-17T10:45:50.000Z
2021-04-05T05:51:11.000Z
chariot/transformer/text/lower_normalizer.py
Y-Kuro-u/chariot
032f3eecdd55b30c65351e1e636c939c4b20919e
[ "Apache-2.0" ]
8
2019-02-23T06:43:21.000Z
2021-02-18T06:05:11.000Z
from chariot.transformer.text.base import TextNormalizer class LowerNormalizer(TextNormalizer): def __init__(self, copy=True): super().__init__(copy) def apply(self, text): return text.lower()
20.090909
56
0.701357
25
221
5.88
0.72
0
0
0
0
0
0
0
0
0
0
0
0.19457
221
10
57
22.1
0.825843
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.166667
0.166667
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
1
0
0
0
1
1
0
0
4
e589baebc71ad159149655f236ec97dd72625526
222
py
Python
python/lvmpwi/pwi/__init__.py
sdss/lvmpwi
75ac69557c88da71d6be577e8f626c99ac5e6165
[ "BSD-3-Clause" ]
null
null
null
python/lvmpwi/pwi/__init__.py
sdss/lvmpwi
75ac69557c88da71d6be577e8f626c99ac5e6165
[ "BSD-3-Clause" ]
10
2021-07-07T13:23:25.000Z
2021-12-02T14:05:24.000Z
python/lvmpwi/pwi/__init__.py
sdss/lvmpwi
75ac69557c88da71d6be577e8f626c99ac5e6165
[ "BSD-3-Clause" ]
1
2021-12-14T00:31:19.000Z
2021-12-14T00:31:19.000Z
# -*- coding: utf-8 -*- # # @Author: Florian Briegel (briegel@mpia.de # @Date: 2021-06-15 # @Filename: __init__.py # @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause) from .pwi4_client import PWI4
22.2
74
0.689189
33
222
4.484848
0.848485
0.054054
0.135135
0
0
0
0
0
0
0
0
0.06701
0.126126
222
9
75
24.666667
0.695876
0.797297
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
e5a5d1a2debf0c90774c2123feb289fcd0dce885
104
py
Python
examples/libtest/imports/allsimple.py
takipsizad/pyjs
54db0ba6747aca744f9f3c3e985a17e913dfb951
[ "ECL-2.0", "Apache-2.0" ]
739
2015-01-01T02:05:11.000Z
2022-03-30T15:26:16.000Z
examples/libtest/imports/allsimple.py
takipsizad/pyjs
54db0ba6747aca744f9f3c3e985a17e913dfb951
[ "ECL-2.0", "Apache-2.0" ]
33
2015-03-25T23:17:04.000Z
2021-08-19T08:25:22.000Z
examples/libtest/imports/allsimple.py
takipsizad/pyjs
54db0ba6747aca744f9f3c3e985a17e913dfb951
[ "ECL-2.0", "Apache-2.0" ]
167
2015-01-01T22:27:47.000Z
2022-03-17T13:29:19.000Z
""" Helper module for import * without __all__ """ all_import2 = 3 all_import3 = 3 all_override = True
13
42
0.721154
15
104
4.533333
0.733333
0.117647
0
0
0
0
0
0
0
0
0
0.047059
0.182692
104
7
43
14.857143
0.752941
0.403846
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
e5ab67efa3e5456347a7f2ff014fa65c466d2986
18
py
Python
src/typer_make/__init__.py
zdog234/typer-make
3e28102c091e832eae5b5112a5ff4ad2e9e5aa2e
[ "MIT" ]
null
null
null
src/typer_make/__init__.py
zdog234/typer-make
3e28102c091e832eae5b5112a5ff4ad2e9e5aa2e
[ "MIT" ]
83
2021-05-12T06:17:38.000Z
2022-03-28T00:42:29.000Z
src/typer_make/__init__.py
zdog234/typer-make
3e28102c091e832eae5b5112a5ff4ad2e9e5aa2e
[ "MIT" ]
null
null
null
"""typer-make."""
9
17
0.5
2
18
4.5
1
0
0
0
0
0
0
0
0
0
0
0
0.055556
18
1
18
18
0.529412
0.611111
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
e5bffb959986d24fca222add5518bca256990c0e
75
py
Python
tweet/__init__.py
leo0309/django-demo
2c2e91058be52a6937252df6b174a4173b10fd50
[ "Apache-2.0" ]
null
null
null
tweet/__init__.py
leo0309/django-demo
2c2e91058be52a6937252df6b174a4173b10fd50
[ "Apache-2.0" ]
null
null
null
tweet/__init__.py
leo0309/django-demo
2c2e91058be52a6937252df6b174a4173b10fd50
[ "Apache-2.0" ]
null
null
null
#replace MySQLdb with pymysql import pymysql pymysql.install_as_MySQLdb()
25
30
0.84
10
75
6.1
0.7
0
0
0
0
0
0
0
0
0
0
0
0.106667
75
3
31
25
0.910448
0.373333
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
e5c3cc89a8b0e568f7115f848bfd2e0d4cb05d51
438
py
Python
filer/tests/__init__.py
Wordbank/django-filer
0e25f1573573449afe827772480e008357893c42
[ "MIT" ]
null
null
null
filer/tests/__init__.py
Wordbank/django-filer
0e25f1573573449afe827772480e008357893c42
[ "MIT" ]
null
null
null
filer/tests/__init__.py
Wordbank/django-filer
0e25f1573573449afe827772480e008357893c42
[ "MIT" ]
null
null
null
#-*- coding: utf-8 -*- from django.test import TestCase class Mock(): pass from filer.tests.admin import * from filer.tests.models import * from filer.tests.fields import * from filer.tests.utils import * from filer.tests.tools import * from filer.tests.permissions import * class FilerTests(TestCase): def test_environment(self): """Just make sure everything is set up correctly.""" self.assert_(True)
24.333333
60
0.703196
59
438
5.186441
0.559322
0.176471
0.27451
0.326797
0
0
0
0
0
0
0
0.002817
0.189498
438
18
61
24.333333
0.859155
0.155251
0
0
0
0
0
0
0
0
0
0
0.083333
1
0.083333
false
0.083333
0.583333
0
0.833333
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
1
1
0
0
0
0
4
e5db15242481bbade21064c791cd69063115f06b
106
py
Python
test.py
Maciejfiedler/random-flask-app
3ad6a21aba7d43378758f303debe802b5f8c3b0d
[ "Unlicense" ]
1
2021-03-08T18:14:25.000Z
2021-03-08T18:14:25.000Z
test.py
Maciejfiedler/random-flask-app
3ad6a21aba7d43378758f303debe802b5f8c3b0d
[ "Unlicense" ]
null
null
null
test.py
Maciejfiedler/random-flask-app
3ad6a21aba7d43378758f303debe802b5f8c3b0d
[ "Unlicense" ]
null
null
null
def readfromtxt(): with open("requests.txt", "r") as f: return f.read() print(readfromtxt())
17.666667
40
0.603774
14
106
4.571429
0.857143
0
0
0
0
0
0
0
0
0
0
0
0.216981
106
5
41
21.2
0.771084
0
0
0
0
0
0.122642
0
0
0
0
0
0
1
0.25
true
0
0
0
0.5
0.25
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
0
0
0
0
0
4
f90c6eba9a549ddab0985ebd72b093fa00a60369
100
py
Python
flight_ticket/apps.py
Calpax-aaS/web-app
155a40a51b27f9741c137dcf144daabcb09d39ed
[ "BSD-3-Clause" ]
null
null
null
flight_ticket/apps.py
Calpax-aaS/web-app
155a40a51b27f9741c137dcf144daabcb09d39ed
[ "BSD-3-Clause" ]
2
2021-06-09T18:48:49.000Z
2021-09-22T19:55:17.000Z
flight_ticket/apps.py
Calpax-aaS/web-app
155a40a51b27f9741c137dcf144daabcb09d39ed
[ "BSD-3-Clause" ]
1
2022-03-02T20:55:50.000Z
2022-03-02T20:55:50.000Z
from django.apps import AppConfig class FlightTicketConfig(AppConfig): name = 'flight_ticket'
16.666667
36
0.78
11
100
7
0.909091
0
0
0
0
0
0
0
0
0
0
0
0.15
100
5
37
20
0.905882
0
0
0
0
0
0.13
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
006013cc41b15666ab9584f8db82817a64d819e3
161
py
Python
drive/cars/admin.py
yousef-alramli/rest-framwork
c36d24d7a806d2b383870ddfc0e7e434bc651b4d
[ "MIT" ]
null
null
null
drive/cars/admin.py
yousef-alramli/rest-framwork
c36d24d7a806d2b383870ddfc0e7e434bc651b4d
[ "MIT" ]
null
null
null
drive/cars/admin.py
yousef-alramli/rest-framwork
c36d24d7a806d2b383870ddfc0e7e434bc651b4d
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import Car @admin.register(Car) class CarAdmin(admin.ModelAdmin): list_display = ['name', 'updated', 'user']
20.125
46
0.732919
21
161
5.571429
0.761905
0
0
0
0
0
0
0
0
0
0
0
0.136646
161
7
47
23
0.841727
0
0
0
0
0
0.093168
0
0
0
0
0
0
1
0
false
0
0.4
0
0.8
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
0072c65c7f1d67621568a6fe2a1990b2161875a9
131
py
Python
inktime/fading.py
g-patin/inktime
ac9758a28eb1f97d403bce2ceaaac2a8b9a89954
[ "Apache-2.0" ]
null
null
null
inktime/fading.py
g-patin/inktime
ac9758a28eb1f97d403bce2ceaaac2a8b9a89954
[ "Apache-2.0" ]
null
null
null
inktime/fading.py
g-patin/inktime
ac9758a28eb1f97d403bce2ceaaac2a8b9a89954
[ "Apache-2.0" ]
null
null
null
# AUTOGENERATED! DO NOT EDIT! File to edit: notebooks/03_trajectories-in-od-space.ipynb (unless otherwise specified). __all__ = []
43.666667
117
0.770992
18
131
5.333333
0.944444
0
0
0
0
0
0
0
0
0
0
0.017241
0.114504
131
3
118
43.666667
0.810345
0.877863
0
0
1
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
008e3af62a1911babad7e4ef8708134c2c9173ac
198
py
Python
samples/python/46.teams-auth/bots/__init__.py
Aliacf21/BotBuilder-Samples
be48548edafd4efdc074f5a59ef2bb3af735ad9a
[ "MIT" ]
1,998
2019-05-07T06:33:22.000Z
2022-03-31T12:59:15.000Z
samples/python/46.teams-auth/bots/__init__.py
Aliacf21/BotBuilder-Samples
be48548edafd4efdc074f5a59ef2bb3af735ad9a
[ "MIT" ]
1,526
2020-09-05T18:57:14.000Z
2020-12-03T01:45:40.000Z
samples/python/46.teams-auth/bots/__init__.py
stevkan/BotBuilder-Samples
75a21b412d8873906bed3460f7c5f0940a067d58
[ "MIT" ]
2,820
2016-09-21T03:47:43.000Z
2019-05-03T15:12:46.000Z
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. from .dialog_bot import DialogBot from .teams_bot import TeamsBot __all__ = ["DialogBot", "TeamsBot"]
24.75
59
0.772727
25
198
5.88
0.76
0.122449
0
0
0
0
0
0
0
0
0
0
0.141414
198
7
60
28.285714
0.864706
0.449495
0
0
0
0
0.160377
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
00ad14267cca0384b722bf7262577ed8d80486ac
1,584
py
Python
app/database/user_db.py
gmbz/frro-soporte-TPI-09
5161f5002fa11307c357920ec2278bb97f92f926
[ "MIT" ]
2
2021-09-19T13:30:20.000Z
2021-12-29T21:49:09.000Z
app/database/user_db.py
gmbz/frro-soporte-TPI-09
5161f5002fa11307c357920ec2278bb97f92f926
[ "MIT" ]
null
null
null
app/database/user_db.py
gmbz/frro-soporte-TPI-09
5161f5002fa11307c357920ec2278bb97f92f926
[ "MIT" ]
1
2021-06-24T14:24:02.000Z
2021-06-24T14:24:02.000Z
from ..models.models import Usuario from .db import session from ..models.exceptions import UserAlreadyExists, UserNotFound from typing import Optional def register_user(usuario: Usuario) -> Usuario: """Agrega un nuevo usuario a la tabla y lo devuelve""" if user_exists(usuario): raise UserAlreadyExists(f"User {usuario.username} ya existe") if email_exists(usuario): raise UserAlreadyExists(f"El email {usuario.email} ya existe") session.add(usuario) session.commit() return usuario def buscar_id_user(user: Usuario) -> Usuario: return session.query(Usuario).get(user.id) def buscar_id(id_usuario) -> Optional[Usuario]: return session.query(Usuario).get(id_usuario) def user_exists(user_: Usuario) -> Optional[Usuario]: return session.query(Usuario).filter(Usuario.username == user_.username ).first() def email_exists(user_: Usuario) -> Optional[Usuario]: return session.query(Usuario).filter(Usuario.email == user_.email ).first() def buscar_user(username_: str) -> Optional[Usuario]: return session.query(Usuario).filter(Usuario.username == username_).first() def autenticacion(user_: Usuario) -> Optional[Usuario]: usuario = buscar_user(user_.username) if usuario: check = usuario.check_password(user_.password) if check is True: return usuario raise UserNotFound('Contraseña incorrecta') raise UserNotFound('El usuario no existe') def change_pass(): session.commit()
29.886792
79
0.683712
185
1,584
5.72973
0.281081
0.062264
0.09434
0.117925
0.345283
0.277358
0.241509
0.19717
0.19717
0.132075
0
0
0.210859
1,584
52
80
30.461538
0.848
0.030303
0
0.176471
0
0
0.070588
0
0
0
0
0
0
1
0.235294
false
0.058824
0.117647
0.147059
0.558824
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
1
1
0
0
4
00e3fbe505f8c37aa06afa41f948e3e5bdaf5ed9
231
py
Python
Diversity/accounts/admin.py
IAmAngelLiu/shellhack2021
410c1803066501ed389deaaf32d3b43f9510a377
[ "MIT" ]
null
null
null
Diversity/accounts/admin.py
IAmAngelLiu/shellhack2021
410c1803066501ed389deaaf32d3b43f9510a377
[ "MIT" ]
null
null
null
Diversity/accounts/admin.py
IAmAngelLiu/shellhack2021
410c1803066501ed389deaaf32d3b43f9510a377
[ "MIT" ]
null
null
null
from django.contrib import admin # Register your models here. from .models import Employee from .models import Data from .models import Points admin.site.register(Employee) admin.site.register(Data) admin.site.register(Points)
17.769231
32
0.800866
33
231
5.606061
0.393939
0.162162
0.259459
0
0
0
0
0
0
0
0
0
0.121212
231
12
33
19.25
0.91133
0.112554
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.571429
0
0.571429
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
00f2169459bc11d3bad56229118cf1352e9c12ac
94
py
Python
chef_admin/apps.py
pradeepdhankhar/chef24x7
4b8a36c07b78b7f985227874d169171ff7b0dd5f
[ "MIT" ]
null
null
null
chef_admin/apps.py
pradeepdhankhar/chef24x7
4b8a36c07b78b7f985227874d169171ff7b0dd5f
[ "MIT" ]
null
null
null
chef_admin/apps.py
pradeepdhankhar/chef24x7
4b8a36c07b78b7f985227874d169171ff7b0dd5f
[ "MIT" ]
1
2019-12-13T10:21:30.000Z
2019-12-13T10:21:30.000Z
from django.apps import AppConfig class ChefAdminConfig(AppConfig): name = 'chef_admin'
15.666667
33
0.765957
11
94
6.454545
0.909091
0
0
0
0
0
0
0
0
0
0
0
0.159574
94
5
34
18.8
0.898734
0
0
0
0
0
0.106383
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
daadac7005bfa960ee666306df30acdbd0ca2449
93
py
Python
src/s3.py
ytyaru/Python.Dynamic.Create.Type.20191229160958
dd0d3ad7d8a8f924948768dc8e1287b89ff6150a
[ "CC0-1.0" ]
null
null
null
src/s3.py
ytyaru/Python.Dynamic.Create.Type.20191229160958
dd0d3ad7d8a8f924948768dc8e1287b89ff6150a
[ "CC0-1.0" ]
null
null
null
src/s3.py
ytyaru/Python.Dynamic.Create.Type.20191229160958
dd0d3ad7d8a8f924948768dc8e1287b89ff6150a
[ "CC0-1.0" ]
null
null
null
#!/usr/bin/env python3 # coding: utf8 class MyClass: pass class MyClass1: cls_attr = 1
11.625
22
0.688172
14
93
4.5
0.928571
0
0
0
0
0
0
0
0
0
0
0.054054
0.204301
93
7
23
13.285714
0.797297
0.365591
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0.333333
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
1
0
0
1
0
0
4
dae84945c91dc1a464e638a94921c35037ffedab
93
py
Python
python/pyabc/__init__.py
MarbleHE/ABC
138cda24e551aa0f58a6c5e3a14d75be544bfe9f
[ "MIT" ]
6
2020-10-19T07:06:12.000Z
2022-01-03T20:28:23.000Z
python/pyabc/__init__.py
MarbleHE/ABC
138cda24e551aa0f58a6c5e3a14d75be544bfe9f
[ "MIT" ]
20
2020-09-17T15:27:28.000Z
2021-10-09T11:01:27.000Z
python/pyabc/__init__.py
MarbleHE/HECO
138cda24e551aa0f58a6c5e3a14d75be544bfe9f
[ "MIT" ]
3
2020-09-09T07:57:15.000Z
2022-02-07T13:56:48.000Z
from .ABCContext import ABCContext from .ABCProgram import ABCProgram from .ABCTypes import *
31
34
0.83871
11
93
7.090909
0.454545
0
0
0
0
0
0
0
0
0
0
0
0.11828
93
3
35
31
0.95122
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
9705efd8e824909dbb91232ee82ca6135a8d842f
217
py
Python
total_process.py
shingiyeon/cs474
fd984740abff0eb54150a8a958804de46f56bea8
[ "Apache-2.0" ]
null
null
null
total_process.py
shingiyeon/cs474
fd984740abff0eb54150a8a958804de46f56bea8
[ "Apache-2.0" ]
null
null
null
total_process.py
shingiyeon/cs474
fd984740abff0eb54150a8a958804de46f56bea8
[ "Apache-2.0" ]
null
null
null
import methods import decoder import postprocessing import nltk if __name__ == "__main__": # nltk.download() #methods.preprocessing("./data/temp/") decoder.predict() postprocessing.postprocessing("./")
21.7
42
0.718894
21
217
7.047619
0.619048
0
0
0
0
0
0
0
0
0
0
0
0.147465
217
9
43
24.111111
0.8
0.239631
0
0
0
0
0.061728
0
0
0
0
0
0
1
0
true
0
0.571429
0
0.571429
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
970bc6dce399663e2c700a848c06ca93c897b698
1,561
py
Python
images.py
ahrnbom/guts
9134e7f6568a24b435841e5934a640bdbe329a68
[ "MIT" ]
null
null
null
images.py
ahrnbom/guts
9134e7f6568a24b435841e5934a640bdbe329a68
[ "MIT" ]
null
null
null
images.py
ahrnbom/guts
9134e7f6568a24b435841e5934a640bdbe329a68
[ "MIT" ]
null
null
null
""" Copyright (C) 2022 Martin Ahrnbom Released under MIT License. See the file LICENSE for details. Module for some classes that describe sequences of images. If your custom dataset stores images in some other way, create a subclass of ImageSequence and use it. """ from typing import List import numpy as np from pathlib import Path import imageio as iio class ImageSequence: def load(self, im_num:int) -> np.ndarray: pass def number_of_frames(self) -> int: pass def start_frame(self) -> int: pass class FolderSequence(ImageSequence): def __init__(self, folder:Path): self.images = folder.glob('*.jpg') self.images = list(self.images) self.images.sort() def load(self, im_num:int) -> np.ndarray: return iio.imread(self.images[im_num]) def number_of_frames(self) -> int: return len(self.images) def start_frame(self) -> int: return 0 class VideoSequence(ImageSequence): def __init__(self, vid_file:Path): assert vid_file.is_file() self.vid = iio.get_reader(vid_file) self.frame_count = None def __del__(self): # Attempt to clean up self.vid.close() def load(self, im_num:int) -> np.ndarray: return self.vid.get_data(im_num) def number_of_frames(self) -> int: if self.frame_count is None: self.frame_count = self.vid.count_frames() return self.frame_count def start_frame(self) -> int: return 0
25.177419
65
0.638053
215
1,561
4.460465
0.4
0.043796
0.058394
0.040667
0.262774
0.241919
0.216893
0.160584
0.070907
0
0
0.005272
0.27098
1,561
62
66
25.177419
0.837434
0.180013
0
0.378378
0
0
0.00399
0
0
0
0
0
0.027027
1
0.324324
false
0.081081
0.108108
0.135135
0.675676
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
1
1
0
0
4
9746b68d2568333c49cff5e2c2770660dd11e396
55
py
Python
edafos/soil/__init__.py
nickmachairas/edafos
10fa39949d44603c3de9a2880c533577ff020567
[ "MIT" ]
null
null
null
edafos/soil/__init__.py
nickmachairas/edafos
10fa39949d44603c3de9a2880c533577ff020567
[ "MIT" ]
null
null
null
edafos/soil/__init__.py
nickmachairas/edafos
10fa39949d44603c3de9a2880c533577ff020567
[ "MIT" ]
1
2020-06-10T01:54:43.000Z
2020-06-10T01:54:43.000Z
from .physics import * from .profile import SoilProfile
27.5
32
0.818182
7
55
6.428571
0.714286
0
0
0
0
0
0
0
0
0
0
0
0.127273
55
2
32
27.5
0.9375
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
97669f8b6b24f6f50c1c1f53e77e4ea0b7923e21
795
py
Python
countries/auth.py
sinaesmaili216/blog
f72aa1aa0807bbfa83d960e9e9217376edc7349d
[ "BSD-3-Clause" ]
null
null
null
countries/auth.py
sinaesmaili216/blog
f72aa1aa0807bbfa83d960e9e9217376edc7349d
[ "BSD-3-Clause" ]
null
null
null
countries/auth.py
sinaesmaili216/blog
f72aa1aa0807bbfa83d960e9e9217376edc7349d
[ "BSD-3-Clause" ]
null
null
null
import functools from flask import Blueprint from flask import flash from flask import g from flask import redirect from flask import render_template from flask import request from flask import session from flask import url_for from werkzeug.security import check_password_hash from werkzeug.security import generate_password_hash from countries.db import get_db bp = Blueprint("auth", __name__, url_prefix="/auth") def login_required(view): """View decorator that redirects anonymous users to the login page.""" @functools.wraps(view) def wrapped_view(**kwargs): if g.user is None: return redirect(url_for("auth.login")) return view(**kwargs) return wrapped_view #@bp.before_app_request @bp.route("/hello") def hello(): return "hello"
21.486486
74
0.745912
112
795
5.133929
0.455357
0.125217
0.208696
0.090435
0
0
0
0
0
0
0
0
0.177358
795
37
75
21.486486
0.879205
0.109434
0
0
0
0
0.042674
0
0
0
0
0
0
1
0.130435
false
0.086957
0.521739
0.043478
0.826087
0.086957
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
1
0
1
0
0
4
977f292f874722729ffe2874d95eceacd89ca48d
78
py
Python
fsm/states/gui.py
nczeak/switchgrass_cv_application
3e27732f9589f0f4a8cd72519cf06f23e4a969a4
[ "MIT" ]
null
null
null
fsm/states/gui.py
nczeak/switchgrass_cv_application
3e27732f9589f0f4a8cd72519cf06f23e4a969a4
[ "MIT" ]
null
null
null
fsm/states/gui.py
nczeak/switchgrass_cv_application
3e27732f9589f0f4a8cd72519cf06f23e4a969a4
[ "MIT" ]
null
null
null
class WelcomeState: """ The welcome state for the application. """
19.5
42
0.628205
8
78
6.125
0.875
0
0
0
0
0
0
0
0
0
0
0
0.269231
78
4
43
19.5
0.859649
0.487179
0
0
0
0
0
0
0
0
0
0
0
1
0
true
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
1
0
0
0
1
0
0
4
97923f45672d6b155e89163af837a81374847456
252
py
Python
interpolation.py
DahlitzFlorian/how-to-work-with-config-files-in-python-article-snippets
9ebee6617337196e7667ef3b2f95d063a6d100d2
[ "MIT" ]
null
null
null
interpolation.py
DahlitzFlorian/how-to-work-with-config-files-in-python-article-snippets
9ebee6617337196e7667ef3b2f95d063a6d100d2
[ "MIT" ]
null
null
null
interpolation.py
DahlitzFlorian/how-to-work-with-config-files-in-python-article-snippets
9ebee6617337196e7667ef3b2f95d063a6d100d2
[ "MIT" ]
1
2021-11-08T02:04:41.000Z
2021-11-08T02:04:41.000Z
# interpolation.py from configparser import ConfigParser from configparser import ExtendedInterpolation config = ConfigParser(interpolation=ExtendedInterpolation()) config.read("interpolation_config.ini") print(config.get("destinations", "app_dir"))
28
60
0.833333
25
252
8.32
0.56
0.153846
0.211538
0
0
0
0
0
0
0
0
0
0.071429
252
8
61
31.5
0.888889
0.063492
0
0
0
0
0.183761
0.102564
0
0
0
0
0
1
0
false
0
0.4
0
0.4
0.2
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
97bc2e653534dfb26756ad55992623b6701267f0
193
py
Python
core/engine/transform.py
yuwilbur/birthday29
7a2c8069639b27b20bc0903d2cf6c212b398b4d9
[ "MIT" ]
null
null
null
core/engine/transform.py
yuwilbur/birthday29
7a2c8069639b27b20bc0903d2cf6c212b398b4d9
[ "MIT" ]
null
null
null
core/engine/transform.py
yuwilbur/birthday29
7a2c8069639b27b20bc0903d2cf6c212b398b4d9
[ "MIT" ]
null
null
null
from ..engine.vector import Vector from ..engine.component import Component class Transform(Component): def __init__(self, game_object): self.position = Vector() self.rotation = Vector()
24.125
40
0.761658
24
193
5.916667
0.583333
0.140845
0
0
0
0
0
0
0
0
0
0
0.129534
193
7
41
27.571429
0.845238
0
0
0
0
0
0
0
0
0
0
0
0
1
0.166667
false
0
0.333333
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
c11dfb22b95fea5875f0c2e55a26ff410b2cd962
370
py
Python
year_2021/day04/test_giant_squid.py
mjalkio/advent-of-code
54dbfcba3850e72d7b736ef1e7d2a3cb91e65d42
[ "MIT" ]
null
null
null
year_2021/day04/test_giant_squid.py
mjalkio/advent-of-code
54dbfcba3850e72d7b736ef1e7d2a3cb91e65d42
[ "MIT" ]
null
null
null
year_2021/day04/test_giant_squid.py
mjalkio/advent-of-code
54dbfcba3850e72d7b736ef1e7d2a3cb91e65d42
[ "MIT" ]
null
null
null
from util import read_puzzle_input from year_2021.day04.giant_squid import ( get_losing_board_score, get_winning_board_score, ) def test_get_winning_board_score(): assert get_winning_board_score(read_puzzle_input("test_input.txt")) == 4512 def test_get_losing_board_score(): assert get_losing_board_score(read_puzzle_input("test_input.txt")) == 1924
26.428571
79
0.802703
57
370
4.684211
0.385965
0.224719
0.168539
0.213483
0.277154
0.277154
0.277154
0.277154
0
0
0
0.042813
0.116216
370
13
80
28.461538
0.7737
0
0
0
0
0
0.075676
0
0
0
0
0
0.222222
1
0.222222
true
0
0.222222
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
1
0
0
0
0
0
0
4
c129674e2683ac4d7d131e24f41a0c8194c3e481
52
py
Python
text/_elisp/buffer/_op/_text/insert.py
jedhsu/text
8525b602d304ac571a629104c48703443244545c
[ "Apache-2.0" ]
null
null
null
text/_elisp/buffer/_op/_text/insert.py
jedhsu/text
8525b602d304ac571a629104c48703443244545c
[ "Apache-2.0" ]
null
null
null
text/_elisp/buffer/_op/_text/insert.py
jedhsu/text
8525b602d304ac571a629104c48703443244545c
[ "Apache-2.0" ]
null
null
null
class BufferInsert( BufferOperator, ): pass
10.4
19
0.673077
4
52
8.75
1
0
0
0
0
0
0
0
0
0
0
0
0.25
52
4
20
13
0.897436
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.25
0
0
0.25
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
4
c13f2b68bcbb77da3c02440b99a26b6b81342c17
200
py
Python
wayback/__init__.py
edsu/wayback
d6c5270287326d8b418f654fa8ec0be0b5a81b95
[ "BSD-3-Clause" ]
null
null
null
wayback/__init__.py
edsu/wayback
d6c5270287326d8b418f654fa8ec0be0b5a81b95
[ "BSD-3-Clause" ]
null
null
null
wayback/__init__.py
edsu/wayback
d6c5270287326d8b418f654fa8ec0be0b5a81b95
[ "BSD-3-Clause" ]
null
null
null
from ._version import get_versions __version__ = get_versions()['version'] del get_versions from ._client import ( # noqa CdxRecord, memento_url_data, WaybackClient, WaybackSession)
20
39
0.74
22
200
6.227273
0.636364
0.240876
0.262774
0
0
0
0
0
0
0
0
0
0.185
200
9
40
22.222222
0.840491
0.02
0
0
0
0
0.036082
0
0
0
0
0
0
1
0
false
0
0.25
0
0.25
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
c147daba67bc4491e008a3e2e1685e41fcd557ff
150
py
Python
python/pyo.py
dnagle-usgs/lidar-processing
2c7c068da2c9f68e55138c98e76085f109d0053e
[ "CC0-1.0" ]
1
2018-11-16T06:44:54.000Z
2018-11-16T06:44:54.000Z
python/pyo.py
dnagle-usgs/lidar-processing
2c7c068da2c9f68e55138c98e76085f109d0053e
[ "CC0-1.0" ]
null
null
null
python/pyo.py
dnagle-usgs/lidar-processing
2c7c068da2c9f68e55138c98e76085f109d0053e
[ "CC0-1.0" ]
null
null
null
import code import os.path import sys sys.path.append(os.path.dirname(__file__)) import alps.site yo = alps.site.yo code.interact(local=locals())
12.5
42
0.76
25
150
4.4
0.56
0.109091
0.181818
0
0
0
0
0
0
0
0
0
0.113333
150
11
43
13.636364
0.827068
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.571429
0
0.571429
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
1
0
0
4
c1654bb82edbf781bfcfe2d78bbbb8f551465e8a
122
py
Python
pratik.py
Tesmi-ui/Tesmi-ux
f7edacf052651926acc62fdbbbe2c71d7bc14a00
[ "Apache-2.0" ]
null
null
null
pratik.py
Tesmi-ui/Tesmi-ux
f7edacf052651926acc62fdbbbe2c71d7bc14a00
[ "Apache-2.0" ]
null
null
null
pratik.py
Tesmi-ui/Tesmi-ux
f7edacf052651926acc62fdbbbe2c71d7bc14a00
[ "Apache-2.0" ]
null
null
null
import random import math def main(): user = int(input("inter a no.:" )) print("your entered number is " user)
13.555556
39
0.631148
18
122
4.277778
0.888889
0
0
0
0
0
0
0
0
0
0
0
0.237705
122
8
40
15.25
0.827957
0
0
0
0
0
0.286885
0
0
0
0
0
0
0
null
null
0
0.4
null
null
0.2
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
4
c1a16503e5ef54a42f82a47da03fd528d49ea1e0
212
py
Python
texttractor/__init__.py
walkr/texttractor
bfd194ba153ffb9928262d306fa8fc328b24ee7e
[ "MIT" ]
null
null
null
texttractor/__init__.py
walkr/texttractor
bfd194ba153ffb9928262d306fa8fc328b24ee7e
[ "MIT" ]
null
null
null
texttractor/__init__.py
walkr/texttractor
bfd194ba153ffb9928262d306fa8fc328b24ee7e
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- from .core import TextTractor from .core import TextCleaner __author__ = 'Tony Walker' __email__ = 'walkr.walkr@gmail.com' __version__ = '0.0.1' __all__ = ['TextTractor', 'TextCleaner']
21.2
40
0.707547
26
212
5.153846
0.730769
0.119403
0.208955
0
0
0
0
0
0
0
0
0.021858
0.136792
212
9
41
23.555556
0.710383
0.099057
0
0
0
0
0.312169
0.111111
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
c1c47780528cf6ceaef443eedb29e042ecedc857
26
py
Python
tensortrade/version.py
andrewczgithub/tensortrade
b5f5d14c220bcab3394b02286ffd0f52853f519e
[ "Apache-2.0" ]
1
2022-02-25T09:31:40.000Z
2022-02-25T09:31:40.000Z
tensortrade/version.py
andrewczgithub/tensortrade
b5f5d14c220bcab3394b02286ffd0f52853f519e
[ "Apache-2.0" ]
1
2022-02-16T17:48:42.000Z
2022-02-16T18:09:15.000Z
tensortrade/version.py
andrewczgithub/tensortrade
b5f5d14c220bcab3394b02286ffd0f52853f519e
[ "Apache-2.0" ]
null
null
null
__version__ = "0.0.2-rc0"
13
25
0.653846
5
26
2.6
0.8
0
0
0
0
0
0
0
0
0
0
0.173913
0.115385
26
1
26
26
0.391304
0
0
0
0
0
0.346154
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
c1feef4b0e1c55f9692858cdcc4e4af1104b6fe9
50
py
Python
data/tinyfpga_bx.py
jwise/corescore
a0b1c08a12b5def572aec27ade7c4421fd684e41
[ "Apache-2.0" ]
94
2020-03-15T21:48:48.000Z
2022-03-18T02:58:09.000Z
data/tinyfpga_bx.py
jwise/corescore
a0b1c08a12b5def572aec27ade7c4421fd684e41
[ "Apache-2.0" ]
46
2020-04-19T21:36:24.000Z
2022-02-14T22:48:02.000Z
data/tinyfpga_bx.py
jwise/corescore
a0b1c08a12b5def572aec27ade7c4421fd684e41
[ "Apache-2.0" ]
38
2020-04-24T08:15:05.000Z
2022-03-18T02:58:11.000Z
ctx.addClock("i_clk", 16) ctx.addClock("clk", 48)
16.666667
25
0.68
9
50
3.666667
0.666667
0.666667
0
0
0
0
0
0
0
0
0
0.086957
0.08
50
2
26
25
0.630435
0
0
0
0
0
0.16
0
0
0
0
0
0
1
0
true
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
1
0
0
0
0
0
0
4
a9a575f1aecb012021372fd1ffca7980dc93a6b5
24
py
Python
CrittersProto/generator/fileout_test.py
nickjbenson/Kami
2c9614f66055bea02f660f41c3aa5a00083331b8
[ "MIT" ]
1
2018-02-26T13:51:23.000Z
2018-02-26T13:51:23.000Z
CrittersProto/generator/fileout_test.py
nickjbenson/Kami
2c9614f66055bea02f660f41c3aa5a00083331b8
[ "MIT" ]
null
null
null
CrittersProto/generator/fileout_test.py
nickjbenson/Kami
2c9614f66055bea02f660f41c3aa5a00083331b8
[ "MIT" ]
null
null
null
# fileout_test.py fi =
8
17
0.666667
4
24
3.75
1
0
0
0
0
0
0
0
0
0
0
0
0.208333
24
3
18
8
0.789474
0.625
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
4
a9d7a3d45f602e8010e6b07628963b0cea2a9f75
276
py
Python
tests/test_utils.py
gramaziokohler/total_station_robot_localization
aa4baa070d4d93a8058a0286615580ed8f95567f
[ "MIT" ]
null
null
null
tests/test_utils.py
gramaziokohler/total_station_robot_localization
aa4baa070d4d93a8058a0286615580ed8f95567f
[ "MIT" ]
27
2020-12-22T13:20:52.000Z
2022-03-04T23:04:51.000Z
tests/test_utils.py
gramaziokohler/total_station_robot_localization
aa4baa070d4d93a8058a0286615580ed8f95567f
[ "MIT" ]
1
2021-03-26T02:59:59.000Z
2021-03-26T02:59:59.000Z
from __future__ import absolute_import from __future__ import division from __future__ import print_function from compas_mobile_robot_reloc.utils import _ensure_rhino from pytest import raises def test__ensure_rhino(): with raises(ImportError): _ensure_rhino()
23
57
0.822464
36
276
5.638889
0.555556
0.147783
0.236453
0
0
0
0
0
0
0
0
0
0.144928
276
11
58
25.090909
0.860169
0
0
0
0
0
0
0
0
0
0
0
0
1
0.125
true
0
0.75
0
0.875
0.125
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
a9dac0e81fef621a7e274224bc5d806eea4e29a8
145
py
Python
skcosmo/linear_model/__init__.py
andreanelli/scikit-cosmo
97adbd5459bc738f994ded2ac385a13d4ad20afb
[ "BSD-3-Clause" ]
16
2020-12-07T23:27:11.000Z
2021-12-17T22:28:33.000Z
skcosmo/linear_model/__init__.py
andreanelli/scikit-cosmo
97adbd5459bc738f994ded2ac385a13d4ad20afb
[ "BSD-3-Clause" ]
74
2020-11-30T18:51:41.000Z
2021-12-06T20:53:31.000Z
skcosmo/linear_model/__init__.py
andreanelli/scikit-cosmo
97adbd5459bc738f994ded2ac385a13d4ad20afb
[ "BSD-3-Clause" ]
4
2020-10-15T15:01:00.000Z
2020-11-06T16:21:53.000Z
from ._base import OrthogonalRegression from ._ridge import RidgeRegression2FoldCV __all__ = ["OrthogonalRegression", "RidgeRegression2FoldCV"]
29
60
0.841379
11
145
10.545455
0.636364
0
0
0
0
0
0
0
0
0
0
0.015152
0.089655
145
4
61
36.25
0.863636
0
0
0
0
0
0.289655
0.151724
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
a9e5831dd613ead807d07ab5001c75d94b1e7a10
218
py
Python
mmseg/datasets/pipelines/transforms_new.py
shinianzhihou/ChangeDetection
c29a90ebb3d13861c5161cc751bfd1f11c28bf45
[ "Apache-2.0" ]
95
2019-11-04T08:05:54.000Z
2022-03-29T07:09:21.000Z
mmseg/datasets/pipelines/transforms_new.py
shinianzhihou/ChangeDetection
c29a90ebb3d13861c5161cc751bfd1f11c28bf45
[ "Apache-2.0" ]
9
2019-11-04T08:05:14.000Z
2022-03-29T08:53:01.000Z
mmseg/datasets/pipelines/transforms_new.py
shinianzhihou/ChangeDetection
c29a90ebb3d13861c5161cc751bfd1f11c28bf45
[ "Apache-2.0" ]
25
2019-11-22T08:14:32.000Z
2022-03-28T03:18:30.000Z
import albumentations as A from albumentations import DualTransform from albumentations.pytorch import ToTensorV2 from numpy import random from ..builder import PIPELINES PIPELINES.register_module(module=ToTensorV2)
24.222222
45
0.862385
26
218
7.192308
0.538462
0.192513
0
0
0
0
0
0
0
0
0
0.010256
0.105505
218
8
46
27.25
0.948718
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.833333
0
0.833333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
a9e6d46ec4bfcae93d5e63075494036f6989a034
1,543
py
Python
src/day006.py
zhangxinyong12/my-python-demo
3ac121073749ad9caf42531603e921b04e1e7c6c
[ "MIT" ]
null
null
null
src/day006.py
zhangxinyong12/my-python-demo
3ac121073749ad9caf42531603e921b04e1e7c6c
[ "MIT" ]
null
null
null
src/day006.py
zhangxinyong12/my-python-demo
3ac121073749ad9caf42531603e921b04e1e7c6c
[ "MIT" ]
null
null
null
# # # def func(): # n = 0 # while True: # n += 1 # yield n # yield = return + 暂停 # # # # g = func() # # print(g) # # print(g.__next__()) # # print(next(g)) # # # def fid(length): # a, b = 0, 1 # n = 0 # while n < length: # yield b # a, b = b, a + b # n += 1 # return '结束' # # # g = fid(8) # print(next(g)) # print(next(g)) # print(next(g)) # print(next(g)) # print(next(g)) # print(next(g)) # print(next(g)) # print(next(g)) # print(next(g)) # print(next(g)) # print(next(g)) # print(next(g)) # print(next(g)) # print(next(g)) # print(next(g)) # print(next(g)) # def gen(): # i = 0 # while i < 5: # temp = yield i # print('temp=', temp) # i += 1 # return '没有更多' # # # g = gen() # g.send(None) # n1 = g.send('abc') # print(n1) # n2 = g.send('erdf') # print(n2) # 进程 > 线程 > 协程 # # def task1(n): # for i in range(n): # print('正在搬第{}块砖'.format(i)) # yield # # # def task2(n): # for i in range(n): # print('这么着听第{}首有音乐'.format(i)) # yield # # # g1 = task1(10) # g2 = task2(5) # # while True: # try: # next(g1) # next(g2) # except: # break # 可迭代的对象 # 生成器 # 元组 # 列表 # 集合 # 字典 # 字符串 from collections.abc import Iterable list1 = [1, 2, 3, 4] print('list1', isinstance(list1, Iterable)) str1 = '1111' print('str1', isinstance(str1, Iterable)) g = (x for x in range(10)) print('g', isinstance(g, Iterable)) # 迭代器 '''' 迭代器 ''' list1 = iter(list1) print(next(list1)) # p 142
14.420561
43
0.48477
228
1,543
3.263158
0.315789
0.217742
0.228495
0.302419
0.263441
0.263441
0.263441
0.215054
0.215054
0.215054
0
0.043278
0.296176
1,543
106
44
14.556604
0.641805
0.699935
0
0
0
0
0.039548
0
0
0
0
0
0
1
0
false
0
0.111111
0
0.111111
0.444444
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
4
a9efe131356c733e955d99f5a655024093ea3a17
24
py
Python
tests/helper_test_reload_data.py
rndr/aioimport
14a8f01e81f337166f897afdbd57f1d1a3496a95
[ "MIT" ]
null
null
null
tests/helper_test_reload_data.py
rndr/aioimport
14a8f01e81f337166f897afdbd57f1d1a3496a95
[ "MIT" ]
null
null
null
tests/helper_test_reload_data.py
rndr/aioimport
14a8f01e81f337166f897afdbd57f1d1a3496a95
[ "MIT" ]
null
null
null
data: object = object()
12
23
0.666667
3
24
5.333333
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.166667
24
1
24
24
0.8
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
e75698b8b2f8b2aa94c9a4d8a558c17caf951b1f
147
py
Python
aos_sw_api/enums/snmp_trap_mode.py
KennethSoelberg/AOS-Switch
a5a2c54917bbb69fab044bf0b313bcf795642d30
[ "MIT" ]
null
null
null
aos_sw_api/enums/snmp_trap_mode.py
KennethSoelberg/AOS-Switch
a5a2c54917bbb69fab044bf0b313bcf795642d30
[ "MIT" ]
1
2020-12-24T15:36:56.000Z
2021-01-28T23:19:57.000Z
aos_sw_api/enums/snmp_trap_mode.py
KennethSoelberg/AOS-Switch
a5a2c54917bbb69fab044bf0b313bcf795642d30
[ "MIT" ]
1
2021-02-16T23:26:28.000Z
2021-02-16T23:26:28.000Z
from enum import Enum class SnmpTrapModeEnum(str, Enum): STM_ENABLE = "STM_ENABLE" STM_DISABLE = "STM_DISABLE" STM_NONE = "STM_NONE"
18.375
34
0.707483
20
147
4.9
0.5
0.183673
0.244898
0
0
0
0
0
0
0
0
0
0.204082
147
7
35
21
0.837607
0
0
0
0
0
0.197279
0
0
0
0
0
0
1
0
false
0
0.2
0
1
0
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
4
e75ed650bad8e2025f468e166bdb64c115eed465
69
py
Python
anealing/samples/image_search/scripts/model/__init__.py
arkmohba/quantum_computing_memo
421b990772a2e9dbda6bed1f2ae76c5f82e3660a
[ "BSD-3-Clause" ]
null
null
null
anealing/samples/image_search/scripts/model/__init__.py
arkmohba/quantum_computing_memo
421b990772a2e9dbda6bed1f2ae76c5f82e3660a
[ "BSD-3-Clause" ]
null
null
null
anealing/samples/image_search/scripts/model/__init__.py
arkmohba/quantum_computing_memo
421b990772a2e9dbda6bed1f2ae76c5f82e3660a
[ "BSD-3-Clause" ]
null
null
null
from .image_feature import ImageDoubleFeature from .base import Base
23
45
0.855072
9
69
6.444444
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.115942
69
2
46
34.5
0.95082
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
e788c9b5fb1bc2e1996fe42d10d185ecb7712e87
113
py
Python
netbox/dcim/exceptions.py
BrnoPCmaniak/netbox
7b517abdb68a6324950dfd0375861163c7bfff00
[ "Apache-2.0" ]
6
2017-12-01T05:13:39.000Z
2020-01-23T13:04:43.000Z
netbox/dcim/exceptions.py
BrnoPCmaniak/netbox
7b517abdb68a6324950dfd0375861163c7bfff00
[ "Apache-2.0" ]
8
2021-04-16T01:38:00.000Z
2022-01-04T21:27:27.000Z
netbox/dcim/exceptions.py
BrnoPCmaniak/netbox
7b517abdb68a6324950dfd0375861163c7bfff00
[ "Apache-2.0" ]
3
2017-11-18T01:28:22.000Z
2018-05-17T14:04:43.000Z
class LoopDetected(Exception): """ A loop has been detected while tracing a cable path. """ pass
18.833333
56
0.637168
14
113
5.142857
0.928571
0
0
0
0
0
0
0
0
0
0
0
0.274336
113
5
57
22.6
0.878049
0.460177
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.5
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
1
1
0
0
0
0
0
4
e7e12e587bb879f420bc84b8389f1bf0bd41ed60
287
py
Python
caelus/post/__init__.py
sayerhs/cpl
4af066a1f8b48d6578807e59627d24b81fda3667
[ "Apache-2.0" ]
null
null
null
caelus/post/__init__.py
sayerhs/cpl
4af066a1f8b48d6578807e59627d24b81fda3667
[ "Apache-2.0" ]
25
2018-04-11T17:44:34.000Z
2021-07-19T16:57:17.000Z
caelus/post/__init__.py
sayerhs/cpl
4af066a1f8b48d6578807e59627d24b81fda3667
[ "Apache-2.0" ]
2
2019-03-28T12:12:58.000Z
2021-05-02T16:18:16.000Z
# -*- coding: utf-8 -*- """ Provides log analysis and plotting utilities .. currentmodule: caelus.post .. autosummary:: :nosignatures: ~funcobj.functions.PostProcessing ~logs.SolverLog ~plots.CaelusPlot """ from .logs import SolverLog from .funcobj import PostProcessing
16.882353
44
0.721254
29
287
7.137931
0.793103
0
0
0
0
0
0
0
0
0
0
0.004149
0.160279
287
16
45
17.9375
0.854772
0.735192
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
99ad04af3074d996686ef8151a50c86505bb0ab1
25
py
Python
fiber/__init__.py
ehmadzubair/django-fiber
af6e6deb14661d9d9f0b47f5d20adf135cfeef41
[ "Apache-2.0" ]
null
null
null
fiber/__init__.py
ehmadzubair/django-fiber
af6e6deb14661d9d9f0b47f5d20adf135cfeef41
[ "Apache-2.0" ]
null
null
null
fiber/__init__.py
ehmadzubair/django-fiber
af6e6deb14661d9d9f0b47f5d20adf135cfeef41
[ "Apache-2.0" ]
null
null
null
__version__ = '1.9.dev0'
12.5
24
0.68
4
25
3.25
1
0
0
0
0
0
0
0
0
0
0
0.136364
0.12
25
1
25
25
0.454545
0
0
0
0
0
0.32
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
99ade773a618ddee393d7651e4020af9a9a24f44
62
py
Python
python/testData/formatter/hangClosingParenthesisInFunctionDefinition_after.py
jnthn/intellij-community
8fa7c8a3ace62400c838e0d5926a7be106aa8557
[ "Apache-2.0" ]
2
2019-04-28T07:48:50.000Z
2020-12-11T14:18:08.000Z
python/testData/formatter/hangClosingParenthesisInFunctionDefinition_after.py
jnthn/intellij-community
8fa7c8a3ace62400c838e0d5926a7be106aa8557
[ "Apache-2.0" ]
173
2018-07-05T13:59:39.000Z
2018-08-09T01:12:03.000Z
python/testData/formatter/hangClosingParenthesisInFunctionDefinition_after.py
jnthn/intellij-community
8fa7c8a3ace62400c838e0d5926a7be106aa8557
[ "Apache-2.0" ]
2
2020-03-15T08:57:37.000Z
2020-04-07T04:48:14.000Z
def func( x, y, z ): pass
8.857143
10
0.225806
6
62
2.333333
1
0
0
0
0
0
0
0
0
0
0
0
0.693548
62
6
11
10.333333
0.736842
0
0
0
0
0
0
0
0
0
0
0
0
1
0.166667
false
0.166667
0
0
0.166667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
4
99ea3e4fe0a34fbb7a9258bb9cdc585ef19e9a6a
250
py
Python
cctbx/examples/merging/__init__.py
hbrunie/cctbx_project
2d8cb383d50fe20cdbbe4bebae8ed35fabce61e5
[ "BSD-3-Clause-LBNL" ]
2
2021-03-18T12:31:57.000Z
2022-03-14T06:27:06.000Z
cctbx/examples/merging/__init__.py
hbrunie/cctbx_project
2d8cb383d50fe20cdbbe4bebae8ed35fabce61e5
[ "BSD-3-Clause-LBNL" ]
null
null
null
cctbx/examples/merging/__init__.py
hbrunie/cctbx_project
2d8cb383d50fe20cdbbe4bebae8ed35fabce61e5
[ "BSD-3-Clause-LBNL" ]
1
2021-03-26T12:52:30.000Z
2021-03-26T12:52:30.000Z
from __future__ import absolute_import, division, print_function from scitbx.examples import bevington # import dependency import boost.python ext = boost.python.import_ext("cctbx_large_scale_merging_ext") from cctbx_large_scale_merging_ext import *
41.666667
64
0.86
35
250
5.714286
0.514286
0.11
0.15
0.22
0.25
0
0
0
0
0
0
0
0.088
250
5
65
50
0.877193
0.068
0
0
0
0
0.125541
0.125541
0
0
0
0
0
1
0
false
0
1
0
1
0.2
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
99f9eb724adfc7c484a44acc6b6f2b746df1c9b4
91
py
Python
demo_package/__init__.py
xiaocai2333/setuptools_demo
2b69570e9929492e5f0578dcca1f911b2786d90c
[ "Apache-2.0" ]
null
null
null
demo_package/__init__.py
xiaocai2333/setuptools_demo
2b69570e9929492e5f0578dcca1f911b2786d90c
[ "Apache-2.0" ]
null
null
null
demo_package/__init__.py
xiaocai2333/setuptools_demo
2b69570e9929492e5f0578dcca1f911b2786d90c
[ "Apache-2.0" ]
null
null
null
def demo(): print("This is a test package demo!") if __name__=='__main__': demo()
15.166667
41
0.615385
13
91
3.692308
0.846154
0
0
0
0
0
0
0
0
0
0
0
0.21978
91
6
42
15.166667
0.676056
0
0
0
0
0
0.395604
0
0
0
0
0
0
1
0.25
true
0
0
0
0.25
0.25
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
0
0
0
0
0
4
821e16326612b7b202a38879c079a7436391091f
175
py
Python
ml4vision/ml/__init__.py
ml4vision/ml4vision-py
5c8da0a0a099d70b390d5875ac08fbabe01372f1
[ "MIT" ]
null
null
null
ml4vision/ml/__init__.py
ml4vision/ml4vision-py
5c8da0a0a099d70b390d5875ac08fbabe01372f1
[ "MIT" ]
null
null
null
ml4vision/ml/__init__.py
ml4vision/ml4vision-py
5c8da0a0a099d70b390d5875ac08fbabe01372f1
[ "MIT" ]
null
null
null
try: import torch except ImportError: raise ImportError( "ml4vision.ml requires the pytorch library. Please run: pip install ml4vision-py[ml]" ) from None
25
93
0.702857
22
175
5.590909
0.863636
0
0
0
0
0
0
0
0
0
0
0.014815
0.228571
175
6
94
29.166667
0.896296
0
0
0
0
0
0.474286
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
4147e3b8819c86a9659370bfd204dcf64bc595ea
848
py
Python
balancesheet/mongoData/equities.py
tylertjburns/ledgerkeeper
cd69e9f48f35a973d08e450dfffdfea46bdc3802
[ "MIT" ]
null
null
null
balancesheet/mongoData/equities.py
tylertjburns/ledgerkeeper
cd69e9f48f35a973d08e450dfffdfea46bdc3802
[ "MIT" ]
null
null
null
balancesheet/mongoData/equities.py
tylertjburns/ledgerkeeper
cd69e9f48f35a973d08e450dfffdfea46bdc3802
[ "MIT" ]
null
null
null
import mongoengine from balancesheet.mongoData.valueSnapshot import ValueSnapshot class Equity(mongoengine.Document): # Top Level Elements name = mongoengine.StringField(required=True) description = mongoengine.StringField(required=True) account_id = mongoengine.StringField(required=True) equityClass = mongoengine.StringField(required=True) equityType = mongoengine.StringField(required=True) interestRate = mongoengine.FloatField(default=0.0) equityTimeHorizon = mongoengine.StringField(required=True) equityStatus = mongoengine.StringField(required=True) equityContingency = mongoengine.StringField(required=True) # Embedded Documents snapshots = mongoengine.EmbeddedDocumentListField(ValueSnapshot) # Meta meta = { 'db_alias': 'core', 'collection': 'equities' }
32.615385
68
0.753538
75
848
8.493333
0.506667
0.276295
0.376766
0.427002
0
0
0
0
0
0
0
0.002809
0.160377
848
25
69
33.92
0.891854
0.049528
0
0
0
0
0.037453
0
0
0
0
0
0
1
0
false
0
0.117647
0
0.823529
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
4
4148b2d71910b0a419f9b5a14ac13f4182c93531
72
py
Python
rest_framework_idempotency_key/utils.py
hardcoretech/djangorestframework-idempotency-key
0b7ed2789ab2b379a594fd090ddac9aa0b398250
[ "MIT" ]
5
2021-10-18T05:53:52.000Z
2022-02-09T14:09:15.000Z
rest_framework_idempotency_key/utils.py
hardcoretech/djangorestframework-idempotency-key
0b7ed2789ab2b379a594fd090ddac9aa0b398250
[ "MIT" ]
3
2021-11-02T13:00:56.000Z
2022-01-03T01:31:17.000Z
rest_framework_idempotency_key/utils.py
hardcoretech/djangorestframework-idempotency-key
0b7ed2789ab2b379a594fd090ddac9aa0b398250
[ "MIT" ]
null
null
null
def raise_if(expression, error): if expression: raise error
18
32
0.666667
9
72
5.222222
0.555556
0.510638
0
0
0
0
0
0
0
0
0
0
0.263889
72
3
33
24
0.886792
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0
0
0.333333
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
4
414a7bcbad230d44465498ba3b032788b46a44dd
252
py
Python
modules/server/physim.py
bullseyestudio/guns-game
3104c44e43ea7f000f6b9e756d622f98110d0a21
[ "Apache-2.0", "BSD-3-Clause" ]
null
null
null
modules/server/physim.py
bullseyestudio/guns-game
3104c44e43ea7f000f6b9e756d622f98110d0a21
[ "Apache-2.0", "BSD-3-Clause" ]
1
2018-11-21T04:50:57.000Z
2018-11-21T04:50:57.000Z
modules/server/physim.py
bullseyestudio/guns-game
3104c44e43ea7f000f6b9e756d622f98110d0a21
[ "Apache-2.0", "BSD-3-Clause" ]
null
null
null
""" Physics simulation module for Guns!, the tank game. Even more docstringy stuff goes here. Todo: I have no idea what physics sim functions we need yet, but we should have the module. Todo: This will probably end up breaking into bits. """ pass
19.384615
79
0.746032
42
252
4.47619
0.857143
0
0
0
0
0
0
0
0
0
0
0
0.194444
252
12
80
21
0.926108
0.936508
0
0
0
0
0
0
0
0
0
0.166667
0
1
0
true
1
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
1
0
0
0
0
0
0
null
0
0
1
0
0
0
1
1
0
0
0
0
0
4
41529f6a7beca29f77dfd4c17b5faebc1d10fed4
147
py
Python
textstat_core/sentence.py
textstat/textstat-core
83651221fc247e6c692611fb986a065997f510a9
[ "MIT" ]
1
2021-08-24T12:49:28.000Z
2021-08-24T12:49:28.000Z
textstat_core/sentence.py
textstat/textstat-core
83651221fc247e6c692611fb986a065997f510a9
[ "MIT" ]
null
null
null
textstat_core/sentence.py
textstat/textstat-core
83651221fc247e6c692611fb986a065997f510a9
[ "MIT" ]
null
null
null
from .word_collection import WordCollection class Sentence(WordCollection): @property def length(self): return len(self.words)
14.7
43
0.714286
16
147
6.5
0.875
0
0
0
0
0
0
0
0
0
0
0
0.210884
147
9
44
16.333333
0.896552
0
0
0
0
0
0
0
0
0
0
0
0
1
0.2
false
0
0.2
0.2
0.8
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
4
4164628fe6bd4ac76d26488527a421b69819feaf
109
py
Python
HW/HW7/CW7.2.py
kolyasalubov/Lv-639.pythonCore
06f10669a188318884adb00723127465ebdf2907
[ "MIT" ]
null
null
null
HW/HW7/CW7.2.py
kolyasalubov/Lv-639.pythonCore
06f10669a188318884adb00723127465ebdf2907
[ "MIT" ]
null
null
null
HW/HW7/CW7.2.py
kolyasalubov/Lv-639.pythonCore
06f10669a188318884adb00723127465ebdf2907
[ "MIT" ]
null
null
null
def reverse_list(l): return [list for list in reversed (l)] #'return a list with the reverse order of l'
27.25
44
0.706422
20
109
3.8
0.65
0.184211
0
0
0
0
0
0
0
0
0
0
0.201835
109
4
44
27.25
0.873563
0.394495
0
0
0
0
0
0
0
0
0
0
0
1
0.5
false
0
0
0.5
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
4
417ce8109acbf7b3defb8763966169dd0e97f8c2
529
py
Python
test/test_app/models.py
revpoint/prefs-n-perms
043075834e04b8b27e0f361294a868dd13ed5eac
[ "MIT" ]
3
2015-06-24T21:49:51.000Z
2019-04-13T13:27:49.000Z
test/test_app/models.py
revpoint/prefs-n-perms
043075834e04b8b27e0f361294a868dd13ed5eac
[ "MIT" ]
null
null
null
test/test_app/models.py
revpoint/prefs-n-perms
043075834e04b8b27e0f361294a868dd13ed5eac
[ "MIT" ]
null
null
null
from django.db import models class Site(models.Model): def __unicode__(self): return u'Site {0}'.format(self.id) class Customer(models.Model): site = models.ForeignKey('Site', related_name='customers') def __unicode__(self): return u'Customer {0} - Site {1}'.format(self.id, self.site.id) class CustomerUser(models.Model): customer = models.ForeignKey('Customer', related_name='users') def __unicode__(self): return u'User {0} - Customer {1}'.format(self.id, self.customer.id)
25.190476
75
0.676749
71
529
4.84507
0.352113
0.09593
0.122093
0.174419
0.281977
0
0
0
0
0
0
0.011468
0.175803
529
20
76
26.45
0.777523
0
0
0.25
0
0
0.151229
0
0
0
0
0
0
1
0.25
false
0
0.083333
0.25
1
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4
41813744111167da3c219271f87aaad2a8e12fda
1,550
py
Python
setup.py
xdssio/zappa_client
f2a511fb7d905dca78b6691b9f3042881e43e3a7
[ "MIT" ]
1
2019-03-03T08:01:46.000Z
2019-03-03T08:01:46.000Z
setup.py
xdssio/zappa_client
f2a511fb7d905dca78b6691b9f3042881e43e3a7
[ "MIT" ]
null
null
null
setup.py
xdssio/zappa_client
f2a511fb7d905dca78b6691b9f3042881e43e3a7
[ "MIT" ]
null
null
null
from setuptools import setup setup(name='zappa_client', description='A tool to call Zappa serverless function directly without AWS APIGateway', long_description="Zappa is a tool wrap the deployment of serverless applications to AWS Lambda, " "you can invoke your function with AWS APIGatway using curl easily. " "For some use cases you would like to avoid opening your function to APIGateway " "and to call your function directly. " "there are many steps implemented by zappa which makes it difficult, " "this package is a wrapper to save you that pain.", version='0.0.1', url='https://github.com/xdssio/zappa_client', author='J. Alexander', author_email='jonathan@xdss.io', license='MIT License', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', ], install_requires=[ 'boto3>=1.7.21' ], )
44.285714
104
0.58
171
1,550
5.22807
0.578947
0.191275
0.251678
0.174497
0.060403
0
0
0
0
0
0
0.023563
0.315484
1,550
34
105
45.588235
0.819039
0
0
0.0625
0
0
0.634194
0
0
0
0
0
0
1
0
true
0
0.03125
0
0.03125
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
41aec4ac36837d1f62070070f3b2ce109d311a9e
272
py
Python
tests/gamestonk_terminal/stocks/discovery/test_disc_api.py
minhhoang1023/GamestonkTerminal
195dc19b491052df080178c0cc6a9d535a91a704
[ "MIT" ]
1
2022-03-15T13:05:40.000Z
2022-03-15T13:05:40.000Z
tests/gamestonk_terminal/stocks/discovery/test_disc_api.py
minhhoang1023/GamestonkTerminal
195dc19b491052df080178c0cc6a9d535a91a704
[ "MIT" ]
null
null
null
tests/gamestonk_terminal/stocks/discovery/test_disc_api.py
minhhoang1023/GamestonkTerminal
195dc19b491052df080178c0cc6a9d535a91a704
[ "MIT" ]
null
null
null
# IMPORTATION STANDARD # IMPORTATION THIRDPARTY # IMPORTATION INTERNAL from gamestonk_terminal.helper_classes import ModelsNamespace as _models from gamestonk_terminal.stocks.discovery import disc_api def test_models(): assert isinstance(disc_api.models, _models)
22.666667
72
0.834559
32
272
6.84375
0.65625
0.118721
0.191781
0
0
0
0
0
0
0
0
0
0.117647
272
11
73
24.727273
0.9125
0.235294
0
0
0
0
0
0
0
0
0
0
0.25
1
0.25
true
0
0.5
0
0.75
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
1
0
0
0
0
4
68b8fe46b554e12f32c4cef0a0ea05e606d861da
229
py
Python
App/models/users.py
MaiXiaochai/SnailAPI
2de24f2d1f0b93dc743210b1d66ef2665a09ba40
[ "Apache-2.0" ]
null
null
null
App/models/users.py
MaiXiaochai/SnailAPI
2de24f2d1f0b93dc743210b1d66ef2665a09ba40
[ "Apache-2.0" ]
9
2020-09-14T02:02:31.000Z
2020-09-14T02:08:20.000Z
App/models/users.py
MaiXiaochai/SnailAPI
2de24f2d1f0b93dc743210b1d66ef2665a09ba40
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- """ -------------------------------------- @File : users.py @Author : maixiaochai @Email : maixiaochai@outlook.com @Created on : 2020/5/22 15:42 -------------------------------------- """
19.083333
38
0.366812
19
229
4.421053
0.947368
0
0
0
0
0
0
0
0
0
0
0.063492
0.174672
229
11
39
20.818182
0.380952
0.947598
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
0
0
0
1
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
68e5cd444bcd9d3a06825483f468cc9e2ec86376
16,520
py
Python
src/aadcUserPython/ParkingTrajectory.py
LITdrive/aadc2018
93ce64286eef7eedd9e886da8c685f12827e396f
[ "BSD-4-Clause" ]
5
2018-11-13T01:40:20.000Z
2019-10-22T12:25:38.000Z
src/aadcUserPython/ParkingTrajectory.py
LITdrive/aadc2018
93ce64286eef7eedd9e886da8c685f12827e396f
[ "BSD-4-Clause" ]
null
null
null
src/aadcUserPython/ParkingTrajectory.py
LITdrive/aadc2018
93ce64286eef7eedd9e886da8c685f12827e396f
[ "BSD-4-Clause" ]
1
2019-12-28T02:19:44.000Z
2019-12-28T02:19:44.000Z
# Imports import math import numpy as np import matplotlib.pyplot as plt class ParkingTrajectoryGenerator: # Class Variables # Vehicle Parameters __l = 0.356 # length between front and rear axle in m __b = 0.37 # width of car in m __l_1 = 0.12 # length between front axle and bumper in m __l_2 = 0.108 # length between rear axle and bumper in m __alpha_max = math.radians(45) # maximum steering angle in rad # alpha_c = alpha_max # constant steering angle in rad __rho_min = 1/math.tan(__alpha_max) # radius of the turning cycle of the car in m # Driving lane and parking spot parameters __h_cd = 0.974-2*0.03 # width of driving lane in m __h_pd = (0.96-3*0.02)/2 # width of parking space in m __h_pw = 0.85 # depth of parking space in m __h_ps = (__h_pd - __b)/2 # = h_pr = h_pl = h_ps -> for symmetrical parking -> space between car and parking space boundaries in m # Parameters for calculation of the Trajectory Points __num_points_per_segment = 100 __pull_out_left_straight_offset = 0.2 __r_B2 = math.sqrt((__l + __l_1)**2 + (__rho_min + __b/2)**2) __s_m = -math.sqrt((__rho_min - __b/2)**2 - (__rho_min - __h_pd/2)**2) __s_max = __h_cd - __r_B2 __s = max(abs(__s_m), abs(__s_max)) # Points of Parking Trajectory __parkingTrajectoryPoints_x_rear_axle = np.zeros(2*__num_points_per_segment) __parkingTrajectoryPoints_y_rear_axle = np.zeros(2*__num_points_per_segment) #__parkingTrajectoryPoints_x_front_axle = np.zeros(2*__num_points_per_segment) #__parkingTrajectoryPoints_y_front_axle = np.zeros(2*__num_points_per_segment) __pullOutLeftTrajectoryPoints_x_rear_axle = np.zeros(2*__num_points_per_segment) __pullOutLeftTrajectoryPoints_y_rear_axle = np.zeros(2*__num_points_per_segment) #__pullOutLeftTrajectoryPoints_x_front_axle = np.zeros(2*__num_points_per_segment) #__pullOutLeftTrajectoryPoints_y_front_axle = np.zeros(2*__num_points_per_segment) # Heading of Parking Trajectory __parkingTrajectoryHeading_rear_axle = np.zeros(2*__num_points_per_segment) # Parameter for Representing Circle Arc as Polynomial (Bezier) __c = 0.55191502449 # Parameters of Steering Angle Controller (Saturated Control) from Paper __K_t = 8 __K = 5.85 __a_0 = 0.17 __u = np.tan(__alpha_max)/__l # Vehicle Heading for test purposes (idealised) __theta = np.zeros(2*__num_points_per_segment) # Constructor def __init__(self, targetParkingSpot_x = 0, targetParkingSpot_y = 0): self.__targetPoint_x_rear_axle = targetParkingSpot_x + self.__h_pw - self.__l_2 - self.__h_ps self.__targetPoint_y_rear_axle = targetParkingSpot_y self.__targetPoint_x_front_axle = targetParkingSpot_x + self.__h_pw - self.__l_2 - self.__h_ps - self.__l self.__targetPoint_y_front_axle = targetParkingSpot_y self.calcParkingTrajectory() self.calcPullOutLeftTrajectory() # Setter def setTargetParkingSpot(self, targetParkingSpot_x = 0, targetParkingSpot_y = 0): self.__targetPoint_x_rear_axle = targetParkingSpot_x + self.__h_pw - self.__l_2 - self.__h_ps self.__targetPoint_y_rear_axle = targetParkingSpot_y self.__targetPoint_x_front_axle = targetParkingSpot_x + self.__h_pw - self.__l_2 - self.__h_ps - self.__l self.__targetPoint_y_front_axle = targetParkingSpot_y self.calcParkingTrajectory() self.calcPullOutLeftTrajectory() # Getter def getParkingStartPoint(self): return self.__parkingTrajectoryPoints_x_rear_axle[-1], self.__parkingTrajectoryPoints_y_rear_axle[-1] def getParkingEndPoint(self): return self.__targetPoint_x_rear_axle, self.__targetPoint_y_rear_axle def getParkingTrajectoryPolynomials(self): return self.__parkingTrajectory_polynomial_coefficients_circle_arc_x, self.__parkingTrajectory_polynomial_coefficients_circle_arc_y, self.__parkingTrajectory_polynomial_coefficients_straight_x, self.__parkingTrajectory_polynomial_coefficients_straight_y def gePullOutLeftTrajectoryPolynomials(self): return self.__pullOutLeftTrajectory_polynomial_coefficients_circle_arc_x, self.__pullOutLeftTrajectory_polynomial_coefficients_circle_arc_y, self.__pullOutLeftTrajectory_polynomial_coefficients_straight_x, self.__pullOutLeftTrajectory_polynomial_coefficients_straight_y # Functions def calcParkingTrajectory(self): # = Pull Out Right Trajectory # Target Point Rear End of the Parking Spot (Rear end of the axle) S_x_rear_axle = self.__targetPoint_x_rear_axle - self.__h_pw + self.__l_2 + self.__h_ps + self.__s S_y_rear_axle = self.__targetPoint_y_rear_axle #S_x_front_axle = self.targetPoint_x_front_axle - self.h_pw + self.l_2 + self.h_ps + self.s + self.l #S_y_front_axle = self.targetPoint_y_front_axle O_x_rear_axle = S_x_rear_axle O_y_rear_axle = S_y_rear_axle + self.__rho_min #O_x_front_axle = S_x_front_axle #O_y_front_axle = S_y_front_axle + self.rho_min # Points on Unit circle with Origin O P_0_circle_arc_x = O_x_rear_axle P_0_circle_arc_y = O_y_rear_axle - 1 P_1_circle_arc_x = O_x_rear_axle - self.__c P_1_circle_arc_y = O_y_rear_axle - 1 P_2_circle_arc_x = O_x_rear_axle - 1 P_2_circle_arc_y = O_y_rear_axle - self.__c P_3_circle_arc_x = O_x_rear_axle - 1 P_3_circle_arc_y = O_y_rear_axle # Polynomial of the circle arc self.__parkingTrajectory_polynomial_coefficients_circle_arc_x = np.poly1d([self.__rho_min*(P_3_circle_arc_x + 3.*P_1_circle_arc_x - 3.*P_2_circle_arc_x - P_0_circle_arc_x), self.__rho_min*3*(P_2_circle_arc_x - 2*P_1_circle_arc_x + P_0_circle_arc_x), self.__rho_min*3*(P_1_circle_arc_x - P_0_circle_arc_x), self.__rho_min*P_0_circle_arc_x]) self.__parkingTrajectory_polynomial_coefficients_circle_arc_y = np.poly1d([self.__rho_min*(P_3_circle_arc_y + 3.*P_1_circle_arc_y - 3.*P_2_circle_arc_y - P_0_circle_arc_y), self.__rho_min*3*(P_2_circle_arc_y - 2*P_1_circle_arc_y + P_0_circle_arc_y), self.__rho_min*3*(P_1_circle_arc_y - P_0_circle_arc_y), self.__rho_min*P_0_circle_arc_y]) # Polynomial of the straight self.__parkingTrajectory_polynomial_coefficients_straight_x = np.poly1d([0, 0, S_x_rear_axle - self.__targetPoint_x_rear_axle, self.__targetPoint_x_rear_axle]) self.__parkingTrajectory_polynomial_coefficients_straight_y = np.poly1d([0, 0, S_y_rear_axle - self.__targetPoint_y_rear_axle, self.__targetPoint_y_rear_axle]) self.__parkingTrajectoryPoints_x_rear_axle[ : self.__num_points_per_segment] = np.linspace(self.__targetPoint_x_rear_axle, S_x_rear_axle, self.__num_points_per_segment) self.__parkingTrajectoryPoints_y_rear_axle[ : self.__num_points_per_segment] = np.ones(self.__num_points_per_segment)*self.__targetPoint_y_rear_axle #self.__parkingTrajectoryHeading_rear_axle[ : self.__num_points_per_segment] = np.ones(self.__num_points_per_segment)*math.pi #self.parkingTrajectoryPoints_x_front_axle[0 : self.num_points_per_segment] = np.linspace(self.targetPoint_x_front_axle, S_x_front_axle, self.num_points_per_segment) #self.parkingTrajectoryPoints_y_front_axle[0 : self.num_points_per_segment] = np.ones(self.num_points_per_segment)*self.targetPoint_y_front_axle circle_arc_angle = np.linspace(math.pi, math.pi*(3/2), self.__num_points_per_segment) #heading_angle = np.linspace(math.pi, math.pi/2, self.__num_points_per_segment) # Vehicle Heading for test self.__theta[ : self.__num_points_per_segment] = math.pi self.__theta[self.__num_points_per_segment : ] = np.linspace(math.pi, math.pi/2, self.__num_points_per_segment) #i = self.__num_points_per_segment #for angle in circle_arc_angle : self.__parkingTrajectoryPoints_x_rear_axle[self.__num_points_per_segment : ] = self.__rho_min*np.cos(circle_arc_angle) + O_x_rear_axle self.__parkingTrajectoryPoints_y_rear_axle[self.__num_points_per_segment : ] = self.__rho_min*np.sin(circle_arc_angle) + O_y_rear_axle #self.__parkingTrajectoryPoints_x_front_axle[ : self.__num_points_per_segment] = self.__parkingTrajectoryPoints_x_rear_axle[ : self.__num_points_per_segment] - self.__l #self.__parkingTrajectoryPoints_y_front_axle[ : self.__num_points_per_segment] = self.__parkingTrajectoryPoints_y_rear_axle[ : self.__num_points_per_segment] #self.__parkingTrajectoryPoints_x_front_axle[self.__num_points_per_segment : ] = self.__parkingTrajectoryPoints_x_rear_axle[self.__num_points_per_segment : ] + np.cos(self.__theta[self.__num_points_per_segment : ])*self.__l #self.__parkingTrajectoryPoints_y_front_axle[self.__num_points_per_segment : ] = self.__parkingTrajectoryPoints_y_rear_axle[self.__num_points_per_segment : ] + np.sin(self.__theta[self.__num_points_per_segment : ])*self.__l #self.__parkingTrajectoryHeading_rear_axle[self.__num_points_per_segment : ] = heading_angle #self.parkingTrajectoryPoints_x_front_axle[i] = self.rho_min*math.cos(angle) + O_x_front_axle #self.parkingTrajectoryPoints_y_front_axle[i] = self.rho_min*math.sin(angle) + O_y_front_axle # i += 1 # Printing #t = np.linspace(0, 1, 100) #poly_circle_arc_x = self.__parkingTrajectory_polynomial_coefficients_circle_arc_x(t) #poly_circle_arc_y = self.__parkingTrajectory_polynomial_coefficients_circle_arc_y(t) #poly_straight_x = self.__parkingTrajectory_polynomial_coefficients_straight_x(t) #poly_straight_y = self.__parkingTrajectory_polynomial_coefficients_straight_y(t) #plt.plot(self.__parkingTrajectoryPoints_x_rear_axle, self.__parkingTrajectoryPoints_y_rear_axle, 'b.') #plt.plot(poly_circle_arc_x, poly_circle_arc_y, 'r.') #plt.plot(poly_straight_x, poly_straight_y, 'r.') #plt.show() #plt.stem(self.__parkingTrajectoryHeading_rear_axle) #plt.show() return self.__parkingTrajectory_polynomial_coefficients_circle_arc_x, self.__parkingTrajectory_polynomial_coefficients_circle_arc_y, self.__parkingTrajectory_polynomial_coefficients_straight_x, self.__parkingTrajectory_polynomial_coefficients_straight_y def calcPullOutLeftTrajectory(self): # Target Point Rear End of the Parking Spot (Rear end of the axle) S_x_rear_axle = self.__targetPoint_x_rear_axle - self.__h_pw + self.__l_2 + self.__h_ps + self.__s - self.__pull_out_left_straight_offset S_y_rear_axle = self.__targetPoint_y_rear_axle #S_x_front_axle = self.targetPoint_x_front_axle - self.h_pw + self.l_2 + self.h_ps + self.s + self.l #S_y_front_axle = self.targetPoint_y_front_axle O_x_rear_axle = S_x_rear_axle O_y_rear_axle = S_y_rear_axle - self.__rho_min #O_x_front_axle = S_x_front_axle #O_y_front_axle = S_y_front_axle + self.rho_min # Points on Unit circle with Origin O P_0_circle_arc_x = O_x_rear_axle - 1 P_0_circle_arc_y = O_y_rear_axle P_1_circle_arc_x = O_x_rear_axle - 1 P_1_circle_arc_y = O_y_rear_axle + self.__c P_2_circle_arc_x = O_x_rear_axle - self.__c P_2_circle_arc_y = O_y_rear_axle + 1 P_3_circle_arc_x = O_x_rear_axle P_3_circle_arc_y = O_y_rear_axle + 1 # Polynomial of the circle arc self.__pullOutLeftTrajectory_polynomial_coefficients_circle_arc_x = np.poly1d([self.__rho_min*(P_3_circle_arc_x + 3.*P_1_circle_arc_x - 3.*P_2_circle_arc_x - P_0_circle_arc_x), self.__rho_min*3*(P_2_circle_arc_x - 2*P_1_circle_arc_x + P_0_circle_arc_x), self.__rho_min*3*(P_1_circle_arc_x - P_0_circle_arc_x), self.__rho_min*P_0_circle_arc_x]) self.__pullOutLeftTrajectory_polynomial_coefficients_circle_arc_y = np.poly1d([self.__rho_min*(P_3_circle_arc_y + 3.*P_1_circle_arc_y - 3.*P_2_circle_arc_y - P_0_circle_arc_y), self.__rho_min*3*(P_2_circle_arc_y - 2*P_1_circle_arc_y + P_0_circle_arc_y), self.__rho_min*3*(P_1_circle_arc_y - P_0_circle_arc_y), self.__rho_min*P_0_circle_arc_y]) # Polynomial of the straight self.__pullOutLeftTrajectory_polynomial_coefficients_straight_x = np.poly1d([0, 0, S_x_rear_axle - self.__targetPoint_x_rear_axle, self.__targetPoint_x_rear_axle]) self.__pullOutLeftTrajectory_polynomial_coefficients_straight_y = np.poly1d([0, 0, S_y_rear_axle - self.__targetPoint_y_rear_axle, self.__targetPoint_y_rear_axle]) self.__pullOutLeftTrajectoryPoints_x_rear_axle[0 : self.__num_points_per_segment] = np.linspace(self.__targetPoint_x_rear_axle, S_x_rear_axle, self.__num_points_per_segment) self.__pullOutLeftTrajectoryPoints_y_rear_axle[0 : self.__num_points_per_segment] = np.ones(self.__num_points_per_segment)*self.__targetPoint_y_rear_axle #self.parkingTrajectoryPoints_x_front_axle[0 : self.num_points_per_segment] = np.linspace(self.targetPoint_x_front_axle, S_x_front_axle, self.num_points_per_segment) #self.parkingTrajectoryPoints_y_front_axle[0 : self.num_points_per_segment] = np.ones(self.num_points_per_segment)*self.targetPoint_y_front_axle circle_arc_angle = np.linspace(math.pi, math.pi/2, self.__num_points_per_segment) i = self.__num_points_per_segment for angle in circle_arc_angle : self.__pullOutLeftTrajectoryPoints_x_rear_axle[i] = self.__rho_min*np.cos(angle) + O_x_rear_axle self.__pullOutLeftTrajectoryPoints_y_rear_axle[i] = self.__rho_min*np.sin(angle) + O_y_rear_axle #self.parkingTrajectoryPoints_x_front_axle[i] = self.rho_min*math.cos(angle) + O_x_front_axle #self.parkingTrajectoryPoints_y_front_axle[i] = self.rho_min*math.sin(angle) + O_y_front_axle i += 1 # Printing #t = np.linspace(0, 1, 100) #poly_circle_arc_x = self.__pullOutLeftTrajectory_polynomial_coefficients_circle_arc_x(t) #poly_circle_arc_y = self.__pullOutLeftTrajectory_polynomial_coefficients_circle_arc_y(t) #poly_straight_x = self.__pullOutLeftTrajectory_polynomial_coefficients_straight_x(t) #poly_straight_y = self.__pullOutLeftTrajectory_polynomial_coefficients_straight_y(t) #plt.plot(self.__parkingTrajectoryPoints_x_rear_axle, self.__parkingTrajectoryPoints_y_rear_axle, 'b.') #plt.plot(self.__pullOutLeftTrajectoryPoints_x_rear_axle, self.__pullOutLeftTrajectoryPoints_y_rear_axle, 'b.') #plt.plot(poly_circle_arc_x, poly_circle_arc_y, 'r.') #plt.plot(poly_straight_x, poly_straight_y, 'r.') #plt.show() return self.__pullOutLeftTrajectory_polynomial_coefficients_circle_arc_x, self.__pullOutLeftTrajectory_polynomial_coefficients_circle_arc_y, self.__pullOutLeftTrajectory_polynomial_coefficients_straight_x, self.__pullOutLeftTrajectory_polynomial_coefficients_straight_y def getSteeringAngle(self, actualPoint_y, vehicle_heading): theta = vehicle_heading - math.pi print(theta) v = self.__K*(theta - self.__a_0*actualPoint_y) alpha = np.arctan(self.__l*self.__u*np.tanh(self.__K_t*v)) return alpha ParkingTrajectoryGenerator1 = ParkingTrajectoryGenerator() [a, b, c, d] = ParkingTrajectoryGenerator1.getParkingTrajectoryPolynomials() print(a) print(b) print(c) print(d) #plt.plot(ParkingTrajectoryGenerator1._ParkingTrajectoryGenerator__parkingTrajectoryPoints_x_front_axle, ParkingTrajectoryGenerator1._ParkingTrajectoryGenerator__parkingTrajectoryPoints_y_front_axle, 'b.', ParkingTrajectoryGenerator1._ParkingTrajectoryGenerator__parkingTrajectoryPoints_x_rear_axle, ParkingTrajectoryGenerator1._ParkingTrajectoryGenerator__parkingTrajectoryPoints_y_rear_axle, 'r.') #plt.show() steering_angle = np.zeros(ParkingTrajectoryGenerator1._ParkingTrajectoryGenerator__parkingTrajectoryPoints_y_rear_axle.size) i = 0 for elem in ParkingTrajectoryGenerator1._ParkingTrajectoryGenerator__parkingTrajectoryPoints_y_rear_axle : steering_angle[i] = ParkingTrajectoryGenerator1.getSteeringAngle(ParkingTrajectoryGenerator1._ParkingTrajectoryGenerator__parkingTrajectoryPoints_y_rear_axle[i], ParkingTrajectoryGenerator1._ParkingTrajectoryGenerator__theta[i]) i += 1 plt.stem(ParkingTrajectoryGenerator1._ParkingTrajectoryGenerator__theta) plt.show() plt.stem(np.degrees(steering_angle)) plt.show() #ParkingTrajectoryGenerator1.calcPullOutLeftTrajectory()
64.53125
399
0.775545
2,391
16,520
4.687997
0.072773
0.067803
0.053528
0.084753
0.810063
0.774913
0.725756
0.6981
0.685788
0.642163
0
0.016844
0.148305
16,520
256
400
64.53125
0.779815
0.357446
0
0.192
0
0
0
0
0
0
0
0
0
1
0.072
false
0
0.024
0.032
0.376
0.04
0
0
0
null
0
0
0
1
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
68e7c50150cab2884326588ce1a523b7a6d01c6b
207
py
Python
src/vectorgen/constants.py
davehadley/hk-vectorgen
620a17b6a36357188e8d5b74867c497114edb178
[ "MIT" ]
null
null
null
src/vectorgen/constants.py
davehadley/hk-vectorgen
620a17b6a36357188e8d5b74867c497114edb178
[ "MIT" ]
null
null
null
src/vectorgen/constants.py
davehadley/hk-vectorgen
620a17b6a36357188e8d5b74867c497114edb178
[ "MIT" ]
null
null
null
############################################################################### class Orientation: Z = "Z" Y = "Y" ###############################################################################
20.7
79
0.096618
6
207
3.333333
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.10628
207
9
80
23
0.108108
0
0
0
0
0
0.042553
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
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
4
6b59680afcdb454a1c50979b66b6fbeabe5c32d2
93
py
Python
damera/cmd/conductor.py
klonhj2015/damera
e7effe13e568bf5590538a274c8ffb10d82b8725
[ "Apache-2.0" ]
null
null
null
damera/cmd/conductor.py
klonhj2015/damera
e7effe13e568bf5590538a274c8ffb10d82b8725
[ "Apache-2.0" ]
6
2019-12-26T16:44:12.000Z
2022-03-21T22:16:43.000Z
damera/cmd/conductor.py
klonhj2015/damera
e7effe13e568bf5590538a274c8ffb10d82b8725
[ "Apache-2.0" ]
null
null
null
from oslo_log import log as logging LOG = logging.getLogger(__name__) def main(): pass
13.285714
35
0.731183
14
93
4.5
0.785714
0
0
0
0
0
0
0
0
0
0
0
0.193548
93
7
36
13.285714
0.84
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0.25
0.25
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
1
0
1
0
0
0
0
0
4
6b5e9fa9ae629ccfd18d98712eed533b4a0776ae
21
py
Python
aliyun-python-sdk-nlp-automl/aliyunsdknlp_automl/__init__.py
yndu13/aliyun-openapi-python-sdk
12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5
[ "Apache-2.0" ]
1,001
2015-07-24T01:32:41.000Z
2022-03-25T01:28:18.000Z
aliyun-python-sdk-nlp-automl/aliyunsdknlp_automl/__init__.py
yndu13/aliyun-openapi-python-sdk
12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5
[ "Apache-2.0" ]
363
2015-10-20T03:15:00.000Z
2022-03-08T12:26:19.000Z
aliyun-python-sdk-nlp-automl/aliyunsdknlp_automl/__init__.py
yndu13/aliyun-openapi-python-sdk
12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5
[ "Apache-2.0" ]
682
2015-09-22T07:19:02.000Z
2022-03-22T09:51:46.000Z
__version__ = '0.0.9'
21
21
0.666667
4
21
2.5
0.75
0
0
0
0
0
0
0
0
0
0
0.157895
0.095238
21
1
21
21
0.368421
0
0
0
0
0
0.227273
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
6b682b684d5b130be5a89c233b7f3995b6746daa
95
py
Python
admin_toolbox/apps.py
sarendsen/django-admin-toolbox
9f733d90d0d95924a0f07e5a4e45e56f4de29d85
[ "MIT" ]
12
2017-04-28T18:58:01.000Z
2020-07-16T11:10:00.000Z
admin_toolbox/apps.py
sarendsen/django-admin-toolbox
9f733d90d0d95924a0f07e5a4e45e56f4de29d85
[ "MIT" ]
7
2019-01-28T13:02:44.000Z
2019-06-16T21:50:23.000Z
admin_toolbox/apps.py
sarendsen/django-admin-toolbox
9f733d90d0d95924a0f07e5a4e45e56f4de29d85
[ "MIT" ]
4
2019-02-26T06:12:53.000Z
2020-03-08T10:18:05.000Z
from django.apps import AppConfig class SidebarConfig(AppConfig): name = 'admin_toolbox'
15.833333
33
0.768421
11
95
6.545455
0.909091
0
0
0
0
0
0
0
0
0
0
0
0.157895
95
5
34
19
0.9
0
0
0
0
0
0.136842
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
6b91bd137a11000648809dd64eb2560da25522c9
71
py
Python
database_service/run.py
Fox520/PaymentGateway
c4c0675b056ac377b135de778069b1c63883b6de
[ "MIT" ]
1
2021-11-23T16:33:39.000Z
2021-11-23T16:33:39.000Z
database_service/run.py
Fox520/PaymentGateway
c4c0675b056ac377b135de778069b1c63883b6de
[ "MIT" ]
null
null
null
database_service/run.py
Fox520/PaymentGateway
c4c0675b056ac377b135de778069b1c63883b6de
[ "MIT" ]
null
null
null
from db_api import app app.run(host="0.0.0.0", port=6001, debug=True)
17.75
46
0.704225
16
71
3.0625
0.75
0.122449
0.122449
0
0
0
0
0
0
0
0
0.126984
0.112676
71
3
47
23.666667
0.650794
0
0
0
0
0
0.098592
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
6ba20fb546fac78e974173f8edb232960fd14b66
19,757
py
Python
hw3/lab_setup.py
Cate-Lukner/csc221
443027ea9a5a39a17a3bb38c5ad868843ceb2e10
[ "CC0-1.0" ]
null
null
null
hw3/lab_setup.py
Cate-Lukner/csc221
443027ea9a5a39a17a3bb38c5ad868843ceb2e10
[ "CC0-1.0" ]
null
null
null
hw3/lab_setup.py
Cate-Lukner/csc221
443027ea9a5a39a17a3bb38c5ad868843ceb2e10
[ "CC0-1.0" ]
1
2021-09-02T03:55:17.000Z
2021-09-02T03:55:17.000Z
#!/usr/bin/env python3 import os import gzip import random import json import argparse import logging from pathlib import Path import typing as T from functools import lru_cache log = logging.getLogger(__name__) log.addHandler(logging.NullHandler()) memoize = lru_cache(None) def make_dir(path: str) -> None: Path(path).mkdir(exist_ok=True) @memoize def get_words() -> T.List[str]: return gzip.decompress(WORDS).decode().splitlines() def file_content(word: str, words: T.List[str]) -> str: all_words = [word] + words * 5 random.shuffle(all_words) return '\n'.join(all_words) def part1_path(info): path = Path(info['root'], 'part1') path.mkdir(exist_ok=True) return path def part2_path(info): path = Path(info['root'], 'part2') path.mkdir(exist_ok=True) return path def powerlaw_sequence(population): '''given population P, create occurance behavior of elements that follow powerlaw distribution ''' N = len(population) shuffled = random.sample(population, len(population)) degree = [1] + [0] * (N - 1) for i, value in enumerate(shuffled[1:], 1): n = random.choices( range(N), weights=degree, )[0] degree[i] += 1 degree[n] += 1 new = [] for i, (d, v) in enumerate(zip(degree, shuffled)): new.extend([v] * d) random.shuffle(new) return new def random_numbers(N: int, M: int, max_value: int = 100000): '''create NxM random numbers following powerlaw distribution from range of max_value ''' def sample(): return random.sample(range(max_value), N) numbers = tuple(zip(*[sample() for j in range(M)])) return powerlaw_sequence(numbers)[:N] def random_words(): '''create random words following powerlaw distribution ''' words = get_words() return powerlaw_sequence(words) def create_part2_files(info): Path(part2_path(info), 'shuffled-words.txt').write_text( '\n'.join(random_words()) ) Path(part2_path(info), 'rand-words.txt').write_text( '\n'.join(random_words()) ) def to_text(numbers): return '\n'.join(''.join(f'{n:<8}' for n in row) for row in numbers) Path(part2_path(info), 'rand-numbers.txt').write_text( to_text(random_numbers(1000, 1)) ) Path(part2_path(info), 'rand-numbers-2.txt').write_text( to_text(random_numbers(1000, 2)) ) Path(part2_path(info), 'rand-numbers-5.txt').write_text( to_text(random_numbers(1000, 5)) ) def create_part1_files(root:str, ndirs:int=10, nfiles:int=200) -> dict: info = {'ndirs': ndirs} info['root'] = root words = get_words() random.shuffle(words) directory_words, words = words[:ndirs], words[ndirs:] info['dirs'] = sorted(directory_words) file_words = directory_words * (nfiles // ndirs) info['file_words'] = {} for i in range(nfiles): name = f'file{i:05d}' word = file_words[i % ndirs] info['file_words'].setdefault(word, []).append(name) Path(part1_path(info), name).write_text(file_content(word, words)) return info README_BP = ''' Your lab directory is: {root} Inside your lab directory, you must create these directories: {dirs} For example: $ cd {root} $ mkdir {word} These directories are random words chosen based on your username. Each file in your lab directory (e.g. {file}) contains a list of random words, but each one contains one instance of each of the random words you used to create your directories. Each file must be placed in the directory whose name is contained in the file. E.g. if the word "{word}" is in the file "{file}", then you must move that file "{file}" into the directory "{word}". $ cd {root} $ mv {file} {word} ''' def create_readme(info: dict) -> None: readme = README_BP.format( root=info['root'], dirs='\n'.join(' {}'.format(w) for w in info['dirs']), file=info['file_words'][info['dirs'][0]][0], word=info['dirs'][0], ) Path(part1_path(info), 'README.txt').write_text(readme) def write_info(info: dict) -> None: Path(info['root'], '.info').write_text( json.dumps(info, indent=1, sort_keys=True) ) def get_args(): parser = argparse.ArgumentParser() parser.add_argument('studentid') parser.add_argument('-r', '--root', default='.', type=os.path.abspath) parser.add_argument('--loglevel', default='info', type=lambda s: s.upper()) args = parser.parse_args() return args def main() -> None: args = get_args() logging.basicConfig(level=logging.getLevelName(args.loglevel)) random.seed(args.studentid) make_dir(args.root) info = create_part1_files(args.root) create_readme(info) create_part2_files(info) WORDS = b'\x1f\x8b\x08\x00\x0f\xac\xa7V\x02\xffU\x9a\xd9\x82\xf3\xac\xaeD\xef\xfd\x96\xd8&6\x1d\x0c\xfe\x19\x92v\x9e\xfe\xac\x12N\x7f\xfb\\t\x10\x1e\x18\x84T*\xc9\xed\xe69\xb7\xe5\x9a\xdc\xbc\xe6#\xa4\\\x97|Z\x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bfV\x88\xc1\xab^o\xa8V\'\xfb\xe6\xcf\x9b\xa8\xee\xad\x0f|v:\xef\xfe\xd1\xd7\xa8_\xfd\xaf\x0cP1\xfdB\\\x96J\x93\xc4\xca.\xb1\xad\xcb7=rA*\xed\x9f5\x94\xfcL\x17q\xe1C\xf2\xf0a3J\xe0\x95\n|\xf0\x9c\xe9\x93GzrM\x9f\x8bT\xe3\xff\x00F>3\xd9\xd1(\x00\x00' if __name__=='__main__': main()
99.782828
14,905
0.713165
4,106
19,757
3.405504
0.272284
0.006865
0.005578
0.006079
0.029321
0.026389
0.016949
0.016949
0
0
0
0.188081
0.052184
19,757
197
14,906
100.28934
0.558635
0.012806
0
0.075188
0
0.105263
0.610284
0.564824
0
0
0
0
0
1
0.120301
false
0
0.067669
0.022556
0.270677
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
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
6bee50315a58302dae426fc8674dfc85564bf41c
189
py
Python
test/binaries/foo_v1.py
drmikecrowe/cod
d468624299b83f1dec9f1ac413667337cd512332
[ "Apache-2.0" ]
405
2020-02-01T22:26:41.000Z
2022-03-22T02:20:14.000Z
test/binaries/foo_v1.py
drmikecrowe/cod
d468624299b83f1dec9f1ac413667337cd512332
[ "Apache-2.0" ]
30
2020-02-04T14:01:39.000Z
2022-01-21T01:36:04.000Z
test/binaries/foo_v1.py
drmikecrowe/cod
d468624299b83f1dec9f1ac413667337cd512332
[ "Apache-2.0" ]
22
2020-02-04T17:42:56.000Z
2022-03-04T06:24:37.000Z
#!/usr/bin/env python3 """ Usage: foo [OPTION]... --foo1 useful option foo --bar1 useful option bar """ import sys if __name__ == "__main__": print(__doc__, file=sys.stderr)
14.538462
35
0.634921
25
189
4.32
0.8
0.222222
0
0
0
0
0
0
0
0
0
0.019868
0.201058
189
12
36
15.75
0.695364
0.544974
0
0
0
0
0.102564
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0.333333
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
d405f7dd65faac60af032a230c98dda41bbf84f2
90
py
Python
mkab/config.py
grplyler/mkab
03cf285cdf3266a2ec506f2af77836833afb4ad7
[ "MIT" ]
null
null
null
mkab/config.py
grplyler/mkab
03cf285cdf3266a2ec506f2af77836833afb4ad7
[ "MIT" ]
null
null
null
mkab/config.py
grplyler/mkab
03cf285cdf3266a2ec506f2af77836833afb4ad7
[ "MIT" ]
null
null
null
import os os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = os.path.expanduser('~/.key.json')
45
80
0.777778
12
90
5.666667
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.044444
90
2
80
45
0.790698
0
0
0
0
0
0.450549
0.32967
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
d40b8e92a4d02b55b198d5385e88d1cab31bc475
118
py
Python
vendor-local/src/basket-client/basket/__init__.py
satdav/mozillians
97d764f68d930275c1d722ba21c40ec2a963491d
[ "BSD-3-Clause" ]
null
null
null
vendor-local/src/basket-client/basket/__init__.py
satdav/mozillians
97d764f68d930275c1d722ba21c40ec2a963491d
[ "BSD-3-Clause" ]
null
null
null
vendor-local/src/basket-client/basket/__init__.py
satdav/mozillians
97d764f68d930275c1d722ba21c40ec2a963491d
[ "BSD-3-Clause" ]
null
null
null
from base import (send_sms, subscribe, unsubscribe, user, update_user, debug_user, BasketException)
39.333333
59
0.694915
13
118
6.076923
0.846154
0
0
0
0
0
0
0
0
0
0
0
0.237288
118
2
60
59
0.877778
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
d41f1abbb819598f4f3cc43931d666f578df1715
40
py
Python
Chapter 04/ch4_3_24.py
bpbpublications/TEST-YOUR-SKILLS-IN-PYTHON-LANGUAGE
f6a4194684515495d00aa38347a725dd08f39a0c
[ "MIT" ]
null
null
null
Chapter 04/ch4_3_24.py
bpbpublications/TEST-YOUR-SKILLS-IN-PYTHON-LANGUAGE
f6a4194684515495d00aa38347a725dd08f39a0c
[ "MIT" ]
null
null
null
Chapter 04/ch4_3_24.py
bpbpublications/TEST-YOUR-SKILLS-IN-PYTHON-LANGUAGE
f6a4194684515495d00aa38347a725dd08f39a0c
[ "MIT" ]
null
null
null
x=100 y=100 print(x is y) #True
6.666667
15
0.525
9
40
2.333333
0.666667
0
0
0
0
0
0
0
0
0
0
0.230769
0.35
40
5
16
8
0.576923
0.1
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0.333333
1
1
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
d4254ae59ad7d15f92b04d5c210221c2995f03d6
222
py
Python
main/permissions.py
sultanalieva-s/discrourse
0c263f233ff7ef05f1fb448e251029ba3803ffed
[ "MIT" ]
null
null
null
main/permissions.py
sultanalieva-s/discrourse
0c263f233ff7ef05f1fb448e251029ba3803ffed
[ "MIT" ]
null
null
null
main/permissions.py
sultanalieva-s/discrourse
0c263f233ff7ef05f1fb448e251029ba3803ffed
[ "MIT" ]
null
null
null
# from rest_framework.permissions import BasePermission # # # class IsOwner(BasePermission): # # def has_object_permission(self, req, view, obj): # return req.user.is_authenticated and req.user == obj.author #
24.666667
69
0.725225
27
222
5.814815
0.814815
0.089172
0
0
0
0
0
0
0
0
0
0
0.166667
222
8
70
27.75
0.848649
0.923423
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
d43386aff93ce5235ee331730640fabc8e97283c
150
py
Python
plugin/src/test/resources/refactoring/extractmethod/Comment2.before.py
consulo/consulo-python
586c3eaee3f9c2cc87fb088dc81fb12ffa4b3a9d
[ "Apache-2.0" ]
null
null
null
plugin/src/test/resources/refactoring/extractmethod/Comment2.before.py
consulo/consulo-python
586c3eaee3f9c2cc87fb088dc81fb12ffa4b3a9d
[ "Apache-2.0" ]
11
2017-02-27T22:35:32.000Z
2021-12-24T08:07:40.000Z
plugin/src/test/resources/refactoring/extractmethod/Comment2.before.py
consulo/consulo-python
586c3eaee3f9c2cc87fb088dc81fb12ffa4b3a9d
[ "Apache-2.0" ]
null
null
null
class Foo(): <selection>tmp = "!" #try to extract this assignmet, either with or without this comment</selection> def bar(self): pass
30
104
0.653333
20
150
4.9
0.9
0
0
0
0
0
0
0
0
0
0
0
0.233333
150
5
105
30
0.852174
0.52
0
0
0
0
0.013889
0
0
0
0
0
0
0
null
null
0.25
0
null
null
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
1
0
0
1
0
0
0
0
0
4
d43a2c083d0835bfc7e906dc0c2d788362d8305e
10,097
py
Python
tests/test_degrees.py
thierrydecker/siarnaq
76565903fa9caf8558d3dd0d6f564af6fd672ed5
[ "MIT" ]
null
null
null
tests/test_degrees.py
thierrydecker/siarnaq
76565903fa9caf8558d3dd0d6f564af6fd672ed5
[ "MIT" ]
null
null
null
tests/test_degrees.py
thierrydecker/siarnaq
76565903fa9caf8558d3dd0d6f564af6fd672ed5
[ "MIT" ]
null
null
null
"""Degrees tests module. Copyright (c) 2020 Thierry P.G. DECKER All Rights Reserved. Released under the MIT license """ import pytest from siarnaq.degrees import Degree def test_instanciations(): assert isinstance(Degree(), Degree) assert isinstance(Degree('ce'), Degree) assert isinstance(Degree('fa'), Degree) assert isinstance(Degree('ke'), Degree) assert isinstance(Degree('ra'), Degree) assert isinstance(Degree(temp=10), Degree) assert isinstance(Degree(scale='ce'), Degree) assert isinstance(Degree(scale='fa'), Degree) assert isinstance(Degree(scale='ke'), Degree) assert isinstance(Degree(scale='ra'), Degree) assert isinstance(Degree(scale='ce', temp=0), Degree) assert isinstance(Degree(scale='fa', temp=0), Degree) assert isinstance(Degree(scale='ke', temp=0), Degree) assert isinstance(Degree(scale='ra', temp=0), Degree) with pytest.raises(Exception): assert Degree(scale='Dummy') with pytest.raises(Exception): assert Degree(temp='Dummy') with pytest.raises(Exception): assert Degree(scale='Dummy', temp='Dummy') def test_static_methods(): assert round(Degree.conv_ce_to_fa(temp=0), 2) == 32.00 assert round(Degree.conv_ce_to_ke(temp=0), 2) == 273.15 assert round(Degree.conv_ce_to_ra(temp=0), 2) == 491.67 assert round(Degree.conv_fa_to_ce(temp=32), 2) == 0.00 assert round(Degree.conv_fa_to_ke(temp=32), 2) == 273.15 assert round(Degree.conv_fa_to_ra(temp=32), 2) == 491.67 assert round(Degree.conv_ke_to_ce(temp=0), 2) == -273.15 assert round(Degree.conv_ke_to_fa(temp=273.15), 2) == 32.00 assert round(Degree.conv_ke_to_ra(temp=100), 2) == 180 assert round(Degree.conv_ra_to_ce(temp=100), 2) == -217.59 assert round(Degree.conv_ra_to_fa(temp=100), 2) == -359.67 assert round(Degree.conv_ra_to_ke(temp=100), 2) == 55.56 def test_propertties_getters(): assert Degree().scales == {'ce', 'fa', 'ke', 'ra'} r = Degree(scale='ce', temp=0) assert r.scale == 'ce' assert round(r.temp, 2) == 0.00 assert round(r.celcius, 2) == 0.00 assert round(r.fahrenheit, 2) == 32.00 assert round(r.kelvin, 2) == 273.15 assert round(r.rankine, 2) == 491.67 r = Degree(scale='fa', temp=0) assert r.scale == 'fa' assert round(r.temp, 2) == 0.00 assert round(r.celcius, 2) == -17.78 assert round(r.fahrenheit, 2) == 0 assert round(r.kelvin, 2) == 255.37 assert round(r.rankine, 2) == 459.67 r = Degree(scale='ke', temp=0) assert r.scale == 'ke' assert round(r.temp, 2) == 0.00 assert round(r.celcius, 2) == -273.15 assert round(r.fahrenheit, 2) == -459.67 assert round(r.kelvin, 2) == 0 assert round(r.rankine, 2) == 0 r = Degree(scale='ra', temp=0) assert r.scale == 'ra' assert round(r.temp, 2) == 0.00 assert round(r.celcius, 2) == -273.15 assert round(r.fahrenheit, 2) == -459.67 assert round(r.kelvin, 2) == 0 assert round(r.rankine, 2) == 0 def test_propertties_setters(): # # From 'ce' to 'fa' # r = Degree(scale='ce', temp=0) r.scale = 'fa' assert round(r.temp, 2) == 32.00 assert round(r.celcius, 2) == 0 assert round(r.fahrenheit, 2) == 32.00 assert round(r.kelvin, 2) == 273.15 assert round(r.rankine, 2) == 491.67 # # From 'ce' to 'ke' # r = Degree(scale='ce', temp=0) r.scale = 'ke' assert round(r.temp, 2) == 273.15 assert round(r.celcius, 2) == 0.00 assert round(r.fahrenheit, 2) == 32.00 assert round(r.kelvin, 2) == 273.15 assert round(r.rankine, 2) == 491.67 # # From 'ce' to 'ra' # r = Degree(scale='ce', temp=0) r.scale = 'ra' assert round(r.temp, 2) == 491.67 assert round(r.celcius, 2) == 0.00 assert round(r.fahrenheit, 2) == 32.00 assert round(r.kelvin, 2) == 273.15 assert round(r.rankine, 2) == 491.67 # # From 'fa' to 'ce' # r = Degree(scale='fa', temp=0) r.scale = 'ce' assert round(r.temp, 2) == -17.78 assert round(r.celcius, 2) == -17.78 assert round(r.fahrenheit, 2) == 0.00 assert round(r.kelvin, 2) == 255.37 assert round(r.rankine, 2) == 459.67 # # From 'fa' to 'ke' # r = Degree(scale='fa', temp=0) r.scale = 'ke' assert round(r.temp, 2) == 255.37 assert round(r.celcius, 2) == -17.78 assert round(r.fahrenheit, 2) == 0.00 assert round(r.kelvin, 2) == 255.37 assert round(r.rankine, 2) == 459.67 # # From 'fa' to 'ra' # r = Degree(scale='fa', temp=0) r.scale = 'ra' assert round(r.temp, 2) == 459.67 assert round(r.celcius, 2) == -17.78 assert round(r.fahrenheit, 2) == 0.00 assert round(r.kelvin, 2) == 255.37 assert round(r.rankine, 2) == 459.67 # # From 'ke' to 'ce' # r = Degree(scale='ke', temp=0) r.scale = 'ce' assert round(r.temp, 2) == -273.15 assert round(r.celcius, 2) == -273.15 assert round(r.fahrenheit, 2) == -459.67 assert round(r.kelvin, 2) == 0.00 assert round(r.rankine, 2) == 0.00 # # From 'ke' to 'fa' # r = Degree(scale='ke', temp=0) r.scale = 'fa' assert round(r.temp, 2) == -459.67 assert round(r.celcius, 2) == -273.15 assert round(r.fahrenheit, 2) == -459.67 assert round(r.kelvin, 2) == 0.00 assert round(r.rankine, 2) == 0.00 # # From 'ke' to 'ra' # r = Degree(scale='ke', temp=0) r.scale = 'ra' assert round(r.temp, 2) == 0.00 assert round(r.celcius, 2) == -273.15 assert round(r.fahrenheit, 2) == -459.67 assert round(r.kelvin, 2) == 0.00 assert round(r.rankine, 2) == 0.00 # # From 'ra' to 'ce' # r = Degree(scale='ra', temp=0) r.scale = 'ce' assert round(r.temp, 2) == -273.15 assert round(r.celcius, 2) == -273.15 assert round(r.fahrenheit, 2) == -459.67 assert round(r.kelvin, 2) == 0.00 assert round(r.rankine, 2) == 0.00 # # From 'ra' to 'fa' # r = Degree(scale='ra', temp=0) r.scale = 'fa' assert round(r.temp, 2) == -459.67 assert round(r.celcius, 2) == -273.15 assert round(r.fahrenheit, 2) == -459.67 assert round(r.kelvin, 2) == 0.00 assert round(r.rankine, 2) == 0.00 # # From 'ra' to 'ke' # r = Degree(scale='ra', temp=0) r.scale = 'ke' assert round(r.temp, 2) == 0.00 assert round(r.celcius, 2) == -273.15 assert round(r.fahrenheit, 2) == -459.67 assert round(r.kelvin, 2) == 0.00 assert round(r.rankine, 2) == 0.00 with pytest.raises(Exception): r = Degree() r.scale = 'Dummy' def test_add(): r1 = Degree(scale='ce', temp=1.0) r2 = Degree(scale='ce', temp=20.0) r = r1 + r2 assert r.scale == 'ce' assert r.temp == 21.00 r1 = Degree(scale='fa', temp=1.0) r2 = Degree(scale='fa', temp=2.0) r = r1 + r2 assert r.scale == 'fa' assert r.temp == 3.00 r1 = Degree(scale='fa', temp=1.0) r = r1 + 2.00 assert r.scale == 'fa' assert r.temp == 3.00 r1 = Degree(scale='ke', temp=1.0) r = 2.00 + r1 assert r.scale == 'ke' assert r.temp == 3.00 r1 = Degree(scale='ce', temp=1.0) r2 = Degree(scale='ce', temp=1.0) r1 += r2 assert r1.scale == 'ce' assert r1.temp == 2.00 r1 = Degree(scale='ce', temp=0.0) r2 = Degree(scale='ke', temp=0.0) r1 += r2 assert r1.scale == 'ce' assert r1.temp == -273.15 r1 = Degree(scale='ra', temp=0.0) r2 = Degree(scale='ke', temp=0.0) r1 += r2 assert r1.scale == 'ra' assert r1.temp == 0.00 r1 = Degree(scale='ke', temp=0.0) r2 = Degree(scale='ra', temp=0.0) r1 += r2 assert r1.scale == 'ke' assert r1.temp == 0.00 def test_sub(): r1 = Degree(scale='ce', temp=1.0) r2 = Degree(scale='ce', temp=2.0) r = r1 - r2 assert r.scale == 'ce' assert r.temp == -1.00 r1 = Degree(scale='fa', temp=1.0) r = r1 - 2.00 assert r.scale == 'fa' assert r.temp == -1.00 r1 = Degree(scale='ce', temp=1.0) r2 = Degree(scale='ce', temp=1.0) r1 -= r2 assert r1.scale == 'ce' assert r1.temp == 0.00 r1 = Degree(scale='fa', temp=0.0) r2 = Degree(scale='ce', temp=0.0) r1 = r1 - r2 assert r1.scale == 'fa' assert r1.temp == -32.00 r1 = Degree(scale='ke', temp=0.0) r2 = Degree(scale='ra', temp=0.0) r1 = r1 - r2 assert r1.scale == 'ke' assert r1.temp == 0.00 r1 = Degree(scale='ra', temp=0.0) r2 = Degree(scale='ke', temp=0.0) r1 = r1 - r2 assert r1.scale == 'ra' assert r1.temp == 0.00 def test_mul(): r1 = Degree(scale='ce', temp=2.0) r = r1 * 10 assert r.scale == 'ce' assert r.temp == 20.00 r1 = Degree(scale='fa', temp=2.0) r = 20 * r1 assert r.scale == 'fa' assert r.temp == 40.00 r1 = Degree(scale='ke', temp=2.0) r = 20 * r1 assert r.scale == 'ke' assert r.temp == 40.00 r1 = Degree(scale='ra', temp=20.0) r = r1 * 2 assert r.scale == 'ra' assert r.temp == 40.00 def test_div(): r1 = Degree(scale='ce', temp=2.0) r = r1 / 10 assert r.scale == 'ce' assert r.temp == 0.20 r1 = Degree(scale='fa', temp=10.0) r = r1 / 10 assert r.scale == 'fa' assert r.temp == 1.0 r1 = Degree(scale='ke', temp=5.0) r = r1 / 2 assert r.scale == 'ke' assert r.temp == 2.5 r1 = Degree(scale='ra', temp=10.0) r = r1 / 2 assert r.scale == 'ra' assert r.temp == 5.0 def test_str(): r = Degree('ce') assert str(r) == '0.0 °C' r.scale = 'fa' r.temp = 0 assert str(r) == '0.0 °F' r.scale = 'ke' r.temp = 0 assert str(r) == '0.0 K' r.scale = 'ra' r.temp = 0 assert str(r) == '0.0 °Ra' def test_repr(): r = Degree('ce') assert repr(r) == 'Degree(\'ce\', 0.0)' r.scale = 'fa' r.temp = 0 assert repr(r) == 'Degree(\'fa\', 0.0)' r.scale = 'ke' r.temp = 0 assert repr(r) == 'Degree(\'ke\', 0.0)' r.scale = 'ra' r.temp = 0 assert repr(r) == 'Degree(\'ra\', 0.0)'
26.501312
63
0.560166
1,670
10,097
3.359281
0.053892
0.180392
0.171123
0.057398
0.888235
0.842781
0.757754
0.66328
0.583244
0.550267
0
0.104369
0.254135
10,097
380
64
26.571053
0.640154
0.032683
0
0.679715
0
0
0.033628
0
0
0
0
0
0.590747
1
0.035587
false
0
0.007117
0
0.042705
0
0
0
0
null
0
0
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
4
d43ee82b05f02e927a3a4474fda4f7ce3ab614f8
213
py
Python
dashboard/core/forms.py
hebergui/webtrade
338fbf334b6ba173296635b380b53b088a87bb95
[ "Apache-2.0" ]
null
null
null
dashboard/core/forms.py
hebergui/webtrade
338fbf334b6ba173296635b380b53b088a87bb95
[ "Apache-2.0" ]
null
null
null
dashboard/core/forms.py
hebergui/webtrade
338fbf334b6ba173296635b380b53b088a87bb95
[ "Apache-2.0" ]
null
null
null
from django import forms from .models import Employee class EmployeeForm(forms.ModelForm): class Meta: model = Employee fields = ('name', 'position', 'office', 'age', 'start_date', 'salary')
23.666667
78
0.661972
24
213
5.833333
0.791667
0
0
0
0
0
0
0
0
0
0
0
0.211268
213
8
79
26.625
0.833333
0
0
0
0
0
0.173709
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
d441d23e5f52dc32799994ca9d64e8d91afc7c68
77
py
Python
day09/shetuproject/shetuproject/spiders/start.py
Mhh123/spider
fe4410f9f3b4a9c0a5dac51bd93a1434aaa4f888
[ "Apache-2.0" ]
null
null
null
day09/shetuproject/shetuproject/spiders/start.py
Mhh123/spider
fe4410f9f3b4a9c0a5dac51bd93a1434aaa4f888
[ "Apache-2.0" ]
null
null
null
day09/shetuproject/shetuproject/spiders/start.py
Mhh123/spider
fe4410f9f3b4a9c0a5dac51bd93a1434aaa4f888
[ "Apache-2.0" ]
null
null
null
from scrapy import cmdline cmdline.execute(['scrapy', 'crawl', 'image'])
19.25
46
0.688312
9
77
5.888889
0.777778
0
0
0
0
0
0
0
0
0
0
0
0.142857
77
3
47
25.666667
0.80303
0
0
0
0
0
0.216216
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
2e381cd28caddae33317e9296bd2e3e4240ac5fe
349
py
Python
crc/scripts/failing_script.py
sartography/cr-connect-workflow
e0d1f63c082e9f4e6e3593c45d615afe04f42729
[ "MIT" ]
2
2019-12-02T12:39:21.000Z
2022-01-10T23:31:36.000Z
crc/scripts/failing_script.py
sartography/cr-connect-workflow
e0d1f63c082e9f4e6e3593c45d615afe04f42729
[ "MIT" ]
341
2019-12-11T15:23:59.000Z
2022-03-22T19:36:37.000Z
crc/scripts/failing_script.py
sartography/cr-connect-workflow
e0d1f63c082e9f4e6e3593c45d615afe04f42729
[ "MIT" ]
4
2021-03-23T19:17:14.000Z
2022-03-10T03:12:10.000Z
from crc.scripts.script import Script from crc.services.failing_service import FailingService class FailingScript(Script): def get_description(self): return """It fails""" def do_task_validate_only(self, task, *args, **kwargs): pass def do_task(self, task, *args, **kwargs): FailingService.fail_as_service()
23.266667
59
0.69914
44
349
5.363636
0.613636
0.059322
0.076271
0.152542
0
0
0
0
0
0
0
0
0.194842
349
15
60
23.266667
0.839858
0
0
0
0
0
0.022857
0
0
0
0
0
0
1
0.333333
false
0.111111
0.222222
0.111111
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
1
0
1
1
0
0
4
2e40a1ec3e882d092e13ab169f9dcd4a55ceeed4
127
py
Python
src/common/lie/numpy/__init__.py
yewzijian/MultiReg
8411e3b8d878454c4db06c53025d0dd4e5efdeb3
[ "MIT" ]
3
2021-10-15T11:22:28.000Z
2022-02-21T08:32:44.000Z
src/common/lie/torch/__init__.py
yewzijian/MultiReg
8411e3b8d878454c4db06c53025d0dd4e5efdeb3
[ "MIT" ]
null
null
null
src/common/lie/torch/__init__.py
yewzijian/MultiReg
8411e3b8d878454c4db06c53025d0dd4e5efdeb3
[ "MIT" ]
null
null
null
from .liegroupbase import LieGroupBase from .so3 import SO3 from .so3q import SO3q from .se3 import SE3 from .se3q import SE3q
21.166667
38
0.80315
20
127
5.1
0.35
0
0
0
0
0
0
0
0
0
0
0.074766
0.15748
127
5
39
25.4
0.878505
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
2e48088ffef98ecd0d36062b04f4ea99b44add38
222
py
Python
src/lib/interfaces/iqueueprocessor.py
itsmylin/wechat-robinhood
00986ff432c372f23e4e48adf3ba7b685d28f919
[ "MIT" ]
13
2017-05-04T13:55:38.000Z
2020-07-23T09:11:25.000Z
src/lib/interfaces/iqueueprocessor.py
itsmylin/wechat-robinhood
00986ff432c372f23e4e48adf3ba7b685d28f919
[ "MIT" ]
1
2018-12-06T14:07:48.000Z
2018-12-06T23:00:42.000Z
src/lib/interfaces/iqueueprocessor.py
itsmylin/wechat-robinhood
00986ff432c372f23e4e48adf3ba7b685d28f919
[ "MIT" ]
5
2018-07-24T07:34:02.000Z
2019-10-24T21:30:51.000Z
# Define an interface for possible future implementations of queue processors for other messenger platforms class IQueueProcessor(object): def process_message(self, message): raise Exception('Not implemented')
44.4
107
0.788288
26
222
6.692308
0.923077
0
0
0
0
0
0
0
0
0
0
0
0.157658
222
4
108
55.5
0.930481
0.472973
0
0
0
0
0.130435
0
0
0
0
0
0
1
0.333333
false
0
0
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
2e740e48125a491592744aacf7845c6841158351
14,928
py
Python
tests/ut/test_edge_volumes.py
CTERA-Networks/ctera-python-sdk
35d9cb6949590e664fd237d29f54ce054fe80a9e
[ "Apache-2.0" ]
5
2020-02-25T22:34:48.000Z
2020-02-29T22:56:39.000Z
tests/ut/test_edge_volumes.py
ctera/ctera-python-sdk
a86cb575d538620a12f326fe5e92f5abb5cc1f6b
[ "Apache-2.0" ]
16
2020-03-25T19:12:03.000Z
2021-06-02T14:45:34.000Z
tests/ut/test_edge_volumes.py
ctera/ctera-python-sdk
a86cb575d538620a12f326fe5e92f5abb5cc1f6b
[ "Apache-2.0" ]
3
2020-10-22T18:22:06.000Z
2021-10-03T18:38:41.000Z
from unittest import mock from cterasdk import exception from cterasdk.common import Object from cterasdk.edge.enum import VolumeStatus from cterasdk.edge import volumes from tests.ut import base_edge class TestEdgeVolumes(base_edge.BaseEdgeTest): _drive_1 = 'SATA-1' _drive_2 = 'SATA-2' _drive_size = 81920 _mount_task_1 = (1, 'Task 1') _mount_task_2 = (2, 'Task 2') def setUp(self): super().setUp() self._volume_1_name = 'localcache' self._volume_2_name = 'logs' self._volumes = [self._volume_1_name, self._volume_2_name] self._volume_passphrase = 'password' self._mount_id = 'task id' def test_get_all_volumes(self): get_response = 'Success' self._init_filer(get_response=get_response) ret = volumes.Volumes(self._filer).get() self._filer.get.assert_called_once_with('/config/storage/volumes') self.assertEqual(ret, get_response) def test_get_volume(self): get_response = 'Success' self._init_filer(get_response=get_response) ret = volumes.Volumes(self._filer).get(self._volume_1_name) self._filer.get.assert_called_once_with('/config/storage/volumes/' + self._volume_1_name) self.assertEqual(ret, get_response) def test_add_volume_default_args_single_device_success(self): add_response = 'Success' self._init_filer(add_response=add_response) self._filer.get = mock.MagicMock(side_effect=TestEdgeVolumes._mock_no_arrays_single_drive) track_volume_creation_status_mock = self.patch_call("cterasdk.edge.volumes.track") ret = volumes.Volumes(self._filer).add(self._volume_1_name) self._filer.get.assert_has_calls( [ mock.call('/status/storage/arrays'), mock.call('/status/storage/disks') ] ) track_volume_creation_status_mock.assert_called_once_with(self._filer, '/status/storage/volumes/' + self._volume_1_name + '/status', [VolumeStatus.Ok], [VolumeStatus.Formatting], [VolumeStatus.Mounting, VolumeStatus.Checking, VolumeStatus.Repairing], [VolumeStatus.Corrupted, VolumeStatus.Unknown]) self._filer.add.assert_called_once_with('/config/storage/volumes', mock.ANY) expected_param = self._get_add_volume_param(device=TestEdgeVolumes._drive_1, size=TestEdgeVolumes._drive_size) actual_param = self._filer.add.call_args[0][1] self._assert_equal_objects(actual_param, expected_param) self.assertEqual(ret, add_response) def test_add_encrypted_volume_default_args_single_device_success(self): add_response = 'Success' self._init_filer(add_response=add_response) self._filer.get = mock.MagicMock(side_effect=TestEdgeVolumes._mock_no_arrays_single_drive) track_volume_creation_status_mock = self.patch_call("cterasdk.edge.volumes.track") ret = volumes.Volumes(self._filer).add(self._volume_1_name, passphrase=self._volume_passphrase) self._filer.get.assert_has_calls( [ mock.call('/status/storage/arrays'), mock.call('/status/storage/disks') ] ) track_volume_creation_status_mock.assert_called_once_with(self._filer, '/status/storage/volumes/' + self._volume_1_name + '/status', [VolumeStatus.Ok], [VolumeStatus.Formatting], [VolumeStatus.Mounting, VolumeStatus.Checking, VolumeStatus.Repairing], [VolumeStatus.Corrupted, VolumeStatus.Unknown]) self._filer.add.assert_called_once_with('/config/storage/volumes', mock.ANY) expected_param = self._get_add_volume_param(device=TestEdgeVolumes._drive_1, size=TestEdgeVolumes._drive_size, passphrase=self._volume_passphrase) actual_param = self._filer.add.call_args[0][1] self._assert_equal_objects(actual_param, expected_param) self.assertEqual(ret, add_response) def test_add_volume_no_devices(self): self._init_filer() self._filer.get = mock.MagicMock(side_effect=TestEdgeVolumes._mock_no_devices) with self.assertRaises(exception.CTERAException) as error: volumes.Volumes(self._filer).add(self._volume_1_name) self._filer.get.assert_has_calls( [ mock.call('/status/storage/arrays'), mock.call('/status/storage/disks') ] ) self.assertEqual('Could not find any drives or arrays', error.exception.message) def test_add_volume_invalid_device_name(self): self._init_filer() self._filer.get = mock.MagicMock(side_effect=TestEdgeVolumes._mock_no_arrays_multiple_drive) with self.assertRaises(exception.InputError) as error: volumes.Volumes(self._filer).add(self._volume_1_name, device='Invalid device name') self._filer.get.assert_has_calls( [ mock.call('/status/storage/arrays'), mock.call('/status/storage/disks') ] ) self.assertEqual('Invalid device name', error.exception.message) def test_add_volume_must_specify_device_name(self): self._init_filer() self._filer.get = mock.MagicMock(side_effect=TestEdgeVolumes._mock_no_arrays_multiple_drive) with self.assertRaises(exception.CTERAException) as error: volumes.Volumes(self._filer).add(self._volume_1_name) self._filer.get.assert_has_calls( [ mock.call('/status/storage/arrays'), mock.call('/status/storage/disks') ] ) self.assertEqual('You must specify a drive or an array name', error.exception.message) def test_add_volume_with_device_success(self): add_response = 'Success' self._init_filer(add_response=add_response) self._filer.get = mock.MagicMock(side_effect=TestEdgeVolumes._mock_no_arrays_multiple_drive) track_volume_creation_status_mock = self.patch_call("cterasdk.edge.volumes.track") ret = volumes.Volumes(self._filer).add(self._volume_1_name, device=TestEdgeVolumes._drive_1) self._filer.get.assert_has_calls( [ mock.call('/status/storage/arrays'), mock.call('/status/storage/disks') ] ) track_volume_creation_status_mock.assert_called_once_with(self._filer, '/status/storage/volumes/' + self._volume_1_name + '/status', [VolumeStatus.Ok], [VolumeStatus.Formatting], [VolumeStatus.Mounting, VolumeStatus.Checking, VolumeStatus.Repairing], [VolumeStatus.Corrupted, VolumeStatus.Unknown]) self._filer.add.assert_called_once_with('/config/storage/volumes', mock.ANY) expected_param = self._get_add_volume_param(device=TestEdgeVolumes._drive_1, size=TestEdgeVolumes._drive_size) actual_param = self._filer.add.call_args[0][1] self._assert_equal_objects(actual_param, expected_param) self.assertEqual(ret, add_response) def test_add_volume_exceeding_drive_size(self): self._init_filer() self._filer.get = mock.MagicMock(side_effect=TestEdgeVolumes._mock_no_arrays_single_drive) with self.assertRaises(exception.InputError) as error: volumes.Volumes(self._filer).add(self._volume_1_name, size=999999999) self._filer.get.assert_has_calls( [ mock.call('/status/storage/arrays'), mock.call('/status/storage/disks') ] ) self.assertEqual('You cannot exceed the available storage capacity', error.exception.message) def test_delete_volume_success(self): delete_response = 'Success' self._init_filer(delete_response=delete_response) self._filer.tasks.by_name = mock.MagicMock(return_value=[TestEdgeVolumes._get_pending_mount_task(self._mount_id)]) self._filer.tasks.wait = mock.MagicMock() ret = volumes.Volumes(self._filer).delete(self._volume_1_name) self._filer.tasks.by_name.assert_called_once_with(' '.join(['Mounting', self._volume_1_name, 'file system'])) self._filer.tasks.wait.assert_called_once_with(self._mount_id) self._filer.delete.assert_called_once_with('/config/storage/volumes/' + self._volume_1_name) self.assertEqual(ret, delete_response) def test_delete_volume_raise(self): self._init_filer() self._filer.delete = mock.MagicMock(side_effect=exception.CTERAException()) self._filer.tasks.by_name = mock.MagicMock(return_value=[]) with self.assertRaises(exception.CTERAException) as error: volumes.Volumes(self._filer).delete(self._volume_1_name) self._filer.tasks.by_name.assert_called_once_with(' '.join(['Mounting', self._volume_1_name, 'file system'])) self._filer.delete.assert_called_once_with('/config/storage/volumes/' + self._volume_1_name) self.assertEqual('Volume deletion falied', error.exception.message) def test_delete_all_volume_success(self): delete_response = 'Success' self._init_filer(get_response=self._get_volumes_response_param(), delete_response=delete_response) self._filer.tasks.running = mock.MagicMock(return_value=TestEdgeVolumes._get_pending_mount_tasks()) self._filer.tasks.by_name = mock.MagicMock() self._filer.tasks.wait = mock.MagicMock() volumes.Volumes(self._filer).delete_all() self._filer.get.assert_called_once_with('/config/storage/volumes') self._filer.tasks.running.assert_called_once() self._filer.delete.assert_has_calls( [ mock.call('/config/storage/volumes/' + self._volume_1_name), mock.call('/config/storage/volumes/' + self._volume_2_name) ] ) def test_modify_volume_success(self): before_volume_size = 1000 after_volume_size = 9999 put_response = 'Success' self._init_filer(get_response=TestEdgeVolumes._get_volume_response(self._volume_1_name, before_volume_size), put_response=put_response) ret = volumes.Volumes(self._filer).modify(self._volume_1_name, 9999) self._filer.get.assert_called_once_with('/config/storage/volumes/' + self._volume_1_name) self._filer.put.assert_called_once_with('/config/storage/volumes/' + self._volume_1_name, mock.ANY) expected_param = TestEdgeVolumes._get_volume_response(self._volume_1_name, after_volume_size) actual_param = self._filer.put.call_args[0][1] self._assert_equal_objects(actual_param, expected_param) self.assertEqual(ret, put_response) def test_modify_volume_not_found(self): self._init_filer() self._filer.get = mock.MagicMock(side_effect=exception.CTERAException()) with self.assertRaises(exception.CTERAException) as error: volumes.Volumes(self._filer).modify(self._volume_1_name, 9999) self._filer.get.assert_called_once_with('/config/storage/volumes/' + self._volume_1_name) self.assertEqual('Failed to get the volume', error.exception.message) @staticmethod def _get_volume_response(name, size): param = Object() param.name = name param.size = size return param def _get_volumes_response_param(self): storage_volumes = [] for volume_name in self._volumes: param = Object() param.name = volume_name storage_volumes.append(param) return storage_volumes def test_delete_no_volumes_found(self): self._init_filer(get_response=[]) self._filer.tasks.running = mock.MagicMock(return_value=[]) volumes.Volumes(self._filer).delete_all() self._filer.get.assert_called_once_with('/config/storage/volumes') @staticmethod def _get_pending_mount_tasks(): mount_id, task_name = TestEdgeVolumes._mount_task_1 task_1 = TestEdgeVolumes._get_pending_mount_task(mount_id, task_name) mount_id, task_name = TestEdgeVolumes._mount_task_2 task_2 = TestEdgeVolumes._get_pending_mount_task(mount_id, task_name) return [task_1, task_2] @staticmethod def _get_pending_mount_task(mount_id=None, name=None): param = Object() if mount_id: param.id = mount_id if name: param.name = name return param @staticmethod def _get_drive(name, capacity): param = Object() param.name = name param.availableCapacity = capacity return param def _get_add_volume_param(self, device=None, size=None, passphrase=None): param = Object() param.name = self._volume_1_name if device: param.device = device if size: param.size = size param.fileSystemType = 'xfs' if passphrase: param.encrypted = True param.encPassphrase = passphrase return param @staticmethod def _mock_no_devices(path): if path == '/status/storage/arrays': return [] if path == '/status/storage/disks': return [] return None @staticmethod def _mock_no_arrays_single_drive(path): if path == '/status/storage/arrays': return [] if path == '/status/storage/disks': return [TestEdgeVolumes._get_drive(TestEdgeVolumes._drive_1, TestEdgeVolumes._drive_size)] return None @staticmethod def _mock_no_arrays_multiple_drive(path): if path == '/status/storage/arrays': return [] if path == '/status/storage/disks': return [TestEdgeVolumes._get_drive(TestEdgeVolumes._drive_1, TestEdgeVolumes._drive_size), TestEdgeVolumes._get_drive(TestEdgeVolumes._drive_2, TestEdgeVolumes._drive_size)] return None
48.625407
137
0.639871
1,671
14,928
5.33453
0.087971
0.062598
0.035786
0.0488
0.804801
0.777878
0.736258
0.690038
0.657505
0.613305
0
0.008483
0.265608
14,928
306
138
48.784314
0.804616
0
0
0.501805
0
0
0.086683
0.06116
0
0
0
0
0.180505
1
0.090253
false
0.021661
0.021661
0
0.187726
0
0
0
0
null
0
0
0
1
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
2e82f5c076ccaa77279e9b47ec06f2c2e60ac84b
23,738
py
Python
mmtbx/regression/tst_sequence_validation.py
jbeilstenedmands/cctbx_project
c228fb15ab10377f664c39553d866281358195aa
[ "BSD-3-Clause-LBNL" ]
null
null
null
mmtbx/regression/tst_sequence_validation.py
jbeilstenedmands/cctbx_project
c228fb15ab10377f664c39553d866281358195aa
[ "BSD-3-Clause-LBNL" ]
null
null
null
mmtbx/regression/tst_sequence_validation.py
jbeilstenedmands/cctbx_project
c228fb15ab10377f664c39553d866281358195aa
[ "BSD-3-Clause-LBNL" ]
null
null
null
from __future__ import division from libtbx import easy_mp from libtbx import easy_pickle from libtbx.utils import Sorry, null_out import os def exercise () : import libtbx.utils if (libtbx.utils.detect_multiprocessing_problem() is not None) : print "multiprocessing not available, skipping this test" return if (os.name == "nt"): print "easy_mp fixed_func not supported under Windows, skipping this test" return from mmtbx.validation.sequence import validation, get_sequence_n_copies, \ get_sequence_n_copies_from_files import iotbx.bioinformatics import iotbx.pdb from iotbx import file_reader import libtbx.load_env # import dependency from libtbx.test_utils import Exception_expected, contains_lines, approx_equal from cStringIO import StringIO pdb_in = iotbx.pdb.input(source_info=None, lines="""\ ATOM 2 CA ARG A 10 -6.299 36.344 7.806 1.00 55.20 C ATOM 25 CA TYR A 11 -3.391 33.962 7.211 1.00 40.56 C ATOM 46 CA ALA A 12 -0.693 34.802 4.693 1.00 67.95 C ATOM 56 CA ALA A 13 0.811 31.422 3.858 1.00 57.97 C ATOM 66 CA GLY A 14 4.466 31.094 2.905 1.00 49.24 C ATOM 73 CA ALA A 15 7.163 28.421 2.671 1.00 54.70 C ATOM 83 CA ILE A 16 6.554 24.685 2.957 1.00 51.79 C ATOM 102 CA LEU A 17 7.691 23.612 6.406 1.00 42.30 C ATOM 121 CA PTY A 18 7.292 19.882 5.861 1.00 36.68 C ATOM 128 CA PHE A 19 5.417 16.968 4.327 1.00 44.99 C ATOM 148 CA GLY A 20 3.466 14.289 6.150 1.00 41.99 C ATOM 155 CA GLY A 21 1.756 11.130 4.965 1.00 35.77 C ATOM 190 CA ALA A 24 1.294 19.658 3.683 1.00 47.02 C ATOM 200 CA VAL A 24A 2.361 22.009 6.464 1.00 37.13 C ATOM 216 CA HIS A 25 2.980 25.633 5.535 1.00 42.52 C ATOM 234 CA LEU A 26 4.518 28.425 7.577 1.00 47.63 C ATOM 253 CA ALA A 27 2.095 31.320 7.634 1.00 38.61 C ATOM 263 CA ARG A 28 1.589 34.719 9.165 1.00 37.04 C END""") seq1 = iotbx.bioinformatics.sequence("MTTPSHLSDRYELGEILGFGGMSEVHLARD".lower()) v = validation( pdb_hierarchy=pdb_in.construct_hierarchy(), sequences=[seq1], log=null_out(), nproc=1) out = StringIO() v.show(out=out) assert contains_lines(out.getvalue(), """\ sequence identity: 76.47% 13 residue(s) missing from PDB chain (9 at start, 1 at end) 2 gap(s) in chain 4 mismatches to sequence residue IDs: 12 13 15 24""") cif_block = v.as_cif_block() assert list(cif_block['_struct_ref.pdbx_seq_one_letter_code']) == [ 'MTTPSHLSDRYELGEILGFGGMSEVHLARD'] assert approx_equal(cif_block['_struct_ref_seq.pdbx_auth_seq_align_beg'], ['10', '14', '16', '19', '24']) assert approx_equal(cif_block['_struct_ref_seq.pdbx_auth_seq_align_end'], ['11', '14', '17', '21', '28']) assert approx_equal(cif_block['_struct_ref_seq.db_align_beg'], ['10', '14', '16', '19', '25']) assert approx_equal(cif_block['_struct_ref_seq.db_align_end'], ['11', '14', '17', '21', '29']) assert cif_block['_struct_ref_seq.pdbx_seq_align_beg_ins_code'][4] == 'A' seq2 = iotbx.bioinformatics.sequence("MTTPSHLSDRYELGEILGFGGMSEVHLA") v = validation( pdb_hierarchy=pdb_in.construct_hierarchy(), sequences=[seq2], log=null_out(), nproc=1) out = StringIO() v.show(out=out) assert contains_lines(out.getvalue(), """\ 1 residues not found in sequence residue IDs: 28""") try : v = validation( pdb_hierarchy=pdb_in.construct_hierarchy(), sequences=[], log=null_out(), nproc=1) except AssertionError : pass else : raise Exception_expected cif_block = v.as_cif_block() assert list(cif_block['_struct_ref.pdbx_seq_one_letter_code']) == [ 'MTTPSHLSDRYELGEILGFGGMSEVHLA-'] assert approx_equal(cif_block['_struct_ref_seq.pdbx_auth_seq_align_end'], ['11', '14', '17', '21', '27']) assert approx_equal(cif_block['_struct_ref_seq.db_align_end'], ['11', '14', '17', '21', '28']) # pdb_in2 = iotbx.pdb.input(source_info=None, lines="""\ ATOM 2 CA ARG A 10 -6.299 36.344 7.806 1.00 55.20 C ATOM 25 CA TYR A 11 -3.391 33.962 7.211 1.00 40.56 C ATOM 46 CA ALA A 12 -0.693 34.802 4.693 1.00 67.95 C ATOM 56 CA ALA A 13 0.811 31.422 3.858 1.00 57.97 C ATOM 66 CA GLY A 14 4.466 31.094 2.905 1.00 49.24 C ATOM 73 CA ALA A 15 7.163 28.421 2.671 1.00 54.70 C ATOM 83 CA ILE A 16 6.554 24.685 2.957 1.00 51.79 C ATOM 102 CA LEU A 17 7.691 23.612 6.406 1.00 42.30 C TER ATOM 1936 P G B 2 -22.947 -23.615 15.323 1.00123.20 P ATOM 1959 P C B 3 -26.398 -26.111 19.062 1.00110.06 P ATOM 1979 P U B 4 -29.512 -30.638 21.164 1.00101.06 P ATOM 1999 P C B 5 -30.524 -36.109 21.527 1.00 92.76 P ATOM 2019 P U B 6 -28.684 -41.458 21.223 1.00 87.42 P ATOM 2062 P G B 8 -18.396 -45.415 21.903 1.00 80.35 P ATOM 2085 P A B 9 -13.852 -43.272 24.156 1.00 77.76 P ATOM 2107 P G B 10 -8.285 -44.242 26.815 1.00 79.86 P END """) seq3 = iotbx.bioinformatics.sequence("AGCUUUGGAG") v = validation( pdb_hierarchy=pdb_in2.construct_hierarchy(), sequences=[seq2,seq3], log=null_out(), nproc=1, extract_coordinates=True) out = StringIO() v.show(out=out) cif_block = v.as_cif_block() assert approx_equal(cif_block['_struct_ref.pdbx_seq_one_letter_code'], ['MTTPSHLSDRYELGEILGFGGMSEVHLA', 'AGCUUUGGAG']) assert approx_equal(cif_block['_struct_ref_seq.pdbx_auth_seq_align_beg'], ['10', '14', '16', '2', '6', '8']) assert approx_equal(cif_block['_struct_ref_seq.pdbx_auth_seq_align_end'], ['11', '14', '17', '4', '6', '10']) assert (len(v.chains[0].get_outliers_table()) == 3) assert (len(v.get_table_data()) == 4) assert approx_equal( v.chains[0].get_mean_coordinate_for_alignment_range(11,11), (-0.693, 34.802, 4.693)) assert approx_equal( v.chains[0].get_mean_coordinate_for_alignment_range(11,14), (2.93675, 31.43475, 3.53175)) assert (v.chains[0].get_highlighted_residues() == [11,12,14]) assert contains_lines(out.getvalue(), """\ 3 mismatches to sequence residue IDs: 12 13 15""") assert contains_lines(out.getvalue(), """\ sequence identity: 87.50% 2 residue(s) missing from PDB chain (1 at start, 0 at end) 1 gap(s) in chain 1 mismatches to sequence residue IDs: 5""") s = easy_pickle.dumps(v) seq4 = iotbx.bioinformatics.sequence("") try : v = validation( pdb_hierarchy=pdb_in2.construct_hierarchy(), sequences=[seq4], log=null_out(), nproc=1, extract_coordinates=True) except AssertionError : pass else : raise Exception_expected # check that nucleic acid chain doesn't get aligned against protein sequence pdb_in = iotbx.pdb.input(source_info=None, lines="""\ ATOM 18932 P B DG D 1 -12.183 60.531 25.090 0.50364.79 P ATOM 18963 P B DG D 2 -9.738 55.258 20.689 0.50278.77 P ATOM 18994 P B DA D 3 -10.119 47.855 19.481 0.50355.17 P ATOM 19025 P B DT D 4 -13.664 42.707 21.119 0.50237.06 P ATOM 19056 P B DG D 5 -19.510 39.821 21.770 0.50255.45 P ATOM 19088 P B DA D 6 -26.096 40.001 21.038 0.50437.49 P ATOM 19120 P B DC D 7 -31.790 41.189 18.413 0.50210.00 P ATOM 19149 P B DG D 8 -34.639 41.306 12.582 0.50313.99 P ATOM 19179 P B DA D 9 -34.987 38.244 6.813 0.50158.92 P ATOM 19210 P B DT D 10 -32.560 35.160 1.082 0.50181.38 P HETATM19241 P BTSP D 11 -27.614 30.137 0.455 0.50508.17 P """) sequences, _ = iotbx.bioinformatics.fasta_sequence_parse.parse( """>4GFH:A|PDBID|CHAIN|SEQUENCE MSTEPVSASDKYQKISQLEHILKRPDTYIGSVETQEQLQWIYDEETDCMIEKNVTIVPGLFKIFDEILVNAADNKVRDPS MKRIDVNIHAEEHTIEVKNDGKGIPIEIHNKENIYIPEMIFGHLLTSSNYDDDEKKVTGGRNGYGAKLCNIFSTEFILET ADLNVGQKYVQKWENNMSICHPPKITSYKKGPSYTKVTFKPDLTRFGMKELDNDILGVMRRRVYDINGSVRDINVYLNGK SLKIRNFKNYVELYLKSLEKKRQLDNGEDGAAKSDIPTILYERINNRWEVAFAVSDISFQQISFVNSIATTMGGTHVNYI TDQIVKKISEILKKKKKKSVKSFQIKNNMFIFINCLIENPAFTSQTKEQLTTRVKDFGSRCEIPLEYINKIMKTDLATRM FEIADANEENALKKSDGTRKSRITNYPKLEDANKAGTKEGYKCTLVLTEGDSALSLAVAGLAVVGRDYYGCYPLRGKMLN VREASADQILKNAEIQAIKKIMGLQHRKKYEDTKSLRYGHLMIMTDQDHDGSHIKGLIINFLESSFPGLLDIQGFLLEFI TPIIKVSITKPTKNTIAFYNMPDYEKWREEESHKFTWKQKYYKGLGTSLAQEVREYFSNLDRHLKIFHSLQGNDKDYIDL AFSKKKADDRKEWLRQYEPGTVLDPTLKEIPISDFINKELILFSLADNIRSIPNVLDGFKPGQRKVLYGCFKKNLKSELK VAQLAPYVSECTAYHHGEQSLAQTIIGLAQNFVGSNNIYLLLPNGAFGTRATGGKDAAAARYIYTELNKLTRKIFHPADD PLYKYIQEDEKTVEPEWYLPILPMILVNGAEGIGTGWSTYIPPFNPLEIIKNIRHLMNDEELEQMHPWFRGWTGTIEEIE PLRYRMYGRIEQIGDNVLEITELPARTWTSTIKEYLLLGLSGNDKIKPWIKDMEEQHDDNIKFIITLSPEEMAKTRKIGF YERFKLISPISLMNMVAFDPHGKIKKYNSVNEILSEFYYVRLEYYQKRKDHMSERLQWEVEKYSFQVKFIKMIIEKELTV TNKPRNAIIQELENLGFPRFNKEGKPYYGSPNDEIAEQINDVKGATSDEEDEESSHEDTENVINGPEELYGTYEYLLGMR IWSLTKERYQKLLKQKQEKETELENLLKLSAKDIWNTDLKAFEVGYQEFLQRDAEAR >4GFH:D|PDBID|CHAIN|SEQUENCE GGATGACGATX """) v = validation( pdb_hierarchy=pdb_in.construct_hierarchy(), sequences=sequences, log=null_out(), nproc=1,) out = StringIO() v.show(out=out) assert v.chains[0].n_missing == 0 assert v.chains[0].n_missing_end == 0 assert v.chains[0].n_missing_start == 0 assert len(v.chains[0].alignment.matches()) == 11 # pdb_in = iotbx.pdb.input(source_info=None, lines="""\ ATOM 2 CA GLY A 1 1.367 0.551 0.300 1.00 7.71 C ATOM 6 CA CYS A 2 2.782 3.785 1.683 1.00 5.18 C ATOM 12 CA CYS A 3 -0.375 5.128 3.282 1.00 5.21 C ATOM 18 CA SER A 4 -0.870 2.048 5.492 1.00 7.19 C ATOM 25 CA LEU A 5 2.786 2.056 6.642 1.00 6.78 C ATOM 33 CA PRO A 6 3.212 4.746 9.312 1.00 7.03 C ATOM 40 CA PRO A 7 6.870 5.690 8.552 1.00 7.97 C ATOM 47 CA CYS A 8 6.021 6.070 4.855 1.00 6.48 C ATOM 53 CA ALA A 9 2.812 8.041 5.452 1.00 7.15 C ATOM 58 CA LEU A 10 4.739 10.382 7.748 1.00 8.36 C ATOM 66 CA SER A 11 7.292 11.200 5.016 1.00 7.00 C ATOM 73 CA ASN A 12 4.649 11.435 2.264 1.00 5.40 C ATOM 81 CA PRO A 13 1.879 13.433 3.968 1.00 5.97 C ATOM 88 CA ASP A 14 0.485 15.371 0.986 1.00 7.70 C ATOM 96 CA TYR A 15 0.565 12.245 -1.180 1.00 6.55 C ATOM 108 CA CYS A 16 -1.466 10.260 1.363 1.00 7.32 C ATOM 113 N NH2 A 17 -2.612 12.308 2.058 1.00 8.11 N """) seq = iotbx.bioinformatics.sequence("GCCSLPPCALSNPDYCX") v = validation( pdb_hierarchy=pdb_in.construct_hierarchy(), sequences=[seq], log=null_out(), nproc=1,) out = StringIO() v.show(out=out) assert v.chains[0].n_missing == 0 assert v.chains[0].n_missing_end == 0 assert v.chains[0].n_missing_start == 0 assert len(v.chains[0].alignment.matches()) == 17 # pdb_in = iotbx.pdb.input(source_info=None, lines="""\ ATOM 2518 CA PRO C 3 23.450 -5.848 45.723 1.00 85.24 C ATOM 2525 CA GLY C 4 20.066 -4.416 44.815 1.00 79.25 C ATOM 2529 CA PHE C 5 19.408 -0.913 46.032 1.00 77.13 C ATOM 2540 CA GLY C 6 17.384 -1.466 49.208 1.00 83.44 C ATOM 2544 CA GLN C 7 17.316 -5.259 49.606 1.00 89.25 C ATOM 2553 CA GLY C 8 19.061 -6.829 52.657 1.00 90.67 C """) sequences, _ = iotbx.bioinformatics.fasta_sequence_parse.parse( """>1JN5:A|PDBID|CHAIN|SEQUENCE MASVDFKTYVDQACRAAEEFVNVYYTTMDKRRRLLSRLYMGTATLVWNGNAVSGQESLSEFFEMLPSSEFQISVVDCQPV HDEATPSQTTVLVVICGSVKFEGNKQRDFNQNFILTAQASPSNTVWKIASDCFRFQDWAS >1JN5:B|PDBID|CHAIN|SEQUENCE APPCKGSYFGTENLKSLVLHFLQQYYAIYDSGDRQGLLDAYHDGACCSLSIPFIPQNPARSSLAEYFKDSRNVKKLKDPT LRFRLLKHTRLNVVAFLNELPKTQHDVNSFVVDISAQTSTLLCFSVNGVFKEVDGKSRDSLRAFTRTFIAVPASNSGLCI VNDELFVRNASSEEIQRAFAMPAPTPSSSPVPTLSPEQQEMLQAFSTQSGMNLEWSQKCLQDNNWDYTRSAQAFTHLKAK GEIPEVAFMK >1JN5:C|PDBID|CHAIN|SEQUENCE GQSPGFGQGGSV """) v = validation( pdb_hierarchy=pdb_in.construct_hierarchy(), sequences=sequences, log=null_out(), nproc=1,) out = StringIO() v.show(out=out) assert v.chains[0].n_missing_start == 3 assert v.chains[0].n_missing_end == 3 assert v.chains[0].identity == 1.0 assert v.chains[0].alignment.match_codes == 'iiimmmmmmiii' # pdb_in = iotbx.pdb.input(source_info=None, lines="""\ ATOM 2 CA ALA A 2 -8.453 57.214 -12.754 1.00 52.95 C ATOM 7 CA LEU A 3 -8.574 59.274 -9.471 1.00 24.33 C ATOM 15 CA ARG A 4 -12.178 60.092 -8.575 1.00 28.40 C ATOM 26 CA GLY A 5 -14.170 61.485 -5.667 1.00 26.54 C ATOM 30 CA THR A 6 -17.784 60.743 -4.783 1.00 31.78 C ATOM 37 CA VAL A 7 -19.080 64.405 -4.464 1.00 21.31 C """) seq = iotbx.bioinformatics.sequence("XALRGTV") v = validation( pdb_hierarchy=pdb_in.construct_hierarchy(), sequences=[seq], log=null_out(), nproc=1,) out = StringIO() v.show(out=out) assert v.chains[0].n_missing_start == 1 assert v.chains[0].n_missing_end == 0 assert v.chains[0].identity == 1.0 assert v.chains[0].alignment.match_codes == 'immmmmm' # pdb_in = iotbx.pdb.input(source_info=None, lines="""\ ATOM 2171 CA ASP I 355 5.591 -11.903 1.133 1.00 41.60 C ATOM 2175 CA PHE I 356 7.082 -8.454 0.828 1.00 39.82 C ATOM 2186 CA GLU I 357 5.814 -6.112 -1.877 1.00 41.12 C ATOM 2195 CA GLU I 358 8.623 -5.111 -4.219 1.00 42.70 C ATOM 2199 CA ILE I 359 10.346 -1.867 -3.363 1.00 43.32 C ATOM 2207 CA PRO I 360 11.658 0.659 -5.880 1.00 44.86 C ATOM 2214 CA GLU I 361 14.921 -0.125 -7.592 1.00 44.32 C ATOM 2219 CA GLU I 362 15.848 3.489 -6.866 1.00 44.27 C HETATM 2224 CA TYS I 363 16.482 2.005 -3.448 1.00 44.52 C """) seq = iotbx.bioinformatics.sequence("NGDFEEIPEEYL") v = validation( pdb_hierarchy=pdb_in.construct_hierarchy(), sequences=[seq], log=null_out(), nproc=1,) out = StringIO() v.show(out=out) assert v.chains[0].n_missing_start == 2 assert v.chains[0].n_missing_end == 1 assert v.chains[0].identity == 1.0 pdb_in = iotbx.pdb.input(source_info=None, lines="""\ ATOM 450 CA ASN A 1 37.242 41.665 44.160 1.00 35.89 C ATOM 458 CA GLY A 2 37.796 38.269 42.523 1.00 30.13 C HETATM 463 CA AMSE A 3 35.878 39.005 39.326 0.54 22.83 C HETATM 464 CA BMSE A 3 35.892 39.018 39.323 0.46 22.96 C ATOM 478 CA ILE A 4 37.580 38.048 36.061 1.00 22.00 C ATOM 486 CA SER A 5 37.593 40.843 33.476 1.00 18.73 C ATOM 819 CA ALA A 8 25.982 34.781 27.220 1.00 18.43 C ATOM 824 CA ALA A 9 23.292 32.475 28.614 1.00 19.60 C HETATM 830 CA BMSE A 10 22.793 30.814 25.223 0.41 22.60 C HETATM 831 CA CMSE A 10 22.801 30.850 25.208 0.59 22.54 C ATOM 845 CA GLU A 11 26.504 30.054 24.966 1.00 25.19 C ATOM 854 CA GLY A 12 25.907 28.394 28.320 1.00 38.88 C """) seq = iotbx.bioinformatics.sequence("NGMISAAAAMEG") v = validation( pdb_hierarchy=pdb_in.construct_hierarchy(), sequences=[seq], log=null_out(), nproc=1,) out = StringIO() v.show(out=out) assert v.chains[0].alignment.a == 'NGMISXXAAMEG' assert v.chains[0].alignment.b == 'NGMISAAAAMEG' pdb_in = iotbx.pdb.input(source_info=None, lines="""\ ATOM 4615 CA ALA C 1 1.000 1.000 1.000 1.00 10.00 ATOM 4622 CA ALA C 2 1.000 1.000 1.000 1.00 10.00 ATOM 4627 CA ALA C 3 1.000 1.000 1.000 1.00 10.00 ATOM 4634 CA ALA C 4 1.000 1.000 1.000 1.00 10.00 ATOM 4646 CA ALA C 5 1.000 1.000 1.000 1.00 10.00 ATOM 4658 CA ALA C 6 1.000 1.000 1.000 1.00 10.00 ATOM 4664 CA ALA C 7 1.000 1.000 1.000 1.00 10.00 ATOM 4669 CA ALA C 8 1.000 1.000 1.000 1.00 10.00 ATOM 4680 CA ARG C 9 1.000 1.000 1.000 1.00 10.00 ATOM 4690 CA GLY C 10 1.000 1.000 1.000 1.00 10.00 ATOM 4698 CA PRO C 11 1.000 1.000 1.000 1.00 10.00 ATOM 4705 CA LYS C 12 1.000 1.000 1.000 1.00 10.00 ATOM 4712 CA TRP C 13 1.000 1.000 1.000 1.00 10.00 ATOM 4726 CA GLU C 14 1.000 1.000 1.000 1.00 10.00 ATOM 4738 CA SER C 15 1.000 1.000 1.000 1.00 10.00 ATOM 4744 CA THR C 16 1.000 1.000 1.000 1.00 10.00 ATOM 4751 CA GLY C 17 1.000 1.000 1.000 1.00 10.00 ATOM 4755 CA TYR C 18 1.000 1.000 1.000 1.00 10.00 ATOM 4767 CA PHE C 19 1.000 1.000 1.000 1.00 10.00 ATOM 4778 CA ALA C 20 1.000 1.000 1.000 1.00 10.00 ATOM 4786 CA ALA C 21 1.000 1.000 1.000 1.00 10.00 ATOM 4798 CA TRP C 22 1.000 1.000 1.000 1.00 10.00 ATOM 4812 CA GLY C 23 1.000 1.000 1.000 1.00 10.00 ATOM 4816 CA GLN C 24 1.000 1.000 1.000 1.00 10.00 ATOM 4822 CA GLY C 25 1.000 1.000 1.000 1.00 10.00 ATOM 4826 CA THR C 26 1.000 1.000 1.000 1.00 10.00 ATOM 4833 CA LEU C 27 1.000 1.000 1.000 1.00 10.00 ATOM 4841 CA VAL C 28 1.000 1.000 1.000 1.00 10.00 ATOM 4848 CA THR C 29 1.000 1.000 1.000 1.00 10.00 ATOM 4855 CA VAL C 30 1.000 1.000 1.000 1.00 10.00 ATOM 4862 CA SER C 31 1.000 1.000 1.000 1.00 10.00 ATOM 4868 CA SER C 32 1.000 1.000 1.000 1.00 10.00 END """) seq = iotbx.bioinformatics.sequence( "AAAAAAAARGKWESPAALLKKAAWCSGTLVTVSSASAPKWKSTSGCYFAAPWNKRALRVTVLQSS") v = validation( pdb_hierarchy=pdb_in.construct_hierarchy(), sequences=[seq], log=null_out(), nproc=1,) out = StringIO() v.show(out=out) # all tests below here have additional dependencies if (not libtbx.env.has_module("ksdssp")) : print "Skipping advanced tests (require ksdssp module)" return pdb_file = libtbx.env.find_in_repositories( relative_path="phenix_regression/pdb/1ywf.pdb", test=os.path.isfile) if (pdb_file is not None) : seq = iotbx.bioinformatics.sequence("MGSSHHHHHHSSGLVPRGSHMAVRELPGAWNFRDVADTATALRPGRLFRSSELSRLDDAGRATLRRLGITDVADLRSSREVARRGPGRVPDGIDVHLLPFPDLADDDADDSAPHETAFKRLLTNDGSNGESGESSQSINDAATRYMTDEYRQFPTRNGAQRALHRVVTLLAAGRPVLTHCFAGKDRTGFVVALVLEAVGLDRDVIVADYLRSNDSVPQLRARISEMIQQRFDTELAPEVVTFTKARLSDGVLGVRAEYLAAARQTIDETYGSLGGYLRDAGISQATVNRMRGVLLG") pdb_in = file_reader.any_file(pdb_file, force_type="pdb") hierarchy = pdb_in.file_object.hierarchy v = validation( pdb_hierarchy=hierarchy, sequences=[seq], log=null_out(), nproc=1, include_secondary_structure=True, extract_coordinates=True) out = StringIO() v.show(out=out) aln1, aln2, ss = v.chains[0].get_alignment(include_sec_str=True) assert ("HHH" in ss) and ("LLL" in ss) and ("---" in ss) cif_block = v.as_cif_block() assert cif_block['_struct_ref.pdbx_seq_one_letter_code'] == seq.sequence assert list( cif_block['_struct_ref_seq.pdbx_auth_seq_align_beg']) == ['4', '117'] assert list( cif_block['_struct_ref_seq.pdbx_auth_seq_align_end']) == ['85', '275'] assert list(cif_block['_struct_ref_seq.seq_align_beg']) == ['1', '114'] assert list(cif_block['_struct_ref_seq.seq_align_end']) == ['82', '272'] # determine relative counts of sequences and chains n_seq = get_sequence_n_copies( pdb_hierarchy=hierarchy, sequences=[seq] * 4, copies_from_xtriage=4, out=null_out()) assert (n_seq == 1) hierarchy = hierarchy.deep_copy() chain2 = hierarchy.only_model().chains()[0].detached_copy() hierarchy.only_model().append_chain(chain2) n_seq = get_sequence_n_copies( pdb_hierarchy=hierarchy, sequences=[seq] * 4, copies_from_xtriage=2, out=null_out()) assert (n_seq == 1) n_seq = get_sequence_n_copies( pdb_hierarchy=hierarchy, sequences=[seq], copies_from_xtriage=2, out=null_out()) assert (n_seq == 4) try : n_seq = get_sequence_n_copies( pdb_hierarchy=hierarchy, sequences=[seq] * 3, copies_from_xtriage=2, out=null_out()) except Sorry, s : assert ("round number" in str(s)) else : raise Exception_expected n_seq = get_sequence_n_copies( pdb_hierarchy=hierarchy, sequences=[seq] * 3, copies_from_xtriage=2, force_accept_composition=True, out=null_out()) assert (n_seq == 1) try : n_seq = get_sequence_n_copies( pdb_hierarchy=hierarchy, sequences=[seq] * 4, copies_from_xtriage=1, out=null_out()) except Sorry, s : assert ("less than" in str(s)) else : raise Exception_expected n_seq = get_sequence_n_copies( pdb_hierarchy=hierarchy, sequences=[seq] * 4, copies_from_xtriage=1, assume_xtriage_copies_from_sequence_file=True, out=null_out()) assert (n_seq == 0.5) hierarchy = hierarchy.deep_copy() chain2 = hierarchy.only_model().chains()[0].detached_copy() hierarchy.only_model().append_chain(chain2) try : n_seq = get_sequence_n_copies( pdb_hierarchy=hierarchy, sequences=[seq] * 2, copies_from_xtriage=2, out=null_out()) except Sorry, s : assert ("round number" in str(s)) else : raise Exception_expected n_seq = get_sequence_n_copies( pdb_hierarchy=hierarchy, sequences=[seq], copies_from_xtriage=1, out=null_out()) assert (n_seq == 3) hierarchy = hierarchy.deep_copy() chain2 = hierarchy.only_model().chains()[0].detached_copy() hierarchy.only_model().append_chain(chain2) n_seq = get_sequence_n_copies( pdb_hierarchy=hierarchy, sequences=[seq] * 2, copies_from_xtriage=2, out=null_out()) assert (n_seq == 4) # now with files as input seq_file = "tmp_mmtbx_validation_sequence.fa" open(seq_file, "w").write(">1ywf\n%s" % seq.sequence) n_seq = get_sequence_n_copies_from_files( pdb_file=pdb_file, seq_file=seq_file, copies_from_xtriage=4, out=null_out()) try : assert (n_seq == 4) finally : os.remove(seq_file) if (__name__ == "__main__") : exercise() print "OK"
45.914894
339
0.613742
3,817
23,738
3.69793
0.189678
0.023167
0.034006
0.036273
0.477223
0.461353
0.447609
0.40921
0.397662
0.363797
0
0.206391
0.28684
23,738
516
340
46.003876
0.627385
0.009099
0
0.523109
0
0.266807
0.539696
0.053818
0
1
0
0
0.128151
0
null
null
0.004202
0.027311
null
null
0.008403
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
null
1
0
0
0
1
0
0
0
0
0
0
0
0
4
2e880d6a24cf5e6157bbc2267314c4c545f57ae5
2,991
py
Python
z2/part3/updated_part2_batch/jm/parser_errors_2/912800483.py
kozakusek/ipp-2020-testy
09aa008fa53d159672cc7cbf969a6b237e15a7b8
[ "MIT" ]
1
2020-04-16T12:13:47.000Z
2020-04-16T12:13:47.000Z
z2/part3/updated_part2_batch/jm/parser_errors_2/912800483.py
kozakusek/ipp-2020-testy
09aa008fa53d159672cc7cbf969a6b237e15a7b8
[ "MIT" ]
18
2020-03-06T17:50:15.000Z
2020-05-19T14:58:30.000Z
z2/part3/updated_part2_batch/jm/parser_errors_2/912800483.py
kozakusek/ipp-2020-testy
09aa008fa53d159672cc7cbf969a6b237e15a7b8
[ "MIT" ]
18
2020-03-06T17:45:13.000Z
2020-06-09T19:18:31.000Z
from part1 import ( gamma_board, gamma_busy_fields, gamma_delete, gamma_free_fields, gamma_golden_move, gamma_golden_possible, gamma_move, gamma_new, ) """ scenario: test_random_actions uuid: 912800483 """ """ random actions, total chaos """ board = gamma_new(4, 4, 2, 7) assert board is not None assert gamma_move(board, 1, 0, 1) == 1 assert gamma_move(board, 1, 0, 3) == 1 assert gamma_move(board, 2, 0, 3) == 0 assert gamma_free_fields(board, 2) == 14 assert gamma_move(board, 1, 2, 1) == 1 assert gamma_move(board, 2, 1, 1) == 1 assert gamma_golden_possible(board, 2) == 1 assert gamma_move(board, 1, 2, 1) == 0 assert gamma_move(board, 1, 2, 1) == 0 assert gamma_golden_move(board, 1, 1, 1) == 1 assert gamma_move(board, 2, 2, 0) == 1 assert gamma_move(board, 2, 0, 2) == 1 assert gamma_free_fields(board, 2) == 10 assert gamma_move(board, 1, 2, 2) == 1 board654287219 = gamma_board(board) assert board654287219 is not None assert board654287219 == ("1...\n" "2.1.\n" "111.\n" "..2.\n") del board654287219 board654287219 = None assert gamma_move(board, 2, 2, 2) == 0 assert gamma_move(board, 1, 1, 3) == 1 assert gamma_move(board, 1, 1, 3) == 0 assert gamma_move(board, 2, 1, 0) == 1 assert gamma_move(board, 2, 0, 3) == 0 assert gamma_free_fields(board, 2) == 7 assert gamma_move(board, 1, 3, 0) == 1 assert gamma_move(board, 1, 0, 3) == 0 assert gamma_golden_possible(board, 1) == 0 assert gamma_move(board, 2, 3, 3) == 1 assert gamma_move(board, 1, 2, 3) == 1 board867387183 = gamma_board(board) assert board867387183 is not None assert board867387183 == ("1112\n" "2.1.\n" "111.\n" ".221\n") del board867387183 board867387183 = None assert gamma_move(board, 2, 2, 1) == 0 assert gamma_move(board, 1, 0, 1) == 0 assert gamma_move(board, 2, 2, 3) == 0 assert gamma_move(board, 1, 1, 1) == 0 board637069540 = gamma_board(board) assert board637069540 is not None assert board637069540 == ("1112\n" "2.1.\n" "111.\n" ".221\n") del board637069540 board637069540 = None assert gamma_move(board, 2, 3, 2) == 1 assert gamma_busy_fields(board, 2) == 5 assert gamma_move(board, 1, 0, 0) == 1 assert gamma_move(board, 2, 1, 3) == 0 assert gamma_move(board, 1, 2, 1) == 0 assert gamma_move(board, 1, 2, 0) == 0 assert gamma_move(board, 2, 2, 1) == 0 assert gamma_move(board, 2, 1, 3) == 0 assert gamma_move(board, 1, 2, 1) == 0 assert gamma_move(board, 2, 1, 3) == 0 assert gamma_move(board, 2, 0, 1) == 0 assert gamma_move(board, 1, 2, 1) == 0 assert gamma_move(board, 1, 3, 1) == 1 assert gamma_move(board, 2, 2, 1) == 0 assert gamma_move(board, 2, 2, 1) == 0 assert gamma_move(board, 1, 1, 3) == 0 assert gamma_move(board, 1, 2, 1) == 0 assert gamma_move(board, 2, 2, 1) == 0 assert gamma_move(board, 1, 2, 1) == 0 assert gamma_move(board, 1, 3, 2) == 0 assert gamma_move(board, 2, 2, 1) == 0 assert gamma_busy_fields(board, 2) == 5 assert gamma_golden_possible(board, 2) == 1 gamma_delete(board)
27.694444
46
0.666332
529
2,991
3.616257
0.079395
0.299007
0.337167
0.449556
0.700993
0.675379
0.61265
0.492943
0.415055
0.380031
0
0.152591
0.180542
2,991
107
47
27.953271
0.627907
0
0
0.359551
0
0
0.024802
0
0
0
0
0
0.662921
1
0
false
0
0.011236
0
0.011236
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
4
d85bbe126edf3c5e5f73284a3fa74806c2b886d0
40
py
Python
Python3/Listas/ListaEx3.py
arthursiq5/programacao-progressiva
2ec91602a6f37c93b99e6a92239045cd1c4cef6b
[ "MIT" ]
null
null
null
Python3/Listas/ListaEx3.py
arthursiq5/programacao-progressiva
2ec91602a6f37c93b99e6a92239045cd1c4cef6b
[ "MIT" ]
null
null
null
Python3/Listas/ListaEx3.py
arthursiq5/programacao-progressiva
2ec91602a6f37c93b99e6a92239045cd1c4cef6b
[ "MIT" ]
null
null
null
numeros = list(range(5)) print(numeros)
13.333333
24
0.725
6
40
4.833333
0.833333
0
0
0
0
0
0
0
0
0
0
0.027778
0.1
40
2
25
20
0.777778
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
4
d8709fa5507d0f9e93301ffee9ff85452cd14ed8
159
py
Python
alethioclock/config.py
A-Somma/alethioclock
77ae5cf5845e8e4a96eab6587026673d2c319390
[ "MIT" ]
null
null
null
alethioclock/config.py
A-Somma/alethioclock
77ae5cf5845e8e4a96eab6587026673d2c319390
[ "MIT" ]
null
null
null
alethioclock/config.py
A-Somma/alethioclock
77ae5cf5845e8e4a96eab6587026673d2c319390
[ "MIT" ]
null
null
null
#firebase service account SERVICE_ACCOUNT_PATH = '../.firebase/service-account.json' SERVICE_ADDRESS = '532' STATUSES = ['AUTOMATIC', 'HOME', 'LOST', 'UNKOWN']
39.75
58
0.735849
18
159
6.333333
0.666667
0.368421
0.385965
0
0
0
0
0
0
0
0
0.02069
0.08805
159
4
59
39.75
0.765517
0.150943
0
0
0
0
0.437037
0.244444
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
d89003afcb31aa3b7f93cf4e95c591116b0930a2
124
py
Python
Python/PyinstallerUI.py
ClericPy/somethings
537b0b1014e2655e0f9b4cbaa878e6fdd8ed97b3
[ "MIT" ]
4
2021-02-01T05:03:56.000Z
2022-01-10T00:46:55.000Z
Python/PyinstallerUI.py
ClericPy/somethings
537b0b1014e2655e0f9b4cbaa878e6fdd8ed97b3
[ "MIT" ]
null
null
null
Python/PyinstallerUI.py
ClericPy/somethings
537b0b1014e2655e0f9b4cbaa878e6fdd8ed97b3
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # pip install pyinstallerui # > python -m pyinstallerui from pyinstallerui.core import main main()
17.714286
35
0.709677
15
124
5.866667
0.8
0
0
0
0
0
0
0
0
0
0
0.009615
0.16129
124
6
36
20.666667
0.836538
0.58871
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
d8ac1843546c49a4a930b039ae69d582442fee33
331
py
Python
#074 - Maior e menor valores em Tupla.py
EronBruce/Exercicios_Python
bfb90c8e5414b8883596f0fba46b0c2a66a45983
[ "Apache-2.0" ]
null
null
null
#074 - Maior e menor valores em Tupla.py
EronBruce/Exercicios_Python
bfb90c8e5414b8883596f0fba46b0c2a66a45983
[ "Apache-2.0" ]
null
null
null
#074 - Maior e menor valores em Tupla.py
EronBruce/Exercicios_Python
bfb90c8e5414b8883596f0fba46b0c2a66a45983
[ "Apache-2.0" ]
null
null
null
from random import randint numeros = (randint(0,10),randint(0,10),randint(0,10),randint(0,10),randint(0,10)) print('Os valores sorteados foram: ', end='') for n in numeros: print(f'{n} ', end='') print('\nO maior valor sorteado foi {}'.format(max(numeros))) print('O menor valor sorteado foi {}'.format(min(numeros)))
36.777778
82
0.667674
52
331
4.25
0.519231
0.180995
0.226244
0.307692
0.226244
0.226244
0.226244
0.226244
0.226244
0.226244
0
0.052448
0.135952
331
8
83
41.375
0.72028
0
0
0
0
0
0.28483
0
0
0
0
0
0
1
0
false
0
0.142857
0
0.142857
0.571429
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
4
d8b9cab439a068304382fbb228c74c211ce99359
15
py
Python
glance/__init__.py
GlanceApps/Glance-Website
1e1e23f10afff39758a0e10d1a2b8802089216e6
[ "BSD-3-Clause" ]
1
2021-07-13T06:20:05.000Z
2021-07-13T06:20:05.000Z
glance/__init__.py
GlanceApps/Glance-Website
1e1e23f10afff39758a0e10d1a2b8802089216e6
[ "BSD-3-Clause" ]
7
2015-09-23T20:15:18.000Z
2015-09-23T20:16:57.000Z
glance/__init__.py
GlanceApps/Glance-Website
1e1e23f10afff39758a0e10d1a2b8802089216e6
[ "BSD-3-Clause" ]
null
null
null
""" glance """
7.5
14
0.4
1
15
6
1
0
0
0
0
0
0
0
0
0
0
0
0.2
15
1
15
15
0.5
0.4
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
d8fc0f5664c12949958af0947162bae55477a171
8,710
py
Python
tests/test_runtime.py
NathanDeMaria/aws-lambda-r-runtime
ceddfe8385fb5c3010f34cff7651ba94fdab7a74
[ "MIT" ]
134
2018-12-05T10:17:17.000Z
2022-03-04T21:36:03.000Z
tests/test_runtime.py
NathanDeMaria/aws-lambda-r-runtime
ceddfe8385fb5c3010f34cff7651ba94fdab7a74
[ "MIT" ]
36
2019-01-24T08:39:32.000Z
2021-05-11T01:42:17.000Z
tests/test_runtime.py
eiudigital/aws-lambda-r-runtime
ddb5a8311a315f9f62e0b00c7e66b73dbb92b100
[ "MIT" ]
55
2018-12-11T22:42:47.000Z
2022-02-03T19:54:34.000Z
import base64 import json import re import unittest import boto3 from tests import get_version, get_function_name, is_local from tests.sam import LocalLambdaServer, start_local_lambda class TestRuntimeLayer(unittest.TestCase): lambda_server: LocalLambdaServer = None @classmethod def setUpClass(cls): if is_local(): cls.lambda_server = start_local_lambda(template_path="test-template.yaml", parameter_overrides={'Version': get_version()}, ) def get_client(self): return self.lambda_server.get_client() if is_local() else boto3.client('lambda') def test_script(self): lambda_client = self.get_client() response = lambda_client.invoke(FunctionName=get_function_name("ExampleFunction"), Payload=json.dumps({'x': 1}), ) raw_payload = response['Payload'].read().decode('utf-8') result = json.loads(raw_payload) self.assertEqual(2, result) def test_lowercase_extension(self): lambda_client = self.get_client() response = lambda_client.invoke(FunctionName=get_function_name("LowerCaseExtensionFunction"), Payload=json.dumps({'x': 1}), ) raw_payload = response['Payload'].read().decode('utf-8') result = json.loads(raw_payload) self.assertEqual(2, result) def test_multiple_arguments(self): lambda_client = self.get_client() payload = {'x': 'bar', 'y': 1} response = lambda_client.invoke(FunctionName=get_function_name("MultipleArgumentsFunction"), Payload=json.dumps(payload), ) raw_payload = response['Payload'].read().decode('utf-8') result = json.loads(raw_payload) self.assertDictEqual(payload, result) @unittest.skipIf(is_local(), 'Lambda local does not support log retrieval') def test_debug_logging(self): lambda_client = self.get_client() response = lambda_client.invoke(FunctionName=get_function_name("LoggingFunction"), LogType='Tail', Payload=json.dumps({'x': 1}), ) raw_payload = response['Payload'].read().decode('utf-8') result = json.loads(raw_payload) self.assertEqual(1, result) log = base64.b64decode(response['LogResult']).decode('utf-8') self.assertIn("runtime:Sourcing 'script.R'", log) self.assertIn("runtime:Invoking function 'handler_with_debug_logging' with parameters:\n$x\n[1] 1", log) self.assertIn("runtime:Function returned:\n[1] 1", log) self.assertIn("runtime:Posted result:\n", log) @unittest.skipIf(is_local(), 'Lambda local does not support log retrieval') def test_no_debug_logging(self): lambda_client = self.get_client() response = lambda_client.invoke(FunctionName=get_function_name("ExampleFunction"), LogType='Tail', Payload=json.dumps({'x': 1}), ) raw_payload = response['Payload'].read().decode('utf-8') result = json.loads(raw_payload) self.assertEqual(2, result) log = base64.b64decode(response['LogResult']).decode('utf-8') self.assertNotIn("Sourcing ", log) self.assertNotIn("Invoking function ", log) self.assertNotIn("Function returned:", log) self.assertNotIn("Posted result:", log) @unittest.skipIf(is_local(), 'Lambda local does not pass errors properly') def test_missing_source_file(self): lambda_client = self.get_client() response = lambda_client.invoke(FunctionName=get_function_name("MissingSourceFileFunction"), Payload=json.dumps({'y': 1}), ) raw_payload = response['Payload'].read().decode('utf-8') json_payload = json.loads(raw_payload) self.assertEqual('Unhandled', response['FunctionError']) self.assertIn('Source file does not exist: missing.[R|r]', json_payload['errorMessage']) self.assertEqual('simpleError', json_payload['errorType']) @unittest.skipIf(is_local(), 'Lambda local does not pass errors properly') def test_missing_function(self): lambda_client = self.get_client() response = lambda_client.invoke(FunctionName=get_function_name("MissingFunctionFunction"), Payload=json.dumps({'y': 1}), ) raw_payload = response['Payload'].read().decode('utf-8') json_payload = json.loads(raw_payload) self.assertEqual('Unhandled', response['FunctionError']) self.assertIn('Function "handler_missing" does not exist', json_payload['errorMessage']) self.assertEqual('simpleError', json_payload['errorType']) @unittest.skipIf(is_local(), 'Lambda local does not pass errors properly') def test_function_as_variable(self): lambda_client = self.get_client() response = lambda_client.invoke(FunctionName=get_function_name("HandlerAsVariableFunction"), Payload=json.dumps({'y': 1}), ) raw_payload = response['Payload'].read().decode('utf-8') json_payload = json.loads(raw_payload) self.assertEqual('Unhandled', response['FunctionError']) self.assertIn('Function "handler_as_variable" does not exist', json_payload['errorMessage']) self.assertEqual('simpleError', json_payload['errorType']) @unittest.skipIf(is_local(), 'Lambda local does not pass errors properly') def test_missing_argument(self): lambda_client = self.get_client() response = lambda_client.invoke(FunctionName=get_function_name("ExampleFunction")) raw_payload = response['Payload'].read().decode('utf-8') json_payload = json.loads(raw_payload) self.assertEqual('Unhandled', response['FunctionError']) self.assertIn('argument "x" is missing, with no default', json_payload['errorMessage']) self.assertEqual('simpleError', json_payload['errorType']) @unittest.skipIf(is_local(), 'Lambda local does not pass errors properly') def test_unused_argument(self): lambda_client = self.get_client() response = lambda_client.invoke(FunctionName=get_function_name("ExampleFunction"), Payload=json.dumps({'x': 1, 'y': 1}), ) raw_payload = response['Payload'].read().decode('utf-8') json_payload = json.loads(raw_payload) self.assertEqual('Unhandled', response['FunctionError']) self.assertIn('unused argument (y = 1)', json_payload['errorMessage']) self.assertEqual('simpleError', json_payload['errorType']) # @unittest.skipIf(is_local(), 'Fails locally with "argument list too long"') @unittest.skip('Fails with timeout') def test_long_argument(self): lambda_client = self.get_client() payload = {x: x for x in range(0, 100000)} response = lambda_client.invoke(FunctionName=get_function_name("VariableArgumentsFunction"), Payload=json.dumps(payload), ) raw_payload = response['Payload'].read().decode('utf-8') result = json.loads(raw_payload) self.assertEqual(1, result) @unittest.skipIf(is_local(), 'Lambda local does not pass errors properly') def test_missing_library(self): lambda_client = self.get_client() response = lambda_client.invoke(FunctionName=get_function_name("MissingLibraryFunction"), Payload=json.dumps({'y': 1}), ) raw_payload = response['Payload'].read().decode('utf-8') json_payload = json.loads(raw_payload) self.assertEqual('Unhandled', response['FunctionError']) self.assertIn('there is no package called ‘Matrix’', json_payload['errorMessage']) error_type = 'packageNotFoundError' if get_version() == '3_6_0' else 'simpleError' self.assertEqual(error_type, json_payload['errorType']) @classmethod def tearDownClass(cls): if is_local(): cls.lambda_server.kill()
50.639535
112
0.607692
901
8,710
5.688124
0.152053
0.056195
0.027317
0.046829
0.738341
0.738341
0.738341
0.716488
0.681366
0.679024
0
0.009015
0.274053
8,710
171
113
50.935673
0.801518
0.008611
0
0.536424
0
0
0.188528
0.025492
0
0
0
0
0.211921
1
0.099338
false
0.039735
0.046358
0.006623
0.165563
0
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
2b17762fe3fbc9619976a66bc13a672eff3a9126
213
py
Python
Android/NDK/android-ndk-r20b-win/prebuilt/windows-x86_64/lib/python2.7/plat-win32/STDDEF.py
X018/CCTOOL
989af4d7edab82bf540400eb72eca4e7447d722c
[ "MIT" ]
null
null
null
Android/NDK/android-ndk-r20b-win/prebuilt/windows-x86_64/lib/python2.7/plat-win32/STDDEF.py
X018/CCTOOL
989af4d7edab82bf540400eb72eca4e7447d722c
[ "MIT" ]
null
null
null
Android/NDK/android-ndk-r20b-win/prebuilt/windows-x86_64/lib/python2.7/plat-win32/STDDEF.py
X018/CCTOOL
989af4d7edab82bf540400eb72eca4e7447d722c
[ "MIT" ]
null
null
null
# Generated by h2py from /buildbot/src/googleplex-android/ndk-release-r20/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8/bin/../lib/gcc/x86_64-w64-mingw32/4.8.3/include/stddef.h __WCHAR_TYPE__ = int NULL = 0
53.25
182
0.779343
40
213
3.975
0.8
0.062893
0.100629
0.188679
0.213836
0.213836
0
0
0
0
0
0.134328
0.056338
213
3
183
71
0.656716
0.84507
0
0
1
0
0
0
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
1
0
0
0
1
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
2b4b6b6bd8882b974616e323ab3c59685d357121
132
py
Python
tests/unit/utils/test_context_processors.py
etienne86/oc_p13_team_spirit
fd3d45618d349ecd0a03e63c4a7e9c1044eeffaa
[ "MIT" ]
null
null
null
tests/unit/utils/test_context_processors.py
etienne86/oc_p13_team_spirit
fd3d45618d349ecd0a03e63c4a7e9c1044eeffaa
[ "MIT" ]
null
null
null
tests/unit/utils/test_context_processors.py
etienne86/oc_p13_team_spirit
fd3d45618d349ecd0a03e63c4a7e9c1044eeffaa
[ "MIT" ]
null
null
null
""" This module contains the unit tests related to the context processors in app ``utils``. """ # from django.test import TestCase
18.857143
46
0.734848
19
132
5.105263
0.947368
0
0
0
0
0
0
0
0
0
0
0
0.166667
132
6
47
22
0.881818
0.916667
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
2b7337b67de98bf8e7d3d1d8158ae4b3938a0ab0
413
py
Python
src/bromine/utils/wait.py
Etiqa/bromine
cabf0931f5a06796c26fdc7fb9f7ecf147554fd5
[ "BSD-2-Clause" ]
2
2018-09-20T12:37:01.000Z
2021-08-30T14:44:25.000Z
src/bromine/utils/wait.py
Etiqa/bromine
cabf0931f5a06796c26fdc7fb9f7ecf147554fd5
[ "BSD-2-Clause" ]
null
null
null
src/bromine/utils/wait.py
Etiqa/bromine
cabf0931f5a06796c26fdc7fb9f7ecf147554fd5
[ "BSD-2-Clause" ]
null
null
null
from selenium.webdriver.support.ui import WebDriverWait class Wait(WebDriverWait): def __init__(self, *args, **kwargs): super(Wait, self).__init__(None, *args, **kwargs) def until(self, method, message=''): return super(Wait, self).until(lambda _: method(), message) def until_not(self, method, message=''): return super(Wait, self).until_not(lambda _: method(), message)
29.5
71
0.670702
50
413
5.3
0.44
0.196226
0.14717
0.173585
0.309434
0.309434
0.309434
0.309434
0
0
0
0
0.181598
413
13
72
31.769231
0.784024
0
0
0
0
0
0
0
0
0
0
0
0
1
0.375
false
0
0.125
0.25
0.875
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4
9975f40a1c754fbe714eb051e6768f082426071e
209
py
Python
ripiu/cmsplugin_articles/apps.py
ripiu/cmsplugin_articles
0ca96129eb904bf7f12b97861d248748bcfcf45a
[ "BSD-3-Clause" ]
null
null
null
ripiu/cmsplugin_articles/apps.py
ripiu/cmsplugin_articles
0ca96129eb904bf7f12b97861d248748bcfcf45a
[ "BSD-3-Clause" ]
null
null
null
ripiu/cmsplugin_articles/apps.py
ripiu/cmsplugin_articles
0ca96129eb904bf7f12b97861d248748bcfcf45a
[ "BSD-3-Clause" ]
null
null
null
from django.apps import AppConfig from django.utils.translation import ugettext_lazy as _ class ArticlesConfig(AppConfig): name = 'ripiu.cmsplugin_articles' verbose_name = _('Articles and sections')
26.125
55
0.784689
25
209
6.36
0.76
0.125786
0
0
0
0
0
0
0
0
0
0
0.143541
209
7
56
29.857143
0.888268
0
0
0
0
0
0.215311
0.114833
0
0
0
0
0
1
0
false
0
0.4
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
99842b30ec483a6935bbcde7be0bbff048a7aa90
71
py
Python
function_examples.py
dipakbari4/PythonExercises
e0395b9328f92b69dca8111b237b9159e120415c
[ "MIT" ]
null
null
null
function_examples.py
dipakbari4/PythonExercises
e0395b9328f92b69dca8111b237b9159e120415c
[ "MIT" ]
null
null
null
function_examples.py
dipakbari4/PythonExercises
e0395b9328f92b69dca8111b237b9159e120415c
[ "MIT" ]
null
null
null
def printMyName(name): print("Hello", name) printMyName("Dipak")
11.833333
24
0.676056
8
71
6
0.75
0
0
0
0
0
0
0
0
0
0
0
0.15493
71
5
25
14.2
0.8
0
0
0
0
0
0.140845
0
0
0
0
0
0
1
0.333333
false
0
0
0
0.333333
1
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
1
0
4
41e564a59bf004275f992dee64af79003ce1f0aa
72
py
Python
djtools/socialnetworks/__init__.py
anuj2511/django-tools-socialnetworks
078ead9f08df3913e1c4d730edb3d29cf71809a5
[ "MIT" ]
null
null
null
djtools/socialnetworks/__init__.py
anuj2511/django-tools-socialnetworks
078ead9f08df3913e1c4d730edb3d29cf71809a5
[ "MIT" ]
2
2018-11-12T13:30:02.000Z
2018-11-12T14:33:05.000Z
djtools/socialnetworks/__init__.py
anuj2511/django-tools-socialnetworks
078ead9f08df3913e1c4d730edb3d29cf71809a5
[ "MIT" ]
1
2018-11-12T13:32:40.000Z
2018-11-12T13:32:40.000Z
default_app_config = 'djtools.socialnetworks.apps.SocialNetworksConfig'
36
71
0.875
7
72
8.714286
1
0
0
0
0
0
0
0
0
0
0
0
0.041667
72
1
72
72
0.884058
0
0
0
0
0
0.666667
0.666667
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4