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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
df6cc5107d7ae49da676c3fd3d1c2dd250914b71
| 134
|
py
|
Python
|
.eggs/py2app-0.14-py3.6.egg/py2app/recipes/uuid.py
|
stfbnc/mtsa_py
|
0dd14f0e51e3251f10b3da781867fbc7173608eb
|
[
"MIT"
] | 17
|
2018-08-28T04:40:07.000Z
|
2021-12-15T06:19:31.000Z
|
.eggs/py2app-0.14-py3.6.egg/py2app/recipes/uuid.py
|
stfbnc/mtsa_py
|
0dd14f0e51e3251f10b3da781867fbc7173608eb
|
[
"MIT"
] | 4
|
2019-05-17T09:35:30.000Z
|
2022-03-13T03:50:20.000Z
|
.eggs/py2app-0.14-py3.6.egg/py2app/recipes/uuid.py
|
stfbnc/mtsa_py
|
0dd14f0e51e3251f10b3da781867fbc7173608eb
|
[
"MIT"
] | 3
|
2019-01-15T07:13:53.000Z
|
2020-03-29T00:48:39.000Z
|
def check(cmd, mf):
m = mf.findNode('uuid')
if m:
return dict(expected_missing_imports=set(['netbios', 'win32wnet']))
| 26.8
| 75
| 0.626866
| 18
| 134
| 4.555556
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.018692
| 0.201493
| 134
| 4
| 76
| 33.5
| 0.747664
| 0
| 0
| 0
| 0
| 0
| 0.149254
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
10f8b8c8dd7fd44443fe3f7a6e718b056cbeb235
| 120
|
py
|
Python
|
testproj/testproj/util.py
|
MilanPecov/drf-yasg
|
b99306f71c6a5779b62189df7d9c1f5ea1c794ef
|
[
"BSD-3-Clause"
] | 2,788
|
2017-12-13T10:52:26.000Z
|
2022-03-30T13:00:14.000Z
|
testproj/testproj/util.py
|
MilanPecov/drf-yasg
|
b99306f71c6a5779b62189df7d9c1f5ea1c794ef
|
[
"BSD-3-Clause"
] | 694
|
2017-12-15T11:33:16.000Z
|
2022-03-31T09:27:40.000Z
|
testproj/testproj/util.py
|
MilanPecov/drf-yasg
|
b99306f71c6a5779b62189df7d9c1f5ea1c794ef
|
[
"BSD-3-Clause"
] | 427
|
2017-12-14T19:27:43.000Z
|
2022-03-28T04:22:42.000Z
|
from django.templatetags.static import static
from django.utils.functional import lazy
static_lazy = lazy(static, str)
| 24
| 45
| 0.825
| 17
| 120
| 5.764706
| 0.529412
| 0.204082
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.108333
| 120
| 4
| 46
| 30
| 0.915888
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 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
|
8001f9b0b018d7a16cafa19e0700aa7334a5d45e
| 32
|
py
|
Python
|
PiCN/Layers/LinkLayer/FaceIDTable/test/__init__.py
|
NikolaiRutz/PiCN
|
7775c61caae506a88af2e4ec34349e8bd9098459
|
[
"BSD-3-Clause"
] | null | null | null |
PiCN/Layers/LinkLayer/FaceIDTable/test/__init__.py
|
NikolaiRutz/PiCN
|
7775c61caae506a88af2e4ec34349e8bd9098459
|
[
"BSD-3-Clause"
] | 5
|
2020-07-15T09:01:42.000Z
|
2020-09-28T08:45:21.000Z
|
PiCN/Layers/LinkLayer/FaceIDTable/test/__init__.py
|
NikolaiRutz/PiCN
|
7775c61caae506a88af2e4ec34349e8bd9098459
|
[
"BSD-3-Clause"
] | null | null | null |
"""Tests for the FaceIDTable"""
| 16
| 31
| 0.6875
| 4
| 32
| 5.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125
| 32
| 1
| 32
| 32
| 0.785714
| 0.78125
| 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
|
80113a1172f06650af34d5123a20f68d72ff9d57
| 411
|
py
|
Python
|
asseteour/resolver/base_asset_wrapper.py
|
ImagineersHub/asseteour
|
72dd401d2029eceaed2ee57440435b55ce4e2b36
|
[
"MIT"
] | null | null | null |
asseteour/resolver/base_asset_wrapper.py
|
ImagineersHub/asseteour
|
72dd401d2029eceaed2ee57440435b55ce4e2b36
|
[
"MIT"
] | null | null | null |
asseteour/resolver/base_asset_wrapper.py
|
ImagineersHub/asseteour
|
72dd401d2029eceaed2ee57440435b55ce4e2b36
|
[
"MIT"
] | null | null | null |
from abc import ABCMeta, abstractmethod
from typing import Dict
class BaseAssetWrapper(metaclass=ABCMeta):
@classmethod
@abstractmethod
def parse_obj(cls, payload: Dict):
pass
@classmethod
@abstractmethod
def schema_json(cls, indent=4):
pass
@abstractmethod
def json(self):
pass
@property
@abstractmethod
def publish(self):
pass
| 16.44
| 42
| 0.652068
| 42
| 411
| 6.333333
| 0.571429
| 0.255639
| 0.210526
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.003378
| 0.279805
| 411
| 24
| 43
| 17.125
| 0.89527
| 0
| 0
| 0.555556
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.222222
| false
| 0.222222
| 0.111111
| 0
| 0.388889
| 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
|
80431c27da323e1bde09bb3a5cca52dc9fe752c3
| 72
|
py
|
Python
|
codes/course1/hw02.py
|
BigShuang/big-shuang-python-introductory-course
|
c4fd1343c4c539567180072c749b68bda7c28075
|
[
"MIT"
] | null | null | null |
codes/course1/hw02.py
|
BigShuang/big-shuang-python-introductory-course
|
c4fd1343c4c539567180072c749b68bda7c28075
|
[
"MIT"
] | null | null | null |
codes/course1/hw02.py
|
BigShuang/big-shuang-python-introductory-course
|
c4fd1343c4c539567180072c749b68bda7c28075
|
[
"MIT"
] | null | null | null |
for i in range(5):
n = 2 * i + 1
print(' ' * (5 - i) + 'A' * n)
| 18
| 34
| 0.347222
| 14
| 72
| 1.785714
| 0.714286
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.093023
| 0.402778
| 72
| 3
| 35
| 24
| 0.488372
| 0
| 0
| 0
| 0
| 0
| 0.027778
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.333333
| 1
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
805208d149a6fcff979f94d0fefe8342d6a1591e
| 425
|
py
|
Python
|
app/models/vehicle.py
|
TataneInYourFace/wifill-api
|
9167306aa4b920b87e57d194b9ad073f16977544
|
[
"MIT"
] | null | null | null |
app/models/vehicle.py
|
TataneInYourFace/wifill-api
|
9167306aa4b920b87e57d194b9ad073f16977544
|
[
"MIT"
] | 1
|
2018-10-19T07:41:21.000Z
|
2018-10-19T07:41:21.000Z
|
app/models/vehicle.py
|
TataneInYourFace/wifill-api
|
9167306aa4b920b87e57d194b9ad073f16977544
|
[
"MIT"
] | null | null | null |
from django.db import models
from app.models.user import User
class Vehicle(models.Model):
user = models.ForeignKey(User, null=True)
plate = models.CharField(max_length=255, blank=False)
brand = models.CharField(max_length=255, blank=False)
name = models.CharField(max_length=255, blank=False)
color = models.CharField(max_length=255, blank=True)
class Meta:
ordering = ('user', 'brand',)
| 28.333333
| 57
| 0.710588
| 58
| 425
| 5.137931
| 0.431034
| 0.201342
| 0.241611
| 0.322148
| 0.479866
| 0.479866
| 0.372483
| 0
| 0
| 0
| 0
| 0.033994
| 0.169412
| 425
| 14
| 58
| 30.357143
| 0.810198
| 0
| 0
| 0
| 0
| 0
| 0.021176
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.2
| 0
| 0.9
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
33863dc4d0c72d42f4a281aec4cf0cf6bf63fb8c
| 360
|
py
|
Python
|
pytools/log.py
|
alexfikl/pytools
|
8ac46ed6564f8ef0dbf0306e348099ada8c9230a
|
[
"MIT"
] | 52
|
2015-06-23T10:30:24.000Z
|
2021-07-28T20:50:31.000Z
|
pytools/log.py
|
alexfikl/pytools
|
8ac46ed6564f8ef0dbf0306e348099ada8c9230a
|
[
"MIT"
] | 72
|
2015-10-22T18:57:08.000Z
|
2022-03-01T00:04:45.000Z
|
pytools/log.py
|
alexfikl/pytools
|
8ac46ed6564f8ef0dbf0306e348099ada8c9230a
|
[
"MIT"
] | 27
|
2015-09-14T07:24:04.000Z
|
2021-12-17T14:31:33.000Z
|
from warnings import warn
warn("pytools.log was moved to https://github.com/illinois-ceesd/logpyle/. "
"I will try to import that for you. If the import fails, say "
"'pip install logpyle', and change your imports from 'pytools.log' "
"to 'logpyle'.", DeprecationWarning)
from logpyle import * # noqa # pylint: disable=import-error
| 40
| 76
| 0.688889
| 50
| 360
| 4.96
| 0.72
| 0.080645
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.205556
| 360
| 8
| 77
| 45
| 0.867133
| 0.097222
| 0
| 0
| 0
| 0
| 0.645963
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
339b9dd2a7e5c83a639460c6758990c5c8d9c895
| 57
|
wsgi
|
Python
|
api/webapp.wsgi
|
jisantuc/labeller
|
11c7738d43b860fbdad660b459572843f873abce
|
[
"Apache-2.0"
] | 2
|
2021-12-02T08:42:31.000Z
|
2022-03-11T19:58:40.000Z
|
api/webapp.wsgi
|
jisantuc/labeller
|
11c7738d43b860fbdad660b459572843f873abce
|
[
"Apache-2.0"
] | null | null | null |
api/webapp.wsgi
|
jisantuc/labeller
|
11c7738d43b860fbdad660b459572843f873abce
|
[
"Apache-2.0"
] | 2
|
2021-12-03T17:49:49.000Z
|
2022-03-21T17:05:06.000Z
|
from webapp import create_app
application = create_app()
| 19
| 29
| 0.824561
| 8
| 57
| 5.625
| 0.75
| 0.4
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.122807
| 57
| 2
| 30
| 28.5
| 0.9
| 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
|
33b8cabef1e837767acc111fad9b0efb11bae7fe
| 1,699
|
py
|
Python
|
django/stock/repository_pattern.py
|
nah990/StockF
|
58f719728f4072186459d0ca5651624eab820c5e
|
[
"MIT"
] | null | null | null |
django/stock/repository_pattern.py
|
nah990/StockF
|
58f719728f4072186459d0ca5651624eab820c5e
|
[
"MIT"
] | 3
|
2021-12-27T02:05:58.000Z
|
2022-03-23T00:06:14.000Z
|
django/stock/repository_pattern.py
|
nah990/StockF
|
58f719728f4072186459d0ca5651624eab820c5e
|
[
"MIT"
] | null | null | null |
from .models import StockByDate, StockInfo, SourceInfo
from abc import ABCMeta, abstractmethod
from .db_manager import DBConfigManager
class abstractclassmethod(classmethod):
__slots__ = ()
def __init__(self, function):
super(abstractclassmethod, self).__init__(function)
function.__isabstractmethod__ = True
__isabstractmethod__ = True
class Repository:
__metaclass__ = ABCMeta
db_config_manager = DBConfigManager()
# Connect to DB with user role
@staticmethod
def connect(user):
return user
# Create and add new object to DB
@classmethod
@abstractmethod
def create(cls, model):
pass
# Get object by pk
@classmethod
@abstractmethod
def read_by_pk(cls, pk):
pass
# Get object by filter
@classmethod
@abstractmethod
def read_filtered(cls, filter_dict):
pass
# Get all objects
@classmethod
@abstractmethod
def read_all(cls):
pass
# Refresh by pk
@classmethod
@abstractmethod
def update_by_pk(cls, pk, update_dict):
pass
# Refresh by filter
@classmethod
@abstractmethod
def update_filtered(cls, filter_dict, update_dict):
pass
# Refresh all objects
@classmethod
@abstractmethod
def update_all(cls, update_dict):
pass
# Delete by primary key
@classmethod
@abstractmethod
def delete_by_pk(cls, pk):
pass
# Remove objects matching filter
@classmethod
@abstractmethod
def delete_filtered(cls, filter_dict):
pass
@classmethod
@abstractmethod
def read_join_filtered(cls, join_field, filter_dict):
pass
| 21.2375
| 59
| 0.665686
| 182
| 1,699
| 5.950549
| 0.324176
| 0.23084
| 0.258541
| 0.11819
| 0.265928
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.272513
| 1,699
| 80
| 60
| 21.2375
| 0.876214
| 0.128899
| 0
| 0.545455
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.218182
| false
| 0.181818
| 0.054545
| 0.018182
| 0.4
| 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
|
33d6ddec512e7720028be36363b348ad86ed428c
| 30
|
py
|
Python
|
nornir_f5/plugins/tasks/bigip/__init__.py
|
kpressouyre/nornir_f5
|
9e36ae3e19ac6d45d3858579856fbcc196fe512f
|
[
"Apache-2.0"
] | 1
|
2021-03-23T04:21:08.000Z
|
2021-03-23T04:21:08.000Z
|
nornir_f5/plugins/tasks/bigip/__init__.py
|
kpressouyre/nornir_f5
|
9e36ae3e19ac6d45d3858579856fbcc196fe512f
|
[
"Apache-2.0"
] | 1
|
2021-12-01T19:42:14.000Z
|
2021-12-01T19:42:14.000Z
|
nornir_f5/plugins/tasks/bigip/__init__.py
|
kpressouyre/nornir_f5
|
9e36ae3e19ac6d45d3858579856fbcc196fe512f
|
[
"Apache-2.0"
] | 1
|
2021-11-25T18:12:47.000Z
|
2021-11-25T18:12:47.000Z
|
"""Nornir F5 BIG-IP tasks."""
| 15
| 29
| 0.6
| 5
| 30
| 3.6
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.038462
| 0.133333
| 30
| 1
| 30
| 30
| 0.653846
| 0.766667
| 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
|
33e1a97a0ddf76804deef78e53b4a7785e1364bd
| 222
|
py
|
Python
|
UnityEngine/CameraType/__init__.py
|
Grim-es/udon-pie-auto-completion
|
c2cd86554ed615cdbbb01e19fa40665eafdfaedc
|
[
"MIT"
] | null | null | null |
UnityEngine/CameraType/__init__.py
|
Grim-es/udon-pie-auto-completion
|
c2cd86554ed615cdbbb01e19fa40665eafdfaedc
|
[
"MIT"
] | null | null | null |
UnityEngine/CameraType/__init__.py
|
Grim-es/udon-pie-auto-completion
|
c2cd86554ed615cdbbb01e19fa40665eafdfaedc
|
[
"MIT"
] | null | null | null |
from UdonPie import UnityEngine
from UdonPie.Undefined import *
class CameraType:
def __new__(cls, arg1=None):
'''
:returns: CameraType
:rtype: UnityEngine.CameraType
'''
pass
| 18.5
| 38
| 0.617117
| 21
| 222
| 6.333333
| 0.714286
| 0.165414
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.00641
| 0.297297
| 222
| 11
| 39
| 20.181818
| 0.846154
| 0.22973
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0.2
| 0.4
| 0
| 0.8
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 1
| 0
|
0
| 4
|
33e371908c634df958efa6cadf31fb846706f2a2
| 70
|
py
|
Python
|
ipycode/A00-fileSplit.py
|
wangzhongtian/ConTractMngToolSrc
|
773a29adab950a4a8d8eda58889c0a3494598532
|
[
"Unlicense"
] | null | null | null |
ipycode/A00-fileSplit.py
|
wangzhongtian/ConTractMngToolSrc
|
773a29adab950a4a8d8eda58889c0a3494598532
|
[
"Unlicense"
] | null | null | null |
ipycode/A00-fileSplit.py
|
wangzhongtian/ConTractMngToolSrc
|
773a29adab950a4a8d8eda58889c0a3494598532
|
[
"Unlicense"
] | null | null | null |
#!/usr/bin/python3
#-*- coding: UTF-8
import fileSplit
fileSplit.合并()
| 14
| 18
| 0.7
| 10
| 70
| 4.9
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.031746
| 0.1
| 70
| 4
| 19
| 17.5
| 0.746032
| 0.485714
| 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
|
d50670d1fbc424a70968a991c8f277eb6cb53f38
| 165
|
py
|
Python
|
impact/elements/element.py
|
jacquelinegarrahan/lume-impact
|
13564f4cd5009ad2077d55c45c7ec6f6b3af9bd7
|
[
"Apache-2.0"
] | 1
|
2021-08-06T06:37:35.000Z
|
2021-08-06T06:37:35.000Z
|
impact/elements/element.py
|
jacquelinegarrahan/lume-impact
|
13564f4cd5009ad2077d55c45c7ec6f6b3af9bd7
|
[
"Apache-2.0"
] | 2
|
2021-11-11T22:01:49.000Z
|
2022-01-04T01:02:55.000Z
|
impact/elements/element.py
|
jacquelinegarrahan/lume-impact
|
13564f4cd5009ad2077d55c45c7ec6f6b3af9bd7
|
[
"Apache-2.0"
] | 6
|
2021-01-20T19:17:58.000Z
|
2022-03-29T07:45:12.000Z
|
from impact import parsers
class ImpactEle:
"""
"""
def __init__(self, L=0, type='drift'):
pass
| 8.25
| 42
| 0.406061
| 14
| 165
| 4.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.012048
| 0.49697
| 165
| 20
| 43
| 8.25
| 0.746988
| 0
| 0
| 0
| 0
| 0
| 0.034483
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0.25
| 0.25
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 4
|
d50afc5407278994a3f17929bc7ef173c8ad87e6
| 454
|
py
|
Python
|
src/api/v1/node_api.py
|
glimsil/orch
|
3212c95855cbde73e9d5fd3e7a8464609eb49c71
|
[
"BSD-2-Clause"
] | null | null | null |
src/api/v1/node_api.py
|
glimsil/orch
|
3212c95855cbde73e9d5fd3e7a8464609eb49c71
|
[
"BSD-2-Clause"
] | null | null | null |
src/api/v1/node_api.py
|
glimsil/orch
|
3212c95855cbde73e9d5fd3e7a8464609eb49c71
|
[
"BSD-2-Clause"
] | null | null | null |
from flask import jsonify
from api import api
import socket
@api.route('/v1/node/who/i/am', methods=['GET'])
def node_who_i_am():
return jsonify({'node_name':str(socket.gethostname())})
@api.route('/v1/node/sync', methods=['POST'])
def node_sync():
return jsonify({'node_name':str(socket.gethostname())})
@api.route('/v1/node/cluster/join', methods=['POST'])
def node_cluster_join():
return jsonify({'node_name':str(socket.gethostname())})
| 30.266667
| 59
| 0.702643
| 67
| 454
| 4.626866
| 0.343284
| 0.077419
| 0.096774
| 0.135484
| 0.487097
| 0.487097
| 0.487097
| 0.354839
| 0.354839
| 0.354839
| 0
| 0.007282
| 0.092511
| 454
| 15
| 60
| 30.266667
| 0.745146
| 0
| 0
| 0.25
| 0
| 0
| 0.195604
| 0.046154
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| true
| 0
| 0.25
| 0.25
| 0.75
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
d50c0348467071ff95038defa6df2252d2df3b32
| 41,502
|
py
|
Python
|
tests/test_forms.py
|
azmeuk/webtest
|
ca58f4d1712d87397e84ed30fd87475c6a814d32
|
[
"MIT"
] | 239
|
2015-01-23T06:19:06.000Z
|
2022-03-08T10:40:10.000Z
|
tests/test_forms.py
|
azmeuk/webtest
|
ca58f4d1712d87397e84ed30fd87475c6a814d32
|
[
"MIT"
] | 96
|
2015-01-05T17:16:52.000Z
|
2022-02-04T17:21:41.000Z
|
tests/test_forms.py
|
azmeuk/webtest
|
ca58f4d1712d87397e84ed30fd87475c6a814d32
|
[
"MIT"
] | 84
|
2015-01-21T14:07:59.000Z
|
2022-03-06T08:52:47.000Z
|
import cgi
import os.path
import struct
import sys
import webtest
from webob import Request
from webtest.debugapp import DebugApp
from webtest.compat import to_bytes
from webtest.forms import NoValue, Submit, Upload
from tests.compat import unittest
from tests.compat import u
class TestForms(unittest.TestCase):
def callFUT(self, filename='form_inputs.html', formid='simple_form'):
dirname = os.path.join(os.path.dirname(__file__), 'html')
app = DebugApp(form=os.path.join(dirname, filename), show_form=True)
resp = webtest.TestApp(app).get('/form.html')
return resp.forms[formid]
def test_set_submit_field(self):
form = self.callFUT()
self.assertRaises(
AttributeError,
form['submit'].value__set,
'foo'
)
def test_button(self):
form = self.callFUT()
button = form['button']
self.assertTrue(isinstance(button, Submit),
"<button> without type is a submit button")
def test_button_value_if_submitted(self):
form = self.callFUT()
submit = form['submit']
self.assertEqual(
submit.value_if_submitted(), '',
"submit default value is ''")
button = form['button']
self.assertEqual(
button.value_if_submitted(), '',
"submit default value is ''")
def test_force_select(self):
form = self.callFUT()
form['select'].force_value('notavalue')
form['select'].value__set('value3')
self.assertTrue(
form['select']._forced_value is NoValue,
"Setting a value after having forced a value should keep a forced"
" state")
self.assertEqual(
form['select'].value, 'value3',
"the value should the the one set by value__set")
self.assertEqual(
form['select'].selectedIndex, 2,
"the value index should be the one set by value__set")
def test_form_select(self):
form = self.callFUT()
form.select('select', 'value1')
self.assertEqual(
form['select'].value, 'value1',
"when using form.select, the input selected value should be "
"changed")
def test_get_field_by_index(self):
form = self.callFUT()
self.assertEqual(form['select'],
form.get('select', index=0))
def test_get_unknown_field(self):
form = self.callFUT()
self.assertEqual(form['unknown'].value, '')
form['unknown'].value = '1'
self.assertEqual(form['unknown'].value, '1')
def test_get_non_exist_fields(self):
form = self.callFUT()
self.assertRaises(AssertionError, form.get, 'nonfield')
def test_get_non_exist_fields_with_default(self):
form = self.callFUT()
value = form.get('nonfield', default=1)
self.assertEqual(value, 1)
def test_upload_fields(self):
form = self.callFUT()
fu = webtest.Upload(__file__)
form['file'] = fu
self.assertEqual(form.upload_fields(),
[['file', __file__]])
def test_repr(self):
form = self.callFUT()
self.assertTrue(repr(form).startswith('<Form id='))
def test_the_bs_node_must_not_change(self):
form = self.callFUT()
self.assertEqual(form.text, str(form.html))
def test_set_multiple_checkboxes(self):
form = self.callFUT(formid='multiple_checkbox_form')
form['checkbox'] = [10, 30]
self.assertEqual(form.get('checkbox', index=0).value, '10')
self.assertEqual(form.get('checkbox', index=1).value, None)
self.assertEqual(form.get('checkbox', index=2).value, '30')
def test_button_submit(self):
form = self.callFUT(formid='multiple_buttons_form')
display = form.submit('action')
self.assertIn(u("action=deactivate"), display, display)
def test_button_submit_by_index(self):
form = self.callFUT(formid='multiple_buttons_form')
display = form.submit('action', index=1)
self.assertIn(u("action=activate"), display, display)
def test_button_submit_by_value(self):
form = self.callFUT(formid='multiple_buttons_form')
display = form.submit('action', value='activate')
self.assertIn(u("action=activate"), display, display)
def test_button_submit_by_value_and_index(self):
form = self.callFUT(formid='multiple_buttons_form')
self.assertRaises(ValueError,
form.submit, "action", value="activate",
index=0)
class TestResponseFormAttribute(unittest.TestCase):
def callFUT(self, body):
app = DebugApp(form=to_bytes(body))
return webtest.TestApp(app)
def test_no_form(self):
app = self.callFUT('<html><body></body></html>')
res = app.get('/form.html')
self.assertRaises(TypeError, lambda: res.form)
def test_too_many_forms(self):
app = self.callFUT(
'<html><body><form></form><form></form></body></html>')
res = app.get('/form.html')
self.assertRaises(TypeError, lambda: res.form)
class TestInput(unittest.TestCase):
def callFUT(self, filename='form_inputs.html'):
dirname = os.path.join(os.path.dirname(__file__), 'html')
app = DebugApp(form=os.path.join(dirname, filename), show_form=True)
return webtest.TestApp(app)
def test_input(self):
app = self.callFUT()
res = app.get('/form.html')
self.assertEqual(res.status_int, 200)
self.assertTrue(res.content_type.startswith('text/html'))
form = res.forms['text_input_form']
self.assertEqual(form['foo'].value, 'bar')
self.assertEqual(form.submit_fields(), [('foo', 'bar')])
form = res.forms['radio_input_form']
self.assertEqual(form['foo'].selectedIndex, 1)
self.assertEqual(form['foo'].value, 'baz')
self.assertEqual(form.submit_fields(), [('foo', 'baz')])
form = res.forms['checkbox_input_form']
self.assertEqual(form['foo'].value, 'bar')
self.assertEqual(form.submit_fields(), [('foo', 'bar')])
form = res.forms['password_input_form']
self.assertEqual(form['foo'].value, 'bar')
self.assertEqual(form.submit_fields(), [('foo', 'bar')])
def test_force_radio_input(self):
app = self.callFUT()
res = app.get('/form.html')
form = res.forms['radio_input_form']
form['foo'].force_value('fido')
self.assertEqual(form['foo'].value, 'fido')
self.assertEqual(form.submit_fields(), [('foo', 'fido')])
def test_radio_input_order(self):
app = self.callFUT()
res = app.get('/form.html')
self.assertEqual(res.status_int, 200)
self.assertTrue(res.content_type.startswith('text/html'))
form = res.forms['complex_radio_input_form']
form['foo'].value = 'true'
self.assertEqual(form['foo'].value, 'true')
self.assertEqual(form['foo'].selectedIndex, 0)
self.assertEqual(form.submit_fields(), [
('__start__', 'item:mapping'),
('foo', 'true'),
('__end__', 'item:mapping'),
('__start__', 'item:mapping'),
('__end__', 'item:mapping')])
res = app.get('/form.html')
form = res.forms['complex_radio_input_form']
self.assertEqual(form['foo'].value, 'true')
self.assertEqual(form['foo'].selectedIndex, 1)
self.assertEqual(form.submit_fields(), [
('__start__', 'item:mapping'),
('__end__', 'item:mapping'),
('__start__', 'item:mapping'),
('foo', 'true'),
('__end__', 'item:mapping')])
def test_input_unicode(self):
app = self.callFUT('form_unicode_inputs.html')
res = app.get('/form.html')
self.assertEqual(res.status_int, 200)
self.assertTrue(res.content_type.startswith('text/html'))
self.assertEqual(res.charset.lower(), 'utf-8')
form = res.forms['text_input_form']
self.assertEqual(form['foo'].value, u('Хармс'))
self.assertEqual(form.submit_fields(), [('foo', u('Хармс'))])
form = res.forms['radio_input_form']
self.assertEqual(form['foo'].selectedIndex, 1)
self.assertEqual(form['foo'].value, u('Блок'))
self.assertEqual(form.submit_fields(), [('foo', u('Блок'))])
form = res.forms['checkbox_input_form']
self.assertEqual(form['foo'].value, u('Хармс'))
self.assertEqual(form.submit_fields(), [('foo', u('Хармс'))])
form = res.forms['password_input_form']
self.assertEqual(form['foo'].value, u('Хармс'))
self.assertEqual(form.submit_fields(), [('foo', u('Хармс'))])
def test_input_no_default(self):
app = self.callFUT('form_inputs_with_defaults.html')
res = app.get('/form.html')
self.assertEqual(res.status_int, 200)
self.assertTrue(res.content_type.startswith('text/html'))
form = res.forms['text_input_form']
self.assertEqual(form['foo'].value, '')
self.assertEqual(form.submit_fields(), [('foo', '')])
form = res.forms['radio_input_form']
self.assertTrue(form['foo'].value is None)
self.assertEqual(form.submit_fields(), [])
form = res.forms['checkbox_input_form']
self.assertTrue(form['foo'].value is None)
self.assertEqual(form.submit_fields(), [])
form = res.forms['password_input_form']
self.assertEqual(form['foo'].value, '')
self.assertEqual(form.submit_fields(), [('foo', '')])
def test_textarea_entities(self):
app = self.callFUT()
res = app.get('/form.html')
form = res.forms.get("textarea_input_form")
self.assertEqual(form.get("textarea").value, "'foo&bar'")
self.assertEqual(form.submit_fields(), [('textarea', "'foo&bar'")])
def test_textarea_emptyfirstline(self):
app = self.callFUT()
res = app.get('/form.html')
form = res.forms.get("textarea_emptyline_form")
self.assertEqual(form.get("textarea").value, "aaa")
self.assertEqual(form.submit_fields(), [('textarea', "aaa")])
class TestFormLint(unittest.TestCase):
def test_form_lint(self):
form = webtest.Form(None, '''<form>
<input type="text" name="field"/>
</form>''')
self.assertRaises(AttributeError, form.lint)
form = webtest.Form(None, '''<form>
<input type="text" id="myfield" name="field"/>
</form>''')
self.assertRaises(AttributeError, form.lint)
form = webtest.Form(None, '''<form>
<label for="myfield">my field</label>
<input type="text" id="myfield" name="field"/>
</form>''')
form.lint()
form = webtest.Form(None, '''<form>
<label class="field" for="myfield" role="r">my field</label>
<input type="text" id="myfield" name="field"/>
</form>''')
form.lint()
def select_app(environ, start_response):
req = Request(environ)
status = b"200 OK"
if req.method == "GET":
body = to_bytes("""
<html>
<head><title>form page</title></head>
<body>
<form method="POST" id="single_select_form">
<select id="single" name="single">
<option value="4">Four</option>
<option value="5" selected="selected">Five</option>
<option value="6">Six</option>
<option value="7">Seven</option>
</select>
<input name="button" type="submit" value="single">
</form>
<form method="POST" id="multiple_select_form">
<select id="multiple" name="multiple" multiple>
<option value="8" selected="selected">Eight</option>
<option value="9">Nine</option>
<option value="10">Ten</option>
<option value="11" selected="selected">Eleven</option>
</select>
<input name="button" type="submit" value="multiple">
</form>
</body>
</html>
""")
else:
select_type = req.POST.get("button")
if select_type == "single":
selection = req.POST.get("single")
elif select_type == "multiple":
selection = ", ".join(req.POST.getall("multiple"))
body = to_bytes("""
<html>
<head><title>display page</title></head>
<body>
<p>You submitted the %(select_type)s </p>
<p>You selected %(selection)s</p>
</body>
</html>
""" % dict(selection=selection, select_type=select_type))
headers = [
('Content-Type', 'text/html; charset=utf-8'),
('Content-Length', str(len(body)))]
# PEP 3333 requires native strings:
headers = [(str(k), str(v)) for k, v in headers]
start_response(status, headers)
return [body]
def select_app_without_values(environ, start_response):
req = Request(environ)
status = b"200 OK"
if req.method == "GET":
body = to_bytes("""
<html>
<head><title>form page</title></head>
<body>
<form method="POST" id="single_select_form">
<select id="single" name="single">
<option>Four</option>
<option>Five</option>
<option>Six</option>
<option>Seven</option>
</select>
<input name="button" type="submit" value="single">
</form>
<form method="POST" id="multiple_select_form">
<select id="multiple" name="multiple" multiple="multiple">
<option>Eight</option>
<option selected value="Nine">Nine</option>
<option>Ten</option>
<option selected>Eleven</option>
</select>
<input name="button" type="submit" value="multiple">
</form>
</body>
</html>
""")
else:
select_type = req.POST.get("button")
if select_type == "single":
selection = req.POST.get("single")
elif select_type == "multiple":
selection = ", ".join(req.POST.getall("multiple"))
body = to_bytes("""
<html>
<head><title>display page</title></head>
<body>
<p>You submitted the %(select_type)s </p>
<p>You selected %(selection)s</p>
</body>
</html>
""" % dict(selection=selection, select_type=select_type))
headers = [
('Content-Type', 'text/html; charset=utf-8'),
('Content-Length', str(len(body)))]
# PEP 3333 requires native strings:
headers = [(str(k), str(v)) for k, v in headers]
start_response(status, headers)
return [body]
def select_app_without_default(environ, start_response):
req = Request(environ)
status = b"200 OK"
if req.method == "GET":
body = to_bytes("""
<html>
<head><title>form page</title></head>
<body>
<form method="POST" id="single_select_form">
<select id="single" name="single">
<option value="4">Four</option>
<option value="5">Five</option>
<option value="6">Six</option>
<option value="7">Seven</option>
</select>
<input name="button" type="submit" value="single">
</form>
<form method="POST" id="multiple_select_form">
<select id="multiple" name="multiple" multiple="multiple">
<option value="8">Eight</option>
<option value="9">Nine</option>
<option value="10">Ten</option>
<option value="11">Eleven</option>
</select>
<input name="button" type="submit" value="multiple">
</form>
</body>
</html>
""")
else:
select_type = req.POST.get("button")
if select_type == "single":
selection = req.POST.get("single")
elif select_type == "multiple":
selection = ", ".join(req.POST.getall("multiple"))
body = to_bytes("""
<html>
<head><title>display page</title></head>
<body>
<p>You submitted the %(select_type)s </p>
<p>You selected %(selection)s</p>
</body>
</html>
""" % dict(selection=selection, select_type=select_type))
headers = [
('Content-Type', 'text/html; charset=utf-8'),
('Content-Length', str(len(body)))]
# PEP 3333 requires native strings:
headers = [(str(k), str(v)) for k, v in headers]
start_response(status, headers)
return [body]
def select_app_unicode(environ, start_response):
req = Request(environ)
status = b"200 OK"
if req.method == "GET":
body = u("""
<html>
<head><title>form page</title></head>
<body>
<form method="POST" id="single_select_form">
<select id="single" name="single">
<option value="ЕКБ">Екатеринбург</option>
<option value="МСК" selected="selected">Москва</option>
<option value="СПБ">Санкт-Петербург</option>
<option value="САМ">Самара</option>
</select>
<input name="button" type="submit" value="single">
</form>
<form method="POST" id="multiple_select_form">
<select id="multiple" name="multiple" multiple="multiple">
<option value="8" selected="selected">Лондон</option>
<option value="9">Париж</option>
<option value="10">Пекин</option>
<option value="11" selected="selected">Бристоль</option>
</select>
<input name="button" type="submit" value="multiple">
</form>
</body>
</html>
""").encode('utf8')
else:
select_type = req.POST.get("button")
if select_type == "single":
selection = req.POST.get("single")
elif select_type == "multiple":
selection = ", ".join(req.POST.getall("multiple"))
body = (u("""
<html>
<head><title>display page</title></head>
<body>
<p>You submitted the %(select_type)s </p>
<p>You selected %(selection)s</p>
</body>
</html>
""") % dict(selection=selection, select_type=select_type)).encode('utf8')
headers = [
('Content-Type', 'text/html; charset=utf-8'),
('Content-Length', str(len(body)))]
# PEP 3333 requires native strings:
headers = [(str(k), str(v)) for k, v in headers]
start_response(status, headers)
if not isinstance(body, bytes):
raise AssertionError('Body is not %s' % bytes)
return [body]
class TestSelect(unittest.TestCase):
def test_unicode_select(self):
app = webtest.TestApp(select_app_unicode)
res = app.get('/')
single_form = res.forms["single_select_form"]
self.assertEqual(single_form["single"].value, u("МСК"))
display = single_form.submit("button")
self.assertIn(u("<p>You selected МСК</p>"), display, display)
res = app.get('/')
single_form = res.forms["single_select_form"]
self.assertEqual(single_form["single"].value, u("МСК"))
single_form.set("single", u("СПБ"))
self.assertEqual(single_form["single"].value, u("СПБ"))
display = single_form.submit("button")
self.assertIn(u("<p>You selected СПБ</p>"), display, display)
def test_single_select(self):
app = webtest.TestApp(select_app)
res = app.get('/')
self.assertEqual(res.status_int, 200)
self.assertEqual(res.headers['content-type'],
'text/html; charset=utf-8')
self.assertEqual(res.content_type, 'text/html')
single_form = res.forms["single_select_form"]
self.assertEqual(single_form["single"].value, "5")
display = single_form.submit("button")
self.assertIn("<p>You selected 5</p>", display, display)
res = app.get('/')
self.assertEqual(res.status_int, 200)
self.assertEqual(res.headers['content-type'],
'text/html; charset=utf-8')
self.assertEqual(res.content_type, 'text/html')
single_form = res.forms["single_select_form"]
self.assertEqual(single_form["single"].value, "5")
single_form.set("single", "6")
self.assertEqual(single_form["single"].value, "6")
display = single_form.submit("button")
self.assertIn("<p>You selected 6</p>", display, display)
res = app.get('/')
single_form = res.forms["single_select_form"]
self.assertRaises(ValueError, single_form.select, "single", "5",
text="Five")
self.assertRaises(ValueError, single_form.select, "single",
text="Three")
single_form.select("single", text="Seven")
self.assertEqual(single_form["single"].value, "7")
display = single_form.submit("button")
self.assertIn("<p>You selected 7</p>", display, display)
def test_single_select_forced_value(self):
app = webtest.TestApp(select_app)
res = app.get('/')
self.assertEqual(res.status_int, 200)
self.assertEqual(res.headers['content-type'],
'text/html; charset=utf-8')
self.assertEqual(res.content_type, 'text/html')
single_form = res.forms["single_select_form"]
self.assertEqual(single_form["single"].value, "5")
self.assertRaises(ValueError, single_form.set, "single", "984")
single_form["single"].force_value("984")
self.assertEqual(single_form["single"].value, "984")
display = single_form.submit("button")
self.assertIn("<p>You selected 984</p>", display, display)
def test_single_select_no_default(self):
app = webtest.TestApp(select_app_without_default)
res = app.get('/')
self.assertEqual(res.status_int, 200)
self.assertEqual(res.headers['content-type'],
'text/html; charset=utf-8')
self.assertEqual(res.content_type, 'text/html')
single_form = res.forms["single_select_form"]
self.assertEqual(single_form["single"].value, "4")
display = single_form.submit("button")
self.assertIn("<p>You selected 4</p>", display, display)
res = app.get('/')
self.assertEqual(res.status_int, 200)
self.assertEqual(res.headers['content-type'],
'text/html; charset=utf-8')
self.assertEqual(res.content_type, 'text/html')
single_form = res.forms["single_select_form"]
self.assertEqual(single_form["single"].value, "4")
single_form.set("single", 6)
self.assertEqual(single_form["single"].value, "6")
display = single_form.submit("button")
self.assertIn("<p>You selected 6</p>", display, display)
def test_multiple_select(self):
app = webtest.TestApp(select_app)
res = app.get('/')
self.assertEqual(res.status_int, 200)
self.assertEqual(res.headers['content-type'],
'text/html; charset=utf-8')
self.assertEqual(res.content_type, 'text/html')
multiple_form = res.forms["multiple_select_form"]
self.assertEqual(multiple_form["multiple"].value, ['8', '11'],
multiple_form["multiple"].value)
display = multiple_form.submit("button")
self.assertIn("<p>You selected 8, 11</p>", display, display)
res = app.get('/')
self.assertEqual(res.status_int, 200)
self.assertEqual(res.headers['content-type'],
'text/html; charset=utf-8')
self.assertEqual(res.content_type, 'text/html')
multiple_form = res.forms["multiple_select_form"]
self.assertEqual(multiple_form["multiple"].value, ["8", "11"],
multiple_form["multiple"].value)
multiple_form.set("multiple", ["9"])
self.assertEqual(multiple_form["multiple"].value, ["9"],
multiple_form["multiple"].value)
display = multiple_form.submit("button")
self.assertIn("<p>You selected 9</p>", display, display)
res = app.get('/')
multiple_form = res.forms["multiple_select_form"]
self.assertRaises(ValueError, multiple_form.select_multiple,
"multiple",
["8", "10"], texts=["Eight", "Ten"])
self.assertRaises(ValueError, multiple_form.select_multiple,
"multiple", texts=["Twelve"])
multiple_form.select_multiple("multiple",
texts=["Eight", "Nine", "Ten"])
display = multiple_form.submit("button")
self.assertIn("<p>You selected 8, 9, 10</p>", display, display)
def test_multiple_select_forced_values(self):
app = webtest.TestApp(select_app)
res = app.get('/')
self.assertEqual(res.status_int, 200)
self.assertEqual(res.headers['content-type'],
'text/html; charset=utf-8')
self.assertEqual(res.content_type, 'text/html')
multiple_form = res.forms["multiple_select_form"]
self.assertEqual(multiple_form["multiple"].value, ["8", "11"],
multiple_form["multiple"].value)
self.assertRaises(ValueError, multiple_form.set,
"multiple", ["24", "88"])
multiple_form["multiple"].force_value(["24", "88"])
self.assertEqual(multiple_form["multiple"].value, ["24", "88"],
multiple_form["multiple"].value)
display = multiple_form.submit("button")
self.assertIn("<p>You selected 24, 88</p>", display, display)
def test_multiple_select_no_default(self):
app = webtest.TestApp(select_app_without_default)
res = app.get('/')
self.assertEqual(res.status_int, 200)
self.assertEqual(res.headers['content-type'],
'text/html; charset=utf-8')
self.assertEqual(res.content_type, 'text/html')
multiple_form = res.forms["multiple_select_form"]
self.assertTrue(multiple_form["multiple"].value is None,
repr(multiple_form["multiple"].value))
display = multiple_form.submit("button")
self.assertIn("<p>You selected </p>", display, display)
res = app.get('/')
self.assertEqual(res.status_int, 200)
self.assertEqual(res.headers['content-type'],
'text/html; charset=utf-8')
self.assertEqual(res.content_type, 'text/html')
multiple_form = res.forms["multiple_select_form"]
self.assertTrue(multiple_form["multiple"].value is None,
multiple_form["multiple"].value)
multiple_form.set("multiple", ["9"])
self.assertEqual(multiple_form["multiple"].value, ["9"],
multiple_form["multiple"].value)
display = multiple_form.submit("button")
self.assertIn("<p>You selected 9</p>", display, display)
def test_select_no_value(self):
app = webtest.TestApp(select_app_without_values)
res = app.get('/')
self.assertEqual(res.status_int, 200)
self.assertEqual(res.headers['content-type'],
'text/html; charset=utf-8')
self.assertEqual(res.content_type, 'text/html')
single_form = res.forms["single_select_form"]
self.assertEqual(single_form["single"].value, "Four")
display = single_form.submit("button")
self.assertIn("<p>You selected Four</p>", display, display)
res = app.get('/')
self.assertEqual(res.status_int, 200)
self.assertEqual(res.headers['content-type'],
'text/html; charset=utf-8')
self.assertEqual(res.content_type, 'text/html')
single_form = res.forms["single_select_form"]
self.assertEqual(single_form["single"].value, "Four")
single_form.set("single", "Six")
self.assertEqual(single_form["single"].value, "Six")
display = single_form.submit("button")
self.assertIn("<p>You selected Six</p>", display, display)
def test_multiple_select_no_value(self):
app = webtest.TestApp(select_app_without_values)
res = app.get('/')
self.assertEqual(res.status_int, 200)
self.assertEqual(res.headers['content-type'],
'text/html; charset=utf-8')
self.assertEqual(res.content_type, 'text/html')
multiple_form = res.forms["multiple_select_form"]
self.assertEqual(multiple_form["multiple"].value, ["Nine", "Eleven"])
display = multiple_form.submit("button")
self.assertIn("<p>You selected Nine, Eleven</p>", display, display)
res = app.get('/')
self.assertEqual(res.status_int, 200)
self.assertEqual(res.headers['content-type'],
'text/html; charset=utf-8')
self.assertEqual(res.content_type, 'text/html')
multiple_form = res.forms["multiple_select_form"]
self.assertEqual(multiple_form["multiple"].value, ["Nine", "Eleven"])
multiple_form.set("multiple", ["Nine", "Ten"])
self.assertEqual(multiple_form["multiple"].value, ["Nine", "Ten"])
display = multiple_form.submit("button")
self.assertIn("<p>You selected Nine, Ten</p>", display, display)
def test_multiple_select_reset_value(self):
app = webtest.TestApp(select_app_without_values)
res = app.get('/')
self.assertEqual(res.status_int, 200)
self.assertEqual(res.headers['content-type'],
'text/html; charset=utf-8')
self.assertEqual(res.content_type, 'text/html')
multiple_form = res.forms["multiple_select_form"]
self.assertEqual(multiple_form["multiple"].value, ["Nine", "Eleven"])
# reset with value
multiple_form["multiple"].value = []
self.assertIsNone(multiple_form["multiple"].value)
# re-set a value
multiple_form["multiple"].value = ['Nine']
assert multiple_form["multiple"].value == ['Nine']
# reset with force_value
multiple_form["multiple"].force_value(None)
self.assertIsNone(multiple_form["multiple"].value)
display = multiple_form.submit("button")
self.assertIn("<p>You selected </p>", display, display)
class SingleUploadFileApp:
body = b"""
<html>
<head><title>form page</title></head>
<body>
<form method="POST" id="file_upload_form"
enctype="multipart/form-data">
<input name="file-field" type="file" value="some/path/file.txt" />
<input name="int-field" type="text" value="" />
<input name="button" type="submit" value="single">
</form>
</body>
</html>
"""
def __call__(self, environ, start_response):
req = Request(environ)
status = b"200 OK"
if req.method == "GET":
body = self.body
else:
body = b"""
<html>
<head><title>display page</title></head>
<body>
""" + self.get_files_page(req) + b"""
</body>
</html>
"""
headers = [
('Content-Type', 'text/html; charset=utf-8'),
('Content-Length', str(len(body)))]
# PEP 3333 requires native strings:
headers = [(str(k), str(v)) for k, v in headers]
start_response(status, headers)
assert(isinstance(body, bytes))
return [body]
def get_files_page(self, req):
file_parts = []
uploaded_files = [(k, v) for k, v in req.POST.items() if 'file' in k]
uploaded_files = sorted(uploaded_files)
for name, uploaded_file in uploaded_files:
if isinstance(uploaded_file, cgi.FieldStorage):
filename = to_bytes(uploaded_file.filename)
value = to_bytes(uploaded_file.value, 'ascii')
content_type = to_bytes(uploaded_file.type, 'ascii')
else:
filename = value = content_type = b''
file_parts.append(b"""
<p>You selected '""" + filename + b"""'</p>
<p>with contents: '""" + value + b"""'</p>
<p>with content type: '""" + content_type + b"""'</p>
""")
return b''.join(file_parts)
class UploadBinaryApp(SingleUploadFileApp):
def get_files_page(self, req):
uploaded_files = [(k, v) for k, v in req.POST.items() if 'file' in k]
data = uploaded_files[0][1].value
data = struct.unpack(b'255h', data[:510])
return b','.join([to_bytes(str(i)) for i in data])
class MultipleUploadFileApp(SingleUploadFileApp):
body = b"""
<html>
<head><title>form page</title></head>
<body>
<form method="POST" id="file_upload_form"
enctype="multipart/form-data">
<input name="file-field-1" type="file" />
<input name="file-field-2" type="file" />
<input name="button" type="submit" value="single">
</form>
</body>
</html>
"""
class TestFileUpload(unittest.TestCase):
def assertFile(self, name, contents, display, content_type=None):
if isinstance(name, bytes):
text_name = name.decode('ascii')
else:
text_name = name
self.assertIn("<p>You selected '" + text_name + "'</p>",
display, display)
if isinstance(contents, bytes):
text_contents = contents.decode('ascii')
else:
text_contents = contents
self.assertIn("<p>with contents: '" + text_contents + "'</p>",
display, display)
if content_type:
self.assertIn("<p>with content type: '" + content_type + "'</p>",
display, display)
def test_no_uploads_error(self):
app = webtest.TestApp(SingleUploadFileApp())
app.get('/').forms["file_upload_form"].upload_fields()
def test_upload_without_file(self):
app = webtest.TestApp(SingleUploadFileApp())
upload_form = app.get('/').forms["file_upload_form"]
upload_form.submit()
def test_file_upload_with_filename_only(self):
uploaded_file_name = os.path.join(os.path.dirname(__file__),
"__init__.py")
uploaded_file_contents = open(uploaded_file_name).read()
uploaded_file_contents = to_bytes(uploaded_file_contents)
app = webtest.TestApp(SingleUploadFileApp())
res = app.get('/')
self.assertEqual(res.status_int, 200)
self.assertEqual(res.headers['content-type'],
'text/html; charset=utf-8')
self.assertEqual(res.content_type, 'text/html')
self.assertEqual(res.charset, 'utf-8')
single_form = res.forms["file_upload_form"]
single_form.set("file-field", (uploaded_file_name,))
display = single_form.submit("button")
self.assertFile(uploaded_file_name, uploaded_file_contents, display)
def test_file_upload_with_filename_and_contents(self):
uploaded_file_name = os.path.join(os.path.dirname(__file__),
"__init__.py")
uploaded_file_contents = open(uploaded_file_name).read()
uploaded_file_contents = to_bytes(uploaded_file_contents)
app = webtest.TestApp(SingleUploadFileApp())
res = app.get('/')
self.assertEqual(res.status_int, 200)
self.assertEqual(res.headers['content-type'],
'text/html; charset=utf-8')
self.assertEqual(res.content_type, 'text/html')
single_form = res.forms["file_upload_form"]
single_form.set("file-field",
(uploaded_file_name, uploaded_file_contents))
display = single_form.submit("button")
self.assertFile(uploaded_file_name, uploaded_file_contents, display)
def test_file_upload_with_content_type(self):
uploaded_file_name = os.path.join(os.path.dirname(__file__),
"__init__.py")
with open(uploaded_file_name, 'rb') as f:
uploaded_file_contents = f.read()
app = webtest.TestApp(SingleUploadFileApp())
res = app.get('/')
single_form = res.forms["file_upload_form"]
single_form["file-field"].value = Upload(uploaded_file_name,
uploaded_file_contents,
'text/x-custom-type')
display = single_form.submit("button")
self.assertFile(uploaded_file_name, uploaded_file_contents, display,
content_type='text/x-custom-type')
def test_file_upload_binary(self):
binary_data = struct.pack('255h', *range(0, 255))
app = webtest.TestApp(UploadBinaryApp())
res = app.get('/')
single_form = res.forms["file_upload_form"]
single_form.set("file-field", ('my_file.dat', binary_data))
display = single_form.submit("button")
self.assertIn(','.join([str(n) for n in range(0, 255)]), display)
def test_multiple_file_uploads_with_filename_and_contents(self):
uploaded_file1_name = os.path.join(os.path.dirname(__file__),
"__init__.py")
uploaded_file1_contents = open(uploaded_file1_name).read()
uploaded_file1_contents = to_bytes(uploaded_file1_contents)
uploaded_file2_name = __file__
uploaded_file2_name = os.path.join(os.path.dirname(__file__), 'html',
"404.html")
uploaded_file2_contents = open(uploaded_file2_name).read()
uploaded_file2_contents = to_bytes(uploaded_file2_contents)
app = webtest.TestApp(MultipleUploadFileApp())
res = app.get('/')
self.assertEqual(res.status_int, 200)
self.assertEqual(res.headers['content-type'],
'text/html; charset=utf-8')
self.assertEqual(res.content_type, 'text/html')
single_form = res.forms["file_upload_form"]
single_form.set("file-field-1",
(uploaded_file1_name, uploaded_file1_contents))
single_form.set("file-field-2",
(uploaded_file2_name, uploaded_file2_contents))
display = single_form.submit("button")
self.assertFile(uploaded_file1_name, uploaded_file1_contents, display)
self.assertFile(uploaded_file1_name, uploaded_file1_contents, display)
def test_post_int(self):
binary_data = struct.pack('255h', *range(0, 255))
app = webtest.TestApp(SingleUploadFileApp())
res = app.get('/')
single_form = res.forms["file_upload_form"]
single_form.set("file-field", ('my_file.dat', binary_data))
single_form.set("int-field", 100)
# just check it does not raise
single_form.submit("button")
def test_invalid_types(self):
binary_data = struct.pack('255h', *range(0, 255))
app = webtest.TestApp(SingleUploadFileApp())
res = app.get('/')
single_form = res.forms["file_upload_form"]
single_form.set("file-field", ('my_file.dat', binary_data))
single_form.set("int-field", SingleUploadFileApp())
self.assertRaises(ValueError, single_form.submit, "button")
def test_upload_invalid_content(self):
app = webtest.TestApp(SingleUploadFileApp())
res = app.get('/')
single_form = res.forms["file_upload_form"]
single_form.set("file-field", ('my_file.dat', 1))
try:
single_form.submit("button")
except ValueError:
e = sys.exc_info()[1]
self.assertEquals(
str(e),
u('File content must be %s not %s' % (bytes, int))
)
def test_invalid_uploadfiles(self):
app = webtest.TestApp(SingleUploadFileApp())
self.assertRaises(ValueError, app.post, '/', upload_files=[()])
self.assertRaises(
ValueError,
app.post, '/',
upload_files=[('name', 'filename', 'content', 'extra')]
)
def test_goto_upload_files(self):
app = webtest.TestApp(SingleUploadFileApp())
resp = app.get('/')
resp = resp.goto(
'/',
method='post',
upload_files=[('file', 'filename', b'content')]
)
resp.mustcontain("<p>You selected 'filename'</p>",
"<p>with contents: 'content'</p>")
def test_post_upload_files(self):
app = webtest.TestApp(SingleUploadFileApp())
resp = app.post(
'/',
upload_files=[('file', 'filename', b'content')]
)
resp.mustcontain("<p>You selected 'filename'</p>",
"<p>with contents: 'content'</p>")
def test_post_upload_empty_files(self):
app = webtest.TestApp(SingleUploadFileApp())
resp = app.post(
'/',
upload_files=[('file', 'filename', b'')]
)
resp.mustcontain("<p>You selected 'filename'</p>",
"<p>with contents: ''</p>")
resp = app.get('/')
form = resp.form
form['file-field'] = Upload('filename', b'', 'text/plain')
resp = form.submit()
resp.mustcontain("<p>You selected 'filename'</p>",
"<p>with contents: ''</p>")
| 38.932458
| 78
| 0.589128
| 4,743
| 41,502
| 4.982922
| 0.063884
| 0.085682
| 0.045697
| 0.032961
| 0.806127
| 0.7716
| 0.716806
| 0.671829
| 0.646399
| 0.629517
| 0
| 0.010221
| 0.259771
| 41,502
| 1,065
| 79
| 38.969014
| 0.75909
| 0.006096
| 0
| 0.652079
| 0
| 0.001094
| 0.273867
| 0.034676
| 0
| 0
| 0
| 0
| 0.218818
| 1
| 0.067834
| false
| 0.003282
| 0.012035
| 0
| 0.102845
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
1d0fedfb7b338404bf84bacf7e1e0db02f7efb5a
| 120
|
py
|
Python
|
WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/mini-scripts/python_NumPy_Summations_2.txt.py
|
webdevhub42/Lambda
|
b04b84fb5b82fe7c8b12680149e25ae0d27a0960
|
[
"MIT"
] | 5
|
2021-06-02T23:44:25.000Z
|
2021-12-27T16:21:57.000Z
|
WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/mini-scripts/python_NumPy_Summations_2.txt.py
|
webdevhub42/Lambda
|
b04b84fb5b82fe7c8b12680149e25ae0d27a0960
|
[
"MIT"
] | 22
|
2021-05-31T01:33:25.000Z
|
2021-10-18T18:32:39.000Z
|
WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/mini-scripts/python_NumPy_Summations_2.txt.py
|
webdevhub42/Lambda
|
b04b84fb5b82fe7c8b12680149e25ae0d27a0960
|
[
"MIT"
] | 3
|
2021-06-19T03:37:47.000Z
|
2021-08-31T00:49:51.000Z
|
import numpy as np
arr1 = np.array([1, 2, 3])
arr2 = np.array([1, 2, 3])
newarr = np.sum([arr1, arr2])
print(newarr)
| 13.333333
| 29
| 0.608333
| 23
| 120
| 3.173913
| 0.565217
| 0.191781
| 0.219178
| 0.246575
| 0.273973
| 0
| 0
| 0
| 0
| 0
| 0
| 0.102041
| 0.183333
| 120
| 8
| 30
| 15
| 0.642857
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.2
| 0
| 0.2
| 0.2
| 1
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
1d20a8f1545d845394e1f5edf52448a542555ae5
| 111
|
py
|
Python
|
a10/build/lib/a10/asvr/db/__init__.py
|
THS-on/AttestationEngine
|
6746d602215df43056b04515bd9b831f0bb0ddbb
|
[
"BSD-3-Clause-Clear"
] | 7
|
2021-10-20T05:22:47.000Z
|
2022-01-31T14:46:14.000Z
|
a10/build/lib/a10/asvr/db/__init__.py
|
THS-on/AttestationEngine
|
6746d602215df43056b04515bd9b831f0bb0ddbb
|
[
"BSD-3-Clause-Clear"
] | 15
|
2021-11-21T23:27:36.000Z
|
2022-03-25T11:35:07.000Z
|
a10/build/lib/a10/asvr/db/__init__.py
|
THS-on/AttestationEngine
|
6746d602215df43056b04515bd9b831f0bb0ddbb
|
[
"BSD-3-Clause-Clear"
] | 5
|
2021-12-08T20:55:34.000Z
|
2022-03-29T11:41:33.000Z
|
# Copyright 2021 Nokia
# Licensed under the BSD 3-Clause Clear License.
# SPDX-License-Identifier: BSD-3-Clear
| 27.75
| 48
| 0.774775
| 17
| 111
| 5.058824
| 0.764706
| 0.093023
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.0625
| 0.135135
| 111
| 3
| 49
| 37
| 0.833333
| 0.936937
| 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
|
1d2dc122738bf6d68995c9f12eb28377f7273da6
| 139
|
py
|
Python
|
libtool/util/regex.py
|
matan-h/libtool
|
259df4e887ab0a218850040018bc9ad38721ee9f
|
[
"MIT"
] | null | null | null |
libtool/util/regex.py
|
matan-h/libtool
|
259df4e887ab0a218850040018bc9ad38721ee9f
|
[
"MIT"
] | null | null | null |
libtool/util/regex.py
|
matan-h/libtool
|
259df4e887ab0a218850040018bc9ad38721ee9f
|
[
"MIT"
] | null | null | null |
import re
def get_val(val, string):
sec = """{}(\s|)+=(\s|)+(["'])(.*)(["'])""".format(val)
return re.findall(sec, string)[0][3]
| 19.857143
| 59
| 0.482014
| 19
| 139
| 3.473684
| 0.684211
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.016949
| 0.151079
| 139
| 6
| 60
| 23.166667
| 0.542373
| 0
| 0
| 0
| 0
| 0
| 0.223022
| 0.223022
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
1d6381326459448602068f20a112f33cd9689164
| 158
|
py
|
Python
|
file_handling/excepation handling program test/print_excepation_information_in_msg.class_program.py
|
swarajRaut01/Python
|
28c4a6d70c14244b65c9bd2c264b7488a82a75a5
|
[
"MIT"
] | null | null | null |
file_handling/excepation handling program test/print_excepation_information_in_msg.class_program.py
|
swarajRaut01/Python
|
28c4a6d70c14244b65c9bd2c264b7488a82a75a5
|
[
"MIT"
] | null | null | null |
file_handling/excepation handling program test/print_excepation_information_in_msg.class_program.py
|
swarajRaut01/Python
|
28c4a6d70c14244b65c9bd2c264b7488a82a75a5
|
[
"MIT"
] | null | null | null |
#print excepation information as a msg in program
try:
print(10/0)
except ZeroDivisionError as msg:
print("the type of error:",msg.__class__)
| 19.75
| 50
| 0.702532
| 23
| 158
| 4.652174
| 0.782609
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.024194
| 0.21519
| 158
| 7
| 51
| 22.571429
| 0.83871
| 0.303797
| 0
| 0
| 0
| 0
| 0.176471
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 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
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
1d6aa47bbdb0bd49b5e0e167a65c83c3df2c7d8c
| 23
|
py
|
Python
|
python/testData/intentions/PyConvertTypeCommentToVariableAnnotationIntentionTest/typeHintFollowedByComment_after.py
|
jnthn/intellij-community
|
8fa7c8a3ace62400c838e0d5926a7be106aa8557
|
[
"Apache-2.0"
] | 2
|
2019-04-28T07:48:50.000Z
|
2020-12-11T14:18:08.000Z
|
python/testData/intentions/PyConvertTypeCommentToVariableAnnotationIntentionTest/typeHintFollowedByComment_after.py
|
Cyril-lamirand/intellij-community
|
60ab6c61b82fc761dd68363eca7d9d69663cfa39
|
[
"Apache-2.0"
] | 173
|
2018-07-05T13:59:39.000Z
|
2018-08-09T01:12:03.000Z
|
python/testData/intentions/PyConvertTypeCommentToVariableAnnotationIntentionTest/typeHintFollowedByComment_after.py
|
Cyril-lamirand/intellij-community
|
60ab6c61b82fc761dd68363eca7d9d69663cfa39
|
[
"Apache-2.0"
] | 2
|
2020-03-15T08:57:37.000Z
|
2020-04-07T04:48:14.000Z
|
var: int = undefined()
| 11.5
| 22
| 0.652174
| 3
| 23
| 5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.173913
| 23
| 1
| 23
| 23
| 0.789474
| 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
|
1d763078cca2015fcc49782a1473a54ee6186124
| 161
|
py
|
Python
|
settings.py
|
khaledboka/point_to_line
|
1af0721ba1ff88d410992cf473c1864e128ffeb2
|
[
"BSD-2-Clause"
] | null | null | null |
settings.py
|
khaledboka/point_to_line
|
1af0721ba1ff88d410992cf473c1864e128ffeb2
|
[
"BSD-2-Clause"
] | 3
|
2021-03-09T15:21:34.000Z
|
2021-09-01T21:02:35.000Z
|
settings.py
|
cartologic/point_to_line
|
1af0721ba1ff88d410992cf473c1864e128ffeb2
|
[
"BSD-2-Clause"
] | null | null | null |
# this file is excuted from cartoview.app_manager.settings using exec_file
import os
import point_to_line
app_folder = os.path.dirname(point_to_line.__file__)
| 23
| 74
| 0.832298
| 27
| 161
| 4.555556
| 0.703704
| 0.113821
| 0.178862
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.111801
| 161
| 6
| 75
| 26.833333
| 0.86014
| 0.447205
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
d544e3297d3521a7d009869f69b30d715439078f
| 93
|
py
|
Python
|
src/pyfma/__init__.py
|
Vutshi/pyfma
|
9b9ca33529a1edd5bc7ebbf7726f7b1d4a73c165
|
[
"MIT"
] | null | null | null |
src/pyfma/__init__.py
|
Vutshi/pyfma
|
9b9ca33529a1edd5bc7ebbf7726f7b1d4a73c165
|
[
"MIT"
] | null | null | null |
src/pyfma/__init__.py
|
Vutshi/pyfma
|
9b9ca33529a1edd5bc7ebbf7726f7b1d4a73c165
|
[
"MIT"
] | null | null | null |
from _pyfma import fma
from .__about__ import __version__
__all__ = ["__version__", "fma"]
| 15.5
| 34
| 0.752688
| 11
| 93
| 4.818182
| 0.636364
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.150538
| 93
| 5
| 35
| 18.6
| 0.670886
| 0
| 0
| 0
| 0
| 0
| 0.150538
| 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
|
d5525cefeef4d9a6e93355dd97015570cbe87a05
| 114
|
py
|
Python
|
commands/hello.py
|
el-ideal-ideas/MocaCommands
|
33dda0b05ca3b34f4855ff264bcf70d016dfb1c0
|
[
"MIT"
] | null | null | null |
commands/hello.py
|
el-ideal-ideas/MocaCommands
|
33dda0b05ca3b34f4855ff264bcf70d016dfb1c0
|
[
"MIT"
] | null | null | null |
commands/hello.py
|
el-ideal-ideas/MocaCommands
|
33dda0b05ca3b34f4855ff264bcf70d016dfb1c0
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python3
# Please make sure this file can be executed.
# chmod +x hello.py
print('Hello World!!')
| 16.285714
| 45
| 0.692982
| 19
| 114
| 4.157895
| 0.947368
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.010526
| 0.166667
| 114
| 6
| 46
| 19
| 0.821053
| 0.72807
| 0
| 0
| 0
| 0
| 0.464286
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
d5682ab86e697f17a24fe8fab55aa35246ae83e4
| 323
|
py
|
Python
|
Exercicios/Extras/Arrow.py
|
RicardoMart922/estudo_Python
|
cb595c2a5e5aee568b6afa71b3ed9dd9cb7eef72
|
[
"MIT"
] | null | null | null |
Exercicios/Extras/Arrow.py
|
RicardoMart922/estudo_Python
|
cb595c2a5e5aee568b6afa71b3ed9dd9cb7eef72
|
[
"MIT"
] | null | null | null |
Exercicios/Extras/Arrow.py
|
RicardoMart922/estudo_Python
|
cb595c2a5e5aee568b6afa71b3ed9dd9cb7eef72
|
[
"MIT"
] | null | null | null |
def seta(n):
for i in range(n):
if i == n - 1:
print((2 * n) * '*', end='')
print((i + 1) * '*')
else:
print((2 * n) * ' ', end='')
print((i + 1) * '*')
for j in range(n - 1, 0, -1):
print((2 * n) * ' ',end='')
print(j * '*')
seta(10)
| 24.846154
| 40
| 0.309598
| 43
| 323
| 2.325581
| 0.372093
| 0.18
| 0.21
| 0.3
| 0.51
| 0.51
| 0.34
| 0
| 0
| 0
| 0
| 0.060773
| 0.439628
| 323
| 12
| 41
| 26.916667
| 0.491713
| 0
| 0
| 0.333333
| 0
| 0
| 0.018576
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.083333
| false
| 0
| 0
| 0
| 0.083333
| 0.5
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
d56841c83fa5ecd4ffecb17a09a33178193515ca
| 31
|
py
|
Python
|
autokey/CapsCtrl/caps_g.py
|
TeX2e/dotfiles
|
4e39b59623067fcb09ceaa7f4892ff7a2b285374
|
[
"WTFPL"
] | 1
|
2017-04-17T16:24:23.000Z
|
2017-04-17T16:24:23.000Z
|
autokey/CapsCtrl/caps_g.py
|
TeX2e/dotfiles
|
4e39b59623067fcb09ceaa7f4892ff7a2b285374
|
[
"WTFPL"
] | null | null | null |
autokey/CapsCtrl/caps_g.py
|
TeX2e/dotfiles
|
4e39b59623067fcb09ceaa7f4892ff7a2b285374
|
[
"WTFPL"
] | 1
|
2021-02-23T07:51:32.000Z
|
2021-02-23T07:51:32.000Z
|
keyboard.send_keys("<ctrl>+g")
| 15.5
| 30
| 0.709677
| 5
| 31
| 4.2
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.032258
| 31
| 1
| 31
| 31
| 0.7
| 0
| 0
| 0
| 0
| 0
| 0.258065
| 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
|
d58e94ec5caaff3a9a3eecd3c2b15c63dfb1cf67
| 359
|
py
|
Python
|
app/models.py
|
YuliyaSim/blogwebsite
|
4499eeade05b2614fd1a7691779513fb38eb8132
|
[
"MIT"
] | null | null | null |
app/models.py
|
YuliyaSim/blogwebsite
|
4499eeade05b2614fd1a7691779513fb38eb8132
|
[
"MIT"
] | 1
|
2021-05-10T21:19:36.000Z
|
2021-05-10T21:19:36.000Z
|
app/models.py
|
YuliyaSim/blogwebsite
|
4499eeade05b2614fd1a7691779513fb38eb8132
|
[
"MIT"
] | null | null | null |
from app import db
class Blogpost(db.Model):
post_id = db.Column(db.Integer, primary_key=True)
title = db.Column(db.String(64))
subtitle = db.Column(db.String(64))
author = db.Column(db.String(64))
date_posted = db.Column(db.DateTime)
content = db.Column(db.Text)
# def __repr__(self):
# return f'<Book: {self.title}>'
| 23.933333
| 53
| 0.64624
| 54
| 359
| 4.166667
| 0.555556
| 0.213333
| 0.266667
| 0.213333
| 0.24
| 0
| 0
| 0
| 0
| 0
| 0
| 0.020906
| 0.200557
| 359
| 14
| 54
| 25.642857
| 0.763066
| 0.150418
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.125
| 0
| 1
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
d5995fefd698d1d13007b796a48a2f98caf0cc37
| 604
|
py
|
Python
|
mne/viz/tests/test_figure.py
|
stevemats/mne-python
|
47051833f21bb372d60afc3adbf4305648ac7f69
|
[
"BSD-3-Clause"
] | 1,953
|
2015-01-17T20:33:46.000Z
|
2022-03-30T04:36:34.000Z
|
mne/viz/tests/test_figure.py
|
stevemats/mne-python
|
47051833f21bb372d60afc3adbf4305648ac7f69
|
[
"BSD-3-Clause"
] | 8,490
|
2015-01-01T13:04:18.000Z
|
2022-03-31T23:02:08.000Z
|
mne/viz/tests/test_figure.py
|
stevemats/mne-python
|
47051833f21bb372d60afc3adbf4305648ac7f69
|
[
"BSD-3-Clause"
] | 1,130
|
2015-01-08T22:39:27.000Z
|
2022-03-30T21:44:26.000Z
|
# Authors: Daniel McCloy <dan@mccloy.info>
#
# License: Simplified BSD
import pytest
from mne.viz._mpl_figure import _psd_figure
from mne.viz._figure import _get_browser
def test_browse_figure_constructor():
"""Test error handling in MNEBrowseFigure constructor."""
with pytest.raises(TypeError, match='an instance of Raw, Epochs, or ICA'):
_get_browser(inst='foo')
def test_psd_figure_constructor():
"""Test error handling in MNELineFigure constructor."""
with pytest.raises(TypeError, match='an instance of Raw or Epochs, got'):
_psd_figure('foo', *((None,) * 20))
| 30.2
| 78
| 0.726821
| 81
| 604
| 5.209877
| 0.530864
| 0.063981
| 0.047393
| 0.123223
| 0.436019
| 0.436019
| 0.265403
| 0.265403
| 0.265403
| 0.265403
| 0
| 0.003937
| 0.15894
| 604
| 19
| 79
| 31.789474
| 0.826772
| 0.27649
| 0
| 0
| 0
| 0
| 0.17217
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.222222
| true
| 0
| 0.333333
| 0
| 0.555556
| 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
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
d5a4104962800246c7d852c401bb5d81c0c30259
| 3,219
|
py
|
Python
|
alphamind/benchmarks/data/winsorize.py
|
rongliang-tech/alpha-mind
|
39f720974c637d17e185e445dc05c9fc4863a241
|
[
"MIT"
] | 186
|
2017-11-27T01:26:44.000Z
|
2022-03-28T16:11:33.000Z
|
alphamind/benchmarks/data/winsorize.py
|
atefar2/alpha-mind
|
66d839affb5d81d31d5cac7e5e224278e3f99a8b
|
[
"MIT"
] | 2
|
2017-12-19T02:47:36.000Z
|
2021-01-09T05:25:18.000Z
|
alphamind/benchmarks/data/winsorize.py
|
atefar2/alpha-mind
|
66d839affb5d81d31d5cac7e5e224278e3f99a8b
|
[
"MIT"
] | 65
|
2017-11-27T01:26:47.000Z
|
2022-03-17T10:50:52.000Z
|
# -*- coding: utf-8 -*-
"""
Created on 2017-4-25
@author: cheng.li
"""
import datetime as dt
import numpy as np
import pandas as pd
from alphamind.data.winsorize import winsorize_normal
def benchmark_winsorize_normal(n_samples: int, n_features: int, n_loops: int) -> None:
print("-" * 60)
print("Starting winsorize normal benchmarking")
print("Parameters(n_samples: {0}, n_features: {1}, n_loops: {2})".format(n_samples, n_features,
n_loops))
num_stds = 2
x = np.random.randn(n_samples, n_features)
start = dt.datetime.now()
for _ in range(n_loops):
_ = winsorize_normal(x, num_stds)
impl_model_time = dt.datetime.now() - start
print('{0:20s}: {1}'.format('Implemented model', impl_model_time))
def impl(x):
std_values = x.std(axis=0)
mean_value = x.mean(axis=0)
lower_bound = mean_value - num_stds * std_values
upper_bound = mean_value + num_stds * std_values
res = np.where(x > upper_bound, upper_bound, x)
res = np.where(res < lower_bound, lower_bound, res)
return res
start = dt.datetime.now()
for _ in range(n_loops):
_ = impl(x)
benchmark_model_time = dt.datetime.now() - start
print('{0:20s}: {1}'.format('Benchmark model', benchmark_model_time))
def benchmark_winsorize_normal_with_group(n_samples: int, n_features: int, n_loops: int,
n_groups: int) -> None:
print("-" * 60)
print("Starting winsorize normal with group-by values benchmarking")
print(
"Parameters(n_samples: {0}, n_features: {1}, n_loops: {2}, n_groups: {3})".format(n_samples,
n_features,
n_loops,
n_groups))
num_stds = 2
x = np.random.randn(n_samples, n_features)
groups = np.random.randint(n_groups, size=n_samples)
start = dt.datetime.now()
for _ in range(n_loops):
_ = winsorize_normal(x, num_stds, groups=groups)
impl_model_time = dt.datetime.now() - start
print('{0:20s}: {1}'.format('Implemented model', impl_model_time))
def impl(x):
std_values = x.std(axis=0)
mean_value = x.mean(axis=0)
lower_bound = mean_value - num_stds * std_values
upper_bound = mean_value + num_stds * std_values
res = np.where(x > upper_bound, upper_bound, x)
res = np.where(res < lower_bound, lower_bound, res)
return res
start = dt.datetime.now()
for _ in range(n_loops):
_ = pd.DataFrame(x).groupby(groups).transform(impl)
benchmark_model_time = dt.datetime.now() - start
print('{0:20s}: {1}'.format('Benchmark model', benchmark_model_time))
if __name__ == '__main__':
benchmark_winsorize_normal(3000, 10, 1000)
benchmark_winsorize_normal_with_group(3000, 10, 1000, 30)
| 33.53125
| 102
| 0.560422
| 398
| 3,219
| 4.256281
| 0.211055
| 0.035419
| 0.061393
| 0.040142
| 0.790437
| 0.751476
| 0.751476
| 0.717237
| 0.669421
| 0.631641
| 0
| 0.02914
| 0.328363
| 3,219
| 95
| 103
| 33.884211
| 0.754394
| 0.019261
| 0
| 0.612903
| 0
| 0.016129
| 0.113949
| 0.013752
| 0
| 0
| 0
| 0
| 0
| 1
| 0.064516
| false
| 0
| 0.064516
| 0
| 0.16129
| 0.16129
| 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
|
d5a567636617e49740902766571c21f06e01cb73
| 2,680
|
py
|
Python
|
src/LPB/LPBVisitor.py
|
CptSpookz/LPB
|
1e3ff95e87b7aa9bc09eb214d2015e866ea9494f
|
[
"MIT"
] | 1
|
2018-10-24T18:51:12.000Z
|
2018-10-24T18:51:12.000Z
|
src/LPB/LPBVisitor.py
|
CptSpookz/LPB
|
1e3ff95e87b7aa9bc09eb214d2015e866ea9494f
|
[
"MIT"
] | null | null | null |
src/LPB/LPBVisitor.py
|
CptSpookz/LPB
|
1e3ff95e87b7aa9bc09eb214d2015e866ea9494f
|
[
"MIT"
] | null | null | null |
# Generated from LPB.g4 by ANTLR 4.7.1
from antlr4 import *
if __name__ is not None and "." in __name__:
from .LPBParser import LPBParser
else:
from LPBParser import LPBParser
from antlr4.error.Errors import ParseCancellationException
# This class defines a complete generic visitor for a parse tree produced by LPBParser.
class LPBVisitor(ParseTreeVisitor):
# Visit a parse tree produced by LPBParser#programa.
def visitPrograma(self, ctx:LPBParser.ProgramaContext):
return self.visitChildren(ctx)
# Visit a parse tree produced by LPBParser#decl_imovel.
def visitDecl_imovel(self, ctx:LPBParser.Decl_imovelContext):
return self.visitChildren(ctx)
# Visit a parse tree produced by LPBParser#decl_casa.
def visitDecl_casa(self, ctx:LPBParser.Decl_casaContext):
return self.visitChildren(ctx)
# Visit a parse tree produced by LPBParser#decl_apartamento.
def visitDecl_apartamento(self, ctx:LPBParser.Decl_apartamentoContext):
return self.visitChildren(ctx)
# Visit a parse tree produced by LPBParser#corpo.
def visitCorpo(self, ctx:LPBParser.CorpoContext):
return self.visitChildren(ctx)
# Visit a parse tree produced by LPBParser#decl_andar.
def visitDecl_andar(self, ctx:LPBParser.Decl_andarContext):
return self.visitChildren(ctx)
# Visit a parse tree produced by LPBParser#decl_planta.
def visitDecl_planta(self, ctx:LPBParser.Decl_plantaContext):
return self.visitChildren(ctx)
# Visit a parse tree produced by LPBParser#decl_comodos.
def visitDecl_comodos(self, ctx:LPBParser.Decl_comodosContext):
return self.visitChildren(ctx)
# Visit a parse tree produced by LPBParser#decl_moveis.
def visitDecl_moveis(self, ctx:LPBParser.Decl_moveisContext):
return self.visitChildren(ctx)
# Visit a parse tree produced by LPBParser#id_bloco.
def visitId_bloco(self, ctx:LPBParser.Id_blocoContext):
return self.visitChildren(ctx)
# Visit a parse tree produced by LPBParser#var_comodo.
def visitVar_comodo(self, ctx:LPBParser.Var_comodoContext):
return self.visitChildren(ctx)
# Visit a parse tree produced by LPBParser#tipo_comodo.
def visitTipo_comodo(self, ctx:LPBParser.Tipo_comodoContext):
return self.visitChildren(ctx)
# Visit a parse tree produced by LPBParser#tipo_movel.
def visitTipo_movel(self, ctx:LPBParser.Tipo_movelContext):
return self.visitChildren(ctx)
# Visit a parse tree produced by LPBParser#dimensao.
def visitDimensao(self, ctx:LPBParser.DimensaoContext):
return self.visitChildren(ctx)
del LPBParser
| 31.904762
| 87
| 0.745149
| 339
| 2,680
| 5.769912
| 0.235988
| 0.046012
| 0.076687
| 0.138037
| 0.462679
| 0.462679
| 0.447853
| 0.43047
| 0.43047
| 0.43047
| 0
| 0.002749
| 0.185448
| 2,680
| 84
| 88
| 31.904762
| 0.893266
| 0.317164
| 0
| 0.388889
| 1
| 0
| 0.000556
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.388889
| false
| 0
| 0.111111
| 0.388889
| 0.916667
| 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
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
d5a60fdd709604d275ff2b3365d1766f4980f7d5
| 93
|
py
|
Python
|
_project/testovani/apps.py
|
SucheG/cayman-pullup.cz
|
a03bb58d5ff3ef3dba431bd4e900e6b3649c48f8
|
[
"CC0-1.0"
] | null | null | null |
_project/testovani/apps.py
|
SucheG/cayman-pullup.cz
|
a03bb58d5ff3ef3dba431bd4e900e6b3649c48f8
|
[
"CC0-1.0"
] | null | null | null |
_project/testovani/apps.py
|
SucheG/cayman-pullup.cz
|
a03bb58d5ff3ef3dba431bd4e900e6b3649c48f8
|
[
"CC0-1.0"
] | 1
|
2018-10-08T16:56:40.000Z
|
2018-10-08T16:56:40.000Z
|
from django.apps import AppConfig
class TestovaniConfig(AppConfig):
name = 'testovani'
| 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
|
639b70cec82eef32dcabff26a0c609fa05ea04f6
| 137
|
py
|
Python
|
Hello World Programs/Hello World.py
|
chloee59/Contribute-to-HacktoberFest2020
|
15c292f4bdc659ad4a0fc1276b245520612c24ab
|
[
"MIT"
] | null | null | null |
Hello World Programs/Hello World.py
|
chloee59/Contribute-to-HacktoberFest2020
|
15c292f4bdc659ad4a0fc1276b245520612c24ab
|
[
"MIT"
] | null | null | null |
Hello World Programs/Hello World.py
|
chloee59/Contribute-to-HacktoberFest2020
|
15c292f4bdc659ad4a0fc1276b245520612c24ab
|
[
"MIT"
] | null | null | null |
print ("Hello world")
print ("Nice to meet you!")
name = input ("what is your name")
print ("I hope to code with you more" name "!")
| 27.4
| 48
| 0.635036
| 23
| 137
| 3.782609
| 0.73913
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.211679
| 137
| 4
| 49
| 34.25
| 0.805556
| 0
| 0
| 0
| 0
| 0
| 0.540146
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0.75
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
8946e949f159ef64b04c0446e5a9e266c09ae307
| 3,140
|
py
|
Python
|
third/time_Arrow.py
|
gottaegbert/penter
|
8cbb6be3c4bf67c7c69fa70e597bfbc3be4f0a2d
|
[
"MIT"
] | 13
|
2020-01-04T07:37:38.000Z
|
2021-08-31T05:19:58.000Z
|
third/time_Arrow.py
|
gottaegbert/penter
|
8cbb6be3c4bf67c7c69fa70e597bfbc3be4f0a2d
|
[
"MIT"
] | 3
|
2020-06-05T22:42:53.000Z
|
2020-08-24T07:18:54.000Z
|
third/time_Arrow.py
|
gottaegbert/penter
|
8cbb6be3c4bf67c7c69fa70e597bfbc3be4f0a2d
|
[
"MIT"
] | 9
|
2020-10-19T04:53:06.000Z
|
2021-08-31T05:20:01.000Z
|
# https://github.com/arrow-py/arrow
"""
>>> import arrow
>>> arrow.get('2013-05-11T21:23:58.970460+07:00')
<Arrow [2013-05-11T21:23:58.970460+07:00]>
>>> utc = arrow.utcnow()
>>> utc
<Arrow [2013-05-11T21:23:58.970460+00:00]>
>>> utc = utc.shift(hours=-1)
>>> utc
<Arrow [2013-05-11T20:23:58.970460+00:00]>
>>> local = utc.to('US/Pacific')
>>> local
<Arrow [2013-05-11T13:23:58.970460-07:00]>
>>> local.timestamp
1368303838
>>> local.format()
'2013-05-11 13:23:58 -07:00'
>>> local.format('YYYY-MM-DD HH:mm:ss ZZ')
'2013-05-11 13:23:58 -07:00'
>>> local.humanize()
'an hour ago'
>>> local.humanize(locale='ko_kr')
'1시간 전'
>>> arrow.utcnow()
<Arrow [2013-05-07T04:20:39.369271+00:00]>
>>> arrow.now()
<Arrow [2013-05-06T21:20:40.841085-07:00]>
>>> arrow.now('US/Pacific')
<Arrow [2013-05-06T21:20:44.761511-07:00]>
>>> arrow.get(1367900664)
<Arrow [2013-05-07T04:24:24+00:00]>
>>> arrow.get(1367900664.152325)
<Arrow [2013-05-07T04:24:24.152325+00:00]>
>>> arrow.get(datetime.utcnow())
<Arrow [2013-05-07T04:24:24.152325+00:00]>
>>> arrow.get(datetime(2013, 5, 5), 'US/Pacific')
<Arrow [2013-05-05T00:00:00-07:00]>
>>> from dateutil import tz
>>> arrow.get(datetime(2013, 5, 5), tz.gettz('US/Pacific'))
<Arrow [2013-05-05T00:00:00-07:00]>
>>> arrow.get(datetime.now(tz.gettz('US/Pacific')))
<Arrow [2013-05-06T21:24:49.552236-07:00]>
>>> arrow.get('2013-05-05 12:30:45', 'YYYY-MM-DD HH:mm:ss')
<Arrow [2013-05-05T12:30:45+00:00]>
>>> arrow.get('June was born in May 1980', 'MMMM YYYY')
<Arrow [1980-05-01T00:00:00+00:00]>
>>> arrow.get(2013, 5, 5)
<Arrow [2013-05-05T00:00:00+00:00]>
>>> past = arrow.utcnow().shift(hours=-1)
>>> past.humanize()
'an hour ago'
# 只需要时间间隔
>>> present = arrow.utcnow()
>>> future = present.shift(hours=2)
>>> future.humanize(present)
'in 2 hours'
>>> future.humanize(present, only_distance=True)
'2 hours'
# 不同的时间粒度
>>> present = arrow.utcnow()
>>> future = present.shift(minutes=66)
>>> future.humanize(present, granularity="minute")
'in 66 minutes'
>>> future.humanize(present, granularity=["hour", "minute"])
'in an hour and 6 minutes'
>>> present.humanize(future, granularity=["hour", "minute"])
'an hour and 6 minutes ago'
>>> future.humanize(present, only_distance=True, granularity=["hour", "minute"])
'an hour and 6 minutes'
>>> arrow.utcnow().span('hour')
(<Arrow [2013-05-07T05:00:00+00:00]>, <Arrow [2013-05-07T05:59:59.999999+00:00]>)
# 向下取整
>>> arrow.utcnow().floor('hour')
<Arrow [2013-05-07T05:00:00+00:00]>
# 向上取整
>>> arrow.utcnow().ceil('hour')
<Arrow [2013-05-07T05:59:59.999999+00:00]>
# 时间范围序列
>>> start = datetime(2013, 5, 5, 12, 30)
>>> end = datetime(2013, 5, 5, 17, 15)
>>> for r in arrow.Arrow.span_range('hour', start, end):
... print r
...
(<Arrow [2013-05-05T12:00:00+00:00]>, <Arrow [2013-05-05T12:59:59.999999+00:00]>)
(<Arrow [2013-05-05T13:00:00+00:00]>, <Arrow [2013-05-05T13:59:59.999999+00:00]>)
(<Arrow [2013-05-05T14:00:00+00:00]>, <Arrow [2013-05-05T14:59:59.999999+00:00]>)
(<Arrow [2013-05-05T15:00:00+00:00]>, <Arrow [2013-05-05T15:59:59.999999+00:00]>)
(<Arrow [2013-05-05T16:00:00+00:00]>, <Arrow [2013-05-05T16:59:59.999999+00:00]>)
"""
| 26.837607
| 81
| 0.649682
| 541
| 3,140
| 3.763401
| 0.214418
| 0.084479
| 0.15668
| 0.070236
| 0.562868
| 0.5
| 0.346758
| 0.268173
| 0.157171
| 0.077603
| 0
| 0.284355
| 0.096178
| 3,140
| 117
| 82
| 26.837607
| 0.433051
| 0.997134
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
89471bc6a991e1d9497b6f603ab9d30938d69293
| 323
|
py
|
Python
|
udemy-data-structures-and-algorithms/15-recursion/15.5_factorial_memoization.py
|
washimimizuku/python-data-structures-and-algorithms
|
537f4eabaf31888ae48004d153088fb28bb684ab
|
[
"MIT"
] | null | null | null |
udemy-data-structures-and-algorithms/15-recursion/15.5_factorial_memoization.py
|
washimimizuku/python-data-structures-and-algorithms
|
537f4eabaf31888ae48004d153088fb28bb684ab
|
[
"MIT"
] | null | null | null |
udemy-data-structures-and-algorithms/15-recursion/15.5_factorial_memoization.py
|
washimimizuku/python-data-structures-and-algorithms
|
537f4eabaf31888ae48004d153088fb28bb684ab
|
[
"MIT"
] | null | null | null |
# Create cache for known results
factorial_memo = {}
def factorial(k):
if k < 2:
return 1
if not k in factorial_memo:
factorial_memo[k] = k * factorial(k-1)
return factorial_memo[k]
print(factorial_memo)
print(factorial(4))
print(factorial_memo)
print(factorial(5))
print(factorial_memo)
| 15.380952
| 46
| 0.684211
| 47
| 323
| 4.553191
| 0.382979
| 0.425234
| 0.252336
| 0.214953
| 0.299065
| 0
| 0
| 0
| 0
| 0
| 0
| 0.019685
| 0.213622
| 323
| 20
| 47
| 16.15
| 0.822835
| 0.092879
| 0
| 0.25
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.083333
| false
| 0
| 0
| 0
| 0.25
| 0.416667
| 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
|
8948a92cc25589fb4c5f8d4542880240bf2753df
| 103
|
py
|
Python
|
mysocialauth/social_auth_app/apps.py
|
itssubas/django-social-auth
|
076ebfb4b2c7d2ddf3693294bf8b58c08b892cf3
|
[
"MIT"
] | null | null | null |
mysocialauth/social_auth_app/apps.py
|
itssubas/django-social-auth
|
076ebfb4b2c7d2ddf3693294bf8b58c08b892cf3
|
[
"MIT"
] | null | null | null |
mysocialauth/social_auth_app/apps.py
|
itssubas/django-social-auth
|
076ebfb4b2c7d2ddf3693294bf8b58c08b892cf3
|
[
"MIT"
] | null | null | null |
from django.apps import AppConfig
class SocialAuthAppConfig(AppConfig):
name = 'social_auth_app'
| 17.166667
| 37
| 0.786408
| 12
| 103
| 6.583333
| 0.916667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.145631
| 103
| 5
| 38
| 20.6
| 0.897727
| 0
| 0
| 0
| 0
| 0
| 0.145631
| 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
|
895b890668160ca1aaa03d6d668f6d30f8afafa1
| 453
|
py
|
Python
|
tests/test_helpers.py
|
baurt/sqladmin
|
5701c7905a1e8c6ea8f2bcfbf7ff68517f64c572
|
[
"BSD-3-Clause"
] | 319
|
2021-12-27T21:40:02.000Z
|
2022-03-31T20:03:47.000Z
|
tests/test_helpers.py
|
dwreeves/sqladmin
|
fbc733ec1a7eb31ddd1e39e2b9dd2b21c82f0ce7
|
[
"BSD-3-Clause"
] | 36
|
2021-12-31T00:12:49.000Z
|
2022-03-31T09:58:14.000Z
|
tests/test_helpers.py
|
dwreeves/sqladmin
|
fbc733ec1a7eb31ddd1e39e2b9dd2b21c82f0ce7
|
[
"BSD-3-Clause"
] | 30
|
2022-01-03T16:57:58.000Z
|
2022-03-24T04:23:47.000Z
|
from sqladmin.helpers import secure_filename
def test_secure_filename(monkeypatch):
assert secure_filename("My cool movie.mov") == "My_cool_movie.mov"
assert secure_filename("../../../etc/passwd") == "etc_passwd"
assert (
secure_filename("i contain cool \xfcml\xe4uts.txt")
== "i_contain_cool_umlauts.txt"
)
assert secure_filename("__filename__") == "filename"
assert secure_filename("foo$&^*)bar") == "foobar"
| 34.846154
| 70
| 0.686534
| 54
| 453
| 5.425926
| 0.462963
| 0.334471
| 0.341297
| 0.095563
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.002646
| 0.165563
| 453
| 12
| 71
| 37.75
| 0.772487
| 0
| 0
| 0
| 0
| 0
| 0.348786
| 0.057395
| 0
| 0
| 0
| 0
| 0.5
| 1
| 0.1
| false
| 0.1
| 0.1
| 0
| 0.2
| 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
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
8997371d6cf2b0742cd918f9b7d7907b27de2c41
| 10,048
|
py
|
Python
|
inverse_covariance/tests/quic_graph_lasso_test.py
|
aldanor/skggm
|
d2e29d692d1654285653ab07fd24534628fcb076
|
[
"MIT"
] | null | null | null |
inverse_covariance/tests/quic_graph_lasso_test.py
|
aldanor/skggm
|
d2e29d692d1654285653ab07fd24534628fcb076
|
[
"MIT"
] | null | null | null |
inverse_covariance/tests/quic_graph_lasso_test.py
|
aldanor/skggm
|
d2e29d692d1654285653ab07fd24534628fcb076
|
[
"MIT"
] | null | null | null |
import numpy as np
import pytest
from numpy.testing import assert_raises
from numpy.testing import assert_allclose
from sklearn import datasets
from inverse_covariance import (
QuicGraphicalLasso,
QuicGraphicalLassoCV,
QuicGraphicalLassoEBIC,
quic,
)
def custom_init(X):
init_cov = np.cov(X, rowvar=False)
return init_cov, np.max(np.abs(np.triu(init_cov)))
class TestQuicGraphicalLasso(object):
@pytest.mark.parametrize(
"params_in, expected",
[
(
{},
[
3.2437533337151625,
3.4490549523890648,
9.7303201146340168,
3.673994442010553e-11,
],
), # NOQA
(
{"lam": 1.0, "max_iter": 100},
[3.1622776601683795, 3.1622776601683795, 10.0, 0.0],
),
(
{"lam": 0.5, "mode": "trace"},
[
3.2437533337151625,
3.4490549523890652,
32.290292419357321,
0.21836515326396364,
],
), # NOQA
(
{
"lam": 0.5,
"mode": "path",
"path": np.array([1.0, 0.9, 0.8, 0.7, 0.6, 0.5]),
},
[
8.3256240637201717,
9.7862122341861983,
22.752074276274861,
1.6530965731149066e-08,
],
), # NOQA
(
{"lam": 1.0, "max_iter": 100, "init_method": "cov"},
[
0.0071706976421055616,
1394.564448134179,
50.890448754467911,
7.1054273576010019e-15,
],
), # NOQA
(
{"lam": 1.0, "max_iter": 100, "init_method": custom_init},
[
0.0071706976421055616,
1394.564448134179,
50.890448754467911,
7.1054273576010019e-15,
],
), # NOQA
(
{"lam": 1.0, "max_iter": 100, "init_method": "spearman"},
[3.1622776601683795, 3.1622776601683795, 10.0, 1.7763568394002505e-15],
), # NOQA
(
{"lam": 1.0, "max_iter": 100, "init_method": "kendalltau"},
[3.1622776601683795, 3.1622776601683795, 10.0, 0.0],
), # NOQA
],
)
def test_integration_quic_graphical_lasso(self, params_in, expected):
"""
Just tests inputs/outputs (not validity of result).
"""
X = datasets.load_diabetes().data
ic = QuicGraphicalLasso(**params_in)
ic.fit(X)
result_vec = [
np.linalg.norm(ic.covariance_),
np.linalg.norm(ic.precision_),
np.linalg.norm(ic.opt_),
np.linalg.norm(ic.duality_gap_),
]
print(result_vec)
assert_allclose(expected, result_vec, atol=1e-1, rtol=1e-1)
@pytest.mark.parametrize(
"params_in, expected",
[
(
{},
[
3.2437533337151625,
3.4490549523890648,
9.7303201146340168,
3.673994442010553e-11,
],
), # NOQA
(
{"lam": 1.0, "max_iter": 100},
[3.1622776601683795, 3.1622776601683795, 10.0, 0.0],
),
(
{"lam": 0.5, "mode": "trace"},
[
3.2437533337151625,
3.4490549523890652,
32.290292419357321,
0.21836515326396364,
],
), # NOQA
(
{
"lam": 0.5,
"mode": "path",
"path": np.array([1.0, 0.9, 0.8, 0.7, 0.6, 0.5]),
},
[
8.3256240637201717,
9.7862122341861983,
22.752074276274861,
1.6530965731149066e-08,
],
), # NOQA
(
{"lam": 1.0, "max_iter": 100, "init_method": "cov"},
[
0.0071706976421055616,
1394.564448134179,
50.890448754467911,
7.1054273576010019e-15,
],
), # NOQA
(
{"lam": 1.0, "max_iter": 100, "init_method": "spearman"},
[3.1622776601683795, 3.1622776601683795, 10.0, 0.0],
), # NOQA
(
{"lam": 1.0, "max_iter": 100, "init_method": "kendalltau"},
[3.1622776601683795, 3.1622776601683795, 10.0, 0.0],
), # NOQA
],
)
def test_integration_quic_graphical_lasso_fun(self, params_in, expected):
"""
Just tests inputs/outputs (not validity of result).
"""
X = datasets.load_diabetes().data
lam = 0.5
if "lam" in params_in:
lam = params_in["lam"]
del params_in["lam"]
S = np.corrcoef(X, rowvar=False)
if "init_method" in params_in:
if params_in["init_method"] == "cov":
S = np.cov(X, rowvar=False)
del params_in["init_method"]
precision_, covariance_, opt_, cpu_time_, iters_, duality_gap_ = quic(
S, lam, **params_in
)
result_vec = [
np.linalg.norm(covariance_),
np.linalg.norm(precision_),
np.linalg.norm(opt_),
np.linalg.norm(duality_gap_),
]
print(result_vec)
assert_allclose(expected, result_vec, atol=1e-1, rtol=1e-1)
@pytest.mark.parametrize(
"params_in, expected",
[
(
{"n_refinements": 1},
[4.6528, 32.335, 3.822, 1.5581289048993696e-06, 0.01],
), # NOQA
(
{
"lam": 0.5 * np.ones((10, 10)) - 0.5 * np.diag(np.ones((10,))),
"n_refinements": 1,
},
[4.6765, 49.24459, 3.26151, 6.769744583801085e-07],
), # NOQA
(
{
"lam": 0.5 * np.ones((10, 10)) - 0.5 * np.diag(np.ones((10,))),
"n_refinements": 1,
"init_method": "cov",
},
[0.0106, 21634.95296, 57.6289, 0.00039],
),
(
{
"lam": 0.5 * np.ones((10, 10)) - 0.5 * np.diag(np.ones((10,))),
"n_refinements": 1,
"init_method": custom_init,
},
[0.0106, 21634.95296, 57.6289, 0.00039],
), # NOQA
(
{
"lam": 0.5 * np.ones((10, 10)) - 0.5 * np.diag(np.ones((10,))),
"n_refinements": 1,
"init_method": "spearman",
},
[
4.8315707207048622,
38.709631332689789,
2.8265068394116657,
1.5312382906085276e-07,
],
), # NOQA
(
{
"lam": 0.5 * np.ones((10, 10)) - 0.5 * np.diag(np.ones((10,))),
"n_refinements": 1,
"init_method": "kendalltau",
},
[
4.9007318106601074,
85.081499460930743,
2.0463861650623159,
0.00012530384889419821,
],
), # NOQA
],
)
def test_integration_quic_graphical_lasso_cv(self, params_in, expected):
"""
Just tests inputs/outputs (not validity of result).
"""
X = datasets.load_diabetes().data
ic = QuicGraphicalLassoCV(**params_in)
ic.fit(X)
result_vec = [
np.linalg.norm(ic.covariance_),
np.linalg.norm(ic.precision_),
np.linalg.norm(ic.opt_),
np.linalg.norm(ic.duality_gap_),
]
if isinstance(ic.lam_, float):
result_vec.append(ic.lam_)
elif isinstance(ic.lam_, np.ndarray):
assert ic.lam_.shape == params_in["lam"].shape
print(result_vec)
assert_allclose(expected, result_vec, atol=1e-1, rtol=1e-1)
assert len(ic.grid_scores_) == len(ic.cv_lams_)
@pytest.mark.parametrize(
"params_in, expected",
[
({}, [3.1622776601683795, 3.1622776601683795, 0.91116275611548958]),
({"lam": 0.5 * np.ones((10, 10))}, [4.797, 2.1849]),
(
{"lam": 0.5 * np.ones((10, 10)), "init_method": custom_init},
[0.0106, 35056.88460],
), # NOQA
],
)
def test_integration_quic_graphical_lasso_ebic(self, params_in, expected):
"""
Just tests inputs/outputs (not validity of result).
"""
X = datasets.load_diabetes().data
ic = QuicGraphicalLassoEBIC(**params_in)
ic.fit(X)
result_vec = [np.linalg.norm(ic.covariance_), np.linalg.norm(ic.precision_)]
if isinstance(ic.lam_, float):
result_vec.append(ic.lam_)
elif isinstance(ic.lam_, np.ndarray):
assert ic.lam_.shape == params_in["lam"].shape
print(result_vec)
assert_allclose(expected, result_vec, atol=1e-1, rtol=1e-1)
def test_invalid_method(self):
"""
Test behavior of invalid inputs.
"""
X = datasets.load_diabetes().data
ic = QuicGraphicalLasso(method="unknownmethod")
assert_raises(NotImplementedError, ic.fit, X)
| 32.517799
| 87
| 0.439689
| 927
| 10,048
| 4.612729
| 0.186624
| 0.037418
| 0.039289
| 0.032741
| 0.759588
| 0.731291
| 0.723106
| 0.673761
| 0.661132
| 0.660664
| 0
| 0.245107
| 0.435609
| 10,048
| 308
| 88
| 32.623377
| 0.508905
| 0.033439
| 0
| 0.553114
| 0
| 0
| 0.061286
| 0
| 0
| 0
| 0
| 0
| 0.03663
| 1
| 0.021978
| false
| 0
| 0.021978
| 0
| 0.051282
| 0.014652
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 1
| 0
| 1
| 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
|
89a1b10d14bdbbec080f45fecbeaf2e6b8f8834c
| 193
|
py
|
Python
|
tests/constants.py
|
raiden-network/raiden-wizard
|
faea0f3075b748b6a1e204518e84b0fd1950d5b5
|
[
"MIT"
] | 9
|
2020-05-27T12:19:29.000Z
|
2022-03-20T05:55:36.000Z
|
tests/constants.py
|
raiden-network/raiden-wizard
|
faea0f3075b748b6a1e204518e84b0fd1950d5b5
|
[
"MIT"
] | 178
|
2020-02-26T17:03:22.000Z
|
2021-12-28T14:21:00.000Z
|
tests/constants.py
|
raiden-network/raiden-wizard
|
faea0f3075b748b6a1e204518e84b0fd1950d5b5
|
[
"MIT"
] | 9
|
2020-03-30T13:35:28.000Z
|
2022-03-01T17:24:20.000Z
|
import tempfile
from pathlib import Path
TESTING_TEMP_FOLDER = Path(tempfile.gettempdir()).joinpath("raiden-wizard-testing")
TESTING_KEYSTORE_FOLDER = TESTING_TEMP_FOLDER.joinpath("keystore")
| 32.166667
| 83
| 0.834197
| 24
| 193
| 6.458333
| 0.541667
| 0.141935
| 0.219355
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.067358
| 193
| 5
| 84
| 38.6
| 0.861111
| 0
| 0
| 0
| 0
| 0
| 0.150259
| 0.108808
| 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
|
89a4049c7a9e1c8b35eada2ea8ffa7e07bb99d7e
| 35
|
py
|
Python
|
Second.py
|
DheerajKN/Python-with-pygame
|
22a39eba6de64fb31b1c7bd5c1b1d434b790f29b
|
[
"MIT"
] | 1
|
2019-04-18T08:09:17.000Z
|
2019-04-18T08:09:17.000Z
|
Second.py
|
DheerajKN/Python-with-pygame
|
22a39eba6de64fb31b1c7bd5c1b1d434b790f29b
|
[
"MIT"
] | null | null | null |
Second.py
|
DheerajKN/Python-with-pygame
|
22a39eba6de64fb31b1c7bd5c1b1d434b790f29b
|
[
"MIT"
] | null | null | null |
s="\t\tHello\n"
print(s.strip())
| 11.666667
| 17
| 0.571429
| 7
| 35
| 2.857143
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.114286
| 35
| 2
| 18
| 17.5
| 0.645161
| 0
| 0
| 0
| 0
| 0
| 0.333333
| 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
|
89b5a982460ef61e62dc172e5ff082191884905b
| 313
|
py
|
Python
|
venv/Lib/site-packages/flask_administration/blueprints.py
|
DoesArt-Studios/RamBrowse
|
a81da53e04d265d17e76855e7affc11130ee6120
|
[
"MIT"
] | 1
|
2020-05-18T06:35:36.000Z
|
2020-05-18T06:35:36.000Z
|
venv/Lib/site-packages/flask_administration/blueprints.py
|
DoesArt-Studios/RamBrowse
|
a81da53e04d265d17e76855e7affc11130ee6120
|
[
"MIT"
] | null | null | null |
venv/Lib/site-packages/flask_administration/blueprints.py
|
DoesArt-Studios/RamBrowse
|
a81da53e04d265d17e76855e7affc11130ee6120
|
[
"MIT"
] | null | null | null |
from flask import jsonify, Blueprint, request, Response, render_template
from .utils import (static_folder, template_folder, encode_model)
admin = Blueprint('main',
'flask.ext.administration.main',
static_folder=static_folder,
template_folder=template_folder)
| 39.125
| 72
| 0.690096
| 33
| 313
| 6.30303
| 0.545455
| 0.173077
| 0.288462
| 0.25
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.233227
| 313
| 7
| 73
| 44.714286
| 0.866667
| 0
| 0
| 0
| 0
| 0
| 0.105431
| 0.092652
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0.333333
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
89b8d91aa521c6ad5c769377e26181594b481fd7
| 788
|
py
|
Python
|
phase_2/pkg_KOG/class_hero.py
|
Jackson-Cong/191130
|
2a47d5bef9139172cf9a472880cc278b964a0394
|
[
"BSD-3-Clause"
] | null | null | null |
phase_2/pkg_KOG/class_hero.py
|
Jackson-Cong/191130
|
2a47d5bef9139172cf9a472880cc278b964a0394
|
[
"BSD-3-Clause"
] | null | null | null |
phase_2/pkg_KOG/class_hero.py
|
Jackson-Cong/191130
|
2a47d5bef9139172cf9a472880cc278b964a0394
|
[
"BSD-3-Clause"
] | null | null | null |
# -*- coding: UTF-8 -*-
import random
class Hero():
'''
skin = '英雄原始皮肤'
name = '英雄姓名'
position = '英雄定位'
ab_viability = 0
ab_damage = 0
ab_effect = 0
ab_difficulty = 0
'''
def __init__(self, s, n, p):
'初始化英雄类'
self.skin = s
self.__name = n # 不可更改
self.__position = p # 不可更改
self.ab_viability = random.randint(1, 100)
self.ab_damage = random.randint(1, 100)
self.ab_effect = random.randint(1, 100)
self.ab_difficulty = random.randint(1, 100)
return
@property
def name(self):
return self.__name
@property
def position(self):
return self.__position
def show_story(self):
return
def show_history(self):
return
| 19.7
| 51
| 0.550761
| 96
| 788
| 4.291667
| 0.364583
| 0.058252
| 0.135922
| 0.165049
| 0.167476
| 0.167476
| 0
| 0
| 0
| 0
| 0
| 0.040307
| 0.338832
| 788
| 39
| 52
| 20.205128
| 0.75048
| 0.191624
| 0
| 0.227273
| 0
| 0
| 0.009967
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.227273
| false
| 0
| 0.045455
| 0.181818
| 0.545455
| 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
|
9834db89cddefc5f9fef58cd52af2fcf951ad100
| 336
|
py
|
Python
|
app/commands/default/slack_send.py
|
mallycrip/jenkinsfile-converter
|
aa9eddeec48444efdbf7d042680382131a127032
|
[
"MIT"
] | null | null | null |
app/commands/default/slack_send.py
|
mallycrip/jenkinsfile-converter
|
aa9eddeec48444efdbf7d042680382131a127032
|
[
"MIT"
] | null | null | null |
app/commands/default/slack_send.py
|
mallycrip/jenkinsfile-converter
|
aa9eddeec48444efdbf7d042680382131a127032
|
[
"MIT"
] | null | null | null |
from app.commands.default import BaseCommand
class SlackSend(BaseCommand):
def get_command(self, color, message) -> str:
return self.generate_command(color, message)
@classmethod
def generate_command(cls, color, message):
return f'slackSend (color: "{color}", message: """\\\n{message}""".stripMargin())'
| 30.545455
| 90
| 0.690476
| 38
| 336
| 6.026316
| 0.578947
| 0.209607
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.169643
| 336
| 10
| 91
| 33.6
| 0.820789
| 0
| 0
| 0
| 1
| 0
| 0.214286
| 0.10119
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0
| 0.142857
| 0.285714
| 0.857143
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 4
|
9873d8b8ea1a10eac9db2ceae3d041e3f8598a61
| 4,337
|
py
|
Python
|
registry/packages.py
|
AraOshin/civic-sandbox-backend
|
7f864cd829927e5cbe99f252ba54c488ed4dedb6
|
[
"MIT"
] | 1
|
2018-11-16T21:57:25.000Z
|
2018-11-16T21:57:25.000Z
|
registry/packages.py
|
nam20485/civic-sandbox-backend
|
7f864cd829927e5cbe99f252ba54c488ed4dedb6
|
[
"MIT"
] | null | null | null |
registry/packages.py
|
nam20485/civic-sandbox-backend
|
7f864cd829927e5cbe99f252ba54c488ed4dedb6
|
[
"MIT"
] | 1
|
2019-03-07T17:24:26.000Z
|
2019-03-07T17:24:26.000Z
|
packages = {
'Greenspace': {
'description': '',
'foundations' : [
'neighborhood_development_18_027',
'neighborhood_development_18_021'
],
'default_foundation' : 'neighborhood_development_18_027',
'slides' : [
'neighborhood_development_18_003',
'neighborhood_development_18_004',
'neighborhood_development_18_005'
],
'default_slide' : [
'neighborhood_development_18_003',
'neighborhood_development_18_004'
],
},
'Food Access': {
'description': '',
'foundations' : [
'Percent Renter Occupied',
'poverty rate'
],
'default_foundation' : 'poverty rate',
'slides' : [
'neighborhood_development_18_007',
'neighborhood_development_18_008',
'neighborhood_development_18_005',
'neighborhood_development_18_012'
],
'default_slide' : 'neighborhood_development_18_008'
},
'Sweeps': {
'description': '',
'foundations' : [
'neighborhood_development_18_020',
'neighborhood_development_18_021',
'neighborhood_development_18_027',
'neighborhood_development_18_034',
'neighborhood_development_18_028',
'neighborhood_development_18_030'
],
'default_foundation' : 'neighborhood_development_18_020',
'slides' : [
'neighborhood_development_18_010',
'neighborhood_development_18_011',
'neighborhood_development_18_009',
'neighborhood_development_18_003',
'neighborhood_development_18_004',
],
'default_slide' : [
'neighborhood_development_18_010',
],
},
'Bikes': {
'description': '',
'foundations' : [
'neighborhood_development_18_021'
],
'default_foundation' : 'neighborhood_development_18_021',
'slides' : [
'neighborhood_development_18_001',
'neighborhood_development_18_002',
'neighborhood_development_18_006',
'neighborhood_development_18_014',
'neighborhood_development_18_013'
],
'default_slide' : [
'neighborhood_development_18_001',
'neighborhood_development_18_002'
],
},
'Disaster Resilience': {
'description': '',
'foundations' : [
'disaster_resilience_18_002',
'disaster_resilience_18_003',
'disaster_resilience_18_004',
'disaster_resilience_18_005',
],
'default_foundation' : 'disaster_resilience_18_002',
'slides' : [
'disaster_resilience_18_001',
],
'default_slide' : [
'disaster_resilience_18_001',
]
},
'Evictions': {
'description': '',
'foundations' : [
'neighborhood_development_18_022',
'neighborhood_development_18_023',
'neighborhood_development_18_024',
'neighborhood_development_18_025',
'neighborhood_development_18_026',
'neighborhood_development_18_032',
],
'default_foundation' : 'neighborhood_development_18_024',
'slides' : [
'neighborhood_development_18_012',
'neighborhood_development_18_007',
'neighborhood_development_18_009',
'housing_affordability_18_001'
],
'default_slide' : ['neighborhood_development_18_009',]
},
'Voters': {
'description': '',
'foundations' : [
'neighborhood_development_18_015',
'neighborhood_development_18_016',
'neighborhood_development_18_017',
'neighborhood_development_18_018',
'neighborhood_development_18_019'
],
'default_foundation' : 'voters18',
'slides' : [
'neighborhood_development_18_007',
'neighborhood_development_18_004',
'neighborhood_development_18_006',
'neighborhood_development_18_002',
],
'default_slide' : []
},
'Transportation': {
'description': '',
'foundations' : [
'transportation_systems_18_005',
],
'default_foundation' : 'transportation_systems_18_005',
'slides' : [
'transportation_systems_18_001',
'transportation_systems_18_003',
'transportation_systems_18_004',
],
'default_slide' : [
'transportation_systems_18_001',
'transportation_systems_18_003',
'transportation_systems_18_004',
],
}
}
| 30.118056
| 62
| 0.635462
| 359
| 4,337
| 7.038997
| 0.167131
| 0.500594
| 0.544123
| 0.073605
| 0.540562
| 0.380689
| 0.380689
| 0.274634
| 0.117135
| 0.061733
| 0
| 0.110561
| 0.255476
| 4,337
| 144
| 63
| 30.118056
| 0.672035
| 0
| 0
| 0.555556
| 0
| 0
| 0.634855
| 0.494929
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 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
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
98925c11d94069b4203987ba167a6c80d2f1f30d
| 99
|
py
|
Python
|
jaegerserver/apps.py
|
the-bombers/jaeger
|
8912252af89154928f47bfde6912267d782371d1
|
[
"Unlicense"
] | null | null | null |
jaegerserver/apps.py
|
the-bombers/jaeger
|
8912252af89154928f47bfde6912267d782371d1
|
[
"Unlicense"
] | 19
|
2021-03-17T10:22:19.000Z
|
2021-03-19T15:13:08.000Z
|
jaegerserver/apps.py
|
the-bombers/jaeger
|
8912252af89154928f47bfde6912267d782371d1
|
[
"Unlicense"
] | null | null | null |
from django.apps import AppConfig
class JaegerserverConfig(AppConfig):
name = 'jaegerserver'
| 16.5
| 36
| 0.777778
| 10
| 99
| 7.7
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.151515
| 99
| 5
| 37
| 19.8
| 0.916667
| 0
| 0
| 0
| 0
| 0
| 0.121212
| 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
|
7f2adeeac0ef7b2299a59a4f772a735b62c22c19
| 214
|
py
|
Python
|
case/api_test/conftest.py
|
lzpsgh/AscTrio
|
f969beece5dc93d29063da03793521bc54b814dd
|
[
"MIT"
] | 5
|
2021-07-21T06:50:51.000Z
|
2022-03-31T04:18:28.000Z
|
case/api_test/conftest.py
|
lzpsgh/AscTrio
|
f969beece5dc93d29063da03793521bc54b814dd
|
[
"MIT"
] | null | null | null |
case/api_test/conftest.py
|
lzpsgh/AscTrio
|
f969beece5dc93d29063da03793521bc54b814dd
|
[
"MIT"
] | 1
|
2022-03-28T01:50:03.000Z
|
2022-03-28T01:50:03.000Z
|
# import pytest
#
# from case.conftest import api_data
#
#
# @pytest.fixture(scope="function")
# def testcase_data(request):
# testcase_name = request.function.__name__
# return api_data.get(testcase_name)
| 21.4
| 47
| 0.733645
| 27
| 214
| 5.481481
| 0.592593
| 0.094595
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.14486
| 214
| 9
| 48
| 23.777778
| 0.808743
| 0.911215
| 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
|
7f3da242a8ca5bec4f9f34d7f819cb7e39d878e8
| 93
|
py
|
Python
|
qwilt/qsig/__init__.py
|
Qwilt/Qsig-Token-Python
|
4d663b5699495f1a14bbc34ce23d34fe03872ce0
|
[
"MIT"
] | 1
|
2020-01-01T13:21:38.000Z
|
2020-01-01T13:21:38.000Z
|
qwilt/qsig/__init__.py
|
Qwilt/Qsig-Token-Python
|
4d663b5699495f1a14bbc34ce23d34fe03872ce0
|
[
"MIT"
] | 1
|
2020-07-20T12:07:16.000Z
|
2020-07-22T05:29:20.000Z
|
qwilt/qsig/__init__.py
|
Qwilt/Qsig-Token-Python
|
4d663b5699495f1a14bbc34ce23d34fe03872ce0
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
from .qsig import Qsig, QsigError
__all__ = ['Qsig', 'QsigError']
| 13.285714
| 33
| 0.612903
| 11
| 93
| 4.818182
| 0.727273
| 0.490566
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.013158
| 0.182796
| 93
| 7
| 34
| 13.285714
| 0.684211
| 0.225806
| 0
| 0
| 0
| 0
| 0.183099
| 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
|
7f5641b73662c58164efef95c9059d8694c78193
| 172
|
py
|
Python
|
pyxb/bundles/opengis/examples/demo.py
|
eLBati/pyxb
|
14737c23a125fd12c954823ad64fc4497816fae3
|
[
"Apache-2.0"
] | 123
|
2015-01-12T06:43:22.000Z
|
2022-03-20T18:06:46.000Z
|
pyxb/bundles/opengis/examples/demo.py
|
eLBati/pyxb
|
14737c23a125fd12c954823ad64fc4497816fae3
|
[
"Apache-2.0"
] | 103
|
2015-01-08T18:35:57.000Z
|
2022-01-18T01:44:14.000Z
|
pyxb/bundles/opengis/examples/demo.py
|
eLBati/pyxb
|
14737c23a125fd12c954823ad64fc4497816fae3
|
[
"Apache-2.0"
] | 54
|
2015-02-15T17:12:00.000Z
|
2022-03-07T23:02:32.000Z
|
from __future__ import print_function
import pyxb.bundles.opengis.gml as gml
dv = gml.DegreesType(32, direction='N')
print(dv.toDOM(element_name='degrees').toxml("utf-8"))
| 34.4
| 54
| 0.77907
| 27
| 172
| 4.740741
| 0.814815
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.018868
| 0.075581
| 172
| 4
| 55
| 43
| 0.786164
| 0
| 0
| 0
| 0
| 0
| 0.075581
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 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
| 0
| 0
| 0
| 1
| 0
| 0
| 1
|
0
| 4
|
7f5cfa459f86e843fd53afdee7b0bb51cecafad6
| 116
|
py
|
Python
|
test_apps/python_app/example/patterns/startup.py
|
Origen-SDK/o2
|
5b0f9a6d113ddebc73c7ee224931e8b2d0301794
|
[
"MIT"
] | null | null | null |
test_apps/python_app/example/patterns/startup.py
|
Origen-SDK/o2
|
5b0f9a6d113ddebc73c7ee224931e8b2d0301794
|
[
"MIT"
] | 127
|
2019-11-23T17:09:35.000Z
|
2021-09-02T11:06:20.000Z
|
test_apps/python_app/example/patterns/startup.py
|
Origen-SDK/o2
|
5b0f9a6d113ddebc73c7ee224931e8b2d0301794
|
[
"MIT"
] | null | null | null |
# Pattern that would startup the DUT, then do nothing else.
# Should still generate.
with Pattern() as pat:
...
| 23.2
| 59
| 0.698276
| 17
| 116
| 4.764706
| 0.941176
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.206897
| 116
| 4
| 60
| 29
| 0.880435
| 0.689655
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
7f60f7d7d78459ae55379f9f5ca9568b5f3d6755
| 175
|
py
|
Python
|
OCR/recon_img.py
|
lhfei/scrapy-in-action
|
1caac28812a6b11cf69e90f276fa7e9dc08a635e
|
[
"Apache-2.0"
] | null | null | null |
OCR/recon_img.py
|
lhfei/scrapy-in-action
|
1caac28812a6b11cf69e90f276fa7e9dc08a635e
|
[
"Apache-2.0"
] | null | null | null |
OCR/recon_img.py
|
lhfei/scrapy-in-action
|
1caac28812a6b11cf69e90f276fa7e9dc08a635e
|
[
"Apache-2.0"
] | null | null | null |
import easyocr
reader = easyocr.Reader(['ch_sim', 'en']) # need to run only once to load model into memory
result = reader.readtext('chinese.jpg', detail = 0, paragraph=True)
| 43.75
| 91
| 0.731429
| 27
| 175
| 4.703704
| 0.851852
| 0.204724
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.006623
| 0.137143
| 175
| 4
| 92
| 43.75
| 0.834437
| 0.268571
| 0
| 0
| 0
| 0
| 0.149606
| 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
|
7f6acd31318f5c4bfd333a4da43cc8cda74af81a
| 237
|
py
|
Python
|
Python/Exercícios_Python/001_=_deixando_tudo_pronto.py
|
vdonoladev/aprendendo-programacao
|
83abbcd6701b2105903b28fd549738863418cfb8
|
[
"MIT"
] | null | null | null |
Python/Exercícios_Python/001_=_deixando_tudo_pronto.py
|
vdonoladev/aprendendo-programacao
|
83abbcd6701b2105903b28fd549738863418cfb8
|
[
"MIT"
] | null | null | null |
Python/Exercícios_Python/001_=_deixando_tudo_pronto.py
|
vdonoladev/aprendendo-programacao
|
83abbcd6701b2105903b28fd549738863418cfb8
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
"""001 = Deixando tudo pronto
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1GhfZy4Dql6Q-h1khGuR5Uji39RilKx9T
"""
msg = "Olá, Mundo"
print(msg)
| 21.545455
| 77
| 0.729958
| 29
| 237
| 5.965517
| 0.965517
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.058537
| 0.135021
| 237
| 11
| 78
| 21.545455
| 0.785366
| 0.835443
| 0
| 0
| 1
| 0
| 0.30303
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.5
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
7f7fb053278e91b8b33976c424fcb55d5353b91b
| 31
|
py
|
Python
|
python/testData/selectWord/literal/before.py
|
jnthn/intellij-community
|
8fa7c8a3ace62400c838e0d5926a7be106aa8557
|
[
"Apache-2.0"
] | 2
|
2019-04-28T07:48:50.000Z
|
2020-12-11T14:18:08.000Z
|
python/testData/selectWord/literal/before.py
|
Cyril-lamirand/intellij-community
|
60ab6c61b82fc761dd68363eca7d9d69663cfa39
|
[
"Apache-2.0"
] | 173
|
2018-07-05T13:59:39.000Z
|
2018-08-09T01:12:03.000Z
|
python/testData/selectWord/literal/before.py
|
Cyril-lamirand/intellij-community
|
60ab6c61b82fc761dd68363eca7d9d69663cfa39
|
[
"Apache-2.0"
] | 2
|
2020-03-15T08:57:37.000Z
|
2020-04-07T04:48:14.000Z
|
x = r"hello world <caret>again"
| 31
| 31
| 0.709677
| 6
| 31
| 3.666667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.129032
| 31
| 1
| 31
| 31
| 0.814815
| 0
| 0
| 0
| 0
| 0
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
7f8b75d67008da8c5ac68069f5e9cdae55fbabf3
| 155
|
py
|
Python
|
src/instructions.py
|
Cyclip/parser-py
|
ee599b219f74927b06088a830b4f4d4aca18e5c3
|
[
"MIT"
] | null | null | null |
src/instructions.py
|
Cyclip/parser-py
|
ee599b219f74927b06088a830b4f4d4aca18e5c3
|
[
"MIT"
] | null | null | null |
src/instructions.py
|
Cyclip/parser-py
|
ee599b219f74927b06088a830b4f4d4aca18e5c3
|
[
"MIT"
] | null | null | null |
INSTRUCTIONS = {
"SUM": 0b00001,
"SUB": 0b00010,
"MULT": 0b00011,
"DIV": 0b00101,
}
def instrFor(instr):
return INSTRUCTIONS[instr]
| 17.222222
| 30
| 0.593548
| 15
| 155
| 6.133333
| 0.866667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.206897
| 0.251613
| 155
| 9
| 30
| 17.222222
| 0.586207
| 0
| 0
| 0
| 0
| 0
| 0.083333
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.125
| false
| 0
| 0
| 0.125
| 0.25
| 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
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 4
|
7f90cf053a201357d9c50de613ac5215942759fe
| 275
|
py
|
Python
|
webhooks.py
|
JacobMannix/StaffordResults
|
7c602159c66a2d092febcfdb3fc99ea5013ca9df
|
[
"MIT"
] | null | null | null |
webhooks.py
|
JacobMannix/StaffordResults
|
7c602159c66a2d092febcfdb3fc99ea5013ca9df
|
[
"MIT"
] | null | null | null |
webhooks.py
|
JacobMannix/StaffordResults
|
7c602159c66a2d092febcfdb3fc99ea5013ca9df
|
[
"MIT"
] | null | null | null |
#!/home/mannix/anaconda3/bin/python
# # Jacob Mannix [08-31-2020]
# Webhook Function
# Import Dependencies
import requests
# Function
def webhookMessage(webhook_url, message_content):
Message = {"content": message_content}
requests.post(webhook_url, data=Message)
| 21.153846
| 49
| 0.756364
| 33
| 275
| 6.181818
| 0.636364
| 0.205882
| 0.205882
| 0.27451
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.037657
| 0.130909
| 275
| 12
| 50
| 22.916667
| 0.8159
| 0.389091
| 0
| 0
| 0
| 0
| 0.04321
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0
| 0.5
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
7fb7ab918e2a989c2f4797719d76ff8008b200ec
| 61
|
py
|
Python
|
app/mongo/data/collect/models/model.py
|
jgphilpott/polyMaker
|
33ab5ecdba277d1765ffdaebb77f0bab2480dc46
|
[
"MIT"
] | null | null | null |
app/mongo/data/collect/models/model.py
|
jgphilpott/polyMaker
|
33ab5ecdba277d1765ffdaebb77f0bab2480dc46
|
[
"MIT"
] | null | null | null |
app/mongo/data/collect/models/model.py
|
jgphilpott/polyMaker
|
33ab5ecdba277d1765ffdaebb77f0bab2480dc46
|
[
"MIT"
] | null | null | null |
class Model():
def __init__(self, model):
pass
| 10.166667
| 30
| 0.557377
| 7
| 61
| 4.285714
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.327869
| 61
| 5
| 31
| 12.2
| 0.731707
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0.333333
| 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
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
7fbab6aab3392719deaa563dcfed117040616f60
| 84
|
py
|
Python
|
python__fundamentals/data_types_and_variables_lab/05.pounds_to_dollars.py
|
EmilianStoyanov/Projects-in-SoftUni
|
e83996670fe00424a158905d537a7bbbeee8fb59
|
[
"MIT"
] | 1
|
2020-07-14T12:32:47.000Z
|
2020-07-14T12:32:47.000Z
|
python__fundamentals/data_types_and_variables_lab/05.pounds_to_dollars.py
|
EmilianStoyanov/Projects-in-SoftUni
|
e83996670fe00424a158905d537a7bbbeee8fb59
|
[
"MIT"
] | null | null | null |
python__fundamentals/data_types_and_variables_lab/05.pounds_to_dollars.py
|
EmilianStoyanov/Projects-in-SoftUni
|
e83996670fe00424a158905d537a7bbbeee8fb59
|
[
"MIT"
] | null | null | null |
pound = int(input())
conv_to_dollar = pound * 1.31
print(f"{conv_to_dollar:.3f}")
| 14
| 30
| 0.678571
| 15
| 84
| 3.533333
| 0.733333
| 0.226415
| 0.45283
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.054795
| 0.130952
| 84
| 5
| 31
| 16.8
| 0.671233
| 0
| 0
| 0
| 0
| 0
| 0.238095
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.333333
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
f6b17e40a64f6e955938ba58e578aaa4881568dd
| 101
|
py
|
Python
|
testingCentre/apps.py
|
p2titus/ContactTracing
|
83b11a2908223aab51983ed8128fe11850208b5a
|
[
"MIT"
] | null | null | null |
testingCentre/apps.py
|
p2titus/ContactTracing
|
83b11a2908223aab51983ed8128fe11850208b5a
|
[
"MIT"
] | null | null | null |
testingCentre/apps.py
|
p2titus/ContactTracing
|
83b11a2908223aab51983ed8128fe11850208b5a
|
[
"MIT"
] | null | null | null |
from django.apps import AppConfig
class TestingCentreConfig(AppConfig):
name = 'testingCentre'
| 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
|
f6fecefcdebd1a8c482f564cb98d549c7873e4b5
| 27
|
py
|
Python
|
优化算法/test.py
|
shao1chuan/pythonbook
|
cd9877d04e1e11422d38cc051e368d3d9ce2ab45
|
[
"MulanPSL-1.0"
] | 95
|
2020-10-11T04:45:46.000Z
|
2022-02-25T01:50:40.000Z
|
优化算法/test.py
|
shao1chuan/pythonbook
|
cd9877d04e1e11422d38cc051e368d3d9ce2ab45
|
[
"MulanPSL-1.0"
] | null | null | null |
优化算法/test.py
|
shao1chuan/pythonbook
|
cd9877d04e1e11422d38cc051e368d3d9ce2ab45
|
[
"MulanPSL-1.0"
] | 30
|
2020-11-05T09:01:00.000Z
|
2022-03-08T05:58:55.000Z
|
lr = pow(2,-2)*16
print(lr)
| 13.5
| 17
| 0.592593
| 7
| 27
| 2.285714
| 0.714286
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.166667
| 0.111111
| 27
| 2
| 18
| 13.5
| 0.5
| 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
|
63ed6ff4fcea3f5da8339ceeaf8155ad8fa0e50c
| 77
|
py
|
Python
|
service/tests/__init__.py
|
tuub/jper
|
1a723a36617b2c27b0fc43dd4cb9a0f5fe811f37
|
[
"Apache-2.0"
] | 2
|
2015-05-21T10:38:46.000Z
|
2015-06-10T15:49:50.000Z
|
service/tests/__init__.py
|
tuub/jper
|
1a723a36617b2c27b0fc43dd4cb9a0f5fe811f37
|
[
"Apache-2.0"
] | 83
|
2015-05-05T11:10:13.000Z
|
2016-02-22T11:04:34.000Z
|
service/tests/__init__.py
|
tuub/jper
|
1a723a36617b2c27b0fc43dd4cb9a0f5fe811f37
|
[
"Apache-2.0"
] | 3
|
2015-11-11T16:37:33.000Z
|
2016-07-26T10:33:52.000Z
|
"""
This module contains all of the system tests and associated fixtures
"""
| 19.25
| 68
| 0.753247
| 11
| 77
| 5.272727
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.168831
| 77
| 3
| 69
| 25.666667
| 0.90625
| 0.883117
| 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
|
120058f91b9748a1cf2e83a8fca59365bc30aa14
| 98
|
py
|
Python
|
ECE650-system-programming/HW4_db/hw4_django_orm/app_homepage/apps.py
|
yo1995/cht_Duke_courses
|
d889e85e677f419c67c12e78143f3e8143457944
|
[
"MIT"
] | 8
|
2019-03-28T18:37:32.000Z
|
2022-03-29T22:15:05.000Z
|
ECE650-system-programming/HW4_db/hw4_django_orm/app_homepage/apps.py
|
yo1995/cht_Duke_courses
|
d889e85e677f419c67c12e78143f3e8143457944
|
[
"MIT"
] | null | null | null |
ECE650-system-programming/HW4_db/hw4_django_orm/app_homepage/apps.py
|
yo1995/cht_Duke_courses
|
d889e85e677f419c67c12e78143f3e8143457944
|
[
"MIT"
] | 13
|
2018-09-12T19:56:46.000Z
|
2020-11-24T22:48:46.000Z
|
from django.apps import AppConfig
class AppHomepageConfig(AppConfig):
name = 'app_homepage'
| 16.333333
| 35
| 0.77551
| 11
| 98
| 6.818182
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.153061
| 98
| 5
| 36
| 19.6
| 0.903614
| 0
| 0
| 0
| 0
| 0
| 0.122449
| 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
|
125806430cd62a1ccc8f7242bb2b421042186459
| 113
|
py
|
Python
|
elif_bayindir/phase_1/python_basic_1/day_8/q3.py
|
CodedLadiesInnovateTech/-python-challenge-solutions
|
430cd3eb84a2905a286819eef384ee484d8eb9e7
|
[
"MIT"
] | 6
|
2020-05-23T19:53:25.000Z
|
2021-05-08T20:21:30.000Z
|
elif_bayindir/phase_1/python_basic_1/day_8/q3.py
|
CodedLadiesInnovateTech/-python-challenge-solutions
|
430cd3eb84a2905a286819eef384ee484d8eb9e7
|
[
"MIT"
] | 8
|
2020-05-14T18:53:12.000Z
|
2020-07-03T00:06:20.000Z
|
elif_bayindir/phase_1/python_basic_1/day_8/q3.py
|
CodedLadiesInnovateTech/-python-challenge-solutions
|
430cd3eb84a2905a286819eef384ee484d8eb9e7
|
[
"MIT"
] | 39
|
2020-05-10T20:55:02.000Z
|
2020-09-12T17:40:59.000Z
|
# Question 3
# Absolute file path.
import os
os.chdir("/home/elif/Desktop")
print(os.path.abspath("elma.py"))
| 12.555556
| 33
| 0.699115
| 18
| 113
| 4.388889
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.010101
| 0.123894
| 113
| 8
| 34
| 14.125
| 0.787879
| 0.265487
| 0
| 0
| 0
| 0
| 0.320513
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0.333333
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
1272e0a752546f6cd1485becee5ff74978eac68b
| 94
|
py
|
Python
|
survey/forms.py
|
Udantu/portfolio-v1
|
1fc1b88c1a76db24647555535baaceb16b563b6b
|
[
"MIT"
] | null | null | null |
survey/forms.py
|
Udantu/portfolio-v1
|
1fc1b88c1a76db24647555535baaceb16b563b6b
|
[
"MIT"
] | null | null | null |
survey/forms.py
|
Udantu/portfolio-v1
|
1fc1b88c1a76db24647555535baaceb16b563b6b
|
[
"MIT"
] | null | null | null |
from django import forms
class AnswerQuestion(forms.Form):
answer = forms.IntegerField()
| 18.8
| 33
| 0.765957
| 11
| 94
| 6.545455
| 0.818182
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.148936
| 94
| 4
| 34
| 23.5
| 0.9
| 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
|
89c5fcfe49fcef1f40e0f037f7061b258d62efa9
| 86
|
py
|
Python
|
securityheaders/checkers/xpoweredby/__init__.py
|
th3cyb3rc0p/securityheaders
|
941264be581dc01afe28f6416f2d7bed79aecfb3
|
[
"Apache-2.0"
] | 151
|
2018-07-29T22:34:43.000Z
|
2022-03-22T05:08:27.000Z
|
securityheaders/checkers/xpoweredby/__init__.py
|
th3cyb3rc0p/securityheaders
|
941264be581dc01afe28f6416f2d7bed79aecfb3
|
[
"Apache-2.0"
] | 5
|
2019-04-24T07:31:36.000Z
|
2021-04-15T14:31:23.000Z
|
securityheaders/checkers/xpoweredby/__init__.py
|
th3cyb3rc0p/securityheaders
|
941264be581dc01afe28f6416f2d7bed79aecfb3
|
[
"Apache-2.0"
] | 42
|
2018-07-31T08:18:59.000Z
|
2022-03-28T08:18:32.000Z
|
from .present import XPoweredByPresentChecker
__all__ = ['XPoweredByPresentChecker']
| 21.5
| 45
| 0.837209
| 6
| 86
| 11.333333
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.093023
| 86
| 3
| 46
| 28.666667
| 0.871795
| 0
| 0
| 0
| 0
| 0
| 0.27907
| 0.27907
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
89d6e16f2cd459efd5a3d83024f44a6ac6dd2cac
| 141
|
py
|
Python
|
CodeCrakers/drones.py
|
suhasksv/py-ground
|
8c04a845c6b5c4efcb335c8ad59416874e8226d1
|
[
"Apache-2.0"
] | 3
|
2020-06-01T09:40:41.000Z
|
2020-08-26T12:09:27.000Z
|
CodeCrakers/drones.py
|
suhasksv/py-ground
|
8c04a845c6b5c4efcb335c8ad59416874e8226d1
|
[
"Apache-2.0"
] | null | null | null |
CodeCrakers/drones.py
|
suhasksv/py-ground
|
8c04a845c6b5c4efcb335c8ad59416874e8226d1
|
[
"Apache-2.0"
] | 4
|
2020-07-20T10:38:23.000Z
|
2020-10-16T08:41:05.000Z
|
x = 0
drone_chk = [112, 334, 4444, 4444, 445, 112, 27466, 445, 27466]
for i in drone_chk:
x ^= i
print("The missing drone order ID is:", x)
| 23.5
| 63
| 0.64539
| 28
| 141
| 3.178571
| 0.642857
| 0.179775
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.303571
| 0.205674
| 141
| 5
| 64
| 28.2
| 0.491071
| 0
| 0
| 0
| 0
| 0
| 0.212766
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.2
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 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
|
89e3423d74f11adefe2e54c4bb5c464e6029b7f8
| 266
|
py
|
Python
|
tests/__init__.py
|
theincognito-inc/manga-dl
|
899905bafb6c6891815b58cce41eaff32a682570
|
[
"MIT"
] | 1
|
2020-11-19T00:40:49.000Z
|
2020-11-19T00:40:49.000Z
|
tests/__init__.py
|
eduhoribe/manga-py
|
fe7eb2e08532b3c75b4f7ac8cc4132f0e7a65eb4
|
[
"MIT"
] | null | null | null |
tests/__init__.py
|
eduhoribe/manga-py
|
fe7eb2e08532b3c75b4f7ac8cc4132f0e7a65eb4
|
[
"MIT"
] | null | null | null |
from .archive import TestArchive
from .base import TestBaseClass
from .http import TestHttpClasses
from .init_provider import TestInitProvider
from .matrix import TestMatrix
from .web_driver import TestWebDriver
from .crypt import TestCrypt
from .std import TestStd
| 29.555556
| 43
| 0.849624
| 34
| 266
| 6.588235
| 0.588235
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.120301
| 266
| 8
| 44
| 33.25
| 0.957265
| 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
|
89fa3232bd4ecc9b48132b04b83a2a92a2c5aa8d
| 125
|
py
|
Python
|
__init__.py
|
austinmilt/video-game-view
|
df6a75236966e5e2bbaf2d2695569902cefee92b
|
[
"Apache-2.0"
] | 3
|
2018-03-02T00:30:22.000Z
|
2018-12-25T16:19:57.000Z
|
__init__.py
|
austinmilt/video-game-view
|
df6a75236966e5e2bbaf2d2695569902cefee92b
|
[
"Apache-2.0"
] | null | null | null |
__init__.py
|
austinmilt/video-game-view
|
df6a75236966e5e2bbaf2d2695569902cefee92b
|
[
"Apache-2.0"
] | null | null | null |
"""
Video Game HUD for Youtube videos.
.. moduleauthor:: Austin Milt <austin.w.milt@gmail.com>
"""
from detection import *
| 15.625
| 55
| 0.704
| 17
| 125
| 5.176471
| 0.882353
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.152
| 125
| 7
| 56
| 17.857143
| 0.830189
| 0.728
| 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
|
d602ce92d721c8eef548674aba6ba30568f2d158
| 230
|
py
|
Python
|
activflow/quotient/forms.py
|
mcgauranc/mosaiq
|
33c4b7db8f3dd1ef18dc0b63d06fb05ee8df4de0
|
[
"Apache-2.0"
] | null | null | null |
activflow/quotient/forms.py
|
mcgauranc/mosaiq
|
33c4b7db8f3dd1ef18dc0b63d06fb05ee8df4de0
|
[
"Apache-2.0"
] | null | null | null |
activflow/quotient/forms.py
|
mcgauranc/mosaiq
|
33c4b7db8f3dd1ef18dc0b63d06fb05ee8df4de0
|
[
"Apache-2.0"
] | null | null | null |
"""Custom Forms"""
from django import forms
from django.db.models import (
CharField)
class CustomForm(forms.ModelForm):
"""Sample Custom form"""
sample_id = CharField("Sample Id:", max_length=200, editable=False)
| 19.166667
| 71
| 0.704348
| 29
| 230
| 5.517241
| 0.655172
| 0.1125
| 0.1875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.015625
| 0.165217
| 230
| 11
| 72
| 20.909091
| 0.817708
| 0.134783
| 0
| 0
| 0
| 0
| 0.053476
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.4
| 0
| 0.8
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
d6205eaf947f81705719709972eb30183e24b0e7
| 2,139
|
py
|
Python
|
feature_eng.py
|
vikrantpailkar/Loan_Default_Prediction
|
81805790a22c0378f81aa77d9806996bca9c4c9a
|
[
"MIT"
] | 2
|
2019-02-02T14:33:40.000Z
|
2019-02-03T07:31:42.000Z
|
feature_eng.py
|
vikrantpailkar/Loan_Default_Prediction
|
81805790a22c0378f81aa77d9806996bca9c4c9a
|
[
"MIT"
] | null | null | null |
feature_eng.py
|
vikrantpailkar/Loan_Default_Prediction
|
81805790a22c0378f81aa77d9806996bca9c4c9a
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
"""
Created on 02/02/2019
Author: Vikrant
"""
from trim_data import ext_num_from_sub_grade
from trim_data import drop_emp_title
from trim_data import fill_na_annual_inc
from trim_data import drop_zip_code
from trim_data import fill_na_delinq_2yrs
from trim_data import drop_earliest_cr_line
from trim_data import fill_na_inq_last_6mths
from trim_data import fill_na_open_acc
from trim_data import fill_na_pub_rec
from trim_data import fill_na_revol_util
from trim_data import fill_na_total_acc
from trim_data import drop_out_prncp
from trim_data import drop_out_prncp_inv
from trim_data import drop_total_rec_late_fee
from trim_data import drop_recoveries
from trim_data import drop_collection_recovery_fee
from trim_data import drop_last_pymnt_d
from trim_data import drop_collections_12_mths_ex_med
from trim_data import drop_policy_code
from trim_data import drop_application_type
from trim_data import drop_acc_now_delinq
from trim_data import drop_tot_coll_amt
from trim_data import drop_tot_cur_bal
from trim_data import fill_na_total_rev_hi_lim
from trim_data import drop_url
from trim_data import drop_pymnt_plan
from trim_data import drop_issue_d
from trim_data import drop_addr_state
from trim_data import drop_last_credit_pull_d
def trim_features(loan):
ext_num_from_sub_grade(loan)
drop_emp_title(loan)
fill_na_annual_inc(loan)
drop_zip_code(loan)
fill_na_delinq_2yrs(loan)
drop_earliest_cr_line(loan)
fill_na_inq_last_6mths(loan)
fill_na_open_acc(loan)
fill_na_pub_rec(loan)
fill_na_revol_util(loan)
fill_na_total_acc(loan)
drop_pymnt_plan(loan)
drop_url(loan)
drop_total_rec_late_fee(loan)
drop_out_prncp(loan)
drop_out_prncp_inv(loan)
drop_recoveries(loan)
drop_collection_recovery_fee(loan)
drop_last_pymnt_d(loan)
drop_collections_12_mths_ex_med(loan)
drop_policy_code(loan)
drop_application_type(loan)
drop_acc_now_delinq(loan)
drop_tot_coll_amt(loan)
drop_tot_cur_bal(loan)
fill_na_total_rev_hi_lim(loan)
drop_issue_d(loan)
drop_addr_state(loan)
drop_last_credit_pull_d(loan)
| 31
| 53
| 0.832632
| 383
| 2,139
| 4.138381
| 0.203655
| 0.146372
| 0.219558
| 0.329338
| 0.5653
| 0.323659
| 0.074448
| 0
| 0
| 0
| 0
| 0.00914
| 0.130435
| 2,139
| 68
| 54
| 31.455882
| 0.843011
| 0.02805
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.016949
| false
| 0
| 0.491525
| 0
| 0.508475
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
d64be7cf7a35f0d88422253ab5bfe37965151b5c
| 401
|
py
|
Python
|
test/samplesheet/test_initialize.py
|
iosonofabio/singlet
|
66d3b13581f571450c9551e99d86845cce992d32
|
[
"MIT"
] | 11
|
2017-09-12T02:45:33.000Z
|
2021-05-18T13:04:12.000Z
|
test/samplesheet/test_initialize.py
|
Takshan/singlet
|
66d3b13581f571450c9551e99d86845cce992d32
|
[
"MIT"
] | 6
|
2017-10-03T22:14:42.000Z
|
2019-02-02T05:12:20.000Z
|
test/samplesheet/test_initialize.py
|
Takshan/singlet
|
66d3b13581f571450c9551e99d86845cce992d32
|
[
"MIT"
] | 4
|
2018-02-15T12:00:04.000Z
|
2021-03-25T12:26:04.000Z
|
#!/usr/bin/env python
# vim: fdm=indent
'''
author: Fabio Zanini
date: 15/08/17
content: Test SampleSheet class.
'''
def test_initialize():
from singlet.samplesheet import SampleSheet
ss = SampleSheet.from_sheetname('example_sheet_tsv')
def test_initialize_fromdataset():
from singlet.samplesheet import SampleSheet
ct = SampleSheet.from_datasetname('example_dataset')
| 23.588235
| 56
| 0.735661
| 48
| 401
| 5.979167
| 0.666667
| 0.04878
| 0.118467
| 0.195122
| 0.271777
| 0
| 0
| 0
| 0
| 0
| 0
| 0.01791
| 0.164589
| 401
| 16
| 57
| 25.0625
| 0.838806
| 0.294264
| 0
| 0.333333
| 0
| 0
| 0.117216
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.333333
| 0
| 0.666667
| 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
| 1
| 0
| 1
| 0
|
0
| 4
|
c3865f3311af05c5b3fbbfe2bb77b9cf670540d3
| 10,679
|
py
|
Python
|
back-end/www/tests/vision_tests.py
|
TUD-KInD/COCTEAU
|
8ea4f546397feaaf22b4e9958b509324b5b332aa
|
[
"MIT"
] | null | null | null |
back-end/www/tests/vision_tests.py
|
TUD-KInD/COCTEAU
|
8ea4f546397feaaf22b4e9958b509324b5b332aa
|
[
"MIT"
] | 1
|
2021-11-15T11:40:04.000Z
|
2021-11-15T11:40:04.000Z
|
back-end/www/tests/vision_tests.py
|
TUD-KInD/COCTEAU
|
8ea4f546397feaaf22b4e9958b509324b5b332aa
|
[
"MIT"
] | 2
|
2021-07-14T13:07:22.000Z
|
2022-01-25T23:58:06.000Z
|
from basic_tests import BasicTest
from models.model_operations import scenario_operations
from models.model_operations import topic_operations
from models.model_operations import user_operations
from models.model_operations import vision_operations
from models.model import db
import unittest
class VisionTest(BasicTest):
"""Test case for visions."""
def setUp(self):
db.create_all()
self.topic = topic_operations.create_topic("test", "test")
self.scenario_1 = scenario_operations.create_scenario(
"t1", "d1", "i1", self.topic.id)
self.scenario_2 = scenario_operations.create_scenario(
"t2", "d2", "i2", self.topic.id)
self.mood = vision_operations.create_mood("happy")
self.user_1 = user_operations.create_user("user1")
self.user_2 = user_operations.create_user("user2")
def test_get_all_moods(self):
moods = vision_operations.get_all_moods()
assert len(moods) == 1
assert moods[0].name == "happy"
def test_create_vision(self):
medias = [
{
"url": "http://url_to_image.com",
"description": "description",
"type": "VIDEO"
},
{
"url": "http://url_to_image.com",
"description": "description",
"type": "GIF"
},
{
"url": "http://url_to_image.com",
"description": "description",
"unsplash_image_id":"uid",
"unsplash_creator_name":"name",
"unsplash_creator_url":"url",
"type": "IMAGE"
},
{
"description": "description",
"type": "TEXT"
}
]
mood_id = self.mood.id
user_id = self.user_1.id
scenario_id = self.scenario_1.id
vision = vision_operations.create_vision(
mood_id=mood_id, medias=medias, user_id=user_id, scenario_id=scenario_id)
assert vision in db.session
for m in vision.medias:
assert m in db.session
def test_get_vision_by_id(self):
medias = [
{
"url": "http://url_to_image.com",
"description": "description",
"type": "VIDEO"
},
{
"url": "http://url_to_image.com",
"description": "description",
"type": "GIF"
},
{
"url": "http://url_to_image.com",
"description": "description",
"unsplash_image_id":"uid",
"unsplash_creator_name":"name",
"unsplash_creator_url":"url",
"type": "IMAGE"
},
{
"description": "description",
"type": "TEXT"
}
]
mood_id = self.mood.id
user_id = self.user_1.id
scenario_id = self.scenario_1.id
vision = vision_operations.create_vision(
mood_id=mood_id, medias=medias, user_id=user_id, scenario_id=scenario_id)
retrieved_vision = vision_operations.get_vision_by_id(vision.id)
assert retrieved_vision.mood_id == mood_id and retrieved_vision.user_id == user_id and retrieved_vision.scenario_id == scenario_id
assert vision.medias == retrieved_vision.medias
def test_get_vision_by_user_id(self):
medias = [
{
"url": "http://url_to_image.com",
"description": "description",
"type": "VIDEO"
},
{
"url": "http://url_to_image.com",
"description": "description",
"type": "GIF"
},
{
"url": "http://url_to_image.com",
"description": "description",
"unsplash_image_id":"uid",
"unsplash_creator_name":"name",
"unsplash_creator_url":"url",
"type": "IMAGE"
},
{
"description": "description",
"type": "TEXT"
}
]
mood_id = self.mood.id
user_id = self.user_1.id
scenario_id = self.scenario_1.id
vision_1 = vision_operations.create_vision(
mood_id=mood_id, medias=medias, user_id=user_id, scenario_id=scenario_id)
vision_2 = vision_operations.create_vision(
mood_id=mood_id, medias=medias[:-1], user_id=user_id, scenario_id=scenario_id)
user_id_2 = self.user_2.id
vision_3 = vision_operations.create_vision(
mood_id=mood_id, medias=medias, user_id=user_id_2, scenario_id=scenario_id)
retrieved_visions = vision_operations.get_visions_by_user(user_id, paginate=False, order=None)
assert len(retrieved_visions) == 2
c1 = retrieved_visions[0].medias == vision_1.medias
c2 = retrieved_visions[0].mood_id == vision_1.mood_id
c3 = retrieved_visions[0].scenario_id == vision_1.scenario_id
assert c1 and c2 and c3
c4 = retrieved_visions[1].medias == vision_2.medias
c5 = retrieved_visions[1].mood_id == vision_2.mood_id
c6 = retrieved_visions[1].scenario_id == vision_2.scenario_id
assert c4 and c5 and c6
def test_get_visions_by_scenario(self):
medias = [
{
"url": "http://url_to_image.com",
"description": "description",
"type": "VIDEO"
},
{
"url": "http://url_to_image.com",
"description": "description",
"type": "GIF"
},
{
"url": "http://url_to_image.com",
"description": "description",
"unsplash_image_id":"uid",
"unsplash_creator_name":"name",
"unsplash_creator_url":"url",
"type": "IMAGE"
},
{
"description": "description",
"type": "TEXT"
}
]
mood_id = self.mood.id
user_id = self.user_1.id
scenario_id = self.scenario_1.id
vision_1 = vision_operations.create_vision(
mood_id=mood_id, medias=medias, user_id=user_id, scenario_id=scenario_id)
vision_2 = vision_operations.create_vision(
mood_id=mood_id, medias=medias[:-1], user_id=user_id, scenario_id=scenario_id)
scenario_id_2 = self.scenario_2.id
vision_3 = vision_operations.create_vision(
mood_id=mood_id, medias=medias, user_id=user_id, scenario_id=scenario_id_2)
retrieved_visions = vision_operations.get_visions_by_scenario(user_id, paginate=False, order=None)
assert len(retrieved_visions) == 2
c1 = retrieved_visions[0].medias == vision_1.medias
c2 = retrieved_visions[0].mood_id == vision_1.mood_id
c3 = retrieved_visions[0].scenario_id == vision_1.scenario_id
assert c1 and c2 and c3
c4 = retrieved_visions[1].medias == vision_2.medias
c5 = retrieved_visions[1].mood_id == vision_2.mood_id
c6 = retrieved_visions[1].scenario_id == vision_2.scenario_id
assert c4 and c5 and c6
def test_update_vision(self):
medias = [
{
"url": "http://url_to_image.com",
"description": "description",
"type": "VIDEO"
},
{
"url": "http://url_to_image.com",
"description": "description",
"type": "GIF"
},
{
"url": "http://url_to_image.com",
"description": "description",
"unsplash_image_id":"uid",
"unsplash_creator_name":"name",
"unsplash_creator_url":"url",
"type": "IMAGE"
},
{
"description": "description",
"type": "TEXT"
}
]
mood_id = self.mood.id
user_id = self.user_1.id
scenario_id = self.scenario_1.id
vision = vision_operations.create_vision(
mood_id=mood_id, medias=medias, user_id=user_id, scenario_id=scenario_id)
new_mood = vision_operations.create_mood("sad")
vision_operations.update_vision(vision.id, mood_id=new_mood.id)
retrieved_vision = vision_operations.get_vision_by_id(vision.id)
assert retrieved_vision.mood_id == new_mood.id
old_medias = vision.medias
new_medias = [
{
"url": "http://url_to_image.com_q",
"description": "description_q",
"unsplash_image_id":"uid_q",
"unsplash_creator_name":"name_q",
"unsplash_creator_url":"url_q",
"type": "IMAGE"
}
]
vision_operations.update_vision(vision.id, medias=new_medias)
retrieved_vision = vision_operations.get_vision_by_id(vision.id)
assert len(retrieved_vision.medias) == 1 and retrieved_vision.medias[0].url == new_medias[0]["url"]
assert retrieved_vision.medias[0].description == new_medias[0]["description"]
assert retrieved_vision.medias[0].media_type.name == new_medias[0]["type"]
for m in old_medias:
assert m not in db.session
def test_remove_vision(self):
medias = [
{
"url": "http://url_to_image.com",
"description": "description",
"type": "VIDEO"
},
{
"url": "http://url_to_image.com",
"description": "description",
"type": "GIF"
},
{
"url": "http://url_to_image.com",
"description": "description",
"unsplash_image_id":"uid",
"unsplash_creator_name":"name",
"unsplash_creator_url":"url",
"type": "IMAGE"
},
{
"description": "description",
"type": "TEXT"
}
]
mood_id = self.mood.id
user_id = self.user_1.id
scenario_id = self.scenario_1.id
vision = vision_operations.create_vision(
mood_id=mood_id, medias=medias, user_id=user_id, scenario_id=scenario_id)
assert vision in db.session
vision_operations.remove_vision(vision.id)
assert vision not in db.session
if __name__ == "__main__":
unittest.main()
| 33.371875
| 138
| 0.541811
| 1,151
| 10,679
| 4.702867
| 0.073849
| 0.050988
| 0.059856
| 0.042121
| 0.801958
| 0.753926
| 0.709773
| 0.688712
| 0.688712
| 0.688712
| 0
| 0.013883
| 0.345725
| 10,679
| 319
| 139
| 33.476489
| 0.760842
| 0.00206
| 0
| 0.566038
| 0
| 0
| 0.169562
| 0.013802
| 0
| 0
| 0
| 0
| 0.071698
| 1
| 0.030189
| false
| 0
| 0.026415
| 0
| 0.060377
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
c3c5c8ebc42745fc2692097c4c28ac0825ea0fc0
| 109
|
py
|
Python
|
receives/helper.py
|
felixsch/receives
|
0d149e3a24c0377ac60d502736299c9f4348244a
|
[
"MIT"
] | null | null | null |
receives/helper.py
|
felixsch/receives
|
0d149e3a24c0377ac60d502736299c9f4348244a
|
[
"MIT"
] | null | null | null |
receives/helper.py
|
felixsch/receives
|
0d149e3a24c0377ac60d502736299c9f4348244a
|
[
"MIT"
] | null | null | null |
import inspect
def current_module():
frame = inspect.stack()[1]
return inspect.getmodule(frame[0])
| 15.571429
| 38
| 0.697248
| 14
| 109
| 5.357143
| 0.785714
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.022222
| 0.174312
| 109
| 6
| 39
| 18.166667
| 0.811111
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
c3ec5559edc67a20ccce3c5d4701b073dd1c987c
| 1,274
|
py
|
Python
|
setup.py
|
iNouvellie/social-network-rusa
|
675ac2678f2d09363b3d67e42de93cb5877fa84b
|
[
"Apache-2.0"
] | null | null | null |
setup.py
|
iNouvellie/social-network-rusa
|
675ac2678f2d09363b3d67e42de93cb5877fa84b
|
[
"Apache-2.0"
] | null | null | null |
setup.py
|
iNouvellie/social-network-rusa
|
675ac2678f2d09363b3d67e42de93cb5877fa84b
|
[
"Apache-2.0"
] | null | null | null |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from distutils.core import setup
"""
@author: Kirill Python
@contact: https://vk.com/python273
@license Apache License, Version 2.0, see LICENSE file
Copyright (C) 2017
"""
setup(
name='vk_api',
version='8.3.1',
author='python273',
author_email='whoami@python273.pw',
url='https://github.com/python273/vk_api',
description='Module for writing scripts for vk.com (vkontakte)',
download_url='https://github.com/python273/vk_api/archive/master.zip',
license='Apache License, Version 2.0, see LICENSE file',
packages=['vk_api', 'jconfig'],
install_requires=['requests', 'enum34'],
classifiers=[
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: Implementation :: PyPy',
'Programming Language :: Python :: Implementation :: CPython',
]
)
| 31.073171
| 74
| 0.635008
| 143
| 1,274
| 5.608392
| 0.496504
| 0.213217
| 0.280549
| 0.129676
| 0.184539
| 0.184539
| 0.184539
| 0.107232
| 0.107232
| 0
| 0
| 0.038767
| 0.210361
| 1,274
| 40
| 75
| 31.85
| 0.758449
| 0.032967
| 0
| 0
| 0
| 0
| 0.638532
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.038462
| 0
| 0.038462
| 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
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
7f0246bbd95fe9f96b480d36cc352d62346a06ac
| 228
|
py
|
Python
|
photos/admin.py
|
martinmandina/Photo-Gallery
|
a9c113a08d71f18b415e083cdeb8dc3f3fa60e80
|
[
"MIT"
] | null | null | null |
photos/admin.py
|
martinmandina/Photo-Gallery
|
a9c113a08d71f18b415e083cdeb8dc3f3fa60e80
|
[
"MIT"
] | null | null | null |
photos/admin.py
|
martinmandina/Photo-Gallery
|
a9c113a08d71f18b415e083cdeb8dc3f3fa60e80
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from .models import Category,Location,Image,Photo
# Register your models here.
admin.site.register(Location)
admin.site.register(Category)
admin.site.register(Image)
admin.site.register(Photo)
| 22.8
| 49
| 0.815789
| 32
| 228
| 5.8125
| 0.4375
| 0.193548
| 0.365591
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.083333
| 228
| 9
| 50
| 25.333333
| 0.889952
| 0.114035
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
61681e4a9794f591da675dc07a24666de01182f4
| 6,609
|
py
|
Python
|
src/tree.py
|
kinow/rosalind-exercises
|
5984f10226e41a3fffbc7f947e397b0cd84ea5cf
|
[
"Unlicense"
] | null | null | null |
src/tree.py
|
kinow/rosalind-exercises
|
5984f10226e41a3fffbc7f947e397b0cd84ea5cf
|
[
"Unlicense"
] | null | null | null |
src/tree.py
|
kinow/rosalind-exercises
|
5984f10226e41a3fffbc7f947e397b0cd84ea5cf
|
[
"Unlicense"
] | null | null | null |
import networkx as nx
if __name__ == '__main__':
n = 872
data = '''
633 397
336 423
583 800
457 20
707 797
61 1
494 672
382 140
282 62
782 188
463 478
571 456
531 8
119 294
863 190
49 205
224 70
88 118
80 139
854 273
66 74
234 155
789 120
225 353
446 767
346 163
796 779
66 450
130 38
228 793
262 263
41 204
21 421
630 120
210 424
15 10
698 778
404 663
489 287
331 214
517 655
355 176
391 416
19 44
518 598
194 161
45 49
683 156
177 274
9 23
311 837
25 605
206 265
21 28
468 690
485 694
211 338
211 749
227 405
485 29
376 271
624 661
49 825
81 19
486 624
90 57
261 597
440 170
470 564
317 482
798 467
766 563
341 499
179 226
110 238
52 467
343 258
237 5
81 524
777 398
669 727
680 36
99 701
713 227
115 146
414 824
20 71
835 634
122 707
67 192
15 66
95 36
548 247
277 520
146 173
94 8
28 334
389 190
525 154
587 650
666 384
208 813
799 119
119 159
221 352
73 399
25 344
870 409
692 438
557 178
303 715
347 40
696 434
267 615
229 668
593 732
413 386
560 496
11 4
16 10
201 461
45 39
42 40
644 238
30 4
483 119
107 82
675 738
667 450
103 846
596 56
365 433
40 8
46 101
552 97
519 103
123 206
731 454
82 39
97 253
250 118
578 226
46 5
278 601
335 24
314 193
82 822
632 490
383 806
359 488
490 297
735 564
783 322
491 266
370 628
581 708
388 207
620 481
174 58
261 130
377 69
116 113
171 293
530 329
787 661
607 225
125 73
12 34
50 432
141 102
526 449
475 187
46 182
31 11
5 43
76 34
420 447
706 106
486 86
361 395
244 273
87 312
9 6
434 56
149 428
32 216
500 300
28 36
231 256
11 436
85 402
355 741
563 170
161 127
484 554
32 1
61 196
498 551
587 189
847 817
160 665
179 547
110 248
518 788
826 201
84 19
646 103
152 838
368 87
48 35
745 189
315 700
412 763
195 386
528 364
652 553
382 649
2 59
861 716
186 3
144 332
738 751
181 390
177 178
75 133
457 627
445 622
336 315
243 251
91 604
776 638
217 246
534 430
480 626
78 51
38 679
208 243
99 32
21 292
804 232
15 91
37 11
641 856
267 183
523 23
321 277
634 671
6 20
19 77
358 16
795 461
494 213
155 101
277 442
130 357
351 521
624 638
391 2
208 493
618 26
53 80
513 412
409 248
398 140
786 829
103 190
247 309
324 191
5 83
227 171
199 775
427 538
5 754
51 126
871 769
218 11
221 363
685 145
589 116
556 814
774 621
177 69
22 33
414 242
165 278
207 206
314 831
85 53
308 121
7 5
503 334
67 418
106 487
816 315
573 678
398 658
103 101
555 651
571 606
99 329
604 811
231 284
92 210
102 20
451 473
19 35
682 230
24 635
199 318
267 300
172 25
101 463
704 52
43 185
266 223
67 211
583 743
583 753
108 195
643 333
471 152
168 603
104 68
60 279
370 460
110 55
541 25
613 93
317 13
1 4
201 163
22 498
466 435
362 241
297 724
134 299
437 228
819 30
167 38
683 750
236 609
695 164
507 307
281 191
53 476
176 45
8 722
328 240
97 288
112 117
170 65
545 20
76 111
18 577
322 518
60 34
586 471
582 523
72 100
282 365
73 809
22 17
349 311
18 11
19 9
97 4
103 275
214 802
504 509
372 371
59 68
653 391
13 131
159 285
636 568
272 133
380 11
853 779
274 756
345 114
128 191
93 4
456 74
836 48
581 163
675 657
616 104
62 549
90 858
304 186
589 760
25 189
254 73
233 48
67 132
779 512
280 211
31 307
157 435
271 69
699 225
67 231
364 595
579 559
72 53
237 387
25 8
643 726
4 10
703 135
225 733
468 687
773 106
20 148
41 32
152 348
312 392
225 92
302 536
72 149
64 65
351 315
859 28
843 63
739 525
160 720
58 21
280 555
436 747
764 82
849 27
616 752
684 348
89 55
299 354
113 101
688 152
220 184
510 41
79 361
845 211
379 282
608 271
78 313
117 341
14 209
105 818
160 112
20 128
46 120
217 302
53 42
87 83
76 431
280 640
42 350
54 213
59 166
16 17
643 711
88 156
686 420
25 92
407 506
170 283
619 215
158 459
496 851
664 459
100 698
286 242
260 25
269 61
583 180
677 651
462 234
584 109
118 657
187 161
702 56
784 690
183 35
55 301
19 277
33 257
301 656
66 119
742 733
865 383
537 110
479 673
400 143
53 122
410 104
137 57
574 585
573 292
474 481
127 108
479 371
68 529
169 147
496 810
253 502
15 326
13 229
114 147
842 493
240 45
600 569
722 833
49 112
203 71
366 148
212 182
115 99
716 675
337 593
162 114
47 36
729 125
6 1
8 3
805 391
200 100
404 172
55 46
840 388
429 299
515 416
114 79
867 400
77 202
270 306
446 392
258 91
23 69
106 383
516 175
419 248
26 303
33 145
387 532
35 496
56 79
235 323
449 310
81 648
197 127
365 477
128 150
464 144
144 164
697 480
841 549
1 2
495 176
240 785
175 15
82 157
27 181
348 381
236 43
231 375
848 523
114 371
98 31
820 349
235 415
370 113
570 394
610 386
602 97
736 40
798 852
588 502
447 568
122 761
319 196
441 160
625 629
719 625
91 565
128 198
235 199
866 77
13 1
337 87
401 147
468 373
294 333
420 246
647 378
691 237
492 306
143 128
61 815
131 553
152 68
235 385
101 221
270 765
110 567
359 327
61 642
221 356
21 397
184 217
393 725
807 212
144 322
12 105
109 497
339 97
470 133
193 51
279 295
290 100
823 672
96 106
440 769
165 164
101 142
721 730
794 159
371 378
270 709
17 56
311 360
755 22
153 834
277 289
9 438
313 540
136 4
325 34
132 369
469 30
228 145
537 757
512 80
27 16
25 827
199 166
595 641
641 710
271 327
43 242
214 296
123 29
291 458
214 594
517 508
153 12
12 14
64 427
145 443
21 569
159 590
292 316
714 828
839 757
781 268
103 184
2 3
26 625
841 844
4 340
358 408
296 762
102 393
746 301
8 52
160 803
424 480
654 20
634 17
392 453
20 86
11 12
763 808
311 744
436 770
87 342
203 780
129 5
615 721
718 425
73 66
786 637
37 676
208 168
232 95
674 446
109 64
427 451
104 138
734 435
343 430
746 772
270 48
850 828
351 556
455 332
574 461
792 398
109 310
219 140
50 46
238 373
2 5
173 180
546 368
12 21
35 54
511 106
575 288
154 26
759 650
543 198
194 411
435 689
22 135
522 124
535 510
612 165
313 599
34 57
444 101
144 29
208 864
435 505
468 728
230 63
158 384
25 168
270 396
832 451
55 712
43 67
639 637
56 550
58 255
337 611
545 562
659 643
448 4
477 504
127 311
75 51
134 403
156 262
406 261
521 542
90 222
454 356
860 601
668 714
50 62
10 24
455 621
21 158
566 202
412 267
539 35
370 771
38 13
214 91
287 240
364 183
474 431
140 108
717 569
223 32
413 527
160 791
63 23
662 173
815 857
716 801
452 342
862 99
705 498
758 330
374 77
501 467
40 241
150 188
93 394
623 406
132 422
645 243
168 171
670 768
270 868
72 425
65 121
88 83
252 183
257 790
681 583
19 70
669 273
35 108
87 821
39 239
378 576
151 78
370 417
748 367
24 29
660 43
131 330
142 264
23 124
26 5
533 229
350 869
172 291
87 163
134 48
817 586
439 399
559 631
125 245
637 431
297 36
383 812
692 693
211 514
244 210
'''
G=nx.Graph()
for line in filter(None, data.split('\n')):
values = line.split(' ')
if len(values) == 2:
G.add_edge(values[0], values[1])
nodes = G.number_of_nodes()
number_of_edges = len(nx.connected_components(G)) -1
number_of_edges += (n - nodes)
print number_of_edges
| 7.793632
| 56
| 0.722954
| 1,720
| 6,609
| 2.767442
| 0.510465
| 0.006723
| 0.008193
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.940083
| 0.267665
| 6,609
| 848
| 57
| 7.793632
| 0.043388
| 0
| 0
| 0
| 0
| 0
| 0.940545
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.001183
| null | null | 0.001183
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
618fc11ab33d704e7a4dd7de39dc74a9fba7bbdc
| 91
|
py
|
Python
|
test_app/apps.py
|
fcfangcc/django-editor-md
|
32f04b1fae30abc8fc5e8c32d43df1e3b79b0e31
|
[
"BSD-3-Clause"
] | 1
|
2019-04-17T14:37:48.000Z
|
2019-04-17T14:37:48.000Z
|
test_app/apps.py
|
fcfangcc/django-editor-md
|
32f04b1fae30abc8fc5e8c32d43df1e3b79b0e31
|
[
"BSD-3-Clause"
] | 1
|
2018-02-06T08:38:48.000Z
|
2021-07-17T14:26:26.000Z
|
test_app/apps.py
|
fcfangcc/django-editor-md
|
32f04b1fae30abc8fc5e8c32d43df1e3b79b0e31
|
[
"BSD-3-Clause"
] | 1
|
2018-06-10T08:19:38.000Z
|
2018-06-10T08:19:38.000Z
|
from django.apps import AppConfig
class EditormdConfig(AppConfig):
name = 'test_app'
| 15.166667
| 33
| 0.758242
| 11
| 91
| 6.181818
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.164835
| 91
| 5
| 34
| 18.2
| 0.894737
| 0
| 0
| 0
| 0
| 0
| 0.087912
| 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
|
619454f8f840e4a8afd5ac624a797501c1c3de83
| 86
|
py
|
Python
|
tests/groups/family/__init__.py
|
aiidateam/aiida-pseudo
|
87515a98fc86bd55756614968a1bc4f2b3f6feb6
|
[
"MIT"
] | 3
|
2020-12-07T23:24:30.000Z
|
2021-05-15T01:50:04.000Z
|
tests/groups/family/__init__.py
|
aiidateam/aiida-pseudo
|
87515a98fc86bd55756614968a1bc4f2b3f6feb6
|
[
"MIT"
] | 89
|
2020-10-15T11:46:18.000Z
|
2022-03-07T17:26:46.000Z
|
tests/groups/family/__init__.py
|
aiidateam/aiida-pseudo
|
87515a98fc86bd55756614968a1bc4f2b3f6feb6
|
[
"MIT"
] | 6
|
2020-10-26T10:01:02.000Z
|
2021-06-07T20:20:58.000Z
|
# -*- coding: utf-8 -*-
"""Tests for the :mod:`aiida_pseudo.groups.family` module."""
| 28.666667
| 61
| 0.627907
| 12
| 86
| 4.416667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.013158
| 0.116279
| 86
| 2
| 62
| 43
| 0.684211
| 0.906977
| 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
|
619f1e3107d7259324d97acab1501d590da0f232
| 3,607
|
py
|
Python
|
tests/tasks/sodaspark/test_sodaspark_tasks.py
|
suryatmodulus/prefect
|
e4ac9f6aa831140c7fba0397f3e5e0884b1b9e42
|
[
"Apache-2.0"
] | 8,633
|
2019-03-23T17:51:03.000Z
|
2022-03-31T22:17:42.000Z
|
tests/tasks/sodaspark/test_sodaspark_tasks.py
|
suryatmodulus/prefect
|
e4ac9f6aa831140c7fba0397f3e5e0884b1b9e42
|
[
"Apache-2.0"
] | 3,903
|
2019-03-23T19:11:21.000Z
|
2022-03-31T23:21:23.000Z
|
tests/tasks/sodaspark/test_sodaspark_tasks.py
|
suryatmodulus/prefect
|
e4ac9f6aa831140c7fba0397f3e5e0884b1b9e42
|
[
"Apache-2.0"
] | 937
|
2019-03-23T18:49:44.000Z
|
2022-03-31T21:45:13.000Z
|
from unittest.mock import MagicMock
import pytest
from pyspark.sql import SparkSession
from prefect.tasks.sodaspark import SodaSparkScan
class TestSodaSparkScan:
def test_construction_provide_scan_and_df(self):
expected_scan_def = "/foo/bar.yaml"
expected_df = SparkSession.builder.getOrCreate().createDataFrame(
[{"id": 123, "value": "foo"}, {"id": 456, "value": "bar"}]
)
soda_spark_scan_task = SodaSparkScan(scan_def=expected_scan_def, df=expected_df)
assert soda_spark_scan_task.scan_def == expected_scan_def
assert soda_spark_scan_task.df == expected_df
def test_construction_no_scan_and_df(self):
soda_spark_scan_task = SodaSparkScan()
assert soda_spark_scan_task.scan_def is None
assert soda_spark_scan_task.df is None
# @pytest.mark.skip(reason="Requires PySpark and Java to be installed")
def test_run_no_scan(self):
df = SparkSession.builder.getOrCreate().createDataFrame(
[{"id": 123, "value": "foo"}, {"id": 456, "value": "bar"}]
)
soda_spark_scan_task = SodaSparkScan(df=df)
with pytest.raises(ValueError) as exc:
soda_spark_scan_task.run()
assert "scan_def cannot be None" in str(exc)
def test_run_no_df(self):
soda_spark_scan_task = SodaSparkScan(scan_def="/foo/bar.yaml")
with pytest.raises(ValueError) as exc:
soda_spark_scan_task.run()
assert "df cannot be None" in str(exc)
# @pytest.mark.skip(reason="Requires PySpark and Java to be installed")
def test_run_invalid_scan(self, monkeypatch):
scan_def = "invalid scan definition"
df = SparkSession.builder.getOrCreate().createDataFrame(
[{"id": 123, "value": "foo"}, {"id": 456, "value": "bar"}]
)
soda_spark_scan_task = SodaSparkScan(scan_def=scan_def, df=df)
with pytest.raises(AttributeError):
soda_spark_scan_task.run()
def test_run_invalid_df(self, monkeypatch):
scan_def = """
table_name: demodata
metrics:
- row_count
- max
- min_length
tests:
- row_count > 0
"""
df = "not a valid df"
soda_spark_scan_task = SodaSparkScan(scan_def=scan_def, df=df)
with pytest.raises(AttributeError):
soda_spark_scan_task.run()
# @pytest.mark.skip(reason="Requires PySpark and Java to be installed")
def test_run_valid_scan_and_df_with_measurements(self):
scan_def = """
table_name: demodata
metrics:
- row_count
- max
- min_length
tests:
- row_count > 0
"""
df = SparkSession.builder.getOrCreate().createDataFrame(
[{"id": 123, "value": "foo"}, {"id": 456, "value": "bar"}]
)
soda_spark_scan_task = SodaSparkScan(scan_def=scan_def, df=df)
res = soda_spark_scan_task.run()
assert hasattr(res, "measurements")
# @pytest.mark.skip(reason="Requires PySpark and Java to be installed")
def test_run_valid_scan_and_df_with_errors(self):
scan_def = """
table_name: demodata
metrics:
- row_count
- max
- min_length
tests:
- row_count == 0
"""
df = SparkSession.builder.getOrCreate().createDataFrame(
[{"id": 123, "value": "foo"}, {"id": 456, "value": "bar"}]
)
soda_spark_scan_task = SodaSparkScan(scan_def=scan_def, df=df)
res = soda_spark_scan_task.run()
assert hasattr(res, "errors")
| 34.028302
| 88
| 0.626282
| 444
| 3,607
| 4.79955
| 0.18018
| 0.065697
| 0.109808
| 0.143595
| 0.801032
| 0.772407
| 0.730174
| 0.664946
| 0.664946
| 0.664946
| 0
| 0.01242
| 0.263377
| 3,607
| 105
| 89
| 34.352381
| 0.789612
| 0.07735
| 0
| 0.583333
| 0
| 0
| 0.201324
| 0
| 0
| 0
| 0
| 0
| 0.095238
| 1
| 0.095238
| false
| 0
| 0.047619
| 0
| 0.154762
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
61bc0236a9a4c6ae617a008de26b731b43b79894
| 384
|
py
|
Python
|
gym/envs/debugging/__init__.py
|
enterstudio/gym
|
3355287f4c778d21e246a08a2af90696d68aee9f
|
[
"MIT"
] | 49
|
2017-12-11T11:00:02.000Z
|
2022-03-30T05:19:31.000Z
|
gym/envs/debugging/__init__.py
|
enterstudio/gym
|
3355287f4c778d21e246a08a2af90696d68aee9f
|
[
"MIT"
] | 2
|
2018-01-01T17:39:56.000Z
|
2019-07-24T04:49:08.000Z
|
gym/envs/debugging/__init__.py
|
enterstudio/gym
|
3355287f4c778d21e246a08a2af90696d68aee9f
|
[
"MIT"
] | 12
|
2017-12-13T11:52:17.000Z
|
2020-12-03T00:53:29.000Z
|
from gym.envs.debugging.one_round_deterministic_reward import OneRoundDeterministicRewardEnv
from gym.envs.debugging.two_round_deterministic_reward import TwoRoundDeterministicRewardEnv
from gym.envs.debugging.one_round_nondeterministic_reward import OneRoundNondeterministicRewardEnv
from gym.envs.debugging.two_round_nondeterministic_reward import TwoRoundNondeterministicRewardEnv
| 76.8
| 98
| 0.927083
| 40
| 384
| 8.6
| 0.375
| 0.081395
| 0.127907
| 0.232558
| 0.325581
| 0.325581
| 0
| 0
| 0
| 0
| 0
| 0
| 0.041667
| 384
| 4
| 99
| 96
| 0.934783
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
f6345c46211daf7ebe52eedee94a56b42fde5119
| 109
|
py
|
Python
|
yandex/yandex2016_a_a.py
|
knuu/competitive-programming
|
16bc68fdaedd6f96ae24310d697585ca8836ab6e
|
[
"MIT"
] | 1
|
2018-11-12T15:18:55.000Z
|
2018-11-12T15:18:55.000Z
|
yandex/yandex2016_a_a.py
|
knuu/competitive-programming
|
16bc68fdaedd6f96ae24310d697585ca8836ab6e
|
[
"MIT"
] | null | null | null |
yandex/yandex2016_a_a.py
|
knuu/competitive-programming
|
16bc68fdaedd6f96ae24310d697585ca8836ab6e
|
[
"MIT"
] | null | null | null |
P, A, B = map(int, input().split())
if P >= A+B:
print(P)
elif B > P:
print(-1)
else:
print(A+B)
| 13.625
| 35
| 0.486239
| 22
| 109
| 2.409091
| 0.545455
| 0.113208
| 0.113208
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.012658
| 0.275229
| 109
| 7
| 36
| 15.571429
| 0.658228
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 0.428571
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
f638e967e871d2139e218f939b819398878885a0
| 755
|
py
|
Python
|
ffws/test/parser/test_LightCycler480.py
|
mojaie/flashflood-workspace-sample
|
647a638ddc8fc5cf179f46f4f5d88bd3ba98faa0
|
[
"MIT"
] | null | null | null |
ffws/test/parser/test_LightCycler480.py
|
mojaie/flashflood-workspace-sample
|
647a638ddc8fc5cf179f46f4f5d88bd3ba98faa0
|
[
"MIT"
] | null | null | null |
ffws/test/parser/test_LightCycler480.py
|
mojaie/flashflood-workspace-sample
|
647a638ddc8fc5cf179f46f4f5d88bd3ba98faa0
|
[
"MIT"
] | null | null | null |
#
# (C) 2014-2017 Seiji Matsuoka
# Licensed under the MIT License (MIT)
# http://opensource.org/licenses/MIT
#
import unittest
from ffws.parser import LightCycler480 as lc
class TestLightCycler480(unittest.TestCase):
def test_file_loader(self):
data = lc.file_loader("./raw/instruments/LightCycler480.txt")
plate1 = data["plates"][0]
self.assertEqual(plate1["plateId"], "Plate1")
self.assertEqual(plate1["layerIndex"], 0)
self.assertEqual(plate1["wellValues"][0], "NaN")
self.assertEqual(plate1["wellValues"][3], "NaN")
self.assertEqual(plate1["wellValues"][22], 9.83E-1)
self.assertEqual(plate1["wellValues"][361], 1.98E3)
self.assertEqual(plate1["wellValues"][383], "NaN")
| 32.826087
| 69
| 0.672848
| 89
| 755
| 5.674157
| 0.561798
| 0.207921
| 0.291089
| 0.306931
| 0.134653
| 0
| 0
| 0
| 0
| 0
| 0
| 0.073365
| 0.169536
| 755
| 22
| 70
| 34.318182
| 0.732057
| 0.13245
| 0
| 0
| 0
| 0
| 0.191063
| 0.05547
| 0
| 0
| 0
| 0
| 0.538462
| 1
| 0.076923
| false
| 0
| 0.153846
| 0
| 0.307692
| 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
|
f66ccc57add6c4af6c1270d0629452966c272400
| 2,036
|
py
|
Python
|
skbandit/bandits/base.py
|
dourouc05/scikit-bandit
|
aa0a0a58304844f593682ff1fe7f0960977bd0d2
|
[
"BSD-3-Clause"
] | null | null | null |
skbandit/bandits/base.py
|
dourouc05/scikit-bandit
|
aa0a0a58304844f593682ff1fe7f0960977bd0d2
|
[
"BSD-3-Clause"
] | null | null | null |
skbandit/bandits/base.py
|
dourouc05/scikit-bandit
|
aa0a0a58304844f593682ff1fe7f0960977bd0d2
|
[
"BSD-3-Clause"
] | null | null | null |
from abc import ABC, abstractmethod
from typing import Union, List, Dict
import numpy as np
class Bandit(ABC):
"""A stochastic, multi-armed bandit player.
A bandit player can be implemented using three methods:
* a constructor: to create the player (required parameters, number of arms, etc.)
* `pull()`: decide the current arm to pull (an integer number, starting at 0)
* `reward(arm, reward)`: when pulling the `arm`, the player got a `reward`. This function is supposed to, but does
not have to, be called after each call to `pull()`
* `rewards(rewards)`: in a full-information or semi-bandit setting, the rewards associated with all arms (or
just those that were played) at a given round
"""
def __init__(self, n_arms: int):
self._n_arms = n_arms
@abstractmethod
def pull(self, context: Union[None, np.ndarray] = None) -> Union[int, List[int]]:
pass
def reward(self, arm: int, reward: float, context: Union[None, np.ndarray] = None) -> None:
raise NotImplementedError
def rewards(self, reward: Union[List[float], Dict[int, float]], context: Union[None, np.ndarray] = None) -> None:
raise NotImplementedError
@property
def n_arms(self):
return self._n_arms
class RewardAccumulatorMixin:
def __init__(self, n_arms: int):
self._arm_counts = [0] * n_arms
self._total_rewards = [0.0] * n_arms
def reward(self, arm: int, reward: float, **kwargs) -> None:
self._arm_counts[arm] += 1
self._total_rewards[arm] += reward
@property
def total_rewards(self):
return self._total_rewards
@property
def arm_counts(self):
return self._arm_counts
# TODO: Explore what others implement:
# https://github.com/jkomiyama/banditlib
# https://www.di.ens.fr/~cappe/Code/PymaBandits/
# https://github.com/flaviotruzzi/AdBandits
# http://banditslilian.gforge.inria.fr/index.html -> https://smpybandits.readthedocs.io/en/latest/docs/Policies.html#submodules
| 33.933333
| 129
| 0.678291
| 281
| 2,036
| 4.800712
| 0.455516
| 0.029652
| 0.026686
| 0.04003
| 0.188288
| 0.188288
| 0.16679
| 0.09192
| 0.09192
| 0.09192
| 0
| 0.003104
| 0.208743
| 2,036
| 59
| 130
| 34.508475
| 0.834264
| 0.43222
| 0
| 0.241379
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.016949
| 0
| 1
| 0.310345
| false
| 0.034483
| 0.103448
| 0.103448
| 0.586207
| 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
|
f673b67a565a16bdfc4923ead218d32403099883
| 282
|
py
|
Python
|
src/jNlp/eProcessing.py
|
Reynolddoss/jProcessing
|
a3ecfde40311fd5b7b4e41b405310655f124d780
|
[
"BSD-2-Clause"
] | 133
|
2015-01-24T07:33:17.000Z
|
2022-03-14T12:17:51.000Z
|
src/jNlp/eProcessing.py
|
Reynolddoss/jProcessing
|
a3ecfde40311fd5b7b4e41b405310655f124d780
|
[
"BSD-2-Clause"
] | 14
|
2015-03-06T07:46:13.000Z
|
2020-07-20T01:57:17.000Z
|
src/jNlp/eProcessing.py
|
kevincobain2000/jProcessing
|
5ea303cc4bf6e8aaa4a3c5f9d023368191919f75
|
[
"BSD-2-Clause"
] | 39
|
2015-01-29T18:58:19.000Z
|
2020-12-04T03:50:30.000Z
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pkg_resources import resource_stream
import sys, os, subprocess
from subprocess import call
import xml.etree.cElementTree as etree
import nltk
from nltk.stem.wordnet import WordNetLemmatizer
if __name__ == '__main__':
pass
| 18.8
| 47
| 0.762411
| 39
| 282
| 5.25641
| 0.74359
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.004167
| 0.148936
| 282
| 14
| 48
| 20.142857
| 0.85
| 0.148936
| 0
| 0
| 0
| 0
| 0.033613
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.125
| 0.75
| 0
| 0.75
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
|
0
| 4
|
9caf7fa4ff6fb6dbc629c2c9be4bdbaae0f6b52c
| 87
|
py
|
Python
|
tests/contract/test_misc.py
|
samuelhwilliams/github-trello-powerup
|
c37539eafb3749b1e029bdeec997e715e9c3f3a4
|
[
"MIT"
] | null | null | null |
tests/contract/test_misc.py
|
samuelhwilliams/github-trello-powerup
|
c37539eafb3749b1e029bdeec997e715e9c3f3a4
|
[
"MIT"
] | null | null | null |
tests/contract/test_misc.py
|
samuelhwilliams/github-trello-powerup
|
c37539eafb3749b1e029bdeec997e715e9c3f3a4
|
[
"MIT"
] | null | null | null |
"""
TESTS TO WRITE:
* API contract tests for notify/email provider, github, trello
"""
| 17.4
| 62
| 0.712644
| 12
| 87
| 5.166667
| 0.916667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.16092
| 87
| 4
| 63
| 21.75
| 0.849315
| 0.896552
| 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
|
9cf6a61c8dd9521dd1b7a891efa4af5f8eb8209f
| 480
|
py
|
Python
|
ports/devel/ninja/dragonfly/patch-configure.py
|
liweitianux/DeltaPorts
|
b907de0ceb9c0e46ae8961896e97b361aa7c62c0
|
[
"BSD-2-Clause-FreeBSD"
] | 31
|
2015-02-06T17:06:37.000Z
|
2022-03-08T19:53:28.000Z
|
ports/devel/ninja/dragonfly/patch-configure.py
|
liweitianux/DeltaPorts
|
b907de0ceb9c0e46ae8961896e97b361aa7c62c0
|
[
"BSD-2-Clause-FreeBSD"
] | 236
|
2015-06-29T19:51:17.000Z
|
2021-12-16T22:46:38.000Z
|
ports/devel/ninja/dragonfly/patch-configure.py
|
liweitianux/DeltaPorts
|
b907de0ceb9c0e46ae8961896e97b361aa7c62c0
|
[
"BSD-2-Clause-FreeBSD"
] | 52
|
2015-02-06T17:05:36.000Z
|
2021-10-21T12:13:06.000Z
|
--- configure.py.intermediate 2014-12-12 13:05:20 UTC
+++ configure.py
@@ -41,6 +41,8 @@ class Platform(object):
self._platform = sys.platform
if self._platform.startswith('linux'):
self._platform = 'linux'
+ elif self._platform.startswith('dragonfly'):
+ self._platform = 'freebsd'
elif self._platform.startswith('freebsd'):
self._platform = 'freebsd'
elif self._platform.startswith('gnukfreebsd'):
| 40
| 55
| 0.616667
| 52
| 480
| 5.538462
| 0.461538
| 0.333333
| 0.305556
| 0.270833
| 0.3125
| 0.3125
| 0.3125
| 0
| 0
| 0
| 0
| 0.054795
| 0.239583
| 480
| 11
| 56
| 43.636364
| 0.734247
| 0
| 0
| 0
| 0
| 0
| 0.10625
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
9cfe7461cb989bebb283cc079011dc65884a988d
| 109
|
py
|
Python
|
api/test/conftest.py
|
avikalpg/IndianVotingAssistant
|
53582b4718c28e7e29771b485dbe91044ce8fbbc
|
[
"Apache-2.0"
] | 8
|
2021-05-15T20:23:13.000Z
|
2022-02-20T11:48:20.000Z
|
api/test/conftest.py
|
avikalpg/IndianVotingAssistant
|
53582b4718c28e7e29771b485dbe91044ce8fbbc
|
[
"Apache-2.0"
] | 9
|
2021-05-11T08:18:53.000Z
|
2021-06-27T12:43:05.000Z
|
api/test/conftest.py
|
avikalpg/IndianVotingAssistant
|
53582b4718c28e7e29771b485dbe91044ce8fbbc
|
[
"Apache-2.0"
] | 2
|
2021-05-13T11:10:46.000Z
|
2021-06-13T12:43:36.000Z
|
import pytest
@pytest.fixture
def get_base_url():
base_url = "http://localhost:5000/"
return base_url
| 18.166667
| 37
| 0.724771
| 16
| 109
| 4.6875
| 0.6875
| 0.28
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.043478
| 0.155963
| 109
| 6
| 38
| 18.166667
| 0.771739
| 0
| 0
| 0
| 0
| 0
| 0.209524
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0.2
| 0
| 0.6
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
141d6d522578acd74ff77db2c30f1498c65060f2
| 883
|
py
|
Python
|
pymultimatic/model/__init__.py
|
oliverpell/pymultiMATIC
|
f4029bdd7d043b9d9f6411da13596535c89c077b
|
[
"MIT"
] | 30
|
2019-12-01T16:04:11.000Z
|
2022-02-28T09:23:52.000Z
|
pymultimatic/model/__init__.py
|
oliverpell/pymultiMATIC
|
f4029bdd7d043b9d9f6411da13596535c89c077b
|
[
"MIT"
] | 43
|
2019-11-09T18:55:10.000Z
|
2022-02-25T20:05:55.000Z
|
pymultimatic/model/__init__.py
|
oliverpell/pymultiMATIC
|
f4029bdd7d043b9d9f6411da13596535c89c077b
|
[
"MIT"
] | 7
|
2020-08-03T08:44:18.000Z
|
2022-02-27T10:15:46.000Z
|
"""Mapped model from the API."""
from .mode import ( # noqa: F401
Mode,
OperatingMode,
OperatingModes,
QuickVeto,
ActiveMode,
SettingMode,
SettingModes,
)
from .timeprogram import TimeProgram, TimeProgramDay, TimePeriodSetting # noqa: F401
from .common import Component, Function # noqa: F401
from .zone import ZoneCooling, ZoneHeating, Zone, ActiveFunction # noqa: F401
from .room import Device, Room # noqa: F401
from .status import HvacStatus, BoilerStatus, Error # noqa: F401
from .syncstate import SyncState # noqa: F401
from .dhw import Dhw, HotWater, Circulation # noqa: F401
from .report import Report, EmfReport # noqa: F401
from .ventilation import Ventilation # noqa: F401
from .quick_mode import QuickMode, QuickModes, HolidayMode # noqa: F401
from .info import FacilityDetail # noqa: F401
from .system import System # noqa: F401
| 38.391304
| 85
| 0.741789
| 104
| 883
| 6.288462
| 0.432692
| 0.159021
| 0.201835
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.053867
| 0.180068
| 883
| 22
| 86
| 40.136364
| 0.849448
| 0.192525
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.619048
| 0
| 0.619048
| 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
|
142c41200a9f127dbdb2a1a972de029d7c2c4800
| 69
|
py
|
Python
|
Day 3/setup.py
|
SSSCodingClub/Jumper
|
283f52c200f6697eb4f331d280bda632497754cb
|
[
"Unlicense"
] | null | null | null |
Day 3/setup.py
|
SSSCodingClub/Jumper
|
283f52c200f6697eb4f331d280bda632497754cb
|
[
"Unlicense"
] | null | null | null |
Day 3/setup.py
|
SSSCodingClub/Jumper
|
283f52c200f6697eb4f331d280bda632497754cb
|
[
"Unlicense"
] | null | null | null |
import pygame
pygame.init()
SCREEN_WIDTH, SCREEN_HEIGHT = 640, 640
| 11.5
| 38
| 0.768116
| 10
| 69
| 5.1
| 0.7
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.101695
| 0.144928
| 69
| 5
| 39
| 13.8
| 0.762712
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 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
|
142d42d65ee883242cfa7e5048f08982c5d79580
| 201
|
py
|
Python
|
app/support/admin.py
|
gab98fra/curriculo.page-project
|
15d2cde96ae726c12e12b574992b8ce74671ad40
|
[
"Apache-2.0"
] | 1
|
2021-09-18T03:11:02.000Z
|
2021-09-18T03:11:02.000Z
|
app/support/admin.py
|
gab98fra/curriculo.page-project
|
15d2cde96ae726c12e12b574992b8ce74671ad40
|
[
"Apache-2.0"
] | null | null | null |
app/support/admin.py
|
gab98fra/curriculo.page-project
|
15d2cde96ae726c12e12b574992b8ce74671ad40
|
[
"Apache-2.0"
] | 1
|
2021-09-18T22:11:51.000Z
|
2021-09-18T22:11:51.000Z
|
from django.contrib import admin
from .models import FAQModel, AssistanceModel, FeedbackModel
admin.site.register(FAQModel)
admin.site.register(AssistanceModel)
admin.site.register(FeedbackModel)
| 18.272727
| 60
| 0.830846
| 23
| 201
| 7.26087
| 0.478261
| 0.161677
| 0.305389
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.089552
| 201
| 10
| 61
| 20.1
| 0.912568
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.4
| 0
| 0.4
| 0
| 1
| 0
| 0
| null | 0
| 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
| 0
| 0
|
0
| 4
|
144fef1b8db5d12d3ffc47e97965f7287bfdfc69
| 206
|
py
|
Python
|
adjutant-plugin/mfa_actions/serializers.py
|
catalyst-cloud/adjutant-mfa
|
d9e99dd006a895ca33b840e7d92bc5107ec4ba8d
|
[
"Apache-2.0"
] | 2
|
2018-02-15T12:56:05.000Z
|
2018-03-10T09:45:08.000Z
|
adjutant-plugin/mfa_actions/serializers.py
|
catalyst-cloud/adjutant-mfa
|
d9e99dd006a895ca33b840e7d92bc5107ec4ba8d
|
[
"Apache-2.0"
] | 1
|
2018-05-24T23:08:17.000Z
|
2018-05-24T23:08:17.000Z
|
adjutant-plugin/mfa_actions/serializers.py
|
catalyst-cloud/adjutant-mfa
|
d9e99dd006a895ca33b840e7d92bc5107ec4ba8d
|
[
"Apache-2.0"
] | 3
|
2018-02-09T03:27:43.000Z
|
2018-07-02T10:45:35.000Z
|
from adjutant.actions.v1.serializers import BaseUserIdSerializer
from rest_framework import serializers
class EditMFASerializer(BaseUserIdSerializer):
delete = serializers.BooleanField(default=False)
| 29.428571
| 64
| 0.854369
| 20
| 206
| 8.75
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.005348
| 0.092233
| 206
| 6
| 65
| 34.333333
| 0.930481
| 0
| 0
| 0
| 0
| 0
| 0
| 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
|
147fd1b2cb3b1008b975617b06453965fc8341c6
| 153
|
py
|
Python
|
oxe-api/exception/cannot_assign_value_from_parent_category.py
|
CybersecurityLuxembourg/openxeco
|
8d4e5578bde6a07f5d6d569b16b4de224abf7bf0
|
[
"BSD-2-Clause"
] | null | null | null |
oxe-api/exception/cannot_assign_value_from_parent_category.py
|
CybersecurityLuxembourg/openxeco
|
8d4e5578bde6a07f5d6d569b16b4de224abf7bf0
|
[
"BSD-2-Clause"
] | null | null | null |
oxe-api/exception/cannot_assign_value_from_parent_category.py
|
CybersecurityLuxembourg/openxeco
|
8d4e5578bde6a07f5d6d569b16b4de224abf7bf0
|
[
"BSD-2-Clause"
] | null | null | null |
class CannotAssignValueFromParentCategory(Exception):
def __init__(self):
super().__init__("422 Cannot assign value from parent category")
| 25.5
| 72
| 0.751634
| 15
| 153
| 7.133333
| 0.933333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.023438
| 0.163399
| 153
| 5
| 73
| 30.6
| 0.8125
| 0
| 0
| 0
| 0
| 0
| 0.289474
| 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
|
149383602551b8044e7b50145326b7cbf411aefd
| 1,743
|
py
|
Python
|
pymetabolism/tests/test_parsers.py
|
Midnighter/pymetabolism
|
20773e6b3e722a7c353171211ceedb019b012951
|
[
"BSD-3-Clause"
] | 1
|
2019-07-08T04:59:09.000Z
|
2019-07-08T04:59:09.000Z
|
pymetabolism/tests/test_parsers.py
|
Midnighter/pymetabolism
|
20773e6b3e722a7c353171211ceedb019b012951
|
[
"BSD-3-Clause"
] | 2
|
2018-08-19T18:59:15.000Z
|
2018-08-19T18:59:15.000Z
|
pymetabolism/tests/test_parsers.py
|
Midnighter/pymetabolism
|
20773e6b3e722a7c353171211ceedb019b012951
|
[
"BSD-3-Clause"
] | null | null | null |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
=============
Parsers Tests
=============
:Authors:
Moritz Emanuel Beber
Nikolaus Sonnenschein
:Date:
2011-04-10
:Copyright:
Copyright(c) 2011 Jacobs University of Bremen. All rights reserved.
:File:
test_parsers.py
"""
import os
import nose.tools as nt
from ..miscellaneous import OptionsManager
from .. import parsers
from ..metabolism import metabolism as pymet
def test_nothing():
pass
#class TestSBMLParser(object):
#
# def __init__(self):
# self.options = OptionsManager.get_instance()
# self.options.reversible_suffix = "r"
# self.parser = parsers.SBMLParser()
# self.system = self.parser.parse(os.path.join(os.path.dirname(__file__),
# "data", "Ec_core_flux1.xml"))
#
# def test_compartments(self):
# nt.assert_equal(len(self.system.compartments), 3)
# for comp in self.system.compartments:
# nt.assert_true(isinstance(comp, pymet.SBMLCompartment))
# nt.assert_true(comp.name)
#
# def test_compounds(self):
# nt.assert_equal(len(self.system.compounds), 77)
# for cmpd in self.system.compounds:
# nt.assert_true(isinstance(cmpd, pymet.SBMLCompartmentCompound))
# nt.assert_true(cmpd.name)
# nt.assert_true(cmpd.identifier)
# nt.assert_true(len(cmpd.extended_name) > 0)
#
# def test_reactions(self):
# nt.assert_equal(len(self.system.reactions), 77)
# for rxn in self.system.reactions:
# nt.assert_true(isinstance(rxn, pymet.SBMLReaction))
# nt.assert_true(rxn.name)
# nt.assert_true(rxn.identifier)
# nt.assert_true(len(rxn.extended_name) > 0)
| 26.815385
| 80
| 0.640849
| 211
| 1,743
| 5.14218
| 0.42654
| 0.095853
| 0.110599
| 0.047005
| 0.129032
| 0.082949
| 0.082949
| 0
| 0
| 0
| 0
| 0.015475
| 0.221457
| 1,743
| 64
| 81
| 27.234375
| 0.784083
| 0.853127
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.142857
| true
| 0.142857
| 0.714286
| 0
| 0.857143
| 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
| 1
| 1
| 0
| 0
| 0
|
0
| 4
|
2139efd086b3304c8aa359ac6e6335afa7ad1e84
| 314
|
py
|
Python
|
website/products/index.py
|
zckoh/ecommerce-fullstack
|
c4cecea3ebaec900da484954d01dcbc2cba325c9
|
[
"Apache-2.0"
] | 1
|
2021-12-14T22:24:20.000Z
|
2021-12-14T22:24:20.000Z
|
website/products/index.py
|
zckoh/ecommerce-fullstack
|
c4cecea3ebaec900da484954d01dcbc2cba325c9
|
[
"Apache-2.0"
] | 11
|
2021-03-30T13:59:29.000Z
|
2022-03-12T00:48:40.000Z
|
website/products/index.py
|
zckoh/ecommerce-fullstack
|
c4cecea3ebaec900da484954d01dcbc2cba325c9
|
[
"Apache-2.0"
] | null | null | null |
from algoliasearch_django import AlgoliaIndex
from algoliasearch_django.decorators import register
from .models import Product
@register(Product)
class ProductIndex(AlgoliaIndex):
fields = ('product_name', 'model_no', 'product_category',
'product_details', 'slug', 'main_product_image')
| 31.4
| 62
| 0.751592
| 33
| 314
| 6.909091
| 0.606061
| 0.149123
| 0.201754
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.159236
| 314
| 9
| 63
| 34.888889
| 0.863636
| 0
| 0
| 0
| 0
| 0
| 0.239344
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.428571
| 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
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
21519a31dc278428ac39c9db0a7cb49e8da64b30
| 201
|
py
|
Python
|
rekcurd_dashboard/logger/__init__.py
|
rekcurd/dashboard
|
c246a7c4c18c8aa6332482661cd55fc67cacf869
|
[
"Apache-2.0"
] | 19
|
2019-03-07T12:03:50.000Z
|
2021-01-28T16:30:17.000Z
|
rekcurd_dashboard/logger/__init__.py
|
rekcurd/dashboard
|
c246a7c4c18c8aa6332482661cd55fc67cacf869
|
[
"Apache-2.0"
] | 69
|
2019-02-01T05:53:28.000Z
|
2022-03-15T19:14:20.000Z
|
rekcurd_dashboard/logger/__init__.py
|
rekcurd/drucker-dashboard
|
c246a7c4c18c8aa6332482661cd55fc67cacf869
|
[
"Apache-2.0"
] | 8
|
2020-03-05T12:39:52.000Z
|
2022-01-26T10:34:21.000Z
|
# -*- coding: utf-8 -*-
from .logger_interface import SystemLoggerInterface
from .logger_jsonlogger import JsonSystemLogger
from .logger_fluent import FluentSystemLogger
logger = JsonSystemLogger()
| 22.333333
| 51
| 0.810945
| 20
| 201
| 8
| 0.6
| 0.1875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.005618
| 0.114428
| 201
| 8
| 52
| 25.125
| 0.893258
| 0.104478
| 0
| 0
| 0
| 0
| 0
| 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
|
215512e306153a6fce3531437be98ccf3716c608
| 136
|
py
|
Python
|
naszrzecznik2/signatures/apps.py
|
watchdogpolska/naszrzecznik2
|
d0cce54b799520918116adf2a2de5df2d3b9a397
|
[
"MIT"
] | null | null | null |
naszrzecznik2/signatures/apps.py
|
watchdogpolska/naszrzecznik2
|
d0cce54b799520918116adf2a2de5df2d3b9a397
|
[
"MIT"
] | 1
|
2016-09-21T21:10:37.000Z
|
2016-09-25T15:40:38.000Z
|
naszrzecznik2/signatures/apps.py
|
watchdogpolska/naszrzecznik2
|
d0cce54b799520918116adf2a2de5df2d3b9a397
|
[
"MIT"
] | 2
|
2016-09-25T15:33:07.000Z
|
2018-08-13T20:11:20.000Z
|
from __future__ import unicode_literals
from django.apps import AppConfig
class SignaturesConfig(AppConfig):
name = 'signatures'
| 17
| 39
| 0.801471
| 15
| 136
| 6.933333
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.147059
| 136
| 7
| 40
| 19.428571
| 0.896552
| 0
| 0
| 0
| 0
| 0
| 0.073529
| 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
|
dcc22a22321bf1d314b74fda6b04042c65f1d105
| 431
|
py
|
Python
|
scripts/build.py
|
1byte2bytes/SydChain
|
ac1fffd9f87c2afa6e2f6a0540d69dad0815ef4f
|
[
"MIT"
] | null | null | null |
scripts/build.py
|
1byte2bytes/SydChain
|
ac1fffd9f87c2afa6e2f6a0540d69dad0815ef4f
|
[
"MIT"
] | null | null | null |
scripts/build.py
|
1byte2bytes/SydChain
|
ac1fffd9f87c2afa6e2f6a0540d69dad0815ef4f
|
[
"MIT"
] | null | null | null |
import build_autoconf
import build_automake
import build_bison
import build_libtool
import build_m4
import build_make
import build_cmake
import build_git
import build_mercurial
import build_ccache
import build_gawk
import build_yasm
import build_nasm
import build_mono
import build_rustc
import build_ninja
import build_dmd
#import build_swift
import build_llvm
# i686 toolchain
#import build_i686_binutils
#import build_i686_gcc
| 17.958333
| 27
| 0.883991
| 67
| 431
| 5.343284
| 0.373134
| 0.645251
| 0.083799
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.025974
| 0.106729
| 431
| 23
| 28
| 18.73913
| 0.903896
| 0.185615
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
dcd5c3fb4d4740a8e4b8ed7831d8b385fdbd8d2c
| 195
|
py
|
Python
|
medical_prescription/exam/models/newexam.py
|
ristovao/2017.2-Receituario-Medico
|
5387eb80dfb354e948abe64f7d8bbe087fc4f136
|
[
"MIT"
] | 11
|
2017-09-19T00:29:40.000Z
|
2018-04-05T23:52:39.000Z
|
medical_prescription/exam/models/newexam.py
|
ristovao/2017.2-Receituario-Medico
|
5387eb80dfb354e948abe64f7d8bbe087fc4f136
|
[
"MIT"
] | 271
|
2017-09-09T00:07:28.000Z
|
2017-12-07T05:00:45.000Z
|
medical_prescription/exam/models/newexam.py
|
ristovao/2017.2-Receituario-Medico
|
5387eb80dfb354e948abe64f7d8bbe087fc4f136
|
[
"MIT"
] | 26
|
2017-08-31T20:48:49.000Z
|
2018-03-21T15:11:27.000Z
|
# Django
from django.db import models
# Local Django
from exam import constants
class NewExam(models.Model):
exam_description = models.CharField(max_length=constants.DESC_TUSS_MAX_LENGTH)
| 19.5
| 82
| 0.805128
| 27
| 195
| 5.62963
| 0.62963
| 0.131579
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.128205
| 195
| 9
| 83
| 21.666667
| 0.894118
| 0.097436
| 0
| 0
| 0
| 0
| 0
| 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
|
dcdc82ac6a581b593d27431080c74055a2e06598
| 252
|
py
|
Python
|
authlib/__init__.py
|
jmrafael/Streamlit-Authentication
|
208e9d8f116d25d420f41b6d01c13f063052805b
|
[
"MIT"
] | null | null | null |
authlib/__init__.py
|
jmrafael/Streamlit-Authentication
|
208e9d8f116d25d420f41b6d01c13f063052805b
|
[
"MIT"
] | null | null | null |
authlib/__init__.py
|
jmrafael/Streamlit-Authentication
|
208e9d8f116d25d420f41b6d01c13f063052805b
|
[
"MIT"
] | null | null | null |
from .common import const, trace_activity, AppError, DatabaseError
from .common.dt_helpers import tnow_iso , tnow_iso_str, dt_from_str, dt_from_ts, dt_to_str
from .common.crypto import aes256cbcExtended
from .common.cookie_manager import CookieManager
| 50.4
| 90
| 0.849206
| 38
| 252
| 5.315789
| 0.526316
| 0.19802
| 0.089109
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.013158
| 0.095238
| 252
| 4
| 91
| 63
| 0.872807
| 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
|
dceafd476e558e7e93c6896b1fb4587fd1195f64
| 4,102
|
py
|
Python
|
hr_html/invite_test.py
|
aungbobo04/emailer
|
2b60917300d528e12263d0d15a15b944088eb193
|
[
"MIT"
] | null | null | null |
hr_html/invite_test.py
|
aungbobo04/emailer
|
2b60917300d528e12263d0d15a15b944088eb193
|
[
"MIT"
] | null | null | null |
hr_html/invite_test.py
|
aungbobo04/emailer
|
2b60917300d528e12263d0d15a15b944088eb193
|
[
"MIT"
] | null | null | null |
#!/usr/bin/python3
# This is the test file for developers !!! Do NOT use this file.
import yagmail
content = ["""<!DOCTYPE html><html lang="en" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml" style="box-sizing:border-box; padding:0px; margin:0px"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="https://fonts.googleapis.com/css?family=Poppins" rel="stylesheet" type="text/css" /><link href="https://fonts.googleapis.com/css?family=Karla" rel="stylesheet" type="text/css" /></head>
<body style="box-sizing: border-box font-family:'Karla'"><div style="box-sizing:border-box; margin-left: auto; margin-right:auto; max-width:500px; background-color:#253a6d;"><img style="box-sizing: border-box; margin: auto; border: 0; display:block; max-width:500px; width:100%" src="https://i.imgur.com/3jmX19l.jpg" alt="cover" padding:0px>
<h1 style="box-sizing: border-box; padding:0px; margin:0px; font-family:'Poppins'; font-size:30px; text-align: center; color: #f1dfb7">You're Invited!</h1>
<img style="box-sizing: border-box; margin: auto; display: block; border: 0; width: 100px; max-width:100%" src="https://i.imgur.com/wbLDpc2.png" alt="cookie logo"/>
<div style="box-sizing: border-box; margin: auto; max-width:350px; text-align: center"><p style="font-size: 17px; font-family:'Poppins'; color: #f1dfb7">Dear Applicants,</p><p style="font-size: 16px; font-family:'Poppins'; color: #f1dfb7">Thank You for applying for the position of <strong>Human Resource Manager</strong> with Cookie Academy. We would like to invite you to join the meeting to interview for the position. Click the button below to see your schedule.</p>
<a style="margin: auto; max-width: 45%; text-decoration: none; display: block; outline:none; overflow:hidden; background-color:#f1dfb7; color:#253a6d; font-weight: bold; padding:10px 8px; border-radius:10px" href="https://docs.google.com/document/d/1f8n8mBqHYu90aoFvx9xMrEeVIEtietFHYUR5KIXebLI/edit">Check Schedule</a>
<p style="box-sizing:border-box; font-size:18px; margin-bottom: 0px; padding: 0px; text-decoration: underline; color:#f1dfb7">Google Meet Info</p><p style="border-box:box-sizing; margin-top: 4px; margin-bottom: 0px; padding:0px; color:#f1dfb7">HR Interview
October 23 1:00 - 2:00 pm</p>
<a style="margin: auto; max-width: 40%; text-decoration: none; display: block; outline:none; overflow:hidden; background-color:#f1dfb7; color:#253a6d; font-weight: bold; padding:10px 5px; border-radius:10px" href="https://meet.google.com/idb-aotb-pjm">Join Meeting</a>
<div style="display:flex"><div style="display:flex; margin:auto"><a href="https://www.facebook.com/cookieacademymm" target="blank"><img alt="facebook" height="32" src="https://i.imgur.com/on4VXmE.png" style="display:block; height:auto; padding-right: 25px; border:0;" title="Facebook" width="32"/></a><a href="https://www.facebook.com/cookieacademymm" target="blank"><img alt="instagram" height="32" src="https://i.imgur.com/Xx7nxgi.png" style="display:block; padding-right:25px; height:auto; border:0;" title="Instagram" width="32"/></a><a href="https://discord.com/invite/sMfdX4Pvz5" target="blank"><img alt="discord" height="32" src="https://i.imgur.com/B1rsYUF.png" style="display:block; height:auto; border:0;" title="Discord" width="32"/></a><a href="#" target="blank"></div></div><p style="color: #ebebeb; font-size: 12px; text-decoration: none; margin-bottom:0px">Email: <a style="margin: 2px 0px 0px 0px; font-size: 12px; color: #ebebeb" href="cookieacademy19@gmail.com">cookieacademy19</a></p><p style="margin: 2px 0px 0px 0px; color: #ebebeb; font-size:12px">Human Resource Department</p><p style="margin: 2px 0px 0px 0px; color: #ebebeb; font-size:12px">Cookie Academy © 2021</p></div>
</div>
</body>
</html>
"""]
def send_mail(content):
yag = yagmail.SMTP("cookieacademy19@gmail.com")
yag.send(to="goddess.gs13@gmail.com", subject="html test", contents=content)
print("success")
if __name__ == "__main__":
send_mail(content)
| 132.322581
| 1,201
| 0.720624
| 629
| 4,102
| 4.685215
| 0.322735
| 0.027486
| 0.038005
| 0.054293
| 0.457414
| 0.364438
| 0.309128
| 0.226671
| 0.175093
| 0.14659
| 0
| 0.042941
| 0.091663
| 4,102
| 30
| 1,202
| 136.733333
| 0.747719
| 0.019503
| 0
| 0
| 0
| 0.428571
| 0.950236
| 0.194825
| 0
| 0
| 0
| 0
| 0
| 1
| 0.047619
| false
| 0
| 0.047619
| 0
| 0.095238
| 0.047619
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
dcecb127add5dc5e155ce8526bf93209e2001330
| 109
|
py
|
Python
|
0_ACMSGURU/100 A+B.py
|
zielman/Codeforces-solutions
|
636f11a9eb10939d09d2e50ddc5ec53327d0b7ab
|
[
"MIT"
] | null | null | null |
0_ACMSGURU/100 A+B.py
|
zielman/Codeforces-solutions
|
636f11a9eb10939d09d2e50ddc5ec53327d0b7ab
|
[
"MIT"
] | 1
|
2021-05-05T17:05:03.000Z
|
2021-05-05T17:05:03.000Z
|
0_ACMSGURU/100 A+B.py
|
zielman/Codeforces-solutions
|
636f11a9eb10939d09d2e50ddc5ec53327d0b7ab
|
[
"MIT"
] | null | null | null |
# https://codeforces.com/problemsets/acmsguru/problem/99999/100
A, B = map(int, input().split())
print(A+B)
| 21.8
| 63
| 0.706422
| 17
| 109
| 4.529412
| 0.882353
| 0.051948
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.08
| 0.082569
| 109
| 4
| 64
| 27.25
| 0.69
| 0.559633
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 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
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
0d4250f7a987e53e9577e6c7f20da5a97bdbd9b8
| 179
|
py
|
Python
|
Vault7/Lost-in-Translation/windows/Resources/Dsz/PyScripts/Lib/dsz/lp/gui/__init__.py
|
dendisuhubdy/grokmachine
|
120a21a25c2730ed356739231ec8b99fc0575c8b
|
[
"BSD-3-Clause"
] | 46
|
2017-05-15T11:15:08.000Z
|
2018-07-02T03:32:52.000Z
|
Vault7/Lost-in-Translation/windows/Resources/Dsz/PyScripts/Lib/dsz/lp/gui/__init__.py
|
dendisuhubdy/grokmachine
|
120a21a25c2730ed356739231ec8b99fc0575c8b
|
[
"BSD-3-Clause"
] | null | null | null |
Vault7/Lost-in-Translation/windows/Resources/Dsz/PyScripts/Lib/dsz/lp/gui/__init__.py
|
dendisuhubdy/grokmachine
|
120a21a25c2730ed356739231ec8b99fc0575c8b
|
[
"BSD-3-Clause"
] | 24
|
2017-05-17T03:26:17.000Z
|
2018-07-09T07:00:50.000Z
|
# package dsz.lp.gui
import dsz
import dsz.lp.alias
import dsz.lp.cmdline
import dsz.path
import dsz.version
import os
import re
import sys
import xml.dom.minidom
| 12.785714
| 23
| 0.731844
| 30
| 179
| 4.366667
| 0.5
| 0.343511
| 0.167939
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.206704
| 179
| 13
| 24
| 13.769231
| 0.922535
| 0.100559
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
b4a3990b1a1cd7b2cfd6d17f2785722e825e8f32
| 129
|
py
|
Python
|
demo/demo.py
|
nielsonf/hello_world
|
90af4baa85900b3b5126b6dfc3031d3f2e149341
|
[
"MIT"
] | null | null | null |
demo/demo.py
|
nielsonf/hello_world
|
90af4baa85900b3b5126b6dfc3031d3f2e149341
|
[
"MIT"
] | null | null | null |
demo/demo.py
|
nielsonf/hello_world
|
90af4baa85900b3b5126b6dfc3031d3f2e149341
|
[
"MIT"
] | null | null | null |
def cube(a):
"""Cube the number a.
Args:
a (float): The number to be squared.
"""
return a**3
| 12.9
| 44
| 0.465116
| 18
| 129
| 3.333333
| 0.666667
| 0.3
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.012987
| 0.403101
| 129
| 9
| 45
| 14.333333
| 0.766234
| 0.511628
| 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
| 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
|
b4b140e448380c58342a0ebe8fe920a461d0f033
| 821
|
py
|
Python
|
Task/Balanced-brackets/Python/balanced-brackets-2.py
|
LaudateCorpus1/RosettaCodeData
|
9ad63ea473a958506c041077f1d810c0c7c8c18d
|
[
"Info-ZIP"
] | 1
|
2021-05-05T13:42:20.000Z
|
2021-05-05T13:42:20.000Z
|
Task/Balanced-brackets/Python/balanced-brackets-2.py
|
seanwallawalla-forks/RosettaCodeData
|
9ad63ea473a958506c041077f1d810c0c7c8c18d
|
[
"Info-ZIP"
] | null | null | null |
Task/Balanced-brackets/Python/balanced-brackets-2.py
|
seanwallawalla-forks/RosettaCodeData
|
9ad63ea473a958506c041077f1d810c0c7c8c18d
|
[
"Info-ZIP"
] | null | null | null |
>>> from itertools import accumulate
>>> from random import shuffle
>>> def gen(n):
... txt = list('[]' * n)
... shuffle(txt)
... return ''.join(txt)
...
>>> def balanced(txt):
... brackets = ({'[': 1, ']': -1}.get(ch, 0) for ch in txt)
... return all(x>=0 for x in accumulate(brackets))
...
>>> for txt in (gen(N) for N in range(10)):
... print ("%-22r is%s balanced" % (txt, '' if balanced(txt) else ' not'))
...
'' is balanced
'][' is not balanced
'[]][' is not balanced
']][[[]' is not balanced
'][[][][]' is not balanced
'[[[][][]]]' is balanced
'][[[][][]][]' is not balanced
'][]][][[]][[][' is not balanced
'][[]]][][[]][[[]' is not balanced
'][[][[]]]][[[]][][' is not balanced
| 32.84
| 78
| 0.433618
| 90
| 821
| 3.955556
| 0.355556
| 0.252809
| 0.292135
| 0.47191
| 0.348315
| 0.348315
| 0.348315
| 0.348315
| 0.348315
| 0.348315
| 0
| 0.013841
| 0.295981
| 821
| 24
| 79
| 34.208333
| 0.602076
| 0
| 0
| 0.125
| 0
| 0
| 0.142509
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.083333
| null | null | 0.041667
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.