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
46880ad28d510a275a0ef3b605187be19076f07b
125
py
Python
tests/test_doctest.py
nlaurance/sourceparse
f7e1a6b7d35b5189b50a68a174260e4d9bd4e4d1
[ "MIT" ]
null
null
null
tests/test_doctest.py
nlaurance/sourceparse
f7e1a6b7d35b5189b50a68a174260e4d9bd4e4d1
[ "MIT" ]
1
2018-01-09T13:52:58.000Z
2018-01-09T14:00:43.000Z
tests/test_doctest.py
nlaurance/sourceparse
f7e1a6b7d35b5189b50a68a174260e4d9bd4e4d1
[ "MIT" ]
1
2018-01-04T17:59:36.000Z
2018-01-04T17:59:36.000Z
import doctest def test_doctests(): doctest.testfile("../README.rst") if __name__ == "__main__": test_doctests()
12.5
37
0.672
14
125
5.285714
0.785714
0.324324
0
0
0
0
0
0
0
0
0
0
0.176
125
9
38
13.888889
0.718447
0
0
0
0
0
0.168
0
0
0
0
0
0
1
0.2
true
0
0.2
0
0.4
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
46b2b8e9399a85c379f4285c77e5661d7da16017
182
py
Python
bin/django-admin.py
aonrobot/MSC-thug-auth-provider
aef37ef5a000586b8502cc536244f31e08b9c2db
[ "Apache-2.0" ]
null
null
null
bin/django-admin.py
aonrobot/MSC-thug-auth-provider
aef37ef5a000586b8502cc536244f31e08b9c2db
[ "Apache-2.0" ]
13
2019-07-03T21:28:31.000Z
2022-02-26T10:42:05.000Z
bin/django-admin.py
aonrobot/MSC-thug-auth-provider
aef37ef5a000586b8502cc536244f31e08b9c2db
[ "Apache-2.0" ]
null
null
null
#!/Users/propaganda/Documents/work/msc/MSC-thug-auth-provider/bin/python3.7 from django.core import management if __name__ == "__main__": management.execute_from_command_line()
30.333333
75
0.791209
25
182
5.32
0.88
0
0
0
0
0
0
0
0
0
0
0.011976
0.082418
182
5
76
36.4
0.784431
0.406593
0
0
0
0
0.074766
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
d3b3f8ee565bda866609352e1aa4ec4098fc8f0d
301
py
Python
Scripts/selected-glyphs/transform/gridfit.py
miguelsousa/hTools2
eab400677c1b21bb2519a7354a142e167c2b39ba
[ "BSD-3-Clause" ]
null
null
null
Scripts/selected-glyphs/transform/gridfit.py
miguelsousa/hTools2
eab400677c1b21bb2519a7354a142e167c2b39ba
[ "BSD-3-Clause" ]
null
null
null
Scripts/selected-glyphs/transform/gridfit.py
miguelsousa/hTools2
eab400677c1b21bb2519a7354a142e167c2b39ba
[ "BSD-3-Clause" ]
null
null
null
# [h] fit to grid dialog '''Round different glyph features to a given grid.''' # debug import hTools2 reload(hTools2) if hTools2.DEBUG: import hTools2.dialogs.glyphs reload(hTools2.dialogs.glyphs) # import from hTools2.dialogs.glyphs import roundToGridDialog # run roundToGridDialog()
14.333333
53
0.747508
38
301
5.921053
0.552632
0.186667
0.266667
0.231111
0
0
0
0
0
0
0
0.02381
0.162791
301
20
54
15.05
0.869048
0.292359
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.428571
0
0.428571
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
1
0
1
0
0
0
0
4
d3cc42aa621427cf5a1dc9c215804beb42adfd74
69
py
Python
coding/optimization/alphabet.py
Tom83B/rate-code-eff-2019
d494d20334fcbbf94865eafef2ec54a4d12557f2
[ "MIT" ]
null
null
null
coding/optimization/alphabet.py
Tom83B/rate-code-eff-2019
d494d20334fcbbf94865eafef2ec54a4d12557f2
[ "MIT" ]
null
null
null
coding/optimization/alphabet.py
Tom83B/rate-code-eff-2019
d494d20334fcbbf94865eafef2ec54a4d12557f2
[ "MIT" ]
null
null
null
from optimization.blahut_arimoto import optimize def kostal_method()
23
48
0.869565
9
69
6.444444
1
0
0
0
0
0
0
0
0
0
0
0
0.086957
69
3
49
23
0.920635
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0.5
null
null
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
4
d3efd2a42368c30bf100211718a26f15e4eb78db
5,499
py
Python
ietf/group/migrations/0002_groupfeatures_historicalgroupfeatures.py
omunroe-com/ietfdb2
aeaae292fbd55aca1b6043227ec105e67d73367f
[ "BSD-3-Clause" ]
2
2021-11-20T03:40:56.000Z
2021-11-20T03:40:59.000Z
ietf/group/migrations/0002_groupfeatures_historicalgroupfeatures.py
omunroe-com/ietfdb2
aeaae292fbd55aca1b6043227ec105e67d73367f
[ "BSD-3-Clause" ]
null
null
null
ietf/group/migrations/0002_groupfeatures_historicalgroupfeatures.py
omunroe-com/ietfdb2
aeaae292fbd55aca1b6043227ec105e67d73367f
[ "BSD-3-Clause" ]
null
null
null
# -*- coding: utf-8 -*- # Generated by Django 1.11.13 on 2018-07-10 15:58 from __future__ import unicode_literals import django.core.validators import django.db.models.deletion from django.conf import settings from django.db import migrations, models import debug # pyflakes:ignore import ietf.utils.models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('name', '0002_agendatypename'), ('group', '0001_initial'), ] operations = [ migrations.CreateModel( name='GroupFeatures', fields=[ ('type', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='name.GroupTypeName', related_name='features')), ('has_milestones', models.BooleanField(default=False, verbose_name=b'Milestones')), ('has_chartering_process', models.BooleanField(default=False, verbose_name=b'Chartering')), ('has_documents', models.BooleanField(default=False, verbose_name=b'Documents')), ('has_dependencies', models.BooleanField(default=False, verbose_name=b'Dependencies')), ('has_nonsession_materials', models.BooleanField(default=False, verbose_name=b'Materials')), ('has_meetings', models.BooleanField(default=False, verbose_name=b'Meetings')), ('has_reviews', models.BooleanField(default=False, verbose_name=b'Reviews')), ('has_default_jabber', models.BooleanField(default=False, verbose_name=b'Jabber')), ('customize_workflow', models.BooleanField(default=False, verbose_name=b'Workflow')), ('about_page', models.CharField(default=b'ietf.group.views.group_about', max_length=64)), ('default_tab', models.CharField(default=b'ietf.group.views.group_about', max_length=64)), ('material_types', models.CharField(default=b'slides', max_length=64, validators=[django.core.validators.RegexValidator(code=b'invalid', message=b'Enter a comma-separated list of material types', regex=b'[a-z0-9_-]+(,[a-z0-9_-]+)*')])), ('admin_roles', models.CharField(default=b'chair', max_length=64, validators=[django.core.validators.RegexValidator(code=b'invalid', message=b'Enter a comma-separated list of role slugs', regex=b'[a-z0-9_-]+(,[a-z0-9_-]+)*')])), ('agenda_type', models.ForeignKey(default=b'ietf', null=True, on_delete=django.db.models.deletion.CASCADE, to='name.AgendaTypeName')), ], ), migrations.CreateModel( name='HistoricalGroupFeatures', fields=[ ('has_milestones', models.BooleanField(default=False, verbose_name=b'Milestones')), ('has_chartering_process', models.BooleanField(default=False, verbose_name=b'Chartering')), ('has_documents', models.BooleanField(default=False, verbose_name=b'Documents')), ('has_dependencies', models.BooleanField(default=False, verbose_name=b'Dependencies')), ('has_nonsession_materials', models.BooleanField(default=False, verbose_name=b'Materials')), ('has_meetings', models.BooleanField(default=False, verbose_name=b'Meetings')), ('has_reviews', models.BooleanField(default=False, verbose_name=b'Reviews')), ('has_default_jabber', models.BooleanField(default=False, verbose_name=b'Jabber')), ('customize_workflow', models.BooleanField(default=False, verbose_name=b'Workflow')), ('about_page', models.CharField(default=b'ietf.group.views.group_about', max_length=64)), ('default_tab', models.CharField(default=b'ietf.group.views.group_about', max_length=64)), ('material_types', models.CharField(default=b'slides', max_length=64, validators=[django.core.validators.RegexValidator(code=b'invalid', message=b'Enter a comma-separated list of material types', regex=b'[a-z0-9_-]+(,[a-z0-9_-]+)*')])), ('admin_roles', models.CharField(default=b'chair', max_length=64, validators=[django.core.validators.RegexValidator(code=b'invalid', message=b'Enter a comma-separated list of role slugs', regex=b'[a-z0-9_-]+(,[a-z0-9_-]+)*')])), ('history_id', models.AutoField(primary_key=True, serialize=False)), ('history_change_reason', models.CharField(max_length=100, null=True)), ('history_date', models.DateTimeField()), ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)), ('agenda_type', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='name.AgendaTypeName')), ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), ('type', ietf.utils.models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='name.GroupTypeName')), ], options={ 'ordering': ('-history_date', '-history_id'), 'get_latest_by': 'history_date', 'verbose_name': 'historical group features', }, ), ]
72.355263
252
0.656119
625
5,499
5.5904
0.2144
0.059817
0.128792
0.154551
0.729823
0.701774
0.701774
0.689181
0.66743
0.66743
0
0.013914
0.189671
5,499
75
253
73.32
0.770197
0.015457
0
0.523077
1
0
0.252865
0.065065
0
0
0
0
0
1
0
false
0
0.107692
0
0.153846
0
0
0
0
null
0
0
0
0
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
3147cc650f2d70af3229ec8bc54399ea9b246fbf
725
py
Python
cifti/__init__.py
pauldmccarthy/cifti
f9f55d67307732ebfaf97a2417e684f480c97f5e
[ "MIT" ]
null
null
null
cifti/__init__.py
pauldmccarthy/cifti
f9f55d67307732ebfaf97a2417e684f480c97f5e
[ "MIT" ]
null
null
null
cifti/__init__.py
pauldmccarthy/cifti
f9f55d67307732ebfaf97a2417e684f480c97f5e
[ "MIT" ]
null
null
null
"""Contains helper objects to easily create, read, write, and manipulate CIFTI files Functions --------- load : Loads a CIFTI file returning the matrix and two Axis objects describing the row/columns save : Saves a matrix and two Axis objects into a CIFTI file Classes ------- Axis : Parent class of all cifti axes BrainModel : cifti axis, where each row/column is a voxel/vertex Parcels : cifti axis, where each row/column is a parcel Series : cifti axis describing a time series Scalar : cifti axis where each row/column has its own name Label : cifti axis where each row/column has its own name and label table """ from .io import read, write, get_axes from .axis import Axis, Series, Parcels, BrainModel, Label, Scalar
38.157895
94
0.76
118
725
4.661017
0.474576
0.081818
0.101818
0.130909
0.338182
0.254545
0.254545
0.254545
0.145455
0.145455
0
0
0.171034
725
18
95
40.277778
0.915141
0.844138
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
314bb3efff938f05c401c7b083ea7a05844e32cb
99
py
Python
bcpy/features/__init__.py
bneurd/bcpy
f52b64d3206c38f3131e91b4067a35765991891e
[ "MIT" ]
2
2019-05-08T17:35:55.000Z
2020-03-06T18:23:40.000Z
bcpy/features/__init__.py
igornfaustino/bcpy
f52b64d3206c38f3131e91b4067a35765991891e
[ "MIT" ]
17
2019-07-17T01:36:15.000Z
2020-05-02T13:22:27.000Z
bcpy/features/__init__.py
bneurd/bcpy
f52b64d3206c38f3131e91b4067a35765991891e
[ "MIT" ]
1
2019-05-08T17:38:35.000Z
2019-05-08T17:38:35.000Z
from .feature_extract import extract from . import strategies __all__ = ['extract', 'strategies']
19.8
36
0.767677
11
99
6.454545
0.545455
0
0
0
0
0
0
0
0
0
0
0
0.131313
99
4
37
24.75
0.825581
0
0
0
0
0
0.171717
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
3160eef83d7d1091c4693eee24410eb01a0f73dc
322
py
Python
scripts/ssc/models/TopoAE/debug_topoae.py
MrBellamonte/MT-VAEs-TDA
8881b5db607c673fb558f7b74ece27f244b16b77
[ "MIT" ]
null
null
null
scripts/ssc/models/TopoAE/debug_topoae.py
MrBellamonte/MT-VAEs-TDA
8881b5db607c673fb558f7b74ece27f244b16b77
[ "MIT" ]
1
2020-09-22T13:04:58.000Z
2020-09-22T13:05:23.000Z
scripts/ssc/models/TopoAE/debug_topoae.py
MrBellamonte/AEs-VAEs-TDA
8881b5db607c673fb558f7b74ece27f244b16b77
[ "MIT" ]
null
null
null
from scripts.ssc.models.TopoAE.config_libraries.local_configs.mnist2 import mnist_test_loc from scripts.ssc.models.TopoAE.config_libraries.swissroll import swissroll_testing from src.models.TopoAE.train_engine import simulator_TopoAE if __name__ == "__main__": simulator_TopoAE(mnist_test_loc.configs_from_grid()[0])
46
90
0.850932
46
322
5.5
0.543478
0.142292
0.110672
0.158103
0.324111
0.324111
0.324111
0
0
0
0
0.006667
0.068323
322
6
91
53.666667
0.836667
0
0
0
0
0
0.024845
0
0
0
0
0
0
1
0
true
0
0.6
0
0.6
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
3185b73908fc8c18742ab8325fd0e54fb24f6848
206
py
Python
serif/theory/alternate_pos.py
BBN-E/ZS4IE
357965f3068cfe5098422d8cb0ca4b0f99c99fd4
[ "Apache-2.0" ]
7
2022-03-24T11:04:08.000Z
2022-03-31T17:12:46.000Z
serif/theory/alternate_pos.py
BBN-E/ZS4IE
357965f3068cfe5098422d8cb0ca4b0f99c99fd4
[ "Apache-2.0" ]
null
null
null
serif/theory/alternate_pos.py
BBN-E/ZS4IE
357965f3068cfe5098422d8cb0ca4b0f99c99fd4
[ "Apache-2.0" ]
null
null
null
from serif.theory.serif_theory import SerifTheory from serif.xmlio import _SimpleAttribute class AlternatePOS(SerifTheory): tag = _SimpleAttribute(is_required=True) prob = _SimpleAttribute(float)
25.75
49
0.81068
23
206
7.043478
0.652174
0.111111
0
0
0
0
0
0
0
0
0
0
0.126214
206
7
50
29.428571
0.9
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.4
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
318f94eff68650f69b0ce90ebb1c9a529c77ab67
21,240
py
Python
rllab/envs/mujoco/maze/maze_env_utils.py
andrewli77/HAAR-A-Hierarchical-RL-Algorithm
e652da781a03435c904d967211be935f437fb64a
[ "MIT" ]
19
2019-10-07T15:19:29.000Z
2022-01-26T21:26:46.000Z
rllab/envs/mujoco/maze/maze_env_utils.py
WeiChengTseng/HAAR-A-Hierarchical-RL-Algorithm
f468118e231938606593202898551035a8e60166
[ "MIT" ]
1
2020-11-18T12:39:35.000Z
2020-11-19T05:44:56.000Z
rllab/envs/mujoco/maze/maze_env_utils.py
WeiChengTseng/HAAR-A-Hierarchical-RL-Algorithm
f468118e231938606593202898551035a8e60166
[ "MIT" ]
5
2020-05-04T15:21:54.000Z
2021-06-01T18:40:26.000Z
from rllab.misc import logger import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt import os.path as osp import numpy as np import math import random def line_intersect(pt1, pt2, ptA, ptB): """ Taken from https://www.cs.hmc.edu/ACM/lectures/intersections.html this returns the intersection of Line(pt1,pt2) and Line(ptA,ptB) returns a tuple: (xi, yi, valid, r, s), where (xi, yi) is the intersection r is the scalar multiple such that (xi,yi) = pt1 + r*(pt2-pt1) s is the scalar multiple such that (xi,yi) = pt1 + s*(ptB-ptA) valid == 0 if there are 0 or inf. intersections (invalid) valid == 1 if it has a unique intersection ON the segment """ DET_TOLERANCE = 0.00000001 # the first line is pt1 + r*(pt2-pt1) # in component form: x1, y1 = pt1 x2, y2 = pt2 dx1 = x2 - x1 dy1 = y2 - y1 # the second line is ptA + s*(ptB-ptA) x, y = ptA xB, yB = ptB dx = xB - x dy = yB - y # we need to find the (typically unique) values of r and s # that will satisfy # # (x1, y1) + r(dx1, dy1) = (x, y) + s(dx, dy) # # which is the same as # # [ dx1 -dx ][ r ] = [ x-x1 ] # [ dy1 -dy ][ s ] = [ y-y1 ] # # whose solution is # # [ r ] = _1_ [ -dy dx ] [ x-x1 ] # [ s ] = DET [ -dy1 dx1 ] [ y-y1 ] # # where DET = (-dx1 * dy + dy1 * dx) # # if DET is too small, they're parallel # DET = (-dx1 * dy + dy1 * dx) if math.fabs(DET) < DET_TOLERANCE: return (0, 0, 0, 0, 0) # now, the determinant should be OK DETinv = 1.0 / DET # find the scalar amount along the "self" segment r = DETinv * (-dy * (x - x1) + dx * (y - y1)) # find the scalar amount along the input line s = DETinv * (-dy1 * (x - x1) + dx1 * (y - y1)) # return the average of the two descriptions xi = (x1 + r * dx1 + x + s * dx) / 2.0 yi = (y1 + r * dy1 + y + s * dy) / 2.0 return (xi, yi, 1, r, s) def ray_segment_intersect(ray, segment): """ Check if the ray originated from (x, y) with direction theta intersects the line segment (x1, y1) -- (x2, y2), and return the intersection point if there is one """ (x, y), theta = ray # (x1, y1), (x2, y2) = segment pt1 = (x, y) len = 1 pt2 = (x + len * math.cos(theta), y + len * math.sin(theta)) xo, yo, valid, r, s = line_intersect(pt1, pt2, *segment) if valid and r >= 0 and 0 <= s <= 1: return (xo, yo) return None def point_distance(p1, p2): x1, y1 = p1 x2, y2 = p2 return ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5 def construct_maze(maze_id=0, length=1): # define the maze to use if maze_id == 0: if length != 1: raise NotImplementedError("Maze_id 0 only has length 1!") structure = [ [1, 1, 1, 1, 1], [1, 0, 0, 0, 1], [1, 1, 1, 0, 1], [1, 'r', 0, 'g', 1], [1, 1, 1, 1, 1], ] # structure = [ # [0, 0, 0, 0, 0], # [0, 'r', 0, 0, 0], # [0, 0, 0, 0, 0], # [0, 0, 0, 'g', 0], # [0, 0, 0, 0, 0], # ] # structure = [ # [1, 1, 1, 1, 1, 1, 1], # [1, 0, 0, 0, 0, 'g', 1], # [1, 0, 0, 0, 0, 0, 1], # [1, 'r', 0, 0, 0, 0, 1], # [1, 1, 1, 1, 1, 1, 1], # ] elif maze_id == 1: # donuts maze: can reach the single goal by 2 equal paths c = length + 4 M = np.ones((c, c)) M[1:c - 1, (1, c - 2)] = 0 M[(1, c - 2), 1:c - 1] = 0 M = M.astype(int).tolist() M[1][c // 2] = 'r' M[c - 2][c // 2] = 'g' structure = M elif maze_id == 2: # spiral maze: need to use all the keys (only makes sense for length >=3) c = length + 4 M = np.ones((c, c)) M[1:c - 1, (1, c - 2)] = 0 M[(1, c - 2), 1:c - 1] = 0 M = M.astype(int).tolist() M[1][c // 2] = 'r' # now block one of the ways and put the goal on the other side M[1][c // 2 - 1] = 1 M[1][c // 2 - 2] = 'g' structure = M elif maze_id == 3: # corridor with goals at the 2 extremes structure = [ [1] * (2 * length + 5), [1, 'g'] + [0] * length + ['r'] + [0] * length + ['g', 1], [1] * (2 * length + 5), ] elif 4 <= maze_id <= 7: # cross corridor, goal in c = 2 * length + 5 M = np.ones((c, c)) M = M - np.diag(np.ones(c)) M = M - np.diag(np.ones(c - 1), 1) - np.diag(np.ones(c - 1), -1) i = np.arange(c) j = i[::-1] M[i, j] = 0 M[i[:-1], j[1:]] = 0 M[i[1:], j[:-1]] = 0 M[np.array([0, c - 1]), :] = 1 M[:, np.array([0, c - 1])] = 1 M = M.astype(int).tolist() M[c // 2][c // 2] = 'r' if maze_id == 4: M[1][1] = 'g' if maze_id == 5: M[1][c - 2] = 'g' if maze_id == 6: M[c - 2][1] = 'g' if maze_id == 7: M[c - 2][c - 2] = 'g' structure = M elif maze_id == 8: # reflexion of benchmark maze structure = [ [1, 1, 1, 1, 1], [1, 'g', 0, 0, 1], [1, 1, 1, 0, 1], [1, 'r', 0, 0, 1], [1, 1, 1, 1, 1], ] elif maze_id == 9: # sym benchmark maze structure = [ [1, 1, 1, 1, 1], [1, 0, 0, 'r', 1], [1, 0, 1, 1, 1], [1, 0, 0, 'g', 1], [1, 1, 1, 1, 1], ] elif maze_id == 10: # reflexion of sym of benchmark maze structure = [ [1, 1, 1, 1, 1], [1, 0, 0, 'g', 1], [1, 0, 1, 1, 1], [1, 0, 0, 'r', 1], [1, 1, 1, 1, 1], ] elif maze_id == 11: # four room structure = [ [1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 1, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 1], [1,'r',0,'g',1, 0, 0, 0, 1], [1, 1, 0, 1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 1, 1, 0, 1, 1], [1, 0, 0, 0, 1, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 1, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1], ] if structure: return structure else: raise NotImplementedError("The provided MazeId is not recognized") def construct_maze_random(maze_id=0, length=1): # random start, only correct for maze_id == 8 for now! x_relative = y_relative = 0 # for random start position # define the maze to use if maze_id == 0: if length != 1: raise NotImplementedError("Maze_id 0 only has length 1!") structure = [ [1, 1, 1, 1, 1], [1, 0, 0, 0, 1], [1, 1, 1, 0, 1], [1, 'r', 0, 'g', 1], [1, 1, 1, 1, 1], ] elif maze_id == 1: # donuts maze: can reach the single goal by 2 equal paths c = length + 4 M = np.ones((c, c)) M[1:c - 1, (1, c - 2)] = 0 M[(1, c - 2), 1:c - 1] = 0 M = M.astype(int).tolist() M[1][c // 2] = 'r' M[c - 2][c // 2] = 'g' structure = M elif maze_id == 2: # spiral maze: need to use all the keys (only makes sense for length >=3) c = length + 4 M = np.ones((c, c)) M[1:c - 1, (1, c - 2)] = 0 M[(1, c - 2), 1:c - 1] = 0 M = M.astype(int).tolist() M[1][c // 2] = 'r' # now block one of the ways and put the goal on the other side M[1][c // 2 - 1] = 1 M[1][c // 2 - 2] = 'g' structure = M elif maze_id == 3: # corridor with goals at the 2 extremes structure = [ [1] * (2 * length + 5), [1, 'g'] + [0] * length + ['r'] + [0] * length + ['g', 1], [1] * (2 * length + 5), ] elif 4 <= maze_id <= 7: # cross corridor, goal in c = 2 * length + 5 M = np.ones((c, c)) M = M - np.diag(np.ones(c)) M = M - np.diag(np.ones(c - 1), 1) - np.diag(np.ones(c - 1), -1) i = np.arange(c) j = i[::-1] M[i, j] = 0 M[i[:-1], j[1:]] = 0 M[i[1:], j[:-1]] = 0 M[np.array([0, c - 1]), :] = 1 M[:, np.array([0, c - 1])] = 1 M = M.astype(int).tolist() M[c // 2][c // 2] = 'r' if maze_id == 4: M[1][1] = 'g' if maze_id == 5: M[1][c - 2] = 'g' if maze_id == 6: M[c - 2][1] = 'g' if maze_id == 7: M[c - 2][c - 2] = 'g' structure = M elif maze_id == 8: # benchmark maze # not used random seed here. Not necessary? # random.seed(1) pool = [(1, 2), (1, 3), (2, 3), (3, 3), (3, 2), (3, 1)] random_i = np.random.choice(len(pool), p=[0.07, 0.08, 0.11, 0.14, 0.2, 0.4]) x_r, y_r = pool[random_i] # (3, 1) was the initial choice! structure = [ [1, 1, 1, 1, 1], [1, 'g', 0, 0, 1], [1, 1, 1, 0, 1], [1, 0, 0, 0, 1], [1, 1, 1, 1, 1], ] x_r, y_r = 3, 1 # fix start, only for the maze x_g, y_g = 1, 1 # useless for this env structure[x_r][y_r] = 'r' x_relative = x_r - 3 # the x index relative to (0, 0) y_relative = y_r - 1 pool = [(1, 2), (1, 3), (2, 3), (3, 3), (3, 2), (3, 1)] # random pool p = [0.07, 0.08, 0.11, 0.14, 0.2, 0.4] # choice probability from pool elif maze_id == 9: # mirrored maze, for transfer structure = [ [1, 1, 1, 1, 1], [1, 0, 0, 'g', 1], [1, 0, 1, 1, 1], [1, 0, 0, 0, 1], [1, 1, 1, 1, 1], ] x_r, y_r = 3, 1 # fix start, only for the maze x_g, y_g = 1, 3 # useless for this env structure[x_r][y_r] = 'r' # print("x_r, y_r", x_r, y_r) x_relative = x_r - 3 # the x index relative to (0, 0) y_relative = y_r - 1 pool = [(1, 2), (1, 1), (2, 1), (3, 1), (3, 2), (3, 3)] p = [0.07, 0.08, 0.11, 0.14, 0.2, 0.4] # hand-crafted possibility, higher possibility for farther starting pt elif maze_id == 11: structure = [ [1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 1, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 1], [1,'r',0,'g',1, 0, 0, 0, 1], [1, 1, 0, 1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 1, 1, 0, 1, 1], [1, 0, 0, 0, 1, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 1, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1], ] x_r, y_r = 3, 1 x_g, y_g = 3, 3 # this is hard-coded in maze_env.py! x_relative = 0 # x_r, y_r relative to a fixed point y_relative = 0 pool = [(1, 1), (1, 2), (1, 3), (1, 5), (1, 6), (1, 7), (2, 1), (2, 2), (2, 3), (2, 4), (2, 5), (2, 6), (2, 7), (3, 1), (3, 2), (3, 3), (3, 5), (3, 6), (3, 7), (4, 2), (4, 5), (4, 6), (4, 7), (5, 1), (5, 2), (5, 3), (5, 6), (6, 1), (6, 2), (6, 3), (6, 5), (6, 6), (6, 7), (7, 1), (7, 2), (7, 3), (7, 4), (7, 5), (7, 6), (7, 7), (8, 1), (8, 2), (8, 3), (8, 5), (8, 6), (8, 7), ] # random pool for r or g p = [0.02174] * 45 + [0.0217] # choice probability from pool elif maze_id == 12: # a maze that deviates from the original maze a little (to test its transferability) structure = [ # a spiral matrix [1, 1, 1, 1, 1], [1, 0, 0, 0, 1], [1, 'g', 1, 0, 1], [1, 1, 1, 0, 1], [1, 0, 0, 0, 1], [1, 1, 1, 1, 1] ] x_r, y_r = 4, 1 # x_g, y_g = 2, 1 # these are hard-coded in maze_env.py! need to modify!!! structure[x_r][y_r] = 'r' x_relative = 1 # x_r, y_r relative to (3, 1) y_relative = 0 pool = [(1, 1), (1, 2), (1, 3), (2, 3), (3, 3), (4, 3), (4, 2), (4, 1)] # random pool for r or g p = [0.028, 0.056, 0.083, 0.11, 0.139, 0.17, 0.194, 0.22] elif maze_id == 14: # a maze that deviates from the original maze a little (to test its transferability) structure = [ # a mirrored spiral matrix [1, 1, 1, 1, 1], [1, 0, 0, 0, 1], [1, 0, 1, 'g', 1], [1, 0, 1, 1, 1], [1, 0, 0, 0, 1], [1, 1, 1, 1, 1] ] x_r, y_r = 4, 3 structure[x_r][y_r] = 'r' x_relative = 1 # x_r, y_r relative to (3, 1) y_relative = 2 pool = [(1, 3), (1, 2), (1, 1), (2, 1), (3, 1), (4, 1), (4, 2), (4, 3)] # random pool for r or g p = [0.028, 0.056, 0.083, 0.11, 0.139, 0.17, 0.194, 0.22] elif maze_id == 13: # a maze that is elongated structure = [ [1, 1, 1, 1, 1, 1, 1], [1, 'g', 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 0, 1], [1, 1, 1, 1, 1, 0, 1], [1, 1, 1, 1, 1, 0, 1], [1, 0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1] ] x_r, y_r = 5, 1 structure[x_r][y_r] = 'r' x_relative = 2 # x_r, y_r relative to a fixed point (3, 1) y_relative = 0 pool = [(1, 2), (1, 3), (1, 4), (1, 5), (2, 5), (3, 5), (4, 5), (5, 5), (5, 4), (5, 3), (5, 2), (5, 1)] # random pool for r or g p = [0.013, 0.026, 0.028, 0.051, 0.064, 0.077, 0.090, 0.103, 0.115, 0.128, 0.141, 0.164] elif maze_id == 10: # reflexion of sym of benchmark maze structure = [ [1, 1, 1, 1, 1], [1, 0, 0, 'g', 1], [1, 0, 1, 1, 1], [1, 0, 0, 'r', 1], [1, 1, 1, 1, 1], ] if structure: return pool, p, structure, x_relative, y_relative else: raise NotImplementedError("The provided MazeId is not recognized") def plot_ray(self, reading, ray_idx, color='r'): structure = self.MAZE_STRUCTURE size_scaling = self.MAZE_SIZE_SCALING # duplicate cells to plot the maze structure_plot = np.zeros(((len(structure) - 1) * 2, (len(structure[0]) - 1) * 2)) for i in range(len(structure)): for j in range(len(structure[0])): cell = structure[i][j] if type(cell) is not int: cell = 0.3 if cell == 'r' else 0.7 if i == 0: if j == 0: structure_plot[i, j] = cell elif j == len(structure[0]) - 1: structure_plot[i, 2 * j - 1] = cell else: structure_plot[i, 2 * j - 1:2 * j + 1] = cell elif i == len(structure) - 1: if j == 0: structure_plot[2 * i - 1, j] = cell elif j == len(structure[0]) - 1: structure_plot[2 * i - 1, 2 * j - 1] = cell else: structure_plot[2 * i - 1, 2 * j - 1:2 * j + 1] = cell else: if j == 0: structure_plot[2 * i - 1:2 * i + 1, j] = cell elif j == len(structure[0]) - 1: structure_plot[2 * i - 1:2 * i + 1, 2 * j - 1] = cell else: structure_plot[2 * i - 1:2 * i + 1, 2 * j - 1:2 * j + 1] = cell fig, ax = plt.subplots() im = ax.pcolor(-np.array(structure_plot), cmap='gray', edgecolor='black', linestyle=':', lw=1) x_labels = list(range(len(structure[0]))) y_labels = list(range(len(structure))) ax.grid(True) # elimiate this to avoid inner lines ax.xaxis.set(ticks=2 * np.arange(len(x_labels)), ticklabels=x_labels) ax.yaxis.set(ticks=2 * np.arange(len(y_labels)), ticklabels=y_labels) robot_xy = np.array(self.wrapped_env.get_body_com("torso")[:2]) # the coordinates of this are wrt the init!! ori = self.get_ori() # for Ant this is computed with atan2, which gives [-pi, pi] # compute origin cell i_o, j_o coordinates and center of it x_o, y_o (with 0,0 in the top-right corner of struc) o_xy = np.array(self._find_robot()) # this is self.init_torso_x, self.init_torso_y !!: center of the cell xy! o_ij = (o_xy / size_scaling).astype(int) # this is the position in the grid (check if correct..) o_xy_plot = o_xy / size_scaling * 2 robot_xy_plot = o_xy_plot + robot_xy / size_scaling * 2 plt.scatter(*robot_xy_plot) # for ray_idx in range(self._n_bins): length_wall = self._sensor_range - reading * self._sensor_range if reading else 1e-6 ray_ori = ori - self._sensor_span * 0.5 + ray_idx / (self._n_bins - 1) * self._sensor_span if ray_ori > math.pi: ray_ori -= 2 * math.pi elif ray_ori < - math.pi: ray_ori += 2 * math.pi # find the end point wall end_xy = (robot_xy + length_wall * np.array([math.cos(ray_ori), math.sin(ray_ori)])) end_xy_plot = (o_ij + end_xy / size_scaling) * 2 plt.plot([robot_xy_plot[0], end_xy_plot[0]], [robot_xy_plot[1], end_xy_plot[1]], color) ax.set_title('sensors debug') print('plotting now, close the window') # plt.show(fig) # plt.close() def plot_state(self, name='sensors', state=None): if state: self.wrapped_env.reset(state) structure = self.__class__.MAZE_STRUCTURE size_scaling = self.__class__.MAZE_SIZE_SCALING # duplicate cells to plot the maze structure_plot = np.zeros(((len(structure) - 1) * 2, (len(structure[0]) - 1) * 2)) for i in range(len(structure)): for j in range(len(structure[0])): cell = structure[i][j] if type(cell) is not int: cell = 0.3 if cell == 'r' else 0.7 if i == 0: if j == 0: structure_plot[i, j] = cell elif j == len(structure[0]) - 1: structure_plot[i, 2 * j - 1] = cell else: structure_plot[i, 2 * j - 1:2 * j + 1] = cell elif i == len(structure) - 1: if j == 0: structure_plot[2 * i - 1, j] = cell elif j == len(structure[0]) - 1: structure_plot[2 * i - 1, 2 * j - 1] = cell else: structure_plot[2 * i - 1, 2 * j - 1:2 * j + 1] = cell else: if j == 0: structure_plot[2 * i - 1:2 * i + 1, j] = cell elif j == len(structure[0]) - 1: structure_plot[2 * i - 1:2 * i + 1, 2 * j - 1] = cell else: structure_plot[2 * i - 1:2 * i + 1, 2 * j - 1:2 * j + 1] = cell fig, ax = plt.subplots() im = ax.pcolor(-np.array(structure_plot), cmap='gray', edgecolor='black', linestyle=':', lw=1) x_labels = list(range(len(structure[0]))) y_labels = list(range(len(structure))) ax.grid(True) # elimiate this to avoid inner lines ax.xaxis.set(ticks=2 * np.arange(len(x_labels)), ticklabels=x_labels) ax.yaxis.set(ticks=2 * np.arange(len(y_labels)), ticklabels=y_labels) obs = self.get_current_maze_obs() robot_xy = np.array(self.wrapped_env.get_body_com("torso")[:2]) # the coordinates of this are wrt the init ori = self.get_ori() # for Ant this is computed with atan2, which gives [-pi, pi] # compute origin cell i_o, j_o coordinates and center of it x_o, y_o (with 0,0 in the top-right corner of struc) o_xy = np.array(self._find_robot()) # this is self.init_torso_x, self.init_torso_y: center of the cell xy! o_ij = (o_xy / size_scaling).astype(int) # this is the position in the grid o_xy_plot = o_xy / size_scaling * 2 robot_xy_plot = o_xy_plot + robot_xy / size_scaling * 2 plt.scatter(*robot_xy_plot) for ray_idx in range(self._n_bins): length_wall = self._sensor_range - obs[ray_idx] * self._sensor_range if obs[ray_idx] else 1e-6 ray_ori = ori - self._sensor_span * 0.5 + ray_idx / (self._n_bins - 1) * self._sensor_span if ray_ori > math.pi: ray_ori -= 2 * math.pi elif ray_ori < - math.pi: ray_ori += 2 * math.pi # find the end point wall end_xy = (robot_xy + length_wall * np.array([math.cos(ray_ori), math.sin(ray_ori)])) end_xy_plot = (o_ij + end_xy / size_scaling) * 2 plt.plot([robot_xy_plot[0], end_xy_plot[0]], [robot_xy_plot[1], end_xy_plot[1]], 'r') length_goal = self._sensor_range - obs[ray_idx + self._n_bins] * self._sensor_range if obs[ ray_idx + self._n_bins] else 1e-6 ray_ori = ori - self._sensor_span * 0.5 + ray_idx / (self._n_bins - 1) * self._sensor_span # find the end point goal end_xy = (robot_xy + length_goal * np.array([math.cos(ray_ori), math.sin(ray_ori)])) end_xy_plot = (o_ij + end_xy / size_scaling) * 2 plt.plot([robot_xy_plot[0], end_xy_plot[0]], [robot_xy_plot[1], end_xy_plot[1]], 'g') log_dir = logger.get_snapshot_dir() ax.set_title('sensors: ' + name) plt.savefig(osp.join(log_dir, name + '_sesors.png')) # this saves the current figure, here f plt.close()
36.494845
137
0.460734
3,544
21,240
2.661117
0.102709
0.05747
0.055349
0.053865
0.750928
0.737674
0.719118
0.699502
0.69314
0.666949
0
0.1044
0.368644
21,240
581
138
36.557659
0.598881
0.202072
0
0.728929
0
0
0.01717
0
0
0
0
0
0
1
0.015945
false
0
0.015945
0
0.045558
0.002278
0
0
0
null
0
0
0
0
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
31a21cf806781c03b1fd741f310934e24a3d7c37
154
py
Python
core/tempCodeRunnerFile.py
chart21/Verification-of-Outsourced-Object-Detection
ed1c27e5de6e6c98098969262aa8bd41da140c8b
[ "MIT" ]
null
null
null
core/tempCodeRunnerFile.py
chart21/Verification-of-Outsourced-Object-Detection
ed1c27e5de6e6c98098969262aa8bd41da140c8b
[ "MIT" ]
null
null
null
core/tempCodeRunnerFile.py
chart21/Verification-of-Outsourced-Object-Detection
ed1c27e5de6e6c98098969262aa8bd41da140c8b
[ "MIT" ]
null
null
null
Object found: {}, Confidence: {:.2f}, BBox Coords (xmin, ymin, xmax, ymax): {}, {}, {}, {} ;".format(class_name, score, coor[0], coor[1], coor[2], coor[3]
154
154
0.584416
22
154
4.045455
0.863636
0
0
0
0
0
0
0
0
0
0
0.037313
0.12987
154
1
154
154
0.626866
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
4
31b0b0ed3ce3b9701aafedbb978e33a03be213bc
77
py
Python
Codefights/arcade/python-arcade/level-9/55.Twins-Score/Python/solution1.py
RevansChen/online-judge
ad1b07fee7bd3c49418becccda904e17505f3018
[ "MIT" ]
7
2017-09-20T16:40:39.000Z
2021-08-31T18:15:08.000Z
Codefights/arcade/python-arcade/level-9/55.Twins-Score/Python/solution1.py
RevansChen/online-judge
ad1b07fee7bd3c49418becccda904e17505f3018
[ "MIT" ]
null
null
null
Codefights/arcade/python-arcade/level-9/55.Twins-Score/Python/solution1.py
RevansChen/online-judge
ad1b07fee7bd3c49418becccda904e17505f3018
[ "MIT" ]
null
null
null
# Python3 # 有限制修改區域 def twinsScore(b, m): return [*map(sum, zip(b, m))]
12.833333
33
0.597403
12
77
3.833333
0.833333
0.086957
0
0
0
0
0
0
0
0
0
0.016393
0.207792
77
5
34
15.4
0.737705
0.194805
0
0
0
0
0
0
0
0
0
0
0
1
0.5
false
0
0
0.5
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
4
31d607c74ea216640e772177dc61923a8d4718e6
83
py
Python
boot/wifi.py
swissbyte/symlite
e46e4d95986da5716e153a22c59b229004ac2a70
[ "MIT" ]
null
null
null
boot/wifi.py
swissbyte/symlite
e46e4d95986da5716e153a22c59b229004ac2a70
[ "MIT" ]
null
null
null
boot/wifi.py
swissbyte/symlite
e46e4d95986da5716e153a22c59b229004ac2a70
[ "MIT" ]
null
null
null
import os if "wlan0" in os.listdir('/sys/class/net/'): print("WLAN0 exists!")
16.6
44
0.638554
13
83
4.076923
0.846154
0
0
0
0
0
0
0
0
0
0
0.028571
0.156627
83
4
45
20.75
0.728571
0
0
0
0
0
0.39759
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
9ec7325170a19bd49f3443e396c495bc772c76b9
14,657
py
Python
knc/features.py
rmorgan10/KNC-Live
5a3f97b0b791c84433c118c087acbb68a9e473e6
[ "BSD-3-Clause" ]
null
null
null
knc/features.py
rmorgan10/KNC-Live
5a3f97b0b791c84433c118c087acbb68a9e473e6
[ "BSD-3-Clause" ]
null
null
null
knc/features.py
rmorgan10/KNC-Live
5a3f97b0b791c84433c118c087acbb68a9e473e6
[ "BSD-3-Clause" ]
1
2021-05-08T03:10:13.000Z
2021-05-08T03:10:13.000Z
""" KN-Classify hand-engineered lightcurve features """ import numpy as np import pandas as pd class FeatureExtractor(): """ Class to contain all feature extraction methods """ def __init__(self): # Establish feature families self.features = [x for x in dir(self) if x[0:1] != '_'] self.families = ['nobs_brighter_than', 'slope', 'same_nite_color_diff', 'total_color_diff', 'snr', 'flat', 'half', 'mag'] self.feat_families = {fam: [x for x in self.features if x.find(fam) != -1] for fam in self.families} self.single_features = [x for x in self.features if x.find('color') == -1] self.double_features = [x for x in self.features if x.find('color') != -1] return # Family 1: Nobs bright than def __family1(self, lc, flt, threshold): mag_arr = self.__get_mags(lc, flt) if len(mag_arr) > 0: return sum((mag_arr < threshold)) else: return 'N' @staticmethod def __get_mags(lc, flt): if flt is None: return lc['MAG'].values.astype(float) else: return lc['MAG'].values[lc['FLT'].values == flt].astype(float) def nobs_brighter_than_17(self, lc, flt1, flt2=None): return self.__family1(lc, flt1, 17.0) def nobs_brighter_than_18(self, lc, flt1, flt2=None): return self.__family1(lc, flt1, 18.0) def nobs_brighter_than_19(self, lc, flt1, flt2=None): return self.__family1(lc, flt1, 19.0) def nobs_brighter_than_20(self, lc, flt1, flt2=None): return self.__family1(lc, flt1, 20.0) def nobs_brighter_than_21(self, lc, flt1, flt2=None): return self.__family1(lc, flt1, 21.0) def nobs_brighter_than_215(self, lc, flt1, flt2=None): return self.__family1(lc, flt1, 21.5) def nobs_brighter_than_22(self, lc, flt1, flt2=None): return self.__family1(lc, flt1, 22.0) def nobs_brighter_than_225(self, lc, flt1, flt2=None): return self.__family1(lc, flt1, 22.5) def nobs_brighter_than_23(self, lc, flt1, flt2=None): return self.__family1(lc, flt1, 23.0) def nobs_brighter_than_17_any_flt(self, lc, flt1, flt2=None): return self.__family1(lc, None, 17.0) def nobs_brighter_than_18_any_flt(self, lc, flt1, flt2=None): return self.__family1(lc, None, 18.0) def nobs_brighter_than_19_any_flt(self, lc, flt1, flt2=None): return self.__family1(lc, None, 19.0) def nobs_brighter_than_20_any_flt(self, lc, flt1, flt2=None): return self.__family1(lc, None, 20.0) def nobs_brighter_than_21_any_flt(self, lc, flt1, flt2=None): return self.__family1(lc, None, 20.0) def nobs_brighter_than_215_any_flt(self, lc, flt1, flt2=None): return self.__family1(lc, None, 20.0) def nobs_brighter_than_22_any_flt(self, lc, flt1, flt2=None): return self.__family1(lc, None, 20.0) def nobs_brighter_than_225_any_flt(self, lc, flt1, flt2=None): return self.__family1(lc, None, 20.0) def nobs_brighter_than_23_any_flt(self, lc, flt1, flt2=None): return self.__family1(lc, None, 20.0) # Family 2: Slope @staticmethod def __get_mjds(lc, flt): if flt is None: mjds = lc['MJD'].values.astype(float) else: mjds = lc['MJD'].values[lc['FLT'].values == flt].astype(float) if len(mjds) != 0: return mjds - mjds.min() else: return mjds @staticmethod def __combine_nites(mags, mjds): nites = mjds.round().astype(int) data = {} out_mjds, out_mags = [], [] for idx, nite in enumerate(nites): if not nite in data: data[nite] = None out_mjds.append(mjds[idx]) out_mags.append(mags[idx]) return np.array(out_mjds), np.array(out_mags) def slope_average(self, lc, flt1, flt2=None): mags = self.__get_mags(lc, flt1) mjds = self.__get_mjds(lc, flt1) mjds, mags = self.__combine_nites(mags, mjds) if len(mags) > 1: if mjds[-1] != mjds[0]: return (mags[-1] - mags[0]) / (mjds[-1] - mjds[0]) else: return 'N' else: return 'N' def slope_max(self, lc, flt1, flt2=None): mags = self.__get_mags(lc, flt1) mjds = self.__get_mjds(lc, flt1) mjds, mags = self.__combine_nites(mags, mjds) if len(mags) > 1: return np.max(np.diff(mags) / np.diff(mjds)) else: return 'N' def slope_min(self, lc, flt1, flt2=None): mags = self.__get_mags(lc, flt1) mjds = self.__get_mjds(lc, flt1) mjds, mags = self.__combine_nites(mags, mjds) if len(mags) > 1: return np.min(np.diff(mags) / np.diff(mjds)) else: return 'N' def slope_mjd_of_max(self, lc, flt1, flt2=None): mags = self.__get_mags(lc, flt1) mjds = self.__get_mjds(lc, flt1) mjds, mags = self.__combine_nites(mags, mjds) if len(mags) > 1: return mjds[np.argmax(np.diff(mags) / np.diff(mjds))] else: return 'N' def slope_mjd_of_min(self, lc, flt1, flt2=None): mags = self.__get_mags(lc, flt1) mjds = self.__get_mjds(lc, flt1) mjds, mags = self.__combine_nites(mags, mjds) if len(mags) > 1: return mjds[np.argmin(np.diff(mags) / np.diff(mjds))] else: return 'N' # Family 3: Same night color difference def __get_nite_color(self, lc, flt1, flt2): lc['NITE'] = lc['MJD'].values.astype(float).round().astype(int) nites = lc.groupby('NITE') colors = [] for (nite, df) in nites: mags_1 = self.__get_mags(df, flt1) mags_2 = self.__get_mags(df, flt2) if len(mags_1) == 0 or len(mags_2) == 0: continue colors.append(mags_1.mean() - mags_2.mean()) return colors def same_nite_color_diff_max(self, lc, flt1, flt2): colors = self.__get_nite_color(lc, flt1, flt2) if len(colors) == 0: return 'N' else: return max(colors) def same_nite_color_diff_min(self, lc, flt1, flt2): colors = self.__get_nite_color(lc, flt1, flt2) if len(colors) == 0: return 'N' else: return min(colors) def same_nite_color_diff_average(self, lc, flt1, flt2): colors = self.__get_nite_color(lc, flt1, flt2) if len(colors) == 0: return 'N' else: return np.mean(colors) # Family 4: Total color differences def total_color_diff_max_max(self, lc, flt1, flt2): mags_1 = self.__get_mags(lc, flt1) mags_2 = self.__get_mags(lc, flt2) if len(mags_1) == 0 or len(mags_2) == 0: return 'N' else: return mags_1.max() - mags_2.max() def total_color_diff_max_min(self, lc, flt1, flt2): mags_1 = self.__get_mags(lc, flt1) mags_2 = self.__get_mags(lc, flt2) if len(mags_1) == 0 or len(mags_2) == 0: return 'N' else: return mags_1.max() - mags_2.min() def total_color_diff_min_max(self, lc, flt1, flt2): mags_1 = self.__get_mags(lc, flt1) mags_2 = self.__get_mags(lc, flt2) if len(mags_1) == 0 or len(mags_2) == 0: return 'N' else: return mags_1.min() - mags_2.max() def total_color_diff_min_min(self, lc, flt1, flt2): mags_1 = self.__get_mags(lc, flt1) mags_2 = self.__get_mags(lc, flt2) if len(mags_1) == 0 or len(mags_2) == 0: return 'N' else: return mags_1.min() - mags_2.min() def total_color_diff_mean_mean(self, lc, flt1, flt2): mags_1 = self.__get_mags(lc, flt1) mags_2 = self.__get_mags(lc, flt2) if len(mags_1) == 0 or len(mags_2) == 0: return 'N' else: return mags_1.mean() - mags_2.mean() # Family 5: SNR @staticmethod def __get_flux_and_fluxerr(lc, flt): return (lc['FLUXCAL'].values[lc['FLT'].values == flt].astype(float), lc['FLUXCALERR'].values[lc['FLT'].values == flt].astype(float)) def snr_max(self, lc, flt1, flt2=None): if not ('FLUXCAL' in lc.columns and 'FLUXCALERR' in lc.columns): return 'N' flux, fluxerr = self.__get_flux_and_fluxerr(lc, flt1) if len(flux) == 0: return 'N' else: return (flux / fluxerr).max() def snr_mean(self, lc, flt1, flt2=None): if not ('FLUXCAL' in lc.columns and 'FLUXCALERR' in lc.columns): return 'N' flux, fluxerr = self.__get_flux_and_fluxerr(lc, flt1) if len(flux) == 0: return 'N' else: return (flux / fluxerr).mean() def snr_mjd_of_max(self, lc, flt1, flt2=None): if not ('FLUXCAL' in lc.columns and 'FLUXCALERR' in lc.columns): return 'N' flux, fluxerr = self.__get_flux_and_fluxerr(lc, flt1) if len(flux) == 0: return 'N' mjds = self.__get_mjds(lc, flt1) return mjds[np.argmax(flux / fluxerr)] # Family 6: Flat line fitting @staticmethod def __get_magerrs(lc, flt): return lc['MAGERR'].values[lc['FLT'].values == flt].astype(float) def flat_reduced_chi2(self, lc, flt1, flt2=None): mags = self.__get_mags(lc, flt1) magerrs = self.__get_magerrs(lc, flt1) if len(mags) < 3: return 'N' chi2 = sum((mags - mags.mean())**2 / magerrs**2) dof = len(mags) - 1 return chi2 / dof def flat_reduced_chi2_weighted(self, lc, flt1, flt2=None): mags = self.__get_mags(lc, flt1) magerrs = self.__get_magerrs(lc, flt1) if len(mags) < 3: return 'N' weighted_av = sum(mags / magerrs**2) / sum(1 / magerrs**2) chi2 = sum((mags - weighted_av) ** 2 / magerrs ** 2) dof = len(mags) - 1 return chi2 / dof def flat_nobs_3_sigma_from_line(self, lc, flt1, flt2=None): mags = self.__get_mags(lc, flt1) magerrs = self.__get_magerrs(lc, flt1) if len(mags) < 3: return 'N' return sum(np.abs((mags - mags.mean()) / magerrs) > 3) def flat_nobs_3_sigma_from_line_weighted(self, lc, flt1, flt2=None): mags = self.__get_mags(lc, flt1) magerrs = self.__get_magerrs(lc, flt1) if len(mags) < 3: return 'N' weighted_av = sum(mags / magerrs**2) / sum(1 / magerrs**2) return sum(np.abs((mags - weighted_av) / magerrs) > 3) def flat_nobs_2_sigma_from_line(self, lc, flt1, flt2=None): mags = self.__get_mags(lc, flt1) magerrs = self.__get_magerrs(lc, flt1) if len(mags) < 3: return 'N' return sum(np.abs((mags - mags.mean()) / magerrs) > 2) def flat_nobs_2_sigma_from_line_weighted(self, lc, flt1, flt2=None): mags = self.__get_mags(lc, flt1) magerrs = self.__get_magerrs(lc, flt1) if len(mags) < 3: return 'N' weighted_av = sum(mags / magerrs**2) / sum(1 / magerrs**2) return sum(np.abs((mags - weighted_av) / magerrs) > 2) # Familiy 7: Half lightcurve mags def half_first_average_mag(self, lc, flt1, flt2=None): mags = self.__get_mags(lc, flt1) mjds = self.__get_mjds(lc, flt1) if len(mags) < 4: return 'N' split = mjds.mean() return mags[mjds < split].mean() def half_second_average_mag(self, lc, flt1, flt2=None): mags = self.__get_mags(lc, flt1) mjds = self.__get_mjds(lc, flt1) if len(mags) < 4: return 'N' split = mjds.mean() return mags[mjds > split].mean() def half_first_average_mag_weighted(self, lc, flt1, flt2=None): mags = self.__get_mags(lc, flt1) mjds = self.__get_mjds(lc, flt1) magerrs = self.__get_magerrs(lc, flt1) if len(mags) < 4: return 'N' mask = (mjds < mjds.mean()) return sum(mags[mask] / magerrs[mask]**2) / sum(1 / magerrs[mask]**2) def half_second_average_mag_weighted(self, lc, flt1, flt2=None): mags = self.__get_mags(lc, flt1) mjds = self.__get_mjds(lc, flt1) magerrs = self.__get_magerrs(lc, flt1) if len(mags) < 4: return 'N' mask = (mjds > mjds.mean()) return sum(mags[mask] / magerrs[mask]**2) / sum(1 / magerrs[mask]**2) def half_split_average_mag_difference(self, lc, flt1, flt2=None): mags = self.__get_mags(lc, flt1) mjds = self.__get_mjds(lc, flt1) if len(mags) < 4: return 'N' mask = (mjds < mjds.mean()) return mags[mask].mean() - mags[~mask].mean() def half_split_average_mag_difference_weighted(self, lc, flt1, flt2=None): mags = self.__get_mags(lc, flt1) mjds = self.__get_mjds(lc, flt1) magerrs = self.__get_magerrs(lc, flt1) if len(mags) < 4: return 'N' mask = (mjds < mjds.mean()) lav = sum(mags[mask] / magerrs[mask]**2) / sum(1 / magerrs[mask]**2) rav = sum(mags[~mask] / magerrs[~mask]**2) / sum(1 / magerrs[~mask]**2) return lav - rav # Family 8: Full lightcurve mags def mag_average(self, lc, flt1, flt2=None): mags = self.__get_mags(lc, flt1) if len(mags) == 0: return 'N' return mags.mean() def mag_average_weighted(self, lc, flt1, flt2=None): mags = self.__get_mags(lc, flt1) magerrs = self.__get_mags(lc, flt1) if len(mags) == 0: return 'N' return sum(mags / magerrs**2) / sum(1 / magerrs**2) def mag_brightest(self, lc, flt1, flt2=None): mags = self.__get_mags(lc, flt1) if len(mags) == 0: return 'N' return mags.min() def mag_total_change(self, lc, flt1, flt2=None): mags = self.__get_mags(lc, flt1) if len(mags) == 0: return 'N' return mags[0] - mags[-1]
33.160633
79
0.558027
2,042
14,657
3.756121
0.071009
0.089179
0.070404
0.09309
0.809126
0.769622
0.731682
0.685658
0.668188
0.660756
0
0.042846
0.315276
14,657
441
80
33.235828
0.721403
0.023402
0
0.539823
0
0
0.016314
0
0
0
0
0
0
1
0.171091
false
0
0.0059
0.058997
0.466077
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
9edbed95eacb767b490ff9cf2a409be36143f146
176
py
Python
api/podcasts/apps.py
urfonline/api
fbd76c246eb1c64c9a12dbcffb21a317e64f8ada
[ "MIT" ]
4
2017-06-13T16:20:34.000Z
2019-10-03T09:19:54.000Z
api/podcasts/apps.py
urfonline/api
fbd76c246eb1c64c9a12dbcffb21a317e64f8ada
[ "MIT" ]
162
2017-05-23T11:41:33.000Z
2022-03-11T23:26:15.000Z
api/podcasts/apps.py
urfonline/api
fbd76c246eb1c64c9a12dbcffb21a317e64f8ada
[ "MIT" ]
1
2017-05-19T09:25:25.000Z
2017-05-19T09:25:25.000Z
from django.apps import AppConfig class PodcastConfig(AppConfig): name = 'api.podcasts' verbose_name = 'Podcasts' def ready(self): from . import signals
17.6
33
0.681818
20
176
5.95
0.75
0
0
0
0
0
0
0
0
0
0
0
0.232955
176
9
34
19.555556
0.881481
0
0
0
0
0
0.113636
0
0
0
0
0
0
1
0.166667
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
9ee08a8dc9d0a076b4ce186a7f5292df2c4e80aa
108
py
Python
test/resources/hello_data/python/main.py
Manu343726/biicode-common
91b32c6fd1e4a72ce5451183f1766d313cd0e420
[ "MIT" ]
17
2015-04-15T09:40:23.000Z
2017-05-17T20:34:49.000Z
test/resources/hello_data/python/main.py
Manu343726/biicode-common
91b32c6fd1e4a72ce5451183f1766d313cd0e420
[ "MIT" ]
2
2015-04-22T11:29:36.000Z
2018-09-25T09:31:09.000Z
test/resources/hello_virtual/python/main.py
bowlofstew/common
45e9ca902be7bbbdd73dafe3ab8957bc4a006020
[ "MIT" ]
22
2015-04-15T09:46:00.000Z
2020-09-29T17:03:31.000Z
''' Created on 17/07/2013 @author: drodri ''' import pretty if __name__ == '__main__': pretty.pretty()
12
26
0.657407
14
108
4.5
0.857143
0
0
0
0
0
0
0
0
0
0
0.089888
0.175926
108
9
27
12
0.617978
0.351852
0
0
0
0
0.126984
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
9ef0828b5d323aca66ea9e3547693c10b7927a75
238
py
Python
tests/functional/test_whoami.py
lipak2345/python-ecsclient
d3f61497348f7c89c760c036d010aa6ca1317c22
[ "Apache-2.0" ]
null
null
null
tests/functional/test_whoami.py
lipak2345/python-ecsclient
d3f61497348f7c89c760c036d010aa6ca1317c22
[ "Apache-2.0" ]
1
2021-09-01T13:39:01.000Z
2021-12-30T21:07:38.000Z
tests/functional/test_whoami.py
lipak2345/python-ecsclient
d3f61497348f7c89c760c036d010aa6ca1317c22
[ "Apache-2.0" ]
null
null
null
from ecsclient import schemas from tests import functional class TestWhoami(functional.BaseTestCase): def test_whoami(self): response = self.client.user_info.whoami() self.assertValidSchema(response, schemas.WHOAMI)
26.444444
56
0.760504
27
238
6.62963
0.666667
0.111732
0
0
0
0
0
0
0
0
0
0
0.163866
238
8
57
29.75
0.899497
0
0
0
0
0
0
0
0
0
0
0
0.166667
1
0.166667
false
0
0.333333
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
9ef1464117cd9e29bfcaf01ed2b1db032ea940f5
25
py
Python
tests/__init__.py
writepython/fmrest
c3eab39c5cfd97a1879f14f62a06e1b904471eb1
[ "MIT" ]
null
null
null
tests/__init__.py
writepython/fmrest
c3eab39c5cfd97a1879f14f62a06e1b904471eb1
[ "MIT" ]
null
null
null
tests/__init__.py
writepython/fmrest
c3eab39c5cfd97a1879f14f62a06e1b904471eb1
[ "MIT" ]
null
null
null
u"""fmrest test suite"""
12.5
24
0.64
4
25
4
1
0
0
0
0
0
0
0
0
0
0
0
0.12
25
1
25
25
0.727273
0.68
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
7303a26aee6cd10fd12037674a8473150cdda495
62
py
Python
epimargin/etl/__init__.py
dilawar/epimargin
0261117cb29dd233600d8f0410d79c93ba261fd3
[ "MIT" ]
6
2021-06-19T14:01:10.000Z
2021-12-31T23:49:34.000Z
epimargin/etl/__init__.py
dilawar/epimargin
0261117cb29dd233600d8f0410d79c93ba261fd3
[ "MIT" ]
34
2020-04-26T05:50:39.000Z
2020-06-17T14:02:32.000Z
epimargin/etl/__init__.py
dilawar/epimargin
0261117cb29dd233600d8f0410d79c93ba261fd3
[ "MIT" ]
5
2021-05-26T16:35:15.000Z
2021-09-10T02:20:34.000Z
from .commons import download_data __all__ = ["download_data"]
31
34
0.806452
8
62
5.5
0.75
0.545455
0
0
0
0
0
0
0
0
0
0
0.096774
62
2
35
31
0.785714
0
0
0
0
0
0.206349
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
734ad07da89c635db8109f0513835342e1c6ff52
206
py
Python
en/056/python/main.py
franciscogomes2020/exercises
8b33c4b9349a9331e4002a8225adc2a482c70024
[ "MIT" ]
null
null
null
en/056/python/main.py
franciscogomes2020/exercises
8b33c4b9349a9331e4002a8225adc2a482c70024
[ "MIT" ]
null
null
null
en/056/python/main.py
franciscogomes2020/exercises
8b33c4b9349a9331e4002a8225adc2a482c70024
[ "MIT" ]
null
null
null
# Develop a program that reads the name, age and gender of 4 people. At the end of the program, show: the average age of the group, what the oldest man's name is, and how many women are under 20 years old.
103
205
0.752427
42
206
3.690476
0.738095
0.064516
0
0
0
0
0
0
0
0
0
0.018293
0.203884
206
1
206
206
0.926829
0.985437
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
b413c86041a0b2a5cd3c8b16af72285a6a7c71f9
158
py
Python
templatestore/apps.py
ackotech/django-templatestore
ec96f9b1f5b3d129bea0b2e8f3773bfcea440f36
[ "Apache-2.0" ]
7
2020-03-06T12:17:50.000Z
2020-10-19T22:52:55.000Z
templatestore/apps.py
nilinswap/django-templatestore
bbf288a096b3a1e9d188d3dbd203cae2fc38b96c
[ "Apache-2.0" ]
82
2020-03-11T11:10:48.000Z
2022-02-28T03:20:52.000Z
templatestore/apps.py
wilspi/django-template-editor
1c255ec408b209014039cc5d7907766d0c6475f3
[ "Apache-2.0" ]
3
2020-05-12T08:42:50.000Z
2020-08-31T16:28:39.000Z
from django.apps import AppConfig from templatestore import app_settings as ts_settings class TemplateStoreAppConfig(AppConfig): name = "templatestore"
22.571429
53
0.822785
18
158
7.111111
0.722222
0
0
0
0
0
0
0
0
0
0
0
0.132911
158
6
54
26.333333
0.934307
0
0
0
0
0
0.082278
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
b45c03c065f3eef9a864748dad01da36e0574707
302
py
Python
insult.py
mrmilosz/kosmibot
cb129958a9ec526d86d54035a1951b575166132e
[ "MIT" ]
null
null
null
insult.py
mrmilosz/kosmibot
cb129958a9ec526d86d54035a1951b575166132e
[ "MIT" ]
null
null
null
insult.py
mrmilosz/kosmibot
cb129958a9ec526d86d54035a1951b575166132e
[ "MIT" ]
null
null
null
import random class Insult: def __init__(self, filename): self.insults = open(filename).read().splitlines() def get(self, victim_name): insult_format = random.choice(self.insults) return insult_format % victim_name if insult_format.count('%s') == 1 else insult_format
30.2
95
0.692053
39
302
5.102564
0.589744
0.241206
0
0
0
0
0
0
0
0
0
0.004132
0.198676
302
9
96
33.555556
0.818182
0
0
0
0
0
0.006623
0
0
0
0
0
0
1
0.285714
false
0
0.142857
0
0.714286
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
b475c19d7b1c708cb6b0f64175e80d2b65bc8baf
164
py
Python
Python-Basics/11.While/07. Min Number.py
Xamaneone/SoftUni-Intro
985fe3249cd2adf021c2003372e840219811d989
[ "MIT" ]
null
null
null
Python-Basics/11.While/07. Min Number.py
Xamaneone/SoftUni-Intro
985fe3249cd2adf021c2003372e840219811d989
[ "MIT" ]
null
null
null
Python-Basics/11.While/07. Min Number.py
Xamaneone/SoftUni-Intro
985fe3249cd2adf021c2003372e840219811d989
[ "MIT" ]
null
null
null
import sys num = input() max_num = sys.maxsize while num != "Stop": num = int(num) if num < max_num: max_num = num num = input() print (max_num)
18.222222
21
0.591463
26
164
3.576923
0.423077
0.258065
0.193548
0
0
0
0
0
0
0
0
0
0.280488
164
9
22
18.222222
0.788136
0
0
0.222222
0
0
0.024242
0
0
0
0
0
0
1
0
false
0
0.111111
0
0.111111
0.111111
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
b47d94e2a42cf52292a95a7028763f65c377a38a
786
py
Python
Customers/search_indexes.py
solvable/rr
314ae475ac9a56779d5deb3c457427bf6d8dcb5f
[ "MIT" ]
null
null
null
Customers/search_indexes.py
solvable/rr
314ae475ac9a56779d5deb3c457427bf6d8dcb5f
[ "MIT" ]
null
null
null
Customers/search_indexes.py
solvable/rr
314ae475ac9a56779d5deb3c457427bf6d8dcb5f
[ "MIT" ]
null
null
null
import datetime from haystack import indexes from .models import Customer class CustomerIndex(indexes.SearchIndex, indexes.Indexable): text = indexes.CharField(document = True, use_template=True) billStreet = indexes.CharField(model_attr='billStreet') billCity = indexes.CharField(model_attr = 'billCity') billState = indexes.CharField(model_attr = 'billState') billZip = indexes.CharField(model_attr = 'billZip') phone1 = indexes.CharField(model_attr='phone1') phone2 = indexes.CharField(model_attr='phone2') email = indexes.CharField(model_attr='email') def get_model(self): return Customer def index_queryset(self, using=None): """Used when the entire index for model is updated""" return self.get_model().objects
34.173913
64
0.727735
92
786
6.097826
0.456522
0.228164
0.262032
0.311943
0
0
0
0
0
0
0
0.006126
0.169211
786
22
65
35.727273
0.852986
0.059796
0
0
0
0
0.069672
0
0
0
0
0
0
1
0.125
false
0
0.1875
0.0625
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
b481d03cd45d6bbc9fa1956712ad4f93c3d5d91f
171
py
Python
Networking/checkip.py
inflatus/python
bc87e2ca9f40c0e53c0d6e15e364cb7dff1c6fc0
[ "MIT" ]
null
null
null
Networking/checkip.py
inflatus/python
bc87e2ca9f40c0e53c0d6e15e364cb7dff1c6fc0
[ "MIT" ]
7
2021-02-08T20:43:38.000Z
2022-03-12T00:17:16.000Z
Networking/checkip.py
inflatus/python
bc87e2ca9f40c0e53c0d6e15e364cb7dff1c6fc0
[ "MIT" ]
null
null
null
import bs4 as bs import urllib.request sauce = urllib.request.urlopen('http://checkip.dyndns.com/').read() soup = bs.BeautifulSoup(sauce, 'lxml') print(soup.body.text)
19
67
0.736842
25
171
5.04
0.76
0.206349
0
0
0
0
0
0
0
0
0
0.006494
0.099415
171
8
68
21.375
0.811688
0
0
0
0
0
0.175439
0
0
0
0
0
0
1
0
false
0
0.4
0
0.4
0.2
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
b48eeba6140b93856bd85f47bb610f870ec796c5
17,239
py
Python
test/test_config_api.py
dcompane/controlm_py
c521208be2f00303383bb32ca5eb2b7ff91999d3
[ "MIT" ]
2
2020-03-20T18:24:23.000Z
2021-03-05T22:05:04.000Z
test/test_config_api.py
dcompane/controlm_py
c521208be2f00303383bb32ca5eb2b7ff91999d3
[ "MIT" ]
null
null
null
test/test_config_api.py
dcompane/controlm_py
c521208be2f00303383bb32ca5eb2b7ff91999d3
[ "MIT" ]
1
2021-05-27T15:54:37.000Z
2021-05-27T15:54:37.000Z
# coding: utf-8 """ Control-M Services Provides access to BMC Control-M Services # noqa: E501 OpenAPI spec version: 9.20.220 Contact: customer_support@bmc.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import unittest import controlm_py from controlm_py.api.config_api import ConfigApi # noqa: E501 from controlm_py.rest import ApiException class TestConfigApi(unittest.TestCase): """ConfigApi unit test stubs""" def setUp(self): self.api = ConfigApi() # noqa: E501 def tearDown(self): pass def test_add_agent(self): """Test case for add_agent add agent to Server # noqa: E501 """ pass def test_add_archive_rule(self): """Test case for add_archive_rule Add Workload Archiving rule # noqa: E501 """ pass def test_add_external_user(self): """Test case for add_external_user Add and external user # noqa: E501 """ pass def test_add_external_user_or_user_group_to_mft_folder(self): """Test case for add_external_user_or_user_group_to_mft_folder Add external user or user groups to virtual folder external users list. # noqa: E501 """ pass def test_add_gateway(self): """Test case for add_gateway add gateway. # noqa: E501 """ pass def test_add_host_to_hostgroup(self): """Test case for add_host_to_hostgroup add agent to hostgroup # noqa: E501 """ pass def test_add_hub_to_cluster(self): """Test case for add_hub_to_cluster add hub to cluster. # noqa: E501 """ pass def test_add_mft_folder(self): """Test case for add_mft_folder Add virtual folder # noqa: E501 """ pass def test_add_mft_user_group(self): """Test case for add_mft_user_group Add user group. # noqa: E501 """ pass def test_add_pgp_template(self): """Test case for add_pgp_template Add PGP Template # noqa: E501 """ pass def test_add_remote_host(self): """Test case for add_remote_host add remote host to Server # noqa: E501 """ pass def test_add_role(self): """Test case for add_role Add Authorization Role # noqa: E501 """ pass def test_add_role_to_ldap_group(self): """Test case for add_role_to_ldap_group Add a role to LDAP group # noqa: E501 """ pass def test_add_role_to_user(self): """Test case for add_role_to_user Add a role to user # noqa: E501 """ pass def test_add_secret(self): """Test case for add_secret Add a new secret # noqa: E501 """ pass def test_add_server(self): """Test case for add_server add server to the system # noqa: E501 """ pass def test_add_user(self): """Test case for add_user Add user # noqa: E501 """ pass def test_add_zos_template(self): """Test case for add_zos_template Add z/OS Template # noqa: E501 """ pass def test_authorize_mft_ssh_cluster(self): """Test case for authorize_mft_ssh_cluster Authorize SSH Cluster # noqa: E501 """ pass def test_authorize_mft_ssh_host(self): """Test case for authorize_mft_ssh_host Authorize SSH Host # noqa: E501 """ pass def test_authorize_ssh_known_remotehost(self): """Test case for authorize_ssh_known_remotehost Authorize # noqa: E501 """ pass def test_change_user_password(self): """Test case for change_user_password Change user password # noqa: E501 """ pass def test_create_agent_certificate_signing_request(self): """Test case for create_agent_certificate_signing_request Create certificate signing request (CSR). # noqa: E501 """ pass def test_create_run_as_user(self): """Test case for create_run_as_user Add a new Run-as user # noqa: E501 """ pass def test_delete_agent(self): """Test case for delete_agent delete an agent from Server # noqa: E501 """ pass def test_delete_archive_rule(self): """Test case for delete_archive_rule Delete Workload Archiving rule # noqa: E501 """ pass def test_delete_authorization_role(self): """Test case for delete_authorization_role Delete Authorization Role # noqa: E501 """ pass def test_delete_external_user(self): """Test case for delete_external_user Delete an external user # noqa: E501 """ pass def test_delete_external_user_or_user_group_from_mft_folder(self): """Test case for delete_external_user_or_user_group_from_mft_folder Remove an external user or user group from an existing virtual folder in MFT. # noqa: E501 """ pass def test_delete_host_from_group(self): """Test case for delete_host_from_group delete an agent from a hostgroup # noqa: E501 """ pass def test_delete_host_group(self): """Test case for delete_host_group delete host group # noqa: E501 """ pass def test_delete_mft_folder(self): """Test case for delete_mft_folder Delete a virtual folder. # noqa: E501 """ pass def test_delete_mft_user_group(self): """Test case for delete_mft_user_group Delete user group. # noqa: E501 """ pass def test_delete_pgp_template(self): """Test case for delete_pgp_template Delete PGP Template # noqa: E501 """ pass def test_delete_remote_host(self): """Test case for delete_remote_host delete a remote host from Server # noqa: E501 """ pass def test_delete_role_from_ldap_group(self): """Test case for delete_role_from_ldap_group Delete a role from LDAP group # noqa: E501 """ pass def test_delete_run_as_user(self): """Test case for delete_run_as_user delete Run-as user # noqa: E501 """ pass def test_delete_secret(self): """Test case for delete_secret Delete an existing secret # noqa: E501 """ pass def test_delete_user(self): """Test case for delete_user Delete user # noqa: E501 """ pass def test_delete_zos_template(self): """Test case for delete_zos_template Delete z/OS Template # noqa: E501 """ pass def test_deploy_agent_certificate(self): """Test case for deploy_agent_certificate Deploy certificate (CRT). # noqa: E501 """ pass def test_disable_agent(self): """Test case for disable_agent disable agent from the Server # noqa: E501 """ pass def test_enable_agent(self): """Test case for enable_agent enable agent from the Server # noqa: E501 """ pass def test_failover(self): """Test case for failover Perform Manual Failover on a specified Server # noqa: E501 """ pass def test_generate_mft_rsa_ssh_key(self): """Test case for generate_mft_rsa_ssh_key Generate RSA SSH Key # noqa: E501 """ pass def test_get_agent_certificate_expiration_date(self): """Test case for get_agent_certificate_expiration_date Get certificate expiration date. # noqa: E501 """ pass def test_get_agent_parameters(self): """Test case for get_agent_parameters get agent parameters # noqa: E501 """ pass def test_get_agents(self): """Test case for get_agents get Server agents # noqa: E501 """ pass def test_get_all_archive_rules(self): """Test case for get_all_archive_rules Get all Workload Archiving rules # noqa: E501 """ pass def test_get_all_authorization_roles(self): """Test case for get_all_authorization_roles Get Authorization Roles # noqa: E501 """ pass def test_get_all_organization_groups(self): """Test case for get_all_organization_groups Get All organization groups # noqa: E501 """ pass def test_get_all_roles_associated_with_organization_group(self): """Test case for get_all_roles_associated_with_organization_group Get Authorization Roles associated with an organization group # noqa: E501 """ pass def test_get_all_users(self): """Test case for get_all_users Get users # noqa: E501 """ pass def test_get_archive_statistics(self): """Test case for get_archive_statistics Get Workload Archiving statistics # noqa: E501 """ pass def test_get_external_user_authorized_folders(self): """Test case for get_external_user_authorized_folders Get MFT external user authorized folders # noqa: E501 """ pass def test_get_external_users(self): """Test case for get_external_users Get MFT external users that match the search criteria. # noqa: E501 """ pass def test_get_fts_settings(self): """Test case for get_fts_settings Get File Transfer Server (FTS) configuration data. # noqa: E501 """ pass def test_get_hostgroups(self): """Test case for get_hostgroups get Server hostgroups # noqa: E501 """ pass def test_get_hosts_in_group(self): """Test case for get_hosts_in_group get hostgroup agents # noqa: E501 """ pass def test_get_hub_status_details(self): """Test case for get_hub_status_details Get hub status. # noqa: E501 """ pass def test_get_mft_configuration(self): """Test case for get_mft_configuration Get MFT Configuration # noqa: E501 """ pass def test_get_mft_folders(self): """Test case for get_mft_folders Get MFT virtual folders that match the search criteria. # noqa: E501 """ pass def test_get_mft_gateways(self): """Test case for get_mft_gateways Get MFT gateways # noqa: E501 """ pass def test_get_mft_user_groups(self): """Test case for get_mft_user_groups Get all user groups that match the search criteria. # noqa: E501 """ pass def test_get_pgp_templates(self): """Test case for get_pgp_templates Get PGP Templates # noqa: E501 """ pass def test_get_remote_host_properties(self): """Test case for get_remote_host_properties get a remote host configuration from Server # noqa: E501 """ pass def test_get_remote_hosts(self): """Test case for get_remote_hosts get Server remote hosts # noqa: E501 """ pass def test_get_role(self): """Test case for get_role Get Authorization Role # noqa: E501 """ pass def test_get_role_associates(self): """Test case for get_role_associates Get all authorization entities associated with role # noqa: E501 """ pass def test_get_run_as_user(self): """Test case for get_run_as_user Get Run-as user # noqa: E501 """ pass def test_get_run_as_users_list(self): """Test case for get_run_as_users_list Get Run-as user list that match the requested search criteria. # noqa: E501 """ pass def test_get_server_parameters(self): """Test case for get_server_parameters get Server parameters # noqa: E501 """ pass def test_get_servers(self): """Test case for get_servers get all the Servers name and hostname in the system # noqa: E501 """ pass def test_get_user(self): """Test case for get_user Get user # noqa: E501 """ pass def test_get_user_effective_rights(self): """Test case for get_user_effective_rights Get user real effective authorizations # noqa: E501 """ pass def test_get_workflow_insights_status(self): """Test case for get_workflow_insights_status get Workflow Insights status # noqa: E501 """ pass def test_get_zos_templates(self): """Test case for get_zos_templates Get z/OS Templates # noqa: E501 """ pass def test_list_secrets(self): """Test case for list_secrets Get list of secret names # noqa: E501 """ pass def test_ping_agent(self): """Test case for ping_agent ping to the agent in the Server # noqa: E501 """ pass def test_recycle_item(self): """Test case for recycle_item recycle item # noqa: E501 """ pass def test_remove_controlm_server(self): """Test case for remove_controlm_server Delete Server # noqa: E501 """ pass def test_remove_gateway(self): """Test case for remove_gateway remove gateway. # noqa: E501 """ pass def test_remove_hub_from_cluster(self): """Test case for remove_hub_from_cluster remove hub from cluster. # noqa: E501 """ pass def test_remove_role_from_user(self): """Test case for remove_role_from_user Remove a role from a user # noqa: E501 """ pass def test_send_archive_cleanup_request(self): """Test case for send_archive_cleanup_request Deletes data (jobs including outputs and logs) from the Workload Archiving database. # noqa: E501 """ pass def test_set_agent_parameter(self): """Test case for set_agent_parameter set agent parameter # noqa: E501 """ pass def test_set_system_param(self): """Test case for set_system_param set value of a an em system parameter # noqa: E501 """ pass def test_setasprimary(self): """Test case for setasprimary Set secondary server as Primary on a specified Server # noqa: E501 """ pass def test_test_run_as_user(self): """Test case for test_run_as_user Test existed Run-as user # noqa: E501 """ pass def test_update_archive_rule(self): """Test case for update_archive_rule Edit Workload Archiving rule # noqa: E501 """ pass def test_update_external_user(self): """Test case for update_external_user Update an external user # noqa: E501 """ pass def test_update_fts_settings(self): """Test case for update_fts_settings Update File Transfer Server (FTS) configuration data. # noqa: E501 """ pass def test_update_hosts_in_hostgroup(self): """Test case for update_hosts_in_hostgroup update agents in hostgroup. # noqa: E501 """ pass def test_update_mft_configuration(self): """Test case for update_mft_configuration Update MFT Configuration # noqa: E501 """ pass def test_update_mft_folder(self): """Test case for update_mft_folder Update an existing virtual folder in MFT. # noqa: E501 """ pass def test_update_mft_user_group(self): """Test case for update_mft_user_group Update user group. # noqa: E501 """ pass def test_update_pgp_template(self): """Test case for update_pgp_template Update PGP Template # noqa: E501 """ pass def test_update_role(self): """Test case for update_role Update Authorization Role # noqa: E501 """ pass def test_update_run_as_user(self): """Test case for update_run_as_user Update Run-as user # noqa: E501 """ pass def test_update_secret(self): """Test case for update_secret Update an existing secret # noqa: E501 """ pass def test_update_user(self): """Test case for update_user Update user # noqa: E501 """ pass def test_update_zos_template(self): """Test case for update_zos_template Update z/OS Template # noqa: E501 """ pass if __name__ == '__main__': unittest.main()
23.046791
106
0.598353
2,151
17,239
4.521153
0.088796
0.086375
0.115373
0.157326
0.665913
0.557738
0.36329
0.155784
0.081645
0.036195
0
0.027893
0.330356
17,239
747
107
23.077644
0.814536
0.473519
0
0.476852
1
0
0.001177
0
0
0
0
0
0
1
0.481481
false
0.481481
0.023148
0
0.509259
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
4
c30168b513edbca9538354032bfa2c8a29a52dd2
1,547
py
Python
sounds/sound.py
liuzihau/OutdoorAtHome
aaf928c8e8e347b5ed9809e20b4536250236eca5
[ "Apache-2.0" ]
null
null
null
sounds/sound.py
liuzihau/OutdoorAtHome
aaf928c8e8e347b5ed9809e20b4536250236eca5
[ "Apache-2.0" ]
null
null
null
sounds/sound.py
liuzihau/OutdoorAtHome
aaf928c8e8e347b5ed9809e20b4536250236eca5
[ "Apache-2.0" ]
null
null
null
import pygame import time class fitness_sound(): def __init__(self): self.soundon = 0 def play_my_sound(self,type,timer): if timer < 10 and (self.soundon) == 0: file = f"sounds/{type}.wav" pygame.mixer.init() pygame.mixer.music.load(file) pygame.mixer.music.play() self.soundon = 1 else: pass # def sound_of_all(): # pygame.mixer.init() # pygame.mixer.Sound.play(pygame.mixer.Sound("sounds/bent_over_row.wav")) # pygame.time.delay(26000) # pygame.mixer.Sound.play(pygame.mixer.Sound("sounds/bicycle_crunch.wav")) # pygame.time.delay(35000) # pygame.mixer.Sound.play(pygame.mixer.Sound("sounds/bridge.wav")) # pygame.time.delay(23000) # pygame.mixer.Sound.play(pygame.mixer.Sound("sounds/dumbbell_bench_press.wav")) # pygame.time.delay(45000) # pygame.mixer.Sound.play(pygame.mixer.Sound("sounds/hip_thrust.wav")) # pygame.time.delay(57000) # pygame.mixer.Sound.play(pygame.mixer.Sound("sounds/lying_leg_raises.wav")) # pygame.time.delay(23000) # pygame.mixer.Sound.play(pygame.mixer.Sound("sounds/side_lateral_raise.wav")) # pygame.time.delay(38000) # pygame.mixer.Sound.play(pygame.mixer.Sound("sounds/squat.wav")) # pygame.time.delay(44000) # return if __name__ == '__main__': fitness_sound.sound_of_all()
32.229167
89
0.593407
187
1,547
4.748663
0.315508
0.247748
0.288288
0.18018
0.476351
0.43018
0.43018
0.43018
0.146396
0.146396
0
0.039753
0.268261
1,547
47
90
32.914894
0.7447
0.581771
0
0
0
0
0.043783
0
0
0
0
0
0
1
0.125
false
0.0625
0.125
0
0.3125
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
1
0
0
0
0
0
4
c30d2d844087c5379759af26dd7d4435667f3e44
212
py
Python
ComicPub/homepage/urls.py
Xonshiz/ComicPub
d332ee1b62d6c28347954280696c86898de6d125
[ "MIT" ]
8
2017-09-02T07:04:59.000Z
2020-12-17T17:30:34.000Z
ComicPub/homepage/urls.py
Xonshiz/ComicPub
d332ee1b62d6c28347954280696c86898de6d125
[ "MIT" ]
1
2017-10-24T12:49:57.000Z
2017-10-24T15:04:44.000Z
ComicPub/homepage/urls.py
Xonshiz/ComicPub
d332ee1b62d6c28347954280696c86898de6d125
[ "MIT" ]
4
2017-10-24T14:13:13.000Z
2021-12-15T17:09:23.000Z
from django.conf.urls import url from homepage import views urlpatterns = [ url(r'^$', views.homepage_index, name="homepage_index"), # url(r'^$', views.HomePageIndex.as_view(), name="homepage_index"), ]
26.5
71
0.70283
28
212
5.178571
0.535714
0.268966
0.124138
0
0
0
0
0
0
0
0
0
0.132075
212
7
72
30.285714
0.788043
0.306604
0
0
0
0
0.110345
0
0
0
0
0
0
1
0
false
0
0.4
0
0.4
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
c3430dbaae1e18444157551926f94a3cdeac9fd6
5,164
py
Python
Dynamic_HD_Scripts/Dynamic_HD_Script_Tests/test_create_connected_lsmask_wrapper.py
ThomasRiddick/DynamicHD
bff378a49ff6c709dc59c2d6835852e1083df20a
[ "BSD-3-Clause" ]
1
2021-08-04T07:51:18.000Z
2021-08-04T07:51:18.000Z
Dynamic_HD_Scripts/Dynamic_HD_Script_Tests/test_create_connected_lsmask_wrapper.py
ThomasRiddick/DynamicHD
bff378a49ff6c709dc59c2d6835852e1083df20a
[ "BSD-3-Clause" ]
1
2022-01-27T22:12:45.000Z
2022-02-01T10:16:47.000Z
Dynamic_HD_Scripts/Dynamic_HD_Script_Tests/test_create_connected_lsmask_wrapper.py
ThomasRiddick/DynamicHD
bff378a49ff6c709dc59c2d6835852e1083df20a
[ "BSD-3-Clause" ]
null
null
null
''' Unit test of the wrapper for the connected ls mask creation c++ code Created on May 25, 2016 @author: thomasriddick ''' import unittest import numpy as np from Dynamic_HD_Scripts.interface.cpp_interface.libs \ import create_connected_lsmask_wrapper as cc_lsmask_wrapper #@UnresolvedImport class Test(unittest.TestCase): """Unit test object""" def setUp(self): """Unit test setup function. Prepare test data""" self.landsea_in = np.asarray([[0,0,1,0,1,1,0,1,0,1], [1,0,0,0,0,1,0,1,1,1], [0,0,0,1,1,1,1,1,1,0], [0,0,1,0,1,0,0,1,1,1], [0,0,0,1,0,0,0,0,0,1], [0,1,0,1,0,0,1,0,1,0], [0,1,0,0,0,0,0,1,0,0], [0,0,0,0,0,1,0,0,0,0], [1,1,0,0,1,1,1,0,1,0], [1,1,1,0,0,0,0,0,0,0]], dtype=np.int32, order='C') self.ocean_seed_points = np.asarray([[0,0,1,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,1,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,1,0,0,0,0,0,0,0,0], [0,1,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [1,0,0,0,0,0,0,0,0,0]], dtype=np.int32, order='C') self.expected_output_using_diagonals = np.asarray([[0,0,1,0,1,1,0,1,0,1], [1,0,0,0,0,1,0,1,1,1], [0,0,0,1,1,1,1,1,1,0], [0,0,1,0,1,0,0,1,1,1], [0,0,0,1,0,0,0,0,0,1], [0,1,0,1,0,0,1,0,1,0], [0,1,0,0,0,0,0,1,0,0], [0,0,0,0,0,0,0,0,0,0], [1,1,0,0,0,0,0,0,0,0], [1,1,1,0,0,0,0,0,0,0]], dtype=np.int32, order='C') self.expected_output_not_using_diagonals = np.asarray([[0,0,1,0,1,1,0,1,0,1], [1,0,0,0,0,1,0,1,1,1], [0,0,0,1,1,1,1,1,1,0], [0,0,0,0,1,0,0,1,1,1], [0,0,0,0,0,0,0,0,0,1], [0,1,0,0,0,0,0,0,0,0], [0,1,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [1,1,0,0,0,0,0,0,0,0], [1,1,1,0,0,0,0,0,0,0]], dtype=np.int32, order='C') def testCreateConnectedLsmaskWrapperUsingDiagonals(self): """Test creating a connected ls mask including diagonal connections""" cc_lsmask_wrapper.create_connected_ls_mask(self.landsea_in, #@UndefinedVariable self.ocean_seed_points, True) np.testing.assert_array_equal(self.landsea_in, self.expected_output_using_diagonals, "Creating a connected ls mask using diagonal doesn't produce" " expected results") def testCreateConnectedLsmaskWrapperWithoutUsingDiagonals(self): """Test creating a connected ls mask not including diagonal connections""" cc_lsmask_wrapper.create_connected_ls_mask(self.landsea_in, #@UndefinedVariable self.ocean_seed_points, False) np.testing.assert_array_equal(self.landsea_in, self.expected_output_not_using_diagonals, "Creating a connected ls mask not using diagonals doesn't produce" " expected results") if __name__ == "__main__": #import sys;sys.argv = ['', 'Test.testName'] unittest.main()
56.747253
104
0.332107
627
5,164
2.647528
0.133971
0.274699
0.334337
0.371084
0.675904
0.642169
0.629518
0.543373
0.540964
0.539157
0
0.174979
0.541828
5,164
90
105
57.377778
0.526627
0.079202
0
0.617647
0
0
0.035775
0
0
0
0
0
0.029412
1
0.044118
false
0
0.044118
0
0.102941
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
1
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
5ee7fd8c534c68c54c2fb265b67760d2ddc3122c
535
py
Python
detectron/lib/python3.6/site-packages/torch/distributed/__init__.py
JustinBear99/Mask_RCNN
d43eaf7c6ebf29d4d6da796a0f7ff5561e21acff
[ "Apache-2.0" ]
null
null
null
detectron/lib/python3.6/site-packages/torch/distributed/__init__.py
JustinBear99/Mask_RCNN
d43eaf7c6ebf29d4d6da796a0f7ff5561e21acff
[ "Apache-2.0" ]
null
null
null
detectron/lib/python3.6/site-packages/torch/distributed/__init__.py
JustinBear99/Mask_RCNN
d43eaf7c6ebf29d4d6da796a0f7ff5561e21acff
[ "Apache-2.0" ]
null
null
null
from __future__ import absolute_import, division, print_function, unicode_literals import torch def is_available(): return hasattr(torch._C, "_c10d_init") if is_available() and not torch._C._c10d_init(): raise RuntimeError("Failed to initialize torch.distributed") if is_available(): from .distributed_c10d import * # Variables prefixed with underscore are not auto imported # See the comment in `distributed_c10d.py` above `_backend` on why we expose # this. from .distributed_c10d import _backend
25.47619
82
0.753271
71
535
5.380282
0.647887
0.086387
0.052356
0.073298
0
0
0
0
0
0
0
0.022624
0.173832
535
20
83
26.75
0.841629
0.256075
0
0
0
0
0.121827
0
0
0
0
0
0
1
0.111111
true
0
0.444444
0.111111
0.666667
0.111111
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
1
1
0
0
4
5eff80f47e96a0ee278f12733fb14f20ac08f80f
184
py
Python
demos/consts.py
Linusp/soph
46822f347795f51c3872a164fbbe416fa0e91807
[ "MIT" ]
41
2016-04-28T03:14:27.000Z
2021-02-21T18:55:09.000Z
demos/consts.py
Linusp/soph
46822f347795f51c3872a164fbbe416fa0e91807
[ "MIT" ]
3
2016-06-19T07:29:56.000Z
2017-12-15T09:39:05.000Z
demos/consts.py
Linusp/soph
46822f347795f51c3872a164fbbe416fa0e91807
[ "MIT" ]
25
2016-06-07T17:29:02.000Z
2021-05-08T08:43:36.000Z
import os PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) MODEL_PATH = os.path.join(PROJECT_ROOT, 'models') DATA_PATH = os.path.join(PROJECT_ROOT, 'data')
26.285714
74
0.76087
30
184
4.366667
0.4
0.229008
0.198473
0.229008
0.625954
0.381679
0
0
0
0
0
0
0.081522
184
6
75
30.666667
0.775148
0
0
0
0
0
0.054348
0
0
0
0
0
0
1
0
false
0
0.25
0
0.25
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
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
6f04a19a9c1a981eb21b779442f0b4bc0fe57542
765
py
Python
meta_features/base.py
mostafaelaraby/generalization-gap-features-tensorflow
efec157d790a43a3fdeed81f3bf521023f6a83af
[ "Apache-2.0" ]
null
null
null
meta_features/base.py
mostafaelaraby/generalization-gap-features-tensorflow
efec157d790a43a3fdeed81f3bf521023f6a83af
[ "Apache-2.0" ]
null
null
null
meta_features/base.py
mostafaelaraby/generalization-gap-features-tensorflow
efec157d790a43a3fdeed81f3bf521023f6a83af
[ "Apache-2.0" ]
null
null
null
import tensorflow as tf class Base: def __init__(self, name, feature_names,is_demogen=False): self.name = name self.feature_names = [feature_name +"_" + name for feature_name in feature_names] self.last_runtime = -1 self.is_demogen = is_demogen def get_name(self): return self.name def get_feature_names(self): return self.feature_names def extract_features(self, model, dataset): pass def get_run_time(self): return self.last_runtime def get_input_target(self, data): if self.is_demogen: # this is for demogen dataset only working on cifar-10 return data["inputs"], tf.squeeze(tf.cast(data["targets"], tf.int32)) return data
29.423077
90
0.645752
104
765
4.509615
0.423077
0.127932
0.089552
0
0
0
0
0
0
0
0
0.008945
0.269281
765
25
91
30.6
0.830054
0.067974
0
0
0
0
0.019691
0
0
0
0
0
0
1
0.315789
false
0.052632
0.052632
0.157895
0.684211
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
1
1
0
0
4
6f0bca427672985c83338cd9e7a168273972ffbc
124
py
Python
exercicios/007.py
daldantas/Curso-Python
96d09393b1ad278990156906e965c0d7adb4f4aa
[ "MIT" ]
null
null
null
exercicios/007.py
daldantas/Curso-Python
96d09393b1ad278990156906e965c0d7adb4f4aa
[ "MIT" ]
null
null
null
exercicios/007.py
daldantas/Curso-Python
96d09393b1ad278990156906e965c0d7adb4f4aa
[ "MIT" ]
null
null
null
n1 = float(input("Digite um número: ")) n2 = float(input("Digite outro: ")) m = (n1 + n2) / 2 print('{:.2f}'.format(m))
24.8
40
0.556452
19
124
3.631579
0.684211
0.289855
0.463768
0
0
0
0
0
0
0
0
0.059406
0.185484
124
4
41
31
0.623762
0
0
0
0
0
0.316667
0
0
0
0
0
0
1
0
false
0
0
0
0
0.25
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
6f31f0c7e51779dad4dfb9c66baaa199153ee423
76
py
Python
ex41.py
cohadar/learn-python-the-hard-way
10d88fe59a8abc5303661cfe91c6db9fa71bdd56
[ "MIT" ]
null
null
null
ex41.py
cohadar/learn-python-the-hard-way
10d88fe59a8abc5303661cfe91c6db9fa71bdd56
[ "MIT" ]
null
null
null
ex41.py
cohadar/learn-python-the-hard-way
10d88fe59a8abc5303661cfe91c6db9fa71bdd56
[ "MIT" ]
null
null
null
# list.copy is done with lst[:] # This tutorial is gettingg more insane
10.857143
39
0.697368
12
76
4.416667
0.916667
0
0
0
0
0
0
0
0
0
0
0
0.223684
76
6
40
12.666667
0.898305
0.881579
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
6f3309530d706d96b59228aae1ae630bdda51555
421
py
Python
Droit/views/errors.py
Halleloya/DBAC
af149fdcb18cb12817ea44b45750ede502d114a2
[ "BSD-3-Clause" ]
null
null
null
Droit/views/errors.py
Halleloya/DBAC
af149fdcb18cb12817ea44b45750ede502d114a2
[ "BSD-3-Clause" ]
null
null
null
Droit/views/errors.py
Halleloya/DBAC
af149fdcb18cb12817ea44b45750ede502d114a2
[ "BSD-3-Clause" ]
null
null
null
""" Define the error pages for the project """ from flask import render_template def register_error_page(app): @app.errorhandler(404) def page_not_found(e): # note that we set the 404 status explicitly return render_template('/errors/404.html', description = e), 404 @app.errorhandler(401) def unauthorized (e): return render_template('/errors/401.html', description = e), 401
24.764706
72
0.688836
57
421
4.964912
0.561404
0.14841
0.141343
0.183746
0
0
0
0
0
0
0
0.062874
0.206651
421
16
73
26.3125
0.784431
0.194774
0
0
0
0
0.096677
0
0
0
0
0
0
1
0.375
false
0
0.125
0.25
0.75
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
6f39bd3d68171b799a53acf6028ddb77cbf33f05
531
py
Python
test/test_main_view.py
pixb/great-hero-beard-robot
5c2b9549e43f756f1604e98fb06b15ad437c11f3
[ "MIT" ]
null
null
null
test/test_main_view.py
pixb/great-hero-beard-robot
5c2b9549e43f756f1604e98fb06b15ad437c11f3
[ "MIT" ]
null
null
null
test/test_main_view.py
pixb/great-hero-beard-robot
5c2b9549e43f756f1604e98fb06b15ad437c11f3
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # @Time : 2021/8/25 8:15 # @Author : pixb # @Email : tpxsky@163.com # @File : test_main_view.py # @Software: PyCharm # @Description: from view.main_view import main_view def test_main_back(): main_view().click_back() def test_click_enter(): main_view().click_enter() def test_add_speed(): main_view().click_add_speed() def test_select_level(): main_view().select_level() def test_click_sale(): main_view().click_sale() def test_w_click(): main_view().double_click()
18.310345
36
0.676083
79
531
4.177215
0.43038
0.218182
0.157576
0
0
0
0
0
0
0
0
0.031746
0.169492
531
28
37
18.964286
0.716553
0.284369
0
0
0
0
0
0
0
0
0
0
0
1
0.461538
true
0
0.076923
0
0.538462
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
0
0
1
0
0
4
6f451f7ac64563044fa2508a7e4f4b2ced214879
45
py
Python
lang/py/cookbook/v2/source/cb2_2_1_sol_5.py
ch1huizong/learning
632267634a9fd84a5f5116de09ff1e2681a6cc85
[ "MIT" ]
null
null
null
lang/py/cookbook/v2/source/cb2_2_1_sol_5.py
ch1huizong/learning
632267634a9fd84a5f5116de09ff1e2681a6cc85
[ "MIT" ]
null
null
null
lang/py/cookbook/v2/source/cb2_2_1_sol_5.py
ch1huizong/learning
632267634a9fd84a5f5116de09ff1e2681a6cc85
[ "MIT" ]
null
null
null
for line in file_object: ## process line
15
24
0.688889
7
45
4.285714
0.857143
0
0
0
0
0
0
0
0
0
0
0
0.244444
45
2
25
22.5
0.882353
0.266667
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
4
489f8c5a279d112759479481c820706af52d0b4e
115
py
Python
Scripts/support/textManipulation.py
MainDuelo/Python-Tkinter-and-SQLite
7f69780ce9c1c8ebe807197448030aed94c3a082
[ "MIT" ]
null
null
null
Scripts/support/textManipulation.py
MainDuelo/Python-Tkinter-and-SQLite
7f69780ce9c1c8ebe807197448030aed94c3a082
[ "MIT" ]
null
null
null
Scripts/support/textManipulation.py
MainDuelo/Python-Tkinter-and-SQLite
7f69780ce9c1c8ebe807197448030aed94c3a082
[ "MIT" ]
null
null
null
class TextManipulation: def formatText(text): newText = text.replace("&", "\n") return newText
23
41
0.608696
11
115
6.363636
0.818182
0
0
0
0
0
0
0
0
0
0
0
0.26087
115
5
42
23
0.823529
0
0
0
0
0
0.025862
0
0
0
0
0
0
1
0.25
false
0
0
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
48a91e52dcde69b0ac65d9abba9b30445878565f
249
py
Python
setup.py
PublicMapping/districtbuilder-classic-config
a83fd3d8c541475b80eb056d1d3a0f297986ba63
[ "Apache-2.0" ]
null
null
null
setup.py
PublicMapping/districtbuilder-classic-config
a83fd3d8c541475b80eb056d1d3a0f297986ba63
[ "Apache-2.0" ]
1
2018-03-01T21:44:48.000Z
2018-03-01T21:44:48.000Z
setup.py
PublicMapping/district-builder-config
a83fd3d8c541475b80eb056d1d3a0f297986ba63
[ "Apache-2.0" ]
null
null
null
from distutils.core import setup setup( name="district_builder_config", version="0.1.0", packages=["district_builder_config"], package_data={'': ['templates/*.j2']}, install_requires=[ 'jinja2', 'lxml', ], )
19.153846
42
0.60241
26
249
5.538462
0.807692
0.208333
0.291667
0
0
0
0
0
0
0
0
0.025907
0.2249
249
12
43
20.75
0.720207
0
0
0
0
0
0.301205
0.184739
0
0
0
0
0
1
0
true
0
0.090909
0
0.090909
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
48e39fdcd0c968124ac508cfc46fb1d14ee18ae9
96
py
Python
Lesson 5 Miniflow/Backpropagation/nn.py
alchemz/Self-Driving-Car-Engineer-Nanodegree
70d6ae9d741b6c53712e0099af04597dc0ba0291
[ "MIT" ]
1
2021-03-20T12:32:35.000Z
2021-03-20T12:32:35.000Z
Lesson 5 Miniflow/Backpropagation/nn.py
alchemz/Self-Driving-Car-Engineer-Nanodegree
70d6ae9d741b6c53712e0099af04597dc0ba0291
[ "MIT" ]
null
null
null
Lesson 5 Miniflow/Backpropagation/nn.py
alchemz/Self-Driving-Car-Engineer-Nanodegree
70d6ae9d741b6c53712e0099af04597dc0ba0291
[ "MIT" ]
null
null
null
import numpy as np from miniflow import * X, W, b = Input(), Input(), Input() y = Input() f= li
16
35
0.625
17
96
3.529412
0.764706
0.333333
0
0
0
0
0
0
0
0
0
0
0.208333
96
6
36
16
0.789474
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.4
0
0.4
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
5b01b43a5925ea007b714242cb2e97f79df2f191
318
py
Python
config_handler/exceptions.py
amphinicy/config-handler
3f787b569eba253bf013a4f8e7324a56153d0d2c
[ "MIT" ]
null
null
null
config_handler/exceptions.py
amphinicy/config-handler
3f787b569eba253bf013a4f8e7324a56153d0d2c
[ "MIT" ]
1
2019-04-10T13:27:32.000Z
2019-04-10T13:27:32.000Z
config_handler/exceptions.py
amphinicy/config-handler
3f787b569eba253bf013a4f8e7324a56153d0d2c
[ "MIT" ]
null
null
null
class ConfigHandlerException(Exception): """Main Config Handler Exception class""" class ConfigHandlerFileReadException(ConfigHandlerException): """Config Handler ConfigFile Read Exception class""" class ConfigHandlerNamingException(ConfigHandlerException): """Config Handler Naming Exception class"""
28.909091
61
0.795597
25
318
10.12
0.44
0.15415
0.150198
0
0
0
0
0
0
0
0
0
0.119497
318
10
62
31.8
0.903571
0.377358
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0
0
1
0
1
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
1
0
0
4
5b0459c3b7ef7ef2b7d03a3837c86bc10528d470
173
py
Python
lab-taxi/main.py
piotrbazan/deep-reinforcement-learning
165ab29a1d85630b7baa7ccb31a1ab91cd0c6413
[ "MIT" ]
null
null
null
lab-taxi/main.py
piotrbazan/deep-reinforcement-learning
165ab29a1d85630b7baa7ccb31a1ab91cd0c6413
[ "MIT" ]
null
null
null
lab-taxi/main.py
piotrbazan/deep-reinforcement-learning
165ab29a1d85630b7baa7ccb31a1ab91cd0c6413
[ "MIT" ]
null
null
null
from agent import * from monitor import interact import gym import numpy as np env = gym.make('Taxi-v2') agent = Sarsa() avg_rewards, best_avg_reward = interact(env, agent)
21.625
51
0.763006
28
173
4.607143
0.642857
0
0
0
0
0
0
0
0
0
0
0.006757
0.144509
173
8
51
21.625
0.864865
0
0
0
0
0
0.04023
0
0
0
0
0
0
1
0
false
0
0.571429
0
0.571429
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
5b095a6e5b2e6b4226aeb79c336118f61aed7522
211
py
Python
301-400/381-390/389-findTheDifference/findTheDifference.py
xuychen/Leetcode
c8bf33af30569177c5276ffcd72a8d93ba4c402a
[ "MIT" ]
null
null
null
301-400/381-390/389-findTheDifference/findTheDifference.py
xuychen/Leetcode
c8bf33af30569177c5276ffcd72a8d93ba4c402a
[ "MIT" ]
null
null
null
301-400/381-390/389-findTheDifference/findTheDifference.py
xuychen/Leetcode
c8bf33af30569177c5276ffcd72a8d93ba4c402a
[ "MIT" ]
null
null
null
class Solution(object): def findTheDifference(self, s, t): """ :type s: str :type t: str :rtype: str """ return chr(reduce(lambda a, b: a ^ ord(b), s + t, 0))
23.444444
61
0.473934
28
211
3.571429
0.678571
0.04
0
0
0
0
0
0
0
0
0
0.007576
0.374408
211
9
61
23.444444
0.75
0.175355
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
5b2386fcb0b3e8b285fc398f98e7d07a722a8b64
215
py
Python
tests/context.py
alethiophile/openakun
6e9a6aee403c3b94dd3e323ff39a6bdfd80e2374
[ "MIT" ]
null
null
null
tests/context.py
alethiophile/openakun
6e9a6aee403c3b94dd3e323ff39a6bdfd80e2374
[ "MIT" ]
null
null
null
tests/context.py
alethiophile/openakun
6e9a6aee403c3b94dd3e323ff39a6bdfd80e2374
[ "MIT" ]
null
null
null
import os, sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) os.environ['OPENAKUN_TESTING'] = '1' import openakun.pages as pages
30.714286
74
0.562791
27
215
4.296296
0.592593
0.155172
0
0
0
0
0
0
0
0
0
0.013072
0.288372
215
6
75
35.833333
0.745098
0
0
0
0
0
0.088372
0
0
0
0
0
0
1
0
true
0
0.4
0
0.4
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
d2ef21259f46a9a9c179cd80888c657a70a2e47d
89
py
Python
src/Server/backend/GnC/apps.py
tejpratap545/denselight_system
af927da71113e48c9673e3f72623f1f28785ae7c
[ "Apache-2.0" ]
null
null
null
src/Server/backend/GnC/apps.py
tejpratap545/denselight_system
af927da71113e48c9673e3f72623f1f28785ae7c
[ "Apache-2.0" ]
null
null
null
src/Server/backend/GnC/apps.py
tejpratap545/denselight_system
af927da71113e48c9673e3f72623f1f28785ae7c
[ "Apache-2.0" ]
null
null
null
from django.apps import AppConfig class GncConfig(AppConfig): name = "backend.GnC"
14.833333
33
0.741573
11
89
6
0.909091
0
0
0
0
0
0
0
0
0
0
0
0.168539
89
5
34
17.8
0.891892
0
0
0
0
0
0.123596
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
9623396c4d30354ea50b7124a5736fecdcb321a7
646
py
Python
tests/test_utils.py
Copper-Head/RoboSanta
1e9ca5d7c21bc8e893dcb6f25e9c6baadfe08ba4
[ "MIT" ]
null
null
null
tests/test_utils.py
Copper-Head/RoboSanta
1e9ca5d7c21bc8e893dcb6f25e9c6baadfe08ba4
[ "MIT" ]
1
2019-12-16T10:48:16.000Z
2019-12-16T10:48:16.000Z
tests/test_utils.py
iliakur/RoboSanta
1e9ca5d7c21bc8e893dcb6f25e9c6baadfe08ba4
[ "MIT" ]
null
null
null
from fileIO import experiment_item_name def test_experiment_item_name(): path = "some-file.lp" assert experiment_item_name(path) == "some-file" nested_path = "/some-dir/some-file.lp" assert experiment_item_name(nested_path) == "some-file" different_extension = "some-file.txt" assert experiment_item_name(different_extension) == "some-file" many_extensions = "some-file.txt.lp" assert experiment_item_name(many_extensions) == "some-file.txt" hidden_path = "/some-dir/.hidden" assert experiment_item_name(hidden_path) == ".hidden" empty_path = "" assert experiment_item_name(empty_path) == ""
30.761905
67
0.719814
85
646
5.152941
0.258824
0.255708
0.328767
0.328767
0.406393
0.232877
0.155251
0
0
0
0
0
0.157895
646
20
68
32.3
0.805147
0
0
0
0
0
0.196594
0.034056
0
0
0
0
0.428571
1
0.071429
false
0
0.071429
0
0.142857
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
82593e4646811dacb505111ef4336f562e786178
1,356
py
Python
cirq/ion/ion_gates.py
alexisshaw/Cirq
f907314fdce765c433206d6ad3c4cff02df07cd9
[ "Apache-2.0" ]
1
2020-07-16T07:09:10.000Z
2020-07-16T07:09:10.000Z
cirq/ion/ion_gates.py
alexisshaw/Cirq
f907314fdce765c433206d6ad3c4cff02df07cd9
[ "Apache-2.0" ]
null
null
null
cirq/ion/ion_gates.py
alexisshaw/Cirq
f907314fdce765c433206d6ad3c4cff02df07cd9
[ "Apache-2.0" ]
null
null
null
# Copyright 2018 The Cirq Developers # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Operations native to iontrap systems.""" import numpy as np from cirq import ops def ms(rads: float) -> ops.XXPowGate: """The Mølmer–Sørensen gate, a native two-qubit operation in ion traps. A rotation around the XX axis in the two-qubit bloch sphere. The gate implements the following unitary: exp(-i t XX) = [ cos(t) 0 0 -isin(t)] [ 0 cos(t) -isin(t) 0 ] [ 0 -isin(t) cos(t) 0 ] [-isin(t) 0 0 cos(t) ] Args: rads: The rotation angle in radians. Returns: Mølmer–Sørensen gate rotating by the desired amount. """ return ops.XXPowGate(exponent=rads * 2 / np.pi, global_shift=-0.5)
33.073171
75
0.634218
198
1,356
4.348485
0.570707
0.069686
0.010453
0.037166
0.018583
0
0
0
0
0
0
0.019527
0.282448
1,356
40
76
33.9
0.863309
0.822271
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.5
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
0
1
0
0
4
82612217373354876b13477c4703bf972232dbe2
66
py
Python
tonga/services/consumer/__init__.py
Qotto/tonga
a6ae223ebf0fb7b317118b762102f1909435d1cf
[ "MIT" ]
1
2019-12-17T10:06:03.000Z
2019-12-17T10:06:03.000Z
tonga/services/consumer/__init__.py
Qotto/tonga
a6ae223ebf0fb7b317118b762102f1909435d1cf
[ "MIT" ]
1
2019-07-04T15:22:58.000Z
2019-07-05T07:23:31.000Z
tonga/services/consumer/__init__.py
Qotto/tonga
a6ae223ebf0fb7b317118b762102f1909435d1cf
[ "MIT" ]
2
2019-06-05T15:40:49.000Z
2019-12-10T09:24:23.000Z
#!/usr/bin/env python # coding: utf-8 # Copyright (c) Qotto, 2019
16.5
27
0.666667
11
66
4
1
0
0
0
0
0
0
0
0
0
0
0.089286
0.151515
66
3
28
22
0.696429
0.909091
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
82694872601c915d96e15a32375bdbef43a5183a
970
py
Python
app.py
pwentrys/app_factory
17081ef7c8e5867f33323d2f78880f8657693d3c
[ "MIT" ]
null
null
null
app.py
pwentrys/app_factory
17081ef7c8e5867f33323d2f78880f8657693d3c
[ "MIT" ]
null
null
null
app.py
pwentrys/app_factory
17081ef7c8e5867f33323d2f78880f8657693d3c
[ "MIT" ]
null
null
null
# --------------------------------------------------------------------------- # # # # Core Imports # # # # --------------------------------------------------------------------------- # from config.configuration import DEBUG, NAME, IP, PORT, THREADED from flaskfactory import FlaskFactory as Factory # --------------------------------------------------------------------------- # # # # Default Configuration # # # # --------------------------------------------------------------------------- # app = Factory.create(NAME, IP, PORT, DEBUG, THREADED)
60.625
79
0.170103
27
970
6.111111
0.62963
0.072727
0.121212
0
0
0
0
0
0
0
0
0
0.486598
970
15
80
64.666667
0.331325
0.791753
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
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
8273757df88786f297c61ff04cedfdae61e481d7
300
py
Python
tdd/chap1/superlists/lists/views.py
peter-wangxu/python_play
5774c192a49ea0c35504697dd75e1c2c8e366097
[ "Apache-2.0" ]
null
null
null
tdd/chap1/superlists/lists/views.py
peter-wangxu/python_play
5774c192a49ea0c35504697dd75e1c2c8e366097
[ "Apache-2.0" ]
null
null
null
tdd/chap1/superlists/lists/views.py
peter-wangxu/python_play
5774c192a49ea0c35504697dd75e1c2c8e366097
[ "Apache-2.0" ]
null
null
null
from django.shortcuts import render from django.http import HttpResponse # Create your views here. def home_page(request): if request.method == 'POST': return render(request, 'home.html', {'new_item_text': request.POST['item_text']}) return render(request, 'home.html')
30
57
0.69
39
300
5.205128
0.589744
0.098522
0.187192
0.226601
0.26601
0
0
0
0
0
0
0
0.19
300
9
58
33.333333
0.835391
0.076667
0
0
0
0
0.16
0
0
0
0
0
0
1
0.142857
false
0
0.285714
0
0.714286
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
4
8280cecb7c7dcd1eedb6b5aa0ff542a5d44743f8
172
py
Python
app/secure.py
ttkltll/fisher
8889705c7bde10304cfde7972b805226ac59d735
[ "MIT" ]
null
null
null
app/secure.py
ttkltll/fisher
8889705c7bde10304cfde7972b805226ac59d735
[ "MIT" ]
3
2020-09-15T23:37:18.000Z
2020-09-16T00:36:55.000Z
app/secure.py
ttkltll/fisher
8889705c7bde10304cfde7972b805226ac59d735
[ "MIT" ]
1
2020-09-15T02:55:54.000Z
2020-09-15T02:55:54.000Z
DEBUG = True SECRET_KEY = "iECgbYWReMNxkRprrzMo5KAQYnb2UeZ3bwvReTSt+VSESW0OB8zbglT+6rEcDW9X" SQLALCHEMY_DATABASE_URI = "mysql+pymysql://root:999999@127.0.0.1:3306/fisher"
34.4
79
0.825581
20
172
6.95
0.95
0
0
0
0
0
0
0
0
0
0
0.141975
0.05814
172
4
80
43
0.716049
0
0
0
0
0
0.656977
0.656977
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
8286e87e74c0a3b6aaf9f7f538e426e74f579609
2,696
py
Python
tests/chadlib/utility/test_hex_math.py
cjreynol/chadlib
e417a6c5b100b7124a7d9b61d0120b3caa897bb8
[ "MIT" ]
1
2021-08-06T21:56:52.000Z
2021-08-06T21:56:52.000Z
tests/chadlib/utility/test_hex_math.py
cjreynol/chadlib
e417a6c5b100b7124a7d9b61d0120b3caa897bb8
[ "MIT" ]
null
null
null
tests/chadlib/utility/test_hex_math.py
cjreynol/chadlib
e417a6c5b100b7124a7d9b61d0120b3caa897bb8
[ "MIT" ]
null
null
null
from unittest import TestCase from chadlib.utility.hex_math import * class TestHexMath(TestCase): def setUp(self): self.position0 = (0, 0, 0) self.position1 = (3, 2, -5) self.cubic_positions = [self.position0, self.position1] self.axial_positions = [cubic_to_axial(*pos) for pos in self.cubic_positions] def tearDown(self): pass def test_cubic_to_axial_to_cubic(self): for pos in self.cubic_positions: axial = cubic_to_axial(*self.position0) cubic = axial_to_cubic(*axial) self.assertTupleEqual(self.position0, cubic) def test_cubic_inverse_movements(self): for pos in self.cubic_positions: self.assertTupleEqual(pos, cubic_north(*cubic_south(*pos))) self.assertTupleEqual(pos, cubic_south(*cubic_north(*pos))) self.assertTupleEqual(pos, cubic_northeast(*cubic_southwest(*pos))) self.assertTupleEqual(pos, cubic_southwest(*cubic_northeast(*pos))) self.assertTupleEqual(pos, cubic_northwest(*cubic_southeast(*pos))) self.assertTupleEqual(pos, cubic_southeast(*cubic_northwest(*pos))) self.assertTupleEqual(pos, cubic_east(*cubic_west(*pos))) self.assertTupleEqual(pos, cubic_west(*cubic_east(*pos))) def test_axial_inverse_movements(self): for pos in self.axial_positions: self.assertTupleEqual(pos, axial_north(*axial_south(*pos))) self.assertTupleEqual(pos, axial_south(*axial_north(*pos))) self.assertTupleEqual(pos, axial_northeast(*axial_southwest(*pos))) self.assertTupleEqual(pos, axial_southwest(*axial_northeast(*pos))) self.assertTupleEqual(pos, axial_northwest(*axial_southeast(*pos))) self.assertTupleEqual(pos, axial_southeast(*axial_northwest(*pos))) self.assertTupleEqual(pos, axial_east(*axial_west(*pos))) self.assertTupleEqual(pos, axial_west(*axial_east(*pos))) def test_cubic_n_inverse_movement(self): n = 10 for pos in self.cubic_positions: self.assertTupleEqual(pos, cubic_n_moves(cubic_north, n, *cubic_n_moves(cubic_south, n, *pos))) def test_axial_n_inverse_movement(self): n = 10 for pos in self.axial_positions: self.assertTupleEqual(pos, axial_n_moves(axial_north, n, *axial_n_moves(axial_south, n, *pos))) def test_cubic_validation(self): for pos in self.cubic_positions: self.assertTrue(is_valid_cubic_coord(*pos))
40.238806
79
0.642804
312
2,696
5.285256
0.157051
0.230443
0.251061
0.22074
0.580958
0.23772
0.221953
0.181928
0.158884
0.158884
0
0.007948
0.253338
2,696
66
80
40.848485
0.811227
0
0
0.163265
0
0
0
0
0
0
0
0
0.408163
1
0.163265
false
0.020408
0.040816
0
0.22449
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
82d56627eeab3ffbe585d54cc8f75f3c576e1b38
953
py
Python
Products/CMFDefault/browser/membership/tests/test_password.py
zopefoundation/Products.CMFDefault
a176d9aac5a7e04725dbd0f7b76c6ac357062139
[ "ZPL-2.1" ]
null
null
null
Products/CMFDefault/browser/membership/tests/test_password.py
zopefoundation/Products.CMFDefault
a176d9aac5a7e04725dbd0f7b76c6ac357062139
[ "ZPL-2.1" ]
5
2017-07-13T00:51:25.000Z
2021-02-04T15:08:39.000Z
Products/CMFDefault/browser/membership/tests/test_password.py
zopefoundation/Products.CMFDefault
a176d9aac5a7e04725dbd0f7b76c6ac357062139
[ "ZPL-2.1" ]
3
2017-07-08T03:22:35.000Z
2018-05-20T06:42:03.000Z
############################################################################## # # Copyright (c) 2010 Zope Foundation and Contributors. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """ Test Products.CMFDefault.browser.password """ import unittest from Testing import ZopeTestCase from Products.CMFDefault.testing import FunctionalLayer ftest_suite = ZopeTestCase.FunctionalDocFileSuite('password.txt') ftest_suite.layer = FunctionalLayer def test_suite(): return unittest.TestSuite(( ftest_suite, ))
32.862069
78
0.644281
102
953
5.980392
0.656863
0.04918
0.045902
0
0
0
0
0
0
0
0
0.007255
0.132214
953
28
79
34.035714
0.730351
0.500525
0
0
0
0
0.039604
0
0
0
0
0
0
1
0.111111
false
0.111111
0.333333
0.111111
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
0
0
1
1
1
1
0
0
4
7d5a78f6c67bd1f330633bff6ded50e2ddfe0ba1
116
py
Python
Chapter 4, Working with lists/Dimensions.py
EdgarCastillo101/Crash-Course-Python-2nd-edition
484c9096076c0ba69b1b9d78c6c974064fc1eda3
[ "MIT" ]
null
null
null
Chapter 4, Working with lists/Dimensions.py
EdgarCastillo101/Crash-Course-Python-2nd-edition
484c9096076c0ba69b1b9d78c6c974064fc1eda3
[ "MIT" ]
null
null
null
Chapter 4, Working with lists/Dimensions.py
EdgarCastillo101/Crash-Course-Python-2nd-edition
484c9096076c0ba69b1b9d78c6c974064fc1eda3
[ "MIT" ]
null
null
null
dimensions = (200, 50) print(dimensions[0]) print(dimensions[1]) for dimension in dimensions: print(dimension)
16.571429
28
0.732759
15
116
5.666667
0.6
0.352941
0
0
0
0
0
0
0
0
0
0.07
0.137931
116
6
29
19.333333
0.78
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0.6
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
4
7d6c22baeb76c6b284171db438291f9c73274cbd
158
py
Python
tests/web_platform/css_grid_1/placement/test_grid_layout_grid_span.py
fletchgraham/colosseum
77be4896ee52b8f5956a3d77b5f2ccd2c8608e8f
[ "BSD-3-Clause" ]
null
null
null
tests/web_platform/css_grid_1/placement/test_grid_layout_grid_span.py
fletchgraham/colosseum
77be4896ee52b8f5956a3d77b5f2ccd2c8608e8f
[ "BSD-3-Clause" ]
null
null
null
tests/web_platform/css_grid_1/placement/test_grid_layout_grid_span.py
fletchgraham/colosseum
77be4896ee52b8f5956a3d77b5f2ccd2c8608e8f
[ "BSD-3-Clause" ]
1
2020-01-16T01:56:41.000Z
2020-01-16T01:56:41.000Z
from tests.utils import W3CTestCase class TestGridLayoutGridSpan(W3CTestCase): vars().update(W3CTestCase.find_tests(__file__, 'grid-layout-grid-span'))
26.333333
76
0.797468
18
158
6.722222
0.777778
0
0
0
0
0
0
0
0
0
0
0.020833
0.088608
158
5
77
31.6
0.819444
0
0
0
0
0
0.133758
0.133758
0
0
0
0
0
1
0
true
0
0.333333
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
7d729d85a98251daea415fb32ab2c34067197ac1
47
py
Python
gunmel/__init__.py
zhenkai/xgunicorn
33fc122fdc9435ba0b6562186d3c86d983eb992a
[ "Apache-2.0" ]
null
null
null
gunmel/__init__.py
zhenkai/xgunicorn
33fc122fdc9435ba0b6562186d3c86d983eb992a
[ "Apache-2.0" ]
null
null
null
gunmel/__init__.py
zhenkai/xgunicorn
33fc122fdc9435ba0b6562186d3c86d983eb992a
[ "Apache-2.0" ]
1
2020-03-03T04:04:56.000Z
2020-03-03T04:04:56.000Z
default_app_config = 'gunmel.apps.GunmelConfig'
47
47
0.851064
6
47
6.333333
1
0
0
0
0
0
0
0
0
0
0
0
0.042553
47
1
47
47
0.844444
0
0
0
0
0
0.5
0.5
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
7d94251483a50c8aa6ab8c10c219bd54c68dc27e
130
py
Python
my_test.py
CT-assignments-S20-E/farm-problem-natanbrook
230b113a674a5af0c0fea60b790ea39ae1fef131
[ "Apache-2.0" ]
null
null
null
my_test.py
CT-assignments-S20-E/farm-problem-natanbrook
230b113a674a5af0c0fea60b790ea39ae1fef131
[ "Apache-2.0" ]
null
null
null
my_test.py
CT-assignments-S20-E/farm-problem-natanbrook
230b113a674a5af0c0fea60b790ea39ae1fef131
[ "Apache-2.0" ]
1
2020-05-28T14:46:21.000Z
2020-05-28T14:46:21.000Z
from my_code import legs def test_inc(): assert 20 == legs(2,2,2) assert 34 == legs(5,2,4) assert 22 == legs(1,3,2)
16.25
28
0.592308
26
130
2.884615
0.653846
0.053333
0
0
0
0
0
0
0
0
0
0.153061
0.246154
130
7
29
18.571429
0.612245
0
0
0
0
0
0
0
0
0
0
0
0.6
1
0.2
true
0
0.2
0
0.4
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
1
0
0
0
0
0
0
4
7db3d422b2d20a3a1284dae52404eb114c7e72c3
62
py
Python
lmtuners/models/__init__.py
shoarora/polytune
86f31ba3f41ea47edcfa0442a29a79a2a46deaeb
[ "MIT" ]
2
2020-09-17T10:12:36.000Z
2020-11-22T16:34:08.000Z
lmtuners/models/__init__.py
shoarora/polytune
86f31ba3f41ea47edcfa0442a29a79a2a46deaeb
[ "MIT" ]
null
null
null
lmtuners/models/__init__.py
shoarora/polytune
86f31ba3f41ea47edcfa0442a29a79a2a46deaeb
[ "MIT" ]
null
null
null
from .albert import AlbertForTokenClassification # noqa: 401
31
61
0.822581
6
62
8.5
1
0
0
0
0
0
0
0
0
0
0
0.055556
0.129032
62
1
62
62
0.888889
0.145161
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
7dd8a6371d1d52668aaf08043b62f34886f3abaf
134
py
Python
iioy/movies/external/data_sources/__init__.py
tizz98/iioy-v4
64d12fafb3c758f8291c6f577aba203932c44cbd
[ "MIT" ]
null
null
null
iioy/movies/external/data_sources/__init__.py
tizz98/iioy-v4
64d12fafb3c758f8291c6f577aba203932c44cbd
[ "MIT" ]
2
2020-06-05T18:23:54.000Z
2021-03-19T22:02:23.000Z
iioy/movies/external/data_sources/__init__.py
tizz98/iioy-v4
64d12fafb3c758f8291c6f577aba203932c44cbd
[ "MIT" ]
null
null
null
# flake8: noqa from .tmdb import ( TmdbMovieAdapter, TmdbMovieCastAdapter, TmdbMovieListAdapter, TmdbPersonAdapter, )
16.75
25
0.723881
9
134
10.777778
1
0
0
0
0
0
0
0
0
0
0
0.009434
0.208955
134
7
26
19.142857
0.90566
0.089552
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.166667
0
0.166667
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
1
0
0
0
0
0
0
4
7dd8de4089dd9251588b49f9d3dfa7d324619338
164
py
Python
data/wind/wind.py
QUANTAXIS/quant
d3b76799b20cac7a876fbdeb6f97c48295dde06f
[ "MIT" ]
null
null
null
data/wind/wind.py
QUANTAXIS/quant
d3b76799b20cac7a876fbdeb6f97c48295dde06f
[ "MIT" ]
null
null
null
data/wind/wind.py
QUANTAXIS/quant
d3b76799b20cac7a876fbdeb6f97c48295dde06f
[ "MIT" ]
1
2021-04-10T07:10:42.000Z
2021-04-10T07:10:42.000Z
from WindPy import * w.start() from datetime import datetime #前复权:复权后价格=[(复权前价格-现金红利)+配(新)股价格×流通股份变动比例]÷(1+流通股份变动比例) #后复权:复权后价格=复权前价格×(1+流通股份变动比例)+现金红利 import talib
27.333333
55
0.756098
30
164
4.233333
0.633333
0.15748
0
0
0
0
0
0
0
0
0
0.013158
0.073171
164
6
56
27.333333
0.802632
0.530488
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.75
0
0.75
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
817c38b3b2acfbd538ca61f855a6810f414983b1
917
py
Python
editor_api/database/output/aquifer.py
jphuart/swatplus-automatic-workflow
dd2eeb7f882eb2d4ab7e1e5265c10b9beb93ddc4
[ "MIT" ]
8
2020-06-28T07:50:29.000Z
2022-01-05T16:29:48.000Z
editor_api/database/output/aquifer.py
jphuart/swatplus-automatic-workflow
dd2eeb7f882eb2d4ab7e1e5265c10b9beb93ddc4
[ "MIT" ]
null
null
null
editor_api/database/output/aquifer.py
jphuart/swatplus-automatic-workflow
dd2eeb7f882eb2d4ab7e1e5265c10b9beb93ddc4
[ "MIT" ]
5
2020-06-28T07:50:31.000Z
2021-08-16T07:09:59.000Z
from peewee import * from .base import OutputBase class Aquifer(OutputBase): flo = DoubleField(null=True) stor = DoubleField(null=True) rchrg = DoubleField(null=True) seep = DoubleField(null=True) revap = DoubleField(null=True) dep_wt = DoubleField(null=True) no3_st = DoubleField(null=True) min = DoubleField(null=True) orgn = DoubleField(null=True) orgp = DoubleField(null=True) rchrgn = DoubleField(null=True) nloss = DoubleField(null=True) no3gw = DoubleField(null=True) seepno3 = DoubleField(null=True) flo_cha = DoubleField(null=True) flo_res = DoubleField(null=True) flo_ls = DoubleField(null=True) class Basin_aqu_day(Aquifer): pass class Basin_aqu_mon(Aquifer): pass class Basin_aqu_yr(Aquifer): pass class Basin_aqu_aa(Aquifer): pass class Aquifer_day(Aquifer): pass class Aquifer_mon(Aquifer): pass class Aquifer_yr(Aquifer): pass class Aquifer_aa(Aquifer): pass
16.672727
33
0.754635
127
917
5.314961
0.283465
0.377778
0.478519
0.136296
0.106667
0
0
0
0
0
0
0.003802
0.139586
917
54
34
16.981481
0.851711
0
0
0.222222
0
0
0
0
0
0
0
0
0
1
0
false
0.222222
0.055556
0
0.777778
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
4
81828806966f4f5e182b92f3a3c4e469b4cc7662
306
py
Python
problems/dividenconquer/Solution240.py
akalu/cs-problems-python
9b1bd8e3932be62135a38a77f955ded9a766b654
[ "MIT" ]
null
null
null
problems/dividenconquer/Solution240.py
akalu/cs-problems-python
9b1bd8e3932be62135a38a77f955ded9a766b654
[ "MIT" ]
null
null
null
problems/dividenconquer/Solution240.py
akalu/cs-problems-python
9b1bd8e3932be62135a38a77f955ded9a766b654
[ "MIT" ]
null
null
null
""" Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted in ascending from left to right. Integers in each column are sorted in ascending from top to bottom. """ class Solution240: pass
27.818182
80
0.722222
48
306
4.604167
0.729167
0.090498
0.126697
0.180995
0.217195
0
0
0
0
0
0
0.012931
0.24183
306
10
81
30.6
0.939655
0.816993
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
4
81988d660e9694fc9b4a2171b2b15e0828c2e1e6
206
py
Python
gans/utils/data_utils.py
tlatkowski/gans-2.0
974efc5bbcea39c0a7dec9405ba4514ada6dc39c
[ "MIT" ]
78
2019-09-25T15:09:18.000Z
2022-02-09T09:56:15.000Z
gans/utils/data_utils.py
tlatkowski/gans-2.0
974efc5bbcea39c0a7dec9405ba4514ada6dc39c
[ "MIT" ]
23
2019-10-09T21:24:39.000Z
2022-03-12T00:00:53.000Z
gans/utils/data_utils.py
tlatkowski/gans-2.0
974efc5bbcea39c0a7dec9405ba4514ada6dc39c
[ "MIT" ]
18
2020-01-24T13:13:57.000Z
2022-02-15T18:58:12.000Z
def normalize_inputs(data): """ Normalizes the inputs to [-1, 1] :param data: input data array :return: normalized data to [-1, 1] """ data = (data - 127.5) / 127.5 return data
20.6
39
0.57767
29
206
4.068966
0.517241
0.050847
0.067797
0
0
0
0
0
0
0
0
0.081633
0.286408
206
9
40
22.888889
0.721088
0.480583
0
0
0
0
0
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
81db3652bf57d9462b69f466dc7642f0e7f66cf5
4,602
py
Python
samples/client/petstore/python-experimental/petstore_api/models/__init__.py
tek08/openapi-generator
5d14b46a5e305b8f1c541b1d6d96751f0626e363
[ "Apache-2.0" ]
null
null
null
samples/client/petstore/python-experimental/petstore_api/models/__init__.py
tek08/openapi-generator
5d14b46a5e305b8f1c541b1d6d96751f0626e363
[ "Apache-2.0" ]
null
null
null
samples/client/petstore/python-experimental/petstore_api/models/__init__.py
tek08/openapi-generator
5d14b46a5e305b8f1c541b1d6d96751f0626e363
[ "Apache-2.0" ]
null
null
null
# coding: utf-8 # flake8: noqa <<<<<<< HEAD # import all models into this package # if you have many models here with many references from one model to another this may # raise a RecursionError # to avoid this, import only the models that you directly need like: # from from petstore_api.model.pet import Pet # or import this package, but before doing it, use: # import sys # sys.setrecursionlimit(n) from petstore_api.model.additional_properties_any_type import AdditionalPropertiesAnyType from petstore_api.model.additional_properties_array import AdditionalPropertiesArray from petstore_api.model.additional_properties_boolean import AdditionalPropertiesBoolean from petstore_api.model.additional_properties_class import AdditionalPropertiesClass from petstore_api.model.additional_properties_integer import AdditionalPropertiesInteger from petstore_api.model.additional_properties_number import AdditionalPropertiesNumber from petstore_api.model.additional_properties_object import AdditionalPropertiesObject from petstore_api.model.additional_properties_string import AdditionalPropertiesString from petstore_api.model.animal import Animal from petstore_api.model.animal_farm import AnimalFarm from petstore_api.model.api_response import ApiResponse from petstore_api.model.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly from petstore_api.model.array_of_number_only import ArrayOfNumberOnly from petstore_api.model.array_test import ArrayTest from petstore_api.model.capitalization import Capitalization from petstore_api.model.cat import Cat from petstore_api.model.cat_all_of import CatAllOf from petstore_api.model.category import Category from petstore_api.model.child import Child from petstore_api.model.child_all_of import ChildAllOf from petstore_api.model.child_cat import ChildCat from petstore_api.model.child_cat_all_of import ChildCatAllOf from petstore_api.model.child_dog import ChildDog from petstore_api.model.child_dog_all_of import ChildDogAllOf from petstore_api.model.child_lizard import ChildLizard from petstore_api.model.child_lizard_all_of import ChildLizardAllOf from petstore_api.model.class_model import ClassModel from petstore_api.model.client import Client from petstore_api.model.dog import Dog from petstore_api.model.dog_all_of import DogAllOf from petstore_api.model.enum_arrays import EnumArrays from petstore_api.model.enum_class import EnumClass from petstore_api.model.enum_test import EnumTest from petstore_api.model.file import File from petstore_api.model.file_schema_test_class import FileSchemaTestClass from petstore_api.model.format_test import FormatTest from petstore_api.model.grandparent import Grandparent from petstore_api.model.grandparent_animal import GrandparentAnimal from petstore_api.model.has_only_read_only import HasOnlyReadOnly from petstore_api.model.list import List from petstore_api.model.map_test import MapTest from petstore_api.model.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass from petstore_api.model.model200_response import Model200Response from petstore_api.model.model_return import ModelReturn from petstore_api.model.name import Name from petstore_api.model.number_only import NumberOnly from petstore_api.model.order import Order from petstore_api.model.outer_composite import OuterComposite from petstore_api.model.outer_enum import OuterEnum from petstore_api.model.outer_number import OuterNumber from petstore_api.model.parent import Parent from petstore_api.model.parent_all_of import ParentAllOf from petstore_api.model.parent_pet import ParentPet from petstore_api.model.pet import Pet from petstore_api.model.player import Player from petstore_api.model.read_only_first import ReadOnlyFirst from petstore_api.model.special_model_name import SpecialModelName from petstore_api.model.string_boolean_map import StringBooleanMap from petstore_api.model.tag import Tag from petstore_api.model.type_holder_default import TypeHolderDefault from petstore_api.model.type_holder_example import TypeHolderExample from petstore_api.model.user import User from petstore_api.model.xml_item import XmlItem ======= """ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ # we can not import model classes here because that would create a circular # reference which would not work in python2 >>>>>>> ooof
50.021739
174
0.867232
654
4,602
5.876147
0.281346
0.199844
0.249805
0.333073
0.32917
0.174863
0.016654
0
0
0
0
0.003582
0.089961
4,602
91
175
50.571429
0.91404
0.104954
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0.954545
null
null
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
1
0
0
0
1
0
0
0
0
4
81e3bbb4ae6386583c41a13ddddbfd94118b0e75
171
py
Python
Business_Coaching_Platform/dedicated_page/forms.py
SDOS2020/Team_1_Business_Coaching_Platform
0b61f67ce3158cf727d3570daf60bff1b0417360
[ "MIT" ]
null
null
null
Business_Coaching_Platform/dedicated_page/forms.py
SDOS2020/Team_1_Business_Coaching_Platform
0b61f67ce3158cf727d3570daf60bff1b0417360
[ "MIT" ]
30
2020-11-23T22:09:51.000Z
2020-12-21T21:55:04.000Z
Business_Coaching_Platform/dedicated_page/forms.py
SDOS2020/Team_1_Business_Coaching_Platform
0b61f67ce3158cf727d3570daf60bff1b0417360
[ "MIT" ]
null
null
null
from django import forms from .models import Post class customForm(forms.Form): content = forms.CharField(required=False) pk = forms.IntegerField(required=False)
24.428571
45
0.766082
22
171
5.954545
0.681818
0.198473
0
0
0
0
0
0
0
0
0
0
0.146199
171
6
46
28.5
0.89726
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.4
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
c49d9e427ad4cce7a6f8fba4fac50d65a3820781
168
py
Python
reddit2telegram/channels/~inactive/r_hermitcraft/app.py
CaringCat/reddit2telegram
aa3195d9964dfe0f5d822b37a41d567d1af423b7
[ "MIT" ]
187
2016-09-20T09:15:54.000Z
2022-03-29T12:22:33.000Z
reddit2telegram/channels/~inactive/r_hermitcraft/app.py
CaringCat/reddit2telegram
aa3195d9964dfe0f5d822b37a41d567d1af423b7
[ "MIT" ]
84
2016-09-22T14:25:07.000Z
2022-03-19T01:26:17.000Z
reddit2telegram/channels/~inactive/r_hermitcraft/app.py
CaringCat/reddit2telegram
aa3195d9964dfe0f5d822b37a41d567d1af423b7
[ "MIT" ]
172
2016-09-21T15:39:39.000Z
2022-03-16T15:15:58.000Z
#encoding:utf-8 subreddit = 'HermitCraft' t_channel = '@r_HermitCraft' def send_post(submission, r2t): return r2t.send_simple(submission, min_upvotes_limit=100)
18.666667
61
0.767857
23
168
5.347826
0.826087
0
0
0
0
0
0
0
0
0
0
0.040541
0.119048
168
8
62
21
0.790541
0.083333
0
0
0
0
0.163399
0
0
0
0
0
0
1
0.25
false
0
0
0.25
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
4
c4bded62f8176ca710884248045625ece952f747
731
py
Python
utils/graphql/scalars.py
getmetamapper/metamapper
0b2f67eec03fbf7ece35ff9f58ea9bb2dde4d85f
[ "BSD-2-Clause" ]
53
2020-07-01T23:11:59.000Z
2022-03-31T19:10:28.000Z
utils/graphql/scalars.py
metamapper-io/metamapper
376716e72bcaca62f1ec09ca9a13a0346e5502f9
[ "BSD-2-Clause" ]
5
2020-11-25T19:48:57.000Z
2022-02-27T23:50:18.000Z
utils/graphql/scalars.py
metamapper-io/metamapper
376716e72bcaca62f1ec09ca9a13a0346e5502f9
[ "BSD-2-Clause" ]
5
2020-08-29T16:43:59.000Z
2022-01-17T19:05:30.000Z
# -*- coding: utf-8 -*- import graphene class Upload(graphene.types.Scalar): """Create scalar that ignores normal serialization/deserialization, since that will be handled by the multipart request spec""" @staticmethod def serialize(value): return value @staticmethod def parse_literal(node): return node @staticmethod def parse_value(value): return value class JSONObject(graphene.types.Scalar): """Handle serialization/deserialization of a JSON object. """ @staticmethod def serialize(value): return value @staticmethod def parse_literal(node): return node @staticmethod def parse_value(value): return value
20.305556
77
0.666211
79
731
6.113924
0.481013
0.186335
0.132505
0.120083
0.505176
0.505176
0.505176
0.505176
0.505176
0.505176
0
0.001832
0.253078
731
35
78
20.885714
0.882784
0.27907
0
0.857143
0
0
0
0
0
0
0
0
0
1
0.285714
false
0
0.047619
0.285714
0.714286
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4
c4d81ddbca265a219fed65029e926604be03fcbc
195
py
Python
pythonCore/ch04/E06.py
Furzoom/learnpython
a3034584e481d4e7c55912d9da06439688aa67ea
[ "MIT" ]
null
null
null
pythonCore/ch04/E06.py
Furzoom/learnpython
a3034584e481d4e7c55912d9da06439688aa67ea
[ "MIT" ]
null
null
null
pythonCore/ch04/E06.py
Furzoom/learnpython
a3034584e481d4e7c55912d9da06439688aa67ea
[ "MIT" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- # type(a) == type(b) - whether value of type(a) is equivalent to value of type(b) # type(a) is type(b) - whether type(a) and type(b) have same type
32.5
81
0.635897
37
195
3.351351
0.513514
0.16129
0.193548
0
0
0
0
0
0
0
0
0.00625
0.179487
195
5
82
39
0.76875
0.953846
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
0
0
0
null
0
1
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
c4e33e361b16e0a3f92ccdc928d57e2b186120bb
1,299
py
Python
src/winforms/toga_winforms/widgets/tree.py
luizoti/toga
3c49e685f325f1aba2ce048b253402d7e4519f97
[ "BSD-3-Clause" ]
1,261
2019-03-31T16:28:47.000Z
2022-03-31T09:01:23.000Z
src/winforms/toga_winforms/widgets/tree.py
luizoti/toga
3c49e685f325f1aba2ce048b253402d7e4519f97
[ "BSD-3-Clause" ]
597
2019-04-02T20:02:42.000Z
2022-03-30T10:28:47.000Z
src/winforms/toga_winforms/widgets/tree.py
luizoti/toga
3c49e685f325f1aba2ce048b253402d7e4519f97
[ "BSD-3-Clause" ]
318
2019-03-31T18:32:00.000Z
2022-03-30T18:07:13.000Z
from toga_winforms.libs import WinForms from .base import Widget class Tree(Widget): def create(self): self.native = WinForms.TreeView() def row_data(self, item): self.interface.factory.not_implemented('Tree.row_data()') def on_select(self, selection): self.interface.factory.not_implemented('Tree.on_select()') def change_source(self, source): self.interface.factory.not_implemented('Tree.change_source()') def insert(self, parent, index, item): self.interface.factory.not_implemented('Tree.insert()') def change(self, item): self.interface.factory.not_implemented('Tree.change()') def remove(self, parent, index, item): self.interface.factory.not_implemented('Tree.remove()') def clear(self): self.interface.factory.not_implemented('Tree.clear()') def get_selection(self): self.interface.factory.not_implemented('Tree.get_selection()') def set_on_select(self, handler): self.interface.factory.not_implemented('Tree.set_on_select()') def set_on_double_click(self, handler): self.interface.factory.not_implemented('Table.set_on_double_click()') def scroll_to_node(self, node): self.interface.factory.not_implemented('Tree.scroll_to_node()')
30.928571
77
0.701309
165
1,299
5.315152
0.242424
0.163056
0.250855
0.288483
0.581528
0.581528
0.490308
0.234892
0.129989
0.129989
0
0
0.168591
1,299
41
78
31.682927
0.812037
0
0
0
0
0
0.146266
0.036952
0
0
0
0
0
1
0.444444
false
0
0.074074
0
0.555556
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
c4f61f81576f1be30cdfe8969732ef2af9dcec32
125
py
Python
multithread.py
kgh-85/werkzeug
0e6f5ef25552ed0a4e800de4395d780a202d2053
[ "Apache-2.0" ]
1
2022-01-12T06:58:37.000Z
2022-01-12T06:58:37.000Z
multithread.py
kgh-85/werkzeug
0e6f5ef25552ed0a4e800de4395d780a202d2053
[ "Apache-2.0" ]
null
null
null
multithread.py
kgh-85/werkzeug
0e6f5ef25552ed0a4e800de4395d780a202d2053
[ "Apache-2.0" ]
1
2022-01-11T15:12:01.000Z
2022-01-11T15:12:01.000Z
from multiprocessing import Pool, cpu_count def myFunction(func, data): p = Pool(cpu_count()) p.map(func, data)
12.5
43
0.68
18
125
4.611111
0.666667
0.168675
0.289157
0
0
0
0
0
0
0
0
0
0.208
125
9
44
13.888889
0.838384
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.25
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
1
0
0
0
0
0
0
0
4
c4fbb098a998345d64b84f320c746617f09de9cf
5,705
py
Python
seleniumbase/translate/japanese.py
kawarada-san/SeleniumBase
8e601717fdef0814aae01c6411ea0e1fb114a269
[ "MIT" ]
null
null
null
seleniumbase/translate/japanese.py
kawarada-san/SeleniumBase
8e601717fdef0814aae01c6411ea0e1fb114a269
[ "MIT" ]
null
null
null
seleniumbase/translate/japanese.py
kawarada-san/SeleniumBase
8e601717fdef0814aae01c6411ea0e1fb114a269
[ "MIT" ]
null
null
null
# Japanese Language Translations - Python 3 Only! from seleniumbase import BaseCase class セレンテストケース(BaseCase): # noqa def URLを開く(self, *args, **kwargs): # open(url) self.open(*args, **kwargs) def クリックして(self, *args, **kwargs): # click(selector) self.click(*args, **kwargs) def ダブルクリックして(self, *args, **kwargs): # double_click(selector) self.double_click(*args, **kwargs) def ゆっくりクリックして(self, *args, **kwargs): # slow_click(selector) self.slow_click(*args, **kwargs) def リンクテキストをクリックします(self, *args, **kwargs): # click_link_text(link_text) self.click_link_text(*args, **kwargs) def テキストを更新(self, *args, **kwargs): # update_text(selector, new_value) self.update_text(*args, **kwargs) def テキストを追加(self, *args, **kwargs): # add_text(selector, new_value) self.add_text(*args, **kwargs) def テキストを取得(self, *args, **kwargs): # get_text(selector, new_value) self.get_text(*args, **kwargs) def テキストを確認する(self, *args, **kwargs): # assert_text(text, selector) self.assert_text(*args, **kwargs) def 正確なテキストを確認する(self, *args, **kwargs): # assert_exact_text(text, selector) self.assert_exact_text(*args, **kwargs) def 要素を確認する(self, *args, **kwargs): # assert_element(selector) self.assert_element(*args, **kwargs) def タイトルを確認(self, *args, **kwargs): # assert_title(title) self.assert_title(*args, **kwargs) def 検証が正しい(self, *args, **kwargs): # assert_true(expr) self.assert_true(*args, **kwargs) def 検証は偽です(self, *args, **kwargs): # assert_false(expr) self.assert_false(*args, **kwargs) def 検証が等しい(self, *args, **kwargs): # assert_equal(first, second) self.assert_equal(*args, **kwargs) def 検証が等しくない(self, *args, **kwargs): # assert_not_equal(first, second) self.assert_not_equal(*args, **kwargs) def ページを更新する(self, *args, **kwargs): # refresh_page() self.refresh_page(*args, **kwargs) def 現在のURLを取得(self, *args, **kwargs): # get_current_url() self.get_current_url(*args, **kwargs) def ページのソースコードを取得する(self, *args, **kwargs): # get_page_source() self.get_page_source(*args, **kwargs) def 戻る(self, *args, **kwargs): # go_back() self.go_back(*args, **kwargs) def 進む(self, *args, **kwargs): # go_forward() self.go_forward(*args, **kwargs) def テキストが表示されています(self, *args, **kwargs): # is_text_visible(text, selector="html") self.is_text_visible(*args, **kwargs) def 要素は表示されますか(self, *args, **kwargs): # is_element_visible(selector) self.is_element_visible(*args, **kwargs) def 要素が存在するかどうか(self, *args, **kwargs): # is_element_present(selector) self.is_element_present(*args, **kwargs) def テキストを待つ(self, *args, **kwargs): # wait_for_text(text, selector) self.wait_for_text(*args, **kwargs) def 要素を待つ(self, *args, **kwargs): # wait_for_element(selector) self.wait_for_element(*args, **kwargs) def 眠る(self, *args, **kwargs): # sleep(seconds) self.sleep(*args, **kwargs) def を提出す(self, *args, **kwargs): # submit(selector) self.submit(*args, **kwargs) def JSクリックして(self, *args, **kwargs): # js_click(selector) self.js_click(*args, **kwargs) def htmlをチェック(self, *args, **kwargs): # inspect_html() self.inspect_html(*args, **kwargs) def スクリーンショットを保存(self, *args, **kwargs): # save_screenshot(name) self.save_screenshot(*args, **kwargs) def ファイルを選択(self, *args, **kwargs): # choose_file(selector, file_path) self.choose_file(*args, **kwargs) def スクリプトを実行する(self, *args, **kwargs): # execute_script(script) self.execute_script(*args, **kwargs) def 広告ブロック(self, *args, **kwargs): # ad_block() self.ad_block(*args, **kwargs) def スキップする(self, *args, **kwargs): # skip(reason="") self.skip(*args, **kwargs) def リンク切れを確認する(self, *args, **kwargs): # assert_no_404_errors() self.assert_no_404_errors(*args, **kwargs) def JSエラーを確認する(self, *args, **kwargs): # assert_no_js_errors() self.assert_no_js_errors(*args, **kwargs) def フレームに切り替え(self, *args, **kwargs): # switch_to_frame(frame) self.switch_to_frame(*args, **kwargs) def デフォルトのコンテンツに切り替える(self, *args, **kwargs): # switch_to_default_content() self.switch_to_default_content(*args, **kwargs) def 新しいウィンドウを開く(self, *args, **kwargs): # open_new_window() self.open_new_window(*args, **kwargs) def ウィンドウに切り替え(self, *args, **kwargs): # switch_to_window(window) self.switch_to_window(*args, **kwargs) def デフォルトのウィンドウに切り替える(self, *args, **kwargs): # switch_to_default_window() self.switch_to_default_window(*args, **kwargs) def ハイライト(self, *args, **kwargs): # highlight(selector) self.highlight(*args, **kwargs) def ハイライトしてクリックして(self, *args, **kwargs): # highlight_click(selector) self.highlight_click(*args, **kwargs) def スクロールして(self, *args, **kwargs): # scroll_to(selector) self.scroll_to(*args, **kwargs) def 一番上までスクロール(self, *args, **kwargs): # scroll_to_top() self.scroll_to_top(*args, **kwargs) def 一番下までスクロール(self, *args, **kwargs): # scroll_to_bottom() self.scroll_to_bottom(*args, **kwargs)
29.407216
55
0.603681
661
5,705
5.009077
0.198185
0.283902
0.198732
0.060405
0.143763
0.017517
0
0
0
0
0
0.001623
0.243996
5,705
193
56
29.559585
0.766056
0.194917
0
0
0
0
0
0
0
0
0
0
0.104167
1
0.489583
false
0
0.010417
0
0.510417
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
1eecbaa9483cb3e261d89a46864b2a0c09bfd108
52
py
Python
src/tests/unit/converters/__init__.py
wilsonGmn/pyrin
25dbe3ce17e80a43eee7cfc7140b4c268a6948e0
[ "BSD-3-Clause" ]
null
null
null
src/tests/unit/converters/__init__.py
wilsonGmn/pyrin
25dbe3ce17e80a43eee7cfc7140b4c268a6948e0
[ "BSD-3-Clause" ]
null
null
null
src/tests/unit/converters/__init__.py
wilsonGmn/pyrin
25dbe3ce17e80a43eee7cfc7140b4c268a6948e0
[ "BSD-3-Clause" ]
null
null
null
# -*- coding: utf-8 -*- """ converters package. """
10.4
23
0.519231
5
52
5.4
1
0
0
0
0
0
0
0
0
0
0
0.023256
0.173077
52
4
24
13
0.604651
0.807692
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
1efe7e69ae2639862bb59b0c4b8bbabff425c59e
1,333
py
Python
examples/all_refs.py
wyfo/apimodel
99e6b23504e8ca775fda9dfa93c4e350211c1b8a
[ "MIT" ]
118
2020-05-24T20:22:27.000Z
2022-03-23T23:04:50.000Z
examples/all_refs.py
wyfo/apimodel
99e6b23504e8ca775fda9dfa93c4e350211c1b8a
[ "MIT" ]
89
2021-02-26T14:22:41.000Z
2022-03-30T22:17:06.000Z
examples/all_refs.py
wyfo/apimodel
99e6b23504e8ca775fda9dfa93c4e350211c1b8a
[ "MIT" ]
13
2020-12-24T22:43:50.000Z
2022-03-13T15:03:44.000Z
from dataclasses import dataclass from apischema.json_schema import deserialization_schema @dataclass class Bar: baz: str @dataclass class Foo: bar1: Bar bar2: Bar assert deserialization_schema(Foo, all_refs=False) == { "$schema": "http://json-schema.org/draft/2020-12/schema#", "$defs": { "Bar": { "additionalProperties": False, "properties": {"baz": {"type": "string"}}, "required": ["baz"], "type": "object", } }, "additionalProperties": False, "properties": {"bar1": {"$ref": "#/$defs/Bar"}, "bar2": {"$ref": "#/$defs/Bar"}}, "required": ["bar1", "bar2"], "type": "object", } assert deserialization_schema(Foo, all_refs=True) == { "$schema": "http://json-schema.org/draft/2020-12/schema#", "$defs": { "Bar": { "additionalProperties": False, "properties": {"baz": {"type": "string"}}, "required": ["baz"], "type": "object", }, "Foo": { "additionalProperties": False, "properties": { "bar1": {"$ref": "#/$defs/Bar"}, "bar2": {"$ref": "#/$defs/Bar"}, }, "required": ["bar1", "bar2"], "type": "object", }, }, "$ref": "#/$defs/Foo", }
25.150943
85
0.484621
115
1,333
5.565217
0.286957
0.065625
0.21875
0.09375
0.75625
0.75625
0.640625
0.640625
0.640625
0.640625
0
0.023631
0.301575
1,333
52
86
25.634615
0.663802
0
0
0.488889
0
0
0.339085
0
0
0
0
0
0.044444
1
0
true
0
0.044444
0
0.155556
0
0
0
0
null
0
1
0
0
1
0
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
1
0
0
0
0
0
0
4
1effcc148875bb56588ce97d11cc6a6fca1e44c6
60
py
Python
enthought/pyface/grid/grid_cell_renderer.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
3
2016-12-09T06:05:18.000Z
2018-03-01T13:00:29.000Z
enthought/pyface/grid/grid_cell_renderer.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
1
2020-12-02T00:51:32.000Z
2020-12-02T08:48:55.000Z
enthought/pyface/grid/grid_cell_renderer.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
null
null
null
# proxy module from pyface.grid.grid_cell_renderer import *
20
44
0.816667
9
60
5.222222
0.888889
0
0
0
0
0
0
0
0
0
0
0
0.116667
60
2
45
30
0.886792
0.2
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
481dc994f0265de6e62cf6e6f268a16dc7ee3be2
184
py
Python
problems/camelcase_method.py
stereoabuse/codewars
d6437afaef38c3601903891b8b9cb0f84c108c54
[ "MIT" ]
null
null
null
problems/camelcase_method.py
stereoabuse/codewars
d6437afaef38c3601903891b8b9cb0f84c108c54
[ "MIT" ]
null
null
null
problems/camelcase_method.py
stereoabuse/codewars
d6437afaef38c3601903891b8b9cb0f84c108c54
[ "MIT" ]
null
null
null
## CamelCase Method ## 6 kyu ## https://www.codewars.com//kata/587731fda577b3d1b0001196 def camel_case(string): return ''.join([word.title() for word in string.split()])
26.285714
61
0.673913
23
184
5.347826
0.913043
0
0
0
0
0
0
0
0
0
0
0.123377
0.163043
184
7
61
26.285714
0.675325
0.434783
0
0
0
0
0
0
0
0
0
0
0
1
0.5
false
0
0
0.5
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
4
48267f9674d9e86a273364ef9f1162e51b0f46a0
6,909
py
Python
pymove/tests/test_core_pandas_discrete.py
JuniorNunes15/PyMove
ee5b68282502bfcb9cf38b52dcdefed5bd927a90
[ "MIT" ]
63
2019-08-06T14:24:36.000Z
2022-03-22T11:11:03.000Z
pymove/tests/test_core_pandas_discrete.py
JuniorNunes15/PyMove
ee5b68282502bfcb9cf38b52dcdefed5bd927a90
[ "MIT" ]
49
2019-09-20T14:06:50.000Z
2022-03-11T22:13:43.000Z
pymove/tests/test_core_pandas_discrete.py
JuniorNunes15/PyMove
ee5b68282502bfcb9cf38b52dcdefed5bd927a90
[ "MIT" ]
18
2019-08-15T18:13:10.000Z
2021-11-30T16:26:19.000Z
import numpy as np from pandas.testing import assert_frame_equal from pymove.core.pandas_discrete import PandasDiscreteMoveDataFrame from pymove.utils.constants import ( DATETIME, DIST_TO_PREV, INDEX_GRID, LATITUDE, LOCAL_LABEL, LONGITUDE, PREV_LOCAL, SPEED_TO_PREV, TID_STAT, TIME_TO_PREV, TRAJ_ID, ) def test_discretize_based_grid(): discrete_df = PandasDiscreteMoveDataFrame( data={DATETIME: ['2020-01-01 01:08:29', '2020-01-05 01:13:24', '2020-01-06 02:21:53', '2020-01-06 03:34:48', '2020-01-08 05:55:41'], LATITUDE: [3.754245, 3.150849, 3.754249, 3.165933, 3.920178], LONGITUDE: [38.3456743, 38.6913486, 38.3456743, 38.2715962, 38.5161605], TRAJ_ID: ['pwe-5089', 'xjt-1579', 'tre-1890', 'xjt-1579', 'pwe-5089'], LOCAL_LABEL: [1, 4, 2, 16, 32]}, ) expected = PandasDiscreteMoveDataFrame( data={DATETIME: ['2020-01-01 01:08:29', '2020-01-08 05:55:41', '2020-01-06 02:21:53', '2020-01-05 01:13:24', '2020-01-06 03:34:48'], LATITUDE: [3.754245, 3.920178, 3.754249, 3.150849, 3.165933], LONGITUDE: [38.3456743, 38.5161605, 38.3456743, 38.6913486, 38.2715962], TRAJ_ID: ['pwe-5089', 'pwe-5089', 'tre-1890', 'xjt-1579', 'xjt-1579'], LOCAL_LABEL: [1, 32, 2, 4, 16], INDEX_GRID: [754, 2407, 754, 3956, 1]}, ) discrete_df.discretize_based_grid() assert_frame_equal(discrete_df, expected) def test_generate_prev_local_features(): discrete_df = PandasDiscreteMoveDataFrame( data={DATETIME: ['2020-01-01 01:08:29', '2020-01-01 01:10:29', '2020-01-01 10:15:00', '2020-01-05 01:13:24', '2020-01-06 02:21:53', ], LATITUDE: [3.754245, 3.150849, 3.754249, 3.165933, 3.920178, ], LONGITUDE: [38.3456743, 38.6913486, 38.3456743, 38.2715962, 38.5161605, ], TRAJ_ID: ['pwe-5089', 'pwe-5089', 'pwe-5089', 'pwe-5089', 'pwe-5089', ], LOCAL_LABEL: [1.0, 2.0, 1.0, 2.0, 1.0]}, ) expected = PandasDiscreteMoveDataFrame( data={ TRAJ_ID: ['pwe-5089', 'pwe-5089', 'pwe-5089', 'pwe-5089', 'pwe-5089',], DATETIME: ['2020-01-01 01:08:29', '2020-01-01 01:10:29', '2020-01-01 10:15:00', '2020-01-05 01:13:24', '2020-01-06 02:21:53',], LATITUDE: [3.754245, 3.150849, 3.754249, 3.165933, 3.920178, ], LONGITUDE: [38.3456743, 38.6913486, 38.3456743, 38.2715962, 38.5161605, ], LOCAL_LABEL: [1.0, 2.0, 1.0, 2.0, 1.0], PREV_LOCAL: [np.nan, 1.0, 2.0, 1.0, 2.0]}, ) discrete_df.generate_prev_local_features() assert_frame_equal(discrete_df, expected) def test_generate_tid_based_statistics(): discrete_df = PandasDiscreteMoveDataFrame( data={ TRAJ_ID: ['pwe-5089', 'pwe-5089', 'pwe-5089', 'pwe-5089', 'pwe-5089' ], DATETIME: ['2020-01-01 01:08:29', '2020-01-01 01:10:29', '2020-01-01 10:15:00', '2020-01-05 01:13:24', '2020-01-06 02:21:53', ], LATITUDE: [3.754245, 3.150849, 3.754249, 3.165933, 3.920178, ], LONGITUDE: [38.3456743, 38.6913486, 38.3456743, 38.2715962, 38.5161605 ], LOCAL_LABEL: [1.0, 2.0, 1.0, 2.0, 1.0], PREV_LOCAL: [np.nan, 1.0, 2.0, 1.0, 2.0]} ) expected = PandasDiscreteMoveDataFrame( data={ TRAJ_ID: ['pwe-5089', 'pwe-5089', 'pwe-5089', 'pwe-5089', 'pwe-5089', ], DATETIME: ['2020-01-01 01:08:29', '2020-01-01 01:10:29', '2020-01-01 10:15:00', '2020-01-05 01:13:24', '2020-01-06 02:21:53', ], LATITUDE: [3.754245, 3.150849, 3.754249, 3.165933, 3.920178, ], LONGITUDE: [38.3456743, 38.6913486, 38.3456743, 38.2715962, 38.5161605, ], LOCAL_LABEL: [1.0, 2.0, 1.0, 2.0, 1.0], PREV_LOCAL: [np.nan, 1.0, 2.0, 1.0, 2.0], DIST_TO_PREV: [np.nan, 77289.911988, 77290.298056, 65932.426141, 88150.855250], TIME_TO_PREV: [np.nan, 120.0, 32671.0, 313104.0, 90509.0], SPEED_TO_PREV: [np.nan, 644.082600, 2.365716, 0.210577, 0.973946], TID_STAT: [1, 1, 1, 1, 1]}, ) discrete_df.generate_tid_based_statistics() assert_frame_equal(discrete_df, expected)
33.538835
78
0.361992
659
6,909
3.687405
0.159332
0.074074
0.069959
0.097942
0.69465
0.679012
0.641975
0.641975
0.633745
0.584362
0
0.37054
0.525402
6,909
205
79
33.702439
0.37054
0
0
0.714286
0
0
0.117238
0
0
0
0
0
0.021164
1
0.015873
false
0
0.021164
0
0.037037
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
1
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
484e1321817f004c2f06cc3d1d70f41523918835
77
py
Python
src/main/python/ui/distribution/__init__.py
boom-roasted/ImageWAO
944505dab1a7c97b8eae2bf9fb30006d0f471f89
[ "MIT" ]
1
2020-03-22T01:52:52.000Z
2020-03-22T01:52:52.000Z
src/main/python/ui/distribution/__init__.py
leftaltkey/ImageWAO
944505dab1a7c97b8eae2bf9fb30006d0f471f89
[ "MIT" ]
2
2021-06-08T21:12:47.000Z
2021-06-08T21:30:32.000Z
src/main/python/ui/distribution/__init__.py
leftaltkey/ImageWAO
944505dab1a7c97b8eae2bf9fb30006d0f471f89
[ "MIT" ]
null
null
null
from .distributionform import DistributionForm __all__ = [DistributionForm]
19.25
46
0.844156
6
77
10.166667
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.103896
77
3
47
25.666667
0.884058
0
0
0
0
0
0
0
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
487964188e1046cce660c12fb7dca469bdd35e11
1,693
py
Python
src/main/java/neqsim/util/python/Copy of init.py
asmfstatoil/neqsim
21b3034b1c51a481c1347eec3b87b641bc56def2
[ "Apache-2.0" ]
28
2019-07-27T13:41:28.000Z
2022-02-24T08:39:18.000Z
src/main/java/neqsim/util/python/Copy of init.py
asmfstatoil/neqsim
21b3034b1c51a481c1347eec3b87b641bc56def2
[ "Apache-2.0" ]
76
2019-05-12T08:26:46.000Z
2022-03-29T11:23:44.000Z
src/main/java/neqsim/util/python/Copy of init.py
asmfstatoil/neqsim
21b3034b1c51a481c1347eec3b87b641bc56def2
[ "Apache-2.0" ]
16
2019-05-06T09:23:22.000Z
2022-03-27T01:48:50.000Z
from javax.swing import * from thermo.system import * from thermodynamicOperations import * from processSimulation import * from processSimulation.processEquipment import * from processSimulation.processEquipment.stream import * from processSimulation.processEquipment.mixer import * from processSimulation.processEquipment.stream import * from processSimulation.processEquipment.separator import * from processSimulation.processEquipment.valve import * from processSimulation.processEquipment.pipeline import * from processSimulation.processSystem import * from Numeric import * from java.sql import * from java import * from util.database import * from visad.python.JPythonMethods import * #from visad.python import * #from util.pythonScript.pythonTools.mathTools import * #from fluidMechanics.geometryDefinitions import * #from fluidMechanics.flowSystem import * # #from fluidMechanics.geometryDefinitions.pipe import * #from fluidMechanics.flowSystem.twoPhaseFlowSystem.twoPhasePipeFlowSystem import * #import sys #sys.path.append('c:\\java\\Thermo_with_Java\\util\\pythonScript\\pythonTools\\mathTools') #sys.path.append('c:\\java\\Thermo_with_Java\\util\\pythonScript\\pythonTools\\visAdScripts') #sys.path.append('c:\\java\\jython-2.0\\Lib') #sys.path.append('c:\\java\\Thermo_with_Java\\util\\pythonScript\\pythonTools\\DataHandeling') #from NetCDFcreate import * #from newtonSolver import * ##from util.pythonScript.Even.visAdScripts import * #from statistics.parameterFitting.nonLinearParameterFitting import * #from statistics.parameterFitting import * ##from statistics.parameterFitting.nonLinearParameterFitting.thermodynamicParameterFitting.binaryInteractionParameters import *
47.027778
127
0.831069
175
1,693
8.005714
0.291429
0.192719
0.173448
0.214847
0.357602
0.257673
0.257673
0.257673
0.257673
0.126338
0
0.001275
0.073243
1,693
35
128
48.371429
0.891651
0.568813
0
0.117647
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
6fc540bca2e56a0b1c317a5db52a85cf2d3245ee
241
py
Python
ganjoor/__init__.py
MmeK/ganjoor_api_wrapper
b7457ea42efd8a29d5e37868c2db1e6355fcaf54
[ "MIT" ]
1
2021-12-09T23:30:17.000Z
2021-12-09T23:30:17.000Z
ganjoor/__init__.py
MmeK/ganjoor_api_wrapper
b7457ea42efd8a29d5e37868c2db1e6355fcaf54
[ "MIT" ]
4
2021-10-16T18:44:31.000Z
2021-11-06T18:46:33.000Z
ganjoor/__init__.py
MmeK/ganjoor_api_wrapper
b7457ea42efd8a29d5e37868c2db1e6355fcaf54
[ "MIT" ]
null
null
null
# Copyright 2021 Mohammad Kazemi <kazemi.me.222@gmail.com>. # SPDX-License-Identifier: MIT from .models import (Poet, Poem, Category) from .ganjoor import Ganjoor from .config import GANJGAH_BASE_URL from .exceptions import GanjoorException
34.428571
59
0.804979
33
241
5.818182
0.757576
0
0
0
0
0
0
0
0
0
0
0.03271
0.112033
241
6
60
40.166667
0.864486
0.356846
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
6fd9d29c489e5d996cf6d793173a7387ff6cdbfa
210
py
Python
master/utils-master/utils-master/.startup.py
AlexRogalskiy/DevArtifacts
931aabb8cbf27656151c54856eb2ea7d1153203a
[ "MIT" ]
4
2018-09-07T15:35:24.000Z
2019-03-27T09:48:12.000Z
master/utils-master/utils-master/.startup.py
AlexRogalskiy/DevArtifacts
931aabb8cbf27656151c54856eb2ea7d1153203a
[ "MIT" ]
371
2020-03-04T21:51:56.000Z
2022-03-31T20:59:11.000Z
master/utils-master/utils-master/.startup.py
AlexRogalskiy/DevArtifacts
931aabb8cbf27656151c54856eb2ea7d1153203a
[ "MIT" ]
3
2019-06-18T19:57:17.000Z
2020-11-06T03:55:08.000Z
# python startup file to toggle autocomplete on. # e.g. export PYTHONSTARTUPFILE=pythonstartup.py # import readline import rlcompleter readline.parse_and_bind('tab: complete') print "Auto complete is enabled"
23.333333
48
0.804762
28
210
5.964286
0.892857
0
0
0
0
0
0
0
0
0
0
0
0.119048
210
8
49
26.25
0.902703
0.442857
0
0
0
0
0.327434
0
0
0
0
0
0
0
null
null
0
0.5
null
null
0.25
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
4
82f6619313d12666d72c316412a1654c4a856f22
229
py
Python
shallow_backup/__init__.py
jules-kim/shallow-backup
672d71e94e44c09baccdbfa3618ca4eef4930073
[ "MIT" ]
null
null
null
shallow_backup/__init__.py
jules-kim/shallow-backup
672d71e94e44c09baccdbfa3618ca4eef4930073
[ "MIT" ]
null
null
null
shallow_backup/__init__.py
jules-kim/shallow-backup
672d71e94e44c09baccdbfa3618ca4eef4930073
[ "MIT" ]
null
null
null
__all__ = ['config', 'utils', 'git_wrapper', 'reinstall', 'constants', 'backup', 'printing', 'prompts'] import config import utils import git_wrapper import constants import backup import printing import prompts import reinstall
22.9
103
0.772926
27
229
6.333333
0.407407
0.116959
0
0
0
0
0
0
0
0
0
0
0.113537
229
9
104
25.444444
0.842365
0
0
0
0
0
0.266376
0
0
0
0
0
0
1
0
false
0
0.888889
0
0.888889
0.222222
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
d213719075c354beb9ff49a675766eefe97337cd
66
py
Python
frontend/__init__.py
karllindmark/IsYourProjectUpToDate
ce2df36b8fa39a4732b05dfd75558a914e4e990b
[ "Apache-2.0" ]
null
null
null
frontend/__init__.py
karllindmark/IsYourProjectUpToDate
ce2df36b8fa39a4732b05dfd75558a914e4e990b
[ "Apache-2.0" ]
null
null
null
frontend/__init__.py
karllindmark/IsYourProjectUpToDate
ce2df36b8fa39a4732b05dfd75558a914e4e990b
[ "Apache-2.0" ]
null
null
null
""" Module for the frontend, ie the UI and presentation layer """
33
65
0.712121
10
66
4.7
0.9
0
0
0
0
0
0
0
0
0
0
0
0.181818
66
1
66
66
0.87037
0.863636
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
d22ad5487bc6bc76170ebfbd782e2b680fc1df82
216
py
Python
tests/tests/test_settings.py
einsfr/commontail
a7421b7aac89dead7e4f7e0da0dff317157c3fea
[ "MIT" ]
null
null
null
tests/tests/test_settings.py
einsfr/commontail
a7421b7aac89dead7e4f7e0da0dff317157c3fea
[ "MIT" ]
null
null
null
tests/tests/test_settings.py
einsfr/commontail
a7421b7aac89dead7e4f7e0da0dff317157c3fea
[ "MIT" ]
null
null
null
from unittest import TestCase from django.conf import settings class SettingsTestCase(TestCase): def test_import(self): self.assertEqual(settings.COMMONTAIL_NO_IMAGE_PLACEHOLDER_TITLE, 'image later')
21.6
87
0.791667
26
216
6.384615
0.730769
0
0
0
0
0
0
0
0
0
0
0
0.143519
216
9
88
24
0.897297
0
0
0
0
0
0.050926
0
0
0
0
0
0.2
1
0.2
false
0
0.6
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
d24747b2c99fbf0680128ad8b972b9c219d91e54
101
py
Python
service_and_process/apps.py
rameshgopalakrishnan/v_excel_inventory
5e7e8cfeb5b0217d7029feb917f84614aa384601
[ "Apache-2.0" ]
null
null
null
service_and_process/apps.py
rameshgopalakrishnan/v_excel_inventory
5e7e8cfeb5b0217d7029feb917f84614aa384601
[ "Apache-2.0" ]
null
null
null
service_and_process/apps.py
rameshgopalakrishnan/v_excel_inventory
5e7e8cfeb5b0217d7029feb917f84614aa384601
[ "Apache-2.0" ]
null
null
null
from django.apps import AppConfig class LaundryConfig(AppConfig): name = 'service_and_process'
16.833333
33
0.782178
12
101
6.416667
0.916667
0
0
0
0
0
0
0
0
0
0
0
0.148515
101
5
34
20.2
0.895349
0
0
0
0
0
0.188119
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
d281c21601382dde76e9d4534fe470f7c677cb5e
2,777
py
Python
pytissueoptics/tests/testsMaterial.py
DCC-Lab/PyTissueOptics
2e1920a970d62c1e2aeca25749ba88969c300325
[ "MIT" ]
3
2021-02-01T19:30:35.000Z
2021-06-14T20:08:10.000Z
pytissueoptics/tests/testsMaterial.py
DCC-Lab/PyTissueOptics
2e1920a970d62c1e2aeca25749ba88969c300325
[ "MIT" ]
25
2021-02-03T15:53:18.000Z
2022-03-30T22:53:29.000Z
pytissueoptics/tests/testsMaterial.py
DCC-Lab/PyTissueOptics
2e1920a970d62c1e2aeca25749ba88969c300325
[ "MIT" ]
2
2022-02-12T03:51:53.000Z
2022-02-14T04:52:28.000Z
import envtest # modifies path from pytissueoptics import * import numpy as np import random from math import cos inf = float("+inf") class TestVector(envtest.PyTissueTestCase): def testMateiralInit(self): mat = Material() self.assertIsNotNone(mat) def testMaterialG0(self): mat = Material(g=0) sumTheta = 0 sumPhi = 0 N = 1000000 for i in range(N): theta, phi = mat.getScatteringAngles(None) sumTheta += cos(theta) sumPhi += phi self.assertAlmostEqual((sumTheta)/N, 0, 2) self.assertAlmostEqual(sumPhi/N, 3.1416, 2) def testMaterialG08(self): mat = Material(g=0.8) sumTheta = 0 sumPhi = 0 N = 1000000 for i in range(N): theta, phi = mat.getScatteringAngles(None) sumTheta += cos(theta) sumPhi += phi self.assertAlmostEqual((sumTheta)/N, 0.8, 2) self.assertAlmostEqual(sumPhi/N, 3.1416, 2) def testMaterialG1(self): mat = Material(g=1) sumTheta = 0 sumPhi = 0 N = 1000000 for i in range(N): theta, phi = mat.getScatteringAngles(None) sumTheta += cos(theta) sumPhi += phi self.assertAlmostEqual((sumTheta)/N, 1, 2) self.assertAlmostEqual(sumPhi/N, 3.1416, 2) def testMaterialG1(self): mat = Material(g=-0.5) sumTheta = 0 sumPhi = 0 N = 1000000 for i in range(N): theta, phi = mat.getScatteringAngles(None) sumTheta += cos(theta) sumPhi += phi self.assertAlmostEqual((sumTheta)/N, -0.5, 2) self.assertAlmostEqual(sumPhi/N, 3.1416, 2) def testMaterialMus(self): mat = Material(mu_s = 10, mu_a = 0, g = 0.8) sumDist = 0 N = 1000000 for i in range(N): d = mat.getScatteringDistance(None) sumDist += d self.assertAlmostEqual((sumDist)/N, 1/mat.mu_s, 2) def testMaterialMua(self): mat = Material(mu_s = 0, mu_a = 20, g = 0.8) sumDist = 0 N = 1000000 for i in range(N): d = mat.getScatteringDistance(None) sumDist += d self.assertAlmostEqual((sumDist)/N, 1/mat.mu_a, 2) def testMaterialMut(self): mat = Material(mu_s = 10, mu_a = 20, g = 0.8) sumDist = 0 N = 1000000 for i in range(N): d = mat.getScatteringDistance(None) sumDist += d self.assertAlmostEqual((sumDist)/N, 1/mat.mu_t, 2) def testMaterialAlbedo(self): mat = Material(mu_s = 0, mu_a = 0, g = 0.8) self.assertAlmostEqual(mat.albedo,0, 2) if __name__ == '__main__': envtest.main()
29.231579
58
0.555996
339
2,777
4.498525
0.188791
0.165246
0.088525
0.055082
0.759344
0.736393
0.733115
0.733115
0.678033
0.628197
0
0.071814
0.333093
2,777
94
59
29.542553
0.75162
0.004681
0
0.590361
0
0
0.004345
0
0
0
0
0
0.156627
1
0.108434
false
0
0.060241
0
0.180723
0
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
d2844539b7c0cc28e8877d969cac37af9a6ad7d1
12,240
py
Python
bpmninja/song_metadata.py
chelseadole/bpmninja
37495114777c3c6b2c2654ae1b74b29224b80293
[ "MIT" ]
null
null
null
bpmninja/song_metadata.py
chelseadole/bpmninja
37495114777c3c6b2c2654ae1b74b29224b80293
[ "MIT" ]
null
null
null
bpmninja/song_metadata.py
chelseadole/bpmninja
37495114777c3c6b2c2654ae1b74b29224b80293
[ "MIT" ]
null
null
null
"""All song metadata.""" song_metadata = {0: {'title': 'A Sheridan Square', 'artist': 'Henry Red Allen', 'album': 'Allen, Henry Red: Original 1933-1941 Recordings', 'bpm': 124, 'filepath': 'a-sheridan-square.mp3', 'id': 0}, 1: {'title': "Ain't Misbehavin'", 'artist': 'Sidney Bechet', 'album': 'VICTOR 26746', 'bpm': 145, 'filepath': 'aint-misbehavin.mp3', 'id': 1}, 2: {'title': 'All Of Me', 'artist': 'Sidney Bechet', 'album': 'Sidney Bechet Vol. 9', 'bpm': 113, 'filepath': 'all-of-me.mp3', 'id': 2}, 3: {'title': 'All Right Okay You Win', 'artist': 'Count Basie', 'album': 'Count Basie at Newport', 'bpm': 146, 'filepath': 'all-right-okay-you-win.m4a', 'id': 3}, 4: {'title': 'Are You All Reet?', 'artist': 'Cab Calloway', 'album': 'Are You Hep To The Jive?', 'bpm': 158, 'filepath': 'are-you-alreet.mp3', 'id': 4}, 5: {'title': 'Artillerie Lourde', 'artist': 'Henri Crolla & Co.', 'album': 'Notre Ami Django', 'bpm': 129, 'filepath': 'artillerie-lourde.mp3', 'id': 5}, 6: {'title': 'Back Beat Boogie', 'artist': 'Harry James & His Orchestra', 'album': 'The Best of Harry James Orchestra', 'bpm': 197, 'filepath': 'back-beat-boogie.mp3', 'id': 6}, 7: {'title': 'Battle Axe', 'artist': 'Jimmie Lunceford', 'album': 'Jimmie Lunceford and His Orchestra (1940)', 'bpm': 249, 'filepath': 'battle-axe.mp3', 'id': 7}, 8: {'title': 'Bloodhound', 'artist': 'Hot Lips Page', 'album': '1944-1946', 'bpm': 185, 'filepath': 'bloodhound.mp3', 'id': 8}, 9: {'title': 'Blow, Illinois, Blow', 'artist': 'Illinois Jacquet', 'album': 'Illinois Jacquet', 'bpm': 217, 'filepath': 'blow-illinois-blow.mp3', 'id': 9}, 10: {'title': 'Boo Wah Boo Wah', 'artist': 'Cab Calloway', 'album': 'Boo Wah Boo Wah', 'bpm': 200, 'filepath': 'boo-wah-boo-wah.mp3', 'id': 10}, 11: {'title': 'Buddy Bolden Stomp', 'artist': 'Sidney Bechet', 'album': 'Sidney Bechet Vol. 9', 'bpm': 204, 'filepath': 'buddy-bolden-stomp.mp3', 'id': 11}, 12: {'title': 'Celery Stalks At Midnight', 'artist': 'Will Bradley and his Orchestra', 'album': 'Ultimate Collection', 'bpm': 154, 'filepath': 'celery-stalks-at-midnight.mp3', 'id': 12}, 13: {'title': 'Cherokee', 'artist': 'Charlie Barnet', 'album': 'Charlie Barnet', 'bpm': 177, 'filepath': 'cherokee.mp3', 'id': 13}, 14: {'title': 'Dig It', 'artist': 'Doris Day', 'album': 'The Music Plays On', 'bpm': 150, 'filepath': 'dig-it.mp3', 'id': 14}, 15: {'title': 'Diga Diga Doo', 'artist': "Mill's Hotsy Totsy Gang", 'album': 'BRUNSWICK 4014', 'bpm': 221, 'filepath': 'diga-diga-doo.mp3', 'id': 15}, 16: {'title': 'Esquire Bounce', 'artist': 'Coleman Hawkins', 'album': 'Jazz & Blues World Presents: Coleman Hawkins', 'bpm': 168, 'filepath': 'esquire-bounce.mp3', 'id': 16}, 17: {'title': 'Flying Home', 'artist': 'Lionel Hampton', 'album': 'Flying Home', 'bpm': 190, 'filepath': 'flying-home.mp3', 'id': 17}, 18: {'title': 'Four Or Five Times', 'artist': 'Bechet-Spanier Big Four', 'album': 'The Essential Collection (Digitally Remastered)', 'bpm': 112, 'filepath': 'four-or-five-times.mp3', 'id': 18}, 19: {'title': 'Gimme, Gimme, Gimme', 'artist': 'Hot Lips Page', 'album': '1946-1950', 'bpm': 100, 'filepath': 'gimme-gimme-gimme.mp3', 'id': 19}, 20: {'title': 'How Come', 'artist': "Anita O'Day", 'album': '1945-1950', 'bpm': 140, 'filepath': 'how-come.mp3', 'id': 20}, 21: {'title': 'Johnny Come Lately', 'artist': 'Duke Ellington', 'album': 'Sophisticated', 'bpm': 173, 'filepath': 'johnny-come-lately.mp3', 'id': 21}, 22: {'title': 'Leap Frog', 'artist': 'Les Brown', 'album': 'Les Brown & Doris Day & Friends', 'bpm': 187, 'filepath': 'leap-frog.mp3', 'id': 22}, 23: {'title': "Let's Get Drunk And Truck", 'artist': 'The Harlem Hamfats', 'album': 'Harlem Hamfats Vol. 2 1936-1937', 'bpm': 183, 'filepath': 'lets-get-drunk-and-truck.mp3', 'id': 23}, 24: {'title': 'Little Jazz', 'artist': 'Roy Eldridge', 'album': '1957 Live (Jazz Band Records)', 'bpm': 170, 'filepath': 'little-jazz.mp3', 'id': 24}, 25: {'title': 'Love in My Heart (Swing Baby Swing)', 'artist': 'Duke Ellington ft. Rex Stewart & His 52nd Street S', 'album': 'At The Piano', 'bpm': 164, 'filepath': 'love-in-my-heart.mp3', 'id': 25}, 26: {'title': 'Love You Madly', 'artist': 'Ella Fitzgerald', 'album': 'Love You Madly', 'bpm': 121, 'filepath': 'love-you-madly.mp3', 'id': 26}, 27: {'title': 'Make Me A Pallet On The Floor', 'artist': 'Sidney Bechet and His New Orleans Feetwarmers', 'album': 1940, 'bpm': 104, 'filepath': 'make-me-a-pallet-on-the-floor.mp3', 'id': 27}, 28: {'title': 'Midnight Alley (Remastered)', 'artist': 'Ray Anthony', 'album': "Ray's Star", 'bpm': 176, 'filepath': 'midnight-alley.mp3', 'id': 28}, 29: {'title': 'Midnight In Moscow', 'artist': 'Kenny Ball and his Jazzmen', 'album': 'Kenny Ball', 'bpm': 171, 'filepath': 'midnight-in-moscow.mp3', 'id': 29}, 30: {'title': 'Moonglow (Take 2)', 'artist': 'Benny Goodman Quartet', 'album': 'The Complete RCA Victor Small Recordings', 'bpm': 123, 'filepath': 'moonglow-take-2.mp3', 'id': 30}, 31: {'title': 'Moten Swing', 'artist': 'Glen Gray & The Casa Loma Orchestra', 'album': 'Jazz Band Greats', 'bpm': 166, 'filepath': 'moten-swing.mp3', 'id': 31}, 32: {'title': 'Muddy River Blues', 'artist': 'Jack Teagarden and His Orchestra', 'album': '1939-1940', 'bpm': 133, 'filepath': 'muddy-river-blues.m4a', 'id': 32}, 33: {'title': 'My Baby Just Cares', 'artist': 'Nina Simone', 'album': 'My Baby Just Cares', 'bpm': 118, 'filepath': 'my-baby-just-cares.mp3', 'id': 33}, 34: {'title': 'Old Paree', 'artist': 'Hot Lips Page', 'album': '1950-1953', 'bpm': 122, 'filepath': 'old-paree.mp3', 'id': 34}, 35: {'title': 'One Foot In The Groove', 'artist': 'Artie Shaw', 'album': 'Artie Shaw Fifty Favourites', 'bpm': 163, 'filepath': 'one-foot-in-the-groove.mp3', 'id': 35}, 36: {'title': 'Opus One', 'artist': 'Tommy Dorsey', 'album': 'The Ultimate Big Band Theme Collection', 'bpm': 163, 'filepath': 'opus-one.mp3', 'id': 36}, 37: {'title': 'Perdido', 'artist': 'Duke Ellington', 'album': 'Duke Ellington Et Son Orchestre: 1940', 'bpm': 132, 'filepath': 'perdido.mp3', 'id': 37}, 38: {'title': 'Rose Room', 'artist': 'Benny Goodman', 'album': 'Benny Goodman LIVE', 'bpm': 136, 'filepath': 'rose-room.mp3', 'id': 38}, 39: {'title': 'Rosetta', 'artist': 'Albert Nicholas', 'album': 'The Golden Era of Dixieland Jazz', 'bpm': 213, 'filepath': 'rosetta.mp3', 'id': 39}, 40: {'title': 'Save The Bones For Henry Jones', 'artist': 'Pat Flowers', 'album': '1945-1947 {Chronological Classics, 1093}', 'bpm': 154, 'filepath': 'save-the-bones-for-henry-jones.mp3', 'id': 40}, 41: {'title': 'Savoy', 'artist': 'Lucky Millinder', 'album': 'Lucky Millinder', 'bpm': 196, 'filepath': 'savoy.mp3', 'id': 41}, 42: {'title': 'Shivers', 'artist': 'Charlie Christian with Benny Goodman & His Sextet', 'album': 'All My Life', 'bpm': 186, 'filepath': 'shivers.mp3', 'id': 42}, 43: {'title': 'Singing A Happy Song', 'artist': 'Benny Goodman', 'album': 'Complete Jazz Series 1935', 'bpm': 194, 'filepath': 'singing-a-happy-song.m4a', 'id': 43}, 44: {'title': 'Slip Horn Jive', 'artist': 'Glenn Miller', 'album': 'Glenn Miller & His Orchestra', 'bpm': 254, 'filepath': 'slip-horn-jive.mp3', 'id': 44}, 45: {'title': 'Solid Mama', 'artist': 'Earl Hines and his Orchestra', 'album': 'Remastered Collection (Remastered 2015)', 'bpm': 177, 'filepath': 'solid-mama.mp3', 'id': 45}, 46: {'title': 'Sophisticated Jump', 'artist': 'Al Cooper & His Savoy Sultans', 'album': 'Al Cooper (Doxy Collection)', 'bpm': 154, 'filepath': 'sophisticated-jump.mp3', 'id': 46}, 47: {'title': 'St. James Infirmary', 'artist': 'Hot Lips Page', 'album': '1946-1950', 'bpm': 119, 'filepath': 'st-james-infirmary.mp3', 'id': 47}, 48: {'title': 'Stitches', 'artist': 'Al Cooper & His Savoy Sultans', 'album': 'Al Cooper (Doxy Collection)', 'bpm': 187, 'filepath': 'stitches.mp3', 'id': 48}, 49: {'title': 'Stomp, Stomp', 'artist': 'The Cats & the Fiddle', 'album': "The Jive is Jumpin'", 'bpm': 201, 'filepath': 'stomp-stomp.mp3', 'id': 49}, 50: {'title': 'Sultan Serenade', 'artist': 'Horace Henderson and His Orchestra', 'album': '1940-1941', 'bpm': 216, 'filepath': 'sultan-serenade.mp3', 'id': 50}, 51: {'title': 'Sweet Sue, Just You', 'artist': 'Benny Goodman', 'album': 'Sweet Sue, Just You', 'bpm': 168, 'filepath': 'sweet-sue-just-you.mp3', 'id': 51}, 52: {'title': 'Swinging On Nothing', 'artist': 'Tommy Dorsey', 'album': 'Tommy Dorsey', 'bpm': 126, 'filepath': 'swinging-on-nothing.mp3', 'id': 52}, 53: {'title': 'The Fox', 'artist': 'Ray Anthony Orchestra', 'album': 'Ray Anthony & His Orchestra 1949-53', 'bpm': 162, 'filepath': 'the-fox.mp3', 'id': 53}, 54: {'title': "The Jeep Is Jumpin'", 'artist': 'Johnny Hodges', 'album': 'Johnny Hodges', 'bpm': 178, 'filepath': 'the-jeep-is-jumpin.mp3', 'id': 54}, 55: {'title': 'The Right Idea', 'artist': 'Charlie Barnet and his Orchestra', 'album': 'Essential, Vol. 4', 'bpm': 184, 'filepath': 'the-right-idea.m4a', 'id': 55}, 56: {'title': 'Too Young for the Blues', 'artist': 'Ella Fitzgerald', 'album': 'First Lady of Song (Box Set)', 'bpm': 137, 'filepath': 'too-young-for-the-blues.mp3', 'id': 56}, 57: {'title': 'Undecided', 'artist': 'Ella Fitzgerald And Her Famous Orchestra', 'album': 'Live At The Savoy - 1939-40', 'bpm': 205, 'filepath': 'undecided.mp3', 'id': 57}, 58: {'title': "Walk 'Em", 'artist': 'Buddy Johnson', 'album': 'Jukebox Hits 1940-1951', 'bpm': 122, 'filepath': 'walk-em.mp3', 'id': 58}, 59: {'title': 'Whatcha Know Joe', 'artist': 'Will Bradley', 'album': 1941, 'bpm': 175, 'filepath': 'whatcha-know-joe.mp3', 'id': 59}, 60: {'title': 'When A Woman Loves A Man', 'artist': 'Billie Holiday', 'album': 'Billie Holiday 1937-1939', 'bpm': 89, 'filepath': 'when-a-woman-loves-a-man.m4a', 'id': 60}, 61: {'title': 'Honeysuckle Rose', 'artist': 'Sarah Vaughan', 'album': 'Live In Chicago', 'bpm': 140, 'filepath': 'honeysuckle-rose.mp3', 'id': 61}, 62: {'title': 'Duck Fever', 'artist': 'Freddie Jackson', 'album': 'Something Saxy: Jazz In The Lounge', 'bpm': 191, 'filepath': 'duck-fever.mp3', 'id': 62}, 63: {'title': "When You're Smiling (1938)", 'artist': 'Nat Gonella & His Georgians', 'album': 'Georgia On My Mind', 'bpm': 191, 'filepath': 'when-youre-smiling.mp3', 'id': 63}, 64: {'title': 'Bottoms Up', 'artist': 'Illinois Jacquet', 'album': '1945-1946', 'bpm': 203, 'filepath': 'bottoms-up.mp3', 'id': 64}, 65: {'title': 'Blow Top Blues', 'artist': 'Etta Jones with Barney Bigard and His Orchestra', 'album': '0:00', 'bpm': 91, 'filepath': 'blow-top-blues.mp3', 'id': 65}, 66: {'title': "Your Father's Moustache", 'artist': 'Woody Herman', 'album': 'Original Hits: Woody Herman', 'bpm': 228, 'filepath': 'your-fathers-moustache.m4a', 'id': 66}, 67: {'title': 'Wolverine Blues', 'artist': 'Jack Teagarden and His Orchestra', 'album': '1939-1940', 'bpm': 213, 'filepath': 'wolverine-blues.m4a', 'id': 67}, 68: {'title': 'Second Balcony Jump', 'artist': 'Earl Hines', 'album': '1942-1945', 'bpm': 144, 'filepath': 'second-balcony-jump.mp3', 'id': 68}, 69: {'title': 'They Raided The Joint', 'artist': 'Roy Eldridge', 'album': "Vintage 50's Swedish Jazz 1949-1969", 'bpm': 153, 'filepath': 'they-raided-the-joint.mp3', 'id': 69}, 70: {'title': 'Mr. Five By Five', 'artist': 'Jimmy Rushing', 'album': 'The Humphrey Lyttelton Big Band with Jimmy Rushing', 'bpm': 157, 'filepath': 'mr-five-by-five.mp3', 'id': 70}, 71: {'title': 'Joshua Fit The Battle of Jericho', 'artist': 'Kid Ory & His Creole Jazz Band', 'album': 'In The Forties', 'bpm': 159, 'filepath': 'joshua-fit-the-battle-of-jericho.mp3', 'id': 71}, 72: {'title': "Evenin' (1936)", 'artist': 'Count Basie and his Orchestra with Jimmy Rushing', 'album': "Evenin'", 'bpm': 168, 'filepath': 'evenin.mp3', 'id': 72}, 73: {'title': 'Call Me A Taxi', 'artist': 'Will Bradley', 'album': 'Will Bradley', 'bpm': 172, 'filepath': 'call-me-a-taxi.mp3', 'id': 73}, 74: {'title': '9:20 Special', 'artist': 'John Kirby', 'album': 'The Best Of 1937-1945', 'bpm': 173, 'filepath': '920-special.mp3', 'id': 74}, 75: {'title': 'Move Your Hand', 'artist': 'The Harlem Hamfats', 'album': "Weed Smoker's Dream", 'bpm': 176, 'filepath': 'move-your-hand.mp3', 'id': 75}, 76: {'title': 'Till Tom Special', 'artist': 'Charlie Christian', 'album': 'With The Benny Goodman Sextet', 'bpm': 177, 'filepath': 'till-tom-special.mp3', 'id': 76}}
4,080
12,214
0.628758
1,755
12,240
4.384615
0.303704
0.045484
0.017544
0.018194
0.100585
0.073554
0.055101
0.049123
0.040546
0.02963
0
0.07556
0.124183
12,240
2
12,215
6,120
0.642257
0.001471
0
0
0
0
0.653324
0.058448
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
963319c419f5a5869aff0543c93322fd99e95ece
474
py
Python
dbaas/drivers/mysqlpercona.py
didindinn/database-as-a-service
747de31ff8546f7874ddd654af860e130afd17a0
[ "BSD-3-Clause" ]
303
2015-01-08T10:35:54.000Z
2022-02-28T08:54:06.000Z
dbaas/drivers/mysqlpercona.py
nouraellm/database-as-a-service
5e655c9347bea991b7218a01549f5e44f161d7be
[ "BSD-3-Clause" ]
124
2015-01-14T12:56:15.000Z
2022-03-22T20:45:11.000Z
dbaas/drivers/mysqlpercona.py
nouraellm/database-as-a-service
5e655c9347bea991b7218a01549f5e44f161d7be
[ "BSD-3-Clause" ]
110
2015-01-02T11:59:48.000Z
2022-02-28T08:54:06.000Z
from . import mysqldb from physical.models import Instance class MySQLPercona(mysqldb.MySQL): def get_default_instance_type(self): return Instance.MYSQL_PERCONA @classmethod def topology_name(cls): return ['mysql_percona_single'] class MySQLPerconaFOXHA(mysqldb.MySQLFOXHA): def get_default_instance_type(self): return Instance.MYSQL_PERCONA @classmethod def topology_name(cls): return ['mysql_percona_foxha']
20.608696
44
0.729958
54
474
6.148148
0.444444
0.144578
0.078313
0.126506
0.614458
0.614458
0.614458
0.614458
0.614458
0.614458
0
0
0.198312
474
22
45
21.545455
0.873684
0
0
0.571429
0
0
0.082278
0
0
0
0
0
0
1
0.285714
false
0
0.142857
0.285714
0.857143
0
0
0
0
null
0
0
0
0
0
0
0
0
1
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
9638cd5f59df1b8284b707583af3625677c72f58
7,158
py
Python
libs/configs/DOTA/retinanet/cfgs_res50_dota_atan_v3.py
Karlinik/RotationDetection
efd20d56d3964b89fa356e79a052bb53f6ac8ddb
[ "Apache-2.0" ]
850
2020-10-27T08:51:54.000Z
2022-03-30T15:12:06.000Z
libs/configs/DOTA/retinanet/cfgs_res50_dota_atan_v3.py
Karlinik/RotationDetection
efd20d56d3964b89fa356e79a052bb53f6ac8ddb
[ "Apache-2.0" ]
94
2020-12-01T02:18:47.000Z
2022-03-30T08:14:27.000Z
libs/configs/DOTA/retinanet/cfgs_res50_dota_atan_v3.py
Karlinik/RotationDetection
efd20d56d3964b89fa356e79a052bb53f6ac8ddb
[ "Apache-2.0" ]
149
2020-10-29T03:30:32.000Z
2022-03-29T09:53:23.000Z
# -*- coding: utf-8 -*- from __future__ import division, print_function, absolute_import import numpy as np from libs.configs._base_.models.retinanet_r50_fpn import * from libs.configs._base_.datasets.dota_detection import * from libs.configs._base_.schedules.schedule_1x import * from dataloader.pretrained_weights.pretrain_zoo import PretrainModelZoo # schedule BATCH_SIZE = 1 GPU_GROUP = "0" NUM_GPU = len(GPU_GROUP.strip().split(',')) SAVE_WEIGHTS_INTE = 20673 DECAY_STEP = np.array(DECAY_EPOCH, np.int32) * SAVE_WEIGHTS_INTE MAX_ITERATION = SAVE_WEIGHTS_INTE * MAX_EPOCH WARM_SETP = int(WARM_EPOCH * SAVE_WEIGHTS_INTE) # dataset DATASET_NAME = 'DOTATrain' # model # backbone pretrain_zoo = PretrainModelZoo() PRETRAINED_CKPT = pretrain_zoo.pretrain_weight_path(NET_NAME, ROOT_PATH) TRAINED_CKPT = os.path.join(ROOT_PATH, 'output/trained_weights') # bbox head ANGLE_RANGE = 180 # loss CLS_WEIGHT = 1.0 REG_WEIGHT = 1.0 / 5.0 REG_LOSS_MODE = None VERSION = 'RetinaNet_DOTA_1x_20210726' """ RetinaNet-H + theta=atan(sin(theta)/cos(theta)) + 180, sin^2(theta) + cos^2(theta) = 1 [-90, 90] sin in [-1, 1] cos in [0, 1] FLOPs: 485784881; Trainable params: 33051321 AP50:95: [0.6219588395799995, 0.5900819156180207, 0.5517010615222904, 0.4838942320308083, 0.4041809009083858, 0.29513475504257797, 0.1950400605938477, 0.10536651197643225, 0.042175716518712755, 0.0022298248960640693] mmAP: 0.32917638186871395 ++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++-- {'0.95': {'mAP': 0.0022298248960640693, 'storage-tank': 0.0101010101010101, 'ground-track-field': 0.0018181818181818182, 'tennis-court': 0.019762845849802372, 'baseball-diamond': 0.0, 'plane': 0.0009045680687471732, 'small-vehicle': 0.0, 'ship': 9.620009620009621e-05, 'harbor': 0.00012436264146250465, 'soccer-ball-field': 0.0, 'bridge': 0.0, 'large-vehicle': 0.0006402048655569782, 'basketball-court': 0.0, 'helicopter': 0.0, 'swimming-pool': 0.0, 'roundabout': 0.0}, '0.55': {'mAP': 0.5900819156180207, 'storage-tank': 0.7821167176986156, 'ground-track-field': 0.585923162177455, 'tennis-court': 0.89640544738318, 'baseball-diamond': 0.6409370785429295, 'plane': 0.8947763065481882, 'small-vehicle': 0.5225800235695158, 'ship': 0.6589287858729878, 'harbor': 0.42278808647875477, 'soccer-ball-field': 0.6168358732455926, 'bridge': 0.28673021434045987, 'large-vehicle': 0.443459314075796, 'basketball-court': 0.5860753133353813, 'helicopter': 0.39321579219288605, 'swimming-pool': 0.4966172021220622, 'roundabout': 0.623839416686508}, '0.65': {'mAP': 0.4838942320308083, 'storage-tank': 0.703686486850428, 'ground-track-field': 0.4582121295547346, 'tennis-court': 0.8929762974960739, 'baseball-diamond': 0.516330396851967, 'plane': 0.8820386553458407, 'small-vehicle': 0.4341109792559855, 'ship': 0.545882257415277, 'harbor': 0.23702298020522927, 'soccer-ball-field': 0.48594326905482227, 'bridge': 0.13793997570138036, 'large-vehicle': 0.3159858646685459, 'basketball-court': 0.5493799221023796, 'helicopter': 0.2644069261535571, 'swimming-pool': 0.3177772367426935, 'roundabout': 0.5167201030632094}, '0.8': {'mAP': 0.1950400605938477, 'storage-tank': 0.23437333952706677, 'ground-track-field': 0.26611867664499245, 'tennis-court': 0.763372516747552, 'baseball-diamond': 0.11260330578512397, 'plane': 0.4760154511924117, 'small-vehicle': 0.0705332644598394, 'ship': 0.16903432269060098, 'harbor': 0.015777610818933134, 'soccer-ball-field': 0.2528386156572064, 'bridge': 0.045454545454545456, 'large-vehicle': 0.04220779220779221, 'basketball-court': 0.22395577395577396, 'helicopter': 0.08682983682983683, 'swimming-pool': 0.020527859237536656, 'roundabout': 0.14595799769850404}, '0.7': {'mAP': 0.4041809009083858, 'storage-tank': 0.5713030835234201, 'ground-track-field': 0.4411286793357105, 'tennis-court': 0.8750232359772143, 'baseball-diamond': 0.3587099269790509, 'plane': 0.7775672061947545, 'small-vehicle': 0.31359852405275784, 'ship': 0.4820215706587658, 'harbor': 0.1638949393047754, 'soccer-ball-field': 0.4344227064365303, 'bridge': 0.08468408684059858, 'large-vehicle': 0.22843088785212995, 'basketball-court': 0.5295997338562823, 'helicopter': 0.1604646737537103, 'swimming-pool': 0.2158296016933543, 'roundabout': 0.42603465716673267}, 'mmAP': 0.32917638186871395, '0.85': {'mAP': 0.10536651197643225, 'storage-tank': 0.10199029604826304, 'ground-track-field': 0.12953474135292317, 'tennis-court': 0.5438413412390602, 'baseball-diamond': 0.045454545454545456, 'plane': 0.2016801962722456, 'small-vehicle': 0.045454545454545456, 'ship': 0.10533936357128913, 'harbor': 0.009767092411720512, 'soccer-ball-field': 0.13636363636363635, 'bridge': 0.011363636363636364, 'large-vehicle': 0.0087730451366815, 'basketball-court': 0.11842167759095656, 'helicopter': 0.045454545454545456, 'swimming-pool': 0.00974025974025974, 'roundabout': 0.06731875719217492}, '0.9': {'mAP': 0.042175716518712755, 'storage-tank': 0.028409090909090908, 'ground-track-field': 0.045454545454545456, 'tennis-court': 0.27613068993864825, 'baseball-diamond': 0.0048484848484848485, 'plane': 0.03693058210824708, 'small-vehicle': 0.0017575757575757577, 'ship': 0.09090909090909091, 'harbor': 0.002331002331002331, 'soccer-ball-field': 0.09090909090909091, 'bridge': 0.0, 'large-vehicle': 0.001918925401775006, 'basketball-court': 0.03409090909090909, 'helicopter': 0.0, 'swimming-pool': 0.0007639419404125286, 'roundabout': 0.018181818181818184}, '0.6': {'mAP': 0.5517010615222904, 'storage-tank': 0.7683112603670017, 'ground-track-field': 0.5278721455490211, 'tennis-court': 0.8961420380991326, 'baseball-diamond': 0.6077399640401626, 'plane': 0.8912951789284248, 'small-vehicle': 0.48169553694012035, 'ship': 0.6401545188085672, 'harbor': 0.3246909175564914, 'soccer-ball-field': 0.5525343072133332, 'bridge': 0.22316835013203135, 'large-vehicle': 0.3906635166271324, 'basketball-court': 0.5846588273927832, 'helicopter': 0.37095318043973435, 'swimming-pool': 0.42964586334191024, 'roundabout': 0.5859903173985088}, '0.75': {'mAP': 0.29513475504257797, 'storage-tank': 0.43778091624743337, 'ground-track-field': 0.3278443778443778, 'tennis-court': 0.7880930350773967, 'baseball-diamond': 0.17719101354088848, 'plane': 0.6489820655043292, 'small-vehicle': 0.18688721191247495, 'ship': 0.3141654459468437, 'harbor': 0.06063518693276478, 'soccer-ball-field': 0.36103287827425756, 'bridge': 0.05344859639338167, 'large-vehicle': 0.13618491201796437, 'basketball-court': 0.43017442167072706, 'helicopter': 0.11521531100478467, 'swimming-pool': 0.14012085535264343, 'roundabout': 0.249265097918402}, '0.5': {'mAP': 0.6219588395799995, 'storage-tank': 0.80839288248404, 'ground-track-field': 0.5945511971124983, 'tennis-court': 0.89640544738318, 'baseball-diamond': 0.6745779464169431, 'plane': 0.8960316622598585, 'small-vehicle': 0.5393852534010024, 'ship': 0.7264871486973908, 'harbor': 0.5127510533352412, 'soccer-ball-field': 0.6561298946271076, 'bridge': 0.34196740290156447, 'large-vehicle': 0.5099733378468009, 'basketball-court': 0.5916845976680699, 'helicopter': 0.4040989826472015, 'swimming-pool': 0.5368336801446979, 'roundabout': 0.6401121067743961}} """
137.653846
5,645
0.760687
817
7,158
6.597307
0.336597
0.022263
0.022263
0.03154
0.04193
0.032653
0.015584
0
0
0
0
0.444761
0.069293
7,158
51
5,646
140.352941
0.364305
0.0095
0
0
0
0
0.063922
0.052004
0
0
0
0
0
1
0
false
0
0.272727
0
0.272727
0.045455
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
1
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
967e01a90f8554f99516f7476aa71994fcd3d3e9
134
py
Python
site/thicc/apps/scape/apps.py
aldenjenkins/ThiccGaming
4790d2568b019438d1569d0fe4e9f9aba008b737
[ "BSD-3-Clause" ]
null
null
null
site/thicc/apps/scape/apps.py
aldenjenkins/ThiccGaming
4790d2568b019438d1569d0fe4e9f9aba008b737
[ "BSD-3-Clause" ]
9
2020-03-24T16:20:31.000Z
2022-03-11T23:32:38.000Z
site/thicc/apps/scape/apps.py
aldenjenkins/ThiccGaming
4790d2568b019438d1569d0fe4e9f9aba008b737
[ "BSD-3-Clause" ]
null
null
null
from __future__ import unicode_literals from django.apps import AppConfig class RunescapeConfig(AppConfig): name = 'runescape'
16.75
39
0.798507
15
134
6.8
0.8
0
0
0
0
0
0
0
0
0
0
0
0.149254
134
7
40
19.142857
0.894737
0
0
0
0
0
0.067164
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
96aa8cdd67bd0fd144ace6b2a284b6ed0df805a0
7,081
py
Python
tests/cpu/test_runtime_api_jit.py
Peach-He/intel-extension-for-pytorch
d3d4d2bc5e8637e251f49d70ae9982c4a1e65935
[ "Apache-2.0" ]
null
null
null
tests/cpu/test_runtime_api_jit.py
Peach-He/intel-extension-for-pytorch
d3d4d2bc5e8637e251f49d70ae9982c4a1e65935
[ "Apache-2.0" ]
null
null
null
tests/cpu/test_runtime_api_jit.py
Peach-He/intel-extension-for-pytorch
d3d4d2bc5e8637e251f49d70ae9982c4a1e65935
[ "Apache-2.0" ]
null
null
null
import unittest, copy import torch import torch.nn as nn import intel_extension_for_pytorch as ipex from common_utils import TestCase from torch.testing._internal.jit_utils import JitTestCase import time, sys from test_jit_llga_utils import JitLlgaTestCase, run_tests, LLGA_FUSION_GROUP import torch.fx.experimental.optimization as optimization class SimpleNet(torch.nn.Module): def __init__(self): super(SimpleNet, self).__init__() self.conv = torch.nn.Conv2d(64, 128, (3, 3), stride=(2, 2), padding=(1, 1), bias=False) def forward(self, x): x1 = self.conv(x) y = torch.flatten(x1, start_dim=1) return y class SimpleNet_v2(torch.nn.Module): def __init__(self): super(SimpleNet_v2, self).__init__() self.conv = torch.nn.Conv2d(3, 64, (3, 3), stride=(2, 2), padding=(1, 1), bias=False) self.conv2 = torch.nn.Conv2d(64, 64, (3, 3), stride=(2, 2), padding=(1, 1), bias=False) def forward(self, x): x1 = self.conv(x) x1 = self.conv2(x1) y = torch.flatten(x1, start_dim=1) return y class TestJitRuntimeAPI(JitTestCase): @unittest.skipIf(not ipex.cpu.runtime.is_runtime_ext_enabled(), "Skip when IPEX Runtime extension is not enabled") def test_trace_module(self): model = SimpleNet() model.eval() x = torch.rand(64, 64, 3, 3) # Calculate the reference result trace_model = torch.jit.trace(model, x) y = trace_model(x) # Create task cpu_pool = ipex.cpu.runtime.CPUPool(node_id=0) task = ipex.cpu.runtime.Task(trace_model, cpu_pool) # Task submit and get y_runtime_future = task(x) y_runtime = y_runtime_future.get() self.assertEqual(y, y_runtime) @unittest.skipIf(not ipex.cpu.runtime.is_runtime_ext_enabled(), "Skip when IPEX Runtime extension is not enabled") def test_sync_trace_module(self): model = SimpleNet() model.eval() x = torch.rand(64, 64, 3, 3) # Calculate the reference result trace_mode = torch.jit.trace(model, x) y = trace_mode(x) # Create task cpu_pool = ipex.cpu.runtime.CPUPool(node_id=0) task = ipex.cpu.runtime.Task(trace_mode, cpu_pool) # Task sync run y_runtime = task.run_sync(x) self.assertEqual(y, y_runtime) @unittest.skipIf(not ipex.cpu.runtime.is_runtime_ext_enabled(), "Skip when IPEX Runtime extension is not enabled") def test_bf16_task_core_bind(self): model = SimpleNet() model.eval() x = torch.rand(64, 64, 3, 3) # Calculate the reference result with torch.cpu.amp.autocast(enabled=True, dtype=torch.bfloat16), torch.no_grad(): trace_mode = torch.jit.trace(model, x) y = trace_mode(x) # Create task cpu_pool = ipex.cpu.runtime.CPUPool(node_id=0) task = ipex.cpu.runtime.Task(trace_mode, cpu_pool) # Task submit and wait y_runtime_future = task(x) y_runtime = y_runtime_future.get() self.assertEqual(y, y_runtime) @unittest.skipIf(not ipex.cpu.runtime.is_runtime_ext_enabled(), "Skip when IPEX Runtime extension is not enabled") def test_task_multi_submission(self): model = SimpleNet() model.eval() x = torch.rand(64, 64, 3, 3) # Calculate the reference result with torch.cpu.amp.autocast(enabled=True, dtype=torch.bfloat16), torch.no_grad(): trace_mode = torch.jit.trace(model, x) y = trace_mode(x) # Create task cpu_pool = ipex.cpu.runtime.CPUPool(node_id=0) task = ipex.cpu.runtime.Task(trace_mode, cpu_pool) # Submit task 3 times, then wait for result y_runtime = [] y_runtime_future = [] for i in range(3): y_runtime_future.append(task(x)) for item in y_runtime_future: y_runtime.append(item.get()) self.assertEqual(y, y_runtime[0]) self.assertEqual(y, y_runtime[1]) self.assertEqual(y, y_runtime[2]) @unittest.skipIf(not ipex.cpu.runtime.is_runtime_ext_enabled(), "Skip when IPEX Runtime extension is not enabled") def test_multi_stream_bf16_module(self): model = SimpleNet() model.eval() batch_size = ipex.cpu.runtime.get_core_list_of_node_id(0).__len__() x = torch.rand(batch_size, 64, 3, 3) num_streams = batch_size # Calculate the reference result with torch.cpu.amp.autocast(enabled=True, dtype=torch.bfloat16), torch.no_grad(): trace_model = torch.jit.trace(model, x) y = trace_model(x) # Create MultiStreamModule cpu_pool = ipex.cpu.runtime.CPUPool(node_id=0) multi_stream_model = ipex.cpu.runtime.MultiStreamModule(trace_model, num_streams=num_streams, cpu_pool=cpu_pool) y_runtime = multi_stream_model(x) self.assertEqual(y, y_runtime) @unittest.skipIf(not ipex.cpu.runtime.is_runtime_ext_enabled(), "Skip when IPEX Runtime extension is not enabled") def test_multi_stream_concat_output(self): model = SimpleNet() model.eval() batch_size = ipex.cpu.runtime.get_core_list_of_node_id(0).__len__() x = torch.rand(batch_size, 64, 3, 3) num_streams = batch_size # Calculate the reference result with torch.cpu.amp.autocast(enabled=True, dtype=torch.bfloat16), torch.no_grad(): trace_model = torch.jit.trace(model, x) # Create MultiStreamModule cpu_pool = ipex.cpu.runtime.CPUPool(node_id=0) multi_stream_model = ipex.cpu.runtime.MultiStreamModule(trace_model, num_streams=num_streams, cpu_pool=cpu_pool) y_runtime = multi_stream_model(x) # Create MultiStreamModule with concat_output=False multi_stream_model2 = ipex.cpu.runtime.MultiStreamModule(trace_model, num_streams=num_streams, cpu_pool=cpu_pool, concat_output=False) y_runtime2 = multi_stream_model2(x) self.assertEqual(y_runtime2.__len__(), num_streams) self.assertEqual(y_runtime, torch.cat(y_runtime2)) class TestLLGARuntimeAPI(JitLlgaTestCase): @unittest.skipIf(not ipex.cpu.runtime.is_runtime_ext_enabled(), "Skip when IPEX Runtime extension is not enabled") def test_int8_simpleNet_task_core_bind(self): with torch.no_grad(): model = SimpleNet_v2() model.eval() x = torch.rand(2, 3, 224, 224).contiguous(memory_format=torch.channels_last) # Calculate the reference result graph, m_llga, m_cpu = self.prepareModel(model, [x], folding=True, qscheme=torch.per_tensor_symmetric) y = m_llga(x) # Create task cpu_pool = ipex.cpu.runtime.CPUPool(node_id=0) task = ipex.cpu.runtime.Task(m_llga, cpu_pool) # Task submit and wait y_runtime_future = task(x) y_runtime = y_runtime_future.get() self.assertEqual(y, y_runtime) if __name__ == '__main__': test = unittest.main()
38.483696
142
0.657393
984
7,081
4.493902
0.147358
0.047038
0.075984
0.030755
0.760968
0.736318
0.728856
0.715739
0.698553
0.698553
0
0.021836
0.236831
7,081
183
143
38.693989
0.796447
0.069764
0
0.620155
0
0
0.051325
0
0
0
0
0
0.077519
1
0.085271
false
0
0.069767
0
0.20155
0
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
736f3280b963487dc9f2de292d6081975e3a8a5c
146
py
Python
Python/Tests/TestData/PydStdLib/Package/__init__.py
nanshuiyu/pytools
9f9271fe8cf564b4f94e9456d400f4306ea77c23
[ "Apache-2.0" ]
null
null
null
Python/Tests/TestData/PydStdLib/Package/__init__.py
nanshuiyu/pytools
9f9271fe8cf564b4f94e9456d400f4306ea77c23
[ "Apache-2.0" ]
null
null
null
Python/Tests/TestData/PydStdLib/Package/__init__.py
nanshuiyu/pytools
9f9271fe8cf564b4f94e9456d400f4306ea77c23
[ "Apache-2.0" ]
null
null
null
import Package._testcapi if False: from Package import EphemeralReference select = EphemeralReference select = 123 select = str
16.222222
43
0.726027
15
146
7
0.666667
0.457143
0
0
0
0
0
0
0
0
0
0.027027
0.239726
146
8
44
18.25
0.918919
0
0
0
0
0
0
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
7385509ed8199eda248959151aea9eb61dd42b33
38,649
py
Python
venv/lib/python3.6/site-packages/ansible_collections/netapp/ontap/tests/unit/plugins/modules/test_na_ontap_svm.py
usegalaxy-no/usegalaxy
75dad095769fe918eb39677f2c887e681a747f3a
[ "MIT" ]
1
2020-01-22T13:11:23.000Z
2020-01-22T13:11:23.000Z
venv/lib/python3.6/site-packages/ansible_collections/netapp/ontap/tests/unit/plugins/modules/test_na_ontap_svm.py
usegalaxy-no/usegalaxy
75dad095769fe918eb39677f2c887e681a747f3a
[ "MIT" ]
12
2020-02-21T07:24:52.000Z
2020-04-14T09:54:32.000Z
venv/lib/python3.6/site-packages/ansible_collections/netapp/ontap/tests/unit/plugins/modules/test_na_ontap_svm.py
usegalaxy-no/usegalaxy
75dad095769fe918eb39677f2c887e681a747f3a
[ "MIT" ]
null
null
null
# (c) 2018, NetApp, Inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ''' unit test template for ONTAP Ansible module ''' from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json import pytest from ansible.module_utils import basic from ansible.module_utils._text import to_bytes from ansible_collections.netapp.ontap.tests.unit.compat import unittest from ansible_collections.netapp.ontap.tests.unit.compat.mock import patch, Mock, call import ansible_collections.netapp.ontap.plugins.module_utils.netapp as netapp_utils from ansible_collections.netapp.ontap.plugins.modules.na_ontap_svm \ import NetAppOntapSVM as svm_module # module under test if not netapp_utils.has_netapp_lib(): pytestmark = pytest.mark.skip('skipping as missing required netapp_lib') # REST API canned responses when mocking send_request SRR = { # common responses 'is_rest': (200, dict(version=dict(generation=9, major=9, minor=1, full='dummy_9_9_1')), None), 'is_rest_96': (200, dict(version=dict(generation=9, major=6, minor=0, full='dummy_9_6_0')), None), 'is_zapi': (400, {}, "Unreachable"), 'empty_good': (200, {'num_records': 0}, None), 'end_of_sequence': (500, None, "Unexpected call to send_request"), 'generic_error': (400, None, "Expected error"), # module specific responses 'svm_record': (200, {'records': [{"uuid": "09e9fd5e-8ebd-11e9-b162-005056b39fe7", "name": "test_svm", "subtype": "default", "language": "c.utf_8", "aggregates": [{"name": "aggr_1", "uuid": "850dd65b-8811-4611-ac8c-6f6240475ff9"}, {"name": "aggr_2", "uuid": "850dd65b-8811-4611-ac8c-6f6240475ff9"}], "comment": "new comment", "ipspace": {"name": "ansible_ipspace", "uuid": "2b760d31-8dfd-11e9-b162-005056b39fe7"}, "snapshot_policy": {"uuid": "3b611707-8dfd-11e9-b162-005056b39fe7", "name": "old_snapshot_policy"}, "nfs": {"enabled": True, "allowed": True}, "cifs": {"enabled": False}, "iscsi": {"enabled": False}, "fcp": {"enabled": False}, "nvme": {"enabled": False}}]}, None), 'svm_record_ap': (200, {'records': [{"name": "test_svm", "aggregates": [{"name": "aggr_1", "uuid": "850dd65b-8811-4611-ac8c-6f6240475ff9"}, {"name": "aggr_2", "uuid": "850dd65b-8811-4611-ac8c-6f6240475ff9"}], "ipspace": {"name": "ansible_ipspace", "uuid": "2b760d31-8dfd-11e9-b162-005056b39fe7"}, "snapshot_policy": {"uuid": "3b611707-8dfd-11e9-b162-005056b39fe7", "name": "old_snapshot_policy"}, "nfs": {"enabled": False}, "cifs": {"enabled": True, "allowed": True}, "iscsi": {"enabled": True, "allowed": True}, "fcp": {"enabled": False}, "nvme": {"enabled": False}}]}, None), 'cli_record': (200, {'records': [{"max_volumes": 100, "allowed_protocols": ['nfs', 'iscsi']}]}, None) } def set_module_args(args): """prepare arguments so that they will be picked up during module creation""" args = json.dumps({'ANSIBLE_MODULE_ARGS': args}) basic._ANSIBLE_ARGS = to_bytes(args) # pylint: disable=protected-access class AnsibleExitJson(Exception): """Exception class to be raised by module.exit_json and caught by the test case""" class AnsibleFailJson(Exception): """Exception class to be raised by module.fail_json and caught by the test case""" def exit_json(*args, **kwargs): # pylint: disable=unused-argument """function to patch over exit_json; package return data into an exception""" if 'changed' not in kwargs: kwargs['changed'] = False raise AnsibleExitJson(kwargs) def fail_json(*args, **kwargs): # pylint: disable=unused-argument """function to patch over fail_json; package return data into an exception""" kwargs['failed'] = True raise AnsibleFailJson(kwargs) class MockONTAPConnection(object): ''' mock server connection to ONTAP host ''' def __init__(self, kind=None, data=None): ''' save arguments ''' self.type = kind self.params = data self.xml_in = None self.xml_out = None def invoke_successfully(self, xml, enable_tunneling): # pylint: disable=unused-argument ''' mock invoke_successfully returning xml data ''' self.xml_in = xml if self.type == 'vserver': xml = self.build_vserver_info(self.params) self.xml_out = xml return xml @staticmethod def build_vserver_info(vserver): ''' build xml data for vserser-info ''' xml = netapp_utils.zapi.NaElement('xml') data = {'num-records': 1, 'attributes-list': {'vserver-info': { 'vserver-name': vserver['name'], 'ipspace': vserver['ipspace'], 'root-volume': vserver['root_volume'], 'root-volume-aggregate': vserver['root_volume_aggregate'], 'language': vserver['language'], 'comment': vserver['comment'], 'snapshot-policy': vserver['snapshot_policy'], 'vserver-subtype': vserver['subtype'], 'allowed-protocols': [{'protocol': 'nfs'}, {'protocol': 'cifs'}], 'aggr-list': [{'aggr-name': 'aggr_1'}, {'aggr-name': 'aggr_2'}], }}} xml.translate_struct(data) return xml class TestMyModule(unittest.TestCase): ''' a group of related Unit Tests ''' def setUp(self): self.mock_module_helper = patch.multiple(basic.AnsibleModule, exit_json=exit_json, fail_json=fail_json) self.mock_module_helper.start() self.addCleanup(self.mock_module_helper.stop) self.server = MockONTAPConnection() self.mock_vserver = { 'name': 'test_svm', 'root_volume': 'ansible_vol', 'root_volume_aggregate': 'ansible_aggr', 'aggr_list': 'aggr_1,aggr_2', 'ipspace': 'ansible_ipspace', 'subtype': 'default', 'language': 'c.utf_8', 'snapshot_policy': 'old_snapshot_policy', 'comment': 'new comment' } def mock_args(self, rest=False): if rest: return {'name': self.mock_vserver['name'], 'aggr_list': self.mock_vserver['aggr_list'], 'ipspace': self.mock_vserver['ipspace'], 'comment': self.mock_vserver['comment'], 'subtype': 'default', 'hostname': 'test', 'username': 'test_user', 'password': 'test_pass!'} else: return { 'name': self.mock_vserver['name'], 'root_volume': self.mock_vserver['root_volume'], 'root_volume_aggregate': self.mock_vserver['root_volume_aggregate'], 'aggr_list': self.mock_vserver['aggr_list'], 'ipspace': self.mock_vserver['ipspace'], 'comment': self.mock_vserver['comment'], 'subtype': 'default', 'hostname': 'test', 'username': 'test_user', 'password': 'test_pass!', 'use_rest': 'never' } def get_vserver_mock_object(self, kind=None, data=None, cx_type='zapi'): """ Helper method to return an na_ontap_volume object :param kind: passes this param to MockONTAPConnection() :param data: passes this param to MockONTAPConnection() :return: na_ontap_volume object """ vserver_obj = svm_module() if cx_type == 'zapi': vserver_obj.asup_log_for_cserver = Mock(return_value=None) vserver_obj.cluster = Mock() vserver_obj.cluster.invoke_successfully = Mock() if kind is None: vserver_obj.server = MockONTAPConnection() elif data is None: vserver_obj.server = MockONTAPConnection(kind='vserver', data=self.mock_vserver) else: vserver_obj.server = MockONTAPConnection(kind='vserver', data=data) return vserver_obj def test_module_fail_when_required_args_missing(self): ''' required arguments are reported as errors ''' with pytest.raises(AnsibleFailJson) as exc: set_module_args({}) svm_module() print('Info: %s' % exc.value.args[0]['msg']) def test_get_nonexistent_vserver(self): ''' test if get_vserver() throws an error if vserver is not specified ''' data = self.mock_args() set_module_args(data) result = self.get_vserver_mock_object().get_vserver() assert result is None def test_create_error_missing_name(self): ''' Test if create throws an error if name is not specified''' data = self.mock_args() del data['name'] set_module_args(data) with pytest.raises(AnsibleFailJson) as exc: self.get_vserver_mock_object('vserver').create_vserver() msg = 'missing required arguments: name' assert exc.value.args[0]['msg'] == msg @patch('ansible_collections.netapp.ontap.plugins.modules.na_ontap_svm.NetAppOntapSVM.create_vserver') def test_successful_create(self, create_vserver): '''Test successful create''' data = self.mock_args() set_module_args(data) with pytest.raises(AnsibleExitJson) as exc: self.get_vserver_mock_object().apply() assert exc.value.args[0]['changed'] create_vserver.assert_called_with() def test_successful_create_zapi(self): '''Test successful create''' data = self.mock_args() set_module_args(data) with pytest.raises(AnsibleExitJson) as exc: self.get_vserver_mock_object().apply() assert exc.value.args[0]['changed'] @patch('ansible_collections.netapp.ontap.plugins.modules.na_ontap_svm.NetAppOntapSVM.create_vserver') def test_create_idempotency(self, create_vserver): '''Test successful create''' data = self.mock_args() set_module_args(data) with pytest.raises(AnsibleExitJson) as exc: self.get_vserver_mock_object('vserver').apply() assert not exc.value.args[0]['changed'] create_vserver.assert_not_called() def test_successful_delete(self): '''Test successful delete''' self._modify_options_with_expected_change('state', 'absent') @patch('ansible_collections.netapp.ontap.plugins.modules.na_ontap_svm.NetAppOntapSVM.delete_vserver') def test_delete_idempotency(self, delete_vserver): '''Test delete idempotency''' data = self.mock_args() data['state'] = 'absent' set_module_args(data) with pytest.raises(AnsibleExitJson) as exc: self.get_vserver_mock_object().apply() assert not exc.value.args[0]['changed'] delete_vserver.assert_not_called() @patch('ansible_collections.netapp.ontap.plugins.modules.na_ontap_svm.NetAppOntapSVM.get_vserver') def test_successful_rename(self, get_vserver): '''Test successful rename''' data = self.mock_args() data['from_name'] = 'test_svm' data['name'] = 'test_new_svm' set_module_args(data) current = { 'name': 'test_svm', 'root_volume': 'ansible_vol', 'root_volume_aggregate': 'ansible_aggr', 'ipspace': 'ansible_ipspace', 'subtype': 'default', 'language': 'c.utf_8' } get_vserver.side_effect = [ None, current ] with pytest.raises(AnsibleExitJson) as exc: self.get_vserver_mock_object().apply() assert exc.value.args[0]['changed'] def test_successful_modify_language(self): '''Test successful modify language''' self._modify_options_with_expected_change('language', 'c') def test_successful_modify_snapshot_policy(self): '''Test successful modify language''' self._modify_options_with_expected_change( 'snapshot_policy', 'new_snapshot_policy' ) def test_successful_modify_allowed_protocols(self): '''Test successful modify allowed protocols''' self._modify_options_with_expected_change( 'allowed_protocols', 'nvme,fcp' ) def test_successful_modify_aggr_list(self): '''Test successful modify aggr-list''' self._modify_options_with_expected_change( 'aggr_list', 'aggr_3,aggr_4' ) def _modify_options_with_expected_change(self, arg0, arg1): data = self.mock_args() data[arg0] = arg1 set_module_args(data) with pytest.raises(AnsibleExitJson) as exc: self.get_vserver_mock_object('vserver').apply() assert exc.value.args[0]['changed'] @patch('ansible_collections.netapp.ontap.plugins.module_utils.netapp.OntapRestAPI.send_request') def test_rest_error(self, mock_request): data = self.mock_args(rest=True) set_module_args(data) mock_request.side_effect = [ SRR['is_rest'], SRR['generic_error'], SRR['end_of_sequence'] ] with pytest.raises(AnsibleFailJson) as exc: self.get_vserver_mock_object(cx_type='rest').apply() assert exc.value.args[0]['msg'] == 'calling: svm/svms: got %s.' % SRR['generic_error'][2] @patch('ansible_collections.netapp.ontap.plugins.module_utils.netapp.OntapRestAPI.send_request') def test_rest_error_unsupported_parm(self, mock_request): data = self.mock_args(rest=True) data['use_rest'] = 'Always' data['root_volume'] = 'not_supported_by_rest' set_module_args(data) mock_request.side_effect = [ SRR['is_rest'], SRR['end_of_sequence'] ] with pytest.raises(AnsibleFailJson) as exc: self.get_vserver_mock_object(cx_type='rest').apply() assert exc.value.args[0]['msg'] == "REST API currently does not support 'root_volume'" @patch('ansible_collections.netapp.ontap.plugins.module_utils.netapp.OntapRestAPI.send_request') def test_rest_successfully_create(self, mock_request): data = self.mock_args(rest=True) data['state'] = 'present' set_module_args(data) mock_request.side_effect = [ SRR['is_rest'], SRR['empty_good'], # get SRR['empty_good'], # post SRR['end_of_sequence'] ] with pytest.raises(AnsibleExitJson) as exc: self.get_vserver_mock_object(cx_type='rest').apply() assert exc.value.args[0]['changed'] @patch('ansible_collections.netapp.ontap.plugins.module_utils.netapp.OntapRestAPI.send_request') def test_rest_create_idempotency(self, mock_request): data = self.mock_args(rest=True) data['state'] = 'present' set_module_args(data) mock_request.side_effect = [ SRR['is_rest'], SRR['svm_record'], # get SRR['end_of_sequence'] ] with pytest.raises(AnsibleExitJson) as exc: self.get_vserver_mock_object(cx_type='rest').apply() assert not exc.value.args[0]['changed'] @patch('ansible_collections.netapp.ontap.plugins.module_utils.netapp.OntapRestAPI.send_request') def test_rest_successful_delete(self, mock_request): '''Test successful delete''' data = self.mock_args(rest=True) data['state'] = 'absent' set_module_args(data) mock_request.side_effect = [ SRR['is_rest'], SRR['svm_record'], # get SRR['empty_good'], # delete SRR['end_of_sequence'] ] with pytest.raises(AnsibleExitJson) as exc: self.get_vserver_mock_object(cx_type='rest').apply() assert exc.value.args[0]['changed'] @patch('ansible_collections.netapp.ontap.plugins.module_utils.netapp.OntapRestAPI.send_request') def test_rest_delete_idempotency(self, mock_request): '''Test delete idempotency''' data = self.mock_args(rest=True) data['state'] = 'absent' set_module_args(data) mock_request.side_effect = [ SRR['is_rest'], SRR['empty_good'], # get SRR['end_of_sequence'] ] with pytest.raises(AnsibleExitJson) as exc: self.get_vserver_mock_object(cx_type='rest').apply() assert not exc.value.args[0]['changed'] @patch('ansible_collections.netapp.ontap.plugins.module_utils.netapp.OntapRestAPI.send_request') def test_rest_successful_rename(self, mock_request): '''Test successful rename''' data = self.mock_args(rest=True) data['from_name'] = 'test_svm' data['name'] = 'test_new_svm' set_module_args(data) mock_request.side_effect = [ SRR['is_rest'], SRR['svm_record'], # get SRR['svm_record'], # get SRR['empty_good'], # patch SRR['end_of_sequence'] ] with pytest.raises(AnsibleExitJson) as exc: self.get_vserver_mock_object(cx_type='rest').apply() assert exc.value.args[0]['changed'] @patch('ansible_collections.netapp.ontap.plugins.module_utils.netapp.OntapRestAPI.send_request') def test_rest_successful_modify_language(self, mock_request): '''Test successful modify language''' data = self.mock_args(rest=True) data['language'] = 'c' set_module_args(data) mock_request.side_effect = [ SRR['is_rest'], SRR['svm_record'], # get SRR['svm_record'], # get SRR['empty_good'], # patch SRR['end_of_sequence'] ] with pytest.raises(AnsibleExitJson) as exc: self.get_vserver_mock_object(cx_type='rest').apply() assert exc.value.args[0]['changed'] @patch('ansible_collections.netapp.ontap.plugins.module_utils.netapp.OntapRestAPI.send_request') def test_rest_successful_get(self, mock_request): '''Test successful get''' data = self.mock_args(rest=True) data['language'] = 'c' set_module_args(data) mock_request.side_effect = [ SRR['is_rest'], SRR['svm_record'], # get SRR['svm_record_ap'], # get AP SRR['end_of_sequence'] ] na_ontap_svm_object = self.get_vserver_mock_object(cx_type='rest') current = na_ontap_svm_object.get_vserver() print(current) assert current['services']['nfs']['allowed'] assert not current['services']['cifs']['enabled'] current = na_ontap_svm_object.get_vserver() print(current) assert not current['services']['nfs']['enabled'] assert current['services']['cifs']['allowed'] assert current['services']['iscsi']['allowed'] @patch('ansible_collections.netapp.ontap.plugins.module_utils.netapp.OntapRestAPI.send_request') def test_rest_successfully_create_ignore_zapi_option(self, mock_request): data = self.mock_args(rest=True) data['state'] = 'present' data['root_volume'] = 'whatever' data['aggr_list'] = '*' data['ignore_rest_unsupported_options'] = 'true' set_module_args(data) mock_request.side_effect = [ SRR['is_rest'], SRR['empty_good'], # get SRR['empty_good'], # post SRR['end_of_sequence'] ] module = self.get_vserver_mock_object(cx_type='rest') with pytest.raises(AnsibleExitJson) as exc: module.apply() assert exc.value.args[0]['changed'] assert module.use_rest @patch('ansible_collections.netapp.ontap.plugins.module_utils.netapp.OntapRestAPI.send_request') def test_rest_successfully_create_with_service(self, mock_request): data = self.mock_args(rest=True) data['state'] = 'present' data['services'] = {'nfs': {'allowed': True, 'enabled': True}} set_module_args(data) mock_request.side_effect = [ SRR['is_rest'], SRR['empty_good'], # get SRR['empty_good'], # post SRR['end_of_sequence'] ] module = self.get_vserver_mock_object(cx_type='rest') with pytest.raises(AnsibleExitJson) as exc: module.apply() assert exc.value.args[0]['changed'] assert module.use_rest @patch('ansible_collections.netapp.ontap.plugins.module_utils.netapp.OntapRestAPI.send_request') def test_rest_successfully_modify_with_service(self, mock_request): data = self.mock_args(rest=True) data['state'] = 'present' data['services'] = {'nfs': {'allowed': True, 'enabled': True}, 'fcp': {'allowed': True, 'enabled': True}} set_module_args(data) mock_request.side_effect = [ SRR['is_rest'], SRR['svm_record'], # get SRR['empty_good'], # patch svm for allowed SRR['empty_good'], # post to enable fcp service SRR['end_of_sequence'] ] module = self.get_vserver_mock_object(cx_type='rest') with pytest.raises(AnsibleExitJson) as exc: module.apply() assert exc.value.args[0]['changed'] assert module.use_rest expected = call('POST', 'protocols/san/fcp/services', {'return_timeout': 30}, json={'enabled': True, 'svm.name': 'test_svm'}, headers=None) print(mock_request.mock_calls) assert expected in mock_request.mock_calls @patch('ansible_collections.netapp.ontap.plugins.module_utils.netapp.OntapRestAPI.send_request') def test_rest_successfully_enable_service(self, mock_request): data = self.mock_args(rest=True) data['state'] = 'present' data['services'] = {'nfs': {'allowed': True, 'enabled': True}} set_module_args(data) mock_request.side_effect = [ SRR['is_rest'], SRR['empty_good'], # post to enable FCP SRR['end_of_sequence'] ] # modify = {'enabled_protocols': ['nfs', 'fcp']} # current = {'enabled_protocols': ['nfs'], 'disabled_protocols': ['fcp', 'iscsi', 'nvme'], 'uuid': 'uuid'} modify = {'services': {'nfs': {'allowed': True}, 'fcp': {'enabled': True}}} current = {'services': {'nfs': {'allowed': True}}, 'uuid': 'uuid'} module = self.get_vserver_mock_object(cx_type='rest') module.modify_services(modify, current) expected = call('POST', 'protocols/san/fcp/services', {'return_timeout': 30}, json={'enabled': True, 'svm.name': 'test_svm'}, headers=None) print(mock_request.mock_calls) assert expected in mock_request.mock_calls @patch('ansible_collections.netapp.ontap.plugins.module_utils.netapp.OntapRestAPI.send_request') def test_rest_successfully_reenable_service(self, mock_request): data = self.mock_args(rest=True) data['state'] = 'present' data['services'] = {'nfs': {'allowed': True, 'enabled': True}} set_module_args(data) mock_request.side_effect = [ SRR['is_rest'], SRR['empty_good'], # patch to reenable FCP SRR['end_of_sequence'] ] # modify = {'enabled_protocols': ['nfs', 'fcp']} fcp_dict = {'_links': {'self': {'href': 'fcp_link'}}} # current = {'enabled_protocols': ['nfs'], 'disabled_protocols': ['fcp', 'iscsi', 'nvme'], 'uuid': 'uuid', 'fcp': fcp_dict} modify = {'services': {'nfs': {'allowed': True}, 'fcp': {'enabled': True}}} current = {'services': {'nfs': {'allowed': True}}, 'uuid': 'uuid', 'fcp': fcp_dict} module = self.get_vserver_mock_object(cx_type='rest') module.modify_services(modify, current) expected = call('PATCH', 'protocols/san/fcp/services/uuid', {'return_timeout': 30}, json={'enabled': True}, headers=None) print(mock_request.mock_calls) assert expected in mock_request.mock_calls @patch('ansible_collections.netapp.ontap.plugins.module_utils.netapp.OntapRestAPI.send_request') def test_rest_negative_enable_service(self, mock_request): data = self.mock_args(rest=True) data['state'] = 'present' data['services'] = {'nfs': {'allowed': True, 'enabled': True}} set_module_args(data) mock_request.side_effect = [ SRR['is_rest'], SRR['empty_good'], # patch to reenable FCP SRR['end_of_sequence'] ] # modify = {'enabled_protocols': ['nfs', 'bad_value']} # current = {'enabled_protocols': ['nfs'], 'disabled_protocols': ['fcp', 'iscsi', 'nvme']} modify = {'services': {'nfs': {'allowed': True}, 'bad_value': {'enabled': True}}, 'name': 'new_name'} current = {'services': {'nfs': {'allowed': True}}, 'uuid': 'uuid'} module = self.get_vserver_mock_object(cx_type='rest') module.enablable_protocols = ['nfs', 'bad_value'] with pytest.raises(AnsibleFailJson) as exc: module.modify_services(modify, current) msg = 'Internal error, unexpecting service: bad_value.' assert exc.value.args[0]['msg'] == msg @patch('ansible_collections.netapp.ontap.plugins.module_utils.netapp.OntapRestAPI.send_request') def test_rest_negative_modify_services(self, mock_request): data = self.mock_args(rest=True) data['state'] = 'present' data['services'] = {'nfs': {'allowed': True, 'enabled': True}} set_module_args(data) mock_request.side_effect = [ SRR['is_rest'], SRR['generic_error'], # patch to reenable FCP SRR['end_of_sequence'] ] # modify = {'enabled_protocols': ['nfs', 'fcp']} # current = {'enabled_protocols': ['nfs'], 'disabled_protocols': ['fcp', 'iscsi', 'nvme'], 'uuid': 'uuid'} modify = {'services': {'nfs': {'allowed': True}, 'fcp': {'enabled': True}}, 'name': 'new_name'} current = {'services': {'nfs': {'allowed': True}}, 'uuid': 'uuid'} module = self.get_vserver_mock_object(cx_type='rest') with pytest.raises(AnsibleFailJson) as exc: module.modify_services(modify, current) msg = 'Error in modify service for fcp: calling: protocols/san/fcp/services: got Expected error.' assert exc.value.args[0]['msg'] == msg @patch('ansible_collections.netapp.ontap.plugins.module_utils.netapp.OntapRestAPI.send_request') def test_rest_negative_modify_current_none(self, mock_request): data = self.mock_args(rest=True) data['state'] = 'present' data['services'] = {'nfs': {'allowed': True, 'enabled': True}} set_module_args(data) mock_request.side_effect = [ SRR['is_rest'], SRR['end_of_sequence'] ] modify = {'enabled_protocols': ['nfs', 'fcp']} current = None module = self.get_vserver_mock_object(cx_type='rest') with pytest.raises(AnsibleFailJson) as exc: module.modify_vserver(modify, current) msg = 'Internal error, expecting SVM object in modify.' assert exc.value.args[0]['msg'] == msg @patch('ansible_collections.netapp.ontap.plugins.module_utils.netapp.OntapRestAPI.send_request') def test_rest_negative_modify_modify_none(self, mock_request): data = self.mock_args(rest=True) data['state'] = 'present' data['services'] = {'nfs': {'allowed': True, 'enabled': True}} set_module_args(data) mock_request.side_effect = [ SRR['is_rest'], SRR['end_of_sequence'] ] modify = {} current = {'enabled_protocols': ['nfs'], 'disabled_protocols': ['fcp', 'iscsi', 'nvme'], 'uuid': 'uuid'} module = self.get_vserver_mock_object(cx_type='rest') with pytest.raises(AnsibleFailJson) as exc: module.modify_vserver(modify, current) msg = 'Internal error, expecting something to modify in modify.' assert exc.value.args[0]['msg'] == msg @patch('ansible_collections.netapp.ontap.plugins.module_utils.netapp.OntapRestAPI.send_request') def test_rest_negative_modify_error_1(self, mock_request): data = self.mock_args(rest=True) data['state'] = 'present' data['services'] = {'nfs': {'allowed': True, 'enabled': True}} set_module_args(data) mock_request.side_effect = [ SRR['is_rest'], SRR['generic_error'], # patch to rename SRR['end_of_sequence'] ] # modify = {'enabled_protocols': ['nfs', 'fcp'], 'name': 'new_name'} # current = {'enabled_protocols': ['nfs'], 'disabled_protocols': ['fcp', 'iscsi', 'nvme'], 'uuid': 'uuid'} modify = {'services': {'nfs': {'allowed': True}, 'fcp': {'allowed': True}}, 'name': 'new_name'} current = {'services': {'nfs': {'allowed': True}}, 'uuid': 'uuid'} module = self.get_vserver_mock_object(cx_type='rest') with pytest.raises(AnsibleFailJson) as exc: module.modify_vserver(modify, current) msg = 'Error in rename: calling: svm/svms/uuid: got Expected error.' assert exc.value.args[0]['msg'] == msg @patch('ansible_collections.netapp.ontap.plugins.module_utils.netapp.OntapRestAPI.send_request') def test_rest_negative_modify_error_2(self, mock_request): data = self.mock_args(rest=True) data['state'] = 'present' data['services'] = {'nfs': {'allowed': True, 'enabled': True}} data['language'] = 'klingon' set_module_args(data) mock_request.side_effect = [ SRR['is_rest'], SRR['empty_good'], # patch to rename SRR['generic_error'], # patch for other options SRR['end_of_sequence'] ] modify = {'enabled_protocols': ['nfs', 'fcp'], 'name': 'new_name', 'language': 'klingon'} current = {'enabled_protocols': ['nfs'], 'disabled_protocols': ['fcp', 'iscsi', 'nvme'], 'uuid': 'uuid'} module = self.get_vserver_mock_object(cx_type='rest') with pytest.raises(AnsibleFailJson) as exc: module.modify_vserver(modify, current) msg = 'Error in modify: calling: svm/svms/uuid: got Expected error.' assert exc.value.args[0]['msg'] == msg # print(mock_request.mock_calls) @patch('ansible_collections.netapp.ontap.plugins.module_utils.netapp.OntapRestAPI.send_request') def test_rest_successfully_get_older_rest(self, mock_request): data = self.mock_args(rest=True) data['state'] = 'present' data['services'] = {'nfs': {'allowed': True, 'enabled': True}} set_module_args(data) mock_request.side_effect = [ SRR['is_rest_96'], SRR['svm_record'], # get SRR['empty_good'], # get using REST CLI SRR['end_of_sequence'] ] module = self.get_vserver_mock_object(cx_type='rest') details = module.get_vserver() expected = call('GET', 'private/cli/vserver', {'fields': 'allowed_protocols', 'vserver': 'test_svm'}, headers=None) print(mock_request.mock_calls) print(details) assert expected in mock_request.mock_calls @patch('ansible_collections.netapp.ontap.plugins.module_utils.netapp.OntapRestAPI.send_request') def test_rest_successfully_add_protocols_on_create(self, mock_request): data = self.mock_args(rest=True) data['state'] = 'present' data['services'] = {'nfs': {'allowed': True, 'enabled': True}} set_module_args(data) mock_request.side_effect = [ SRR['is_rest_96'], SRR['empty_good'], # get SRR['empty_good'], # POST for create SRR['empty_good'], # PATCH for add-protocols SRR['end_of_sequence'] ] module = self.get_vserver_mock_object(cx_type='rest') with pytest.raises(AnsibleExitJson) as exc: module.apply() expected = call('PATCH', 'private/cli/vserver/add-protocols', {'return_timeout': 30, 'vserver': 'test_svm'}, json={'protocols': ['nfs']}, headers=None) print(mock_request.mock_calls) assert expected in mock_request.mock_calls @patch('ansible_collections.netapp.ontap.plugins.module_utils.netapp.OntapRestAPI.send_request') def test_rest_successfully_add_remove_protocols_on_modify(self, mock_request): data = self.mock_args(rest=True) data['state'] = 'present' data['services'] = {'nfs': {'allowed': True, 'enabled': True}, 'iscsi': {'allowed': False}, 'fcp': {'allowed': True}} set_module_args(data) mock_request.side_effect = [ SRR['is_rest_96'], SRR['svm_record'], # get SRR['cli_record'], # get for protocols SRR['empty_good'], # PATCH for add-protocols SRR['empty_good'], # PATCH for remove-protocols SRR['end_of_sequence'] ] module = self.get_vserver_mock_object(cx_type='rest') with pytest.raises(AnsibleExitJson) as exc: module.apply() print(mock_request.mock_calls) expected = call('PATCH', 'private/cli/vserver/add-protocols', {'return_timeout': 30, 'vserver': 'test_svm'}, json={'protocols': ['fcp']}, headers=None) assert expected in mock_request.mock_calls expected = call('PATCH', 'private/cli/vserver/remove-protocols', {'return_timeout': 30, 'vserver': 'test_svm'}, json={'protocols': ['iscsi']}, headers=None) assert expected in mock_request.mock_calls @patch('ansible_collections.netapp.ontap.plugins.module_utils.netapp.OntapRestAPI.send_request') def test_rest_successfully_add_remove_protocols_on_modify_old_style(self, mock_request): data = self.mock_args(rest=True) data['state'] = 'present' data['allowed_protocols'] = ['nfs', 'fcp'] set_module_args(data) mock_request.side_effect = [ SRR['is_rest_96'], SRR['svm_record'], # get SRR['cli_record'], # get for protocols SRR['empty_good'], # PATCH for add-protocols SRR['empty_good'], # PATCH for remove-protocols SRR['end_of_sequence'] ] module = self.get_vserver_mock_object(cx_type='rest') with pytest.raises(AnsibleExitJson) as exc: module.apply() print(mock_request.mock_calls) expected = call('PATCH', 'private/cli/vserver/add-protocols', {'return_timeout': 30, 'vserver': 'test_svm'}, json={'protocols': ['fcp']}, headers=None) assert expected in mock_request.mock_calls expected = call('PATCH', 'private/cli/vserver/remove-protocols', {'return_timeout': 30, 'vserver': 'test_svm'}, json={'protocols': ['iscsi']}, headers=None) assert expected in mock_request.mock_calls @patch('ansible_collections.netapp.ontap.plugins.module_utils.netapp.OntapRestAPI.send_request') def test_validate_int_or_string_as_int(self, mock_request): data = self.mock_args(rest=True) data['state'] = 'present' data['services'] = {'nfs': {'allowed': True, 'enabled': True}} set_module_args(data) mock_request.side_effect = [ SRR['is_rest'], SRR['end_of_sequence'] ] modify = {} current = {'enabled_protocols': ['nfs'], 'disabled_protocols': ['fcp', 'iscsi', 'nvme'], 'uuid': 'uuid'} module = self.get_vserver_mock_object(cx_type='rest') module.validate_int_or_string('10', 'whatever') @patch('ansible_collections.netapp.ontap.plugins.module_utils.netapp.OntapRestAPI.send_request') def test_validate_int_or_string_as_str(self, mock_request): data = self.mock_args(rest=True) data['state'] = 'present' data['services'] = {'nfs': {'allowed': True, 'enabled': True}} set_module_args(data) mock_request.side_effect = [ SRR['is_rest'], SRR['end_of_sequence'] ] modify = {} current = {'enabled_protocols': ['nfs'], 'disabled_protocols': ['fcp', 'iscsi', 'nvme'], 'uuid': 'uuid'} module = self.get_vserver_mock_object(cx_type='rest') module.validate_int_or_string('whatever', 'whatever') @patch('ansible_collections.netapp.ontap.plugins.module_utils.netapp.OntapRestAPI.send_request') def test_negative_validate_int_or_string(self, mock_request): data = self.mock_args(rest=True) data['state'] = 'present' data['services'] = {'nfs': {'allowed': True, 'enabled': True}} set_module_args(data) mock_request.side_effect = [ SRR['is_rest'], SRR['end_of_sequence'] ] modify = {} current = {'enabled_protocols': ['nfs'], 'disabled_protocols': ['fcp', 'iscsi', 'nvme'], 'uuid': 'uuid'} module = self.get_vserver_mock_object(cx_type='rest') astring = 'testme' with pytest.raises(AnsibleFailJson) as exc: module.validate_int_or_string('10a', astring) msg = "expecting int value or '%s'" % astring assert msg in exc.value.args[0]['msg']
46.453125
159
0.601956
4,352
38,649
5.09398
0.079733
0.027787
0.021697
0.032478
0.784384
0.763138
0.73923
0.709189
0.689115
0.676395
0
0.011572
0.26218
38,649
831
160
46.509025
0.765851
0.077673
0
0.643258
0
0.001404
0.256048
0.097954
0
0
0
0
0.064607
1
0.070225
false
0.002809
0.01264
0
0.095506
0.016854
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
73a787b0b91377907da788cb5b3ca6ed14c0a3aa
7,475
py
Python
tests/units/transformers/test_per_column_imputer.py
shubhada-2019/tsfresh
ff69073bbb4df787fcbf277a611c6b40632e767d
[ "MIT" ]
6,596
2016-10-26T13:05:43.000Z
2022-03-31T04:12:38.000Z
tests/units/transformers/test_per_column_imputer.py
shubhada-2019/tsfresh
ff69073bbb4df787fcbf277a611c6b40632e767d
[ "MIT" ]
849
2016-10-26T13:52:09.000Z
2022-03-11T14:34:12.000Z
tests/units/transformers/test_per_column_imputer.py
shubhada-2019/tsfresh
ff69073bbb4df787fcbf277a611c6b40632e767d
[ "MIT" ]
1,113
2016-10-27T19:23:54.000Z
2022-03-31T15:59:49.000Z
# -*- coding: utf-8 -*- # This file as well as the whole tsfresh package are licenced under the MIT licence (see the LICENCE.txt) # Maximilian Christ (maximilianchrist.com), Blue Yonder Gmbh, 2016 import warnings from builtins import range from unittest import TestCase import numpy as np import numpy.testing as npt import pandas as pd import pandas.testing as pdt from sklearn.exceptions import NotFittedError from tsfresh.transformers.per_column_imputer import PerColumnImputer class PerColumnImputerTestCase(TestCase): def setUp(self): np.random.seed(0) def test_not_fitted(self): imputer = PerColumnImputer() X = pd.DataFrame() self.assertRaises(NotFittedError, imputer.transform, X) def test_only_nans_and_infs(self): imputer = PerColumnImputer() X = pd.DataFrame(index=list(range(100))) X["NaNs"] = np.nan * np.ones(100) X["PINF"] = np.PINF * np.ones(100) X["NINF"] = np.NINF * np.ones(100) with warnings.catch_warnings(record=True) as w: imputer.fit(X) self.assertEqual(len(w), 1) self.assertEqual( "The columns ['NaNs' 'PINF' 'NINF'] did not have any finite values. Filling with zeros.", str(w[0].message), ) selected_X = imputer.transform(X) self.assertTrue((selected_X.values == 0).all()) def test_with_numpy_array(self): imputer = PerColumnImputer() X = pd.DataFrame(index=list(range(100))) X["NaNs"] = np.nan * np.ones(100) X["PINF"] = np.PINF * np.ones(100) X["NINF"] = np.NINF * np.ones(100) X_numpy = X.values.copy() with warnings.catch_warnings(record=True) as w: imputer.fit(X) self.assertEqual(len(w), 1) self.assertEqual( "The columns ['NaNs' 'PINF' 'NINF'] did not have any finite values. Filling with zeros.", str(w[0].message), ) selected_X = imputer.transform(X) # re-initialize for new dicts imputer = PerColumnImputer() with warnings.catch_warnings(record=True) as w: imputer.fit(X_numpy) self.assertEqual(len(w), 1) self.assertEqual( "The columns [0 1 2] did not have any finite values. Filling with zeros.", str(w[0].message), ) selected_X_numpy = imputer.transform(X_numpy) npt.assert_array_equal(selected_X.values, selected_X_numpy.values) self.assertTrue(selected_X_numpy.shape, (1, 100)) def test_standard_replacement_behavior(self): imputer = PerColumnImputer() data = [np.NINF, np.PINF, np.nan, 100.0, -100.0, 1.0, 1.0] truth = [-100.0, 100.0, 1.0, 100.0, -100.0, 1.0, 1.0] X = pd.DataFrame({"a": data}) true_X = pd.DataFrame({"a": truth}) imputer.fit(X) selected_X = imputer.transform(X) pdt.assert_frame_equal(selected_X, true_X) def test_partial_preset_col_to_NINF_given(self): data = [np.NINF, np.PINF, np.nan, 100.0, -100.0, 1.0, 1.0] truth = [-100.0, 100.0, 1.0, 100.0, -100.0, 1.0, 1.0] X = pd.DataFrame({"a": data}) true_X = pd.DataFrame({"a": truth}) col_to_min = {"a": -100} imputer = PerColumnImputer(col_to_NINF_repl_preset=col_to_min) imputer.fit(X) selected_X = imputer.transform(X) pdt.assert_frame_equal(selected_X, true_X) def test_partial_preset_col_to_PINF_given(self): data = [np.NINF, np.PINF, np.nan, 100.0, -100.0, 1.0, 1.0] truth = [-100.0, 100.0, 1.0, 100.0, -100.0, 1.0, 1.0] X = pd.DataFrame({"a": data}) true_X = pd.DataFrame({"a": truth}) col_to_max = {"a": 100} imputer = PerColumnImputer(col_to_PINF_repl_preset=col_to_max) imputer.fit(X) selected_X = imputer.transform(X) pdt.assert_frame_equal(selected_X, true_X) def test_partial_preset_col_to_NAN_given(self): data = [np.NINF, np.PINF, np.nan, 100.0, -100.0, 1.0, 1.0] truth = [-100.0, 100.0, 1.0, 100.0, -100.0, 1.0, 1.0] X = pd.DataFrame({"a": data}) true_X = pd.DataFrame({"a": truth}) col_to_median = {"a": 1} imputer = PerColumnImputer(col_to_NAN_repl_preset=col_to_median) imputer.fit(X) selected_X = imputer.transform(X) pdt.assert_frame_equal(selected_X, true_X) def test_different_shapes_fitted_and_transformed(self): imputer = PerColumnImputer() X = pd.DataFrame(index=list(range(10))) X["a"] = np.ones(10) imputer.fit(X) X["b"] = np.ones(10) self.assertRaises(ValueError, imputer.transform, X) def test_preset_has_higher_priority_than_fit(self): data = [np.NINF, np.PINF, np.nan, 100.0, -100.0, 1.0, 1.0] truth = [-100.0, 100.0, 0.0, 100.0, -100.0, 1.0, 1.0] X = pd.DataFrame({"a": data}) true_X = pd.DataFrame({"a": truth}) col_to_median = {"a": 0} imputer = PerColumnImputer(col_to_NAN_repl_preset=col_to_median) imputer.fit(X) selected_X = imputer.transform(X) pdt.assert_frame_equal(selected_X, true_X) def test_only_parameters_of_last_fit_count(self): data = [np.NINF, np.PINF, np.nan, 100.0, -100.0, 1.0, 1.0] data_2 = [np.NINF, np.PINF, np.nan, 10.0, -10.0, 3.0, 3.0] truth_a = [-10.0, 10.0, 3.0, 10.0, -10.0, 3.0, 3.0] truth_b = [-10.0, 10.0, 3.0, 10.0, -10.0, 3.0, 3.0] X = pd.DataFrame({"a": data, "b": data}) X_2 = pd.DataFrame({"a": data_2, "b": data_2}) true_X = pd.DataFrame({"a": truth_a, "b": truth_b}) imputer = PerColumnImputer() imputer.fit(X) imputer.fit(X_2) selected_X = imputer.transform(X_2) pdt.assert_frame_equal(selected_X, true_X) def test_only_subset_of_columns_given(self): data = [np.NINF, np.PINF, np.nan, 100.0, -100.0, 1.0, 1.0] truth_a = [-100.0, 100.0, 0.0, 100.0, -100.0, 1.0, 1.0] truth_b = [-100.0, 100.0, 1.0, 100.0, -100.0, 1.0, 1.0] X = pd.DataFrame({"a": data, "b": data}) true_X = pd.DataFrame({"a": truth_a, "b": truth_b}) col_to_median = {"a": 0} imputer = PerColumnImputer(col_to_NAN_repl_preset=col_to_median) imputer.fit(X) selected_X = imputer.transform(X) pdt.assert_frame_equal(selected_X, true_X) def test_NINF_preset_contains_more_columns_than_dataframe_to_fit(self): X = pd.DataFrame(index=list(range(10))) X["a"] = np.ones(10) col_to_min = {"a": 0, "b": 0} imputer = PerColumnImputer(col_to_NINF_repl_preset=col_to_min) self.assertRaises(ValueError, imputer.fit, X) def test_PINF_preset_contains_more_columns_than_dataframe_to_fit(self): X = pd.DataFrame(index=list(range(10))) X["a"] = np.ones(10) col_to_max = {"a": 0, "b": 0} imputer = PerColumnImputer(col_to_PINF_repl_preset=col_to_max) self.assertRaises(ValueError, imputer.fit, X) def test_NAN_preset_contains_more_columns_than_dataframe_to_fit(self): X = pd.DataFrame(index=list(range(10))) X["a"] = np.ones(10) col_to_median = {"a": 0, "b": 0} imputer = PerColumnImputer(col_to_NAN_repl_preset=col_to_median) self.assertRaises(ValueError, imputer.fit, X)
32.359307
105
0.603746
1,125
7,475
3.816889
0.125333
0.039124
0.023055
0.039124
0.747788
0.729157
0.705636
0.705636
0.676293
0.653703
0
0.065853
0.254448
7,475
230
106
32.5
0.704647
0.029164
0
0.645161
0
0.012903
0.041782
0
0
0
0
0
0.135484
1
0.096774
false
0
0.058065
0
0.16129
0
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
73d8a8844a2208c89ea2b1f0603dc40c3a9a54eb
81
py
Python
doc/workshop/advancedReliability/inputs/goalFunction.py
rinelson456/raven
1114246136a2f72969e75b5e99a11b35500d4eef
[ "Apache-2.0" ]
159
2017-03-24T21:07:06.000Z
2022-03-20T13:44:40.000Z
doc/workshop/advancedReliability/inputs/goalFunction.py
rinelson456/raven
1114246136a2f72969e75b5e99a11b35500d4eef
[ "Apache-2.0" ]
1,667
2017-03-27T14:41:22.000Z
2022-03-31T19:50:06.000Z
doc/workshop/advancedReliability/inputs/goalFunction.py
rinelson456/raven
1114246136a2f72969e75b5e99a11b35500d4eef
[ "Apache-2.0" ]
95
2017-03-24T21:05:03.000Z
2022-03-08T17:30:22.000Z
def __residuumSign(self): if self.outcome == 0: return -1 else: return 1
16.2
25
0.654321
12
81
4.25
0.75
0.27451
0
0
0
0
0
0
0
0
0
0.048387
0.234568
81
4
26
20.25
0.774194
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0
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
1
0
0
0
0
0
0
0
4
73e2319af9d7750b7289eb5afb569e209c9d68cb
75
py
Python
peekpy/exception.py
Xeladem/PeekPy
cff6f73ff5d29a022e60f6927b3e188bb10186cd
[ "MIT" ]
null
null
null
peekpy/exception.py
Xeladem/PeekPy
cff6f73ff5d29a022e60f6927b3e188bb10186cd
[ "MIT" ]
null
null
null
peekpy/exception.py
Xeladem/PeekPy
cff6f73ff5d29a022e60f6927b3e188bb10186cd
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- class RedisServiceException(Exception): pass
12.5
39
0.653333
7
75
7
1
0
0
0
0
0
0
0
0
0
0
0.016393
0.186667
75
5
40
15
0.786885
0.28
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
4
73f6db17deb83073c79fa7b78872de4a6b4895b2
359
py
Python
regression_tests/parsers/c_parser/exprs/binary_ops/lt_op_expr.py
mehrdad-shokri/retdec-regression-tests-framework
9c3edcd0a7bc292a0d5b5cbfb4315010c78d3bc3
[ "MIT" ]
21
2017-12-12T20:38:43.000Z
2019-04-14T12:46:10.000Z
regression_tests/parsers/c_parser/exprs/binary_ops/lt_op_expr.py
mehrdad-shokri/retdec-regression-tests-framework
9c3edcd0a7bc292a0d5b5cbfb4315010c78d3bc3
[ "MIT" ]
6
2018-01-06T13:32:23.000Z
2018-09-14T15:09:11.000Z
regression_tests/parsers/c_parser/exprs/binary_ops/lt_op_expr.py
mehrdad-shokri/retdec-regression-tests-framework
9c3edcd0a7bc292a0d5b5cbfb4315010c78d3bc3
[ "MIT" ]
11
2017-12-12T20:38:46.000Z
2018-07-19T03:12:03.000Z
""" A less than operator (``<``). """ from regression_tests.parsers.c_parser.exprs.binary_ops.binary_op_expr import BinaryOpExpr class LtOpExpr(BinaryOpExpr): """A less than operator (``<``).""" def is_lt_op(self): """Returns ``True``.""" return True def __str__(self): return '{} < {}'.format(self.lhs, self.rhs)
21.117647
90
0.604457
43
359
4.790698
0.697674
0.048544
0.087379
0.165049
0
0
0
0
0
0
0
0
0.211699
359
16
91
22.4375
0.727915
0.214485
0
0
0
0
0.026923
0
0
0
0
0
0
1
0.333333
false
0
0.166667
0.166667
1
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4
fb75a8d72586d15a84032a5f168befdd13d16fc8
82
py
Python
src/hello_konsou/hello.py
konsou/packaging_tutorial
2e722a3a05043394087a122570ffddbe6f9a5550
[ "MIT" ]
null
null
null
src/hello_konsou/hello.py
konsou/packaging_tutorial
2e722a3a05043394087a122570ffddbe6f9a5550
[ "MIT" ]
null
null
null
src/hello_konsou/hello.py
konsou/packaging_tutorial
2e722a3a05043394087a122570ffddbe6f9a5550
[ "MIT" ]
null
null
null
def hello(): print(f"Hello, world!") if __name__ == '__main__': hello()
11.714286
27
0.573171
10
82
3.9
0.8
0
0
0
0
0
0
0
0
0
0
0
0.231707
82
6
28
13.666667
0.619048
0
0
0
0
0
0.256098
0
0
0
0
0
0
1
0.25
true
0
0
0
0.25
0.25
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
1
0
0
0
0
0
0
4
fb8b8af6e9c56325bc0d8d78bcb9f450f6b1bb77
2,148
py
Python
test/fields_identity_tests/test_emails.py
koppeltatyana/python_training
bc07671dcb85b783a13a6b00247e4500fc3c2265
[ "Apache-2.0" ]
null
null
null
test/fields_identity_tests/test_emails.py
koppeltatyana/python_training
bc07671dcb85b783a13a6b00247e4500fc3c2265
[ "Apache-2.0" ]
null
null
null
test/fields_identity_tests/test_emails.py
koppeltatyana/python_training
bc07671dcb85b783a13a6b00247e4500fc3c2265
[ "Apache-2.0" ]
null
null
null
from random import randrange import allure from model.contact import Contact def test_emails_on_home_page(app, db): if len(db.get_contact_list()) == 0: with allure.step("If contact's list is empty, I'll create a new contact"): app.contact.create(Contact(firstname="NAME")) with allure.step("Given an index for compering"): index = randrange(len(app.contact.get_contact_list())) with allure.step("Given contact's by index information from home page"): contact_from_home_page = app.contact.get_contact_list()[index] with allure.step("Given contact's by index information from edit page"): contact_from_edit_page = app.contact.get_contact_info_from_edit_page(index) with allure.step("Then the contact's emails from home page is equal to the contact's emails from edit page"): assert merge_emails_like_on_home_page(contact_from_edit_page) == contact_from_home_page.all_emails_from_home_page def test_emails_on_contact_view_page(app, db): if len(db.get_contact_list()) == 0: with allure.step("If contact's list is empty, I'll create a new contact"): app.contact.create(Contact(firstname="NAME")) with allure.step("Given an index for compering"): index = randrange(len(app.contact.get_contact_list())) with allure.step("Given contact's by index information from edit page"): contact_from_edit_page = app.contact.get_contact_info_from_edit_page(index) with allure.step("Given contact's by index information from view page"): contact_from_view_page = app.contact.get_contact_info_from_view_page(index) with allure.step("Then the contact's emails from edit page is equal to the contact's emails from view page"): assert merge_emails_like_on_home_page(contact_from_edit_page) == merge_emails_list_from_view_page(contact_from_view_page.all_emails_from_view_page) def merge_emails_like_on_home_page(contact): return "\n".join(filter(lambda x: x != "", [contact.email, contact.email2, contact.email3])) def merge_emails_list_from_view_page(lst): return "\n".join(filter(lambda x: x != "", lst))
53.7
155
0.743017
338
2,148
4.452663
0.177515
0.066445
0.093023
0.075748
0.854485
0.810631
0.782724
0.665781
0.665781
0.620598
0
0.002215
0.159218
2,148
39
156
55.076923
0.831118
0
0
0.451613
0
0
0.258845
0
0
0
0
0
0.064516
1
0.129032
false
0
0.096774
0.064516
0.290323
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
fbb88f7d6e3d8a3d0714008f462c4915499abc5e
42
py
Python
src/web-scrapers/config.py
CharlesFrankum/FF_Team_Selector
f230904faa6713dcec97e086e14eb7d841de9278
[ "Apache-2.0" ]
null
null
null
src/web-scrapers/config.py
CharlesFrankum/FF_Team_Selector
f230904faa6713dcec97e086e14eb7d841de9278
[ "Apache-2.0" ]
3
2021-03-31T19:24:31.000Z
2021-12-13T20:07:43.000Z
src/web-scrapers/config.py
CharlesFrankum/FF_Team_Selector
f230904faa6713dcec97e086e14eb7d841de9278
[ "Apache-2.0" ]
1
2019-08-08T06:46:13.000Z
2019-08-08T06:46:13.000Z
fantasy_email = '' fantasy_password = ''
14
22
0.690476
4
42
6.75
0.75
0
0
0
0
0
0
0
0
0
0
0
0.166667
42
2
23
21
0.771429
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0.5
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
4
83729fdd2780eaffe278a15aded511948991a2a4
778
py
Python
test_parse_license.py
hjwp/tdd-fridays
4c2fd8c7eb25d1ebb7c43e4fbd5ba550a23af448
[ "Unlicense" ]
2
2019-08-04T09:27:24.000Z
2019-09-06T10:48:08.000Z
test_parse_license.py
hjwp/tdd-fridays
4c2fd8c7eb25d1ebb7c43e4fbd5ba550a23af448
[ "Unlicense" ]
null
null
null
test_parse_license.py
hjwp/tdd-fridays
4c2fd8c7eb25d1ebb7c43e4fbd5ba550a23af448
[ "Unlicense" ]
null
null
null
import pytest from parse_license import parse, parse_one def test_no_children_sums_metadata(): assert parse('0 3 4 5 6') == 4 + 5 + 6 assert parse('0 2 0 7') == 7 def test_one_child(): assert parse('1 2 0 1 9 2 7') == 18 # @pytest.mark.xfail def test_two_child(): assert parse('2 2 0 1 9 0 3 6 6 6 2 7') == 9 + 6+6+6 + 2+7 def test_two_child(): assert parse_one([1, 0, 2, 2, 0 ,1 ,9 ,0 ,3 ,6 ,6 ,6 ,2 ,7]) == (9 + 6+6+6 + 2+7, []) def test_parse_one_for_no_children(): assert parse_one([0, 3, 4, 5, 6, 7, 8, 9]) == (4 + 5 + 6, [7, 8, 9]) assert parse_one([0, 3, 5, 6, 7, 8, 9, 10]) == (5 + 6 + 7, [8, 9, 10]) def test_parse_one_for_one_children(): assert parse_one([1, 3, 0, 2, 1, 1, 4, 5, 6, 7, 8, 9]) == (1 + 1 + 4 + 5 + 6, [7, 8, 9])
29.923077
92
0.551414
171
778
2.356725
0.175439
0.218362
0.044665
0.059553
0.503722
0.33995
0.163772
0.163772
0.124069
0.124069
0
0.188356
0.249357
778
26
93
29.923077
0.501712
0.023136
0
0.125
0
0
0.068511
0
0
0
0
0
0.5
1
0.375
true
0
0.125
0
0.5
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
1
1
0
0
0
0
0
0
4