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
ffbcc158d9f754dee755ff6df0856c0df771db06
2,009
py
Python
hookdns/gethostbyname_ex.py
cle-b/hookdns
8ff26ba71988319769b69fb0e0ccc1c2d3994898
[ "Apache-2.0" ]
null
null
null
hookdns/gethostbyname_ex.py
cle-b/hookdns
8ff26ba71988319769b69fb0e0ccc1c2d3994898
[ "Apache-2.0" ]
null
null
null
hookdns/gethostbyname_ex.py
cle-b/hookdns
8ff26ba71988319769b69fb0e0ccc1c2d3994898
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- from contextlib import ContextDecorator import socket from mock import patch class patch_gethostbyname_ex(ContextDecorator): """Intercepts the call to socket.gethostbyname_ex to customize the DNS resolution. Custom DNS resolutions are describe by a dictionnary where the keys are hostnames and the values the expected corresponding addresses. { "hostname1": "addr1", "hostname2": "addr2" } hostname and addr could be a domain name or a string representation of an IPv4. A call to socket.gethostbyname_ex for hostname1 returns the same call but for addr1. You can use it as a decorator or a context manager: @patch_gethostbyname_ex({"servername": "1.2.3.4"}) def my_func(): ... assert ("servername", [], ["1.2.3.4"]) == socket.gethostbyname_ex("servername") ... with patch_gethostbyname_ex({"servername": "1.2.3.4"}): ... assert ("servername", [], ["1.2.3.4"]) == socket.gethostbyname_ex("servername") ... https://docs.python.org/3/library/socket.html#socket.gethostbyname_ex """ # noqa: E501 def __init__(self, hosts): self.real_socket_gethostbyname_ex = socket.gethostbyname_ex self.hosts = hosts def _patch_socket_gethostbyname_ex(self, hostname): new_host = self.hosts.get(hostname, hostname) (_, _, ipaddrlist) = self.real_socket_gethostbyname_ex(new_host) # we modify the return value with the original hostname # and set an empty aliaslist return (hostname, [], ipaddrlist) def __enter__(self): self.mock_gethostbyname_ex = patch("socket.gethostbyname_ex") mock_gethostbyname_ex2 = self.mock_gethostbyname_ex.start() mock_gethostbyname_ex2.side_effect = self._patch_socket_gethostbyname_ex return self def __exit__(self, *exc): self.mock_gethostbyname_ex.stop() return False
34.050847
91
0.660528
244
2,009
5.213115
0.434426
0.200472
0.181604
0.040881
0.221698
0.133648
0.133648
0.133648
0.080189
0.080189
0
0.019672
0.240916
2,009
58
92
34.637931
0.814426
0.523644
0
0
0
0
0.026528
0.026528
0
0
0
0
0
1
0.210526
false
0
0.157895
0
0.578947
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
ffddd4f00b08028aac4e13adf4ee059c05f55e8e
91
py
Python
setup.py
DevAI-64/class_generator
364a9342e9e16fbf9ff9dd3c5d73143ff2671a4c
[ "MIT" ]
null
null
null
setup.py
DevAI-64/class_generator
364a9342e9e16fbf9ff9dd3c5d73143ff2671a4c
[ "MIT" ]
null
null
null
setup.py
DevAI-64/class_generator
364a9342e9e16fbf9ff9dd3c5d73143ff2671a4c
[ "MIT" ]
null
null
null
"""For launch setup function.""" from setuptools import setup # type: ignore setup()
18.2
45
0.681319
11
91
5.636364
0.818182
0
0
0
0
0
0
0
0
0
0
0
0.197802
91
4
46
22.75
0.849315
0.43956
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
fffa93d98389f6dc452f79483bc9340b4b2f189d
267
py
Python
pytest_blender/utils.py
didierbroska/pytest-blender
9fd85567cae6595b032363ad4f6f50219e467477
[ "BSD-3-Clause" ]
null
null
null
pytest_blender/utils.py
didierbroska/pytest-blender
9fd85567cae6595b032363ad4f6f50219e467477
[ "BSD-3-Clause" ]
null
null
null
pytest_blender/utils.py
didierbroska/pytest-blender
9fd85567cae6595b032363ad4f6f50219e467477
[ "BSD-3-Clause" ]
null
null
null
import shutil import sys def which_blender_by_os(): """Get the expected Blender executable location by operative system.""" if sys.platform == "darwin": return "Blender" return "blender.exe" if "win" in sys.platform else shutil.which("blender")
26.7
78
0.700375
36
267
5.111111
0.638889
0.130435
0
0
0
0
0
0
0
0
0
0
0.191011
267
9
79
29.666667
0.851852
0.243446
0
0
0
0
0.173469
0
0
0
0
0
0
1
0.166667
true
0
0.333333
0
0.833333
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
fffe1f140606648f3cef1337ea2f350915bfa3d6
97
py
Python
application/contributor/apps.py
sid-7/Pitcher
d2e611c0aa33eb0a171a742d5fe6b2566027eac1
[ "MIT" ]
null
null
null
application/contributor/apps.py
sid-7/Pitcher
d2e611c0aa33eb0a171a742d5fe6b2566027eac1
[ "MIT" ]
8
2021-03-30T13:20:26.000Z
2021-09-22T19:00:35.000Z
application/contributor/apps.py
sid-7/Pitcher
d2e611c0aa33eb0a171a742d5fe6b2566027eac1
[ "MIT" ]
null
null
null
from django.apps import AppConfig class ContributorConfig(AppConfig): name = 'contributor'
16.166667
35
0.773196
10
97
7.5
0.9
0
0
0
0
0
0
0
0
0
0
0
0.154639
97
5
36
19.4
0.914634
0
0
0
0
0
0.113402
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
080052522814e4d216b754d428986c90d0447c3a
34
py
Python
custom_components/google_coral/__init__.py
robmarkcole/HASS-Google-Coral
f6e002f54ed8576d632966f6aa8bed449b55f16d
[ "MIT" ]
24
2019-05-25T13:15:56.000Z
2021-01-21T18:11:51.000Z
custom_components/google_coral/__init__.py
robmarkcole/HASS-Google-Coral
f6e002f54ed8576d632966f6aa8bed449b55f16d
[ "MIT" ]
5
2019-05-26T13:41:33.000Z
2019-07-16T03:44:24.000Z
custom_components/google_coral/__init__.py
robmarkcole/HASS-Google-Coral
f6e002f54ed8576d632966f6aa8bed449b55f16d
[ "MIT" ]
5
2019-06-04T08:45:38.000Z
2021-07-30T18:57:34.000Z
"""The Google Coral component."""
17
33
0.676471
4
34
5.75
1
0
0
0
0
0
0
0
0
0
0
0
0.117647
34
1
34
34
0.766667
0.794118
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
08138e27474e66b5810b4b252a33adee270963de
87
py
Python
Django/ballon/apps.py
ballon3/GRAD
c630e32272fe34ead590c04d8360169e02be87f1
[ "MIT" ]
null
null
null
Django/ballon/apps.py
ballon3/GRAD
c630e32272fe34ead590c04d8360169e02be87f1
[ "MIT" ]
null
null
null
Django/ballon/apps.py
ballon3/GRAD
c630e32272fe34ead590c04d8360169e02be87f1
[ "MIT" ]
null
null
null
from django.apps import AppConfig class BallonConfig(AppConfig): name = 'ballon'
14.5
33
0.747126
10
87
6.5
0.9
0
0
0
0
0
0
0
0
0
0
0
0.172414
87
5
34
17.4
0.902778
0
0
0
0
0
0.068966
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
083b71b45a1570d6d20b93f68d943467dd26731b
252
py
Python
checkmate/properties.py
CheckMateIO/checkmate_python
2c81a53156d527ceaeaec3d00e3f2cb75163d9f2
[ "MIT" ]
1
2015-08-03T21:02:48.000Z
2015-08-03T21:02:48.000Z
checkmate/properties.py
CheckMateIO/checkmate_python
2c81a53156d527ceaeaec3d00e3f2cb75163d9f2
[ "MIT" ]
null
null
null
checkmate/properties.py
CheckMateIO/checkmate_python
2c81a53156d527ceaeaec3d00e3f2cb75163d9f2
[ "MIT" ]
null
null
null
class Properties: def __init__(self, client): self.client = client def search(self, params={}): url = '/properties' property_params = {'property': params} return self.client.request('GET', url, property_params)
28
63
0.623016
27
252
5.592593
0.481481
0.198676
0
0
0
0
0
0
0
0
0
0
0.25
252
8
64
31.5
0.798942
0
0
0
0
0
0.087302
0
0
0
0
0
0
1
0.285714
false
0
0
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
1
0
0
0
0
1
0
0
4
084eae69258806027e942daa75e99c94fb0c91ec
464
py
Python
Program/installer.py
callmemark/StarGuard
368172cf87315db4e7d8b9fe3fb8c6bde400e977
[ "MIT" ]
null
null
null
Program/installer.py
callmemark/StarGuard
368172cf87315db4e7d8b9fe3fb8c6bde400e977
[ "MIT" ]
null
null
null
Program/installer.py
callmemark/StarGuard
368172cf87315db4e7d8b9fe3fb8c6bde400e977
[ "MIT" ]
null
null
null
import os def install_dependecies(): print("install will begin...") try: os.system("pip install numpy") os.system("pip install pip install sklearn") os.system("pip install matplotlib") os.system("pip install scikit-image") os.system("pip install opencv-python") os.system("pip install pandas") os.system("pip install Pillow") except Exception as error: print("error while downloading: " + str(error)) install_dependecies()
24.421053
50
0.693966
61
464
5.245902
0.442623
0.25
0.240625
0.39375
0
0
0
0
0
0
0
0
0.178879
464
19
51
24.421053
0.839895
0
0
0
0
0
0.449664
0
0
0
0
0
0
1
0.071429
true
0
0.071429
0
0.142857
0.142857
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
1
0
0
0
0
0
0
4
f23472b74181239a2f31ae25049dbf381dc7e967
846
py
Python
venv/Lib/site-packages/PyOpenGL-3.0.1/OpenGL/GL/SGIX/tag_sample_buffer.py
temelkirci/Motion_Editor
a8b8d4c4d2dcc9be28385600f56066cef92a38ad
[ "MIT" ]
1
2022-03-02T17:07:20.000Z
2022-03-02T17:07:20.000Z
venv/Lib/site-packages/PyOpenGL-3.0.1/OpenGL/GL/SGIX/tag_sample_buffer.py
temelkirci/RealTime_6DOF_Motion_Editor
a8b8d4c4d2dcc9be28385600f56066cef92a38ad
[ "MIT" ]
null
null
null
venv/Lib/site-packages/PyOpenGL-3.0.1/OpenGL/GL/SGIX/tag_sample_buffer.py
temelkirci/RealTime_6DOF_Motion_Editor
a8b8d4c4d2dcc9be28385600f56066cef92a38ad
[ "MIT" ]
null
null
null
'''OpenGL extension SGIX.tag_sample_buffer This module customises the behaviour of the OpenGL.raw.GL.SGIX.tag_sample_buffer to provide a more Python-friendly API Overview (from the spec) The extensions defines a special purpose fast multisample clear. This clear can be used with some restrictions as a significantly faster alternative to Clear(DEPTH_BUFFER_BIT). The extension is based on the RealityEngine architecture and will probably never be supported by any other architecture. The official definition of this extension is available here: http://www.opengl.org/registry/specs/SGIX/tag_sample_buffer.txt ''' from OpenGL import platform, constants, constant, arrays from OpenGL import extensions, wrapper from OpenGL.GL import glget import ctypes from OpenGL.raw.GL.SGIX.tag_sample_buffer import * ### END AUTOGENERATED SECTION
35.25
66
0.815603
127
846
5.354331
0.606299
0.041176
0.076471
0.111765
0.088235
0.088235
0.088235
0
0
0
0
0
0.13357
846
24
67
35.25
0.927694
0.822695
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
f26c9f4efa86c464898503edce2af3e178d2d8be
55
py
Python
logic.py
tomaszFijalkowski/poker-player-vistula-python
e380b14c921202c35148d1584080d7d43f0707a9
[ "MIT" ]
null
null
null
logic.py
tomaszFijalkowski/poker-player-vistula-python
e380b14c921202c35148d1584080d7d43f0707a9
[ "MIT" ]
null
null
null
logic.py
tomaszFijalkowski/poker-player-vistula-python
e380b14c921202c35148d1584080d7d43f0707a9
[ "MIT" ]
null
null
null
def join(player, game_state): print("TEST", player)
27.5
29
0.690909
8
55
4.625
0.875
0
0
0
0
0
0
0
0
0
0
0
0.145455
55
2
30
27.5
0.787234
0
0
0
0
0
0.071429
0
0
0
0
0
0
1
0.5
false
0
0
0
0.5
0.5
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
1
0
4
4b494287287809efcda75b2c9c31f41bed28d854
65
py
Python
Python/multi.py
asmeeta2074/Hello-world
c09896839560cc1f2c8f8d48b6f7942352e3e123
[ "MIT" ]
null
null
null
Python/multi.py
asmeeta2074/Hello-world
c09896839560cc1f2c8f8d48b6f7942352e3e123
[ "MIT" ]
null
null
null
Python/multi.py
asmeeta2074/Hello-world
c09896839560cc1f2c8f8d48b6f7942352e3e123
[ "MIT" ]
null
null
null
x=int(input("enter x1")) y=int(input("enter x2")) c=x*y print(c)
13
24
0.630769
15
65
2.733333
0.6
0.390244
0.634146
0
0
0
0
0
0
0
0
0.033898
0.092308
65
4
25
16.25
0.661017
0
0
0
0
0
0.246154
0
0
0
0
0
0
1
0
false
0
0
0
0
0.25
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
4b5622ba0d951dd5f65fda39d976b6af563b1565
57
py
Python
09-comprehensions/03_nested_comp.py
saidulislam/Functional-Programming-in-Python
27ae205f9cf0fa38e16e29089cf72981f8a51a78
[ "Apache-2.0" ]
null
null
null
09-comprehensions/03_nested_comp.py
saidulislam/Functional-Programming-in-Python
27ae205f9cf0fa38e16e29089cf72981f8a51a78
[ "Apache-2.0" ]
null
null
null
09-comprehensions/03_nested_comp.py
saidulislam/Functional-Programming-in-Python
27ae205f9cf0fa38e16e29089cf72981f8a51a78
[ "Apache-2.0" ]
null
null
null
a = [[x for x in range(3)] for y in range(4)] print(a)
19
46
0.561404
14
57
2.285714
0.642857
0.4375
0
0
0
0
0
0
0
0
0
0.046512
0.245614
57
3
47
19
0.697674
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
4
4ba8eb3771784139cbc91effc816890789558781
2,078
py
Python
z2/part3/updated_part2_batch/jm/parser_errors_2/868673657.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/868673657.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/868673657.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: 868673657 """ """ random actions, total chaos """ board = gamma_new(2, 4, 2, 1) assert board is not None assert gamma_move(board, 1, 1, 0) == 1 assert gamma_move(board, 2, 2, 1) == 0 assert gamma_move(board, 2, 0, 0) == 1 assert gamma_move(board, 1, 1, 0) == 0 assert gamma_move(board, 1, 0, 3) == 0 assert gamma_golden_possible(board, 1) == 1 board534950584 = gamma_board(board) assert board534950584 is not None assert board534950584 == ("..\n" "..\n" "..\n" "21\n") del board534950584 board534950584 = None assert gamma_move(board, 2, 2, 0) == 0 assert gamma_move(board, 1, 1, 3) == 0 assert gamma_move(board, 1, 0, 0) == 0 assert gamma_free_fields(board, 2) == 1 assert gamma_move(board, 1, 1, 1) == 1 assert gamma_move(board, 2, 1, 3) == 0 assert gamma_move(board, 2, 1, 2) == 0 board574240617 = gamma_board(board) assert board574240617 is not None assert board574240617 == ("..\n" "..\n" ".1\n" "21\n") del board574240617 board574240617 = None assert gamma_move(board, 1, 1, 3) == 0 assert gamma_move(board, 1, 0, 1) == 1 assert gamma_move(board, 2, 3, 1) == 0 assert gamma_move(board, 2, 1, 2) == 0 assert gamma_free_fields(board, 2) == 0 assert gamma_move(board, 1, 2, 1) == 0 assert gamma_move(board, 2, 2, 1) == 0 assert gamma_move(board, 2, 1, 3) == 0 assert gamma_golden_move(board, 2, 1, 0) == 1 assert gamma_move(board, 1, 2, 1) == 0 assert gamma_move(board, 1, 1, 3) == 0 assert gamma_busy_fields(board, 1) == 2 assert gamma_move(board, 2, 2, 1) == 0 board471905426 = gamma_board(board) assert board471905426 is not None assert board471905426 == ("..\n" "..\n" "11\n" "22\n") del board471905426 board471905426 = None assert gamma_move(board, 1, 3, 0) == 0 assert gamma_move(board, 1, 0, 1) == 0 assert gamma_golden_possible(board, 1) == 1 assert gamma_move(board, 2, 3, 0) == 0 gamma_delete(board)
24.162791
46
0.673725
346
2,078
3.887283
0.109827
0.245353
0.267658
0.356877
0.548699
0.54052
0.504833
0.400743
0.262454
0.234201
0
0.156909
0.178056
2,078
85
47
24.447059
0.630562
0
0
0.298507
0
0
0.024121
0
0
0
0
0
0.552239
1
0
false
0
0.014925
0
0.014925
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
4bbdf76974eb72ca2e8ce2a3bcf0e3ea170dbecb
85
py
Python
myFuns/myFuns.py
ryanelandt/throwAwayPython
bac6d9e63e702f38fa6c363de800595455d713fa
[ "MIT" ]
null
null
null
myFuns/myFuns.py
ryanelandt/throwAwayPython
bac6d9e63e702f38fa6c363de800595455d713fa
[ "MIT" ]
null
null
null
myFuns/myFuns.py
ryanelandt/throwAwayPython
bac6d9e63e702f38fa6c363de800595455d713fa
[ "MIT" ]
null
null
null
def add_numbers(a, b): return a + b def two_n_plus_one(a): return 2 * a + 1
14.166667
22
0.6
18
85
2.611111
0.666667
0.085106
0
0
0
0
0
0
0
0
0
0.032787
0.282353
85
6
23
14.166667
0.737705
0
0
0
0
0
0
0
0
0
0
0
0
1
0.5
false
0
0
0.5
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
4
4bbfc1a05a94c518530fdae6df18c533fff8ef86
156
py
Python
replace_str.py
Pseudopode/replace_txt
5c0c0a4b537d78eea1f6b23a66770ea74f4122eb
[ "MIT" ]
null
null
null
replace_str.py
Pseudopode/replace_txt
5c0c0a4b537d78eea1f6b23a66770ea74f4122eb
[ "MIT" ]
null
null
null
replace_str.py
Pseudopode/replace_txt
5c0c0a4b537d78eea1f6b23a66770ea74f4122eb
[ "MIT" ]
null
null
null
import sys oldtext = open(sys.argv[1]).read() oldtext = oldtext.replace(sys.argv[3], sys.argv[4]) f2 = open(sys.argv[2], 'w') f2.write(oldtext) f2.close()
19.5
51
0.673077
28
156
3.75
0.535714
0.266667
0.209524
0
0
0
0
0
0
0
0
0.05
0.102564
156
8
52
19.5
0.7
0
0
0
0
0
0.006369
0
0
0
0
0
0
1
0
false
0
0.166667
0
0.166667
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
2997010a08aa5899000e4ea307af4fe78e1de4b8
71
py
Python
tftk/loss/__init__.py
kitfactory/tftk
5cae0a96b99eecb6f64922068c162f973eebba71
[ "MIT" ]
6
2020-03-09T00:18:08.000Z
2021-11-08T09:27:19.000Z
tftk/loss/__init__.py
kitfactory/tftk
5cae0a96b99eecb6f64922068c162f973eebba71
[ "MIT" ]
2
2022-02-10T07:34:22.000Z
2022-03-12T01:10:05.000Z
tftk/loss/__init__.py
kitfactory/tftk
5cae0a96b99eecb6f64922068c162f973eebba71
[ "MIT" ]
null
null
null
from . loss import ssim_color_loss __all__ = [ 'ssim_color_loss' ]
14.2
34
0.71831
10
71
4.3
0.6
0.418605
0.604651
0
0
0
0
0
0
0
0
0
0.197183
71
5
35
14.2
0.754386
0
0
0
0
0
0.208333
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
29e058de20c7662ca19753e482270b5f9a1b408a
168
py
Python
search/apps.py
kimyou7/ParkGoGreen
a0b21210823d711af56d76226919950aa01a2b92
[ "MIT" ]
null
null
null
search/apps.py
kimyou7/ParkGoGreen
a0b21210823d711af56d76226919950aa01a2b92
[ "MIT" ]
null
null
null
search/apps.py
kimyou7/ParkGoGreen
a0b21210823d711af56d76226919950aa01a2b92
[ "MIT" ]
null
null
null
""" List of applications, each one has its own urls, views, templates, etc. """ from django.apps import AppConfig class SearchConfig(AppConfig): name = 'search'
16.8
71
0.714286
22
168
5.454545
0.954545
0
0
0
0
0
0
0
0
0
0
0
0.178571
168
9
72
18.666667
0.869565
0.422619
0
0
0
0
0.067416
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
29fe11b2f67275688c8a087de5db462ae1d5285b
82
py
Python
bangoo/__init__.py
slapec/bangoo
34facf122f15943a4368d5c2f45fe178ff01edaa
[ "MIT" ]
null
null
null
bangoo/__init__.py
slapec/bangoo
34facf122f15943a4368d5c2f45fe178ff01edaa
[ "MIT" ]
null
null
null
bangoo/__init__.py
slapec/bangoo
34facf122f15943a4368d5c2f45fe178ff01edaa
[ "MIT" ]
null
null
null
import pkg_resources pkg_resources.declare_namespace(__name__) __version__ = '2'
16.4
41
0.841463
10
82
5.8
0.8
0.413793
0
0
0
0
0
0
0
0
0
0.013333
0.085366
82
4
42
20.5
0.76
0
0
0
0
0
0.012195
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
4b025d2b8b8b99766a95586617670fad3c629eff
235
py
Python
crunchyroll/subtitles.py
architdate/animedl
08157b303511895f7d53897aecbfdd1e5657723d
[ "MIT" ]
8
2020-05-04T05:26:59.000Z
2021-12-12T09:00:39.000Z
crunchyroll/subtitles.py
architdate/animedl
08157b303511895f7d53897aecbfdd1e5657723d
[ "MIT" ]
2
2020-07-10T18:15:08.000Z
2021-09-09T12:12:07.000Z
crunchyroll/subtitles.py
architdate/animedl
08157b303511895f7d53897aecbfdd1e5657723d
[ "MIT" ]
2
2021-03-26T02:25:13.000Z
2021-06-01T17:00:56.000Z
import requests, json def get_subs(page): metadata = get_metadata(page) return metadata['subtitles'] def get_metadata(page): meta = page.text.split('vilos.config.media = ')[1].split(';\n\n')[0] return json.loads(meta)
26.111111
72
0.680851
34
235
4.617647
0.588235
0.076433
0.191083
0
0
0
0
0
0
0
0
0.01005
0.153191
235
9
73
26.111111
0.778894
0
0
0
0
0
0.148305
0
0
0
0
0
0
1
0.285714
false
0
0.142857
0
0.714286
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
4b0e5c83098cfa6da6f066a5d383075a71ddcbb2
232
py
Python
mirumon/cli/helpers.py
mirumon/mirumon-windows-client
8d21726288478174467a436fe94e1c1831bda9e7
[ "MIT" ]
1
2021-09-15T09:17:32.000Z
2021-09-15T09:17:32.000Z
mirumon/cli/helpers.py
mirumon/mirumon-windows-client
8d21726288478174467a436fe94e1c1831bda9e7
[ "MIT" ]
6
2019-09-14T18:15:19.000Z
2019-12-03T22:27:45.000Z
mirumon/cli/helpers.py
mirumon/mirumon-win-client
8d21726288478174467a436fe94e1c1831bda9e7
[ "MIT" ]
null
null
null
import os import pathlib def current_dir() -> pathlib.Path: return pathlib.Path(os.getcwd()) def create_logs_dir() -> pathlib.Path: logs_dir = current_dir() / "logs" logs_dir.mkdir(exist_ok=True) return logs_dir
17.846154
38
0.698276
34
232
4.529412
0.441176
0.181818
0.181818
0
0
0
0
0
0
0
0
0
0.181034
232
12
39
19.333333
0.810526
0
0
0
0
0
0.017241
0
0
0
0
0
0
1
0.25
false
0
0.25
0.125
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
0
0
0
1
1
0
0
4
d99b5311b3925b110fa3c1ab742b53732bcc060c
61
py
Python
Raw_Data/Demand.py
LuShuixiu/Symbolic_Dynamics
9d12c18762887c6c5cb69e82763911d82d0c5c45
[ "MIT" ]
null
null
null
Raw_Data/Demand.py
LuShuixiu/Symbolic_Dynamics
9d12c18762887c6c5cb69e82763911d82d0c5c45
[ "MIT" ]
null
null
null
Raw_Data/Demand.py
LuShuixiu/Symbolic_Dynamics
9d12c18762887c6c5cb69e82763911d82d0c5c45
[ "MIT" ]
null
null
null
#### This code is to have a demand signal from transcations.
30.5
60
0.737705
10
61
4.5
1
0
0
0
0
0
0
0
0
0
0
0
0.180328
61
1
61
61
0.9
0.901639
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
d9a0fdac69447773cfb21a4eaea36e4521a39b63
1,093
py
Python
operations/fleet_management/migrations/0062_auto_20180710_1525.py
kaizer88/emps
2669b32c46befcf1a19390fb25013817e6b00980
[ "MIT" ]
null
null
null
operations/fleet_management/migrations/0062_auto_20180710_1525.py
kaizer88/emps
2669b32c46befcf1a19390fb25013817e6b00980
[ "MIT" ]
null
null
null
operations/fleet_management/migrations/0062_auto_20180710_1525.py
kaizer88/emps
2669b32c46befcf1a19390fb25013817e6b00980
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # Generated by Django 1.11.7 on 2018-07-10 13:25 from __future__ import unicode_literals from django.db import migrations from fleet_management.models import InsuranceClaimDocumentTypes def populate_upload_types(apps, schema_editor): upload = InsuranceClaimDocumentTypes.objects.get_or_create(description="Affidavit") upload = InsuranceClaimDocumentTypes.objects.get_or_create(description="Police Report") upload = InsuranceClaimDocumentTypes.objects.get_or_create(description="Drivers Licence") upload = InsuranceClaimDocumentTypes.objects.get_or_create(description="Claim Form") upload = InsuranceClaimDocumentTypes.objects.get_or_create(description="Pictures of Damage") upload = InsuranceClaimDocumentTypes.objects.get_or_create(description="Quotation") upload = InsuranceClaimDocumentTypes.objects.get_or_create(description="Incident and Accident Report") class Migration(migrations.Migration): dependencies = [ ('fleet_management', '0061_auto_20180710_1514'), ] operations = [ migrations.RunPython(populate_upload_types) ]
43.72
103
0.809698
119
1,093
7.193277
0.512605
0.26986
0.327103
0.351636
0.507009
0.507009
0.507009
0
0
0
0
0.033571
0.10064
1,093
24
104
45.541667
0.837233
0.062214
0
0
1
0
0.137965
0.022505
0
0
0
0
0
1
0.055556
false
0
0.166667
0
0.388889
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
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
d9c92146b3539871dc0076bc74ec5403e880a97a
87
py
Python
src/worker/apps.py
brandongallagher1999/Django_CRUD
e7da7c7c63f26e59804a578f1ba5d9562753805f
[ "bzip2-1.0.6" ]
1
2020-09-16T22:54:33.000Z
2020-09-16T22:54:33.000Z
src/worker/apps.py
brandongallagher1999/Django_CRUD
e7da7c7c63f26e59804a578f1ba5d9562753805f
[ "bzip2-1.0.6" ]
4
2022-01-29T09:56:29.000Z
2022-01-29T09:57:52.000Z
src/django/worker/apps.py
PascalSun/FullStackDemo
c08cf127cabc804970e54e0fa0035a4d66d3e464
[ "MIT" ]
1
2020-11-04T17:43:32.000Z
2020-11-04T17:43:32.000Z
from django.apps import AppConfig class WorkerConfig(AppConfig): name = 'worker'
14.5
33
0.747126
10
87
6.5
0.9
0
0
0
0
0
0
0
0
0
0
0
0.172414
87
5
34
17.4
0.902778
0
0
0
0
0
0.068966
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
d9f79a8dada31cc74060a9b5630df9207dd50c0a
191
py
Python
chat/apps.py
KraftSoft/letsgo-back
24159eee1a510e9ae218a0262bc6a51618414b33
[ "BSD-3-Clause" ]
1
2018-02-17T08:46:11.000Z
2018-02-17T08:46:11.000Z
chat/apps.py
KraftSoft/letsgo-back
24159eee1a510e9ae218a0262bc6a51618414b33
[ "BSD-3-Clause" ]
null
null
null
chat/apps.py
KraftSoft/letsgo-back
24159eee1a510e9ae218a0262bc6a51618414b33
[ "BSD-3-Clause" ]
null
null
null
from django.apps import AppConfig class ChatConfig(AppConfig): name = 'chat' verbose_name = "Chat" def ready(self): from chat.signals.handlers import add_to_chat #noqa
21.222222
60
0.696335
25
191
5.2
0.72
0.123077
0
0
0
0
0
0
0
0
0
0
0.219895
191
9
60
21.222222
0.872483
0.020942
0
0
0
0
0.042781
0
0
0
0
0
0
1
0.166667
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
d9fbb3024960402537620913284e86310524a0c9
1,183
py
Python
app/tests/test_sources.py
Samuel-Muriuki/News_Api
b875133bb39006a27b500d5b79857479baa851dc
[ "Unlicense" ]
null
null
null
app/tests/test_sources.py
Samuel-Muriuki/News_Api
b875133bb39006a27b500d5b79857479baa851dc
[ "Unlicense" ]
null
null
null
app/tests/test_sources.py
Samuel-Muriuki/News_Api
b875133bb39006a27b500d5b79857479baa851dc
[ "Unlicense" ]
null
null
null
import unittest from app.models import Sources class SourceTest(unittest.TestCase): ''' Test Class to test the behaviour of the Source class ''' def setUp(self): ''' Set up method that will run before every Test ''' self.new_source = Sources('The New York Times','Sports',"In an attempt to revive flagging interest in women's badminton as the 2012 London Olympics approach, officials governing the sport have decided that its female athletes need to appear more, how to put it, womanly.", " To create a more “attractive presentation,” the Badminton World Federation has decreed that women must wear skirts or dresses to play at the elite level, beginning Wednesday. ",'2016-03-01T15:43:26Z','https://www.nytimes.com/2011/05/27/sports/badminton-dress-code-for-women-criticized-as-sexist.html','https://static01.nyt.com/images/2011/05/27/sports/BADMINTON/BADMINTON-jumbo.jpg?quality=75&auto=webp',"Badminton's New Dress Code Is Being Criticized as Sexist") def test_instance(self): ''' Test to check creation of new article Source instance ''' self.assertTrue(isinstance(self.new_source,Sources))
56.333333
746
0.724429
174
1,183
4.908046
0.649425
0.016393
0.030445
0.046838
0.053864
0
0
0
0
0
0
0.039135
0.179205
1,183
20
747
59.15
0.840371
0.128487
0
0
0
0.571429
0.709711
0
0
0
0
0
0.142857
1
0.285714
false
0
0.285714
0
0.714286
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
d9fdb6853871e8eb76443f36ae141525cab01bc1
126
py
Python
conbench/extensions.py
jonkeane/conbench
f096cc2f8b7a85d8e9aea32d8310127cf1923212
[ "MIT" ]
48
2020-03-02T16:55:46.000Z
2022-02-26T00:35:57.000Z
conbench/extensions.py
jonkeane/conbench
f096cc2f8b7a85d8e9aea32d8310127cf1923212
[ "MIT" ]
103
2020-03-23T00:22:46.000Z
2022-03-31T22:34:40.000Z
conbench/extensions.py
jonkeane/conbench
f096cc2f8b7a85d8e9aea32d8310127cf1923212
[ "MIT" ]
6
2020-03-04T17:52:35.000Z
2022-03-30T11:53:40.000Z
import flask_bootstrap import flask_login login_manager = flask_login.LoginManager() bootstrap = flask_bootstrap.Bootstrap()
21
42
0.849206
15
126
6.8
0.4
0.215686
0
0
0
0
0
0
0
0
0
0
0.087302
126
5
43
25.2
0.886957
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
8ab9d4b856aad79c15ae92ba8650d08453489647
96
py
Python
conference/apps.py
LilJohny/Conference
f4422e3cb4cc446263090b03bd46dca9b6f945b3
[ "MIT" ]
null
null
null
conference/apps.py
LilJohny/Conference
f4422e3cb4cc446263090b03bd46dca9b6f945b3
[ "MIT" ]
6
2020-02-12T00:48:45.000Z
2021-06-10T18:22:25.000Z
conference/apps.py
LilJohny/Conference
f4422e3cb4cc446263090b03bd46dca9b6f945b3
[ "MIT" ]
null
null
null
from django.apps import AppConfig class ConferencesConfig(AppConfig): name = 'conference'
16
35
0.770833
10
96
7.4
0.9
0
0
0
0
0
0
0
0
0
0
0
0.15625
96
5
36
19.2
0.91358
0
0
0
0
0
0.104167
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
8acee7ba3c75976703c5973431ca8951d968c186
208
py
Python
aioinflux/__init__.py
AndyBryson/aioinflux
578bd8f05a5232e8a7d75d4b40a9f25c17f61487
[ "MIT" ]
120
2018-08-12T11:07:48.000Z
2022-03-28T10:09:23.000Z
aioinflux/__init__.py
AndyBryson/aioinflux
578bd8f05a5232e8a7d75d4b40a9f25c17f61487
[ "MIT" ]
26
2018-08-31T13:26:21.000Z
2022-01-25T10:59:23.000Z
aioinflux/__init__.py
next-e/aioinflux
429308865cd423dac8247f68376342cb907cfecc
[ "MIT" ]
26
2018-08-21T20:41:51.000Z
2022-02-22T17:27:52.000Z
# flake8: noqa from . import serialization from .client import InfluxDBClient, InfluxDBError, InfluxDBWriteError from .iterutils import iterpoints from .serialization.usertype import * __version__ = '0.9.0'
26
69
0.807692
23
208
7.130435
0.652174
0
0
0
0
0
0
0
0
0
0
0.021858
0.120192
208
7
70
29.714286
0.874317
0.057692
0
0
0
0
0.025773
0
0
0
0
0
0
1
0
false
0
0.8
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
76f8afc18b3e3219805e64e0e200623aca7f50cb
13,891
py
Python
tests/functional/test_incidents.py
fbi-cde/crime-data-api
3370f906be18f08b0b5bd2e3079ae79af90da472
[ "CC0-1.0" ]
43
2018-07-23T00:19:48.000Z
2022-01-07T18:07:00.000Z
tests/functional/test_incidents.py
harrisj/crime-data-api
9b49b5cc3cd8309dda888f49356ee5168c43851a
[ "CC0-1.0" ]
3
2018-02-27T14:15:35.000Z
2018-07-24T14:05:06.000Z
tests/functional/test_incidents.py
harrisj/crime-data-api
9b49b5cc3cd8309dda888f49356ee5168c43851a
[ "CC0-1.0" ]
12
2018-01-18T21:15:34.000Z
2022-02-17T10:09:40.000Z
# -*- coding: utf-8 -*- """Functional tests using WebTest. See: http://webtest.readthedocs.org/ """ import pytest from crime_data.common.newmodels import NibrsIncidentRepresentation from crime_data.common.models import db from crime_data.common.base import ExplorerOffenseMapping from flex.core import validate_api_call # class TestIncidentsEndpoint: # def test_incidents_endpoint_exists(self, testapp): # res = testapp.get('/incidents/') # assert res.status_code == 200 # def test_incidents_endpoint_includes_metadata(self, testapp): # res = testapp.get('/incidents/') # assert 'pagination' in res.json # def test_incidents_endpoint_returns_incidents(self, testapp): # res = testapp.get('/incidents/') # assert len(res.json['results']) > 0 # assert 'incident_id' in res.json['results'][0] # def test_incidents_endpoint_includes_offenses(self, testapp): # res = testapp.get('/incidents/') # for incident in res.json['results']: # assert 'offenses' in incident # if incident['offenses'] is not None: # for offense in incident['offenses']: # assert 'offense_type' in offense # assert 'offense_name' in offense['offense_type'] # def test_incidents_endpoint_includes_ori(self, testapp): # res = testapp.get('/incidents/') # for incident in res.json['results']: # assert 'agency' in incident # assert 'ori' in incident['agency'] # @pytest.mark.xfail # def test_incidents_endpoint_includes_counties(self, testapp): # res = testapp.get('/incidents/') # for incident in res.json['results']: # agency = incident['agency'] # assert 'counties' in agency # def test_incidents_endpoint_includes_locations(self, testapp): # res = testapp.get('/incidents/') # for incident in res.json['results']: # assert 'offenses' in incident # if incident['offenses'] is not None: # for offense in incident['offenses']: # assert 'location' in offense # assert 'location_name' in offense['location'] # def test_incidents_endpoint_filters_offense_code(self, testapp): # res = testapp.get('/incidents/?offense_code=35A') # for incident in res.json['results']: # assert 'offenses' in incident # hits = [o for o in incident['offenses'] # if o['offense_type']['offense_code'] == '35A'] # assert len(hits) > 0 # def test_incidents_endpoint_filters_method_entry_code(self, testapp): # res = testapp.get('/incidents/?method_entry_code=N') # for incident in res.json['results']: # assert 'offenses' in incident # hits = [o for o in incident['offenses'] # if o['method_entry_code'] == 'N'] # assert len(hits) > 0 # def test_incidents_endpoint_filters_offense_code_plus_method_entry_code( # self, testapp): # res = testapp.get('/incidents/?offense_code=220&method_entry_code=F') # for incident in res.json['results']: # assert 'offenses' in incident # hits = [o for o in incident['offenses'] # if o['offense_type']['offense_code'] == '220' and o[ # 'method_entry_code'] == 'F'] # assert len(hits) > 0 # def test_incidents_endpoint_filters_location_code(self, testapp): # res = testapp.get('/incidents/?location_code=22') # for incident in res.json['results']: # assert 'offenses' in incident # if incident['offenses'] is not None: # hits = [o for o in incident['offenses'] # if o['location']['location_code'] == '22'] # assert len(hits) > 0 # def test_incidents_endpoint_filters_location_code_plus_offense_code( # self, testapp): # res = testapp.get('/incidents/?location_code=22&offense_code=13C') # for incident in res.json['results']: # assert 'offenses' in incident # hits = [o for o in incident['offenses'] # if o['location']['location_code'] == '22' # if o['offense_type']['offense_code'] == '13C'] # assert len(hits) > 0 # @pytest.mark.xfail # TODO # def test_incidents_endpoint_filters_offense_name_case_insensitive( # self, testapp): # res0 = testapp.get('/incidents/?offense_name=Intimidation') # assert len(res0.json['results']) > 0 # res1 = testapp.get('/incidents/?offense_name=intimidation') # assert len(res1.json['results']) == len(res0.json) # @pytest.mark.xfail # TODO # def test_incidents_endpoint_filters_null_method_entry_code(self, # testapp): # res = testapp.get('/incidents/?method_entry_code=None') # assert len(res.json['results']) > 0 # for incident in res.json['results']: # assert 'offenses' in incident # hits = [o for o in incident['offenses'] # if o['method_entry_code'] == 'F'] # assert len(hits) > 0 # def test_instances_endpoint_bad_filter_400s(self, testapp): # res = testapp.get('/incidents/?llamas=angry', expect_errors=True) # assert res.status_code == 400 # assert res.json['message'] == 'field llamas not found' # def test_incidents_endpoint_filter_names_case_insensitive(self, testapp): # res0 = testapp.get('/incidents/?Incident_Hour=22') # assert res0.json['pagination']['count'] > 0 # res1 = testapp.get('/incidents/?incident_hour=22') # assert res0.json['pagination']['count'] == res1.json['pagination']['count'] # def test_incidents_endpoint_filters_incident_hour(self, testapp): # res = testapp.get('/incidents/?incident_hour=22') # assert len(res.json['results']) > 0 # for incident in res.json['results']: # assert incident['incident_hour'] == 22 # def test_incidents_endpoint_filters_incident_hour_greater_than(self, testapp): # res = testapp.get('/incidents/?incident_hour>16') # assert len(res.json['results']) > 0 # for incident in res.json['results']: # assert incident['incident_hour'] > 16 # def test_incidents_endpoint_filters_location_name(self, testapp): # res = testapp.get('/incidents/?location_name=Parking+Lot/Garage') # assert len(res.json['results']) > 0 # for incident in res.json['results']: # assert len(incident['offenses']) > 0 # hits = [o for o in incident['offenses'] if o['location']['location_name'] == 'Parking Lot/Garage'] # assert len(hits) > 0 # def test_incidents_endpoint_filters_victim_race_code(self, testapp): # res = testapp.get('/incidents/?victim.race_code=B') # assert len(res.json['results']) > 0 # for incident in res.json['results']: # assert len(incident['victims']) > 0 # race_codes = [v['race_code'] for v in incident['victims']] # assert 'B' in race_codes # def test_incidents_endpoint_filters_victim_sex_code(self, testapp): # res = testapp.get('/incidents/?victim.sex_code=F') # assert len(res.json['results']) > 0 # for incident in res.json['results']: # assert len(incident['victims']) > 0 # hits = [v for v in incident['victims'] if v['sex_code'] == 'F'] # assert len(hits) > 0 # def test_incidents_endpoint_filters_offender_age_num(self, testapp): # res = testapp.get('/incidents/?offender.age_num>30') # assert len(res.json['results']) > 0 # for incident in res.json['results']: # assert len(incident['offenders']) > 0 # hits = [o for o in incident['offenders'] if o['age_num'] > 30] # assert len(hits) > 0 # def test_incidents_endpoint_filters_arrestee_resident_code(self, testapp): # res = testapp.get('/incidents/?arrestee.resident_code!=R') # assert len(res.json['results']) > 0 # for incident in res.json['results']: # assert len(incident['arrestees']) > 0 # hits = [a for a in incident['arrestees'] if a['resident_code'] != 'R'] # assert len(hits) > 0 # @pytest.mark.xfail # def test_incidents_endpoint_filters_incident_date(self, testapp): # res = testapp.get('/incidents/?incident_date>2014-06-01&incident_date<2014-06-30') # assert len(res.json['results']) > 0 # for incident in res.json['results']: # dt = dateutil.parser.parse(incident['incident_date']) # assert dt > dateutil.parser.parse('2014-06-01T00:00+00:00') # assert dt <= dateutil.parser.parse('2014-07-01T00:00+00:00') # @pytest.mark.xfail # def test_incidents_endpoint_filters_on_multiple_values(self, testapp): # res = testapp.get('/incidents/?victim.race_code=A,I,P') # assert len(res.json['results']) > 0 # for incident in res.json['results']: # races = [v['race']['race_code'] for v in incident['victims']] # assert ('A' in races) or ('I' in races) or ('P' in races) # # # TODO: escaped commas # @pytest.mark.xfail # def test_incidents_endpoint_filters_on_multiple_values_with_brackets(self, testapp): # res = testapp.get('/incidents/?victim.race_code={A,I,P}') # assert len(res.json['results']) > 0 # for incident in res.json['results']: # races = [v['race']['race_code'] for v in incident['victims']] # assert ('A' in races) or ('I' in races) or ('P' in races) # def test_incidents_endpoint_filter_with_spaces(self, testapp): # for category_name in ('Larceny/Theft Offenses', 'Larceny/Theft+Offenses', 'Larceny/Theft%20Offenses'): # res = testapp.get('/incidents/?offense_category_name=' + category_name) # assert len(res.json['results']) > 0 # for incident in res.json['results']: # offense_names = [o['offense_type']['offense_category_name'] for o in incident['offenses']] # assert ('Larceny/Theft Offenses') in offense_names # def test_incidents_endpoint_filter_with_parens(self, testapp): # for population_family_desc in ('City (1-7)', 'City+(1-7)'): # res = testapp.get('/incidents/?population_family_desc=' + population_family_desc) # assert len(res.json['results']) > 0 # for incident in res.json['results']: # assert incident['agency']['population_family']['population_family_desc'] == 'City (1-7)' # def test_incidents_endpoint_filter_state(self, testapp): # results = testapp.get('/incidents/?state=oh') # for incident in results.json['results']: # assert incident['agency']['state']['state_abbr'] == 'OH' # @pytest.mark.xfail # def test_incidents_endpoint_filter_county(self, testapp): # results = testapp.get('/incidents/?county=warren') # for incident in results.json['results']: # county_names = [c['county_name'].lower() for c in incident['agency']['counties']] # assert 'warren' in county_names # # End filter tests # @pytest.mark.xfail # TODO # def test_incidents_endpoint_filters_for_nulls(self, testapp): # pass # @pytest.mark.xfail #TODO: this has messed up the paginator # def test_incidents_paginate(self, testapp): # page1 = testapp.get('/incidents/?page=1') # page2 = testapp.get('/incidents/?page=2') # assert len(page1.json['results']) == 10 # assert len(page2.json['results']) == 10 # assert page2.json['results'][0] not in page1.json['results'] # def test_incidents_pagination_data_in_metadata(self, testapp): # page = testapp.get('/incidents/?page=3&per_page=7') # assert page.json['pagination']['page'] == 3 # assert page.json['pagination']['per_page'] == 7 # assert 'count' in page.json['pagination'] # assert 'pages' in page.json['pagination'] # assert page.json['pagination']['pages'] > 1 # @pytest.mark.xfail # TODO # def test_incidents_pagination_beyond_end_fails_gracefully(self, testapp): # page = testapp.get('/incidents/?state=DE&page=100000&per_page=1000') # assert False # @pytest.mark.xfail #TODO: this has messed up the paginator # def test_incidents_page_size(self, testapp): # res = testapp.get('/incidents/?per_page=5') # assert len(res.json['results']) == 5 # def _single_incident_id(self, testapp): # res = testapp.get('/incidents/') # return res.json['results'][0]['incident_id'] # def test_incidents_endpoint_single_record_works(self, testapp): # id_no = self._single_incident_id(testapp) # res = testapp.get('/incidents/{}/'.format(id_no)) # assert res.status_code == 200 # # def test_incidents_filter_victim_rel(self, testapp): # res = testapp.get('/incidents/?victim.relationship_code=AQ') # assert res.json['results'] # # def test_incidents_filter_weapon(self, testapp): # res = testapp.get('/incidents/?offense.weapon_code=40') # assert res.json['results'] # # def test_instances_filter_criminal_act(self, testapp): # res = testapp.get('/incidents/?offense.criminal_act_code=P') # assert res.json['results'] # # def test_instances_filter_injury(self, testapp): # res = testapp.get('/incidents/?victim.injury_code=N') # assert res.json['results']
47.409556
112
0.611619
1,658
13,891
4.937877
0.127262
0.068523
0.099792
0.088677
0.717479
0.651765
0.574447
0.486503
0.418835
0.359717
0
0.01744
0.248722
13,891
292
113
47.571918
0.767056
0.945
0
0
0
0
0
0
0
0
0
0.003425
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
0a03e6bfb0f1d7bd62b2504961731a3570347df6
67
py
Python
s3_log_query/__init__.py
mikethoun/s3-log-query
f2dc92854cd4162d62358f88eba682fcd18b9811
[ "Apache-2.0" ]
null
null
null
s3_log_query/__init__.py
mikethoun/s3-log-query
f2dc92854cd4162d62358f88eba682fcd18b9811
[ "Apache-2.0" ]
null
null
null
s3_log_query/__init__.py
mikethoun/s3-log-query
f2dc92854cd4162d62358f88eba682fcd18b9811
[ "Apache-2.0" ]
null
null
null
from s3_log_query.S3LogQuery import LogQuery name = "s3_log_query"
22.333333
44
0.835821
11
67
4.727273
0.727273
0.192308
0.384615
0
0
0
0
0
0
0
0
0.05
0.104478
67
3
45
22.333333
0.816667
0
0
0
0
0
0.176471
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
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
0a15e97354b1e34272a96ea1b91211750e769c45
3,946
py
Python
vivisect/symboliks/constraints.py
mubix/vivisect
2900c0bf59838cb9fc398a8668f76f887b7f54e7
[ "ECL-2.0", "Apache-2.0" ]
1
2017-11-12T03:50:06.000Z
2017-11-12T03:50:06.000Z
vivisect/symboliks/constraints.py
mubix/vivisect
2900c0bf59838cb9fc398a8668f76f887b7f54e7
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
vivisect/symboliks/constraints.py
mubix/vivisect
2900c0bf59838cb9fc398a8668f76f887b7f54e7
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
from vivisect.symboliks.common import * class Constraint: ''' A class to represent algebraic constraints that are tracked by a given polynomial. ''' revclass = None operstr = None def __init__(self, v1, v2): self._strval = None self._v1 = v1 self._v2 = v2 # FIXME consider making constraints into operators... # Their APIs and internals are basically the same! def clearCache(self): self._v1.clearCache() self._v2.clearCache() def walkTree(self, cb, ctx=None): self._v1 = self._v1.walkTree(cb, ctx=ctx) self._v2 = self._v2.walkTree(cb, ctx=ctx) def getWidth(self): return self._v1.getWidth() def setSymSolverContext(self, slvctx): self._v1.setSymSolverContext(slvctx) self._v2.setSymSolverContext(slvctx) def __repr__(self): return '%s(%s,%s)' % (self.__class__.__name__, repr(self._v1), repr(self._v2)) def __str__(self): if self._strval: return self._strval self._strval = '%s %s %s' % (str(self._v1), self.operstr, str(self._v2)) return self._strval def render(self, canvas, vw): self._v1.render(canvas, vw) canvas.addText(' ') canvas.addNameText(self.operstr) canvas.addText(' ') self._v2.render(canvas, vw) def __eq__(self, con): ''' Is this constraint the same as some other? ''' if not isinstance(con, Constraint): return False c1v1 = self._v1.solve() c1v2 = self._v2.solve() c2v1 = con._v1.solve() c2v2 = con._v2.solve() if c1v1 == c2v1 and c1v2 == c2v2 and self.__class__ == con.__class__: return True if c1v1 == c2v2 and c1v2 == c2v1 and self.__class__ == con.revclass: return True return False def reverse(self): if self.revclass == None: raise Exception('Constraints Must Define revclass!') return self.revclass(self._v1, self._v2) def reduce(self, emu=None): v1 = self._v1.reduce(emu=emu) v2 = self._v2.reduce(emu=emu) # FIXME transfer discrete values to one side... return self.__class__(v1, v2) def update(self, emu): v1 = self._v1.update(emu) v2 = self._v2.update(emu) return self.__class__(v1, v2) def clone(self): v1 = self._v1.clone() v2 = self._v2.clone() return self.__class__(v1, v2) def prove(self, emu=None,vals=None): v1 = self._v1.solve(emu=emu,vals=vals) v2 = self._v2.solve(emu=emu,vals=vals) return self.testTruth(v1, v2) def solve(self, emu=None, vals=None): # A "solution" for a condition is it's boolean state as int... return int(self.prove(emu=emu,vals=vals)) def testTruth(self, v1, v2): #raise Exception('Constraint %s must implement testTruth!' % self.__class__.__name__) return True def isDiscrete(self, emu=None): return self._v1.isDiscrete(emu=emu) and self._v2.isDiscrete(emu=emu) def opose(c1, c2): c1.revclass = c2 c2.revclass = c1 class eq(Constraint): operstr = '==' def testTruth(self, v1, v2): return v1 == v2 class ne(Constraint): operstr = '!=' def testTruth(self, v1, v2): return v1 != v2 class le(Constraint): operstr = '<=' def testTruth(self, v1, v2): return v1 <= v2 class gt(Constraint): operstr = '>' def testTruth(self, v1, v2): return v1 > v2 class lt(Constraint): operstr = '<' def testTruth(self, v1, v2): return v1 < v2 class ge(Constraint): operstr = '>=' def testTruth(self, v1, v2): return v1 >= v2 class UNK(Constraint): operstr = 'UNK' class NOTUNK(Constraint): operstr = '!UNK' # Create our oposing constraints opose(ne, eq) opose(le, gt) opose(lt, ge) opose(UNK, NOTUNK)
25.960526
93
0.59554
510
3,946
4.423529
0.219608
0.066489
0.028369
0.055851
0.210106
0.167553
0.138298
0.138298
0.138298
0.138298
0
0.038367
0.28003
3,946
151
94
26.13245
0.75572
0.113786
0
0.184466
0
0
0.020017
0
0
0
0
0.013245
0
1
0.23301
false
0
0.009709
0.106796
0.640777
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
1
0
0
0
1
1
0
0
4
0a549b175d1b53169f57e393f1ba9dc6aa77ff4a
67
py
Python
social_auth/backends/contrib/dropbox.py
merutak/django-social-auth
3a6e4414da0e969fcaf625a891852a3b2d7627c0
[ "BSD-2-Clause", "BSD-3-Clause" ]
863
2015-01-01T00:42:07.000Z
2022-03-30T02:47:18.000Z
social_auth/backends/contrib/dropbox.py
merutak/django-social-auth
3a6e4414da0e969fcaf625a891852a3b2d7627c0
[ "BSD-2-Clause", "BSD-3-Clause" ]
101
2015-01-08T00:28:16.000Z
2022-03-07T03:11:19.000Z
social_auth/backends/contrib/dropbox.py
merutak/django-social-auth
3a6e4414da0e969fcaf625a891852a3b2d7627c0
[ "BSD-2-Clause", "BSD-3-Clause" ]
256
2015-01-02T16:55:36.000Z
2022-03-04T11:10:47.000Z
from social.backends.dropbox import DropboxOAuth as DropboxBackend
33.5
66
0.880597
8
67
7.375
1
0
0
0
0
0
0
0
0
0
0
0
0.089552
67
1
67
67
0.967213
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
0a5a5c0d290f767be3442fd164048573a9d00617
150
py
Python
hw_asr/model/__init__.py
sibsonya/asr_project_template
d53a861ed1000adeeaa841aa74244078fe2722f6
[ "MIT" ]
null
null
null
hw_asr/model/__init__.py
sibsonya/asr_project_template
d53a861ed1000adeeaa841aa74244078fe2722f6
[ "MIT" ]
null
null
null
hw_asr/model/__init__.py
sibsonya/asr_project_template
d53a861ed1000adeeaa841aa74244078fe2722f6
[ "MIT" ]
null
null
null
from hw_asr.model.baseline_model import BaselineModel from hw_asr.model.gru_model import GRUModel __all__ = [ "BaselineModel", "GRUModel" ]
16.666667
53
0.76
19
150
5.578947
0.526316
0.113208
0.169811
0.264151
0
0
0
0
0
0
0
0
0.16
150
8
54
18.75
0.84127
0
0
0
0
0
0.14
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
6a5e5f924404e049f02c9a5e2ddeb8f4e9e8eb3b
188
py
Python
src/mbed_tools/project/_internal/templates/__init__.py
cyliangtw/mbed-tools
69c600c0a5ac1eb0d52b481b5ba020da8bb73d33
[ "Apache-2.0" ]
39
2020-04-03T13:52:34.000Z
2022-03-23T13:08:22.000Z
src/mbed_tools/project/_internal/templates/__init__.py
cyliangtw/mbed-tools
69c600c0a5ac1eb0d52b481b5ba020da8bb73d33
[ "Apache-2.0" ]
306
2020-02-06T18:08:43.000Z
2022-03-25T14:50:18.000Z
src/mbed_tools/project/_internal/templates/__init__.py
cyliangtw/mbed-tools
69c600c0a5ac1eb0d52b481b5ba020da8bb73d33
[ "Apache-2.0" ]
23
2020-03-17T11:42:23.000Z
2022-01-30T02:56:18.000Z
# # Copyright (c) 2020-2021 Arm Limited and Contributors. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # """Package containing jinja templates used by mbed_tools.project."""
31.333333
76
0.760638
26
188
5.461538
1
0
0
0
0
0
0
0
0
0
0
0.060606
0.12234
188
5
77
37.6
0.8
0.925532
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
6a61cb2eb8be044323413df100e279dc9f0ae892
82
py
Python
djbver/core/validators/regex.py
springkjw/djbver
671de8090fec885c15ded7a1a8aacc19d544d094
[ "MIT" ]
null
null
null
djbver/core/validators/regex.py
springkjw/djbver
671de8090fec885c15ded7a1a8aacc19d544d094
[ "MIT" ]
5
2021-03-30T13:47:57.000Z
2021-09-22T19:15:26.000Z
djbver/core/validators/regex.py
springkjw/djbver
671de8090fec885c15ded7a1a8aacc19d544d094
[ "MIT" ]
null
null
null
__all__ = [ 'phone_regex' ] phone_regex = r'^010[-\s]??\d{3,4}[-\s]??\d{4}$'
13.666667
48
0.487805
14
82
2.428571
0.642857
0.588235
0
0
0
0
0
0
0
0
0
0.086957
0.158537
82
5
49
16.4
0.405797
0
0
0
0
0
0.512195
0.378049
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
6a831d840c97f920d95eb35ec65888aba8c7f79a
27
py
Python
requirements.py
Mathieu-Lala/ImWindow
9a7f9749bfcbffdb8d867167d03b118abb399b23
[ "MIT" ]
1
2021-06-28T09:37:14.000Z
2021-06-28T09:37:14.000Z
requirements.py
Mathieu-Lala/ImWindow
9a7f9749bfcbffdb8d867167d03b118abb399b23
[ "MIT" ]
null
null
null
requirements.py
Mathieu-Lala/ImWindow
9a7f9749bfcbffdb8d867167d03b118abb399b23
[ "MIT" ]
1
2021-06-28T04:51:18.000Z
2021-06-28T04:51:18.000Z
conan>=1.35 cmakelang>=0.6
9
14
0.703704
6
27
3.166667
1
0
0
0
0
0
0
0
0
0
0
0.2
0.074074
27
2
15
13.5
0.56
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
6a95278535ca1617253d9a6da3719a2f917c5a4d
239
py
Python
eventlet/green/time.py
rutube/eventlet
bdac9e78f691a41a8649536f371fcec7ce28ebf7
[ "MIT" ]
1
2016-03-03T03:15:19.000Z
2016-03-03T03:15:19.000Z
eventlet/green/time.py
Transisto/bitHopper
b4a946843b340c0b90c30f60aa15976002cf686e
[ "MIT" ]
null
null
null
eventlet/green/time.py
Transisto/bitHopper
b4a946843b340c0b90c30f60aa15976002cf686e
[ "MIT" ]
2
2017-04-15T06:59:51.000Z
2021-03-15T18:20:23.000Z
__time = __import__('time') from eventlet.patcher import slurp_properties __patched__ = ['sleep'] slurp_properties(__time, globals(), ignore=__patched__, srckeys=dir(__time)) from eventlet.greenthread import sleep sleep # silence pyflakes
34.142857
76
0.807531
28
239
6.178571
0.571429
0.092486
0.184971
0
0
0
0
0
0
0
0
0
0.09205
239
6
77
39.833333
0.797235
0.066946
0
0
0
0
0.040724
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
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
6aa0104db2f8a302bd23636de22825cf31fe9f0c
206
py
Python
python/code_challenges/reverse_linked_list.py
YazanAhmad18/data-structures-and-algorithms
2032a3ef8718a0f0ef8d9e90785e8553160a2f56
[ "MIT" ]
null
null
null
python/code_challenges/reverse_linked_list.py
YazanAhmad18/data-structures-and-algorithms
2032a3ef8718a0f0ef8d9e90785e8553160a2f56
[ "MIT" ]
null
null
null
python/code_challenges/reverse_linked_list.py
YazanAhmad18/data-structures-and-algorithms
2032a3ef8718a0f0ef8d9e90785e8553160a2f56
[ "MIT" ]
null
null
null
def reverse_list(ll): """Reverses a linked list Args: ll: linked list Returns: linked list in reversed form """ # put your function implementation here return ll
17.166667
43
0.601942
25
206
4.92
0.72
0.243902
0
0
0
0
0
0
0
0
0
0
0.334951
206
11
44
18.727273
0.89781
0.626214
0
0
0
0
0
0
0
0
0
0
0
1
0.5
false
0
0
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
6ab51b676f22bc4cd016b7ffadb34c489845f414
54
py
Python
wsgi.py
rjvanvoorhis/photomosaic-api-v2
5da432e911c02f17f595ef056c45a5f4fd717738
[ "MIT" ]
null
null
null
wsgi.py
rjvanvoorhis/photomosaic-api-v2
5da432e911c02f17f595ef056c45a5f4fd717738
[ "MIT" ]
null
null
null
wsgi.py
rjvanvoorhis/photomosaic-api-v2
5da432e911c02f17f595ef056c45a5f4fd717738
[ "MIT" ]
null
null
null
from app import initialize_app app = initialize_app()
18
30
0.814815
8
54
5.25
0.5
0.619048
0
0
0
0
0
0
0
0
0
0
0.12963
54
2
31
27
0.893617
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
6ab9f0af11e5bdaf9ab7917a10eeb65729f6b5b1
92
py
Python
class_web/apps.py
linrunjie1506440129/classWeb
051a10bece047ba630be4e52d8cc09f185c98cf8
[ "MIT" ]
null
null
null
class_web/apps.py
linrunjie1506440129/classWeb
051a10bece047ba630be4e52d8cc09f185c98cf8
[ "MIT" ]
null
null
null
class_web/apps.py
linrunjie1506440129/classWeb
051a10bece047ba630be4e52d8cc09f185c98cf8
[ "MIT" ]
null
null
null
from django.apps import AppConfig class ClassWebConfig(AppConfig): name = 'class_web'
15.333333
33
0.76087
11
92
6.272727
0.818182
0
0
0
0
0
0
0
0
0
0
0
0.163043
92
5
34
18.4
0.896104
0
0
0
0
0
0.097826
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
6aca8a4c07537856a12175472c3c03bda36f9e8c
3,723
py
Python
src/sqlTools/BorrowTools.py
XPH0904/Library-management-system
9990654070caa9f757af9a6f4771ce4b1b484083
[ "Apache-2.0" ]
null
null
null
src/sqlTools/BorrowTools.py
XPH0904/Library-management-system
9990654070caa9f757af9a6f4771ce4b1b484083
[ "Apache-2.0" ]
null
null
null
src/sqlTools/BorrowTools.py
XPH0904/Library-management-system
9990654070caa9f757af9a6f4771ce4b1b484083
[ "Apache-2.0" ]
null
null
null
import traceback import mysql.connector from ..database.database import * from ..model.Book import * class BorrowTools: def BookData(self, idReader): db = DatabaseTools() conn = db.getConn() result_set = None ls = [] try : sql = "select book.idBook,nameBook,price,book.kind,author,publisher from reader,borrow,book where book.idBook = borrow.idBook and reader.idReader = borrow.idReader and reader.idReader = %s " answer = (str(idReader),) mycursor = conn.cursor() mycursor.execute(sql,answer) result_set = mycursor.fetchall() for row in result_set: book = Book() book.setIdBook(row[0]) book.setNameBook(row[1]) book.setPrice(row[2]) book.setType(row[3]) book.setAuthor(row[4]) book.setPublisher(row[5]) ls.append(book.list_return()) mycursor.close() conn.close() except Exception as e: traceback.print_exc() return ls def BookData_Search_idBook(self, idBook): db = DatabaseTools() conn = db.getConn() result_set = None ls = [] try : sql = "select book.idBook,nameBook,price,book.kind,author,publisher from book where book.idBook = %s" answer = (str(idBook),) mycursor = conn.cursor() mycursor.execute(sql,answer) result_set = mycursor.fetchall() for row in result_set: book = Book() book.setIdBook(row[0]) book.setNameBook(row[1]) book.setPrice(row[2]) book.setType(row[3]) book.setAuthor(row[4]) book.setPublisher(row[5]) ls.append(book.list_return()) mycursor.close() conn.close() except Exception as e: traceback.print_exc() return ls def whetherInStock(self, idBook): db = DatabaseTools() conn = db.getConn() try : sql = "select * from borrow" mycursor = conn.cursor() mycursor.execute(sql) result_set = mycursor.fetchall() for row in result_set : if row[1] != None : if row[1] == idBook : return False mycursor.close() conn.close() except Exception as e: traceback.print_exc() return True def BorrowBook(self, idReader, idBook): i = 0 db = DatabaseTools() conn = db.getConn() try : sql = "insert into borrow (idReader,idbook,lendDate,dueDate,overtime) values (%s,%s,CURRENT_DATE(),DATE_ADD(CURRENT_DATE(),INTERVAL 2 MONTH),'否')" answer = (str(idReader),str(idBook)) mycursor = conn.cursor() mycursor.execute(sql,answer) i = mycursor.rowcount mycursor.close() conn.commit() conn.close() except Exception as e: traceback.print_exc() return i def ReturnBook(self, idBook): i = 0 db = DatabaseTools() conn = db.getConn() try : sql = "delete from Borrow where idBook= %s" answer = (str(idBook),) mycursor = conn.cursor() mycursor.execute(sql,answer) i = mycursor.rowcount mycursor.close() conn.commit() conn.close() except Exception as e: traceback.print_exc() return i
27.175182
202
0.513833
379
3,723
4.994723
0.237467
0.038035
0.050185
0.055468
0.729002
0.729002
0.709984
0.681458
0.681458
0.659271
0
0.00742
0.384636
3,723
136
203
27.375
0.818856
0
0
0.788462
0
0.028846
0.125806
0.05457
0
0
0
0
0
1
0.048077
false
0
0.038462
0
0.153846
0.048077
0
0
0
null
0
0
0
0
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
6ad28d0e1baa5fa0b735d482f507ad0fc7b8742c
598
py
Python
objects_and_classes/circle.py
MaggieIllustrations/softuni-github-programming
f5695cb14602f3d2974359f6d8734332acc650d3
[ "MIT" ]
null
null
null
objects_and_classes/circle.py
MaggieIllustrations/softuni-github-programming
f5695cb14602f3d2974359f6d8734332acc650d3
[ "MIT" ]
null
null
null
objects_and_classes/circle.py
MaggieIllustrations/softuni-github-programming
f5695cb14602f3d2974359f6d8734332acc650d3
[ "MIT" ]
1
2022-01-14T17:12:44.000Z
2022-01-14T17:12:44.000Z
class Circle: __pi = 3.14 def __init__(self, diameter): self.radius = diameter / 2 self.diameter = diameter def calculate_circumference(self): return self.diameter * self.__pi def calculate_area(self): radius = self.diameter / 2 return radius * radius * self.__pi def calculate_area_of_sector(self, angle): return self.calculate_area() * angle / 360 circle = Circle(10) angle = 5 print(f"{circle.calculate_circumference():.2f}") print(f"{circle.calculate_area():.2f}") print(f"{circle.calculate_area_of_sector(angle):.2f}")
24.916667
54
0.665552
77
598
4.896104
0.311688
0.172414
0.095491
0.167109
0.259947
0.143236
0
0
0
0
0
0.029724
0.212375
598
24
54
24.916667
0.770701
0
0
0
0
0
0.185309
0.185309
0
0
0
0
0
1
0.235294
false
0
0
0.117647
0.529412
0.176471
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
6af16487fba4a06f3aabdeef59dd77d2b28ad331
315
py
Python
ntbk/exceptions.py
bbeng89/ntbk
770ecd9c6223d9579114731a5efa9f9e3c766bad
[ "MIT" ]
1
2021-12-22T19:28:55.000Z
2021-12-22T19:28:55.000Z
ntbk/exceptions.py
bbeng89/ntbk
770ecd9c6223d9579114731a5efa9f9e3c766bad
[ "MIT" ]
16
2021-12-22T19:16:25.000Z
2022-01-26T16:44:57.000Z
ntbk/exceptions.py
bbeng89/ntbk
770ecd9c6223d9579114731a5efa9f9e3c766bad
[ "MIT" ]
null
null
null
"""Custom exceptions for the application""" class InvalidConfigException(Exception): """Exception that is thrown if the configuration file is not valid""" def __init__(self): super().__init__('Configuration file is not valid. \ Please review the docs and check your config file.')
35
73
0.692063
38
315
5.526316
0.710526
0.161905
0.180952
0.209524
0.257143
0
0
0
0
0
0
0
0.219048
315
9
74
35
0.853659
0.320635
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0
0
0.5
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
4
0aaea9cd39af58539286738c7286d294840c60c1
869
py
Python
Python/reinstall.py
fundor333/StuffWithScript
43b0345f4b4319a084d018f9ebfc0f1f68377645
[ "MIT" ]
null
null
null
Python/reinstall.py
fundor333/StuffWithScript
43b0345f4b4319a084d018f9ebfc0f1f68377645
[ "MIT" ]
null
null
null
Python/reinstall.py
fundor333/StuffWithScript
43b0345f4b4319a084d018f9ebfc0f1f68377645
[ "MIT" ]
1
2020-10-06T09:10:50.000Z
2020-10-06T09:10:50.000Z
import os from subprocess import STDOUT, check_call, CalledProcessError class Apt: def __init__(self, stdout=open(os.devnull, 'wb'), stderr=STDOUT): self.stdout = stdout self.stderr = stderr def command(self, structure): try: return check_call(structure, stdout=self.stdout, stderr=self.stderr) except CalledProcessError as ep: return ep.returncode def install(self, package, ally="-y"): return self.command(['apt-get', 'install', ally, package]) def add_repository(self, repo, ally="-y"): return self.command(['apt-add-repository', ally, repo]) def update(self): return self.command(['apt-get', 'update']) def upgrade(self): return self.command(['apt-get', 'upgrade']) def autoclean(self): return self.command(['apt-get', 'autoclean'])
28.966667
80
0.634062
105
869
5.180952
0.342857
0.091912
0.15625
0.183824
0.246324
0.240809
0
0
0
0
0
0
0.228999
869
29
81
29.965517
0.81194
0
0
0
0
0
0.093211
0
0
0
0
0
0
1
0.333333
false
0
0.095238
0.238095
0.809524
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
0ab7436f0492d2dec23bf952529e99ce9b35b6d4
117
py
Python
classification/scripts/get_configsSize.py
s-santoro/lunch-crawler
1e39b1d35d76067a55b2c034d0488a6ec53f8a45
[ "Apache-2.0" ]
1
2020-07-11T04:24:40.000Z
2020-07-11T04:24:40.000Z
classification/scripts/get_configsSize.py
s-santoro/lunch-crawler
1e39b1d35d76067a55b2c034d0488a6ec53f8a45
[ "Apache-2.0" ]
null
null
null
classification/scripts/get_configsSize.py
s-santoro/lunch-crawler
1e39b1d35d76067a55b2c034d0488a6ec53f8a45
[ "Apache-2.0" ]
null
null
null
import os from configs.Configurations import Configurations configs = Configurations().configs print(len(configs))
16.714286
49
0.820513
13
117
7.384615
0.538462
0.4375
0
0
0
0
0
0
0
0
0
0
0.102564
117
6
50
19.5
0.914286
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0.25
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
0adaa4657f80871abd7c6f611a1eef2546a9c58a
20
py
Python
TUI/Inst/ARCTIC/__init__.py
r-owen/TUI
8f130368254161a2748167b7c8260cc24170c28c
[ "BSD-3-Clause" ]
1
2015-04-29T20:28:20.000Z
2015-04-29T20:28:20.000Z
TUI/Inst/ARCTIC/__init__.py
ApachePointObservatory/TUI
8f130368254161a2748167b7c8260cc24170c28c
[ "BSD-3-Clause" ]
1
2017-06-05T22:53:58.000Z
2017-06-05T22:53:58.000Z
TUI/Inst/ARCTIC/__init__.py
r-owen/TUI
8f130368254161a2748167b7c8260cc24170c28c
[ "BSD-3-Clause" ]
1
2020-01-28T06:28:02.000Z
2020-01-28T06:28:02.000Z
"""ARCTIC Imager"""
10
19
0.6
2
20
6
1
0
0
0
0
0
0
0
0
0
0
0
0.1
20
1
20
20
0.666667
0.65
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
e408bd360a718420f41b1626d968934bbda41779
106
py
Python
jmm/utilities/logger/dumb.py
zqmillet/japanese_media_manager
7f7c9ba9f48e67c5f68f80b6fe09675aded05858
[ "MIT" ]
null
null
null
jmm/utilities/logger/dumb.py
zqmillet/japanese_media_manager
7f7c9ba9f48e67c5f68f80b6fe09675aded05858
[ "MIT" ]
null
null
null
jmm/utilities/logger/dumb.py
zqmillet/japanese_media_manager
7f7c9ba9f48e67c5f68f80b6fe09675aded05858
[ "MIT" ]
null
null
null
from logging import CRITICAL from .logger import Logger dumb = Logger(name='dumb', level=CRITICAL + 10)
17.666667
47
0.754717
15
106
5.333333
0.6
0
0
0
0
0
0
0
0
0
0
0.022222
0.150943
106
5
48
21.2
0.866667
0
0
0
0
0
0.037736
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
7c2e5384e3de91577da41242baa1479854aeb4df
371
py
Python
pyndows/version.py
robindpw/pyndows
da4f4a5064d3f24302c32ddb4098808a67bc4c09
[ "MIT" ]
null
null
null
pyndows/version.py
robindpw/pyndows
da4f4a5064d3f24302c32ddb4098808a67bc4c09
[ "MIT" ]
null
null
null
pyndows/version.py
robindpw/pyndows
da4f4a5064d3f24302c32ddb4098808a67bc4c09
[ "MIT" ]
null
null
null
# Version number as Major.Minor.Patch # The version modification must respect the following rules: # Major should be incremented in case there is a breaking change. (eg: 2.5.8 -> 3.0.0) # Minor should be incremented in case there is an enhancement. (eg: 2.5.8 -> 2.6.0) # Patch should be incremented in case there is a bug fix. (eg: 2.5.8 -> 2.5.9) __version__ = "3.3.1"
53
86
0.71159
71
371
3.661972
0.492958
0.030769
0.219231
0.242308
0.423077
0.376923
0.376923
0.253846
0
0
0
0.068404
0.172507
371
6
87
61.833333
0.778502
0.911051
0
0
0
0
0.185185
0
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
1
1
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
0
0
0
0
0
0
0
4
7c33f17091777c3472efcb270867a72a2df294e5
182
py
Python
app/routes/bean/resultBeanTest.py
honolulu0/flaskProjectTest
8eb7c157a39c11ab721569fadf61882fde90028c
[ "bzip2-1.0.6" ]
null
null
null
app/routes/bean/resultBeanTest.py
honolulu0/flaskProjectTest
8eb7c157a39c11ab721569fadf61882fde90028c
[ "bzip2-1.0.6" ]
null
null
null
app/routes/bean/resultBeanTest.py
honolulu0/flaskProjectTest
8eb7c157a39c11ab721569fadf61882fde90028c
[ "bzip2-1.0.6" ]
null
null
null
# coding=utf-8 class ResultBean(dict): def __init__(self): dict.__init__(self) # 继承pyton字典类的方法和属性 def seet(self): self['abc'] = 'asss' return self
18.2
47
0.593407
21
182
4.761905
0.666667
0.16
0
0
0
0
0
0
0
0
0
0.007634
0.28022
182
9
48
20.222222
0.755725
0.159341
0
0
0
0
0.046667
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
7c37be49863defed22a598b2417d2c296feb4ba0
37
py
Python
my_mpo/__init__.py
joycenerd/MPO_Reimplementation
eca619f393250074d116e252733db0460f433098
[ "MIT" ]
1
2022-03-06T16:20:12.000Z
2022-03-06T16:20:12.000Z
my_mpo/__init__.py
joycenerd/MPO_Reimplementation
eca619f393250074d116e252733db0460f433098
[ "MIT" ]
null
null
null
my_mpo/__init__.py
joycenerd/MPO_Reimplementation
eca619f393250074d116e252733db0460f433098
[ "MIT" ]
null
null
null
from .mpo import MPO __all__ = [MPO]
12.333333
20
0.702703
6
37
3.666667
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.189189
37
3
21
12.333333
0.733333
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
7c3dd1ade6f76266b00f4047ff488308ef931bd4
95
py
Python
config.py
karipov/cross-prom
52b9c08e8a03dddbda6e3a2e88754b769f4d852b
[ "MIT" ]
5
2019-12-02T05:57:39.000Z
2022-02-02T17:31:02.000Z
config.py
karipov/cross-prom
52b9c08e8a03dddbda6e3a2e88754b769f4d852b
[ "MIT" ]
1
2019-06-09T03:28:45.000Z
2019-06-23T22:51:13.000Z
config.py
karipov/cross-prom
52b9c08e8a03dddbda6e3a2e88754b769f4d852b
[ "MIT" ]
13
2018-11-24T13:40:40.000Z
2021-07-29T23:29:59.000Z
TOKEN = "YOUR TOKEN HERE" CHAT_ID = [LIST OF ADMIN IDs] # e.g. [1234567, 2233445, 3466123...]
23.75
67
0.652632
15
95
4.066667
0.933333
0
0
0
0
0
0
0
0
0
0
0.269231
0.178947
95
3
68
31.666667
0.512821
0.368421
0
0
0
0
0.258621
0
0
0
0
0
0
0
null
null
0
0
null
null
0
1
0
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
1
0
0
0
0
0
0
0
0
4
7cb853672bcd9d098b78687a2d93921e621c27c1
129
py
Python
ssda_nlp/death_and_birth_records_model_training.py
slavesocieties/ssda-nlp
8764d2f928ca0fe4e5737fbea4dcd518b8b804f6
[ "MIT" ]
null
null
null
ssda_nlp/death_and_birth_records_model_training.py
slavesocieties/ssda-nlp
8764d2f928ca0fe4e5737fbea4dcd518b8b804f6
[ "MIT" ]
21
2021-02-23T22:31:04.000Z
2022-01-27T22:51:18.000Z
ssda_nlp/death_and_birth_records_model_training.py
slavesocieties/ssda-nlp
8764d2f928ca0fe4e5737fbea4dcd518b8b804f6
[ "MIT" ]
null
null
null
# AUTOGENERATED! DO NOT EDIT! File to edit: 67-death-and-birth-records-together.ipynb (unless otherwise specified). __all__ = []
43
115
0.75969
18
129
5.222222
0.944444
0
0
0
0
0
0
0
0
0
0
0.017544
0.116279
129
3
116
43
0.807018
0.875969
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
7cb87e36a39c23391a73e9757fb9a5a8658f9536
418
py
Python
flash_examples/basic.py
SpaceAppsPCC/NASA-Hackathon
4ed3ebb167f22e66915829b259f41338685e7670
[ "MIT" ]
null
null
null
flash_examples/basic.py
SpaceAppsPCC/NASA-Hackathon
4ed3ebb167f22e66915829b259f41338685e7670
[ "MIT" ]
null
null
null
flash_examples/basic.py
SpaceAppsPCC/NASA-Hackathon
4ed3ebb167f22e66915829b259f41338685e7670
[ "MIT" ]
null
null
null
from flask import Flask, render_template app = Flask(__name__) @app.route('/') @app.route('/home/') def home(): # Connecting to a template (html file) return render_template('home.html') @app.route('/puppy/<name>') def pup_name(name): return render_template('puppy.html',name=name) @app.route('/about/') def about(): return render_template('about.html') if __name__ == '__main__': app.run(debug=True)
18.173913
47
0.69378
59
418
4.627119
0.40678
0.205128
0.21978
0
0
0
0
0
0
0
0
0
0.126794
418
22
48
19
0.747945
0.086124
0
0
0
0
0.168421
0
0
0
0
0
0
1
0.214286
false
0
0.071429
0.214286
0.5
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
4
7cd71693fdecbaa38703ff5a21cf52b7204d902e
230
py
Python
src/message/__init__.py
AnthonyKenny98/GroupChatBot
3453a099ffe195359c062ab95f75908976d0376b
[ "MIT" ]
null
null
null
src/message/__init__.py
AnthonyKenny98/GroupChatBot
3453a099ffe195359c062ab95f75908976d0376b
[ "MIT" ]
4
2020-03-23T07:50:06.000Z
2021-06-02T00:39:11.000Z
src/message/__init__.py
AnthonyKenny98/GroupChatBot
3453a099ffe195359c062ab95f75908976d0376b
[ "MIT" ]
null
null
null
"""Init.""" # -*- coding: utf-8 -*- # @Author: AnthonyKenny98 # @Date: 2019-11-11 18:17:31 # @Last Modified by: AnthonyKenny98 # @Last Modified time: 2019-11-14 15:58:02 from .message import Message, Attachment # noqa: F401
25.555556
54
0.66087
33
230
4.606061
0.787879
0.078947
0
0
0
0
0
0
0
0
0
0.1875
0.165217
230
8
55
28.75
0.604167
0.734783
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
7ce7526189896e23b5b648e9b7ed0e0d7462d5af
8,995
py
Python
tests/test_validate.py
Jesse-Yung/jsonclasses
d40c52aec42bcb978a80ceb98b93ab38134dc790
[ "MIT" ]
50
2021-08-18T08:08:04.000Z
2022-03-20T07:23:26.000Z
tests/test_validate.py
Jesse-Yung/jsonclasses
d40c52aec42bcb978a80ceb98b93ab38134dc790
[ "MIT" ]
1
2021-11-23T02:12:29.000Z
2021-11-23T13:35:26.000Z
tests/test_validate.py
Jesse-Yung/jsonclasses
d40c52aec42bcb978a80ceb98b93ab38134dc790
[ "MIT" ]
8
2021-07-01T02:39:15.000Z
2021-12-10T02:20:18.000Z
from __future__ import annotations from unittest import TestCase from jsonclasses.excs import ValidationException from tests.classes.simple_article import SimpleArticle from tests.classes.simple_language import SimpleLanguage from tests.classes.simple_project import SimpleProject from tests.classes.simple_chart import SimpleChart from tests.classes.author import Author from tests.classes.linked_profile import LinkedProfile from tests.classes.linked_user import LinkedUser class TestValidate(TestCase): def test_validate_does_not_raise_and_returns_self_for_valid_object(self): article = SimpleArticle(title='U Ia Huê', content='Bê Tshua Bo') self.assertEqual(article, article.validate()) def test_validate_raises_if_object_is_not_valid(self): article = SimpleArticle() self.assertRaises(ValidationException, article.validate) def test_is_valid_returns_false_if_object_is_not_valid(self): article = SimpleArticle() self.assertEqual(False, article.is_valid) def test_is_valid_returns_true_if_object_is_valid(self): article = SimpleArticle(title='U Ia Huê', content='Bê Tshua Bo') self.assertEqual(True, article.is_valid) def test_validate_by_default_validates_one_field(self): article = SimpleArticle() with self.assertRaises(ValidationException) as context: article.validate() exception = context.exception self.assertEqual(len(exception.keypath_messages), 1) self.assertEqual(exception.keypath_messages['title'], "value required") def test_validate_validates_all_fields_if_option_is_passed(self): article = SimpleArticle() with self.assertRaises(ValidationException) as context: article.validate(all_fields=True) exception = context.exception self.assertEqual(len(exception.keypath_messages), 2) self.assertEqual(exception.keypath_messages['title'], "value required") self.assertEqual(exception.keypath_messages['content'], "value required") def test_validate_validates_all_fields_if_class_config_is_on(self): language = SimpleLanguage() with self.assertRaises(ValidationException) as context: language.validate() exception = context.exception self.assertEqual(len(exception.keypath_messages), 2) self.assertEqual(exception.keypath_messages['name'], "value required") self.assertEqual(exception.keypath_messages['code'], "value required") def test_validate_validates_one_field_if_explicitly_specified(self): language = SimpleLanguage() with self.assertRaises(ValidationException) as context: language.validate(all_fields=False) exception = context.exception self.assertEqual(len(exception.keypath_messages), 1) self.assertEqual(exception.keypath_messages['name'], "value required") def test_validate_validates_one_list_field_by_default(self): project = SimpleProject(name='Teo', attendees=['A', 'B', 'C', 'D']) with self.assertRaises(ValidationException) as context: project.validate() exception = context.exception self.assertEqual(len(exception.keypath_messages), 1) self.assertEqual(exception.keypath_messages['attendees.0'], "length of value is not greater than or equal 2") def test_validate_validates_all_list_fields_if_required(self): project = SimpleProject(name='Teo', attendees=['A', 'B', 'C', 'D']) with self.assertRaises(ValidationException) as context: project.validate(all_fields=True) exception = context.exception self.assertEqual(len(exception.keypath_messages), 4) self.assertEqual(exception.keypath_messages['attendees.0'], "length of value is not greater than or equal 2") self.assertEqual(exception.keypath_messages['attendees.1'], "length of value is not greater than or equal 2") self.assertEqual(exception.keypath_messages['attendees.2'], "length of value is not greater than or equal 2") self.assertEqual(exception.keypath_messages['attendees.3'], "length of value is not greater than or equal 2") def test_validate_validates_one_dict_field_by_default(self): chart = SimpleChart(name='Teo', partitions={ 'a': 2, 'b': 3, 'c': 4, 'd': 5}) with self.assertRaises(ValidationException) as context: chart.validate() exception = context.exception self.assertEqual(len(exception.keypath_messages), 1) self.assertEqual(exception.keypath_messages['partitions.a'], "value is not less than or equal 1") def test_validate_validates_all_dict_fields_if_required(self): chart = SimpleChart(name='Teo', partitions={ 'a': 2, 'b': 3, 'c': 4, 'd': 5}) with self.assertRaises(ValidationException) as context: chart.validate(all_fields=True) exception = context.exception self.assertEqual(len(exception.keypath_messages), 4) self.assertEqual(exception.keypath_messages['partitions.a'], "value is not less than or equal 1") self.assertEqual(exception.keypath_messages['partitions.b'], "value is not less than or equal 1") self.assertEqual(exception.keypath_messages['partitions.c'], "value is not less than or equal 1") self.assertEqual(exception.keypath_messages['partitions.d'], "value is not less than or equal 1") def test_validate_validates_with_class_config_by_default(self): author = Author(name='A', articles=[{}, {}]) with self.assertRaises(ValidationException) as context: author.validate() exception = context.exception self.assertEqual(len(exception.keypath_messages), 2) self.assertEqual(exception.keypath_messages['articles.0.title'], "value required") self.assertEqual(exception.keypath_messages['articles.0.content'], "value required") def test_validate_validates_one_field_inside_nested_if_required(self): author = Author(name='A', articles=[{}, {}]) with self.assertRaises(ValidationException) as context: author.validate(all_fields=False) exception = context.exception self.assertEqual(len(exception.keypath_messages), 1) self.assertEqual(exception.keypath_messages['articles.0.title'], "value required") def test_validate_validates_all_field_inside_nested_if_required(self): author = Author(name='A', articles=[{}, {}]) with self.assertRaises(ValidationException) as context: author.validate(all_fields=True) exception = context.exception self.assertEqual(len(exception.keypath_messages), 4) self.assertEqual(exception.keypath_messages['articles.0.title'], "value required") self.assertEqual(exception.keypath_messages['articles.0.content'], "value required") self.assertEqual(exception.keypath_messages['articles.1.title'], "value required") self.assertEqual(exception.keypath_messages['articles.1.content'], "value required") def test_validate_only_validate_modified_fields_for_non_new_object(self): article = SimpleArticle(title='my', content='side') article._mark_not_new() article.content = None article._modified_fields = [] article.validate(all_fields=True) def test_validate_validates_linked_objects_anyway(self): author = Author(name='Tsit Tiu', articles=[{'title': 'Khua Tioh Sê Kai', 'content': 'Ai Gua Tsuê'}, {'title': 'Thên Ha Si Lan Ê', 'content': 'Tsiu Ho Lang Tsai'}]) author._mark_not_new() author.articles[0]._mark_not_new() author.articles[1]._mark_not_new() author.articles[0].content = None with self.assertRaises(ValidationException) as context: author.validate() exception = context.exception self.assertEqual(len(exception.keypath_messages), 1) self.assertEqual(exception.keypath_messages['articles.0.content'], "value required") def test_validate_linked_objects_no_infinite_loop(self): profile = LinkedProfile(name='Ua Bê Tshiu Pên') user = LinkedUser(name='Tsuan Sê Kai') user.profile = profile user.validate()
48.621622
77
0.65781
974
8,995
5.865503
0.14271
0.102398
0.151234
0.130229
0.788377
0.757045
0.742167
0.729389
0.697882
0.64502
0
0.006794
0.247248
8,995
184
78
48.88587
0.836952
0
0
0.579268
0
0
0.118399
0
0
0
0
0
0.317073
1
0.109756
false
0.006098
0.060976
0
0.176829
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
6b021856f0dbc26655a906c20052632e5e5dc6d6
163
py
Python
cvat/apps/dataset_repo/apps.py
gitibharatibiswal/cvat-adas-team
a33c1ae38d79ed6e35a61a97b74cd2978853e4c2
[ "Intel", "MIT" ]
3
2021-02-17T10:58:42.000Z
2021-04-10T09:51:03.000Z
cvat/apps/dataset_repo/apps.py
nav13n/cvat
9bdcc7f8f2d86a763ab5f306ea049ce1432da557
[ "Intel", "MIT" ]
57
2021-01-19T10:51:18.000Z
2021-04-22T19:43:44.000Z
cvat/apps/dataset_repo/apps.py
nav13n/cvat
9bdcc7f8f2d86a763ab5f306ea049ce1432da557
[ "Intel", "MIT" ]
41
2020-12-16T05:52:41.000Z
2021-09-23T08:45:16.000Z
# Copyright (C) 2018 Intel Corporation # # SPDX-License-Identifier: MIT from django.apps import AppConfig class GitConfig(AppConfig): name = 'dataset_repo'
16.3
38
0.748466
20
163
6.05
0.95
0
0
0
0
0
0
0
0
0
0
0.029197
0.159509
163
9
39
18.111111
0.854015
0.398773
0
0
0
0
0.12766
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
6b068f78e7be11853c5348079ee7f3ee49e83ea5
388
py
Python
builder/core/action.py
awslabs/aws-crt-builder
43ea817a7d464ff019528745478656f406f60071
[ "Apache-2.0" ]
10
2020-02-07T02:25:04.000Z
2021-08-06T02:17:08.000Z
builder/core/action.py
awslabs/aws-crt-builder
43ea817a7d464ff019528745478656f406f60071
[ "Apache-2.0" ]
18
2020-03-20T01:29:38.000Z
2022-02-10T23:06:16.000Z
builder/core/action.py
awslabs/aws-crt-builder
43ea817a7d464ff019528745478656f406f60071
[ "Apache-2.0" ]
4
2020-02-20T00:39:13.000Z
2020-12-21T17:25:33.000Z
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0. class Action(object): """ A build step """ def is_main(self): """ Returns True if this action needs no external tasks run to set it up """ return False def run(self, env): pass def __str__(self): return self.__class__.__name__
22.823529
84
0.636598
54
388
4.333333
0.833333
0
0
0
0
0
0
0
0
0
0
0.006969
0.260309
388
16
85
24.25
0.808362
0.484536
0
0
0
0
0
0
0
0
0
0
0
1
0.428571
false
0.142857
0
0.142857
0.857143
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
1
1
0
0
4
6b1c0b25ed0c92c238c568cc73b19a469f23fdd4
4,030
py
Python
test/test_namespaces_dict.py
DaniFdezAlvarez/dbpedia-shexer
e2c0685b167810e13411b592b6bdd4acfc11e8c1
[ "Apache-2.0" ]
16
2019-03-18T21:32:36.000Z
2022-03-28T17:53:57.000Z
test/test_namespaces_dict.py
DaniFdezAlvarez/shexer
4f4dffc95bcad038cbc1bd85b58e5558c7c0a6d1
[ "Apache-2.0" ]
67
2019-02-27T12:58:55.000Z
2022-03-28T20:38:48.000Z
test/test_namespaces_dict.py
DaniFdezAlvarez/dbpedia-shexer
e2c0685b167810e13411b592b6bdd4acfc11e8c1
[ "Apache-2.0" ]
2
2019-03-09T00:30:28.000Z
2020-01-09T18:04:14.000Z
import unittest from shexer.shaper import Shaper from test.const import G1_NT, G1, BASE_FILES, default_namespaces, G1_ALL_CLASSES_NO_COMMENTS from test.t_utils import file_vs_str_tunned_comparison import os.path as pth from shexer.consts import TURTLE, NT _BASE_DIR = BASE_FILES + "namespaces_dict" + pth.sep class TestNamespacesDict(unittest.TestCase): def test_same_namespaces_as_source_ttl_file(self): shaper = Shaper(target_classes=["http://xmlns.com/foaf/0.1/Person", "http://xmlns.com/foaf/0.1/Document"], graph_file_input=G1, namespaces_dict=default_namespaces(), all_classes_mode=False, input_format=TURTLE, disable_comments=True) str_result = shaper.shex_graph(string_output=True) self.assertTrue(file_vs_str_tunned_comparison(file_path=G1_ALL_CLASSES_NO_COMMENTS, str_target=str_result)) def test_no_foaf(self): namespaces = {"http://example.org/" : "ex", "http://www.w3.org/XML/1998/namespace/" : "xml", "http://www.w3.org/1999/02/22-rdf-syntax-ns#": "rdf", "http://www.w3.org/2000/01/rdf-schema#" : "rdfs", "http://www.w3.org/2001/XMLSchema#": "xsd" # "http://xmlns.com/foaf/0.1/": "foaf" } shaper = Shaper(target_classes=["http://xmlns.com/foaf/0.1/Person", "http://xmlns.com/foaf/0.1/Document"], graph_file_input=G1_NT, namespaces_dict=namespaces, all_classes_mode=False, input_format=NT, disable_comments=True) str_result = shaper.shex_graph(string_output=True) self.assertTrue(file_vs_str_tunned_comparison(file_path=_BASE_DIR + "\\no_foaf.shex", str_target=str_result)) def test_overwrite_empty(self): namespaces = default_namespaces() namespaces["http://unuseful.but.yet/here/"] = "" shaper = Shaper(target_classes=["http://xmlns.com/foaf/0.1/Person", "http://xmlns.com/foaf/0.1/Document"], graph_file_input=G1, namespaces_dict=namespaces, all_classes_mode=False, input_format=TURTLE, disable_comments=True) str_result = shaper.shex_graph(string_output=True) self.assertTrue(file_vs_str_tunned_comparison(file_path=_BASE_DIR + "\\overwrite_empty.shex", str_target=str_result)) def test_overwrite_some_namespaces(self): namespaces = {"http://example.org/": "ex", "http://www.w3.org/XML/1998/namespace/": "xml", "http://www.w3.org/1999/02/22-rdf-syntax-ns#": "rdf", "http://www.w3.org/2000/01/rdf-schema#": "rdfs", "http://www.w3.org/2001/XMLSchema#": "xxssdd", "http://xmlns.com/foaf/0.1/": "fooo" } shaper = Shaper(target_classes=["http://xmlns.com/foaf/0.1/Person", "http://xmlns.com/foaf/0.1/Document"], graph_file_input=G1, namespaces_dict=namespaces, all_classes_mode=False, input_format=TURTLE, disable_comments=True) str_result = shaper.shex_graph(string_output=True) self.assertTrue(file_vs_str_tunned_comparison(file_path=_BASE_DIR + "\\overwrite.shex", str_target=str_result))
52.337662
101
0.523325
429
4,030
4.645688
0.214452
0.045158
0.060211
0.080281
0.798294
0.752634
0.722027
0.722027
0.683894
0.656799
0
0.031274
0.365261
4,030
76
102
53.026316
0.74785
0.008933
0
0.61194
0
0
0.190631
0.005511
0
0
0
0
0.059701
1
0.059701
false
0
0.089552
0
0.164179
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
6b1d9069b43b6ee28b275ec9dc9f40f71f74d823
207
py
Python
colcon_core/environment_variable.py
brawner/colcon-core
83bf0391323514ab8ada7aacc693fd16f59c1037
[ "Apache-2.0" ]
76
2017-04-27T23:13:57.000Z
2022-03-25T10:02:11.000Z
colcon_core/environment_variable.py
brawner/colcon-core
83bf0391323514ab8ada7aacc693fd16f59c1037
[ "Apache-2.0" ]
442
2018-03-13T16:45:28.000Z
2022-03-30T22:47:42.000Z
colcon_core/environment_variable.py
brawner/colcon-core
83bf0391323514ab8ada7aacc693fd16f59c1037
[ "Apache-2.0" ]
34
2018-06-22T09:56:34.000Z
2022-03-26T23:46:42.000Z
# Copyright 2016-2018 Dirk Thomas # Licensed under the Apache License, Version 2.0 from collections import namedtuple EnvironmentVariable = namedtuple( 'EnvironmentVariable', ('name', 'description'))
23
51
0.768116
22
207
7.227273
0.909091
0.36478
0
0
0
0
0
0
0
0
0
0.056497
0.144928
207
8
52
25.875
0.841808
0.376812
0
0
0
0
0.269841
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
6b219ae72d9333350b1fca21b4b63f1bae9f59a8
101
py
Python
AquariumPro/AquariumPro/aquaticPlants/apps.py
Python1991/Aquarium-Pro
83034c04f55073647ea11975e4248aa7ddfc9a22
[ "MIT" ]
null
null
null
AquariumPro/AquariumPro/aquaticPlants/apps.py
Python1991/Aquarium-Pro
83034c04f55073647ea11975e4248aa7ddfc9a22
[ "MIT" ]
null
null
null
AquariumPro/AquariumPro/aquaticPlants/apps.py
Python1991/Aquarium-Pro
83034c04f55073647ea11975e4248aa7ddfc9a22
[ "MIT" ]
null
null
null
from django.apps import AppConfig class AquaticplantsConfig(AppConfig): name = 'aquaticPlants'
16.833333
37
0.782178
10
101
7.9
0.9
0
0
0
0
0
0
0
0
0
0
0
0.148515
101
5
38
20.2
0.918605
0
0
0
0
0
0.128713
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
6b230d8164f2c3a43ee8c37acea6dbd25e56e5bd
626
py
Python
bncs/__init__.py
dkuwahara/bncs.py
ca88ae244df4d39316d81d1e894c657e1a980a6e
[ "MIT" ]
1
2020-02-09T11:02:28.000Z
2020-02-09T11:02:28.000Z
bncs/__init__.py
dkuwahara/bncs.py
ca88ae244df4d39316d81d1e894c657e1a980a6e
[ "MIT" ]
null
null
null
bncs/__init__.py
dkuwahara/bncs.py
ca88ae244df4d39316d81d1e894c657e1a980a6e
[ "MIT" ]
null
null
null
# Utilities from bncs.common.buffer import DataBuffer, DataReader, format_buffer from bncs.common.products import BNCS_PRODUCTS from bncs.common.products import get_product as get_product_info from bncs.common.chat import * from bncs.common.packets import * # Hashing from bncs.hashing.cdkeys import KeyDecoder from bncs.hashing.nls import NLS_Client, NLS_Server from bncs.hashing.nls import get_sv as get_create_account from bncs.hashing.sigverify import check_signature, decode_signature from bncs.hashing.xsha import hash_password, double_hash_password, xsha1 # Main from bncs.client import BncsClient, parse_chat_event
34.777778
72
0.845048
94
626
5.446809
0.404255
0.171875
0.136719
0.085938
0.203125
0
0
0
0
0
0
0.001779
0.102236
626
17
73
36.823529
0.909253
0.035144
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.090909
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
1
0
1
0
0
4
6b30d044d9bdad3c32245e046226a7e99ccb7b5e
13,670
py
Python
netbox/netbox/tests/test_authentication.py
TheFlyingCorpse/netbox
a226f06b1beb575011d783b202d76cb74d3b1f79
[ "Apache-2.0" ]
2
2021-09-02T05:17:34.000Z
2021-11-14T20:06:48.000Z
netbox/netbox/tests/test_authentication.py
emersonfelipesp/netbox
fecca5ad83fb6b48a2f15982dfd3242653f105f9
[ "Apache-2.0" ]
25
2019-09-17T19:40:50.000Z
2022-03-11T04:01:55.000Z
netbox/netbox/tests/test_authentication.py
emersonfelipesp/netbox
fecca5ad83fb6b48a2f15982dfd3242653f105f9
[ "Apache-2.0" ]
1
2018-12-05T12:03:21.000Z
2018-12-05T12:03:21.000Z
from django.conf import settings from django.contrib.auth.models import Group, User from django.contrib.contenttypes.models import ContentType from django.test import Client from django.test.utils import override_settings from django.urls import reverse from netaddr import IPNetwork from rest_framework.test import APIClient from dcim.models import Site from ipam.choices import PrefixStatusChoices from ipam.models import Prefix from users.models import ObjectPermission, Token from utilities.testing import TestCase class ExternalAuthenticationTestCase(TestCase): @classmethod def setUpTestData(cls): cls.user = User.objects.create(username='remoteuser1') def setUp(self): self.client = Client() @override_settings( LOGIN_REQUIRED=True ) def test_remote_auth_disabled(self): """ Test enabling remote authentication with the default configuration. """ headers = { 'HTTP_REMOTE_USER': 'remoteuser1', } self.assertFalse(settings.REMOTE_AUTH_ENABLED) self.assertEqual(settings.REMOTE_AUTH_HEADER, 'HTTP_REMOTE_USER') # Client should not be authenticated response = self.client.get(reverse('home'), follow=True, **headers) self.assertNotIn('_auth_user_id', self.client.session) @override_settings( REMOTE_AUTH_ENABLED=True, LOGIN_REQUIRED=True ) def test_remote_auth_enabled(self): """ Test enabling remote authentication with the default configuration. """ headers = { 'HTTP_REMOTE_USER': 'remoteuser1', } self.assertTrue(settings.REMOTE_AUTH_ENABLED) self.assertEqual(settings.REMOTE_AUTH_HEADER, 'HTTP_REMOTE_USER') response = self.client.get(reverse('home'), follow=True, **headers) self.assertEqual(response.status_code, 200) self.assertEqual(int(self.client.session.get('_auth_user_id')), self.user.pk, msg='Authentication failed') @override_settings( REMOTE_AUTH_ENABLED=True, REMOTE_AUTH_HEADER='HTTP_FOO', LOGIN_REQUIRED=True ) def test_remote_auth_custom_header(self): """ Test enabling remote authentication with a custom HTTP header. """ headers = { 'HTTP_FOO': 'remoteuser1', } self.assertTrue(settings.REMOTE_AUTH_ENABLED) self.assertEqual(settings.REMOTE_AUTH_HEADER, 'HTTP_FOO') response = self.client.get(reverse('home'), follow=True, **headers) self.assertEqual(response.status_code, 200) self.assertEqual(int(self.client.session.get('_auth_user_id')), self.user.pk, msg='Authentication failed') @override_settings( REMOTE_AUTH_ENABLED=True, REMOTE_AUTH_AUTO_CREATE_USER=True, LOGIN_REQUIRED=True ) def test_remote_auth_auto_create(self): """ Test enabling remote authentication with automatic user creation disabled. """ headers = { 'HTTP_REMOTE_USER': 'remoteuser2', } self.assertTrue(settings.REMOTE_AUTH_ENABLED) self.assertTrue(settings.REMOTE_AUTH_AUTO_CREATE_USER) self.assertEqual(settings.REMOTE_AUTH_HEADER, 'HTTP_REMOTE_USER') response = self.client.get(reverse('home'), follow=True, **headers) self.assertEqual(response.status_code, 200) # Local user should have been automatically created new_user = User.objects.get(username='remoteuser2') self.assertEqual(int(self.client.session.get('_auth_user_id')), new_user.pk, msg='Authentication failed') @override_settings( REMOTE_AUTH_ENABLED=True, REMOTE_AUTH_AUTO_CREATE_USER=True, REMOTE_AUTH_DEFAULT_GROUPS=['Group 1', 'Group 2'], LOGIN_REQUIRED=True ) def test_remote_auth_default_groups(self): """ Test enabling remote authentication with the default configuration. """ headers = { 'HTTP_REMOTE_USER': 'remoteuser2', } self.assertTrue(settings.REMOTE_AUTH_ENABLED) self.assertTrue(settings.REMOTE_AUTH_AUTO_CREATE_USER) self.assertEqual(settings.REMOTE_AUTH_HEADER, 'HTTP_REMOTE_USER') self.assertEqual(settings.REMOTE_AUTH_DEFAULT_GROUPS, ['Group 1', 'Group 2']) # Create required groups groups = ( Group(name='Group 1'), Group(name='Group 2'), Group(name='Group 3'), ) Group.objects.bulk_create(groups) response = self.client.get(reverse('home'), follow=True, **headers) self.assertEqual(response.status_code, 200) new_user = User.objects.get(username='remoteuser2') self.assertEqual(int(self.client.session.get('_auth_user_id')), new_user.pk, msg='Authentication failed') self.assertListEqual( [groups[0], groups[1]], list(new_user.groups.all()) ) @override_settings( REMOTE_AUTH_ENABLED=True, REMOTE_AUTH_AUTO_CREATE_USER=True, REMOTE_AUTH_DEFAULT_PERMISSIONS={'dcim.add_site': None, 'dcim.change_site': None}, LOGIN_REQUIRED=True ) def test_remote_auth_default_permissions(self): """ Test enabling remote authentication with the default configuration. """ headers = { 'HTTP_REMOTE_USER': 'remoteuser2', } self.assertTrue(settings.REMOTE_AUTH_ENABLED) self.assertTrue(settings.REMOTE_AUTH_AUTO_CREATE_USER) self.assertEqual(settings.REMOTE_AUTH_HEADER, 'HTTP_REMOTE_USER') self.assertEqual(settings.REMOTE_AUTH_DEFAULT_PERMISSIONS, {'dcim.add_site': None, 'dcim.change_site': None}) response = self.client.get(reverse('home'), follow=True, **headers) self.assertEqual(response.status_code, 200) new_user = User.objects.get(username='remoteuser2') self.assertEqual(int(self.client.session.get('_auth_user_id')), new_user.pk, msg='Authentication failed') self.assertTrue(new_user.has_perms(['dcim.add_site', 'dcim.change_site'])) class ObjectPermissionAPIViewTestCase(TestCase): client_class = APIClient @classmethod def setUpTestData(cls): cls.sites = ( Site(name='Site 1', slug='site-1'), Site(name='Site 2', slug='site-2'), Site(name='Site 3', slug='site-3'), ) Site.objects.bulk_create(cls.sites) cls.prefixes = ( Prefix(prefix=IPNetwork('10.0.0.0/24'), site=cls.sites[0]), Prefix(prefix=IPNetwork('10.0.1.0/24'), site=cls.sites[0]), Prefix(prefix=IPNetwork('10.0.2.0/24'), site=cls.sites[0]), Prefix(prefix=IPNetwork('10.0.3.0/24'), site=cls.sites[1]), Prefix(prefix=IPNetwork('10.0.4.0/24'), site=cls.sites[1]), Prefix(prefix=IPNetwork('10.0.5.0/24'), site=cls.sites[1]), Prefix(prefix=IPNetwork('10.0.6.0/24'), site=cls.sites[2]), Prefix(prefix=IPNetwork('10.0.7.0/24'), site=cls.sites[2]), Prefix(prefix=IPNetwork('10.0.8.0/24'), site=cls.sites[2]), ) Prefix.objects.bulk_create(cls.prefixes) def setUp(self): """ Create a test user and token for API calls. """ self.user = User.objects.create(username='testuser') self.token = Token.objects.create(user=self.user) self.header = {'HTTP_AUTHORIZATION': 'Token {}'.format(self.token.key)} @override_settings(EXEMPT_VIEW_PERMISSIONS=[]) def test_get_object(self): # Attempt to retrieve object without permission url = reverse('ipam-api:prefix-detail', kwargs={'pk': self.prefixes[0].pk}) response = self.client.get(url, **self.header) self.assertEqual(response.status_code, 403) # Assign object permission obj_perm = ObjectPermission( name='Test permission', constraints={'site__name': 'Site 1'}, actions=['view'] ) obj_perm.save() obj_perm.users.add(self.user) obj_perm.object_types.add(ContentType.objects.get_for_model(Prefix)) # Retrieve permitted object url = reverse('ipam-api:prefix-detail', kwargs={'pk': self.prefixes[0].pk}) response = self.client.get(url, **self.header) self.assertEqual(response.status_code, 200) # Attempt to retrieve non-permitted object url = reverse('ipam-api:prefix-detail', kwargs={'pk': self.prefixes[3].pk}) response = self.client.get(url, **self.header) self.assertEqual(response.status_code, 404) @override_settings(EXEMPT_VIEW_PERMISSIONS=[]) def test_list_objects(self): url = reverse('ipam-api:prefix-list') # Attempt to list objects without permission response = self.client.get(url, **self.header) self.assertEqual(response.status_code, 403) # Assign object permission obj_perm = ObjectPermission( name='Test permission', constraints={'site__name': 'Site 1'}, actions=['view'] ) obj_perm.save() obj_perm.users.add(self.user) obj_perm.object_types.add(ContentType.objects.get_for_model(Prefix)) # Retrieve all objects. Only permitted objects should be returned. response = self.client.get(url, **self.header) self.assertEqual(response.status_code, 200) self.assertEqual(response.data['count'], 3) @override_settings(EXEMPT_VIEW_PERMISSIONS=[]) def test_create_object(self): url = reverse('ipam-api:prefix-list') data = { 'prefix': '10.0.9.0/24', 'site': self.sites[1].pk, } initial_count = Prefix.objects.count() # Attempt to create an object without permission response = self.client.post(url, data, format='json', **self.header) self.assertEqual(response.status_code, 403) # Assign object permission obj_perm = ObjectPermission( name='Test permission', constraints={'site__name': 'Site 1'}, actions=['add'] ) obj_perm.save() obj_perm.users.add(self.user) obj_perm.object_types.add(ContentType.objects.get_for_model(Prefix)) # Attempt to create a non-permitted object response = self.client.post(url, data, format='json', **self.header) self.assertEqual(response.status_code, 403) self.assertEqual(Prefix.objects.count(), initial_count) # Create a permitted object data['site'] = self.sites[0].pk response = self.client.post(url, data, format='json', **self.header) self.assertEqual(response.status_code, 201) self.assertEqual(Prefix.objects.count(), initial_count + 1) @override_settings(EXEMPT_VIEW_PERMISSIONS=[]) def test_edit_object(self): # Attempt to edit an object without permission data = {'site': self.sites[0].pk} url = reverse('ipam-api:prefix-detail', kwargs={'pk': self.prefixes[0].pk}) response = self.client.patch(url, data, format='json', **self.header) self.assertEqual(response.status_code, 403) # Assign object permission obj_perm = ObjectPermission( name='Test permission', constraints={'site__name': 'Site 1'}, actions=['change'] ) obj_perm.save() obj_perm.users.add(self.user) obj_perm.object_types.add(ContentType.objects.get_for_model(Prefix)) # Attempt to edit a non-permitted object data = {'site': self.sites[0].pk} url = reverse('ipam-api:prefix-detail', kwargs={'pk': self.prefixes[3].pk}) response = self.client.patch(url, data, format='json', **self.header) self.assertEqual(response.status_code, 404) # Edit a permitted object data['status'] = 'reserved' url = reverse('ipam-api:prefix-detail', kwargs={'pk': self.prefixes[0].pk}) response = self.client.patch(url, data, format='json', **self.header) self.assertEqual(response.status_code, 200) # Attempt to modify a permitted object to a non-permitted object data['site'] = self.sites[1].pk url = reverse('ipam-api:prefix-detail', kwargs={'pk': self.prefixes[0].pk}) response = self.client.patch(url, data, format='json', **self.header) self.assertEqual(response.status_code, 403) @override_settings(EXEMPT_VIEW_PERMISSIONS=[]) def test_delete_object(self): # Attempt to delete an object without permission url = reverse('ipam-api:prefix-detail', kwargs={'pk': self.prefixes[0].pk}) response = self.client.delete(url, format='json', **self.header) self.assertEqual(response.status_code, 403) # Assign object permission obj_perm = ObjectPermission( name='Test permission', constraints={'site__name': 'Site 1'}, actions=['delete'] ) obj_perm.save() obj_perm.users.add(self.user) obj_perm.object_types.add(ContentType.objects.get_for_model(Prefix)) # Attempt to delete a non-permitted object url = reverse('ipam-api:prefix-detail', kwargs={'pk': self.prefixes[3].pk}) response = self.client.delete(url, format='json', **self.header) self.assertEqual(response.status_code, 404) # Delete a permitted object url = reverse('ipam-api:prefix-detail', kwargs={'pk': self.prefixes[0].pk}) response = self.client.delete(url, format='json', **self.header) self.assertEqual(response.status_code, 204)
38.615819
117
0.646379
1,628
13,670
5.266585
0.104423
0.062981
0.046186
0.067646
0.793679
0.768603
0.755423
0.70154
0.666783
0.666783
0
0.017666
0.229773
13,670
353
118
38.725212
0.796657
0.095611
0
0.589641
0
0
0.111668
0.018064
0
0
0
0
0.191235
1
0.059761
false
0
0.051793
0
0.123506
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
6b338fb19eda617f2c0e2b9df4c01d2b841862f5
1,136
py
Python
domilang/forms.py
semroig/domilang-webapp
1ac744587dd5ba2eaa09560f7a115fc8a6cf18c8
[ "MIT" ]
null
null
null
domilang/forms.py
semroig/domilang-webapp
1ac744587dd5ba2eaa09560f7a115fc8a6cf18c8
[ "MIT" ]
null
null
null
domilang/forms.py
semroig/domilang-webapp
1ac744587dd5ba2eaa09560f7a115fc8a6cf18c8
[ "MIT" ]
null
null
null
from django import forms NIVEL_CHOICES =( ("Elementary", "Elementary"), ("Intermediate", "Intermediate"), ("Advanced", "Advanced") ) class LogInForm(forms.Form): username = forms.CharField(label="Username") password = forms.CharField(label="Password") class RegisterForm(forms.Form): username = forms.CharField(label="Username") email = forms.EmailField(label="Email") password = forms.CharField(label="Password") confirmation = forms.CharField(label="Confirm Password") class ProfileForm(forms.Form): first_name = forms.CharField(label="First Name", required=False) last_name = forms.CharField(label="Last Name", required=False) native_lan = forms.CharField(label="Native Language", required=False) foto = forms.ImageField(required=False) pais = forms.CharField(label="Country", required=False) franja = forms.CharField(label="Time Zone", required=False) nivel = forms.ChoiceField(choices = NIVEL_CHOICES, label="Level", required=False) study_lan = forms.CharField(label="Study Language", required=False) phone = forms.CharField(label="Phone", required=False)
40.571429
85
0.722711
128
1,136
6.367188
0.320313
0.206135
0.279755
0.053988
0.193865
0.107975
0.107975
0
0
0
0
0
0.137324
1,136
28
86
40.571429
0.831633
0
0
0.166667
0
0
0.164468
0
0
0
0
0
0
1
0
false
0.125
0.041667
0
0.791667
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
4
8624312dd40f2559492b2fff98f57471417bf646
18
py
Python
src/AlgoPlus/CTP/__init__.py
mynameiziji/AlgoPlus
36a2dd3b38fce905dbd81cb05d7027c2cc7dfb21
[ "MIT" ]
1
2021-04-26T04:03:45.000Z
2021-04-26T04:03:45.000Z
src/AlgoPlus/CTP/__init__.py
280185386/AlgoPlus
9504628be7d398ee76bc7a420b660429460f6a06
[ "MIT" ]
null
null
null
src/AlgoPlus/CTP/__init__.py
280185386/AlgoPlus
9504628be7d398ee76bc7a420b660429460f6a06
[ "MIT" ]
1
2021-11-15T09:00:46.000Z
2021-11-15T09:00:46.000Z
# encoding:utf-8
9
17
0.666667
3
18
4
1
0
0
0
0
0
0
0
0
0
0
0.066667
0.166667
18
1
18
18
0.733333
0.777778
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
8628363ecbfdbe26c23da56bb706b4c09a700e63
112
py
Python
Python3-built-in-functions/0x77id.py
DropsDevopsOrg/PythonWiki
0c344edad37ed34c03cf066df991922cb4bdeee0
[ "Apache-2.0" ]
15
2019-04-09T04:20:21.000Z
2022-02-08T20:33:42.000Z
Python3-built-in-functions/0x77id.py
sep8dog/PythonWiki
0c344edad37ed34c03cf066df991922cb4bdeee0
[ "Apache-2.0" ]
1
2019-07-22T07:27:10.000Z
2020-10-09T08:00:17.000Z
Python3-built-in-functions/0x77id.py
sep8dog/PythonWiki
0c344edad37ed34c03cf066df991922cb4bdeee0
[ "Apache-2.0" ]
16
2019-09-13T14:06:42.000Z
2022-03-15T06:02:01.000Z
a = 'some_string' b = 'some' + '_' + 'string' c = 'somestring' print(id(a)) print(id(b)) print(id(c))
12.444444
28
0.526786
17
112
3.352941
0.470588
0.368421
0
0
0
0
0
0
0
0
0
0
0.232143
112
8
29
14
0.662791
0
0
0
0
0
0.31068
0
0.166667
0
0
0
0
1
0
false
0
0
0
0
0.5
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
4
8630da3d0f8e6f938a0309be09428fff928c18c3
200
py
Python
nums.py
treyhunner/oddities
a57266ea9060ac466b44bcc6ae2ff9e64b75075c
[ "MIT" ]
4
2018-09-04T01:13:39.000Z
2018-10-09T15:18:27.000Z
nums.py
treyhunner/oddities
a57266ea9060ac466b44bcc6ae2ff9e64b75075c
[ "MIT" ]
null
null
null
nums.py
treyhunner/oddities
a57266ea9060ac466b44bcc6ae2ff9e64b75075c
[ "MIT" ]
null
null
null
lots_of_numbers = range(-1000, 1000) the_same_numbers = range(-1000, 1000) same_numbers = ( i for i, j in zip(lots_of_numbers, the_same_numbers) if i is j ) print(*same_numbers, sep=", ")
22.222222
54
0.685
34
200
3.735294
0.470588
0.346457
0.204724
0.314961
0
0
0
0
0
0
0
0.098765
0.19
200
8
55
25
0.685185
0
0
0
0
0
0.01
0
0
0
0
0
0
1
0
false
0
0
0
0
0.125
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
8642005f33f6e0470b6015165cd3520c3b0dab33
83
py
Python
cheatsheet-startup-python/example-basic/third-package/requests-fun.py
seniortesting/cheatsheet-startup-parent
de0047d58e245427efa992f0f19c30bdec4f70f4
[ "MIT" ]
null
null
null
cheatsheet-startup-python/example-basic/third-package/requests-fun.py
seniortesting/cheatsheet-startup-parent
de0047d58e245427efa992f0f19c30bdec4f70f4
[ "MIT" ]
null
null
null
cheatsheet-startup-python/example-basic/third-package/requests-fun.py
seniortesting/cheatsheet-startup-parent
de0047d58e245427efa992f0f19c30bdec4f70f4
[ "MIT" ]
null
null
null
import requests session = requests.Session() if __name__ == '__main__': pass
11.857143
28
0.698795
9
83
5.555556
0.777778
0.6
0
0
0
0
0
0
0
0
0
0
0.192771
83
6
29
13.833333
0.746269
0
0
0
0
0
0.097561
0
0
0
0
0
0
1
0
false
0.25
0.25
0
0.25
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
1
0
0
0
0
0
4
866626cb29e8e980111eacc367057c757b307ae9
158
py
Python
py_tdlib/constructors/callback_query_answer.py
Mr-TelegramBot/python-tdlib
2e2d21a742ebcd439971a32357f2d0abd0ce61eb
[ "MIT" ]
24
2018-10-05T13:04:30.000Z
2020-05-12T08:45:34.000Z
py_tdlib/constructors/callback_query_answer.py
MrMahdi313/python-tdlib
2e2d21a742ebcd439971a32357f2d0abd0ce61eb
[ "MIT" ]
3
2019-06-26T07:20:20.000Z
2021-05-24T13:06:56.000Z
py_tdlib/constructors/callback_query_answer.py
MrMahdi313/python-tdlib
2e2d21a742ebcd439971a32357f2d0abd0ce61eb
[ "MIT" ]
5
2018-10-05T14:29:28.000Z
2020-08-11T15:04:10.000Z
from ..factory import Type class callbackQueryAnswer(Type): text = None # type: "string" show_alert = None # type: "Bool" url = None # type: "string"
19.75
34
0.670886
20
158
5.25
0.65
0.228571
0.266667
0
0
0
0
0
0
0
0
0
0.202532
158
7
35
22.571429
0.833333
0.265823
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.2
0
1
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
866eaf43523f7f1d896bcc2e39e8076371c0fa7c
52
py
Python
sksurgeryspherefitting/ui/__init__.py
astaolaf/sksurgeryspherefitting
59ff3cf50b3928734a9b1af0be2c07d559305e89
[ "BSD-3-Clause" ]
1
2021-10-04T21:45:16.000Z
2021-10-04T21:45:16.000Z
sksurgeryspherefitting/ui/__init__.py
astaolaf/sksurgeryspherefitting
59ff3cf50b3928734a9b1af0be2c07d559305e89
[ "BSD-3-Clause" ]
5
2021-07-06T10:17:52.000Z
2021-07-20T09:30:36.000Z
sksurgeryspherefitting/ui/__init__.py
thompson318/scikit-surgery-sphere-fitting
bfc275c02f5fea570a4b0389c1d7aaec97fe3a77
[ "BSD-3-Clause" ]
1
2021-07-21T10:36:17.000Z
2021-07-21T10:36:17.000Z
# coding=utf-8 """scikit-surgery-sphere-fitting"""
13
35
0.692308
7
52
5.142857
1
0
0
0
0
0
0
0
0
0
0
0.020833
0.076923
52
3
36
17.333333
0.729167
0.826923
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
867896d41412f1404362561ecb9860cb1ae2aaff
960
py
Python
deepr/layers/__init__.py
Mbompr/deepr
1fb28e15aeeac6ef2d8e5b678feb380f2b1951f2
[ "Apache-2.0" ]
null
null
null
deepr/layers/__init__.py
Mbompr/deepr
1fb28e15aeeac6ef2d8e5b678feb380f2b1951f2
[ "Apache-2.0" ]
null
null
null
deepr/layers/__init__.py
Mbompr/deepr
1fb28e15aeeac6ef2d8e5b678feb380f2b1951f2
[ "Apache-2.0" ]
null
null
null
# pylint: disable=unused-import,missing-docstring from deepr.layers.base import Layer, layer from deepr.layers.bpr import BPR, MaskedBPR from deepr.layers.click_rank import ClickRank from deepr.layers.combinators import Sequential, Select, Rename, Parallel from deepr.layers.core import Product, Sum, Concat, Dense, LogicalAnd, DotProduct, Add, Identity, Conv1d from deepr.layers.dropout import SpatialDropout1D, Dropout from deepr.layers.embedding import Embedding, CombineEmbeddings from deepr.layers.lookup import Lookup, LookupFromFile, LookupFromMapping, table_from_file, table_from_mapping from deepr.layers.mask import Equal, NotEqual, BooleanMask, BooleanReduceMode, LookAheadMask, PaddingMask from deepr.layers.reduce import Average, WeightedAverage from deepr.layers.size import IsMinSize from deepr.layers.slice import Slice, SliceFirst, SliceLast, SliceLastPadded from deepr.layers.sparse import ToDense from deepr.layers.string import StringJoin
56.470588
110
0.84375
123
960
6.544715
0.495935
0.156522
0.26087
0
0
0
0
0
0
0
0
0.002294
0.091667
960
16
111
60
0.920872
0.048958
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
1
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
86839261761c333d615a992e37ea0b6dd8a5756f
135
py
Python
src/hypercorn/__init__.py
ai-mocap/hypercorn
0c1a74a726d5e54a2a3876edba8ad2a0a547c5d5
[ "MIT" ]
264
2018-06-02T17:49:46.000Z
2022-03-29T07:39:06.000Z
src/hypercorn/__init__.py
ai-mocap/hypercorn
0c1a74a726d5e54a2a3876edba8ad2a0a547c5d5
[ "MIT" ]
52
2018-06-14T19:30:00.000Z
2022-02-27T04:26:48.000Z
src/hypercorn/__init__.py
ai-mocap/hypercorn
0c1a74a726d5e54a2a3876edba8ad2a0a547c5d5
[ "MIT" ]
29
2018-06-13T23:54:48.000Z
2022-02-20T15:23:14.000Z
from __future__ import annotations from .__about__ import __version__ from .config import Config __all__ = ("__version__", "Config")
19.285714
35
0.792593
15
135
5.8
0.533333
0
0
0
0
0
0
0
0
0
0
0
0.133333
135
6
36
22.5
0.74359
0
0
0
0
0
0.125926
0
0
0
0
0
0
1
0
false
0
0.75
0
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
868c1f12792535657c33e2bd05882003c80e3047
36
py
Python
Bronze/Bronze_V/15439.py
masterTyper/baekjoon_solved_ac
b9ce14d9bdaa5b5b06735ad075fb827de9f44b9c
[ "MIT" ]
null
null
null
Bronze/Bronze_V/15439.py
masterTyper/baekjoon_solved_ac
b9ce14d9bdaa5b5b06735ad075fb827de9f44b9c
[ "MIT" ]
null
null
null
Bronze/Bronze_V/15439.py
masterTyper/baekjoon_solved_ac
b9ce14d9bdaa5b5b06735ad075fb827de9f44b9c
[ "MIT" ]
null
null
null
N = int(input()) print(N * (N - 1))
12
18
0.472222
7
36
2.428571
0.714286
0
0
0
0
0
0
0
0
0
0
0.035714
0.222222
36
3
18
12
0.571429
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
86a4467b908ef9d7ddf42746224146716571d58a
418
py
Python
erica/domain/BackgroundJobs/BackgroundJobInterface.py
digitalservice4germany/erica
7e07d88f3db78ab6e4f7cccad8dfef2a4b3a71b2
[ "MIT" ]
3
2022-01-31T15:17:17.000Z
2022-03-01T16:15:47.000Z
erica/domain/BackgroundJobs/BackgroundJobInterface.py
digitalservice4germany/erica
7e07d88f3db78ab6e4f7cccad8dfef2a4b3a71b2
[ "MIT" ]
59
2022-01-31T14:04:20.000Z
2022-03-31T20:08:47.000Z
erica/domain/BackgroundJobs/BackgroundJobInterface.py
digitalservice4germany/erica
7e07d88f3db78ab6e4f7cccad8dfef2a4b3a71b2
[ "MIT" ]
1
2022-03-10T09:24:28.000Z
2022-03-10T09:24:28.000Z
from abc import ABCMeta, abstractmethod from rq.job import Job class BackgroundJobInterface: __metaclass__ = ABCMeta @abstractmethod def enqueue(self, f, *args, **kwargs): pass @abstractmethod def scheduled_enqueue(self): pass @abstractmethod def get_enqueued_job_by_id(self, job_id): pass @abstractmethod def list_all_jobs(self) -> Job: pass
17.416667
45
0.665072
47
418
5.659574
0.531915
0.255639
0.236842
0
0
0
0
0
0
0
0
0
0.26555
418
23
46
18.173913
0.86645
0
0
0.5
0
0
0
0
0
0
0
0
0
1
0.25
false
0.25
0.125
0
0.5
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
4
86a5d2476bd98a2e468661edc8e320d41498063e
181
py
Python
appname/models.py
bitmazk/django-reusable-app-boilerplate
4c706e94cca2ad73d788b282f2232d9a2c8e006b
[ "Unlicense" ]
2
2015-02-11T06:33:34.000Z
2015-11-08T16:09:43.000Z
appname/models.py
bitmazk/django-reusable-app-boilerplate
4c706e94cca2ad73d788b282f2232d9a2c8e006b
[ "Unlicense" ]
null
null
null
appname/models.py
bitmazk/django-reusable-app-boilerplate
4c706e94cca2ad73d788b282f2232d9a2c8e006b
[ "Unlicense" ]
null
null
null
"""Models for appname application.""" from django.db import models class Example(models.Model): """Example model class.""" text = models.TextField(blank=True, null=True)
20.111111
50
0.701657
23
181
5.521739
0.695652
0
0
0
0
0
0
0
0
0
0
0
0.154696
181
8
51
22.625
0.830065
0.287293
0
0
0
0
0
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
86d560905a3beab11596734411ccf9c505a9b0b1
81
py
Python
enthought/logger/plugin/view/logger_preferences_page.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
3
2016-12-09T06:05:18.000Z
2018-03-01T13:00:29.000Z
enthought/logger/plugin/view/logger_preferences_page.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
1
2020-12-02T00:51:32.000Z
2020-12-02T08:48:55.000Z
enthought/logger/plugin/view/logger_preferences_page.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
null
null
null
# proxy module from apptools.logger.plugin.view.logger_preferences_page import *
27
65
0.839506
11
81
6
0.909091
0
0
0
0
0
0
0
0
0
0
0
0.08642
81
2
66
40.5
0.891892
0.148148
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
86ee5ee9f80bef9fe398affb4835374eb00496b1
92
py
Python
example/cities/models.py
azevakin/django-google-json-style-api
f1d8058ed7ce03368ea36ca333e96e21fa74b2e1
[ "MIT" ]
1
2021-10-19T20:00:02.000Z
2021-10-19T20:00:02.000Z
example/cities/models.py
azevakin/django-google-json-style-api
f1d8058ed7ce03368ea36ca333e96e21fa74b2e1
[ "MIT" ]
null
null
null
example/cities/models.py
azevakin/django-google-json-style-api
f1d8058ed7ce03368ea36ca333e96e21fa74b2e1
[ "MIT" ]
null
null
null
from django.db import models class City(models.Model): city_name = models.TextField()
15.333333
34
0.73913
13
92
5.153846
0.769231
0
0
0
0
0
0
0
0
0
0
0
0.163043
92
5
35
18.4
0.87013
0
0
0
0
0
0
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
810a89bfd50eb87555723b959d800aa61b433e9a
215
py
Python
Ex_88.py
soldierloko/Curso-em-Video
d867366425f72fe15903cb17cdc222a7fe7a3831
[ "MIT" ]
null
null
null
Ex_88.py
soldierloko/Curso-em-Video
d867366425f72fe15903cb17cdc222a7fe7a3831
[ "MIT" ]
null
null
null
Ex_88.py
soldierloko/Curso-em-Video
d867366425f72fe15903cb17cdc222a7fe7a3831
[ "MIT" ]
null
null
null
#Faça um programa que ajude um jogador da mega sena a criar palpites. #O programa vai perguntar quantos jogos serão gerados e vai sortear 6 números entre 1 e 60 para cada jogo, cadastrando tudo em uma lista composta
107.5
145
0.804651
39
215
4.435897
0.897436
0
0
0
0
0
0
0
0
0
0
0.022599
0.176744
215
2
145
107.5
0.954802
0.986047
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
81235bc67a634555efdcb9d6d3f28404bcbcc597
169
py
Python
krotos/msd/latent/als.py
KelvinLu/krotos-convnet
e37218aeaf10b73d77dfac911be46d8ab689e41d
[ "MIT" ]
5
2017-03-23T15:49:23.000Z
2019-03-12T04:23:48.000Z
krotos/msd/latent/als.py
KelvinLu/krotos-convnet
e37218aeaf10b73d77dfac911be46d8ab689e41d
[ "MIT" ]
null
null
null
krotos/msd/latent/als.py
KelvinLu/krotos-convnet
e37218aeaf10b73d77dfac911be46d8ab689e41d
[ "MIT" ]
null
null
null
import numpy as np def confidence_transform(R, param_alpha, param_epsilon): C = R.copy() C.data = param_alpha * np.log(1 + param_epsilon * C.data) return C
24.142857
61
0.686391
28
169
3.964286
0.607143
0.18018
0.234234
0
0
0
0
0
0
0
0
0.007463
0.207101
169
6
62
28.166667
0.820896
0
0
0
0
0
0
0
0
0
0
0
0
1
0.2
false
0
0.2
0
0.6
0
1
0
0
null
0
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
812f267e257f285b4d2535a3900ca50e4f41b7ed
93
py
Python
logistics/apps.py
Oswaldinho24k/geo-csv
0100435c5d5a5fd12133b376b305e8fa79ddb8f0
[ "MIT" ]
null
null
null
logistics/apps.py
Oswaldinho24k/geo-csv
0100435c5d5a5fd12133b376b305e8fa79ddb8f0
[ "MIT" ]
null
null
null
logistics/apps.py
Oswaldinho24k/geo-csv
0100435c5d5a5fd12133b376b305e8fa79ddb8f0
[ "MIT" ]
null
null
null
from django.apps import AppConfig class LogisticsConfig(AppConfig): name = 'logistics'
15.5
33
0.763441
10
93
7.1
0.9
0
0
0
0
0
0
0
0
0
0
0
0.16129
93
5
34
18.6
0.910256
0
0
0
0
0
0.096774
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
813d7a5aece7b4bd476e70e59f740c180985e4f3
82
py
Python
mcli/apps.py
xurvan/django-mcli
be6939cfb89eddfc66d83f9d15f2d28414ff9e1a
[ "Apache-2.0" ]
1
2020-11-18T11:08:40.000Z
2020-11-18T11:08:40.000Z
mcli/apps.py
xurvan/django-mcli
be6939cfb89eddfc66d83f9d15f2d28414ff9e1a
[ "Apache-2.0" ]
null
null
null
mcli/apps.py
xurvan/django-mcli
be6939cfb89eddfc66d83f9d15f2d28414ff9e1a
[ "Apache-2.0" ]
null
null
null
from django.apps import AppConfig class MliConfig(AppConfig): name = 'mcli'
13.666667
33
0.731707
10
82
6
0.9
0
0
0
0
0
0
0
0
0
0
0
0.182927
82
5
34
16.4
0.895522
0
0
0
0
0
0.04878
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
d4958761e5f2519fa2a7a6f58360e1a22fe926f0
658
py
Python
aiogram/types/video.py
SvineruS/aiogram
7892edf45302fa195544430ac5db11dcbcbf7ae6
[ "MIT" ]
2,744
2017-11-19T00:56:19.000Z
2022-03-31T15:48:23.000Z
aiogram/types/video.py
SvineruS/aiogram
7892edf45302fa195544430ac5db11dcbcbf7ae6
[ "MIT" ]
513
2018-01-23T16:52:59.000Z
2022-03-27T01:50:30.000Z
aiogram/types/video.py
SvineruS/aiogram
7892edf45302fa195544430ac5db11dcbcbf7ae6
[ "MIT" ]
813
2017-12-05T06:49:48.000Z
2022-03-29T15:47:50.000Z
from . import base from . import fields from . import mixins from .photo_size import PhotoSize class Video(base.TelegramObject, mixins.Downloadable): """ This object represents a video file. https://core.telegram.org/bots/api#video """ file_id: base.String = fields.Field() file_unique_id: base.String = fields.Field() width: base.Integer = fields.Field() height: base.Integer = fields.Field() duration: base.Integer = fields.Field() thumb: PhotoSize = fields.Field(base=PhotoSize) file_name: base.String = fields.Field() mime_type: base.String = fields.Field() file_size: base.Integer = fields.Field()
29.909091
54
0.699088
85
658
5.329412
0.411765
0.218543
0.14128
0.18543
0.165563
0
0
0
0
0
0
0
0.180851
658
21
55
31.333333
0.840445
0.118541
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.285714
0
1
0
0
0
0
null
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
1
0
0
4
d4a2485263e98380c725f8c3459922fd5f74a2fd
1,092
py
Python
lib/systems/l-valine.py
pulsar-chem/BPModule
f8e64e04fdb01947708f098e833600c459c2ff0e
[ "BSD-3-Clause" ]
null
null
null
lib/systems/l-valine.py
pulsar-chem/BPModule
f8e64e04fdb01947708f098e833600c459c2ff0e
[ "BSD-3-Clause" ]
null
null
null
lib/systems/l-valine.py
pulsar-chem/BPModule
f8e64e04fdb01947708f098e833600c459c2ff0e
[ "BSD-3-Clause" ]
null
null
null
import pulsar as psr def load_ref_system(): """ Returns l-valine as found in the IQMol fragment library. All credit to https://github.com/nutjunkie/IQmol """ return psr.make_system(""" C 0.2036 -0.4958 0.3403 N 1.4832 -1.2440 0.2997 C 0.3147 0.9660 0.8346 C -1.0593 1.6179 0.8658 C 0.9346 1.0303 2.2224 C -0.3596 -0.5230 -1.0775 O 0.1045 -0.0437 -2.0961 O -1.5354 -1.1775 -1.2134 H -0.4768 -1.0587 1.0299 H 1.8309 -1.3539 1.2292 H 2.1548 -0.7502 -0.2505 H 0.9641 1.5372 0.1249 H -1.5332 1.6117 -0.1249 H -0.9924 2.6651 1.1892 H -1.7373 1.1021 1.5594 H 0.9116 2.0570 2.6127 H 1.9862 0.7132 2.2244 H 0.3950 0.3965 2.9394 H -1.8067 -1.1757 -2.1262 """)
40.444444
64
0.406593
163
1,092
2.705521
0.546012
0.022676
0.027211
0
0
0
0
0
0
0
0
0.518182
0.496337
1,092
26
65
42
0.283636
0.096154
0
0
0
0
0.913133
0
0
0
0
0
0
1
0.043478
true
0
0.043478
0
0.130435
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
1
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
d4bb62b0feb68dbd8ceaa357e7b8e913051931b5
200
py
Python
liable/functions/__init__.py
lycantropos/liable
d61f6602cde34b8e5a315f695f3d29c2f41409af
[ "MIT" ]
null
null
null
liable/functions/__init__.py
lycantropos/liable
d61f6602cde34b8e5a315f695f3d29c2f41409af
[ "MIT" ]
null
null
null
liable/functions/__init__.py
lycantropos/liable
d61f6602cde34b8e5a315f695f3d29c2f41409af
[ "MIT" ]
null
null
null
from .utils import (ARGUMENTS_TEMPLATES, FunctionCall, Argument, signature, dependants_paths, walk)
28.571429
40
0.415
11
200
7.363636
1
0
0
0
0
0
0
0
0
0
0
0
0.545
200
6
41
33.333333
0.89011
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.166667
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
1
0
0
0
0
0
0
4
d4f24927b97a46e256f61043aec597c6e8c451ac
1,187
py
Python
setup.py
bitrate16/aiohttp-dynamic
0ac6d94c300b9e93cde971be81b72aa4e994048e
[ "Apache-2.0" ]
1
2021-10-15T02:37:04.000Z
2021-10-15T02:37:04.000Z
setup.py
bitrate16/aiohttp-dynamic
0ac6d94c300b9e93cde971be81b72aa4e994048e
[ "Apache-2.0" ]
null
null
null
setup.py
bitrate16/aiohttp-dynamic
0ac6d94c300b9e93cde971be81b72aa4e994048e
[ "Apache-2.0" ]
null
null
null
from setuptools import setup setup( name = 'aiohttp_dynamic', packages = ['aiohttp_dynamic'], version = '1.3.0', license='Apache License 2.0', description = 'aiohttp extension for creating and modifying dynamic routes in runtime', author = 'bitrate16', author_email = 'bitrate16@gmail.com', url = 'https://github.com/bitrate16/aiohttp-dynamic', download_url = 'https://github.com/bitrate16/aiohttp-dynamic/archive/1.2.0.tar.gz', keywords = ['aiohttp', 'dynamic', 'routing', 'mutable', 'aiohttp-server'], install_requires = [ 'aiohttp', 'yarl' ], classifiers = [ # Chose either "3 - Alpha", "4 - Beta" or "5 - Production/Stable" as the current state of your package 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Topic :: Software Development :: Libraries :: Python Modules', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11' ] )
35.969697
104
0.679023
142
1,187
5.640845
0.56338
0.166042
0.218477
0.227216
0.099875
0.099875
0.099875
0
0
0
0
0.036145
0.16091
1,187
32
105
37.09375
0.768072
0.084246
0
0
0
0.033333
0.686636
0
0
0
0
0
0
1
0
true
0
0.033333
0
0.033333
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
d4f75ed18e5132f76ddcf8cb6ed9eb5a7d4526b0
12,202
py
Python
bitsy/bitsy.py
JaideepSagar1997/bitsy
12c3ae89daff7471a33b45850350f3df2b552215
[ "MIT" ]
1
2019-12-31T10:04:38.000Z
2019-12-31T10:04:38.000Z
bitsy/bitsy.py
JaideepSagar1997/bitsy
12c3ae89daff7471a33b45850350f3df2b552215
[ "MIT" ]
1
2019-12-31T06:38:48.000Z
2019-12-31T06:38:48.000Z
bitsy/bitsy.py
JaideepSagar1997/bitsy
12c3ae89daff7471a33b45850350f3df2b552215
[ "MIT" ]
null
null
null
import math import numpy as np import re class bitstream: def __init__(self,array = None): if(str(locals()['array']) == 'None'): self.array_unit_size = 8 self.array_type = 'uint' self.valid = True self.read_index = 0 self.r_bit_index = 0 self.write_index = 0 self.w_bit_index = 0 self.array = np.zeros((8),dtype = 'uint8') self.capacity = 8*self.array_unit_size self.size = 0 else: self.array_unit_size = int(re.search(r'\d+',str(array.dtype)).group()) self.array_type = re.findall('[a-zA-Z]+',str(array.dtype))[0] if(not(math.floor(math.log(self.array_unit_size,2)) == math.log(self.array_unit_size,2)) or not(self.array_type == 'uint')): print('Error : Array must be of valid dtype (uint) ',self.array_type,' ',math.log(self.array_unit_size,2)) self.valid = False return if(len(array.shape)>1): print(array.shape) print('Error : Array must be one dimensional') self.valid = False return self.valid = True self.read_index = 0 self.r_bit_index = 0 array_size = 2**math.ceil(math.log(len(array)+1,2)) self.array = np.zeros((array_size),dtype = array.dtype) self.array[0:len(array)] = array self.capacity = array_size * self.array_unit_size self.write_index = len(array) self.w_bit_index = 0 self.size = len(array)*self.array_unit_size """ def size(self): ri = self.read_index wi = self.write_index if(self.read_index> self.write_index): wi = wi + len(self.array) count = (wi - ri -1)*self.array_unit_size count = count + self.w_bit_index + (self.array_unit_size - self.r_bit_index + 1) return count """ def get_next(self, number_of_bits): if ((not self.valid) or self.is_empty()): print('Error : Either stream doesnt have enough bits or stream does not contain valid data') return if ((number_of_bits > self.size)): number_of_bits = self.size rbi = self.r_bit_index ri = self.read_index s = self.size if (self.r_bit_index + number_of_bits - 1 < self.array_unit_size): #print('before : ',self.read_index, ' ', self.r_bit_index) mask = int(2 ** number_of_bits) - 1 mask = mask << (self.r_bit_index) ans = (mask & self.array[self.read_index]) >> self.r_bit_index self.r_bit_index = (self.r_bit_index + number_of_bits) % self.array_unit_size if (self.r_bit_index == 0): self.read_index = (self.read_index + 1) % len(self.array) #print('after : ',self.read_index,' ',self.r_bit_index) #print(bin(ans)) else: num_bits_frm_cur = self.array_unit_size - self.r_bit_index num_bits_frm_nxt = number_of_bits - num_bits_frm_cur ans1 = self.read(num_bits_frm_cur) if (not (self.r_bit_index == 0)): self.read_index = (self.read_index + 1) % len(self.array) ans2 = self.read(num_bits_frm_nxt) # ans = (ans2<<math.ceil(math.log(ans1+1,2))) + ans1 ans = (ans2 << (num_bits_frm_cur)) + ans1 #print(ans2 << (num_bits_frm_cur) ,'+', ans1) self.r_bit_index = rbi self.read_index = ri self.size = s return ans def read(self,number_of_bits): s = self.size if((not self.valid )or self.is_empty()): print('Error : Either stream doesnt have enough bits or stream does not contain valid data') return if((number_of_bits > self.size)): number_of_bits = self.size if(self.r_bit_index + number_of_bits-1 < self.array_unit_size): mask = int(2**number_of_bits) - 1 mask = mask<<(self.r_bit_index) ans = (mask & self.array[self.read_index])>>self.r_bit_index self.r_bit_index = (self.r_bit_index + number_of_bits)%self.array_unit_size if(self.r_bit_index == 0): self.read_index = (self.read_index +1)%len(self.array) self.size = self.size - number_of_bits #print(self.read_index,' ',self.r_bit_index) #print(bin(ans)) else: num_bits_frm_cur = self.array_unit_size - self.r_bit_index num_bits_frm_nxt = number_of_bits - num_bits_frm_cur ans1 = self.read(num_bits_frm_cur) if(not(self.r_bit_index == 0)): self.read_index = (self.read_index +1)%len(self.array) ans2 = self.read(num_bits_frm_nxt) #ans = (ans2<<math.ceil(math.log(ans1+1,2))) + ans1 ans = (ans2<<(num_bits_frm_cur)) + ans1 s2 = self.size #print(s-s2,'removed : ',ans) return ans def write(self,number_of_bits,val): s = self.array_unit_size w = self.w_bit_index wi = self.write_index r = self.r_bit_index ri = self.read_index rb = ri*s + r wb = wi *s + w if(self.size+number_of_bits > self.capacity): a = self.array self.array = np.zeros((2*len(a)),dtype= a.dtype) self.capacity = 2*len(a)*s if(rb<wb): self.array[0:(wi-ri+1)] = a[r:(wi+1)] self.read_index = 0 self.write_index = wi-ri else: self.array[0:wi]=a[0:wi] self.array[-(len(a) - ri):] = a[ri:] self.read_index = len(self.array) -(len(a) - ri) if(number_of_bits + self.w_bit_index -1 < self.array_unit_size): x = self.array[self.write_index] val = val << self.w_bit_index mask = 2**number_of_bits - 1 mask = mask<<(self.w_bit_index) self.array[self.write_index]= (val & mask) + (x &(~mask)) self.w_bit_index = (self.w_bit_index + number_of_bits)%self.array_unit_size if(self.w_bit_index == 0): self.write_index = (self.write_index +1)%len(self.array) self.size = self.size + number_of_bits else: num_bits_in_cur = self.array_unit_size - self.w_bit_index num_bits_in_nxt = number_of_bits - num_bits_in_cur self.write(num_bits_in_cur, val) if(not(self.w_bit_index == 0)): self.write_index = (self.write_index +1)%len(self.array) val = val>>(num_bits_in_cur) self.write(num_bits_in_nxt,val ) def read_from_end(self, number_of_bits): s = self.size if ((not self.valid) or self.is_empty()): print('Error : Either stream doesnt have enough bits or stream does not contain valid data') return if ((number_of_bits > self.size)): number_of_bits = self.size if (self.r_bit_index + number_of_bits - 1 < self.array_unit_size): mask = int(2 ** number_of_bits) - 1 mask = mask << (self.r_bit_index) ans = (mask & self.array[self.read_index]) >> self.r_bit_index self.r_bit_index = (self.r_bit_index + number_of_bits) % self.array_unit_size if (self.r_bit_index == 0): self.read_index = (self.read_index + 1) % len(self.array) self.size = self.size - number_of_bits # print(self.read_index,' ',self.r_bit_index) # print(bin(ans)) else: num_bits_frm_cur = self.array_unit_size - self.r_bit_index num_bits_frm_nxt = number_of_bits - num_bits_frm_cur ans1 = self.read(num_bits_frm_cur) if (not (self.r_bit_index == 0)): self.read_index = (self.read_index + 1) % len(self.array) ans2 = self.read(num_bits_frm_nxt) # ans = (ans2<<math.ceil(math.log(ans1+1,2))) + ans1 ans = (ans2 << (num_bits_frm_cur)) + ans1 s2 = self.size # print(s-s2,'removed : ',ans) return ans def write_in_front(self, number_of_bits, val): s = self.array_unit_size w = self.w_bit_index wi = self.write_index r = self.r_bit_index ri = self.read_index rb = ri * s + r wb = wi * s + w if (self.size + number_of_bits > self.capacity): a = self.array self.array = np.zeros((2 * len(a)), dtype=a.dtype) self.capacity = 2 * len(a) * s if (rb < wb): self.array[0:(wi - ri + 1)] = a[r:(wi + 1)] self.read_index = 0 self.write_index = wi - ri else: self.array[0:wi] = a[0:wi] self.array[-(len(a) - ri):] = a[ri:] self.read_index = len(self.array) - (len(a) - ri) if (number_of_bits + self.w_bit_index - 1 < self.array_unit_size): x = self.array[self.write_index] val = val << self.w_bit_index mask = 2 ** number_of_bits - 1 mask = mask << (self.w_bit_index) self.array[self.write_index] = (val & mask) + (x & (~mask)) self.w_bit_index = (self.w_bit_index + number_of_bits) % self.array_unit_size if (self.w_bit_index == 0): self.write_index = (self.write_index + 1) % len(self.array) self.size = self.size + number_of_bits else: num_bits_in_cur = self.array_unit_size - self.w_bit_index num_bits_in_nxt = number_of_bits - num_bits_in_cur self.write(num_bits_in_cur, val) if (not (self.w_bit_index == 0)): self.write_index = (self.write_index + 1) % len(self.array) val = val >> (num_bits_in_cur) self.write(num_bits_in_nxt, val) def show(self): i = self.read_index while(True): x = self.array[i] if(i == self.read_index): x = x >> self.r_bit_index print(bin(x)) i=(i+1)%len(self.array) if((i == self.write_index)): x = self.array[self.write_index] if(not(self.w_bit_index == 0)): x = (int(2**(self.w_bit_index)) - 1) & x print(bin(x)) break def get_array(self): i = 0 size = math.ceil(self.size/self.array_unit_size) ans = np.zeros((size),dtype = (str(self.array_type)+str(self.array_unit_size))) ri = self.read_index = 0 rbi = self.r_bit_index = 0 wi = self.write_index = len(ans) wbi = self.w_bit_index for i in range(size-1): #print('unit size',self.array_unit_size) ans[i] = self.read(self.array_unit_size) #print(ans[i]) ans[size - 1] = self.read(self.size) #self.array[0:len(ans)] = ans self.read_index = ri self.r_bit_index = rbi self.write_index = wi self.w_bit_index = wbi self.size = size * self.array_unit_size return ans def is_empty(self): return (self.size == 0) """ a = np.array([1,2,4,5],dtype='uint8') bs = bitstream(a); bs.show() print(bs.read(3)) print(bs.read(3)) print(bs.read(3)) print("now") bs.show() ar = bs.get_array() print(ar) print("now") bs.show() """
34.763533
137
0.520734
1,674
12,202
3.533453
0.0681
0.114117
0.051395
0.083516
0.790194
0.749789
0.713102
0.692815
0.683009
0.676078
0
0.016164
0.36117
12,202
351
138
34.763533
0.742656
0.047287
0
0.742222
0
0
0.034064
0
0
0
0
0
0
1
0.04
false
0
0.013333
0.004444
0.102222
0.035556
0
0
0
null
0
0
0
0
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
d4fce6eec453eadbcaa34439ed8ee5a627f93a72
225
py
Python
gapipy/models/dossier_feature.py
wmak/gapipy
b6849606d4f6af24b9f871f65e87aaf0d0c013cc
[ "MIT" ]
4
2015-03-19T02:10:35.000Z
2018-10-22T19:51:44.000Z
gapipy/models/dossier_feature.py
wmak/gapipy
b6849606d4f6af24b9f871f65e87aaf0d0c013cc
[ "MIT" ]
69
2015-03-11T20:58:04.000Z
2021-10-12T18:39:15.000Z
gapipy/models/dossier_feature.py
wmak/gapipy
b6849606d4f6af24b9f871f65e87aaf0d0c013cc
[ "MIT" ]
1
2016-08-31T15:22:43.000Z
2016-08-31T15:22:43.000Z
from .base import BaseModel class DossierFeatureParent(BaseModel): _as_is_fields = ['id', 'label', 'code', 'description'] class DossierFeatureChild(BaseModel): _as_is_fields = ['id', 'label', 'code', 'description']
28.125
58
0.711111
24
225
6.416667
0.583333
0.142857
0.168831
0.246753
0.532468
0.532468
0.532468
0.532468
0
0
0
0
0.133333
225
7
59
32.142857
0.789744
0
0
0.4
0
0
0.195556
0
0
0
0
0
0
1
0
false
0
0.2
0
1
0
1
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
4
be0bc34bf30e97786a304ca35a013bc9004b63d0
243
py
Python
pages/models.py
morenoh149/djangox-autocomplete-light
b549cb5f33202464c58d647fcc1f60faa9985d3d
[ "MIT" ]
1
2021-09-16T00:49:52.000Z
2021-09-16T00:49:52.000Z
pages/models.py
morenoh149/djangox-autocomplete-light
b549cb5f33202464c58d647fcc1f60faa9985d3d
[ "MIT" ]
1
2021-06-10T20:27:15.000Z
2021-06-10T20:27:15.000Z
pages/models.py
morenoh149/djangox-autocomplete-light
b549cb5f33202464c58d647fcc1f60faa9985d3d
[ "MIT" ]
null
null
null
from django.db import models class Company(models.Model): name = models.CharField(blank=True, max_length=300) ticker = models.CharField(blank=True, max_length=300) def __str__(self): return f"({self.ticker}) {self.name}"
27
57
0.699588
34
243
4.823529
0.617647
0.182927
0.243902
0.292683
0.439024
0.439024
0.439024
0
0
0
0
0.029703
0.168724
243
9
58
27
0.782178
0
0
0
0
0
0.110656
0
0
0
0
0
0
1
0.166667
false
0
0.166667
0.166667
1
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
0
0
0
4
be1d5641a3c516f7e7796eda3959bb8c879fd680
594
py
Python
python/anyascii/_data/_21f.py
casept/anyascii
d4f426b91751254b68eaa84c6cd23099edd668e6
[ "ISC" ]
null
null
null
python/anyascii/_data/_21f.py
casept/anyascii
d4f426b91751254b68eaa84c6cd23099edd668e6
[ "ISC" ]
null
null
null
python/anyascii/_data/_21f.py
casept/anyascii
d4f426b91751254b68eaa84c6cd23099edd668e6
[ "ISC" ]
null
null
null
b=' Chi Po Die Mom Chop Lei Yi Gaan Dian Zeon Dun Gao Hu Xiao Ga Peng Shen Wei Vot Rung Dui Chao Yin Kuai Ku Zui Gu Yun Zhi Ji Cheng Xie Xian Zui An Hao Po Di Ye Nao Fai Non Jie Bang Lan Cang Bi Zhan Qi Lom Nao Lu Kuang Mo Lei Pao Li Ceng Dang Lei E Beng Jue Hei Zam Xuan Nie Hai Doi Doc Lom Xian Jian Mi Nie Ngoi Cang Song Zeng Yi Chong Cang Ngong Lei Nuo Li Li Luo Tang Nie Nie Ji Lei Nang Lin Ling Xian Yu Zai Quan Lie Yu Huang Nao Xun Ju Huo'
594
594
0.565657
108
594
3.111111
0.805556
0
0
0
0
0
0
0
0
0
0
0
0.429293
594
1
594
594
0.99115
0
0
0
0
1
0.991597
0
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
be2a8d76e204c0ddb858e691370bb5d8f8f44f93
238
py
Python
friendly_computing_machine/__init__.py
yohanna123/friendly-computing-machine
68d4f1c9098688f0fe59c7c586d4ee554450f86c
[ "BSD-3-Clause" ]
null
null
null
friendly_computing_machine/__init__.py
yohanna123/friendly-computing-machine
68d4f1c9098688f0fe59c7c586d4ee554450f86c
[ "BSD-3-Clause" ]
null
null
null
friendly_computing_machine/__init__.py
yohanna123/friendly-computing-machine
68d4f1c9098688f0fe59c7c586d4ee554450f86c
[ "BSD-3-Clause" ]
null
null
null
""" This is the base file of the friendly_computing_machine! """ #. means current folder. To import your math. from . import math from .math import mult # look into your math file and find mult and will drop to friendly_computing_maching
34
107
0.773109
39
238
4.615385
0.641026
0.188889
0
0
0
0
0
0
0
0
0
0
0.168067
238
6
108
39.666667
0.909091
0.773109
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
078d4dd915cf5ae23c4bd38407d1a306409bf870
234
py
Python
iteraciones.py
Naxred/PensamientoComputacionalPython
a19fe394fd8b6265d486d432bbc5774d0cf35368
[ "Unlicense" ]
null
null
null
iteraciones.py
Naxred/PensamientoComputacionalPython
a19fe394fd8b6265d486d432bbc5774d0cf35368
[ "Unlicense" ]
null
null
null
iteraciones.py
Naxred/PensamientoComputacionalPython
a19fe394fd8b6265d486d432bbc5774d0cf35368
[ "Unlicense" ]
null
null
null
contador_externo = 0 contador_interno = 0 while contador_externo < 5: while contador_interno < 6: print(contador_externo, contador_interno) contador_interno += 1 contador_externo += 1 contador_interno = 0
23.4
49
0.709402
28
234
5.607143
0.321429
0.477707
0.203822
0
0
0
0
0
0
0
0
0.038889
0.230769
234
9
50
26
0.833333
0
0
0.25
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0.125
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
079cbb406b6db40ec3c831a12198e9c8a020247e
2,250
py
Python
airflow/models/__init__.py
ankit-shrivastava/airflow
77b1bdc12ca5ddf043d4550d36948766b59f60ce
[ "Apache-2.0" ]
1
2020-01-04T07:22:27.000Z
2020-01-04T07:22:27.000Z
airflow/models/__init__.py
ankit-shrivastava/airflow
77b1bdc12ca5ddf043d4550d36948766b59f60ce
[ "Apache-2.0" ]
null
null
null
airflow/models/__init__.py
ankit-shrivastava/airflow
77b1bdc12ca5ddf043d4550d36948766b59f60ce
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. """Airflow models""" from airflow.models.base import ID_LEN, Base # noqa: F401 from airflow.models.baseoperator import BaseOperator, BaseOperatorLink # noqa: F401 from airflow.models.connection import Connection # noqa: F401 from airflow.models.dag import DAG, DagModel # noqa: F401 from airflow.models.dagbag import DagBag # noqa: F401 from airflow.models.dagpickle import DagPickle # noqa: F401 from airflow.models.dagrun import DagRun # noqa: F401 from airflow.models.errors import ImportError # noqa: F401, pylint: disable=redefined-builtin from airflow.models.log import Log # noqa: F401 from airflow.models.pool import Pool # noqa: F401 from airflow.models.skipmixin import SkipMixin # noqa: F401 from airflow.models.slamiss import SlaMiss # noqa: F401 from airflow.models.taskfail import TaskFail # noqa: F401 from airflow.models.taskinstance import TaskInstance, clear_task_instances # noqa: F401 from airflow.models.taskreschedule import TaskReschedule # noqa: F401 from airflow.models.variable import Variable # noqa: F401 from airflow.models.xcom import XCOM_RETURN_KEY, XCom # noqa: F401 try: from airflow.models.kubernetes import KubeResourceVersion, KubeWorkerIdentifier # noqa: F401 except ImportError: pass # Load SQLAlchemy models during package initialization # Must be loaded after loading DAG model. # noinspection PyUnresolvedReferences import airflow.jobs # noqa: F401 isort # isort:skip
47.87234
97
0.783111
311
2,250
5.649518
0.427653
0.140581
0.174161
0.162208
0.213432
0
0
0
0
0
0
0.032376
0.148889
2,250
46
98
48.913043
0.885117
0.524889
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.045455
0.909091
0
0.909091
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
07b020104f8355ea95f945878e0b4dceb3cf51f0
391
py
Python
allMyCats1.py
MywellHC/Automate-the-Boring-Stuff
3e0541dffbf57a1c43f7d5c99bdfffb55034fd26
[ "MIT" ]
null
null
null
allMyCats1.py
MywellHC/Automate-the-Boring-Stuff
3e0541dffbf57a1c43f7d5c99bdfffb55034fd26
[ "MIT" ]
null
null
null
allMyCats1.py
MywellHC/Automate-the-Boring-Stuff
3e0541dffbf57a1c43f7d5c99bdfffb55034fd26
[ "MIT" ]
null
null
null
catName1 = input() print('Enter the name of cat 2:') catName2 = input() print('Enter the name of cat 3:') catName3 = input() print('Enter the name of cat 4:') catName4 = input() print('Enter the name of cat 5:') catName5 = input() print('Enter the name of cat 6:') catName6 = input() print(catName1 + ' ' + catName2 + ' ' + catName3 + ' ' + catName4 + ' ' + catName5 + ' ' + catName6)
27.928571
56
0.629156
54
391
4.555556
0.333333
0.243902
0.304878
0.365854
0.54878
0.54878
0.54878
0
0
0
0
0.054662
0.204604
391
13
57
30.076923
0.736334
0
0
0
0
0
0.319693
0
0
0
0
0
0
1
0
false
0
0
0
0
0.461538
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
07c47156458a814217ef1972f285dcb2c275928c
69
py
Python
stacker/tests/fixtures/mock_lookups.py
vkhatri/stacker
d4eccc3ad99a1b37f77a82eb909dd06c487ead23
[ "BSD-2-Clause" ]
null
null
null
stacker/tests/fixtures/mock_lookups.py
vkhatri/stacker
d4eccc3ad99a1b37f77a82eb909dd06c487ead23
[ "BSD-2-Clause" ]
null
null
null
stacker/tests/fixtures/mock_lookups.py
vkhatri/stacker
d4eccc3ad99a1b37f77a82eb909dd06c487ead23
[ "BSD-2-Clause" ]
null
null
null
TYPE_NAME = "mock" def handler(value, **kwargs): return "mock"
11.5
29
0.637681
9
69
4.777778
0.888889
0
0
0
0
0
0
0
0
0
0
0
0.202899
69
5
30
13.8
0.781818
0
0
0
0
0
0.115942
0
0
0
0
0
0
1
0.333333
false
0
0
0.333333
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
4
07e2a058286b381cf587ecf0bd1ab34bcbeb92fe
164
py
Python
serious_shop/coupons/forms.py
ImustAdmit/django-serious-shop
e2145f2315b4afdfe1fc35fb2b6e02adc0df33c5
[ "MIT" ]
1
2020-09-17T13:40:42.000Z
2020-09-17T13:40:42.000Z
serious_shop/coupons/forms.py
ImustAdmit/django-serious-shop
e2145f2315b4afdfe1fc35fb2b6e02adc0df33c5
[ "MIT" ]
null
null
null
serious_shop/coupons/forms.py
ImustAdmit/django-serious-shop
e2145f2315b4afdfe1fc35fb2b6e02adc0df33c5
[ "MIT" ]
null
null
null
from django import forms from django.utils.translation import ugettext_lazy as _ class CouponForm(forms.Form): code = forms.CharField(label=_("Coupon Code"))
23.428571
55
0.77439
22
164
5.636364
0.727273
0.16129
0
0
0
0
0
0
0
0
0
0
0.134146
164
6
56
27.333333
0.873239
0
0
0
0
0
0.067073
0
0
0
0
0
0
1
0
false
0
0.5
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
07f1cfb8612eb7698923618c66acedbb99c82a37
3,886
py
Python
tests/test_strings.py
samlowe106/PaperScraper
1069140f63d0d1f76349bd407574ad0dbf6e3ca9
[ "MIT" ]
null
null
null
tests/test_strings.py
samlowe106/PaperScraper
1069140f63d0d1f76349bd407574ad0dbf6e3ca9
[ "MIT" ]
1
2022-02-23T07:31:33.000Z
2022-02-23T07:31:33.000Z
tests/test_strings.py
samlowe106/PaperScraper
1069140f63d0d1f76349bd407574ad0dbf6e3ca9
[ "MIT" ]
null
null
null
from src.model import strings import unittest class TestStrings(unittest.TestCase): """ # TODO """ def test_retitle(self): pass def test_trim_string(self): self.assertEqual("", strings.trim_string("", "")) self.assertEqual("", strings.trim_string("", "z")) self.assertEqual("", strings.trim_string("aaa", "a")) self.assertEqual("", strings.trim_string("aaaa", "a")) self.assertEqual("", strings.trim_string("baba", "ba")) self.assertEqual("baba", strings.trim_string("baba", "ab")) self.assertEqual("main", strings.trim_string("__main__", "_")) self.assertEqual("words", strings.trim_string("......words....", ".")) self.assertEqual("TRING", strings.trim_string("STRING", "S")) self.assertEqual("TRING", strings.trim_string("STRINGS", "S")) self.assertEqual("TSRISNSG", strings.trim_string("STSRISNSGSSSS", "S")) self.assertEqual("azazaza", strings.trim_string("zazazazaz", "z")) self.assertEqual(" be or not to be?", strings.trim_string("to be or not to be?", "to")) self.assertEqual("to be or not to be?", strings.trim_string(" to be or not to be? ", " ")) def test_shorten(self): self.assertEqual("", strings.shorten("any string", 0)) self.assertEqual("any", strings.shorten("any string", 3)) self.assertEqual("any", strings.shorten("any string", 4)) self.assertEqual("any", strings.shorten("any string", 5)) self.assertEqual("any...", strings.shorten("any string", 6)) self.assertEqual(" ", strings.shorten(" ", 1)) self.assertEqual("a", strings.shorten("aaa", 1)) self.assertEqual("hello...", strings.shorten("hello world!", 8)) self.assertEqual("hello al", strings.shorten("hello al", 8)) self.assertEqual("he...", strings.shorten("hello al", 5)) self.assertEqual("veryl...", strings.shorten("verylongword", 8)) with self.assertRaises(IndexError): strings.shorten("", -1) strings.shorten("arbitrary string", -100) def test_title_case(self): self.assertEqual("", strings.title_case("")) self.assertEqual("!!!", strings.title_case("!!!")) self.assertEqual("1234", strings.title_case("1234")) self.assertEqual("A234", strings.title_case("a234")) self.assertEqual("1word's", strings.title_case("1word's")) self.assertEqual("ALtErNaTiNg CaPs", strings.title_case("ALtErNaTiNg CaPs")) self.assertEqual("UPPERCASE STRING", strings.title_case("UPPERCASE STRING")) self.assertEqual("Lowercase String", strings.title_case("lowercase string")) self.assertEqual("Can't Contractions", strings.title_case("can't contractions")) self.assertEqual("String To Be Capitalized", strings.title_case("string to be capitalized")) self.assertEqual("Could've Should've Would've", strings.title_case("could've Should've would've")) def test_remove_invalid(self): self.assertEqual("", strings.remove_invalid("")) self.assertEqual("", strings.remove_invalid("\\")) self.assertEqual("", strings.remove_invalid("/")) self.assertEqual("", strings.remove_invalid(":")) self.assertEqual("", strings.remove_invalid("*")) self.assertEqual("", strings.remove_invalid("?")) self.assertEqual("", strings.remove_invalid("<")) self.assertEqual("", strings.remove_invalid(">")) self.assertEqual("", strings.remove_invalid("|")) self.assertEqual("'", strings.remove_invalid('"')) self.assertEqual("'", strings.remove_invalid("'")) self.assertEqual("valid filename", strings.remove_invalid("valid filename")) self.assertEqual("invalid flename", strings.remove_invalid("invalid? f|lename")) def test_file_title(self): pass
47.390244
106
0.636644
432
3,886
5.604167
0.189815
0.303594
0.181743
0.12722
0.415118
0.375465
0.298637
0.199091
0.199091
0.199091
0
0.00977
0.183479
3,886
81
107
47.975309
0.75323
0.001544
0
0.031746
0
0
0.182195
0
0
0
0
0.012346
0.793651
1
0.095238
false
0.031746
0.031746
0
0.142857
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
1
0
0
0
0
0
0
0
0
0
4
07f9a26a05e66bf7578dfbe4471643cb2a1facaf
66
py
Python
Data/Stocks/__init__.py
yangtx2009/finance
5ba428f0495a16de89ea852e04e71bde8a00f9ba
[ "MIT" ]
null
null
null
Data/Stocks/__init__.py
yangtx2009/finance
5ba428f0495a16de89ea852e04e71bde8a00f9ba
[ "MIT" ]
null
null
null
Data/Stocks/__init__.py
yangtx2009/finance
5ba428f0495a16de89ea852e04e71bde8a00f9ba
[ "MIT" ]
null
null
null
import os STOCK_DIR = os.path.dirname(os.path.realpath(__file__))
22
55
0.787879
11
66
4.272727
0.727273
0.255319
0
0
0
0
0
0
0
0
0
0
0.075758
66
3
55
22
0.770492
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
ed070583a0459453ed168ce2e06a890b805e89fe
140
py
Python
bus_system/apps/passenger/apps.py
pygabo/bus_system
ffb76d3414e058286799f3df1cb551b26286e7c3
[ "MIT" ]
null
null
null
bus_system/apps/passenger/apps.py
pygabo/bus_system
ffb76d3414e058286799f3df1cb551b26286e7c3
[ "MIT" ]
null
null
null
bus_system/apps/passenger/apps.py
pygabo/bus_system
ffb76d3414e058286799f3df1cb551b26286e7c3
[ "MIT" ]
null
null
null
from django.apps import AppConfig class PassengerConfig(AppConfig): name = "bus_system.apps.passenger" verbose_name = "passenger"
20
38
0.757143
16
140
6.5
0.75
0
0
0
0
0
0
0
0
0
0
0
0.157143
140
6
39
23.333333
0.881356
0
0
0
0
0
0.242857
0.178571
0
0
0
0
0
1
0
false
0.75
0.25
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
4
ed0c779f6467d24da543a697e08d359ff302bf05
382
py
Python
src/bci4als/__init__.py
danpolus/bci4als
46715f66790672e317e0cc4272c41828e864c336
[ "MIT" ]
null
null
null
src/bci4als/__init__.py
danpolus/bci4als
46715f66790672e317e0cc4272c41828e864c336
[ "MIT" ]
null
null
null
src/bci4als/__init__.py
danpolus/bci4als
46715f66790672e317e0cc4272c41828e864c336
[ "MIT" ]
null
null
null
"""Top-level package for BCI-4-ALS.""" import importlib_metadata # __author__ = """Evyatar Luvaton, Noam Siegel""" # __email__ = 'noamsi@post.bgu.ac.il' # __version__ = importlib_metadata.version('bci4als') from src.bci4als.experiments.offline import OfflineExperiment from src.bci4als.experiments.online import OnlineExperiment from .eeg import EEG from .ml_model import MLModel
31.833333
61
0.787958
49
382
5.836735
0.693878
0.118881
0.097902
0.174825
0
0
0
0
0
0
0
0.011662
0.102094
382
11
62
34.727273
0.822157
0.442408
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
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
ed226092b8727acbf68b542cb7ec124192b9a72a
218
py
Python
apps/files/__init__.py
aeraeg/first_leader
f027e9e90c5c99b28f4fccb912afe32430874fda
[ "BSD-3-Clause" ]
null
null
null
apps/files/__init__.py
aeraeg/first_leader
f027e9e90c5c99b28f4fccb912afe32430874fda
[ "BSD-3-Clause" ]
null
null
null
apps/files/__init__.py
aeraeg/first_leader
f027e9e90c5c99b28f4fccb912afe32430874fda
[ "BSD-3-Clause" ]
null
null
null
from .pdf import Convert from .names import Names from .windows_control import Files_control from .copy_files import Direcories from .delete_folders import delete_files from .excel import Edite from .merge import Merge
31.142857
42
0.844037
33
218
5.424242
0.454545
0
0
0
0
0
0
0
0
0
0
0
0.123853
218
7
43
31.142857
0.937173
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
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
ed5fb0640049d76ad7f1d94be736473a6f0a6eb0
1,062
py
Python
oas/python-client/test/test_trello_api.py
NGenetzky/jatdb
518e0cedca1b61b8a744aef5e02255d8501bf8eb
[ "MIT" ]
null
null
null
oas/python-client/test/test_trello_api.py
NGenetzky/jatdb
518e0cedca1b61b8a744aef5e02255d8501bf8eb
[ "MIT" ]
null
null
null
oas/python-client/test/test_trello_api.py
NGenetzky/jatdb
518e0cedca1b61b8a744aef5e02255d8501bf8eb
[ "MIT" ]
null
null
null
# coding: utf-8 """ jatdb JSON API to DB: Fetch JSON from APIs and send to a TinyDB database. # noqa: E501 OpenAPI spec version: 0.0.2 Contact: Nathan@Genetzky.us Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import unittest import jatdb_client from jatdb_client.api.trello_api import TrelloApi # noqa: E501 from jatdb_client.rest import ApiException class TestTrelloApi(unittest.TestCase): """TrelloApi unit test stubs""" def setUp(self): self.api = jatdb_client.api.trello_api.TrelloApi() # noqa: E501 def tearDown(self): pass def test_trello_model_id_put(self): """Test case for trello_model_id_put Updates the models currently in db. # noqa: E501 """ pass def test_trello_post(self): """Test case for trello_post """ pass def test_trello_put(self): """Test case for trello_put """ pass if __name__ == '__main__': unittest.main()
19.666667
85
0.651601
141
1,062
4.680851
0.489362
0.048485
0.05
0.077273
0.174242
0.072727
0
0
0
0
0
0.020279
0.257062
1,062
53
86
20.037736
0.816223
0.403955
0
0.222222
1
0
0.014134
0
0
0
0
0
0
1
0.277778
false
0.222222
0.277778
0
0.611111
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
4